@ux-builder/ui 0.0.0-stage → 0.6.1
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/AGENTS.md +275 -0
- package/README.md +293 -2
- package/THIRD-PARTY-NOTICES.md +195 -0
- package/catalogue.json +19424 -0
- package/dist/icons.js +2 -0
- package/dist/index.js +537 -0
- package/dist/index.js.map +1 -0
- package/dist/patterns.css +900 -0
- package/dist/patterns.js +4235 -0
- package/dist/patterns.js.map +1 -0
- package/dist/shared-Bom_GJww.js +18858 -0
- package/dist/shared-Bom_GJww.js.map +1 -0
- package/dist/shared-CjrUPFqv.js +1501 -0
- package/dist/shared-CjrUPFqv.js.map +1 -0
- package/dist/ui.css +997 -0
- package/licenses/carbon.LICENSE +201 -0
- package/licenses/fluent.LICENSE +24 -0
- package/licenses/lucide.LICENSE +43 -0
- package/licenses/material.LICENSE +202 -0
- package/licenses/vendored.json +214 -0
- package/lint/core.mjs +158 -0
- package/lint/eslint.mjs +128 -0
- package/lint/stylelint.mjs +35 -0
- package/package.json +104 -4
- package/skill/ux-builder-ui/SKILL.md +280 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,537 @@
|
|
|
1
|
+
import { A as e, C as t, D as n, E as r, O as i, S as a, T as o, _ as s, a as c, b as l, c as u, d, f, g as p, h as m, i as h, j as g, k as _, l as v, m as y, n as b, o as x, p as S, r as C, s as w, t as T, u as E, v as D, w as ee, x as O, y as k } from "./shared-CjrUPFqv.js";
|
|
2
|
+
import { UC as A, Wu as te, lP as ne } from "./shared-Bom_GJww.js";
|
|
3
|
+
import { cloneElement as re, createContext as ie, useCallback as j, useContext as M, useEffect as N, useId as P, useLayoutEffect as ae, useMemo as oe, useRef as F, useState as I } from "react";
|
|
4
|
+
import { jsx as L, jsxs as R } from "react/jsx-runtime";
|
|
5
|
+
//#region src/widgets/AppearanceSwitch.jsx
|
|
6
|
+
var z = [
|
|
7
|
+
{
|
|
8
|
+
value: "light",
|
|
9
|
+
icon: ne
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
value: "system",
|
|
13
|
+
icon: te
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
value: "dark",
|
|
17
|
+
icon: A
|
|
18
|
+
}
|
|
19
|
+
];
|
|
20
|
+
function B({ value: e = "system", onChange: t, label: n = "Appearance", labels: r = {
|
|
21
|
+
light: "Light",
|
|
22
|
+
system: "Auto",
|
|
23
|
+
dark: "Dark"
|
|
24
|
+
}, available: i, className: a }) {
|
|
25
|
+
let o = F([]), s = z.map((e) => e.value === "system" || !i || i.includes(e.value)), c = Math.max(0, z.findIndex((t) => t.value === e));
|
|
26
|
+
function u(e, n) {
|
|
27
|
+
for (let r = 1; r <= z.length; r++) {
|
|
28
|
+
let i = (e + n * r + z.length * r) % z.length;
|
|
29
|
+
if (s[i]) {
|
|
30
|
+
t?.(z[i].value), o.current[i]?.focus();
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function d(e) {
|
|
36
|
+
let t = {
|
|
37
|
+
ArrowRight: 1,
|
|
38
|
+
ArrowDown: 1,
|
|
39
|
+
ArrowLeft: -1,
|
|
40
|
+
ArrowUp: -1
|
|
41
|
+
}[e.key];
|
|
42
|
+
t ? (e.preventDefault(), u(c, t)) : e.key === "Home" ? (e.preventDefault(), u(-1, 1)) : e.key === "End" && (e.preventDefault(), u(z.length, -1));
|
|
43
|
+
}
|
|
44
|
+
return /* @__PURE__ */ L("div", {
|
|
45
|
+
className: `piq-appearance${a ? ` ${a}` : ""}`,
|
|
46
|
+
role: "radiogroup",
|
|
47
|
+
"aria-label": n,
|
|
48
|
+
onKeyDown: d,
|
|
49
|
+
children: z.map((n, i) => /* @__PURE__ */ L("button", {
|
|
50
|
+
ref: (e) => {
|
|
51
|
+
o.current[i] = e;
|
|
52
|
+
},
|
|
53
|
+
type: "button",
|
|
54
|
+
role: "radio",
|
|
55
|
+
"aria-checked": n.value === e,
|
|
56
|
+
"aria-label": r[n.value],
|
|
57
|
+
title: r[n.value],
|
|
58
|
+
tabIndex: i === c ? 0 : -1,
|
|
59
|
+
disabled: !s[i],
|
|
60
|
+
className: "piq-appearance__opt",
|
|
61
|
+
onClick: () => t?.(n.value),
|
|
62
|
+
children: /* @__PURE__ */ L(l, { icon: n.icon })
|
|
63
|
+
}, n.value))
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region src/widgets/Breadcrumbs.jsx
|
|
68
|
+
function V({ items: e = [], label: t = "Breadcrumb", onNavigate: n, className: r, ...i }) {
|
|
69
|
+
let a = e.length > 1 ? e[e.length - 2] : null, o = (e) => (t) => {
|
|
70
|
+
n && (t.preventDefault(), n(e, t));
|
|
71
|
+
};
|
|
72
|
+
return /* @__PURE__ */ R("nav", {
|
|
73
|
+
"aria-label": t,
|
|
74
|
+
className: `piq-breadcrumbs${r ? ` ${r}` : ""}`,
|
|
75
|
+
...i,
|
|
76
|
+
children: [/* @__PURE__ */ L("ol", {
|
|
77
|
+
className: "piq-breadcrumbs__list",
|
|
78
|
+
children: e.map((t, n) => /* @__PURE__ */ L("li", {
|
|
79
|
+
className: "piq-breadcrumbs__item",
|
|
80
|
+
children: n === e.length - 1 ? t.href ? /* @__PURE__ */ L("a", {
|
|
81
|
+
href: t.href,
|
|
82
|
+
"aria-current": "page",
|
|
83
|
+
onClick: o(t),
|
|
84
|
+
children: t.label
|
|
85
|
+
}) : /* @__PURE__ */ L("span", {
|
|
86
|
+
"aria-current": "page",
|
|
87
|
+
children: t.label
|
|
88
|
+
}) : /* @__PURE__ */ L("a", {
|
|
89
|
+
href: t.href,
|
|
90
|
+
onClick: o(t),
|
|
91
|
+
children: t.label
|
|
92
|
+
})
|
|
93
|
+
}, n))
|
|
94
|
+
}), a && /* @__PURE__ */ R("a", {
|
|
95
|
+
className: "piq-breadcrumbs__back",
|
|
96
|
+
href: a.href,
|
|
97
|
+
onClick: o(a),
|
|
98
|
+
children: [/* @__PURE__ */ L(l, { name: "arrow-left" }), a.label]
|
|
99
|
+
})]
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
//#endregion
|
|
103
|
+
//#region src/widgets/Card.jsx
|
|
104
|
+
function H({ title: e, actions: t, children: n, as: r = "section", ...i }) {
|
|
105
|
+
return /* @__PURE__ */ R(r, {
|
|
106
|
+
className: "piq-card",
|
|
107
|
+
...i,
|
|
108
|
+
children: [
|
|
109
|
+
e && /* @__PURE__ */ L("h3", {
|
|
110
|
+
className: "piq-card__title",
|
|
111
|
+
children: e
|
|
112
|
+
}),
|
|
113
|
+
typeof n == "string" ? /* @__PURE__ */ L("p", {
|
|
114
|
+
className: "piq-card__body",
|
|
115
|
+
children: n
|
|
116
|
+
}) : n,
|
|
117
|
+
t && /* @__PURE__ */ L("div", {
|
|
118
|
+
className: "piq-card__actions",
|
|
119
|
+
children: t
|
|
120
|
+
})
|
|
121
|
+
]
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
//#endregion
|
|
125
|
+
//#region src/widgets/Combobox.jsx
|
|
126
|
+
function U({ label: e, options: t = [], value: n, onChange: r, placeholder: i, hint: a, error: o, emptyLabel: s = "No matches", id: c, className: l }) {
|
|
127
|
+
let d = t.find((e) => e.value === n), [f, p] = I(d?.label ?? ""), [m, h] = I(!1), [g, _] = I(-1), v = P(), y = F(null);
|
|
128
|
+
N(() => {
|
|
129
|
+
m || p(d?.label ?? "");
|
|
130
|
+
}, [d?.label, m]);
|
|
131
|
+
let b = f.trim().toLowerCase(), x = (e) => e.toLowerCase().startsWith(b) || e.toLowerCase().split(/[\s,./()-]+/).some((e) => e.startsWith(b)), S = m && b && b !== (d?.label ?? "").toLowerCase() ? t.filter((e) => x(e.label)) : t, C = (e) => {
|
|
132
|
+
r?.(e.value), p(e.label), h(!1), _(-1);
|
|
133
|
+
};
|
|
134
|
+
function w(e) {
|
|
135
|
+
e.key === "ArrowDown" ? (e.preventDefault(), m || h(!0), _((e) => Math.min(e + 1, S.length - 1))) : e.key === "ArrowUp" ? (e.preventDefault(), m || h(!0), _((e) => Math.max(e - 1, 0))) : e.key === "Enter" ? m && (e.preventDefault(), S[g] && C(S[g])) : e.key === "Escape" && m && (e.preventDefault(), h(!1), _(-1), p(d?.label ?? ""));
|
|
136
|
+
}
|
|
137
|
+
return /* @__PURE__ */ L(u, {
|
|
138
|
+
label: e,
|
|
139
|
+
hint: a,
|
|
140
|
+
error: o,
|
|
141
|
+
id: c,
|
|
142
|
+
className: `piq-combobox${l ? ` ${l}` : ""}`,
|
|
143
|
+
children: (t) => /* @__PURE__ */ R("span", {
|
|
144
|
+
className: "piq-combobox__field",
|
|
145
|
+
children: [
|
|
146
|
+
/* @__PURE__ */ L("input", {
|
|
147
|
+
ref: y,
|
|
148
|
+
...t,
|
|
149
|
+
type: "text",
|
|
150
|
+
role: "combobox",
|
|
151
|
+
className: "piq-field__input",
|
|
152
|
+
autoComplete: "off",
|
|
153
|
+
placeholder: i,
|
|
154
|
+
"aria-expanded": m,
|
|
155
|
+
"aria-controls": `${v}-list`,
|
|
156
|
+
"aria-autocomplete": "list",
|
|
157
|
+
"aria-activedescendant": m && S[g] ? `${v}-${S[g].value}` : void 0,
|
|
158
|
+
value: f,
|
|
159
|
+
onChange: (e) => {
|
|
160
|
+
p(e.target.value), h(!0), _(0);
|
|
161
|
+
},
|
|
162
|
+
onKeyDown: w,
|
|
163
|
+
onBlur: () => {
|
|
164
|
+
h(!1), _(-1);
|
|
165
|
+
}
|
|
166
|
+
}),
|
|
167
|
+
/* @__PURE__ */ L("ul", {
|
|
168
|
+
id: `${v}-list`,
|
|
169
|
+
role: "listbox",
|
|
170
|
+
"aria-label": typeof e == "string" ? e : void 0,
|
|
171
|
+
className: "piq-menu piq-combobox__list",
|
|
172
|
+
hidden: !m || !S.length,
|
|
173
|
+
children: S.map((e, t) => /* @__PURE__ */ L("li", {
|
|
174
|
+
id: `${v}-${e.value}`,
|
|
175
|
+
role: "option",
|
|
176
|
+
"aria-selected": e.value === n,
|
|
177
|
+
className: `piq-menu__item${t === g ? " is-hover" : ""}`,
|
|
178
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
179
|
+
onClick: () => C(e),
|
|
180
|
+
children: e.label
|
|
181
|
+
}, e.value))
|
|
182
|
+
}),
|
|
183
|
+
/* @__PURE__ */ L("span", {
|
|
184
|
+
className: m && !S.length ? "piq-combobox__empty" : "piq-visually-hidden",
|
|
185
|
+
role: "status",
|
|
186
|
+
children: m && !S.length ? s : ""
|
|
187
|
+
})
|
|
188
|
+
]
|
|
189
|
+
})
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
//#endregion
|
|
193
|
+
//#region src/widgets/ChoicePicker.jsx
|
|
194
|
+
function W({ label: e, options: t, value: n, onChange: r, disabled: i }) {
|
|
195
|
+
let a = F([]), o = Math.max(0, t.findIndex((e) => e.value === n));
|
|
196
|
+
function s(e) {
|
|
197
|
+
let n = (e + t.length) % t.length;
|
|
198
|
+
r?.(t[n].value), a.current[n]?.focus();
|
|
199
|
+
}
|
|
200
|
+
function c(e) {
|
|
201
|
+
let n = {
|
|
202
|
+
ArrowRight: o + 1,
|
|
203
|
+
ArrowDown: o + 1,
|
|
204
|
+
ArrowLeft: o - 1,
|
|
205
|
+
ArrowUp: o - 1,
|
|
206
|
+
Home: 0,
|
|
207
|
+
End: t.length - 1
|
|
208
|
+
};
|
|
209
|
+
e.key in n && (e.preventDefault(), s(n[e.key]));
|
|
210
|
+
}
|
|
211
|
+
return /* @__PURE__ */ L("div", {
|
|
212
|
+
className: "piq-seg",
|
|
213
|
+
role: "radiogroup",
|
|
214
|
+
"aria-label": e,
|
|
215
|
+
onKeyDown: c,
|
|
216
|
+
children: t.map((e, t) => {
|
|
217
|
+
let s = e.value === n;
|
|
218
|
+
return /* @__PURE__ */ R("button", {
|
|
219
|
+
ref: (e) => {
|
|
220
|
+
a.current[t] = e;
|
|
221
|
+
},
|
|
222
|
+
type: "button",
|
|
223
|
+
role: "radio",
|
|
224
|
+
"aria-checked": s,
|
|
225
|
+
tabIndex: t === o ? 0 : -1,
|
|
226
|
+
disabled: i,
|
|
227
|
+
className: "piq-seg__opt",
|
|
228
|
+
onClick: () => r?.(e.value),
|
|
229
|
+
children: [/* @__PURE__ */ L("span", {
|
|
230
|
+
className: "piq-seg__tick",
|
|
231
|
+
"aria-hidden": "true",
|
|
232
|
+
children: "✓"
|
|
233
|
+
}), e.label]
|
|
234
|
+
}, e.value);
|
|
235
|
+
})
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
//#endregion
|
|
239
|
+
//#region src/widgets/DataTable.jsx
|
|
240
|
+
var G = (e, t) => typeof e == "number" && typeof t == "number" ? e - t : String(e ?? "").localeCompare(String(t ?? ""), void 0, { numeric: !0 });
|
|
241
|
+
function K({ columns: e, rows: t, rowKey: n = "id", caption: r, pageSize: i = 10, initialSort: a }) {
|
|
242
|
+
let [o, s] = I(a ?? null), [c, l] = I(0), u = oe(() => {
|
|
243
|
+
if (!o) return t;
|
|
244
|
+
let e = o.dir === "descending" ? -1 : 1;
|
|
245
|
+
return [...t].sort((t, n) => e * G(t[o.key], n[o.key]));
|
|
246
|
+
}, [t, o]), d = Math.max(1, Math.ceil(u.length / i)), f = Math.min(c, d - 1), p = u.slice(f * i, (f + 1) * i), h = u.length ? f * i + 1 : 0;
|
|
247
|
+
function g(e) {
|
|
248
|
+
s((t) => t?.key === e && t.dir === "ascending" ? {
|
|
249
|
+
key: e,
|
|
250
|
+
dir: "descending"
|
|
251
|
+
} : {
|
|
252
|
+
key: e,
|
|
253
|
+
dir: "ascending"
|
|
254
|
+
}), l(0);
|
|
255
|
+
}
|
|
256
|
+
return /* @__PURE__ */ R("div", {
|
|
257
|
+
className: "piq-table-wrap",
|
|
258
|
+
children: [/* @__PURE__ */ R("table", {
|
|
259
|
+
className: "piq-table",
|
|
260
|
+
children: [
|
|
261
|
+
r && /* @__PURE__ */ L("caption", {
|
|
262
|
+
className: "piq-visually-hidden",
|
|
263
|
+
children: r
|
|
264
|
+
}),
|
|
265
|
+
/* @__PURE__ */ L("thead", { children: /* @__PURE__ */ L("tr", { children: e.map((e) => {
|
|
266
|
+
let t = o?.key === e.key ? o.dir : void 0;
|
|
267
|
+
return /* @__PURE__ */ L("th", {
|
|
268
|
+
scope: "col",
|
|
269
|
+
"aria-sort": e.sortable ? t ?? "none" : void 0,
|
|
270
|
+
className: e.numeric ? "piq-num" : void 0,
|
|
271
|
+
children: e.sortable ? /* @__PURE__ */ R("button", {
|
|
272
|
+
type: "button",
|
|
273
|
+
className: "piq-table__sort",
|
|
274
|
+
onClick: () => g(e.key),
|
|
275
|
+
children: [e.label, /* @__PURE__ */ L("span", {
|
|
276
|
+
className: "piq-table__arrow",
|
|
277
|
+
"aria-hidden": "true",
|
|
278
|
+
children: t === "descending" ? "↓" : "↑"
|
|
279
|
+
})]
|
|
280
|
+
}) : e.label
|
|
281
|
+
}, e.key);
|
|
282
|
+
}) }) }),
|
|
283
|
+
/* @__PURE__ */ L("tbody", { children: p.map((t) => /* @__PURE__ */ L("tr", { children: e.map((e) => /* @__PURE__ */ L("td", {
|
|
284
|
+
className: e.numeric ? "piq-num" : void 0,
|
|
285
|
+
children: e.render ? e.render(t) : t[e.key]
|
|
286
|
+
}, e.key)) }, t[n])) })
|
|
287
|
+
]
|
|
288
|
+
}), d > 1 && /* @__PURE__ */ R("div", {
|
|
289
|
+
className: "piq-table__pager",
|
|
290
|
+
children: [
|
|
291
|
+
/* @__PURE__ */ R("span", {
|
|
292
|
+
"aria-live": "polite",
|
|
293
|
+
children: [
|
|
294
|
+
h,
|
|
295
|
+
"–",
|
|
296
|
+
h + p.length - 1,
|
|
297
|
+
" of ",
|
|
298
|
+
u.length
|
|
299
|
+
]
|
|
300
|
+
}),
|
|
301
|
+
/* @__PURE__ */ L(m, {
|
|
302
|
+
variant: "text",
|
|
303
|
+
size: "sm",
|
|
304
|
+
onClick: () => l(f - 1),
|
|
305
|
+
disabled: f === 0,
|
|
306
|
+
children: "Previous"
|
|
307
|
+
}),
|
|
308
|
+
/* @__PURE__ */ L(m, {
|
|
309
|
+
variant: "text",
|
|
310
|
+
size: "sm",
|
|
311
|
+
onClick: () => l(f + 1),
|
|
312
|
+
disabled: f >= d - 1,
|
|
313
|
+
children: "Next"
|
|
314
|
+
})
|
|
315
|
+
]
|
|
316
|
+
})]
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
//#endregion
|
|
320
|
+
//#region src/widgets/Notice.jsx
|
|
321
|
+
var se = {
|
|
322
|
+
info: "i",
|
|
323
|
+
accent: "i",
|
|
324
|
+
success: "✓",
|
|
325
|
+
warning: "!",
|
|
326
|
+
error: "×"
|
|
327
|
+
};
|
|
328
|
+
function ce({ tone: e = "info", title: t, children: n, ...r }) {
|
|
329
|
+
return /* @__PURE__ */ R("div", {
|
|
330
|
+
className: `piq-notice piq-notice--${e}`,
|
|
331
|
+
...r,
|
|
332
|
+
children: [
|
|
333
|
+
/* @__PURE__ */ L("span", {
|
|
334
|
+
className: "piq-notice__mark",
|
|
335
|
+
"aria-hidden": "true",
|
|
336
|
+
children: se[e] ?? "i"
|
|
337
|
+
}),
|
|
338
|
+
/* @__PURE__ */ L("p", {
|
|
339
|
+
className: "piq-notice__title",
|
|
340
|
+
children: t
|
|
341
|
+
}),
|
|
342
|
+
n && /* @__PURE__ */ L("p", {
|
|
343
|
+
className: "piq-notice__body",
|
|
344
|
+
children: n
|
|
345
|
+
})
|
|
346
|
+
]
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
//#endregion
|
|
350
|
+
//#region src/widgets/StatusPill.jsx
|
|
351
|
+
var q = {
|
|
352
|
+
live: "Live",
|
|
353
|
+
limited: "Limited",
|
|
354
|
+
purchasing: "Purchasing",
|
|
355
|
+
evaluation: "In evaluation",
|
|
356
|
+
closed: "Closed"
|
|
357
|
+
};
|
|
358
|
+
function le({ state: e, children: t }) {
|
|
359
|
+
return /* @__PURE__ */ L("span", {
|
|
360
|
+
className: `piq-pill piq-pill--${e}`,
|
|
361
|
+
children: t ?? q[e] ?? e
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
//#endregion
|
|
365
|
+
//#region src/widgets/Toast.jsx
|
|
366
|
+
function J({ message: e, actionLabel: t, onAction: n, onMouseEnter: r, onMouseLeave: i, onFocus: a, onBlur: o }) {
|
|
367
|
+
return /* @__PURE__ */ R("div", {
|
|
368
|
+
className: "piq-toast",
|
|
369
|
+
onMouseEnter: r,
|
|
370
|
+
onMouseLeave: i,
|
|
371
|
+
onFocus: a,
|
|
372
|
+
onBlur: o,
|
|
373
|
+
children: [/* @__PURE__ */ L("p", {
|
|
374
|
+
className: "piq-toast__text",
|
|
375
|
+
children: e
|
|
376
|
+
}), t && /* @__PURE__ */ L("button", {
|
|
377
|
+
type: "button",
|
|
378
|
+
className: "piq-toast__action",
|
|
379
|
+
onClick: n,
|
|
380
|
+
children: t
|
|
381
|
+
})]
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
var Y = ie(null);
|
|
385
|
+
function ue({ toast: e, dismiss: t }) {
|
|
386
|
+
let [n, r] = I(!1), i = F(e.duration);
|
|
387
|
+
N(() => {
|
|
388
|
+
if (n) return;
|
|
389
|
+
let r = Date.now(), a = setTimeout(() => t(e.id), i.current);
|
|
390
|
+
return () => {
|
|
391
|
+
clearTimeout(a), i.current -= Date.now() - r;
|
|
392
|
+
};
|
|
393
|
+
}, [
|
|
394
|
+
n,
|
|
395
|
+
e.id,
|
|
396
|
+
t
|
|
397
|
+
]);
|
|
398
|
+
let a = () => r(!0), o = () => r(!1);
|
|
399
|
+
return /* @__PURE__ */ L(J, {
|
|
400
|
+
message: e.message,
|
|
401
|
+
actionLabel: e.actionLabel,
|
|
402
|
+
onAction: () => {
|
|
403
|
+
e.onAction?.(), t(e.id);
|
|
404
|
+
},
|
|
405
|
+
onMouseEnter: a,
|
|
406
|
+
onMouseLeave: o,
|
|
407
|
+
onFocus: a,
|
|
408
|
+
onBlur: o
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
function de({ children: e }) {
|
|
412
|
+
let [t, n] = I([]), r = F(0), i = j((e) => n((t) => t.filter((t) => t.id !== e)), []), a = j(({ message: e, actionLabel: t, onAction: i, duration: a = 6e3 }) => {
|
|
413
|
+
let o = ++r.current;
|
|
414
|
+
return n((n) => [...n, {
|
|
415
|
+
id: o,
|
|
416
|
+
message: e,
|
|
417
|
+
actionLabel: t,
|
|
418
|
+
onAction: i,
|
|
419
|
+
duration: a
|
|
420
|
+
}]), o;
|
|
421
|
+
}, []);
|
|
422
|
+
return /* @__PURE__ */ R(Y.Provider, {
|
|
423
|
+
value: {
|
|
424
|
+
show: a,
|
|
425
|
+
dismiss: i
|
|
426
|
+
},
|
|
427
|
+
children: [e, /* @__PURE__ */ L("div", {
|
|
428
|
+
className: "piq-toasts",
|
|
429
|
+
role: "status",
|
|
430
|
+
"aria-live": "polite",
|
|
431
|
+
children: t.map((e) => /* @__PURE__ */ L(ue, {
|
|
432
|
+
toast: e,
|
|
433
|
+
dismiss: i
|
|
434
|
+
}, e.id))
|
|
435
|
+
})]
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
function fe() {
|
|
439
|
+
let e = M(Y);
|
|
440
|
+
if (!e) throw Error("useToast needs a <ToastProvider> above it");
|
|
441
|
+
return e;
|
|
442
|
+
}
|
|
443
|
+
//#endregion
|
|
444
|
+
//#region src/widgets/Tooltip.jsx
|
|
445
|
+
function pe({ content: e, children: t, placement: n = "top", className: r }) {
|
|
446
|
+
let i = P(), a = F(null), [o, s] = I(!1), c = F(!1), l = F(!1), u = () => s(c.current || l.current);
|
|
447
|
+
N(() => {
|
|
448
|
+
let e = a.current, t = () => {
|
|
449
|
+
c.current = !0, u();
|
|
450
|
+
}, n = () => {
|
|
451
|
+
c.current = !1, u();
|
|
452
|
+
};
|
|
453
|
+
return e.addEventListener("mouseenter", t), e.addEventListener("mouseleave", n), () => {
|
|
454
|
+
e.removeEventListener("mouseenter", t), e.removeEventListener("mouseleave", n);
|
|
455
|
+
};
|
|
456
|
+
}, []), N(() => {
|
|
457
|
+
if (!o) return;
|
|
458
|
+
let e = (e) => {
|
|
459
|
+
e.key === "Escape" && (c.current = !1, l.current = !1, s(!1));
|
|
460
|
+
};
|
|
461
|
+
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
462
|
+
}, [o]);
|
|
463
|
+
let d = re(t, {
|
|
464
|
+
"aria-describedby": [t.props["aria-describedby"], i].filter(Boolean).join(" "),
|
|
465
|
+
onFocus: (e) => {
|
|
466
|
+
l.current = !0, u(), t.props.onFocus?.(e);
|
|
467
|
+
},
|
|
468
|
+
onBlur: (e) => {
|
|
469
|
+
l.current = !1, u(), t.props.onBlur?.(e);
|
|
470
|
+
}
|
|
471
|
+
});
|
|
472
|
+
return /* @__PURE__ */ R("span", {
|
|
473
|
+
ref: a,
|
|
474
|
+
className: `piq-tooltip-anchor${r ? ` ${r}` : ""}`,
|
|
475
|
+
children: [d, /* @__PURE__ */ L("span", {
|
|
476
|
+
id: i,
|
|
477
|
+
role: "tooltip",
|
|
478
|
+
className: "piq-tooltip",
|
|
479
|
+
"data-placement": n,
|
|
480
|
+
hidden: !o,
|
|
481
|
+
children: e
|
|
482
|
+
})]
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
//#endregion
|
|
486
|
+
//#region src/brand/Logo.jsx
|
|
487
|
+
var me = new Map(g.map((e) => [e.name, e])), he = new Map(e.map((e) => [e.name, e])), ge = typeof window > "u" ? N : ae, X = !0;
|
|
488
|
+
try {
|
|
489
|
+
X = process.env.NODE_ENV !== "production";
|
|
490
|
+
} catch {}
|
|
491
|
+
var Z = (e) => {
|
|
492
|
+
X && console.warn(`@ux-builder/ui Logo: ${e}`);
|
|
493
|
+
}, Q = (e) => !!e && e !== "none" && e !== "initial";
|
|
494
|
+
function $(e) {
|
|
495
|
+
let t = me.get(e);
|
|
496
|
+
return t ? he.get(t.brand)?.title ?? t.title : null;
|
|
497
|
+
}
|
|
498
|
+
function _e({ variant: e = "logo", size: t = "md", label: n, className: r = "", ...i }) {
|
|
499
|
+
let a = M(ee), o = F(null), [s, c] = I(null), [l, u] = I(!0), d = !!a && a.theme === null, f = e === "mark" ? "mark" : "logo";
|
|
500
|
+
ge(() => {
|
|
501
|
+
if (d || !o.current) return;
|
|
502
|
+
let e = getComputedStyle(o.current);
|
|
503
|
+
u(Q(e.getPropertyValue(`--piq-brand-${f}-image`).trim()) || Q(e.getPropertyValue(`--piq-brand-${f}-mask`).trim())), a?.theme || c(o.current.closest?.("[data-theme]")?.getAttribute("data-theme") ?? null);
|
|
504
|
+
});
|
|
505
|
+
let p = a?.theme ?? s, m = n ?? $(p) ?? "";
|
|
506
|
+
if (N(() => {
|
|
507
|
+
d ? Z("an embedded view must not draw the brand (CONTRACT-001); nothing drawn") : !m && p && Z(`no brand title for theme "${p}"; pass label`);
|
|
508
|
+
}, [
|
|
509
|
+
d,
|
|
510
|
+
m,
|
|
511
|
+
p
|
|
512
|
+
]), d) return null;
|
|
513
|
+
let h = [
|
|
514
|
+
"piq-logo",
|
|
515
|
+
`piq-logo--${f}`,
|
|
516
|
+
t === "sm" && "piq-logo--sm",
|
|
517
|
+
!l && "piq-logo--text",
|
|
518
|
+
r
|
|
519
|
+
].filter(Boolean).join(" "), g = !l && m ? f === "mark" ? m.trim()[0] : m : null;
|
|
520
|
+
return /* @__PURE__ */ L("span", {
|
|
521
|
+
ref: o,
|
|
522
|
+
role: "img",
|
|
523
|
+
"aria-label": m || void 0,
|
|
524
|
+
className: h,
|
|
525
|
+
"data-logo": l ? "artwork" : "text",
|
|
526
|
+
...i,
|
|
527
|
+
children: g && /* @__PURE__ */ L("span", {
|
|
528
|
+
className: "piq-logo__text",
|
|
529
|
+
"aria-hidden": "true",
|
|
530
|
+
children: g
|
|
531
|
+
})
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
//#endregion
|
|
535
|
+
export { B as AppearanceSwitch, V as Breadcrumbs, m as Button, H as Card, f as Checkbox, W as ChoicePicker, U as Combobox, K as DataTable, x as DatePicker, w as DateRangePicker, c as Dialog, i as Favicon, k as ICON_NAMES, l as Icon, _e as Logo, h as MenuButton, ce as Notice, C as Pagination, p as ProgressBar, S as RadioGroup, q as STATES, v as Select, b as Sheet, s as Skeleton, D as Spinner, le as StatusPill, y as Switch, T as Tabs, E as TextArea, d as TextField, o as ThemeProvider, J as Toast, de as ToastProvider, pe as Tooltip, _ as applyFavicon, $ as brandTitleFor, O as iconSetFor, a as pickGlyph, t as registerIcons, r as resolveAppearance, n as useTheme, fe as useToast };
|
|
536
|
+
|
|
537
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["MANIFEST_THEMES","MANIFEST_BRANDS","brands","registerIcons","useTheme","resolveAppearance","Favicon","pickGlyph","ThemeProvider","Skeleton","Dialog","Icon","Frame","ProgressBar","Button","MenuButton","themes","applyFavicon","Select","Switch","Sheet","DatePicker","RadioGroup","Pagination","DateRangePicker","Tabs","TextArea","Spinner","ThemeContext","iconSetFor","ICON_NAMES","iconMoon","iconContrast","iconSun","OPTIONS","AppearanceSwitch","refs","useRef","enabled","o","available","index","value","move","n","from","step","onChange","onKeyDown","className","label","el","labels","Breadcrumbs","rest","parent","items","follow","onNavigate","e","item","i","it","Card","Tag","title","children","actions","Combobox","chosen","options","text","setText","useState","open","setOpen","active","setActive","base","useId","input","query","matches","w","shown","choose","onKey","a","control","emptyLabel","ChoicePicker","select","next","moves","on","compare","b","DataTable","sort","setSort","initialSort","page","setPage","sorted","useMemo","rows","dir","pages","pageSize","current","first","toggle","s","key","caption","columns","c","row","rowKey","MARKS","Notice","tone","STATES","StatusPill","state","Toast","message","actionLabel","onAction","ToastContext","createContext","Timed","paused","setPaused","left","toast","started","timer","dismiss","hold","go","ToastProvider","toasts","setToasts","useCallback","all","id","show","t","useToast","ctx","useContext","Tooltip","wrap","setShown","hover","focus","update","useEffect","enter","leave","esc","child","cloneElement","placement","content","THEMES","BRANDS","useBeforePaint","useLayoutEffect","dev","warn","msg","isSet","v","brandTitleFor","theme","Logo","context","ref","pageTheme","setPageTheme","artwork","setArtwork","embedded","kind","variant","css","name","classes","size","Checkbox","TextField"],"sources":["../src/widgets/AppearanceSwitch.jsx","../src/widgets/Breadcrumbs.jsx","../src/widgets/Card.jsx","../src/widgets/Combobox.jsx","../src/widgets/ChoicePicker.jsx","../src/widgets/DataTable.jsx","../src/widgets/Notice.jsx","../src/widgets/StatusPill.jsx","../src/widgets/Toast.jsx","../src/widgets/Tooltip.jsx","../src/brand/Logo.jsx"],"sourcesContent":["import { useRef } from \"react\";\nimport { Icon } from \"../icons/Icon.jsx\";\nimport { iconContrast, iconMoon, iconSun } from \"../icons/library.generated.js\";\n\nconst OPTIONS = [\n { value: \"light\", icon: iconSun },\n { value: \"system\", icon: iconContrast },\n { value: \"dark\", icon: iconMoon },\n];\n\n/* Light, the system's setting, or dark, as three icons in a pill: a radio\n group (arrow keys move and choose), each option named in text for\n assistive technology and shown on hover, the chosen one raised on a disc\n so the choice is never colour alone. value is \"light\", \"system\" or\n \"dark\", as ThemeProvider's appearance takes; available lists the\n appearances the theme has, and the others are disabled. */\nexport function AppearanceSwitch({ value = \"system\", onChange, label = \"Appearance\", labels = { light: \"Light\", system: \"Auto\", dark: \"Dark\" }, available, className }) {\n const refs = useRef([]);\n const enabled = OPTIONS.map((o) => o.value === \"system\" || !available || available.includes(o.value));\n const index = Math.max(0, OPTIONS.findIndex((o) => o.value === value));\n function move(from, step) {\n for (let n = 1; n <= OPTIONS.length; n++) {\n const i = (from + step * n + OPTIONS.length * n) % OPTIONS.length;\n if (enabled[i]) { onChange?.(OPTIONS[i].value); refs.current[i]?.focus(); return; }\n }\n }\n function onKeyDown(e) {\n const step = { ArrowRight: 1, ArrowDown: 1, ArrowLeft: -1, ArrowUp: -1 }[e.key];\n if (step) { e.preventDefault(); move(index, step); }\n else if (e.key === \"Home\") { e.preventDefault(); move(-1, 1); }\n else if (e.key === \"End\") { e.preventDefault(); move(OPTIONS.length, -1); }\n }\n return (\n <div className={`piq-appearance${className ? ` ${className}` : \"\"}`} role=\"radiogroup\" aria-label={label} onKeyDown={onKeyDown}>\n {OPTIONS.map((o, i) => (\n <button key={o.value} ref={(el) => { refs.current[i] = el; }} type=\"button\" role=\"radio\" aria-checked={o.value === value}\n aria-label={labels[o.value]} title={labels[o.value]} tabIndex={i === index ? 0 : -1} disabled={!enabled[i]}\n className=\"piq-appearance__opt\" onClick={() => onChange?.(o.value)}>\n <Icon icon={o.icon} />\n </button>\n ))}\n </div>\n );\n}\n","import { Icon } from \"../icons/Icon.jsx\";\n\n/* Where the page sits in a hierarchy, as an ordered list of links in a\n navigation landmark; the last item is the current page. Where it has\n little width (the compact size class) it shows only a link back to the\n parent. items: [{ label, href }]. onNavigate(item, event), if given, is\n called instead of following the link, for an app's own router. */\nexport function Breadcrumbs({ items = [], label = \"Breadcrumb\", onNavigate, className, ...rest }) {\n const parent = items.length > 1 ? items[items.length - 2] : null;\n const follow = (item) => (e) => { if (onNavigate) { e.preventDefault(); onNavigate(item, e); } };\n return (\n <nav aria-label={label} className={`piq-breadcrumbs${className ? ` ${className}` : \"\"}`} {...rest}>\n <ol className=\"piq-breadcrumbs__list\">\n {items.map((it, i) => (\n <li key={i} className=\"piq-breadcrumbs__item\">\n {i === items.length - 1\n ? it.href ? <a href={it.href} aria-current=\"page\" onClick={follow(it)}>{it.label}</a> : <span aria-current=\"page\">{it.label}</span>\n : <a href={it.href} onClick={follow(it)}>{it.label}</a>}\n </li>\n ))}\n </ol>\n {parent && (\n <a className=\"piq-breadcrumbs__back\" href={parent.href} onClick={follow(parent)}>\n <Icon name=\"arrow-left\" />\n {parent.label}\n </a>\n )}\n </nav>\n );\n}\n","/* A bounded group of content with an optional title and actions. */\n\nexport function Card({ title, actions, children, as: Tag = \"section\", ...rest }) {\n return (\n <Tag className=\"piq-card\" {...rest}>\n {title && <h3 className=\"piq-card__title\">{title}</h3>}\n {typeof children === \"string\" ? <p className=\"piq-card__body\">{children}</p> : children}\n {actions && <div className=\"piq-card__actions\">{actions}</div>}\n </Tag>\n );\n}\n","import { useEffect, useId, useRef, useState } from \"react\";\nimport { Frame } from \"./Field.jsx\";\n\n/* A choice from a long list by typing: the WAI-ARIA Combobox pattern with a\n listbox popup. Typing filters the options; Down and Up move the active\n option (focus stays in the field, aria-activedescendant follows); Enter\n chooses; Escape closes without changing the choice; with no match it says\n so. Text matches the start of any word of an option. options: [{ value,\n label }]; value and onChange(value) hold the choice. */\nexport function Combobox({ label, options = [], value, onChange, placeholder, hint, error, emptyLabel = \"No matches\", id, className }) {\n const chosen = options.find((o) => o.value === value);\n const [text, setText] = useState(chosen?.label ?? \"\");\n const [open, setOpen] = useState(false);\n const [active, setActive] = useState(-1);\n const base = useId();\n const input = useRef(null);\n\n useEffect(() => { if (!open) setText(chosen?.label ?? \"\"); }, [chosen?.label, open]);\n const query = text.trim().toLowerCase();\n // Matches the start of any word, so \"lo\" finds London and Los Angeles, not Barcelona.\n const matches = (label) => label.toLowerCase().startsWith(query) || label.toLowerCase().split(/[\\s,./()-]+/).some((w) => w.startsWith(query));\n const shown = open && query && query !== (chosen?.label ?? \"\").toLowerCase() ? options.filter((o) => matches(o.label)) : options;\n\n const choose = (o) => { onChange?.(o.value); setText(o.label); setOpen(false); setActive(-1); };\n function onKey(e) {\n if (e.key === \"ArrowDown\") { e.preventDefault(); if (!open) setOpen(true); setActive((a) => Math.min(a + 1, shown.length - 1)); }\n else if (e.key === \"ArrowUp\") { e.preventDefault(); if (!open) setOpen(true); setActive((a) => Math.max(a - 1, 0)); }\n else if (e.key === \"Enter\") { if (open) { e.preventDefault(); if (shown[active]) choose(shown[active]); } }\n else if (e.key === \"Escape\") { if (open) { e.preventDefault(); setOpen(false); setActive(-1); setText(chosen?.label ?? \"\"); } }\n }\n\n return (\n <Frame label={label} hint={hint} error={error} id={id} className={`piq-combobox${className ? ` ${className}` : \"\"}`}>\n {(control) => (\n <span className=\"piq-combobox__field\">\n <input ref={input} {...control} type=\"text\" role=\"combobox\" className=\"piq-field__input\" autoComplete=\"off\" placeholder={placeholder}\n aria-expanded={open} aria-controls={`${base}-list`} aria-autocomplete=\"list\"\n aria-activedescendant={open && shown[active] ? `${base}-${shown[active].value}` : undefined}\n value={text} onChange={(e) => { setText(e.target.value); setOpen(true); setActive(0); }} onKeyDown={onKey}\n onBlur={() => { setOpen(false); setActive(-1); }} />\n <ul id={`${base}-list`} role=\"listbox\" aria-label={typeof label === \"string\" ? label : undefined} className=\"piq-menu piq-combobox__list\" hidden={!open || !shown.length}>\n {shown.map((o, i) => (\n <li key={o.value} id={`${base}-${o.value}`} role=\"option\" aria-selected={o.value === value} className={`piq-menu__item${i === active ? \" is-hover\" : \"\"}`}\n onMouseDown={(e) => e.preventDefault()} onClick={() => choose(o)}>{o.label}</li>\n ))}\n </ul>\n <span className={open && !shown.length ? \"piq-combobox__empty\" : \"piq-visually-hidden\"} role=\"status\">{open && !shown.length ? emptyLabel : \"\"}</span>\n </span>\n )}\n </Frame>\n );\n}\n","import { useRef } from \"react\";\n\n/* One choice from a few, every option in view: a radio group drawn as\n segments. It is a single tab stop; the arrow keys, Home and End move the\n selection, as a native radio group does. */\n\nexport function ChoicePicker({ label, options, value, onChange, disabled }) {\n const refs = useRef([]);\n const index = Math.max(0, options.findIndex((o) => o.value === value));\n\n function select(i) {\n const next = (i + options.length) % options.length;\n onChange?.(options[next].value);\n refs.current[next]?.focus();\n }\n\n function onKeyDown(e) {\n const moves = { ArrowRight: index + 1, ArrowDown: index + 1, ArrowLeft: index - 1, ArrowUp: index - 1, Home: 0, End: options.length - 1 };\n if (e.key in moves) { e.preventDefault(); select(moves[e.key]); }\n }\n\n return (\n <div className=\"piq-seg\" role=\"radiogroup\" aria-label={label} onKeyDown={onKeyDown}>\n {options.map((o, i) => {\n const on = o.value === value;\n return (\n <button\n key={o.value}\n ref={(el) => { refs.current[i] = el; }}\n type=\"button\"\n role=\"radio\"\n aria-checked={on}\n tabIndex={i === index ? 0 : -1}\n disabled={disabled}\n className=\"piq-seg__opt\"\n onClick={() => onChange?.(o.value)}\n >\n <span className=\"piq-seg__tick\" aria-hidden=\"true\">✓</span>\n {o.label}\n </button>\n );\n })}\n </div>\n );\n}\n","import { useMemo, useState } from \"react\";\nimport { Button } from \"./Button.jsx\";\n\n/* A table that sorts and pages. Sortable headers are buttons with aria-sort\n on their cell, so the order is announced; numbers align right and sort as\n numbers.\n\n columns: [{ key, label, numeric?, sortable?, render?(row) }]\n rows: plain objects; rowKey names the field that identifies one. */\n\nconst compare = (a, b) => (typeof a === \"number\" && typeof b === \"number\" ? a - b : String(a ?? \"\").localeCompare(String(b ?? \"\"), undefined, { numeric: true }));\n\nexport function DataTable({ columns, rows, rowKey = \"id\", caption, pageSize = 10, initialSort }) {\n const [sort, setSort] = useState(initialSort ?? null);\n const [page, setPage] = useState(0);\n\n const sorted = useMemo(() => {\n if (!sort) return rows;\n const dir = sort.dir === \"descending\" ? -1 : 1;\n return [...rows].sort((a, b) => dir * compare(a[sort.key], b[sort.key]));\n }, [rows, sort]);\n\n const pages = Math.max(1, Math.ceil(sorted.length / pageSize));\n const current = Math.min(page, pages - 1);\n const shown = sorted.slice(current * pageSize, (current + 1) * pageSize);\n const first = sorted.length ? current * pageSize + 1 : 0;\n\n function toggle(key) {\n setSort((s) => (s?.key === key && s.dir === \"ascending\" ? { key, dir: \"descending\" } : { key, dir: \"ascending\" }));\n setPage(0);\n }\n\n return (\n <div className=\"piq-table-wrap\">\n <table className=\"piq-table\">\n {caption && <caption className=\"piq-visually-hidden\">{caption}</caption>}\n <thead>\n <tr>\n {columns.map((c) => {\n const dir = sort?.key === c.key ? sort.dir : undefined;\n return (\n <th key={c.key} scope=\"col\" aria-sort={c.sortable ? dir ?? \"none\" : undefined} className={c.numeric ? \"piq-num\" : undefined}>\n {c.sortable ? (\n <button type=\"button\" className=\"piq-table__sort\" onClick={() => toggle(c.key)}>\n {c.label}\n <span className=\"piq-table__arrow\" aria-hidden=\"true\">{dir === \"descending\" ? \"↓\" : \"↑\"}</span>\n </button>\n ) : c.label}\n </th>\n );\n })}\n </tr>\n </thead>\n <tbody>\n {shown.map((row) => (\n <tr key={row[rowKey]}>\n {columns.map((c) => <td key={c.key} className={c.numeric ? \"piq-num\" : undefined}>{c.render ? c.render(row) : row[c.key]}</td>)}\n </tr>\n ))}\n </tbody>\n </table>\n {pages > 1 && (\n <div className=\"piq-table__pager\">\n <span aria-live=\"polite\">{first}–{first + shown.length - 1} of {sorted.length}</span>\n <Button variant=\"text\" size=\"sm\" onClick={() => setPage(current - 1)} disabled={current === 0}>Previous</Button>\n <Button variant=\"text\" size=\"sm\" onClick={() => setPage(current + 1)} disabled={current >= pages - 1}>Next</Button>\n </div>\n )}\n </div>\n );\n}\n","/* A message in the flow of the page. The tone sets its colour and its mark;\n the title says the point, so the colour is never the only signal. An error\n rendered in response to an action should pass role=\"alert\". */\n\nconst MARKS = { info: \"i\", accent: \"i\", success: \"✓\", warning: \"!\", error: \"×\" };\n\nexport function Notice({ tone = \"info\", title, children, ...rest }) {\n return (\n <div className={`piq-notice piq-notice--${tone}`} {...rest}>\n <span className=\"piq-notice__mark\" aria-hidden=\"true\">{MARKS[tone] ?? \"i\"}</span>\n <p className=\"piq-notice__title\">{title}</p>\n {children && <p className=\"piq-notice__body\">{children}</p>}\n </div>\n );\n}\n","/* An availability status. It is a label, never a target, and it always says\n its state in words, so colour is never the only signal. */\n\n/* The states StatusPill takes, and the words it shows for each. */\nexport const STATES = {\n live: \"Live\",\n limited: \"Limited\",\n purchasing: \"Purchasing\",\n evaluation: \"In evaluation\",\n closed: \"Closed\",\n};\n\nexport function StatusPill({ state, children }) {\n return <span className={`piq-pill piq-pill--${state}`}>{children ?? STATES[state] ?? state}</span>;\n}\n","import { createContext, useCallback, useContext, useEffect, useRef, useState } from \"react\";\n\n/* A short confirmation after an action, with Undo. The region is a polite\n live region, so a screen reader announces each toast without moving focus.\n A toast waits while the pointer or focus is on it, so nobody loses the Undo\n by reading slowly (WCAG 2.2.1). */\n\nexport function Toast({ message, actionLabel, onAction, onMouseEnter, onMouseLeave, onFocus, onBlur }) {\n return (\n <div className=\"piq-toast\" onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave} onFocus={onFocus} onBlur={onBlur}>\n <p className=\"piq-toast__text\">{message}</p>\n {actionLabel && <button type=\"button\" className=\"piq-toast__action\" onClick={onAction}>{actionLabel}</button>}\n </div>\n );\n}\n\nconst ToastContext = createContext(null);\n\nfunction Timed({ toast, dismiss }) {\n const [paused, setPaused] = useState(false);\n const left = useRef(toast.duration);\n useEffect(() => {\n if (paused) return undefined;\n const started = Date.now();\n const timer = setTimeout(() => dismiss(toast.id), left.current);\n return () => { clearTimeout(timer); left.current -= Date.now() - started; };\n }, [paused, toast.id, dismiss]);\n const hold = () => setPaused(true), go = () => setPaused(false);\n return (\n <Toast\n message={toast.message}\n actionLabel={toast.actionLabel}\n onAction={() => { toast.onAction?.(); dismiss(toast.id); }}\n onMouseEnter={hold} onMouseLeave={go} onFocus={hold} onBlur={go}\n />\n );\n}\n\n/* Holds the toasts for its subtree and shows them in a polite live region; wrap the app once. */\nexport function ToastProvider({ children }) {\n const [toasts, setToasts] = useState([]);\n const next = useRef(0);\n const dismiss = useCallback((id) => setToasts((all) => all.filter((t) => t.id !== id)), []);\n const show = useCallback(({ message, actionLabel, onAction, duration = 6000 }) => {\n const id = ++next.current;\n setToasts((all) => [...all, { id, message, actionLabel, onAction, duration }]);\n return id;\n }, []);\n return (\n <ToastContext.Provider value={{ show, dismiss }}>\n {children}\n <div className=\"piq-toasts\" role=\"status\" aria-live=\"polite\">\n {toasts.map((t) => <Timed key={t.id} toast={t} dismiss={dismiss} />)}\n </div>\n </ToastContext.Provider>\n );\n}\n\n/* show({ message, actionLabel: \"Undo\", onAction }) puts up a toast; inside a\n ToastProvider only. */\n/* show({ message, actionLabel, onAction, duration }) a toast, or dismiss(id) one. */\nexport function useToast() {\n const ctx = useContext(ToastContext);\n if (!ctx) throw new Error(\"useToast needs a <ToastProvider> above it\");\n return ctx;\n}\n","import { cloneElement, useEffect, useId, useRef, useState } from \"react\";\n\n/* A short description of a control, shown while the pointer is over it or\n it has keyboard focus: the WAI-ARIA Tooltip pattern. The control points to\n it with aria-describedby; Escape hides it without moving focus; the pointer\n can move onto it without it closing (WCAG 1.4.13). It describes, it never\n names: an icon-only button still needs its own aria-label. children is the\n one control; content is the text. */\nexport function Tooltip({ content, children, placement = \"top\", className }) {\n const id = useId();\n const wrap = useRef(null);\n const [shown, setShown] = useState(false);\n const hover = useRef(false), focus = useRef(false);\n const update = () => setShown(hover.current || focus.current);\n\n useEffect(() => {\n const el = wrap.current;\n const enter = () => { hover.current = true; update(); };\n const leave = () => { hover.current = false; update(); };\n el.addEventListener(\"mouseenter\", enter);\n el.addEventListener(\"mouseleave\", leave);\n return () => { el.removeEventListener(\"mouseenter\", enter); el.removeEventListener(\"mouseleave\", leave); };\n }, []);\n useEffect(() => {\n if (!shown) return undefined;\n const esc = (e) => { if (e.key === \"Escape\") { hover.current = false; focus.current = false; setShown(false); } };\n document.addEventListener(\"keydown\", esc);\n return () => document.removeEventListener(\"keydown\", esc);\n }, [shown]);\n\n const child = cloneElement(children, {\n \"aria-describedby\": [children.props[\"aria-describedby\"], id].filter(Boolean).join(\" \"),\n onFocus: (e) => { focus.current = true; update(); children.props.onFocus?.(e); },\n onBlur: (e) => { focus.current = false; update(); children.props.onBlur?.(e); },\n });\n return (\n <span ref={wrap} className={`piq-tooltip-anchor${className ? ` ${className}` : \"\"}`}>\n {child}\n <span id={id} role=\"tooltip\" className=\"piq-tooltip\" data-placement={placement} hidden={!shown}>{content}</span>\n </span>\n );\n}\n","import { useContext, useEffect, useLayoutEffect, useRef, useState } from \"react\";\nimport { brands as MANIFEST_BRANDS, themes as MANIFEST_THEMES } from \"@ux-builder/tokens/manifest.json\";\nimport { ThemeContext } from \"../ThemeProvider.jsx\";\n\n/* The active theme's logo (FEAT-004 SDK-15, US-010-AC8 to AC10).\n\n <Logo /> the brand's logo, at the brand's height\n <Logo variant=\"mark\" /> the brand's mark, where space is tight\n <Logo size=\"sm\" /> the brand's compact height\n\n It draws the brand's artwork from the theme's brand tokens\n (--piq-brand-logo-image, or --piq-brand-logo-mask painted in\n --piq-brand-logo-paint), so it changes with the theme and the\n appearance and the app names no file. A brand without artwork gets its\n title as a wordmark (the mark: its initial) in --piq-brand-logo-paint, so\n a theme switch always shows. Either way it is one image named by the\n brand's title, or by label.\n\n Brand tokens belong to the top-level app (CONTRACT-001, ADR-011): inside\n a ThemeProvider given tokens, an embedded view, it draws nothing. */\n\nconst THEMES = new Map(MANIFEST_THEMES.map((t) => [t.name, t]));\nconst BRANDS = new Map(MANIFEST_BRANDS.map((b) => [b.name, b]));\nconst useBeforePaint = typeof window === \"undefined\" ? useEffect : useLayoutEffect;\n\nlet dev = true;\ntry { dev = process.env.NODE_ENV !== \"production\"; } catch { /* no bundler */ }\nconst warn = (msg) => { if (dev) console.warn(`@ux-builder/ui Logo: ${msg}`); };\n\nconst isSet = (v) => Boolean(v) && v !== \"none\" && v !== \"initial\";\n\n/* The brand title for a theme, from the themes this package was built with. */\nexport function brandTitleFor(theme) {\n const t = THEMES.get(theme);\n return t ? BRANDS.get(t.brand)?.title ?? t.title : null;\n}\n\n/* The active theme's logo, or its mark (variant=\"mark\"), drawn from the brand's artwork; a brand without artwork gets its title as a wordmark in the logo colour. */\nexport function Logo({ variant = \"logo\", size = \"md\", label, className = \"\", ...rest }) {\n const context = useContext(ThemeContext);\n const ref = useRef(null);\n const [pageTheme, setPageTheme] = useState(null);\n const [artwork, setArtwork] = useState(true);\n const embedded = Boolean(context) && context.theme === null;\n const kind = variant === \"mark\" ? \"mark\" : \"logo\";\n\n // Before paint: does the brand have artwork here, and which theme is on?\n useBeforePaint(() => {\n if (embedded || !ref.current) return;\n const css = getComputedStyle(ref.current);\n setArtwork(isSet(css.getPropertyValue(`--piq-brand-${kind}-image`).trim()) || isSet(css.getPropertyValue(`--piq-brand-${kind}-mask`).trim()));\n if (!context?.theme) setPageTheme(ref.current.closest?.(\"[data-theme]\")?.getAttribute(\"data-theme\") ?? null);\n });\n\n const theme = context?.theme ?? pageTheme;\n const name = label ?? brandTitleFor(theme) ?? \"\";\n useEffect(() => {\n if (embedded) warn(\"an embedded view must not draw the brand (CONTRACT-001); nothing drawn\");\n else if (!name && theme) warn(`no brand title for theme \"${theme}\"; pass label`);\n }, [embedded, name, theme]);\n if (embedded) return null;\n\n const classes = [\"piq-logo\", `piq-logo--${kind}`, size === \"sm\" && \"piq-logo--sm\", !artwork && \"piq-logo--text\", className].filter(Boolean).join(\" \");\n const text = !artwork && name ? (kind === \"mark\" ? name.trim()[0] : name) : null;\n return (\n <span ref={ref} role=\"img\" aria-label={name || undefined} className={classes} data-logo={artwork ? \"artwork\" : \"text\"} {...rest}>\n {text && <span className=\"piq-logo__text\" aria-hidden=\"true\">{text}</span>}\n </span>\n );\n}\n"],"mappings":";;;;;AAIA,IAAMkC,IAAU;CACd;EAAE,OAAO;EAAS,MAAMD;CAAQ;CAChC;EAAE,OAAO;EAAU,MAAMD;CAAa;CACtC;EAAE,OAAO;EAAQ,MAAMD;CAAS;AAClC;AAQA,SAAgBI,EAAiB,EAAE,WAAQ,UAAU,aAAU,WAAQ,cAAc,YAAS;CAAE,OAAO;CAAS,QAAQ;CAAQ,MAAM;AAAO,GAAG,cAAW,gBAAa;CACtK,IAAMC,IAAOC,EAAO,CAAC,CAAC,GAChBC,IAAUJ,EAAQ,KAAK,MAAMK,EAAE,UAAU,YAAY,CAACC,KAAaA,EAAU,SAASD,EAAE,KAAK,CAAC,GAC9FE,IAAQ,KAAK,IAAI,GAAGP,EAAQ,WAAW,MAAMK,EAAE,UAAUG,CAAK,CAAC;CACrE,SAASC,EAAK,GAAM,GAAM;EACxB,KAAK,IAAIC,IAAI,GAAGA,KAAKV,EAAQ,QAAQ,KAAK;GACxC,IAAM,KAAKW,IAAOC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