@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,13 +1,12 @@
1
- import { createAnatomy as c } from "../../anatomy/dist/index.js";
2
- import { raf as p, createScope as u, nextTick as E } from "../../dom-query/dist/index.js";
3
- import { ariaHidden as O } from "../../aria-hidden/dist/index.js";
4
- import { createMachine as m } from "../../core/dist/index.js";
5
- import { trackDismissableElement as C } from "../../dismissable/dist/index.js";
6
- import { preventBodyScroll as I } from "../../remove-scroll/dist/index.js";
7
- import { compact as f } from "../../utils/dist/index.js";
8
- import { createFocusTrap as v } from "../../../focus-trap/dist/focus-trap.esm.js";
9
- import { createProps as k } from "../../types/dist/index.js";
10
- var T = c("dialog").parts(
1
+ import { createAnatomy as y } from "../../anatomy/dist/index.js";
2
+ import { ariaHidden as k } from "../../aria-hidden/dist/index.js";
3
+ import { createMachine as I } from "../../core/dist/index.js";
4
+ import { trackDismissableElement as b } from "../../dismissable/dist/index.js";
5
+ import { raf as E, getComputedStyle as D } from "../../dom-query/dist/index.js";
6
+ import { trapFocus as P } from "../../focus-trap/dist/index.js";
7
+ import { preventBodyScroll as F } from "../../remove-scroll/dist/index.js";
8
+ import { createProps as T } from "../../types/dist/index.js";
9
+ var L = y("dialog").parts(
11
10
  "trigger",
12
11
  "backdrop",
13
12
  "positioner",
@@ -15,308 +14,282 @@ var T = c("dialog").parts(
15
14
  "title",
16
15
  "description",
17
16
  "closeTrigger"
18
- ), a = T.build(), o = u({
19
- getPositionerId: (t) => {
20
- var n;
21
- return ((n = t.ids) == null ? void 0 : n.positioner) ?? `dialog:${t.id}:positioner`;
22
- },
23
- getBackdropId: (t) => {
24
- var n;
25
- return ((n = t.ids) == null ? void 0 : n.backdrop) ?? `dialog:${t.id}:backdrop`;
26
- },
27
- getContentId: (t) => {
28
- var n;
29
- return ((n = t.ids) == null ? void 0 : n.content) ?? `dialog:${t.id}:content`;
30
- },
31
- getTriggerId: (t) => {
32
- var n;
33
- return ((n = t.ids) == null ? void 0 : n.trigger) ?? `dialog:${t.id}:trigger`;
34
- },
35
- getTitleId: (t) => {
36
- var n;
37
- return ((n = t.ids) == null ? void 0 : n.title) ?? `dialog:${t.id}:title`;
38
- },
39
- getDescriptionId: (t) => {
40
- var n;
41
- return ((n = t.ids) == null ? void 0 : n.description) ?? `dialog:${t.id}:description`;
42
- },
43
- getCloseTriggerId: (t) => {
44
- var n;
45
- return ((n = t.ids) == null ? void 0 : n.closeTrigger) ?? `dialog:${t.id}:close`;
46
- },
47
- getContentEl: (t) => o.getById(t, o.getContentId(t)),
48
- getPositionerEl: (t) => o.getById(t, o.getPositionerId(t)),
49
- getBackdropEl: (t) => o.getById(t, o.getBackdropId(t)),
50
- getTriggerEl: (t) => o.getById(t, o.getTriggerId(t)),
51
- getTitleEl: (t) => o.getById(t, o.getTitleId(t)),
52
- getDescriptionEl: (t) => o.getById(t, o.getDescriptionId(t)),
53
- getCloseTriggerEl: (t) => o.getById(t, o.getCloseTriggerId(t))
54
- });
55
- function w(t, n, e) {
56
- const r = t.context["aria-label"], s = t.matches("open"), d = t.context.renderedElements;
17
+ ), l = L.build(), m = (e) => {
18
+ var t;
19
+ return ((t = e.ids) == null ? void 0 : t.positioner) ?? `dialog:${e.id}:positioner`;
20
+ }, v = (e) => {
21
+ var t;
22
+ return ((t = e.ids) == null ? void 0 : t.backdrop) ?? `dialog:${e.id}:backdrop`;
23
+ }, p = (e) => {
24
+ var t;
25
+ return ((t = e.ids) == null ? void 0 : t.content) ?? `dialog:${e.id}:content`;
26
+ }, f = (e) => {
27
+ var t;
28
+ return ((t = e.ids) == null ? void 0 : t.trigger) ?? `dialog:${e.id}:trigger`;
29
+ }, g = (e) => {
30
+ var t;
31
+ return ((t = e.ids) == null ? void 0 : t.title) ?? `dialog:${e.id}:title`;
32
+ }, u = (e) => {
33
+ var t;
34
+ return ((t = e.ids) == null ? void 0 : t.description) ?? `dialog:${e.id}:description`;
35
+ }, C = (e) => {
36
+ var t;
37
+ return ((t = e.ids) == null ? void 0 : t.closeTrigger) ?? `dialog:${e.id}:close`;
38
+ }, c = (e) => e.getById(p(e)), h = (e) => e.getById(m(e)), S = (e) => e.getById(v(e)), B = (e) => e.getById(f(e)), N = (e) => e.getById(g(e)), w = (e) => e.getById(u(e)), R = (e) => e.getById(C(e));
39
+ function q(e, t) {
40
+ const { state: n, send: a, context: o, prop: r, scope: i } = e, O = r("aria-label"), d = n.matches("open");
57
41
  return {
58
- open: s,
59
- setOpen(i) {
60
- i !== s && n(i ? "OPEN" : "CLOSE");
42
+ open: d,
43
+ setOpen(s) {
44
+ n.matches("open") !== s && a({ type: s ? "OPEN" : "CLOSE" });
61
45
  },
62
46
  getTriggerProps() {
63
- return e.button({
64
- ...a.trigger.attrs,
65
- dir: t.context.dir,
66
- id: o.getTriggerId(t.context),
47
+ return t.button({
48
+ ...l.trigger.attrs,
49
+ dir: r("dir"),
50
+ id: f(i),
67
51
  "aria-haspopup": "dialog",
68
52
  type: "button",
69
- "aria-expanded": s,
70
- "data-state": s ? "open" : "closed",
71
- "aria-controls": o.getContentId(t.context),
72
- onClick(i) {
73
- i.defaultPrevented || n("TOGGLE");
53
+ "aria-expanded": d,
54
+ "data-state": d ? "open" : "closed",
55
+ "aria-controls": p(i),
56
+ onClick(s) {
57
+ s.defaultPrevented || a({ type: "TOGGLE" });
74
58
  }
75
59
  });
76
60
  },
77
61
  getBackdropProps() {
78
- return e.element({
79
- ...a.backdrop.attrs,
80
- dir: t.context.dir,
81
- hidden: !s,
82
- id: o.getBackdropId(t.context),
83
- "data-state": s ? "open" : "closed"
62
+ return t.element({
63
+ ...l.backdrop.attrs,
64
+ dir: r("dir"),
65
+ hidden: !d,
66
+ id: v(i),
67
+ "data-state": d ? "open" : "closed"
84
68
  });
85
69
  },
86
70
  getPositionerProps() {
87
- return e.element({
88
- ...a.positioner.attrs,
89
- dir: t.context.dir,
90
- id: o.getPositionerId(t.context),
71
+ return t.element({
72
+ ...l.positioner.attrs,
73
+ dir: r("dir"),
74
+ id: m(i),
91
75
  style: {
92
- pointerEvents: s ? void 0 : "none"
76
+ pointerEvents: d ? void 0 : "none"
93
77
  }
94
78
  });
95
79
  },
96
80
  getContentProps() {
97
- return e.element({
98
- ...a.content.attrs,
99
- dir: t.context.dir,
100
- role: t.context.role,
101
- hidden: !s,
102
- id: o.getContentId(t.context),
81
+ const s = o.get("rendered");
82
+ return t.element({
83
+ ...l.content.attrs,
84
+ dir: r("dir"),
85
+ role: r("role"),
86
+ hidden: !d,
87
+ id: p(i),
103
88
  tabIndex: -1,
104
- "data-state": s ? "open" : "closed",
89
+ "data-state": d ? "open" : "closed",
105
90
  "aria-modal": !0,
106
- "aria-label": r || void 0,
107
- "aria-labelledby": r || !d.title ? void 0 : o.getTitleId(t.context),
108
- "aria-describedby": d.description ? o.getDescriptionId(t.context) : void 0
91
+ "aria-label": O || void 0,
92
+ "aria-labelledby": O || !s.title ? void 0 : g(i),
93
+ "aria-describedby": s.description ? u(i) : void 0
109
94
  });
110
95
  },
111
96
  getTitleProps() {
112
- return e.element({
113
- ...a.title.attrs,
114
- dir: t.context.dir,
115
- id: o.getTitleId(t.context)
97
+ return t.element({
98
+ ...l.title.attrs,
99
+ dir: r("dir"),
100
+ id: g(i)
116
101
  });
117
102
  },
118
103
  getDescriptionProps() {
119
- return e.element({
120
- ...a.description.attrs,
121
- dir: t.context.dir,
122
- id: o.getDescriptionId(t.context)
104
+ return t.element({
105
+ ...l.description.attrs,
106
+ dir: r("dir"),
107
+ id: u(i)
123
108
  });
124
109
  },
125
110
  getCloseTriggerProps() {
126
- return e.button({
127
- ...a.closeTrigger.attrs,
128
- dir: t.context.dir,
129
- id: o.getCloseTriggerId(t.context),
111
+ return t.button({
112
+ ...l.closeTrigger.attrs,
113
+ dir: r("dir"),
114
+ id: C(i),
130
115
  type: "button",
131
- onClick(i) {
132
- i.defaultPrevented || (i.stopPropagation(), n("CLOSE"));
116
+ onClick(s) {
117
+ s.defaultPrevented || (s.stopPropagation(), a({ type: "CLOSE" }));
133
118
  }
134
119
  });
135
120
  }
136
121
  };
137
122
  }
138
- function N(t) {
139
- const n = f(t);
140
- return m(
141
- {
142
- id: "dialog",
143
- initial: n.open ? "open" : "closed",
144
- context: {
145
- role: "dialog",
146
- renderedElements: {
147
- title: !0,
148
- description: !0
123
+ var J = I({
124
+ props({ props: e, scope: t }) {
125
+ const n = e.role === "alertdialog";
126
+ return {
127
+ role: "dialog",
128
+ modal: !0,
129
+ trapFocus: !0,
130
+ preventScroll: !0,
131
+ closeOnInteractOutside: !n,
132
+ closeOnEscape: !0,
133
+ restoreFocus: !0,
134
+ initialFocusEl: n ? () => R(t) : void 0,
135
+ ...e
136
+ };
137
+ },
138
+ initialState({ prop: e }) {
139
+ return e("open") || e("defaultOpen") ? "open" : "closed";
140
+ },
141
+ context({ bindable: e }) {
142
+ return {
143
+ rendered: e(() => ({
144
+ defaultValue: { title: !0, description: !0 }
145
+ }))
146
+ };
147
+ },
148
+ watch({ track: e, action: t, prop: n }) {
149
+ e([() => n("open")], () => {
150
+ t(["toggleVisibility"]);
151
+ });
152
+ },
153
+ states: {
154
+ open: {
155
+ entry: ["checkRenderedElements", "syncZIndex"],
156
+ effects: ["trackDismissableElement", "trapFocus", "preventScroll", "hideContentBelow"],
157
+ on: {
158
+ "CONTROLLED.CLOSE": {
159
+ target: "closed"
149
160
  },
150
- modal: !0,
151
- trapFocus: !0,
152
- preventScroll: !0,
153
- closeOnInteractOutside: !0,
154
- closeOnEscape: !0,
155
- restoreFocus: !0,
156
- ...n
157
- },
158
- created: ["setAlertDialogProps"],
159
- watch: {
160
- open: ["toggleVisibility"]
161
- },
162
- states: {
163
- open: {
164
- entry: ["checkRenderedElements", "syncZIndex"],
165
- activities: ["trackDismissableElement", "trapFocus", "preventScroll", "hideContentBelow"],
166
- on: {
167
- "CONTROLLED.CLOSE": {
168
- target: "closed"
169
- },
170
- CLOSE: [
171
- {
172
- guard: "isOpenControlled",
173
- actions: ["invokeOnClose"]
174
- },
175
- {
176
- target: "closed",
177
- actions: ["invokeOnClose"]
178
- }
179
- ],
180
- TOGGLE: [
181
- {
182
- guard: "isOpenControlled",
183
- actions: ["invokeOnClose"]
184
- },
185
- {
186
- target: "closed",
187
- actions: ["invokeOnClose"]
188
- }
189
- ]
161
+ CLOSE: [
162
+ {
163
+ guard: "isOpenControlled",
164
+ actions: ["invokeOnClose"]
165
+ },
166
+ {
167
+ target: "closed",
168
+ actions: ["invokeOnClose"]
190
169
  }
170
+ ],
171
+ TOGGLE: [
172
+ {
173
+ guard: "isOpenControlled",
174
+ actions: ["invokeOnClose"]
175
+ },
176
+ {
177
+ target: "closed",
178
+ actions: ["invokeOnClose"]
179
+ }
180
+ ]
181
+ }
182
+ },
183
+ closed: {
184
+ on: {
185
+ "CONTROLLED.OPEN": {
186
+ target: "open"
191
187
  },
192
- closed: {
193
- on: {
194
- "CONTROLLED.OPEN": {
195
- target: "open"
196
- },
197
- OPEN: [
198
- {
199
- guard: "isOpenControlled",
200
- actions: ["invokeOnOpen"]
201
- },
202
- {
203
- target: "open",
204
- actions: ["invokeOnOpen"]
205
- }
206
- ],
207
- TOGGLE: [
208
- {
209
- guard: "isOpenControlled",
210
- actions: ["invokeOnOpen"]
211
- },
212
- {
213
- target: "open",
214
- actions: ["invokeOnOpen"]
215
- }
216
- ]
188
+ OPEN: [
189
+ {
190
+ guard: "isOpenControlled",
191
+ actions: ["invokeOnOpen"]
192
+ },
193
+ {
194
+ target: "open",
195
+ actions: ["invokeOnOpen"]
217
196
  }
218
- }
197
+ ],
198
+ TOGGLE: [
199
+ {
200
+ guard: "isOpenControlled",
201
+ actions: ["invokeOnOpen"]
202
+ },
203
+ {
204
+ target: "open",
205
+ actions: ["invokeOnOpen"]
206
+ }
207
+ ]
219
208
  }
209
+ }
210
+ },
211
+ implementations: {
212
+ guards: {
213
+ isOpenControlled: ({ prop: e }) => e("open") != null
220
214
  },
221
- {
222
- guards: {
223
- isOpenControlled: (e) => !!e["open.controlled"]
215
+ effects: {
216
+ trackDismissableElement({ scope: e, send: t, prop: n }) {
217
+ return b(() => c(e), {
218
+ defer: !0,
219
+ pointerBlocking: n("modal"),
220
+ exclude: [B(e)],
221
+ onInteractOutside(o) {
222
+ var r;
223
+ (r = n("onInteractOutside")) == null || r(o), n("closeOnInteractOutside") || o.preventDefault();
224
+ },
225
+ persistentElements: n("persistentElements"),
226
+ onFocusOutside: n("onFocusOutside"),
227
+ onPointerDownOutside: n("onPointerDownOutside"),
228
+ onEscapeKeyDown(o) {
229
+ var r;
230
+ (r = n("onEscapeKeyDown")) == null || r(o), n("closeOnEscape") || o.preventDefault();
231
+ },
232
+ onDismiss() {
233
+ t({ type: "CLOSE", src: "interact-outside" });
234
+ }
235
+ });
224
236
  },
225
- activities: {
226
- trackDismissableElement(e, r, { send: s }) {
227
- return C(() => o.getContentEl(e), {
228
- defer: !0,
229
- pointerBlocking: e.modal,
230
- exclude: [o.getTriggerEl(e)],
231
- onInteractOutside(i) {
232
- var l;
233
- (l = e.onInteractOutside) == null || l.call(e, i), e.closeOnInteractOutside || i.preventDefault();
234
- },
235
- persistentElements: e.persistentElements,
236
- onFocusOutside: e.onFocusOutside,
237
- onPointerDownOutside: e.onPointerDownOutside,
238
- onEscapeKeyDown(i) {
239
- var l;
240
- (l = e.onEscapeKeyDown) == null || l.call(e, i), e.closeOnEscape || i.preventDefault();
241
- },
242
- onDismiss() {
243
- s({ type: "CLOSE", src: "interact-outside" });
244
- }
245
- });
246
- },
247
- preventScroll(e) {
248
- if (e.preventScroll)
249
- return I(o.getDoc(e));
250
- },
251
- trapFocus(e) {
252
- if (!e.trapFocus || !e.modal) return;
253
- let r;
254
- const s = E(() => {
255
- var i;
256
- const d = o.getContentEl(e);
257
- if (d) {
258
- r = v(d, {
259
- document: o.getDoc(e),
260
- escapeDeactivates: !1,
261
- preventScroll: !0,
262
- fallbackFocus: d,
263
- returnFocusOnDeactivate: e.restoreFocus,
264
- allowOutsideClick: !0,
265
- initialFocus: ((i = e.initialFocusEl) == null ? void 0 : i.call(e)) ?? void 0,
266
- setReturnFocus(l) {
267
- var g;
268
- return ((g = e.finalFocusEl) == null ? void 0 : g.call(e)) ?? l;
269
- }
270
- });
271
- try {
272
- r.activate();
273
- } catch {
274
- }
275
- }
276
- });
277
- return () => {
278
- r == null || r.deactivate(), s();
279
- };
280
- },
281
- hideContentBelow(e) {
282
- return e.modal ? O(() => [o.getContentEl(e)], { defer: !0 }) : void 0;
283
- }
237
+ preventScroll({ scope: e, prop: t }) {
238
+ if (t("preventScroll"))
239
+ return F(e.getDoc());
284
240
  },
285
- actions: {
286
- setAlertDialogProps(e) {
287
- e.role === "alertdialog" && (e.initialFocusEl || (e.initialFocusEl = () => o.getCloseTriggerEl(e)), e.closeOnInteractOutside = !1);
288
- },
289
- checkRenderedElements(e) {
290
- p(() => {
291
- e.renderedElements.title = !!o.getTitleEl(e), e.renderedElements.description = !!o.getDescriptionEl(e);
241
+ trapFocus({ scope: e, prop: t }) {
242
+ return !t("trapFocus") || !t("modal") ? void 0 : P(() => c(e), {
243
+ preventScroll: !0,
244
+ returnFocusOnDeactivate: !!t("restoreFocus"),
245
+ initialFocus: t("initialFocusEl"),
246
+ setReturnFocus: (a) => {
247
+ var o;
248
+ return ((o = t("finalFocusEl")) == null ? void 0 : o()) ?? a;
249
+ }
250
+ });
251
+ },
252
+ hideContentBelow({ scope: e, prop: t }) {
253
+ return t("modal") ? k(() => [c(e)], { defer: !0 }) : void 0;
254
+ }
255
+ },
256
+ actions: {
257
+ checkRenderedElements({ context: e, scope: t }) {
258
+ E(() => {
259
+ e.set("rendered", {
260
+ title: !!N(t),
261
+ description: !!w(t)
292
262
  });
293
- },
294
- syncZIndex(e) {
295
- p(() => {
296
- const r = o.getContentEl(e);
297
- if (!r) return;
298
- const d = o.getWin(e).getComputedStyle(r);
299
- [o.getPositionerEl(e), o.getBackdropEl(e)].forEach((l) => {
300
- l == null || l.style.setProperty("--z-index", d.zIndex);
301
- });
263
+ });
264
+ },
265
+ syncZIndex({ scope: e }) {
266
+ E(() => {
267
+ const t = c(e);
268
+ if (!t) return;
269
+ const n = D(t);
270
+ [h(e), S(e)].forEach((o) => {
271
+ o == null || o.style.setProperty("--z-index", n.zIndex);
302
272
  });
303
- },
304
- invokeOnClose(e) {
305
- var r;
306
- (r = e.onOpenChange) == null || r.call(e, { open: !1 });
307
- },
308
- invokeOnOpen(e) {
309
- var r;
310
- (r = e.onOpenChange) == null || r.call(e, { open: !0 });
311
- },
312
- toggleVisibility(e, r, { send: s }) {
313
- s({ type: e.open ? "CONTROLLED.OPEN" : "CONTROLLED.CLOSE", previousEvent: r });
314
- }
273
+ });
274
+ },
275
+ invokeOnClose({ prop: e }) {
276
+ var t;
277
+ (t = e("onOpenChange")) == null || t({ open: !1 });
278
+ },
279
+ invokeOnOpen({ prop: e }) {
280
+ var t;
281
+ (t = e("onOpenChange")) == null || t({ open: !0 });
282
+ },
283
+ toggleVisibility({ prop: e, send: t, event: n }) {
284
+ t({
285
+ type: e("open") ? "CONTROLLED.OPEN" : "CONTROLLED.CLOSE",
286
+ previousEvent: n
287
+ });
315
288
  }
316
289
  }
317
- );
318
- }
319
- k()([
290
+ }
291
+ });
292
+ T()([
320
293
  "aria-label",
321
294
  "closeOnEscape",
322
295
  "closeOnInteractOutside",
@@ -334,7 +307,7 @@ k()([
334
307
  "onInteractOutside",
335
308
  "onOpenChange",
336
309
  "onPointerDownOutside",
337
- "open.controlled",
310
+ "defaultOpen",
338
311
  "open",
339
312
  "persistentElements",
340
313
  "preventScroll",
@@ -343,7 +316,7 @@ k()([
343
316
  "trapFocus"
344
317
  ]);
345
318
  export {
346
- T as anatomy,
347
- w as connect,
348
- N as machine
319
+ L as anatomy,
320
+ q as connect,
321
+ J as machine
349
322
  };