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

Commit a93af84

Browse files
committed
refactor: upgrad accordion
1 parent 2b54859 commit a93af84

File tree

37 files changed

+83
-163
lines changed

37 files changed

+83
-163
lines changed

package.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
"@types/lodash.camelcase": "^4.3.6",
8787
"@types/lodash.kebabcase": "^4.1.6",
8888
"@types/lodash.mergewith": "^4.6.6",
89+
"@types/react": "file:stub/types__react",
8990
"@types/recursive-readdir": "^2.2.0",
9091
"@types/shelljs": "^0.8.9",
9192
"@types/tinycolor2": "^1.4.2",
@@ -106,8 +107,8 @@
106107
"@vueuse/head": "^0.7.4",
107108
"@vueuse/integrations": "^4.8.1",
108109
"@vueuse/motion": "^1.5.4",
109-
"@zag-js/accordion": "^0.1.9",
110-
"@zag-js/vue": "^0.1.9",
110+
"@zag-js/accordion": "^0.1.13",
111+
"@zag-js/vue": "^0.1.14",
111112
"aria-hidden": "^1.1.2",
112113
"axe-core": "^4.1.2",
113114
"babel-jest": "^26.6.3",
@@ -139,6 +140,7 @@
139140
"feather-icons-paths": "^1.0.8",
140141
"focus-trap": "^6.3.0",
141142
"fs-extra": "^9.0.1",
143+
"happy-dom": "^6.0.3",
142144
"husky": "^4.3.8",
143145
"hygen": "^6.0.4",
144146
"jest": "^26.6.3",
@@ -178,9 +180,5 @@
178180
"packages/*",
179181
"tooling/*"
180182
]
181-
},
182-
"devDependencies": {
183-
"@types/react": "file:stub/types__react",
184-
"happy-dom": "^6.0.3"
185183
}
186184
}

packages/anatomy/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"@chakra-ui/vue-theme-tools": "0.1.0-alpha.10"
3030
},
3131
"devDependencies": {
32-
"vue": "^3.2.29"
32+
"vue": "^3.2.37"
3333
},
3434
"peerDependencies": {
3535
"vue": "^3.1.4"

packages/c-accordion/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
"@chakra-ui/vue-composables": "0.1.0-alpha.9",
2727
"@chakra-ui/vue-system": "0.1.0-alpha.10",
2828
"@chakra-ui/vue-utils": "0.1.0-alpha.10",
29-
"@zag-js/accordion": "^0.1.9",
30-
"@zag-js/vue": "^0.1.9"
29+
"@zag-js/accordion": "^0.1.13",
30+
"@zag-js/vue": "^0.1.14"
3131
},
3232
"peerDependencies": {
3333
"vue": ">=3.0.5"
@@ -36,6 +36,6 @@
3636
"access": "public"
3737
},
3838
"devDependencies": {
39-
"vue": "^3.2.29"
39+
"vue": "^3.2.37"
4040
}
4141
}

packages/c-accordion/src/accordion.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ export const CAccordion: ComponentWithProps<DeepPartial<CAccordionProps>> =
8888
multiple: _props.allowMultiple,
8989
collapsible: _props.allowToggle,
9090
}))
91-
const [state, send] = useMachine(accordion.machine(context.value))
91+
const [state, send] = useMachine(accordion.machine({ id: uid.value }), {
92+
context,
93+
})
9294
const apiRef = computed(() =>
9395
accordion.connect(state.value, send, normalizeProps)
9496
)
@@ -115,8 +117,6 @@ export const CAccordion: ComponentWithProps<DeepPartial<CAccordionProps>> =
115117
})
116118
StylesProvider(styles)
117119

118-
const accordionRef = useSetup({ send, id: uid.value })
119-
120120
return () => {
121121
const api = apiRef.value
122122
return (
@@ -125,11 +125,7 @@ export const CAccordion: ComponentWithProps<DeepPartial<CAccordionProps>> =
125125
"> div": styles.value.root,
126126
}}
127127
>
128-
{() => (
129-
<div ref={accordionRef} {...api.rootProps}>
130-
{getValidChildren(slots)}
131-
</div>
132-
)}
128+
{() => <div {...api.rootProps}>{getValidChildren(slots)}</div>}
133129
</chakra.div>
134130
)
135131
}

packages/c-alert/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@
3131
"access": "public"
3232
},
3333
"devDependencies": {
34-
"vue": "^3.2.29"
34+
"vue": "^3.2.37"
3535
}
3636
}

packages/c-breadcrumb/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@
3737
"vue": "^3.1.4"
3838
},
3939
"devDependencies": {
40-
"vue": "^3.2.29"
40+
"vue": "^3.2.37"
4141
}
4242
}

packages/c-button/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@
3333
"access": "public"
3434
},
3535
"devDependencies": {
36-
"vue": "^3.2.29"
36+
"vue": "^3.2.37"
3737
}
3838
}

packages/c-close-button/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"@chakra-ui/vue-utils": "0.1.0-alpha.10"
3636
},
3737
"devDependencies": {
38-
"vue": "^3.2.29"
38+
"vue": "^3.2.37"
3939
},
4040
"peerDependencies": {
4141
"vue": "^3.1.4"

packages/c-code/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"@chakra-ui/vue-utils": "0.1.0-alpha.10"
3434
},
3535
"devDependencies": {
36-
"vue": "^3.2.29"
36+
"vue": "^3.2.37"
3737
},
3838
"peerDependencies": {
3939
"vue": "^3.1.4"

packages/c-color-mode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"@chakra-ui/utils": "^2.0.3"
3131
},
3232
"devDependencies": {
33-
"vue": "^3.2.29"
33+
"vue": "^3.2.37"
3434
},
3535
"peerDependencies": {
3636
"vue": "^3.1.4"

0 commit comments

Comments
 (0)