@dimaan/ui 0.0.30 → 0.0.32
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 +219 -180
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -6
- package/dist/index.d.ts +16 -6
- package/dist/index.js +219 -180
- package/dist/index.js.map +1 -1
- package/dist/preset.css +29 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -905,7 +905,7 @@ var badgeDotSizeClass = {
|
|
|
905
905
|
md: "size-2"
|
|
906
906
|
};
|
|
907
907
|
var badgeBaseClass = "inline-flex shrink-0 items-center rounded-full border font-medium leading-none whitespace-nowrap select-none transition-colors";
|
|
908
|
-
var Badge = react.forwardRef(function Badge2({ variant = "default", size = "md", tone = "
|
|
908
|
+
var Badge = react.forwardRef(function Badge2({ variant = "default", size = "md", tone = "soft", dot = false, className, children, ...props }, ref) {
|
|
909
909
|
const variantClass = tone === "soft" ? badgeSoftVariantClass[variant] : badgeVariantClass[variant];
|
|
910
910
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
911
911
|
"span",
|
|
@@ -1066,16 +1066,16 @@ var Checkbox = react.forwardRef(function Checkbox2({
|
|
|
1066
1066
|
|
|
1067
1067
|
// src/components/date-picker/datePickerVariants.ts
|
|
1068
1068
|
var datePickerTriggerVariantClass = {
|
|
1069
|
-
default: "border border-input bg-background hover:border-ring",
|
|
1069
|
+
default: "border border-input bg-background shadow-xs hover:border-ring",
|
|
1070
1070
|
filled: "border border-transparent bg-muted hover:bg-muted/80",
|
|
1071
1071
|
ghost: "border border-transparent bg-transparent hover:bg-accent"
|
|
1072
1072
|
};
|
|
1073
1073
|
var datePickerTriggerSizeClass = {
|
|
1074
|
-
sm: "h-8 rounded-
|
|
1075
|
-
md: "h-
|
|
1076
|
-
lg: "h-11 rounded-
|
|
1074
|
+
sm: "h-8 rounded-lg ps-2.5 pe-8 text-sm gap-1.5",
|
|
1075
|
+
md: "h-10 rounded-lg ps-3 pe-9 text-sm gap-2",
|
|
1076
|
+
lg: "h-11 rounded-lg ps-4 pe-10 text-base gap-2"
|
|
1077
1077
|
};
|
|
1078
|
-
var datePickerTriggerBaseClass = "group/datepicker relative inline-flex w-full items-center text-foreground outline-none transition-[background-color,border-color,box-shadow] focus-visible:ring-[3px] focus-visible:ring-primary-glow aria-[invalid=true]:border-destructive aria-[invalid=true]:focus-visible:ring-destructive/40 disabled:pointer-events-none disabled:opacity-50 cursor-pointer";
|
|
1078
|
+
var datePickerTriggerBaseClass = "group/datepicker relative inline-flex w-full items-center text-foreground outline-none transition-[background-color,border-color,box-shadow] focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary-glow aria-[invalid=true]:border-destructive aria-[invalid=true]:focus-visible:border-destructive aria-[invalid=true]:focus-visible:ring-destructive/40 disabled:pointer-events-none disabled:opacity-50 cursor-pointer";
|
|
1079
1079
|
var datePickerPlaceholderClass = "truncate text-muted-foreground";
|
|
1080
1080
|
var datePickerValueClass = "truncate text-foreground";
|
|
1081
1081
|
var datePickerContentClass = "z-50 overflow-hidden rounded-md border border-border bg-popover p-3 text-popover-foreground shadow-md 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";
|
|
@@ -2130,16 +2130,16 @@ function FormPageSkeleton({ rowCount }) {
|
|
|
2130
2130
|
|
|
2131
2131
|
// src/components/input/inputVariants.ts
|
|
2132
2132
|
var inputVariantClass = {
|
|
2133
|
-
default: "border border-input bg-background hover:border-ring",
|
|
2133
|
+
default: "border border-input bg-background shadow-xs hover:border-ring",
|
|
2134
2134
|
filled: "border border-transparent bg-muted hover:bg-muted/80",
|
|
2135
2135
|
ghost: "border border-transparent bg-transparent hover:bg-accent"
|
|
2136
2136
|
};
|
|
2137
2137
|
var inputSizeClass = {
|
|
2138
|
-
sm: "h-8 rounded-
|
|
2139
|
-
md: "h-
|
|
2140
|
-
lg: "h-11 rounded-
|
|
2138
|
+
sm: "h-8 rounded-lg px-2.5 text-sm gap-1.5",
|
|
2139
|
+
md: "h-10 rounded-lg px-3 text-sm gap-2",
|
|
2140
|
+
lg: "h-11 rounded-lg px-4 text-base gap-2.5"
|
|
2141
2141
|
};
|
|
2142
|
-
var inputBaseClass = "group/input relative inline-flex w-full items-center text-foreground outline-none transition-[background-color,border-color,box-shadow] focus-within:ring-[3px] focus-within:ring-primary-glow aria-[invalid=true]:border-destructive aria-[invalid=true]:focus-within:ring-destructive/40 has-[input:disabled]:pointer-events-none has-[input:disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0";
|
|
2142
|
+
var inputBaseClass = "group/input relative inline-flex w-full items-center text-foreground outline-none transition-[background-color,border-color,box-shadow] focus-within:border-primary focus-within:ring-[3px] focus-within:ring-primary-glow aria-[invalid=true]:border-destructive aria-[invalid=true]:focus-within:border-destructive aria-[invalid=true]:focus-within:ring-destructive/40 has-[input:disabled]:pointer-events-none has-[input:disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0";
|
|
2143
2143
|
var Input = react.forwardRef(function Input2({
|
|
2144
2144
|
variant = "default",
|
|
2145
2145
|
inputSize = "md",
|
|
@@ -2321,9 +2321,9 @@ function Pagination({
|
|
|
2321
2321
|
children: isRtl ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { "aria-hidden": "true", className: "size-3.5" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, { "aria-hidden": "true", className: "size-3.5" })
|
|
2322
2322
|
}
|
|
2323
2323
|
),
|
|
2324
|
-
/* @__PURE__ */ jsxRuntime.
|
|
2325
|
-
|
|
2326
|
-
"
|
|
2324
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex min-w-7 items-center justify-center rounded-lg bg-gradient-table px-2.5 py-0.5 text-xs font-semibold text-white", children: pageIndex + 1 }),
|
|
2325
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "px-0.5 text-muted-foreground", children: [
|
|
2326
|
+
"/ ",
|
|
2327
2327
|
pageCount
|
|
2328
2328
|
] }),
|
|
2329
2329
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2348,7 +2348,7 @@ function Toolbar({ count, onClear, renderLabel, clearLabel, children }) {
|
|
|
2348
2348
|
{
|
|
2349
2349
|
role: "toolbar",
|
|
2350
2350
|
"aria-label": "Bulk actions",
|
|
2351
|
-
className: "flex flex-wrap items-center gap-3 rounded-
|
|
2351
|
+
className: "flex flex-wrap items-center gap-3 rounded-xl border border-border bg-muted/50 px-3.5 py-2.5 text-sm shadow-[var(--shadow-xs)]",
|
|
2352
2352
|
children: [
|
|
2353
2353
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-foreground", children: renderLabel ? renderLabel(count) : `${count} selected` }),
|
|
2354
2354
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ms-auto flex flex-wrap items-center gap-2", children: [
|
|
@@ -2364,18 +2364,18 @@ function Toolbar({ count, onClear, renderLabel, clearLabel, children }) {
|
|
|
2364
2364
|
var tableSizeClass = {
|
|
2365
2365
|
sm: {
|
|
2366
2366
|
row: "",
|
|
2367
|
-
cell: "px-3 py-
|
|
2368
|
-
head: "whitespace-nowrap px-3 py-
|
|
2367
|
+
cell: "px-3 py-2 text-xs tabular-nums",
|
|
2368
|
+
head: "whitespace-nowrap px-3 py-3 text-[11px] font-semibold uppercase tracking-wider"
|
|
2369
2369
|
},
|
|
2370
2370
|
md: {
|
|
2371
2371
|
row: "",
|
|
2372
|
-
cell: "px-4 py-
|
|
2373
|
-
head: "whitespace-nowrap px-4 py-
|
|
2372
|
+
cell: "px-4 py-3.5 text-sm tabular-nums",
|
|
2373
|
+
head: "whitespace-nowrap px-4 py-4 text-xs font-semibold uppercase tracking-wider"
|
|
2374
2374
|
},
|
|
2375
2375
|
lg: {
|
|
2376
2376
|
row: "",
|
|
2377
|
-
cell: "px-
|
|
2378
|
-
head: "whitespace-nowrap px-
|
|
2377
|
+
cell: "px-6 py-4 text-sm tabular-nums",
|
|
2378
|
+
head: "whitespace-nowrap px-6 py-5 text-[13px] font-semibold uppercase tracking-wider"
|
|
2379
2379
|
}
|
|
2380
2380
|
};
|
|
2381
2381
|
var tableBaseClass = "w-full caption-bottom border-collapse";
|
|
@@ -2432,6 +2432,7 @@ function Table(props) {
|
|
|
2432
2432
|
maxHeight,
|
|
2433
2433
|
striped = false,
|
|
2434
2434
|
onRowClick,
|
|
2435
|
+
getRowAccent,
|
|
2435
2436
|
tableRef,
|
|
2436
2437
|
pageSizeOptions = DEFAULT_PAGE_SIZE_OPTIONS,
|
|
2437
2438
|
showPagination,
|
|
@@ -2503,166 +2504,196 @@ function Table(props) {
|
|
|
2503
2504
|
children: bulkActions(selectedRowsInData)
|
|
2504
2505
|
}
|
|
2505
2506
|
),
|
|
2506
|
-
/* @__PURE__ */ jsxRuntime.
|
|
2507
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2507
2508
|
"div",
|
|
2508
2509
|
{
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
"aria-labelledby": ariaLabelledBy,
|
|
2520
|
-
"aria-rowcount": totalRowCount,
|
|
2521
|
-
className: cn(tableBaseClass, "text-sm text-foreground", tableClassName),
|
|
2522
|
-
children: [
|
|
2523
|
-
caption ? /* @__PURE__ */ jsxRuntime.jsx("caption", { className: "sr-only", children: caption }) : null,
|
|
2524
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2525
|
-
"thead",
|
|
2510
|
+
"data-testid": "table-card",
|
|
2511
|
+
className: "overflow-hidden rounded-xl border border-border bg-card shadow-[var(--shadow-card)]",
|
|
2512
|
+
children: [
|
|
2513
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2514
|
+
"div",
|
|
2515
|
+
{
|
|
2516
|
+
className: cn("overflow-x-auto", maxHeight !== void 0 && "overflow-y-auto"),
|
|
2517
|
+
style: maxHeight !== void 0 ? { maxHeight } : void 0,
|
|
2518
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2519
|
+
"table",
|
|
2526
2520
|
{
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
enableRowSelection ? /* @__PURE__ */ jsxRuntime.jsx("th", { scope: "col", className: cn("w-10", sizeClasses.head), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2537
|
-
Checkbox,
|
|
2521
|
+
ref: tableRef,
|
|
2522
|
+
"aria-label": ariaLabel,
|
|
2523
|
+
"aria-labelledby": ariaLabelledBy,
|
|
2524
|
+
"aria-rowcount": totalRowCount,
|
|
2525
|
+
className: cn(tableBaseClass, "text-sm text-foreground", tableClassName),
|
|
2526
|
+
children: [
|
|
2527
|
+
caption ? /* @__PURE__ */ jsxRuntime.jsx("caption", { className: "sr-only", children: caption }) : null,
|
|
2528
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2529
|
+
"thead",
|
|
2538
2530
|
{
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
{
|
|
2552
|
-
scope: "col",
|
|
2553
|
-
"aria-sort": column.sortable ? ariaSort : void 0,
|
|
2554
|
-
className: cn(
|
|
2555
|
-
sizeClasses.head,
|
|
2556
|
-
alignClass[column.align ?? "start"],
|
|
2557
|
-
column.className
|
|
2558
|
-
),
|
|
2559
|
-
children: column.sortable ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2560
|
-
"button",
|
|
2531
|
+
className: cn(
|
|
2532
|
+
// Faint opaque teal header tint (--color-panel-header, shared with the
|
|
2533
|
+
// list-page filter panel) + a 2px teal bottom rule. The rule is an inset
|
|
2534
|
+
// shadow so it stays attached to a sticky header instead of collapsing
|
|
2535
|
+
// into the first row's border; the tint is opaque (mixed into
|
|
2536
|
+
// --color-card) so a sticky header fully hides the rows underneath.
|
|
2537
|
+
"bg-panel-header text-muted-foreground shadow-[inset_0_-2px_0_var(--color-primary)]",
|
|
2538
|
+
maxHeight !== void 0 && "sticky top-0 z-10"
|
|
2539
|
+
),
|
|
2540
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
|
|
2541
|
+
enableRowSelection ? /* @__PURE__ */ jsxRuntime.jsx("th", { scope: "col", className: cn("w-10", sizeClasses.head), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2542
|
+
Checkbox,
|
|
2561
2543
|
{
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2544
|
+
"aria-label": "Select all rows on this page",
|
|
2545
|
+
checked: allOnPageSelected,
|
|
2546
|
+
indeterminate: someOnPageSelected,
|
|
2547
|
+
disabled: selectableRowIds.length === 0,
|
|
2548
|
+
onCheckedChange: toggleHeader
|
|
2549
|
+
}
|
|
2550
|
+
) }) : null,
|
|
2551
|
+
columns.map((column) => {
|
|
2552
|
+
const isSorted = effectiveSort.columnId === column.id;
|
|
2553
|
+
const ariaSort = isSorted ? effectiveSort.direction === "asc" ? "ascending" : "descending" : "none";
|
|
2554
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2555
|
+
"th",
|
|
2556
|
+
{
|
|
2557
|
+
scope: "col",
|
|
2558
|
+
"aria-sort": column.sortable ? ariaSort : void 0,
|
|
2559
|
+
className: cn(
|
|
2560
|
+
sizeClasses.head,
|
|
2561
|
+
alignClass[column.align ?? "start"],
|
|
2562
|
+
column.className,
|
|
2563
|
+
isSorted && "text-primary"
|
|
2564
|
+
),
|
|
2565
|
+
children: column.sortable ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2566
|
+
"button",
|
|
2570
2567
|
{
|
|
2571
|
-
|
|
2572
|
-
|
|
2568
|
+
type: "button",
|
|
2569
|
+
onClick: () => handleSortClick(column.id),
|
|
2570
|
+
className: "inline-flex items-center gap-1.5 font-inherit uppercase tracking-inherit text-inherit hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background",
|
|
2571
|
+
"aria-label": sortAriaLabel(column, effectiveSort),
|
|
2572
|
+
children: [
|
|
2573
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: renderHeader(column.header) }),
|
|
2574
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2575
|
+
SortIndicator,
|
|
2576
|
+
{
|
|
2577
|
+
active: isSorted,
|
|
2578
|
+
direction: isSorted ? effectiveSort.direction : null
|
|
2579
|
+
}
|
|
2580
|
+
)
|
|
2581
|
+
]
|
|
2573
2582
|
}
|
|
2574
|
-
)
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
})
|
|
2582
|
-
] })
|
|
2583
|
-
}
|
|
2584
|
-
),
|
|
2585
|
-
/* @__PURE__ */ jsxRuntime.jsx("tbody", { children: loading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2586
|
-
SkeletonRows,
|
|
2587
|
-
{
|
|
2588
|
-
rowCount: skeletonCount,
|
|
2589
|
-
columnCount: totalColumnCount,
|
|
2590
|
-
cellClassName: sizeClasses.cell
|
|
2591
|
-
}
|
|
2592
|
-
) : data.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2593
|
-
"td",
|
|
2594
|
-
{
|
|
2595
|
-
colSpan: totalColumnCount,
|
|
2596
|
-
className: cn(sizeClasses.cell, "py-10 text-center text-muted-foreground"),
|
|
2597
|
-
children: emptyState ?? "No data"
|
|
2598
|
-
}
|
|
2599
|
-
) }) : data.map((row, rowIndex) => {
|
|
2600
|
-
const id = getRowId(row, rowIndex);
|
|
2601
|
-
const isSelected = selected.has(id);
|
|
2602
|
-
const rowSelectable = isRowSelectable ? isRowSelectable(row) : true;
|
|
2603
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2604
|
-
"tr",
|
|
2605
|
-
{
|
|
2606
|
-
"data-selected": isSelected ? "true" : void 0,
|
|
2607
|
-
"aria-selected": enableRowSelection ? isSelected : void 0,
|
|
2608
|
-
className: cn(
|
|
2609
|
-
"border-t border-border/60 first:border-t-0 transition-colors",
|
|
2610
|
-
"hover:bg-primary/5",
|
|
2611
|
-
striped && rowIndex % 2 === 1 && "bg-muted/20",
|
|
2612
|
-
isSelected && selectedRowClass,
|
|
2613
|
-
onRowClick && "cursor-pointer"
|
|
2583
|
+
) : renderHeader(column.header)
|
|
2584
|
+
},
|
|
2585
|
+
column.id
|
|
2586
|
+
);
|
|
2587
|
+
})
|
|
2588
|
+
] })
|
|
2589
|
+
}
|
|
2614
2590
|
),
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2591
|
+
/* @__PURE__ */ jsxRuntime.jsx("tbody", { children: loading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2592
|
+
SkeletonRows,
|
|
2593
|
+
{
|
|
2594
|
+
rowCount: skeletonCount,
|
|
2595
|
+
columnCount: totalColumnCount,
|
|
2596
|
+
cellClassName: sizeClasses.cell
|
|
2597
|
+
}
|
|
2598
|
+
) : data.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2599
|
+
"td",
|
|
2600
|
+
{
|
|
2601
|
+
colSpan: totalColumnCount,
|
|
2602
|
+
className: cn(sizeClasses.cell, "py-10 text-center text-muted-foreground"),
|
|
2603
|
+
children: emptyState ?? "No data"
|
|
2604
|
+
}
|
|
2605
|
+
) }) : data.map((row, rowIndex) => {
|
|
2606
|
+
const id = getRowId(row, rowIndex);
|
|
2607
|
+
const isSelected = selected.has(id);
|
|
2608
|
+
const rowSelectable = isRowSelectable ? isRowSelectable(row) : true;
|
|
2609
|
+
const accent = getRowAccent?.(row, rowIndex);
|
|
2610
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2611
|
+
"tr",
|
|
2629
2612
|
{
|
|
2613
|
+
"data-selected": isSelected ? "true" : void 0,
|
|
2614
|
+
"aria-selected": enableRowSelection ? isSelected : void 0,
|
|
2630
2615
|
className: cn(
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2616
|
+
"border-b border-border/60 last:border-b-0 transition-colors",
|
|
2617
|
+
"hover:bg-muted/60",
|
|
2618
|
+
striped && rowIndex % 2 === 1 && "bg-muted/20",
|
|
2619
|
+
isSelected && selectedRowClass,
|
|
2620
|
+
onRowClick && "cursor-pointer"
|
|
2634
2621
|
),
|
|
2635
|
-
|
|
2622
|
+
onClick: onRowClick ? () => onRowClick(row, rowIndex) : void 0,
|
|
2623
|
+
children: [
|
|
2624
|
+
enableRowSelection ? /* @__PURE__ */ jsxRuntime.jsxs("td", { className: cn(sizeClasses.cell, "relative w-10"), children: [
|
|
2625
|
+
accent ? /* @__PURE__ */ jsxRuntime.jsx(RowAccent, { color: accent }) : null,
|
|
2626
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2627
|
+
Checkbox,
|
|
2628
|
+
{
|
|
2629
|
+
"aria-label": `Select row ${rowIndex + 1}`,
|
|
2630
|
+
checked: isSelected,
|
|
2631
|
+
disabled: !rowSelectable,
|
|
2632
|
+
onCheckedChange: (next) => toggleRow(id, next),
|
|
2633
|
+
onClick: stopRowClickPropagation
|
|
2634
|
+
}
|
|
2635
|
+
)
|
|
2636
|
+
] }) : null,
|
|
2637
|
+
columns.map((column, colIndex) => {
|
|
2638
|
+
const isFirst = colIndex === 0 && !enableRowSelection;
|
|
2639
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2640
|
+
"td",
|
|
2641
|
+
{
|
|
2642
|
+
className: cn(
|
|
2643
|
+
sizeClasses.cell,
|
|
2644
|
+
alignClass[column.align ?? "start"],
|
|
2645
|
+
column.className,
|
|
2646
|
+
isFirst && "relative"
|
|
2647
|
+
),
|
|
2648
|
+
children: [
|
|
2649
|
+
isFirst && accent ? /* @__PURE__ */ jsxRuntime.jsx(RowAccent, { color: accent }) : null,
|
|
2650
|
+
renderCell(column, row, rowIndex)
|
|
2651
|
+
]
|
|
2652
|
+
},
|
|
2653
|
+
column.id
|
|
2654
|
+
);
|
|
2655
|
+
})
|
|
2656
|
+
]
|
|
2636
2657
|
},
|
|
2637
|
-
|
|
2638
|
-
)
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
labels
|
|
2658
|
+
id
|
|
2659
|
+
);
|
|
2660
|
+
}) })
|
|
2661
|
+
]
|
|
2662
|
+
}
|
|
2663
|
+
)
|
|
2664
|
+
}
|
|
2665
|
+
),
|
|
2666
|
+
paginationVisible ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-border px-4 py-3", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2667
|
+
Pagination,
|
|
2668
|
+
{
|
|
2669
|
+
pageIndex,
|
|
2670
|
+
pageSize,
|
|
2671
|
+
pageCount,
|
|
2672
|
+
totalRowCount,
|
|
2673
|
+
pageSizeOptions,
|
|
2674
|
+
onChange: handlePaginationChange,
|
|
2675
|
+
labels
|
|
2676
|
+
}
|
|
2677
|
+
) }) : null
|
|
2678
|
+
]
|
|
2659
2679
|
}
|
|
2660
|
-
)
|
|
2680
|
+
)
|
|
2661
2681
|
] });
|
|
2662
2682
|
}
|
|
2663
2683
|
function renderHeader(header) {
|
|
2664
2684
|
return typeof header === "function" ? header() : header;
|
|
2665
2685
|
}
|
|
2686
|
+
function RowAccent({ color }) {
|
|
2687
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2688
|
+
"span",
|
|
2689
|
+
{
|
|
2690
|
+
"aria-hidden": "true",
|
|
2691
|
+
"data-testid": "row-accent",
|
|
2692
|
+
className: "pointer-events-none absolute inset-y-1 start-0 w-[3px] rounded-full",
|
|
2693
|
+
style: { background: color }
|
|
2694
|
+
}
|
|
2695
|
+
);
|
|
2696
|
+
}
|
|
2666
2697
|
function renderCell(column, row, rowIndex) {
|
|
2667
2698
|
if (column.render) return column.render(row, rowIndex);
|
|
2668
2699
|
if (column.accessor !== void 0) {
|
|
@@ -2687,26 +2718,34 @@ function stopRowClickPropagation(event) {
|
|
|
2687
2718
|
function SkeletonRows({ rowCount, columnCount, cellClassName }) {
|
|
2688
2719
|
const rowKeys = Array.from({ length: Math.max(0, rowCount) }, (_, i) => `skeleton-row-${i}`);
|
|
2689
2720
|
const colKeys = Array.from({ length: Math.max(1, columnCount) }, (_, i) => `skeleton-col-${i}`);
|
|
2690
|
-
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: rowKeys.map((rowKey) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2721
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: rowKeys.map((rowKey) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2722
|
+
"tr",
|
|
2723
|
+
{
|
|
2724
|
+
className: "border-b border-border/60 last:border-b-0",
|
|
2725
|
+
"data-testid": "table-skeleton-row",
|
|
2726
|
+
children: colKeys.map((colKey) => /* @__PURE__ */ jsxRuntime.jsx("td", { className: cellClassName, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block h-3 w-full animate-pulse rounded bg-muted" }) }, `${rowKey}-${colKey}`))
|
|
2727
|
+
},
|
|
2728
|
+
rowKey
|
|
2729
|
+
)) });
|
|
2691
2730
|
}
|
|
2692
2731
|
function SortIndicator({ active, direction }) {
|
|
2693
|
-
const className = cn("size-3.5 shrink-0", active ? "text-
|
|
2732
|
+
const className = cn("size-3.5 shrink-0", active ? "text-primary" : "text-muted-foreground");
|
|
2694
2733
|
if (!active) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsUpDown, { "aria-hidden": "true", className });
|
|
2695
2734
|
return direction === "asc" ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronUp, { "aria-hidden": "true", className }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { "aria-hidden": "true", className });
|
|
2696
2735
|
}
|
|
2697
2736
|
|
|
2698
2737
|
// src/components/select/selectVariants.ts
|
|
2699
2738
|
var selectVariantClass = {
|
|
2700
|
-
default: "border border-input bg-background hover:border-ring",
|
|
2739
|
+
default: "border border-input bg-background shadow-xs hover:border-ring",
|
|
2701
2740
|
filled: "border border-transparent bg-muted hover:bg-muted/80",
|
|
2702
2741
|
ghost: "border border-transparent bg-transparent hover:bg-accent"
|
|
2703
2742
|
};
|
|
2704
2743
|
var selectSizeClass = {
|
|
2705
|
-
sm: "h-8 rounded-
|
|
2706
|
-
md: "h-
|
|
2707
|
-
lg: "h-11 rounded-
|
|
2744
|
+
sm: "h-8 rounded-lg ps-2.5 pe-8 text-sm",
|
|
2745
|
+
md: "h-10 rounded-lg ps-3 pe-9 text-sm",
|
|
2746
|
+
lg: "h-11 rounded-lg ps-4 pe-10 text-base"
|
|
2708
2747
|
};
|
|
2709
|
-
var selectBaseClass = "group/select relative inline-flex w-full items-center text-foreground outline-none transition-[background-color,border-color,box-shadow] focus:ring-[3px] focus:ring-primary-glow aria-[invalid=true]:border-destructive aria-[invalid=true]:focus:ring-destructive/40 disabled:pointer-events-none disabled:opacity-50 cursor-pointer data-[placeholder]:text-muted-foreground";
|
|
2748
|
+
var selectBaseClass = "group/select relative inline-flex w-full items-center text-foreground outline-none transition-[background-color,border-color,box-shadow] focus:border-primary focus:ring-[3px] focus:ring-primary-glow aria-[invalid=true]:border-destructive aria-[invalid=true]:focus:border-destructive aria-[invalid=true]:focus:ring-destructive/40 disabled:pointer-events-none disabled:opacity-50 cursor-pointer data-[placeholder]:text-muted-foreground";
|
|
2710
2749
|
var selectContentClass = "z-50 max-h-(--radix-select-content-available-height) min-w-(--radix-select-trigger-width) overflow-hidden rounded-md border border-border bg-popover text-popover-foreground shadow-md 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";
|
|
2711
2750
|
var selectViewportClass = "p-1";
|
|
2712
2751
|
var selectItemClass = "relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 ps-8 pe-2 text-sm outline-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50";
|
|
@@ -2717,9 +2756,9 @@ var selectStatusClass = "flex items-center justify-center gap-2 px-2 py-6 text-c
|
|
|
2717
2756
|
|
|
2718
2757
|
// src/components/multi-select/multiSelectVariants.ts
|
|
2719
2758
|
var multiSelectTriggerSizeClass = {
|
|
2720
|
-
sm: "min-h-8 rounded-
|
|
2721
|
-
md: "min-h-
|
|
2722
|
-
lg: "min-h-11 rounded-
|
|
2759
|
+
sm: "min-h-8 rounded-lg ps-2.5 pe-8 py-1 text-sm",
|
|
2760
|
+
md: "min-h-10 rounded-lg ps-3 pe-9 py-1 text-sm",
|
|
2761
|
+
lg: "min-h-11 rounded-lg ps-4 pe-10 py-1.5 text-base"
|
|
2723
2762
|
};
|
|
2724
2763
|
var multiSelectValueRowClass = "flex min-w-0 flex-1 flex-wrap items-center gap-1";
|
|
2725
2764
|
var multiSelectChipClass = "max-w-full gap-1 pe-1";
|
|
@@ -3192,7 +3231,7 @@ function ListPageFilterBar({
|
|
|
3192
3231
|
},
|
|
3193
3232
|
filter.key
|
|
3194
3233
|
)) });
|
|
3195
|
-
const header = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 border-b border-
|
|
3234
|
+
const header = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 border-b-2 border-primary bg-panel-header px-4 py-3", children: [
|
|
3196
3235
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-semibold text-foreground", children: labels.title ?? "Filters" }),
|
|
3197
3236
|
activeCount > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center rounded-full bg-primary/10 px-2 py-0.5 text-xs font-semibold text-primary", children: [
|
|
3198
3237
|
activeCount,
|
|
@@ -3204,7 +3243,7 @@ function ListPageFilterBar({
|
|
|
3204
3243
|
labels.reset
|
|
3205
3244
|
] }) : null
|
|
3206
3245
|
] });
|
|
3207
|
-
const cardClass = "overflow-hidden rounded-xl border border-border bg-card";
|
|
3246
|
+
const cardClass = "overflow-hidden rounded-xl border border-border bg-card shadow-[var(--shadow-card)]";
|
|
3208
3247
|
if (manual) {
|
|
3209
3248
|
return /* @__PURE__ */ jsxRuntime.jsxs("form", { "data-slot": "list-page-filter-bar", className: cardClass, onSubmit: apply, children: [
|
|
3210
3249
|
header,
|
|
@@ -3688,14 +3727,14 @@ var Switch = react.forwardRef(function Switch2({
|
|
|
3688
3727
|
|
|
3689
3728
|
// src/components/textarea/textareaVariants.ts
|
|
3690
3729
|
var textareaVariantClass = {
|
|
3691
|
-
default: "border border-input bg-background hover:border-ring",
|
|
3730
|
+
default: "border border-input bg-background shadow-xs hover:border-ring",
|
|
3692
3731
|
filled: "border border-transparent bg-muted hover:bg-muted/80",
|
|
3693
3732
|
ghost: "border border-transparent bg-transparent hover:bg-accent"
|
|
3694
3733
|
};
|
|
3695
3734
|
var textareaSizeClass = {
|
|
3696
|
-
sm: "rounded-
|
|
3697
|
-
md: "rounded-
|
|
3698
|
-
lg: "rounded-
|
|
3735
|
+
sm: "rounded-lg px-2.5 py-1.5 text-sm",
|
|
3736
|
+
md: "rounded-lg px-3 py-2 text-sm",
|
|
3737
|
+
lg: "rounded-lg px-4 py-2.5 text-base"
|
|
3699
3738
|
};
|
|
3700
3739
|
var textareaResizeClass = {
|
|
3701
3740
|
none: "resize-none",
|
|
@@ -3703,7 +3742,7 @@ var textareaResizeClass = {
|
|
|
3703
3742
|
horizontal: "resize-x",
|
|
3704
3743
|
both: "resize"
|
|
3705
3744
|
};
|
|
3706
|
-
var textareaBaseClass = "group/textarea relative flex w-full text-foreground outline-none transition-[background-color,border-color,box-shadow] focus-within:ring-[3px] focus-within:ring-primary-glow aria-[invalid=true]:border-destructive aria-[invalid=true]:focus-within:ring-destructive/40 has-[textarea:disabled]:pointer-events-none has-[textarea:disabled]:opacity-50";
|
|
3745
|
+
var textareaBaseClass = "group/textarea relative flex w-full text-foreground outline-none transition-[background-color,border-color,box-shadow] focus-within:border-primary focus-within:ring-[3px] focus-within:ring-primary-glow aria-[invalid=true]:border-destructive aria-[invalid=true]:focus-within:border-destructive aria-[invalid=true]:focus-within:ring-destructive/40 has-[textarea:disabled]:pointer-events-none has-[textarea:disabled]:opacity-50";
|
|
3707
3746
|
var Textarea = react.forwardRef(function Textarea2({
|
|
3708
3747
|
variant = "default",
|
|
3709
3748
|
textareaSize = "md",
|