@aortl/admin-react 0.0.1 → 0.2.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 (71) hide show
  1. package/README.md +0 -31
  2. package/dist/Accordion.d.ts +16 -0
  3. package/dist/Accordion.d.ts.map +1 -0
  4. package/dist/AdminRoot.d.ts +5 -0
  5. package/dist/AdminRoot.d.ts.map +1 -0
  6. package/dist/Alert.d.ts +23 -0
  7. package/dist/Alert.d.ts.map +1 -0
  8. package/dist/AppShell.d.ts +28 -0
  9. package/dist/AppShell.d.ts.map +1 -0
  10. package/dist/Badge.d.ts +12 -0
  11. package/dist/Badge.d.ts.map +1 -0
  12. package/dist/BrandTile.d.ts +10 -0
  13. package/dist/BrandTile.d.ts.map +1 -0
  14. package/dist/Breadcrumbs.d.ts +29 -0
  15. package/dist/Breadcrumbs.d.ts.map +1 -0
  16. package/dist/Button.d.ts +10 -2
  17. package/dist/Button.d.ts.map +1 -1
  18. package/dist/ButtonGroup.d.ts +7 -0
  19. package/dist/ButtonGroup.d.ts.map +1 -0
  20. package/dist/Card.d.ts +32 -5
  21. package/dist/Card.d.ts.map +1 -1
  22. package/dist/Checkbox.d.ts +11 -0
  23. package/dist/Checkbox.d.ts.map +1 -0
  24. package/dist/Dialog.d.ts +73 -0
  25. package/dist/Dialog.d.ts.map +1 -0
  26. package/dist/Field.d.ts +5 -2
  27. package/dist/Field.d.ts.map +1 -1
  28. package/dist/FileInput.d.ts +12 -0
  29. package/dist/FileInput.d.ts.map +1 -0
  30. package/dist/Footer.d.ts +16 -0
  31. package/dist/Footer.d.ts.map +1 -0
  32. package/dist/Input.d.ts.map +1 -1
  33. package/dist/InputGroup.d.ts +10 -0
  34. package/dist/InputGroup.d.ts.map +1 -0
  35. package/dist/Menu.d.ts +35 -0
  36. package/dist/Menu.d.ts.map +1 -0
  37. package/dist/Navbar.d.ts +36 -0
  38. package/dist/Navbar.d.ts.map +1 -0
  39. package/dist/Pagination.d.ts +51 -0
  40. package/dist/Pagination.d.ts.map +1 -0
  41. package/dist/Progress.d.ts +12 -0
  42. package/dist/Progress.d.ts.map +1 -0
  43. package/dist/Radio.d.ts +17 -0
  44. package/dist/Radio.d.ts.map +1 -0
  45. package/dist/Select.d.ts +43 -0
  46. package/dist/Select.d.ts.map +1 -0
  47. package/dist/Sidebar.d.ts +79 -0
  48. package/dist/Sidebar.d.ts.map +1 -0
  49. package/dist/Spinner.d.ts +9 -0
  50. package/dist/Spinner.d.ts.map +1 -0
  51. package/dist/Switch.d.ts +11 -0
  52. package/dist/Switch.d.ts.map +1 -0
  53. package/dist/Table.d.ts +55 -0
  54. package/dist/Table.d.ts.map +1 -0
  55. package/dist/Tabs.d.ts +26 -0
  56. package/dist/Tabs.d.ts.map +1 -0
  57. package/dist/Textarea.d.ts +9 -0
  58. package/dist/Textarea.d.ts.map +1 -0
  59. package/dist/admin.css +2918 -248
  60. package/dist/admin.scoped.css +3383 -0
  61. package/dist/cn.d.ts +10 -0
  62. package/dist/cn.d.ts.map +1 -0
  63. package/dist/icon.d.ts +26 -0
  64. package/dist/icon.d.ts.map +1 -0
  65. package/dist/index.cjs +1244 -14
  66. package/dist/index.cjs.map +1 -1
  67. package/dist/index.d.ts +26 -1
  68. package/dist/index.d.ts.map +1 -1
  69. package/dist/index.mjs +1218 -16
  70. package/dist/index.mjs.map +1 -1
  71. package/package.json +26 -7
package/dist/index.cjs CHANGED
@@ -1,45 +1,695 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- let _base_ui_react_button = require("@base-ui/react/button");
3
2
  let clsx = require("clsx");
4
3
  let react_jsx_runtime = require("react/jsx-runtime");
4
+ let react = require("react");
5
+ let _base_ui_react_button = require("@base-ui/react/button");
5
6
  let _base_ui_react_input = require("@base-ui/react/input");
7
+ let _base_ui_react_checkbox = require("@base-ui/react/checkbox");
8
+ let _base_ui_react_radio = require("@base-ui/react/radio");
9
+ let _base_ui_react_radio_group = require("@base-ui/react/radio-group");
10
+ let _base_ui_react_switch = require("@base-ui/react/switch");
11
+ let _base_ui_react_select = require("@base-ui/react/select");
6
12
  let _base_ui_react_field = require("@base-ui/react/field");
