@adsgency_npm/adsgency-ads-ui 0.1.0-alpha.6 → 0.1.0-alpha.8
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 +909 -189
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +115 -6
- package/dist/index.d.ts +115 -6
- package/dist/index.js +899 -182
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -64,6 +64,7 @@ __export(src_exports, {
|
|
|
64
64
|
AdsCheckbox: () => AdsCheckbox,
|
|
65
65
|
AdsDataPagination: () => AdsDataPagination,
|
|
66
66
|
AdsDataTable: () => AdsDataTable,
|
|
67
|
+
AdsDataTableToolbar: () => AdsDataTableToolbar,
|
|
67
68
|
AdsDatePicker: () => AdsDatePicker,
|
|
68
69
|
AdsDateTimePicker: () => AdsDateTimePicker,
|
|
69
70
|
AdsDialog: () => AdsDialog,
|
|
@@ -106,6 +107,7 @@ __export(src_exports, {
|
|
|
106
107
|
AdsInputOTPGroup: () => AdsInputOTPGroup,
|
|
107
108
|
AdsInputOTPSeparator: () => AdsInputOTPSeparator,
|
|
108
109
|
AdsInputOTPSlot: () => AdsInputOTPSlot,
|
|
110
|
+
AdsMasonry: () => AdsMasonry,
|
|
109
111
|
AdsPagination: () => AdsPagination,
|
|
110
112
|
AdsPaginationContent: () => AdsPaginationContent,
|
|
111
113
|
AdsPaginationEllipsis: () => AdsPaginationEllipsis,
|
|
@@ -172,6 +174,7 @@ __export(src_exports, {
|
|
|
172
174
|
AdsTooltipContent: () => AdsTooltipContent,
|
|
173
175
|
AdsTooltipProvider: () => AdsTooltipProvider,
|
|
174
176
|
AdsTooltipTrigger: () => AdsTooltipTrigger,
|
|
177
|
+
AdsViewCustomersDataTable: () => AdsViewCustomersDataTable,
|
|
175
178
|
adsDefaultMessages: () => adsDefaultMessages,
|
|
176
179
|
designTokens: () => designTokens,
|
|
177
180
|
useAdsI18n: () => useAdsI18n
|
|
@@ -213,12 +216,16 @@ var adsDefaultMessages = {
|
|
|
213
216
|
clearSort: "Clear sort",
|
|
214
217
|
collapseRow: "Collapse row",
|
|
215
218
|
expandRow: "Expand row",
|
|
219
|
+
filterColumn: "Filter column",
|
|
216
220
|
noDataAvailable: "No data available",
|
|
221
|
+
selectAllRows: "Select all rows",
|
|
217
222
|
selectRow: "Select row",
|
|
218
223
|
sortAscending: "Sort ascending",
|
|
219
224
|
sortDescending: "Sort descending"
|
|
220
225
|
},
|
|
221
226
|
pagination: {
|
|
227
|
+
first: "First",
|
|
228
|
+
last: "Last",
|
|
222
229
|
previous: "Previous",
|
|
223
230
|
next: "Next",
|
|
224
231
|
morePages: "More pages",
|
|
@@ -226,7 +233,9 @@ var adsDefaultMessages = {
|
|
|
226
233
|
itemsPerPage: "Items per page",
|
|
227
234
|
itemsPerPageOption: "{{value}} / page",
|
|
228
235
|
jumpTo: "Jump to page",
|
|
229
|
-
total: "Showing {{start}}-{{end}} of {{total}}"
|
|
236
|
+
total: "Showing {{start}}-{{end}} of {{total}}",
|
|
237
|
+
compactTotal: "Total: {{total}}",
|
|
238
|
+
pageStatus: "Page {{page}} of {{pages}}"
|
|
230
239
|
}
|
|
231
240
|
},
|
|
232
241
|
zh: {
|
|
@@ -256,12 +265,16 @@ var adsDefaultMessages = {
|
|
|
256
265
|
clearSort: "\u6E05\u9664\u6392\u5E8F",
|
|
257
266
|
collapseRow: "\u6536\u8D77\u884C",
|
|
258
267
|
expandRow: "\u5C55\u5F00\u884C",
|
|
268
|
+
filterColumn: "\u7B5B\u9009\u5217",
|
|
259
269
|
noDataAvailable: "\u6682\u65E0\u6570\u636E",
|
|
270
|
+
selectAllRows: "\u9009\u62E9\u5168\u90E8\u884C",
|
|
260
271
|
selectRow: "\u9009\u62E9\u884C",
|
|
261
272
|
sortAscending: "\u5347\u5E8F\u6392\u5E8F",
|
|
262
273
|
sortDescending: "\u964D\u5E8F\u6392\u5E8F"
|
|
263
274
|
},
|
|
264
275
|
pagination: {
|
|
276
|
+
first: "\u7B2C\u4E00\u9875",
|
|
277
|
+
last: "\u6700\u540E\u4E00\u9875",
|
|
265
278
|
previous: "\u4E0A\u4E00\u9875",
|
|
266
279
|
next: "\u4E0B\u4E00\u9875",
|
|
267
280
|
morePages: "\u66F4\u591A\u9875\u7801",
|
|
@@ -269,7 +282,9 @@ var adsDefaultMessages = {
|
|
|
269
282
|
itemsPerPage: "\u6BCF\u9875\u6761\u6570",
|
|
270
283
|
itemsPerPageOption: "{{value}} / \u9875",
|
|
271
284
|
jumpTo: "\u8DF3\u8F6C\u9875\u7801",
|
|
272
|
-
total: "\u663E\u793A\u7B2C {{start}}-{{end}} \u6761\uFF0C\u5171 {{total}} \u6761"
|
|
285
|
+
total: "\u663E\u793A\u7B2C {{start}}-{{end}} \u6761\uFF0C\u5171 {{total}} \u6761",
|
|
286
|
+
compactTotal: "\u603B\u6570: {{total}}",
|
|
287
|
+
pageStatus: "\u7B2C {{page}} / {{pages}} \u9875"
|
|
273
288
|
}
|
|
274
289
|
}
|
|
275
290
|
};
|
|
@@ -3592,8 +3607,10 @@ function AdsDataPagination({
|
|
|
3592
3607
|
pageSizeOptions = [10, 20, 50, 100],
|
|
3593
3608
|
onPageSizeChange,
|
|
3594
3609
|
showQuickJumper = false,
|
|
3610
|
+
showFirstLast = false,
|
|
3595
3611
|
siblingCount = 1,
|
|
3596
3612
|
boundaryCount = 1,
|
|
3613
|
+
variant = "default",
|
|
3597
3614
|
disabled = false,
|
|
3598
3615
|
className,
|
|
3599
3616
|
classNames,
|
|
@@ -3693,6 +3710,158 @@ function AdsDataPagination({
|
|
|
3693
3710
|
end: rangeEnd,
|
|
3694
3711
|
total
|
|
3695
3712
|
}) : null;
|
|
3713
|
+
const compactTotalContent = interpolate(messages.pagination.compactTotal, { total });
|
|
3714
|
+
const pageStatus = interpolate(messages.pagination.pageStatus, {
|
|
3715
|
+
page: mergedCurrent,
|
|
3716
|
+
pages: totalPages
|
|
3717
|
+
});
|
|
3718
|
+
const shouldShowFirstLast = variant === "compact" || showFirstLast;
|
|
3719
|
+
const navigationLabel = ariaLabel ?? messages.pagination.navigation;
|
|
3720
|
+
const previousDisabled = disabled || mergedCurrent <= 1;
|
|
3721
|
+
const nextDisabled = disabled || mergedCurrent >= totalPages;
|
|
3722
|
+
const navButtonClassName = cn(
|
|
3723
|
+
paginationButtonBaseClassName,
|
|
3724
|
+
paginationButtonInactiveClassName,
|
|
3725
|
+
"gap-1 px-md py-sm"
|
|
3726
|
+
);
|
|
3727
|
+
const renderPageNavigation = () => {
|
|
3728
|
+
if (variant === "compact") {
|
|
3729
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex flex-wrap items-center gap-sm", children: [
|
|
3730
|
+
shouldShowFirstLast ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3731
|
+
Button,
|
|
3732
|
+
{
|
|
3733
|
+
"aria-label": messages.pagination.first,
|
|
3734
|
+
className: navButtonClassName,
|
|
3735
|
+
disabled: previousDisabled,
|
|
3736
|
+
onClick: () => commitPageChange(1),
|
|
3737
|
+
size: "sm",
|
|
3738
|
+
type: "button",
|
|
3739
|
+
variant: "ghost",
|
|
3740
|
+
children: messages.pagination.first
|
|
3741
|
+
}
|
|
3742
|
+
) : null,
|
|
3743
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3744
|
+
Button,
|
|
3745
|
+
{
|
|
3746
|
+
"aria-label": messages.pagination.previous,
|
|
3747
|
+
className: navButtonClassName,
|
|
3748
|
+
disabled: previousDisabled,
|
|
3749
|
+
onClick: () => commitPageChange(mergedCurrent - 1),
|
|
3750
|
+
size: "sm",
|
|
3751
|
+
type: "button",
|
|
3752
|
+
variant: "ghost",
|
|
3753
|
+
children: messages.pagination.previous
|
|
3754
|
+
}
|
|
3755
|
+
),
|
|
3756
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3757
|
+
"span",
|
|
3758
|
+
{
|
|
3759
|
+
"aria-current": "page",
|
|
3760
|
+
className: "inline-flex h-9 items-center rounded-radius-md border border-transparent px-sm text-sm font-medium text-foreground",
|
|
3761
|
+
children: pageStatus
|
|
3762
|
+
}
|
|
3763
|
+
),
|
|
3764
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3765
|
+
Button,
|
|
3766
|
+
{
|
|
3767
|
+
"aria-label": messages.pagination.next,
|
|
3768
|
+
className: navButtonClassName,
|
|
3769
|
+
disabled: nextDisabled,
|
|
3770
|
+
onClick: () => commitPageChange(mergedCurrent + 1),
|
|
3771
|
+
size: "sm",
|
|
3772
|
+
type: "button",
|
|
3773
|
+
variant: "ghost",
|
|
3774
|
+
children: messages.pagination.next
|
|
3775
|
+
}
|
|
3776
|
+
),
|
|
3777
|
+
shouldShowFirstLast ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3778
|
+
Button,
|
|
3779
|
+
{
|
|
3780
|
+
"aria-label": messages.pagination.last,
|
|
3781
|
+
className: navButtonClassName,
|
|
3782
|
+
disabled: nextDisabled,
|
|
3783
|
+
onClick: () => commitPageChange(totalPages),
|
|
3784
|
+
size: "sm",
|
|
3785
|
+
type: "button",
|
|
3786
|
+
variant: "ghost",
|
|
3787
|
+
children: messages.pagination.last
|
|
3788
|
+
}
|
|
3789
|
+
) : null
|
|
3790
|
+
] });
|
|
3791
|
+
}
|
|
3792
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(AdsPagination, { "aria-label": navigationLabel, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(AdsPaginationContent, { children: [
|
|
3793
|
+
shouldShowFirstLast ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(AdsPaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3794
|
+
Button,
|
|
3795
|
+
{
|
|
3796
|
+
"aria-label": messages.pagination.first,
|
|
3797
|
+
className: navButtonClassName,
|
|
3798
|
+
disabled: previousDisabled,
|
|
3799
|
+
onClick: () => commitPageChange(1),
|
|
3800
|
+
size: "sm",
|
|
3801
|
+
type: "button",
|
|
3802
|
+
variant: "ghost",
|
|
3803
|
+
children: messages.pagination.first
|
|
3804
|
+
}
|
|
3805
|
+
) }) : null,
|
|
3806
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(AdsPaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3807
|
+
Button,
|
|
3808
|
+
{
|
|
3809
|
+
"aria-label": messages.pagination.previous,
|
|
3810
|
+
className: navButtonClassName,
|
|
3811
|
+
disabled: previousDisabled,
|
|
3812
|
+
onClick: () => commitPageChange(mergedCurrent - 1),
|
|
3813
|
+
size: "sm",
|
|
3814
|
+
type: "button",
|
|
3815
|
+
variant: "ghost",
|
|
3816
|
+
children: messages.pagination.previous
|
|
3817
|
+
}
|
|
3818
|
+
) }),
|
|
3819
|
+
paginationRange.map(
|
|
3820
|
+
(token, index) => token === "ellipsis" ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(AdsPaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(AdsPaginationEllipsis, { label: messages.pagination.morePages }) }, `ellipsis-${index}`) : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(AdsPaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3821
|
+
Button,
|
|
3822
|
+
{
|
|
3823
|
+
"aria-current": token === mergedCurrent ? "page" : void 0,
|
|
3824
|
+
className: cn(
|
|
3825
|
+
paginationButtonBaseClassName,
|
|
3826
|
+
token === mergedCurrent ? paginationButtonActiveClassName : paginationButtonInactiveClassName
|
|
3827
|
+
),
|
|
3828
|
+
disabled,
|
|
3829
|
+
onClick: () => commitPageChange(token),
|
|
3830
|
+
size: "sm",
|
|
3831
|
+
type: "button",
|
|
3832
|
+
variant: "ghost",
|
|
3833
|
+
children: token
|
|
3834
|
+
}
|
|
3835
|
+
) }, token)
|
|
3836
|
+
),
|
|
3837
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(AdsPaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3838
|
+
Button,
|
|
3839
|
+
{
|
|
3840
|
+
"aria-label": messages.pagination.next,
|
|
3841
|
+
className: navButtonClassName,
|
|
3842
|
+
disabled: nextDisabled,
|
|
3843
|
+
onClick: () => commitPageChange(mergedCurrent + 1),
|
|
3844
|
+
size: "sm",
|
|
3845
|
+
type: "button",
|
|
3846
|
+
variant: "ghost",
|
|
3847
|
+
children: messages.pagination.next
|
|
3848
|
+
}
|
|
3849
|
+
) }),
|
|
3850
|
+
shouldShowFirstLast ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(AdsPaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3851
|
+
Button,
|
|
3852
|
+
{
|
|
3853
|
+
"aria-label": messages.pagination.last,
|
|
3854
|
+
className: navButtonClassName,
|
|
3855
|
+
disabled: nextDisabled,
|
|
3856
|
+
onClick: () => commitPageChange(totalPages),
|
|
3857
|
+
size: "sm",
|
|
3858
|
+
type: "button",
|
|
3859
|
+
variant: "ghost",
|
|
3860
|
+
children: messages.pagination.last
|
|
3861
|
+
}
|
|
3862
|
+
) }) : null
|
|
3863
|
+
] }) });
|
|
3864
|
+
};
|
|
3696
3865
|
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
3697
3866
|
"div",
|
|
3698
3867
|
{
|
|
@@ -3704,7 +3873,7 @@ function AdsDataPagination({
|
|
|
3704
3873
|
),
|
|
3705
3874
|
children: [
|
|
3706
3875
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex flex-wrap items-center gap-md text-sm leading-5 text-muted-foreground", children: [
|
|
3707
|
-
totalContent ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: classNames?.total, children: totalContent }) : null,
|
|
3876
|
+
variant === "compact" ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: classNames?.total, children: compactTotalContent }) : totalContent ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: classNames?.total, children: totalContent }) : null,
|
|
3708
3877
|
showSizeChanger ? /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: cn("flex items-center gap-sm", classNames?.pageSizeChanger), children: [
|
|
3709
3878
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { children: messages.pagination.itemsPerPage }),
|
|
3710
3879
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
@@ -3729,58 +3898,7 @@ function AdsDataPagination({
|
|
|
3729
3898
|
] }) : null
|
|
3730
3899
|
] }),
|
|
3731
3900
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex flex-col gap-md sm:flex-row sm:items-center sm:justify-end", children: [
|
|
3732
|
-
|
|
3733
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(AdsPaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3734
|
-
Button,
|
|
3735
|
-
{
|
|
3736
|
-
className: cn(
|
|
3737
|
-
paginationButtonBaseClassName,
|
|
3738
|
-
paginationButtonInactiveClassName,
|
|
3739
|
-
"gap-1 px-md py-sm"
|
|
3740
|
-
),
|
|
3741
|
-
disabled: disabled || mergedCurrent <= 1,
|
|
3742
|
-
onClick: () => commitPageChange(mergedCurrent - 1),
|
|
3743
|
-
size: "sm",
|
|
3744
|
-
type: "button",
|
|
3745
|
-
variant: "ghost",
|
|
3746
|
-
children: messages.pagination.previous
|
|
3747
|
-
}
|
|
3748
|
-
) }),
|
|
3749
|
-
paginationRange.map(
|
|
3750
|
-
(token, index) => token === "ellipsis" ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(AdsPaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(AdsPaginationEllipsis, { label: messages.pagination.morePages }) }, `ellipsis-${index}`) : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(AdsPaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3751
|
-
Button,
|
|
3752
|
-
{
|
|
3753
|
-
"aria-current": token === mergedCurrent ? "page" : void 0,
|
|
3754
|
-
className: cn(
|
|
3755
|
-
paginationButtonBaseClassName,
|
|
3756
|
-
token === mergedCurrent ? paginationButtonActiveClassName : paginationButtonInactiveClassName
|
|
3757
|
-
),
|
|
3758
|
-
disabled,
|
|
3759
|
-
onClick: () => commitPageChange(token),
|
|
3760
|
-
size: "sm",
|
|
3761
|
-
type: "button",
|
|
3762
|
-
variant: "ghost",
|
|
3763
|
-
children: token
|
|
3764
|
-
}
|
|
3765
|
-
) }, token)
|
|
3766
|
-
),
|
|
3767
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(AdsPaginationItem, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3768
|
-
Button,
|
|
3769
|
-
{
|
|
3770
|
-
className: cn(
|
|
3771
|
-
paginationButtonBaseClassName,
|
|
3772
|
-
paginationButtonInactiveClassName,
|
|
3773
|
-
"gap-1 px-md py-sm"
|
|
3774
|
-
),
|
|
3775
|
-
disabled: disabled || mergedCurrent >= totalPages,
|
|
3776
|
-
onClick: () => commitPageChange(mergedCurrent + 1),
|
|
3777
|
-
size: "sm",
|
|
3778
|
-
type: "button",
|
|
3779
|
-
variant: "ghost",
|
|
3780
|
-
children: messages.pagination.next
|
|
3781
|
-
}
|
|
3782
|
-
) })
|
|
3783
|
-
] }) }),
|
|
3901
|
+
renderPageNavigation(),
|
|
3784
3902
|
showQuickJumper ? /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
3785
3903
|
"label",
|
|
3786
3904
|
{
|
|
@@ -3819,6 +3937,7 @@ function AdsDataPagination({
|
|
|
3819
3937
|
|
|
3820
3938
|
// src/components/AdsDataTable/index.tsx
|
|
3821
3939
|
var React41 = __toESM(require("react"), 1);
|
|
3940
|
+
var import_lucide_react17 = require("lucide-react");
|
|
3822
3941
|
|
|
3823
3942
|
// src/components/AdsEmpty/index.tsx
|
|
3824
3943
|
var import_class_variance_authority9 = require("class-variance-authority");
|
|
@@ -4434,6 +4553,7 @@ AdsTableExpandCell.displayName = "AdsTableExpandCell";
|
|
|
4434
4553
|
// src/components/AdsDataTable/index.tsx
|
|
4435
4554
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
4436
4555
|
var SKELETON_ROW_COUNT = 4;
|
|
4556
|
+
var FLEX_WIDTH_UNIT = 160;
|
|
4437
4557
|
var sizeClassNames = {
|
|
4438
4558
|
small: {
|
|
4439
4559
|
cell: "py-1.5 text-xs leading-4",
|
|
@@ -4452,6 +4572,9 @@ function getColumnKey(column, index) {
|
|
|
4452
4572
|
if (column.key !== void 0) {
|
|
4453
4573
|
return String(column.key);
|
|
4454
4574
|
}
|
|
4575
|
+
if (column.field) {
|
|
4576
|
+
return column.field;
|
|
4577
|
+
}
|
|
4455
4578
|
if (Array.isArray(column.dataIndex)) {
|
|
4456
4579
|
return column.dataIndex.join(".");
|
|
4457
4580
|
}
|
|
@@ -4460,6 +4583,17 @@ function getColumnKey(column, index) {
|
|
|
4460
4583
|
}
|
|
4461
4584
|
return `column-${index}`;
|
|
4462
4585
|
}
|
|
4586
|
+
function getValueByFieldPath(record, field) {
|
|
4587
|
+
if (!field) {
|
|
4588
|
+
return void 0;
|
|
4589
|
+
}
|
|
4590
|
+
return field.split(".").reduce((value, key) => {
|
|
4591
|
+
if (value && typeof value === "object") {
|
|
4592
|
+
return value[key];
|
|
4593
|
+
}
|
|
4594
|
+
return void 0;
|
|
4595
|
+
}, record);
|
|
4596
|
+
}
|
|
4463
4597
|
function getColumnValue(record, dataIndex) {
|
|
4464
4598
|
if (dataIndex === void 0) {
|
|
4465
4599
|
return void 0;
|
|
@@ -4493,10 +4627,45 @@ function compareValues(valueA, valueB) {
|
|
|
4493
4627
|
}
|
|
4494
4628
|
return String(valueA ?? "").localeCompare(String(valueB ?? ""));
|
|
4495
4629
|
}
|
|
4496
|
-
function
|
|
4497
|
-
|
|
4630
|
+
function toPixelWidth(value) {
|
|
4631
|
+
if (typeof value === "number" && Number.isFinite(value)) {
|
|
4632
|
+
return value;
|
|
4633
|
+
}
|
|
4634
|
+
if (typeof value === "string") {
|
|
4635
|
+
const matched = Number.parseFloat(value);
|
|
4636
|
+
return Number.isFinite(matched) ? matched : void 0;
|
|
4637
|
+
}
|
|
4638
|
+
return void 0;
|
|
4639
|
+
}
|
|
4640
|
+
function normalizeFilterValue(value) {
|
|
4641
|
+
if (value === null || value === void 0) {
|
|
4642
|
+
return "";
|
|
4643
|
+
}
|
|
4644
|
+
if (typeof value === "string" || typeof value === "number") {
|
|
4645
|
+
return String(value);
|
|
4646
|
+
}
|
|
4647
|
+
return JSON.stringify(value);
|
|
4648
|
+
}
|
|
4649
|
+
function getResolvedColumnWidth(column, overrideWidth) {
|
|
4650
|
+
if (overrideWidth !== void 0) {
|
|
4651
|
+
return overrideWidth;
|
|
4652
|
+
}
|
|
4498
4653
|
if (column.width !== void 0) {
|
|
4499
|
-
|
|
4654
|
+
return column.width;
|
|
4655
|
+
}
|
|
4656
|
+
if (column.flex !== void 0 && Number.isFinite(column.flex) && column.flex > 0) {
|
|
4657
|
+
return `${Math.max(column.flex, 1) * FLEX_WIDTH_UNIT}px`;
|
|
4658
|
+
}
|
|
4659
|
+
return void 0;
|
|
4660
|
+
}
|
|
4661
|
+
function getCellStyle(column, overrideWidth) {
|
|
4662
|
+
const style = {};
|
|
4663
|
+
const resolvedWidth = getResolvedColumnWidth(column, overrideWidth);
|
|
4664
|
+
if (resolvedWidth !== void 0) {
|
|
4665
|
+
style.width = resolvedWidth;
|
|
4666
|
+
}
|
|
4667
|
+
if (column.minWidth !== void 0) {
|
|
4668
|
+
style.minWidth = column.minWidth;
|
|
4500
4669
|
}
|
|
4501
4670
|
if (column.align !== void 0) {
|
|
4502
4671
|
style.textAlign = column.align;
|
|
@@ -4504,16 +4673,79 @@ function getCellStyle(column) {
|
|
|
4504
4673
|
return Object.keys(style).length > 0 ? style : void 0;
|
|
4505
4674
|
}
|
|
4506
4675
|
function renderCellValue(value, ellipsis) {
|
|
4507
|
-
if (React41.isValidElement(value)
|
|
4508
|
-
return value
|
|
4676
|
+
if (React41.isValidElement(value)) {
|
|
4677
|
+
return value;
|
|
4678
|
+
}
|
|
4679
|
+
if (value === null || value === void 0) {
|
|
4680
|
+
return "";
|
|
4509
4681
|
}
|
|
4510
4682
|
const stringValue = typeof value === "string" || typeof value === "number" ? String(value) : JSON.stringify(value);
|
|
4511
4683
|
if (ellipsis) {
|
|
4512
4684
|
const shouldShowTitle = typeof ellipsis === "object" ? ellipsis.showTitle !== false : true;
|
|
4513
|
-
|
|
4685
|
+
const maxWidth = typeof ellipsis === "object" ? ellipsis.maxWidth : void 0;
|
|
4686
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4687
|
+
"div",
|
|
4688
|
+
{
|
|
4689
|
+
className: "truncate",
|
|
4690
|
+
style: maxWidth !== void 0 ? { maxWidth } : void 0,
|
|
4691
|
+
title: shouldShowTitle ? stringValue : void 0,
|
|
4692
|
+
children: stringValue
|
|
4693
|
+
}
|
|
4694
|
+
);
|
|
4514
4695
|
}
|
|
4515
4696
|
return stringValue;
|
|
4516
4697
|
}
|
|
4698
|
+
function getColumnHeader(column, columnKey) {
|
|
4699
|
+
return column.title ?? column.headerName ?? columnKey;
|
|
4700
|
+
}
|
|
4701
|
+
function getColumnRawValue(column, record, index) {
|
|
4702
|
+
if (column.valueGetter) {
|
|
4703
|
+
return column.valueGetter(record, index);
|
|
4704
|
+
}
|
|
4705
|
+
if (column.field) {
|
|
4706
|
+
return getValueByFieldPath(record, column.field);
|
|
4707
|
+
}
|
|
4708
|
+
return getColumnValue(record, column.dataIndex);
|
|
4709
|
+
}
|
|
4710
|
+
function resolveRenderedCellContent(column, record, index) {
|
|
4711
|
+
const rawValue = getColumnRawValue(column, record, index);
|
|
4712
|
+
const formattedValue = column.valueFormatter ? column.valueFormatter(rawValue, record, index) : rawValue;
|
|
4713
|
+
if (column.render) {
|
|
4714
|
+
return column.render(formattedValue, record, index);
|
|
4715
|
+
}
|
|
4716
|
+
if (column.cellRenderer) {
|
|
4717
|
+
return column.cellRenderer({
|
|
4718
|
+
value: rawValue,
|
|
4719
|
+
formattedValue,
|
|
4720
|
+
record,
|
|
4721
|
+
data: record,
|
|
4722
|
+
index,
|
|
4723
|
+
column
|
|
4724
|
+
});
|
|
4725
|
+
}
|
|
4726
|
+
return formattedValue;
|
|
4727
|
+
}
|
|
4728
|
+
function shouldIgnoreRowClick(event) {
|
|
4729
|
+
const target = event.target;
|
|
4730
|
+
if (!(target instanceof HTMLElement)) {
|
|
4731
|
+
return false;
|
|
4732
|
+
}
|
|
4733
|
+
return Boolean(
|
|
4734
|
+
target.closest(
|
|
4735
|
+
[
|
|
4736
|
+
"a",
|
|
4737
|
+
"button",
|
|
4738
|
+
"input",
|
|
4739
|
+
"select",
|
|
4740
|
+
"textarea",
|
|
4741
|
+
"[role='checkbox']",
|
|
4742
|
+
"[role='radio']",
|
|
4743
|
+
"[role='button']",
|
|
4744
|
+
"[data-ads-row-click-stop]"
|
|
4745
|
+
].join(",")
|
|
4746
|
+
)
|
|
4747
|
+
);
|
|
4748
|
+
}
|
|
4517
4749
|
function getInitialSortState(columns) {
|
|
4518
4750
|
const columnIndex = columns.findIndex((column2) => column2.defaultSortOrder !== void 0);
|
|
4519
4751
|
if (columnIndex === -1) {
|
|
@@ -4530,6 +4762,16 @@ function getInitialSortState(columns) {
|
|
|
4530
4762
|
order
|
|
4531
4763
|
};
|
|
4532
4764
|
}
|
|
4765
|
+
function getInitialFilterValues(columns) {
|
|
4766
|
+
return columns.reduce((accumulator, column, index) => {
|
|
4767
|
+
const columnKey = getColumnKey(column, index);
|
|
4768
|
+
const value = column.filterValue ?? column.defaultFilterValue;
|
|
4769
|
+
if (value !== void 0) {
|
|
4770
|
+
accumulator[columnKey] = value;
|
|
4771
|
+
}
|
|
4772
|
+
return accumulator;
|
|
4773
|
+
}, {});
|
|
4774
|
+
}
|
|
4533
4775
|
function AdsDataTable({
|
|
4534
4776
|
className,
|
|
4535
4777
|
columns,
|
|
@@ -4549,7 +4791,9 @@ function AdsDataTable({
|
|
|
4549
4791
|
footer,
|
|
4550
4792
|
tableClassName,
|
|
4551
4793
|
classNames,
|
|
4552
|
-
onSortChange
|
|
4794
|
+
onSortChange,
|
|
4795
|
+
onRowClick,
|
|
4796
|
+
suppressRowClickSelection = true
|
|
4553
4797
|
}) {
|
|
4554
4798
|
const { messages } = useAdsI18n();
|
|
4555
4799
|
const resolvedColumns = React41.useMemo(() => columns.filter(Boolean), [columns]);
|
|
@@ -4559,15 +4803,20 @@ function AdsDataTable({
|
|
|
4559
4803
|
const [internalSelectedKeys, setInternalSelectedKeys] = React41.useState(
|
|
4560
4804
|
rowSelection?.defaultSelectedRowKeys ?? rowSelection?.selectedRowKeys ?? []
|
|
4561
4805
|
);
|
|
4806
|
+
const [internalFilterValues, setInternalFilterValues] = React41.useState(
|
|
4807
|
+
() => getInitialFilterValues(resolvedColumns)
|
|
4808
|
+
);
|
|
4562
4809
|
const [internalExpandedKeys, setInternalExpandedKeys] = React41.useState(
|
|
4563
4810
|
expandable?.defaultExpandedRowKeys ?? expandable?.expandedRowKeys ?? []
|
|
4564
4811
|
);
|
|
4812
|
+
const [internalColumnWidths, setInternalColumnWidths] = React41.useState({});
|
|
4565
4813
|
const [internalCurrentPage, setInternalCurrentPage] = React41.useState(
|
|
4566
4814
|
pagination !== false ? pagination.defaultCurrent ?? pagination.current ?? 1 : 1
|
|
4567
4815
|
);
|
|
4568
4816
|
const [internalPageSize, setInternalPageSize] = React41.useState(
|
|
4569
4817
|
pagination !== false ? pagination.defaultPageSize ?? pagination.pageSize ?? 10 : 10
|
|
4570
4818
|
);
|
|
4819
|
+
const [activeResize, setActiveResize] = React41.useState(null);
|
|
4571
4820
|
React41.useEffect(() => {
|
|
4572
4821
|
if (rowSelection?.selectedRowKeys !== void 0) {
|
|
4573
4822
|
setInternalSelectedKeys(rowSelection.selectedRowKeys);
|
|
@@ -4588,6 +4837,27 @@ function AdsDataTable({
|
|
|
4588
4837
|
setInternalPageSize(pagination.pageSize);
|
|
4589
4838
|
}
|
|
4590
4839
|
}, [pagination]);
|
|
4840
|
+
React41.useEffect(() => {
|
|
4841
|
+
setInternalFilterValues((previous) => {
|
|
4842
|
+
const next = { ...previous };
|
|
4843
|
+
let hasChanged = false;
|
|
4844
|
+
resolvedColumns.forEach((column, index) => {
|
|
4845
|
+
const columnKey = getColumnKey(column, index);
|
|
4846
|
+
if (column.filterValue !== void 0) {
|
|
4847
|
+
if (next[columnKey] !== column.filterValue) {
|
|
4848
|
+
next[columnKey] = column.filterValue;
|
|
4849
|
+
hasChanged = true;
|
|
4850
|
+
}
|
|
4851
|
+
return;
|
|
4852
|
+
}
|
|
4853
|
+
if (!(columnKey in next) && column.defaultFilterValue !== void 0) {
|
|
4854
|
+
next[columnKey] = column.defaultFilterValue;
|
|
4855
|
+
hasChanged = true;
|
|
4856
|
+
}
|
|
4857
|
+
});
|
|
4858
|
+
return hasChanged ? next : previous;
|
|
4859
|
+
});
|
|
4860
|
+
}, [resolvedColumns]);
|
|
4591
4861
|
const controlledSortState = React41.useMemo(() => {
|
|
4592
4862
|
const columnIndex = resolvedColumns.findIndex((column2) => column2.sortOrder !== void 0);
|
|
4593
4863
|
if (columnIndex === -1) {
|
|
@@ -4606,22 +4876,56 @@ function AdsDataTable({
|
|
|
4606
4876
|
const hasSelectionColumn = Boolean(rowSelection);
|
|
4607
4877
|
const hasExpandableColumn = Boolean(expandable?.expandedRowRender);
|
|
4608
4878
|
const density = sizeClassNames[size];
|
|
4879
|
+
const paginationMode = pagination === false ? "client" : pagination.mode ?? "client";
|
|
4880
|
+
const allowsRowSelectionByClick = Boolean(rowSelection) && !suppressRowClickSelection;
|
|
4881
|
+
const filterValues = React41.useMemo(
|
|
4882
|
+
() => resolvedColumns.reduce((accumulator, column, index) => {
|
|
4883
|
+
const columnKey = getColumnKey(column, index);
|
|
4884
|
+
accumulator[columnKey] = column.filterValue ?? internalFilterValues[columnKey] ?? "";
|
|
4885
|
+
return accumulator;
|
|
4886
|
+
}, {}),
|
|
4887
|
+
[internalFilterValues, resolvedColumns]
|
|
4888
|
+
);
|
|
4889
|
+
const filteredData = React41.useMemo(() => {
|
|
4890
|
+
const filterableColumns = resolvedColumns.filter((column) => column.filter);
|
|
4891
|
+
if (filterableColumns.length === 0) {
|
|
4892
|
+
return dataSource;
|
|
4893
|
+
}
|
|
4894
|
+
return dataSource.filter(
|
|
4895
|
+
(record, index) => filterableColumns.every((column) => {
|
|
4896
|
+
const columnKey = getColumnKey(column, resolvedColumns.indexOf(column));
|
|
4897
|
+
const filterValue = filterValues[columnKey]?.trim();
|
|
4898
|
+
if (!filterValue || column.filterMode === "server") {
|
|
4899
|
+
return true;
|
|
4900
|
+
}
|
|
4901
|
+
const rawValue = getColumnRawValue(column, record, index);
|
|
4902
|
+
if (typeof column.filter === "function") {
|
|
4903
|
+
return column.filter(filterValue, record, index, rawValue);
|
|
4904
|
+
}
|
|
4905
|
+
return normalizeFilterValue(rawValue).toLowerCase().includes(filterValue.toLowerCase());
|
|
4906
|
+
})
|
|
4907
|
+
);
|
|
4908
|
+
}, [dataSource, filterValues, resolvedColumns]);
|
|
4609
4909
|
const sortedData = React41.useMemo(() => {
|
|
4610
4910
|
if (!sortState || !sortState.column || sortState.order === null) {
|
|
4611
|
-
return
|
|
4911
|
+
return filteredData;
|
|
4612
4912
|
}
|
|
4613
4913
|
const column = sortState.column;
|
|
4614
4914
|
const sortable = column.sorter;
|
|
4615
4915
|
if (!sortable) {
|
|
4616
|
-
return
|
|
4916
|
+
return filteredData;
|
|
4617
4917
|
}
|
|
4618
|
-
const sorterFn = typeof sortable === "function" ? sortable : (a, b) =>
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
-
|
|
4622
|
-
|
|
4918
|
+
const sorterFn = typeof sortable === "function" ? sortable : (a, b) => {
|
|
4919
|
+
const indexA = filteredData.indexOf(a);
|
|
4920
|
+
const indexB = filteredData.indexOf(b);
|
|
4921
|
+
return compareValues(
|
|
4922
|
+
getColumnRawValue(column, a, indexA),
|
|
4923
|
+
getColumnRawValue(column, b, indexB)
|
|
4924
|
+
);
|
|
4925
|
+
};
|
|
4926
|
+
const nextData = [...filteredData].sort(sorterFn);
|
|
4623
4927
|
return sortState.order === "descend" ? nextData.reverse() : nextData;
|
|
4624
|
-
}, [
|
|
4928
|
+
}, [filteredData, sortState]);
|
|
4625
4929
|
const resolvedTotal = pagination === false ? sortedData.length : pagination.total ?? sortedData.length;
|
|
4626
4930
|
const currentPageSize = pagination === false ? Math.max(sortedData.length, 1) : Math.max(1, pagination.pageSize ?? internalPageSize);
|
|
4627
4931
|
const totalPages = pagination === false ? 1 : Math.max(1, Math.ceil(Math.max(resolvedTotal, 0) / currentPageSize));
|
|
@@ -4638,12 +4942,12 @@ function AdsDataTable({
|
|
|
4638
4942
|
}
|
|
4639
4943
|
}, [currentPage, internalCurrentPage, pagination]);
|
|
4640
4944
|
const paginatedData = React41.useMemo(() => {
|
|
4641
|
-
if (pagination === false) {
|
|
4945
|
+
if (pagination === false || paginationMode === "server") {
|
|
4642
4946
|
return sortedData;
|
|
4643
4947
|
}
|
|
4644
4948
|
const start = (currentPage - 1) * currentPageSize;
|
|
4645
4949
|
return sortedData.slice(start, start + currentPageSize);
|
|
4646
|
-
}, [currentPage, currentPageSize, pagination, sortedData]);
|
|
4950
|
+
}, [currentPage, currentPageSize, pagination, paginationMode, sortedData]);
|
|
4647
4951
|
const handleSortChange = React41.useCallback(
|
|
4648
4952
|
(column, columnKey, nextOrder) => {
|
|
4649
4953
|
const nextSortState = nextOrder === null ? null : {
|
|
@@ -4658,6 +4962,21 @@ function AdsDataTable({
|
|
|
4658
4962
|
},
|
|
4659
4963
|
[controlledSortState, onSortChange]
|
|
4660
4964
|
);
|
|
4965
|
+
const handleFilterChange = React41.useCallback(
|
|
4966
|
+
(column, columnKey, nextValue) => {
|
|
4967
|
+
if (column.filterValue === void 0) {
|
|
4968
|
+
setInternalFilterValues((previous) => ({
|
|
4969
|
+
...previous,
|
|
4970
|
+
[columnKey]: nextValue
|
|
4971
|
+
}));
|
|
4972
|
+
}
|
|
4973
|
+
if (pagination !== false && pagination.current === void 0) {
|
|
4974
|
+
setInternalCurrentPage(1);
|
|
4975
|
+
}
|
|
4976
|
+
column.onFilterChange?.(nextValue);
|
|
4977
|
+
},
|
|
4978
|
+
[pagination]
|
|
4979
|
+
);
|
|
4661
4980
|
const updateSelection = React41.useCallback(
|
|
4662
4981
|
(nextKeys) => {
|
|
4663
4982
|
if (!rowSelection) {
|
|
@@ -4673,6 +4992,20 @@ function AdsDataTable({
|
|
|
4673
4992
|
},
|
|
4674
4993
|
[dataSource, rowKey, rowSelection]
|
|
4675
4994
|
);
|
|
4995
|
+
const toggleSelectionFromRowClick = React41.useCallback(
|
|
4996
|
+
(record, recordKey) => {
|
|
4997
|
+
if (!allowsRowSelectionByClick || !rowSelection) {
|
|
4998
|
+
return;
|
|
4999
|
+
}
|
|
5000
|
+
if (rowSelection.type === "radio") {
|
|
5001
|
+
updateSelection([recordKey]);
|
|
5002
|
+
return;
|
|
5003
|
+
}
|
|
5004
|
+
const nextKeys = selectedKeys.includes(recordKey) ? selectedKeys.filter((key) => key !== recordKey) : [...selectedKeys, recordKey];
|
|
5005
|
+
updateSelection(Array.from(new Set(nextKeys)));
|
|
5006
|
+
},
|
|
5007
|
+
[allowsRowSelectionByClick, rowSelection, selectedKeys, updateSelection]
|
|
5008
|
+
);
|
|
4676
5009
|
const toggleExpanded = React41.useCallback(
|
|
4677
5010
|
(record, recordKey) => {
|
|
4678
5011
|
if (!expandable?.expandedRowRender) {
|
|
@@ -4724,6 +5057,136 @@ function AdsDataTable({
|
|
|
4724
5057
|
},
|
|
4725
5058
|
[pagination]
|
|
4726
5059
|
);
|
|
5060
|
+
const visibleRowEntries = React41.useMemo(
|
|
5061
|
+
() => paginatedData.map((record, index) => ({
|
|
5062
|
+
key: resolveRowKey(record, index, rowKey),
|
|
5063
|
+
record
|
|
5064
|
+
})),
|
|
5065
|
+
[paginatedData, rowKey]
|
|
5066
|
+
);
|
|
5067
|
+
const visibleSelectableKeys = React41.useMemo(
|
|
5068
|
+
() => visibleRowEntries.map((entry) => entry.key),
|
|
5069
|
+
[visibleRowEntries]
|
|
5070
|
+
);
|
|
5071
|
+
const selectedVisibleCount = React41.useMemo(
|
|
5072
|
+
() => visibleSelectableKeys.filter((key) => selectedKeys.includes(key)).length,
|
|
5073
|
+
[selectedKeys, visibleSelectableKeys]
|
|
5074
|
+
);
|
|
5075
|
+
const allVisibleRowsSelected = visibleSelectableKeys.length > 0 && selectedVisibleCount === visibleSelectableKeys.length;
|
|
5076
|
+
const someVisibleRowsSelected = selectedVisibleCount > 0 && selectedVisibleCount < visibleSelectableKeys.length;
|
|
5077
|
+
const getColumnWidthOverride = React41.useCallback(
|
|
5078
|
+
(column, columnKey) => internalColumnWidths[columnKey] ?? getResolvedColumnWidth(column),
|
|
5079
|
+
[internalColumnWidths]
|
|
5080
|
+
);
|
|
5081
|
+
const startColumnResize = React41.useCallback(
|
|
5082
|
+
(event, column, columnKey) => {
|
|
5083
|
+
event.preventDefault();
|
|
5084
|
+
event.stopPropagation();
|
|
5085
|
+
const startWidth = toPixelWidth(internalColumnWidths[columnKey]) ?? toPixelWidth(getResolvedColumnWidth(column)) ?? toPixelWidth(column.minWidth) ?? FLEX_WIDTH_UNIT;
|
|
5086
|
+
const minWidth = Math.max(toPixelWidth(column.minWidth) ?? 96, 48);
|
|
5087
|
+
const resizeState = {
|
|
5088
|
+
columnKey,
|
|
5089
|
+
minWidth,
|
|
5090
|
+
startWidth,
|
|
5091
|
+
startX: event.clientX
|
|
5092
|
+
};
|
|
5093
|
+
setActiveResize(resizeState);
|
|
5094
|
+
const handleMouseMove = (nextEvent) => {
|
|
5095
|
+
const delta = nextEvent.clientX - resizeState.startX;
|
|
5096
|
+
const nextWidth = Math.max(resizeState.minWidth, resizeState.startWidth + delta);
|
|
5097
|
+
setInternalColumnWidths((previous) => ({
|
|
5098
|
+
...previous,
|
|
5099
|
+
[resizeState.columnKey]: nextWidth
|
|
5100
|
+
}));
|
|
5101
|
+
};
|
|
5102
|
+
const handleMouseUp = () => {
|
|
5103
|
+
setActiveResize(null);
|
|
5104
|
+
window.removeEventListener("mousemove", handleMouseMove);
|
|
5105
|
+
window.removeEventListener("mouseup", handleMouseUp);
|
|
5106
|
+
};
|
|
5107
|
+
window.addEventListener("mousemove", handleMouseMove);
|
|
5108
|
+
window.addEventListener("mouseup", handleMouseUp);
|
|
5109
|
+
},
|
|
5110
|
+
[internalColumnWidths]
|
|
5111
|
+
);
|
|
5112
|
+
const renderColumnHeader = React41.useCallback(
|
|
5113
|
+
(column, columnKey, columnSortOrder) => {
|
|
5114
|
+
const headerTitle = getColumnHeader(column, columnKey);
|
|
5115
|
+
const hasSorter = Boolean(column.sorter);
|
|
5116
|
+
const hasFilter = Boolean(column.filter);
|
|
5117
|
+
const hasResizeHandle = Boolean(column.resizable);
|
|
5118
|
+
if (!hasSorter && !hasFilter && !hasResizeHandle) {
|
|
5119
|
+
return headerTitle;
|
|
5120
|
+
}
|
|
5121
|
+
const nextOrder = columnSortOrder === null ? "ascend" : columnSortOrder === "ascend" ? "descend" : null;
|
|
5122
|
+
const actionLabel = nextOrder === "ascend" ? messages.table.sortAscending : nextOrder === "descend" ? messages.table.sortDescending : messages.table.clearSort;
|
|
5123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "relative flex min-w-0 items-center gap-2 pr-3", children: [
|
|
5124
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex min-w-0 flex-1 items-center justify-between gap-2", children: [
|
|
5125
|
+
hasSorter ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
5126
|
+
Button,
|
|
5127
|
+
{
|
|
5128
|
+
"aria-label": `${headerTitle} ${actionLabel}`,
|
|
5129
|
+
className: cn(
|
|
5130
|
+
"h-8 min-w-0 flex-1 justify-between rounded-radius-md border-0 bg-transparent px-0 text-left shadow-none hover:bg-transparent focus-visible:ring-0",
|
|
5131
|
+
"hover:text-[var(--card-foreground)]"
|
|
5132
|
+
),
|
|
5133
|
+
onClick: () => handleSortChange(column, columnKey, nextOrder),
|
|
5134
|
+
size: "sm",
|
|
5135
|
+
type: "button",
|
|
5136
|
+
variant: "ghost",
|
|
5137
|
+
children: [
|
|
5138
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "truncate", children: headerTitle }),
|
|
5139
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "inline-flex h-4 w-4 items-center justify-center text-icon-muted", children: columnSortOrder === "ascend" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react17.ChevronDown, { className: "h-4 w-4 rotate-180" }) : columnSortOrder === "descend" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react17.ChevronDown, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react17.ChevronDown, { className: "h-4 w-4 opacity-60" }) })
|
|
5140
|
+
]
|
|
5141
|
+
}
|
|
5142
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "truncate", children: headerTitle }),
|
|
5143
|
+
hasFilter ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(AdsPopover, { children: [
|
|
5144
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(AdsPopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
5145
|
+
Button,
|
|
5146
|
+
{
|
|
5147
|
+
"aria-label": `${headerTitle} ${messages.table.filterColumn}`,
|
|
5148
|
+
className: cn(
|
|
5149
|
+
"h-6 w-6 shrink-0 rounded-[6px] border-0 bg-transparent px-0 shadow-none hover:bg-accent focus-visible:ring-0",
|
|
5150
|
+
filterValues[columnKey] ? "text-primary" : "text-icon-muted hover:text-[var(--card-foreground)]"
|
|
5151
|
+
),
|
|
5152
|
+
"data-ads-column-filter-trigger": "true",
|
|
5153
|
+
size: "sm",
|
|
5154
|
+
type: "button",
|
|
5155
|
+
variant: "ghost",
|
|
5156
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react17.Filter, { className: "h-3.5 w-3.5" })
|
|
5157
|
+
}
|
|
5158
|
+
) }),
|
|
5159
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(AdsPopoverContent, { align: "end", className: "w-64", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
5160
|
+
AdsInput,
|
|
5161
|
+
{
|
|
5162
|
+
clearable: true,
|
|
5163
|
+
onChange: (event) => handleFilterChange(column, columnKey, event.currentTarget.value),
|
|
5164
|
+
onClear: () => handleFilterChange(column, columnKey, ""),
|
|
5165
|
+
placeholder: column.filterPlaceholder,
|
|
5166
|
+
size: "sm",
|
|
5167
|
+
value: filterValues[columnKey] ?? ""
|
|
5168
|
+
}
|
|
5169
|
+
) })
|
|
5170
|
+
] }) : null
|
|
5171
|
+
] }),
|
|
5172
|
+
hasResizeHandle ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
5173
|
+
"span",
|
|
5174
|
+
{
|
|
5175
|
+
"aria-label": `Resize ${headerTitle} column`,
|
|
5176
|
+
className: cn(
|
|
5177
|
+
"absolute inset-y-1 -right-1 z-20 flex w-2 cursor-col-resize items-center justify-center rounded-full transition-colors",
|
|
5178
|
+
"before:block before:h-5 before:w-px before:rounded-full before:bg-[#4A4C55]",
|
|
5179
|
+
"hover:before:bg-[#6B6E78]",
|
|
5180
|
+
activeResize?.columnKey === columnKey ? "before:bg-[#8B8E99]" : void 0
|
|
5181
|
+
),
|
|
5182
|
+
onMouseDown: (event) => startColumnResize(event, column, columnKey),
|
|
5183
|
+
role: "separator"
|
|
5184
|
+
}
|
|
5185
|
+
) : null
|
|
5186
|
+
] });
|
|
5187
|
+
},
|
|
5188
|
+
[activeResize?.columnKey, filterValues, handleFilterChange, handleSortChange, messages.table, startColumnResize]
|
|
5189
|
+
);
|
|
4727
5190
|
const tableNode = /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(AdsTableSurface, { className: cn("flex min-h-0 flex-1 flex-col", className), children: [
|
|
4728
5191
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(AdsTableScrollArea, { fill, stickyHeader: sticky, x: scroll?.x, y: scroll?.y, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(AdsTableRoot, { className: tableClassName, children: [
|
|
4729
5192
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(AdsTableColGroup, { children: [
|
|
@@ -4732,36 +5195,39 @@ function AdsDataTable({
|
|
|
4732
5195
|
resolvedColumns.map((column, index) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4733
5196
|
AdsTableCol,
|
|
4734
5197
|
{
|
|
4735
|
-
style: column
|
|
5198
|
+
style: getCellStyle(column, getColumnWidthOverride(column, getColumnKey(column, index)))
|
|
4736
5199
|
},
|
|
4737
5200
|
getColumnKey(column, index)
|
|
4738
5201
|
))
|
|
4739
5202
|
] }),
|
|
4740
5203
|
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(AdsTableHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(AdsTableRow, { children: [
|
|
4741
|
-
hasSelectionColumn ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(AdsTableHead, { className: "w-12 p-2"
|
|
5204
|
+
hasSelectionColumn ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(AdsTableHead, { className: "w-12 p-2", children: rowSelection?.type !== "radio" && !rowSelection?.hideSelectAll ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
5205
|
+
Checkbox2,
|
|
5206
|
+
{
|
|
5207
|
+
"aria-label": messages.table.selectAllRows,
|
|
5208
|
+
checked: allVisibleRowsSelected ? true : someVisibleRowsSelected ? "indeterminate" : false,
|
|
5209
|
+
disabled: visibleSelectableKeys.length === 0,
|
|
5210
|
+
onCheckedChange: (nextChecked) => {
|
|
5211
|
+
const shouldSelectAll = Boolean(nextChecked);
|
|
5212
|
+
const remainingKeys = selectedKeys.filter(
|
|
5213
|
+
(key) => !visibleSelectableKeys.includes(key)
|
|
5214
|
+
);
|
|
5215
|
+
const nextKeys = shouldSelectAll ? Array.from(/* @__PURE__ */ new Set([...remainingKeys, ...visibleSelectableKeys])) : remainingKeys;
|
|
5216
|
+
updateSelection(nextKeys);
|
|
5217
|
+
},
|
|
5218
|
+
onClick: (event) => event.stopPropagation()
|
|
5219
|
+
}
|
|
5220
|
+
) }) : null }) : null,
|
|
4742
5221
|
hasExpandableColumn ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(AdsTableHead, { className: "w-12 p-2" }) : null,
|
|
4743
5222
|
resolvedColumns.map((column, index) => {
|
|
4744
5223
|
const columnKey = getColumnKey(column, index);
|
|
4745
5224
|
const columnSortOrder = sortState?.columnKey === columnKey ? sortState.order : column.sortOrder ?? null;
|
|
4746
|
-
if (column.sorter) {
|
|
4747
|
-
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4748
|
-
AdsTableSortHeader,
|
|
4749
|
-
{
|
|
4750
|
-
className: cn(density.head, column.className),
|
|
4751
|
-
onToggleSort: (nextOrder) => handleSortChange(column, columnKey, nextOrder),
|
|
4752
|
-
sortOrder: columnSortOrder,
|
|
4753
|
-
style: getCellStyle(column),
|
|
4754
|
-
title: column.title ?? columnKey
|
|
4755
|
-
},
|
|
4756
|
-
columnKey
|
|
4757
|
-
);
|
|
4758
|
-
}
|
|
4759
5225
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4760
5226
|
AdsTableHead,
|
|
4761
5227
|
{
|
|
4762
|
-
className: cn(density.head, column.className),
|
|
4763
|
-
style: getCellStyle(column),
|
|
4764
|
-
children: column
|
|
5228
|
+
className: cn(density.head, column.className, column.headerClassName),
|
|
5229
|
+
style: getCellStyle(column, getColumnWidthOverride(column, columnKey)),
|
|
5230
|
+
children: renderColumnHeader(column, columnKey, columnSortOrder)
|
|
4765
5231
|
},
|
|
4766
5232
|
columnKey
|
|
4767
5233
|
);
|
|
@@ -4786,12 +5252,24 @@ function AdsDataTable({
|
|
|
4786
5252
|
const row = /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
4787
5253
|
AdsTableRow,
|
|
4788
5254
|
{
|
|
4789
|
-
className: cn(
|
|
5255
|
+
className: cn(
|
|
5256
|
+
dataRowClassName,
|
|
5257
|
+
onRowClick ? "cursor-pointer" : void 0
|
|
5258
|
+
),
|
|
4790
5259
|
"data-state": selectedKeys.includes(recordKey) ? "selected" : void 0,
|
|
4791
|
-
onClick: () => {
|
|
5260
|
+
onClick: (event) => {
|
|
5261
|
+
if (shouldIgnoreRowClick(event)) {
|
|
5262
|
+
return;
|
|
5263
|
+
}
|
|
5264
|
+
if (onRowClick) {
|
|
5265
|
+
toggleSelectionFromRowClick(record, recordKey);
|
|
5266
|
+
onRowClick(record, index, event);
|
|
5267
|
+
return;
|
|
5268
|
+
}
|
|
4792
5269
|
if (expandable?.expandRowByClick && canExpand) {
|
|
4793
5270
|
toggleExpanded(record, recordKey);
|
|
4794
5271
|
}
|
|
5272
|
+
toggleSelectionFromRowClick(record, recordKey);
|
|
4795
5273
|
},
|
|
4796
5274
|
children: [
|
|
4797
5275
|
hasSelectionColumn ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
@@ -4819,13 +5297,22 @@ function AdsDataTable({
|
|
|
4819
5297
|
}
|
|
4820
5298
|
) : null,
|
|
4821
5299
|
resolvedColumns.map((column, columnIndex) => {
|
|
4822
|
-
const
|
|
4823
|
-
|
|
5300
|
+
const renderedValue = renderCellValue(
|
|
5301
|
+
resolveRenderedCellContent(column, record, index),
|
|
5302
|
+
column.ellipsis
|
|
5303
|
+
);
|
|
4824
5304
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4825
5305
|
AdsTableCell,
|
|
4826
5306
|
{
|
|
4827
|
-
className: cn(
|
|
4828
|
-
|
|
5307
|
+
className: cn(
|
|
5308
|
+
density.cell,
|
|
5309
|
+
column.className,
|
|
5310
|
+
column.cellClassName
|
|
5311
|
+
),
|
|
5312
|
+
style: getCellStyle(
|
|
5313
|
+
column,
|
|
5314
|
+
getColumnWidthOverride(column, getColumnKey(column, columnIndex))
|
|
5315
|
+
),
|
|
4829
5316
|
children: renderedValue
|
|
4830
5317
|
},
|
|
4831
5318
|
`${String(recordKey)}-${getColumnKey(column, columnIndex)}`
|
|
@@ -4882,10 +5369,12 @@ function AdsDataTable({
|
|
|
4882
5369
|
onPageSizeChange: handlePageSizeChange,
|
|
4883
5370
|
pageSize: currentPageSize,
|
|
4884
5371
|
pageSizeOptions: pagination.pageSizeOptions,
|
|
5372
|
+
showFirstLast: pagination.showFirstLast,
|
|
4885
5373
|
showQuickJumper: pagination.showQuickJumper,
|
|
4886
5374
|
showSizeChanger: pagination.showSizeChanger,
|
|
4887
5375
|
showTotal: pagination.showTotal,
|
|
4888
|
-
total: resolvedTotal
|
|
5376
|
+
total: resolvedTotal,
|
|
5377
|
+
variant: pagination.variant
|
|
4889
5378
|
}
|
|
4890
5379
|
) }) : null
|
|
4891
5380
|
] });
|
|
@@ -4910,21 +5399,150 @@ function AdsDataTable({
|
|
|
4910
5399
|
return tableNode;
|
|
4911
5400
|
}
|
|
4912
5401
|
|
|
5402
|
+
// src/components/AdsDataTableToolbar/index.tsx
|
|
5403
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
5404
|
+
function AdsDataTableToolbar({
|
|
5405
|
+
action,
|
|
5406
|
+
className,
|
|
5407
|
+
searchClassName,
|
|
5408
|
+
searchPlaceholder,
|
|
5409
|
+
searchValue = "",
|
|
5410
|
+
title,
|
|
5411
|
+
titleClassName,
|
|
5412
|
+
onSearchChange,
|
|
5413
|
+
onSearchClear
|
|
5414
|
+
}) {
|
|
5415
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
5416
|
+
"div",
|
|
5417
|
+
{
|
|
5418
|
+
className: cn(
|
|
5419
|
+
"flex flex-col gap-md px-6 pb-4 pt-6 md:flex-row md:items-center md:justify-between",
|
|
5420
|
+
className
|
|
5421
|
+
),
|
|
5422
|
+
children: [
|
|
5423
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "min-w-0 flex-1", children: title ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("h2", { className: cn("truncate text-xl font-medium text-white", titleClassName), children: title }) : null }),
|
|
5424
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.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_runtime46.jsx)("div", { className: "min-w-0 md:max-w-[440px] md:flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
5426
|
+
AdsInput,
|
|
5427
|
+
{
|
|
5428
|
+
className: cn(
|
|
5429
|
+
"border-[#27282F] bg-[#27282F] text-white placeholder:text-[#848484]",
|
|
5430
|
+
searchClassName
|
|
5431
|
+
),
|
|
5432
|
+
clearable: true,
|
|
5433
|
+
onChange: (event) => onSearchChange?.(event.target.value),
|
|
5434
|
+
onClear: onSearchClear,
|
|
5435
|
+
placeholder: searchPlaceholder,
|
|
5436
|
+
value: searchValue
|
|
5437
|
+
}
|
|
5438
|
+
) }),
|
|
5439
|
+
action ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "shrink-0", children: action }) : null
|
|
5440
|
+
] })
|
|
5441
|
+
]
|
|
5442
|
+
}
|
|
5443
|
+
);
|
|
5444
|
+
}
|
|
5445
|
+
|
|
5446
|
+
// src/components/AdsViewCustomersDataTable/index.tsx
|
|
5447
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
5448
|
+
function resolveHeight(value) {
|
|
5449
|
+
if (value === void 0) {
|
|
5450
|
+
return 500;
|
|
5451
|
+
}
|
|
5452
|
+
return value;
|
|
5453
|
+
}
|
|
5454
|
+
function AdsViewCustomersDataTable({
|
|
5455
|
+
columns,
|
|
5456
|
+
dataSource = [],
|
|
5457
|
+
emptyState,
|
|
5458
|
+
error = false,
|
|
5459
|
+
errorDescription = "Try again or adjust the current query.",
|
|
5460
|
+
errorState,
|
|
5461
|
+
errorTitle = "Unable to load records",
|
|
5462
|
+
height = 500,
|
|
5463
|
+
loading = false,
|
|
5464
|
+
pagination = false,
|
|
5465
|
+
retryLabel = "Retry",
|
|
5466
|
+
rowKey,
|
|
5467
|
+
scroll,
|
|
5468
|
+
searchPlaceholder = "Search customers",
|
|
5469
|
+
searchValue = "",
|
|
5470
|
+
sticky = true,
|
|
5471
|
+
title,
|
|
5472
|
+
toolbarAction,
|
|
5473
|
+
onRetry,
|
|
5474
|
+
onSearchChange,
|
|
5475
|
+
onSearchClear,
|
|
5476
|
+
...props
|
|
5477
|
+
}) {
|
|
5478
|
+
const tableHeight = resolveHeight(height);
|
|
5479
|
+
const resolvedErrorState = errorState ?? /* @__PURE__ */ (0, import_jsx_runtime47.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_runtime47.jsx)("p", { className: "text-sm font-medium text-white", children: errorTitle }),
|
|
5481
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("p", { className: "max-w-md text-sm text-[#848484]", children: errorDescription }),
|
|
5482
|
+
onRetry ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AdsButton, { intent: "primary", onClick: onRetry, children: retryLabel }) : null
|
|
5483
|
+
] });
|
|
5484
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "overflow-hidden rounded-xl border border-[#27282F] bg-[#1B1C21]", children: [
|
|
5485
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5486
|
+
AdsDataTableToolbar,
|
|
5487
|
+
{
|
|
5488
|
+
action: toolbarAction,
|
|
5489
|
+
onSearchChange,
|
|
5490
|
+
onSearchClear,
|
|
5491
|
+
searchPlaceholder,
|
|
5492
|
+
searchValue,
|
|
5493
|
+
title
|
|
5494
|
+
}
|
|
5495
|
+
),
|
|
5496
|
+
error ? resolvedErrorState : null,
|
|
5497
|
+
!error ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5498
|
+
AdsDataTable,
|
|
5499
|
+
{
|
|
5500
|
+
...props,
|
|
5501
|
+
className: cn(
|
|
5502
|
+
"rounded-none border-0 bg-[#1B1C21]",
|
|
5503
|
+
"[&_thead_th]:border-b-[#27282F] [&_thead_th]:bg-[#27282F] [&_thead_th]:text-[14px] [&_thead_th]:leading-5",
|
|
5504
|
+
"[&_tbody_td]:border-b-[#27282F] [&_tbody_td]:text-[14px] [&_tbody_td]:leading-5",
|
|
5505
|
+
"[&_tbody_tr:hover]:!bg-[#333333]",
|
|
5506
|
+
"[&_[data-slot='ads-table-root']]:bg-[#1B1C21]",
|
|
5507
|
+
"[&_[data-slot='ads-table-root']]:text-white",
|
|
5508
|
+
"[&_[data-slot='ads-table-scroll-area']]:bg-[#1B1C21]"
|
|
5509
|
+
),
|
|
5510
|
+
columns,
|
|
5511
|
+
dataSource,
|
|
5512
|
+
emptyState,
|
|
5513
|
+
loading,
|
|
5514
|
+
pagination: pagination === false ? false : {
|
|
5515
|
+
...pagination,
|
|
5516
|
+
showFirstLast: true,
|
|
5517
|
+
variant: "compact"
|
|
5518
|
+
},
|
|
5519
|
+
rowKey,
|
|
5520
|
+
scroll: {
|
|
5521
|
+
...scroll,
|
|
5522
|
+
y: scroll?.y ?? tableHeight
|
|
5523
|
+
},
|
|
5524
|
+
sticky,
|
|
5525
|
+
tableClassName: "[&_td]:text-white [&_th]:text-white"
|
|
5526
|
+
}
|
|
5527
|
+
) : null
|
|
5528
|
+
] });
|
|
5529
|
+
}
|
|
5530
|
+
|
|
4913
5531
|
// src/components/AdsProgress/index.tsx
|
|
4914
5532
|
var React43 = __toESM(require("react"), 1);
|
|
4915
5533
|
|
|
4916
5534
|
// src/primitives/progress.tsx
|
|
4917
5535
|
var React42 = __toESM(require("react"), 1);
|
|
4918
5536
|
var ProgressPrimitive = __toESM(require("@radix-ui/react-progress"), 1);
|
|
4919
|
-
var
|
|
4920
|
-
var Progress = React42.forwardRef(({ className, indicatorClassName, value, ...props }, ref) => /* @__PURE__ */ (0,
|
|
5537
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
5538
|
+
var Progress = React42.forwardRef(({ className, indicatorClassName, value, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
4921
5539
|
ProgressPrimitive.Root,
|
|
4922
5540
|
{
|
|
4923
5541
|
className: cn("relative h-4 w-full overflow-hidden rounded-full bg-secondary", className),
|
|
4924
5542
|
ref,
|
|
4925
5543
|
value,
|
|
4926
5544
|
...props,
|
|
4927
|
-
children: /* @__PURE__ */ (0,
|
|
5545
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
4928
5546
|
ProgressPrimitive.Indicator,
|
|
4929
5547
|
{
|
|
4930
5548
|
className: cn("h-full w-full flex-1 bg-primary transition-all", indicatorClassName),
|
|
@@ -4936,13 +5554,13 @@ var Progress = React42.forwardRef(({ className, indicatorClassName, value, ...pr
|
|
|
4936
5554
|
Progress.displayName = ProgressPrimitive.Root.displayName;
|
|
4937
5555
|
|
|
4938
5556
|
// src/components/AdsProgress/index.tsx
|
|
4939
|
-
var
|
|
5557
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
4940
5558
|
var progressBaseClassName = "h-2 rounded-radius-full bg-[color:color-mix(in_srgb,var(--primary)_20%,transparent)]";
|
|
4941
5559
|
var progressIndicatorVariantClassName = {
|
|
4942
5560
|
ai: "bg-brand-gradient",
|
|
4943
5561
|
default: "bg-primary"
|
|
4944
5562
|
};
|
|
4945
|
-
var Progress2 = React43.forwardRef(({ className, indicatorClassName, ...props }, ref) => /* @__PURE__ */ (0,
|
|
5563
|
+
var Progress2 = React43.forwardRef(({ className, indicatorClassName, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4946
5564
|
Progress,
|
|
4947
5565
|
{
|
|
4948
5566
|
className: cn(progressBaseClassName, className),
|
|
@@ -4971,12 +5589,12 @@ var AdsProgress = React43.forwardRef(
|
|
|
4971
5589
|
id
|
|
4972
5590
|
});
|
|
4973
5591
|
const labelId = label ? `${description.inputId}-label` : void 0;
|
|
4974
|
-
const helperNode = helperText ? /* @__PURE__ */ (0,
|
|
4975
|
-
const errorNode = errorText ? /* @__PURE__ */ (0,
|
|
4976
|
-
return /* @__PURE__ */ (0,
|
|
4977
|
-
label ? /* @__PURE__ */ (0,
|
|
5592
|
+
const helperNode = helperText ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(AdsFieldDescription, { id: description.helperId, children: helperText }) : null;
|
|
5593
|
+
const errorNode = errorText ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(AdsFieldError, { id: description.errorId, children: errorText }) : null;
|
|
5594
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(AdsFieldItem, { children: [
|
|
5595
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(AdsFieldLabel, { id: labelId, children: label }) : null,
|
|
4978
5596
|
descriptionPlacement === "above" ? helperNode : null,
|
|
4979
|
-
/* @__PURE__ */ (0,
|
|
5597
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
4980
5598
|
Progress,
|
|
4981
5599
|
{
|
|
4982
5600
|
"aria-describedby": description.describedBy,
|
|
@@ -5005,8 +5623,8 @@ var React45 = __toESM(require("react"), 1);
|
|
|
5005
5623
|
// src/primitives/slider.tsx
|
|
5006
5624
|
var React44 = __toESM(require("react"), 1);
|
|
5007
5625
|
var SliderPrimitive = __toESM(require("@radix-ui/react-slider"), 1);
|
|
5008
|
-
var
|
|
5009
|
-
var Slider = React44.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
5626
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
5627
|
+
var Slider = React44.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
5010
5628
|
SliderPrimitive.Root,
|
|
5011
5629
|
{
|
|
5012
5630
|
ref,
|
|
@@ -5016,10 +5634,10 @@ var Slider = React44.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
5016
5634
|
),
|
|
5017
5635
|
...props,
|
|
5018
5636
|
children: [
|
|
5019
|
-
/* @__PURE__ */ (0,
|
|
5637
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SliderPrimitive.Track, { className: "relative h-1.5 w-full grow overflow-hidden rounded-full bg-secondary", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SliderPrimitive.Range, { className: "absolute h-full bg-primary" }) }),
|
|
5020
5638
|
Array.from({
|
|
5021
5639
|
length: Array.isArray(props.value) ? props.value.length : Array.isArray(props.defaultValue) ? props.defaultValue.length : 1
|
|
5022
|
-
}).map((_, index) => /* @__PURE__ */ (0,
|
|
5640
|
+
}).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
5023
5641
|
SliderPrimitive.Thumb,
|
|
5024
5642
|
{
|
|
5025
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"
|
|
@@ -5032,9 +5650,9 @@ var Slider = React44.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
5032
5650
|
Slider.displayName = SliderPrimitive.Root.displayName;
|
|
5033
5651
|
|
|
5034
5652
|
// src/components/AdsSlider/index.tsx
|
|
5035
|
-
var
|
|
5653
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
5036
5654
|
var sliderBaseClassName = "py-1";
|
|
5037
|
-
var Slider2 = React45.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
5655
|
+
var Slider2 = React45.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Slider, { className: cn(sliderBaseClassName, className), ref, ...props }));
|
|
5038
5656
|
Slider2.displayName = "Slider";
|
|
5039
5657
|
var AdsSlider = React45.forwardRef(
|
|
5040
5658
|
({
|
|
@@ -5051,12 +5669,12 @@ var AdsSlider = React45.forwardRef(
|
|
|
5051
5669
|
helperText,
|
|
5052
5670
|
id
|
|
5053
5671
|
});
|
|
5054
|
-
const helperNode = helperText ? /* @__PURE__ */ (0,
|
|
5055
|
-
const errorNode = errorText ? /* @__PURE__ */ (0,
|
|
5056
|
-
return /* @__PURE__ */ (0,
|
|
5057
|
-
label ? /* @__PURE__ */ (0,
|
|
5672
|
+
const helperNode = helperText ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(AdsFieldDescription, { id: description.helperId, children: helperText }) : null;
|
|
5673
|
+
const errorNode = errorText ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(AdsFieldError, { id: description.errorId, children: errorText }) : null;
|
|
5674
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(AdsFieldItem, { children: [
|
|
5675
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(AdsFieldLabel, { children: label }) : null,
|
|
5058
5676
|
descriptionPlacement === "above" ? helperNode : null,
|
|
5059
|
-
/* @__PURE__ */ (0,
|
|
5677
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5060
5678
|
Slider2,
|
|
5061
5679
|
{
|
|
5062
5680
|
"aria-describedby": description.describedBy,
|
|
@@ -5078,8 +5696,8 @@ var React47 = __toESM(require("react"), 1);
|
|
|
5078
5696
|
// src/primitives/switch.tsx
|
|
5079
5697
|
var React46 = __toESM(require("react"), 1);
|
|
5080
5698
|
var SwitchPrimitives = __toESM(require("@radix-ui/react-switch"), 1);
|
|
5081
|
-
var
|
|
5082
|
-
var Switch = React46.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
5699
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
5700
|
+
var Switch = React46.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
5083
5701
|
SwitchPrimitives.Root,
|
|
5084
5702
|
{
|
|
5085
5703
|
className: cn(
|
|
@@ -5088,7 +5706,7 @@ var Switch = React46.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
5088
5706
|
),
|
|
5089
5707
|
...props,
|
|
5090
5708
|
ref,
|
|
5091
|
-
children: /* @__PURE__ */ (0,
|
|
5709
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
5092
5710
|
SwitchPrimitives.Thumb,
|
|
5093
5711
|
{
|
|
5094
5712
|
className: cn(
|
|
@@ -5101,15 +5719,15 @@ var Switch = React46.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
5101
5719
|
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
5102
5720
|
|
|
5103
5721
|
// src/components/AdsSwitch/index.tsx
|
|
5104
|
-
var
|
|
5722
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
5105
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";
|
|
5106
|
-
var Switch2 = React47.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
5724
|
+
var Switch2 = React47.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Switch, { className: cn(switchBaseClassName, className), ref, ...props }));
|
|
5107
5725
|
Switch2.displayName = "Switch";
|
|
5108
5726
|
var AdsSwitch = React47.forwardRef(({ className, description, id, label, switchClassName, wrapperClassName, ...props }, ref) => {
|
|
5109
5727
|
const generatedId = React47.useId();
|
|
5110
5728
|
const inputId = id ?? generatedId;
|
|
5111
5729
|
if (!label) {
|
|
5112
|
-
return /* @__PURE__ */ (0,
|
|
5730
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
5113
5731
|
Switch2,
|
|
5114
5732
|
{
|
|
5115
5733
|
className: cn(className, switchClassName),
|
|
@@ -5119,12 +5737,12 @@ var AdsSwitch = React47.forwardRef(({ className, description, id, label, switchC
|
|
|
5119
5737
|
}
|
|
5120
5738
|
);
|
|
5121
5739
|
}
|
|
5122
|
-
return /* @__PURE__ */ (0,
|
|
5123
|
-
/* @__PURE__ */ (0,
|
|
5124
|
-
/* @__PURE__ */ (0,
|
|
5125
|
-
description ? /* @__PURE__ */ (0,
|
|
5740
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("label", { className: cn("block w-full cursor-pointer", wrapperClassName), htmlFor: inputId, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex w-full items-start gap-3", children: [
|
|
5741
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-1.5 pt-0.5", children: [
|
|
5742
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "text-sm font-medium leading-5 text-foreground", children: label }),
|
|
5743
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(AdsFieldDescription, { className: "text-sm leading-5", children: description }) : null
|
|
5126
5744
|
] }),
|
|
5127
|
-
/* @__PURE__ */ (0,
|
|
5745
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
5128
5746
|
Switch2,
|
|
5129
5747
|
{
|
|
5130
5748
|
className: cn(className, switchClassName),
|
|
@@ -5143,9 +5761,9 @@ var React49 = __toESM(require("react"), 1);
|
|
|
5143
5761
|
// src/primitives/tabs.tsx
|
|
5144
5762
|
var React48 = __toESM(require("react"), 1);
|
|
5145
5763
|
var TabsPrimitive = __toESM(require("@radix-ui/react-tabs"), 1);
|
|
5146
|
-
var
|
|
5764
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
5147
5765
|
var Tabs = TabsPrimitive.Root;
|
|
5148
|
-
var TabsList = React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
5766
|
+
var TabsList = React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5149
5767
|
TabsPrimitive.List,
|
|
5150
5768
|
{
|
|
5151
5769
|
className: cn("inline-flex items-center", className),
|
|
@@ -5154,7 +5772,7 @@ var TabsList = React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
5154
5772
|
}
|
|
5155
5773
|
));
|
|
5156
5774
|
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
5157
|
-
var TabsTrigger = React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
5775
|
+
var TabsTrigger = React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5158
5776
|
TabsPrimitive.Trigger,
|
|
5159
5777
|
{
|
|
5160
5778
|
className: cn(
|
|
@@ -5166,7 +5784,7 @@ var TabsTrigger = React48.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
5166
5784
|
}
|
|
5167
5785
|
));
|
|
5168
5786
|
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
5169
|
-
var TabsContent = React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
5787
|
+
var TabsContent = React48.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
5170
5788
|
TabsPrimitive.Content,
|
|
5171
5789
|
{
|
|
5172
5790
|
className: cn("focus-visible:outline-none", className),
|
|
@@ -5177,9 +5795,9 @@ var TabsContent = React48.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
5177
5795
|
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
5178
5796
|
|
|
5179
5797
|
// src/components/AdsTabs/index.tsx
|
|
5180
|
-
var
|
|
5798
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
5181
5799
|
var AdsTabs = Tabs;
|
|
5182
|
-
var AdsTabsList = React49.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
5800
|
+
var AdsTabsList = React49.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
5183
5801
|
TabsList,
|
|
5184
5802
|
{
|
|
5185
5803
|
className: cn(
|
|
@@ -5191,7 +5809,7 @@ var AdsTabsList = React49.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
5191
5809
|
}
|
|
5192
5810
|
));
|
|
5193
5811
|
AdsTabsList.displayName = "AdsTabsList";
|
|
5194
|
-
var AdsTabsTrigger = React49.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
5812
|
+
var AdsTabsTrigger = React49.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
5195
5813
|
TabsTrigger,
|
|
5196
5814
|
{
|
|
5197
5815
|
className: cn(
|
|
@@ -5203,7 +5821,7 @@ var AdsTabsTrigger = React49.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
5203
5821
|
}
|
|
5204
5822
|
));
|
|
5205
5823
|
AdsTabsTrigger.displayName = "AdsTabsTrigger";
|
|
5206
|
-
var AdsTabsContent = React49.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
5824
|
+
var AdsTabsContent = React49.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
5207
5825
|
TabsContent,
|
|
5208
5826
|
{
|
|
5209
5827
|
className: cn(
|
|
@@ -5222,8 +5840,8 @@ var React51 = __toESM(require("react"), 1);
|
|
|
5222
5840
|
// src/primitives/toggle.tsx
|
|
5223
5841
|
var React50 = __toESM(require("react"), 1);
|
|
5224
5842
|
var TogglePrimitive = __toESM(require("@radix-ui/react-toggle"), 1);
|
|
5225
|
-
var
|
|
5226
|
-
var Toggle = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
5843
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
5844
|
+
var Toggle = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
5227
5845
|
TogglePrimitive.Root,
|
|
5228
5846
|
{
|
|
5229
5847
|
className: cn(
|
|
@@ -5237,7 +5855,7 @@ var Toggle = React50.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
5237
5855
|
Toggle.displayName = TogglePrimitive.Root.displayName;
|
|
5238
5856
|
|
|
5239
5857
|
// src/components/AdsToggle/index.tsx
|
|
5240
|
-
var
|
|
5858
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
5241
5859
|
var sizeClassName3 = {
|
|
5242
5860
|
sm: "!h-8 px-[6px] text-sm",
|
|
5243
5861
|
md: "!h-9 px-md text-sm",
|
|
@@ -5255,7 +5873,7 @@ var variantClassName = {
|
|
|
5255
5873
|
var AdsToggle = React51.forwardRef(({ children, className, size = "md", variant = "default", ...props }, ref) => {
|
|
5256
5874
|
const childCount = React51.Children.count(children);
|
|
5257
5875
|
const isIconOnly = childCount === 1 && React51.isValidElement(children);
|
|
5258
|
-
return /* @__PURE__ */ (0,
|
|
5876
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5259
5877
|
Toggle,
|
|
5260
5878
|
{
|
|
5261
5879
|
className: cn(
|
|
@@ -5279,8 +5897,8 @@ var React53 = __toESM(require("react"), 1);
|
|
|
5279
5897
|
// src/primitives/toggle-group.tsx
|
|
5280
5898
|
var React52 = __toESM(require("react"), 1);
|
|
5281
5899
|
var ToggleGroupPrimitive = __toESM(require("@radix-ui/react-toggle-group"), 1);
|
|
5282
|
-
var
|
|
5283
|
-
var ToggleGroup = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
5900
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
5901
|
+
var ToggleGroup = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
5284
5902
|
ToggleGroupPrimitive.Root,
|
|
5285
5903
|
{
|
|
5286
5904
|
className: cn("inline-flex items-center justify-start", className),
|
|
@@ -5289,7 +5907,7 @@ var ToggleGroup = React52.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
5289
5907
|
}
|
|
5290
5908
|
));
|
|
5291
5909
|
ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;
|
|
5292
|
-
var ToggleGroupItem = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
5910
|
+
var ToggleGroupItem = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
5293
5911
|
ToggleGroupPrimitive.Item,
|
|
5294
5912
|
{
|
|
5295
5913
|
className: cn(
|
|
@@ -5303,7 +5921,7 @@ var ToggleGroupItem = React52.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
5303
5921
|
ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
|
|
5304
5922
|
|
|
5305
5923
|
// src/components/AdsToggleGroup/index.tsx
|
|
5306
|
-
var
|
|
5924
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
5307
5925
|
var sizeClassName4 = {
|
|
5308
5926
|
sm: "h-8 min-w-7 px-[6px] text-sm",
|
|
5309
5927
|
md: "h-9 min-w-[34px] px-md text-sm",
|
|
@@ -5322,7 +5940,7 @@ var AdsToggleGroup = React53.forwardRef(
|
|
|
5322
5940
|
size = "md",
|
|
5323
5941
|
variant = "default",
|
|
5324
5942
|
...props
|
|
5325
|
-
}, ref) => /* @__PURE__ */ (0,
|
|
5943
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(AdsToggleGroupContext.Provider, { value: { orientation, size, variant }, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
5326
5944
|
ToggleGroup,
|
|
5327
5945
|
{
|
|
5328
5946
|
className: cn(
|
|
@@ -5343,7 +5961,7 @@ var AdsToggleGroupItem = React53.forwardRef(({ className, size, variant, ...prop
|
|
|
5343
5961
|
const resolvedOrientation = context?.orientation ?? "horizontal";
|
|
5344
5962
|
const resolvedSize = size ?? context?.size ?? "md";
|
|
5345
5963
|
const resolvedVariant = variant ?? context?.variant ?? "default";
|
|
5346
|
-
return /* @__PURE__ */ (0,
|
|
5964
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
5347
5965
|
ToggleGroupItem,
|
|
5348
5966
|
{
|
|
5349
5967
|
className: cn(
|
|
@@ -5362,7 +5980,7 @@ AdsToggleGroupItem.displayName = "AdsToggleGroupItem";
|
|
|
5362
5980
|
|
|
5363
5981
|
// src/components/AdsTextarea/index.tsx
|
|
5364
5982
|
var React54 = __toESM(require("react"), 1);
|
|
5365
|
-
var
|
|
5983
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
5366
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";
|
|
5367
5985
|
var AdsTextarea = React54.forwardRef(
|
|
5368
5986
|
({
|
|
@@ -5383,12 +6001,12 @@ var AdsTextarea = React54.forwardRef(
|
|
|
5383
6001
|
helperText,
|
|
5384
6002
|
id
|
|
5385
6003
|
});
|
|
5386
|
-
const helperNode = helperText ? /* @__PURE__ */ (0,
|
|
5387
|
-
const errorNode = errorText ? /* @__PURE__ */ (0,
|
|
5388
|
-
return /* @__PURE__ */ (0,
|
|
5389
|
-
label ? /* @__PURE__ */ (0,
|
|
6004
|
+
const helperNode = helperText ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(AdsFieldDescription, { id: description.helperId, children: helperText }) : null;
|
|
6005
|
+
const errorNode = errorText ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(AdsFieldError, { id: description.errorId, children: errorText }) : null;
|
|
6006
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(AdsFieldItem, { children: [
|
|
6007
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(AdsFieldLabel, { htmlFor: description.inputId, children: label }) : null,
|
|
5390
6008
|
descriptionPlacement === "above" ? helperNode : null,
|
|
5391
|
-
/* @__PURE__ */ (0,
|
|
6009
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
5392
6010
|
Textarea,
|
|
5393
6011
|
{
|
|
5394
6012
|
"aria-describedby": description.describedBy,
|
|
@@ -5406,7 +6024,7 @@ var AdsTextarea = React54.forwardRef(
|
|
|
5406
6024
|
...props
|
|
5407
6025
|
}
|
|
5408
6026
|
),
|
|
5409
|
-
action ? /* @__PURE__ */ (0,
|
|
6027
|
+
action ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "w-full [&>*]:w-full", children: action }) : null,
|
|
5410
6028
|
descriptionPlacement === "below" ? helperNode : null,
|
|
5411
6029
|
errorNode
|
|
5412
6030
|
] });
|
|
@@ -5420,12 +6038,12 @@ var React56 = __toESM(require("react"), 1);
|
|
|
5420
6038
|
// src/primitives/tooltip.tsx
|
|
5421
6039
|
var React55 = __toESM(require("react"), 1);
|
|
5422
6040
|
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"), 1);
|
|
5423
|
-
var
|
|
6041
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
5424
6042
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
5425
6043
|
var Tooltip = TooltipPrimitive.Root;
|
|
5426
6044
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
5427
6045
|
var TooltipArrow = TooltipPrimitive.Arrow;
|
|
5428
|
-
var TooltipContent = React55.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0,
|
|
6046
|
+
var TooltipContent = React55.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(TooltipPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
5429
6047
|
TooltipPrimitive.Content,
|
|
5430
6048
|
{
|
|
5431
6049
|
className: cn(
|
|
@@ -5440,12 +6058,12 @@ var TooltipContent = React55.forwardRef(({ className, sideOffset = 4, ...props }
|
|
|
5440
6058
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
5441
6059
|
|
|
5442
6060
|
// src/components/AdsTooltip/index.tsx
|
|
5443
|
-
var
|
|
6061
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
5444
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)]";
|
|
5445
6063
|
var AdsTooltipProvider = TooltipProvider;
|
|
5446
6064
|
var AdsTooltip = Tooltip;
|
|
5447
6065
|
var AdsTooltipTrigger = TooltipTrigger;
|
|
5448
|
-
var AdsTooltipContent = React56.forwardRef(({ align = "center", className, sideOffset = 10, ...props }, ref) => /* @__PURE__ */ (0,
|
|
6066
|
+
var AdsTooltipContent = React56.forwardRef(({ align = "center", className, sideOffset = 10, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
5449
6067
|
TooltipContent,
|
|
5450
6068
|
{
|
|
5451
6069
|
align,
|
|
@@ -5456,7 +6074,7 @@ var AdsTooltipContent = React56.forwardRef(({ align = "center", className, sideO
|
|
|
5456
6074
|
}
|
|
5457
6075
|
));
|
|
5458
6076
|
AdsTooltipContent.displayName = "AdsTooltipContent";
|
|
5459
|
-
var AdsTooltipArrow = React56.forwardRef(({ className, height = 5, width = 10, ...props }, ref) => /* @__PURE__ */ (0,
|
|
6077
|
+
var AdsTooltipArrow = React56.forwardRef(({ className, height = 5, width = 10, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
5460
6078
|
TooltipArrow,
|
|
5461
6079
|
{
|
|
5462
6080
|
className: cn("fill-[#844fff]", className),
|
|
@@ -5470,15 +6088,15 @@ AdsTooltipArrow.displayName = "AdsTooltipArrow";
|
|
|
5470
6088
|
|
|
5471
6089
|
// src/components/AdsToast/index.tsx
|
|
5472
6090
|
var React57 = __toESM(require("react"), 1);
|
|
5473
|
-
var
|
|
6091
|
+
var import_lucide_react18 = require("lucide-react");
|
|
5474
6092
|
var import_sonner = require("sonner");
|
|
5475
|
-
var
|
|
6093
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
5476
6094
|
var adsToastIconMap = {
|
|
5477
|
-
success:
|
|
5478
|
-
info:
|
|
5479
|
-
warning:
|
|
5480
|
-
error:
|
|
5481
|
-
loading:
|
|
6095
|
+
success: import_lucide_react18.CircleCheck,
|
|
6096
|
+
info: import_lucide_react18.Info,
|
|
6097
|
+
warning: import_lucide_react18.TriangleAlert,
|
|
6098
|
+
error: import_lucide_react18.OctagonX,
|
|
6099
|
+
loading: import_lucide_react18.LoaderCircle
|
|
5482
6100
|
};
|
|
5483
6101
|
function resolveToastIcon(intent, icon) {
|
|
5484
6102
|
if (icon) {
|
|
@@ -5488,7 +6106,7 @@ function resolveToastIcon(intent, icon) {
|
|
|
5488
6106
|
return null;
|
|
5489
6107
|
}
|
|
5490
6108
|
const Icon2 = adsToastIconMap[intent];
|
|
5491
|
-
return /* @__PURE__ */ (0,
|
|
6109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
5492
6110
|
Icon2,
|
|
5493
6111
|
{
|
|
5494
6112
|
"aria-hidden": true,
|
|
@@ -5512,7 +6130,7 @@ var AdsToast = React57.forwardRef(
|
|
|
5512
6130
|
...props
|
|
5513
6131
|
}, ref) => {
|
|
5514
6132
|
const resolvedIcon = resolveToastIcon(intent, icon);
|
|
5515
|
-
return /* @__PURE__ */ (0,
|
|
6133
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
5516
6134
|
"div",
|
|
5517
6135
|
{
|
|
5518
6136
|
className: cn(
|
|
@@ -5527,8 +6145,8 @@ var AdsToast = React57.forwardRef(
|
|
|
5527
6145
|
...props,
|
|
5528
6146
|
children: [
|
|
5529
6147
|
resolvedIcon,
|
|
5530
|
-
/* @__PURE__ */ (0,
|
|
5531
|
-
/* @__PURE__ */ (0,
|
|
6148
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
|
|
6149
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
5532
6150
|
"p",
|
|
5533
6151
|
{
|
|
5534
6152
|
className: cn(
|
|
@@ -5538,7 +6156,7 @@ var AdsToast = React57.forwardRef(
|
|
|
5538
6156
|
children: title
|
|
5539
6157
|
}
|
|
5540
6158
|
),
|
|
5541
|
-
description ? /* @__PURE__ */ (0,
|
|
6159
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
5542
6160
|
"p",
|
|
5543
6161
|
{
|
|
5544
6162
|
className: cn(
|
|
@@ -5549,7 +6167,7 @@ var AdsToast = React57.forwardRef(
|
|
|
5549
6167
|
}
|
|
5550
6168
|
) : null
|
|
5551
6169
|
] }),
|
|
5552
|
-
action ? /* @__PURE__ */ (0,
|
|
6170
|
+
action ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
5553
6171
|
AdsButton,
|
|
5554
6172
|
{
|
|
5555
6173
|
className: "shrink-0 rounded-radius-lg",
|
|
@@ -5575,7 +6193,7 @@ function AdsToaster({
|
|
|
5575
6193
|
...props
|
|
5576
6194
|
}) {
|
|
5577
6195
|
const { messages } = useAdsI18n();
|
|
5578
|
-
return /* @__PURE__ */ (0,
|
|
6196
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
5579
6197
|
import_sonner.Toaster,
|
|
5580
6198
|
{
|
|
5581
6199
|
closeButton: false,
|
|
@@ -5593,7 +6211,7 @@ function AdsToaster({
|
|
|
5593
6211
|
);
|
|
5594
6212
|
}
|
|
5595
6213
|
function toStageNode(intent, title, options) {
|
|
5596
|
-
return /* @__PURE__ */ (0,
|
|
6214
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
5597
6215
|
AdsToast,
|
|
5598
6216
|
{
|
|
5599
6217
|
action: options?.action,
|
|
@@ -5607,7 +6225,7 @@ function toStageNode(intent, title, options) {
|
|
|
5607
6225
|
function showAdsToast(intent, title, options) {
|
|
5608
6226
|
const { action, description, icon, ...toastOptions } = options ?? {};
|
|
5609
6227
|
return import_sonner.toast.custom(
|
|
5610
|
-
(id) => /* @__PURE__ */ (0,
|
|
6228
|
+
(id) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
5611
6229
|
AdsToast,
|
|
5612
6230
|
{
|
|
5613
6231
|
action: action ? {
|
|
@@ -5663,15 +6281,15 @@ var AdsToastManager = Object.assign(
|
|
|
5663
6281
|
// src/components/AdsDialog/index.tsx
|
|
5664
6282
|
var React58 = __toESM(require("react"), 1);
|
|
5665
6283
|
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
5666
|
-
var
|
|
5667
|
-
var
|
|
6284
|
+
var import_lucide_react19 = require("lucide-react");
|
|
6285
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
5668
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";
|
|
5669
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%]";
|
|
5670
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";
|
|
5671
6289
|
var Dialog = DialogPrimitive.Root;
|
|
5672
6290
|
var DialogTrigger = DialogPrimitive.Trigger;
|
|
5673
6291
|
var DialogPortal = DialogPrimitive.Portal;
|
|
5674
|
-
var DialogOverlay = React58.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
6292
|
+
var DialogOverlay = React58.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
5675
6293
|
DialogPrimitive.Overlay,
|
|
5676
6294
|
{
|
|
5677
6295
|
className: cn(overlayClassName2, className),
|
|
@@ -5680,7 +6298,7 @@ var DialogOverlay = React58.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
5680
6298
|
}
|
|
5681
6299
|
));
|
|
5682
6300
|
DialogOverlay.displayName = "DialogOverlay";
|
|
5683
|
-
var DialogClose = React58.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
6301
|
+
var DialogClose = React58.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
5684
6302
|
DialogPrimitive.Close,
|
|
5685
6303
|
{
|
|
5686
6304
|
className: cn(
|
|
@@ -5696,9 +6314,9 @@ var DialogContent = React58.forwardRef(
|
|
|
5696
6314
|
({ children, className, closeLabel, hideCloseButton = false, ...props }, ref) => {
|
|
5697
6315
|
const { messages } = useAdsI18n();
|
|
5698
6316
|
const resolvedCloseLabel = closeLabel ?? messages.dialog.close;
|
|
5699
|
-
return /* @__PURE__ */ (0,
|
|
5700
|
-
/* @__PURE__ */ (0,
|
|
5701
|
-
/* @__PURE__ */ (0,
|
|
6317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(DialogPortal, { children: [
|
|
6318
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(DialogOverlay, {}),
|
|
6319
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
5702
6320
|
DialogPrimitive.Content,
|
|
5703
6321
|
{
|
|
5704
6322
|
className: cn(
|
|
@@ -5710,14 +6328,14 @@ var DialogContent = React58.forwardRef(
|
|
|
5710
6328
|
...props,
|
|
5711
6329
|
children: [
|
|
5712
6330
|
children,
|
|
5713
|
-
!hideCloseButton ? /* @__PURE__ */ (0,
|
|
6331
|
+
!hideCloseButton ? /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
5714
6332
|
DialogPrimitive.Close,
|
|
5715
6333
|
{
|
|
5716
6334
|
"aria-label": resolvedCloseLabel,
|
|
5717
6335
|
className: cn(closeButtonClassName, adsTextColorClassName.card),
|
|
5718
6336
|
children: [
|
|
5719
|
-
/* @__PURE__ */ (0,
|
|
5720
|
-
/* @__PURE__ */ (0,
|
|
6337
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_lucide_react19.X, { "aria-hidden": true, className: "h-4 w-4" }),
|
|
6338
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "sr-only", children: resolvedCloseLabel })
|
|
5721
6339
|
]
|
|
5722
6340
|
}
|
|
5723
6341
|
) : null
|
|
@@ -5729,7 +6347,7 @@ var DialogContent = React58.forwardRef(
|
|
|
5729
6347
|
);
|
|
5730
6348
|
DialogContent.displayName = "DialogContent";
|
|
5731
6349
|
var DialogHeader = React58.forwardRef(
|
|
5732
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
6350
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
5733
6351
|
"div",
|
|
5734
6352
|
{
|
|
5735
6353
|
className: cn("flex flex-col gap-sm pr-8 text-left", className),
|
|
@@ -5740,7 +6358,7 @@ var DialogHeader = React58.forwardRef(
|
|
|
5740
6358
|
);
|
|
5741
6359
|
DialogHeader.displayName = "DialogHeader";
|
|
5742
6360
|
var DialogFooter = React58.forwardRef(
|
|
5743
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
6361
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
5744
6362
|
"div",
|
|
5745
6363
|
{
|
|
5746
6364
|
className: cn(
|
|
@@ -5753,7 +6371,7 @@ var DialogFooter = React58.forwardRef(
|
|
|
5753
6371
|
)
|
|
5754
6372
|
);
|
|
5755
6373
|
DialogFooter.displayName = "DialogFooter";
|
|
5756
|
-
var DialogTitle = React58.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
6374
|
+
var DialogTitle = React58.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
5757
6375
|
DialogPrimitive.Title,
|
|
5758
6376
|
{
|
|
5759
6377
|
className: cn(
|
|
@@ -5766,7 +6384,7 @@ var DialogTitle = React58.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
5766
6384
|
}
|
|
5767
6385
|
));
|
|
5768
6386
|
DialogTitle.displayName = "DialogTitle";
|
|
5769
|
-
var DialogDescription = React58.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
6387
|
+
var DialogDescription = React58.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
5770
6388
|
DialogPrimitive.Description,
|
|
5771
6389
|
{
|
|
5772
6390
|
className: cn("text-sm leading-5", adsTextColorClassName.muted, className),
|
|
@@ -5786,6 +6404,105 @@ var AdsDialogFooter = DialogFooter;
|
|
|
5786
6404
|
var AdsDialogTitle = DialogTitle;
|
|
5787
6405
|
var AdsDialogDescription = DialogDescription;
|
|
5788
6406
|
|
|
6407
|
+
// src/components/AdsMasonry/index.tsx
|
|
6408
|
+
var import_masonic = require("masonic");
|
|
6409
|
+
var import_jsx_runtime65 = 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_runtime65.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_runtime65.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_runtime65.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_runtime65.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_runtime65.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
|
+
|
|
5789
6506
|
// src/tokens/designTokens.ts
|
|
5790
6507
|
var designTokens = {
|
|
5791
6508
|
background: "#151619",
|
|
@@ -5884,6 +6601,7 @@ var designTokens = {
|
|
|
5884
6601
|
AdsCheckbox,
|
|
5885
6602
|
AdsDataPagination,
|
|
5886
6603
|
AdsDataTable,
|
|
6604
|
+
AdsDataTableToolbar,
|
|
5887
6605
|
AdsDatePicker,
|
|
5888
6606
|
AdsDateTimePicker,
|
|
5889
6607
|
AdsDialog,
|
|
@@ -5926,6 +6644,7 @@ var designTokens = {
|
|
|
5926
6644
|
AdsInputOTPGroup,
|
|
5927
6645
|
AdsInputOTPSeparator,
|
|
5928
6646
|
AdsInputOTPSlot,
|
|
6647
|
+
AdsMasonry,
|
|
5929
6648
|
AdsPagination,
|
|
5930
6649
|
AdsPaginationContent,
|
|
5931
6650
|
AdsPaginationEllipsis,
|
|
@@ -5992,6 +6711,7 @@ var designTokens = {
|
|
|
5992
6711
|
AdsTooltipContent,
|
|
5993
6712
|
AdsTooltipProvider,
|
|
5994
6713
|
AdsTooltipTrigger,
|
|
6714
|
+
AdsViewCustomersDataTable,
|
|
5995
6715
|
adsDefaultMessages,
|
|
5996
6716
|
designTokens,
|
|
5997
6717
|
useAdsI18n
|