auxalia-ui-kit 1.7.6 → 1.8.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 +385 -97
- package/dist/index.d.cts +60 -2
- package/dist/index.d.ts +60 -2
- package/dist/index.js +354 -80
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -43,6 +43,7 @@ __export(index_exports, {
|
|
|
43
43
|
CollapsibleContent: () => CollapsibleContent,
|
|
44
44
|
CollapsibleRoot: () => CollapsibleRoot,
|
|
45
45
|
CollapsibleTrigger: () => CollapsibleTrigger,
|
|
46
|
+
Container: () => Container,
|
|
46
47
|
ControlledTable: () => ControlledTable_default,
|
|
47
48
|
Dialog: () => Dialog,
|
|
48
49
|
DialogClose: () => DialogClose,
|
|
@@ -79,6 +80,7 @@ __export(index_exports, {
|
|
|
79
80
|
FieldSeparator: () => FieldSeparator,
|
|
80
81
|
FieldSet: () => FieldSet,
|
|
81
82
|
FieldTitle: () => FieldTitle,
|
|
83
|
+
Icon: () => Icon2,
|
|
82
84
|
Input: () => Input,
|
|
83
85
|
Label: () => Label3,
|
|
84
86
|
Pagination: () => Pagination,
|
|
@@ -108,6 +110,7 @@ __export(index_exports, {
|
|
|
108
110
|
SkeletonAvatar: () => SkeletonAvatar,
|
|
109
111
|
SkeletonCard: () => SkeletonCard,
|
|
110
112
|
SkeletonText: () => SkeletonText,
|
|
113
|
+
Stack: () => Stack,
|
|
111
114
|
Switch: () => Switch,
|
|
112
115
|
Tabs: () => Tabs,
|
|
113
116
|
TabsContent: () => TabsContent,
|
|
@@ -119,11 +122,22 @@ __export(index_exports, {
|
|
|
119
122
|
TooltipProvider: () => TooltipProvider,
|
|
120
123
|
TooltipTrigger: () => TooltipTrigger,
|
|
121
124
|
badgeVariants: () => badgeVariants,
|
|
125
|
+
breakpoints: () => breakpoints,
|
|
122
126
|
buttonVariants: () => buttonVariants,
|
|
123
127
|
checkboxVariants: () => checkboxVariants,
|
|
124
128
|
cn: () => cn,
|
|
129
|
+
containerVariants: () => containerVariants,
|
|
130
|
+
iconVariants: () => iconVariants,
|
|
125
131
|
radioItemVariants: () => radioItemVariants,
|
|
126
|
-
|
|
132
|
+
stackVariants: () => stackVariants,
|
|
133
|
+
tailwindPreset: () => tailwind_preset_default,
|
|
134
|
+
useBreakpoint: () => useBreakpoint,
|
|
135
|
+
useClickOutside: () => useClickOutside,
|
|
136
|
+
useDebounce: () => useDebounce2,
|
|
137
|
+
useLocalStorage: () => useLocalStorage,
|
|
138
|
+
useMediaQuery: () => useMediaQuery,
|
|
139
|
+
usePrevious: () => usePrevious2,
|
|
140
|
+
useTheme: () => useTheme
|
|
127
141
|
});
|
|
128
142
|
module.exports = __toCommonJS(index_exports);
|
|
129
143
|
|
|
@@ -4708,7 +4722,7 @@ var RemoveScroll = React34.forwardRef(function(props, parentRef) {
|
|
|
4708
4722
|
onWheelCapture: nothing,
|
|
4709
4723
|
onTouchMoveCapture: nothing
|
|
4710
4724
|
}), callbacks = _a[0], setCallbacks = _a[1];
|
|
4711
|
-
var forwardProps = props.forwardProps, children = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noRelative = props.noRelative, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as,
|
|
4725
|
+
var forwardProps = props.forwardProps, children = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noRelative = props.noRelative, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container2 = _b === void 0 ? "div" : _b, gapMode = props.gapMode, rest = __rest(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]);
|
|
4712
4726
|
var SideCar2 = sideCar;
|
|
4713
4727
|
var containerRef = useMergeRefs([ref, parentRef]);
|
|
4714
4728
|
var containerProps = __assign(__assign({}, rest), callbacks);
|
|
@@ -4716,7 +4730,7 @@ var RemoveScroll = React34.forwardRef(function(props, parentRef) {
|
|
|
4716
4730
|
React34.Fragment,
|
|
4717
4731
|
null,
|
|
4718
4732
|
enabled && React34.createElement(SideCar2, { sideCar: effectCar, removeScrollBar, shards, noRelative, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode }),
|
|
4719
|
-
forwardProps ? React34.cloneElement(React34.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : React34.createElement(
|
|
4733
|
+
forwardProps ? React34.cloneElement(React34.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : React34.createElement(Container2, __assign({}, containerProps, { className, ref: containerRef }), children)
|
|
4720
4734
|
);
|
|
4721
4735
|
});
|
|
4722
4736
|
RemoveScroll.defaultProps = {
|
|
@@ -6569,6 +6583,137 @@ function Text({ size: size4 = "md", className, ...props }) {
|
|
|
6569
6583
|
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: cn(textVariants({ size: size4 }), className), ...props });
|
|
6570
6584
|
}
|
|
6571
6585
|
|
|
6586
|
+
// src/components/Icon/index.tsx
|
|
6587
|
+
var React41 = __toESM(require("react"), 1);
|
|
6588
|
+
|
|
6589
|
+
// src/components/Icon/icon.styles.ts
|
|
6590
|
+
var import_class_variance_authority15 = require("class-variance-authority");
|
|
6591
|
+
var iconVariants = (0, import_class_variance_authority15.cva)("shrink-0", {
|
|
6592
|
+
variants: {
|
|
6593
|
+
size: {
|
|
6594
|
+
xs: "size-3",
|
|
6595
|
+
sm: "size-4",
|
|
6596
|
+
md: "size-5",
|
|
6597
|
+
lg: "size-6",
|
|
6598
|
+
xl: "size-8"
|
|
6599
|
+
},
|
|
6600
|
+
color: {
|
|
6601
|
+
default: "text-content",
|
|
6602
|
+
muted: "text-muted",
|
|
6603
|
+
dim: "text-dim",
|
|
6604
|
+
primary: "text-primary",
|
|
6605
|
+
success: "text-success",
|
|
6606
|
+
warning: "text-warning",
|
|
6607
|
+
destructive: "text-destructive",
|
|
6608
|
+
info: "text-info"
|
|
6609
|
+
}
|
|
6610
|
+
},
|
|
6611
|
+
defaultVariants: {
|
|
6612
|
+
size: "md",
|
|
6613
|
+
color: "default"
|
|
6614
|
+
}
|
|
6615
|
+
});
|
|
6616
|
+
|
|
6617
|
+
// src/components/Icon/index.tsx
|
|
6618
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
6619
|
+
var Icon2 = React41.forwardRef(
|
|
6620
|
+
({ icon: IconComponent, size: size4, color, strokeWidth = 2, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
6621
|
+
IconComponent,
|
|
6622
|
+
{
|
|
6623
|
+
ref,
|
|
6624
|
+
strokeWidth,
|
|
6625
|
+
className: cn(iconVariants({ size: size4, color }), className),
|
|
6626
|
+
...props
|
|
6627
|
+
}
|
|
6628
|
+
)
|
|
6629
|
+
);
|
|
6630
|
+
Icon2.displayName = "Icon";
|
|
6631
|
+
|
|
6632
|
+
// src/components/Container.tsx
|
|
6633
|
+
var React42 = __toESM(require("react"), 1);
|
|
6634
|
+
var import_class_variance_authority16 = require("class-variance-authority");
|
|
6635
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
6636
|
+
var containerVariants = (0, import_class_variance_authority16.cva)("mx-auto w-full", {
|
|
6637
|
+
variants: {
|
|
6638
|
+
size: {
|
|
6639
|
+
sm: "max-w-screen-sm",
|
|
6640
|
+
md: "max-w-screen-md",
|
|
6641
|
+
lg: "max-w-screen-lg",
|
|
6642
|
+
xl: "max-w-screen-xl",
|
|
6643
|
+
"2xl": "max-w-screen-2xl",
|
|
6644
|
+
full: "max-w-full"
|
|
6645
|
+
},
|
|
6646
|
+
padding: {
|
|
6647
|
+
none: "",
|
|
6648
|
+
sm: "px-4",
|
|
6649
|
+
md: "px-4 sm:px-6",
|
|
6650
|
+
lg: "px-4 sm:px-6 lg:px-8"
|
|
6651
|
+
}
|
|
6652
|
+
},
|
|
6653
|
+
defaultVariants: {
|
|
6654
|
+
size: "xl",
|
|
6655
|
+
padding: "md"
|
|
6656
|
+
}
|
|
6657
|
+
});
|
|
6658
|
+
var Container = React42.forwardRef(
|
|
6659
|
+
({ className, size: size4, padding, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { ref, className: cn(containerVariants({ size: size4, padding }), className), ...props })
|
|
6660
|
+
);
|
|
6661
|
+
Container.displayName = "Container";
|
|
6662
|
+
|
|
6663
|
+
// src/components/Stack.tsx
|
|
6664
|
+
var React43 = __toESM(require("react"), 1);
|
|
6665
|
+
var import_class_variance_authority17 = require("class-variance-authority");
|
|
6666
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
6667
|
+
var stackVariants = (0, import_class_variance_authority17.cva)("flex", {
|
|
6668
|
+
variants: {
|
|
6669
|
+
direction: {
|
|
6670
|
+
vertical: "flex-col",
|
|
6671
|
+
horizontal: "flex-row"
|
|
6672
|
+
},
|
|
6673
|
+
gap: {
|
|
6674
|
+
none: "gap-0",
|
|
6675
|
+
xs: "gap-1",
|
|
6676
|
+
sm: "gap-2",
|
|
6677
|
+
md: "gap-4",
|
|
6678
|
+
lg: "gap-6",
|
|
6679
|
+
xl: "gap-8"
|
|
6680
|
+
},
|
|
6681
|
+
align: {
|
|
6682
|
+
start: "items-start",
|
|
6683
|
+
center: "items-center",
|
|
6684
|
+
end: "items-end",
|
|
6685
|
+
stretch: "items-stretch",
|
|
6686
|
+
baseline: "items-baseline"
|
|
6687
|
+
},
|
|
6688
|
+
justify: {
|
|
6689
|
+
start: "justify-start",
|
|
6690
|
+
center: "justify-center",
|
|
6691
|
+
end: "justify-end",
|
|
6692
|
+
between: "justify-between",
|
|
6693
|
+
around: "justify-around"
|
|
6694
|
+
},
|
|
6695
|
+
wrap: {
|
|
6696
|
+
true: "flex-wrap",
|
|
6697
|
+
false: "flex-nowrap"
|
|
6698
|
+
}
|
|
6699
|
+
},
|
|
6700
|
+
defaultVariants: {
|
|
6701
|
+
direction: "vertical",
|
|
6702
|
+
gap: "md"
|
|
6703
|
+
}
|
|
6704
|
+
});
|
|
6705
|
+
var Stack = React43.forwardRef(
|
|
6706
|
+
({ className, direction, gap, align, justify, wrap, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6707
|
+
"div",
|
|
6708
|
+
{
|
|
6709
|
+
ref,
|
|
6710
|
+
className: cn(stackVariants({ direction, gap, align, justify, wrap }), className),
|
|
6711
|
+
...props
|
|
6712
|
+
}
|
|
6713
|
+
)
|
|
6714
|
+
);
|
|
6715
|
+
Stack.displayName = "Stack";
|
|
6716
|
+
|
|
6572
6717
|
// src/components/ControlledTable/index.tsx
|
|
6573
6718
|
var import_react11 = require("react");
|
|
6574
6719
|
var import_radix_ui8 = require("radix-ui");
|
|
@@ -6597,7 +6742,7 @@ function useDebounce(value, delay) {
|
|
|
6597
6742
|
var useDebounce_default = useDebounce;
|
|
6598
6743
|
|
|
6599
6744
|
// src/components/ControlledTable/SimpleSearch.tsx
|
|
6600
|
-
var
|
|
6745
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
6601
6746
|
var SimpleSearch = ({
|
|
6602
6747
|
searchValue,
|
|
6603
6748
|
onSearchCallback,
|
|
@@ -6616,9 +6761,9 @@ var SimpleSearch = ({
|
|
|
6616
6761
|
}
|
|
6617
6762
|
onSearchCallback?.(debouncedValue);
|
|
6618
6763
|
}, [debouncedValue]);
|
|
6619
|
-
return /* @__PURE__ */ (0,
|
|
6620
|
-
/* @__PURE__ */ (0,
|
|
6621
|
-
/* @__PURE__ */ (0,
|
|
6764
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "relative", children: [
|
|
6765
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react6.SearchIcon, { size: 16, className: "absolute left-3 top-1/2 -translate-y-1/2 text-muted" }),
|
|
6766
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6622
6767
|
Input,
|
|
6623
6768
|
{
|
|
6624
6769
|
value: localValue,
|
|
@@ -6633,7 +6778,7 @@ var SimpleSearch_default = SimpleSearch;
|
|
|
6633
6778
|
|
|
6634
6779
|
// src/components/ControlledTable/tableFilter/filterItem/filterSelect/index.tsx
|
|
6635
6780
|
var import_react9 = __toESM(require("react"), 1);
|
|
6636
|
-
var
|
|
6781
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
6637
6782
|
var CustomFilterSelect = ({
|
|
6638
6783
|
field,
|
|
6639
6784
|
onFilterCallback,
|
|
@@ -6668,18 +6813,18 @@ var CustomFilterSelect = ({
|
|
|
6668
6813
|
const actualValue = value === "__none__" ? "" : value;
|
|
6669
6814
|
setSearchTerm({ [field.id]: actualValue });
|
|
6670
6815
|
};
|
|
6671
|
-
return /* @__PURE__ */ (0,
|
|
6672
|
-
field.label && /* @__PURE__ */ (0,
|
|
6673
|
-
/* @__PURE__ */ (0,
|
|
6816
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: `min-w-50 ${className ?? ""}`, children: [
|
|
6817
|
+
field.label && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "mb-1.5 text-sm text-neutral-600", children: field.label }),
|
|
6818
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
6674
6819
|
Select2,
|
|
6675
6820
|
{
|
|
6676
6821
|
value: searchTerm?.[field.id] ? String(searchTerm[field.id]) : "__none__",
|
|
6677
6822
|
onValueChange: handleValueChange,
|
|
6678
6823
|
children: [
|
|
6679
|
-
/* @__PURE__ */ (0,
|
|
6680
|
-
/* @__PURE__ */ (0,
|
|
6681
|
-
/* @__PURE__ */ (0,
|
|
6682
|
-
modifiedOptions.map((opt) => /* @__PURE__ */ (0,
|
|
6824
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SelectTrigger2, { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SelectValue2, {}) }),
|
|
6825
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(SelectContent2, { children: [
|
|
6826
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SelectItem2, { value: "__none__", children: field.insteadNone ?? "None" }),
|
|
6827
|
+
modifiedOptions.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SelectItem2, { value: String(opt.id ?? opt.value), children: opt.title ?? opt.label }, String(opt.id ?? opt.value)))
|
|
6683
6828
|
] })
|
|
6684
6829
|
]
|
|
6685
6830
|
}
|
|
@@ -6689,7 +6834,7 @@ var CustomFilterSelect = ({
|
|
|
6689
6834
|
var filterSelect_default = CustomFilterSelect;
|
|
6690
6835
|
|
|
6691
6836
|
// src/components/ControlledTable/tableFilter/filterItem/index.tsx
|
|
6692
|
-
var
|
|
6837
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
6693
6838
|
var FIELD_TYPE_COMPONENT_MAP = [
|
|
6694
6839
|
{
|
|
6695
6840
|
types: ["select"],
|
|
@@ -6704,7 +6849,7 @@ var FilterItem = ({ field, searchValue, filteredParams, onFilterCallback }) => {
|
|
|
6704
6849
|
if (!config) return null;
|
|
6705
6850
|
const { component: Component, extraProps } = config;
|
|
6706
6851
|
const additionalProps = typeof extraProps === "function" ? extraProps(field) : extraProps;
|
|
6707
|
-
return /* @__PURE__ */ (0,
|
|
6852
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6708
6853
|
Component,
|
|
6709
6854
|
{
|
|
6710
6855
|
field,
|
|
@@ -6719,13 +6864,13 @@ var FilterItem = ({ field, searchValue, filteredParams, onFilterCallback }) => {
|
|
|
6719
6864
|
var filterItem_default = FilterItem;
|
|
6720
6865
|
|
|
6721
6866
|
// src/components/ControlledTable/tableFilter/index.tsx
|
|
6722
|
-
var
|
|
6867
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
6723
6868
|
var TableFilter = ({ filterFields, filteredParams, onFilterCallback }) => {
|
|
6724
6869
|
if (!filterFields || filterFields.length === 0) {
|
|
6725
6870
|
return null;
|
|
6726
6871
|
}
|
|
6727
|
-
return /* @__PURE__ */ (0,
|
|
6728
|
-
return /* @__PURE__ */ (0,
|
|
6872
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "flex flex-wrap items-end gap-4", children: filterFields.map((field) => {
|
|
6873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6729
6874
|
filterItem_default,
|
|
6730
6875
|
{
|
|
6731
6876
|
field,
|
|
@@ -6740,7 +6885,7 @@ var TableFilter = ({ filterFields, filteredParams, onFilterCallback }) => {
|
|
|
6740
6885
|
var tableFilter_default = TableFilter;
|
|
6741
6886
|
|
|
6742
6887
|
// src/components/ControlledTable/toolbar/index.tsx
|
|
6743
|
-
var
|
|
6888
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
6744
6889
|
var CommonToolbar = ({
|
|
6745
6890
|
title,
|
|
6746
6891
|
searchValue,
|
|
@@ -6752,18 +6897,18 @@ var CommonToolbar = ({
|
|
|
6752
6897
|
onFilterCallback
|
|
6753
6898
|
}) => {
|
|
6754
6899
|
const [isFilterOpen, setIsFilterOpen] = (0, import_react10.useState)(false);
|
|
6755
|
-
return /* @__PURE__ */ (0,
|
|
6756
|
-
title && /* @__PURE__ */ (0,
|
|
6757
|
-
/* @__PURE__ */ (0,
|
|
6758
|
-
/* @__PURE__ */ (0,
|
|
6759
|
-
filterFields && filterFields.length > 0 && /* @__PURE__ */ (0,
|
|
6760
|
-
/* @__PURE__ */ (0,
|
|
6761
|
-
/* @__PURE__ */ (0,
|
|
6900
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { children: [
|
|
6901
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "px-4 pt-3 text-base font-semibold uppercase tracking-wide text-content", children: title }),
|
|
6902
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex items-center justify-between gap-4 border-b border-card-hover bg-card px-4 py-2", children: [
|
|
6903
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
6904
|
+
filterFields && filterFields.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
6905
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(Button, { variant: "outline", size: "sm", onClick: () => setIsFilterOpen((prev) => !prev), children: [
|
|
6906
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react7.Filter, { size: 14, className: "mr-1" }),
|
|
6762
6907
|
"Filters"
|
|
6763
6908
|
] }),
|
|
6764
|
-
numSelected > 0 && /* @__PURE__ */ (0,
|
|
6909
|
+
numSelected > 0 && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "inline-flex h-5 min-w-5 items-center justify-center rounded-full bg-primary px-1.5 text-xs font-medium text-white", children: numSelected })
|
|
6765
6910
|
] }),
|
|
6766
|
-
/* @__PURE__ */ (0,
|
|
6911
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "max-w-90 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6767
6912
|
SimpleSearch_default,
|
|
6768
6913
|
{
|
|
6769
6914
|
searchValue,
|
|
@@ -6772,9 +6917,9 @@ var CommonToolbar = ({
|
|
|
6772
6917
|
}
|
|
6773
6918
|
) })
|
|
6774
6919
|
] }),
|
|
6775
|
-
toolbarActions.length > 0 && /* @__PURE__ */ (0,
|
|
6920
|
+
toolbarActions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "flex items-center gap-2", children: renderToolbarActions(toolbarActions, numSelected) })
|
|
6776
6921
|
] }),
|
|
6777
|
-
filterFields && filterFields.length > 0 && /* @__PURE__ */ (0,
|
|
6922
|
+
filterFields && filterFields.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(CollapsibleRoot, { open: isFilterOpen, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(CollapsibleContent, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "rounded-sm border border-border p-4", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6778
6923
|
tableFilter_default,
|
|
6779
6924
|
{
|
|
6780
6925
|
filterFields,
|
|
@@ -6788,15 +6933,15 @@ function renderToolbarActions(actions, numSelected) {
|
|
|
6788
6933
|
if (!actions || actions.length === 0) return null;
|
|
6789
6934
|
return actions.map((item) => {
|
|
6790
6935
|
const isTitleView = Object.keys(item).includes("titleView") ? item.titleView : true;
|
|
6791
|
-
return /* @__PURE__ */ (0,
|
|
6936
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
6792
6937
|
Button,
|
|
6793
6938
|
{
|
|
6794
6939
|
variant: "outline",
|
|
6795
6940
|
onClick: () => item.callback(),
|
|
6796
6941
|
disabled: item.visibleWithoutSelection ? false : numSelected === 0,
|
|
6797
6942
|
children: [
|
|
6798
|
-
/* @__PURE__ */ (0,
|
|
6799
|
-
isTitleView && /* @__PURE__ */ (0,
|
|
6943
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "mr-1", children: getIconForAction(item.action) }),
|
|
6944
|
+
isTitleView && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { children: item.label ?? item.action })
|
|
6800
6945
|
]
|
|
6801
6946
|
},
|
|
6802
6947
|
item.action
|
|
@@ -6807,29 +6952,29 @@ function getIconForAction(action) {
|
|
|
6807
6952
|
const cls = "h-4 w-4";
|
|
6808
6953
|
switch (action) {
|
|
6809
6954
|
case "delete":
|
|
6810
|
-
return /* @__PURE__ */ (0,
|
|
6955
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react7.Trash2, { className: cls });
|
|
6811
6956
|
case "edit":
|
|
6812
|
-
return /* @__PURE__ */ (0,
|
|
6957
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react7.Edit, { className: cls });
|
|
6813
6958
|
case "download":
|
|
6814
|
-
return /* @__PURE__ */ (0,
|
|
6959
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react7.Download, { className: cls });
|
|
6815
6960
|
case "open":
|
|
6816
|
-
return /* @__PURE__ */ (0,
|
|
6961
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react7.Eye, { className: cls });
|
|
6817
6962
|
case "clone":
|
|
6818
|
-
return /* @__PURE__ */ (0,
|
|
6963
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react7.Copy, { className: cls });
|
|
6819
6964
|
case "create":
|
|
6820
|
-
return /* @__PURE__ */ (0,
|
|
6965
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react7.Plus, { className: cls });
|
|
6821
6966
|
case "upload":
|
|
6822
|
-
return /* @__PURE__ */ (0,
|
|
6967
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react7.Upload, { className: cls });
|
|
6823
6968
|
case "view":
|
|
6824
|
-
return /* @__PURE__ */ (0,
|
|
6969
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react7.Eye, { className: cls });
|
|
6825
6970
|
case "check":
|
|
6826
|
-
return /* @__PURE__ */ (0,
|
|
6971
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react7.ListCheckIcon, { className: cls });
|
|
6827
6972
|
case "print":
|
|
6828
|
-
return /* @__PURE__ */ (0,
|
|
6973
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react7.FileTextIcon, { className: cls });
|
|
6829
6974
|
case "compare":
|
|
6830
|
-
return /* @__PURE__ */ (0,
|
|
6975
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react7.Copy, { className: cls });
|
|
6831
6976
|
case "convert":
|
|
6832
|
-
return /* @__PURE__ */ (0,
|
|
6977
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react7.Upload, { className: cls });
|
|
6833
6978
|
default:
|
|
6834
6979
|
return null;
|
|
6835
6980
|
}
|
|
@@ -6837,7 +6982,7 @@ function getIconForAction(action) {
|
|
|
6837
6982
|
var toolbar_default = CommonToolbar;
|
|
6838
6983
|
|
|
6839
6984
|
// src/components/ControlledTable/ControlledPagination.tsx
|
|
6840
|
-
var
|
|
6985
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
6841
6986
|
var ControlledPagination = ({
|
|
6842
6987
|
currentPage,
|
|
6843
6988
|
rowsPerPage,
|
|
@@ -6863,26 +7008,26 @@ var ControlledPagination = ({
|
|
|
6863
7008
|
}
|
|
6864
7009
|
return pages;
|
|
6865
7010
|
};
|
|
6866
|
-
return /* @__PURE__ */ (0,
|
|
6867
|
-
/* @__PURE__ */ (0,
|
|
6868
|
-
/* @__PURE__ */ (0,
|
|
7011
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex w-full items-center justify-between text-content", children: [
|
|
7012
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex items-center gap-2 text-base", children: [
|
|
7013
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { children: [
|
|
6869
7014
|
rowsPerPageLabel,
|
|
6870
7015
|
":"
|
|
6871
7016
|
] }),
|
|
6872
|
-
/* @__PURE__ */ (0,
|
|
7017
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
6873
7018
|
Select2,
|
|
6874
7019
|
{
|
|
6875
7020
|
value: rowsPerPage.toString(),
|
|
6876
7021
|
onValueChange: (value) => onRowsPerPageChange(parseInt(value, 10)),
|
|
6877
7022
|
children: [
|
|
6878
|
-
/* @__PURE__ */ (0,
|
|
6879
|
-
/* @__PURE__ */ (0,
|
|
7023
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(SelectTrigger2, { className: "w-20", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(SelectValue2, {}) }),
|
|
7024
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(SelectContent2, { children: rowsPerPageOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(SelectItem2, { value: option.toString(), children: option }, option)) })
|
|
6880
7025
|
]
|
|
6881
7026
|
}
|
|
6882
7027
|
)
|
|
6883
7028
|
] }),
|
|
6884
|
-
/* @__PURE__ */ (0,
|
|
6885
|
-
/* @__PURE__ */ (0,
|
|
7029
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Pagination, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(PaginationContent, { children: [
|
|
7030
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(PaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
6886
7031
|
PaginationPrevious,
|
|
6887
7032
|
{
|
|
6888
7033
|
onClick: () => currentPage > 1 && onPageChange(currentPage - 1),
|
|
@@ -6890,7 +7035,7 @@ var ControlledPagination = ({
|
|
|
6890
7035
|
}
|
|
6891
7036
|
) }),
|
|
6892
7037
|
getPageNumbers().map(
|
|
6893
|
-
(page, idx) => page === "ellipsis" ? /* @__PURE__ */ (0,
|
|
7038
|
+
(page, idx) => page === "ellipsis" ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(PaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(PaginationEllipsis, {}) }, `ellipsis-${idx}`) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(PaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
6894
7039
|
PaginationLink,
|
|
6895
7040
|
{
|
|
6896
7041
|
onClick: () => onPageChange(page),
|
|
@@ -6900,7 +7045,7 @@ var ControlledPagination = ({
|
|
|
6900
7045
|
}
|
|
6901
7046
|
) }, page)
|
|
6902
7047
|
),
|
|
6903
|
-
/* @__PURE__ */ (0,
|
|
7048
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(PaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
6904
7049
|
PaginationNext,
|
|
6905
7050
|
{
|
|
6906
7051
|
onClick: () => currentPage < totalPages && onPageChange(currentPage + 1),
|
|
@@ -6913,7 +7058,7 @@ var ControlledPagination = ({
|
|
|
6913
7058
|
var ControlledPagination_default = ControlledPagination;
|
|
6914
7059
|
|
|
6915
7060
|
// src/components/ControlledTable/index.tsx
|
|
6916
|
-
var
|
|
7061
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
6917
7062
|
var ControlledTable = ({
|
|
6918
7063
|
tableSource,
|
|
6919
7064
|
tableConfig,
|
|
@@ -7009,7 +7154,7 @@ var ControlledTable = ({
|
|
|
7009
7154
|
if (field.renderLink) {
|
|
7010
7155
|
return field.renderLink(to, rawValue);
|
|
7011
7156
|
}
|
|
7012
|
-
return /* @__PURE__ */ (0,
|
|
7157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7013
7158
|
"a",
|
|
7014
7159
|
{
|
|
7015
7160
|
href: to,
|
|
@@ -7021,22 +7166,22 @@ var ControlledTable = ({
|
|
|
7021
7166
|
);
|
|
7022
7167
|
}
|
|
7023
7168
|
if (field.type === "img") {
|
|
7024
|
-
return /* @__PURE__ */ (0,
|
|
7169
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("img", { src: rawValue, alt: "", className: "h-auto max-w-full" });
|
|
7025
7170
|
}
|
|
7026
7171
|
if (field.type === "bool") {
|
|
7027
|
-
return rawValue ? /* @__PURE__ */ (0,
|
|
7172
|
+
return rawValue ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react8.Check, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react8.X, { size: 16 });
|
|
7028
7173
|
}
|
|
7029
7174
|
const content = rawValue ?? "";
|
|
7030
7175
|
if (field.withTooltip) {
|
|
7031
|
-
return /* @__PURE__ */ (0,
|
|
7032
|
-
/* @__PURE__ */ (0,
|
|
7033
|
-
/* @__PURE__ */ (0,
|
|
7176
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(Tooltip, { children: [
|
|
7177
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "block max-w-50 truncate", children: content }) }),
|
|
7178
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(TooltipContent, { children: content })
|
|
7034
7179
|
] }) });
|
|
7035
7180
|
}
|
|
7036
|
-
return /* @__PURE__ */ (0,
|
|
7181
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { children: content });
|
|
7037
7182
|
};
|
|
7038
|
-
return /* @__PURE__ */ (0,
|
|
7039
|
-
/* @__PURE__ */ (0,
|
|
7183
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "overflow-hidden rounded-sm border border-border", children: [
|
|
7184
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7040
7185
|
toolbar_default,
|
|
7041
7186
|
{
|
|
7042
7187
|
title,
|
|
@@ -7049,35 +7194,35 @@ var ControlledTable = ({
|
|
|
7049
7194
|
onFilterCallback
|
|
7050
7195
|
}
|
|
7051
7196
|
),
|
|
7052
|
-
/* @__PURE__ */ (0,
|
|
7053
|
-
loading && /* @__PURE__ */ (0,
|
|
7054
|
-
/* @__PURE__ */ (0,
|
|
7055
|
-
/* @__PURE__ */ (0,
|
|
7056
|
-
isSelectable && /* @__PURE__ */ (0,
|
|
7197
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "relative overflow-hidden", children: [
|
|
7198
|
+
loading && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "absolute inset-0 z-10 flex items-center justify-center bg-card/60", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" }) }),
|
|
7199
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "overflow-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("table", { className: "w-full text-base", children: [
|
|
7200
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("thead", { className: "border-b border-card-hover bg-surface text-dim", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("tr", { children: [
|
|
7201
|
+
isSelectable && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("th", { className: "w-10 px-3 py-3", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7057
7202
|
import_radix_ui8.Checkbox.Root,
|
|
7058
7203
|
{
|
|
7059
7204
|
checked: allSelected,
|
|
7060
7205
|
onCheckedChange: handleSelectAll,
|
|
7061
7206
|
className: "flex h-4 w-4 items-center justify-center rounded border border-border-input bg-white dark:bg-white/5 data-[state=checked]:border-primary data-[state=checked]:bg-primary",
|
|
7062
|
-
children: /* @__PURE__ */ (0,
|
|
7207
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_radix_ui8.Checkbox.Indicator, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react8.CheckIcon, { size: 10, className: "text-primary-foreground" }) })
|
|
7063
7208
|
}
|
|
7064
7209
|
) }),
|
|
7065
7210
|
fields.map((field) => {
|
|
7066
7211
|
const id = field.orderField || field.id;
|
|
7067
7212
|
const isSorted = sortObj?.field === id;
|
|
7068
|
-
return /* @__PURE__ */ (0,
|
|
7213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7069
7214
|
"th",
|
|
7070
7215
|
{
|
|
7071
7216
|
className: `px-3 py-3 text-base font-medium ${field.headAlign === "center" ? "text-center" : field.headAlign === "right" ? "text-right" : "text-left"} ${field.sortable ? "cursor-pointer select-none hover:text-primary" : ""}`,
|
|
7072
7217
|
style: { width: field.width },
|
|
7073
7218
|
onClick: () => field.sortable && handleSort(field),
|
|
7074
|
-
children: /* @__PURE__ */ (0,
|
|
7219
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
7075
7220
|
"div",
|
|
7076
7221
|
{
|
|
7077
7222
|
className: `inline-flex items-center gap-1 ${field.headAlign === "center" ? "justify-center" : ""}`,
|
|
7078
7223
|
children: [
|
|
7079
7224
|
field.label ?? "",
|
|
7080
|
-
field.sortable && (isSorted ? sortObj?.order === "asc" ? /* @__PURE__ */ (0,
|
|
7225
|
+
field.sortable && (isSorted ? sortObj?.order === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react8.ArrowUp, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react8.ArrowDown, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react8.ArrowUpDown, { size: 14, className: "opacity-40" }))
|
|
7081
7226
|
]
|
|
7082
7227
|
}
|
|
7083
7228
|
)
|
|
@@ -7085,9 +7230,9 @@ var ControlledTable = ({
|
|
|
7085
7230
|
field.id
|
|
7086
7231
|
);
|
|
7087
7232
|
}),
|
|
7088
|
-
hasActions && /* @__PURE__ */ (0,
|
|
7233
|
+
hasActions && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("th", { className: "w-10 px-3 py-3" })
|
|
7089
7234
|
] }) }),
|
|
7090
|
-
/* @__PURE__ */ (0,
|
|
7235
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("tbody", { children: tableData.length === 0 && !loading ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7091
7236
|
"td",
|
|
7092
7237
|
{
|
|
7093
7238
|
colSpan: fields.length + (isSelectable ? 1 : 0) + (hasActions ? 1 : 0),
|
|
@@ -7097,13 +7242,13 @@ var ControlledTable = ({
|
|
|
7097
7242
|
) }) : tableData.map((record) => {
|
|
7098
7243
|
const key = record[rowUniqueKey];
|
|
7099
7244
|
const isSelected = selectedRows.includes(key);
|
|
7100
|
-
return /* @__PURE__ */ (0,
|
|
7245
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
7101
7246
|
"tr",
|
|
7102
7247
|
{
|
|
7103
7248
|
onClick: () => onRowClick?.(record),
|
|
7104
7249
|
className: `border-b border-card-hover bg-card last:border-b-0 transition-colors ${onRowClick ? "cursor-pointer" : ""} ${isSelected ? "bg-primary/5" : "hover:bg-card-hover"}`,
|
|
7105
7250
|
children: [
|
|
7106
|
-
isSelectable && /* @__PURE__ */ (0,
|
|
7251
|
+
isSelectable && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7107
7252
|
"td",
|
|
7108
7253
|
{
|
|
7109
7254
|
className: "w-10 px-3 py-3",
|
|
@@ -7111,18 +7256,18 @@ var ControlledTable = ({
|
|
|
7111
7256
|
e.stopPropagation();
|
|
7112
7257
|
handleSelectRow(key);
|
|
7113
7258
|
},
|
|
7114
|
-
children: /* @__PURE__ */ (0,
|
|
7259
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7115
7260
|
import_radix_ui8.Checkbox.Root,
|
|
7116
7261
|
{
|
|
7117
7262
|
checked: isSelected,
|
|
7118
7263
|
onCheckedChange: () => handleSelectRow(key),
|
|
7119
7264
|
className: "flex h-4 w-4 items-center justify-center rounded border border-border-input bg-white dark:bg-white/5 data-[state=checked]:border-primary data-[state=checked]:bg-primary",
|
|
7120
|
-
children: /* @__PURE__ */ (0,
|
|
7265
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_radix_ui8.Checkbox.Indicator, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react8.CheckIcon, { size: 10, className: "text-primary-foreground" }) })
|
|
7121
7266
|
}
|
|
7122
7267
|
)
|
|
7123
7268
|
}
|
|
7124
7269
|
),
|
|
7125
|
-
fields.map((field) => /* @__PURE__ */ (0,
|
|
7270
|
+
fields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7126
7271
|
"td",
|
|
7127
7272
|
{
|
|
7128
7273
|
className: `px-3 py-3 text-base font-normal text-content ${field.textAlign === "center" ? "text-center" : field.textAlign === "right" ? "text-right" : "text-left"}`,
|
|
@@ -7131,24 +7276,24 @@ var ControlledTable = ({
|
|
|
7131
7276
|
},
|
|
7132
7277
|
field.id
|
|
7133
7278
|
)),
|
|
7134
|
-
hasActions && /* @__PURE__ */ (0,
|
|
7135
|
-
withEditAction && /* @__PURE__ */ (0,
|
|
7279
|
+
hasActions && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("td", { className: "px-3 py-3", onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
7280
|
+
withEditAction && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7136
7281
|
"button",
|
|
7137
7282
|
{
|
|
7138
7283
|
className: "inline-flex h-7 w-7 items-center justify-center rounded hover:bg-surface-hover",
|
|
7139
7284
|
onClick: () => handleEditAction?.(record.id),
|
|
7140
|
-
children: /* @__PURE__ */ (0,
|
|
7285
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react8.Edit, { size: 15 })
|
|
7141
7286
|
}
|
|
7142
7287
|
),
|
|
7143
|
-
withDownloadAction && /* @__PURE__ */ (0,
|
|
7288
|
+
withDownloadAction && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7144
7289
|
"button",
|
|
7145
7290
|
{
|
|
7146
7291
|
className: "inline-flex h-7 w-7 items-center justify-center rounded hover:bg-surface-hover",
|
|
7147
7292
|
onClick: () => handleDownloadAction?.(record.id),
|
|
7148
|
-
children: /* @__PURE__ */ (0,
|
|
7293
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react8.Download, { size: 15 })
|
|
7149
7294
|
}
|
|
7150
7295
|
),
|
|
7151
|
-
withOpenAction && /* @__PURE__ */ (0,
|
|
7296
|
+
withOpenAction && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7152
7297
|
"button",
|
|
7153
7298
|
{
|
|
7154
7299
|
className: "inline-flex h-7 w-7 items-center justify-center rounded hover:bg-surface-hover",
|
|
@@ -7157,23 +7302,23 @@ var ControlledTable = ({
|
|
|
7157
7302
|
else if (openPath) window.location.href = openPath(record);
|
|
7158
7303
|
else if (handleClickIcon) handleClickIcon(record);
|
|
7159
7304
|
},
|
|
7160
|
-
children: /* @__PURE__ */ (0,
|
|
7305
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react8.Eye, { size: 15 })
|
|
7161
7306
|
}
|
|
7162
7307
|
),
|
|
7163
|
-
withCloneAction && /* @__PURE__ */ (0,
|
|
7308
|
+
withCloneAction && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7164
7309
|
"button",
|
|
7165
7310
|
{
|
|
7166
7311
|
className: "inline-flex h-7 w-7 items-center justify-center rounded hover:bg-surface-hover",
|
|
7167
7312
|
onClick: () => handleClickIcon?.(record),
|
|
7168
|
-
children: /* @__PURE__ */ (0,
|
|
7313
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react8.Copy, { size: 15 })
|
|
7169
7314
|
}
|
|
7170
7315
|
),
|
|
7171
|
-
withRemoveAction && /* @__PURE__ */ (0,
|
|
7316
|
+
withRemoveAction && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7172
7317
|
"button",
|
|
7173
7318
|
{
|
|
7174
7319
|
className: "inline-flex h-7 w-7 items-center justify-center rounded text-destructive hover:bg-destructive/10",
|
|
7175
7320
|
onClick: () => handleRemoveAction?.(record.id),
|
|
7176
|
-
children: /* @__PURE__ */ (0,
|
|
7321
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react8.Trash2, { size: 15 })
|
|
7177
7322
|
}
|
|
7178
7323
|
)
|
|
7179
7324
|
] }) })
|
|
@@ -7184,7 +7329,7 @@ var ControlledTable = ({
|
|
|
7184
7329
|
}) })
|
|
7185
7330
|
] }) })
|
|
7186
7331
|
] }),
|
|
7187
|
-
withPagination && totalCount > 0 && /* @__PURE__ */ (0,
|
|
7332
|
+
withPagination && totalCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "border-t border-card-hover bg-card px-4 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7188
7333
|
ControlledPagination_default,
|
|
7189
7334
|
{
|
|
7190
7335
|
currentPage,
|
|
@@ -7199,6 +7344,135 @@ var ControlledTable = ({
|
|
|
7199
7344
|
};
|
|
7200
7345
|
var ControlledTable_default = ControlledTable;
|
|
7201
7346
|
|
|
7347
|
+
// src/hooks/useMediaQuery.ts
|
|
7348
|
+
var import_react12 = require("react");
|
|
7349
|
+
|
|
7350
|
+
// src/hooks/breakpoints.ts
|
|
7351
|
+
var breakpoints = {
|
|
7352
|
+
sm: 640,
|
|
7353
|
+
md: 768,
|
|
7354
|
+
lg: 1024,
|
|
7355
|
+
xl: 1280,
|
|
7356
|
+
"2xl": 1536
|
|
7357
|
+
};
|
|
7358
|
+
|
|
7359
|
+
// src/hooks/useMediaQuery.ts
|
|
7360
|
+
function useMediaQuery(query) {
|
|
7361
|
+
const [matches, setMatches] = (0, import_react12.useState)(() => {
|
|
7362
|
+
if (typeof window === "undefined") return false;
|
|
7363
|
+
return window.matchMedia(query).matches;
|
|
7364
|
+
});
|
|
7365
|
+
(0, import_react12.useEffect)(() => {
|
|
7366
|
+
if (typeof window === "undefined") return;
|
|
7367
|
+
const mql = window.matchMedia(query);
|
|
7368
|
+
setMatches(mql.matches);
|
|
7369
|
+
const handler = (e) => setMatches(e.matches);
|
|
7370
|
+
mql.addEventListener("change", handler);
|
|
7371
|
+
return () => mql.removeEventListener("change", handler);
|
|
7372
|
+
}, [query]);
|
|
7373
|
+
return matches;
|
|
7374
|
+
}
|
|
7375
|
+
function useBreakpoint(bp) {
|
|
7376
|
+
return useMediaQuery(`(min-width: ${breakpoints[bp]}px)`);
|
|
7377
|
+
}
|
|
7378
|
+
|
|
7379
|
+
// src/hooks/useLocalStorage.ts
|
|
7380
|
+
var import_react13 = require("react");
|
|
7381
|
+
function useLocalStorage(key, initialValue) {
|
|
7382
|
+
const [storedValue, setStoredValue] = (0, import_react13.useState)(() => {
|
|
7383
|
+
if (typeof window === "undefined") return initialValue;
|
|
7384
|
+
try {
|
|
7385
|
+
const item = window.localStorage.getItem(key);
|
|
7386
|
+
return item !== null ? JSON.parse(item) : initialValue;
|
|
7387
|
+
} catch {
|
|
7388
|
+
return initialValue;
|
|
7389
|
+
}
|
|
7390
|
+
});
|
|
7391
|
+
const setValue = (0, import_react13.useCallback)(
|
|
7392
|
+
(value) => {
|
|
7393
|
+
setStoredValue((prev) => {
|
|
7394
|
+
const next = typeof value === "function" ? value(prev) : value;
|
|
7395
|
+
try {
|
|
7396
|
+
window.localStorage.setItem(key, JSON.stringify(next));
|
|
7397
|
+
} catch {
|
|
7398
|
+
}
|
|
7399
|
+
return next;
|
|
7400
|
+
});
|
|
7401
|
+
},
|
|
7402
|
+
[key]
|
|
7403
|
+
);
|
|
7404
|
+
const removeValue = (0, import_react13.useCallback)(() => {
|
|
7405
|
+
setStoredValue(initialValue);
|
|
7406
|
+
try {
|
|
7407
|
+
window.localStorage.removeItem(key);
|
|
7408
|
+
} catch {
|
|
7409
|
+
}
|
|
7410
|
+
}, [key, initialValue]);
|
|
7411
|
+
return [storedValue, setValue, removeValue];
|
|
7412
|
+
}
|
|
7413
|
+
|
|
7414
|
+
// src/hooks/usePrevious.ts
|
|
7415
|
+
var import_react14 = require("react");
|
|
7416
|
+
function usePrevious2(value) {
|
|
7417
|
+
const ref = (0, import_react14.useRef)(void 0);
|
|
7418
|
+
(0, import_react14.useEffect)(() => {
|
|
7419
|
+
ref.current = value;
|
|
7420
|
+
}, [value]);
|
|
7421
|
+
return ref.current;
|
|
7422
|
+
}
|
|
7423
|
+
|
|
7424
|
+
// src/hooks/useClickOutside.ts
|
|
7425
|
+
var import_react15 = require("react");
|
|
7426
|
+
function useClickOutside(ref, handler) {
|
|
7427
|
+
(0, import_react15.useEffect)(() => {
|
|
7428
|
+
const listener = (event) => {
|
|
7429
|
+
if (!ref.current || ref.current.contains(event.target)) return;
|
|
7430
|
+
handler(event);
|
|
7431
|
+
};
|
|
7432
|
+
document.addEventListener("mousedown", listener);
|
|
7433
|
+
document.addEventListener("touchstart", listener);
|
|
7434
|
+
return () => {
|
|
7435
|
+
document.removeEventListener("mousedown", listener);
|
|
7436
|
+
document.removeEventListener("touchstart", listener);
|
|
7437
|
+
};
|
|
7438
|
+
}, [ref, handler]);
|
|
7439
|
+
}
|
|
7440
|
+
|
|
7441
|
+
// src/hooks/useDebounce.ts
|
|
7442
|
+
var import_react16 = require("react");
|
|
7443
|
+
function useDebounce2(value, delay) {
|
|
7444
|
+
const [debouncedValue, setDebouncedValue] = (0, import_react16.useState)(value);
|
|
7445
|
+
(0, import_react16.useEffect)(() => {
|
|
7446
|
+
const timer = setTimeout(() => setDebouncedValue(value), delay);
|
|
7447
|
+
return () => clearTimeout(timer);
|
|
7448
|
+
}, [value, delay]);
|
|
7449
|
+
return debouncedValue;
|
|
7450
|
+
}
|
|
7451
|
+
|
|
7452
|
+
// src/hooks/useTheme.ts
|
|
7453
|
+
var import_react17 = require("react");
|
|
7454
|
+
function useTheme(storageKey = "auxalia-theme") {
|
|
7455
|
+
const [theme, setThemeState] = (0, import_react17.useState)(() => {
|
|
7456
|
+
if (typeof window === "undefined") return "system";
|
|
7457
|
+
return localStorage.getItem(storageKey) ?? "system";
|
|
7458
|
+
});
|
|
7459
|
+
const resolvedTheme = theme === "system" ? typeof window !== "undefined" && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : theme;
|
|
7460
|
+
(0, import_react17.useEffect)(() => {
|
|
7461
|
+
document.documentElement.classList.toggle("dark", resolvedTheme === "dark");
|
|
7462
|
+
}, [resolvedTheme]);
|
|
7463
|
+
const setTheme = (0, import_react17.useCallback)(
|
|
7464
|
+
(next) => {
|
|
7465
|
+
setThemeState(next);
|
|
7466
|
+
try {
|
|
7467
|
+
localStorage.setItem(storageKey, next);
|
|
7468
|
+
} catch {
|
|
7469
|
+
}
|
|
7470
|
+
},
|
|
7471
|
+
[storageKey]
|
|
7472
|
+
);
|
|
7473
|
+
return { theme, resolvedTheme, setTheme };
|
|
7474
|
+
}
|
|
7475
|
+
|
|
7202
7476
|
// src/tailwind.preset.ts
|
|
7203
7477
|
var auxaliaColors = {
|
|
7204
7478
|
// Primary brand: Brand Green — values live in tokens.css as --color-auxalia-green-*
|
|
@@ -7406,6 +7680,7 @@ var AuxaliaTokens = {
|
|
|
7406
7680
|
CollapsibleContent,
|
|
7407
7681
|
CollapsibleRoot,
|
|
7408
7682
|
CollapsibleTrigger,
|
|
7683
|
+
Container,
|
|
7409
7684
|
ControlledTable,
|
|
7410
7685
|
Dialog,
|
|
7411
7686
|
DialogClose,
|
|
@@ -7442,6 +7717,7 @@ var AuxaliaTokens = {
|
|
|
7442
7717
|
FieldSeparator,
|
|
7443
7718
|
FieldSet,
|
|
7444
7719
|
FieldTitle,
|
|
7720
|
+
Icon,
|
|
7445
7721
|
Input,
|
|
7446
7722
|
Label,
|
|
7447
7723
|
Pagination,
|
|
@@ -7471,6 +7747,7 @@ var AuxaliaTokens = {
|
|
|
7471
7747
|
SkeletonAvatar,
|
|
7472
7748
|
SkeletonCard,
|
|
7473
7749
|
SkeletonText,
|
|
7750
|
+
Stack,
|
|
7474
7751
|
Switch,
|
|
7475
7752
|
Tabs,
|
|
7476
7753
|
TabsContent,
|
|
@@ -7482,9 +7759,20 @@ var AuxaliaTokens = {
|
|
|
7482
7759
|
TooltipProvider,
|
|
7483
7760
|
TooltipTrigger,
|
|
7484
7761
|
badgeVariants,
|
|
7762
|
+
breakpoints,
|
|
7485
7763
|
buttonVariants,
|
|
7486
7764
|
checkboxVariants,
|
|
7487
7765
|
cn,
|
|
7766
|
+
containerVariants,
|
|
7767
|
+
iconVariants,
|
|
7488
7768
|
radioItemVariants,
|
|
7489
|
-
|
|
7769
|
+
stackVariants,
|
|
7770
|
+
tailwindPreset,
|
|
7771
|
+
useBreakpoint,
|
|
7772
|
+
useClickOutside,
|
|
7773
|
+
useDebounce,
|
|
7774
|
+
useLocalStorage,
|
|
7775
|
+
useMediaQuery,
|
|
7776
|
+
usePrevious,
|
|
7777
|
+
useTheme
|
|
7490
7778
|
});
|