13
+ let _base_ui_react_tabs = require("@base-ui/react/tabs");
14
+ let _base_ui_react_dialog = require("@base-ui/react/dialog");
15
+ //#region src/Accordion.tsx
16
+ function AccordionRoot({ className, ...rest }) {
17
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
18
+ className: (0, clsx.clsx)("accordion", className),
19
+ ...rest
20
+ });
21
+ }
22
+ function AccordionItem({ className, ...rest }) {
23
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("details", {
24
+ className: (0, clsx.clsx)("accordion-item", className),
25
+ ...rest
26
+ });
27
+ }
28
+ function AccordionSummary({ className, ...rest }) {
29
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", {
30
+ className: (0, clsx.clsx)("accordion-summary", className),
31
+ ...rest
32
+ });
33
+ }
34
+ function AccordionContent({ className, ...rest }) {
35
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
36
+ className: (0, clsx.clsx)("accordion-content", className),
37
+ ...rest
38
+ });
39
+ }
40
+ var Accordion = Object.assign(AccordionRoot, {
41
+ Item: AccordionItem,
42
+ Summary: AccordionSummary,
43
+ Content: AccordionContent
44
+ });
45
+ //#endregion
46
+ //#region src/AdminRoot.tsx
47
+ function AdminRoot({ className, ...rest }) {
48
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
49
+ className: (0, clsx.clsx)("admin-root", className),
50
+ ...rest
51
+ });
52
+ }
53
+ //#endregion
54
+ //#region src/icon.ts
55
+ /**
56
+ * Render an `IconProp` to a React node, defaulting to `size={16} aria-hidden`
57
+ * when given a component reference.
58
+ *
59
+ * Anything that is not `null`/`undefined` and not already a React element is
60
+ * treated as a component type — `createElement` accepts function components,
61
+ * `forwardRef`s (e.g. `@tabler/icons-react`), `memo`, etc.
62
+ */
63
+ function renderIcon(icon, size = 16) {
64
+ if (icon == null) return null;
65
+ if ((0, react.isValidElement)(icon)) return icon;
66
+ return (0, react.createElement)(icon, {
67
+ size,
68
+ "aria-hidden": true
69
+ });
70
+ }
71
+ //#endregion
72
+ //#region src/Alert.tsx
73
+ function AlertRoot({ variant = "info", icon, title, description, className, role, children, ...rest }) {
74
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
75
+ role: role ?? (variant === "danger" || variant === "warning" ? "alert" : "status"),
76
+ className: (0, clsx.clsx)("alert", `alert-${variant}`, className),
77
+ ...rest,
78
+ children: [
79
+ renderIcon(icon),
80
+ title !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AlertTitle, { children: title }) : null,
81
+ description !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AlertDescription, { children: description }) : null,
82
+ children
83
+ ]
84
+ });
85
+ }
86
+ function AlertTitle({ className, ...rest }) {
87
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", {
88
+ className: (0, clsx.clsx)("alert-title", className),
89
+ ...rest
90
+ });
91
+ }
92
+ function AlertDescription({ className, ...rest }) {
93
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
94
+ className: (0, clsx.clsx)("alert-description", className),
95
+ ...rest
96
+ });
97
+ }
98
+ var Alert = Object.assign(AlertRoot, {
99
+ Title: AlertTitle,
100
+ Description: AlertDescription
101
+ });
102
+ //#endregion
103
+ //#region src/AppShell.tsx
104
+ var AppShellContext = (0, react.createContext)(null);
105
+ function useAppShell() {
106
+ return (0, react.useContext)(AppShellContext);
107
+ }
108
+ function AppShellRoot({ hasSidebar = false, hasFooter = false, mobileDrawerOpen, defaultMobileDrawerOpen = false, onMobileDrawerOpenChange, systemAccent, className, style, children, ...rest }) {
109
+ const [uncontrolledOpen, setUncontrolledOpen] = (0, react.useState)(defaultMobileDrawerOpen);
110
+ const isControlled = mobileDrawerOpen !== void 0;
111
+ const open = isControlled ? mobileDrawerOpen : uncontrolledOpen;
112
+ const value = (0, react.useMemo)(() => ({
113
+ mobileDrawerOpen: open,
114
+ setMobileDrawerOpen: (next) => {
115
+ if (!isControlled) setUncontrolledOpen(next);
116
+ onMobileDrawerOpenChange?.(next);
117
+ },
118
+ hasSidebar
119
+ }), [
120
+ open,
121
+ isControlled,
122
+ onMobileDrawerOpenChange,
123
+ hasSidebar
124
+ ]);
125
+ const rootStyle = systemAccent !== void 0 ? {
126
+ ...style,
127
+ "--color-system-accent": systemAccent
128
+ } : style;
129
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AppShellContext.Provider, {
130
+ value,
131
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
132
+ className: (0, clsx.clsx)("app-shell", hasSidebar && "app-shell-with-sidebar", hasFooter && "app-shell-with-footer", className),
133
+ style: rootStyle,
134
+ ...rest,
135
+ children
136
+ })
137
+ });
138
+ }
139
+ function AppShellMain({ className, ...rest }) {
140
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("main", {
141
+ className: (0, clsx.clsx)("app-shell-main", className),
142
+ ...rest
143
+ });
144
+ }
145
+ var AppShell = Object.assign(AppShellRoot, { Main: AppShellMain });
146
+ //#endregion
147
+ //#region src/Badge.tsx
148
+ function Badge({ variant = "neutral", size = "md", icon, className, children, ...rest }) {
149
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
150
+ className: (0, clsx.clsx)("badge", `badge-${variant}`, size !== "md" && `badge-${size}`, className),
151
+ ...rest,
152
+ children: [renderIcon(icon, size === "sm" ? 10 : 12), children]
153
+ });
154
+ }
155
+ //#endregion
156
+ //#region src/BrandTile.tsx
157
+ function BrandTile({ monogram, icon, className, children, ...rest }) {
158
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
159
+ className: (0, clsx.clsx)("brand-tile", className),
160
+ "aria-hidden": true,
161
+ ...rest,
162
+ children: icon ? renderIcon(icon, 14) : children ?? monogram
163
+ });
164
+ }
165
+ //#endregion
166
+ //#region src/cn.ts
167
+ /**
168
+ * className merger that preserves Base UI's render-prop className form.
169
+ *
170
+ * Base UI components accept `className: string | ((state) => string | undefined)`. The plain
171
+ * `clsx()` path is correct for strings, but a function form has to be deferred
172
+ * until Base UI invokes it with the component state.
173
+ */
174
+ function cn(base, className) {
175
+ if (typeof className === "function") return (state) => (0, clsx.clsx)(base, className(state));
176
+ return (0, clsx.clsx)(base, className);
177
+ }
178
+ //#endregion
7
179
  //#region src/Button.tsx
8
- function Button({ variant = "primary", size = "md", block, className, type = "button", ...rest }) {
9
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_button.Button, {
180
+ function Button({ variant = "primary", size = "md", fullWidth, loading, icon, iconTrailing, className, type = "button", disabled, children, ...rest }) {
181
+ const iconOnly = children == null && (icon != null || iconTrailing != null);
182
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_base_ui_react_button.Button, {
10
183
  type,
11
- className: (0, clsx.clsx)("btn", `btn-${variant}`, size !== "md" && `btn-${size}`, block && "btn-block", typeof className === "string" ? className : void 0),
184
+ disabled: disabled || loading,
185
+ "aria-busy": loading || void 0,
186
+ className: cn([
187
+ "btn",
188
+ `btn-${variant}`,
189
+ size !== "md" && `btn-${size}`,
190
+ fullWidth && "btn-full-width",
191
+ loading && "btn-loading",
192
+ iconOnly && "btn-square"
193
+ ], className),
194
+ ...rest,
195
+ children: [
196
+ loading ? null : renderIcon(icon),
197
+ children,
198
+ renderIcon(iconTrailing)
199
+ ]
200
+ });
201
+ }
202
+ //#endregion
203
+ //#region src/ButtonGroup.tsx
204
+ function ButtonGroup({ orientation = "horizontal", role = "group", className, ...rest }) {
205
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
206
+ role,
207
+ className: (0, clsx.clsx)("btn-group", orientation === "vertical" && "btn-group-vertical", className),
12
208
  ...rest
13
209
  });
14
210
  }
15
211
  //#endregion
212
+ //#region src/Breadcrumbs.tsx
213
+ function BreadcrumbsRoot({ separator, className, children, "aria-label": ariaLabel = "Breadcrumb", ...rest }) {
214
+ const items = react.Children.toArray(children).filter(react.isValidElement);
215
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("nav", {
216
+ "aria-label": ariaLabel,
217
+ className: (0, clsx.clsx)("breadcrumbs", className),
218
+ ...rest,
219
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ol", { children: items.map((child, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react.Fragment, { children: [child, i < items.length - 1 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BreadcrumbSeparator, { children: separator }) : null] }, child.key ?? i)) })
220
+ });
221
+ }
222
+ function BreadcrumbItem(props) {
223
+ if (props.href !== void 0) {
224
+ const { className, current, icon, children, ...rest } = props;
225
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("a", {
226
+ className: (0, clsx.clsx)("breadcrumb-item", className),
227
+ "aria-current": current ? "page" : void 0,
228
+ ...rest,
229
+ children: [renderIcon(icon, 14), children]
230
+ }) });
231
+ }
232
+ const { className, current, icon, children, ...rest } = props;
233
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
234
+ className: (0, clsx.clsx)("breadcrumb-item", className),
235
+ "aria-current": current ? "page" : void 0,
236
+ ...rest,
237
+ children: [renderIcon(icon, 14), children]
238
+ }) });
239
+ }
240
+ function BreadcrumbSeparator({ className, children, ...rest }) {
241
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
242
+ "aria-hidden": "true",
243
+ className: (0, clsx.clsx)("breadcrumb-separator", className),
244
+ ...rest,
245
+ children
246
+ });
247
+ }
248
+ var Breadcrumbs = Object.assign(BreadcrumbsRoot, {
249
+ Item: BreadcrumbItem,
250
+ Separator: BreadcrumbSeparator
251
+ });
252
+ //#endregion
16
253
  //#region src/Input.tsx
