smartsell-ui-kit 0.1.13 → 0.1.14
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/README.md +2 -0
- package/dist/index.cjs +358 -143
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -388
- package/dist/index.d.ts +18 -388
- package/dist/index.js +357 -143
- package/dist/index.js.map +1 -1
- package/dist/types-ENHTzCG6.d.cts +392 -0
- package/dist/types-ENHTzCG6.d.ts +392 -0
- package/dist/types.d.cts +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2296,8 +2296,221 @@ function DatePicker({
|
|
|
2296
2296
|
);
|
|
2297
2297
|
}
|
|
2298
2298
|
|
|
2299
|
+
// src/components/Loading.tsx
|
|
2300
|
+
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2301
|
+
var SIZE_BY_CONTROL_SIZE = {
|
|
2302
|
+
sm: 28,
|
|
2303
|
+
md: 40,
|
|
2304
|
+
lg: 56
|
|
2305
|
+
};
|
|
2306
|
+
var BASE_DROP_MS = 1500;
|
|
2307
|
+
var BASE_WHEEL_MS = 900;
|
|
2308
|
+
var BASE_BOB_MS = 1500;
|
|
2309
|
+
var ITEM_DELAY_RATIOS = [0, 0.26, 0.52];
|
|
2310
|
+
var ITEM_FILL_OPACITIES = [1, 0.72, 0.88];
|
|
2311
|
+
var LOADING_KEYFRAMES = `
|
|
2312
|
+
@keyframes ss-loading-drop {
|
|
2313
|
+
0% { transform: translateY(-18px) scale(0.55); opacity: 0; }
|
|
2314
|
+
12% { opacity: 1; }
|
|
2315
|
+
45% { transform: translateY(0) scale(1); opacity: 1; }
|
|
2316
|
+
56% { transform: translateY(-2.5px) scale(1); opacity: 1; }
|
|
2317
|
+
66% { transform: translateY(0) scale(1); opacity: 1; }
|
|
2318
|
+
82%, 100% { transform: translateY(0) scale(0.72); opacity: 0; }
|
|
2319
|
+
}
|
|
2320
|
+
@keyframes ss-loading-bob {
|
|
2321
|
+
0%, 50%, 100% { transform: translateY(0) rotate(0deg); }
|
|
2322
|
+
25% { transform: translateY(-0.9px) rotate(-1.2deg); }
|
|
2323
|
+
75% { transform: translateY(-0.5px) rotate(0.8deg); }
|
|
2324
|
+
}
|
|
2325
|
+
@keyframes ss-loading-wheel {
|
|
2326
|
+
from { transform: rotate(0deg); }
|
|
2327
|
+
to { transform: rotate(360deg); }
|
|
2328
|
+
}
|
|
2329
|
+
@keyframes ss-loading-pulse {
|
|
2330
|
+
0%, 100% { opacity: 1; }
|
|
2331
|
+
50% { opacity: 0.45; }
|
|
2332
|
+
}
|
|
2333
|
+
@media (prefers-reduced-motion: reduce) {
|
|
2334
|
+
.ss-loading-cart,
|
|
2335
|
+
.ss-loading-wheel,
|
|
2336
|
+
.ss-loading-item {
|
|
2337
|
+
animation: none !important;
|
|
2338
|
+
opacity: 1 !important;
|
|
2339
|
+
transform: none !important;
|
|
2340
|
+
}
|
|
2341
|
+
.ss-loading-svg {
|
|
2342
|
+
animation: ss-loading-pulse 1600ms ease-in-out infinite;
|
|
2343
|
+
}
|
|
2344
|
+
}
|
|
2345
|
+
`;
|
|
2346
|
+
var resolveSize = (size) => {
|
|
2347
|
+
return typeof size === "number" ? size : SIZE_BY_CONTROL_SIZE[size];
|
|
2348
|
+
};
|
|
2349
|
+
var WHEELS = [
|
|
2350
|
+
{ cx: 18, cy: 32.6 },
|
|
2351
|
+
{ cx: 35, cy: 32.6 }
|
|
2352
|
+
];
|
|
2353
|
+
function Loading({
|
|
2354
|
+
size = "md",
|
|
2355
|
+
color,
|
|
2356
|
+
label,
|
|
2357
|
+
accessibleLabel = "Loading",
|
|
2358
|
+
speed = 1,
|
|
2359
|
+
className,
|
|
2360
|
+
style,
|
|
2361
|
+
...rest
|
|
2362
|
+
}) {
|
|
2363
|
+
useUiKitTheme();
|
|
2364
|
+
const pixelSize = resolveSize(size);
|
|
2365
|
+
const safeSpeed = Math.max(0.1, speed);
|
|
2366
|
+
const dropDuration = BASE_DROP_MS / safeSpeed;
|
|
2367
|
+
const strokeColor = color != null ? color : "var(--theme-primary)";
|
|
2368
|
+
const itemAnimation = (index) => ({
|
|
2369
|
+
transformBox: "fill-box",
|
|
2370
|
+
transformOrigin: "center",
|
|
2371
|
+
animation: `ss-loading-drop ${dropDuration}ms cubic-bezier(0.45, 0, 0.35, 1) infinite`,
|
|
2372
|
+
animationDelay: `${ITEM_DELAY_RATIOS[index] * dropDuration}ms`
|
|
2373
|
+
});
|
|
2374
|
+
return /* @__PURE__ */ jsxs8(
|
|
2375
|
+
"div",
|
|
2376
|
+
{
|
|
2377
|
+
...rest,
|
|
2378
|
+
role: "status",
|
|
2379
|
+
"aria-live": "polite",
|
|
2380
|
+
"aria-busy": "true",
|
|
2381
|
+
className: cx(UI_KIT_ROOT_CLASSNAME, "inline-flex flex-col items-center justify-center", className),
|
|
2382
|
+
style: {
|
|
2383
|
+
gap: Math.round(pixelSize * 0.2),
|
|
2384
|
+
backgroundColor: "transparent",
|
|
2385
|
+
...style
|
|
2386
|
+
},
|
|
2387
|
+
children: [
|
|
2388
|
+
/* @__PURE__ */ jsxs8(
|
|
2389
|
+
"svg",
|
|
2390
|
+
{
|
|
2391
|
+
className: "ss-loading-svg",
|
|
2392
|
+
width: pixelSize,
|
|
2393
|
+
height: pixelSize,
|
|
2394
|
+
viewBox: "0 0 48 48",
|
|
2395
|
+
fill: "none",
|
|
2396
|
+
"aria-hidden": "true",
|
|
2397
|
+
style: { color: strokeColor, overflow: "hidden" },
|
|
2398
|
+
children: [
|
|
2399
|
+
/* @__PURE__ */ jsx8("style", { children: LOADING_KEYFRAMES }),
|
|
2400
|
+
/* @__PURE__ */ jsxs8(
|
|
2401
|
+
"g",
|
|
2402
|
+
{
|
|
2403
|
+
className: "ss-loading-cart",
|
|
2404
|
+
style: {
|
|
2405
|
+
transformBox: "view-box",
|
|
2406
|
+
transformOrigin: "26px 32px",
|
|
2407
|
+
animation: `ss-loading-bob ${BASE_BOB_MS / safeSpeed}ms ease-in-out infinite`
|
|
2408
|
+
},
|
|
2409
|
+
children: [
|
|
2410
|
+
/* @__PURE__ */ jsx8(
|
|
2411
|
+
"rect",
|
|
2412
|
+
{
|
|
2413
|
+
className: "ss-loading-item",
|
|
2414
|
+
x: 15.5,
|
|
2415
|
+
y: 16.5,
|
|
2416
|
+
width: 7.5,
|
|
2417
|
+
height: 7,
|
|
2418
|
+
rx: 1.8,
|
|
2419
|
+
fill: "currentColor",
|
|
2420
|
+
fillOpacity: ITEM_FILL_OPACITIES[0],
|
|
2421
|
+
style: itemAnimation(0)
|
|
2422
|
+
}
|
|
2423
|
+
),
|
|
2424
|
+
/* @__PURE__ */ jsx8(
|
|
2425
|
+
"circle",
|
|
2426
|
+
{
|
|
2427
|
+
className: "ss-loading-item",
|
|
2428
|
+
cx: 27.5,
|
|
2429
|
+
cy: 20,
|
|
2430
|
+
r: 3.6,
|
|
2431
|
+
fill: "currentColor",
|
|
2432
|
+
fillOpacity: ITEM_FILL_OPACITIES[1],
|
|
2433
|
+
style: itemAnimation(1)
|
|
2434
|
+
}
|
|
2435
|
+
),
|
|
2436
|
+
/* @__PURE__ */ jsx8(
|
|
2437
|
+
"rect",
|
|
2438
|
+
{
|
|
2439
|
+
className: "ss-loading-item",
|
|
2440
|
+
x: 32,
|
|
2441
|
+
y: 16.5,
|
|
2442
|
+
width: 6.6,
|
|
2443
|
+
height: 7,
|
|
2444
|
+
rx: 1.8,
|
|
2445
|
+
fill: "currentColor",
|
|
2446
|
+
fillOpacity: ITEM_FILL_OPACITIES[2],
|
|
2447
|
+
style: itemAnimation(2)
|
|
2448
|
+
}
|
|
2449
|
+
),
|
|
2450
|
+
/* @__PURE__ */ jsxs8("g", { stroke: "currentColor", strokeWidth: 2.6, strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2451
|
+
/* @__PURE__ */ jsx8("path", { d: "M3.5 7.5h4.6l1.6 5" }),
|
|
2452
|
+
/* @__PURE__ */ jsx8("path", { d: "M9.7 12.5H43l-4.4 13.5H14.1z" }),
|
|
2453
|
+
/* @__PURE__ */ jsx8("path", { d: "M18 26v3.4" }),
|
|
2454
|
+
/* @__PURE__ */ jsx8("path", { d: "M35 26v3.4" })
|
|
2455
|
+
] }),
|
|
2456
|
+
WHEELS.map((wheel) => /* @__PURE__ */ jsxs8(
|
|
2457
|
+
"g",
|
|
2458
|
+
{
|
|
2459
|
+
className: "ss-loading-wheel",
|
|
2460
|
+
style: {
|
|
2461
|
+
transformBox: "view-box",
|
|
2462
|
+
transformOrigin: `${wheel.cx}px ${wheel.cy}px`,
|
|
2463
|
+
animation: `ss-loading-wheel ${BASE_WHEEL_MS / safeSpeed}ms linear infinite`
|
|
2464
|
+
},
|
|
2465
|
+
children: [
|
|
2466
|
+
/* @__PURE__ */ jsx8(
|
|
2467
|
+
"circle",
|
|
2468
|
+
{
|
|
2469
|
+
cx: wheel.cx,
|
|
2470
|
+
cy: wheel.cy,
|
|
2471
|
+
r: 3.2,
|
|
2472
|
+
stroke: "currentColor",
|
|
2473
|
+
strokeWidth: 2.2,
|
|
2474
|
+
fill: "none"
|
|
2475
|
+
}
|
|
2476
|
+
),
|
|
2477
|
+
/* @__PURE__ */ jsx8(
|
|
2478
|
+
"path",
|
|
2479
|
+
{
|
|
2480
|
+
d: `M${wheel.cx} ${wheel.cy}V${wheel.cy - 3.2}`,
|
|
2481
|
+
stroke: "currentColor",
|
|
2482
|
+
strokeWidth: 2.2,
|
|
2483
|
+
strokeLinecap: "round"
|
|
2484
|
+
}
|
|
2485
|
+
)
|
|
2486
|
+
]
|
|
2487
|
+
},
|
|
2488
|
+
wheel.cx
|
|
2489
|
+
))
|
|
2490
|
+
]
|
|
2491
|
+
}
|
|
2492
|
+
)
|
|
2493
|
+
]
|
|
2494
|
+
}
|
|
2495
|
+
),
|
|
2496
|
+
label ? /* @__PURE__ */ jsx8(
|
|
2497
|
+
"span",
|
|
2498
|
+
{
|
|
2499
|
+
style: {
|
|
2500
|
+
color: "var(--theme-textLight)",
|
|
2501
|
+
fontSize: Math.max(12, Math.round(pixelSize * 0.3)),
|
|
2502
|
+
lineHeight: 1.4
|
|
2503
|
+
},
|
|
2504
|
+
children: label
|
|
2505
|
+
}
|
|
2506
|
+
) : /* @__PURE__ */ jsx8("span", { className: "ui-kit-sr-only", children: accessibleLabel })
|
|
2507
|
+
]
|
|
2508
|
+
}
|
|
2509
|
+
);
|
|
2510
|
+
}
|
|
2511
|
+
|
|
2299
2512
|
// src/components/Separator.tsx
|
|
2300
|
-
import { jsx as
|
|
2513
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
2301
2514
|
function Separator({
|
|
2302
2515
|
orientation = "vertical",
|
|
2303
2516
|
color,
|
|
@@ -2314,7 +2527,7 @@ function Separator({
|
|
|
2314
2527
|
height: orientation === "vertical" ? usesVerticalStretch ? "auto" : size : 3,
|
|
2315
2528
|
...style
|
|
2316
2529
|
};
|
|
2317
|
-
return /* @__PURE__ */
|
|
2530
|
+
return /* @__PURE__ */ jsx9(
|
|
2318
2531
|
"div",
|
|
2319
2532
|
{
|
|
2320
2533
|
...rest,
|
|
@@ -2387,13 +2600,13 @@ function filterSelectGroups(groups, query) {
|
|
|
2387
2600
|
}
|
|
2388
2601
|
|
|
2389
2602
|
// src/componentsBase/select/SelectBase.tsx
|
|
2390
|
-
import { Fragment as Fragment3, jsx as
|
|
2603
|
+
import { Fragment as Fragment3, jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2391
2604
|
var MENU_OFFSET = 8;
|
|
2392
2605
|
var MENU_MAX_HEIGHT = 280;
|
|
2393
2606
|
var emptySubscribe = () => () => {
|
|
2394
2607
|
};
|
|
2395
2608
|
function SearchIcon({ size }) {
|
|
2396
|
-
return /* @__PURE__ */
|
|
2609
|
+
return /* @__PURE__ */ jsx10("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx10(
|
|
2397
2610
|
"path",
|
|
2398
2611
|
{
|
|
2399
2612
|
d: "m21 21-4.35-4.35M10.5 18a7.5 7.5 0 1 1 0-15 7.5 7.5 0 0 1 0 15Z",
|
|
@@ -2774,7 +2987,7 @@ function SelectBase({
|
|
|
2774
2987
|
const hasSomeVisibleSelected = visibleSelectedCount > 0 && visibleSelectedCount < visibleEnabledValues.length;
|
|
2775
2988
|
const hasAllVisibleSelected = visibleEnabledValues.length > 0 && visibleSelectedCount === visibleEnabledValues.length;
|
|
2776
2989
|
const canToggleVisibleSelection = !disabled && visibleEnabledValues.length > 0;
|
|
2777
|
-
const bulkToggleControl = isMultiSelect ? /* @__PURE__ */
|
|
2990
|
+
const bulkToggleControl = isMultiSelect ? /* @__PURE__ */ jsx10(
|
|
2778
2991
|
"button",
|
|
2779
2992
|
{
|
|
2780
2993
|
type: "button",
|
|
@@ -2794,7 +3007,7 @@ function SelectBase({
|
|
|
2794
3007
|
"m-0 inline-flex h-5 w-5 shrink-0 items-center justify-center border-0 bg-transparent p-0",
|
|
2795
3008
|
canToggleVisibleSelection ? "cursor-pointer opacity-100" : "cursor-not-allowed opacity-45"
|
|
2796
3009
|
),
|
|
2797
|
-
children: /* @__PURE__ */
|
|
3010
|
+
children: /* @__PURE__ */ jsx10(
|
|
2798
3011
|
CheckboxIndicator,
|
|
2799
3012
|
{
|
|
2800
3013
|
checked: hasAllVisibleSelected,
|
|
@@ -2951,7 +3164,7 @@ function SelectBase({
|
|
|
2951
3164
|
}
|
|
2952
3165
|
};
|
|
2953
3166
|
const emptyState = isLoading ? loadingMessage : emptyMessage;
|
|
2954
|
-
return /* @__PURE__ */
|
|
3167
|
+
return /* @__PURE__ */ jsx10(
|
|
2955
3168
|
ControlFrame,
|
|
2956
3169
|
{
|
|
2957
3170
|
label,
|
|
@@ -2962,8 +3175,8 @@ function SelectBase({
|
|
|
2962
3175
|
size,
|
|
2963
3176
|
hasValue: hasSelection || isOpen,
|
|
2964
3177
|
floatingPlaceholder,
|
|
2965
|
-
children: /* @__PURE__ */
|
|
2966
|
-
/* @__PURE__ */
|
|
3178
|
+
children: /* @__PURE__ */ jsxs9("div", { ref: shellRef, className: "relative w-full", children: [
|
|
3179
|
+
/* @__PURE__ */ jsxs9(
|
|
2967
3180
|
"button",
|
|
2968
3181
|
{
|
|
2969
3182
|
...buttonPassthroughProps,
|
|
@@ -2992,12 +3205,12 @@ function SelectBase({
|
|
|
2992
3205
|
...isTriggerDisabled ? { opacity: DISABLED_FIELD_OPACITY } : {}
|
|
2993
3206
|
},
|
|
2994
3207
|
children: [
|
|
2995
|
-
/* @__PURE__ */
|
|
3208
|
+
/* @__PURE__ */ jsx10(
|
|
2996
3209
|
"span",
|
|
2997
3210
|
{
|
|
2998
3211
|
className: "block min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap",
|
|
2999
3212
|
style: controlTextNudgeStyle,
|
|
3000
|
-
children: hasSelection ? displayContent : /* @__PURE__ */
|
|
3213
|
+
children: hasSelection ? displayContent : /* @__PURE__ */ jsx10(
|
|
3001
3214
|
"span",
|
|
3002
3215
|
{
|
|
3003
3216
|
className: floatingPlaceholder ? "" : "text-[var(--theme-textLight)]",
|
|
@@ -3006,7 +3219,7 @@ function SelectBase({
|
|
|
3006
3219
|
)
|
|
3007
3220
|
}
|
|
3008
3221
|
),
|
|
3009
|
-
/* @__PURE__ */
|
|
3222
|
+
/* @__PURE__ */ jsx10(
|
|
3010
3223
|
"span",
|
|
3011
3224
|
{
|
|
3012
3225
|
"aria-hidden": "true",
|
|
@@ -3019,7 +3232,7 @@ function SelectBase({
|
|
|
3019
3232
|
right: indicatorOffset,
|
|
3020
3233
|
transform: `translateY(-50%) rotate(${isOpen ? 180 : 0}deg)`
|
|
3021
3234
|
},
|
|
3022
|
-
children: /* @__PURE__ */
|
|
3235
|
+
children: /* @__PURE__ */ jsx10("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", children: /* @__PURE__ */ jsx10(
|
|
3023
3236
|
"path",
|
|
3024
3237
|
{
|
|
3025
3238
|
d: "M5.75 7.75L10 12l4.25-4.25",
|
|
@@ -3034,7 +3247,7 @@ function SelectBase({
|
|
|
3034
3247
|
]
|
|
3035
3248
|
}
|
|
3036
3249
|
),
|
|
3037
|
-
/* @__PURE__ */
|
|
3250
|
+
/* @__PURE__ */ jsx10(
|
|
3038
3251
|
"select",
|
|
3039
3252
|
{
|
|
3040
3253
|
...rest,
|
|
@@ -3052,8 +3265,8 @@ function SelectBase({
|
|
|
3052
3265
|
}
|
|
3053
3266
|
),
|
|
3054
3267
|
isMounted && isOpen ? createPortal(
|
|
3055
|
-
/* @__PURE__ */
|
|
3056
|
-
/* @__PURE__ */
|
|
3268
|
+
/* @__PURE__ */ jsxs9(Fragment3, { children: [
|
|
3269
|
+
/* @__PURE__ */ jsx10("style", { children: `
|
|
3057
3270
|
#${listboxId} {
|
|
3058
3271
|
scrollbar-width: thin;
|
|
3059
3272
|
scrollbar-color: ${scrollbarThumbColor} transparent;
|
|
@@ -3084,7 +3297,7 @@ function SelectBase({
|
|
|
3084
3297
|
opacity: 1;
|
|
3085
3298
|
}
|
|
3086
3299
|
` }),
|
|
3087
|
-
/* @__PURE__ */
|
|
3300
|
+
/* @__PURE__ */ jsxs9(
|
|
3088
3301
|
"div",
|
|
3089
3302
|
{
|
|
3090
3303
|
ref: menuRef,
|
|
@@ -3107,7 +3320,7 @@ function SelectBase({
|
|
|
3107
3320
|
visibility: isPlacementResolved ? "visible" : "hidden"
|
|
3108
3321
|
},
|
|
3109
3322
|
children: [
|
|
3110
|
-
hasFilter ? /* @__PURE__ */
|
|
3323
|
+
hasFilter ? /* @__PURE__ */ jsxs9(
|
|
3111
3324
|
"div",
|
|
3112
3325
|
{
|
|
3113
3326
|
className: cx(
|
|
@@ -3115,20 +3328,20 @@ function SelectBase({
|
|
|
3115
3328
|
),
|
|
3116
3329
|
children: [
|
|
3117
3330
|
bulkToggleControl,
|
|
3118
|
-
/* @__PURE__ */
|
|
3331
|
+
/* @__PURE__ */ jsx10(
|
|
3119
3332
|
"div",
|
|
3120
3333
|
{
|
|
3121
3334
|
className: "flex-1",
|
|
3122
3335
|
onClick: (event) => event.stopPropagation(),
|
|
3123
3336
|
onMouseDown: (event) => event.stopPropagation(),
|
|
3124
3337
|
onPointerDown: (event) => event.stopPropagation(),
|
|
3125
|
-
children: /* @__PURE__ */
|
|
3338
|
+
children: /* @__PURE__ */ jsx10(
|
|
3126
3339
|
Input,
|
|
3127
3340
|
{
|
|
3128
3341
|
id: searchInputId,
|
|
3129
3342
|
ref: searchInputRef,
|
|
3130
3343
|
type: "text",
|
|
3131
|
-
icon: /* @__PURE__ */
|
|
3344
|
+
icon: /* @__PURE__ */ jsx10(SearchIcon, { size: 16 }),
|
|
3132
3345
|
disableFloatingLabel: true,
|
|
3133
3346
|
value: currentSearchQuery,
|
|
3134
3347
|
onChange: (event) => {
|
|
@@ -3148,7 +3361,7 @@ function SelectBase({
|
|
|
3148
3361
|
)
|
|
3149
3362
|
]
|
|
3150
3363
|
}
|
|
3151
|
-
) : isMultiSelect ? /* @__PURE__ */
|
|
3364
|
+
) : isMultiSelect ? /* @__PURE__ */ jsx10(
|
|
3152
3365
|
"div",
|
|
3153
3366
|
{
|
|
3154
3367
|
className: cx(
|
|
@@ -3157,8 +3370,8 @@ function SelectBase({
|
|
|
3157
3370
|
children: bulkToggleControl
|
|
3158
3371
|
}
|
|
3159
3372
|
) : null,
|
|
3160
|
-
hasFilter && /* @__PURE__ */
|
|
3161
|
-
/* @__PURE__ */
|
|
3373
|
+
hasFilter && /* @__PURE__ */ jsx10(Separator, {}),
|
|
3374
|
+
/* @__PURE__ */ jsx10(
|
|
3162
3375
|
"div",
|
|
3163
3376
|
{
|
|
3164
3377
|
id: listboxId,
|
|
@@ -3167,7 +3380,7 @@ function SelectBase({
|
|
|
3167
3380
|
"aria-multiselectable": isMultiSelect || void 0,
|
|
3168
3381
|
onScroll: onListboxScroll,
|
|
3169
3382
|
className: "min-h-0 flex-1 overflow-y-auto overflow-x-hidden py-1",
|
|
3170
|
-
children: visibleGroups.length === 0 ? /* @__PURE__ */
|
|
3383
|
+
children: visibleGroups.length === 0 ? /* @__PURE__ */ jsx10("div", { className: "px-3 py-[14px] text-center text-[13px] text-[var(--theme-textLight)]", children: emptyState }) : visibleGroups.map((group) => /* @__PURE__ */ jsxs9(
|
|
3171
3384
|
"div",
|
|
3172
3385
|
{
|
|
3173
3386
|
className: cx(
|
|
@@ -3175,7 +3388,7 @@ function SelectBase({
|
|
|
3175
3388
|
group.label ? "mt-1" : "mt-0"
|
|
3176
3389
|
),
|
|
3177
3390
|
children: [
|
|
3178
|
-
group.label ? /* @__PURE__ */
|
|
3391
|
+
group.label ? /* @__PURE__ */ jsx10(
|
|
3179
3392
|
"span",
|
|
3180
3393
|
{
|
|
3181
3394
|
className: cx(
|
|
@@ -3193,7 +3406,7 @@ function SelectBase({
|
|
|
3193
3406
|
);
|
|
3194
3407
|
const isHighlighted = option.value === highlightedValue;
|
|
3195
3408
|
const isActive = isSelected || isHighlighted;
|
|
3196
|
-
return /* @__PURE__ */
|
|
3409
|
+
return /* @__PURE__ */ jsx10(
|
|
3197
3410
|
"div",
|
|
3198
3411
|
{
|
|
3199
3412
|
role: "option",
|
|
@@ -3223,7 +3436,7 @@ function SelectBase({
|
|
|
3223
3436
|
!option.disabled && isActive ? "text-[var(--theme-text)]" : null,
|
|
3224
3437
|
!option.disabled && !isActive ? "text-[var(--theme-text)]" : null
|
|
3225
3438
|
),
|
|
3226
|
-
children: /* @__PURE__ */
|
|
3439
|
+
children: /* @__PURE__ */ jsxs9(
|
|
3227
3440
|
"div",
|
|
3228
3441
|
{
|
|
3229
3442
|
className: cx(
|
|
@@ -3236,8 +3449,8 @@ function SelectBase({
|
|
|
3236
3449
|
!isSelected && !isHighlighted ? "bg-[var(--theme-surface)] font-medium" : null
|
|
3237
3450
|
),
|
|
3238
3451
|
children: [
|
|
3239
|
-
/* @__PURE__ */
|
|
3240
|
-
isMultiSelect ? /* @__PURE__ */
|
|
3452
|
+
/* @__PURE__ */ jsxs9("span", { className: "flex min-w-0 flex-1 items-center gap-2.5", children: [
|
|
3453
|
+
isMultiSelect ? /* @__PURE__ */ jsx10(
|
|
3241
3454
|
CheckboxIndicator,
|
|
3242
3455
|
{
|
|
3243
3456
|
checked: isSelected,
|
|
@@ -3249,21 +3462,21 @@ function SelectBase({
|
|
|
3249
3462
|
uncheckedBackgroundColor: "transparent"
|
|
3250
3463
|
}
|
|
3251
3464
|
) : null,
|
|
3252
|
-
/* @__PURE__ */
|
|
3465
|
+
/* @__PURE__ */ jsx10("span", { className: "block min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap", children: option.label })
|
|
3253
3466
|
] }),
|
|
3254
|
-
!isMultiSelect && isSelected ? /* @__PURE__ */
|
|
3467
|
+
!isMultiSelect && isSelected ? /* @__PURE__ */ jsx10(
|
|
3255
3468
|
"span",
|
|
3256
3469
|
{
|
|
3257
3470
|
"aria-hidden": "true",
|
|
3258
3471
|
className: "flex shrink-0 items-center justify-center text-[var(--theme-primary)]",
|
|
3259
|
-
children: /* @__PURE__ */
|
|
3472
|
+
children: /* @__PURE__ */ jsx10(
|
|
3260
3473
|
"svg",
|
|
3261
3474
|
{
|
|
3262
3475
|
width: "16",
|
|
3263
3476
|
height: "16",
|
|
3264
3477
|
viewBox: "0 0 20 20",
|
|
3265
3478
|
fill: "none",
|
|
3266
|
-
children: /* @__PURE__ */
|
|
3479
|
+
children: /* @__PURE__ */ jsx10(
|
|
3267
3480
|
"path",
|
|
3268
3481
|
{
|
|
3269
3482
|
d: "M5.75 10.25L8.5 13l5.75-6",
|
|
@@ -3290,9 +3503,9 @@ function SelectBase({
|
|
|
3290
3503
|
))
|
|
3291
3504
|
}
|
|
3292
3505
|
),
|
|
3293
|
-
menuFooter ? /* @__PURE__ */
|
|
3294
|
-
/* @__PURE__ */
|
|
3295
|
-
/* @__PURE__ */
|
|
3506
|
+
menuFooter ? /* @__PURE__ */ jsxs9(Fragment3, { children: [
|
|
3507
|
+
/* @__PURE__ */ jsx10(Separator, {}),
|
|
3508
|
+
/* @__PURE__ */ jsx10("div", { className: "shrink-0 px-2 pb-1 pt-2.5", children: menuFooter })
|
|
3296
3509
|
] }) : null
|
|
3297
3510
|
]
|
|
3298
3511
|
}
|
|
@@ -3376,17 +3589,17 @@ function parseSelectChildren(children) {
|
|
|
3376
3589
|
}
|
|
3377
3590
|
|
|
3378
3591
|
// src/components/Select.tsx
|
|
3379
|
-
import { jsx as
|
|
3592
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
3380
3593
|
function Select({ children, options, ...props }) {
|
|
3381
|
-
const actualChildren = options ? options.map((option) => /* @__PURE__ */
|
|
3382
|
-
return /* @__PURE__ */
|
|
3594
|
+
const actualChildren = options ? options.map((option) => /* @__PURE__ */ jsx11("option", { value: option.value, children: option.label }, option.value)) : children;
|
|
3595
|
+
return /* @__PURE__ */ jsx11(SelectBase, { ...props, groups: parseSelectChildren(actualChildren), nativeOptions: actualChildren });
|
|
3383
3596
|
}
|
|
3384
3597
|
|
|
3385
3598
|
// src/components/SelectAsync.tsx
|
|
3386
3599
|
import { useEffect as useEffect6, useMemo as useMemo4, useRef as useRef4, useState as useState5 } from "react";
|
|
3387
3600
|
|
|
3388
3601
|
// src/componentsBase/select/objectOptionsAdapter.tsx
|
|
3389
|
-
import { jsx as
|
|
3602
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
3390
3603
|
var getOptionKey = (option) => {
|
|
3391
3604
|
return String(option.value);
|
|
3392
3605
|
};
|
|
@@ -3442,13 +3655,13 @@ var buildNativeOptionsFromObjectOptions = (options) => {
|
|
|
3442
3655
|
return options.map((option) => {
|
|
3443
3656
|
const optionValue = getOptionKey(option);
|
|
3444
3657
|
const optionText = getTextContent(option.label).trim() || optionValue;
|
|
3445
|
-
return /* @__PURE__ */
|
|
3658
|
+
return /* @__PURE__ */ jsx12("option", { value: optionValue, disabled: option.disabled, children: optionText }, `native-${optionValue}`);
|
|
3446
3659
|
});
|
|
3447
3660
|
};
|
|
3448
3661
|
var getSelectObjectOptionKey = getOptionKey;
|
|
3449
3662
|
|
|
3450
3663
|
// src/components/SelectAsync.tsx
|
|
3451
|
-
import { jsx as
|
|
3664
|
+
import { jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3452
3665
|
var DEFAULT_LOAD_MORE_THRESHOLD = 24;
|
|
3453
3666
|
var normalizeAsyncValue = (value, isMulti) => {
|
|
3454
3667
|
if (value == null) {
|
|
@@ -3641,15 +3854,15 @@ function SelectAsync({
|
|
|
3641
3854
|
}
|
|
3642
3855
|
onChange == null ? void 0 : onChange(nextValue);
|
|
3643
3856
|
};
|
|
3644
|
-
const menuFooter = isLoadingMore || hasMore ? /* @__PURE__ */
|
|
3857
|
+
const menuFooter = isLoadingMore || hasMore ? /* @__PURE__ */ jsxs10(
|
|
3645
3858
|
"div",
|
|
3646
3859
|
{
|
|
3647
3860
|
"aria-live": "polite",
|
|
3648
3861
|
className: "flex items-center gap-3 text-xs leading-[1.4] text-[var(--theme-textLight)]",
|
|
3649
3862
|
style: { justifyContent: hasMore ? "space-between" : "center" },
|
|
3650
3863
|
children: [
|
|
3651
|
-
/* @__PURE__ */
|
|
3652
|
-
isLoadingMore ? /* @__PURE__ */
|
|
3864
|
+
/* @__PURE__ */ jsx13("span", { children: isLoadingMore ? loadingMoreMessage : hasMore ? loadMoreHintMessage : null }),
|
|
3865
|
+
isLoadingMore ? /* @__PURE__ */ jsx13(
|
|
3653
3866
|
"span",
|
|
3654
3867
|
{
|
|
3655
3868
|
"aria-hidden": "true",
|
|
@@ -3661,7 +3874,7 @@ function SelectAsync({
|
|
|
3661
3874
|
) : null;
|
|
3662
3875
|
const resolvedEmptyMessage = loadError && remoteOptions.length === 0 ? loadError : emptyMessage;
|
|
3663
3876
|
const resolvedValue = selectedOptions.map((option) => getSelectObjectOptionKey(option));
|
|
3664
|
-
return /* @__PURE__ */
|
|
3877
|
+
return /* @__PURE__ */ jsx13(
|
|
3665
3878
|
SelectBase,
|
|
3666
3879
|
{
|
|
3667
3880
|
...props,
|
|
@@ -4079,10 +4292,10 @@ var downloadTableAsPdf = (matrix, fileBaseName, title, page, totalPages) => {
|
|
|
4079
4292
|
};
|
|
4080
4293
|
|
|
4081
4294
|
// src/componentsBase/table/TableBase.tsx
|
|
4082
|
-
import { Fragment as Fragment4, jsx as
|
|
4295
|
+
import { Fragment as Fragment4, jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
4083
4296
|
var OVERFLOW_MENU_WIDTH = 220;
|
|
4084
4297
|
function SettingsIcon() {
|
|
4085
|
-
return /* @__PURE__ */
|
|
4298
|
+
return /* @__PURE__ */ jsxs11(
|
|
4086
4299
|
"svg",
|
|
4087
4300
|
{
|
|
4088
4301
|
width: "16",
|
|
@@ -4091,7 +4304,7 @@ function SettingsIcon() {
|
|
|
4091
4304
|
fill: "none",
|
|
4092
4305
|
"aria-hidden": "true",
|
|
4093
4306
|
children: [
|
|
4094
|
-
/* @__PURE__ */
|
|
4307
|
+
/* @__PURE__ */ jsx14(
|
|
4095
4308
|
"path",
|
|
4096
4309
|
{
|
|
4097
4310
|
d: "M12 15.2a3.2 3.2 0 1 0 0-6.4 3.2 3.2 0 0 0 0 6.4Z",
|
|
@@ -4099,7 +4312,7 @@ function SettingsIcon() {
|
|
|
4099
4312
|
strokeWidth: "2"
|
|
4100
4313
|
}
|
|
4101
4314
|
),
|
|
4102
|
-
/* @__PURE__ */
|
|
4315
|
+
/* @__PURE__ */ jsx14(
|
|
4103
4316
|
"path",
|
|
4104
4317
|
{
|
|
4105
4318
|
d: `
|
|
@@ -4123,7 +4336,7 @@ function SettingsIcon() {
|
|
|
4123
4336
|
);
|
|
4124
4337
|
}
|
|
4125
4338
|
function MoreActionsIcon() {
|
|
4126
|
-
return /* @__PURE__ */
|
|
4339
|
+
return /* @__PURE__ */ jsxs11(
|
|
4127
4340
|
"svg",
|
|
4128
4341
|
{
|
|
4129
4342
|
width: "16",
|
|
@@ -4132,16 +4345,16 @@ function MoreActionsIcon() {
|
|
|
4132
4345
|
fill: "currentColor",
|
|
4133
4346
|
"aria-hidden": "true",
|
|
4134
4347
|
children: [
|
|
4135
|
-
/* @__PURE__ */
|
|
4136
|
-
/* @__PURE__ */
|
|
4137
|
-
/* @__PURE__ */
|
|
4348
|
+
/* @__PURE__ */ jsx14("circle", { cx: "5", cy: "12", r: "1.8" }),
|
|
4349
|
+
/* @__PURE__ */ jsx14("circle", { cx: "12", cy: "12", r: "1.8" }),
|
|
4350
|
+
/* @__PURE__ */ jsx14("circle", { cx: "19", cy: "12", r: "1.8" })
|
|
4138
4351
|
]
|
|
4139
4352
|
}
|
|
4140
4353
|
);
|
|
4141
4354
|
}
|
|
4142
4355
|
function ChevronIcon({ direction }) {
|
|
4143
4356
|
const isLeft = direction === "left";
|
|
4144
|
-
return /* @__PURE__ */
|
|
4357
|
+
return /* @__PURE__ */ jsx14(
|
|
4145
4358
|
"svg",
|
|
4146
4359
|
{
|
|
4147
4360
|
width: "14",
|
|
@@ -4149,7 +4362,7 @@ function ChevronIcon({ direction }) {
|
|
|
4149
4362
|
viewBox: "0 0 24 24",
|
|
4150
4363
|
fill: "none",
|
|
4151
4364
|
"aria-hidden": "true",
|
|
4152
|
-
children: /* @__PURE__ */
|
|
4365
|
+
children: /* @__PURE__ */ jsx14(
|
|
4153
4366
|
"path",
|
|
4154
4367
|
{
|
|
4155
4368
|
d: isLeft ? "M15 6 9 12l6 6" : "m9 6 6 6-6 6",
|
|
@@ -4209,8 +4422,8 @@ function OverflowMenu({ label, children }) {
|
|
|
4209
4422
|
window.removeEventListener("scroll", updateMenuPosition, true);
|
|
4210
4423
|
};
|
|
4211
4424
|
}, [isOpen]);
|
|
4212
|
-
return /* @__PURE__ */
|
|
4213
|
-
/* @__PURE__ */
|
|
4425
|
+
return /* @__PURE__ */ jsxs11("div", { ref: containerRef, className: "relative", children: [
|
|
4426
|
+
/* @__PURE__ */ jsx14(
|
|
4214
4427
|
"button",
|
|
4215
4428
|
{
|
|
4216
4429
|
type: "button",
|
|
@@ -4229,11 +4442,11 @@ function OverflowMenu({ label, children }) {
|
|
|
4229
4442
|
"cursor-pointer border-0 bg-transparent text-[var(--theme-text)]",
|
|
4230
4443
|
"transition-colors hover:text-[var(--theme-primary)]"
|
|
4231
4444
|
].join(" "),
|
|
4232
|
-
children: /* @__PURE__ */
|
|
4445
|
+
children: /* @__PURE__ */ jsx14(MoreActionsIcon, {})
|
|
4233
4446
|
}
|
|
4234
4447
|
),
|
|
4235
4448
|
isOpen && menuPosition && typeof document !== "undefined" ? createPortal2(
|
|
4236
|
-
/* @__PURE__ */
|
|
4449
|
+
/* @__PURE__ */ jsx14(
|
|
4237
4450
|
"div",
|
|
4238
4451
|
{
|
|
4239
4452
|
ref: menuRef,
|
|
@@ -4422,7 +4635,7 @@ function TableBase({
|
|
|
4422
4635
|
const tone = (_a = action.tone) != null ? _a : "default";
|
|
4423
4636
|
const iconOnly = appearance === "inline" && action.icon != null;
|
|
4424
4637
|
const isMenuAction = appearance === "menu";
|
|
4425
|
-
return /* @__PURE__ */
|
|
4638
|
+
return /* @__PURE__ */ jsxs11(
|
|
4426
4639
|
"button",
|
|
4427
4640
|
{
|
|
4428
4641
|
type: "button",
|
|
@@ -4447,7 +4660,7 @@ function TableBase({
|
|
|
4447
4660
|
),
|
|
4448
4661
|
children: [
|
|
4449
4662
|
action.icon,
|
|
4450
|
-
appearance === "menu" || !iconOnly ? /* @__PURE__ */
|
|
4663
|
+
appearance === "menu" || !iconOnly ? /* @__PURE__ */ jsx14("span", { children: action.label }) : null
|
|
4451
4664
|
]
|
|
4452
4665
|
},
|
|
4453
4666
|
(_b = action.id) != null ? _b : `${action.label}-${rowIndex}`
|
|
@@ -4460,7 +4673,7 @@ function TableBase({
|
|
|
4460
4673
|
}
|
|
4461
4674
|
const inlineActions = resolvedActions.slice(0, visibleInlineActions);
|
|
4462
4675
|
const overflowActions = resolvedActions.slice(visibleInlineActions);
|
|
4463
|
-
return /* @__PURE__ */
|
|
4676
|
+
return /* @__PURE__ */ jsxs11(
|
|
4464
4677
|
"div",
|
|
4465
4678
|
{
|
|
4466
4679
|
className: cx(
|
|
@@ -4473,7 +4686,7 @@ function TableBase({
|
|
|
4473
4686
|
inlineActions.map(
|
|
4474
4687
|
(action) => renderActionButton(action, item, rowIndex, "inline")
|
|
4475
4688
|
),
|
|
4476
|
-
overflowActions.length > 0 ? /* @__PURE__ */
|
|
4689
|
+
overflowActions.length > 0 ? /* @__PURE__ */ jsx14(OverflowMenu, { label: resolvedLabels.actionsMenuLabel, children: overflowActions.map(
|
|
4477
4690
|
(action) => renderActionButton(action, item, rowIndex, "menu")
|
|
4478
4691
|
) }) : null
|
|
4479
4692
|
]
|
|
@@ -4484,7 +4697,7 @@ function TableBase({
|
|
|
4484
4697
|
var _a;
|
|
4485
4698
|
const content = resolveColumnContent(column, item, rowIndex);
|
|
4486
4699
|
const align = (_a = column.align) != null ? _a : column.type === "actions" ? "right" : "left";
|
|
4487
|
-
return /* @__PURE__ */
|
|
4700
|
+
return /* @__PURE__ */ jsx14(
|
|
4488
4701
|
"td",
|
|
4489
4702
|
{
|
|
4490
4703
|
colSpan: column.colSpan,
|
|
@@ -4497,14 +4710,14 @@ function TableBase({
|
|
|
4497
4710
|
width: column.width,
|
|
4498
4711
|
minWidth: column.minWidth
|
|
4499
4712
|
},
|
|
4500
|
-
children: hasRenderableContent(content) ? content : /* @__PURE__ */
|
|
4713
|
+
children: hasRenderableContent(content) ? content : /* @__PURE__ */ jsx14("span", { className: "text-[var(--theme-textLight)]", children: "-" })
|
|
4501
4714
|
},
|
|
4502
4715
|
`${getColumnKey(column, columnIndex)}-${rowIndex}`
|
|
4503
4716
|
);
|
|
4504
4717
|
};
|
|
4505
4718
|
const renderEmptyState = () => {
|
|
4506
4719
|
const message = error ? error : loading ? resolvedLabels.loadingMessage : hasSearchValue ? resolvedLabels.noResultsMessage : resolvedLabels.emptyMessage;
|
|
4507
|
-
return /* @__PURE__ */
|
|
4720
|
+
return /* @__PURE__ */ jsxs11(
|
|
4508
4721
|
"div",
|
|
4509
4722
|
{
|
|
4510
4723
|
className: [
|
|
@@ -4513,13 +4726,13 @@ function TableBase({
|
|
|
4513
4726
|
"p-6 text-center text-[var(--theme-text)] shadow-none"
|
|
4514
4727
|
].join(" "),
|
|
4515
4728
|
children: [
|
|
4516
|
-
/* @__PURE__ */
|
|
4517
|
-
error && onRetry ? /* @__PURE__ */
|
|
4729
|
+
/* @__PURE__ */ jsx14("strong", { className: "text-base", children: message }),
|
|
4730
|
+
error && onRetry ? /* @__PURE__ */ jsx14(Button, { variant: "secondary", onClick: onRetry, children: resolvedLabels.retryLabel }) : null
|
|
4518
4731
|
]
|
|
4519
4732
|
}
|
|
4520
4733
|
);
|
|
4521
4734
|
};
|
|
4522
|
-
return /* @__PURE__ */
|
|
4735
|
+
return /* @__PURE__ */ jsxs11(
|
|
4523
4736
|
"div",
|
|
4524
4737
|
{
|
|
4525
4738
|
ref: containerRef,
|
|
@@ -4531,8 +4744,8 @@ function TableBase({
|
|
|
4531
4744
|
),
|
|
4532
4745
|
style,
|
|
4533
4746
|
children: [
|
|
4534
|
-
shouldRenderToolbar ? /* @__PURE__ */
|
|
4535
|
-
shouldRenderToolbarPrimaryGroup ? /* @__PURE__ */
|
|
4747
|
+
shouldRenderToolbar ? /* @__PURE__ */ jsxs11("div", { className: "flex min-w-0 flex-wrap items-center justify-between gap-3", children: [
|
|
4748
|
+
shouldRenderToolbarPrimaryGroup ? /* @__PURE__ */ jsxs11(
|
|
4536
4749
|
"div",
|
|
4537
4750
|
{
|
|
4538
4751
|
className: cx(
|
|
@@ -4545,7 +4758,7 @@ function TableBase({
|
|
|
4545
4758
|
// to the Input would land on the inner <input>, which lives inside a
|
|
4546
4759
|
// flex-column ControlFrame — there flex-basis becomes height and the
|
|
4547
4760
|
// field grows absurdly tall.
|
|
4548
|
-
/* @__PURE__ */
|
|
4761
|
+
/* @__PURE__ */ jsx14("div", { className: "min-w-0 max-w-[360px] flex-[1_1_260px]", children: /* @__PURE__ */ jsx14(
|
|
4549
4762
|
Input,
|
|
4550
4763
|
{
|
|
4551
4764
|
type: "search",
|
|
@@ -4556,7 +4769,7 @@ function TableBase({
|
|
|
4556
4769
|
}
|
|
4557
4770
|
) })
|
|
4558
4771
|
) : null,
|
|
4559
|
-
showSettingsButton && !loading ? /* @__PURE__ */
|
|
4772
|
+
showSettingsButton && !loading ? /* @__PURE__ */ jsx14(
|
|
4560
4773
|
Button,
|
|
4561
4774
|
{
|
|
4562
4775
|
variant: "secondary",
|
|
@@ -4564,13 +4777,13 @@ function TableBase({
|
|
|
4564
4777
|
title: resolvedLabels.settingsButtonLabel,
|
|
4565
4778
|
onClick: () => setIsSettingsModalOpen(true),
|
|
4566
4779
|
className: "shrink-0",
|
|
4567
|
-
children: /* @__PURE__ */
|
|
4780
|
+
children: /* @__PURE__ */ jsx14(SettingsIcon, {})
|
|
4568
4781
|
}
|
|
4569
4782
|
) : null
|
|
4570
4783
|
]
|
|
4571
4784
|
}
|
|
4572
4785
|
) : null,
|
|
4573
|
-
shouldShowToolbarStatus ? /* @__PURE__ */
|
|
4786
|
+
shouldShowToolbarStatus ? /* @__PURE__ */ jsxs11(
|
|
4574
4787
|
"div",
|
|
4575
4788
|
{
|
|
4576
4789
|
className: cx(
|
|
@@ -4578,17 +4791,17 @@ function TableBase({
|
|
|
4578
4791
|
shouldRenderToolbarPrimaryGroup ? "ml-auto" : ""
|
|
4579
4792
|
),
|
|
4580
4793
|
children: [
|
|
4581
|
-
loading ? /* @__PURE__ */
|
|
4582
|
-
!loading && error && hasRows ? /* @__PURE__ */
|
|
4583
|
-
/* @__PURE__ */
|
|
4584
|
-
onRetry ? /* @__PURE__ */
|
|
4794
|
+
loading ? /* @__PURE__ */ jsx14("span", { className: "text-[13px] font-semibold text-[var(--theme-textLight)]", children: resolvedLabels.loadingMessage }) : null,
|
|
4795
|
+
!loading && error && hasRows ? /* @__PURE__ */ jsxs11("div", { className: "inline-flex items-center gap-2.5", children: [
|
|
4796
|
+
/* @__PURE__ */ jsx14("span", { className: "text-[13px] font-semibold text-[var(--theme-negative)]", children: resolvedLabels.errorMessage }),
|
|
4797
|
+
onRetry ? /* @__PURE__ */ jsx14(Button, { variant: "ghost", onClick: onRetry, children: resolvedLabels.retryLabel }) : null
|
|
4585
4798
|
] }) : null
|
|
4586
4799
|
]
|
|
4587
4800
|
}
|
|
4588
4801
|
) : null
|
|
4589
4802
|
] }) : null,
|
|
4590
4803
|
!hasRows && (!loading || error) ? renderEmptyState() : null,
|
|
4591
|
-
hasRows ? isCollapsed ? /* @__PURE__ */
|
|
4804
|
+
hasRows ? isCollapsed ? /* @__PURE__ */ jsx14(
|
|
4592
4805
|
"div",
|
|
4593
4806
|
{
|
|
4594
4807
|
role: "list",
|
|
@@ -4596,7 +4809,7 @@ function TableBase({
|
|
|
4596
4809
|
className: "flex min-w-0 flex-col gap-3.5",
|
|
4597
4810
|
children: items.map((item, rowIndex) => {
|
|
4598
4811
|
const rowActions = renderActions(item, rowIndex);
|
|
4599
|
-
return /* @__PURE__ */
|
|
4812
|
+
return /* @__PURE__ */ jsxs11(
|
|
4600
4813
|
"article",
|
|
4601
4814
|
{
|
|
4602
4815
|
role: "listitem",
|
|
@@ -4607,7 +4820,7 @@ function TableBase({
|
|
|
4607
4820
|
"px-3.5 py-3 shadow-none"
|
|
4608
4821
|
].join(" "),
|
|
4609
4822
|
children: [
|
|
4610
|
-
/* @__PURE__ */
|
|
4823
|
+
/* @__PURE__ */ jsx14(
|
|
4611
4824
|
"div",
|
|
4612
4825
|
{
|
|
4613
4826
|
className: cx(
|
|
@@ -4626,7 +4839,7 @@ function TableBase({
|
|
|
4626
4839
|
1,
|
|
4627
4840
|
Math.min((_b = column.colSpan) != null ? _b : 1, mobileGridColumnCount)
|
|
4628
4841
|
);
|
|
4629
|
-
return /* @__PURE__ */
|
|
4842
|
+
return /* @__PURE__ */ jsxs11(
|
|
4630
4843
|
"div",
|
|
4631
4844
|
{
|
|
4632
4845
|
className: cx(
|
|
@@ -4634,7 +4847,7 @@ function TableBase({
|
|
|
4634
4847
|
span === 2 ? "col-span-2" : "col-span-1"
|
|
4635
4848
|
),
|
|
4636
4849
|
children: [
|
|
4637
|
-
!column.hideLabel && column.label ? /* @__PURE__ */
|
|
4850
|
+
!column.hideLabel && column.label ? /* @__PURE__ */ jsx14(
|
|
4638
4851
|
"span",
|
|
4639
4852
|
{
|
|
4640
4853
|
className: [
|
|
@@ -4646,14 +4859,14 @@ function TableBase({
|
|
|
4646
4859
|
children: column.label
|
|
4647
4860
|
}
|
|
4648
4861
|
) : null,
|
|
4649
|
-
/* @__PURE__ */
|
|
4862
|
+
/* @__PURE__ */ jsx14(
|
|
4650
4863
|
"div",
|
|
4651
4864
|
{
|
|
4652
4865
|
className: cx(
|
|
4653
4866
|
"min-w-0 max-w-full",
|
|
4654
4867
|
mobileGridColumnCount === 2 ? "" : "flex-1"
|
|
4655
4868
|
),
|
|
4656
|
-
children: /* @__PURE__ */
|
|
4869
|
+
children: /* @__PURE__ */ jsx14(
|
|
4657
4870
|
"div",
|
|
4658
4871
|
{
|
|
4659
4872
|
className: cx(
|
|
@@ -4661,7 +4874,7 @@ function TableBase({
|
|
|
4661
4874
|
"text-[var(--theme-text)] [overflow-wrap:anywhere]",
|
|
4662
4875
|
getAlignClassName(align)
|
|
4663
4876
|
),
|
|
4664
|
-
children: hasRenderableContent(content) ? content : /* @__PURE__ */
|
|
4877
|
+
children: hasRenderableContent(content) ? content : /* @__PURE__ */ jsx14("span", { className: "text-[var(--theme-textLight)]", children: "-" })
|
|
4665
4878
|
}
|
|
4666
4879
|
)
|
|
4667
4880
|
}
|
|
@@ -4673,15 +4886,15 @@ function TableBase({
|
|
|
4673
4886
|
})
|
|
4674
4887
|
}
|
|
4675
4888
|
),
|
|
4676
|
-
rowActions ? /* @__PURE__ */
|
|
4889
|
+
rowActions ? /* @__PURE__ */ jsx14("div", { className: "flex justify-end pt-1", children: rowActions }) : null
|
|
4677
4890
|
]
|
|
4678
4891
|
},
|
|
4679
4892
|
getRowId(item, rowIndex, getCustomRowId)
|
|
4680
4893
|
);
|
|
4681
4894
|
})
|
|
4682
4895
|
}
|
|
4683
|
-
) : /* @__PURE__ */
|
|
4684
|
-
/* @__PURE__ */
|
|
4896
|
+
) : /* @__PURE__ */ jsxs11(Fragment4, { children: [
|
|
4897
|
+
/* @__PURE__ */ jsx14("style", { children: `
|
|
4685
4898
|
#${scrollRegionId} {
|
|
4686
4899
|
scrollbar-width: thin;
|
|
4687
4900
|
scrollbar-color: var(--theme-secondary) transparent;
|
|
@@ -4708,7 +4921,7 @@ function TableBase({
|
|
|
4708
4921
|
background-clip: padding-box;
|
|
4709
4922
|
}
|
|
4710
4923
|
` }),
|
|
4711
|
-
/* @__PURE__ */
|
|
4924
|
+
/* @__PURE__ */ jsx14(
|
|
4712
4925
|
"div",
|
|
4713
4926
|
{
|
|
4714
4927
|
id: scrollRegionId,
|
|
@@ -4719,12 +4932,12 @@ function TableBase({
|
|
|
4719
4932
|
"rounded-[20px] border-2 border-solid border-[var(--theme-background)]",
|
|
4720
4933
|
"bg-[var(--theme-surface)] shadow-none"
|
|
4721
4934
|
),
|
|
4722
|
-
children: /* @__PURE__ */
|
|
4723
|
-
/* @__PURE__ */
|
|
4935
|
+
children: /* @__PURE__ */ jsxs11("table", { className: "w-max min-w-full max-w-none border-separate border-spacing-0", children: [
|
|
4936
|
+
/* @__PURE__ */ jsx14("thead", { children: /* @__PURE__ */ jsxs11("tr", { children: [
|
|
4724
4937
|
desktopColumns.map((column, columnIndex) => {
|
|
4725
4938
|
var _a, _b;
|
|
4726
4939
|
const align = (_a = column.align) != null ? _a : column.type === "actions" ? "right" : "left";
|
|
4727
|
-
return /* @__PURE__ */
|
|
4940
|
+
return /* @__PURE__ */ jsx14(
|
|
4728
4941
|
"th",
|
|
4729
4942
|
{
|
|
4730
4943
|
colSpan: (_b = column.headerColSpan) != null ? _b : column.colSpan,
|
|
@@ -4744,7 +4957,7 @@ function TableBase({
|
|
|
4744
4957
|
getColumnKey(column, columnIndex)
|
|
4745
4958
|
);
|
|
4746
4959
|
}),
|
|
4747
|
-
actions ? /* @__PURE__ */
|
|
4960
|
+
actions ? /* @__PURE__ */ jsx14(
|
|
4748
4961
|
"th",
|
|
4749
4962
|
{
|
|
4750
4963
|
scope: "col",
|
|
@@ -4765,11 +4978,11 @@ function TableBase({
|
|
|
4765
4978
|
}
|
|
4766
4979
|
) : null
|
|
4767
4980
|
] }) }),
|
|
4768
|
-
/* @__PURE__ */
|
|
4981
|
+
/* @__PURE__ */ jsx14("tbody", { children: items.map((item, rowIndex) => {
|
|
4769
4982
|
const rowActions = renderActions(item, rowIndex);
|
|
4770
4983
|
const isAlternateRow = rowIndex % 2 !== 0;
|
|
4771
4984
|
const stickyRowBackgroundImage = rowIndex % 2 === 0 ? void 0 : "linear-gradient(var(--theme-background), var(--theme-background))";
|
|
4772
|
-
return /* @__PURE__ */
|
|
4985
|
+
return /* @__PURE__ */ jsxs11(
|
|
4773
4986
|
"tr",
|
|
4774
4987
|
{
|
|
4775
4988
|
className: isAlternateRow ? "bg-[var(--theme-background)]" : "bg-[var(--theme-surface)]",
|
|
@@ -4782,7 +4995,7 @@ function TableBase({
|
|
|
4782
4995
|
columnIndex
|
|
4783
4996
|
);
|
|
4784
4997
|
}),
|
|
4785
|
-
actions ? /* @__PURE__ */
|
|
4998
|
+
actions ? /* @__PURE__ */ jsx14(
|
|
4786
4999
|
"td",
|
|
4787
5000
|
{
|
|
4788
5001
|
className: cx(
|
|
@@ -4808,9 +5021,9 @@ function TableBase({
|
|
|
4808
5021
|
}
|
|
4809
5022
|
)
|
|
4810
5023
|
] }) : null,
|
|
4811
|
-
hasRows && shouldRenderFooter ? /* @__PURE__ */
|
|
4812
|
-
shouldShowPaginationControls ? /* @__PURE__ */
|
|
4813
|
-
/* @__PURE__ */
|
|
5024
|
+
hasRows && shouldRenderFooter ? /* @__PURE__ */ jsxs11("div", { className: "-mt-2 flex flex-wrap items-center justify-between gap-3", children: [
|
|
5025
|
+
shouldShowPaginationControls ? /* @__PURE__ */ jsxs11("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
5026
|
+
/* @__PURE__ */ jsx14(
|
|
4814
5027
|
Button,
|
|
4815
5028
|
{
|
|
4816
5029
|
variant: "secondary",
|
|
@@ -4821,7 +5034,7 @@ function TableBase({
|
|
|
4821
5034
|
children: 1
|
|
4822
5035
|
}
|
|
4823
5036
|
),
|
|
4824
|
-
/* @__PURE__ */
|
|
5037
|
+
/* @__PURE__ */ jsx14(
|
|
4825
5038
|
Button,
|
|
4826
5039
|
{
|
|
4827
5040
|
variant: "secondary",
|
|
@@ -4829,10 +5042,10 @@ function TableBase({
|
|
|
4829
5042
|
disabled: !canGoToPreviousPage,
|
|
4830
5043
|
"aria-label": resolvedLabels.previousPageLabel,
|
|
4831
5044
|
style: paginationButtonStyle,
|
|
4832
|
-
children: /* @__PURE__ */
|
|
5045
|
+
children: /* @__PURE__ */ jsx14(ChevronIcon, { direction: "left" })
|
|
4833
5046
|
}
|
|
4834
5047
|
),
|
|
4835
|
-
/* @__PURE__ */
|
|
5048
|
+
/* @__PURE__ */ jsx14(
|
|
4836
5049
|
Button,
|
|
4837
5050
|
{
|
|
4838
5051
|
variant: "secondary",
|
|
@@ -4842,7 +5055,7 @@ function TableBase({
|
|
|
4842
5055
|
children: normalizedPage
|
|
4843
5056
|
}
|
|
4844
5057
|
),
|
|
4845
|
-
/* @__PURE__ */
|
|
5058
|
+
/* @__PURE__ */ jsx14(
|
|
4846
5059
|
Button,
|
|
4847
5060
|
{
|
|
4848
5061
|
variant: "secondary",
|
|
@@ -4850,10 +5063,10 @@ function TableBase({
|
|
|
4850
5063
|
disabled: !canGoToNextPage,
|
|
4851
5064
|
"aria-label": resolvedLabels.nextPageLabel,
|
|
4852
5065
|
style: paginationButtonStyle,
|
|
4853
|
-
children: /* @__PURE__ */
|
|
5066
|
+
children: /* @__PURE__ */ jsx14(ChevronIcon, { direction: "right" })
|
|
4854
5067
|
}
|
|
4855
5068
|
),
|
|
4856
|
-
/* @__PURE__ */
|
|
5069
|
+
/* @__PURE__ */ jsx14(
|
|
4857
5070
|
Button,
|
|
4858
5071
|
{
|
|
4859
5072
|
variant: "secondary",
|
|
@@ -4865,16 +5078,16 @@ function TableBase({
|
|
|
4865
5078
|
}
|
|
4866
5079
|
)
|
|
4867
5080
|
] }) : null,
|
|
4868
|
-
/* @__PURE__ */
|
|
5081
|
+
/* @__PURE__ */ jsx14(
|
|
4869
5082
|
"div",
|
|
4870
5083
|
{
|
|
4871
5084
|
className: cx(
|
|
4872
5085
|
"flex items-center gap-2.5 text-[13px] text-[var(--theme-textLight)]",
|
|
4873
5086
|
shouldShowRowsPerPageControl ? "ml-auto" : ""
|
|
4874
5087
|
),
|
|
4875
|
-
children: shouldShowRowsPerPageControl ? /* @__PURE__ */
|
|
4876
|
-
resolvedLabels.rowsPerPageLabel ? /* @__PURE__ */
|
|
4877
|
-
/* @__PURE__ */
|
|
5088
|
+
children: shouldShowRowsPerPageControl ? /* @__PURE__ */ jsxs11(Fragment4, { children: [
|
|
5089
|
+
resolvedLabels.rowsPerPageLabel ? /* @__PURE__ */ jsx14("span", { children: resolvedLabels.rowsPerPageLabel }) : null,
|
|
5090
|
+
/* @__PURE__ */ jsx14("div", { className: "w-[72px]", children: /* @__PURE__ */ jsx14(
|
|
4878
5091
|
Select,
|
|
4879
5092
|
{
|
|
4880
5093
|
value: String(pageSize),
|
|
@@ -4893,7 +5106,7 @@ function TableBase({
|
|
|
4893
5106
|
}
|
|
4894
5107
|
)
|
|
4895
5108
|
] }) : null,
|
|
4896
|
-
/* @__PURE__ */
|
|
5109
|
+
/* @__PURE__ */ jsxs11(
|
|
4897
5110
|
Modal,
|
|
4898
5111
|
{
|
|
4899
5112
|
isOpen: isSettingsModalOpen,
|
|
@@ -4910,9 +5123,9 @@ function TableBase({
|
|
|
4910
5123
|
paddingTop: 8
|
|
4911
5124
|
},
|
|
4912
5125
|
children: [
|
|
4913
|
-
/* @__PURE__ */
|
|
4914
|
-
/* @__PURE__ */
|
|
4915
|
-
/* @__PURE__ */
|
|
5126
|
+
/* @__PURE__ */ jsxs11("section", { className: "grid gap-3", children: [
|
|
5127
|
+
/* @__PURE__ */ jsx14("strong", { className: "text-sm text-[var(--theme-text)]", children: resolvedLabels.tableInfoSectionTitle }),
|
|
5128
|
+
/* @__PURE__ */ jsxs11(
|
|
4916
5129
|
"div",
|
|
4917
5130
|
{
|
|
4918
5131
|
className: cx(
|
|
@@ -4920,31 +5133,31 @@ function TableBase({
|
|
|
4920
5133
|
"border-2 border-[var(--theme-background)] bg-[var(--theme-surface)]"
|
|
4921
5134
|
),
|
|
4922
5135
|
children: [
|
|
4923
|
-
/* @__PURE__ */
|
|
4924
|
-
/* @__PURE__ */
|
|
4925
|
-
/* @__PURE__ */
|
|
5136
|
+
/* @__PURE__ */ jsxs11("div", { className: "grid gap-1", children: [
|
|
5137
|
+
/* @__PURE__ */ jsx14("span", { className: "text-xs text-[var(--theme-textLight)]", children: resolvedLabels.totalItemsInfoLabel }),
|
|
5138
|
+
/* @__PURE__ */ jsx14("strong", { className: "font-medium text-[var(--theme-text)]", children: totalItemCount })
|
|
4926
5139
|
] }),
|
|
4927
|
-
/* @__PURE__ */
|
|
4928
|
-
/* @__PURE__ */
|
|
4929
|
-
/* @__PURE__ */
|
|
5140
|
+
/* @__PURE__ */ jsxs11("div", { className: "grid gap-1", children: [
|
|
5141
|
+
/* @__PURE__ */ jsx14("span", { className: "text-xs text-[var(--theme-textLight)]", children: resolvedLabels.totalPagesInfoLabel }),
|
|
5142
|
+
/* @__PURE__ */ jsx14("strong", { className: "font-medium text-[var(--theme-text)]", children: totalPages })
|
|
4930
5143
|
] }),
|
|
4931
|
-
/* @__PURE__ */
|
|
4932
|
-
/* @__PURE__ */
|
|
4933
|
-
/* @__PURE__ */
|
|
5144
|
+
/* @__PURE__ */ jsxs11("div", { className: "grid gap-1", children: [
|
|
5145
|
+
/* @__PURE__ */ jsx14("span", { className: "text-xs text-[var(--theme-textLight)]", children: resolvedLabels.currentPageItemsInfoLabel }),
|
|
5146
|
+
/* @__PURE__ */ jsx14("strong", { className: "font-medium text-[var(--theme-text)]", children: currentPageItemCount })
|
|
4934
5147
|
] }),
|
|
4935
|
-
/* @__PURE__ */
|
|
4936
|
-
/* @__PURE__ */
|
|
4937
|
-
/* @__PURE__ */
|
|
5148
|
+
/* @__PURE__ */ jsxs11("div", { className: "grid gap-1", children: [
|
|
5149
|
+
/* @__PURE__ */ jsx14("span", { className: "text-xs text-[var(--theme-textLight)]", children: resolvedLabels.currentPageInfoLabel }),
|
|
5150
|
+
/* @__PURE__ */ jsx14("strong", { className: "font-medium text-[var(--theme-text)]", children: normalizedPage })
|
|
4938
5151
|
] })
|
|
4939
5152
|
]
|
|
4940
5153
|
}
|
|
4941
5154
|
)
|
|
4942
5155
|
] }),
|
|
4943
|
-
/* @__PURE__ */
|
|
4944
|
-
/* @__PURE__ */
|
|
4945
|
-
/* @__PURE__ */
|
|
4946
|
-
/* @__PURE__ */
|
|
4947
|
-
/* @__PURE__ */
|
|
5156
|
+
/* @__PURE__ */ jsx14("div", { className: "py-[18px]", children: /* @__PURE__ */ jsx14(Separator, {}) }),
|
|
5157
|
+
/* @__PURE__ */ jsxs11("section", { className: "grid gap-3", children: [
|
|
5158
|
+
/* @__PURE__ */ jsx14("strong", { className: "text-sm text-[var(--theme-text)]", children: resolvedLabels.downloadSectionTitle }),
|
|
5159
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex flex-wrap gap-2.5", children: [
|
|
5160
|
+
/* @__PURE__ */ jsx14(
|
|
4948
5161
|
Button,
|
|
4949
5162
|
{
|
|
4950
5163
|
variant: "secondary",
|
|
@@ -4953,7 +5166,7 @@ function TableBase({
|
|
|
4953
5166
|
children: resolvedLabels.downloadCsvLabel
|
|
4954
5167
|
}
|
|
4955
5168
|
),
|
|
4956
|
-
/* @__PURE__ */
|
|
5169
|
+
/* @__PURE__ */ jsx14(
|
|
4957
5170
|
Button,
|
|
4958
5171
|
{
|
|
4959
5172
|
variant: "secondary",
|
|
@@ -4962,7 +5175,7 @@ function TableBase({
|
|
|
4962
5175
|
children: resolvedLabels.downloadXlsLabel
|
|
4963
5176
|
}
|
|
4964
5177
|
),
|
|
4965
|
-
/* @__PURE__ */
|
|
5178
|
+
/* @__PURE__ */ jsx14(
|
|
4966
5179
|
Button,
|
|
4967
5180
|
{
|
|
4968
5181
|
variant: "secondary",
|
|
@@ -4982,7 +5195,7 @@ function TableBase({
|
|
|
4982
5195
|
}
|
|
4983
5196
|
|
|
4984
5197
|
// src/components/Table.tsx
|
|
4985
|
-
import { jsx as
|
|
5198
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
4986
5199
|
function Table({
|
|
4987
5200
|
items,
|
|
4988
5201
|
desktopColumns,
|
|
@@ -5041,7 +5254,7 @@ function Table({
|
|
|
5041
5254
|
const startIndex = (normalizedPage - 1) * pageSize;
|
|
5042
5255
|
return filteredItems.slice(startIndex, startIndex + pageSize);
|
|
5043
5256
|
}, [filteredItems, normalizedPage, pageSize]);
|
|
5044
|
-
return /* @__PURE__ */
|
|
5257
|
+
return /* @__PURE__ */ jsx15(
|
|
5045
5258
|
TableBase,
|
|
5046
5259
|
{
|
|
5047
5260
|
...props,
|
|
@@ -5078,7 +5291,7 @@ function Table({
|
|
|
5078
5291
|
|
|
5079
5292
|
// src/components/TableAsync.tsx
|
|
5080
5293
|
import { useEffect as useEffect9, useMemo as useMemo6, useRef as useRef6, useState as useState8 } from "react";
|
|
5081
|
-
import { jsx as
|
|
5294
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
5082
5295
|
var areUnknownArraysEqual2 = (left, right) => {
|
|
5083
5296
|
if (left.length !== right.length) {
|
|
5084
5297
|
return false;
|
|
@@ -5197,7 +5410,7 @@ function TableAsync({
|
|
|
5197
5410
|
setPage(normalizedPage);
|
|
5198
5411
|
onPageChange == null ? void 0 : onPageChange(normalizedPage);
|
|
5199
5412
|
}, [normalizedPage, onPageChange, page]);
|
|
5200
|
-
return /* @__PURE__ */
|
|
5413
|
+
return /* @__PURE__ */ jsx16(
|
|
5201
5414
|
TableBase,
|
|
5202
5415
|
{
|
|
5203
5416
|
...props,
|
|
@@ -5236,7 +5449,7 @@ function TableAsync({
|
|
|
5236
5449
|
}
|
|
5237
5450
|
|
|
5238
5451
|
// src/components/Textarea.tsx
|
|
5239
|
-
import { jsx as
|
|
5452
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
5240
5453
|
function Textarea({
|
|
5241
5454
|
label,
|
|
5242
5455
|
hint,
|
|
@@ -5253,7 +5466,7 @@ function Textarea({
|
|
|
5253
5466
|
const resolvedPlaceholder = placeholder != null ? placeholder : " ";
|
|
5254
5467
|
const placeholderClass = floatingPlaceholder ? "placeholder-transparent" : "placeholder-[var(--theme-textLight)]";
|
|
5255
5468
|
const isPopulated = rest.value !== void 0 && rest.value !== "" && rest.value !== null;
|
|
5256
|
-
const textarea = /* @__PURE__ */
|
|
5469
|
+
const textarea = /* @__PURE__ */ jsx17(
|
|
5257
5470
|
"textarea",
|
|
5258
5471
|
{
|
|
5259
5472
|
...rest,
|
|
@@ -5278,7 +5491,7 @@ function Textarea({
|
|
|
5278
5491
|
}
|
|
5279
5492
|
}
|
|
5280
5493
|
);
|
|
5281
|
-
return /* @__PURE__ */
|
|
5494
|
+
return /* @__PURE__ */ jsx17(
|
|
5282
5495
|
ControlFrame,
|
|
5283
5496
|
{
|
|
5284
5497
|
label,
|
|
@@ -5305,6 +5518,7 @@ export {
|
|
|
5305
5518
|
ComposableModal,
|
|
5306
5519
|
DatePicker,
|
|
5307
5520
|
Input,
|
|
5521
|
+
Loading,
|
|
5308
5522
|
Modal,
|
|
5309
5523
|
Select,
|
|
5310
5524
|
SelectAsync,
|