@ux-builder/ui 0.6.0 → 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 +2 -1
- package/catalogue.json +15 -2
- package/dist/index.js +1 -1
- package/dist/patterns.js +1 -1
- package/dist/{shared-DspdvNFe.js → shared-CAXoQbx9.js} +115 -102
- package/dist/shared-CAXoQbx9.js.map +1 -0
- package/package.json +2 -2
- package/skill/ux-builder-ui/SKILL.md +2 -1
- package/dist/shared-DspdvNFe.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
|
|
|
@@ -271,4 +271,5 @@ The page's favicon follows the theme too: the top-level `ThemeProvider` sets it
|
|
|
271
271
|
| `praxis-material` | material | dark, light (default dark) |
|
|
272
272
|
| `praxis-v2-databricks` | databricks | dark, light (default light) |
|
|
273
273
|
| `synaptiq` | own anatomy | dark, light (default light) |
|
|
274
|
+
| `ux-builder-databricks` | databricks | dark, light (default light) |
|
|
274
275
|
<!-- catalogue:end -->
|
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.",
|
|
@@ -130,6 +130,19 @@
|
|
|
130
130
|
"default": "light",
|
|
131
131
|
"css": "@ux-builder/tokens/themes/synaptiq.css",
|
|
132
132
|
"fonts": "@ux-builder/tokens/fonts/synaptiq.css"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"name": "ux-builder-databricks",
|
|
136
|
+
"title": "UX Builder Databricks",
|
|
137
|
+
"brand": "ux-builder",
|
|
138
|
+
"designSystem": "databricks",
|
|
139
|
+
"appearances": [
|
|
140
|
+
"dark",
|
|
141
|
+
"light"
|
|
142
|
+
],
|
|
143
|
+
"default": "light",
|
|
144
|
+
"css": "@ux-builder/tokens/themes/ux-builder-databricks.css",
|
|
145
|
+
"fonts": "@ux-builder/tokens/fonts/ux-builder-databricks.css"
|
|
133
146
|
}
|
|
134
147
|
],
|
|
135
148
|
"designSystems": [
|
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
|
|
@@ -65,6 +65,14 @@ var f = [
|
|
|
65
65
|
designSystem: null,
|
|
66
66
|
default: "light",
|
|
67
67
|
appearances: ["dark", "light"]
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: "ux-builder-databricks",
|
|
71
|
+
title: "UX Builder Databricks",
|
|
72
|
+
brand: "ux-builder",
|
|
73
|
+
designSystem: "databricks",
|
|
74
|
+
default: "light",
|
|
75
|
+
appearances: ["dark", "light"]
|
|
68
76
|
}
|
|
69
77
|
], p = [
|
|
70
78
|
{
|
|
@@ -91,32 +99,37 @@ var f = [
|
|
|
91
99
|
name: "synaptiq",
|
|
92
100
|
title: "Synaptiq",
|
|
93
101
|
appearances: ["light", "dark"]
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
name: "ux-builder",
|
|
105
|
+
title: "UX Builder",
|
|
106
|
+
appearances: ["light", "dark"]
|
|
94
107
|
}
|
|
95
108
|
], m = /* @__PURE__ */ "accent.badge-bg.badge-fg.badge-radius.badge-size.body.border.btn-focus-offset.btn-focus-ring.btn-hover-mix.btn-lift.btn-lift-hover.btn-lift-press.btn-lift-quiet.btn-min-height.btn-pad-x.btn-press-mix.btn-radius.btn-secondary-bg.btn-secondary-border.btn-secondary-fg.btn-shift-hover.btn-shift-press.btn-size.btn-text-fg.btn-weight.card-bg.card-border.card-pad.check-border.check-on-bg.check-on-fg.check-radius.check-size.favicon.field-bg.field-border.field-border-bottom.field-focus-offset.field-focus-outline.field-focus-shadow.field-height.field-hover-edge.field-invalid-shadow.field-label-fg.field-label-size.field-label-tracking.field-label-transform.field-label-weight.field-pad-x.field-radius.font-body.font-display.font-heading.font-mono.ink.leading-body.leading-tight.logo-aspect.logo-bg.logo-height.logo-height-sm.logo-image.logo-mask.logo-paint.mark-bg.mark-image.mark-mask.measure.menu-bg.menu-border.menu-item-height.menu-item-hover.menu-item-on-bg.menu-item-on-fg.menu-item-on-mark.menu-item-on-weight.menu-pad-y.menu-radius.menu-shadow.muted.muted-2.navy.notice-bg.notice-border-width.notice-edge-mix.notice-radius.notice-stripe.notice-tint.paper.pill-bg.pill-border.pill-dot-size.pill-gap.pill-pad.pill-radius.pill-size.pill-tracking.pill-transform.pill-weight.piq-badge-bg.piq-badge-fg.piq-badge-font-size.piq-badge-radius.piq-border-default.piq-brand-favicon.piq-brand-logo-aspect.piq-brand-logo-bg.piq-brand-logo-height.piq-brand-logo-height-sm.piq-brand-logo-image.piq-brand-logo-mask.piq-brand-logo-paint.piq-brand-mark-bg.piq-brand-mark-image.piq-brand-mark-mask.piq-button-font-size.piq-button-font-weight.piq-button-ghost-fg.piq-button-height.piq-button-offset-hover.piq-button-offset-press.piq-button-padding-x.piq-button-radius.piq-button-secondary-bg.piq-button-secondary-border.piq-button-secondary-fg.piq-button-shadow.piq-button-shadow-flat.piq-button-shadow-hover.piq-button-shadow-press.piq-card-bg.piq-card-border.piq-card-padding.piq-check-border.piq-check-checked-bg.piq-check-checked-fg.piq-check-radius.piq-check-size.piq-choice-picker-border.piq-choice-picker-divider.piq-choice-picker-font-size.piq-choice-picker-font-weight.piq-choice-picker-gap.piq-choice-picker-height.piq-choice-picker-option-bg.piq-choice-picker-option-border.piq-choice-picker-option-fg.piq-choice-picker-option-hover-bg.piq-choice-picker-option-radius.piq-choice-picker-option-selected-bg.piq-choice-picker-option-selected-check.piq-choice-picker-option-selected-fg.piq-choice-picker-padding-x.piq-choice-picker-radius.piq-color-accent.piq-color-border.piq-color-ground.piq-color-ground-recessed.piq-color-on-accent.piq-color-structure.piq-color-surface.piq-color-surface-sunken.piq-color-text.piq-color-text-muted.piq-color-text-strong.piq-color-text-subtle.piq-field-bg.piq-field-border.piq-field-border-bottom.piq-field-border-hover.piq-field-focus-offset.piq-field-focus-outline.piq-field-focus-shadow.piq-field-height.piq-field-invalid-shadow.piq-field-label-fg.piq-field-label-font-size.piq-field-label-font-weight.piq-field-label-letter-spacing.piq-field-label-text-transform.piq-field-padding-x.piq-field-radius.piq-focus-offset.piq-focus-ring.piq-font-body.piq-font-display.piq-font-heading.piq-font-mono.piq-font-size-body.piq-font-size-display.piq-font-size-heading.piq-font-size-label.piq-font-size-lead.piq-font-size-small.piq-font-size-title.piq-font-weight-regular.piq-font-weight-strong.piq-icon-set.piq-letter-spacing-eyebrow.piq-letter-spacing-label.piq-line-height-body.piq-line-height-tight.piq-menu-bg.piq-menu-border.piq-menu-item-height.piq-menu-item-hover-bg.piq-menu-item-selected-bg.piq-menu-item-selected-fg.piq-menu-item-selected-font-weight.piq-menu-item-selected-indicator.piq-menu-padding-y.piq-menu-radius.piq-menu-shadow.piq-nav-bar-height.piq-nav-item-direction.piq-nav-item-gap.piq-nav-item-label-font-size.piq-nav-item-selected-bg.piq-nav-item-selected-border.piq-nav-width.piq-notice-bg.piq-notice-border-tone-mix.piq-notice-border-width.piq-notice-radius.piq-notice-stripe-width.piq-notice-tone-mix.piq-page-header-gap.piq-page-header-padding-y.piq-page-header-title-font-size.piq-pill-bg.piq-pill-border.piq-pill-dot-size.piq-pill-font-size.piq-pill-font-weight.piq-pill-gap.piq-pill-letter-spacing.piq-pill-padding.piq-pill-radius.piq-pill-text-transform.piq-progress-fill-bg.piq-progress-height.piq-progress-radius.piq-progress-track-bg.piq-radius-card.piq-radius-control.piq-shadow-card.piq-shadow-overlay.piq-size-breakpoint-expanded.piq-size-breakpoint-extra-large.piq-size-breakpoint-large.piq-size-breakpoint-medium.piq-size-content-form.piq-size-content-page.piq-size-measure.piq-size-target-minimum.piq-size-target-touch.piq-skeleton-bg.piq-skeleton-effect.piq-skeleton-radius.piq-space-1.piq-space-2.piq-space-3.piq-space-4.piq-space-5.piq-space-6.piq-space-7.piq-space-8.piq-space-gutter-compact.piq-space-gutter-expanded.piq-space-gutter-extra-large.piq-space-gutter-large.piq-space-gutter-medium.piq-spinner-line-cap.piq-spinner-stroke-width.piq-spinner-track-color.piq-state-closed.piq-state-evaluation.piq-state-layer-hover.piq-state-layer-press.piq-state-limited.piq-state-live.piq-state-purchasing.piq-switch-checked-thumb-bg.piq-switch-checked-thumb-size.piq-switch-checked-track-bg.piq-switch-height.piq-switch-radius.piq-switch-thumb-bg.piq-switch-thumb-inset.piq-switch-thumb-size.piq-switch-track-bg.piq-switch-track-border.piq-switch-width.piq-table-cell-padding-x.piq-table-cell-padding-y.piq-table-font-size.piq-table-header-bg.piq-table-header-border.piq-table-header-fg.piq-table-header-font-size.piq-table-header-font-weight.piq-table-header-height.piq-table-header-letter-spacing.piq-table-header-text-transform.piq-table-row-border.piq-table-row-height.piq-table-row-hover-bg.piq-table-row-stripe-bg.piq-tabs-indicator-height.piq-tabs-list-border.piq-tabs-tab-bg-selected.piq-tabs-tab-padding-x.piq-tabs-tab-radius.piq-toast-action-fg.piq-toast-bg.piq-toast-fg.piq-toast-radius.piq-toast-shadow.piq-toast-stripe-width.radius.radius-card.rail.rule.seg-bg.seg-divider.seg-fg.seg-gap.seg-height.seg-hover-bg.seg-on-bg.seg-on-fg.seg-opt-border.seg-opt-radius.seg-outline.seg-pad-x.seg-radius.seg-size.seg-tick.seg-weight.shadow-card.shadow-raised.size-body.size-display.size-heading.size-intro.size-label.size-small.size-title.space-1.space-2.space-3.space-4.space-5.space-6.space-7.space-8.state-closed.state-evaluation.state-limited.state-live.state-purchasing.surface.surface-sunken.switch-height.switch-inset.switch-off-bg.switch-off-border.switch-on-bg.switch-radius.switch-thumb-off.switch-thumb-off-bg.switch-thumb-on.switch-thumb-on-bg.switch-width.table-head-bg.table-head-border.table-head-fg.table-head-height.table-head-size.table-head-tracking.table-head-transform.table-head-weight.table-pad-x.table-pad-y.table-row-height.table-row-hover.table-size.toast-action-fg.toast-bg.toast-fg.toast-radius.toast-shadow.toast-stripe.tracking-kicker.tracking-label.weight-bold.weight-normal".split("."), h = "data-piq-favicon", g = {
|
|
96
109
|
svg: "image/svg+xml",
|
|
97
110
|
png: "image/png",
|
|
98
111
|
webp: "image/webp",
|
|
99
112
|
ico: "image/x-icon"
|
|
100
|
-
}
|
|
101
|
-
function
|
|
113
|
+
}, _ = /url\(\s*(?:"((?:[^"\\]|\\.)*)"|'((?:[^'\\]|\\.)*)'|([^\s"'()]+))\s*\)/;
|
|
114
|
+
function v(e) {
|
|
102
115
|
if (typeof window > "u" || !e) return null;
|
|
103
|
-
let t = getComputedStyle(e).getPropertyValue("--piq-brand-favicon").trim();
|
|
104
|
-
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;
|
|
105
118
|
}
|
|
106
|
-
function
|
|
119
|
+
function y(e = typeof document > "u" ? null : document.documentElement) {
|
|
107
120
|
if (typeof document > "u" || !e) return null;
|
|
108
|
-
let t =
|
|
121
|
+
let t = v(e), n = document.head.querySelector(`link[${h}]`);
|
|
109
122
|
if (!t) return n?.remove(), null;
|
|
110
123
|
n || (n = document.createElement("link"), n.rel = "icon", n.setAttribute(h, ""));
|
|
111
|
-
let r = g[/\.(\w+)(?:[?#].*)?$/.exec(t)?.[1]?.toLowerCase()];
|
|
124
|
+
let r = /^data:([^;,]+)/.exec(t)?.[1] ?? g[/\.(\w+)(?:[?#].*)?$/.exec(t)?.[1]?.toLowerCase()];
|
|
112
125
|
return r ? n.type = r : n.removeAttribute("type"), n.getAttribute("href") !== t && n.setAttribute("href", t), document.head.appendChild(n), t;
|
|
113
126
|
}
|
|
114
|
-
function
|
|
127
|
+
function b() {
|
|
115
128
|
typeof document < "u" && document.head.querySelector(`link[${h}]`)?.remove();
|
|
116
129
|
}
|
|
117
|
-
function
|
|
130
|
+
function x() {
|
|
118
131
|
return r(() => {
|
|
119
|
-
let e = document.documentElement, t = () =>
|
|
132
|
+
let e = document.documentElement, t = () => y(e);
|
|
120
133
|
t();
|
|
121
134
|
let n = new MutationObserver(t);
|
|
122
135
|
n.observe(e, {
|
|
@@ -125,119 +138,119 @@ function b() {
|
|
|
125
138
|
});
|
|
126
139
|
let r = window.matchMedia?.("(prefers-color-scheme: dark)");
|
|
127
140
|
return r?.addEventListener("change", t), () => {
|
|
128
|
-
n.disconnect(), r?.removeEventListener("change", t),
|
|
141
|
+
n.disconnect(), r?.removeEventListener("change", t), b();
|
|
129
142
|
};
|
|
130
143
|
}, []), null;
|
|
131
144
|
}
|
|
132
145
|
//#endregion
|
|
133
146
|
//#region src/ThemeProvider.jsx
|
|
134
|
-
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;
|
|
135
148
|
try {
|
|
136
|
-
|
|
149
|
+
E = process.env.NODE_ENV !== "production";
|
|
137
150
|
} catch {}
|
|
138
|
-
var
|
|
139
|
-
|
|
151
|
+
var D = (e) => {
|
|
152
|
+
E && console.warn(`@ux-builder/ui ThemeProvider: ${e}`);
|
|
140
153
|
};
|
|
141
|
-
function
|
|
142
|
-
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";
|
|
143
156
|
}
|
|
144
|
-
function
|
|
145
|
-
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);
|
|
146
159
|
return i ? r && i.appearances.includes(r) ? r : i.default : r ?? null;
|
|
147
160
|
}
|
|
148
|
-
var
|
|
161
|
+
var A = typeof window > "u" ? r : a, ee = (e) => ({
|
|
149
162
|
...Object.fromEntries(m.map((e) => [`--${e}`, "initial"])),
|
|
150
163
|
...Object.fromEntries(Object.entries(e).filter(([, e]) => !String(e).startsWith("url(")).map(([e, t]) => [`--${e}`, t]))
|
|
151
164
|
});
|
|
152
165
|
function j({ theme: e, appearance: i = "system", tokens: a, favicon: l = !0, onChange: d, as: p = "div", style: m, children: h, ...g }) {
|
|
153
|
-
let _ = n(
|
|
154
|
-
r(() =>
|
|
155
|
-
if (
|
|
156
|
-
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");
|
|
157
170
|
return t(), e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
158
|
-
}, [
|
|
159
|
-
let
|
|
171
|
+
}, [j]);
|
|
172
|
+
let F = a ? j === "system" ? N ?? "light" : j : k(x, j, N);
|
|
160
173
|
r(() => {
|
|
161
|
-
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}`));
|
|
162
175
|
}, [
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
176
|
+
x,
|
|
177
|
+
j,
|
|
178
|
+
F,
|
|
166
179
|
a
|
|
167
180
|
]);
|
|
168
|
-
let
|
|
169
|
-
|
|
170
|
-
|
|
181
|
+
let I = l && !a && !_;
|
|
182
|
+
A(() => {
|
|
183
|
+
I && y(v.current);
|
|
171
184
|
}, [
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
]), r(() =>
|
|
176
|
-
let
|
|
177
|
-
|
|
185
|
+
I,
|
|
186
|
+
x,
|
|
187
|
+
F
|
|
188
|
+
]), r(() => I ? b : void 0, [I]);
|
|
189
|
+
let L = t((e) => {
|
|
190
|
+
E(e), d?.({
|
|
178
191
|
theme: e,
|
|
179
|
-
appearance:
|
|
192
|
+
appearance: j
|
|
180
193
|
});
|
|
181
|
-
}, [d,
|
|
182
|
-
|
|
183
|
-
theme:
|
|
194
|
+
}, [d, j]), R = t((e) => {
|
|
195
|
+
M(e), d?.({
|
|
196
|
+
theme: x,
|
|
184
197
|
appearance: e
|
|
185
198
|
});
|
|
186
|
-
}, [d,
|
|
199
|
+
}, [d, x]), z = !a && !_;
|
|
187
200
|
r(() => {
|
|
188
|
-
if (!
|
|
201
|
+
if (!z || typeof window > "u") return;
|
|
189
202
|
let e = (e) => {
|
|
190
203
|
let { theme: t, appearance: n } = e.detail ?? {};
|
|
191
|
-
t &&
|
|
192
|
-
theme: t ??
|
|
193
|
-
appearance: n ??
|
|
204
|
+
t && E(t), n && M(n), (t || n) && d?.({
|
|
205
|
+
theme: t ?? x,
|
|
206
|
+
appearance: n ?? j
|
|
194
207
|
});
|
|
195
208
|
};
|
|
196
|
-
return window.addEventListener(
|
|
209
|
+
return window.addEventListener(T, e), () => window.removeEventListener(T, e);
|
|
197
210
|
}, [
|
|
198
|
-
|
|
211
|
+
z,
|
|
199
212
|
d,
|
|
200
|
-
|
|
201
|
-
|
|
213
|
+
x,
|
|
214
|
+
j
|
|
202
215
|
]);
|
|
203
|
-
let
|
|
204
|
-
theme: a ? null :
|
|
205
|
-
appearance:
|
|
206
|
-
preference:
|
|
216
|
+
let B = o(() => ({
|
|
217
|
+
theme: a ? null : x,
|
|
218
|
+
appearance: F,
|
|
219
|
+
preference: j,
|
|
207
220
|
themes: f,
|
|
208
|
-
setTheme:
|
|
209
|
-
setAppearance:
|
|
221
|
+
setTheme: L,
|
|
222
|
+
setAppearance: R
|
|
210
223
|
}), [
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
224
|
+
x,
|
|
225
|
+
F,
|
|
226
|
+
j,
|
|
214
227
|
a,
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
]),
|
|
218
|
-
...
|
|
219
|
-
colorScheme:
|
|
228
|
+
L,
|
|
229
|
+
R
|
|
230
|
+
]), V = a ? { style: {
|
|
231
|
+
...ee(a),
|
|
232
|
+
colorScheme: F ?? void 0,
|
|
220
233
|
...m
|
|
221
234
|
} } : {
|
|
222
|
-
"data-theme":
|
|
223
|
-
...
|
|
235
|
+
"data-theme": x,
|
|
236
|
+
...F && { "data-appearance": F },
|
|
224
237
|
style: {
|
|
225
|
-
colorScheme:
|
|
238
|
+
colorScheme: F ?? void 0,
|
|
226
239
|
...m
|
|
227
240
|
}
|
|
228
241
|
};
|
|
229
|
-
return /* @__PURE__ */ u(
|
|
230
|
-
value:
|
|
242
|
+
return /* @__PURE__ */ u(S.Provider, {
|
|
243
|
+
value: B,
|
|
231
244
|
children: /* @__PURE__ */ u(p, {
|
|
232
|
-
ref:
|
|
245
|
+
ref: v,
|
|
233
246
|
...g,
|
|
234
|
-
...
|
|
247
|
+
...V,
|
|
235
248
|
children: h
|
|
236
249
|
})
|
|
237
250
|
});
|
|
238
251
|
}
|
|
239
252
|
function M() {
|
|
240
|
-
let e = n(
|
|
253
|
+
let e = n(S);
|
|
241
254
|
if (!e) throw Error("useTheme() needs a <ThemeProvider> above it");
|
|
242
255
|
return e;
|
|
243
256
|
}
|
|
@@ -826,14 +839,14 @@ function z(e) {
|
|
|
826
839
|
function B(e, t, n = P) {
|
|
827
840
|
return n[t]?.[e] ? [n[t][e], t] : n.lucide?.[e] ? [n.lucide[e], "lucide"] : [null, null];
|
|
828
841
|
}
|
|
829
|
-
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) => {
|
|
830
843
|
let n = e.glyphs;
|
|
831
844
|
if (n[t]) return [n[t], t];
|
|
832
845
|
if (n.lucide) return [n.lucide, "lucide"];
|
|
833
846
|
let r = Object.keys(N).find((e) => n[e]);
|
|
834
847
|
return r ? [n[r], r] : [null, null];
|
|
835
848
|
};
|
|
836
|
-
function
|
|
849
|
+
function W(...e) {
|
|
837
850
|
let t = [];
|
|
838
851
|
for (let n of e.flat()) {
|
|
839
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 } } }`);
|
|
@@ -842,17 +855,17 @@ function te(...e) {
|
|
|
842
855
|
}
|
|
843
856
|
return t;
|
|
844
857
|
}
|
|
845
|
-
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;
|
|
846
859
|
function G({ name: e, icon: t, set: r, size: i = "1em", label: a, className: o = "", ...l }) {
|
|
847
|
-
let d = n(
|
|
848
|
-
|
|
860
|
+
let d = n(S), f = s(null), [p, m] = c(null), [h, g] = c(null);
|
|
861
|
+
re(() => {
|
|
849
862
|
if (r || !f.current) return;
|
|
850
863
|
let e = getComputedStyle(f.current).getPropertyValue("--piq-icon-set").trim().replace(/^["']|["']$/g, "");
|
|
851
864
|
g(P[e] ? e : null), d?.theme || m(f.current.closest?.("[data-theme]")?.getAttribute("data-theme") ?? null);
|
|
852
865
|
});
|
|
853
|
-
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, _);
|
|
854
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;
|
|
855
|
-
let
|
|
868
|
+
let x = a ? {
|
|
856
869
|
role: "img",
|
|
857
870
|
"aria-label": a
|
|
858
871
|
} : {
|
|
@@ -868,17 +881,17 @@ function G({ name: e, icon: t, set: r, size: i = "1em", label: a, className: o =
|
|
|
868
881
|
className: `piq-icon${o ? ` ${o}` : ""}`,
|
|
869
882
|
"data-icon": v?.name ?? e,
|
|
870
883
|
"data-icon-set": b,
|
|
871
|
-
...
|
|
872
|
-
...
|
|
884
|
+
...ne[b],
|
|
885
|
+
...x,
|
|
873
886
|
...l,
|
|
874
887
|
dangerouslySetInnerHTML: { __html: y.body }
|
|
875
888
|
});
|
|
876
889
|
}
|
|
877
890
|
//#endregion
|
|
878
891
|
//#region src/widgets/Loading.jsx
|
|
879
|
-
var
|
|
880
|
-
function
|
|
881
|
-
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;
|
|
882
895
|
return /* @__PURE__ */ d("div", {
|
|
883
896
|
className: `piq-progress${p ? "" : " piq-progress--indeterminate"}${s ? ` ${s}` : ""}`,
|
|
884
897
|
...c,
|
|
@@ -930,7 +943,7 @@ function q() {
|
|
|
930
943
|
})]
|
|
931
944
|
});
|
|
932
945
|
}
|
|
933
|
-
function
|
|
946
|
+
function oe({ size: e = "md", label: t = "Loading", showLabel: n = !1, className: r = "", ...i }) {
|
|
934
947
|
return /* @__PURE__ */ d("span", {
|
|
935
948
|
className: `piq-spinner piq-spinner--${e}${r ? ` ${r}` : ""}`,
|
|
936
949
|
role: "status",
|
|
@@ -941,7 +954,7 @@ function ae({ size: e = "md", label: t = "Loading", showLabel: n = !1, className
|
|
|
941
954
|
})]
|
|
942
955
|
});
|
|
943
956
|
}
|
|
944
|
-
function
|
|
957
|
+
function se({ variant: e = "text", lines: t = 1, width: n, height: r, className: i = "", style: a, ...o }) {
|
|
945
958
|
let s = `piq-skeleton piq-skeleton--${e}${i ? ` ${i}` : ""}`;
|
|
946
959
|
if (e === "text") {
|
|
947
960
|
let e = Math.max(1, Math.floor(t));
|
|
@@ -975,13 +988,13 @@ function oe({ variant: e = "text", lines: t = 1, width: n, height: r, className:
|
|
|
975
988
|
}
|
|
976
989
|
//#endregion
|
|
977
990
|
//#region src/widgets/Button.jsx
|
|
978
|
-
var
|
|
991
|
+
var ce = {
|
|
979
992
|
primary: "",
|
|
980
993
|
secondary: " piq-btn--secondary",
|
|
981
994
|
text: " piq-btn--text"
|
|
982
995
|
};
|
|
983
996
|
function J({ variant: e = "primary", size: t, badge: n, busy: r = !1, type: i = "button", className: a = "", onClick: o, children: s, ...c }) {
|
|
984
|
-
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", {
|
|
985
998
|
className: "piq-btn__badge",
|
|
986
999
|
children: n
|
|
987
1000
|
})] });
|
|
@@ -1009,7 +1022,7 @@ function J({ variant: e = "primary", size: t, badge: n, busy: r = !1, type: i =
|
|
|
1009
1022
|
}
|
|
1010
1023
|
//#endregion
|
|
1011
1024
|
//#region src/widgets/Choice.jsx
|
|
1012
|
-
function
|
|
1025
|
+
function le({ label: e, className: t = "", ...n }) {
|
|
1013
1026
|
return /* @__PURE__ */ d("label", {
|
|
1014
1027
|
className: `piq-check${t ? ` ${t}` : ""}`,
|
|
1015
1028
|
children: [/* @__PURE__ */ u("input", {
|
|
@@ -1019,7 +1032,7 @@ function ce({ label: e, className: t = "", ...n }) {
|
|
|
1019
1032
|
}), /* @__PURE__ */ u("span", { children: e })]
|
|
1020
1033
|
});
|
|
1021
1034
|
}
|
|
1022
|
-
function
|
|
1035
|
+
function ue({ label: e, className: t = "", ...n }) {
|
|
1023
1036
|
return /* @__PURE__ */ d("label", {
|
|
1024
1037
|
className: `piq-check piq-switch${t ? ` ${t}` : ""}`,
|
|
1025
1038
|
children: [/* @__PURE__ */ u("input", {
|
|
@@ -1030,7 +1043,7 @@ function le({ label: e, className: t = "", ...n }) {
|
|
|
1030
1043
|
}), /* @__PURE__ */ u("span", { children: e })]
|
|
1031
1044
|
});
|
|
1032
1045
|
}
|
|
1033
|
-
function
|
|
1046
|
+
function de({ label: e, options: t, name: n, value: r, defaultValue: a, onChange: o, disabled: s }) {
|
|
1034
1047
|
let c = i(), l = n ?? c;
|
|
1035
1048
|
return /* @__PURE__ */ d("fieldset", {
|
|
1036
1049
|
className: "piq-radios",
|
|
@@ -1099,7 +1112,7 @@ function X({ label: e, hint: t, error: n, id: r, className: i = "", ...a }) {
|
|
|
1099
1112
|
})
|
|
1100
1113
|
});
|
|
1101
1114
|
}
|
|
1102
|
-
function
|
|
1115
|
+
function fe({ label: e, hint: t, error: n, id: r, className: i = "", rows: a = 4, ...o }) {
|
|
1103
1116
|
return /* @__PURE__ */ u(Y, {
|
|
1104
1117
|
label: e,
|
|
1105
1118
|
hint: t,
|
|
@@ -1156,7 +1169,7 @@ function Q({ label: e, value: t, onChange: n, min: r, max: i, hint: a, error: o,
|
|
|
1156
1169
|
onChange: (e) => n?.(e.target.value)
|
|
1157
1170
|
});
|
|
1158
1171
|
}
|
|
1159
|
-
function
|
|
1172
|
+
function pe({ label: e, from: t, to: n, onChange: r, min: a, max: o, fromLabel: s = "From", toLabel: c = "To", className: l }) {
|
|
1160
1173
|
let f = i();
|
|
1161
1174
|
return /* @__PURE__ */ d("fieldset", {
|
|
1162
1175
|
className: `piq-date-range${l ? ` ${l}` : ""}`,
|
|
@@ -1202,7 +1215,7 @@ function $(e, t) {
|
|
|
1202
1215
|
}
|
|
1203
1216
|
//#endregion
|
|
1204
1217
|
//#region src/widgets/Dialog.jsx
|
|
1205
|
-
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 }) {
|
|
1206
1219
|
let m = $(e, s), h = i(), g = i();
|
|
1207
1220
|
return /* @__PURE__ */ d("dialog", {
|
|
1208
1221
|
ref: m,
|
|
@@ -1247,7 +1260,7 @@ function pe({ open: e = !1, onClose: t, title: n, description: r, actions: a, cl
|
|
|
1247
1260
|
}
|
|
1248
1261
|
//#endregion
|
|
1249
1262
|
//#region src/widgets/MenuButton.jsx
|
|
1250
|
-
function
|
|
1263
|
+
function he({ label: e, items: t = [], icon: n, variant: a = "secondary", size: o, align: l = "start", buttonLabel: f, className: p, ...m }) {
|
|
1251
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) => {
|
|
1252
1265
|
g(!0), v(e === "last" ? S.at(-1) : S[0]);
|
|
1253
1266
|
}, w = (e = !0) => {
|
|
@@ -1347,7 +1360,7 @@ function me({ label: e, items: t = [], icon: n, variant: a = "secondary", size:
|
|
|
1347
1360
|
}
|
|
1348
1361
|
//#endregion
|
|
1349
1362
|
//#region src/widgets/Pagination.jsx
|
|
1350
|
-
function
|
|
1363
|
+
function ge({ page: e = 1, pageSize: t = 20, total: n = 0, onPageChange: r, pageSizes: i = [
|
|
1351
1364
|
10,
|
|
1352
1365
|
20,
|
|
1353
1366
|
50,
|
|
@@ -1396,7 +1409,7 @@ function he({ page: e = 1, pageSize: t = 20, total: n = 0, onPageChange: r, page
|
|
|
1396
1409
|
}
|
|
1397
1410
|
//#endregion
|
|
1398
1411
|
//#region src/widgets/Sheet.jsx
|
|
1399
|
-
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 }) {
|
|
1400
1413
|
let p = $(e, s), m = i();
|
|
1401
1414
|
return /* @__PURE__ */ u("dialog", {
|
|
1402
1415
|
ref: p,
|
|
@@ -1432,7 +1445,7 @@ function ge({ open: e = !1, onClose: t, title: n, label: r, side: a = "start", c
|
|
|
1432
1445
|
}
|
|
1433
1446
|
//#endregion
|
|
1434
1447
|
//#region src/widgets/Tabs.jsx
|
|
1435
|
-
function
|
|
1448
|
+
function ve({ tabs: e = [], value: t, defaultValue: n, onChange: r, label: a, className: o, ...l }) {
|
|
1436
1449
|
let [f, p] = c(n ?? e[0]?.id), m = t ?? f, h = i(), g = s(null);
|
|
1437
1450
|
function _(e, n) {
|
|
1438
1451
|
t === void 0 && p(e), e !== m && r?.(e), n && [...g.current?.querySelectorAll("[role=\"tab\"]") ?? []].find((t) => t.dataset.tab === String(e))?.focus();
|
|
@@ -1483,6 +1496,6 @@ function _e({ tabs: e = [], value: t, defaultValue: n, onChange: r, label: a, cl
|
|
|
1483
1496
|
});
|
|
1484
1497
|
}
|
|
1485
1498
|
//#endregion
|
|
1486
|
-
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 };
|
|
1487
1500
|
|
|
1488
|
-
//# sourceMappingURL=shared-
|
|
1501
|
+
//# sourceMappingURL=shared-CAXoQbx9.js.map
|