17
254
  function Input({ variant = "bordered", inputSize = "md", className, type = "text", ...rest }) {
18
255
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_input.Input, {
19
256
  type,
20
- className: (0, clsx.clsx)("input", `input-${variant}`, inputSize !== "md" && `input-${inputSize}`, typeof className === "string" ? className : void 0),
257
+ className: cn([
258
+ "input",
259
+ `input-${variant}`,
260
+ inputSize !== "md" && `input-${inputSize}`
261
+ ], className),
262
+ ...rest
263
+ });
264
+ }
265
+ //#endregion
266
+ //#region src/FileInput.tsx
267
+ function FileInput({ variant = "bordered", inputSize = "md", className, ...rest }) {
268
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_input.Input, {
269
+ type: "file",
270
+ className: cn([
271
+ "file-input",
272
+ `file-input-${variant}`,
273
+ inputSize !== "md" && `file-input-${inputSize}`
274
+ ], className),
275
+ ...rest
276
+ });
277
+ }
278
+ //#endregion
279
+ //#region src/InputGroup.tsx
280
+ function InputGroupRoot({ className, ...rest }) {
281
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
282
+ className: (0, clsx.clsx)("input-group", className),
283
+ ...rest
284
+ });
285
+ }
286
+ function InputGroupAddon({ className, ...rest }) {
287
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
288
+ className: (0, clsx.clsx)("input-group-addon", className),
21
289
  ...rest
22
290
  });
23
291
  }
