@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
@@ -1,14 +1,13 @@
1
- import { raf as E, contains as h, getDocument as B, waitForElements as O, setStyle as I, getEventTarget as f, isHTMLElement as D } from "../../dom-query/dist/index.js";
2
- import { trackInteractOutside as A } from "../../interact-outside/dist/index.js";
3
- import { isFunction as b, warn as k } from "../../utils/dist/index.js";
4
- import { addDomEvent as M } from "../../dom-event/dist/index.js";
5
- function N(e, t) {
6
- const r = (i) => {
7
- i.key === "Escape" && (i.isComposing || t == null || t(i));
1
+ import { raf as B, contains as h, getDocument as b, waitForElements as I, addDomEvent as D, setStyle as M, getEventTarget as g, isHTMLElement as A } from "../../dom-query/dist/index.js";
2
+ import { trackInteractOutside as N } from "../../interact-outside/dist/index.js";
3
+ import { isFunction as k, warn as p } from "../../utils/dist/index.js";
4
+ function T(e, t) {
5
+ const i = (r) => {
6
+ r.key === "Escape" && (r.isComposing || t == null || t(r));
8
7
  };
9
- return M(B(e), "keydown", r, { capture: !0 });
8
+ return D(b(e), "keydown", i, { capture: !0 });
10
9
  }
11
- var o = {
10
+ var c = {
12
11
  layers: [],
13
12
  branches: [],
14
13
  count() {
@@ -24,9 +23,9 @@ var o = {
24
23
  return this.pointerBlockingLayers().length > 0;
25
24
  },
26
25
  isBelowPointerBlockingLayer(e) {
27
- var i;
28
- const t = this.indexOf(e), r = this.topMostPointerBlockingLayer() ? this.indexOf((i = this.topMostPointerBlockingLayer()) == null ? void 0 : i.node) : -1;
29
- return t < r;
26
+ var r;
27
+ const t = this.indexOf(e), i = this.topMostPointerBlockingLayer() ? this.indexOf((r = this.topMostPointerBlockingLayer()) == null ? void 0 : r.node) : -1;
28
+ return t < i;
30
29
  },
31
30
  isTopMost(e) {
32
31
  const t = this.layers[this.count() - 1];
@@ -36,7 +35,7 @@ var o = {
36
35
  return Array.from(this.layers).slice(this.indexOf(e) + 1);
37
36
  },
38
37
  isInNestedLayer(e, t) {
39
- return this.getNestedLayers(e).some((r) => h(r.node, t));
38
+ return this.getNestedLayers(e).some((i) => h(i.node, t));
40
39
  },
41
40
  isInBranch(e) {
42
41
  return Array.from(this.branches).some((t) => h(t, e));
@@ -50,7 +49,7 @@ var o = {
50
49
  },
51
50
  remove(e) {
52
51
  const t = this.indexOf(e);
53
- t < 0 || (t < this.count() - 1 && this.getNestedLayers(e).forEach((i) => i.dismiss()), this.layers.splice(t, 1), e.style.removeProperty("--layer-index"));
52
+ t < 0 || (t < this.count() - 1 && this.getNestedLayers(e).forEach((r) => r.dismiss()), this.layers.splice(t, 1), e.style.removeProperty("--layer-index"));
54
53
  },
55
54
  removeBranch(e) {
56
55
  const t = this.branches.indexOf(e);
@@ -67,88 +66,91 @@ var o = {
67
66
  this.remove(this.layers[0].node);
68
67
  }
69
68
  }, m;
70
- function g() {
71
- o.layers.forEach(({ node: e }) => {
72
- e.style.pointerEvents = o.isBelowPointerBlockingLayer(e) ? "none" : "auto";
69
+ function E() {
70
+ c.layers.forEach(({ node: e }) => {
71
+ e.style.pointerEvents = c.isBelowPointerBlockingLayer(e) ? "none" : "auto";
73
72
  });
74
73
  }
75
- function T(e) {
74
+ function K(e) {
76
75
  e.style.pointerEvents = "";
77
76
  }
78
- function K(e, t) {
79
- const r = B(e), i = [];
80
- if (o.hasPointerBlockingLayer() && !r.body.hasAttribute("data-inert") && (m = document.body.style.pointerEvents, queueMicrotask(() => {
81
- r.body.style.pointerEvents = "none", r.body.setAttribute("data-inert", "");
77
+ function C(e, t) {
78
+ const i = b(e), r = [];
79
+ if (c.hasPointerBlockingLayer() && !i.body.hasAttribute("data-inert") && (m = document.body.style.pointerEvents, queueMicrotask(() => {
80
+ i.body.style.pointerEvents = "none", i.body.setAttribute("data-inert", "");
82
81
  })), t) {
83
- const a = O(t, (n) => {
84
- i.push(I(n, { pointerEvents: "auto" }));
82
+ const a = I(t, (n) => {
83
+ r.push(M(n, { pointerEvents: "auto" }));
85
84
  });
86
- i.push(a);
85
+ r.push(a);
87
86
  }
88
87
  return () => {
89
- o.hasPointerBlockingLayer() || (queueMicrotask(() => {
90
- r.body.style.pointerEvents = m, r.body.removeAttribute("data-inert"), r.body.style.length === 0 && r.body.removeAttribute("style");
91
- }), i.forEach((a) => a()));
88
+ c.hasPointerBlockingLayer() || (queueMicrotask(() => {
89
+ i.body.style.pointerEvents = m, i.body.removeAttribute("data-inert"), i.body.style.length === 0 && i.body.removeAttribute("style");
90
+ }), r.forEach((a) => a()));
92
91
  };
93
92
  }
94
- function C(e, t) {
95
- if (!e) {
96
- k("[@zag-js/dismissable] node is `null` or `undefined`");
93
+ function _(e, t) {
94
+ const { warnOnMissingNode: i = !0 } = t;
95
+ if (i && !e) {
96
+ p("[@zag-js/dismissable] node is `null` or `undefined`");
97
97
  return;
98
98
  }
99
- const { onDismiss: r, pointerBlocking: i, exclude: a, debug: n } = t, p = { dismiss: r, node: e, pointerBlocking: i };
100
- o.add(p), g();
101
- function P(s) {
102
- var u, l;
103
- const c = f(s.detail.originalEvent);
104
- o.isBelowPointerBlockingLayer(e) || o.isInBranch(c) || ((u = t.onPointerDownOutside) == null || u.call(t, s), (l = t.onInteractOutside) == null || l.call(t, s), !s.defaultPrevented && (n && console.log("onPointerDownOutside:", s.detail.originalEvent), r == null || r()));
105
- }
99
+ if (!e)
100
+ return;
101
+ const { onDismiss: r, pointerBlocking: a, exclude: n, debug: y } = t, P = { dismiss: r, node: e, pointerBlocking: a };
102
+ c.add(P), E();
106
103
  function v(s) {
107
104
  var u, l;
108
- const c = f(s.detail.originalEvent);
109
- o.isInBranch(c) || ((u = t.onFocusOutside) == null || u.call(t, s), (l = t.onInteractOutside) == null || l.call(t, s), !s.defaultPrevented && (n && console.log("onFocusOutside:", s.detail.originalEvent), r == null || r()));
105
+ const o = g(s.detail.originalEvent);
106
+ c.isBelowPointerBlockingLayer(e) || c.isInBranch(o) || ((u = t.onPointerDownOutside) == null || u.call(t, s), (l = t.onInteractOutside) == null || l.call(t, s), !s.defaultPrevented && (y && console.log("onPointerDownOutside:", s.detail.originalEvent), r == null || r()));
110
107
  }
111
108
  function L(s) {
112
- var c;
113
- o.isTopMost(e) && ((c = t.onEscapeKeyDown) == null || c.call(t, s), !s.defaultPrevented && r && (s.preventDefault(), r()));
109
+ var u, l;
110
+ const o = g(s.detail.originalEvent);
111
+ c.isInBranch(o) || ((u = t.onFocusOutside) == null || u.call(t, s), (l = t.onInteractOutside) == null || l.call(t, s), !s.defaultPrevented && (y && console.log("onFocusOutside:", s.detail.originalEvent), r == null || r()));
114
112
  }
115
113
  function x(s) {
116
- var y;
114
+ var o;
115
+ c.isTopMost(e) && ((o = t.onEscapeKeyDown) == null || o.call(t, s), !s.defaultPrevented && r && (s.preventDefault(), r()));
116
+ }
117
+ function w(s) {
118
+ var f;
117
119
  if (!e) return !1;
118
- const c = typeof a == "function" ? a() : a, u = Array.isArray(c) ? c : [c], l = (y = t.persistentElements) == null ? void 0 : y.map((d) => d()).filter(D);
119
- return l && u.push(...l), u.some((d) => h(d, s)) || o.isInNestedLayer(e, s);
120
+ const o = typeof n == "function" ? n() : n, u = Array.isArray(o) ? o : [o], l = (f = t.persistentElements) == null ? void 0 : f.map((d) => d()).filter(A);
121
+ return l && u.push(...l), u.some((d) => h(d, s)) || c.isInNestedLayer(e, s);
120
122
  }
121
- const w = [
122
- i ? K(e, t.persistentElements) : void 0,
123
- N(e, L),
124
- A(e, { exclude: x, onFocusOutside: v, onPointerDownOutside: P, defer: t.defer })
123
+ const O = [
124
+ a ? C(e, t.persistentElements) : void 0,
125
+ T(e, x),
126
+ N(e, { exclude: w, onFocusOutside: L, onPointerDownOutside: v, defer: t.defer })
125
127
  ];
126
128
  return () => {
127
- o.remove(e), g(), T(e), w.forEach((s) => s == null ? void 0 : s());
129
+ c.remove(e), E(), K(e), O.forEach((s) => s == null ? void 0 : s());
128
130
  };
129
131
  }
130
132
  function S(e, t) {
131
- const { defer: r } = t, i = r ? E : (n) => n(), a = [];
133
+ const { defer: i } = t, r = i ? B : (n) => n(), a = [];
132
134
  return a.push(
133
- i(() => {
134
- const n = b(e) ? e() : e;
135
- a.push(C(n, t));
135
+ r(() => {
136
+ const n = k(e) ? e() : e;
137
+ a.push(_(n, t));
136
138
  })
137
139
  ), () => {
138
140
  a.forEach((n) => n == null ? void 0 : n());
139
141
  };
140
142
  }
141
143
  function F(e, t = {}) {
142
- const { defer: r } = t, i = r ? E : (n) => n(), a = [];
144
+ const { defer: i } = t, r = i ? B : (n) => n(), a = [];
143
145
  return a.push(
144
- i(() => {
145
- const n = b(e) ? e() : e;
146
+ r(() => {
147
+ const n = k(e) ? e() : e;
146
148
  if (!n) {
147
- k("[@zag-js/dismissable] branch node is `null` or `undefined`");
149
+ p("[@zag-js/dismissable] branch node is `null` or `undefined`");
148
150
  return;
149
151
  }
150
- o.addBranch(n), a.push(() => {
151
- o.removeBranch(n);
152
+ c.addBranch(n), a.push(() => {
153
+ c.removeBranch(n);
152
154
  });
153
155
  })
154
156
  ), () => {