@leonardaustin/ui 0.27.0 → 0.28.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 (46) hide show
  1. package/dist/components/charts/AreaChart.js +113 -114
  2. package/dist/components/charts/Heatmap.d.ts +20 -0
  3. package/dist/components/charts/Heatmap.js +46 -0
  4. package/dist/components/charts/chartUtils.d.ts +2 -0
  5. package/dist/components/charts/chartUtils.js +14 -9
  6. package/dist/components/charts/useChartSize.d.ts +5 -0
  7. package/dist/components/charts/useChartSize.js +18 -0
  8. package/dist/components/tables/Pagination.d.ts +3 -1
  9. package/dist/components/tables/Pagination.js +12 -12
  10. package/dist/components/tables/ResourceTable.d.ts +5 -0
  11. package/dist/components/tables/ResourceTable.js +11 -9
  12. package/dist/components/tables/Table.d.ts +22 -3
  13. package/dist/components/tables/Table.js +41 -35
  14. package/dist/components/ui/ActionLink.d.ts +14 -0
  15. package/dist/components/ui/ActionLink.js +12 -0
  16. package/dist/components/ui/DateRangePicker.js +107 -76
  17. package/dist/components/ui/EmptyState.d.ts +8 -6
  18. package/dist/components/ui/EmptyState.js +11 -10
  19. package/dist/components/ui/ErrorBoundary.d.ts +6 -0
  20. package/dist/components/ui/ErrorBoundary.js +11 -5
  21. package/dist/components/ui/Grid.d.ts +1 -1
  22. package/dist/components/ui/Icon.d.ts +91 -0
  23. package/dist/components/ui/Icon.js +98 -0
  24. package/dist/components/ui/Inline.d.ts +1 -1
  25. package/dist/components/ui/LoadingSpinner.d.ts +7 -3
  26. package/dist/components/ui/LoadingSpinner.js +19 -11
  27. package/dist/components/ui/Meter.d.ts +11 -0
  28. package/dist/components/ui/Meter.js +7 -0
  29. package/dist/components/ui/MetricCard.d.ts +11 -8
  30. package/dist/components/ui/MetricCard.js +18 -15
  31. package/dist/components/ui/PaginationBar.d.ts +3 -3
  32. package/dist/components/ui/PaginationBar.js +35 -33
  33. package/dist/components/ui/SideSheet.d.ts +4 -2
  34. package/dist/components/ui/SideSheet.js +64 -52
  35. package/dist/components/ui/Stack.d.ts +1 -1
  36. package/dist/components/ui/Tabs.d.ts +5 -1
  37. package/dist/components/ui/Tabs.js +23 -21
  38. package/dist/components/ui/Text.d.ts +19 -0
  39. package/dist/components/ui/Text.js +20 -0
  40. package/dist/components/ui/Toolbar.js +13 -13
  41. package/dist/core.css +105 -0
  42. package/dist/hooks/useFocusTrap.js +1 -1
  43. package/dist/index.d.ts +5 -0
  44. package/dist/index.js +134 -129
  45. package/dist/styles.css +106 -0
  46. package/package.json +1 -1
