@devslab/dds-solid 0.9.0 → 0.11.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.
@@ -0,0 +1,63 @@
1
+ import { type JSX } from "solid-js";
2
+ /** One item in a nav group's list. `active` is a caller override — pass it
3
+ * only when the generic prefix rule below gets a route wrong. "Index route"
4
+ * in that rule means an `href` exactly one path segment deep (e.g.
5
+ * `/dashboard`); a console mounted under a path prefix (so its own root is
6
+ * two or more segments deep) should pass `active` explicitly on that item
7
+ * rather than rely on the generic rule. */
8
+ export interface ConsoleNavItem {
9
+ id: string;
10
+ href: string;
11
+ label: string;
12
+ badge?: number;
13
+ active?: boolean;
14
+ }
15
+ export interface ConsoleNavGroup {
16
+ label: string;
17
+ items: readonly ConsoleNavItem[];
18
+ }
19
+ export interface ConsoleShellLabels {
20
+ skip: string;
21
+ menuOpen: string;
22
+ menuClose: string;
23
+ /** Accessible name for the rail's `<nav>` landmark (e.g. "Dashboard
24
+ * navigation"). Required, not optional: a console page also has the
25
+ * DataTable's pagination `<nav>` (named via its own `labels.nextPage`),
26
+ * and an unnamed landmark next to a named one is a regression a
27
+ * screen-reader user would notice immediately — the rail is the primary
28
+ * nav, so it must never be the anonymous one. */
29
+ nav: string;
30
+ /** Badge accessible name template. `{count}` is substituted with the
31
+ * item's pending count — DDS supplies no words of its own. */
32
+ badge: string;
33
+ }
34
+ export interface ConsoleHeader {
35
+ eyebrow?: string;
36
+ title: string;
37
+ actions?: JSX.Element;
38
+ }
39
+ export interface ConsoleShellProps {
40
+ surface: string;
41
+ activePath: string;
42
+ brand: {
43
+ href: string;
44
+ name: string;
45
+ mark: string;
46
+ };
47
+ /** Lines pinned under the brand — a product's organization, environment,
48
+ * or role context. */
49
+ context?: readonly {
50
+ label: string;
51
+ value: string;
52
+ }[];
53
+ nav: readonly ConsoleNavGroup[];
54
+ labels: ConsoleShellLabels;
55
+ header: ConsoleHeader;
56
+ /** Slot for the rail's bottom — DDS must not depend on site-kit, so a
57
+ * theme toggle, locale picker, or sign-out form all arrive as children
58
+ * the product renders itself. */
59
+ foot?: JSX.Element;
60
+ children: JSX.Element;
61
+ }
62
+ export declare function ConsoleShell(props: ConsoleShellProps): JSX.Element;
63
+ //# sourceMappingURL=console-shell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"console-shell.d.ts","sourceRoot":"","sources":["../src/console-shell.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+D,KAAK,GAAG,EAAE,MAAM,UAAU,CAAC;AAEjG;;;;;2CAK2C;AAC3C,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,cAAc,EAAE,CAAC;CAClC;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;qDAKiD;IACjD,GAAG,EAAE,MAAM,CAAC;IACZ;kEAC8D;IAC9D,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACpD;0BACsB;IACtB,OAAO,CAAC,EAAE,SAAS;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACtD,GAAG,EAAE,SAAS,eAAe,EAAE,CAAC;IAChC,MAAM,EAAE,kBAAkB,CAAC;IAC3B,MAAM,EAAE,aAAa,CAAC;IACtB;;qCAEiC;IACjC,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACnB,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC;CACvB;AAsBD,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,GAAG,CAAC,OAAO,CA8FlE"}
package/dist/index.d.ts CHANGED
@@ -1,7 +1,10 @@
1
1
  export { createControllableSignal, type ControllableOptions } from "./controllable";
2
2
  export { Button, Checkbox, Field, IconButton, Radio, Select, Switch, type ButtonProps, type ButtonTone, type CheckboxProps, type FieldControlProps, type FieldProps, type IconButtonProps, type RadioProps, type SelectProps, type SwitchProps, type ControlSize, } from "./controls";
3
+ export { ConsoleShell, type ConsoleHeader, type ConsoleNavGroup, type ConsoleNavItem, type ConsoleShellLabels, type ConsoleShellProps } from "./console-shell";
3
4
  export { Dialog, type DialogProps } from "./dialog";
