@adsgency_npm/adsgency-ads-ui 0.1.0-alpha.7 → 0.1.0-alpha.9
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 +603 -502
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +33 -1
- package/dist/index.d.ts +33 -1
- package/dist/index.js +537 -437
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -107,6 +107,7 @@ __export(src_exports, {
|
|
|
107
107
|
AdsInputOTPGroup: () => AdsInputOTPGroup,
|
|
108
108
|
AdsInputOTPSeparator: () => AdsInputOTPSeparator,
|
|
109
109
|
AdsInputOTPSlot: () => AdsInputOTPSlot,
|
|
110
|
+
AdsMasonry: () => AdsMasonry,
|
|
110
111
|
AdsPagination: () => AdsPagination,
|
|
111
112
|
AdsPaginationContent: () => AdsPaginationContent,
|
|
112
113
|
AdsPaginationEllipsis: () => AdsPaginationEllipsis,
|
|
@@ -2590,9 +2591,27 @@ var AdsSkeleton = React27.forwardRef(
|
|
|
2590
2591
|
AdsSkeleton.displayName = "AdsSkeleton";
|
|
2591
2592
|
|
|
2592
2593
|
// src/components/AdsInput/index.tsx
|
|
2594
|
+
var React29 = __toESM(require("react"), 1);
|
|
2595
|
+
|
|
2596
|
+
// src/lib/adsClearButton.tsx
|
|
2593
2597
|
var React28 = __toESM(require("react"), 1);
|
|
2594
2598
|
var import_lucide_react9 = require("lucide-react");
|
|
2595
2599
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2600
|
+
var adsClearButtonClassName = "inline-flex min-w-0 shrink-0 items-center justify-center rounded-sm border-0 bg-transparent p-0 text-icon-muted shadow-none transition-colors hover:bg-transparent hover:text-foreground focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-[rgba(161,161,161,0.5)] focus-visible:ring-offset-0 disabled:pointer-events-none disabled:opacity-50";
|
|
2601
|
+
var AdsClearButton = React28.forwardRef(({ className, type = "button", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2602
|
+
"button",
|
|
2603
|
+
{
|
|
2604
|
+
...props,
|
|
2605
|
+
className: cn(adsClearButtonClassName, "h-4 w-4", className),
|
|
2606
|
+
ref,
|
|
2607
|
+
type,
|
|
2608
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react9.X, { "aria-hidden": true, className: "h-3.5 w-3.5" })
|
|
2609
|
+
}
|
|
2610
|
+
));
|
|
2611
|
+
AdsClearButton.displayName = "AdsClearButton";
|
|
2612
|
+
|
|
2613
|
+
// src/components/AdsInput/index.tsx
|
|
2614
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2596
2615
|
var inputBaseClassName = "flex w-full rounded-md border border-border bg-card px-3 py-2 ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-[var(--card-foreground)] placeholder:text-[var(--muted-foreground)] focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm";
|
|
2597
2616
|
var inputSizeClasses = {
|
|
2598
2617
|
sm: "h-8 text-sm leading-5",
|
|
@@ -2634,7 +2653,7 @@ function getInputSurfaceClassName({
|
|
|
2634
2653
|
className
|
|
2635
2654
|
);
|
|
2636
2655
|
}
|
|
2637
|
-
var AdsInput =
|
|
2656
|
+
var AdsInput = React29.forwardRef(
|
|
2638
2657
|
({
|
|
2639
2658
|
action,
|
|
2640
2659
|
className,
|
|
@@ -2656,9 +2675,9 @@ var AdsInput = React28.forwardRef(
|
|
|
2656
2675
|
...props
|
|
2657
2676
|
}, ref) => {
|
|
2658
2677
|
const { messages } = useAdsI18n();
|
|
2659
|
-
const inputRef =
|
|
2660
|
-
const [selectedFiles, setSelectedFiles] =
|
|
2661
|
-
const [currentValue, setCurrentValue] =
|
|
2678
|
+
const inputRef = React29.useRef(null);
|
|
2679
|
+
const [selectedFiles, setSelectedFiles] = React29.useState([]);
|
|
2680
|
+
const [currentValue, setCurrentValue] = React29.useState(
|
|
2662
2681
|
() => getTextInputValue(props.value ?? props.defaultValue)
|
|
2663
2682
|
);
|
|
2664
2683
|
const description = useAdsFieldDescription({
|
|
@@ -2667,7 +2686,7 @@ var AdsInput = React28.forwardRef(
|
|
|
2667
2686
|
helperText,
|
|
2668
2687
|
id
|
|
2669
2688
|
});
|
|
2670
|
-
|
|
2689
|
+
React29.useEffect(() => {
|
|
2671
2690
|
if (props.value !== void 0) {
|
|
2672
2691
|
setCurrentValue(getTextInputValue(props.value));
|
|
2673
2692
|
}
|
|
@@ -2684,7 +2703,7 @@ var AdsInput = React28.forwardRef(
|
|
|
2684
2703
|
const resolvedClearButtonLabel = clearButtonLabel ?? messages.input.clear;
|
|
2685
2704
|
const resolvedFileTriggerLabel = fileTriggerLabel ?? messages.input.chooseFile;
|
|
2686
2705
|
const resolvedEmptyFileLabel = emptyFileLabel ?? messages.input.noFileChosen;
|
|
2687
|
-
const handleChange =
|
|
2706
|
+
const handleChange = React29.useCallback(
|
|
2688
2707
|
(event) => {
|
|
2689
2708
|
setCurrentValue(event.target.value);
|
|
2690
2709
|
if (isFileInput) {
|
|
@@ -2696,7 +2715,7 @@ var AdsInput = React28.forwardRef(
|
|
|
2696
2715
|
},
|
|
2697
2716
|
[isFileInput, onChange]
|
|
2698
2717
|
);
|
|
2699
|
-
const handleClear =
|
|
2718
|
+
const handleClear = React29.useCallback(() => {
|
|
2700
2719
|
const element = inputRef.current;
|
|
2701
2720
|
if (!element) {
|
|
2702
2721
|
return;
|
|
@@ -2711,10 +2730,10 @@ var AdsInput = React28.forwardRef(
|
|
|
2711
2730
|
onClear?.();
|
|
2712
2731
|
}, [onClear]);
|
|
2713
2732
|
const fileNameText = selectedFiles.length > 0 ? selectedFiles.join(", ") : resolvedEmptyFileLabel;
|
|
2714
|
-
const helperNode = helperText ? /* @__PURE__ */ (0,
|
|
2715
|
-
const errorNode = errorText ? /* @__PURE__ */ (0,
|
|
2716
|
-
const inputNode = isFileInput ? /* @__PURE__ */ (0,
|
|
2717
|
-
/* @__PURE__ */ (0,
|
|
2733
|
+
const helperNode = helperText ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(AdsFieldDescription, { id: description.helperId, children: helperText }) : null;
|
|
2734
|
+
const errorNode = errorText ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(AdsFieldError, { id: description.errorId, children: errorText }) : null;
|
|
2735
|
+
const inputNode = isFileInput ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "relative flex w-full min-w-0 flex-1 items-center", children: [
|
|
2736
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2718
2737
|
Input,
|
|
2719
2738
|
{
|
|
2720
2739
|
"aria-describedby": description.describedBy,
|
|
@@ -2734,7 +2753,7 @@ var AdsInput = React28.forwardRef(
|
|
|
2734
2753
|
...props
|
|
2735
2754
|
}
|
|
2736
2755
|
),
|
|
2737
|
-
/* @__PURE__ */ (0,
|
|
2756
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
2738
2757
|
"div",
|
|
2739
2758
|
{
|
|
2740
2759
|
"aria-hidden": "true",
|
|
@@ -2745,7 +2764,7 @@ var AdsInput = React28.forwardRef(
|
|
|
2745
2764
|
props.disabled ? "cursor-not-allowed opacity-50" : void 0
|
|
2746
2765
|
),
|
|
2747
2766
|
children: [
|
|
2748
|
-
/* @__PURE__ */ (0,
|
|
2767
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2749
2768
|
"span",
|
|
2750
2769
|
{
|
|
2751
2770
|
className: cn(
|
|
@@ -2755,7 +2774,7 @@ var AdsInput = React28.forwardRef(
|
|
|
2755
2774
|
children: resolvedFileTriggerLabel
|
|
2756
2775
|
}
|
|
2757
2776
|
),
|
|
2758
|
-
/* @__PURE__ */ (0,
|
|
2777
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2759
2778
|
"span",
|
|
2760
2779
|
{
|
|
2761
2780
|
className: cn(
|
|
@@ -2768,9 +2787,9 @@ var AdsInput = React28.forwardRef(
|
|
|
2768
2787
|
]
|
|
2769
2788
|
}
|
|
2770
2789
|
)
|
|
2771
|
-
] }) : /* @__PURE__ */ (0,
|
|
2772
|
-
prefix ? /* @__PURE__ */ (0,
|
|
2773
|
-
/* @__PURE__ */ (0,
|
|
2790
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "relative flex w-full min-w-0 flex-1 items-center", children: [
|
|
2791
|
+
prefix ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "pointer-events-none absolute left-md inline-flex text-icon-muted", children: prefix }) : null,
|
|
2792
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2774
2793
|
Input,
|
|
2775
2794
|
{
|
|
2776
2795
|
"aria-describedby": description.describedBy,
|
|
@@ -2786,30 +2805,23 @@ var AdsInput = React28.forwardRef(
|
|
|
2786
2805
|
...props
|
|
2787
2806
|
}
|
|
2788
2807
|
),
|
|
2789
|
-
canClear || suffix ? /* @__PURE__ */ (0,
|
|
2790
|
-
suffix ? /* @__PURE__ */ (0,
|
|
2791
|
-
canClear ? /* @__PURE__ */ (0,
|
|
2792
|
-
|
|
2808
|
+
canClear || suffix ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: "absolute right-md inline-flex items-center gap-xs text-icon-muted", children: [
|
|
2809
|
+
suffix ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "inline-flex items-center", children: suffix }) : null,
|
|
2810
|
+
canClear ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2811
|
+
AdsClearButton,
|
|
2793
2812
|
{
|
|
2794
2813
|
"aria-label": resolvedClearButtonLabel,
|
|
2795
|
-
|
|
2796
|
-
"inline-flex h-4 w-4 items-center justify-center rounded-sm text-icon-muted transition-colors focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-[rgba(161,161,161,0.5)] focus-visible:ring-offset-0",
|
|
2797
|
-
"hover:text-[var(--card-foreground)]"
|
|
2798
|
-
),
|
|
2799
|
-
onClick: handleClear,
|
|
2800
|
-
type: "button",
|
|
2801
|
-
variant: "ghost",
|
|
2802
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react9.X, { "aria-hidden": true, className: "h-3.5 w-3.5" })
|
|
2814
|
+
onClick: handleClear
|
|
2803
2815
|
}
|
|
2804
2816
|
) : null
|
|
2805
2817
|
] }) : null
|
|
2806
2818
|
] });
|
|
2807
|
-
return /* @__PURE__ */ (0,
|
|
2808
|
-
label ? /* @__PURE__ */ (0,
|
|
2819
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(AdsFieldItem, { children: [
|
|
2820
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(AdsFieldLabel, { htmlFor: description.inputId, children: label }) : null,
|
|
2809
2821
|
descriptionPlacement === "above" ? helperNode : null,
|
|
2810
|
-
/* @__PURE__ */ (0,
|
|
2822
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex w-full items-center gap-sm", children: [
|
|
2811
2823
|
inputNode,
|
|
2812
|
-
action ? /* @__PURE__ */ (0,
|
|
2824
|
+
action ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "shrink-0", children: action }) : null
|
|
2813
2825
|
] }),
|
|
2814
2826
|
descriptionPlacement === "below" ? helperNode : null,
|
|
2815
2827
|
errorNode
|
|
@@ -2819,14 +2831,13 @@ var AdsInput = React28.forwardRef(
|
|
|
2819
2831
|
AdsInput.displayName = "AdsInput";
|
|
2820
2832
|
|
|
2821
2833
|
// src/components/AdsInputGroup/index.tsx
|
|
2822
|
-
var
|
|
2823
|
-
var import_lucide_react10 = require("lucide-react");
|
|
2834
|
+
var React31 = __toESM(require("react"), 1);
|
|
2824
2835
|
|
|
2825
2836
|
// src/primitives/textarea.tsx
|
|
2826
|
-
var
|
|
2827
|
-
var
|
|
2828
|
-
var Textarea =
|
|
2829
|
-
return /* @__PURE__ */ (0,
|
|
2837
|
+
var React30 = __toESM(require("react"), 1);
|
|
2838
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2839
|
+
var Textarea = React30.forwardRef(({ className, ...props }, ref) => {
|
|
2840
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2830
2841
|
"textarea",
|
|
2831
2842
|
{
|
|
2832
2843
|
className: cn(
|
|
@@ -2841,7 +2852,7 @@ var Textarea = React29.forwardRef(({ className, ...props }, ref) => {
|
|
|
2841
2852
|
Textarea.displayName = "Textarea";
|
|
2842
2853
|
|
|
2843
2854
|
// src/components/AdsInputGroup/index.tsx
|
|
2844
|
-
var
|
|
2855
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2845
2856
|
function useAdsInputGroupDescription(describedBy, helperText, errorText, idBase) {
|
|
2846
2857
|
const helperId = helperText ? `${idBase}-helper` : void 0;
|
|
2847
2858
|
const errorId = errorText ? `${idBase}-error` : void 0;
|
|
@@ -2860,11 +2871,11 @@ function AdsInputGroupChrome({
|
|
|
2860
2871
|
helperText,
|
|
2861
2872
|
label
|
|
2862
2873
|
}) {
|
|
2863
|
-
return /* @__PURE__ */ (0,
|
|
2864
|
-
label ? /* @__PURE__ */ (0,
|
|
2874
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex w-full flex-col gap-md", children: [
|
|
2875
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "text-sm font-medium leading-5 text-foreground", children: label }) : null,
|
|
2865
2876
|
children,
|
|
2866
|
-
helperText ? /* @__PURE__ */ (0,
|
|
2867
|
-
errorText ? /* @__PURE__ */ (0,
|
|
2877
|
+
helperText ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-sm leading-5 text-muted-foreground", id: helperId, children: helperText }) : null,
|
|
2878
|
+
errorText ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-sm leading-5 text-destructive", id: errorId, children: errorText }) : null
|
|
2868
2879
|
] });
|
|
2869
2880
|
}
|
|
2870
2881
|
var addonBaseClassName = "flex shrink-0 items-center self-stretch bg-secondary px-lg text-sm leading-5 text-foreground";
|
|
@@ -2903,21 +2914,21 @@ function AdsInputGroup({
|
|
|
2903
2914
|
trailingAddon,
|
|
2904
2915
|
trailingAddonClassName
|
|
2905
2916
|
}) {
|
|
2906
|
-
const generatedId =
|
|
2917
|
+
const generatedId = React31.useId();
|
|
2907
2918
|
const description = useAdsInputGroupDescription(
|
|
2908
2919
|
void 0,
|
|
2909
2920
|
helperText,
|
|
2910
2921
|
errorText,
|
|
2911
2922
|
id ?? generatedId
|
|
2912
2923
|
);
|
|
2913
|
-
return /* @__PURE__ */ (0,
|
|
2924
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2914
2925
|
AdsInputGroupChrome,
|
|
2915
2926
|
{
|
|
2916
2927
|
errorText,
|
|
2917
2928
|
helperText,
|
|
2918
2929
|
label,
|
|
2919
2930
|
...description,
|
|
2920
|
-
children: /* @__PURE__ */ (0,
|
|
2931
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: cn("w-full", className), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
2921
2932
|
"div",
|
|
2922
2933
|
{
|
|
2923
2934
|
className: cn(
|
|
@@ -2927,9 +2938,9 @@ function AdsInputGroup({
|
|
|
2927
2938
|
surfaceClassName
|
|
2928
2939
|
),
|
|
2929
2940
|
children: [
|
|
2930
|
-
header ? /* @__PURE__ */ (0,
|
|
2931
|
-
/* @__PURE__ */ (0,
|
|
2932
|
-
leadingAddon ? /* @__PURE__ */ (0,
|
|
2941
|
+
header ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "border-b border-border px-md py-md text-sm text-foreground", children: header }) : null,
|
|
2942
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex min-h-11 w-full items-stretch", children: [
|
|
2943
|
+
leadingAddon ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2933
2944
|
"div",
|
|
2934
2945
|
{
|
|
2935
2946
|
className: cn(
|
|
@@ -2940,7 +2951,7 @@ function AdsInputGroup({
|
|
|
2940
2951
|
children: leadingAddon
|
|
2941
2952
|
}
|
|
2942
2953
|
) : null,
|
|
2943
|
-
/* @__PURE__ */ (0,
|
|
2954
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2944
2955
|
"div",
|
|
2945
2956
|
{
|
|
2946
2957
|
className: cn(
|
|
@@ -2950,7 +2961,7 @@ function AdsInputGroup({
|
|
|
2950
2961
|
children
|
|
2951
2962
|
}
|
|
2952
2963
|
),
|
|
2953
|
-
trailingAddon ? /* @__PURE__ */ (0,
|
|
2964
|
+
trailingAddon ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2954
2965
|
"div",
|
|
2955
2966
|
{
|
|
2956
2967
|
className: cn(
|
|
@@ -2962,33 +2973,33 @@ function AdsInputGroup({
|
|
|
2962
2973
|
}
|
|
2963
2974
|
) : null
|
|
2964
2975
|
] }),
|
|
2965
|
-
footer ? /* @__PURE__ */ (0,
|
|
2976
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "border-t border-border px-md py-sm text-sm text-muted-foreground", children: footer }) : null
|
|
2966
2977
|
]
|
|
2967
2978
|
}
|
|
2968
2979
|
) })
|
|
2969
2980
|
}
|
|
2970
2981
|
);
|
|
2971
2982
|
}
|
|
2972
|
-
var AdsInputGroupInput =
|
|
2983
|
+
var AdsInputGroupInput = React31.forwardRef(({ className, clearable = false, clearButtonLabel, onChange, onClear, ...props }, ref) => {
|
|
2973
2984
|
const { messages } = useAdsI18n();
|
|
2974
|
-
const inputRef =
|
|
2975
|
-
const [currentValue, setCurrentValue] =
|
|
2985
|
+
const inputRef = React31.useRef(null);
|
|
2986
|
+
const [currentValue, setCurrentValue] = React31.useState(
|
|
2976
2987
|
() => getInputGroupValue(props.value ?? props.defaultValue)
|
|
2977
2988
|
);
|
|
2978
|
-
|
|
2989
|
+
React31.useEffect(() => {
|
|
2979
2990
|
if (props.value !== void 0) {
|
|
2980
2991
|
setCurrentValue(getInputGroupValue(props.value));
|
|
2981
2992
|
}
|
|
2982
2993
|
}, [props.value]);
|
|
2983
2994
|
const canClear = clearable && !props.disabled && !props.readOnly && currentValue.length > 0;
|
|
2984
|
-
const handleChange =
|
|
2995
|
+
const handleChange = React31.useCallback(
|
|
2985
2996
|
(event) => {
|
|
2986
2997
|
setCurrentValue(event.target.value);
|
|
2987
2998
|
onChange?.(event);
|
|
2988
2999
|
},
|
|
2989
3000
|
[onChange]
|
|
2990
3001
|
);
|
|
2991
|
-
const handleClear =
|
|
3002
|
+
const handleClear = React31.useCallback(() => {
|
|
2992
3003
|
const element = inputRef.current;
|
|
2993
3004
|
if (!element) {
|
|
2994
3005
|
return;
|
|
@@ -3002,8 +3013,8 @@ var AdsInputGroupInput = React30.forwardRef(({ className, clearable = false, cle
|
|
|
3002
3013
|
element.focus();
|
|
3003
3014
|
onClear?.();
|
|
3004
3015
|
}, [onClear]);
|
|
3005
|
-
return /* @__PURE__ */ (0,
|
|
3006
|
-
/* @__PURE__ */ (0,
|
|
3016
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "relative flex w-full min-w-0 flex-1 items-center", children: [
|
|
3017
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
3007
3018
|
Input,
|
|
3008
3019
|
{
|
|
3009
3020
|
className: cn(
|
|
@@ -3020,21 +3031,18 @@ var AdsInputGroupInput = React30.forwardRef(({ className, clearable = false, cle
|
|
|
3020
3031
|
...props
|
|
3021
3032
|
}
|
|
3022
3033
|
),
|
|
3023
|
-
canClear ? /* @__PURE__ */ (0,
|
|
3024
|
-
|
|
3034
|
+
canClear ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
3035
|
+
AdsClearButton,
|
|
3025
3036
|
{
|
|
3026
3037
|
"aria-label": clearButtonLabel ?? messages.input.clear,
|
|
3027
|
-
className: "absolute right-0
|
|
3028
|
-
onClick: handleClear
|
|
3029
|
-
type: "button",
|
|
3030
|
-
variant: "ghost",
|
|
3031
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react10.X, { "aria-hidden": true, className: "h-3.5 w-3.5" })
|
|
3038
|
+
className: "absolute right-0",
|
|
3039
|
+
onClick: handleClear
|
|
3032
3040
|
}
|
|
3033
3041
|
) : null
|
|
3034
3042
|
] });
|
|
3035
3043
|
});
|
|
3036
3044
|
AdsInputGroupInput.displayName = "AdsInputGroupInput";
|
|
3037
|
-
var AdsInputGroupTextarea =
|
|
3045
|
+
var AdsInputGroupTextarea = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
3038
3046
|
Textarea,
|
|
3039
3047
|
{
|
|
3040
3048
|
className: cn(
|
|
@@ -3049,14 +3057,14 @@ var AdsInputGroupTextarea = React30.forwardRef(({ className, ...props }, ref) =>
|
|
|
3049
3057
|
AdsInputGroupTextarea.displayName = "AdsInputGroupTextarea";
|
|
3050
3058
|
|
|
3051
3059
|
// src/components/AdsInputOTP/index.tsx
|
|
3052
|
-
var
|
|
3060
|
+
var React33 = __toESM(require("react"), 1);
|
|
3053
3061
|
|
|
3054
3062
|
// src/primitives/input-otp.tsx
|
|
3055
|
-
var
|
|
3063
|
+
var React32 = __toESM(require("react"), 1);
|
|
3056
3064
|
var import_input_otp = require("input-otp");
|
|
3057
|
-
var
|
|
3058
|
-
var
|
|
3059
|
-
var InputOTP =
|
|
3065
|
+
var import_lucide_react10 = require("lucide-react");
|
|
3066
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
3067
|
+
var InputOTP = React32.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3060
3068
|
import_input_otp.OTPInput,
|
|
3061
3069
|
{
|
|
3062
3070
|
ref,
|
|
@@ -3069,12 +3077,12 @@ var InputOTP = React31.forwardRef(({ className, containerClassName, ...props },
|
|
|
3069
3077
|
}
|
|
3070
3078
|
));
|
|
3071
3079
|
InputOTP.displayName = "InputOTP";
|
|
3072
|
-
var InputOTPGroup =
|
|
3080
|
+
var InputOTPGroup = React32.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { ref, className: cn("flex items-center", className), ...props }));
|
|
3073
3081
|
InputOTPGroup.displayName = "InputOTPGroup";
|
|
3074
|
-
var InputOTPSlot =
|
|
3075
|
-
const inputOTPContext =
|
|
3082
|
+
var InputOTPSlot = React32.forwardRef(({ index, className, ...props }, ref) => {
|
|
3083
|
+
const inputOTPContext = React32.useContext(import_input_otp.OTPInputContext);
|
|
3076
3084
|
const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];
|
|
3077
|
-
return /* @__PURE__ */ (0,
|
|
3085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
3078
3086
|
"div",
|
|
3079
3087
|
{
|
|
3080
3088
|
ref,
|
|
@@ -3086,19 +3094,19 @@ var InputOTPSlot = React31.forwardRef(({ index, className, ...props }, ref) => {
|
|
|
3086
3094
|
...props,
|
|
3087
3095
|
children: [
|
|
3088
3096
|
char,
|
|
3089
|
-
hasFakeCaret && /* @__PURE__ */ (0,
|
|
3097
|
+
hasFakeCaret && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "h-4 w-px animate-caret-blink bg-foreground duration-1000" }) })
|
|
3090
3098
|
]
|
|
3091
3099
|
}
|
|
3092
3100
|
);
|
|
3093
3101
|
});
|
|
3094
3102
|
InputOTPSlot.displayName = "InputOTPSlot";
|
|
3095
|
-
var InputOTPSeparator =
|
|
3103
|
+
var InputOTPSeparator = React32.forwardRef(({ ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { ref, role: "separator", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react10.Dot, {}) }));
|
|
3096
3104
|
InputOTPSeparator.displayName = "InputOTPSeparator";
|
|
3097
3105
|
|
|
3098
3106
|
// src/components/AdsInputOTP/index.tsx
|
|
3099
|
-
var
|
|
3107
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
3100
3108
|
function useFieldDescription(id, describedBy, helperText, errorText) {
|
|
3101
|
-
const generatedId =
|
|
3109
|
+
const generatedId = React33.useId();
|
|
3102
3110
|
const inputId = id ?? generatedId;
|
|
3103
3111
|
const helperId = helperText ? `${inputId}-helper` : void 0;
|
|
3104
3112
|
const errorId = errorText ? `${inputId}-error` : void 0;
|
|
@@ -3119,21 +3127,21 @@ function AdsInputOTPChrome({
|
|
|
3119
3127
|
inputId,
|
|
3120
3128
|
label
|
|
3121
3129
|
}) {
|
|
3122
|
-
return /* @__PURE__ */ (0,
|
|
3123
|
-
label ? /* @__PURE__ */ (0,
|
|
3130
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex w-full flex-col gap-md", children: [
|
|
3131
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("label", { className: "text-sm font-medium leading-5 text-foreground", htmlFor: inputId, children: label }) : null,
|
|
3124
3132
|
children,
|
|
3125
|
-
helperText ? /* @__PURE__ */ (0,
|
|
3126
|
-
errorText ? /* @__PURE__ */ (0,
|
|
3133
|
+
helperText ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-sm leading-5 text-muted-foreground", id: helperId, children: helperText }) : null,
|
|
3134
|
+
errorText ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-sm leading-5 text-destructive", id: errorId, children: errorText }) : null
|
|
3127
3135
|
] });
|
|
3128
3136
|
}
|
|
3129
3137
|
function buildSeparator(node, key) {
|
|
3130
3138
|
if (node === void 0) {
|
|
3131
|
-
return /* @__PURE__ */ (0,
|
|
3139
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(AdsInputOTPSeparator, {}, key);
|
|
3132
3140
|
}
|
|
3133
|
-
if (
|
|
3134
|
-
return
|
|
3141
|
+
if (React33.isValidElement(node)) {
|
|
3142
|
+
return React33.cloneElement(node, { key });
|
|
3135
3143
|
}
|
|
3136
|
-
return /* @__PURE__ */ (0,
|
|
3144
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { children: node }, key);
|
|
3137
3145
|
}
|
|
3138
3146
|
function buildOtpChildren(groups, separator) {
|
|
3139
3147
|
const defaultGroup = groups.length > 0 ? groups : [6];
|
|
@@ -3141,7 +3149,7 @@ function buildOtpChildren(groups, separator) {
|
|
|
3141
3149
|
let index = 0;
|
|
3142
3150
|
defaultGroup.forEach((size, indexOfGroup) => {
|
|
3143
3151
|
items.push(
|
|
3144
|
-
/* @__PURE__ */ (0,
|
|
3152
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(AdsInputOTPGroup, { children: Array.from({ length: size }, (_, slotOffset) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3145
3153
|
AdsInputOTPSlot,
|
|
3146
3154
|
{
|
|
3147
3155
|
index: index + slotOffset
|
|
@@ -3156,11 +3164,11 @@ function buildOtpChildren(groups, separator) {
|
|
|
3156
3164
|
});
|
|
3157
3165
|
return items;
|
|
3158
3166
|
}
|
|
3159
|
-
var AdsInputOTP =
|
|
3167
|
+
var AdsInputOTP = React33.forwardRef(({ action, errorText, groups, helperText, label, separator, children, id, ...props }, ref) => {
|
|
3160
3168
|
const totalSlots = groups && groups.length > 0 ? groups.reduce((sum, value) => sum + value, 0) : 6;
|
|
3161
3169
|
const description = useFieldDescription(id, props["aria-describedby"], helperText, errorText);
|
|
3162
3170
|
const otpChildren = children ?? buildOtpChildren(groups ?? [], separator);
|
|
3163
|
-
return /* @__PURE__ */ (0,
|
|
3171
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3164
3172
|
AdsInputOTPChrome,
|
|
3165
3173
|
{
|
|
3166
3174
|
errorText,
|
|
@@ -3169,8 +3177,8 @@ var AdsInputOTP = React32.forwardRef(({ action, errorText, groups, helperText, l
|
|
|
3169
3177
|
helperId: description.helperId,
|
|
3170
3178
|
inputId: description.inputId,
|
|
3171
3179
|
label,
|
|
3172
|
-
children: /* @__PURE__ */ (0,
|
|
3173
|
-
/* @__PURE__ */ (0,
|
|
3180
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex w-full items-center gap-sm", children: [
|
|
3181
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3174
3182
|
InputOTP,
|
|
3175
3183
|
{
|
|
3176
3184
|
"aria-describedby": description.describedBy,
|
|
@@ -3182,15 +3190,15 @@ var AdsInputOTP = React32.forwardRef(({ action, errorText, groups, helperText, l
|
|
|
3182
3190
|
children: otpChildren
|
|
3183
3191
|
}
|
|
3184
3192
|
),
|
|
3185
|
-
action ? /* @__PURE__ */ (0,
|
|
3193
|
+
action ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "shrink-0", children: action }) : null
|
|
3186
3194
|
] })
|
|
3187
3195
|
}
|
|
3188
3196
|
);
|
|
3189
3197
|
});
|
|
3190
3198
|
AdsInputOTP.displayName = "AdsInputOTP";
|
|
3191
|
-
var AdsInputOTPGroup =
|
|
3199
|
+
var AdsInputOTPGroup = React33.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(InputOTPGroup, { className, ref, ...props }));
|
|
3192
3200
|
AdsInputOTPGroup.displayName = "AdsInputOTPGroup";
|
|
3193
|
-
var AdsInputOTPSeparator =
|
|
3201
|
+
var AdsInputOTPSeparator = React33.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3194
3202
|
InputOTPSeparator,
|
|
3195
3203
|
{
|
|
3196
3204
|
className: className ?? "h-px w-6 shrink-0 bg-border text-transparent [&_svg]:hidden",
|
|
@@ -3199,7 +3207,7 @@ var AdsInputOTPSeparator = React32.forwardRef(({ className, ...props }, ref) =>
|
|
|
3199
3207
|
}
|
|
3200
3208
|
));
|
|
3201
3209
|
AdsInputOTPSeparator.displayName = "AdsInputOTPSeparator";
|
|
3202
|
-
var AdsInputOTPSlot =
|
|
3210
|
+
var AdsInputOTPSlot = React33.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3203
3211
|
InputOTPSlot,
|
|
3204
3212
|
{
|
|
3205
3213
|
className: [
|
|
@@ -3216,17 +3224,17 @@ var AdsInputOTPSlot = React32.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
3216
3224
|
AdsInputOTPSlot.displayName = "AdsInputOTPSlot";
|
|
3217
3225
|
|
|
3218
3226
|
// src/components/AdsDataPagination/index.tsx
|
|
3219
|
-
var
|
|
3227
|
+
var React37 = __toESM(require("react"), 1);
|
|
3220
3228
|
|
|
3221
3229
|
// src/components/AdsPagination/index.tsx
|
|
3222
|
-
var
|
|
3223
|
-
var
|
|
3230
|
+
var React35 = __toESM(require("react"), 1);
|
|
3231
|
+
var import_lucide_react12 = require("lucide-react");
|
|
3224
3232
|
|
|
3225
3233
|
// src/primitives/pagination.tsx
|
|
3226
|
-
var
|
|
3227
|
-
var
|
|
3228
|
-
var
|
|
3229
|
-
var Pagination = ({ className, ...props }) => /* @__PURE__ */ (0,
|
|
3234
|
+
var React34 = __toESM(require("react"), 1);
|
|
3235
|
+
var import_lucide_react11 = require("lucide-react");
|
|
3236
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
3237
|
+
var Pagination = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3230
3238
|
"nav",
|
|
3231
3239
|
{
|
|
3232
3240
|
role: "navigation",
|
|
@@ -3236,7 +3244,7 @@ var Pagination = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_run
|
|
|
3236
3244
|
}
|
|
3237
3245
|
);
|
|
3238
3246
|
Pagination.displayName = "Pagination";
|
|
3239
|
-
var PaginationContent =
|
|
3247
|
+
var PaginationContent = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3240
3248
|
"ul",
|
|
3241
3249
|
{
|
|
3242
3250
|
ref,
|
|
@@ -3245,14 +3253,14 @@ var PaginationContent = React33.forwardRef(({ className, ...props }, ref) => /*
|
|
|
3245
3253
|
}
|
|
3246
3254
|
));
|
|
3247
3255
|
PaginationContent.displayName = "PaginationContent";
|
|
3248
|
-
var PaginationItem =
|
|
3256
|
+
var PaginationItem = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("li", { ref, className: cn("", className), ...props }));
|
|
3249
3257
|
PaginationItem.displayName = "PaginationItem";
|
|
3250
3258
|
var PaginationLink = ({
|
|
3251
3259
|
className,
|
|
3252
3260
|
isActive,
|
|
3253
3261
|
size = "icon",
|
|
3254
3262
|
...props
|
|
3255
|
-
}) => /* @__PURE__ */ (0,
|
|
3263
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3256
3264
|
"a",
|
|
3257
3265
|
{
|
|
3258
3266
|
"aria-current": isActive ? "page" : void 0,
|
|
@@ -3270,7 +3278,7 @@ PaginationLink.displayName = "PaginationLink";
|
|
|
3270
3278
|
var PaginationPrevious = ({
|
|
3271
3279
|
className,
|
|
3272
3280
|
...props
|
|
3273
|
-
}) => /* @__PURE__ */ (0,
|
|
3281
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
3274
3282
|
PaginationLink,
|
|
3275
3283
|
{
|
|
3276
3284
|
"aria-label": "Go to previous page",
|
|
@@ -3278,8 +3286,8 @@ var PaginationPrevious = ({
|
|
|
3278
3286
|
className: cn("gap-1 pl-2.5", className),
|
|
3279
3287
|
...props,
|
|
3280
3288
|
children: [
|
|
3281
|
-
/* @__PURE__ */ (0,
|
|
3282
|
-
/* @__PURE__ */ (0,
|
|
3289
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react11.ChevronLeft, { className: "h-4 w-4" }),
|
|
3290
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { children: "Previous" })
|
|
3283
3291
|
]
|
|
3284
3292
|
}
|
|
3285
3293
|
);
|
|
@@ -3287,7 +3295,7 @@ PaginationPrevious.displayName = "PaginationPrevious";
|
|
|
3287
3295
|
var PaginationNext = ({
|
|
3288
3296
|
className,
|
|
3289
3297
|
...props
|
|
3290
|
-
}) => /* @__PURE__ */ (0,
|
|
3298
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
3291
3299
|
PaginationLink,
|
|
3292
3300
|
{
|
|
3293
3301
|
"aria-label": "Go to next page",
|
|
@@ -3295,8 +3303,8 @@ var PaginationNext = ({
|
|
|
3295
3303
|
className: cn("gap-1 pr-2.5", className),
|
|
3296
3304
|
...props,
|
|
3297
3305
|
children: [
|
|
3298
|
-
/* @__PURE__ */ (0,
|
|
3299
|
-
/* @__PURE__ */ (0,
|
|
3306
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { children: "Next" }),
|
|
3307
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react11.ChevronRight, { className: "h-4 w-4" })
|
|
3300
3308
|
]
|
|
3301
3309
|
}
|
|
3302
3310
|
);
|
|
@@ -3304,27 +3312,27 @@ PaginationNext.displayName = "PaginationNext";
|
|
|
3304
3312
|
var PaginationEllipsis = ({
|
|
3305
3313
|
className,
|
|
3306
3314
|
...props
|
|
3307
|
-
}) => /* @__PURE__ */ (0,
|
|
3315
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
3308
3316
|
"span",
|
|
3309
3317
|
{
|
|
3310
3318
|
"aria-hidden": true,
|
|
3311
3319
|
className: cn("flex h-9 w-9 items-center justify-center", className),
|
|
3312
3320
|
...props,
|
|
3313
3321
|
children: [
|
|
3314
|
-
/* @__PURE__ */ (0,
|
|
3315
|
-
/* @__PURE__ */ (0,
|
|
3322
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react11.MoreHorizontal, { className: "h-4 w-4" }),
|
|
3323
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "sr-only", children: "More pages" })
|
|
3316
3324
|
]
|
|
3317
3325
|
}
|
|
3318
3326
|
);
|
|
3319
3327
|
PaginationEllipsis.displayName = "PaginationEllipsis";
|
|
3320
3328
|
|
|
3321
3329
|
// src/components/AdsPagination/index.tsx
|
|
3322
|
-
var
|
|
3330
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
3323
3331
|
var paginationLinkBaseClassName = "inline-flex h-9 min-w-9 items-center justify-center rounded-radius-md border text-sm font-medium leading-5 tracking-normal transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background";
|
|
3324
3332
|
var paginationLinkInactiveClassName = "border-transparent bg-transparent px-[10px] text-foreground shadow-none hover:bg-accent hover:shadow-[0px_1px_2px_rgba(0,0,0,0.1)]";
|
|
3325
3333
|
var paginationLinkActiveClassName = "border-border bg-card px-[10px] text-foreground shadow-[0px_1px_2px_rgba(0,0,0,0.1)]";
|
|
3326
3334
|
function AdsPagination({ className, ...props }) {
|
|
3327
|
-
return /* @__PURE__ */ (0,
|
|
3335
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3328
3336
|
Pagination,
|
|
3329
3337
|
{
|
|
3330
3338
|
className: cn("mx-0 w-auto justify-start", className),
|
|
@@ -3333,14 +3341,14 @@ function AdsPagination({ className, ...props }) {
|
|
|
3333
3341
|
);
|
|
3334
3342
|
}
|
|
3335
3343
|
AdsPagination.displayName = "AdsPagination";
|
|
3336
|
-
var AdsPaginationContent =
|
|
3344
|
+
var AdsPaginationContent = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(PaginationContent, { ref, className: cn("gap-1", className), ...props }));
|
|
3337
3345
|
AdsPaginationContent.displayName = "AdsPaginationContent";
|
|
3338
|
-
var AdsPaginationItem =
|
|
3339
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3346
|
+
var AdsPaginationItem = React35.forwardRef(
|
|
3347
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(PaginationItem, { ref, className, ...props })
|
|
3340
3348
|
);
|
|
3341
3349
|
AdsPaginationItem.displayName = "AdsPaginationItem";
|
|
3342
|
-
var AdsPaginationLink =
|
|
3343
|
-
({ className, isActive = false, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3350
|
+
var AdsPaginationLink = React35.forwardRef(
|
|
3351
|
+
({ className, isActive = false, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3344
3352
|
"a",
|
|
3345
3353
|
{
|
|
3346
3354
|
"aria-current": isActive ? "page" : void 0,
|
|
@@ -3355,10 +3363,10 @@ var AdsPaginationLink = React34.forwardRef(
|
|
|
3355
3363
|
)
|
|
3356
3364
|
);
|
|
3357
3365
|
AdsPaginationLink.displayName = "AdsPaginationLink";
|
|
3358
|
-
var AdsPaginationPrevious =
|
|
3366
|
+
var AdsPaginationPrevious = React35.forwardRef(({ "aria-label": ariaLabel, children, className, ...props }, ref) => {
|
|
3359
3367
|
const { messages } = useAdsI18n();
|
|
3360
3368
|
const label = children ?? messages.pagination.previous;
|
|
3361
|
-
return /* @__PURE__ */ (0,
|
|
3369
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
3362
3370
|
AdsPaginationLink,
|
|
3363
3371
|
{
|
|
3364
3372
|
"aria-label": ariaLabel ?? messages.pagination.previous,
|
|
@@ -3366,18 +3374,18 @@ var AdsPaginationPrevious = React34.forwardRef(({ "aria-label": ariaLabel, child
|
|
|
3366
3374
|
ref,
|
|
3367
3375
|
...props,
|
|
3368
3376
|
children: [
|
|
3369
|
-
/* @__PURE__ */ (0,
|
|
3370
|
-
/* @__PURE__ */ (0,
|
|
3377
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react12.ChevronLeft, { "aria-hidden": true, className: "h-4 w-4" }),
|
|
3378
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { children: label })
|
|
3371
3379
|
]
|
|
3372
3380
|
}
|
|
3373
3381
|
);
|
|
3374
3382
|
});
|
|
3375
3383
|
AdsPaginationPrevious.displayName = "AdsPaginationPrevious";
|
|
3376
|
-
var AdsPaginationNext =
|
|
3384
|
+
var AdsPaginationNext = React35.forwardRef(
|
|
3377
3385
|
({ "aria-label": ariaLabel, children, className, ...props }, ref) => {
|
|
3378
3386
|
const { messages } = useAdsI18n();
|
|
3379
3387
|
const label = children ?? messages.pagination.next;
|
|
3380
|
-
return /* @__PURE__ */ (0,
|
|
3388
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
3381
3389
|
AdsPaginationLink,
|
|
3382
3390
|
{
|
|
3383
3391
|
"aria-label": ariaLabel ?? messages.pagination.next,
|
|
@@ -3385,8 +3393,8 @@ var AdsPaginationNext = React34.forwardRef(
|
|
|
3385
3393
|
ref,
|
|
3386
3394
|
...props,
|
|
3387
3395
|
children: [
|
|
3388
|
-
/* @__PURE__ */ (0,
|
|
3389
|
-
/* @__PURE__ */ (0,
|
|
3396
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { children: label }),
|
|
3397
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react12.ChevronRight, { "aria-hidden": true, className: "h-4 w-4" })
|
|
3390
3398
|
]
|
|
3391
3399
|
}
|
|
3392
3400
|
);
|
|
@@ -3400,7 +3408,7 @@ function AdsPaginationEllipsis({
|
|
|
3400
3408
|
}) {
|
|
3401
3409
|
const { messages } = useAdsI18n();
|
|
3402
3410
|
const resolvedLabel = label ?? messages.pagination.morePages;
|
|
3403
|
-
return /* @__PURE__ */ (0,
|
|
3411
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
3404
3412
|
"span",
|
|
3405
3413
|
{
|
|
3406
3414
|
"aria-hidden": true,
|
|
@@ -3410,8 +3418,8 @@ function AdsPaginationEllipsis({
|
|
|
3410
3418
|
),
|
|
3411
3419
|
...props,
|
|
3412
3420
|
children: [
|
|
3413
|
-
/* @__PURE__ */ (0,
|
|
3414
|
-
/* @__PURE__ */ (0,
|
|
3421
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react12.MoreHorizontal, { className: "h-4 w-4" }),
|
|
3422
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "sr-only", children: resolvedLabel })
|
|
3415
3423
|
]
|
|
3416
3424
|
}
|
|
3417
3425
|
);
|
|
@@ -3419,9 +3427,8 @@ function AdsPaginationEllipsis({
|
|
|
3419
3427
|
AdsPaginationEllipsis.displayName = "AdsPaginationEllipsis";
|
|
3420
3428
|
|
|
3421
3429
|
// src/components/AdsSelect/index.tsx
|
|
3422
|
-
var
|
|
3423
|
-
var
|
|
3424
|
-
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
3430
|
+
var React36 = __toESM(require("react"), 1);
|
|
3431
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
3425
3432
|
var selectTriggerBaseClassName = "h-9 rounded-radius-md border border-border bg-card px-md py-2 text-sm leading-5 shadow-[0px_1px_2px_rgba(0,0,0,0.1)] focus:border-border-focus focus:ring-[3px] focus:ring-[rgba(161,161,161,0.5)] focus:ring-offset-0 data-[placeholder]:text-[var(--muted-foreground)]";
|
|
3426
3433
|
var selectContentBaseClassName = "rounded-radius-md border-border bg-popover text-popover-foreground shadow-[0px_8px_24px_rgba(0,0,0,0.22)]";
|
|
3427
3434
|
function AdsSelect({
|
|
@@ -3445,7 +3452,7 @@ function AdsSelect({
|
|
|
3445
3452
|
}) {
|
|
3446
3453
|
const { messages } = useAdsI18n();
|
|
3447
3454
|
const isControlled = value !== void 0;
|
|
3448
|
-
const [internalValue, setInternalValue] =
|
|
3455
|
+
const [internalValue, setInternalValue] = React36.useState(
|
|
3449
3456
|
defaultValue
|
|
3450
3457
|
);
|
|
3451
3458
|
const resolvedValue = isControlled ? value : internalValue;
|
|
@@ -3458,7 +3465,7 @@ function AdsSelect({
|
|
|
3458
3465
|
id
|
|
3459
3466
|
});
|
|
3460
3467
|
const resolvedClearButtonLabel = clearButtonLabel ?? messages.select.clear;
|
|
3461
|
-
const handleValueChange =
|
|
3468
|
+
const handleValueChange = React36.useCallback(
|
|
3462
3469
|
(nextValue) => {
|
|
3463
3470
|
if (!isControlled) {
|
|
3464
3471
|
setInternalValue(nextValue);
|
|
@@ -3467,7 +3474,7 @@ function AdsSelect({
|
|
|
3467
3474
|
},
|
|
3468
3475
|
[isControlled, onValueChange]
|
|
3469
3476
|
);
|
|
3470
|
-
const handleClear =
|
|
3477
|
+
const handleClear = React36.useCallback(
|
|
3471
3478
|
(event) => {
|
|
3472
3479
|
event.preventDefault();
|
|
3473
3480
|
event.stopPropagation();
|
|
@@ -3479,12 +3486,12 @@ function AdsSelect({
|
|
|
3479
3486
|
},
|
|
3480
3487
|
[isControlled, onClear, onValueChange]
|
|
3481
3488
|
);
|
|
3482
|
-
const helperNode = helperText ? /* @__PURE__ */ (0,
|
|
3483
|
-
const errorNode = errorText ? /* @__PURE__ */ (0,
|
|
3484
|
-
return /* @__PURE__ */ (0,
|
|
3485
|
-
label ? /* @__PURE__ */ (0,
|
|
3489
|
+
const helperNode = helperText ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(AdsFieldDescription, { id: description.helperId, children: helperText }) : null;
|
|
3490
|
+
const errorNode = errorText ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(AdsFieldError, { id: description.errorId, children: errorText }) : null;
|
|
3491
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(AdsFieldItem, { children: [
|
|
3492
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(AdsFieldLabel, { htmlFor: description.inputId, children: label }) : null,
|
|
3486
3493
|
descriptionPlacement === "above" ? helperNode : null,
|
|
3487
|
-
/* @__PURE__ */ (0,
|
|
3494
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
3488
3495
|
Select,
|
|
3489
3496
|
{
|
|
3490
3497
|
...props,
|
|
@@ -3492,8 +3499,8 @@ function AdsSelect({
|
|
|
3492
3499
|
onValueChange: handleValueChange,
|
|
3493
3500
|
...resolvedValue !== void 0 ? { value: resolvedValue } : {},
|
|
3494
3501
|
children: [
|
|
3495
|
-
/* @__PURE__ */ (0,
|
|
3496
|
-
/* @__PURE__ */ (0,
|
|
3502
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "relative", children: [
|
|
3503
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3497
3504
|
SelectTrigger,
|
|
3498
3505
|
{
|
|
3499
3506
|
"aria-describedby": description.describedBy,
|
|
@@ -3505,25 +3512,19 @@ function AdsSelect({
|
|
|
3505
3512
|
triggerClassName
|
|
3506
3513
|
),
|
|
3507
3514
|
id: description.inputId,
|
|
3508
|
-
children: /* @__PURE__ */ (0,
|
|
3515
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(SelectValue, { placeholder })
|
|
3509
3516
|
}
|
|
3510
3517
|
),
|
|
3511
|
-
canClear ? /* @__PURE__ */ (0,
|
|
3512
|
-
|
|
3518
|
+
canClear ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3519
|
+
AdsClearButton,
|
|
3513
3520
|
{
|
|
3514
3521
|
"aria-label": resolvedClearButtonLabel,
|
|
3515
|
-
className:
|
|
3516
|
-
|
|
3517
|
-
"hover:text-[var(--card-foreground)]"
|
|
3518
|
-
),
|
|
3519
|
-
onClick: handleClear,
|
|
3520
|
-
type: "button",
|
|
3521
|
-
variant: "ghost",
|
|
3522
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react14.X, { "aria-hidden": true, className: "h-3.5 w-3.5" })
|
|
3522
|
+
className: "absolute right-8 top-1/2 -translate-y-1/2",
|
|
3523
|
+
onClick: handleClear
|
|
3523
3524
|
}
|
|
3524
3525
|
) : null
|
|
3525
3526
|
] }),
|
|
3526
|
-
/* @__PURE__ */ (0,
|
|
3527
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3527
3528
|
SelectContent,
|
|
3528
3529
|
{
|
|
3529
3530
|
className: cn(selectContentBaseClassName, contentClassName3),
|
|
@@ -3540,7 +3541,7 @@ function AdsSelect({
|
|
|
3540
3541
|
}
|
|
3541
3542
|
|
|
3542
3543
|
// src/components/AdsDataPagination/index.tsx
|
|
3543
|
-
var
|
|
3544
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
3544
3545
|
var paginationButtonBaseClassName = "inline-flex h-9 min-w-9 items-center justify-center rounded-radius-md border text-sm font-medium leading-5 tracking-normal transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50";
|
|
3545
3546
|
var paginationButtonInactiveClassName = "border-transparent bg-transparent px-[10px] text-foreground shadow-none hover:bg-accent hover:shadow-[0px_1px_2px_rgba(0,0,0,0.1)]";
|
|
3546
3547
|
var paginationButtonActiveClassName = "border-border bg-card px-[10px] text-foreground shadow-[0px_1px_2px_rgba(0,0,0,0.1)]";
|
|
@@ -3616,9 +3617,9 @@ function AdsDataPagination({
|
|
|
3616
3617
|
ariaLabel
|
|
3617
3618
|
}) {
|
|
3618
3619
|
const { messages } = useAdsI18n();
|
|
3619
|
-
const [internalCurrent, setInternalCurrent] =
|
|
3620
|
-
const [internalPageSize, setInternalPageSize] =
|
|
3621
|
-
const [quickJumpValue, setQuickJumpValue] =
|
|
3620
|
+
const [internalCurrent, setInternalCurrent] = React37.useState(defaultCurrent);
|
|
3621
|
+
const [internalPageSize, setInternalPageSize] = React37.useState(defaultPageSize);
|
|
3622
|
+
const [quickJumpValue, setQuickJumpValue] = React37.useState("");
|
|
3622
3623
|
const isCurrentControlled = current !== void 0;
|
|
3623
3624
|
const isPageSizeControlled = pageSize !== void 0;
|
|
3624
3625
|
const mergedPageSize = Math.max(1, isPageSizeControlled ? pageSize : internalPageSize);
|
|
@@ -3639,20 +3640,20 @@ function AdsDataPagination({
|
|
|
3639
3640
|
new Set(pageSizeOptions.filter((option) => Number.isFinite(option) && option > 0))
|
|
3640
3641
|
);
|
|
3641
3642
|
const resolvedPageSizeOptions = pageSizeValues.length > 0 ? pageSizeValues : [10, 20, 50, 100];
|
|
3642
|
-
|
|
3643
|
+
React37.useEffect(() => {
|
|
3643
3644
|
if (!isCurrentControlled && internalCurrent !== mergedCurrent) {
|
|
3644
3645
|
setInternalCurrent(mergedCurrent);
|
|
3645
3646
|
}
|
|
3646
3647
|
}, [internalCurrent, isCurrentControlled, mergedCurrent]);
|
|
3647
|
-
|
|
3648
|
+
React37.useEffect(() => {
|
|
3648
3649
|
if (!isPageSizeControlled && internalPageSize !== mergedPageSize) {
|
|
3649
3650
|
setInternalPageSize(mergedPageSize);
|
|
3650
3651
|
}
|
|
3651
3652
|
}, [internalPageSize, isPageSizeControlled, mergedPageSize]);
|
|
3652
|
-
|
|
3653
|
+
React37.useEffect(() => {
|
|
3653
3654
|
setQuickJumpValue(String(mergedCurrent));
|
|
3654
3655
|
}, [mergedCurrent]);
|
|
3655
|
-
const commitPageChange =
|
|
3656
|
+
const commitPageChange = React37.useCallback(
|
|
3656
3657
|
(nextPage, nextPageSize = mergedPageSize) => {
|
|
3657
3658
|
const clampedPage = clampPage(nextPage, Math.max(1, Math.ceil(Math.max(total, 0) / nextPageSize)));
|
|
3658
3659
|
if (!isCurrentControlled) {
|
|
@@ -3666,7 +3667,7 @@ function AdsDataPagination({
|
|
|
3666
3667
|
},
|
|
3667
3668
|
[isCurrentControlled, mergedCurrent, mergedPageSize, onChange, total]
|
|
3668
3669
|
);
|
|
3669
|
-
const handlePageSizeChange =
|
|
3670
|
+
const handlePageSizeChange = React37.useCallback(
|
|
3670
3671
|
(nextValue) => {
|
|
3671
3672
|
const nextPageSize = Number(nextValue);
|
|
3672
3673
|
if (!Number.isFinite(nextPageSize) || nextPageSize <= 0 || nextPageSize === mergedPageSize) {
|
|
@@ -3691,7 +3692,7 @@ function AdsDataPagination({
|
|
|
3691
3692
|
total
|
|
3692
3693
|
]
|
|
3693
3694
|
);
|
|
3694
|
-
const handleQuickJumpSubmit =
|
|
3695
|
+
const handleQuickJumpSubmit = React37.useCallback(() => {
|
|
3695
3696
|
const trimmedValue = quickJumpValue.trim();
|
|
3696
3697
|
if (!trimmedValue) {
|
|
3697
3698
|
setQuickJumpValue(String(mergedCurrent));
|
|
@@ -3725,8 +3726,8 @@ function AdsDataPagination({
|
|
|
3725
3726
|
);
|
|
3726
3727
|
const renderPageNavigation = () => {
|
|
3727
3728
|
if (variant === "compact") {
|
|
3728
|
-
return /* @__PURE__ */ (0,
|
|
3729
|
-
shouldShowFirstLast ? /* @__PURE__ */ (0,
|
|
3729
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex flex-wrap items-center gap-sm", children: [
|
|
3730
|
+
shouldShowFirstLast ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3730
3731
|
Button,
|
|
3731
3732
|
{
|
|
3732
3733
|
"aria-label": messages.pagination.first,
|
|
@@ -3739,7 +3740,7 @@ function AdsDataPagination({
|
|
|
3739
3740
|
children: messages.pagination.first
|
|
3740
3741
|
}
|
|
3741
3742
|
) : null,
|
|
3742
|
-
/* @__PURE__ */ (0,
|
|
3743
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3743
3744
|
Button,
|
|
3744
3745
|
{
|
|
3745
3746
|
"aria-label": messages.pagination.previous,
|
|
@@ -3752,7 +3753,7 @@ function AdsDataPagination({
|
|
|
3752
3753
|
children: messages.pagination.previous
|
|
3753
3754
|
}
|
|
3754
3755
|
),
|
|
3755
|
-
/* @__PURE__ */ (0,
|
|
3756
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3756
3757
|
"span",
|
|
3757
3758
|
{
|
|
3758
3759
|
"aria-current": "page",
|
|
@@ -3760,7 +3761,7 @@ function AdsDataPagination({
|
|
|
3760
3761
|
children: pageStatus
|
|
3761
3762
|
}
|
|
3762
3763
|
),
|
|
3763
|
-
/* @__PURE__ */ (0,
|
|
3764
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3764
3765
|
Button,
|
|
3765
3766
|
{
|
|
3766
3767
|
"aria-label": messages.pagination.next,
|
|
@@ -3773,7 +3774,7 @@ function AdsDataPagination({
|
|
|
3773
3774
|
children: messages.pagination.next
|
|
3774
3775
|
}
|
|
3775
3776
|
),
|
|
3776
|
-
shouldShowFirstLast ? /* @__PURE__ */ (0,
|
|
3777
|
+
shouldShowFirstLast ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3777
3778
|
Button,
|
|
3778
3779
|
{
|
|
3779
3780
|
"aria-label": messages.pagination.last,
|
|
@@ -3788,8 +3789,8 @@ function AdsDataPagination({
|
|
|
3788
3789
|
) : null
|
|
3789
3790
|
] });
|
|
3790
3791
|
}
|
|
3791
|
-
return /* @__PURE__ */ (0,
|
|
3792
|
-
shouldShowFirstLast ? /* @__PURE__ */ (0,
|
|
3792
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(AdsPagination, { "aria-label": navigationLabel, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(AdsPaginationContent, { children: [
|
|
3793
|
+
shouldShowFirstLast ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(AdsPaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3793
3794
|
Button,
|
|
3794
3795
|
{
|
|
3795
3796
|
"aria-label": messages.pagination.first,
|
|
@@ -3802,7 +3803,7 @@ function AdsDataPagination({
|
|
|
3802
3803
|
children: messages.pagination.first
|
|
3803
3804
|
}
|
|
3804
3805
|
) }) : null,
|
|
3805
|
-
/* @__PURE__ */ (0,
|
|
3806
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(AdsPaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3806
3807
|
Button,
|
|
3807
3808
|
{
|
|
3808
3809
|
"aria-label": messages.pagination.previous,
|
|
@@ -3816,7 +3817,7 @@ function AdsDataPagination({
|
|
|
3816
3817
|
}
|
|
3817
3818
|
) }),
|
|
3818
3819
|
paginationRange.map(
|
|
3819
|
-
(token, index) => token === "ellipsis" ? /* @__PURE__ */ (0,
|
|
3820
|
+
(token, index) => token === "ellipsis" ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(AdsPaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(AdsPaginationEllipsis, { label: messages.pagination.morePages }) }, `ellipsis-${index}`) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(AdsPaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3820
3821
|
Button,
|
|
3821
3822
|
{
|
|
3822
3823
|
"aria-current": token === mergedCurrent ? "page" : void 0,
|
|
@@ -3833,7 +3834,7 @@ function AdsDataPagination({
|
|
|
3833
3834
|
}
|
|
3834
3835
|
) }, token)
|
|
3835
3836
|
),
|
|
3836
|
-
/* @__PURE__ */ (0,
|
|
3837
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(AdsPaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3837
3838
|
Button,
|
|
3838
3839
|
{
|
|
3839
3840
|
"aria-label": messages.pagination.next,
|
|
@@ -3846,7 +3847,7 @@ function AdsDataPagination({
|
|
|
3846
3847
|
children: messages.pagination.next
|
|
3847
3848
|
}
|
|
3848
3849
|
) }),
|
|
3849
|
-
shouldShowFirstLast ? /* @__PURE__ */ (0,
|
|
3850
|
+
shouldShowFirstLast ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(AdsPaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3850
3851
|
Button,
|
|
3851
3852
|
{
|
|
3852
3853
|
"aria-label": messages.pagination.last,
|
|
@@ -3861,7 +3862,7 @@ function AdsDataPagination({
|
|
|
3861
3862
|
) }) : null
|
|
3862
3863
|
] }) });
|
|
3863
3864
|
};
|
|
3864
|
-
return /* @__PURE__ */ (0,
|
|
3865
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3865
3866
|
"div",
|
|
3866
3867
|
{
|
|
3867
3868
|
"data-slot": "ads-data-pagination",
|
|
@@ -3871,34 +3872,34 @@ function AdsDataPagination({
|
|
|
3871
3872
|
className
|
|
3872
3873
|
),
|
|
3873
3874
|
children: [
|
|
3874
|
-
/* @__PURE__ */ (0,
|
|
3875
|
-
variant === "compact" ? /* @__PURE__ */ (0,
|
|
3876
|
-
showSizeChanger ? /* @__PURE__ */ (0,
|
|
3877
|
-
/* @__PURE__ */ (0,
|
|
3878
|
-
/* @__PURE__ */ (0,
|
|
3875
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex flex-wrap items-center gap-md text-sm leading-5 text-muted-foreground", children: [
|
|
3876
|
+
variant === "compact" ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: classNames?.total, children: compactTotalContent }) : totalContent ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: classNames?.total, children: totalContent }) : null,
|
|
3877
|
+
showSizeChanger ? /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: cn("flex items-center gap-sm", classNames?.pageSizeChanger), children: [
|
|
3878
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { children: messages.pagination.itemsPerPage }),
|
|
3879
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3879
3880
|
Select,
|
|
3880
3881
|
{
|
|
3881
3882
|
disabled,
|
|
3882
3883
|
onValueChange: handlePageSizeChange,
|
|
3883
3884
|
value: String(mergedPageSize),
|
|
3884
3885
|
children: [
|
|
3885
|
-
/* @__PURE__ */ (0,
|
|
3886
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3886
3887
|
SelectTrigger,
|
|
3887
3888
|
{
|
|
3888
3889
|
"aria-label": messages.pagination.itemsPerPage,
|
|
3889
3890
|
className: cn(inlineControlClassName, "w-[132px] px-sm"),
|
|
3890
|
-
children: /* @__PURE__ */ (0,
|
|
3891
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(SelectValue, {})
|
|
3891
3892
|
}
|
|
3892
3893
|
),
|
|
3893
|
-
/* @__PURE__ */ (0,
|
|
3894
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(SelectContent, { children: resolvedPageSizeOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(SelectItem, { value: String(option), children: interpolate(messages.pagination.itemsPerPageOption, { value: option }) }, option)) })
|
|
3894
3895
|
]
|
|
3895
3896
|
}
|
|
3896
3897
|
)
|
|
3897
3898
|
] }) : null
|
|
3898
3899
|
] }),
|
|
3899
|
-
/* @__PURE__ */ (0,
|
|
3900
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex flex-col gap-md sm:flex-row sm:items-center sm:justify-end", children: [
|
|
3900
3901
|
renderPageNavigation(),
|
|
3901
|
-
showQuickJumper ? /* @__PURE__ */ (0,
|
|
3902
|
+
showQuickJumper ? /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3902
3903
|
"label",
|
|
3903
3904
|
{
|
|
3904
3905
|
className: cn(
|
|
@@ -3906,8 +3907,8 @@ function AdsDataPagination({
|
|
|
3906
3907
|
classNames?.quickJumper
|
|
3907
3908
|
),
|
|
3908
3909
|
children: [
|
|
3909
|
-
/* @__PURE__ */ (0,
|
|
3910
|
-
/* @__PURE__ */ (0,
|
|
3910
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { children: messages.pagination.jumpTo }),
|
|
3911
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3911
3912
|
Input,
|
|
3912
3913
|
{
|
|
3913
3914
|
"aria-label": messages.pagination.jumpTo,
|
|
@@ -3935,12 +3936,12 @@ function AdsDataPagination({
|
|
|
3935
3936
|
}
|
|
3936
3937
|
|
|
3937
3938
|
// src/components/AdsDataTable/index.tsx
|
|
3938
|
-
var
|
|
3939
|
-
var
|
|
3939
|
+
var React42 = __toESM(require("react"), 1);
|
|
3940
|
+
var import_lucide_react15 = require("lucide-react");
|
|
3940
3941
|
|
|
3941
3942
|
// src/components/AdsEmpty/index.tsx
|
|
3942
3943
|
var import_class_variance_authority9 = require("class-variance-authority");
|
|
3943
|
-
var
|
|
3944
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
3944
3945
|
var adsEmptyVariants = (0, import_class_variance_authority9.cva)(
|
|
3945
3946
|
"flex w-full flex-col items-center justify-center gap-6 p-12 text-center",
|
|
3946
3947
|
{
|
|
@@ -3957,7 +3958,7 @@ var adsEmptyVariants = (0, import_class_variance_authority9.cva)(
|
|
|
3957
3958
|
}
|
|
3958
3959
|
);
|
|
3959
3960
|
function AdsEmpty({ className, variant, ...props }) {
|
|
3960
|
-
return /* @__PURE__ */ (0,
|
|
3961
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3961
3962
|
"div",
|
|
3962
3963
|
{
|
|
3963
3964
|
"data-slot": "ads-empty",
|
|
@@ -3967,7 +3968,7 @@ function AdsEmpty({ className, variant, ...props }) {
|
|
|
3967
3968
|
);
|
|
3968
3969
|
}
|
|
3969
3970
|
function AdsEmptyHeader({ className, ...props }) {
|
|
3970
|
-
return /* @__PURE__ */ (0,
|
|
3971
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3971
3972
|
"div",
|
|
3972
3973
|
{
|
|
3973
3974
|
"data-slot": "ads-empty-header",
|
|
@@ -3977,7 +3978,7 @@ function AdsEmptyHeader({ className, ...props }) {
|
|
|
3977
3978
|
);
|
|
3978
3979
|
}
|
|
3979
3980
|
function AdsEmptyMedia({ className, ...props }) {
|
|
3980
|
-
return /* @__PURE__ */ (0,
|
|
3981
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3981
3982
|
"div",
|
|
3982
3983
|
{
|
|
3983
3984
|
"data-slot": "ads-empty-media",
|
|
@@ -3991,7 +3992,7 @@ function AdsEmptyMedia({ className, ...props }) {
|
|
|
3991
3992
|
);
|
|
3992
3993
|
}
|
|
3993
3994
|
function AdsEmptyTitle({ className, ...props }) {
|
|
3994
|
-
return /* @__PURE__ */ (0,
|
|
3995
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3995
3996
|
"div",
|
|
3996
3997
|
{
|
|
3997
3998
|
"data-slot": "ads-empty-title",
|
|
@@ -4001,7 +4002,7 @@ function AdsEmptyTitle({ className, ...props }) {
|
|
|
4001
4002
|
);
|
|
4002
4003
|
}
|
|
4003
4004
|
function AdsEmptyDescription({ className, ...props }) {
|
|
4004
|
-
return /* @__PURE__ */ (0,
|
|
4005
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4005
4006
|
"p",
|
|
4006
4007
|
{
|
|
4007
4008
|
"data-slot": "ads-empty-description",
|
|
@@ -4011,7 +4012,7 @@ function AdsEmptyDescription({ className, ...props }) {
|
|
|
4011
4012
|
);
|
|
4012
4013
|
}
|
|
4013
4014
|
function AdsEmptyContent({ className, ...props }) {
|
|
4014
|
-
return /* @__PURE__ */ (0,
|
|
4015
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4015
4016
|
"div",
|
|
4016
4017
|
{
|
|
4017
4018
|
"data-slot": "ads-empty-content",
|
|
@@ -4021,7 +4022,7 @@ function AdsEmptyContent({ className, ...props }) {
|
|
|
4021
4022
|
);
|
|
4022
4023
|
}
|
|
4023
4024
|
function AdsEmptyActions({ className, ...props }) {
|
|
4024
|
-
return /* @__PURE__ */ (0,
|
|
4025
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4025
4026
|
"div",
|
|
4026
4027
|
{
|
|
4027
4028
|
"data-slot": "ads-empty-actions",
|
|
@@ -4031,7 +4032,7 @@ function AdsEmptyActions({ className, ...props }) {
|
|
|
4031
4032
|
);
|
|
4032
4033
|
}
|
|
4033
4034
|
function AdsEmptyFooter({ className, ...props }) {
|
|
4034
|
-
return /* @__PURE__ */ (0,
|
|
4035
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4035
4036
|
"div",
|
|
4036
4037
|
{
|
|
4037
4038
|
"data-slot": "ads-empty-footer",
|
|
@@ -4042,19 +4043,19 @@ function AdsEmptyFooter({ className, ...props }) {
|
|
|
4042
4043
|
}
|
|
4043
4044
|
|
|
4044
4045
|
// src/components/AdsTable/index.tsx
|
|
4045
|
-
var
|
|
4046
|
-
var
|
|
4046
|
+
var React41 = __toESM(require("react"), 1);
|
|
4047
|
+
var import_lucide_react14 = require("lucide-react");
|
|
4047
4048
|
|
|
4048
4049
|
// src/components/AdsRadioGroup/index.tsx
|
|
4049
|
-
var
|
|
4050
|
+
var React39 = __toESM(require("react"), 1);
|
|
4050
4051
|
|
|
4051
4052
|
// src/primitives/radio-group.tsx
|
|
4052
|
-
var
|
|
4053
|
+
var React38 = __toESM(require("react"), 1);
|
|
4053
4054
|
var RadioGroupPrimitive = __toESM(require("@radix-ui/react-radio-group"), 1);
|
|
4054
|
-
var
|
|
4055
|
-
var
|
|
4056
|
-
var RadioGroup =
|
|
4057
|
-
return /* @__PURE__ */ (0,
|
|
4055
|
+
var import_lucide_react13 = require("lucide-react");
|
|
4056
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
4057
|
+
var RadioGroup = React38.forwardRef(({ className, ...props }, ref) => {
|
|
4058
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4058
4059
|
RadioGroupPrimitive.Root,
|
|
4059
4060
|
{
|
|
4060
4061
|
className: cn("grid gap-2", className),
|
|
@@ -4064,8 +4065,8 @@ var RadioGroup = React37.forwardRef(({ className, ...props }, ref) => {
|
|
|
4064
4065
|
);
|
|
4065
4066
|
});
|
|
4066
4067
|
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
|
|
4067
|
-
var RadioGroupItem =
|
|
4068
|
-
return /* @__PURE__ */ (0,
|
|
4068
|
+
var RadioGroupItem = React38.forwardRef(({ className, ...props }, ref) => {
|
|
4069
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4069
4070
|
RadioGroupPrimitive.Item,
|
|
4070
4071
|
{
|
|
4071
4072
|
ref,
|
|
@@ -4074,19 +4075,19 @@ var RadioGroupItem = React37.forwardRef(({ className, ...props }, ref) => {
|
|
|
4074
4075
|
className
|
|
4075
4076
|
),
|
|
4076
4077
|
...props,
|
|
4077
|
-
children: /* @__PURE__ */ (0,
|
|
4078
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(RadioGroupPrimitive.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react13.Circle, { className: "h-2.5 w-2.5 fill-current text-current" }) })
|
|
4078
4079
|
}
|
|
4079
4080
|
);
|
|
4080
4081
|
});
|
|
4081
4082
|
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
4082
4083
|
|
|
4083
4084
|
// src/components/AdsRadioGroup/index.tsx
|
|
4084
|
-
var
|
|
4085
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
4085
4086
|
var radioGroupBaseClassName = "gap-3";
|
|
4086
4087
|
var radioItemBaseClassName = "h-4 w-4 border-border bg-card text-primary shadow-[0px_1px_2px_rgba(0,0,0,0.1)] focus-visible:ring-[3px] focus-visible:ring-[rgba(161,161,161,0.5)] focus-visible:ring-offset-0";
|
|
4087
|
-
var RadioGroup2 =
|
|
4088
|
+
var RadioGroup2 = React39.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(RadioGroup, { className: cn(radioGroupBaseClassName, className), ref, ...props }));
|
|
4088
4089
|
RadioGroup2.displayName = "RadioGroup";
|
|
4089
|
-
var RadioGroupItem2 =
|
|
4090
|
+
var RadioGroupItem2 = React39.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4090
4091
|
RadioGroupItem,
|
|
4091
4092
|
{
|
|
4092
4093
|
className: cn(radioItemBaseClassName, className),
|
|
@@ -4095,7 +4096,7 @@ var RadioGroupItem2 = React38.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
4095
4096
|
}
|
|
4096
4097
|
));
|
|
4097
4098
|
RadioGroupItem2.displayName = "RadioGroupItem";
|
|
4098
|
-
var AdsRadioGroup =
|
|
4099
|
+
var AdsRadioGroup = React39.forwardRef(
|
|
4099
4100
|
({
|
|
4100
4101
|
children,
|
|
4101
4102
|
className,
|
|
@@ -4111,12 +4112,12 @@ var AdsRadioGroup = React38.forwardRef(
|
|
|
4111
4112
|
helperText,
|
|
4112
4113
|
id
|
|
4113
4114
|
});
|
|
4114
|
-
const helperNode = helperText ? /* @__PURE__ */ (0,
|
|
4115
|
-
const errorNode = errorText ? /* @__PURE__ */ (0,
|
|
4116
|
-
return /* @__PURE__ */ (0,
|
|
4117
|
-
label ? /* @__PURE__ */ (0,
|
|
4115
|
+
const helperNode = helperText ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(AdsFieldDescription, { id: description.helperId, children: helperText }) : null;
|
|
4116
|
+
const errorNode = errorText ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(AdsFieldError, { id: description.errorId, children: errorText }) : null;
|
|
4117
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(AdsFieldItem, { children: [
|
|
4118
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(AdsFieldLabel, { children: label }) : null,
|
|
4118
4119
|
descriptionPlacement === "above" ? helperNode : null,
|
|
4119
|
-
/* @__PURE__ */ (0,
|
|
4120
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4120
4121
|
RadioGroup2,
|
|
4121
4122
|
{
|
|
4122
4123
|
"aria-describedby": description.describedBy,
|
|
@@ -4132,11 +4133,11 @@ var AdsRadioGroup = React38.forwardRef(
|
|
|
4132
4133
|
}
|
|
4133
4134
|
);
|
|
4134
4135
|
AdsRadioGroup.displayName = "AdsRadioGroup";
|
|
4135
|
-
var AdsRadioGroupOption =
|
|
4136
|
-
const generatedId =
|
|
4136
|
+
var AdsRadioGroupOption = React39.forwardRef(({ className, description, id, label, value, ...props }, ref) => {
|
|
4137
|
+
const generatedId = React39.useId();
|
|
4137
4138
|
const inputId = id ?? generatedId;
|
|
4138
|
-
return /* @__PURE__ */ (0,
|
|
4139
|
-
/* @__PURE__ */ (0,
|
|
4139
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("label", { className: "flex w-full cursor-pointer items-start gap-2", htmlFor: inputId, children: [
|
|
4140
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4140
4141
|
RadioGroupItem2,
|
|
4141
4142
|
{
|
|
4142
4143
|
className: cn(className),
|
|
@@ -4146,20 +4147,20 @@ var AdsRadioGroupOption = React38.forwardRef(({ className, description, id, labe
|
|
|
4146
4147
|
...props
|
|
4147
4148
|
}
|
|
4148
4149
|
),
|
|
4149
|
-
/* @__PURE__ */ (0,
|
|
4150
|
-
/* @__PURE__ */ (0,
|
|
4151
|
-
description ? /* @__PURE__ */ (0,
|
|
4150
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-1.5", children: [
|
|
4151
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "text-sm leading-5 text-foreground", children: label }),
|
|
4152
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(AdsFieldDescription, { className: "text-sm leading-5", children: description }) : null
|
|
4152
4153
|
] })
|
|
4153
4154
|
] });
|
|
4154
4155
|
});
|
|
4155
4156
|
AdsRadioGroupOption.displayName = "AdsRadioGroupOption";
|
|
4156
|
-
var AdsRadioGroupCardOption =
|
|
4157
|
-
const generatedId =
|
|
4157
|
+
var AdsRadioGroupCardOption = React39.forwardRef(({ className, description, disabled, id, label, value, ...props }, ref) => {
|
|
4158
|
+
const generatedId = React39.useId();
|
|
4158
4159
|
const inputId = id ?? generatedId;
|
|
4159
4160
|
const titleId = `${inputId}-label`;
|
|
4160
4161
|
const descriptionId = description ? `${inputId}-description` : void 0;
|
|
4161
|
-
return /* @__PURE__ */ (0,
|
|
4162
|
-
/* @__PURE__ */ (0,
|
|
4162
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "relative", children: [
|
|
4163
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4163
4164
|
RadioGroupItem2,
|
|
4164
4165
|
{
|
|
4165
4166
|
"aria-describedby": descriptionId,
|
|
@@ -4172,7 +4173,7 @@ var AdsRadioGroupCardOption = React38.forwardRef(({ className, description, disa
|
|
|
4172
4173
|
...props
|
|
4173
4174
|
}
|
|
4174
4175
|
),
|
|
4175
|
-
/* @__PURE__ */ (0,
|
|
4176
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
4176
4177
|
"div",
|
|
4177
4178
|
{
|
|
4178
4179
|
className: cn(
|
|
@@ -4181,16 +4182,16 @@ var AdsRadioGroupCardOption = React38.forwardRef(({ className, description, disa
|
|
|
4181
4182
|
className
|
|
4182
4183
|
),
|
|
4183
4184
|
children: [
|
|
4184
|
-
/* @__PURE__ */ (0,
|
|
4185
|
-
/* @__PURE__ */ (0,
|
|
4186
|
-
description ? /* @__PURE__ */ (0,
|
|
4185
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-1.5", children: [
|
|
4186
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "text-sm font-medium leading-5 text-foreground", id: titleId, children: label }),
|
|
4187
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(AdsFieldDescription, { className: "text-xs leading-4", id: descriptionId, children: description }) : null
|
|
4187
4188
|
] }),
|
|
4188
|
-
/* @__PURE__ */ (0,
|
|
4189
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "flex h-full shrink-0 items-start justify-center pt-px", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4189
4190
|
"div",
|
|
4190
4191
|
{
|
|
4191
4192
|
className: "grid h-4 w-4 place-content-center rounded-full border bg-card shadow-[0px_1px_2px_rgba(0,0,0,0.1)]",
|
|
4192
4193
|
"data-indicator": true,
|
|
4193
|
-
children: /* @__PURE__ */ (0,
|
|
4194
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4194
4195
|
"span",
|
|
4195
4196
|
{
|
|
4196
4197
|
className: "h-2 w-2 rounded-full bg-primary transition-opacity",
|
|
@@ -4207,9 +4208,9 @@ var AdsRadioGroupCardOption = React38.forwardRef(({ className, description, disa
|
|
|
4207
4208
|
AdsRadioGroupCardOption.displayName = "AdsRadioGroupCardOption";
|
|
4208
4209
|
|
|
4209
4210
|
// src/primitives/table.tsx
|
|
4210
|
-
var
|
|
4211
|
-
var
|
|
4212
|
-
var Table =
|
|
4211
|
+
var React40 = __toESM(require("react"), 1);
|
|
4212
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
4213
|
+
var Table = React40.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4213
4214
|
"table",
|
|
4214
4215
|
{
|
|
4215
4216
|
ref,
|
|
@@ -4218,7 +4219,7 @@ var Table = React39.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
4218
4219
|
}
|
|
4219
4220
|
));
|
|
4220
4221
|
Table.displayName = "Table";
|
|
4221
|
-
var TableScrollArea =
|
|
4222
|
+
var TableScrollArea = React40.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4222
4223
|
"div",
|
|
4223
4224
|
{
|
|
4224
4225
|
ref,
|
|
@@ -4227,9 +4228,9 @@ var TableScrollArea = React39.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
4227
4228
|
}
|
|
4228
4229
|
));
|
|
4229
4230
|
TableScrollArea.displayName = "TableScrollArea";
|
|
4230
|
-
var TableHeader =
|
|
4231
|
+
var TableHeader = React40.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
|
|
4231
4232
|
TableHeader.displayName = "TableHeader";
|
|
4232
|
-
var TableBody =
|
|
4233
|
+
var TableBody = React40.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4233
4234
|
"tbody",
|
|
4234
4235
|
{
|
|
4235
4236
|
ref,
|
|
@@ -4238,7 +4239,7 @@ var TableBody = React39.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
4238
4239
|
}
|
|
4239
4240
|
));
|
|
4240
4241
|
TableBody.displayName = "TableBody";
|
|
4241
|
-
var TableFooter =
|
|
4242
|
+
var TableFooter = React40.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4242
4243
|
"tfoot",
|
|
4243
4244
|
{
|
|
4244
4245
|
ref,
|
|
@@ -4250,7 +4251,7 @@ var TableFooter = React39.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
4250
4251
|
}
|
|
4251
4252
|
));
|
|
4252
4253
|
TableFooter.displayName = "TableFooter";
|
|
4253
|
-
var TableRow =
|
|
4254
|
+
var TableRow = React40.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4254
4255
|
"tr",
|
|
4255
4256
|
{
|
|
4256
4257
|
ref,
|
|
@@ -4262,7 +4263,7 @@ var TableRow = React39.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
4262
4263
|
}
|
|
4263
4264
|
));
|
|
4264
4265
|
TableRow.displayName = "TableRow";
|
|
4265
|
-
var TableHead =
|
|
4266
|
+
var TableHead = React40.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4266
4267
|
"th",
|
|
4267
4268
|
{
|
|
4268
4269
|
ref,
|
|
@@ -4274,7 +4275,7 @@ var TableHead = React39.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
4274
4275
|
}
|
|
4275
4276
|
));
|
|
4276
4277
|
TableHead.displayName = "TableHead";
|
|
4277
|
-
var TableCell =
|
|
4278
|
+
var TableCell = React40.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4278
4279
|
"td",
|
|
4279
4280
|
{
|
|
4280
4281
|
ref,
|
|
@@ -4283,7 +4284,7 @@ var TableCell = React39.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
4283
4284
|
}
|
|
4284
4285
|
));
|
|
4285
4286
|
TableCell.displayName = "TableCell";
|
|
4286
|
-
var TableCaption =
|
|
4287
|
+
var TableCaption = React40.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4287
4288
|
"caption",
|
|
4288
4289
|
{
|
|
4289
4290
|
ref,
|
|
@@ -4292,21 +4293,21 @@ var TableCaption = React39.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
4292
4293
|
}
|
|
4293
4294
|
));
|
|
4294
4295
|
TableCaption.displayName = "TableCaption";
|
|
4295
|
-
var TableColGroup =
|
|
4296
|
+
var TableColGroup = React40.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("colgroup", { ref, className: cn(className), ...props }));
|
|
4296
4297
|
TableColGroup.displayName = "TableColGroup";
|
|
4297
|
-
var TableCol =
|
|
4298
|
+
var TableCol = React40.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("col", { ref, className: cn(className), ...props }));
|
|
4298
4299
|
TableCol.displayName = "TableCol";
|
|
4299
4300
|
|
|
4300
4301
|
// src/components/AdsTable/index.tsx
|
|
4301
|
-
var
|
|
4302
|
-
var AdsTableStickyHeaderContext =
|
|
4302
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
4303
|
+
var AdsTableStickyHeaderContext = React41.createContext(false);
|
|
4303
4304
|
function resolveLength(value) {
|
|
4304
4305
|
if (value === void 0) {
|
|
4305
4306
|
return void 0;
|
|
4306
4307
|
}
|
|
4307
4308
|
return typeof value === "number" ? `${value}px` : value;
|
|
4308
4309
|
}
|
|
4309
|
-
var AdsTableSurface =
|
|
4310
|
+
var AdsTableSurface = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4310
4311
|
"div",
|
|
4311
4312
|
{
|
|
4312
4313
|
ref,
|
|
@@ -4318,8 +4319,8 @@ var AdsTableSurface = React40.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
4318
4319
|
}
|
|
4319
4320
|
));
|
|
4320
4321
|
AdsTableSurface.displayName = "AdsTableSurface";
|
|
4321
|
-
var AdsTableRoot =
|
|
4322
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
4322
|
+
var AdsTableRoot = React41.forwardRef(
|
|
4323
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4323
4324
|
Table,
|
|
4324
4325
|
{
|
|
4325
4326
|
ref,
|
|
@@ -4334,7 +4335,7 @@ var AdsTableRoot = React40.forwardRef(
|
|
|
4334
4335
|
)
|
|
4335
4336
|
);
|
|
4336
4337
|
AdsTableRoot.displayName = "AdsTableRoot";
|
|
4337
|
-
var AdsTableScrollArea =
|
|
4338
|
+
var AdsTableScrollArea = React41.forwardRef(
|
|
4338
4339
|
({
|
|
4339
4340
|
children,
|
|
4340
4341
|
className,
|
|
@@ -4344,7 +4345,7 @@ var AdsTableScrollArea = React40.forwardRef(
|
|
|
4344
4345
|
x,
|
|
4345
4346
|
y,
|
|
4346
4347
|
...props
|
|
4347
|
-
}, ref) => /* @__PURE__ */ (0,
|
|
4348
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(AdsTableStickyHeaderContext.Provider, { value: stickyHeader, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4348
4349
|
TableScrollArea,
|
|
4349
4350
|
{
|
|
4350
4351
|
ref,
|
|
@@ -4366,15 +4367,15 @@ var AdsTableScrollArea = React40.forwardRef(
|
|
|
4366
4367
|
) })
|
|
4367
4368
|
);
|
|
4368
4369
|
AdsTableScrollArea.displayName = "AdsTableScrollArea";
|
|
4369
|
-
var AdsTable =
|
|
4370
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
4370
|
+
var AdsTable = React41.forwardRef(
|
|
4371
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(AdsTableSurface, { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(AdsTableScrollArea, { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(AdsTableRoot, { ref, className, ...props }) }) })
|
|
4371
4372
|
);
|
|
4372
4373
|
AdsTable.displayName = "AdsTable";
|
|
4373
|
-
var AdsTableColGroup =
|
|
4374
|
+
var AdsTableColGroup = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(TableColGroup, { ref, className, ...props }));
|
|
4374
4375
|
AdsTableColGroup.displayName = "AdsTableColGroup";
|
|
4375
|
-
var AdsTableCol =
|
|
4376
|
+
var AdsTableCol = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(TableCol, { ref, className, ...props }));
|
|
4376
4377
|
AdsTableCol.displayName = "AdsTableCol";
|
|
4377
|
-
var AdsTableHeader =
|
|
4378
|
+
var AdsTableHeader = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4378
4379
|
TableHeader,
|
|
4379
4380
|
{
|
|
4380
4381
|
ref,
|
|
@@ -4383,7 +4384,7 @@ var AdsTableHeader = React40.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
4383
4384
|
}
|
|
4384
4385
|
));
|
|
4385
4386
|
AdsTableHeader.displayName = "AdsTableHeader";
|
|
4386
|
-
var AdsTableBody =
|
|
4387
|
+
var AdsTableBody = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4387
4388
|
TableBody,
|
|
4388
4389
|
{
|
|
4389
4390
|
ref,
|
|
@@ -4392,7 +4393,7 @@ var AdsTableBody = React40.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
4392
4393
|
}
|
|
4393
4394
|
));
|
|
4394
4395
|
AdsTableBody.displayName = "AdsTableBody";
|
|
4395
|
-
var AdsTableFooter =
|
|
4396
|
+
var AdsTableFooter = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4396
4397
|
TableFooter,
|
|
4397
4398
|
{
|
|
4398
4399
|
ref,
|
|
@@ -4405,7 +4406,7 @@ var AdsTableFooter = React40.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
4405
4406
|
}
|
|
4406
4407
|
));
|
|
4407
4408
|
AdsTableFooter.displayName = "AdsTableFooter";
|
|
4408
|
-
var AdsTableRow =
|
|
4409
|
+
var AdsTableRow = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4409
4410
|
TableRow,
|
|
4410
4411
|
{
|
|
4411
4412
|
ref,
|
|
@@ -4417,9 +4418,9 @@ var AdsTableRow = React40.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
4417
4418
|
}
|
|
4418
4419
|
));
|
|
4419
4420
|
AdsTableRow.displayName = "AdsTableRow";
|
|
4420
|
-
var AdsTableHead =
|
|
4421
|
-
const stickyHeader =
|
|
4422
|
-
return /* @__PURE__ */ (0,
|
|
4421
|
+
var AdsTableHead = React41.forwardRef(({ className, ...props }, ref) => {
|
|
4422
|
+
const stickyHeader = React41.useContext(AdsTableStickyHeaderContext);
|
|
4423
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4423
4424
|
TableHead,
|
|
4424
4425
|
{
|
|
4425
4426
|
ref,
|
|
@@ -4434,7 +4435,7 @@ var AdsTableHead = React40.forwardRef(({ className, ...props }, ref) => {
|
|
|
4434
4435
|
);
|
|
4435
4436
|
});
|
|
4436
4437
|
AdsTableHead.displayName = "AdsTableHead";
|
|
4437
|
-
var AdsTableCell =
|
|
4438
|
+
var AdsTableCell = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4438
4439
|
TableCell,
|
|
4439
4440
|
{
|
|
4440
4441
|
ref,
|
|
@@ -4447,7 +4448,7 @@ var AdsTableCell = React40.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
4447
4448
|
}
|
|
4448
4449
|
));
|
|
4449
4450
|
AdsTableCell.displayName = "AdsTableCell";
|
|
4450
|
-
var AdsTableCaption =
|
|
4451
|
+
var AdsTableCaption = React41.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4451
4452
|
TableCaption,
|
|
4452
4453
|
{
|
|
4453
4454
|
ref,
|
|
@@ -4456,12 +4457,12 @@ var AdsTableCaption = React40.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
4456
4457
|
}
|
|
4457
4458
|
));
|
|
4458
4459
|
AdsTableCaption.displayName = "AdsTableCaption";
|
|
4459
|
-
var AdsTableSortHeader =
|
|
4460
|
+
var AdsTableSortHeader = React41.forwardRef(
|
|
4460
4461
|
({ className, disabled = false, onToggleSort, sortOrder, title, ...props }, ref) => {
|
|
4461
4462
|
const { messages } = useAdsI18n();
|
|
4462
4463
|
const nextOrder = sortOrder === null ? "ascend" : sortOrder === "ascend" ? "descend" : null;
|
|
4463
4464
|
const actionLabel = nextOrder === "ascend" ? messages.table.sortAscending : nextOrder === "descend" ? messages.table.sortDescending : messages.table.clearSort;
|
|
4464
|
-
return /* @__PURE__ */ (0,
|
|
4465
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(AdsTableHead, { ref, className, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
4465
4466
|
Button,
|
|
4466
4467
|
{
|
|
4467
4468
|
"aria-label": `${title} ${actionLabel}`,
|
|
@@ -4477,15 +4478,15 @@ var AdsTableSortHeader = React40.forwardRef(
|
|
|
4477
4478
|
type: "button",
|
|
4478
4479
|
variant: "ghost",
|
|
4479
4480
|
children: [
|
|
4480
|
-
/* @__PURE__ */ (0,
|
|
4481
|
-
/* @__PURE__ */ (0,
|
|
4481
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "truncate", children: title }),
|
|
4482
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "inline-flex h-4 w-4 items-center justify-center text-icon-muted", children: sortOrder === "ascend" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react14.ChevronDown, { className: "h-4 w-4 rotate-180" }) : sortOrder === "descend" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react14.ChevronDown, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react14.ChevronDown, { className: "h-4 w-4 opacity-60" }) })
|
|
4482
4483
|
]
|
|
4483
4484
|
}
|
|
4484
4485
|
) });
|
|
4485
4486
|
}
|
|
4486
4487
|
);
|
|
4487
4488
|
AdsTableSortHeader.displayName = "AdsTableSortHeader";
|
|
4488
|
-
var AdsTableSelectionCell =
|
|
4489
|
+
var AdsTableSelectionCell = React41.forwardRef(
|
|
4489
4490
|
({
|
|
4490
4491
|
checked = false,
|
|
4491
4492
|
className,
|
|
@@ -4496,7 +4497,7 @@ var AdsTableSelectionCell = React40.forwardRef(
|
|
|
4496
4497
|
...props
|
|
4497
4498
|
}, ref) => {
|
|
4498
4499
|
const { messages } = useAdsI18n();
|
|
4499
|
-
return /* @__PURE__ */ (0,
|
|
4500
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(AdsTableCell, { ref, className: cn("w-12 p-2", className), ...props, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "flex items-center justify-center", children: type === "radio" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4500
4501
|
RadioGroupItem2,
|
|
4501
4502
|
{
|
|
4502
4503
|
"aria-label": messages.table.selectRow,
|
|
@@ -4508,7 +4509,7 @@ var AdsTableSelectionCell = React40.forwardRef(
|
|
|
4508
4509
|
},
|
|
4509
4510
|
value
|
|
4510
4511
|
}
|
|
4511
|
-
) : /* @__PURE__ */ (0,
|
|
4512
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4512
4513
|
Checkbox2,
|
|
4513
4514
|
{
|
|
4514
4515
|
"aria-label": messages.table.selectRow,
|
|
@@ -4522,10 +4523,10 @@ var AdsTableSelectionCell = React40.forwardRef(
|
|
|
4522
4523
|
}
|
|
4523
4524
|
);
|
|
4524
4525
|
AdsTableSelectionCell.displayName = "AdsTableSelectionCell";
|
|
4525
|
-
var AdsTableExpandCell =
|
|
4526
|
+
var AdsTableExpandCell = React41.forwardRef(
|
|
4526
4527
|
({ className, disabled = false, expanded = false, onToggle, ...props }, ref) => {
|
|
4527
4528
|
const { messages } = useAdsI18n();
|
|
4528
|
-
return /* @__PURE__ */ (0,
|
|
4529
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(AdsTableCell, { ref, className: cn("w-12 p-2", className), ...props, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4529
4530
|
Button,
|
|
4530
4531
|
{
|
|
4531
4532
|
"aria-label": expanded ? messages.table.collapseRow : messages.table.expandRow,
|
|
@@ -4542,7 +4543,7 @@ var AdsTableExpandCell = React40.forwardRef(
|
|
|
4542
4543
|
size: "sm",
|
|
4543
4544
|
type: "button",
|
|
4544
4545
|
variant: "ghost",
|
|
4545
|
-
children: expanded ? /* @__PURE__ */ (0,
|
|
4546
|
+
children: expanded ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react14.ChevronDown, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react14.ChevronRight, { className: "h-4 w-4" })
|
|
4546
4547
|
}
|
|
4547
4548
|
) }) });
|
|
4548
4549
|
}
|
|
@@ -4550,7 +4551,7 @@ var AdsTableExpandCell = React40.forwardRef(
|
|
|
4550
4551
|
AdsTableExpandCell.displayName = "AdsTableExpandCell";
|
|
4551
4552
|
|
|
4552
4553
|
// src/components/AdsDataTable/index.tsx
|
|
4553
|
-
var
|
|
4554
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
4554
4555
|
var SKELETON_ROW_COUNT = 4;
|
|
4555
4556
|
var FLEX_WIDTH_UNIT = 160;
|
|
4556
4557
|
var sizeClassNames = {
|
|
@@ -4672,7 +4673,7 @@ function getCellStyle(column, overrideWidth) {
|
|
|
4672
4673
|
return Object.keys(style).length > 0 ? style : void 0;
|
|
4673
4674
|
}
|
|
4674
4675
|
function renderCellValue(value, ellipsis) {
|
|
4675
|
-
if (
|
|
4676
|
+
if (React42.isValidElement(value)) {
|
|
4676
4677
|
return value;
|
|
4677
4678
|
}
|
|
4678
4679
|
if (value === null || value === void 0) {
|
|
@@ -4682,7 +4683,7 @@ function renderCellValue(value, ellipsis) {
|
|
|
4682
4683
|
if (ellipsis) {
|
|
4683
4684
|
const shouldShowTitle = typeof ellipsis === "object" ? ellipsis.showTitle !== false : true;
|
|
4684
4685
|
const maxWidth = typeof ellipsis === "object" ? ellipsis.maxWidth : void 0;
|
|
4685
|
-
return /* @__PURE__ */ (0,
|
|
4686
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4686
4687
|
"div",
|
|
4687
4688
|
{
|
|
4688
4689
|
className: "truncate",
|
|
@@ -4795,48 +4796,48 @@ function AdsDataTable({
|
|
|
4795
4796
|
suppressRowClickSelection = true
|
|
4796
4797
|
}) {
|
|
4797
4798
|
const { messages } = useAdsI18n();
|
|
4798
|
-
const resolvedColumns =
|
|
4799
|
-
const [internalSortState, setInternalSortState] =
|
|
4799
|
+
const resolvedColumns = React42.useMemo(() => columns.filter(Boolean), [columns]);
|
|
4800
|
+
const [internalSortState, setInternalSortState] = React42.useState(
|
|
4800
4801
|
() => getInitialSortState(resolvedColumns)
|
|
4801
4802
|
);
|
|
4802
|
-
const [internalSelectedKeys, setInternalSelectedKeys] =
|
|
4803
|
+
const [internalSelectedKeys, setInternalSelectedKeys] = React42.useState(
|
|
4803
4804
|
rowSelection?.defaultSelectedRowKeys ?? rowSelection?.selectedRowKeys ?? []
|
|
4804
4805
|
);
|
|
4805
|
-
const [internalFilterValues, setInternalFilterValues] =
|
|
4806
|
+
const [internalFilterValues, setInternalFilterValues] = React42.useState(
|
|
4806
4807
|
() => getInitialFilterValues(resolvedColumns)
|
|
4807
4808
|
);
|
|
4808
|
-
const [internalExpandedKeys, setInternalExpandedKeys] =
|
|
4809
|
+
const [internalExpandedKeys, setInternalExpandedKeys] = React42.useState(
|
|
4809
4810
|
expandable?.defaultExpandedRowKeys ?? expandable?.expandedRowKeys ?? []
|
|
4810
4811
|
);
|
|
4811
|
-
const [internalColumnWidths, setInternalColumnWidths] =
|
|
4812
|
-
const [internalCurrentPage, setInternalCurrentPage] =
|
|
4812
|
+
const [internalColumnWidths, setInternalColumnWidths] = React42.useState({});
|
|
4813
|
+
const [internalCurrentPage, setInternalCurrentPage] = React42.useState(
|
|
4813
4814
|
pagination !== false ? pagination.defaultCurrent ?? pagination.current ?? 1 : 1
|
|
4814
4815
|
);
|
|
4815
|
-
const [internalPageSize, setInternalPageSize] =
|
|
4816
|
+
const [internalPageSize, setInternalPageSize] = React42.useState(
|
|
4816
4817
|
pagination !== false ? pagination.defaultPageSize ?? pagination.pageSize ?? 10 : 10
|
|
4817
4818
|
);
|
|
4818
|
-
const [activeResize, setActiveResize] =
|
|
4819
|
-
|
|
4819
|
+
const [activeResize, setActiveResize] = React42.useState(null);
|
|
4820
|
+
React42.useEffect(() => {
|
|
4820
4821
|
if (rowSelection?.selectedRowKeys !== void 0) {
|
|
4821
4822
|
setInternalSelectedKeys(rowSelection.selectedRowKeys);
|
|
4822
4823
|
}
|
|
4823
4824
|
}, [rowSelection?.selectedRowKeys]);
|
|
4824
|
-
|
|
4825
|
+
React42.useEffect(() => {
|
|
4825
4826
|
if (expandable?.expandedRowKeys !== void 0) {
|
|
4826
4827
|
setInternalExpandedKeys(expandable.expandedRowKeys);
|
|
4827
4828
|
}
|
|
4828
4829
|
}, [expandable?.expandedRowKeys]);
|
|
4829
|
-
|
|
4830
|
+
React42.useEffect(() => {
|
|
4830
4831
|
if (pagination !== false && pagination.current !== void 0) {
|
|
4831
4832
|
setInternalCurrentPage(pagination.current);
|
|
4832
4833
|
}
|
|
4833
4834
|
}, [pagination]);
|
|
4834
|
-
|
|
4835
|
+
React42.useEffect(() => {
|
|
4835
4836
|
if (pagination !== false && pagination.pageSize !== void 0) {
|
|
4836
4837
|
setInternalPageSize(pagination.pageSize);
|
|
4837
4838
|
}
|
|
4838
4839
|
}, [pagination]);
|
|
4839
|
-
|
|
4840
|
+
React42.useEffect(() => {
|
|
4840
4841
|
setInternalFilterValues((previous) => {
|
|
4841
4842
|
const next = { ...previous };
|
|
4842
4843
|
let hasChanged = false;
|
|
@@ -4857,7 +4858,7 @@ function AdsDataTable({
|
|
|
4857
4858
|
return hasChanged ? next : previous;
|
|
4858
4859
|
});
|
|
4859
4860
|
}, [resolvedColumns]);
|
|
4860
|
-
const controlledSortState =
|
|
4861
|
+
const controlledSortState = React42.useMemo(() => {
|
|
4861
4862
|
const columnIndex = resolvedColumns.findIndex((column2) => column2.sortOrder !== void 0);
|
|
4862
4863
|
if (columnIndex === -1) {
|
|
4863
4864
|
return null;
|
|
@@ -4877,7 +4878,7 @@ function AdsDataTable({
|
|
|
4877
4878
|
const density = sizeClassNames[size];
|
|
4878
4879
|
const paginationMode = pagination === false ? "client" : pagination.mode ?? "client";
|
|
4879
4880
|
const allowsRowSelectionByClick = Boolean(rowSelection) && !suppressRowClickSelection;
|
|
4880
|
-
const filterValues =
|
|
4881
|
+
const filterValues = React42.useMemo(
|
|
4881
4882
|
() => resolvedColumns.reduce((accumulator, column, index) => {
|
|
4882
4883
|
const columnKey = getColumnKey(column, index);
|
|
4883
4884
|
accumulator[columnKey] = column.filterValue ?? internalFilterValues[columnKey] ?? "";
|
|
@@ -4885,7 +4886,7 @@ function AdsDataTable({
|
|
|
4885
4886
|
}, {}),
|
|
4886
4887
|
[internalFilterValues, resolvedColumns]
|
|
4887
4888
|
);
|
|
4888
|
-
const filteredData =
|
|
4889
|
+
const filteredData = React42.useMemo(() => {
|
|
4889
4890
|
const filterableColumns = resolvedColumns.filter((column) => column.filter);
|
|
4890
4891
|
if (filterableColumns.length === 0) {
|
|
4891
4892
|
return dataSource;
|
|
@@ -4905,7 +4906,7 @@ function AdsDataTable({
|
|
|
4905
4906
|
})
|
|
4906
4907
|
);
|
|
4907
4908
|
}, [dataSource, filterValues, resolvedColumns]);
|
|
4908
|
-
const sortedData =
|
|
4909
|
+
const sortedData = React42.useMemo(() => {
|
|
4909
4910
|
if (!sortState || !sortState.column || sortState.order === null) {
|
|
4910
4911
|
return filteredData;
|
|
4911
4912
|
}
|
|
@@ -4932,7 +4933,7 @@ function AdsDataTable({
|
|
|
4932
4933
|
Math.max(1, pagination.current ?? internalCurrentPage),
|
|
4933
4934
|
totalPages
|
|
4934
4935
|
);
|
|
4935
|
-
|
|
4936
|
+
React42.useEffect(() => {
|
|
4936
4937
|
if (pagination === false || pagination.current !== void 0) {
|
|
4937
4938
|
return;
|
|
4938
4939
|
}
|
|
@@ -4940,14 +4941,14 @@ function AdsDataTable({
|
|
|
4940
4941
|
setInternalCurrentPage(currentPage);
|
|
4941
4942
|
}
|
|
4942
4943
|
}, [currentPage, internalCurrentPage, pagination]);
|
|
4943
|
-
const paginatedData =
|
|
4944
|
+
const paginatedData = React42.useMemo(() => {
|
|
4944
4945
|
if (pagination === false || paginationMode === "server") {
|
|
4945
4946
|
return sortedData;
|
|
4946
4947
|
}
|
|
4947
4948
|
const start = (currentPage - 1) * currentPageSize;
|
|
4948
4949
|
return sortedData.slice(start, start + currentPageSize);
|
|
4949
4950
|
}, [currentPage, currentPageSize, pagination, paginationMode, sortedData]);
|
|
4950
|
-
const handleSortChange =
|
|
4951
|
+
const handleSortChange = React42.useCallback(
|
|
4951
4952
|
(column, columnKey, nextOrder) => {
|
|
4952
4953
|
const nextSortState = nextOrder === null ? null : {
|
|
4953
4954
|
column,
|
|
@@ -4961,7 +4962,7 @@ function AdsDataTable({
|
|
|
4961
4962
|
},
|
|
4962
4963
|
[controlledSortState, onSortChange]
|
|
4963
4964
|
);
|
|
4964
|
-
const handleFilterChange =
|
|
4965
|
+
const handleFilterChange = React42.useCallback(
|
|
4965
4966
|
(column, columnKey, nextValue) => {
|
|
4966
4967
|
if (column.filterValue === void 0) {
|
|
4967
4968
|
setInternalFilterValues((previous) => ({
|
|
@@ -4976,7 +4977,7 @@ function AdsDataTable({
|
|
|
4976
4977
|
},
|
|
4977
4978
|
[pagination]
|
|
4978
4979
|
);
|
|
4979
|
-
const updateSelection =
|
|
4980
|
+
const updateSelection = React42.useCallback(
|
|
4980
4981
|
(nextKeys) => {
|
|
4981
4982
|
if (!rowSelection) {
|
|
4982
4983
|
return;
|
|
@@ -4991,7 +4992,7 @@ function AdsDataTable({
|
|
|
4991
4992
|
},
|
|
4992
4993
|
[dataSource, rowKey, rowSelection]
|
|
4993
4994
|
);
|
|
4994
|
-
const toggleSelectionFromRowClick =
|
|
4995
|
+
const toggleSelectionFromRowClick = React42.useCallback(
|
|
4995
4996
|
(record, recordKey) => {
|
|
4996
4997
|
if (!allowsRowSelectionByClick || !rowSelection) {
|
|
4997
4998
|
return;
|
|
@@ -5005,7 +5006,7 @@ function AdsDataTable({
|
|
|
5005
5006
|
},
|
|
5006
5007
|
[allowsRowSelectionByClick, rowSelection, selectedKeys, updateSelection]
|
|
5007
5008
|
);
|
|
5008
|
-
const toggleExpanded =
|
|
5009
|
+
const toggleExpanded = React42.useCallback(
|
|
5009
5010
|
(record, recordKey) => {
|
|
5010
5011
|
if (!expandable?.expandedRowRender) {
|
|
5011
5012
|
return;
|
|
@@ -5022,11 +5023,11 @@ function AdsDataTable({
|
|
|
5022
5023
|
},
|
|
5023
5024
|
[expandable, expandedKeys]
|
|
5024
5025
|
);
|
|
5025
|
-
const renderedEmptyState = emptyState ?? /* @__PURE__ */ (0,
|
|
5026
|
-
/* @__PURE__ */ (0,
|
|
5027
|
-
typeof emptyText === "string" ? null : /* @__PURE__ */ (0,
|
|
5026
|
+
const renderedEmptyState = emptyState ?? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(AdsEmpty, { className: "min-h-[220px] py-12", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(AdsEmptyContent, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(AdsEmptyHeader, { children: [
|
|
5027
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(AdsEmptyTitle, { children: emptyText ?? messages.table.noDataAvailable }),
|
|
5028
|
+
typeof emptyText === "string" ? null : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(AdsEmptyDescription, { children: messages.table.noDataAvailable })
|
|
5028
5029
|
] }) }) });
|
|
5029
|
-
const handlePaginationChange =
|
|
5030
|
+
const handlePaginationChange = React42.useCallback(
|
|
5030
5031
|
(page, nextPageSize) => {
|
|
5031
5032
|
if (pagination === false) {
|
|
5032
5033
|
return;
|
|
@@ -5041,7 +5042,7 @@ function AdsDataTable({
|
|
|
5041
5042
|
},
|
|
5042
5043
|
[currentPageSize, pagination]
|
|
5043
5044
|
);
|
|
5044
|
-
const handlePageSizeChange =
|
|
5045
|
+
const handlePageSizeChange = React42.useCallback(
|
|
5045
5046
|
(nextPageSize, page) => {
|
|
5046
5047
|
if (pagination === false) {
|
|
5047
5048
|
return;
|
|
@@ -5056,28 +5057,28 @@ function AdsDataTable({
|
|
|
5056
5057
|
},
|
|
5057
5058
|
[pagination]
|
|
5058
5059
|
);
|
|
5059
|
-
const visibleRowEntries =
|
|
5060
|
+
const visibleRowEntries = React42.useMemo(
|
|
5060
5061
|
() => paginatedData.map((record, index) => ({
|
|
5061
5062
|
key: resolveRowKey(record, index, rowKey),
|
|
5062
5063
|
record
|
|
5063
5064
|
})),
|
|
5064
5065
|
[paginatedData, rowKey]
|
|
5065
5066
|
);
|
|
5066
|
-
const visibleSelectableKeys =
|
|
5067
|
+
const visibleSelectableKeys = React42.useMemo(
|
|
5067
5068
|
() => visibleRowEntries.map((entry) => entry.key),
|
|
5068
5069
|
[visibleRowEntries]
|
|
5069
5070
|
);
|
|
5070
|
-
const selectedVisibleCount =
|
|
5071
|
+
const selectedVisibleCount = React42.useMemo(
|
|
5071
5072
|
() => visibleSelectableKeys.filter((key) => selectedKeys.includes(key)).length,
|
|
5072
5073
|
[selectedKeys, visibleSelectableKeys]
|
|
5073
5074
|
);
|
|
5074
5075
|
const allVisibleRowsSelected = visibleSelectableKeys.length > 0 && selectedVisibleCount === visibleSelectableKeys.length;
|
|
5075
5076
|
const someVisibleRowsSelected = selectedVisibleCount > 0 && selectedVisibleCount < visibleSelectableKeys.length;
|
|
5076
|
-
const getColumnWidthOverride =
|
|
5077
|
+
const getColumnWidthOverride = React42.useCallback(
|
|
5077
5078
|
(column, columnKey) => internalColumnWidths[columnKey] ?? getResolvedColumnWidth(column),
|
|
5078
5079
|
[internalColumnWidths]
|
|
5079
5080
|
);
|
|
5080
|
-
const startColumnResize =
|
|
5081
|
+
const startColumnResize = React42.useCallback(
|
|
5081
5082
|
(event, column, columnKey) => {
|
|
5082
5083
|
event.preventDefault();
|
|
5083
5084
|
event.stopPropagation();
|
|
@@ -5108,7 +5109,7 @@ function AdsDataTable({
|
|
|
5108
5109
|
},
|
|
5109
5110
|
[internalColumnWidths]
|
|
5110
5111
|
);
|
|
5111
|
-
const renderColumnHeader =
|
|
5112
|
+
const renderColumnHeader = React42.useCallback(
|
|
5112
5113
|
(column, columnKey, columnSortOrder) => {
|
|
5113
5114
|
const headerTitle = getColumnHeader(column, columnKey);
|
|
5114
5115
|
const hasSorter = Boolean(column.sorter);
|
|
@@ -5119,9 +5120,9 @@ function AdsDataTable({
|
|
|
5119
5120
|
}
|
|
5120
5121
|
const nextOrder = columnSortOrder === null ? "ascend" : columnSortOrder === "ascend" ? "descend" : null;
|
|
5121
5122
|
const actionLabel = nextOrder === "ascend" ? messages.table.sortAscending : nextOrder === "descend" ? messages.table.sortDescending : messages.table.clearSort;
|
|
5122
|
-
return /* @__PURE__ */ (0,
|
|
5123
|
-
/* @__PURE__ */ (0,
|
|
5124
|
-
hasSorter ? /* @__PURE__ */ (0,
|
|
5123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "relative flex min-w-0 items-center gap-2 pr-3", children: [
|
|
5124
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex min-w-0 flex-1 items-center justify-between gap-2", children: [
|
|
5125
|
+
hasSorter ? /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
5125
5126
|
Button,
|
|
5126
5127
|
{
|
|
5127
5128
|
"aria-label": `${headerTitle} ${actionLabel}`,
|
|
@@ -5134,28 +5135,28 @@ function AdsDataTable({
|
|
|
5134
5135
|
type: "button",
|
|
5135
5136
|
variant: "ghost",
|
|
5136
5137
|
children: [
|
|
5137
|
-
/* @__PURE__ */ (0,
|
|
5138
|
-
/* @__PURE__ */ (0,
|
|
5138
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "truncate", children: headerTitle }),
|
|
5139
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "inline-flex h-4 w-4 items-center justify-center text-icon-muted", children: columnSortOrder === "ascend" ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react15.ChevronDown, { className: "h-4 w-4 rotate-180" }) : columnSortOrder === "descend" ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react15.ChevronDown, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react15.ChevronDown, { className: "h-4 w-4 opacity-60" }) })
|
|
5139
5140
|
]
|
|
5140
5141
|
}
|
|
5141
|
-
) : /* @__PURE__ */ (0,
|
|
5142
|
-
hasFilter ? /* @__PURE__ */ (0,
|
|
5143
|
-
/* @__PURE__ */ (0,
|
|
5142
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "truncate", children: headerTitle }),
|
|
5143
|
+
hasFilter ? /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(AdsPopover, { children: [
|
|
5144
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(AdsPopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
5144
5145
|
Button,
|
|
5145
5146
|
{
|
|
5146
5147
|
"aria-label": `${headerTitle} ${messages.table.filterColumn}`,
|
|
5147
5148
|
className: cn(
|
|
5148
|
-
"h-6 w-6 shrink-0 rounded-[6px] border
|
|
5149
|
+
"h-6 w-6 shrink-0 rounded-[6px] border-0 bg-transparent px-0 shadow-none hover:bg-accent focus-visible:ring-0",
|
|
5149
5150
|
filterValues[columnKey] ? "text-primary" : "text-icon-muted hover:text-[var(--card-foreground)]"
|
|
5150
5151
|
),
|
|
5151
5152
|
"data-ads-column-filter-trigger": "true",
|
|
5152
5153
|
size: "sm",
|
|
5153
5154
|
type: "button",
|
|
5154
5155
|
variant: "ghost",
|
|
5155
|
-
children: /* @__PURE__ */ (0,
|
|
5156
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react15.Filter, { className: "h-3.5 w-3.5" })
|
|
5156
5157
|
}
|
|
5157
5158
|
) }),
|
|
5158
|
-
/* @__PURE__ */ (0,
|
|
5159
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(AdsPopoverContent, { align: "end", className: "w-64", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
5159
5160
|
AdsInput,
|
|
5160
5161
|
{
|
|
5161
5162
|
clearable: true,
|
|
@@ -5168,7 +5169,7 @@ function AdsDataTable({
|
|
|
5168
5169
|
) })
|
|
5169
5170
|
] }) : null
|
|
5170
5171
|
] }),
|
|
5171
|
-
hasResizeHandle ? /* @__PURE__ */ (0,
|
|
5172
|
+
hasResizeHandle ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
5172
5173
|
"span",
|
|
5173
5174
|
{
|
|
5174
5175
|
"aria-label": `Resize ${headerTitle} column`,
|
|
@@ -5186,12 +5187,12 @@ function AdsDataTable({
|
|
|
5186
5187
|
},
|
|
5187
5188
|
[activeResize?.columnKey, filterValues, handleFilterChange, handleSortChange, messages.table, startColumnResize]
|
|
5188
5189
|
);
|
|
5189
|
-
const tableNode = /* @__PURE__ */ (0,
|
|
5190
|
-
/* @__PURE__ */ (0,
|
|
5191
|
-
/* @__PURE__ */ (0,
|
|
5192
|
-
hasSelectionColumn ? /* @__PURE__ */ (0,
|
|
5193
|
-
hasExpandableColumn ? /* @__PURE__ */ (0,
|
|
5194
|
-
resolvedColumns.map((column, index) => /* @__PURE__ */ (0,
|
|
5190
|
+
const tableNode = /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(AdsTableSurface, { className: cn("flex min-h-0 flex-1 flex-col", className), children: [
|
|
5191
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(AdsTableScrollArea, { fill, stickyHeader: sticky, x: scroll?.x, y: scroll?.y, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(AdsTableRoot, { className: tableClassName, children: [
|
|
5192
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(AdsTableColGroup, { children: [
|
|
5193
|
+
hasSelectionColumn ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(AdsTableCol, { style: { width: rowSelection?.columnWidth ?? 48 } }) : null,
|
|
5194
|
+
hasExpandableColumn ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(AdsTableCol, { style: { width: 48 } }) : null,
|
|
5195
|
+
resolvedColumns.map((column, index) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
5195
5196
|
AdsTableCol,
|
|
5196
5197
|
{
|
|
5197
5198
|
style: getCellStyle(column, getColumnWidthOverride(column, getColumnKey(column, index)))
|
|
@@ -5199,8 +5200,8 @@ function AdsDataTable({
|
|
|
5199
5200
|
getColumnKey(column, index)
|
|
5200
5201
|
))
|
|
5201
5202
|
] }),
|
|
5202
|
-
/* @__PURE__ */ (0,
|
|
5203
|
-
hasSelectionColumn ? /* @__PURE__ */ (0,
|
|
5203
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(AdsTableHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(AdsTableRow, { children: [
|
|
5204
|
+
hasSelectionColumn ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(AdsTableHead, { className: "w-12 p-2", children: rowSelection?.type !== "radio" && !rowSelection?.hideSelectAll ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
5204
5205
|
Checkbox2,
|
|
5205
5206
|
{
|
|
5206
5207
|
"aria-label": messages.table.selectAllRows,
|
|
@@ -5217,11 +5218,11 @@ function AdsDataTable({
|
|
|
5217
5218
|
onClick: (event) => event.stopPropagation()
|
|
5218
5219
|
}
|
|
5219
5220
|
) }) : null }) : null,
|
|
5220
|
-
hasExpandableColumn ? /* @__PURE__ */ (0,
|
|
5221
|
+
hasExpandableColumn ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(AdsTableHead, { className: "w-12 p-2" }) : null,
|
|
5221
5222
|
resolvedColumns.map((column, index) => {
|
|
5222
5223
|
const columnKey = getColumnKey(column, index);
|
|
5223
5224
|
const columnSortOrder = sortState?.columnKey === columnKey ? sortState.order : column.sortOrder ?? null;
|
|
5224
|
-
return /* @__PURE__ */ (0,
|
|
5225
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
5225
5226
|
AdsTableHead,
|
|
5226
5227
|
{
|
|
5227
5228
|
className: cn(density.head, column.className, column.headerClassName),
|
|
@@ -5232,14 +5233,14 @@ function AdsDataTable({
|
|
|
5232
5233
|
);
|
|
5233
5234
|
})
|
|
5234
5235
|
] }) }),
|
|
5235
|
-
/* @__PURE__ */ (0,
|
|
5236
|
-
hasSelectionColumn ? /* @__PURE__ */ (0,
|
|
5237
|
-
hasExpandableColumn ? /* @__PURE__ */ (0,
|
|
5238
|
-
resolvedColumns.map((column, index) => /* @__PURE__ */ (0,
|
|
5236
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(AdsTableBody, { children: loading ? Array.from({ length: SKELETON_ROW_COUNT }, (_, skeletonIndex) => /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(AdsTableRow, { children: [
|
|
5237
|
+
hasSelectionColumn ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(AdsTableCell, { className: "w-12 p-2", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(AdsSkeleton, { className: "h-4 w-4 rounded-[4px]" }) }) : null,
|
|
5238
|
+
hasExpandableColumn ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(AdsTableCell, { className: "w-12 p-2", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(AdsSkeleton, { className: "h-4 w-4 rounded-[4px]" }) }) : null,
|
|
5239
|
+
resolvedColumns.map((column, index) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
5239
5240
|
AdsTableCell,
|
|
5240
5241
|
{
|
|
5241
5242
|
className: cn(density.cell, column.className),
|
|
5242
|
-
children: /* @__PURE__ */ (0,
|
|
5243
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(AdsSkeleton, { className: "h-4 w-full rounded" })
|
|
5243
5244
|
},
|
|
5244
5245
|
`${getColumnKey(column, index)}-${skeletonIndex}`
|
|
5245
5246
|
))
|
|
@@ -5248,7 +5249,7 @@ function AdsDataTable({
|
|
|
5248
5249
|
const isExpanded = expandedKeys.includes(recordKey);
|
|
5249
5250
|
const canExpand = !!expandable?.expandedRowRender && (!expandable.rowExpandable || expandable.rowExpandable(record));
|
|
5250
5251
|
const dataRowClassName = typeof rowClassName === "function" ? rowClassName(record, index) : rowClassName;
|
|
5251
|
-
const row = /* @__PURE__ */ (0,
|
|
5252
|
+
const row = /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
5252
5253
|
AdsTableRow,
|
|
5253
5254
|
{
|
|
5254
5255
|
className: cn(
|
|
@@ -5271,7 +5272,7 @@ function AdsDataTable({
|
|
|
5271
5272
|
toggleSelectionFromRowClick(record, recordKey);
|
|
5272
5273
|
},
|
|
5273
5274
|
children: [
|
|
5274
|
-
hasSelectionColumn ? /* @__PURE__ */ (0,
|
|
5275
|
+
hasSelectionColumn ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
5275
5276
|
AdsTableSelectionCell,
|
|
5276
5277
|
{
|
|
5277
5278
|
checked: selectedKeys.includes(recordKey),
|
|
@@ -5287,7 +5288,7 @@ function AdsDataTable({
|
|
|
5287
5288
|
value: String(recordKey)
|
|
5288
5289
|
}
|
|
5289
5290
|
) : null,
|
|
5290
|
-
hasExpandableColumn ? /* @__PURE__ */ (0,
|
|
5291
|
+
hasExpandableColumn ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
5291
5292
|
AdsTableExpandCell,
|
|
5292
5293
|
{
|
|
5293
5294
|
disabled: !canExpand,
|
|
@@ -5300,7 +5301,7 @@ function AdsDataTable({
|
|
|
5300
5301
|
resolveRenderedCellContent(column, record, index),
|
|
5301
5302
|
column.ellipsis
|
|
5302
5303
|
);
|
|
5303
|
-
return /* @__PURE__ */ (0,
|
|
5304
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
5304
5305
|
AdsTableCell,
|
|
5305
5306
|
{
|
|
5306
5307
|
className: cn(
|
|
@@ -5326,12 +5327,12 @@ function AdsDataTable({
|
|
|
5326
5327
|
}
|
|
5327
5328
|
return [
|
|
5328
5329
|
row,
|
|
5329
|
-
/* @__PURE__ */ (0,
|
|
5330
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(AdsTableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
5330
5331
|
AdsTableCell,
|
|
5331
5332
|
{
|
|
5332
5333
|
className: "p-0",
|
|
5333
5334
|
colSpan: resolvedColumns.length + Number(hasSelectionColumn) + Number(hasExpandableColumn),
|
|
5334
|
-
children: /* @__PURE__ */ (0,
|
|
5335
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
5335
5336
|
"div",
|
|
5336
5337
|
{
|
|
5337
5338
|
className: cn(
|
|
@@ -5345,7 +5346,7 @@ function AdsDataTable({
|
|
|
5345
5346
|
) }, `${String(recordKey)}-expanded`)
|
|
5346
5347
|
];
|
|
5347
5348
|
}) : [
|
|
5348
|
-
/* @__PURE__ */ (0,
|
|
5349
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(AdsTableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
5349
5350
|
AdsTableCell,
|
|
5350
5351
|
{
|
|
5351
5352
|
colSpan: resolvedColumns.length + Number(hasSelectionColumn) + Number(hasExpandableColumn),
|
|
@@ -5355,8 +5356,8 @@ function AdsDataTable({
|
|
|
5355
5356
|
) }, "empty-row")
|
|
5356
5357
|
] })
|
|
5357
5358
|
] }) }),
|
|
5358
|
-
footer ? /* @__PURE__ */ (0,
|
|
5359
|
-
pagination !== false ? /* @__PURE__ */ (0,
|
|
5359
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "border-t border-border p-3", children: footer }) : null,
|
|
5360
|
+
pagination !== false ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: cn("border-t border-border p-3", classNames?.paginationContainer), children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
5360
5361
|
AdsDataPagination,
|
|
5361
5362
|
{
|
|
5362
5363
|
ariaLabel: messages.pagination.navigation,
|
|
@@ -5378,7 +5379,7 @@ function AdsDataTable({
|
|
|
5378
5379
|
) }) : null
|
|
5379
5380
|
] });
|
|
5380
5381
|
if (rowSelection?.type === "radio") {
|
|
5381
|
-
return /* @__PURE__ */ (0,
|
|
5382
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
5382
5383
|
RadioGroup2,
|
|
5383
5384
|
{
|
|
5384
5385
|
onValueChange: (value) => {
|
|
@@ -5399,7 +5400,7 @@ function AdsDataTable({
|
|
|
5399
5400
|
}
|
|
5400
5401
|
|
|
5401
5402
|
// src/components/AdsDataTableToolbar/index.tsx
|
|
5402
|
-
var
|
|
5403
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
5403
5404
|
function AdsDataTableToolbar({
|
|
5404
5405
|
action,
|
|
5405
5406
|
className,
|
|
@@ -5411,7 +5412,7 @@ function AdsDataTableToolbar({
|
|
|
5411
5412
|
onSearchChange,
|
|
5412
5413
|
onSearchClear
|
|
5413
5414
|
}) {
|
|
5414
|
-
return /* @__PURE__ */ (0,
|
|
5415
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
5415
5416
|
"div",
|
|
5416
5417
|
{
|
|
5417
5418
|
className: cn(
|
|
@@ -5419,9 +5420,9 @@ function AdsDataTableToolbar({
|
|
|
5419
5420
|
className
|
|
5420
5421
|
),
|
|
5421
5422
|
children: [
|
|
5422
|
-
/* @__PURE__ */ (0,
|
|
5423
|
-
/* @__PURE__ */ (0,
|
|
5424
|
-
/* @__PURE__ */ (0,
|
|
5423
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "min-w-0 flex-1", children: title ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("h2", { className: cn("truncate text-xl font-medium text-white", titleClassName), children: title }) : null }),
|
|
5424
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex w-full flex-col gap-sm md:min-w-0 md:flex-1 md:flex-row md:items-center md:justify-end", children: [
|
|
5425
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "min-w-0 md:max-w-[440px] md:flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5425
5426
|
AdsInput,
|
|
5426
5427
|
{
|
|
5427
5428
|
className: cn(
|
|
@@ -5435,7 +5436,7 @@ function AdsDataTableToolbar({
|
|
|
5435
5436
|
value: searchValue
|
|
5436
5437
|
}
|
|
5437
5438
|
) }),
|
|
5438
|
-
action ? /* @__PURE__ */ (0,
|
|
5439
|
+
action ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "shrink-0", children: action }) : null
|
|
5439
5440
|
] })
|
|
5440
5441
|
]
|
|
5441
5442
|
}
|
|
@@ -5443,7 +5444,7 @@ function AdsDataTableToolbar({
|
|
|
5443
5444
|
}
|
|
5444
5445
|
|
|
5445
5446
|
// src/components/AdsViewCustomersDataTable/index.tsx
|
|
5446
|
-
var
|
|
5447
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
5447
5448
|
function resolveHeight(value) {
|
|
5448
5449
|
if (value === void 0) {
|
|
5449
5450
|
return 500;
|
|
@@ -5475,13 +5476,13 @@ function AdsViewCustomersDataTable({
|
|
|
5475
5476
|
...props
|
|
5476
5477
|
}) {
|
|
5477
5478
|
const tableHeight = resolveHeight(height);
|
|
5478
|
-
const resolvedErrorState = errorState ?? /* @__PURE__ */ (0,
|
|
5479
|
-
/* @__PURE__ */ (0,
|
|
5480
|
-
/* @__PURE__ */ (0,
|
|
5481
|
-
onRetry ? /* @__PURE__ */ (0,
|
|
5479
|
+
const resolvedErrorState = errorState ?? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex min-h-[500px] flex-col items-center justify-center gap-3 px-6 py-12 text-center", children: [
|
|
5480
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: "text-sm font-medium text-white", children: errorTitle }),
|
|
5481
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: "max-w-md text-sm text-[#848484]", children: errorDescription }),
|
|
5482
|
+
onRetry ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(AdsButton, { intent: "primary", onClick: onRetry, children: retryLabel }) : null
|
|
5482
5483
|
] });
|
|
5483
|
-
return /* @__PURE__ */ (0,
|
|
5484
|
-
/* @__PURE__ */ (0,
|
|
5484
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "overflow-hidden rounded-xl border border-[#27282F] bg-[#1B1C21]", children: [
|
|
5485
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
5485
5486
|
AdsDataTableToolbar,
|
|
5486
5487
|
{
|
|
5487
5488
|
action: toolbarAction,
|
|
@@ -5493,7 +5494,7 @@ function AdsViewCustomersDataTable({
|
|
|
5493
5494
|
}
|
|
5494
5495
|
),
|
|
5495
5496
|
error ? resolvedErrorState : null,
|
|
5496
|
-
!error ? /* @__PURE__ */ (0,
|
|
5497
|
+
!error ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
5497
5498
|
AdsDataTable,
|
|
5498
5499
|
{
|
|
5499
5500
|
...props,
|
|
@@ -5528,20 +5529,20 @@ function AdsViewCustomersDataTable({
|
|
|
5528
5529
|
}
|
|
5529
5530
|
|
|
5530
5531
|
// src/components/AdsProgress/index.tsx
|
|
5531
|
-
var
|
|
5532
|
+
var React44 = __toESM(require("react"), 1);
|
|
5532
5533
|
|
|
5533
5534
|
// src/primitives/progress.tsx
|
|
5534
|
-
var
|
|
5535
|
+
var React43 = __toESM(require("react"), 1);
|
|
5535
5536
|
var ProgressPrimitive = __toESM(require("@radix-ui/react-progress"), 1);
|
|
5536
|
-
var
|
|
5537
|
-
var Progress =
|
|
5537
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
5538
|
+
var Progress = React43.forwardRef(({ className, indicatorClassName, value, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
5538
5539
|
ProgressPrimitive.Root,
|
|
5539
5540
|
{
|
|
5540
5541
|
className: cn("relative h-4 w-full overflow-hidden rounded-full bg-secondary", className),
|
|
5541
5542
|
ref,
|
|
5542
5543
|
value,
|
|
5543
5544
|
...props,
|
|
5544
|
-
children: /* @__PURE__ */ (0,
|
|
5545
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
5545
5546
|
ProgressPrimitive.Indicator,
|
|
5546
5547
|
{
|
|
5547
5548
|
className: cn("h-full w-full flex-1 bg-primary transition-all", indicatorClassName),
|
|
@@ -5553,13 +5554,13 @@ var Progress = React42.forwardRef(({ className, indicatorClassName, value, ...pr
|
|
|
5553
5554
|
Progress.displayName = ProgressPrimitive.Root.displayName;
|
|
5554
5555
|
|
|
5555
5556
|
// src/components/AdsProgress/index.tsx
|
|
5556
|
-
var
|
|
5557
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
5557
5558
|
var progressBaseClassName = "h-2 rounded-radius-full bg-[color:color-mix(in_srgb,var(--primary)_20%,transparent)]";
|
|
5558
5559
|
var progressIndicatorVariantClassName = {
|
|
5559
5560
|
ai: "bg-brand-gradient",
|
|
5560
5561
|
default: "bg-primary"
|
|
5561
5562
|
};
|
|
5562
|
-
var Progress2 =
|
|
5563
|
+
var Progress2 = React44.forwardRef(({ className, indicatorClassName, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
5563
5564
|
Progress,
|
|
5564
5565
|
{
|
|
5565
5566
|
className: cn(progressBaseClassName, className),
|
|
@@ -5569,7 +5570,7 @@ var Progress2 = React43.forwardRef(({ className, indicatorClassName, ...props },
|
|
|
5569
5570
|
}
|
|
5570
5571
|
));
|
|
5571
5572
|
Progress2.displayName = "Progress";
|
|
5572
|
-
var AdsProgress =
|
|
5573
|
+
var AdsProgress = React44.forwardRef(
|
|
5573
5574
|
({
|
|
5574
5575
|
className,
|
|
5575
5576
|
descriptionPlacement = "above",
|
|
@@ -5588,12 +5589,12 @@ var AdsProgress = React43.forwardRef(
|
|
|
5588
5589
|
id
|
|
5589
5590
|
});
|
|
5590
5591
|
const labelId = label ? `${description.inputId}-label` : void 0;
|
|
5591
|
-
const helperNode = helperText ? /* @__PURE__ */ (0,
|
|
5592
|
-
const errorNode = errorText ? /* @__PURE__ */ (0,
|
|
5593
|
-
return /* @__PURE__ */ (0,
|
|
5594
|
-
label ? /* @__PURE__ */ (0,
|
|
5592
|
+
const helperNode = helperText ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(AdsFieldDescription, { id: description.helperId, children: helperText }) : null;
|
|
5593
|
+
const errorNode = errorText ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(AdsFieldError, { id: description.errorId, children: errorText }) : null;
|
|
5594
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(AdsFieldItem, { children: [
|
|
5595
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(AdsFieldLabel, { id: labelId, children: label }) : null,
|
|
5595
5596
|
descriptionPlacement === "above" ? helperNode : null,
|
|
5596
|
-
/* @__PURE__ */ (0,
|
|
5597
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
5597
5598
|
Progress,
|
|
5598
5599
|
{
|
|
5599
5600
|
"aria-describedby": description.describedBy,
|
|
@@ -5617,13 +5618,13 @@ var AdsProgress = React43.forwardRef(
|
|
|
5617
5618
|
AdsProgress.displayName = "AdsProgress";
|
|
5618
5619
|
|
|
5619
5620
|
// src/components/AdsSlider/index.tsx
|
|
5620
|
-
var
|
|
5621
|
+
var React46 = __toESM(require("react"), 1);
|
|
5621
5622
|
|
|
5622
5623
|
// src/primitives/slider.tsx
|
|
5623
|
-
var
|
|
5624
|
+
var React45 = __toESM(require("react"), 1);
|
|
5624
5625
|
var SliderPrimitive = __toESM(require("@radix-ui/react-slider"), 1);
|
|
5625
|
-
var
|
|
5626
|
-
var Slider =
|
|
5626
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
5627
|
+
var Slider = React45.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
5627
5628
|
SliderPrimitive.Root,
|
|
5628
5629
|
{
|
|
5629
5630
|
ref,
|
|
@@ -5633,10 +5634,10 @@ var Slider = React44.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
5633
5634
|
),
|
|
5634
5635
|
...props,
|
|
5635
5636
|
children: [
|
|
5636
|
-
/* @__PURE__ */ (0,
|
|
5637
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(SliderPrimitive.Track, { className: "relative h-1.5 w-full grow overflow-hidden rounded-full bg-secondary", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(SliderPrimitive.Range, { className: "absolute h-full bg-primary" }) }),
|
|
5637
5638
|
Array.from({
|
|
5638
5639
|
length: Array.isArray(props.value) ? props.value.length : Array.isArray(props.defaultValue) ? props.defaultValue.length : 1
|
|
5639
|
-
}).map((_, index) => /* @__PURE__ */ (0,
|
|
5640
|
+
}).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5640
5641
|
SliderPrimitive.Thumb,
|
|
5641
5642
|
{
|
|
5642
5643
|
className: "block h-5 w-5 rounded-full border border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"
|
|
@@ -5649,11 +5650,11 @@ var Slider = React44.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
5649
5650
|
Slider.displayName = SliderPrimitive.Root.displayName;
|
|
5650
5651
|
|
|
5651
5652
|
// src/components/AdsSlider/index.tsx
|
|
5652
|
-
var
|
|
5653
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
5653
5654
|
var sliderBaseClassName = "py-1";
|
|
5654
|
-
var Slider2 =
|
|
5655
|
+
var Slider2 = React46.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Slider, { className: cn(sliderBaseClassName, className), ref, ...props }));
|
|
5655
5656
|
Slider2.displayName = "Slider";
|
|
5656
|
-
var AdsSlider =
|
|
5657
|
+
var AdsSlider = React46.forwardRef(
|
|
5657
5658
|
({
|
|
5658
5659
|
className,
|
|
5659
5660
|
descriptionPlacement = "above",
|
|
@@ -5668,12 +5669,12 @@ var AdsSlider = React45.forwardRef(
|
|
|
5668
5669
|
helperText,
|
|
5669
5670
|
id
|
|
5670
5671
|
});
|
|
5671
|
-
const helperNode = helperText ? /* @__PURE__ */ (0,
|
|
5672
|
-
const errorNode = errorText ? /* @__PURE__ */ (0,
|
|
5673
|
-
return /* @__PURE__ */ (0,
|
|
5674
|
-
label ? /* @__PURE__ */ (0,
|
|
5672
|
+
const helperNode = helperText ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(AdsFieldDescription, { id: description.helperId, children: helperText }) : null;
|
|
5673
|
+
const errorNode = errorText ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(AdsFieldError, { id: description.errorId, children: errorText }) : null;
|
|
5674
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(AdsFieldItem, { children: [
|
|
5675
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(AdsFieldLabel, { children: label }) : null,
|
|
5675
5676
|
descriptionPlacement === "above" ? helperNode : null,
|
|
5676
|
-
/* @__PURE__ */ (0,
|
|
5677
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
5677
5678
|
Slider2,
|
|
5678
5679
|
{
|
|
5679
5680
|
"aria-describedby": description.describedBy,
|
|
@@ -5690,13 +5691,13 @@ var AdsSlider = React45.forwardRef(
|
|
|
5690
5691
|
AdsSlider.displayName = "AdsSlider";
|
|
5691
5692
|
|
|
5692
5693
|
// src/components/AdsSwitch/index.tsx
|
|
5693
|
-
var
|
|
5694
|
+
var React48 = __toESM(require("react"), 1);
|
|
5694
5695
|
|
|
5695
5696
|
// src/primitives/switch.tsx
|
|
5696
|
-
var
|
|
5697
|
+
var React47 = __toESM(require("react"), 1);
|
|
5697
5698
|
var SwitchPrimitives = __toESM(require("@radix-ui/react-switch"), 1);
|
|
5698
|
-
var
|
|
5699
|
-
var Switch =
|
|
5699
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
5700
|
+
var Switch = React47.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
5700
5701
|
SwitchPrimitives.Root,
|
|
5701
5702
|
{
|
|
5702
5703
|
className: cn(
|
|
@@ -5705,7 +5706,7 @@ var Switch = React46.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
5705
5706
|
),
|
|
5706
5707
|
...props,
|
|
5707
5708
|
ref,
|
|
5708
|
-
children: /* @__PURE__ */ (0,
|
|
5709
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
5709
5710
|
SwitchPrimitives.Thumb,
|
|
5710
5711
|
{
|
|
5711
5712
|
className: cn(
|
|
@@ -5718,15 +5719,15 @@ var Switch = React46.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
5718
5719
|
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
5719
5720
|
|
|
5720
5721
|
// src/components/AdsSwitch/index.tsx
|
|
5721
|
-
var
|
|
5722
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
5722
5723
|
var switchBaseClassName = "h-6 w-11 border border-transparent bg-muted shadow-[0px_1px_2px_rgba(0,0,0,0.1)] focus-visible:ring-[3px] focus-visible:ring-[rgba(161,161,161,0.5)] focus-visible:ring-offset-0 data-[state=checked]:bg-primary data-[state=unchecked]:bg-muted";
|
|
5723
|
-
var Switch2 =
|
|
5724
|
+
var Switch2 = React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Switch, { className: cn(switchBaseClassName, className), ref, ...props }));
|
|
5724
5725
|
Switch2.displayName = "Switch";
|
|
5725
|
-
var AdsSwitch =
|
|
5726
|
-
const generatedId =
|
|
5726
|
+
var AdsSwitch = React48.forwardRef(({ className, description, id, label, switchClassName, wrapperClassName, ...props }, ref) => {
|
|
5727
|
+
const generatedId = React48.useId();
|
|
5727
5728
|
const inputId = id ?? generatedId;
|
|
5728
5729
|
if (!label) {
|
|
5729
|
-
return /* @__PURE__ */ (0,
|
|
5730
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5730
5731
|
Switch2,
|
|
5731
5732
|
{
|
|
5732
5733
|
className: cn(className, switchClassName),
|
|
@@ -5736,12 +5737,12 @@ var AdsSwitch = React47.forwardRef(({ className, description, id, label, switchC
|
|
|
5736
5737
|
}
|
|
5737
5738
|
);
|
|
5738
5739
|
}
|
|
5739
|
-
return /* @__PURE__ */ (0,
|
|
5740
|
-
/* @__PURE__ */ (0,
|
|
5741
|
-
/* @__PURE__ */ (0,
|
|
5742
|
-
description ? /* @__PURE__ */ (0,
|
|
5740
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("label", { className: cn("block w-full cursor-pointer", wrapperClassName), htmlFor: inputId, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex w-full items-start gap-3", children: [
|
|
5741
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-1.5 pt-0.5", children: [
|
|
5742
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "text-sm font-medium leading-5 text-foreground", children: label }),
|
|
5743
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(AdsFieldDescription, { className: "text-sm leading-5", children: description }) : null
|
|
5743
5744
|
] }),
|
|
5744
|
-
/* @__PURE__ */ (0,
|
|
5745
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5745
5746
|
Switch2,
|
|
5746
5747
|
{
|
|
5747
5748
|
className: cn(className, switchClassName),
|
|
@@ -5755,14 +5756,14 @@ var AdsSwitch = React47.forwardRef(({ className, description, id, label, switchC
|
|
|
5755
5756
|
AdsSwitch.displayName = "AdsSwitch";
|
|
5756
5757
|
|
|
5757
5758
|
// src/components/AdsTabs/index.tsx
|
|
5758
|
-
var
|
|
5759
|
+
var React50 = __toESM(require("react"), 1);
|
|
5759
5760
|
|
|
5760
5761
|
// src/primitives/tabs.tsx
|
|
5761
|
-
var
|
|
5762
|
+
var React49 = __toESM(require("react"), 1);
|
|
5762
5763
|
var TabsPrimitive = __toESM(require("@radix-ui/react-tabs"), 1);
|
|
5763
|
-
var
|
|
5764
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
5764
5765
|
var Tabs = TabsPrimitive.Root;
|
|
5765
|
-
var TabsList =
|
|
5766
|
+
var TabsList = React49.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
5766
5767
|
TabsPrimitive.List,
|
|
5767
5768
|
{
|
|
5768
5769
|
className: cn("inline-flex items-center", className),
|
|
@@ -5771,7 +5772,7 @@ var TabsList = React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
5771
5772
|
}
|
|
5772
5773
|
));
|
|
5773
5774
|
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
5774
|
-
var TabsTrigger =
|
|
5775
|
+
var TabsTrigger = React49.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
5775
5776
|
TabsPrimitive.Trigger,
|
|
5776
5777
|
{
|
|
5777
5778
|
className: cn(
|
|
@@ -5783,7 +5784,7 @@ var TabsTrigger = React48.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
5783
5784
|
}
|
|
5784
5785
|
));
|
|
5785
5786
|
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
5786
|
-
var TabsContent =
|
|
5787
|
+
var TabsContent = React49.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
5787
5788
|
TabsPrimitive.Content,
|
|
5788
5789
|
{
|
|
5789
5790
|
className: cn("focus-visible:outline-none", className),
|
|
@@ -5794,9 +5795,9 @@ var TabsContent = React48.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
5794
5795
|
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
5795
5796
|
|
|
5796
5797
|
// src/components/AdsTabs/index.tsx
|
|
5797
|
-
var
|
|
5798
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
5798
5799
|
var AdsTabs = Tabs;
|
|
5799
|
-
var AdsTabsList =
|
|
5800
|
+
var AdsTabsList = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
5800
5801
|
TabsList,
|
|
5801
5802
|
{
|
|
5802
5803
|
className: cn(
|
|
@@ -5808,7 +5809,7 @@ var AdsTabsList = React49.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
5808
5809
|
}
|
|
5809
5810
|
));
|
|
5810
5811
|
AdsTabsList.displayName = "AdsTabsList";
|
|
5811
|
-
var AdsTabsTrigger =
|
|
5812
|
+
var AdsTabsTrigger = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
5812
5813
|
TabsTrigger,
|
|
5813
5814
|
{
|
|
5814
5815
|
className: cn(
|
|
@@ -5820,7 +5821,7 @@ var AdsTabsTrigger = React49.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
5820
5821
|
}
|
|
5821
5822
|
));
|
|
5822
5823
|
AdsTabsTrigger.displayName = "AdsTabsTrigger";
|
|
5823
|
-
var AdsTabsContent =
|
|
5824
|
+
var AdsTabsContent = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
5824
5825
|
TabsContent,
|
|
5825
5826
|
{
|
|
5826
5827
|
className: cn(
|
|
@@ -5834,13 +5835,13 @@ var AdsTabsContent = React49.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
5834
5835
|
AdsTabsContent.displayName = "AdsTabsContent";
|
|
5835
5836
|
|
|
5836
5837
|
// src/components/AdsToggle/index.tsx
|
|
5837
|
-
var
|
|
5838
|
+
var React52 = __toESM(require("react"), 1);
|
|
5838
5839
|
|
|
5839
5840
|
// src/primitives/toggle.tsx
|
|
5840
|
-
var
|
|
5841
|
+
var React51 = __toESM(require("react"), 1);
|
|
5841
5842
|
var TogglePrimitive = __toESM(require("@radix-ui/react-toggle"), 1);
|
|
5842
|
-
var
|
|
5843
|
-
var Toggle =
|
|
5843
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
5844
|
+
var Toggle = React51.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5844
5845
|
TogglePrimitive.Root,
|
|
5845
5846
|
{
|
|
5846
5847
|
className: cn(
|
|
@@ -5854,7 +5855,7 @@ var Toggle = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
5854
5855
|
Toggle.displayName = TogglePrimitive.Root.displayName;
|
|
5855
5856
|
|
|
5856
5857
|
// src/components/AdsToggle/index.tsx
|
|
5857
|
-
var
|
|
5858
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
5858
5859
|
var sizeClassName3 = {
|
|
5859
5860
|
sm: "!h-8 px-[6px] text-sm",
|
|
5860
5861
|
md: "!h-9 px-md text-sm",
|
|
@@ -5869,10 +5870,10 @@ var variantClassName = {
|
|
|
5869
5870
|
default: "border border-transparent bg-transparent text-foreground shadow-none hover:bg-muted/70 data-[state=on]:bg-muted data-[state=on]:shadow-[0px_1px_1px_rgba(0,0,0,0.1)]",
|
|
5870
5871
|
outline: "border border-border bg-transparent text-foreground shadow-none hover:bg-muted/70 data-[state=on]:border-transparent data-[state=on]:bg-muted data-[state=on]:shadow-[0px_1px_1px_rgba(0,0,0,0.1)]"
|
|
5871
5872
|
};
|
|
5872
|
-
var AdsToggle =
|
|
5873
|
-
const childCount =
|
|
5874
|
-
const isIconOnly = childCount === 1 &&
|
|
5875
|
-
return /* @__PURE__ */ (0,
|
|
5873
|
+
var AdsToggle = React52.forwardRef(({ children, className, size = "md", variant = "default", ...props }, ref) => {
|
|
5874
|
+
const childCount = React52.Children.count(children);
|
|
5875
|
+
const isIconOnly = childCount === 1 && React52.isValidElement(children);
|
|
5876
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
5876
5877
|
Toggle,
|
|
5877
5878
|
{
|
|
5878
5879
|
className: cn(
|
|
@@ -5891,13 +5892,13 @@ var AdsToggle = React51.forwardRef(({ children, className, size = "md", variant
|
|
|
5891
5892
|
AdsToggle.displayName = "AdsToggle";
|
|
5892
5893
|
|
|
5893
5894
|
// src/components/AdsToggleGroup/index.tsx
|
|
5894
|
-
var
|
|
5895
|
+
var React54 = __toESM(require("react"), 1);
|
|
5895
5896
|
|
|
5896
5897
|
// src/primitives/toggle-group.tsx
|
|
5897
|
-
var
|
|
5898
|
+
var React53 = __toESM(require("react"), 1);
|
|
5898
5899
|
var ToggleGroupPrimitive = __toESM(require("@radix-ui/react-toggle-group"), 1);
|
|
5899
|
-
var
|
|
5900
|
-
var ToggleGroup =
|
|
5900
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
5901
|
+
var ToggleGroup = React53.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
5901
5902
|
ToggleGroupPrimitive.Root,
|
|
5902
5903
|
{
|
|
5903
5904
|
className: cn("inline-flex items-center justify-start", className),
|
|
@@ -5906,7 +5907,7 @@ var ToggleGroup = React52.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
5906
5907
|
}
|
|
5907
5908
|
));
|
|
5908
5909
|
ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;
|
|
5909
|
-
var ToggleGroupItem =
|
|
5910
|
+
var ToggleGroupItem = React53.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
5910
5911
|
ToggleGroupPrimitive.Item,
|
|
5911
5912
|
{
|
|
5912
5913
|
className: cn(
|
|
@@ -5920,7 +5921,7 @@ var ToggleGroupItem = React52.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
5920
5921
|
ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
|
|
5921
5922
|
|
|
5922
5923
|
// src/components/AdsToggleGroup/index.tsx
|
|
5923
|
-
var
|
|
5924
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
5924
5925
|
var sizeClassName4 = {
|
|
5925
5926
|
sm: "h-8 min-w-7 px-[6px] text-sm",
|
|
5926
5927
|
md: "h-9 min-w-[34px] px-md text-sm",
|
|
@@ -5930,8 +5931,8 @@ var variantClassName2 = {
|
|
|
5930
5931
|
default: "border-transparent bg-transparent text-foreground hover:bg-muted/70 data-[state=on]:bg-muted data-[state=on]:shadow-[0px_1px_1px_rgba(0,0,0,0.1)]",
|
|
5931
5932
|
outline: "border border-border bg-transparent text-foreground hover:bg-muted/70 data-[state=on]:border-transparent data-[state=on]:bg-muted data-[state=on]:shadow-[0px_1px_1px_rgba(0,0,0,0.1)]"
|
|
5932
5933
|
};
|
|
5933
|
-
var AdsToggleGroupContext =
|
|
5934
|
-
var AdsToggleGroup =
|
|
5934
|
+
var AdsToggleGroupContext = React54.createContext(null);
|
|
5935
|
+
var AdsToggleGroup = React54.forwardRef(
|
|
5935
5936
|
({
|
|
5936
5937
|
children,
|
|
5937
5938
|
className,
|
|
@@ -5939,7 +5940,7 @@ var AdsToggleGroup = React53.forwardRef(
|
|
|
5939
5940
|
size = "md",
|
|
5940
5941
|
variant = "default",
|
|
5941
5942
|
...props
|
|
5942
|
-
}, ref) => /* @__PURE__ */ (0,
|
|
5943
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(AdsToggleGroupContext.Provider, { value: { orientation, size, variant }, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5943
5944
|
ToggleGroup,
|
|
5944
5945
|
{
|
|
5945
5946
|
className: cn(
|
|
@@ -5955,12 +5956,12 @@ var AdsToggleGroup = React53.forwardRef(
|
|
|
5955
5956
|
) })
|
|
5956
5957
|
);
|
|
5957
5958
|
AdsToggleGroup.displayName = "AdsToggleGroup";
|
|
5958
|
-
var AdsToggleGroupItem =
|
|
5959
|
-
const context =
|
|
5959
|
+
var AdsToggleGroupItem = React54.forwardRef(({ className, size, variant, ...props }, ref) => {
|
|
5960
|
+
const context = React54.useContext(AdsToggleGroupContext);
|
|
5960
5961
|
const resolvedOrientation = context?.orientation ?? "horizontal";
|
|
5961
5962
|
const resolvedSize = size ?? context?.size ?? "md";
|
|
5962
5963
|
const resolvedVariant = variant ?? context?.variant ?? "default";
|
|
5963
|
-
return /* @__PURE__ */ (0,
|
|
5964
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5964
5965
|
ToggleGroupItem,
|
|
5965
5966
|
{
|
|
5966
5967
|
className: cn(
|
|
@@ -5978,10 +5979,10 @@ var AdsToggleGroupItem = React53.forwardRef(({ className, size, variant, ...prop
|
|
|
5978
5979
|
AdsToggleGroupItem.displayName = "AdsToggleGroupItem";
|
|
5979
5980
|
|
|
5980
5981
|
// src/components/AdsTextarea/index.tsx
|
|
5981
|
-
var
|
|
5982
|
-
var
|
|
5982
|
+
var React55 = __toESM(require("react"), 1);
|
|
5983
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
5983
5984
|
var textareaBaseClassName = "w-full rounded-radius-md border border-border bg-card px-md py-md text-base leading-6 shadow-[0px_1px_2px_rgba(0,0,0,0.1)] placeholder:text-[var(--muted-foreground)] focus-visible:border-border-focus focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-[rgba(161,161,161,0.5)] focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50";
|
|
5984
|
-
var AdsTextarea =
|
|
5985
|
+
var AdsTextarea = React55.forwardRef(
|
|
5985
5986
|
({
|
|
5986
5987
|
action,
|
|
5987
5988
|
className,
|
|
@@ -6000,12 +6001,12 @@ var AdsTextarea = React54.forwardRef(
|
|
|
6000
6001
|
helperText,
|
|
6001
6002
|
id
|
|
6002
6003
|
});
|
|
6003
|
-
const helperNode = helperText ? /* @__PURE__ */ (0,
|
|
6004
|
-
const errorNode = errorText ? /* @__PURE__ */ (0,
|
|
6005
|
-
return /* @__PURE__ */ (0,
|
|
6006
|
-
label ? /* @__PURE__ */ (0,
|
|
6004
|
+
const helperNode = helperText ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(AdsFieldDescription, { id: description.helperId, children: helperText }) : null;
|
|
6005
|
+
const errorNode = errorText ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(AdsFieldError, { id: description.errorId, children: errorText }) : null;
|
|
6006
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(AdsFieldItem, { children: [
|
|
6007
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(AdsFieldLabel, { htmlFor: description.inputId, children: label }) : null,
|
|
6007
6008
|
descriptionPlacement === "above" ? helperNode : null,
|
|
6008
|
-
/* @__PURE__ */ (0,
|
|
6009
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
6009
6010
|
Textarea,
|
|
6010
6011
|
{
|
|
6011
6012
|
"aria-describedby": description.describedBy,
|
|
@@ -6023,7 +6024,7 @@ var AdsTextarea = React54.forwardRef(
|
|
|
6023
6024
|
...props
|
|
6024
6025
|
}
|
|
6025
6026
|
),
|
|
6026
|
-
action ? /* @__PURE__ */ (0,
|
|
6027
|
+
action ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "w-full [&>*]:w-full", children: action }) : null,
|
|
6027
6028
|
descriptionPlacement === "below" ? helperNode : null,
|
|
6028
6029
|
errorNode
|
|
6029
6030
|
] });
|
|
@@ -6032,17 +6033,17 @@ var AdsTextarea = React54.forwardRef(
|
|
|
6032
6033
|
AdsTextarea.displayName = "AdsTextarea";
|
|
6033
6034
|
|
|
6034
6035
|
// src/components/AdsTooltip/index.tsx
|
|
6035
|
-
var
|
|
6036
|
+
var React57 = __toESM(require("react"), 1);
|
|
6036
6037
|
|
|
6037
6038
|
// src/primitives/tooltip.tsx
|
|
6038
|
-
var
|
|
6039
|
+
var React56 = __toESM(require("react"), 1);
|
|
6039
6040
|
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"), 1);
|
|
6040
|
-
var
|
|
6041
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
6041
6042
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
6042
6043
|
var Tooltip = TooltipPrimitive.Root;
|
|
6043
6044
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
6044
6045
|
var TooltipArrow = TooltipPrimitive.Arrow;
|
|
6045
|
-
var TooltipContent =
|
|
6046
|
+
var TooltipContent = React56.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(TooltipPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
6046
6047
|
TooltipPrimitive.Content,
|
|
6047
6048
|
{
|
|
6048
6049
|
className: cn(
|
|
@@ -6057,12 +6058,12 @@ var TooltipContent = React55.forwardRef(({ className, sideOffset = 4, ...props }
|
|
|
6057
6058
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
6058
6059
|
|
|
6059
6060
|
// src/components/AdsTooltip/index.tsx
|
|
6060
|
-
var
|
|
6061
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
6061
6062
|
var tooltipContentClassName = "z-50 rounded-[6px] border-0 bg-[#844fff] px-3 py-2 text-sm font-normal leading-5 text-[#fdfdfd] shadow-[0px_8px_24px_rgba(0,0,0,0.22)]";
|
|
6062
6063
|
var AdsTooltipProvider = TooltipProvider;
|
|
6063
6064
|
var AdsTooltip = Tooltip;
|
|
6064
6065
|
var AdsTooltipTrigger = TooltipTrigger;
|
|
6065
|
-
var AdsTooltipContent =
|
|
6066
|
+
var AdsTooltipContent = React57.forwardRef(({ align = "center", className, sideOffset = 10, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
6066
6067
|
TooltipContent,
|
|
6067
6068
|
{
|
|
6068
6069
|
align,
|
|
@@ -6073,7 +6074,7 @@ var AdsTooltipContent = React56.forwardRef(({ align = "center", className, sideO
|
|
|
6073
6074
|
}
|
|
6074
6075
|
));
|
|
6075
6076
|
AdsTooltipContent.displayName = "AdsTooltipContent";
|
|
6076
|
-
var AdsTooltipArrow =
|
|
6077
|
+
var AdsTooltipArrow = React57.forwardRef(({ className, height = 5, width = 10, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
6077
6078
|
TooltipArrow,
|
|
6078
6079
|
{
|
|
6079
6080
|
className: cn("fill-[#844fff]", className),
|
|
@@ -6086,16 +6087,16 @@ var AdsTooltipArrow = React56.forwardRef(({ className, height = 5, width = 10, .
|
|
|
6086
6087
|
AdsTooltipArrow.displayName = "AdsTooltipArrow";
|
|
6087
6088
|
|
|
6088
6089
|
// src/components/AdsToast/index.tsx
|
|
6089
|
-
var
|
|
6090
|
-
var
|
|
6090
|
+
var React58 = __toESM(require("react"), 1);
|
|
6091
|
+
var import_lucide_react16 = require("lucide-react");
|
|
6091
6092
|
var import_sonner = require("sonner");
|
|
6092
|
-
var
|
|
6093
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
6093
6094
|
var adsToastIconMap = {
|
|
6094
|
-
success:
|
|
6095
|
-
info:
|
|
6096
|
-
warning:
|
|
6097
|
-
error:
|
|
6098
|
-
loading:
|
|
6095
|
+
success: import_lucide_react16.CircleCheck,
|
|
6096
|
+
info: import_lucide_react16.Info,
|
|
6097
|
+
warning: import_lucide_react16.TriangleAlert,
|
|
6098
|
+
error: import_lucide_react16.OctagonX,
|
|
6099
|
+
loading: import_lucide_react16.LoaderCircle
|
|
6099
6100
|
};
|
|
6100
6101
|
function resolveToastIcon(intent, icon) {
|
|
6101
6102
|
if (icon) {
|
|
@@ -6105,7 +6106,7 @@ function resolveToastIcon(intent, icon) {
|
|
|
6105
6106
|
return null;
|
|
6106
6107
|
}
|
|
6107
6108
|
const Icon2 = adsToastIconMap[intent];
|
|
6108
|
-
return /* @__PURE__ */ (0,
|
|
6109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
6109
6110
|
Icon2,
|
|
6110
6111
|
{
|
|
6111
6112
|
"aria-hidden": true,
|
|
@@ -6118,7 +6119,7 @@ function resolveToastIcon(intent, icon) {
|
|
|
6118
6119
|
}
|
|
6119
6120
|
);
|
|
6120
6121
|
}
|
|
6121
|
-
var AdsToast =
|
|
6122
|
+
var AdsToast = React58.forwardRef(
|
|
6122
6123
|
({
|
|
6123
6124
|
action,
|
|
6124
6125
|
className,
|
|
@@ -6129,7 +6130,7 @@ var AdsToast = React57.forwardRef(
|
|
|
6129
6130
|
...props
|
|
6130
6131
|
}, ref) => {
|
|
6131
6132
|
const resolvedIcon = resolveToastIcon(intent, icon);
|
|
6132
|
-
return /* @__PURE__ */ (0,
|
|
6133
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
6133
6134
|
"div",
|
|
6134
6135
|
{
|
|
6135
6136
|
className: cn(
|
|
@@ -6144,8 +6145,8 @@ var AdsToast = React57.forwardRef(
|
|
|
6144
6145
|
...props,
|
|
6145
6146
|
children: [
|
|
6146
6147
|
resolvedIcon,
|
|
6147
|
-
/* @__PURE__ */ (0,
|
|
6148
|
-
/* @__PURE__ */ (0,
|
|
6148
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
|
|
6149
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
6149
6150
|
"p",
|
|
6150
6151
|
{
|
|
6151
6152
|
className: cn(
|
|
@@ -6155,7 +6156,7 @@ var AdsToast = React57.forwardRef(
|
|
|
6155
6156
|
children: title
|
|
6156
6157
|
}
|
|
6157
6158
|
),
|
|
6158
|
-
description ? /* @__PURE__ */ (0,
|
|
6159
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
6159
6160
|
"p",
|
|
6160
6161
|
{
|
|
6161
6162
|
className: cn(
|
|
@@ -6166,7 +6167,7 @@ var AdsToast = React57.forwardRef(
|
|
|
6166
6167
|
}
|
|
6167
6168
|
) : null
|
|
6168
6169
|
] }),
|
|
6169
|
-
action ? /* @__PURE__ */ (0,
|
|
6170
|
+
action ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
6170
6171
|
AdsButton,
|
|
6171
6172
|
{
|
|
6172
6173
|
className: "shrink-0 rounded-radius-lg",
|
|
@@ -6192,7 +6193,7 @@ function AdsToaster({
|
|
|
6192
6193
|
...props
|
|
6193
6194
|
}) {
|
|
6194
6195
|
const { messages } = useAdsI18n();
|
|
6195
|
-
return /* @__PURE__ */ (0,
|
|
6196
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
6196
6197
|
import_sonner.Toaster,
|
|
6197
6198
|
{
|
|
6198
6199
|
closeButton: false,
|
|
@@ -6210,7 +6211,7 @@ function AdsToaster({
|
|
|
6210
6211
|
);
|
|
6211
6212
|
}
|
|
6212
6213
|
function toStageNode(intent, title, options) {
|
|
6213
|
-
return /* @__PURE__ */ (0,
|
|
6214
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
6214
6215
|
AdsToast,
|
|
6215
6216
|
{
|
|
6216
6217
|
action: options?.action,
|
|
@@ -6224,7 +6225,7 @@ function toStageNode(intent, title, options) {
|
|
|
6224
6225
|
function showAdsToast(intent, title, options) {
|
|
6225
6226
|
const { action, description, icon, ...toastOptions } = options ?? {};
|
|
6226
6227
|
return import_sonner.toast.custom(
|
|
6227
|
-
(id) => /* @__PURE__ */ (0,
|
|
6228
|
+
(id) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
6228
6229
|
AdsToast,
|
|
6229
6230
|
{
|
|
6230
6231
|
action: action ? {
|
|
@@ -6278,17 +6279,17 @@ var AdsToastManager = Object.assign(
|
|
|
6278
6279
|
);
|
|
6279
6280
|
|
|
6280
6281
|
// src/components/AdsDialog/index.tsx
|
|
6281
|
-
var
|
|
6282
|
+
var React59 = __toESM(require("react"), 1);
|
|
6282
6283
|
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
6283
|
-
var
|
|
6284
|
-
var
|
|
6284
|
+
var import_lucide_react17 = require("lucide-react");
|
|
6285
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
6285
6286
|
var overlayClassName2 = "fixed inset-0 z-50 bg-black/80 backdrop-blur-[2px] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0";
|
|
6286
6287
|
var contentClassName2 = "fixed left-1/2 top-1/2 z-50 grid w-[calc(100%-2rem)] max-w-[423px] -translate-x-1/2 -translate-y-1/2 gap-lg rounded-radius-md border border-border bg-card p-xl shadow-[0px_4px_6px_-4px_rgba(0,0,0,0.1),0px_10px_15px_-3px_rgba(0,0,0,0.1)] duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]";
|
|
6287
6288
|
var closeButtonClassName = "absolute right-xl top-xl inline-flex h-6 w-6 items-center justify-center rounded-sm opacity-80 transition-opacity hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-card disabled:pointer-events-none";
|
|
6288
6289
|
var Dialog = DialogPrimitive.Root;
|
|
6289
6290
|
var DialogTrigger = DialogPrimitive.Trigger;
|
|
6290
6291
|
var DialogPortal = DialogPrimitive.Portal;
|
|
6291
|
-
var DialogOverlay =
|
|
6292
|
+
var DialogOverlay = React59.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
6292
6293
|
DialogPrimitive.Overlay,
|
|
6293
6294
|
{
|
|
6294
6295
|
className: cn(overlayClassName2, className),
|
|
@@ -6297,7 +6298,7 @@ var DialogOverlay = React58.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
6297
6298
|
}
|
|
6298
6299
|
));
|
|
6299
6300
|
DialogOverlay.displayName = "DialogOverlay";
|
|
6300
|
-
var DialogClose =
|
|
6301
|
+
var DialogClose = React59.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
6301
6302
|
DialogPrimitive.Close,
|
|
6302
6303
|
{
|
|
6303
6304
|
className: cn(
|
|
@@ -6309,13 +6310,13 @@ var DialogClose = React58.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
6309
6310
|
}
|
|
6310
6311
|
));
|
|
6311
6312
|
DialogClose.displayName = "DialogClose";
|
|
6312
|
-
var DialogContent =
|
|
6313
|
+
var DialogContent = React59.forwardRef(
|
|
6313
6314
|
({ children, className, closeLabel, hideCloseButton = false, ...props }, ref) => {
|
|
6314
6315
|
const { messages } = useAdsI18n();
|
|
6315
6316
|
const resolvedCloseLabel = closeLabel ?? messages.dialog.close;
|
|
6316
|
-
return /* @__PURE__ */ (0,
|
|
6317
|
-
/* @__PURE__ */ (0,
|
|
6318
|
-
/* @__PURE__ */ (0,
|
|
6317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(DialogPortal, { children: [
|
|
6318
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(DialogOverlay, {}),
|
|
6319
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
6319
6320
|
DialogPrimitive.Content,
|
|
6320
6321
|
{
|
|
6321
6322
|
className: cn(
|
|
@@ -6327,14 +6328,14 @@ var DialogContent = React58.forwardRef(
|
|
|
6327
6328
|
...props,
|
|
6328
6329
|
children: [
|
|
6329
6330
|
children,
|
|
6330
|
-
!hideCloseButton ? /* @__PURE__ */ (0,
|
|
6331
|
+
!hideCloseButton ? /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
6331
6332
|
DialogPrimitive.Close,
|
|
6332
6333
|
{
|
|
6333
6334
|
"aria-label": resolvedCloseLabel,
|
|
6334
6335
|
className: cn(closeButtonClassName, adsTextColorClassName.card),
|
|
6335
6336
|
children: [
|
|
6336
|
-
/* @__PURE__ */ (0,
|
|
6337
|
-
/* @__PURE__ */ (0,
|
|
6337
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_lucide_react17.X, { "aria-hidden": true, className: "h-4 w-4" }),
|
|
6338
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "sr-only", children: resolvedCloseLabel })
|
|
6338
6339
|
]
|
|
6339
6340
|
}
|
|
6340
6341
|
) : null
|
|
@@ -6345,8 +6346,8 @@ var DialogContent = React58.forwardRef(
|
|
|
6345
6346
|
}
|
|
6346
6347
|
);
|
|
6347
6348
|
DialogContent.displayName = "DialogContent";
|
|
6348
|
-
var DialogHeader =
|
|
6349
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
6349
|
+
var DialogHeader = React59.forwardRef(
|
|
6350
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
6350
6351
|
"div",
|
|
6351
6352
|
{
|
|
6352
6353
|
className: cn("flex flex-col gap-sm pr-8 text-left", className),
|
|
@@ -6356,8 +6357,8 @@ var DialogHeader = React58.forwardRef(
|
|
|
6356
6357
|
)
|
|
6357
6358
|
);
|
|
6358
6359
|
DialogHeader.displayName = "DialogHeader";
|
|
6359
|
-
var DialogFooter =
|
|
6360
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
6360
|
+
var DialogFooter = React59.forwardRef(
|
|
6361
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
6361
6362
|
"div",
|
|
6362
6363
|
{
|
|
6363
6364
|
className: cn(
|
|
@@ -6370,7 +6371,7 @@ var DialogFooter = React58.forwardRef(
|
|
|
6370
6371
|
)
|
|
6371
6372
|
);
|
|
6372
6373
|
DialogFooter.displayName = "DialogFooter";
|
|
6373
|
-
var DialogTitle =
|
|
6374
|
+
var DialogTitle = React59.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
6374
6375
|
DialogPrimitive.Title,
|
|
6375
6376
|
{
|
|
6376
6377
|
className: cn(
|
|
@@ -6383,7 +6384,7 @@ var DialogTitle = React58.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
6383
6384
|
}
|
|
6384
6385
|
));
|
|
6385
6386
|
DialogTitle.displayName = "DialogTitle";
|
|
6386
|
-
var DialogDescription =
|
|
6387
|
+
var DialogDescription = React59.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
6387
6388
|
DialogPrimitive.Description,
|
|
6388
6389
|
{
|
|
6389
6390
|
className: cn("text-sm leading-5", adsTextColorClassName.muted, className),
|
|
@@ -6403,6 +6404,105 @@ var AdsDialogFooter = DialogFooter;
|
|
|
6403
6404
|
var AdsDialogTitle = DialogTitle;
|
|
6404
6405
|
var AdsDialogDescription = DialogDescription;
|
|
6405
6406
|
|
|
6407
|
+
// src/components/AdsMasonry/index.tsx
|
|
6408
|
+
var import_masonic = require("masonic");
|
|
6409
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
6410
|
+
var DEFAULT_COLUMN_WIDTH = 240;
|
|
6411
|
+
var DEFAULT_GAP = 16;
|
|
6412
|
+
var DEFAULT_ITEM_HEIGHT_ESTIMATE = 280;
|
|
6413
|
+
var DEFAULT_LOADING_ITEM_COUNT = 8;
|
|
6414
|
+
var DEFAULT_MAX_COLUMN_COUNT = 4;
|
|
6415
|
+
var LOADING_HEIGHT_PATTERN = [220, 280, 240, 320, 260, 300];
|
|
6416
|
+
function AdsMasonry({
|
|
6417
|
+
items,
|
|
6418
|
+
renderItem,
|
|
6419
|
+
layoutKey,
|
|
6420
|
+
getItemKey,
|
|
6421
|
+
columnWidth = DEFAULT_COLUMN_WIDTH,
|
|
6422
|
+
maxColumnCount = DEFAULT_MAX_COLUMN_COUNT,
|
|
6423
|
+
gap = DEFAULT_GAP,
|
|
6424
|
+
itemHeightEstimate = DEFAULT_ITEM_HEIGHT_ESTIMATE,
|
|
6425
|
+
overscanBy,
|
|
6426
|
+
scrollFps,
|
|
6427
|
+
ssrWidth,
|
|
6428
|
+
ssrHeight,
|
|
6429
|
+
emptyState,
|
|
6430
|
+
loading = false,
|
|
6431
|
+
loadingItemCount = DEFAULT_LOADING_ITEM_COUNT,
|
|
6432
|
+
className,
|
|
6433
|
+
itemClassName,
|
|
6434
|
+
classNames,
|
|
6435
|
+
onRender
|
|
6436
|
+
}) {
|
|
6437
|
+
const rootClassName = cn("w-full", classNames?.root, className);
|
|
6438
|
+
if (loading) {
|
|
6439
|
+
const skeletonItems = Array.from(
|
|
6440
|
+
{ length: loadingItemCount },
|
|
6441
|
+
(_, index) => index
|
|
6442
|
+
);
|
|
6443
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6444
|
+
"div",
|
|
6445
|
+
{
|
|
6446
|
+
className: cn(
|
|
6447
|
+
"grid gap-4 sm:grid-cols-2 xl:grid-cols-3",
|
|
6448
|
+
rootClassName
|
|
6449
|
+
),
|
|
6450
|
+
"data-slot": "ads-masonry",
|
|
6451
|
+
children: skeletonItems.map((index) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6452
|
+
AdsSkeleton,
|
|
6453
|
+
{
|
|
6454
|
+
className: cn("w-full rounded-radius-lg", classNames?.skeleton),
|
|
6455
|
+
"data-slot": "ads-masonry-skeleton",
|
|
6456
|
+
"data-testid": "ads-masonry-skeleton",
|
|
6457
|
+
style: {
|
|
6458
|
+
height: `${LOADING_HEIGHT_PATTERN[index % LOADING_HEIGHT_PATTERN.length]}px`
|
|
6459
|
+
}
|
|
6460
|
+
},
|
|
6461
|
+
index
|
|
6462
|
+
))
|
|
6463
|
+
}
|
|
6464
|
+
);
|
|
6465
|
+
}
|
|
6466
|
+
if (items.length === 0) {
|
|
6467
|
+
return emptyState ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6468
|
+
"div",
|
|
6469
|
+
{
|
|
6470
|
+
className: cn(rootClassName, classNames?.empty),
|
|
6471
|
+
"data-slot": "ads-masonry-empty",
|
|
6472
|
+
children: emptyState
|
|
6473
|
+
}
|
|
6474
|
+
) : null;
|
|
6475
|
+
}
|
|
6476
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6477
|
+
import_masonic.Masonry,
|
|
6478
|
+
{
|
|
6479
|
+
className: rootClassName,
|
|
6480
|
+
columnGutter: gap,
|
|
6481
|
+
columnWidth,
|
|
6482
|
+
itemHeightEstimate,
|
|
6483
|
+
itemKey: getItemKey,
|
|
6484
|
+
items,
|
|
6485
|
+
maxColumnCount,
|
|
6486
|
+
onRender,
|
|
6487
|
+
overscanBy,
|
|
6488
|
+
render: ({ data, index, width }) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6489
|
+
"div",
|
|
6490
|
+
{
|
|
6491
|
+
className: cn("pb-0", classNames?.item, itemClassName),
|
|
6492
|
+
"data-slot": "ads-masonry-item",
|
|
6493
|
+
children: renderItem(data, { index, width })
|
|
6494
|
+
}
|
|
6495
|
+
),
|
|
6496
|
+
role: "list",
|
|
6497
|
+
rowGutter: gap,
|
|
6498
|
+
scrollFps,
|
|
6499
|
+
ssrHeight,
|
|
6500
|
+
ssrWidth
|
|
6501
|
+
},
|
|
6502
|
+
layoutKey
|
|
6503
|
+
);
|
|
6504
|
+
}
|
|
6505
|
+
|
|
6406
6506
|
// src/tokens/designTokens.ts
|
|
6407
6507
|
var designTokens = {
|
|
6408
6508
|
background: "#151619",
|
|
@@ -6544,6 +6644,7 @@ var designTokens = {
|
|
|
6544
6644
|
AdsInputOTPGroup,
|
|
6545
6645
|
AdsInputOTPSeparator,
|
|
6546
6646
|
AdsInputOTPSlot,
|
|
6647
|
+
AdsMasonry,
|
|
6547
6648
|
AdsPagination,
|
|
6548
6649
|
AdsPaginationContent,
|
|
6549
6650
|
AdsPaginationEllipsis,
|