@ark-ui/react 1.0.1 → 1.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.
Files changed (183) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +67 -61
  3. package/accordion/accordion.stories.d.ts +0 -1
  4. package/color-picker/color-picker-format-select.cjs +21 -0
  5. package/color-picker/color-picker-format-select.d.ts +6 -0
  6. package/color-picker/color-picker-format-select.mjs +17 -0
  7. package/color-picker/color-picker-format-trigger.cjs +19 -0
  8. package/color-picker/color-picker-format-trigger.d.ts +6 -0
  9. package/color-picker/color-picker-format-trigger.mjs +15 -0
  10. package/color-picker/color-picker-swatch-context.cjs +15 -0
  11. package/color-picker/color-picker-swatch-context.d.ts +6 -0
  12. package/color-picker/color-picker-swatch-context.mjs +10 -0
  13. package/color-picker/color-picker-swatch-indicator.cjs +21 -0
  14. package/color-picker/color-picker-swatch-indicator.d.ts +6 -0
  15. package/color-picker/color-picker-swatch-indicator.mjs +17 -0
  16. package/color-picker/color-picker-swatch-trigger.cjs +4 -1
  17. package/color-picker/color-picker-swatch-trigger.d.ts +1 -5
  18. package/color-picker/color-picker-swatch-trigger.mjs +4 -1
  19. package/color-picker/color-picker-swatch.cjs +4 -3
  20. package/color-picker/color-picker-swatch.mjs +4 -3
  21. package/color-picker/color-picker-transparency-grid.d.ts +2 -5
  22. package/color-picker/color-picker.cjs +4 -2
  23. package/color-picker/color-picker.mjs +4 -2
  24. package/color-picker/index.cjs +10 -0
  25. package/color-picker/index.d.ts +10 -3
  26. package/color-picker/index.mjs +7 -1
  27. package/color-picker/use-color-picker.cjs +1 -1
  28. package/color-picker/use-color-picker.d.ts +4 -1
  29. package/color-picker/use-color-picker.mjs +1 -1
  30. package/combobox/combobox.cjs +1 -1
  31. package/combobox/combobox.d.ts +1 -1
  32. package/combobox/combobox.mjs +1 -1
  33. package/date-picker/date-picker.cjs +2 -2
  34. package/date-picker/date-picker.mjs +2 -2
  35. package/date-picker/date-picker.stories.d.ts +1 -0
  36. package/dialog/dialog-backdrop.cjs +1 -1
  37. package/dialog/dialog-backdrop.mjs +1 -1
  38. package/dialog/dialog.cjs +2 -1
  39. package/dialog/dialog.mjs +2 -1
  40. package/editable/editable.cjs +2 -2
  41. package/editable/editable.mjs +2 -2
  42. package/factory.cjs +1 -2
  43. package/factory.d.ts +1 -1
  44. package/factory.mjs +2 -3
  45. package/factory.test.d.ts +1 -0
  46. package/file-upload/file-upload-context.cjs +15 -0
  47. package/file-upload/file-upload-context.d.ts +6 -0
  48. package/file-upload/file-upload-context.mjs +10 -0
  49. package/file-upload/file-upload-dropzone.cjs +24 -0
  50. package/file-upload/file-upload-dropzone.d.ts +6 -0
  51. package/file-upload/file-upload-dropzone.mjs +20 -0
  52. package/file-upload/file-upload-item-context.cjs +15 -0
  53. package/file-upload/file-upload-item-context.d.ts +6 -0
  54. package/file-upload/file-upload-item-context.mjs +10 -0
  55. package/file-upload/file-upload-item-delete-trigger.cjs +21 -0
  56. package/file-upload/file-upload-item-delete-trigger.d.ts +6 -0
  57. package/file-upload/file-upload-item-delete-trigger.mjs +17 -0
  58. package/file-upload/file-upload-item-group.cjs +24 -0
  59. package/file-upload/file-upload-item-group.d.ts +8 -0
  60. package/file-upload/file-upload-item-group.mjs +20 -0
  61. package/file-upload/file-upload-item-name.cjs +24 -0
  62. package/file-upload/file-upload-item-name.d.ts +6 -0
  63. package/file-upload/file-upload-item-name.mjs +20 -0
  64. package/file-upload/file-upload-item-preview-image.cjs +25 -0
  65. package/file-upload/file-upload-item-preview-image.d.ts +6 -0
  66. package/file-upload/file-upload-item-preview-image.mjs +21 -0
  67. package/file-upload/file-upload-item-preview.cjs +25 -0
  68. package/file-upload/file-upload-item-preview.d.ts +11 -0
  69. package/file-upload/file-upload-item-preview.mjs +21 -0
  70. package/file-upload/file-upload-item-size-text.cjs +24 -0
  71. package/file-upload/file-upload-item-size-text.d.ts +6 -0
  72. package/file-upload/file-upload-item-size-text.mjs +20 -0
  73. package/file-upload/file-upload-item.cjs +24 -0
  74. package/file-upload/file-upload-item.d.ts +8 -0
  75. package/file-upload/file-upload-item.mjs +20 -0
  76. package/file-upload/file-upload-label.cjs +19 -0
  77. package/file-upload/file-upload-label.d.ts +6 -0
  78. package/file-upload/file-upload-label.mjs +15 -0
  79. package/file-upload/file-upload-trigger.cjs +21 -0
  80. package/file-upload/file-upload-trigger.d.ts +6 -0
  81. package/file-upload/file-upload-trigger.mjs +17 -0
  82. package/file-upload/file-upload.cjs +46 -0
  83. package/file-upload/file-upload.d.ts +9 -0
  84. package/file-upload/file-upload.mjs +42 -0
  85. package/file-upload/file-upload.stories.d.ts +7 -0
  86. package/file-upload/file-upload.test.d.ts +1 -0
  87. package/file-upload/index.cjs +43 -0
  88. package/file-upload/index.d.ts +29 -0
  89. package/file-upload/index.mjs +29 -0
  90. package/file-upload/use-file-upload.cjs +48 -0
  91. package/file-upload/use-file-upload.d.ts +8 -0
  92. package/file-upload/use-file-upload.mjs +25 -0
  93. package/hover-card/hover-card.cjs +2 -1
  94. package/hover-card/hover-card.mjs +2 -1
  95. package/index.cjs +74 -42
  96. package/index.d.ts +1 -0
  97. package/index.mjs +18 -2
  98. package/menu/menu.cjs +4 -3
  99. package/menu/menu.mjs +2 -1
  100. package/number-input/index.cjs +3 -3
  101. package/number-input/index.d.ts +1 -1
  102. package/number-input/index.mjs +1 -1
  103. package/number-input/number-input.cjs +5 -3
  104. package/number-input/number-input.d.ts +5 -4
  105. package/number-input/number-input.mjs +5 -3
  106. package/number-input/number-input.stories.d.ts +1 -0
  107. package/package.json +72 -57
  108. package/pagination/pagination-item.cjs +1 -1
  109. package/pagination/pagination-item.mjs +1 -1
  110. package/pagination/pagination.cjs +2 -2
  111. package/pagination/pagination.mjs +2 -2
  112. package/pin-input/index.cjs +3 -3
  113. package/pin-input/index.d.ts +1 -1
  114. package/pin-input/index.mjs +1 -1
  115. package/pin-input/pin-input.cjs +2 -2
  116. package/pin-input/pin-input.mjs +2 -2
  117. package/popover/popover.cjs +2 -1
  118. package/popover/popover.mjs +2 -1
  119. package/portal.cjs +2 -1
  120. package/portal.d.ts +2 -2
  121. package/portal.mjs +2 -1
  122. package/radio-group/radio-group-indicator.cjs +1 -2
  123. package/radio-group/radio-group-indicator.mjs +1 -2
  124. package/radio-group/radio-group-item.d.ts +1 -1
  125. package/radio-group/radio-group.cjs +2 -2
  126. package/radio-group/radio-group.mjs +2 -2
  127. package/radio-group/radio-group.stories.d.ts +1 -1
  128. package/rating-group/rating-group-control.cjs +2 -2
  129. package/rating-group/rating-group-control.mjs +2 -2
  130. package/rating-group/rating-group-item-context.d.ts +2 -2
  131. package/rating-group/rating-group-item.cjs +5 -4
  132. package/rating-group/rating-group-item.mjs +5 -4
  133. package/rating-group/rating-group.cjs +2 -2
  134. package/rating-group/rating-group.mjs +2 -2
  135. package/rating-group/use-rating-group.cjs +4 -4
  136. package/rating-group/use-rating-group.d.ts +4 -4
  137. package/rating-group/use-rating-group.mjs +3 -3
  138. package/segment-group/segment-group-indicator.cjs +2 -2
  139. package/segment-group/segment-group-indicator.mjs +2 -2
  140. package/segment-group/segment-group-item-context.d.ts +1 -13
  141. package/segment-group/segment-group-item-control.cjs +2 -2
  142. package/segment-group/segment-group-item-control.mjs +2 -2
  143. package/segment-group/segment-group-item-text.cjs +2 -2
  144. package/segment-group/segment-group-item-text.mjs +2 -2
  145. package/segment-group/segment-group-item.cjs +3 -3
  146. package/segment-group/segment-group-item.d.ts +3 -2
  147. package/segment-group/segment-group-item.mjs +3 -3
  148. package/segment-group/segment-group-label.cjs +2 -2
  149. package/segment-group/segment-group-label.mjs +2 -2
  150. package/segment-group/segment-group.cjs +4 -4
  151. package/segment-group/segment-group.mjs +4 -4
  152. package/select/select-item-group.cjs +2 -2
  153. package/select/select-item-group.mjs +2 -2
  154. package/select/select.cjs +1 -1
  155. package/select/select.d.ts +1 -1
  156. package/select/select.mjs +1 -1
  157. package/select/select.stories.d.ts +1 -0
  158. package/slider/slider.stories.d.ts +1 -1
  159. package/switch/switch.cjs +2 -2
  160. package/switch/switch.mjs +2 -2
  161. package/toast/create-toaster.cjs +2 -2
  162. package/toast/create-toaster.d.ts +1 -1
  163. package/toast/create-toaster.mjs +2 -2
  164. package/toast/index.cjs +5 -2
  165. package/toast/index.d.ts +6 -4
  166. package/toast/index.mjs +5 -3
  167. package/toast/toast-group.cjs +15 -0
  168. package/toast/toast-group.d.ts +6 -0
  169. package/toast/toast-group.mjs +11 -0
  170. package/tooltip/tooltip.cjs +2 -1
  171. package/tooltip/tooltip.mjs +2 -1
  172. package/use-is-server.cjs +16 -0
  173. package/use-is-server.d.ts +1 -0
  174. package/use-is-server.mjs +12 -0
  175. package/segment-group/segment-group.anatomy.cjs +0 -10
  176. package/segment-group/segment-group.anatomy.d.ts +0 -2
  177. package/segment-group/segment-group.anatomy.mjs +0 -6
  178. /package/number-input/{number-input-field.cjs → number-input-input.cjs} +0 -0
  179. /package/number-input/{number-input-field.d.ts → number-input-input.d.ts} +0 -0
  180. /package/number-input/{number-input-field.mjs → number-input-input.mjs} +0 -0
  181. /package/pin-input/{pin-input-field.cjs → pin-input-input.cjs} +0 -0
  182. /package/pin-input/{pin-input-field.d.ts → pin-input-input.d.ts} +0 -0
  183. /package/pin-input/{pin-input-field.mjs → pin-input-input.mjs} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ark-ui/react",
