@devslab/dds-solid 0.22.0 → 0.23.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 +34 -0
- package/README.md +32 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +171 -143
- package/dist/index.js.map +1 -1
- package/dist/pending-action.d.ts +36 -0
- package/dist/pending-action.d.ts.map +1 -0
- package/dist/server.js +42 -2
- package/dist/server.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -7,117 +7,117 @@ import { SelectPicker as p } from "./select-picker.js";
|
|
|
7
7
|
import { DropdownMenu as m } from "./dropdown-menu.js";
|
|
8
8
|
import { Popover as h } from "./popover.js";
|
|
9
9
|
import { Calendar as g } from "./calendar.js";
|
|
10
|
-
import { For as _, Show as v, createContext as y, createEffect as b, createMemo as x, createSignal as S, createUniqueId as C,
|
|
11
|
-
import { Dynamic as
|
|
12
|
-
import { Dialog as K, useDialog as
|
|
13
|
-
import { usePresenceContext as
|
|
14
|
-
import { FocusTrap as
|
|
15
|
-
import { ariaHidden as
|
|
10
|
+
import { For as _, Show as v, createContext as y, createEffect as b, createMemo as x, createSignal as S, createUniqueId as C, getOwner as w, mergeProps as T, onCleanup as E, onMount as D, splitProps as O, useContext as k } from "solid-js";
|
|
11
|
+
import { Dynamic as A, Portal as j, className as M, createComponent as N, delegateEvents as P, effect as F, getNextElement as I, getNextMarker as L, insert as R, isServer as z, memo as B, mergeProps as V, runHydrationEvents as H, setAttribute as U, setProperty as W, spread as ee, template as G } from "solid-js/web";
|
|
12
|
+
import { Dialog as K, useDialog as te } from "@ark-ui/solid/dialog";
|
|
13
|
+
import { usePresenceContext as ne } from "@ark-ui/solid/presence";
|
|
14
|
+
import { FocusTrap as re } from "@zag-js/focus-trap";
|
|
15
|
+
import { ariaHidden as ie } from "@zag-js/aria-hidden";
|
|
16
16
|
import { RadioGroup as q } from "@ark-ui/solid/radio-group";
|
|
17
|
-
import { directionPolicy as J, icons as
|
|
18
|
-
import { Tabs as Y, useTabsContext as
|
|
19
|
-
import { LocaleProvider as
|
|
20
|
-
import { Toast as X, Toaster as
|
|
21
|
-
import { space as
|
|
22
|
-
import { Tooltip as Z, useTooltip as
|
|
17
|
+
import { directionPolicy as J, icons as ae } from "@devslab/dds-icons";
|
|
18
|
+
import { Tabs as Y, useTabsContext as oe } from "@ark-ui/solid/tabs";
|
|
19
|
+
import { LocaleProvider as se } from "@ark-ui/solid/locale";
|
|
20
|
+
import { Toast as X, Toaster as ce, createToaster as le } from "@ark-ui/solid/toast";
|
|
21
|
+
import { space as ue } from "@devslab/dds-tokens";
|
|
22
|
+
import { Tooltip as Z, useTooltip as de } from "@ark-ui/solid/tooltip";
|
|
23
23
|
//#region src/console-shell.tsx
|
|
24
|
-
var
|
|
25
|
-
function
|
|
24
|
+
var fe = /*#__PURE__*/ G("<dl class=dds-console-rail__context>"), pe = /*#__PURE__*/ G("<div class=dds-console-rail__foot>"), me = /*#__PURE__*/ G("<p class=dds-console-page-eyebrow>"), he = /*#__PURE__*/ G("<div class=dds-console-page-header__actions>"), ge = /*#__PURE__*/ G("<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><!$><!/>"), _e = /*#__PURE__*/ G("<div><dt></dt><dd>"), ve = /*#__PURE__*/ G("<section class=dds-console-rail__group><h2 class=dds-console-rail__group-label></h2><ul>"), ye = /*#__PURE__*/ G("<span class=dds-console-rail__badge>"), be = /*#__PURE__*/ G("<li><a class=dds-console-rail__item><span></span><!$><!/>");
|
|
25
|
+
function xe(e, t, n) {
|
|
26
26
|
return n === void 0 ? t.split("/").filter(Boolean).length <= 1 ? e === t : e === t || e.startsWith(`${t}/`) : n;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function Se(e, t) {
|
|
29
29
|
return e.replace("{count}", () => String(t));
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function Ce(e) {
|
|
32
32
|
let [t, n] = S(!1), r = () => n(!1), [i, a] = S(!1);
|
|
33
|
-
return
|
|
33
|
+
return D(() => {
|
|
34
34
|
a(!0);
|
|
35
35
|
let e = (e) => {
|
|
36
36
|
e.key === "Escape" && r();
|
|
37
37
|
};
|
|
38
|
-
document.addEventListener("keydown", e),
|
|
38
|
+
document.addEventListener("keydown", e), E(() => document.removeEventListener("keydown", e));
|
|
39
39
|
}), (() => {
|
|
40
|
-
var a =
|
|
41
|
-
return
|
|
42
|
-
var n =
|
|
40
|
+
var a = I(ge), o = a.firstChild, s = o.nextSibling, c = s.firstChild.nextSibling, l = s.nextSibling, u = l.nextSibling, d = u.firstChild, f = d.firstChild, p = f.nextSibling, m = d.nextSibling, [h, g] = L(m.nextSibling), y = h.nextSibling, b = y.nextSibling, [x, S] = L(b.nextSibling), w = u.nextSibling, T = w.firstChild, E = T.firstChild, D = E.firstChild, [O, k] = L(D.nextSibling), A = O.nextSibling, j = E.nextSibling, [M, P] = L(j.nextSibling), z = T.nextSibling, [V, W] = L(z.nextSibling);
|
|
41
|
+
return R(o, () => e.labels.skip), s.$$click = () => n(!t()), R(c, (() => {
|
|
42
|
+
var n = B(() => !!t());
|
|
43
43
|
return () => n() ? e.labels.menuClose : e.labels.menuOpen;
|
|
44
|
-
})()), l.$$click = r,
|
|
44
|
+
})()), l.$$click = r, R(p, () => e.brand.name), R(u, N(v, {
|
|
45
45
|
get when() {
|
|
46
|
-
return
|
|
46
|
+
return B(() => !!e.context)() && e.context.length > 0;
|
|
47
47
|
},
|
|
48
48
|
get children() {
|
|
49
|
-
var t =
|
|
50
|
-
return
|
|
49
|
+
var t = I(fe);
|
|
50
|
+
return R(t, N(_, {
|
|
51
51
|
get each() {
|
|
52
52
|
return e.context;
|
|
53
53
|
},
|
|
54
54
|
children: (e) => (() => {
|
|
55
|
-
var t =
|
|
56
|
-
return
|
|
55
|
+
var t = I(_e), n = t.firstChild, r = n.nextSibling;
|
|
56
|
+
return R(n, () => e.label), R(r, () => e.value), t;
|
|
57
57
|
})()
|
|
58
58
|
})), t;
|
|
59
59
|
}
|
|
60
|
-
}), h, g),
|
|
60
|
+
}), h, g), R(y, N(_, {
|
|
61
61
|
get each() {
|
|
62
62
|
return e.nav;
|
|
63
63
|
},
|
|
64
64
|
children: (t) => {
|
|
65
65
|
let n = `dds-console-group-${C()}`;
|
|
66
66
|
return (() => {
|
|
67
|
-
var i =
|
|
68
|
-
return
|
|
67
|
+
var i = I(ve), a = i.firstChild, o = a.nextSibling;
|
|
68
|
+
return U(i, "aria-labelledby", n), U(a, "id", n), R(a, () => t.label), R(o, N(_, {
|
|
69
69
|
get each() {
|
|
70
70
|
return t.items;
|
|
71
71
|
},
|
|
72
72
|
children: (t) => (() => {
|
|
73
|
-
var n =
|
|
74
|
-
return i.$$click = r,
|
|
73
|
+
var n = I(be), i = n.firstChild, a = i.firstChild, o = a.nextSibling, [s, c] = L(o.nextSibling);
|
|
74
|
+
return i.$$click = r, R(a, () => t.label), R(i, N(v, {
|
|
75
75
|
get when() {
|
|
76
|
-
return
|
|
76
|
+
return B(() => t.badge !== void 0)() && t.badge > 0;
|
|
77
77
|
},
|
|
78
78
|
get children() {
|
|
79
|
-
var n =
|
|
80
|
-
return
|
|
79
|
+
var n = I(ye);
|
|
80
|
+
return R(n, () => t.badge), F(() => U(n, "aria-label", Se(e.labels.badge, t.badge))), n;
|
|
81
81
|
}
|
|
82
|
-
}), s, c),
|
|
83
|
-
var r = `${e.surface}.${t.id}`, a = t.href, o =
|
|
84
|
-
return r !== n.e &&
|
|
82
|
+
}), s, c), F((n) => {
|
|
83
|
+
var r = `${e.surface}.${t.id}`, a = t.href, o = xe(e.activePath, t.href, t.active) ? "page" : void 0;
|
|
84
|
+
return r !== n.e && U(i, "data-nav", n.e = r), a !== n.t && U(i, "href", n.t = a), o !== n.a && U(i, "aria-current", n.a = o), n;
|
|
85
85
|
}, {
|
|
86
86
|
e: void 0,
|
|
87
87
|
t: void 0,
|
|
88
88
|
a: void 0
|
|
89
|
-
}),
|
|
89
|
+
}), H(), n;
|
|
90
90
|
})()
|
|
91
91
|
})), i;
|
|
92
92
|
})();
|
|
93
93
|
}
|
|
94
|
-
})),
|
|
94
|
+
})), R(u, N(v, {
|
|
95
95
|
get when() {
|
|
96
96
|
return e.foot;
|
|
97
97
|
},
|
|
98
98
|
get children() {
|
|
99
|
-
var t =
|
|
100
|
-
return
|
|
99
|
+
var t = I(pe);
|
|
100
|
+
return R(t, () => e.foot), t;
|
|
101
101
|
}
|
|
102
|
-
}), x, S),
|
|
102
|
+
}), x, S), R(E, N(v, {
|
|
103
103
|
get when() {
|
|
104
104
|
return e.header.eyebrow;
|
|
105
105
|
},
|
|
106
106
|
get children() {
|
|
107
|
-
var t =
|
|
108
|
-
return
|
|
107
|
+
var t = I(me);
|
|
108
|
+
return R(t, () => e.header.eyebrow), t;
|
|
109
109
|
}
|
|
110
|
-
}), O, k),
|
|
110
|
+
}), O, k), R(A, () => e.header.title), R(T, N(v, {
|
|
111
111
|
get when() {
|
|
112
112
|
return e.header.actions;
|
|
113
113
|
},
|
|
114
114
|
get children() {
|
|
115
|
-
var t =
|
|
116
|
-
return
|
|
115
|
+
var t = I(he);
|
|
116
|
+
return R(t, () => e.header.actions), t;
|
|
117
117
|
}
|
|
118
|
-
}),
|
|
118
|
+
}), M, P), R(w, () => e.children, V, W), F((n) => {
|
|
119
119
|
var r = e.surface, o = i() ? "true" : void 0, c = t(), p = t() ? "true" : "false", m = t() ? "true" : "false", h = e.brand.href, g = e.brand.mark, _ = e.labels.nav;
|
|
120
|
-
return r !== n.e &&
|
|
120
|
+
return r !== n.e && U(a, "data-surface", n.e = r), o !== n.t && U(a, "data-hydrated", n.t = o), c !== n.a && U(s, "aria-expanded", n.a = c), p !== n.o && U(l, "data-open", n.o = p), m !== n.i && U(u, "data-open", n.i = m), h !== n.n && U(d, "href", n.n = h), g !== n.s && U(f, "src", n.s = g), _ !== n.h && U(y, "aria-label", n.h = _), n;
|
|
121
121
|
}, {
|
|
122
122
|
e: void 0,
|
|
123
123
|
t: void 0,
|
|
@@ -127,13 +127,13 @@ function Se(e) {
|
|
|
127
127
|
n: void 0,
|
|
128
128
|
s: void 0,
|
|
129
129
|
h: void 0
|
|
130
|
-
}),
|
|
130
|
+
}), H(), a;
|
|
131
131
|
})();
|
|
132
132
|
}
|
|
133
|
-
|
|
133
|
+
P(["click"]);
|
|
134
134
|
//#endregion
|
|
135
135
|
//#region src/dialog.tsx
|
|
136
|
-
var
|
|
136
|
+
var we = /*#__PURE__*/ G("<div>");
|
|
137
137
|
[
|
|
138
138
|
"a[href]",
|
|
139
139
|
"button:not([disabled])",
|
|
@@ -142,8 +142,8 @@ var Ce = /*#__PURE__*/ G("<div>");
|
|
|
142
142
|
"textarea:not([disabled])",
|
|
143
143
|
"[tabindex]:not([tabindex='-1'])"
|
|
144
144
|
].join(",");
|
|
145
|
-
function
|
|
146
|
-
let t = C(), n = () => e.id ?? `dds-dialog-${t}`, [r, i] = S(), a =
|
|
145
|
+
function Te(e) {
|
|
146
|
+
let t = C(), n = () => e.id ?? `dds-dialog-${t}`, [r, i] = S(), a = te(() => ({
|
|
147
147
|
id: n(),
|
|
148
148
|
open: e.open,
|
|
149
149
|
defaultOpen: e.defaultOpen,
|
|
@@ -158,7 +158,7 @@ function we(e) {
|
|
|
158
158
|
trapFocus: !e.additionalFocusContainers,
|
|
159
159
|
preventScroll: !0,
|
|
160
160
|
role: e.role ?? "dialog",
|
|
161
|
-
persistentElements:
|
|
161
|
+
persistentElements: z ? [] : e.additionalFocusContainers?.().filter((e) => !!e).map((e) => () => e),
|
|
162
162
|
ids: {
|
|
163
163
|
content: n(),
|
|
164
164
|
title: `${n()}-title`,
|
|
@@ -169,7 +169,7 @@ function we(e) {
|
|
|
169
169
|
let t = r();
|
|
170
170
|
if (!o() || !e.additionalFocusContainers || !t) return;
|
|
171
171
|
let n = t.ownerDocument.activeElement, i, a, [s, c] = S(!1), l = () => [t, ...e.additionalFocusContainers().filter((e) => !!(e?.isConnected && e.ownerDocument === t.ownerDocument))], u = t.ownerDocument.defaultView.requestAnimationFrame(() => {
|
|
172
|
-
i = new
|
|
172
|
+
i = new re(l(), {
|
|
173
173
|
document: t.ownerDocument,
|
|
174
174
|
escapeDeactivates: !1,
|
|
175
175
|
allowOutsideClick: !0,
|
|
@@ -184,23 +184,23 @@ function we(e) {
|
|
|
184
184
|
b(() => {
|
|
185
185
|
if (!s()) return;
|
|
186
186
|
let e = l();
|
|
187
|
-
i.updateContainerElements(e), a?.(), a =
|
|
188
|
-
}),
|
|
187
|
+
i.updateContainerElements(e), a?.(), a = ie(e, { defer: !1 });
|
|
188
|
+
}), E(() => {
|
|
189
189
|
t.ownerDocument.defaultView.cancelAnimationFrame(u), a?.(), i?.deactivate({ returnFocus: e.restoreFocus !== !1 });
|
|
190
190
|
});
|
|
191
191
|
});
|
|
192
192
|
let s = (t, n) => c(e.unstyled ? void 0 : t, n), l = () => {
|
|
193
|
-
let t =
|
|
193
|
+
let t = ne(), r = (n) => N(A, V({ get component() {
|
|
194
194
|
return e.contentAs ?? "div";
|
|
195
195
|
} }, () => n({}), { ref: (e) => {
|
|
196
196
|
t().ref(e), i(e);
|
|
197
197
|
} }));
|
|
198
|
-
return
|
|
198
|
+
return N(K.Positioner, {
|
|
199
199
|
get class() {
|
|
200
200
|
return s("dds-dialog-overlay", e.overlayClass);
|
|
201
201
|
},
|
|
202
202
|
get children() {
|
|
203
|
-
return
|
|
203
|
+
return N(K.Content, V(() => e.contentProps, {
|
|
204
204
|
ref: i,
|
|
205
205
|
get class() {
|
|
206
206
|
return s("dds-dialog", e.class);
|
|
@@ -211,13 +211,13 @@ function we(e) {
|
|
|
211
211
|
},
|
|
212
212
|
"aria-modal": "true",
|
|
213
213
|
get "aria-describedby"() {
|
|
214
|
-
return
|
|
214
|
+
return B(() => !!e.description)() ? `${n()}-description` : void 0;
|
|
215
215
|
},
|
|
216
216
|
get children() {
|
|
217
217
|
return (() => {
|
|
218
218
|
let t = {
|
|
219
219
|
get title() {
|
|
220
|
-
return
|
|
220
|
+
return N(K.Title, {
|
|
221
221
|
get class() {
|
|
222
222
|
return s("dds-dialog__title", e.titleClass);
|
|
223
223
|
},
|
|
@@ -227,7 +227,7 @@ function we(e) {
|
|
|
227
227
|
});
|
|
228
228
|
},
|
|
229
229
|
get description() {
|
|
230
|
-
return e.description &&
|
|
230
|
+
return e.description && N(K.Description, {
|
|
231
231
|
get class() {
|
|
232
232
|
return s("dds-dialog__body", e.descriptionClass);
|
|
233
233
|
},
|
|
@@ -241,16 +241,16 @@ function we(e) {
|
|
|
241
241
|
},
|
|
242
242
|
get actions() {
|
|
243
243
|
return e.actions && (() => {
|
|
244
|
-
var t =
|
|
245
|
-
return
|
|
244
|
+
var t = I(we);
|
|
245
|
+
return R(t, () => e.actions), F(() => M(t, s("dds-dialog__actions", e.actionsClass))), t;
|
|
246
246
|
})();
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
249
|
return e.frame ? e.frame(t) : [
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
250
|
+
B(() => t.title),
|
|
251
|
+
B(() => t.description),
|
|
252
|
+
B(() => t.children),
|
|
253
|
+
B(() => t.actions)
|
|
254
254
|
];
|
|
255
255
|
})();
|
|
256
256
|
}
|
|
@@ -258,21 +258,21 @@ function we(e) {
|
|
|
258
258
|
}
|
|
259
259
|
});
|
|
260
260
|
};
|
|
261
|
-
return
|
|
261
|
+
return N(K.RootProvider, {
|
|
262
262
|
value: a,
|
|
263
263
|
lazyMount: !0,
|
|
264
264
|
unmountOnExit: !0,
|
|
265
265
|
get children() {
|
|
266
|
-
return
|
|
266
|
+
return N(v, {
|
|
267
267
|
get when() {
|
|
268
268
|
return e.portal;
|
|
269
269
|
},
|
|
270
270
|
get fallback() {
|
|
271
|
-
return
|
|
271
|
+
return N(l, {});
|
|
272
272
|
},
|
|
273
273
|
get children() {
|
|
274
|
-
return
|
|
275
|
-
return
|
|
274
|
+
return N(j, V(() => e.portalMount ? { mount: e.portalMount } : {}, { get children() {
|
|
275
|
+
return N(l, {});
|
|
276
276
|
} }));
|
|
277
277
|
}
|
|
278
278
|
});
|
|
@@ -281,9 +281,9 @@ function we(e) {
|
|
|
281
281
|
}
|
|
282
282
|
//#endregion
|
|
283
283
|
//#region src/radio-group.tsx
|
|
284
|
-
function
|
|
284
|
+
function Ee(e) {
|
|
285
285
|
let t = e.value ?? e.defaultValue;
|
|
286
|
-
return
|
|
286
|
+
return N(q.Root, {
|
|
287
287
|
get value() {
|
|
288
288
|
return e.value;
|
|
289
289
|
},
|
|
@@ -309,16 +309,16 @@ function Te(e) {
|
|
|
309
309
|
return c("dds-radio-group", e.class);
|
|
310
310
|
},
|
|
311
311
|
get children() {
|
|
312
|
-
return [
|
|
312
|
+
return [N(q.Label, {
|
|
313
313
|
class: "dds-field__label",
|
|
314
314
|
get children() {
|
|
315
315
|
return e.label;
|
|
316
316
|
}
|
|
317
|
-
}),
|
|
317
|
+
}), N(_, {
|
|
318
318
|
get each() {
|
|
319
319
|
return e.options;
|
|
320
320
|
},
|
|
321
|
-
children: (e) =>
|
|
321
|
+
children: (e) => N(q.Item, {
|
|
322
322
|
get value() {
|
|
323
323
|
return e.value;
|
|
324
324
|
},
|
|
@@ -327,13 +327,13 @@ function Te(e) {
|
|
|
327
327
|
},
|
|
328
328
|
class: "dds-check",
|
|
329
329
|
get children() {
|
|
330
|
-
return [
|
|
330
|
+
return [N(q.ItemHiddenInput, {
|
|
331
331
|
class: "dds-check__input",
|
|
332
332
|
style: {},
|
|
333
333
|
ref: (n) => {
|
|
334
334
|
n.defaultChecked = t === e.value;
|
|
335
335
|
}
|
|
336
|
-
}),
|
|
336
|
+
}), N(q.ItemText, { get children() {
|
|
337
337
|
return e.label;
|
|
338
338
|
} })];
|
|
339
339
|
}
|
|
@@ -344,18 +344,18 @@ function Te(e) {
|
|
|
344
344
|
}
|
|
345
345
|
//#endregion
|
|
346
346
|
//#region src/icon.tsx
|
|
347
|
-
var
|
|
348
|
-
function
|
|
349
|
-
let [t, n] =
|
|
347
|
+
var De = /*#__PURE__*/ G("<svg><!$><!/><g>"), Oe = /*#__PURE__*/ G("<title>");
|
|
348
|
+
function ke(e) {
|
|
349
|
+
let [t, n] = O(e, [
|
|
350
350
|
"name",
|
|
351
351
|
"label",
|
|
352
352
|
"size",
|
|
353
353
|
"directional",
|
|
354
354
|
"class"
|
|
355
|
-
]), r = () =>
|
|
355
|
+
]), r = () => ae[t.name], i = () => t.directional ?? J.mirrorInRtl.includes(t.name);
|
|
356
356
|
return (() => {
|
|
357
|
-
var e =
|
|
358
|
-
return
|
|
357
|
+
var e = I(De), a = e.firstChild, [o, s] = L(a.nextSibling), l = o.nextSibling;
|
|
358
|
+
return ee(e, V(n, {
|
|
359
359
|
get class() {
|
|
360
360
|
return c(i() && J.cssClass, t.class);
|
|
361
361
|
},
|
|
@@ -384,19 +384,47 @@ function Oe(e) {
|
|
|
384
384
|
get "aria-hidden"() {
|
|
385
385
|
return t.label ? void 0 : "true";
|
|
386
386
|
}
|
|
387
|
-
}), !0, !0),
|
|
388
|
-
var e =
|
|
387
|
+
}), !0, !0), R(e, (() => {
|
|
388
|
+
var e = B(() => !!t.label);
|
|
389
389
|
return () => e() && (() => {
|
|
390
|
-
var e =
|
|
391
|
-
return
|
|
390
|
+
var e = I(Oe);
|
|
391
|
+
return R(e, () => t.label), e;
|
|
392
392
|
})();
|
|
393
|
-
})(), o, s),
|
|
393
|
+
})(), o, s), F(() => W(l, "innerHTML", r().body)), H(), e;
|
|
394
394
|
})();
|
|
395
395
|
}
|
|
396
396
|
//#endregion
|
|
397
|
+
//#region src/pending-action.ts
|
|
398
|
+
function Ae() {
|
|
399
|
+
let [e, t] = S(null), n = null, r = !1, i = () => {
|
|
400
|
+
n?.abort(), n = null;
|
|
401
|
+
};
|
|
402
|
+
return w() && E(() => {
|
|
403
|
+
r = !0, i();
|
|
404
|
+
}), {
|
|
405
|
+
current: e,
|
|
406
|
+
busy: () => e() !== null,
|
|
407
|
+
is: (t) => e() === t,
|
|
408
|
+
async run(e, a, o) {
|
|
409
|
+
if (r || n && !o?.replace) return;
|
|
410
|
+
i();
|
|
411
|
+
let s = new AbortController();
|
|
412
|
+
n = s, t(() => e);
|
|
413
|
+
try {
|
|
414
|
+
return await a(s.signal);
|
|
415
|
+
} finally {
|
|
416
|
+
n === s && (n = null, t(null));
|
|
417
|
+
}
|
|
418
|
+
},
|
|
419
|
+
reset() {
|
|
420
|
+
i(), t(null);
|
|
421
|
+
}
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
//#endregion
|
|
397
425
|
//#region src/status-pill.tsx
|
|
398
|
-
var
|
|
399
|
-
function
|
|
426
|
+
var je = /*#__PURE__*/ G("<code>"), Me = /*#__PURE__*/ G("<span>");
|
|
427
|
+
function Ne(e) {
|
|
400
428
|
let t = new Set(e.openDomains ?? []);
|
|
401
429
|
return function(n) {
|
|
402
430
|
let r = () => e.tones[n.domain]?.[n.value], i = () => e.label(n.domain, n.value, n.locale), a = () => !!(r() && i()), o = () => {
|
|
@@ -409,24 +437,24 @@ function je(e) {
|
|
|
409
437
|
text: t
|
|
410
438
|
};
|
|
411
439
|
};
|
|
412
|
-
return
|
|
440
|
+
return N(v, {
|
|
413
441
|
get when() {
|
|
414
442
|
return a() || !t.has(n.domain);
|
|
415
443
|
},
|
|
416
444
|
get fallback() {
|
|
417
445
|
return (() => {
|
|
418
|
-
var e =
|
|
419
|
-
return
|
|
446
|
+
var e = I(je);
|
|
447
|
+
return R(e, () => n.value), F(() => U(e, "data-status", `${n.domain}.${n.value}`)), e;
|
|
420
448
|
})();
|
|
421
449
|
},
|
|
422
450
|
get children() {
|
|
423
451
|
return (() => {
|
|
424
452
|
let e = o();
|
|
425
453
|
return (() => {
|
|
426
|
-
var t =
|
|
427
|
-
return
|
|
454
|
+
var t = I(Me);
|
|
455
|
+
return R(t, () => e.text), F((r) => {
|
|
428
456
|
var i = e.tone === "neutral" ? "dds-badge" : `dds-badge dds-badge--${e.tone}`, a = `${n.domain}.${n.value}`, o = e.tone;
|
|
429
|
-
return i !== r.e &&
|
|
457
|
+
return i !== r.e && M(t, r.e = i), a !== r.t && U(t, "data-status", r.t = a), o !== r.a && U(t, "data-tone", r.a = o), r;
|
|
430
458
|
}, {
|
|
431
459
|
e: void 0,
|
|
432
460
|
t: void 0,
|
|
@@ -440,9 +468,9 @@ function je(e) {
|
|
|
440
468
|
}
|
|
441
469
|
//#endregion
|
|
442
470
|
//#region src/direction.ts
|
|
443
|
-
function
|
|
471
|
+
function Pe(e, t) {
|
|
444
472
|
let [n, r] = S("ltr");
|
|
445
|
-
return
|
|
473
|
+
return D(() => {
|
|
446
474
|
let t = e()?.parentElement;
|
|
447
475
|
if (!t) return;
|
|
448
476
|
let n = () => r(getComputedStyle(t).direction === "rtl" ? "rtl" : "ltr");
|
|
@@ -452,21 +480,21 @@ function Me(e, t) {
|
|
|
452
480
|
attributes: !0,
|
|
453
481
|
subtree: !0,
|
|
454
482
|
attributeFilter: ["dir"]
|
|
455
|
-
}),
|
|
483
|
+
}), E(() => i.disconnect());
|
|
456
484
|
}), () => t() ?? n();
|
|
457
485
|
}
|
|
458
486
|
//#endregion
|
|
459
487
|
//#region src/tabs.tsx
|
|
460
|
-
function
|
|
461
|
-
let t = C(), n = () => e.id ?? `dds-tabs-${t}`, r, i =
|
|
488
|
+
function Fe(e) {
|
|
489
|
+
let t = C(), n = () => e.id ?? `dds-tabs-${t}`, r, i = Pe(() => r, () => e.dir), a = e.asChild ? (t) => e.asChild(T(t({}), { ref: (e) => {
|
|
462
490
|
r = e;
|
|
463
491
|
} })) : void 0;
|
|
464
|
-
return
|
|
492
|
+
return N(se, {
|
|
465
493
|
get locale() {
|
|
466
494
|
return i() === "rtl" ? "ar" : "en";
|
|
467
495
|
},
|
|
468
496
|
get children() {
|
|
469
|
-
return
|
|
497
|
+
return N(Y.Root, V({
|
|
470
498
|
ref(e) {
|
|
471
499
|
var t = r;
|
|
472
500
|
typeof t == "function" ? t(e) : r = e;
|
|
@@ -504,13 +532,13 @@ function Ne(e) {
|
|
|
504
532
|
}
|
|
505
533
|
});
|
|
506
534
|
}
|
|
507
|
-
function
|
|
508
|
-
let [t, n] =
|
|
535
|
+
function Ie(e) {
|
|
536
|
+
let [t, n] = O(e, [
|
|
509
537
|
"class",
|
|
510
538
|
"children",
|
|
511
539
|
"unstyled"
|
|
512
540
|
]);
|
|
513
|
-
return
|
|
541
|
+
return N(Y.List, V(n, {
|
|
514
542
|
get class() {
|
|
515
543
|
return c(!t.unstyled && "dds-tabs", t.class);
|
|
516
544
|
},
|
|
@@ -519,15 +547,15 @@ function Pe(e) {
|
|
|
519
547
|
}
|
|
520
548
|
}));
|
|
521
549
|
}
|
|
522
|
-
function
|
|
523
|
-
let [t, n] =
|
|
550
|
+
function Le(e) {
|
|
551
|
+
let [t, n] = O(e, [
|
|
524
552
|
"class",
|
|
525
553
|
"children",
|
|
526
554
|
"value",
|
|
527
555
|
"unstyled",
|
|
528
556
|
"asChild"
|
|
529
|
-
]), r = t.asChild ? (n) => t.asChild(
|
|
530
|
-
return
|
|
557
|
+
]), r = t.asChild ? (n) => t.asChild(T(n({}), { ref: e.ref })) : void 0;
|
|
558
|
+
return N(Y.Trigger, V(n, {
|
|
531
559
|
get value() {
|
|
532
560
|
return t.value;
|
|
533
561
|
},
|
|
@@ -538,16 +566,16 @@ function Q(e) {
|
|
|
538
566
|
return t.children;
|
|
539
567
|
} }));
|
|
540
568
|
}
|
|
541
|
-
function
|
|
542
|
-
let [t, n] =
|
|
569
|
+
function Re(e) {
|
|
570
|
+
let [t, n] = O(e, [
|
|
543
571
|
"value",
|
|
544
572
|
"children",
|
|
545
573
|
"style"
|
|
546
|
-
]), r =
|
|
574
|
+
]), r = oe(), i = () => r().value !== t.value, a = () => i() ? typeof t.style == "string" ? `${t.style.replace(/;+\s*$/, "")};display:none;` : {
|
|
547
575
|
...t.style,
|
|
548
576
|
display: "none"
|
|
549
577
|
} : t.style;
|
|
550
|
-
return
|
|
578
|
+
return N(Y.Content, V(n, {
|
|
551
579
|
get value() {
|
|
552
580
|
return t.value;
|
|
553
581
|
},
|
|
@@ -567,16 +595,16 @@ function Fe(e) {
|
|
|
567
595
|
}
|
|
568
596
|
//#endregion
|
|
569
597
|
//#region src/toast.tsx
|
|
570
|
-
var
|
|
571
|
-
function
|
|
598
|
+
var Q = y();
|
|
599
|
+
function ze(e) {
|
|
572
600
|
let t = C(), n, r, i = () => r ??= new Proxy(n?.ownerDocument ?? document, { get(e, t) {
|
|
573
601
|
if (t === "getElementById") return (t) => t === "toast-group:bottom-end" ? n ?? null : e.getElementById(t);
|
|
574
602
|
let r = Reflect.get(e, t, e);
|
|
575
603
|
return typeof r == "function" ? r.bind(e) : r;
|
|
576
|
-
} }), a =
|
|
604
|
+
} }), a = le({
|
|
577
605
|
placement: "bottom-end",
|
|
578
606
|
overlap: !1,
|
|
579
|
-
gap:
|
|
607
|
+
gap: ue[8],
|
|
580
608
|
offsets: "var(--dds-space-16)",
|
|
581
609
|
removeDelay: 0,
|
|
582
610
|
hotkey: ["DDS_NO_HOTKEY"],
|
|
@@ -599,10 +627,10 @@ function Ie(e) {
|
|
|
599
627
|
dismiss: (e) => a.remove(e),
|
|
600
628
|
clear: () => a.remove()
|
|
601
629
|
};
|
|
602
|
-
return
|
|
630
|
+
return E(s.clear), N(Q.Provider, {
|
|
603
631
|
value: s,
|
|
604
632
|
get children() {
|
|
605
|
-
return [
|
|
633
|
+
return [B(() => e.children), N(ce, {
|
|
606
634
|
toaster: a,
|
|
607
635
|
ref(e) {
|
|
608
636
|
var t = n;
|
|
@@ -621,7 +649,7 @@ function Ie(e) {
|
|
|
621
649
|
},
|
|
622
650
|
children: (t) => {
|
|
623
651
|
let n = () => t().meta?.dds;
|
|
624
|
-
return
|
|
652
|
+
return N(X.Root, {
|
|
625
653
|
get class() {
|
|
626
654
|
return c("dds-toast", `dds-toast--${n().tone ?? "info"}`);
|
|
627
655
|
},
|
|
@@ -629,12 +657,12 @@ function Ie(e) {
|
|
|
629
657
|
return n().tone === "danger" ? "alert" : "status";
|
|
630
658
|
},
|
|
631
659
|
get children() {
|
|
632
|
-
return [
|
|
660
|
+
return [N(X.Description, { get children() {
|
|
633
661
|
return t().description;
|
|
634
|
-
} }),
|
|
662
|
+
} }), B(() => B(() => !!e.dismissLabel)() && N(X.CloseTrigger, {
|
|
635
663
|
class: "dds-iconbtn dds-iconbtn--sm",
|
|
636
664
|
get "aria-label"() {
|
|
637
|
-
return
|
|
665
|
+
return B(() => typeof e.dismissLabel == "function")() ? e.dismissLabel(n()) : e.dismissLabel;
|
|
638
666
|
},
|
|
639
667
|
children: "×"
|
|
640
668
|
}))];
|
|
@@ -645,20 +673,20 @@ function Ie(e) {
|
|
|
645
673
|
}
|
|
646
674
|
});
|
|
647
675
|
}
|
|
648
|
-
function
|
|
649
|
-
let e =
|
|
676
|
+
function Be() {
|
|
677
|
+
let e = k(Q);
|
|
650
678
|
if (!e) throw Error("useToast must be called inside <ToastProvider>");
|
|
651
679
|
return e;
|
|
652
680
|
}
|
|
653
681
|
//#endregion
|
|
654
682
|
//#region src/tooltip.tsx
|
|
655
|
-
var
|
|
656
|
-
function
|
|
683
|
+
var $ = /*#__PURE__*/ G("<span><!$><!/><!$><!/>");
|
|
684
|
+
function Ve(e) {
|
|
657
685
|
let t = C(), n = () => e.id ?? `dds-tooltip-${t}`, [i, a] = r({
|
|
658
686
|
value: () => e.open,
|
|
659
687
|
defaultValue: e.defaultOpen ?? !1,
|
|
660
688
|
onChange: (t) => e.onOpenChange?.(t)
|
|
661
|
-
}), o =
|
|
689
|
+
}), o = de(() => ({
|
|
662
690
|
id: n(),
|
|
663
691
|
ids: { content: n() },
|
|
664
692
|
open: i(),
|
|
@@ -666,14 +694,14 @@ function ze(e) {
|
|
|
666
694
|
openDelay: 0,
|
|
667
695
|
closeDelay: 0
|
|
668
696
|
}));
|
|
669
|
-
return
|
|
697
|
+
return N(Z.RootProvider, {
|
|
670
698
|
value: o,
|
|
671
699
|
lazyMount: !1,
|
|
672
700
|
unmountOnExit: !1,
|
|
673
701
|
get children() {
|
|
674
|
-
var t =
|
|
675
|
-
return
|
|
676
|
-
let [, r] =
|
|
702
|
+
var t = I($), r = t.firstChild, [i, a] = L(r.nextSibling), s = i.nextSibling, [l, u] = L(s.nextSibling);
|
|
703
|
+
return R(t, N(Z.Trigger, { asChild: (t) => {
|
|
704
|
+
let [, r] = O(t(), ["onFocusIn", "onFocusOut"]);
|
|
677
705
|
return e.children({
|
|
678
706
|
...r,
|
|
679
707
|
"aria-describedby": n(),
|
|
@@ -682,18 +710,18 @@ function ze(e) {
|
|
|
682
710
|
onPointerEnter: () => o().setOpen(!0),
|
|
683
711
|
onPointerLeave: () => o().setOpen(!1)
|
|
684
712
|
});
|
|
685
|
-
} }), i, a),
|
|
686
|
-
return
|
|
713
|
+
} }), i, a), R(t, N(Z.Positioner, { get children() {
|
|
714
|
+
return N(Z.Content, {
|
|
687
715
|
class: "dds-tooltip__bubble",
|
|
688
716
|
get children() {
|
|
689
717
|
return e.content;
|
|
690
718
|
}
|
|
691
719
|
});
|
|
692
|
-
} }), l, u),
|
|
720
|
+
} }), l, u), F(() => M(t, c("dds-tooltip", e.class))), t;
|
|
693
721
|
}
|
|
694
722
|
});
|
|
695
723
|
}
|
|
696
724
|
//#endregion
|
|
697
|
-
export { e as Button, g as Calendar, i as Checkbox, f as Combobox,
|
|
725
|
+
export { e as Button, g as Calendar, i as Checkbox, f as Combobox, Ce as ConsoleShell, l as DatePicker, Te as Dialog, m as DropdownMenu, s as Field, ke as Icon, t as IconButton, u as Input, d as InputGroup, h as Popover, n as Radio, Ee as RadioGroup, o as Select, p as SelectPicker, a as Switch, Le as Tab, Ie as TabList, Re as TabPanel, Fe as Tabs, ze as ToastProvider, Ve as Tooltip, r as createControllableSignal, Ae as createPendingAction, Ne as createStatusPill, Be as useToast };
|
|
698
726
|
|
|
699
727
|
//# sourceMappingURL=index.js.map
|