4
5
  export { Icon, type IconProps } from "./icon";
6
+ export { createStatusPill } from "./status-pill";
7
+ export type { StatusTone } from "./status-pill";
5
8
  export { Tab, TabList, TabPanel, Tabs, type TabPanelProps, type TabProps, type TabsProps } from "./tabs";
6
9
  export { ToastProvider, useToast, type ToastApi, type ToastInput, type ToastProviderProps, type ToastTone } from "./toast";
7
10
  export { Tooltip, type TooltipProps, type TooltipTriggerProps } from "./tooltip";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACpF,OAAO,EACL,MAAM,EACN,QAAQ,EACR,KAAK,EACL,UAAU,EACV,KAAK,EACL,MAAM,EACN,MAAM,EACN,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,WAAW,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,aAAa,EAAE,KAAK,QAAQ,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AACzG,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAE,KAAK,kBAAkB,EAAE,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAC3H,OAAO,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACpF,OAAO,EACL,MAAM,EACN,QAAQ,EACR,KAAK,EACL,UAAU,EACV,KAAK,EACL,MAAM,EACN,MAAM,EACN,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,WAAW,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,YAAY,EAAE,KAAK,aAAa,EAAE,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,KAAK,kBAAkB,EAAE,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAC/J,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,aAAa,EAAE,KAAK,QAAQ,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AACzG,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAE,KAAK,kBAAkB,EAAE,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAC3H,OAAO,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,WAAW,CAAC"}
package/dist/index.js CHANGED
@@ -19,8 +19,8 @@ function k(...e) {
19
19
  }
20
20
  //#endregion
21
21
  //#region src/controls.tsx
22
- var A = /*#__PURE__*/ C("<button><!$><!/><!$><!/>"), j = /*#__PURE__*/ C("<span class=dds-spinner aria-hidden=true>"), M = /*#__PURE__*/ C("<button>"), ee = /*#__PURE__*/ C("<div><label class=dds-field__label><!$><!/><!$><!/></label><!$><!/><!$><!/><!$><!/>"), te = /*#__PURE__*/ C("<span aria-hidden=true> *"), ne = /*#__PURE__*/ C("<div class=dds-field__help>"), re = /*#__PURE__*/ C("<div class=dds-field__error role=alert>"), ie = /*#__PURE__*/ C("<span><select>"), N = /*#__PURE__*/ C("<label><input><span>");
23
- function P(e) {
22
+ var A = /*#__PURE__*/ C("<button><!$><!/><!$><!/>"), j = /*#__PURE__*/ C("<span class=dds-spinner aria-hidden=true>"), M = /*#__PURE__*/ C("<button>"), N = /*#__PURE__*/ C("<div><label class=dds-field__label><!$><!/><!$><!/></label><!$><!/><!$><!/><!$><!/>"), P = /*#__PURE__*/ C("<span aria-hidden=true> *"), F = /*#__PURE__*/ C("<div class=dds-field__help>"), I = /*#__PURE__*/ C("<div class=dds-field__error role=alert>"), L = /*#__PURE__*/ C("<span><select>"), R = /*#__PURE__*/ C("<label><input><span>");
23
+ function z(e) {
24
24
  let [t, n] = c(e, [
25
25
  "class",
26
26
  "tone",
@@ -51,7 +51,7 @@ function P(e) {
51
51
  })(), i, a), g(e, () => t.children, s, c), y(), e;
52
52
  })();
53
53
  }
54
- function F(e) {
54
+ function B(e) {
55
55
  let [t, n] = c(e, [
56
56
  "class",
57
57
  "tone",
@@ -82,7 +82,7 @@ function F(e) {
82
82
  })()), y(), e;
83
83
  })();
84
84
  }