3
- "version": "1.0.1",
3
+ "version": "1.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",
@@ -13,6 +13,7 @@
13
13
  "dialog",
14
14
  "editable",
15
15
  "environment",
16
+ "file upload",
16
17
  "hover card",
17
18
  "menu",
18
19
  "number input",
@@ -59,74 +60,78 @@
59
60
  "release-it": "release-it --config ../../../release-it.json"
60
61
  },
61
62
  "dependencies": {
62
- "@ark-ui/anatomy": "1.0.0",
63
- "@zag-js/accordion": "0.29.0",
64
- "@zag-js/avatar": "0.29.0",
65
- "@zag-js/carousel": "0.29.0",
66
- "@zag-js/checkbox": "0.29.0",
67
- "@zag-js/color-picker": "0.29.0",
68
- "@zag-js/color-utils": "0.29.0",
69
- "@zag-js/combobox": "0.29.0",
70
- "@zag-js/core": "0.29.0",
71
- "@zag-js/date-picker": "0.29.0",
72
- "@zag-js/date-utils": "0.29.0",
73
- "@zag-js/dialog": "0.29.0",
74
- "@zag-js/editable": "0.29.0",
75
- "@zag-js/hover-card": "0.29.0",
76
- "@zag-js/menu": "0.29.0",
77
- "@zag-js/number-input": "0.29.0",
78
- "@zag-js/pagination": "0.29.0",
79
- "@zag-js/pin-input": "0.29.0",
80
- "@zag-js/popover": "0.29.0",
81
- "@zag-js/presence": "0.29.0",
82
- "@zag-js/radio-group": "0.29.0",
83
- "@zag-js/rating-group": "0.29.0",
84
- "@zag-js/react": "0.29.0",
85
- "@zag-js/select": "0.29.0",
86
- "@zag-js/slider": "0.29.0",
87
- "@zag-js/splitter": "0.29.0",
88
- "@zag-js/switch": "0.29.0",
89
- "@zag-js/tabs": "0.29.0",
90
- "@zag-js/tags-input": "0.29.0",
91
- "@zag-js/toast": "0.29.0",
92
- "@zag-js/toggle-group": "0.29.0",
93
- "@zag-js/tooltip": "0.29.0",
94
- "@zag-js/types": "0.29.0"
63
+ "@ark-ui/anatomy": "1.2.0",
64
+ "@zag-js/accordion": "0.31.1",
65
+ "@zag-js/avatar": "0.31.1",
66
+ "@zag-js/carousel": "0.31.1",
67
+ "@zag-js/checkbox": "0.31.1",
68
+ "@zag-js/color-picker": "0.31.1",
69
+ "@zag-js/color-utils": "0.31.1",
70
+ "@zag-js/combobox": "0.31.1",
71
+ "@zag-js/core": "0.31.1",
72
+ "@zag-js/date-picker": "0.31.1",
73
+ "@zag-js/date-utils": "0.31.1",
74
+ "@zag-js/dialog": "0.31.1",
75
+ "@zag-js/editable": "0.31.1",
76
+ "@zag-js/file-upload": "0.31.1",
77
+ "@zag-js/hover-card": "0.31.1",
78
+ "@zag-js/menu": "0.31.1",
79
+ "@zag-js/number-input": "0.31.1",
80
+ "@zag-js/pagination": "0.31.1",
81
+ "@zag-js/pin-input": "0.31.1",
82
+ "@zag-js/popover": "0.31.1",
83
+ "@zag-js/presence": "0.31.1",
84
+ "@zag-js/radio-group": "0.31.1",
85
+ "@zag-js/rating-group": "0.31.1",
86
+ "@zag-js/react": "0.31.1",
87
+ "@zag-js/select": "0.31.1",
88
+ "@zag-js/slider": "0.31.1",
89
+ "@zag-js/splitter": "0.31.1",
90
+ "@zag-js/switch": "0.31.1",
91
+ "@zag-js/tabs": "0.31.1",
92
+ "@zag-js/tags-input": "0.31.1",
93
+ "@zag-js/toast": "0.31.1",
94
+ "@zag-js/toggle-group": "0.31.1",
95
+ "@zag-js/tooltip": "0.31.1",
96
+ "@zag-js/types": "0.31.1"
95
97
  },
