@webority/ui-react 0.8.0 → 0.8.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/README.md CHANGED
@@ -20,4 +20,4 @@ import { AppButton } from '@webority/ui-react';
20
20
  <AppButton variant="primary">Save changes</AppButton>;
21
21
  ```
22
22
 
23
- Component catalogue: <https://ui.webority.dev>
23
+ Component catalogue: <https://ui-react.webority.dev>
@@ -5,35 +5,56 @@
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: plain (today's
15
- * bordered card), filled (a subtle surface fill), accent (a brand-tinted fill).
16
- * @param {'md'|'lg'} [props.size='md'] Tile scale: md (default), lg (a hero tile with an
17
- * enlarged value — for the single headline stat above a dashboard).
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).
18
+ * @param {'sm'|'md'|'lg'} [props.size='md'] Tile scale: sm (compact), md (default), lg (a hero
19
+ * tile with an enlarged value — for the single headline stat above a dashboard).
20
+ * @param {number} [props.valueSize] Custom value ("main heading") font-size in px. Overrides the
21
+ * size/variant default — use it to tame a too-large headline (e.g. the spotlight serif).
18
22
  * @param {boolean} [props.inline=false] Put the icon beside the text instead of above it.
19
23
  * @param {boolean} [props.attention=false] Marks the tile as needing action (warning-tinted).
20
24
  * @param {string} [props.href] Renders the whole tile as a link to this URL.
21
25
  * @param {import('react').ElementType} [props.linkComponent] Router link; receives `to` instead of `href`.
22
- * @param {string} [props.className]
26
+ * @param {string} [props.className] Extra class(es) on the tile root.
27
+ * @param {import('react').CSSProperties} [props.style] Inline style on the tile root; the
28
+ * `valueSize` var is merged into it.
29
+ * @param {string} [props.iconClassName] Extra class(es) on the icon chip.
30
+ * @param {string} [props.labelClassName] Extra class(es) on the label.
31
+ * @param {string} [props.valueClassName] Extra class(es) on the value.
32
+ * @param {string} [props.captionClassName] Extra class(es) on the caption.
33
+ * @param {string} [props.deltaClassName] Extra class(es) on the delta.
34
+ * @param {string} [props.sparklineClassName] Extra class(es) on the sparkline.
23
35
  */
24
- export default function AppKpiTile({ label, value, icon, iconTone, delta, deltaDirection, sparkline, variant, size, inline, attention, href, linkComponent: Link, className, ...rest }: {
36
+ export default function AppKpiTile({ label, value, caption, icon, iconTone, delta, deltaDirection, sparkline, variant, size, valueSize, inline, attention, href, linkComponent: Link, className, style, iconClassName, labelClassName, valueClassName, captionClassName, deltaClassName, sparklineClassName, ...rest }: {
25
37
  label: string;
26
38
  value: import('react').ReactNode;
39
+ caption?: import('react').ReactNode;
27
40
  icon?: string | import('react').ReactNode;
28
41
  iconTone?: 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'neutral';
29
42
  delta?: import('react').ReactNode;
30
43
  deltaDirection?: 'up' | 'down' | 'flat';
31
44
  sparkline?: number[];
32
- variant?: 'plain' | 'filled' | 'accent';
33
- size?: 'md' | 'lg';
45
+ variant?: 'plain' | 'filled' | 'accent' | 'spotlight';
46
+ size?: 'sm' | 'md' | 'lg';
47
+ valueSize?: number;
34
48
  inline?: boolean;
35
49
  attention?: boolean;
36
50
  href?: string;
37
51
  linkComponent?: import('react').ElementType;
38
52
  className?: string;
53
+ style?: import('react').CSSProperties;
54
+ iconClassName?: string;
55
+ labelClassName?: string;
56
+ valueClassName?: string;
57
+ captionClassName?: string;
58
+ deltaClassName?: string;
59
+ sparklineClassName?: string;
39
60
  }): import("react").JSX.Element;
@@ -23,6 +23,9 @@
23
23
  * @param {boolean} [props.required=false]
24
24
  * @param {string} [props.error]
25
25
  * @param {string} [props.hint]
26
+ * @param {import('react').ReactNode} [props.help] Content for the label info-tip (decoupled:
27
+ * the caller supplies the node; a glossary-backed app wraps its lookup here). Mirrors AppInput.
28
+ * @param {string} [props.helpLabel="More information"] aria-label for the info-tip button.
26
29
  * @param {number} [props.min] Minimum value (inclusive)
27
30
  * @param {number} [props.max] Maximum value (inclusive)
28
31
  * @param {number} [props.step=1] Increment by this amount
@@ -1,26 +1,50 @@
1
1
  /**
2
- * A chronological activity feed — an audit trail, a sign-off history, a status log.
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
- * The rail is drawn on the list, not per item, so it cannot break into segments
7
- * when an entry wraps to two lines.
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, tone?: 'neutral'|'success'|'warning'|'danger'|'info',
11
- * title: import('react').ReactNode, at?: string, by?: string, note?: string }[]} props.items
12
- * Newest first — a reader scanning an audit trail expects the latest event at the top.
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
@@ -13,7 +13,7 @@ function j(e, t) {
13
13
  if (!(!O() || !t) && !("as" in t)) for (let n of Object.keys(t)) {
14
14
  if (k(n) || D.has(n)) continue;
15
15
  let t = `${e}.${n}`;
16
- A.has(t) || (A.add(t), console.warn(`[@webority/ui-react] <${e}> received an unknown prop "${n}". It is not part of the component's API and is not a valid HTML attribute, so it will either be dropped or land on the DOM — check the prop name against the component catalogue at https://ui.webority.dev.`));
16
+ A.has(t) || (A.add(t), console.warn(`[@webority/ui-react] <${e}> received an unknown prop "${n}". It is not part of the component's API and is not a valid HTML attribute, so it will either be dropped or land on the DOM — check the prop name against the component catalogue at https://ui-react.webority.dev.`));
17
17
  }
18
18
  }
19
19
  //#endregion
