@serendie/ui 2.1.2 → 2.1.3-dev.202509030422

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 (107) hide show
  1. package/dist/client.js +67 -65
  2. package/dist/components/Accordion/Accordion.d.ts +1 -1
  3. package/dist/components/Avatar/Avatar.d.ts +1 -1
  4. package/dist/components/Banner/Banner.d.ts +1 -1
  5. package/dist/components/BottomNavigation/BottomNavigationItem.d.ts +1 -1
  6. package/dist/components/Button/Button.d.ts +2 -2
  7. package/dist/components/DatePicker/DatePicker.d.ts +13 -0
  8. package/dist/components/DatePicker/DatePicker.js +203 -0
  9. package/dist/components/DatePicker/index.d.ts +1 -0
  10. package/dist/components/DatePicker/index.js +4 -0
  11. package/dist/components/DatePicker/styles.d.ts +1 -0
  12. package/dist/components/DatePicker/styles.js +224 -0
  13. package/dist/components/IconButton/IconButton.d.ts +3 -3
  14. package/dist/components/List/ListItem.d.ts +1 -1
  15. package/dist/components/ModalDialog/ModalDialog.d.ts +1 -1
  16. package/dist/components/NotificationBadge/NotificationBadge.d.ts +1 -1
  17. package/dist/components/Pagination/Pagination.d.ts +1 -1
  18. package/dist/components/Search/Search.d.ts +1 -1
  19. package/dist/components/Select/Select.d.ts +3 -2
  20. package/dist/components/Switch/Switch.d.ts +1 -1
  21. package/dist/components/Tabs/Tabs.d.ts +1 -1
  22. package/dist/components/TextField/TextField.js +59 -156
  23. package/dist/components/Toast/Toast.d.ts +1 -1
  24. package/dist/components/TopAppBar/TopAppBar.d.ts +1 -1
  25. package/dist/index.d.ts +1 -0
  26. package/dist/index.js +67 -65
  27. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-content.js +15 -0
  28. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-context.js +5 -0
  29. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-control.js +13 -0
  30. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-input.js +14 -0
  31. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-label.js +13 -0
  32. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-month-select.js +13 -0
  33. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-next-trigger.js +14 -0
  34. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-positioner.js +14 -0
  35. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-prev-trigger.js +14 -0
  36. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-root.js +55 -0
  37. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-body.js +14 -0
  38. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-cell-trigger.js +19 -0
  39. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-cell.js +26 -0
  40. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-head.js +14 -0
  41. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-header.js +14 -0
  42. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-row.js +14 -0
  43. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table.js +16 -0
  44. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-trigger.js +13 -0
  45. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-view-control.js +14 -0
  46. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-view.js +23 -0
  47. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-year-select.js +13 -0
  48. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker.anatomy.js +5 -0
  49. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-context.js +10 -0
  50. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-table-cell-props-context.js +10 -0
  51. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-table-props-context.js +10 -0
  52. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-view-props-context.js +12 -0
  53. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker.js +18 -0
  54. package/dist/node_modules/@ark-ui/react/dist/components/factory.js +11 -12
  55. package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-root.js +5 -4
  56. package/dist/node_modules/@ark-ui/react/dist/utils/use-event.js +0 -1
  57. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +36 -36
  58. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +238 -235
  59. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +88 -83
  60. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +68 -67
  61. package/dist/node_modules/@internationalized/date/dist/CalendarDate.js +178 -0
  62. package/dist/node_modules/@internationalized/date/dist/DateFormatter.js +99 -0
  63. package/dist/node_modules/@internationalized/date/dist/GregorianCalendar.js +98 -0
  64. package/dist/node_modules/@internationalized/date/dist/conversion.js +135 -0
  65. package/dist/node_modules/@internationalized/date/dist/manipulation.js +205 -0
  66. package/dist/node_modules/@internationalized/date/dist/queries.js +202 -0
  67. package/dist/node_modules/@internationalized/date/dist/string.js +27 -0
  68. package/dist/node_modules/@internationalized/date/dist/utils.js +6 -0
  69. package/dist/node_modules/@internationalized/date/dist/weekStartData.js +100 -0
  70. package/dist/node_modules/@swc/helpers/esm/_check_private_redeclaration.js +7 -0
  71. package/dist/node_modules/@swc/helpers/esm/_class_private_field_init.js +7 -0
  72. package/dist/node_modules/@zag-js/anatomy/dist/index.js +15 -14
  73. package/dist/node_modules/@zag-js/aria-hidden/dist/index.js +23 -23
  74. package/dist/node_modules/@zag-js/collection/dist/index.js +102 -71
  75. package/dist/node_modules/@zag-js/combobox/dist/index.js +482 -426
  76. package/dist/node_modules/@zag-js/date-picker/dist/index.js +1820 -0
  77. package/dist/node_modules/@zag-js/date-utils/dist/index.js +366 -0
  78. package/dist/node_modules/@zag-js/dialog/dist/index.js +66 -64
  79. package/dist/node_modules/@zag-js/dismissable/dist/index.js +94 -69
  80. package/dist/node_modules/@zag-js/dom-query/dist/index.js +359 -300
  81. package/dist/node_modules/@zag-js/live-region/dist/index.js +39 -0
  82. package/dist/node_modules/@zag-js/menu/dist/index.js +357 -340
  83. package/dist/node_modules/@zag-js/popper/dist/index.js +123 -120
  84. package/dist/node_modules/@zag-js/presence/dist/index.js +17 -17
  85. package/dist/node_modules/@zag-js/radio-group/dist/index.js +118 -117
  86. package/dist/node_modules/@zag-js/react/dist/index.js +124 -121
  87. package/dist/node_modules/@zag-js/select/dist/index.js +211 -197
  88. package/dist/node_modules/@zag-js/toast/dist/index.js +73 -71
  89. package/dist/node_modules/@zag-js/tooltip/dist/index.js +31 -30
  90. package/dist/node_modules/@zag-js/utils/dist/index.js +150 -104
  91. package/dist/preset.d.ts +3 -1
  92. package/dist/recipes/index.d.ts +3 -2
  93. package/dist/recipes/index.js +5 -2
  94. package/dist/recipes/textFieldRecipe.d.ts +6 -0
  95. package/dist/recipes/textFieldRecipe.js +107 -0
  96. package/dist/styled-system/css/cva.js +43 -38
  97. package/dist/styled-system/recipes/create-recipe.js +37 -0
  98. package/dist/styled-system/recipes/text-field-recipe.js +61 -0
  99. package/dist/styles.css +1 -1
  100. package/package.json +3 -3
  101. package/styled-system/recipes/create-recipe.js +82 -0
  102. package/styled-system/recipes/index.d.ts +2 -0
  103. package/styled-system/recipes/index.js +1 -0
  104. package/styled-system/recipes/text-field-recipe.d.ts +28 -0
  105. package/styled-system/recipes/text-field-recipe.js +72 -0
  106. package/dist/node_modules/@zag-js/store/dist/index.js +0 -131
  107. package/dist/node_modules/proxy-compare/dist/index.js +0 -7
