@devslab/dds-solid 0.17.1 → 0.18.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/README.ko.md +12 -1
- package/README.md +12 -1
- package/dist/controls.d.ts.map +1 -1
- package/dist/dialog.d.ts +24 -0
- package/dist/dialog.d.ts.map +1 -1
- package/dist/direction.d.ts +5 -0
- package/dist/direction.d.ts.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +657 -388
- package/dist/index.js.map +1 -1
- package/dist/radio-group.d.ts +21 -0
- package/dist/radio-group.d.ts.map +1 -0
- package/dist/server.js +542 -254
- package/dist/server.js.map +1 -1
- package/dist/tabs.d.ts +12 -1
- package/dist/tabs.d.ts.map +1 -1
- package/dist/toast.d.ts +2 -1
- package/dist/toast.d.ts.map +1 -1
- package/dist/tooltip.d.ts +2 -1
- package/dist/tooltip.d.ts.map +1 -1
- package/package.json +8 -5
- package/styles.css +16 -0
package/dist/index.js
CHANGED
|
@@ -1,27 +1,40 @@
|
|
|
1
|
-
import { For as e, Show as t, createContext as n, createEffect as r,
|
|
2
|
-
import { className as
|
|
3
|
-
import {
|
|
1
|
+
import { For as e, Show as t, createContext as n, createEffect as r, createMemo as i, createSignal as a, createUniqueId as o, mergeProps as s, onCleanup as c, onMount as l, splitProps as u, useContext as d } from "solid-js";
|
|
2
|
+
import { Dynamic as f, Portal as p, className as m, createComponent as h, delegateEvents as g, effect as _, getNextElement as v, getNextMarker as y, insert as b, isServer as x, memo as S, mergeProps as C, runHydrationEvents as w, setAttribute as T, setProperty as E, spread as D, template as O, use as k } from "solid-js/web";
|
|
3
|
+
import { useCheckbox as A } from "@ark-ui/solid/checkbox";
|
|
4
|
+
import { useSwitch as j } from "@ark-ui/solid/switch";
|
|
5
|
+
import { Field as M } from "@ark-ui/solid/field";
|
|
6
|
+
import { Dialog as N, useDialog as P } from "@ark-ui/solid/dialog";
|
|
7
|
+
import { usePresenceContext as F } from "@ark-ui/solid/presence";
|
|
8
|
+
import { FocusTrap as I } from "@zag-js/focus-trap";
|
|
9
|
+
import { ariaHidden as L } from "@zag-js/aria-hidden";
|
|
10
|
+
import { RadioGroup as R } from "@ark-ui/solid/radio-group";
|
|
11
|
+
import { directionPolicy as z, icons as B } from "@devslab/dds-icons";
|
|
12
|
+
import { Tabs as V, useTabsContext as H } from "@ark-ui/solid/tabs";
|
|
13
|
+
import { LocaleProvider as U } from "@ark-ui/solid/locale";
|
|
14
|
+
import { Toast as W, Toaster as ee, createToaster as te } from "@ark-ui/solid/toast";
|
|
15
|
+
import { space as ne } from "@devslab/dds-tokens";
|
|
16
|
+
import { Tooltip as G, useTooltip as re } from "@ark-ui/solid/tooltip";
|
|
4
17
|
//#region src/controllable.ts
|
|
5
|
-
function
|
|
6
|
-
let [t, n] =
|
|
18
|
+
function K(e) {
|
|
19
|
+
let [t, n] = a(e.defaultValue), r = () => e.value() ?? t(), i = n;
|
|
7
20
|
return [r, (t) => {
|
|
8
21
|
let n = typeof t == "function" ? t(r()) : t;
|
|
9
|
-
return e.value() === void 0 &&
|
|
22
|
+
return e.value() === void 0 && i(() => n), e.onChange?.(n), n;
|
|
10
23
|
}];
|
|
11
24
|
}
|
|
12
25
|
//#endregion
|
|
13
26
|
//#region src/utils.ts
|
|
14
|
-
function
|
|
27
|
+
function q(...e) {
|
|
15
28
|
return e.filter(Boolean).join(" ");
|
|
16
29
|
}
|
|
17
|
-
function
|
|
30
|
+
function ie(...e) {
|
|
18
31
|
return e.filter(Boolean).join(" ") || void 0;
|
|
19
32
|
}
|
|
20
33
|
//#endregion
|
|
21
34
|
//#region src/controls.tsx
|
|
22
|
-
var
|
|
23
|
-
function
|
|
24
|
-
let [t, n] =
|
|
35
|
+
var ae = /*#__PURE__*/ O("<button><!$><!/><!$><!/>"), J = /*#__PURE__*/ O("<span class=dds-spinner aria-hidden=true>"), oe = /*#__PURE__*/ O("<button>"), se = /*#__PURE__*/ O("<span aria-hidden=true> *"), ce = /*#__PURE__*/ O("<span><select>"), Y = /*#__PURE__*/ O("<label><input><span>");
|
|
36
|
+
function le(e) {
|
|
37
|
+
let [t, n] = u(e, [
|
|
25
38
|
"class",
|
|
26
39
|
"tone",
|
|
27
40
|
"size",
|
|
@@ -31,13 +44,13 @@ function z(e) {
|
|
|
31
44
|
"children"
|
|
32
45
|
]);
|
|
33
46
|
return (() => {
|
|
34
|
-
var e =
|
|
35
|
-
return
|
|
47
|
+
var e = v(ae), r = e.firstChild, [i, a] = y(r.nextSibling), o = i.nextSibling, [s, c] = y(o.nextSibling);
|
|
48
|
+
return D(e, C(n, {
|
|
36
49
|
get type() {
|
|
37
50
|
return t.type ?? "button";
|
|
38
51
|
},
|
|
39
52
|
get class() {
|
|
40
|
-
return
|
|
53
|
+
return q("dds-btn", `dds-btn--${t.tone ?? "primary"}`, t.size !== "md" && t.size ? `dds-btn--${t.size}` : void 0, t.class);
|
|
41
54
|
},
|
|
42
55
|
get disabled() {
|
|
43
56
|
return t.disabled || t.loading;
|
|
@@ -45,14 +58,14 @@ function z(e) {
|
|
|
45
58
|
get "aria-busy"() {
|
|
46
59
|
return t.loading ? "true" : void 0;
|
|
47
60
|
}
|
|
48
|
-
}), !1, !0),
|
|
49
|
-
var e =
|
|
50
|
-
return () => e() &&
|
|
51
|
-
})(), i, a),
|
|
61
|
+
}), !1, !0), b(e, (() => {
|
|
62
|
+
var e = S(() => !!t.loading);
|
|
63
|
+
return () => e() && v(J);
|
|
64
|
+
})(), i, a), b(e, () => t.children, s, c), w(), e;
|
|
52
65
|
})();
|
|
53
66
|
}
|
|
54
|
-
function
|
|
55
|
-
let [t, n] =
|
|
67
|
+
function ue(e) {
|
|
68
|
+
let [t, n] = u(e, [
|
|
56
69
|
"class",
|
|
57
70
|
"tone",
|
|
58
71
|
"size",
|
|
@@ -62,13 +75,13 @@ function B(e) {
|
|
|
62
75
|
"children"
|
|
63
76
|
]);
|
|
64
77
|
return (() => {
|
|
65
|
-
var e =
|
|
66
|
-
return
|
|
78
|
+
var e = v(oe);
|
|
79
|
+
return D(e, C(n, {
|
|
67
80
|
get type() {
|
|
68
81
|
return t.type ?? "button";
|
|
69
82
|
},
|
|
70
83
|
get class() {
|
|
71
|
-
return
|
|
84
|
+
return q("dds-iconbtn", t.tone && t.tone !== "ghost" ? `dds-iconbtn--${t.tone}` : void 0, t.size !== "md" && t.size ? `dds-iconbtn--${t.size}` : void 0, t.class);
|
|
72
85
|
},
|
|
73
86
|
get disabled() {
|
|
74
87
|
return t.disabled || t.loading;
|
|
@@ -76,66 +89,86 @@ function B(e) {
|
|
|
76
89
|
get "aria-busy"() {
|
|
77
90
|
return t.loading ? "true" : void 0;
|
|
78
91
|
}
|
|
79
|
-
}), !1, !0),
|
|
80
|
-
var e =
|
|
81
|
-
return () => e() ?
|
|
82
|
-
})()),
|
|
92
|
+
}), !1, !0), b(e, (() => {
|
|
93
|
+
var e = S(() => !!t.loading);
|
|
94
|
+
return () => e() ? v(J) : t.children;
|
|
95
|
+
})()), w(), e;
|
|
83
96
|
})();
|
|
84
97
|
}
|
|
85
|
-
function
|
|
86
|
-
let t =
|
|
98
|
+
function de(e) {
|
|
99
|
+
let t = o(), n = () => e.id ?? `dds-field-${t}`, r = () => e.helpText ? `${n()}-help` : void 0, i = () => e.error ? `${n()}-error` : void 0, a = () => ({
|
|
87
100
|
id: n(),
|
|
88
|
-
"aria-describedby":
|
|
101
|
+
"aria-describedby": ie(r(), i()),
|
|
89
102
|
"aria-invalid": e.error ? "true" : void 0,
|
|
90
103
|
"aria-required": e.required ? "true" : void 0
|
|
91
104
|
});
|
|
92
|
-
return (
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
105
|
+
return h(M.Root, {
|
|
106
|
+
get id() {
|
|
107
|
+
return n();
|
|
108
|
+
},
|
|
109
|
+
get required() {
|
|
110
|
+
return e.required ?? !1;
|
|
111
|
+
},
|
|
112
|
+
get invalid() {
|
|
113
|
+
return !!e.error;
|
|
114
|
+
},
|
|
115
|
+
get ids() {
|
|
116
|
+
return {
|
|
117
|
+
control: `${n()}-root`,
|
|
118
|
+
helperText: `${n()}-help`,
|
|
119
|
+
errorText: `${n()}-error`
|
|
120
|
+
};
|
|
121
|
+
},
|
|
122
|
+
get class() {
|
|
123
|
+
return q("dds-field", e.error ? "dds-field--error" : void 0, e.class);
|
|
124
|
+
},
|
|
125
|
+
get children() {
|
|
126
|
+
return [
|
|
127
|
+
h(M.Label, {
|
|
128
|
+
class: "dds-field__label",
|
|
129
|
+
get for() {
|
|
130
|
+
return n();
|
|
131
|
+
},
|
|
132
|
+
get children() {
|
|
133
|
+
return [S(() => e.label), S(() => S(() => !!e.required)() && v(se))];
|
|
134
|
+
}
|
|
135
|
+
}),
|
|
136
|
+
S(() => S(() => typeof e.children == "function")() ? e.children(a()) : e.children),
|
|
137
|
+
S(() => S(() => !!e.helpText)() && h(M.HelperText, {
|
|
138
|
+
class: "dds-field__help",
|
|
139
|
+
get children() {
|
|
140
|
+
return e.helpText;
|
|
141
|
+
}
|
|
142
|
+
})),
|
|
143
|
+
S(() => S(() => !!e.error)() && h(M.ErrorText, {
|
|
144
|
+
class: "dds-field__error",
|
|
145
|
+
role: "alert",
|
|
146
|
+
get children() {
|
|
147
|
+
return e.error;
|
|
148
|
+
}
|
|
149
|
+
}))
|
|
150
|
+
];
|
|
151
|
+
}
|
|
152
|
+
});
|
|
120
153
|
}
|
|
121
|
-
function
|
|
122
|
-
let [t, n] =
|
|
154
|
+
function fe(e) {
|
|
155
|
+
let [t, n] = u(e, [
|
|
123
156
|
"class",
|
|
124
157
|
"invalid",
|
|
125
158
|
"children"
|
|
126
159
|
]);
|
|
127
160
|
return (() => {
|
|
128
|
-
var e =
|
|
129
|
-
return
|
|
161
|
+
var e = v(ce), r = e.firstChild;
|
|
162
|
+
return D(r, C(n, {
|
|
130
163
|
class: "dds-select__input",
|
|
131
164
|
get "aria-invalid"() {
|
|
132
165
|
return t.invalid ? "true" : void 0;
|
|
133
166
|
}
|
|
134
|
-
}), !1, !0),
|
|
167
|
+
}), !1, !0), b(r, () => t.children), _(() => m(e, q("dds-select", t.class))), w(), e;
|
|
135
168
|
})();
|
|
136
169
|
}
|
|
137
|
-
function
|
|
138
|
-
let [t, n] =
|
|
170
|
+
function pe(e) {
|
|
171
|
+
let [t, n] = u(e, [
|
|
139
172
|
"checked",
|
|
140
173
|
"defaultChecked",
|
|
141
174
|
"onCheckedChange",
|
|
@@ -144,14 +177,14 @@ function U(e) {
|
|
|
144
177
|
"inputClass",
|
|
145
178
|
"type",
|
|
146
179
|
"role"
|
|
147
|
-
]), [r, i] =
|
|
180
|
+
]), [r, i] = K({
|
|
148
181
|
value: () => t.checked,
|
|
149
182
|
defaultValue: t.defaultChecked ?? !1,
|
|
150
183
|
onChange: t.onCheckedChange
|
|
151
184
|
});
|
|
152
185
|
return (() => {
|
|
153
|
-
var e =
|
|
154
|
-
return
|
|
186
|
+
var e = v(Y), a = e.firstChild, o = a.nextSibling;
|
|
187
|
+
return D(a, C(n, {
|
|
155
188
|
get type() {
|
|
156
189
|
return t.type;
|
|
157
190
|
},
|
|
@@ -159,115 +192,183 @@ function U(e) {
|
|
|
159
192
|
return t.role;
|
|
160
193
|
},
|
|
161
194
|
get class() {
|
|
162
|
-
return
|
|
195
|
+
return q(t.role === "switch" ? "dds-switch__input" : "dds-check__input", t.inputClass);
|
|
163
196
|
},
|
|
164
197
|
get checked() {
|
|
165
198
|
return r();
|
|
166
199
|
},
|
|
167
200
|
onChange: (e) => i(e.currentTarget.checked)
|
|
168
|
-
}), !1, !1),
|
|
201
|
+
}), !1, !1), b(o, () => t.label), _(() => m(e, q(t.role === "switch" ? "dds-switch" : "dds-check", t.class))), w(), e;
|
|
202
|
+
})();
|
|
203
|
+
}
|
|
204
|
+
var me = (e) => h(X, C(e, { kind: "checkbox" })), he = (e) => h(pe, C(e, { type: "radio" })), ge = (e) => h(X, C(e, { kind: "switch" }));
|
|
205
|
+
function X(e) {
|
|
206
|
+
let t = o(), [n, r] = u(e, [
|
|
207
|
+
"checked",
|
|
208
|
+
"defaultChecked",
|
|
209
|
+
"onCheckedChange",
|
|
210
|
+
"label",
|
|
211
|
+
"class",
|
|
212
|
+
"inputClass",
|
|
213
|
+
"kind",
|
|
214
|
+
"id",
|
|
215
|
+
"onClick",
|
|
216
|
+
"onFocusIn",
|
|
217
|
+
"onFocusOut",
|
|
218
|
+
"style"
|
|
219
|
+
]), i = () => ({
|
|
220
|
+
id: `dds-check-${t}`,
|
|
221
|
+
ids: { hiddenInput: n.id ?? `dds-check-${t}-input` },
|
|
222
|
+
checked: n.checked,
|
|
223
|
+
defaultChecked: n.defaultChecked,
|
|
224
|
+
onCheckedChange: (e) => n.onCheckedChange?.(e.checked === !0),
|
|
225
|
+
disabled: r.disabled,
|
|
226
|
+
required: r.required,
|
|
227
|
+
readOnly: r.readonly,
|
|
228
|
+
name: r.name,
|
|
229
|
+
form: r.form,
|
|
230
|
+
value: String(r.value ?? "on")
|
|
231
|
+
}), a = n.kind === "switch" ? j(i) : A(i), s = () => n.kind === "switch" ? "dds-switch__input" : "dds-check__input", c = () => {
|
|
232
|
+
let [, e] = u(a().getRootProps(), ["onClick"]);
|
|
233
|
+
return e;
|
|
234
|
+
};
|
|
235
|
+
return (() => {
|
|
236
|
+
var e = v(Y), t = e.firstChild, i = t.nextSibling;
|
|
237
|
+
return D(e, C(c, { get class() {
|
|
238
|
+
return q(n.kind === "switch" ? "dds-switch" : "dds-check", n.class);
|
|
239
|
+
} }), !1, !0), k((e) => {
|
|
240
|
+
e.defaultChecked = n.checked ?? n.defaultChecked ?? !1, typeof r.ref == "function" && r.ref(e);
|
|
241
|
+
}, t), D(t, C(() => a().getHiddenInputProps(), r, {
|
|
242
|
+
type: "checkbox",
|
|
243
|
+
get role() {
|
|
244
|
+
return n.kind === "switch" ? "switch" : void 0;
|
|
245
|
+
},
|
|
246
|
+
get class() {
|
|
247
|
+
return q(s(), n.inputClass);
|
|
248
|
+
},
|
|
249
|
+
get style() {
|
|
250
|
+
return n.style ?? {};
|
|
251
|
+
},
|
|
252
|
+
get checked() {
|
|
253
|
+
return a().checked;
|
|
254
|
+
},
|
|
255
|
+
onFocusIn: (e) => {
|
|
256
|
+
Z(a().getHiddenInputProps().onFocusIn, e), Z(n.onFocusIn, e);
|
|
257
|
+
},
|
|
258
|
+
onFocusOut: (e) => {
|
|
259
|
+
Z(a().getHiddenInputProps().onFocusOut, e), Z(n.onFocusOut, e);
|
|
260
|
+
},
|
|
261
|
+
onClick: (e) => {
|
|
262
|
+
if (typeof n.onClick == "function" ? n.onClick(e) : n.onClick && n.onClick[0](n.onClick[1], e), !e.defaultPrevented) {
|
|
263
|
+
let t = a().getHiddenInputProps().onClick;
|
|
264
|
+
typeof t == "function" ? t(e) : t && t[0](t[1], e);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}), !1, !1), D(i, C(() => a().getLabelProps()), !1, !0), b(i, () => n.label), w(), e;
|
|
169
268
|
})();
|
|
170
269
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
270
|
+
function Z(e, t) {
|
|
271
|
+
typeof e == "function" ? e(t) : e && e[0](e[1], t);
|
|
272
|
+
}
|
|
273
|
+
//#endregion
|
|
274
|
+
//#region src/console-shell.tsx
|
|
275
|
+
var _e = /*#__PURE__*/ O("<dl class=dds-console-rail__context>"), ve = /*#__PURE__*/ O("<div class=dds-console-rail__foot>"), ye = /*#__PURE__*/ O("<p class=dds-console-page-eyebrow>"), be = /*#__PURE__*/ O("<div class=dds-console-page-header__actions>"), xe = /*#__PURE__*/ O("<div class=dds-console-shell><a class=\"dds-console-skip dds-visually-hidden\"href=#dds-console-main></a><button class=dds-console-rail__toggle type=button data-action=toggle-rail aria-controls=dds-console-rail><span aria-hidden=true></span><span class=dds-visually-hidden></span></button><div class=dds-console-rail__scrim></div><aside id=dds-console-rail class=dds-console-rail><a class=dds-console-rail__brand><img alt width=20 height=20><strong></strong></a><!$><!/><nav class=dds-console-rail__nav></nav><!$><!/></aside><main id=dds-console-main class=dds-console-main tabindex=-1><header class=dds-console-page-header><div class=dds-console-page-header__text><!$><!/><h1></h1></div><!$><!/></header><!$><!/>"), Se = /*#__PURE__*/ O("<div><dt></dt><dd>"), Ce = /*#__PURE__*/ O("<section class=dds-console-rail__group><h2 class=dds-console-rail__group-label></h2><ul>"), we = /*#__PURE__*/ O("<span class=dds-console-rail__badge>"), Te = /*#__PURE__*/ O("<li><a class=dds-console-rail__item><span></span><!$><!/>");
|
|
276
|
+
function Ee(e, t, n) {
|
|
176
277
|
return n === void 0 ? t.split("/").filter(Boolean).length <= 1 ? e === t : e === t || e.startsWith(`${t}/`) : n;
|
|
177
278
|
}
|
|
178
|
-
function
|
|
279
|
+
function De(e, t) {
|
|
179
280
|
return e.replace("{count}", () => String(t));
|
|
180
281
|
}
|
|
181
|
-
function
|
|
182
|
-
let [r,
|
|
183
|
-
return
|
|
184
|
-
|
|
282
|
+
function Oe(n) {
|
|
283
|
+
let [r, i] = a(!1), s = () => i(!1), [u, d] = a(!1);
|
|
284
|
+
return l(() => {
|
|
285
|
+
d(!0);
|
|
185
286
|
let e = (e) => {
|
|
186
|
-
e.key === "Escape" &&
|
|
287
|
+
e.key === "Escape" && s();
|
|
187
288
|
};
|
|
188
|
-
document.addEventListener("keydown", e),
|
|
289
|
+
document.addEventListener("keydown", e), c(() => document.removeEventListener("keydown", e));
|
|
189
290
|
}), (() => {
|
|
190
|
-
var
|
|
191
|
-
return
|
|
192
|
-
var e =
|
|
291
|
+
var a = v(xe), c = a.firstChild, l = c.nextSibling, d = l.firstChild.nextSibling, f = l.nextSibling, p = f.nextSibling, m = p.firstChild, g = m.firstChild, x = g.nextSibling, C = m.nextSibling, [E, D] = y(C.nextSibling), O = E.nextSibling, k = O.nextSibling, [A, j] = y(k.nextSibling), M = p.nextSibling, N = M.firstChild, P = N.firstChild, F = P.firstChild, [I, L] = y(F.nextSibling), R = I.nextSibling, z = P.nextSibling, [B, V] = y(z.nextSibling), H = N.nextSibling, [U, W] = y(H.nextSibling);
|
|
292
|
+
return b(c, () => n.labels.skip), l.$$click = () => i(!r()), b(d, (() => {
|
|
293
|
+
var e = S(() => !!r());
|
|
193
294
|
return () => e() ? n.labels.menuClose : n.labels.menuOpen;
|
|
194
|
-
})()),
|
|
295
|
+
})()), f.$$click = s, b(x, () => n.brand.name), b(p, h(t, {
|
|
195
296
|
get when() {
|
|
196
|
-
return
|
|
297
|
+
return S(() => !!n.context)() && n.context.length > 0;
|
|
197
298
|
},
|
|
198
299
|
get children() {
|
|
199
|
-
var t =
|
|
200
|
-
return
|
|
300
|
+
var t = v(_e);
|
|
301
|
+
return b(t, h(e, {
|
|
201
302
|
get each() {
|
|
202
303
|
return n.context;
|
|
203
304
|
},
|
|
204
305
|
children: (e) => (() => {
|
|
205
|
-
var t =
|
|
206
|
-
return
|
|
306
|
+
var t = v(Se), n = t.firstChild, r = n.nextSibling;
|
|
307
|
+
return b(n, () => e.label), b(r, () => e.value), t;
|
|
207
308
|
})()
|
|
208
309
|
})), t;
|
|
209
310
|
}
|
|
210
|
-
}), E, D),
|
|
311
|
+
}), E, D), b(O, h(e, {
|
|
211
312
|
get each() {
|
|
212
313
|
return n.nav;
|
|
213
314
|
},
|
|
214
315
|
children: (r) => {
|
|
215
|
-
let i = `dds-console-group-${
|
|
316
|
+
let i = `dds-console-group-${o()}`;
|
|
216
317
|
return (() => {
|
|
217
|
-
var a =
|
|
218
|
-
return
|
|
318
|
+
var a = v(Ce), o = a.firstChild, c = o.nextSibling;
|
|
319
|
+
return T(a, "aria-labelledby", i), T(o, "id", i), b(o, () => r.label), b(c, h(e, {
|
|
219
320
|
get each() {
|
|
220
321
|
return r.items;
|
|
221
322
|
},
|
|
222
323
|
children: (e) => (() => {
|
|
223
|
-
var r =
|
|
224
|
-
return i.$$click =
|
|
324
|
+
var r = v(Te), i = r.firstChild, a = i.firstChild, o = a.nextSibling, [c, l] = y(o.nextSibling);
|
|
325
|
+
return i.$$click = s, b(a, () => e.label), b(i, h(t, {
|
|
225
326
|
get when() {
|
|
226
|
-
return
|
|
327
|
+
return S(() => e.badge !== void 0)() && e.badge > 0;
|
|
227
328
|
},
|
|
228
329
|
get children() {
|
|
229
|
-
var t =
|
|
230
|
-
return
|
|
330
|
+
var t = v(we);
|
|
331
|
+
return b(t, () => e.badge), _(() => T(t, "aria-label", De(n.labels.badge, e.badge))), t;
|
|
231
332
|
}
|
|
232
|
-
}),
|
|
233
|
-
var r = `${n.surface}.${e.id}`, a = e.href, o =
|
|
234
|
-
return r !== t.e &&
|
|
333
|
+
}), c, l), _((t) => {
|
|
334
|
+
var r = `${n.surface}.${e.id}`, a = e.href, o = Ee(n.activePath, e.href, e.active) ? "page" : void 0;
|
|
335
|
+
return r !== t.e && T(i, "data-nav", t.e = r), a !== t.t && T(i, "href", t.t = a), o !== t.a && T(i, "aria-current", t.a = o), t;
|
|
235
336
|
}, {
|
|
236
337
|
e: void 0,
|
|
237
338
|
t: void 0,
|
|
238
339
|
a: void 0
|
|
239
|
-
}),
|
|
340
|
+
}), w(), r;
|
|
240
341
|
})()
|
|
241
342
|
})), a;
|
|
242
343
|
})();
|
|
243
344
|
}
|
|
244
|
-
})),
|
|
345
|
+
})), b(p, h(t, {
|
|
245
346
|
get when() {
|
|
246
347
|
return n.foot;
|
|
247
348
|
},
|
|
248
349
|
get children() {
|
|
249
|
-
var e =
|
|
250
|
-
return
|
|
350
|
+
var e = v(ve);
|
|
351
|
+
return b(e, () => n.foot), e;
|
|
251
352
|
}
|
|
252
|
-
}), A, j),
|
|
353
|
+
}), A, j), b(P, h(t, {
|
|
253
354
|
get when() {
|
|
254
355
|
return n.header.eyebrow;
|
|
255
356
|
},
|
|
256
357
|
get children() {
|
|
257
|
-
var e =
|
|
258
|
-
return
|
|
358
|
+
var e = v(ye);
|
|
359
|
+
return b(e, () => n.header.eyebrow), e;
|
|
259
360
|
}
|
|
260
|
-
}), I, L),
|
|
361
|
+
}), I, L), b(R, () => n.header.title), b(N, h(t, {
|
|
261
362
|
get when() {
|
|
262
363
|
return n.header.actions;
|
|
263
364
|
},
|
|
264
365
|
get children() {
|
|
265
|
-
var e =
|
|
266
|
-
return
|
|
366
|
+
var e = v(be);
|
|
367
|
+
return b(e, () => n.header.actions), e;
|
|
267
368
|
}
|
|
268
|
-
}), B, V),
|
|
269
|
-
var t = n.surface,
|
|
270
|
-
return t !== e.e &&
|
|
369
|
+
}), B, V), b(M, () => n.children, U, W), _((e) => {
|
|
370
|
+
var t = n.surface, i = u() ? "true" : void 0, o = r(), s = r() ? "true" : "false", c = r() ? "true" : "false", d = n.brand.href, h = n.brand.mark, _ = n.labels.nav;
|
|
371
|
+
return t !== e.e && T(a, "data-surface", e.e = t), i !== e.t && T(a, "data-hydrated", e.t = i), o !== e.a && T(l, "aria-expanded", e.a = o), s !== e.o && T(f, "data-open", e.o = s), c !== e.i && T(p, "data-open", e.i = c), d !== e.n && T(m, "href", e.n = d), h !== e.s && T(g, "src", e.s = h), _ !== e.h && T(O, "aria-label", e.h = _), e;
|
|
271
372
|
}, {
|
|
272
373
|
e: void 0,
|
|
273
374
|
t: void 0,
|
|
@@ -277,13 +378,14 @@ function ue(n) {
|
|
|
277
378
|
n: void 0,
|
|
278
379
|
s: void 0,
|
|
279
380
|
h: void 0
|
|
280
|
-
}),
|
|
381
|
+
}), w(), a;
|
|
281
382
|
})();
|
|
282
383
|
}
|
|
283
|
-
|
|
384
|
+
g(["click"]);
|
|
284
385
|
//#endregion
|
|
285
386
|
//#region src/dialog.tsx
|
|
286
|
-
var
|
|
387
|
+
var ke = /*#__PURE__*/ O("<div>");
|
|
388
|
+
[
|
|
287
389
|
"a[href]",
|
|
288
390
|
"button:not([disabled])",
|
|
289
391
|
"input:not([disabled])",
|
|
@@ -291,86 +393,222 @@ var de = /*#__PURE__*/ C("<div class=dds-dialog-overlay><div role=dialog aria-mo
|
|
|
291
393
|
"textarea:not([disabled])",
|
|
292
394
|
"[tabindex]:not([tabindex='-1'])"
|
|
293
395
|
].join(",");
|
|
294
|
-
function
|
|
295
|
-
let n =
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
396
|
+
function Ae(e) {
|
|
397
|
+
let n = o(), s = () => e.id ?? `dds-dialog-${n}`, [l, u] = a(), d = P(() => ({
|
|
398
|
+
id: s(),
|
|
399
|
+
open: e.open,
|
|
400
|
+
defaultOpen: e.defaultOpen,
|
|
401
|
+
onOpenChange: (t) => e.onOpenChange?.(t.open),
|
|
402
|
+
closeOnEscape: e.closeOnEscape ?? !0,
|
|
403
|
+
closeOnInteractOutside: e.closeOnOutside ?? !0,
|
|
404
|
+
onEscapeKeyDown: e.onEscapeKeyDown,
|
|
405
|
+
initialFocusEl: () => e.initialFocus?.() ?? null,
|
|
406
|
+
finalFocusEl: () => e.finalFocus?.() ?? null,
|
|
407
|
+
restoreFocus: e.restoreFocus ?? !0,
|
|
408
|
+
modal: !e.additionalFocusContainers,
|
|
409
|
+
trapFocus: !e.additionalFocusContainers,
|
|
410
|
+
preventScroll: !0,
|
|
411
|
+
role: e.role ?? "dialog",
|
|
412
|
+
persistentElements: x ? [] : e.additionalFocusContainers?.().filter((e) => !!e).map((e) => () => e),
|
|
413
|
+
ids: {
|
|
414
|
+
content: s(),
|
|
415
|
+
title: `${s()}-title`,
|
|
416
|
+
description: `${s()}-description`
|
|
417
|
+
}
|
|
418
|
+
})), g = i(() => d().open);
|
|
419
|
+
r(() => {
|
|
420
|
+
let t = l();
|
|
421
|
+
if (!g() || !e.additionalFocusContainers || !t) return;
|
|
422
|
+
let n = t.ownerDocument.activeElement, i, o, [s, u] = a(!1), d = () => [t, ...e.additionalFocusContainers().filter((e) => !!(e?.isConnected && e.ownerDocument === t.ownerDocument))], f = t.ownerDocument.defaultView.requestAnimationFrame(() => {
|
|
423
|
+
i = new I(d(), {
|
|
424
|
+
document: t.ownerDocument,
|
|
425
|
+
escapeDeactivates: !1,
|
|
426
|
+
allowOutsideClick: !0,
|
|
427
|
+
preventScroll: !0,
|
|
428
|
+
delayInitialFocus: !1,
|
|
429
|
+
fallbackFocus: t,
|
|
430
|
+
getShadowRoot: !0,
|
|
431
|
+
initialFocus: () => e.initialFocus?.() ?? void 0,
|
|
432
|
+
setReturnFocus: () => e.finalFocus?.() ?? (n instanceof HTMLElement && n.isConnected ? n : !1)
|
|
433
|
+
}), u(!0), i.activate();
|
|
304
434
|
});
|
|
305
|
-
|
|
306
|
-
if (
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
435
|
+
r(() => {
|
|
436
|
+
if (!s()) return;
|
|
437
|
+
let e = d();
|
|
438
|
+
i.updateContainerElements(e), o?.(), o = L(e, { defer: !1 });
|
|
439
|
+
}), c(() => {
|
|
440
|
+
t.ownerDocument.defaultView.cancelAnimationFrame(f), o?.(), i?.deactivate({ returnFocus: e.restoreFocus !== !1 });
|
|
441
|
+
});
|
|
442
|
+
});
|
|
443
|
+
let y = (t, n) => q(e.unstyled ? void 0 : t, n), w = () => {
|
|
444
|
+
let t = F(), n = (n) => h(f, C({ get component() {
|
|
445
|
+
return e.contentAs ?? "div";
|
|
446
|
+
} }, () => n({}), { ref: (e) => {
|
|
447
|
+
t().ref(e), u(e);
|
|
448
|
+
} }));
|
|
449
|
+
return h(N.Positioner, {
|
|
450
|
+
get class() {
|
|
451
|
+
return y("dds-dialog-overlay", e.overlayClass);
|
|
452
|
+
},
|
|
453
|
+
get children() {
|
|
454
|
+
return h(N.Content, C(() => e.contentProps, {
|
|
455
|
+
ref: u,
|
|
456
|
+
get class() {
|
|
457
|
+
return y("dds-dialog", e.class);
|
|
458
|
+
}
|
|
459
|
+
}, () => e.contentAs ? { asChild: n } : {}, {
|
|
460
|
+
get role() {
|
|
461
|
+
return e.role ?? "dialog";
|
|
462
|
+
},
|
|
463
|
+
"aria-modal": "true",
|
|
464
|
+
get "aria-describedby"() {
|
|
465
|
+
return S(() => !!e.description)() ? `${s()}-description` : void 0;
|
|
466
|
+
},
|
|
467
|
+
get children() {
|
|
468
|
+
return (() => {
|
|
469
|
+
let t = {
|
|
470
|
+
get title() {
|
|
471
|
+
return h(N.Title, {
|
|
472
|
+
get class() {
|
|
473
|
+
return y("dds-dialog__title", e.titleClass);
|
|
474
|
+
},
|
|
475
|
+
get children() {
|
|
476
|
+
return e.title;
|
|
477
|
+
}
|
|
478
|
+
});
|
|
479
|
+
},
|
|
480
|
+
get description() {
|
|
481
|
+
return e.description && h(N.Description, {
|
|
482
|
+
get class() {
|
|
483
|
+
return y("dds-dialog__body", e.descriptionClass);
|
|
484
|
+
},
|
|
485
|
+
get children() {
|
|
486
|
+
return e.description;
|
|
487
|
+
}
|
|
488
|
+
});
|
|
489
|
+
},
|
|
490
|
+
get children() {
|
|
491
|
+
return e.children;
|
|
492
|
+
},
|
|
493
|
+
get actions() {
|
|
494
|
+
return e.actions && (() => {
|
|
495
|
+
var t = v(ke);
|
|
496
|
+
return b(t, () => e.actions), _(() => m(t, y("dds-dialog__actions", e.actionsClass))), t;
|
|
497
|
+
})();
|
|
498
|
+
}
|
|
499
|
+
};
|
|
500
|
+
return e.frame ? e.frame(t) : [
|
|
501
|
+
S(() => t.title),
|
|
502
|
+
S(() => t.description),
|
|
503
|
+
S(() => t.children),
|
|
504
|
+
S(() => t.actions)
|
|
505
|
+
];
|
|
506
|
+
})();
|
|
507
|
+
}
|
|
508
|
+
}));
|
|
315
509
|
}
|
|
316
|
-
let r = n[0], i = n[n.length - 1];
|
|
317
|
-
t.shiftKey && document.activeElement === r ? (t.preventDefault(), i.focus()) : !t.shiftKey && document.activeElement === i && (t.preventDefault(), r.focus());
|
|
318
|
-
};
|
|
319
|
-
document.addEventListener("keydown", t), o(() => {
|
|
320
|
-
document.removeEventListener("keydown", t), queueMicrotask(() => x?.focus());
|
|
321
510
|
});
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
|
|
511
|
+
};
|
|
512
|
+
return h(N.RootProvider, {
|
|
513
|
+
value: d,
|
|
514
|
+
lazyMount: !0,
|
|
515
|
+
unmountOnExit: !0,
|
|
516
|
+
get children() {
|
|
517
|
+
return h(t, {
|
|
518
|
+
get when() {
|
|
519
|
+
return e.portal;
|
|
520
|
+
},
|
|
521
|
+
get fallback() {
|
|
522
|
+
return h(w, {});
|
|
523
|
+
},
|
|
524
|
+
get children() {
|
|
525
|
+
return h(p, C(() => e.portalMount ? { mount: e.portalMount } : {}, { get children() {
|
|
526
|
+
return h(w, {});
|
|
527
|
+
} }));
|
|
528
|
+
}
|
|
529
|
+
});
|
|
530
|
+
}
|
|
531
|
+
});
|
|
532
|
+
}
|
|
533
|
+
//#endregion
|
|
534
|
+
//#region src/radio-group.tsx
|
|
535
|
+
function je(t) {
|
|
536
|
+
let n = t.value ?? t.defaultValue;
|
|
537
|
+
return h(R.Root, {
|
|
538
|
+
get value() {
|
|
539
|
+
return t.value;
|
|
540
|
+
},
|
|
541
|
+
get defaultValue() {
|
|
542
|
+
return t.defaultValue;
|
|
543
|
+
},
|
|
544
|
+
get name() {
|
|
545
|
+
return t.name;
|
|
546
|
+
},
|
|
547
|
+
get form() {
|
|
548
|
+
return t.form;
|
|
549
|
+
},
|
|
550
|
+
get disabled() {
|
|
551
|
+
return t.disabled;
|
|
552
|
+
},
|
|
553
|
+
get required() {
|
|
554
|
+
return t.required;
|
|
555
|
+
},
|
|
556
|
+
onValueChange: (e) => {
|
|
557
|
+
e.value !== null && t.onValueChange?.(e.value);
|
|
558
|
+
},
|
|
559
|
+
get class() {
|
|
560
|
+
return q("dds-radio-group", t.class);
|
|
325
561
|
},
|
|
326
562
|
get children() {
|
|
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
|
-
|
|
563
|
+
return [h(R.Label, {
|
|
564
|
+
class: "dds-field__label",
|
|
565
|
+
get children() {
|
|
566
|
+
return t.label;
|
|
567
|
+
}
|
|
568
|
+
}), h(e, {
|
|
569
|
+
get each() {
|
|
570
|
+
return t.options;
|
|
571
|
+
},
|
|
572
|
+
children: (e) => h(R.Item, {
|
|
573
|
+
get value() {
|
|
574
|
+
return e.value;
|
|
575
|
+
},
|
|
576
|
+
get disabled() {
|
|
577
|
+
return e.disabled;
|
|
578
|
+
},
|
|
579
|
+
class: "dds-check",
|
|
580
|
+
get children() {
|
|
581
|
+
return [h(R.ItemHiddenInput, {
|
|
582
|
+
class: "dds-check__input",
|
|
583
|
+
style: {},
|
|
584
|
+
ref: (t) => {
|
|
585
|
+
t.defaultChecked = n === e.value;
|
|
586
|
+
}
|
|
587
|
+
}), h(R.ItemText, { get children() {
|
|
588
|
+
return e.label;
|
|
589
|
+
} })];
|
|
590
|
+
}
|
|
591
|
+
})
|
|
592
|
+
})];
|
|
354
593
|
}
|
|
355
594
|
});
|
|
356
595
|
}
|
|
357
|
-
f(["pointerdown"]);
|
|
358
596
|
//#endregion
|
|
359
597
|
//#region src/icon.tsx
|
|
360
|
-
var
|
|
361
|
-
function
|
|
362
|
-
let [t, n] =
|
|
598
|
+
var Me = /*#__PURE__*/ O("<svg><!$><!/><g>"), Ne = /*#__PURE__*/ O("<title>");
|
|
599
|
+
function Pe(e) {
|
|
600
|
+
let [t, n] = u(e, [
|
|
363
601
|
"name",
|
|
364
602
|
"label",
|
|
365
603
|
"size",
|
|
366
604
|
"directional",
|
|
367
605
|
"class"
|
|
368
|
-
]), r = () =>
|
|
606
|
+
]), r = () => B[t.name], i = () => t.directional ?? z.mirrorInRtl.includes(t.name);
|
|
369
607
|
return (() => {
|
|
370
|
-
var e =
|
|
371
|
-
return
|
|
608
|
+
var e = v(Me), a = e.firstChild, [o, s] = y(a.nextSibling), c = o.nextSibling;
|
|
609
|
+
return D(e, C(n, {
|
|
372
610
|
get class() {
|
|
373
|
-
return
|
|
611
|
+
return q(i() && z.cssClass, t.class);
|
|
374
612
|
},
|
|
375
613
|
get viewBox() {
|
|
376
614
|
return r().viewBox;
|
|
@@ -397,19 +635,19 @@ function Y(e) {
|
|
|
397
635
|
get "aria-hidden"() {
|
|
398
636
|
return t.label ? void 0 : "true";
|
|
399
637
|
}
|
|
400
|
-
}), !0, !0),
|
|
401
|
-
var e =
|
|
638
|
+
}), !0, !0), b(e, (() => {
|
|
639
|
+
var e = S(() => !!t.label);
|
|
402
640
|
return () => e() && (() => {
|
|
403
|
-
var e =
|
|
404
|
-
return
|
|
641
|
+
var e = v(Ne);
|
|
642
|
+
return b(e, () => t.label), e;
|
|
405
643
|
})();
|
|
406
|
-
})(), o, s),
|
|
644
|
+
})(), o, s), _(() => E(c, "innerHTML", r().body)), w(), e;
|
|
407
645
|
})();
|
|
408
646
|
}
|
|
409
647
|
//#endregion
|
|
410
648
|
//#region src/status-pill.tsx
|
|
411
|
-
var
|
|
412
|
-
function
|
|
649
|
+
var Fe = /*#__PURE__*/ O("<code>"), Q = /*#__PURE__*/ O("<span>");
|
|
650
|
+
function Ie(e) {
|
|
413
651
|
let n = new Set(e.openDomains ?? []);
|
|
414
652
|
return function(r) {
|
|
415
653
|
let i = () => e.tones[r.domain]?.[r.value], a = () => e.label(r.domain, r.value, r.locale), o = () => !!(i() && a()), s = () => {
|
|
@@ -422,24 +660,24 @@ function ye(e) {
|
|
|
422
660
|
text: t
|
|
423
661
|
};
|
|
424
662
|
};
|
|
425
|
-
return
|
|
663
|
+
return h(t, {
|
|
426
664
|
get when() {
|
|
427
665
|
return o() || !n.has(r.domain);
|
|
428
666
|
},
|
|
429
667
|
get fallback() {
|
|
430
668
|
return (() => {
|
|
431
|
-
var e =
|
|
432
|
-
return
|
|
669
|
+
var e = v(Fe);
|
|
670
|
+
return b(e, () => r.value), _(() => T(e, "data-status", `${r.domain}.${r.value}`)), e;
|
|
433
671
|
})();
|
|
434
672
|
},
|
|
435
673
|
get children() {
|
|
436
674
|
return (() => {
|
|
437
675
|
let e = s();
|
|
438
676
|
return (() => {
|
|
439
|
-
var t =
|
|
440
|
-
return
|
|
677
|
+
var t = v(Q);
|
|
678
|
+
return b(t, () => e.text), _((n) => {
|
|
441
679
|
var i = e.tone === "neutral" ? "dds-badge" : `dds-badge dds-badge--${e.tone}`, a = `${r.domain}.${r.value}`, o = e.tone;
|
|
442
|
-
return i !== n.e &&
|
|
680
|
+
return i !== n.e && m(t, n.e = i), a !== n.t && T(t, "data-status", n.t = a), o !== n.a && T(t, "data-tone", n.a = o), n;
|
|
443
681
|
}, {
|
|
444
682
|
e: void 0,
|
|
445
683
|
t: void 0,
|
|
@@ -452,230 +690,261 @@ function ye(e) {
|
|
|
452
690
|
};
|
|
453
691
|
}
|
|
454
692
|
//#endregion
|
|
693
|
+
//#region src/direction.ts
|
|
694
|
+
function Le(e, t) {
|
|
695
|
+
let [n, r] = a("ltr");
|
|
696
|
+
return l(() => {
|
|
697
|
+
let t = e()?.parentElement;
|
|
698
|
+
if (!t) return;
|
|
699
|
+
let n = () => r(getComputedStyle(t).direction === "rtl" ? "rtl" : "ltr");
|
|
700
|
+
n();
|
|
701
|
+
let i = new MutationObserver(n);
|
|
702
|
+
i.observe(t.ownerDocument.documentElement, {
|
|
703
|
+
attributes: !0,
|
|
704
|
+
subtree: !0,
|
|
705
|
+
attributeFilter: ["dir"]
|
|
706
|
+
}), c(() => i.disconnect());
|
|
707
|
+
}), () => t() ?? n();
|
|
708
|
+
}
|
|
709
|
+
//#endregion
|
|
455
710
|
//#region src/tabs.tsx
|
|
456
|
-
|
|
457
|
-
let e =
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
value: () => e.value,
|
|
464
|
-
defaultValue: e.defaultValue,
|
|
465
|
-
onChange: e.onValueChange
|
|
466
|
-
}), o = [], s = {
|
|
467
|
-
value: r,
|
|
468
|
-
setValue: i,
|
|
469
|
-
orientation: e.orientation ?? "horizontal",
|
|
470
|
-
register(e) {
|
|
471
|
-
return o.push(e), () => {
|
|
472
|
-
let t = o.indexOf(e);
|
|
473
|
-
t >= 0 && o.splice(t, 1);
|
|
474
|
-
};
|
|
711
|
+
function Re(e) {
|
|
712
|
+
let t = o(), n = () => e.id ?? `dds-tabs-${t}`, r, i = Le(() => r, () => e.dir), a = e.asChild ? (t) => e.asChild(s(t({}), { ref: (e) => {
|
|
713
|
+
r = e;
|
|
714
|
+
} })) : void 0;
|
|
715
|
+
return h(U, {
|
|
716
|
+
get locale() {
|
|
717
|
+
return i() === "rtl" ? "ar" : "en";
|
|
475
718
|
},
|
|
476
|
-
tabs: () => o,
|
|
477
|
-
tabId: (e) => `${n()}-tab-${e}`,
|
|
478
|
-
panelId: (e) => `${n()}-panel-${e}`
|
|
479
|
-
};
|
|
480
|
-
return d(Z.Provider, {
|
|
481
|
-
value: s,
|
|
482
719
|
get children() {
|
|
483
|
-
return
|
|
720
|
+
return h(V.Root, C({
|
|
721
|
+
ref(e) {
|
|
722
|
+
var t = r;
|
|
723
|
+
typeof t == "function" ? t(e) : r = e;
|
|
724
|
+
},
|
|
725
|
+
get id() {
|
|
726
|
+
return n();
|
|
727
|
+
},
|
|
728
|
+
get value() {
|
|
729
|
+
return e.value;
|
|
730
|
+
},
|
|
731
|
+
get defaultValue() {
|
|
732
|
+
return e.defaultValue;
|
|
733
|
+
},
|
|
734
|
+
get orientation() {
|
|
735
|
+
return e.orientation ?? "horizontal";
|
|
736
|
+
},
|
|
737
|
+
get activationMode() {
|
|
738
|
+
return e.activationMode ?? "automatic";
|
|
739
|
+
},
|
|
740
|
+
onValueChange: (t) => e.onValueChange?.(t.value),
|
|
741
|
+
lazyMount: !1,
|
|
742
|
+
unmountOnExit: !1,
|
|
743
|
+
get class() {
|
|
744
|
+
return e.unstyled ? void 0 : "dds-tabs-root";
|
|
745
|
+
}
|
|
746
|
+
}, a ? { asChild: a } : {}, {
|
|
747
|
+
ids: {
|
|
748
|
+
trigger: (t) => e.tabId?.(t) ?? `${n()}-tab-${t}`,
|
|
749
|
+
content: (t) => e.panelId?.(t) ?? `${n()}-panel-${t}`
|
|
750
|
+
},
|
|
751
|
+
get children() {
|
|
752
|
+
return e.children;
|
|
753
|
+
}
|
|
754
|
+
}));
|
|
484
755
|
}
|
|
485
756
|
});
|
|
486
757
|
}
|
|
487
|
-
function
|
|
488
|
-
let t
|
|
758
|
+
function ze(e) {
|
|
759
|
+
let [t, n] = u(e, [
|
|
489
760
|
"class",
|
|
490
761
|
"children",
|
|
491
|
-
"
|
|
492
|
-
])
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
else if (e.key === "ArrowDown" && t.orientation === "vertical") a = (i + 1) % r.length;
|
|
502
|
-
else if (e.key === "ArrowUp" && t.orientation === "vertical") a = (i - 1 + r.length) % r.length;
|
|
503
|
-
else return;
|
|
504
|
-
e.preventDefault();
|
|
505
|
-
let s = r[a];
|
|
506
|
-
s && (s.element.focus(), t.setValue(s.value));
|
|
507
|
-
};
|
|
508
|
-
return (() => {
|
|
509
|
-
var e = m(X);
|
|
510
|
-
return S(e, v(r, {
|
|
511
|
-
get class() {
|
|
512
|
-
return O("dds-tabs", n.class);
|
|
513
|
-
},
|
|
514
|
-
role: "tablist",
|
|
515
|
-
get "aria-orientation"() {
|
|
516
|
-
return t.orientation;
|
|
517
|
-
},
|
|
518
|
-
onKeyDown: i
|
|
519
|
-
}), !1, !0), g(e, () => n.children), y(), e;
|
|
520
|
-
})();
|
|
762
|
+
"unstyled"
|
|
763
|
+
]);
|
|
764
|
+
return h(V.List, C(n, {
|
|
765
|
+
get class() {
|
|
766
|
+
return q(!t.unstyled && "dds-tabs", t.class);
|
|
767
|
+
},
|
|
768
|
+
get children() {
|
|
769
|
+
return t.children;
|
|
770
|
+
}
|
|
771
|
+
}));
|
|
521
772
|
}
|
|
522
|
-
function
|
|
523
|
-
let t
|
|
524
|
-
"value",
|
|
773
|
+
function Be(e) {
|
|
774
|
+
let [t, n] = u(e, [
|
|
525
775
|
"class",
|
|
526
776
|
"children",
|
|
527
|
-
"
|
|
528
|
-
"
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
return
|
|
540
|
-
|
|
541
|
-
return t.tabId(n.value);
|
|
542
|
-
},
|
|
543
|
-
type: "button",
|
|
544
|
-
role: "tab",
|
|
545
|
-
get class() {
|
|
546
|
-
return O("dds-tab", n.class);
|
|
547
|
-
},
|
|
548
|
-
get "aria-selected"() {
|
|
549
|
-
return t.value() === n.value;
|
|
550
|
-
},
|
|
551
|
-
get "aria-controls"() {
|
|
552
|
-
return t.panelId(n.value);
|
|
553
|
-
},
|
|
554
|
-
get tabindex() {
|
|
555
|
-
return t.value() === n.value ? 0 : -1;
|
|
556
|
-
},
|
|
557
|
-
get disabled() {
|
|
558
|
-
return n.disabled;
|
|
559
|
-
},
|
|
560
|
-
onClick: (e) => {
|
|
561
|
-
typeof n.onClick == "function" && n.onClick(e), e.defaultPrevented || t.setValue(n.value);
|
|
562
|
-
}
|
|
563
|
-
}), !1, !0), g(e, () => n.children), y(), e;
|
|
564
|
-
})();
|
|
777
|
+
"value",
|
|
778
|
+
"unstyled",
|
|
779
|
+
"asChild"
|
|
780
|
+
]), r = t.asChild ? (n) => t.asChild(s(n({}), { ref: e.ref })) : void 0;
|
|
781
|
+
return h(V.Trigger, C(n, {
|
|
782
|
+
get value() {
|
|
783
|
+
return t.value;
|
|
784
|
+
},
|
|
785
|
+
get class() {
|
|
786
|
+
return q(!t.unstyled && "dds-tab", t.class);
|
|
787
|
+
}
|
|
788
|
+
}, r ? { asChild: r } : {}, { get children() {
|
|
789
|
+
return t.children;
|
|
790
|
+
} }));
|
|
565
791
|
}
|
|
566
|
-
function
|
|
567
|
-
let t
|
|
792
|
+
function Ve(e) {
|
|
793
|
+
let [t, n] = u(e, [
|
|
568
794
|
"value",
|
|
569
|
-
"
|
|
570
|
-
"
|
|
571
|
-
]);
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
795
|
+
"children",
|
|
796
|
+
"style"
|
|
797
|
+
]), r = H(), i = () => r().value !== t.value, a = () => i() ? typeof t.style == "string" ? `${t.style.replace(/;+\s*$/, "")};display:none;` : {
|
|
798
|
+
...t.style,
|
|
799
|
+
display: "none"
|
|
800
|
+
} : t.style;
|
|
801
|
+
return h(V.Content, C(n, {
|
|
802
|
+
get value() {
|
|
803
|
+
return t.value;
|
|
804
|
+
},
|
|
805
|
+
get style() {
|
|
806
|
+
return a();
|
|
807
|
+
},
|
|
808
|
+
get hidden() {
|
|
809
|
+
return i();
|
|
810
|
+
},
|
|
811
|
+
get inert() {
|
|
812
|
+
return i();
|
|
813
|
+
},
|
|
814
|
+
get children() {
|
|
815
|
+
return t.children;
|
|
816
|
+
}
|
|
817
|
+
}));
|
|
591
818
|
}
|
|
592
819
|
//#endregion
|
|
593
820
|
//#region src/toast.tsx
|
|
594
|
-
var
|
|
595
|
-
function
|
|
596
|
-
let
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
821
|
+
var $ = n();
|
|
822
|
+
function He(e) {
|
|
823
|
+
let t = o(), n, r, i = () => r ??= new Proxy(n?.ownerDocument ?? document, { get(e, t) {
|
|
824
|
+
if (t === "getElementById") return (t) => t === "toast-group:bottom-end" ? n ?? null : e.getElementById(t);
|
|
825
|
+
let r = Reflect.get(e, t, e);
|
|
826
|
+
return typeof r == "function" ? r.bind(e) : r;
|
|
827
|
+
} }), a = te({
|
|
828
|
+
placement: "bottom-end",
|
|
829
|
+
overlap: !1,
|
|
830
|
+
gap: ne[8],
|
|
831
|
+
offsets: "var(--dds-space-16)",
|
|
832
|
+
removeDelay: 0,
|
|
833
|
+
hotkey: ["DDS_NO_HOTKEY"],
|
|
834
|
+
max: 2 ** 53 - 1,
|
|
835
|
+
pauseOnPageIdle: !0
|
|
836
|
+
}), s = 0, l = {
|
|
837
|
+
show(n) {
|
|
838
|
+
let r = `dds-toast-${t}-${++s}`, i = n.duration ?? e.defaultDuration ?? 5e3;
|
|
839
|
+
return a.create({
|
|
840
|
+
id: r,
|
|
841
|
+
description: n.message,
|
|
842
|
+
type: n.tone === "danger" ? "error" : n.tone ?? "info",
|
|
843
|
+
duration: i > 0 ? i : Infinity,
|
|
844
|
+
meta: { dds: {
|
|
845
|
+
...n,
|
|
846
|
+
id: r
|
|
847
|
+
} }
|
|
848
|
+
}), r;
|
|
608
849
|
},
|
|
609
|
-
dismiss:
|
|
610
|
-
clear()
|
|
611
|
-
for (let e of a.values()) clearTimeout(e);
|
|
612
|
-
a.clear(), r([]);
|
|
613
|
-
}
|
|
850
|
+
dismiss: (e) => a.remove(e),
|
|
851
|
+
clear: () => a.remove()
|
|
614
852
|
};
|
|
615
|
-
return
|
|
853
|
+
return c(l.clear), h($.Provider, {
|
|
616
854
|
value: l,
|
|
617
855
|
get children() {
|
|
618
|
-
return [
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
856
|
+
return [S(() => e.children), h(ee, {
|
|
857
|
+
toaster: a,
|
|
858
|
+
ref(e) {
|
|
859
|
+
var t = n;
|
|
860
|
+
typeof t == "function" ? t(e) : n = e;
|
|
861
|
+
},
|
|
862
|
+
getRootNode: i,
|
|
863
|
+
id: `dds-toast-region-${t}`,
|
|
864
|
+
get class() {
|
|
865
|
+
return q("dds-toast-region", e.class);
|
|
866
|
+
},
|
|
867
|
+
get role() {
|
|
868
|
+
return e.regionLabel ? "region" : "presentation";
|
|
869
|
+
},
|
|
870
|
+
get "aria-label"() {
|
|
871
|
+
return e.regionLabel ?? "";
|
|
872
|
+
},
|
|
873
|
+
children: (t) => {
|
|
874
|
+
let n = () => t().meta?.dds;
|
|
875
|
+
return h(W.Root, {
|
|
876
|
+
get class() {
|
|
877
|
+
return q("dds-toast", `dds-toast--${n().tone ?? "info"}`);
|
|
878
|
+
},
|
|
879
|
+
get role() {
|
|
880
|
+
return n().tone === "danger" ? "alert" : "status";
|
|
881
|
+
},
|
|
882
|
+
get children() {
|
|
883
|
+
return [h(W.Description, { get children() {
|
|
884
|
+
return t().description;
|
|
885
|
+
} }), S(() => S(() => !!e.dismissLabel)() && h(W.CloseTrigger, {
|
|
886
|
+
class: "dds-iconbtn dds-iconbtn--sm",
|
|
887
|
+
get "aria-label"() {
|
|
888
|
+
return S(() => typeof e.dismissLabel == "function")() ? e.dismissLabel(n()) : e.dismissLabel;
|
|
889
|
+
},
|
|
890
|
+
children: "×"
|
|
891
|
+
}))];
|
|
892
|
+
}
|
|
893
|
+
});
|
|
894
|
+
}
|
|
895
|
+
})];
|
|
642
896
|
}
|
|
643
897
|
});
|
|
644
898
|
}
|
|
645
|
-
function
|
|
646
|
-
let e =
|
|
899
|
+
function Ue() {
|
|
900
|
+
let e = d($);
|
|
647
901
|
if (!e) throw Error("useToast must be called inside <ToastProvider>");
|
|
648
902
|
return e;
|
|
649
903
|
}
|
|
650
|
-
f(["click"]);
|
|
651
904
|
//#endregion
|
|
652
905
|
//#region src/tooltip.tsx
|
|
653
|
-
var
|
|
654
|
-
function
|
|
655
|
-
let t =
|
|
906
|
+
var We = /*#__PURE__*/ O("<span><!$><!/><!$><!/>");
|
|
907
|
+
function Ge(e) {
|
|
908
|
+
let t = o(), n = () => e.id ?? `dds-tooltip-${t}`, [r, i] = K({
|
|
656
909
|
value: () => e.open,
|
|
657
910
|
defaultValue: e.defaultOpen ?? !1,
|
|
658
|
-
onChange: e.onOpenChange
|
|
659
|
-
}),
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
t:
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
911
|
+
onChange: (t) => e.onOpenChange?.(t)
|
|
912
|
+
}), a = re(() => ({
|
|
913
|
+
id: n(),
|
|
914
|
+
ids: { content: n() },
|
|
915
|
+
open: r(),
|
|
916
|
+
onOpenChange: (e) => i(e.open),
|
|
917
|
+
openDelay: 0,
|
|
918
|
+
closeDelay: 0
|
|
919
|
+
}));
|
|
920
|
+
return h(G.RootProvider, {
|
|
921
|
+
value: a,
|
|
922
|
+
lazyMount: !1,
|
|
923
|
+
unmountOnExit: !1,
|
|
924
|
+
get children() {
|
|
925
|
+
var t = v(We), r = t.firstChild, [i, o] = y(r.nextSibling), s = i.nextSibling, [c, l] = y(s.nextSibling);
|
|
926
|
+
return b(t, h(G.Trigger, { asChild: (t) => {
|
|
927
|
+
let [, r] = u(t(), ["onFocusIn", "onFocusOut"]);
|
|
928
|
+
return e.children({
|
|
929
|
+
...r,
|
|
930
|
+
"aria-describedby": n(),
|
|
931
|
+
onFocus: () => a().setOpen(!0),
|
|
932
|
+
onBlur: () => a().setOpen(!1),
|
|
933
|
+
onPointerEnter: () => a().setOpen(!0),
|
|
934
|
+
onPointerLeave: () => a().setOpen(!1)
|
|
935
|
+
});
|
|
936
|
+
} }), i, o), b(t, h(G.Positioner, { get children() {
|
|
937
|
+
return h(G.Content, {
|
|
938
|
+
class: "dds-tooltip__bubble",
|
|
939
|
+
get children() {
|
|
940
|
+
return e.content;
|
|
941
|
+
}
|
|
942
|
+
});
|
|
943
|
+
} }), c, l), _(() => m(t, q("dds-tooltip", e.class))), t;
|
|
944
|
+
}
|
|
945
|
+
});
|
|
677
946
|
}
|
|
678
947
|
//#endregion
|
|
679
|
-
export {
|
|
948
|
+
export { le as Button, me as Checkbox, Oe as ConsoleShell, Ae as Dialog, de as Field, Pe as Icon, ue as IconButton, he as Radio, je as RadioGroup, fe as Select, ge as Switch, Be as Tab, ze as TabList, Ve as TabPanel, Re as Tabs, He as ToastProvider, Ge as Tooltip, K as createControllableSignal, Ie as createStatusPill, Ue as useToast };
|
|
680
949
|
|
|
681
950
|
//# sourceMappingURL=index.js.map
|