@l3mpire/ui 2.5.4 → 2.6.0
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/USAGE.md +65 -0
- package/dist/index.d.mts +39 -2
- package/dist/index.d.ts +39 -2
- package/dist/index.js +788 -221
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +792 -218
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/styles/globals.css +13 -0
package/dist/index.js
CHANGED
|
@@ -38,6 +38,7 @@ __export(index_exports, {
|
|
|
38
38
|
Button: () => Button,
|
|
39
39
|
ButtonCell: () => ButtonCell,
|
|
40
40
|
Checkbox: () => Checkbox,
|
|
41
|
+
ChipInput: () => ChipInput,
|
|
41
42
|
DataTable: () => DataTable,
|
|
42
43
|
DataTablePagination: () => DataTablePagination,
|
|
43
44
|
DateCell: () => DateCell,
|
|
@@ -69,6 +70,7 @@ __export(index_exports, {
|
|
|
69
70
|
ModalTitle: () => ModalTitle,
|
|
70
71
|
ModalTrigger: () => ModalTrigger,
|
|
71
72
|
NumberCell: () => NumberCell,
|
|
73
|
+
NumberInput: () => NumberInput,
|
|
72
74
|
ProductLogo: () => ProductLogo,
|
|
73
75
|
RowActions: () => RowActions,
|
|
74
76
|
SearchBar: () => SearchBar,
|
|
@@ -115,6 +117,7 @@ __export(index_exports, {
|
|
|
115
117
|
avatarVariants: () => avatarVariants,
|
|
116
118
|
badgeVariants: () => badgeVariants,
|
|
117
119
|
buttonVariants: () => buttonVariants,
|
|
120
|
+
chipInputVariants: () => chipInputVariants,
|
|
118
121
|
cn: () => cn,
|
|
119
122
|
emptyStateVariants: () => emptyStateVariants,
|
|
120
123
|
flexRender: () => import_react_table.flexRender,
|
|
@@ -837,7 +840,7 @@ var TooltipContent = React4.forwardRef(({ className, type, hasArrow = true, side
|
|
|
837
840
|
hasArrow && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
838
841
|
TooltipPrimitive.Arrow,
|
|
839
842
|
{
|
|
840
|
-
className: type === "
|
|
843
|
+
className: type === "default" ? "fill-tooltip-default-bg" : "fill-tooltip-invert-bg"
|
|
841
844
|
}
|
|
842
845
|
)
|
|
843
846
|
]
|
|
@@ -1940,40 +1943,57 @@ var DropdownMenuItem = React15.forwardRef(
|
|
|
1940
1943
|
action,
|
|
1941
1944
|
isActive,
|
|
1942
1945
|
children,
|
|
1946
|
+
onClick,
|
|
1943
1947
|
...props
|
|
1944
|
-
}, ref) =>
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1948
|
+
}, ref) => {
|
|
1949
|
+
const handleClick = React15.useCallback(
|
|
1950
|
+
(e) => {
|
|
1951
|
+
const target = e.target;
|
|
1952
|
+
if (!target.closest("button[role='checkbox']")) {
|
|
1953
|
+
const checkbox = e.currentTarget.querySelector(
|
|
1954
|
+
"button[role='checkbox']"
|
|
1955
|
+
);
|
|
1956
|
+
checkbox?.click();
|
|
1957
|
+
}
|
|
1958
|
+
onClick?.(e);
|
|
1959
|
+
},
|
|
1960
|
+
[onClick]
|
|
1961
|
+
);
|
|
1962
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1963
|
+
"div",
|
|
1964
|
+
{
|
|
1965
|
+
ref,
|
|
1966
|
+
role: "option",
|
|
1967
|
+
"aria-selected": isActive,
|
|
1968
|
+
className: cn(
|
|
1969
|
+
itemStyle,
|
|
1970
|
+
isActive && "bg-dropdown-item-hover",
|
|
1971
|
+
className
|
|
1967
1972
|
),
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1973
|
+
onClick: handleClick,
|
|
1974
|
+
...props,
|
|
1975
|
+
children: [
|
|
1976
|
+
children,
|
|
1977
|
+
avatar,
|
|
1978
|
+
flag,
|
|
1979
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1980
|
+
import_icons11.Icon,
|
|
1981
|
+
{
|
|
1982
|
+
icon,
|
|
1983
|
+
size: "sm",
|
|
1984
|
+
className: "shrink-0 text-dropdown-item-icon"
|
|
1985
|
+
}
|
|
1986
|
+
),
|
|
1987
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex flex-1 items-center gap-sm min-w-0", children: [
|
|
1988
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: cn("truncate shrink-0", textSm, "text-dropdown-item-text"), children: label }),
|
|
1989
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: cn("truncate", textXs, "text-dropdown-item-secondary"), children: description })
|
|
1990
|
+
] }),
|
|
1991
|
+
badge,
|
|
1992
|
+
action
|
|
1993
|
+
]
|
|
1994
|
+
}
|
|
1995
|
+
);
|
|
1996
|
+
}
|
|
1977
1997
|
);
|
|
1978
1998
|
DropdownMenuItem.displayName = "DropdownMenuItem";
|
|
1979
1999
|
var DropdownMenuRadixItem = React15.forwardRef(
|
|
@@ -2041,7 +2061,7 @@ var clearStyle = [
|
|
|
2041
2061
|
"sticky bottom-0 -mx-base -mb-base",
|
|
2042
2062
|
"flex items-center justify-center",
|
|
2043
2063
|
"h-10 min-w-[80px] px-md py-[10px]",
|
|
2044
|
-
"bg-gradient-to-t from-
|
|
2064
|
+
"bg-gradient-to-t from-dropdown-bg from-[10%] to-dropdown-bg",
|
|
2045
2065
|
"border border-dropdown-border",
|
|
2046
2066
|
"shadow-sm",
|
|
2047
2067
|
"cursor-pointer"
|
|
@@ -2192,6 +2212,7 @@ SidebarItem.displayName = "SidebarItem";
|
|
|
2192
2212
|
// src/components/ui/select.tsx
|
|
2193
2213
|
var React18 = __toESM(require("react"));
|
|
2194
2214
|
var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"));
|
|
2215
|
+
var TooltipPrimitive2 = __toESM(require("@radix-ui/react-tooltip"));
|
|
2195
2216
|
var import_class_variance_authority11 = require("class-variance-authority");
|
|
2196
2217
|
var import_icons13 = require("@l3mpire/icons");
|
|
2197
2218
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
@@ -2207,13 +2228,15 @@ var selectVariants = (0, import_class_variance_authority11.cva)(
|
|
|
2207
2228
|
{
|
|
2208
2229
|
variants: {
|
|
2209
2230
|
size: {
|
|
2210
|
-
sm: "px-base
|
|
2211
|
-
md: "px-md
|
|
2231
|
+
sm: "px-base gap-base rounded-base min-w-[80px]",
|
|
2232
|
+
md: "px-md gap-base rounded-md"
|
|
2212
2233
|
}
|
|
2213
2234
|
},
|
|
2214
2235
|
defaultVariants: { size: "md" }
|
|
2215
2236
|
}
|
|
2216
2237
|
);
|
|
2238
|
+
var selectHeight = { sm: 32, md: 40 };
|
|
2239
|
+
var chipHeight = { sm: 20, md: 24 };
|
|
2217
2240
|
var triggerStates = {
|
|
2218
2241
|
default: [
|
|
2219
2242
|
"bg-gradient-to-t from-select-bg-default from-[10%] to-select-bg-gradient-to",
|
|
@@ -2250,6 +2273,126 @@ var errorGuidance = {
|
|
|
2250
2273
|
icon: "shrink-0 text-select-error-icon",
|
|
2251
2274
|
text: "text-xs font-medium leading-xs text-select-error-text"
|
|
2252
2275
|
};
|
|
2276
|
+
function SelectChips({ tags, onTagRemove, chipHeightPx }) {
|
|
2277
|
+
const containerRef = React18.useRef(null);
|
|
2278
|
+
const measureRef = React18.useRef(null);
|
|
2279
|
+
const [visibleCount, setVisibleCount] = React18.useState(tags.length);
|
|
2280
|
+
React18.useLayoutEffect(() => {
|
|
2281
|
+
const container = containerRef.current;
|
|
2282
|
+
const measureRow = measureRef.current;
|
|
2283
|
+
if (!container || !measureRow) return;
|
|
2284
|
+
const measure = () => {
|
|
2285
|
+
const containerWidth = container.getBoundingClientRect().width;
|
|
2286
|
+
const chips = Array.from(
|
|
2287
|
+
measureRow.children
|
|
2288
|
+
);
|
|
2289
|
+
const overflowChipWidth = 32;
|
|
2290
|
+
let usedWidth = 0;
|
|
2291
|
+
let count = 0;
|
|
2292
|
+
for (const chip of chips) {
|
|
2293
|
+
const chipWidth = chip.getBoundingClientRect().width;
|
|
2294
|
+
const gapWidth = count > 0 ? 4 : 0;
|
|
2295
|
+
const projectedWidth = usedWidth + gapWidth + chipWidth;
|
|
2296
|
+
const remaining = tags.length - (count + 1);
|
|
2297
|
+
const needsOverflow = remaining > 0;
|
|
2298
|
+
const totalNeeded = projectedWidth + (needsOverflow ? 4 + overflowChipWidth : 0);
|
|
2299
|
+
if (totalNeeded <= containerWidth) {
|
|
2300
|
+
usedWidth = projectedWidth;
|
|
2301
|
+
count++;
|
|
2302
|
+
} else {
|
|
2303
|
+
break;
|
|
2304
|
+
}
|
|
2305
|
+
}
|
|
2306
|
+
setVisibleCount(Math.max(1, count));
|
|
2307
|
+
};
|
|
2308
|
+
measure();
|
|
2309
|
+
const observer = new ResizeObserver(measure);
|
|
2310
|
+
observer.observe(container);
|
|
2311
|
+
return () => observer.disconnect();
|
|
2312
|
+
}, [tags]);
|
|
2313
|
+
const overflowCount = tags.length - visibleCount;
|
|
2314
|
+
const overflowTags = tags.slice(visibleCount);
|
|
2315
|
+
const chipClass = cn(
|
|
2316
|
+
"inline-flex items-center gap-xs shrink-0",
|
|
2317
|
+
"px-sm rounded-base",
|
|
2318
|
+
"bg-tag-neutral-bg text-tag-neutral-text",
|
|
2319
|
+
"text-xs font-medium leading-xs",
|
|
2320
|
+
"whitespace-nowrap"
|
|
2321
|
+
);
|
|
2322
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex flex-1 items-center gap-xs min-w-0 overflow-hidden relative", children: [
|
|
2323
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2324
|
+
"div",
|
|
2325
|
+
{
|
|
2326
|
+
ref: measureRef,
|
|
2327
|
+
"aria-hidden": true,
|
|
2328
|
+
className: "absolute flex items-center gap-xs pointer-events-none",
|
|
2329
|
+
style: { visibility: "hidden", whiteSpace: "nowrap", top: 0, left: 0 },
|
|
2330
|
+
children: tags.map((tag) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: chipClass, style: { height: chipHeightPx }, children: [
|
|
2331
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "truncate max-w-[100px]", children: tag }),
|
|
2332
|
+
onTagRemove && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "inline-flex shrink-0 w-3 h-3" })
|
|
2333
|
+
] }, tag))
|
|
2334
|
+
}
|
|
2335
|
+
),
|
|
2336
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { ref: containerRef, className: "flex flex-1 items-center gap-xs overflow-hidden", children: [
|
|
2337
|
+
tags.slice(0, visibleCount).map((tag) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2338
|
+
"span",
|
|
2339
|
+
{
|
|
2340
|
+
className: chipClass,
|
|
2341
|
+
style: { height: chipHeightPx },
|
|
2342
|
+
children: [
|
|
2343
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "truncate max-w-[100px]", children: tag }),
|
|
2344
|
+
onTagRemove && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2345
|
+
"button",
|
|
2346
|
+
{
|
|
2347
|
+
type: "button",
|
|
2348
|
+
"aria-label": `Remove ${tag}`,
|
|
2349
|
+
className: "inline-flex shrink-0 items-center justify-center cursor-pointer rounded-sm hover:opacity-70",
|
|
2350
|
+
onClick: (e) => {
|
|
2351
|
+
e.stopPropagation();
|
|
2352
|
+
e.preventDefault();
|
|
2353
|
+
onTagRemove(tag);
|
|
2354
|
+
},
|
|
2355
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_icons13.Icon, { icon: import_icons13.faXmarkSolid, size: "xs" })
|
|
2356
|
+
}
|
|
2357
|
+
)
|
|
2358
|
+
]
|
|
2359
|
+
},
|
|
2360
|
+
tag
|
|
2361
|
+
)),
|
|
2362
|
+
overflowCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TooltipPrimitive2.Provider, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(TooltipPrimitive2.Root, { children: [
|
|
2363
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TooltipPrimitive2.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2364
|
+
"span",
|
|
2365
|
+
{
|
|
2366
|
+
className: cn(chipClass, "cursor-default"),
|
|
2367
|
+
style: { height: chipHeightPx },
|
|
2368
|
+
children: [
|
|
2369
|
+
"+",
|
|
2370
|
+
overflowCount
|
|
2371
|
+
]
|
|
2372
|
+
}
|
|
2373
|
+
) }),
|
|
2374
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TooltipPrimitive2.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2375
|
+
TooltipPrimitive2.Content,
|
|
2376
|
+
{
|
|
2377
|
+
sideOffset: 4,
|
|
2378
|
+
className: cn(
|
|
2379
|
+
"z-50 px-base py-sm rounded-md shadow-lg",
|
|
2380
|
+
"bg-tooltip-default-bg text-tooltip-default-text",
|
|
2381
|
+
"text-xs font-regular leading-xs",
|
|
2382
|
+
"flex flex-col gap-xs",
|
|
2383
|
+
"data-[state=delayed-open]:animate-[tooltip-in_150ms_ease-out]",
|
|
2384
|
+
"data-[state=closed]:animate-[tooltip-out_100ms_ease-in]"
|
|
2385
|
+
),
|
|
2386
|
+
children: [
|
|
2387
|
+
overflowTags.map((t) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: t }, t)),
|
|
2388
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TooltipPrimitive2.Arrow, { className: "fill-tooltip-default-bg" })
|
|
2389
|
+
]
|
|
2390
|
+
}
|
|
2391
|
+
) })
|
|
2392
|
+
] }) })
|
|
2393
|
+
] })
|
|
2394
|
+
] });
|
|
2395
|
+
}
|
|
2253
2396
|
var Select = React18.forwardRef(
|
|
2254
2397
|
({
|
|
2255
2398
|
className,
|
|
@@ -2259,6 +2402,8 @@ var Select = React18.forwardRef(
|
|
|
2259
2402
|
placeholder = "Select...",
|
|
2260
2403
|
value,
|
|
2261
2404
|
multiCount,
|
|
2405
|
+
tags,
|
|
2406
|
+
onTagRemove,
|
|
2262
2407
|
icon,
|
|
2263
2408
|
avatar,
|
|
2264
2409
|
flag,
|
|
@@ -2280,10 +2425,13 @@ var Select = React18.forwardRef(
|
|
|
2280
2425
|
setInternalOpen(open);
|
|
2281
2426
|
onOpenChange?.(open);
|
|
2282
2427
|
};
|
|
2283
|
-
const
|
|
2428
|
+
const resolvedSize = size ?? "md";
|
|
2429
|
+
const hasTags = tags != null && tags.length > 0;
|
|
2430
|
+
const hasValue = hasTags || value != null && value !== "";
|
|
2284
2431
|
const isActive = isOpen && !error && !disabled;
|
|
2285
2432
|
const icColor = iconColor[disabled ? "disabled" : "default"];
|
|
2286
2433
|
const triggerState = disabled ? triggerStates.disabled : error ? triggerStates.error : triggerStates.default;
|
|
2434
|
+
const heightPx = selectHeight[resolvedSize];
|
|
2287
2435
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2288
2436
|
PopoverPrimitive.Root,
|
|
2289
2437
|
{
|
|
@@ -2301,10 +2449,13 @@ var Select = React18.forwardRef(
|
|
|
2301
2449
|
disabled,
|
|
2302
2450
|
"aria-invalid": error || void 0,
|
|
2303
2451
|
"aria-describedby": errorId,
|
|
2452
|
+
style: { height: heightPx },
|
|
2304
2453
|
className: cn(
|
|
2305
2454
|
selectVariants({ size }),
|
|
2306
2455
|
triggerState,
|
|
2307
2456
|
isActive && triggerStates.active,
|
|
2457
|
+
// Reduce vertical padding when tags are present
|
|
2458
|
+
hasTags ? "py-xs" : resolvedSize === "sm" ? "py-sm" : "py-[10px]",
|
|
2308
2459
|
className
|
|
2309
2460
|
),
|
|
2310
2461
|
...props,
|
|
@@ -2312,7 +2463,14 @@ var Select = React18.forwardRef(
|
|
|
2312
2463
|
avatar,
|
|
2313
2464
|
flag,
|
|
2314
2465
|
icon && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_icons13.Icon, { icon, size: "sm", className: cn("shrink-0", icColor) }),
|
|
2315
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2466
|
+
tags && tags.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2467
|
+
SelectChips,
|
|
2468
|
+
{
|
|
2469
|
+
tags,
|
|
2470
|
+
onTagRemove,
|
|
2471
|
+
chipHeightPx: chipHeight[resolvedSize]
|
|
2472
|
+
}
|
|
2473
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2316
2474
|
"span",
|
|
2317
2475
|
{
|
|
2318
2476
|
className: cn(
|
|
@@ -2322,7 +2480,7 @@ var Select = React18.forwardRef(
|
|
|
2322
2480
|
children: hasValue ? value : placeholder
|
|
2323
2481
|
}
|
|
2324
2482
|
),
|
|
2325
|
-
multiCount != null && multiCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "shrink-0 text-xs leading-normal text-select-text-multi", children: [
|
|
2483
|
+
!hasTags && multiCount != null && multiCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "shrink-0 text-xs leading-normal text-select-text-multi", children: [
|
|
2326
2484
|
"+",
|
|
2327
2485
|
multiCount,
|
|
2328
2486
|
" others"
|
|
@@ -2790,12 +2948,418 @@ var TextInput = React22.forwardRef(
|
|
|
2790
2948
|
);
|
|
2791
2949
|
TextInput.displayName = "TextInput";
|
|
2792
2950
|
|
|
2793
|
-
// src/components/ui/
|
|
2951
|
+
// src/components/ui/chip-input.tsx
|
|
2794
2952
|
var React23 = __toESM(require("react"));
|
|
2795
2953
|
var import_class_variance_authority14 = require("class-variance-authority");
|
|
2796
|
-
var
|
|
2954
|
+
var import_icons17 = require("@l3mpire/icons");
|
|
2797
2955
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2798
|
-
var
|
|
2956
|
+
var chipInputVariants = (0, import_class_variance_authority14.cva)(
|
|
2957
|
+
[
|
|
2958
|
+
"flex flex-wrap items-center w-full border transition-colors",
|
|
2959
|
+
"text-sm",
|
|
2960
|
+
"font-regular",
|
|
2961
|
+
"leading-sm",
|
|
2962
|
+
"gap-xs"
|
|
2963
|
+
],
|
|
2964
|
+
{
|
|
2965
|
+
variants: {
|
|
2966
|
+
size: {
|
|
2967
|
+
sm: "px-base py-sm rounded-base",
|
|
2968
|
+
md: "px-md py-[10px] rounded-md"
|
|
2969
|
+
}
|
|
2970
|
+
},
|
|
2971
|
+
defaultVariants: { size: "md" }
|
|
2972
|
+
}
|
|
2973
|
+
);
|
|
2974
|
+
var wrapperStates2 = {
|
|
2975
|
+
default: [
|
|
2976
|
+
"bg-text-input-bg-default",
|
|
2977
|
+
"border-text-input-border-default",
|
|
2978
|
+
"text-text-input-text-default",
|
|
2979
|
+
"hover:border-text-input-border-hover",
|
|
2980
|
+
"focus-within:border-text-input-border-hover",
|
|
2981
|
+
"focus-within:shadow-focus-ring"
|
|
2982
|
+
],
|
|
2983
|
+
error: [
|
|
2984
|
+
"bg-text-input-bg-default",
|
|
2985
|
+
"border-text-input-border-error",
|
|
2986
|
+
"text-text-input-text-default"
|
|
2987
|
+
],
|
|
2988
|
+
disabled: [
|
|
2989
|
+
"bg-text-input-bg-disabled",
|
|
2990
|
+
"border-text-input-border-disabled",
|
|
2991
|
+
"text-text-input-text-disabled",
|
|
2992
|
+
"cursor-not-allowed"
|
|
2993
|
+
]
|
|
2994
|
+
};
|
|
2995
|
+
var chipStyle = [
|
|
2996
|
+
"inline-flex items-center gap-xs shrink-0",
|
|
2997
|
+
"h-6 px-sm rounded-base",
|
|
2998
|
+
"bg-tag-neutral-bg text-tag-neutral-text",
|
|
2999
|
+
"text-xs font-medium leading-xs",
|
|
3000
|
+
"whitespace-nowrap"
|
|
3001
|
+
];
|
|
3002
|
+
var errorGuidance4 = {
|
|
3003
|
+
icon: "shrink-0 text-text-input-error-icon",
|
|
3004
|
+
text: "text-xs font-medium leading-xs text-text-input-error-text"
|
|
3005
|
+
};
|
|
3006
|
+
var ChipInput = React23.forwardRef(
|
|
3007
|
+
({
|
|
3008
|
+
className,
|
|
3009
|
+
size,
|
|
3010
|
+
values,
|
|
3011
|
+
onChange,
|
|
3012
|
+
placeholder = "Type a value and press Enter",
|
|
3013
|
+
label,
|
|
3014
|
+
labelType,
|
|
3015
|
+
error,
|
|
3016
|
+
errorMessage,
|
|
3017
|
+
disabled,
|
|
3018
|
+
iconLeft,
|
|
3019
|
+
max = 0,
|
|
3020
|
+
...props
|
|
3021
|
+
}, ref) => {
|
|
3022
|
+
const autoId = React23.useId();
|
|
3023
|
+
const inputId = props.id ?? autoId;
|
|
3024
|
+
const errorId = error && errorMessage ? `${inputId}-error` : void 0;
|
|
3025
|
+
const inputRef = React23.useRef(null);
|
|
3026
|
+
const [inputValue, setInputValue] = React23.useState("");
|
|
3027
|
+
const state = disabled ? "disabled" : error ? "error" : "default";
|
|
3028
|
+
const addChip = (val) => {
|
|
3029
|
+
const trimmed = val.trim();
|
|
3030
|
+
if (!trimmed) return;
|
|
3031
|
+
if (values.includes(trimmed)) return;
|
|
3032
|
+
if (max > 0 && values.length >= max) return;
|
|
3033
|
+
onChange([...values, trimmed]);
|
|
3034
|
+
setInputValue("");
|
|
3035
|
+
};
|
|
3036
|
+
const removeChip = (val) => {
|
|
3037
|
+
onChange(values.filter((v) => v !== val));
|
|
3038
|
+
};
|
|
3039
|
+
const handleKeyDown = (e) => {
|
|
3040
|
+
if (e.key === "Enter") {
|
|
3041
|
+
e.preventDefault();
|
|
3042
|
+
addChip(inputValue);
|
|
3043
|
+
} else if (e.key === "Backspace" && inputValue === "" && values.length > 0) {
|
|
3044
|
+
removeChip(values[values.length - 1]);
|
|
3045
|
+
}
|
|
3046
|
+
};
|
|
3047
|
+
const handleWrapperClick = () => {
|
|
3048
|
+
inputRef.current?.focus();
|
|
3049
|
+
};
|
|
3050
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex flex-col gap-xs", children: [
|
|
3051
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(InputLabel, { type: labelType, disabled, children: label }),
|
|
3052
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
3053
|
+
"div",
|
|
3054
|
+
{
|
|
3055
|
+
ref,
|
|
3056
|
+
role: "textbox",
|
|
3057
|
+
"aria-disabled": disabled || void 0,
|
|
3058
|
+
className: cn(
|
|
3059
|
+
chipInputVariants({ size }),
|
|
3060
|
+
wrapperStates2[state],
|
|
3061
|
+
"cursor-text",
|
|
3062
|
+
className
|
|
3063
|
+
),
|
|
3064
|
+
onClick: handleWrapperClick,
|
|
3065
|
+
...props,
|
|
3066
|
+
children: [
|
|
3067
|
+
iconLeft && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3068
|
+
import_icons17.Icon,
|
|
3069
|
+
{
|
|
3070
|
+
icon: iconLeft,
|
|
3071
|
+
size: "sm",
|
|
3072
|
+
className: cn(
|
|
3073
|
+
"shrink-0",
|
|
3074
|
+
disabled ? "text-text-input-text-disabled" : "text-text-input-icon"
|
|
3075
|
+
)
|
|
3076
|
+
}
|
|
3077
|
+
),
|
|
3078
|
+
values.map((val) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: cn(chipStyle), children: [
|
|
3079
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "truncate max-w-[150px]", children: val }),
|
|
3080
|
+
!disabled && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3081
|
+
"button",
|
|
3082
|
+
{
|
|
3083
|
+
type: "button",
|
|
3084
|
+
"aria-label": `Remove ${val}`,
|
|
3085
|
+
className: "inline-flex shrink-0 items-center justify-center cursor-pointer rounded-sm hover:opacity-70",
|
|
3086
|
+
onClick: (e) => {
|
|
3087
|
+
e.stopPropagation();
|
|
3088
|
+
removeChip(val);
|
|
3089
|
+
},
|
|
3090
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_icons17.Icon, { icon: import_icons17.faXmarkSolid, size: "xs" })
|
|
3091
|
+
}
|
|
3092
|
+
)
|
|
3093
|
+
] }, val)),
|
|
3094
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3095
|
+
"input",
|
|
3096
|
+
{
|
|
3097
|
+
ref: inputRef,
|
|
3098
|
+
id: inputId,
|
|
3099
|
+
type: "text",
|
|
3100
|
+
disabled,
|
|
3101
|
+
"aria-invalid": error || void 0,
|
|
3102
|
+
"aria-describedby": errorId,
|
|
3103
|
+
value: inputValue,
|
|
3104
|
+
onChange: (e) => setInputValue(e.target.value),
|
|
3105
|
+
onKeyDown: handleKeyDown,
|
|
3106
|
+
placeholder,
|
|
3107
|
+
className: cn(
|
|
3108
|
+
"flex-1 min-w-[120px] bg-transparent outline-none",
|
|
3109
|
+
"[font-size:inherit] font-[inherit] leading-[inherit] [color:inherit]",
|
|
3110
|
+
disabled ? "placeholder:text-text-input-text-disabled cursor-not-allowed" : "placeholder:text-text-input-text-placeholder"
|
|
3111
|
+
)
|
|
3112
|
+
}
|
|
3113
|
+
)
|
|
3114
|
+
]
|
|
3115
|
+
}
|
|
3116
|
+
),
|
|
3117
|
+
error && errorMessage && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex items-center gap-xs", children: [
|
|
3118
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_icons17.Icon, { icon: import_icons17.faCircleExclamationOutline, size: "xs", className: errorGuidance4.icon }),
|
|
3119
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { id: errorId, className: errorGuidance4.text, children: errorMessage })
|
|
3120
|
+
] })
|
|
3121
|
+
] });
|
|
3122
|
+
}
|
|
3123
|
+
);
|
|
3124
|
+
ChipInput.displayName = "ChipInput";
|
|
3125
|
+
|
|
3126
|
+
// src/components/ui/number-input.tsx
|
|
3127
|
+
var React24 = __toESM(require("react"));
|
|
3128
|
+
var import_class_variance_authority15 = require("class-variance-authority");
|
|
3129
|
+
var import_icons18 = require("@l3mpire/icons");
|
|
3130
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
3131
|
+
var stepperButtonVariants = (0, import_class_variance_authority15.cva)(
|
|
3132
|
+
[
|
|
3133
|
+
"shrink-0 flex items-center justify-center",
|
|
3134
|
+
"border border-text-input-border-default",
|
|
3135
|
+
"cursor-pointer transition-colors"
|
|
3136
|
+
],
|
|
3137
|
+
{
|
|
3138
|
+
variants: {
|
|
3139
|
+
size: {
|
|
3140
|
+
sm: "p-sm",
|
|
3141
|
+
md: "p-[10px]"
|
|
3142
|
+
}
|
|
3143
|
+
},
|
|
3144
|
+
defaultVariants: { size: "md" }
|
|
3145
|
+
}
|
|
3146
|
+
);
|
|
3147
|
+
var stepperButtonStates = {
|
|
3148
|
+
enabled: [
|
|
3149
|
+
"bg-gradient-to-t from-text-input-button-bg from-[10%] to-text-input-button-gradient-to",
|
|
3150
|
+
"hover:from-text-input-button-bg-hover hover:from-[0%] hover:to-text-input-button-gradient-to",
|
|
3151
|
+
"active:from-text-input-button-bg-hover active:from-[0%] active:to-text-input-button-gradient-to"
|
|
3152
|
+
],
|
|
3153
|
+
disabled: [
|
|
3154
|
+
"bg-text-input-bg-disabled",
|
|
3155
|
+
"border-text-input-border-disabled",
|
|
3156
|
+
"cursor-not-allowed"
|
|
3157
|
+
]
|
|
3158
|
+
};
|
|
3159
|
+
var inputVariants = (0, import_class_variance_authority15.cva)(
|
|
3160
|
+
[
|
|
3161
|
+
"min-w-[48px] text-center border-y border-text-input-border-default",
|
|
3162
|
+
"bg-text-input-bg-default",
|
|
3163
|
+
"text-sm font-regular leading-sm",
|
|
3164
|
+
"text-text-input-text-default",
|
|
3165
|
+
"outline-none",
|
|
3166
|
+
"[appearance:textfield]",
|
|
3167
|
+
"[&::-webkit-outer-spin-button]:appearance-none",
|
|
3168
|
+
"[&::-webkit-inner-spin-button]:appearance-none"
|
|
3169
|
+
],
|
|
3170
|
+
{
|
|
3171
|
+
variants: {
|
|
3172
|
+
size: {
|
|
3173
|
+
sm: "px-base py-sm",
|
|
3174
|
+
md: "px-md py-[10px]"
|
|
3175
|
+
}
|
|
3176
|
+
},
|
|
3177
|
+
defaultVariants: { size: "md" }
|
|
3178
|
+
}
|
|
3179
|
+
);
|
|
3180
|
+
var wrapperStates3 = {
|
|
3181
|
+
default: [
|
|
3182
|
+
"focus-within:shadow-focus-ring",
|
|
3183
|
+
"focus-within:[&_button]:border-text-input-border-hover",
|
|
3184
|
+
"focus-within:[&_input]:border-text-input-border-hover"
|
|
3185
|
+
],
|
|
3186
|
+
error: [
|
|
3187
|
+
"[&_button]:border-text-input-border-error",
|
|
3188
|
+
"[&_input]:border-text-input-border-error"
|
|
3189
|
+
],
|
|
3190
|
+
disabled: []
|
|
3191
|
+
};
|
|
3192
|
+
var errorGuidance5 = {
|
|
3193
|
+
icon: "shrink-0 text-text-input-error-icon",
|
|
3194
|
+
text: "text-xs font-medium leading-xs text-text-input-error-text"
|
|
3195
|
+
};
|
|
3196
|
+
var NumberInput = React24.forwardRef(
|
|
3197
|
+
({
|
|
3198
|
+
className,
|
|
3199
|
+
size,
|
|
3200
|
+
value: controlledValue,
|
|
3201
|
+
defaultValue = 0,
|
|
3202
|
+
onChange,
|
|
3203
|
+
min,
|
|
3204
|
+
max,
|
|
3205
|
+
step = 1,
|
|
3206
|
+
label,
|
|
3207
|
+
labelType,
|
|
3208
|
+
error,
|
|
3209
|
+
errorMessage,
|
|
3210
|
+
disabled,
|
|
3211
|
+
id,
|
|
3212
|
+
...props
|
|
3213
|
+
}, ref) => {
|
|
3214
|
+
const autoId = React24.useId();
|
|
3215
|
+
const inputId = id ?? autoId;
|
|
3216
|
+
const errorId = error && errorMessage ? `${inputId}-error` : void 0;
|
|
3217
|
+
const isControlled = controlledValue !== void 0;
|
|
3218
|
+
const [internalValue, setInternalValue] = React24.useState(defaultValue);
|
|
3219
|
+
const currentValue = isControlled ? controlledValue : internalValue;
|
|
3220
|
+
const resolvedSize = size ?? "md";
|
|
3221
|
+
const state = disabled ? "disabled" : error ? "error" : "default";
|
|
3222
|
+
const clamp = (val) => {
|
|
3223
|
+
let clamped = val;
|
|
3224
|
+
if (min != null) clamped = Math.max(min, clamped);
|
|
3225
|
+
if (max != null) clamped = Math.min(max, clamped);
|
|
3226
|
+
return clamped;
|
|
3227
|
+
};
|
|
3228
|
+
const setValue = (val) => {
|
|
3229
|
+
const clamped = clamp(val);
|
|
3230
|
+
if (!isControlled) setInternalValue(clamped);
|
|
3231
|
+
onChange?.(clamped);
|
|
3232
|
+
};
|
|
3233
|
+
const handleInputChange = (e) => {
|
|
3234
|
+
const parsed = parseInt(e.target.value, 10);
|
|
3235
|
+
if (!isNaN(parsed)) {
|
|
3236
|
+
setValue(parsed);
|
|
3237
|
+
} else if (e.target.value === "" || e.target.value === "-") {
|
|
3238
|
+
if (!isControlled) setInternalValue(0);
|
|
3239
|
+
}
|
|
3240
|
+
};
|
|
3241
|
+
const handleBlur = () => {
|
|
3242
|
+
setValue(currentValue);
|
|
3243
|
+
};
|
|
3244
|
+
const decrement = () => {
|
|
3245
|
+
if (disabled) return;
|
|
3246
|
+
setValue(currentValue - step);
|
|
3247
|
+
};
|
|
3248
|
+
const increment = () => {
|
|
3249
|
+
if (disabled) return;
|
|
3250
|
+
setValue(currentValue + step);
|
|
3251
|
+
};
|
|
3252
|
+
const atMin = min != null && currentValue <= min;
|
|
3253
|
+
const atMax = max != null && currentValue >= max;
|
|
3254
|
+
const valueStr = String(currentValue);
|
|
3255
|
+
const charCount = valueStr.length;
|
|
3256
|
+
const inputWidth = charCount > 3 ? `${48 + (charCount - 3) * 9}px` : void 0;
|
|
3257
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: cn("flex flex-col gap-xs", className), children: [
|
|
3258
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(InputLabel, { type: labelType, disabled, children: label }),
|
|
3259
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
3260
|
+
"div",
|
|
3261
|
+
{
|
|
3262
|
+
className: cn(
|
|
3263
|
+
"inline-flex w-fit rounded-md shadow-sm",
|
|
3264
|
+
wrapperStates3[state]
|
|
3265
|
+
),
|
|
3266
|
+
children: [
|
|
3267
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3268
|
+
"button",
|
|
3269
|
+
{
|
|
3270
|
+
type: "button",
|
|
3271
|
+
disabled: disabled || atMin,
|
|
3272
|
+
onClick: decrement,
|
|
3273
|
+
"aria-label": "Decrease",
|
|
3274
|
+
className: cn(
|
|
3275
|
+
stepperButtonVariants({ size: resolvedSize }),
|
|
3276
|
+
"rounded-l-md -mr-px",
|
|
3277
|
+
stepperButtonStates[disabled || atMin ? "disabled" : "enabled"]
|
|
3278
|
+
),
|
|
3279
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3280
|
+
import_icons18.Icon,
|
|
3281
|
+
{
|
|
3282
|
+
icon: import_icons18.faMinusOutline,
|
|
3283
|
+
size: "sm",
|
|
3284
|
+
className: cn(
|
|
3285
|
+
disabled || atMin ? "text-text-input-text-disabled" : "text-text-input-text-default"
|
|
3286
|
+
)
|
|
3287
|
+
}
|
|
3288
|
+
)
|
|
3289
|
+
}
|
|
3290
|
+
),
|
|
3291
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3292
|
+
"input",
|
|
3293
|
+
{
|
|
3294
|
+
ref,
|
|
3295
|
+
id: inputId,
|
|
3296
|
+
type: "number",
|
|
3297
|
+
disabled,
|
|
3298
|
+
"aria-invalid": error || void 0,
|
|
3299
|
+
"aria-describedby": errorId,
|
|
3300
|
+
value: currentValue,
|
|
3301
|
+
onChange: handleInputChange,
|
|
3302
|
+
onBlur: handleBlur,
|
|
3303
|
+
min,
|
|
3304
|
+
max,
|
|
3305
|
+
step,
|
|
3306
|
+
style: inputWidth ? { width: inputWidth } : void 0,
|
|
3307
|
+
className: cn(
|
|
3308
|
+
inputVariants({ size: resolvedSize }),
|
|
3309
|
+
"-mx-px",
|
|
3310
|
+
disabled && [
|
|
3311
|
+
"bg-text-input-bg-disabled",
|
|
3312
|
+
"border-text-input-border-disabled",
|
|
3313
|
+
"text-text-input-text-disabled",
|
|
3314
|
+
"cursor-not-allowed"
|
|
3315
|
+
],
|
|
3316
|
+
error && "border-text-input-border-error"
|
|
3317
|
+
),
|
|
3318
|
+
...props
|
|
3319
|
+
}
|
|
3320
|
+
),
|
|
3321
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3322
|
+
"button",
|
|
3323
|
+
{
|
|
3324
|
+
type: "button",
|
|
3325
|
+
disabled: disabled || atMax,
|
|
3326
|
+
onClick: increment,
|
|
3327
|
+
"aria-label": "Increase",
|
|
3328
|
+
className: cn(
|
|
3329
|
+
stepperButtonVariants({ size: resolvedSize }),
|
|
3330
|
+
"rounded-r-md -ml-px",
|
|
3331
|
+
stepperButtonStates[disabled || atMax ? "disabled" : "enabled"]
|
|
3332
|
+
),
|
|
3333
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3334
|
+
import_icons18.Icon,
|
|
3335
|
+
{
|
|
3336
|
+
icon: import_icons18.faPlusOutline,
|
|
3337
|
+
size: "sm",
|
|
3338
|
+
className: cn(
|
|
3339
|
+
disabled || atMax ? "text-text-input-text-disabled" : "text-text-input-text-default"
|
|
3340
|
+
)
|
|
3341
|
+
}
|
|
3342
|
+
)
|
|
3343
|
+
}
|
|
3344
|
+
)
|
|
3345
|
+
]
|
|
3346
|
+
}
|
|
3347
|
+
),
|
|
3348
|
+
error && errorMessage && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center gap-xs", children: [
|
|
3349
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_icons18.Icon, { icon: import_icons18.faCircleExclamationOutline, size: "xs", className: errorGuidance5.icon }),
|
|
3350
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { id: errorId, className: errorGuidance5.text, children: errorMessage })
|
|
3351
|
+
] })
|
|
3352
|
+
] });
|
|
3353
|
+
}
|
|
3354
|
+
);
|
|
3355
|
+
NumberInput.displayName = "NumberInput";
|
|
3356
|
+
|
|
3357
|
+
// src/components/ui/typography.tsx
|
|
3358
|
+
var React25 = __toESM(require("react"));
|
|
3359
|
+
var import_class_variance_authority16 = require("class-variance-authority");
|
|
3360
|
+
var import_react_slot3 = require("@radix-ui/react-slot");
|
|
3361
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
3362
|
+
var typographyVariants = (0, import_class_variance_authority16.cva)("", {
|
|
2799
3363
|
variants: {
|
|
2800
3364
|
variant: {
|
|
2801
3365
|
h1: "text-xl leading-lg",
|
|
@@ -2826,10 +3390,10 @@ var defaultElementMap = {
|
|
|
2826
3390
|
sm: "p",
|
|
2827
3391
|
xs: "p"
|
|
2828
3392
|
};
|
|
2829
|
-
var Typography =
|
|
3393
|
+
var Typography = React25.forwardRef(
|
|
2830
3394
|
({ className, variant = "md", weight, as, asChild = false, ...props }, ref) => {
|
|
2831
3395
|
const Comp = asChild ? import_react_slot3.Slot : as ?? defaultElementMap[variant ?? "md"] ?? "p";
|
|
2832
|
-
return /* @__PURE__ */ (0,
|
|
3396
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2833
3397
|
Comp,
|
|
2834
3398
|
{
|
|
2835
3399
|
ref,
|
|
@@ -2842,10 +3406,10 @@ var Typography = React23.forwardRef(
|
|
|
2842
3406
|
Typography.displayName = "Typography";
|
|
2843
3407
|
|
|
2844
3408
|
// src/components/ui/user-menu.tsx
|
|
2845
|
-
var
|
|
2846
|
-
var
|
|
2847
|
-
var UserMenu =
|
|
2848
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3409
|
+
var React26 = __toESM(require("react"));
|
|
3410
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
3411
|
+
var UserMenu = React26.forwardRef(
|
|
3412
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2849
3413
|
"div",
|
|
2850
3414
|
{
|
|
2851
3415
|
ref,
|
|
@@ -2864,8 +3428,8 @@ var UserMenu = React24.forwardRef(
|
|
|
2864
3428
|
)
|
|
2865
3429
|
);
|
|
2866
3430
|
UserMenu.displayName = "UserMenu";
|
|
2867
|
-
var UserMenuInfoRow =
|
|
2868
|
-
({ className, avatar, name, subtitle, action, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3431
|
+
var UserMenuInfoRow = React26.forwardRef(
|
|
3432
|
+
({ className, avatar, name, subtitle, action, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
2869
3433
|
"div",
|
|
2870
3434
|
{
|
|
2871
3435
|
ref,
|
|
@@ -2873,9 +3437,9 @@ var UserMenuInfoRow = React24.forwardRef(
|
|
|
2873
3437
|
...props,
|
|
2874
3438
|
children: [
|
|
2875
3439
|
avatar,
|
|
2876
|
-
/* @__PURE__ */ (0,
|
|
2877
|
-
/* @__PURE__ */ (0,
|
|
2878
|
-
subtitle && /* @__PURE__ */ (0,
|
|
3440
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex flex-1 flex-col min-w-0", children: [
|
|
3441
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "text-sm font-medium leading-sm text-user-menu-name truncate", children: name }),
|
|
3442
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "text-xs font-regular leading-xs text-user-menu-subtitle truncate", children: subtitle })
|
|
2879
3443
|
] }),
|
|
2880
3444
|
action
|
|
2881
3445
|
]
|
|
@@ -2883,8 +3447,8 @@ var UserMenuInfoRow = React24.forwardRef(
|
|
|
2883
3447
|
)
|
|
2884
3448
|
);
|
|
2885
3449
|
UserMenuInfoRow.displayName = "UserMenuInfoRow";
|
|
2886
|
-
var UserMenuSection =
|
|
2887
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3450
|
+
var UserMenuSection = React26.forwardRef(
|
|
3451
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2888
3452
|
"div",
|
|
2889
3453
|
{
|
|
2890
3454
|
ref,
|
|
@@ -2897,12 +3461,12 @@ var UserMenuSection = React24.forwardRef(
|
|
|
2897
3461
|
UserMenuSection.displayName = "UserMenuSection";
|
|
2898
3462
|
|
|
2899
3463
|
// src/components/ui/modal.tsx
|
|
2900
|
-
var
|
|
3464
|
+
var React27 = __toESM(require("react"));
|
|
2901
3465
|
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
|
|
2902
|
-
var
|
|
2903
|
-
var
|
|
2904
|
-
var
|
|
2905
|
-
var modalVariants = (0,
|
|
3466
|
+
var import_class_variance_authority17 = require("class-variance-authority");
|
|
3467
|
+
var import_icons19 = require("@l3mpire/icons");
|
|
3468
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
3469
|
+
var modalVariants = (0, import_class_variance_authority17.cva)(
|
|
2906
3470
|
[
|
|
2907
3471
|
"fixed top-[50%] left-[50%] -translate-x-1/2 -translate-y-1/2 z-50",
|
|
2908
3472
|
"flex flex-col",
|
|
@@ -2925,7 +3489,7 @@ var modalVariants = (0, import_class_variance_authority15.cva)(
|
|
|
2925
3489
|
var Modal = DialogPrimitive.Root;
|
|
2926
3490
|
var ModalTrigger = DialogPrimitive.Trigger;
|
|
2927
3491
|
var ModalClose = DialogPrimitive.Close;
|
|
2928
|
-
var ModalOverlay =
|
|
3492
|
+
var ModalOverlay = React27.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2929
3493
|
DialogPrimitive.Overlay,
|
|
2930
3494
|
{
|
|
2931
3495
|
ref,
|
|
@@ -2938,9 +3502,9 @@ var ModalOverlay = React25.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
2938
3502
|
}
|
|
2939
3503
|
));
|
|
2940
3504
|
ModalOverlay.displayName = "ModalOverlay";
|
|
2941
|
-
var ModalContent =
|
|
2942
|
-
/* @__PURE__ */ (0,
|
|
2943
|
-
/* @__PURE__ */ (0,
|
|
3505
|
+
var ModalContent = React27.forwardRef(({ className, size, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(DialogPrimitive.Portal, { children: [
|
|
3506
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ModalOverlay, {}),
|
|
3507
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2944
3508
|
DialogPrimitive.Content,
|
|
2945
3509
|
{
|
|
2946
3510
|
ref,
|
|
@@ -2951,8 +3515,8 @@ var ModalContent = React25.forwardRef(({ className, size, children, ...props },
|
|
|
2951
3515
|
)
|
|
2952
3516
|
] }));
|
|
2953
3517
|
ModalContent.displayName = "ModalContent";
|
|
2954
|
-
var ModalHeader =
|
|
2955
|
-
({ className, showBorder = true, onClose, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3518
|
+
var ModalHeader = React27.forwardRef(
|
|
3519
|
+
({ className, showBorder = true, onClose, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
2956
3520
|
"div",
|
|
2957
3521
|
{
|
|
2958
3522
|
ref,
|
|
@@ -2963,15 +3527,15 @@ var ModalHeader = React25.forwardRef(
|
|
|
2963
3527
|
),
|
|
2964
3528
|
...props,
|
|
2965
3529
|
children: [
|
|
2966
|
-
/* @__PURE__ */ (0,
|
|
2967
|
-
onClose && /* @__PURE__ */ (0,
|
|
3530
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex flex-1 flex-col gap-2xs", children }),
|
|
3531
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(DialogPrimitive.Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2968
3532
|
"button",
|
|
2969
3533
|
{
|
|
2970
3534
|
type: "button",
|
|
2971
3535
|
onClick: onClose,
|
|
2972
3536
|
className: "inline-flex shrink-0 items-center justify-center p-xs rounded-base text-modal-header-close hover:bg-black/5 transition-colors cursor-pointer",
|
|
2973
3537
|
"aria-label": "Close",
|
|
2974
|
-
children: /* @__PURE__ */ (0,
|
|
3538
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_icons19.Icon, { icon: import_icons19.faXmarkSolid, size: "sm" })
|
|
2975
3539
|
}
|
|
2976
3540
|
) })
|
|
2977
3541
|
]
|
|
@@ -2979,7 +3543,7 @@ var ModalHeader = React25.forwardRef(
|
|
|
2979
3543
|
)
|
|
2980
3544
|
);
|
|
2981
3545
|
ModalHeader.displayName = "ModalHeader";
|
|
2982
|
-
var ModalTitle =
|
|
3546
|
+
var ModalTitle = React27.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2983
3547
|
DialogPrimitive.Title,
|
|
2984
3548
|
{
|
|
2985
3549
|
ref,
|
|
@@ -2988,7 +3552,7 @@ var ModalTitle = React25.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
2988
3552
|
}
|
|
2989
3553
|
));
|
|
2990
3554
|
ModalTitle.displayName = "ModalTitle";
|
|
2991
|
-
var ModalDescription =
|
|
3555
|
+
var ModalDescription = React27.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2992
3556
|
DialogPrimitive.Description,
|
|
2993
3557
|
{
|
|
2994
3558
|
ref,
|
|
@@ -2997,7 +3561,7 @@ var ModalDescription = React25.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
2997
3561
|
}
|
|
2998
3562
|
));
|
|
2999
3563
|
ModalDescription.displayName = "ModalDescription";
|
|
3000
|
-
var ModalBody =
|
|
3564
|
+
var ModalBody = React27.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3001
3565
|
"div",
|
|
3002
3566
|
{
|
|
3003
3567
|
ref,
|
|
@@ -3006,8 +3570,8 @@ var ModalBody = React25.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
3006
3570
|
}
|
|
3007
3571
|
));
|
|
3008
3572
|
ModalBody.displayName = "ModalBody";
|
|
3009
|
-
var ModalFooter =
|
|
3010
|
-
({ className, showBorder = true, infoMessage, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3573
|
+
var ModalFooter = React27.forwardRef(
|
|
3574
|
+
({ className, showBorder = true, infoMessage, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
3011
3575
|
"div",
|
|
3012
3576
|
{
|
|
3013
3577
|
ref,
|
|
@@ -3018,9 +3582,9 @@ var ModalFooter = React25.forwardRef(
|
|
|
3018
3582
|
),
|
|
3019
3583
|
...props,
|
|
3020
3584
|
children: [
|
|
3021
|
-
infoMessage && /* @__PURE__ */ (0,
|
|
3022
|
-
/* @__PURE__ */ (0,
|
|
3023
|
-
/* @__PURE__ */ (0,
|
|
3585
|
+
infoMessage && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-1 items-center gap-base", children: [
|
|
3586
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_icons19.Icon, { icon: import_icons19.faCircleInfoSolid, size: "sm", className: "shrink-0 text-modal-footer-icon" }),
|
|
3587
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-sm font-regular leading-sm text-modal-footer-text", children: infoMessage })
|
|
3024
3588
|
] }),
|
|
3025
3589
|
children
|
|
3026
3590
|
]
|
|
@@ -3030,9 +3594,9 @@ var ModalFooter = React25.forwardRef(
|
|
|
3030
3594
|
ModalFooter.displayName = "ModalFooter";
|
|
3031
3595
|
|
|
3032
3596
|
// src/components/ui/dialog.tsx
|
|
3033
|
-
var
|
|
3034
|
-
var
|
|
3035
|
-
var Dialog =
|
|
3597
|
+
var React28 = __toESM(require("react"));
|
|
3598
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
3599
|
+
var Dialog = React28.forwardRef(
|
|
3036
3600
|
({
|
|
3037
3601
|
open,
|
|
3038
3602
|
onOpenChange,
|
|
@@ -3049,16 +3613,16 @@ var Dialog = React26.forwardRef(
|
|
|
3049
3613
|
className
|
|
3050
3614
|
}, ref) => {
|
|
3051
3615
|
const handleCancel = onCancel ?? (() => onOpenChange?.(false));
|
|
3052
|
-
return /* @__PURE__ */ (0,
|
|
3053
|
-
/* @__PURE__ */ (0,
|
|
3054
|
-
/* @__PURE__ */ (0,
|
|
3055
|
-
description && /* @__PURE__ */ (0,
|
|
3616
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Modal, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(ModalContent, { size: "sm", ref, className, children: [
|
|
3617
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(ModalHeader, { showBorder: false, onClose: handleCancel, children: [
|
|
3618
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ModalTitle, { children: title }),
|
|
3619
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ModalDescription, { children: description })
|
|
3056
3620
|
] }),
|
|
3057
|
-
/* @__PURE__ */ (0,
|
|
3058
|
-
/* @__PURE__ */ (0,
|
|
3059
|
-
/* @__PURE__ */ (0,
|
|
3060
|
-
secondaryLabel && /* @__PURE__ */ (0,
|
|
3061
|
-
/* @__PURE__ */ (0,
|
|
3621
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(ModalFooter, { children: [
|
|
3622
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ModalClose, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Button, { appearance: "ghost", intent: "brand", size: "md", onClick: handleCancel, children: cancelLabel }) }),
|
|
3623
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center gap-md", children: [
|
|
3624
|
+
secondaryLabel && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Button, { appearance: "outlined", intent: "brand", size: "md", onClick: onSecondaryAction, children: secondaryLabel }),
|
|
3625
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
3062
3626
|
Button,
|
|
3063
3627
|
{
|
|
3064
3628
|
appearance: "solid",
|
|
@@ -3077,11 +3641,11 @@ var Dialog = React26.forwardRef(
|
|
|
3077
3641
|
Dialog.displayName = "Dialog";
|
|
3078
3642
|
|
|
3079
3643
|
// src/components/ui/empty-state.tsx
|
|
3080
|
-
var
|
|
3081
|
-
var
|
|
3082
|
-
var
|
|
3083
|
-
var
|
|
3084
|
-
var emptyStateVariants = (0,
|
|
3644
|
+
var React29 = __toESM(require("react"));
|
|
3645
|
+
var import_class_variance_authority18 = require("class-variance-authority");
|
|
3646
|
+
var import_icons20 = require("@l3mpire/icons");
|
|
3647
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
3648
|
+
var emptyStateVariants = (0, import_class_variance_authority18.cva)(
|
|
3085
3649
|
"flex flex-col items-center text-center",
|
|
3086
3650
|
{
|
|
3087
3651
|
variants: {
|
|
@@ -3095,7 +3659,7 @@ var emptyStateVariants = (0, import_class_variance_authority16.cva)(
|
|
|
3095
3659
|
}
|
|
3096
3660
|
}
|
|
3097
3661
|
);
|
|
3098
|
-
var iconContainerVariants2 = (0,
|
|
3662
|
+
var iconContainerVariants2 = (0, import_class_variance_authority18.cva)(
|
|
3099
3663
|
[
|
|
3100
3664
|
"flex items-center justify-center shrink-0",
|
|
3101
3665
|
"bg-table-bg border border-table-border",
|
|
@@ -3113,7 +3677,7 @@ var iconContainerVariants2 = (0, import_class_variance_authority16.cva)(
|
|
|
3113
3677
|
}
|
|
3114
3678
|
}
|
|
3115
3679
|
);
|
|
3116
|
-
var EmptyState =
|
|
3680
|
+
var EmptyState = React29.forwardRef(
|
|
3117
3681
|
({
|
|
3118
3682
|
className,
|
|
3119
3683
|
size = "md",
|
|
@@ -3125,23 +3689,23 @@ var EmptyState = React27.forwardRef(
|
|
|
3125
3689
|
...props
|
|
3126
3690
|
}, ref) => {
|
|
3127
3691
|
const isMd = size === "md";
|
|
3128
|
-
return /* @__PURE__ */ (0,
|
|
3692
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
3129
3693
|
"div",
|
|
3130
3694
|
{
|
|
3131
3695
|
ref,
|
|
3132
3696
|
className: cn(emptyStateVariants({ size }), className),
|
|
3133
3697
|
...props,
|
|
3134
3698
|
children: [
|
|
3135
|
-
icon && /* @__PURE__ */ (0,
|
|
3136
|
-
|
|
3699
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: iconContainerVariants2({ size }), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
3700
|
+
import_icons20.Icon,
|
|
3137
3701
|
{
|
|
3138
3702
|
icon,
|
|
3139
3703
|
size: isMd ? "md" : "sm",
|
|
3140
3704
|
className: "text-table-cell-text-secondary"
|
|
3141
3705
|
}
|
|
3142
3706
|
) }),
|
|
3143
|
-
/* @__PURE__ */ (0,
|
|
3144
|
-
/* @__PURE__ */ (0,
|
|
3707
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex flex-col gap-xs w-full", children: [
|
|
3708
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
3145
3709
|
"p",
|
|
3146
3710
|
{
|
|
3147
3711
|
className: cn(
|
|
@@ -3151,7 +3715,7 @@ var EmptyState = React27.forwardRef(
|
|
|
3151
3715
|
children: title
|
|
3152
3716
|
}
|
|
3153
3717
|
),
|
|
3154
|
-
description && /* @__PURE__ */ (0,
|
|
3718
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
3155
3719
|
"p",
|
|
3156
3720
|
{
|
|
3157
3721
|
className: cn(
|
|
@@ -3162,7 +3726,7 @@ var EmptyState = React27.forwardRef(
|
|
|
3162
3726
|
}
|
|
3163
3727
|
)
|
|
3164
3728
|
] }),
|
|
3165
|
-
(primaryAction || secondaryAction) && /* @__PURE__ */ (0,
|
|
3729
|
+
(primaryAction || secondaryAction) && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
3166
3730
|
"div",
|
|
3167
3731
|
{
|
|
3168
3732
|
className: cn(
|
|
@@ -3170,7 +3734,7 @@ var EmptyState = React27.forwardRef(
|
|
|
3170
3734
|
isMd ? "gap-lg" : "gap-base"
|
|
3171
3735
|
),
|
|
3172
3736
|
children: [
|
|
3173
|
-
secondaryAction && /* @__PURE__ */ (0,
|
|
3737
|
+
secondaryAction && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
3174
3738
|
Button,
|
|
3175
3739
|
{
|
|
3176
3740
|
appearance: "outlined",
|
|
@@ -3180,7 +3744,7 @@ var EmptyState = React27.forwardRef(
|
|
|
3180
3744
|
children: secondaryAction.label
|
|
3181
3745
|
}
|
|
3182
3746
|
),
|
|
3183
|
-
primaryAction && /* @__PURE__ */ (0,
|
|
3747
|
+
primaryAction && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
3184
3748
|
Button,
|
|
3185
3749
|
{
|
|
3186
3750
|
appearance: "solid",
|
|
@@ -3201,8 +3765,8 @@ var EmptyState = React27.forwardRef(
|
|
|
3201
3765
|
EmptyState.displayName = "EmptyState";
|
|
3202
3766
|
|
|
3203
3767
|
// src/components/ui/table-cells.tsx
|
|
3204
|
-
var
|
|
3205
|
-
var
|
|
3768
|
+
var React30 = __toESM(require("react"));
|
|
3769
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
3206
3770
|
function getInitials(name) {
|
|
3207
3771
|
return name.split(" ").map((part) => part[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
|
|
3208
3772
|
}
|
|
@@ -3211,11 +3775,11 @@ var AvatarCell = ({
|
|
|
3211
3775
|
subtitle,
|
|
3212
3776
|
src,
|
|
3213
3777
|
className
|
|
3214
|
-
}) => /* @__PURE__ */ (0,
|
|
3215
|
-
/* @__PURE__ */ (0,
|
|
3216
|
-
/* @__PURE__ */ (0,
|
|
3217
|
-
/* @__PURE__ */ (0,
|
|
3218
|
-
subtitle && /* @__PURE__ */ (0,
|
|
3778
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: cn("flex items-center gap-md", className), children: [
|
|
3779
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Avatar, { initials: getInitials(name), src, alt: name, size: "lg", shape: "rounded" }),
|
|
3780
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex flex-col", children: [
|
|
3781
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-sm font-medium text-table-cell-text-primary leading-sm", children: name }),
|
|
3782
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-xs font-regular text-table-cell-text-secondary leading-xs", children: subtitle })
|
|
3219
3783
|
] })
|
|
3220
3784
|
] });
|
|
3221
3785
|
AvatarCell.displayName = "AvatarCell";
|
|
@@ -3225,7 +3789,7 @@ var StatusCell = ({
|
|
|
3225
3789
|
type = "primary",
|
|
3226
3790
|
size = "sm",
|
|
3227
3791
|
className
|
|
3228
|
-
}) => /* @__PURE__ */ (0,
|
|
3792
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: cn("flex items-center", className), children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Badge, { variant, type, size, children: label }) });
|
|
3229
3793
|
StatusCell.displayName = "StatusCell";
|
|
3230
3794
|
var secondaryIntentColors = {
|
|
3231
3795
|
success: "text-badge-light-success-text",
|
|
@@ -3243,7 +3807,7 @@ var NumberCell = ({
|
|
|
3243
3807
|
className
|
|
3244
3808
|
}) => {
|
|
3245
3809
|
const formatted = typeof value === "number" && formatOptions ? new Intl.NumberFormat(locale, formatOptions).format(value) : String(value);
|
|
3246
|
-
return /* @__PURE__ */ (0,
|
|
3810
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
3247
3811
|
"div",
|
|
3248
3812
|
{
|
|
3249
3813
|
className: cn(
|
|
@@ -3252,8 +3816,8 @@ var NumberCell = ({
|
|
|
3252
3816
|
className
|
|
3253
3817
|
),
|
|
3254
3818
|
children: [
|
|
3255
|
-
/* @__PURE__ */ (0,
|
|
3256
|
-
secondaryStat && /* @__PURE__ */ (0,
|
|
3819
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-sm font-medium text-table-cell-text-primary", children: formatted }),
|
|
3820
|
+
secondaryStat && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3257
3821
|
"span",
|
|
3258
3822
|
{
|
|
3259
3823
|
className: cn(
|
|
@@ -3281,7 +3845,7 @@ var DateCell = ({
|
|
|
3281
3845
|
}) => {
|
|
3282
3846
|
const d = typeof date === "string" ? new Date(date) : date;
|
|
3283
3847
|
const formatted = d.toLocaleDateString(locale, format);
|
|
3284
|
-
return /* @__PURE__ */ (0,
|
|
3848
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3285
3849
|
"span",
|
|
3286
3850
|
{
|
|
3287
3851
|
className: cn(
|
|
@@ -3293,7 +3857,7 @@ var DateCell = ({
|
|
|
3293
3857
|
);
|
|
3294
3858
|
};
|
|
3295
3859
|
DateCell.displayName = "DateCell";
|
|
3296
|
-
var EmailCell = ({ email, className }) => /* @__PURE__ */ (0,
|
|
3860
|
+
var EmailCell = ({ email, className }) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3297
3861
|
Link,
|
|
3298
3862
|
{
|
|
3299
3863
|
intent: "neutral",
|
|
@@ -3309,13 +3873,13 @@ var LinkCell = ({
|
|
|
3309
3873
|
label,
|
|
3310
3874
|
target = "_blank",
|
|
3311
3875
|
className
|
|
3312
|
-
}) => /* @__PURE__ */ (0,
|
|
3876
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Link, { intent: "brand", size: "sm", href, target, className, children: label ?? href });
|
|
3313
3877
|
LinkCell.displayName = "LinkCell";
|
|
3314
3878
|
var TextCell = ({
|
|
3315
3879
|
value,
|
|
3316
3880
|
secondary = false,
|
|
3317
3881
|
className
|
|
3318
|
-
}) => /* @__PURE__ */ (0,
|
|
3882
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3319
3883
|
"span",
|
|
3320
3884
|
{
|
|
3321
3885
|
className: cn(
|
|
@@ -3331,20 +3895,20 @@ var ButtonCell = ({
|
|
|
3331
3895
|
className,
|
|
3332
3896
|
children,
|
|
3333
3897
|
...props
|
|
3334
|
-
}) => /* @__PURE__ */ (0,
|
|
3898
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: cn("flex items-center", className), children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Button, { size: "sm", appearance: "ghost", intent: "brand", ...props, children }) });
|
|
3335
3899
|
ButtonCell.displayName = "ButtonCell";
|
|
3336
3900
|
var EditableCell = ({
|
|
3337
3901
|
value,
|
|
3338
3902
|
onSave,
|
|
3339
3903
|
className
|
|
3340
3904
|
}) => {
|
|
3341
|
-
const [isEditing, setIsEditing] =
|
|
3342
|
-
const [draft, setDraft] =
|
|
3343
|
-
const inputRef =
|
|
3344
|
-
|
|
3905
|
+
const [isEditing, setIsEditing] = React30.useState(false);
|
|
3906
|
+
const [draft, setDraft] = React30.useState(value);
|
|
3907
|
+
const inputRef = React30.useRef(null);
|
|
3908
|
+
React30.useEffect(() => {
|
|
3345
3909
|
setDraft(value);
|
|
3346
3910
|
}, [value]);
|
|
3347
|
-
|
|
3911
|
+
React30.useEffect(() => {
|
|
3348
3912
|
if (isEditing) {
|
|
3349
3913
|
inputRef.current?.focus();
|
|
3350
3914
|
inputRef.current?.select();
|
|
@@ -3364,7 +3928,7 @@ var EditableCell = ({
|
|
|
3364
3928
|
}
|
|
3365
3929
|
};
|
|
3366
3930
|
if (isEditing) {
|
|
3367
|
-
return /* @__PURE__ */ (0,
|
|
3931
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3368
3932
|
"input",
|
|
3369
3933
|
{
|
|
3370
3934
|
ref: inputRef,
|
|
@@ -3380,7 +3944,7 @@ var EditableCell = ({
|
|
|
3380
3944
|
}
|
|
3381
3945
|
);
|
|
3382
3946
|
}
|
|
3383
|
-
return /* @__PURE__ */ (0,
|
|
3947
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3384
3948
|
"span",
|
|
3385
3949
|
{
|
|
3386
3950
|
role: "button",
|
|
@@ -3402,7 +3966,7 @@ var EditableCell = ({
|
|
|
3402
3966
|
);
|
|
3403
3967
|
};
|
|
3404
3968
|
EditableCell.displayName = "EditableCell";
|
|
3405
|
-
var RowActions = ({ children, className }) => /* @__PURE__ */ (0,
|
|
3969
|
+
var RowActions = ({ children, className }) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3406
3970
|
"div",
|
|
3407
3971
|
{
|
|
3408
3972
|
className: cn(
|
|
@@ -3416,18 +3980,18 @@ var RowActions = ({ children, className }) => /* @__PURE__ */ (0, import_jsx_run
|
|
|
3416
3980
|
RowActions.displayName = "RowActions";
|
|
3417
3981
|
|
|
3418
3982
|
// src/components/ui/data-table.tsx
|
|
3419
|
-
var
|
|
3983
|
+
var React32 = __toESM(require("react"));
|
|
3420
3984
|
var import_react_table = require("@tanstack/react-table");
|
|
3421
3985
|
var import_core = require("@dnd-kit/core");
|
|
3422
3986
|
var import_sortable = require("@dnd-kit/sortable");
|
|
3423
3987
|
var import_utilities = require("@dnd-kit/utilities");
|
|
3424
|
-
var
|
|
3988
|
+
var import_icons21 = require("@l3mpire/icons");
|
|
3425
3989
|
var PopoverPrimitive2 = __toESM(require("@radix-ui/react-popover"));
|
|
3426
3990
|
|
|
3427
3991
|
// src/components/ui/table.tsx
|
|
3428
|
-
var
|
|
3429
|
-
var
|
|
3430
|
-
var Table =
|
|
3992
|
+
var React31 = __toESM(require("react"));
|
|
3993
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
3994
|
+
var Table = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3431
3995
|
"table",
|
|
3432
3996
|
{
|
|
3433
3997
|
ref,
|
|
@@ -3436,7 +4000,7 @@ var Table = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
3436
4000
|
}
|
|
3437
4001
|
) }));
|
|
3438
4002
|
Table.displayName = "Table";
|
|
3439
|
-
var TableHeader =
|
|
4003
|
+
var TableHeader = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3440
4004
|
"thead",
|
|
3441
4005
|
{
|
|
3442
4006
|
ref,
|
|
@@ -3445,9 +4009,9 @@ var TableHeader = React29.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
3445
4009
|
}
|
|
3446
4010
|
));
|
|
3447
4011
|
TableHeader.displayName = "TableHeader";
|
|
3448
|
-
var TableBody =
|
|
4012
|
+
var TableBody = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("tbody", { ref, className: cn("[&_tr:last-child_td]:border-b-0", className), ...props }));
|
|
3449
4013
|
TableBody.displayName = "TableBody";
|
|
3450
|
-
var TableFooter =
|
|
4014
|
+
var TableFooter = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3451
4015
|
"tfoot",
|
|
3452
4016
|
{
|
|
3453
4017
|
ref,
|
|
@@ -3459,7 +4023,7 @@ var TableFooter = React29.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
3459
4023
|
}
|
|
3460
4024
|
));
|
|
3461
4025
|
TableFooter.displayName = "TableFooter";
|
|
3462
|
-
var TableRow =
|
|
4026
|
+
var TableRow = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3463
4027
|
"tr",
|
|
3464
4028
|
{
|
|
3465
4029
|
ref,
|
|
@@ -3473,7 +4037,7 @@ var TableRow = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
3473
4037
|
}
|
|
3474
4038
|
));
|
|
3475
4039
|
TableRow.displayName = "TableRow";
|
|
3476
|
-
var TableHead =
|
|
4040
|
+
var TableHead = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3477
4041
|
"th",
|
|
3478
4042
|
{
|
|
3479
4043
|
ref,
|
|
@@ -3489,7 +4053,7 @@ var TableHead = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
3489
4053
|
}
|
|
3490
4054
|
));
|
|
3491
4055
|
TableHead.displayName = "TableHead";
|
|
3492
|
-
var TableCell =
|
|
4056
|
+
var TableCell = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3493
4057
|
"td",
|
|
3494
4058
|
{
|
|
3495
4059
|
ref,
|
|
@@ -3504,7 +4068,7 @@ var TableCell = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
3504
4068
|
}
|
|
3505
4069
|
));
|
|
3506
4070
|
TableCell.displayName = "TableCell";
|
|
3507
|
-
var TableCaption =
|
|
4071
|
+
var TableCaption = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3508
4072
|
"caption",
|
|
3509
4073
|
{
|
|
3510
4074
|
ref,
|
|
@@ -3515,7 +4079,7 @@ var TableCaption = React29.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
3515
4079
|
TableCaption.displayName = "TableCaption";
|
|
3516
4080
|
|
|
3517
4081
|
// src/components/ui/data-table.tsx
|
|
3518
|
-
var
|
|
4082
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
3519
4083
|
var filterOperatorsByType = {
|
|
3520
4084
|
string: [
|
|
3521
4085
|
{ value: "contains", label: "Contains" },
|
|
@@ -3565,12 +4129,12 @@ function ColumnFilterPopover({
|
|
|
3565
4129
|
children
|
|
3566
4130
|
}) {
|
|
3567
4131
|
const operators = filterOperatorsByType[filterType] ?? filterOperatorsByType.string;
|
|
3568
|
-
const [operator, setOperator] =
|
|
4132
|
+
const [operator, setOperator] = React32.useState(
|
|
3569
4133
|
operators[0].value
|
|
3570
4134
|
);
|
|
3571
|
-
const [inputValue, setInputValue] =
|
|
3572
|
-
const [open, setOpen] =
|
|
3573
|
-
|
|
4135
|
+
const [inputValue, setInputValue] = React32.useState("");
|
|
4136
|
+
const [open, setOpen] = React32.useState(false);
|
|
4137
|
+
React32.useEffect(() => {
|
|
3574
4138
|
if (open && filterValue && typeof filterValue === "object") {
|
|
3575
4139
|
const fv = filterValue;
|
|
3576
4140
|
if (fv.operator) setOperator(fv.operator);
|
|
@@ -3580,9 +4144,9 @@ function ColumnFilterPopover({
|
|
|
3580
4144
|
setInputValue("");
|
|
3581
4145
|
}
|
|
3582
4146
|
}, [open, filterValue, operators]);
|
|
3583
|
-
return /* @__PURE__ */ (0,
|
|
3584
|
-
/* @__PURE__ */ (0,
|
|
3585
|
-
/* @__PURE__ */ (0,
|
|
4147
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(PopoverPrimitive2.Root, { open, onOpenChange: setOpen, children: [
|
|
4148
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(PopoverPrimitive2.Trigger, { asChild: true, children }),
|
|
4149
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(PopoverPrimitive2.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3586
4150
|
PopoverPrimitive2.Content,
|
|
3587
4151
|
{
|
|
3588
4152
|
align: "start",
|
|
@@ -3592,9 +4156,9 @@ function ColumnFilterPopover({
|
|
|
3592
4156
|
"animate-in fade-in-0 zoom-in-95"
|
|
3593
4157
|
),
|
|
3594
4158
|
onClick: (e) => e.stopPropagation(),
|
|
3595
|
-
children: /* @__PURE__ */ (0,
|
|
3596
|
-
/* @__PURE__ */ (0,
|
|
3597
|
-
/* @__PURE__ */ (0,
|
|
4159
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex flex-col gap-sm", children: [
|
|
4160
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-xs font-medium text-table-head-text", children: "Filter" }),
|
|
4161
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3598
4162
|
"select",
|
|
3599
4163
|
{
|
|
3600
4164
|
className: cn(
|
|
@@ -3604,10 +4168,10 @@ function ColumnFilterPopover({
|
|
|
3604
4168
|
),
|
|
3605
4169
|
value: operator,
|
|
3606
4170
|
onChange: (e) => setOperator(e.target.value),
|
|
3607
|
-
children: operators.map((op) => /* @__PURE__ */ (0,
|
|
4171
|
+
children: operators.map((op) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("option", { value: op.value, children: op.label }, op.value))
|
|
3608
4172
|
}
|
|
3609
4173
|
),
|
|
3610
|
-
!noValueOperators.has(operator) && /* @__PURE__ */ (0,
|
|
4174
|
+
!noValueOperators.has(operator) && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3611
4175
|
"input",
|
|
3612
4176
|
{
|
|
3613
4177
|
type: filterType === "number" ? "number" : filterType === "date" ? "date" : "text",
|
|
@@ -3627,8 +4191,8 @@ function ColumnFilterPopover({
|
|
|
3627
4191
|
}
|
|
3628
4192
|
}
|
|
3629
4193
|
),
|
|
3630
|
-
/* @__PURE__ */ (0,
|
|
3631
|
-
/* @__PURE__ */ (0,
|
|
4194
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-center justify-end gap-xs pt-xs", children: [
|
|
4195
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3632
4196
|
Button,
|
|
3633
4197
|
{
|
|
3634
4198
|
appearance: "ghost",
|
|
@@ -3641,7 +4205,7 @@ function ColumnFilterPopover({
|
|
|
3641
4205
|
children: "Clear"
|
|
3642
4206
|
}
|
|
3643
4207
|
),
|
|
3644
|
-
/* @__PURE__ */ (0,
|
|
4208
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3645
4209
|
Button,
|
|
3646
4210
|
{
|
|
3647
4211
|
appearance: "solid",
|
|
@@ -3674,7 +4238,7 @@ function DraggableHeaderCell({
|
|
|
3674
4238
|
const leadingIcon = meta?.icon;
|
|
3675
4239
|
const canDrag = isDragEnabled && meta?.enableDrag !== false;
|
|
3676
4240
|
const filterType = meta?.filterType ?? "string";
|
|
3677
|
-
const [isHovered, setIsHovered] =
|
|
4241
|
+
const [isHovered, setIsHovered] = React32.useState(false);
|
|
3678
4242
|
const {
|
|
3679
4243
|
attributes,
|
|
3680
4244
|
listeners,
|
|
@@ -3696,7 +4260,7 @@ function DraggableHeaderCell({
|
|
|
3696
4260
|
opacity: isDragging ? 0.5 : 1,
|
|
3697
4261
|
zIndex: isDragging ? 1 : void 0
|
|
3698
4262
|
};
|
|
3699
|
-
return /* @__PURE__ */ (0,
|
|
4263
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
3700
4264
|
TableHead,
|
|
3701
4265
|
{
|
|
3702
4266
|
ref: setNodeRef,
|
|
@@ -3710,77 +4274,77 @@ function DraggableHeaderCell({
|
|
|
3710
4274
|
onMouseEnter: () => setIsHovered(true),
|
|
3711
4275
|
onMouseLeave: () => setIsHovered(false),
|
|
3712
4276
|
children: [
|
|
3713
|
-
/* @__PURE__ */ (0,
|
|
3714
|
-
leadingIcon && (canDrag ? /* @__PURE__ */ (0,
|
|
4277
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-center gap-xs", children: [
|
|
4278
|
+
leadingIcon && (canDrag ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3715
4279
|
"div",
|
|
3716
4280
|
{
|
|
3717
4281
|
...attributes,
|
|
3718
4282
|
...listeners,
|
|
3719
4283
|
className: "shrink-0 flex items-center cursor-grab",
|
|
3720
4284
|
onClick: (e) => e.stopPropagation(),
|
|
3721
|
-
children: /* @__PURE__ */ (0,
|
|
3722
|
-
|
|
4285
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4286
|
+
import_icons21.Icon,
|
|
3723
4287
|
{
|
|
3724
|
-
icon: isHovered ?
|
|
4288
|
+
icon: isHovered ? import_icons21.faGripDotsVerticalSolid : leadingIcon,
|
|
3725
4289
|
size: "xs",
|
|
3726
4290
|
className: "text-table-head-icon"
|
|
3727
4291
|
}
|
|
3728
4292
|
)
|
|
3729
4293
|
}
|
|
3730
|
-
) : /* @__PURE__ */ (0,
|
|
3731
|
-
|
|
4294
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4295
|
+
import_icons21.Icon,
|
|
3732
4296
|
{
|
|
3733
4297
|
icon: leadingIcon,
|
|
3734
4298
|
size: "xs",
|
|
3735
4299
|
className: "shrink-0 text-table-head-icon"
|
|
3736
4300
|
}
|
|
3737
4301
|
)),
|
|
3738
|
-
!leadingIcon && canDrag && isHovered && /* @__PURE__ */ (0,
|
|
4302
|
+
!leadingIcon && canDrag && isHovered && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3739
4303
|
"div",
|
|
3740
4304
|
{
|
|
3741
4305
|
...attributes,
|
|
3742
4306
|
...listeners,
|
|
3743
4307
|
className: "shrink-0 flex items-center cursor-grab",
|
|
3744
4308
|
onClick: (e) => e.stopPropagation(),
|
|
3745
|
-
children: /* @__PURE__ */ (0,
|
|
3746
|
-
|
|
4309
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4310
|
+
import_icons21.Icon,
|
|
3747
4311
|
{
|
|
3748
|
-
icon:
|
|
4312
|
+
icon: import_icons21.faGripDotsVerticalSolid,
|
|
3749
4313
|
size: "xs",
|
|
3750
4314
|
className: "text-table-head-icon"
|
|
3751
4315
|
}
|
|
3752
4316
|
)
|
|
3753
4317
|
}
|
|
3754
4318
|
),
|
|
3755
|
-
/* @__PURE__ */ (0,
|
|
4319
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "flex-1 truncate", children: header.isPlaceholder ? null : (0, import_react_table.flexRender)(
|
|
3756
4320
|
header.column.columnDef.header,
|
|
3757
4321
|
header.getContext()
|
|
3758
4322
|
) }),
|
|
3759
|
-
canSort && (isSorted || isHovered) && /* @__PURE__ */ (0,
|
|
3760
|
-
|
|
4323
|
+
canSort && (isSorted || isHovered) && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4324
|
+
import_icons21.Icon,
|
|
3761
4325
|
{
|
|
3762
|
-
icon: isSorted === "asc" ?
|
|
4326
|
+
icon: isSorted === "asc" ? import_icons21.faSortUpSolid : isSorted === "desc" ? import_icons21.faSortDownSolid : import_icons21.faSortSolid,
|
|
3763
4327
|
size: "xs",
|
|
3764
4328
|
className: "shrink-0 text-table-head-icon"
|
|
3765
4329
|
}
|
|
3766
4330
|
),
|
|
3767
|
-
enableFiltering && (isFiltered || isHovered) && /* @__PURE__ */ (0,
|
|
4331
|
+
enableFiltering && (isFiltered || isHovered) && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3768
4332
|
ColumnFilterPopover,
|
|
3769
4333
|
{
|
|
3770
4334
|
filterType,
|
|
3771
4335
|
filterValue: header.column.getFilterValue(),
|
|
3772
4336
|
onApply: (val) => header.column.setFilterValue(val),
|
|
3773
4337
|
onClear: () => header.column.setFilterValue(void 0),
|
|
3774
|
-
children: /* @__PURE__ */ (0,
|
|
4338
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3775
4339
|
"button",
|
|
3776
4340
|
{
|
|
3777
4341
|
type: "button",
|
|
3778
4342
|
onClick: (e) => e.stopPropagation(),
|
|
3779
4343
|
className: "shrink-0 p-0 border-0 bg-transparent cursor-pointer",
|
|
3780
|
-
children: /* @__PURE__ */ (0,
|
|
3781
|
-
|
|
4344
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4345
|
+
import_icons21.Icon,
|
|
3782
4346
|
{
|
|
3783
|
-
icon: isFiltered ?
|
|
4347
|
+
icon: isFiltered ? import_icons21.faFilterSolid : import_icons21.faFilterOutline,
|
|
3784
4348
|
size: "xs",
|
|
3785
4349
|
className: "text-table-head-icon"
|
|
3786
4350
|
}
|
|
@@ -3790,7 +4354,7 @@ function DraggableHeaderCell({
|
|
|
3790
4354
|
}
|
|
3791
4355
|
)
|
|
3792
4356
|
] }),
|
|
3793
|
-
enableColumnResizing && header.column.getCanResize() && /* @__PURE__ */ (0,
|
|
4357
|
+
enableColumnResizing && header.column.getCanResize() && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3794
4358
|
"div",
|
|
3795
4359
|
{
|
|
3796
4360
|
onMouseDown: header.getResizeHandler(),
|
|
@@ -3908,17 +4472,17 @@ function DataTableInner({
|
|
|
3908
4472
|
emptyMessage = "No results.",
|
|
3909
4473
|
bordered = false
|
|
3910
4474
|
}) {
|
|
3911
|
-
const [internalSorting, setInternalSorting] =
|
|
3912
|
-
const [internalColumnFilters, setInternalColumnFilters] =
|
|
3913
|
-
const [internalPagination, setInternalPagination] =
|
|
3914
|
-
const [internalRowSelection, setInternalRowSelection] =
|
|
3915
|
-
const [internalColumnVisibility, setInternalColumnVisibility] =
|
|
3916
|
-
const [internalColumnOrder, setInternalColumnOrder] =
|
|
3917
|
-
const [internalColumnPinning, setInternalColumnPinning] =
|
|
3918
|
-
const [internalColumnSizing, setInternalColumnSizing] =
|
|
4475
|
+
const [internalSorting, setInternalSorting] = React32.useState([]);
|
|
4476
|
+
const [internalColumnFilters, setInternalColumnFilters] = React32.useState([]);
|
|
4477
|
+
const [internalPagination, setInternalPagination] = React32.useState({ pageIndex: 0, pageSize: 10 });
|
|
4478
|
+
const [internalRowSelection, setInternalRowSelection] = React32.useState({});
|
|
4479
|
+
const [internalColumnVisibility, setInternalColumnVisibility] = React32.useState({});
|
|
4480
|
+
const [internalColumnOrder, setInternalColumnOrder] = React32.useState([]);
|
|
4481
|
+
const [internalColumnPinning, setInternalColumnPinning] = React32.useState({});
|
|
4482
|
+
const [internalColumnSizing, setInternalColumnSizing] = React32.useState({});
|
|
3919
4483
|
const columnOrder = columnOrderProp ?? internalColumnOrder;
|
|
3920
4484
|
const setColumnOrder = onColumnOrderChange ?? setInternalColumnOrder;
|
|
3921
|
-
|
|
4485
|
+
React32.useEffect(() => {
|
|
3922
4486
|
if (enableColumnDrag && columnOrder.length === 0) {
|
|
3923
4487
|
const ids = columns.map((c) => {
|
|
3924
4488
|
if ("accessorKey" in c && c.accessorKey) return String(c.accessorKey);
|
|
@@ -4012,7 +4576,7 @@ function DataTableInner({
|
|
|
4012
4576
|
}),
|
|
4013
4577
|
(0, import_core.useSensor)(import_core.KeyboardSensor)
|
|
4014
4578
|
);
|
|
4015
|
-
const handleDragEnd =
|
|
4579
|
+
const handleDragEnd = React32.useCallback(
|
|
4016
4580
|
(event) => {
|
|
4017
4581
|
const { active, over } = event;
|
|
4018
4582
|
if (!over || active.id === over.id) return;
|
|
@@ -4026,12 +4590,12 @@ function DataTableInner({
|
|
|
4026
4590
|
},
|
|
4027
4591
|
[table, setColumnOrder]
|
|
4028
4592
|
);
|
|
4029
|
-
const columnIds =
|
|
4593
|
+
const columnIds = React32.useMemo(
|
|
4030
4594
|
() => table.getAllLeafColumns().map((c) => c.id),
|
|
4031
4595
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4032
4596
|
[table.getAllLeafColumns().length, columnOrder]
|
|
4033
4597
|
);
|
|
4034
|
-
const columnSizeVars =
|
|
4598
|
+
const columnSizeVars = React32.useMemo(() => {
|
|
4035
4599
|
if (!enableColumnResizing) return {};
|
|
4036
4600
|
const headers = table.getFlatHeaders();
|
|
4037
4601
|
const vars = {};
|
|
@@ -4042,23 +4606,23 @@ function DataTableInner({
|
|
|
4042
4606
|
return vars;
|
|
4043
4607
|
}, [enableColumnResizing, table.getState().columnSizing]);
|
|
4044
4608
|
const totalSize = enableColumnResizing ? table.getTotalSize() : void 0;
|
|
4045
|
-
const tableContent = /* @__PURE__ */ (0,
|
|
4046
|
-
/* @__PURE__ */ (0,
|
|
4609
|
+
const tableContent = /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: cn("w-full", className), style: columnSizeVars, children: [
|
|
4610
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
4047
4611
|
Table,
|
|
4048
4612
|
{
|
|
4049
4613
|
style: totalSize ? { width: totalSize, tableLayout: "fixed" } : void 0,
|
|
4050
4614
|
className: totalSize ? "w-auto" : void 0,
|
|
4051
4615
|
children: [
|
|
4052
|
-
/* @__PURE__ */ (0,
|
|
4616
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4053
4617
|
TableHeader,
|
|
4054
4618
|
{
|
|
4055
4619
|
className: cn(bordered && "border-t border-table-border"),
|
|
4056
|
-
children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0,
|
|
4620
|
+
children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TableRow, { children: enableColumnDrag ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4057
4621
|
import_sortable.SortableContext,
|
|
4058
4622
|
{
|
|
4059
4623
|
items: columnIds,
|
|
4060
4624
|
strategy: import_sortable.horizontalListSortingStrategy,
|
|
4061
|
-
children: headerGroup.headers.map((header) => /* @__PURE__ */ (0,
|
|
4625
|
+
children: headerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4062
4626
|
DraggableHeaderCell,
|
|
4063
4627
|
{
|
|
4064
4628
|
header,
|
|
@@ -4070,7 +4634,7 @@ function DataTableInner({
|
|
|
4070
4634
|
header.id
|
|
4071
4635
|
))
|
|
4072
4636
|
}
|
|
4073
|
-
) : headerGroup.headers.map((header) => /* @__PURE__ */ (0,
|
|
4637
|
+
) : headerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4074
4638
|
DraggableHeaderCell,
|
|
4075
4639
|
{
|
|
4076
4640
|
header,
|
|
@@ -4083,11 +4647,11 @@ function DataTableInner({
|
|
|
4083
4647
|
)) }, headerGroup.id))
|
|
4084
4648
|
}
|
|
4085
4649
|
),
|
|
4086
|
-
/* @__PURE__ */ (0,
|
|
4650
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TableBody, { children: table.getRowModel().rows?.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4087
4651
|
TableRow,
|
|
4088
4652
|
{
|
|
4089
4653
|
"data-state": row.getIsSelected() ? "selected" : void 0,
|
|
4090
|
-
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0,
|
|
4654
|
+
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4091
4655
|
TableCell,
|
|
4092
4656
|
{
|
|
4093
4657
|
style: enableColumnResizing ? { width: `var(--col-${cell.column.id}-size)` } : void 0,
|
|
@@ -4101,12 +4665,12 @@ function DataTableInner({
|
|
|
4101
4665
|
))
|
|
4102
4666
|
},
|
|
4103
4667
|
row.id
|
|
4104
|
-
)) : /* @__PURE__ */ (0,
|
|
4668
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TableRow, { className: "hover:bg-transparent", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4105
4669
|
TableCell,
|
|
4106
4670
|
{
|
|
4107
4671
|
colSpan: columns.length,
|
|
4108
4672
|
className: "h-48 text-center border-b-0",
|
|
4109
|
-
children: emptyState ?? /* @__PURE__ */ (0,
|
|
4673
|
+
children: emptyState ?? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-sm text-table-cell-text-secondary", children: emptyMessage })
|
|
4110
4674
|
}
|
|
4111
4675
|
) }) })
|
|
4112
4676
|
]
|
|
@@ -4115,7 +4679,7 @@ function DataTableInner({
|
|
|
4115
4679
|
children?.(table)
|
|
4116
4680
|
] });
|
|
4117
4681
|
if (enableColumnDrag) {
|
|
4118
|
-
return /* @__PURE__ */ (0,
|
|
4682
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4119
4683
|
import_core.DndContext,
|
|
4120
4684
|
{
|
|
4121
4685
|
sensors,
|
|
@@ -4136,7 +4700,7 @@ function DataTablePagination({
|
|
|
4136
4700
|
const totalCount = table.getFilteredRowModel().rows.length;
|
|
4137
4701
|
const pageIndex = table.getState().pagination.pageIndex;
|
|
4138
4702
|
const pageCount = table.getPageCount();
|
|
4139
|
-
return /* @__PURE__ */ (0,
|
|
4703
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
4140
4704
|
"div",
|
|
4141
4705
|
{
|
|
4142
4706
|
className: cn(
|
|
@@ -4144,16 +4708,16 @@ function DataTablePagination({
|
|
|
4144
4708
|
className
|
|
4145
4709
|
),
|
|
4146
4710
|
children: [
|
|
4147
|
-
/* @__PURE__ */ (0,
|
|
4711
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "text-xs text-table-cell-text-secondary", children: selectedCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { children: [
|
|
4148
4712
|
selectedCount,
|
|
4149
4713
|
" of ",
|
|
4150
4714
|
totalCount,
|
|
4151
4715
|
" row(s) selected"
|
|
4152
4716
|
] }) }),
|
|
4153
|
-
/* @__PURE__ */ (0,
|
|
4154
|
-
/* @__PURE__ */ (0,
|
|
4155
|
-
/* @__PURE__ */ (0,
|
|
4156
|
-
/* @__PURE__ */ (0,
|
|
4717
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-center gap-lg", children: [
|
|
4718
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-center gap-sm", children: [
|
|
4719
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-xs text-table-cell-text-secondary whitespace-nowrap", children: "Rows per page" }),
|
|
4720
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4157
4721
|
"select",
|
|
4158
4722
|
{
|
|
4159
4723
|
className: cn(
|
|
@@ -4163,36 +4727,36 @@ function DataTablePagination({
|
|
|
4163
4727
|
),
|
|
4164
4728
|
value: table.getState().pagination.pageSize,
|
|
4165
4729
|
onChange: (e) => table.setPageSize(Number(e.target.value)),
|
|
4166
|
-
children: pageSizeOptions.map((size) => /* @__PURE__ */ (0,
|
|
4730
|
+
children: pageSizeOptions.map((size) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("option", { value: size, children: size }, size))
|
|
4167
4731
|
}
|
|
4168
4732
|
)
|
|
4169
4733
|
] }),
|
|
4170
|
-
/* @__PURE__ */ (0,
|
|
4734
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: "text-xs text-table-cell-text-secondary whitespace-nowrap", children: [
|
|
4171
4735
|
"Page ",
|
|
4172
4736
|
pageIndex + 1,
|
|
4173
4737
|
" of ",
|
|
4174
4738
|
pageCount
|
|
4175
4739
|
] }),
|
|
4176
|
-
/* @__PURE__ */ (0,
|
|
4177
|
-
/* @__PURE__ */ (0,
|
|
4740
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-center gap-xs", children: [
|
|
4741
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4178
4742
|
Button,
|
|
4179
4743
|
{
|
|
4180
4744
|
appearance: "outlined",
|
|
4181
4745
|
intent: "brand",
|
|
4182
4746
|
size: "md",
|
|
4183
|
-
leftIcon:
|
|
4747
|
+
leftIcon: import_icons21.faChevronLeftOutline,
|
|
4184
4748
|
onClick: () => table.previousPage(),
|
|
4185
4749
|
disabled: !table.getCanPreviousPage(),
|
|
4186
4750
|
"aria-label": "Previous page"
|
|
4187
4751
|
}
|
|
4188
4752
|
),
|
|
4189
|
-
/* @__PURE__ */ (0,
|
|
4753
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4190
4754
|
Button,
|
|
4191
4755
|
{
|
|
4192
4756
|
appearance: "outlined",
|
|
4193
4757
|
intent: "brand",
|
|
4194
4758
|
size: "md",
|
|
4195
|
-
leftIcon:
|
|
4759
|
+
leftIcon: import_icons21.faChevronRightOutline,
|
|
4196
4760
|
onClick: () => table.nextPage(),
|
|
4197
4761
|
disabled: !table.getCanNextPage(),
|
|
4198
4762
|
"aria-label": "Next page"
|
|
@@ -4208,15 +4772,15 @@ var DataTable = Object.assign(DataTableInner, { displayName: "DataTable" });
|
|
|
4208
4772
|
Object.assign(DataTablePagination, { displayName: "DataTablePagination" });
|
|
4209
4773
|
|
|
4210
4774
|
// src/components/ui/side-panel.tsx
|
|
4211
|
-
var
|
|
4775
|
+
var React33 = __toESM(require("react"));
|
|
4212
4776
|
var DialogPrimitive2 = __toESM(require("@radix-ui/react-dialog"));
|
|
4213
|
-
var
|
|
4777
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
4214
4778
|
var SidePanel = DialogPrimitive2.Root;
|
|
4215
4779
|
var SidePanelTrigger = DialogPrimitive2.Trigger;
|
|
4216
4780
|
var SidePanelClose = DialogPrimitive2.Close;
|
|
4217
|
-
var SidePanelContent =
|
|
4218
|
-
overlay && /* @__PURE__ */ (0,
|
|
4219
|
-
/* @__PURE__ */ (0,
|
|
4781
|
+
var SidePanelContent = React33.forwardRef(({ className, overlay = true, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(DialogPrimitive2.Portal, { children: [
|
|
4782
|
+
overlay && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ModalOverlay, {}),
|
|
4783
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4220
4784
|
DialogPrimitive2.Content,
|
|
4221
4785
|
{
|
|
4222
4786
|
ref,
|
|
@@ -4245,6 +4809,7 @@ SidePanelContent.displayName = "SidePanelContent";
|
|
|
4245
4809
|
Button,
|
|
4246
4810
|
ButtonCell,
|
|
4247
4811
|
Checkbox,
|
|
4812
|
+
ChipInput,
|
|
4248
4813
|
DataTable,
|
|
4249
4814
|
DataTablePagination,
|
|
4250
4815
|
DateCell,
|
|
@@ -4276,6 +4841,7 @@ SidePanelContent.displayName = "SidePanelContent";
|
|
|
4276
4841
|
ModalTitle,
|
|
4277
4842
|
ModalTrigger,
|
|
4278
4843
|
NumberCell,
|
|
4844
|
+
NumberInput,
|
|
4279
4845
|
ProductLogo,
|
|
4280
4846
|
RowActions,
|
|
4281
4847
|
SearchBar,
|
|
@@ -4322,6 +4888,7 @@ SidePanelContent.displayName = "SidePanelContent";
|
|
|
4322
4888
|
avatarVariants,
|
|
4323
4889
|
badgeVariants,
|
|
4324
4890
|
buttonVariants,
|
|
4891
|
+
chipInputVariants,
|
|
4325
4892
|
cn,
|
|
4326
4893
|
emptyStateVariants,
|
|
4327
4894
|
flexRender,
|