@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.
- package/dist/components/CheckBox/CheckBox.js +36 -35
- package/dist/components/ChoiceBox/ChoiceBox.js +41 -41
- package/dist/components/DataTable/DataTableComponent.d.ts +3 -20
- package/dist/components/DataTable/DataTableComponent.js +38 -36
- package/dist/components/DataTable/table/HeaderCheckbox.js +29 -19
- package/dist/components/Search/Search.d.ts +3 -1
- package/dist/components/Search/Search.js +34 -33
- package/dist/components/Select/Select.d.ts +2 -1
- package/dist/components/Select/Select.js +47 -41
- package/dist/components/Tooltip/Tooltip.d.ts +14 -0
- package/dist/components/Tooltip/Tooltip.js +70 -0
- package/dist/components/Tooltip/index.d.ts +1 -0
- package/dist/components/Tooltip/index.js +4 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +12 -10
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item-content.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item-indicator.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item-trigger.js +10 -12
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item.js +16 -16
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/use-accordion.js +13 -20
- package/dist/node_modules/@ark-ui/react/dist/components/avatar/avatar-root.js +1 -5
- package/dist/node_modules/@ark-ui/react/dist/components/avatar/use-avatar.js +14 -18
- package/dist/node_modules/@ark-ui/react/dist/components/checkbox/checkbox-hidden-input.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/checkbox/use-checkbox.js +22 -28
- package/dist/node_modules/@ark-ui/react/dist/components/collapsible/collapsible-content.js +7 -9
- package/dist/node_modules/@ark-ui/react/dist/components/collapsible/use-collapsible.js +14 -21
- package/dist/node_modules/@ark-ui/react/dist/components/collection/list-collection.js +5 -0
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-content.js +9 -8
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-item-group.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-positioner.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-root.js +17 -18
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-trigger.js +10 -9
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/use-combobox-item-context.js +5 -7
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/use-combobox.js +21 -45
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-backdrop.js +10 -9
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-close-trigger.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-content.js +6 -5
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-description.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/use-dialog.js +13 -22
- package/dist/node_modules/@ark-ui/react/dist/components/factory.js +26 -24
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-content.js +9 -8
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-item-group.js +1 -3
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-item.js +15 -13
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-root.js +13 -14
- package/dist/node_modules/@ark-ui/react/dist/components/menu/use-menu-option-item-props-context.js +10 -0
- package/dist/node_modules/@ark-ui/react/dist/components/menu/use-menu.js +14 -21
- package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-ellipsis.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-next-trigger.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-prev-trigger.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-root.js +5 -4
- package/dist/node_modules/@ark-ui/react/dist/components/pagination/use-pagination.js +13 -19
- package/dist/node_modules/@ark-ui/react/dist/components/portal/portal.js +25 -16
- package/dist/node_modules/@ark-ui/react/dist/components/presence/split-presence-props.js +3 -2
- package/dist/node_modules/@ark-ui/react/dist/components/presence/use-presence.js +18 -18
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item-control.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item-text.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item.js +1 -5
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/use-radio-group.js +14 -22
- package/dist/node_modules/@ark-ui/react/dist/components/select/select-content.js +9 -8
- package/dist/node_modules/@ark-ui/react/dist/components/select/select-root.js +11 -12
- package/dist/node_modules/@ark-ui/react/dist/components/select/use-select.js +20 -47
- package/dist/node_modules/@ark-ui/react/dist/components/switch/switch-hidden-input.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/switch/use-switch.js +20 -26
- package/dist/node_modules/@ark-ui/react/dist/components/tabs/tabs-root.js +9 -8
- package/dist/node_modules/@ark-ui/react/dist/components/tabs/use-tabs.js +14 -21
- package/dist/node_modules/@ark-ui/react/dist/components/toast/create-toaster.js +3 -7
- package/dist/node_modules/@ark-ui/react/dist/components/toast/toaster.js +28 -15
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-arrow-tip.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-arrow.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-content.js +15 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-positioner.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-root.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-trigger.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/use-tooltip-context.js +10 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/use-tooltip.js +17 -0
- package/dist/node_modules/@ark-ui/react/dist/utils/compose-refs.js +13 -7
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +92 -90
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +230 -216
- package/dist/node_modules/@zag-js/accordion/dist/index.js +210 -227
- package/dist/node_modules/@zag-js/aria-hidden/dist/index.js +49 -12
- package/dist/node_modules/@zag-js/avatar/dist/index.js +119 -134
- package/dist/node_modules/@zag-js/checkbox/dist/index.js +196 -197
- package/dist/node_modules/@zag-js/collapsible/dist/index.js +250 -198
- package/dist/node_modules/@zag-js/collection/dist/index.js +172 -179
- package/dist/node_modules/@zag-js/combobox/dist/index.js +1176 -1082
- package/dist/node_modules/@zag-js/core/dist/index.js +77 -496
- package/dist/node_modules/@zag-js/dialog/dist/index.js +243 -270
- package/dist/node_modules/@zag-js/dismissable/dist/index.js +62 -60
- package/dist/node_modules/@zag-js/dom-query/dist/index.js +465 -253
- package/dist/node_modules/@zag-js/focus-trap/dist/index.js +307 -0
- package/dist/node_modules/@zag-js/focus-visible/dist/index.js +48 -47
- package/dist/node_modules/@zag-js/interact-outside/dist/index.js +112 -80
- package/dist/node_modules/@zag-js/menu/dist/index.js +998 -884
- package/dist/node_modules/@zag-js/pagination/dist/index.js +207 -213
- package/dist/node_modules/@zag-js/popper/dist/index.js +130 -129
- package/dist/node_modules/@zag-js/presence/dist/index.js +139 -122
- package/dist/node_modules/@zag-js/radio-group/dist/index.js +297 -302
- package/dist/node_modules/@zag-js/react/dist/index.js +255 -103
- package/dist/node_modules/@zag-js/remove-scroll/dist/index.js +18 -31
- package/dist/node_modules/@zag-js/select/dist/index.js +889 -885
- package/dist/node_modules/@zag-js/store/dist/index.js +98 -137
- package/dist/node_modules/@zag-js/switch/dist/index.js +199 -191
- package/dist/node_modules/@zag-js/tabs/dist/index.js +383 -386
- package/dist/node_modules/@zag-js/toast/dist/index.js +646 -633
- package/dist/node_modules/@zag-js/tooltip/dist/index.js +459 -0
- package/dist/node_modules/@zag-js/types/dist/index.js +6 -6
- package/dist/node_modules/@zag-js/utils/dist/index.js +112 -99
- package/dist/node_modules/proxy-compare/dist/index.js +4 -106
- package/dist/styles.css +1 -1
- package/package.json +5 -5
- package/dist/node_modules/@ark-ui/react/dist/utils/use-is-server.js +0 -10
- package/dist/node_modules/@zag-js/dom-event/dist/index.js +0 -130
- package/dist/node_modules/@zag-js/element-rect/dist/index.js +0 -32
- package/dist/node_modules/@zag-js/form-utils/dist/index.js +0 -51
- package/dist/node_modules/aria-hidden/dist/es2015/index.js +0 -52
- package/dist/node_modules/focus-trap/dist/focus-trap.esm.js +0 -431
- package/dist/node_modules/klona/full/index.js +0 -21
- package/dist/node_modules/tabbable/dist/index.esm.js +0 -202
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { createAnatomy as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
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
|
-
),
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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:
|
|
59
|
-
setOpen(
|
|
60
|
-
|
|
42
|
+
open: d,
|
|
43
|
+
setOpen(s) {
|
|
44
|
+
n.matches("open") !== s && a({ type: s ? "OPEN" : "CLOSE" });
|
|
61
45
|
},
|
|
62
46
|
getTriggerProps() {
|
|
63
|
-
return
|
|
64
|
-
...
|
|
65
|
-
dir:
|
|
66
|
-
id:
|
|
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":
|
|
70
|
-
"data-state":
|
|
71
|
-
"aria-controls":
|
|
72
|
-
onClick(
|
|
73
|
-
|
|
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
|
|
79
|
-
...
|
|
80
|
-
dir:
|
|
81
|
-
hidden: !
|
|
82
|
-
id:
|
|
83
|
-
"data-state":
|
|
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
|
|
88
|
-
...
|
|
89
|
-
dir:
|
|
90
|
-
id:
|
|
71
|
+
return t.element({
|
|
72
|
+
...l.positioner.attrs,
|
|
73
|
+
dir: r("dir"),
|
|
74
|
+
id: m(i),
|
|
91
75
|
style: {
|
|
92
|
-
pointerEvents:
|
|
76
|
+
pointerEvents: d ? void 0 : "none"
|
|
93
77
|
}
|
|
94
78
|
});
|
|
95
79
|
},
|
|
96
80
|
getContentProps() {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
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":
|
|
89
|
+
"data-state": d ? "open" : "closed",
|
|
105
90
|
"aria-modal": !0,
|
|
106
|
-
"aria-label":
|
|
107
|
-
"aria-labelledby":
|
|
108
|
-
"aria-describedby":
|
|
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
|
|
113
|
-
...
|
|
114
|
-
dir:
|
|
115
|
-
id:
|
|
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
|
|
120
|
-
...
|
|
121
|
-
dir:
|
|
122
|
-
id:
|
|
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
|
|
127
|
-
...
|
|
128
|
-
dir:
|
|
129
|
-
id:
|
|
111
|
+
return t.button({
|
|
112
|
+
...l.closeTrigger.attrs,
|
|
113
|
+
dir: r("dir"),
|
|
114
|
+
id: C(i),
|
|
130
115
|
type: "button",
|
|
131
|
-
onClick(
|
|
132
|
-
|
|
116
|
+
onClick(s) {
|
|
117
|
+
s.defaultPrevented || (s.stopPropagation(), a({ type: "CLOSE" }));
|
|
133
118
|
}
|
|
134
119
|
});
|
|
135
120
|
}
|
|
136
121
|
};
|
|
137
122
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
{
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
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
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
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
|
-
|
|
193
|
-
|
|
194
|
-
"
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
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
|
-
|
|
223
|
-
|
|
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
|
-
|
|
226
|
-
|
|
227
|
-
return
|
|
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
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
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
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
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
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
|
|
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
|
-
|
|
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
|
-
"
|
|
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
|
-
|
|
347
|
-
|
|
348
|
-
|
|
319
|
+
L as anatomy,
|
|
320
|
+
q as connect,
|
|
321
|
+
J as machine
|
|
349
322
|
};
|