Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Commit 6ab9fec

Browse files
Merge pull request #72 from chakra-ui/feature/prop-types
Feature/prop types
2 parents 4cb819d + 1269675 commit 6ab9fec

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+1063
-707
lines changed

.DS_Store

0 Bytes
Binary file not shown.

.changeset/orange-camels-doubt.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
'@chakra-ui/c-accordion': patch
3+
'@chakra-ui/c-alert': patch
4+
'@chakra-ui/c-button': patch
5+
'@chakra-ui/c-close-button': patch
6+
'@chakra-ui/c-code': patch
7+
'@chakra-ui/c-color-mode': patch
8+
'@chakra-ui/c-flex': patch
9+
'@chakra-ui/c-focus-lock': patch
10+
'@chakra-ui/c-icon': patch
11+
'@chakra-ui/c-modal': patch
12+
'@chakra-ui/c-motion': patch
13+
'@chakra-ui/c-popper': patch
14+
'@chakra-ui/c-portal': patch
15+
'@chakra-ui/c-reset': patch
16+
'@chakra-ui/c-scroll-lock': patch
17+
'@chakra-ui/c-spinner': patch
18+
'@chakra-ui/c-theme-provider': patch
19+
'@chakra-ui/c-visually-hidden': patch
20+
'@chakra-ui/vue-next': patch
21+
'@chakra-ui/vue-layout': patch
22+
'@chakra-ui/vue-system': patch
23+
'@chakra-ui/vue-theme': patch
24+
'@chakra-ui/vue-theme-tools': patch
25+
'@chakra-ui/vue-utils': patch
26+
'@chakra-ui/vue-a11y': patch
27+
'@chakra-ui/vue-composables': patch
28+
'@chakra-ui/vue-auto-import': patch
29+
'@chakra-ui/vue-docs': patch
30+
---
31+
32+
Migrated layout packages to TSX \nMigrate test suite to esbuild-jest runner. \nAdded intellisense support for Chakra UI Vue components

babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const baseConfig = function (api) {
2020
],
2121
'@babel/preset-typescript',
2222
]
23-
const plugins = ['@vue/babel-plugin-jsx']
23+
const plugins = ['@vue/babel-plugin-jsx', '@babel/plugin-transform-runtime']
2424

