@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.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),
21
283
  ...rest
22
284
  });
23
285
  }
286
+ function InputGroupAddon({ className, ...rest }) {
287
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
288
+ className: (0, clsx.clsx)("input-group-addon", className),
289
+ ...rest
290
+ });
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,6 +705,7 @@ 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,
@@ -64,25 +715,26 @@ var Card = Object.assign(CardRoot, {
64
715
  //#region src/Field.tsx
65
716
  function FieldRoot({ className, ...rest }) {
66
717
  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),
718
+ className: cn("field", className),
68
719
  ...rest
69
720
  });
70
721
  }
71
- function FieldLabel({ className, ...rest }) {
722
+ function FieldLabel({ className, required, ...rest }) {
72
723
  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),
724
+ "data-required": required ? "" : void 0,
725
+ className: cn("field-label", className),
74
726
  ...rest
75
727
  });
76
728
  }
77
729
  function FieldDescription({ className, ...rest }) {
78
730
  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),
731
+ className: cn("field-description", className),
80
732
  ...rest
81
733
  });
82
734
  }
83
735
  function FieldError({ className, ...rest }) {
84
736
  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),
737
+ className: cn("field-error", className),
86
738
  ...rest
87
739
  });
88
740
  }
@@ -92,9 +744,461 @@ var Field = Object.assign(FieldRoot, {
92
744
  Error: FieldError
93
745
  });
94
746
  //#endregion
