@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,290 +1,274 @@
|
|
|
1
|
-
import { createAnatomy as
|
|
2
|
-
import { getEventKey as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return S(i.getRootEl(e), t);
|
|
28
|
-
},
|
|
29
|
-
getFirstTriggerEl: (e) => w(i.getTriggerEls(e)),
|
|
30
|
-
getLastTriggerEl: (e) => F(i.getTriggerEls(e)),
|
|
31
|
-
getNextTriggerEl: (e, o) => h(i.getTriggerEls(e), i.getItemTriggerId(e, o)),
|
|
32
|
-
getPrevTriggerEl: (e, o) => C(i.getTriggerEls(e), i.getItemTriggerId(e, o))
|
|
33
|
-
});
|
|
34
|
-
function J(e, o, t) {
|
|
35
|
-
const a = e.context.focusedValue, d = e.context.value, I = e.context.multiple;
|
|
36
|
-
function E(n) {
|
|
37
|
-
let r = n;
|
|
38
|
-
I && r.length > 1 && (r = [r[0]]), o({ type: "VALUE.SET", value: r });
|
|
1
|
+
import { createAnatomy as C } from "../../anatomy/dist/index.js";
|
|
2
|
+
import { getEventKey as h, isSafari as S, dataAttr as u, prevById as F, nextById as P, queryAll as w } from "../../dom-query/dist/index.js";
|
|
3
|
+
import { warn as x, last as L, first as A, add as $, remove as B } from "../../utils/dist/index.js";
|
|
4
|
+
import { createMachine as N, createGuards as U } from "../../core/dist/index.js";
|
|
5
|
+
import { createProps as y } from "../../types/dist/index.js";
|
|
6
|
+
var H = C("accordion").parts("root", "item", "itemTrigger", "itemContent", "itemIndicator"), g = H.build(), v = (e) => {
|
|
7
|
+
var t;
|
|
8
|
+
return ((t = e.ids) == null ? void 0 : t.root) ?? `accordion:${e.id}`;
|
|
9
|
+
}, K = (e, t) => {
|
|
10
|
+
var a, o;
|
|
11
|
+
return ((o = (a = e.ids) == null ? void 0 : a.item) == null ? void 0 : o.call(a, t)) ?? `accordion:${e.id}:item:${t}`;
|
|
12
|
+
}, b = (e, t) => {
|
|
13
|
+
var a, o;
|
|
14
|
+
return ((o = (a = e.ids) == null ? void 0 : a.itemContent) == null ? void 0 : o.call(a, t)) ?? `accordion:${e.id}:content:${t}`;
|
|
15
|
+
}, m = (e, t) => {
|
|
16
|
+
var a, o;
|
|
17
|
+
return ((o = (a = e.ids) == null ? void 0 : a.itemTrigger) == null ? void 0 : o.call(a, t)) ?? `accordion:${e.id}:trigger:${t}`;
|
|
18
|
+
}, k = (e) => e.getById(v(e)), p = (e) => {
|
|
19
|
+
const a = `[aria-controls][data-ownedby='${CSS.escape(v(e))}']:not([disabled])`;
|
|
20
|
+
return w(k(e), a);
|
|
21
|
+
}, D = (e) => A(p(e)), X = (e) => L(p(e)), z = (e, t) => P(p(e), m(e, t)), M = (e, t) => F(p(e), m(e, t));
|
|
22
|
+
function _(e, t) {
|
|
23
|
+
const { send: a, context: o, prop: n, scope: l, computed: f } = e, T = o.get("focusedValue"), I = o.get("value"), E = n("multiple");
|
|
24
|
+
function R(i) {
|
|
25
|
+
let r = i;
|
|
26
|
+
!E && r.length > 1 && (r = [r[0]]), a({ type: "VALUE.SET", value: r });
|
|
39
27
|
}
|
|
40
|
-
function c(
|
|
28
|
+
function c(i) {
|
|
41
29
|
return {
|
|
42
|
-
expanded:
|
|
43
|
-
focused:
|
|
44
|
-
disabled: !!(
|
|
30
|
+
expanded: I.includes(i.value),
|
|
31
|
+
focused: T === i.value,
|
|
32
|
+
disabled: !!(i.disabled ?? n("disabled"))
|
|
45
33
|
};
|
|
46
34
|
}
|
|
47
35
|
return {
|
|
48
|
-
focusedValue:
|
|
49
|
-
value:
|
|
50
|
-
setValue:
|
|
36
|
+
focusedValue: T,
|
|
37
|
+
value: I,
|
|
38
|
+
setValue: R,
|
|
51
39
|
getItemState: c,
|
|
52
40
|
getRootProps() {
|
|
53
41
|
return t.element({
|
|
54
42
|
...g.root.attrs,
|
|
55
|
-
dir:
|
|
56
|
-
id:
|
|
57
|
-
"data-orientation":
|
|
43
|
+
dir: n("dir"),
|
|
44
|
+
id: v(l),
|
|
45
|
+
"data-orientation": n("orientation")
|
|
58
46
|
});
|
|
59
47
|
},
|
|
60
|
-
getItemProps(
|
|
61
|
-
const r = c(
|
|
48
|
+
getItemProps(i) {
|
|
49
|
+
const r = c(i);
|
|
62
50
|
return t.element({
|
|
63
51
|
...g.item.attrs,
|
|
64
|
-
dir:
|
|
65
|
-
id:
|
|
52
|
+
dir: n("dir"),
|
|
53
|
+
id: K(l, i.value),
|
|
66
54
|
"data-state": r.expanded ? "open" : "closed",
|
|
67
|
-
"data-focus":
|
|
68
|
-
"data-disabled":
|
|
69
|
-
"data-orientation":
|
|
55
|
+
"data-focus": u(r.focused),
|
|
56
|
+
"data-disabled": u(r.disabled),
|
|
57
|
+
"data-orientation": n("orientation")
|
|
70
58
|
});
|
|
71
59
|
},
|
|
72
|
-
getItemContentProps(
|
|
73
|
-
const r = c(
|
|
60
|
+
getItemContentProps(i) {
|
|
61
|
+
const r = c(i);
|
|
74
62
|
return t.element({
|
|
75
63
|
...g.itemContent.attrs,
|
|
76
|
-
dir:
|
|
64
|
+
dir: n("dir"),
|
|
77
65
|
role: "region",
|
|
78
|
-
id:
|
|
79
|
-
"aria-labelledby":
|
|
66
|
+
id: b(l, i.value),
|
|
67
|
+
"aria-labelledby": m(l, i.value),
|
|
80
68
|
hidden: !r.expanded,
|
|
81
69
|
"data-state": r.expanded ? "open" : "closed",
|
|
82
|
-
"data-disabled":
|
|
83
|
-
"data-focus":
|
|
84
|
-
"data-orientation":
|
|
70
|
+
"data-disabled": u(r.disabled),
|
|
71
|
+
"data-focus": u(r.focused),
|
|
72
|
+
"data-orientation": n("orientation")
|
|
85
73
|
});
|
|
86
74
|
},
|
|
87
|
-
getItemIndicatorProps(
|
|
88
|
-
const r = c(
|
|
75
|
+
getItemIndicatorProps(i) {
|
|
76
|
+
const r = c(i);
|
|
89
77
|
return t.element({
|
|
90
78
|
...g.itemIndicator.attrs,
|
|
91
|
-
dir:
|
|
79
|
+
dir: n("dir"),
|
|
92
80
|
"aria-hidden": !0,
|
|
93
81
|
"data-state": r.expanded ? "open" : "closed",
|
|
94
|
-
"data-disabled":
|
|
95
|
-
"data-focus":
|
|
96
|
-
"data-orientation":
|
|
82
|
+
"data-disabled": u(r.disabled),
|
|
83
|
+
"data-focus": u(r.focused),
|
|
84
|
+
"data-orientation": n("orientation")
|
|
97
85
|
});
|
|
98
86
|
},
|
|
99
|
-
getItemTriggerProps(
|
|
100
|
-
const { value: r } =
|
|
87
|
+
getItemTriggerProps(i) {
|
|
88
|
+
const { value: r } = i, d = c(i);
|
|
101
89
|
return t.button({
|
|
102
90
|
...g.itemTrigger.attrs,
|
|
103
91
|
type: "button",
|
|
104
|
-
dir:
|
|
105
|
-
id:
|
|
106
|
-
"aria-controls":
|
|
107
|
-
"aria-expanded":
|
|
108
|
-
disabled:
|
|
109
|
-
"data-orientation":
|
|
110
|
-
"aria-disabled":
|
|
111
|
-
"data-state":
|
|
112
|
-
"data-ownedby":
|
|
92
|
+
dir: n("dir"),
|
|
93
|
+
id: m(l, r),
|
|
94
|
+
"aria-controls": b(l, r),
|
|
95
|
+
"aria-expanded": d.expanded,
|
|
96
|
+
disabled: d.disabled,
|
|
97
|
+
"data-orientation": n("orientation"),
|
|
98
|
+
"aria-disabled": d.disabled,
|
|
99
|
+
"data-state": d.expanded ? "open" : "closed",
|
|
100
|
+
"data-ownedby": v(l),
|
|
113
101
|
onFocus() {
|
|
114
|
-
|
|
102
|
+
d.disabled || a({ type: "TRIGGER.FOCUS", value: r });
|
|
115
103
|
},
|
|
116
104
|
onBlur() {
|
|
117
|
-
|
|
105
|
+
d.disabled || a({ type: "TRIGGER.BLUR" });
|
|
118
106
|
},
|
|
119
|
-
onClick(
|
|
120
|
-
|
|
107
|
+
onClick(s) {
|
|
108
|
+
d.disabled || (S() && s.currentTarget.focus(), a({ type: "TRIGGER.CLICK", value: r }));
|
|
121
109
|
},
|
|
122
|
-
onKeyDown(
|
|
123
|
-
if (
|
|
124
|
-
const
|
|
110
|
+
onKeyDown(s) {
|
|
111
|
+
if (s.defaultPrevented || d.disabled) return;
|
|
112
|
+
const G = {
|
|
125
113
|
ArrowDown() {
|
|
126
|
-
|
|
114
|
+
f("isHorizontal") || a({ type: "GOTO.NEXT", value: r });
|
|
127
115
|
},
|
|
128
116
|
ArrowUp() {
|
|
129
|
-
|
|
117
|
+
f("isHorizontal") || a({ type: "GOTO.PREV", value: r });
|
|
130
118
|
},
|
|
131
119
|
ArrowRight() {
|
|
132
|
-
|
|
120
|
+
f("isHorizontal") && a({ type: "GOTO.NEXT", value: r });
|
|
133
121
|
},
|
|
134
122
|
ArrowLeft() {
|
|
135
|
-
|
|
123
|
+
f("isHorizontal") && a({ type: "GOTO.PREV", value: r });
|
|
136
124
|
},
|
|
137
125
|
Home() {
|
|
138
|
-
|
|
126
|
+
a({ type: "GOTO.FIRST", value: r });
|
|
139
127
|
},
|
|
140
128
|
End() {
|
|
141
|
-
|
|
129
|
+
a({ type: "GOTO.LAST", value: r });
|
|
142
130
|
}
|
|
143
|
-
},
|
|
144
|
-
dir:
|
|
145
|
-
orientation:
|
|
146
|
-
}),
|
|
147
|
-
|
|
131
|
+
}, O = h(s, {
|
|
132
|
+
dir: n("dir"),
|
|
133
|
+
orientation: n("orientation")
|
|
134
|
+
}), V = G[O];
|
|
135
|
+
V && (V(s), s.preventDefault());
|
|
148
136
|
}
|
|
149
137
|
});
|
|
150
138
|
}
|
|
151
139
|
};
|
|
152
140
|
}
|
|
153
|
-
var { and:
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
isHorizontal: (t) => t.orientation === "horizontal"
|
|
175
|
-
},
|
|
176
|
-
on: {
|
|
177
|
-
"VALUE.SET": {
|
|
178
|
-
actions: ["setValue"]
|
|
141
|
+
var { and: q, not: j } = U(), ee = N({
|
|
142
|
+
props({ props: e }) {
|
|
143
|
+
return {
|
|
144
|
+
collapsible: !1,
|
|
145
|
+
multiple: !1,
|
|
146
|
+
orientation: "vertical",
|
|
147
|
+
defaultValue: [],
|
|
148
|
+
...e
|
|
149
|
+
};
|
|
150
|
+
},
|
|
151
|
+
initialState() {
|
|
152
|
+
return "idle";
|
|
153
|
+
},
|
|
154
|
+
context({ prop: e, bindable: t }) {
|
|
155
|
+
return {
|
|
156
|
+
focusedValue: t(() => ({
|
|
157
|
+
defaultValue: null,
|
|
158
|
+
sync: !0,
|
|
159
|
+
onChange(a) {
|
|
160
|
+
var o;
|
|
161
|
+
(o = e("onFocusChange")) == null || o({ value: a });
|
|
179
162
|
}
|
|
180
|
-
},
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
actions: ["expand"]
|
|
206
|
-
}
|
|
207
|
-
],
|
|
208
|
-
"GOTO.FIRST": {
|
|
209
|
-
actions: "focusFirstTrigger"
|
|
210
|
-
},
|
|
211
|
-
"GOTO.LAST": {
|
|
212
|
-
actions: "focusLastTrigger"
|
|
213
|
-
},
|
|
214
|
-
"TRIGGER.BLUR": {
|
|
215
|
-
target: "idle",
|
|
216
|
-
actions: "clearFocusedValue"
|
|
217
|
-
}
|
|
218
|
-
}
|
|
163
|
+
})),
|
|
164
|
+
value: t(() => ({
|
|
165
|
+
defaultValue: e("defaultValue"),
|
|
166
|
+
value: e("value"),
|
|
167
|
+
onChange(a) {
|
|
168
|
+
var o;
|
|
169
|
+
(o = e("onValueChange")) == null || o({ value: a });
|
|
170
|
+
}
|
|
171
|
+
}))
|
|
172
|
+
};
|
|
173
|
+
},
|
|
174
|
+
computed: {
|
|
175
|
+
isHorizontal: ({ prop: e }) => e("orientation") === "horizontal"
|
|
176
|
+
},
|
|
177
|
+
on: {
|
|
178
|
+
"VALUE.SET": {
|
|
179
|
+
actions: ["setValue"]
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
states: {
|
|
183
|
+
idle: {
|
|
184
|
+
on: {
|
|
185
|
+
"TRIGGER.FOCUS": {
|
|
186
|
+
target: "focused",
|
|
187
|
+
actions: ["setFocusedValue"]
|
|
219
188
|
}
|
|
220
189
|
}
|
|
221
190
|
},
|
|
222
|
-
{
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
},
|
|
227
|
-
actions: {
|
|
228
|
-
collapse(t, a) {
|
|
229
|
-
const d = t.multiple ? N(t.value, a.value) : [];
|
|
230
|
-
f.value(t, t.multiple ? d : []);
|
|
231
|
-
},
|
|
232
|
-
expand(t, a) {
|
|
233
|
-
const d = t.multiple ? A(t.value, a.value) : [a.value];
|
|
234
|
-
f.value(t, d);
|
|
235
|
-
},
|
|
236
|
-
focusFirstTrigger(t) {
|
|
237
|
-
var a;
|
|
238
|
-
(a = i.getFirstTriggerEl(t)) == null || a.focus();
|
|
239
|
-
},
|
|
240
|
-
focusLastTrigger(t) {
|
|
241
|
-
var a;
|
|
242
|
-
(a = i.getLastTriggerEl(t)) == null || a.focus();
|
|
243
|
-
},
|
|
244
|
-
focusNextTrigger(t) {
|
|
245
|
-
if (!t.focusedValue) return;
|
|
246
|
-
const a = i.getNextTriggerEl(t, t.focusedValue);
|
|
247
|
-
a == null || a.focus();
|
|
248
|
-
},
|
|
249
|
-
focusPrevTrigger(t) {
|
|
250
|
-
if (!t.focusedValue) return;
|
|
251
|
-
const a = i.getPrevTriggerEl(t, t.focusedValue);
|
|
252
|
-
a == null || a.focus();
|
|
191
|
+
focused: {
|
|
192
|
+
on: {
|
|
193
|
+
"GOTO.NEXT": {
|
|
194
|
+
actions: ["focusNextTrigger"]
|
|
253
195
|
},
|
|
254
|
-
|
|
255
|
-
|
|
196
|
+
"GOTO.PREV": {
|
|
197
|
+
actions: ["focusPrevTrigger"]
|
|
256
198
|
},
|
|
257
|
-
|
|
258
|
-
|
|
199
|
+
"TRIGGER.CLICK": [
|
|
200
|
+
{
|
|
201
|
+
guard: q("isExpanded", "canToggle"),
|
|
202
|
+
actions: ["collapse"]
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
guard: j("isExpanded"),
|
|
206
|
+
actions: ["expand"]
|
|
207
|
+
}
|
|
208
|
+
],
|
|
209
|
+
"GOTO.FIRST": {
|
|
210
|
+
actions: ["focusFirstTrigger"]
|
|
259
211
|
},
|
|
260
|
-
|
|
261
|
-
|
|
212
|
+
"GOTO.LAST": {
|
|
213
|
+
actions: ["focusLastTrigger"]
|
|
262
214
|
},
|
|
263
|
-
|
|
264
|
-
|
|
215
|
+
"TRIGGER.BLUR": {
|
|
216
|
+
target: "idle",
|
|
217
|
+
actions: ["clearFocusedValue"]
|
|
265
218
|
}
|
|
266
219
|
}
|
|
267
220
|
}
|
|
268
|
-
);
|
|
269
|
-
}
|
|
270
|
-
var T = {
|
|
271
|
-
change(e) {
|
|
272
|
-
var o;
|
|
273
|
-
(o = e.onValueChange) == null || o.call(e, { value: Array.from(e.value) });
|
|
274
|
-
},
|
|
275
|
-
focusChange(e) {
|
|
276
|
-
var o;
|
|
277
|
-
(o = e.onFocusChange) == null || o.call(e, { value: e.focusedValue });
|
|
278
|
-
}
|
|
279
|
-
}, f = {
|
|
280
|
-
value(e, o) {
|
|
281
|
-
p(e.value, o) || (e.value = o, T.change(e));
|
|
282
221
|
},
|
|
283
|
-
|
|
284
|
-
|
|
222
|
+
implementations: {
|
|
223
|
+
guards: {
|
|
224
|
+
canToggle: ({ prop: e }) => !!e("collapsible") || !!e("multiple"),
|
|
225
|
+
isExpanded: ({ context: e, event: t }) => e.get("value").includes(t.value)
|
|
226
|
+
},
|
|
227
|
+
actions: {
|
|
228
|
+
collapse({ context: e, prop: t, event: a }) {
|
|
229
|
+
const o = t("multiple") ? B(e.get("value"), a.value) : [];
|
|
230
|
+
e.set("value", o);
|
|
231
|
+
},
|
|
232
|
+
expand({ context: e, prop: t, event: a }) {
|
|
233
|
+
const o = t("multiple") ? $(e.get("value"), a.value) : [a.value];
|
|
234
|
+
e.set("value", o);
|
|
235
|
+
},
|
|
236
|
+
focusFirstTrigger({ scope: e }) {
|
|
237
|
+
var t;
|
|
238
|
+
(t = D(e)) == null || t.focus();
|
|
239
|
+
},
|
|
240
|
+
focusLastTrigger({ scope: e }) {
|
|
241
|
+
var t;
|
|
242
|
+
(t = X(e)) == null || t.focus();
|
|
243
|
+
},
|
|
244
|
+
focusNextTrigger({ context: e, scope: t }) {
|
|
245
|
+
const a = e.get("focusedValue");
|
|
246
|
+
if (!a) return;
|
|
247
|
+
const o = z(t, a);
|
|
248
|
+
o == null || o.focus();
|
|
249
|
+
},
|
|
250
|
+
focusPrevTrigger({ context: e, scope: t }) {
|
|
251
|
+
const a = e.get("focusedValue");
|
|
252
|
+
if (!a) return;
|
|
253
|
+
const o = M(t, a);
|
|
254
|
+
o == null || o.focus();
|
|
255
|
+
},
|
|
256
|
+
setFocusedValue({ context: e, event: t }) {
|
|
257
|
+
e.set("focusedValue", t.value);
|
|
258
|
+
},
|
|
259
|
+
clearFocusedValue({ context: e }) {
|
|
260
|
+
e.set("focusedValue", null);
|
|
261
|
+
},
|
|
262
|
+
setValue({ context: e, event: t }) {
|
|
263
|
+
e.set("value", t.value);
|
|
264
|
+
},
|
|
265
|
+
coarseValue({ context: e, prop: t }) {
|
|
266
|
+
!t("multiple") && e.get("value").length > 1 && (x("The value of accordion should be a single value when multiple is false."), e.set("value", [e.get("value")[0]]));
|
|
267
|
+
}
|
|
268
|
+
}
|
|
285
269
|
}
|
|
286
|
-
};
|
|
287
|
-
|
|
270
|
+
});
|
|
271
|
+
y()([
|
|
288
272
|
"collapsible",
|
|
289
273
|
"dir",
|
|
290
274
|
"disabled",
|
|
@@ -295,13 +279,12 @@ v()([
|
|
|
295
279
|
"onFocusChange",
|
|
296
280
|
"onValueChange",
|
|
297
281
|
"orientation",
|
|
298
|
-
"value"
|
|
282
|
+
"value",
|
|
283
|
+
"defaultValue"
|
|
299
284
|
]);
|
|
300
|
-
|
|
285
|
+
y()(["value", "disabled"]);
|
|
301
286
|
export {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
Q as machine,
|
|
306
|
-
W as splitItemProps
|
|
287
|
+
H as anatomy,
|
|
288
|
+
_ as connect,
|
|
289
|
+
ee as machine
|
|
307
290
|
};
|
|
@@ -1,19 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
return ()
|
|
1
|
+
var i = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap(), p = {}, m = 0, b = (t) => t && (t.host || b(t.parentNode)), M = (t, n) => n.map((a) => {
|
|
2
|
+
if (t.contains(a)) return a;
|
|
3
|
+
const s = b(a);
|
|
4
|
+
return s && t.contains(s) ? s : (console.error("[zag-js > ariaHidden] target", a, "in not contained inside", t, ". Doing nothing"), null);
|
|
5
|
+
}).filter((a) => !!a), W = (t) => t.localName === "next-route-announcer" || t.localName === "script" || t.hasAttribute("aria-live") ? !0 : t.matches("[data-live-announcer]"), g = (t, n) => {
|
|
6
|
+
const { parentNode: a, markerName: s, controlAttribute: o } = n, c = M(a, Array.isArray(t) ? t : [t]);
|
|
7
|
+
p[s] || (p[s] = /* @__PURE__ */ new WeakMap());
|
|
8
|
+
const u = p[s], v = [], f = /* @__PURE__ */ new Set(), N = new Set(c), A = (e) => {
|
|
9
|
+
!e || f.has(e) || (f.add(e), A(e.parentNode));
|
|
10
|
+
};
|
|
11
|
+
c.forEach(A);
|
|
12
|
+
const d = (e) => {
|
|
13
|
+
!e || N.has(e) || Array.prototype.forEach.call(e.children, (r) => {
|
|
14
|
+
if (f.has(r))
|
|
15
|
+
d(r);
|
|
16
|
+
else
|
|
17
|
+
try {
|
|
18
|
+
if (W(r)) return;
|
|
19
|
+
const k = r.getAttribute(o) === "true", w = (i.get(r) || 0) + 1, y = (u.get(r) || 0) + 1;
|
|
20
|
+
i.set(r, w), u.set(r, y), v.push(r), w === 1 && k && h.set(r, !0), y === 1 && r.setAttribute(s, ""), k || r.setAttribute(o, "true");
|
|
21
|
+
} catch (l) {
|
|
22
|
+
console.error("[zag-js > ariaHidden] cannot operate on ", r, l);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
return d(a), f.clear(), m++, () => {
|
|
27
|
+
v.forEach((e) => {
|
|
28
|
+
const r = i.get(e) - 1, l = u.get(e) - 1;
|
|
29
|
+
i.set(e, r), u.set(e, l), r || (h.has(e) || e.removeAttribute(o), h.delete(e)), l || e.removeAttribute(s);
|
|
30
|
+
}), m--, m || (i = /* @__PURE__ */ new WeakMap(), i = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap(), p = {});
|
|
31
|
+
};
|
|
32
|
+
}, H = (t) => (Array.isArray(t) ? t[0] : t).ownerDocument.body, E = (t, n = H(t), a = "data-aria-hidden") => {
|
|
33
|
+
if (n)
|
|
34
|
+
return g(t, {
|
|
35
|
+
parentNode: n,
|
|
36
|
+
markerName: a,
|
|
37
|
+
controlAttribute: "aria-hidden"
|
|
38
|
+
});
|
|
39
|
+
}, V = (t) => {
|
|
40
|
+
const n = requestAnimationFrame(() => t());
|
|
41
|
+
return () => cancelAnimationFrame(n);
|
|
5
42
|
};
|
|
6
|
-
function
|
|
7
|
-
const { defer:
|
|
8
|
-
return
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
43
|
+
function S(t, n = {}) {
|
|
44
|
+
const { defer: a = !0 } = n, s = a ? V : (c) => c(), o = [];
|
|
45
|
+
return o.push(
|
|
46
|
+
s(() => {
|
|
47
|
+
const u = (typeof t == "function" ? t() : t).filter(Boolean);
|
|
48
|
+
u.length !== 0 && o.push(E(u));
|
|
12
49
|
})
|
|
13
50
|
), () => {
|
|
14
|
-
|
|
51
|
+
o.forEach((c) => c == null ? void 0 : c());
|
|
15
52
|
};
|
|
16
53
|
}
|
|
17
54
|
export {
|
|
18
|
-
|
|
55
|
+
S as ariaHidden
|
|
19
56
|
};
|