2525
return {
2626
presets,

components.d.ts

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
/**
2+
* Typescript support for @@chakra-ui/vue-next1.0.0-alpha.4 auto-imported
3+
* components using `vite-plugin-components`
4+
*
5+
* @see: https://github.com/antfu/vite-plugin-components#typescript
6+
*
7+
* This is a generated file. Do not edit it's contents.
8+
*
9+
* This file was generated on 2021-06-30T14:10:23.013Z
10+
*/
11+
12+
import { ChakraProps } from '@chakra-ui/vue-system'
13+
import { VNodeChild, HTMLAttributes } from 'vue'
14+
15+
export type JsxNode = VNodeChild | JSX.Element
16+
17+
export interface SlotDirective {
18+
[name: string]: () => JsxNode
19+
}
20+
21+
type JsxComponentCustomProps = {
22+
vModel?: unknown
23+
vModels?: unknown[]
24+
vCustom?: unknown[]
25+
vShow?: boolean
26+
vHtml?: JsxNode
27+
vSlots?: SlotDirective
28+
} & Omit<HTMLAttributes, 'innerHTML'> & {
29+
innerHTML?: JsxNode
30+
}
31+
32+
declare module 'vue' {
33+
/* Global component types for Volar auto-complete */
34+
export interface GlobalComponents {
35+
CAlert: typeof import('@chakra-ui/vue-next')['CAlert']
36+
CAlertTitle: typeof import('@chakra-ui/vue-next')['CAlertTitle']
37+
CAlertDescription: typeof import('@chakra-ui/vue-next')['CAlertDescription']
38+
CAlertIcon: typeof import('@chakra-ui/vue-next')['CAlertIcon']
39+
CButton: typeof import('@chakra-ui/vue-next')['CButton']
40+
CButtonGroup: typeof import('@chakra-ui/vue-next')['CButtonGroup']
41+
CIconButton: typeof import('@chakra-ui/vue-next')['CIconButton']
42+
CFocusLock: typeof import('@chakra-ui/vue-next')['CFocusLock']
43+
CAspectRatio: typeof import('@chakra-ui/vue-next')['CAspectRatio']
44+
CBadge: typeof import('@chakra-ui/vue-next')['CBadge']
45+
CBox: typeof import('@chakra-ui/vue-next')['CBox']
46+
CSquare: typeof import('@chakra-ui/vue-next')['CSquare']
47+
CCircle: typeof import('@chakra-ui/vue-next')['CCircle']
48+
CCenter: typeof import('@chakra-ui/vue-next')['CCenter']
49+
CContainer: typeof import('@chakra-ui/vue-next')['CContainer']
50+
CDivider: typeof import('@chakra-ui/vue-next')['CDivider']
51+
CGrid: typeof import('@chakra-ui/vue-next')['CGrid']
52+
CGridItem: typeof import('@chakra-ui/vue-next')['CGridItem']
53+
CHeading: typeof import('@chakra-ui/vue-next')['CHeading']
54+
CLink: typeof import('@chakra-ui/vue-next')['CLink']
55+
CLinkOverlay: typeof import('@chakra-ui/vue-next')['CLinkOverlay']
56+
CLinkBox: typeof import('@chakra-ui/vue-next')['CLinkBox']
57+
CList: typeof import('@chakra-ui/vue-next')['CList']
58+
COrderedList: typeof import('@chakra-ui/vue-next')['COrderedList']
59+
CUnorderedList: typeof import('@chakra-ui/vue-next')['CUnorderedList']
60+
CListItem: typeof import('@chakra-ui/vue-next')['CListItem']
61+
CListIcon: typeof import('@chakra-ui/vue-next')['CListIcon']
62+
CKbd: typeof import('@chakra-ui/vue-next')['CKbd']
63+
CSimpleGrid: typeof import('@chakra-ui/vue-next')['CSimpleGrid']
64+
CSpacer: typeof import('@chakra-ui/vue-next')['CSpacer']
65+
CStackDivider: typeof import('@chakra-ui/vue-next')['CStackDivider']
66+
CStackItem: typeof import('@chakra-ui/vue-next')['CStackItem']
67+
CStack: typeof import('@chakra-ui/vue-next')['CStack']
68+
CHStack: typeof import('@chakra-ui/vue-next')['CHStack']
69+
CVStack: typeof import('@chakra-ui/vue-next')['CVStack']
70+
CText: typeof import('@chakra-ui/vue-next')['CText']
71+
CModal: typeof import('@chakra-ui/vue-next')['CModal']
72+
CModalContent: typeof import('@chakra-ui/vue-next')['CModalContent']
73+
CModalOverlay: typeof import('@chakra-ui/vue-next')['CModalOverlay']
74+
CModalHeader: typeof import('@chakra-ui/vue-next')['CModalHeader']
75+
CModalBody: typeof import('@chakra-ui/vue-next')['CModalBody']
76+
CModalFooter: typeof import('@chakra-ui/vue-next')['CModalFooter']
77+
CModalCloseButton: typeof import('@chakra-ui/vue-next')['CModalCloseButton']
78+
CMotion: typeof import('@chakra-ui/vue-next')['CMotion']
79+
CPortal: typeof import('@chakra-ui/vue-next')['CPortal']
80+
CScrollLock: typeof import('@chakra-ui/vue-next')['CScrollLock']
81+
CVisuallyHidden: typeof import('@chakra-ui/vue-next')['CVisuallyHidden']
82+
CVisuallyHiddenInput: typeof import('@chakra-ui/vue-next')['CVisuallyHiddenInput']
83+
'chakra.a': typeof import('@chakra-ui/vue-next')['CBox']
84+
'chakra.b': typeof import('@chakra-ui/vue-next')['CBox']
85+
'chakra.article': typeof import('@chakra-ui/vue-next')['CBox']
86+
'chakra.aside': typeof import('@chakra-ui/vue-next')['CBox']
87+
'chakra.blockquote': typeof import('@chakra-ui/vue-next')['CBox']
88+
'chakra.button': typeof import('@chakra-ui/vue-next')['CBox']
89+
'chakra.caption': typeof import('@chakra-ui/vue-next')['CBox']
90+
'chakra.cite': typeof import('@chakra-ui/vue-next')['CBox']
91+
'chakra.circle': typeof import('@chakra-ui/vue-next')['CBox']
92+
'chakra.code': typeof import('@chakra-ui/vue-next')['CBox']
93+
'chakra.dd': typeof import('@chakra-ui/vue-next')['CBox']
94+
'chakra.div': typeof import('@chakra-ui/vue-next')['CBox']
95+
'chakra.dl': typeof import('@chakra-ui/vue-next')['CBox']
96+
'chakra.dt': typeof import('@chakra-ui/vue-next')['CBox']
97+
'chakra.fieldset': typeof import('@chakra-ui/vue-next')['CBox']
98+
'chakra.figcaption': typeof import('@chakra-ui/vue-next')['CBox']
99+
'chakra.figure': typeof import('@chakra-ui/vue-next')['CBox']
100+
'chakra.footer': typeof import('@chakra-ui/vue-next')['CBox']
101+
'chakra.form': typeof import('@chakra-ui/vue-next')['CBox']
102+
'chakra.h1': typeof import('@chakra-ui/vue-next')['CBox']
103+
'chakra.h2': typeof import('@chakra-ui/vue-next')['CBox']
104+
'chakra.h3': typeof import('@chakra-ui/vue-next')['CBox']
105+
'chakra.h4': typeof import('@chakra-ui/vue-next')['CBox']
106+
'chakra.h5': typeof import('@chakra-ui/vue-next')['CBox']
107+
'chakra.h6': typeof import('@chakra-ui/vue-next')['CBox']
108+
'chakra.header': typeof import('@chakra-ui/vue-next')['CBox']
109+
'chakra.hr': typeof import('@chakra-ui/vue-next')['CBox']
110+
'chakra.iframe': typeof import('@chakra-ui/vue-next')['CBox']
111+
'chakra.img': typeof import('@chakra-ui/vue-next')['CBox']
112+
'chakra.input': typeof import('@chakra-ui/vue-next')['CBox']
113+
'chakra.kbd': typeof import('@chakra-ui/vue-next')['CBox']
114+
'chakra.label': typeof import('@chakra-ui/vue-next')['CBox']
115+
'chakra.li': typeof import('@chakra-ui/vue-next')['CBox']
116+
'chakra.mark': typeof import('@chakra-ui/vue-next')['CBox']
117+
'chakra.main': typeof import('@chakra-ui/vue-next')['CBox']
118+
'chakra.nav': typeof import('@chakra-ui/vue-next')['CBox']
119+
'chakra.ol': typeof import('@chakra-ui/vue-next')['CBox']
120+
'chakra.p': typeof import('@chakra-ui/vue-next')['CBox']
121+
'chakra.path': typeof import('@chakra-ui/vue-next')['CBox']
122+
'chakra.pre': typeof import('@chakra-ui/vue-next')['CBox']
123+
'chakra.q': typeof import('@chakra-ui/vue-next')['CBox']
124+
'chakra.rect': typeof import('@chakra-ui/vue-next')['CBox']
125+
'chakra.s': typeof import('@chakra-ui/vue-next')['CBox']
126+
'chakra.svg': typeof import('@chakra-ui/vue-next')['CBox']
127+
'chakra.section': typeof import('@chakra-ui/vue-next')['CBox']
128+
'chakra.select': typeof import('@chakra-ui/vue-next')['CBox']
129+
'chakra.strong': typeof import('@chakra-ui/vue-next')['CBox']
130+
'chakra.small': typeof import('@chakra-ui/vue-next')['CBox']
131+
'chakra.span': typeof import('@chakra-ui/vue-next')['CBox']
132+
'chakra.sub': typeof import('@chakra-ui/vue-next')['CBox']
133+
'chakra.sup': typeof import('@chakra-ui/vue-next')['CBox']
134+
'chakra.table': typeof import('@chakra-ui/vue-next')['CBox']
135+
'chakra.tbody': typeof import('@chakra-ui/vue-next')['CBox']
136+
'chakra.td': typeof import('@chakra-ui/vue-next')['CBox']
137+
'chakra.textarea': typeof import('@chakra-ui/vue-next')['CBox']
138+
'chakra.tfoot': typeof import('@chakra-ui/vue-next')['CBox']
139+
'chakra.th': typeof import('@chakra-ui/vue-next')['CBox']
140+
'chakra.thead': typeof import('@chakra-ui/vue-next')['CBox']
141+
'chakra.tr': typeof import('@chakra-ui/vue-next')['CBox']
142+
'chakra.ul': typeof import('@chakra-ui/vue-next')['CBox']
143+
}
144+
145+
/* Component custom props types for JSX and TSX auto complete */
146+
export interface ComponentCustomProps
147+
extends JsxComponentCustomProps,
148+
ChakraProps {
149+
onClick?: () => any
150+
vSlots?: {
151+
[eleName: string]: JSX.Element
152+
}
153+
}
154+
}

jest.config.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
module.exports = {
22
transform: {
3-
'^.+\\.(ts|tsx|js|jsx)$': 'ts-jest/dist',
3+
'^.+\\.(ts|tsx)$': [
4+
'esbuild-jest',
5+
{
6+
jsxFactory: 'h',
7+
jsxFragment: 'Fragment',
8+
sourcemap: true,
9+
target: 'es2020',
10+
},
11+
],
412
},
513
transformIgnorePatterns: ['/node_modules/(?!@popperjs/.*|lodash.)'],
614
moduleNameMapper: {
715
'^@/(.*)$': '<rootDir>/$1',
816
'@chakra-ui/vue-test-utils': '<rootDir>/packages/test-utils/src/index.ts',
917
},
18+
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
1019
snapshotSerializers: [
1120
'@chakra-ui/vue-test-utils/dist/cjs/snapshot-serializer.js',
1221
],
1322
testMatch: ['**/**/*.test.(js|jsx|ts|tsx)'],
14-
globals: {
15-
'ts-jest': {
16-
tsconfig: 'tsconfig.json',
17-
},
18-
},
1923
}

package.json

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"dependencies": {
4040
"@babel/cli": "^7.12.8",
4141
"@babel/core": "^7.12.9",
42+
"@babel/plugin-transform-runtime": "^7.13.15",
4243
"@babel/preset-env": "^7.12.7",
4344
"@babel/preset-typescript": "^7.12.7",
4445
"@chakra-ui/styled-system": "^1.10.0",
@@ -47,6 +48,9 @@
4748
"@changesets/cli": "^2.14.1",
4849
"@commitlint/cli": "^11.0.0",
4950
"@commitlint/config-conventional": "^11.0.0",
51+
"@cypress/snapshot": "^2.1.7",
52+
"@cypress/vite-dev-server": "^1.2.6",
53+
"@cypress/vue": "^3.0.1",
5054
"@emotion/css": "^11.1.3",
5155
"@emotion/server": "^11.0.0",
5256
"@manypkg/cli": "^0.17.0",
@@ -55,6 +59,7 @@
5559
"@testing-library/user-event": "^12.6.2",
5660
"@testing-library/vue": "^6.3.4",
5761
"@types/body-scroll-lock": "^2.6.1",
62+
"@types/eslint": "^7.2.13",
5863
"@types/jest": "^26.0.20",
5964
"@types/jest-axe": "^3.5.1",
6065
"@types/lodash.camelcase": "^4.3.6",
@@ -68,6 +73,7 @@
6873
"@vue/babel-plugin-jsx": "^1.0.3",
6974
"@vue/compiler-sfc": "^3.0.11",
7075
"@vue/eslint-config-typescript": "^5.1.0",
76+
"@vue/test-utils": "^2.0.0-rc.6",
7177
"@vuedx/typecheck": "^0.4.1",
7278
"@vuedx/typescript-plugin-vue": "^0.4.1",
7379
"@vueuse/core": "4.9.1",
@@ -84,9 +90,14 @@
8490
"cross-env": "^7.0.2",
8591
"css-get-unit": "^1.0.1",
8692
"csstype": "^3.0.5",
93+
"cypress": "^7.2.0",
94+
"cypress-commands": "^1.1.0",
95+
"cypress-plugin-tab": "^1.0.5",
8796
"dequal": "^2.0.2",
8897
"dom-focus-lock": "^1.0.4",
89-
"esbuild-jest": "^0.4.0",
98+
"esbuild": "^0.12.12",
99+
"esbuild-jest": "0.4.0",
100+
"esbuild-plugin-babel": "^0.2.3",
90101
"eslint": "^7.0.0",
91102
"eslint-config-prettier": "^6.12.0",
92103
"eslint-config-standard": "^14.1.1",
@@ -106,6 +117,7 @@
106117
"jest-transform-stub": "^2.0.0",
107118
"lerna": "^3.22.1",
108119
"lint-staged": "^10.5.3",
120+
"local-cypress": "^1.2.1",
109121
"lodash.camelcase": "^4.3.0",
110122
"lodash.kebabcase": "^4.1.1",
111123
"lodash.mergewith": "^4.6.2",
@@ -118,7 +130,7 @@
118130
"ts-jest": "^26.5.0",
119131
"ts-node": "^9.0.0",
120132
"typescript": "^4.1.3",
121-
"vite": "2.2.4",
133+
"vite": "^2.3.8",
122134
"vite-plugin-components": "^0.8.3",
123135
"vite-plugin-pages": "^0.9.2",
124136
"vitepress": "^0.12.0",
@@ -127,16 +139,5 @@
127139
"vue-prism-editor": "^2.0.0-alpha.2",
128140
"vue-router": "^4.0.6",
129141
"vue3-perfect-scrollbar": "^1.5.5"
130-
},
131-
"devDependencies": {
132-
"@babel/plugin-transform-runtime": "^7.13.15",
133-
"@cypress/snapshot": "^2.1.7",
134-
"@cypress/vite-dev-server": "^1.2.6",
135-
"@cypress/vue": "^3",
136-
"@vue/test-utils": "^2.0.0-rc.6",
137-
"cypress": "^7.2.0",
138-
"cypress-commands": "^1.1.0",
139-
"cypress-plugin-tab": "^1.0.5",
140-
"local-cypress": "^1.2.1"
141142
}
142143
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
<template>
22
<c-alert> HELLO ALERT </c-alert>
33
</template>
4+
5+
<script lang="ts" setup>
6+
import { CDivider } from '../../layout/src'
7+
</script>

packages/c-alert/package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@
3434
"@chakra-ui/vue-utils": "0.1.0-alpha.2"
3535
},
3636
"devDependencies": {
37-
"vue": ">=3.0.5"
38-
},
39-
"peerDependencies": {
40-
"@chakra-ui/vue-system": "0.1.0-alpha.2",
41-
"vue": "^3.0.5"
37+
"vue": "^3.0.11"
4238
}
4339
}

packages/c-button/package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@
3636
"@chakra-ui/vue-utils": "0.1.0-alpha.2"
3737
},
3838
"devDependencies": {
39-
"vue": ">=3.0.5"
40-
},
41-
"peerDependencies": {
42-
"@chakra-ui/vue-system": "0.1.0-alpha.2",
43-
"vue": "^3.0.5"
39+
"vue": "^3.0.11"
4440
}
4541
}

packages/c-close-button/package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,7 @@
4242
"@chakra-ui/vue-system": "0.1.0-alpha.2",
4343
"@chakra-ui/vue-utils": "0.1.0-alpha.2"
4444
},
45-
"peerDependencies": {
46-
"vue": ">=3.0.5"
47-
},
4845
"devDependencies": {
49-
"vue": ">=3.0.5"
46+
"vue": "^3.0.11"
5047
}
5148
}

0 commit comments

Comments
 (0)