@serendie/ui 2.0.0 → 2.1.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 (118) hide show
  1. package/dist/components/CheckBox/CheckBox.js +36 -35
  2. package/dist/components/ChoiceBox/ChoiceBox.js +41 -41
  3. package/dist/components/DataTable/DataTableComponent.d.ts +3 -20
  4. package/dist/components/DataTable/DataTableComponent.js +38 -36
  5. package/dist/components/DataTable/table/HeaderCheckbox.js +29 -19
  6. package/dist/components/Search/Search.d.ts +3 -1
  7. package/dist/components/Search/Search.js +34 -33
  8. package/dist/components/Select/Select.d.ts +2 -1
  9. package/dist/components/Select/Select.js +47 -41
  10. package/dist/components/Tooltip/Tooltip.d.ts +14 -0
  11. package/dist/components/Tooltip/Tooltip.js +70 -0
  12. package/dist/components/Tooltip/index.d.ts +1 -0
  13. package/dist/components/Tooltip/index.js +4 -0
  14. package/dist/index.d.ts +1 -0
  15. package/dist/index.js +12 -10
  16. package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item-content.js +4 -6
  17. package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item-indicator.js +4 -6
  18. package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item-trigger.js +10 -12
  19. package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item.js +16 -16
  20. package/dist/node_modules/@ark-ui/react/dist/components/accordion/use-accordion.js +13 -20
  21. package/dist/node_modules/@ark-ui/react/dist/components/avatar/avatar-root.js +1 -5
  22. package/dist/node_modules/@ark-ui/react/dist/components/avatar/use-avatar.js +14 -18
  23. package/dist/node_modules/@ark-ui/react/dist/components/checkbox/checkbox-hidden-input.js +4 -6
  24. package/dist/node_modules/@ark-ui/react/dist/components/checkbox/use-checkbox.js +22 -28
  25. package/dist/node_modules/@ark-ui/react/dist/components/collapsible/collapsible-content.js +7 -9
  26. package/dist/node_modules/@ark-ui/react/dist/components/collapsible/use-collapsible.js +14 -21
  27. package/dist/node_modules/@ark-ui/react/dist/components/collection/list-collection.js +5 -0
  28. package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-content.js +9 -8
  29. package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-item-group.js +4 -6
  30. package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-positioner.js +4 -6
  31. package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-root.js +17 -18
  32. package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-trigger.js +10 -9
  33. package/dist/node_modules/@ark-ui/react/dist/components/combobox/use-combobox-item-context.js +5 -7
  34. package/dist/node_modules/@ark-ui/react/dist/components/combobox/use-combobox.js +21 -45
  35. package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-backdrop.js +10 -9
  36. package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-close-trigger.js +4 -6
  37. package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-content.js +6 -5
  38. package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-description.js +4 -6
  39. package/dist/node_modules/@ark-ui/react/dist/components/dialog/use-dialog.js +13 -22
  40. package/dist/node_modules/@ark-ui/react/dist/components/factory.js +26 -24
  41. package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-content.js +9 -8
  42. package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-item-group.js +1 -3
  43. package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-item.js +15 -13
  44. package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-root.js +13 -14
  45. package/dist/node_modules/@ark-ui/react/dist/components/menu/use-menu-option-item-props-context.js +10 -0
  46. package/dist/node_modules/@ark-ui/react/dist/components/menu/use-menu.js +14 -21
  47. package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-ellipsis.js +4 -6
  48. package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-next-trigger.js +4 -6
  49. package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-prev-trigger.js +4 -6
  50. package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-root.js +5 -4
  51. package/dist/node_modules/@ark-ui/react/dist/components/pagination/use-pagination.js +13 -19
  52. package/dist/node_modules/@ark-ui/react/dist/components/portal/portal.js +25 -16
  53. package/dist/node_modules/@ark-ui/react/dist/components/presence/split-presence-props.js +3 -2
  54. package/dist/node_modules/@ark-ui/react/dist/components/presence/use-presence.js +18 -18
  55. package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item-control.js +4 -6
  56. package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item-text.js +4 -6
  57. package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item.js +1 -5
  58. package/dist/node_modules/@ark-ui/react/dist/components/radio-group/use-radio-group.js +14 -22
  59. package/dist/node_modules/@ark-ui/react/dist/components/select/select-content.js +9 -8
  60. package/dist/node_modules/@ark-ui/react/dist/components/select/select-root.js +11 -12
  61. package/dist/node_modules/@ark-ui/react/dist/components/select/use-select.js +20 -47
  62. package/dist/node_modules/@ark-ui/react/dist/components/switch/switch-hidden-input.js +4 -6
  63. package/dist/node_modules/@ark-ui/react/dist/components/switch/use-switch.js +20 -26
  64. package/dist/node_modules/@ark-ui/react/dist/components/tabs/tabs-root.js +9 -8
  65. package/dist/node_modules/@ark-ui/react/dist/components/tabs/use-tabs.js +14 -21
  66. package/dist/node_modules/@ark-ui/react/dist/components/toast/create-toaster.js +3 -7
  67. package/dist/node_modules/@ark-ui/react/dist/components/toast/toaster.js +28 -15
  68. package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-arrow-tip.js +13 -0
  69. package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-arrow.js +13 -0
  70. package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-content.js +15 -0
  71. package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-positioner.js +14 -0
  72. package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-root.js +14 -0
  73. package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-trigger.js +13 -0
  74. package/dist/node_modules/@ark-ui/react/dist/components/tooltip/use-tooltip-context.js +10 -0
  75. package/dist/node_modules/@ark-ui/react/dist/components/tooltip/use-tooltip.js +17 -0
  76. package/dist/node_modules/@ark-ui/react/dist/utils/compose-refs.js +13 -7
  77. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +92 -90
  78. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +230 -216
  79. package/dist/node_modules/@zag-js/accordion/dist/index.js +210 -227
  80. package/dist/node_modules/@zag-js/aria-hidden/dist/index.js +49 -12
  81. package/dist/node_modules/@zag-js/avatar/dist/index.js +119 -134
  82. package/dist/node_modules/@zag-js/checkbox/dist/index.js +196 -197
  83. package/dist/node_modules/@zag-js/collapsible/dist/index.js +250 -198
  84. package/dist/node_modules/@zag-js/collection/dist/index.js +172 -179
  85. package/dist/node_modules/@zag-js/combobox/dist/index.js +1176 -1082
  86. package/dist/node_modules/@zag-js/core/dist/index.js +77 -496
  87. package/dist/node_modules/@zag-js/dialog/dist/index.js +243 -270
  88. package/dist/node_modules/@zag-js/dismissable/dist/index.js +62 -60
  89. package/dist/node_modules/@zag-js/dom-query/dist/index.js +465 -253
  90. package/dist/node_modules/@zag-js/focus-trap/dist/index.js +307 -0
  91. package/dist/node_modules/@zag-js/focus-visible/dist/index.js +48 -47
  92. package/dist/node_modules/@zag-js/interact-outside/dist/index.js +112 -80
  93. package/dist/node_modules/@zag-js/menu/dist/index.js +998 -884
  94. package/dist/node_modules/@zag-js/pagination/dist/index.js +207 -213
  95. package/dist/node_modules/@zag-js/popper/dist/index.js +130 -129
  96. package/dist/node_modules/@zag-js/presence/dist/index.js +139 -122
  97. package/dist/node_modules/@zag-js/radio-group/dist/index.js +297 -302
  98. package/dist/node_modules/@zag-js/react/dist/index.js +255 -103
  99. package/dist/node_modules/@zag-js/remove-scroll/dist/index.js +18 -31
  100. package/dist/node_modules/@zag-js/select/dist/index.js +889 -885
  101. package/dist/node_modules/@zag-js/store/dist/index.js +98 -137
  102. package/dist/node_modules/@zag-js/switch/dist/index.js +199 -191
  103. package/dist/node_modules/@zag-js/tabs/dist/index.js +383 -386
  104. package/dist/node_modules/@zag-js/toast/dist/index.js +646 -633
  105. package/dist/node_modules/@zag-js/tooltip/dist/index.js +459 -0
  106. package/dist/node_modules/@zag-js/types/dist/index.js +6 -6
  107. package/dist/node_modules/@zag-js/utils/dist/index.js +112 -99
  108. package/dist/node_modules/proxy-compare/dist/index.js +4 -106
  109. package/dist/styles.css +1 -1
  110. package/package.json +5 -5
  111. package/dist/node_modules/@ark-ui/react/dist/utils/use-is-server.js +0 -10
  112. package/dist/node_modules/@zag-js/dom-event/dist/index.js +0 -130
  113. package/dist/node_modules/@zag-js/element-rect/dist/index.js +0 -32
  114. package/dist/node_modules/@zag-js/form-utils/dist/index.js +0 -51
  115. package/dist/node_modules/aria-hidden/dist/es2015/index.js +0 -52
  116. package/dist/node_modules/focus-trap/dist/focus-trap.esm.js +0 -431
  117. package/dist/node_modules/klona/full/index.js +0 -21
  118. package/dist/node_modules/tabbable/dist/index.esm.js +0 -202
