@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,138 +1,112 @@
|
|
|
1
|
-
import { createAnatomy as
|
|
2
|
-
import {
|
|
3
|
-
import { trackFocusVisible as
|
|
4
|
-
import { createMachine as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
import { createProps as I } from "../../types/dist/index.js";
|
|
9
|
-
var _ = p("radio-group").parts(
|
|
1
|
+
import { createAnatomy as S } from "../../anatomy/dist/index.js";
|
|
2
|
+
import { dispatchInputCheckedEvent as k, trackElementRect as R, trackFormControl as D, dataAttr as u, visuallyHiddenStyle as F, isSafari as A, isLeftClick as $, queryAll as P } from "../../dom-query/dist/index.js";
|
|
3
|
+
import { trackFocusVisible as _, isFocusVisible as w } from "../../focus-visible/dist/index.js";
|
|
4
|
+
import { createMachine as O, createGuards as H } from "../../core/dist/index.js";
|
|
5
|
+
import { isString as L } from "../../utils/dist/index.js";
|
|
6
|
+
import { createProps as b } from "../../types/dist/index.js";
|
|
7
|
+
var U = S("radio-group").parts(
|
|
10
8
|
"root",
|
|
11
9
|
"label",
|
|
12
10
|
"item",
|
|
13
11
|
"itemText",
|
|
14
12
|
"itemControl",
|
|
15
13
|
"indicator"
|
|
16
|
-
), v =
|
|
17
|
-
|
|
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
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
},
|
|
60
|
-
getActiveRadioEl: (e) => {
|
|
61
|
-
if (e.value)
|
|
62
|
-
return n.getById(e, n.getItemId(e, e.value));
|
|
63
|
-
},
|
|
64
|
-
getOffsetRect: (e) => ({
|
|
65
|
-
left: (e == null ? void 0 : e.offsetLeft) ?? 0,
|
|
66
|
-
top: (e == null ? void 0 : e.offsetTop) ?? 0,
|
|
67
|
-
width: (e == null ? void 0 : e.offsetWidth) ?? 0,
|
|
68
|
-
height: (e == null ? void 0 : e.offsetHeight) ?? 0
|
|
69
|
-
}),
|
|
70
|
-
getRectById: (e, i) => {
|
|
71
|
-
const t = n.getById(e, n.getItemId(e, i));
|
|
72
|
-
if (t)
|
|
73
|
-
return n.resolveRect(n.getOffsetRect(t));
|
|
74
|
-
},
|
|
75
|
-
resolveRect: (e) => ({
|
|
76
|
-
width: `${e.width}px`,
|
|
77
|
-
height: `${e.height}px`,
|
|
78
|
-
left: `${e.left}px`,
|
|
79
|
-
top: `${e.top}px`
|
|
80
|
-
})
|
|
14
|
+
), v = U.build(), g = (e) => {
|
|
15
|
+
var t;
|
|
16
|
+
return ((t = e.ids) == null ? void 0 : t.root) ?? `radio-group:${e.id}`;
|
|
17
|
+
}, I = (e) => {
|
|
18
|
+
var t;
|
|
19
|
+
return ((t = e.ids) == null ? void 0 : t.label) ?? `radio-group:${e.id}:label`;
|
|
20
|
+
}, T = (e, t) => {
|
|
21
|
+
var i, r;
|
|
22
|
+
return ((r = (i = e.ids) == null ? void 0 : i.item) == null ? void 0 : r.call(i, t)) ?? `radio-group:${e.id}:radio:${t}`;
|
|
23
|
+
}, p = (e, t) => {
|
|
24
|
+
var i, r;
|
|
25
|
+
return ((r = (i = e.ids) == null ? void 0 : i.itemHiddenInput) == null ? void 0 : r.call(i, t)) ?? `radio-group:${e.id}:radio:input:${t}`;
|
|
26
|
+
}, B = (e, t) => {
|
|
27
|
+
var i, r;
|
|
28
|
+
return ((r = (i = e.ids) == null ? void 0 : i.itemControl) == null ? void 0 : r.call(i, t)) ?? `radio-group:${e.id}:radio:control:${t}`;
|
|
29
|
+
}, q = (e, t) => {
|
|
30
|
+
var i, r;
|
|
31
|
+
return ((r = (i = e.ids) == null ? void 0 : i.itemLabel) == null ? void 0 : r.call(i, t)) ?? `radio-group:${e.id}:radio:label:${t}`;
|
|
32
|
+
}, C = (e) => {
|
|
33
|
+
var t;
|
|
34
|
+
return ((t = e.ids) == null ? void 0 : t.indicator) ?? `radio-group:${e.id}:indicator`;
|
|
35
|
+
}, m = (e) => e.getById(g(e)), K = (e, t) => e.getById(p(e, t)), M = (e) => e.getById(C(e)), N = (e) => {
|
|
36
|
+
var t;
|
|
37
|
+
return (t = m(e)) == null ? void 0 : t.querySelector("input:not(:disabled)");
|
|
38
|
+
}, G = (e) => {
|
|
39
|
+
var t;
|
|
40
|
+
return (t = m(e)) == null ? void 0 : t.querySelector("input:not(:disabled):checked");
|
|
41
|
+
}, V = (e) => {
|
|
42
|
+
const i = `input[type=radio][data-ownedby='${CSS.escape(g(e))}']:not([disabled])`;
|
|
43
|
+
return P(m(e), i);
|
|
44
|
+
}, W = (e, t) => {
|
|
45
|
+
if (t)
|
|
46
|
+
return e.getById(T(e, t));
|
|
47
|
+
}, j = (e) => ({
|
|
48
|
+
left: (e == null ? void 0 : e.offsetLeft) ?? 0,
|
|
49
|
+
top: (e == null ? void 0 : e.offsetTop) ?? 0,
|
|
50
|
+
width: (e == null ? void 0 : e.offsetWidth) ?? 0,
|
|
51
|
+
height: (e == null ? void 0 : e.offsetHeight) ?? 0
|
|
52
|
+
}), J = (e) => ({
|
|
53
|
+
width: `${e.width}px`,
|
|
54
|
+
height: `${e.height}px`,
|
|
55
|
+
left: `${e.left}px`,
|
|
56
|
+
top: `${e.top}px`
|
|
81
57
|
});
|
|
82
|
-
function
|
|
83
|
-
const
|
|
84
|
-
function
|
|
58
|
+
function te(e, t) {
|
|
59
|
+
const { context: i, send: r, computed: c, prop: o, scope: l } = e, s = c("isDisabled"), y = o("readOnly");
|
|
60
|
+
function f(a) {
|
|
61
|
+
const n = i.get("focusedValue") === a.value, d = n && w();
|
|
85
62
|
return {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
63
|
+
value: a.value,
|
|
64
|
+
invalid: !!a.invalid,
|
|
65
|
+
disabled: !!a.disabled || s,
|
|
66
|
+
checked: i.get("value") === a.value,
|
|
67
|
+
focused: n,
|
|
68
|
+
focusVisible: d,
|
|
69
|
+
hovered: i.get("hoveredValue") === a.value,
|
|
70
|
+
active: i.get("activeValue") === a.value
|
|
92
71
|
};
|
|
93
72
|
}
|
|
94
|
-
function
|
|
95
|
-
const
|
|
73
|
+
function h(a) {
|
|
74
|
+
const n = f(a);
|
|
96
75
|
return {
|
|
97
|
-
"data-focus":
|
|
98
|
-
"data-focus-visible":
|
|
99
|
-
"data-disabled":
|
|
100
|
-
"data-readonly":
|
|
101
|
-
"data-state":
|
|
102
|
-
"data-hover":
|
|
103
|
-
"data-invalid":
|
|
104
|
-
"data-orientation":
|
|
105
|
-
"data-ssr":
|
|
76
|
+
"data-focus": u(n.focused),
|
|
77
|
+
"data-focus-visible": u(n.focusVisible),
|
|
78
|
+
"data-disabled": u(n.disabled),
|
|
79
|
+
"data-readonly": u(y),
|
|
80
|
+
"data-state": n.checked ? "checked" : "unchecked",
|
|
81
|
+
"data-hover": u(n.hovered),
|
|
82
|
+
"data-invalid": u(n.invalid),
|
|
83
|
+
"data-orientation": o("orientation"),
|
|
84
|
+
"data-ssr": u(i.get("ssr"))
|
|
106
85
|
};
|
|
107
86
|
}
|
|
108
|
-
const
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
o.focus();
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
const r = n.getFirstEnabledInputEl(e.context);
|
|
115
|
-
r == null || r.focus();
|
|
87
|
+
const E = () => {
|
|
88
|
+
const a = G(l) ?? N(l);
|
|
89
|
+
a == null || a.focus();
|
|
116
90
|
};
|
|
117
91
|
return {
|
|
118
|
-
focus:
|
|
119
|
-
value:
|
|
120
|
-
setValue(
|
|
121
|
-
|
|
92
|
+
focus: E,
|
|
93
|
+
value: i.get("value"),
|
|
94
|
+
setValue(a) {
|
|
95
|
+
r({ type: "SET_VALUE", value: a, isTrusted: !1 });
|
|
122
96
|
},
|
|
123
97
|
clearValue() {
|
|
124
|
-
|
|
98
|
+
r({ type: "SET_VALUE", value: null, isTrusted: !1 });
|
|
125
99
|
},
|
|
126
100
|
getRootProps() {
|
|
127
101
|
return t.element({
|
|
128
102
|
...v.root.attrs,
|
|
129
103
|
role: "radiogroup",
|
|
130
|
-
id:
|
|
131
|
-
"aria-labelledby":
|
|
132
|
-
"data-orientation":
|
|
133
|
-
"data-disabled":
|
|
134
|
-
"aria-orientation":
|
|
135
|
-
dir:
|
|
104
|
+
id: g(l),
|
|
105
|
+
"aria-labelledby": I(l),
|
|
106
|
+
"data-orientation": o("orientation"),
|
|
107
|
+
"data-disabled": u(s),
|
|
108
|
+
"aria-orientation": o("orientation"),
|
|
109
|
+
dir: o("dir"),
|
|
136
110
|
style: {
|
|
137
111
|
position: "relative"
|
|
138
112
|
}
|
|
@@ -141,256 +115,276 @@ function M(e, i, t) {
|
|
|
141
115
|
getLabelProps() {
|
|
142
116
|
return t.element({
|
|
143
117
|
...v.label.attrs,
|
|
144
|
-
dir:
|
|
145
|
-
"data-orientation":
|
|
146
|
-
"data-disabled":
|
|
147
|
-
id:
|
|
148
|
-
onClick:
|
|
118
|
+
dir: o("dir"),
|
|
119
|
+
"data-orientation": o("orientation"),
|
|
120
|
+
"data-disabled": u(s),
|
|
121
|
+
id: I(l),
|
|
122
|
+
onClick: E
|
|
149
123
|
});
|
|
150
124
|
},
|
|
151
|
-
getItemState:
|
|
152
|
-
getItemProps(
|
|
153
|
-
const
|
|
125
|
+
getItemState: f,
|
|
126
|
+
getItemProps(a) {
|
|
127
|
+
const n = f(a);
|
|
154
128
|
return t.label({
|
|
155
129
|
...v.item.attrs,
|
|
156
|
-
dir:
|
|
157
|
-
id:
|
|
158
|
-
htmlFor:
|
|
159
|
-
...
|
|
130
|
+
dir: o("dir"),
|
|
131
|
+
id: T(l, a.value),
|
|
132
|
+
htmlFor: p(l, a.value),
|
|
133
|
+
...h(a),
|
|
160
134
|
onPointerMove() {
|
|
161
|
-
|
|
135
|
+
n.disabled || n.hovered || r({ type: "SET_HOVERED", value: a.value, hovered: !0 });
|
|
162
136
|
},
|
|
163
137
|
onPointerLeave() {
|
|
164
|
-
|
|
138
|
+
n.disabled || r({ type: "SET_HOVERED", value: null });
|
|
165
139
|
},
|
|
166
140
|
onPointerDown(d) {
|
|
167
|
-
|
|
141
|
+
n.disabled || $(d) && (n.focused && d.pointerType === "mouse" && d.preventDefault(), r({ type: "SET_ACTIVE", value: a.value, active: !0 }));
|
|
168
142
|
},
|
|
169
143
|
onPointerUp() {
|
|
170
|
-
|
|
144
|
+
n.disabled || r({ type: "SET_ACTIVE", value: null });
|
|
145
|
+
},
|
|
146
|
+
onClick() {
|
|
147
|
+
var d;
|
|
148
|
+
!n.disabled && A() && ((d = K(l, a.value)) == null || d.focus());
|
|
171
149
|
}
|
|
172
150
|
});
|
|
173
151
|
},
|
|
174
|
-
getItemTextProps(
|
|
152
|
+
getItemTextProps(a) {
|
|
175
153
|
return t.element({
|
|
176
154
|
...v.itemText.attrs,
|
|
177
|
-
dir:
|
|
178
|
-
id:
|
|
179
|
-
...
|
|
155
|
+
dir: o("dir"),
|
|
156
|
+
id: q(l, a.value),
|
|
157
|
+
...h(a)
|
|
180
158
|
});
|
|
181
159
|
},
|
|
182
|
-
getItemControlProps(
|
|
183
|
-
const
|
|
160
|
+
getItemControlProps(a) {
|
|
161
|
+
const n = f(a);
|
|
184
162
|
return t.element({
|
|
185
163
|
...v.itemControl.attrs,
|
|
186
|
-
dir:
|
|
187
|
-
id:
|
|
188
|
-
"data-active":
|
|
164
|
+
dir: o("dir"),
|
|
165
|
+
id: B(l, a.value),
|
|
166
|
+
"data-active": u(n.active),
|
|
189
167
|
"aria-hidden": !0,
|
|
190
|
-
...
|
|
168
|
+
...h(a)
|
|
191
169
|
});
|
|
192
170
|
},
|
|
193
|
-
getItemHiddenInputProps(
|
|
194
|
-
const
|
|
171
|
+
getItemHiddenInputProps(a) {
|
|
172
|
+
const n = f(a);
|
|
195
173
|
return t.input({
|
|
196
|
-
"data-ownedby":
|
|
197
|
-
id:
|
|
174
|
+
"data-ownedby": g(l),
|
|
175
|
+
id: p(l, a.value),
|
|
198
176
|
type: "radio",
|
|
199
|
-
name:
|
|
200
|
-
form:
|
|
201
|
-
value:
|
|
177
|
+
name: o("name") || o("id"),
|
|
178
|
+
form: o("form"),
|
|
179
|
+
value: a.value,
|
|
202
180
|
onClick(d) {
|
|
203
|
-
if (
|
|
181
|
+
if (y) {
|
|
204
182
|
d.preventDefault();
|
|
205
183
|
return;
|
|
206
184
|
}
|
|
207
|
-
d.currentTarget.checked &&
|
|
185
|
+
d.currentTarget.checked && r({ type: "SET_VALUE", value: a.value, isTrusted: !0 });
|
|
208
186
|
},
|
|
209
187
|
onBlur() {
|
|
210
|
-
|
|
188
|
+
r({ type: "SET_FOCUSED", value: null, focused: !1 });
|
|
211
189
|
},
|
|
212
190
|
onFocus() {
|
|
213
|
-
|
|
214
|
-
i({ type: "SET_FOCUSED", value: o.value, focused: !0, focusVisible: d });
|
|
191
|
+
r({ type: "SET_FOCUSED", value: a.value, focused: !0 });
|
|
215
192
|
},
|
|
216
193
|
onKeyDown(d) {
|
|
217
|
-
d.defaultPrevented || d.key === " " &&
|
|
194
|
+
d.defaultPrevented || d.key === " " && r({ type: "SET_ACTIVE", value: a.value, active: !0 });
|
|
218
195
|
},
|
|
219
196
|
onKeyUp(d) {
|
|
220
|
-
d.defaultPrevented || d.key === " " &&
|
|
197
|
+
d.defaultPrevented || d.key === " " && r({ type: "SET_ACTIVE", value: null });
|
|
221
198
|
},
|
|
222
|
-
disabled:
|
|
223
|
-
defaultChecked:
|
|
224
|
-
style:
|
|
199
|
+
disabled: n.disabled,
|
|
200
|
+
defaultChecked: n.checked,
|
|
201
|
+
style: F
|
|
225
202
|
});
|
|
226
203
|
},
|
|
227
204
|
getIndicatorProps() {
|
|
228
|
-
|
|
205
|
+
const a = i.get("indicatorRect");
|
|
229
206
|
return t.element({
|
|
230
|
-
id:
|
|
207
|
+
id: C(l),
|
|
231
208
|
...v.indicator.attrs,
|
|
232
|
-
dir:
|
|
233
|
-
hidden:
|
|
234
|
-
"data-disabled":
|
|
235
|
-
"data-orientation":
|
|
209
|
+
dir: o("dir"),
|
|
210
|
+
hidden: i.get("value") == null,
|
|
211
|
+
"data-disabled": u(s),
|
|
212
|
+
"data-orientation": o("orientation"),
|
|
236
213
|
style: {
|
|
237
214
|
"--transition-property": "left, top, width, height",
|
|
238
|
-
"--left":
|
|
239
|
-
"--top":
|
|
240
|
-
"--width":
|
|
241
|
-
"--height":
|
|
215
|
+
"--left": a == null ? void 0 : a.left,
|
|
216
|
+
"--top": a == null ? void 0 : a.top,
|
|
217
|
+
"--width": a == null ? void 0 : a.width,
|
|
218
|
+
"--height": a == null ? void 0 : a.height,
|
|
242
219
|
position: "absolute",
|
|
243
220
|
willChange: "var(--transition-property)",
|
|
244
221
|
transitionProperty: "var(--transition-property)",
|
|
245
|
-
transitionDuration:
|
|
222
|
+
transitionDuration: i.get("canIndicatorTransition") ? "var(--transition-duration, 150ms)" : "0ms",
|
|
246
223
|
transitionTimingFunction: "var(--transition-timing-function)",
|
|
247
|
-
[
|
|
224
|
+
[o("orientation") === "horizontal" ? "left" : "top"]: o("orientation") === "horizontal" ? "var(--left)" : "var(--top)"
|
|
248
225
|
}
|
|
249
226
|
});
|
|
250
227
|
}
|
|
251
228
|
};
|
|
252
229
|
}
|
|
253
|
-
var { not:
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
230
|
+
var { not: Q } = H(), ae = O({
|
|
231
|
+
props({ props: e }) {
|
|
232
|
+
return {
|
|
233
|
+
orientation: "vertical",
|
|
234
|
+
...e
|
|
235
|
+
};
|
|
236
|
+
},
|
|
237
|
+
initialState() {
|
|
238
|
+
return "idle";
|
|
239
|
+
},
|
|
240
|
+
context({ prop: e, bindable: t }) {
|
|
241
|
+
return {
|
|
242
|
+
value: t(() => ({
|
|
243
|
+
defaultValue: e("defaultValue"),
|
|
244
|
+
value: e("value"),
|
|
245
|
+
onChange(i) {
|
|
246
|
+
var r;
|
|
247
|
+
(r = e("onValueChange")) == null || r({ value: i });
|
|
248
|
+
}
|
|
249
|
+
})),
|
|
250
|
+
activeValue: t(() => ({
|
|
251
|
+
defaultValue: null
|
|
252
|
+
})),
|
|
253
|
+
focusedValue: t(() => ({
|
|
254
|
+
defaultValue: null
|
|
255
|
+
})),
|
|
256
|
+
hoveredValue: t(() => ({
|
|
257
|
+
defaultValue: null
|
|
258
|
+
})),
|
|
259
|
+
indicatorRect: t(() => ({
|
|
260
|
+
defaultValue: {}
|
|
261
|
+
})),
|
|
262
|
+
canIndicatorTransition: t(() => ({
|
|
263
|
+
defaultValue: !1
|
|
264
|
+
})),
|
|
265
|
+
fieldsetDisabled: t(() => ({
|
|
266
|
+
defaultValue: !1
|
|
267
|
+
})),
|
|
268
|
+
ssr: t(() => ({
|
|
269
|
+
defaultValue: !0
|
|
270
|
+
}))
|
|
271
|
+
};
|
|
272
|
+
},
|
|
273
|
+
refs() {
|
|
274
|
+
return {
|
|
275
|
+
indicatorCleanup: null
|
|
276
|
+
};
|
|
277
|
+
},
|
|
278
|
+
computed: {
|
|
279
|
+
isDisabled: ({ prop: e, context: t }) => !!e("disabled") || t.get("fieldsetDisabled")
|
|
280
|
+
},
|
|
281
|
+
entry: ["syncIndicatorRect", "syncSsr"],
|
|
282
|
+
exit: ["cleanupObserver"],
|
|
283
|
+
effects: ["trackFormControlState", "trackFocusVisible"],
|
|
284
|
+
watch({ track: e, action: t, context: i }) {
|
|
285
|
+
e([() => i.get("value")], () => {
|
|
286
|
+
t(["setIndicatorTransition", "syncIndicatorRect", "syncInputElements"]);
|
|
287
|
+
});
|
|
288
|
+
},
|
|
289
|
+
on: {
|
|
290
|
+
SET_VALUE: [
|
|
291
|
+
{
|
|
292
|
+
guard: Q("isTrusted"),
|
|
293
|
+
actions: ["setValue", "dispatchChangeEvent"]
|
|
282
294
|
},
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
295
|
+
{
|
|
296
|
+
actions: ["setValue"]
|
|
297
|
+
}
|
|
298
|
+
],
|
|
299
|
+
SET_HOVERED: {
|
|
300
|
+
actions: ["setHovered"]
|
|
301
|
+
},
|
|
302
|
+
SET_ACTIVE: {
|
|
303
|
+
actions: ["setActive"]
|
|
304
|
+
},
|
|
305
|
+
SET_FOCUSED: {
|
|
306
|
+
actions: ["setFocused"]
|
|
307
|
+
}
|
|
308
|
+
},
|
|
309
|
+
states: {
|
|
310
|
+
idle: {}
|
|
311
|
+
},
|
|
312
|
+
implementations: {
|
|
313
|
+
guards: {
|
|
314
|
+
isTrusted: ({ event: e }) => !!e.isTrusted
|
|
315
|
+
},
|
|
316
|
+
effects: {
|
|
317
|
+
trackFormControlState({ context: e, scope: t }) {
|
|
318
|
+
return D(m(t), {
|
|
319
|
+
onFieldsetDisabledChange(i) {
|
|
320
|
+
e.set("fieldsetDisabled", i);
|
|
288
321
|
},
|
|
289
|
-
{
|
|
290
|
-
|
|
322
|
+
onFormReset() {
|
|
323
|
+
e.set("value", e.initial("value"));
|
|
291
324
|
}
|
|
292
|
-
|
|
293
|
-
SET_HOVERED: {
|
|
294
|
-
actions: "setHovered"
|
|
295
|
-
},
|
|
296
|
-
SET_ACTIVE: {
|
|
297
|
-
actions: "setActive"
|
|
298
|
-
},
|
|
299
|
-
SET_FOCUSED: {
|
|
300
|
-
actions: "setFocused"
|
|
301
|
-
}
|
|
325
|
+
});
|
|
302
326
|
},
|
|
303
|
-
|
|
304
|
-
|
|
327
|
+
trackFocusVisible({ scope: e }) {
|
|
328
|
+
var t;
|
|
329
|
+
return _({ root: (t = e.getRootNode) == null ? void 0 : t.call(e) });
|
|
305
330
|
}
|
|
306
331
|
},
|
|
307
|
-
{
|
|
308
|
-
|
|
309
|
-
|
|
332
|
+
actions: {
|
|
333
|
+
setValue({ context: e, event: t }) {
|
|
334
|
+
e.set("value", t.value);
|
|
310
335
|
},
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
return k(n.getRootEl(t), {
|
|
314
|
-
onFieldsetDisabledChange(s) {
|
|
315
|
-
t.fieldsetDisabled = s;
|
|
316
|
-
},
|
|
317
|
-
onFormReset() {
|
|
318
|
-
l({ type: "SET_VALUE", value: u.value });
|
|
319
|
-
}
|
|
320
|
-
});
|
|
321
|
-
},
|
|
322
|
-
trackFocusVisible(t) {
|
|
323
|
-
return y({ root: n.getRootNode(t) });
|
|
324
|
-
}
|
|
336
|
+
setHovered({ context: e, event: t }) {
|
|
337
|
+
e.set("hoveredValue", t.value);
|
|
325
338
|
},
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
syncIndicatorRect(t) {
|
|
355
|
-
var u;
|
|
356
|
-
if ((u = t.indicatorCleanup) == null || u.call(t), !n.getIndicatorEl(t)) return;
|
|
357
|
-
const a = t.value, l = n.getActiveRadioEl(t);
|
|
358
|
-
if (a == null || !l) {
|
|
359
|
-
t.indicatorRect = {};
|
|
360
|
-
return;
|
|
361
|
-
}
|
|
362
|
-
t.indicatorCleanup = C(l, {
|
|
363
|
-
getRect(s) {
|
|
364
|
-
return n.getOffsetRect(s);
|
|
365
|
-
},
|
|
366
|
-
onChange(s) {
|
|
367
|
-
t.indicatorRect = n.resolveRect(s), b(() => {
|
|
368
|
-
t.canIndicatorTransition = !1;
|
|
369
|
-
});
|
|
370
|
-
}
|
|
371
|
-
});
|
|
372
|
-
},
|
|
373
|
-
dispatchChangeEvent(t) {
|
|
374
|
-
n.getInputEls(t).forEach((l) => {
|
|
375
|
-
const u = l.value === t.value;
|
|
376
|
-
u !== l.checked && S(l, { checked: u });
|
|
377
|
-
});
|
|
339
|
+
setActive({ context: e, event: t }) {
|
|
340
|
+
e.set("activeValue", t.value);
|
|
341
|
+
},
|
|
342
|
+
setFocused({ context: e, event: t }) {
|
|
343
|
+
e.set("focusedValue", t.value);
|
|
344
|
+
},
|
|
345
|
+
syncInputElements({ context: e, scope: t }) {
|
|
346
|
+
V(t).forEach((r) => {
|
|
347
|
+
r.checked = r.value === e.get("value");
|
|
348
|
+
});
|
|
349
|
+
},
|
|
350
|
+
setIndicatorTransition({ context: e }) {
|
|
351
|
+
e.set("canIndicatorTransition", L(e.get("value")));
|
|
352
|
+
},
|
|
353
|
+
cleanupObserver({ refs: e }) {
|
|
354
|
+
var t;
|
|
355
|
+
(t = e.get("indicatorCleanup")) == null || t();
|
|
356
|
+
},
|
|
357
|
+
syncSsr({ context: e }) {
|
|
358
|
+
e.set("ssr", !1);
|
|
359
|
+
},
|
|
360
|
+
syncIndicatorRect({ context: e, scope: t, refs: i }) {
|
|
361
|
+
var l;
|
|
362
|
+
if ((l = i.get("indicatorCleanup")) == null || l(), !M(t)) return;
|
|
363
|
+
const r = e.get("value"), c = W(t, r);
|
|
364
|
+
if (r == null || !c) {
|
|
365
|
+
e.set("canIndicatorTransition", !1), e.set("indicatorRect", {});
|
|
366
|
+
return;
|
|
378
367
|
}
|
|
368
|
+
const o = R([c], {
|
|
369
|
+
measure(s) {
|
|
370
|
+
return j(s);
|
|
371
|
+
},
|
|
372
|
+
onEntry({ rects: s }) {
|
|
373
|
+
e.set("indicatorRect", J(s[0]));
|
|
374
|
+
}
|
|
375
|
+
});
|
|
376
|
+
i.set("indicatorCleanup", o);
|
|
377
|
+
},
|
|
378
|
+
dispatchChangeEvent({ context: e, scope: t }) {
|
|
379
|
+
V(t).forEach((r) => {
|
|
380
|
+
const c = r.value === e.get("value");
|
|
381
|
+
c !== r.checked && k(r, { checked: c });
|
|
382
|
+
});
|
|
379
383
|
}
|
|
380
384
|
}
|
|
381
|
-
);
|
|
382
|
-
}
|
|
383
|
-
var P = {
|
|
384
|
-
change: (e) => {
|
|
385
|
-
var i;
|
|
386
|
-
e.value != null && ((i = e.onValueChange) == null || i.call(e, { value: e.value }));
|
|
387
|
-
}
|
|
388
|
-
}, w = {
|
|
389
|
-
value: (e, i) => {
|
|
390
|
-
D(e.value, i) || (e.value = i, P.change(e));
|
|
391
385
|
}
|
|
392
|
-
};
|
|
393
|
-
|
|
386
|
+
});
|
|
387
|
+
b()([
|
|
394
388
|
"dir",
|
|
395
389
|
"disabled",
|
|
396
390
|
"form",
|
|
@@ -401,11 +395,12 @@ I()([
|
|
|
401
395
|
"onValueChange",
|
|
402
396
|
"orientation",
|
|
403
397
|
"readOnly",
|
|
404
|
-
"value"
|
|
398
|
+
"value",
|
|
399
|
+
"defaultValue"
|
|
405
400
|
]);
|
|
406
|
-
|
|
401
|
+
b()(["value", "disabled", "invalid"]);
|
|
407
402
|
export {
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
403
|
+
U as anatomy,
|
|
404
|
+
te as connect,
|
|
405
|
+
ae as machine
|
|
411
406
|
};
|