292
+ var InputGroup = Object.assign(InputGroupRoot, { Addon: InputGroupAddon });
293
+ //#endregion
294
+ //#region src/Pagination.tsx
295
+ /**
296
+ * Compute the items to render for a given `page` / `total`. Always returns:
297
+ * previous, ...numbers/ellipses, next
298
+ * with `boundaryCount` items on each end and `siblingCount` items around `page`.
299
+ * Pure: no React state, safe to call during render.
300
+ */
301
+ function getPaginationItems({ page, total, siblingCount = 1, boundaryCount = 1 }) {
302
+ if (total <= 0) return [{
303
+ type: "previous",
304
+ page: 1,
305
+ disabled: true
306
+ }, {
307
+ type: "next",
308
+ page: 1,
309
+ disabled: true
310
+ }];
311
+ const clampedPage = Math.min(Math.max(1, page), total);
312
+ const items = [];
313
+ items.push({
314
+ type: "previous",
315
+ page: clampedPage - 1,
316
+ disabled: clampedPage === 1
317
+ });
318
+ const startPages = range(1, Math.min(boundaryCount, total));
319
+ const endPages = range(Math.max(total - boundaryCount + 1, boundaryCount + 1), total);
320
+ const siblingsStart = Math.max(Math.min(clampedPage - siblingCount, total - boundaryCount - siblingCount * 2 - 1), boundaryCount + 2);
321
+ const siblingsEnd = Math.min(Math.max(clampedPage + siblingCount, boundaryCount + siblingCount * 2 + 2), endPages.length > 0 ? endPages[0] - 2 : total - 1);
322
+ const middle = [];
323
+ if (siblingsStart > boundaryCount + 2) middle.push("ellipsis-start");
324
+ else if (boundaryCount + 1 < total - boundaryCount) middle.push(boundaryCount + 1);
325
+ middle.push(...range(siblingsStart, siblingsEnd));
326
+ if (siblingsEnd < total - boundaryCount - 1) middle.push("ellipsis-end");
327
+ else if (total - boundaryCount > boundaryCount) middle.push(total - boundaryCount);
328
+ const seen = /* @__PURE__ */ new Set();
329
+ const pushNumber = (n) => {
330
+ if (n < 1 || n > total || seen.has(n)) return;
331
+ seen.add(n);
332
+ items.push({
333
+ type: "page",
334
+ page: n,
335
+ selected: n === clampedPage
336
+ });
337
+ };
338
+ for (const n of startPages) pushNumber(n);
339
+ for (const entry of middle) if (entry === "ellipsis-start") items.push({
340
+ type: "ellipsis",
341
+ key: "start"
342
+ });
343
+ else if (entry === "ellipsis-end") items.push({
344
+ type: "ellipsis",
345
+ key: "end"
346
+ });
347
+ else pushNumber(entry);
348
+ for (const n of endPages) pushNumber(n);
349
+ items.push({
350
+ type: "next",
351
+ page: clampedPage + 1,
352
+ disabled: clampedPage === total
353
+ });
354
+ return items;
355
+ }
356
+ function range(start, end) {
357
+ if (end < start) return [];
358
+ const out = [];
359
+ for (let i = start; i <= end; i++) out.push(i);
360
+ return out;
361
+ }
362
+ function Pagination({ page, total, onPageChange, siblingCount = 1, boundaryCount = 1, previousIcon, nextIcon, renderItem, className, "aria-label": ariaLabel = "Pagination", ...rest }) {
363
+ const items = getPaginationItems({
364
+ page,
365
+ total,
366
+ siblingCount,
367
+ boundaryCount
368
+ });
369
+ const prev = previousIcon !== void 0 ? renderIcon(previousIcon, 16) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChevronLeftIcon, {});
370
+ const next = nextIcon !== void 0 ? renderIcon(nextIcon, 16) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChevronRightIcon, {});
371
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("nav", {
372
+ "aria-label": ariaLabel,
373
+ className: (0, clsx.clsx)("pagination", className),
374
+ ...rest,
375
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", { children: items.map((item, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
376
+ className: "page-item",
377
+ children: renderItem ? renderItem(item) : defaultRender(item, onPageChange, prev, next)
378
+ }, paginationItemKey(item, i))) })
379
+ });
380
+ }
381
+ function ChevronLeftIcon() {
382
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
383
+ width: "16",
384
+ height: "16",
385
+ viewBox: "0 0 24 24",
386
+ fill: "none",
387
+ stroke: "currentColor",
388
+ strokeWidth: "2",
389
+ strokeLinecap: "round",
390
+ strokeLinejoin: "round",
391
+ "aria-hidden": "true",
392
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M15 6l-6 6 6 6" })
393
+ });
394
+ }
395
+ function ChevronRightIcon() {
396
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
397
+ width: "16",
398
+ height: "16",
399
+ viewBox: "0 0 24 24",
400
+ fill: "none",
401
+ stroke: "currentColor",
402
+ strokeWidth: "2",
403
+ strokeLinecap: "round",
404
+ strokeLinejoin: "round",
405
+ "aria-hidden": "true",
406
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M9 6l6 6-6 6" })
407
+ });
408
+ }
409
+ function paginationItemKey(item, index) {
410
+ switch (item.type) {
411
+ case "previous": return "previous";
412
+ case "next": return "next";
413
+ case "ellipsis": return `ellipsis-${item.key}`;
414
+ case "page": return `page-${item.page}`;
415
+ default: return `${index}`;
416
+ }
417
+ }
418
+ function defaultRender(item, onPageChange, prev, next) {
419
+ switch (item.type) {
420
+ case "previous": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
421
+ type: "button",
422
+ className: "page-link",
423
+ "aria-label": "Previous page",
424
+ "aria-disabled": item.disabled || void 0,
425
+ disabled: item.disabled,
426
+ onClick: () => onPageChange(item.page),
427
+ children: prev
428
+ });
429
+ case "next": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
430
+ type: "button",
431
+ className: "page-link",
432
+ "aria-label": "Next page",
433
+ "aria-disabled": item.disabled || void 0,
434
+ disabled: item.disabled,
435
+ onClick: () => onPageChange(item.page),
436
+ children: next
437
+ });
438
+ case "ellipsis": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
439
+ className: "page-ellipsis",
440
+ "aria-hidden": "true",
441
+ children: "…"
442
+ });
443
+ case "page": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
444
+ type: "button",
445
+ className: (0, clsx.clsx)("page-link", item.selected && "active"),
446
+ "aria-current": item.selected ? "page" : void 0,
447
+ "aria-label": `Page ${item.page}`,
448
+ onClick: () => onPageChange(item.page),
449
+ children: item.page
450
+ });
451
+ }
452
+ }
453
+ //#endregion
454
+ //#region src/Textarea.tsx
455
+ function Textarea({ variant = "bordered", textareaSize = "md", className, ...rest }) {
456
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
457
+ className: (0, clsx.clsx)("textarea", `textarea-${variant}`, textareaSize !== "md" && `textarea-${textareaSize}`, className),
458
+ ...rest
459
+ });
460
+ }
461
+ //#endregion
462
+ //#region src/Checkbox.tsx
463
+ function CheckboxRoot({ className, children, ...rest }) {
464
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_checkbox.Checkbox.Root, {
465
+ className: cn("checkbox", className),
466
+ ...rest,
467
+ children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CheckboxIndicator, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CheckIcon$1, {}) })
468
+ });
469
+ }
470
+ function CheckboxIndicator({ className, ...rest }) {
471
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_checkbox.Checkbox.Indicator, {
472
+ className: cn("checkbox-indicator", className),
473
+ ...rest
474
+ });
475
+ }
476
+ function CheckIcon$1() {
477
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
478
+ viewBox: "0 0 24 24",
479
+ fill: "none",
480
+ stroke: "currentColor",
481
+ strokeWidth: 2.5,
482
+ strokeLinecap: "round",
483
+ strokeLinejoin: "round",
484
+ width: "100%",
485
+ height: "100%",
486
+ "aria-hidden": true,
487
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("polyline", { points: "20 6 9 17 4 12" })
488
+ });
489
+ }
490
+ var Checkbox = Object.assign(CheckboxRoot, { Indicator: CheckboxIndicator });
491
+ //#endregion
492
+ //#region src/Radio.tsx
493
+ function RadioRoot({ className, children, ...rest }) {
494
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_radio.Radio.Root, {
495
+ className: cn("radio", className),
496
+ ...rest,
497
+ children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RadioIndicator, {})
498
+ });
499
+ }
500
+ function RadioIndicator({ className, ...rest }) {
501
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_radio.Radio.Indicator, {
502
+ className: cn("radio-indicator", className),
503
+ ...rest
504
+ });
505
+ }
506
+ var Radio = Object.assign(RadioRoot, { Indicator: RadioIndicator });
507
+ function RadioGroup({ orientation = "horizontal", className, ...rest }) {
508
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_radio_group.RadioGroup, {
509
+ className: cn(["radio-group", orientation === "vertical" && "radio-group-vertical"], className),
510
+ ...rest
511
+ });
512
+ }
513
+ //#endregion
514
+ //#region src/Progress.tsx
515
+ function Progress({ value, max = 100, variant = "primary", size = "md", className, ...rest }) {
516
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("progress", {
517
+ value,
518
+ max,
519
+ className: (0, clsx.clsx)("progress", variant !== "primary" && `progress-${variant}`, size !== "md" && `progress-${size}`, className),
520
+ ...rest
521
+ });
522
+ }
523
+ //#endregion
524
+ //#region src/Spinner.tsx
525
+ function Spinner({ size = "md", label = "Loading", className, ...rest }) {
526
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("output", {
527
+ "aria-label": label,
528
+ className: (0, clsx.clsx)("spinner", size !== "md" && `spinner-${size}`, className),
529
+ ...rest
530
+ });
531
+ }
532
+ //#endregion
533
+ //#region src/Switch.tsx
534
+ function SwitchRoot({ className, children, ...rest }) {
535
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_switch.Switch.Root, {
536
+ className: cn("switch", className),
537
+ ...rest,
538
+ children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SwitchThumb, {})
539
+ });
540
+ }
541
+ function SwitchThumb({ className, ...rest }) {
542
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_switch.Switch.Thumb, {
543
+ className: cn("switch-thumb", className),
544
+ ...rest
545
+ });
546
+ }
547
+ var Switch = Object.assign(SwitchRoot, { Thumb: SwitchThumb });
548
+ //#endregion
549
+ //#region src/Select.tsx
550
+ function SelectRoot(props) {
551
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_select.Select.Root, { ...props });
552
+ }
553
+ function SelectTrigger({ variant = "bordered", triggerSize = "md", className, ...rest }) {
554
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_select.Select.Trigger, {
555
+ className: cn([
556
+ "select",
557
+ `select-${variant}`,
558
+ triggerSize !== "md" && `select-${triggerSize}`
559
+ ], className),
560
+ ...rest
561
+ });
562
+ }
563
+ function SelectValue(props) {
564
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_select.Select.Value, { ...props });
565
+ }
566
+ function SelectIcon({ className, children, ...rest }) {
567
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_select.Select.Icon, {
568
+ className: cn("select-icon", className),
569
+ ...rest,
570
+ children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChevronDownIcon, {})
571
+ });
572
+ }
573
+ function SelectPopup({ className, sideOffset = 4, children, ...rest }) {
574
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_select.Select.Portal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_select.Select.Positioner, {
575
+ sideOffset,
576
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_select.Select.Popup, {
577
+ className: cn("select-popup", className),
578
+ ...rest,
579
+ children
580
+ })
581
+ }) });
582
+ }
583
+ function SelectItem({ className, ...rest }) {
584
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_select.Select.Item, {
585
+ className: cn("select-item", className),
586
+ ...rest
587
+ });
588
+ }
589
+ function SelectItemText(props) {
590
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_select.Select.ItemText, { ...props });
591
+ }
592
+ function SelectItemIndicator({ className, children, ...rest }) {
593
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_select.Select.ItemIndicator, {
594
+ className: cn("select-item-indicator", className),
595
+ ...rest,
596
+ children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CheckIcon, {})
597
+ });
598
+ }
599
+ function SelectGroup(props) {
600
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_select.Select.Group, { ...props });
601
+ }
602
+ function SelectGroupLabel({ className, ...rest }) {
603
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_select.Select.GroupLabel, {
604
+ className: cn("select-group-label", className),
605
+ ...rest
606
+ });
607
+ }
608
+ function CheckIcon() {
609
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
610
+ viewBox: "0 0 24 24",
611
+ fill: "none",
612
+ stroke: "currentColor",
613
+ strokeWidth: 2.5,
614
+ strokeLinecap: "round",
615
+ strokeLinejoin: "round",
616
+ width: "100%",
617
+ height: "100%",
618
+ "aria-hidden": true,
619
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("polyline", { points: "20 6 9 17 4 12" })
620
+ });
621
+ }
622
+ function ChevronDownIcon() {
623
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
624
+ viewBox: "0 0 24 24",
625
+ fill: "none",
626
+ stroke: "currentColor",
627
+ strokeWidth: 2,
628
+ strokeLinecap: "round",
629
+ strokeLinejoin: "round",
630
+ width: "100%",
631
+ height: "100%",
632
+ "aria-hidden": true,
633
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("polyline", { points: "6 9 12 15 18 9" })
634
+ });
635
+ }
636
+ var Select = Object.assign(SelectRoot, {
637
+ Trigger: SelectTrigger,
638
+ Value: SelectValue,
639
+ Icon: SelectIcon,
640
+ Popup: SelectPopup,
641
+ Item: SelectItem,
642
+ ItemText: SelectItemText,
643
+ ItemIndicator: SelectItemIndicator,
644
+ Group: SelectGroup,
645
+ GroupLabel: SelectGroupLabel
646
+ });
24
647
  //#endregion
