@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,141 +1,173 @@
1
- import { addDomEvent as E, fireCustomEvent as T, queueBeforeEvent as X, isContextMenuEvent as k } from "../../dom-event/dist/index.js";
2
- import { raf as m, getDocument as F, getWindow as H, isFocusable as y, getEventTarget as p, isHTMLElement as I, contains as _ } from "../../dom-query/dist/index.js";
1
+ import { raf as p, getDocument as _, getWindow as U, isShadowRoot as V, addDomEvent as b, isTouchDevice as W, getEventTarget as x, isFocusable as X, isContextMenuEvent as M, isHTMLElement as k, contains as q, getNearestOverflowAncestor as I } from "../../dom-query/dist/index.js";
3
2
  import { callAll as O } from "../../utils/dist/index.js";
4
- function x(t) {
3
+ function B(t) {
5
4
  const e = {
6
- each(r) {
7
- var i;
8
- for (let o = 0; o < ((i = t.frames) == null ? void 0 : i.length); o += 1) {
9
- const n = t.frames[o];
10
- n && r(n);
5
+ each(n) {
6
+ var r;
7
+ for (let i = 0; i < ((r = t.frames) == null ? void 0 : r.length); i += 1) {
8
+ const o = t.frames[i];
9
+ o && n(o);
11
10
  }
12
11
  },
13
- queueBeforeEvent(r, i) {
14
- const o = /* @__PURE__ */ new Set();
15
- return e.each((n) => {
12
+ addEventListener(n, r, i) {
13
+ return e.each((o) => {
16
14
  try {
17
- o.add(X(n.document, r, i));
15
+ o.document.addEventListener(n, r, i);
18
16
  } catch {
19
17
  }
20
18
  }), () => {
21
19
  try {
22
- o.forEach((n) => n());
20
+ e.removeEventListener(n, r, i);
23
21
  } catch {
24
22
  }
25
23
  };
26
24
  },
27
- addEventListener(r, i, o) {
28
- return e.each((n) => {
25
+ removeEventListener(n, r, i) {
26
+ e.each((o) => {
29
27
  try {
30
- n.document.addEventListener(r, i, o);
28
+ o.document.removeEventListener(n, r, i);
31
29
  } catch {
32
30
  }
33
- }), () => {
31
+ });
32
+ }
33
+ };
34
+ return e;
35
+ }
36
+ function $(t) {
37
+ const e = t.frameElement != null ? t.parent : null;
38
+ return {
39
+ addEventListener: (n, r, i) => {
40
+ try {
41
+ e == null || e.addEventListener(n, r, i);
42
+ } catch {
43
+ }
44
+ return () => {
34
45
  try {
35
- e.removeEventListener(r, i, o);
46
+ e == null || e.removeEventListener(n, r, i);
36
47
  } catch {
37
48
  }
38
49
  };
39
50
  },
40
- removeEventListener(r, i, o) {
41
- e.each((n) => {
42
- try {
43
- n.document.removeEventListener(r, i, o);
44
- } catch {
45
- }
46
- });
51
+ removeEventListener: (n, r, i) => {
52
+ try {
53
+ e == null || e.removeEventListener(n, r, i);
54
+ } catch {
55
+ }
47
56
  }
48
57
  };
49
- return e;
50
58
  }
51
- var P = "pointerdown.outside", v = "focus.outside";
52
- function B(t) {
59
+ var C = "pointerdown.outside", D = "focus.outside";
60
+ function j(t) {
53
61
  for (const e of t)
54
- if (I(e) && y(e)) return !0;
62
+ if (k(e) && X(e)) return !0;
55
63
  return !1;
56
64
  }
57
- var W = (t) => "clientY" in t;
58
- function N(t, e) {
59
- if (!W(e) || !t) return !1;
60
- const r = t.getBoundingClientRect();
61
- return r.width === 0 || r.height === 0 ? !1 : r.top <= e.clientY && e.clientY <= r.top + r.height && r.left <= e.clientX && e.clientX <= r.left + r.width;
65
+ var H = (t) => "clientY" in t;
66
+ function z(t, e) {
67
+ if (!H(e) || !t) return !1;
68
+ const n = t.getBoundingClientRect();
69
+ return n.width === 0 || n.height === 0 ? !1 : n.top <= e.clientY && e.clientY <= n.top + n.height && n.left <= e.clientX && e.clientX <= n.left + n.width;
62
70
  }
63
- function U(t) {
64
- const e = p(t);
65
- if (!e || !W(t)) return !1;
66
- const i = e.scrollHeight > e.clientHeight && t.clientX > e.clientWidth, n = e.scrollWidth > e.clientWidth && t.clientY > e.clientHeight;
67
- return i || n;
71
+ function G(t, e) {
72
+ return t.y <= e.y && e.y <= t.y + t.height && t.x <= e.x && e.x <= t.x + t.width;
68
73
  }
69
- function q(t, e) {
70
- const { exclude: r, onFocusOutside: i, onPointerDownOutside: o, onInteractOutside: n, defer: b } = e;
74
+ function Y(t, e) {
75
+ if (!e || !H(t)) return !1;
76
+ const n = e.scrollHeight > e.clientHeight, r = n && t.clientX > e.offsetLeft + e.clientWidth, i = e.scrollWidth > e.clientWidth, o = i && t.clientY > e.offsetTop + e.clientHeight, E = {
77
+ x: e.offsetLeft,
78
+ y: e.offsetTop,
79
+ width: e.clientWidth + (n ? 16 : 0),
80
+ height: e.clientHeight + (i ? 16 : 0)
81
+ }, l = {
82
+ x: t.clientX,
83
+ y: t.clientY
84
+ };
85
+ return G(E, l) ? r || o : !1;
86
+ }
87
+ function J(t, e) {
88
+ const { exclude: n, onFocusOutside: r, onPointerDownOutside: i, onInteractOutside: o, defer: E } = e;
71
89
  if (!t) return;
72
- const f = F(t), Y = H(t), d = x(Y);
73
- function g(c) {
74
- const s = p(c);
75
- return !I(s) || _(t, s) || N(t, c) || U(c) ? !1 : !(r != null && r(s));
90
+ const l = _(t), y = U(t), g = B(y), w = $(y);
91
+ function S(c, a) {
92
+ if (!k(a) || !a.isConnected || q(t, a) || z(t, c)) return !1;
93
+ const s = l.querySelector(`[aria-controls="${t.id}"]`);
94
+ if (s) {
95
+ const u = I(s);
96
+ if (Y(c, u)) return !1;
97
+ }
98
+ const h = I(t);
99
+ return Y(c, h) ? !1 : !(n != null && n(a));
76
100
  }
77
- const l = /* @__PURE__ */ new Set();
78
- function w(c) {
79
- function s() {
80
- var L;
81
- const a = b ? m : (h) => h(), D = ((L = c.composedPath) == null ? void 0 : L.call(c)) ?? [c.target];
82
- a(() => {
83
- if (!(!t || !g(c))) {
84
- if (o || n) {
85
- const h = O(o, n);
86
- t.addEventListener(P, h, { once: !0 });
101
+ const d = /* @__PURE__ */ new Set(), N = V(t == null ? void 0 : t.getRootNode());
102
+ function L(c) {
103
+ function a(s) {
104
+ var P;
105
+ const h = E && !W() ? p : (m) => m(), u = s ?? c, T = ((P = u == null ? void 0 : u.composedPath) == null ? void 0 : P.call(u)) ?? [u == null ? void 0 : u.target];
106
+ h(() => {
107
+ const m = N ? T[0] : x(c);
108
+ if (!(!t || !S(c, m))) {
109
+ if (i || o) {
110
+ const F = O(i, o);
111
+ t.addEventListener(C, F, { once: !0 });
87
112
  }
88
- T(t, P, {
113
+ R(t, C, {
89
114
  bubbles: !1,
90
115
  cancelable: !0,
91
116
  detail: {
92
- originalEvent: c,
93
- contextmenu: k(c),
94
- focusable: B(D)
117
+ originalEvent: u,
118
+ contextmenu: M(u),
119
+ focusable: j(T),
120
+ target: m
95
121
  }
96
122
  });
97
123
  }
98
124
  });
99
125
  }
100
- c.pointerType === "touch" ? (l.forEach((a) => a()), l.add(E(f, "click", s, { once: !0 })), l.add(d.addEventListener("click", s, { once: !0 }))) : s();
126
+ c.pointerType === "touch" ? (d.forEach((s) => s()), d.add(b(l, "click", a, { once: !0 })), d.add(w.addEventListener("click", a, { once: !0 })), d.add(g.addEventListener("click", a, { once: !0 }))) : a();
101
127
  }
102
- const u = /* @__PURE__ */ new Set(), C = setTimeout(() => {
103
- u.add(d.addEventListener("pointerdown", w, !0)), u.add(E(f, "pointerdown", w, !0));
128
+ const f = /* @__PURE__ */ new Set(), A = setTimeout(() => {
129
+ f.add(b(l, "pointerdown", L, !0)), f.add(w.addEventListener("pointerdown", L, !0)), f.add(g.addEventListener("pointerdown", L, !0));
104
130
  }, 0);
105
- function S(c) {
106
- (b ? m : (a) => a())(() => {
107
- if (!(!t || !g(c))) {
108
- if (i || n) {
109
- const a = O(i, n);
110
- t.addEventListener(v, a, { once: !0 });
131
+ function v(c) {
132
+ (E ? p : (s) => s())(() => {
133
+ const s = x(c);
134
+ if (!(!t || !S(c, s))) {
135
+ if (r || o) {
136
+ const h = O(r, o);
137
+ t.addEventListener(D, h, { once: !0 });
111
138
  }
112
- T(t, v, {
139
+ R(t, D, {
113
140
  bubbles: !1,
114
141
  cancelable: !0,
115
142
  detail: {
116
143
  originalEvent: c,
117
144
  contextmenu: !1,
118
- focusable: y(p(c))
145
+ focusable: X(s),
146
+ target: s
119
147
  }
120
148
  });
121
149
  }
122
150
  });
123
151
  }
124
- return u.add(E(f, "focusin", S, !0)), u.add(d.addEventListener("focusin", S, !0)), () => {
125
- clearTimeout(C), l.forEach((c) => c()), u.forEach((c) => c());
152
+ return W() || (f.add(b(l, "focusin", v, !0)), f.add(w.addEventListener("focusin", v, !0)), f.add(g.addEventListener("focusin", v, !0))), () => {
153
+ clearTimeout(A), d.forEach((c) => c()), f.forEach((c) => c());
126
154
  };
127
155
  }
128
- function A(t, e) {
129
- const { defer: r } = e, i = r ? m : (n) => n(), o = [];
130
- return o.push(
131
- i(() => {
132
- const n = typeof t == "function" ? t() : t;
133
- o.push(q(n, e));
156
+ function Z(t, e) {
157
+ const { defer: n } = e, r = n ? p : (o) => o(), i = [];
158
+ return i.push(
159
+ r(() => {
160
+ const o = typeof t == "function" ? t() : t;
161
+ i.push(J(o, e));
134
162
  })
135
163
  ), () => {
136
- o.forEach((n) => n == null ? void 0 : n());
164
+ i.forEach((o) => o == null ? void 0 : o());
137
165
  };
138
166
  }
167
+ function R(t, e, n) {
168
+ const r = t.ownerDocument.defaultView || window, i = new r.CustomEvent(e, n);
169
+ return t.dispatchEvent(i);
170
+ }
139
171
  export {
140
- A as trackInteractOutside
172
+ Z as trackInteractOutside
141
173
  };