@ark-ui/react 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +53 -0
- package/accordion/accordion-context.d.ts +1 -2
- package/accordion/accordion-item-content.cjs +4 -12
- package/accordion/accordion-item-content.mjs +4 -12
- package/accordion/accordion-item-trigger.cjs +3 -3
- package/accordion/accordion-item-trigger.mjs +3 -3
- package/accordion/accordion-item.cjs +21 -13
- package/accordion/accordion-item.d.ts +4 -3
- package/accordion/accordion-item.mjs +21 -13
- package/accordion/accordion-root.cjs +3 -4
- package/accordion/accordion-root.d.ts +2 -2
- package/accordion/accordion-root.mjs +3 -4
- package/clipboard/clipboard-indicator.cjs +1 -1
- package/clipboard/clipboard-indicator.mjs +1 -1
- package/clipboard/index.cjs +24 -0
- package/clipboard/index.mjs +10 -0
- package/collapsible/collapsible-content.cjs +24 -0
- package/collapsible/collapsible-content.d.ts +6 -0
- package/collapsible/collapsible-content.mjs +20 -0
- package/collapsible/collapsible-context.cjs +15 -0
- package/collapsible/collapsible-context.d.ts +6 -0
- package/collapsible/collapsible-context.mjs +10 -0
- package/collapsible/collapsible-root.cjs +22 -0
- package/collapsible/collapsible-root.d.ts +8 -0
- package/collapsible/collapsible-root.mjs +18 -0
- package/collapsible/collapsible-trigger.cjs +21 -0
- package/collapsible/collapsible-trigger.d.ts +6 -0
- package/collapsible/collapsible-trigger.mjs +17 -0
- package/collapsible/collapsible.cjs +13 -0
- package/collapsible/collapsible.d.ts +4 -0
- package/collapsible/collapsible.mjs +3 -0
- package/collapsible/index.cjs +17 -0
- package/collapsible/index.d.ts +8 -0
- package/collapsible/index.mjs +6 -0
- package/collapsible/split-collapsible-props.cjs +22 -0
- package/collapsible/split-collapsible-props.d.ts +2 -0
- package/collapsible/split-collapsible-props.mjs +18 -0
- package/collapsible/use-collapsible.cjs +55 -0
- package/collapsible/use-collapsible.d.ts +17 -0
- package/collapsible/use-collapsible.mjs +32 -0
- package/dialog/dialog-backdrop.cjs +3 -3
- package/dialog/dialog-backdrop.mjs +3 -3
- package/dialog/dialog-root.cjs +3 -2
- package/dialog/dialog-root.mjs +3 -2
- package/factory.cjs +16 -12
- package/factory.mjs +17 -13
- package/index.cjs +27 -19
- package/index.d.ts +1 -0
- package/index.mjs +16 -10
- package/menu/menu-item-group.d.ts +2 -2
- package/package.json +56 -224
- package/presence/index.cjs +0 -3
- package/presence/index.d.ts +2 -3
- package/presence/index.mjs +0 -1
- package/presence/split-presence-props.cjs +6 -8
- package/presence/split-presence-props.d.ts +1 -1
- package/presence/split-presence-props.mjs +6 -8
- package/presence/use-presence.d.ts +2 -11
- package/render-strategy.cjs +18 -0
- package/render-strategy.d.ts +16 -0
- package/render-strategy.mjs +12 -0
- package/splitter/splitter-root.cjs +0 -1
- package/splitter/splitter-root.mjs +0 -1
- package/splitter/use-splitter.cjs +1 -2
- package/splitter/use-splitter.mjs +1 -2
- package/tabs/tab-content.cjs +3 -3
- package/tabs/tab-content.mjs +3 -3
- package/tabs/tabs-root.cjs +3 -4
- package/tabs/tabs-root.d.ts +2 -2
- package/tabs/tabs-root.mjs +3 -4
- package/toast/create-toaster.d.ts +2 -1
- package/tree-view/tree-view-branch-indicator.cjs +1 -7
- package/tree-view/tree-view-branch-indicator.mjs +1 -7
- package/tree-view/tree-view-root.cjs +2 -1
- package/tree-view/tree-view-root.mjs +2 -1
- package/tree-view/use-tree-view.cjs +2 -2
- package/tree-view/use-tree-view.d.ts +6 -2
- package/tree-view/use-tree-view.mjs +2 -2
- package/presence/presence-props-context.cjs +0 -17
- package/presence/presence-props-context.d.ts +0 -6
- package/presence/presence-props-context.mjs +0 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ark-ui/react",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "A collection of unstyled, accessible UI components for React, utilizing state machines for seamless interaction.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"accordion",
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"carousel",
|
|
9
9
|
"checkbox",
|
|
10
10
|
"clipboard",
|
|
11
|
+
"collapsible",
|
|
11
12
|
"color picker",
|
|
12
13
|
"combobox",
|
|
13
14
|
"date picker",
|
|
@@ -64,65 +65,66 @@
|
|
|
64
65
|
"release-it": "release-it --config ../../../release-it.json"
|
|
65
66
|
},
|
|
66
67
|
"dependencies": {
|
|
67
|
-
"@ark-ui/anatomy": "2.
|
|
68
|
-
"@zag-js/accordion": "0.
|
|
69
|
-
"@zag-js/avatar": "0.
|
|
70
|
-
"@zag-js/carousel": "0.
|
|
71
|
-
"@zag-js/checkbox": "0.
|
|
72
|
-
"@zag-js/clipboard": "0.
|
|
73
|
-
"@zag-js/collapsible": "0.
|
|
74
|
-
"@zag-js/color-picker": "0.
|
|
75
|
-
"@zag-js/color-utils": "0.
|
|
76
|
-
"@zag-js/combobox": "0.
|
|
77
|
-
"@zag-js/
|
|
78
|
-
"@zag-js/date-
|
|
79
|
-
"@zag-js/
|
|
80
|
-
"@zag-js/
|
|
81
|
-
"@zag-js/
|
|
82
|
-
"@zag-js/
|
|
83
|
-
"@zag-js/
|
|
84
|
-
"@zag-js/
|
|
85
|
-
"@zag-js/
|
|
86
|
-
"@zag-js/
|
|
87
|
-
"@zag-js/
|
|
88
|
-
"@zag-js/
|
|
89
|
-
"@zag-js/
|
|
90
|
-
"@zag-js/
|
|
91
|
-
"@zag-js/
|
|
92
|
-
"@zag-js/
|
|
93
|
-
"@zag-js/
|
|
94
|
-
"@zag-js/
|
|
95
|
-
"@zag-js/
|
|
96
|
-
"@zag-js/
|
|
97
|
-
"@zag-js/
|
|
98
|
-
"@zag-js/
|
|
99
|
-
"@zag-js/
|
|
100
|
-
"@zag-js/
|
|
101
|
-
"@zag-js/
|
|
102
|
-
"@zag-js/
|
|
103
|
-
"@zag-js/
|
|
104
|
-
"@zag-js/
|
|
68
|
+
"@ark-ui/anatomy": "2.3.0",
|
|
69
|
+
"@zag-js/accordion": "0.38.0",
|
|
70
|
+
"@zag-js/avatar": "0.38.0",
|
|
71
|
+
"@zag-js/carousel": "0.38.0",
|
|
72
|
+
"@zag-js/checkbox": "0.38.0",
|
|
73
|
+
"@zag-js/clipboard": "0.38.0",
|
|
74
|
+
"@zag-js/collapsible": "0.38.0",
|
|
75
|
+
"@zag-js/color-picker": "0.38.0",
|
|
76
|
+
"@zag-js/color-utils": "0.38.0",
|
|
77
|
+
"@zag-js/combobox": "0.38.0",
|
|
78
|
+
"@zag-js/core": "0.38.0",
|
|
79
|
+
"@zag-js/date-picker": "0.38.0",
|
|
80
|
+
"@zag-js/date-utils": "0.38.0",
|
|
81
|
+
"@zag-js/dialog": "0.38.0",
|
|
82
|
+
"@zag-js/editable": "0.38.0",
|
|
83
|
+
"@zag-js/file-upload": "0.38.0",
|
|
84
|
+
"@zag-js/hover-card": "0.38.0",
|
|
85
|
+
"@zag-js/i18n-utils": "0.38.0",
|
|
86
|
+
"@zag-js/menu": "0.38.0",
|
|
87
|
+
"@zag-js/number-input": "0.38.0",
|
|
88
|
+
"@zag-js/pagination": "0.38.0",
|
|
89
|
+
"@zag-js/pin-input": "0.38.0",
|
|
90
|
+
"@zag-js/popover": "0.38.0",
|
|
91
|
+
"@zag-js/presence": "0.38.0",
|
|
92
|
+
"@zag-js/progress": "0.38.0",
|
|
93
|
+
"@zag-js/radio-group": "0.38.0",
|
|
94
|
+
"@zag-js/rating-group": "0.38.0",
|
|
95
|
+
"@zag-js/react": "0.38.0",
|
|
96
|
+
"@zag-js/select": "0.38.0",
|
|
97
|
+
"@zag-js/slider": "0.38.0",
|
|
98
|
+
"@zag-js/splitter": "0.38.0",
|
|
99
|
+
"@zag-js/switch": "0.38.0",
|
|
100
|
+
"@zag-js/tabs": "0.38.0",
|
|
101
|
+
"@zag-js/tags-input": "0.38.0",
|
|
102
|
+
"@zag-js/toast": "0.38.0",
|
|
103
|
+
"@zag-js/toggle-group": "0.38.0",
|
|
104
|
+
"@zag-js/tooltip": "0.38.0",
|
|
105
|
+
"@zag-js/tree-view": "0.38.0",
|
|
106
|
+
"@zag-js/types": "0.38.0"
|
|
105
107
|
},
|
|
106
108
|
"devDependencies": {
|
|
107
109
|
"@release-it/keep-a-changelog": "5.0.0",
|
|
108
|
-
"@storybook/addon-a11y": "7.6.
|
|
109
|
-
"@storybook/addon-essentials": "7.6.
|
|
110
|
-
"@storybook/addons": "7.6.
|
|
111
|
-
"@storybook/react": "7.6.
|
|
112
|
-
"@storybook/react-vite": "7.6.
|
|
110
|
+
"@storybook/addon-a11y": "7.6.17",
|
|
111
|
+
"@storybook/addon-essentials": "7.6.17",
|
|
112
|
+
"@storybook/addons": "7.6.17",
|
|
113
|
+
"@storybook/react": "7.6.17",
|
|
114
|
+
"@storybook/react-vite": "7.6.17",
|
|
113
115
|
"@testing-library/dom": "9.3.4",
|
|
114
116
|
"@testing-library/jest-dom": "6.4.2",
|
|
115
117
|
"@testing-library/react": "14.2.1",
|
|
116
118
|
"@testing-library/user-event": "14.5.2",
|
|
117
119
|
"@types/jsdom": "21.1.6",
|
|
118
|
-
"@types/react": "18.2.
|
|
120
|
+
"@types/react": "18.2.58",
|
|
119
121
|
"@types/react-dom": "18.2.19",
|
|
120
122
|
"@types/testing-library__jest-dom": "5.14.9",
|
|
121
|
-
"@typescript-eslint/eslint-plugin": "
|
|
122
|
-
"@typescript-eslint/parser": "
|
|
123
|
+
"@typescript-eslint/eslint-plugin": "7.0.2",
|
|
124
|
+
"@typescript-eslint/parser": "7.0.2",
|
|
123
125
|
"@vitejs/plugin-react": "4.2.1",
|
|
124
|
-
"@vitest/coverage-v8": "1.
|
|
125
|
-
"eslint": "8.
|
|
126
|
+
"@vitest/coverage-v8": "1.3.1",
|
|
127
|
+
"eslint": "8.57.0",
|
|
126
128
|
"eslint-plugin-jest-dom": "5.1.0",
|
|
127
129
|
"eslint-plugin-react": "7.33.2",
|
|
128
130
|
"eslint-plugin-react-hooks": "4.6.0",
|
|
@@ -133,13 +135,13 @@
|
|
|
133
135
|
"react-dom": "18.2.0",
|
|
134
136
|
"react-frame-component": "5.2.6",
|
|
135
137
|
"react-hook-form": "7.50.1",
|
|
136
|
-
"release-it": "17.
|
|
138
|
+
"release-it": "17.1.1",
|
|
137
139
|
"resize-observer-polyfill": "1.5.1",
|
|
138
|
-
"storybook": "7.6.
|
|
140
|
+
"storybook": "7.6.17",
|
|
139
141
|
"typescript": "5.3.3",
|
|
140
|
-
"vite": "5.1.
|
|
141
|
-
"vite-plugin-dts": "3.7.
|
|
142
|
-
"vitest": "1.
|
|
142
|
+
"vite": "5.1.4",
|
|
143
|
+
"vite-plugin-dts": "3.7.3",
|
|
144
|
+
"vitest": "1.3.1"
|
|
143
145
|
},
|
|
144
146
|
"peerDependencies": {
|
|
145
147
|
"react": ">=18.0.0",
|
|
@@ -152,176 +154,6 @@
|
|
|
152
154
|
"./"
|
|
153
155
|
],
|
|
154
156
|
"exports": {
|
|
155
|
-
".": {
|
|
156
|
-
"types": "./index.d.ts",
|
|
157
|
-
"import": "./index.mjs",
|
|
158
|
-
"require": "./index.cjs"
|
|
159
|
-
},
|
|
160
|
-
"./accordion": {
|
|
161
|
-
"types": "./accordion/index.d.ts",
|
|
162
|
-
"import": "./accordion/index.mjs",
|
|
163
|
-
"require": "./accordion/index.cjs"
|
|
164
|
-
},
|
|
165
|
-
"./avatar": {
|
|
166
|
-
"types": "./avatar/index.d.ts",
|
|
167
|
-
"import": "./avatar/index.mjs",
|
|
168
|
-
"require": "./avatar/index.cjs"
|
|
169
|
-
},
|
|
170
|
-
"./carousel": {
|
|
171
|
-
"types": "./carousel/index.d.ts",
|
|
172
|
-
"import": "./carousel/index.mjs",
|
|
173
|
-
"require": "./carousel/index.cjs"
|
|
174
|
-
},
|
|
175
|
-
"./checkbox": {
|
|
176
|
-
"types": "./checkbox/index.d.ts",
|
|
177
|
-
"import": "./checkbox/index.mjs",
|
|
178
|
-
"require": "./checkbox/index.cjs"
|
|
179
|
-
},
|
|
180
|
-
"./color-picker": {
|
|
181
|
-
"types": "./color-picker/index.d.ts",
|
|
182
|
-
"import": "./color-picker/index.mjs",
|
|
183
|
-
"require": "./color-picker/index.cjs"
|
|
184
|
-
},
|
|
185
|
-
"./combobox": {
|
|
186
|
-
"types": "./combobox/index.d.ts",
|
|
187
|
-
"import": "./combobox/index.mjs",
|
|
188
|
-
"require": "./combobox/index.cjs"
|
|
189
|
-
},
|
|
190
|
-
"./date-picker": {
|
|
191
|
-
"types": "./date-picker/index.d.ts",
|
|
192
|
-
"import": "./date-picker/index.mjs",
|
|
193
|
-
"require": "./date-picker/index.cjs"
|
|
194
|
-
},
|
|
195
|
-
"./dialog": {
|
|
196
|
-
"types": "./dialog/index.d.ts",
|
|
197
|
-
"import": "./dialog/index.mjs",
|
|
198
|
-
"require": "./dialog/index.cjs"
|
|
199
|
-
},
|
|
200
|
-
"./editable": {
|
|
201
|
-
"types": "./editable/index.d.ts",
|
|
202
|
-
"import": "./editable/index.mjs",
|
|
203
|
-
"require": "./editable/index.cjs"
|
|
204
|
-
},
|
|
205
|
-
"./environment": {
|
|
206
|
-
"types": "./environment/index.d.ts",
|
|
207
|
-
"import": "./environment/index.mjs",
|
|
208
|
-
"require": "./environment/index.cjs"
|
|
209
|
-
},
|
|
210
|
-
"./file-upload": {
|
|
211
|
-
"types": "./file-upload/index.d.ts",
|
|
212
|
-
"import": "./file-upload/index.mjs",
|
|
213
|
-
"require": "./file-upload/index.cjs"
|
|
214
|
-
},
|
|
215
|
-
"./hover-card": {
|
|
216
|
-
"types": "./hover-card/index.d.ts",
|
|
217
|
-
"import": "./hover-card/index.mjs",
|
|
218
|
-
"require": "./hover-card/index.cjs"
|
|
219
|
-
},
|
|
220
|
-
"./locale": {
|
|
221
|
-
"types": "./locale/index.d.ts",
|
|
222
|
-
"import": "./locale/index.mjs",
|
|
223
|
-
"require": "./locale/index.cjs"
|
|
224
|
-
},
|
|
225
|
-
"./menu": {
|
|
226
|
-
"types": "./menu/index.d.ts",
|
|
227
|
-
"import": "./menu/index.mjs",
|
|
228
|
-
"require": "./menu/index.cjs"
|
|
229
|
-
},
|
|
230
|
-
"./number-input": {
|
|
231
|
-
"types": "./number-input/index.d.ts",
|
|
232
|
-
"import": "./number-input/index.mjs",
|
|
233
|
-
"require": "./number-input/index.cjs"
|
|
234
|
-
},
|
|
235
|
-
"./pagination": {
|
|
236
|
-
"types": "./pagination/index.d.ts",
|
|
237
|
-
"import": "./pagination/index.mjs",
|
|
238
|
-
"require": "./pagination/index.cjs"
|
|
239
|
-
},
|
|
240
|
-
"./pin-input": {
|
|
241
|
-
"types": "./pin-input/index.d.ts",
|
|
242
|
-
"import": "./pin-input/index.mjs",
|
|
243
|
-
"require": "./pin-input/index.cjs"
|
|
244
|
-
},
|
|
245
|
-
"./popover": {
|
|
246
|
-
"types": "./popover/index.d.ts",
|
|
247
|
-
"import": "./popover/index.mjs",
|
|
248
|
-
"require": "./popover/index.cjs"
|
|
249
|
-
},
|
|
250
|
-
"./presence": {
|
|
251
|
-
"types": "./presence/index.d.ts",
|
|
252
|
-
"import": "./presence/index.mjs",
|
|
253
|
-
"require": "./presence/index.cjs"
|
|
254
|
-
},
|
|
255
|
-
"./progress": {
|
|
256
|
-
"types": "./progress/index.d.ts",
|
|
257
|
-
"import": "./progress/index.mjs",
|
|
258
|
-
"require": "./progress/index.cjs"
|
|
259
|
-
},
|
|
260
|
-
"./radio-group": {
|
|
261
|
-
"types": "./radio-group/index.d.ts",
|
|
262
|
-
"import": "./radio-group/index.mjs",
|
|
263
|
-
"require": "./radio-group/index.cjs"
|
|
264
|
-
},
|
|
265
|
-
"./rating-group": {
|
|
266
|
-
"types": "./rating-group/index.d.ts",
|
|
267
|
-
"import": "./rating-group/index.mjs",
|
|
268
|
-
"require": "./rating-group/index.cjs"
|
|
269
|
-
},
|
|
270
|
-
"./segment-group": {
|
|
271
|
-
"types": "./segment-group/index.d.ts",
|
|
272
|
-
"import": "./segment-group/index.mjs",
|
|
273
|
-
"require": "./segment-group/index.cjs"
|
|
274
|
-
},
|
|
275
|
-
"./select": {
|
|
276
|
-
"types": "./select/index.d.ts",
|
|
277
|
-
"import": "./select/index.mjs",
|
|
278
|
-
"require": "./select/index.cjs"
|
|
279
|
-
},
|
|
280
|
-
"./slider": {
|
|
281
|
-
"types": "./slider/index.d.ts",
|
|
282
|
-
"import": "./slider/index.mjs",
|
|
283
|
-
"require": "./slider/index.cjs"
|
|
284
|
-
},
|
|
285
|
-
"./splitter": {
|
|
286
|
-
"types": "./splitter/index.d.ts",
|
|
287
|
-
"import": "./splitter/index.mjs",
|
|
288
|
-
"require": "./splitter/index.cjs"
|
|
289
|
-
},
|
|
290
|
-
"./switch": {
|
|
291
|
-
"types": "./switch/index.d.ts",
|
|
292
|
-
"import": "./switch/index.mjs",
|
|
293
|
-
"require": "./switch/index.cjs"
|
|
294
|
-
},
|
|
295
|
-
"./tabs": {
|
|
296
|
-
"types": "./tabs/index.d.ts",
|
|
297
|
-
"import": "./tabs/index.mjs",
|
|
298
|
-
"require": "./tabs/index.cjs"
|
|
299
|
-
},
|
|
300
|
-
"./tags-input": {
|
|
301
|
-
"types": "./tags-input/index.d.ts",
|
|
302
|
-
"import": "./tags-input/index.mjs",
|
|
303
|
-
"require": "./tags-input/index.cjs"
|
|
304
|
-
},
|
|
305
|
-
"./toast": {
|
|
306
|
-
"types": "./toast/index.d.ts",
|
|
307
|
-
"import": "./toast/index.mjs",
|
|
308
|
-
"require": "./toast/index.cjs"
|
|
309
|
-
},
|
|
310
|
-
"./toggle-group": {
|
|
311
|
-
"types": "./toggle-group/index.d.ts",
|
|
312
|
-
"import": "./toggle-group/index.mjs",
|
|
313
|
-
"require": "./toggle-group/index.cjs"
|
|
314
|
-
},
|
|
315
|
-
"./tooltip": {
|
|
316
|
-
"types": "./tooltip/index.d.ts",
|
|
317
|
-
"import": "./tooltip/index.mjs",
|
|
318
|
-
"require": "./tooltip/index.cjs"
|
|
319
|
-
},
|
|
320
|
-
"./tree-view": {
|
|
321
|
-
"types": "./tree-view/index.d.ts",
|
|
322
|
-
"import": "./tree-view/index.mjs",
|
|
323
|
-
"require": "./tree-view/index.cjs"
|
|
324
|
-
},
|
|
325
157
|
"./factory": {
|
|
326
158
|
"types": "./factory.d.ts",
|
|
327
159
|
"import": "./factory.mjs",
|
package/presence/index.cjs
CHANGED
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
4
4
|
|
|
5
5
|
const presence = require('./presence.cjs');
|
|
6
6
|
const presenceContext = require('./presence-context.cjs');
|
|
7
|
-
const presencePropsContext = require('./presence-props-context.cjs');
|
|
8
7
|
const splitPresenceProps = require('./split-presence-props.cjs');
|
|
9
8
|
const usePresence = require('./use-presence.cjs');
|
|
10
9
|
|
|
@@ -13,7 +12,5 @@ const usePresence = require('./use-presence.cjs');
|
|
|
13
12
|
exports.Presence = presence.Presence;
|
|
14
13
|
exports.PresenceProvider = presenceContext.PresenceProvider;
|
|
15
14
|
exports.usePresenceContext = presenceContext.usePresenceContext;
|
|
16
|
-
exports.PresencePropsProvider = presencePropsContext.PresencePropsProvider;
|
|
17
|
-
exports.usePresencePropsContext = presencePropsContext.usePresencePropsContext;
|
|
18
15
|
exports.splitPresenceProps = splitPresenceProps.splitPresenceProps;
|
|
19
16
|
exports.usePresence = usePresence.usePresence;
|
package/presence/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Presence, type PresenceProps } from './presence';
|
|
2
2
|
import { PresenceProvider, usePresenceContext, type PresenceContext } from './presence-context';
|
|
3
|
-
import { PresencePropsProvider, usePresencePropsContext, type PresencePropsContext } from './presence-props-context';
|
|
4
3
|
import { splitPresenceProps } from './split-presence-props';
|
|
5
4
|
import { usePresence, type UsePresenceProps, type UsePresenceReturn } from './use-presence';
|
|
6
|
-
export { Presence,
|
|
7
|
-
export type { PresenceContext, PresenceProps,
|
|
5
|
+
export { Presence, PresenceProvider, splitPresenceProps, usePresence, usePresenceContext };
|
|
6
|
+
export type { PresenceContext, PresenceProps, UsePresenceProps, UsePresenceReturn };
|
package/presence/index.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { Presence } from './presence.mjs';
|
|
2
2
|
export { PresenceProvider, usePresenceContext } from './presence-context.mjs';
|
|
3
|
-
export { PresencePropsProvider, usePresencePropsContext } from './presence-props-context.mjs';
|
|
4
3
|
export { splitPresenceProps } from './split-presence-props.mjs';
|
|
5
4
|
export { usePresence } from './use-presence.mjs';
|
|
@@ -5,13 +5,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
5
5
|
|
|
6
6
|
const createSplitProps = require('../create-split-props.cjs');
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
]);
|
|
15
|
-
}
|
|
8
|
+
const splitPresenceProps = (props) => createSplitProps.createSplitProps()(props, [
|
|
9
|
+
"lazyMount",
|
|
10
|
+
"onExitComplete",
|
|
11
|
+
"present",
|
|
12
|
+
"unmountOnExit"
|
|
13
|
+
]);
|
|
16
14
|
|
|
17
15
|
exports.splitPresenceProps = splitPresenceProps;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { UsePresenceProps } from './use-presence';
|
|
2
|
-
export declare
|
|
2
|
+
export declare const splitPresenceProps: <T extends UsePresenceProps>(props: T) => [UsePresenceProps, Omit<T, "lazyMount" | "unmountOnExit" | "onExitComplete" | "present">];
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { createSplitProps } from '../create-split-props.mjs';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
]);
|
|
11
|
-
}
|
|
4
|
+
const splitPresenceProps = (props) => createSplitProps()(props, [
|
|
5
|
+
"lazyMount",
|
|
6
|
+
"onExitComplete",
|
|
7
|
+
"present",
|
|
8
|
+
"unmountOnExit"
|
|
9
|
+
]);
|
|
12
10
|
|
|
13
11
|
export { splitPresenceProps };
|
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
import * as presence from '@zag-js/presence';
|
|
2
2
|
import { type ForwardedRef } from 'react';
|
|
3
|
+
import type { RenderStrategyProps } from '../render-strategy';
|
|
3
4
|
import type { Optional } from '../types';
|
|
4
|
-
export interface UsePresenceProps extends Optional<presence.Context, 'present'
|
|
5
|
-
/**
|
|
6
|
-
* Whether to enable lazy mounting
|
|
7
|
-
* @default false
|
|
8
|
-
*/
|
|
9
|
-
lazyMount?: boolean;
|
|
10
|
-
/**
|
|
11
|
-
* Whether to unmount on exit.
|
|
12
|
-
* @default false
|
|
13
|
-
*/
|
|
14
|
-
unmountOnExit?: boolean;
|
|
5
|
+
export interface UsePresenceProps extends Optional<presence.Context, 'present'>, RenderStrategyProps {
|
|
15
6
|
}
|
|
16
7
|
export type UsePresenceReturn = ReturnType<typeof usePresence>;
|
|
17
8
|
export declare const usePresence: (props: UsePresenceProps) => {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
const createContext = require('./create-context.cjs');
|
|
7
|
+
const createSplitProps = require('./create-split-props.cjs');
|
|
8
|
+
|
|
9
|
+
const [RenderStrategyProvider, useRenderStrategyContext] = createContext.createContext({
|
|
10
|
+
name: "RenderStrategyContext",
|
|
11
|
+
hookName: "useRenderStrategyContext",
|
|
12
|
+
providerName: "<RenderStrategyProvider />"
|
|
13
|
+
});
|
|
14
|
+
const splitRenderStrategyProps = (props) => createSplitProps.createSplitProps()(props, ["lazyMount", "unmountOnExit"]);
|
|
15
|
+
|
|
16
|
+
exports.RenderStrategyProvider = RenderStrategyProvider;
|
|
17
|
+
exports.splitRenderStrategyProps = splitRenderStrategyProps;
|
|
18
|
+
exports.useRenderStrategyContext = useRenderStrategyContext;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Provider } from 'react';
|
|
2
|
+
/// <reference types="react" />
|
|
3
|
+
export interface RenderStrategyProps {
|
|
4
|
+
/**
|
|
5
|
+
* Whether to enable lazy mounting
|
|
6
|
+
* @default false
|
|
7
|
+
*/
|
|
8
|
+
lazyMount?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Whether to unmount on exit.
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
13
|
+
unmountOnExit?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const RenderStrategyProvider: Provider<RenderStrategyProps>, useRenderStrategyContext: () => RenderStrategyProps;
|
|
16
|
+
export declare const splitRenderStrategyProps: <T extends RenderStrategyProps>(props: T) => [RenderStrategyProps, Omit<T, "lazyMount" | "unmountOnExit">];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { createContext } from './create-context.mjs';
|
|
3
|
+
import { createSplitProps } from './create-split-props.mjs';
|
|
4
|
+
|
|
5
|
+
const [RenderStrategyProvider, useRenderStrategyContext] = createContext({
|
|
6
|
+
name: "RenderStrategyContext",
|
|
7
|
+
hookName: "useRenderStrategyContext",
|
|
8
|
+
providerName: "<RenderStrategyProvider />"
|
|
9
|
+
});
|
|
10
|
+
const splitRenderStrategyProps = (props) => createSplitProps()(props, ["lazyMount", "unmountOnExit"]);
|
|
11
|
+
|
|
12
|
+
export { RenderStrategyProvider, splitRenderStrategyProps, useRenderStrategyContext };
|
|
@@ -39,8 +39,7 @@ const useSplitter = (props) => {
|
|
|
39
39
|
...initialContext,
|
|
40
40
|
size: props.size,
|
|
41
41
|
onSizeChange: useEvent.useEvent(props.onSizeChange, { sync: true }),
|
|
42
|
-
onSizeChangeEnd: useEvent.useEvent(props.onSizeChangeEnd)
|
|
43
|
-
onSizeChangeStart: useEvent.useEvent(props.onSizeChangeStart)
|
|
42
|
+
onSizeChangeEnd: useEvent.useEvent(props.onSizeChangeEnd)
|
|
44
43
|
};
|
|
45
44
|
const [state, send] = react$1.useMachine(splitter__namespace.machine(initialContext), { context });
|
|
46
45
|
return splitter__namespace.connect(state, send, react$1.normalizeProps);
|
|
@@ -16,8 +16,7 @@ const useSplitter = (props) => {
|
|
|
16
16
|
...initialContext,
|
|
17
17
|
size: props.size,
|
|
18
18
|
onSizeChange: useEvent(props.onSizeChange, { sync: true }),
|
|
19
|
-
onSizeChangeEnd: useEvent(props.onSizeChangeEnd)
|
|
20
|
-
onSizeChangeStart: useEvent(props.onSizeChangeStart)
|
|
19
|
+
onSizeChangeEnd: useEvent(props.onSizeChangeEnd)
|
|
21
20
|
};
|
|
22
21
|
const [state, send] = useMachine(splitter.machine(initialContext), { context });
|
|
23
22
|
return splitter.connect(state, send, normalizeProps);
|
package/tabs/tab-content.cjs
CHANGED
|
@@ -10,15 +10,15 @@ const react = require('react');
|
|
|
10
10
|
const createSplitProps = require('../create-split-props.cjs');
|
|
11
11
|
const factory = require('../factory.cjs');
|
|
12
12
|
const presenceContext = require('../presence/presence-context.cjs');
|
|
13
|
-
const presencePropsContext = require('../presence/presence-props-context.cjs');
|
|
14
13
|
const usePresence = require('../presence/use-presence.cjs');
|
|
14
|
+
const renderStrategy = require('../render-strategy.cjs');
|
|
15
15
|
const tabsContext = require('./tabs-context.cjs');
|
|
16
16
|
|
|
17
17
|
const TabContent = react.forwardRef((props, ref) => {
|
|
18
18
|
const [contentProps, localProps] = createSplitProps.createSplitProps()(props, ["value"]);
|
|
19
19
|
const api = tabsContext.useTabsContext();
|
|
20
|
-
const
|
|
21
|
-
const presenceApi = usePresence.usePresence({ ...
|
|
20
|
+
const renderStrategyProps = renderStrategy.useRenderStrategyContext();
|
|
21
|
+
const presenceApi = usePresence.usePresence({ ...renderStrategyProps, present: api.value === props.value });
|
|
22
22
|
const mergedProps = react$1.mergeProps(
|
|
23
23
|
api.getContentProps(contentProps),
|
|
24
24
|
presenceApi.getPresenceProps(ref),
|
package/tabs/tab-content.mjs
CHANGED
|
@@ -6,15 +6,15 @@ import { forwardRef } from 'react';
|
|
|
6
6
|
import { createSplitProps } from '../create-split-props.mjs';
|
|
7
7
|
import { ark } from '../factory.mjs';
|
|
8
8
|
import { PresenceProvider } from '../presence/presence-context.mjs';
|
|
9
|
-
import { usePresencePropsContext } from '../presence/presence-props-context.mjs';
|
|
10
9
|
import { usePresence } from '../presence/use-presence.mjs';
|
|
10
|
+
import { useRenderStrategyContext } from '../render-strategy.mjs';
|
|
11
11
|
import { useTabsContext } from './tabs-context.mjs';
|
|
12
12
|
|
|
13
13
|
const TabContent = forwardRef((props, ref) => {
|
|
14
14
|
const [contentProps, localProps] = createSplitProps()(props, ["value"]);
|
|
15
15
|
const api = useTabsContext();
|
|
16
|
-
const
|
|
17
|
-
const presenceApi = usePresence({ ...
|
|
16
|
+
const renderStrategyProps = useRenderStrategyContext();
|
|
17
|
+
const presenceApi = usePresence({ ...renderStrategyProps, present: api.value === props.value });
|
|
18
18
|
const mergedProps = mergeProps(
|
|
19
19
|
api.getContentProps(contentProps),
|
|
20
20
|
presenceApi.getPresenceProps(ref),
|
package/tabs/tabs-root.cjs
CHANGED
|
@@ -8,13 +8,12 @@ const react$1 = require('@zag-js/react');
|
|
|
8
8
|
const react = require('react');
|
|
9
9
|
const createSplitProps = require('../create-split-props.cjs');
|
|
10
10
|
const factory = require('../factory.cjs');
|
|
11
|
-
const
|
|
12
|
-
const splitPresenceProps = require('../presence/split-presence-props.cjs');
|
|
11
|
+
const renderStrategy = require('../render-strategy.cjs');
|
|
13
12
|
const tabsContext = require('./tabs-context.cjs');
|
|
14
13
|
const useTabs = require('./use-tabs.cjs');
|
|
15
14
|
|
|
16
15
|
const TabsRoot = react.forwardRef((props, ref) => {
|
|
17
|
-
const [
|
|
16
|
+
const [renderStrategyProps, tabsProps] = renderStrategy.splitRenderStrategyProps(props);
|
|
18
17
|
const [useTabsProps, localprops] = createSplitProps.createSplitProps()(tabsProps, [
|
|
19
18
|
"activationMode",
|
|
20
19
|
"defaultValue",
|
|
@@ -31,7 +30,7 @@ const TabsRoot = react.forwardRef((props, ref) => {
|
|
|
31
30
|
]);
|
|
32
31
|
const api = useTabs.useTabs(useTabsProps);
|
|
33
32
|
const mergedProps = react$1.mergeProps(api.rootProps, localprops);
|
|
34
|
-
return /* @__PURE__ */ jsxRuntime.jsx(tabsContext.TabsProvider, { value: api, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
33
|
+
return /* @__PURE__ */ jsxRuntime.jsx(tabsContext.TabsProvider, { value: api, children: /* @__PURE__ */ jsxRuntime.jsx(renderStrategy.RenderStrategyProvider, { value: renderStrategyProps, children: /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref }) }) });
|
|
35
34
|
});
|
|
36
35
|
TabsRoot.displayName = "TabsRoot";
|
|
37
36
|
|
package/tabs/tabs-root.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
2
2
|
/// <reference types="react" />
|
|
3
3
|
import { type HTMLArkProps } from '../factory';
|
|
4
|
-
import { type
|
|
4
|
+
import { type RenderStrategyProps } from '../render-strategy';
|
|
5
5
|
import { type Assign } from '../types';
|
|
6
6
|
import { type UseTabsProps } from './use-tabs';
|
|
7
|
-
export interface TabsRootProps extends Assign<HTMLArkProps<'div'>, UseTabsProps>,
|
|
7
|
+
export interface TabsRootProps extends Assign<HTMLArkProps<'div'>, UseTabsProps>, RenderStrategyProps {
|
|
8
8
|
}
|
|
9
9
|
export declare const TabsRoot: ForwardRefExoticComponent<TabsRootProps & RefAttributes<HTMLDivElement>>;
|
package/tabs/tabs-root.mjs
CHANGED
|
@@ -4,13 +4,12 @@ import { mergeProps } from '@zag-js/react';
|
|
|
4
4
|
import { forwardRef } from 'react';
|
|
5
5
|
import { createSplitProps } from '../create-split-props.mjs';
|
|
6
6
|
import { ark } from '../factory.mjs';
|
|
7
|
-
import {
|
|
8
|
-
import { splitPresenceProps } from '../presence/split-presence-props.mjs';
|
|
7
|
+
import { splitRenderStrategyProps, RenderStrategyProvider } from '../render-strategy.mjs';
|
|
9
8
|
import { TabsProvider } from './tabs-context.mjs';
|
|
10
9
|
import { useTabs } from './use-tabs.mjs';
|
|
11
10
|
|
|
12
11
|
const TabsRoot = forwardRef((props, ref) => {
|
|
13
|
-
const [
|
|
12
|
+
const [renderStrategyProps, tabsProps] = splitRenderStrategyProps(props);
|
|
14
13
|
const [useTabsProps, localprops] = createSplitProps()(tabsProps, [
|
|
15
14
|
"activationMode",
|
|
16
15
|
"defaultValue",
|
|
@@ -27,7 +26,7 @@ const TabsRoot = forwardRef((props, ref) => {
|
|
|
27
26
|
]);
|
|
28
27
|
const api = useTabs(useTabsProps);
|
|
29
28
|
const mergedProps = mergeProps(api.rootProps, localprops);
|
|
30
|
-
return /* @__PURE__ */ jsx(TabsProvider, { value: api, children: /* @__PURE__ */ jsx(
|
|
29
|
+
return /* @__PURE__ */ jsx(TabsProvider, { value: api, children: /* @__PURE__ */ jsx(RenderStrategyProvider, { value: renderStrategyProps, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref }) }) });
|
|
31
30
|
});
|
|
32
31
|
TabsRoot.displayName = "TabsRoot";
|
|
33
32
|
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { type PropTypes } from '@zag-js/react';
|
|
2
2
|
import * as toast from '@zag-js/toast';
|
|
3
3
|
import { type JSX } from 'react';
|
|
4
|
+
import { type HTMLArkProps } from '../factory';
|
|
4
5
|
import type { Optional } from '../types';
|
|
5
6
|
type GroupContext = Partial<toast.GroupMachineContext>;
|
|
6
7
|
export interface CreateToasterProps extends Omit<Optional<GroupContext, 'id'>, 'render'> {
|
|
7
8
|
placement: toast.Placement;
|
|
8
9
|
render: (api: toast.Api<PropTypes>) => JSX.Element;
|
|
9
10
|
}
|
|
10
|
-
export type CreateToasterReturn = [React.
|
|
11
|
+
export type CreateToasterReturn = [React.FC<HTMLArkProps<'ol'>>, toast.GroupApi<PropTypes>];
|
|
11
12
|
export declare const createToaster: (props: CreateToasterProps) => CreateToasterReturn;
|
|
12
13
|
export {};
|