25
648
  //#region src/Card.tsx
26
- function CardRoot({ bordered, compact, className, ...rest }) {
649
+ /**
650
+ * The bare `.card` container — no body, no title. Use this when you need to
651
+ * compose the internals yourself (e.g. a media block above the body).
652
+ */
653
+ function CardContainer({ bordered, compact, className, ...rest }) {
27
654
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
28
655
  className: (0, clsx.clsx)("card", bordered && "card-bordered", compact && "card-compact", className),
29
656
  ...rest
30
657
  });
31
658
  }
659
+ /**
660
+ * Standard card: a `.card` container with a single `.card-body` that lays out
661
+ * an optional title (with icon), description, children, and actions. For
662
+ * anything outside that shape, use `<Card.Container>` and compose by hand.
663
+ */
664
+ function CardRoot({ bordered, compact, icon, title, description, actions, className, children, ...rest }) {
665
+ const hasTitle = icon !== void 0 || title !== void 0;
666
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CardContainer, {
667
+ bordered,
668
+ compact,
669
+ className,
670
+ ...rest,
671
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(CardBody, { children: [
672
+ hasTitle ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CardTitle, {
673
+ icon,
674
+ children: title
675
+ }) : null,
676
+ description !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CardDescription, { children: description }) : null,
677
+ children,
678
+ actions !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CardActions, { children: actions }) : null
679
+ ] })
680
+ });
681
+ }
32
682
  function CardBody({ className, ...rest }) {
33
683
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
34
684
  className: (0, clsx.clsx)("card-body", className),
35
685
  ...rest
36
686
  });
37
687
  }
38
- function CardTitle({ className, children, ...rest }) {
39
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
688
+ function CardTitle({ icon, className, children, ...rest }) {
689
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("h3", {
40
690
  className: (0, clsx.clsx)("card-title", className),
41
691
  ...rest,
42
- children
692
+ children: [renderIcon(icon), children]
43
693
  });
44
694
  }
45
695
  function CardDescription({ className, ...rest }) {
@@ -55,34 +705,161 @@ function CardActions({ className, ...rest }) {
55
705
  });
56
706
  }
57
707
  var Card = Object.assign(CardRoot, {
708
+ Container: CardContainer,
58
709
  Body: CardBody,
59
710
  Title: CardTitle,
60
711
  Description: CardDescription,
61
712
  Actions: CardActions
62
713
  });
63
714
  //#endregion
715
+ //#region src/Dialog.tsx
716
+ var DialogContext = (0, react.createContext)(null);
717
+ function DefaultCloseIcon() {
718
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
719
+ width: "16",
720
+ height: "16",
721
+ viewBox: "0 0 24 24",
722
+ fill: "none",
723
+ stroke: "currentColor",
724
+ strokeWidth: "2",
725
+ strokeLinecap: "round",
726
+ strokeLinejoin: "round",
727
+ "aria-hidden": "true",
728
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M18 6 6 18" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "m6 6 12 12" })]
729
+ });
730
+ }
731
+ /**
732
+ * The bare `<dialog>` primitive — no opinions about header, body, or footer.
733
+ * Use this when the default `<Dialog>` layout doesn't fit (custom header,
734
+ * media block, multi-step content).
735
+ */
736
+ function DialogContainer({ open, onOpenChange, size = "md", closedby = "any", className, children, ...rest }) {
737
+ const ref = (0, react.useRef)(null);
738
+ const onOpenChangeRef = (0, react.useRef)(onOpenChange);
739
+ onOpenChangeRef.current = onOpenChange;
740
+ (0, react.useEffect)(() => {
741
+ const el = ref.current;
742
+ if (!el || open === void 0) return;
743
+ if (open && !el.open) el.showModal();
744
+ else if (!open && el.open) el.close();
745
+ }, [open]);
746
+ (0, react.useEffect)(() => {
747
+ const el = ref.current;
748
+ if (!el) return;
749
+ const handleClose = () => onOpenChangeRef.current?.(false);
750
+ el.addEventListener("close", handleClose);
751
+ return () => el.removeEventListener("close", handleClose);
752
+ }, []);
753
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DialogContext.Provider, {
754
+ value: { close: () => ref.current?.close() },
755
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dialog", {
756
+ ref,
757
+ className: (0, clsx.clsx)("dialog", size !== "md" && `dialog-${size}`, className),
758
+ closedby,
759
+ ...rest,
760
+ children
761
+ })
762
+ });
763
+ }
764
+ function DialogHeader({ className, ...rest }) {
765
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
766
+ className: (0, clsx.clsx)("dialog-header", className),
767
+ ...rest
768
+ });
769
+ }
770
+ function DialogTitle({ icon, className, children, ...rest }) {
771
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("h2", {
772
+ className: (0, clsx.clsx)("dialog-title", className),
773
+ ...rest,
774
+ children: [renderIcon(icon), children]
775
+ });
776
+ }
777
+ function DialogDescription({ className, ...rest }) {
778
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
779
+ className: (0, clsx.clsx)("dialog-description", className),
780
+ ...rest
781
+ });
782
+ }
783
+ function DialogBody({ className, ...rest }) {
784
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
785
+ className: (0, clsx.clsx)("dialog-body", className),
786
+ ...rest
787
+ });
788
+ }
789
+ function DialogFooter({ className, ...rest }) {
790
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
791
+ className: (0, clsx.clsx)("dialog-footer", className),
792
+ ...rest
793
+ });
794
+ }
795
+ function DialogCloseButton({ icon, className, children, onClick, type = "button", "aria-label": ariaLabel = "Close", ...rest }) {
796
+ const ctx = (0, react.useContext)(DialogContext);
797
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
798
+ type,
799
+ className: (0, clsx.clsx)("dialog-close", className),
800
+ "aria-label": ariaLabel,
801
+ onClick: (event) => {
802
+ onClick?.(event);
803
+ if (!event.defaultPrevented) ctx?.close();
804
+ },
805
+ ...rest,
806
+ children: children ?? (icon !== void 0 ? renderIcon(icon) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DefaultCloseIcon, {}))
807
+ });
808
+ }
809
+ /**
810
+ * Standard modal: a `<dialog>` with an opinionated header / body / footer
811
+ * layout driven by shorthand props. For anything outside that shape, use
812
+ * `<Dialog.Container>` and compose by hand.
813
+ */
814
+ function DialogRoot({ icon, title, description, actions, dismissible = true, closeLabel = "Close", children, ...containerProps }) {
815
+ const hasTitle = title !== void 0 || icon !== void 0;
816
+ const showHeader = hasTitle || dismissible;
817
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DialogContainer, {
818
+ ...containerProps,
819
+ children: [
820
+ showHeader ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DialogHeader, { children: [hasTitle ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DialogTitle, {
821
+ icon,
822
+ children: title
823
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "flex-1" }), dismissible ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DialogCloseButton, { "aria-label": closeLabel }) : null] }) : null,
824
+ description !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DialogDescription, { children: description }) : null,
825
+ children !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DialogBody, { children }) : null,
826
+ actions !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DialogFooter, { children: actions }) : null
827
+ ]
828
+ });
829
+ }
830
+ var Dialog = Object.assign(DialogRoot, {
831
+ Container: DialogContainer,
832
+ Header: DialogHeader,
833
+ Title: DialogTitle,
834
+ Description: DialogDescription,
835
+ Body: DialogBody,
836
+ Footer: DialogFooter,
837
+ CloseButton: DialogCloseButton
838
+ });
839
+ //#endregion
64
840
  //#region src/Field.tsx
