rudiment-ui 0.2.0 → 0.4.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 (126) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +222 -160
  3. package/dist/components/AppShell/AppShell.d.ts +48 -0
  4. package/dist/components/AppShell/AppShell.d.ts.map +1 -0
  5. package/dist/components/Brand/Brand.d.ts +16 -0
  6. package/dist/components/Brand/Brand.d.ts.map +1 -0
  7. package/dist/components/Breadcrumb/Breadcrumb.d.ts +14 -0
  8. package/dist/components/Breadcrumb/Breadcrumb.d.ts.map +1 -0
  9. package/dist/components/Charts/BarChart/BarChart.d.ts +5 -1
  10. package/dist/components/Charts/BarChart/BarChart.d.ts.map +1 -1
  11. package/dist/components/Charts/DonutChart/DonutChart.d.ts.map +1 -1
  12. package/dist/components/Charts/LineChart/LineChart.d.ts +18 -2
  13. package/dist/components/Charts/LineChart/LineChart.d.ts.map +1 -1
  14. package/dist/components/Checkbox/Checkbox.d.ts +7 -0
  15. package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
  16. package/dist/components/Checkbox/CheckboxGroup.d.ts.map +1 -1
  17. package/dist/components/Checkbox/CheckboxGroupContext.d.ts +4 -0
  18. package/dist/components/Checkbox/CheckboxGroupContext.d.ts.map +1 -0
  19. package/dist/components/ComboBox/ComboBox.d.ts +41 -0
  20. package/dist/components/ComboBox/ComboBox.d.ts.map +1 -0
  21. package/dist/components/DatePicker/CalendarParts.d.ts +21 -0
  22. package/dist/components/DatePicker/CalendarParts.d.ts.map +1 -0
  23. package/dist/components/DatePicker/DatePicker.d.ts +34 -0
  24. package/dist/components/DatePicker/DatePicker.d.ts.map +1 -0
  25. package/dist/components/DatePicker/DateRangePicker.d.ts +33 -0
  26. package/dist/components/DatePicker/DateRangePicker.d.ts.map +1 -0
  27. package/dist/components/DatePicker/dateUtils.d.ts +14 -0
  28. package/dist/components/DatePicker/dateUtils.d.ts.map +1 -0
  29. package/dist/components/Dialog/Dialog.d.ts +11 -1
  30. package/dist/components/Dialog/Dialog.d.ts.map +1 -1
  31. package/dist/components/Divider/Divider.d.ts +15 -0
  32. package/dist/components/Divider/Divider.d.ts.map +1 -0
  33. package/dist/components/Dot/Dot.d.ts +20 -0
  34. package/dist/components/Dot/Dot.d.ts.map +1 -0
  35. package/dist/components/EmptyState/EmptyState.d.ts +18 -0
  36. package/dist/components/EmptyState/EmptyState.d.ts.map +1 -0
  37. package/dist/components/Footer/Footer.d.ts +31 -0
  38. package/dist/components/Footer/Footer.d.ts.map +1 -0
  39. package/dist/components/Form/Form.d.ts +17 -0
  40. package/dist/components/Form/Form.d.ts.map +1 -0
  41. package/dist/components/Image/Image.d.ts +18 -0
  42. package/dist/components/Image/Image.d.ts.map +1 -0
  43. package/dist/components/Input/Input.d.ts +11 -0
  44. package/dist/components/Input/Input.d.ts.map +1 -1
  45. package/dist/components/Kanban/KanbanBoard.d.ts +3 -1
  46. package/dist/components/Kanban/KanbanBoard.d.ts.map +1 -1
  47. package/dist/components/Kanban/KanbanCard.d.ts +6 -1
  48. package/dist/components/Kanban/KanbanCard.d.ts.map +1 -1
  49. package/dist/components/Link/Link.d.ts +16 -0
  50. package/dist/components/Link/Link.d.ts.map +1 -0
  51. package/dist/components/Menu/MenuItem.d.ts +10 -1
  52. package/dist/components/Menu/MenuItem.d.ts.map +1 -1
  53. package/dist/components/Menu/MenuSeparator.d.ts +5 -0
  54. package/dist/components/Menu/MenuSeparator.d.ts.map +1 -0
  55. package/dist/components/Menu/SubmenuTrigger.d.ts +5 -0
  56. package/dist/components/Menu/SubmenuTrigger.d.ts.map +1 -0
  57. package/dist/components/NavItem/NavItem.d.ts.map +1 -1
  58. package/dist/components/NumberField/NumberField.d.ts +37 -0
  59. package/dist/components/NumberField/NumberField.d.ts.map +1 -0
  60. package/dist/components/PageHeader/PageHeader.d.ts +12 -0
  61. package/dist/components/PageHeader/PageHeader.d.ts.map +1 -0
  62. package/dist/components/Pagination/Pagination.d.ts +14 -0
  63. package/dist/components/Pagination/Pagination.d.ts.map +1 -0
  64. package/dist/components/ProgressBar/ProgressBar.d.ts +14 -2
  65. package/dist/components/ProgressBar/ProgressBar.d.ts.map +1 -1
  66. package/dist/components/RadioGroup/Radio.d.ts +15 -0
  67. package/dist/components/RadioGroup/Radio.d.ts.map +1 -0
  68. package/dist/components/RadioGroup/RadioGroup.d.ts.map +1 -1
  69. package/dist/components/Rating/Rating.d.ts +18 -0
  70. package/dist/components/Rating/Rating.d.ts.map +1 -0
  71. package/dist/components/RouterProvider/RouterProvider.d.ts +15 -0
  72. package/dist/components/RouterProvider/RouterProvider.d.ts.map +1 -0
  73. package/dist/components/SectionHeader/SectionHeader.d.ts +12 -0
  74. package/dist/components/SectionHeader/SectionHeader.d.ts.map +1 -0
  75. package/dist/components/Select/Option.d.ts +3 -0
  76. package/dist/components/Select/Option.d.ts.map +1 -0
  77. package/dist/components/Stepper/Stepper.d.ts +17 -0
  78. package/dist/components/Stepper/Stepper.d.ts.map +1 -0
  79. package/dist/components/Switch/Switch.d.ts +5 -1
  80. package/dist/components/Switch/Switch.d.ts.map +1 -1
  81. package/dist/components/Table/Table.d.ts +30 -0
  82. package/dist/components/Table/Table.d.ts.map +1 -0
  83. package/dist/components/Table/TableBody.d.ts +10 -0
  84. package/dist/components/Table/TableBody.d.ts.map +1 -0
  85. package/dist/components/Table/TableCell.d.ts +11 -0
  86. package/dist/components/Table/TableCell.d.ts.map +1 -0
  87. package/dist/components/Table/TableColumn.d.ts +15 -0
  88. package/dist/components/Table/TableColumn.d.ts.map +1 -0
  89. package/dist/components/Table/TableHeader.d.ts +10 -0
  90. package/dist/components/Table/TableHeader.d.ts.map +1 -0
  91. package/dist/components/Table/TableRow.d.ts +10 -0
  92. package/dist/components/Table/TableRow.d.ts.map +1 -0
  93. package/dist/components/Table/TableSelectionCheckbox.d.ts +3 -0
  94. package/dist/components/Table/TableSelectionCheckbox.d.ts.map +1 -0
  95. package/dist/components/Tabs/Tab.d.ts +15 -0
  96. package/dist/components/Tabs/Tab.d.ts.map +1 -0
  97. package/dist/components/Tabs/TabList.d.ts +10 -0
  98. package/dist/components/Tabs/TabList.d.ts.map +1 -0
  99. package/dist/components/Tabs/TabPanel.d.ts +8 -0
  100. package/dist/components/Tabs/TabPanel.d.ts.map +1 -0
  101. package/dist/components/Tabs/Tabs.d.ts +15 -0
  102. package/dist/components/Tabs/Tabs.d.ts.map +1 -0
  103. package/dist/components/Textarea/Textarea.d.ts +17 -0
  104. package/dist/components/Textarea/Textarea.d.ts.map +1 -0
  105. package/dist/components/Toast/Toast.d.ts +15 -0
  106. package/dist/components/Toast/Toast.d.ts.map +1 -0
  107. package/dist/components/Toast/toastQueue.d.ts +40 -0
  108. package/dist/components/Toast/toastQueue.d.ts.map +1 -0
  109. package/dist/components/TopBar/TopBar.d.ts +18 -0
  110. package/dist/components/TopBar/TopBar.d.ts.map +1 -0
  111. package/dist/hooks/useChartTheme.d.ts +2 -0
  112. package/dist/hooks/useChartTheme.d.ts.map +1 -1
  113. package/dist/index.css +1 -1
  114. package/dist/index.d.ts +79 -5
  115. package/dist/index.d.ts.map +1 -1
  116. package/dist/index.js +2689 -1094
  117. package/dist/layouts/Box/Box.d.ts +2 -0
  118. package/dist/layouts/Box/Box.d.ts.map +1 -1
  119. package/dist/layouts/Cover/Cover.d.ts +7 -1
  120. package/dist/layouts/Cover/Cover.d.ts.map +1 -1
  121. package/dist/typography/Heading/Heading.d.ts +9 -0
  122. package/dist/typography/Heading/Heading.d.ts.map +1 -1
  123. package/dist/typography/Text/Text.d.ts +11 -0
  124. package/dist/typography/Text/Text.d.ts.map +1 -1
  125. package/package.json +11 -6
  126. package/styles.d.ts +3 -0
package/dist/index.js CHANGED
@@ -1,34 +1,37 @@
1
1
  "use client";