96
98
  "devDependencies": {
97
- "@release-it/keep-a-changelog": "4.0.0",
98
- "@storybook/addon-a11y": "7.5.3",
99
- "@storybook/addon-essentials": "7.5.3",
100
- "@storybook/addons": "7.5.3",
101
- "@storybook/react": "7.5.3",
102
- "@storybook/react-vite": "7.5.3",
99
+ "@release-it/keep-a-changelog": "5.0.0",
100
+ "@storybook/addon-a11y": "7.6.4",
101
+ "@storybook/addon-essentials": "7.6.4",
102
+ "@storybook/addons": "7.6.4",
103
+ "@storybook/react": "7.6.4",
104
+ "@storybook/react-vite": "7.6.4",
103
105
  "@testing-library/dom": "9.3.3",
104
- "@testing-library/jest-dom": "6.1.4",
105
- "@testing-library/react": "14.1.0",
106
+ "@testing-library/jest-dom": "6.1.5",
107
+ "@testing-library/react": "14.1.2",
106
108
  "@testing-library/user-event": "14.5.1",
107
- "@types/jsdom": "21.1.5",
108
- "@types/react": "18.2.37",
109
- "@types/react-dom": "18.2.15",
109
+ "@types/jsdom": "21.1.6",
110
+ "@types/react": "18.2.42",
111
+ "@types/react-dom": "18.2.17",
110
112
  "@types/testing-library__jest-dom": "5.14.9",
111
- "@typescript-eslint/eslint-plugin": "6.10.0",
112
- "@typescript-eslint/parser": "6.10.0",
113
- "@vitejs/plugin-react": "4.1.1",
113
+ "@typescript-eslint/eslint-plugin": "6.14.0",
114
+ "@typescript-eslint/parser": "6.14.0",
115
+ "@vitejs/plugin-react": "4.2.1",
114
116
  "@vitest/coverage-v8": "0.34.6",
115
- "eslint": "8.53.0",
117
+ "eslint": "8.55.0",
118
+ "eslint-plugin-jest-dom": "5.1.0",
116
119
  "eslint-plugin-react": "7.33.2",
117
120
  "eslint-plugin-react-hooks": "4.6.0",
118
- "globby": "13.2.2",
119
- "jsdom": "22.1.0",
120
- "lucide-react": "0.292.0",
121
+ "eslint-plugin-testing-library": "6.2.0",
122
+ "globby": "14.0.0",
123
+ "jsdom": "23.0.1",
124
+ "lucide-react": "0.294.0",
121
125
  "react": "18.2.0",
122
126
  "react-dom": "18.2.0",
123
127
  "react-frame-component": "5.2.6",
124
- "release-it": "16.2.1",
128
+ "react-hook-form": "7.49.2",
129
+ "release-it": "17.0.1",
125
130
  "resize-observer-polyfill": "1.5.1",
126
- "storybook": "7.5.3",
127
- "typescript": "5.2.2",
128
- "vite": "4.5.0",
129
- "vite-plugin-dts": "3.6.3",
131
+ "storybook": "7.6.4",
132
+ "typescript": "5.3.3",
133
+ "vite": "5.0.8",
134
+ "vite-plugin-dts": "3.6.4",
130
135
  "vitest": "0.34.6"
131
136
  },