65
841
  function FieldRoot({ className, ...rest }) {
66
842
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_field.Field.Root, {
67
- className: (0, clsx.clsx)("field", typeof className === "string" ? className : void 0),
843
+ className: cn("field", className),
68
844
  ...rest
69
845
  });
70
846
  }
71
- function FieldLabel({ className, ...rest }) {
847
+ function FieldLabel({ className, required, ...rest }) {
72
848
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_field.Field.Label, {
73
- className: (0, clsx.clsx)("field-label", typeof className === "string" ? className : void 0),
849
+ "data-required": required ? "" : void 0,
850
+ className: cn("field-label", className),
74
851
  ...rest
75
852
  });
76
853
  }
77
854
  function FieldDescription({ className, ...rest }) {
78
855
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_field.Field.Description, {
79
- className: (0, clsx.clsx)("field-description", typeof className === "string" ? className : void 0),
856
+ className: cn("field-description", className),
80
857
  ...rest
81
858
  });
82
859
  }
83
860
  function FieldError({ className, ...rest }) {
84
861
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_field.Field.Error, {
85
- className: (0, clsx.clsx)("field-error", typeof className === "string" ? className : void 0),
862
+ className: cn("field-error", className),
86
863
  ...rest
87
864
  });
88
865
  }
@@ -92,9 +869,462 @@ var Field = Object.assign(FieldRoot, {
92
869
  Error: FieldError
93
870
  });
94
871
  //#endregion
