@leonardaustin/ui 0.27.0 → 0.29.0

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.
Files changed (56) hide show
  1. package/dist/components/charts/AreaChart.js +113 -114
  2. package/dist/components/charts/BarChart.d.ts +4 -2
  3. package/dist/components/charts/BarChart.js +69 -49
  4. package/dist/components/charts/Heatmap.d.ts +20 -0
  5. package/dist/components/charts/Heatmap.js +46 -0
  6. package/dist/components/charts/StackedBarChart.d.ts +3 -1
  7. package/dist/components/charts/StackedBarChart.js +103 -95
  8. package/dist/components/charts/VerticalBarChart.d.ts +3 -1
  9. package/dist/components/charts/VerticalBarChart.js +94 -83
  10. package/dist/components/charts/barChartUtils.d.ts +16 -0
  11. package/dist/components/charts/barChartUtils.js +24 -0
  12. package/dist/components/charts/chartUtils.d.ts +2 -0
  13. package/dist/components/charts/chartUtils.js +14 -9
  14. package/dist/components/charts/useChartSize.d.ts +13 -0
  15. package/dist/components/charts/useChartSize.js +27 -0
  16. package/dist/components/tables/Pagination.d.ts +3 -1
  17. package/dist/components/tables/Pagination.js +12 -12
  18. package/dist/components/tables/ResourceTable.d.ts +5 -0
  19. package/dist/components/tables/ResourceTable.js +11 -9
  20. package/dist/components/tables/Table.d.ts +22 -3
  21. package/dist/components/tables/Table.js +41 -35
  22. package/dist/components/ui/ActionLink.d.ts +14 -0
  23. package/dist/components/ui/ActionLink.js +12 -0
  24. package/dist/components/ui/DateRangePicker.js +107 -76
  25. package/dist/components/ui/EmptyState.d.ts +8 -6
  26. package/dist/components/ui/EmptyState.js +11 -10
  27. package/dist/components/ui/ErrorBoundary.d.ts +6 -0
  28. package/dist/components/ui/ErrorBoundary.js +11 -5
  29. package/dist/components/ui/Grid.d.ts +1 -1
  30. package/dist/components/ui/Icon.d.ts +91 -0
  31. package/dist/components/ui/Icon.js +98 -0
  32. package/dist/components/ui/Inline.d.ts +1 -1
  33. package/dist/components/ui/LoadingSpinner.d.ts +7 -3
  34. package/dist/components/ui/LoadingSpinner.js +19 -11
  35. package/dist/components/ui/MainAsideLayout.d.ts +10 -0
  36. package/dist/components/ui/MainAsideLayout.js +18 -0
  37. package/dist/components/ui/Meter.d.ts +11 -0
  38. package/dist/components/ui/Meter.js +7 -0
  39. package/dist/components/ui/MetricCard.d.ts +11 -8
  40. package/dist/components/ui/MetricCard.js +18 -15
  41. package/dist/components/ui/PaginationBar.d.ts +3 -3
  42. package/dist/components/ui/PaginationBar.js +35 -33
  43. package/dist/components/ui/SideSheet.d.ts +4 -2
  44. package/dist/components/ui/SideSheet.js +64 -52
  45. package/dist/components/ui/Stack.d.ts +1 -1
  46. package/dist/components/ui/Tabs.d.ts +5 -1
  47. package/dist/components/ui/Tabs.js +23 -21
  48. package/dist/components/ui/Text.d.ts +19 -0
  49. package/dist/components/ui/Text.js +20 -0
  50. package/dist/components/ui/Toolbar.js +13 -13
  51. package/dist/core.css +122 -0
  52. package/dist/hooks/useFocusTrap.js +1 -1
  53. package/dist/index.d.ts +6 -0
  54. package/dist/index.js +135 -129
  55. package/dist/styles.css +123 -0
  56. package/package.json +1 -1
@@ -5,127 +5,158 @@ import { useControllableState as r } from "../../hooks/useControllableState.js";
5
5
  import { usePopover as i } from "../../hooks/usePopover.js";
6
6
  import { formatPickerDate as a } from "../../lib/calendar.js";
7
7
  import { CalendarGrid as o } from "./CalendarGrid.js";
8
- import { useMemo as s, useState as c } from "react";
9
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
10
- import { Calendar as d } from "lucide-react";
8
+ import { useLayoutEffect as s, useMemo as c, useRef as l, useState as u } from "react";
9
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
10
+ import { Calendar as p } from "lucide-react";
11
11
  //#region src/components/ui/DateRangePicker.tsx