132
137
  "peerDependencies": {
@@ -195,6 +200,11 @@
195
200
  "import": "./environment/index.mjs",
196
201
  "require": "./environment/index.cjs"
197
202
  },
203
+ "./file-upload": {
204
+ "types": "./file-upload/index.d.ts",
205
+ "import": "./file-upload/index.mjs",
206
+ "require": "./file-upload/index.cjs"
207
+ },
198
208
  "./hover-card": {
199
209
  "types": "./hover-card/index.d.ts",
200
210
  "import": "./hover-card/index.mjs",
@@ -290,6 +300,11 @@
290
300
  "import": "./tooltip/index.mjs",
291
301
  "require": "./tooltip/index.cjs"
292
302
  },
303
+ "./factory": {
304
+ "types": "./factory/factory.d.ts",
305
+ "import": "./factory.mjs",
306
+ "require": "./factory.cjs"
307
+ },
293
308
  "./package.json": "./package.json"
294
309
  }
295
310
  }
@@ -11,7 +11,7 @@ const factory = require('../factory.cjs');
11
11
  const paginationContext = require('./pagination-context.cjs');
12
12
 
13
13
  const PaginationItem = react.forwardRef((props, ref) => {
14
- const [itemProps, localProps] = createSplitProps.createSplitProps()(props, ["type", "value"]);
14
+ const [itemProps, localProps] = createSplitProps.createSplitProps()(props, ["value", "type"]);
15
15
  const api = paginationContext.usePaginationContext();
16
16
  const mergedProps = react$1.mergeProps(api.getItemProps(itemProps), localProps);
17
17
  return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.button, { ...mergedProps, ref });
@@ -7,7 +7,7 @@ import { ark } from '../factory.mjs';
7
7
  import { usePaginationContext } from './pagination-context.mjs';
8
8
 
9
9
  const PaginationItem = forwardRef((props, ref) => {
10
- const [itemProps, localProps] = createSplitProps()(props, ["type", "value"]);
10
+ const [itemProps, localProps] = createSplitProps()(props, ["value", "type"]);
11
11
  const api = usePaginationContext();
12
12
  const mergedProps = mergeProps(api.getItemProps(itemProps), localProps);
13
13
  return /* @__PURE__ */ jsx(ark.button, { ...mergedProps, ref });
@@ -13,7 +13,7 @@ const paginationContext = require('./pagination-context.cjs');
13
13
  const usePagination = require('./use-pagination.cjs');
14
14
 
15
15
  const Pagination = react.forwardRef((props, ref) => {
16
- const [paginationProps, { children, ...navProps }] = createSplitProps.createSplitProps()(
16
+ const [paginationProps, { children, ...localProps }] = createSplitProps.createSplitProps()(
17
17
  props,
18
18
  [
19
19
  "count",
@@ -31,8 +31,8 @@ const Pagination = react.forwardRef((props, ref) => {
31
31
  ]
32
32
  );
33
33
  const api = usePagination.usePagination(paginationProps);
34
+ const mergedProps = react$1.mergeProps(api.rootProps, localProps);
34
35
  const view = runIfFn.runIfFn(children, api);
35
- const mergedProps = react$1.mergeProps(api.rootProps, navProps);
36
36
  return /* @__PURE__ */ jsxRuntime.jsx(paginationContext.PaginationProvider, { value: api, children: /* @__PURE__ */ jsxRuntime.jsx(factory.ark.nav, { ...mergedProps, ref, children: view }) });
37
37
  });
38
38
  Pagination.displayName = "Pagination";
@@ -9,7 +9,7 @@ import { PaginationProvider } from './pagination-context.mjs';
9
9
  import { usePagination } from './use-pagination.mjs';
10
10
 
11
11
  const Pagination = forwardRef((props, ref) => {
12
- const [paginationProps, { children, ...navProps }] = createSplitProps()(
12
+ const [paginationProps, { children, ...localProps }] = createSplitProps()(
13
13
  props,
14
14
  [
15
15
  "count",
@@ -27,8 +27,8 @@ const Pagination = forwardRef((props, ref) => {
27
27
  ]
28
28
  );
29
29
  const api = usePagination(paginationProps);
30
+ const mergedProps = mergeProps(api.rootProps, localProps);
30
31
  const view = runIfFn(children, api);
31
- const mergedProps = mergeProps(api.rootProps, navProps);
32
32
  return /* @__PURE__ */ jsx(PaginationProvider, { value: api, children: /* @__PURE__ */ jsx(ark.nav, { ...mergedProps, ref, children: view }) });
33
33
  });
34
34
  Pagination.displayName = "Pagination";
@@ -6,18 +6,18 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
6
6
  const pinInput = require('./pin-input.cjs');
7
7
  const pinInputContext = require('./pin-input-context.cjs');
8
8
  const pinInputControl = require('./pin-input-control.cjs');
9
- const pinInputField = require('./pin-input-field.cjs');
9
+ const pinInputInput = require('./pin-input-input.cjs');
10
10
  const pinInputLabel = require('./pin-input-label.cjs');
11
11
 
12
12
  const PinInput = Object.assign(pinInput.PinInput, {
13
13
  Root: pinInput.PinInput,
14
14
  Control: pinInputControl.PinInputControl,
15
- Input: pinInputField.PinInputInput,
15
+ Input: pinInputInput.PinInputInput,
16
16
  Label: pinInputLabel.PinInputLabel
17
17
  });
18
18
 
19
19
  exports.usePinInputContext = pinInputContext.usePinInputContext;
20
20
  exports.PinInputControl = pinInputControl.PinInputControl;
21
- exports.PinInputInput = pinInputField.PinInputInput;
21
+ exports.PinInputInput = pinInputInput.PinInputInput;
22
22
  exports.PinInputLabel = pinInputLabel.PinInputLabel;
23
23
  exports.PinInput = PinInput;
@@ -3,7 +3,7 @@ import { ForwardRefExoticComponent, RefAttributes } from 'react';
3
3
  import { type PinInputProps } from './pin-input';
4
4
  import { usePinInputContext, type PinInputContext } from './pin-input-context';
5
5
  import { PinInputControl, type PinInputControlProps } from './pin-input-control';
6
- import { PinInputInput, type PinInputInputProps } from './pin-input-field';
6
+ import { PinInputInput, type PinInputInputProps } from './pin-input-input';
7
7
  import { PinInputLabel, type PinInputLabelProps } from './pin-input-label';
8
8
  declare const PinInput: ForwardRefExoticComponent<PinInputProps & RefAttributes<HTMLDivElement>> & {
9
9
  Root: ForwardRefExoticComponent<PinInputProps & RefAttributes<HTMLDivElement>>;
@@ -2,7 +2,7 @@
2
2
  import { PinInput as PinInput$1 } from './pin-input.mjs';
3
3
  export { usePinInputContext } from './pin-input-context.mjs';
4
4
  import { PinInputControl } from './pin-input-control.mjs';
5
- import { PinInputInput } from './pin-input-field.mjs';
5
+ import { PinInputInput } from './pin-input-input.mjs';
6
6
  import { PinInputLabel } from './pin-input-label.mjs';
7
7
 
8
8
  const PinInput = Object.assign(PinInput$1, {
@@ -12,7 +12,7 @@ const pinInputContext = require('./pin-input-context.cjs');
12
12
  const usePinInput = require('./use-pin-input.cjs');
13
13
 
14
14
  const PinInput = react.forwardRef((props, ref) => {
15
- const [usePinInputProps, divProps] = createSplitProps.createSplitProps()(props, [
15
+ const [usePinInputProps, localProps] = createSplitProps.createSplitProps()(props, [
16
16
  "autoFocus",
17
17
  "blurOnComplete",
18
18
  "defaultValue",
@@ -37,7 +37,7 @@ const PinInput = react.forwardRef((props, ref) => {
37
37
  "value"
38
38
  ]);
39
39
  const api = usePinInput.usePinInput(usePinInputProps);
40
- const mergedProps = react$1.mergeProps(api.rootProps, divProps);
40
+ const mergedProps = react$1.mergeProps(api.rootProps, localProps);
41
41
  return /* @__PURE__ */ jsxRuntime.jsxs(pinInputContext.PinInputProvider, { value: api, children: [
42
42
  /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref }),
43
43
  /* @__PURE__ */ jsxRuntime.jsx("input", { ...api.hiddenInputProps })
@@ -8,7 +8,7 @@ import { PinInputProvider } from './pin-input-context.mjs';
8
8
  import { usePinInput } from './use-pin-input.mjs';
9
9
 
10
10
  const PinInput = forwardRef((props, ref) => {
11
- const [usePinInputProps, divProps] = createSplitProps()(props, [
11
+ const [usePinInputProps, localProps] = createSplitProps()(props, [
12
12
  "autoFocus",
13
13
  "blurOnComplete",
14
14
  "defaultValue",
@@ -33,7 +33,7 @@ const PinInput = forwardRef((props, ref) => {
33
33
  "value"
34
34
  ]);
35
35
  const api = usePinInput(usePinInputProps);
36
- const mergedProps = mergeProps(api.rootProps, divProps);
36
+ const mergedProps = mergeProps(api.rootProps, localProps);
37
37
  return /* @__PURE__ */ jsxs(PinInputProvider, { value: api, children: [
38
38
  /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref }),
39
39
  /* @__PURE__ */ jsx("input", { ...api.hiddenInputProps })
@@ -4,6 +4,7 @@
4
4
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
5
 
6
6
  const jsxRuntime = require('react/jsx-runtime');
7
+ const react = require('@zag-js/react');
7
8
  require('react');
8
9
  require('../presence/index.cjs');
9
10
  const splitPresenceProps = require('../presence/split-presence-props.cjs');
@@ -16,7 +17,7 @@ const presenceContext = require('../presence/presence-context.cjs');
16
17
  const Popover = (props) => {
17
18
  const [presenceProps, { children, ...localProps }] = splitPresenceProps.splitPresenceProps(props);
18
19
  const api = usePopover.usePopover(localProps);
19
- const presenceApi = usePresence.usePresence({ ...presenceProps, present: api.isOpen });
20
+ const presenceApi = usePresence.usePresence(react.mergeProps({ present: api.isOpen }, presenceProps));
20
21
  const view = runIfFn.runIfFn(children, api);
21
22
  return /* @__PURE__ */ jsxRuntime.jsx(popoverContext.PopoverProvider, { value: api, children: /* @__PURE__ */ jsxRuntime.jsx(presenceContext.PresenceProvider, { value: presenceApi, children: view }) });
22
23
  };
@@ -1,5 +1,6 @@
1
1
  'use client';
2
2
  import { jsx } from 'react/jsx-runtime';
3
+ import { mergeProps } from '@zag-js/react';
3
4
  import 'react';
4
5
  import '../presence/index.mjs';
5
6
  import { splitPresenceProps } from '../presence/split-presence-props.mjs';
@@ -12,7 +13,7 @@ import { PresenceProvider } from '../presence/presence-context.mjs';
12
13
  const Popover = (props) => {
13
14
  const [presenceProps, { children, ...localProps }] = splitPresenceProps(props);
14
15
  const api = usePopover(localProps);
15
- const presenceApi = usePresence({ ...presenceProps, present: api.isOpen });
16
+ const presenceApi = usePresence(mergeProps({ present: api.isOpen }, presenceProps));
16
17
  const view = runIfFn(children, api);
17
18
  return /* @__PURE__ */ jsx(PopoverProvider, { value: api, children: /* @__PURE__ */ jsx(PresenceProvider, { value: presenceApi, children: view }) });
18
19
  };
package/portal.cjs CHANGED
@@ -6,11 +6,12 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
6
6
  const react = require('react');
7
7
  const reactDom = require('react-dom');
8
8
  require('./environment/index.cjs');
9
+ const useIsServer = require('./use-is-server.cjs');
9
10
  const environmentContext = require('./environment/environment-context.cjs');
10
11
 
11
- const isServer = typeof window === "undefined";
12
12
  const Portal = (props) => {
13
13
  const { children, container, disabled } = props;
14
+ const isServer = useIsServer.useIsServer();
14
15
  const getRootNode = environmentContext.useEnvironmentContext();
15
16
  if (isServer || disabled)
16
17
  return children;
package/portal.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { ReactNode, type PropsWithChildren, type RefObject } from 'react';
1
+ import { type PropsWithChildren, type ReactNode, type ReactPortal, type RefObject } from 'react';
2
2
  export interface PortalProps {
3
3
  disabled?: boolean;
4
4
  container?: RefObject<HTMLElement>;
5
5
  }
6
- export declare const Portal: (props: PropsWithChildren<PortalProps>) => ReactNode;
6
+ export declare const Portal: (props: PropsWithChildren<PortalProps>) => ReactPortal[] | ReactNode | null | undefined;
package/portal.mjs CHANGED
@@ -2,11 +2,12 @@
2
2
  import { Children } from 'react';
3
3
  import { createPortal } from 'react-dom';
4
4
  import './environment/index.mjs';
5
+ import { useIsServer } from './use-is-server.mjs';
5
6
  import { useEnvironmentContext } from './environment/environment-context.mjs';
6
7
 
7
- const isServer = typeof window === "undefined";
8
8
  const Portal = (props) => {
9
9
  const { children, container, disabled } = props;
10
+ const isServer = useIsServer();
10
11
  const getRootNode = useEnvironmentContext();
11
12
  if (isServer || disabled)
12
13
  return children;
@@ -4,7 +4,6 @@
4
4
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
5
 
6
6
  const jsxRuntime = require('react/jsx-runtime');
7
- const anatomy = require('@ark-ui/anatomy');
8
7
  const react$1 = require('@zag-js/react');
9
8
  const react = require('react');
10
9
  const factory = require('../factory.cjs');
@@ -14,7 +13,7 @@ const RadioGroupIndicator = react.forwardRef(
14
13
  (props, ref) => {
15
14
  const api = radioGroupContext.useRadioGroupContext();
16
15
  const mergedProps = react$1.mergeProps(api.indicatorProps, props);
17
- return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ...anatomy.radioGroupAnatomy.build().indicator.attrs, ref });
16
+ return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref });
18
17
  }
19
18
  );
20
19
  RadioGroupIndicator.displayName = "RadioGroupIndicator";
@@ -1,6 +1,5 @@
1
1
  'use client';
2
2
  import { jsx } from 'react/jsx-runtime';
3
- import { radioGroupAnatomy } from '@ark-ui/anatomy';
4
3
  import { mergeProps } from '@zag-js/react';
5
4
  import { forwardRef } from 'react';
6
5
  import { ark } from '../factory.mjs';
@@ -10,7 +9,7 @@ const RadioGroupIndicator = forwardRef(
10
9
  (props, ref) => {
11
10
  const api = useRadioGroupContext();
12
11
  const mergedProps = mergeProps(api.indicatorProps, props);
13
- return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ...radioGroupAnatomy.build().indicator.attrs, ref });
12
+ return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });
14
13
  }
15
14
  );
16
15
  RadioGroupIndicator.displayName = "RadioGroupIndicator";
@@ -3,7 +3,7 @@ import { ForwardRefExoticComponent, RefAttributes, type ReactNode } from 'react'
3
3
  import { type HTMLArkProps } from '../factory';
4
4
  import type { Assign } from '../types';
5
5
  export interface RadioGroupItemProps extends Assign<HTMLArkProps<'label'>, {
6
- children?: ReactNode | ((state: ItemState) => ReactNode);
6
+ children?: ((state: ItemState) => ReactNode) | ReactNode;
7
7
  }>, ItemProps {
8
8
  }
9
9
  export declare const RadioGroupItem: ForwardRefExoticComponent<RadioGroupItemProps & RefAttributes<HTMLLabelElement>>;
@@ -12,7 +12,7 @@ const radioGroupContext = require('./radio-group-context.cjs');
12
12
  const useRadioGroup = require('./use-radio-group.cjs');
13
13
 
14
14
  const RadioGroup = react.forwardRef((props, ref) => {
15
- const [useRadioGroupProps, divProps] = createSplitProps.createSplitProps()(props, [
15
+ const [useRadioGroupProps, localProps] = createSplitProps.createSplitProps()(props, [
16
16
  "defaultValue",
17
17
  "dir",
18
18
  "disabled",
@@ -26,7 +26,7 @@ const RadioGroup = react.forwardRef((props, ref) => {
26
26
  "value"
27
27
  ]);
28
28
  const api = useRadioGroup.useRadioGroup(useRadioGroupProps);
29
- const mergedProps = react$1.mergeProps(api.rootProps, divProps);
29
+ const mergedProps = react$1.mergeProps(api.rootProps, localProps);
30
30
  return /* @__PURE__ */ jsxRuntime.jsx(radioGroupContext.RadioGroupProvider, { value: api, children: /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref }) });
31
31
  });
32
32
  RadioGroup.displayName = "RadioGroup";
@@ -8,7 +8,7 @@ import { RadioGroupProvider } from './radio-group-context.mjs';
8
8
  import { useRadioGroup } from './use-radio-group.mjs';
9
9
 
10
10
  const RadioGroup = forwardRef((props, ref) => {
11
- const [useRadioGroupProps, divProps] = createSplitProps()(props, [
11
+ const [useRadioGroupProps, localProps] = createSplitProps()(props, [
12
12
  "defaultValue",
13
13
  "dir",
14
14
  "disabled",
@@ -22,7 +22,7 @@ const RadioGroup = forwardRef((props, ref) => {
22
22
  "value"
23
23
  ]);
24
24
  const api = useRadioGroup(useRadioGroupProps);
25
- const mergedProps = mergeProps(api.rootProps, divProps);
25
+ const mergedProps = mergeProps(api.rootProps, localProps);
26
26
  return /* @__PURE__ */ jsx(RadioGroupProvider, { value: api, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref }) });
27
27
  });
28
28
  RadioGroup.displayName = "RadioGroup";
@@ -7,4 +7,4 @@ export default meta;
7
7
  export declare const Basic: () => JSX.Element;
8
8
  export declare const Disabled: () => JSX.Element;
9
9
  export declare const InitialValue: () => JSX.Element;
10
- export declare const OnChange: () => JSX.Element;
10
+ export declare const OnEvent: () => JSX.Element;
@@ -12,9 +12,9 @@ const ratingGroupContext = require('./rating-group-context.cjs');
12
12
 
13
13
  const RatingGroupControl = react.forwardRef(
14
14
  (props, ref) => {
15
- const { children, ...divProps } = props;
15
+ const { children, ...localProps } = props;
16
16
  const api = ratingGroupContext.useRatingGroupContext();
17
- const mergedProps = react$1.mergeProps(api.controlProps, divProps);
17
+ const mergedProps = react$1.mergeProps(api.controlProps, localProps);
18
18
  const view = runIfFn.runIfFn(children, api);
19
19
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
20
20
  /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref, children: view }),
@@ -8,9 +8,9 @@ import { useRatingGroupContext } from './rating-group-context.mjs';
8
8
 
9
9
  const RatingGroupControl = forwardRef(
10
10
  (props, ref) => {
11
- const { children, ...divProps } = props;
11
+ const { children, ...localProps } = props;
12
12
  const api = useRatingGroupContext();
13
- const mergedProps = mergeProps(api.controlProps, divProps);
13
+ const mergedProps = mergeProps(api.controlProps, localProps);
14
14
  const view = runIfFn(children, api);
15
15
  return /* @__PURE__ */ jsxs(Fragment, { children: [
16
16
  /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref, children: view }),
@@ -1,6 +1,6 @@
1
1
  import { Provider } from 'react';
2
2
  /// <reference types="react" />
3
- import { type ItemState } from '@zag-js/rating-group';
4
- export interface RatingGroupItemContext extends ItemState {
3
+ import { type ItemProps } from '@zag-js/rating-group';
4
+ export interface RatingGroupItemContext extends ItemProps {
5
5
  }
6
6
  export declare const RatingGroupItemProvider: Provider<RatingGroupItemContext>, useRatingGroupItemContext: () => RatingGroupItemContext;
@@ -6,18 +6,19 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
6
6
  const jsxRuntime = require('react/jsx-runtime');
7
7
  const react$1 = require('@zag-js/react');
8
8
  const react = require('react');
9
+ const createSplitProps = require('../create-split-props.cjs');
9
10
  const factory = require('../factory.cjs');
10
11
  const runIfFn = require('../run-if-fn.cjs');
11
12
  const ratingGroupContext = require('./rating-group-context.cjs');
12
13
  const ratingGroupItemContext = require('./rating-group-item-context.cjs');
13
14
 
14
15
  const RatingGroupItem = react.forwardRef((props, ref) => {
15
- const { children, index, ...divProps } = props;
16
+ const [itemProps, { children, ...localProps }] = createSplitProps.createSplitProps()(props, ["index"]);
16
17
  const api = ratingGroupContext.useRatingGroupContext();
17
- const itemState = api.getItemState({ index });
18
- const mergedProps = react$1.mergeProps(api.getItemProps({ index }), divProps);
18
+ const mergedProps = react$1.mergeProps(api.getItemProps(itemProps), localProps);
19
+ const itemState = api.getItemState(itemProps);
19
20
  const view = runIfFn.runIfFn(children, itemState);
20
- return /* @__PURE__ */ jsxRuntime.jsx(ratingGroupItemContext.RatingGroupItemProvider, { value: itemState, children: /* @__PURE__ */ jsxRuntime.jsx(factory.ark.span, { ...mergedProps, ref, children: view }) });
21
+ return /* @__PURE__ */ jsxRuntime.jsx(ratingGroupItemContext.RatingGroupItemProvider, { value: itemProps, children: /* @__PURE__ */ jsxRuntime.jsx(factory.ark.span, { ...mergedProps, ref, children: view }) });
21
22
  });
22
23
  RatingGroupItem.displayName = "RatingGroupItem";
23
24
 
@@ -2,18 +2,19 @@
2
2
  import { jsx } from 'react/jsx-runtime';
3
3
  import { mergeProps } from '@zag-js/react';
4
4
  import { forwardRef } from 'react';
5
+ import { createSplitProps } from '../create-split-props.mjs';
5
6
  import { ark } from '../factory.mjs';
6
7
  import { runIfFn } from '../run-if-fn.mjs';
7
8
  import { useRatingGroupContext } from './rating-group-context.mjs';
8
9
  import { RatingGroupItemProvider } from './rating-group-item-context.mjs';
9
10
 
10
11
  const RatingGroupItem = forwardRef((props, ref) => {
11
- const { children, index, ...divProps } = props;
12
+ const [itemProps, { children, ...localProps }] = createSplitProps()(props, ["index"]);
12
13
  const api = useRatingGroupContext();
13
- const itemState = api.getItemState({ index });
14
- const mergedProps = mergeProps(api.getItemProps({ index }), divProps);
14
+ const mergedProps = mergeProps(api.getItemProps(itemProps), localProps);
15
+ const itemState = api.getItemState(itemProps);
15
16
  const view = runIfFn(children, itemState);
16
- return /* @__PURE__ */ jsx(RatingGroupItemProvider, { value: itemState, children: /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref, children: view }) });
17
+ return /* @__PURE__ */ jsx(RatingGroupItemProvider, { value: itemProps, children: /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref, children: view }) });
17
18
  });
18
19
  RatingGroupItem.displayName = "RatingGroupItem";
19
20
 
@@ -12,7 +12,7 @@ const ratingGroupContext = require('./rating-group-context.cjs');
12
12
  const useRatingGroup = require('./use-rating-group.cjs');
13
13
 
14
14
  const RatingGroup = react.forwardRef((props, ref) => {
15
- const [useRatingProps, inputProps] = createSplitProps.createSplitProps()(props, [
15
+ const [useRatingProps, localProps] = createSplitProps.createSplitProps()(props, [
16
16
  "allowHalf",
17
17
  "autoFocus",
18
18
  "count",
@@ -31,7 +31,7 @@ const RatingGroup = react.forwardRef((props, ref) => {
31
31
  "value"
32
32
  ]);
33
33
  const api = useRatingGroup.useRatingGroup(useRatingProps);
34
- const mergedProps = react$1.mergeProps(api.rootProps, inputProps);
34
+ const mergedProps = react$1.mergeProps(api.rootProps, localProps);
35
35
  return /* @__PURE__ */ jsxRuntime.jsx(ratingGroupContext.RatingGroupProvider, { value: api, children: /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref }) });
36
36
  });
37
37
  RatingGroup.displayName = "RatingGroup";
@@ -8,7 +8,7 @@ import { RatingGroupProvider } from './rating-group-context.mjs';
8
8
  import { useRatingGroup } from './use-rating-group.mjs';
9
9
 
10
10
  const RatingGroup = forwardRef((props, ref) => {
11
- const [useRatingProps, inputProps] = createSplitProps()(props, [
11
+ const [useRatingProps, localProps] = createSplitProps()(props, [
12
12
  "allowHalf",
13
13
  "autoFocus",
14
14
  "count",
@@ -27,7 +27,7 @@ const RatingGroup = forwardRef((props, ref) => {
27
27
  "value"
28
28
  ]);
29
29
  const api = useRatingGroup(useRatingProps);
30
- const mergedProps = mergeProps(api.rootProps, inputProps);
30
+ const mergedProps = mergeProps(api.rootProps, localProps);
31
31
  return /* @__PURE__ */ jsx(RatingGroupProvider, { value: api, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref }) });
32
32
  });
33
33
  RatingGroup.displayName = "RatingGroup";