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