12
- var f = {
12
+ var ee = {
13
13
  start: null,
14
14
  end: null
15
15
  };
16
- function p({ controlSize: p, label: m, value: h, defaultValue: g = f, onValueChange: _, placeholder: v = "Select date range...", format: y = a, ref: b, className: x, ...S }) {
17
- let C = n(p), [w, T] = r({
18
- value: h,
19
- defaultValue: g,
20
- onChange: _
21
- }), { open: E, show: D, close: O, rootRef: k, anchorRef: ee, triggerRef: te, popupRef: A, labelId: j, popupId: M, triggerAria: N } = i({
16
+ function m({ controlSize: m, label: h, value: g, defaultValue: _ = ee, onValueChange: v, placeholder: y = "Select date range...", format: b = a, ref: x, className: te, ...ne }) {
17
+ let re = n(m), [S, ie] = r({
18
+ value: g,
19
+ defaultValue: _,
20
+ onChange: v
21
+ }), { open: C, show: ae, close: w, rootRef: T, anchorRef: oe, triggerRef: E, popupRef: D, labelId: O, popupId: k, triggerAria: A } = i({
22
22
  haspopup: "dialog",
23
- labelled: !!m
24
- }), P = s(() => t(b, k), [b, k]), F = /* @__PURE__ */ new Date(), [I, L] = c(w.start?.getFullYear() ?? F.getFullYear()), [R, z] = c(w.start?.getMonth() ?? F.getMonth()), [B, V] = c(null), [H, U] = c("start"), [W, G] = c(w.start), [K, q] = c(w.end), J = R === 11 ? I + 1 : I, Y = R === 11 ? 0 : R + 1;
25
- function X() {
26
- if (E) {
27
- O("toggle");
23
+ labelled: !!h
24
+ }), j = c(() => t(x, T), [x, T]), M = l(null), N = l(null), [P, F] = u(!0), I = /* @__PURE__ */ new Date(), [L, R] = u(S.start?.getFullYear() ?? I.getFullYear()), [z, B] = u(S.start?.getMonth() ?? I.getMonth()), V = z === 11 ? L + 1 : L, H = z === 11 ? 0 : z + 1;
25
+ s(() => {
26
+ let e = D.current, t = M.current, n = t?.parentElement, r = e?.ownerDocument.defaultView;
27
+ if (!C || !e || !t || !n || !r) return;
28
+ let i = e.ownerDocument, a = () => {
29
+ let a = parseFloat(r.getComputedStyle(n).columnGap), o = e.offsetWidth - n.offsetWidth, s = 2 * t.offsetWidth + a + o + 16 > i.documentElement.clientWidth, c = i.activeElement;
30
+ if (s && e.contains(c) && !t.contains(c)) {
31
+ let e = c?.getAttribute("data-day");
32
+ if (e) N.current = e, R(V), B(H);
33
+ else {
34
+ let e = c?.getAttribute("aria-label");
35
+ Array.from(t.querySelectorAll("button")).find((t) => t.getAttribute("aria-label") === e)?.focus({ preventScroll: !0 });
36
+ }
37
+ }
38
+ F(s);
39
+ }, o = typeof ResizeObserver > "u" ? null : new ResizeObserver(a);
40
+ o?.observe(e);
41
+ let s = o ? 0 : r.requestAnimationFrame(a);
42
+ return r.addEventListener("resize", a), () => {
43
+ o?.disconnect(), r.cancelAnimationFrame(s), r.removeEventListener("resize", a);
44
+ };
45
+ }, [
46
+ C,
47
+ D,
48
+ H,
49
+ V
50
+ ]), s(() => {
51
+ let e = N.current;
52
+ !P || !e || (N.current = null, M.current?.querySelector(`[data-day="${e}"]`)?.focus({ preventScroll: !0 }));
53
+ }, [P]);
54
+ let [U, W] = u(null), [G, K] = u("start"), [q, J] = u(S.start), [Y, X] = u(S.end);
55
+ function se() {
56
+ if (C) {
57
+ w("toggle");
28
58
  return;
29
59
  }
30
- G(w.start), q(w.end), U("start"), w.start && (L(w.start.getFullYear()), z(w.start.getMonth())), D();
60
+ J(S.start), X(S.end), K("start"), F(!0), S.start && (R(S.start.getFullYear()), B(S.start.getMonth())), ae();
31
61
  }
32
62
  function Z(e) {
33
- H === "start" ? (G(e), q(null), U("end")) : (W && e < W ? (q(W), G(e)) : q(e), U("start"), T({
34
- start: W && e < W ? e : W,
35
- end: W && e < W ? W : e
36
- }), O("select"));
63
+ G === "start" ? (J(e), X(null), K("end")) : (q && e < q ? (X(q), J(e)) : X(e), K("start"), ie({
64
+ start: q && e < q ? e : q,
65
+ end: q && e < q ? q : e
66
+ }), w("select"));
37
67
  }
38
- function ne() {
39
- R === 0 ? (L(I - 1), z(11)) : z(R - 1);
68
+ function ce() {
69
+ z === 0 ? (R(L - 1), B(11)) : B(z - 1);
40
70
  }
41
- function re() {
42
- R === 11 ? (L(I + 1), z(0)) : z(R + 1);
71
+ function le() {
72
+ z === 11 ? (R(L + 1), B(0)) : B(z + 1);
43
73
  }
44
- let { start: Q, end: $ } = w;
45
- return /* @__PURE__ */ u("div", {
46
- ...S,
47
- ref: P,
48
- className: e("flex flex-col gap-1.5", x),
49
- children: [m && /* @__PURE__ */ l("span", {
50
- id: j,
74
+ let { start: Q, end: $ } = S;
75
+ return /* @__PURE__ */ f("div", {
76
+ ...ne,
77
+ ref: j,
78
+ className: e("flex flex-col gap-1.5", te),
79
+ children: [h && /* @__PURE__ */ d("span", {
80
+ id: O,
51
81
  className: "ui-field-label text-xs font-medium",
52
- children: m
53
- }), /* @__PURE__ */ u("div", {
82
+ children: h
83
+ }), /* @__PURE__ */ f("div", {
54
84
  className: "relative",
55
- ref: ee,
85
+ ref: oe,
56
86
  children: [
57
- /* @__PURE__ */ l("button", {
87
+ /* @__PURE__ */ d("button", {
58
88
  type: "button",
59
- ref: te,
60
- ...N,
61
- onClick: X,
62
- "data-control-size": C,
89
+ ref: E,
90
+ ...A,
91
+ onClick: se,
92
+ "data-control-size": re,
63
93
  className: e("ui-sized-control flex h-7 w-full cursor-pointer items-center rounded-md text-xs", "bg-bg-secondary border-border text-text-primary border", "hover:bg-bg-hover hover:border-border-strong", "transition-colors duration-[100ms]", "px-2 pr-7"),
64
- children: Q ? $ ? `${y(Q)} – ${y($)}` : y(Q) : /* @__PURE__ */ l("span", {
94
+ children: Q ? $ ? `${b(Q)} – ${b($)}` : b(Q) : /* @__PURE__ */ d("span", {
65
95
  className: "text-text-placeholder",
66
- children: v
96
+ children: y
67
97
  })
68
98
  }),
69
- /* @__PURE__ */ l(d, { className: "text-text-tertiary pointer-events-none absolute top-1/2 right-2 h-3 w-3 -translate-y-1/2" }),
70
- E && /* @__PURE__ */ u("div", {
71
- ref: A,
72
- id: M,
99
+ /* @__PURE__ */ d(p, { className: "text-text-tertiary pointer-events-none absolute top-1/2 right-2 h-3 w-3 -translate-y-1/2" }),
100
+ C && /* @__PURE__ */ f("div", {
101
+ ref: D,
102
+ id: k,
73
103
  role: "dialog",
74
104
  "aria-label": "Choose date range",
75
105
  className: e("ui-glass ui-glass-popover bg-bg-tertiary border-border-strong animate-scale-in fixed top-0 left-0 z-[100] rounded-md border shadow-lg", "p-3"),
76
- children: [/* @__PURE__ */ u("div", {
106
+ children: [/* @__PURE__ */ f("div", {
77
107
  className: "mb-2 flex items-center justify-between",
78
108
  children: [
79
- /* @__PURE__ */ l("button", {
109
+ /* @__PURE__ */ d("button", {
80
110
  type: "button",
81
- onClick: ne,
111
+ onClick: ce,
82
112
  "aria-label": "Previous month",
83
- className: "text-text-tertiary hover:text-text-primary hover:bg-bg-hover flex h-6 w-6 cursor-pointer items-center justify-center rounded-md transition-colors duration-[100ms]",
84
- children: /* @__PURE__ */ l("span", {
113
+ className: e("text-text-tertiary hover:text-text-primary hover:bg-bg-hover h-6 w-6 cursor-pointer items-center justify-center rounded-md transition-colors duration-[100ms]", P ? "hidden" : "flex"),
114
+ children: /* @__PURE__ */ d("span", {
85
115
  className: "text-xs",
86
116
  children: "‹"
87
117
  })
88
118
  }),
89
- /* @__PURE__ */ l("span", {
90
- className: "text-text-tertiary text-2xs",
119
+ /* @__PURE__ */ d("span", {
120
+ className: "text-text-tertiary text-2xs flex-1 text-center",
91
121
  "aria-live": "polite",
92
- children: H === "start" ? "Select start date" : "Select end date"
122
+ children: G === "start" ? "Select start date" : "Select end date"
93
123
  }),
94
- /* @__PURE__ */ l("button", {
124
+ /* @__PURE__ */ d("button", {
95
125
  type: "button",
96
- onClick: re,
126
+ onClick: le,
97
127
  "aria-label": "Next month",
98
- className: "text-text-tertiary hover:text-text-primary hover:bg-bg-hover flex h-6 w-6 cursor-pointer items-center justify-center rounded-md transition-colors duration-[100ms]",
99
- children: /* @__PURE__ */ l("span", {
128
+ className: e("text-text-tertiary hover:text-text-primary hover:bg-bg-hover h-6 w-6 cursor-pointer items-center justify-center rounded-md transition-colors duration-[100ms]", P ? "hidden" : "flex"),
129
+ children: /* @__PURE__ */ d("span", {
100
130
  className: "text-xs",
101
131
  children: "›"
102
132
  })
103
133
  })
104
134
  ]
105
- }), /* @__PURE__ */ u("div", {
106
- className: "flex gap-4",
107
- children: [/* @__PURE__ */ l(o, {
108
- year: I,
109
- month: R,
110
- rangeStart: W,
111
- rangeEnd: K,
112
- hoverDate: H === "end" ? B : null,
135
+ }), /* @__PURE__ */ f("div", {
136
+ className: "flex w-max gap-4",
137
+ children: [/* @__PURE__ */ d(o, {
138
+ ref: M,
139
+ year: L,
140
+ month: z,
141
+ rangeStart: q,
142
+ rangeEnd: Y,
143
+ hoverDate: G === "end" ? U : null,
113
144
  onSelect: Z,
114
145
  onMonthChange: (e, t) => {
115
- L(e), z(t);
146
+ R(e), B(t);
116
147
  },
117
- onHover: V
118
- }), /* @__PURE__ */ l(o, {
119
- year: J,
120
- month: Y,
121
- rangeStart: W,
122
- rangeEnd: K,
123
- hoverDate: H === "end" ? B : null,
148
+ onHover: W
149
+ }), !P && /* @__PURE__ */ d(o, {
150
+ year: V,
151
+ month: H,
152
+ rangeStart: q,
153
+ rangeEnd: Y,
154
+ hoverDate: G === "end" ? U : null,
124
155
  onSelect: Z,
125
156
  onMonthChange: (e, t) => {
126
- t === 0 ? (L(e - 1), z(11)) : (L(e), z(t - 1));
157
+ t === 0 ? (R(e - 1), B(11)) : (R(e), B(t - 1));
127
158
  },
128
- onHover: V
159
+ onHover: W
129
160
  })]
130
161
  })]
131
162
  })
@@ -134,4 +165,4 @@ function p({ controlSize: p, label: m, value: h, defaultValue: g = f, onValueCha
134
165
  });
135
166
  }
136
167
  //#endregion
137
- export { p as DateRangePicker };
168
+ export { m as DateRangePicker };
@@ -1,14 +1,16 @@
1
1
  import type { ComponentPropsWithRef, ReactNode } from "react";
2
- export interface EmptyStateProps extends ComponentPropsWithRef<"div"> {
2
+ export interface EmptyStateProps extends Omit<ComponentPropsWithRef<"div">, "title"> {
3
3
  /** Icon shown in the tile above the title. Defaults to an inbox icon. */
4
4
  icon?: ReactNode;
5
- /** Heading text. */
6
- title: string;
7
- /** Supporting text below the title. */
8
- description?: string;
5
+ /** Title content. */
6
+ title: ReactNode;
7
+ /** Renders the title as a heading at this level. String titles otherwise render as paragraphs. */
8
+ headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
9
+ /** Supporting content below the title, including multiple paragraphs. */
10
+ description?: ReactNode;
9
11
  /** Call-to-action, e.g. a Button, shown below the description. */
10
12
  action?: ReactNode;
11
13
  /** Additional utility classes for the root element. */
12
14
  className?: string;
13
15
  }
14
- export declare function EmptyState({ icon, title, description, action, className, ref, ...rest }: EmptyStateProps): import("react/jsx-runtime").JSX.Element;
16
+ export declare function EmptyState({ icon, title, headingLevel, description, action, className, ref, ...rest }: EmptyStateProps): import("react/jsx-runtime").JSX.Element;
@@ -2,27 +2,28 @@ import { cn as e } from "../../lib/cn.js";
2
2
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
3
  import { Inbox as r } from "lucide-react";
4
4
  //#region src/components/ui/EmptyState.tsx
5
- function i({ icon: i, title: a, description: o, action: s, className: c, ref: l, ...u }) {
5
+ function i({ icon: i, title: a, headingLevel: o, description: s, action: c, className: l, ref: u, ...d }) {
6
+ let f = o ? `h${o}` : typeof a == "string" ? "p" : "div", p = typeof s == "string" ? "p" : "div";
6
7
  return /* @__PURE__ */ n("div", {
7
- ...u,
8
- ref: l,
9
- className: e("flex flex-col items-center justify-center px-4 py-12", c),
8
+ ...d,
9
+ ref: u,
10
+ className: e("flex flex-col items-center justify-center px-4 py-12", l),
10
11
  children: [
11
12
  /* @__PURE__ */ t("div", {
12
13
  className: "bg-bg-tertiary text-text-tertiary mb-3 flex h-10 w-10 items-center justify-center rounded-md",
13
14
  children: i || /* @__PURE__ */ t(r, { className: "h-5 w-5" })
14
15
  }),
15
- /* @__PURE__ */ t("p", {
16
+ /* @__PURE__ */ t(f, {
16
17
  className: "text-text-primary mb-1 text-sm font-medium",
17
18
  children: a
18
19
  }),
19
- o && /* @__PURE__ */ t("p", {
20
+ s || s === 0 ? /* @__PURE__ */ t(p, {
20
21
  className: "text-text-secondary max-w-[300px] text-center text-xs",
21
- children: o
22
- }),
23
- s && /* @__PURE__ */ t("div", {
24
- className: "mt-4",
25
22
  children: s
23
+ }) : null,
24
+ c && /* @__PURE__ */ t("div", {
25
+ className: "mt-4",
26
+ children: c
26
27
  })
27
28
  ]
28
29
  });
@@ -2,6 +2,11 @@ import { Component, type ErrorInfo, type ReactNode } from "react";
2
2
  /** Props for ErrorBoundary. */
3
3
  export interface ErrorBoundaryProps {
4
4
  children: ReactNode;
5
+ /** Render a custom recovery UI. Call reset to retry rendering the children. */
6
+ fallback?: (props: {
7
+ error: unknown;
8
+ reset: () => void;
9
+ }) => ReactNode;
5
10
  }
6
11
  interface State {
7
12
  hasError: boolean;
@@ -11,6 +16,7 @@ export declare class ErrorBoundary extends Component<ErrorBoundaryProps, State>
11
16
  state: State;
12
17
  static getDerivedStateFromError(error: Error): State;
13
18
  componentDidCatch(error: Error, info: ErrorInfo): void;
19
+ private reset;
14
20
  render(): string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null | undefined;
15
21
  }
16
22
  export {};
@@ -16,8 +16,17 @@ var i = class extends t {
16
16
  componentDidCatch(e, t) {
17
17
  console.error("[ErrorBoundary] Uncaught error:", e, t.componentStack);
18
18
  }
19
+ reset = () => {
20
+ this.setState({
21
+ hasError: !1,
22
+ error: null
23
+ });
24
+ };
19
25
  render() {
20
- return this.state.hasError ? /* @__PURE__ */ r("div", {
26
+ return this.state.hasError ? this.props.fallback ? this.props.fallback({
27
+ error: this.state.error,
28
+ reset: this.reset
29
+ }) : /* @__PURE__ */ r("div", {
21
30
  className: "ui-glass-shell bg-bg-primary flex min-h-svh flex-col items-center justify-center p-8 text-center",
22
31
  children: [
23
32
  /* @__PURE__ */ n("p", {
@@ -31,10 +40,7 @@ var i = class extends t {
31
40
  /* @__PURE__ */ n(e, {
32
41
  variant: "secondary",
33
42
  onClick: () => {
34
- this.setState({
35
- hasError: !1,
36
- error: null
37
- }), window.location.href = "/";
43
+ this.reset(), window.location.href = "/";
38
44
  },
39
45
  children: "Go home"
40
46
  })
@@ -14,7 +14,7 @@ export interface GridOptions {
14
14
  justify?: "start" | "center" | "end" | "stretch";
15
15
  }
16
16
  export type GridProps<E extends LayoutElement = "div"> = LayoutProps<E, GridOptions>;
17
- export declare function Grid<E extends LayoutElement = "div">({ as, columns, gap, gapX, gapY, align, justify, className, style, ...props }: GridProps<E>): import("react").DetailedReactHTMLElement<Omit<GridProps<E>, "columns" | "style" | "className" | "gap" | "justify" | "align" | "as" | "gapX" | "gapY"> & {
17
+ export declare function Grid<E extends LayoutElement = "div">({ as, columns, gap, gapX, gapY, align, justify, className, style, ...props }: GridProps<E>): import("react").DetailedReactHTMLElement<Omit<GridProps<E>, "columns" | "style" | "className" | "gap" | "align" | "justify" | "as" | "gapX" | "gapY"> & {
18
18
  className: string;
19
19
  style: LayoutStyle;
20
20
  }, HTMLElement>;
@@ -0,0 +1,91 @@
1
+ import type { ComponentPropsWithRef } from "react";
2
+ declare const glyphs: {
3
+ activity: import("lucide-react").LucideIcon;
4
+ alert: import("lucide-react").LucideIcon;
5
+ archive: import("lucide-react").LucideIcon;
6
+ "arrow-down-wide-narrow": import("lucide-react").LucideIcon;
7
+ "arrow-left": import("lucide-react").LucideIcon;
8
+ "arrow-right": import("lucide-react").LucideIcon;
9
+ "arrow-up-narrow-wide": import("lucide-react").LucideIcon;
10
+ bell: import("lucide-react").LucideIcon;
11
+ bot: import("lucide-react").LucideIcon;
12
+ brain: import("lucide-react").LucideIcon;
13
+ calendar: import("lucide-react").LucideIcon;
14
+ "calendar-clock": import("lucide-react").LucideIcon;
15
+ "calendar-plus": import("lucide-react").LucideIcon;
16
+ "chart-no-axes-column": import("lucide-react").LucideIcon;
17
+ "check-circle": import("lucide-react").LucideIcon;
18
+ "chevron-down": import("lucide-react").LucideIcon;
19
+ "chevron-left": import("lucide-react").LucideIcon;
20
+ "chevron-right": import("lucide-react").LucideIcon;
21
+ "chevrons-up-down": import("lucide-react").LucideIcon;
22
+ "circle-check": import("lucide-react").LucideIcon;
23
+ clipboard: import("lucide-react").LucideIcon;
24
+ "clipboard-list": import("lucide-react").LucideIcon;
25
+ clock: import("lucide-react").LucideIcon;
26
+ code: import("lucide-react").LucideIcon;
27
+ "credit-card": import("lucide-react").LucideIcon;
28
+ database: import("lucide-react").LucideIcon;
29
+ download: import("lucide-react").LucideIcon;
30
+ "external-link": import("lucide-react").LucideIcon;
31
+ eye: import("lucide-react").LucideIcon;
32
+ "eye-off": import("lucide-react").LucideIcon;
33
+ "file-chart-column-increasing": import("lucide-react").LucideIcon;
34
+ "file-check": import("lucide-react").LucideIcon;
35
+ "file-text": import("lucide-react").LucideIcon;
36
+ form: import("lucide-react").LucideIcon;
37
+ "git-branch": import("lucide-react").LucideIcon;
38
+ "git-merge": import("lucide-react").LucideIcon;
39
+ globe: import("lucide-react").LucideIcon;
40
+ history: import("lucide-react").LucideIcon;
41
+ house: import("lucide-react").LucideIcon;
42
+ inbox: import("lucide-react").LucideIcon;
43
+ key: import("lucide-react").LucideIcon;
44
+ layers: import("lucide-react").LucideIcon;
45
+ link: import("lucide-react").LucideIcon;
46
+ list: import("lucide-react").LucideIcon;
47
+ "log-out": import("lucide-react").LucideIcon;
48
+ "map-pin": import("lucide-react").LucideIcon;
49
+ menu: import("lucide-react").LucideIcon;
50
+ "message-square": import("lucide-react").LucideIcon;
51
+ mic: import("lucide-react").LucideIcon;
52
+ moon: import("lucide-react").LucideIcon;
53
+ network: import("lucide-react").LucideIcon;
54
+ package: import("lucide-react").LucideIcon;
55
+ paperclip: import("lucide-react").LucideIcon;
56
+ pause: import("lucide-react").LucideIcon;
57
+ phone: import("lucide-react").LucideIcon;
58
+ pill: import("lucide-react").LucideIcon;
59
+ play: import("lucide-react").LucideIcon;
60
+ plus: import("lucide-react").LucideIcon;
61
+ "refresh-cw": import("lucide-react").LucideIcon;
62
+ reply: import("lucide-react").LucideIcon;
63
+ route: import("lucide-react").LucideIcon;
64
+ save: import("lucide-react").LucideIcon;
65
+ scale: import("lucide-react").LucideIcon;
66
+ search: import("lucide-react").LucideIcon;
67
+ send: import("lucide-react").LucideIcon;
68
+ settings: import("lucide-react").LucideIcon;
69
+ "shield-check": import("lucide-react").LucideIcon;
70
+ smartphone: import("lucide-react").LucideIcon;
71
+ star: import("lucide-react").LucideIcon;
72
+ store: import("lucide-react").LucideIcon;
73
+ sun: import("lucide-react").LucideIcon;
74
+ tag: import("lucide-react").LucideIcon;
75
+ trash: import("lucide-react").LucideIcon;
76
+ "trending-up": import("lucide-react").LucideIcon;
77
+ "triangle-alert": import("lucide-react").LucideIcon;
78
+ user: import("lucide-react").LucideIcon;
79
+ users: import("lucide-react").LucideIcon;
80
+ video: import("lucide-react").LucideIcon;
81
+ x: import("lucide-react").LucideIcon;
82
+ };
83
+ export type IconName = keyof typeof glyphs;
84
+ export interface IconProps extends Omit<ComponentPropsWithRef<"svg">, "children"> {
85
+ /** Common action or status glyph. */
86
+ name: IconName;
87
+ /** Width and height; defaults to 20 pixels. */
88
+ size?: number | string;
89
+ }
90
+ export declare function Icon({ name, size, className, ...props }: IconProps): import("react/jsx-runtime").JSX.Element;
91
+ export {};
@@ -0,0 +1,98 @@
1
+ import { cn as ee } from "../../lib/cn.js";
2
+ import { jsx as e } from "react/jsx-runtime";
3
+ import { Activity as t, Archive as n, ArrowDownWideNarrow as r, ArrowLeft as i, ArrowRight as a, ArrowUpNarrowWide as o, Bell as s, Bot as te, Brain as c, Calendar as l, CalendarClock as u, CalendarPlus as d, ChartNoAxesColumn as f, ChevronDown as p, ChevronLeft as m, ChevronRight as h, ChevronsUpDown as g, CircleCheck as _, Clipboard as v, ClipboardList as y, Clock as b, Code as x, CreditCard as S, Database as C, Download as w, ExternalLink as T, Eye as E, EyeOff as D, FileChartColumnIncreasing as O, FileCheck as k, FileText as A, Form as j, GitBranch as M, GitMerge as N, Globe as P, History as F, House as I, Inbox as L, Key as R, Layers as z, Link as B, List as V, LogOut as H, MapPin as U, Menu as W, MessageSquare as G, Mic as K, Moon as ne, Network as q, Package as J, Paperclip as Y, Pause as X, Phone as Z, Pill as re, Play as ie, Plus as ae, RefreshCw as oe, Reply as se, Route as ce, Save as le, Scale as ue, Search as de, Send as fe, Settings as pe, ShieldCheck as me, Smartphone as he, Star as ge, Store as _e, Sun as ve, Tag as ye, Trash as be, TrendingUp as xe, TriangleAlert as Q, User as Se, Users as Ce, Video as $, X as we } from "lucide-react";
4
+ //#region src/components/ui/Icon.tsx
5
+ var Te = {
6
+ activity: t,
7
+ alert: Q,
8
+ archive: n,
9
+ "arrow-down-wide-narrow": r,
10
+ "arrow-left": i,
11
+ "arrow-right": a,
12
+ "arrow-up-narrow-wide": o,
13
+ bell: s,
14
+ bot: te,
15
+ brain: c,
16
+ calendar: l,
17
+ "calendar-clock": u,
18
+ "calendar-plus": d,
19
+ "chart-no-axes-column": f,
20
+ "check-circle": _,
21
+ "chevron-down": p,
22
+ "chevron-left": m,
23
+ "chevron-right": h,
24
+ "chevrons-up-down": g,
25
+ "circle-check": _,
26
+ clipboard: v,
27
+ "clipboard-list": y,
28
+ clock: b,
29
+ code: x,
30
+ "credit-card": S,
31
+ database: C,
32
+ download: w,
33
+ "external-link": T,
34
+ eye: E,
35
+ "eye-off": D,
36
+ "file-chart-column-increasing": O,
37
+ "file-check": k,
38
+ "file-text": A,
39
+ form: j,
40
+ "git-branch": M,
41
+ "git-merge": N,
42
+ globe: P,
43
+ history: F,
44
+ house: I,
45
+ inbox: L,
46
+ key: R,
47
+ layers: z,
48
+ link: B,
49
+ list: V,
50
+ "log-out": H,
51
+ "map-pin": U,
52
+ menu: W,
53
+ "message-square": G,
54
+ mic: K,
55
+ moon: ne,
56
+ network: q,
57
+ package: J,
58
+ paperclip: Y,
59
+ pause: X,
60
+ phone: Z,
61
+ pill: re,
62
+ play: ie,
63
+ plus: ae,
64
+ "refresh-cw": oe,
65
+ reply: se,
66
+ route: ce,
67
+ save: le,
68
+ scale: ue,
69
+ search: de,
70
+ send: fe,
71
+ settings: pe,
72
+ "shield-check": me,
73
+ smartphone: he,
74
+ star: ge,
75
+ store: _e,
76
+ sun: ve,
77
+ tag: ye,
78
+ trash: be,
79
+ "trending-up": xe,
80
+ "triangle-alert": Q,
81
+ user: Se,
82
+ users: Ce,
83
+ video: $,
84
+ x: we
85
+ };
86
+ function Ee({ name: t, size: n = 20, className: r, ...i }) {
87
+ let a = Te[t], o = i["aria-label"] || i["aria-labelledby"];
88
+ return /* @__PURE__ */ e(a, {
89
+ size: n,
90
+ className: ee("inline-block shrink-0", r),
91
+ color: "currentColor",
92
+ role: o ? "img" : void 0,
93
+ "aria-hidden": o ? void 0 : !0,
94
+ ...i
95
+ });
96
+ }
97
+ //#endregion
98
+ export { Ee as Icon };
@@ -18,7 +18,7 @@ export interface InlineOptions {
18
18
  stackBelow?: LayoutBreakpoint;
19
19
  }
20
20
  export type InlineProps<E extends LayoutElement = "div"> = LayoutProps<E, InlineOptions>;
21
- export declare function Inline<E extends LayoutElement = "div">({ as, gap, gapX, gapY, align, justify, wrap, inline, stackBelow, className, style, ...props }: InlineProps<E>): import("react").DetailedReactHTMLElement<Omit<InlineProps<E>, "inline" | "style" | "className" | "gap" | "wrap" | "justify" | "align" | "as" | "gapX" | "gapY" | "stackBelow"> & {
21
+ export declare function Inline<E extends LayoutElement = "div">({ as, gap, gapX, gapY, align, justify, wrap, inline, stackBelow, className, style, ...props }: InlineProps<E>): import("react").DetailedReactHTMLElement<Omit<InlineProps<E>, "inline" | "style" | "className" | "gap" | "align" | "justify" | "wrap" | "as" | "gapX" | "gapY" | "stackBelow"> & {
22
22
  className: string;
23
23
  style: LayoutStyle;
24
24
  }, HTMLElement>;
@@ -1,9 +1,13 @@
1
1
  import type { ComponentPropsWithRef } from "react";
2
- export type LoadingSpinnerSize = "sm" | "md" | "lg";
2
+ export type LoadingSpinnerSize = "sm" | "md" | "lg" | "inline";
3
3
  export interface LoadingSpinnerProps extends Omit<ComponentPropsWithRef<"div">, "children"> {
4
4
  /** Additional utility classes appended to the centering wrapper. */
5
5
  className?: string;
6
- /** Size of the spinner icon. Defaults to `md`. */
6
+ /** Icon size. Defaults to `md`. Use `inline` for a small spinner without the 200px wrapper. */
7
7
  size?: LoadingSpinnerSize;
8
+ /** Text announced by the status region. Defaults to “Loading…” for inline or visible labels. */
9
+ label?: string;
10
+ /** Display the status text next to the spinner. Defaults to false. */
11
+ showLabel?: boolean;
8
12
  }
9
- export declare function LoadingSpinner({ className, size, ref, ...rest }: LoadingSpinnerProps): import("react/jsx-runtime").JSX.Element;
13
+ export declare function LoadingSpinner({ className, size, showLabel, label, ref, ...rest }: LoadingSpinnerProps): import("react/jsx-runtime").JSX.Element;
@@ -1,19 +1,27 @@
1
1
  import { cn as e } from "../../lib/cn.js";
2
- import { jsx as t } from "react/jsx-runtime";
3
- import { Loader2 as n } from "lucide-react";
2
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
+ import { Loader2 as r } from "lucide-react";
4
4
  //#region src/components/ui/LoadingSpinner.tsx
5
- var r = {
5
+ var i = {
6
6
  sm: "w-4 h-4",
7
7
  md: "w-6 h-6",
8
- lg: "w-8 h-8"
8
+ lg: "w-8 h-8",
9
+ inline: "w-4 h-4"
9
10
  };
10
- function i({ className: i, size: a = "md", ref: o, ...s }) {
11
- return /* @__PURE__ */ t("div", {
12
- ...s,
13
- ref: o,
14
- className: e("flex min-h-[200px] items-center justify-center", i),
15
- children: /* @__PURE__ */ t(n, { className: e("text-accent animate-spin", r[a]) })
11
+ function a({ className: a, size: o = "md", showLabel: s = !1, label: c = o === "inline" || s ? "Loading…" : void 0, ref: l, ...u }) {
12
+ return /* @__PURE__ */ n(o === "inline" ? "span" : "div", {
13
+ role: c ? "status" : void 0,
14
+ ...u,
15
+ ref: l,
16
+ className: e(o === "inline" ? "inline-flex" : "flex min-h-[200px]", "items-center justify-center", s && c && "gap-2", a),
17
+ children: [/* @__PURE__ */ t(r, {
18
+ "aria-hidden": "true",
19
+ className: e("text-accent animate-spin", i[o])
20
+ }), c && /* @__PURE__ */ t("span", {
21
+ className: s ? "text-text-secondary text-xs" : "sr-only",
22
+ children: c
23
+ })]
16
24
  });
17
25
  }
18
26
  //#endregion
19
- export { i as LoadingSpinner };
27
+ export { a as LoadingSpinner };
@@ -0,0 +1,10 @@
1
+ import type { ComponentPropsWithRef, ReactNode } from "react";
2
+ export interface MainAsideLayoutProps extends ComponentPropsWithRef<"div"> {
3
+ /** Primary content, displayed first at every width. */
4
+ children: ReactNode;
5
+ /** Supporting content, rendered in an aside. */
6
+ aside: ReactNode;
7
+ /** Show a divider between the columns when side by side. */
8
+ divider?: boolean;
9
+ }
10
+ export declare function MainAsideLayout({ children, aside, divider, className, ...props }: MainAsideLayoutProps): import("react/jsx-runtime").JSX.Element;