@@ -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,11 @@
1
+ import type { ComponentPropsWithRef } from "react";
2
+ export interface MeterProps extends ComponentPropsWithRef<"meter"> {
3
+ /** Current measurement within the native meter range. */
4
+ value: number;
5
+ /** Lower bound. Defaults to 0. */
6
+ min?: number;
7
+ /** Upper bound. Defaults to 1. */
8
+ max?: number;
9
+ }
10
+ /** Name the measurement with a label element, aria-label or aria-labelledby. */
11
+ export declare function Meter(props: MeterProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ //#region src/components/ui/Meter.tsx
3
+ function t(t) {
4
+ return /* @__PURE__ */ e("meter", { ...t });
5
+ }
6
+ //#endregion
7
+ export { t as Meter };
@@ -1,11 +1,14 @@
1
- import type { ComponentPropsWithRef, ElementType } from "react";
1
+ import type { ComponentPropsWithRef, ElementType, ReactNode } from "react";
2
+ import { type SemanticTone } from "../../lib/tones";
2
3
  export interface MetricCardProps extends Omit<ComponentPropsWithRef<"div">, "children"> {
3
- /** Small uppercase caption naming the metric. */
4
- label: string;
5
- /** The headline figure. */
6
- value: string | number;
7
- /** Secondary line of muted text below the value. */
8
- sub?: string;
4
+ /** Small uppercase caption naming the metric. Accepts inline content. */
5
+ label: ReactNode;
6
+ /** The headline figure or inline content. */
7
+ value: ReactNode;
8
+ /** Secondary line of muted inline content below the value. */
9
+ sub?: ReactNode;
10
+ /** Semantic text tone for the headline value. Defaults to primary text. */
11
+ valueTone?: SemanticTone;
9
12
  /**
10
13
  * Optional trend indicator rendered below the value. `value` is the change
11
14
  * string (e.g. "+12.5%"), `label` is the supporting context (e.g. "vs last
@@ -26,4 +29,4 @@ export interface MetricCardProps extends Omit<ComponentPropsWithRef<"div">, "chi
26
29
  /** Additional utility classes appended to the root element. */
27
30
  className?: string;
28
31
  }
29
- export declare function MetricCard({ label, value, sub, trend, bar, icon: Icon, iconColor, className, ref, ...rest }: MetricCardProps): import("react/jsx-runtime").JSX.Element;
32
+ export declare function MetricCard({ label, value, valueTone, sub, trend, bar, icon: Icon, iconColor, className, ref, ...rest }: MetricCardProps): import("react/jsx-runtime").JSX.Element;
@@ -7,41 +7,44 @@ var a = {
7
7
  negative: "danger",
8
8
  neutral: "neutral"
9
9
  };
10
- function o({ label: o, value: s, sub: c, trend: l, bar: u, icon: d, iconColor: f, className: p, ref: m, ...h }) {
11
- let g = l && a[l.tone], _ = n(t(g) ? g : "neutral").text;
10
+ function o({ label: o, value: s, valueTone: c, sub: l, trend: u, bar: d, icon: f, iconColor: p, className: m, ref: h, ...g }) {
11
+ let _ = t(c) ? n(c).text : "text-text-primary", v = l != null && typeof l != "boolean" && l !== "", y = u && a[u.tone], b = n(t(y) ? y : "neutral").text;
12
12
  return /* @__PURE__ */ i("div", {
13
- ...h,
14
- ref: m,
15
- className: e("ui-glass bg-bg-card border-border relative overflow-hidden rounded-md border p-3", p),
13
+ ...g,
14
+ ref: h,
15
+ className: e("ui-glass bg-bg-card border-border relative overflow-hidden rounded-md border p-3", m),
16
16
  children: [
17
- d && /* @__PURE__ */ r(d, { className: e("absolute -right-9 -bottom-9 h-44 w-44 -rotate-45 opacity-[0.06]", f) }),
17
+ f && /* @__PURE__ */ r(f, {
18
+ "aria-hidden": "true",
19
+ className: e("pointer-events-none absolute -right-9 -bottom-9 h-44 w-44 -rotate-45 opacity-[0.06]", p)
20
+ }),
18
21
  /* @__PURE__ */ r("p", {
19
22
  className: "text-2xs-f text-text-tertiary font-label mb-1 font-medium tracking-wider uppercase",
20
23
  children: o
21
24
  }),
22
25
  /* @__PURE__ */ r("p", {
23
- className: "text-text-primary font-data text-xl font-bold tabular-nums",
26
+ className: e(_, "font-data text-xl font-bold tabular-nums"),
24
27
  children: s
25
28
  }),
26
- c && /* @__PURE__ */ r("p", {
29
+ v && /* @__PURE__ */ r("p", {
27
30
  className: "text-2xs text-text-tertiary font-label mt-0.5",
28
- children: c
31
+ children: l
29
32
  }),
30
- l && /* @__PURE__ */ i("p", {
33
+ u && /* @__PURE__ */ i("p", {
31
34
  className: "text-2xs font-label mt-1 flex items-center gap-1",
32
35
  children: [/* @__PURE__ */ r("span", {
33
- className: e("font-medium tabular-nums", _),
34
- children: l.value
36
+ className: e("font-medium tabular-nums", b),
37
+ children: u.value
35
38
  }), /* @__PURE__ */ r("span", {
36
39
  className: "text-text-tertiary",
37
- children: l.label
40
+ children: u.label
38
41
  })]
39
42
  }),
40
- u !== void 0 && /* @__PURE__ */ r("div", {
43
+ d !== void 0 && /* @__PURE__ */ r("div", {
41
44
  className: "bg-bg-tertiary mt-2 h-[3px] overflow-hidden rounded-md",
42
45
  children: /* @__PURE__ */ r("div", {
43
46
  className: "bg-accent h-full rounded-md transition-all duration-[250ms] ease-out",
44
- style: { width: `${Math.min(100, Math.max(0, u))}%` }
47
+ style: { width: `${Math.min(100, Math.max(0, d))}%` }
45
48
  })
46
49
  })
47
50
  ]
@@ -26,7 +26,7 @@
26
26
  * />
27
27
  * ```
28
28
  */
29
- import type { ComponentPropsWithRef, ReactNode } from "react";
29
+ import { type ComponentPropsWithRef, type ReactNode } from "react";
30
30
  export interface PageSizeOption {
31
31
  value: string;
32
32
  label: string;
@@ -36,8 +36,8 @@ export interface PaginationBarProps extends Omit<ComponentPropsWithRef<"div">, "
36
36
  page: number;
37
37
  /** Number of items per page. */
38
38
  pageSize: number;
39
- /** Total number of items across all pages. */
40
- total: number;
39
+ /** Total across all pages. Omit or pass null while the count is unknown. */
40
+ total?: number | null;
41
41
  /** Replace the default range text with custom content or a total formatter. */
42
42
  summary?: ReactNode | ((total: number) => ReactNode);
43
43
  /** Show a short total caption after the range or custom summary. */
@@ -1,9 +1,10 @@
1
1
  import { cn as e } from "../../lib/cn.js";
2
2
  import { SelectDropdown as t } from "./SelectDropdown.js";
3
3
  import { Pagination as n } from "../tables/Pagination.js";
4
- import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
4
+ import { useState as r } from "react";
5
+ import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
5
6
  //#region src/components/ui/PaginationBar.tsx
6
- var o = [
7
+ var s = [
7
8
  {
8
9
  value: "10",
9
10
  label: "10 per page"
@@ -17,45 +18,46 @@ var o = [
17
18
  label: "50 per page"
18
19
  }
19
20
  ];
20
- function s({ page: s, pageSize: c, total: l, summary: u, showTotal: d = !1, loading: f = !1, pageSizeOptions: p = o, onPageChange: m, onPageSizeChange: h, className: g, ref: _, ...v }) {
21
- let y = Math.ceil(l / c), b = Math.min((s - 1) * c + 1, l), x = Math.min(s * c, l);
22
- return /* @__PURE__ */ a("div", {
23
- ref: _,
24
- ...v,
25
- className: e("flex items-center justify-between", g),
26
- children: [/* @__PURE__ */ a("div", {
21
+ function c({ page: c, pageSize: l, total: u, summary: d, showTotal: f = !1, loading: p = !1, pageSizeOptions: m = s, onPageChange: h, onPageSizeChange: g, className: _, ref: v, ...y }) {
22
+ let [b, x] = r(u), S = p ? u ?? b : u;
23
+ Object.is(S, b) || x(S);
24
+ let C = S == null ? 0 : Math.ceil(S / l), w = (c - 1) * l + 1, T = S == null ? 0 : Math.min(c * l, S), E = c > 1 && c > C, D = f && S != null && !(d === void 0 && E), O = typeof d == "function" ? S == null ? null : d(S) : d;
25
+ return d === void 0 && S != null && (O = E ? `${S} in total` : `${Math.min(w, S)}–${T} of ${S}`), /* @__PURE__ */ o("div", {
26
+ ref: v,
27
+ ...y,
28
+ className: e("flex items-center justify-between", _),
29
+ children: [/* @__PURE__ */ o("div", {
27
30
  className: "flex items-center gap-3",
28
- children: [h && /* @__PURE__ */ i(t, {
31
+ children: [g && /* @__PURE__ */ a(t, {
29
32
  size: "sm",
30
- value: String(c),
31
- onValueChange: (e) => h(Number(e)),
32
- options: p,
33
+ value: String(l),
34
+ onValueChange: (e) => g(Number(e)),
35
+ options: m,
33
36
  className: "w-28",
34
37
  role: "group",
35
- "aria-busy": f || void 0
36
- }), /* @__PURE__ */ a("span", {
38
+ "aria-busy": p || void 0
39
+ }), /* @__PURE__ */ o("span", {
37
40
  role: "status",
38
- className: e("text-text-tertiary text-xs", !f && "ui-pagination-count"),
39
- children: [f ? "Loading results..." : u === void 0 ? /* @__PURE__ */ a(r, { children: [
40
- b,
41
- "–",
42
- x,
43
- " of ",
44
- l
45
- ] }) : typeof u == "function" ? u(l) : u, !f && d && /* @__PURE__ */ a(r, { children: [
46
- " · ",
47
- l,
48
- " in total"
49
- ] })]
41
+ className: e("text-text-tertiary text-xs", !p && "ui-pagination-count"),
42
+ children: [
43
+ O,
44
+ D && /* @__PURE__ */ o(i, { children: [
45
+ O != null && " · ",
46
+ S,
47
+ " in total"
48
+ ] }),
49
+ p && /* @__PURE__ */ o(i, { children: [(O != null || D) && " · ", "Loading results..."] })
50
+ ]
50
51
  })]
51
- }), /* @__PURE__ */ i(n, {
52
- page: s,
53
- totalPages: y,
54
- onPageChange: m,
55
- loading: f,
52
+ }), /* @__PURE__ */ a(n, {
53
+ keepNavigation: !0,
54
+ page: c,
55
+ totalPages: C,
56
+ onPageChange: h,
57
+ loading: p,
56
58
  summary: null
57
59
  })]
58
60
  });
59
61
  }
60
62
  //#endregion
61
- export { s as PaginationBar };
63
+ export { c as PaginationBar };
@@ -10,7 +10,7 @@ export interface SideSheetProps extends Omit<ComponentPropsWithRef<"div">, "titl
10
10
  onClose: () => void;
11
11
  /**
12
12
  * Heading shown in the header. A string also names the dialog
13
- * (`aria-label`); otherwise it is named "Panel".
13
+ * unless you supply an explicit `aria-label`. Rich titles default to "Panel".
14
14
  */
15
15
  title?: ReactNode;
16
16
  /** The sheet body, which scrolls when taller than the sheet. */
@@ -26,9 +26,11 @@ export interface SideSheetProps extends Omit<ComponentPropsWithRef<"div">, "titl
26
26
  widthClassName?: string;
27
27
  /** Enable pointer and keyboard resizing at viewport widths of 640px and up. Defaults to `false`. */
28
28
  resizable?: boolean;
29
+ /** Fill the viewport below 640px, including when the desktop sheet was resized. */
30
+ fullWidthOnNarrow?: boolean;
29
31
  /** Additional utility classes for the sheet panel. */
30
32
  className?: string;
31
33
  /** Additional utility classes for the scrolling body. */
32
34
  contentClassName?: string;
33
35
  }
34
- export declare function SideSheet({ open, onClose, title, children, footer, side, widthClassName, resizable, className, contentClassName, ref, style, id, ...rest }: SideSheetProps): import("react").ReactPortal | null;
36
+ export declare function SideSheet({ open, onClose, title, children, footer, side, widthClassName, resizable, fullWidthOnNarrow, "aria-label": ariaLabel, className, contentClassName, ref, style, id, ...rest }: SideSheetProps): import("react").ReactPortal | null;