@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,231 +1,283 @@
1
- import { createAnatomy as E } from "../../anatomy/dist/index.js";
2
- import { raf as c, createScope as N, getComputedStyle as f, dataAttr as O } from "../../dom-query/dist/index.js";
3
- import { createMachine as h } from "../../core/dist/index.js";
4
- import { compact as v } from "../../utils/dist/index.js";
5
- import { createProps as y } from "../../types/dist/index.js";
6
- import { ref as I } from "../../store/dist/index.js";
7
- var L = E("collapsible").parts("root", "trigger", "content"), g = L.build(), l = N({
8
- getRootId: (n) => {
9
- var r;
10
- return ((r = n.ids) == null ? void 0 : r.root) ?? `collapsible:${n.id}`;
11
- },
12
- getContentId: (n) => {
13
- var r;
14
- return ((r = n.ids) == null ? void 0 : r.content) ?? `collapsible:${n.id}:content`;
15
- },
16
- getTriggerId: (n) => {
17
- var r;
18
- return ((r = n.ids) == null ? void 0 : r.trigger) ?? `collapsible:${n.id}:trigger`;
19
- },
20
- getRootEl: (n) => l.getById(n, l.getRootId(n)),
21
- getContentEl: (n) => l.getById(n, l.getContentId(n)),
22
- getTriggerEl: (n) => l.getById(n, l.getTriggerId(n))
23
- });
24
- function T(n, r, e) {
25
- const o = n.matches("open", "closing"), i = n.matches("open"), t = n.context.height, s = n.context.width, a = !!n.context.disabled, d = !n.context.initial && i;
1
+ import { createAnatomy as k } from "../../anatomy/dist/index.js";
2
+ import { raf as h, dataAttr as v, getComputedStyle as O, setStyle as I, getEventTarget as y, nextTick as b } from "../../dom-query/dist/index.js";
3
+ import { createMachine as N } from "../../core/dist/index.js";
4
+ import { createProps as S } from "../../types/dist/index.js";
5
+ var z = k("collapsible").parts("root", "trigger", "content", "indicator"), m = z.build(), x = (e) => {
6
+ var t;
7
+ return ((t = e.ids) == null ? void 0 : t.root) ?? `collapsible:${e.id}`;
8
+ }, C = (e) => {
9
+ var t;
10
+ return ((t = e.ids) == null ? void 0 : t.content) ?? `collapsible:${e.id}:content`;
11
+ }, A = (e) => {
12
+ var t;
13
+ return ((t = e.ids) == null ? void 0 : t.trigger) ?? `collapsible:${e.id}:trigger`;
14
+ }, g = (e) => e.getById(C(e));
15
+ function T(e, t) {
16
+ const { state: n, send: s, context: o, scope: i, prop: l } = e, a = n.matches("open") || n.matches("closing"), r = n.matches("open"), { width: c, height: u } = o.get("size"), d = !!l("disabled"), E = !o.get("initial") && r, f = "ltr";
26
17
  return {
27
- disabled: a,
28
- visible: o,
29
- open: i,
18
+ disabled: d,
19
+ visible: a,
20
+ open: r,
21
+ measureSize() {
22
+ s({ type: "size.measure" });
23
+ },
30
24
  setOpen(p) {
31
- p !== i && r(p ? "OPEN" : "CLOSE");
25
+ n.matches("open") !== p && s({ type: p ? "open" : "close" });
32
26
  },
33
27
  getRootProps() {
34
- return e.element({
35
- ...g.root.attrs,
36
- "data-state": i ? "open" : "closed",
37
- dir: n.context.dir,
38
- id: l.getRootId(n.context)
28
+ return t.element({
29
+ ...m.root.attrs,
30
+ "data-state": r ? "open" : "closed",
31
+ dir: f,
32
+ id: x(i)
39
33
  });
40
34
  },
41
35
  getContentProps() {
42
- return e.element({
43
- ...g.content.attrs,
44
- "data-state": d ? void 0 : i ? "open" : "closed",
45
- id: l.getContentId(n.context),
46
- "data-disabled": O(a),
47
- hidden: !o,
36
+ return t.element({
37
+ ...m.content.attrs,
38
+ "data-collapsible": "",
39
+ "data-state": E ? void 0 : r ? "open" : "closed",
40
+ id: C(i),
41
+ "data-disabled": v(d),
42
+ hidden: !a,
48
43
  style: {
49
- "--height": t != null ? `${t}px` : void 0,
50
- "--width": s != null ? `${s}px` : void 0
44
+ "--height": u != null ? `${u}px` : void 0,
45
+ "--width": c != null ? `${c}px` : void 0
51
46
  }
52
47
  });
53
48
  },
54
49
  getTriggerProps() {
55
- return e.element({
56
- ...g.trigger.attrs,
57
- id: l.getTriggerId(n.context),
58
- dir: n.context.dir,
50
+ return t.element({
51
+ ...m.trigger.attrs,
52
+ id: A(i),
53
+ dir: f,
59
54
  type: "button",
60
- "data-state": i ? "open" : "closed",
61
- "data-disabled": O(a),
62
- "aria-controls": l.getContentId(n.context),
63
- "aria-expanded": o || !1,
55
+ "data-state": r ? "open" : "closed",
56
+ "data-disabled": v(d),
57
+ "aria-controls": C(i),
58
+ "aria-expanded": a || !1,
64
59
  onClick(p) {
65
- p.defaultPrevented || a || r({ type: i ? "CLOSE" : "OPEN", src: "trigger.click" });
60
+ p.defaultPrevented || d || s({ type: r ? "close" : "open" });
66
61
  }
67
62
  });
63
+ },
64
+ getIndicatorProps() {
65
+ return t.element({
66
+ ...m.indicator.attrs,
67
+ dir: f,
68
+ "data-state": r ? "open" : "closed",
69
+ "data-disabled": v(d)
70
+ });
68
71
  }
69
72
  };
70
73
  }
71
- function P(n) {
72
- const r = v(n);
73
- return h(
74
- {
75
- id: "collapsible",
76
- initial: r.open ? "open" : "closed",
77
- context: {
78
- ...r,
79
- height: 0,
80
- width: 0,
81
- initial: !1,
82
- stylesRef: null,
83
- unmountAnimationName: null
84
- },
85
- watch: {
86
- open: ["setInitial", "computeSize", "toggleVisibility"]
87
- },
88
- exit: ["clearInitial"],
89
- states: {
90
- closed: {
91
- tags: ["closed"],
92
- on: {
93
- "CONTROLLED.OPEN": "open",
94
- OPEN: [
95
- {
96
- guard: "isOpenControlled",
97
- actions: ["invokeOnOpen"]
98
- },
99
- {
100
- target: "open",
101
- actions: ["setInitial", "computeSize", "invokeOnOpen"]
102
- }
103
- ]
74
+ var V = N({
75
+ initialState({ prop: e }) {
76
+ return e("open") || e("defaultOpen") ? "open" : "closed";
77
+ },
78
+ context({ bindable: e }) {
79
+ return {
80
+ size: e(() => ({
81
+ defaultValue: { height: 0, width: 0 },
82
+ sync: !0
83
+ })),
84
+ initial: e(() => ({
85
+ defaultValue: !1
86
+ }))
87
+ };
88
+ },
89
+ refs() {
90
+ return {
91
+ cleanup: void 0,
92
+ stylesRef: void 0
93
+ };
94
+ },
95
+ watch({ track: e, prop: t, action: n }) {
96
+ e([() => t("open")], () => {
97
+ n(["setInitial", "computeSize", "toggleVisibility"]);
98
+ });
99
+ },
100
+ exit: ["clearInitial", "cleanupNode"],
101
+ states: {
102
+ closed: {
103
+ on: {
104
+ "controlled.open": {
105
+ target: "open"
106
+ },
107
+ open: [
108
+ {
109
+ guard: "isOpenControlled",
110
+ actions: ["invokeOnOpen"]
111
+ },
112
+ {
113
+ target: "open",
114
+ actions: ["setInitial", "computeSize", "invokeOnOpen"]
104
115
  }
116
+ ]
117
+ }
118
+ },
119
+ closing: {
120
+ effects: ["trackExitAnimation"],
121
+ on: {
122
+ "controlled.close": {
123
+ target: "closed"
105
124
  },
106
- closing: {
107
- tags: ["open"],
108
- activities: ["trackAnimationEvents"],
109
- on: {
110
- "CONTROLLED.CLOSE": "closed",
111
- "CONTROLLED.OPEN": "open",
112
- OPEN: [
113
- {
114
- guard: "isOpenControlled",
115
- actions: ["invokeOnOpen"]
116
- },
117
- {
118
- target: "open",
119
- actions: ["setInitial", "invokeOnOpen"]
120
- }
121
- ],
122
- CLOSE: [
123
- {
124
- guard: "isOpenControlled",
125
- actions: ["invokeOnExitComplete"]
126
- },
127
- {
128
- target: "closed",
129
- actions: ["setInitial", "computeSize", "invokeOnExitComplete"]
130
- }
131
- ],
132
- "ANIMATION.END": {
133
- target: "closed",
134
- actions: ["invokeOnExitComplete"]
135
- }
125
+ "controlled.open": {
126
+ target: "open"
127
+ },
128
+ open: [
129
+ {
130
+ guard: "isOpenControlled",
131
+ actions: ["invokeOnOpen"]
132
+ },
133
+ {
134
+ target: "open",
135
+ actions: ["setInitial", "invokeOnOpen"]
136
+ }
137
+ ],
138
+ close: [
139
+ {
140
+ guard: "isOpenControlled",
141
+ actions: ["invokeOnExitComplete"]
142
+ },
143
+ {
144
+ target: "closed",
145
+ actions: ["setInitial", "computeSize", "invokeOnExitComplete"]
136
146
  }
147
+ ],
148
+ "animation.end": {
149
+ target: "closed",
150
+ actions: ["invokeOnExitComplete", "clearInitial"]
151
+ }
152
+ }
153
+ },
154
+ open: {
155
+ effects: ["trackEnterAnimation"],
156
+ on: {
157
+ "controlled.close": {
158
+ target: "closing"
137
159
  },
138
- open: {
139
- tags: ["open"],
140
- on: {
141
- "CONTROLLED.CLOSE": "closing",
142
- CLOSE: [
143
- {
144
- guard: "isOpenControlled",
145
- actions: ["invokeOnClose"]
146
- },
147
- {
148
- target: "closing",
149
- actions: ["setInitial", "computeSize", "invokeOnClose"]
150
- }
151
- ]
160
+ close: [
161
+ {
162
+ guard: "isOpenControlled",
163
+ actions: ["invokeOnClose"]
164
+ },
165
+ {
166
+ target: "closing",
167
+ actions: ["setInitial", "computeSize", "invokeOnClose"]
152
168
  }
169
+ ],
170
+ "size.measure": {
171
+ actions: ["measureSize"]
172
+ },
173
+ "animation.end": {
174
+ actions: ["clearInitial"]
153
175
  }
154
176
  }
177
+ }
178
+ },
179
+ implementations: {
180
+ guards: {
181
+ isOpenControlled: ({ prop: e }) => e("open") != null
155
182
  },
156
- {
157
- guards: {
158
- isOpenControlled: (e) => !!e["open.controlled"]
183
+ effects: {
184
+ trackEnterAnimation: ({ send: e, scope: t }) => {
185
+ let n;
186
+ const s = h(() => {
187
+ const o = g(t);
188
+ if (!o) return;
189
+ const i = O(o).animationName;
190
+ if (!i || i === "none") {
191
+ e({ type: "animation.end" });
192
+ return;
193
+ }
194
+ const a = (r) => {
195
+ y(r) === o && e({ type: "animation.end" });
196
+ };
197
+ o.addEventListener("animationend", a), n = () => {
198
+ o.removeEventListener("animationend", a);
199
+ };
200
+ });
201
+ return () => {
202
+ s(), n == null || n();
203
+ };
159
204
  },
160
- activities: {
161
- trackAnimationEvents(e, o, { send: i }) {
162
- let t;
163
- const s = c(() => {
164
- const a = l.getContentEl(e);
165
- if (!a) return;
166
- const d = f(a).animationName;
167
- if (!d || d === "none") {
168
- i({ type: "ANIMATION.END" });
169
- return;
170
- }
171
- const m = (u) => {
172
- const C = (a.ownerDocument.defaultView || window).getComputedStyle(a).animationName;
173
- u.target === a && C === e.unmountAnimationName && i({ type: "ANIMATION.END" });
174
- };
175
- a.addEventListener("animationend", m), t = () => {
176
- a.removeEventListener("animationend", m);
177
- };
205
+ trackExitAnimation: ({ send: e, scope: t }) => {
206
+ let n;
207
+ const s = h(() => {
208
+ const o = g(t);
209
+ if (!o) return;
210
+ const i = O(o).animationName;
211
+ if (!i || i === "none") {
212
+ e({ type: "animation.end" });
213
+ return;
214
+ }
215
+ const a = (c) => {
216
+ y(c) === o && e({ type: "animation.end" });
217
+ };
218
+ o.addEventListener("animationend", a);
219
+ const r = I(o, {
220
+ animationFillMode: "forwards"
178
221
  });
179
- return () => {
180
- s(), t == null || t();
222
+ n = () => {
223
+ o.removeEventListener("animationend", a), b(() => r());
181
224
  };
182
- }
225
+ });
226
+ return () => {
227
+ s(), n == null || n();
228
+ };
229
+ }
230
+ },
231
+ actions: {
232
+ setInitial: ({ context: e, flush: t }) => {
233
+ t(() => {
234
+ e.set("initial", !0);
235
+ });
183
236
  },
184
- actions: {
185
- setInitial(e) {
186
- e.initial = !0;
187
- },
188
- clearInitial(e) {
189
- e.initial = !1;
190
- },
191
- computeSize(e, o) {
192
- var i;
193
- (i = e._rafCleanup) == null || i.call(e), e._rafCleanup = c(() => {
194
- const t = l.getContentEl(e);
195
- if (!t) return;
196
- if (e.stylesRef || (e.stylesRef = I({
197
- animationName: t.style.animationName,
198
- animationDuration: t.style.animationDuration
199
- })), o.type === "CLOSE" || !e.open) {
200
- const d = t.ownerDocument.defaultView || window;
201
- e.unmountAnimationName = d.getComputedStyle(t).animationName;
202
- }
203
- const s = t.hidden;
204
- t.style.animationName = "none", t.style.animationDuration = "0s", t.hidden = !1;
205
- const a = t.getBoundingClientRect();
206
- e.height = a.height, e.width = a.width, e.initial && (t.style.animationName = e.stylesRef.animationName, t.style.animationDuration = e.stylesRef.animationDuration), t.hidden = s;
207
- });
208
- },
209
- invokeOnOpen: (e) => {
210
- var o;
211
- (o = e.onOpenChange) == null || o.call(e, { open: !0 });
212
- },
213
- invokeOnClose: (e) => {
214
- var o;
215
- (o = e.onOpenChange) == null || o.call(e, { open: !1 });
216
- },
217
- invokeOnExitComplete(e) {
218
- var o;
219
- (o = e.onExitComplete) == null || o.call(e);
220
- },
221
- toggleVisibility: (e, o, { send: i }) => {
222
- i({ type: e.open ? "CONTROLLED.OPEN" : "CONTROLLED.CLOSE" });
223
- }
237
+ clearInitial: ({ context: e }) => {
238
+ e.set("initial", !1);
239
+ },
240
+ cleanupNode: ({ refs: e }) => {
241
+ e.set("stylesRef", null);
242
+ },
243
+ measureSize: ({ context: e, scope: t }) => {
244
+ const n = g(t);
245
+ if (!n) return;
246
+ const { height: s, width: o } = n.getBoundingClientRect();
247
+ e.set("size", { height: s, width: o });
248
+ },
249
+ computeSize: ({ refs: e, scope: t, context: n }) => {
250
+ var o;
251
+ (o = e.get("cleanup")) == null || o();
252
+ const s = h(() => {
253
+ const i = g(t);
254
+ if (!i) return;
255
+ const l = i.hidden;
256
+ i.style.animationName = "none", i.style.animationDuration = "0s", i.hidden = !1;
257
+ const a = i.getBoundingClientRect();
258
+ n.set("size", { height: a.height, width: a.width }), n.get("initial") && (i.style.animationName = "", i.style.animationDuration = ""), i.hidden = l;
259
+ });
260
+ e.set("cleanup", s);
261
+ },
262
+ invokeOnOpen: ({ prop: e }) => {
263
+ var t;
264
+ (t = e("onOpenChange")) == null || t({ open: !0 });
265
+ },
266
+ invokeOnClose: ({ prop: e }) => {
267
+ var t;
268
+ (t = e("onOpenChange")) == null || t({ open: !1 });
269
+ },
270
+ invokeOnExitComplete: ({ prop: e }) => {
271
+ var t;
272
+ (t = e("onExitComplete")) == null || t();
273
+ },
274
+ toggleVisibility: ({ prop: e, send: t }) => {
275
+ t({ type: e("open") ? "controlled.open" : "controlled.close" });
224
276
  }
225
277
  }
226
- );
227
- }
228
- y()([
278
+ }
279
+ });
280
+ S()([
229
281
  "dir",
230
282
  "disabled",
231
283
  "getRootNode",
@@ -233,11 +285,11 @@ y()([
233
285
  "ids",
234
286
  "onExitComplete",
235
287
  "onOpenChange",
236
- "open.controlled",
288
+ "defaultOpen",
237
289
  "open"
238
290
  ]);
239
291
  export {
240
- L as anatomy,
292
+ z as anatomy,
241
293
  T as connect,
242
- P as machine
294
+ V as machine
243
295
  };