2
- import { clsx as ie } from "clsx";
3
- import { twMerge as oe } from "tailwind-merge";
4
- import { useButton as O, useTextField as ne, useCheckbox as ae, useCheckboxGroup as se, useSelect as ce, HiddenSelect as de, usePopover as le, useListBox as ue, useOption as me, usePreventScroll as fe, useModalOverlay as he, useDialog as pe, OverlayContainer as ge, FocusScope as be, useSwitch as _e, VisuallyHidden as ve, useRadioGroup as Ne, useTooltip as Ce, useTooltipTrigger as Re, useProgressBar as Z, useLink as ye } from "react-aria";
5
- import w, { useState as $, useCallback as I, useEffect as xe, forwardRef as b, useRef as R, createContext as ke, Children as Pe, isValidElement as Se, cloneElement as Be } from "react";
6
- import { jsx as t, jsxs as h, Fragment as T } from "react/jsx-runtime";
7
- import { useObjectRef as y } from "@react-aria/utils";
8
- import { Icon as Ie } from "@iconify/react";
9
- import { useToggleState as q, useCheckboxGroupState as we, useSelectState as Te, useRadioGroupState as $e, useTooltipTriggerState as De } from "react-stately";
10
- import { MenuTrigger as Me, Popover as Ee, Menu as Oe, MenuItem as Ke, MenuSection as Le, Header as Ge, Collection as Ae, Keyboard as Fe } from "react-aria-components";
11
- import { Separator as yt, SubmenuTrigger as xt } from "react-aria-components";
12
- import { ResponsiveContainer as G, BarChart as je, CartesianGrid as J, XAxis as K, YAxis as L, Tooltip as A, Legend as F, Bar as ze, LineChart as He, Line as Ue, PieChart as Xe, Pie as We, Cell as Ye } from "recharts";
13
- import { useDroppable as Ze, useSensors as qe, useSensor as U, PointerSensor as Je, KeyboardSensor as Qe, DndContext as Ve, closestCorners as er, DragOverlay as rr } from "@dnd-kit/core";
14
- import { SortableContext as tr, verticalListSortingStrategy as ir, sortableKeyboardCoordinates as or, useSortable as nr } from "@dnd-kit/sortable";
15
- import { CSS as ar } from "@dnd-kit/utilities";
16
- function m(...r) {
17
- return oe(ie(r));
18
- }
19
- function Q(r, e, i) {
20
- const { buttonProps: o } = O(
21
- { ...r, isDisabled: r.isDisabled || e },
22
- i
2
+ import { clsx as ir } from "clsx";
3
+ import { twMerge as tr } from "tailwind-merge";
4
+ import { useButton as G, useTextField as xe, useCheckboxGroupItem as nr, useCheckbox as ar, useCheckboxGroup as or, useSelect as sr, HiddenSelect as dr, usePopover as Ce, useListBox as Se, useOption as Pe, usePreventScroll as lr, useModalOverlay as cr, useDialog as ur, OverlayContainer as mr, FocusScope as pr, useSwitch as hr, VisuallyHidden as te, useRadioGroup as fr, useRadio as _r, useTooltip as br, useTooltipTrigger as gr, useProgressBar as Te, useLink as W, mergeProps as Nr, RouterProvider as vr, useFilter as Rr, useComboBox as yr, DismissButton as kr } from "react-aria";
5
+ import D, { useState as O, useCallback as A, useEffect as ne, forwardRef as v, createContext as ae, useContext as K, useId as we, useRef as P, Children as $e, isValidElement as X, useMemo as I, cloneElement as xr, useLayoutEffect as Cr } from "react";
6
+ import { jsx as i, jsxs as p, Fragment as w } from "react/jsx-runtime";
7
+ import { useObjectRef as B } from "@react-aria/utils";
8
+ import { Icon as Sr } from "@iconify/react";
9
+ import { useToggleState as Be, useCheckboxGroupState as Pr, useSelectState as Tr, useRadioGroupState as wr, useTooltipTriggerState as $r, useComboBoxState as Br } from "react-stately";
10
+ import { Item as ua } from "react-stately";
11
+ import { MenuTrigger as Ir, Popover as oe, Menu as Mr, Keyboard as Dr, MenuItem as Er, Text as z, MenuSection as Lr, Header as Or, Collection as se, Separator as zr, SubmenuTrigger as Ar, Tabs as Fr, TabList as Gr, Tab as Kr, TabPanel as Vr, UNSTABLE_ToastQueue as Hr, UNSTABLE_ToastRegion as Ur, UNSTABLE_ToastStateContext as jr, UNSTABLE_Toast as qr, UNSTABLE_ToastContent as Wr, Table as Xr, Checkbox as Zr, useTableOptions as Ie, TableHeader as Qr, Column as Me, TableBody as Yr, Row as Jr, Cell as De, TableStateContext as ei, Label as Z, Button as F, FieldError as Ee, Heading as ri, CalendarGrid as ii, CalendarGridHeader as ti, CalendarHeaderCell as ni, CalendarGridBody as ai, CalendarCell as oi, DatePicker as si, Group as de, DateInput as Q, DateSegment as Y, Dialog as Le, Calendar as di, DateRangePicker as li, RangeCalendar as ci, NumberField as ui, Input as mi } from "react-aria-components";
12
+ import { Separator as pa } from "react-aria-components";
13
+ import { ResponsiveContainer as le, BarChart as pi, CartesianGrid as Oe, XAxis as J, YAxis as ee, Tooltip as ce, Legend as ue, Bar as hi, LineChart as fi, ReferenceLine as _i, Line as bi, PieChart as gi, Pie as Ni, Cell as vi } from "recharts";
14
+ import { useDroppable as Ri, useSensors as yi, useSensor as be, PointerSensor as ki, KeyboardSensor as xi, DndContext as Ci, closestCorners as Si, DragOverlay as Pi } from "@dnd-kit/core";
15
+ import { SortableContext as Ti, verticalListSortingStrategy as wi, sortableKeyboardCoordinates as $i, useSortable as Bi } from "@dnd-kit/sortable";
16
+ import { CSS as Ii } from "@dnd-kit/utilities";
17
+ import { flushSync as Mi } from "react-dom";
18
+ import { parseDateTime as Di, toCalendarDate as me, parseDate as Ei, toCalendarDateTime as Li } from "@internationalized/date";
19
+ function u(...e) {
20
+ return tr(ir(e));
21
+ }
22
+ function ze(e, r, t) {
23
+ const { buttonProps: n } = G(
24
+ { ...e, isDisabled: e.isDisabled || r },
25
+ t
23
26
  );
24
27
  return {
25
28
  buttonProps: {
26
- ...o,
27
- "aria-busy": e || void 0
29
+ ...n,
30
+ "aria-busy": r || void 0
28
31
  }
29
32
  };
30
33
  }
31
- const sr = {
34
+ const Oi = {
32
35
  axisColor: "--rudi-component-chart-axis-color",
33
36
  gridColor: "--rudi-component-chart-grid-color",
34
37
  labelColor: "--rudi-component-chart-label-color",
@@ -37,10 +40,10 @@ const sr = {
37
40
  tooltipText: "--rudi-component-chart-tooltip-text",
38
41
  tooltipBorder: "--rudi-component-chart-tooltip-border",
39
42
  chartBg: "--rudi-component-chart-bg"
40
- }, cr = Array.from(
43
+ }, zi = Array.from(
41
44
  { length: 8 },
42
- (r, e) => `--rudi-color-dataviz-series-${e + 1}`
43
- ), X = [
45
+ (e, r) => `--rudi-color-dataviz-series-${r + 1}`
46
+ ), ge = [
44
47
  "#2563eb",
45
48
  "#d946ef",
46
49
  "#f59e0b",
@@ -50,10 +53,10 @@ const sr = {
50
53
  "#06b6d4",
51
54
  "#f97316"
52
55
  ];
53
- function W() {
56
+ function Ne() {
54
57
  if (typeof window > "u")
55
58
  return {
56
- colors: X,
59
+ colors: ge,
57
60
  axisColor: "#6b7280",
58
61
  gridColor: "#e5e7eb",
59
62
  labelColor: "#111827",
@@ -61,207 +64,260 @@ function W() {
61
64
  tooltipBg: "#ffffff",
62
65
  tooltipText: "#111827",
63
66
  tooltipBorder: "#e5e7eb",
64
- chartBg: "#ffffff"
67
+ chartBg: "#ffffff",
68
+ tones: { default: "#6b7280", success: "#16a34a", warning: "#d97706", error: "#dc2626", info: "#2563eb" }
65
69
  };
66
- const r = getComputedStyle(document.documentElement), e = (n) => r.getPropertyValue(n).trim(), i = cr.map((n, a) => e(n) || X[a]), o = {};
67
- for (const [n, a] of Object.entries(sr))
68
- o[n] = e(a) || "";
70
+ const e = getComputedStyle(document.documentElement), r = (a) => e.getPropertyValue(a).trim(), t = zi.map((a, o) => r(a) || ge[o]), n = {};
71
+ for (const [a, o] of Object.entries(Oi))
72
+ n[a] = r(o) || "";
69
73
  return {
70
- colors: i,
71
- axisColor: o.axisColor,
72
- gridColor: o.gridColor,
73
- labelColor: o.labelColor,
74
- legendColor: o.legendColor,
75
- tooltipBg: o.tooltipBg,
76
- tooltipText: o.tooltipText,
77
- tooltipBorder: o.tooltipBorder,
78
- chartBg: o.chartBg
74
+ colors: t,
75
+ axisColor: n.axisColor,
76
+ gridColor: n.gridColor,
77
+ labelColor: n.labelColor,
78
+ legendColor: n.legendColor,
79
+ tooltipBg: n.tooltipBg,
80
+ tooltipText: n.tooltipText,
81
+ tooltipBorder: n.tooltipBorder,
82
+ chartBg: n.chartBg,
83
+ tones: {
84
+ default: r("--rudi-color-text-subtle") || "#6b7280",
85
+ success: r("--rudi-color-feedback-success") || "#16a34a",
86
+ warning: r("--rudi-color-feedback-warning") || "#d97706",
87
+ error: r("--rudi-color-feedback-error") || "#dc2626",
88
+ info: r("--rudi-color-feedback-info") || "#2563eb"
89
+ }
79
90
  };
80
91
  }
81
- function j() {
82
- const [r, e] = $(W), i = I(() => {
83
- e(W());
92
+ function pe() {
93
+ const [e, r] = O(Ne), t = A(() => {
94
+ r(Ne());
84
95
  }, []);
85
- return xe(() => {
86
- i();
87
- const o = new MutationObserver((n) => {
88
- for (const a of n)
89
- a.type === "attributes" && a.attributeName === "data-theme" && i();
96
+ return ne(() => {
97
+ t();
98
+ const n = new MutationObserver((o) => {
99
+ for (const s of o)
100
+ s.type === "attributes" && s.attributeName === "data-theme" && t();
90
101
  });
91
- return o.observe(document.documentElement, {
102
+ n.observe(document.documentElement, {
92
103
  attributes: !0,
93
104
  attributeFilter: ["data-theme"]
94
- }), () => o.disconnect();
95
- }, [i]), r;
105
+ });
106
+ const a = window.matchMedia?.("(prefers-color-scheme: dark)");
107
+ return a?.addEventListener("change", t), () => {
108
+ n.disconnect(), a?.removeEventListener("change", t);
109
+ };
110
+ }, [t]), e;
96
111
  }
97
- const k = b(
98
- function({ icon: e, size: i = "md", color: o, label: n, className: a }, d) {
99
- const c = typeof i == "string" ? `rudi-icon--${i}` : void 0, l = typeof i == "number" ? { width: i, height: i, ...o ? { color: o } : {} } : o ? { color: o } : void 0;
100
- return /* @__PURE__ */ t(
112
+ const R = v(
113
+ function({ icon: r, size: t = "md", color: n, label: a, className: o }, s) {
114
+ const d = typeof t == "string" ? `rudi-icon--${t}` : void 0, l = typeof t == "number" ? { width: t, height: t, ...n ? { color: n } : {} } : n ? { color: n } : void 0;
115
+ return /* @__PURE__ */ i(
101
116
  "span",
102
117
  {
103
- ref: d,
104
- className: m("rudi-icon", c, a),
105
- role: n ? "img" : void 0,
106
- "aria-label": n,
107
- "aria-hidden": n ? void 0 : !0,
118
+ ref: s,
119
+ className: u("rudi-icon", d, o),
120
+ role: a ? "img" : void 0,
121
+ "aria-label": a,
122
+ "aria-hidden": a ? void 0 : !0,
108
123
  style: l,
109
- children: /* @__PURE__ */ t(Ie, { icon: e })
124
+ children: /* @__PURE__ */ i(Sr, { icon: r })
110
125
  }
111
126
  );
112
127
  }
113
- ), Or = w.forwardRef(
128
+ ), jt = D.forwardRef(
114
129
  function({
115
- variant: e = "primary",
116
- size: i = "md",
117
- isLoading: o = !1,
118
- iconBefore: n,
119
- iconAfter: a,
120
- className: d,
121
- children: c,
130
+ variant: r = "primary",
131
+ size: t = "md",
132
+ isLoading: n = !1,
133
+ iconBefore: a,
134
+ iconAfter: o,
135
+ className: s,
136
+ children: d,
122
137
  ...l
123
- }, u) {
124
- const s = y(u), { buttonProps: p } = Q(l, o, s);
125
- return /* @__PURE__ */ t(
138
+ }, c) {
139
+ const m = B(c), { buttonProps: f } = ze(l, n, m);
140
+ return /* @__PURE__ */ i(
126
141
  "button",
127
142
  {
128
- ...p,
129
- ref: s,
130
- className: m(
143
+ ...f,
144
+ ref: m,
145
+ className: u(
131
146
  "rudi-button",
132
- `rudi-button--${e}`,
133
- `rudi-button--${i}`,
134
- o && "rudi-button--loading",
135
- d
147
+ `rudi-button--${r}`,
148
+ `rudi-button--${t}`,
149
+ n && "rudi-button--loading",
150
+ s
136
151
  ),
137
- children: o ? /* @__PURE__ */ h(T, { children: [
138
- /* @__PURE__ */ t("span", { className: "rudi-button__spinner", role: "img", "aria-hidden": "true" }),
139
- /* @__PURE__ */ t("span", { children: c })
140
- ] }) : /* @__PURE__ */ h(T, { children: [
141
- n && /* @__PURE__ */ t(k, { icon: n, size: i, className: "rudi-button__icon" }),
142
- /* @__PURE__ */ t("span", { children: c }),
143
- a && /* @__PURE__ */ t(k, { icon: a, size: i, className: "rudi-button__icon" })
152
+ children: n ? /* @__PURE__ */ p(w, { children: [
153
+ /* @__PURE__ */ i("span", { className: "rudi-button__spinner", role: "img", "aria-hidden": "true" }),
154
+ /* @__PURE__ */ i("span", { children: d })
155
+ ] }) : /* @__PURE__ */ p(w, { children: [
156
+ a && /* @__PURE__ */ i(R, { icon: a, size: t, className: "rudi-button__icon" }),
157
+ /* @__PURE__ */ i("span", { children: d }),
158
+ o && /* @__PURE__ */ i(R, { icon: o, size: t, className: "rudi-button__icon" })
144
159
  ] })
145
160
  }
146
161
  );
147
162
  }
148
- ), Kr = w.forwardRef(
163
+ ), qt = D.forwardRef(
149
164
  function({
150
- label: e,
151
- type: i = "text",
152
- placeholder: o,
153
- description: n,
154
- errorMessage: a,
155
- isRequired: d = !1,
156
- isDisabled: c = !1,
165
+ label: r,
166
+ type: t = "text",
167
+ placeholder: n,
168
+ description: a,
169
+ errorMessage: o,
170
+ isRequired: s = !1,
171
+ isDisabled: d = !1,
157
172
  value: l,
158
- defaultValue: u,
159
- onChange: s,
160
- className: p
161
- }, g) {
162
- const f = y(g), {
163
- labelProps: _,
164
- inputProps: v,
165
- descriptionProps: N,
173
+ defaultValue: c,
174
+ onChange: m,
175
+ onBlur: f,
176
+ name: g,
177
+ autoComplete: _,
178
+ inputMode: h,
179
+ maxLength: b,
180
+ isReadOnly: N,
181
+ autoFocus: y,
182
+ className: k
183
+ }, C) {
184
+ const T = B(C), {
185
+ labelProps: M,
186
+ inputProps: E,
187
+ descriptionProps: $,
166
188
  errorMessageProps: x,
167
- isInvalid: C
168
- } = ne(
189
+ isInvalid: S
190
+ } = xe(
169
191
  {
170
- label: e,
171
- type: i,
172
- placeholder: o,
173
- description: n,
174
- errorMessage: a,
175
- isRequired: d,
176
- isDisabled: c,
192
+ label: r,
193
+ type: t,
194
+ placeholder: n,
195
+ description: a,
196
+ errorMessage: o,
197
+ isRequired: s,
198
+ isDisabled: d,
177
199
  value: l,
178
- defaultValue: u,
179
- onChange: s,
180
- isInvalid: !!a
200
+ defaultValue: c,
201
+ onChange: m,
202
+ onBlur: f,
203
+ name: g,
204
+ autoComplete: _,
205
+ inputMode: h,
206
+ maxLength: b,
207
+ isReadOnly: N,
208
+ autoFocus: y,
209
+ isInvalid: !!o
181
210
  },
182
- f
211
+ T
183
212
  );
184
- return /* @__PURE__ */ h("div", { className: m("rudi-input", p), children: [
185
- /* @__PURE__ */ h("label", { ..._, className: "rudi-input__label", children: [
186
- e,
187
- d && /* @__PURE__ */ h("span", { className: "rudi-input__required", "aria-hidden": "true", children: [
213
+ return /* @__PURE__ */ p("div", { className: u("rudi-input", k), children: [
214
+ /* @__PURE__ */ p("label", { ...M, className: "rudi-input__label", children: [
215
+ r,
216
+ s && /* @__PURE__ */ p("span", { className: "rudi-input__required", "aria-hidden": "true", children: [
188
217
  " ",
189
218
  "*"
190
219
  ] })
191
220
  ] }),
192
- /* @__PURE__ */ t(
221
+ /* @__PURE__ */ i(
193
222
  "input",
194
223
  {
195
- ...v,
196
- ref: f,
197
- className: m(
224
+ ...E,
225
+ ref: T,
226
+ className: u(
198
227
  "rudi-input__field",
199
- C && "rudi-input__field--error"
228
+ S && "rudi-input__field--error"
200
229
  )
201
230
  }
202
231
  ),
203
- n && !C && /* @__PURE__ */ t("p", { ...N, className: "rudi-input__description", children: n }),
204
- C && a && /* @__PURE__ */ t("p", { ...x, className: "rudi-input__error", children: a })
232
+ a && !S && /* @__PURE__ */ i("p", { ...$, className: "rudi-input__description", children: a }),
233
+ S && o && /* @__PURE__ */ i("p", { ...x, className: "rudi-input__error", children: o })
205
234
  ] });
206
235
  }
207
- ), Lr = b(
208
- function(e, i) {
209
- const o = y(i), n = q(e), { inputProps: a } = ae(e, n, o);
210
- return /* @__PURE__ */ h(
211
- "label",
212
- {
213
- className: m(
214
- "rudi-checkbox",
215
- e.isDisabled && "rudi-checkbox--disabled",
216
- e.className
236
+ ), Ae = ae(null);
237
+ function Fe({ props: e, inputProps: r, isSelected: t, inputRef: n }) {
238
+ const a = we(), o = !!e.errorMessage, s = /* @__PURE__ */ p(
239
+ "label",
240
+ {
241
+ className: u(
242
+ "rudi-checkbox",
243
+ e.isDisabled && "rudi-checkbox--disabled",
244
+ !o && e.className
245
+ ),
246
+ children: [
247
+ /* @__PURE__ */ i(
248
+ "input",
249
+ {
250
+ ...r,
251
+ ref: n,
252
+ className: "rudi-checkbox__input",
253
+ "aria-invalid": o || void 0,
254
+ "aria-describedby": o ? a : r["aria-describedby"]
255
+ }
217
256
  ),
218
- children: [
219
- /* @__PURE__ */ t("input", { ...a, ref: o, className: "rudi-checkbox__input" }),
220
- /* @__PURE__ */ t(
221
- "span",
222
- {
223
- className: m(
224
- "rudi-checkbox__control",
225
- n.isSelected && "rudi-checkbox__control--checked",
226
- e.isIndeterminate && "rudi-checkbox__control--indeterminate"
227
- ),
228
- "aria-hidden": "true"
229
- }
230
- ),
231
- /* @__PURE__ */ t("span", { className: "rudi-checkbox__label", children: e.children })
232
- ]
233
- }
234
- );
257
+ /* @__PURE__ */ i(
258
+ "span",
259
+ {
260
+ className: u(
261
+ "rudi-checkbox__control",
262
+ t && "rudi-checkbox__control--checked",
263
+ e.isIndeterminate && "rudi-checkbox__control--indeterminate"
264
+ ),
265
+ "aria-hidden": "true"
266
+ }
267
+ ),
268
+ /* @__PURE__ */ i("span", { className: "rudi-checkbox__label", children: e.children })
269
+ ]
270
+ }
271
+ );
272
+ return o ? /* @__PURE__ */ p("div", { className: u("rudi-checkbox-field", e.className), children: [
273
+ s,
274
+ /* @__PURE__ */ i("p", { id: a, className: "rudi-checkbox__error", children: e.errorMessage })
275
+ ] }) : s;
276
+ }
277
+ const Ai = v(
278
+ function({ group: r, ...t }, n) {
279
+ const a = B(n), { inputProps: o } = nr({ ...t, value: t.value ?? "" }, r, a);
280
+ return /* @__PURE__ */ i(Fe, { props: t, inputProps: o, isSelected: r.isSelected(t.value ?? ""), inputRef: a });
281
+ }
282
+ ), Fi = v(
283
+ function(r, t) {
284
+ const n = B(t), a = Be(r), { inputProps: o } = ar({ ...r, isInvalid: !!r.errorMessage }, a, n);
285
+ return /* @__PURE__ */ i(Fe, { props: r, inputProps: o, isSelected: a.isSelected, inputRef: n });
286
+ }
287
+ ), Wt = v(
288
+ function(r, t) {
289
+ const n = K(Ae);
290
+ return n ? /* @__PURE__ */ i(Ai, { ...r, group: n, ref: t }) : /* @__PURE__ */ i(Fi, { ...r, ref: t });
235
291
  }
236
292
  );
237
- function Gr(r) {
238
- const e = we(r), { groupProps: i, labelProps: o, descriptionProps: n, errorMessageProps: a } = se(r, e);
239
- return /* @__PURE__ */ h(
293
+ function Xt(e) {
294
+ const r = { ...e, isInvalid: !!e.errorMessage }, t = Pr(r), { groupProps: n, labelProps: a, descriptionProps: o, errorMessageProps: s } = or(r, t);
295
+ return /* @__PURE__ */ i(Ae.Provider, { value: t, children: /* @__PURE__ */ p(
240
296
  "div",
241
297
  {
242
- ...i,
243
- className: m("rudi-checkbox-group", r.className),
298
+ ...n,
299
+ className: u("rudi-checkbox-group", e.className),
244
300
  children: [
245
- /* @__PURE__ */ t("span", { ...o, className: "rudi-checkbox-group__label", children: r.label }),
246
- r.children,
247
- r.description && !r.errorMessage && /* @__PURE__ */ t(
301
+ /* @__PURE__ */ i("span", { ...a, className: "rudi-checkbox-group__label", children: e.label }),
302
+ e.children,
303
+ e.description && !e.errorMessage && /* @__PURE__ */ i(
248
304
  "p",
249
305
  {
250
- ...n,
306
+ ...o,
251
307
  className: "rudi-checkbox-group__description",
252
- children: r.description
308
+ children: e.description
253
309
  }
254
310
  ),
255
- r.errorMessage && /* @__PURE__ */ t("p", { ...a, className: "rudi-checkbox-group__error", children: r.errorMessage })
311
+ e.errorMessage && /* @__PURE__ */ i("p", { ...s, className: "rudi-checkbox-group__error", children: e.errorMessage })
256
312
  ]
257
313
  }
258
- );
314
+ ) });
259
315
  }
260
- function dr(r) {
261
- return /* @__PURE__ */ t(
316
+ function Gi(e) {
317
+ return /* @__PURE__ */ i(
262
318
  "svg",
263
319
  {
264
- ...r,
320
+ ...e,
265
321
  xmlns: "http://www.w3.org/2000/svg",
266
322
  width: "16",
267
323
  height: "16",
@@ -271,489 +327,569 @@ function dr(r) {
271
327
  strokeWidth: "2",
272
328
  strokeLinecap: "round",
273
329
  strokeLinejoin: "round",
274
- children: /* @__PURE__ */ t("polyline", { points: "6 9 12 15 18 9" })
330
+ children: /* @__PURE__ */ i("polyline", { points: "6 9 12 15 18 9" })
275
331
  }
276
332
  );
277
333
  }
278
- function lr({
279
- state: r,
280
- triggerRef: e,
281
- popoverRef: i,
282
- children: o
334
+ function Ki({
335
+ state: e,
336
+ triggerRef: r,
337
+ popoverRef: t,
338
+ children: n
283
339
  }) {
284
- const { popoverProps: n } = le({ triggerRef: e, popoverRef: i }, r);
285
- return /* @__PURE__ */ t(
340
+ const { popoverProps: a } = Ce({ triggerRef: r, popoverRef: t }, e);
341
+ return /* @__PURE__ */ i(
286
342
  "div",
287
343
  {
288
- ...n,
289
- ref: i,
344
+ ...a,
345
+ ref: t,
290
346
  className: "rudi-select__popover",
291
- children: o
347
+ children: n
292
348
  }
293
349
  );
294
350
  }
295
- function ur({ state: r, listBoxRef: e, ...i }) {
296
- const { listBoxProps: o } = ue(i, r, e);
297
- return /* @__PURE__ */ t("ul", { ...o, ref: e, className: "rudi-select__listbox", children: [...r.collection].map((n) => /* @__PURE__ */ t(mr, { item: n, state: r }, n.key)) });
351
+ function Vi({ state: e, listBoxRef: r, ...t }) {
352
+ const { listBoxProps: n } = Se(t, e, r);
353
+ return /* @__PURE__ */ i("ul", { ...n, ref: r, className: "rudi-select__listbox", children: [...e.collection].map((a) => /* @__PURE__ */ i(Hi, { item: a, state: e }, a.key)) });
298
354
  }
299
- function mr({ item: r, state: e }) {
300
- const i = R(null), { optionProps: o, isSelected: n, isFocused: a } = me(
301
- { key: r.key },
302
- e,
303
- i
355
+ function Hi({ item: e, state: r }) {
356
+ const t = P(null), { optionProps: n, isSelected: a, isFocused: o } = Pe(
357
+ { key: e.key },
358
+ r,
359
+ t
304
360
  );
305
- return /* @__PURE__ */ t(
361
+ return /* @__PURE__ */ i(
306
362
  "li",
307
363
  {
308
- ...o,
309
- ref: i,
364
+ ...n,
365
+ ref: t,
310
366
  className: "rudi-select__option",
311
- "data-focused": a,
312
- "aria-selected": n,
313
- children: r.rendered
367
+ "data-focused": o,
368
+ "aria-selected": a,
369
+ children: e.rendered
314
370
  }
315
371
  );
316
372
  }
317
- function Ar(r) {
318
- const e = Te(r), i = R(null), o = R(null), n = R(null), {
319
- labelProps: a,
320
- triggerProps: d,
321
- valueProps: c,
373
+ function Zt(e) {
374
+ const r = Tr(e), t = P(null), n = P(null), a = P(null), {
375
+ labelProps: o,
376
+ triggerProps: s,
377
+ valueProps: d,
322
378
  menuProps: l,
323
- descriptionProps: u,
324
- errorMessageProps: s
379
+ descriptionProps: c,
380
+ errorMessageProps: m
325
381
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
326
- } = ce(r, e, i), { buttonProps: p } = O(d, i);
327
- return /* @__PURE__ */ h("div", { className: m("rudi-select", r.className), children: [
328
- /* @__PURE__ */ t("label", { ...a, className: "rudi-select__label", children: r.label }),
329
- /* @__PURE__ */ t(de, { state: e, triggerRef: i, label: r.label }),
330
- /* @__PURE__ */ h(
382
+ } = sr(e, r, t), { buttonProps: f } = G(s, t);
383
+ return /* @__PURE__ */ p("div", { className: u("rudi-select", e.className), children: [
384
+ /* @__PURE__ */ i("label", { ...o, className: "rudi-select__label", children: e.label }),
385
+ /* @__PURE__ */ i(dr, { state: r, triggerRef: t, label: e.label }),
386
+ /* @__PURE__ */ p(
331
387
  "button",
332
388
  {
333
- ...p,
334
- ref: i,
335
- className: m(
389
+ ...f,
390
+ ref: t,
391
+ className: u(
336
392
  "rudi-select__trigger",
337
- r.errorMessage && "rudi-select__trigger--error"
393
+ e.errorMessage && "rudi-select__trigger--error"
338
394
  ),
339
395
  children: [
340
- /* @__PURE__ */ t("span", { ...c, children: e.selectedItem ? e.selectedItem.rendered : r.placeholder || "Select an option" }),
341
- /* @__PURE__ */ t(dr, { "aria-hidden": "true" })
396
+ /* @__PURE__ */ i("span", { ...d, children: r.selectedItem ? r.selectedItem.rendered : e.placeholder || "Select an option" }),
397
+ /* @__PURE__ */ i(Gi, { "aria-hidden": "true" })
342
398
  ]
343
399
  }
344
400
  ),
345
- e.isOpen && /* @__PURE__ */ t(lr, { state: e, triggerRef: i, popoverRef: o, children: /* @__PURE__ */ t(ur, { ...l, state: e, listBoxRef: n }) }),
346
- r.description && !r.errorMessage && /* @__PURE__ */ t("p", { ...u, className: "rudi-select__description", children: r.description }),
347
- r.errorMessage && /* @__PURE__ */ t("p", { ...s, className: "rudi-select__error", children: r.errorMessage })
401
+ r.isOpen && /* @__PURE__ */ i(Ki, { state: r, triggerRef: t, popoverRef: n, children: /* @__PURE__ */ i(Vi, { ...l, state: r, listBoxRef: a }) }),
402
+ e.description && !e.errorMessage && /* @__PURE__ */ i("p", { ...c, className: "rudi-select__description", children: e.description }),
403
+ e.errorMessage && /* @__PURE__ */ i("p", { ...m, className: "rudi-select__error", children: e.errorMessage })
348
404
  ] });
349
405
  }
350
- function Fr(r) {
351
- return /* @__PURE__ */ t(Me, { ...r });
406
+ function Qt(e) {
407
+ return /* @__PURE__ */ i(Ir, { ...e });
352
408
  }
353
- function jr({ className: r, ...e }) {
354
- return /* @__PURE__ */ t(Ee, { className: "rudi-menu__popover", children: /* @__PURE__ */ t(
355
- Oe,
409
+ function Yt({ className: e, ...r }) {
410
+ return /* @__PURE__ */ i(oe, { className: "rudi-menu__popover", children: /* @__PURE__ */ i(
411
+ Mr,
356
412
  {
357
- ...e,
358
- className: m("rudi-menu__list", r)
413
+ ...r,
414
+ className: u("rudi-menu__list", e)
359
415
  }
360
416
  ) });
361
417
  }
362
- function zr({ isDestructive: r, className: e, ...i }) {
363
- return /* @__PURE__ */ t(
364
- Ke,
418
+ function Ui({ className: e, ...r }) {
419
+ return /* @__PURE__ */ i(
420
+ Dr,
421
+ {
422
+ ...r,
423
+ className: u("rudi-menu__item-shortcut", e)
424
+ }
425
+ );
426
+ }
427
+ function Jt({
428
+ isDestructive: e,
429
+ icon: r,
430
+ label: t,
431
+ description: n,
432
+ shortcut: a,
433
+ className: o,
434
+ textValue: s,
435
+ children: d,
436
+ ...l
437
+ }) {
438
+ const c = t != null || r != null || n != null || a != null;
439
+ return /* @__PURE__ */ i(
440
+ Er,
365
441
  {
366
- ...i,
367
- className: (o) => m(
442
+ ...l,
443
+ textValue: s ?? t ?? (typeof d == "string" ? d : void 0),
444
+ className: (f) => u(
368
445
  "rudi-menu__item",
369
- r && "rudi-menu__item--destructive",
370
- typeof e == "function" ? e(o) : e
446
+ e && "rudi-menu__item--destructive",
447
+ typeof o == "function" ? o(f) : o
371
448
  ),
372
- "data-destructive": r || void 0
449
+ "data-destructive": e || void 0,
450
+ children: c ? /* @__PURE__ */ p(w, { children: [
451
+ r && /* @__PURE__ */ i(R, { icon: r, className: "rudi-menu__item-icon" }),
452
+ (t != null || n != null) && /* @__PURE__ */ p("span", { className: "rudi-menu__item-content", children: [
453
+ t != null && /* @__PURE__ */ i(z, { slot: "label", className: "rudi-menu__item-label", children: t }),
454
+ n != null && /* @__PURE__ */ i(z, { slot: "description", className: "rudi-menu__item-description", children: n })
455
+ ] }),
456
+ a != null && /* @__PURE__ */ i(Ui, { children: a })
457
+ ] }) : d
373
458
  }
374
459
  );
375
460
  }
376
- function Hr({
377
- title: r,
378
- className: e,
379
- children: i,
380
- ...o
461
+ function en({
462
+ title: e,
463
+ className: r,
464
+ children: t,
465
+ ...n
381
466
  }) {
382
- return /* @__PURE__ */ h(Le, { ...o, className: m("rudi-menu__section", e), children: [
383
- r && /* @__PURE__ */ t(Ge, { className: "rudi-menu__section-header", children: r }),
384
- /* @__PURE__ */ t(Ae, { items: o.items, children: i })
467
+ return /* @__PURE__ */ p(Lr, { ...n, className: u("rudi-menu__section", r), children: [
468
+ e && /* @__PURE__ */ i(Or, { className: "rudi-menu__section-header", children: e }),
469
+ /* @__PURE__ */ i(se, { items: n.items, children: t })
385
470
  ] });
386
471
  }
387
- function Ur({ className: r, ...e }) {
388
- return /* @__PURE__ */ t(
389
- Fe,
472
+ function rn({ className: e, ...r }) {
473
+ return /* @__PURE__ */ i(
474
+ zr,
390
475
  {
391
- ...e,
392
- className: m("rudi-menu__item-shortcut", r)
476
+ ...r,
477
+ className: u("rudi-menu__separator", e)
393
478
  }
394
479
  );
395
480
  }
396
- const Xr = b(function({
397
- isOpen: e,
398
- onClose: i,
399
- title: o,
400
- isDismissable: n = !0,
401
- size: a = "md",
402
- children: d,
403
- className: c
404
- }, l) {
405
- const u = R(null), s = y(l);
406
- fe({ isDisabled: !e });
407
- const p = {
408
- isOpen: e,
409
- close: i,
481
+ function tn(e) {
482
+ return /* @__PURE__ */ i(Ar, { ...e });
483
+ }
484
+ const he = D.forwardRef(
485
+ function({
486
+ variant: r = "secondary",
487
+ size: t = "md",
488
+ isLoading: n = !1,
489
+ className: a,
490
+ children: o,
491
+ ...s
492
+ }, d) {
493
+ const l = B(d), { buttonProps: c } = ze(s, n, l);
494
+ return /* @__PURE__ */ i(
495
+ "button",
496
+ {
497
+ ...c,
498
+ ref: l,
499
+ className: u(
500
+ "rudi-icon-button",
501
+ `rudi-icon-button--${r}`,
502
+ `rudi-icon-button--${t}`,
503
+ a
504
+ ),
505
+ children: o
506
+ }
507
+ );
508
+ }
509
+ );
510
+ function re({ children: e, className: r }) {
511
+ return /* @__PURE__ */ i("div", { className: u("rudi-dialog__footer", r), children: e });
512
+ }
513
+ const ji = v(function(r, t) {
514
+ return r.isOpen ? /* @__PURE__ */ i(qi, { ...r, forwardedRef: t }) : null;
515
+ });
516
+ function qi({
517
+ onClose: e,
518
+ title: r,
519
+ isDismissable: t = !0,
520
+ size: n = "md",
521
+ children: a,
522
+ className: o,
523
+ forwardedRef: s
524
+ }) {
525
+ const d = P(null), l = B(s);
526
+ lr();
527
+ const c = {
528
+ isOpen: !0,
529
+ close: e,
410
530
  open: () => {
411
531
  },
412
532
  toggle: () => {
413
533
  },
414
534
  setOpen: () => {
415
535
  }
416
- }, { modalProps: g, underlayProps: f } = he(
417
- { isDismissable: n },
418
- p,
419
- s
420
- ), { dialogProps: _, titleProps: v } = pe({}, s);
421
- return e ? /* @__PURE__ */ t(ge, { children: /* @__PURE__ */ t(
536
+ }, { modalProps: m, underlayProps: f } = cr(
537
+ { isDismissable: t },
538
+ c,
539
+ l
540
+ ), { dialogProps: g, titleProps: _ } = ur({}, l), h = $e.toArray(a), b = h.filter((y) => X(y) && y.type === re), N = h.filter((y) => !(X(y) && y.type === re));
541
+ return /* @__PURE__ */ i(mr, { children: /* @__PURE__ */ i(
422
542
  "div",
423
543
  {
424
544
  ...f,
425
- ref: u,
545
+ ref: d,
426
546
  className: "rudi-dialog__overlay",
427
- children: /* @__PURE__ */ t(be, { contain: !0, restoreFocus: !0, autoFocus: !0, children: /* @__PURE__ */ h(
547
+ children: /* @__PURE__ */ i(pr, { contain: !0, restoreFocus: !0, autoFocus: !0, children: /* @__PURE__ */ p(
428
548
  "div",
429
549
  {
550
+ ...m,
430
551
  ...g,
431
- ..._,
432
- ref: s,
433
- className: m(
552
+ ref: l,
553
+ className: u(
434
554
  "rudi-dialog",
435
- `rudi-dialog--${a}`,
436
- c
555
+ `rudi-dialog--${n}`,
556
+ o
437
557
  ),
438
558
  children: [
439
- /* @__PURE__ */ t("h2", { ...v, className: "rudi-dialog__title", children: o }),
440
- /* @__PURE__ */ t("div", { className: "rudi-dialog__body", children: d })
559
+ /* @__PURE__ */ p("div", { className: "rudi-dialog__header", children: [
560
+ /* @__PURE__ */ i("h2", { ..._, className: "rudi-dialog__title", children: r }),
561
+ t && /* @__PURE__ */ i(he, { "aria-label": "Close", variant: "ghost", size: "sm", onPress: e, children: /* @__PURE__ */ i(R, { icon: "lucide:x" }) })
562
+ ] }),
563
+ /* @__PURE__ */ i("div", { className: "rudi-dialog__body", children: N }),
564
+ b
441
565
  ]
442
566
  }
443
567
  ) })
444
568
  }
445
- ) }) : null;
446
- }), Wr = b(
447
- function(e, i) {
448
- const o = y(i), n = q(e), { inputProps: a } = _e(e, n, o);
449
- return /* @__PURE__ */ h(
569
+ ) });
570
+ }
571
+ const nn = Object.assign(ji, { Footer: re }), an = v(
572
+ function(r, t) {
573
+ const n = B(t), a = Be(r), { inputProps: o } = hr(r, a, n);
574
+ return /* @__PURE__ */ p(
450
575
  "label",
451
576
  {
452
- className: m(
577
+ className: u(
453
578
  "rudi-switch",
454
- e.isDisabled && "rudi-switch--disabled",
455
- e.className
579
+ r.isDisabled && "rudi-switch--disabled",
580
+ r.className
456
581
  ),
457
582
  children: [
458
- /* @__PURE__ */ t(ve, { children: /* @__PURE__ */ t("input", { ...a, ref: o }) }),
459
- /* @__PURE__ */ t(
583
+ /* @__PURE__ */ i(te, { children: /* @__PURE__ */ i("input", { ...o, ref: n }) }),
584
+ /* @__PURE__ */ i(
460
585
  "span",
461
586
  {
462
- className: m(
587
+ className: u(
463
588
  "rudi-switch__track",
464
- n.isSelected && "rudi-switch__track--on"
589
+ a.isSelected && "rudi-switch__track--on"
465
590
  ),
466
591
  "aria-hidden": "true",
467
- children: /* @__PURE__ */ t("span", { className: "rudi-switch__thumb" })
592
+ children: /* @__PURE__ */ i("span", { className: "rudi-switch__thumb" })
468
593
  }
469
594
  ),
470
- /* @__PURE__ */ t("span", { className: "rudi-switch__label", children: e.children })
595
+ r.children != null && /* @__PURE__ */ i("span", { className: "rudi-switch__label", children: r.children })
471
596
  ]
472
597
  }
473
598
  );
474
599
  }
475
- ), fr = ke(null);
476
- function Yr(r) {
477
- const e = $e(r), { radioGroupProps: i, labelProps: o, descriptionProps: n, errorMessageProps: a } = Ne(r, e);
478
- return /* @__PURE__ */ t(fr.Provider, { value: e, children: /* @__PURE__ */ h(
600
+ ), Ge = ae(null);
601
+ function on(e) {
602
+ const r = { ...e, isInvalid: !!e.errorMessage }, t = wr(r), { radioGroupProps: n, labelProps: a, descriptionProps: o, errorMessageProps: s } = fr(r, t);
603
+ return /* @__PURE__ */ i(Ge.Provider, { value: t, children: /* @__PURE__ */ p(
479
604
  "div",
480
605
  {
481
- ...i,
482
- className: m("rudi-radio-group", r.className),
606
+ ...n,
607
+ className: u("rudi-radio-group", e.className),
483
608
  children: [
484
- /* @__PURE__ */ t("span", { ...o, className: "rudi-radio-group__label", children: r.label }),
485
- /* @__PURE__ */ t(
609
+ /* @__PURE__ */ i("span", { ...a, className: "rudi-radio-group__label", children: e.label }),
610
+ /* @__PURE__ */ i(
486
611
  "div",
487
612
  {
488
- className: m(
613
+ className: u(
489
614
  "rudi-radio-group__options",
490
- r.orientation === "horizontal" && "rudi-radio-group__options--horizontal"
615
+ e.orientation === "horizontal" && "rudi-radio-group__options--horizontal"
491
616
  ),
492
- children: r.children
617
+ children: e.children
493
618
  }
494
619
  ),
495
- r.description && !r.errorMessage && /* @__PURE__ */ t("p", { ...n, className: "rudi-radio-group__description", children: r.description }),
496
- r.errorMessage && /* @__PURE__ */ t("p", { ...a, className: "rudi-radio-group__error", children: r.errorMessage })
620
+ e.description && !e.errorMessage && /* @__PURE__ */ i("p", { ...o, className: "rudi-radio-group__description", children: e.description }),
621
+ e.errorMessage && /* @__PURE__ */ i("p", { ...s, className: "rudi-radio-group__error", children: e.errorMessage })
497
622
  ]
498
623
  }
499
624
  ) });
500
625
  }
501
- const Zr = b(
502
- function({ delay: e = 500, closeDelay: i = 0, children: o }, n) {
503
- const a = De({ delay: e, closeDelay: i }), d = R(null), { triggerProps: c, tooltipProps: l } = Re({ delay: e, closeDelay: i }, a, d), [u, s] = o, { "aria-describedby": p, tabIndex: g, ...f } = c;
504
- return /* @__PURE__ */ h("span", { ref: n, className: "rudi-tooltip-trigger", ...f, children: [
505
- w.cloneElement(u, {
506
- ref: d,
507
- "aria-describedby": p
626
+ const sn = v(
627
+ function(r, t) {
628
+ const n = K(Ge);
629
+ if (!n)
630
+ throw new Error("RudiRadio must be rendered inside a RudiRadioGroup.");
631
+ const a = B(t), { inputProps: o, isSelected: s, isDisabled: d } = _r(r, n, a);
632
+ return /* @__PURE__ */ p(
633
+ "label",
634
+ {
635
+ className: u(
636
+ "rudi-radio",
637
+ d && "rudi-radio--disabled",
638
+ r.className
639
+ ),
640
+ children: [
641
+ /* @__PURE__ */ i("input", { ...o, ref: a, className: "rudi-radio__input" }),
642
+ /* @__PURE__ */ i(
643
+ "span",
644
+ {
645
+ className: u(
646
+ "rudi-radio__control",
647
+ s && "rudi-radio__control--selected"
648
+ ),
649
+ "aria-hidden": "true"
650
+ }
651
+ ),
652
+ /* @__PURE__ */ i("span", { className: "rudi-radio__label", children: r.children })
653
+ ]
654
+ }
655
+ );
656
+ }
657
+ ), dn = v(
658
+ function({ delay: r = 500, closeDelay: t = 0, children: n }, a) {
659
+ const o = $r({ delay: r, closeDelay: t }), s = P(null), { triggerProps: d, tooltipProps: l } = gr({ delay: r, closeDelay: t }, o, s), [c, m] = n, { "aria-describedby": f, tabIndex: g, ..._ } = d;
660
+ return /* @__PURE__ */ p("span", { ref: a, className: "rudi-tooltip-trigger", ..._, children: [
661
+ D.cloneElement(c, {
662
+ ref: s,
663
+ "aria-describedby": f
508
664
  }),
509
- a.isOpen && w.cloneElement(s, l)
665
+ o.isOpen && D.cloneElement(m, l)
510
666
  ] });
511
667
  }
512
- ), qr = b(
513
- function({ children: e, className: i, ...o }, n) {
514
- const { tooltipProps: a } = Ce(o);
515
- return /* @__PURE__ */ t(
668
+ ), ln = v(
669
+ function({ children: r, className: t, ...n }, a) {
670
+ const { tooltipProps: o } = br(n);
671
+ return /* @__PURE__ */ i(
516
672
  "span",
517
673
  {
518
- ...a,
519
- ref: n,
520
- className: m("rudi-tooltip", i),
674
+ ...o,
675
+ ref: a,
676
+ className: u("rudi-tooltip", t),
521
677
  role: "tooltip",
522
- children: e
678
+ children: r
523
679
  }
524
680
  );
525
681
  }
526
682
  );
527
- function Jr({
528
- variant: r,
529
- title: e,
530
- icon: i,
531
- isPolite: o = !1,
532
- dismissible: n = !1,
533
- onDismiss: a,
534
- children: d,
535
- className: c
683
+ function Wi({
684
+ variant: e,
685
+ title: r,
686
+ icon: t,
687
+ isPolite: n = !1,
688
+ dismissible: a = !1,
689
+ onDismiss: o,
690
+ children: s,
691
+ className: d
536
692
  }) {
537
- const [l, u] = $(!1);
538
- return l ? null : /* @__PURE__ */ h(
693
+ const [l, c] = O(!1);
694
+ return l ? null : /* @__PURE__ */ p(
539
695
  "div",
540
696
  {
541
- role: o ? "status" : "alert",
542
- className: m(
697
+ role: n ? "status" : "alert",
698
+ className: u(
543
699
  "rudi-alert",
544
- `rudi-alert--${r}`,
545
- i && "rudi-alert--has-icon",
546
- n && "rudi-alert--dismissible",
547
- c
700
+ `rudi-alert--${e}`,
701
+ t && "rudi-alert--has-icon",
702
+ a && "rudi-alert--dismissible",
703
+ d
548
704
  ),
549
705
  children: [
550
- i && /* @__PURE__ */ t(k, { icon: i, size: "md", className: "rudi-alert__icon", "aria-hidden": "true" }),
551
- /* @__PURE__ */ h("div", { className: "rudi-alert__body", children: [
552
- e && /* @__PURE__ */ t("p", { className: "rudi-alert__title", children: e }),
553
- /* @__PURE__ */ t("div", { className: "rudi-alert__content", children: d })
706
+ t && /* @__PURE__ */ i(R, { icon: t, size: "md", className: "rudi-alert__icon", "aria-hidden": "true" }),
707
+ /* @__PURE__ */ p("div", { className: "rudi-alert__body", children: [
708
+ r && /* @__PURE__ */ i("p", { className: "rudi-alert__title", children: r }),
709
+ /* @__PURE__ */ i("div", { className: "rudi-alert__content", children: s })
554
710
  ] }),
555
- n && /* @__PURE__ */ t(
711
+ a && /* @__PURE__ */ i(
556
712
  "button",
557
713
  {
558
714
  type: "button",
559
715
  className: "rudi-alert__dismiss",
560
716
  "aria-label": "Dismiss alert",
561
717
  onClick: () => {
562
- u(!0), a?.();
718
+ c(!0), o?.();
563
719
  },
564
- children: /* @__PURE__ */ t(k, { icon: "mdi:close", size: "sm", "aria-hidden": "true" })
720
+ children: /* @__PURE__ */ i(R, { icon: "mdi:close", size: "sm", "aria-hidden": "true" })
565
721
  }
566
722
  )
567
723
  ]
568
724
  }
569
725
  );
570
726
  }
571
- const Qr = w.forwardRef(
572
- function({
573
- variant: e = "secondary",
574
- size: i = "md",
575
- isLoading: o = !1,
576
- className: n,
577
- children: a,
578
- ...d
579
- }, c) {
580
- const l = y(c), { buttonProps: u } = Q(d, o, l);
581
- return /* @__PURE__ */ t(
582
- "button",
583
- {
584
- ...u,
585
- ref: l,
586
- className: m(
587
- "rudi-icon-button",
588
- `rudi-icon-button--${e}`,
589
- `rudi-icon-button--${i}`,
590
- n
591
- ),
592
- children: a
593
- }
594
- );
595
- }
596
- );
597
- function hr({
598
- variant: r = "default",
599
- size: e = "md",
600
- dot: i = !1,
601
- children: o,
602
- className: n
727
+ function Xi({
728
+ variant: e = "default",
729
+ size: r = "md",
730
+ dot: t = !1,
731
+ children: n,
732
+ className: a
603
733
  }) {
604
- return /* @__PURE__ */ t(
734
+ return /* @__PURE__ */ i(
605
735
  "span",
606
736
  {
607
- className: m(
737
+ className: u(
608
738
  "rudi-badge",
609
- `rudi-badge--${r}`,
610
739
  `rudi-badge--${e}`,
611
- i && "rudi-badge--dot",
612
- n
740
+ `rudi-badge--${r}`,
741
+ t && "rudi-badge--dot",
742
+ a
613
743
  ),
614
- children: !i && o
744
+ children: !t && n
615
745
  }
616
746
  );
617
747
  }
618
- function Vr({
619
- variant: r = "default",
620
- dismissible: e = !1,
621
- onDismiss: i,
622
- onPress: o,
623
- isDisabled: n = !1,
624
- children: a,
625
- className: d
748
+ function cn({
749
+ variant: e = "default",
750
+ dismissible: r = !1,
751
+ onDismiss: t,
752
+ onPress: n,
753
+ isDisabled: a = !1,
754
+ children: o,
755
+ className: s
626
756
  }) {
627
- const [c, l] = $(!1), u = R(null), { buttonProps: s } = O(
757
+ const [d, l] = O(!1), c = P(null), { buttonProps: m } = G(
628
758
  {
629
- onPress: o,
630
- isDisabled: n,
631
- elementType: o ? "button" : "span"
759
+ onPress: n,
760
+ isDisabled: a,
761
+ elementType: n ? "button" : "span"
632
762
  },
633
- u
634
- ), p = typeof a == "string" ? `Remove ${a}` : "Remove", g = m(
763
+ c
764
+ ), f = typeof o == "string" ? `Remove ${o}` : "Remove", g = u(
635
765
  "rudi-tag",
636
- `rudi-tag--${r}`,
637
- o && "rudi-tag--interactive",
638
- e && "rudi-tag--dismissible",
639
- d
766
+ `rudi-tag--${e}`,
767
+ n && "rudi-tag--interactive",
768
+ r && "rudi-tag--dismissible",
769
+ s
640
770
  );
641
- return c ? null : o ? /* @__PURE__ */ h("button", { ref: u, ...s, className: g, children: [
642
- a,
643
- e && /* @__PURE__ */ t(
771
+ return d ? null : n ? /* @__PURE__ */ p("button", { ref: c, ...m, className: g, children: [
772
+ o,
773
+ r && /* @__PURE__ */ i(
644
774
  "span",
645
775
  {
646
776
  role: "button",
647
777
  tabIndex: 0,
648
778
  className: "rudi-tag__close",
649
- "aria-label": p,
650
- onClick: (f) => {
651
- f.stopPropagation(), l(!0), i?.();
779
+ "aria-label": f,
780
+ onClick: (_) => {
781
+ _.stopPropagation(), l(!0), t?.();
652
782
  },
653
- onKeyDown: (f) => {
654
- (f.key === "Enter" || f.key === " ") && (f.preventDefault(), f.stopPropagation(), l(!0), i?.());
783
+ onKeyDown: (_) => {
784
+ (_.key === "Enter" || _.key === " ") && (_.preventDefault(), _.stopPropagation(), l(!0), t?.());
655
785
  },
656
- children: /* @__PURE__ */ t(k, { icon: "mdi:close", size: "sm", "aria-hidden": "true" })
786
+ children: /* @__PURE__ */ i(R, { icon: "mdi:close", size: "sm", "aria-hidden": "true" })
657
787
  }
658
788
  )
659
- ] }) : /* @__PURE__ */ h(
789
+ ] }) : /* @__PURE__ */ p(
660
790
  "span",
661
791
  {
662
792
  className: g,
663
- ...n ? { "aria-disabled": "true" } : {},
793
+ ...a ? { "aria-disabled": "true" } : {},
664
794
  children: [
665
- a,
666
- e && /* @__PURE__ */ t(
795
+ o,
796
+ r && /* @__PURE__ */ i(
667
797
  "button",
668
798
  {
669
799
  type: "button",
670
800
  className: "rudi-tag__close",
671
- "aria-label": p,
801
+ "aria-label": f,
672
802
  onClick: () => {
673
- l(!0), i?.();
803
+ l(!0), t?.();
674
804
  },
675
- children: /* @__PURE__ */ t(k, { icon: "mdi:close", size: "sm", "aria-hidden": "true" })
805
+ children: /* @__PURE__ */ i(R, { icon: "mdi:close", size: "sm", "aria-hidden": "true" })
676
806
  }
677
807
  )
678
808
  ]
679
809
  }
680
810
  );
681
811
  }
682
- const pr = b(
683
- function({ variant: e = "default", padding: i = "md", children: o, className: n }, a) {
684
- return /* @__PURE__ */ t(
812
+ const Zi = v(
813
+ function({ variant: r = "default", padding: t = "md", children: n, className: a }, o) {
814
+ return /* @__PURE__ */ i(
685
815
  "div",
686
816
  {
687
- ref: a,
688
- className: m(
817
+ ref: o,
818
+ className: u(
689
819
  "rudi-card",
690
- `rudi-card--${e}`,
691
- `rudi-card--padding-${i}`,
692
- n
820
+ `rudi-card--${r}`,
821
+ `rudi-card--padding-${t}`,
822
+ a
693
823
  ),
694
- children: o
824
+ children: n
695
825
  }
696
826
  );
697
827
  }
698
828
  );
699
- function gr({ children: r, className: e }) {
700
- return /* @__PURE__ */ t("div", { className: m("rudi-card__header", e), children: r });
829
+ function Qi({ children: e, className: r }) {
830
+ return /* @__PURE__ */ i("div", { className: u("rudi-card__header", r), children: e });
701
831
  }
702
- function br({ children: r, className: e }) {
703
- return /* @__PURE__ */ t("div", { className: m("rudi-card__body", e), children: r });
832
+ function Yi({ children: e, className: r }) {
833
+ return /* @__PURE__ */ i("div", { className: u("rudi-card__body", r), children: e });
704
834
  }
705
- function _r({ children: r, className: e }) {
706
- return /* @__PURE__ */ t("div", { className: m("rudi-card__footer", e), children: r });
835
+ function Ji({ children: e, className: r }) {
836
+ return /* @__PURE__ */ i("div", { className: u("rudi-card__footer", r), children: e });
707
837
  }
708
- const Y = Object.assign(pr, {
709
- Header: gr,
710
- Body: br,
711
- Footer: _r
838
+ const ve = Object.assign(Zi, {
839
+ Header: Qi,
840
+ Body: Yi,
841
+ Footer: Ji
712
842
  });
713
- function et({
714
- value: r,
715
- minValue: e = 0,
716
- maxValue: i = 100,
717
- label: o,
718
- showValueLabel: n = !1,
719
- variant: a = "default",
843
+ function et(e, r, t) {
844
+ if (!t || t.length === 0) return r;
845
+ const n = [...t].sort((a, o) => o.at - a.at).find((a) => e >= a.at);
846
+ return n ? n.variant : r;
847
+ }
848
+ function un({
849
+ value: e,
850
+ minValue: r = 0,
851
+ maxValue: t = 100,
852
+ label: n,
853
+ showValueLabel: a = !1,
854
+ variant: o = "default",
855
+ thresholds: s,
720
856
  size: d = "md",
721
- className: c
857
+ className: l
722
858
  }) {
723
- const { progressBarProps: l, labelProps: u } = Z({
724
- label: o,
725
- value: r,
726
- minValue: e,
727
- maxValue: i
728
- }), s = (r - e) / (i - e) * 100;
729
- return /* @__PURE__ */ h(
859
+ const { progressBarProps: c, labelProps: m } = Te({
860
+ label: n,
861
+ value: e,
862
+ minValue: r,
863
+ maxValue: t
864
+ }), f = t - r, g = f === 0 ? 0 : (e - r) / f * 100, _ = Math.min(100, Math.max(0, g)), h = et(_, o, s);
865
+ return /* @__PURE__ */ p(
730
866
  "div",
731
867
  {
732
- ...l,
733
- className: m("rudi-progress", c),
868
+ ...c,
869
+ className: u("rudi-progress", l),
734
870
  children: [
735
- /* @__PURE__ */ h("div", { className: "rudi-progress__label-row", children: [
736
- /* @__PURE__ */ t("span", { ...u, className: "rudi-progress__label", children: o }),
737
- n && /* @__PURE__ */ h("span", { className: "rudi-progress__value", children: [
738
- Math.round(s),
871
+ /* @__PURE__ */ p("div", { className: "rudi-progress__label-row", children: [
872
+ /* @__PURE__ */ i("span", { ...m, className: "rudi-progress__label", children: n }),
873
+ a && /* @__PURE__ */ p("span", { className: "rudi-progress__value", children: [
874
+ Math.round(_),
739
875
  "%"
740
876
  ] })
741
877
  ] }),
742
- /* @__PURE__ */ t(
878
+ /* @__PURE__ */ i(
743
879
  "div",
744
880
  {
745
- className: m(
881
+ className: u(
746
882
  "rudi-progress__track",
747
883
  `rudi-progress__track--${d}`
748
884
  ),
749
- children: /* @__PURE__ */ t(
885
+ children: /* @__PURE__ */ i(
750
886
  "div",
751
887
  {
752
- className: m(
888
+ className: u(
753
889
  "rudi-progress__bar",
754
- `rudi-progress__bar--${a}`
890
+ `rudi-progress__bar--${h}`
755
891
  ),
756
- style: { width: `${s}%` }
892
+ style: { width: `${_}%` }
757
893
  }
758
894
  )
759
895
  }
@@ -762,292 +898,712 @@ function et({
762
898
  }
763
899
  );
764
900
  }
765
- function vr(r) {
766
- const e = r.trim().split(/\s+/);
767
- return e.length >= 2 ? (e[0][0] + e[e.length - 1][0]).toUpperCase() : (e[0]?.[0] ?? "").toUpperCase();
768
- }
769
- function rt({
770
- src: r,
771
- alt: e,
772
- name: i,
773
- size: o = "md",
774
- status: n,
775
- className: a
901
+ function mn({
902
+ orientation: e = "horizontal",
903
+ spacing: r = "md",
904
+ label: t,
905
+ className: n
776
906
  }) {
777
- const [d, c] = $(!1), l = r && !d, u = i ? vr(i) : "", s = e || i;
778
- return /* @__PURE__ */ h(
779
- "span",
907
+ const a = u(
908
+ "rudi-divider",
909
+ `rudi-divider--${e}`,
910
+ `rudi-divider--spacing-${r}`,
911
+ t && e === "horizontal" && "rudi-divider--labeled",
912
+ n
913
+ );
914
+ return t && e === "horizontal" ? /* @__PURE__ */ p("div", { className: a, role: "separator", "aria-orientation": "horizontal", children: [
915
+ /* @__PURE__ */ i("span", { className: "rudi-divider__line", "aria-hidden": "true" }),
916
+ /* @__PURE__ */ i("span", { className: "rudi-divider__label", children: t }),
917
+ /* @__PURE__ */ i("span", { className: "rudi-divider__line", "aria-hidden": "true" })
918
+ ] }) : e === "vertical" ? /* @__PURE__ */ i(
919
+ "div",
780
920
  {
781
- className: m(
782
- "rudi-avatar",
783
- `rudi-avatar--${o}`,
784
- a
785
- ),
786
- role: "img",
787
- "aria-label": s,
788
- children: [
789
- l ? /* @__PURE__ */ t(
790
- "img",
791
- {
792
- src: r,
793
- alt: e || "",
794
- className: "rudi-avatar__image",
795
- onError: () => c(!0)
796
- }
797
- ) : /* @__PURE__ */ t("span", { className: "rudi-avatar__initials", "aria-hidden": "true", children: u }),
798
- n && /* @__PURE__ */ t(
799
- hr,
800
- {
801
- variant: n,
802
- dot: !0,
803
- className: "rudi-avatar__status"
804
- }
805
- )
806
- ]
921
+ className: a,
922
+ role: "separator",
923
+ "aria-orientation": "vertical"
807
924
  }
808
- );
925
+ ) : /* @__PURE__ */ i("hr", { className: a });
809
926
  }
810
- function tt({
811
- label: r,
812
- value: e,
813
- delta: i,
814
- trend: o = "neutral",
815
- children: n,
816
- className: a
927
+ function pn({
928
+ tone: e = "default",
929
+ color: r,
930
+ size: t = "md",
931
+ pulse: n = !1,
932
+ label: a,
933
+ className: o
817
934
  }) {
818
- return /* @__PURE__ */ t(
819
- Y,
935
+ const s = r ? { "--rudi-dot-color": r } : void 0;
936
+ return /* @__PURE__ */ i(
937
+ "span",
820
938
  {
821
- variant: "outlined",
822
- padding: "md",
823
- className: m("rudi-stat-card", a),
824
- children: /* @__PURE__ */ h(Y.Body, { children: [
825
- /* @__PURE__ */ t("span", { className: "rudi-stat-card__label", children: r }),
826
- /* @__PURE__ */ t("span", { className: "rudi-stat-card__value", children: e }),
827
- i && /* @__PURE__ */ t(
828
- "span",
829
- {
830
- className: m(
831
- "rudi-stat-card__delta",
832
- `rudi-stat-card__delta--${o}`
833
- ),
834
- children: i
835
- }
836
- ),
837
- n && /* @__PURE__ */ t("div", { className: "rudi-stat-card__extra", children: n })
838
- ] })
939
+ className: u(
940
+ "rudi-dot",
941
+ !r && `rudi-dot--${e}`,
942
+ `rudi-dot--${t}`,
943
+ n && "rudi-dot--pulse",
944
+ o
945
+ ),
946
+ style: s,
947
+ role: a ? "status" : void 0,
948
+ "aria-hidden": a ? void 0 : !0,
949
+ children: a && /* @__PURE__ */ i("span", { className: "rudi-dot__label", children: a })
839
950
  }
840
951
  );
841
952
  }
842
- function V(r, e) {
843
- return m(
844
- "rudi-nav-item",
845
- r && "rudi-nav-item--active",
846
- e
847
- );
848
- }
849
- function ee(r, e, i) {
850
- return /* @__PURE__ */ h(T, { children: [
851
- r && /* @__PURE__ */ t(k, { icon: r, className: "rudi-nav-item__icon" }),
852
- /* @__PURE__ */ t("span", { className: "rudi-nav-item__label", children: e }),
853
- i && /* @__PURE__ */ t("span", { className: "rudi-nav-item__badge", children: i })
854
- ] });
855
- }
856
- const Nr = b(
857
- function({ label: e, icon: i, isActive: o = !1, href: n, onPress: a, badge: d, isDisabled: c = !1, className: l }, u) {
858
- const s = y(u), { linkProps: p } = ye(
859
- { href: n, isDisabled: c, onPress: a },
860
- s
861
- );
862
- return /* @__PURE__ */ t(
953
+ const hn = D.forwardRef(
954
+ function({
955
+ href: r,
956
+ variant: t = "default",
957
+ underline: n = "hover",
958
+ external: a = !1,
959
+ children: o,
960
+ className: s,
961
+ ...d
962
+ }, l) {
963
+ const c = B(l), m = a ? { target: "_blank", rel: "noreferrer noopener" } : {}, { linkProps: f } = W({ href: r, ...m }, c);
964
+ return /* @__PURE__ */ p(
863
965
  "a",
864
966
  {
865
- ...p,
866
- ref: s,
867
- href: n,
868
- className: V(o, l),
869
- children: ee(i, e, d)
870
- }
871
- );
872
- }
873
- ), Cr = b(
874
- function({ label: e, icon: i, isActive: o = !1, onPress: n, badge: a, isDisabled: d = !1, className: c }, l) {
875
- const u = y(l), { buttonProps: s } = O(
876
- { onPress: n, isDisabled: d },
877
- u
878
- );
879
- return /* @__PURE__ */ t(
880
- "button",
881
- {
882
- ...s,
883
- ref: u,
884
- className: V(o, c),
885
- children: ee(i, e, a)
886
- }
887
- );
888
- }
889
- ), it = b(
890
- function(e, i) {
891
- return e.href ? /* @__PURE__ */ t(
892
- Nr,
893
- {
894
- ...e,
895
- ref: i
896
- }
897
- ) : /* @__PURE__ */ t(
898
- Cr,
899
- {
900
- ...e,
901
- ref: i
967
+ ...Nr(d, f),
968
+ ...m,
969
+ ref: c,
970
+ href: r,
971
+ className: u(
972
+ "rudi-link",
973
+ `rudi-link--${t}`,
974
+ `rudi-link--underline-${n}`,
975
+ s
976
+ ),
977
+ children: [
978
+ o,
979
+ a && /* @__PURE__ */ i(
980
+ R,
981
+ {
982
+ icon: "lucide:arrow-up-right",
983
+ size: "sm",
984
+ className: "rudi-link__external-icon"
985
+ }
986
+ )
987
+ ]
902
988
  }
903
989
  );
904
990
  }
905
- ), E = 100, D = E / 2;
906
- function ot({
907
- value: r,
908
- minValue: e = 0,
909
- maxValue: i = 100,
910
- label: o,
911
- showValueLabel: n = !1,
912
- variant: a = "default",
913
- size: d = "md",
914
- children: c,
915
- className: l
991
+ );
992
+ function fn({
993
+ src: e,
994
+ alt: r,
995
+ aspectRatio: t,
996
+ fit: n = "cover",
997
+ radius: a = "md",
998
+ loading: o = "lazy",
999
+ overlay: s,
1000
+ className: d
916
1001
  }) {
917
- const { progressBarProps: u, labelProps: s } = Z({
918
- label: o,
919
- value: r,
920
- minValue: e,
921
- maxValue: i
922
- }), p = (r - e) / (i - e) * 100, g = 8, f = (E - g) / 2, _ = 2 * Math.PI * f, v = _ * (1 - p / 100);
923
- return /* @__PURE__ */ h(
1002
+ return /* @__PURE__ */ p(
924
1003
  "div",
925
1004
  {
926
- ...u,
927
- className: m(
928
- "rudi-circular-progress",
929
- `rudi-circular-progress--${d}`,
930
- l
931
- ),
1005
+ className: u("rudi-image", `rudi-image--radius-${a}`, d),
1006
+ style: t ? { aspectRatio: t } : void 0,
932
1007
  children: [
933
- /* @__PURE__ */ h(
934
- "svg",
1008
+ /* @__PURE__ */ i(
1009
+ "img",
935
1010
  {
936
- viewBox: `0 0 ${E} ${E}`,
937
- className: "rudi-circular-progress__svg",
938
- children: [
939
- /* @__PURE__ */ t(
940
- "circle",
941
- {
942
- cx: D,
943
- cy: D,
944
- r: f,
945
- className: "rudi-circular-progress__track",
946
- strokeWidth: g
947
- }
948
- ),
949
- /* @__PURE__ */ t(
950
- "circle",
951
- {
952
- cx: D,
953
- cy: D,
954
- r: f,
955
- className: m(
956
- "rudi-circular-progress__fill",
957
- `rudi-circular-progress__fill--${a}`
958
- ),
959
- strokeWidth: g,
960
- strokeDasharray: _,
961
- strokeDashoffset: v,
962
- strokeLinecap: "round"
963
- }
964
- )
965
- ]
1011
+ src: e,
1012
+ alt: r,
1013
+ loading: o,
1014
+ className: u("rudi-image__img", `rudi-image__img--${n}`)
966
1015
  }
967
1016
  ),
968
- /* @__PURE__ */ t("div", { className: "rudi-circular-progress__center", children: c ?? (n && /* @__PURE__ */ h("span", { className: "rudi-circular-progress__value", children: [
969
- Math.round(p),
970
- "%"
971
- ] })) }),
972
- /* @__PURE__ */ t("span", { ...s, className: "rudi-circular-progress__label", children: o })
1017
+ s != null && /* @__PURE__ */ i("div", { className: "rudi-image__overlay", children: s })
973
1018
  ]
974
1019
  }
975
1020
  );
976
1021
  }
977
- function nt({
978
- data: r,
979
- dataKeys: e,
980
- indexKey: i,
981
- layout: o = "vertical",
982
- stacked: n = !1,
983
- showLegend: a = !0,
984
- showGrid: d = !0,
985
- height: c = 300,
986
- label: l,
987
- className: u
1022
+ function rt(e, r) {
1023
+ return r >= e + 1 ? "full" : r >= e + 0.5 ? "half" : "empty";
1024
+ }
1025
+ function _n({
1026
+ value: e,
1027
+ max: r = 5,
1028
+ size: t = "md",
1029
+ onChange: n,
1030
+ showValue: a = !1,
1031
+ count: o,
1032
+ label: s,
1033
+ className: d
988
1034
  }) {
989
- const s = j(), p = o === "horizontal";
990
- return /* @__PURE__ */ t(
1035
+ const l = typeof n == "function", c = l ? Math.round(e) : e, m = Array.from({ length: r }, (h, b) => rt(b, c)), f = s ?? `Rated ${c} out of ${r}`, g = (h) => /* @__PURE__ */ i(
1036
+ R,
1037
+ {
1038
+ icon: h === "half" ? "lucide:star-half" : "lucide:star",
1039
+ size: t,
1040
+ className: u("rudi-rating__star", `rudi-rating__star--${h}`)
1041
+ }
1042
+ ), _ = (a || o != null) && /* @__PURE__ */ p("span", { className: "rudi-rating__text", children: [
1043
+ a && c.toFixed(1),
1044
+ o != null && ` (${o})`
1045
+ ] });
1046
+ return l ? /* @__PURE__ */ p(
1047
+ "div",
1048
+ {
1049
+ className: u("rudi-rating", `rudi-rating--${t}`, d),
1050
+ role: "radiogroup",
1051
+ "aria-label": f,
1052
+ children: [
1053
+ m.map((h, b) => /* @__PURE__ */ i(
1054
+ "button",
1055
+ {
1056
+ type: "button",
1057
+ role: "radio",
1058
+ "aria-checked": Math.round(e) === b + 1,
1059
+ "aria-label": `${b + 1} star${b === 0 ? "" : "s"}`,
1060
+ className: "rudi-rating__button",
1061
+ onClick: () => n(b + 1),
1062
+ children: g(h)
1063
+ },
1064
+ b
1065
+ )),
1066
+ _
1067
+ ]
1068
+ }
1069
+ ) : /* @__PURE__ */ p(
1070
+ "div",
1071
+ {
1072
+ className: u("rudi-rating", `rudi-rating--${t}`, d),
1073
+ role: "img",
1074
+ "aria-label": f,
1075
+ children: [
1076
+ /* @__PURE__ */ i("span", { className: "rudi-rating__stars", "aria-hidden": "true", children: m.map((h, b) => /* @__PURE__ */ i("span", { children: g(h) }, b)) }),
1077
+ _
1078
+ ]
1079
+ }
1080
+ );
1081
+ }
1082
+ function it(e, r) {
1083
+ return e.icon ? /* @__PURE__ */ i(R, { icon: e.icon, size: "sm" }) : e.status === "complete" ? /* @__PURE__ */ i(R, { icon: "lucide:check", size: "sm" }) : /* @__PURE__ */ i("span", { className: "rudi-stepper__number", children: r + 1 });
1084
+ }
1085
+ function bn({
1086
+ steps: e,
1087
+ orientation: r = "horizontal",
1088
+ size: t = "md",
1089
+ className: n
1090
+ }) {
1091
+ return /* @__PURE__ */ i(
1092
+ "ol",
1093
+ {
1094
+ className: u(
1095
+ "rudi-stepper",
1096
+ `rudi-stepper--${r}`,
1097
+ `rudi-stepper--${t}`,
1098
+ n
1099
+ ),
1100
+ children: e.map((a, o) => {
1101
+ const s = a.status ?? "upcoming", d = s === "complete" || s === "current", l = o < e.length - 1 && (e[o + 1].status ?? "upcoming") !== "upcoming";
1102
+ return /* @__PURE__ */ p(
1103
+ "li",
1104
+ {
1105
+ className: u("rudi-stepper__step", `rudi-stepper__step--${s}`),
1106
+ "aria-current": s === "current" ? "step" : void 0,
1107
+ children: [
1108
+ /* @__PURE__ */ p("div", { className: "rudi-stepper__marker", children: [
1109
+ o > 0 && /* @__PURE__ */ i(
1110
+ "span",
1111
+ {
1112
+ className: u(
1113
+ "rudi-stepper__connector",
1114
+ "rudi-stepper__connector--before",
1115
+ d && "rudi-stepper__connector--filled"
1116
+ ),
1117
+ "aria-hidden": "true"
1118
+ }
1119
+ ),
1120
+ /* @__PURE__ */ i(
1121
+ "span",
1122
+ {
1123
+ className: u(
1124
+ "rudi-stepper__node",
1125
+ d && "rudi-stepper__node--filled"
1126
+ ),
1127
+ children: it(a, o)
1128
+ }
1129
+ ),
1130
+ o < e.length - 1 && /* @__PURE__ */ i(
1131
+ "span",
1132
+ {
1133
+ className: u(
1134
+ "rudi-stepper__connector",
1135
+ "rudi-stepper__connector--after",
1136
+ l && "rudi-stepper__connector--filled"
1137
+ ),
1138
+ "aria-hidden": "true"
1139
+ }
1140
+ )
1141
+ ] }),
1142
+ /* @__PURE__ */ p("div", { className: "rudi-stepper__content", children: [
1143
+ /* @__PURE__ */ i("span", { className: "rudi-stepper__label", children: a.label }),
1144
+ a.description && /* @__PURE__ */ i("span", { className: "rudi-stepper__description", children: a.description })
1145
+ ] })
1146
+ ]
1147
+ },
1148
+ `${a.label}-${o}`
1149
+ );
1150
+ })
1151
+ }
1152
+ );
1153
+ }
1154
+ const gn = D.forwardRef(function({
1155
+ label: r,
1156
+ placeholder: t,
1157
+ description: n,
1158
+ errorMessage: a,
1159
+ isRequired: o = !1,
1160
+ isDisabled: s = !1,
1161
+ value: d,
1162
+ defaultValue: l,
1163
+ onChange: c,
1164
+ rows: m = 4,
1165
+ resize: f = "vertical",
1166
+ className: g
1167
+ }, _) {
1168
+ const h = B(_), {
1169
+ labelProps: b,
1170
+ inputProps: N,
1171
+ descriptionProps: y,
1172
+ errorMessageProps: k,
1173
+ isInvalid: C
1174
+ } = xe(
1175
+ {
1176
+ label: r,
1177
+ placeholder: t,
1178
+ description: n,
1179
+ errorMessage: a,
1180
+ isRequired: o,
1181
+ isDisabled: s,
1182
+ value: d,
1183
+ defaultValue: l,
1184
+ onChange: c,
1185
+ isInvalid: !!a,
1186
+ inputElementType: "textarea"
1187
+ },
1188
+ h
1189
+ );
1190
+ return /* @__PURE__ */ p("div", { className: u("rudi-textarea", g), children: [
1191
+ /* @__PURE__ */ p("label", { ...b, className: "rudi-textarea__label", children: [
1192
+ r,
1193
+ o && /* @__PURE__ */ p("span", { className: "rudi-textarea__required", "aria-hidden": "true", children: [
1194
+ " ",
1195
+ "*"
1196
+ ] })
1197
+ ] }),
1198
+ /* @__PURE__ */ i(
1199
+ "textarea",
1200
+ {
1201
+ ...N,
1202
+ ref: h,
1203
+ rows: m,
1204
+ className: u(
1205
+ "rudi-textarea__field",
1206
+ `rudi-textarea__field--resize-${f}`,
1207
+ C && "rudi-textarea__field--error"
1208
+ )
1209
+ }
1210
+ ),
1211
+ n && !C && /* @__PURE__ */ i("p", { ...y, className: "rudi-textarea__description", children: n }),
1212
+ C && a && /* @__PURE__ */ i("p", { ...k, className: "rudi-textarea__error", children: a })
1213
+ ] });
1214
+ });
1215
+ function tt({ href: e, children: r }) {
1216
+ const t = P(null), { linkProps: n } = W({ href: e }, t);
1217
+ return /* @__PURE__ */ i("a", { ...n, ref: t, href: e, className: "rudi-breadcrumb__link", children: r });
1218
+ }
1219
+ function Nn({
1220
+ items: e,
1221
+ separator: r = "lucide:chevron-right",
1222
+ label: t = "Breadcrumb",
1223
+ className: n
1224
+ }) {
1225
+ return /* @__PURE__ */ i("nav", { "aria-label": t, className: u("rudi-breadcrumb", n), children: /* @__PURE__ */ i("ol", { className: "rudi-breadcrumb__list", children: e.map((a, o) => {
1226
+ const s = o === e.length - 1;
1227
+ return /* @__PURE__ */ p("li", { className: "rudi-breadcrumb__item", children: [
1228
+ s || !a.href ? /* @__PURE__ */ i(
1229
+ "span",
1230
+ {
1231
+ className: "rudi-breadcrumb__current",
1232
+ "aria-current": s ? "page" : void 0,
1233
+ children: a.label
1234
+ }
1235
+ ) : /* @__PURE__ */ i(tt, { href: a.href, children: a.label }),
1236
+ !s && /* @__PURE__ */ i(
1237
+ R,
1238
+ {
1239
+ icon: r,
1240
+ size: "sm",
1241
+ className: "rudi-breadcrumb__separator"
1242
+ }
1243
+ )
1244
+ ] }, `${a.label}-${o}`);
1245
+ }) }) });
1246
+ }
1247
+ function nt(e, r, t) {
1248
+ const n = t * 2 + 5;
1249
+ if (r <= n)
1250
+ return Array.from({ length: r }, (c, m) => m + 1);
1251
+ const a = Math.max(e - t, 1), o = Math.min(e + t, r), s = a > 2, d = o < r - 1, l = [1];
1252
+ if (s) l.push("ellipsis-start");
1253
+ else for (let c = 2; c < a; c++) l.push(c);
1254
+ for (let c = a; c <= o; c++)
1255
+ c !== 1 && c !== r && l.push(c);
1256
+ if (d) l.push("ellipsis-end");
1257
+ else for (let c = o + 1; c < r; c++) l.push(c);
1258
+ return l.push(r), l;
1259
+ }
1260
+ function vn({
1261
+ page: e,
1262
+ pageCount: r,
1263
+ onPageChange: t,
1264
+ siblingCount: n = 1,
1265
+ label: a = "Pagination",
1266
+ className: o
1267
+ }) {
1268
+ if (r <= 1) return null;
1269
+ const s = nt(e, r, n), d = (l) => {
1270
+ const c = Math.min(Math.max(l, 1), r);
1271
+ c !== e && t(c);
1272
+ };
1273
+ return /* @__PURE__ */ i("nav", { "aria-label": a, className: u("rudi-pagination", o), children: /* @__PURE__ */ p("ul", { className: "rudi-pagination__list", children: [
1274
+ /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(
1275
+ "button",
1276
+ {
1277
+ type: "button",
1278
+ className: "rudi-pagination__control",
1279
+ "aria-label": "Go to previous page",
1280
+ disabled: e <= 1,
1281
+ onClick: () => d(e - 1),
1282
+ children: /* @__PURE__ */ i(R, { icon: "lucide:chevron-left", size: "sm" })
1283
+ }
1284
+ ) }),
1285
+ s.map(
1286
+ (l) => typeof l == "number" ? /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(
1287
+ "button",
1288
+ {
1289
+ type: "button",
1290
+ className: u(
1291
+ "rudi-pagination__page",
1292
+ l === e && "rudi-pagination__page--active"
1293
+ ),
1294
+ "aria-label": `Go to page ${l}`,
1295
+ "aria-current": l === e ? "page" : void 0,
1296
+ onClick: () => d(l),
1297
+ children: l
1298
+ }
1299
+ ) }, l) : /* @__PURE__ */ i("li", { className: "rudi-pagination__ellipsis", "aria-hidden": "true", children: "…" }, l)
1300
+ ),
1301
+ /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(
1302
+ "button",
1303
+ {
1304
+ type: "button",
1305
+ className: "rudi-pagination__control",
1306
+ "aria-label": "Go to next page",
1307
+ disabled: e >= r,
1308
+ onClick: () => d(e + 1),
1309
+ children: /* @__PURE__ */ i(R, { icon: "lucide:chevron-right", size: "sm" })
1310
+ }
1311
+ ) })
1312
+ ] }) });
1313
+ }
1314
+ function at(e) {
1315
+ const r = e.trim().split(/\s+/);
1316
+ return r.length >= 2 ? (r[0][0] + r[r.length - 1][0]).toUpperCase() : (r[0]?.[0] ?? "").toUpperCase();
1317
+ }
1318
+ function Rn({
1319
+ src: e,
1320
+ alt: r,
1321
+ name: t,
1322
+ size: n = "md",
1323
+ status: a,
1324
+ className: o
1325
+ }) {
1326
+ const [s, d] = O(!1), l = e && !s, c = t ? at(t) : "", m = r || t;
1327
+ return /* @__PURE__ */ p(
1328
+ "span",
1329
+ {
1330
+ className: u(
1331
+ "rudi-avatar",
1332
+ `rudi-avatar--${n}`,
1333
+ o
1334
+ ),
1335
+ role: "img",
1336
+ "aria-label": m,
1337
+ children: [
1338
+ l ? /* @__PURE__ */ i(
1339
+ "img",
1340
+ {
1341
+ src: e,
1342
+ alt: r || "",
1343
+ className: "rudi-avatar__image",
1344
+ onError: () => d(!0)
1345
+ }
1346
+ ) : /* @__PURE__ */ i("span", { className: "rudi-avatar__initials", "aria-hidden": "true", children: c }),
1347
+ a && /* @__PURE__ */ i(
1348
+ Xi,
1349
+ {
1350
+ variant: a,
1351
+ dot: !0,
1352
+ className: "rudi-avatar__status"
1353
+ }
1354
+ )
1355
+ ]
1356
+ }
1357
+ );
1358
+ }
1359
+ function yn({
1360
+ label: e,
1361
+ value: r,
1362
+ delta: t,
1363
+ trend: n = "neutral",
1364
+ children: a,
1365
+ className: o
1366
+ }) {
1367
+ return /* @__PURE__ */ i(
1368
+ ve,
1369
+ {
1370
+ variant: "outlined",
1371
+ padding: "md",
1372
+ className: u("rudi-stat-card", o),
1373
+ children: /* @__PURE__ */ p(ve.Body, { children: [
1374
+ /* @__PURE__ */ i("span", { className: "rudi-stat-card__label", children: e }),
1375
+ /* @__PURE__ */ i("span", { className: "rudi-stat-card__value", children: r }),
1376
+ t && /* @__PURE__ */ i(
1377
+ "span",
1378
+ {
1379
+ className: u(
1380
+ "rudi-stat-card__delta",
1381
+ `rudi-stat-card__delta--${n}`
1382
+ ),
1383
+ children: t
1384
+ }
1385
+ ),
1386
+ a && /* @__PURE__ */ i("div", { className: "rudi-stat-card__extra", children: a })
1387
+ ] })
1388
+ }
1389
+ );
1390
+ }
1391
+ function Ke(e, r) {
1392
+ return u(
1393
+ "rudi-nav-item",
1394
+ e && "rudi-nav-item--active",
1395
+ r
1396
+ );
1397
+ }
1398
+ function Ve(e, r, t) {
1399
+ return /* @__PURE__ */ p(w, { children: [
1400
+ e && /* @__PURE__ */ i(R, { icon: e, className: "rudi-nav-item__icon" }),
1401
+ /* @__PURE__ */ i("span", { className: "rudi-nav-item__label", children: r }),
1402
+ t && /* @__PURE__ */ i("span", { className: "rudi-nav-item__badge", children: t })
1403
+ ] });
1404
+ }
1405
+ const ot = v(
1406
+ function({ label: r, icon: t, isActive: n = !1, href: a, onPress: o, badge: s, isDisabled: d = !1, className: l }, c) {
1407
+ const m = B(c), { linkProps: f } = W(
1408
+ { href: a, isDisabled: d, onPress: o },
1409
+ m
1410
+ );
1411
+ return /* @__PURE__ */ i(
1412
+ "a",
1413
+ {
1414
+ ...f,
1415
+ ref: m,
1416
+ href: a,
1417
+ "aria-current": n ? "page" : void 0,
1418
+ className: Ke(n, l),
1419
+ children: Ve(t, r, s)
1420
+ }
1421
+ );
1422
+ }
1423
+ ), st = v(
1424
+ function({ label: r, icon: t, isActive: n = !1, onPress: a, badge: o, isDisabled: s = !1, className: d }, l) {
1425
+ const c = B(l), { buttonProps: m } = G(
1426
+ { onPress: a, isDisabled: s },
1427
+ c
1428
+ );
1429
+ return /* @__PURE__ */ i(
1430
+ "button",
1431
+ {
1432
+ ...m,
1433
+ ref: c,
1434
+ "aria-current": n ? "true" : void 0,
1435
+ className: Ke(n, d),
1436
+ children: Ve(t, r, o)
1437
+ }
1438
+ );
1439
+ }
1440
+ ), kn = v(
1441
+ function(r, t) {
1442
+ return r.href ? /* @__PURE__ */ i(
1443
+ ot,
1444
+ {
1445
+ ...r,
1446
+ ref: t
1447
+ }
1448
+ ) : /* @__PURE__ */ i(
1449
+ st,
1450
+ {
1451
+ ...r,
1452
+ ref: t
1453
+ }
1454
+ );
1455
+ }
1456
+ ), j = 100, V = j / 2;
1457
+ function xn({
1458
+ value: e,
1459
+ minValue: r = 0,
1460
+ maxValue: t = 100,
1461
+ label: n,
1462
+ showValueLabel: a = !1,
1463
+ variant: o = "default",
1464
+ size: s = "md",
1465
+ children: d,
1466
+ className: l
1467
+ }) {
1468
+ const { progressBarProps: c, labelProps: m } = Te({
1469
+ label: n,
1470
+ value: e,
1471
+ minValue: r,
1472
+ maxValue: t
1473
+ }), f = (e - r) / (t - r) * 100, g = 8, _ = (j - g) / 2, h = 2 * Math.PI * _, b = h * (1 - f / 100);
1474
+ return /* @__PURE__ */ p(
1475
+ "div",
1476
+ {
1477
+ ...c,
1478
+ className: u(
1479
+ "rudi-circular-progress",
1480
+ `rudi-circular-progress--${s}`,
1481
+ l
1482
+ ),
1483
+ children: [
1484
+ /* @__PURE__ */ p(
1485
+ "svg",
1486
+ {
1487
+ viewBox: `0 0 ${j} ${j}`,
1488
+ className: "rudi-circular-progress__svg",
1489
+ children: [
1490
+ /* @__PURE__ */ i(
1491
+ "circle",
1492
+ {
1493
+ cx: V,
1494
+ cy: V,
1495
+ r: _,
1496
+ className: "rudi-circular-progress__track",
1497
+ strokeWidth: g
1498
+ }
1499
+ ),
1500
+ /* @__PURE__ */ i(
1501
+ "circle",
1502
+ {
1503
+ cx: V,
1504
+ cy: V,
1505
+ r: _,
1506
+ className: u(
1507
+ "rudi-circular-progress__fill",
1508
+ `rudi-circular-progress__fill--${o}`
1509
+ ),
1510
+ strokeWidth: g,
1511
+ strokeDasharray: h,
1512
+ strokeDashoffset: b,
1513
+ strokeLinecap: "round"
1514
+ }
1515
+ )
1516
+ ]
1517
+ }
1518
+ ),
1519
+ /* @__PURE__ */ i("div", { className: "rudi-circular-progress__center", children: d ?? (a && /* @__PURE__ */ p("span", { className: "rudi-circular-progress__value", children: [
1520
+ Math.round(f),
1521
+ "%"
1522
+ ] })) }),
1523
+ /* @__PURE__ */ i("span", { ...m, className: "rudi-circular-progress__label", children: n })
1524
+ ]
1525
+ }
1526
+ );
1527
+ }
1528
+ function Cn({
1529
+ data: e,
1530
+ dataKeys: r,
1531
+ indexKey: t,
1532
+ layout: n = "vertical",
1533
+ stacked: a = !1,
1534
+ showLegend: o = !0,
1535
+ showGrid: s = !0,
1536
+ height: d = 300,
1537
+ label: l,
1538
+ className: c
1539
+ }) {
1540
+ const m = pe(), f = n === "horizontal", g = f ? Math.min(
1541
+ 220,
1542
+ Math.max(60, ...e.map((_) => String(_[t] ?? "").length * 8 + 24))
1543
+ ) : void 0;
1544
+ return /* @__PURE__ */ i(
991
1545
  "div",
992
1546
  {
993
- className: m("rudi-chart", u),
1547
+ className: u("rudi-chart", c),
994
1548
  role: "img",
995
1549
  "aria-label": l,
996
- children: /* @__PURE__ */ t(G, { width: "100%", height: c, children: /* @__PURE__ */ h(
997
- je,
1550
+ children: /* @__PURE__ */ i(le, { width: "100%", height: d, children: /* @__PURE__ */ p(
1551
+ pi,
998
1552
  {
999
- data: r,
1000
- layout: p ? "vertical" : "horizontal",
1553
+ data: e,
1554
+ layout: f ? "vertical" : "horizontal",
1001
1555
  children: [
1002
- d && /* @__PURE__ */ t(
1003
- J,
1556
+ s && /* @__PURE__ */ i(
1557
+ Oe,
1004
1558
  {
1005
1559
  strokeDasharray: "3 3",
1006
- stroke: s.gridColor,
1007
- vertical: !p,
1008
- horizontal: !p
1560
+ stroke: m.gridColor,
1561
+ vertical: f,
1562
+ horizontal: !f
1009
1563
  }
1010
1564
  ),
1011
- p ? /* @__PURE__ */ h(T, { children: [
1012
- /* @__PURE__ */ t(K, { type: "number", tick: { fill: s.axisColor } }),
1013
- /* @__PURE__ */ t(
1014
- L,
1565
+ f ? /* @__PURE__ */ p(w, { children: [
1566
+ /* @__PURE__ */ i(J, { type: "number", tick: { fill: m.axisColor } }),
1567
+ /* @__PURE__ */ i(
1568
+ ee,
1015
1569
  {
1016
- dataKey: i,
1570
+ dataKey: t,
1017
1571
  type: "category",
1018
- tick: { fill: s.axisColor }
1572
+ width: g,
1573
+ tick: { fill: m.axisColor }
1019
1574
  }
1020
1575
  )
1021
- ] }) : /* @__PURE__ */ h(T, { children: [
1022
- /* @__PURE__ */ t(K, { dataKey: i, tick: { fill: s.axisColor } }),
1023
- /* @__PURE__ */ t(L, { tick: { fill: s.axisColor } })
1576
+ ] }) : /* @__PURE__ */ p(w, { children: [
1577
+ /* @__PURE__ */ i(J, { dataKey: t, tick: { fill: m.axisColor } }),
1578
+ /* @__PURE__ */ i(ee, { tick: { fill: m.axisColor } })
1024
1579
  ] }),
1025
- /* @__PURE__ */ t(
1026
- A,
1580
+ /* @__PURE__ */ i(
1581
+ ce,
1027
1582
  {
1028
1583
  contentStyle: {
1029
- backgroundColor: s.tooltipBg,
1030
- color: s.tooltipText,
1031
- border: `1px solid ${s.tooltipBorder}`,
1584
+ backgroundColor: m.tooltipBg,
1585
+ color: m.tooltipText,
1586
+ border: `1px solid ${m.tooltipBorder}`,
1032
1587
  borderRadius: "0.375rem"
1033
1588
  }
1034
1589
  }
1035
1590
  ),
1036
- a && /* @__PURE__ */ t(
1037
- F,
1591
+ o && /* @__PURE__ */ i(
1592
+ ue,
1038
1593
  {
1039
- wrapperStyle: { color: s.legendColor }
1594
+ wrapperStyle: { color: m.legendColor },
1595
+ formatter: (_) => /* @__PURE__ */ i("span", { style: { color: m.legendColor }, children: _ })
1040
1596
  }
1041
1597
  ),
1042
- e.map((g, f) => /* @__PURE__ */ t(
1043
- ze,
1598
+ r.map((_, h) => /* @__PURE__ */ i(
1599
+ hi,
1044
1600
  {
1045
- dataKey: g,
1046
- fill: s.colors[f % s.colors.length],
1047
- stackId: n ? "stack" : void 0,
1601
+ dataKey: _,
1602
+ fill: m.colors[h % m.colors.length],
1603
+ stackId: a ? "stack" : void 0,
1048
1604
  radius: [2, 2, 0, 0]
1049
1605
  },
1050
- g
1606
+ _
1051
1607
  ))
1052
1608
  ]
1053
1609
  }
@@ -1055,290 +1611,317 @@ function nt({
1055
1611
  }
1056
1612
  );
1057
1613
  }
1058
- function at({
1059
- data: r,
1060
- dataKeys: e,
1061
- indexKey: i,
1062
- curved: o = !0,
1063
- showDots: n = !0,
1064
- showGrid: a = !0,
1065
- showLegend: d = !0,
1066
- height: c = 300,
1614
+ function Sn({
1615
+ data: e,
1616
+ dataKeys: r,
1617
+ indexKey: t,
1618
+ curved: n = !0,
1619
+ showDots: a = !0,
1620
+ showGrid: o = !0,
1621
+ showLegend: s = !0,
1622
+ height: d = 300,
1067
1623
  label: l,
1068
- className: u
1624
+ referenceLines: c = [],
1625
+ yDomain: m,
1626
+ unit: f,
1627
+ className: g
1069
1628
  }) {
1070
- const s = j();
1071
- return /* @__PURE__ */ t(
1629
+ const _ = pe();
1630
+ return /* @__PURE__ */ i(
1072
1631
  "div",
1073
1632
  {
1074
- className: m("rudi-chart", u),
1633
+ className: u("rudi-chart", g),
1075
1634
  role: "img",
1076
1635
  "aria-label": l,
1077
- children: /* @__PURE__ */ t(G, { width: "100%", height: c, children: /* @__PURE__ */ h(He, { data: r, children: [
1078
- a && /* @__PURE__ */ t(
1079
- J,
1636
+ children: /* @__PURE__ */ i(le, { width: "100%", height: d, children: /* @__PURE__ */ p(fi, { data: e, children: [
1637
+ o && /* @__PURE__ */ i(
1638
+ Oe,
1080
1639
  {
1081
1640
  strokeDasharray: "3 3",
1082
- stroke: s.gridColor
1641
+ stroke: _.gridColor
1083
1642
  }
1084
1643
  ),
1085
- /* @__PURE__ */ t(K, { dataKey: i, tick: { fill: s.axisColor } }),
1086
- /* @__PURE__ */ t(L, { tick: { fill: s.axisColor } }),
1087
- /* @__PURE__ */ t(
1088
- A,
1644
+ /* @__PURE__ */ i(J, { dataKey: t, tick: { fill: _.axisColor } }),
1645
+ /* @__PURE__ */ i(ee, { tick: { fill: _.axisColor }, domain: m, unit: f }),
1646
+ /* @__PURE__ */ i(
1647
+ ce,
1089
1648
  {
1090
1649
  contentStyle: {
1091
- backgroundColor: s.tooltipBg,
1092
- color: s.tooltipText,
1093
- border: `1px solid ${s.tooltipBorder}`,
1650
+ backgroundColor: _.tooltipBg,
1651
+ color: _.tooltipText,
1652
+ border: `1px solid ${_.tooltipBorder}`,
1094
1653
  borderRadius: "0.375rem"
1095
- }
1654
+ },
1655
+ formatter: f ? (h) => `${h}${f}` : void 0
1096
1656
  }
1097
1657
  ),
1098
- d && /* @__PURE__ */ t(
1099
- F,
1658
+ s && /* @__PURE__ */ i(
1659
+ ue,
1100
1660
  {
1101
- wrapperStyle: { color: s.legendColor }
1661
+ wrapperStyle: { color: _.legendColor },
1662
+ formatter: (h) => /* @__PURE__ */ i("span", { style: { color: _.legendColor }, children: h })
1102
1663
  }
1103
1664
  ),
1104
- e.map((p, g) => /* @__PURE__ */ t(
1105
- Ue,
1665
+ c.map((h) => /* @__PURE__ */ i(
1666
+ _i,
1106
1667
  {
1107
- type: o ? "monotone" : "linear",
1108
- dataKey: p,
1109
- stroke: s.colors[g % s.colors.length],
1110
- dot: n,
1668
+ y: h.y,
1669
+ stroke: _.tones[h.tone ?? "default"],
1670
+ strokeDasharray: "6 4",
1671
+ ifOverflow: "extendDomain",
1672
+ label: { value: h.label, position: "insideTopRight", fill: _.tones[h.tone ?? "default"] }
1673
+ },
1674
+ `${h.y}-${h.label}`
1675
+ )),
1676
+ r.map((h, b) => /* @__PURE__ */ i(
1677
+ bi,
1678
+ {
1679
+ type: n ? "monotone" : "linear",
1680
+ dataKey: h,
1681
+ stroke: _.colors[b % _.colors.length],
1682
+ dot: a,
1111
1683
  strokeWidth: 2,
1112
1684
  activeDot: { r: 5 }
1113
1685
  },
1114
- p
1686
+ h
1115
1687
  ))
1116
1688
  ] }) })
1117
1689
  }
1118
1690
  );
1119
1691
  }
1120
- function st({
1121
- data: r,
1122
- innerRadius: e = 60,
1123
- showLabels: i = !1,
1124
- showLegend: o = !0,
1125
- height: n = 300,
1126
- label: a,
1127
- className: d
1692
+ function Pn({
1693
+ data: e,
1694
+ innerRadius: r = 60,
1695
+ showLabels: t = !1,
1696
+ showLegend: n = !0,
1697
+ height: a = 300,
1698
+ label: o,
1699
+ className: s
1128
1700
  }) {
1129
- const c = j();
1130
- return /* @__PURE__ */ t(
1701
+ const d = pe();
1702
+ return /* @__PURE__ */ i(
1131
1703
  "div",
1132
1704
  {
1133
- className: m("rudi-chart", d),
1705
+ className: u("rudi-chart", s),
1134
1706
  role: "img",
1135
- "aria-label": a,
1136
- children: /* @__PURE__ */ t(G, { width: "100%", height: n, children: /* @__PURE__ */ h(Xe, { children: [
1137
- /* @__PURE__ */ t(
1138
- We,
1707
+ "aria-label": o,
1708
+ children: /* @__PURE__ */ i(le, { width: "100%", height: a, children: /* @__PURE__ */ p(gi, { children: [
1709
+ /* @__PURE__ */ i(
1710
+ Ni,
1139
1711
  {
1140
- data: r,
1712
+ data: e,
1141
1713
  dataKey: "value",
1142
1714
  nameKey: "name",
1143
1715
  cx: "50%",
1144
1716
  cy: "50%",
1145
- innerRadius: e,
1146
- outerRadius: e + 30,
1717
+ innerRadius: r,
1718
+ outerRadius: r + 30,
1147
1719
  paddingAngle: 2,
1148
- label: i ? ({ name: l }) => l : !1,
1149
- children: r.map((l, u) => /* @__PURE__ */ t(
1150
- Ye,
1720
+ label: t ? ({ name: l }) => l : !1,
1721
+ children: e.map((l, c) => /* @__PURE__ */ i(
1722
+ vi,
1151
1723
  {
1152
- fill: c.colors[u % c.colors.length]
1724
+ fill: d.colors[c % d.colors.length]
1153
1725
  },
1154
- u
1726
+ c
1155
1727
  ))
1156
1728
  }
1157
1729
  ),
1158
- /* @__PURE__ */ t(
1159
- A,
1730
+ /* @__PURE__ */ i(
1731
+ ce,
1160
1732
  {
1161
1733
  contentStyle: {
1162
- backgroundColor: c.tooltipBg,
1163
- color: c.tooltipText,
1164
- border: `1px solid ${c.tooltipBorder}`,
1734
+ backgroundColor: d.tooltipBg,
1735
+ color: d.tooltipText,
1736
+ border: `1px solid ${d.tooltipBorder}`,
1165
1737
  borderRadius: "0.375rem"
1166
1738
  }
1167
1739
  }
1168
1740
  ),
1169
- o && /* @__PURE__ */ t(
1170
- F,
1741
+ n && /* @__PURE__ */ i(
1742
+ ue,
1171
1743
  {
1172
- wrapperStyle: { color: c.legendColor }
1744
+ wrapperStyle: { color: d.legendColor },
1745
+ formatter: (l) => /* @__PURE__ */ i("span", { style: { color: d.legendColor }, children: l })
1173
1746
  }
1174
1747
  )
1175
1748
  ] }) })
1176
1749
  }
1177
1750
  );
1178
1751
  }
1179
- function re({
1180
- id: r,
1181
- title: e,
1182
- items: i,
1183
- renderCard: o,
1184
- className: n
1752
+ function He({
1753
+ id: e,
1754
+ title: r,
1755
+ items: t,
1756
+ renderCard: n,
1757
+ className: a
1185
1758
  }) {
1186
- const { setNodeRef: a, isOver: d } = Ze({ id: r });
1187
- return /* @__PURE__ */ h(
1759
+ const { setNodeRef: o, isOver: s } = Ri({ id: e });
1760
+ return /* @__PURE__ */ p(
1188
1761
  "div",
1189
1762
  {
1190
- className: m(
1763
+ className: u(
1191
1764
  "rudi-kanban__column",
1192
- d && "rudi-kanban__column--over",
1193
- n
1765
+ s && "rudi-kanban__column--over",
1766
+ a
1194
1767
  ),
1195
1768
  role: "region",
1196
- "aria-label": e,
1769
+ "aria-label": r,
1197
1770
  children: [
1198
- /* @__PURE__ */ h("div", { className: "rudi-kanban__column-header", children: [
1199
- /* @__PURE__ */ t("span", { className: "rudi-kanban__column-title", children: e }),
1200
- /* @__PURE__ */ t("span", { className: "rudi-kanban__column-count", children: i.length })
1771
+ /* @__PURE__ */ p("div", { className: "rudi-kanban__column-header", children: [
1772
+ /* @__PURE__ */ i("span", { className: "rudi-kanban__column-title", children: r }),
1773
+ /* @__PURE__ */ i("span", { className: "rudi-kanban__column-count", children: t.length })
1201
1774
  ] }),
1202
- /* @__PURE__ */ t("div", { ref: a, className: "rudi-kanban__column-body", children: /* @__PURE__ */ t(
1203
- tr,
1775
+ /* @__PURE__ */ i("div", { ref: o, className: "rudi-kanban__column-body", children: /* @__PURE__ */ i(
1776
+ Ti,
1204
1777
  {
1205
- items: i.map((c) => c.id),
1206
- strategy: ir,
1207
- children: i.map((c) => o(c))
1778
+ items: t.map((d) => d.id),
1779
+ strategy: wi,
1780
+ children: t.map((d) => n(d))
1208
1781
  }
1209
1782
  ) })
1210
1783
  ]
1211
1784
  }
1212
1785
  );
1213
1786
  }
1214
- function M(r, e) {
1215
- return r.find((i) => i.items.some((o) => o.id === e));
1787
+ function H(e, r) {
1788
+ return e.find((t) => t.items.some((n) => n.id === r));
1216
1789
  }
1217
- function Rr({
1218
- columns: r,
1219
- onCardMove: e,
1220
- renderCard: i,
1221
- className: o
1790
+ function dt({
1791
+ columns: e,
1792
+ onCardMove: r,
1793
+ renderCard: t,
1794
+ getCardLabel: n,
1795
+ className: a
1222
1796
  }) {
1223
- const [n, a] = $(null), d = R(null), c = qe(
1224
- U(Je, {
1797
+ const [o, s] = O(null), d = yi(
1798
+ be(ki, {
1225
1799
  activationConstraint: { distance: 5 }
1226
1800
  }),
1227
- U(Qe, {
1228
- coordinateGetter: or
1801
+ be(xi, {
1802
+ coordinateGetter: $i
1229
1803
  })
1230
- ), l = I((f) => {
1231
- d.current && (d.current.textContent = f);
1232
- }, []), u = n ? r.flatMap((f) => f.items).find((f) => f.id === n) : null, s = I(
1233
- (f) => {
1234
- const _ = String(f.active.id);
1235
- a(_);
1236
- const v = M(r, _);
1237
- v && l(`Picked up card from ${v.title}`);
1804
+ ), l = A(
1805
+ (h) => {
1806
+ const b = e.flatMap((N) => N.items).find((N) => N.id === h);
1807
+ return b && n ? n(b) : h;
1238
1808
  },
1239
- [r, l]
1240
- ), p = I(
1241
- (f) => {
1242
- const { over: _ } = f;
1243
- if (!_) return;
1244
- const v = String(_.id), N = r.find((x) => x.id === v) || M(r, v);
1245
- N && l(`Over column ${N.title}`);
1809
+ [e, n]
1810
+ ), c = A(
1811
+ (h) => {
1812
+ const b = e.find((k) => k.id === h);
1813
+ if (b) return `${b.title}, position ${b.items.length + 1}`;
1814
+ const N = H(e, h);
1815
+ if (!N) return;
1816
+ const y = N.items.findIndex((k) => k.id === h);
1817
+ return `${N.title}, position ${y + 1} of ${N.items.length}`;
1246
1818
  },
1247
- [r, l]
1248
- ), g = I(
1249
- (f) => {
1250
- const { active: _, over: v } = f;
1251
- if (a(null), !v) {
1252
- l("Cancelled drag");
1253
- return;
1254
- }
1255
- const N = String(_.id), x = String(v.id), C = M(r, N);
1819
+ [e]
1820
+ ), m = I(
1821
+ () => ({
1822
+ onDragStart: ({ active: h }) => {
1823
+ const b = H(e, String(h.id));
1824
+ return `Picked up ${l(String(h.id))}${b ? ` from ${b.title}` : ""}.`;
1825
+ },
1826
+ onDragOver: ({ active: h, over: b }) => {
1827
+ const N = b ? c(String(b.id)) : void 0;
1828
+ return N ? `${l(String(h.id))} is over ${N}.` : `${l(String(h.id))} is no longer over a column.`;
1829
+ },
1830
+ onDragEnd: ({ active: h, over: b }) => {
1831
+ const N = b ? c(String(b.id)) : void 0;
1832
+ return N ? `Dropped ${l(String(h.id))} in ${N}.` : `Dropped ${l(String(h.id))}. It was not moved.`;
1833
+ },
1834
+ onDragCancel: ({ active: h }) => `Cancelled. ${l(String(h.id))} was not moved.`
1835
+ }),
1836
+ [e, l, c]
1837
+ ), f = o ? e.flatMap((h) => h.items).find((h) => h.id === o) : null, g = A(
1838
+ (h) => {
1839
+ const b = String(h.active.id);
1840
+ s(b);
1841
+ },
1842
+ []
1843
+ ), _ = A(
1844
+ (h) => {
1845
+ const { active: b, over: N } = h;
1846
+ if (s(null), !N) return;
1847
+ const y = String(b.id), k = String(N.id), C = H(e, y);
1256
1848
  if (!C) return;
1257
- const z = C.items.findIndex(
1258
- (B) => B.id === N
1259
- ), H = r.find((B) => B.id === x), te = M(r, x), P = H || te;
1260
- if (!P) return;
1261
- let S;
1262
- H ? S = P.items.length : S = P.items.findIndex((B) => B.id === x), !(C.id === P.id && z === S) && (l(`Dropped card in ${P.title} at position ${S + 1}`), e({
1263
- cardId: N,
1849
+ const T = C.items.findIndex(
1850
+ (S) => S.id === y
1851
+ ), M = e.find((S) => S.id === k), E = H(e, k), $ = M || E;
1852
+ if (!$) return;
1853
+ let x;
1854
+ M ? x = $.items.length : x = $.items.findIndex((S) => S.id === k), !(C.id === $.id && T === x) && r({
1855
+ cardId: y,
1264
1856
  fromColumnId: C.id,
1265
- toColumnId: P.id,
1266
- fromIndex: z,
1267
- toIndex: S
1268
- }));
1857
+ toColumnId: $.id,
1858
+ fromIndex: T,
1859
+ toIndex: x
1860
+ });
1269
1861
  },
1270
- [r, e, l]
1862
+ [e, r]
1271
1863
  );
1272
- return /* @__PURE__ */ h(
1273
- Ve,
1864
+ return /* @__PURE__ */ p(
1865
+ Ci,
1274
1866
  {
1275
- sensors: c,
1276
- collisionDetection: er,
1277
- onDragStart: s,
1278
- onDragOver: p,
1279
- onDragEnd: g,
1867
+ sensors: d,
1868
+ collisionDetection: Si,
1869
+ accessibility: { announcements: m },
1870
+ onDragStart: g,
1871
+ onDragEnd: _,
1872
+ onDragCancel: () => s(null),
1280
1873
  children: [
1281
- /* @__PURE__ */ t("div", { className: m("rudi-kanban", o), children: r.map((f) => /* @__PURE__ */ t(
1282
- re,
1874
+ /* @__PURE__ */ i("div", { className: u("rudi-kanban", a), children: e.map((h) => /* @__PURE__ */ i(
1875
+ He,
1283
1876
  {
1284
- id: f.id,
1285
- title: f.title,
1286
- items: f.items,
1287
- renderCard: i
1877
+ id: h.id,
1878
+ title: h.title,
1879
+ items: h.items,
1880
+ renderCard: t
1288
1881
  },
1289
- f.id
1882
+ h.id
1290
1883
  )) }),
1291
- /* @__PURE__ */ t(rr, { children: u ? /* @__PURE__ */ t("div", { className: "rudi-kanban__card rudi-kanban__card--overlay", children: i(u) }) : null }),
1292
- /* @__PURE__ */ t(
1293
- "div",
1294
- {
1295
- ref: d,
1296
- role: "status",
1297
- "aria-live": "assertive",
1298
- "aria-atomic": "true",
1299
- className: "rudi-kanban__sr-only"
1300
- }
1301
- )
1884
+ /* @__PURE__ */ i(Pi, { children: f ? /* @__PURE__ */ i("div", { className: "rudi-kanban__card rudi-kanban__card--overlay", children: t(f) }) : null })
1302
1885
  ]
1303
1886
  }
1304
1887
  );
1305
1888
  }
1306
- const ct = Object.assign(Rr, {
1307
- Column: re
1889
+ const Tn = Object.assign(dt, {
1890
+ Column: He
1308
1891
  });
1309
- function dt({ id: r, children: e, className: i }) {
1892
+ function wn({ id: e, label: r, children: t, className: n }) {
1310
1893
  const {
1311
- attributes: o,
1312
- listeners: n,
1313
- setNodeRef: a,
1894
+ attributes: a,
1895
+ listeners: o,
1896
+ setNodeRef: s,
1314
1897
  transform: d,
1315
- transition: c,
1316
- isDragging: l
1317
- } = nr({ id: r }), u = {
1318
- transform: ar.Transform.toString(d),
1319
- transition: c
1898
+ transition: l,
1899
+ isDragging: c
1900
+ } = Bi({ id: e }), m = {
1901
+ transform: Ii.Transform.toString(d),
1902
+ transition: l
1320
1903
  };
1321
- return /* @__PURE__ */ h(
1904
+ return /* @__PURE__ */ p(
1322
1905
  "div",
1323
1906
  {
1324
- ref: a,
1325
- style: u,
1326
- className: m(
1907
+ ref: s,
1908
+ style: m,
1909
+ className: u(
1327
1910
  "rudi-kanban__card",
1328
- l && "rudi-kanban__card--dragging",
1329
- i
1911
+ c && "rudi-kanban__card--dragging",
1912
+ n
1330
1913
  ),
1331
1914
  children: [
1332
- /* @__PURE__ */ t(
1915
+ /* @__PURE__ */ i(
1333
1916
  "button",
1334
1917
  {
1335
1918
  type: "button",
1336
1919
  className: "rudi-kanban__card-handle",
1337
- "aria-label": `Drag handle for card ${r}`,
1920
+ "aria-label": `Move ${r ?? e}`,
1921
+ ...a,
1338
1922
  ...o,
1339
- ...n,
1340
1923
  "aria-roledescription": "sortable",
1341
- children: /* @__PURE__ */ h(
1924
+ children: /* @__PURE__ */ p(
1342
1925
  "svg",
1343
1926
  {
1344
1927
  width: "12",
@@ -1347,309 +1930,1321 @@ function dt({ id: r, children: e, className: i }) {
1347
1930
  fill: "currentColor",
1348
1931
  "aria-hidden": "true",
1349
1932
  children: [
1350
- /* @__PURE__ */ t("circle", { cx: "3.5", cy: "2", r: "1.25" }),
1351
- /* @__PURE__ */ t("circle", { cx: "8.5", cy: "2", r: "1.25" }),
1352
- /* @__PURE__ */ t("circle", { cx: "3.5", cy: "6", r: "1.25" }),
1353
- /* @__PURE__ */ t("circle", { cx: "8.5", cy: "6", r: "1.25" }),
1354
- /* @__PURE__ */ t("circle", { cx: "3.5", cy: "10", r: "1.25" }),
1355
- /* @__PURE__ */ t("circle", { cx: "8.5", cy: "10", r: "1.25" })
1933
+ /* @__PURE__ */ i("circle", { cx: "3.5", cy: "2", r: "1.25" }),
1934
+ /* @__PURE__ */ i("circle", { cx: "8.5", cy: "2", r: "1.25" }),
1935
+ /* @__PURE__ */ i("circle", { cx: "3.5", cy: "6", r: "1.25" }),
1936
+ /* @__PURE__ */ i("circle", { cx: "8.5", cy: "6", r: "1.25" }),
1937
+ /* @__PURE__ */ i("circle", { cx: "3.5", cy: "10", r: "1.25" }),
1938
+ /* @__PURE__ */ i("circle", { cx: "8.5", cy: "10", r: "1.25" })
1356
1939
  ]
1357
1940
  }
1358
1941
  )
1359
1942
  }
1360
1943
  ),
1361
- /* @__PURE__ */ t("div", { className: "rudi-kanban__card-content", children: e })
1944
+ /* @__PURE__ */ i("div", { className: "rudi-kanban__card-content", children: t })
1362
1945
  ]
1363
1946
  }
1364
1947
  );
1365
1948
  }
1366
- const lt = b(
1367
- function({ level: e, size: i, className: o, children: n, ...a }, d) {
1368
- const c = `h${e}`;
1369
- return /* @__PURE__ */ t(
1370
- c,
1949
+ const fe = v(
1950
+ function({ level: r, size: t, weight: n, tone: a, align: o, noMargin: s, className: d, children: l, ...c }, m) {
1951
+ const f = `h${r}`;
1952
+ return /* @__PURE__ */ i(
1953
+ f,
1371
1954
  {
1372
- ref: d,
1373
- className: m(
1374
- `rudi-heading rudi-heading--${i ?? e}`,
1375
- o
1955
+ ref: m,
1956
+ className: u(
1957
+ `rudi-heading rudi-heading--${t ?? r}`,
1958
+ n && `rudi-heading--weight-${n}`,
1959
+ a && `rudi-heading--tone-${a}`,
1960
+ o && `rudi-heading--align-${o}`,
1961
+ s && "rudi-heading--flush",
1962
+ d
1376
1963
  ),
1377
- ...a,
1378
- children: n
1964
+ ...c,
1965
+ children: l
1379
1966
  }
1380
1967
  );
1381
1968
  }
1382
- ), ut = b(function({ variant: e = "body", as: i = "p", className: o, children: n, ...a }, d) {
1383
- return /* @__PURE__ */ t(
1384
- i,
1969
+ ), _e = v(function({
1970
+ variant: r = "body",
1971
+ as: t = "p",
1972
+ weight: n,
1973
+ tone: a,
1974
+ align: o,
1975
+ noMargin: s,
1976
+ className: d,
1977
+ children: l,
1978
+ ...c
1979
+ }, m) {
1980
+ return /* @__PURE__ */ i(
1981
+ t,
1385
1982
  {
1386
- ref: d,
1387
- className: m(`rudi-text rudi-text--${e}`, o),
1388
- ...a,
1389
- children: n
1983
+ ref: m,
1984
+ className: u(
1985
+ `rudi-text rudi-text--${r}`,
1986
+ n && `rudi-text--weight-${n}`,
1987
+ a && `rudi-text--tone-${a}`,
1988
+ o && `rudi-text--align-${o}`,
1989
+ s && "rudi-text--flush",
1990
+ d
1991
+ ),
1992
+ ...c,
1993
+ children: l
1390
1994
  }
1391
1995
  );
1392
- }), mt = b(function({ size: e = "base", as: i = "div", className: o, children: n, ...a }, d) {
1393
- return /* @__PURE__ */ t(
1394
- i,
1996
+ }), $n = v(function({ size: r = "base", as: t = "div", className: n, children: a, ...o }, s) {
1997
+ return /* @__PURE__ */ i(
1998
+ t,
1395
1999
  {
1396
- ref: d,
1397
- className: m(
2000
+ ref: s,
2001
+ className: u(
1398
2002
  "rudi-prose",
1399
- e !== "base" && `rudi-prose--${e}`,
1400
- o
2003
+ r !== "base" && `rudi-prose--${r}`,
2004
+ n
1401
2005
  ),
1402
- ...a,
1403
- children: n
2006
+ ...o,
2007
+ children: a
1404
2008
  }
1405
2009
  );
1406
- }), ft = b(function({
1407
- padding: e,
1408
- bordered: i = !1,
1409
- invert: o = !1,
1410
- as: n = "div",
1411
- className: a,
2010
+ }), Bn = v(function({
2011
+ padding: r,
2012
+ bordered: t = !1,
2013
+ invert: n = !1,
2014
+ sticky: a = !1,
2015
+ as: o = "div",
2016
+ className: s,
1412
2017
  style: d,
1413
- children: c,
1414
- ...l
1415
- }, u) {
1416
- const s = {};
1417
- return e && (s["--box-padding"] = e), /* @__PURE__ */ t(
1418
- n,
2018
+ children: l,
2019
+ ...c
2020
+ }, m) {
2021
+ const f = {};
2022
+ return r && (f["--box-padding"] = r), typeof a == "string" && (f["--box-sticky-top"] = a), /* @__PURE__ */ i(
2023
+ o,
1419
2024
  {
1420
- ref: u,
1421
- className: m(
2025
+ ref: m,
2026
+ className: u(
1422
2027
  "rudi-box",
1423
- i && "rudi-box--bordered",
1424
- o && "rudi-box--invert",
1425
- a
2028
+ t && "rudi-box--bordered",
2029
+ n && "rudi-box--invert",
2030
+ a && "rudi-box--sticky",
2031
+ s
1426
2032
  ),
1427
- style: { ...s, ...d },
1428
- ...l,
1429
- children: c
2033
+ style: { ...f, ...d },
2034
+ ...c,
2035
+ children: l
1430
2036
  }
1431
2037
  );
1432
- }), ht = b(function({
1433
- space: e,
1434
- recursive: i = !1,
1435
- splitAfter: o,
1436
- as: n = "div",
1437
- className: a,
1438
- style: d,
1439
- children: c,
2038
+ }), In = v(function({
2039
+ space: r,
2040
+ recursive: t = !1,
2041
+ splitAfter: n,
2042
+ as: a = "div",
2043
+ className: o,
2044
+ style: s,
2045
+ children: d,
1440
2046
  ...l
1441
- }, u) {
1442
- const s = {};
1443
- e && (s["--stack-space"] = e);
1444
- const p = Pe.toArray(c), g = o ? p.map((f, _) => _ === o - 1 && Se(f) ? Be(
1445
- f,
2047
+ }, c) {
2048
+ const m = {};
2049
+ r && (m["--stack-space"] = r);
2050
+ const f = $e.toArray(d), g = n ? f.map((_, h) => h === n - 1 && X(_) ? xr(
2051
+ _,
1446
2052
  {
1447
2053
  style: {
1448
- ...f.props.style,
2054
+ ..._.props.style,
1449
2055
  marginBlockEnd: "auto"
1450
2056
  }
1451
2057
  }
1452
- ) : f) : c;
1453
- return /* @__PURE__ */ t(
1454
- n,
2058
+ ) : _) : d;
2059
+ return /* @__PURE__ */ i(
2060
+ a,
1455
2061
  {
1456
- ref: u,
1457
- className: m(
2062
+ ref: c,
2063
+ className: u(
1458
2064
  "rudi-stack",
1459
- i && "rudi-stack--recursive",
1460
- o && "rudi-stack--split",
1461
- a
2065
+ t && "rudi-stack--recursive",
2066
+ n && "rudi-stack--split",
2067
+ o
1462
2068
  ),
1463
- style: { ...s, ...d },
2069
+ style: { ...m, ...s },
1464
2070
  ...l,
1465
2071
  children: g
1466
2072
  }
1467
2073
  );
1468
- }), pt = b(function({
1469
- space: e,
1470
- justify: i,
1471
- align: o,
1472
- as: n = "div",
1473
- className: a,
1474
- style: d,
1475
- children: c,
2074
+ }), Mn = v(function({
2075
+ space: r,
2076
+ justify: t,
2077
+ align: n,
2078
+ as: a = "div",
2079
+ className: o,
2080
+ style: s,
2081
+ children: d,
1476
2082
  ...l
1477
- }, u) {
1478
- const s = {};
1479
- return e && (s["--cluster-space"] = e), i && (s["--cluster-justify"] = i), o && (s["--cluster-align"] = o), /* @__PURE__ */ t(
1480
- n,
2083
+ }, c) {
2084
+ const m = {};
2085
+ return r && (m["--cluster-space"] = r), t && (m["--cluster-justify"] = t), n && (m["--cluster-align"] = n), /* @__PURE__ */ i(
2086
+ a,
1481
2087
  {
1482
- ref: u,
1483
- className: m("rudi-cluster", a),
1484
- style: { ...s, ...d },
2088
+ ref: c,
2089
+ className: u("rudi-cluster", o),
2090
+ style: { ...m, ...s },
1485
2091
  ...l,
1486
- children: c
2092
+ children: d
1487
2093
  }
1488
2094
  );
1489
- }), gt = b(function({
1490
- minCellWidth: e,
1491
- space: i,
1492
- as: o = "div",
1493
- className: n,
1494
- style: a,
1495
- children: d,
1496
- ...c
2095
+ }), Dn = v(function({
2096
+ minCellWidth: r,
2097
+ space: t,
2098
+ as: n = "div",
2099
+ className: a,
2100
+ style: o,
2101
+ children: s,
2102
+ ...d
1497
2103
  }, l) {
1498
- const u = {};
1499
- return e && (u["--grid-min-cell"] = e), i && (u["--grid-space"] = i), /* @__PURE__ */ t(
1500
- o,
2104
+ const c = {};
2105
+ return r && (c["--grid-min-cell"] = r), t && (c["--grid-space"] = t), /* @__PURE__ */ i(
2106
+ n,
1501
2107
  {
1502
2108
  ref: l,
1503
- className: m("rudi-grid", n),
1504
- style: { ...u, ...a },
1505
- ...c,
1506
- children: d
2109
+ className: u("rudi-grid", a),
2110
+ style: { ...c, ...o },
2111
+ ...d,
2112
+ children: s
1507
2113
  }
1508
2114
  );
1509
- }), bt = b(function({
1510
- side: e = "left",
1511
- sideWidth: i,
1512
- contentMin: o,
1513
- space: n,
1514
- noStretch: a = !1,
1515
- as: d = "div",
1516
- className: c,
2115
+ }), En = v(function({
2116
+ side: r = "left",
2117
+ sideWidth: t,
2118
+ contentMin: n,
2119
+ space: a,
2120
+ noStretch: o = !1,
2121
+ as: s = "div",
2122
+ className: d,
1517
2123
  style: l,
1518
- children: u,
1519
- ...s
1520
- }, p) {
2124
+ children: c,
2125
+ ...m
2126
+ }, f) {
1521
2127
  const g = {};
1522
- return i && (g["--sidebar-width"] = i), o && (g["--sidebar-content-min"] = o), n && (g["--sidebar-space"] = n), /* @__PURE__ */ t(
1523
- d,
2128
+ return t && (g["--sidebar-width"] = t), n && (g["--sidebar-content-min"] = n), a && (g["--sidebar-space"] = a), /* @__PURE__ */ i(
2129
+ s,
1524
2130
  {
1525
- ref: p,
1526
- className: m(
2131
+ ref: f,
2132
+ className: u(
1527
2133
  "rudi-sidebar",
1528
- e === "right" && "rudi-sidebar--right",
1529
- a && "rudi-sidebar--no-stretch",
1530
- c
2134
+ r === "right" && "rudi-sidebar--right",
2135
+ o && "rudi-sidebar--no-stretch",
2136
+ d
1531
2137
  ),
1532
2138
  style: { ...g, ...l },
1533
- ...s,
1534
- children: u
2139
+ ...m,
2140
+ children: c
1535
2141
  }
1536
2142
  );
1537
- }), _t = b(function({
1538
- maxWidth: e,
1539
- gutters: i,
1540
- intrinsic: o = !1,
1541
- as: n = "div",
1542
- className: a,
1543
- style: d,
1544
- children: c,
2143
+ }), Ln = v(function({
2144
+ maxWidth: r,
2145
+ gutters: t,
2146
+ intrinsic: n = !1,
2147
+ as: a = "div",
2148
+ className: o,
2149
+ style: s,
2150
+ children: d,
1545
2151
  ...l
1546
- }, u) {
1547
- const s = {};
1548
- return e && (s["--center-max-width"] = e), i && (s["--center-gutters"] = i), /* @__PURE__ */ t(
1549
- n,
2152
+ }, c) {
2153
+ const m = {};
2154
+ return r && (m["--center-max-width"] = r), t && (m["--center-gutters"] = t), /* @__PURE__ */ i(
2155
+ a,
1550
2156
  {
1551
- ref: u,
1552
- className: m(
2157
+ ref: c,
2158
+ className: u(
1553
2159
  "rudi-center",
1554
- o && "rudi-center--intrinsic",
1555
- a
2160
+ n && "rudi-center--intrinsic",
2161
+ o
1556
2162
  ),
1557
- style: { ...s, ...d },
2163
+ style: { ...m, ...s },
1558
2164
  ...l,
1559
- children: c
2165
+ children: d
1560
2166
  }
1561
2167
  );
1562
- }), vt = b(function({
1563
- minHeight: e,
1564
- space: i,
1565
- as: o = "div",
1566
- className: n,
1567
- style: a,
1568
- children: d,
1569
- ...c
2168
+ }), lt = v(function({ as: r = "div", className: t, children: n, ...a }, o) {
2169
+ return /* @__PURE__ */ i(r, { ref: o, className: u("rudi-cover__centered", t), ...a, children: n });
2170
+ }), ct = v(function({
2171
+ minHeight: r,
2172
+ space: t,
2173
+ as: n = "div",
2174
+ className: a,
2175
+ style: o,
2176
+ children: s,
2177
+ ...d
1570
2178
  }, l) {
1571
- const u = {};
1572
- return e && (u["--cover-min-height"] = e), i && (u["--cover-space"] = i), /* @__PURE__ */ t(
1573
- o,
2179
+ const c = {};
2180
+ return r && (c["--cover-min-height"] = r), t && (c["--cover-space"] = t), /* @__PURE__ */ i(
2181
+ n,
1574
2182
  {
1575
2183
  ref: l,
1576
- className: m("rudi-cover", n),
1577
- style: { ...u, ...a },
1578
- ...c,
1579
- children: d
2184
+ className: u("rudi-cover", a),
2185
+ style: { ...c, ...o },
2186
+ ...d,
2187
+ children: s
1580
2188
  }
1581
2189
  );
1582
- }), Nt = b(
2190
+ }), On = Object.assign(ct, { Centered: lt }), zn = v(
2191
+ function({
2192
+ threshold: r,
2193
+ space: t,
2194
+ limit: n,
2195
+ as: a = "div",
2196
+ className: o,
2197
+ style: s,
2198
+ children: d,
2199
+ ...l
2200
+ }, c) {
2201
+ const m = {};
2202
+ return r && (m["--switcher-threshold"] = r), t && (m["--switcher-space"] = t), /* @__PURE__ */ i(
2203
+ a,
2204
+ {
2205
+ ref: c,
2206
+ className: u("rudi-switcher", o),
2207
+ style: { ...m, ...s },
2208
+ ...l,
2209
+ children: d
2210
+ }
2211
+ );
2212
+ }
2213
+ ), Ue = ae(null);
2214
+ function je() {
2215
+ const e = K(Ue);
2216
+ if (!e)
2217
+ throw new Error(
2218
+ "RudiAppShell subcomponents must be rendered inside <RudiAppShell>."
2219
+ );
2220
+ return e;
2221
+ }
2222
+ const ut = v(
1583
2223
  function({
1584
- threshold: e,
1585
- space: i,
1586
- limit: o,
1587
- as: n = "div",
2224
+ isSidebarOpen: r,
2225
+ onSidebarOpenChange: t,
2226
+ defaultSidebarOpen: n = !1,
1588
2227
  className: a,
1589
- style: d,
1590
- children: c,
2228
+ children: o,
2229
+ ...s
2230
+ }, d) {
2231
+ const [l, c] = O(n), m = r !== void 0, f = m ? r : l, g = we(), _ = P(null), h = (b) => {
2232
+ m || c(b), t?.(b);
2233
+ };
2234
+ return ne(() => {
2235
+ if (!f) return;
2236
+ const b = (N) => {
2237
+ N.key === "Escape" && (m || c(!1), t?.(!1), _.current?.querySelector("button")?.focus());
2238
+ };
2239
+ return document.addEventListener("keydown", b), () => document.removeEventListener("keydown", b);
2240
+ }, [f, m, t]), /* @__PURE__ */ i(
2241
+ Ue.Provider,
2242
+ {
2243
+ value: {
2244
+ isSidebarOpen: f,
2245
+ setSidebarOpen: h,
2246
+ toggleSidebar: () => h(!f),
2247
+ sidebarId: g,
2248
+ menuButtonRef: _
2249
+ },
2250
+ children: /* @__PURE__ */ i(
2251
+ "div",
2252
+ {
2253
+ ref: d,
2254
+ className: u(
2255
+ "rudi-app-shell",
2256
+ f && "rudi-app-shell--sidebar-open",
2257
+ a
2258
+ ),
2259
+ ...s,
2260
+ children: o
2261
+ }
2262
+ )
2263
+ }
2264
+ );
2265
+ }
2266
+ );
2267
+ function mt({
2268
+ width: e,
2269
+ className: r,
2270
+ style: t,
2271
+ children: n,
2272
+ "aria-label": a = "Sidebar",
2273
+ ...o
2274
+ }) {
2275
+ const { isSidebarOpen: s, setSidebarOpen: d, sidebarId: l } = je(), c = {};
2276
+ return e && (c["--sidebar-width"] = e), /* @__PURE__ */ p(w, { children: [
2277
+ /* @__PURE__ */ i(
2278
+ "button",
2279
+ {
2280
+ type: "button",
2281
+ "aria-label": "Close navigation",
2282
+ className: "rudi-app-shell__backdrop",
2283
+ onClick: () => d(!1),
2284
+ tabIndex: s ? 0 : -1
2285
+ }
2286
+ ),
2287
+ /* @__PURE__ */ i(
2288
+ "aside",
2289
+ {
2290
+ id: l,
2291
+ className: u("rudi-app-shell__sidebar", r),
2292
+ "aria-label": a,
2293
+ style: { ...c, ...t },
2294
+ ...o,
2295
+ children: n
2296
+ }
2297
+ )
2298
+ ] });
2299
+ }
2300
+ function pt({
2301
+ className: e,
2302
+ children: r,
2303
+ ...t
2304
+ }) {
2305
+ return /* @__PURE__ */ i("div", { className: u("rudi-app-shell__content", e), ...t, children: r });
2306
+ }
2307
+ function ht({
2308
+ maxWidth: e,
2309
+ padding: r,
2310
+ className: t,
2311
+ style: n,
2312
+ children: a,
2313
+ ...o
2314
+ }) {
2315
+ const s = {};
2316
+ return e && (s["--app-shell-main-max-width"] = e), r && (s["--app-shell-main-padding"] = r), /* @__PURE__ */ i(
2317
+ "main",
2318
+ {
2319
+ className: u("rudi-app-shell__main", t),
2320
+ style: { ...s, ...n },
2321
+ ...o,
2322
+ children: /* @__PURE__ */ i("div", { className: "rudi-app-shell__main-inner", children: a })
2323
+ }
2324
+ );
2325
+ }
2326
+ function ft({
2327
+ "aria-label": e = "Open navigation",
2328
+ icon: r = "lucide:menu",
2329
+ className: t
2330
+ }) {
2331
+ const { toggleSidebar: n, isSidebarOpen: a, sidebarId: o, menuButtonRef: s } = je();
2332
+ return /* @__PURE__ */ i("span", { ref: s, className: u("rudi-app-shell__menu", t), children: /* @__PURE__ */ i(
2333
+ he,
2334
+ {
2335
+ "aria-label": e,
2336
+ "aria-expanded": a,
2337
+ "aria-controls": o,
2338
+ variant: "ghost",
2339
+ onPress: n,
2340
+ children: /* @__PURE__ */ i(R, { icon: r })
2341
+ }
2342
+ ) });
2343
+ }
2344
+ const An = Object.assign(ut, {
2345
+ Sidebar: mt,
2346
+ Content: pt,
2347
+ Main: ht,
2348
+ MenuButton: ft
2349
+ }), Fn = v(
2350
+ function({
2351
+ start: r,
2352
+ end: t,
2353
+ announcement: n,
2354
+ sticky: a = !0,
2355
+ as: o = "header",
2356
+ className: s,
2357
+ children: d,
1591
2358
  ...l
1592
- }, u) {
1593
- const s = {};
1594
- return e && (s["--switcher-threshold"] = e), i && (s["--switcher-space"] = i), /* @__PURE__ */ t(
1595
- n,
2359
+ }, c) {
2360
+ return /* @__PURE__ */ p(
2361
+ o,
1596
2362
  {
1597
- ref: u,
1598
- className: m("rudi-switcher", a),
1599
- style: { ...s, ...d },
2363
+ ref: c,
2364
+ className: u(
2365
+ "rudi-top-bar",
2366
+ a && "rudi-top-bar--sticky",
2367
+ s
2368
+ ),
1600
2369
  ...l,
1601
- children: c
2370
+ children: [
2371
+ n != null && /* @__PURE__ */ i("div", { className: "rudi-top-bar__announcement", children: n }),
2372
+ /* @__PURE__ */ p("div", { className: "rudi-top-bar__row", children: [
2373
+ r != null && /* @__PURE__ */ i("div", { className: "rudi-top-bar__start", children: r }),
2374
+ d != null && /* @__PURE__ */ i("div", { className: "rudi-top-bar__center", children: d }),
2375
+ t != null && /* @__PURE__ */ i("div", { className: "rudi-top-bar__end", children: t })
2376
+ ] })
2377
+ ]
2378
+ }
2379
+ );
2380
+ }
2381
+ ), Gn = v(
2382
+ function({ title: r, subtitle: t, actions: n, headingLevel: a = 1, className: o, ...s }, d) {
2383
+ return /* @__PURE__ */ p("div", { ref: d, className: u("rudi-page-header", o), ...s, children: [
2384
+ /* @__PURE__ */ p("div", { className: "rudi-page-header__text", children: [
2385
+ /* @__PURE__ */ i(
2386
+ fe,
2387
+ {
2388
+ level: a,
2389
+ size: 2,
2390
+ noMargin: !0,
2391
+ className: "rudi-page-header__title",
2392
+ children: r
2393
+ }
2394
+ ),
2395
+ t != null && /* @__PURE__ */ i(
2396
+ _e,
2397
+ {
2398
+ variant: "caption",
2399
+ noMargin: !0,
2400
+ className: "rudi-page-header__subtitle",
2401
+ children: t
2402
+ }
2403
+ )
2404
+ ] }),
2405
+ n != null && /* @__PURE__ */ i("div", { className: "rudi-page-header__actions", children: n })
2406
+ ] });
2407
+ }
2408
+ ), Kn = v(function({ title: r, description: t, action: n, headingLevel: a = 2, className: o, ...s }, d) {
2409
+ return /* @__PURE__ */ p("div", { ref: d, className: u("rudi-section-header", o), ...s, children: [
2410
+ /* @__PURE__ */ p("div", { className: "rudi-section-header__text", children: [
2411
+ /* @__PURE__ */ i(
2412
+ fe,
2413
+ {
2414
+ level: a,
2415
+ size: 5,
2416
+ noMargin: !0,
2417
+ className: "rudi-section-header__title",
2418
+ children: r
2419
+ }
2420
+ ),
2421
+ t != null && /* @__PURE__ */ i(
2422
+ _e,
2423
+ {
2424
+ variant: "body-sm",
2425
+ noMargin: !0,
2426
+ className: "rudi-section-header__description",
2427
+ children: t
2428
+ }
2429
+ )
2430
+ ] }),
2431
+ n != null && /* @__PURE__ */ i("div", { className: "rudi-section-header__action", children: n })
2432
+ ] });
2433
+ }), Vn = vr;
2434
+ function _t({ name: e, mark: r, hideName: t }) {
2435
+ return /* @__PURE__ */ p(w, { children: [
2436
+ r != null && /* @__PURE__ */ i("span", { className: "rudi-brand__mark", "aria-hidden": "true", children: r }),
2437
+ /* @__PURE__ */ i("span", { className: u("rudi-brand__name", t && "rudi-brand__name--hidden"), children: e })
2438
+ ] });
2439
+ }
2440
+ function bt({ href: e, className: r, children: t }) {
2441
+ const n = P(null), { linkProps: a } = W({ href: e }, n);
2442
+ return /* @__PURE__ */ i("a", { ...a, ref: n, href: e, className: r, children: t });
2443
+ }
2444
+ function Hn({ name: e, mark: r, hideName: t = !1, href: n, size: a = "md", className: o }) {
2445
+ const s = u("rudi-brand", `rudi-brand--${a}`, n && "rudi-brand--link", o), d = /* @__PURE__ */ i(_t, { name: e, mark: r, hideName: t });
2446
+ return n ? /* @__PURE__ */ i(bt, { href: n, className: s, children: d }) : /* @__PURE__ */ i("span", { className: s, children: d });
2447
+ }
2448
+ const gt = (e) => `${e} ${e === 1 ? "problem" : "problems"} to fix`, Un = v(function({ onSubmit: r, errors: t = [], errorTitle: n = gt, noValidate: a = !0, className: o, children: s, ...d }, l) {
2449
+ const c = B(l), m = P(null), f = t.length > 0, [g, _] = O(0);
2450
+ return ne(() => {
2451
+ g > 0 && f && m.current?.focus();
2452
+ }, [g]), /* @__PURE__ */ p(
2453
+ "form",
2454
+ {
2455
+ ...d,
2456
+ ref: c,
2457
+ noValidate: a,
2458
+ className: u("rudi-form", o),
2459
+ onSubmit: (h) => {
2460
+ h.preventDefault(), r?.(new FormData(h.currentTarget), h), _((b) => b + 1);
2461
+ },
2462
+ children: [
2463
+ f && /* @__PURE__ */ i("div", { ref: m, tabIndex: -1, className: "rudi-form__summary", children: /* @__PURE__ */ i(Wi, { variant: "error", title: n(t.length), children: /* @__PURE__ */ i("ul", { className: "rudi-form__summary-list", children: t.map((h) => /* @__PURE__ */ i("li", { children: h }, h)) }) }) }),
2464
+ s
2465
+ ]
2466
+ }
2467
+ );
2468
+ });
2469
+ function jn({ orientation: e = "horizontal", className: r, ...t }) {
2470
+ return /* @__PURE__ */ i(
2471
+ Fr,
2472
+ {
2473
+ ...t,
2474
+ orientation: e,
2475
+ className: u("rudi-tabs", `rudi-tabs--${e}`, r)
2476
+ }
2477
+ );
2478
+ }
2479
+ function qn({
2480
+ variant: e = "underline",
2481
+ className: r,
2482
+ ...t
2483
+ }) {
2484
+ return /* @__PURE__ */ i(
2485
+ Gr,
2486
+ {
2487
+ ...t,
2488
+ className: u("rudi-tab-list", `rudi-tab-list--${e}`, r)
2489
+ }
2490
+ );
2491
+ }
2492
+ function Wn({ id: e, icon: r, badge: t, className: n, children: a, ...o }) {
2493
+ return /* @__PURE__ */ p(Kr, { ...o, id: e, className: u("rudi-tab", n), children: [
2494
+ r && /* @__PURE__ */ i(R, { icon: r, className: "rudi-tab__icon" }),
2495
+ /* @__PURE__ */ i("span", { className: "rudi-tab__label", children: a }),
2496
+ t != null && t !== !1 && /* @__PURE__ */ p(w, { children: [
2497
+ " ",
2498
+ /* @__PURE__ */ i("span", { className: "rudi-tab__badge", children: t })
2499
+ ] })
2500
+ ] });
2501
+ }
2502
+ function Xn({ className: e, ...r }) {
2503
+ return /* @__PURE__ */ i(Vr, { ...r, className: u("rudi-tab-panel", e) });
2504
+ }
2505
+ const Zn = v(
2506
+ function({ icon: r, title: t, description: n, action: a, headingLevel: o = 3, size: s = "md", className: d }, l) {
2507
+ return /* @__PURE__ */ p("div", { ref: l, className: u("rudi-empty-state", `rudi-empty-state--${s}`, d), children: [
2508
+ r && /* @__PURE__ */ i(R, { icon: r, className: "rudi-empty-state__icon" }),
2509
+ /* @__PURE__ */ i(
2510
+ fe,
2511
+ {
2512
+ level: o,
2513
+ size: s === "sm" ? 6 : 5,
2514
+ align: "center",
2515
+ noMargin: !0,
2516
+ className: "rudi-empty-state__title",
2517
+ children: t
2518
+ }
2519
+ ),
2520
+ n != null && /* @__PURE__ */ i(
2521
+ _e,
2522
+ {
2523
+ as: typeof n == "string" ? "p" : "div",
2524
+ variant: s === "sm" ? "body-sm" : "body",
2525
+ tone: "subtle",
2526
+ align: "center",
2527
+ noMargin: !0,
2528
+ className: "rudi-empty-state__description",
2529
+ children: n
2530
+ }
2531
+ ),
2532
+ a != null && /* @__PURE__ */ i("div", { className: "rudi-empty-state__action", children: a })
2533
+ ] });
2534
+ }
2535
+ );
2536
+ function Nt({ state: e, triggerRef: r, popoverRef: t, children: n }) {
2537
+ const { popoverProps: a } = Ce(
2538
+ { triggerRef: r, popoverRef: t, isNonModal: !0, placement: "bottom start", offset: 4 },
2539
+ e
2540
+ ), [o, s] = O();
2541
+ Cr(() => {
2542
+ s(r.current?.offsetWidth);
2543
+ }, [r]);
2544
+ const d = {
2545
+ ...a.style,
2546
+ ...o ? { "--trigger-width": `${o}px` } : {}
2547
+ };
2548
+ return /* @__PURE__ */ p("div", { ...a, ref: t, style: d, className: "rudi-combo-box__popover", children: [
2549
+ n,
2550
+ /* @__PURE__ */ i(kr, { onDismiss: e.close })
2551
+ ] });
2552
+ }
2553
+ function vt({ state: e, listBoxRef: r, ...t }) {
2554
+ const { listBoxProps: n } = Se(t, e, r);
2555
+ return /* @__PURE__ */ i("ul", { ...n, ref: r, className: "rudi-combo-box__listbox", children: [...e.collection].map((a) => /* @__PURE__ */ i(Rt, { item: a, state: e }, a.key)) });
2556
+ }
2557
+ function Rt({ item: e, state: r }) {
2558
+ const t = P(null), { optionProps: n, isSelected: a, isFocused: o, isDisabled: s } = Pe(
2559
+ { key: e.key },
2560
+ r,
2561
+ t
2562
+ );
2563
+ return /* @__PURE__ */ i(
2564
+ "li",
2565
+ {
2566
+ ...n,
2567
+ ref: t,
2568
+ className: "rudi-combo-box__option",
2569
+ "data-focused": o,
2570
+ "data-disabled": s || void 0,
2571
+ "aria-selected": a,
2572
+ children: e.rendered
2573
+ }
2574
+ );
2575
+ }
2576
+ function Qn(e) {
2577
+ const {
2578
+ label: r,
2579
+ description: t,
2580
+ errorMessage: n,
2581
+ isRequired: a = !1,
2582
+ isDisabled: o = !1,
2583
+ menuTrigger: s = "input",
2584
+ emptyMessage: d = "No matches",
2585
+ placeholder: l,
2586
+ className: c
2587
+ } = e, { contains: m } = Rr({ sensitivity: "base" }), f = !!n, g = {
2588
+ ...e,
2589
+ items: void 0,
2590
+ defaultItems: e.items,
2591
+ menuTrigger: s,
2592
+ isRequired: a,
2593
+ isDisabled: o,
2594
+ isInvalid: f,
2595
+ validationBehavior: "aria",
2596
+ allowsEmptyCollection: !0,
2597
+ defaultFilter: m
2598
+ }, _ = Br(g), h = P(null), b = P(null), N = P(null), y = P(null), k = P(null), {
2599
+ labelProps: C,
2600
+ inputProps: T,
2601
+ listBoxProps: M,
2602
+ buttonProps: E,
2603
+ descriptionProps: $,
2604
+ errorMessageProps: x
2605
+ } = yr(
2606
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2607
+ { ...g, inputRef: b, buttonRef: N, listBoxRef: y, popoverRef: k },
2608
+ _
2609
+ ), { buttonProps: S } = G(E, N), rr = _.collection.size === 0;
2610
+ return /* @__PURE__ */ p("div", { className: u("rudi-combo-box", c), children: [
2611
+ /* @__PURE__ */ p("label", { ...C, className: "rudi-combo-box__label", children: [
2612
+ r,
2613
+ a && /* @__PURE__ */ p("span", { className: "rudi-combo-box__required", "aria-hidden": "true", children: [
2614
+ " ",
2615
+ "*"
2616
+ ] })
2617
+ ] }),
2618
+ /* @__PURE__ */ p(
2619
+ "div",
2620
+ {
2621
+ ref: h,
2622
+ className: u(
2623
+ "rudi-combo-box__field",
2624
+ f && "rudi-combo-box__field--error",
2625
+ o && "rudi-combo-box__field--disabled"
2626
+ ),
2627
+ children: [
2628
+ /* @__PURE__ */ i(
2629
+ "input",
2630
+ {
2631
+ ...T,
2632
+ ref: b,
2633
+ placeholder: l,
2634
+ className: "rudi-combo-box__input"
2635
+ }
2636
+ ),
2637
+ /* @__PURE__ */ i("button", { ...S, ref: N, className: "rudi-combo-box__button", children: /* @__PURE__ */ i(R, { icon: "lucide:chevrons-up-down", size: "sm" }) })
2638
+ ]
2639
+ }
2640
+ ),
2641
+ _.isOpen && /* @__PURE__ */ p(Nt, { state: _, triggerRef: h, popoverRef: k, children: [
2642
+ /* @__PURE__ */ i(vt, { ...M, state: _, listBoxRef: y }),
2643
+ rr && /* @__PURE__ */ i("p", { className: "rudi-combo-box__empty", children: d })
2644
+ ] }),
2645
+ t && !f && /* @__PURE__ */ i("p", { ...$, className: "rudi-combo-box__description", children: t }),
2646
+ f && /* @__PURE__ */ i("p", { ...x, className: "rudi-combo-box__error", children: n })
2647
+ ] });
2648
+ }
2649
+ const yt = {
2650
+ success: 5e3,
2651
+ info: 5e3,
2652
+ warning: 5e3,
2653
+ error: void 0
2654
+ };
2655
+ function kt() {
2656
+ return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
2657
+ }
2658
+ function xt(e) {
2659
+ typeof document < "u" && "startViewTransition" in document && !kt() ? document.startViewTransition(() => {
2660
+ Mi(e);
2661
+ }) : e();
2662
+ }
2663
+ const q = new Hr({
2664
+ maxVisibleToasts: 5,
2665
+ wrapUpdate: xt
2666
+ });
2667
+ function qe({ title: e, description: r, variant: t, timeout: n, onClose: a }) {
2668
+ const o = n === void 0 ? yt[t] : n;
2669
+ return q.add(
2670
+ { title: e, description: r, variant: t },
2671
+ { timeout: o && o > 0 ? o : void 0, onClose: a }
2672
+ );
2673
+ }
2674
+ const U = (e) => (r, t = {}) => qe({ ...t, title: r, variant: e }), Yn = {
2675
+ add: qe,
2676
+ success: U("success"),
2677
+ info: U("info"),
2678
+ warning: U("warning"),
2679
+ error: U("error"),
2680
+ close: (e) => q.close(e),
2681
+ /** Removes every toast. Mainly useful in tests. */
2682
+ clear: () => q.clear()
2683
+ }, Ct = {
2684
+ info: "lucide:info",
2685
+ success: "lucide:circle-check",
2686
+ warning: "lucide:triangle-alert",
2687
+ error: "lucide:circle-alert"
2688
+ };
2689
+ function St({ toast: e }) {
2690
+ const r = K(jr), { title: t, description: n, variant: a } = e.content;
2691
+ return /* @__PURE__ */ p(
2692
+ qr,
2693
+ {
2694
+ toast: e,
2695
+ className: u("rudi-toast", `rudi-toast--${a}`),
2696
+ style: { viewTransitionName: e.key },
2697
+ children: [
2698
+ /* @__PURE__ */ i(R, { icon: Ct[a], size: "md", className: "rudi-toast__icon" }),
2699
+ /* @__PURE__ */ p(Wr, { className: "rudi-toast__content", children: [
2700
+ /* @__PURE__ */ i(z, { slot: "title", className: "rudi-toast__title", children: t }),
2701
+ n && /* @__PURE__ */ i(z, { slot: "description", className: "rudi-toast__description", children: n })
2702
+ ] }),
2703
+ /* @__PURE__ */ i(
2704
+ he,
2705
+ {
2706
+ "aria-label": "Close",
2707
+ variant: "ghost",
2708
+ size: "sm",
2709
+ className: "rudi-toast__close",
2710
+ onPress: () => r?.close(e.key),
2711
+ children: /* @__PURE__ */ i(R, { icon: "lucide:x", size: "sm" })
2712
+ }
2713
+ )
2714
+ ]
2715
+ }
2716
+ );
2717
+ }
2718
+ function Jn({
2719
+ placement: e = "bottom-end",
2720
+ "aria-label": r,
2721
+ className: t
2722
+ }) {
2723
+ return /* @__PURE__ */ i(
2724
+ Ur,
2725
+ {
2726
+ queue: q,
2727
+ "aria-label": r,
2728
+ className: u("rudi-toast-region", `rudi-toast-region--${e}`, t),
2729
+ children: ({ toast: n }) => /* @__PURE__ */ i(St, { toast: n })
2730
+ }
2731
+ );
2732
+ }
2733
+ const ea = v(function({ density: r = "regular", striped: t = !1, stickyHeader: n = !1, maxHeight: a, className: o, ...s }, d) {
2734
+ const l = a != null ? {
2735
+ "--table-max-height": typeof a == "number" ? `${a}px` : a
2736
+ } : void 0;
2737
+ return /* @__PURE__ */ i(
2738
+ "div",
2739
+ {
2740
+ className: u(
2741
+ "rudi-table",
2742
+ `rudi-table--${r}`,
2743
+ t && "rudi-table--striped",
2744
+ n && "rudi-table--sticky-header",
2745
+ a != null && "rudi-table--max-height",
2746
+ o
2747
+ ),
2748
+ style: l,
2749
+ children: /* @__PURE__ */ i(Xr, { ...s, ref: d, className: "rudi-table__grid" })
2750
+ }
2751
+ );
2752
+ });
2753
+ function We() {
2754
+ return /* @__PURE__ */ i(Zr, { slot: "selection", className: "rudi-table__checkbox", children: ({ isSelected: e, isIndeterminate: r }) => /* @__PURE__ */ i(
2755
+ "span",
2756
+ {
2757
+ "aria-hidden": "true",
2758
+ className: u(
2759
+ "rudi-table__checkbox-control",
2760
+ e && "rudi-table__checkbox-control--checked",
2761
+ r && "rudi-table__checkbox-control--indeterminate"
2762
+ )
2763
+ }
2764
+ ) });
2765
+ }
2766
+ function ra({
2767
+ columns: e,
2768
+ children: r,
2769
+ dependencies: t,
2770
+ className: n,
2771
+ ...a
2772
+ }) {
2773
+ const { selectionBehavior: o, selectionMode: s } = Ie();
2774
+ return /* @__PURE__ */ p(Qr, { ...a, className: u("rudi-table__header", n), children: [
2775
+ o === "toggle" && /* @__PURE__ */ i(Me, { className: "rudi-table__column rudi-table__column--selection", children: s === "multiple" ? /* @__PURE__ */ i(We, {}) : /* @__PURE__ */ i(te, { children: "Select" }) }),
2776
+ /* @__PURE__ */ i(se, { items: e, dependencies: t, children: r })
2777
+ ] });
2778
+ }
2779
+ const Pt = {
2780
+ ascending: "lucide:arrow-up",
2781
+ descending: "lucide:arrow-down",
2782
+ none: "lucide:arrow-up-down"
2783
+ };
2784
+ function ia({
2785
+ align: e = "start",
2786
+ width: r,
2787
+ minWidth: t,
2788
+ children: n,
2789
+ className: a,
2790
+ textValue: o,
2791
+ ...s
2792
+ }) {
2793
+ return /* @__PURE__ */ i(
2794
+ Me,
2795
+ {
2796
+ ...s,
2797
+ "data-align": e,
2798
+ textValue: o ?? (typeof n == "string" ? n : void 0),
2799
+ style: r != null || t != null ? { width: r, minWidth: t } : void 0,
2800
+ className: u("rudi-table__column", a),
2801
+ children: ({ allowsSorting: d, sortDirection: l }) => /* @__PURE__ */ p("span", { className: "rudi-table__column-content", children: [
2802
+ /* @__PURE__ */ i("span", { className: "rudi-table__column-label", children: n }),
2803
+ d && /* @__PURE__ */ i(
2804
+ R,
2805
+ {
2806
+ icon: Pt[l ?? "none"],
2807
+ size: "sm",
2808
+ className: u(
2809
+ "rudi-table__sort-icon",
2810
+ l && "rudi-table__sort-icon--active"
2811
+ )
2812
+ }
2813
+ )
2814
+ ] })
2815
+ }
2816
+ );
2817
+ }
2818
+ function ta({ className: e, ...r }) {
2819
+ return /* @__PURE__ */ i(Yr, { ...r, className: u("rudi-table__body", e) });
2820
+ }
2821
+ function na({
2822
+ id: e,
2823
+ columns: r,
2824
+ children: t,
2825
+ dependencies: n,
2826
+ className: a,
2827
+ ...o
2828
+ }) {
2829
+ const { selectionBehavior: s } = Ie();
2830
+ return /* @__PURE__ */ p(Jr, { id: e, ...o, className: u("rudi-table__row", a), children: [
2831
+ s === "toggle" && /* @__PURE__ */ i(De, { className: "rudi-table__cell rudi-table__cell--selection", children: /* @__PURE__ */ i(We, {}) }),
2832
+ /* @__PURE__ */ i(se, { items: r, dependencies: n, children: t })
2833
+ ] });
2834
+ }
2835
+ const Tt = /* @__PURE__ */ new Set(["checkbox", "radio", "button", "submit", "reset", "range", "color", "file", "image"]);
2836
+ function wt(e) {
2837
+ return e instanceof HTMLTextAreaElement ? !0 : e instanceof HTMLInputElement ? !Tt.has(e.type) : e instanceof HTMLElement && e.isContentEditable;
2838
+ }
2839
+ function $t({
2840
+ columnIndex: e,
2841
+ align: r,
2842
+ children: t
2843
+ }) {
2844
+ const n = K(ei), a = e != null ? n?.collection.columns[e] : void 0, o = r ?? a?.props?.["data-align"], s = (d, l) => {
2845
+ wt(d.target) && n?.setKeyboardNavigationDisabled(l);
2846
+ };
2847
+ return /* @__PURE__ */ i(
2848
+ "div",
2849
+ {
2850
+ className: "rudi-table__cell-content",
2851
+ "data-align": o ?? "start",
2852
+ onFocus: (d) => s(d, !0),
2853
+ onBlur: (d) => s(d, !1),
2854
+ children: t
2855
+ }
2856
+ );
2857
+ }
2858
+ function aa({ align: e, children: r, className: t, textValue: n, ...a }) {
2859
+ return /* @__PURE__ */ i(
2860
+ De,
2861
+ {
2862
+ ...a,
2863
+ textValue: n ?? (typeof r == "string" ? r : void 0),
2864
+ className: u("rudi-table__cell", t),
2865
+ children: ({ columnIndex: o }) => /* @__PURE__ */ i($t, { columnIndex: o, align: e, children: r })
2866
+ }
2867
+ );
2868
+ }
2869
+ const Re = (e) => String(e).padStart(2, "0");
2870
+ function L(e, r = "day") {
2871
+ if (!e) return null;
2872
+ try {
2873
+ if (e.includes("T")) {
2874
+ const n = Di(e);
2875
+ return r === "day" ? me(n) : n;
2876
+ }
2877
+ const t = Ei(e);
2878
+ return r === "minute" ? Li(t) : t;
2879
+ } catch {
2880
+ return null;
2881
+ }
2882
+ }
2883
+ function ie(e, r = "day") {
2884
+ const t = me(e).toString();
2885
+ if (r === "day") return t;
2886
+ const n = "hour" in e ? e : { hour: 0, minute: 0 };
2887
+ return `${t}T${Re(n.hour)}:${Re(n.minute)}`;
2888
+ }
2889
+ function Xe(e) {
2890
+ if (e)
2891
+ return (r) => e(me(r).toString());
2892
+ }
2893
+ function Ze() {
2894
+ return /* @__PURE__ */ p("header", { className: "rudi-date-picker__calendar-header", children: [
2895
+ /* @__PURE__ */ i(F, { slot: "previous", className: "rudi-date-picker__nav", children: /* @__PURE__ */ i(R, { icon: "lucide:chevron-left", size: "sm" }) }),
2896
+ /* @__PURE__ */ i(ri, { className: "rudi-date-picker__heading" }),
2897
+ /* @__PURE__ */ i(F, { slot: "next", className: "rudi-date-picker__nav", children: /* @__PURE__ */ i(R, { icon: "lucide:chevron-right", size: "sm" }) })
2898
+ ] });
2899
+ }
2900
+ function Qe() {
2901
+ return /* @__PURE__ */ p(ii, { className: "rudi-date-picker__grid", children: [
2902
+ /* @__PURE__ */ i(ti, { children: (e) => /* @__PURE__ */ i(ni, { className: "rudi-date-picker__weekday", children: e }) }),
2903
+ /* @__PURE__ */ i(ai, { children: (e) => /* @__PURE__ */ i(oi, { date: e, className: "rudi-date-picker__cell" }) })
2904
+ ] });
2905
+ }
2906
+ function Ye() {
2907
+ return /* @__PURE__ */ i(F, { className: "rudi-date-picker__trigger", children: /* @__PURE__ */ i(R, { icon: "lucide:calendar", size: "sm" }) });
2908
+ }
2909
+ function Je({ label: e, isRequired: r }) {
2910
+ return /* @__PURE__ */ p(Z, { className: "rudi-date-picker__label", children: [
2911
+ e,
2912
+ r && /* @__PURE__ */ p("span", { className: "rudi-date-picker__required", "aria-hidden": "true", children: [
2913
+ " ",
2914
+ "*"
2915
+ ] })
2916
+ ] });
2917
+ }
2918
+ function er({
2919
+ description: e,
2920
+ errorMessage: r,
2921
+ isInvalid: t
2922
+ }) {
2923
+ return /* @__PURE__ */ p(w, { children: [
2924
+ e && !t && /* @__PURE__ */ i(z, { slot: "description", className: "rudi-date-picker__description", children: e }),
2925
+ /* @__PURE__ */ i(Ee, { className: "rudi-date-picker__error", children: r || void 0 })
2926
+ ] });
2927
+ }
2928
+ const oa = D.forwardRef(
2929
+ function({
2930
+ label: r,
2931
+ value: t,
2932
+ defaultValue: n,
2933
+ onChange: a,
2934
+ granularity: o = "day",
2935
+ minValue: s,
2936
+ maxValue: d,
2937
+ isDateUnavailable: l,
2938
+ description: c,
2939
+ errorMessage: m,
2940
+ isRequired: f = !1,
2941
+ isDisabled: g = !1,
2942
+ isReadOnly: _ = !1,
2943
+ name: h,
2944
+ hourCycle: b,
2945
+ className: N
2946
+ }, y) {
2947
+ const k = I(
2948
+ () => t === void 0 ? void 0 : L(t, o),
2949
+ [t, o]
2950
+ ), C = I(
2951
+ () => L(n, o) ?? void 0,
2952
+ // Only read on mount, like any uncontrolled default.
2953
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2954
+ []
2955
+ ), T = I(
2956
+ () => L(s, o) ?? void 0,
2957
+ [s, o]
2958
+ ), M = I(
2959
+ () => L(d, o) ?? void 0,
2960
+ [d, o]
2961
+ ), E = I(
2962
+ () => Xe(l),
2963
+ [l]
2964
+ ), $ = (x) => {
2965
+ a?.(x ? ie(x, o) : null);
2966
+ };
2967
+ return /* @__PURE__ */ i(
2968
+ si,
2969
+ {
2970
+ ref: y,
2971
+ className: u("rudi-date-picker", N),
2972
+ value: k,
2973
+ defaultValue: C,
2974
+ onChange: $,
2975
+ granularity: o,
2976
+ minValue: T,
2977
+ maxValue: M,
2978
+ isDateUnavailable: E,
2979
+ isRequired: f,
2980
+ isDisabled: g,
2981
+ isReadOnly: _,
2982
+ isInvalid: m ? !0 : void 0,
2983
+ validationBehavior: "aria",
2984
+ name: h,
2985
+ hourCycle: b,
2986
+ shouldForceLeadingZeros: !0,
2987
+ children: ({ isInvalid: x }) => /* @__PURE__ */ p(w, { children: [
2988
+ /* @__PURE__ */ i(Je, { label: r, isRequired: f }),
2989
+ /* @__PURE__ */ p(de, { className: "rudi-date-picker__field", children: [
2990
+ /* @__PURE__ */ i(Q, { className: "rudi-date-picker__input", children: (S) => /* @__PURE__ */ i(
2991
+ Y,
2992
+ {
2993
+ segment: S,
2994
+ className: "rudi-date-picker__segment"
2995
+ }
2996
+ ) }),
2997
+ /* @__PURE__ */ i(Ye, {})
2998
+ ] }),
2999
+ /* @__PURE__ */ i(
3000
+ er,
3001
+ {
3002
+ description: c,
3003
+ errorMessage: m,
3004
+ isInvalid: x
3005
+ }
3006
+ ),
3007
+ /* @__PURE__ */ i(oe, { className: "rudi-date-picker__popover", placement: "bottom start", children: /* @__PURE__ */ i(Le, { className: "rudi-date-picker__dialog", children: /* @__PURE__ */ p(di, { className: "rudi-date-picker__calendar", children: [
3008
+ /* @__PURE__ */ i(Ze, {}),
3009
+ /* @__PURE__ */ i(Qe, {})
3010
+ ] }) }) })
3011
+ ] })
3012
+ }
3013
+ );
3014
+ }
3015
+ );
3016
+ function ye(e) {
3017
+ if (!e) return null;
3018
+ const r = L(e.start, "day"), t = L(e.end, "day");
3019
+ return r && t ? { start: r, end: t } : null;
3020
+ }
3021
+ const sa = D.forwardRef(function({
3022
+ label: r,
3023
+ value: t,
3024
+ defaultValue: n,
3025
+ onChange: a,
3026
+ minValue: o,
3027
+ maxValue: s,
3028
+ isDateUnavailable: d,
3029
+ description: l,
3030
+ errorMessage: c,
3031
+ isRequired: m = !1,
3032
+ isDisabled: f = !1,
3033
+ isReadOnly: g = !1,
3034
+ startName: _,
3035
+ endName: h,
3036
+ className: b
3037
+ }, N) {
3038
+ const y = t === void 0 ? void 0 : t ? `${t.start}/${t.end}` : null, k = I(
3039
+ () => t === void 0 ? void 0 : ye(t),
3040
+ // valueKey captures the range contents, so new-but-equal objects don't re-parse.
3041
+ // eslint-disable-next-line react-hooks/exhaustive-deps
3042
+ [y]
3043
+ ), C = I(
3044
+ () => ye(n) ?? void 0,
3045
+ // eslint-disable-next-line react-hooks/exhaustive-deps
3046
+ []
3047
+ ), T = I(() => L(o) ?? void 0, [o]), M = I(() => L(s) ?? void 0, [s]), E = I(
3048
+ () => Xe(d),
3049
+ [d]
3050
+ ), $ = (x) => {
3051
+ a?.(
3052
+ x ? { start: ie(x.start), end: ie(x.end) } : null
3053
+ );
3054
+ };
3055
+ return /* @__PURE__ */ i(
3056
+ li,
3057
+ {
3058
+ ref: N,
3059
+ className: u("rudi-date-picker", b),
3060
+ value: k,
3061
+ defaultValue: C,
3062
+ onChange: $,
3063
+ granularity: "day",
3064
+ minValue: T,
3065
+ maxValue: M,
3066
+ isDateUnavailable: E,
3067
+ isRequired: m,
3068
+ isDisabled: f,
3069
+ isReadOnly: g,
3070
+ isInvalid: c ? !0 : void 0,
3071
+ validationBehavior: "aria",
3072
+ startName: _,
3073
+ endName: h,
3074
+ shouldForceLeadingZeros: !0,
3075
+ children: ({ isInvalid: x }) => /* @__PURE__ */ p(w, { children: [
3076
+ /* @__PURE__ */ i(Je, { label: r, isRequired: m }),
3077
+ /* @__PURE__ */ p(de, { className: "rudi-date-picker__field", children: [
3078
+ /* @__PURE__ */ i(Q, { slot: "start", className: "rudi-date-picker__input", children: (S) => /* @__PURE__ */ i(Y, { segment: S, className: "rudi-date-picker__segment" }) }),
3079
+ /* @__PURE__ */ i("span", { className: "rudi-date-picker__range-separator", "aria-hidden": "true", children: "–" }),
3080
+ /* @__PURE__ */ i(Q, { slot: "end", className: "rudi-date-picker__input", children: (S) => /* @__PURE__ */ i(Y, { segment: S, className: "rudi-date-picker__segment" }) }),
3081
+ /* @__PURE__ */ i(Ye, {})
3082
+ ] }),
3083
+ /* @__PURE__ */ i(
3084
+ er,
3085
+ {
3086
+ description: l,
3087
+ errorMessage: c,
3088
+ isInvalid: x
3089
+ }
3090
+ ),
3091
+ /* @__PURE__ */ i(oe, { className: "rudi-date-picker__popover", placement: "bottom start", children: /* @__PURE__ */ i(Le, { className: "rudi-date-picker__dialog", children: /* @__PURE__ */ p(ci, { className: "rudi-date-picker__calendar rudi-date-picker__calendar--range", children: [
3092
+ /* @__PURE__ */ i(Ze, {}),
3093
+ /* @__PURE__ */ i(Qe, {})
3094
+ ] }) }) })
3095
+ ] })
3096
+ }
3097
+ );
3098
+ }), ke = (e) => e === void 0 ? void 0 : e === null ? NaN : e, da = D.forwardRef(
3099
+ function({
3100
+ label: r,
3101
+ labelHidden: t = !1,
3102
+ value: n,
3103
+ defaultValue: a,
3104
+ onChange: o,
3105
+ minValue: s,
3106
+ maxValue: d,
3107
+ step: l,
3108
+ formatOptions: c,
3109
+ placeholder: m,
3110
+ description: f,
3111
+ errorMessage: g,
3112
+ isRequired: _ = !1,
3113
+ isDisabled: h = !1,
3114
+ isReadOnly: b = !1,
3115
+ name: N,
3116
+ hideStepper: y = !1,
3117
+ className: k
3118
+ }, C) {
3119
+ return /* @__PURE__ */ i(
3120
+ ui,
3121
+ {
3122
+ className: u("rudi-number-field", k),
3123
+ value: ke(n),
3124
+ defaultValue: ke(a),
3125
+ onChange: (T) => o?.(Number.isNaN(T) ? null : T),
3126
+ minValue: s,
3127
+ maxValue: d,
3128
+ step: l,
3129
+ formatOptions: c,
3130
+ isRequired: _,
3131
+ isDisabled: h,
3132
+ isReadOnly: b,
3133
+ isInvalid: g ? !0 : void 0,
3134
+ validationBehavior: "aria",
3135
+ name: N,
3136
+ children: ({ isInvalid: T }) => /* @__PURE__ */ p(w, { children: [
3137
+ t ? /* @__PURE__ */ i(te, { children: /* @__PURE__ */ i(Z, { children: r }) }) : /* @__PURE__ */ p(Z, { className: "rudi-number-field__label", children: [
3138
+ r,
3139
+ _ && /* @__PURE__ */ p("span", { className: "rudi-number-field__required", "aria-hidden": "true", children: [
3140
+ " ",
3141
+ "*"
3142
+ ] })
3143
+ ] }),
3144
+ /* @__PURE__ */ p(de, { className: "rudi-number-field__field", children: [
3145
+ /* @__PURE__ */ i(
3146
+ mi,
3147
+ {
3148
+ ref: C,
3149
+ placeholder: m,
3150
+ className: "rudi-number-field__input"
3151
+ }
3152
+ ),
3153
+ !y && /* @__PURE__ */ p(w, { children: [
3154
+ /* @__PURE__ */ i(F, { slot: "decrement", className: "rudi-number-field__stepper", children: /* @__PURE__ */ i(R, { icon: "lucide:minus", size: "sm" }) }),
3155
+ /* @__PURE__ */ i(F, { slot: "increment", className: "rudi-number-field__stepper", children: /* @__PURE__ */ i(R, { icon: "lucide:plus", size: "sm" }) })
3156
+ ] })
3157
+ ] }),
3158
+ f && !T && /* @__PURE__ */ i(z, { slot: "description", className: "rudi-number-field__description", children: f }),
3159
+ /* @__PURE__ */ i(Ee, { className: "rudi-number-field__error", children: g || void 0 })
3160
+ ] })
1602
3161
  }
1603
3162
  );
1604
3163
  }
1605
3164
  );
1606
3165
  export {
1607
- Jr as RudiAlert,
1608
- rt as RudiAvatar,
1609
- hr as RudiBadge,
1610
- nt as RudiBarChart,
1611
- ft as RudiBox,
1612
- Or as RudiButton,
1613
- Y as RudiCard,
1614
- _t as RudiCenter,
1615
- Lr as RudiCheckbox,
1616
- Gr as RudiCheckboxGroup,
1617
- ot as RudiCircularProgress,
1618
- pt as RudiCluster,
1619
- vt as RudiCover,
1620
- Xr as RudiDialog,
1621
- st as RudiDonutChart,
1622
- gt as RudiGrid,
1623
- lt as RudiHeading,
1624
- k as RudiIcon,
1625
- Qr as RudiIconButton,
1626
- Kr as RudiInput,
1627
- ct as RudiKanbanBoard,
1628
- dt as RudiKanbanCard,
1629
- re as RudiKanbanColumn,
1630
- Ur as RudiKeyboard,
1631
- at as RudiLineChart,
1632
- jr as RudiMenu,
1633
- zr as RudiMenuItem,
1634
- Hr as RudiMenuSection,
1635
- Fr as RudiMenuTrigger,
1636
- it as RudiNavItem,
1637
- et as RudiProgressBar,
1638
- mt as RudiProse,
1639
- Yr as RudiRadioGroup,
1640
- Ar as RudiSelect,
1641
- yt as RudiSeparator,
1642
- bt as RudiSidebar,
1643
- ht as RudiStack,
1644
- tt as RudiStatCard,
1645
- xt as RudiSubmenuTrigger,
1646
- Wr as RudiSwitch,
1647
- Nt as RudiSwitcher,
1648
- Vr as RudiTag,
1649
- ut as RudiText,
1650
- qr as RudiTooltip,
1651
- Zr as RudiTooltipTrigger,
1652
- m as cn,
1653
- j as useChartTheme,
1654
- Q as useLoadingButton
3166
+ Wi as RudiAlert,
3167
+ An as RudiAppShell,
3168
+ Rn as RudiAvatar,
3169
+ Xi as RudiBadge,
3170
+ Cn as RudiBarChart,
3171
+ Bn as RudiBox,
3172
+ Hn as RudiBrand,
3173
+ Nn as RudiBreadcrumb,
3174
+ jt as RudiButton,
3175
+ ve as RudiCard,
3176
+ Ln as RudiCenter,
3177
+ Wt as RudiCheckbox,
3178
+ Xt as RudiCheckboxGroup,
3179
+ xn as RudiCircularProgress,
3180
+ Mn as RudiCluster,
3181
+ Qn as RudiComboBox,
3182
+ On as RudiCover,
3183
+ oa as RudiDatePicker,
3184
+ sa as RudiDateRangePicker,
3185
+ nn as RudiDialog,
3186
+ mn as RudiDivider,
3187
+ Pn as RudiDonutChart,
3188
+ pn as RudiDot,
3189
+ Zn as RudiEmptyState,
3190
+ Un as RudiForm,
3191
+ Dn as RudiGrid,
3192
+ fe as RudiHeading,
3193
+ R as RudiIcon,
3194
+ he as RudiIconButton,
3195
+ fn as RudiImage,
3196
+ qt as RudiInput,
3197
+ Tn as RudiKanbanBoard,
3198
+ wn as RudiKanbanCard,
3199
+ He as RudiKanbanColumn,
3200
+ Ui as RudiKeyboard,
3201
+ Sn as RudiLineChart,
3202
+ hn as RudiLink,
3203
+ Yt as RudiMenu,
3204
+ Jt as RudiMenuItem,
3205
+ en as RudiMenuSection,
3206
+ rn as RudiMenuSeparator,
3207
+ Qt as RudiMenuTrigger,
3208
+ kn as RudiNavItem,
3209
+ da as RudiNumberField,
3210
+ ua as RudiOption,
3211
+ Gn as RudiPageHeader,
3212
+ vn as RudiPagination,
3213
+ un as RudiProgressBar,
3214
+ $n as RudiProse,
3215
+ sn as RudiRadio,
3216
+ on as RudiRadioGroup,
3217
+ _n as RudiRating,
3218
+ Vn as RudiRouterProvider,
3219
+ Kn as RudiSectionHeader,
3220
+ Zt as RudiSelect,
3221
+ pa as RudiSeparator,
3222
+ En as RudiSidebar,
3223
+ In as RudiStack,
3224
+ yn as RudiStatCard,
3225
+ bn as RudiStepper,
3226
+ tn as RudiSubmenuTrigger,
3227
+ an as RudiSwitch,
3228
+ zn as RudiSwitcher,
3229
+ Wn as RudiTab,
3230
+ qn as RudiTabList,
3231
+ Xn as RudiTabPanel,
3232
+ ea as RudiTable,
3233
+ ta as RudiTableBody,
3234
+ aa as RudiTableCell,
3235
+ ia as RudiTableColumn,
3236
+ ra as RudiTableHeader,
3237
+ na as RudiTableRow,
3238
+ jn as RudiTabs,
3239
+ cn as RudiTag,
3240
+ _e as RudiText,
3241
+ gn as RudiTextarea,
3242
+ Jn as RudiToastRegion,
3243
+ ln as RudiTooltip,
3244
+ dn as RudiTooltipTrigger,
3245
+ Fn as RudiTopBar,
3246
+ u as cn,
3247
+ Yn as rudiToast,
3248
+ pe as useChartTheme,
3249
+ ze as useLoadingButton
1655
3250
  };