@adsgency_npm/adsgency-ads-ui 0.1.0-alpha.20 → 0.1.0-alpha.22
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 +482 -230
- package/dist/index.d.cts +69 -8
- package/dist/index.d.ts +69 -8
- package/dist/index.js +453 -205
- package/package.json +3 -1
- package/dist/chunk-YJFQM6IB.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/tokens/designTokens.cjs.map +0 -1
- package/dist/tokens/designTokens.js.map +0 -1
- package/dist/tokens/tailwindPreset.cjs.map +0 -1
- package/dist/tokens/tailwindPreset.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -48,6 +48,7 @@ __export(src_exports, {
|
|
|
48
48
|
AdsAlertDialogTrigger: () => AdsAlertDialogTrigger,
|
|
49
49
|
AdsAlertTitle: () => AlertTitle2,
|
|
50
50
|
AdsBadge: () => AdsBadge,
|
|
51
|
+
AdsBarChart: () => AdsBarChart,
|
|
51
52
|
AdsBreadcrumb: () => AdsBreadcrumb,
|
|
52
53
|
AdsBreadcrumbEllipsis: () => AdsBreadcrumbEllipsis,
|
|
53
54
|
AdsBreadcrumbItem: () => AdsBreadcrumbItem,
|
|
@@ -124,6 +125,7 @@ __export(src_exports, {
|
|
|
124
125
|
AdsPopoverTitle: () => AdsPopoverTitle,
|
|
125
126
|
AdsPopoverTrigger: () => AdsPopoverTrigger,
|
|
126
127
|
AdsProgress: () => AdsProgress,
|
|
128
|
+
AdsRadialProgressChart: () => AdsRadialProgressChart,
|
|
127
129
|
AdsRadioGroup: () => AdsRadioGroup,
|
|
128
130
|
AdsRadioGroupCardOption: () => AdsRadioGroupCardOption,
|
|
129
131
|
AdsRadioGroupOption: () => AdsRadioGroupOption,
|
|
@@ -141,7 +143,9 @@ __export(src_exports, {
|
|
|
141
143
|
AdsSeparator: () => AdsSeparator,
|
|
142
144
|
AdsSkeleton: () => AdsSkeleton,
|
|
143
145
|
AdsSlider: () => AdsSlider,
|
|
146
|
+
AdsSparklineChart: () => AdsSparklineChart,
|
|
144
147
|
AdsSpinner: () => AdsSpinner,
|
|
148
|
+
AdsStackedBarChart: () => AdsStackedBarChart,
|
|
145
149
|
AdsSwitch: () => AdsSwitch,
|
|
146
150
|
AdsTable: () => AdsTable,
|
|
147
151
|
AdsTableBody: () => AdsTableBody,
|
|
@@ -219,7 +223,6 @@ var adsDefaultMessages = {
|
|
|
219
223
|
collapseRow: "Collapse row",
|
|
220
224
|
expandRow: "Expand row",
|
|
221
225
|
filterColumn: "Filter column",
|
|
222
|
-
loadingRows: "Loading table rows",
|
|
223
226
|
noDataAvailable: "No data available",
|
|
224
227
|
selectAllRows: "Select all rows",
|
|
225
228
|
selectRow: "Select row",
|
|
@@ -270,7 +273,6 @@ var adsDefaultMessages = {
|
|
|
270
273
|
collapseRow: "\u6536\u8D77\u884C",
|
|
271
274
|
expandRow: "\u5C55\u5F00\u884C",
|
|
272
275
|
filterColumn: "\u7B5B\u9009\u5217",
|
|
273
|
-
loadingRows: "\u6B63\u5728\u52A0\u8F7D\u8868\u683C\u884C",
|
|
274
276
|
noDataAvailable: "\u6682\u65E0\u6570\u636E",
|
|
275
277
|
selectAllRows: "\u9009\u62E9\u5168\u90E8\u884C",
|
|
276
278
|
selectRow: "\u9009\u62E9\u884C",
|
|
@@ -829,7 +831,7 @@ var adsTextColorClassName = {
|
|
|
829
831
|
// src/components/AdsAlertDialog/index.tsx
|
|
830
832
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
831
833
|
var overlayClassName = "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";
|
|
832
|
-
var contentClassName = "fixed left-1/2 top-1/2 z-50 grid w-[calc(100%-2rem)] max-w-[512px] -translate-x-1/2 -translate-y-1/2 gap-lg rounded-radius-lg border-
|
|
834
|
+
var contentClassName = "fixed left-1/2 top-1/2 z-50 grid w-[calc(100%-2rem)] max-w-[512px] -translate-x-1/2 -translate-y-1/2 gap-lg rounded-radius-lg 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%]";
|
|
833
835
|
var actionClassName = "inline-flex h-9 items-center justify-center rounded-radius-md border-0 bg-brand-gradient px-lg py-sm text-sm font-medium leading-5 tracking-normal shadow-[0px_1px_2px_rgba(0,0,0,0.1)] transition-opacity hover:opacity-90 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 disabled:opacity-[0.65]";
|
|
834
836
|
var cancelClassName = "inline-flex h-9 items-center justify-center rounded-radius-md border border-border bg-card px-lg py-sm text-sm font-medium leading-5 tracking-normal shadow-[0px_1px_2px_rgba(0,0,0,0.1)] transition-colors hover:bg-accent 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 disabled:opacity-[0.65]";
|
|
835
837
|
var AlertDialog = AlertDialogPrimitive.Root;
|
|
@@ -2806,7 +2808,6 @@ AdsSkeleton.displayName = "AdsSkeleton";
|
|
|
2806
2808
|
|
|
2807
2809
|
// src/components/AdsInput/index.tsx
|
|
2808
2810
|
var React30 = __toESM(require("react"), 1);
|
|
2809
|
-
var import_lucide_react10 = require("lucide-react");
|
|
2810
2811
|
|
|
2811
2812
|
// src/lib/adsClearButton.tsx
|
|
2812
2813
|
var React29 = __toESM(require("react"), 1);
|
|
@@ -2833,11 +2834,6 @@ var inputSizeClasses = {
|
|
|
2833
2834
|
md: "h-9 text-base leading-6",
|
|
2834
2835
|
lg: "h-10 text-base leading-6"
|
|
2835
2836
|
};
|
|
2836
|
-
var fileTriggerSizeClasses = {
|
|
2837
|
-
sm: "h-8 px-md py-sm",
|
|
2838
|
-
md: "h-9 px-lg py-sm",
|
|
2839
|
-
lg: "h-10 px-xl py-[10px]"
|
|
2840
|
-
};
|
|
2841
2837
|
function assignInputRef(ref, value) {
|
|
2842
2838
|
if (typeof ref === "function") {
|
|
2843
2839
|
ref(value);
|
|
@@ -2856,17 +2852,6 @@ function getTextInputValue(value) {
|
|
|
2856
2852
|
}
|
|
2857
2853
|
return "";
|
|
2858
2854
|
}
|
|
2859
|
-
function renderFileTriggerIcon(icon) {
|
|
2860
|
-
if (!icon) {
|
|
2861
|
-
return null;
|
|
2862
|
-
}
|
|
2863
|
-
if (React30.isValidElement(icon)) {
|
|
2864
|
-
return React30.cloneElement(icon, {
|
|
2865
|
-
className: cn("!h-4 !w-4 h-4 w-4", icon.props.className)
|
|
2866
|
-
});
|
|
2867
|
-
}
|
|
2868
|
-
return icon;
|
|
2869
|
-
}
|
|
2870
2855
|
function getInputSurfaceClassName({
|
|
2871
2856
|
className,
|
|
2872
2857
|
errorText,
|
|
@@ -2893,7 +2878,6 @@ var AdsInput = React30.forwardRef(
|
|
|
2893
2878
|
descriptionPlacement = "below",
|
|
2894
2879
|
emptyFileLabel,
|
|
2895
2880
|
errorText,
|
|
2896
|
-
fileTriggerIcon = /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react10.Upload, { "aria-hidden": true, className: "h-4 w-4" }),
|
|
2897
2881
|
fileTriggerLabel,
|
|
2898
2882
|
helperText,
|
|
2899
2883
|
id,
|
|
@@ -2934,7 +2918,6 @@ var AdsInput = React30.forwardRef(
|
|
|
2934
2918
|
});
|
|
2935
2919
|
const resolvedClearButtonLabel = clearButtonLabel ?? messages.input.clear;
|
|
2936
2920
|
const resolvedFileTriggerLabel = fileTriggerLabel ?? messages.input.chooseFile;
|
|
2937
|
-
const resolvedFileTriggerIcon = renderFileTriggerIcon(fileTriggerIcon);
|
|
2938
2921
|
const resolvedEmptyFileLabel = emptyFileLabel ?? messages.input.noFileChosen;
|
|
2939
2922
|
const handleChange = React30.useCallback(
|
|
2940
2923
|
(event) => {
|
|
@@ -2965,7 +2948,7 @@ var AdsInput = React30.forwardRef(
|
|
|
2965
2948
|
const fileNameText = selectedFiles.length > 0 ? selectedFiles.join(", ") : resolvedEmptyFileLabel;
|
|
2966
2949
|
const helperNode = helperText ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(AdsFieldDescription, { id: description.helperId, children: helperText }) : null;
|
|
2967
2950
|
const errorNode = errorText ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(AdsFieldError, { id: description.errorId, children: errorText }) : null;
|
|
2968
|
-
const inputNode = isFileInput ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "
|
|
2951
|
+
const inputNode = isFileInput ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "relative flex w-full min-w-0 flex-1 items-center", children: [
|
|
2969
2952
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2970
2953
|
Input,
|
|
2971
2954
|
{
|
|
@@ -2991,23 +2974,20 @@ var AdsInput = React30.forwardRef(
|
|
|
2991
2974
|
{
|
|
2992
2975
|
"aria-hidden": "true",
|
|
2993
2976
|
className: cn(
|
|
2994
|
-
|
|
2977
|
+
inputSurfaceClassName,
|
|
2978
|
+
adsTextColorClassName.card,
|
|
2979
|
+
"items-center text-sm leading-5",
|
|
2995
2980
|
props.disabled ? "cursor-not-allowed opacity-50" : void 0
|
|
2996
2981
|
),
|
|
2997
2982
|
children: [
|
|
2998
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.
|
|
2983
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2999
2984
|
"span",
|
|
3000
2985
|
{
|
|
3001
|
-
"data-ads-file-trigger": "",
|
|
3002
2986
|
className: cn(
|
|
3003
|
-
"
|
|
3004
|
-
|
|
3005
|
-
adsTextColorClassName.primary
|
|
2987
|
+
"shrink-0 pr-sm text-sm font-medium leading-5",
|
|
2988
|
+
adsTextColorClassName.card
|
|
3006
2989
|
),
|
|
3007
|
-
children:
|
|
3008
|
-
resolvedFileTriggerIcon ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "inline-flex h-4 w-4 items-center justify-center [&>svg]:!h-4 [&>svg]:!w-4", children: resolvedFileTriggerIcon }) : null,
|
|
3009
|
-
resolvedFileTriggerLabel
|
|
3010
|
-
]
|
|
2990
|
+
children: resolvedFileTriggerLabel
|
|
3011
2991
|
}
|
|
3012
2992
|
),
|
|
3013
2993
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
@@ -3298,7 +3278,7 @@ var React34 = __toESM(require("react"), 1);
|
|
|
3298
3278
|
// src/primitives/input-otp.tsx
|
|
3299
3279
|
var React33 = __toESM(require("react"), 1);
|
|
3300
3280
|
var import_input_otp = require("input-otp");
|
|
3301
|
-
var
|
|
3281
|
+
var import_lucide_react10 = require("lucide-react");
|
|
3302
3282
|
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
3303
3283
|
var InputOTP = React33.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3304
3284
|
import_input_otp.OTPInput,
|
|
@@ -3336,7 +3316,7 @@ var InputOTPSlot = React33.forwardRef(({ index, className, ...props }, ref) => {
|
|
|
3336
3316
|
);
|
|
3337
3317
|
});
|
|
3338
3318
|
InputOTPSlot.displayName = "InputOTPSlot";
|
|
3339
|
-
var InputOTPSeparator = React33.forwardRef(({ ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { ref, role: "separator", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3319
|
+
var InputOTPSeparator = React33.forwardRef(({ ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { ref, role: "separator", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react10.Dot, {}) }));
|
|
3340
3320
|
InputOTPSeparator.displayName = "InputOTPSeparator";
|
|
3341
3321
|
|
|
3342
3322
|
// src/components/AdsInputOTP/index.tsx
|
|
@@ -3464,11 +3444,11 @@ var React38 = __toESM(require("react"), 1);
|
|
|
3464
3444
|
|
|
3465
3445
|
// src/components/AdsPagination/index.tsx
|
|
3466
3446
|
var React36 = __toESM(require("react"), 1);
|
|
3467
|
-
var
|
|
3447
|
+
var import_lucide_react12 = require("lucide-react");
|
|
3468
3448
|
|
|
3469
3449
|
// src/primitives/pagination.tsx
|
|
3470
3450
|
var React35 = __toESM(require("react"), 1);
|
|
3471
|
-
var
|
|
3451
|
+
var import_lucide_react11 = require("lucide-react");
|
|
3472
3452
|
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
3473
3453
|
var Pagination = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3474
3454
|
"nav",
|
|
@@ -3522,7 +3502,7 @@ var PaginationPrevious = ({
|
|
|
3522
3502
|
className: cn("gap-1 pl-2.5", className),
|
|
3523
3503
|
...props,
|
|
3524
3504
|
children: [
|
|
3525
|
-
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3505
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react11.ChevronLeft, { className: "h-4 w-4" }),
|
|
3526
3506
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { children: "Previous" })
|
|
3527
3507
|
]
|
|
3528
3508
|
}
|
|
@@ -3540,7 +3520,7 @@ var PaginationNext = ({
|
|
|
3540
3520
|
...props,
|
|
3541
3521
|
children: [
|
|
3542
3522
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { children: "Next" }),
|
|
3543
|
-
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3523
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react11.ChevronRight, { className: "h-4 w-4" })
|
|
3544
3524
|
]
|
|
3545
3525
|
}
|
|
3546
3526
|
);
|
|
@@ -3555,7 +3535,7 @@ var PaginationEllipsis = ({
|
|
|
3555
3535
|
className: cn("flex h-9 w-9 items-center justify-center", className),
|
|
3556
3536
|
...props,
|
|
3557
3537
|
children: [
|
|
3558
|
-
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3538
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react11.MoreHorizontal, { className: "h-4 w-4" }),
|
|
3559
3539
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "sr-only", children: "More pages" })
|
|
3560
3540
|
]
|
|
3561
3541
|
}
|
|
@@ -3610,7 +3590,7 @@ var AdsPaginationPrevious = React36.forwardRef(({ "aria-label": ariaLabel, child
|
|
|
3610
3590
|
ref,
|
|
3611
3591
|
...props,
|
|
3612
3592
|
children: [
|
|
3613
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3593
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react12.ChevronLeft, { "aria-hidden": true, className: "h-4 w-4" }),
|
|
3614
3594
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { children: label })
|
|
3615
3595
|
]
|
|
3616
3596
|
}
|
|
@@ -3630,7 +3610,7 @@ var AdsPaginationNext = React36.forwardRef(
|
|
|
3630
3610
|
...props,
|
|
3631
3611
|
children: [
|
|
3632
3612
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { children: label }),
|
|
3633
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3613
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react12.ChevronRight, { "aria-hidden": true, className: "h-4 w-4" })
|
|
3634
3614
|
]
|
|
3635
3615
|
}
|
|
3636
3616
|
);
|
|
@@ -3654,7 +3634,7 @@ function AdsPaginationEllipsis({
|
|
|
3654
3634
|
),
|
|
3655
3635
|
...props,
|
|
3656
3636
|
children: [
|
|
3657
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3637
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react12.MoreHorizontal, { className: "h-4 w-4" }),
|
|
3658
3638
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "sr-only", children: resolvedLabel })
|
|
3659
3639
|
]
|
|
3660
3640
|
}
|
|
@@ -4186,7 +4166,7 @@ function AdsDataPagination({
|
|
|
4186
4166
|
|
|
4187
4167
|
// src/components/AdsDataTable/index.tsx
|
|
4188
4168
|
var React43 = __toESM(require("react"), 1);
|
|
4189
|
-
var
|
|
4169
|
+
var import_lucide_react15 = require("lucide-react");
|
|
4190
4170
|
|
|
4191
4171
|
// src/components/AdsEmpty/index.tsx
|
|
4192
4172
|
var import_class_variance_authority9 = require("class-variance-authority");
|
|
@@ -4293,7 +4273,7 @@ function AdsEmptyFooter({ className, ...props }) {
|
|
|
4293
4273
|
|
|
4294
4274
|
// src/components/AdsTable/index.tsx
|
|
4295
4275
|
var React42 = __toESM(require("react"), 1);
|
|
4296
|
-
var
|
|
4276
|
+
var import_lucide_react14 = require("lucide-react");
|
|
4297
4277
|
|
|
4298
4278
|
// src/components/AdsRadioGroup/index.tsx
|
|
4299
4279
|
var React40 = __toESM(require("react"), 1);
|
|
@@ -4301,7 +4281,7 @@ var React40 = __toESM(require("react"), 1);
|
|
|
4301
4281
|
// src/primitives/radio-group.tsx
|
|
4302
4282
|
var React39 = __toESM(require("react"), 1);
|
|
4303
4283
|
var RadioGroupPrimitive = __toESM(require("@radix-ui/react-radio-group"), 1);
|
|
4304
|
-
var
|
|
4284
|
+
var import_lucide_react13 = require("lucide-react");
|
|
4305
4285
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
4306
4286
|
var RadioGroup = React39.forwardRef(({ className, ...props }, ref) => {
|
|
4307
4287
|
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
@@ -4324,7 +4304,7 @@ var RadioGroupItem = React39.forwardRef(({ className, ...props }, ref) => {
|
|
|
4324
4304
|
className
|
|
4325
4305
|
),
|
|
4326
4306
|
...props,
|
|
4327
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(RadioGroupPrimitive.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4307
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(RadioGroupPrimitive.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react13.Circle, { className: "h-2.5 w-2.5 fill-current text-current" }) })
|
|
4328
4308
|
}
|
|
4329
4309
|
);
|
|
4330
4310
|
});
|
|
@@ -4728,7 +4708,7 @@ var AdsTableSortHeader = React42.forwardRef(
|
|
|
4728
4708
|
variant: "ghost",
|
|
4729
4709
|
children: [
|
|
4730
4710
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "truncate", children: title }),
|
|
4731
|
-
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "inline-flex h-4 w-4 items-center justify-center text-icon-muted", children: sortOrder === "ascend" ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4711
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "inline-flex h-4 w-4 items-center justify-center text-icon-muted", children: sortOrder === "ascend" ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react14.ChevronDown, { className: "h-4 w-4 rotate-180" }) : sortOrder === "descend" ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react14.ChevronDown, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react14.ChevronDown, { className: "h-4 w-4 opacity-60" }) })
|
|
4732
4712
|
]
|
|
4733
4713
|
}
|
|
4734
4714
|
) });
|
|
@@ -4792,7 +4772,7 @@ var AdsTableExpandCell = React42.forwardRef(
|
|
|
4792
4772
|
size: "sm",
|
|
4793
4773
|
type: "button",
|
|
4794
4774
|
variant: "ghost",
|
|
4795
|
-
children: expanded ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4775
|
+
children: expanded ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react14.ChevronDown, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react14.ChevronRight, { className: "h-4 w-4" })
|
|
4796
4776
|
}
|
|
4797
4777
|
) }) });
|
|
4798
4778
|
}
|
|
@@ -4805,33 +4785,18 @@ var SKELETON_ROW_COUNT = 4;
|
|
|
4805
4785
|
var FLEX_WIDTH_UNIT = 160;
|
|
4806
4786
|
var sizeClassNames = {
|
|
4807
4787
|
small: {
|
|
4808
|
-
bodyHeight: 32,
|
|
4809
4788
|
cell: "py-1.5 text-xs leading-4",
|
|
4810
|
-
headHeight: 32,
|
|
4811
4789
|
head: "h-8 py-1.5 text-xs leading-4"
|
|
4812
4790
|
},
|
|
4813
4791
|
middle: {
|
|
4814
|
-
bodyHeight: 40,
|
|
4815
4792
|
cell: "py-2 text-sm leading-5",
|
|
4816
|
-
headHeight: 40,
|
|
4817
4793
|
head: "h-10 py-2 text-sm leading-5"
|
|
4818
4794
|
},
|
|
4819
4795
|
large: {
|
|
4820
|
-
bodyHeight: 48,
|
|
4821
4796
|
cell: "py-3 text-base leading-6",
|
|
4822
|
-
headHeight: 48,
|
|
4823
4797
|
head: "h-12 py-3 text-base leading-6"
|
|
4824
4798
|
}
|
|
4825
4799
|
};
|
|
4826
|
-
function getSpinnerLoadingHeight(scrollY, density) {
|
|
4827
|
-
if (typeof scrollY === "number") {
|
|
4828
|
-
return Math.max(scrollY - density.headHeight, density.bodyHeight * SKELETON_ROW_COUNT);
|
|
4829
|
-
}
|
|
4830
|
-
if (typeof scrollY === "string") {
|
|
4831
|
-
return `max(calc(${scrollY} - ${density.headHeight}px), ${density.bodyHeight * SKELETON_ROW_COUNT}px)`;
|
|
4832
|
-
}
|
|
4833
|
-
return density.bodyHeight * SKELETON_ROW_COUNT;
|
|
4834
|
-
}
|
|
4835
4800
|
function getColumnKey(column, index) {
|
|
4836
4801
|
if (column.key !== void 0) {
|
|
4837
4802
|
return String(column.key);
|
|
@@ -5042,8 +5007,6 @@ function AdsDataTable({
|
|
|
5042
5007
|
dataSource = [],
|
|
5043
5008
|
rowKey,
|
|
5044
5009
|
loading = false,
|
|
5045
|
-
loadingVariant = "skeleton",
|
|
5046
|
-
expandedRowSurface = "inset",
|
|
5047
5010
|
emptyText,
|
|
5048
5011
|
emptyState,
|
|
5049
5012
|
rowClassName,
|
|
@@ -5142,14 +5105,8 @@ function AdsDataTable({
|
|
|
5142
5105
|
const hasSelectionColumn = Boolean(rowSelection);
|
|
5143
5106
|
const hasExpandableColumn = Boolean(expandable?.expandedRowRender);
|
|
5144
5107
|
const density = sizeClassNames[size];
|
|
5145
|
-
const columnCount = resolvedColumns.length + Number(hasSelectionColumn) + Number(hasExpandableColumn);
|
|
5146
5108
|
const paginationMode = pagination === false ? "client" : pagination.mode ?? "client";
|
|
5147
5109
|
const allowsRowSelectionByClick = Boolean(rowSelection) && !suppressRowClickSelection;
|
|
5148
|
-
const spinnerLoadingHeight = React43.useMemo(
|
|
5149
|
-
() => getSpinnerLoadingHeight(scroll?.y, density),
|
|
5150
|
-
[density, scroll?.y]
|
|
5151
|
-
);
|
|
5152
|
-
const expandedRowContentClassName = expandedRowSurface === "plain" ? "bg-transparent p-4" : expandedRowSurface === "subtle" ? "mx-6 my-4 rounded-[20px] border border-border bg-transparent p-4" : "border-t border-border bg-popover/40 p-4";
|
|
5153
5110
|
const filterValues = React43.useMemo(
|
|
5154
5111
|
() => resolvedColumns.reduce((accumulator, column, index) => {
|
|
5155
5112
|
const columnKey = getColumnKey(column, index);
|
|
@@ -5408,7 +5365,7 @@ function AdsDataTable({
|
|
|
5408
5365
|
variant: "ghost",
|
|
5409
5366
|
children: [
|
|
5410
5367
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "truncate", children: headerTitle }),
|
|
5411
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "inline-flex h-4 w-4 items-center justify-center text-icon-muted", children: columnSortOrder === "ascend" ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5368
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "inline-flex h-4 w-4 items-center justify-center text-icon-muted", children: columnSortOrder === "ascend" ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react15.ChevronDown, { className: "h-4 w-4 rotate-180" }) : columnSortOrder === "descend" ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react15.ChevronDown, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react15.ChevronDown, { className: "h-4 w-4 opacity-60" }) })
|
|
5412
5369
|
]
|
|
5413
5370
|
}
|
|
5414
5371
|
) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "truncate", children: headerTitle }),
|
|
@@ -5425,7 +5382,7 @@ function AdsDataTable({
|
|
|
5425
5382
|
size: "sm",
|
|
5426
5383
|
type: "button",
|
|
5427
5384
|
variant: "ghost",
|
|
5428
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5385
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react15.Filter, { className: "h-3.5 w-3.5" })
|
|
5429
5386
|
}
|
|
5430
5387
|
) }),
|
|
5431
5388
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AdsPopoverContent, { align: "end", className: "w-64", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
@@ -5505,26 +5462,7 @@ function AdsDataTable({
|
|
|
5505
5462
|
);
|
|
5506
5463
|
})
|
|
5507
5464
|
] }) }),
|
|
5508
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AdsTableBody, { children: loading
|
|
5509
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AdsTableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5510
|
-
AdsTableCell,
|
|
5511
|
-
{
|
|
5512
|
-
className: "p-0",
|
|
5513
|
-
colSpan: columnCount,
|
|
5514
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5515
|
-
"div",
|
|
5516
|
-
{
|
|
5517
|
-
"aria-label": messages.table.loadingRows,
|
|
5518
|
-
"aria-live": "polite",
|
|
5519
|
-
className: "flex items-center justify-center px-6 py-8 text-foreground",
|
|
5520
|
-
role: "status",
|
|
5521
|
-
style: { minHeight: spinnerLoadingHeight },
|
|
5522
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AdsSpinner, { size: "lg", tone: "foreground" })
|
|
5523
|
-
}
|
|
5524
|
-
)
|
|
5525
|
-
}
|
|
5526
|
-
) }, "spinner-row")
|
|
5527
|
-
] : loading ? Array.from({ length: SKELETON_ROW_COUNT }, (_, skeletonIndex) => /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(AdsTableRow, { children: [
|
|
5465
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AdsTableBody, { children: loading ? Array.from({ length: SKELETON_ROW_COUNT }, (_, skeletonIndex) => /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(AdsTableRow, { children: [
|
|
5528
5466
|
hasSelectionColumn ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AdsTableCell, { className: "w-12 p-2", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AdsSkeleton, { className: "h-4 w-4 rounded-[4px]" }) }) : null,
|
|
5529
5467
|
hasExpandableColumn ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AdsTableCell, { className: "w-12 p-2", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AdsSkeleton, { className: "h-4 w-4 rounded-[4px]" }) }) : null,
|
|
5530
5468
|
resolvedColumns.map((column, index) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
@@ -5627,7 +5565,7 @@ function AdsDataTable({
|
|
|
5627
5565
|
"div",
|
|
5628
5566
|
{
|
|
5629
5567
|
className: cn(
|
|
5630
|
-
|
|
5568
|
+
"border-t border-border bg-popover/40 p-4",
|
|
5631
5569
|
classNames?.expandedRowContent
|
|
5632
5570
|
),
|
|
5633
5571
|
children: expandable?.expandedRowRender?.(record, index)
|
|
@@ -5640,7 +5578,7 @@ function AdsDataTable({
|
|
|
5640
5578
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AdsTableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5641
5579
|
AdsTableCell,
|
|
5642
5580
|
{
|
|
5643
|
-
colSpan:
|
|
5581
|
+
colSpan: resolvedColumns.length + Number(hasSelectionColumn) + Number(hasExpandableColumn),
|
|
5644
5582
|
className: cn("p-0", classNames?.emptyRowCell),
|
|
5645
5583
|
children: renderedEmptyState
|
|
5646
5584
|
}
|
|
@@ -5908,14 +5846,324 @@ var AdsProgress = React45.forwardRef(
|
|
|
5908
5846
|
);
|
|
5909
5847
|
AdsProgress.displayName = "AdsProgress";
|
|
5910
5848
|
|
|
5911
|
-
// src/components/
|
|
5849
|
+
// src/components/AdsRadialProgressChart/index.tsx
|
|
5850
|
+
var import_recharts2 = require("recharts");
|
|
5851
|
+
|
|
5852
|
+
// src/primitives/chart.tsx
|
|
5853
|
+
var React46 = __toESM(require("react"), 1);
|
|
5854
|
+
var import_recharts = require("recharts");
|
|
5855
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
5856
|
+
var chartContext = React46.createContext(null);
|
|
5857
|
+
var ChartContainer = React46.forwardRef(
|
|
5858
|
+
({ children, className, config, height = 240, style, ...props }, ref) => {
|
|
5859
|
+
const chartStyle = Object.entries(config).reduce((variables, [key, item]) => {
|
|
5860
|
+
if (item.color) {
|
|
5861
|
+
variables[`--color-${key}`] = item.color;
|
|
5862
|
+
}
|
|
5863
|
+
return variables;
|
|
5864
|
+
}, {});
|
|
5865
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(chartContext.Provider, { value: config, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
5866
|
+
"div",
|
|
5867
|
+
{
|
|
5868
|
+
className: cn("relative w-full text-xs", className),
|
|
5869
|
+
"data-slot": "chart",
|
|
5870
|
+
ref,
|
|
5871
|
+
style: { height, ...chartStyle, ...style },
|
|
5872
|
+
...props,
|
|
5873
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_recharts.ResponsiveContainer, { height: "100%", width: "100%", children })
|
|
5874
|
+
}
|
|
5875
|
+
) });
|
|
5876
|
+
}
|
|
5877
|
+
);
|
|
5878
|
+
ChartContainer.displayName = "ChartContainer";
|
|
5879
|
+
|
|
5880
|
+
// src/components/AdsRadialProgressChart/index.tsx
|
|
5881
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
5882
|
+
var DEFAULT_SIZE = 160;
|
|
5883
|
+
var DEFAULT_STROKE_WIDTH = 14;
|
|
5884
|
+
function clamp(value, min, max) {
|
|
5885
|
+
return Math.min(Math.max(value, min), max);
|
|
5886
|
+
}
|
|
5887
|
+
function AdsRadialProgressChart({
|
|
5888
|
+
ariaLabel,
|
|
5889
|
+
className,
|
|
5890
|
+
color = "var(--primary)",
|
|
5891
|
+
label,
|
|
5892
|
+
max = 100,
|
|
5893
|
+
size = DEFAULT_SIZE,
|
|
5894
|
+
strokeWidth = DEFAULT_STROKE_WIDTH,
|
|
5895
|
+
trackColor = "color-mix(in srgb, var(--primary) 20%, transparent)",
|
|
5896
|
+
value
|
|
5897
|
+
}) {
|
|
5898
|
+
const safeMax = Number.isFinite(max) && max > 0 ? max : 0;
|
|
5899
|
+
const safeValue = Number.isFinite(value) && safeMax > 0 ? clamp(value, 0, safeMax) : 0;
|
|
5900
|
+
const percentage = safeMax > 0 ? Math.round(safeValue / safeMax * 100) : 0;
|
|
5901
|
+
const safeSize = Number.isFinite(size) && size > 0 ? size : DEFAULT_SIZE;
|
|
5902
|
+
const safeStrokeWidth = clamp(
|
|
5903
|
+
Number.isFinite(strokeWidth) && strokeWidth > 0 ? strokeWidth : DEFAULT_STROKE_WIDTH,
|
|
5904
|
+
1,
|
|
5905
|
+
safeSize / 2
|
|
5906
|
+
);
|
|
5907
|
+
const chartData = [{ value: safeValue }];
|
|
5908
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
5909
|
+
"div",
|
|
5910
|
+
{
|
|
5911
|
+
"aria-label": ariaLabel ?? `${percentage}%`,
|
|
5912
|
+
className: cn(
|
|
5913
|
+
"relative inline-grid size-[var(--ads-radial-chart-size)] place-items-center",
|
|
5914
|
+
className
|
|
5915
|
+
),
|
|
5916
|
+
"data-testid": "ads-radial-progress-chart",
|
|
5917
|
+
role: "img",
|
|
5918
|
+
style: { "--ads-radial-chart-size": `${safeSize}px` },
|
|
5919
|
+
children: [
|
|
5920
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
5921
|
+
ChartContainer,
|
|
5922
|
+
{
|
|
5923
|
+
"aria-hidden": "true",
|
|
5924
|
+
className: "absolute inset-0",
|
|
5925
|
+
config: { value: { color } },
|
|
5926
|
+
height: "100%",
|
|
5927
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
5928
|
+
import_recharts2.RadialBarChart,
|
|
5929
|
+
{
|
|
5930
|
+
accessibilityLayer: true,
|
|
5931
|
+
data: chartData,
|
|
5932
|
+
endAngle: -270,
|
|
5933
|
+
innerRadius: safeSize / 2 - safeStrokeWidth,
|
|
5934
|
+
outerRadius: safeSize / 2,
|
|
5935
|
+
startAngle: 90,
|
|
5936
|
+
children: [
|
|
5937
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
5938
|
+
import_recharts2.PolarAngleAxis,
|
|
5939
|
+
{
|
|
5940
|
+
axisLine: false,
|
|
5941
|
+
dataKey: "value",
|
|
5942
|
+
domain: [0, Math.max(safeMax, 1)],
|
|
5943
|
+
tick: false,
|
|
5944
|
+
type: "number"
|
|
5945
|
+
}
|
|
5946
|
+
),
|
|
5947
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
5948
|
+
import_recharts2.RadialBar,
|
|
5949
|
+
{
|
|
5950
|
+
background: { fill: trackColor },
|
|
5951
|
+
cornerRadius: safeStrokeWidth / 2,
|
|
5952
|
+
dataKey: "value",
|
|
5953
|
+
fill: "var(--color-value)",
|
|
5954
|
+
isAnimationActive: false
|
|
5955
|
+
}
|
|
5956
|
+
)
|
|
5957
|
+
]
|
|
5958
|
+
}
|
|
5959
|
+
)
|
|
5960
|
+
}
|
|
5961
|
+
),
|
|
5962
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "pointer-events-none absolute inset-0 flex items-center justify-center text-center", children: label ?? `${percentage}%` })
|
|
5963
|
+
]
|
|
5964
|
+
}
|
|
5965
|
+
);
|
|
5966
|
+
}
|
|
5967
|
+
|
|
5968
|
+
// src/components/AdsSparklineChart/index.tsx
|
|
5969
|
+
var import_recharts3 = require("recharts");
|
|
5970
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
5971
|
+
var DEFAULT_HEIGHT = 40;
|
|
5972
|
+
function getSafeHeight(height) {
|
|
5973
|
+
return Number.isFinite(height) && height && height > 0 ? height : DEFAULT_HEIGHT;
|
|
5974
|
+
}
|
|
5975
|
+
function getSafeValue(value) {
|
|
5976
|
+
return typeof value === "number" && Number.isFinite(value) ? Math.max(value, 0) : 0;
|
|
5977
|
+
}
|
|
5978
|
+
function AdsSparklineChart({
|
|
5979
|
+
ariaLabel,
|
|
5980
|
+
className,
|
|
5981
|
+
color = "var(--chart-1)",
|
|
5982
|
+
data,
|
|
5983
|
+
dataKey,
|
|
5984
|
+
height,
|
|
5985
|
+
xKey
|
|
5986
|
+
}) {
|
|
5987
|
+
const chartData = data.map((datum) => ({
|
|
5988
|
+
...datum,
|
|
5989
|
+
[xKey]: datum[xKey],
|
|
5990
|
+
[dataKey]: getSafeValue(datum[dataKey])
|
|
5991
|
+
}));
|
|
5992
|
+
const safeHeight = getSafeHeight(height);
|
|
5993
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5994
|
+
"div",
|
|
5995
|
+
{
|
|
5996
|
+
"aria-label": ariaLabel ?? "Trend chart",
|
|
5997
|
+
className: cn("w-full", className),
|
|
5998
|
+
"data-testid": "ads-sparkline-chart",
|
|
5999
|
+
role: "img",
|
|
6000
|
+
style: { height: safeHeight },
|
|
6001
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
6002
|
+
ChartContainer,
|
|
6003
|
+
{
|
|
6004
|
+
"aria-hidden": "true",
|
|
6005
|
+
className: "h-full",
|
|
6006
|
+
config: { value: { color } },
|
|
6007
|
+
height: "100%",
|
|
6008
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_recharts3.LineChart, { data: chartData, margin: { bottom: 1, left: 1, right: 1, top: 1 }, children: [
|
|
6009
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_recharts3.XAxis, { dataKey: xKey, hide: true, type: "category" }),
|
|
6010
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
6011
|
+
import_recharts3.Line,
|
|
6012
|
+
{
|
|
6013
|
+
activeDot: false,
|
|
6014
|
+
dataKey,
|
|
6015
|
+
dot: false,
|
|
6016
|
+
isAnimationActive: false,
|
|
6017
|
+
stroke: "var(--color-value)",
|
|
6018
|
+
strokeWidth: 2,
|
|
6019
|
+
type: "monotone"
|
|
6020
|
+
}
|
|
6021
|
+
)
|
|
6022
|
+
] })
|
|
6023
|
+
}
|
|
6024
|
+
)
|
|
6025
|
+
}
|
|
6026
|
+
);
|
|
6027
|
+
}
|
|
6028
|
+
|
|
6029
|
+
// src/components/AdsStackedBarChart/index.tsx
|
|
5912
6030
|
var React47 = __toESM(require("react"), 1);
|
|
6031
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
6032
|
+
var DEFAULT_HEIGHT2 = 20;
|
|
6033
|
+
var DEFAULT_SEGMENT_COLOR = "var(--chart-1)";
|
|
6034
|
+
function getSafeHeight2(height) {
|
|
6035
|
+
return Number.isFinite(height) && height && height > 0 ? height : DEFAULT_HEIGHT2;
|
|
6036
|
+
}
|
|
6037
|
+
function formatPercentage(percentage) {
|
|
6038
|
+
return `${Number(percentage.toFixed(2))}%`;
|
|
6039
|
+
}
|
|
6040
|
+
function AdsStackedBarChart({
|
|
6041
|
+
ariaLabel,
|
|
6042
|
+
className,
|
|
6043
|
+
height,
|
|
6044
|
+
segments
|
|
6045
|
+
}) {
|
|
6046
|
+
const descriptionId = React47.useId();
|
|
6047
|
+
const validSegments = segments.reduce((items, segment, index) => {
|
|
6048
|
+
const value = Number.isFinite(segment.value) ? Math.max(segment.value, 0) : 0;
|
|
6049
|
+
if (value > 0) {
|
|
6050
|
+
items.push({
|
|
6051
|
+
color: segment.color ?? DEFAULT_SEGMENT_COLOR,
|
|
6052
|
+
label: segment.label ?? `Segment ${index + 1}`,
|
|
6053
|
+
value
|
|
6054
|
+
});
|
|
6055
|
+
}
|
|
6056
|
+
return items;
|
|
6057
|
+
}, []);
|
|
6058
|
+
const normalizationBase = validSegments.reduce(
|
|
6059
|
+
(maximum, segment) => Math.max(maximum, segment.value),
|
|
6060
|
+
0
|
|
6061
|
+
);
|
|
6062
|
+
const normalizedTotal = normalizationBase > 0 ? validSegments.reduce((sum, segment) => sum + segment.value / normalizationBase, 0) : 0;
|
|
6063
|
+
const hasData = normalizedTotal > 0 && Number.isFinite(normalizedTotal);
|
|
6064
|
+
const getPercentage = (value) => value / normalizationBase / normalizedTotal * 100;
|
|
6065
|
+
const summary = hasData ? validSegments.map((segment) => `${segment.label}: ${formatPercentage(getPercentage(segment.value))}`).join(", ") : "No data";
|
|
6066
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
6067
|
+
"div",
|
|
6068
|
+
{
|
|
6069
|
+
"aria-label": ariaLabel ?? summary,
|
|
6070
|
+
"aria-describedby": ariaLabel ? descriptionId : void 0,
|
|
6071
|
+
className: cn("overflow-hidden rounded-full bg-muted", className),
|
|
6072
|
+
"data-testid": "ads-stacked-bar-chart",
|
|
6073
|
+
role: "img",
|
|
6074
|
+
style: { height: getSafeHeight2(height) },
|
|
6075
|
+
children: [
|
|
6076
|
+
ariaLabel && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "sr-only", id: descriptionId, children: summary }),
|
|
6077
|
+
hasData && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { "aria-hidden": "true", className: "flex size-full", children: validSegments.map((segment, index) => {
|
|
6078
|
+
const percentage = getPercentage(segment.value);
|
|
6079
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
6080
|
+
"div",
|
|
6081
|
+
{
|
|
6082
|
+
"data-testid": "ads-stacked-bar-chart-segment",
|
|
6083
|
+
style: { backgroundColor: segment.color, width: `${percentage}%` }
|
|
6084
|
+
},
|
|
6085
|
+
`${segment.label}-${index}`
|
|
6086
|
+
);
|
|
6087
|
+
}) })
|
|
6088
|
+
]
|
|
6089
|
+
}
|
|
6090
|
+
);
|
|
6091
|
+
}
|
|
6092
|
+
|
|
6093
|
+
// src/components/AdsBarChart/index.tsx
|
|
6094
|
+
var import_recharts4 = require("recharts");
|
|
6095
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
6096
|
+
var DEFAULT_HEIGHT3 = 160;
|
|
6097
|
+
var DEFAULT_HIGHLIGHT_COLOR = "var(--chart-2)";
|
|
6098
|
+
var DEFAULT_RADIUS = 4;
|
|
6099
|
+
function getSafeHeight3(height) {
|
|
6100
|
+
return Number.isFinite(height) && height && height > 0 ? height : DEFAULT_HEIGHT3;
|
|
6101
|
+
}
|
|
6102
|
+
function getSafeRadius(radius) {
|
|
6103
|
+
return Number.isFinite(radius) && radius !== void 0 && radius >= 0 ? radius : DEFAULT_RADIUS;
|
|
6104
|
+
}
|
|
6105
|
+
function getSafeValue2(value) {
|
|
6106
|
+
return typeof value === "number" && Number.isFinite(value) ? Math.max(value, 0) : 0;
|
|
6107
|
+
}
|
|
6108
|
+
function AdsBarChart({
|
|
6109
|
+
ariaLabel,
|
|
6110
|
+
barRadius,
|
|
6111
|
+
className,
|
|
6112
|
+
color = "var(--chart-1)",
|
|
6113
|
+
data,
|
|
6114
|
+
dataKey,
|
|
6115
|
+
height,
|
|
6116
|
+
highlightColor,
|
|
6117
|
+
highlightIndex,
|
|
6118
|
+
xKey
|
|
6119
|
+
}) {
|
|
6120
|
+
const chartData = data.map((datum) => ({
|
|
6121
|
+
...datum,
|
|
6122
|
+
[xKey]: datum[xKey],
|
|
6123
|
+
[dataKey]: getSafeValue2(datum[dataKey])
|
|
6124
|
+
}));
|
|
6125
|
+
const safeHeight = getSafeHeight3(height);
|
|
6126
|
+
const safeRadius = getSafeRadius(barRadius);
|
|
6127
|
+
const safeHighlightIndex = Number.isInteger(highlightIndex) ? highlightIndex : -1;
|
|
6128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
6129
|
+
"div",
|
|
6130
|
+
{
|
|
6131
|
+
"aria-label": ariaLabel ?? "Bar chart",
|
|
6132
|
+
className: cn("w-full", className),
|
|
6133
|
+
"data-testid": "ads-bar-chart",
|
|
6134
|
+
role: "img",
|
|
6135
|
+
style: { height: safeHeight },
|
|
6136
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
6137
|
+
ChartContainer,
|
|
6138
|
+
{
|
|
6139
|
+
"aria-hidden": "true",
|
|
6140
|
+
className: "h-full",
|
|
6141
|
+
config: { value: { color } },
|
|
6142
|
+
height: "100%",
|
|
6143
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_recharts4.BarChart, { data: chartData, margin: { bottom: 0, left: 0, right: 0, top: 0 }, children: [
|
|
6144
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_recharts4.XAxis, { dataKey: xKey, hide: true, type: "category" }),
|
|
6145
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_recharts4.Bar, { dataKey, fill: "var(--color-value)", isAnimationActive: false, radius: safeRadius, children: chartData.map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
6146
|
+
import_recharts4.Cell,
|
|
6147
|
+
{
|
|
6148
|
+
fill: index === safeHighlightIndex ? highlightColor ?? DEFAULT_HIGHLIGHT_COLOR : "var(--color-value)"
|
|
6149
|
+
},
|
|
6150
|
+
index
|
|
6151
|
+
)) })
|
|
6152
|
+
] })
|
|
6153
|
+
}
|
|
6154
|
+
)
|
|
6155
|
+
}
|
|
6156
|
+
);
|
|
6157
|
+
}
|
|
6158
|
+
|
|
6159
|
+
// src/components/AdsSlider/index.tsx
|
|
6160
|
+
var React49 = __toESM(require("react"), 1);
|
|
5913
6161
|
|
|
5914
6162
|
// src/primitives/slider.tsx
|
|
5915
|
-
var
|
|
6163
|
+
var React48 = __toESM(require("react"), 1);
|
|
5916
6164
|
var SliderPrimitive = __toESM(require("@radix-ui/react-slider"), 1);
|
|
5917
|
-
var
|
|
5918
|
-
var Slider =
|
|
6165
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
6166
|
+
var Slider = React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
5919
6167
|
SliderPrimitive.Root,
|
|
5920
6168
|
{
|
|
5921
6169
|
ref,
|
|
@@ -5925,10 +6173,10 @@ var Slider = React46.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
5925
6173
|
),
|
|
5926
6174
|
...props,
|
|
5927
6175
|
children: [
|
|
5928
|
-
/* @__PURE__ */ (0,
|
|
6176
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(SliderPrimitive.Track, { className: "relative h-1.5 w-full grow overflow-hidden rounded-full bg-secondary", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(SliderPrimitive.Range, { className: "absolute h-full bg-primary" }) }),
|
|
5929
6177
|
Array.from({
|
|
5930
6178
|
length: Array.isArray(props.value) ? props.value.length : Array.isArray(props.defaultValue) ? props.defaultValue.length : 1
|
|
5931
|
-
}).map((_, index) => /* @__PURE__ */ (0,
|
|
6179
|
+
}).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5932
6180
|
SliderPrimitive.Thumb,
|
|
5933
6181
|
{
|
|
5934
6182
|
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"
|
|
@@ -5941,11 +6189,11 @@ var Slider = React46.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
5941
6189
|
Slider.displayName = SliderPrimitive.Root.displayName;
|
|
5942
6190
|
|
|
5943
6191
|
// src/components/AdsSlider/index.tsx
|
|
5944
|
-
var
|
|
6192
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
5945
6193
|
var sliderBaseClassName = "py-1";
|
|
5946
|
-
var Slider2 =
|
|
6194
|
+
var Slider2 = React49.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Slider, { className: cn(sliderBaseClassName, className), ref, ...props }));
|
|
5947
6195
|
Slider2.displayName = "Slider";
|
|
5948
|
-
var AdsSlider =
|
|
6196
|
+
var AdsSlider = React49.forwardRef(
|
|
5949
6197
|
({
|
|
5950
6198
|
className,
|
|
5951
6199
|
descriptionPlacement = "above",
|
|
@@ -5960,12 +6208,12 @@ var AdsSlider = React47.forwardRef(
|
|
|
5960
6208
|
helperText,
|
|
5961
6209
|
id
|
|
5962
6210
|
});
|
|
5963
|
-
const helperNode = helperText ? /* @__PURE__ */ (0,
|
|
5964
|
-
const errorNode = errorText ? /* @__PURE__ */ (0,
|
|
5965
|
-
return /* @__PURE__ */ (0,
|
|
5966
|
-
label ? /* @__PURE__ */ (0,
|
|
6211
|
+
const helperNode = helperText ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(AdsFieldDescription, { id: description.helperId, children: helperText }) : null;
|
|
6212
|
+
const errorNode = errorText ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(AdsFieldError, { id: description.errorId, children: errorText }) : null;
|
|
6213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(AdsFieldItem, { children: [
|
|
6214
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(AdsFieldLabel, { children: label }) : null,
|
|
5967
6215
|
descriptionPlacement === "above" ? helperNode : null,
|
|
5968
|
-
/* @__PURE__ */ (0,
|
|
6216
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
5969
6217
|
Slider2,
|
|
5970
6218
|
{
|
|
5971
6219
|
"aria-describedby": description.describedBy,
|
|
@@ -5982,13 +6230,13 @@ var AdsSlider = React47.forwardRef(
|
|
|
5982
6230
|
AdsSlider.displayName = "AdsSlider";
|
|
5983
6231
|
|
|
5984
6232
|
// src/components/AdsSwitch/index.tsx
|
|
5985
|
-
var
|
|
6233
|
+
var React51 = __toESM(require("react"), 1);
|
|
5986
6234
|
|
|
5987
6235
|
// src/primitives/switch.tsx
|
|
5988
|
-
var
|
|
6236
|
+
var React50 = __toESM(require("react"), 1);
|
|
5989
6237
|
var SwitchPrimitives = __toESM(require("@radix-ui/react-switch"), 1);
|
|
5990
|
-
var
|
|
5991
|
-
var Switch =
|
|
6238
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
6239
|
+
var Switch = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
5992
6240
|
SwitchPrimitives.Root,
|
|
5993
6241
|
{
|
|
5994
6242
|
className: cn(
|
|
@@ -5997,7 +6245,7 @@ var Switch = React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
5997
6245
|
),
|
|
5998
6246
|
...props,
|
|
5999
6247
|
ref,
|
|
6000
|
-
children: /* @__PURE__ */ (0,
|
|
6248
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
6001
6249
|
SwitchPrimitives.Thumb,
|
|
6002
6250
|
{
|
|
6003
6251
|
className: cn(
|
|
@@ -6010,15 +6258,15 @@ var Switch = React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
6010
6258
|
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
6011
6259
|
|
|
6012
6260
|
// src/components/AdsSwitch/index.tsx
|
|
6013
|
-
var
|
|
6261
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
6014
6262
|
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";
|
|
6015
|
-
var Switch2 =
|
|
6263
|
+
var Switch2 = React51.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Switch, { className: cn(switchBaseClassName, className), ref, ...props }));
|
|
6016
6264
|
Switch2.displayName = "Switch";
|
|
6017
|
-
var AdsSwitch =
|
|
6018
|
-
const generatedId =
|
|
6265
|
+
var AdsSwitch = React51.forwardRef(({ className, description, id, label, switchClassName, wrapperClassName, ...props }, ref) => {
|
|
6266
|
+
const generatedId = React51.useId();
|
|
6019
6267
|
const inputId = id ?? generatedId;
|
|
6020
6268
|
if (!label) {
|
|
6021
|
-
return /* @__PURE__ */ (0,
|
|
6269
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
6022
6270
|
Switch2,
|
|
6023
6271
|
{
|
|
6024
6272
|
className: cn(className, switchClassName),
|
|
@@ -6028,12 +6276,12 @@ var AdsSwitch = React49.forwardRef(({ className, description, id, label, switchC
|
|
|
6028
6276
|
}
|
|
6029
6277
|
);
|
|
6030
6278
|
}
|
|
6031
|
-
return /* @__PURE__ */ (0,
|
|
6032
|
-
/* @__PURE__ */ (0,
|
|
6033
|
-
/* @__PURE__ */ (0,
|
|
6034
|
-
description ? /* @__PURE__ */ (0,
|
|
6279
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("label", { className: cn("block w-full cursor-pointer", wrapperClassName), htmlFor: inputId, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex w-full items-start gap-3", children: [
|
|
6280
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-1.5 pt-0.5", children: [
|
|
6281
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "text-sm font-medium leading-5 text-foreground", children: label }),
|
|
6282
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(AdsFieldDescription, { className: "text-sm leading-5", children: description }) : null
|
|
6035
6283
|
] }),
|
|
6036
|
-
/* @__PURE__ */ (0,
|
|
6284
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
6037
6285
|
Switch2,
|
|
6038
6286
|
{
|
|
6039
6287
|
className: cn(className, switchClassName),
|
|
@@ -6047,14 +6295,14 @@ var AdsSwitch = React49.forwardRef(({ className, description, id, label, switchC
|
|
|
6047
6295
|
AdsSwitch.displayName = "AdsSwitch";
|
|
6048
6296
|
|
|
6049
6297
|
// src/components/AdsTabs/index.tsx
|
|
6050
|
-
var
|
|
6298
|
+
var React53 = __toESM(require("react"), 1);
|
|
6051
6299
|
|
|
6052
6300
|
// src/primitives/tabs.tsx
|
|
6053
|
-
var
|
|
6301
|
+
var React52 = __toESM(require("react"), 1);
|
|
6054
6302
|
var TabsPrimitive = __toESM(require("@radix-ui/react-tabs"), 1);
|
|
6055
|
-
var
|
|
6303
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
6056
6304
|
var Tabs = TabsPrimitive.Root;
|
|
6057
|
-
var TabsList =
|
|
6305
|
+
var TabsList = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
6058
6306
|
TabsPrimitive.List,
|
|
6059
6307
|
{
|
|
6060
6308
|
className: cn("inline-flex items-center", className),
|
|
@@ -6063,7 +6311,7 @@ var TabsList = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
6063
6311
|
}
|
|
6064
6312
|
));
|
|
6065
6313
|
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
6066
|
-
var TabsTrigger =
|
|
6314
|
+
var TabsTrigger = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
6067
6315
|
TabsPrimitive.Trigger,
|
|
6068
6316
|
{
|
|
6069
6317
|
className: cn(
|
|
@@ -6075,7 +6323,7 @@ var TabsTrigger = React50.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
6075
6323
|
}
|
|
6076
6324
|
));
|
|
6077
6325
|
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
6078
|
-
var TabsContent =
|
|
6326
|
+
var TabsContent = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
6079
6327
|
TabsPrimitive.Content,
|
|
6080
6328
|
{
|
|
6081
6329
|
className: cn("focus-visible:outline-none", className),
|
|
@@ -6086,9 +6334,9 @@ var TabsContent = React50.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
6086
6334
|
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
6087
6335
|
|
|
6088
6336
|
// src/components/AdsTabs/index.tsx
|
|
6089
|
-
var
|
|
6337
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
6090
6338
|
var AdsTabs = Tabs;
|
|
6091
|
-
var AdsTabsList =
|
|
6339
|
+
var AdsTabsList = React53.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
6092
6340
|
TabsList,
|
|
6093
6341
|
{
|
|
6094
6342
|
className: cn(
|
|
@@ -6100,7 +6348,7 @@ var AdsTabsList = React51.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
6100
6348
|
}
|
|
6101
6349
|
));
|
|
6102
6350
|
AdsTabsList.displayName = "AdsTabsList";
|
|
6103
|
-
var AdsTabsTrigger =
|
|
6351
|
+
var AdsTabsTrigger = React53.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
6104
6352
|
TabsTrigger,
|
|
6105
6353
|
{
|
|
6106
6354
|
className: cn(
|
|
@@ -6112,7 +6360,7 @@ var AdsTabsTrigger = React51.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
6112
6360
|
}
|
|
6113
6361
|
));
|
|
6114
6362
|
AdsTabsTrigger.displayName = "AdsTabsTrigger";
|
|
6115
|
-
var AdsTabsContent =
|
|
6363
|
+
var AdsTabsContent = React53.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
6116
6364
|
TabsContent,
|
|
6117
6365
|
{
|
|
6118
6366
|
className: cn(
|
|
@@ -6126,13 +6374,13 @@ var AdsTabsContent = React51.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
6126
6374
|
AdsTabsContent.displayName = "AdsTabsContent";
|
|
6127
6375
|
|
|
6128
6376
|
// src/components/AdsToggle/index.tsx
|
|
6129
|
-
var
|
|
6377
|
+
var React55 = __toESM(require("react"), 1);
|
|
6130
6378
|
|
|
6131
6379
|
// src/primitives/toggle.tsx
|
|
6132
|
-
var
|
|
6380
|
+
var React54 = __toESM(require("react"), 1);
|
|
6133
6381
|
var TogglePrimitive = __toESM(require("@radix-ui/react-toggle"), 1);
|
|
6134
|
-
var
|
|
6135
|
-
var Toggle =
|
|
6382
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
6383
|
+
var Toggle = React54.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
6136
6384
|
TogglePrimitive.Root,
|
|
6137
6385
|
{
|
|
6138
6386
|
className: cn(
|
|
@@ -6146,7 +6394,7 @@ var Toggle = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
6146
6394
|
Toggle.displayName = TogglePrimitive.Root.displayName;
|
|
6147
6395
|
|
|
6148
6396
|
// src/components/AdsToggle/index.tsx
|
|
6149
|
-
var
|
|
6397
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
6150
6398
|
var sizeClassName3 = {
|
|
6151
6399
|
sm: "!h-8 px-[6px] text-sm",
|
|
6152
6400
|
md: "!h-9 px-md text-sm",
|
|
@@ -6161,10 +6409,10 @@ var variantClassName = {
|
|
|
6161
6409
|
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)]",
|
|
6162
6410
|
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)]"
|
|
6163
6411
|
};
|
|
6164
|
-
var AdsToggle =
|
|
6165
|
-
const childCount =
|
|
6166
|
-
const isIconOnly = childCount === 1 &&
|
|
6167
|
-
return /* @__PURE__ */ (0,
|
|
6412
|
+
var AdsToggle = React55.forwardRef(({ children, className, size = "md", variant = "default", ...props }, ref) => {
|
|
6413
|
+
const childCount = React55.Children.count(children);
|
|
6414
|
+
const isIconOnly = childCount === 1 && React55.isValidElement(children);
|
|
6415
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
6168
6416
|
Toggle,
|
|
6169
6417
|
{
|
|
6170
6418
|
className: cn(
|
|
@@ -6183,13 +6431,13 @@ var AdsToggle = React53.forwardRef(({ children, className, size = "md", variant
|
|
|
6183
6431
|
AdsToggle.displayName = "AdsToggle";
|
|
6184
6432
|
|
|
6185
6433
|
// src/components/AdsToggleGroup/index.tsx
|
|
6186
|
-
var
|
|
6434
|
+
var React57 = __toESM(require("react"), 1);
|
|
6187
6435
|
|
|
6188
6436
|
// src/primitives/toggle-group.tsx
|
|
6189
|
-
var
|
|
6437
|
+
var React56 = __toESM(require("react"), 1);
|
|
6190
6438
|
var ToggleGroupPrimitive = __toESM(require("@radix-ui/react-toggle-group"), 1);
|
|
6191
|
-
var
|
|
6192
|
-
var ToggleGroup =
|
|
6439
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
6440
|
+
var ToggleGroup = React56.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
6193
6441
|
ToggleGroupPrimitive.Root,
|
|
6194
6442
|
{
|
|
6195
6443
|
className: cn("inline-flex items-center justify-start", className),
|
|
@@ -6198,7 +6446,7 @@ var ToggleGroup = React54.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
6198
6446
|
}
|
|
6199
6447
|
));
|
|
6200
6448
|
ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;
|
|
6201
|
-
var ToggleGroupItem =
|
|
6449
|
+
var ToggleGroupItem = React56.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
6202
6450
|
ToggleGroupPrimitive.Item,
|
|
6203
6451
|
{
|
|
6204
6452
|
className: cn(
|
|
@@ -6212,7 +6460,7 @@ var ToggleGroupItem = React54.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
6212
6460
|
ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
|
|
6213
6461
|
|
|
6214
6462
|
// src/components/AdsToggleGroup/index.tsx
|
|
6215
|
-
var
|
|
6463
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
6216
6464
|
var sizeClassName4 = {
|
|
6217
6465
|
sm: "h-8 min-w-7 px-[6px] text-sm",
|
|
6218
6466
|
md: "h-9 min-w-[34px] px-md text-sm",
|
|
@@ -6222,8 +6470,8 @@ var variantClassName2 = {
|
|
|
6222
6470
|
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)]",
|
|
6223
6471
|
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)]"
|
|
6224
6472
|
};
|
|
6225
|
-
var AdsToggleGroupContext =
|
|
6226
|
-
var AdsToggleGroup =
|
|
6473
|
+
var AdsToggleGroupContext = React57.createContext(null);
|
|
6474
|
+
var AdsToggleGroup = React57.forwardRef(
|
|
6227
6475
|
({
|
|
6228
6476
|
children,
|
|
6229
6477
|
className,
|
|
@@ -6231,7 +6479,7 @@ var AdsToggleGroup = React55.forwardRef(
|
|
|
6231
6479
|
size = "md",
|
|
6232
6480
|
variant = "default",
|
|
6233
6481
|
...props
|
|
6234
|
-
}, ref) => /* @__PURE__ */ (0,
|
|
6482
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(AdsToggleGroupContext.Provider, { value: { orientation, size, variant }, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6235
6483
|
ToggleGroup,
|
|
6236
6484
|
{
|
|
6237
6485
|
className: cn(
|
|
@@ -6247,12 +6495,12 @@ var AdsToggleGroup = React55.forwardRef(
|
|
|
6247
6495
|
) })
|
|
6248
6496
|
);
|
|
6249
6497
|
AdsToggleGroup.displayName = "AdsToggleGroup";
|
|
6250
|
-
var AdsToggleGroupItem =
|
|
6251
|
-
const context =
|
|
6498
|
+
var AdsToggleGroupItem = React57.forwardRef(({ className, size, variant, ...props }, ref) => {
|
|
6499
|
+
const context = React57.useContext(AdsToggleGroupContext);
|
|
6252
6500
|
const resolvedOrientation = context?.orientation ?? "horizontal";
|
|
6253
6501
|
const resolvedSize = size ?? context?.size ?? "md";
|
|
6254
6502
|
const resolvedVariant = variant ?? context?.variant ?? "default";
|
|
6255
|
-
return /* @__PURE__ */ (0,
|
|
6503
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6256
6504
|
ToggleGroupItem,
|
|
6257
6505
|
{
|
|
6258
6506
|
className: cn(
|
|
@@ -6270,10 +6518,10 @@ var AdsToggleGroupItem = React55.forwardRef(({ className, size, variant, ...prop
|
|
|
6270
6518
|
AdsToggleGroupItem.displayName = "AdsToggleGroupItem";
|
|
6271
6519
|
|
|
6272
6520
|
// src/components/AdsTextarea/index.tsx
|
|
6273
|
-
var
|
|
6274
|
-
var
|
|
6521
|
+
var React58 = __toESM(require("react"), 1);
|
|
6522
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
6275
6523
|
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";
|
|
6276
|
-
var AdsTextarea =
|
|
6524
|
+
var AdsTextarea = React58.forwardRef(
|
|
6277
6525
|
({
|
|
6278
6526
|
action,
|
|
6279
6527
|
className,
|
|
@@ -6292,12 +6540,12 @@ var AdsTextarea = React56.forwardRef(
|
|
|
6292
6540
|
helperText,
|
|
6293
6541
|
id
|
|
6294
6542
|
});
|
|
6295
|
-
const helperNode = helperText ? /* @__PURE__ */ (0,
|
|
6296
|
-
const errorNode = errorText ? /* @__PURE__ */ (0,
|
|
6297
|
-
return /* @__PURE__ */ (0,
|
|
6298
|
-
label ? /* @__PURE__ */ (0,
|
|
6543
|
+
const helperNode = helperText ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(AdsFieldDescription, { id: description.helperId, children: helperText }) : null;
|
|
6544
|
+
const errorNode = errorText ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(AdsFieldError, { id: description.errorId, children: errorText }) : null;
|
|
6545
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(AdsFieldItem, { children: [
|
|
6546
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(AdsFieldLabel, { htmlFor: description.inputId, children: label }) : null,
|
|
6299
6547
|
descriptionPlacement === "above" ? helperNode : null,
|
|
6300
|
-
/* @__PURE__ */ (0,
|
|
6548
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
6301
6549
|
Textarea,
|
|
6302
6550
|
{
|
|
6303
6551
|
"aria-describedby": description.describedBy,
|
|
@@ -6315,7 +6563,7 @@ var AdsTextarea = React56.forwardRef(
|
|
|
6315
6563
|
...props
|
|
6316
6564
|
}
|
|
6317
6565
|
),
|
|
6318
|
-
action ? /* @__PURE__ */ (0,
|
|
6566
|
+
action ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "w-full [&>*]:w-full", children: action }) : null,
|
|
6319
6567
|
descriptionPlacement === "below" ? helperNode : null,
|
|
6320
6568
|
errorNode
|
|
6321
6569
|
] });
|
|
@@ -6324,17 +6572,17 @@ var AdsTextarea = React56.forwardRef(
|
|
|
6324
6572
|
AdsTextarea.displayName = "AdsTextarea";
|
|
6325
6573
|
|
|
6326
6574
|
// src/components/AdsTooltip/index.tsx
|
|
6327
|
-
var
|
|
6575
|
+
var React60 = __toESM(require("react"), 1);
|
|
6328
6576
|
|
|
6329
6577
|
// src/primitives/tooltip.tsx
|
|
6330
|
-
var
|
|
6578
|
+
var React59 = __toESM(require("react"), 1);
|
|
6331
6579
|
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"), 1);
|
|
6332
|
-
var
|
|
6580
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
6333
6581
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
6334
6582
|
var Tooltip = TooltipPrimitive.Root;
|
|
6335
6583
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
6336
6584
|
var TooltipArrow = TooltipPrimitive.Arrow;
|
|
6337
|
-
var TooltipContent =
|
|
6585
|
+
var TooltipContent = React59.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(TooltipPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
6338
6586
|
TooltipPrimitive.Content,
|
|
6339
6587
|
{
|
|
6340
6588
|
className: cn(
|
|
@@ -6349,12 +6597,12 @@ var TooltipContent = React57.forwardRef(({ className, sideOffset = 4, ...props }
|
|
|
6349
6597
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
6350
6598
|
|
|
6351
6599
|
// src/components/AdsTooltip/index.tsx
|
|
6352
|
-
var
|
|
6600
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
6353
6601
|
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)]";
|
|
6354
6602
|
var AdsTooltipProvider = TooltipProvider;
|
|
6355
6603
|
var AdsTooltip = Tooltip;
|
|
6356
6604
|
var AdsTooltipTrigger = TooltipTrigger;
|
|
6357
|
-
var AdsTooltipContent =
|
|
6605
|
+
var AdsTooltipContent = React60.forwardRef(({ align = "center", className, sideOffset = 10, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
6358
6606
|
TooltipContent,
|
|
6359
6607
|
{
|
|
6360
6608
|
align,
|
|
@@ -6365,7 +6613,7 @@ var AdsTooltipContent = React58.forwardRef(({ align = "center", className, sideO
|
|
|
6365
6613
|
}
|
|
6366
6614
|
));
|
|
6367
6615
|
AdsTooltipContent.displayName = "AdsTooltipContent";
|
|
6368
|
-
var AdsTooltipArrow =
|
|
6616
|
+
var AdsTooltipArrow = React60.forwardRef(({ className, height = 5, width = 10, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
6369
6617
|
TooltipArrow,
|
|
6370
6618
|
{
|
|
6371
6619
|
className: cn("fill-[#844fff]", className),
|
|
@@ -6378,16 +6626,16 @@ var AdsTooltipArrow = React58.forwardRef(({ className, height = 5, width = 10, .
|
|
|
6378
6626
|
AdsTooltipArrow.displayName = "AdsTooltipArrow";
|
|
6379
6627
|
|
|
6380
6628
|
// src/components/AdsToast/index.tsx
|
|
6381
|
-
var
|
|
6382
|
-
var
|
|
6629
|
+
var React61 = __toESM(require("react"), 1);
|
|
6630
|
+
var import_lucide_react16 = require("lucide-react");
|
|
6383
6631
|
var import_sonner = require("sonner");
|
|
6384
|
-
var
|
|
6632
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
6385
6633
|
var adsToastIconMap = {
|
|
6386
|
-
success:
|
|
6387
|
-
info:
|
|
6388
|
-
warning:
|
|
6389
|
-
error:
|
|
6390
|
-
loading:
|
|
6634
|
+
success: import_lucide_react16.CircleCheck,
|
|
6635
|
+
info: import_lucide_react16.Info,
|
|
6636
|
+
warning: import_lucide_react16.TriangleAlert,
|
|
6637
|
+
error: import_lucide_react16.OctagonX,
|
|
6638
|
+
loading: import_lucide_react16.LoaderCircle
|
|
6391
6639
|
};
|
|
6392
6640
|
function resolveToastIcon(intent, icon) {
|
|
6393
6641
|
if (icon) {
|
|
@@ -6397,7 +6645,7 @@ function resolveToastIcon(intent, icon) {
|
|
|
6397
6645
|
return null;
|
|
6398
6646
|
}
|
|
6399
6647
|
const Icon2 = adsToastIconMap[intent];
|
|
6400
|
-
return /* @__PURE__ */ (0,
|
|
6648
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
6401
6649
|
Icon2,
|
|
6402
6650
|
{
|
|
6403
6651
|
"aria-hidden": true,
|
|
@@ -6410,7 +6658,7 @@ function resolveToastIcon(intent, icon) {
|
|
|
6410
6658
|
}
|
|
6411
6659
|
);
|
|
6412
6660
|
}
|
|
6413
|
-
var AdsToast =
|
|
6661
|
+
var AdsToast = React61.forwardRef(
|
|
6414
6662
|
({
|
|
6415
6663
|
action,
|
|
6416
6664
|
className,
|
|
@@ -6421,7 +6669,7 @@ var AdsToast = React59.forwardRef(
|
|
|
6421
6669
|
...props
|
|
6422
6670
|
}, ref) => {
|
|
6423
6671
|
const resolvedIcon = resolveToastIcon(intent, icon);
|
|
6424
|
-
return /* @__PURE__ */ (0,
|
|
6672
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
|
|
6425
6673
|
"div",
|
|
6426
6674
|
{
|
|
6427
6675
|
className: cn(
|
|
@@ -6436,8 +6684,8 @@ var AdsToast = React59.forwardRef(
|
|
|
6436
6684
|
...props,
|
|
6437
6685
|
children: [
|
|
6438
6686
|
resolvedIcon,
|
|
6439
|
-
/* @__PURE__ */ (0,
|
|
6440
|
-
/* @__PURE__ */ (0,
|
|
6687
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
|
|
6688
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
6441
6689
|
"p",
|
|
6442
6690
|
{
|
|
6443
6691
|
className: cn(
|
|
@@ -6447,7 +6695,7 @@ var AdsToast = React59.forwardRef(
|
|
|
6447
6695
|
children: title
|
|
6448
6696
|
}
|
|
6449
6697
|
),
|
|
6450
|
-
description ? /* @__PURE__ */ (0,
|
|
6698
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
6451
6699
|
"p",
|
|
6452
6700
|
{
|
|
6453
6701
|
className: cn(
|
|
@@ -6458,7 +6706,7 @@ var AdsToast = React59.forwardRef(
|
|
|
6458
6706
|
}
|
|
6459
6707
|
) : null
|
|
6460
6708
|
] }),
|
|
6461
|
-
action ? /* @__PURE__ */ (0,
|
|
6709
|
+
action ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
6462
6710
|
AdsButton,
|
|
6463
6711
|
{
|
|
6464
6712
|
className: "shrink-0 rounded-radius-lg",
|
|
@@ -6484,7 +6732,7 @@ function AdsToaster({
|
|
|
6484
6732
|
...props
|
|
6485
6733
|
}) {
|
|
6486
6734
|
const { messages } = useAdsI18n();
|
|
6487
|
-
return /* @__PURE__ */ (0,
|
|
6735
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
6488
6736
|
import_sonner.Toaster,
|
|
6489
6737
|
{
|
|
6490
6738
|
closeButton: false,
|
|
@@ -6502,7 +6750,7 @@ function AdsToaster({
|
|
|
6502
6750
|
);
|
|
6503
6751
|
}
|
|
6504
6752
|
function toStageNode(intent, title, options) {
|
|
6505
|
-
return /* @__PURE__ */ (0,
|
|
6753
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
6506
6754
|
AdsToast,
|
|
6507
6755
|
{
|
|
6508
6756
|
action: options?.action,
|
|
@@ -6516,7 +6764,7 @@ function toStageNode(intent, title, options) {
|
|
|
6516
6764
|
function showAdsToast(intent, title, options) {
|
|
6517
6765
|
const { action, description, icon, ...toastOptions } = options ?? {};
|
|
6518
6766
|
return import_sonner.toast.custom(
|
|
6519
|
-
(id) => /* @__PURE__ */ (0,
|
|
6767
|
+
(id) => /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
6520
6768
|
AdsToast,
|
|
6521
6769
|
{
|
|
6522
6770
|
action: action ? {
|
|
@@ -6570,10 +6818,10 @@ var AdsToastManager = Object.assign(
|
|
|
6570
6818
|
);
|
|
6571
6819
|
|
|
6572
6820
|
// src/components/AdsDialog/index.tsx
|
|
6573
|
-
var
|
|
6821
|
+
var React62 = __toESM(require("react"), 1);
|
|
6574
6822
|
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
6575
|
-
var
|
|
6576
|
-
var
|
|
6823
|
+
var import_lucide_react17 = require("lucide-react");
|
|
6824
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
6577
6825
|
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";
|
|
6578
6826
|
var contentClassName2 = "fixed left-1/2 top-1/2 z-50 flex max-h-[calc(100dvh-2rem)] w-[calc(100%-2rem)] max-w-[423px] -translate-x-1/2 -translate-y-1/2 flex-col gap-lg overflow-hidden 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%]";
|
|
6579
6827
|
var bodyClassName = "min-h-0 flex-1 overflow-y-auto overscroll-contain [scrollbar-gutter:stable]";
|
|
@@ -6581,7 +6829,7 @@ var closeButtonClassName = "absolute right-xl top-xl inline-flex h-6 w-6 items-c
|
|
|
6581
6829
|
var Dialog = DialogPrimitive.Root;
|
|
6582
6830
|
var DialogTrigger = DialogPrimitive.Trigger;
|
|
6583
6831
|
var DialogPortal = DialogPrimitive.Portal;
|
|
6584
|
-
var DialogOverlay =
|
|
6832
|
+
var DialogOverlay = React62.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
6585
6833
|
DialogPrimitive.Overlay,
|
|
6586
6834
|
{
|
|
6587
6835
|
className: cn(overlayClassName2, className),
|
|
@@ -6590,7 +6838,7 @@ var DialogOverlay = React60.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
6590
6838
|
}
|
|
6591
6839
|
));
|
|
6592
6840
|
DialogOverlay.displayName = "DialogOverlay";
|
|
6593
|
-
var DialogClose =
|
|
6841
|
+
var DialogClose = React62.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
6594
6842
|
DialogPrimitive.Close,
|
|
6595
6843
|
{
|
|
6596
6844
|
className: cn(
|
|
@@ -6604,8 +6852,8 @@ var DialogClose = React60.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
6604
6852
|
DialogClose.displayName = "DialogClose";
|
|
6605
6853
|
function flattenDialogChildren(children) {
|
|
6606
6854
|
const nodes = [];
|
|
6607
|
-
|
|
6608
|
-
if (
|
|
6855
|
+
React62.Children.forEach(children, (child) => {
|
|
6856
|
+
if (React62.isValidElement(child) && child.type === React62.Fragment) {
|
|
6609
6857
|
nodes.push(...flattenDialogChildren(child.props.children));
|
|
6610
6858
|
return;
|
|
6611
6859
|
}
|
|
@@ -6614,10 +6862,10 @@ function flattenDialogChildren(children) {
|
|
|
6614
6862
|
return nodes;
|
|
6615
6863
|
}
|
|
6616
6864
|
function isDialogSlotElement(child, component) {
|
|
6617
|
-
return
|
|
6865
|
+
return React62.isValidElement(child) && child.type === component;
|
|
6618
6866
|
}
|
|
6619
|
-
var DialogBody =
|
|
6620
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
6867
|
+
var DialogBody = React62.forwardRef(
|
|
6868
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
6621
6869
|
"div",
|
|
6622
6870
|
{
|
|
6623
6871
|
className: cn(bodyClassName, className),
|
|
@@ -6628,7 +6876,7 @@ var DialogBody = React60.forwardRef(
|
|
|
6628
6876
|
)
|
|
6629
6877
|
);
|
|
6630
6878
|
DialogBody.displayName = "DialogBody";
|
|
6631
|
-
var DialogContent =
|
|
6879
|
+
var DialogContent = React62.forwardRef(
|
|
6632
6880
|
({
|
|
6633
6881
|
children,
|
|
6634
6882
|
className,
|
|
@@ -6685,9 +6933,9 @@ var DialogContent = React60.forwardRef(
|
|
|
6685
6933
|
const looseBodyNodes = bodyNodes.filter(
|
|
6686
6934
|
(child) => !isDialogSlotElement(child, DialogBody)
|
|
6687
6935
|
);
|
|
6688
|
-
return /* @__PURE__ */ (0,
|
|
6689
|
-
/* @__PURE__ */ (0,
|
|
6690
|
-
/* @__PURE__ */ (0,
|
|
6936
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(NestedDismissableLayerProvider, { coordinator: parentLayer.coordinator, children: /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(DialogPortal, { children: [
|
|
6937
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(DialogOverlay, {}),
|
|
6938
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
|
|
6691
6939
|
DialogPrimitive.Content,
|
|
6692
6940
|
{
|
|
6693
6941
|
"data-slot": "ads-dialog-content",
|
|
@@ -6703,18 +6951,18 @@ var DialogContent = React60.forwardRef(
|
|
|
6703
6951
|
...props,
|
|
6704
6952
|
children: [
|
|
6705
6953
|
headerNode,
|
|
6706
|
-
headerNode === null && generatedHeaderNodes.length > 0 ? /* @__PURE__ */ (0,
|
|
6954
|
+
headerNode === null && generatedHeaderNodes.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(DialogHeader, { children: generatedHeaderNodes }) : null,
|
|
6707
6955
|
explicitBodyNodes.length > 0 ? explicitBodyNodes : null,
|
|
6708
|
-
looseBodyNodes.length > 0 ? /* @__PURE__ */ (0,
|
|
6956
|
+
looseBodyNodes.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(DialogBody, { children: looseBodyNodes }) : null,
|
|
6709
6957
|
footerNode,
|
|
6710
|
-
!hideCloseButton ? /* @__PURE__ */ (0,
|
|
6958
|
+
!hideCloseButton ? /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
|
|
6711
6959
|
DialogPrimitive.Close,
|
|
6712
6960
|
{
|
|
6713
6961
|
"aria-label": resolvedCloseLabel,
|
|
6714
6962
|
className: cn(closeButtonClassName, adsTextColorClassName.card),
|
|
6715
6963
|
children: [
|
|
6716
|
-
/* @__PURE__ */ (0,
|
|
6717
|
-
/* @__PURE__ */ (0,
|
|
6964
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_lucide_react17.X, { "aria-hidden": true, className: "h-4 w-4" }),
|
|
6965
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { className: "sr-only", children: resolvedCloseLabel })
|
|
6718
6966
|
]
|
|
6719
6967
|
}
|
|
6720
6968
|
) : null
|
|
@@ -6725,8 +6973,8 @@ var DialogContent = React60.forwardRef(
|
|
|
6725
6973
|
}
|
|
6726
6974
|
);
|
|
6727
6975
|
DialogContent.displayName = "DialogContent";
|
|
6728
|
-
var DialogHeader =
|
|
6729
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
6976
|
+
var DialogHeader = React62.forwardRef(
|
|
6977
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
6730
6978
|
"div",
|
|
6731
6979
|
{
|
|
6732
6980
|
"data-slot": "ads-dialog-header",
|
|
@@ -6737,8 +6985,8 @@ var DialogHeader = React60.forwardRef(
|
|
|
6737
6985
|
)
|
|
6738
6986
|
);
|
|
6739
6987
|
DialogHeader.displayName = "DialogHeader";
|
|
6740
|
-
var DialogFooter =
|
|
6741
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
6988
|
+
var DialogFooter = React62.forwardRef(
|
|
6989
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
6742
6990
|
"div",
|
|
6743
6991
|
{
|
|
6744
6992
|
"data-slot": "ads-dialog-footer",
|
|
@@ -6752,7 +7000,7 @@ var DialogFooter = React60.forwardRef(
|
|
|
6752
7000
|
)
|
|
6753
7001
|
);
|
|
6754
7002
|
DialogFooter.displayName = "DialogFooter";
|
|
6755
|
-
var DialogTitle =
|
|
7003
|
+
var DialogTitle = React62.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
6756
7004
|
DialogPrimitive.Title,
|
|
6757
7005
|
{
|
|
6758
7006
|
className: cn(
|
|
@@ -6765,7 +7013,7 @@ var DialogTitle = React60.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
6765
7013
|
}
|
|
6766
7014
|
));
|
|
6767
7015
|
DialogTitle.displayName = "DialogTitle";
|
|
6768
|
-
var DialogDescription =
|
|
7016
|
+
var DialogDescription = React62.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
6769
7017
|
DialogPrimitive.Description,
|
|
6770
7018
|
{
|
|
6771
7019
|
className: cn("text-sm leading-5", adsTextColorClassName.muted, className),
|
|
@@ -6788,7 +7036,7 @@ var AdsDialogDescription = DialogDescription;
|
|
|
6788
7036
|
|
|
6789
7037
|
// src/components/AdsMasonry/index.tsx
|
|
6790
7038
|
var import_masonic = require("masonic");
|
|
6791
|
-
var
|
|
7039
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
6792
7040
|
var DEFAULT_COLUMN_WIDTH = 240;
|
|
6793
7041
|
var DEFAULT_GAP = 16;
|
|
6794
7042
|
var DEFAULT_ITEM_HEIGHT_ESTIMATE = 280;
|
|
@@ -6824,7 +7072,7 @@ function AdsMasonry({
|
|
|
6824
7072
|
{ length: loadingItemCount },
|
|
6825
7073
|
(_, index) => index
|
|
6826
7074
|
);
|
|
6827
|
-
return /* @__PURE__ */ (0,
|
|
7075
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
6828
7076
|
"div",
|
|
6829
7077
|
{
|
|
6830
7078
|
className: cn(
|
|
@@ -6836,20 +7084,20 @@ function AdsMasonry({
|
|
|
6836
7084
|
const mediaHeight = LOADING_MEDIA_HEIGHT_PATTERN[index % LOADING_MEDIA_HEIGHT_PATTERN.length];
|
|
6837
7085
|
const titleWidth = LOADING_TITLE_WIDTH_PATTERN[index % LOADING_TITLE_WIDTH_PATTERN.length];
|
|
6838
7086
|
const bodyWidth = LOADING_BODY_WIDTH_PATTERN[index % LOADING_BODY_WIDTH_PATTERN.length];
|
|
6839
|
-
return /* @__PURE__ */ (0,
|
|
7087
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(
|
|
6840
7088
|
"article",
|
|
6841
7089
|
{
|
|
6842
7090
|
className: "overflow-hidden rounded-radius-lg border border-border bg-card shadow-showcase",
|
|
6843
7091
|
"data-slot": "ads-masonry-loading-card",
|
|
6844
7092
|
"data-testid": "ads-masonry-loading-card",
|
|
6845
7093
|
children: [
|
|
6846
|
-
/* @__PURE__ */ (0,
|
|
7094
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
6847
7095
|
"div",
|
|
6848
7096
|
{
|
|
6849
7097
|
className: "border-b border-border/60 bg-surface-inset/50",
|
|
6850
7098
|
"data-slot": "ads-masonry-skeleton-preview",
|
|
6851
7099
|
"data-testid": "ads-masonry-skeleton-preview",
|
|
6852
|
-
children: /* @__PURE__ */ (0,
|
|
7100
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
6853
7101
|
AdsSkeleton,
|
|
6854
7102
|
{
|
|
6855
7103
|
className: cn("w-full rounded-none", classNames?.skeleton),
|
|
@@ -6860,10 +7108,10 @@ function AdsMasonry({
|
|
|
6860
7108
|
)
|
|
6861
7109
|
}
|
|
6862
7110
|
),
|
|
6863
|
-
/* @__PURE__ */ (0,
|
|
6864
|
-
/* @__PURE__ */ (0,
|
|
6865
|
-
/* @__PURE__ */ (0,
|
|
6866
|
-
/* @__PURE__ */ (0,
|
|
7111
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "flex flex-col gap-4 p-lg", children: [
|
|
7112
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
|
|
7113
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "flex-1 space-y-2", children: [
|
|
7114
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
6867
7115
|
AdsSkeleton,
|
|
6868
7116
|
{
|
|
6869
7117
|
className: cn("h-3 w-16 rounded-full", classNames?.skeleton),
|
|
@@ -6871,7 +7119,7 @@ function AdsMasonry({
|
|
|
6871
7119
|
"data-testid": "ads-masonry-skeleton"
|
|
6872
7120
|
}
|
|
6873
7121
|
),
|
|
6874
|
-
/* @__PURE__ */ (0,
|
|
7122
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
6875
7123
|
AdsSkeleton,
|
|
6876
7124
|
{
|
|
6877
7125
|
className: cn("h-6 rounded-full", classNames?.skeleton),
|
|
@@ -6881,7 +7129,7 @@ function AdsMasonry({
|
|
|
6881
7129
|
}
|
|
6882
7130
|
)
|
|
6883
7131
|
] }),
|
|
6884
|
-
/* @__PURE__ */ (0,
|
|
7132
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
6885
7133
|
AdsSkeleton,
|
|
6886
7134
|
{
|
|
6887
7135
|
className: cn("h-6 w-16 rounded-full", classNames?.skeleton),
|
|
@@ -6890,7 +7138,7 @@ function AdsMasonry({
|
|
|
6890
7138
|
}
|
|
6891
7139
|
)
|
|
6892
7140
|
] }),
|
|
6893
|
-
/* @__PURE__ */ (0,
|
|
7141
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
6894
7142
|
AdsSkeleton,
|
|
6895
7143
|
{
|
|
6896
7144
|
className: cn("h-4 rounded-full", classNames?.skeleton),
|
|
@@ -6909,7 +7157,7 @@ function AdsMasonry({
|
|
|
6909
7157
|
);
|
|
6910
7158
|
}
|
|
6911
7159
|
if (items.length === 0) {
|
|
6912
|
-
return emptyState ? /* @__PURE__ */ (0,
|
|
7160
|
+
return emptyState ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
6913
7161
|
"div",
|
|
6914
7162
|
{
|
|
6915
7163
|
className: cn(rootClassName, classNames?.empty),
|
|
@@ -6918,7 +7166,7 @@ function AdsMasonry({
|
|
|
6918
7166
|
}
|
|
6919
7167
|
) : null;
|
|
6920
7168
|
}
|
|
6921
|
-
return /* @__PURE__ */ (0,
|
|
7169
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
6922
7170
|
import_masonic.Masonry,
|
|
6923
7171
|
{
|
|
6924
7172
|
className: rootClassName,
|
|
@@ -6930,7 +7178,7 @@ function AdsMasonry({
|
|
|
6930
7178
|
maxColumnCount,
|
|
6931
7179
|
onRender,
|
|
6932
7180
|
overscanBy,
|
|
6933
|
-
render: ({ data, index, width }) => /* @__PURE__ */ (0,
|
|
7181
|
+
render: ({ data, index, width }) => /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
6934
7182
|
"div",
|
|
6935
7183
|
{
|
|
6936
7184
|
className: cn("pb-0", classNames?.item, itemClassName),
|
|
@@ -7030,6 +7278,7 @@ var designTokens = {
|
|
|
7030
7278
|
AdsAlertDialogTrigger,
|
|
7031
7279
|
AdsAlertTitle,
|
|
7032
7280
|
AdsBadge,
|
|
7281
|
+
AdsBarChart,
|
|
7033
7282
|
AdsBreadcrumb,
|
|
7034
7283
|
AdsBreadcrumbEllipsis,
|
|
7035
7284
|
AdsBreadcrumbItem,
|
|
@@ -7106,6 +7355,7 @@ var designTokens = {
|
|
|
7106
7355
|
AdsPopoverTitle,
|
|
7107
7356
|
AdsPopoverTrigger,
|
|
7108
7357
|
AdsProgress,
|
|
7358
|
+
AdsRadialProgressChart,
|
|
7109
7359
|
AdsRadioGroup,
|
|
7110
7360
|
AdsRadioGroupCardOption,
|
|
7111
7361
|
AdsRadioGroupOption,
|
|
@@ -7123,7 +7373,9 @@ var designTokens = {
|
|
|
7123
7373
|
AdsSeparator,
|
|
7124
7374
|
AdsSkeleton,
|
|
7125
7375
|
AdsSlider,
|
|
7376
|
+
AdsSparklineChart,
|
|
7126
7377
|
AdsSpinner,
|
|
7378
|
+
AdsStackedBarChart,
|
|
7127
7379
|
AdsSwitch,
|
|
7128
7380
|
AdsTable,
|
|
7129
7381
|
AdsTableBody,
|