@devslab/dds-react 0.24.0 → 0.25.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 +3 -2
- package/README.md +3 -2
- package/dist/calendar-view-BxjCQV9k.js +119 -0
- package/dist/calendar-view-BxjCQV9k.js.map +1 -0
- package/dist/calendar-view.d.ts +11 -1
- package/dist/calendar-view.d.ts.map +1 -1
- package/dist/calendar.js +5 -4
- package/dist/calendar.js.map +1 -1
- package/dist/choice-N-5K_ggs.js +309 -0
- package/dist/choice-N-5K_ggs.js.map +1 -0
- package/dist/choice-types-kSaEnZPr.js +23 -0
- package/dist/choice-types-kSaEnZPr.js.map +1 -0
- package/dist/combobox.js +1 -1
- package/dist/date-only-Bu4UmsTP.js +151 -0
- package/dist/date-only-Bu4UmsTP.js.map +1 -0
- package/dist/date-only.d.ts +92 -0
- package/dist/date-only.d.ts.map +1 -1
- package/dist/date-picker.js +69 -68
- package/dist/date-picker.js.map +1 -1
- package/dist/date-range-picker.d.ts +41 -0
- package/dist/date-range-picker.d.ts.map +1 -0
- package/dist/date-range-picker.js +327 -0
- package/dist/date-range-picker.js.map +1 -0
- package/dist/direction-DbZcVPsZ.js +21 -0
- package/dist/direction-DbZcVPsZ.js.map +1 -0
- package/dist/direction.d.ts +5 -0
- package/dist/direction.d.ts.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +108 -103
- package/dist/index.js.map +1 -1
- package/dist/input.d.ts.map +1 -1
- package/dist/input.js +1 -1
- package/dist/input.js.map +1 -1
- package/dist/internal/choice.d.ts +27 -3
- package/dist/internal/choice.d.ts.map +1 -1
- package/dist/month-picker.d.ts +33 -0
- package/dist/month-picker.d.ts.map +1 -0
- package/dist/month-picker.js +242 -0
- package/dist/month-picker.js.map +1 -0
- package/dist/number-input.d.ts +53 -0
- package/dist/number-input.d.ts.map +1 -0
- package/dist/number-input.js +254 -0
- package/dist/number-input.js.map +1 -0
- package/dist/segmented-control.d.ts +40 -0
- package/dist/segmented-control.d.ts.map +1 -0
- package/dist/segmented-control.js +73 -0
- package/dist/segmented-control.js.map +1 -0
- package/dist/select-picker.js +1 -1
- package/dist/time-only.d.ts +32 -0
- package/dist/time-only.d.ts.map +1 -0
- package/dist/time-picker-BQ7BT6-u.js +100 -0
- package/dist/time-picker-BQ7BT6-u.js.map +1 -0
- package/dist/time-picker.d.ts +34 -0
- package/dist/time-picker.d.ts.map +1 -0
- package/dist/time-picker.js +2 -0
- package/package.json +29 -4
- package/styles.css +31 -1
- package/dist/calendar-view-I_sNlioP.js +0 -145
- package/dist/calendar-view-I_sNlioP.js.map +0 -1
- package/dist/choice-B3vNMfKK.js +0 -300
- package/dist/choice-B3vNMfKK.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,47 +1,52 @@
|
|
|
1
1
|
import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "./controls-BajigKUv.js";
|
|
2
2
|
import { DatePicker as c } from "./date-picker.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
3
|
+
import { DateRangePicker as l } from "./date-range-picker.js";
|
|
4
|
+
import { MonthPicker as u } from "./month-picker.js";
|
|
5
|
+
import { Input as d, InputGroup as f } from "./input.js";
|
|
6
|
+
import { Combobox as p } from "./combobox.js";
|
|
7
|
+
import { SelectPicker as m } from "./select-picker.js";
|
|
8
|
+
import { DropdownMenu as h } from "./dropdown-menu.js";
|
|
9
|
+
import { Popover as g } from "./popover.js";
|
|
10
|
+
import { Calendar as _ } from "./calendar.js";
|
|
11
|
+
import { t as v } from "./time-picker-BQ7BT6-u.js";
|
|
12
|
+
import { SegmentedControl as y, validateSegmentedItems as b } from "./segmented-control.js";
|
|
13
|
+
import { NumberInput as x, normalizeNumberText as S, numberInputMessages as ee } from "./number-input.js";
|
|
14
|
+
import { createContext as C, forwardRef as w, useCallback as T, useContext as E, useEffect as D, useId as O, useMemo as k, useRef as A, useState as j } from "react";
|
|
15
|
+
import { Field as M } from "@ark-ui/react/field";
|
|
16
|
+
import { Checkbox as N } from "@ark-ui/react/checkbox";
|
|
17
|
+
import { Switch as P } from "@ark-ui/react/switch";
|
|
18
|
+
import { Fragment as F, jsx as I, jsxs as L } from "react/jsx-runtime";
|
|
19
|
+
import { Tabs as R, Tabs as z, useTabsContext as B } from "@ark-ui/react/tabs";
|
|
20
|
+
import { RadioGroup as V, RadioGroup as H, useRadioGroupContext as U } from "@ark-ui/react/radio-group";
|
|
21
|
+
import { Dialog as W, Dialog as G } from "@ark-ui/react/dialog";
|
|
22
|
+
import { Tooltip as K, Tooltip as q } from "@ark-ui/react/tooltip";
|
|
23
|
+
import { Portal as J } from "@ark-ui/react/portal";
|
|
24
|
+
import { directionPolicy as Y, icons as X } from "@devslab/dds-icons";
|
|
25
|
+
import { Toast as Z, Toast as Q, Toaster as te, createToaster as ne } from "@ark-ui/react/toast";
|
|
26
|
+
import { DatePicker as re } from "@ark-ui/react/date-picker";
|
|
22
27
|
//#region src/selection.tsx
|
|
23
|
-
var
|
|
24
|
-
return /* @__PURE__ */
|
|
28
|
+
var ie = w(function({ onValueChange: e, unstyled: n, className: r, ...i }, a) {
|
|
29
|
+
return /* @__PURE__ */ I(z.Root, {
|
|
25
30
|
...i,
|
|
26
31
|
ref: a,
|
|
27
32
|
onValueChange: (t) => e?.(t.value),
|
|
28
33
|
className: t(!n && "dds-tabs-root", r)
|
|
29
34
|
});
|
|
30
|
-
}),
|
|
31
|
-
return /* @__PURE__ */
|
|
35
|
+
}), ae = w(function({ unstyled: e, className: n, ...r }, i) {
|
|
36
|
+
return /* @__PURE__ */ I(z.List, {
|
|
32
37
|
...r,
|
|
33
38
|
ref: i,
|
|
34
39
|
className: t(!e && "dds-tabs", n)
|
|
35
40
|
});
|
|
36
|
-
}),
|
|
37
|
-
return /* @__PURE__ */
|
|
41
|
+
}), oe = w(function({ unstyled: e, className: n, ...r }, i) {
|
|
42
|
+
return /* @__PURE__ */ I(z.Trigger, {
|
|
38
43
|
...r,
|
|
39
44
|
ref: i,
|
|
40
45
|
className: t(!e && "dds-tab", n)
|
|
41
46
|
});
|
|
42
|
-
}),
|
|
43
|
-
let i =
|
|
44
|
-
return /* @__PURE__ */
|
|
47
|
+
}), se = w(function({ value: e, style: t, ...n }, r) {
|
|
48
|
+
let i = B().value !== e;
|
|
49
|
+
return /* @__PURE__ */ I(z.Content, {
|
|
45
50
|
...n,
|
|
46
51
|
value: e,
|
|
47
52
|
ref: r,
|
|
@@ -52,17 +57,17 @@ var q = _(function({ onValueChange: e, unstyled: n, className: r, ...i }, a) {
|
|
|
52
57
|
} : t
|
|
53
58
|
});
|
|
54
59
|
});
|
|
55
|
-
function
|
|
56
|
-
let t =
|
|
57
|
-
return /* @__PURE__ */
|
|
60
|
+
function ce({ option: e }) {
|
|
61
|
+
let t = U(), { style: n, defaultChecked: r, ...i } = t.getItemHiddenInputProps(e);
|
|
62
|
+
return /* @__PURE__ */ I("input", {
|
|
58
63
|
...i,
|
|
59
64
|
checked: t.value === e.value,
|
|
60
65
|
onChange: () => {},
|
|
61
66
|
className: "dds-check__input"
|
|
62
67
|
});
|
|
63
68
|
}
|
|
64
|
-
var
|
|
65
|
-
return /* @__PURE__ */
|
|
69
|
+
var le = w(function({ options: e, label: n, onValueChange: r, className: i, children: a, ...o }, s) {
|
|
70
|
+
return /* @__PURE__ */ L(H.Root, {
|
|
66
71
|
...o,
|
|
67
72
|
ref: s,
|
|
68
73
|
onValueChange: (e) => {
|
|
@@ -70,42 +75,42 @@ var ne = _(function({ options: e, label: n, onValueChange: r, className: i, chil
|
|
|
70
75
|
},
|
|
71
76
|
className: t("dds-radio-group", i),
|
|
72
77
|
children: [
|
|
73
|
-
/* @__PURE__ */
|
|
78
|
+
/* @__PURE__ */ I(H.Label, {
|
|
74
79
|
className: "dds-field__label",
|
|
75
80
|
children: n
|
|
76
81
|
}),
|
|
77
|
-
e.map((e) => /* @__PURE__ */
|
|
82
|
+
e.map((e) => /* @__PURE__ */ L(H.Item, {
|
|
78
83
|
value: e.value,
|
|
79
84
|
disabled: e.disabled,
|
|
80
85
|
className: "dds-check",
|
|
81
|
-
children: [/* @__PURE__ */
|
|
86
|
+
children: [/* @__PURE__ */ I(ce, { option: e }), /* @__PURE__ */ I(H.ItemText, { children: e.label })]
|
|
82
87
|
}, e.value)),
|
|
83
88
|
a
|
|
84
89
|
]
|
|
85
90
|
});
|
|
86
|
-
}),
|
|
91
|
+
}), ue = w(function({ title: e, description: n, children: r, actions: i, onOpenChange: a, closeOnOutside: o, portal: s = !0, className: c, overlayClassName: l, contentProps: u, initialFocus: d, finalFocus: f, frame: p, unstyled: m, ...h }, g) {
|
|
87
92
|
let _ = {
|
|
88
|
-
title: /* @__PURE__ */
|
|
93
|
+
title: /* @__PURE__ */ I(G.Title, {
|
|
89
94
|
className: m ? void 0 : "dds-dialog__title",
|
|
90
95
|
children: e
|
|
91
96
|
}),
|
|
92
|
-
description: n && /* @__PURE__ */
|
|
97
|
+
description: n && /* @__PURE__ */ I(G.Description, {
|
|
93
98
|
className: m ? void 0 : "dds-dialog__body",
|
|
94
99
|
children: n
|
|
95
100
|
}),
|
|
96
101
|
children: r,
|
|
97
|
-
actions: i && /* @__PURE__ */
|
|
102
|
+
actions: i && /* @__PURE__ */ I("div", {
|
|
98
103
|
className: m ? void 0 : "dds-dialog__actions",
|
|
99
104
|
children: i
|
|
100
105
|
})
|
|
101
|
-
}, v = /* @__PURE__ */
|
|
106
|
+
}, v = /* @__PURE__ */ I(G.Positioner, {
|
|
102
107
|
className: t(!m && "dds-dialog-overlay", l),
|
|
103
|
-
children: /* @__PURE__ */
|
|
108
|
+
children: /* @__PURE__ */ I(G.Content, {
|
|
104
109
|
...u,
|
|
105
110
|
ref: g,
|
|
106
111
|
"aria-describedby": n ? u?.["aria-describedby"] : void 0,
|
|
107
112
|
className: t(!m && "dds-dialog", c, u?.className),
|
|
108
|
-
children: p ? p(_) : /* @__PURE__ */
|
|
113
|
+
children: p ? p(_) : /* @__PURE__ */ L(F, { children: [
|
|
109
114
|
_.title,
|
|
110
115
|
_.description,
|
|
111
116
|
r,
|
|
@@ -113,7 +118,7 @@ var ne = _(function({ options: e, label: n, onValueChange: r, className: i, chil
|
|
|
113
118
|
] })
|
|
114
119
|
})
|
|
115
120
|
});
|
|
116
|
-
return /* @__PURE__ */
|
|
121
|
+
return /* @__PURE__ */ I(G.Root, {
|
|
117
122
|
...h,
|
|
118
123
|
onOpenChange: (e) => a?.(e.open),
|
|
119
124
|
closeOnInteractOutside: o ?? h.closeOnInteractOutside,
|
|
@@ -121,21 +126,21 @@ var ne = _(function({ options: e, label: n, onValueChange: r, className: i, chil
|
|
|
121
126
|
finalFocusEl: f ? () => f() ?? null : h.finalFocusEl,
|
|
122
127
|
lazyMount: !0,
|
|
123
128
|
unmountOnExit: !0,
|
|
124
|
-
children: s ? /* @__PURE__ */
|
|
129
|
+
children: s ? /* @__PURE__ */ I(J, { children: v }) : v
|
|
125
130
|
});
|
|
126
131
|
});
|
|
127
|
-
function
|
|
128
|
-
return /* @__PURE__ */
|
|
132
|
+
function de({ content: e, children: n, onOpenChange: r, className: i, contentProps: a, ...o }) {
|
|
133
|
+
return /* @__PURE__ */ I(q.Root, {
|
|
129
134
|
openDelay: 0,
|
|
130
135
|
closeDelay: 0,
|
|
131
136
|
...o,
|
|
132
137
|
onOpenChange: (e) => r?.(e.open),
|
|
133
|
-
children: /* @__PURE__ */
|
|
138
|
+
children: /* @__PURE__ */ L("span", {
|
|
134
139
|
className: t("dds-tooltip", i),
|
|
135
|
-
children: [typeof n == "function" ? /* @__PURE__ */
|
|
140
|
+
children: [typeof n == "function" ? /* @__PURE__ */ I(q.Context, { children: (e) => n(e.getTriggerProps()) }) : /* @__PURE__ */ I(q.Trigger, {
|
|
136
141
|
asChild: !0,
|
|
137
142
|
children: n
|
|
138
|
-
}), /* @__PURE__ */
|
|
143
|
+
}), /* @__PURE__ */ I(J, { children: /* @__PURE__ */ I(q.Positioner, { children: /* @__PURE__ */ I(q.Content, {
|
|
139
144
|
...a,
|
|
140
145
|
className: t("dds-tooltip__bubble", a?.className),
|
|
141
146
|
children: e
|
|
@@ -145,9 +150,9 @@ function ie({ content: e, children: n, onOpenChange: r, className: i, contentPro
|
|
|
145
150
|
}
|
|
146
151
|
//#endregion
|
|
147
152
|
//#region src/icon.tsx
|
|
148
|
-
var
|
|
149
|
-
let c =
|
|
150
|
-
return /* @__PURE__ */
|
|
153
|
+
var fe = w(function({ name: e, label: n, size: r = 24, directional: i, className: a, ...o }, s) {
|
|
154
|
+
let c = X[e];
|
|
155
|
+
return /* @__PURE__ */ L("svg", {
|
|
151
156
|
...o,
|
|
152
157
|
ref: s,
|
|
153
158
|
viewBox: c.viewBox,
|
|
@@ -161,19 +166,19 @@ var ae = _(function({ name: e, label: n, size: r = 24, directional: i, className
|
|
|
161
166
|
role: n ? "img" : void 0,
|
|
162
167
|
"aria-label": n,
|
|
163
168
|
"aria-hidden": !n || void 0,
|
|
164
|
-
className: t((i ??
|
|
165
|
-
children: [n && /* @__PURE__ */
|
|
169
|
+
className: t((i ?? Y.mirrorInRtl.includes(e)) && Y.cssClass, a),
|
|
170
|
+
children: [n && /* @__PURE__ */ I("title", { children: n }), /* @__PURE__ */ I("g", { dangerouslySetInnerHTML: { __html: c.body } })]
|
|
166
171
|
});
|
|
167
|
-
}),
|
|
168
|
-
function
|
|
169
|
-
let o =
|
|
172
|
+
}), $ = C(null);
|
|
173
|
+
function pe({ children: e, defaultDuration: n = 5e3, dismissLabel: r, regionLabel: i, className: a }) {
|
|
174
|
+
let o = O(), s = A(0), c = k(() => ne({
|
|
170
175
|
placement: "bottom-end",
|
|
171
176
|
overlap: !1,
|
|
172
177
|
gap: 8,
|
|
173
178
|
offsets: "var(--dds-space-16)",
|
|
174
179
|
removeDelay: 0,
|
|
175
180
|
hotkey: ["DDS_NO_HOTKEY"]
|
|
176
|
-
}), []), l =
|
|
181
|
+
}), []), l = k(() => ({
|
|
177
182
|
show(e) {
|
|
178
183
|
let t = `dds-toast-${o}-${++s.current}`, r = e.duration ?? n;
|
|
179
184
|
return c.create({
|
|
@@ -194,9 +199,9 @@ function oe({ children: e, defaultDuration: n = 5e3, dismissLabel: r, regionLabe
|
|
|
194
199
|
o,
|
|
195
200
|
n
|
|
196
201
|
]);
|
|
197
|
-
return
|
|
202
|
+
return D(() => () => c.remove(), [c]), /* @__PURE__ */ L($.Provider, {
|
|
198
203
|
value: l,
|
|
199
|
-
children: [e, /* @__PURE__ */
|
|
204
|
+
children: [e, /* @__PURE__ */ I(te, {
|
|
200
205
|
toaster: c,
|
|
201
206
|
label: i ?? "",
|
|
202
207
|
"aria-label": i ?? "",
|
|
@@ -204,10 +209,10 @@ function oe({ children: e, defaultDuration: n = 5e3, dismissLabel: r, regionLabe
|
|
|
204
209
|
className: t("dds-toast-region", a),
|
|
205
210
|
children: (e) => {
|
|
206
211
|
let n = e.meta?.dds;
|
|
207
|
-
return /* @__PURE__ */
|
|
212
|
+
return /* @__PURE__ */ L(Z.Root, {
|
|
208
213
|
className: t("dds-toast", `dds-toast--${n.tone ?? "info"}`),
|
|
209
214
|
role: n.tone === "danger" ? "alert" : "status",
|
|
210
|
-
children: [/* @__PURE__ */
|
|
215
|
+
children: [/* @__PURE__ */ I(Z.Description, { children: e.description }), r && /* @__PURE__ */ I(Z.CloseTrigger, {
|
|
211
216
|
className: "dds-iconbtn dds-iconbtn--sm",
|
|
212
217
|
"aria-label": typeof r == "function" ? r(n) : r,
|
|
213
218
|
children: "×"
|
|
@@ -217,89 +222,89 @@ function oe({ children: e, defaultDuration: n = 5e3, dismissLabel: r, regionLabe
|
|
|
217
222
|
})]
|
|
218
223
|
});
|
|
219
224
|
}
|
|
220
|
-
function
|
|
221
|
-
let e =
|
|
225
|
+
function me() {
|
|
226
|
+
let e = E($);
|
|
222
227
|
if (!e) throw Error("useToast must be called inside <ToastProvider>");
|
|
223
228
|
return e;
|
|
224
229
|
}
|
|
225
230
|
//#endregion
|
|
226
231
|
//#region src/console-shell.tsx
|
|
227
|
-
function
|
|
232
|
+
function he(e, t) {
|
|
228
233
|
return t.active ?? (t.href.split("/").filter(Boolean).length <= 1 ? e === t.href : e === t.href || e.startsWith(`${t.href}/`));
|
|
229
234
|
}
|
|
230
|
-
var
|
|
231
|
-
let [p, m] =
|
|
232
|
-
return
|
|
235
|
+
var ge = w(function({ surface: e, activePath: n, brand: r, context: i, nav: a, labels: o, header: s, foot: c, children: l, className: u, ...d }, f) {
|
|
236
|
+
let [p, m] = j(!1), [h, g] = j(!1), _ = O(), v = `dds-console-rail-${_}`, y = `dds-console-main-${_}`;
|
|
237
|
+
return D(() => {
|
|
233
238
|
g(!0);
|
|
234
239
|
let e = (e) => {
|
|
235
240
|
e.key === "Escape" && m(!1);
|
|
236
241
|
};
|
|
237
242
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
238
|
-
}, []), /* @__PURE__ */
|
|
243
|
+
}, []), /* @__PURE__ */ L("div", {
|
|
239
244
|
...d,
|
|
240
245
|
ref: f,
|
|
241
246
|
className: t("dds-console-shell", u),
|
|
242
247
|
"data-surface": e,
|
|
243
248
|
"data-hydrated": h ? "true" : void 0,
|
|
244
249
|
children: [
|
|
245
|
-
/* @__PURE__ */
|
|
250
|
+
/* @__PURE__ */ I("a", {
|
|
246
251
|
className: "dds-console-skip dds-visually-hidden",
|
|
247
252
|
href: `#${y}`,
|
|
248
253
|
children: o.skip
|
|
249
254
|
}),
|
|
250
|
-
/* @__PURE__ */
|
|
255
|
+
/* @__PURE__ */ L("button", {
|
|
251
256
|
className: "dds-console-rail__toggle",
|
|
252
257
|
type: "button",
|
|
253
258
|
"data-action": "toggle-rail",
|
|
254
259
|
"aria-controls": v,
|
|
255
260
|
"aria-expanded": p,
|
|
256
261
|
onClick: () => m(!p),
|
|
257
|
-
children: [/* @__PURE__ */
|
|
262
|
+
children: [/* @__PURE__ */ I("span", { "aria-hidden": !0 }), /* @__PURE__ */ I("span", {
|
|
258
263
|
className: "dds-visually-hidden",
|
|
259
264
|
children: p ? o.menuClose : o.menuOpen
|
|
260
265
|
})]
|
|
261
266
|
}),
|
|
262
|
-
/* @__PURE__ */
|
|
267
|
+
/* @__PURE__ */ I("div", {
|
|
263
268
|
className: "dds-console-rail__scrim",
|
|
264
269
|
"data-open": String(p),
|
|
265
270
|
onClick: () => m(!1)
|
|
266
271
|
}),
|
|
267
|
-
/* @__PURE__ */
|
|
272
|
+
/* @__PURE__ */ L("aside", {
|
|
268
273
|
id: v,
|
|
269
274
|
className: "dds-console-rail",
|
|
270
275
|
"data-open": String(p),
|
|
271
276
|
children: [
|
|
272
|
-
/* @__PURE__ */
|
|
277
|
+
/* @__PURE__ */ L("a", {
|
|
273
278
|
className: "dds-console-rail__brand",
|
|
274
279
|
href: r.href,
|
|
275
|
-
children: [/* @__PURE__ */
|
|
280
|
+
children: [/* @__PURE__ */ I("img", {
|
|
276
281
|
src: r.mark,
|
|
277
282
|
alt: "",
|
|
278
283
|
width: 20,
|
|
279
284
|
height: 20
|
|
280
|
-
}), /* @__PURE__ */
|
|
285
|
+
}), /* @__PURE__ */ I("strong", { children: r.name })]
|
|
281
286
|
}),
|
|
282
|
-
i && i.length > 0 && /* @__PURE__ */
|
|
287
|
+
i && i.length > 0 && /* @__PURE__ */ I("dl", {
|
|
283
288
|
className: "dds-console-rail__context",
|
|
284
|
-
children: i.map((e, t) => /* @__PURE__ */
|
|
289
|
+
children: i.map((e, t) => /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("dt", { children: e.label }), /* @__PURE__ */ I("dd", { children: e.value })] }, t))
|
|
285
290
|
}),
|
|
286
|
-
/* @__PURE__ */
|
|
291
|
+
/* @__PURE__ */ I("nav", {
|
|
287
292
|
className: "dds-console-rail__nav",
|
|
288
293
|
"aria-label": o.nav,
|
|
289
|
-
children: a.map((t, r) => /* @__PURE__ */
|
|
294
|
+
children: a.map((t, r) => /* @__PURE__ */ L("section", {
|
|
290
295
|
className: "dds-console-rail__group",
|
|
291
296
|
"aria-labelledby": `${_}-group-${r}`,
|
|
292
|
-
children: [/* @__PURE__ */
|
|
297
|
+
children: [/* @__PURE__ */ I("h2", {
|
|
293
298
|
id: `${_}-group-${r}`,
|
|
294
299
|
className: "dds-console-rail__group-label",
|
|
295
300
|
children: t.label
|
|
296
|
-
}), /* @__PURE__ */
|
|
301
|
+
}), /* @__PURE__ */ I("ul", { children: t.items.map((t) => /* @__PURE__ */ I("li", { children: /* @__PURE__ */ L("a", {
|
|
297
302
|
className: "dds-console-rail__item",
|
|
298
303
|
"data-nav": `${e}.${t.id}`,
|
|
299
304
|
href: t.href,
|
|
300
|
-
"aria-current":
|
|
305
|
+
"aria-current": he(n, t) ? "page" : void 0,
|
|
301
306
|
onClick: () => m(!1),
|
|
302
|
-
children: [/* @__PURE__ */
|
|
307
|
+
children: [/* @__PURE__ */ I("span", { children: t.label }), t.badge !== void 0 && t.badge > 0 && /* @__PURE__ */ I("span", {
|
|
303
308
|
className: "dds-console-rail__badge",
|
|
304
309
|
"aria-label": o.badge.replace("{count}", () => String(t.badge)),
|
|
305
310
|
children: t.badge
|
|
@@ -307,25 +312,25 @@ var ce = _(function({ surface: e, activePath: n, brand: r, context: i, nav: a, l
|
|
|
307
312
|
}) }, t.id)) })]
|
|
308
313
|
}, r))
|
|
309
314
|
}),
|
|
310
|
-
c && /* @__PURE__ */
|
|
315
|
+
c && /* @__PURE__ */ I("div", {
|
|
311
316
|
className: "dds-console-rail__foot",
|
|
312
317
|
children: c
|
|
313
318
|
})
|
|
314
319
|
]
|
|
315
320
|
}),
|
|
316
|
-
/* @__PURE__ */
|
|
321
|
+
/* @__PURE__ */ L("main", {
|
|
317
322
|
id: y,
|
|
318
323
|
className: "dds-console-main",
|
|
319
324
|
tabIndex: -1,
|
|
320
|
-
children: [/* @__PURE__ */
|
|
325
|
+
children: [/* @__PURE__ */ L("header", {
|
|
321
326
|
className: "dds-console-page-header",
|
|
322
|
-
children: [/* @__PURE__ */
|
|
327
|
+
children: [/* @__PURE__ */ L("div", {
|
|
323
328
|
className: "dds-console-page-header__text",
|
|
324
|
-
children: [s.eyebrow && /* @__PURE__ */
|
|
329
|
+
children: [s.eyebrow && /* @__PURE__ */ I("p", {
|
|
325
330
|
className: "dds-console-page-eyebrow",
|
|
326
331
|
children: s.eyebrow
|
|
327
|
-
}), /* @__PURE__ */
|
|
328
|
-
}), s.actions && /* @__PURE__ */
|
|
332
|
+
}), /* @__PURE__ */ I("h1", { children: s.title })]
|
|
333
|
+
}), s.actions && /* @__PURE__ */ I("div", {
|
|
329
334
|
className: "dds-console-page-header__actions",
|
|
330
335
|
children: s.actions
|
|
331
336
|
})]
|
|
@@ -336,18 +341,18 @@ var ce = _(function({ surface: e, activePath: n, brand: r, context: i, nav: a, l
|
|
|
336
341
|
});
|
|
337
342
|
//#endregion
|
|
338
343
|
//#region src/status-pill.tsx
|
|
339
|
-
function
|
|
344
|
+
function _e(e) {
|
|
340
345
|
let t = new Set(e.openDomains ?? []);
|
|
341
346
|
return function(n) {
|
|
342
347
|
let r = e.tones[n.domain]?.[n.value], i = e.label(n.domain, n.value, n.locale);
|
|
343
348
|
if (!r || !i) {
|
|
344
|
-
if (t.has(n.domain)) return /* @__PURE__ */
|
|
349
|
+
if (t.has(n.domain)) return /* @__PURE__ */ I("code", {
|
|
345
350
|
"data-status": `${n.domain}.${n.value}`,
|
|
346
351
|
children: n.value
|
|
347
352
|
});
|
|
348
353
|
throw Error(r ? `StatusPill: no label for ${n.domain}.${n.value}` : `StatusPill: no tone for ${n.domain}.${n.value}`);
|
|
349
354
|
}
|
|
350
|
-
return /* @__PURE__ */
|
|
355
|
+
return /* @__PURE__ */ I("span", {
|
|
351
356
|
className: r === "neutral" ? "dds-badge" : `dds-badge dds-badge--${r}`,
|
|
352
357
|
"data-status": `${n.domain}.${n.value}`,
|
|
353
358
|
"data-tone": r,
|
|
@@ -357,12 +362,12 @@ function le(e) {
|
|
|
357
362
|
}
|
|
358
363
|
//#endregion
|
|
359
364
|
//#region src/pending-action.ts
|
|
360
|
-
function
|
|
361
|
-
let [e, t] =
|
|
362
|
-
|
|
365
|
+
function ve() {
|
|
366
|
+
let [e, t] = j(null), n = A(null);
|
|
367
|
+
D(() => () => {
|
|
363
368
|
n.current?.abort(), n.current = null;
|
|
364
369
|
}, []);
|
|
365
|
-
let r =
|
|
370
|
+
let r = T(async (e, r, i) => {
|
|
366
371
|
if (n.current && !i?.replace) return;
|
|
367
372
|
n.current?.abort();
|
|
368
373
|
let a = new AbortController();
|
|
@@ -372,10 +377,10 @@ function ue() {
|
|
|
372
377
|
} finally {
|
|
373
378
|
n.current === a && (n.current = null, t(null));
|
|
374
379
|
}
|
|
375
|
-
}, []), i =
|
|
380
|
+
}, []), i = T(() => {
|
|
376
381
|
n.current?.abort(), n.current = null, t(null);
|
|
377
382
|
}, []);
|
|
378
|
-
return
|
|
383
|
+
return k(() => ({
|
|
379
384
|
current: e,
|
|
380
385
|
busy: e !== null,
|
|
381
386
|
is: (t) => e === t,
|
|
@@ -388,6 +393,6 @@ function ue() {
|
|
|
388
393
|
]);
|
|
389
394
|
}
|
|
390
395
|
//#endregion
|
|
391
|
-
export {
|
|
396
|
+
export { N as ArkCheckbox, re as ArkDatePicker, W as ArkDialog, M as ArkField, V as ArkRadioGroup, P as ArkSwitch, R as ArkTabs, Q as ArkToast, K as ArkTooltip, s as Button, _ as Calendar, r as Checkbox, p as Combobox, ge as ConsoleShell, c as DatePicker, l as DateRangePicker, ue as Dialog, h as DropdownMenu, a as Field, fe as Icon, n as IconButton, d as Input, f as InputGroup, u as MonthPicker, x as NumberInput, g as Popover, e as Radio, le as RadioGroup, y as SegmentedControl, i as Select, m as SelectPicker, o as Switch, oe as Tab, ae as TabList, se as TabPanel, ie as Tabs, v as TimePicker, pe as ToastProvider, de as Tooltip, t as classes, _e as createStatusPill, S as normalizeNumberText, ee as numberInputMessages, ve as usePendingAction, me as useToast, b as validateSegmentedItems };
|
|
392
397
|
|
|
393
398
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/selection.tsx","../src/overlays.tsx","../src/icon.tsx","../src/toast.tsx","../src/console-shell.tsx","../src/status-pill.tsx","../src/pending-action.ts"],"sourcesContent":["import { forwardRef, type ComponentProps, type ReactNode } from \"react\";\nimport { Tabs as ArkTabs, useTabsContext } from \"@ark-ui/react/tabs\";\nimport {\n RadioGroup as ArkRadioGroup,\n useRadioGroupContext,\n} from \"@ark-ui/react/radio-group\";\nimport { classes } from \"./controls\";\nexport interface TabsProps\n extends Omit<ComponentProps<typeof ArkTabs.Root>, \"onValueChange\"> {\n onValueChange?: (value: string) => void;\n unstyled?: boolean;\n}\nexport const Tabs = forwardRef<HTMLDivElement, TabsProps>(function Tabs(\n { onValueChange, unstyled, className, ...rest },\n ref\n) {\n return (\n <ArkTabs.Root\n {...rest}\n ref={ref}\n onValueChange={(details) => onValueChange?.(details.value)}\n className={classes(!unstyled && \"dds-tabs-root\", className)}\n />\n );\n});\nexport type TabProps = ComponentProps<typeof ArkTabs.Trigger> & {\n unstyled?: boolean;\n};\nexport type TabPanelProps = ComponentProps<typeof ArkTabs.Content>;\nexport const TabList = forwardRef<\n HTMLDivElement,\n ComponentProps<typeof ArkTabs.List> & { unstyled?: boolean }\n>(function TabList({ unstyled, className, ...rest }, ref) {\n return (\n <ArkTabs.List\n {...rest}\n ref={ref}\n className={classes(!unstyled && \"dds-tabs\", className)}\n />\n );\n});\nexport const Tab = forwardRef<HTMLButtonElement, TabProps>(function Tab(\n { unstyled, className, ...rest },\n ref\n) {\n return (\n <ArkTabs.Trigger\n {...rest}\n ref={ref}\n className={classes(!unstyled && \"dds-tab\", className)}\n />\n );\n});\nexport const TabPanel = forwardRef<HTMLDivElement, TabPanelProps>(\n function TabPanel({ value, style, ...rest }, ref) {\n const tabs = useTabsContext();\n const inactive = tabs.value !== value;\n return (\n <ArkTabs.Content\n {...rest}\n value={value}\n ref={ref}\n hidden={inactive}\n style={inactive ? { ...style, display: \"none\" } : style}\n />\n );\n }\n);\nfunction VisibleRadioInput({ option }: { option: RadioOption }) {\n const group = useRadioGroupContext();\n // Ark owns selection and roving focus; DDS displays the native radio.\n const {\n style: _,\n defaultChecked: __,\n ...inputProps\n } = group.getItemHiddenInputProps(option);\n return (\n <input\n {...inputProps}\n checked={group.value === option.value}\n onChange={() => {}}\n className=\"dds-check__input\"\n />\n );\n}\nexport interface RadioOption {\n value: string;\n label: ReactNode;\n disabled?: boolean;\n}\nexport interface RadioGroupProps\n extends Omit<\n ComponentProps<typeof ArkRadioGroup.Root>,\n \"onValueChange\" | \"children\"\n > {\n options: readonly RadioOption[];\n label: ReactNode;\n onValueChange?: (value: string) => void;\n children?: ReactNode;\n}\nexport const RadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(\n function RadioGroup(\n { options, label, onValueChange, className, children, ...rest },\n ref\n ) {\n return (\n <ArkRadioGroup.Root\n {...rest}\n ref={ref}\n onValueChange={(details) => {\n if (details.value !== null) onValueChange?.(details.value);\n }}\n className={classes(\"dds-radio-group\", className)}\n >\n <ArkRadioGroup.Label className=\"dds-field__label\">\n {label}\n </ArkRadioGroup.Label>\n {options.map((option) => (\n <ArkRadioGroup.Item\n key={option.value}\n value={option.value}\n disabled={option.disabled}\n className=\"dds-check\"\n >\n <VisibleRadioInput option={option} />\n <ArkRadioGroup.ItemText>{option.label}</ArkRadioGroup.ItemText>\n </ArkRadioGroup.Item>\n ))}\n {children}\n </ArkRadioGroup.Root>\n );\n }\n);\n","import {\n forwardRef,\n type ComponentProps,\n type ButtonHTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport { Dialog as ArkDialog } from \"@ark-ui/react/dialog\";\nimport { Tooltip as ArkTooltip } from \"@ark-ui/react/tooltip\";\nimport { Portal } from \"@ark-ui/react/portal\";\nimport { classes } from \"./controls\";\nexport interface DialogFrameParts {\n title: ReactNode;\n description: ReactNode;\n children: ReactNode;\n actions: ReactNode;\n}\nexport interface DialogProps\n extends Omit<\n ComponentProps<typeof ArkDialog.Root>,\n \"children\" | \"onOpenChange\"\n > {\n title: ReactNode;\n description?: ReactNode;\n children: ReactNode;\n actions?: ReactNode;\n onOpenChange?: (open: boolean) => void;\n closeOnOutside?: boolean;\n portal?: boolean;\n className?: string;\n overlayClassName?: string;\n contentProps?: ComponentProps<typeof ArkDialog.Content>;\n initialFocus?: () => HTMLElement | null | undefined;\n finalFocus?: () => HTMLElement | null | undefined;\n frame?: (parts: DialogFrameParts) => ReactNode;\n unstyled?: boolean;\n}\nexport const Dialog = forwardRef<HTMLDivElement, DialogProps>(function Dialog(\n {\n title,\n description,\n children,\n actions,\n onOpenChange,\n closeOnOutside,\n portal = true,\n className,\n overlayClassName,\n contentProps,\n initialFocus,\n finalFocus,\n frame,\n unstyled,\n ...rest\n },\n ref\n) {\n const parts: DialogFrameParts = {\n title: (\n <ArkDialog.Title className={unstyled ? undefined : \"dds-dialog__title\"}>\n {title}\n </ArkDialog.Title>\n ),\n description: description && (\n <ArkDialog.Description\n className={unstyled ? undefined : \"dds-dialog__body\"}\n >\n {description}\n </ArkDialog.Description>\n ),\n children,\n actions: actions && (\n <div className={unstyled ? undefined : \"dds-dialog__actions\"}>\n {actions}\n </div>\n ),\n };\n const content = (\n <ArkDialog.Positioner\n className={classes(!unstyled && \"dds-dialog-overlay\", overlayClassName)}\n >\n <ArkDialog.Content\n {...contentProps}\n ref={ref}\n aria-describedby={\n description ? contentProps?.[\"aria-describedby\"] : undefined\n }\n className={classes(\n !unstyled && \"dds-dialog\",\n className,\n contentProps?.className\n )}\n >\n {frame ? (\n frame(parts)\n ) : (\n <>\n {parts.title}\n {parts.description}\n {children}\n {parts.actions}\n </>\n )}\n </ArkDialog.Content>\n </ArkDialog.Positioner>\n );\n return (\n <ArkDialog.Root\n {...rest}\n onOpenChange={(details) => onOpenChange?.(details.open)}\n closeOnInteractOutside={closeOnOutside ?? rest.closeOnInteractOutside}\n initialFocusEl={\n initialFocus ? () => initialFocus() ?? null : rest.initialFocusEl\n }\n finalFocusEl={finalFocus ? () => finalFocus() ?? null : rest.finalFocusEl}\n lazyMount\n unmountOnExit\n >\n {portal ? <Portal>{content}</Portal> : content}\n </ArkDialog.Root>\n );\n});\nexport type TooltipTriggerProps = ButtonHTMLAttributes<HTMLButtonElement>;\nexport interface TooltipProps\n extends Omit<\n ComponentProps<typeof ArkTooltip.Root>,\n \"children\" | \"onOpenChange\"\n > {\n content: ReactNode;\n children: ReactNode | ((props: TooltipTriggerProps) => ReactNode);\n onOpenChange?: (open: boolean) => void;\n className?: string;\n contentProps?: ComponentProps<typeof ArkTooltip.Content>;\n}\nexport function Tooltip({\n content,\n children,\n onOpenChange,\n className,\n contentProps,\n ...rest\n}: TooltipProps) {\n return (\n <ArkTooltip.Root\n openDelay={0}\n closeDelay={0}\n {...rest}\n onOpenChange={(details) => onOpenChange?.(details.open)}\n >\n <span className={classes(\"dds-tooltip\", className)}>\n {typeof children === \"function\" ? (\n <ArkTooltip.Context>\n {(api) => children(api.getTriggerProps())}\n </ArkTooltip.Context>\n ) : (\n <ArkTooltip.Trigger asChild>{children}</ArkTooltip.Trigger>\n )}\n <Portal>\n <ArkTooltip.Positioner>\n <ArkTooltip.Content\n {...contentProps}\n className={classes(\n \"dds-tooltip__bubble\",\n contentProps?.className\n )}\n >\n {content}\n </ArkTooltip.Content>\n </ArkTooltip.Positioner>\n </Portal>\n </span>\n </ArkTooltip.Root>\n );\n}\n","import { forwardRef, type SVGProps } from \"react\";\nimport { icons, directionPolicy, type DdsIconName } from \"@devslab/dds-icons\";\nimport { classes } from \"./controls\";\nexport interface IconProps\n extends Omit<SVGProps<SVGSVGElement>, \"name\" | \"children\"> {\n name: DdsIconName;\n label?: string;\n size?: number | string;\n directional?: boolean;\n}\nexport const Icon = forwardRef<SVGSVGElement, IconProps>(function Icon(\n { name, label, size = 24, directional, className, ...rest },\n ref\n) {\n const icon = icons[name];\n return (\n <svg\n {...rest}\n ref={ref}\n viewBox={icon.viewBox}\n width={size}\n height={size}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={icon.strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n role={label ? \"img\" : undefined}\n aria-label={label}\n aria-hidden={label ? undefined : true}\n className={classes(\n (directional ?? directionPolicy.mirrorInRtl.includes(name)) &&\n directionPolicy.cssClass,\n className\n )}\n >\n {label && <title>{label}</title>}\n <g dangerouslySetInnerHTML={{ __html: icon.body }} />\n </svg>\n );\n});\n","import {\n createContext,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n type ReactNode,\n} from \"react\";\nimport { Toast as ArkToast, Toaster, createToaster } from \"@ark-ui/react/toast\";\nimport { classes } from \"./controls\";\nexport type ToastTone = \"success\" | \"warning\" | \"danger\" | \"info\";\nexport interface ToastInput {\n message: ReactNode;\n tone?: ToastTone;\n duration?: number;\n}\nexport interface ToastRecord extends ToastInput {\n id: string;\n}\nexport interface ToastApi {\n show: (toast: ToastInput) => string;\n dismiss: (id: string) => void;\n clear: () => void;\n}\nexport interface ToastProviderProps {\n children: ReactNode;\n defaultDuration?: number;\n dismissLabel?: string | ((toast: ToastRecord) => string);\n regionLabel?: string;\n className?: string;\n}\nconst ToastContext = createContext<ToastApi | null>(null);\nexport function ToastProvider({\n children,\n defaultDuration = 5000,\n dismissLabel,\n regionLabel,\n className,\n}: ToastProviderProps) {\n const prefix = useId();\n const sequence = useRef(0);\n const toaster = useMemo(\n () =>\n createToaster({\n placement: \"bottom-end\",\n overlap: false,\n gap: 8,\n offsets: \"var(--dds-space-16)\",\n removeDelay: 0,\n hotkey: [\"DDS_NO_HOTKEY\"],\n }),\n []\n );\n const api = useMemo<ToastApi>(() => {\n return {\n show(input) {\n const id = `dds-toast-${prefix}-${++sequence.current}`;\n const duration = input.duration ?? defaultDuration;\n toaster.create({\n id,\n description: input.message,\n type: input.tone === \"danger\" ? \"error\" : input.tone ?? \"info\",\n duration: duration > 0 ? duration : Infinity,\n meta: { dds: { ...input, id } },\n });\n return id;\n },\n dismiss: (id) => toaster.remove(id),\n clear: () => toaster.remove(),\n };\n }, [toaster, prefix, defaultDuration]);\n useEffect(() => () => toaster.remove(), [toaster]);\n return (\n <ToastContext.Provider value={api}>\n {children}\n <Toaster\n toaster={toaster}\n label={regionLabel ?? \"\"}\n aria-label={regionLabel ?? \"\"}\n role={regionLabel ? \"region\" : \"presentation\"}\n className={classes(\"dds-toast-region\", className)}\n >\n {(toast) => {\n const record = toast.meta?.dds as ToastRecord;\n return (\n <ArkToast.Root\n className={classes(\n \"dds-toast\",\n `dds-toast--${record.tone ?? \"info\"}`\n )}\n role={record.tone === \"danger\" ? \"alert\" : \"status\"}\n >\n <ArkToast.Description>{toast.description}</ArkToast.Description>\n {dismissLabel && (\n <ArkToast.CloseTrigger\n className=\"dds-iconbtn dds-iconbtn--sm\"\n aria-label={\n typeof dismissLabel === \"function\"\n ? dismissLabel(record)\n : dismissLabel\n }\n >\n ×\n </ArkToast.CloseTrigger>\n )}\n </ArkToast.Root>\n );\n }}\n </Toaster>\n </ToastContext.Provider>\n );\n}\nexport function useToast(): ToastApi {\n const api = useContext(ToastContext);\n if (!api) throw new Error(\"useToast must be called inside <ToastProvider>\");\n return api;\n}\n","import {\n forwardRef,\n useEffect,\n useId,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport { classes } from \"./controls\";\nexport interface ConsoleNavItem {\n id: string;\n href: string;\n label: string;\n badge?: number;\n active?: boolean;\n}\nexport interface ConsoleNavGroup {\n label: string;\n items: readonly ConsoleNavItem[];\n}\nexport interface ConsoleShellLabels {\n skip: string;\n menuOpen: string;\n menuClose: string;\n nav: string;\n badge: string;\n}\nexport interface ConsoleHeader {\n eyebrow?: string;\n title: string;\n actions?: ReactNode;\n}\nexport interface ConsoleShellProps\n extends Omit<HTMLAttributes<HTMLDivElement>, \"children\" | \"context\"> {\n surface: string;\n activePath: string;\n brand: { href: string; name: string; mark: string };\n context?: readonly { label: string; value: string }[];\n nav: readonly ConsoleNavGroup[];\n labels: ConsoleShellLabels;\n header: ConsoleHeader;\n foot?: ReactNode;\n children: ReactNode;\n}\nfunction isActive(path: string, item: ConsoleNavItem) {\n return (\n item.active ??\n (item.href.split(\"/\").filter(Boolean).length <= 1\n ? path === item.href\n : path === item.href || path.startsWith(`${item.href}/`))\n );\n}\nexport const ConsoleShell = forwardRef<HTMLDivElement, ConsoleShellProps>(\n function ConsoleShell(\n {\n surface,\n activePath,\n brand,\n context,\n nav,\n labels,\n header,\n foot,\n children,\n className,\n ...rest\n },\n ref\n ) {\n const [open, setOpen] = useState(false);\n const [hydrated, setHydrated] = useState(false);\n const id = useId();\n const railId = `dds-console-rail-${id}`;\n const mainId = `dds-console-main-${id}`;\n useEffect(() => {\n setHydrated(true);\n const onKey = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") setOpen(false);\n };\n document.addEventListener(\"keydown\", onKey);\n return () => document.removeEventListener(\"keydown\", onKey);\n }, []);\n return (\n <div\n {...rest}\n ref={ref}\n className={classes(\"dds-console-shell\", className)}\n data-surface={surface}\n data-hydrated={hydrated ? \"true\" : undefined}\n >\n <a className=\"dds-console-skip dds-visually-hidden\" href={`#${mainId}`}>\n {labels.skip}\n </a>\n <button\n className=\"dds-console-rail__toggle\"\n type=\"button\"\n data-action=\"toggle-rail\"\n aria-controls={railId}\n aria-expanded={open}\n onClick={() => setOpen(!open)}\n >\n <span aria-hidden />\n <span className=\"dds-visually-hidden\">\n {open ? labels.menuClose : labels.menuOpen}\n </span>\n </button>\n <div\n className=\"dds-console-rail__scrim\"\n data-open={String(open)}\n onClick={() => setOpen(false)}\n />\n <aside\n id={railId}\n className=\"dds-console-rail\"\n data-open={String(open)}\n >\n <a className=\"dds-console-rail__brand\" href={brand.href}>\n <img src={brand.mark} alt=\"\" width={20} height={20} />\n <strong>{brand.name}</strong>\n </a>\n {context && context.length > 0 && (\n <dl className=\"dds-console-rail__context\">\n {context.map((row, index) => (\n <div key={index}>\n <dt>{row.label}</dt>\n <dd>{row.value}</dd>\n </div>\n ))}\n </dl>\n )}\n <nav className=\"dds-console-rail__nav\" aria-label={labels.nav}>\n {nav.map((group, index) => (\n <section\n key={index}\n className=\"dds-console-rail__group\"\n aria-labelledby={`${id}-group-${index}`}\n >\n <h2\n id={`${id}-group-${index}`}\n className=\"dds-console-rail__group-label\"\n >\n {group.label}\n </h2>\n <ul>\n {group.items.map((item) => (\n <li key={item.id}>\n <a\n className=\"dds-console-rail__item\"\n data-nav={`${surface}.${item.id}`}\n href={item.href}\n aria-current={\n isActive(activePath, item) ? \"page\" : undefined\n }\n onClick={() => setOpen(false)}\n >\n <span>{item.label}</span>\n {item.badge !== undefined && item.badge > 0 && (\n <span\n className=\"dds-console-rail__badge\"\n aria-label={labels.badge.replace(\"{count}\", () =>\n String(item.badge)\n )}\n >\n {item.badge}\n </span>\n )}\n </a>\n </li>\n ))}\n </ul>\n </section>\n ))}\n </nav>\n {foot && <div className=\"dds-console-rail__foot\">{foot}</div>}\n </aside>\n <main id={mainId} className=\"dds-console-main\" tabIndex={-1}>\n <header className=\"dds-console-page-header\">\n <div className=\"dds-console-page-header__text\">\n {header.eyebrow && (\n <p className=\"dds-console-page-eyebrow\">{header.eyebrow}</p>\n )}\n <h1>{header.title}</h1>\n </div>\n {header.actions && (\n <div className=\"dds-console-page-header__actions\">\n {header.actions}\n </div>\n )}\n </header>\n {children}\n </main>\n </div>\n );\n }\n);\n","export type StatusTone = \"success\" | \"warning\" | \"danger\" | \"info\" | \"brand\" | \"neutral\";\nexport function createStatusPill<D extends string>(config:{\n tones:Record<D,Record<string,StatusTone>>;\n label:(domain:D,value:string,locale:string)=>string|undefined;\n openDomains?:readonly NoInfer<D>[];\n}){\n const open=new Set<string>(config.openDomains??[]);\n return function StatusPill(props:{domain:D;value:string;locale:string}){\n const tone=config.tones[props.domain]?.[props.value];\n const label=config.label(props.domain,props.value,props.locale);\n if(!tone||!label){\n if(open.has(props.domain))return <code data-status={`${props.domain}.${props.value}`}>{props.value}</code>;\n throw new Error(!tone?`StatusPill: no tone for ${props.domain}.${props.value}`:`StatusPill: no label for ${props.domain}.${props.value}`);\n }\n return <span className={tone==='neutral'?'dds-badge':`dds-badge dds-badge--${tone}`} data-status={`${props.domain}.${props.value}`} data-tone={tone}>{label}</span>;\n };\n}\n","import { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\n\n/** Options for one `run` call. */\nexport interface PendingActionRunOptions {\n /**\n * Start even while another action runs: that one is aborted and this one takes its place, so the\n * latest request wins (a list reload after typing, paging or sorting). Without it a second start\n * while one runs is ignored, which is what a button wants.\n */\n replace?: boolean;\n}\n\n/**\n * Which of a screen's actions is running. A screen with several buttons gives each one its own\n * key, so only the button that started the work shows progress, while every other control can\n * still be locked through `busy`. One shared flag for all the buttons spins every one of them.\n * The same contract as `createPendingAction` in `@devslab/dds-solid`, with values for accessors.\n */\nexport interface PendingAction<K extends string = string> {\n /** The key of the action now running, or null. */\n readonly current: K | null;\n /** True while any action runs: lock the other controls with it. */\n readonly busy: boolean;\n /** True while `key` is the running action: give that control its progress state. */\n is(key: K): boolean;\n /**\n * Runs `task` as `key` and clears the state when it settles, whether it resolves or throws (the\n * error reaches the caller). While another action runs it does nothing and resolves to undefined,\n * unless `replace` is set. The task receives a signal that aborts when this run stops counting:\n * `reset()`, a run that replaced it, or the component unmounting. Check `signal.aborted` after\n * each await before touching state, or pass the signal to `fetch`.\n */\n run<T>(key: K, task: (signal: AbortSignal) => T | Promise<T>, options?: PendingActionRunOptions): Promise<T | undefined>;\n /** Stops tracking the running action and aborts its signal, for example when the screen's data was replaced. */\n reset(): void;\n}\n\n/** Tracks the running action of a component. */\nexport function usePendingAction<K extends string = string>(): PendingAction<K> {\n const [current, setCurrent] = useState<K | null>(null);\n // State lands on the next render; the ref answers a second click in the same event loop turn.\n const active = useRef<AbortController | null>(null);\n useEffect(() => () => {\n active.current?.abort();\n active.current = null;\n }, []);\n const run = useCallback(async <T,>(\n key: K,\n task: (signal: AbortSignal) => T | Promise<T>,\n options?: PendingActionRunOptions,\n ): Promise<T | undefined> => {\n if (active.current && !options?.replace) return undefined;\n active.current?.abort();\n const controller = new AbortController();\n active.current = controller;\n setCurrent(key);\n try {\n return await task(controller.signal);\n } finally {\n if (active.current === controller) {\n active.current = null;\n setCurrent(null);\n }\n }\n }, []);\n const reset = useCallback(() => {\n active.current?.abort();\n active.current = null;\n setCurrent(null);\n }, []);\n return useMemo(() => ({\n current,\n busy: current !== null,\n is: (key: K) => current === key,\n run,\n reset,\n }), [current, run, reset]);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAYA,IAAa,IAAO,EAAsC,SACxD,EAAE,kBAAe,aAAU,cAAW,GAAG,KACzC,GACA;CACA,OACE,kBAAC,EAAQ,MAAT;EACE,GAAI;EACC;EACL,gBAAgB,MAAY,IAAgB,EAAQ,KAAK;EACzD,WAAW,EAAQ,CAAC,KAAY,iBAAiB,CAAS;CAC3D,CAAA;AAEL,CAAC,GAKY,IAAU,EAGrB,SAAiB,EAAE,aAAU,cAAW,GAAG,KAAQ,GAAK;CACxD,OACE,kBAAC,EAAQ,MAAT;EACE,GAAI;EACC;EACL,WAAW,EAAQ,CAAC,KAAY,YAAY,CAAS;CACtD,CAAA;AAEL,CAAC,GACY,IAAM,EAAwC,SACzD,EAAE,aAAU,cAAW,GAAG,KAC1B,GACA;CACA,OACE,kBAAC,EAAQ,SAAT;EACE,GAAI;EACC;EACL,WAAW,EAAQ,CAAC,KAAY,WAAW,CAAS;CACrD,CAAA;AAEL,CAAC,GACY,IAAW,EACtB,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C,EAAO,SAAS,MAAM;EACtB,IAAM,IAAa,IAAI,gBAAgB;EAEvC,AADA,EAAO,UAAU,GACjB,EAAW,CAAG;EACd,IAAI;GACF,OAAO,MAAM,EAAK,EAAW,MAAM;EACrC,UAAU;GACR,AAAI,EAAO,YAAY,MACrB,EAAO,UAAU,MACjB,EAAW,IAAI;EAEnB;CACF,GAAG,CAAC,CAAC,GACC,IAAQ,QAAkB;EAG9B,AAFA,EAAO,SAAS,MAAM,GACtB,EAAO,UAAU,MACjB,EAAW,IAAI;CACjB,GAAG,CAAC,CAAC;CACL,OAAO,SAAe;EACpB;EACA,MAAM,MAAY;EAClB,KAAK,MAAW,MAAY;EAC5B;EACA;CACF,IAAI;EAAC;EAAS;EAAK;CAAK,CAAC;AAC3B"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/selection.tsx","../src/overlays.tsx","../src/icon.tsx","../src/toast.tsx","../src/console-shell.tsx","../src/status-pill.tsx","../src/pending-action.ts"],"sourcesContent":["import { forwardRef, type ComponentProps, type ReactNode } from \"react\";\nimport { Tabs as ArkTabs, useTabsContext } from \"@ark-ui/react/tabs\";\nimport {\n RadioGroup as ArkRadioGroup,\n useRadioGroupContext,\n} from \"@ark-ui/react/radio-group\";\nimport { classes } from \"./controls\";\nexport interface TabsProps\n extends Omit<ComponentProps<typeof ArkTabs.Root>, \"onValueChange\"> {\n onValueChange?: (value: string) => void;\n unstyled?: boolean;\n}\nexport const Tabs = forwardRef<HTMLDivElement, TabsProps>(function Tabs(\n { onValueChange, unstyled, className, ...rest },\n ref\n) {\n return (\n <ArkTabs.Root\n {...rest}\n ref={ref}\n onValueChange={(details) => onValueChange?.(details.value)}\n className={classes(!unstyled && \"dds-tabs-root\", className)}\n />\n );\n});\nexport type TabProps = ComponentProps<typeof ArkTabs.Trigger> & {\n unstyled?: boolean;\n};\nexport type TabPanelProps = ComponentProps<typeof ArkTabs.Content>;\nexport const TabList = forwardRef<\n HTMLDivElement,\n ComponentProps<typeof ArkTabs.List> & { unstyled?: boolean }\n>(function TabList({ unstyled, className, ...rest }, ref) {\n return (\n <ArkTabs.List\n {...rest}\n ref={ref}\n className={classes(!unstyled && \"dds-tabs\", className)}\n />\n );\n});\nexport const Tab = forwardRef<HTMLButtonElement, TabProps>(function Tab(\n { unstyled, className, ...rest },\n ref\n) {\n return (\n <ArkTabs.Trigger\n {...rest}\n ref={ref}\n className={classes(!unstyled && \"dds-tab\", className)}\n />\n );\n});\nexport const TabPanel = forwardRef<HTMLDivElement, TabPanelProps>(\n function TabPanel({ value, style, ...rest }, ref) {\n const tabs = useTabsContext();\n const inactive = tabs.value !== value;\n return (\n <ArkTabs.Content\n {...rest}\n value={value}\n ref={ref}\n hidden={inactive}\n style={inactive ? { ...style, display: \"none\" } : style}\n />\n );\n }\n);\nfunction VisibleRadioInput({ option }: { option: RadioOption }) {\n const group = useRadioGroupContext();\n // Ark owns selection and roving focus; DDS displays the native radio.\n const {\n style: _,\n defaultChecked: __,\n ...inputProps\n } = group.getItemHiddenInputProps(option);\n return (\n <input\n {...inputProps}\n checked={group.value === option.value}\n onChange={() => {}}\n className=\"dds-check__input\"\n />\n );\n}\nexport interface RadioOption {\n value: string;\n label: ReactNode;\n disabled?: boolean;\n}\nexport interface RadioGroupProps\n extends Omit<\n ComponentProps<typeof ArkRadioGroup.Root>,\n \"onValueChange\" | \"children\"\n > {\n options: readonly RadioOption[];\n label: ReactNode;\n onValueChange?: (value: string) => void;\n children?: ReactNode;\n}\nexport const RadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(\n function RadioGroup(\n { options, label, onValueChange, className, children, ...rest },\n ref\n ) {\n return (\n <ArkRadioGroup.Root\n {...rest}\n ref={ref}\n onValueChange={(details) => {\n if (details.value !== null) onValueChange?.(details.value);\n }}\n className={classes(\"dds-radio-group\", className)}\n >\n <ArkRadioGroup.Label className=\"dds-field__label\">\n {label}\n </ArkRadioGroup.Label>\n {options.map((option) => (\n <ArkRadioGroup.Item\n key={option.value}\n value={option.value}\n disabled={option.disabled}\n className=\"dds-check\"\n >\n <VisibleRadioInput option={option} />\n <ArkRadioGroup.ItemText>{option.label}</ArkRadioGroup.ItemText>\n </ArkRadioGroup.Item>\n ))}\n {children}\n </ArkRadioGroup.Root>\n );\n }\n);\n","import {\n forwardRef,\n type ComponentProps,\n type ButtonHTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport { Dialog as ArkDialog } from \"@ark-ui/react/dialog\";\nimport { Tooltip as ArkTooltip } from \"@ark-ui/react/tooltip\";\nimport { Portal } from \"@ark-ui/react/portal\";\nimport { classes } from \"./controls\";\nexport interface DialogFrameParts {\n title: ReactNode;\n description: ReactNode;\n children: ReactNode;\n actions: ReactNode;\n}\nexport interface DialogProps\n extends Omit<\n ComponentProps<typeof ArkDialog.Root>,\n \"children\" | \"onOpenChange\"\n > {\n title: ReactNode;\n description?: ReactNode;\n children: ReactNode;\n actions?: ReactNode;\n onOpenChange?: (open: boolean) => void;\n closeOnOutside?: boolean;\n portal?: boolean;\n className?: string;\n overlayClassName?: string;\n contentProps?: ComponentProps<typeof ArkDialog.Content>;\n initialFocus?: () => HTMLElement | null | undefined;\n finalFocus?: () => HTMLElement | null | undefined;\n frame?: (parts: DialogFrameParts) => ReactNode;\n unstyled?: boolean;\n}\nexport const Dialog = forwardRef<HTMLDivElement, DialogProps>(function Dialog(\n {\n title,\n description,\n children,\n actions,\n onOpenChange,\n closeOnOutside,\n portal = true,\n className,\n overlayClassName,\n contentProps,\n initialFocus,\n finalFocus,\n frame,\n unstyled,\n ...rest\n },\n ref\n) {\n const parts: DialogFrameParts = {\n title: (\n <ArkDialog.Title className={unstyled ? undefined : \"dds-dialog__title\"}>\n {title}\n </ArkDialog.Title>\n ),\n description: description && (\n <ArkDialog.Description\n className={unstyled ? undefined : \"dds-dialog__body\"}\n >\n {description}\n </ArkDialog.Description>\n ),\n children,\n actions: actions && (\n <div className={unstyled ? undefined : \"dds-dialog__actions\"}>\n {actions}\n </div>\n ),\n };\n const content = (\n <ArkDialog.Positioner\n className={classes(!unstyled && \"dds-dialog-overlay\", overlayClassName)}\n >\n <ArkDialog.Content\n {...contentProps}\n ref={ref}\n aria-describedby={\n description ? contentProps?.[\"aria-describedby\"] : undefined\n }\n className={classes(\n !unstyled && \"dds-dialog\",\n className,\n contentProps?.className\n )}\n >\n {frame ? (\n frame(parts)\n ) : (\n <>\n {parts.title}\n {parts.description}\n {children}\n {parts.actions}\n </>\n )}\n </ArkDialog.Content>\n </ArkDialog.Positioner>\n );\n return (\n <ArkDialog.Root\n {...rest}\n onOpenChange={(details) => onOpenChange?.(details.open)}\n closeOnInteractOutside={closeOnOutside ?? rest.closeOnInteractOutside}\n initialFocusEl={\n initialFocus ? () => initialFocus() ?? null : rest.initialFocusEl\n }\n finalFocusEl={finalFocus ? () => finalFocus() ?? null : rest.finalFocusEl}\n lazyMount\n unmountOnExit\n >\n {portal ? <Portal>{content}</Portal> : content}\n </ArkDialog.Root>\n );\n});\nexport type TooltipTriggerProps = ButtonHTMLAttributes<HTMLButtonElement>;\nexport interface TooltipProps\n extends Omit<\n ComponentProps<typeof ArkTooltip.Root>,\n \"children\" | \"onOpenChange\"\n > {\n content: ReactNode;\n children: ReactNode | ((props: TooltipTriggerProps) => ReactNode);\n onOpenChange?: (open: boolean) => void;\n className?: string;\n contentProps?: ComponentProps<typeof ArkTooltip.Content>;\n}\nexport function Tooltip({\n content,\n children,\n onOpenChange,\n className,\n contentProps,\n ...rest\n}: TooltipProps) {\n return (\n <ArkTooltip.Root\n openDelay={0}\n closeDelay={0}\n {...rest}\n onOpenChange={(details) => onOpenChange?.(details.open)}\n >\n <span className={classes(\"dds-tooltip\", className)}>\n {typeof children === \"function\" ? (\n <ArkTooltip.Context>\n {(api) => children(api.getTriggerProps())}\n </ArkTooltip.Context>\n ) : (\n <ArkTooltip.Trigger asChild>{children}</ArkTooltip.Trigger>\n )}\n <Portal>\n <ArkTooltip.Positioner>\n <ArkTooltip.Content\n {...contentProps}\n className={classes(\n \"dds-tooltip__bubble\",\n contentProps?.className\n )}\n >\n {content}\n </ArkTooltip.Content>\n </ArkTooltip.Positioner>\n </Portal>\n </span>\n </ArkTooltip.Root>\n );\n}\n","import { forwardRef, type SVGProps } from \"react\";\nimport { icons, directionPolicy, type DdsIconName } from \"@devslab/dds-icons\";\nimport { classes } from \"./controls\";\nexport interface IconProps\n extends Omit<SVGProps<SVGSVGElement>, \"name\" | \"children\"> {\n name: DdsIconName;\n label?: string;\n size?: number | string;\n directional?: boolean;\n}\nexport const Icon = forwardRef<SVGSVGElement, IconProps>(function Icon(\n { name, label, size = 24, directional, className, ...rest },\n ref\n) {\n const icon = icons[name];\n return (\n <svg\n {...rest}\n ref={ref}\n viewBox={icon.viewBox}\n width={size}\n height={size}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={icon.strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n role={label ? \"img\" : undefined}\n aria-label={label}\n aria-hidden={label ? undefined : true}\n className={classes(\n (directional ?? directionPolicy.mirrorInRtl.includes(name)) &&\n directionPolicy.cssClass,\n className\n )}\n >\n {label && <title>{label}</title>}\n <g dangerouslySetInnerHTML={{ __html: icon.body }} />\n </svg>\n );\n});\n","import {\n createContext,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n type ReactNode,\n} from \"react\";\nimport { Toast as ArkToast, Toaster, createToaster } from \"@ark-ui/react/toast\";\nimport { classes } from \"./controls\";\nexport type ToastTone = \"success\" | \"warning\" | \"danger\" | \"info\";\nexport interface ToastInput {\n message: ReactNode;\n tone?: ToastTone;\n duration?: number;\n}\nexport interface ToastRecord extends ToastInput {\n id: string;\n}\nexport interface ToastApi {\n show: (toast: ToastInput) => string;\n dismiss: (id: string) => void;\n clear: () => void;\n}\nexport interface ToastProviderProps {\n children: ReactNode;\n defaultDuration?: number;\n dismissLabel?: string | ((toast: ToastRecord) => string);\n regionLabel?: string;\n className?: string;\n}\nconst ToastContext = createContext<ToastApi | null>(null);\nexport function ToastProvider({\n children,\n defaultDuration = 5000,\n dismissLabel,\n regionLabel,\n className,\n}: ToastProviderProps) {\n const prefix = useId();\n const sequence = useRef(0);\n const toaster = useMemo(\n () =>\n createToaster({\n placement: \"bottom-end\",\n overlap: false,\n gap: 8,\n offsets: \"var(--dds-space-16)\",\n removeDelay: 0,\n hotkey: [\"DDS_NO_HOTKEY\"],\n }),\n []\n );\n const api = useMemo<ToastApi>(() => {\n return {\n show(input) {\n const id = `dds-toast-${prefix}-${++sequence.current}`;\n const duration = input.duration ?? defaultDuration;\n toaster.create({\n id,\n description: input.message,\n type: input.tone === \"danger\" ? \"error\" : input.tone ?? \"info\",\n duration: duration > 0 ? duration : Infinity,\n meta: { dds: { ...input, id } },\n });\n return id;\n },\n dismiss: (id) => toaster.remove(id),\n clear: () => toaster.remove(),\n };\n }, [toaster, prefix, defaultDuration]);\n useEffect(() => () => toaster.remove(), [toaster]);\n return (\n <ToastContext.Provider value={api}>\n {children}\n <Toaster\n toaster={toaster}\n label={regionLabel ?? \"\"}\n aria-label={regionLabel ?? \"\"}\n role={regionLabel ? \"region\" : \"presentation\"}\n className={classes(\"dds-toast-region\", className)}\n >\n {(toast) => {\n const record = toast.meta?.dds as ToastRecord;\n return (\n <ArkToast.Root\n className={classes(\n \"dds-toast\",\n `dds-toast--${record.tone ?? \"info\"}`\n )}\n role={record.tone === \"danger\" ? \"alert\" : \"status\"}\n >\n <ArkToast.Description>{toast.description}</ArkToast.Description>\n {dismissLabel && (\n <ArkToast.CloseTrigger\n className=\"dds-iconbtn dds-iconbtn--sm\"\n aria-label={\n typeof dismissLabel === \"function\"\n ? dismissLabel(record)\n : dismissLabel\n }\n >\n ×\n </ArkToast.CloseTrigger>\n )}\n </ArkToast.Root>\n );\n }}\n </Toaster>\n </ToastContext.Provider>\n );\n}\nexport function useToast(): ToastApi {\n const api = useContext(ToastContext);\n if (!api) throw new Error(\"useToast must be called inside <ToastProvider>\");\n return api;\n}\n","import {\n forwardRef,\n useEffect,\n useId,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport { classes } from \"./controls\";\nexport interface ConsoleNavItem {\n id: string;\n href: string;\n label: string;\n badge?: number;\n active?: boolean;\n}\nexport interface ConsoleNavGroup {\n label: string;\n items: readonly ConsoleNavItem[];\n}\nexport interface ConsoleShellLabels {\n skip: string;\n menuOpen: string;\n menuClose: string;\n nav: string;\n badge: string;\n}\nexport interface ConsoleHeader {\n eyebrow?: string;\n title: string;\n actions?: ReactNode;\n}\nexport interface ConsoleShellProps\n extends Omit<HTMLAttributes<HTMLDivElement>, \"children\" | \"context\"> {\n surface: string;\n activePath: string;\n brand: { href: string; name: string; mark: string };\n context?: readonly { label: string; value: string }[];\n nav: readonly ConsoleNavGroup[];\n labels: ConsoleShellLabels;\n header: ConsoleHeader;\n foot?: ReactNode;\n children: ReactNode;\n}\nfunction isActive(path: string, item: ConsoleNavItem) {\n return (\n item.active ??\n (item.href.split(\"/\").filter(Boolean).length <= 1\n ? path === item.href\n : path === item.href || path.startsWith(`${item.href}/`))\n );\n}\nexport const ConsoleShell = forwardRef<HTMLDivElement, ConsoleShellProps>(\n function ConsoleShell(\n {\n surface,\n activePath,\n brand,\n context,\n nav,\n labels,\n header,\n foot,\n children,\n className,\n ...rest\n },\n ref\n ) {\n const [open, setOpen] = useState(false);\n const [hydrated, setHydrated] = useState(false);\n const id = useId();\n const railId = `dds-console-rail-${id}`;\n const mainId = `dds-console-main-${id}`;\n useEffect(() => {\n setHydrated(true);\n const onKey = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") setOpen(false);\n };\n document.addEventListener(\"keydown\", onKey);\n return () => document.removeEventListener(\"keydown\", onKey);\n }, []);\n return (\n <div\n {...rest}\n ref={ref}\n className={classes(\"dds-console-shell\", className)}\n data-surface={surface}\n data-hydrated={hydrated ? \"true\" : undefined}\n >\n <a className=\"dds-console-skip dds-visually-hidden\" href={`#${mainId}`}>\n {labels.skip}\n </a>\n <button\n className=\"dds-console-rail__toggle\"\n type=\"button\"\n data-action=\"toggle-rail\"\n aria-controls={railId}\n aria-expanded={open}\n onClick={() => setOpen(!open)}\n >\n <span aria-hidden />\n <span className=\"dds-visually-hidden\">\n {open ? labels.menuClose : labels.menuOpen}\n </span>\n </button>\n <div\n className=\"dds-console-rail__scrim\"\n data-open={String(open)}\n onClick={() => setOpen(false)}\n />\n <aside\n id={railId}\n className=\"dds-console-rail\"\n data-open={String(open)}\n >\n <a className=\"dds-console-rail__brand\" href={brand.href}>\n <img src={brand.mark} alt=\"\" width={20} height={20} />\n <strong>{brand.name}</strong>\n </a>\n {context && context.length > 0 && (\n <dl className=\"dds-console-rail__context\">\n {context.map((row, index) => (\n <div key={index}>\n <dt>{row.label}</dt>\n <dd>{row.value}</dd>\n </div>\n ))}\n </dl>\n )}\n <nav className=\"dds-console-rail__nav\" aria-label={labels.nav}>\n {nav.map((group, index) => (\n <section\n key={index}\n className=\"dds-console-rail__group\"\n aria-labelledby={`${id}-group-${index}`}\n >\n <h2\n id={`${id}-group-${index}`}\n className=\"dds-console-rail__group-label\"\n >\n {group.label}\n </h2>\n <ul>\n {group.items.map((item) => (\n <li key={item.id}>\n <a\n className=\"dds-console-rail__item\"\n data-nav={`${surface}.${item.id}`}\n href={item.href}\n aria-current={\n isActive(activePath, item) ? \"page\" : undefined\n }\n onClick={() => setOpen(false)}\n >\n <span>{item.label}</span>\n {item.badge !== undefined && item.badge > 0 && (\n <span\n className=\"dds-console-rail__badge\"\n aria-label={labels.badge.replace(\"{count}\", () =>\n String(item.badge)\n )}\n >\n {item.badge}\n </span>\n )}\n </a>\n </li>\n ))}\n </ul>\n </section>\n ))}\n </nav>\n {foot && <div className=\"dds-console-rail__foot\">{foot}</div>}\n </aside>\n <main id={mainId} className=\"dds-console-main\" tabIndex={-1}>\n <header className=\"dds-console-page-header\">\n <div className=\"dds-console-page-header__text\">\n {header.eyebrow && (\n <p className=\"dds-console-page-eyebrow\">{header.eyebrow}</p>\n )}\n <h1>{header.title}</h1>\n </div>\n {header.actions && (\n <div className=\"dds-console-page-header__actions\">\n {header.actions}\n </div>\n )}\n </header>\n {children}\n </main>\n </div>\n );\n }\n);\n","export type StatusTone = \"success\" | \"warning\" | \"danger\" | \"info\" | \"brand\" | \"neutral\";\nexport function createStatusPill<D extends string>(config:{\n tones:Record<D,Record<string,StatusTone>>;\n label:(domain:D,value:string,locale:string)=>string|undefined;\n openDomains?:readonly NoInfer<D>[];\n}){\n const open=new Set<string>(config.openDomains??[]);\n return function StatusPill(props:{domain:D;value:string;locale:string}){\n const tone=config.tones[props.domain]?.[props.value];\n const label=config.label(props.domain,props.value,props.locale);\n if(!tone||!label){\n if(open.has(props.domain))return <code data-status={`${props.domain}.${props.value}`}>{props.value}</code>;\n throw new Error(!tone?`StatusPill: no tone for ${props.domain}.${props.value}`:`StatusPill: no label for ${props.domain}.${props.value}`);\n }\n return <span className={tone==='neutral'?'dds-badge':`dds-badge dds-badge--${tone}`} data-status={`${props.domain}.${props.value}`} data-tone={tone}>{label}</span>;\n };\n}\n","import { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\n\n/** Options for one `run` call. */\nexport interface PendingActionRunOptions {\n /**\n * Start even while another action runs: that one is aborted and this one takes its place, so the\n * latest request wins (a list reload after typing, paging or sorting). Without it a second start\n * while one runs is ignored, which is what a button wants.\n */\n replace?: boolean;\n}\n\n/**\n * Which of a screen's actions is running. A screen with several buttons gives each one its own\n * key, so only the button that started the work shows progress, while every other control can\n * still be locked through `busy`. One shared flag for all the buttons spins every one of them.\n * The same contract as `createPendingAction` in `@devslab/dds-solid`, with values for accessors.\n */\nexport interface PendingAction<K extends string = string> {\n /** The key of the action now running, or null. */\n readonly current: K | null;\n /** True while any action runs: lock the other controls with it. */\n readonly busy: boolean;\n /** True while `key` is the running action: give that control its progress state. */\n is(key: K): boolean;\n /**\n * Runs `task` as `key` and clears the state when it settles, whether it resolves or throws (the\n * error reaches the caller). While another action runs it does nothing and resolves to undefined,\n * unless `replace` is set. The task receives a signal that aborts when this run stops counting:\n * `reset()`, a run that replaced it, or the component unmounting. Check `signal.aborted` after\n * each await before touching state, or pass the signal to `fetch`.\n */\n run<T>(key: K, task: (signal: AbortSignal) => T | Promise<T>, options?: PendingActionRunOptions): Promise<T | undefined>;\n /** Stops tracking the running action and aborts its signal, for example when the screen's data was replaced. */\n reset(): void;\n}\n\n/** Tracks the running action of a component. */\nexport function usePendingAction<K extends string = string>(): PendingAction<K> {\n const [current, setCurrent] = useState<K | null>(null);\n // State lands on the next render; the ref answers a second click in the same event loop turn.\n const active = useRef<AbortController | null>(null);\n useEffect(() => () => {\n active.current?.abort();\n active.current = null;\n }, []);\n const run = useCallback(async <T,>(\n key: K,\n task: (signal: AbortSignal) => T | Promise<T>,\n options?: PendingActionRunOptions,\n ): Promise<T | undefined> => {\n if (active.current && !options?.replace) return undefined;\n active.current?.abort();\n const controller = new AbortController();\n active.current = controller;\n setCurrent(key);\n try {\n return await task(controller.signal);\n } finally {\n if (active.current === controller) {\n active.current = null;\n setCurrent(null);\n }\n }\n }, []);\n const reset = useCallback(() => {\n active.current?.abort();\n active.current = null;\n setCurrent(null);\n }, []);\n return useMemo(() => ({\n current,\n busy: current !== null,\n is: (key: K) => current === key,\n run,\n reset,\n }), [current, run, reset]);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,IAAa,KAAO,EAAsC,SACxD,EAAE,kBAAe,aAAU,cAAW,GAAG,KACzC,GACA;CACA,OACE,kBAAC,EAAQ,MAAT;EACE,GAAI;EACC;EACL,gBAAgB,MAAY,IAAgB,EAAQ,KAAK;EACzD,WAAW,EAAQ,CAAC,KAAY,iBAAiB,CAAS;CAC3D,CAAA;AAEL,CAAC,GAKY,KAAU,EAGrB,SAAiB,EAAE,aAAU,cAAW,GAAG,KAAQ,GAAK;CACxD,OACE,kBAAC,EAAQ,MAAT;EACE,GAAI;EACC;EACL,WAAW,EAAQ,CAAC,KAAY,YAAY,CAAS;CACtD,CAAA;AAEL,CAAC,GACY,KAAM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