@@ -1,7 +1,7 @@
1
- import { autoUpdate as S, offset as A, flip as D, shift as H, arrow as R, size as W, hide as B, computePosition as I, limitShift as T } from "../../../@floating-ui/dom/dist/floating-ui.dom.js";
2
- import { raf as V, isHTMLElement as k, getWindow as C, getComputedStyle as L } from "../../dom-query/dist/index.js";
3
- import { noop as N, isNull as j, runIfFn as U, compact as _ } from "../../utils/dist/index.js";
4
- function b(e = 0, t = 0, r = 0, i = 0) {
1
+ import { autoUpdate as T, offset as I, flip as V, shift as Y, arrow as j, size as k, hide as C, computePosition as L, limitShift as N } from "../../../@floating-ui/dom/dist/floating-ui.dom.js";
2
+ import { raf as U, isHTMLElement as X, getWindow as _, getComputedStyle as q } from "../../dom-query/dist/index.js";
3
+ import { noop as G, isNull as J, compact as K } from "../../utils/dist/index.js";
4
+ function R(e = 0, t = 0, r = 0, i = 0) {
5
5
  if (typeof DOMRect == "function")
6
6
  return new DOMRect(e, t, r, i);
7
7
  const n = {
@@ -16,55 +16,57 @@ function b(e = 0, t = 0, r = 0, i = 0) {
16
16
  };
17
17
  return { ...n, toJSON: () => n };
18
18
  }
19
- function q(e) {
20
- if (!e) return b();
19
+ function Q(e) {
20
+ if (!e) return R();
21
21
  const { x: t, y: r, width: i, height: n } = e;
22
- return b(t, r, i, n);
22
+ return R(t, r, i, n);
23
23
  }
24
- function E(e, t) {
24
+ function Z(e, t) {
25
25
  return {
26
- contextElement: k(e) ? e : void 0,
26
+ contextElement: X(e) ? e : void 0,
27
27
  getBoundingClientRect: () => {
28
28
  const r = e, i = t == null ? void 0 : t(r);
29
- return i || !r ? q(i) : r.getBoundingClientRect();
29
+ return i || !r ? Q(i) : r.getBoundingClientRect();
30
30
  }
31
31
  };
32
32
  }
33
- var u = (e) => ({ variable: e, reference: `var(${e})` }), f = {
34
- arrowSize: u("--arrow-size"),
35
- arrowSizeHalf: u("--arrow-size-half"),
36
- arrowBg: u("--arrow-background"),
37
- transformOrigin: u("--transform-origin"),
38
- arrowOffset: u("--arrow-offset")
39
- }, G = (e) => ({
40
- top: "bottom center",
41
- "top-start": e ? `${e.x}px bottom` : "left bottom",
42
- "top-end": e ? `${e.x}px bottom` : "right bottom",
43
- bottom: "top center",
44
- "bottom-start": e ? `${e.x}px top` : "top left",
45
- "bottom-end": e ? `${e.x}px top` : "top right",
46
- left: "right center",
47
- "left-start": e ? `right ${e.y}px` : "right top",
48
- "left-end": e ? `right ${e.y}px` : "right bottom",
49
- right: "left center",
50
- "right-start": e ? `left ${e.y}px` : "left top",
51
- "right-end": e ? `left ${e.y}px` : "left bottom"
52
- }), J = {
53
- name: "transformOrigin",
54
- fn({ placement: e, elements: t, middlewareData: r }) {
55
- const { arrow: i } = r, n = G(i)[e], { floating: o } = t;
56
- return o.style.setProperty(f.transformOrigin.variable, n), {
57
- data: { transformOrigin: n }
58
- };
59
- }
60
- }, Y = {
33
+ var m = (e) => ({ variable: e, reference: `var(${e})` }), f = {
34
+ arrowSize: m("--arrow-size"),
35
+ arrowSizeHalf: m("--arrow-size-half"),
36
+ arrowBg: m("--arrow-background"),
37
+ transformOrigin: m("--transform-origin"),
38
+ arrowOffset: m("--arrow-offset")
39
+ }, F = (e) => e === "top" || e === "bottom" ? "y" : "x";
40
+ function E(e, t) {
41
+ return {
42
+ name: "transformOrigin",
43
+ fn(r) {
44
+ var A, H, D, W;
45
+ const { elements: i, middlewareData: n, placement: o, rects: c, y: s } = r, d = o.split("-")[0], l = F(d), a = ((A = n.arrow) == null ? void 0 : A.x) || 0, y = ((H = n.arrow) == null ? void 0 : H.y) || 0, w = (t == null ? void 0 : t.clientWidth) || 0, v = (t == null ? void 0 : t.clientHeight) || 0, p = a + w / 2, h = y + v / 2, x = Math.abs(((D = n.shift) == null ? void 0 : D.y) || 0), P = c.reference.height / 2, b = v / 2, g = ((W = e.offset) == null ? void 0 : W.mainAxis) ?? e.gutter, u = typeof g == "number" ? g + b : g ?? b, O = x > u, M = {
46
+ top: `${p}px calc(100% + ${u}px)`,
47
+ bottom: `${p}px ${-u}px`,
48
+ left: `calc(100% + ${u}px) ${h}px`,
49
+ right: `${-u}px ${h}px`
50
+ }[d], S = `${p}px ${c.reference.y + P - s}px`, z = !!e.overlap && l === "y" && O;
51
+ return i.floating.style.setProperty(
52
+ f.transformOrigin.variable,
53
+ z ? S : M
54
+ ), {
55
+ data: {
56
+ transformOrigin: z ? S : M
57
+ }
58
+ };
59
+ }
60
+ };
61
+ }
62
+ var ee = {
61
63
  name: "rects",
62
64
  fn({ rects: e }) {
63
65
  return {
64
66
  data: e
65
67
  };
66
68
  }
67
- }, K = (e) => {
69
+ }, te = (e) => {
68
70
  if (e)
69
71
  return {
70
72
  name: "shiftArrow",
@@ -79,14 +81,14 @@ var u = (e) => ({ variable: e, reference: `var(${e})` }), f = {
79
81
  }
80
82
  };
81
83
  };
82
- function Q(e) {
84
+ function re(e) {
83
85
  const [t, r] = e.split("-");
84
86
  return { side: t, align: r, hasAlign: r != null };
85
87
  }
86
- function de(e) {
88
+ function me(e) {
87
89
  return e.split("-")[0];
88
90
  }
89
- var X = {
91
+ var ne = {
90
92
  strategy: "absolute",
91
93
  placement: "bottom",
92
94
  listeners: !0,
@@ -99,121 +101,122 @@ var X = {
99
101
  overflowPadding: 8,
100
102
  arrowPadding: 4
101
103
  };
102
- function P(e, t) {
104
+ function B(e, t) {
103
105
  const r = e.devicePixelRatio || 1;
104
106
  return Math.round(t * r) / r;
105
107
  }
106
- function M(e) {
107
- return U(e.boundary);
108
+ function $(e) {
109
+ return typeof e == "function" ? e() : e === "clipping-ancestors" ? "clippingAncestors" : e;
108
110
  }
109
- function Z(e, t) {
110
- if (e)
111
- return R({
112
- element: e,
113
- padding: t.arrowPadding
114
- });
111
+ function ie(e, t, r) {
112
+ const i = e || t.createElement("div");
113
+ return j({ element: i, padding: r.arrowPadding });
115
114
  }
116
- function F(e, t) {
117
- if (!j(t.offset ?? t.gutter))
118
- return A(({ placement: r }) => {
119
- var d, a;
120
- const i = ((e == null ? void 0 : e.clientHeight) || 0) / 2, n = ((d = t.offset) == null ? void 0 : d.mainAxis) ?? t.gutter, o = typeof n == "number" ? n + i : n ?? i, { hasAlign: c } = Q(r), s = c ? void 0 : t.shift, l = ((a = t.offset) == null ? void 0 : a.crossAxis) ?? s;
121
- return _({
122
- crossAxis: l,
115
+ function oe(e, t) {
116
+ if (!J(t.offset ?? t.gutter))
117
+ return I(({ placement: r }) => {
118
+ var l, a;
119
+ const i = ((e == null ? void 0 : e.clientHeight) || 0) / 2, n = ((l = t.offset) == null ? void 0 : l.mainAxis) ?? t.gutter, o = typeof n == "number" ? n + i : n ?? i, { hasAlign: c } = re(r), s = c ? void 0 : t.shift, d = ((a = t.offset) == null ? void 0 : a.crossAxis) ?? s;
120
+ return K({
121
+ crossAxis: d,
123
122
  mainAxis: o,
124
123
  alignmentAxis: t.shift
125
124
  });
126
125
  });
127
126
  }
128
- function ee(e) {
129
- if (e.flip)
130
- return D({
131
- boundary: M(e),
132
- padding: e.overflowPadding,
133
- fallbackPlacements: e.flip === !0 ? void 0 : e.flip
134
- });
127
+ function se(e) {
128
+ if (!e.flip) return;
129
+ const t = $(e.boundary);
130
+ return V({
131
+ ...t ? { boundary: t } : void 0,
132
+ padding: e.overflowPadding,
133
+ fallbackPlacements: e.flip === !0 ? void 0 : e.flip
134
+ });
135
135
  }
136
- function te(e) {
137
- if (!(!e.slide && !e.overlap))
138
- return H({
139
- boundary: M(e),
140
- mainAxis: e.slide,
141
- crossAxis: e.overlap,
142
- padding: e.overflowPadding,
143
- limiter: T()
144
- });
136
+ function ae(e) {
137
+ if (!e.slide && !e.overlap) return;
138
+ const t = $(e.boundary);
139
+ return Y({
140
+ ...t ? { boundary: t } : void 0,
141
+ mainAxis: e.slide,
142
+ crossAxis: e.overlap,
143
+ padding: e.overflowPadding,
144
+ limiter: N()
145
+ });
145
146
  }
146
- function re(e) {
147
- return W({
147
+ function ce(e) {
148
+ return k({
148
149
  padding: e.overflowPadding,
149
150
  apply({ elements: t, rects: r, availableHeight: i, availableWidth: n }) {
150
- const o = t.floating, c = Math.round(r.reference.width);
151
- n = Math.floor(n), i = Math.floor(i), o.style.setProperty("--reference-width", `${c}px`), o.style.setProperty("--available-width", `${n}px`), o.style.setProperty("--available-height", `${i}px`);
151
+ const o = t.floating, c = Math.round(r.reference.width), s = Math.round(r.reference.height);
152
+ n = Math.floor(n), i = Math.floor(i), o.style.setProperty("--reference-width", `${c}px`), o.style.setProperty("--reference-height", `${s}px`), o.style.setProperty("--available-width", `${n}px`), o.style.setProperty("--available-height", `${i}px`);
152
153
  }
153
154
  });
154
155
  }
155
- function ne(e) {
156
- var t;
156
+ function fe(e) {
157
157
  if (e.hideWhenDetached)
158
- return B({ strategy: "referenceHidden", boundary: ((t = e.boundary) == null ? void 0 : t.call(e)) ?? "clippingAncestors" });
158
+ return C({ strategy: "referenceHidden", boundary: $(e.boundary) ?? "clippingAncestors" });
159
159
  }
160
- function ie(e) {
160
+ function de(e) {
161
161
  return e ? e === !0 ? { ancestorResize: !0, ancestorScroll: !0, elementResize: !0, layoutShift: !0 } : e : {};
162
162
  }
163
- function oe(e, t, r = {}) {
164
- const i = E(e, r.getAnchorRect);
163
+ function le(e, t, r = {}) {
164
+ const i = Z(e, r.getAnchorRect);
165
165
  if (!t || !i) return;
166
- const n = Object.assign({}, X, r), o = t.querySelector("[data-part=arrow]"), c = [
167
- F(o, n),
168
- ee(n),
169
- te(n),
170
- Z(o, n),
171
- K(o),
172
- J,
173
- re(n),
174
- ne(n),
175
- Y
176
- ], { placement: s, strategy: l, onComplete: d, onPositioned: a } = n, h = async () => {
177
- var x;
166
+ const n = Object.assign({}, ne, r), o = t.querySelector("[data-part=arrow]"), c = [
167
+ oe(o, n),
168
+ se(n),
169
+ ae(n),
170
+ ie(o, t.ownerDocument, n),
171
+ te(o),
172
+ E(
173
+ { gutter: n.gutter, offset: n.offset, overlap: n.overlap },
174
+ o
175
+ ),
176
+ ce(n),
177
+ fe(n),
178
+ ee
179
+ ], { placement: s, strategy: d, onComplete: l, onPositioned: a } = n, y = async () => {
180
+ var u;
178
181
  if (!i || !t) return;
179
- const p = await I(i, t, {
182
+ const h = await L(i, t, {
180
183
  placement: s,
181
184
  middleware: c,
182
- strategy: l
185
+ strategy: d
183
186
  });
184
- d == null || d(p), a == null || a({ placed: !0 });
185
- const y = C(t), $ = P(y, p.x), z = P(y, p.y);
186
- t.style.setProperty("--x", `${$}px`), t.style.setProperty("--y", `${z}px`), n.hideWhenDetached && (((x = p.middlewareData.hide) == null ? void 0 : x.referenceHidden) ? (t.style.setProperty("visibility", "hidden"), t.style.setProperty("pointer-events", "none")) : (t.style.removeProperty("visibility"), t.style.removeProperty("pointer-events")));
187
- const v = t.firstElementChild;
188
- if (v) {
189
- const w = L(v);
190
- t.style.setProperty("--z-index", w.zIndex);
187
+ l == null || l(h), a == null || a({ placed: !0 });
188
+ const x = _(t), P = B(x, h.x), b = B(x, h.y);
189
+ t.style.setProperty("--x", `${P}px`), t.style.setProperty("--y", `${b}px`), n.hideWhenDetached && (((u = h.middlewareData.hide) == null ? void 0 : u.referenceHidden) ? (t.style.setProperty("visibility", "hidden"), t.style.setProperty("pointer-events", "none")) : (t.style.removeProperty("visibility"), t.style.removeProperty("pointer-events")));
190
+ const g = t.firstElementChild;
191
+ if (g) {
192
+ const O = q(g);
193
+ t.style.setProperty("--z-index", O.zIndex);
191
194
  }
192
- }, m = async () => {
193
- r.updatePosition ? (await r.updatePosition({ updatePosition: h }), a == null || a({ placed: !0 })) : await h();
194
- }, O = ie(n.listeners), g = n.listeners ? S(i, t, m, O) : N;
195
- return m(), () => {
196
- g == null || g(), a == null || a({ placed: !1 });
195
+ }, w = async () => {
196
+ r.updatePosition ? (await r.updatePosition({ updatePosition: y, floatingElement: t }), a == null || a({ placed: !0 })) : await y();
197
+ }, v = de(n.listeners), p = n.listeners ? T(i, t, w, v) : G;
198
+ return w(), () => {
199
+ p == null || p(), a == null || a({ placed: !1 });
197
200
  };
198
201
  }
199
- function le(e, t, r = {}) {
200
- const { defer: i, ...n } = r, o = i ? V : (s) => s(), c = [];
202
+ function ye(e, t, r = {}) {
203
+ const { defer: i, ...n } = r, o = i ? U : (s) => s(), c = [];
201
204
  return c.push(
202
205
  o(() => {
203
- const s = typeof e == "function" ? e() : e, l = typeof t == "function" ? t() : t;
204
- c.push(oe(s, l, n));
206
+ const s = typeof e == "function" ? e() : e, d = typeof t == "function" ? t() : t;
207
+ c.push(le(s, d, n));
205
208
  })
206
209
  ), () => {
207
210
  c.forEach((s) => s == null ? void 0 : s());
208
211
  };
209
212
  }
210
- var ae = {
213
+ var ue = {
211
214
  bottom: "rotate(45deg)",
212
215
  left: "rotate(135deg)",
213
216
  top: "rotate(225deg)",
214
217
  right: "rotate(315deg)"
215
218
  };
216
- function ue(e = {}) {
219
+ function we(e = {}) {
217
220
  const { placement: t, sameWidth: r, fitViewport: i, strategy: n = "absolute" } = e;
218
221
  return {
219
222
  arrow: {
@@ -225,7 +228,7 @@ function ue(e = {}) {
225
228
  },
226
229
  arrowTip: {
227
230
  // @ts-expect-error - Fix this
228
- transform: t ? ae[t.split("-")[0]] : void 0,
231
+ transform: t ? ue[t.split("-")[0]] : void 0,
229
232
  background: f.arrowBg.reference,
230
233
  top: "0",
231
234
  left: "0",
@@ -251,7 +254,7 @@ function ue(e = {}) {
251
254
  };
252
255
  }
253
256
  export {
254
- le as getPlacement,
255
- de as getPlacementSide,
256
- ue as getPlacementStyles
257
+ ye as getPlacement,
258
+ me as getPlacementSide,
259
+ we as getPlacementStyles
257
260
  };
@@ -1,6 +1,6 @@
1
- import { setStyle as N, nextTick as d, raf as p, getComputedStyle as g, getEventTarget as v } from "../../dom-query/dist/index.js";
2
- import { createMachine as y } from "../../core/dist/index.js";
3
- import { createProps as f } from "../../types/dist/index.js";
1
+ import { setStyle as N, nextTick as d, raf as p, getComputedStyle as g, getEventTarget as E } from "../../dom-query/dist/index.js";
2
+ import { createMachine as v } from "../../core/dist/index.js";
3
+ import { createProps as y } from "../../types/dist/index.js";
4
4
  function S(e, t) {
5
5
  const { state: i, send: n, context: s } = e, a = i.matches("mounted", "unmountSuspended");
6
6
  return {
@@ -14,7 +14,7 @@ function S(e, t) {
14
14
  }
15
15
  };
16
16
  }
17
- var O = y({
17
+ var O = v({
18
18
  props({ props: e }) {
19
19
  return { ...e, present: !!e.present };
20
20
  },
@@ -39,14 +39,17 @@ var O = y({
39
39
  };
40
40
  },
41
41
  exit: ["clearInitial", "cleanupNode"],
42
- watch({ track: e, action: t, prop: i }) {
43
- e([() => i("present")], () => {
44
- t(["setInitial", "syncPresence"]);
42
+ watch({ track: e, prop: t, send: i }) {
43
+ e([() => t("present")], () => {
44
+ i({ type: "PRESENCE.CHANGED" });
45
45
  });
46
46
  },
47
47
  on: {
48
48
  "NODE.SET": {
49
- actions: ["setNode", "setStyles"]
49
+ actions: ["setupNode"]
50
+ },
51
+ "PRESENCE.CHANGED": {
52
+ actions: ["setInitial", "syncPresence"]
50
53
  }
51
54
  },
52
55
  states: {
@@ -93,18 +96,15 @@ var O = y({
93
96
  clearInitial: ({ context: e }) => {
94
97
  e.set("initial", !1);
95
98
  },
96
- cleanupNode: ({ refs: e }) => {
97
- e.set("node", null), e.set("styles", null);
98
- },
99
99
  invokeOnExitComplete: ({ prop: e }) => {
100
100
  var t;
101
101
  (t = e("onExitComplete")) == null || t();
102
102
  },
103
- setNode: ({ refs: e, event: t }) => {
104
- e.set("node", t.node);
103
+ setupNode: ({ refs: e, event: t }) => {
104
+ e.get("node") !== t.node && (e.set("node", t.node), e.set("styles", g(t.node)));
105
105
  },
106
- setStyles: ({ refs: e, event: t }) => {
107
- e.set("styles", g(t.node));
106
+ cleanupNode: ({ refs: e }) => {
107
+ e.set("node", null), e.set("styles", null);
108
108
  },
109
109
  syncPresence: ({ context: e, refs: t, send: i, prop: n }) => {
110
110
  const s = n("present");
@@ -137,7 +137,7 @@ var O = y({
137
137
  (((c = (l = o.composedPath) == null ? void 0 : l.call(o)) == null ? void 0 : c[0]) ?? o.target) === n && e.set("prevAnimationName", u(t.get("styles")));
138
138
  }, a = (o) => {
139
139
  const m = u(t.get("styles"));
140
- v(o) === n && m === e.get("unmountAnimationName") && i({ type: "UNMOUNT", src: "animationend" });
140
+ E(o) === n && m === e.get("unmountAnimationName") && i({ type: "UNMOUNT", src: "animationend" });
141
141
  };
142
142
  n.addEventListener("animationstart", s), n.addEventListener("animationcancel", a), n.addEventListener("animationend", a);
143
143
  const r = N(n, { animationFillMode: "forwards" });
@@ -151,7 +151,7 @@ var O = y({
151
151
  function u(e) {
152
152
  return (e == null ? void 0 : e.animationName) || "none";
153
153
  }
154
- f()(["onExitComplete", "present", "immediate"]);
154
+ y()(["onExitComplete", "present", "immediate"]);
155
155
  export {
156
156
  S as connect,
157
157
  O as machine