@@ -3104,7 +3104,7 @@ var We = class extends HTMLElement {
3104
3104
  this.innerHTML = `
3105
3105
  <div class="phone-input-wrap">
3106
3106
  <div class="phone-country-adornment">
3107
- <button type="button" class="country-toggle" aria-haspopup="listbox" aria-expanded="false" aria-controls="${Ge(t)}"${this.hasAttribute("disabled") ? " disabled" : ""}>
3107
+ <button type="button" class="country-toggle" aria-label="Choose country" aria-haspopup="listbox" aria-expanded="false" aria-controls="${Ge(t)}"${this.hasAttribute("disabled") ? " disabled" : ""}>
3108
3108
  <span class="${Ie(this._country)}" data-flag aria-hidden="true"></span>
3109
3109
  <i class="bi bi-chevron-down phone-chevron" aria-hidden="true"></i>
3110
3110
  <span class="phone-dial" data-dial>+${Fe(this._country)}</span>
@@ -6477,47 +6477,55 @@ 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, icon: n, iconTone: r, delta: i, deltaDirection: a, sparkline: o, variant: s = "plain", size: c = "md", inline: l = !1, attention: u = !1, href: d, linkComponent: f, className: h = "", ...g }) {
6481
- j("AppKpiTile", g);
6482
- let _ = `kpi${l ? " kpi-inline" : ""}${s === "filled" ? " kpi-filled" : s === "accent" ? " kpi-accent" : ""}${c === "lg" ? " kpi-lg" : ""}${u ? " kpi-attention" : ""}${h ? ` ${h}` : ""}`, v = a ?? Yn(i), y = v === "up" ? "arrow-up" : v === "down" ? "arrow-down" : null, b = {};
6483
- return d != null && (b = f ? {
6484
- as: f,
6485
- to: d
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", valueSize: u, inline: d = !1, attention: f = !1, href: h, linkComponent: g, className: _ = "", style: v, iconClassName: y = "", labelClassName: b = "", valueClassName: x = "", captionClassName: S = "", deltaClassName: C = "", sparklineClassName: w = "", ...T }) {
6481
+ j("AppKpiTile", T);
6482
+ let E = `kpi${d ? " kpi-inline" : ""}${c === "filled" ? " kpi-filled" : c === "accent" ? " kpi-accent" : c === "spotlight" ? " kpi-spotlight" : ""}${l === "lg" ? " kpi-lg" : l === "sm" ? " kpi-sm" : ""}${f ? " kpi-attention" : ""}${_ ? ` ${_}` : ""}`, D = typeof u == "number" && u > 0 ? {
6483
+ ...v,
6484
+ "--wui-kpi-value-size": `${u}px`
6485
+ } : v, O = o ?? Yn(a), k = O === "up" ? "arrow-up" : O === "down" ? "arrow-down" : null, A = {};
6486
+ return h != null && (A = g ? {
6487
+ as: g,
6488
+ to: h
6486
6489
  } : {
6487
6490
  as: "a",
6488
- href: d
6489
- }), /* @__PURE__ */ m(b.as || "div", {
6490
- className: _,
6491
- ...g,
6492
- ...b,
6491
+ href: h
6492
+ }), /* @__PURE__ */ m(A.as || "div", {
6493
+ className: E,
6494
+ style: D,
6495
+ ...T,
6496
+ ...A,
6493
6497
  children: [
6494
- n && /* @__PURE__ */ p("span", {
6495
- className: `kpi-icon${r ? ` kpi-icon-${r}` : ""}`,
6496
- children: L(n, { size: 20 })
6498
+ r && /* @__PURE__ */ p("span", {
6499
+ className: `kpi-icon${i ? ` kpi-icon-${i}` : ""}${y ? ` ${y}` : ""}`,
6500
+ children: L(r, { size: 20 })
6497
6501
  }),
6498
6502
  /* @__PURE__ */ p("div", {
6499
- className: "kpi-label",
6503
+ className: `kpi-label${b ? ` ${b}` : ""}`,
6500
6504
  children: e
6501
6505
  }),
6502
6506
  /* @__PURE__ */ p("div", {
6503
- className: "kpi-value",
6507
+ className: `kpi-value${x ? ` ${x}` : ""}`,
6504
6508
  children: t
6505
6509
  }),
6506
- i && /* @__PURE__ */ m("div", {
6507
- className: `kpi-delta${v === "flat" ? "" : ` ${v}`}`,
6508
- children: [y && /* @__PURE__ */ p(I, {
6509
- name: y,
6510
+ n && /* @__PURE__ */ p("div", {
6511
+ className: `kpi-caption${S ? ` ${S}` : ""}`,
6512
+ children: n
6513
+ }),
6514
+ a && /* @__PURE__ */ m("div", {
6515
+ className: `kpi-delta${O === "flat" ? "" : ` ${O}`}${C ? ` ${C}` : ""}`,
6516
+ children: [k && /* @__PURE__ */ p(I, {
6517
+ name: k,
6510
6518
  size: 13
6511
- }), i]
6519
+ }), a]
6512
6520
  }),
6513
- o && o.length > 0 && /* @__PURE__ */ p("svg", {
6514
- className: "kpi-sparkline",
6521
+ s && s.length > 0 && /* @__PURE__ */ p("svg", {
6522
+ className: `kpi-sparkline${w ? ` ${w}` : ""}`,
6515
6523
  width: Kn,
6516
6524
  height: qn,
6517
6525
  viewBox: `0 0 ${Kn} ${qn}`,
6518
6526
  "aria-hidden": "true",
6519
6527
  children: /* @__PURE__ */ p("polyline", {
6520
- points: Jn(o),
6528
+ points: Jn(s),
6521
6529
  stroke: "currentColor",
6522
6530
  fill: "none"
6523
6531
  })
@@ -6754,91 +6762,95 @@ var rr = i(function({ values: e, onChange: t, options: n, placeholder: r = "Sele
6754
6762
  }) : null
6755
6763
  ]
6756
6764
  });
6757
- }), ir = i(function({ label: e, required: t = !1, error: n, hint: r, value: i, onChange: a, min: c, max: l, step: u = 1, precision: f = 0, unit: h, size: g = "md", id: _, name: v, className: y = "", fieldClassName: b = "", disabled: S = !1, ...C }, w) {
6758
- j("AppNumberInput", C);
6759
- let T = s(), E = _ || T, D = (e) => {
6760
- if (f === 0) return Math.round(e);
6761
- let t = 10 ** f;
6765
+ }), ir = i(function({ label: e, required: t = !1, error: n, hint: r, help: i, helpLabel: a = "More information", value: c, onChange: l, min: u, max: f, step: h = 1, precision: g = 0, unit: _, size: v = "md", id: y, name: b, className: S = "", fieldClassName: C = "", disabled: w = !1, ...T }, E) {
6766
+ j("AppNumberInput", T);
6767
+ let D = s(), O = y || D, k = (e) => {
6768
+ if (g === 0) return Math.round(e);
6769
+ let t = 10 ** g;
6762
6770
  return Math.round(e * t) / t;
6763
- }, O = (e) => {
6771
+ }, A = (e) => {
6764
6772
  let t = e;
6765
- return typeof c == "number" && (t = Math.max(t, c)), typeof l == "number" && (t = Math.min(t, l)), t;
6766
- }, k = (e) => {
6773
+ return typeof u == "number" && (t = Math.max(t, u)), typeof f == "number" && (t = Math.min(t, f)), t;
6774
+ }, M = (e) => {
6767
6775
  if (e === "" || e === null) return null;
6768
6776
  let t = parseFloat(e);
6769
6777
  return Number.isNaN(t) ? null : t;
6770
- }, [A, M] = d(i ?? "");
6778
+ }, [N, P] = d(c ?? "");
6771
6779
  o(() => {
6772
- M(i ?? "");
6773
- }, [i]);
6774
- let N = (e) => {
6775
- let t = (k(A) ?? O(0)) + e * u, n = O(D(t));
6776
- M(String(n)), a?.(n);
6777
- }, P = k(A), F = S || P !== null && typeof c == "number" && P <= c, L = S || P !== null && typeof l == "number" && P >= l, R = n && E ? `${E}-error` : void 0, z = r && E ? `${E}-hint` : void 0, B = R || z, ee = [
6780
+ P(c ?? "");
6781
+ }, [c]);
6782
+ let F = (e) => {
6783
+ let t = (M(N) ?? A(0)) + e * h, n = A(k(t));
6784
+ P(String(n)), l?.(n);
6785
+ }, L = M(N), R = w || L !== null && typeof u == "number" && L <= u, z = w || L !== null && typeof f == "number" && L >= f, B = n && O ? `${O}-error` : void 0, ee = r && O ? `${O}-hint` : void 0, te = B || ee, ne = [
6778
6786
  "input",
6779
- g === "sm" ? "input-sm" : "",
6780
- g === "lg" ? "input-lg" : "",
6787
+ v === "sm" ? "input-sm" : "",
6788
+ v === "lg" ? "input-lg" : "",
6781
6789
  n ? "error" : "",
6782
6790
  "num-input",
6783
- y
6784
- ].filter(Boolean).join(" "), te = (e) => {
6791
+ S
6792
+ ].filter(Boolean).join(" "), re = (e) => {
6785
6793
  let t = e.target.value;
6786
- M(t);
6787
- let n = k(t);
6788
- n !== null && a?.(n);
6789
- }, ne = (e) => {
6790
- let t = k(e.target.value);
6791
- if (t === null) M(""), a?.("");
6794
+ P(t);
6795
+ let n = M(t);
6796
+ n !== null && l?.(n);
6797
+ }, V = (e) => {
6798
+ let t = M(e.target.value);
6799
+ if (t === null) P(""), l?.("");
6792
6800
  else {
6793
- let e = O(D(t));
6794
- M(String(e)), a?.(e);
6801
+ let e = A(k(t));
6802
+ P(String(e)), l?.(e);
6795
6803
  }
6796
- C.onBlur?.(e);
6797
- }, re = (e) => {
6798
- e.key === "ArrowUp" ? (e.preventDefault(), N(1)) : e.key === "ArrowDown" && (e.preventDefault(), N(-1)), C.onKeyDown?.(e);
6799
- }, V = /* @__PURE__ */ p(x.Control, {
6800
- ...C,
6801
- id: E,
6802
- name: v,
6804
+ T.onBlur?.(e);
6805
+ }, ie = (e) => {
6806
+ e.key === "ArrowUp" ? (e.preventDefault(), F(1)) : e.key === "ArrowDown" && (e.preventDefault(), F(-1)), T.onKeyDown?.(e);
6807
+ }, ae = /* @__PURE__ */ p(x.Control, {
6808
+ ...T,
6809
+ id: O,
6810
+ name: b,
6803
6811
  type: "text",
6804
- inputMode: f > 0 ? "decimal" : "numeric",
6805
- className: ee,
6806
- disabled: S,
6812
+ inputMode: g > 0 ? "decimal" : "numeric",
6813
+ className: ne,
6814
+ disabled: w,
6807
6815
  required: t,
6808
6816
  "aria-invalid": n ? "true" : "false",
6809
- "aria-describedby": B,
6810
- value: A,
6811
- ref: w,
6812
- onChange: te,
6813
- onBlur: ne,
6814
- onKeyDown: re
6815
- }), ie = /* @__PURE__ */ m("div", {
6816
- className: "num-wrap",
6817
+ "aria-describedby": te,
6818
+ value: N,
6819
+ ref: E,
6820
+ onChange: re,
6821
+ onBlur: V,
6822
+ onKeyDown: ie
6823
+ }), oe = /* @__PURE__ */ m("div", {
6824
+ className: [
6825
+ "num-wrap",
6826
+ v === "sm" ? "num-wrap-sm" : "",
6827
+ v === "lg" ? "num-wrap-lg" : ""
6828
+ ].filter(Boolean).join(" "),
6817
6829
  children: [
6818
6830
  /* @__PURE__ */ p("button", {
6819
6831
  type: "button",
6820
6832
  className: "num-btn",
6821
6833
  "aria-label": "Decrease",
6822
6834
  tabIndex: -1,
6823
- disabled: F,
6824
- onClick: () => N(-1),
6835
+ disabled: R,
6836
+ onClick: () => F(-1),
6825
6837
  children: /* @__PURE__ */ p(I, {
6826
6838
  name: "minus",
6827
6839
  size: 16
6828
6840
  })
6829
6841
  }),
6830
- V,
6831
- h && /* @__PURE__ */ p("span", {
6842
+ ae,
6843
+ _ && /* @__PURE__ */ p("span", {
6832
6844
  className: "affix",
6833
- children: h
6845
+ children: _
6834
6846
  }),
6835
6847
  /* @__PURE__ */ p("button", {
6836
6848
  type: "button",
6837
6849
  className: "num-btn",
6838
6850
  "aria-label": "Increase",
6839
6851
  tabIndex: -1,
6840
- disabled: L,
6841
- onClick: () => N(1),
6852
+ disabled: z,
6853
+ onClick: () => F(1),
6842
6854
  children: /* @__PURE__ */ p(I, {
6843
6855
  name: "plus",
6844
6856
  size: 16
@@ -6847,21 +6859,28 @@ var rr = i(function({ values: e, onChange: t, options: n, placeholder: r = "Sele
6847
6859
  ]
6848
6860
  });
6849
6861
  return /* @__PURE__ */ m(x.Group, {
6850
- className: `field${b ? ` ${b}` : ""}`,
6862
+ className: `field${C ? ` ${C}` : ""}`,
6851
6863
  children: [
6852
6864
  e && /* @__PURE__ */ m(x.Label, {
6853
6865
  className: "label",
6854
- htmlFor: E,
6855
- children: [e, t && /* @__PURE__ */ p(Z, {})]
6866
+ htmlFor: O,
6867
+ children: [
6868
+ e,
6869
+ t && /* @__PURE__ */ p(Z, {}),
6870
+ i && /* @__PURE__ */ p(St, {
6871
+ label: a,
6872
+ children: i
6873
+ })
6874
+ ]
6856
6875
  }),
6857
- ie,
6876
+ oe,
6858
6877
  n ? /* @__PURE__ */ p("div", {
6859
6878
  className: "field-error",
6860
- id: R,
6879
+ id: B,
6861
6880
  children: n
6862
6881
  }) : r ? /* @__PURE__ */ p("div", {
6863
6882
  className: "field-hint",
6864
- id: z,
6883
+ id: ee,
6865
6884
  children: r
6866
6885
  }) : null
6867
6886
  ]
@@ -7032,36 +7051,38 @@ function sr({ page: e, totalPages: t, onChange: n, siblings: r = 1, size: i = "m
7032
7051
  }
7033
7052
  //#endregion
7034
7053
  //#region src/components/AppPhoneNumberInput.jsx
7035
- var cr = i(function({ value: e, onChange: t, country: n, disabled: r = !1, name: i, label: a = "Phone number", placeholder: o, required: c = !1, error: l, fieldClassName: u = "", ...d }, f) {
7036
- j("AppPhoneNumberInput", d);
7037
- let h = s(), g = i || h, _ = l && g ? `${g}-error` : void 0, { setRef: v } = Q({
7038
- ref: f,
7054
+ var cr = i(function({ value: e, onChange: t, country: n, disabled: r = !1, name: i, label: a = "Phone number", placeholder: o, required: c = !1, error: l, showFlag: u = !0, showDialCode: d = !0, fieldClassName: f = "", ...h }, g) {
7055
+ j("AppPhoneNumberInput", h);
7056
+ let _ = s(), v = i || _, y = l && v ? `${v}-error` : void 0, { setRef: b } = Q({
7057
+ ref: g,
7039
7058
  value: e ?? "",
7040
7059
  onChange: t,
7041
7060
  events: ["input", "change"]
7042
7061
  });
7043
7062
  return /* @__PURE__ */ m("div", {
7044
- className: `field app-phone-number-input${u ? ` ${u}` : ""}`,
7063
+ className: `field app-phone-number-input${f ? ` ${f}` : ""}`,
7045
7064
  children: [
7046
7065
  a && /* @__PURE__ */ m("label", {
7047
7066
  className: "label",
7048
- htmlFor: g,
7067
+ htmlFor: v,
7049
7068
  children: [a, c && /* @__PURE__ */ p(Z, {})]
7050
7069
  }),
7051
7070
  /* @__PURE__ */ p("wui-phone", {
7052
7071
  "aria-label": typeof a == "string" ? a : void 0,
7053
- "aria-describedby": _,
7054
- ref: v,
7072
+ "aria-describedby": y,
7073
+ ref: b,
7055
7074
  name: i,
7056
7075
  country: n,
7057
7076
  placeholder: o,
7058
7077
  required: c ? "" : void 0,
7059
7078
  disabled: r ? "" : void 0,
7060
- ...d
7079
+ "hide-flag": u ? void 0 : "",
7080
+ "hide-dial": d ? void 0 : "",
7081
+ ...h
7061
7082
  }),
7062
7083
  l && /* @__PURE__ */ p("div", {
7063
7084
  className: "field-error",
7064
- id: _,
7085
+ id: y,
7065
7086
  children: l
7066
7087
  })
7067
7088
  ]
@@ -8052,34 +8073,34 @@ function Fr({ tabs: e, value: t, onChange: n, variant: r = "underline", orientat
8052
8073
  let n = y.current;
8053
8074
  if (!n) return;
8054
8075
  let r = n.querySelector(".app-tab.active");
8055
- if (r) {
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();
8076
+ 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
8077
  }, [
8066
8078
  x,
8067
8079
  e,
8068
8080
  t,
8069
8081
  k
8070
- ]);
8082
+ ]), M = a(() => {
8083
+ let e = y.current;
8084
+ if (!e || x) return;
8085
+ let t = e.querySelector(".app-tab.active");
8086
+ if (!t) return;
8087
+ let n = t.offsetLeft, r = n + t.offsetWidth;
8088
+ n - 28 < e.scrollLeft ? e.scrollLeft = Math.max(0, n - 28) : r + 28 > e.scrollLeft + e.clientWidth && (e.scrollLeft = r + 28 - e.clientWidth);
8089
+ }, [x]);
8071
8090
  c(() => {
8072
8091
  A();
8073
- }, [A]);
8074
- let M = u(A);
8092
+ }, [A]), c(() => {
8093
+ M();
8094
+ }, [t, M]);
8095
+ let N = u(A);
8075
8096
  o(() => {
8076
- M.current = A;
8097
+ N.current = A;
8077
8098
  }, [A]), o(() => {
8078
8099
  if (typeof ResizeObserver > "u") return;
8079
- let e = new ResizeObserver(() => M.current());
8100
+ let e = new ResizeObserver(() => N.current());
8080
8101
  return y.current && e.observe(y.current), b.current && e.observe(b.current), () => e.disconnect();
8081
8102
  }, [x]);
8082
- function N(t) {
8103
+ function P(t) {
8083
8104
  let r = t.target?.dataset?.key;
8084
8105
  if (r == null) return;
8085
8106
  let i = e.findIndex((e) => e.key === r);
@@ -8093,10 +8114,10 @@ function Fr({ tabs: e, value: t, onChange: n, variant: r = "underline", orientat
8093
8114
  }, s = x ? "ArrowDown" : "ArrowRight", c = x ? "ArrowUp" : "ArrowLeft", l = null;
8094
8115
  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
8116
  }
8096
- let P = (e) => {
8117
+ let F = (e) => {
8097
8118
  let t = y.current;
8098
8119
  t && t.scrollBy({ left: e * t.clientWidth * .7 });
8099
- }, F = [
8120
+ }, L = [
8100
8121
  "app-tabs",
8101
8122
  r === "pills" ? "app-tabs-pills" : "",
8102
8123
  x ? "app-tabs-vertical" : "",
@@ -8104,15 +8125,15 @@ function Fr({ tabs: e, value: t, onChange: n, variant: r = "underline", orientat
8104
8125
  s === "lg" ? "app-tabs-lg" : "",
8105
8126
  l ? "app-tabs-fitted" : "",
8106
8127
  g
8107
- ].filter(Boolean).join(" "), L = /* @__PURE__ */ m("div", {
8128
+ ].filter(Boolean).join(" "), R = /* @__PURE__ */ m("div", {
8108
8129
  ref: y,
8109
8130
  role: "tablist",
8110
8131
  "aria-orientation": x ? "vertical" : void 0,
8111
8132
  "aria-label": h,
8112
- className: F,
8133
+ className: L,
8113
8134
  style: _,
8114
8135
  ...x ? v : void 0,
8115
- onKeyDown: N,
8136
+ onKeyDown: P,
8116
8137
  onScroll: k,
8117
8138
  children: [e.map((e) => {
8118
8139
  let r = e.key === t;
@@ -8141,7 +8162,7 @@ function Fr({ tabs: e, value: t, onChange: n, variant: r = "underline", orientat
8141
8162
  "aria-hidden": "true"
8142
8163
  })]
8143
8164
  });
8144
- return x ? L : /* @__PURE__ */ m("div", {
8165
+ return x ? R : /* @__PURE__ */ m("div", {
8145
8166
  ref: b,
8146
8167
  className: "app-tabs-wrap",
8147
8168
  ...v,
@@ -8151,19 +8172,19 @@ function Fr({ tabs: e, value: t, onChange: n, variant: r = "underline", orientat
8151
8172
  className: "app-tabs-scroll-btn prev",
8152
8173
  "aria-label": "Scroll tabs backward",
8153
8174
  tabIndex: -1,
8154
- onClick: () => P(-1),
8175
+ onClick: () => F(-1),
8155
8176
  children: /* @__PURE__ */ p(I, {
8156
8177
  name: "chevron-left",
8157
8178
  size: 16
8158
8179
  })
8159
8180
  }),
8160
- L,
8181
+ R,
8161
8182
  /* @__PURE__ */ p("button", {
8162
8183
  type: "button",
8163
8184
  className: "app-tabs-scroll-btn next",
8164
8185
  "aria-label": "Scroll tabs forward",
8165
8186
  tabIndex: -1,
8166
- onClick: () => P(1),
8187
+ onClick: () => F(1),
8167
8188
  children: /* @__PURE__ */ p(I, {
8168
8189
  name: "chevron-right",
8169
8190
  size: 16
@@ -8287,50 +8308,85 @@ var Ir = i(function({ values: e, onChange: t, placeholder: n = "Add…", name: r
8287
8308
  }) : null
8288
8309
  ]
8289
8310
  });
8290
- });
8291
- //#endregion
8292
- //#region src/components/AppTimeline.jsx
8293
- function Rr({ items: e = [], className: t = "", ...n }) {
8294
- return j("AppTimeline", n), /* @__PURE__ */ p("ol", {
8295
- className: `timeline${t ? ` ${t}` : ""}`,
8296
- ...n,
8297
- children: e.map((e, t) => /* @__PURE__ */ m("li", {
8298
- className: `timeline-item${e.tone && e.tone !== "neutral" ? ` ${e.tone}` : ""}`,
8299
- children: [/* @__PURE__ */ p("span", {
8300
- className: "timeline-dot",
8301
- children: /* @__PURE__ */ p(I, {
8302
- name: e.icon || "circle",
8303
- size: 12
8304
- })
8305
- }), /* @__PURE__ */ m("div", {
8306
- className: "timeline-body",
8307
- children: [
8308
- /* @__PURE__ */ p("div", {
8309
- className: "timeline-title",
8310
- children: e.title
8311
- }),
8312
- (e.at || e.by) && /* @__PURE__ */ m("div", {
8313
- className: "timeline-meta",
8314
- children: [e.at && /* @__PURE__ */ p("span", {
8315
- className: "timeline-at",
8316
- children: e.at
8317
- }), e.by && /* @__PURE__ */ p("span", {
8318
- className: "timeline-by",
8319
- children: e.by
8320
- })]
8321
- }),
8322
- e.note && /* @__PURE__ */ p("p", {
8323
- className: "timeline-note",
8324
- children: e.note
8325
- })
8326
- ]
8327
- })]
8328
- }, e.key ?? `${e.at}-${t}`))
8311
+ }), Rr = {
8312
+ done: "check",
8313
+ current: "clock",
8314
+ "on-hold": "lock",
8315
+ rejected: "x",
8316
+ cancelled: "minus",
8317
+ skipped: "arrow-right",
8318
+ upcoming: null
8319
+ };
8320
+ function zr({ items: e = [], variant: t = "feed", size: n, className: r = "", style: i, ...a }) {
8321
+ j("AppTimeline", a);
8322
+ 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;
8323
+ return /* @__PURE__ */ p("ol", {
8324
+ className: s,
8325
+ style: c ? {
8326
+ ...i,
8327
+ "--wui-timeline-dot": `${c}px`
8328
+ } : i,
8329
+ ...a,
8330
+ children: e.map((e, t) => {
8331
+ 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";
8332
+ return /* @__PURE__ */ m("li", {
8333
+ className: `timeline-item${r}${i}`,
8334
+ children: [/* @__PURE__ */ p("span", {
8335
+ className: "timeline-dot",
8336
+ children: a ? /* @__PURE__ */ p(I, {
8337
+ name: a,
8338
+ size: l
8339
+ }) : null
8340
+ }), /* @__PURE__ */ m("div", {
8341
+ className: "timeline-body",
8342
+ children: [
8343
+ o ? /* @__PURE__ */ m("div", {
8344
+ className: "timeline-head",
8345
+ children: [/* @__PURE__ */ p("div", {
8346
+ className: "timeline-title",
8347
+ children: e.title
8348
+ }), e.at && /* @__PURE__ */ p("span", {
8349
+ className: "timeline-at",
8350
+ children: e.at
8351
+ })]
8352
+ }) : /* @__PURE__ */ p("div", {
8353
+ className: "timeline-title",
8354
+ children: e.title
8355
+ }),
8356
+ e.description && /* @__PURE__ */ p("div", {
8357
+ className: "timeline-desc",
8358
+ children: e.description
8359
+ }),
8360
+ !o && (e.at || e.by) && /* @__PURE__ */ m("div", {
8361
+ className: "timeline-meta",
8362
+ children: [e.at && /* @__PURE__ */ p("span", {
8363
+ className: "timeline-at",
8364
+ children: e.at
8365
+ }), e.by && /* @__PURE__ */ p("span", {
8366
+ className: "timeline-by",
8367
+ children: e.by
8368
+ })]
8369
+ }),
8370
+ o && e.by && /* @__PURE__ */ p("div", {
8371
+ className: "timeline-meta",
8372
+ children: /* @__PURE__ */ p("span", {
8373
+ className: "timeline-by",
8374
+ children: e.by
8375
+ })
8376
+ }),
8377
+ e.note && /* @__PURE__ */ p("p", {
8378
+ className: "timeline-note",
8379
+ children: e.note
8380
+ })
8381
+ ]
8382
+ })]
8383
+ }, e.key ?? `${e.at}-${t}`);
8384
+ })
8329
8385
  });
8330
8386
  }
8331
8387
  //#endregion
8332
8388
  //#region src/components/AppTimePicker.jsx
8333
- var zr = 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) {
8389
+ 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
8390
  j("AppTimePicker", b);
8335
8391
  let S = s(), C = _ || o || S, { setRef: w } = Q({
8336
8392
  ref: x,
@@ -8375,32 +8431,32 @@ var zr = i(function({ value: e, onChange: t, label: n, required: r = !1, hint: i
8375
8431
  })
8376
8432
  ]
8377
8433
  });
8378
- }), Br = 6, $ = [], Vr = /* @__PURE__ */ new Set(), Hr = /* @__PURE__ */ new Map(), Ur = 0;
8379
- function Wr() {
8380
- for (let e of Vr) e($);
8381
- }
8382
- function Gr(e) {
8383
- let t = Hr.get(e);
8384
- t !== void 0 && (clearTimeout(t), Hr.delete(e));
8434
+ }), Vr = 6, $ = [], Hr = /* @__PURE__ */ new Set(), Ur = /* @__PURE__ */ new Map(), Wr = 0;
8435
+ function Gr() {
8436
+ for (let e of Hr) e($);
8385
8437
  }
8386
8438
  function Kr(e) {
8387
- if (e.length <= Br) return e;
8439
+ let t = Ur.get(e);
8440
+ t !== void 0 && (clearTimeout(t), Ur.delete(e));
8441
+ }
8442
+ function qr(e) {
8443
+ if (e.length <= Vr) return e;
8388
8444
  let t = [...e];
8389
- for (; t.length > Br;) {
8445
+ for (; t.length > Vr;) {
8390
8446
  let e = t.findIndex((e) => e.duration !== 0);
8391
8447
  t.splice(e === -1 ? 0 : e, 1);
8392
8448
  }
8393
8449
  return t;
8394
8450
  }
8395
- function qr(e) {
8396
- return Vr.add(e), e($), () => Vr.delete(e);
8451
+ function Jr(e) {
8452
+ return Hr.add(e), e($), () => Hr.delete(e);
8397
8453
  }
8398
- function Jr(e, t, n = {}) {
8454
+ function Yr(e, t, n = {}) {
8399
8455
  let r = n.id, i = r || typeof e != "string" ? void 0 : `${t}:${e}`;
8400
8456
  if (r) {
8401
8457
  let i = $.find((e) => e.externalId === r);
8402
8458
  if (i) {
8403
- Gr(i.id);
8459
+ Kr(i.id);
8404
8460
  let r = n.duration === void 0 ? 5e3 : n.duration;
8405
8461
  $ = $.map((a) => a.id === i.id ? {
8406
8462
  ...a,
@@ -8413,12 +8469,12 @@ function Jr(e, t, n = {}) {
8413
8469
  shape: n.shape,
8414
8470
  surface: n.surface,
8415
8471
  progress: n.progress
8416
- } : a), Wr(), r > 0 && Hr.set(i.id, setTimeout(() => Yr(i.id), r));
8472
+ } : a), Gr(), r > 0 && Ur.set(i.id, setTimeout(() => Xr(i.id), r));
8417
8473
  return;
8418
8474
  }
8419
8475
  } else if (i && $.some((e) => e.key === i)) return;
8420
- let a = ++Ur, o = n.duration === void 0 ? 5e3 : n.duration;
8421
- $ = Kr([...$, {
8476
+ let a = ++Wr, o = n.duration === void 0 ? 5e3 : n.duration;
8477
+ $ = qr([...$, {
8422
8478
  id: a,
8423
8479
  externalId: r,
8424
8480
  message: e,
@@ -8431,19 +8487,19 @@ function Jr(e, t, n = {}) {
8431
8487
  surface: n.surface,
8432
8488
  progress: n.progress,
8433
8489
  key: i
8434
- }]), Wr(), o > 0 && Hr.set(a, setTimeout(() => Yr(a), o));
8490
+ }]), Gr(), o > 0 && Ur.set(a, setTimeout(() => Xr(a), o));
8435
8491
  }
8436
- function Yr(e) {
8437
- Gr(e);
8492
+ function Xr(e) {
8493
+ Kr(e);
8438
8494
  let t = $.filter((t) => t.id !== e);
8439
- t.length !== $.length && ($ = t, Wr());
8495
+ t.length !== $.length && ($ = t, Gr());
8440
8496
  }
8441
- function Xr() {
8442
- $.length !== 0 && ($ = [], Wr());
8497
+ function Zr() {
8498
+ $.length !== 0 && ($ = [], Gr());
8443
8499
  }
8444
8500
  //#endregion
8445
8501
  //#region src/components/AppToast.jsx
8446
- var Zr = {
8502
+ var Qr = {
8447
8503
  success: {
8448
8504
  icon: "check-circle-fill",
8449
8505
  assertive: !1
@@ -8460,7 +8516,7 @@ var Zr = {
8460
8516
  icon: "x-circle-fill",
8461
8517
  assertive: !0
8462
8518
  }
8463
- }, Qr = {
8519
+ }, $r = {
8464
8520
  "top-start": "top-0 start-0",
8465
8521
  "top-center": "top-0 start-50 translate-middle-x",
8466
8522
  "top-end": "top-0 end-0",
@@ -8468,22 +8524,22 @@ var Zr = {
8468
8524
  "bottom-start": "bottom-0 start-0",
8469
8525
  "bottom-center": "bottom-0 start-50 translate-middle-x",
8470
8526
  "bottom-end": "bottom-0 end-0"
8471
- }, $r = 64, ei = /* @__PURE__ */ new Set([
8527
+ }, ei = 64, ti = /* @__PURE__ */ new Set([
8472
8528
  "rise",
8473
8529
  "organic",
8474
8530
  "jelly",
8475
8531
  "spring"
8476
- ]), ti = /* @__PURE__ */ new Set([
8532
+ ]), ni = /* @__PURE__ */ new Set([
8477
8533
  "rounded",
8478
8534
  "pill",
8479
8535
  "sharp"
8480
- ]), ni = /* @__PURE__ */ new Set(["auto", "inverse"]);
8481
- function ri({ position: e = "bottom-end", maxVisible: t = 4, animation: n = "rise", shape: r = "rounded", surface: i = "auto" }) {
8536
+ ]), ri = /* @__PURE__ */ new Set(["auto", "inverse"]);
8537
+ function ii({ position: e = "bottom-end", maxVisible: t = 4, animation: n = "rise", shape: r = "rounded", surface: i = "auto" }) {
8482
8538
  let [a, s] = d([]);
8483
- o(() => qr(s), []);
8539
+ o(() => Jr(s), []);
8484
8540
  let c = Math.max(0, a.length - t), l = c ? a.slice(c) : a;
8485
8541
  return /* @__PURE__ */ m("div", {
8486
- className: `wui-toast-container toast-container position-fixed ${Qr[e] ?? Qr["bottom-end"]} p-3`,
8542
+ className: `wui-toast-container toast-container position-fixed ${$r[e] ?? $r["bottom-end"]} p-3`,
8487
8543
  children: [c > 0 && /* @__PURE__ */ m("div", {
8488
8544
  className: "wui-toast-more",
8489
8545
  "aria-hidden": "true",
@@ -8492,7 +8548,7 @@ function ri({ position: e = "bottom-end", maxVisible: t = 4, animation: n = "ris
8492
8548
  c,
8493
8549
  " more"
8494
8550
  ]
8495
- }), l.map((e) => /* @__PURE__ */ p(ii, {
8551
+ }), l.map((e) => /* @__PURE__ */ p(ai, {
8496
8552
  toast: e,
8497
8553
  defaultAnimation: n,
8498
8554
  defaultShape: r,
@@ -8500,8 +8556,8 @@ function ri({ position: e = "bottom-end", maxVisible: t = 4, animation: n = "ris
8500
8556
  }, e.id))]
8501
8557
  });
8502
8558
  }
8503
- function ii({ toast: e, defaultAnimation: t = "rise", defaultShape: n = "rounded", defaultSurface: r = "auto" }) {
8504
- let i = Zr[e.variant] ?? Zr.success, a = ei.has(e.animation) ? e.animation : t, o = ti.has(e.shape) ? e.shape : n, s = ni.has(e.surface) ? e.surface : r, c = (a !== "rise" && ei.has(a) ? ` wui-toast--anim-${a}` : "") + (o !== "rounded" && ti.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 = () => Yr(e.id), b = (e) => {
8559
+ function ai({ toast: e, defaultAnimation: t = "rise", defaultShape: n = "rounded", defaultSurface: r = "auto" }) {
8560
+ 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
8561
  e.button !== 0 || e.target.closest("button") || (v.current = e.clientX, _(!0), e.currentTarget.setPointerCapture?.(e.pointerId));
8506
8562
  }, x = (e) => {
8507
8563
  v.current !== null && h(e.clientX - v.current);
@@ -8510,7 +8566,7 @@ function ii({ toast: e, defaultAnimation: t = "rise", defaultShape: n = "rounded
8510
8566
  }, C = (e) => {
8511
8567
  if (v.current === null) return;
8512
8568
  let t = e.clientX - v.current;
8513
- if (Math.abs(t) > $r) {
8569
+ if (Math.abs(t) > ei) {
8514
8570
  y();
8515
8571
  return;
8516
8572
  }
@@ -8593,7 +8649,7 @@ function ii({ toast: e, defaultAnimation: t = "rise", defaultShape: n = "rounded
8593
8649
  }
8594
8650
  //#endregion
8595
8651
  //#region src/components/AppToolbar.jsx
8596
- function ai({ items: e = [], actions: t = [], value: n, defaultValue: r, onSelect: i, label: a, name: o, disabled: c = !1, className: l = "", ...u }) {
8652
+ function oi({ items: e = [], actions: t = [], value: n, defaultValue: r, onSelect: i, label: a, name: o, disabled: c = !1, className: l = "", ...u }) {
8597
8653
  j("AppToolbar", u);
8598
8654
  let f = s(), h = o || f, [g, _] = d(r), v = n === void 0 ? g : n;
8599
8655
  return /* @__PURE__ */ m("div", {
@@ -8651,13 +8707,13 @@ function ai({ items: e = [], actions: t = [], value: n, defaultValue: r, onSelec
8651
8707
  }
8652
8708
  //#endregion
8653
8709
  //#region src/components/AppTooltip.jsx
8654
- var oi = {
8710
+ var si = {
8655
8711
  start: "left",
8656
8712
  end: "right",
8657
8713
  top: "top",
8658
8714
  bottom: "bottom"
8659
8715
  };
8660
- function si({ content: e, children: t, placement: r = "top", tone: i = "default", size: a = "md", className: o = "", ...c }) {
8716
+ function ci({ content: e, children: t, placement: r = "top", tone: i = "default", size: a = "md", className: o = "", ...c }) {
8661
8717
  j("AppTooltip", c);
8662
8718
  let l = /* @__PURE__ */ p(E, {
8663
8719
  id: s(),
@@ -8671,14 +8727,14 @@ function si({ content: e, children: t, placement: r = "top", tone: i = "default"
8671
8727
  });
8672
8728
  return /* @__PURE__ */ p(w, {
8673
8729
  trigger: ["hover", "focus"],
8674
- placement: oi[r] || r,
8730
+ placement: si[r] || r,
8675
8731
  overlay: l,
8676
8732
  children: n(t, c)
8677
8733
  });
8678
8734
  }
8679
8735
  //#endregion
8680
8736
  //#region src/components/AppWizard.jsx
8681
- var ci = 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) {
8737
+ 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
8738
  j("AppWizard", E);
8683
8739
  let O = u(null), k = (e) => {
8684
8740
  O.current = e, typeof D == "function" ? D(e) : D && (D.current = e);
@@ -8733,38 +8789,38 @@ var ci = i(function({ steps: t = [], children: n, active: r, defaultActive: i =
8733
8789
  });
8734
8790
  //#endregion
8735
8791
  //#region src/components/AppWorkspaceSwitcher.jsx
8736
- function li({ 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, ariaLabel: _, ...v }) {
8737
- let { onToggle: y, ...x } = v;
8738
- j("AppWorkspaceSwitcher", x);
8739
- let [S, C] = d(""), [w, T] = d(!1), E = u(null), D = e.find((e) => e.id === t) ?? e[0], O = l(() => {
8740
- let t = S.trim().toLowerCase();
8792
+ 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 }) {
8793
+ let { onToggle: x, ...S } = y;
8794
+ j("AppWorkspaceSwitcher", S);
8795
+ let [C, w] = d(""), [T, E] = d(!1), D = u(null), O = e.find((e) => e.id === t) ?? e[0], k = l(() => {
8796
+ let t = C.trim().toLowerCase();
8741
8797
  return !s || !t ? e : e.filter((e) => String(e.name ?? "").toLowerCase().includes(t));
8742
8798
  }, [
8743
8799
  e,
8744
- S,
8800
+ C,
8745
8801
  s
8746
8802
  ]);
8747
8803
  o(() => {
8748
- w && s && E.current?.focus();
8749
- }, [w, s]), o(() => {
8804
+ T && s && D.current?.focus();
8805
+ }, [T, s]), o(() => {
8750
8806
  if (!s) return;
8751
- let e = E.current;
8807
+ let e = D.current;
8752
8808
  if (!e) return;
8753
8809
  let t = (e) => e.stopPropagation();
8754
8810
  return e.addEventListener("keydown", t), () => e.removeEventListener("keydown", t);
8755
8811
  }, [s]);
8756
- let k = D?.name ?? "", A = _ ?? `Workspace ${k}`;
8812
+ let A = O?.name ?? "", M = v ?? `Workspace ${A}`;
8757
8813
  return /* @__PURE__ */ m(b, {
8758
- className: "workspace-switcher",
8814
+ className: `workspace-switcher${_ === "sm" ? " workspace-switcher-sm" : ""}${_ === "lg" ? " workspace-switcher-lg" : ""}`,
8759
8815
  onToggle: (e, t) => {
8760
- T(e), y?.(e, t);
8816
+ E(e), x?.(e, t);
8761
8817
  },
8762
- ...x,
8818
+ ...S,
8763
8819
  children: [/* @__PURE__ */ p(b.Toggle, {
8764
- as: pi,
8820
+ as: mi,
8765
8821
  compact: g,
8766
- tenant: D,
8767
- "aria-label": A
8822
+ tenant: O,
8823
+ "aria-label": M
8768
8824
  }), /* @__PURE__ */ m(b.Menu, {
8769
8825
  className: "workspace-switcher-menu",
8770
8826
  renderOnMount: !0,
@@ -8779,24 +8835,24 @@ function li({ tenants: e = [], currentId: t, onSelect: n, menuLabel: r, footerAc
8779
8835
  name: "search",
8780
8836
  size: 14
8781
8837
  }), /* @__PURE__ */ p("input", {
8782
- ref: E,
8838
+ ref: D,
8783
8839
  type: "search",
8784
8840
  className: "workspace-switcher-search-input",
8785
8841
  placeholder: "Search workspaces",
8786
8842
  "aria-label": "Search workspaces",
8787
- value: S,
8788
- onChange: (e) => C(e.target.value)
8843
+ value: C,
8844
+ onChange: (e) => w(e.target.value)
8789
8845
  })]
8790
8846
  }) : null,
8791
8847
  /* @__PURE__ */ m("div", {
8792
8848
  className: "workspace-switcher-list",
8793
- children: [O.map((e) => /* @__PURE__ */ m(b.Item, {
8849
+ children: [k.map((e) => /* @__PURE__ */ m(b.Item, {
8794
8850
  as: "button",
8795
8851
  type: "button",
8796
- className: `workspace-switcher-option${e.id === D?.id ? " is-active" : ""}`,
8852
+ className: `workspace-switcher-option${e.id === O?.id ? " is-active" : ""}`,
8797
8853
  onClick: () => n?.(e),
8798
8854
  children: [
8799
- /* @__PURE__ */ p(di, { tenant: e }),
8855
+ /* @__PURE__ */ p(fi, { tenant: e }),
8800
8856
  /* @__PURE__ */ p("span", {
8801
8857
  className: "workspace-switcher-option-name",
8802
8858
  children: e.name
@@ -8805,13 +8861,13 @@ function li({ tenants: e = [], currentId: t, onSelect: n, menuLabel: r, footerAc
8805
8861
  className: "workspace-switcher-badge",
8806
8862
  children: e.badge
8807
8863
  }) : null,
8808
- e.id === D?.id ? /* @__PURE__ */ p(I, {
8864
+ e.id === O?.id ? /* @__PURE__ */ p(I, {
8809
8865
  name: "check",
8810
8866
  size: 16,
8811
8867
  className: "workspace-switcher-tick"
8812
8868
  }) : null
8813
8869
  ]
8814
- }, e.id)), O.length === 0 ? /* @__PURE__ */ p("div", {
8870
+ }, e.id)), k.length === 0 ? /* @__PURE__ */ p("div", {
8815
8871
  className: "workspace-switcher-empty",
8816
8872
  children: "No workspaces match."
8817
8873
  }) : null]
@@ -8828,17 +8884,17 @@ function li({ tenants: e = [], currentId: t, onSelect: n, menuLabel: r, footerAc
8828
8884
  }) : null,
8829
8885
  i ? /* @__PURE__ */ p("div", {
8830
8886
  className: "workspace-switcher-footer",
8831
- children: fi(i, a)
8887
+ children: pi(i, a)
8832
8888
  }) : null
8833
8889
  ]
8834
8890
  })]
8835
8891
  });
8836
8892
  }
8837
- function ui(e) {
8893
+ function di(e) {
8838
8894
  let t = String(e ?? "").trim().split(/\s+/).filter(Boolean);
8839
8895
  return t.length === 0 ? "" : (t[0][0] + (t.length > 1 ? t[t.length - 1][0] : "")).toUpperCase();
8840
8896
  }
8841
- function di({ tenant: e }) {
8897
+ function fi({ tenant: e }) {
8842
8898
  return e?.logoUrl ? /* @__PURE__ */ p("img", {
8843
8899
  className: "workspace-switcher-mark",
8844
8900
  src: e.logoUrl,
@@ -8846,10 +8902,10 @@ function di({ tenant: e }) {
8846
8902
  loading: "lazy"
8847
8903
  }) : /* @__PURE__ */ p("span", {
8848
8904
  className: "workspace-switcher-mark",
8849
- children: ui(e?.name)
8905
+ children: di(e?.name)
8850
8906
  });
8851
8907
  }
8852
- function fi(e, t) {
8908
+ function pi(e, t) {
8853
8909
  if (typeof e != "object" || !e || !("label" in e)) return e;
8854
8910
  let { label: n, icon: r, href: i } = e;
8855
8911
  return /* @__PURE__ */ m(i ? t ?? "a" : "button", {
@@ -8861,7 +8917,7 @@ function fi(e, t) {
8861
8917
  }) : null, n]
8862
8918
  });
8863
8919
  }
8864
- var pi = i(function({ compact: e, tenant: t, "aria-label": n, className: r, ...i }, a) {
8920
+ var mi = i(function({ compact: e, tenant: t, "aria-label": n, className: r, ...i }, a) {
8865
8921
  return /* @__PURE__ */ m("button", {
8866
8922
  ref: a,
8867
8923
  type: "button",
@@ -8869,7 +8925,7 @@ var pi = i(function({ compact: e, tenant: t, "aria-label": n, className: r, ...i
8869
8925
  "aria-haspopup": "true",
8870
8926
  "aria-label": n,
8871
8927
  ...i,
8872
- children: [/* @__PURE__ */ p(di, { tenant: t }), e ? null : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("span", {
8928
+ children: [/* @__PURE__ */ p(fi, { tenant: t }), e ? null : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("span", {
8873
8929
  className: "workspace-switcher-trigger-name",
8874
8930
  children: t?.name
8875
8931
  }), /* @__PURE__ */ p(I, {
@@ -8881,36 +8937,36 @@ var pi = i(function({ compact: e, tenant: t, "aria-label": n, className: r, ...i
8881
8937
  });
8882
8938
  //#endregion
8883
8939
  //#region src/components/toast.js
8884
- function mi() {
8885
- Xr();
8940
+ function hi() {
8941
+ Zr();
8886
8942
  }
8887
- var hi = /* @__PURE__ */ new Set([
8943
+ var gi = /* @__PURE__ */ new Set([
8888
8944
  "success",
8889
8945
  "info",
8890
8946
  "warning",
8891
8947
  "error"
8892
8948
  ]);
8893
- function gi(e, t = "info") {
8949
+ function _i(e, t = "info") {
8894
8950
  let n = "info", r = {};
8895
- typeof t == "string" ? n = hi.has(t) ? t : "info" : typeof t == "object" && t && (r = t, n = hi.has(r.variant) ? r.variant : "info"), Jr(e, n, r);
8951
+ 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
8952
  }
8897
- function _i(e, t = {}) {
8898
- Jr(e, "error", t);
8953
+ function vi(e, t = {}) {
8954
+ Yr(e, "error", t);
8899
8955
  }
8900
- gi.promise = (e, t, n = {}) => {
8956
+ _i.promise = (e, t, n = {}) => {
8901
8957
  let r = n.id || `promise-${Date.now()}-${Math.random()}`;
8902
- return gi(t.loading || "Loading...", {
8958
+ return _i(t.loading || "Loading...", {
8903
8959
  ...n,
8904
8960
  variant: "info",
8905
8961
  id: r,
8906
8962
  duration: 0
8907
- }), e.then((e) => (gi((typeof t.success == "function" ? t.success(e) : t.success) || "Done", {
8963
+ }), e.then((e) => (_i((typeof t.success == "function" ? t.success(e) : t.success) || "Done", {
8908
8964
  ...n,
8909
8965
  variant: "success",
8910
8966
  id: r,
8911
8967
  duration: n.duration === void 0 ? 5e3 : n.duration
8912
8968
  }), e)).catch((e) => {
8913
- throw gi((typeof t.error == "function" ? t.error(e) : t.error) || "Error", {
8969
+ throw _i((typeof t.error == "function" ? t.error(e) : t.error) || "Error", {
8914
8970
  ...n,
8915
8971
  variant: "error",
8916
8972
  id: r,
@@ -8920,7 +8976,7 @@ gi.promise = (e, t, n = {}) => {
8920
8976
  };
8921
8977
  //#endregion
8922
8978
  //#region src/lib/usePagination.js
8923
- function vi(e, t = 10) {
8979
+ function yi(e, t = 10) {
8924
8980
  let [n, r] = d(1), [i, a] = d(t), s = e.length, c = Math.max(1, Math.ceil(s / i));
8925
8981
  o(() => {
8926
8982
  n > c && r(c);
@@ -8946,4 +9002,4 @@ function vi(e, t = 10) {
8946
9002
  };
8947
9003
  }
8948
9004
  //#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, zr as AppTimePicker, Rr as AppTimeline, ri as AppToast, ri as AppToastContainer, ai as AppToolbar, si as AppTooltip, ci as AppWizard, li as AppWorkspaceSwitcher, I as Icon, dn as MODAL_ICONS, Z as RequiredMark, mi as dismissAll, _i as errorToast, N as iconNames, F as registerIcons, gi as toast, vi as usePagination };
9005
+ 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.0",
3
+ "version": "0.8.2",
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.0",
32
- "@webority/ui-elements": "^0.8.0"
31
+ "@webority/theme": "^0.8.2",
32
+ "@webority/ui-elements": "^0.8.2"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "bootstrap": "5.3.3",