872
+ //#region src/Footer.tsx
873
+ function FooterRoot({ className, ...rest }) {
874
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("footer", {
875
+ className: (0, clsx.clsx)("footer", className),
876
+ ...rest
877
+ });
878
+ }
879
+ function FooterLinks({ className, ...rest }) {
880
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
881
+ className: (0, clsx.clsx)("footer-links", className),
882
+ ...rest
883
+ });
884
+ }
885
+ function FooterLink({ className, children, ...rest }) {
886
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
887
+ className: (0, clsx.clsx)("footer-link", className),
888
+ ...rest,
889
+ children
890
+ });
891
+ }
892
+ function FooterMeta({ className, ...rest }) {
893
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
894
+ className: (0, clsx.clsx)("footer-meta", className),
895
+ ...rest
896
+ });
897
+ }
898
+ var Footer = Object.assign(FooterRoot, {
899
+ Links: FooterLinks,
900
+ Link: FooterLink,
901
+ Meta: FooterMeta
902
+ });
903
+ //#endregion
904
+ //#region src/Menu.tsx
905
+ function MenuRoot({ className, ...rest }) {
906
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("details", {
907
+ className: (0, clsx.clsx)("menu", className),
908
+ ...rest
909
+ });
910
+ }
911
+ function MenuTrigger({ className, ...rest }) {
912
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", {
913
+ className: (0, clsx.clsx)("menu-trigger", className),
914
+ ...rest
915
+ });
916
+ }
917
+ function MenuPopup({ className, role = "menu", ...rest }) {
918
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
919
+ role,
920
+ className: (0, clsx.clsx)("menu-popup", className),
921
+ ...rest
922
+ });
923
+ }
924
+ function MenuItem(props) {
925
+ if (props.href !== void 0) {
926
+ const { className, role = "menuitem", icon, children, ...rest } = props;
927
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("a", {
928
+ role,
929
+ className: (0, clsx.clsx)("menu-item", className),
930
+ ...rest,
931
+ children: [renderIcon(icon), children]
932
+ });
933
+ }
934
+ const { className, type = "button", role = "menuitem", icon, children, ...rest } = props;
935
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
936
+ type,
937
+ role,
938
+ className: (0, clsx.clsx)("menu-item", className),
939
+ ...rest,
940
+ children: [renderIcon(icon), children]
941
+ });
942
+ }
943
+ function MenuSeparator({ className, ...rest }) {
944
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hr", {
945
+ className: (0, clsx.clsx)("menu-separator", className),
946
+ ...rest
947
+ });
948
+ }
949
+ function MenuGroup({ className, role = "group", ...rest }) {
950
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
951
+ role,
952
+ className: (0, clsx.clsx)("menu-group", className),
953
+ ...rest
954
+ });
955
+ }
956
+ function MenuGroupLabel({ className, ...rest }) {
957
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
958
+ className: (0, clsx.clsx)("menu-group-label", className),
959
+ ...rest
960
+ });
961
+ }
962
+ var Menu = Object.assign(MenuRoot, {
963
+ Trigger: MenuTrigger,
964
+ Popup: MenuPopup,
965
+ Item: MenuItem,
966
+ Separator: MenuSeparator,
967
+ Group: MenuGroup,
968
+ GroupLabel: MenuGroupLabel
969
+ });
970
+ //#endregion
971
+ //#region src/Navbar.tsx
972
+ function NavbarRoot({ className, ...rest }) {
973
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("header", {
974
+ className: (0, clsx.clsx)("navbar", className),
975
+ ...rest
976
+ });
977
+ }
978
+ function NavbarBrand({ className, ...rest }) {
979
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
980
+ className: (0, clsx.clsx)("navbar-brand", className),
981
+ ...rest
982
+ });
983
+ }
984
+ function NavbarItems({ className, ...rest }) {
985
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("nav", {
986
+ className: (0, clsx.clsx)("navbar-items", className),
987
+ ...rest
988
+ });
989
+ }
990
+ function NavbarItem({ active, icon, className, children, ...rest }) {
991
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("a", {
992
+ className: (0, clsx.clsx)("navbar-item", className),
993
+ "aria-current": active ? "page" : void 0,
994
+ ...rest,
995
+ children: [renderIcon(icon), children]
996
+ });
997
+ }
998
+ function NavbarDropdown({ label, className, children, ...rest }) {
999
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Menu, {
1000
+ className,
1001
+ ...rest,
1002
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Menu.Trigger, {
1003
+ className: "navbar-item",
1004
+ children: label
1005
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Menu.Popup, { children })]
1006
+ });
1007
+ }
1008
+ function NavbarActions({ className, ...rest }) {
1009
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1010
+ className: (0, clsx.clsx)("navbar-actions", className),
1011
+ ...rest
1012
+ });
1013
+ }
1014
+ function NavbarMobileToggle({ label = "Open menu", className, type = "button", ...rest }) {
1015
+ const shell = useAppShell();
1016
+ const open = shell?.mobileDrawerOpen ?? false;
1017
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1018
+ type,
1019
+ "aria-label": label,
1020
+ "aria-expanded": open,
1021
+ onClick: () => shell?.setMobileDrawerOpen(!open),
1022
+ className: (0, clsx.clsx)("navbar-mobile-toggle", className),
1023
+ ...rest
1024
+ });
1025
+ }
1026
+ var Navbar = Object.assign(NavbarRoot, {
1027
+ Brand: NavbarBrand,
1028
+ Items: NavbarItems,
1029
+ Item: NavbarItem,
1030
+ Dropdown: NavbarDropdown,
1031
+ Actions: NavbarActions,
1032
+ MobileToggle: NavbarMobileToggle
1033
+ });
1034
+ //#endregion
1035
+ //#region src/Tabs.tsx
1036
+ function TabsRoot({ variant = "bordered", size = "md", fullWidth = false, className, ...rest }) {
1037
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_tabs.Tabs.Root, {
1038
+ className: cn([
1039
+ "tabs",
1040
+ `tabs-${variant}`,
1041
+ size !== "md" && `tabs-${size}`,
1042
+ fullWidth && "tabs-full-width"
1043
+ ], className),
1044
+ ...rest
1045
+ });
1046
+ }
1047
+ function TabsList({ className, ...rest }) {
1048
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_tabs.Tabs.List, {
1049
+ className: cn("tab-list", className),
1050
+ ...rest
1051
+ });
1052
+ }
1053
+ function TabsTab({ className, ...rest }) {
1054
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_tabs.Tabs.Tab, {
1055
+ className: cn("tab", className),
1056
+ ...rest
1057
+ });
1058
+ }
1059
+ function TabsPanel({ className, ...rest }) {
1060
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_tabs.Tabs.Panel, {
1061
+ className: cn("tab-panel", className),
1062
+ ...rest
1063
+ });
1064
+ }
1065
+ function TabsIndicator({ className, ...rest }) {
1066
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_tabs.Tabs.Indicator, {
1067
+ className: cn("tab-indicator", className),
1068
+ ...rest
1069
+ });
1070
+ }
1071
+ var Tabs = Object.assign(TabsRoot, {
1072
+ List: TabsList,
1073
+ Tab: TabsTab,
1074
+ Panel: TabsPanel,
1075
+ Indicator: TabsIndicator
1076
+ });
1077
+ //#endregion
1078
+ //#region src/Table.tsx
1079
+ function TableRoot({ striped, bordered, relaxed, sticky, className, ...rest }) {
1080
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("table", {
1081
+ className: (0, clsx.clsx)("table", striped && "table-striped", bordered && "table-bordered", relaxed && "table-relaxed", sticky && "table-sticky", className),
1082
+ ...rest
1083
+ });
1084
+ }
1085
+ function TableHead({ className, ...rest }) {
1086
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("thead", {
1087
+ className: (0, clsx.clsx)(className),
1088
+ ...rest
1089
+ });
1090
+ }
1091
+ function TableBody({ className, ...rest }) {
1092
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tbody", {
1093
+ className: (0, clsx.clsx)(className),
1094
+ ...rest
1095
+ });
1096
+ }
1097
+ function TableFoot({ className, ...rest }) {
1098
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tfoot", {
1099
+ className: (0, clsx.clsx)(className),
1100
+ ...rest
1101
+ });
1102
+ }
1103
+ function TableRow({ selected, asLink, className, ...rest }) {
1104
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tr", {
1105
+ className: (0, clsx.clsx)(asLink && "table-row-link", className),
1106
+ "data-selected": selected || void 0,
1107
+ ...rest
1108
+ });
1109
+ }
1110
+ function TableHeaderCell({ align, gutter, className, scope, ...rest }) {
1111
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", {
1112
+ className: (0, clsx.clsx)("table-header-cell", gutter && "table-cell-gutter", className),
1113
+ "data-align": align && align !== "left" ? align : void 0,
1114
+ scope: scope ?? "col",
1115
+ ...rest
1116
+ });
1117
+ }
1118
+ function TableCell({ align, gutter, numeric, className, ...rest }) {
1119
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
1120
+ className: (0, clsx.clsx)("table-cell", gutter && "table-cell-gutter", numeric && "table-cell-numeric", className),
1121
+ "data-align": align && align !== "left" ? align : void 0,
1122
+ ...rest
1123
+ });
1124
+ }
1125
+ var Table = Object.assign(TableRoot, {
1126
+ Head: TableHead,
1127
+ Body: TableBody,
1128
+ Foot: TableFoot,
1129
+ Row: TableRow,
1130
+ HeaderCell: TableHeaderCell,
1131
+ Cell: TableCell
1132
+ });
1133
+ //#endregion
1134
+ //#region src/Sidebar.tsx
1135
+ var SidebarContext = (0, react.createContext)(null);
1136
+ function SidebarRoot({ collapsed, defaultCollapsed, onCollapsedChange, drawerLabel = "Navigation", className, children, ...rest }) {
1137
+ const shell = useAppShell();
1138
+ const drawerOpen = shell?.mobileDrawerOpen ?? false;
1139
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(SidebarContext.Provider, {
1140
+ value: {
1141
+ collapsed,
1142
+ defaultCollapsed,
1143
+ onCollapsedChange
1144
+ },
1145
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("aside", {
1146
+ className: (0, clsx.clsx)("sidebar", className),
1147
+ ...rest,
1148
+ children: drawerOpen ? null : children
1149
+ }), shell ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_dialog.Dialog.Root, {
1150
+ open: drawerOpen,
1151
+ onOpenChange: (open) => shell.setMobileDrawerOpen(open),
1152
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_base_ui_react_dialog.Dialog.Portal, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_dialog.Dialog.Backdrop, { className: "sidebar-drawer-backdrop" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_dialog.Dialog.Popup, {
1153
+ className: "sidebar-drawer",
1154
+ "aria-label": drawerLabel,
1155
+ onClick: (event) => {
1156
+ if (event.target.closest("a, [data-drawer-close]")) shell.setMobileDrawerOpen(false);
1157
+ },
1158
+ children
1159
+ })] })
1160
+ }) : null]
1161
+ });
1162
+ }
1163
+ function SidebarHeader({ className, ...rest }) {
1164
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1165
+ className: (0, clsx.clsx)("sidebar-header", className),
1166
+ ...rest
1167
+ });
1168
+ }
1169
+ function SidebarNav({ className, ...rest }) {
1170
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("nav", {
1171
+ className: (0, clsx.clsx)("sidebar-nav", className),
1172
+ ...rest
1173
+ });
1174
+ }
1175
+ function SidebarGroup({ className, ...rest }) {
1176
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1177
+ className: (0, clsx.clsx)("sidebar-group", className),
1178
+ ...rest
1179
+ });
1180
+ }
1181
+ function SidebarGroupLabel({ className, ...rest }) {
1182
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1183
+ className: (0, clsx.clsx)("sidebar-group-label", className),
1184
+ ...rest
1185
+ });
1186
+ }
1187
+ function SidebarItem({ active, icon, badge, className, children, ...rest }) {
1188
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("a", {
1189
+ className: (0, clsx.clsx)("sidebar-item", className),
1190
+ "aria-current": active ? "page" : void 0,
1191
+ ...rest,
1192
+ children: [
1193
+ icon != null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarIcon, { children: renderIcon(icon) }) : null,
1194
+ children !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarLabel, { children }) : null,
1195
+ badge !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarBadge, { children: badge }) : null
1196
+ ]
1197
+ });
1198
+ }
1199
+ function SidebarIcon({ className, ...rest }) {
1200
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1201
+ "aria-hidden": true,
1202
+ className: (0, clsx.clsx)("sidebar-icon", className),
1203
+ ...rest
1204
+ });
1205
+ }
1206
+ function SidebarLabel({ className, ...rest }) {
1207
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1208
+ className: (0, clsx.clsx)("sidebar-label", className),
1209
+ ...rest
1210
+ });
1211
+ }
1212
+ function SidebarBadge({ className, ...rest }) {
1213
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1214
+ className: (0, clsx.clsx)("sidebar-badge", className),
1215
+ ...rest
1216
+ });
1217
+ }
1218
+ function SidebarCollapsible({ icon, label, trigger, children, className, open, defaultOpen, onOpenChange, ...rest }) {
1219
+ const isControlled = open !== void 0;
1220
+ const [internalOpen, setInternalOpen] = (0, react.useState)(defaultOpen ?? false);
1221
+ const isOpen = isControlled ? open : internalOpen;
1222
+ const triggerContent = trigger ?? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [icon != null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarIcon, { children: renderIcon(icon) }) : null, label !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarLabel, { children: label }) : null] });
1223
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
1224
+ className: (0, clsx.clsx)("sidebar-collapsible", className),
1225
+ open: isOpen,
1226
+ onToggle: (event) => {
1227
+ const next = event.currentTarget.open;
1228
+ if (!isControlled) setInternalOpen(next);
1229
+ onOpenChange?.(next);
1230
+ },
1231
+ ...rest,
1232
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", {
1233
+ className: "sidebar-collapsible-trigger",
1234
+ children: triggerContent
1235
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1236
+ className: "sidebar-collapsible-panel",
1237
+ children
1238
+ })]
1239
+ });
1240
+ }
1241
+ function SidebarSubItem({ active, icon, badge, className, children, ...rest }) {
1242
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("a", {
1243
+ className: (0, clsx.clsx)("sidebar-subitem", className),
1244
+ "aria-current": active ? "page" : void 0,
1245
+ ...rest,
1246
+ children: [
1247
+ icon != null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarIcon, { children: renderIcon(icon) }) : null,
1248
+ children,
1249
+ badge !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarBadge, { children: badge }) : null
1250
+ ]
1251
+ });
1252
+ }
1253
+ function SidebarFooter({ className, ...rest }) {
1254
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1255
+ className: (0, clsx.clsx)("sidebar-footer", className),
1256
+ ...rest
1257
+ });
1258
+ }
1259
+ function SidebarCollapseToggle({ label = "Toggle sidebar", className, children, ...rest }) {
1260
+ const ctx = (0, react.useContext)(SidebarContext);
1261
+ const controlledChecked = ctx?.collapsed;
1262
+ const isControlled = controlledChecked !== void 0;
1263
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
1264
+ className: (0, clsx.clsx)("sidebar-collapse-toggle", className),
1265
+ ...rest,
1266
+ children: [
1267
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
1268
+ type: "checkbox",
1269
+ className: "sidebar-toggle",
1270
+ "aria-label": label,
1271
+ ...isControlled ? { checked: controlledChecked } : { defaultChecked: ctx?.defaultCollapsed },
1272
+ onChange: (event) => ctx?.onCollapsedChange?.(event.currentTarget.checked)
1273
+ }),
1274
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1275
+ className: "sr-only",
1276
+ children: label
1277
+ }),
1278
+ children
1279
+ ]
1280
+ });
1281
+ }
1282
+ var Sidebar = Object.assign(SidebarRoot, {
1283
+ Header: SidebarHeader,
1284
+ Nav: SidebarNav,
1285
+ Group: SidebarGroup,
1286
+ GroupLabel: SidebarGroupLabel,
1287
+ Item: SidebarItem,
1288
+ Icon: SidebarIcon,
1289
+ Label: SidebarLabel,
1290
+ Badge: SidebarBadge,
1291
+ Collapsible: SidebarCollapsible,
1292
+ SubItem: SidebarSubItem,
1293
+ Footer: SidebarFooter,
1294
+ CollapseToggle: SidebarCollapseToggle
1295
+ });
1296
+ //#endregion
1297
+ exports.Accordion = Accordion;
1298
+ exports.AdminRoot = AdminRoot;
1299
+ exports.Alert = Alert;
1300
+ exports.AppShell = AppShell;
1301
+ exports.Badge = Badge;
1302
+ exports.BrandTile = BrandTile;
1303
+ exports.Breadcrumbs = Breadcrumbs;
95
1304
  exports.Button = Button;
1305
+ exports.ButtonGroup = ButtonGroup;
96
1306
  exports.Card = Card;
1307
+ exports.Checkbox = Checkbox;
1308
+ exports.Dialog = Dialog;
97
1309
  exports.Field = Field;
1310
+ exports.FileInput = FileInput;
1311
+ exports.Footer = Footer;
98
1312
  exports.Input = Input;
1313
+ exports.InputGroup = InputGroup;
1314
+ exports.Menu = Menu;
1315
+ exports.Navbar = Navbar;
1316
+ exports.Pagination = Pagination;
1317
+ exports.Progress = Progress;
1318
+ exports.Radio = Radio;
1319
+ exports.RadioGroup = RadioGroup;
1320
+ exports.Select = Select;
1321
+ exports.Sidebar = Sidebar;
1322
+ exports.Spinner = Spinner;
1323
+ exports.Switch = Switch;
1324
+ exports.Table = Table;
1325
+ exports.Tabs = Tabs;
1326
+ exports.Textarea = Textarea;
1327
+ exports.getPaginationItems = getPaginationItems;
1328
+ exports.useAppShell = useAppShell;
99
1329
 
100
1330
  //# sourceMappingURL=index.cjs.map