@adsgency_npm/adsgency-ads-ui 0.1.0-alpha.7 → 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 +102 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +33 -1
- package/dist/index.d.ts +33 -1
- package/dist/index.js +101 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -107,6 +107,7 @@ __export(src_exports, {
|
|
|
107
107
|
AdsInputOTPGroup: () => AdsInputOTPGroup,
|
|
108
108
|
AdsInputOTPSeparator: () => AdsInputOTPSeparator,
|
|
109
109
|
AdsInputOTPSlot: () => AdsInputOTPSlot,
|
|
110
|
+
AdsMasonry: () => AdsMasonry,
|
|
110
111
|
AdsPagination: () => AdsPagination,
|
|
111
112
|
AdsPaginationContent: () => AdsPaginationContent,
|
|
112
113
|
AdsPaginationEllipsis: () => AdsPaginationEllipsis,
|
|
@@ -5145,7 +5146,7 @@ function AdsDataTable({
|
|
|
5145
5146
|
{
|
|
5146
5147
|
"aria-label": `${headerTitle} ${messages.table.filterColumn}`,
|
|
5147
5148
|
className: cn(
|
|
5148
|
-
"h-6 w-6 shrink-0 rounded-[6px] border
|
|
5149
|
+
"h-6 w-6 shrink-0 rounded-[6px] border-0 bg-transparent px-0 shadow-none hover:bg-accent focus-visible:ring-0",
|
|
5149
5150
|
filterValues[columnKey] ? "text-primary" : "text-icon-muted hover:text-[var(--card-foreground)]"
|
|
5150
5151
|
),
|
|
5151
5152
|
"data-ads-column-filter-trigger": "true",
|
|
@@ -6403,6 +6404,105 @@ var AdsDialogFooter = DialogFooter;
|
|
|
6403
6404
|
var AdsDialogTitle = DialogTitle;
|
|
6404
6405
|
var AdsDialogDescription = DialogDescription;
|
|
6405
6406
|
|
|
6407
|
+
// src/components/AdsMasonry/index.tsx
|
|
6408
|
+
var import_masonic = require("masonic");
|
|
6409
|
+
var import_jsx_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
|
+
|
|
6406
6506
|
// src/tokens/designTokens.ts
|
|
6407
6507
|
var designTokens = {
|
|
6408
6508
|
background: "#151619",
|
|
@@ -6544,6 +6644,7 @@ var designTokens = {
|
|
|
6544
6644
|
AdsInputOTPGroup,
|
|
6545
6645
|
AdsInputOTPSeparator,
|
|
6546
6646
|
AdsInputOTPSlot,
|
|
6647
|
+
AdsMasonry,
|
|
6547
6648
|
AdsPagination,
|
|
6548
6649
|
AdsPaginationContent,
|
|
6549
6650
|
AdsPaginationEllipsis,
|