@morze/ui 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.
package/dist/index.cjs ADDED
@@ -0,0 +1,3331 @@
1
+ "use client";
2
+ 'use strict';
3
+
4
+ var clsx = require('clsx');
5
+ var React39 = require('react');
6
+ var jsxRuntime = require('react/jsx-runtime');
7
+ var classVarianceAuthority = require('class-variance-authority');
8
+ var radixUi = require('radix-ui');
9
+
10
+ function _interopNamespace(e) {
11
+ if (e && e.__esModule) return e;
12
+ var n = Object.create(null);
13
+ if (e) {
14
+ Object.keys(e).forEach(function (k) {
15
+ if (k !== 'default') {
16
+ var d = Object.getOwnPropertyDescriptor(e, k);
17
+ Object.defineProperty(n, k, d.get ? d : {
18
+ enumerable: true,
19
+ get: function () { return e[k]; }
20
+ });
21
+ }
22
+ });
23
+ }
24
+ n.default = e;
25
+ return Object.freeze(n);
26
+ }
27
+
28
+ var React39__namespace = /*#__PURE__*/_interopNamespace(React39);
29
+
30
+ // src/lib/utils.ts
31
+ function cn(...inputs) {
32
+ return clsx.clsx(inputs);
33
+ }
34
+ var ThemeContext = React39__namespace.createContext(null);
35
+ function readStored(key) {
36
+ if (!key || typeof window === "undefined") return null;
37
+ try {
38
+ const stored = window.localStorage.getItem(key);
39
+ return stored === "dark" || stored === "light" || stored === "system" ? stored : null;
40
+ } catch {
41
+ return null;
42
+ }
43
+ }
44
+ function writeStored(key, theme) {
45
+ if (!key || typeof window === "undefined") return;
46
+ try {
47
+ window.localStorage.setItem(key, theme);
48
+ } catch {
49
+ }
50
+ }
51
+ function systemTheme() {
52
+ if (typeof window === "undefined" || !window.matchMedia) return "dark";
53
+ return window.matchMedia("(prefers-color-scheme: light)").matches ? "light" : "dark";
54
+ }
55
+ function MorzeThemeProvider({
56
+ children,
57
+ defaultTheme = "dark",
58
+ storageKey = "morze-ui-theme",
59
+ target = "html",
60
+ className
61
+ }) {
62
+ const [theme, setThemeState] = React39__namespace.useState(defaultTheme);
63
+ const [resolved, setResolved] = React39__namespace.useState(
64
+ defaultTheme === "system" ? "dark" : defaultTheme
65
+ );
66
+ React39__namespace.useEffect(() => {
67
+ const stored = readStored(storageKey);
68
+ if (stored) setThemeState(stored);
69
+ }, [storageKey]);
70
+ React39__namespace.useEffect(() => {
71
+ if (theme !== "system") {
72
+ setResolved(theme);
73
+ return;
74
+ }
75
+ setResolved(systemTheme());
76
+ const mql = window.matchMedia("(prefers-color-scheme: light)");
77
+ const onChange = () => setResolved(systemTheme());
78
+ mql.addEventListener("change", onChange);
79
+ return () => mql.removeEventListener("change", onChange);
80
+ }, [theme]);
81
+ React39__namespace.useEffect(() => {
82
+ if (target !== "html" || typeof document === "undefined") return;
83
+ document.documentElement.setAttribute("data-mz-theme", resolved);
84
+ }, [resolved, target]);
85
+ const setTheme = React39__namespace.useCallback(
86
+ (next) => {
87
+ setThemeState(next);
88
+ writeStored(storageKey, next);
89
+ },
90
+ [storageKey]
91
+ );
92
+ const value = React39__namespace.useMemo(
93
+ () => ({ theme, resolvedTheme: resolved, setTheme }),
94
+ [theme, resolved, setTheme]
95
+ );
96
+ return /* @__PURE__ */ jsxRuntime.jsx(ThemeContext.Provider, { value, children: /* @__PURE__ */ jsxRuntime.jsx(
97
+ "div",
98
+ {
99
+ "data-slot": "morze-root",
100
+ "data-mz-theme": target === "element" ? resolved : void 0,
101
+ className: ["mz-root", className].filter(Boolean).join(" "),
102
+ children
103
+ }
104
+ ) });
105
+ }
106
+ function useMorzeTheme() {
107
+ const context = React39__namespace.useContext(ThemeContext);
108
+ if (!context) {
109
+ throw new Error("useMorzeTheme must be used inside <MorzeThemeProvider>");
110
+ }
111
+ return context;
112
+ }
113
+ function icon(path, extra) {
114
+ return function Icon(props) {
115
+ return /* @__PURE__ */ jsxRuntime.jsx(
116
+ "svg",
117
+ {
118
+ xmlns: "http://www.w3.org/2000/svg",
119
+ viewBox: "0 0 24 24",
120
+ fill: "none",
121
+ stroke: "currentColor",
122
+ strokeWidth: 2,
123
+ strokeLinecap: "round",
124
+ strokeLinejoin: "round",
125
+ "aria-hidden": "true",
126
+ ...extra,
127
+ ...props,
128
+ children: path
129
+ }
130
+ );
131
+ };
132
+ }
133
+ var CheckIcon = icon(/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M20 6 9 17l-5-5" }));
134
+ var MinusIcon = icon(/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M5 12h14" }));
135
+ var XIcon = icon(/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M18 6 6 18M6 6l12 12" }));
136
+ var ChevronDownIcon = icon(/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m6 9 6 6 6-6" }));
137
+ var ChevronUpIcon = icon(/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m18 15-6-6-6 6" }));
138
+ var ChevronRightIcon = icon(/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m9 18 6-6-6-6" }));
139
+ var DotIcon = icon(/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "4", fill: "currentColor" }));
140
+ var SpinnerIcon = icon(
141
+ /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
142
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "9", opacity: "0.25" }),
143
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 12a9 9 0 0 0-9-9" })
144
+ ] })
145
+ );
146
+ var ChevronLeftIcon = icon(/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m15 18-6-6 6-6" }));
147
+ var ChevronsLeftIcon = icon(
148
+ /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
149
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m11 17-5-5 5-5" }),
150
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m18 17-5-5 5-5" })
151
+ ] })
152
+ );
153
+ var ChevronsRightIcon = icon(
154
+ /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
155
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m13 17 5-5-5-5" }),
156
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m6 17 5-5-5-5" })
157
+ ] })
158
+ );
159
+ var ArrowUpIcon = icon(/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 19V5m-7 7 7-7 7 7" }));
160
+ var ArrowDownIcon = icon(/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 5v14m7-7-7 7-7-7" }));
161
+ var SortIcon = icon(
162
+ /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
163
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m7 15 3 3 3-3", opacity: "0.9" }),
164
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m7 9 3-3 3 3", opacity: "0.9" })
165
+ ] })
166
+ );
167
+ var FilterIcon = icon(/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4 5h16l-6.5 7.5V19l-3 2v-8.5L4 5Z" }));
168
+ var ColumnsIcon = icon(
169
+ /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
170
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "3", y: "4", width: "18", height: "16", rx: "2" }),
171
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9 4v16M15 4v16" })
172
+ ] })
173
+ );
174
+ var GripIcon = icon(
175
+ /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
176
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "9", cy: "7", r: "1.4", fill: "currentColor" }),
177
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "9", cy: "12", r: "1.4", fill: "currentColor" }),
178
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "9", cy: "17", r: "1.4", fill: "currentColor" }),
179
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "15", cy: "7", r: "1.4", fill: "currentColor" }),
180
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "15", cy: "12", r: "1.4", fill: "currentColor" }),
181
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "15", cy: "17", r: "1.4", fill: "currentColor" })
182
+ ] })
183
+ );
184
+ var PinIcon = icon(/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M15 3 21 9l-4 1-4 4-1 5-6-6 5-1 4-4 1-4Z" }));
185
+ var EyeIcon = icon(
186
+ /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
187
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7Z" }),
188
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "3" })
189
+ ] })
190
+ );
191
+ var EyeOffIcon = icon(
192
+ /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
193
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10.6 5.2A9.8 9.8 0 0 1 12 5c6.5 0 10 7 10 7a17 17 0 0 1-3 3.9M6.2 6.2A17 17 0 0 0 2 12s3.5 7 10 7c1.9 0 3.5-.6 4.9-1.4" }),
194
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m3 3 18 18" })
195
+ ] })
196
+ );
197
+ var InboxIcon = icon(
198
+ /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
199
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3 12h5l2 3h4l2-3h5" }),
200
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M5.5 5h13l2.5 7v5a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-5l2.5-7Z" })
201
+ ] })
202
+ );
203
+ var AlertIcon = icon(
204
+ /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
205
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 9v4M12 17h.01" }),
206
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10.3 3.9 2.6 17a2 2 0 0 0 1.7 3h15.4a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0Z" })
207
+ ] })
208
+ );
209
+ var buttonVariants = classVarianceAuthority.cva("mz-btn mz-focusable", {
210
+ variants: {
211
+ variant: {
212
+ primary: "mz-btn--primary",
213
+ secondary: "mz-btn--secondary",
214
+ outline: "mz-btn--outline",
215
+ ghost: "mz-btn--ghost",
216
+ destructive: "mz-btn--destructive",
217
+ link: "mz-btn--link"
218
+ },
219
+ size: {
220
+ xs: "mz-btn--xs",
221
+ sm: "mz-btn--sm",
222
+ md: "mz-btn--md",
223
+ lg: "mz-btn--lg",
224
+ "icon-xs": "mz-btn--icon-xs",
225
+ "icon-sm": "mz-btn--icon-sm",
226
+ icon: "mz-btn--icon",
227
+ "icon-lg": "mz-btn--icon-lg"
228
+ }
229
+ },
230
+ defaultVariants: {
231
+ variant: "primary",
232
+ size: "md"
233
+ }
234
+ });
235
+ function Button({
236
+ className,
237
+ variant = "primary",
238
+ size = "md",
239
+ asChild = false,
240
+ tone,
241
+ loading = false,
242
+ dot = false,
243
+ disabled,
244
+ children,
245
+ ...props
246
+ }) {
247
+ const Comp = asChild ? radixUi.Slot.Root : "button";
248
+ const isDisabled = disabled || loading;
249
+ const decorate = (label) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
250
+ dot ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mz-btn__dot", "aria-hidden": "true" }) : null,
251
+ label,
252
+ loading ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mz-btn__spinner", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(SpinnerIcon, {}) }) : null
253
+ ] });
254
+ let content;
255
+ if (asChild) {
256
+ const child = React39__namespace.Children.only(children);
257
+ content = React39__namespace.cloneElement(child, void 0, decorate(child.props.children));
258
+ } else {
259
+ content = decorate(children);
260
+ }
261
+ return /* @__PURE__ */ jsxRuntime.jsx(
262
+ Comp,
263
+ {
264
+ "data-slot": "button",
265
+ "data-variant": variant,
266
+ "data-size": size,
267
+ "data-tone": tone,
268
+ "data-loading": loading || void 0,
269
+ className: cn(buttonVariants({ variant, size }), className),
270
+ disabled: asChild ? void 0 : isDisabled,
271
+ "aria-disabled": asChild && isDisabled ? true : void 0,
272
+ "aria-busy": loading || void 0,
273
+ ...props,
274
+ children: content
275
+ }
276
+ );
277
+ }
278
+ var badgeVariants = classVarianceAuthority.cva("mz-badge", {
279
+ variants: {
280
+ variant: {
281
+ solid: "mz-badge--solid",
282
+ soft: "mz-badge--soft",
283
+ outline: "mz-badge--outline"
284
+ }
285
+ },
286
+ defaultVariants: {
287
+ variant: "solid"
288
+ }
289
+ });
290
+ function Badge({
291
+ className,
292
+ variant = "solid",
293
+ tone,
294
+ dot = false,
295
+ asChild = false,
296
+ children,
297
+ ...props
298
+ }) {
299
+ const Comp = asChild ? radixUi.Slot.Root : "span";
300
+ return /* @__PURE__ */ jsxRuntime.jsx(
301
+ Comp,
302
+ {
303
+ "data-slot": "badge",
304
+ "data-variant": variant,
305
+ "data-tone": tone,
306
+ className: cn(badgeVariants({ variant }), className),
307
+ ...props,
308
+ children: asChild ? children : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
309
+ dot ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mz-badge__dot", "aria-hidden": "true" }) : null,
310
+ children
311
+ ] })
312
+ }
313
+ );
314
+ }
315
+ var toggleVariants = classVarianceAuthority.cva("mz-toggle", {
316
+ variants: {
317
+ variant: {
318
+ default: "",
319
+ outline: "mz-toggle--outline"
320
+ },
321
+ size: {
322
+ sm: "mz-toggle--sm",
323
+ md: "mz-toggle--md",
324
+ lg: "mz-toggle--lg"
325
+ }
326
+ },
327
+ defaultVariants: {
328
+ variant: "default",
329
+ size: "md"
330
+ }
331
+ });
332
+ function Toggle({
333
+ className,
334
+ variant = "default",
335
+ size = "md",
336
+ tone,
337
+ ...props
338
+ }) {
339
+ return /* @__PURE__ */ jsxRuntime.jsx(
340
+ radixUi.Toggle.Root,
341
+ {
342
+ "data-slot": "toggle",
343
+ "data-variant": variant,
344
+ "data-size": size,
345
+ "data-tone": tone,
346
+ className: cn(toggleVariants({ variant, size }), "mz-focusable", className),
347
+ ...props
348
+ }
349
+ );
350
+ }
351
+ var ToggleGroupContext = React39__namespace.createContext({
352
+ size: "md",
353
+ variant: "default"
354
+ });
355
+ function ToggleGroup({
356
+ className,
357
+ variant = "default",
358
+ size = "md",
359
+ tone,
360
+ appearance = "segmented",
361
+ style,
362
+ children,
363
+ ...props
364
+ }) {
365
+ return /* @__PURE__ */ jsxRuntime.jsx(
366
+ radixUi.ToggleGroup.Root,
367
+ {
368
+ "data-slot": "toggle-group",
369
+ "data-variant": variant,
370
+ "data-size": size,
371
+ "data-tone": tone,
372
+ "data-appearance": appearance,
373
+ className: cn(
374
+ "mz-toggle-group",
375
+ appearance === "segmented" && "mz-toggle-group--segmented",
376
+ appearance === "joined" && "mz-toggle-group--joined",
377
+ className
378
+ ),
379
+ style: appearance === "spaced" ? { "--mz-toggle-group-gap": "8px", ...style } : style,
380
+ ...props,
381
+ children: /* @__PURE__ */ jsxRuntime.jsx(ToggleGroupContext.Provider, { value: { variant, size, tone }, children })
382
+ }
383
+ );
384
+ }
385
+ function ToggleGroupItem({
386
+ className,
387
+ children,
388
+ variant,
389
+ size,
390
+ ...props
391
+ }) {
392
+ const context = React39__namespace.useContext(ToggleGroupContext);
393
+ const resolvedVariant = variant ?? context.variant;
394
+ const resolvedSize = size ?? context.size;
395
+ return /* @__PURE__ */ jsxRuntime.jsx(
396
+ radixUi.ToggleGroup.Item,
397
+ {
398
+ "data-slot": "toggle-group-item",
399
+ "data-variant": resolvedVariant,
400
+ "data-size": resolvedSize,
401
+ "data-tone": context.tone,
402
+ className: cn(
403
+ toggleVariants({ variant: resolvedVariant, size: resolvedSize }),
404
+ "mz-focusable",
405
+ className
406
+ ),
407
+ ...props,
408
+ children
409
+ }
410
+ );
411
+ }
412
+ function Checkbox({ className, size = "md", tone, ...props }) {
413
+ return /* @__PURE__ */ jsxRuntime.jsx(
414
+ radixUi.Checkbox.Root,
415
+ {
416
+ "data-slot": "checkbox",
417
+ "data-size": size,
418
+ "data-tone": tone,
419
+ className: cn(
420
+ "mz-checkbox mz-focusable",
421
+ size === "sm" && "mz-checkbox--sm",
422
+ size === "lg" && "mz-checkbox--lg",
423
+ className
424
+ ),
425
+ ...props,
426
+ children: /* @__PURE__ */ jsxRuntime.jsxs(radixUi.Checkbox.Indicator, { "data-slot": "checkbox-indicator", className: "mz-checkbox__indicator", children: [
427
+ /* @__PURE__ */ jsxRuntime.jsx(CheckIcon, { className: "mz-checkbox__check" }),
428
+ /* @__PURE__ */ jsxRuntime.jsx(MinusIcon, { className: "mz-checkbox__dash" })
429
+ ] })
430
+ }
431
+ );
432
+ }
433
+ function RadioGroup({
434
+ className,
435
+ ...props
436
+ }) {
437
+ return /* @__PURE__ */ jsxRuntime.jsx(
438
+ radixUi.RadioGroup.Root,
439
+ {
440
+ "data-slot": "radio-group",
441
+ className: cn("mz-radio-group", className),
442
+ ...props
443
+ }
444
+ );
445
+ }
446
+ function RadioGroupItem({
447
+ className,
448
+ tone,
449
+ ...props
450
+ }) {
451
+ return /* @__PURE__ */ jsxRuntime.jsx(
452
+ radixUi.RadioGroup.Item,
453
+ {
454
+ "data-slot": "radio-group-item",
455
+ "data-tone": tone,
456
+ className: cn("mz-radio mz-focusable", className),
457
+ ...props,
458
+ children: /* @__PURE__ */ jsxRuntime.jsx(
459
+ radixUi.RadioGroup.Indicator,
460
+ {
461
+ "data-slot": "radio-group-indicator",
462
+ className: "mz-radio__indicator"
463
+ }
464
+ )
465
+ }
466
+ );
467
+ }
468
+ function Switch({ className, size = "md", tone, ...props }) {
469
+ return /* @__PURE__ */ jsxRuntime.jsx(
470
+ radixUi.Switch.Root,
471
+ {
472
+ "data-slot": "switch",
473
+ "data-size": size,
474
+ "data-tone": tone,
475
+ className: cn(
476
+ "mz-switch mz-focusable",
477
+ size === "sm" && "mz-switch--sm",
478
+ size === "lg" && "mz-switch--lg",
479
+ className
480
+ ),
481
+ ...props,
482
+ children: /* @__PURE__ */ jsxRuntime.jsx(radixUi.Switch.Thumb, { "data-slot": "switch-thumb", className: "mz-switch__thumb" })
483
+ }
484
+ );
485
+ }
486
+ function Slider({
487
+ className,
488
+ defaultValue,
489
+ value,
490
+ min = 0,
491
+ max = 100,
492
+ tone,
493
+ ...props
494
+ }) {
495
+ const values = React39__namespace.useMemo(
496
+ () => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min],
497
+ [value, defaultValue, min]
498
+ );
499
+ return /* @__PURE__ */ jsxRuntime.jsxs(
500
+ radixUi.Slider.Root,
501
+ {
502
+ "data-slot": "slider",
503
+ "data-tone": tone,
504
+ defaultValue,
505
+ value,
506
+ min,
507
+ max,
508
+ className: cn("mz-slider", className),
509
+ ...props,
510
+ children: [
511
+ /* @__PURE__ */ jsxRuntime.jsx(radixUi.Slider.Track, { "data-slot": "slider-track", className: "mz-slider__track", children: /* @__PURE__ */ jsxRuntime.jsx(radixUi.Slider.Range, { "data-slot": "slider-range", className: "mz-slider__range" }) }),
512
+ Array.from({ length: values.length }, (_, index) => /* @__PURE__ */ jsxRuntime.jsx(
513
+ radixUi.Slider.Thumb,
514
+ {
515
+ "data-slot": "slider-thumb",
516
+ className: "mz-slider__thumb mz-focusable"
517
+ },
518
+ index
519
+ ))
520
+ ]
521
+ }
522
+ );
523
+ }
524
+ function Input({ className, type, inputSize = "md", ...props }) {
525
+ return /* @__PURE__ */ jsxRuntime.jsx(
526
+ "input",
527
+ {
528
+ type,
529
+ "data-slot": "input",
530
+ "data-size": inputSize,
531
+ className: cn(
532
+ "mz-input",
533
+ inputSize === "sm" && "mz-input--sm",
534
+ inputSize === "lg" && "mz-input--lg",
535
+ className
536
+ ),
537
+ ...props
538
+ }
539
+ );
540
+ }
541
+ function Textarea({ className, ...props }) {
542
+ return /* @__PURE__ */ jsxRuntime.jsx("textarea", { "data-slot": "textarea", className: cn("mz-textarea", className), ...props });
543
+ }
544
+ function Label({ className, ...props }) {
545
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Label.Root, { "data-slot": "label", className: cn("mz-label", className), ...props });
546
+ }
547
+ function Field({ className, ...props }) {
548
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "field", className: cn("mz-field", className), ...props });
549
+ }
550
+ function FieldHint({ className, ...props }) {
551
+ return /* @__PURE__ */ jsxRuntime.jsx("p", { "data-slot": "field-hint", className: cn("mz-field__hint", className), ...props });
552
+ }
553
+ function FieldError({ className, ...props }) {
554
+ return /* @__PURE__ */ jsxRuntime.jsx(
555
+ "p",
556
+ {
557
+ "data-slot": "field-error",
558
+ role: "alert",
559
+ className: cn("mz-field__error", className),
560
+ ...props
561
+ }
562
+ );
563
+ }
564
+ function Select({ ...props }) {
565
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Select.Root, { "data-slot": "select", ...props });
566
+ }
567
+ function SelectGroup({ ...props }) {
568
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Select.Group, { "data-slot": "select-group", ...props });
569
+ }
570
+ function SelectValue({ ...props }) {
571
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Select.Value, { "data-slot": "select-value", ...props });
572
+ }
573
+ function SelectTrigger({
574
+ className,
575
+ size = "md",
576
+ tone,
577
+ children,
578
+ ...props
579
+ }) {
580
+ return /* @__PURE__ */ jsxRuntime.jsxs(
581
+ radixUi.Select.Trigger,
582
+ {
583
+ "data-slot": "select-trigger",
584
+ "data-size": size,
585
+ "data-tone": tone,
586
+ className: cn(
587
+ "mz-select-trigger mz-focusable",
588
+ size === "sm" && "mz-select-trigger--sm",
589
+ className
590
+ ),
591
+ ...props,
592
+ children: [
593
+ children,
594
+ /* @__PURE__ */ jsxRuntime.jsx(radixUi.Select.Icon, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ChevronDownIcon, { className: "mz-select-trigger__icon" }) })
595
+ ]
596
+ }
597
+ );
598
+ }
599
+ function SelectContent({
600
+ className,
601
+ children,
602
+ position = "popper",
603
+ ...props
604
+ }) {
605
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Select.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
606
+ radixUi.Select.Content,
607
+ {
608
+ "data-slot": "select-content",
609
+ className: cn(
610
+ "mz-panel mz-select-content",
611
+ position === "popper" && "mz-select-content--popper",
612
+ className
613
+ ),
614
+ position,
615
+ ...props,
616
+ children: [
617
+ /* @__PURE__ */ jsxRuntime.jsx(SelectScrollUpButton, {}),
618
+ /* @__PURE__ */ jsxRuntime.jsx(
619
+ radixUi.Select.Viewport,
620
+ {
621
+ className: cn(
622
+ "mz-select-viewport",
623
+ position === "popper" && "mz-select-viewport--popper"
624
+ ),
625
+ children
626
+ }
627
+ ),
628
+ /* @__PURE__ */ jsxRuntime.jsx(SelectScrollDownButton, {})
629
+ ]
630
+ }
631
+ ) });
632
+ }
633
+ function SelectLabel({ className, ...props }) {
634
+ return /* @__PURE__ */ jsxRuntime.jsx(
635
+ radixUi.Select.Label,
636
+ {
637
+ "data-slot": "select-label",
638
+ className: cn("mz-menu-label", className),
639
+ ...props
640
+ }
641
+ );
642
+ }
643
+ function SelectItem({
644
+ className,
645
+ children,
646
+ ...props
647
+ }) {
648
+ return /* @__PURE__ */ jsxRuntime.jsxs(radixUi.Select.Item, { "data-slot": "select-item", className: cn("mz-item", className), ...props, children: [
649
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mz-item__indicator", children: /* @__PURE__ */ jsxRuntime.jsx(radixUi.Select.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(CheckIcon, {}) }) }),
650
+ /* @__PURE__ */ jsxRuntime.jsx(radixUi.Select.ItemText, { children })
651
+ ] });
652
+ }
653
+ function SelectSeparator({
654
+ className,
655
+ ...props
656
+ }) {
657
+ return /* @__PURE__ */ jsxRuntime.jsx(
658
+ radixUi.Select.Separator,
659
+ {
660
+ "data-slot": "select-separator",
661
+ className: cn("mz-menu-separator", className),
662
+ ...props
663
+ }
664
+ );
665
+ }
666
+ function SelectScrollUpButton({
667
+ className,
668
+ ...props
669
+ }) {
670
+ return /* @__PURE__ */ jsxRuntime.jsx(
671
+ radixUi.Select.ScrollUpButton,
672
+ {
673
+ "data-slot": "select-scroll-up-button",
674
+ className: cn("mz-select-scroll-button", className),
675
+ ...props,
676
+ children: /* @__PURE__ */ jsxRuntime.jsx(ChevronUpIcon, { width: 16, height: 16 })
677
+ }
678
+ );
679
+ }
680
+ function SelectScrollDownButton({
681
+ className,
682
+ ...props
683
+ }) {
684
+ return /* @__PURE__ */ jsxRuntime.jsx(
685
+ radixUi.Select.ScrollDownButton,
686
+ {
687
+ "data-slot": "select-scroll-down-button",
688
+ className: cn("mz-select-scroll-button", className),
689
+ ...props,
690
+ children: /* @__PURE__ */ jsxRuntime.jsx(ChevronDownIcon, { width: 16, height: 16 })
691
+ }
692
+ );
693
+ }
694
+ function Tabs({ className, ...props }) {
695
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Tabs.Root, { "data-slot": "tabs", className: cn("mz-tabs", className), ...props });
696
+ }
697
+ function TabsList({
698
+ className,
699
+ variant = "default",
700
+ tone,
701
+ ...props
702
+ }) {
703
+ return /* @__PURE__ */ jsxRuntime.jsx(
704
+ radixUi.Tabs.List,
705
+ {
706
+ "data-slot": "tabs-list",
707
+ "data-variant": variant,
708
+ "data-tone": tone,
709
+ className: cn("mz-tabs-list", variant === "line" && "mz-tabs-list--line", className),
710
+ ...props
711
+ }
712
+ );
713
+ }
714
+ function TabsTrigger({ className, ...props }) {
715
+ return /* @__PURE__ */ jsxRuntime.jsx(
716
+ radixUi.Tabs.Trigger,
717
+ {
718
+ "data-slot": "tabs-trigger",
719
+ className: cn("mz-tabs-trigger mz-focusable", className),
720
+ ...props
721
+ }
722
+ );
723
+ }
724
+ function TabsContent({ className, ...props }) {
725
+ return /* @__PURE__ */ jsxRuntime.jsx(
726
+ radixUi.Tabs.Content,
727
+ {
728
+ "data-slot": "tabs-content",
729
+ className: cn("mz-tabs-content", className),
730
+ ...props
731
+ }
732
+ );
733
+ }
734
+ function Card({
735
+ className,
736
+ interactive = false,
737
+ onClick,
738
+ onKeyDown,
739
+ ...props
740
+ }) {
741
+ const clickable = interactive && Boolean(onClick);
742
+ const handleKeyDown = clickable ? (event) => {
743
+ onKeyDown?.(event);
744
+ if (event.defaultPrevented) return;
745
+ if (event.key === "Enter" || event.key === " ") {
746
+ event.preventDefault();
747
+ event.currentTarget.click();
748
+ }
749
+ } : onKeyDown;
750
+ return /* @__PURE__ */ jsxRuntime.jsx(
751
+ "div",
752
+ {
753
+ "data-slot": "card",
754
+ role: clickable ? "button" : void 0,
755
+ tabIndex: clickable ? 0 : void 0,
756
+ className: cn(
757
+ "mz-card",
758
+ interactive && "mz-card--interactive",
759
+ clickable && "mz-focusable",
760
+ className
761
+ ),
762
+ onClick,
763
+ onKeyDown: handleKeyDown,
764
+ ...props
765
+ }
766
+ );
767
+ }
768
+ function CardHeader({ className, ...props }) {
769
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "card-header", className: cn("mz-card-header", className), ...props });
770
+ }
771
+ function CardTitle({ className, ...props }) {
772
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "card-title", className: cn("mz-card-title", className), ...props });
773
+ }
774
+ function CardDescription({ className, ...props }) {
775
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "card-description", className: cn("mz-card-description", className), ...props });
776
+ }
777
+ function CardAction({ className, ...props }) {
778
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "card-action", className: cn("mz-card-action", className), ...props });
779
+ }
780
+ function CardContent({ className, ...props }) {
781
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "card-content", className: cn("mz-card-content", className), ...props });
782
+ }
783
+ function CardFooter({ className, ...props }) {
784
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "card-footer", className: cn("mz-card-footer", className), ...props });
785
+ }
786
+ function Alert({
787
+ className,
788
+ tone = "primary",
789
+ ...props
790
+ }) {
791
+ return /* @__PURE__ */ jsxRuntime.jsx(
792
+ "div",
793
+ {
794
+ "data-slot": "alert",
795
+ "data-tone": tone,
796
+ role: "alert",
797
+ className: cn("mz-alert", className),
798
+ ...props
799
+ }
800
+ );
801
+ }
802
+ function AlertTitle({ className, ...props }) {
803
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "alert-title", className: cn("mz-alert-title", className), ...props });
804
+ }
805
+ function AlertDescription({ className, ...props }) {
806
+ return /* @__PURE__ */ jsxRuntime.jsx(
807
+ "div",
808
+ {
809
+ "data-slot": "alert-description",
810
+ className: cn("mz-alert-description", className),
811
+ ...props
812
+ }
813
+ );
814
+ }
815
+ function Accordion({ className, ...props }) {
816
+ return /* @__PURE__ */ jsxRuntime.jsx(
817
+ radixUi.Accordion.Root,
818
+ {
819
+ "data-slot": "accordion",
820
+ className: cn("mz-accordion", className),
821
+ ...props
822
+ }
823
+ );
824
+ }
825
+ function AccordionItem({
826
+ className,
827
+ ...props
828
+ }) {
829
+ return /* @__PURE__ */ jsxRuntime.jsx(
830
+ radixUi.Accordion.Item,
831
+ {
832
+ "data-slot": "accordion-item",
833
+ className: cn("mz-accordion-item", className),
834
+ ...props
835
+ }
836
+ );
837
+ }
838
+ function AccordionTrigger({
839
+ className,
840
+ children,
841
+ ...props
842
+ }) {
843
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Accordion.Header, { className: "mz-accordion-header", children: /* @__PURE__ */ jsxRuntime.jsxs(
844
+ radixUi.Accordion.Trigger,
845
+ {
846
+ "data-slot": "accordion-trigger",
847
+ className: cn("mz-accordion-trigger mz-focusable", className),
848
+ ...props,
849
+ children: [
850
+ children,
851
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mz-accordion-trigger__icon", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(ChevronDownIcon, {}) })
852
+ ]
853
+ }
854
+ ) });
855
+ }
856
+ function AccordionContent({
857
+ className,
858
+ children,
859
+ ...props
860
+ }) {
861
+ return /* @__PURE__ */ jsxRuntime.jsx(
862
+ radixUi.Accordion.Content,
863
+ {
864
+ "data-slot": "accordion-content",
865
+ className: cn("mz-accordion-content", className),
866
+ ...props,
867
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mz-accordion-content__inner", children })
868
+ }
869
+ );
870
+ }
871
+ function Progress({
872
+ className,
873
+ value,
874
+ max = 100,
875
+ tone,
876
+ ...props
877
+ }) {
878
+ const percent = max > 0 ? Math.min(Math.max(value ?? 0, 0), max) / max * 100 : 0;
879
+ return /* @__PURE__ */ jsxRuntime.jsx(
880
+ radixUi.Progress.Root,
881
+ {
882
+ "data-slot": "progress",
883
+ "data-tone": tone,
884
+ value,
885
+ max,
886
+ className: cn("mz-progress", className),
887
+ ...props,
888
+ children: /* @__PURE__ */ jsxRuntime.jsx(
889
+ radixUi.Progress.Indicator,
890
+ {
891
+ "data-slot": "progress-indicator",
892
+ className: "mz-progress__indicator",
893
+ style: { transform: `translateX(-${100 - percent}%)` }
894
+ }
895
+ )
896
+ }
897
+ );
898
+ }
899
+ function Avatar({
900
+ className,
901
+ size = "md",
902
+ ...props
903
+ }) {
904
+ return /* @__PURE__ */ jsxRuntime.jsx(
905
+ radixUi.Avatar.Root,
906
+ {
907
+ "data-slot": "avatar",
908
+ "data-size": size,
909
+ className: cn(
910
+ "mz-avatar",
911
+ size === "sm" && "mz-avatar--sm",
912
+ size === "lg" && "mz-avatar--lg",
913
+ className
914
+ ),
915
+ ...props
916
+ }
917
+ );
918
+ }
919
+ function AvatarImage({ className, ...props }) {
920
+ return /* @__PURE__ */ jsxRuntime.jsx(
921
+ radixUi.Avatar.Image,
922
+ {
923
+ "data-slot": "avatar-image",
924
+ className: cn("mz-avatar__image", className),
925
+ ...props
926
+ }
927
+ );
928
+ }
929
+ function AvatarFallback({
930
+ className,
931
+ ...props
932
+ }) {
933
+ return /* @__PURE__ */ jsxRuntime.jsx(
934
+ radixUi.Avatar.Fallback,
935
+ {
936
+ "data-slot": "avatar-fallback",
937
+ className: cn("mz-avatar__fallback", className),
938
+ ...props
939
+ }
940
+ );
941
+ }
942
+ function Separator({
943
+ className,
944
+ orientation = "horizontal",
945
+ decorative = true,
946
+ ...props
947
+ }) {
948
+ return /* @__PURE__ */ jsxRuntime.jsx(
949
+ radixUi.Separator.Root,
950
+ {
951
+ "data-slot": "separator",
952
+ decorative,
953
+ orientation,
954
+ className: cn("mz-separator", className),
955
+ ...props
956
+ }
957
+ );
958
+ }
959
+ function Skeleton({ className, ...props }) {
960
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "skeleton", className: cn("mz-skeleton", className), ...props });
961
+ }
962
+ function Spinner({ className, label = "Loading", children, ...props }) {
963
+ return /* @__PURE__ */ jsxRuntime.jsxs(
964
+ "span",
965
+ {
966
+ "data-slot": "spinner",
967
+ role: label === null ? void 0 : "status",
968
+ "aria-hidden": label === null ? true : void 0,
969
+ className: cn("mz-spinner", className),
970
+ ...props,
971
+ children: [
972
+ /* @__PURE__ */ jsxRuntime.jsx(SpinnerIcon, {}),
973
+ label === null ? null : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mz-sr-only", children: label }),
974
+ children
975
+ ]
976
+ }
977
+ );
978
+ }
979
+ function Dialog({ ...props }) {
980
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Dialog.Root, { "data-slot": "dialog", ...props });
981
+ }
982
+ function DialogTrigger({ ...props }) {
983
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Dialog.Trigger, { "data-slot": "dialog-trigger", ...props });
984
+ }
985
+ function DialogPortal({ ...props }) {
986
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Dialog.Portal, { "data-slot": "dialog-portal", ...props });
987
+ }
988
+ function DialogClose({ ...props }) {
989
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Dialog.Close, { "data-slot": "dialog-close", ...props });
990
+ }
991
+ function DialogOverlay({
992
+ className,
993
+ ...props
994
+ }) {
995
+ return /* @__PURE__ */ jsxRuntime.jsx(
996
+ radixUi.Dialog.Overlay,
997
+ {
998
+ "data-slot": "dialog-overlay",
999
+ className: cn("mz-dialog-overlay", className),
1000
+ ...props
1001
+ }
1002
+ );
1003
+ }
1004
+ function DialogContent({
1005
+ className,
1006
+ children,
1007
+ showCloseButton = true,
1008
+ closeLabel = "Close",
1009
+ ...props
1010
+ }) {
1011
+ return /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal, { children: [
1012
+ /* @__PURE__ */ jsxRuntime.jsx(DialogOverlay, {}),
1013
+ /* @__PURE__ */ jsxRuntime.jsxs(
1014
+ radixUi.Dialog.Content,
1015
+ {
1016
+ "data-slot": "dialog-content",
1017
+ className: cn("mz-panel mz-dialog-content", className),
1018
+ ...props,
1019
+ children: [
1020
+ children,
1021
+ showCloseButton ? /* @__PURE__ */ jsxRuntime.jsxs(radixUi.Dialog.Close, { "data-slot": "dialog-close", className: "mz-dialog-close mz-focusable", children: [
1022
+ /* @__PURE__ */ jsxRuntime.jsx(XIcon, {}),
1023
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mz-sr-only", children: closeLabel })
1024
+ ] }) : null
1025
+ ]
1026
+ }
1027
+ )
1028
+ ] });
1029
+ }
1030
+ function DialogHeader({ className, ...props }) {
1031
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "dialog-header", className: cn("mz-dialog-header", className), ...props });
1032
+ }
1033
+ function DialogFooter({ className, ...props }) {
1034
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "dialog-footer", className: cn("mz-dialog-footer", className), ...props });
1035
+ }
1036
+ function DialogTitle({ className, ...props }) {
1037
+ return /* @__PURE__ */ jsxRuntime.jsx(
1038
+ radixUi.Dialog.Title,
1039
+ {
1040
+ "data-slot": "dialog-title",
1041
+ className: cn("mz-dialog-title", className),
1042
+ ...props
1043
+ }
1044
+ );
1045
+ }
1046
+ function DialogDescription({
1047
+ className,
1048
+ ...props
1049
+ }) {
1050
+ return /* @__PURE__ */ jsxRuntime.jsx(
1051
+ radixUi.Dialog.Description,
1052
+ {
1053
+ "data-slot": "dialog-description",
1054
+ className: cn("mz-dialog-description", className),
1055
+ ...props
1056
+ }
1057
+ );
1058
+ }
1059
+ function Popover({ ...props }) {
1060
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Popover.Root, { "data-slot": "popover", ...props });
1061
+ }
1062
+ function PopoverTrigger({ ...props }) {
1063
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Popover.Trigger, { "data-slot": "popover-trigger", ...props });
1064
+ }
1065
+ function PopoverAnchor({ ...props }) {
1066
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Popover.Anchor, { "data-slot": "popover-anchor", ...props });
1067
+ }
1068
+ function PopoverContent({
1069
+ className,
1070
+ align = "center",
1071
+ sideOffset = 6,
1072
+ ...props
1073
+ }) {
1074
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Popover.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
1075
+ radixUi.Popover.Content,
1076
+ {
1077
+ "data-slot": "popover-content",
1078
+ align,
1079
+ sideOffset,
1080
+ className: cn("mz-panel mz-popover-content", className),
1081
+ ...props
1082
+ }
1083
+ ) });
1084
+ }
1085
+ function PopoverHeader({ className, ...props }) {
1086
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "popover-header", className: cn("mz-popover-header", className), ...props });
1087
+ }
1088
+ function PopoverTitle({ className, ...props }) {
1089
+ return /* @__PURE__ */ jsxRuntime.jsx("h2", { "data-slot": "popover-title", className: cn("mz-popover-title", className), ...props });
1090
+ }
1091
+ function PopoverDescription({ className, ...props }) {
1092
+ return /* @__PURE__ */ jsxRuntime.jsx(
1093
+ "p",
1094
+ {
1095
+ "data-slot": "popover-description",
1096
+ className: cn("mz-popover-description", className),
1097
+ ...props
1098
+ }
1099
+ );
1100
+ }
1101
+ function DropdownMenu({ ...props }) {
1102
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.DropdownMenu.Root, { "data-slot": "dropdown-menu", ...props });
1103
+ }
1104
+ function DropdownMenuPortal({ ...props }) {
1105
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.DropdownMenu.Portal, { "data-slot": "dropdown-menu-portal", ...props });
1106
+ }
1107
+ function DropdownMenuTrigger({
1108
+ ...props
1109
+ }) {
1110
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.DropdownMenu.Trigger, { "data-slot": "dropdown-menu-trigger", ...props });
1111
+ }
1112
+ function DropdownMenuContent({
1113
+ className,
1114
+ sideOffset = 6,
1115
+ ...props
1116
+ }) {
1117
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.DropdownMenu.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
1118
+ radixUi.DropdownMenu.Content,
1119
+ {
1120
+ "data-slot": "dropdown-menu-content",
1121
+ sideOffset,
1122
+ className: cn("mz-panel mz-menu-content", className),
1123
+ ...props
1124
+ }
1125
+ ) });
1126
+ }
1127
+ function DropdownMenuGroup({ ...props }) {
1128
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.DropdownMenu.Group, { "data-slot": "dropdown-menu-group", ...props });
1129
+ }
1130
+ function DropdownMenuItem({
1131
+ className,
1132
+ inset,
1133
+ variant = "default",
1134
+ ...props
1135
+ }) {
1136
+ return /* @__PURE__ */ jsxRuntime.jsx(
1137
+ radixUi.DropdownMenu.Item,
1138
+ {
1139
+ "data-slot": "dropdown-menu-item",
1140
+ "data-inset": inset,
1141
+ "data-variant": variant,
1142
+ className: cn(
1143
+ "mz-item",
1144
+ inset ? "mz-item--inset" : "mz-item--plain",
1145
+ variant === "destructive" && "mz-item--destructive",
1146
+ className
1147
+ ),
1148
+ ...props
1149
+ }
1150
+ );
1151
+ }
1152
+ function DropdownMenuCheckboxItem({
1153
+ className,
1154
+ children,
1155
+ checked,
1156
+ ...props
1157
+ }) {
1158
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1159
+ radixUi.DropdownMenu.CheckboxItem,
1160
+ {
1161
+ "data-slot": "dropdown-menu-checkbox-item",
1162
+ className: cn("mz-item", className),
1163
+ checked,
1164
+ ...props,
1165
+ children: [
1166
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mz-item__indicator", children: /* @__PURE__ */ jsxRuntime.jsx(radixUi.DropdownMenu.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(CheckIcon, {}) }) }),
1167
+ children
1168
+ ]
1169
+ }
1170
+ );
1171
+ }
1172
+ function DropdownMenuRadioGroup({
1173
+ ...props
1174
+ }) {
1175
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.DropdownMenu.RadioGroup, { "data-slot": "dropdown-menu-radio-group", ...props });
1176
+ }
1177
+ function DropdownMenuRadioItem({
1178
+ className,
1179
+ children,
1180
+ ...props
1181
+ }) {
1182
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1183
+ radixUi.DropdownMenu.RadioItem,
1184
+ {
1185
+ "data-slot": "dropdown-menu-radio-item",
1186
+ className: cn("mz-item", className),
1187
+ ...props,
1188
+ children: [
1189
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mz-item__indicator", children: /* @__PURE__ */ jsxRuntime.jsx(radixUi.DropdownMenu.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(DotIcon, {}) }) }),
1190
+ children
1191
+ ]
1192
+ }
1193
+ );
1194
+ }
1195
+ function DropdownMenuLabel({
1196
+ className,
1197
+ inset,
1198
+ ...props
1199
+ }) {
1200
+ return /* @__PURE__ */ jsxRuntime.jsx(
1201
+ radixUi.DropdownMenu.Label,
1202
+ {
1203
+ "data-slot": "dropdown-menu-label",
1204
+ "data-inset": inset,
1205
+ className: cn("mz-menu-label", inset && "mz-menu-label--inset", className),
1206
+ ...props
1207
+ }
1208
+ );
1209
+ }
1210
+ function DropdownMenuSeparator({
1211
+ className,
1212
+ ...props
1213
+ }) {
1214
+ return /* @__PURE__ */ jsxRuntime.jsx(
1215
+ radixUi.DropdownMenu.Separator,
1216
+ {
1217
+ "data-slot": "dropdown-menu-separator",
1218
+ className: cn("mz-menu-separator", className),
1219
+ ...props
1220
+ }
1221
+ );
1222
+ }
1223
+ function DropdownMenuShortcut({ className, ...props }) {
1224
+ return /* @__PURE__ */ jsxRuntime.jsx(
1225
+ "span",
1226
+ {
1227
+ "data-slot": "dropdown-menu-shortcut",
1228
+ className: cn("mz-menu-shortcut", className),
1229
+ ...props
1230
+ }
1231
+ );
1232
+ }
1233
+ function DropdownMenuSub({ ...props }) {
1234
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.DropdownMenu.Sub, { "data-slot": "dropdown-menu-sub", ...props });
1235
+ }
1236
+ function DropdownMenuSubTrigger({
1237
+ className,
1238
+ inset,
1239
+ children,
1240
+ ...props
1241
+ }) {
1242
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1243
+ radixUi.DropdownMenu.SubTrigger,
1244
+ {
1245
+ "data-slot": "dropdown-menu-sub-trigger",
1246
+ "data-inset": inset,
1247
+ className: cn(
1248
+ "mz-item mz-menu-sub-trigger",
1249
+ inset ? "mz-item--inset" : "mz-item--plain",
1250
+ className
1251
+ ),
1252
+ ...props,
1253
+ children: [
1254
+ children,
1255
+ /* @__PURE__ */ jsxRuntime.jsx(ChevronRightIcon, { className: "mz-menu-sub-trigger__icon" })
1256
+ ]
1257
+ }
1258
+ );
1259
+ }
1260
+ function DropdownMenuSubContent({
1261
+ className,
1262
+ ...props
1263
+ }) {
1264
+ return /* @__PURE__ */ jsxRuntime.jsx(
1265
+ radixUi.DropdownMenu.SubContent,
1266
+ {
1267
+ "data-slot": "dropdown-menu-sub-content",
1268
+ className: cn("mz-panel mz-menu-content", className),
1269
+ ...props
1270
+ }
1271
+ );
1272
+ }
1273
+ var TooltipProviderPresence = React39__namespace.createContext(false);
1274
+ function TooltipProvider({
1275
+ delayDuration = 200,
1276
+ children,
1277
+ ...props
1278
+ }) {
1279
+ return /* @__PURE__ */ jsxRuntime.jsx(TooltipProviderPresence.Provider, { value: true, children: /* @__PURE__ */ jsxRuntime.jsx(
1280
+ radixUi.Tooltip.Provider,
1281
+ {
1282
+ "data-slot": "tooltip-provider",
1283
+ delayDuration,
1284
+ ...props,
1285
+ children
1286
+ }
1287
+ ) });
1288
+ }
1289
+ function Tooltip({ ...props }) {
1290
+ const hasProvider = React39__namespace.useContext(TooltipProviderPresence);
1291
+ const root = /* @__PURE__ */ jsxRuntime.jsx(radixUi.Tooltip.Root, { "data-slot": "tooltip", ...props });
1292
+ return hasProvider ? root : /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { children: root });
1293
+ }
1294
+ function TooltipTrigger({ ...props }) {
1295
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Tooltip.Trigger, { "data-slot": "tooltip-trigger", ...props });
1296
+ }
1297
+ function TooltipContent({
1298
+ className,
1299
+ sideOffset = 6,
1300
+ children,
1301
+ ...props
1302
+ }) {
1303
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Tooltip.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
1304
+ radixUi.Tooltip.Content,
1305
+ {
1306
+ "data-slot": "tooltip-content",
1307
+ sideOffset,
1308
+ className: cn("mz-tooltip-content", className),
1309
+ ...props,
1310
+ children: [
1311
+ children,
1312
+ /* @__PURE__ */ jsxRuntime.jsx(radixUi.Tooltip.Arrow, { className: "mz-tooltip-arrow", width: 10, height: 5 })
1313
+ ]
1314
+ }
1315
+ ) });
1316
+ }
1317
+ function Sheet({ ...props }) {
1318
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Dialog.Root, { "data-slot": "sheet", ...props });
1319
+ }
1320
+ function SheetTrigger({ ...props }) {
1321
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Dialog.Trigger, { "data-slot": "sheet-trigger", ...props });
1322
+ }
1323
+ function SheetClose({ ...props }) {
1324
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Dialog.Close, { "data-slot": "sheet-close", ...props });
1325
+ }
1326
+ function SheetPortal({ ...props }) {
1327
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Dialog.Portal, { "data-slot": "sheet-portal", ...props });
1328
+ }
1329
+ function SheetOverlay({ className, ...props }) {
1330
+ return /* @__PURE__ */ jsxRuntime.jsx(
1331
+ radixUi.Dialog.Overlay,
1332
+ {
1333
+ "data-slot": "sheet-overlay",
1334
+ className: cn("mz-dialog-overlay", className),
1335
+ ...props
1336
+ }
1337
+ );
1338
+ }
1339
+ function SheetContent({
1340
+ className,
1341
+ children,
1342
+ side = "right",
1343
+ showCloseButton = true,
1344
+ closeLabel = "Close",
1345
+ ...props
1346
+ }) {
1347
+ return /* @__PURE__ */ jsxRuntime.jsxs(SheetPortal, { children: [
1348
+ /* @__PURE__ */ jsxRuntime.jsx(SheetOverlay, {}),
1349
+ /* @__PURE__ */ jsxRuntime.jsxs(
1350
+ radixUi.Dialog.Content,
1351
+ {
1352
+ "data-slot": "sheet-content",
1353
+ "data-side": side,
1354
+ className: cn("mz-sheet", className),
1355
+ ...props,
1356
+ children: [
1357
+ children,
1358
+ showCloseButton ? /* @__PURE__ */ jsxRuntime.jsxs(radixUi.Dialog.Close, { "data-slot": "sheet-close", className: "mz-dialog-close mz-focusable", children: [
1359
+ /* @__PURE__ */ jsxRuntime.jsx(XIcon, {}),
1360
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mz-sr-only", children: closeLabel })
1361
+ ] }) : null
1362
+ ]
1363
+ }
1364
+ )
1365
+ ] });
1366
+ }
1367
+ function SheetHeader({ className, ...props }) {
1368
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "sheet-header", className: cn("mz-sheet__header", className), ...props });
1369
+ }
1370
+ function SheetFooter({ className, ...props }) {
1371
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "sheet-footer", className: cn("mz-sheet__footer", className), ...props });
1372
+ }
1373
+ function SheetTitle({ className, ...props }) {
1374
+ return /* @__PURE__ */ jsxRuntime.jsx(
1375
+ radixUi.Dialog.Title,
1376
+ {
1377
+ "data-slot": "sheet-title",
1378
+ className: cn("mz-dialog-title", className),
1379
+ ...props
1380
+ }
1381
+ );
1382
+ }
1383
+ function SheetDescription({
1384
+ className,
1385
+ ...props
1386
+ }) {
1387
+ return /* @__PURE__ */ jsxRuntime.jsx(
1388
+ radixUi.Dialog.Description,
1389
+ {
1390
+ "data-slot": "sheet-description",
1391
+ className: cn("mz-dialog-description", className),
1392
+ ...props
1393
+ }
1394
+ );
1395
+ }
1396
+ function useIsMobile(breakpoint = 768) {
1397
+ const [isMobile, setIsMobile] = React39__namespace.useState(false);
1398
+ React39__namespace.useEffect(() => {
1399
+ const query = window.matchMedia(`(max-width: ${breakpoint - 1}px)`);
1400
+ const update = () => setIsMobile(query.matches);
1401
+ update();
1402
+ query.addEventListener("change", update);
1403
+ return () => query.removeEventListener("change", update);
1404
+ }, [breakpoint]);
1405
+ return isMobile;
1406
+ }
1407
+ var STORAGE_KEY = "morze-ui-sidebar";
1408
+ var SHORTCUT = "b";
1409
+ var SidebarContext = React39__namespace.createContext(null);
1410
+ function useSidebar() {
1411
+ const context = React39__namespace.useContext(SidebarContext);
1412
+ if (!context) throw new Error("useSidebar must be used inside <SidebarProvider>");
1413
+ return context;
1414
+ }
1415
+ function readStored2(key) {
1416
+ if (!key || typeof window === "undefined") return null;
1417
+ try {
1418
+ const raw = window.localStorage.getItem(key);
1419
+ return raw === null ? null : raw === "true";
1420
+ } catch {
1421
+ return null;
1422
+ }
1423
+ }
1424
+ function SidebarProvider({
1425
+ defaultOpen = true,
1426
+ open: openProp,
1427
+ onOpenChange,
1428
+ storageKey = STORAGE_KEY,
1429
+ mobileBreakpoint = 768,
1430
+ className,
1431
+ style,
1432
+ children,
1433
+ ...props
1434
+ }) {
1435
+ const isMobile = useIsMobile(mobileBreakpoint);
1436
+ const [openMobile, setOpenMobile] = React39__namespace.useState(false);
1437
+ const [internalOpen, setInternalOpen] = React39__namespace.useState(defaultOpen);
1438
+ React39__namespace.useEffect(() => {
1439
+ const stored = readStored2(storageKey);
1440
+ if (stored !== null) setInternalOpen(stored);
1441
+ }, [storageKey]);
1442
+ const open = openProp ?? internalOpen;
1443
+ const setOpen = React39__namespace.useCallback(
1444
+ (next) => {
1445
+ if (openProp === void 0) setInternalOpen(next);
1446
+ onOpenChange?.(next);
1447
+ if (!storageKey || typeof window === "undefined") return;
1448
+ try {
1449
+ window.localStorage.setItem(storageKey, String(next));
1450
+ } catch {
1451
+ }
1452
+ },
1453
+ [openProp, onOpenChange, storageKey]
1454
+ );
1455
+ const toggleSidebar = React39__namespace.useCallback(() => {
1456
+ if (isMobile) setOpenMobile((current) => !current);
1457
+ else setOpen(!open);
1458
+ }, [isMobile, open, setOpen]);
1459
+ React39__namespace.useEffect(() => {
1460
+ const onKeyDown = (event) => {
1461
+ if (event.key.toLowerCase() !== SHORTCUT || !(event.metaKey || event.ctrlKey)) return;
1462
+ event.preventDefault();
1463
+ toggleSidebar();
1464
+ };
1465
+ window.addEventListener("keydown", onKeyDown);
1466
+ return () => window.removeEventListener("keydown", onKeyDown);
1467
+ }, [toggleSidebar]);
1468
+ const value = React39__namespace.useMemo(
1469
+ () => ({
1470
+ state: open ? "expanded" : "collapsed",
1471
+ open,
1472
+ setOpen,
1473
+ openMobile,
1474
+ setOpenMobile,
1475
+ isMobile,
1476
+ toggleSidebar
1477
+ }),
1478
+ [open, setOpen, openMobile, isMobile, toggleSidebar]
1479
+ );
1480
+ return /* @__PURE__ */ jsxRuntime.jsx(SidebarContext.Provider, { value, children: /* @__PURE__ */ jsxRuntime.jsx(
1481
+ "div",
1482
+ {
1483
+ "data-slot": "sidebar-wrapper",
1484
+ "data-state": value.state,
1485
+ className: cn("mz-sidebar-layout", className),
1486
+ style,
1487
+ ...props,
1488
+ children
1489
+ }
1490
+ ) });
1491
+ }
1492
+ function Sidebar({
1493
+ side = "left",
1494
+ variant = "inset",
1495
+ collapsible = "icon",
1496
+ mobileTitle = "Navigation",
1497
+ mobileDescription = "Application sections",
1498
+ className,
1499
+ children,
1500
+ ...props
1501
+ }) {
1502
+ const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
1503
+ if (isMobile && collapsible !== "none") {
1504
+ return /* @__PURE__ */ jsxRuntime.jsx(Sheet, { open: openMobile, onOpenChange: setOpenMobile, children: /* @__PURE__ */ jsxRuntime.jsxs(
1505
+ SheetContent,
1506
+ {
1507
+ side,
1508
+ showCloseButton: false,
1509
+ "data-slot": "sidebar",
1510
+ "data-mobile": "true",
1511
+ className: cn("mz-sidebar--mobile", className),
1512
+ children: [
1513
+ /* @__PURE__ */ jsxRuntime.jsxs(SheetHeader, { className: "mz-sr-only", children: [
1514
+ /* @__PURE__ */ jsxRuntime.jsx(SheetTitle, { children: mobileTitle }),
1515
+ /* @__PURE__ */ jsxRuntime.jsx(SheetDescription, { children: mobileDescription })
1516
+ ] }),
1517
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mz-sidebar__inner", children })
1518
+ ]
1519
+ }
1520
+ ) });
1521
+ }
1522
+ return /* @__PURE__ */ jsxRuntime.jsx(
1523
+ "div",
1524
+ {
1525
+ "data-slot": "sidebar",
1526
+ "data-state": state,
1527
+ "data-side": side,
1528
+ "data-variant": variant,
1529
+ "data-collapsible": collapsible === "none" ? void 0 : collapsible,
1530
+ className: cn("mz-sidebar", className),
1531
+ ...props,
1532
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mz-sidebar__inner", children })
1533
+ }
1534
+ );
1535
+ }
1536
+ function SidebarTrigger({
1537
+ className,
1538
+ onClick,
1539
+ label = "Toggle sidebar",
1540
+ ...props
1541
+ }) {
1542
+ const { toggleSidebar, state } = useSidebar();
1543
+ return /* @__PURE__ */ jsxRuntime.jsx(
1544
+ "button",
1545
+ {
1546
+ type: "button",
1547
+ "data-slot": "sidebar-trigger",
1548
+ "data-state": state,
1549
+ "aria-label": label,
1550
+ title: label,
1551
+ className: cn("mz-sidebar__trigger mz-focusable", className),
1552
+ onClick: (event) => {
1553
+ onClick?.(event);
1554
+ if (!event.defaultPrevented) toggleSidebar();
1555
+ },
1556
+ ...props,
1557
+ children: /* @__PURE__ */ jsxRuntime.jsx(ChevronLeftIcon, {})
1558
+ }
1559
+ );
1560
+ }
1561
+ function SidebarRail({
1562
+ className,
1563
+ label = "Toggle sidebar",
1564
+ ...props
1565
+ }) {
1566
+ const { toggleSidebar } = useSidebar();
1567
+ return /* @__PURE__ */ jsxRuntime.jsx(
1568
+ "button",
1569
+ {
1570
+ type: "button",
1571
+ "data-slot": "sidebar-rail",
1572
+ "aria-label": label,
1573
+ tabIndex: -1,
1574
+ className: cn("mz-sidebar__rail", className),
1575
+ onClick: toggleSidebar,
1576
+ ...props
1577
+ }
1578
+ );
1579
+ }
1580
+ function SidebarInset({ className, ...props }) {
1581
+ return /* @__PURE__ */ jsxRuntime.jsx("main", { "data-slot": "sidebar-inset", className: cn("mz-sidebar-inset", className), ...props });
1582
+ }
1583
+ function SidebarPanel({ className, ...props }) {
1584
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "sidebar-panel", className: cn("mz-sidebar-panel", className), ...props });
1585
+ }
1586
+ function SidebarInput({ className, ...props }) {
1587
+ return /* @__PURE__ */ jsxRuntime.jsx(Input, { "data-slot": "sidebar-input", inputSize: "sm", className: cn("mz-sidebar__input", className), ...props });
1588
+ }
1589
+ function SidebarHeader({ className, ...props }) {
1590
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "sidebar-header", className: cn("mz-sidebar__header", className), ...props });
1591
+ }
1592
+ function SidebarFooter({ className, ...props }) {
1593
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "sidebar-footer", className: cn("mz-sidebar__footer", className), ...props });
1594
+ }
1595
+ function SidebarSeparator({ className, ...props }) {
1596
+ return /* @__PURE__ */ jsxRuntime.jsx(
1597
+ Separator,
1598
+ {
1599
+ "data-slot": "sidebar-separator",
1600
+ className: cn("mz-sidebar__separator", className),
1601
+ ...props
1602
+ }
1603
+ );
1604
+ }
1605
+ function SidebarContent({ className, ...props }) {
1606
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "sidebar-content", className: cn("mz-sidebar__content", className), ...props });
1607
+ }
1608
+ function SidebarGroup({ className, ...props }) {
1609
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "sidebar-group", className: cn("mz-sidebar__group", className), ...props });
1610
+ }
1611
+ function SidebarGroupLabel({
1612
+ className,
1613
+ asChild = false,
1614
+ ...props
1615
+ }) {
1616
+ const Comp = asChild ? radixUi.Slot.Root : "div";
1617
+ return /* @__PURE__ */ jsxRuntime.jsx(Comp, { "data-slot": "sidebar-group-label", className: cn("mz-sidebar__group-label", className), ...props });
1618
+ }
1619
+ function SidebarGroupAction({
1620
+ className,
1621
+ asChild = false,
1622
+ ...props
1623
+ }) {
1624
+ const Comp = asChild ? radixUi.Slot.Root : "button";
1625
+ return /* @__PURE__ */ jsxRuntime.jsx(
1626
+ Comp,
1627
+ {
1628
+ "data-slot": "sidebar-group-action",
1629
+ className: cn("mz-sidebar__group-action mz-focusable", className),
1630
+ ...props
1631
+ }
1632
+ );
1633
+ }
1634
+ function SidebarGroupContent({ className, ...props }) {
1635
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "sidebar-group-content", className: cn("mz-sidebar__group-content", className), ...props });
1636
+ }
1637
+ function SidebarMenu({ className, ...props }) {
1638
+ return /* @__PURE__ */ jsxRuntime.jsx("ul", { "data-slot": "sidebar-menu", className: cn("mz-sidebar__menu", className), ...props });
1639
+ }
1640
+ function SidebarMenuItem({ className, ...props }) {
1641
+ return /* @__PURE__ */ jsxRuntime.jsx("li", { "data-slot": "sidebar-menu-item", className: cn("mz-sidebar__menu-item", className), ...props });
1642
+ }
1643
+ function SidebarMenuButton({
1644
+ asChild = false,
1645
+ isActive = false,
1646
+ size = "md",
1647
+ tooltip,
1648
+ className,
1649
+ ...props
1650
+ }) {
1651
+ const Comp = asChild ? radixUi.Slot.Root : "button";
1652
+ const { isMobile, state } = useSidebar();
1653
+ const button = /* @__PURE__ */ jsxRuntime.jsx(
1654
+ Comp,
1655
+ {
1656
+ "data-slot": "sidebar-menu-button",
1657
+ "data-size": size,
1658
+ "data-active": isActive || void 0,
1659
+ className: cn("mz-sidebar__menu-button mz-focusable", className),
1660
+ ...props
1661
+ }
1662
+ );
1663
+ if (!tooltip || state !== "collapsed" || isMobile) return button;
1664
+ return /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
1665
+ /* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: button }),
1666
+ /* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { side: "right", align: "center", children: tooltip })
1667
+ ] });
1668
+ }
1669
+ function SidebarMenuAction({
1670
+ className,
1671
+ asChild = false,
1672
+ showOnHover = false,
1673
+ ...props
1674
+ }) {
1675
+ const Comp = asChild ? radixUi.Slot.Root : "button";
1676
+ return /* @__PURE__ */ jsxRuntime.jsx(
1677
+ Comp,
1678
+ {
1679
+ "data-slot": "sidebar-menu-action",
1680
+ "data-hover-only": showOnHover || void 0,
1681
+ className: cn("mz-sidebar__menu-action mz-focusable", className),
1682
+ ...props
1683
+ }
1684
+ );
1685
+ }
1686
+ function SidebarMenuBadge({ className, ...props }) {
1687
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "sidebar-menu-badge", className: cn("mz-sidebar__menu-badge", className), ...props });
1688
+ }
1689
+ function SidebarMenuSkeleton({
1690
+ className,
1691
+ showIcon = false,
1692
+ ...props
1693
+ }) {
1694
+ const width = React39__namespace.useMemo(() => `${Math.floor(Math.random() * 40) + 50}%`, []);
1695
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1696
+ "div",
1697
+ {
1698
+ "data-slot": "sidebar-menu-skeleton",
1699
+ className: cn("mz-sidebar__menu-skeleton", className),
1700
+ ...props,
1701
+ children: [
1702
+ showIcon ? /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "mz-sidebar__menu-skeleton-icon" }) : null,
1703
+ /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "mz-sidebar__menu-skeleton-text", style: { width } })
1704
+ ]
1705
+ }
1706
+ );
1707
+ }
1708
+ function SidebarMenuSub({ className, ...props }) {
1709
+ return /* @__PURE__ */ jsxRuntime.jsx("ul", { "data-slot": "sidebar-menu-sub", className: cn("mz-sidebar__menu-sub", className), ...props });
1710
+ }
1711
+ function SidebarMenuSubItem({ className, ...props }) {
1712
+ return /* @__PURE__ */ jsxRuntime.jsx("li", { "data-slot": "sidebar-menu-sub-item", className: cn("mz-sidebar__menu-sub-item", className), ...props });
1713
+ }
1714
+ function SidebarMenuSubButton({
1715
+ asChild = false,
1716
+ isActive = false,
1717
+ size = "md",
1718
+ className,
1719
+ ...props
1720
+ }) {
1721
+ const Comp = asChild ? radixUi.Slot.Root : "a";
1722
+ return /* @__PURE__ */ jsxRuntime.jsx(
1723
+ Comp,
1724
+ {
1725
+ "data-slot": "sidebar-menu-sub-button",
1726
+ "data-size": size,
1727
+ "data-active": isActive || void 0,
1728
+ className: cn("mz-sidebar__menu-sub-button mz-focusable", className),
1729
+ ...props
1730
+ }
1731
+ );
1732
+ }
1733
+ function CellEditor({
1734
+ row,
1735
+ def,
1736
+ onDone
1737
+ }) {
1738
+ const initial = def.value(row);
1739
+ const [value, setValue] = React39__namespace.useState(initial);
1740
+ const [saving, setSaving] = React39__namespace.useState(false);
1741
+ const [error, setError] = React39__namespace.useState(null);
1742
+ const commit = async () => {
1743
+ if (value === initial) return onDone();
1744
+ setSaving(true);
1745
+ try {
1746
+ await def.onSave(row, value);
1747
+ onDone();
1748
+ } catch (cause) {
1749
+ setValue(initial);
1750
+ setError(cause instanceof Error ? cause.message : "Could not save");
1751
+ setSaving(false);
1752
+ }
1753
+ };
1754
+ const onKeyDown = (event) => {
1755
+ if (event.key === "Enter") {
1756
+ event.preventDefault();
1757
+ void commit();
1758
+ }
1759
+ if (event.key === "Escape") {
1760
+ event.preventDefault();
1761
+ onDone();
1762
+ }
1763
+ };
1764
+ if (def.type === "select") {
1765
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1766
+ Select,
1767
+ {
1768
+ open: true,
1769
+ value,
1770
+ onValueChange: async (next) => {
1771
+ setValue(next);
1772
+ setSaving(true);
1773
+ try {
1774
+ await def.onSave(row, next);
1775
+ onDone();
1776
+ } catch {
1777
+ setValue(initial);
1778
+ setSaving(false);
1779
+ }
1780
+ },
1781
+ onOpenChange: (open) => !open && onDone(),
1782
+ children: [
1783
+ /* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { size: "sm", className: "mz-dt__editor", children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, {}) }),
1784
+ /* @__PURE__ */ jsxRuntime.jsx(SelectContent, { children: (def.options ?? []).map((option) => /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: option.value, children: option.label }, option.value)) })
1785
+ ]
1786
+ }
1787
+ );
1788
+ }
1789
+ return /* @__PURE__ */ jsxRuntime.jsx(
1790
+ Input,
1791
+ {
1792
+ autoFocus: true,
1793
+ inputSize: "sm",
1794
+ type: def.type === "number" ? "number" : "text",
1795
+ className: "mz-dt__editor",
1796
+ value,
1797
+ disabled: saving,
1798
+ "aria-invalid": error ? true : void 0,
1799
+ title: error ?? void 0,
1800
+ onChange: (event) => setValue(event.target.value),
1801
+ onKeyDown,
1802
+ onBlur: () => void commit()
1803
+ }
1804
+ );
1805
+ }
1806
+
1807
+ // src/components/data-table/labels.ts
1808
+ var defaultDataTableLabels = {
1809
+ filter: "Filter",
1810
+ filterFor: (column) => `Filter: ${column}`,
1811
+ filterActive: "active",
1812
+ contains: "Contains\u2026",
1813
+ apply: "Apply",
1814
+ reset: "Reset",
1815
+ resetAll: "Reset all",
1816
+ resetFilters: "Reset filters",
1817
+ clearFilter: "Clear filter",
1818
+ rangeFrom: "from",
1819
+ rangeTo: "to",
1820
+ dateFrom: "From",
1821
+ dateTo: "To",
1822
+ yes: "Yes",
1823
+ no: "No",
1824
+ columns: "Columns",
1825
+ moveUp: (column) => `Move \u201C${column}\u201D up`,
1826
+ moveDown: (column) => `Move \u201C${column}\u201D down`,
1827
+ pinning: (column, side) => `Pinning for \u201C${column}\u201D: ${side}`,
1828
+ pinnedLeft: "Left",
1829
+ pinnedRight: "Right",
1830
+ notPinned: "Not pinned",
1831
+ show: (column) => `Show \u201C${column}\u201D`,
1832
+ hide: (column) => `Hide \u201C${column}\u201D`,
1833
+ sortBy: (column) => `Sort by \u201C${column}\u201D (Shift to add to the sort)`,
1834
+ columnWidth: (column) => `Width of column \u201C${column}\u201D`,
1835
+ selectPage: "Select page",
1836
+ selectRow: "Select row",
1837
+ expandRow: "Expand",
1838
+ collapseRow: "Collapse",
1839
+ details: "Details",
1840
+ empty: "Nothing found",
1841
+ retry: "Retry",
1842
+ rowsPerPage: "Rows per page",
1843
+ nothingFound: "Nothing found",
1844
+ of: "of",
1845
+ firstPage: "First page",
1846
+ previousPage: "Previous page",
1847
+ nextPage: "Next page",
1848
+ lastPage: "Last page",
1849
+ selectedCount: (count) => `Selected: ${count}`,
1850
+ allMatchingSuffix: " (all matching)",
1851
+ selectAllMatching: (total) => `Select all ${total}`,
1852
+ clearSelection: "Clear selection",
1853
+ bulkActions: "Actions for the selected rows"
1854
+ };
1855
+ function resolveLabels(labels) {
1856
+ return labels ? { ...defaultDataTableLabels, ...labels } : defaultDataTableLabels;
1857
+ }
1858
+
1859
+ // src/components/data-table/utils.ts
1860
+ function isFilterActive(value) {
1861
+ if (!value) return false;
1862
+ switch (value.type) {
1863
+ case "text":
1864
+ return value.value.trim().length > 0;
1865
+ case "select":
1866
+ return value.value.length > 0;
1867
+ case "number-range":
1868
+ return value.min !== void 0 || value.max !== void 0;
1869
+ case "date-range":
1870
+ return Boolean(value.from || value.to);
1871
+ case "boolean":
1872
+ return true;
1873
+ }
1874
+ }
1875
+ function activeFilters(filters) {
1876
+ return Object.entries(filters).filter(([, value]) => isFilterActive(value));
1877
+ }
1878
+ function setFilter(query, id, value) {
1879
+ const filters = { ...query.filters };
1880
+ if (isFilterActive(value)) filters[id] = value;
1881
+ else delete filters[id];
1882
+ return { ...query, filters, page: 1 };
1883
+ }
1884
+ function toggleSort(query, id, additive = false) {
1885
+ const existing = query.sort.find((s) => s.id === id);
1886
+ const next = additive ? query.sort.filter((s) => s.id !== id) : [];
1887
+ if (!existing) next.push({ id, dir: "asc" });
1888
+ else if (existing.dir === "asc") next.push({ id, dir: "desc" });
1889
+ return { ...query, sort: next, page: 1 };
1890
+ }
1891
+ function sortStateOf(query, id) {
1892
+ const index = query.sort.findIndex((s) => s.id === id);
1893
+ if (index < 0) return { dir: void 0, index: void 0 };
1894
+ return { dir: query.sort[index].dir, index: query.sort.length > 1 ? index + 1 : void 0 };
1895
+ }
1896
+ function pageCount(total, pageSize) {
1897
+ if (!total || pageSize <= 0) return 1;
1898
+ return Math.max(1, Math.ceil(total / pageSize));
1899
+ }
1900
+ function serializeSort(sort) {
1901
+ return sort.map((s) => s.dir === "desc" ? `-${s.id}` : s.id).join(",");
1902
+ }
1903
+ function parseSort(raw) {
1904
+ if (!raw) return [];
1905
+ return raw.split(",").filter(Boolean).map(
1906
+ (token) => token.startsWith("-") ? { id: token.slice(1), dir: "desc" } : { id: token, dir: "asc" }
1907
+ );
1908
+ }
1909
+ function ColumnFilter({ columnLabel, def, value, onApply, labels: labelsProp }) {
1910
+ const labels = resolveLabels(labelsProp);
1911
+ const [open, setOpen] = React39__namespace.useState(false);
1912
+ const [draft, setDraft] = React39__namespace.useState(value);
1913
+ React39__namespace.useEffect(() => {
1914
+ if (open) setDraft(value);
1915
+ }, [open, value]);
1916
+ const active = isFilterActive(value);
1917
+ const commit = (next) => {
1918
+ onApply(isFilterActive(next) ? next : void 0);
1919
+ setOpen(false);
1920
+ };
1921
+ return /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open, onOpenChange: setOpen, children: [
1922
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
1923
+ "button",
1924
+ {
1925
+ type: "button",
1926
+ "data-slot": "data-table-filter-trigger",
1927
+ "data-active": active || void 0,
1928
+ className: "mz-dt__filter mz-focusable",
1929
+ "aria-label": `${labels.filterFor(columnLabel)}${active ? ` (${labels.filterActive})` : ""}`,
1930
+ title: labels.filterFor(columnLabel),
1931
+ children: /* @__PURE__ */ jsxRuntime.jsx(FilterIcon, {})
1932
+ }
1933
+ ) }),
1934
+ /* @__PURE__ */ jsxRuntime.jsxs(PopoverContent, { align: "start", className: "mz-dt__filter-panel", children: [
1935
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mz-dt__filter-head", children: columnLabel }),
1936
+ /* @__PURE__ */ jsxRuntime.jsx(
1937
+ FilterBody,
1938
+ {
1939
+ def,
1940
+ draft,
1941
+ setDraft,
1942
+ labels,
1943
+ onSubmit: () => commit(draft)
1944
+ }
1945
+ ),
1946
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mz-dt__filter-actions", children: [
1947
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { size: "sm", variant: "ghost", onClick: () => commit(void 0), children: labels.reset }),
1948
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { size: "sm", onClick: () => commit(draft), children: labels.apply })
1949
+ ] })
1950
+ ] })
1951
+ ] });
1952
+ }
1953
+ function FilterBody({
1954
+ def,
1955
+ draft,
1956
+ setDraft,
1957
+ labels,
1958
+ onSubmit
1959
+ }) {
1960
+ const submitOnEnter = (event) => {
1961
+ if (event.key === "Enter") {
1962
+ event.preventDefault();
1963
+ onSubmit();
1964
+ }
1965
+ };
1966
+ if (def.type === "text") {
1967
+ const current2 = draft?.type === "text" ? draft.value : "";
1968
+ return /* @__PURE__ */ jsxRuntime.jsx(
1969
+ Input,
1970
+ {
1971
+ autoFocus: true,
1972
+ inputSize: "sm",
1973
+ placeholder: def.placeholder ?? labels.contains,
1974
+ value: current2,
1975
+ onKeyDown: submitOnEnter,
1976
+ onChange: (e) => setDraft({ type: "text", value: e.target.value })
1977
+ }
1978
+ );
1979
+ }
1980
+ if (def.type === "select") {
1981
+ const current2 = draft?.type === "select" ? draft.value : [];
1982
+ const toggle = (option) => {
1983
+ if (def.multiple === false) {
1984
+ setDraft({ type: "select", value: current2.includes(option) ? [] : [option] });
1985
+ return;
1986
+ }
1987
+ setDraft({
1988
+ type: "select",
1989
+ value: current2.includes(option) ? current2.filter((v) => v !== option) : [...current2, option]
1990
+ });
1991
+ };
1992
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mz-dt__filter-options", role: "group", children: def.options.map((option) => /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "mz-dt__filter-option", children: [
1993
+ /* @__PURE__ */ jsxRuntime.jsx(
1994
+ Checkbox,
1995
+ {
1996
+ size: "sm",
1997
+ checked: current2.includes(option.value),
1998
+ onCheckedChange: () => toggle(option.value)
1999
+ }
2000
+ ),
2001
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: option.label })
2002
+ ] }, option.value)) });
2003
+ }
2004
+ if (def.type === "number-range") {
2005
+ const current2 = draft?.type === "number-range" ? draft : { };
2006
+ const patch = (part) => setDraft({ type: "number-range", min: current2.min, max: current2.max, ...part });
2007
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mz-dt__filter-range", children: [
2008
+ /* @__PURE__ */ jsxRuntime.jsx(
2009
+ Input,
2010
+ {
2011
+ autoFocus: true,
2012
+ inputSize: "sm",
2013
+ type: "number",
2014
+ step: def.step,
2015
+ placeholder: labels.rangeFrom,
2016
+ value: current2.min ?? "",
2017
+ onKeyDown: submitOnEnter,
2018
+ onChange: (e) => patch({ min: e.target.value === "" ? void 0 : Number(e.target.value) })
2019
+ }
2020
+ ),
2021
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mz-dt__filter-dash", children: "\u2014" }),
2022
+ /* @__PURE__ */ jsxRuntime.jsx(
2023
+ Input,
2024
+ {
2025
+ inputSize: "sm",
2026
+ type: "number",
2027
+ step: def.step,
2028
+ placeholder: labels.rangeTo,
2029
+ value: current2.max ?? "",
2030
+ onKeyDown: submitOnEnter,
2031
+ onChange: (e) => patch({ max: e.target.value === "" ? void 0 : Number(e.target.value) })
2032
+ }
2033
+ )
2034
+ ] });
2035
+ }
2036
+ if (def.type === "date-range") {
2037
+ const current2 = draft?.type === "date-range" ? draft : { };
2038
+ const patch = (part) => setDraft({ type: "date-range", from: current2.from, to: current2.to, ...part });
2039
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mz-dt__filter-range mz-dt__filter-range--stacked", children: [
2040
+ /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "mz-dt-from", children: labels.dateFrom }),
2041
+ /* @__PURE__ */ jsxRuntime.jsx(
2042
+ Input,
2043
+ {
2044
+ id: "mz-dt-from",
2045
+ inputSize: "sm",
2046
+ type: "date",
2047
+ value: current2.from ?? "",
2048
+ onKeyDown: submitOnEnter,
2049
+ onChange: (e) => patch({ from: e.target.value || void 0 })
2050
+ }
2051
+ ),
2052
+ /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "mz-dt-to", children: labels.dateTo }),
2053
+ /* @__PURE__ */ jsxRuntime.jsx(
2054
+ Input,
2055
+ {
2056
+ id: "mz-dt-to",
2057
+ inputSize: "sm",
2058
+ type: "date",
2059
+ value: current2.to ?? "",
2060
+ onKeyDown: submitOnEnter,
2061
+ onChange: (e) => patch({ to: e.target.value || void 0 })
2062
+ }
2063
+ )
2064
+ ] });
2065
+ }
2066
+ const current = draft?.type === "boolean" ? draft.value : void 0;
2067
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mz-dt__filter-options", role: "radiogroup", children: [
2068
+ { value: true, label: def.trueLabel ?? labels.yes },
2069
+ { value: false, label: def.falseLabel ?? labels.no }
2070
+ ].map((option) => /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "mz-dt__filter-option", children: [
2071
+ /* @__PURE__ */ jsxRuntime.jsx(
2072
+ Checkbox,
2073
+ {
2074
+ size: "sm",
2075
+ checked: current === option.value,
2076
+ onCheckedChange: (checked) => setDraft(checked ? { type: "boolean", value: option.value } : void 0)
2077
+ }
2078
+ ),
2079
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: option.label })
2080
+ ] }, String(option.value))) });
2081
+ }
2082
+ function FilterChip({
2083
+ label,
2084
+ onClear,
2085
+ clearLabel = defaultDataTableLabels.clearFilter,
2086
+ className
2087
+ }) {
2088
+ return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: cn("mz-dt__chip", className), children: [
2089
+ label,
2090
+ /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: onClear, "aria-label": clearLabel, className: "mz-focusable", children: "\xD7" })
2091
+ ] });
2092
+ }
2093
+ function ColumnManager({
2094
+ columns,
2095
+ layout,
2096
+ onToggleHidden,
2097
+ onSetPinned,
2098
+ onMove,
2099
+ onMoveTo,
2100
+ onReset,
2101
+ labels: labelsProp
2102
+ }) {
2103
+ const labels = resolveLabels(labelsProp);
2104
+ const [dragging, setDragging] = React39__namespace.useState(null);
2105
+ const byId = React39__namespace.useMemo(() => new Map(columns.map((c) => [c.id, c])), [columns]);
2106
+ const ordered = layout.order.map((id) => byId.get(id)).filter((c) => Boolean(c));
2107
+ const hiddenCount = layout.hidden.length;
2108
+ return /* @__PURE__ */ jsxRuntime.jsxs(Popover, { children: [
2109
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "secondary", size: "sm", children: [
2110
+ /* @__PURE__ */ jsxRuntime.jsx(ColumnsIcon, {}),
2111
+ labels.columns,
2112
+ hiddenCount > 0 ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mz-dt__count", children: ordered.length - hiddenCount }) : null
2113
+ ] }) }),
2114
+ /* @__PURE__ */ jsxRuntime.jsxs(PopoverContent, { align: "end", className: "mz-dt__columns", children: [
2115
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mz-dt__columns-head", children: [
2116
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: labels.columns }),
2117
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "link", size: "xs", onClick: onReset, children: labels.reset })
2118
+ ] }),
2119
+ /* @__PURE__ */ jsxRuntime.jsx(Separator, {}),
2120
+ /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "mz-dt__columns-list", children: ordered.map((column, index) => {
2121
+ const hidden = layout.hidden.includes(column.id);
2122
+ const pinned = layout.pinned[column.id];
2123
+ const label = column.label ?? (typeof column.header === "string" ? column.header : column.id);
2124
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2125
+ "li",
2126
+ {
2127
+ className: "mz-dt__columns-item",
2128
+ "data-dragging": dragging === column.id || void 0,
2129
+ draggable: true,
2130
+ onDragStart: () => setDragging(column.id),
2131
+ onDragEnd: () => setDragging(null),
2132
+ onDragOver: (event) => event.preventDefault(),
2133
+ onDrop: () => {
2134
+ if (dragging && dragging !== column.id) onMoveTo(dragging, column.id);
2135
+ setDragging(null);
2136
+ },
2137
+ children: [
2138
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mz-dt__columns-grip", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(GripIcon, {}) }),
2139
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mz-dt__columns-label", children: label }),
2140
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mz-dt__columns-controls", children: [
2141
+ /* @__PURE__ */ jsxRuntime.jsx(
2142
+ "button",
2143
+ {
2144
+ type: "button",
2145
+ className: "mz-dt__icon-btn mz-focusable",
2146
+ disabled: index === 0,
2147
+ onClick: () => onMove(column.id, -1),
2148
+ "aria-label": labels.moveUp(label),
2149
+ children: "\u2191"
2150
+ }
2151
+ ),
2152
+ /* @__PURE__ */ jsxRuntime.jsx(
2153
+ "button",
2154
+ {
2155
+ type: "button",
2156
+ className: "mz-dt__icon-btn mz-focusable",
2157
+ disabled: index === ordered.length - 1,
2158
+ onClick: () => onMove(column.id, 1),
2159
+ "aria-label": labels.moveDown(label),
2160
+ children: "\u2193"
2161
+ }
2162
+ ),
2163
+ /* @__PURE__ */ jsxRuntime.jsx(
2164
+ "button",
2165
+ {
2166
+ type: "button",
2167
+ className: "mz-dt__icon-btn mz-focusable",
2168
+ "data-active": pinned ? true : void 0,
2169
+ onClick: () => onSetPinned(column.id, pinned === "left" ? "right" : pinned === "right" ? void 0 : "left"),
2170
+ "aria-label": labels.pinning(
2171
+ label,
2172
+ pinned === "left" ? labels.pinnedLeft : pinned === "right" ? labels.pinnedRight : labels.notPinned
2173
+ ),
2174
+ title: pinned === "left" ? labels.pinnedLeft : pinned === "right" ? labels.pinnedRight : labels.notPinned,
2175
+ children: /* @__PURE__ */ jsxRuntime.jsx(PinIcon, {})
2176
+ }
2177
+ ),
2178
+ /* @__PURE__ */ jsxRuntime.jsx(
2179
+ "button",
2180
+ {
2181
+ type: "button",
2182
+ className: "mz-dt__icon-btn mz-focusable",
2183
+ disabled: column.hideable === false,
2184
+ onClick: () => onToggleHidden(column.id),
2185
+ "aria-label": hidden ? labels.show(label) : labels.hide(label),
2186
+ children: hidden ? /* @__PURE__ */ jsxRuntime.jsx(EyeOffIcon, {}) : /* @__PURE__ */ jsxRuntime.jsx(EyeIcon, {})
2187
+ }
2188
+ )
2189
+ ] })
2190
+ ]
2191
+ },
2192
+ column.id
2193
+ );
2194
+ }) })
2195
+ ] })
2196
+ ] });
2197
+ }
2198
+ function DataTablePagination({
2199
+ query,
2200
+ total,
2201
+ rowsOnPage,
2202
+ pageSizeOptions = [10, 25, 50, 100],
2203
+ labels: labelsProp,
2204
+ locale,
2205
+ onQueryChange
2206
+ }) {
2207
+ const labels = resolveLabels(labelsProp);
2208
+ const pages = pageCount(total, query.pageSize);
2209
+ const from = total === 0 ? 0 : (query.page - 1) * query.pageSize + 1;
2210
+ const to = total === void 0 ? from + rowsOnPage - 1 : Math.min(query.page * query.pageSize, total);
2211
+ const go = (page) => onQueryChange({ ...query, page: Math.min(Math.max(page, 1), pages) });
2212
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mz-dt__pagination", "data-slot": "data-table-pagination", children: [
2213
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mz-dt__pagination-info", children: total === 0 ? labels.nothingFound : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2214
+ from,
2215
+ "\u2013",
2216
+ to,
2217
+ total !== void 0 ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2218
+ " ",
2219
+ labels.of,
2220
+ " ",
2221
+ total.toLocaleString(locale)
2222
+ ] }) : null
2223
+ ] }) }),
2224
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mz-dt__pagination-size", children: [
2225
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: labels.rowsPerPage }),
2226
+ /* @__PURE__ */ jsxRuntime.jsxs(
2227
+ Select,
2228
+ {
2229
+ value: String(query.pageSize),
2230
+ onValueChange: (value) => onQueryChange({ ...query, pageSize: Number(value), page: 1 }),
2231
+ children: [
2232
+ /* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { size: "sm", className: "mz-dt__pagination-select", children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, {}) }),
2233
+ /* @__PURE__ */ jsxRuntime.jsx(SelectContent, { children: pageSizeOptions.map((size) => /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: String(size), children: size }, size)) })
2234
+ ]
2235
+ }
2236
+ )
2237
+ ] }),
2238
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mz-dt__pagination-nav", children: [
2239
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "mz-dt__pagination-page", children: [
2240
+ query.page,
2241
+ " / ",
2242
+ pages
2243
+ ] }),
2244
+ /* @__PURE__ */ jsxRuntime.jsx(
2245
+ Button,
2246
+ {
2247
+ variant: "secondary",
2248
+ size: "icon-sm",
2249
+ disabled: query.page <= 1,
2250
+ onClick: () => go(1),
2251
+ "aria-label": labels.firstPage,
2252
+ children: /* @__PURE__ */ jsxRuntime.jsx(ChevronsLeftIcon, {})
2253
+ }
2254
+ ),
2255
+ /* @__PURE__ */ jsxRuntime.jsx(
2256
+ Button,
2257
+ {
2258
+ variant: "secondary",
2259
+ size: "icon-sm",
2260
+ disabled: query.page <= 1,
2261
+ onClick: () => go(query.page - 1),
2262
+ "aria-label": labels.previousPage,
2263
+ children: /* @__PURE__ */ jsxRuntime.jsx(ChevronLeftIcon, {})
2264
+ }
2265
+ ),
2266
+ /* @__PURE__ */ jsxRuntime.jsx(
2267
+ Button,
2268
+ {
2269
+ variant: "secondary",
2270
+ size: "icon-sm",
2271
+ disabled: query.page >= pages,
2272
+ onClick: () => go(query.page + 1),
2273
+ "aria-label": labels.nextPage,
2274
+ children: /* @__PURE__ */ jsxRuntime.jsx(ChevronRightIcon, {})
2275
+ }
2276
+ ),
2277
+ /* @__PURE__ */ jsxRuntime.jsx(
2278
+ Button,
2279
+ {
2280
+ variant: "secondary",
2281
+ size: "icon-sm",
2282
+ disabled: query.page >= pages,
2283
+ onClick: () => go(pages),
2284
+ "aria-label": labels.lastPage,
2285
+ children: /* @__PURE__ */ jsxRuntime.jsx(ChevronsRightIcon, {})
2286
+ }
2287
+ )
2288
+ ] })
2289
+ ] });
2290
+ }
2291
+ function useColumnResize(options) {
2292
+ const { rootRef, widthOf, minWidthOf, onCommit } = options;
2293
+ const [resizing, setResizing] = React39__namespace.useState(null);
2294
+ const varName = (id) => `--mz-dt-w-${cssSafe(id)}`;
2295
+ const start = React39__namespace.useCallback(
2296
+ (event, id) => {
2297
+ if (event.button !== 0) return;
2298
+ event.preventDefault();
2299
+ event.stopPropagation();
2300
+ const root = rootRef.current;
2301
+ if (!root) return;
2302
+ const handle = event.currentTarget;
2303
+ const startX = event.clientX;
2304
+ const startWidth = widthOf(id);
2305
+ const min = minWidthOf(id);
2306
+ let width = startWidth;
2307
+ handle.setPointerCapture(event.pointerId);
2308
+ setResizing(id);
2309
+ const onMove = (moveEvent) => {
2310
+ width = Math.max(min, Math.round(startWidth + moveEvent.clientX - startX));
2311
+ root.style.setProperty(varName(id), `${width}px`);
2312
+ };
2313
+ const finish = () => {
2314
+ handle.releasePointerCapture?.(event.pointerId);
2315
+ handle.removeEventListener("pointermove", onMove);
2316
+ handle.removeEventListener("pointerup", finish);
2317
+ handle.removeEventListener("pointercancel", finish);
2318
+ setResizing(null);
2319
+ if (width !== startWidth) onCommit(id, width);
2320
+ };
2321
+ handle.addEventListener("pointermove", onMove);
2322
+ handle.addEventListener("pointerup", finish);
2323
+ handle.addEventListener("pointercancel", finish);
2324
+ },
2325
+ [rootRef, widthOf, minWidthOf, onCommit]
2326
+ );
2327
+ const autoFit = React39__namespace.useCallback(
2328
+ (id) => {
2329
+ const root = rootRef.current;
2330
+ if (!root) return;
2331
+ const cells = root.querySelectorAll(`[data-col="${CSS.escape(id)}"]`);
2332
+ let widest = minWidthOf(id);
2333
+ cells.forEach((cell) => {
2334
+ const content = cell.firstElementChild;
2335
+ const padding = 26;
2336
+ widest = Math.max(widest, (content?.scrollWidth ?? cell.scrollWidth) + padding);
2337
+ });
2338
+ const width = Math.min(widest, 640);
2339
+ root.style.setProperty(varName(id), `${width}px`);
2340
+ onCommit(id, width);
2341
+ },
2342
+ [rootRef, minWidthOf, onCommit]
2343
+ );
2344
+ const onKeyDown = React39__namespace.useCallback(
2345
+ (event, id) => {
2346
+ const step = event.shiftKey ? 32 : 8;
2347
+ if (event.key !== "ArrowLeft" && event.key !== "ArrowRight") return;
2348
+ event.preventDefault();
2349
+ const next = Math.max(
2350
+ minWidthOf(id),
2351
+ widthOf(id) + (event.key === "ArrowRight" ? step : -step)
2352
+ );
2353
+ rootRef.current?.style.setProperty(varName(id), `${next}px`);
2354
+ onCommit(id, next);
2355
+ },
2356
+ [rootRef, widthOf, minWidthOf, onCommit]
2357
+ );
2358
+ return { start, autoFit, onKeyDown, resizing, varName };
2359
+ }
2360
+ function cssSafe(id) {
2361
+ return id.replace(/[^a-zA-Z0-9_-]/g, "_");
2362
+ }
2363
+ var DEFAULT_WIDTH = 168;
2364
+ var DEFAULT_MIN = 72;
2365
+ function readStored3(key) {
2366
+ if (!key || typeof window === "undefined") return null;
2367
+ try {
2368
+ const raw = window.localStorage.getItem(key);
2369
+ return raw ? JSON.parse(raw) : null;
2370
+ } catch {
2371
+ return null;
2372
+ }
2373
+ }
2374
+ function writeStored2(key, layout) {
2375
+ if (!key || typeof window === "undefined") return;
2376
+ try {
2377
+ window.localStorage.setItem(key, JSON.stringify(layout));
2378
+ } catch {
2379
+ }
2380
+ }
2381
+ function useColumnLayout({
2382
+ columns,
2383
+ persistKey = null,
2384
+ layout: controlled,
2385
+ onLayoutChange
2386
+ }) {
2387
+ const baseline = React39__namespace.useMemo(
2388
+ () => ({
2389
+ order: columns.map((c) => c.id),
2390
+ hidden: [],
2391
+ widths: Object.fromEntries(
2392
+ columns.map((c) => [c.id, c.width ?? DEFAULT_WIDTH])
2393
+ ),
2394
+ pinned: Object.fromEntries(columns.map((c) => [c.id, c.pinned])),
2395
+ sized: []
2396
+ }),
2397
+ [columns]
2398
+ );
2399
+ const [internal, setInternal] = React39__namespace.useState(baseline);
2400
+ React39__namespace.useEffect(() => {
2401
+ const stored = readStored3(persistKey);
2402
+ if (stored) setInternal((current) => merge(current, stored, baseline));
2403
+ }, [persistKey]);
2404
+ React39__namespace.useEffect(() => {
2405
+ setInternal((current) => merge(baseline, current, baseline));
2406
+ }, [baseline]);
2407
+ const layout = React39__namespace.useMemo(
2408
+ () => controlled ? merge(baseline, controlled, baseline) : internal,
2409
+ [controlled, internal, baseline]
2410
+ );
2411
+ const update = React39__namespace.useCallback(
2412
+ (patch, options) => {
2413
+ setInternal((current) => {
2414
+ const base = controlled ? merge(baseline, controlled, baseline) : current;
2415
+ const next = patch(base);
2416
+ if (next === base) return current;
2417
+ if (options?.persist !== false) {
2418
+ writeStored2(persistKey, next);
2419
+ onLayoutChange?.(next);
2420
+ }
2421
+ return next;
2422
+ });
2423
+ },
2424
+ [controlled, baseline, persistKey, onLayoutChange]
2425
+ );
2426
+ const byId = React39__namespace.useMemo(
2427
+ () => new Map(columns.map((c) => [c.id, c])),
2428
+ [columns]
2429
+ );
2430
+ const visible = React39__namespace.useMemo(() => {
2431
+ const ordered = layout.order.map((id) => byId.get(id)).filter((c) => Boolean(c) && !layout.hidden.includes(c.id));
2432
+ const side = (id) => layout.pinned[id];
2433
+ return [
2434
+ ...ordered.filter((c) => side(c.id) === "left"),
2435
+ ...ordered.filter((c) => !side(c.id)),
2436
+ ...ordered.filter((c) => side(c.id) === "right")
2437
+ ];
2438
+ }, [layout, byId]);
2439
+ const widthOf = React39__namespace.useCallback(
2440
+ (id) => layout.widths[id] ?? byId.get(id)?.width ?? DEFAULT_WIDTH,
2441
+ [layout.widths, byId]
2442
+ );
2443
+ const minWidthOf = React39__namespace.useCallback(
2444
+ (id) => byId.get(id)?.minWidth ?? DEFAULT_MIN,
2445
+ [byId]
2446
+ );
2447
+ const fitTo = React39__namespace.useCallback(
2448
+ (available) => update(
2449
+ (current) => {
2450
+ const shown = current.order.map((id) => byId.get(id)).filter((c) => Boolean(c) && !current.hidden.includes(c.id));
2451
+ if (!shown.length || available <= 0) return current;
2452
+ const baseOf = (c) => c.width ?? DEFAULT_WIDTH;
2453
+ const isFlexible = (c) => c.flex !== false && !current.sized.includes(c.id);
2454
+ const flexible = shown.filter(isFlexible);
2455
+ if (!flexible.length) return current;
2456
+ const fixedTotal = shown.filter((c) => !isFlexible(c)).reduce((sum, c) => sum + (current.widths[c.id] ?? baseOf(c)), 0);
2457
+ const flexBaseTotal = flexible.reduce((sum, c) => sum + baseOf(c), 0);
2458
+ const target = available - fixedTotal;
2459
+ const next = { ...current.widths };
2460
+ if (target <= flexBaseTotal) {
2461
+ for (const column of flexible) {
2462
+ next[column.id] = Math.max(baseOf(column), column.minWidth ?? DEFAULT_MIN);
2463
+ }
2464
+ } else {
2465
+ let remaining = target;
2466
+ let pool = flexBaseTotal;
2467
+ const growing = [...flexible];
2468
+ for (let pass = 0; pass < 3 && growing.length; pass += 1) {
2469
+ const scale = remaining / pool;
2470
+ const clamped = [];
2471
+ for (const column of growing) {
2472
+ const min = column.minWidth ?? DEFAULT_MIN;
2473
+ const max = column.maxWidth ?? Infinity;
2474
+ const scaled = baseOf(column) * scale;
2475
+ const bounded = Math.min(Math.max(scaled, min), max);
2476
+ if (bounded !== scaled) {
2477
+ next[column.id] = Math.round(bounded);
2478
+ remaining -= bounded;
2479
+ pool -= baseOf(column);
2480
+ clamped.push(column);
2481
+ }
2482
+ }
2483
+ if (!clamped.length) break;
2484
+ growing.splice(0, growing.length, ...growing.filter((c) => !clamped.includes(c)));
2485
+ }
2486
+ if (growing.length) {
2487
+ const scale = remaining / pool;
2488
+ let used = 0;
2489
+ growing.forEach((column, index) => {
2490
+ if (index === growing.length - 1) {
2491
+ next[column.id] = Math.round(remaining - used);
2492
+ } else {
2493
+ const width = Math.round(baseOf(column) * scale);
2494
+ next[column.id] = width;
2495
+ used += width;
2496
+ }
2497
+ });
2498
+ }
2499
+ }
2500
+ const changed = shown.some(
2501
+ (c) => Math.abs((next[c.id] ?? 0) - (current.widths[c.id] ?? baseOf(c))) > 0.5
2502
+ );
2503
+ return changed ? { ...current, widths: next } : current;
2504
+ },
2505
+ { persist: false }
2506
+ ),
2507
+ [update, byId]
2508
+ );
2509
+ return {
2510
+ layout,
2511
+ visible,
2512
+ widthOf,
2513
+ minWidthOf,
2514
+ setWidth: (id, width) => update((c) => ({
2515
+ ...c,
2516
+ widths: { ...c.widths, [id]: width },
2517
+ sized: c.sized.includes(id) ? c.sized : [...c.sized, id]
2518
+ })),
2519
+ fitTo,
2520
+ toggleHidden: (id) => update((c) => ({
2521
+ ...c,
2522
+ hidden: c.hidden.includes(id) ? c.hidden.filter((h) => h !== id) : [...c.hidden, id]
2523
+ })),
2524
+ setPinned: (id, side) => update((c) => ({ ...c, pinned: { ...c.pinned, [id]: side } })),
2525
+ move: (id, delta) => update((c) => {
2526
+ const order = [...c.order];
2527
+ const from = order.indexOf(id);
2528
+ const to = Math.min(Math.max(from + delta, 0), order.length - 1);
2529
+ if (from < 0 || from === to) return c;
2530
+ order.splice(to, 0, ...order.splice(from, 1));
2531
+ return { ...c, order };
2532
+ }),
2533
+ moveTo: (id, targetId) => update((c) => {
2534
+ const order = [...c.order];
2535
+ const from = order.indexOf(id);
2536
+ const to = order.indexOf(targetId);
2537
+ if (from < 0 || to < 0 || from === to) return c;
2538
+ order.splice(to, 0, ...order.splice(from, 1));
2539
+ return { ...c, order };
2540
+ }),
2541
+ reset: () => update(() => baseline)
2542
+ };
2543
+ }
2544
+ function merge(base, patch, fallback) {
2545
+ const known = new Set(fallback.order);
2546
+ const order = [
2547
+ ...(patch.order ?? base.order).filter((id) => known.has(id)),
2548
+ ...fallback.order.filter((id) => !(patch.order ?? base.order).includes(id))
2549
+ ];
2550
+ return {
2551
+ order,
2552
+ hidden: (patch.hidden ?? base.hidden).filter((id) => known.has(id)),
2553
+ widths: { ...fallback.widths, ...base.widths, ...patch.widths },
2554
+ pinned: { ...fallback.pinned, ...base.pinned, ...patch.pinned },
2555
+ sized: (patch.sized ?? base.sized ?? []).filter((id) => known.has(id))
2556
+ };
2557
+ }
2558
+ function useRowSelection(options) {
2559
+ const { value, onChange, pageKeys } = options;
2560
+ const anchor = React39__namespace.useRef(null);
2561
+ const selected = React39__namespace.useMemo(() => new Set(value.keys), [value.keys]);
2562
+ const setKeys = (keys, allMatching = false) => onChange({ keys, allMatching });
2563
+ const toggle = (key, event) => {
2564
+ if (event?.shiftKey && anchor.current) {
2565
+ const from = pageKeys.indexOf(anchor.current);
2566
+ const to = pageKeys.indexOf(key);
2567
+ if (from >= 0 && to >= 0) {
2568
+ const range = pageKeys.slice(Math.min(from, to), Math.max(from, to) + 1);
2569
+ const next2 = new Set(selected);
2570
+ const turningOn = !selected.has(key);
2571
+ range.forEach((id) => turningOn ? next2.add(id) : next2.delete(id));
2572
+ setKeys([...next2]);
2573
+ return;
2574
+ }
2575
+ }
2576
+ anchor.current = key;
2577
+ const next = new Set(selected);
2578
+ if (next.has(key)) next.delete(key);
2579
+ else next.add(key);
2580
+ setKeys([...next]);
2581
+ };
2582
+ const pageSelected = pageKeys.length > 0 && pageKeys.every((key) => selected.has(key));
2583
+ const pagePartial = !pageSelected && pageKeys.some((key) => selected.has(key));
2584
+ const togglePage = () => {
2585
+ const next = new Set(selected);
2586
+ if (pageSelected) pageKeys.forEach((key) => next.delete(key));
2587
+ else pageKeys.forEach((key) => next.add(key));
2588
+ setKeys([...next]);
2589
+ };
2590
+ return {
2591
+ selected,
2592
+ count: value.allMatching ? void 0 : value.keys.length,
2593
+ allMatching: value.allMatching,
2594
+ pageSelected,
2595
+ pagePartial,
2596
+ toggle,
2597
+ togglePage,
2598
+ /** Escalates from "this page" to "everything the filter matches". */
2599
+ selectAllMatching: () => onChange({ keys: value.keys, allMatching: true }),
2600
+ clear: () => {
2601
+ anchor.current = null;
2602
+ onChange({ keys: [], allMatching: false });
2603
+ }
2604
+ };
2605
+ }
2606
+ var SELECT_WIDTH = 44;
2607
+ var EXPAND_WIDTH = 40;
2608
+ function DataTable({
2609
+ columns,
2610
+ data,
2611
+ rowKey,
2612
+ total,
2613
+ loading = false,
2614
+ error,
2615
+ onRetry,
2616
+ query,
2617
+ onQueryChange,
2618
+ selection,
2619
+ onSelectionChange,
2620
+ bulkActions,
2621
+ renderExpanded,
2622
+ onRowClick,
2623
+ layout: controlledLayout,
2624
+ onLayoutChange,
2625
+ persistKey = null,
2626
+ toolbar,
2627
+ autoFit = true,
2628
+ density = "normal",
2629
+ stickyHeader = true,
2630
+ emptyState,
2631
+ pageSizeOptions,
2632
+ labels: labelsProp,
2633
+ locale,
2634
+ caption,
2635
+ className
2636
+ }) {
2637
+ const labels = resolveLabels(labelsProp);
2638
+ const rootRef = React39__namespace.useRef(null);
2639
+ const scrollerRef = React39__namespace.useRef(null);
2640
+ const [scrolled, setScrolled] = React39__namespace.useState({ left: false, right: false });
2641
+ const [expanded, setExpanded] = React39__namespace.useState(/* @__PURE__ */ new Set());
2642
+ const [editing, setEditing] = React39__namespace.useState(null);
2643
+ const {
2644
+ layout,
2645
+ visible,
2646
+ widthOf,
2647
+ minWidthOf,
2648
+ setWidth,
2649
+ toggleHidden,
2650
+ setPinned,
2651
+ move,
2652
+ moveTo,
2653
+ reset,
2654
+ fitTo
2655
+ } = useColumnLayout({ columns, persistKey, layout: controlledLayout, onLayoutChange });
2656
+ const resize = useColumnResize({ rootRef, widthOf, minWidthOf, onCommit: setWidth });
2657
+ const selectable = Boolean(selection && onSelectionChange);
2658
+ const pageKeys = React39__namespace.useMemo(() => data.map(rowKey), [data, rowKey]);
2659
+ const rows = useRowSelection({
2660
+ value: selection ?? { keys: [], allMatching: false },
2661
+ onChange: onSelectionChange ?? (() => {
2662
+ }),
2663
+ pageKeys
2664
+ });
2665
+ const lastFitWidth = React39__namespace.useRef(0);
2666
+ React39__namespace.useEffect(() => {
2667
+ const scroller = scrollerRef.current;
2668
+ if (!scroller || !autoFit) return;
2669
+ const controls = (selectable ? SELECT_WIDTH : 0) + (renderExpanded ? EXPAND_WIDTH : 0);
2670
+ const run = () => {
2671
+ const available = scroller.clientWidth - controls - 2;
2672
+ if (Math.abs(available - lastFitWidth.current) < 1) return;
2673
+ lastFitWidth.current = available;
2674
+ fitTo(available);
2675
+ };
2676
+ run();
2677
+ const observer = new ResizeObserver(run);
2678
+ observer.observe(scroller);
2679
+ return () => observer.disconnect();
2680
+ }, [autoFit, fitTo, selectable, renderExpanded, layout.hidden, layout.order]);
2681
+ React39__namespace.useEffect(() => {
2682
+ const scroller = scrollerRef.current;
2683
+ if (!scroller) return;
2684
+ const update = () => {
2685
+ const max = scroller.scrollWidth - scroller.clientWidth;
2686
+ setScrolled({ left: scroller.scrollLeft > 1, right: scroller.scrollLeft < max - 1 });
2687
+ };
2688
+ update();
2689
+ scroller.addEventListener("scroll", update, { passive: true });
2690
+ const observer = new ResizeObserver(update);
2691
+ observer.observe(scroller);
2692
+ return () => {
2693
+ scroller.removeEventListener("scroll", update);
2694
+ observer.disconnect();
2695
+ };
2696
+ }, [visible.length, data.length]);
2697
+ const offsets = React39__namespace.useMemo(() => {
2698
+ const result = /* @__PURE__ */ new Map();
2699
+ let leftParts = selectable ? [`${SELECT_WIDTH}px`] : [];
2700
+ if (renderExpanded) leftParts = [...leftParts, `${EXPAND_WIDTH}px`];
2701
+ for (const column of visible) {
2702
+ if (layout.pinned[column.id] !== "left") continue;
2703
+ result.set(column.id, leftParts.length ? `calc(${leftParts.join(" + ")})` : "0px");
2704
+ leftParts.push(`var(--mz-dt-w-${cssSafe(column.id)}, ${widthOf(column.id)}px)`);
2705
+ }
2706
+ const rightParts = [];
2707
+ for (const column of [...visible].reverse()) {
2708
+ if (layout.pinned[column.id] !== "right") continue;
2709
+ result.set(column.id, rightParts.length ? `calc(${rightParts.join(" + ")})` : "0px");
2710
+ rightParts.push(`var(--mz-dt-w-${cssSafe(column.id)}, ${widthOf(column.id)}px)`);
2711
+ }
2712
+ return result;
2713
+ }, [visible, layout.pinned, widthOf, selectable, renderExpanded]);
2714
+ const widthVars = React39__namespace.useMemo(() => {
2715
+ const style = {};
2716
+ for (const column of visible) {
2717
+ style[`--mz-dt-w-${cssSafe(column.id)}`] = `${widthOf(column.id)}px`;
2718
+ }
2719
+ return style;
2720
+ }, [visible, widthOf]);
2721
+ const leftPinned = visible.filter((c) => layout.pinned[c.id] === "left");
2722
+ const rightPinned = visible.filter((c) => layout.pinned[c.id] === "right");
2723
+ const lastLeftPinned = leftPinned[leftPinned.length - 1]?.id;
2724
+ const firstRightPinned = rightPinned[0]?.id;
2725
+ const pinEdgeOf = (id) => id === lastLeftPinned ? "left" : id === firstRightPinned ? "right" : void 0;
2726
+ const controlPinEdge = leftPinned.length === 0 ? "left" : void 0;
2727
+ const chips = activeFilters(query.filters);
2728
+ const columnById = React39__namespace.useMemo(() => new Map(columns.map((c) => [c.id, c])), [columns]);
2729
+ const labelOf = (id) => {
2730
+ const column = columnById.get(id);
2731
+ return column?.label ?? (typeof column?.header === "string" ? column.header : id);
2732
+ };
2733
+ const toggleExpanded = (key) => setExpanded((current) => {
2734
+ const next = new Set(current);
2735
+ if (next.has(key)) next.delete(key);
2736
+ else next.add(key);
2737
+ return next;
2738
+ });
2739
+ const fillerIndex = visible.length - rightPinned.length;
2740
+ const colSpan = visible.length + 1 + (selectable ? 1 : 0) + (renderExpanded ? 1 : 0);
2741
+ const selectionCount = rows.allMatching ? total : rows.count;
2742
+ const renderHeaderCells = (list) => list.map((column) => {
2743
+ const { dir, index } = sortStateOf(query, column.id);
2744
+ const pinned = layout.pinned[column.id];
2745
+ const label = labelOf(column.id);
2746
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2747
+ "th",
2748
+ {
2749
+ "data-col": column.id,
2750
+ "data-pinned": pinned,
2751
+ "data-pin-edge": pinEdgeOf(column.id),
2752
+ "data-align": column.align,
2753
+ "aria-sort": dir === "asc" ? "ascending" : dir === "desc" ? "descending" : "none",
2754
+ className: "mz-dt__th",
2755
+ style: pinned ? { [pinned]: offsets.get(column.id) } : void 0,
2756
+ children: [
2757
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mz-dt__th-inner", children: [
2758
+ column.sortable ? /* @__PURE__ */ jsxRuntime.jsxs(
2759
+ "button",
2760
+ {
2761
+ type: "button",
2762
+ className: "mz-dt__sort mz-focusable",
2763
+ title: labels.sortBy(label),
2764
+ onClick: (event) => onQueryChange(toggleSort(query, column.id, event.shiftKey)),
2765
+ children: [
2766
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mz-dt__th-label", children: column.header }),
2767
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "mz-dt__sort-icon", "data-active": dir ? true : void 0, children: [
2768
+ dir === "asc" ? /* @__PURE__ */ jsxRuntime.jsx(ArrowUpIcon, {}) : dir === "desc" ? /* @__PURE__ */ jsxRuntime.jsx(ArrowDownIcon, {}) : /* @__PURE__ */ jsxRuntime.jsx(SortIcon, {}),
2769
+ index ? /* @__PURE__ */ jsxRuntime.jsx("b", { children: index }) : null
2770
+ ] })
2771
+ ]
2772
+ }
2773
+ ) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mz-dt__th-label", title: column.headerTitle, children: column.header }),
2774
+ column.filter ? /* @__PURE__ */ jsxRuntime.jsx(
2775
+ ColumnFilter,
2776
+ {
2777
+ columnLabel: label,
2778
+ def: column.filter,
2779
+ value: query.filters[column.id],
2780
+ onApply: (value) => onQueryChange(setFilter(query, column.id, value))
2781
+ }
2782
+ ) : null
2783
+ ] }),
2784
+ column.resizable === false ? null : /* @__PURE__ */ jsxRuntime.jsx(
2785
+ "span",
2786
+ {
2787
+ role: "separator",
2788
+ "aria-orientation": "vertical",
2789
+ "aria-label": labels.columnWidth(label),
2790
+ tabIndex: 0,
2791
+ className: "mz-dt__resizer mz-focusable",
2792
+ "data-resizing": resize.resizing === column.id || void 0,
2793
+ onPointerDown: (event) => resize.start(event, column.id),
2794
+ onDoubleClick: () => resize.autoFit(column.id),
2795
+ onKeyDown: (event) => resize.onKeyDown(event, column.id)
2796
+ }
2797
+ )
2798
+ ]
2799
+ },
2800
+ column.id
2801
+ );
2802
+ });
2803
+ const renderBodyCells = (row, rowIndex, list) => {
2804
+ const key = rowKey(row);
2805
+ return list.map((column) => {
2806
+ const pinned = layout.pinned[column.id];
2807
+ const isEditing = editing?.key === key && editing.col === column.id;
2808
+ return /* @__PURE__ */ jsxRuntime.jsx(
2809
+ "td",
2810
+ {
2811
+ "data-col": column.id,
2812
+ "data-pinned": pinned,
2813
+ "data-pin-edge": pinEdgeOf(column.id),
2814
+ "data-align": column.align,
2815
+ "data-editable": column.editable ? true : void 0,
2816
+ className: "mz-dt__td",
2817
+ style: pinned ? { [pinned]: offsets.get(column.id) } : void 0,
2818
+ onDoubleClick: column.editable ? (event) => {
2819
+ event.stopPropagation();
2820
+ setEditing({ key, col: column.id });
2821
+ } : void 0,
2822
+ children: isEditing && column.editable ? /* @__PURE__ */ jsxRuntime.jsx(
2823
+ CellEditor,
2824
+ {
2825
+ row,
2826
+ def: column.editable,
2827
+ onDone: () => setEditing(null)
2828
+ }
2829
+ ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mz-dt__cell", children: column.cell ? column.cell(row, { rowIndex }) : column.accessor?.(row) })
2830
+ },
2831
+ column.id
2832
+ );
2833
+ });
2834
+ };
2835
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2836
+ "div",
2837
+ {
2838
+ ref: rootRef,
2839
+ "data-slot": "data-table",
2840
+ "data-density": density,
2841
+ className: cn("mz-dt", className),
2842
+ style: widthVars,
2843
+ children: [
2844
+ (toolbar || chips.length > 0 || columns.some((c) => c.hideable !== false)) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mz-dt__toolbar", children: [
2845
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mz-dt__toolbar-main", children: toolbar }),
2846
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mz-dt__toolbar-side", children: /* @__PURE__ */ jsxRuntime.jsx(
2847
+ ColumnManager,
2848
+ {
2849
+ columns,
2850
+ layout,
2851
+ labels: labelsProp,
2852
+ onToggleHidden: toggleHidden,
2853
+ onSetPinned: setPinned,
2854
+ onMove: move,
2855
+ onMoveTo: moveTo,
2856
+ onReset: reset
2857
+ }
2858
+ ) })
2859
+ ] }),
2860
+ chips.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mz-dt__chips", children: [
2861
+ chips.map(([id, value]) => /* @__PURE__ */ jsxRuntime.jsx(
2862
+ FilterChip,
2863
+ {
2864
+ label: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2865
+ /* @__PURE__ */ jsxRuntime.jsx("b", { children: labelOf(id) }),
2866
+ describeFilter(value, columnById.get(id)?.filter, labels)
2867
+ ] }),
2868
+ clearLabel: labels.clearFilter,
2869
+ onClear: () => onQueryChange(setFilter(query, id, void 0))
2870
+ },
2871
+ id
2872
+ )),
2873
+ /* @__PURE__ */ jsxRuntime.jsx(
2874
+ Button,
2875
+ {
2876
+ variant: "link",
2877
+ size: "xs",
2878
+ onClick: () => onQueryChange({ ...query, filters: {}, page: 1 }),
2879
+ children: labels.resetAll
2880
+ }
2881
+ )
2882
+ ] }),
2883
+ /* @__PURE__ */ jsxRuntime.jsxs(
2884
+ "div",
2885
+ {
2886
+ ref: scrollerRef,
2887
+ className: "mz-dt__scroller",
2888
+ "data-scrolled-left": scrolled.left || void 0,
2889
+ "data-scrolled-right": scrolled.right || void 0,
2890
+ children: [
2891
+ /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "mz-dt__table", "data-sticky": stickyHeader || void 0, children: [
2892
+ caption ? /* @__PURE__ */ jsxRuntime.jsx("caption", { className: "mz-sr-only", children: caption }) : null,
2893
+ /* @__PURE__ */ jsxRuntime.jsxs("colgroup", { children: [
2894
+ selectable ? /* @__PURE__ */ jsxRuntime.jsx("col", { style: { width: SELECT_WIDTH } }) : null,
2895
+ renderExpanded ? /* @__PURE__ */ jsxRuntime.jsx("col", { style: { width: EXPAND_WIDTH } }) : null,
2896
+ visible.slice(0, fillerIndex).map((column) => /* @__PURE__ */ jsxRuntime.jsx(
2897
+ "col",
2898
+ {
2899
+ style: { width: `var(--mz-dt-w-${cssSafe(column.id)}, ${widthOf(column.id)}px)` }
2900
+ },
2901
+ column.id
2902
+ )),
2903
+ /* @__PURE__ */ jsxRuntime.jsx("col", { className: "mz-dt__col-filler" }),
2904
+ visible.slice(fillerIndex).map((column) => /* @__PURE__ */ jsxRuntime.jsx(
2905
+ "col",
2906
+ {
2907
+ style: { width: `var(--mz-dt-w-${cssSafe(column.id)}, ${widthOf(column.id)}px)` }
2908
+ },
2909
+ column.id
2910
+ ))
2911
+ ] }),
2912
+ /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
2913
+ selectable ? /* @__PURE__ */ jsxRuntime.jsx(
2914
+ "th",
2915
+ {
2916
+ className: "mz-dt__th mz-dt__th--control",
2917
+ "data-pinned": "left",
2918
+ "data-pin-edge": renderExpanded ? void 0 : controlPinEdge,
2919
+ style: { left: 0 },
2920
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2921
+ Checkbox,
2922
+ {
2923
+ size: "sm",
2924
+ "aria-label": labels.selectPage,
2925
+ checked: rows.pageSelected ? true : rows.pagePartial ? "indeterminate" : false,
2926
+ onCheckedChange: rows.togglePage
2927
+ }
2928
+ )
2929
+ }
2930
+ ) : null,
2931
+ renderExpanded ? /* @__PURE__ */ jsxRuntime.jsx(
2932
+ "th",
2933
+ {
2934
+ className: "mz-dt__th mz-dt__th--control",
2935
+ "data-pinned": "left",
2936
+ "data-pin-edge": controlPinEdge,
2937
+ style: { left: selectable ? SELECT_WIDTH : 0 },
2938
+ children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mz-sr-only", children: labels.details })
2939
+ }
2940
+ ) : null,
2941
+ renderHeaderCells(visible.slice(0, fillerIndex)),
2942
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: "mz-dt__th mz-dt__th--filler", "aria-hidden": "true" }),
2943
+ renderHeaderCells(visible.slice(fillerIndex))
2944
+ ] }) }),
2945
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: loading && data.length === 0 ? Array.from({ length: Math.min(query.pageSize, 8) }, (_, index) => /* @__PURE__ */ jsxRuntime.jsx("tr", { className: "mz-dt__row", children: /* @__PURE__ */ jsxRuntime.jsx("td", { className: "mz-dt__td", colSpan, children: /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { style: { height: 14, width: `${60 + index * 13 % 35}%` } }) }) }, `skeleton-${index}`)) : data.map((row, rowIndex) => {
2946
+ const key = rowKey(row);
2947
+ const isOpen = expanded.has(key);
2948
+ return /* @__PURE__ */ jsxRuntime.jsxs(React39__namespace.Fragment, { children: [
2949
+ /* @__PURE__ */ jsxRuntime.jsxs(
2950
+ "tr",
2951
+ {
2952
+ className: "mz-dt__row",
2953
+ "data-selected": rows.selected.has(key) || rows.allMatching || void 0,
2954
+ "data-clickable": onRowClick ? true : void 0,
2955
+ onClick: onRowClick ? () => onRowClick(row) : void 0,
2956
+ children: [
2957
+ selectable ? /* @__PURE__ */ jsxRuntime.jsx(
2958
+ "td",
2959
+ {
2960
+ className: "mz-dt__td mz-dt__td--control",
2961
+ "data-pinned": "left",
2962
+ "data-pin-edge": renderExpanded ? void 0 : controlPinEdge,
2963
+ style: { left: 0 },
2964
+ onClick: (event) => event.stopPropagation(),
2965
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2966
+ Checkbox,
2967
+ {
2968
+ size: "sm",
2969
+ "aria-label": labels.selectRow,
2970
+ checked: rows.selected.has(key) || rows.allMatching,
2971
+ onClick: (event) => rows.toggle(key, { shiftKey: event.shiftKey })
2972
+ }
2973
+ )
2974
+ }
2975
+ ) : null,
2976
+ renderExpanded ? /* @__PURE__ */ jsxRuntime.jsx(
2977
+ "td",
2978
+ {
2979
+ className: "mz-dt__td mz-dt__td--control",
2980
+ "data-pinned": "left",
2981
+ "data-pin-edge": controlPinEdge,
2982
+ style: { left: selectable ? SELECT_WIDTH : 0 },
2983
+ onClick: (event) => event.stopPropagation(),
2984
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2985
+ "button",
2986
+ {
2987
+ type: "button",
2988
+ className: "mz-dt__expand mz-focusable",
2989
+ "data-open": isOpen || void 0,
2990
+ "aria-expanded": isOpen,
2991
+ "aria-label": isOpen ? labels.collapseRow : labels.expandRow,
2992
+ onClick: () => toggleExpanded(key),
2993
+ children: /* @__PURE__ */ jsxRuntime.jsx(ChevronRightIcon, {})
2994
+ }
2995
+ )
2996
+ }
2997
+ ) : null,
2998
+ renderBodyCells(row, rowIndex, visible.slice(0, fillerIndex)),
2999
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "mz-dt__td mz-dt__td--filler", "aria-hidden": "true" }),
3000
+ renderBodyCells(row, rowIndex, visible.slice(fillerIndex))
3001
+ ]
3002
+ }
3003
+ ),
3004
+ isOpen && renderExpanded ? /* @__PURE__ */ jsxRuntime.jsx("tr", { className: "mz-dt__row mz-dt__row--expanded", children: /* @__PURE__ */ jsxRuntime.jsx("td", { className: "mz-dt__td mz-dt__td--expanded", colSpan, children: renderExpanded(row) }) }) : null
3005
+ ] }, key);
3006
+ }) })
3007
+ ] }),
3008
+ !loading && !error && data.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mz-dt__state", children: emptyState ?? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3009
+ /* @__PURE__ */ jsxRuntime.jsx(InboxIcon, {}),
3010
+ /* @__PURE__ */ jsxRuntime.jsx("p", { children: labels.empty }),
3011
+ chips.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
3012
+ Button,
3013
+ {
3014
+ size: "sm",
3015
+ variant: "secondary",
3016
+ onClick: () => onQueryChange({ ...query, filters: {}, page: 1 }),
3017
+ children: labels.resetFilters
3018
+ }
3019
+ ) : null
3020
+ ] }) }) : null,
3021
+ error ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mz-dt__state", "data-tone": "danger", children: [
3022
+ /* @__PURE__ */ jsxRuntime.jsx(AlertIcon, {}),
3023
+ /* @__PURE__ */ jsxRuntime.jsx("p", { children: error }),
3024
+ onRetry ? /* @__PURE__ */ jsxRuntime.jsx(Button, { size: "sm", variant: "secondary", onClick: onRetry, children: labels.retry }) : null
3025
+ ] }) : null,
3026
+ loading && data.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mz-dt__loading-bar", "aria-hidden": "true" }) : null
3027
+ ]
3028
+ }
3029
+ ),
3030
+ /* @__PURE__ */ jsxRuntime.jsx(
3031
+ DataTablePagination,
3032
+ {
3033
+ query,
3034
+ total,
3035
+ rowsOnPage: data.length,
3036
+ pageSizeOptions,
3037
+ labels: labelsProp,
3038
+ locale,
3039
+ onQueryChange
3040
+ }
3041
+ ),
3042
+ selectable && (rows.count ?? 0) > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mz-dt__bulkbar", role: "region", "aria-label": labels.bulkActions, children: [
3043
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "mz-dt__bulkbar-count", children: [
3044
+ labels.selectedCount(
3045
+ selectionCount?.toLocaleString(locale) ?? String(rows.count ?? 0)
3046
+ ),
3047
+ rows.allMatching ? labels.allMatchingSuffix : null
3048
+ ] }),
3049
+ !rows.allMatching && total !== void 0 && rows.pageSelected && total > data.length ? /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "link", size: "xs", onClick: rows.selectAllMatching, children: labels.selectAllMatching(total.toLocaleString(locale)) }) : null,
3050
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mz-dt__bulkbar-actions", children: [
3051
+ bulkActions?.(selection ?? { keys: [], allMatching: false }),
3052
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "ghost", size: "sm", onClick: rows.clear, children: labels.clearSelection })
3053
+ ] })
3054
+ ] }) : null
3055
+ ]
3056
+ }
3057
+ );
3058
+ }
3059
+ function describeFilter(value, def, labels) {
3060
+ switch (value.type) {
3061
+ case "text":
3062
+ return `: \u201C${value.value}\u201D`;
3063
+ case "select": {
3064
+ const options = def?.type === "select" ? def.options : [];
3065
+ const labels2 = value.value.map(
3066
+ (v) => options.find((option) => option.value === v)?.label ?? v
3067
+ );
3068
+ return `: ${labels2.join(", ")}`;
3069
+ }
3070
+ case "number-range":
3071
+ return `: ${value.min ?? "\u2026"}\u2013${value.max ?? "\u2026"}`;
3072
+ case "date-range":
3073
+ return `: ${value.from ?? "\u2026"} \u2013 ${value.to ?? "\u2026"}`;
3074
+ case "boolean":
3075
+ return `: ${value.value ? labels.yes.toLowerCase() : labels.no.toLowerCase()}`;
3076
+ }
3077
+ }
3078
+
3079
+ // src/components/data-table/types.ts
3080
+ var emptyQuery = {
3081
+ sort: [],
3082
+ filters: {},
3083
+ page: 1,
3084
+ pageSize: 25
3085
+ };
3086
+
3087
+ // src/components/data-table/use-table-query.ts
3088
+ function encode(query, prefix) {
3089
+ const params = new URLSearchParams(window.location.search);
3090
+ const set = (key, value) => {
3091
+ if (value) params.set(prefix + key, value);
3092
+ else params.delete(prefix + key);
3093
+ };
3094
+ set("sort", serializeSort(query.sort) || void 0);
3095
+ set("page", query.page > 1 ? String(query.page) : void 0);
3096
+ set("size", String(query.pageSize));
3097
+ set("f", Object.keys(query.filters).length ? JSON.stringify(query.filters) : void 0);
3098
+ return params;
3099
+ }
3100
+ function decode(prefix, fallback) {
3101
+ const params = new URLSearchParams(window.location.search);
3102
+ const get = (key) => params.get(prefix + key);
3103
+ let filters = fallback.filters;
3104
+ const rawFilters = get("f");
3105
+ if (rawFilters) {
3106
+ try {
3107
+ filters = JSON.parse(rawFilters);
3108
+ } catch {
3109
+ filters = {};
3110
+ }
3111
+ }
3112
+ return {
3113
+ sort: get("sort") ? parseSort(get("sort")) : fallback.sort,
3114
+ filters,
3115
+ page: Number(get("page") ?? fallback.page) || 1,
3116
+ pageSize: Number(get("size") ?? fallback.pageSize) || fallback.pageSize
3117
+ };
3118
+ }
3119
+ function useTableQuery({
3120
+ initial,
3121
+ urlKey = null,
3122
+ history = "replace"
3123
+ } = {}) {
3124
+ const base = React39__namespace.useMemo(() => ({ ...emptyQuery, ...initial }), [initial]);
3125
+ const [query, setQuery] = React39__namespace.useState(base);
3126
+ React39__namespace.useEffect(() => {
3127
+ if (urlKey === null || typeof window === "undefined") return;
3128
+ setQuery(decode(urlKey, base));
3129
+ }, [urlKey]);
3130
+ React39__namespace.useEffect(() => {
3131
+ if (urlKey === null || typeof window === "undefined") return;
3132
+ const params = encode(query, urlKey);
3133
+ const search = params.toString();
3134
+ const next = `${window.location.pathname}${search ? `?${search}` : ""}${window.location.hash}`;
3135
+ if (next === `${window.location.pathname}${window.location.search}${window.location.hash}`) return;
3136
+ window.history[history === "push" ? "pushState" : "replaceState"](null, "", next);
3137
+ }, [query, urlKey, history]);
3138
+ React39__namespace.useEffect(() => {
3139
+ if (urlKey === null || typeof window === "undefined") return;
3140
+ const onPop = () => setQuery(decode(urlKey, base));
3141
+ window.addEventListener("popstate", onPop);
3142
+ return () => window.removeEventListener("popstate", onPop);
3143
+ }, [urlKey, base]);
3144
+ const reset = React39__namespace.useCallback(() => setQuery(base), [base]);
3145
+ return { query, setQuery, reset };
3146
+ }
3147
+ function useSavedViews({
3148
+ storageKey = null,
3149
+ views: controlled,
3150
+ onViewsChange
3151
+ } = {}) {
3152
+ const [internal, setInternal] = React39__namespace.useState([]);
3153
+ React39__namespace.useEffect(() => {
3154
+ if (!storageKey || typeof window === "undefined") return;
3155
+ try {
3156
+ const raw = window.localStorage.getItem(storageKey);
3157
+ if (raw) setInternal(JSON.parse(raw));
3158
+ } catch {
3159
+ }
3160
+ }, [storageKey]);
3161
+ const views = controlled ?? internal;
3162
+ const persist = React39__namespace.useCallback(
3163
+ (next) => {
3164
+ setInternal(next);
3165
+ onViewsChange?.(next);
3166
+ if (!storageKey || typeof window === "undefined") return;
3167
+ try {
3168
+ window.localStorage.setItem(storageKey, JSON.stringify(next));
3169
+ } catch {
3170
+ }
3171
+ },
3172
+ [storageKey, onViewsChange]
3173
+ );
3174
+ return {
3175
+ views,
3176
+ save: (view) => persist([...views.filter((v) => v.id !== view.id), view]),
3177
+ remove: (id) => persist(views.filter((v) => v.id !== id))
3178
+ };
3179
+ }
3180
+
3181
+ exports.Accordion = Accordion;
3182
+ exports.AccordionContent = AccordionContent;
3183
+ exports.AccordionItem = AccordionItem;
3184
+ exports.AccordionTrigger = AccordionTrigger;
3185
+ exports.Alert = Alert;
3186
+ exports.AlertDescription = AlertDescription;
3187
+ exports.AlertTitle = AlertTitle;
3188
+ exports.Avatar = Avatar;
3189
+ exports.AvatarFallback = AvatarFallback;
3190
+ exports.AvatarImage = AvatarImage;
3191
+ exports.Badge = Badge;
3192
+ exports.Button = Button;
3193
+ exports.Card = Card;
3194
+ exports.CardAction = CardAction;
3195
+ exports.CardContent = CardContent;
3196
+ exports.CardDescription = CardDescription;
3197
+ exports.CardFooter = CardFooter;
3198
+ exports.CardHeader = CardHeader;
3199
+ exports.CardTitle = CardTitle;
3200
+ exports.Checkbox = Checkbox;
3201
+ exports.ColumnFilter = ColumnFilter;
3202
+ exports.ColumnManager = ColumnManager;
3203
+ exports.DataTable = DataTable;
3204
+ exports.DataTablePagination = DataTablePagination;
3205
+ exports.Dialog = Dialog;
3206
+ exports.DialogClose = DialogClose;
3207
+ exports.DialogContent = DialogContent;
3208
+ exports.DialogDescription = DialogDescription;
3209
+ exports.DialogFooter = DialogFooter;
3210
+ exports.DialogHeader = DialogHeader;
3211
+ exports.DialogOverlay = DialogOverlay;
3212
+ exports.DialogPortal = DialogPortal;
3213
+ exports.DialogTitle = DialogTitle;
3214
+ exports.DialogTrigger = DialogTrigger;
3215
+ exports.DropdownMenu = DropdownMenu;
3216
+ exports.DropdownMenuCheckboxItem = DropdownMenuCheckboxItem;
3217
+ exports.DropdownMenuContent = DropdownMenuContent;
3218
+ exports.DropdownMenuGroup = DropdownMenuGroup;
3219
+ exports.DropdownMenuItem = DropdownMenuItem;
3220
+ exports.DropdownMenuLabel = DropdownMenuLabel;
3221
+ exports.DropdownMenuPortal = DropdownMenuPortal;
3222
+ exports.DropdownMenuRadioGroup = DropdownMenuRadioGroup;
3223
+ exports.DropdownMenuRadioItem = DropdownMenuRadioItem;
3224
+ exports.DropdownMenuSeparator = DropdownMenuSeparator;
3225
+ exports.DropdownMenuShortcut = DropdownMenuShortcut;
3226
+ exports.DropdownMenuSub = DropdownMenuSub;
3227
+ exports.DropdownMenuSubContent = DropdownMenuSubContent;
3228
+ exports.DropdownMenuSubTrigger = DropdownMenuSubTrigger;
3229
+ exports.DropdownMenuTrigger = DropdownMenuTrigger;
3230
+ exports.Field = Field;
3231
+ exports.FieldError = FieldError;
3232
+ exports.FieldHint = FieldHint;
3233
+ exports.FilterChip = FilterChip;
3234
+ exports.Input = Input;
3235
+ exports.Label = Label;
3236
+ exports.MorzeThemeProvider = MorzeThemeProvider;
3237
+ exports.Popover = Popover;
3238
+ exports.PopoverAnchor = PopoverAnchor;
3239
+ exports.PopoverContent = PopoverContent;
3240
+ exports.PopoverDescription = PopoverDescription;
3241
+ exports.PopoverHeader = PopoverHeader;
3242
+ exports.PopoverTitle = PopoverTitle;
3243
+ exports.PopoverTrigger = PopoverTrigger;
3244
+ exports.Progress = Progress;
3245
+ exports.RadioGroup = RadioGroup;
3246
+ exports.RadioGroupItem = RadioGroupItem;
3247
+ exports.Select = Select;
3248
+ exports.SelectContent = SelectContent;
3249
+ exports.SelectGroup = SelectGroup;
3250
+ exports.SelectItem = SelectItem;
3251
+ exports.SelectLabel = SelectLabel;
3252
+ exports.SelectScrollDownButton = SelectScrollDownButton;
3253
+ exports.SelectScrollUpButton = SelectScrollUpButton;
3254
+ exports.SelectSeparator = SelectSeparator;
3255
+ exports.SelectTrigger = SelectTrigger;
3256
+ exports.SelectValue = SelectValue;
3257
+ exports.Separator = Separator;
3258
+ exports.Sheet = Sheet;
3259
+ exports.SheetClose = SheetClose;
3260
+ exports.SheetContent = SheetContent;
3261
+ exports.SheetDescription = SheetDescription;
3262
+ exports.SheetFooter = SheetFooter;
3263
+ exports.SheetHeader = SheetHeader;
3264
+ exports.SheetOverlay = SheetOverlay;
3265
+ exports.SheetPortal = SheetPortal;
3266
+ exports.SheetTitle = SheetTitle;
3267
+ exports.SheetTrigger = SheetTrigger;
3268
+ exports.Sidebar = Sidebar;
3269
+ exports.SidebarContent = SidebarContent;
3270
+ exports.SidebarFooter = SidebarFooter;
3271
+ exports.SidebarGroup = SidebarGroup;
3272
+ exports.SidebarGroupAction = SidebarGroupAction;
3273
+ exports.SidebarGroupContent = SidebarGroupContent;
3274
+ exports.SidebarGroupLabel = SidebarGroupLabel;
3275
+ exports.SidebarHeader = SidebarHeader;
3276
+ exports.SidebarInput = SidebarInput;
3277
+ exports.SidebarInset = SidebarInset;
3278
+ exports.SidebarMenu = SidebarMenu;
3279
+ exports.SidebarMenuAction = SidebarMenuAction;
3280
+ exports.SidebarMenuBadge = SidebarMenuBadge;
3281
+ exports.SidebarMenuButton = SidebarMenuButton;
3282
+ exports.SidebarMenuItem = SidebarMenuItem;
3283
+ exports.SidebarMenuSkeleton = SidebarMenuSkeleton;
3284
+ exports.SidebarMenuSub = SidebarMenuSub;
3285
+ exports.SidebarMenuSubButton = SidebarMenuSubButton;
3286
+ exports.SidebarMenuSubItem = SidebarMenuSubItem;
3287
+ exports.SidebarPanel = SidebarPanel;
3288
+ exports.SidebarProvider = SidebarProvider;
3289
+ exports.SidebarRail = SidebarRail;
3290
+ exports.SidebarSeparator = SidebarSeparator;
3291
+ exports.SidebarTrigger = SidebarTrigger;
3292
+ exports.Skeleton = Skeleton;
3293
+ exports.Slider = Slider;
3294
+ exports.Spinner = Spinner;
3295
+ exports.Switch = Switch;
3296
+ exports.Tabs = Tabs;
3297
+ exports.TabsContent = TabsContent;
3298
+ exports.TabsList = TabsList;
3299
+ exports.TabsTrigger = TabsTrigger;
3300
+ exports.Textarea = Textarea;
3301
+ exports.Toggle = Toggle;
3302
+ exports.ToggleGroup = ToggleGroup;
3303
+ exports.ToggleGroupItem = ToggleGroupItem;
3304
+ exports.Tooltip = Tooltip;
3305
+ exports.TooltipContent = TooltipContent;
3306
+ exports.TooltipProvider = TooltipProvider;
3307
+ exports.TooltipTrigger = TooltipTrigger;
3308
+ exports.activeFilters = activeFilters;
3309
+ exports.badgeVariants = badgeVariants;
3310
+ exports.buttonVariants = buttonVariants;
3311
+ exports.cn = cn;
3312
+ exports.defaultDataTableLabels = defaultDataTableLabels;
3313
+ exports.emptyQuery = emptyQuery;
3314
+ exports.isFilterActive = isFilterActive;
3315
+ exports.pageCount = pageCount;
3316
+ exports.parseSort = parseSort;
3317
+ exports.resolveLabels = resolveLabels;
3318
+ exports.serializeSort = serializeSort;
3319
+ exports.setFilter = setFilter;
3320
+ exports.sortStateOf = sortStateOf;
3321
+ exports.toggleSort = toggleSort;
3322
+ exports.toggleVariants = toggleVariants;
3323
+ exports.useColumnLayout = useColumnLayout;
3324
+ exports.useIsMobile = useIsMobile;
3325
+ exports.useMorzeTheme = useMorzeTheme;
3326
+ exports.useRowSelection = useRowSelection;
3327
+ exports.useSavedViews = useSavedViews;
3328
+ exports.useSidebar = useSidebar;
3329
+ exports.useTableQuery = useTableQuery;
3330
+ //# sourceMappingURL=index.cjs.map
3331
+ //# sourceMappingURL=index.cjs.map