Skip to content

Commit 84d2814

Browse files
Merge pull request chakra-ui#142 from chakra-ui/feat/accordion
Feat/accordion
2 parents 1871c4a + 2285201 commit 84d2814

File tree

103 files changed

+2837
-839
lines changed

Some content is hidden

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

103 files changed

+2837
-839
lines changed

.changeset/sixty-rockets-sniff.md

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
"@chakra-ui/vue-anatomy": minor
3+
"@chakra-ui/c-accordion": minor
4+
"@chakra-ui/c-alert": minor
5+
"@chakra-ui/c-breadcrumb": minor
6+
"@chakra-ui/c-button": minor
7+
"@chakra-ui/c-close-button": minor
8+
"@chakra-ui/c-code": minor
9+
"@chakra-ui/c-color-mode": minor
10+
"@chakra-ui/c-flex": minor
11+
"@chakra-ui/c-focus-lock": minor
12+
"@chakra-ui/c-form-control": minor
13+
"@chakra-ui/c-icon": minor
14+
"@chakra-ui/c-input": minor
15+
"@chakra-ui/c-modal": minor
16+
"@chakra-ui/c-motion": minor
17+
"@chakra-ui/c-popper": minor
18+
"@chakra-ui/c-portal": minor
19+
"@chakra-ui/c-reset": minor
20+
"@chakra-ui/c-scroll-lock": minor
21+
"@chakra-ui/c-spinner": minor
22+
"@chakra-ui/c-theme-provider": minor
23+
"@chakra-ui/c-visually-hidden": minor
24+
"@chakra-ui/vue-next": minor
25+
"@chakra-ui/vue-layout": minor
26+
"@chakra-ui/nuxt-next": minor
27+
"@chakra-ui/vue-styled": minor
28+
"@chakra-ui/vue-system": minor
29+
"@chakra-ui/vue-test-utils": minor
30+
"@chakra-ui/vue-theme": minor
31+
"@chakra-ui/vue-theme-tools": minor
32+
"@chakra-ui/vue-utils": minor
33+
"@chakra-ui/vue-a11y": minor
34+
"@chakra-ui/vue-composables": minor
35+
"@chakra-ui/vue-auto-import": minor
36+
"@chakra-ui/vue-docs": minor
37+
---
38+
39+
Created accordion component and migrated to Zag.js
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
to: packages/<%=h.changeCase.paramCase(name)%>/src/index.ts
2+
to: packages/<%=h.changeCase.paramCase(name)%>/src/index.tsx
33
---
44

55
export * from './<%=h.changeCase.paramCase(name)%>'
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
to: packages/<%=h.changeCase.paramCase(name)%>/index.ts
2+
to: packages/<%=h.changeCase.paramCase(name)%>/index.tsx
33
---
44

55
export * from './src'

