@aortl/admin-react 0.17.0 → 0.18.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/CHANGELOG.md +19 -1
- package/dist/Alert.d.ts +9 -2
- package/dist/Alert.d.ts.map +1 -1
- package/dist/Avatar.d.ts +8 -3
- package/dist/Avatar.d.ts.map +1 -1
- package/dist/Card.d.ts +4 -1
- package/dist/Card.d.ts.map +1 -1
- package/dist/Dialog.d.ts +4 -1
- package/dist/Dialog.d.ts.map +1 -1
- package/dist/Drawer.d.ts +51 -0
- package/dist/Drawer.d.ts.map +1 -0
- package/dist/Field.d.ts +4 -1
- package/dist/Field.d.ts.map +1 -1
- package/dist/Indicator.d.ts +3 -1
- package/dist/Indicator.d.ts.map +1 -1
- package/dist/Input.d.ts +19 -2
- package/dist/Input.d.ts.map +1 -1
- package/dist/Item.d.ts +55 -0
- package/dist/Item.d.ts.map +1 -0
- package/dist/Menu.d.ts +7 -5
- package/dist/Menu.d.ts.map +1 -1
- package/dist/NumberInput.d.ts +28 -0
- package/dist/NumberInput.d.ts.map +1 -0
- package/dist/Pagination.d.ts +4 -1
- package/dist/Pagination.d.ts.map +1 -1
- package/dist/PropertyList.d.ts +10 -3
- package/dist/PropertyList.d.ts.map +1 -1
- package/dist/Sidebar.d.ts +16 -5
- package/dist/Sidebar.d.ts.map +1 -1
- package/dist/StatCard.d.ts +16 -1
- package/dist/StatCard.d.ts.map +1 -1
- package/dist/Table.d.ts +14 -1
- package/dist/Table.d.ts.map +1 -1
- package/dist/Timeline.d.ts +29 -0
- package/dist/Timeline.d.ts.map +1 -0
- package/dist/Tooltip.d.ts +4 -1
- package/dist/Tooltip.d.ts.map +1 -1
- package/dist/admin.scoped.css +621 -14
- package/dist/cn.d.ts +7 -0
- package/dist/cn.d.ts.map +1 -1
- package/dist/dialog-internal.d.ts +17 -0
- package/dist/dialog-internal.d.ts.map +1 -0
- package/dist/index.cjs +640 -101
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +7 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +635 -102
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -5,6 +5,7 @@ let react = require("react");
|
|
|
5
5
|
let _base_ui_react_avatar = require("@base-ui/react/avatar");
|
|
6
6
|
let _base_ui_react_button = require("@base-ui/react/button");
|
|
7
7
|
let _base_ui_react_input = require("@base-ui/react/input");
|
|
8
|
+
let _base_ui_react_number_field = require("@base-ui/react/number-field");
|
|
8
9
|
let _base_ui_react_field = require("@base-ui/react/field");
|
|
9
10
|
let _base_ui_react_checkbox = require("@base-ui/react/checkbox");
|
|
10
11
|
let _base_ui_react_radio = require("@base-ui/react/radio");
|
|
@@ -115,17 +116,47 @@ function renderIcon(icon, size = "1em") {
|
|
|
115
116
|
}
|
|
116
117
|
//#endregion
|
|
117
118
|
//#region src/Alert.tsx
|
|
118
|
-
function
|
|
119
|
+
function DismissIcon() {
|
|
120
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
121
|
+
width: "1em",
|
|
122
|
+
height: "1em",
|
|
123
|
+
viewBox: "0 0 24 24",
|
|
124
|
+
fill: "none",
|
|
125
|
+
stroke: "currentColor",
|
|
126
|
+
strokeWidth: "2",
|
|
127
|
+
strokeLinecap: "round",
|
|
128
|
+
strokeLinejoin: "round",
|
|
129
|
+
"aria-hidden": "true",
|
|
130
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M18 6 6 18" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "m6 6 12 12" })]
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
function AlertRoot({ variant, icon, title, description, action, onDismiss, dismissLabel = "Dismiss", classNames, className, role, children, ...rest }) {
|
|
119
134
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
120
135
|
role: role ?? (variant === "danger" || variant === "warning" ? "alert" : "status"),
|
|
121
136
|
className: cn(["alert", `alert-${variant}`], className),
|
|
122
137
|
...rest,
|
|
123
138
|
children: [
|
|
124
139
|
renderIcon(icon),
|
|
125
|
-
title !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AlertTitle, {
|
|
126
|
-
|
|
140
|
+
title !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AlertTitle, {
|
|
141
|
+
className: classNames?.title,
|
|
142
|
+
children: title
|
|
143
|
+
}) : null,
|
|
144
|
+
description !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AlertDescription, {
|
|
145
|
+
className: classNames?.description,
|
|
146
|
+
children: description
|
|
147
|
+
}) : null,
|
|
127
148
|
children,
|
|
128
|
-
action !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AlertAction, {
|
|
149
|
+
action !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AlertAction, {
|
|
150
|
+
className: classNames?.action,
|
|
151
|
+
children: action
|
|
152
|
+
}) : null,
|
|
153
|
+
onDismiss ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
154
|
+
type: "button",
|
|
155
|
+
className: cn("alert-dismiss", classNames?.dismiss),
|
|
156
|
+
"aria-label": dismissLabel,
|
|
157
|
+
onClick: onDismiss,
|
|
158
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DismissIcon, {})
|
|
159
|
+
}) : null
|
|
129
160
|
]
|
|
130
161
|
});
|
|
131
162
|
}
|
|
@@ -284,11 +315,23 @@ function Avatar({ src, alt, initials, size = "md", shape = "circle", className,
|
|
|
284
315
|
}) : null]
|
|
285
316
|
});
|
|
286
317
|
}
|
|
287
|
-
/** Overlapping stack of avatars; later children paint on top. */
|
|
288
|
-
function AvatarGroup({ className, ...rest }) {
|
|
289
|
-
|
|
318
|
+
/** Overlapping stack of avatars; later children paint on top. `max` caps the visible count. */
|
|
319
|
+
function AvatarGroup({ max, size = "md", className, children, ...rest }) {
|
|
320
|
+
const items = react.Children.toArray(children);
|
|
321
|
+
const overflow = max !== void 0 && items.length > max ? items.length - max : 0;
|
|
322
|
+
const visible = overflow > 0 ? items.slice(0, max) : items;
|
|
323
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
290
324
|
className: cn("avatar-group", className),
|
|
291
|
-
...rest
|
|
325
|
+
...rest,
|
|
326
|
+
children: [visible, overflow > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
327
|
+
className: cn([
|
|
328
|
+
"avatar",
|
|
329
|
+
size !== "md" && `avatar-${size}`,
|
|
330
|
+
"avatar-more"
|
|
331
|
+
], void 0),
|
|
332
|
+
"aria-label": `+${overflow} more`,
|
|
333
|
+
children: ["+", overflow]
|
|
334
|
+
}) : null]
|
|
292
335
|
});
|
|
293
336
|
}
|
|
294
337
|
//#endregion
|
|
@@ -616,9 +659,52 @@ var Breadcrumbs = Object.assign(BreadcrumbsRoot, {
|
|
|
616
659
|
});
|
|
617
660
|
//#endregion
|
|
618
661
|
//#region src/Input.tsx
|
|
619
|
-
function
|
|
620
|
-
|
|
662
|
+
function ClearIcon() {
|
|
663
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
664
|
+
width: "1em",
|
|
665
|
+
height: "1em",
|
|
666
|
+
viewBox: "0 0 24 24",
|
|
667
|
+
fill: "none",
|
|
668
|
+
stroke: "currentColor",
|
|
669
|
+
strokeWidth: "2",
|
|
670
|
+
strokeLinecap: "round",
|
|
671
|
+
strokeLinejoin: "round",
|
|
672
|
+
"aria-hidden": "true",
|
|
673
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M18 6 6 18" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "m6 6 12 12" })]
|
|
674
|
+
});
|
|
675
|
+
}
|
|
676
|
+
function Input({ variant = "bordered", inputSize = "md", icon, iconTrailing, clearable = false, clearLabel = "Clear", onClear, action, className, classNames, type = "text", value, defaultValue, onChange, disabled, readOnly, ref: consumerRef, ...rest }) {
|
|
677
|
+
const innerRef = (0, react.useRef)(null);
|
|
678
|
+
const isControlled = value !== void 0;
|
|
679
|
+
const [uncontrolledHasValue, setUncontrolledHasValue] = (0, react.useState)(() => defaultValue != null && String(defaultValue).length > 0);
|
|
680
|
+
const hasValue = isControlled ? value != null && String(value).length > 0 : uncontrolledHasValue;
|
|
681
|
+
const setRef = (0, react.useCallback)((node) => {
|
|
682
|
+
innerRef.current = node;
|
|
683
|
+
if (typeof consumerRef === "function") consumerRef(node);
|
|
684
|
+
else if (consumerRef) consumerRef.current = node;
|
|
685
|
+
}, [consumerRef]);
|
|
686
|
+
function handleChange(event) {
|
|
687
|
+
if (!isControlled) setUncontrolledHasValue(event.target.value.length > 0);
|
|
688
|
+
onChange?.(event);
|
|
689
|
+
}
|
|
690
|
+
function handleClear() {
|
|
691
|
+
const input = innerRef.current;
|
|
692
|
+
if (!input) return;
|
|
693
|
+
(Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set)?.call(input, "");
|
|
694
|
+
input.dispatchEvent(new Event("input", { bubbles: true }));
|
|
695
|
+
input.focus();
|
|
696
|
+
if (!isControlled) setUncontrolledHasValue(false);
|
|
697
|
+
onClear?.();
|
|
698
|
+
}
|
|
699
|
+
const showClear = clearable && hasValue && !disabled && !readOnly;
|
|
700
|
+
const inputEl = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_input.Input, {
|
|
701
|
+
ref: setRef,
|
|
621
702
|
type,
|
|
703
|
+
value,
|
|
704
|
+
defaultValue,
|
|
705
|
+
onChange: handleChange,
|
|
706
|
+
disabled,
|
|
707
|
+
readOnly,
|
|
622
708
|
className: cn([
|
|
623
709
|
"input",
|
|
624
710
|
variant !== "bordered" && `input-${variant}`,
|
|
@@ -626,16 +712,72 @@ function Input({ variant = "bordered", inputSize = "md", icon, iconTrailing, cla
|
|
|
626
712
|
], className),
|
|
627
713
|
...rest
|
|
628
714
|
});
|
|
629
|
-
if (icon
|
|
715
|
+
if (!(icon != null || iconTrailing != null || action != null || clearable)) return inputEl;
|
|
716
|
+
const trailing = showClear ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
717
|
+
type: "button",
|
|
718
|
+
className: cn("input-action", classNames?.action),
|
|
719
|
+
"aria-label": clearLabel,
|
|
720
|
+
onClick: handleClear,
|
|
721
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ClearIcon, {})
|
|
722
|
+
}) : action ?? renderIcon(iconTrailing);
|
|
630
723
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
631
|
-
className: cn("input-icon",
|
|
724
|
+
className: cn("input-icon", classNames?.wrapper),
|
|
632
725
|
children: [
|
|
633
726
|
renderIcon(icon),
|
|
634
|
-
|
|
635
|
-
|
|
727
|
+
inputEl,
|
|
728
|
+
trailing
|
|
729
|
+
]
|
|
730
|
+
});
|
|
731
|
+
}
|
|
732
|
+
function EyeIcon() {
|
|
733
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
734
|
+
width: "1em",
|
|
735
|
+
height: "1em",
|
|
736
|
+
viewBox: "0 0 24 24",
|
|
737
|
+
fill: "none",
|
|
738
|
+
stroke: "currentColor",
|
|
739
|
+
strokeWidth: "2",
|
|
740
|
+
strokeLinecap: "round",
|
|
741
|
+
strokeLinejoin: "round",
|
|
742
|
+
"aria-hidden": "true",
|
|
743
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6" })]
|
|
744
|
+
});
|
|
745
|
+
}
|
|
746
|
+
function EyeOffIcon() {
|
|
747
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
748
|
+
width: "1em",
|
|
749
|
+
height: "1em",
|
|
750
|
+
viewBox: "0 0 24 24",
|
|
751
|
+
fill: "none",
|
|
752
|
+
stroke: "currentColor",
|
|
753
|
+
strokeWidth: "2",
|
|
754
|
+
strokeLinecap: "round",
|
|
755
|
+
strokeLinejoin: "round",
|
|
756
|
+
"aria-hidden": "true",
|
|
757
|
+
children: [
|
|
758
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M10.585 10.587a2 2 0 0 0 2.829 2.828" }),
|
|
759
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87" }),
|
|
760
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M3 3l18 18" })
|
|
636
761
|
]
|
|
637
762
|
});
|
|
638
763
|
}
|
|
764
|
+
/** Password field with a trailing reveal toggle. Emits the same `.input` / `.input-action` classes. */
|
|
765
|
+
function PasswordInput({ revealLabel = "Show password", classNames, ...rest }) {
|
|
766
|
+
const [revealed, setRevealed] = (0, react.useState)(false);
|
|
767
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Input, {
|
|
768
|
+
type: revealed ? "text" : "password",
|
|
769
|
+
action: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
770
|
+
type: "button",
|
|
771
|
+
className: cn("input-action", classNames?.action),
|
|
772
|
+
"aria-label": revealLabel,
|
|
773
|
+
"aria-pressed": revealed,
|
|
774
|
+
onClick: () => setRevealed((v) => !v),
|
|
775
|
+
children: revealed ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EyeOffIcon, {}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EyeIcon, {})
|
|
776
|
+
}),
|
|
777
|
+
classNames,
|
|
778
|
+
...rest
|
|
779
|
+
});
|
|
780
|
+
}
|
|
639
781
|
//#endregion
|
|
640
782
|
//#region src/FileInput.tsx
|
|
641
783
|
function FileInput({ variant = "bordered", inputSize = "md", className, ...rest }) {
|
|
@@ -665,8 +807,69 @@ function InputGroupAddon({ className, ...rest }) {
|
|
|
665
807
|
}
|
|
666
808
|
var InputGroup = Object.assign(InputGroupRoot, { Addon: InputGroupAddon });
|
|
667
809
|
//#endregion
|
|
810
|
+
//#region src/NumberInput.tsx
|
|
811
|
+
function MinusIcon() {
|
|
812
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
813
|
+
width: "1em",
|
|
814
|
+
height: "1em",
|
|
815
|
+
viewBox: "0 0 24 24",
|
|
816
|
+
fill: "none",
|
|
817
|
+
stroke: "currentColor",
|
|
818
|
+
strokeWidth: "2",
|
|
819
|
+
strokeLinecap: "round",
|
|
820
|
+
strokeLinejoin: "round",
|
|
821
|
+
"aria-hidden": "true",
|
|
822
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M5 12h14" })
|
|
823
|
+
});
|
|
824
|
+
}
|
|
825
|
+
function PlusIcon() {
|
|
826
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
827
|
+
width: "1em",
|
|
828
|
+
height: "1em",
|
|
829
|
+
viewBox: "0 0 24 24",
|
|
830
|
+
fill: "none",
|
|
831
|
+
stroke: "currentColor",
|
|
832
|
+
strokeWidth: "2",
|
|
833
|
+
strokeLinecap: "round",
|
|
834
|
+
strokeLinejoin: "round",
|
|
835
|
+
"aria-hidden": "true",
|
|
836
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M12 5v14M5 12h14" })
|
|
837
|
+
});
|
|
838
|
+
}
|
|
839
|
+
/**
|
|
840
|
+
* Numeric field with stepper buttons over Base UI NumberField (clamp-on-blur,
|
|
841
|
+
* step, `Intl` formatting via `format`). The vanilla bundle styles a native
|
|
842
|
+
* `<input type="number">` and steps with `stepUp()` / `stepDown()`.
|
|
843
|
+
*/
|
|
844
|
+
function NumberInput({ size = "md", classNames, placeholder, inputAriaLabel, decrementLabel = "Decrease", incrementLabel = "Increase", decrementIcon, incrementIcon, className, ...rootProps }) {
|
|
845
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_number_field.NumberField.Root, {
|
|
846
|
+
className: cn("number-input-root", className),
|
|
847
|
+
...rootProps,
|
|
848
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_base_ui_react_number_field.NumberField.Group, {
|
|
849
|
+
className: cn(["number-input", size !== "md" && `number-input-${size}`], classNames?.group),
|
|
850
|
+
children: [
|
|
851
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_number_field.NumberField.Decrement, {
|
|
852
|
+
className: cn("number-input-step", classNames?.decrement),
|
|
853
|
+
"aria-label": decrementLabel,
|
|
854
|
+
children: decrementIcon ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MinusIcon, {})
|
|
855
|
+
}),
|
|
856
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_number_field.NumberField.Input, {
|
|
857
|
+
className: cn("number-input-field", classNames?.input),
|
|
858
|
+
placeholder,
|
|
859
|
+
"aria-label": inputAriaLabel
|
|
860
|
+
}),
|
|
861
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_number_field.NumberField.Increment, {
|
|
862
|
+
className: cn("number-input-step", classNames?.increment),
|
|
863
|
+
"aria-label": incrementLabel,
|
|
864
|
+
children: incrementIcon ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PlusIcon, {})
|
|
865
|
+
})
|
|
866
|
+
]
|
|
867
|
+
})
|
|
868
|
+
});
|
|
869
|
+
}
|
|
870
|
+
//#endregion
|
|
668
871
|
//#region src/Indicator.tsx
|
|
669
|
-
function Indicator({ label, variant = "neutral", size = "sm", icon, placement = "top-end", offset, className, "aria-label": ariaLabel, style: styleProp, children, ...rest }) {
|
|
872
|
+
function Indicator({ label, variant = "neutral", size = "sm", icon, placement = "top-end", offset, max, className, "aria-label": ariaLabel, style: styleProp, children, ...rest }) {
|
|
670
873
|
const [vertical, horizontal] = placement.split("-");
|
|
671
874
|
const placementClasses = [
|
|
672
875
|
"indicator-item",
|
|
@@ -674,6 +877,7 @@ function Indicator({ label, variant = "neutral", size = "sm", icon, placement =
|
|
|
674
877
|
horizontal !== "end" && `indicator-${horizontal}`
|
|
675
878
|
];
|
|
676
879
|
const hasContent = label !== void 0 || icon !== void 0;
|
|
880
|
+
const displayLabel = typeof label === "number" && max !== void 0 && label > max ? `${max}+` : label;
|
|
677
881
|
const style = offset !== void 0 ? {
|
|
678
882
|
...styleProp,
|
|
679
883
|
"--indicator-offset": `${offset}px`
|
|
@@ -688,7 +892,7 @@ function Indicator({ label, variant = "neutral", size = "sm", icon, placement =
|
|
|
688
892
|
size,
|
|
689
893
|
icon,
|
|
690
894
|
"aria-label": ariaLabel,
|
|
691
|
-
children:
|
|
895
|
+
children: displayLabel
|
|
692
896
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
693
897
|
className: cn([
|
|
694
898
|
...placementClasses,
|
|
@@ -794,7 +998,7 @@ function range(start, end) {
|
|
|
794
998
|
for (let i = start; i <= end; i++) out.push(i);
|
|
795
999
|
return out;
|
|
796
1000
|
}
|
|
797
|
-
function Pagination({ page, total, onPageChange, siblingCount = 1, boundaryCount = 1, previousIcon, nextIcon, renderItem, className, "aria-label": ariaLabel = "Pagination", ...rest }) {
|
|
1001
|
+
function Pagination({ page, total, onPageChange, siblingCount = 1, boundaryCount = 1, previousIcon, nextIcon, renderItem, className, classNames, "aria-label": ariaLabel = "Pagination", ...rest }) {
|
|
798
1002
|
const items = getPaginationItems({
|
|
799
1003
|
page,
|
|
800
1004
|
total,
|
|
@@ -808,8 +1012,8 @@ function Pagination({ page, total, onPageChange, siblingCount = 1, boundaryCount
|
|
|
808
1012
|
className: cn("pagination", className),
|
|
809
1013
|
...rest,
|
|
810
1014
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", { children: items.map((item, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
|
|
811
|
-
className: cn("page-item",
|
|
812
|
-
children: renderItem ? renderItem(item) : defaultRender(item, onPageChange, prev, next)
|
|
1015
|
+
className: cn("page-item", classNames?.item),
|
|
1016
|
+
children: renderItem ? renderItem(item) : defaultRender(item, onPageChange, prev, next, classNames)
|
|
813
1017
|
}, paginationItemKey(item, i))) })
|
|
814
1018
|
});
|
|
815
1019
|
}
|
|
@@ -850,11 +1054,11 @@ function paginationItemKey(item, index) {
|
|
|
850
1054
|
default: return `${index}`;
|
|
851
1055
|
}
|
|
852
1056
|
}
|
|
853
|
-
function defaultRender(item, onPageChange, prev, next) {
|
|
1057
|
+
function defaultRender(item, onPageChange, prev, next, classNames) {
|
|
854
1058
|
switch (item.type) {
|
|
855
1059
|
case "previous": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
856
1060
|
type: "button",
|
|
857
|
-
className: cn("page-link",
|
|
1061
|
+
className: cn("page-link", classNames?.link),
|
|
858
1062
|
"aria-label": "Previous page",
|
|
859
1063
|
"aria-disabled": item.disabled || void 0,
|
|
860
1064
|
disabled: item.disabled,
|
|
@@ -863,7 +1067,7 @@ function defaultRender(item, onPageChange, prev, next) {
|
|
|
863
1067
|
});
|
|
864
1068
|
case "next": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
865
1069
|
type: "button",
|
|
866
|
-
className: cn("page-link",
|
|
1070
|
+
className: cn("page-link", classNames?.link),
|
|
867
1071
|
"aria-label": "Next page",
|
|
868
1072
|
"aria-disabled": item.disabled || void 0,
|
|
869
1073
|
disabled: item.disabled,
|
|
@@ -871,13 +1075,13 @@ function defaultRender(item, onPageChange, prev, next) {
|
|
|
871
1075
|
children: next
|
|
872
1076
|
});
|
|
873
1077
|
case "ellipsis": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
874
|
-
className: cn("page-ellipsis",
|
|
1078
|
+
className: cn("page-ellipsis", classNames?.ellipsis),
|
|
875
1079
|
"aria-hidden": "true",
|
|
876
1080
|
children: "…"
|
|
877
1081
|
});
|
|
878
1082
|
case "page": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
879
1083
|
type: "button",
|
|
880
|
-
className: cn(["page-link", item.selected && "active"],
|
|
1084
|
+
className: cn(["page-link", item.selected && "active"], classNames?.link),
|
|
881
1085
|
"aria-current": item.selected ? "page" : void 0,
|
|
882
1086
|
"aria-label": `Page ${item.page}`,
|
|
883
1087
|
onClick: () => onPageChange(item.page),
|
|
@@ -910,7 +1114,7 @@ function CheckboxRoot({ className, children, ...rest }) {
|
|
|
910
1114
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_checkbox.Checkbox.Root, {
|
|
911
1115
|
className: cn("checkbox", className),
|
|
912
1116
|
...rest,
|
|
913
|
-
children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CheckboxIndicator, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CheckIcon$
|
|
1117
|
+
children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CheckboxIndicator, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CheckIcon$2, {}) })
|
|
914
1118
|
});
|
|
915
1119
|
}
|
|
916
1120
|
function CheckboxIndicator({ className, ...rest }) {
|
|
@@ -919,7 +1123,7 @@ function CheckboxIndicator({ className, ...rest }) {
|
|
|
919
1123
|
...rest
|
|
920
1124
|
});
|
|
921
1125
|
}
|
|
922
|
-
function CheckIcon$
|
|
1126
|
+
function CheckIcon$2() {
|
|
923
1127
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
924
1128
|
viewBox: "0 0 24 24",
|
|
925
1129
|
fill: "none",
|
|
@@ -1048,7 +1252,7 @@ function SelectItemIndicator({ className, children, ...rest }) {
|
|
|
1048
1252
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_select.Select.ItemIndicator, {
|
|
1049
1253
|
className: cn("select-item-indicator", className),
|
|
1050
1254
|
...rest,
|
|
1051
|
-
children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CheckIcon, {})
|
|
1255
|
+
children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CheckIcon$1, {})
|
|
1052
1256
|
});
|
|
1053
1257
|
}
|
|
1054
1258
|
function SelectGroup(props) {
|
|
@@ -1060,7 +1264,7 @@ function SelectGroupLabel({ className, ...rest }) {
|
|
|
1060
1264
|
...rest
|
|
1061
1265
|
});
|
|
1062
1266
|
}
|
|
1063
|
-
function CheckIcon() {
|
|
1267
|
+
function CheckIcon$1() {
|
|
1064
1268
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
1065
1269
|
viewBox: "0 0 24 24",
|
|
1066
1270
|
fill: "none",
|
|
@@ -1139,9 +1343,10 @@ function CardContainer({ variant = "default", bordered, compact, scroll, classNa
|
|
|
1139
1343
|
* an optional title (with icon), description, children, and actions. For
|
|
1140
1344
|
* anything outside that shape, use `<Card.Container>` and compose by hand.
|
|
1141
1345
|
*/
|
|
1142
|
-
function CardRoot({ variant, bordered, compact, media, icon, title, description, toolbar, actions, className, children, ...rest }) {
|
|
1346
|
+
function CardRoot({ variant, bordered, compact, media, icon, title, description, toolbar, actions, className, classNames, children, ...rest }) {
|
|
1143
1347
|
const titleEl = icon !== void 0 || title !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CardTitle, {
|
|
1144
1348
|
icon,
|
|
1349
|
+
className: classNames?.title,
|
|
1145
1350
|
children: title
|
|
1146
1351
|
}) : null;
|
|
1147
1352
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(CardContainer, {
|
|
@@ -1150,12 +1355,30 @@ function CardRoot({ variant, bordered, compact, media, icon, title, description,
|
|
|
1150
1355
|
compact,
|
|
1151
1356
|
className,
|
|
1152
1357
|
...rest,
|
|
1153
|
-
children: [media !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CardMedia, {
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1358
|
+
children: [media !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CardMedia, {
|
|
1359
|
+
className: classNames?.media,
|
|
1360
|
+
children: media
|
|
1361
|
+
}) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(CardBody, {
|
|
1362
|
+
className: classNames?.body,
|
|
1363
|
+
children: [
|
|
1364
|
+
toolbar !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(CardHeader, {
|
|
1365
|
+
className: classNames?.header,
|
|
1366
|
+
children: [titleEl, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CardToolbar, {
|
|
1367
|
+
className: classNames?.toolbar,
|
|
1368
|
+
children: toolbar
|
|
1369
|
+
})]
|
|
1370
|
+
}) : titleEl,
|
|
1371
|
+
description !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CardDescription, {
|
|
1372
|
+
className: classNames?.description,
|
|
1373
|
+
children: description
|
|
1374
|
+
}) : null,
|
|
1375
|
+
children,
|
|
1376
|
+
actions !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CardActions, {
|
|
1377
|
+
className: classNames?.actions,
|
|
1378
|
+
children: actions
|
|
1379
|
+
}) : null
|
|
1380
|
+
]
|
|
1381
|
+
})]
|
|
1159
1382
|
});
|
|
1160
1383
|
}
|
|
1161
1384
|
function CardMedia({ className, ...rest }) {
|
|
@@ -1213,12 +1436,17 @@ var Card = Object.assign(CardRoot, {
|
|
|
1213
1436
|
});
|
|
1214
1437
|
//#endregion
|
|
1215
1438
|
//#region src/StatCard.tsx
|
|
1439
|
+
function trendIntent(direction) {
|
|
1440
|
+
if (direction === "down") return "negative";
|
|
1441
|
+
if (direction === "flat") return "neutral";
|
|
1442
|
+
return "positive";
|
|
1443
|
+
}
|
|
1216
1444
|
/**
|
|
1217
1445
|
* Compact KPI tile (label / value / detail) on a `.card` shell, so it shares
|
|
1218
1446
|
* every card modifier — `compact`/`bordered` map to `.card-compact`/`.card-bordered`.
|
|
1219
1447
|
* Free-form tiles: `<Card>`; label/value tables: `<PropertyList>`.
|
|
1220
1448
|
*/
|
|
1221
|
-
function StatCard({ variant = "default", label, value, detail, icon, compact, bordered, className, children, ...rest }) {
|
|
1449
|
+
function StatCard({ variant = "default", label, value, detail, trend, icon, compact, bordered, className, classNames, children, ...rest }) {
|
|
1222
1450
|
const hasLabel = label !== void 0;
|
|
1223
1451
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1224
1452
|
className: cn([
|
|
@@ -1231,15 +1459,21 @@ function StatCard({ variant = "default", label, value, detail, icon, compact, bo
|
|
|
1231
1459
|
...rest,
|
|
1232
1460
|
children: [
|
|
1233
1461
|
hasLabel ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
|
|
1234
|
-
className: cn("stat-card-label",
|
|
1462
|
+
className: cn("stat-card-label", classNames?.label),
|
|
1235
1463
|
children: [renderIcon(icon), label]
|
|
1236
1464
|
}) : null,
|
|
1237
1465
|
value !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1238
|
-
className: cn("stat-card-value",
|
|
1466
|
+
className: cn("stat-card-value", classNames?.value),
|
|
1239
1467
|
children: value
|
|
1240
1468
|
}) : null,
|
|
1469
|
+
trend !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1470
|
+
className: cn("stat-card-trend", classNames?.trend),
|
|
1471
|
+
"data-trend": trend.direction ?? "up",
|
|
1472
|
+
"data-intent": trend.intent ?? trendIntent(trend.direction ?? "up"),
|
|
1473
|
+
children: trend.value
|
|
1474
|
+
}) : null,
|
|
1241
1475
|
detail !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1242
|
-
className: cn("stat-card-detail",
|
|
1476
|
+
className: cn("stat-card-detail", classNames?.detail),
|
|
1243
1477
|
children: detail
|
|
1244
1478
|
}) : null,
|
|
1245
1479
|
children
|
|
@@ -1247,6 +1481,137 @@ function StatCard({ variant = "default", label, value, detail, icon, compact, bo
|
|
|
1247
1481
|
});
|
|
1248
1482
|
}
|
|
1249
1483
|
//#endregion
|
|
1484
|
+
//#region src/Timeline.tsx
|
|
1485
|
+
function TimelineRoot({ numbered, className, ...rest }) {
|
|
1486
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ol", {
|
|
1487
|
+
className: cn(["timeline", numbered && "timeline-numbered"], className),
|
|
1488
|
+
...rest
|
|
1489
|
+
});
|
|
1490
|
+
}
|
|
1491
|
+
function TimelineItem({ status = "default", icon, marker, title, time, description, className, classNames, children, ...rest }) {
|
|
1492
|
+
let indicator;
|
|
1493
|
+
if (marker !== void 0) indicator = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1494
|
+
className: cn("timeline-marker", classNames?.marker),
|
|
1495
|
+
children: marker
|
|
1496
|
+
});
|
|
1497
|
+
else if (icon != null) indicator = renderIcon(icon);
|
|
1498
|
+
else indicator = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: cn("timeline-dot", classNames?.dot) });
|
|
1499
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
1500
|
+
className: cn(["timeline-item", status !== "default" && `timeline-item-${status}`], className),
|
|
1501
|
+
...rest,
|
|
1502
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1503
|
+
className: cn("timeline-indicator", classNames?.indicator),
|
|
1504
|
+
children: indicator
|
|
1505
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1506
|
+
className: cn("timeline-content", classNames?.content),
|
|
1507
|
+
children: [
|
|
1508
|
+
title !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1509
|
+
className: cn("timeline-title", classNames?.title),
|
|
1510
|
+
children: title
|
|
1511
|
+
}) : null,
|
|
1512
|
+
time !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1513
|
+
className: cn("timeline-time", classNames?.time),
|
|
1514
|
+
children: time
|
|
1515
|
+
}) : null,
|
|
1516
|
+
description !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1517
|
+
className: cn("timeline-description", classNames?.description),
|
|
1518
|
+
children: description
|
|
1519
|
+
}) : null,
|
|
1520
|
+
children
|
|
1521
|
+
]
|
|
1522
|
+
})]
|
|
1523
|
+
});
|
|
1524
|
+
}
|
|
1525
|
+
var Timeline = Object.assign(TimelineRoot, { Item: TimelineItem });
|
|
1526
|
+
//#endregion
|
|
1527
|
+
//#region src/Item.tsx
|
|
1528
|
+
/** The bare row primitive — just the `.item` shell, for layouts the default `<Item>` doesn't fit. */
|
|
1529
|
+
function ItemContainer({ variant = "default", size = "md", asLink, className, ...rest }) {
|
|
1530
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1531
|
+
className: cn([
|
|
1532
|
+
"item",
|
|
1533
|
+
variant !== "default" && `item-${variant}`,
|
|
1534
|
+
size !== "md" && `item-${size}`,
|
|
1535
|
+
asLink && "item-link"
|
|
1536
|
+
], className),
|
|
1537
|
+
...rest
|
|
1538
|
+
});
|
|
1539
|
+
}
|
|
1540
|
+
function ItemMedia({ className, ...rest }) {
|
|
1541
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1542
|
+
className: cn("item-media", className),
|
|
1543
|
+
...rest
|
|
1544
|
+
});
|
|
1545
|
+
}
|
|
1546
|
+
function ItemContent({ className, ...rest }) {
|
|
1547
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1548
|
+
className: cn("item-content", className),
|
|
1549
|
+
...rest
|
|
1550
|
+
});
|
|
1551
|
+
}
|
|
1552
|
+
function ItemTitle({ className, ...rest }) {
|
|
1553
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1554
|
+
className: cn("item-title", className),
|
|
1555
|
+
...rest
|
|
1556
|
+
});
|
|
1557
|
+
}
|
|
1558
|
+
function ItemDescription({ className, ...rest }) {
|
|
1559
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1560
|
+
className: cn("item-description", className),
|
|
1561
|
+
...rest
|
|
1562
|
+
});
|
|
1563
|
+
}
|
|
1564
|
+
function ItemActions({ className, ...rest }) {
|
|
1565
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1566
|
+
className: cn("item-actions", className),
|
|
1567
|
+
...rest
|
|
1568
|
+
});
|
|
1569
|
+
}
|
|
1570
|
+
/** Opinionated row with media / title+description / actions shorthand. For other shapes, compose `<Item.Container>`. */
|
|
1571
|
+
function ItemRoot({ media, icon, title, description, actions, classNames, children, ...rest }) {
|
|
1572
|
+
const leading = media ?? renderIcon(icon);
|
|
1573
|
+
const hasContent = title !== void 0 || description !== void 0;
|
|
1574
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ItemContainer, {
|
|
1575
|
+
...rest,
|
|
1576
|
+
children: [
|
|
1577
|
+
leading != null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ItemMedia, {
|
|
1578
|
+
className: classNames?.media,
|
|
1579
|
+
children: leading
|
|
1580
|
+
}) : null,
|
|
1581
|
+
hasContent ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ItemContent, {
|
|
1582
|
+
className: classNames?.content,
|
|
1583
|
+
children: [title !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ItemTitle, {
|
|
1584
|
+
className: classNames?.title,
|
|
1585
|
+
children: title
|
|
1586
|
+
}) : null, description !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ItemDescription, {
|
|
1587
|
+
className: classNames?.description,
|
|
1588
|
+
children: description
|
|
1589
|
+
}) : null]
|
|
1590
|
+
}) : null,
|
|
1591
|
+
children,
|
|
1592
|
+
actions !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ItemActions, {
|
|
1593
|
+
className: classNames?.actions,
|
|
1594
|
+
children: actions
|
|
1595
|
+
}) : null
|
|
1596
|
+
]
|
|
1597
|
+
});
|
|
1598
|
+
}
|
|
1599
|
+
/** Divided vertical stack of items. */
|
|
1600
|
+
function ItemGroup({ bordered, className, ...rest }) {
|
|
1601
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1602
|
+
className: cn(["item-group", bordered && "item-group-bordered"], className),
|
|
1603
|
+
...rest
|
|
1604
|
+
});
|
|
1605
|
+
}
|
|
1606
|
+
var Item = Object.assign(ItemRoot, {
|
|
1607
|
+
Container: ItemContainer,
|
|
1608
|
+
Media: ItemMedia,
|
|
1609
|
+
Content: ItemContent,
|
|
1610
|
+
Title: ItemTitle,
|
|
1611
|
+
Description: ItemDescription,
|
|
1612
|
+
Actions: ItemActions
|
|
1613
|
+
});
|
|
1614
|
+
//#endregion
|
|
1250
1615
|
//#region src/chart-internal.ts
|
|
1251
1616
|
/**
|
|
1252
1617
|
* Multi-series palette of existing Flexoki tokens, not a new token layer. The
|
|
@@ -1490,24 +1855,15 @@ var StackedBar = Object.assign(StackedBarRoot, {
|
|
|
1490
1855
|
Legend: ChartLegend
|
|
1491
1856
|
});
|
|
1492
1857
|
//#endregion
|
|
1493
|
-
//#region src/
|
|
1858
|
+
//#region src/dialog-internal.ts
|
|
1494
1859
|
var DialogContext = (0, react.createContext)(null);
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
strokeWidth: "2",
|
|
1503
|
-
strokeLinecap: "round",
|
|
1504
|
-
strokeLinejoin: "round",
|
|
1505
|
-
"aria-hidden": "true",
|
|
1506
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M18 6 6 18" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "m6 6 12 12" })]
|
|
1507
|
-
});
|
|
1508
|
-
}
|
|
1509
|
-
/** The bare `<dialog>` primitive — for layouts the default `<Dialog>` doesn't fit. */
|
|
1510
|
-
function DialogContainer({ open, onOpenChange, size = "md", closedby = "any", className, children, ref: consumerRef, ...rest }) {
|
|
1860
|
+
/**
|
|
1861
|
+
* Drives a native `<dialog>` from a controlled `open` prop, shared by `<Dialog>`
|
|
1862
|
+
* and `<Drawer>`: merges the consumer ref, calls `showModal()` / `close()` on
|
|
1863
|
+
* change, and reports closes (Esc, backdrop, form submit) via `onOpenChange`.
|
|
1864
|
+
* Returns `ref` for the portal container context.
|
|
1865
|
+
*/
|
|
1866
|
+
function useDialogElement(open, onOpenChange, consumerRef) {
|
|
1511
1867
|
const ref = (0, react.useRef)(null);
|
|
1512
1868
|
const onOpenChangeRef = (0, react.useRef)(onOpenChange);
|
|
1513
1869
|
onOpenChangeRef.current = onOpenChange;
|
|
@@ -1529,8 +1885,33 @@ function DialogContainer({ open, onOpenChange, size = "md", closedby = "any", cl
|
|
|
1529
1885
|
el.addEventListener("close", handleClose);
|
|
1530
1886
|
return () => el.removeEventListener("close", handleClose);
|
|
1531
1887
|
}, []);
|
|
1888
|
+
return {
|
|
1889
|
+
setRef,
|
|
1890
|
+
ctx: { close: () => ref.current?.close() },
|
|
1891
|
+
ref
|
|
1892
|
+
};
|
|
1893
|
+
}
|
|
1894
|
+
//#endregion
|
|
1895
|
+
//#region src/Dialog.tsx
|
|
1896
|
+
function DefaultCloseIcon() {
|
|
1897
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
1898
|
+
width: "16",
|
|
1899
|
+
height: "16",
|
|
1900
|
+
viewBox: "0 0 24 24",
|
|
1901
|
+
fill: "none",
|
|
1902
|
+
stroke: "currentColor",
|
|
1903
|
+
strokeWidth: "2",
|
|
1904
|
+
strokeLinecap: "round",
|
|
1905
|
+
strokeLinejoin: "round",
|
|
1906
|
+
"aria-hidden": "true",
|
|
1907
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M18 6 6 18" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "m6 6 12 12" })]
|
|
1908
|
+
});
|
|
1909
|
+
}
|
|
1910
|
+
/** The bare `<dialog>` primitive — for layouts the default `<Dialog>` doesn't fit. */
|
|
1911
|
+
function DialogContainer({ open, onOpenChange, size = "md", closedby = "any", className, children, ref: consumerRef, ...rest }) {
|
|
1912
|
+
const { setRef, ctx, ref } = useDialogElement(open, onOpenChange, consumerRef);
|
|
1532
1913
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DialogContext.Provider, {
|
|
1533
|
-
value:
|
|
1914
|
+
value: ctx,
|
|
1534
1915
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PortalContainerContext.Provider, {
|
|
1535
1916
|
value: ref,
|
|
1536
1917
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dialog", {
|
|
@@ -1589,19 +1970,35 @@ function DialogCloseButton({ icon, className, children, onClick, type = "button"
|
|
|
1589
1970
|
});
|
|
1590
1971
|
}
|
|
1591
1972
|
/** Standard modal with shorthand-driven header/body/footer. For other shapes, compose `<Dialog.Container>` by hand. */
|
|
1592
|
-
function DialogRoot({ icon, title, description, actions, dismissible = true, closeLabel = "Close", children, ...containerProps }) {
|
|
1973
|
+
function DialogRoot({ icon, title, description, actions, dismissible = true, closeLabel = "Close", classNames, children, ...containerProps }) {
|
|
1593
1974
|
const hasTitle = title !== void 0 || icon !== void 0;
|
|
1594
1975
|
const showHeader = hasTitle || dismissible;
|
|
1595
1976
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DialogContainer, {
|
|
1596
1977
|
...containerProps,
|
|
1597
1978
|
children: [
|
|
1598
|
-
showHeader ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DialogHeader, {
|
|
1599
|
-
|
|
1600
|
-
children:
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1979
|
+
showHeader ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DialogHeader, {
|
|
1980
|
+
className: classNames?.header,
|
|
1981
|
+
children: [hasTitle ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DialogTitle, {
|
|
1982
|
+
icon,
|
|
1983
|
+
className: classNames?.title,
|
|
1984
|
+
children: title
|
|
1985
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: cn("flex-1", void 0) }), dismissible ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DialogCloseButton, {
|
|
1986
|
+
"aria-label": closeLabel,
|
|
1987
|
+
className: classNames?.close
|
|
1988
|
+
}) : null]
|
|
1989
|
+
}) : null,
|
|
1990
|
+
description !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DialogDescription, {
|
|
1991
|
+
className: classNames?.description,
|
|
1992
|
+
children: description
|
|
1993
|
+
}) : null,
|
|
1994
|
+
children !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DialogBody, {
|
|
1995
|
+
className: classNames?.body,
|
|
1996
|
+
children
|
|
1997
|
+
}) : null,
|
|
1998
|
+
actions !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DialogFooter, {
|
|
1999
|
+
className: classNames?.footer,
|
|
2000
|
+
children: actions
|
|
2001
|
+
}) : null
|
|
1605
2002
|
]
|
|
1606
2003
|
});
|
|
1607
2004
|
}
|
|
@@ -1615,6 +2012,73 @@ var Dialog = Object.assign(DialogRoot, {
|
|
|
1615
2012
|
CloseButton: DialogCloseButton
|
|
1616
2013
|
});
|
|
1617
2014
|
//#endregion
|
|
2015
|
+
//#region src/Drawer.tsx
|
|
2016
|
+
/** The bare edge-anchored `<dialog>` primitive — for layouts the default `<Drawer>` doesn't fit. */
|
|
2017
|
+
function DrawerContainer({ open, onOpenChange, side = "end", size = "md", closedby = "any", className, children, ref: consumerRef, ...rest }) {
|
|
2018
|
+
const { setRef, ctx, ref } = useDialogElement(open, onOpenChange, consumerRef);
|
|
2019
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DialogContext.Provider, {
|
|
2020
|
+
value: ctx,
|
|
2021
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PortalContainerContext.Provider, {
|
|
2022
|
+
value: ref,
|
|
2023
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dialog", {
|
|
2024
|
+
ref: setRef,
|
|
2025
|
+
className: cn([
|
|
2026
|
+
"dialog",
|
|
2027
|
+
"drawer",
|
|
2028
|
+
side !== "end" && `drawer-${side}`,
|
|
2029
|
+
size !== "md" && `drawer-${size}`
|
|
2030
|
+
], className),
|
|
2031
|
+
closedby,
|
|
2032
|
+
...rest,
|
|
2033
|
+
children
|
|
2034
|
+
})
|
|
2035
|
+
})
|
|
2036
|
+
});
|
|
2037
|
+
}
|
|
2038
|
+
/** Edge-anchored panel with shorthand-driven header/body/footer. For other shapes, compose `<Drawer.Container>`. */
|
|
2039
|
+
function DrawerRoot({ icon, title, description, actions, dismissible = true, closeLabel = "Close", classNames, children, ...containerProps }) {
|
|
2040
|
+
const hasTitle = title !== void 0 || icon !== void 0;
|
|
2041
|
+
const showHeader = hasTitle || dismissible;
|
|
2042
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DrawerContainer, {
|
|
2043
|
+
...containerProps,
|
|
2044
|
+
children: [
|
|
2045
|
+
showHeader ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Dialog.Header, {
|
|
2046
|
+
className: classNames?.header,
|
|
2047
|
+
children: [hasTitle ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Dialog.Title, {
|
|
2048
|
+
icon,
|
|
2049
|
+
className: classNames?.title,
|
|
2050
|
+
children: title
|
|
2051
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: cn("flex-1", void 0) }), dismissible ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Dialog.CloseButton, {
|
|
2052
|
+
"aria-label": closeLabel,
|
|
2053
|
+
className: classNames?.close
|
|
2054
|
+
}) : null]
|
|
2055
|
+
}) : null,
|
|
2056
|
+
description !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Dialog.Description, {
|
|
2057
|
+
className: classNames?.description,
|
|
2058
|
+
children: description
|
|
2059
|
+
}) : null,
|
|
2060
|
+
children !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Dialog.Body, {
|
|
2061
|
+
className: classNames?.body,
|
|
2062
|
+
children
|
|
2063
|
+
}) : null,
|
|
2064
|
+
actions !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Dialog.Footer, {
|
|
2065
|
+
className: classNames?.footer,
|
|
2066
|
+
children: actions
|
|
2067
|
+
}) : null
|
|
2068
|
+
]
|
|
2069
|
+
});
|
|
2070
|
+
}
|
|
2071
|
+
/** Shares the Dialog header/body/footer subparts; only the container differs. */
|
|
2072
|
+
var Drawer = Object.assign(DrawerRoot, {
|
|
2073
|
+
Container: DrawerContainer,
|
|
2074
|
+
Header: Dialog.Header,
|
|
2075
|
+
Title: Dialog.Title,
|
|
2076
|
+
Description: Dialog.Description,
|
|
2077
|
+
Body: Dialog.Body,
|
|
2078
|
+
Footer: Dialog.Footer,
|
|
2079
|
+
CloseButton: Dialog.CloseButton
|
|
2080
|
+
});
|
|
2081
|
+
//#endregion
|
|
1618
2082
|
//#region src/Field.tsx
|
|
1619
2083
|
/** The bare `.field` container — for layouts the default `<Field>` doesn't fit. */
|
|
1620
2084
|
function FieldContainer({ className, ...rest }) {
|
|
@@ -1624,14 +2088,19 @@ function FieldContainer({ className, ...rest }) {
|
|
|
1624
2088
|
});
|
|
1625
2089
|
}
|
|
1626
2090
|
/** Standard field — label, control (`children`), description, error. For other shapes, compose `<Field.Container>` by hand. */
|
|
1627
|
-
function FieldRoot({ label, description, error, required, inline, className, children, ...rest }) {
|
|
2091
|
+
function FieldRoot({ label, description, error, required, inline, className, classNames, children, ...rest }) {
|
|
1628
2092
|
const labelEl = label !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FieldLabel, {
|
|
1629
2093
|
required,
|
|
2094
|
+
className: classNames?.label,
|
|
1630
2095
|
children: label
|
|
1631
2096
|
}) : null;
|
|
1632
|
-
const descriptionEl = description !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FieldDescription, {
|
|
2097
|
+
const descriptionEl = description !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FieldDescription, {
|
|
2098
|
+
className: classNames?.description,
|
|
2099
|
+
children: description
|
|
2100
|
+
}) : null;
|
|
1633
2101
|
const errorEl = error !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FieldError, {
|
|
1634
2102
|
match: true,
|
|
2103
|
+
className: classNames?.error,
|
|
1635
2104
|
children: error
|
|
1636
2105
|
}) : null;
|
|
1637
2106
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(FieldContainer, {
|
|
@@ -1722,17 +2191,41 @@ function MenuPopup({ className, role = "menu", ...rest }) {
|
|
|
1722
2191
|
...rest
|
|
1723
2192
|
});
|
|
1724
2193
|
}
|
|
2194
|
+
function CheckIcon() {
|
|
2195
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
2196
|
+
width: "1em",
|
|
2197
|
+
height: "1em",
|
|
2198
|
+
viewBox: "0 0 24 24",
|
|
2199
|
+
fill: "none",
|
|
2200
|
+
stroke: "currentColor",
|
|
2201
|
+
strokeWidth: "2",
|
|
2202
|
+
strokeLinecap: "round",
|
|
2203
|
+
strokeLinejoin: "round",
|
|
2204
|
+
"aria-hidden": "true",
|
|
2205
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M5 12l5 5l10 -10" })
|
|
2206
|
+
});
|
|
2207
|
+
}
|
|
2208
|
+
function MenuItemIndicator() {
|
|
2209
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2210
|
+
className: cn("menu-item-indicator", void 0),
|
|
2211
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CheckIcon, {})
|
|
2212
|
+
});
|
|
2213
|
+
}
|
|
1725
2214
|
function MenuItem(props) {
|
|
1726
2215
|
const ref = (0, react.useRef)(null);
|
|
1727
2216
|
const hotkey = props.hotkey;
|
|
2217
|
+
const checked = props.checked;
|
|
1728
2218
|
const ariaDisabled = props["aria-disabled"];
|
|
1729
2219
|
const isDisabled = "disabled" in props && props.disabled === true || ariaDisabled === true || ariaDisabled === "true";
|
|
1730
2220
|
const { ariaKeyShortcuts, primaryChord } = useHotkey(hotkey, () => ref.current?.click(), { enabled: !isDisabled });
|
|
2221
|
+
const leading = checked !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MenuItemIndicator, {}) : renderIcon(props.icon);
|
|
2222
|
+
const defaultRole = checked !== void 0 ? "menuitemcheckbox" : "menuitem";
|
|
1731
2223
|
if (props.href !== void 0) {
|
|
1732
|
-
const { className, role
|
|
2224
|
+
const { className, role, icon: _icon, checked: _checked, children, hotkey: _hk, onClick, ...rest } = props;
|
|
1733
2225
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("a", {
|
|
1734
2226
|
ref,
|
|
1735
|
-
role,
|
|
2227
|
+
role: role ?? defaultRole,
|
|
2228
|
+
"aria-checked": checked,
|
|
1736
2229
|
"aria-keyshortcuts": ariaKeyShortcuts,
|
|
1737
2230
|
className: cn("menu-item", className),
|
|
1738
2231
|
onClick: (event) => {
|
|
@@ -1744,22 +2237,23 @@ function MenuItem(props) {
|
|
|
1744
2237
|
},
|
|
1745
2238
|
...rest,
|
|
1746
2239
|
children: [
|
|
1747
|
-
|
|
2240
|
+
leading,
|
|
1748
2241
|
children,
|
|
1749
2242
|
primaryChord !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Kbd, { keys: primaryChord }) : null
|
|
1750
2243
|
]
|
|
1751
2244
|
});
|
|
1752
2245
|
}
|
|
1753
|
-
const { className, type = "button", role
|
|
2246
|
+
const { className, type = "button", role, icon: _icon, checked: _checked, children, hotkey: _hk, ...rest } = props;
|
|
1754
2247
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
1755
2248
|
ref,
|
|
1756
2249
|
type,
|
|
1757
|
-
role,
|
|
2250
|
+
role: role ?? defaultRole,
|
|
2251
|
+
"aria-checked": checked,
|
|
1758
2252
|
"aria-keyshortcuts": ariaKeyShortcuts,
|
|
1759
2253
|
className: cn("menu-item", className),
|
|
1760
2254
|
...rest,
|
|
1761
2255
|
children: [
|
|
1762
|
-
|
|
2256
|
+
leading,
|
|
1763
2257
|
children,
|
|
1764
2258
|
primaryChord !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Kbd, { keys: primaryChord }) : null
|
|
1765
2259
|
]
|
|
@@ -1946,7 +2440,7 @@ function TooltipPopup({ size = "md", side = "top", align = "center", sideOffset
|
|
|
1946
2440
|
})
|
|
1947
2441
|
});
|
|
1948
2442
|
}
|
|
1949
|
-
function TooltipShorthand({ content, side, align, sideOffset, size, children, ...rootProps }) {
|
|
2443
|
+
function TooltipShorthand({ content, side, align, sideOffset, size, classNames, children, ...rootProps }) {
|
|
1950
2444
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(TooltipRoot, {
|
|
1951
2445
|
...rootProps,
|
|
1952
2446
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_tooltip.Tooltip.Trigger, { render: children }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TooltipPopup, {
|
|
@@ -1954,6 +2448,7 @@ function TooltipShorthand({ content, side, align, sideOffset, size, children, ..
|
|
|
1954
2448
|
align,
|
|
1955
2449
|
sideOffset,
|
|
1956
2450
|
size,
|
|
2451
|
+
className: classNames?.popup,
|
|
1957
2452
|
children: content
|
|
1958
2453
|
})]
|
|
1959
2454
|
});
|
|
@@ -1998,7 +2493,7 @@ function CheckGlyph({ className }) {
|
|
|
1998
2493
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M5 12l5 5l10 -10" })
|
|
1999
2494
|
});
|
|
2000
2495
|
}
|
|
2001
|
-
function PropertyListRoot({ striped, compact, hideIfAllEmpty, title, className, children, ...rest }) {
|
|
2496
|
+
function PropertyListRoot({ striped, compact, hideIfAllEmpty, title, className, classNames, children, ...rest }) {
|
|
2002
2497
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
2003
2498
|
className: cn([
|
|
2004
2499
|
"property-list",
|
|
@@ -2008,10 +2503,10 @@ function PropertyListRoot({ striped, compact, hideIfAllEmpty, title, className,
|
|
|
2008
2503
|
], className),
|
|
2009
2504
|
...rest,
|
|
2010
2505
|
children: [title !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
|
|
2011
|
-
className: cn("property-list-title",
|
|
2506
|
+
className: cn("property-list-title", classNames?.title),
|
|
2012
2507
|
children: title
|
|
2013
2508
|
}) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dl", {
|
|
2014
|
-
className: cn("property-list-items",
|
|
2509
|
+
className: cn("property-list-items", classNames?.items),
|
|
2015
2510
|
children
|
|
2016
2511
|
})]
|
|
2017
2512
|
});
|
|
@@ -2021,14 +2516,18 @@ function isEmptyValue(value) {
|
|
|
2021
2516
|
if (typeof value === "string") return value.trim() === "";
|
|
2022
2517
|
return false;
|
|
2023
2518
|
}
|
|
2024
|
-
function PropertyListItem({ label, value, numeric, copyable, copyValue, children, ...rest }) {
|
|
2519
|
+
function PropertyListItem({ label, value, numeric, copyable, copyValue, classNames, children, ...rest }) {
|
|
2025
2520
|
if (children !== void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children });
|
|
2026
2521
|
const empty = isEmptyValue(value);
|
|
2027
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(PropertyListLabel, {
|
|
2522
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(PropertyListLabel, {
|
|
2523
|
+
className: classNames?.label,
|
|
2524
|
+
children: label
|
|
2525
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PropertyListValue, {
|
|
2028
2526
|
numeric,
|
|
2029
2527
|
copyable,
|
|
2030
2528
|
empty,
|
|
2031
2529
|
copyValue: copyValue ?? (typeof value === "string" ? value : void 0),
|
|
2530
|
+
classNames: classNames?.copy ? { copy: classNames.copy } : void 0,
|
|
2032
2531
|
...rest,
|
|
2033
2532
|
children: empty ? "—" : value
|
|
2034
2533
|
})] });
|
|
@@ -2039,7 +2538,7 @@ function PropertyListLabel({ className, ...rest }) {
|
|
|
2039
2538
|
...rest
|
|
2040
2539
|
});
|
|
2041
2540
|
}
|
|
2042
|
-
function PropertyListValue({ numeric, copyable, empty, copyValue, className, children, ...rest }) {
|
|
2541
|
+
function PropertyListValue({ numeric, copyable, empty, copyValue, className, classNames, children, ...rest }) {
|
|
2043
2542
|
const ddRef = (0, react.useRef)(null);
|
|
2044
2543
|
const [copied, setCopied] = (0, react.useState)(false);
|
|
2045
2544
|
async function handleCopy() {
|
|
@@ -2063,7 +2562,7 @@ function PropertyListValue({ numeric, copyable, empty, copyValue, className, chi
|
|
|
2063
2562
|
children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
2064
2563
|
type: "button",
|
|
2065
2564
|
"aria-label": "Copy",
|
|
2066
|
-
className: cn("property-list-copy",
|
|
2565
|
+
className: cn("property-list-copy", classNames?.copy),
|
|
2067
2566
|
onClick: handleCopy,
|
|
2068
2567
|
"data-copied": copied ? "true" : void 0,
|
|
2069
2568
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(CopyGlyph, { className: cn("property-list-copy-icon", void 0) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CheckGlyph, { className: cn("property-list-copy-icon-copied", void 0) })]
|
|
@@ -2077,14 +2576,17 @@ var PropertyList = Object.assign(PropertyListRoot, {
|
|
|
2077
2576
|
});
|
|
2078
2577
|
//#endregion
|
|
2079
2578
|
//#region src/Table.tsx
|
|
2080
|
-
function TableRoot({ striped, bordered, relaxed, sticky, className, ...rest }) {
|
|
2579
|
+
function TableRoot({ striped, bordered, density, relaxed, sticky, pinCol, className, ...rest }) {
|
|
2580
|
+
const resolvedDensity = density ?? (relaxed ? "relaxed" : "default");
|
|
2081
2581
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("table", {
|
|
2082
2582
|
className: cn([
|
|
2083
2583
|
"table",
|
|
2084
2584
|
striped && "table-striped",
|
|
2085
2585
|
bordered && "table-bordered",
|
|
2086
|
-
|
|
2087
|
-
|
|
2586
|
+
resolvedDensity === "compact" && "table-compact",
|
|
2587
|
+
resolvedDensity === "relaxed" && "table-relaxed",
|
|
2588
|
+
sticky && "table-sticky",
|
|
2589
|
+
pinCol && "table-pin-col"
|
|
2088
2590
|
], className),
|
|
2089
2591
|
...rest
|
|
2090
2592
|
});
|
|
@@ -2134,18 +2636,28 @@ function TableCell({ align, gutter, numeric, className, ...rest }) {
|
|
|
2134
2636
|
...rest
|
|
2135
2637
|
});
|
|
2136
2638
|
}
|
|
2639
|
+
/** A centered "no results" row; renders its own `<tr>`, so drop it inside `<Table.Body>`. */
|
|
2640
|
+
function TableEmpty({ colSpan, className, children, ...rest }) {
|
|
2641
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tr", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
2642
|
+
className: cn("table-empty", className),
|
|
2643
|
+
colSpan,
|
|
2644
|
+
...rest,
|
|
2645
|
+
children
|
|
2646
|
+
}) });
|
|
2647
|
+
}
|
|
2137
2648
|
var Table = Object.assign(TableRoot, {
|
|
2138
2649
|
Head: TableHead,
|
|
2139
2650
|
Body: TableBody,
|
|
2140
2651
|
Foot: TableFoot,
|
|
2141
2652
|
Row: TableRow,
|
|
2142
2653
|
HeaderCell: TableHeaderCell,
|
|
2143
|
-
Cell: TableCell
|
|
2654
|
+
Cell: TableCell,
|
|
2655
|
+
Empty: TableEmpty
|
|
2144
2656
|
});
|
|
2145
2657
|
//#endregion
|
|
2146
2658
|
//#region src/Sidebar.tsx
|
|
2147
2659
|
var SidebarContext = (0, react.createContext)(null);
|
|
2148
|
-
function SidebarRoot({ collapsed, defaultCollapsed, onCollapsedChange, drawerLabel = "Navigation", className, children, ...rest }) {
|
|
2660
|
+
function SidebarRoot({ collapsed, defaultCollapsed, onCollapsedChange, drawerLabel = "Navigation", className, classNames, children, ...rest }) {
|
|
2149
2661
|
const shell = useAppShell();
|
|
2150
2662
|
const drawerOpen = shell?.mobileDrawerOpen ?? false;
|
|
2151
2663
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(SidebarContext.Provider, {
|
|
@@ -2161,8 +2673,8 @@ function SidebarRoot({ collapsed, defaultCollapsed, onCollapsedChange, drawerLab
|
|
|
2161
2673
|
}), shell ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_dialog.Dialog.Root, {
|
|
2162
2674
|
open: drawerOpen,
|
|
2163
2675
|
onOpenChange: (open) => shell.setMobileDrawerOpen(open),
|
|
2164
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_base_ui_react_dialog.Dialog.Portal, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_dialog.Dialog.Backdrop, { className: cn("sidebar-drawer-backdrop",
|
|
2165
|
-
className: cn("sidebar-drawer",
|
|
2676
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_base_ui_react_dialog.Dialog.Portal, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_dialog.Dialog.Backdrop, { className: cn("sidebar-drawer-backdrop", classNames?.drawerBackdrop) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_dialog.Dialog.Popup, {
|
|
2677
|
+
className: cn("sidebar-drawer", classNames?.drawer),
|
|
2166
2678
|
"aria-label": drawerLabel,
|
|
2167
2679
|
onClick: (event) => {
|
|
2168
2680
|
if (event.target.closest("a, [data-drawer-close]")) shell.setMobileDrawerOpen(false);
|
|
@@ -2196,15 +2708,24 @@ function SidebarGroupLabel({ className, ...rest }) {
|
|
|
2196
2708
|
...rest
|
|
2197
2709
|
});
|
|
2198
2710
|
}
|
|
2199
|
-
function SidebarItem({ active, icon, badge, className, children, ...rest }) {
|
|
2711
|
+
function SidebarItem({ active, icon, badge, className, classNames, children, ...rest }) {
|
|
2200
2712
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("a", {
|
|
2201
2713
|
className: cn("sidebar-item", className),
|
|
2202
2714
|
"aria-current": active ? "page" : void 0,
|
|
2203
2715
|
...rest,
|
|
2204
2716
|
children: [
|
|
2205
|
-
icon != null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarIcon, {
|
|
2206
|
-
|
|
2207
|
-
|
|
2717
|
+
icon != null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarIcon, {
|
|
2718
|
+
className: classNames?.icon,
|
|
2719
|
+
children: renderIcon(icon)
|
|
2720
|
+
}) : null,
|
|
2721
|
+
children !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarLabel, {
|
|
2722
|
+
className: classNames?.label,
|
|
2723
|
+
children
|
|
2724
|
+
}) : null,
|
|
2725
|
+
badge !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarBadge, {
|
|
2726
|
+
className: classNames?.badge,
|
|
2727
|
+
children: badge
|
|
2728
|
+
}) : null
|
|
2208
2729
|
]
|
|
2209
2730
|
});
|
|
2210
2731
|
}
|
|
@@ -2227,11 +2748,17 @@ function SidebarBadge({ className, ...rest }) {
|
|
|
2227
2748
|
...rest
|
|
2228
2749
|
});
|
|
2229
2750
|
}
|
|
2230
|
-
function SidebarCollapsible({ icon, label, trigger, children, className, open, defaultOpen, onOpenChange, ...rest }) {
|
|
2751
|
+
function SidebarCollapsible({ icon, label, trigger, children, className, classNames, open, defaultOpen, onOpenChange, ...rest }) {
|
|
2231
2752
|
const isControlled = open !== void 0;
|
|
2232
2753
|
const [internalOpen, setInternalOpen] = (0, react.useState)(defaultOpen ?? false);
|
|
2233
2754
|
const isOpen = isControlled ? open : internalOpen;
|
|
2234
|
-
const triggerContent = trigger ?? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [icon != null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarIcon, {
|
|
2755
|
+
const triggerContent = trigger ?? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [icon != null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarIcon, {
|
|
2756
|
+
className: classNames?.icon,
|
|
2757
|
+
children: renderIcon(icon)
|
|
2758
|
+
}) : null, label !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarLabel, {
|
|
2759
|
+
className: classNames?.label,
|
|
2760
|
+
children: label
|
|
2761
|
+
}) : null] });
|
|
2235
2762
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
|
|
2236
2763
|
className: cn("sidebar-collapsible", className),
|
|
2237
2764
|
open: isOpen,
|
|
@@ -2242,23 +2769,29 @@ function SidebarCollapsible({ icon, label, trigger, children, className, open, d
|
|
|
2242
2769
|
},
|
|
2243
2770
|
...rest,
|
|
2244
2771
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", {
|
|
2245
|
-
className: cn("sidebar-collapsible-trigger",
|
|
2772
|
+
className: cn("sidebar-collapsible-trigger", classNames?.trigger),
|
|
2246
2773
|
children: triggerContent
|
|
2247
2774
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2248
|
-
className: cn("sidebar-collapsible-panel",
|
|
2775
|
+
className: cn("sidebar-collapsible-panel", classNames?.panel),
|
|
2249
2776
|
children
|
|
2250
2777
|
})]
|
|
2251
2778
|
});
|
|
2252
2779
|
}
|
|
2253
|
-
function SidebarSubItem({ active, icon, badge, className, children, ...rest }) {
|
|
2780
|
+
function SidebarSubItem({ active, icon, badge, className, classNames, children, ...rest }) {
|
|
2254
2781
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("a", {
|
|
2255
2782
|
className: cn("sidebar-subitem", className),
|
|
2256
2783
|
"aria-current": active ? "page" : void 0,
|
|
2257
2784
|
...rest,
|
|
2258
2785
|
children: [
|
|
2259
|
-
icon != null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarIcon, {
|
|
2786
|
+
icon != null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarIcon, {
|
|
2787
|
+
className: classNames?.icon,
|
|
2788
|
+
children: renderIcon(icon)
|
|
2789
|
+
}) : null,
|
|
2260
2790
|
children,
|
|
2261
|
-
badge !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarBadge, {
|
|
2791
|
+
badge !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarBadge, {
|
|
2792
|
+
className: classNames?.badge,
|
|
2793
|
+
children: badge
|
|
2794
|
+
}) : null
|
|
2262
2795
|
]
|
|
2263
2796
|
});
|
|
2264
2797
|
}
|
|
@@ -2268,7 +2801,7 @@ function SidebarFooter({ className, ...rest }) {
|
|
|
2268
2801
|
...rest
|
|
2269
2802
|
});
|
|
2270
2803
|
}
|
|
2271
|
-
function SidebarCollapseToggle({ label = "Toggle sidebar", className, children, ...rest }) {
|
|
2804
|
+
function SidebarCollapseToggle({ label = "Toggle sidebar", className, classNames, children, ...rest }) {
|
|
2272
2805
|
const ctx = (0, react.useContext)(SidebarContext);
|
|
2273
2806
|
const controlledChecked = ctx?.collapsed;
|
|
2274
2807
|
const isControlled = controlledChecked !== void 0;
|
|
@@ -2278,7 +2811,7 @@ function SidebarCollapseToggle({ label = "Toggle sidebar", className, children,
|
|
|
2278
2811
|
children: [
|
|
2279
2812
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
2280
2813
|
type: "checkbox",
|
|
2281
|
-
className: cn("sidebar-toggle",
|
|
2814
|
+
className: cn("sidebar-toggle", classNames?.input),
|
|
2282
2815
|
"aria-label": label,
|
|
2283
2816
|
...isControlled ? { checked: controlledChecked } : { defaultChecked: ctx?.defaultCollapsed },
|
|
2284
2817
|
onChange: (event) => ctx?.onCollapsedChange?.(event.currentTarget.checked)
|
|
@@ -2325,17 +2858,22 @@ exports.CodeBlock = CodeBlock;
|
|
|
2325
2858
|
exports.Container = Container;
|
|
2326
2859
|
exports.Dialog = Dialog;
|
|
2327
2860
|
exports.Donut = Donut;
|
|
2861
|
+
exports.Drawer = Drawer;
|
|
2328
2862
|
exports.Field = Field;
|
|
2329
2863
|
exports.FileInput = FileInput;
|
|
2330
2864
|
exports.Footer = Footer;
|
|
2331
2865
|
exports.Indicator = Indicator;
|
|
2332
2866
|
exports.Input = Input;
|
|
2333
2867
|
exports.InputGroup = InputGroup;
|
|
2868
|
+
exports.Item = Item;
|
|
2869
|
+
exports.ItemGroup = ItemGroup;
|
|
2334
2870
|
exports.Kbd = Kbd;
|
|
2335
2871
|
exports.Link = Link;
|
|
2336
2872
|
exports.Menu = Menu;
|
|
2337
2873
|
exports.Navbar = Navbar;
|
|
2874
|
+
exports.NumberInput = NumberInput;
|
|
2338
2875
|
exports.Pagination = Pagination;
|
|
2876
|
+
exports.PasswordInput = PasswordInput;
|
|
2339
2877
|
exports.Progress = Progress;
|
|
2340
2878
|
exports.PropertyList = PropertyList;
|
|
2341
2879
|
exports.Prose = Prose;
|
|
@@ -2352,6 +2890,7 @@ exports.Switch = Switch;
|
|
|
2352
2890
|
exports.Table = Table;
|
|
2353
2891
|
exports.Tabs = Tabs;
|
|
2354
2892
|
exports.Textarea = Textarea;
|
|
2893
|
+
exports.Timeline = Timeline;
|
|
2355
2894
|
exports.Tooltip = Tooltip;
|
|
2356
2895
|
exports.getPaginationItems = getPaginationItems;
|
|
2357
2896
|
exports.useAppShell = useAppShell;
|