@ux-builder/ui 0.6.1 → 0.6.2
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 +1 -1
- package/catalogue.json +2 -2
- package/dist/index.js +1 -1
- package/dist/patterns.js +1 -1
- package/dist/{shared-CjrUPFqv.js → shared-CAXoQbx9.js} +102 -102
- package/dist/shared-CAXoQbx9.js.map +1 -0
- package/package.json +2 -2
- package/skill/ux-builder-ui/SKILL.md +1 -1
- package/dist/shared-CjrUPFqv.js.map +0 -1
package/AGENTS.md
CHANGED
|
@@ -77,7 +77,7 @@ import { ThemeProvider } from "@ux-builder/ui";
|
|
|
77
77
|
<!-- catalogue:start -->
|
|
78
78
|
## Reference (generated from the SDK; do not edit by hand)
|
|
79
79
|
|
|
80
|
-
@ux-builder/ui 0.6.
|
|
80
|
+
@ux-builder/ui 0.6.2, @ux-builder/tokens 1.6.0. The full catalogue, with every token and prop, is `@ux-builder/ui/catalogue.json`.
|
|
81
81
|
|
|
82
82
|
### Components
|
|
83
83
|
|
package/catalogue.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$description": "Generated by tools/gen-catalogue.mjs from source (FEAT-004 SDK-13). Do not edit; run npm run catalogue.",
|
|
3
3
|
"packages": {
|
|
4
|
-
"@ux-builder/ui": "0.6.
|
|
5
|
-
"@ux-builder/tokens": "1.
|
|
4
|
+
"@ux-builder/ui": "0.6.2",
|
|
5
|
+
"@ux-builder/tokens": "1.6.0"
|
|
6
6
|
},
|
|
7
7
|
"rules": [
|
|
8
8
|
"Use the SDK's widgets (@ux-builder/ui) for buttons, fields, choices, tables, menus, tabs, breadcrumbs, sheets, notices, status pills, toasts, progress bars, spinners, skeletons, icons and the logo; do not build your own. Icons beyond the shared names come from @ux-builder/ui/icons, never hand-drawn.",
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
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-CAXoQbx9.js";
|
|
2
2
|
import { UC as A, Wu as te, lP as ne } from "./shared-Bom_GJww.js";
|
|
3
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
4
|
import { jsx as L, jsxs as R } from "react/jsx-runtime";
|
package/dist/patterns.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as e, a as t, b as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, p as d, r as f, s as p, t as m, u as h } from "./shared-
|
|
1
|
+
import { _ as e, a as t, b as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, p as d, r as f, s as p, t as m, u as h } from "./shared-CAXoQbx9.js";
|
|
2
2
|
import { Fragment as g, cloneElement as _, useCallback as v, useEffect as y, useId as b, useLayoutEffect as x, useMemo as S, useRef as C, useState as w } from "react";
|
|
3
3
|
import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
4
4
|
//#region src/patterns/Layout.jsx
|
|
@@ -110,26 +110,26 @@ var f = [
|
|
|
110
110
|
png: "image/png",
|
|
111
111
|
webp: "image/webp",
|
|
112
112
|
ico: "image/x-icon"
|
|
113
|
-
}
|
|
114
|
-
function
|
|
113
|
+
}, _ = /url\(\s*(?:"((?:[^"\\]|\\.)*)"|'((?:[^'\\]|\\.)*)'|([^\s"'()]+))\s*\)/;
|
|
114
|
+
function v(e) {
|
|
115
115
|
if (typeof window > "u" || !e) return null;
|
|
116
|
-
let t = getComputedStyle(e).getPropertyValue("--piq-brand-favicon").trim();
|
|
117
|
-
return
|
|
116
|
+
let t = getComputedStyle(e).getPropertyValue("--piq-brand-favicon").trim(), n = _.exec(t);
|
|
117
|
+
return n ? (n[1] ?? n[2] ?? n[3]).replace(/\\(.)/g, "$1") : null;
|
|
118
118
|
}
|
|
119
|
-
function
|
|
119
|
+
function y(e = typeof document > "u" ? null : document.documentElement) {
|
|
120
120
|
if (typeof document > "u" || !e) return null;
|
|
121
|
-
let t =
|
|
121
|
+
let t = v(e), n = document.head.querySelector(`link[${h}]`);
|
|
122
122
|
if (!t) return n?.remove(), null;
|
|
123
123
|
n || (n = document.createElement("link"), n.rel = "icon", n.setAttribute(h, ""));
|
|
124
|
-
let r = g[/\.(\w+)(?:[?#].*)?$/.exec(t)?.[1]?.toLowerCase()];
|
|
124
|
+
let r = /^data:([^;,]+)/.exec(t)?.[1] ?? g[/\.(\w+)(?:[?#].*)?$/.exec(t)?.[1]?.toLowerCase()];
|
|
125
125
|
return r ? n.type = r : n.removeAttribute("type"), n.getAttribute("href") !== t && n.setAttribute("href", t), document.head.appendChild(n), t;
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function b() {
|
|
128
128
|
typeof document < "u" && document.head.querySelector(`link[${h}]`)?.remove();
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function x() {
|
|
131
131
|
return r(() => {
|
|
132
|
-
let e = document.documentElement, t = () =>
|
|
132
|
+
let e = document.documentElement, t = () => y(e);
|
|
133
133
|
t();
|
|
134
134
|
let n = new MutationObserver(t);
|
|
135
135
|
n.observe(e, {
|
|
@@ -138,119 +138,119 @@ function b() {
|
|
|
138
138
|
});
|
|
139
139
|
let r = window.matchMedia?.("(prefers-color-scheme: dark)");
|
|
140
140
|
return r?.addEventListener("change", t), () => {
|
|
141
|
-
n.disconnect(), r?.removeEventListener("change", t),
|
|
141
|
+
n.disconnect(), r?.removeEventListener("change", t), b();
|
|
142
142
|
};
|
|
143
143
|
}, []), null;
|
|
144
144
|
}
|
|
145
145
|
//#endregion
|
|
146
146
|
//#region src/ThemeProvider.jsx
|
|
147
|
-
var
|
|
147
|
+
var S = e(null), C = new Map(f.map((e) => [e.name, e])), w = "(prefers-color-scheme: dark)", T = "piq:set-theme", E = !0;
|
|
148
148
|
try {
|
|
149
|
-
|
|
149
|
+
E = process.env.NODE_ENV !== "production";
|
|
150
150
|
} catch {}
|
|
151
|
-
var
|
|
152
|
-
|
|
151
|
+
var D = (e) => {
|
|
152
|
+
E && console.warn(`@ux-builder/ui ThemeProvider: ${e}`);
|
|
153
153
|
};
|
|
154
|
-
function
|
|
155
|
-
return typeof window > "u" || !window.matchMedia ? null : window.matchMedia(
|
|
154
|
+
function O() {
|
|
155
|
+
return typeof window > "u" || !window.matchMedia ? null : window.matchMedia(w).matches ? "dark" : "light";
|
|
156
156
|
}
|
|
157
|
-
function
|
|
158
|
-
let r = t === "system" ? n : t, i =
|
|
157
|
+
function k(e, t, n = O()) {
|
|
158
|
+
let r = t === "system" ? n : t, i = C.get(e);
|
|
159
159
|
return i ? r && i.appearances.includes(r) ? r : i.default : r ?? null;
|
|
160
160
|
}
|
|
161
|
-
var
|
|
161
|
+
var A = typeof window > "u" ? r : a, ee = (e) => ({
|
|
162
162
|
...Object.fromEntries(m.map((e) => [`--${e}`, "initial"])),
|
|
163
163
|
...Object.fromEntries(Object.entries(e).filter(([, e]) => !String(e).startsWith("url(")).map(([e, t]) => [`--${e}`, t]))
|
|
164
164
|
});
|
|
165
165
|
function j({ theme: e, appearance: i = "system", tokens: a, favicon: l = !0, onChange: d, as: p = "div", style: m, children: h, ...g }) {
|
|
166
|
-
let _ = n(
|
|
167
|
-
r(() =>
|
|
168
|
-
if (
|
|
169
|
-
let e = window.matchMedia(
|
|
166
|
+
let _ = n(S), v = s(null), [x, E] = c(e), [j, M] = c(i), [N, P] = c(O);
|
|
167
|
+
r(() => E(e), [e]), r(() => M(i), [i]), A(() => {
|
|
168
|
+
if (j !== "system" || typeof window > "u" || !window.matchMedia) return;
|
|
169
|
+
let e = window.matchMedia(w), t = () => P(e.matches ? "dark" : "light");
|
|
170
170
|
return t(), e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
171
|
-
}, [
|
|
172
|
-
let
|
|
171
|
+
}, [j]);
|
|
172
|
+
let F = a ? j === "system" ? N ?? "light" : j : k(x, j, N);
|
|
173
173
|
r(() => {
|
|
174
|
-
a || (
|
|
174
|
+
a || (x && !C.has(x) ? D(`unknown theme "${x}"; known: ${[...C.keys()].join(", ")}`) : x && j !== "system" && F !== j && D(`theme "${x}" has no ${j} appearance; using ${F}`));
|
|
175
175
|
}, [
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
176
|
+
x,
|
|
177
|
+
j,
|
|
178
|
+
F,
|
|
179
179
|
a
|
|
180
180
|
]);
|
|
181
|
-
let
|
|
182
|
-
|
|
183
|
-
|
|
181
|
+
let I = l && !a && !_;
|
|
182
|
+
A(() => {
|
|
183
|
+
I && y(v.current);
|
|
184
184
|
}, [
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
]), r(() =>
|
|
189
|
-
let
|
|
190
|
-
|
|
185
|
+
I,
|
|
186
|
+
x,
|
|
187
|
+
F
|
|
188
|
+
]), r(() => I ? b : void 0, [I]);
|
|
189
|
+
let L = t((e) => {
|
|
190
|
+
E(e), d?.({
|
|
191
191
|
theme: e,
|
|
192
|
-
appearance:
|
|
192
|
+
appearance: j
|
|
193
193
|
});
|
|
194
|
-
}, [d,
|
|
195
|
-
|
|
196
|
-
theme:
|
|
194
|
+
}, [d, j]), R = t((e) => {
|
|
195
|
+
M(e), d?.({
|
|
196
|
+
theme: x,
|
|
197
197
|
appearance: e
|
|
198
198
|
});
|
|
199
|
-
}, [d,
|
|
199
|
+
}, [d, x]), z = !a && !_;
|
|
200
200
|
r(() => {
|
|
201
|
-
if (!
|
|
201
|
+
if (!z || typeof window > "u") return;
|
|
202
202
|
let e = (e) => {
|
|
203
203
|
let { theme: t, appearance: n } = e.detail ?? {};
|
|
204
|
-
t &&
|
|
205
|
-
theme: t ??
|
|
206
|
-
appearance: n ??
|
|
204
|
+
t && E(t), n && M(n), (t || n) && d?.({
|
|
205
|
+
theme: t ?? x,
|
|
206
|
+
appearance: n ?? j
|
|
207
207
|
});
|
|
208
208
|
};
|
|
209
|
-
return window.addEventListener(
|
|
209
|
+
return window.addEventListener(T, e), () => window.removeEventListener(T, e);
|
|
210
210
|
}, [
|
|
211
|
-
|
|
211
|
+
z,
|
|
212
212
|
d,
|
|
213
|
-
|
|
214
|
-
|
|
213
|
+
x,
|
|
214
|
+
j
|
|
215
215
|
]);
|
|
216
|
-
let
|
|
217
|
-
theme: a ? null :
|
|
218
|
-
appearance:
|
|
219
|
-
preference:
|
|
216
|
+
let B = o(() => ({
|
|
217
|
+
theme: a ? null : x,
|
|
218
|
+
appearance: F,
|
|
219
|
+
preference: j,
|
|
220
220
|
themes: f,
|
|
221
|
-
setTheme:
|
|
222
|
-
setAppearance:
|
|
221
|
+
setTheme: L,
|
|
222
|
+
setAppearance: R
|
|
223
223
|
}), [
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
224
|
+
x,
|
|
225
|
+
F,
|
|
226
|
+
j,
|
|
227
227
|
a,
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
]),
|
|
231
|
-
...
|
|
232
|
-
colorScheme:
|
|
228
|
+
L,
|
|
229
|
+
R
|
|
230
|
+
]), V = a ? { style: {
|
|
231
|
+
...ee(a),
|
|
232
|
+
colorScheme: F ?? void 0,
|
|
233
233
|
...m
|
|
234
234
|
} } : {
|
|
235
|
-
"data-theme":
|
|
236
|
-
...
|
|
235
|
+
"data-theme": x,
|
|
236
|
+
...F && { "data-appearance": F },
|
|
237
237
|
style: {
|
|
238
|
-
colorScheme:
|
|
238
|
+
colorScheme: F ?? void 0,
|
|
239
239
|
...m
|
|
240
240
|
}
|
|
241
241
|
};
|
|
242
|
-
return /* @__PURE__ */ u(
|
|
243
|
-
value:
|
|
242
|
+
return /* @__PURE__ */ u(S.Provider, {
|
|
243
|
+
value: B,
|
|
244
244
|
children: /* @__PURE__ */ u(p, {
|
|
245
|
-
ref:
|
|
245
|
+
ref: v,
|
|
246
246
|
...g,
|
|
247
|
-
...
|
|
247
|
+
...V,
|
|
248
248
|
children: h
|
|
249
249
|
})
|
|
250
250
|
});
|
|
251
251
|
}
|
|
252
252
|
function M() {
|
|
253
|
-
let e = n(
|
|
253
|
+
let e = n(S);
|
|
254
254
|
if (!e) throw Error("useTheme() needs a <ThemeProvider> above it");
|
|
255
255
|
return e;
|
|
256
256
|
}
|
|
@@ -839,14 +839,14 @@ function z(e) {
|
|
|
839
839
|
function B(e, t, n = P) {
|
|
840
840
|
return n[t]?.[e] ? [n[t][e], t] : n.lucide?.[e] ? [n.lucide[e], "lucide"] : [null, null];
|
|
841
841
|
}
|
|
842
|
-
var V = /* @__PURE__ */ new Map(), H = /<script|\son\w+\s*=|\shref\s*=|<foreignObject/i,
|
|
842
|
+
var V = /* @__PURE__ */ new Map(), H = /<script|\son\w+\s*=|\shref\s*=|<foreignObject/i, U = (e, t) => {
|
|
843
843
|
let n = e.glyphs;
|
|
844
844
|
if (n[t]) return [n[t], t];
|
|
845
845
|
if (n.lucide) return [n.lucide, "lucide"];
|
|
846
846
|
let r = Object.keys(N).find((e) => n[e]);
|
|
847
847
|
return r ? [n[r], r] : [null, null];
|
|
848
848
|
};
|
|
849
|
-
function
|
|
849
|
+
function W(...e) {
|
|
850
850
|
let t = [];
|
|
851
851
|
for (let n of e.flat()) {
|
|
852
852
|
if (!(n && typeof n.name == "string" && n.glyphs && Object.keys(n.glyphs).length > 0 && Object.keys(n.glyphs).every((e) => N[e]))) throw Error(`@ux-builder/ui registerIcons: an icon is { name, glyphs: { ${Object.keys(N).join(" | ")}: { viewBox, body } } }`);
|
|
@@ -855,17 +855,17 @@ function te(...e) {
|
|
|
855
855
|
}
|
|
856
856
|
return t;
|
|
857
857
|
}
|
|
858
|
-
var
|
|
858
|
+
var te = (e) => e.replace(/-([a-z])/g, (e, t) => t.toUpperCase()), ne = Object.fromEntries(Object.entries(N).map(([e, t]) => [e, Object.fromEntries(Object.entries(t.svg).map(([e, t]) => [te(e), t]))])), re = typeof window > "u" ? r : a;
|
|
859
859
|
function G({ name: e, icon: t, set: r, size: i = "1em", label: a, className: o = "", ...l }) {
|
|
860
|
-
let d = n(
|
|
861
|
-
|
|
860
|
+
let d = n(S), f = s(null), [p, m] = c(null), [h, g] = c(null);
|
|
861
|
+
re(() => {
|
|
862
862
|
if (r || !f.current) return;
|
|
863
863
|
let e = getComputedStyle(f.current).getPropertyValue("--piq-icon-set").trim().replace(/^["']|["']$/g, "");
|
|
864
864
|
g(P[e] ? e : null), d?.theme || m(f.current.closest?.("[data-theme]")?.getAttribute("data-theme") ?? null);
|
|
865
865
|
});
|
|
866
|
-
let _ = r ?? h ?? z(d?.theme ?? p), v = t ?? (P.lucide[e] ? null : V.get(e)), [y, b] = v ?
|
|
866
|
+
let _ = r ?? h ?? z(d?.theme ?? p), v = t ?? (P.lucide[e] ? null : V.get(e)), [y, b] = v ? U(v, _) : B(e, _);
|
|
867
867
|
if (!y) return R && console.warn(`@ux-builder/ui Icon: no icon "${e}". Shared names: ${L.join(", ")}. Every Lucide icon is in @ux-builder/ui/icons: import it (e.g. import { iconPin } from "@ux-builder/ui/icons") and pass icon={iconPin}, or registerIcons(iconPin) once.`), null;
|
|
868
|
-
let
|
|
868
|
+
let x = a ? {
|
|
869
869
|
role: "img",
|
|
870
870
|
"aria-label": a
|
|
871
871
|
} : {
|
|
@@ -881,17 +881,17 @@ function G({ name: e, icon: t, set: r, size: i = "1em", label: a, className: o =
|
|
|
881
881
|
className: `piq-icon${o ? ` ${o}` : ""}`,
|
|
882
882
|
"data-icon": v?.name ?? e,
|
|
883
883
|
"data-icon-set": b,
|
|
884
|
-
...
|
|
885
|
-
...
|
|
884
|
+
...ne[b],
|
|
885
|
+
...x,
|
|
886
886
|
...l,
|
|
887
887
|
dangerouslySetInnerHTML: { __html: y.body }
|
|
888
888
|
});
|
|
889
889
|
}
|
|
890
890
|
//#endregion
|
|
891
891
|
//#region src/widgets/Loading.jsx
|
|
892
|
-
var
|
|
893
|
-
function
|
|
894
|
-
let l = i(), f = n > 0 ? n : 100, p = typeof t == "number" && Number.isFinite(t), m = p ?
|
|
892
|
+
var ie = (e, t, n) => Math.min(n, Math.max(t, e)), K = (e) => typeof e == "number" ? `${e}px` : e;
|
|
893
|
+
function ae({ label: e, value: t, max: n = 100, valueText: r, showValue: a = !1, hideLabel: o = !1, className: s = "", ...c }) {
|
|
894
|
+
let l = i(), f = n > 0 ? n : 100, p = typeof t == "number" && Number.isFinite(t), m = p ? ie(t, 0, f) : null, h = p ? Math.round(m / f * 100) : null;
|
|
895
895
|
return /* @__PURE__ */ d("div", {
|
|
896
896
|
className: `piq-progress${p ? "" : " piq-progress--indeterminate"}${s ? ` ${s}` : ""}`,
|
|
897
897
|
...c,
|
|
@@ -943,7 +943,7 @@ function q() {
|
|
|
943
943
|
})]
|
|
944
944
|
});
|
|
945
945
|
}
|
|
946
|
-
function
|
|
946
|
+
function oe({ size: e = "md", label: t = "Loading", showLabel: n = !1, className: r = "", ...i }) {
|
|
947
947
|
return /* @__PURE__ */ d("span", {
|
|
948
948
|
className: `piq-spinner piq-spinner--${e}${r ? ` ${r}` : ""}`,
|
|
949
949
|
role: "status",
|
|
@@ -954,7 +954,7 @@ function ae({ size: e = "md", label: t = "Loading", showLabel: n = !1, className
|
|
|
954
954
|
})]
|
|
955
955
|
});
|
|
956
956
|
}
|
|
957
|
-
function
|
|
957
|
+
function se({ variant: e = "text", lines: t = 1, width: n, height: r, className: i = "", style: a, ...o }) {
|
|
958
958
|
let s = `piq-skeleton piq-skeleton--${e}${i ? ` ${i}` : ""}`;
|
|
959
959
|
if (e === "text") {
|
|
960
960
|
let e = Math.max(1, Math.floor(t));
|
|
@@ -988,13 +988,13 @@ function oe({ variant: e = "text", lines: t = 1, width: n, height: r, className:
|
|
|
988
988
|
}
|
|
989
989
|
//#endregion
|
|
990
990
|
//#region src/widgets/Button.jsx
|
|
991
|
-
var
|
|
991
|
+
var ce = {
|
|
992
992
|
primary: "",
|
|
993
993
|
secondary: " piq-btn--secondary",
|
|
994
994
|
text: " piq-btn--text"
|
|
995
995
|
};
|
|
996
996
|
function J({ variant: e = "primary", size: t, badge: n, busy: r = !1, type: i = "button", className: a = "", onClick: o, children: s, ...c }) {
|
|
997
|
-
let f = `piq-btn${
|
|
997
|
+
let f = `piq-btn${ce[e] ?? ""}${t === "sm" ? " piq-btn--sm" : ""}${r ? " piq-btn--busy" : ""}${a ? ` ${a}` : ""}`, p = /* @__PURE__ */ d(l, { children: [s, n != null && /* @__PURE__ */ u("span", {
|
|
998
998
|
className: "piq-btn__badge",
|
|
999
999
|
children: n
|
|
1000
1000
|
})] });
|
|
@@ -1022,7 +1022,7 @@ function J({ variant: e = "primary", size: t, badge: n, busy: r = !1, type: i =
|
|
|
1022
1022
|
}
|
|
1023
1023
|
//#endregion
|
|
1024
1024
|
//#region src/widgets/Choice.jsx
|
|
1025
|
-
function
|
|
1025
|
+
function le({ label: e, className: t = "", ...n }) {
|
|
1026
1026
|
return /* @__PURE__ */ d("label", {
|
|
1027
1027
|
className: `piq-check${t ? ` ${t}` : ""}`,
|
|
1028
1028
|
children: [/* @__PURE__ */ u("input", {
|
|
@@ -1032,7 +1032,7 @@ function ce({ label: e, className: t = "", ...n }) {
|
|
|
1032
1032
|
}), /* @__PURE__ */ u("span", { children: e })]
|
|
1033
1033
|
});
|
|
1034
1034
|
}
|
|
1035
|
-
function
|
|
1035
|
+
function ue({ label: e, className: t = "", ...n }) {
|
|
1036
1036
|
return /* @__PURE__ */ d("label", {
|
|
1037
1037
|
className: `piq-check piq-switch${t ? ` ${t}` : ""}`,
|
|
1038
1038
|
children: [/* @__PURE__ */ u("input", {
|
|
@@ -1043,7 +1043,7 @@ function le({ label: e, className: t = "", ...n }) {
|
|
|
1043
1043
|
}), /* @__PURE__ */ u("span", { children: e })]
|
|
1044
1044
|
});
|
|
1045
1045
|
}
|
|
1046
|
-
function
|
|
1046
|
+
function de({ label: e, options: t, name: n, value: r, defaultValue: a, onChange: o, disabled: s }) {
|
|
1047
1047
|
let c = i(), l = n ?? c;
|
|
1048
1048
|
return /* @__PURE__ */ d("fieldset", {
|
|
1049
1049
|
className: "piq-radios",
|
|
@@ -1112,7 +1112,7 @@ function X({ label: e, hint: t, error: n, id: r, className: i = "", ...a }) {
|
|
|
1112
1112
|
})
|
|
1113
1113
|
});
|
|
1114
1114
|
}
|
|
1115
|
-
function
|
|
1115
|
+
function fe({ label: e, hint: t, error: n, id: r, className: i = "", rows: a = 4, ...o }) {
|
|
1116
1116
|
return /* @__PURE__ */ u(Y, {
|
|
1117
1117
|
label: e,
|
|
1118
1118
|
hint: t,
|
|
@@ -1169,7 +1169,7 @@ function Q({ label: e, value: t, onChange: n, min: r, max: i, hint: a, error: o,
|
|
|
1169
1169
|
onChange: (e) => n?.(e.target.value)
|
|
1170
1170
|
});
|
|
1171
1171
|
}
|
|
1172
|
-
function
|
|
1172
|
+
function pe({ label: e, from: t, to: n, onChange: r, min: a, max: o, fromLabel: s = "From", toLabel: c = "To", className: l }) {
|
|
1173
1173
|
let f = i();
|
|
1174
1174
|
return /* @__PURE__ */ d("fieldset", {
|
|
1175
1175
|
className: `piq-date-range${l ? ` ${l}` : ""}`,
|
|
@@ -1215,7 +1215,7 @@ function $(e, t) {
|
|
|
1215
1215
|
}
|
|
1216
1216
|
//#endregion
|
|
1217
1217
|
//#region src/widgets/Dialog.jsx
|
|
1218
|
-
function
|
|
1218
|
+
function me({ open: e = !1, onClose: t, title: n, description: r, actions: a, closeLabel: o = "Close", initialFocus: s, role: c, className: l, children: f, ...p }) {
|
|
1219
1219
|
let m = $(e, s), h = i(), g = i();
|
|
1220
1220
|
return /* @__PURE__ */ d("dialog", {
|
|
1221
1221
|
ref: m,
|
|
@@ -1260,7 +1260,7 @@ function pe({ open: e = !1, onClose: t, title: n, description: r, actions: a, cl
|
|
|
1260
1260
|
}
|
|
1261
1261
|
//#endregion
|
|
1262
1262
|
//#region src/widgets/MenuButton.jsx
|
|
1263
|
-
function
|
|
1263
|
+
function he({ label: e, items: t = [], icon: n, variant: a = "secondary", size: o, align: l = "start", buttonLabel: f, className: p, ...m }) {
|
|
1264
1264
|
let [h, g] = c(!1), [_, v] = c(-1), y = s(null), b = s(null), x = i(), S = t.map((e, t) => e.disabled ? -1 : t).filter((e) => e >= 0), C = (e) => {
|
|
1265
1265
|
g(!0), v(e === "last" ? S.at(-1) : S[0]);
|
|
1266
1266
|
}, w = (e = !0) => {
|
|
@@ -1360,7 +1360,7 @@ function me({ label: e, items: t = [], icon: n, variant: a = "secondary", size:
|
|
|
1360
1360
|
}
|
|
1361
1361
|
//#endregion
|
|
1362
1362
|
//#region src/widgets/Pagination.jsx
|
|
1363
|
-
function
|
|
1363
|
+
function ge({ page: e = 1, pageSize: t = 20, total: n = 0, onPageChange: r, pageSizes: i = [
|
|
1364
1364
|
10,
|
|
1365
1365
|
20,
|
|
1366
1366
|
50,
|
|
@@ -1409,7 +1409,7 @@ function he({ page: e = 1, pageSize: t = 20, total: n = 0, onPageChange: r, page
|
|
|
1409
1409
|
}
|
|
1410
1410
|
//#endregion
|
|
1411
1411
|
//#region src/widgets/Sheet.jsx
|
|
1412
|
-
function
|
|
1412
|
+
function _e({ open: e = !1, onClose: t, title: n, label: r, side: a = "start", closeLabel: o = "Close", initialFocus: s, className: c, children: l, ...f }) {
|
|
1413
1413
|
let p = $(e, s), m = i();
|
|
1414
1414
|
return /* @__PURE__ */ u("dialog", {
|
|
1415
1415
|
ref: p,
|
|
@@ -1445,7 +1445,7 @@ function ge({ open: e = !1, onClose: t, title: n, label: r, side: a = "start", c
|
|
|
1445
1445
|
}
|
|
1446
1446
|
//#endregion
|
|
1447
1447
|
//#region src/widgets/Tabs.jsx
|
|
1448
|
-
function
|
|
1448
|
+
function ve({ tabs: e = [], value: t, defaultValue: n, onChange: r, label: a, className: o, ...l }) {
|
|
1449
1449
|
let [f, p] = c(n ?? e[0]?.id), m = t ?? f, h = i(), g = s(null);
|
|
1450
1450
|
function _(e, n) {
|
|
1451
1451
|
t === void 0 && p(e), e !== m && r?.(e), n && [...g.current?.querySelectorAll("[role=\"tab\"]") ?? []].find((t) => t.dataset.tab === String(e))?.focus();
|
|
@@ -1496,6 +1496,6 @@ function _e({ tabs: e = [], value: t, defaultValue: n, onChange: r, label: a, cl
|
|
|
1496
1496
|
});
|
|
1497
1497
|
}
|
|
1498
1498
|
//#endregion
|
|
1499
|
-
export { p as A,
|
|
1499
|
+
export { p as A, W as C, M as D, k as E, x as O, B as S, j as T, se as _, me as a, G as b, Y as c, X as d, le as f, ae as g, J as h, he as i, f as j, y as k, Z as l, ue as m, _e as n, Q as o, de as p, ge as r, pe as s, ve as t, fe as u, oe as v, S as w, z as x, L as y };
|
|
1500
1500
|
|
|
1501
|
-
//# sourceMappingURL=shared-
|
|
1501
|
+
//# sourceMappingURL=shared-CAXoQbx9.js.map
|