_templates/generator/module/src.ts.ejs.t

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
to: packages/<%=h.changeCase.paramCase(name)%>/src/index.ts
2+
to: packages/<%=h.changeCase.paramCase(name)%>/src/index.tsx
33
---
44
const <%= h.changeCase.pascalCase(name) %> = () => {
55
return {}

_templates/generator/tooling/src.ts.ejs.t

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
to: tooling/<%=h.changeCase.paramCase(name)%>/src/index.ts
2+
to: tooling/<%=h.changeCase.paramCase(name)%>/src/index.tsx
33
---
44
const <%= h.changeCase.pascalCase(name) %> = () => {
55
return {}

components.d.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* This is a generated file. Do not edit it's contents.
88
*
9-
* This file was generated on 2022-07-10T15:52:25.222Z
9+
* This file was generated on 2022-07-12T10:47:00.309Z
1010
*/
1111

1212
import { ChakraProps, chakra } from "@chakra-ui/vue-system"
@@ -47,10 +47,11 @@ declare module "@vue/runtime-core" {
4747
export interface GlobalComponents {
4848
chakra: typeof import("@chakra-ui/vue-next")["chakra"]
4949

50-
CAlert: typeof import("@chakra-ui/vue-next")["CAlert"]
51-
CAlertDescription: typeof import("@chakra-ui/vue-next")["CAlertDescription"]
52-
CAlertIcon: typeof import("@chakra-ui/vue-next")["CAlertIcon"]
53-
CAlertTitle: typeof import("@chakra-ui/vue-next")["CAlertTitle"]
50+
CAccordion: typeof import("@chakra-ui/vue-next")["CAccordion"]
51+
CAccordionButton: typeof import("@chakra-ui/vue-next")["CAccordionButton"]
52+
CAccordionIcon: typeof import("@chakra-ui/vue-next")["CAccordionIcon"]
53+
CAccordionItem: typeof import("@chakra-ui/vue-next")["CAccordionItem"]
54+
CAccordionPanel: typeof import("@chakra-ui/vue-next")["CAccordionPanel"]
5455
CBreadcrumb: typeof import("@chakra-ui/vue-next")["CBreadcrumb"]
5556
CBreadcrumbItem: typeof import("@chakra-ui/vue-next")["CBreadcrumbItem"]
5657
CBreadcrumbLink: typeof import("@chakra-ui/vue-next")["CBreadcrumbLink"]

docs/guides/component-guide.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ start building, here's what you need to do:
5151

5252
- Before you can play around with your new component in the playground you will have to export your component from the `@chakra-ui/vue-next` package in the `core` directory under `packages`.
5353

54-
* Inside the `index.ts` file, you will have to add `export * from '@chakra-ui/COMPONENT_NAME'`.
54+
* Inside the `index.tsx` file, you will have to add `export * from '@chakra-ui/COMPONENT_NAME'`.
5555

5656
* Your component also needs to be added as a dependency inside the `package.json` of the `@chakra-ui/vue-next` package as following:
5757
```jsx

jest.config.js

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
module.exports = {
22
transform: {
3-
'^.+\\.(ts|tsx)$': [
4-
'esbuild-jest',
3+
"^.+\\.(ts|tsx)$": [
4+
"esbuild-jest",
55
{
6-
jsxFactory: 'h',
7-
jsxFragment: 'Fragment',
6+
jsxFactory: "h",
7+
jsxFragment: "Fragment",
88
sourcemap: true,
9-
target: 'es2020',
9+
target: "es2020",
1010
},
1111
],
1212
},
13-
transformIgnorePatterns: ['/node_modules/(?!@popperjs/.*|lodash.)'],
13+
transformIgnorePatterns: ["/node_modules/(?!@popperjs/.*|lodash.)"],
1414
moduleNameMapper: {
15-
'^@/(.*)$': '<rootDir>/$1',
16-
'@chakra-ui/vue-test-utils': '<rootDir>/packages/test-utils/src/index.ts',
15+
"^@/(.*)$": "<rootDir>/$1",
16+
"@chakra-ui/vue-test-utils": "<rootDir>/packages/test-utils",
1717
},
18-
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
19-
snapshotSerializers: ['@chakra-ui/vue-test-utils/src/snapshot-serializer.ts'],
20-
testMatch: ['**/**/*.test.(js|jsx|ts|tsx)'],
18+
moduleFileExtensions: ["ts", "tsx", "js", "jsx"],
19+
snapshotSerializers: ["@chakra-ui/vue-test-utils/src/snapshot-serializer.ts"],
20+
testMatch: ["**/**/*.test.(js|jsx|ts|tsx)"],
2121
}

package.json

+12-3
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@
4545
"pkgs:check": "manypkg check",
4646
"pkgs:fix": "manypkg fix",
4747
"size": "echo `TODO: Analyze build sizes`",
48-
"analyze": "size-limit --why"
48+
"analyze": "size-limit --why",
49+
"vitest": "vitest",
50+
"coverage": "vitest run --coverage"
4951
},
5052
"license": "MIT",
5153
"private": true,
@@ -54,12 +56,14 @@
5456
"@babel/core": "^7.12.9",
5557
"@babel/preset-env": "^7.15.0",
5658
"@babel/preset-typescript": "^7.12.7",
59+
"@chakra-ui/anatomy": "^2.0.1",
5760
"@chakra-ui/styled-system": "^1.18.1",
5861
"@chakra-ui/utils": "^2.0.3",
5962
"@changesets/changelog-github": "^0.3.0",
6063
"@changesets/cli": "^2.14.1",
6164
"@commitlint/cli": "^11.0.0",
6265
"@commitlint/config-conventional": "^11.0.0",
66+
"@ctrl/tinycolor": "^3.4.1",
6367
"@cypress/snapshot": "^2.1.7",
6468
"@cypress/vite-dev-server": "^1.2.6",
6569
"@cypress/vue": "^3.0.3",
@@ -102,6 +106,8 @@
102106
"@vueuse/head": "^0.7.4",
103107
"@vueuse/integrations": "^4.8.1",
104108
"@vueuse/motion": "^1.5.4",
109+
"@zag-js/accordion": "^0.1.9",
110+
"@zag-js/vue": "^0.1.9",
105111
"aria-hidden": "^1.1.2",
106112
"axe-core": "^4.1.2",
107113
"babel-jest": "^26.6.3",
@@ -154,15 +160,15 @@
154160
"tinycolor2": "^1.4.2",
155161
"ts-jest": "^26.5.0",
156162
"ts-node": "^9.0.0",
157-
"typescript": "4.5.4",
163+
"typescript": "4.6.4",
158164
"unplugin-vue-components": "^0.14.0",
159165
"vite": "^2.8.6",
160166
"vite-plugin-mdx-vue": "^1.6.0",
161167
"vite-plugin-pages": "^0.20.1",
162168
"vite-plugin-vue-layouts": "^0.5.0",
163169
"vite-ssg": "^0.17.2",
164170
"vitepress": "^0.20.9",
165-
"vitest": "^0.2.5",
171+
"vitest": "^0.18.0",
166172
"vue": "^3.2.29",
167173
"vue-jest": "^5.0.0-alpha.7",
168174
"vue-prism-editor": "^2.0.0-alpha.2",
@@ -174,5 +180,8 @@
174180
"packages/*",
175181
"tooling/*"
176182
]
183+
},
184+
"devDependencies": {
185+
"happy-dom": "^6.0.3"
177186
}
178187
}

packages/anatomy/README.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# @chakra-ui/vue-anatomy
2+
3+
The anatomy of all chakra components
4+
5+
## Installation
6+
7+
```sh
8+
yarn add @chakra-ui/vue-anatomy
9+
# or
10+
npm i @chakra-ui/vue-anatomy
11+
```

packages/anatomy/index.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './src'

packages/anatomy/package.json

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "@chakra-ui/vue-anatomy",
3+
"description": "Chakra UI Vue | The anatomy of all chakra components component",
4+
"version": "0.0.0-alpha.0",
5+
"main": "dist/chakra-ui-vue-anatomy.cjs.js",
6+
"module": "dist/chakra-ui-vue-anatomy.esm.js",
7+
"author": "Jonathan Bakebwa <[email protected]>",
8+
"homepage": "https://github.com/chakra-ui/chakra-ui-vue-next#readme",
9+
"license": "MIT",
10+
"files": [
11+
"dist"
12+
],
13+
"exports": {
14+
".": {
15+
"require": "./dist/chakra-ui-vue-anatomy.cjs.js",
16+
"default": "./dist/chakra-ui-vue-anatomy.esm.js"
17+
}
18+
},
19+
"repository": "https://github.com/chakra-ui/chakra-ui-vue-next/tree/master/packages/anatomy",
20+
"bugs": {
21+
"url": "https://github.com/chakra-ui/chakra-ui-vue-next/issues"
22+
},
23+
"sideEffects": false,
24+
"scripts": {
25+
"clean": "rimraf dist"
26+
},
27+
"dependencies": {
28+
"@chakra-ui/vue-system": "0.1.0-alpha.10",
29+
"@chakra-ui/vue-theme-tools": "0.1.0-alpha.10"
30+
},
31+
"devDependencies": {
32+
"vue": "^3.2.29"
33+
},
34+
"peerDependencies": {
35+
"vue": "^3.1.4"
36+
},
37+
"publishConfig": {
38+
"access": "public"
39+
}
40+
}

0 commit comments

Comments
 (0)