747
+ //#region src/Footer.tsx
748
+ function FooterRoot({ className, ...rest }) {
749
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("footer", {
750
+ className: (0, clsx.clsx)("footer", className),
751
+ ...rest
752
+ });
753
+ }
754
+ function FooterLinks({ className, ...rest }) {
755
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
756
+ className: (0, clsx.clsx)("footer-links", className),
757
+ ...rest
758
+ });
759
+ }
760
+ function FooterLink({ className, children, ...rest }) {
761
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
762
+ className: (0, clsx.clsx)("footer-link", className),
763
+ ...rest,
764
+ children
765
+ });
766
+ }
767
+ function FooterMeta({ className, ...rest }) {
768
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
769
+ className: (0, clsx.clsx)("footer-meta", className),
770
+ ...rest
771
+ });
772
+ }
773
+ var Footer = Object.assign(FooterRoot, {
774
+ Links: FooterLinks,
775
+ Link: FooterLink,
776
+ Meta: FooterMeta
777
+ });
778
+ //#endregion
779
+ //#region src/Menu.tsx
780
+ function MenuRoot({ className, ...rest }) {
781
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("details", {
782
+ className: (0, clsx.clsx)("menu", className),
783
+ ...rest
784
+ });
785
+ }
786
+ function MenuTrigger({ className, ...rest }) {
787
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", {
788
+ className: (0, clsx.clsx)("menu-trigger", className),
789
+ ...rest
790
+ });
791
+ }
792
+ function MenuPopup({ className, role = "menu", ...rest }) {
793
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
794
+ role,
795
+ className: (0, clsx.clsx)("menu-popup", className),
796
+ ...rest
797
+ });
798
+ }
799
+ function MenuItem(props) {
800
+ if (props.href !== void 0) {
801
+ const { className, role = "menuitem", icon, children, ...rest } = props;
802
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("a", {
803
+ role,
804
+ className: (0, clsx.clsx)("menu-item", className),
805
+ ...rest,
806
+ children: [renderIcon(icon), children]
807
+ });
808
+ }
809
+ const { className, type = "button", role = "menuitem", icon, children, ...rest } = props;
810
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
811
+ type,
812
+ role,
813
+ className: (0, clsx.clsx)("menu-item", className),
814
+ ...rest,
815
+ children: [renderIcon(icon), children]
816
+ });
817
+ }
818
+ function MenuSeparator({ className, ...rest }) {
819
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hr", {
820
+ className: (0, clsx.clsx)("menu-separator", className),
821
+ ...rest
822
+ });
823
+ }
824
+ function MenuGroup({ className, role = "group", ...rest }) {
825
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
826
+ role,
827
+ className: (0, clsx.clsx)("menu-group", className),
828
+ ...rest
829
+ });
830
+ }
831
+ function MenuGroupLabel({ className, ...rest }) {
832
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
833
+ className: (0, clsx.clsx)("menu-group-label", className),
834
+ ...rest
835
+ });
836
+ }
837
+ var Menu = Object.assign(MenuRoot, {
838
+ Trigger: MenuTrigger,
839
+ Popup: MenuPopup,
840
+ Item: MenuItem,
841
+ Separator: MenuSeparator,
842
+ Group: MenuGroup,
843
+ GroupLabel: MenuGroupLabel
844
+ });
845
+ //#endregion
846
+ //#region src/Navbar.tsx
847
+ function NavbarRoot({ className, ...rest }) {
848
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("header", {
849
+ className: (0, clsx.clsx)("navbar", className),
850
+ ...rest
851
+ });
852
+ }
853
+ function NavbarBrand({ className, ...rest }) {
854
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
855
+ className: (0, clsx.clsx)("navbar-brand", className),
856
+ ...rest
857
+ });
858
+ }
859
+ function NavbarItems({ className, ...rest }) {
860
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("nav", {
861
+ className: (0, clsx.clsx)("navbar-items", className),
862
+ ...rest
863
+ });
864
+ }
865
+ function NavbarItem({ active, icon, className, children, ...rest }) {
866
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("a", {
867
+ className: (0, clsx.clsx)("navbar-item", className),
868
+ "aria-current": active ? "page" : void 0,
869
+ ...rest,
870
+ children: [renderIcon(icon), children]
871
+ });
872
+ }
873
+ function NavbarDropdown({ label, className, children, ...rest }) {
874
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Menu, {
875
+ className,
876
+ ...rest,
877
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Menu.Trigger, {
878
+ className: "navbar-item",
879
+ children: label
880
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Menu.Popup, { children })]
881
+ });
882
+ }
883
+ function NavbarActions({ className, ...rest }) {
884
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
885
+ className: (0, clsx.clsx)("navbar-actions", className),
886
+ ...rest
887
+ });
888
+ }
889
+ function NavbarMobileToggle({ label = "Open menu", className, type = "button", ...rest }) {
890
+ const shell = useAppShell();
891
+ const open = shell?.mobileDrawerOpen ?? false;
892
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
893
+ type,
894
+ "aria-label": label,
895
+ "aria-expanded": open,
896
+ onClick: () => shell?.setMobileDrawerOpen(!open),
897
+ className: (0, clsx.clsx)("navbar-mobile-toggle", className),
898
+ ...rest
899
+ });
900
+ }
901
+ var Navbar = Object.assign(NavbarRoot, {
902
+ Brand: NavbarBrand,
903
+ Items: NavbarItems,
904
+ Item: NavbarItem,
905
+ Dropdown: NavbarDropdown,
906
+ Actions: NavbarActions,
907
+ MobileToggle: NavbarMobileToggle
908
+ });
909
+ //#endregion
910
+ //#region src/Tabs.tsx
911
+ function TabsRoot({ variant = "bordered", size = "md", fullWidth = false, className, ...rest }) {
912
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_tabs.Tabs.Root, {
913
+ className: cn([
914
+ "tabs",
915
+ `tabs-${variant}`,
916
+ size !== "md" && `tabs-${size}`,
917
+ fullWidth && "tabs-full-width"
918
+ ], className),
919
+ ...rest
920
+ });
921
+ }
922
+ function TabsList({ className, ...rest }) {
923
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_tabs.Tabs.List, {
924
+ className: cn("tab-list", className),
925
+ ...rest
926
+ });
927
+ }
928
+ function TabsTab({ className, ...rest }) {
929
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_tabs.Tabs.Tab, {
930
+ className: cn("tab", className),
931
+ ...rest
932
+ });
933
+ }
934
+ function TabsPanel({ className, ...rest }) {
935
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_tabs.Tabs.Panel, {
936
+ className: cn("tab-panel", className),
937
+ ...rest
938
+ });
939
+ }
940
+ function TabsIndicator({ className, ...rest }) {
941
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_tabs.Tabs.Indicator, {
942
+ className: cn("tab-indicator", className),
943
+ ...rest
944
+ });
945
+ }
946
+ var Tabs = Object.assign(TabsRoot, {
947
+ List: TabsList,
948
+ Tab: TabsTab,
949
+ Panel: TabsPanel,
950
+ Indicator: TabsIndicator
951
+ });
952
+ //#endregion
953
+ //#region src/Table.tsx
954
+ function TableRoot({ striped, bordered, relaxed, sticky, className, ...rest }) {
955
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("table", {
956
+ className: (0, clsx.clsx)("table", striped && "table-striped", bordered && "table-bordered", relaxed && "table-relaxed", sticky && "table-sticky", className),
957
+ ...rest
958
+ });
959
+ }
960
+ function TableHead({ className, ...rest }) {
961
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("thead", {
962
+ className: (0, clsx.clsx)(className),
963
+ ...rest
964
+ });
965
+ }
966
+ function TableBody({ className, ...rest }) {
967
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tbody", {
968
+ className: (0, clsx.clsx)(className),
969
+ ...rest
970
+ });
971
+ }
972
+ function TableFoot({ className, ...rest }) {
973
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tfoot", {
974
+ className: (0, clsx.clsx)(className),
975
+ ...rest
976
+ });
977
+ }
978
+ function TableRow({ selected, asLink, className, ...rest }) {
979
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tr", {
980
+ className: (0, clsx.clsx)(asLink && "table-row-link", className),
981
+ "data-selected": selected || void 0,
982
+ ...rest
983
+ });
984
+ }
985
+ function TableHeaderCell({ align, gutter, className, scope, ...rest }) {
986
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", {
987
+ className: (0, clsx.clsx)("table-header-cell", gutter && "table-cell-gutter", className),
988
+ "data-align": align && align !== "left" ? align : void 0,
989
+ scope: scope ?? "col",
990
+ ...rest
991
+ });
992
+ }
993
+ function TableCell({ align, gutter, numeric, className, ...rest }) {
994
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
995
+ className: (0, clsx.clsx)("table-cell", gutter && "table-cell-gutter", numeric && "table-cell-numeric", className),
996
+ "data-align": align && align !== "left" ? align : void 0,
997
+ ...rest
998
+ });
999
+ }
1000
+ var Table = Object.assign(TableRoot, {
1001
+ Head: TableHead,
1002
+ Body: TableBody,
1003
+ Foot: TableFoot,
1004
+ Row: TableRow,
1005
+ HeaderCell: TableHeaderCell,
1006
+ Cell: TableCell
1007
+ });
1008
+ //#endregion
1009
+ //#region src/Sidebar.tsx
1010
+ var SidebarContext = (0, react.createContext)(null);
1011
+ function SidebarRoot({ collapsed, defaultCollapsed, onCollapsedChange, drawerLabel = "Navigation", className, children, ...rest }) {
1012
+ const shell = useAppShell();
1013
+ const drawerOpen = shell?.mobileDrawerOpen ?? false;
1014
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(SidebarContext.Provider, {
1015
+ value: {
1016
+ collapsed,
1017
+ defaultCollapsed,
1018
+ onCollapsedChange
1019
+ },
1020
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("aside", {
1021
+ className: (0, clsx.clsx)("sidebar", className),
1022
+ ...rest,
1023
+ children: drawerOpen ? null : children
1024
+ }), shell ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_dialog.Dialog.Root, {
1025
+ open: drawerOpen,
1026
+ onOpenChange: (open) => shell.setMobileDrawerOpen(open),
1027
+ 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, {
1028
+ className: "sidebar-drawer",
1029
+ "aria-label": drawerLabel,
1030
+ onClick: (event) => {
1031
+ if (event.target.closest("a, [data-drawer-close]")) shell.setMobileDrawerOpen(false);
1032
+ },
1033
+ children
1034
+ })] })
1035
+ }) : null]
1036
+ });
1037
+ }
1038
+ function SidebarHeader({ className, ...rest }) {
1039
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1040
+ className: (0, clsx.clsx)("sidebar-header", className),
1041
+ ...rest
1042
+ });
1043
+ }
1044
+ function SidebarNav({ className, ...rest }) {
1045
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("nav", {
1046
+ className: (0, clsx.clsx)("sidebar-nav", className),
1047
+ ...rest
1048
+ });
1049
+ }
1050
+ function SidebarGroup({ className, ...rest }) {
1051
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1052
+ className: (0, clsx.clsx)("sidebar-group", className),
1053
+ ...rest
1054
+ });
1055
+ }
1056
+ function SidebarGroupLabel({ className, ...rest }) {
1057
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1058
+ className: (0, clsx.clsx)("sidebar-group-label", className),
1059
+ ...rest
1060
+ });
1061
+ }
1062
+ function SidebarItem({ active, icon, badge, className, children, ...rest }) {
1063
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("a", {
1064
+ className: (0, clsx.clsx)("sidebar-item", className),
1065
+ "aria-current": active ? "page" : void 0,
1066
+ ...rest,
1067
+ children: [
1068
+ icon != null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarIcon, { children: renderIcon(icon) }) : null,
1069
+ children !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarLabel, { children }) : null,
1070
+ badge !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarBadge, { children: badge }) : null
1071
+ ]
1072
+ });
1073
+ }
1074
+ function SidebarIcon({ className, ...rest }) {
1075
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1076
+ "aria-hidden": true,
1077
+ className: (0, clsx.clsx)("sidebar-icon", className),
1078
+ ...rest
1079
+ });
1080
+ }
1081
+ function SidebarLabel({ className, ...rest }) {
1082
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1083
+ className: (0, clsx.clsx)("sidebar-label", className),
1084
+ ...rest
1085
+ });
1086
+ }
1087
+ function SidebarBadge({ className, ...rest }) {
1088
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1089
+ className: (0, clsx.clsx)("sidebar-badge", className),
1090
+ ...rest
1091
+ });
1092
+ }
1093
+ function SidebarCollapsible({ icon, label, trigger, children, className, open, defaultOpen, onOpenChange, ...rest }) {
1094
+ const isControlled = open !== void 0;
1095
+ const [internalOpen, setInternalOpen] = (0, react.useState)(defaultOpen ?? false);
1096
+ const isOpen = isControlled ? open : internalOpen;
1097
+ 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] });
1098
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
1099
+ className: (0, clsx.clsx)("sidebar-collapsible", className),
1100
+ open: isOpen,
1101
+ onToggle: (event) => {
1102
+ const next = event.currentTarget.open;
1103
+ if (!isControlled) setInternalOpen(next);
1104
+ onOpenChange?.(next);
1105
+ },
1106
+ ...rest,
1107
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", {
1108
+ className: "sidebar-collapsible-trigger",
1109
+ children: triggerContent
1110
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1111
+ className: "sidebar-collapsible-panel",
1112
+ children
1113
+ })]
1114
+ });
1115
+ }
1116
+ function SidebarSubItem({ active, icon, badge, className, children, ...rest }) {
1117
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("a", {
1118
+ className: (0, clsx.clsx)("sidebar-subitem", className),
1119
+ "aria-current": active ? "page" : void 0,
1120
+ ...rest,
1121
+ children: [
1122
+ icon != null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarIcon, { children: renderIcon(icon) }) : null,
1123
+ children,
1124
+ badge !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarBadge, { children: badge }) : null
1125
+ ]
1126
+ });
1127
+ }
1128
+ function SidebarFooter({ className, ...rest }) {
1129
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1130
+ className: (0, clsx.clsx)("sidebar-footer", className),
1131
+ ...rest
1132
+ });
1133
+ }
1134
+ function SidebarCollapseToggle({ label = "Toggle sidebar", className, children, ...rest }) {
1135
+ const ctx = (0, react.useContext)(SidebarContext);
1136
+ const controlledChecked = ctx?.collapsed;
1137
+ const isControlled = controlledChecked !== void 0;
1138
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
1139
+ className: (0, clsx.clsx)("sidebar-collapse-toggle", className),
1140
+ ...rest,
1141
+ children: [
1142
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
1143
+ type: "checkbox",
1144
+ className: "sidebar-toggle",
1145
+ "aria-label": label,
1146
+ ...isControlled ? { checked: controlledChecked } : { defaultChecked: ctx?.defaultCollapsed },
1147
+ onChange: (event) => ctx?.onCollapsedChange?.(event.currentTarget.checked)
1148
+ }),
1149
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1150
+ className: "sr-only",
1151
+ children: label
1152
+ }),
1153
+ children
1154
+ ]
1155
+ });
1156
+ }
1157
+ var Sidebar = Object.assign(SidebarRoot, {
1158
+ Header: SidebarHeader,
1159
+ Nav: SidebarNav,
1160
+ Group: SidebarGroup,
1161
+ GroupLabel: SidebarGroupLabel,
1162
+ Item: SidebarItem,
1163
+ Icon: SidebarIcon,
1164
+ Label: SidebarLabel,
1165
+ Badge: SidebarBadge,
1166
+ Collapsible: SidebarCollapsible,
1167
+ SubItem: SidebarSubItem,
1168
+ Footer: SidebarFooter,
1169
+ CollapseToggle: SidebarCollapseToggle
1170
+ });
1171
+ //#endregion
1172
+ exports.Accordion = Accordion;
1173
+ exports.AdminRoot = AdminRoot;
1174
+ exports.Alert = Alert;
1175
+ exports.AppShell = AppShell;
1176
+ exports.Badge = Badge;
1177
+ exports.BrandTile = BrandTile;
1178
+ exports.Breadcrumbs = Breadcrumbs;
95
1179
  exports.Button = Button;
1180
+ exports.ButtonGroup = ButtonGroup;
96
1181
  exports.Card = Card;
1182
+ exports.Checkbox = Checkbox;
97
1183
  exports.Field = Field;
1184
+ exports.FileInput = FileInput;
1185
+ exports.Footer = Footer;
98
1186
  exports.Input = Input;
1187
+ exports.InputGroup = InputGroup;
1188
+ exports.Menu = Menu;
1189
+ exports.Navbar = Navbar;
1190
+ exports.Pagination = Pagination;
1191
+ exports.Progress = Progress;
1192
+ exports.Radio = Radio;
1193
+ exports.RadioGroup = RadioGroup;
1194
+ exports.Select = Select;
1195
+ exports.Sidebar = Sidebar;
1196
+ exports.Spinner = Spinner;
1197
+ exports.Switch = Switch;
1198
+ exports.Table = Table;
1199
+ exports.Tabs = Tabs;
1200
+ exports.Textarea = Textarea;
1201
+ exports.getPaginationItems = getPaginationItems;
1202
+ exports.useAppShell = useAppShell;
99
1203
 
100
1204
  //# sourceMappingURL=index.cjs.map