85
- function I(e) {
85
+ function V(e) {
86
86
  let t = a(), n = () => e.id ?? `dds-field-${t}`, r = () => e.helpText ? `${n()}-help` : void 0, i = () => e.error ? `${n()}-error` : void 0, o = () => ({
87
87
  id: n(),
88
88
  "aria-describedby": k(r(), i()),
@@ -90,23 +90,23 @@ function I(e) {
90
90
  "aria-required": e.required ? "true" : void 0
91
91
  });
92
92
  return (() => {
93
- var t = m(ee), a = t.firstChild, s = a.firstChild, [c, l] = h(s.nextSibling), d = c.nextSibling, [f, v] = h(d.nextSibling), y = a.nextSibling, [x, S] = h(y.nextSibling), C = x.nextSibling, [w, T] = h(C.nextSibling), E = w.nextSibling, [D, k] = h(E.nextSibling);
93
+ var t = m(N), a = t.firstChild, s = a.firstChild, [c, l] = h(s.nextSibling), d = c.nextSibling, [f, v] = h(d.nextSibling), y = a.nextSibling, [x, S] = h(y.nextSibling), C = x.nextSibling, [w, T] = h(C.nextSibling), E = w.nextSibling, [D, k] = h(E.nextSibling);
94
94
  return g(a, () => e.label, c, l), g(a, (() => {
95
95
  var t = _(() => !!e.required);
96
- return () => t() && m(te);
96
+ return () => t() && m(P);
97
97
  })(), f, v), g(t, (() => {
98
98
  var t = _(() => typeof e.children == "function");
99
99
  return () => t() ? e.children(o()) : e.children;
100
100
  })(), x, S), g(t, (() => {
101
101
  var t = _(() => !!e.helpText);
102
102
  return () => t() && (() => {
103
- var t = m(ne);
103
+ var t = m(F);
104
104
  return g(t, () => e.helpText), p(() => b(t, "id", r())), t;
105
105
  })();
106
106
  })(), w, T), g(t, (() => {
107
107
  var t = _(() => !!e.error);
108
108
  return () => t() && (() => {
109
- var t = m(re);
109
+ var t = m(I);
110
110
  return g(t, () => e.error), p(() => b(t, "id", i())), t;
111
111
  })();
112
112
  })(), D, k), p((r) => {
@@ -118,14 +118,14 @@ function I(e) {
118
118
  }), t;
119
119
  })();
120
120
  }
121
- function L(e) {
121
+ function H(e) {
122
122
  let [t, n] = c(e, [
123
123
  "class",
124
124
  "invalid",
125
125
  "children"
126
126
  ]);
127
127
  return (() => {
128
- var e = m(ie), r = e.firstChild;
128
+ var e = m(L), r = e.firstChild;
129
129
  return S(r, v(n, {
130
130
  class: "dds-select__input",
131
131
  get "aria-invalid"() {
@@ -134,7 +134,7 @@ function L(e) {
134
134
  }), !1, !0), g(r, () => t.children), p(() => u(e, O("dds-select", t.class))), y(), e;
135
135
  })();
136
136
  }
137
- function R(e) {
137
+ function U(e) {
138
138
  let [t, n] = c(e, [
139
139
  "checked",
140
140
  "defaultChecked",
@@ -150,7 +150,7 @@ function R(e) {
150
150
  onChange: t.onCheckedChange
151
151
  });
152
152
  return (() => {
153
- var e = m(N), a = e.firstChild, o = a.nextSibling;
153
+ var e = m(R), a = e.firstChild, o = a.nextSibling;
154
154
  return S(a, v(n, {
155
155
  get type() {
156
156
  return t.type;
@@ -168,10 +168,122 @@ function R(e) {
168
168
  }), !1, !1), g(o, () => t.label), p(() => u(e, O(t.role === "switch" ? "dds-switch" : "dds-check", t.class))), y(), e;
169
169
  })();
170
170
  }
171
- var z = (e) => d(R, v(e, { type: "checkbox" })), B = (e) => d(R, v(e, { type: "radio" })), V = (e) => d(R, v(e, {
171
+ var W = (e) => d(U, v(e, { type: "checkbox" })), ee = (e) => d(U, v(e, { type: "radio" })), te = (e) => d(U, v(e, {
172
172
  type: "checkbox",
173
173
  role: "switch"
174
- })), H = /*#__PURE__*/ C("<div class=dds-dialog-overlay><div role=dialog aria-modal=true tabindex=-1><h2 class=dds-dialog__title></h2><!$><!/><!$><!/><!$><!/>"), U = /*#__PURE__*/ C("<div class=dds-dialog__body>"), W = /*#__PURE__*/ C("<div class=dds-dialog__actions>"), G = [
174
+ })), ne = /*#__PURE__*/ C("<dl class=dds-console-rail__context>"), re = /*#__PURE__*/ C("<div class=dds-console-rail__foot>"), ie = /*#__PURE__*/ C("<p class=dds-console-page-eyebrow>"), ae = /*#__PURE__*/ C("<div class=dds-console-page-header__actions>"), oe = /*#__PURE__*/ C("<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><!$><!/>"), G = /*#__PURE__*/ C("<div><dt></dt><dd>"), K = /*#__PURE__*/ C("<section class=dds-console-rail__group><h2 class=dds-console-rail__group-label></h2><ul>"), q = /*#__PURE__*/ C("<span class=dds-console-rail__badge>"), se = /*#__PURE__*/ C("<li><a class=dds-console-rail__item><span></span><!$><!/>");
175
+ function ce(e, t, n) {
176
+ return n === void 0 ? t.split("/").filter(Boolean).length <= 1 ? e === t : e === t || e.startsWith(`${t}/`) : n;
177
+ }
178
+ function le(e, t) {
179
+ return e.replace("{count}", () => String(t));
180
+ }
181
+ function ue(n) {
182
+ let [r, c] = i(!1), l = () => c(!1), [u, f] = i(!1);
183
+ return s(() => {
184
+ f(!0);
185
+ let e = (e) => {
186
+ e.key === "Escape" && l();
187
+ };
188
+ document.addEventListener("keydown", e), o(() => document.removeEventListener("keydown", e));
189
+ }), (() => {
190
+ var i = m(oe), o = i.firstChild, s = o.nextSibling, f = s.firstChild.nextSibling, v = s.nextSibling, x = v.nextSibling, S = x.firstChild, C = S.firstChild, w = C.nextSibling, T = S.nextSibling, [E, D] = h(T.nextSibling), O = E.nextSibling, k = O.nextSibling, [A, j] = h(k.nextSibling), M = x.nextSibling, N = M.firstChild, P = N.firstChild, F = P.firstChild, [I, L] = h(F.nextSibling), R = I.nextSibling, z = P.nextSibling, [B, V] = h(z.nextSibling), H = N.nextSibling, [U, W] = h(H.nextSibling);
191
+ return g(o, () => n.labels.skip), s.$$click = () => c(!r()), g(f, (() => {
192
+ var e = _(() => !!r());
193
+ return () => e() ? n.labels.menuClose : n.labels.menuOpen;
194
+ })()), v.$$click = l, g(w, () => n.brand.name), g(x, d(t, {
195
+ get when() {
196
+ return _(() => !!n.context)() && n.context.length > 0;
197
+ },
198
+ get children() {
199
+ var t = m(ne);
200
+ return g(t, d(e, {
201
+ get each() {
202
+ return n.context;
203
+ },
204
+ children: (e) => (() => {
205
+ var t = m(G), n = t.firstChild, r = n.nextSibling;
206
+ return g(n, () => e.label), g(r, () => e.value), t;
207
+ })()
208
+ })), t;
209
+ }
210
+ }), E, D), g(O, d(e, {
211
+ get each() {
212
+ return n.nav;
213
+ },
214
+ children: (r) => {
215
+ let i = `dds-console-group-${a()}`;
216
+ return (() => {
217
+ var a = m(K), o = a.firstChild, s = o.nextSibling;
218
+ return b(a, "aria-labelledby", i), b(o, "id", i), g(o, () => r.label), g(s, d(e, {
219
+ get each() {
220
+ return r.items;
221
+ },
222
+ children: (e) => (() => {
223
+ var r = m(se), i = r.firstChild, a = i.firstChild, o = a.nextSibling, [s, c] = h(o.nextSibling);
224
+ return i.$$click = l, g(a, () => e.label), g(i, d(t, {
225
+ get when() {
226
+ return _(() => e.badge !== void 0)() && e.badge > 0;
227
+ },
228
+ get children() {
229
+ var t = m(q);
230
+ return g(t, () => e.badge), p(() => b(t, "aria-label", le(n.labels.badge, e.badge))), t;
231
+ }
232
+ }), s, c), p((t) => {
233
+ var r = `${n.surface}.${e.id}`, a = e.href, o = ce(n.activePath, e.href, e.active) ? "page" : void 0;
234
+ return r !== t.e && b(i, "data-nav", t.e = r), a !== t.t && b(i, "href", t.t = a), o !== t.a && b(i, "aria-current", t.a = o), t;
235
+ }, {
236
+ e: void 0,
237
+ t: void 0,
238
+ a: void 0
239
+ }), y(), r;
240
+ })()
241
+ })), a;
242
+ })();
243
+ }
244
+ })), g(x, d(t, {
245
+ get when() {
246
+ return n.foot;
247
+ },
248
+ get children() {
249
+ var e = m(re);
250
+ return g(e, () => n.foot), e;
251
+ }
252
+ }), A, j), g(P, d(t, {
253
+ get when() {
254
+ return n.header.eyebrow;
255
+ },
256
+ get children() {
257
+ var e = m(ie);
258
+ return g(e, () => n.header.eyebrow), e;
259
+ }
260
+ }), I, L), g(R, () => n.header.title), g(N, d(t, {
261
+ get when() {
262
+ return n.header.actions;
263
+ },
264
+ get children() {
265
+ var e = m(ae);
266
+ return g(e, () => n.header.actions), e;
267
+ }
268
+ }), B, V), g(M, () => n.children, U, W), p((e) => {
269
+ var t = n.surface, a = u() ? "true" : void 0, o = r(), c = r() ? "true" : "false", l = r() ? "true" : "false", d = n.brand.href, f = n.brand.mark, p = n.labels.nav;
270
+ return t !== e.e && b(i, "data-surface", e.e = t), a !== e.t && b(i, "data-hydrated", e.t = a), o !== e.a && b(s, "aria-expanded", e.a = o), c !== e.o && b(v, "data-open", e.o = c), l !== e.i && b(x, "data-open", e.i = l), d !== e.n && b(S, "href", e.n = d), f !== e.s && b(C, "src", e.s = f), p !== e.h && b(O, "aria-label", e.h = p), e;
271
+ }, {
272
+ e: void 0,
273
+ t: void 0,
274
+ a: void 0,
275
+ o: void 0,
276
+ i: void 0,
277
+ n: void 0,
278
+ s: void 0,
279
+ h: void 0
280
+ }), y(), i;
281
+ })();
282
+ }
283
+ f(["click"]);
284
+ //#endregion
285
+ //#region src/dialog.tsx
286
+ var de = /*#__PURE__*/ C("<div class=dds-dialog-overlay><div role=dialog aria-modal=true tabindex=-1><h2 class=dds-dialog__title></h2><!$><!/><!$><!/><!$><!/>"), fe = /*#__PURE__*/ C("<div class=dds-dialog__body>"), pe = /*#__PURE__*/ C("<div class=dds-dialog__actions>"), J = [
175
287
  "a[href]",
176
288
  "button:not([disabled])",
177
289
  "input:not([disabled])",
@@ -179,7 +291,7 @@ var z = (e) => d(R, v(e, { type: "checkbox" })), B = (e) => d(R, v(e, { type: "r
179
291
  "textarea:not([disabled])",
180
292
  "[tabindex]:not([tabindex='-1'])"
181
293
  ].join(",");
182
- function K(e) {
294
+ function me(e) {
183
295
  let n = a(), i = () => e.id ?? `dds-dialog-${n}`, s = () => `${i()}-title`, c = () => e.description ? `${i()}-description` : void 0, [l, f] = D({
184
296
  value: () => e.open,
185
297
  defaultValue: e.defaultOpen ?? !1,
@@ -188,7 +300,7 @@ function K(e) {
188
300
  return r(() => {
189
301
  if (!l()) return;
190
302
  x = document.activeElement instanceof HTMLElement ? document.activeElement : null, queueMicrotask(() => {
191
- (v?.querySelector(G) ?? v)?.focus();
303
+ (v?.querySelector(J) ?? v)?.focus();
192
304
  });
193
305
  let t = (t) => {
194
306
  if (t.key === "Escape" && e.closeOnEscape !== !1) {
@@ -196,7 +308,7 @@ function K(e) {
196
308
  return;
197
309
  }
198
310
  if (t.key !== "Tab" || !v) return;
199
- let n = [...v.querySelectorAll(G)].filter((e) => !e.hidden && e.getAttribute("aria-hidden") !== "true");
311
+ let n = [...v.querySelectorAll(J)].filter((e) => !e.hidden && e.getAttribute("aria-hidden") !== "true");
200
312
  if (n.length === 0) {
201
313
  t.preventDefault(), v.focus();
202
314
  return;
@@ -212,7 +324,7 @@ function K(e) {
212
324
  return l();
213
325
  },
214
326
  get children() {
215
- var t = m(H), n = t.firstChild, r = n.firstChild, a = r.nextSibling, [o, l] = h(a.nextSibling), d = o.nextSibling, [x, S] = h(d.nextSibling), C = x.nextSibling, [T, E] = h(C.nextSibling);
327
+ var t = m(de), n = t.firstChild, r = n.firstChild, a = r.nextSibling, [o, l] = h(a.nextSibling), d = o.nextSibling, [x, S] = h(d.nextSibling), C = x.nextSibling, [T, E] = h(C.nextSibling);
216
328
  t.$$pointerdown = (t) => {
217
329
  t.target === t.currentTarget && e.closeOnOutside !== !1 && f(!1);
218
330
  };
@@ -220,13 +332,13 @@ function K(e) {
220
332
  return typeof D == "function" ? w(D, n) : v = n, g(r, () => e.title), g(n, (() => {
221
333
  var t = _(() => !!e.description);
222
334
  return () => t() && (() => {
223
- var t = m(U);
335
+ var t = m(fe);
224
336
  return g(t, () => e.description), p(() => b(t, "id", c())), t;
225
337
  })();
226
338
  })(), o, l), g(n, () => e.children, x, S), g(n, (() => {
227
339
  var t = _(() => !!e.actions);
228
340
  return () => t() && (() => {
229
- var t = m(W);
341
+ var t = m(pe);
230
342
  return g(t, () => e.actions), t;
231
343
  })();
232
344
  })(), T, E), p((t) => {
@@ -245,8 +357,8 @@ function K(e) {
245
357
  f(["pointerdown"]);
246
358
  //#endregion
247
359
  //#region src/icon.tsx
248
- var q = /*#__PURE__*/ C("<svg><!$><!/><g>"), J = /*#__PURE__*/ C("<title>");
249
- function ae(e) {
360
+ var he = /*#__PURE__*/ C("<svg><!$><!/><g>"), ge = /*#__PURE__*/ C("<title>");
361
+ function Y(e) {
250
362
  let [t, n] = c(e, [
251
363
  "name",
252
364
  "label",
@@ -255,7 +367,7 @@ function ae(e) {
255
367
  "class"
256
368
  ]), r = () => E[t.name], i = () => t.directional ?? T.mirrorInRtl.includes(t.name);
257
369
  return (() => {
258
- var e = m(q), a = e.firstChild, [o, s] = h(a.nextSibling), c = o.nextSibling;
370
+ var e = m(he), a = e.firstChild, [o, s] = h(a.nextSibling), c = o.nextSibling;
259
371
  return S(e, v(n, {
260
372
  get class() {
261
373
  return O(i() && T.cssClass, t.class);
@@ -288,20 +400,65 @@ function ae(e) {
288
400
  }), !0, !0), g(e, (() => {
289
401
  var e = _(() => !!t.label);
290
402
  return () => e() && (() => {
291
- var e = m(J);
403
+ var e = m(ge);
292
404
  return g(e, () => t.label), e;
293
405
  })();
294
406
  })(), o, s), p(() => x(c, "innerHTML", r().body)), y(), e;
295
407
  })();
296
408
  }
297
409
  //#endregion
410
+ //#region src/status-pill.tsx
411
+ var _e = /*#__PURE__*/ C("<code>"), ve = /*#__PURE__*/ C("<span>");
412
+ function ye(e) {
413
+ let n = new Set(e.openDomains ?? []);
414
+ return function(r) {
415
+ let i = () => e.tones[r.domain]?.[r.value], a = () => e.label(r.domain, r.value, r.locale), o = () => !!(i() && a()), s = () => {
416
+ let e = i();
417
+ if (!e) throw Error(`StatusPill: no tone for ${r.domain}.${r.value}`);
418
+ let t = a();
419
+ if (!t) throw Error(`StatusPill: no label for ${r.domain}.${r.value}`);
420
+ return {
421
+ tone: e,
422
+ text: t
423
+ };
424
+ };
425
+ return d(t, {
426
+ get when() {
427
+ return o() || !n.has(r.domain);
428
+ },
429
+ get fallback() {
430
+ return (() => {
431
+ var e = m(_e);
432
+ return g(e, () => r.value), p(() => b(e, "data-status", `${r.domain}.${r.value}`)), e;
433
+ })();
434
+ },
435
+ get children() {
436
+ return (() => {
437
+ let e = s();
438
+ return (() => {
439
+ var t = m(ve);
440
+ return g(t, () => e.text), p((n) => {
441
+ var i = e.tone === "neutral" ? "dds-badge" : `dds-badge dds-badge--${e.tone}`, a = `${r.domain}.${r.value}`, o = e.tone;
442
+ return i !== n.e && u(t, n.e = i), a !== n.t && b(t, "data-status", n.t = a), o !== n.a && b(t, "data-tone", n.a = o), n;
443
+ }, {
444
+ e: void 0,
445
+ t: void 0,
446
+ a: void 0
447
+ }), t;
448
+ })();
449
+ })();
450
+ }
451
+ });
452
+ };
453
+ }
454
+ //#endregion
298
455
  //#region src/tabs.tsx
299
- var Y = /*#__PURE__*/ C("<div>"), oe = /*#__PURE__*/ C("<button>"), X = n(), Z = () => {
300
- let e = l(X);
456
+ var X = /*#__PURE__*/ C("<div>"), be = /*#__PURE__*/ C("<button>"), Z = n(), Q = () => {
457
+ let e = l(Z);
301
458
  if (!e) throw Error("Tab components must be rendered inside <Tabs>");
302
459
  return e;
303
460
  };
304
- function se(e) {
461
+ function xe(e) {
305
462
  let t = a(), n = () => e.id ?? `dds-tabs-${t}`, [r, i] = D({
306
463
  value: () => e.value,
307
464
  defaultValue: e.defaultValue,
@@ -320,15 +477,15 @@ function se(e) {
320
477
  tabId: (e) => `${n()}-tab-${e}`,
321
478
  panelId: (e) => `${n()}-panel-${e}`
322
479
  };
323
- return d(X.Provider, {
480
+ return d(Z.Provider, {
324
481
  value: s,
325
482
  get children() {
326
483
  return e.children;
327
484
  }
328
485
  });
329
486
  }
330
- function Q(e) {
331
- let t = Z(), [n, r] = c(e, [
487
+ function Se(e) {
488
+ let t = Q(), [n, r] = c(e, [
332
489
  "class",
333
490
  "children",
334
491
  "onKeyDown"
@@ -349,7 +506,7 @@ function Q(e) {
349
506
  s && (s.element.focus(), t.setValue(s.value));
350
507
  };
351
508
  return (() => {
352
- var e = m(Y);
509
+ var e = m(X);
353
510
  return S(e, v(r, {
354
511
  get class() {
355
512
  return O("dds-tabs", n.class);
@@ -362,8 +519,8 @@ function Q(e) {
362
519
  }), !1, !0), g(e, () => n.children), y(), e;
363
520
  })();
364
521
  }
365
- function ce(e) {
366
- let t = Z(), [n, r] = c(e, [
522
+ function Ce(e) {
523
+ let t = Q(), [n, r] = c(e, [
367
524
  "value",
368
525
  "class",
369
526
  "children",
@@ -378,7 +535,7 @@ function ce(e) {
378
535
  });
379
536
  o(e);
380
537
  }), (() => {
381
- var e = m(oe), a = i;
538
+ var e = m(be), a = i;
382
539
  return typeof a == "function" ? w(a, e) : i = e, S(e, v(r, {
383
540
  get id() {
384
541
  return t.tabId(n.value);
@@ -406,14 +563,14 @@ function ce(e) {
406
563
  }), !1, !0), g(e, () => n.children), y(), e;
407
564
  })();
408
565
  }
409
- function le(e) {
410
- let t = Z(), [n, r] = c(e, [
566
+ function we(e) {
567
+ let t = Q(), [n, r] = c(e, [
411
568
  "value",
412
569
  "class",
413
570
  "children"
414
571
  ]);
415
572
  return (() => {
416
- var e = m(Y);
573
+ var e = m(X);
417
574
  return S(e, v(r, {
418
575
  get id() {
419
576
  return t.panelId(n.value);
@@ -434,8 +591,8 @@ function le(e) {
434
591
  }
435
592
  //#endregion
436
593
  //#region src/toast.tsx
437
- var ue = /*#__PURE__*/ C("<div aria-live=polite aria-relevant=\"additions removals\">"), de = /*#__PURE__*/ C("<div><span></span><!$><!/>"), fe = /*#__PURE__*/ C("<button type=button class=\"dds-iconbtn dds-iconbtn--sm\">×"), $ = n();
438
- function pe(t) {
594
+ var Te = /*#__PURE__*/ C("<div aria-live=polite aria-relevant=\"additions removals\">"), Ee = /*#__PURE__*/ C("<div><span></span><!$><!/>"), De = /*#__PURE__*/ C("<button type=button class=\"dds-iconbtn dds-iconbtn--sm\">×"), $ = n();
595
+ function Oe(t) {
439
596
  let [n, r] = i([]), a = /* @__PURE__ */ new Map(), s = 0, c = (e) => {
440
597
  let t = a.get(e);
441
598
  t && clearTimeout(t), a.delete(e), r((t) => t.filter((t) => t.id !== e));
@@ -459,17 +616,17 @@ function pe(t) {
459
616
  value: l,
460
617
  get children() {
461
618
  return [_(() => t.children), (() => {
462
- var r = m(ue);
619
+ var r = m(Te);
463
620
  return g(r, d(e, {
464
621
  get each() {
465
622
  return n();
466
623
  },
467
624
  children: (e) => (() => {
468
- var n = m(de), r = n.firstChild, i = r.nextSibling, [a, o] = h(i.nextSibling);
625
+ var n = m(Ee), r = n.firstChild, i = r.nextSibling, [a, o] = h(i.nextSibling);
469
626
  return g(r, () => e.message), g(n, (() => {
470
627
  var n = _(() => !!t.dismissLabel);
471
628
  return () => n() ? (() => {
472
- var n = m(fe);
629
+ var n = m(De);
473
630
  return n.$$click = () => c(e.id), p(() => b(n, "aria-label", typeof t.dismissLabel == "function" ? t.dismissLabel(e) : t.dismissLabel)), y(), n;
474
631
  })() : null;
475
632
  })(), a, o), p((t) => {
@@ -485,7 +642,7 @@ function pe(t) {
485
642
  }
486
643
  });
487
644
  }
488
- function me() {
645
+ function ke() {
489
646
  let e = l($);
490
647
  if (!e) throw Error("useToast must be called inside <ToastProvider>");
491
648
  return e;
@@ -493,8 +650,8 @@ function me() {
493
650
  f(["click"]);
494
651
  //#endregion
495
652
  //#region src/tooltip.tsx
496
- var he = /*#__PURE__*/ C("<span><!$><!/><span class=dds-tooltip__bubble role=tooltip>");
497
- function ge(e) {
653
+ var Ae = /*#__PURE__*/ C("<span><!$><!/><span class=dds-tooltip__bubble role=tooltip>");
654
+ function je(e) {
498
655
  let t = a(), n = () => e.id ?? `dds-tooltip-${t}`, [r, i] = D({
499
656
  value: () => e.open,
500
657
  defaultValue: e.defaultOpen ?? !1,
@@ -507,7 +664,7 @@ function ge(e) {
507
664
  onPointerLeave: () => i(!1)
508
665
  };
509
666
  return (() => {
510
- var t = m(he), i = t.firstChild, [a, s] = h(i.nextSibling), c = a.nextSibling;
667
+ var t = m(Ae), i = t.firstChild, [a, s] = h(i.nextSibling), c = a.nextSibling;
511
668
  return g(t, () => e.children(o), a, s), g(c, () => e.content), p((i) => {
512
669
  var a = O("dds-tooltip", e.class), o = n(), s = !r();
513
670
  return a !== i.e && u(t, i.e = a), o !== i.t && b(c, "id", i.t = o), s !== i.a && x(c, "hidden", i.a = s), i;
@@ -519,6 +676,6 @@ function ge(e) {
519
676
  })();
520
677
  }
521
678
  //#endregion
522
- export { P as Button, z as Checkbox, K as Dialog, I as Field, ae as Icon, F as IconButton, B as Radio, L as Select, V as Switch, ce as Tab, Q as TabList, le as TabPanel, se as Tabs, pe as ToastProvider, ge as Tooltip, D as createControllableSignal, me as useToast };
679
+ export { z as Button, W as Checkbox, ue as ConsoleShell, me as Dialog, V as Field, Y as Icon, B as IconButton, ee as Radio, H as Select, te as Switch, Ce as Tab, Se as TabList, we as TabPanel, xe as Tabs, Oe as ToastProvider, je as Tooltip, D as createControllableSignal, ye as createStatusPill, ke as useToast };
523
680
 
524
681
  //# sourceMappingURL=index.js.map