@webority/ui-react 0.8.0 → 0.8.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.
|
@@ -5,35 +5,50 @@
|
|
|
5
5
|
* @param {object} props
|
|
6
6
|
* @param {string} props.label What the number measures.
|
|
7
7
|
* @param {import('react').ReactNode} props.value The number itself, already formatted.
|
|
8
|
+
* @param {import('react').ReactNode} [props.caption] A sub-line under the value (e.g. "Total sent").
|
|
8
9
|
* @param {string|import('react').ReactNode} [props.icon] Icon name for the leading tile, or a custom node.
|
|
9
10
|
* @param {'primary'|'success'|'warning'|'danger'|'info'|'neutral'} [props.iconTone] Tints the icon chip.
|
|
10
11
|
* @param {import('react').ReactNode} [props.delta] Change text, e.g. "12% vs last month".
|
|
11
12
|
* @param {'up'|'down'|'flat'} [props.deltaDirection] Colours the delta and picks its arrow. Omitted →
|
|
12
13
|
* inferred from a leading "+"/"-" on `delta` (falls back to 'flat').
|
|
13
14
|
* @param {number[]} [props.sparkline] A trend series rendered as a small inline chart.
|
|
14
|
-
* @param {'plain'|'filled'|'accent'} [props.variant='plain'] The tile surface:
|
|
15
|
-
* bordered card), filled (a subtle surface fill), accent (a brand-tinted fill)
|
|
15
|
+
* @param {'plain'|'filled'|'accent'|'spotlight'} [props.variant='plain'] The tile surface/layout:
|
|
16
|
+
* plain (today's bordered card), filled (a subtle surface fill), accent (a brand-tinted fill),
|
|
17
|
+
* spotlight (editorial feature tile — icon pinned top-right, serif value, caption below).
|
|
16
18
|
* @param {'md'|'lg'} [props.size='md'] Tile scale: md (default), lg (a hero tile with an
|
|
17
19
|
* enlarged value — for the single headline stat above a dashboard).
|
|
18
20
|
* @param {boolean} [props.inline=false] Put the icon beside the text instead of above it.
|
|
19
21
|
* @param {boolean} [props.attention=false] Marks the tile as needing action (warning-tinted).
|
|
20
22
|
* @param {string} [props.href] Renders the whole tile as a link to this URL.
|
|
21
23
|
* @param {import('react').ElementType} [props.linkComponent] Router link; receives `to` instead of `href`.
|
|
22
|
-
* @param {string} [props.className]
|
|
24
|
+
* @param {string} [props.className] Extra class(es) on the tile root.
|
|
25
|
+
* @param {string} [props.iconClassName] Extra class(es) on the icon chip.
|
|
26
|
+
* @param {string} [props.labelClassName] Extra class(es) on the label.
|
|
27
|
+
* @param {string} [props.valueClassName] Extra class(es) on the value.
|
|
28
|
+
* @param {string} [props.captionClassName] Extra class(es) on the caption.
|
|
29
|
+
* @param {string} [props.deltaClassName] Extra class(es) on the delta.
|
|
30
|
+
* @param {string} [props.sparklineClassName] Extra class(es) on the sparkline.
|
|
23
31
|
*/
|
|
24
|
-
export default function AppKpiTile({ label, value, icon, iconTone, delta, deltaDirection, sparkline, variant, size, inline, attention, href, linkComponent: Link, className, ...rest }: {
|
|
32
|
+
export default function AppKpiTile({ label, value, caption, icon, iconTone, delta, deltaDirection, sparkline, variant, size, inline, attention, href, linkComponent: Link, className, iconClassName, labelClassName, valueClassName, captionClassName, deltaClassName, sparklineClassName, ...rest }: {
|
|
25
33
|
label: string;
|
|
26
34
|
value: import('react').ReactNode;
|
|
35
|
+
caption?: import('react').ReactNode;
|
|
27
36
|
icon?: string | import('react').ReactNode;
|
|
28
37
|
iconTone?: 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'neutral';
|
|
29
38
|
delta?: import('react').ReactNode;
|
|
30
39
|
deltaDirection?: 'up' | 'down' | 'flat';
|
|
31
40
|
sparkline?: number[];
|
|
32
|
-
variant?: 'plain' | 'filled' | 'accent';
|
|
41
|
+
variant?: 'plain' | 'filled' | 'accent' | 'spotlight';
|
|
33
42
|
size?: 'md' | 'lg';
|
|
34
43
|
inline?: boolean;
|
|
35
44
|
attention?: boolean;
|
|
36
45
|
href?: string;
|
|
37
46
|
linkComponent?: import('react').ElementType;
|
|
38
47
|
className?: string;
|
|
48
|
+
iconClassName?: string;
|
|
49
|
+
labelClassName?: string;
|
|
50
|
+
valueClassName?: string;
|
|
51
|
+
captionClassName?: string;
|
|
52
|
+
deltaClassName?: string;
|
|
53
|
+
sparklineClassName?: string;
|
|
39
54
|
}): import("react").JSX.Element;
|
|
@@ -1,26 +1,50 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* A chronological activity feed
|
|
3
|
-
* Each entry is a toned dot on a vertical rail, with a title, a timestamp, an
|
|
4
|
-
* actor, and an optional free-text note.
|
|
2
|
+
* A chronological activity feed OR a status-progress tracker.
|
|
5
3
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* - `variant="feed"` (default) — an audit trail / sign-off history / status log.
|
|
5
|
+
* Each entry is a toned dot on a continuous vertical rail, with a title, a
|
|
6
|
+
* timestamp, an actor and an optional boxed note.
|
|
7
|
+
* - `variant="progress"` — a status tracker for a fixed sequence of stages
|
|
8
|
+
* (e.g. Initiated → Submitted → Approved → Sanctioned → Disbursed). Each step
|
|
9
|
+
* shows a solid status dot (done/current/on-hold/rejected/cancelled/skipped)
|
|
10
|
+
* or a hollow ring (upcoming); the rail is drawn per segment so the path
|
|
11
|
+
* between two completed steps reads as filled. The timestamp is pinned to the
|
|
12
|
+
* top-right of the step.
|
|
13
|
+
*
|
|
14
|
+
* The rail is drawn so it cannot break into disconnected segments when an entry
|
|
15
|
+
* wraps to two lines — the failure that makes most hand-rolled timelines look
|
|
16
|
+
* broken with real data.
|
|
8
17
|
*
|
|
9
18
|
* @param {object} props
|
|
10
|
-
* @param {{ key?: string, icon?: string,
|
|
11
|
-
*
|
|
12
|
-
*
|
|
19
|
+
* @param {{ key?: string, icon?: string,
|
|
20
|
+
* tone?: 'neutral'|'success'|'warning'|'danger'|'info',
|
|
21
|
+
* status?: 'upcoming'|'current'|'done'|'on-hold'|'rejected'|'cancelled'|'skipped',
|
|
22
|
+
* title: import('react').ReactNode, description?: import('react').ReactNode,
|
|
23
|
+
* at?: string, by?: string, note?: string }[]} props.items
|
|
24
|
+
* Feed variant: newest first. Progress variant: first stage first.
|
|
25
|
+
* `status` drives the dot + rail in the progress variant; `description` is a
|
|
26
|
+
* plain inline subtext under the title (distinct from the boxed `note`).
|
|
27
|
+
* @param {'feed'|'progress'} [props.variant] Layout mode. Defaults to `feed`.
|
|
28
|
+
* @param {number} [props.size] Dot diameter in px (default 24). The rail, halo
|
|
29
|
+
* and glyph scale from it, so the whole timeline grows/shrinks in proportion.
|
|
13
30
|
* @param {string} [props.className]
|
|
31
|
+
* @param {import('react').CSSProperties} [props.style] Inline style on the list;
|
|
32
|
+
* the `size` var is merged into it.
|
|
14
33
|
*/
|
|
15
|
-
export default function AppTimeline({ items, className, ...rest }: {
|
|
34
|
+
export default function AppTimeline({ items, variant, size, className, style, ...rest }: {
|
|
16
35
|
items: {
|
|
17
36
|
key?: string;
|
|
18
37
|
icon?: string;
|
|
19
38
|
tone?: 'neutral' | 'success' | 'warning' | 'danger' | 'info';
|
|
39
|
+
status?: 'upcoming' | 'current' | 'done' | 'on-hold' | 'rejected' | 'cancelled' | 'skipped';
|
|
20
40
|
title: import('react').ReactNode;
|
|
41
|
+
description?: import('react').ReactNode;
|
|
21
42
|
at?: string;
|
|
22
43
|
by?: string;
|
|
23
44
|
note?: string;
|
|
24
45
|
}[];
|
|
46
|
+
variant?: 'feed' | 'progress';
|
|
47
|
+
size?: number;
|
|
25
48
|
className?: string;
|
|
49
|
+
style?: import('react').CSSProperties;
|
|
26
50
|
}): import("react").JSX.Element;
|
|
@@ -31,10 +31,12 @@
|
|
|
31
31
|
* @param {string} [props.createLabel="Create workspace"] Copy for the create row.
|
|
32
32
|
* @param {boolean} [props.compact=false] Renders the 36px monogram button instead of the full
|
|
33
33
|
* card — the shape a collapsed rail slot wants. Same menu either way.
|
|
34
|
+
* @param {"sm"|"md"|"lg"} [props.size="md"] Trigger size tier — scales the card (and the compact
|
|
35
|
+
* square), its mark and name. The dropdown menu is unchanged across sizes.
|
|
34
36
|
* @param {string} [props.ariaLabel] Accessible name for the trigger. Defaults to
|
|
35
37
|
* "Workspace <name>".
|
|
36
38
|
*/
|
|
37
|
-
export default function AppWorkspaceSwitcher({ tenants, currentId, onSelect, menuLabel, footerAction, linkComponent, searchable, onCreate, canCreate, createLabel, compact, ariaLabel, ...rest }: {
|
|
39
|
+
export default function AppWorkspaceSwitcher({ tenants, currentId, onSelect, menuLabel, footerAction, linkComponent, searchable, onCreate, canCreate, createLabel, compact, size, ariaLabel, ...rest }: {
|
|
38
40
|
tenants?: {
|
|
39
41
|
id: string;
|
|
40
42
|
name: string;
|
|
@@ -55,5 +57,6 @@ export default function AppWorkspaceSwitcher({ tenants, currentId, onSelect, men
|
|
|
55
57
|
canCreate?: boolean;
|
|
56
58
|
createLabel?: string;
|
|
57
59
|
compact?: boolean;
|
|
60
|
+
size?: "sm" | "md" | "lg";
|
|
58
61
|
ariaLabel?: string;
|
|
59
62
|
}): import("react").JSX.Element;
|
package/dist/ui-react.js
CHANGED
|
@@ -6477,47 +6477,51 @@ function Yn(e) {
|
|
|
6477
6477
|
let t = e.trim();
|
|
6478
6478
|
return t.startsWith("+") ? "up" : t.startsWith("-") || t.startsWith("−") ? "down" : "flat";
|
|
6479
6479
|
}
|
|
6480
|
-
function Xn({ label: e, value: t,
|
|
6481
|
-
j("AppKpiTile",
|
|
6482
|
-
let
|
|
6483
|
-
return
|
|
6484
|
-
as:
|
|
6485
|
-
to:
|
|
6480
|
+
function Xn({ label: e, value: t, caption: n, icon: r, iconTone: i, delta: a, deltaDirection: o, sparkline: s, variant: c = "plain", size: l = "md", inline: u = !1, attention: d = !1, href: f, linkComponent: h, className: g = "", iconClassName: _ = "", labelClassName: v = "", valueClassName: y = "", captionClassName: b = "", deltaClassName: x = "", sparklineClassName: S = "", ...C }) {
|
|
6481
|
+
j("AppKpiTile", C);
|
|
6482
|
+
let w = `kpi${u ? " kpi-inline" : ""}${c === "filled" ? " kpi-filled" : c === "accent" ? " kpi-accent" : c === "spotlight" ? " kpi-spotlight" : ""}${l === "lg" ? " kpi-lg" : ""}${d ? " kpi-attention" : ""}${g ? ` ${g}` : ""}`, T = o ?? Yn(a), E = T === "up" ? "arrow-up" : T === "down" ? "arrow-down" : null, D = {};
|
|
6483
|
+
return f != null && (D = h ? {
|
|
6484
|
+
as: h,
|
|
6485
|
+
to: f
|
|
6486
6486
|
} : {
|
|
6487
6487
|
as: "a",
|
|
6488
|
-
href:
|
|
6489
|
-
}), /* @__PURE__ */ m(
|
|
6490
|
-
className:
|
|
6491
|
-
...
|
|
6492
|
-
...
|
|
6488
|
+
href: f
|
|
6489
|
+
}), /* @__PURE__ */ m(D.as || "div", {
|
|
6490
|
+
className: w,
|
|
6491
|
+
...C,
|
|
6492
|
+
...D,
|
|
6493
6493
|
children: [
|
|
6494
|
-
|
|
6495
|
-
className: `kpi-icon${
|
|
6496
|
-
children: L(
|
|
6494
|
+
r && /* @__PURE__ */ p("span", {
|
|
6495
|
+
className: `kpi-icon${i ? ` kpi-icon-${i}` : ""}${_ ? ` ${_}` : ""}`,
|
|
6496
|
+
children: L(r, { size: 20 })
|
|
6497
6497
|
}),
|
|
6498
6498
|
/* @__PURE__ */ p("div", {
|
|
6499
|
-
className:
|
|
6499
|
+
className: `kpi-label${v ? ` ${v}` : ""}`,
|
|
6500
6500
|
children: e
|
|
6501
6501
|
}),
|
|
6502
6502
|
/* @__PURE__ */ p("div", {
|
|
6503
|
-
className:
|
|
6503
|
+
className: `kpi-value${y ? ` ${y}` : ""}`,
|
|
6504
6504
|
children: t
|
|
6505
6505
|
}),
|
|
6506
|
-
|
|
6507
|
-
className: `kpi-
|
|
6508
|
-
children:
|
|
6509
|
-
|
|
6506
|
+
n && /* @__PURE__ */ p("div", {
|
|
6507
|
+
className: `kpi-caption${b ? ` ${b}` : ""}`,
|
|
6508
|
+
children: n
|
|
6509
|
+
}),
|
|
6510
|
+
a && /* @__PURE__ */ m("div", {
|
|
6511
|
+
className: `kpi-delta${T === "flat" ? "" : ` ${T}`}${x ? ` ${x}` : ""}`,
|
|
6512
|
+
children: [E && /* @__PURE__ */ p(I, {
|
|
6513
|
+
name: E,
|
|
6510
6514
|
size: 13
|
|
6511
|
-
}),
|
|
6515
|
+
}), a]
|
|
6512
6516
|
}),
|
|
6513
|
-
|
|
6514
|
-
className:
|
|
6517
|
+
s && s.length > 0 && /* @__PURE__ */ p("svg", {
|
|
6518
|
+
className: `kpi-sparkline${S ? ` ${S}` : ""}`,
|
|
6515
6519
|
width: Kn,
|
|
6516
6520
|
height: qn,
|
|
6517
6521
|
viewBox: `0 0 ${Kn} ${qn}`,
|
|
6518
6522
|
"aria-hidden": "true",
|
|
6519
6523
|
children: /* @__PURE__ */ p("polyline", {
|
|
6520
|
-
points: Jn(
|
|
6524
|
+
points: Jn(s),
|
|
6521
6525
|
stroke: "currentColor",
|
|
6522
6526
|
fill: "none"
|
|
6523
6527
|
})
|
|
@@ -8052,34 +8056,34 @@ function Fr({ tabs: e, value: t, onChange: n, variant: r = "underline", orientat
|
|
|
8052
8056
|
let n = y.current;
|
|
8053
8057
|
if (!n) return;
|
|
8054
8058
|
let r = n.querySelector(".app-tab.active");
|
|
8055
|
-
|
|
8056
|
-
if (x) n.style.setProperty("--wui-tab-y", `${r.offsetTop}px`), n.style.setProperty("--wui-tab-h", `${r.offsetHeight}px`);
|
|
8057
|
-
else {
|
|
8058
|
-
n.style.setProperty("--wui-tab-x", `${r.offsetLeft}px`), n.style.setProperty("--wui-tab-w", `${r.offsetWidth}px`);
|
|
8059
|
-
let e = r.offsetLeft, t = e + r.offsetWidth;
|
|
8060
|
-
e - 28 < n.scrollLeft ? n.scrollLeft = Math.max(0, e - 28) : t + 28 > n.scrollLeft + n.clientWidth && (n.scrollLeft = t + 28 - n.clientWidth);
|
|
8061
|
-
}
|
|
8062
|
-
n.toggleAttribute("data-active-danger", !!e.find((e) => e.key === t)?.danger);
|
|
8063
|
-
} else n.style.setProperty(x ? "--wui-tab-h" : "--wui-tab-w", "0px");
|
|
8064
|
-
n.setAttribute("data-wui-tabs", ""), k();
|
|
8059
|
+
r ? (x ? (n.style.setProperty("--wui-tab-y", `${r.offsetTop}px`), n.style.setProperty("--wui-tab-h", `${r.offsetHeight}px`)) : (n.style.setProperty("--wui-tab-x", `${r.offsetLeft}px`), n.style.setProperty("--wui-tab-w", `${r.offsetWidth}px`)), n.toggleAttribute("data-active-danger", !!e.find((e) => e.key === t)?.danger)) : n.style.setProperty(x ? "--wui-tab-h" : "--wui-tab-w", "0px"), n.setAttribute("data-wui-tabs", ""), k();
|
|
8065
8060
|
}, [
|
|
8066
8061
|
x,
|
|
8067
8062
|
e,
|
|
8068
8063
|
t,
|
|
8069
8064
|
k
|
|
8070
|
-
])
|
|
8065
|
+
]), M = a(() => {
|
|
8066
|
+
let e = y.current;
|
|
8067
|
+
if (!e || x) return;
|
|
8068
|
+
let t = e.querySelector(".app-tab.active");
|
|
8069
|
+
if (!t) return;
|
|
8070
|
+
let n = t.offsetLeft, r = n + t.offsetWidth;
|
|
8071
|
+
n - 28 < e.scrollLeft ? e.scrollLeft = Math.max(0, n - 28) : r + 28 > e.scrollLeft + e.clientWidth && (e.scrollLeft = r + 28 - e.clientWidth);
|
|
8072
|
+
}, [x]);
|
|
8071
8073
|
c(() => {
|
|
8072
8074
|
A();
|
|
8073
|
-
}, [A])
|
|
8074
|
-
|
|
8075
|
+
}, [A]), c(() => {
|
|
8076
|
+
M();
|
|
8077
|
+
}, [t, M]);
|
|
8078
|
+
let N = u(A);
|
|
8075
8079
|
o(() => {
|
|
8076
|
-
|
|
8080
|
+
N.current = A;
|
|
8077
8081
|
}, [A]), o(() => {
|
|
8078
8082
|
if (typeof ResizeObserver > "u") return;
|
|
8079
|
-
let e = new ResizeObserver(() =>
|
|
8083
|
+
let e = new ResizeObserver(() => N.current());
|
|
8080
8084
|
return y.current && e.observe(y.current), b.current && e.observe(b.current), () => e.disconnect();
|
|
8081
8085
|
}, [x]);
|
|
8082
|
-
function
|
|
8086
|
+
function P(t) {
|
|
8083
8087
|
let r = t.target?.dataset?.key;
|
|
8084
8088
|
if (r == null) return;
|
|
8085
8089
|
let i = e.findIndex((e) => e.key === r);
|
|
@@ -8093,10 +8097,10 @@ function Fr({ tabs: e, value: t, onChange: n, variant: r = "underline", orientat
|
|
|
8093
8097
|
}, s = x ? "ArrowDown" : "ArrowRight", c = x ? "ArrowUp" : "ArrowLeft", l = null;
|
|
8094
8098
|
t.key === s ? l = o(i, 1) : t.key === c ? l = o(i, -1) : t.key === "Home" ? l = e.find((e) => !e.disabled) ?? null : t.key === "End" && (l = [...e].reverse().find((e) => !e.disabled) ?? null), l && (t.preventDefault(), C(l.key), O(l.key), f === "automatic" && n(l.key));
|
|
8095
8099
|
}
|
|
8096
|
-
let
|
|
8100
|
+
let F = (e) => {
|
|
8097
8101
|
let t = y.current;
|
|
8098
8102
|
t && t.scrollBy({ left: e * t.clientWidth * .7 });
|
|
8099
|
-
},
|
|
8103
|
+
}, L = [
|
|
8100
8104
|
"app-tabs",
|
|
8101
8105
|
r === "pills" ? "app-tabs-pills" : "",
|
|
8102
8106
|
x ? "app-tabs-vertical" : "",
|
|
@@ -8104,15 +8108,15 @@ function Fr({ tabs: e, value: t, onChange: n, variant: r = "underline", orientat
|
|
|
8104
8108
|
s === "lg" ? "app-tabs-lg" : "",
|
|
8105
8109
|
l ? "app-tabs-fitted" : "",
|
|
8106
8110
|
g
|
|
8107
|
-
].filter(Boolean).join(" "),
|
|
8111
|
+
].filter(Boolean).join(" "), R = /* @__PURE__ */ m("div", {
|
|
8108
8112
|
ref: y,
|
|
8109
8113
|
role: "tablist",
|
|
8110
8114
|
"aria-orientation": x ? "vertical" : void 0,
|
|
8111
8115
|
"aria-label": h,
|
|
8112
|
-
className:
|
|
8116
|
+
className: L,
|
|
8113
8117
|
style: _,
|
|
8114
8118
|
...x ? v : void 0,
|
|
8115
|
-
onKeyDown:
|
|
8119
|
+
onKeyDown: P,
|
|
8116
8120
|
onScroll: k,
|
|
8117
8121
|
children: [e.map((e) => {
|
|
8118
8122
|
let r = e.key === t;
|
|
@@ -8141,7 +8145,7 @@ function Fr({ tabs: e, value: t, onChange: n, variant: r = "underline", orientat
|
|
|
8141
8145
|
"aria-hidden": "true"
|
|
8142
8146
|
})]
|
|
8143
8147
|
});
|
|
8144
|
-
return x ?
|
|
8148
|
+
return x ? R : /* @__PURE__ */ m("div", {
|
|
8145
8149
|
ref: b,
|
|
8146
8150
|
className: "app-tabs-wrap",
|
|
8147
8151
|
...v,
|
|
@@ -8151,19 +8155,19 @@ function Fr({ tabs: e, value: t, onChange: n, variant: r = "underline", orientat
|
|
|
8151
8155
|
className: "app-tabs-scroll-btn prev",
|
|
8152
8156
|
"aria-label": "Scroll tabs backward",
|
|
8153
8157
|
tabIndex: -1,
|
|
8154
|
-
onClick: () =>
|
|
8158
|
+
onClick: () => F(-1),
|
|
8155
8159
|
children: /* @__PURE__ */ p(I, {
|
|
8156
8160
|
name: "chevron-left",
|
|
8157
8161
|
size: 16
|
|
8158
8162
|
})
|
|
8159
8163
|
}),
|
|
8160
|
-
|
|
8164
|
+
R,
|
|
8161
8165
|
/* @__PURE__ */ p("button", {
|
|
8162
8166
|
type: "button",
|
|
8163
8167
|
className: "app-tabs-scroll-btn next",
|
|
8164
8168
|
"aria-label": "Scroll tabs forward",
|
|
8165
8169
|
tabIndex: -1,
|
|
8166
|
-
onClick: () =>
|
|
8170
|
+
onClick: () => F(1),
|
|
8167
8171
|
children: /* @__PURE__ */ p(I, {
|
|
8168
8172
|
name: "chevron-right",
|
|
8169
8173
|
size: 16
|
|
@@ -8287,50 +8291,85 @@ var Ir = i(function({ values: e, onChange: t, placeholder: n = "Add…", name: r
|
|
|
8287
8291
|
}) : null
|
|
8288
8292
|
]
|
|
8289
8293
|
});
|
|
8290
|
-
})
|
|
8291
|
-
|
|
8292
|
-
|
|
8293
|
-
|
|
8294
|
-
|
|
8295
|
-
|
|
8296
|
-
|
|
8297
|
-
|
|
8298
|
-
|
|
8299
|
-
|
|
8300
|
-
|
|
8301
|
-
|
|
8302
|
-
|
|
8303
|
-
|
|
8304
|
-
|
|
8305
|
-
|
|
8306
|
-
|
|
8307
|
-
|
|
8308
|
-
|
|
8309
|
-
|
|
8310
|
-
|
|
8311
|
-
|
|
8312
|
-
|
|
8313
|
-
|
|
8314
|
-
|
|
8315
|
-
|
|
8316
|
-
|
|
8317
|
-
|
|
8318
|
-
|
|
8319
|
-
|
|
8320
|
-
|
|
8321
|
-
|
|
8322
|
-
|
|
8323
|
-
|
|
8324
|
-
|
|
8325
|
-
|
|
8326
|
-
|
|
8327
|
-
|
|
8328
|
-
|
|
8294
|
+
}), Rr = {
|
|
8295
|
+
done: "check",
|
|
8296
|
+
current: "clock",
|
|
8297
|
+
"on-hold": "lock",
|
|
8298
|
+
rejected: "x",
|
|
8299
|
+
cancelled: "minus",
|
|
8300
|
+
skipped: "arrow-right",
|
|
8301
|
+
upcoming: null
|
|
8302
|
+
};
|
|
8303
|
+
function zr({ items: e = [], variant: t = "feed", size: n, className: r = "", style: i, ...a }) {
|
|
8304
|
+
j("AppTimeline", a);
|
|
8305
|
+
let o = t === "progress", s = `timeline${o ? " timeline--progress" : ""}${r ? ` ${r}` : ""}`, c = typeof n == "number" && n > 0 ? n : void 0, l = c ? Math.round(c * .54) : o ? 13 : 12;
|
|
8306
|
+
return /* @__PURE__ */ p("ol", {
|
|
8307
|
+
className: s,
|
|
8308
|
+
style: c ? {
|
|
8309
|
+
...i,
|
|
8310
|
+
"--wui-timeline-dot": `${c}px`
|
|
8311
|
+
} : i,
|
|
8312
|
+
...a,
|
|
8313
|
+
children: e.map((e, t) => {
|
|
8314
|
+
let n = o ? e.status : void 0, r = n ? ` is-${n}` : "", i = e.tone && e.tone !== "neutral" ? ` ${e.tone}` : "", a = o ? e.icon ?? (n ? Rr[n] : void 0) : e.icon || "circle";
|
|
8315
|
+
return /* @__PURE__ */ m("li", {
|
|
8316
|
+
className: `timeline-item${r}${i}`,
|
|
8317
|
+
children: [/* @__PURE__ */ p("span", {
|
|
8318
|
+
className: "timeline-dot",
|
|
8319
|
+
children: a ? /* @__PURE__ */ p(I, {
|
|
8320
|
+
name: a,
|
|
8321
|
+
size: l
|
|
8322
|
+
}) : null
|
|
8323
|
+
}), /* @__PURE__ */ m("div", {
|
|
8324
|
+
className: "timeline-body",
|
|
8325
|
+
children: [
|
|
8326
|
+
o ? /* @__PURE__ */ m("div", {
|
|
8327
|
+
className: "timeline-head",
|
|
8328
|
+
children: [/* @__PURE__ */ p("div", {
|
|
8329
|
+
className: "timeline-title",
|
|
8330
|
+
children: e.title
|
|
8331
|
+
}), e.at && /* @__PURE__ */ p("span", {
|
|
8332
|
+
className: "timeline-at",
|
|
8333
|
+
children: e.at
|
|
8334
|
+
})]
|
|
8335
|
+
}) : /* @__PURE__ */ p("div", {
|
|
8336
|
+
className: "timeline-title",
|
|
8337
|
+
children: e.title
|
|
8338
|
+
}),
|
|
8339
|
+
e.description && /* @__PURE__ */ p("div", {
|
|
8340
|
+
className: "timeline-desc",
|
|
8341
|
+
children: e.description
|
|
8342
|
+
}),
|
|
8343
|
+
!o && (e.at || e.by) && /* @__PURE__ */ m("div", {
|
|
8344
|
+
className: "timeline-meta",
|
|
8345
|
+
children: [e.at && /* @__PURE__ */ p("span", {
|
|
8346
|
+
className: "timeline-at",
|
|
8347
|
+
children: e.at
|
|
8348
|
+
}), e.by && /* @__PURE__ */ p("span", {
|
|
8349
|
+
className: "timeline-by",
|
|
8350
|
+
children: e.by
|
|
8351
|
+
})]
|
|
8352
|
+
}),
|
|
8353
|
+
o && e.by && /* @__PURE__ */ p("div", {
|
|
8354
|
+
className: "timeline-meta",
|
|
8355
|
+
children: /* @__PURE__ */ p("span", {
|
|
8356
|
+
className: "timeline-by",
|
|
8357
|
+
children: e.by
|
|
8358
|
+
})
|
|
8359
|
+
}),
|
|
8360
|
+
e.note && /* @__PURE__ */ p("p", {
|
|
8361
|
+
className: "timeline-note",
|
|
8362
|
+
children: e.note
|
|
8363
|
+
})
|
|
8364
|
+
]
|
|
8365
|
+
})]
|
|
8366
|
+
}, e.key ?? `${e.at}-${t}`);
|
|
8367
|
+
})
|
|
8329
8368
|
});
|
|
8330
8369
|
}
|
|
8331
8370
|
//#endregion
|
|
8332
8371
|
//#region src/components/AppTimePicker.jsx
|
|
8333
|
-
var
|
|
8372
|
+
var Br = i(function({ value: e, onChange: t, label: n, required: r = !1, hint: i, error: a, name: o, min: c, max: l, step: u, format: d = "24", placeholder: f = "Select time", disabled: h, size: g, id: _, ariaLabel: v, className: y = "", ...b }, x) {
|
|
8334
8373
|
j("AppTimePicker", b);
|
|
8335
8374
|
let S = s(), C = _ || o || S, { setRef: w } = Q({
|
|
8336
8375
|
ref: x,
|
|
@@ -8375,32 +8414,32 @@ var zr = i(function({ value: e, onChange: t, label: n, required: r = !1, hint: i
|
|
|
8375
8414
|
})
|
|
8376
8415
|
]
|
|
8377
8416
|
});
|
|
8378
|
-
}),
|
|
8379
|
-
function
|
|
8380
|
-
for (let e of
|
|
8381
|
-
}
|
|
8382
|
-
function Gr(e) {
|
|
8383
|
-
let t = Hr.get(e);
|
|
8384
|
-
t !== void 0 && (clearTimeout(t), Hr.delete(e));
|
|
8417
|
+
}), Vr = 6, $ = [], Hr = /* @__PURE__ */ new Set(), Ur = /* @__PURE__ */ new Map(), Wr = 0;
|
|
8418
|
+
function Gr() {
|
|
8419
|
+
for (let e of Hr) e($);
|
|
8385
8420
|
}
|
|
8386
8421
|
function Kr(e) {
|
|
8387
|
-
|
|
8422
|
+
let t = Ur.get(e);
|
|
8423
|
+
t !== void 0 && (clearTimeout(t), Ur.delete(e));
|
|
8424
|
+
}
|
|
8425
|
+
function qr(e) {
|
|
8426
|
+
if (e.length <= Vr) return e;
|
|
8388
8427
|
let t = [...e];
|
|
8389
|
-
for (; t.length >
|
|
8428
|
+
for (; t.length > Vr;) {
|
|
8390
8429
|
let e = t.findIndex((e) => e.duration !== 0);
|
|
8391
8430
|
t.splice(e === -1 ? 0 : e, 1);
|
|
8392
8431
|
}
|
|
8393
8432
|
return t;
|
|
8394
8433
|
}
|
|
8395
|
-
function
|
|
8396
|
-
return
|
|
8434
|
+
function Jr(e) {
|
|
8435
|
+
return Hr.add(e), e($), () => Hr.delete(e);
|
|
8397
8436
|
}
|
|
8398
|
-
function
|
|
8437
|
+
function Yr(e, t, n = {}) {
|
|
8399
8438
|
let r = n.id, i = r || typeof e != "string" ? void 0 : `${t}:${e}`;
|
|
8400
8439
|
if (r) {
|
|
8401
8440
|
let i = $.find((e) => e.externalId === r);
|
|
8402
8441
|
if (i) {
|
|
8403
|
-
|
|
8442
|
+
Kr(i.id);
|
|
8404
8443
|
let r = n.duration === void 0 ? 5e3 : n.duration;
|
|
8405
8444
|
$ = $.map((a) => a.id === i.id ? {
|
|
8406
8445
|
...a,
|
|
@@ -8413,12 +8452,12 @@ function Jr(e, t, n = {}) {
|
|
|
8413
8452
|
shape: n.shape,
|
|
8414
8453
|
surface: n.surface,
|
|
8415
8454
|
progress: n.progress
|
|
8416
|
-
} : a),
|
|
8455
|
+
} : a), Gr(), r > 0 && Ur.set(i.id, setTimeout(() => Xr(i.id), r));
|
|
8417
8456
|
return;
|
|
8418
8457
|
}
|
|
8419
8458
|
} else if (i && $.some((e) => e.key === i)) return;
|
|
8420
|
-
let a = ++
|
|
8421
|
-
$ =
|
|
8459
|
+
let a = ++Wr, o = n.duration === void 0 ? 5e3 : n.duration;
|
|
8460
|
+
$ = qr([...$, {
|
|
8422
8461
|
id: a,
|
|
8423
8462
|
externalId: r,
|
|
8424
8463
|
message: e,
|
|
@@ -8431,19 +8470,19 @@ function Jr(e, t, n = {}) {
|
|
|
8431
8470
|
surface: n.surface,
|
|
8432
8471
|
progress: n.progress,
|
|
8433
8472
|
key: i
|
|
8434
|
-
}]),
|
|
8473
|
+
}]), Gr(), o > 0 && Ur.set(a, setTimeout(() => Xr(a), o));
|
|
8435
8474
|
}
|
|
8436
|
-
function
|
|
8437
|
-
|
|
8475
|
+
function Xr(e) {
|
|
8476
|
+
Kr(e);
|
|
8438
8477
|
let t = $.filter((t) => t.id !== e);
|
|
8439
|
-
t.length !== $.length && ($ = t,
|
|
8478
|
+
t.length !== $.length && ($ = t, Gr());
|
|
8440
8479
|
}
|
|
8441
|
-
function
|
|
8442
|
-
$.length !== 0 && ($ = [],
|
|
8480
|
+
function Zr() {
|
|
8481
|
+
$.length !== 0 && ($ = [], Gr());
|
|
8443
8482
|
}
|
|
8444
8483
|
//#endregion
|
|
8445
8484
|
//#region src/components/AppToast.jsx
|
|
8446
|
-
var
|
|
8485
|
+
var Qr = {
|
|
8447
8486
|
success: {
|
|
8448
8487
|
icon: "check-circle-fill",
|
|
8449
8488
|
assertive: !1
|
|
@@ -8460,7 +8499,7 @@ var Zr = {
|
|
|
8460
8499
|
icon: "x-circle-fill",
|
|
8461
8500
|
assertive: !0
|
|
8462
8501
|
}
|
|
8463
|
-
},
|
|
8502
|
+
}, $r = {
|
|
8464
8503
|
"top-start": "top-0 start-0",
|
|
8465
8504
|
"top-center": "top-0 start-50 translate-middle-x",
|
|
8466
8505
|
"top-end": "top-0 end-0",
|
|
@@ -8468,22 +8507,22 @@ var Zr = {
|
|
|
8468
8507
|
"bottom-start": "bottom-0 start-0",
|
|
8469
8508
|
"bottom-center": "bottom-0 start-50 translate-middle-x",
|
|
8470
8509
|
"bottom-end": "bottom-0 end-0"
|
|
8471
|
-
},
|
|
8510
|
+
}, ei = 64, ti = /* @__PURE__ */ new Set([
|
|
8472
8511
|
"rise",
|
|
8473
8512
|
"organic",
|
|
8474
8513
|
"jelly",
|
|
8475
8514
|
"spring"
|
|
8476
|
-
]),
|
|
8515
|
+
]), ni = /* @__PURE__ */ new Set([
|
|
8477
8516
|
"rounded",
|
|
8478
8517
|
"pill",
|
|
8479
8518
|
"sharp"
|
|
8480
|
-
]),
|
|
8481
|
-
function
|
|
8519
|
+
]), ri = /* @__PURE__ */ new Set(["auto", "inverse"]);
|
|
8520
|
+
function ii({ position: e = "bottom-end", maxVisible: t = 4, animation: n = "rise", shape: r = "rounded", surface: i = "auto" }) {
|
|
8482
8521
|
let [a, s] = d([]);
|
|
8483
|
-
o(() =>
|
|
8522
|
+
o(() => Jr(s), []);
|
|
8484
8523
|
let c = Math.max(0, a.length - t), l = c ? a.slice(c) : a;
|
|
8485
8524
|
return /* @__PURE__ */ m("div", {
|
|
8486
|
-
className: `wui-toast-container toast-container position-fixed ${
|
|
8525
|
+
className: `wui-toast-container toast-container position-fixed ${$r[e] ?? $r["bottom-end"]} p-3`,
|
|
8487
8526
|
children: [c > 0 && /* @__PURE__ */ m("div", {
|
|
8488
8527
|
className: "wui-toast-more",
|
|
8489
8528
|
"aria-hidden": "true",
|
|
@@ -8492,7 +8531,7 @@ function ri({ position: e = "bottom-end", maxVisible: t = 4, animation: n = "ris
|
|
|
8492
8531
|
c,
|
|
8493
8532
|
" more"
|
|
8494
8533
|
]
|
|
8495
|
-
}), l.map((e) => /* @__PURE__ */ p(
|
|
8534
|
+
}), l.map((e) => /* @__PURE__ */ p(ai, {
|
|
8496
8535
|
toast: e,
|
|
8497
8536
|
defaultAnimation: n,
|
|
8498
8537
|
defaultShape: r,
|
|
@@ -8500,8 +8539,8 @@ function ri({ position: e = "bottom-end", maxVisible: t = 4, animation: n = "ris
|
|
|
8500
8539
|
}, e.id))]
|
|
8501
8540
|
});
|
|
8502
8541
|
}
|
|
8503
|
-
function
|
|
8504
|
-
let i =
|
|
8542
|
+
function ai({ toast: e, defaultAnimation: t = "rise", defaultShape: n = "rounded", defaultSurface: r = "auto" }) {
|
|
8543
|
+
let i = Qr[e.variant] ?? Qr.success, a = ti.has(e.animation) ? e.animation : t, o = ni.has(e.shape) ? e.shape : n, s = ri.has(e.surface) ? e.surface : r, c = (a !== "rise" && ti.has(a) ? ` wui-toast--anim-${a}` : "") + (o !== "rounded" && ni.has(o) ? ` wui-toast--shape-${o}` : "") + (s === "inverse" ? " wui-toast--surface-inverse" : ""), l = e.duration === 0, [f, h] = d(0), [g, _] = d(!1), v = u(null), y = () => Xr(e.id), b = (e) => {
|
|
8505
8544
|
e.button !== 0 || e.target.closest("button") || (v.current = e.clientX, _(!0), e.currentTarget.setPointerCapture?.(e.pointerId));
|
|
8506
8545
|
}, x = (e) => {
|
|
8507
8546
|
v.current !== null && h(e.clientX - v.current);
|
|
@@ -8510,7 +8549,7 @@ function ii({ toast: e, defaultAnimation: t = "rise", defaultShape: n = "rounded
|
|
|
8510
8549
|
}, C = (e) => {
|
|
8511
8550
|
if (v.current === null) return;
|
|
8512
8551
|
let t = e.clientX - v.current;
|
|
8513
|
-
if (Math.abs(t) >
|
|
8552
|
+
if (Math.abs(t) > ei) {
|
|
8514
8553
|
y();
|
|
8515
8554
|
return;
|
|
8516
8555
|
}
|
|
@@ -8593,7 +8632,7 @@ function ii({ toast: e, defaultAnimation: t = "rise", defaultShape: n = "rounded
|
|
|
8593
8632
|
}
|
|
8594
8633
|
//#endregion
|
|
8595
8634
|
//#region src/components/AppToolbar.jsx
|
|
8596
|
-
function
|
|
8635
|
+
function oi({ items: e = [], actions: t = [], value: n, defaultValue: r, onSelect: i, label: a, name: o, disabled: c = !1, className: l = "", ...u }) {
|
|
8597
8636
|
j("AppToolbar", u);
|
|
8598
8637
|
let f = s(), h = o || f, [g, _] = d(r), v = n === void 0 ? g : n;
|
|
8599
8638
|
return /* @__PURE__ */ m("div", {
|
|
@@ -8651,13 +8690,13 @@ function ai({ items: e = [], actions: t = [], value: n, defaultValue: r, onSelec
|
|
|
8651
8690
|
}
|
|
8652
8691
|
//#endregion
|
|
8653
8692
|
//#region src/components/AppTooltip.jsx
|
|
8654
|
-
var
|
|
8693
|
+
var si = {
|
|
8655
8694
|
start: "left",
|
|
8656
8695
|
end: "right",
|
|
8657
8696
|
top: "top",
|
|
8658
8697
|
bottom: "bottom"
|
|
8659
8698
|
};
|
|
8660
|
-
function
|
|
8699
|
+
function ci({ content: e, children: t, placement: r = "top", tone: i = "default", size: a = "md", className: o = "", ...c }) {
|
|
8661
8700
|
j("AppTooltip", c);
|
|
8662
8701
|
let l = /* @__PURE__ */ p(E, {
|
|
8663
8702
|
id: s(),
|
|
@@ -8671,14 +8710,14 @@ function si({ content: e, children: t, placement: r = "top", tone: i = "default"
|
|
|
8671
8710
|
});
|
|
8672
8711
|
return /* @__PURE__ */ p(w, {
|
|
8673
8712
|
trigger: ["hover", "focus"],
|
|
8674
|
-
placement:
|
|
8713
|
+
placement: si[r] || r,
|
|
8675
8714
|
overlay: l,
|
|
8676
8715
|
children: n(t, c)
|
|
8677
8716
|
});
|
|
8678
8717
|
}
|
|
8679
8718
|
//#endregion
|
|
8680
8719
|
//#region src/components/AppWizard.jsx
|
|
8681
|
-
var
|
|
8720
|
+
var li = i(function({ steps: t = [], children: n, active: r, defaultActive: i = 0, onStepChange: a, onFinish: s, onSkip: c, beforeNext: l, onInvalid: d, variant: f = "steps", tone: m, orientation: h = "horizontal", skippable: g = !1, nonLinear: _ = !1, hideStepper: v = !1, disabled: y = !1, label: b = "Progress", backLabel: x = "Back", nextLabel: S = "Next", skipLabel: C = "Skip", finishLabel: w = "Finish", className: T = "", ...E }, D) {
|
|
8682
8721
|
j("AppWizard", E);
|
|
8683
8722
|
let O = u(null), k = (e) => {
|
|
8684
8723
|
O.current = e, typeof D == "function" ? D(e) : D && (D.current = e);
|
|
@@ -8733,38 +8772,38 @@ var ci = i(function({ steps: t = [], children: n, active: r, defaultActive: i =
|
|
|
8733
8772
|
});
|
|
8734
8773
|
//#endregion
|
|
8735
8774
|
//#region src/components/AppWorkspaceSwitcher.jsx
|
|
8736
|
-
function
|
|
8737
|
-
let { onToggle:
|
|
8738
|
-
j("AppWorkspaceSwitcher",
|
|
8739
|
-
let [
|
|
8740
|
-
let t =
|
|
8775
|
+
function ui({ tenants: e = [], currentId: t, onSelect: n, menuLabel: r, footerAction: i, linkComponent: a, searchable: s = !1, onCreate: c, canCreate: f = !1, createLabel: h = "Create workspace", compact: g = !1, size: _ = "md", ariaLabel: v, ...y }) {
|
|
8776
|
+
let { onToggle: x, ...S } = y;
|
|
8777
|
+
j("AppWorkspaceSwitcher", S);
|
|
8778
|
+
let [C, w] = d(""), [T, E] = d(!1), D = u(null), O = e.find((e) => e.id === t) ?? e[0], k = l(() => {
|
|
8779
|
+
let t = C.trim().toLowerCase();
|
|
8741
8780
|
return !s || !t ? e : e.filter((e) => String(e.name ?? "").toLowerCase().includes(t));
|
|
8742
8781
|
}, [
|
|
8743
8782
|
e,
|
|
8744
|
-
|
|
8783
|
+
C,
|
|
8745
8784
|
s
|
|
8746
8785
|
]);
|
|
8747
8786
|
o(() => {
|
|
8748
|
-
|
|
8749
|
-
}, [
|
|
8787
|
+
T && s && D.current?.focus();
|
|
8788
|
+
}, [T, s]), o(() => {
|
|
8750
8789
|
if (!s) return;
|
|
8751
|
-
let e =
|
|
8790
|
+
let e = D.current;
|
|
8752
8791
|
if (!e) return;
|
|
8753
8792
|
let t = (e) => e.stopPropagation();
|
|
8754
8793
|
return e.addEventListener("keydown", t), () => e.removeEventListener("keydown", t);
|
|
8755
8794
|
}, [s]);
|
|
8756
|
-
let
|
|
8795
|
+
let A = O?.name ?? "", M = v ?? `Workspace ${A}`;
|
|
8757
8796
|
return /* @__PURE__ */ m(b, {
|
|
8758
|
-
className: "workspace-switcher"
|
|
8797
|
+
className: `workspace-switcher${_ === "sm" ? " workspace-switcher-sm" : ""}${_ === "lg" ? " workspace-switcher-lg" : ""}`,
|
|
8759
8798
|
onToggle: (e, t) => {
|
|
8760
|
-
|
|
8799
|
+
E(e), x?.(e, t);
|
|
8761
8800
|
},
|
|
8762
|
-
...
|
|
8801
|
+
...S,
|
|
8763
8802
|
children: [/* @__PURE__ */ p(b.Toggle, {
|
|
8764
|
-
as:
|
|
8803
|
+
as: mi,
|
|
8765
8804
|
compact: g,
|
|
8766
|
-
tenant:
|
|
8767
|
-
"aria-label":
|
|
8805
|
+
tenant: O,
|
|
8806
|
+
"aria-label": M
|
|
8768
8807
|
}), /* @__PURE__ */ m(b.Menu, {
|
|
8769
8808
|
className: "workspace-switcher-menu",
|
|
8770
8809
|
renderOnMount: !0,
|
|
@@ -8779,24 +8818,24 @@ function li({ tenants: e = [], currentId: t, onSelect: n, menuLabel: r, footerAc
|
|
|
8779
8818
|
name: "search",
|
|
8780
8819
|
size: 14
|
|
8781
8820
|
}), /* @__PURE__ */ p("input", {
|
|
8782
|
-
ref:
|
|
8821
|
+
ref: D,
|
|
8783
8822
|
type: "search",
|
|
8784
8823
|
className: "workspace-switcher-search-input",
|
|
8785
8824
|
placeholder: "Search workspaces",
|
|
8786
8825
|
"aria-label": "Search workspaces",
|
|
8787
|
-
value:
|
|
8788
|
-
onChange: (e) =>
|
|
8826
|
+
value: C,
|
|
8827
|
+
onChange: (e) => w(e.target.value)
|
|
8789
8828
|
})]
|
|
8790
8829
|
}) : null,
|
|
8791
8830
|
/* @__PURE__ */ m("div", {
|
|
8792
8831
|
className: "workspace-switcher-list",
|
|
8793
|
-
children: [
|
|
8832
|
+
children: [k.map((e) => /* @__PURE__ */ m(b.Item, {
|
|
8794
8833
|
as: "button",
|
|
8795
8834
|
type: "button",
|
|
8796
|
-
className: `workspace-switcher-option${e.id ===
|
|
8835
|
+
className: `workspace-switcher-option${e.id === O?.id ? " is-active" : ""}`,
|
|
8797
8836
|
onClick: () => n?.(e),
|
|
8798
8837
|
children: [
|
|
8799
|
-
/* @__PURE__ */ p(
|
|
8838
|
+
/* @__PURE__ */ p(fi, { tenant: e }),
|
|
8800
8839
|
/* @__PURE__ */ p("span", {
|
|
8801
8840
|
className: "workspace-switcher-option-name",
|
|
8802
8841
|
children: e.name
|
|
@@ -8805,13 +8844,13 @@ function li({ tenants: e = [], currentId: t, onSelect: n, menuLabel: r, footerAc
|
|
|
8805
8844
|
className: "workspace-switcher-badge",
|
|
8806
8845
|
children: e.badge
|
|
8807
8846
|
}) : null,
|
|
8808
|
-
e.id ===
|
|
8847
|
+
e.id === O?.id ? /* @__PURE__ */ p(I, {
|
|
8809
8848
|
name: "check",
|
|
8810
8849
|
size: 16,
|
|
8811
8850
|
className: "workspace-switcher-tick"
|
|
8812
8851
|
}) : null
|
|
8813
8852
|
]
|
|
8814
|
-
}, e.id)),
|
|
8853
|
+
}, e.id)), k.length === 0 ? /* @__PURE__ */ p("div", {
|
|
8815
8854
|
className: "workspace-switcher-empty",
|
|
8816
8855
|
children: "No workspaces match."
|
|
8817
8856
|
}) : null]
|
|
@@ -8828,17 +8867,17 @@ function li({ tenants: e = [], currentId: t, onSelect: n, menuLabel: r, footerAc
|
|
|
8828
8867
|
}) : null,
|
|
8829
8868
|
i ? /* @__PURE__ */ p("div", {
|
|
8830
8869
|
className: "workspace-switcher-footer",
|
|
8831
|
-
children:
|
|
8870
|
+
children: pi(i, a)
|
|
8832
8871
|
}) : null
|
|
8833
8872
|
]
|
|
8834
8873
|
})]
|
|
8835
8874
|
});
|
|
8836
8875
|
}
|
|
8837
|
-
function
|
|
8876
|
+
function di(e) {
|
|
8838
8877
|
let t = String(e ?? "").trim().split(/\s+/).filter(Boolean);
|
|
8839
8878
|
return t.length === 0 ? "" : (t[0][0] + (t.length > 1 ? t[t.length - 1][0] : "")).toUpperCase();
|
|
8840
8879
|
}
|
|
8841
|
-
function
|
|
8880
|
+
function fi({ tenant: e }) {
|
|
8842
8881
|
return e?.logoUrl ? /* @__PURE__ */ p("img", {
|
|
8843
8882
|
className: "workspace-switcher-mark",
|
|
8844
8883
|
src: e.logoUrl,
|
|
@@ -8846,10 +8885,10 @@ function di({ tenant: e }) {
|
|
|
8846
8885
|
loading: "lazy"
|
|
8847
8886
|
}) : /* @__PURE__ */ p("span", {
|
|
8848
8887
|
className: "workspace-switcher-mark",
|
|
8849
|
-
children:
|
|
8888
|
+
children: di(e?.name)
|
|
8850
8889
|
});
|
|
8851
8890
|
}
|
|
8852
|
-
function
|
|
8891
|
+
function pi(e, t) {
|
|
8853
8892
|
if (typeof e != "object" || !e || !("label" in e)) return e;
|
|
8854
8893
|
let { label: n, icon: r, href: i } = e;
|
|
8855
8894
|
return /* @__PURE__ */ m(i ? t ?? "a" : "button", {
|
|
@@ -8861,7 +8900,7 @@ function fi(e, t) {
|
|
|
8861
8900
|
}) : null, n]
|
|
8862
8901
|
});
|
|
8863
8902
|
}
|
|
8864
|
-
var
|
|
8903
|
+
var mi = i(function({ compact: e, tenant: t, "aria-label": n, className: r, ...i }, a) {
|
|
8865
8904
|
return /* @__PURE__ */ m("button", {
|
|
8866
8905
|
ref: a,
|
|
8867
8906
|
type: "button",
|
|
@@ -8869,7 +8908,7 @@ var pi = i(function({ compact: e, tenant: t, "aria-label": n, className: r, ...i
|
|
|
8869
8908
|
"aria-haspopup": "true",
|
|
8870
8909
|
"aria-label": n,
|
|
8871
8910
|
...i,
|
|
8872
|
-
children: [/* @__PURE__ */ p(
|
|
8911
|
+
children: [/* @__PURE__ */ p(fi, { tenant: t }), e ? null : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("span", {
|
|
8873
8912
|
className: "workspace-switcher-trigger-name",
|
|
8874
8913
|
children: t?.name
|
|
8875
8914
|
}), /* @__PURE__ */ p(I, {
|
|
@@ -8881,36 +8920,36 @@ var pi = i(function({ compact: e, tenant: t, "aria-label": n, className: r, ...i
|
|
|
8881
8920
|
});
|
|
8882
8921
|
//#endregion
|
|
8883
8922
|
//#region src/components/toast.js
|
|
8884
|
-
function
|
|
8885
|
-
|
|
8923
|
+
function hi() {
|
|
8924
|
+
Zr();
|
|
8886
8925
|
}
|
|
8887
|
-
var
|
|
8926
|
+
var gi = /* @__PURE__ */ new Set([
|
|
8888
8927
|
"success",
|
|
8889
8928
|
"info",
|
|
8890
8929
|
"warning",
|
|
8891
8930
|
"error"
|
|
8892
8931
|
]);
|
|
8893
|
-
function
|
|
8932
|
+
function _i(e, t = "info") {
|
|
8894
8933
|
let n = "info", r = {};
|
|
8895
|
-
typeof t == "string" ? n =
|
|
8934
|
+
typeof t == "string" ? n = gi.has(t) ? t : "info" : typeof t == "object" && t && (r = t, n = gi.has(r.variant) ? r.variant : "info"), Yr(e, n, r);
|
|
8896
8935
|
}
|
|
8897
|
-
function
|
|
8898
|
-
|
|
8936
|
+
function vi(e, t = {}) {
|
|
8937
|
+
Yr(e, "error", t);
|
|
8899
8938
|
}
|
|
8900
|
-
|
|
8939
|
+
_i.promise = (e, t, n = {}) => {
|
|
8901
8940
|
let r = n.id || `promise-${Date.now()}-${Math.random()}`;
|
|
8902
|
-
return
|
|
8941
|
+
return _i(t.loading || "Loading...", {
|
|
8903
8942
|
...n,
|
|
8904
8943
|
variant: "info",
|
|
8905
8944
|
id: r,
|
|
8906
8945
|
duration: 0
|
|
8907
|
-
}), e.then((e) => (
|
|
8946
|
+
}), e.then((e) => (_i((typeof t.success == "function" ? t.success(e) : t.success) || "Done", {
|
|
8908
8947
|
...n,
|
|
8909
8948
|
variant: "success",
|
|
8910
8949
|
id: r,
|
|
8911
8950
|
duration: n.duration === void 0 ? 5e3 : n.duration
|
|
8912
8951
|
}), e)).catch((e) => {
|
|
8913
|
-
throw
|
|
8952
|
+
throw _i((typeof t.error == "function" ? t.error(e) : t.error) || "Error", {
|
|
8914
8953
|
...n,
|
|
8915
8954
|
variant: "error",
|
|
8916
8955
|
id: r,
|
|
@@ -8920,7 +8959,7 @@ gi.promise = (e, t, n = {}) => {
|
|
|
8920
8959
|
};
|
|
8921
8960
|
//#endregion
|
|
8922
8961
|
//#region src/lib/usePagination.js
|
|
8923
|
-
function
|
|
8962
|
+
function yi(e, t = 10) {
|
|
8924
8963
|
let [n, r] = d(1), [i, a] = d(t), s = e.length, c = Math.max(1, Math.ceil(s / i));
|
|
8925
8964
|
o(() => {
|
|
8926
8965
|
n > c && r(c);
|
|
@@ -8946,4 +8985,4 @@ function vi(e, t = 10) {
|
|
|
8946
8985
|
};
|
|
8947
8986
|
}
|
|
8948
8987
|
//#endregion
|
|
8949
|
-
export { R as ActionIcon, z as AppAccordion, ee as AppAlert, oe as AppAsyncBlock, jt as AppAutocomplete, Lt as AppAvatar, Bt as AppAvatarGroup, Ut as AppBadge, Gt as AppBanner, Kt as AppBreadcrumbs, V as AppButton, qt as AppCallout, Yt as AppCard, Zt as AppCheckbox, Qt as AppChip, $t as AppChoiceCard, en as AppChoiceChip, tn as AppColorField, nn as AppCompareTable, fn as AppConfirmDialog, mn as AppCopyButton, wn as AppDataTable, Tn as AppDatePicker, En as AppDateRangePicker, On as AppDescriptions, jn as AppDropdown, ie as AppEmptyState, Rn as AppFileAttachment, Bn as AppFilePicker, Vn as AppFloatingDock, Hn as AppFormActions, Un as AppFormRow, Wn as AppFormSection, Gn as AppInfoList, St as AppInfoTip, rn as AppInput, Xn as AppKpiTile, Qn as AppLogoPicker, nr as AppMeter, ln as AppModal, rr as AppMultiSelect, ir as AppNumberInput, ar as AppOtpInput, or as AppPageHeader, sr as AppPagination, cr as AppPhoneNumberInput, xt as AppPopover, lr as AppPricingCard, fr as AppProgress, pr as AppRadio, mr as AppRepeater, hr as AppResourceCard, _r as AppResult, vr as AppScrollbar, yr as AppSearch, br as AppSegmented, Sr as AppSelect, yn as AppSelectMini, Cr as AppShell, Er as AppSidebarMenu, hn as AppSkeleton, gn as AppSkeletonRows, Dr as AppSlider, ae as AppSpinner, kr as AppSplash, Ar as AppStatusBadge, jr as AppStepper, Nr as AppSwitch, Pr as AppTableEmptyState, xn as AppTablePagination, Fr as AppTabs, Ir as AppTagInput, Lr as AppTextarea,
|
|
8988
|
+
export { R as ActionIcon, z as AppAccordion, ee as AppAlert, oe as AppAsyncBlock, jt as AppAutocomplete, Lt as AppAvatar, Bt as AppAvatarGroup, Ut as AppBadge, Gt as AppBanner, Kt as AppBreadcrumbs, V as AppButton, qt as AppCallout, Yt as AppCard, Zt as AppCheckbox, Qt as AppChip, $t as AppChoiceCard, en as AppChoiceChip, tn as AppColorField, nn as AppCompareTable, fn as AppConfirmDialog, mn as AppCopyButton, wn as AppDataTable, Tn as AppDatePicker, En as AppDateRangePicker, On as AppDescriptions, jn as AppDropdown, ie as AppEmptyState, Rn as AppFileAttachment, Bn as AppFilePicker, Vn as AppFloatingDock, Hn as AppFormActions, Un as AppFormRow, Wn as AppFormSection, Gn as AppInfoList, St as AppInfoTip, rn as AppInput, Xn as AppKpiTile, Qn as AppLogoPicker, nr as AppMeter, ln as AppModal, rr as AppMultiSelect, ir as AppNumberInput, ar as AppOtpInput, or as AppPageHeader, sr as AppPagination, cr as AppPhoneNumberInput, xt as AppPopover, lr as AppPricingCard, fr as AppProgress, pr as AppRadio, mr as AppRepeater, hr as AppResourceCard, _r as AppResult, vr as AppScrollbar, yr as AppSearch, br as AppSegmented, Sr as AppSelect, yn as AppSelectMini, Cr as AppShell, Er as AppSidebarMenu, hn as AppSkeleton, gn as AppSkeletonRows, Dr as AppSlider, ae as AppSpinner, kr as AppSplash, Ar as AppStatusBadge, jr as AppStepper, Nr as AppSwitch, Pr as AppTableEmptyState, xn as AppTablePagination, Fr as AppTabs, Ir as AppTagInput, Lr as AppTextarea, Br as AppTimePicker, zr as AppTimeline, ii as AppToast, ii as AppToastContainer, oi as AppToolbar, ci as AppTooltip, li as AppWizard, ui as AppWorkspaceSwitcher, I as Icon, dn as MODAL_ICONS, Z as RequiredMark, hi as dismissAll, vi as errorToast, N as iconNames, F as registerIcons, _i as toast, yi as usePagination };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/ui-react",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Webority shared React component library — App* primitives on react-bootstrap + the @webority/theme design system.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "module",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
},
|
|
29
29
|
"sideEffects": false,
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@webority/theme": "^0.8.
|
|
32
|
-
"@webority/ui-elements": "^0.8.
|
|
31
|
+
"@webority/theme": "^0.8.1",
|
|
32
|
+
"@webority/ui-elements": "^0.8.1"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"bootstrap": "5.3.3",
|