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

Commit e14180f

Browse files
committed
feat: create tests
1 parent 2a2be21 commit e14180f

File tree

14 files changed

+192
-1164
lines changed

14 files changed

+192
-1164
lines changed

components.d.ts

Lines changed: 77 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
/**
22
* Typescript support for @@chakra-ui/vue-next1.0.0-alpha.7 auto-imported
3-
* components using `vite-plugin-components`
3+
* components using `unplugin-vue-components,`
44
*
5-
* @see: https://github.com/antfu/vite-plugin-components#typescript
5+
* @see: https://github.com/antfu/unplugin-vue-components/#typescript
66
*
77
* This is a generated file. Do not edit it's contents.
88
*
9-
* This file was generated on 2021-08-24T10:32:03.469Z
9+
* This file was generated on 2021-11-03T18:37:59.029Z
1010
*/
1111

1212
import { ChakraProps } from '@chakra-ui/vue-system'
1313
import { VNodeChild, HTMLAttributes } from 'vue'
1414

1515
export type JsxNode = VNodeChild | JSX.Element
1616

17+
type EventHandler = (...args: any[]) => void
18+
1719
export interface SlotDirective {
1820
[name: string]: () => JsxNode
1921
}
@@ -39,69 +41,74 @@ declare module 'vue' {
3941
/* Global component types for Volar auto-complete */
4042
export interface GlobalComponents {
4143
CAlert: typeof import('@chakra-ui/vue-next')['CAlert']
42-
CAlertTitle: typeof import('@chakra-ui/vue-next')['CAlertTitle']
4344
CAlertDescription: typeof import('@chakra-ui/vue-next')['CAlertDescription']
4445
CAlertIcon: typeof import('@chakra-ui/vue-next')['CAlertIcon']
46+
CAlertTitle: typeof import('@chakra-ui/vue-next')['CAlertTitle']
4547
CBreadcrumb: typeof import('@chakra-ui/vue-next')['CBreadcrumb']
46-
CBreadcrumbSeparator: typeof import('@chakra-ui/vue-next')['CBreadcrumbSeparator']
4748
CBreadcrumbItem: typeof import('@chakra-ui/vue-next')['CBreadcrumbItem']
4849
CBreadcrumbLink: typeof import('@chakra-ui/vue-next')['CBreadcrumbLink']
50+
CBreadcrumbSeparator: typeof import('@chakra-ui/vue-next')['CBreadcrumbSeparator']
4951
CButton: typeof import('@chakra-ui/vue-next')['CButton']
5052
CButtonGroup: typeof import('@chakra-ui/vue-next')['CButtonGroup']
5153
CIconButton: typeof import('@chakra-ui/vue-next')['CIconButton']
5254
CFocusLock: typeof import('@chakra-ui/vue-next')['CFocusLock']
55+
CFormErrorIcon: typeof import('@chakra-ui/vue-next')['CFormErrorIcon']
56+
CFormErrorMessage: typeof import('@chakra-ui/vue-next')['CFormErrorMessage']
57+
CFormLabel: typeof import('@chakra-ui/vue-next')['CFormLabel']
58+
CRequiredIndicator: typeof import('@chakra-ui/vue-next')['CRequiredIndicator']
59+
CInput: typeof import('@chakra-ui/vue-next')['CInput']
5360
CAspectRatio: typeof import('@chakra-ui/vue-next')['CAspectRatio']
5461
CBadge: typeof import('@chakra-ui/vue-next')['CBadge']
5562
CBox: typeof import('@chakra-ui/vue-next')['CBox']
56-
CSquare: typeof import('@chakra-ui/vue-next')['CSquare']
57-
CCircle: typeof import('@chakra-ui/vue-next')['CCircle']
5863
CCenter: typeof import('@chakra-ui/vue-next')['CCenter']
64+
CCircle: typeof import('@chakra-ui/vue-next')['CCircle']
5965
CContainer: typeof import('@chakra-ui/vue-next')['CContainer']
6066
CDivider: typeof import('@chakra-ui/vue-next')['CDivider']
6167
CGrid: typeof import('@chakra-ui/vue-next')['CGrid']
6268
CGridItem: typeof import('@chakra-ui/vue-next')['CGridItem']
69+
CHStack: typeof import('@chakra-ui/vue-next')['CHStack']
6370
CHeading: typeof import('@chakra-ui/vue-next')['CHeading']
71+
CKbd: typeof import('@chakra-ui/vue-next')['CKbd']
6472
CLink: typeof import('@chakra-ui/vue-next')['CLink']
65-
CLinkOverlay: typeof import('@chakra-ui/vue-next')['CLinkOverlay']
6673
CLinkBox: typeof import('@chakra-ui/vue-next')['CLinkBox']
74+
CLinkOverlay: typeof import('@chakra-ui/vue-next')['CLinkOverlay']
6775
CList: typeof import('@chakra-ui/vue-next')['CList']
68-
COrderedList: typeof import('@chakra-ui/vue-next')['COrderedList']
69-
CUnorderedList: typeof import('@chakra-ui/vue-next')['CUnorderedList']
70-
CListItem: typeof import('@chakra-ui/vue-next')['CListItem']
7176
CListIcon: typeof import('@chakra-ui/vue-next')['CListIcon']
72-
CKbd: typeof import('@chakra-ui/vue-next')['CKbd']
77+
CListItem: typeof import('@chakra-ui/vue-next')['CListItem']
78+
COrderedList: typeof import('@chakra-ui/vue-next')['COrderedList']
7379
CSimpleGrid: typeof import('@chakra-ui/vue-next')['CSimpleGrid']
7480
CSpacer: typeof import('@chakra-ui/vue-next')['CSpacer']
81+
CSquare: typeof import('@chakra-ui/vue-next')['CSquare']
82+
CStack: typeof import('@chakra-ui/vue-next')['CStack']
7583
CStackDivider: typeof import('@chakra-ui/vue-next')['CStackDivider']
7684
CStackItem: typeof import('@chakra-ui/vue-next')['CStackItem']
77-
CStack: typeof import('@chakra-ui/vue-next')['CStack']
78-
CHStack: typeof import('@chakra-ui/vue-next')['CHStack']
79-
CVStack: typeof import('@chakra-ui/vue-next')['CVStack']
8085
CText: typeof import('@chakra-ui/vue-next')['CText']
81-
CModal: typeof import('@chakra-ui/vue-next')['CModal']
82-
CModalContent: typeof import('@chakra-ui/vue-next')['CModalContent']
83-
CModalOverlay: typeof import('@chakra-ui/vue-next')['CModalOverlay']
84-
CModalHeader: typeof import('@chakra-ui/vue-next')['CModalHeader']
85-
CModalBody: typeof import('@chakra-ui/vue-next')['CModalBody']
86-
CModalFooter: typeof import('@chakra-ui/vue-next')['CModalFooter']
87-
CModalCloseButton: typeof import('@chakra-ui/vue-next')['CModalCloseButton']
88-
CDrawer: typeof import('@chakra-ui/vue-next')['CDrawer']
89-
CDrawerContent: typeof import('@chakra-ui/vue-next')['CDrawerContent']
90-
CDrawerBody: typeof import('@chakra-ui/vue-next')['CDrawerBody']
91-
CDrawerCloseButton: typeof import('@chakra-ui/vue-next')['CDrawerCloseButton']
92-
CDrawerFooter: typeof import('@chakra-ui/vue-next')['CDrawerFooter']
93-
CDrawerHeader: typeof import('@chakra-ui/vue-next')['CDrawerHeader']
94-
CDrawerOverlay: typeof import('@chakra-ui/vue-next')['CDrawerOverlay']
86+
CUnorderedList: typeof import('@chakra-ui/vue-next')['CUnorderedList']
87+
CVStack: typeof import('@chakra-ui/vue-next')['CVStack']
9588
CAlertDialog: typeof import('@chakra-ui/vue-next')['CAlertDialog']
96-
CAlertDialogContent: typeof import('@chakra-ui/vue-next')['CAlertDialogContent']
9789
CAlertDialogBody: typeof import('@chakra-ui/vue-next')['CAlertDialogBody']
9890
CAlertDialogCloseButton: typeof import('@chakra-ui/vue-next')['CAlertDialogCloseButton']
91+
CAlertDialogContent: typeof import('@chakra-ui/vue-next')['CAlertDialogContent']
9992
CAlertDialogFooter: typeof import('@chakra-ui/vue-next')['CAlertDialogFooter']
10093
CAlertDialogHeader: typeof import('@chakra-ui/vue-next')['CAlertDialogHeader']
10194
CAlertDialogOverlay: typeof import('@chakra-ui/vue-next')['CAlertDialogOverlay']
102-
CMotion: typeof import('@chakra-ui/vue-next')['CMotion']
95+
CDrawer: typeof import('@chakra-ui/vue-next')['CDrawer']
96+
CDrawerBody: typeof import('@chakra-ui/vue-next')['CDrawerBody']
97+
CDrawerCloseButton: typeof import('@chakra-ui/vue-next')['CDrawerCloseButton']
98+
CDrawerContent: typeof import('@chakra-ui/vue-next')['CDrawerContent']
99+
CDrawerFooter: typeof import('@chakra-ui/vue-next')['CDrawerFooter']
100+
CDrawerHeader: typeof import('@chakra-ui/vue-next')['CDrawerHeader']
101+
CDrawerOverlay: typeof import('@chakra-ui/vue-next')['CDrawerOverlay']
102+
CModal: typeof import('@chakra-ui/vue-next')['CModal']
103+
CModalBody: typeof import('@chakra-ui/vue-next')['CModalBody']
104+
CModalCloseButton: typeof import('@chakra-ui/vue-next')['CModalCloseButton']
105+
CModalContent: typeof import('@chakra-ui/vue-next')['CModalContent']
106+
CModalFooter: typeof import('@chakra-ui/vue-next')['CModalFooter']
107+
CModalHeader: typeof import('@chakra-ui/vue-next')['CModalHeader']
108+
CModalOverlay: typeof import('@chakra-ui/vue-next')['CModalOverlay']
103109
CAnimatePresence: typeof import('@chakra-ui/vue-next')['CAnimatePresence']
104110
CCollapse: typeof import('@chakra-ui/vue-next')['CCollapse']
111+
CMotion: typeof import('@chakra-ui/vue-next')['CMotion']
105112
CPortal: typeof import('@chakra-ui/vue-next')['CPortal']
106113
CScrollLock: typeof import('@chakra-ui/vue-next')['CScrollLock']
107114
CVisuallyHidden: typeof import('@chakra-ui/vue-next')['CVisuallyHidden']
@@ -170,11 +177,49 @@ declare module 'vue' {
170177

171178
/* Component custom props types for JSX and TSX auto complete */
172179
export interface ComponentCustomProps
173-
extends JsxComponentCustomProps, ChakraProps {
180+
extends JsxComponentCustomProps,
181+
ChakraProps {
174182
onClick?: () => any
175183
vSlots?: {
176184
[eleName: string]: JSX.Element
177185
}
186+
}
187+
188+
interface ComponentCustomProps {
189+
role?: string
190+
tabindex?: number | string
178191
value?: unknown
192+
// should be removed after Vue supported component events typing
193+
// see: https://github.com/vuejs/vue-next/issues/1553
194+
// https://github.com/vuejs/vue-next/issues/3029
195+
onBlur?: EventHandler
196+
onOpen?: EventHandler
197+
onEdit?: EventHandler
198+
onLoad?: EventHandler
199+
onClose?: EventHandler
200+
onFocus?: EventHandler
201+
onInput?: EventHandler
202+
onClick?: EventHandler
203+
onPress?: EventHandler
204+
onCancel?: EventHandler
205+
onChange?: EventHandler
206+
onDelete?: EventHandler
207+
onScroll?: EventHandler
208+
onSubmit?: EventHandler
209+
onSelect?: EventHandler
210+
onConfirm?: EventHandler
211+
onPreview?: EventHandler
212+
onKeypress?: EventHandler
213+
onTouchend?: EventHandler
214+
onTouchmove?: EventHandler
215+
onTouchstart?: EventHandler
216+
onTouchcancel?: EventHandler
217+
onMouseenter?: EventHandler
218+
onMouseleave?: EventHandler
219+
onMousemove?: EventHandler
220+
onKeydown?: EventHandler
221+
onKeyup?: EventHandler
222+
onDeselect?: EventHandler
223+
onClear?: EventHandler
179224
}
180225
}

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"clean": "yarn workspaces run clean",
1818
"prebuild": "yarn clean",
1919
"build": "yarn preconstruct build",
20-
"postbuild": "yarn size-limit",
20+
"build:types": "ts-node scripts/generate-global-types.ts",
21+
"postbuild": "yarn build:types && yarn size-limit",
2122
"start": "preconstruct watch",
2223
"csb:install": "yarn && yarn bootstrap",
2324
"bootstrap": "yarn run lerna bootstrap",
@@ -112,7 +113,8 @@
112113
"cypress-plugin-tab": "^1.0.5",
113114
"dequal": "^2.0.2",
114115
"dom-focus-lock": "^1.0.4",
115-
"esbuild": "^0.12.12",
116+
"esbuild": "^0.13.12",
117+
"esbuild-darwin-arm64": "^0.13.12",
116118
"esbuild-jest": "0.4.0",
117119
"esbuild-plugin-babel": "^0.2.3",
118120
"eslint": "^7.0.0",

0 commit comments

Comments
 (0)