@@ -0,0 +1,10 @@
1
+ import { createContext as e } from "../../utils/create-context.js";
2
+ const [t, r] = e({
3
+ name: "MenuItemPropsContext",
4
+ hookName: "useMenuItemPropsContext",
5
+ providerName: "<MenuItemPropsProvider />"
6
+ });
7
+ export {
8
+ t as MenuItemPropsProvider,
9
+ r as useMenuItemPropsContext
10
+ };
@@ -1,24 +1,17 @@
1
- import { machine as s, connect as u } from "../../../../../@zag-js/menu/dist/index.js";
2
- import { useMachine as d, normalizeProps as l } from "../../../../../@zag-js/react/dist/index.js";
3
- import { useId as p } from "react";
4
- import { useEnvironmentContext as f } from "../../providers/environment/use-environment-context.js";
5
- import { useLocaleContext as h } from "../../providers/locale/use-locale-context.js";
6
- import { useEvent as o } from "../../utils/use-event.js";
7
- const S = (e = {}) => {
8
- const { getRootNode: t } = f(), { dir: i } = h(), n = {
9
- id: p(),
10
- dir: i,
11
- getRootNode: t,
12
- open: e.defaultOpen,
13
- "open.controlled": e.open !== void 0,
14
- ...e
15
- }, c = {
16
- ...n,
17
- onOpenChange: o(e.onOpenChange),
18
- onSelect: o(e.onSelect)
19
- }, [m, r, a] = d(s(n), { context: c });
20
- return { api: u(m, r, l), machine: a };
1
+ import { machine as s, connect as c } from "../../../../../@zag-js/menu/dist/index.js";
2
+ import { useMachine as m, normalizeProps as p } from "../../../../../@zag-js/react/dist/index.js";
3
+ import { useId as a } from "react";
4
+ import { useEnvironmentContext as u } from "../../providers/environment/use-environment-context.js";
5
+ import { useLocaleContext as f } from "../../providers/locale/use-locale-context.js";
6
+ const M = (t) => {
7
+ const e = a(), { getRootNode: n } = u(), { dir: r } = f(), i = {
8
+ id: e,
9
+ dir: r,
10
+ getRootNode: n,
11
+ ...t
12
+ }, o = m(s, i);
13
+ return { api: c(o, p), service: o };
21
14
  };
22
15
  export {
23
- S as useMenu
16
+ M as useMenu
24
17
  };
@@ -4,12 +4,10 @@ import { createSplitProps as n } from "../../utils/create-split-props.js";
4
4
  import { ark as a } from "../factory.js";
5
5
  import { usePaginationContext as l } from "./use-pagination-context.js";
6
6
  import { mergeProps as P } from "../../../../../@zag-js/core/dist/index.js";
7
- const f = m(
8
- (o, r) => {
9
- const [i, s] = n()(o, ["index"]), t = l(), p = P(t.getEllipsisProps(i), s);
10
- return /* @__PURE__ */ e(a.div, { ...p, ref: r });
11
- }
12
- );
7
+ const f = m((o, r) => {
8
+ const [i, s] = n()(o, ["index"]), t = l(), p = P(t.getEllipsisProps(i), s);
9
+ return /* @__PURE__ */ e(a.div, { ...p, ref: r });
10
+ });
13
11
  f.displayName = "PaginationEllipsis";
14
12
  export {
15
13
  f as PaginationEllipsis
@@ -3,12 +3,10 @@ import { forwardRef as n } from "react";
3
3
  import { ark as g } from "../factory.js";
4
4
  import { usePaginationContext as m } from "./use-pagination-context.js";
5
5
  import { mergeProps as a } from "../../../../../@zag-js/core/dist/index.js";
6
- const p = n(
7
- (r, o) => {
8
- const t = m(), e = a(t.getNextTriggerProps(), r);
9
- return /* @__PURE__ */ i(g.button, { ...e, ref: o });
10
- }
11
- );
6
+ const p = n((r, o) => {
7
+ const t = m(), e = a(t.getNextTriggerProps(), r);
8
+ return /* @__PURE__ */ i(g.button, { ...e, ref: o });
9
+ });
12
10
  p.displayName = "PaginationNextTrigger";
13
11
  export {
14
12
  p as PaginationNextTrigger
@@ -3,12 +3,10 @@ import { forwardRef as n } from "react";
3
3
  import { ark as g } from "../factory.js";
4
4
  import { usePaginationContext as m } from "./use-pagination-context.js";
5
5
  import { mergeProps as a } from "../../../../../@zag-js/core/dist/index.js";
6
- const p = n(
7
- (r, o) => {
8
- const t = m(), e = a(t.getPrevTriggerProps(), r);
9
- return /* @__PURE__ */ i(g.button, { ...e, ref: o });
10
- }
11
- );
6
+ const p = n((r, o) => {
7
+ const t = m(), e = a(t.getPrevTriggerProps(), r);
8
+ return /* @__PURE__ */ i(g.button, { ...e, ref: o });
9
+ });
12
10
  p.displayName = "PaginationPrevTrigger";
13
11
  export {
14
12
  p as PaginationPrevTrigger
@@ -5,10 +5,11 @@ import { ark as m } from "../factory.js";
5
5
  import { usePagination as s } from "./use-pagination.js";
6
6
  import { PaginationProvider as P } from "./use-pagination-context.js";
7
7
  import { mergeProps as f } from "../../../../../@zag-js/core/dist/index.js";
8
- const l = p((t, a) => {
9
- const [i, n] = g()(t, [
8
+ const l = p((a, t) => {
9
+ const [i, e] = g()(a, [
10
10
  "count",
11
11
  "defaultPage",
12
+ "defaultPageSize",
12
13
  "id",
13
14
  "ids",
14
15
  "onPageChange",
@@ -18,8 +19,8 @@ const l = p((t, a) => {
18
19
  "siblingCount",
19
20
  "translations",
20
21
  "type"
21
- ]), o = s(i), e = f(o.getRootProps(), n);
22
- return /* @__PURE__ */ r(P, { value: o, children: /* @__PURE__ */ r(m.nav, { ...e, ref: a }) });
22
+ ]), o = s(i), n = f(o.getRootProps(), e);
23
+ return /* @__PURE__ */ r(P, { value: o, children: /* @__PURE__ */ r(m.nav, { ...n, ref: t }) });
23
24
  });
24
25
  l.displayName = "PaginationRoot";
25
26
  export {
@@ -1,23 +1,17 @@
1
- import { machine as m, connect as c } from "../../../../../@zag-js/pagination/dist/index.js";
2
- import { useMachine as s, normalizeProps as g } from "../../../../../@zag-js/react/dist/index.js";
3
- import { useId as u } from "react";
4
- import { useEnvironmentContext as f } from "../../providers/environment/use-environment-context.js";
5
- import { useLocaleContext as d } from "../../providers/locale/use-locale-context.js";
6
- import { useEvent as p } from "../../utils/use-event.js";
7
- const E = (e) => {
8
- const { getRootNode: o } = f(), { dir: n } = d(), t = {
9
- id: u(),
1
+ import { machine as m, connect as s } from "../../../../../@zag-js/pagination/dist/index.js";
2
+ import { useMachine as c, normalizeProps as p } from "../../../../../@zag-js/react/dist/index.js";
3
+ import { useId as a } from "react";
4
+ import { useEnvironmentContext as u } from "../../providers/environment/use-environment-context.js";
5
+ import { useLocaleContext as f } from "../../providers/locale/use-locale-context.js";
6
+ const l = (o) => {
7
+ const t = a(), { getRootNode: e } = u(), { dir: n } = f(), r = {
8
+ id: t,
10
9
  dir: n,
11
- getRootNode: o,
12
- page: e.defaultPage,
13
- ...e
14
- }, a = {
15
- ...t,
16
- page: e.page,
17
- onPageChange: p(e.onPageChange, { sync: !0 })
18
- }, [i, r] = s(m(t), { context: a });
19
- return c(i, r, g);
10
+ getRootNode: e,
11
+ ...o
12
+ }, i = c(m, r);
13
+ return s(i, p);
20
14
  };
21
15
  export {
22
- E as usePagination
16
+ l as usePagination
23
17
  };
@@ -1,19 +1,28 @@
1
- import { jsx as e, Fragment as n } from "react/jsx-runtime";
2
- import { isShadowRoot as f, getDocument as c } from "../../../../../@zag-js/dom-query/dist/index.js";
3
- import { Children as p } from "react";
4
- import { createPortal as a } from "react-dom";
5
- import { useEnvironmentContext as l } from "../../providers/environment/use-environment-context.js";
6
- import { useIsServer as g } from "../../utils/use-is-server.js";
7
- const C = (t) => {
8
- const { children: r, container: o, disabled: m } = t, i = g(), { getRootNode: s } = l();
9
- if (i || m) return /* @__PURE__ */ e(n, { children: r });
10
- const d = (o == null ? void 0 : o.current) ?? N(s);
11
- return /* @__PURE__ */ e(n, { children: p.map(r, (u) => a(u, d)) });
1
+ import { jsx as i, Fragment as c } from "react/jsx-runtime";
2
+ import { isShadowRoot as f, getDocument as l } from "../../../../../@zag-js/dom-query/dist/index.js";
3
+ import { useState as g, useSyncExternalStore as N, useEffect as S, Children as h } from "react";
4
+ import { createPortal as x } from "react-dom";
5
+ import { useEnvironmentContext as C } from "../../providers/environment/use-environment-context.js";
6
+ const w = (t) => {
7
+ var n;
8
+ const { children: o, disabled: e } = t, [s, a] = g((n = t.container) == null ? void 0 : n.current), m = N(
9
+ P,
10
+ () => !1,
11
+ () => !0
12
+ ), { getRootNode: u } = C();
13
+ if (S(() => {
14
+ a(() => {
15
+ var r;
16
+ return (r = t.container) == null ? void 0 : r.current;
17
+ });
18
+ }, [t.container]), m || e) return /* @__PURE__ */ i(c, { children: o });
19
+ const d = s ?? E(u);
20
+ return /* @__PURE__ */ i(c, { children: h.map(o, (r) => x(r, d)) });
21
+ }, E = (t) => {
22
+ const o = t == null ? void 0 : t(), e = o.getRootNode();
23
+ return f(e) ? e : l(o).body;
24
+ }, P = () => () => {
12
25
  };
13
- function N(t) {
14
- const r = t == null ? void 0 : t(), o = r.getRootNode();
15
- return f(o) ? o : c(r).body;
16
- }
17
26
  export {
18
- C as Portal
27
+ w as Portal
19
28
  };
@@ -1,11 +1,12 @@
1
1
  import { createSplitProps as e } from "../../utils/create-split-props.js";
2
- const n = (t) => e()(t, [
2
+ const o = (t) => e()(t, [
3
3
  "immediate",
4
4
  "lazyMount",
5
5
  "onExitComplete",
6
6
  "present",
7
+ "skipAnimationOnMount",
7
8
  "unmountOnExit"
8
9
  ]);
9
10
  export {
10
- n as splitPresenceProps
11
+ o as splitPresenceProps
11
12
  };
@@ -1,25 +1,25 @@
1
- import { machine as a, connect as f } from "../../../../../@zag-js/presence/dist/index.js";
2
- import { useMachine as d } from "../../../../../@zag-js/react/dist/index.js";
3
- import { useRef as P } from "react";
4
- import { composeRefs as l } from "../../utils/compose-refs.js";
5
- import { useEvent as x } from "../../utils/use-event.js";
6
- const R = (t) => {
7
- const { lazyMount: o, unmountOnExit: s, ...c } = t, n = P(!1), r = {
8
- ...c,
9
- onExitComplete: x(t.onExitComplete)
10
- }, [m, p] = d(a(r), { context: r }), e = f(m, p);
11
- e.present && (n.current = !0);
12
- const u = !e.present && !n.current && o || s && !e.present && n.current;
1
+ import { machine as f, connect as d } from "../../../../../@zag-js/presence/dist/index.js";
2
+ import { useMachine as l } from "../../../../../@zag-js/react/dist/index.js";
3
+ import { useRef as E } from "react";
4
+ import { useEvent as P } from "../../utils/use-event.js";
5
+ const k = (n = {}) => {
6
+ const { lazyMount: s, unmountOnExit: o, present: r, skipAnimationOnMount: c = !1, ...i } = n, t = E(!1), p = {
7
+ ...i,
8
+ present: r,
9
+ onExitComplete: P(n.onExitComplete)
10
+ }, m = l(f, p), e = d(m);
11
+ e.present && (t.current = !0);
12
+ const u = !e.present && !t.current && s || o && !e.present && t.current, a = () => ({
13
+ "data-state": e.skip && c ? void 0 : r ? "open" : "closed",
14
+ hidden: !e.present
15
+ });
13
16
  return {
14
- getPresenceProps: (i) => ({
15
- ref: l(e.setNode, i),
16
- "data-state": t.present ? "open" : "closed",
17
- hidden: !e.present
18
- }),
17
+ ref: e.setNode,
18
+ getPresenceProps: a,
19
19
  present: e.present,
20
20
  unmounted: u
21
21
  };
22
22
  };
23
23
  export {
24
- R as usePresence
24
+ k as usePresence
25
25
  };
@@ -4,12 +4,10 @@ import { ark as s } from "../factory.js";
4
4
  import { useRadioGroupContext as n } from "./use-radio-group-context.js";
5
5
  import { useRadioGroupItemPropsContext as a } from "./use-radio-group-item-props-context.js";
6
6
  import { mergeProps as d } from "../../../../../@zag-js/core/dist/index.js";
7
- const f = i(
8
- (o, r) => {
9
- const t = n(), m = a(), e = d(t.getItemControlProps(m), o);
10
- return /* @__PURE__ */ p(s.div, { ...e, ref: r });
11
- }
12
- );
7
+ const f = i((o, r) => {
8
+ const t = n(), m = a(), e = d(t.getItemControlProps(m), o);
9
+ return /* @__PURE__ */ p(s.div, { ...e, ref: r });
10
+ });
13
11
  f.displayName = "RadioGroupItemControl";
14
12
  export {
15
13
  f as RadioGroupItemControl
@@ -4,12 +4,10 @@ import { ark as i } from "../factory.js";
4
4
  import { useRadioGroupContext as a } from "./use-radio-group-context.js";
5
5
  import { useRadioGroupItemPropsContext as d } from "./use-radio-group-item-props-context.js";
6
6
  import { mergeProps as f } from "../../../../../@zag-js/core/dist/index.js";
7
- const n = s(
8
- (o, r) => {
9
- const t = a(), e = d(), m = f(t.getItemTextProps(e), o);
10
- return /* @__PURE__ */ p(i.span, { ...m, ref: r });
11
- }
12
- );
7
+ const n = s((o, r) => {
8
+ const t = a(), e = d(), m = f(t.getItemTextProps(e), o);
9
+ return /* @__PURE__ */ p(i.span, { ...m, ref: r });
10
+ });
13
11
  n.displayName = "RadioGroupItemText";
14
12
  export {
15
13
  n as RadioGroupItemText
@@ -7,11 +7,7 @@ import { RadioGroupItemProvider as f } from "./use-radio-group-item-context.js";
7
7
  import { RadioGroupItemPropsProvider as n } from "./use-radio-group-item-props-context.js";
8
8
  import { mergeProps as c } from "../../../../../@zag-js/core/dist/index.js";
9
9
  const P = d((t, m) => {
10
- const [o, i] = s()(t, [
11
- "value",
12
- "disabled",
13
- "invalid"
14
- ]), e = u(), p = c(e.getItemProps(o), i), a = e.getItemState(o);
10
+ const [o, i] = s()(t, ["value", "disabled", "invalid"]), e = u(), p = c(e.getItemProps(o), i), a = e.getItemState(o);
15
11
  return /* @__PURE__ */ r(f, { value: a, children: /* @__PURE__ */ r(n, { value: o, children: /* @__PURE__ */ r(l.label, { ...p, ref: m }) }) });
16
12
  });
17
13
  P.displayName = "RadioGroupItem";
@@ -1,25 +1,17 @@
1
- import { machine as u, connect as m } from "../../../../../@zag-js/radio-group/dist/index.js";
2
- import { useMachine as c, normalizeProps as s } from "../../../../../@zag-js/react/dist/index.js";
3
- import { useId as l } from "react";
4
- import { useEnvironmentContext as d } from "../../providers/environment/use-environment-context.js";
5
- import { useLocaleContext as f } from "../../providers/locale/use-locale-context.js";
6
- import { useEvent as v } from "../../utils/use-event.js";
7
- const E = (e) => {
8
- const { getRootNode: t } = d(), { dir: n } = f(), o = {
9
- id: l(),
10
- dir: n,
11
- getRootNode: t,
12
- value: e.defaultValue,
13
- ...e
14
- }, r = {
15
- ...o,
16
- value: e.value,
17
- onValueChange: v(e.onValueChange, { sync: !0 })
18
- }, [a, i] = c(u(o), {
19
- context: r
20
- });
21
- return m(a, i, s);
1
+ import { machine as m, connect as s } from "../../../../../@zag-js/radio-group/dist/index.js";
2
+ import { useMachine as c, normalizeProps as p } from "../../../../../@zag-js/react/dist/index.js";
3
+ import { useId as u } from "react";
4
+ import { useEnvironmentContext as a } from "../../providers/environment/use-environment-context.js";
5
+ import { useLocaleContext as d } from "../../providers/locale/use-locale-context.js";
6
+ const C = (o) => {
7
+ const t = u(), { getRootNode: e } = a(), { dir: r } = d(), n = {
8
+ id: t,
9
+ dir: r,
10
+ getRootNode: e,
11
+ ...o
12
+ }, i = c(m, n);
13
+ return s(i, p);
22
14
  };
23
15
  export {
24
- E as useRadioGroup
16
+ C as useRadioGroup
25
17
  };
@@ -1,14 +1,15 @@
1
1
  import { jsx as m } from "react/jsx-runtime";
2
2
  import { forwardRef as s } from "react";
3
- import { ark as p } from "../factory.js";
3
+ import { composeRefs as p } from "../../utils/compose-refs.js";
4
+ import { ark as f } from "../factory.js";
4
5
  import { usePresenceContext as c } from "../presence/use-presence-context.js";
5
- import { useSelectContext as f } from "./use-select-context.js";
6
- import { mergeProps as i } from "../../../../../@zag-js/core/dist/index.js";
7
- const l = s((t, r) => {
8
- const o = f(), e = c(), n = i(o.getContentProps(), e.getPresenceProps(r), t);
9
- return e.unmounted ? null : /* @__PURE__ */ m(p.div, { ...n });
6
+ import { useSelectContext as i } from "./use-select-context.js";
7
+ import { mergeProps as l } from "../../../../../@zag-js/core/dist/index.js";
8
+ const u = s((r, o) => {
9
+ const t = i(), e = c(), n = l(t.getContentProps(), e.getPresenceProps(), r);
10
+ return e.unmounted ? null : /* @__PURE__ */ m(f.div, { ...n, ref: p(e.ref, o) });
10
11
  });
11
- l.displayName = "SelectContent";
12
+ u.displayName = "SelectContent";
12
13
  export {
13
- l as SelectContent
14
+ u as SelectContent
14
15
  };
@@ -1,6 +1,6 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import { forwardRef as a } from "react";
3
- import { createSplitProps as d } from "../../utils/create-split-props.js";
2
+ import { forwardRef as d } from "react";
3
+ import { createSplitProps as a } from "../../utils/create-split-props.js";
4
4
  import { ark as u } from "../factory.js";
5
5
  import { splitPresenceProps as f } from "../presence/split-presence-props.js";
6
6
  import { usePresence as P } from "../presence/use-presence.js";
@@ -8,10 +8,12 @@ import { PresenceProvider as g } from "../presence/use-presence-context.js";
8
8
  import { useSelect as h } from "./use-select.js";
9
9
  import { SelectProvider as S } from "./use-select-context.js";
10
10
  import { mergeProps as r } from "../../../../../@zag-js/core/dist/index.js";
11
- const v = (t, s) => {
12
- const [i, n] = f(t), [l, p] = d()(n, [
11
+ const v = (t, l) => {
12
+ const [n, s] = f(t), [i, c] = a()(s, [
13
13
  "closeOnSelect",
14
+ "collection",
14
15
  "composite",
16
+ "defaultHighlightedValue",
15
17
  "defaultOpen",
16
18
  "defaultValue",
17
19
  "deselectable",
@@ -21,10 +23,6 @@ const v = (t, s) => {
21
23
  "id",
22
24
  "ids",
23
25
  "invalid",
24
- "isItemDisabled",
25
- "items",
26
- "itemToString",
27
- "itemToValue",
28
26
  "loopFocus",
29
27
  "multiple",
30
28
  "name",
@@ -33,6 +31,7 @@ const v = (t, s) => {
33
31
  "onInteractOutside",
34
32
  "onOpenChange",
35
33
  "onPointerDownOutside",
34
+ "onSelect",
36
35
  "onValueChange",
37
36
  "open",
38
37
  "positioning",
@@ -40,9 +39,9 @@ const v = (t, s) => {
40
39
  "required",
41
40
  "scrollToIndexFn",
42
41
  "value"
43
- ]), e = h(l), c = P(r({ present: e.open }, i)), m = r(e.getRootProps(), p);
44
- return /* @__PURE__ */ o(S, { value: e, children: /* @__PURE__ */ o(g, { value: c, children: /* @__PURE__ */ o(u.div, { ...m, ref: s }) }) });
45
- }, D = a(v);
42
+ ]), e = h(i), p = P(r({ present: e.open }, n)), m = r(e.getRootProps(), c);
43
+ return /* @__PURE__ */ o(S, { value: e, children: /* @__PURE__ */ o(g, { value: p, children: /* @__PURE__ */ o(u.div, { ...m, ref: l }) }) });
44
+ }, j = d(v);
46
45
  export {
47
- D as SelectRoot
46
+ j as SelectRoot
48
47
  };
@@ -1,53 +1,26 @@
1
- import { useMachine as h, normalizeProps as C } from "../../../../../@zag-js/react/dist/index.js";
2
- import { collection as v, machine as p, connect as O } from "../../../../../@zag-js/select/dist/index.js";
3
- import { useMemo as b, useId as x, useEffect as P } from "react";
4
- import { useEnvironmentContext as S } from "../../providers/environment/use-environment-context.js";
5
- import { useLocaleContext as V } from "../../providers/locale/use-locale-context.js";
6
- import { createSplitProps as y } from "../../utils/create-split-props.js";
7
- import { useEvent as n } from "../../utils/use-event.js";
8
- import { useFieldContext as E } from "../field/use-field-context.js";
9
- const z = (o) => {
10
- const [i, r] = y()(o, [
11
- "isItemDisabled",
12
- "itemToValue",
13
- "itemToString",
14
- "items"
15
- ]), t = b(
16
- () => v(i),
17
- Object.values(i)
18
- ), a = V(), s = S(), e = E(), c = {
19
- id: x(),
1
+ import { useMachine as i, normalizeProps as m } from "../../../../../@zag-js/react/dist/index.js";
2
+ import { machine as a, connect as d } from "../../../../../@zag-js/select/dist/index.js";
3
+ import { useId as p } from "react";
4
+ import { useEnvironmentContext as u } from "../../providers/environment/use-environment-context.js";
5
+ import { useLocaleContext as l } from "../../providers/locale/use-locale-context.js";
6
+ import { useFieldContext as b } from "../field/use-field-context.js";
7
+ const O = (r) => {
8
+ const t = p(), { dir: e } = l(), { getRootNode: n } = u(), o = b(), s = {
9
+ id: t,
20
10
  ids: {
21
- label: e == null ? void 0 : e.ids.label,
22
- hiddenSelect: e == null ? void 0 : e.ids.control
11
+ label: o == null ? void 0 : o.ids.label,
12
+ hiddenSelect: o == null ? void 0 : o.ids.control
23
13
  },
24
- disabled: e == null ? void 0 : e.disabled,
25
- readOnly: e == null ? void 0 : e.readOnly,
26
- invalid: e == null ? void 0 : e.invalid,
27
- required: e == null ? void 0 : e.required,
28
- dir: a.dir,
29
- getRootNode: s.getRootNode,
30
- collection: t,
31
- open: o.defaultOpen,
32
- value: o.defaultValue,
33
- "open.controlled": o.open !== void 0,
14
+ disabled: o == null ? void 0 : o.disabled,
15
+ readOnly: o == null ? void 0 : o.readOnly,
16
+ invalid: o == null ? void 0 : o.invalid,
17
+ required: o == null ? void 0 : o.required,
18
+ dir: e,
19
+ getRootNode: n,
34
20
  ...r
35
- }, m = (() => {
36
- const { collection: q, ...g } = c;
37
- return {
38
- ...g,
39
- value: o.value,
40
- onValueChange: n(o.onValueChange, { sync: !0 }),
41
- onHighlightChange: n(o.onHighlightChange),
42
- onOpenChange: n(o.onOpenChange)
43
- };
44
- })(), [u, d] = h(p(c), {
45
- context: m
46
- }), l = O(u, d, C);
47
- return P(() => {
48
- l.setCollection(t);
49
- }, [t]), l;
21
+ }, c = i(a, s);
22
+ return d(c, m);
50
23
  };
51
24
  export {
52
- z as useSelect
25
+ O as useSelect
53
26
  };
@@ -4,12 +4,10 @@ import { ark as p } from "../factory.js";
4
4
  import { useFieldContext as s } from "../field/use-field-context.js";
5
5
  import { useSwitchContext as d } from "./use-switch-context.js";
6
6
  import { mergeProps as c } from "../../../../../@zag-js/core/dist/index.js";
7
- const a = n(
8
- (t, o) => {
9
- const e = d(), i = c(e.getHiddenInputProps(), t), r = s();
10
- return /* @__PURE__ */ m(p.input, { "aria-describedby": r == null ? void 0 : r.ariaDescribedby, ...i, ref: o });
11
- }
12
- );
7
+ const a = n((t, o) => {
8
+ const e = d(), i = c(e.getHiddenInputProps(), t), r = s();
9
+ return /* @__PURE__ */ m(p.input, { "aria-describedby": r == null ? void 0 : r.ariaDescribedby, ...i, ref: o });
10
+ });
13
11
  a.displayName = "SwitchHiddenInput";
14
12
  export {
15
13
  a as SwitchHiddenInput
@@ -1,31 +1,25 @@
1
- import { useMachine as a, normalizeProps as d } from "../../../../../@zag-js/react/dist/index.js";
2
- import { machine as m, connect as u } from "../../../../../@zag-js/switch/dist/index.js";
3
- import { useId as h } from "react";
4
- import { useEnvironmentContext as C } from "../../providers/environment/use-environment-context.js";
5
- import { useLocaleContext as k } from "../../providers/locale/use-locale-context.js";
6
- import { useEvent as x } from "../../utils/use-event.js";
7
- import { useFieldContext as l } from "../field/use-field-context.js";
8
- const I = (t) => {
9
- const { getRootNode: o } = C(), { dir: r } = k(), e = l(), n = {
10
- id: h(),
1
+ import { useMachine as c, normalizeProps as m } from "../../../../../@zag-js/react/dist/index.js";
2
+ import { machine as a, connect as p } from "../../../../../@zag-js/switch/dist/index.js";
3
+ import { useId as u } from "react";
4
+ import { useEnvironmentContext as d } from "../../providers/environment/use-environment-context.js";
5
+ import { useLocaleContext as h } from "../../providers/locale/use-locale-context.js";
6
+ import { useFieldContext as b } from "../field/use-field-context.js";
7
+ const I = (r) => {
8
+ const t = u(), { getRootNode: n } = d(), { dir: e } = h(), o = b(), s = {
9
+ id: t,
11
10
  ids: {
12
- label: e == null ? void 0 : e.ids.label,
13
- hiddenInput: e == null ? void 0 : e.ids.control
11
+ label: o == null ? void 0 : o.ids.label,
12
+ hiddenInput: o == null ? void 0 : o.ids.control
14
13
  },
15
- dir: r,
16
- disabled: e == null ? void 0 : e.disabled,
17
- readOnly: e == null ? void 0 : e.readOnly,
18
- invalid: e == null ? void 0 : e.invalid,
19
- required: e == null ? void 0 : e.required,
20
- getRootNode: o,
21
- checked: t.defaultChecked,
22
- ...t
23
- }, c = {
24
- ...n,
25
- checked: t.checked,
26
- onCheckedChange: x(t.onCheckedChange, { sync: !0 })
27
- }, [s, i] = a(m(n), { context: c });
28
- return u(s, i, d);
14
+ dir: e,
15
+ disabled: o == null ? void 0 : o.disabled,
16
+ readOnly: o == null ? void 0 : o.readOnly,
17
+ invalid: o == null ? void 0 : o.invalid,
18
+ required: o == null ? void 0 : o.required,
19
+ getRootNode: n,
20
+ ...r
21
+ }, i = c(a, s);
22
+ return p(i, m);
29
23
  };
30
24
  export {
31
25
  I as useSwitch