@assure-one/design-system 1.37.0 → 1.38.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/README.md +45 -16
- package/codemods/README.md +40 -0
- package/codemods/lib/registry.mjs +1 -0
- package/codemods/transforms/cm-18-data-table-parts.mjs +234 -0
- package/dist/css/components.css +1 -1
- package/dist/css/legacy-aliases.css +8 -0
- package/dist/css/tokens.css +8 -0
- package/dist/{design-system-provider-C8UlFe52.d.ts → design-system-provider-B5MbvbRc.d.ts} +61 -1
- package/dist/index.d.ts +1358 -206
- package/dist/index.js +2201 -607
- package/dist/index.js.map +1 -1
- package/dist/next/index.d.ts +1 -1
- package/dist/styles.css +1 -1
- package/docs/components.md +36 -8
- package/docs/components.registry.json +2399 -463
- package/docs/for-ai-agents.md +2 -0
- package/eslint-config/index.mjs +210 -0
- package/eslint-config/stylelint-rules.mjs +54 -0
- package/eslint-config/stylelint.mjs +73 -0
- package/package.json +8 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import * as
|
|
3
|
-
import { createContext, forwardRef, useMemo, useId, useRef, useState, useEffect, useCallback, useImperativeHandle, Fragment as Fragment$1,
|
|
2
|
+
import * as React45 from 'react';
|
|
3
|
+
import { createContext, forwardRef, useMemo, useId, useRef, useState, useEffect, useCallback, useImperativeHandle, Children, isValidElement, cloneElement, useContext, Fragment as Fragment$1, useSyncExternalStore, useLayoutEffect } from 'react';
|
|
4
4
|
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
5
5
|
import { clsx } from 'clsx';
|
|
6
6
|
import { extendTailwindMerge } from 'tailwind-merge';
|
|
@@ -2278,7 +2278,7 @@ function ZoomOutIcon({ size = 24, ...props }) {
|
|
|
2278
2278
|
)
|
|
2279
2279
|
] });
|
|
2280
2280
|
}
|
|
2281
|
-
var Accordion =
|
|
2281
|
+
var Accordion = React45.forwardRef(function Accordion2({ className, ...props }, ref) {
|
|
2282
2282
|
return /* @__PURE__ */ jsx(
|
|
2283
2283
|
AccordionPrimitive.Root,
|
|
2284
2284
|
{
|
|
@@ -2289,11 +2289,11 @@ var Accordion = React44.forwardRef(function Accordion2({ className, ...props },
|
|
|
2289
2289
|
);
|
|
2290
2290
|
});
|
|
2291
2291
|
Accordion.displayName = AccordionPrimitive.Root.displayName;
|
|
2292
|
-
var AccordionItem =
|
|
2292
|
+
var AccordionItem = React45.forwardRef(function AccordionItem2({ className, ...props }, ref) {
|
|
2293
2293
|
return /* @__PURE__ */ jsx(AccordionPrimitive.Item, { ref, className: cn(className), ...props });
|
|
2294
2294
|
});
|
|
2295
2295
|
AccordionItem.displayName = AccordionPrimitive.Item.displayName;
|
|
2296
|
-
var AccordionTrigger =
|
|
2296
|
+
var AccordionTrigger = React45.forwardRef(function AccordionTrigger2({ children, className, ...props }, ref) {
|
|
2297
2297
|
return /* @__PURE__ */ jsx(AccordionPrimitive.Header, { className: "ds:flex", children: /* @__PURE__ */ jsxs(
|
|
2298
2298
|
AccordionPrimitive.Trigger,
|
|
2299
2299
|
{
|
|
@@ -2322,7 +2322,7 @@ var AccordionTrigger = React44.forwardRef(function AccordionTrigger2({ children,
|
|
|
2322
2322
|
) });
|
|
2323
2323
|
});
|
|
2324
2324
|
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
|
|
2325
|
-
var AccordionContent =
|
|
2325
|
+
var AccordionContent = React45.forwardRef(function AccordionContent2({ children, className, ...props }, ref) {
|
|
2326
2326
|
return /* @__PURE__ */ jsx(
|
|
2327
2327
|
AccordionPrimitive.Content,
|
|
2328
2328
|
{
|
|
@@ -2553,7 +2553,9 @@ var tableAnatomy = defineAnatomy("table", [
|
|
|
2553
2553
|
"row",
|
|
2554
2554
|
"head",
|
|
2555
2555
|
"cell",
|
|
2556
|
-
"caption"
|
|
2556
|
+
"caption",
|
|
2557
|
+
"sort",
|
|
2558
|
+
"sort-indicator"
|
|
2557
2559
|
]);
|
|
2558
2560
|
var dataTableAnatomy = defineAnatomy("data-table", [
|
|
2559
2561
|
"root",
|
|
@@ -2567,11 +2569,18 @@ var dataTableAnatomy = defineAnatomy("data-table", [
|
|
|
2567
2569
|
"head-button",
|
|
2568
2570
|
"head-indicator",
|
|
2569
2571
|
"cell",
|
|
2570
|
-
"checkbox-cell"
|
|
2572
|
+
"checkbox-cell",
|
|
2573
|
+
"search",
|
|
2574
|
+
"filters",
|
|
2575
|
+
"columns-menu",
|
|
2576
|
+
"content",
|
|
2577
|
+
"bulk-actions",
|
|
2578
|
+
"pagination"
|
|
2571
2579
|
]);
|
|
2572
2580
|
var paginationAnatomy = defineAnatomy("pagination", [
|
|
2573
2581
|
"root",
|
|
2574
2582
|
"label",
|
|
2583
|
+
"page-size",
|
|
2575
2584
|
"pages",
|
|
2576
2585
|
"previous",
|
|
2577
2586
|
"next",
|
|
@@ -2971,7 +2980,8 @@ var EN_MESSAGES = {
|
|
|
2971
2980
|
range: (start, end, total) => `${start}\u2013${end} of ${total}`,
|
|
2972
2981
|
page: (page, total) => `Page ${page} of ${total}`,
|
|
2973
2982
|
previous: "Previous page",
|
|
2974
|
-
next: "Next page"
|
|
2983
|
+
next: "Next page",
|
|
2984
|
+
rowsPerPage: "Rows per page"
|
|
2975
2985
|
},
|
|
2976
2986
|
copyButton: { copy: "Copy to clipboard", copied: "Copied" },
|
|
2977
2987
|
loadingRows: { loading: "Loading" },
|
|
@@ -2984,6 +2994,10 @@ var EN_MESSAGES = {
|
|
|
2984
2994
|
unknownUser: "Unknown user",
|
|
2985
2995
|
status: (status) => `${status} status`
|
|
2986
2996
|
},
|
|
2997
|
+
avatarGroup: {
|
|
2998
|
+
overflow: (count) => `+${count}`,
|
|
2999
|
+
overflowLabel: (count) => `${count} more`
|
|
3000
|
+
},
|
|
2987
3001
|
otpInput: { name: "One-time password" },
|
|
2988
3002
|
datePicker: {
|
|
2989
3003
|
openCalendar: "Open calendar",
|
|
@@ -3038,7 +3052,8 @@ var EN_MESSAGES = {
|
|
|
3038
3052
|
pin: "Pin sidebar",
|
|
3039
3053
|
unpin: "Unpin sidebar",
|
|
3040
3054
|
collapseSection: "Collapse section",
|
|
3041
|
-
expandSection: "Expand section"
|
|
3055
|
+
expandSection: "Expand section",
|
|
3056
|
+
navigation: "Navigation"
|
|
3042
3057
|
},
|
|
3043
3058
|
shell: { content: "Page content" },
|
|
3044
3059
|
bottomNav: { region: "Primary" },
|
|
@@ -3049,7 +3064,24 @@ var EN_MESSAGES = {
|
|
|
3049
3064
|
},
|
|
3050
3065
|
appHeader: { search: "Search\u2026" },
|
|
3051
3066
|
bulkActionBar: { clearSelection: "Clear selection" },
|
|
3052
|
-
|
|
3067
|
+
errorState: {
|
|
3068
|
+
title: "Something went wrong",
|
|
3069
|
+
retry: "Try again",
|
|
3070
|
+
showDetails: "Show details",
|
|
3071
|
+
hideDetails: "Hide details"
|
|
3072
|
+
},
|
|
3073
|
+
dataTable: {
|
|
3074
|
+
search: "Search\u2026",
|
|
3075
|
+
of: "of",
|
|
3076
|
+
searchLabel: "Search",
|
|
3077
|
+
columns: "Columns",
|
|
3078
|
+
filterAll: "All",
|
|
3079
|
+
selectAll: "Select all rows",
|
|
3080
|
+
selectRow: "Select row"
|
|
3081
|
+
},
|
|
3082
|
+
tableStates: { loading: "Loading", empty: "No results" },
|
|
3083
|
+
table: { region: "Scrollable table" },
|
|
3084
|
+
peoplePicker: { assignToMe: "Assign to me" }
|
|
3053
3085
|
};
|
|
3054
3086
|
|
|
3055
3087
|
// src/primitives/behavior/overlay/recipes.ts
|
|
@@ -3186,9 +3218,9 @@ function presence(motion2) {
|
|
|
3186
3218
|
return { [PRESENCE_ATTRIBUTE]: motion2 };
|
|
3187
3219
|
}
|
|
3188
3220
|
function useExitPresence(ref, open, onExited) {
|
|
3189
|
-
const onExitedRef =
|
|
3221
|
+
const onExitedRef = React45.useRef(onExited);
|
|
3190
3222
|
onExitedRef.current = onExited;
|
|
3191
|
-
|
|
3223
|
+
React45.useLayoutEffect(() => {
|
|
3192
3224
|
if (open) return void 0;
|
|
3193
3225
|
const node = ref.current;
|
|
3194
3226
|
const running = node && typeof node.getAnimations === "function" ? node.getAnimations().filter((animation) => animation.playState !== "finished") : [];
|
|
@@ -3366,7 +3398,7 @@ var ModalDescription = DialogPrimitive2.Description;
|
|
|
3366
3398
|
var AlertDialog = AlertDialogPrimitive.Root;
|
|
3367
3399
|
var AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
3368
3400
|
var AlertDialogPortal = withPortalContainer(AlertDialogPrimitive.Portal);
|
|
3369
|
-
var AlertDialogOverlay =
|
|
3401
|
+
var AlertDialogOverlay = React45.forwardRef((props, ref) => /* @__PURE__ */ jsx(
|
|
3370
3402
|
Backdrop,
|
|
3371
3403
|
{
|
|
3372
3404
|
as: AlertDialogPrimitive.Overlay,
|
|
@@ -3377,7 +3409,7 @@ var AlertDialogOverlay = React44.forwardRef((props, ref) => /* @__PURE__ */ jsx(
|
|
|
3377
3409
|
}
|
|
3378
3410
|
));
|
|
3379
3411
|
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
3380
|
-
var AlertDialogContent =
|
|
3412
|
+
var AlertDialogContent = React45.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [
|
|
3381
3413
|
/* @__PURE__ */ jsx(AlertDialogOverlay, {}),
|
|
3382
3414
|
/* @__PURE__ */ jsx(
|
|
3383
3415
|
OverlaySurface,
|
|
@@ -3398,9 +3430,9 @@ var AlertDialogHeader = (props) => /* @__PURE__ */ jsx(OverlayHeader, { anatomy:
|
|
|
3398
3430
|
AlertDialogHeader.displayName = "AlertDialogHeader";
|
|
3399
3431
|
var AlertDialogFooter = (props) => /* @__PURE__ */ jsx(OverlayFooter, { anatomy: alertDialogAnatomy, layout: "inset", ...props });
|
|
3400
3432
|
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
3401
|
-
var AlertDialogTitle =
|
|
3433
|
+
var AlertDialogTitle = React45.forwardRef((props, ref) => /* @__PURE__ */ jsx(OverlayTitle, { as: AlertDialogPrimitive.Title, anatomy: alertDialogAnatomy, ref, ...props }));
|
|
3402
3434
|
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
3403
|
-
var AlertDialogDescription =
|
|
3435
|
+
var AlertDialogDescription = React45.forwardRef((props, ref) => /* @__PURE__ */ jsx(
|
|
3404
3436
|
OverlayDescription,
|
|
3405
3437
|
{
|
|
3406
3438
|
as: AlertDialogPrimitive.Description,
|
|
@@ -3419,7 +3451,7 @@ var LEGACY_ACTION_CLASSES = cn(
|
|
|
3419
3451
|
"ds:focus-visible:[box-shadow:var(--shadow-focus-ring)] ds:focus-visible:outline-none",
|
|
3420
3452
|
"ds:disabled:bg-bg-disabled ds:disabled:text-fg-disabled ds:disabled:pointer-events-none ds:disabled:cursor-not-allowed"
|
|
3421
3453
|
);
|
|
3422
|
-
var AlertDialogAction =
|
|
3454
|
+
var AlertDialogAction = React45.forwardRef(({ variant, intent, className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3423
3455
|
AlertDialogPrimitive.Action,
|
|
3424
3456
|
{
|
|
3425
3457
|
ref,
|
|
@@ -3438,7 +3470,7 @@ var AlertDialogAction = React44.forwardRef(({ variant, intent, className, ...pro
|
|
|
3438
3470
|
}
|
|
3439
3471
|
));
|
|
3440
3472
|
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
3441
|
-
var AlertDialogCancel =
|
|
3473
|
+
var AlertDialogCancel = React45.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3442
3474
|
AlertDialogPrimitive.Cancel,
|
|
3443
3475
|
{
|
|
3444
3476
|
ref,
|
|
@@ -3634,7 +3666,7 @@ var AreaChart = forwardRef(function AreaChart2({ data, height = 140, formatValue
|
|
|
3634
3666
|
] });
|
|
3635
3667
|
});
|
|
3636
3668
|
AreaChart.displayName = "AreaChart";
|
|
3637
|
-
var AspectRatio =
|
|
3669
|
+
var AspectRatio = React45.forwardRef(function AspectRatio2({ className, ratio = 16 / 9, ...props }, ref) {
|
|
3638
3670
|
return /* @__PURE__ */ jsx(
|
|
3639
3671
|
AspectRatioPrimitive.Root,
|
|
3640
3672
|
{
|
|
@@ -4186,7 +4218,7 @@ var statusDotSizes = {
|
|
|
4186
4218
|
function getInitials(name) {
|
|
4187
4219
|
return name.split(" ").map((part) => part[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
|
|
4188
4220
|
}
|
|
4189
|
-
var Avatar =
|
|
4221
|
+
var Avatar = React45.forwardRef(
|
|
4190
4222
|
function Avatar2({ src, alt, name, size = "md", variant = "initials", status, className, classNames, ...props }, ref) {
|
|
4191
4223
|
const messages = useDsMessages("avatar");
|
|
4192
4224
|
const initials2 = name ? getInitials(name) : "?";
|
|
@@ -4467,22 +4499,19 @@ var BreadcrumbItem = forwardRef(
|
|
|
4467
4499
|
);
|
|
4468
4500
|
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
4469
4501
|
var BreadcrumbLink = forwardRef(
|
|
4470
|
-
function BreadcrumbLink2({ className, children, ...props }, ref) {
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
"ds:hover:text-fg",
|
|
4479
|
-
"ds:rounded-icon ds:focus-visible:[box-shadow:var(--shadow-focus-ring)] ds:focus-visible:outline-none",
|
|
4480
|
-
className
|
|
4481
|
-
),
|
|
4482
|
-
...props,
|
|
4483
|
-
children
|
|
4484
|
-
}
|
|
4502
|
+
function BreadcrumbLink2({ className, children, href, ...props }, ref) {
|
|
4503
|
+
const RouterLink = useLinkComponent();
|
|
4504
|
+
const classes = cn(
|
|
4505
|
+
"ds:text-fg-3 ds:inline-flex ds:items-center ds:gap-1",
|
|
4506
|
+
"ds:transition-colors ds:duration-[var(--duration-fast)] ds:ease-[var(--ease-out-quart)] ds:motion-reduce:transition-none",
|
|
4507
|
+
"ds:hover:text-fg",
|
|
4508
|
+
"ds:rounded-icon ds:focus-visible:[box-shadow:var(--shadow-focus-ring)] ds:focus-visible:outline-none",
|
|
4509
|
+
className
|
|
4485
4510
|
);
|
|
4511
|
+
if (RouterLink && href !== void 0) {
|
|
4512
|
+
return /* @__PURE__ */ jsx(RouterLink, { ref, href, className: classes, ...props, children });
|
|
4513
|
+
}
|
|
4514
|
+
return /* @__PURE__ */ jsx("a", { ref, href, className: classes, ...props, children });
|
|
4486
4515
|
}
|
|
4487
4516
|
);
|
|
4488
4517
|
BreadcrumbLink.displayName = "BreadcrumbLink";
|
|
@@ -5244,7 +5273,7 @@ var TOOLTIP_MAX_WIDTH = {
|
|
|
5244
5273
|
md: "ds:max-w-md",
|
|
5245
5274
|
none: "ds:max-w-none"
|
|
5246
5275
|
};
|
|
5247
|
-
var TooltipContent =
|
|
5276
|
+
var TooltipContent = React45.forwardRef(({ className, sideOffset = 6, maxWidth = "xs", ...props }, ref) => /* @__PURE__ */ jsx(TooltipPortal, { children: /* @__PURE__ */ jsx(
|
|
5248
5277
|
TooltipPrimitive.Content,
|
|
5249
5278
|
{
|
|
5250
5279
|
ref,
|
|
@@ -5358,8 +5387,8 @@ var SelectRoot = SelectPrimitive.Root;
|
|
|
5358
5387
|
var SelectGroup = SelectPrimitive.Group;
|
|
5359
5388
|
var SelectValue = SelectPrimitive.Value;
|
|
5360
5389
|
function useTriggerOpen(node) {
|
|
5361
|
-
const [open, setOpen] =
|
|
5362
|
-
|
|
5390
|
+
const [open, setOpen] = React45.useState(false);
|
|
5391
|
+
React45.useEffect(() => {
|
|
5363
5392
|
if (!node) return;
|
|
5364
5393
|
const sync = () => setOpen(node.getAttribute("data-state") === "open");
|
|
5365
5394
|
sync();
|
|
@@ -5369,10 +5398,10 @@ function useTriggerOpen(node) {
|
|
|
5369
5398
|
}, [node]);
|
|
5370
5399
|
return open;
|
|
5371
5400
|
}
|
|
5372
|
-
var SelectTrigger =
|
|
5373
|
-
const [node, setNode] =
|
|
5401
|
+
var SelectTrigger = React45.forwardRef(({ className, children, tabIndex, size, classNames, ...props }, ref) => {
|
|
5402
|
+
const [node, setNode] = React45.useState(null);
|
|
5374
5403
|
const open = useTriggerOpen(node);
|
|
5375
|
-
const composedRef =
|
|
5404
|
+
const composedRef = React45.useCallback(
|
|
5376
5405
|
(element) => {
|
|
5377
5406
|
setNode(element);
|
|
5378
5407
|
if (typeof ref === "function") ref(element);
|
|
@@ -5426,7 +5455,7 @@ var SelectTrigger = React44.forwardRef(({ className, children, tabIndex, size, c
|
|
|
5426
5455
|
);
|
|
5427
5456
|
});
|
|
5428
5457
|
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
5429
|
-
var SelectScrollUpButton =
|
|
5458
|
+
var SelectScrollUpButton = React45.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5430
5459
|
SelectPrimitive.ScrollUpButton,
|
|
5431
5460
|
{
|
|
5432
5461
|
ref,
|
|
@@ -5440,7 +5469,7 @@ var SelectScrollUpButton = React44.forwardRef(({ className, ...props }, ref) =>
|
|
|
5440
5469
|
}
|
|
5441
5470
|
));
|
|
5442
5471
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
5443
|
-
var SelectScrollDownButton =
|
|
5472
|
+
var SelectScrollDownButton = React45.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5444
5473
|
SelectPrimitive.ScrollDownButton,
|
|
5445
5474
|
{
|
|
5446
5475
|
ref,
|
|
@@ -5455,7 +5484,7 @@ var SelectScrollDownButton = React44.forwardRef(({ className, ...props }, ref) =
|
|
|
5455
5484
|
));
|
|
5456
5485
|
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
5457
5486
|
var SelectPortal = withPortalContainer(SelectPrimitive.Portal);
|
|
5458
|
-
var SelectContent =
|
|
5487
|
+
var SelectContent = React45.forwardRef(({ className, children, position = "popper", classNames, ...props }, ref) => /* @__PURE__ */ jsx(SelectPortal, { children: /* @__PURE__ */ jsxs(
|
|
5459
5488
|
SelectPrimitive.Content,
|
|
5460
5489
|
{
|
|
5461
5490
|
ref,
|
|
@@ -5492,7 +5521,7 @@ var SelectContent = React44.forwardRef(({ className, children, position = "poppe
|
|
|
5492
5521
|
}
|
|
5493
5522
|
) }));
|
|
5494
5523
|
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
5495
|
-
var SelectLabel =
|
|
5524
|
+
var SelectLabel = React45.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5496
5525
|
SelectPrimitive.Label,
|
|
5497
5526
|
{
|
|
5498
5527
|
ref,
|
|
@@ -5505,7 +5534,7 @@ var SelectLabel = React44.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
5505
5534
|
}
|
|
5506
5535
|
));
|
|
5507
5536
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
5508
|
-
var SelectItem =
|
|
5537
|
+
var SelectItem = React45.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
5509
5538
|
SelectPrimitive.Item,
|
|
5510
5539
|
{
|
|
5511
5540
|
ref,
|
|
@@ -5533,7 +5562,7 @@ var SelectItem = React44.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
5533
5562
|
}
|
|
5534
5563
|
));
|
|
5535
5564
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
5536
|
-
var SelectSeparator =
|
|
5565
|
+
var SelectSeparator = React45.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5537
5566
|
SelectPrimitive.Separator,
|
|
5538
5567
|
{
|
|
5539
5568
|
ref,
|
|
@@ -5600,9 +5629,9 @@ function Select({
|
|
|
5600
5629
|
const disabled = wiring.disabled ?? false;
|
|
5601
5630
|
const required = wiring["aria-required"] === true;
|
|
5602
5631
|
const size = sizeProp ?? fieldControlSize(field?.size);
|
|
5603
|
-
const triggerRef =
|
|
5632
|
+
const triggerRef = React45.useRef(null);
|
|
5604
5633
|
const fieldRef = wiring.ref;
|
|
5605
|
-
const composedTriggerRef =
|
|
5634
|
+
const composedTriggerRef = React45.useCallback(
|
|
5606
5635
|
(node) => {
|
|
5607
5636
|
triggerRef.current = node;
|
|
5608
5637
|
fieldRef(node);
|
|
@@ -5876,15 +5905,15 @@ function Calendar({
|
|
|
5876
5905
|
const range = isRange ? selected : void 0;
|
|
5877
5906
|
const locale = useLocale(typeof localeProp === "string" ? localeProp : void 0);
|
|
5878
5907
|
const localeObject = typeof localeProp === "object" ? localeProp : void 0;
|
|
5879
|
-
const localeProps =
|
|
5908
|
+
const localeProps = React45.useMemo(
|
|
5880
5909
|
() => localeObject ? {} : calendarLocaleProps(locale),
|
|
5881
5910
|
[locale, localeObject]
|
|
5882
5911
|
);
|
|
5883
5912
|
const hydrated = useHydrated();
|
|
5884
|
-
const clockToday =
|
|
5913
|
+
const clockToday = React45.useMemo(() => hydrated ? startOfDay(/* @__PURE__ */ new Date()) : void 0, [hydrated]);
|
|
5885
5914
|
const today = todayProp ?? clockToday;
|
|
5886
5915
|
const anchor = props.month ?? props.defaultMonth ?? todayProp;
|
|
5887
|
-
const { modifiers, modifiersClassNames } =
|
|
5916
|
+
const { modifiers, modifiersClassNames } = React45.useMemo(() => {
|
|
5888
5917
|
const buckets = {};
|
|
5889
5918
|
for (const h of highlights) {
|
|
5890
5919
|
const key = h.color ?? "primary";
|
|
@@ -5899,7 +5928,7 @@ function Calendar({
|
|
|
5899
5928
|
}
|
|
5900
5929
|
return { modifiers: mods, modifiersClassNames: modClasses };
|
|
5901
5930
|
}, [highlights]);
|
|
5902
|
-
const disabledMatcher =
|
|
5931
|
+
const disabledMatcher = React45.useMemo(() => {
|
|
5903
5932
|
if (!minDate && !maxDate) return void 0;
|
|
5904
5933
|
if (minDate && maxDate) return [{ before: minDate }, { after: maxDate }];
|
|
5905
5934
|
if (minDate) return { before: minDate };
|
|
@@ -5907,7 +5936,7 @@ function Calendar({
|
|
|
5907
5936
|
}, [minDate, maxDate]);
|
|
5908
5937
|
const rangeFrom = range?.from;
|
|
5909
5938
|
const rangeTo = range?.to;
|
|
5910
|
-
const navRange =
|
|
5939
|
+
const navRange = React45.useMemo(
|
|
5911
5940
|
() => captionLayout === "label" ? void 0 : resolveCalendarNavRange({
|
|
5912
5941
|
minDate,
|
|
5913
5942
|
maxDate,
|
|
@@ -6216,7 +6245,7 @@ function useFieldsetLegend(explicitId) {
|
|
|
6216
6245
|
}, [registerLegend]);
|
|
6217
6246
|
return explicitId ?? fieldset?.legendId;
|
|
6218
6247
|
}
|
|
6219
|
-
var Checkbox =
|
|
6248
|
+
var Checkbox = React45.forwardRef(function Checkbox2({
|
|
6220
6249
|
label,
|
|
6221
6250
|
indeterminate,
|
|
6222
6251
|
checked,
|
|
@@ -6323,11 +6352,11 @@ function ClientSelect({
|
|
|
6323
6352
|
] });
|
|
6324
6353
|
}
|
|
6325
6354
|
ClientSelect.displayName = "ClientSelect";
|
|
6326
|
-
var Collapsible =
|
|
6355
|
+
var Collapsible = React45.forwardRef(function Collapsible2({ className, ...props }, ref) {
|
|
6327
6356
|
return /* @__PURE__ */ jsx(CollapsiblePrimitive.Root, { ref, className: cn(className), ...props });
|
|
6328
6357
|
});
|
|
6329
6358
|
Collapsible.displayName = CollapsiblePrimitive.Root.displayName;
|
|
6330
|
-
var CollapsibleTrigger =
|
|
6359
|
+
var CollapsibleTrigger = React45.forwardRef(function CollapsibleTrigger2({ className, ...props }, ref) {
|
|
6331
6360
|
return /* @__PURE__ */ jsx(
|
|
6332
6361
|
CollapsiblePrimitive.Trigger,
|
|
6333
6362
|
{
|
|
@@ -6342,7 +6371,7 @@ var CollapsibleTrigger = React44.forwardRef(function CollapsibleTrigger2({ class
|
|
|
6342
6371
|
);
|
|
6343
6372
|
});
|
|
6344
6373
|
CollapsibleTrigger.displayName = CollapsiblePrimitive.Trigger.displayName;
|
|
6345
|
-
var CollapsibleContent =
|
|
6374
|
+
var CollapsibleContent = React45.forwardRef(function CollapsibleContent2({ className, ...props }, ref) {
|
|
6346
6375
|
return /* @__PURE__ */ jsx(
|
|
6347
6376
|
CollapsiblePrimitive.Content,
|
|
6348
6377
|
{
|
|
@@ -6602,17 +6631,17 @@ function CommandPalette({
|
|
|
6602
6631
|
}) {
|
|
6603
6632
|
const messages = useDsMessages("commandPalette", messagesProp);
|
|
6604
6633
|
const placeholder = placeholderProp ?? messages.search;
|
|
6605
|
-
const [internalOpen, setInternalOpen] =
|
|
6634
|
+
const [internalOpen, setInternalOpen] = React45.useState(defaultOpen);
|
|
6606
6635
|
const isControlled = controlledOpen !== void 0;
|
|
6607
6636
|
const open = isControlled ? controlledOpen : internalOpen;
|
|
6608
|
-
const setOpen =
|
|
6637
|
+
const setOpen = React45.useCallback(
|
|
6609
6638
|
(value) => {
|
|
6610
6639
|
if (!isControlled) setInternalOpen(value);
|
|
6611
6640
|
onOpenChange?.(value);
|
|
6612
6641
|
},
|
|
6613
6642
|
[isControlled, onOpenChange]
|
|
6614
6643
|
);
|
|
6615
|
-
|
|
6644
|
+
React45.useEffect(() => {
|
|
6616
6645
|
function handleKeyDown(e) {
|
|
6617
6646
|
if ((e.metaKey || e.ctrlKey) && e.key === "k") {
|
|
6618
6647
|
e.preventDefault();
|
|
@@ -6933,19 +6962,19 @@ function ConfirmDialog({
|
|
|
6933
6962
|
}) {
|
|
6934
6963
|
const messages = useDsMessages("confirm", messagesOverride);
|
|
6935
6964
|
const isControlled = open !== void 0;
|
|
6936
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
6965
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React45.useState(defaultOpen);
|
|
6937
6966
|
const resolvedOpen = isControlled ? open : uncontrolledOpen;
|
|
6938
|
-
const [pending, setPending] =
|
|
6939
|
-
const [error, setError] =
|
|
6940
|
-
const actionRef =
|
|
6941
|
-
const mounted =
|
|
6942
|
-
|
|
6967
|
+
const [pending, setPending] = React45.useState(false);
|
|
6968
|
+
const [error, setError] = React45.useState(void 0);
|
|
6969
|
+
const actionRef = React45.useRef(null);
|
|
6970
|
+
const mounted = React45.useRef(true);
|
|
6971
|
+
React45.useEffect(() => {
|
|
6943
6972
|
mounted.current = true;
|
|
6944
6973
|
return () => {
|
|
6945
6974
|
mounted.current = false;
|
|
6946
6975
|
};
|
|
6947
6976
|
}, []);
|
|
6948
|
-
const setDialogOpen =
|
|
6977
|
+
const setDialogOpen = React45.useCallback(
|
|
6949
6978
|
(nextOpen) => {
|
|
6950
6979
|
onOpenChange?.(nextOpen);
|
|
6951
6980
|
if (!isControlled) setUncontrolledOpen(nextOpen);
|
|
@@ -7143,7 +7172,7 @@ var ContextMenuGroup = ContextMenuPrimitive.Group;
|
|
|
7143
7172
|
var ContextMenuPortal = withPortalContainer(ContextMenuPrimitive.Portal);
|
|
7144
7173
|
var ContextMenuSub = ContextMenuPrimitive.Sub;
|
|
7145
7174
|
var ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
|
|
7146
|
-
var ContextMenuSubTrigger =
|
|
7175
|
+
var ContextMenuSubTrigger = React45.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
7147
7176
|
ContextMenuPrimitive.SubTrigger,
|
|
7148
7177
|
{
|
|
7149
7178
|
ref,
|
|
@@ -7157,7 +7186,7 @@ var ContextMenuSubTrigger = React44.forwardRef(({ className, inset, children, ..
|
|
|
7157
7186
|
}
|
|
7158
7187
|
));
|
|
7159
7188
|
ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
|
|
7160
|
-
var ContextMenuSubContent =
|
|
7189
|
+
var ContextMenuSubContent = React45.forwardRef(({ className, ...props }, ref) => (
|
|
7161
7190
|
// Portal the sub-content to the body. The parent Content is transformed
|
|
7162
7191
|
// while its presence keyframes run, which makes it the containing block for
|
|
7163
7192
|
// `position: fixed` descendants — and its `overflow-hidden` would then clip
|
|
@@ -7177,7 +7206,7 @@ var ContextMenuSubContent = React44.forwardRef(({ className, ...props }, ref) =>
|
|
|
7177
7206
|
) })
|
|
7178
7207
|
));
|
|
7179
7208
|
ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
|
|
7180
|
-
var ContextMenuContent =
|
|
7209
|
+
var ContextMenuContent = React45.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(ContextMenuPortal, { children: /* @__PURE__ */ jsx(
|
|
7181
7210
|
ContextMenuPrimitive.Content,
|
|
7182
7211
|
{
|
|
7183
7212
|
ref,
|
|
@@ -7191,7 +7220,7 @@ var ContextMenuContent = React44.forwardRef(({ className, ...props }, ref) => /*
|
|
|
7191
7220
|
}
|
|
7192
7221
|
) }));
|
|
7193
7222
|
ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
|
|
7194
|
-
var ContextMenuItem =
|
|
7223
|
+
var ContextMenuItem = React45.forwardRef(({ className, destructive, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7195
7224
|
ContextMenuPrimitive.Item,
|
|
7196
7225
|
{
|
|
7197
7226
|
ref,
|
|
@@ -7206,7 +7235,7 @@ var ContextMenuItem = React44.forwardRef(({ className, destructive, inset, ...pr
|
|
|
7206
7235
|
}
|
|
7207
7236
|
));
|
|
7208
7237
|
ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
|
|
7209
|
-
var ContextMenuCheckboxItem =
|
|
7238
|
+
var ContextMenuCheckboxItem = React45.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
7210
7239
|
ContextMenuPrimitive.CheckboxItem,
|
|
7211
7240
|
{
|
|
7212
7241
|
ref,
|
|
@@ -7221,7 +7250,7 @@ var ContextMenuCheckboxItem = React44.forwardRef(({ className, children, checked
|
|
|
7221
7250
|
}
|
|
7222
7251
|
));
|
|
7223
7252
|
ContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;
|
|
7224
|
-
var ContextMenuRadioItem =
|
|
7253
|
+
var ContextMenuRadioItem = React45.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
7225
7254
|
ContextMenuPrimitive.RadioItem,
|
|
7226
7255
|
{
|
|
7227
7256
|
ref,
|
|
@@ -7235,7 +7264,7 @@ var ContextMenuRadioItem = React44.forwardRef(({ className, children, ...props }
|
|
|
7235
7264
|
}
|
|
7236
7265
|
));
|
|
7237
7266
|
ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;
|
|
7238
|
-
var ContextMenuLabel =
|
|
7267
|
+
var ContextMenuLabel = React45.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7239
7268
|
ContextMenuPrimitive.Label,
|
|
7240
7269
|
{
|
|
7241
7270
|
ref,
|
|
@@ -7245,7 +7274,7 @@ var ContextMenuLabel = React44.forwardRef(({ className, inset, ...props }, ref)
|
|
|
7245
7274
|
}
|
|
7246
7275
|
));
|
|
7247
7276
|
ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;
|
|
7248
|
-
var ContextMenuSeparator =
|
|
7277
|
+
var ContextMenuSeparator = React45.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7249
7278
|
ContextMenuPrimitive.Separator,
|
|
7250
7279
|
{
|
|
7251
7280
|
ref,
|
|
@@ -7290,7 +7319,7 @@ var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
|
7290
7319
|
var PopoverAnchor = PopoverPrimitive.Anchor;
|
|
7291
7320
|
var PopoverPortal = withPortalContainer(PopoverPrimitive.Portal);
|
|
7292
7321
|
var PopoverClose = PopoverPrimitive.Close;
|
|
7293
|
-
var PopoverContent =
|
|
7322
|
+
var PopoverContent = React45.forwardRef(
|
|
7294
7323
|
({
|
|
7295
7324
|
className,
|
|
7296
7325
|
align = "center",
|
|
@@ -7920,7 +7949,7 @@ DateRangePicker.displayName = "DateRangePicker";
|
|
|
7920
7949
|
var Dialog = DialogPrimitive2.Root;
|
|
7921
7950
|
var DialogTrigger = DialogPrimitive2.Trigger;
|
|
7922
7951
|
var DialogPortal = withPortalContainer(DialogPrimitive2.Portal);
|
|
7923
|
-
var DialogOverlay =
|
|
7952
|
+
var DialogOverlay = React45.forwardRef((props, ref) => /* @__PURE__ */ jsx(
|
|
7924
7953
|
Backdrop,
|
|
7925
7954
|
{
|
|
7926
7955
|
as: DialogPrimitive2.Overlay,
|
|
@@ -7954,7 +7983,7 @@ var DIALOG_HEIGHTS = {
|
|
|
7954
7983
|
full: "ds:h-[calc(100vh-6rem)]"
|
|
7955
7984
|
};
|
|
7956
7985
|
function useTitleRequired(element) {
|
|
7957
|
-
|
|
7986
|
+
React45.useEffect(() => {
|
|
7958
7987
|
if (process.env.NODE_ENV === "production" || process.env.NODE_ENV === "test") return;
|
|
7959
7988
|
const timer = setTimeout(() => {
|
|
7960
7989
|
const node = element.current;
|
|
@@ -7971,7 +8000,7 @@ function useTitleRequired(element) {
|
|
|
7971
8000
|
return () => clearTimeout(timer);
|
|
7972
8001
|
}, [element]);
|
|
7973
8002
|
}
|
|
7974
|
-
var DialogContent =
|
|
8003
|
+
var DialogContent = React45.forwardRef(
|
|
7975
8004
|
({
|
|
7976
8005
|
size = "md",
|
|
7977
8006
|
height = "auto",
|
|
@@ -7983,7 +8012,7 @@ var DialogContent = React44.forwardRef(
|
|
|
7983
8012
|
children,
|
|
7984
8013
|
...props
|
|
7985
8014
|
}, ref) => {
|
|
7986
|
-
const element =
|
|
8015
|
+
const element = React45.useRef(null);
|
|
7987
8016
|
const mergedRef = useMergedRefs(ref, element);
|
|
7988
8017
|
useTitleRequired(element);
|
|
7989
8018
|
const heightRow = DIALOG_HEIGHTS[height];
|
|
@@ -8021,7 +8050,7 @@ var DialogContent = React44.forwardRef(
|
|
|
8021
8050
|
}
|
|
8022
8051
|
);
|
|
8023
8052
|
DialogContent.displayName = DialogPrimitive2.Content.displayName;
|
|
8024
|
-
var DialogClose =
|
|
8053
|
+
var DialogClose = React45.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
8025
8054
|
DialogPrimitive2.Close,
|
|
8026
8055
|
{
|
|
8027
8056
|
ref,
|
|
@@ -8033,15 +8062,15 @@ var DialogClose = React44.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
8033
8062
|
DialogClose.displayName = "DialogClose";
|
|
8034
8063
|
var DialogHeader = (props) => /* @__PURE__ */ jsx(OverlayHeader, { anatomy: dialogAnatomy, layout: "inset", dismissGutter: true, ...props });
|
|
8035
8064
|
DialogHeader.displayName = "DialogHeader";
|
|
8036
|
-
var DialogBody =
|
|
8065
|
+
var DialogBody = React45.forwardRef(
|
|
8037
8066
|
({ padding = "none", ...props }, ref) => /* @__PURE__ */ jsx(OverlayBody, { anatomy: dialogAnatomy, layout: "inset", padding, ref, ...props })
|
|
8038
8067
|
);
|
|
8039
8068
|
DialogBody.displayName = "DialogBody";
|
|
8040
8069
|
var DialogFooter = (props) => /* @__PURE__ */ jsx(OverlayFooter, { anatomy: dialogAnatomy, layout: "inset", ...props });
|
|
8041
8070
|
DialogFooter.displayName = "DialogFooter";
|
|
8042
|
-
var DialogTitle =
|
|
8071
|
+
var DialogTitle = React45.forwardRef((props, ref) => /* @__PURE__ */ jsx(OverlayTitle, { as: DialogPrimitive2.Title, anatomy: dialogAnatomy, ref, ...props }));
|
|
8043
8072
|
DialogTitle.displayName = DialogPrimitive2.Title.displayName;
|
|
8044
|
-
var DialogDescription =
|
|
8073
|
+
var DialogDescription = React45.forwardRef((props, ref) => /* @__PURE__ */ jsx(
|
|
8045
8074
|
OverlayDescription,
|
|
8046
8075
|
{
|
|
8047
8076
|
as: DialogPrimitive2.Description,
|
|
@@ -8071,7 +8100,7 @@ var chipVariants = cva(
|
|
|
8071
8100
|
}
|
|
8072
8101
|
}
|
|
8073
8102
|
);
|
|
8074
|
-
var DismissibleChip =
|
|
8103
|
+
var DismissibleChip = React45.forwardRef(function DismissibleChip2({ label, onDismiss, variant, className, ...props }, ref) {
|
|
8075
8104
|
const messages = useDsMessages("dismissibleChip");
|
|
8076
8105
|
return /* @__PURE__ */ jsxs(
|
|
8077
8106
|
"button",
|
|
@@ -8284,7 +8313,7 @@ var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
|
8284
8313
|
var DropdownMenuPortal = withPortalContainer(DropdownMenuPrimitive.Portal);
|
|
8285
8314
|
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
8286
8315
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
8287
|
-
var DropdownMenuSubTrigger =
|
|
8316
|
+
var DropdownMenuSubTrigger = React45.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
8288
8317
|
DropdownMenuPrimitive.SubTrigger,
|
|
8289
8318
|
{
|
|
8290
8319
|
ref,
|
|
@@ -8298,7 +8327,7 @@ var DropdownMenuSubTrigger = React44.forwardRef(({ className, inset, children, .
|
|
|
8298
8327
|
}
|
|
8299
8328
|
));
|
|
8300
8329
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
8301
|
-
var DropdownMenuSubContent =
|
|
8330
|
+
var DropdownMenuSubContent = React45.forwardRef(({ className, ...props }, ref) => (
|
|
8302
8331
|
// Portal the sub-content to the body. The parent Content is transformed
|
|
8303
8332
|
// while its presence keyframes run, which makes it the containing block for
|
|
8304
8333
|
// `position: fixed` descendants — and its `overflow-hidden` would then clip
|
|
@@ -8318,7 +8347,7 @@ var DropdownMenuSubContent = React44.forwardRef(({ className, ...props }, ref) =
|
|
|
8318
8347
|
) })
|
|
8319
8348
|
));
|
|
8320
8349
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
8321
|
-
var DropdownMenuContent =
|
|
8350
|
+
var DropdownMenuContent = React45.forwardRef(({ className, sideOffset = 6, align = "start", width = "auto", ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPortal, { children: /* @__PURE__ */ jsx(
|
|
8322
8351
|
DropdownMenuPrimitive.Content,
|
|
8323
8352
|
{
|
|
8324
8353
|
ref,
|
|
@@ -8335,7 +8364,7 @@ var DropdownMenuContent = React44.forwardRef(({ className, sideOffset = 6, align
|
|
|
8335
8364
|
}
|
|
8336
8365
|
) }));
|
|
8337
8366
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
8338
|
-
var DropdownMenuItem =
|
|
8367
|
+
var DropdownMenuItem = React45.forwardRef(({ className, destructive, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
8339
8368
|
DropdownMenuPrimitive.Item,
|
|
8340
8369
|
{
|
|
8341
8370
|
ref,
|
|
@@ -8350,7 +8379,7 @@ var DropdownMenuItem = React44.forwardRef(({ className, destructive, inset, ...p
|
|
|
8350
8379
|
}
|
|
8351
8380
|
));
|
|
8352
8381
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
8353
|
-
var DropdownMenuCheckboxItem =
|
|
8382
|
+
var DropdownMenuCheckboxItem = React45.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
8354
8383
|
DropdownMenuPrimitive.CheckboxItem,
|
|
8355
8384
|
{
|
|
8356
8385
|
ref,
|
|
@@ -8365,7 +8394,7 @@ var DropdownMenuCheckboxItem = React44.forwardRef(({ className, children, checke
|
|
|
8365
8394
|
}
|
|
8366
8395
|
));
|
|
8367
8396
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
8368
|
-
var DropdownMenuRadioItem =
|
|
8397
|
+
var DropdownMenuRadioItem = React45.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
8369
8398
|
DropdownMenuPrimitive.RadioItem,
|
|
8370
8399
|
{
|
|
8371
8400
|
ref,
|
|
@@ -8379,7 +8408,7 @@ var DropdownMenuRadioItem = React44.forwardRef(({ className, children, ...props
|
|
|
8379
8408
|
}
|
|
8380
8409
|
));
|
|
8381
8410
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
8382
|
-
var DropdownMenuLabel =
|
|
8411
|
+
var DropdownMenuLabel = React45.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
8383
8412
|
DropdownMenuPrimitive.Label,
|
|
8384
8413
|
{
|
|
8385
8414
|
ref,
|
|
@@ -8389,7 +8418,7 @@ var DropdownMenuLabel = React44.forwardRef(({ className, inset, ...props }, ref)
|
|
|
8389
8418
|
}
|
|
8390
8419
|
));
|
|
8391
8420
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
8392
|
-
var DropdownMenuSeparator =
|
|
8421
|
+
var DropdownMenuSeparator = React45.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
8393
8422
|
DropdownMenuPrimitive.Separator,
|
|
8394
8423
|
{
|
|
8395
8424
|
ref,
|
|
@@ -8408,32 +8437,322 @@ var DropdownMenuShortcut = ({ className, ...props }) => /* @__PURE__ */ jsx(
|
|
|
8408
8437
|
}
|
|
8409
8438
|
);
|
|
8410
8439
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
8411
|
-
var
|
|
8440
|
+
var SIZES = {
|
|
8441
|
+
page: {
|
|
8442
|
+
pad: "ds:py-20",
|
|
8443
|
+
tile: "ds:mb-5 ds:size-14 ds:[&>svg]:size-7",
|
|
8444
|
+
title: "ds:text-lg",
|
|
8445
|
+
description: "ds:mt-2 ds:text-sm",
|
|
8446
|
+
action: "ds:mt-7"
|
|
8447
|
+
},
|
|
8448
|
+
section: {
|
|
8449
|
+
pad: "ds:py-12",
|
|
8450
|
+
tile: "ds:mb-4 ds:size-12 ds:[&>svg]:size-6",
|
|
8451
|
+
title: "ds:text-base",
|
|
8452
|
+
description: "ds:mt-1.5 ds:text-sm",
|
|
8453
|
+
action: "ds:mt-6"
|
|
8454
|
+
},
|
|
8455
|
+
compact: {
|
|
8456
|
+
pad: "ds:py-8",
|
|
8457
|
+
tile: "ds:mb-3 ds:size-9 ds:[&>svg]:size-4",
|
|
8458
|
+
title: "ds:text-sm",
|
|
8459
|
+
description: "ds:mt-1 ds:text-xs",
|
|
8460
|
+
action: "ds:mt-4"
|
|
8461
|
+
}
|
|
8462
|
+
};
|
|
8463
|
+
var EmptyState = forwardRef(function EmptyState2({
|
|
8464
|
+
icon,
|
|
8465
|
+
title,
|
|
8466
|
+
description,
|
|
8467
|
+
action,
|
|
8468
|
+
size = "default",
|
|
8469
|
+
headingLevel = 3,
|
|
8470
|
+
align = "center",
|
|
8471
|
+
className,
|
|
8472
|
+
...props
|
|
8473
|
+
}, ref) {
|
|
8474
|
+
const key = size === "default" ? "section" : size;
|
|
8475
|
+
const s = SIZES[key];
|
|
8476
|
+
const Tag = `h${headingLevel}`;
|
|
8412
8477
|
return /* @__PURE__ */ jsxs(
|
|
8413
8478
|
"div",
|
|
8414
8479
|
{
|
|
8415
8480
|
ref,
|
|
8416
|
-
|
|
8481
|
+
"data-size": key === "section" ? void 0 : key,
|
|
8482
|
+
"data-align": align === "center" ? void 0 : align,
|
|
8483
|
+
className: cn(
|
|
8484
|
+
"ds:flex ds:flex-col ds:items-center ds:justify-center ds:px-6 ds:text-center",
|
|
8485
|
+
align === "start" && "ds:items-start ds:text-start",
|
|
8486
|
+
s.pad,
|
|
8487
|
+
className
|
|
8488
|
+
),
|
|
8417
8489
|
...props,
|
|
8418
8490
|
children: [
|
|
8419
8491
|
icon && /* @__PURE__ */ jsx(
|
|
8420
8492
|
"div",
|
|
8421
8493
|
{
|
|
8422
8494
|
className: cn(
|
|
8423
|
-
"ds:
|
|
8424
|
-
"ds:bg-surface-2 ds:text-fg-3 ds:ring-1 ds:ring-rule
|
|
8495
|
+
"ds:flex ds:items-center ds:justify-center ds:rounded-full",
|
|
8496
|
+
"ds:bg-surface-2 ds:text-fg-3 ds:ring-1 ds:ring-rule",
|
|
8497
|
+
s.tile
|
|
8425
8498
|
),
|
|
8426
8499
|
children: icon
|
|
8427
8500
|
}
|
|
8428
8501
|
),
|
|
8429
|
-
/* @__PURE__ */ jsx(
|
|
8430
|
-
|
|
8431
|
-
|
|
8502
|
+
/* @__PURE__ */ jsx(
|
|
8503
|
+
Tag,
|
|
8504
|
+
{
|
|
8505
|
+
className: cn("ds:font-display ds:text-fg ds:font-medium ds:tracking-[-0.02em]", s.title),
|
|
8506
|
+
children: title
|
|
8507
|
+
}
|
|
8508
|
+
),
|
|
8509
|
+
description && /* @__PURE__ */ jsx("p", { className: cn("ds:text-fg-3 ds:max-w-sm", s.description), children: description }),
|
|
8510
|
+
action && /* @__PURE__ */ jsx("div", { className: s.action, children: action })
|
|
8432
8511
|
]
|
|
8433
8512
|
}
|
|
8434
8513
|
);
|
|
8435
8514
|
});
|
|
8436
8515
|
EmptyState.displayName = "EmptyState";
|
|
8516
|
+
var DEFAULT_SIZE = {
|
|
8517
|
+
1: "title-page",
|
|
8518
|
+
2: "title-section",
|
|
8519
|
+
3: "title-sub",
|
|
8520
|
+
4: "title-sub",
|
|
8521
|
+
5: "title-sub",
|
|
8522
|
+
6: "title-sub"
|
|
8523
|
+
};
|
|
8524
|
+
var SIZE_CLASS = {
|
|
8525
|
+
display: "ds:text-display",
|
|
8526
|
+
"title-page": "ds:text-title-page",
|
|
8527
|
+
"title-section": "ds:text-title-section",
|
|
8528
|
+
"title-sub": "ds:text-title-sub"
|
|
8529
|
+
};
|
|
8530
|
+
var Heading = forwardRef(function Heading2({ level, size, className, ...props }, ref) {
|
|
8531
|
+
const Tag = `h${level}`;
|
|
8532
|
+
return /* @__PURE__ */ jsx(
|
|
8533
|
+
Tag,
|
|
8534
|
+
{
|
|
8535
|
+
ref,
|
|
8536
|
+
...slot(headingAnatomy, "root"),
|
|
8537
|
+
className: cn("ds:font-display ds:text-fg", SIZE_CLASS[size ?? DEFAULT_SIZE[level]], className),
|
|
8538
|
+
...props
|
|
8539
|
+
}
|
|
8540
|
+
);
|
|
8541
|
+
});
|
|
8542
|
+
Heading.displayName = "Heading";
|
|
8543
|
+
var SIZES2 = {
|
|
8544
|
+
page: {
|
|
8545
|
+
pad: "ds:py-20",
|
|
8546
|
+
tile: "ds:mb-5 ds:size-14 ds:[&>svg]:size-7",
|
|
8547
|
+
title: "ds:text-lg",
|
|
8548
|
+
description: "ds:mt-2 ds:text-sm",
|
|
8549
|
+
actions: "ds:mt-7",
|
|
8550
|
+
button: "lg"
|
|
8551
|
+
},
|
|
8552
|
+
section: {
|
|
8553
|
+
pad: "ds:py-12",
|
|
8554
|
+
tile: "ds:mb-4 ds:size-12 ds:[&>svg]:size-6",
|
|
8555
|
+
title: "ds:text-base",
|
|
8556
|
+
description: "ds:mt-1.5 ds:text-sm",
|
|
8557
|
+
actions: "ds:mt-6",
|
|
8558
|
+
button: "md"
|
|
8559
|
+
},
|
|
8560
|
+
compact: {
|
|
8561
|
+
pad: "ds:py-8",
|
|
8562
|
+
tile: "ds:mb-3 ds:size-9 ds:[&>svg]:size-4",
|
|
8563
|
+
title: "ds:text-sm",
|
|
8564
|
+
description: "ds:mt-1 ds:text-xs",
|
|
8565
|
+
actions: "ds:mt-4",
|
|
8566
|
+
button: "sm"
|
|
8567
|
+
}
|
|
8568
|
+
};
|
|
8569
|
+
var ErrorState = forwardRef(function ErrorState2({
|
|
8570
|
+
icon,
|
|
8571
|
+
title,
|
|
8572
|
+
description,
|
|
8573
|
+
onRetry,
|
|
8574
|
+
retryLabel,
|
|
8575
|
+
action,
|
|
8576
|
+
details,
|
|
8577
|
+
defaultDetailsOpen = false,
|
|
8578
|
+
headingLevel = 3,
|
|
8579
|
+
size = "default",
|
|
8580
|
+
messages: messagesProp,
|
|
8581
|
+
className,
|
|
8582
|
+
...props
|
|
8583
|
+
}, ref) {
|
|
8584
|
+
const messages = useDsMessages("errorState", messagesProp);
|
|
8585
|
+
const [detailsOpen, setDetailsOpen] = useState(defaultDetailsOpen);
|
|
8586
|
+
const key = size === "default" ? "section" : size;
|
|
8587
|
+
const s = SIZES2[key];
|
|
8588
|
+
const compact = key === "compact";
|
|
8589
|
+
return /* @__PURE__ */ jsxs(
|
|
8590
|
+
"div",
|
|
8591
|
+
{
|
|
8592
|
+
ref,
|
|
8593
|
+
role: "alert",
|
|
8594
|
+
"data-size": key === "section" ? void 0 : key,
|
|
8595
|
+
className: cn(
|
|
8596
|
+
"ds:flex ds:flex-col ds:items-center ds:justify-center ds:px-6 ds:text-center",
|
|
8597
|
+
s.pad,
|
|
8598
|
+
className
|
|
8599
|
+
),
|
|
8600
|
+
...props,
|
|
8601
|
+
children: [
|
|
8602
|
+
/* @__PURE__ */ jsx(
|
|
8603
|
+
"div",
|
|
8604
|
+
{
|
|
8605
|
+
className: cn(
|
|
8606
|
+
"ds:flex ds:items-center ds:justify-center ds:rounded-full",
|
|
8607
|
+
"ds:bg-danger-bg ds:text-danger-fg ds:ring-1 ds:ring-rule",
|
|
8608
|
+
s.tile
|
|
8609
|
+
),
|
|
8610
|
+
children: icon ?? /* @__PURE__ */ jsx(AlertTriangleIcon, { "aria-hidden": "true" })
|
|
8611
|
+
}
|
|
8612
|
+
),
|
|
8613
|
+
/* @__PURE__ */ jsx(
|
|
8614
|
+
Heading,
|
|
8615
|
+
{
|
|
8616
|
+
level: headingLevel,
|
|
8617
|
+
size: "title-sub",
|
|
8618
|
+
className: cn("ds:font-display ds:text-fg ds:font-medium ds:tracking-[-0.02em]", s.title),
|
|
8619
|
+
children: title ?? messages.title
|
|
8620
|
+
}
|
|
8621
|
+
),
|
|
8622
|
+
description && /* @__PURE__ */ jsx("p", { className: cn("ds:text-fg-3 ds:max-w-sm", s.description), children: description }),
|
|
8623
|
+
(onRetry || action) && /* @__PURE__ */ jsxs("div", { className: cn("ds:flex ds:items-center ds:gap-2", s.actions), children: [
|
|
8624
|
+
onRetry && /* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", size: s.button, onClick: onRetry, children: retryLabel ?? messages.retry }),
|
|
8625
|
+
action
|
|
8626
|
+
] }),
|
|
8627
|
+
details != null && /* @__PURE__ */ jsxs(
|
|
8628
|
+
Collapsible,
|
|
8629
|
+
{
|
|
8630
|
+
open: detailsOpen,
|
|
8631
|
+
onOpenChange: setDetailsOpen,
|
|
8632
|
+
className: cn("ds:w-full ds:max-w-md", compact ? "ds:mt-3" : "ds:mt-4"),
|
|
8633
|
+
children: [
|
|
8634
|
+
/* @__PURE__ */ jsxs(
|
|
8635
|
+
CollapsibleTrigger,
|
|
8636
|
+
{
|
|
8637
|
+
className: cn(
|
|
8638
|
+
"ds:text-fg-3 ds:hover:text-fg ds:mx-auto ds:w-auto ds:gap-1 ds:rounded-md",
|
|
8639
|
+
"ds:px-1.5 ds:py-0.5 ds:text-xs ds:font-medium ds:transition-colors",
|
|
8640
|
+
"ds:motion-reduce:transition-none"
|
|
8641
|
+
),
|
|
8642
|
+
children: [
|
|
8643
|
+
detailsOpen ? messages.hideDetails : messages.showDetails,
|
|
8644
|
+
/* @__PURE__ */ jsx(
|
|
8645
|
+
ChevronDownIcon,
|
|
8646
|
+
{
|
|
8647
|
+
size: 12,
|
|
8648
|
+
"aria-hidden": "true",
|
|
8649
|
+
className: cn(
|
|
8650
|
+
"ds:transition-transform ds:motion-reduce:transition-none",
|
|
8651
|
+
detailsOpen && "ds:rotate-180"
|
|
8652
|
+
)
|
|
8653
|
+
}
|
|
8654
|
+
)
|
|
8655
|
+
]
|
|
8656
|
+
}
|
|
8657
|
+
),
|
|
8658
|
+
/* @__PURE__ */ jsx(
|
|
8659
|
+
CollapsibleContent,
|
|
8660
|
+
{
|
|
8661
|
+
className: cn(
|
|
8662
|
+
"ds:bg-surface-2 ds:text-fg-3 ds:border-rule ds:mt-2 ds:rounded-md ds:border",
|
|
8663
|
+
"ds:p-3 ds:text-left ds:font-mono ds:text-xs ds:break-words ds:whitespace-pre-wrap"
|
|
8664
|
+
),
|
|
8665
|
+
children: details
|
|
8666
|
+
}
|
|
8667
|
+
)
|
|
8668
|
+
]
|
|
8669
|
+
}
|
|
8670
|
+
)
|
|
8671
|
+
]
|
|
8672
|
+
}
|
|
8673
|
+
);
|
|
8674
|
+
});
|
|
8675
|
+
ErrorState.displayName = "ErrorState";
|
|
8676
|
+
var SectionCard = forwardRef(function SectionCard2({
|
|
8677
|
+
title,
|
|
8678
|
+
description,
|
|
8679
|
+
actions,
|
|
8680
|
+
headingLevel = 3,
|
|
8681
|
+
footer,
|
|
8682
|
+
flush = false,
|
|
8683
|
+
classNames,
|
|
8684
|
+
children,
|
|
8685
|
+
...props
|
|
8686
|
+
}, ref) {
|
|
8687
|
+
return /* @__PURE__ */ jsxs(Card, { ref, ...props, children: [
|
|
8688
|
+
(title || description || actions) && /* @__PURE__ */ jsxs(CardHeader, { className: classNames?.header, children: [
|
|
8689
|
+
/* @__PURE__ */ jsxs("div", { className: "ds:flex ds:min-w-0 ds:flex-col ds:gap-1.5", children: [
|
|
8690
|
+
title && /* @__PURE__ */ jsx(CardTitle, { headingLevel, className: classNames?.title, children: title }),
|
|
8691
|
+
description && /* @__PURE__ */ jsx(CardDescription, { className: classNames?.description, children: description })
|
|
8692
|
+
] }),
|
|
8693
|
+
actions && /* @__PURE__ */ jsx(CardAction, { children: actions })
|
|
8694
|
+
] }),
|
|
8695
|
+
children != null && /* @__PURE__ */ jsx(
|
|
8696
|
+
CardContent,
|
|
8697
|
+
{
|
|
8698
|
+
className: cn(
|
|
8699
|
+
flush && "ds:px-0",
|
|
8700
|
+
!(title || description || actions) && "ds:pt-6",
|
|
8701
|
+
classNames?.content
|
|
8702
|
+
),
|
|
8703
|
+
children
|
|
8704
|
+
}
|
|
8705
|
+
),
|
|
8706
|
+
footer && /* @__PURE__ */ jsx(CardFooter, { children: footer })
|
|
8707
|
+
] });
|
|
8708
|
+
});
|
|
8709
|
+
SectionCard.displayName = "SectionCard";
|
|
8710
|
+
var OVERFLOW_SIZE = {
|
|
8711
|
+
xs: "ds:size-(--avatar-size-xs) ds:text-xs",
|
|
8712
|
+
sm: "ds:size-(--avatar-size-sm) ds:text-xs",
|
|
8713
|
+
md: "ds:size-(--avatar-size-md) ds:text-xs",
|
|
8714
|
+
lg: "ds:size-(--avatar-size-lg) ds:text-sm",
|
|
8715
|
+
xl: "ds:size-(--avatar-size-xl) ds:text-sm"
|
|
8716
|
+
};
|
|
8717
|
+
var AvatarGroup = forwardRef(function AvatarGroup2({ children, max = 4, total, size = "sm", className, ...props }, ref) {
|
|
8718
|
+
const messages = useDsMessages("avatarGroup");
|
|
8719
|
+
const items = Children.toArray(children).filter(isValidElement);
|
|
8720
|
+
const shown = items.slice(0, Math.max(0, max));
|
|
8721
|
+
const hidden = Math.max(0, (total ?? items.length) - shown.length);
|
|
8722
|
+
return /* @__PURE__ */ jsxs(
|
|
8723
|
+
"div",
|
|
8724
|
+
{
|
|
8725
|
+
ref,
|
|
8726
|
+
"data-size": size,
|
|
8727
|
+
className: cn("ds:flex ds:items-center ds:-space-x-1.5", className),
|
|
8728
|
+
...props,
|
|
8729
|
+
children: [
|
|
8730
|
+
shown.map((child, index) => {
|
|
8731
|
+
const element = child;
|
|
8732
|
+
return cloneElement(element, {
|
|
8733
|
+
key: element.key ?? index,
|
|
8734
|
+
size: element.props.size ?? size,
|
|
8735
|
+
classNames: { ...element.props.classNames, frame: "ds:ring-bg ds:ring-2" }
|
|
8736
|
+
});
|
|
8737
|
+
}),
|
|
8738
|
+
hidden > 0 && /* @__PURE__ */ jsx(
|
|
8739
|
+
"span",
|
|
8740
|
+
{
|
|
8741
|
+
role: "img",
|
|
8742
|
+
"aria-label": messages.overflowLabel(hidden),
|
|
8743
|
+
className: cn(
|
|
8744
|
+
"ds:bg-bg-3 ds:text-fg-2 ds:ring-bg ds:relative ds:inline-flex ds:shrink-0",
|
|
8745
|
+
"ds:items-center ds:justify-center ds:rounded-full ds:font-mono ds:leading-none ds:font-medium ds:ring-2",
|
|
8746
|
+
OVERFLOW_SIZE[size]
|
|
8747
|
+
),
|
|
8748
|
+
children: messages.overflow(hidden)
|
|
8749
|
+
}
|
|
8750
|
+
)
|
|
8751
|
+
]
|
|
8752
|
+
}
|
|
8753
|
+
);
|
|
8754
|
+
});
|
|
8755
|
+
AvatarGroup.displayName = "AvatarGroup";
|
|
8437
8756
|
var kindTile = {
|
|
8438
8757
|
doc: "ds:bg-danger-bg ds:text-danger-fg",
|
|
8439
8758
|
sheet: "ds:bg-success-bg ds:text-success-fg",
|
|
@@ -8726,7 +9045,7 @@ FormSection.displayName = "FormSection";
|
|
|
8726
9045
|
var HoverCard = HoverCardPrimitive.Root;
|
|
8727
9046
|
var HoverCardTrigger = HoverCardPrimitive.Trigger;
|
|
8728
9047
|
var HoverCardPortal = withPortalContainer(HoverCardPrimitive.Portal);
|
|
8729
|
-
var HoverCardContent =
|
|
9048
|
+
var HoverCardContent = React45.forwardRef(
|
|
8730
9049
|
({
|
|
8731
9050
|
className,
|
|
8732
9051
|
align = "center",
|
|
@@ -9111,19 +9430,19 @@ function KeyboardShortcutsDialog({
|
|
|
9111
9430
|
messages: messagesProp
|
|
9112
9431
|
} = {}) {
|
|
9113
9432
|
const messages = useDsMessages("keyboardShortcuts", messagesProp);
|
|
9114
|
-
const [internalOpen, setInternalOpen] =
|
|
9433
|
+
const [internalOpen, setInternalOpen] = React45.useState(defaultOpen);
|
|
9115
9434
|
const isControlled = controlledOpen !== void 0;
|
|
9116
9435
|
const open = isControlled ? controlledOpen : internalOpen;
|
|
9117
|
-
const openRef =
|
|
9436
|
+
const openRef = React45.useRef(open);
|
|
9118
9437
|
openRef.current = open;
|
|
9119
|
-
const setOpen =
|
|
9438
|
+
const setOpen = React45.useCallback(
|
|
9120
9439
|
(value) => {
|
|
9121
9440
|
if (!isControlled) setInternalOpen(value);
|
|
9122
9441
|
onOpenChange?.(value);
|
|
9123
9442
|
},
|
|
9124
9443
|
[isControlled, onOpenChange]
|
|
9125
9444
|
);
|
|
9126
|
-
|
|
9445
|
+
React45.useEffect(() => {
|
|
9127
9446
|
if (hotkey === null) return;
|
|
9128
9447
|
function handleKeyDown(e) {
|
|
9129
9448
|
const target = e.target;
|
|
@@ -9162,7 +9481,7 @@ function KeyboardShortcutsDialog({
|
|
|
9162
9481
|
className: "ds:flex ds:items-center ds:justify-between ds:gap-3 ds:py-1",
|
|
9163
9482
|
children: [
|
|
9164
9483
|
/* @__PURE__ */ jsx("span", { className: "ds:text-fg ds:text-sm", children: shortcut.description }),
|
|
9165
|
-
/* @__PURE__ */ jsx("div", { className: "ds:flex ds:shrink-0 ds:items-center ds:gap-1", children: shortcut.keys.map((key, i) => /* @__PURE__ */ jsxs(
|
|
9484
|
+
/* @__PURE__ */ jsx("div", { className: "ds:flex ds:shrink-0 ds:items-center ds:gap-1", children: shortcut.keys.map((key, i) => /* @__PURE__ */ jsxs(React45.Fragment, { children: [
|
|
9166
9485
|
i > 0 && /* @__PURE__ */ jsx("span", { className: "ds:text-fg-4 ds:mx-0.5 ds:text-[11px]", children: messages.then }),
|
|
9167
9486
|
/* @__PURE__ */ jsx(Kbd, { children: key })
|
|
9168
9487
|
] }, i)) })
|
|
@@ -9183,7 +9502,7 @@ function KeyboardShortcutsDialog({
|
|
|
9183
9502
|
var labelVariants = cva(
|
|
9184
9503
|
"ds:text-[13px] ds:font-medium ds:leading-none ds:text-fg ds:select-none ds:peer-disabled:cursor-not-allowed ds:peer-disabled:text-fg-disabled ds:has-[+input:disabled]:text-fg-disabled"
|
|
9185
9504
|
);
|
|
9186
|
-
var Label4 =
|
|
9505
|
+
var Label4 = React45.forwardRef(
|
|
9187
9506
|
function Label5({ children, required, className, id, htmlFor, onClick, ...props }, ref) {
|
|
9188
9507
|
const field = useFieldContext();
|
|
9189
9508
|
const fieldLabelId = useFieldPart("label", id, field !== null);
|
|
@@ -9543,18 +9862,28 @@ var MasterDetailLayout = forwardRef(
|
|
|
9543
9862
|
ref,
|
|
9544
9863
|
"data-detail-open": detailOpen ? "true" : "false",
|
|
9545
9864
|
className: cn(
|
|
9546
|
-
|
|
9865
|
+
// `isolate`: the mobile detail overlay stacks inside this root, so it
|
|
9866
|
+
// no longer borrows the global `--z-modal` layer for an in-flow pane.
|
|
9867
|
+
"ds:bg-surface ds:relative ds:isolate ds:flex ds:h-full ds:min-h-0 ds:w-full ds:overflow-hidden",
|
|
9547
9868
|
className
|
|
9548
9869
|
),
|
|
9549
|
-
style: {
|
|
9870
|
+
style: {
|
|
9871
|
+
"--ds-master-detail-list-width": resolvedWidth,
|
|
9872
|
+
// The name this component has carried since W0-22; consumers may
|
|
9873
|
+
// have set it directly, so it stays written and stays the
|
|
9874
|
+
// fallback of the `--ds-*` hook (C-DOM-03).
|
|
9875
|
+
"--master-list-width": resolvedWidth,
|
|
9876
|
+
...style
|
|
9877
|
+
},
|
|
9550
9878
|
...props,
|
|
9551
9879
|
children: [
|
|
9552
9880
|
/* @__PURE__ */ jsx(
|
|
9553
9881
|
"div",
|
|
9554
9882
|
{
|
|
9555
9883
|
className: cn(
|
|
9556
|
-
"ds:bg-surface ds:flex ds:min-h-0 ds:
|
|
9557
|
-
"ds:md:w-
|
|
9884
|
+
"ds:bg-surface ds:flex ds:min-h-0 ds:flex-col ds:overflow-auto",
|
|
9885
|
+
"ds:max-md:w-full",
|
|
9886
|
+
"ds:md:w-[var(--ds-master-detail-list-width,var(--master-list-width))] ds:md:shrink-0 ds:md:border-rule ds:md:border-r"
|
|
9558
9887
|
),
|
|
9559
9888
|
children: list
|
|
9560
9889
|
}
|
|
@@ -9565,12 +9894,15 @@ var MasterDetailLayout = forwardRef(
|
|
|
9565
9894
|
className: cn(
|
|
9566
9895
|
"ds:bg-surface-2 ds:flex ds:min-h-0 ds:flex-col ds:overflow-auto",
|
|
9567
9896
|
// mobile: overlay the list and slide in from the right
|
|
9568
|
-
|
|
9897
|
+
// No z-index: the root is an isolated stacking context and this
|
|
9898
|
+
// positioned pane is the later sibling, so it paints above the
|
|
9899
|
+
// static list pane on its own.
|
|
9900
|
+
"ds:max-md:absolute ds:max-md:inset-0",
|
|
9569
9901
|
"ds:max-md:transition-transform ds:max-md:duration-[var(--duration-normal)] ds:max-md:ease-[var(--ease-out-quart)]",
|
|
9570
9902
|
"ds:motion-reduce:transition-none",
|
|
9571
9903
|
detailOpen ? "ds:max-md:translate-x-0" : "ds:max-md:pointer-events-none ds:max-md:translate-x-full",
|
|
9572
9904
|
// desktop: reset to a static, independently-scrolling flex column
|
|
9573
|
-
"ds:md:static ds:md:
|
|
9905
|
+
"ds:md:static ds:md:flex-1 ds:md:translate-x-0 ds:md:transition-none ds:md:pointer-events-auto"
|
|
9574
9906
|
),
|
|
9575
9907
|
children: [
|
|
9576
9908
|
onBack && /* @__PURE__ */ jsx("div", { className: "ds:border-rule ds:bg-surface ds:sticky ds:top-0 ds:z-[var(--z-sticky)] ds:flex ds:h-12 ds:shrink-0 ds:items-center ds:border-b ds:px-2 ds:md:hidden", children: /* @__PURE__ */ jsx(
|
|
@@ -9764,7 +10096,7 @@ function MultiSelectField({
|
|
|
9764
10096
|
size = "md",
|
|
9765
10097
|
id
|
|
9766
10098
|
}) {
|
|
9767
|
-
const selected =
|
|
10099
|
+
const selected = React45.useMemo(
|
|
9768
10100
|
() => new Set(value ? value.split(",").filter(Boolean) : []),
|
|
9769
10101
|
[value]
|
|
9770
10102
|
);
|
|
@@ -9777,7 +10109,7 @@ function MultiSelectField({
|
|
|
9777
10109
|
}
|
|
9778
10110
|
onChange(Array.from(next).join(","));
|
|
9779
10111
|
};
|
|
9780
|
-
const generatedId =
|
|
10112
|
+
const generatedId = React45.useId();
|
|
9781
10113
|
const groupId = id ?? generatedId;
|
|
9782
10114
|
return /* @__PURE__ */ jsxs("div", { className: cn("ds:w-full", className), children: [
|
|
9783
10115
|
/* @__PURE__ */ jsx(
|
|
@@ -10160,7 +10492,7 @@ function OTPInput({
|
|
|
10160
10492
|
"aria-labelledby": ariaLabelledBy,
|
|
10161
10493
|
"aria-describedby": ariaDescribedBy
|
|
10162
10494
|
});
|
|
10163
|
-
const inputRef =
|
|
10495
|
+
const inputRef = React45.useRef(null);
|
|
10164
10496
|
useFormReset(inputRef, () => setValue(defaultValue ?? ""), wiring.name, form);
|
|
10165
10497
|
const errorId = `${wiring.id}-error`;
|
|
10166
10498
|
const hasError = wiring["aria-invalid"] === true;
|
|
@@ -10274,23 +10606,38 @@ var PAGE_BUTTON_BASE = cn(
|
|
|
10274
10606
|
"ds:transition-colors ds:duration-[var(--duration-fast)] ds:ease-[var(--ease-out-quart)] ds:motion-reduce:transition-none",
|
|
10275
10607
|
"ds:focus-visible:outline-none ds:focus-visible:[box-shadow:var(--shadow-focus-ring)]"
|
|
10276
10608
|
);
|
|
10609
|
+
var noop2 = () => {
|
|
10610
|
+
};
|
|
10277
10611
|
var Pagination = forwardRef(function Pagination2({
|
|
10278
|
-
|
|
10279
|
-
|
|
10280
|
-
onPageChange,
|
|
10612
|
+
page: pageProp,
|
|
10613
|
+
pageCount: pageCountProp,
|
|
10614
|
+
onPageChange = noop2,
|
|
10281
10615
|
siblingCount = 1,
|
|
10282
10616
|
totalItems,
|
|
10283
10617
|
pageSize,
|
|
10618
|
+
pageSizeOptions,
|
|
10619
|
+
onPageSizeChange,
|
|
10620
|
+
hideOnSinglePage = true,
|
|
10284
10621
|
messages: messagesProp,
|
|
10622
|
+
currentPage: legacyCurrentPage,
|
|
10623
|
+
totalPages: legacyTotalPages,
|
|
10285
10624
|
className,
|
|
10286
10625
|
...props
|
|
10287
10626
|
}, ref) {
|
|
10288
10627
|
const messages = useDsMessages("pagination", messagesProp);
|
|
10289
|
-
|
|
10628
|
+
const currentPage = pageProp ?? legacyCurrentPage ?? 1;
|
|
10629
|
+
const derivedPageCount = totalItems != null && pageSize != null && pageSize > 0 ? Math.max(1, Math.ceil(totalItems / pageSize)) : 1;
|
|
10630
|
+
const totalPages = pageCountProp ?? legacyTotalPages ?? derivedPageCount;
|
|
10631
|
+
const sizeOptions = useMemo(
|
|
10632
|
+
() => (pageSizeOptions ?? []).map((size) => ({ value: String(size), label: String(size) })),
|
|
10633
|
+
[pageSizeOptions]
|
|
10634
|
+
);
|
|
10635
|
+
const showPageSize = sizeOptions.length > 0 && onPageSizeChange != null;
|
|
10636
|
+
if (hideOnSinglePage && totalPages <= 1 && !showPageSize) return null;
|
|
10290
10637
|
const pages = getPageNumbers(currentPage, totalPages, siblingCount);
|
|
10291
10638
|
let contextLabel;
|
|
10292
10639
|
if (totalItems != null && pageSize != null) {
|
|
10293
|
-
const start = (currentPage - 1) * pageSize + 1;
|
|
10640
|
+
const start = totalItems === 0 ? 0 : (currentPage - 1) * pageSize + 1;
|
|
10294
10641
|
const end = Math.min(currentPage * pageSize, totalItems);
|
|
10295
10642
|
contextLabel = messages.range(start, end, totalItems);
|
|
10296
10643
|
} else {
|
|
@@ -10313,6 +10660,27 @@ var Pagination = forwardRef(function Pagination2({
|
|
|
10313
10660
|
children: contextLabel
|
|
10314
10661
|
}
|
|
10315
10662
|
),
|
|
10663
|
+
showPageSize && /* @__PURE__ */ jsxs(
|
|
10664
|
+
"div",
|
|
10665
|
+
{
|
|
10666
|
+
...slot(paginationAnatomy, "page-size"),
|
|
10667
|
+
className: "ds:flex ds:shrink-0 ds:items-center ds:gap-2",
|
|
10668
|
+
children: [
|
|
10669
|
+
/* @__PURE__ */ jsx("span", { className: "ds:text-fg-4 ds:text-xs", children: messages.rowsPerPage }),
|
|
10670
|
+
/* @__PURE__ */ jsx(
|
|
10671
|
+
Select,
|
|
10672
|
+
{
|
|
10673
|
+
size: "sm",
|
|
10674
|
+
options: sizeOptions,
|
|
10675
|
+
value: pageSize != null ? String(pageSize) : void 0,
|
|
10676
|
+
onValueChange: (value) => onPageSizeChange?.(Number(value)),
|
|
10677
|
+
"aria-label": messages.rowsPerPage,
|
|
10678
|
+
className: "ds:w-auto ds:min-w-18"
|
|
10679
|
+
}
|
|
10680
|
+
)
|
|
10681
|
+
]
|
|
10682
|
+
}
|
|
10683
|
+
),
|
|
10316
10684
|
/* @__PURE__ */ jsxs("div", { ...slot(paginationAnatomy, "pages"), className: "ds:flex ds:items-center ds:gap-0.5", children: [
|
|
10317
10685
|
/* @__PURE__ */ jsx(
|
|
10318
10686
|
"button",
|
|
@@ -10373,6 +10741,22 @@ var Pagination = forwardRef(function Pagination2({
|
|
|
10373
10741
|
);
|
|
10374
10742
|
});
|
|
10375
10743
|
Pagination.displayName = "Pagination";
|
|
10744
|
+
var DataTablePagination = forwardRef(
|
|
10745
|
+
function DataTablePagination2({ page, totalItems, pageSize = 25, current, total, className, ...props }, ref) {
|
|
10746
|
+
return /* @__PURE__ */ jsx(
|
|
10747
|
+
Pagination,
|
|
10748
|
+
{
|
|
10749
|
+
ref,
|
|
10750
|
+
page: page ?? current,
|
|
10751
|
+
totalItems: totalItems ?? total ?? 0,
|
|
10752
|
+
pageSize,
|
|
10753
|
+
className: cn("ds:mt-4", className),
|
|
10754
|
+
...props
|
|
10755
|
+
}
|
|
10756
|
+
);
|
|
10757
|
+
}
|
|
10758
|
+
);
|
|
10759
|
+
DataTablePagination.displayName = "DataTablePagination";
|
|
10376
10760
|
var previewVariants = cva("ds:bg-surface ds:flex ds:min-h-0 ds:flex-col ds:overflow-hidden", {
|
|
10377
10761
|
variants: {
|
|
10378
10762
|
variant: {
|
|
@@ -11302,7 +11686,7 @@ var CREATE_ITEM_CLASSES = cn(
|
|
|
11302
11686
|
var GROUP_HEADING_CLASSES = groupHeadingClasses({ palette: "neutral", labelSize: SMALL_TEXT });
|
|
11303
11687
|
var STATE_CLASSES = cn("ds:text-fg-3 ds:px-3 ds:py-2", SMALL_TEXT);
|
|
11304
11688
|
var CREATE_ROW = "\0create";
|
|
11305
|
-
var CmdkCompatContext =
|
|
11689
|
+
var CmdkCompatContext = React45.createContext(false);
|
|
11306
11690
|
function Combobox(props) {
|
|
11307
11691
|
const {
|
|
11308
11692
|
options: items,
|
|
@@ -11350,7 +11734,7 @@ function Combobox(props) {
|
|
|
11350
11734
|
const closeOnSelect = props.closeOnSelect ?? !multiple;
|
|
11351
11735
|
const hideSelected = props.multiple === true && props.hideSelected === true;
|
|
11352
11736
|
const messages = useDsMessages("combobox", messagesProp);
|
|
11353
|
-
const accessors =
|
|
11737
|
+
const accessors = React45.useMemo(() => {
|
|
11354
11738
|
if (!getOptionValue || !getOptionLabel) return void 0;
|
|
11355
11739
|
return {
|
|
11356
11740
|
getOptionValue,
|
|
@@ -11360,7 +11744,7 @@ function Combobox(props) {
|
|
|
11360
11744
|
getOptionKeywords
|
|
11361
11745
|
};
|
|
11362
11746
|
}, [getOptionValue, getOptionLabel, getOptionDisabled, getOptionGroup, getOptionKeywords]);
|
|
11363
|
-
const options =
|
|
11747
|
+
const options = React45.useMemo(() => toOptions(items, accessors), [items, accessors]);
|
|
11364
11748
|
const wiring = useFieldControl({
|
|
11365
11749
|
id: idProp,
|
|
11366
11750
|
name: nameProp,
|
|
@@ -11382,7 +11766,7 @@ function Combobox(props) {
|
|
|
11382
11766
|
const single = normalizeSingleValue(raw);
|
|
11383
11767
|
return single === null ? [] : [single];
|
|
11384
11768
|
};
|
|
11385
|
-
const defaultSelection =
|
|
11769
|
+
const defaultSelection = React45.useMemo(
|
|
11386
11770
|
() => toSelection(props.defaultValue) ?? [],
|
|
11387
11771
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- read once, like a default should be
|
|
11388
11772
|
[]
|
|
@@ -11403,15 +11787,15 @@ function Combobox(props) {
|
|
|
11403
11787
|
defaultProp: defaultSearch,
|
|
11404
11788
|
onChange: onSearchChange
|
|
11405
11789
|
});
|
|
11406
|
-
const selectedOption =
|
|
11407
|
-
const selectedOptions =
|
|
11790
|
+
const selectedOption = React45.useMemo(() => findOption(options, value), [options, value]);
|
|
11791
|
+
const selectedOptions = React45.useMemo(
|
|
11408
11792
|
() => selection.map((entry) => findOption(options, entry)).filter((option) => option !== void 0),
|
|
11409
11793
|
[options, selection]
|
|
11410
11794
|
);
|
|
11411
|
-
const inputRef =
|
|
11412
|
-
const controlRef =
|
|
11795
|
+
const inputRef = React45.useRef(null);
|
|
11796
|
+
const controlRef = React45.useRef(null);
|
|
11413
11797
|
const mergedInputRef = useMergedRefs(inputRef, ref, wiring.ref);
|
|
11414
|
-
const commitSelection =
|
|
11798
|
+
const commitSelection = React45.useCallback(
|
|
11415
11799
|
(next, option) => {
|
|
11416
11800
|
setSelectionState(next);
|
|
11417
11801
|
const changed = next.length !== selection.length || next.some((entry, index) => entry !== selection[index]);
|
|
@@ -11422,18 +11806,18 @@ function Combobox(props) {
|
|
|
11422
11806
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- `props` is read for the discriminant
|
|
11423
11807
|
[setSelectionState, selection, props.multiple, props.onValueChange]
|
|
11424
11808
|
);
|
|
11425
|
-
const setValue =
|
|
11809
|
+
const setValue = React45.useCallback(
|
|
11426
11810
|
(next) => commitSelection(next === null ? [] : [next], findOption(options, next) ?? null),
|
|
11427
11811
|
[commitSelection, options]
|
|
11428
11812
|
);
|
|
11429
|
-
const removeValue =
|
|
11813
|
+
const removeValue = React45.useCallback(
|
|
11430
11814
|
(entry) => commitSelection(
|
|
11431
11815
|
selection.filter((current) => current !== entry),
|
|
11432
11816
|
findOption(options, entry) ?? null
|
|
11433
11817
|
),
|
|
11434
11818
|
[commitSelection, selection, options]
|
|
11435
11819
|
);
|
|
11436
|
-
const setOpen =
|
|
11820
|
+
const setOpen = React45.useCallback(
|
|
11437
11821
|
(next) => {
|
|
11438
11822
|
if (next && inert) return;
|
|
11439
11823
|
setOpenState(next);
|
|
@@ -11442,39 +11826,39 @@ function Combobox(props) {
|
|
|
11442
11826
|
[inert, setOpenState, setSearchState]
|
|
11443
11827
|
);
|
|
11444
11828
|
const trimmed = search.trim();
|
|
11445
|
-
const visibleOptions =
|
|
11829
|
+
const visibleOptions = React45.useMemo(() => {
|
|
11446
11830
|
const filtered = shouldFilter ? filterOptions(options, search) : options;
|
|
11447
11831
|
return hideSelected ? filtered.filter((option) => !selection.includes(option.value)) : filtered;
|
|
11448
11832
|
}, [options, search, shouldFilter, hideSelected, selection]);
|
|
11449
11833
|
const showCreate = onCreate !== void 0 && trimmed.length > 0 && !options.some((option) => foldForMatch(option.label) === foldForMatch(trimmed));
|
|
11450
|
-
const groups =
|
|
11834
|
+
const groups = React45.useMemo(() => groupOptions(visibleOptions), [visibleOptions]);
|
|
11451
11835
|
const hasGroups = groups.some((group) => group.group !== void 0);
|
|
11452
|
-
const rows =
|
|
11836
|
+
const rows = React45.useMemo(() => {
|
|
11453
11837
|
const list = groups.flatMap((group) => group.options);
|
|
11454
11838
|
if (showCreate) list.push({ value: CREATE_ROW, label: messages.create(trimmed) });
|
|
11455
11839
|
return list;
|
|
11456
11840
|
}, [groups, showCreate, messages, trimmed]);
|
|
11457
|
-
const [highlightedValue, setHighlightedValue] =
|
|
11841
|
+
const [highlightedValue, setHighlightedValue] = React45.useState(null);
|
|
11458
11842
|
const highlightedIndex = indexOfValue(rows, highlightedValue);
|
|
11459
|
-
|
|
11843
|
+
React45.useEffect(() => {
|
|
11460
11844
|
if (!open) return;
|
|
11461
11845
|
setHighlightedValue((current) => reconcileHighlight(rows, current, "first"));
|
|
11462
11846
|
}, [open, rows]);
|
|
11463
|
-
const openList =
|
|
11847
|
+
const openList = React45.useCallback(() => {
|
|
11464
11848
|
if (open) return;
|
|
11465
11849
|
setHighlightedValue(value !== null && findOption(rows, value) ? value : null);
|
|
11466
11850
|
setOpen(true);
|
|
11467
11851
|
}, [open, rows, setOpen, value]);
|
|
11468
|
-
const scrollHighlightedIntoView =
|
|
11852
|
+
const scrollHighlightedIntoView = React45.useCallback(() => {
|
|
11469
11853
|
const id = activeDescendantId(listId, rows, highlightedIndex);
|
|
11470
11854
|
if (!id) return;
|
|
11471
11855
|
document.getElementById(id)?.scrollIntoView({ block: "nearest" });
|
|
11472
11856
|
}, [listId, rows, highlightedIndex]);
|
|
11473
|
-
|
|
11857
|
+
React45.useEffect(() => {
|
|
11474
11858
|
if (open) scrollHighlightedIntoView();
|
|
11475
11859
|
}, [open, scrollHighlightedIntoView]);
|
|
11476
11860
|
const focusInput = () => inputRef.current?.focus();
|
|
11477
|
-
const activateRow =
|
|
11861
|
+
const activateRow = React45.useCallback(
|
|
11478
11862
|
(option) => {
|
|
11479
11863
|
if (option.disabled) return;
|
|
11480
11864
|
if (option.value === CREATE_ROW) {
|
|
@@ -11560,7 +11944,7 @@ function Combobox(props) {
|
|
|
11560
11944
|
option.value
|
|
11561
11945
|
)) : null;
|
|
11562
11946
|
const hasChips = props.multiple === true && selectedOptions.length > 0;
|
|
11563
|
-
const cmdkCompat =
|
|
11947
|
+
const cmdkCompat = React45.useContext(CmdkCompatContext);
|
|
11564
11948
|
const buttonSize = BUTTON_SIZE[size];
|
|
11565
11949
|
const indexByValue = new Map(rows.map((row, index) => [row.value, index]));
|
|
11566
11950
|
const renderRow = (option) => {
|
|
@@ -12571,11 +12955,11 @@ function useFormReset2(elementRef, onReset, form) {
|
|
|
12571
12955
|
return () => owner.removeEventListener("reset", handle);
|
|
12572
12956
|
}, [elementRef, form]);
|
|
12573
12957
|
}
|
|
12574
|
-
var RadioGroupContext =
|
|
12958
|
+
var RadioGroupContext = React45.createContext({
|
|
12575
12959
|
appearance: "plain",
|
|
12576
12960
|
invalid: false
|
|
12577
12961
|
});
|
|
12578
|
-
var RadioGroup3 =
|
|
12962
|
+
var RadioGroup3 = React45.forwardRef(function RadioGroup4({
|
|
12579
12963
|
className,
|
|
12580
12964
|
appearance = "plain",
|
|
12581
12965
|
invalid,
|
|
@@ -12607,12 +12991,12 @@ var RadioGroup3 = React44.forwardRef(function RadioGroup4({
|
|
|
12607
12991
|
defaultProp: defaultValue ?? null,
|
|
12608
12992
|
onChange: onValueChange
|
|
12609
12993
|
});
|
|
12610
|
-
const initialValue =
|
|
12611
|
-
const rootRef =
|
|
12994
|
+
const initialValue = React45.useRef(valueProp ?? defaultValue ?? null);
|
|
12995
|
+
const rootRef = React45.useRef(null);
|
|
12612
12996
|
useFormReset2(rootRef, () => setValue(initialValue.current));
|
|
12613
12997
|
const mergedRef = useMergedRefs(ref, rootRef);
|
|
12614
12998
|
const isInvalid = wiring["aria-invalid"] === true;
|
|
12615
|
-
const context =
|
|
12999
|
+
const context = React45.useMemo(
|
|
12616
13000
|
() => ({ appearance, invalid: isInvalid }),
|
|
12617
13001
|
[appearance, isInvalid]
|
|
12618
13002
|
);
|
|
@@ -12648,7 +13032,7 @@ var ITEM_CLASSES2 = cn(
|
|
|
12648
13032
|
"ds:disabled:bg-bg-disabled ds:disabled:border-rule ds:disabled:cursor-not-allowed",
|
|
12649
13033
|
"ds:aria-[invalid=true]:border-danger-line"
|
|
12650
13034
|
);
|
|
12651
|
-
var RadioGroupItem =
|
|
13035
|
+
var RadioGroupItem = React45.forwardRef(function RadioGroupItem2({
|
|
12652
13036
|
className,
|
|
12653
13037
|
label,
|
|
12654
13038
|
description,
|
|
@@ -12657,9 +13041,9 @@ var RadioGroupItem = React44.forwardRef(function RadioGroupItem2({
|
|
|
12657
13041
|
"aria-invalid": ariaInvalid,
|
|
12658
13042
|
...props
|
|
12659
13043
|
}, ref) {
|
|
12660
|
-
const generatedId =
|
|
13044
|
+
const generatedId = React45.useId();
|
|
12661
13045
|
const id = providedId ?? generatedId;
|
|
12662
|
-
const { appearance, invalid } =
|
|
13046
|
+
const { appearance, invalid } = React45.useContext(RadioGroupContext);
|
|
12663
13047
|
const card = appearance === "card";
|
|
12664
13048
|
const descriptionId = card && description ? `${id}-description` : void 0;
|
|
12665
13049
|
const root = /* @__PURE__ */ jsx(
|
|
@@ -12792,19 +13176,19 @@ function ResponsiveDialog({
|
|
|
12792
13176
|
side,
|
|
12793
13177
|
size = "md"
|
|
12794
13178
|
}) {
|
|
12795
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
13179
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React45.useState(defaultOpen);
|
|
12796
13180
|
const controlled = open !== void 0;
|
|
12797
13181
|
const isOpen = controlled ? open : uncontrolledOpen;
|
|
12798
|
-
const handleOpenChange =
|
|
13182
|
+
const handleOpenChange = React45.useCallback(
|
|
12799
13183
|
(next) => {
|
|
12800
13184
|
if (!controlled) setUncontrolledOpen(next);
|
|
12801
13185
|
onOpenChange?.(next);
|
|
12802
13186
|
},
|
|
12803
13187
|
[controlled, onOpenChange]
|
|
12804
13188
|
);
|
|
12805
|
-
const close =
|
|
13189
|
+
const close = React45.useCallback(() => handleOpenChange(false), [handleOpenChange]);
|
|
12806
13190
|
const hasTitle = title !== void 0 && title !== null && title !== "";
|
|
12807
|
-
|
|
13191
|
+
React45.useEffect(() => {
|
|
12808
13192
|
if (process.env.NODE_ENV === "production" || process.env.NODE_ENV === "test") return;
|
|
12809
13193
|
if (!hasTitle) {
|
|
12810
13194
|
errorOnce(
|
|
@@ -12855,7 +13239,7 @@ var RouteTransition = forwardRef(
|
|
|
12855
13239
|
}
|
|
12856
13240
|
);
|
|
12857
13241
|
RouteTransition.displayName = "RouteTransition";
|
|
12858
|
-
var ScrollArea =
|
|
13242
|
+
var ScrollArea = React45.forwardRef(function ScrollArea2({ className, children, ...props }, ref) {
|
|
12859
13243
|
return /* @__PURE__ */ jsxs(
|
|
12860
13244
|
ScrollAreaPrimitive.Root,
|
|
12861
13245
|
{
|
|
@@ -12878,7 +13262,7 @@ var ScrollArea = React44.forwardRef(function ScrollArea2({ className, children,
|
|
|
12878
13262
|
);
|
|
12879
13263
|
});
|
|
12880
13264
|
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
12881
|
-
var ScrollBar =
|
|
13265
|
+
var ScrollBar = React45.forwardRef(function ScrollBar2({ className, orientation = "vertical", ...props }, ref) {
|
|
12882
13266
|
return /* @__PURE__ */ jsx(
|
|
12883
13267
|
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
|
12884
13268
|
{
|
|
@@ -12947,7 +13331,7 @@ function searchInputVariants({
|
|
|
12947
13331
|
class: cn(SEARCH_RESET, row, classProp, className) || void 0
|
|
12948
13332
|
});
|
|
12949
13333
|
}
|
|
12950
|
-
var SearchInput =
|
|
13334
|
+
var SearchInput = React45.forwardRef(
|
|
12951
13335
|
function SearchInput2({
|
|
12952
13336
|
value,
|
|
12953
13337
|
onValueChange,
|
|
@@ -12979,20 +13363,20 @@ var SearchInput = React44.forwardRef(
|
|
|
12979
13363
|
"aria-labelledby": ariaLabelledBy,
|
|
12980
13364
|
"aria-describedby": ariaDescribedBy
|
|
12981
13365
|
});
|
|
12982
|
-
const inputRef =
|
|
13366
|
+
const inputRef = React45.useRef(null);
|
|
12983
13367
|
const setRefs = useMergedRefs(ref, wiringRef, inputRef);
|
|
12984
13368
|
const debouncedValue = useDebounce(value, debounceMs);
|
|
12985
|
-
const isFirstRender =
|
|
12986
|
-
|
|
13369
|
+
const isFirstRender = React45.useRef(true);
|
|
13370
|
+
React45.useEffect(() => {
|
|
12987
13371
|
if (isFirstRender.current) {
|
|
12988
13372
|
isFirstRender.current = false;
|
|
12989
13373
|
return;
|
|
12990
13374
|
}
|
|
12991
13375
|
onSearch?.(debouncedValue);
|
|
12992
13376
|
}, [debouncedValue, onSearch]);
|
|
12993
|
-
const latestChange =
|
|
13377
|
+
const latestChange = React45.useRef(onValueChange);
|
|
12994
13378
|
latestChange.current = onValueChange;
|
|
12995
|
-
|
|
13379
|
+
React45.useEffect(() => {
|
|
12996
13380
|
const owner = inputRef.current?.form;
|
|
12997
13381
|
if (!owner) return;
|
|
12998
13382
|
const handle = () => latestChange.current("");
|
|
@@ -13128,20 +13512,20 @@ function SearchSelect({
|
|
|
13128
13512
|
const createNewLabel = createNewLabelProp ?? copy.createNew;
|
|
13129
13513
|
const isSingleMode = value !== void 0 || onValueChange !== void 0;
|
|
13130
13514
|
const closeOnSelect = isSingleMode || closeOnSelectProp;
|
|
13131
|
-
const byId =
|
|
13515
|
+
const byId = React45.useMemo(() => new Map(options.map((o) => [o.id, o])), [options]);
|
|
13132
13516
|
const singleSelectedOption = isSingleMode && value ? byId.get(value) ?? null : null;
|
|
13133
|
-
const selected =
|
|
13517
|
+
const selected = React45.useMemo(
|
|
13134
13518
|
() => isSingleMode ? singleSelectedOption ? [singleSelectedOption] : [] : selectedProp ?? [],
|
|
13135
13519
|
[isSingleMode, singleSelectedOption, selectedProp]
|
|
13136
13520
|
);
|
|
13137
|
-
const selectedIds =
|
|
13138
|
-
const [open, setOpen] =
|
|
13139
|
-
const [search, setSearch] =
|
|
13140
|
-
const [activeChip, setActiveChip] =
|
|
13141
|
-
const hasGroups =
|
|
13142
|
-
const hasLeadingDot =
|
|
13143
|
-
const pinnedSet =
|
|
13144
|
-
const chips =
|
|
13521
|
+
const selectedIds = React45.useMemo(() => selected.map((s) => s.id), [selected]);
|
|
13522
|
+
const [open, setOpen] = React45.useState(false);
|
|
13523
|
+
const [search, setSearch] = React45.useState("");
|
|
13524
|
+
const [activeChip, setActiveChip] = React45.useState(null);
|
|
13525
|
+
const hasGroups = React45.useMemo(() => options.some((o) => o.group != null), [options]);
|
|
13526
|
+
const hasLeadingDot = React45.useMemo(() => options.some((o) => !!o.color), [options]);
|
|
13527
|
+
const pinnedSet = React45.useMemo(() => new Set(pinnedGroups ?? []), [pinnedGroups]);
|
|
13528
|
+
const chips = React45.useMemo(() => {
|
|
13145
13529
|
if (!groupFilter || !hasGroups) return [];
|
|
13146
13530
|
const seen = [];
|
|
13147
13531
|
for (const option of options) {
|
|
@@ -13153,7 +13537,7 @@ function SearchSelect({
|
|
|
13153
13537
|
}, [groupFilter, hasGroups, options, pinnedSet]);
|
|
13154
13538
|
const chipActive = chips.length > 0 && activeChip !== null;
|
|
13155
13539
|
const trimmed = search.trim();
|
|
13156
|
-
const groupCounts =
|
|
13540
|
+
const groupCounts = React45.useMemo(() => {
|
|
13157
13541
|
const counts = /* @__PURE__ */ new Map();
|
|
13158
13542
|
if (!showGroupCounts || trimmed) return counts;
|
|
13159
13543
|
for (const option of options) {
|
|
@@ -13163,7 +13547,7 @@ function SearchSelect({
|
|
|
13163
13547
|
}
|
|
13164
13548
|
return counts;
|
|
13165
13549
|
}, [showGroupCounts, trimmed, options, selectedIds]);
|
|
13166
|
-
const rows =
|
|
13550
|
+
const rows = React45.useMemo(
|
|
13167
13551
|
() => options.filter((option) => !chipActive || option.group === activeChip).map((option) => {
|
|
13168
13552
|
const heading = chipActive ? void 0 : option.group ?? void 0;
|
|
13169
13553
|
const count = heading ? groupCounts.get(heading) : void 0;
|
|
@@ -13186,7 +13570,7 @@ function SearchSelect({
|
|
|
13186
13570
|
};
|
|
13187
13571
|
const singleValue = closeOnSelect ? selected[0] ?? null : null;
|
|
13188
13572
|
const showValue = singleValue !== null && !open;
|
|
13189
|
-
const renderValue =
|
|
13573
|
+
const renderValue = React45.useCallback(
|
|
13190
13574
|
(row) => {
|
|
13191
13575
|
const source = sourceOf(row);
|
|
13192
13576
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -13215,7 +13599,7 @@ function SearchSelect({
|
|
|
13215
13599
|
},
|
|
13216
13600
|
[descriptionVariant]
|
|
13217
13601
|
);
|
|
13218
|
-
const messages =
|
|
13602
|
+
const messages = React45.useMemo(
|
|
13219
13603
|
() => ({
|
|
13220
13604
|
empty: search ? copy.empty : copy.noOptions,
|
|
13221
13605
|
clear: singleValue ? copy.clearNamed(singleValue.label) : copy.clear,
|
|
@@ -13476,7 +13860,7 @@ var SegmentedProgress = forwardRef(
|
|
|
13476
13860
|
}
|
|
13477
13861
|
);
|
|
13478
13862
|
SegmentedProgress.displayName = "SegmentedProgress";
|
|
13479
|
-
var Separator4 =
|
|
13863
|
+
var Separator4 = React45.forwardRef(function Separator5({ className, orientation = "horizontal", decorative = true, ...props }, ref) {
|
|
13480
13864
|
return /* @__PURE__ */ jsx(
|
|
13481
13865
|
SeparatorPrimitive.Root,
|
|
13482
13866
|
{
|
|
@@ -13493,13 +13877,13 @@ var Separator4 = React44.forwardRef(function Separator5({ className, orientation
|
|
|
13493
13877
|
);
|
|
13494
13878
|
});
|
|
13495
13879
|
Separator4.displayName = SeparatorPrimitive.Root.displayName;
|
|
13496
|
-
var SheetSideContext =
|
|
13880
|
+
var SheetSideContext = React45.createContext({});
|
|
13497
13881
|
var Sheet = ({ side, children, ...props }) => /* @__PURE__ */ jsx(DialogPrimitive2.Root, { ...props, children: /* @__PURE__ */ jsx(SheetSideContext, { value: { side }, children }) });
|
|
13498
13882
|
Sheet.displayName = "Sheet";
|
|
13499
13883
|
var SheetTrigger = DialogPrimitive2.Trigger;
|
|
13500
13884
|
var SheetClose = DialogPrimitive2.Close;
|
|
13501
13885
|
var SheetPortal = withPortalContainer(DialogPrimitive2.Portal);
|
|
13502
|
-
var SheetOverlay =
|
|
13886
|
+
var SheetOverlay = React45.forwardRef((props, ref) => /* @__PURE__ */ jsx(
|
|
13503
13887
|
Backdrop,
|
|
13504
13888
|
{
|
|
13505
13889
|
as: DialogPrimitive2.Overlay,
|
|
@@ -13517,7 +13901,7 @@ var SHEET_SIZES = {
|
|
|
13517
13901
|
xl: "ds:w-[95vw] ds:max-w-[95vw] ds:sm:w-[var(--ds-sheet-width,760px)]",
|
|
13518
13902
|
full: "ds:w-full ds:max-w-none"
|
|
13519
13903
|
};
|
|
13520
|
-
var SheetContent =
|
|
13904
|
+
var SheetContent = React45.forwardRef(
|
|
13521
13905
|
({
|
|
13522
13906
|
side,
|
|
13523
13907
|
size,
|
|
@@ -13531,12 +13915,12 @@ var SheetContent = React44.forwardRef(
|
|
|
13531
13915
|
style,
|
|
13532
13916
|
...props
|
|
13533
13917
|
}, ref) => {
|
|
13534
|
-
const ctx =
|
|
13918
|
+
const ctx = React45.use(SheetSideContext);
|
|
13535
13919
|
const resolvedSide = side ?? ctx.side ?? "right";
|
|
13536
13920
|
const supportsWidth = resolvedSide === "left" || resolvedSide === "right";
|
|
13537
13921
|
const resolvedSize = size ?? (width === void 0 || width === "default" ? void 0 : width);
|
|
13538
13922
|
const sizeRow = supportsWidth && resolvedSize ? SHEET_SIZES[resolvedSize] : null;
|
|
13539
|
-
const
|
|
13923
|
+
const widthStyle2 = supportsWidth && customWidth ? { width: customWidth, maxWidth: "95vw", ...style } : style;
|
|
13540
13924
|
return /* @__PURE__ */ jsxs(SheetPortal, { children: [
|
|
13541
13925
|
/* @__PURE__ */ jsx(SheetOverlay, {}),
|
|
13542
13926
|
/* @__PURE__ */ jsxs(
|
|
@@ -13550,7 +13934,7 @@ var SheetContent = React44.forwardRef(
|
|
|
13550
13934
|
...stateAttributes({ size: resolvedSize ?? "default" }),
|
|
13551
13935
|
rows: [sizeRow],
|
|
13552
13936
|
className,
|
|
13553
|
-
style:
|
|
13937
|
+
style: widthStyle2,
|
|
13554
13938
|
...props,
|
|
13555
13939
|
children: [
|
|
13556
13940
|
children,
|
|
@@ -13572,15 +13956,15 @@ var SheetContent = React44.forwardRef(
|
|
|
13572
13956
|
SheetContent.displayName = DialogPrimitive2.Content.displayName;
|
|
13573
13957
|
var SheetHeader = (props) => /* @__PURE__ */ jsx(OverlayHeader, { anatomy: sheetAnatomy, layout: "padded", dismissGutter: true, ...props });
|
|
13574
13958
|
SheetHeader.displayName = "SheetHeader";
|
|
13575
|
-
var SheetBody =
|
|
13959
|
+
var SheetBody = React45.forwardRef(
|
|
13576
13960
|
({ padding = "md", ...props }, ref) => /* @__PURE__ */ jsx(OverlayBody, { anatomy: sheetAnatomy, layout: "padded", padding, ref, ...props })
|
|
13577
13961
|
);
|
|
13578
13962
|
SheetBody.displayName = "SheetBody";
|
|
13579
13963
|
var SheetFooter = (props) => /* @__PURE__ */ jsx(OverlayFooter, { anatomy: sheetAnatomy, layout: "padded", ...props });
|
|
13580
13964
|
SheetFooter.displayName = "SheetFooter";
|
|
13581
|
-
var SheetTitle =
|
|
13965
|
+
var SheetTitle = React45.forwardRef((props, ref) => /* @__PURE__ */ jsx(OverlayTitle, { as: DialogPrimitive2.Title, anatomy: sheetAnatomy, ref, ...props }));
|
|
13582
13966
|
SheetTitle.displayName = DialogPrimitive2.Title.displayName;
|
|
13583
|
-
var SheetDescription =
|
|
13967
|
+
var SheetDescription = React45.forwardRef((props, ref) => /* @__PURE__ */ jsx(OverlayDescription, { as: DialogPrimitive2.Description, anatomy: sheetAnatomy, ref, ...props }));
|
|
13584
13968
|
SheetDescription.displayName = DialogPrimitive2.Description.displayName;
|
|
13585
13969
|
var SIDE_DRAWER_WIDTHS = {
|
|
13586
13970
|
sm: "ds:max-w-none ds:w-[420px] ds:max-md:w-[95vw]",
|
|
@@ -13697,7 +14081,7 @@ var THUMB_SIZE = {
|
|
|
13697
14081
|
md: "ds:size-4",
|
|
13698
14082
|
lg: "ds:size-(--control-icon-xl)"
|
|
13699
14083
|
};
|
|
13700
|
-
var Slider =
|
|
14084
|
+
var Slider = React45.forwardRef(
|
|
13701
14085
|
function Slider2({
|
|
13702
14086
|
className,
|
|
13703
14087
|
label,
|
|
@@ -13734,8 +14118,8 @@ var Slider = React44.forwardRef(
|
|
|
13734
14118
|
defaultProp: defaultValue,
|
|
13735
14119
|
onChange: onValueChange
|
|
13736
14120
|
});
|
|
13737
|
-
const initialValue =
|
|
13738
|
-
const rootRef =
|
|
14121
|
+
const initialValue = React45.useRef(valueProp ?? defaultValue);
|
|
14122
|
+
const rootRef = React45.useRef(null);
|
|
13739
14123
|
useFormReset2(rootRef, () => setValue(initialValue.current), form);
|
|
13740
14124
|
const mergedRef = useMergedRefs(ref, rootRef);
|
|
13741
14125
|
const displayValue = (() => {
|
|
@@ -14584,13 +14968,15 @@ var Stepper = forwardRef(function Stepper2({ steps, currentStep, orientation = "
|
|
|
14584
14968
|
});
|
|
14585
14969
|
Stepper.displayName = "Stepper";
|
|
14586
14970
|
var StickyActionBar = forwardRef(
|
|
14587
|
-
function StickyActionBar2({ children, hint, offsetForMobileNav, className, ...props }, ref) {
|
|
14971
|
+
function StickyActionBar2({ children, hint, offsetForMobileNav, mode = "sticky", className, ...props }, ref) {
|
|
14588
14972
|
return /* @__PURE__ */ jsxs(
|
|
14589
14973
|
"div",
|
|
14590
14974
|
{
|
|
14591
14975
|
ref,
|
|
14976
|
+
"data-mode": mode,
|
|
14592
14977
|
className: cn(
|
|
14593
|
-
|
|
14978
|
+
mode === "fixed" ? "ds:fixed" : "ds:sticky",
|
|
14979
|
+
"ds:inset-x-0 ds:z-20 ds:flex ds:flex-wrap ds:items-center ds:gap-3",
|
|
14594
14980
|
"ds:border-t ds:border-rule ds:bg-surface/80 ds:px-4 ds:py-3 ds:backdrop-blur-md ds:sm:px-6",
|
|
14595
14981
|
"ds:supports-[backdrop-filter]:bg-surface/80",
|
|
14596
14982
|
offsetForMobileNav ? "ds:bottom-[calc(3.5rem_+_env(safe-area-inset-bottom))] ds:sm:bottom-0" : "ds:bottom-0",
|
|
@@ -14762,7 +15148,7 @@ var switchThumbVariants = cva(
|
|
|
14762
15148
|
}
|
|
14763
15149
|
}
|
|
14764
15150
|
);
|
|
14765
|
-
var Switch =
|
|
15151
|
+
var Switch = React45.forwardRef(
|
|
14766
15152
|
function Switch2({
|
|
14767
15153
|
label,
|
|
14768
15154
|
size,
|
|
@@ -14796,8 +15182,8 @@ var Switch = React44.forwardRef(
|
|
|
14796
15182
|
defaultProp: defaultChecked ?? false,
|
|
14797
15183
|
onChange: onCheckedChange
|
|
14798
15184
|
});
|
|
14799
|
-
const initialChecked =
|
|
14800
|
-
const rootRef =
|
|
15185
|
+
const initialChecked = React45.useRef(checkedProp ?? defaultChecked ?? false);
|
|
15186
|
+
const rootRef = React45.useRef(null);
|
|
14801
15187
|
useFormReset2(rootRef, () => setChecked(initialChecked.current), form);
|
|
14802
15188
|
const mergedRef = useMergedRefs(ref, rootRef);
|
|
14803
15189
|
const root = /* @__PURE__ */ jsx(
|
|
@@ -14844,16 +15230,53 @@ var Switch = React44.forwardRef(
|
|
|
14844
15230
|
}
|
|
14845
15231
|
);
|
|
14846
15232
|
Switch.displayName = SwitchPrimitive.Root.displayName;
|
|
14847
|
-
var
|
|
15233
|
+
var DEFAULT_TABLE_CONTEXT = { headerStyle: "plain", stickyHeader: false };
|
|
15234
|
+
var TableContext = createContext(DEFAULT_TABLE_CONTEXT);
|
|
15235
|
+
function useOverflowing(target) {
|
|
15236
|
+
const [overflowing, setOverflowing] = useState(false);
|
|
15237
|
+
useEffect(() => {
|
|
15238
|
+
const element = target.current;
|
|
15239
|
+
if (!element || typeof ResizeObserver === "undefined") return;
|
|
15240
|
+
const measure = () => setOverflowing(
|
|
15241
|
+
element.scrollWidth > element.clientWidth + 1 || element.scrollHeight > element.clientHeight + 1
|
|
15242
|
+
);
|
|
15243
|
+
measure();
|
|
15244
|
+
const observer = new ResizeObserver(measure);
|
|
15245
|
+
observer.observe(element);
|
|
15246
|
+
const table = element.firstElementChild;
|
|
15247
|
+
if (table) observer.observe(table);
|
|
15248
|
+
return () => observer.disconnect();
|
|
15249
|
+
}, [target]);
|
|
15250
|
+
return overflowing;
|
|
15251
|
+
}
|
|
15252
|
+
var Table = forwardRef(function Table2({
|
|
15253
|
+
className,
|
|
15254
|
+
wrapperClassName,
|
|
15255
|
+
classNames,
|
|
15256
|
+
headerStyle = "plain",
|
|
15257
|
+
density,
|
|
15258
|
+
stickyHeader = false,
|
|
15259
|
+
messages: messagesOverride,
|
|
15260
|
+
...props
|
|
15261
|
+
}, ref) {
|
|
15262
|
+
const messages = useDsMessages("table", messagesOverride);
|
|
15263
|
+
const wrapperRef = useRef(null);
|
|
15264
|
+
const overflowing = useOverflowing(wrapperRef);
|
|
15265
|
+
const context = headerStyle === "plain" && !stickyHeader ? DEFAULT_TABLE_CONTEXT : { headerStyle, stickyHeader };
|
|
14848
15266
|
return /* @__PURE__ */ jsx(
|
|
14849
15267
|
"div",
|
|
14850
15268
|
{
|
|
15269
|
+
ref: wrapperRef,
|
|
14851
15270
|
...slot(tableAnatomy, "wrapper"),
|
|
15271
|
+
...density === void 0 ? {} : { "data-ds-density": density },
|
|
15272
|
+
...overflowing ? { role: "region", "aria-label": messages.region, tabIndex: 0 } : {},
|
|
14852
15273
|
className: cn(
|
|
14853
15274
|
"ds:rounded-card ds:border-rule-strong ds:bg-surface ds:w-full ds:overflow-x-auto ds:border ds:shadow-quiet",
|
|
14854
|
-
|
|
15275
|
+
overflowing && "ds:focus-visible:outline-none ds:focus-visible:[box-shadow:var(--shadow-focus-ring)]",
|
|
15276
|
+
wrapperClassName,
|
|
15277
|
+
classNames?.wrapper
|
|
14855
15278
|
),
|
|
14856
|
-
children: /* @__PURE__ */ jsx(
|
|
15279
|
+
children: /* @__PURE__ */ jsx(TableContext.Provider, { value: context, children: /* @__PURE__ */ jsx(
|
|
14857
15280
|
"table",
|
|
14858
15281
|
{
|
|
14859
15282
|
ref,
|
|
@@ -14861,7 +15284,7 @@ var Table = forwardRef(function Table2({ className, wrapperClassName, ...props }
|
|
|
14861
15284
|
className: cn("ds:w-full ds:caption-bottom ds:border-collapse ds:text-sm", className),
|
|
14862
15285
|
...props
|
|
14863
15286
|
}
|
|
14864
|
-
)
|
|
15287
|
+
) })
|
|
14865
15288
|
}
|
|
14866
15289
|
);
|
|
14867
15290
|
});
|
|
@@ -14909,18 +15332,32 @@ var TableFooter = forwardRef(
|
|
|
14909
15332
|
}
|
|
14910
15333
|
);
|
|
14911
15334
|
TableFooter.displayName = "TableFooter";
|
|
14912
|
-
var TableRow = forwardRef(function TableRow2({ className, ...props }, ref) {
|
|
15335
|
+
var TableRow = forwardRef(function TableRow2({ className, selected, interactive = false, onKeyDown, tabIndex, ...props }, ref) {
|
|
15336
|
+
const handleKeyDown = (event) => {
|
|
15337
|
+
onKeyDown?.(event);
|
|
15338
|
+
if (event.defaultPrevented || event.target !== event.currentTarget) return;
|
|
15339
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
15340
|
+
event.preventDefault();
|
|
15341
|
+
event.currentTarget.click();
|
|
15342
|
+
}
|
|
15343
|
+
};
|
|
14913
15344
|
return /* @__PURE__ */ jsx(
|
|
14914
15345
|
"tr",
|
|
14915
15346
|
{
|
|
14916
15347
|
ref,
|
|
14917
15348
|
...slot(tableAnatomy, "row"),
|
|
15349
|
+
...selected ? { "data-state": "selected" } : {},
|
|
15350
|
+
...interactive ? { tabIndex: tabIndex ?? 0, onKeyDown: handleKeyDown } : { tabIndex, onKeyDown },
|
|
14918
15351
|
className: cn(
|
|
14919
15352
|
"ds:border-rule-soft ds:border-b ds:transition-colors ds:duration-[var(--duration-instant)] ds:ease-[var(--ease-out-quart)] ds:motion-reduce:transition-none",
|
|
14920
15353
|
// G15 compound: selected wins over hover; selected+hover uses the
|
|
14921
15354
|
// Pro hover tint (not bg-bg-2, which would fight the selection).
|
|
14922
15355
|
"ds:data-[state=selected]:bg-brand-bg ds:data-[state=selected]:hover:bg-brand-bg-hover",
|
|
14923
15356
|
"ds:[&:not([data-state=selected])]:hover:bg-surface-hover",
|
|
15357
|
+
// An outline rather than the box-shadow ring: collapsed-border tables
|
|
15358
|
+
// do not paint a row's box-shadow, and an inset outline stays inside
|
|
15359
|
+
// the wrapper's overflow.
|
|
15360
|
+
interactive && "ds:cursor-pointer ds:focus-visible:outline-2 ds:focus-visible:-outline-offset-2 ds:focus-visible:outline-[var(--focus-ring-border)]",
|
|
14924
15361
|
className
|
|
14925
15362
|
),
|
|
14926
15363
|
...props
|
|
@@ -14928,12 +15365,64 @@ var TableRow = forwardRef(function TableRow2({ className, ...props }, ref) {
|
|
|
14928
15365
|
);
|
|
14929
15366
|
});
|
|
14930
15367
|
TableRow.displayName = "TableRow";
|
|
14931
|
-
var
|
|
15368
|
+
var CELL_DENSITY = "ds:[[data-ds-density]_&]:px-(--table-cell-padding-x) ds:[[data-ds-density]_&]:py-(--table-cell-padding-y) ds:[[data-ds-density]_&:has([role=checkbox])]:pr-0";
|
|
15369
|
+
var HEAD_DENSITY = "ds:[[data-ds-density]_&]:h-(--table-row-height) ds:[[data-ds-density]_&]:px-(--table-cell-padding-x) ds:[[data-ds-density]_&]:py-(--table-head-padding-y) ds:[[data-ds-density]_&:has([role=checkbox])]:pr-0";
|
|
15370
|
+
var ALIGN_CLASSES = {
|
|
15371
|
+
start: "ds:text-start",
|
|
15372
|
+
center: "ds:text-center",
|
|
15373
|
+
end: "ds:text-end"
|
|
15374
|
+
};
|
|
15375
|
+
var STICKY_HEADER_Z = "ds:z-[calc(var(--z-base)+1)]";
|
|
15376
|
+
var STICKY_CORNER_Z = "ds:z-[calc(var(--z-base)+2)]";
|
|
15377
|
+
var STICKY_CLASSES = {
|
|
15378
|
+
start: "ds:sticky ds:start-0 ds:[box-shadow:inset_-1px_0_0_var(--color-rule-soft)]",
|
|
15379
|
+
end: "ds:sticky ds:end-0 ds:[box-shadow:inset_1px_0_0_var(--color-rule-soft)]"
|
|
15380
|
+
};
|
|
15381
|
+
var STICKY_CELL_SURFACE = "ds:bg-surface ds:[tr:hover>&]:bg-surface-hover ds:[tr[data-state=selected]>&]:bg-brand-bg ds:[tr[data-state=selected]:hover>&]:bg-brand-bg-hover";
|
|
15382
|
+
function cellCommon({ align, numeric, truncate, sticky }, stickySurface) {
|
|
15383
|
+
const resolvedAlign = align ?? (numeric ? "end" : void 0);
|
|
15384
|
+
return cn(
|
|
15385
|
+
resolvedAlign && ALIGN_CLASSES[resolvedAlign],
|
|
15386
|
+
numeric && "ds:tabular-nums",
|
|
15387
|
+
truncate && "ds:max-w-0 ds:truncate",
|
|
15388
|
+
sticky && STICKY_CLASSES[sticky],
|
|
15389
|
+
sticky && stickySurface
|
|
15390
|
+
);
|
|
15391
|
+
}
|
|
15392
|
+
function widthStyle(width, style) {
|
|
15393
|
+
if (width === void 0) return style;
|
|
15394
|
+
return { width, ...style };
|
|
15395
|
+
}
|
|
15396
|
+
var HEAD_TYPOGRAPHY = {
|
|
15397
|
+
plain: "ds:font-sans ds:text-sm ds:font-medium ds:tracking-normal ds:normal-case ds:text-fg-3",
|
|
15398
|
+
overline: "ds:font-mono ds:text-overline ds:font-medium ds:tracking-[0.14em] ds:uppercase ds:text-fg-4"
|
|
15399
|
+
};
|
|
15400
|
+
var TableHead = forwardRef(function TableHead2({
|
|
15401
|
+
className,
|
|
15402
|
+
align,
|
|
15403
|
+
numeric,
|
|
15404
|
+
truncate,
|
|
15405
|
+
width,
|
|
15406
|
+
sticky,
|
|
15407
|
+
sort,
|
|
15408
|
+
onSortChange,
|
|
15409
|
+
style,
|
|
15410
|
+
children,
|
|
15411
|
+
...props
|
|
15412
|
+
}, ref) {
|
|
15413
|
+
const { headerStyle, stickyHeader } = useContext(TableContext);
|
|
15414
|
+
const sortable = sort !== void 0;
|
|
15415
|
+
const ariaSort = sortable ? sort === "asc" ? "ascending" : sort === "desc" ? "descending" : "none" : void 0;
|
|
15416
|
+
const handleSort = () => {
|
|
15417
|
+
const next = sort === null ? "asc" : sort === "asc" ? "desc" : null;
|
|
15418
|
+
onSortChange?.(next);
|
|
15419
|
+
};
|
|
14932
15420
|
return /* @__PURE__ */ jsx(
|
|
14933
15421
|
"th",
|
|
14934
15422
|
{
|
|
14935
15423
|
ref,
|
|
14936
15424
|
...slot(tableAnatomy, "head"),
|
|
15425
|
+
...sortable ? { "aria-sort": ariaSort, ...stateAttributes({ state: sort ?? void 0 }) } : {},
|
|
14937
15426
|
className: cn(
|
|
14938
15427
|
// Sentence-case column labels in the body font (Plus Jakarta Sans),
|
|
14939
15428
|
// quiet gray — not mono uppercase eyebrows.
|
|
@@ -14942,14 +15431,52 @@ var TableHead = forwardRef(function TableHead2({ className, ...props }, ref) {
|
|
|
14942
15431
|
"ds:text-fg-3 ds:bg-surface-2",
|
|
14943
15432
|
"ds:border-rule ds:border-b",
|
|
14944
15433
|
"ds:[&:has([role=checkbox])]:pr-0",
|
|
15434
|
+
HEAD_DENSITY,
|
|
15435
|
+
headerStyle !== "plain" && HEAD_TYPOGRAPHY[headerStyle],
|
|
15436
|
+
// Stuck header cells lose their collapsed border: the rule is an inset shadow.
|
|
15437
|
+
stickyHeader && cn(
|
|
15438
|
+
"ds:sticky ds:top-0 ds:[box-shadow:inset_0_-1px_0_var(--color-rule)]",
|
|
15439
|
+
STICKY_HEADER_Z
|
|
15440
|
+
),
|
|
15441
|
+
// A head cell that is both a sticky column and in a sticky header is the corner: above both.
|
|
15442
|
+
cellCommon({ align, numeric, truncate, sticky }, STICKY_CORNER_Z),
|
|
14945
15443
|
className
|
|
14946
15444
|
),
|
|
14947
|
-
|
|
15445
|
+
style: widthStyle(width, style),
|
|
15446
|
+
...props,
|
|
15447
|
+
children: sortable ? /* @__PURE__ */ jsxs(
|
|
15448
|
+
Pressable,
|
|
15449
|
+
{
|
|
15450
|
+
onClick: handleSort,
|
|
15451
|
+
...slot(tableAnatomy, "sort"),
|
|
15452
|
+
className: cn(
|
|
15453
|
+
"ds:-mx-1 ds:-my-1 ds:inline-flex ds:items-center ds:gap-1 ds:rounded-icon ds:px-1 ds:py-1",
|
|
15454
|
+
HEAD_TYPOGRAPHY[headerStyle],
|
|
15455
|
+
"ds:transition-colors ds:duration-[var(--duration-fast)] ds:ease-[var(--ease-out-quart)] ds:motion-reduce:transition-none",
|
|
15456
|
+
"ds:hover:text-fg"
|
|
15457
|
+
),
|
|
15458
|
+
children: [
|
|
15459
|
+
children,
|
|
15460
|
+
/* @__PURE__ */ jsx(
|
|
15461
|
+
"span",
|
|
15462
|
+
{
|
|
15463
|
+
"aria-hidden": "true",
|
|
15464
|
+
...slot(tableAnatomy, "sort-indicator"),
|
|
15465
|
+
className: cn(
|
|
15466
|
+
"ds:text-fg-5 ds:inline-flex ds:shrink-0 ds:items-center ds:justify-center",
|
|
15467
|
+
sort && "ds:text-fg-3"
|
|
15468
|
+
),
|
|
15469
|
+
children: sort === "asc" ? /* @__PURE__ */ jsx(ChevronUpIcon, { className: "ds:size-3", strokeWidth: 2.2 }) : sort === "desc" ? /* @__PURE__ */ jsx(ChevronDownIcon, { className: "ds:size-3", strokeWidth: 2.2 }) : /* @__PURE__ */ jsx(ChevronsUpDownIcon, { className: "ds:size-3", strokeWidth: 2 })
|
|
15470
|
+
}
|
|
15471
|
+
)
|
|
15472
|
+
]
|
|
15473
|
+
}
|
|
15474
|
+
) : children
|
|
14948
15475
|
}
|
|
14949
15476
|
);
|
|
14950
15477
|
});
|
|
14951
15478
|
TableHead.displayName = "TableHead";
|
|
14952
|
-
var TableCell = forwardRef(function TableCell2({ className, ...props }, ref) {
|
|
15479
|
+
var TableCell = forwardRef(function TableCell2({ className, align, numeric, muted, truncate, width, sticky, style, ...props }, ref) {
|
|
14953
15480
|
return /* @__PURE__ */ jsx(
|
|
14954
15481
|
"td",
|
|
14955
15482
|
{
|
|
@@ -14960,8 +15487,12 @@ var TableCell = forwardRef(function TableCell2({ className, ...props }, ref) {
|
|
|
14960
15487
|
// rhythm (py-3) for the taller rows in the catalog layout.
|
|
14961
15488
|
"ds:text-fg-2 ds:px-4 ds:py-3 ds:align-middle ds:text-[13px] ds:tabular-nums",
|
|
14962
15489
|
"ds:[&:has([role=checkbox])]:pr-0",
|
|
15490
|
+
CELL_DENSITY,
|
|
15491
|
+
muted && "ds:text-fg-3",
|
|
15492
|
+
cellCommon({ align, numeric, truncate, sticky }, STICKY_CELL_SURFACE),
|
|
14963
15493
|
className
|
|
14964
15494
|
),
|
|
15495
|
+
style: widthStyle(width, style),
|
|
14965
15496
|
...props
|
|
14966
15497
|
}
|
|
14967
15498
|
);
|
|
@@ -14981,13 +15512,13 @@ var TableCaption = forwardRef(
|
|
|
14981
15512
|
}
|
|
14982
15513
|
);
|
|
14983
15514
|
TableCaption.displayName = "TableCaption";
|
|
14984
|
-
var Tabs =
|
|
15515
|
+
var Tabs = React45.forwardRef(
|
|
14985
15516
|
function Tabs2({ className, ...props }, ref) {
|
|
14986
15517
|
return /* @__PURE__ */ jsx(TabsPrimitive.Root, { ref, className: cn(className), ...props });
|
|
14987
15518
|
}
|
|
14988
15519
|
);
|
|
14989
15520
|
Tabs.displayName = TabsPrimitive.Root.displayName;
|
|
14990
|
-
var TabsList =
|
|
15521
|
+
var TabsList = React45.forwardRef(function TabsList2({ className, ...props }, ref) {
|
|
14991
15522
|
return /* @__PURE__ */ jsx(
|
|
14992
15523
|
TabsPrimitive.List,
|
|
14993
15524
|
{
|
|
@@ -15032,7 +15563,7 @@ var triggerVariants = cva(
|
|
|
15032
15563
|
}
|
|
15033
15564
|
}
|
|
15034
15565
|
);
|
|
15035
|
-
var TabsTrigger =
|
|
15566
|
+
var TabsTrigger = React45.forwardRef(function TabsTrigger2({ className, variant, ...props }, ref) {
|
|
15036
15567
|
return /* @__PURE__ */ jsx(
|
|
15037
15568
|
TabsPrimitive.Trigger,
|
|
15038
15569
|
{
|
|
@@ -15043,7 +15574,7 @@ var TabsTrigger = React44.forwardRef(function TabsTrigger2({ className, variant,
|
|
|
15043
15574
|
);
|
|
15044
15575
|
});
|
|
15045
15576
|
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
15046
|
-
var TabsContent =
|
|
15577
|
+
var TabsContent = React45.forwardRef(function TabsContent2({ className, ...props }, ref) {
|
|
15047
15578
|
return /* @__PURE__ */ jsx(
|
|
15048
15579
|
TabsPrimitive.Content,
|
|
15049
15580
|
{
|
|
@@ -15068,7 +15599,7 @@ function TeamMemberSelect({
|
|
|
15068
15599
|
placeholder = "Select team member...",
|
|
15069
15600
|
className
|
|
15070
15601
|
}) {
|
|
15071
|
-
const options =
|
|
15602
|
+
const options = React45.useMemo(() => {
|
|
15072
15603
|
const meBadge = /* @__PURE__ */ jsx(
|
|
15073
15604
|
Badge,
|
|
15074
15605
|
{
|
|
@@ -15716,11 +16247,11 @@ var sizedItemVariants = cva(
|
|
|
15716
16247
|
}
|
|
15717
16248
|
}
|
|
15718
16249
|
);
|
|
15719
|
-
var ToggleGroupContext =
|
|
16250
|
+
var ToggleGroupContext = React45.createContext({
|
|
15720
16251
|
variant: "default",
|
|
15721
16252
|
size: void 0
|
|
15722
16253
|
});
|
|
15723
|
-
var ToggleGroup =
|
|
16254
|
+
var ToggleGroup = React45.forwardRef(function ToggleGroup2({
|
|
15724
16255
|
className,
|
|
15725
16256
|
variant,
|
|
15726
16257
|
size,
|
|
@@ -15762,11 +16293,11 @@ var ToggleGroup = React44.forwardRef(function ToggleGroup2({
|
|
|
15762
16293
|
defaultProp: defaultValue ?? emptyValue,
|
|
15763
16294
|
onChange: onValueChange
|
|
15764
16295
|
});
|
|
15765
|
-
const initialValue =
|
|
15766
|
-
const rootRef =
|
|
16296
|
+
const initialValue = React45.useRef(valueProp ?? defaultValue ?? emptyValue);
|
|
16297
|
+
const rootRef = React45.useRef(null);
|
|
15767
16298
|
const mergedRef = useMergedRefs(ref, rootRef);
|
|
15768
16299
|
const labelledBy = wiring["aria-labelledby"] ?? (fieldset?.legendMounted ? fieldset.legendId : void 0);
|
|
15769
|
-
const context =
|
|
16300
|
+
const context = React45.useMemo(() => ({ variant, size }), [variant, size]);
|
|
15770
16301
|
const radixProps = {
|
|
15771
16302
|
...props,
|
|
15772
16303
|
type,
|
|
@@ -15806,8 +16337,8 @@ var ToggleGroup = React44.forwardRef(function ToggleGroup2({
|
|
|
15806
16337
|
] });
|
|
15807
16338
|
});
|
|
15808
16339
|
ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;
|
|
15809
|
-
var ToggleGroupItem =
|
|
15810
|
-
const ctx =
|
|
16340
|
+
var ToggleGroupItem = React45.forwardRef(function ToggleGroupItem2({ className, variant, ...props }, ref) {
|
|
16341
|
+
const ctx = React45.useContext(ToggleGroupContext);
|
|
15811
16342
|
const resolvedVariant = variant ?? ctx.variant;
|
|
15812
16343
|
return /* @__PURE__ */ jsx(
|
|
15813
16344
|
ToggleGroupPrimitive.Item,
|
|
@@ -15954,7 +16485,7 @@ function IntentBadge({ tone = "muted", icon, children, className, ...props }) {
|
|
|
15954
16485
|
);
|
|
15955
16486
|
}
|
|
15956
16487
|
IntentBadge.displayName = "IntentBadge";
|
|
15957
|
-
var
|
|
16488
|
+
var SIZE_CLASS2 = {
|
|
15958
16489
|
display: "ds:text-display",
|
|
15959
16490
|
"title-page": "ds:text-title-page",
|
|
15960
16491
|
"title-section": "ds:text-title-section",
|
|
@@ -15993,7 +16524,7 @@ var Text = forwardRef(function Text2({ size = "body", color, weight, numeric, tr
|
|
|
15993
16524
|
ref,
|
|
15994
16525
|
...slot(textAnatomy, "root"),
|
|
15995
16526
|
className: cn(
|
|
15996
|
-
|
|
16527
|
+
SIZE_CLASS2[size],
|
|
15997
16528
|
color && COLOR_CLASS[color],
|
|
15998
16529
|
weight && WEIGHT_CLASS[weight],
|
|
15999
16530
|
numeric && "ds:numeric",
|
|
@@ -16005,33 +16536,6 @@ var Text = forwardRef(function Text2({ size = "body", color, weight, numeric, tr
|
|
|
16005
16536
|
);
|
|
16006
16537
|
});
|
|
16007
16538
|
Text.displayName = "Text";
|
|
16008
|
-
var DEFAULT_SIZE = {
|
|
16009
|
-
1: "title-page",
|
|
16010
|
-
2: "title-section",
|
|
16011
|
-
3: "title-sub",
|
|
16012
|
-
4: "title-sub",
|
|
16013
|
-
5: "title-sub",
|
|
16014
|
-
6: "title-sub"
|
|
16015
|
-
};
|
|
16016
|
-
var SIZE_CLASS2 = {
|
|
16017
|
-
display: "ds:text-display",
|
|
16018
|
-
"title-page": "ds:text-title-page",
|
|
16019
|
-
"title-section": "ds:text-title-section",
|
|
16020
|
-
"title-sub": "ds:text-title-sub"
|
|
16021
|
-
};
|
|
16022
|
-
var Heading = forwardRef(function Heading2({ level, size, className, ...props }, ref) {
|
|
16023
|
-
const Tag = `h${level}`;
|
|
16024
|
-
return /* @__PURE__ */ jsx(
|
|
16025
|
-
Tag,
|
|
16026
|
-
{
|
|
16027
|
-
ref,
|
|
16028
|
-
...slot(headingAnatomy, "root"),
|
|
16029
|
-
className: cn("ds:font-display ds:text-fg", SIZE_CLASS2[size ?? DEFAULT_SIZE[level]], className),
|
|
16030
|
-
...props
|
|
16031
|
-
}
|
|
16032
|
-
);
|
|
16033
|
-
});
|
|
16034
|
-
Heading.displayName = "Heading";
|
|
16035
16539
|
|
|
16036
16540
|
// src/primitives/layout/responsive.ts
|
|
16037
16541
|
var GAP = {
|
|
@@ -16284,6 +16788,424 @@ var FieldsetLegend = forwardRef(
|
|
|
16284
16788
|
);
|
|
16285
16789
|
}
|
|
16286
16790
|
);
|
|
16791
|
+
var DEFAULT_PAGE_SIZE = 15;
|
|
16792
|
+
var EMPTY_RECORD = Object.freeze({});
|
|
16793
|
+
var EMPTY_LIST = Object.freeze([]);
|
|
16794
|
+
function defaultGetRowId(row, index) {
|
|
16795
|
+
const id = row?.id;
|
|
16796
|
+
return typeof id === "string" || typeof id === "number" ? String(id) : String(index);
|
|
16797
|
+
}
|
|
16798
|
+
function readAccessor(row, column) {
|
|
16799
|
+
const accessor = column.accessor;
|
|
16800
|
+
if (typeof accessor === "function") return accessor(row);
|
|
16801
|
+
if (accessor !== void 0) return row[accessor];
|
|
16802
|
+
return row[column.id];
|
|
16803
|
+
}
|
|
16804
|
+
function toText(value) {
|
|
16805
|
+
if (value == null) return "";
|
|
16806
|
+
if (value instanceof Date) return value.toISOString();
|
|
16807
|
+
return typeof value === "object" ? "" : String(value);
|
|
16808
|
+
}
|
|
16809
|
+
function compareSortValues(a, b, direction) {
|
|
16810
|
+
const dir = direction === "asc" ? 1 : -1;
|
|
16811
|
+
if (a == null && b == null) return 0;
|
|
16812
|
+
if (a == null) return 1;
|
|
16813
|
+
if (b == null) return -1;
|
|
16814
|
+
const av = normaliseSortValue(a);
|
|
16815
|
+
const bv = normaliseSortValue(b);
|
|
16816
|
+
return av < bv ? -dir : av > bv ? dir : 0;
|
|
16817
|
+
}
|
|
16818
|
+
function normaliseSortValue(value) {
|
|
16819
|
+
if (typeof value === "string") return value.toLowerCase();
|
|
16820
|
+
if (value instanceof Date) return value.getTime();
|
|
16821
|
+
if (typeof value === "boolean") return value ? 1 : 0;
|
|
16822
|
+
return value;
|
|
16823
|
+
}
|
|
16824
|
+
function filterValues(value) {
|
|
16825
|
+
if (value == null || value === "") return EMPTY_LIST;
|
|
16826
|
+
return typeof value === "string" ? [value] : value;
|
|
16827
|
+
}
|
|
16828
|
+
function nextSortDirection(current) {
|
|
16829
|
+
return current === null ? "asc" : current === "asc" ? "desc" : null;
|
|
16830
|
+
}
|
|
16831
|
+
function useDataTable(options) {
|
|
16832
|
+
const {
|
|
16833
|
+
data,
|
|
16834
|
+
columns: allColumns,
|
|
16835
|
+
filterDefinitions = EMPTY_LIST,
|
|
16836
|
+
getRowId = defaultGetRowId,
|
|
16837
|
+
isRowSelectable,
|
|
16838
|
+
manual = false,
|
|
16839
|
+
onSelectAllMatching,
|
|
16840
|
+
resetPageOnChange = true
|
|
16841
|
+
} = options;
|
|
16842
|
+
const id = useId4(options.id, "ds-table");
|
|
16843
|
+
const [sorting, setSortingState] = useSlice(
|
|
16844
|
+
options.sorting,
|
|
16845
|
+
options.state?.sorting,
|
|
16846
|
+
options.defaultSorting,
|
|
16847
|
+
options.defaultState?.sorting,
|
|
16848
|
+
null
|
|
16849
|
+
);
|
|
16850
|
+
const [pagination, setPaginationState] = useSlice(
|
|
16851
|
+
options.pagination,
|
|
16852
|
+
options.state?.pagination,
|
|
16853
|
+
options.defaultPagination ? {
|
|
16854
|
+
page: options.defaultPagination.page ?? 1,
|
|
16855
|
+
pageSize: options.defaultPagination.pageSize ?? DEFAULT_PAGE_SIZE
|
|
16856
|
+
} : void 0,
|
|
16857
|
+
options.defaultState?.pagination,
|
|
16858
|
+
{ page: 1, pageSize: DEFAULT_PAGE_SIZE }
|
|
16859
|
+
);
|
|
16860
|
+
const [search, setSearchState] = useSlice(
|
|
16861
|
+
options.search,
|
|
16862
|
+
options.state?.search,
|
|
16863
|
+
options.defaultSearch,
|
|
16864
|
+
options.defaultState?.search,
|
|
16865
|
+
""
|
|
16866
|
+
);
|
|
16867
|
+
const [selection, setSelectionState] = useSlice(
|
|
16868
|
+
options.selection,
|
|
16869
|
+
options.state?.selection,
|
|
16870
|
+
options.defaultSelection,
|
|
16871
|
+
options.defaultState?.selection,
|
|
16872
|
+
EMPTY_LIST
|
|
16873
|
+
);
|
|
16874
|
+
const [columnVisibility, setColumnVisibilityState] = useSlice(
|
|
16875
|
+
options.columnVisibility,
|
|
16876
|
+
options.state?.columnVisibility,
|
|
16877
|
+
options.defaultColumnVisibility,
|
|
16878
|
+
options.defaultState?.columnVisibility,
|
|
16879
|
+
EMPTY_RECORD
|
|
16880
|
+
);
|
|
16881
|
+
const [filters, setFiltersState] = useSlice(
|
|
16882
|
+
options.filters,
|
|
16883
|
+
options.state?.filters,
|
|
16884
|
+
options.defaultFilters,
|
|
16885
|
+
options.defaultState?.filters,
|
|
16886
|
+
EMPTY_RECORD
|
|
16887
|
+
);
|
|
16888
|
+
const state = useMemo(
|
|
16889
|
+
() => ({ sorting, pagination, search, selection, columnVisibility, filters }),
|
|
16890
|
+
[sorting, pagination, search, selection, columnVisibility, filters]
|
|
16891
|
+
);
|
|
16892
|
+
const latest = useRef({ state, options });
|
|
16893
|
+
latest.current = { state, options };
|
|
16894
|
+
const commit = useCallback(
|
|
16895
|
+
(patch) => {
|
|
16896
|
+
const { state: current, options: opts } = latest.current;
|
|
16897
|
+
const next = { ...current, ...patch };
|
|
16898
|
+
let changed = false;
|
|
16899
|
+
if ("sorting" in patch && !Object.is(patch.sorting, current.sorting)) {
|
|
16900
|
+
changed = true;
|
|
16901
|
+
setSortingState(next.sorting);
|
|
16902
|
+
opts.onSortingChange?.(next.sorting);
|
|
16903
|
+
}
|
|
16904
|
+
if ("pagination" in patch && !Object.is(patch.pagination, current.pagination)) {
|
|
16905
|
+
changed = true;
|
|
16906
|
+
setPaginationState(next.pagination);
|
|
16907
|
+
opts.onPaginationChange?.(next.pagination);
|
|
16908
|
+
}
|
|
16909
|
+
if ("search" in patch && !Object.is(patch.search, current.search)) {
|
|
16910
|
+
changed = true;
|
|
16911
|
+
setSearchState(next.search);
|
|
16912
|
+
opts.onSearchChange?.(next.search);
|
|
16913
|
+
}
|
|
16914
|
+
if ("selection" in patch && !Object.is(patch.selection, current.selection)) {
|
|
16915
|
+
changed = true;
|
|
16916
|
+
setSelectionState(next.selection);
|
|
16917
|
+
opts.onSelectionChange?.(next.selection);
|
|
16918
|
+
}
|
|
16919
|
+
if ("columnVisibility" in patch && !Object.is(patch.columnVisibility, current.columnVisibility)) {
|
|
16920
|
+
changed = true;
|
|
16921
|
+
setColumnVisibilityState(next.columnVisibility);
|
|
16922
|
+
opts.onColumnVisibilityChange?.(next.columnVisibility);
|
|
16923
|
+
}
|
|
16924
|
+
if ("filters" in patch && !Object.is(patch.filters, current.filters)) {
|
|
16925
|
+
changed = true;
|
|
16926
|
+
setFiltersState(next.filters);
|
|
16927
|
+
opts.onFiltersChange?.(next.filters);
|
|
16928
|
+
}
|
|
16929
|
+
if (changed) {
|
|
16930
|
+
latest.current = { state: next, options: opts };
|
|
16931
|
+
opts.onStateChange?.(next);
|
|
16932
|
+
}
|
|
16933
|
+
},
|
|
16934
|
+
[
|
|
16935
|
+
setSortingState,
|
|
16936
|
+
setPaginationState,
|
|
16937
|
+
setSearchState,
|
|
16938
|
+
setSelectionState,
|
|
16939
|
+
setColumnVisibilityState,
|
|
16940
|
+
setFiltersState
|
|
16941
|
+
]
|
|
16942
|
+
);
|
|
16943
|
+
const firstPage = useCallback(
|
|
16944
|
+
(current) => resetPageOnChange && current.page !== 1 ? { pagination: { ...current, page: 1 } } : {},
|
|
16945
|
+
[resetPageOnChange]
|
|
16946
|
+
);
|
|
16947
|
+
const columns = useMemo(
|
|
16948
|
+
() => allColumns.filter((column) => columnVisibility[column.id] !== false),
|
|
16949
|
+
[allColumns, columnVisibility]
|
|
16950
|
+
);
|
|
16951
|
+
const getCellValue = useCallback(
|
|
16952
|
+
(row, column) => readAccessor(row, column),
|
|
16953
|
+
[]
|
|
16954
|
+
);
|
|
16955
|
+
const matching = useMemo(() => {
|
|
16956
|
+
if (manual) return data;
|
|
16957
|
+
const query = search.trim().toLowerCase();
|
|
16958
|
+
const activeFilters = filterDefinitions.map((definition) => ({ definition, values: filterValues(filters[definition.id]) })).filter(({ values }) => values.length > 0);
|
|
16959
|
+
const searched = query ? allColumns.filter(
|
|
16960
|
+
(column) => column.searchable !== false && (column.searchText !== void 0 || column.accessor !== void 0 || column.id in (data[0] ?? {}))
|
|
16961
|
+
) : [];
|
|
16962
|
+
let rows2 = data.filter((row) => {
|
|
16963
|
+
for (const { definition, values } of activeFilters) {
|
|
16964
|
+
if (!values.some((value) => definition.match(row, value))) return false;
|
|
16965
|
+
}
|
|
16966
|
+
if (query) {
|
|
16967
|
+
const hit = searched.some(
|
|
16968
|
+
(column) => (column.searchText ? column.searchText(row) : toText(readAccessor(row, column))).toLowerCase().includes(query)
|
|
16969
|
+
);
|
|
16970
|
+
if (!hit) return false;
|
|
16971
|
+
}
|
|
16972
|
+
return true;
|
|
16973
|
+
});
|
|
16974
|
+
if (sorting) {
|
|
16975
|
+
const column = allColumns.find((c) => c.id === sorting.columnId);
|
|
16976
|
+
if (column) {
|
|
16977
|
+
const sortValue = column.sortValue ?? ((row) => readAccessor(row, column));
|
|
16978
|
+
rows2 = [...rows2].sort(
|
|
16979
|
+
(a, b) => compareSortValues(sortValue(a), sortValue(b), sorting.direction)
|
|
16980
|
+
);
|
|
16981
|
+
}
|
|
16982
|
+
}
|
|
16983
|
+
return rows2;
|
|
16984
|
+
}, [manual, data, allColumns, filterDefinitions, filters, search, sorting]);
|
|
16985
|
+
const rowCount = manual ? options.rowCount ?? data.length : matching.length;
|
|
16986
|
+
const pageSize = Math.max(1, pagination.pageSize);
|
|
16987
|
+
const pageCount = Math.max(1, Math.ceil(rowCount / pageSize));
|
|
16988
|
+
const page = Math.min(Math.max(1, pagination.page), pageCount);
|
|
16989
|
+
const pageRows = useMemo(
|
|
16990
|
+
() => manual ? matching : matching.slice((page - 1) * pageSize, page * pageSize),
|
|
16991
|
+
[manual, matching, page, pageSize]
|
|
16992
|
+
);
|
|
16993
|
+
const selectedSet = useMemo(() => new Set(selection), [selection]);
|
|
16994
|
+
const rowIds = useMemo(() => {
|
|
16995
|
+
const ids = /* @__PURE__ */ new Map();
|
|
16996
|
+
data.forEach((row, index) => ids.set(row, getRowId(row, index)));
|
|
16997
|
+
return ids;
|
|
16998
|
+
}, [data, getRowId]);
|
|
16999
|
+
const idOf = useCallback(
|
|
17000
|
+
(row) => rowIds.get(row) ?? getRowId(row, data.indexOf(row)),
|
|
17001
|
+
[rowIds, getRowId, data]
|
|
17002
|
+
);
|
|
17003
|
+
const rows = useMemo(
|
|
17004
|
+
() => pageRows.map((row, index) => {
|
|
17005
|
+
const rowId = idOf(row);
|
|
17006
|
+
return {
|
|
17007
|
+
id: rowId,
|
|
17008
|
+
row,
|
|
17009
|
+
index,
|
|
17010
|
+
selected: selectedSet.has(rowId),
|
|
17011
|
+
selectable: isRowSelectable ? isRowSelectable(row) : true
|
|
17012
|
+
};
|
|
17013
|
+
}),
|
|
17014
|
+
[pageRows, idOf, isRowSelectable, selectedSet]
|
|
17015
|
+
);
|
|
17016
|
+
const renderCell = useCallback(
|
|
17017
|
+
(model, column) => {
|
|
17018
|
+
const value = readAccessor(model.row, column);
|
|
17019
|
+
return column.cell ? column.cell(model.row, { value, rowId: model.id, index: model.index }) : toText(value);
|
|
17020
|
+
},
|
|
17021
|
+
[]
|
|
17022
|
+
);
|
|
17023
|
+
const getColumnId = useCallback((columnId) => `${id}-col-${columnId}`, [id]);
|
|
17024
|
+
const getRowDomId = useCallback((rowId) => `${id}-row-${rowId}`, [id]);
|
|
17025
|
+
const sortingApi = useMemo(() => {
|
|
17026
|
+
const getDirection = (columnId) => sorting?.columnId === columnId ? sorting.direction : null;
|
|
17027
|
+
return {
|
|
17028
|
+
value: sorting,
|
|
17029
|
+
set: (next) => commit({ sorting: next }),
|
|
17030
|
+
getDirection,
|
|
17031
|
+
toggle: (columnId) => {
|
|
17032
|
+
const direction = nextSortDirection(getDirection(columnId));
|
|
17033
|
+
commit({ sorting: direction ? { columnId, direction } : null });
|
|
17034
|
+
},
|
|
17035
|
+
getAriaSort: (columnId) => {
|
|
17036
|
+
const column = allColumns.find((c) => c.id === columnId);
|
|
17037
|
+
if (!column?.sortable) return void 0;
|
|
17038
|
+
const direction = getDirection(columnId);
|
|
17039
|
+
return direction === "asc" ? "ascending" : direction === "desc" ? "descending" : "none";
|
|
17040
|
+
}
|
|
17041
|
+
};
|
|
17042
|
+
}, [sorting, allColumns, commit]);
|
|
17043
|
+
const paginationApi = useMemo(() => {
|
|
17044
|
+
const setPage = (next) => commit({ pagination: { page: Math.min(Math.max(1, next), pageCount), pageSize } });
|
|
17045
|
+
return {
|
|
17046
|
+
page,
|
|
17047
|
+
pageSize,
|
|
17048
|
+
pageCount,
|
|
17049
|
+
rowCount,
|
|
17050
|
+
rangeStart: rowCount === 0 ? 0 : (page - 1) * pageSize + 1,
|
|
17051
|
+
rangeEnd: rowCount === 0 ? 0 : Math.min(page * pageSize, rowCount),
|
|
17052
|
+
canPreviousPage: page > 1,
|
|
17053
|
+
canNextPage: page < pageCount,
|
|
17054
|
+
set: (next) => commit({ pagination: next }),
|
|
17055
|
+
setPage,
|
|
17056
|
+
setPageSize: (next) => commit({ pagination: { page: 1, pageSize: Math.max(1, next) } }),
|
|
17057
|
+
nextPage: () => setPage(page + 1),
|
|
17058
|
+
previousPage: () => setPage(page - 1)
|
|
17059
|
+
};
|
|
17060
|
+
}, [page, pageSize, pageCount, rowCount, commit]);
|
|
17061
|
+
const searchApi = useMemo(
|
|
17062
|
+
() => ({
|
|
17063
|
+
value: search,
|
|
17064
|
+
set: (next) => commit({ search: next, ...firstPage(latest.current.state.pagination) }),
|
|
17065
|
+
clear: () => commit({ search: "", ...firstPage(latest.current.state.pagination) })
|
|
17066
|
+
}),
|
|
17067
|
+
[search, commit, firstPage]
|
|
17068
|
+
);
|
|
17069
|
+
const selectionApi = useMemo(() => {
|
|
17070
|
+
const selectableOnPage = rows.filter((r) => r.selectable).map((r) => r.id);
|
|
17071
|
+
const selectedOnPage = selectableOnPage.filter((rowId) => selectedSet.has(rowId));
|
|
17072
|
+
const allPageSelected = selectableOnPage.length > 0 && selectedOnPage.length === selectableOnPage.length;
|
|
17073
|
+
const somePageSelected = selectedOnPage.length > 0 && !allPageSelected;
|
|
17074
|
+
const set = (next) => commit({ selection: next });
|
|
17075
|
+
const add = (ids) => {
|
|
17076
|
+
const current = latest.current.state.selection;
|
|
17077
|
+
const seen = new Set(current);
|
|
17078
|
+
const added = ids.filter((rowId) => !seen.has(rowId));
|
|
17079
|
+
if (added.length > 0) set([...current, ...added]);
|
|
17080
|
+
};
|
|
17081
|
+
const remove = (ids) => {
|
|
17082
|
+
const drop = new Set(ids);
|
|
17083
|
+
const current = latest.current.state.selection;
|
|
17084
|
+
const kept = current.filter((rowId) => !drop.has(rowId));
|
|
17085
|
+
if (kept.length !== current.length) set(kept);
|
|
17086
|
+
};
|
|
17087
|
+
const selectPage = () => add(selectableOnPage);
|
|
17088
|
+
const deselectPage = () => remove(selectableOnPage);
|
|
17089
|
+
return {
|
|
17090
|
+
value: selection,
|
|
17091
|
+
count: selection.length,
|
|
17092
|
+
isSelected: (rowId) => selectedSet.has(rowId),
|
|
17093
|
+
set,
|
|
17094
|
+
select: (rowId) => add([rowId]),
|
|
17095
|
+
deselect: (rowId) => remove([rowId]),
|
|
17096
|
+
toggle: (rowId) => selectedSet.has(rowId) ? remove([rowId]) : add([rowId]),
|
|
17097
|
+
clear: () => {
|
|
17098
|
+
if (latest.current.state.selection.length > 0) set(EMPTY_LIST);
|
|
17099
|
+
},
|
|
17100
|
+
allPageSelected,
|
|
17101
|
+
somePageSelected,
|
|
17102
|
+
selectPage,
|
|
17103
|
+
deselectPage,
|
|
17104
|
+
togglePage: () => allPageSelected ? deselectPage() : selectPage(),
|
|
17105
|
+
selectAllMatching: () => {
|
|
17106
|
+
if (manual) {
|
|
17107
|
+
onSelectAllMatching?.(latest.current.state);
|
|
17108
|
+
return;
|
|
17109
|
+
}
|
|
17110
|
+
add(
|
|
17111
|
+
matching.filter((row) => isRowSelectable ? isRowSelectable(row) : true).map((row) => idOf(row))
|
|
17112
|
+
);
|
|
17113
|
+
}
|
|
17114
|
+
};
|
|
17115
|
+
}, [
|
|
17116
|
+
rows,
|
|
17117
|
+
selection,
|
|
17118
|
+
selectedSet,
|
|
17119
|
+
commit,
|
|
17120
|
+
manual,
|
|
17121
|
+
onSelectAllMatching,
|
|
17122
|
+
matching,
|
|
17123
|
+
idOf,
|
|
17124
|
+
isRowSelectable
|
|
17125
|
+
]);
|
|
17126
|
+
const columnVisibilityApi = useMemo(() => {
|
|
17127
|
+
const setVisible = (columnId, visible) => {
|
|
17128
|
+
const current = latest.current.state.columnVisibility;
|
|
17129
|
+
if (current[columnId] !== false === visible) return;
|
|
17130
|
+
const next = { ...current };
|
|
17131
|
+
if (visible) delete next[columnId];
|
|
17132
|
+
else next[columnId] = false;
|
|
17133
|
+
commit({ columnVisibility: next });
|
|
17134
|
+
};
|
|
17135
|
+
return {
|
|
17136
|
+
value: columnVisibility,
|
|
17137
|
+
isVisible: (columnId) => columnVisibility[columnId] !== false,
|
|
17138
|
+
set: (next) => commit({ columnVisibility: next }),
|
|
17139
|
+
setVisible,
|
|
17140
|
+
toggle: (columnId) => setVisible(columnId, columnVisibility[columnId] === false),
|
|
17141
|
+
reset: () => {
|
|
17142
|
+
if (Object.keys(latest.current.state.columnVisibility).length > 0) {
|
|
17143
|
+
commit({ columnVisibility: EMPTY_RECORD });
|
|
17144
|
+
}
|
|
17145
|
+
}
|
|
17146
|
+
};
|
|
17147
|
+
}, [columnVisibility, commit]);
|
|
17148
|
+
const filtersApi = useMemo(() => {
|
|
17149
|
+
const set = (filterId, value) => {
|
|
17150
|
+
const { state: current } = latest.current;
|
|
17151
|
+
const next = { ...current.filters };
|
|
17152
|
+
if (filterValues(value).length === 0) delete next[filterId];
|
|
17153
|
+
else next[filterId] = value;
|
|
17154
|
+
commit({ filters: next, ...firstPage(current.pagination) });
|
|
17155
|
+
};
|
|
17156
|
+
return {
|
|
17157
|
+
value: filters,
|
|
17158
|
+
definitions: filterDefinitions,
|
|
17159
|
+
get: (filterId) => {
|
|
17160
|
+
const value = filters[filterId];
|
|
17161
|
+
return filterValues(value).length === 0 ? null : value;
|
|
17162
|
+
},
|
|
17163
|
+
set,
|
|
17164
|
+
clear: (filterId) => set(filterId, null),
|
|
17165
|
+
clearAll: () => {
|
|
17166
|
+
const { state: current } = latest.current;
|
|
17167
|
+
if (Object.keys(current.filters).length > 0) {
|
|
17168
|
+
commit({ filters: EMPTY_RECORD, ...firstPage(current.pagination) });
|
|
17169
|
+
}
|
|
17170
|
+
},
|
|
17171
|
+
activeCount: Object.values(filters).filter((value) => filterValues(value).length > 0).length
|
|
17172
|
+
};
|
|
17173
|
+
}, [filters, filterDefinitions, commit, firstPage]);
|
|
17174
|
+
return {
|
|
17175
|
+
id,
|
|
17176
|
+
manual,
|
|
17177
|
+
state,
|
|
17178
|
+
allColumns,
|
|
17179
|
+
columns,
|
|
17180
|
+
rows,
|
|
17181
|
+
matchingRows: matching,
|
|
17182
|
+
getCellValue,
|
|
17183
|
+
renderCell,
|
|
17184
|
+
getColumnId,
|
|
17185
|
+
getRowDomId,
|
|
17186
|
+
sorting: sortingApi,
|
|
17187
|
+
pagination: paginationApi,
|
|
17188
|
+
search: searchApi,
|
|
17189
|
+
selection: selectionApi,
|
|
17190
|
+
columnVisibility: columnVisibilityApi,
|
|
17191
|
+
filters: filtersApi
|
|
17192
|
+
};
|
|
17193
|
+
}
|
|
17194
|
+
function useSlice(prop, stateProp, defaultProp, defaultStateProp, fallback) {
|
|
17195
|
+
const controlled = prop !== void 0 ? prop : stateProp;
|
|
17196
|
+
const [uncontrolled, setUncontrolled] = useState(
|
|
17197
|
+
defaultProp !== void 0 ? defaultProp : defaultStateProp !== void 0 ? defaultStateProp : fallback
|
|
17198
|
+
);
|
|
17199
|
+
const value = controlled !== void 0 ? controlled : uncontrolled;
|
|
17200
|
+
const isControlled = controlled !== void 0;
|
|
17201
|
+
const setValue = useCallback(
|
|
17202
|
+
(next) => {
|
|
17203
|
+
if (!isControlled) setUncontrolled(next);
|
|
17204
|
+
},
|
|
17205
|
+
[isControlled, setUncontrolled]
|
|
17206
|
+
);
|
|
17207
|
+
return [value, setValue];
|
|
17208
|
+
}
|
|
16287
17209
|
function MultiSelect(props) {
|
|
16288
17210
|
return /* @__PURE__ */ jsx(Combobox, { ...props, multiple: true });
|
|
16289
17211
|
}
|
|
@@ -19089,7 +20011,7 @@ function MetaText({
|
|
|
19089
20011
|
if (presentValues.length === 0) {
|
|
19090
20012
|
return null;
|
|
19091
20013
|
}
|
|
19092
|
-
return /* @__PURE__ */ jsx("div", { className, children: presentValues.map((value, index) => /* @__PURE__ */ jsxs(
|
|
20014
|
+
return /* @__PURE__ */ jsx("div", { className, children: presentValues.map((value, index) => /* @__PURE__ */ jsxs(React45.Fragment, { children: [
|
|
19093
20015
|
index > 0 && /* @__PURE__ */ jsx(
|
|
19094
20016
|
"span",
|
|
19095
20017
|
{
|
|
@@ -19167,7 +20089,7 @@ function MoreActions({ menu }) {
|
|
|
19167
20089
|
/* @__PURE__ */ jsx(DropdownMenuContent, { align: "end", onClick: (event) => event.stopPropagation(), children: menu })
|
|
19168
20090
|
] });
|
|
19169
20091
|
}
|
|
19170
|
-
var DocumentFileRow =
|
|
20092
|
+
var DocumentFileRow = React45.forwardRef(
|
|
19171
20093
|
function DocumentFileRow2({
|
|
19172
20094
|
name,
|
|
19173
20095
|
fileType,
|
|
@@ -19234,7 +20156,7 @@ var DocumentFileRow = React44.forwardRef(
|
|
|
19234
20156
|
}
|
|
19235
20157
|
);
|
|
19236
20158
|
DocumentFileRow.displayName = "DocumentFileRow";
|
|
19237
|
-
var DocumentFileCard =
|
|
20159
|
+
var DocumentFileCard = React45.forwardRef(
|
|
19238
20160
|
function DocumentFileCard2({
|
|
19239
20161
|
name,
|
|
19240
20162
|
fileType,
|
|
@@ -19310,7 +20232,7 @@ var lineCaptionToneClass = {
|
|
|
19310
20232
|
warning: "ds:text-warning-fg",
|
|
19311
20233
|
danger: "ds:text-danger-fg"
|
|
19312
20234
|
};
|
|
19313
|
-
var DocumentFileLine =
|
|
20235
|
+
var DocumentFileLine = React45.forwardRef(
|
|
19314
20236
|
function DocumentFileLine2({
|
|
19315
20237
|
name,
|
|
19316
20238
|
fileType = "",
|
|
@@ -19484,7 +20406,7 @@ function FileGroup({ files }) {
|
|
|
19484
20406
|
file.id
|
|
19485
20407
|
)) });
|
|
19486
20408
|
}
|
|
19487
|
-
var DocumentChecklist =
|
|
20409
|
+
var DocumentChecklist = React45.forwardRef(
|
|
19488
20410
|
function DocumentChecklist2({
|
|
19489
20411
|
items,
|
|
19490
20412
|
title = "Your documents",
|
|
@@ -19734,6 +20656,58 @@ var NewMenu = forwardRef(function NewMenu2({ actions, groups, triggerLabel = "Ne
|
|
|
19734
20656
|
] });
|
|
19735
20657
|
});
|
|
19736
20658
|
NewMenu.displayName = "NewMenu";
|
|
20659
|
+
function SegmentedControl({
|
|
20660
|
+
options,
|
|
20661
|
+
value,
|
|
20662
|
+
defaultValue,
|
|
20663
|
+
onValueChange,
|
|
20664
|
+
variant,
|
|
20665
|
+
size,
|
|
20666
|
+
name,
|
|
20667
|
+
form,
|
|
20668
|
+
required,
|
|
20669
|
+
disabled,
|
|
20670
|
+
allowDeselect = false,
|
|
20671
|
+
className,
|
|
20672
|
+
itemClassName,
|
|
20673
|
+
...aria
|
|
20674
|
+
}) {
|
|
20675
|
+
return /* @__PURE__ */ jsx(
|
|
20676
|
+
ToggleGroup,
|
|
20677
|
+
{
|
|
20678
|
+
type: "single",
|
|
20679
|
+
value,
|
|
20680
|
+
defaultValue,
|
|
20681
|
+
onValueChange: (next) => {
|
|
20682
|
+
if (!next && !allowDeselect) return;
|
|
20683
|
+
onValueChange?.(next);
|
|
20684
|
+
},
|
|
20685
|
+
variant,
|
|
20686
|
+
size,
|
|
20687
|
+
name,
|
|
20688
|
+
form,
|
|
20689
|
+
required,
|
|
20690
|
+
disabled,
|
|
20691
|
+
"aria-label": aria["aria-label"],
|
|
20692
|
+
"aria-labelledby": aria["aria-labelledby"],
|
|
20693
|
+
className: cn("ds:bg-bg-2 ds:rounded-pill ds:p-0.5", className),
|
|
20694
|
+
children: options.map((option) => /* @__PURE__ */ jsxs(
|
|
20695
|
+
ToggleGroupItem,
|
|
20696
|
+
{
|
|
20697
|
+
value: option.value,
|
|
20698
|
+
disabled: option.disabled,
|
|
20699
|
+
className: itemClassName,
|
|
20700
|
+
children: [
|
|
20701
|
+
option.icon,
|
|
20702
|
+
option.label,
|
|
20703
|
+
option.count != null && /* @__PURE__ */ jsx("span", { className: "ds:text-fg-4 ds:ms-1.5 ds:text-xs ds:font-medium ds:tabular-nums", children: option.count })
|
|
20704
|
+
]
|
|
20705
|
+
},
|
|
20706
|
+
option.value
|
|
20707
|
+
))
|
|
20708
|
+
}
|
|
20709
|
+
);
|
|
20710
|
+
}
|
|
19737
20711
|
var Shell = forwardRef(function Shell2({ className, ...props }, ref) {
|
|
19738
20712
|
return /* @__PURE__ */ jsx(
|
|
19739
20713
|
"div",
|
|
@@ -19758,7 +20732,7 @@ var Main = forwardRef(function Main2({ className, ...props }, ref) {
|
|
|
19758
20732
|
);
|
|
19759
20733
|
});
|
|
19760
20734
|
Main.displayName = "Main";
|
|
19761
|
-
var Content14 = forwardRef(function Content15({ padTop, padBottom, className, style, ...props }, ref) {
|
|
20735
|
+
var Content14 = forwardRef(function Content15({ padding = "default", padTop, padBottom, className, style, ...props }, ref) {
|
|
19762
20736
|
const messages = useDsMessages("shell");
|
|
19763
20737
|
const paddingStyle = padTop || padBottom ? {
|
|
19764
20738
|
...padTop ? { paddingTop: padTop } : null,
|
|
@@ -19773,14 +20747,19 @@ var Content14 = forwardRef(function Content15({ padTop, padBottom, className, st
|
|
|
19773
20747
|
"aria-label": messages.content,
|
|
19774
20748
|
tabIndex: 0,
|
|
19775
20749
|
...slot(shellAnatomy, "content"),
|
|
19776
|
-
|
|
20750
|
+
"data-padding": padding === "none" ? "none" : void 0,
|
|
20751
|
+
className: cn(
|
|
20752
|
+
"ds:flex-1 ds:overflow-y-auto",
|
|
20753
|
+
padding === "none" ? "ds:p-0" : "ds:p-[var(--content-pad)]",
|
|
20754
|
+
className
|
|
20755
|
+
),
|
|
19777
20756
|
style: paddingStyle,
|
|
19778
20757
|
...props
|
|
19779
20758
|
}
|
|
19780
20759
|
);
|
|
19781
20760
|
});
|
|
19782
20761
|
Content14.displayName = "Content";
|
|
19783
|
-
var SidebarContext =
|
|
20762
|
+
var SidebarContext = React45.createContext(null);
|
|
19784
20763
|
var NOOP_CONTEXT = {
|
|
19785
20764
|
state: "expanded",
|
|
19786
20765
|
setState: () => {
|
|
@@ -19793,53 +20772,66 @@ var NOOP_CONTEXT = {
|
|
|
19793
20772
|
}
|
|
19794
20773
|
};
|
|
19795
20774
|
function useSidebarState() {
|
|
19796
|
-
return
|
|
20775
|
+
return React45.useContext(SidebarContext) ?? NOOP_CONTEXT;
|
|
19797
20776
|
}
|
|
19798
20777
|
var DEFAULT_SHORTCUT = "Mod+\\";
|
|
19799
|
-
|
|
19800
|
-
|
|
20778
|
+
var asState = (value) => value === "rail" || value === "expanded" ? value : null;
|
|
20779
|
+
function readStorage(key, storage) {
|
|
20780
|
+
if (!key || typeof document === "undefined") return null;
|
|
19801
20781
|
try {
|
|
19802
|
-
|
|
19803
|
-
|
|
20782
|
+
if (storage === "cookie") {
|
|
20783
|
+
const match = document.cookie.match(
|
|
20784
|
+
new RegExp(`(?:^|;\\s*)${key.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}=([^;]*)`)
|
|
20785
|
+
);
|
|
20786
|
+
return asState(match ? decodeURIComponent(match[1]) : null);
|
|
20787
|
+
}
|
|
20788
|
+
return asState(window.localStorage.getItem(key));
|
|
19804
20789
|
} catch {
|
|
19805
20790
|
return null;
|
|
19806
20791
|
}
|
|
19807
20792
|
}
|
|
20793
|
+
function writeStorage(key, storage, next) {
|
|
20794
|
+
if (typeof document === "undefined") return;
|
|
20795
|
+
try {
|
|
20796
|
+
if (storage === "cookie") {
|
|
20797
|
+
document.cookie = `${key}=${next}; path=/; max-age=31536000; samesite=lax`;
|
|
20798
|
+
return;
|
|
20799
|
+
}
|
|
20800
|
+
window.localStorage.setItem(key, next);
|
|
20801
|
+
} catch {
|
|
20802
|
+
}
|
|
20803
|
+
}
|
|
19808
20804
|
function SidebarProvider({
|
|
19809
20805
|
children,
|
|
19810
20806
|
state: controlled,
|
|
19811
20807
|
defaultState = "expanded",
|
|
19812
20808
|
onStateChange,
|
|
19813
20809
|
storageKey,
|
|
20810
|
+
storage = "localStorage",
|
|
19814
20811
|
shortcut = DEFAULT_SHORTCUT
|
|
19815
20812
|
}) {
|
|
19816
|
-
const [uncontrolled, setUncontrolled] =
|
|
20813
|
+
const [uncontrolled, setUncontrolled] = React45.useState(
|
|
19817
20814
|
controlled ?? defaultState
|
|
19818
20815
|
);
|
|
19819
|
-
|
|
20816
|
+
React45.useEffect(() => {
|
|
19820
20817
|
if (controlled !== void 0) return;
|
|
19821
|
-
const stored = readStorage(storageKey);
|
|
20818
|
+
const stored = readStorage(storageKey, storage);
|
|
19822
20819
|
if (stored && stored !== uncontrolled) setUncontrolled(stored);
|
|
19823
20820
|
}, []);
|
|
19824
20821
|
const state = controlled ?? uncontrolled;
|
|
19825
|
-
const setState =
|
|
20822
|
+
const setState = React45.useCallback(
|
|
19826
20823
|
(next) => {
|
|
19827
20824
|
if (controlled === void 0) setUncontrolled(next);
|
|
19828
20825
|
onStateChange?.(next);
|
|
19829
|
-
if (storageKey
|
|
19830
|
-
try {
|
|
19831
|
-
window.localStorage.setItem(storageKey, next);
|
|
19832
|
-
} catch {
|
|
19833
|
-
}
|
|
19834
|
-
}
|
|
20826
|
+
if (storageKey) writeStorage(storageKey, storage, next);
|
|
19835
20827
|
},
|
|
19836
|
-
[controlled, onStateChange, storageKey]
|
|
20828
|
+
[controlled, onStateChange, storageKey, storage]
|
|
19837
20829
|
);
|
|
19838
|
-
const toggle =
|
|
20830
|
+
const toggle = React45.useCallback(() => {
|
|
19839
20831
|
setState(state === "expanded" ? "rail" : "expanded");
|
|
19840
20832
|
}, [state, setState]);
|
|
19841
|
-
const [peekLockCount, setPeekLockCount] =
|
|
19842
|
-
const acquirePeekLock =
|
|
20833
|
+
const [peekLockCount, setPeekLockCount] = React45.useState(0);
|
|
20834
|
+
const acquirePeekLock = React45.useCallback(() => {
|
|
19843
20835
|
setPeekLockCount((n) => n + 1);
|
|
19844
20836
|
let released = false;
|
|
19845
20837
|
return () => {
|
|
@@ -19848,7 +20840,7 @@ function SidebarProvider({
|
|
|
19848
20840
|
setPeekLockCount((n) => Math.max(0, n - 1));
|
|
19849
20841
|
};
|
|
19850
20842
|
}, []);
|
|
19851
|
-
|
|
20843
|
+
React45.useEffect(() => {
|
|
19852
20844
|
if (!shortcut) return;
|
|
19853
20845
|
const parts = shortcut.split("+");
|
|
19854
20846
|
const key = parts.pop() ?? "";
|
|
@@ -19868,7 +20860,7 @@ function SidebarProvider({
|
|
|
19868
20860
|
window.addEventListener("keydown", onKey);
|
|
19869
20861
|
return () => window.removeEventListener("keydown", onKey);
|
|
19870
20862
|
}, [shortcut, toggle]);
|
|
19871
|
-
const value =
|
|
20863
|
+
const value = React45.useMemo(
|
|
19872
20864
|
() => ({ state, setState, toggle, collapsible: true, peekLockCount, acquirePeekLock }),
|
|
19873
20865
|
[state, setState, toggle, peekLockCount, acquirePeekLock]
|
|
19874
20866
|
);
|
|
@@ -19877,9 +20869,12 @@ function SidebarProvider({
|
|
|
19877
20869
|
SidebarProvider.displayName = "SidebarProvider";
|
|
19878
20870
|
var PEEK_ENTER_DELAY_MS = 100;
|
|
19879
20871
|
var PEEK_LEAVE_DELAY_MS = 200;
|
|
19880
|
-
var SidebarLabelsHiddenContext =
|
|
19881
|
-
var SidebarPeekEnabledContext =
|
|
19882
|
-
|
|
20872
|
+
var SidebarLabelsHiddenContext = React45.createContext(false);
|
|
20873
|
+
var SidebarPeekEnabledContext = React45.createContext(true);
|
|
20874
|
+
function useCollapsedAttribute() {
|
|
20875
|
+
return React45.useContext(SidebarLabelsHiddenContext) ? { "data-collapsed": "true" } : {};
|
|
20876
|
+
}
|
|
20877
|
+
var Sidebar = React45.forwardRef(function Sidebar2({
|
|
19883
20878
|
className,
|
|
19884
20879
|
collapsible = false,
|
|
19885
20880
|
variant = "classic",
|
|
@@ -19891,13 +20886,13 @@ var Sidebar = React44.forwardRef(function Sidebar2({
|
|
|
19891
20886
|
...props
|
|
19892
20887
|
}, ref) {
|
|
19893
20888
|
const isFloating = variant === "floating";
|
|
19894
|
-
const ctx =
|
|
20889
|
+
const ctx = React45.useContext(SidebarContext);
|
|
19895
20890
|
const state = collapsible && ctx ? ctx.state : "expanded";
|
|
19896
20891
|
const peekLockCount = collapsible && ctx && peekEnabled ? ctx.peekLockCount : 0;
|
|
19897
|
-
const [peek, setPeek] =
|
|
19898
|
-
const enterTimer =
|
|
19899
|
-
const leaveTimer =
|
|
19900
|
-
const clearTimers =
|
|
20892
|
+
const [peek, setPeek] = React45.useState(false);
|
|
20893
|
+
const enterTimer = React45.useRef(null);
|
|
20894
|
+
const leaveTimer = React45.useRef(null);
|
|
20895
|
+
const clearTimers = React45.useCallback(() => {
|
|
19901
20896
|
if (enterTimer.current != null) {
|
|
19902
20897
|
window.clearTimeout(enterTimer.current);
|
|
19903
20898
|
enterTimer.current = null;
|
|
@@ -19907,8 +20902,8 @@ var Sidebar = React44.forwardRef(function Sidebar2({
|
|
|
19907
20902
|
leaveTimer.current = null;
|
|
19908
20903
|
}
|
|
19909
20904
|
}, []);
|
|
19910
|
-
|
|
19911
|
-
|
|
20905
|
+
React45.useEffect(() => () => clearTimers(), [clearTimers]);
|
|
20906
|
+
React45.useEffect(() => {
|
|
19912
20907
|
if (state === "expanded") {
|
|
19913
20908
|
clearTimers();
|
|
19914
20909
|
setPeek(false);
|
|
@@ -19993,7 +20988,7 @@ var Sidebar = React44.forwardRef(function Sidebar2({
|
|
|
19993
20988
|
);
|
|
19994
20989
|
});
|
|
19995
20990
|
Sidebar.displayName = "Sidebar";
|
|
19996
|
-
var SidebarTrigger =
|
|
20991
|
+
var SidebarTrigger = React45.forwardRef(
|
|
19997
20992
|
function SidebarTrigger2({
|
|
19998
20993
|
className,
|
|
19999
20994
|
expandLabel,
|
|
@@ -20002,7 +20997,7 @@ var SidebarTrigger = React44.forwardRef(
|
|
|
20002
20997
|
...props
|
|
20003
20998
|
}, ref) {
|
|
20004
20999
|
const messages = useDsMessages("sidebar");
|
|
20005
|
-
const ctx =
|
|
21000
|
+
const ctx = React45.useContext(SidebarContext);
|
|
20006
21001
|
if (!ctx) return null;
|
|
20007
21002
|
const { state, toggle } = ctx;
|
|
20008
21003
|
const label = state === "expanded" ? collapseLabel ?? messages.collapse : expandLabel ?? messages.expand;
|
|
@@ -20034,14 +21029,14 @@ var SidebarTrigger = React44.forwardRef(
|
|
|
20034
21029
|
);
|
|
20035
21030
|
SidebarTrigger.displayName = "SidebarTrigger";
|
|
20036
21031
|
function useSidebarPeekLock(active) {
|
|
20037
|
-
const ctx =
|
|
20038
|
-
|
|
21032
|
+
const ctx = React45.useContext(SidebarContext);
|
|
21033
|
+
React45.useEffect(() => {
|
|
20039
21034
|
if (!active || !ctx) return;
|
|
20040
21035
|
const release = ctx.acquirePeekLock();
|
|
20041
21036
|
return release;
|
|
20042
21037
|
}, [active, ctx]);
|
|
20043
21038
|
}
|
|
20044
|
-
var SidebarPinButton =
|
|
21039
|
+
var SidebarPinButton = React45.forwardRef(
|
|
20045
21040
|
function SidebarPinButton2({
|
|
20046
21041
|
pinLabel,
|
|
20047
21042
|
unpinLabel,
|
|
@@ -20050,7 +21045,7 @@ var SidebarPinButton = React44.forwardRef(
|
|
|
20050
21045
|
...props
|
|
20051
21046
|
}, ref) {
|
|
20052
21047
|
const messages = useDsMessages("sidebar");
|
|
20053
|
-
const ctx =
|
|
21048
|
+
const ctx = React45.useContext(SidebarContext);
|
|
20054
21049
|
if (!ctx || !ctx.collapsible) return null;
|
|
20055
21050
|
const { state, setState } = ctx;
|
|
20056
21051
|
const isPinned = state === "expanded";
|
|
@@ -20117,7 +21112,7 @@ function PinGlyph({
|
|
|
20117
21112
|
}
|
|
20118
21113
|
);
|
|
20119
21114
|
}
|
|
20120
|
-
var SidebarBrand =
|
|
21115
|
+
var SidebarBrand = React45.forwardRef(
|
|
20121
21116
|
function SidebarBrand2({ className, ...props }, ref) {
|
|
20122
21117
|
return /* @__PURE__ */ jsx(
|
|
20123
21118
|
"div",
|
|
@@ -20134,14 +21129,16 @@ var SidebarBrand = React44.forwardRef(
|
|
|
20134
21129
|
}
|
|
20135
21130
|
);
|
|
20136
21131
|
SidebarBrand.displayName = "SidebarBrand";
|
|
20137
|
-
var SidebarBrandText =
|
|
21132
|
+
var SidebarBrandText = React45.forwardRef(
|
|
20138
21133
|
function SidebarBrandText2({ className, ...props }, ref) {
|
|
21134
|
+
const collapsed = useCollapsedAttribute();
|
|
20139
21135
|
return /* @__PURE__ */ jsx(
|
|
20140
21136
|
"span",
|
|
20141
21137
|
{
|
|
20142
21138
|
ref,
|
|
20143
21139
|
"aria-hidden": "false",
|
|
20144
21140
|
...slot(sidebarAnatomy, "brand-text"),
|
|
21141
|
+
...collapsed,
|
|
20145
21142
|
className: cn(
|
|
20146
21143
|
// line-clamp-1 (not `truncate`) so multi-word wordmarks clip at a
|
|
20147
21144
|
// word boundary instead of mid-word when the rail is narrow.
|
|
@@ -20160,16 +21157,17 @@ var SidebarBrandText = React44.forwardRef(
|
|
|
20160
21157
|
}
|
|
20161
21158
|
);
|
|
20162
21159
|
SidebarBrandText.displayName = "SidebarBrandText";
|
|
20163
|
-
var SidebarGroupScopeContext =
|
|
20164
|
-
var SidebarSection =
|
|
20165
|
-
function SidebarSection2({ label, tone = "pro", className, children, ...props }, ref) {
|
|
21160
|
+
var SidebarGroupScopeContext = React45.createContext(null);
|
|
21161
|
+
var SidebarSection = React45.forwardRef(
|
|
21162
|
+
function SidebarSection2({ label, tone = "pro", headerActions, className, children, ...props }, ref) {
|
|
21163
|
+
const collapsed = useCollapsedAttribute();
|
|
20166
21164
|
const ariaLabel = typeof label === "string" ? label : typeof label === "number" ? String(label) : void 0;
|
|
20167
|
-
const [exclusiveId, setExclusiveIdState] =
|
|
20168
|
-
const setExclusive =
|
|
21165
|
+
const [exclusiveId, setExclusiveIdState] = React45.useState(null);
|
|
21166
|
+
const setExclusive = React45.useCallback(
|
|
20169
21167
|
(id) => setExclusiveIdState(id),
|
|
20170
21168
|
[]
|
|
20171
21169
|
);
|
|
20172
|
-
const scope =
|
|
21170
|
+
const scope = React45.useMemo(
|
|
20173
21171
|
() => ({ exclusiveId, setExclusive }),
|
|
20174
21172
|
[exclusiveId, setExclusive]
|
|
20175
21173
|
);
|
|
@@ -20180,6 +21178,7 @@ var SidebarSection = React44.forwardRef(
|
|
|
20180
21178
|
role: ariaLabel ? "group" : void 0,
|
|
20181
21179
|
"aria-label": ariaLabel,
|
|
20182
21180
|
...slot(sidebarAnatomy, "section"),
|
|
21181
|
+
...collapsed,
|
|
20183
21182
|
className: cn(
|
|
20184
21183
|
"ds:mb-4",
|
|
20185
21184
|
// In rail, the visible section labels disappear and the only
|
|
@@ -20191,27 +21190,31 @@ var SidebarSection = React44.forwardRef(
|
|
|
20191
21190
|
),
|
|
20192
21191
|
...props,
|
|
20193
21192
|
children: [
|
|
20194
|
-
label != null && /* @__PURE__ */
|
|
21193
|
+
(label != null || headerActions != null) && /* @__PURE__ */ jsxs(
|
|
20195
21194
|
"div",
|
|
20196
21195
|
{
|
|
20197
21196
|
...slot(sidebarAnatomy, "section-header"),
|
|
21197
|
+
...collapsed,
|
|
20198
21198
|
className: cn(
|
|
20199
21199
|
"ds:mb-1 ds:flex ds:items-center ds:justify-between ds:px-2.5 ds:py-1",
|
|
20200
21200
|
"ds:transition-opacity ds:duration-[var(--motion-duration-spatial)] ds:ease-[var(--motion-ease-move)] ds:motion-reduce:transition-none",
|
|
20201
21201
|
"ds:opacity-100",
|
|
20202
21202
|
"ds:group-data-[labels=hide]/sidebar:invisible ds:group-data-[labels=hide]/sidebar:opacity-0"
|
|
20203
21203
|
),
|
|
20204
|
-
children:
|
|
20205
|
-
|
|
20206
|
-
|
|
20207
|
-
|
|
20208
|
-
|
|
20209
|
-
|
|
20210
|
-
|
|
20211
|
-
|
|
20212
|
-
|
|
20213
|
-
|
|
20214
|
-
|
|
21204
|
+
children: [
|
|
21205
|
+
label != null && /* @__PURE__ */ jsx(
|
|
21206
|
+
"span",
|
|
21207
|
+
{
|
|
21208
|
+
...slot(sidebarAnatomy, "section-label"),
|
|
21209
|
+
className: cn(
|
|
21210
|
+
"ds:font-mono ds:text-[11px] ds:tracking-[0.14em] ds:uppercase",
|
|
21211
|
+
tone === "muted" ? "ds:text-fg-3" : "ds:text-brand"
|
|
21212
|
+
),
|
|
21213
|
+
children: label
|
|
21214
|
+
}
|
|
21215
|
+
),
|
|
21216
|
+
headerActions
|
|
21217
|
+
]
|
|
20215
21218
|
}
|
|
20216
21219
|
),
|
|
20217
21220
|
children
|
|
@@ -20225,17 +21228,17 @@ function getTextContent(node) {
|
|
|
20225
21228
|
if (node == null || typeof node === "boolean") return "";
|
|
20226
21229
|
if (typeof node === "string" || typeof node === "number") return String(node);
|
|
20227
21230
|
if (Array.isArray(node)) return node.map(getTextContent).filter(Boolean).join(" ");
|
|
20228
|
-
if (
|
|
21231
|
+
if (React45.isValidElement(node)) {
|
|
20229
21232
|
return getTextContent(node.props.children);
|
|
20230
21233
|
}
|
|
20231
21234
|
return "";
|
|
20232
21235
|
}
|
|
20233
|
-
var SidebarLink =
|
|
21236
|
+
var SidebarLink = React45.forwardRef(
|
|
20234
21237
|
function SidebarLink2({ href, icon, active = false, asChild, className, children, "aria-label": ariaLabel, ...props }, ref) {
|
|
20235
21238
|
const Comp = asChild ? Slot : "a";
|
|
20236
21239
|
const accessibleLabel = ariaLabel ?? (asChild ? void 0 : getTextContent(children) || void 0);
|
|
20237
|
-
const labelsHidden =
|
|
20238
|
-
const peekEnabled =
|
|
21240
|
+
const labelsHidden = React45.useContext(SidebarLabelsHiddenContext);
|
|
21241
|
+
const peekEnabled = React45.useContext(SidebarPeekEnabledContext);
|
|
20239
21242
|
const tooltipLabel = ariaLabel ?? (getTextContent(children) || void 0);
|
|
20240
21243
|
const showTooltip = labelsHidden && !peekEnabled && Boolean(tooltipLabel);
|
|
20241
21244
|
const link = /* @__PURE__ */ jsx(
|
|
@@ -20287,6 +21290,7 @@ var SidebarLink = React44.forwardRef(
|
|
|
20287
21290
|
"span",
|
|
20288
21291
|
{
|
|
20289
21292
|
...slot(sidebarAnatomy, "link-label"),
|
|
21293
|
+
...labelsHidden ? { "data-collapsed": "true" } : {},
|
|
20290
21294
|
className: cn(
|
|
20291
21295
|
// Flex row so a trailing <SidebarLinkBadge> (ml-auto) aligns
|
|
20292
21296
|
// to the right edge with a gap from the label, instead of
|
|
@@ -20312,13 +21316,15 @@ var SidebarLink = React44.forwardRef(
|
|
|
20312
21316
|
}
|
|
20313
21317
|
);
|
|
20314
21318
|
SidebarLink.displayName = "SidebarLink";
|
|
20315
|
-
var SidebarLinkLabel =
|
|
21319
|
+
var SidebarLinkLabel = React45.forwardRef(
|
|
20316
21320
|
function SidebarLinkLabel2({ className, ...props }, ref) {
|
|
21321
|
+
const collapsed = useCollapsedAttribute();
|
|
20317
21322
|
return /* @__PURE__ */ jsx(
|
|
20318
21323
|
"span",
|
|
20319
21324
|
{
|
|
20320
21325
|
ref,
|
|
20321
21326
|
...slot(sidebarAnatomy, "link-label"),
|
|
21327
|
+
...collapsed,
|
|
20322
21328
|
className: cn(
|
|
20323
21329
|
// line-clamp-1 (not `truncate`) so multi-word labels clip at a
|
|
20324
21330
|
// word boundary; collapses cleanly with the rail-mode max-width
|
|
@@ -20338,13 +21344,15 @@ var SidebarLinkLabel = React44.forwardRef(
|
|
|
20338
21344
|
}
|
|
20339
21345
|
);
|
|
20340
21346
|
SidebarLinkLabel.displayName = "SidebarLinkLabel";
|
|
20341
|
-
var SidebarLinkAction =
|
|
21347
|
+
var SidebarLinkAction = React45.forwardRef(
|
|
20342
21348
|
function SidebarLinkAction2({ className, ...props }, ref) {
|
|
21349
|
+
const collapsed = useCollapsedAttribute();
|
|
20343
21350
|
return /* @__PURE__ */ jsx(
|
|
20344
21351
|
"span",
|
|
20345
21352
|
{
|
|
20346
21353
|
ref,
|
|
20347
21354
|
...slot(sidebarAnatomy, "link-action"),
|
|
21355
|
+
...collapsed,
|
|
20348
21356
|
className: cn(
|
|
20349
21357
|
"ds:transition-opacity ds:duration-[var(--motion-duration-spatial)] ds:ease-[var(--motion-ease-move)] ds:motion-reduce:transition-none",
|
|
20350
21358
|
"ds:opacity-100",
|
|
@@ -20371,7 +21379,7 @@ var sidebarLinkBadgeVariants = cva(
|
|
|
20371
21379
|
defaultVariants: { tone: "default" }
|
|
20372
21380
|
}
|
|
20373
21381
|
);
|
|
20374
|
-
var SidebarLinkBadge =
|
|
21382
|
+
var SidebarLinkBadge = React45.forwardRef(
|
|
20375
21383
|
function SidebarLinkBadge2({ tone, className, ...props }, ref) {
|
|
20376
21384
|
return /* @__PURE__ */ jsx(
|
|
20377
21385
|
"span",
|
|
@@ -20385,7 +21393,7 @@ var SidebarLinkBadge = React44.forwardRef(
|
|
|
20385
21393
|
}
|
|
20386
21394
|
);
|
|
20387
21395
|
SidebarLinkBadge.displayName = "SidebarLinkBadge";
|
|
20388
|
-
var SidebarLinkGroup =
|
|
21396
|
+
var SidebarLinkGroup = React45.forwardRef(
|
|
20389
21397
|
function SidebarLinkGroup2({
|
|
20390
21398
|
id: idProp,
|
|
20391
21399
|
icon,
|
|
@@ -20401,19 +21409,20 @@ var SidebarLinkGroup = React44.forwardRef(
|
|
|
20401
21409
|
...props
|
|
20402
21410
|
}, ref) {
|
|
20403
21411
|
const messages = useDsMessages("sidebar");
|
|
20404
|
-
const
|
|
21412
|
+
const collapsed = useCollapsedAttribute();
|
|
21413
|
+
const reactId = React45.useId();
|
|
20405
21414
|
const id = idProp ?? reactId;
|
|
20406
|
-
const scope =
|
|
20407
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
21415
|
+
const scope = React45.useContext(SidebarGroupScopeContext);
|
|
21416
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React45.useState(defaultOpen);
|
|
20408
21417
|
const open = controlled ?? uncontrolledOpen;
|
|
20409
|
-
const setOpen =
|
|
21418
|
+
const setOpen = React45.useCallback(
|
|
20410
21419
|
(next) => {
|
|
20411
21420
|
if (controlled === void 0) setUncontrolledOpen(next);
|
|
20412
21421
|
onOpenChange?.(next);
|
|
20413
21422
|
},
|
|
20414
21423
|
[controlled, onOpenChange]
|
|
20415
21424
|
);
|
|
20416
|
-
|
|
21425
|
+
React45.useEffect(() => {
|
|
20417
21426
|
if (scope?.exclusiveId && scope.exclusiveId !== id && open) {
|
|
20418
21427
|
setOpen(false);
|
|
20419
21428
|
}
|
|
@@ -20454,6 +21463,7 @@ var SidebarLinkGroup = React44.forwardRef(
|
|
|
20454
21463
|
"span",
|
|
20455
21464
|
{
|
|
20456
21465
|
...slot(sidebarAnatomy, "link-label"),
|
|
21466
|
+
...collapsed,
|
|
20457
21467
|
className: cn(
|
|
20458
21468
|
// line-clamp-1 (not `truncate`) so multi-word labels clip at a
|
|
20459
21469
|
// word boundary; collapses cleanly with the rail-mode max-width
|
|
@@ -20536,7 +21546,7 @@ var SidebarLinkGroup = React44.forwardRef(
|
|
|
20536
21546
|
}
|
|
20537
21547
|
);
|
|
20538
21548
|
SidebarLinkGroup.displayName = "SidebarLinkGroup";
|
|
20539
|
-
var SidebarFooter =
|
|
21549
|
+
var SidebarFooter = React45.forwardRef(
|
|
20540
21550
|
function SidebarFooter2({ className, ...props }, ref) {
|
|
20541
21551
|
return /* @__PURE__ */ jsx(
|
|
20542
21552
|
"div",
|
|
@@ -20554,12 +21564,14 @@ var SidebarFooter = React44.forwardRef(
|
|
|
20554
21564
|
}
|
|
20555
21565
|
);
|
|
20556
21566
|
SidebarFooter.displayName = "SidebarFooter";
|
|
20557
|
-
var SidebarUser =
|
|
21567
|
+
var SidebarUser = React45.forwardRef(function SidebarUser2({ name, subtitle, avatarSrc, className, ...props }, ref) {
|
|
21568
|
+
const collapsed = useCollapsedAttribute();
|
|
20558
21569
|
return /* @__PURE__ */ jsxs(
|
|
20559
21570
|
"div",
|
|
20560
21571
|
{
|
|
20561
21572
|
ref,
|
|
20562
21573
|
...slot(sidebarAnatomy, "user"),
|
|
21574
|
+
...collapsed,
|
|
20563
21575
|
className: cn("ds:flex ds:min-w-0 ds:items-center ds:gap-2.5", className),
|
|
20564
21576
|
...props,
|
|
20565
21577
|
children: [
|
|
@@ -20598,7 +21610,35 @@ var SidebarUser = React44.forwardRef(function SidebarUser2({ name, subtitle, ava
|
|
|
20598
21610
|
);
|
|
20599
21611
|
});
|
|
20600
21612
|
SidebarUser.displayName = "SidebarUser";
|
|
20601
|
-
|
|
21613
|
+
function SidebarDrawer({
|
|
21614
|
+
open,
|
|
21615
|
+
defaultOpen,
|
|
21616
|
+
onOpenChange,
|
|
21617
|
+
label,
|
|
21618
|
+
className,
|
|
21619
|
+
children
|
|
21620
|
+
}) {
|
|
21621
|
+
const messages = useDsMessages("sidebar");
|
|
21622
|
+
return /* @__PURE__ */ jsx(Sheet, { open, defaultOpen, onOpenChange, children: /* @__PURE__ */ jsxs(
|
|
21623
|
+
SheetContent,
|
|
21624
|
+
{
|
|
21625
|
+
side: "left",
|
|
21626
|
+
"data-mode": "mobile",
|
|
21627
|
+
"data-labels": "show",
|
|
21628
|
+
style: { width: "var(--ds-layout-shell-sidebar-width, var(--shell-sidebar-w))" },
|
|
21629
|
+
className: cn(
|
|
21630
|
+
"ds:group/sidebar group/sidebar ds:scrollbar-thin ds:bg-bg-2 ds:flex ds:flex-col ds:overflow-y-auto ds:px-3 ds:pt-4 ds:pb-4",
|
|
21631
|
+
className
|
|
21632
|
+
),
|
|
21633
|
+
children: [
|
|
21634
|
+
/* @__PURE__ */ jsx(SheetTitle, { className: "ds:sr-only", children: label ?? messages.navigation }),
|
|
21635
|
+
children
|
|
21636
|
+
]
|
|
21637
|
+
}
|
|
21638
|
+
) });
|
|
21639
|
+
}
|
|
21640
|
+
SidebarDrawer.displayName = "SidebarDrawer";
|
|
21641
|
+
var SidebarBrandSwitcher = React45.forwardRef(
|
|
20602
21642
|
function SidebarBrandSwitcher2({
|
|
20603
21643
|
brand,
|
|
20604
21644
|
label,
|
|
@@ -20619,7 +21659,7 @@ var SidebarBrandSwitcher = React44.forwardRef(
|
|
|
20619
21659
|
rowClassName,
|
|
20620
21660
|
trailing
|
|
20621
21661
|
}, ref) {
|
|
20622
|
-
const [open, setOpen] =
|
|
21662
|
+
const [open, setOpen] = React45.useState(false);
|
|
20623
21663
|
useSidebarPeekLock(open);
|
|
20624
21664
|
const others = items.filter((p) => p.id !== current.id);
|
|
20625
21665
|
return (
|
|
@@ -20782,7 +21822,7 @@ function SidebarBrandSwitcherOtherRow({
|
|
|
20782
21822
|
isLaunching
|
|
20783
21823
|
}) {
|
|
20784
21824
|
const reachable = item.available !== false;
|
|
20785
|
-
const [launching, setLaunching] =
|
|
21825
|
+
const [launching, setLaunching] = React45.useState(false);
|
|
20786
21826
|
const externalLaunching = isLaunching?.(item) ?? false;
|
|
20787
21827
|
const busy = launching || externalLaunching;
|
|
20788
21828
|
const handleSelect = async () => {
|
|
@@ -20926,11 +21966,29 @@ var AppHeaderActions = forwardRef(
|
|
|
20926
21966
|
}
|
|
20927
21967
|
);
|
|
20928
21968
|
AppHeaderActions.displayName = "AppHeaderActions";
|
|
20929
|
-
var PageHeader = forwardRef(function PageHeader2({
|
|
21969
|
+
var PageHeader = forwardRef(function PageHeader2({
|
|
21970
|
+
eyebrow,
|
|
21971
|
+
title,
|
|
21972
|
+
description,
|
|
21973
|
+
actions,
|
|
21974
|
+
meta,
|
|
21975
|
+
headingLevel = 1,
|
|
21976
|
+
titleSize,
|
|
21977
|
+
className,
|
|
21978
|
+
...props
|
|
21979
|
+
}, ref) {
|
|
20930
21980
|
return /* @__PURE__ */ jsxs("header", { ref, className: cn("ds:mb-7", className), ...props, children: [
|
|
20931
21981
|
eyebrow && /* @__PURE__ */ jsx("div", { className: "ds:mb-1.5", children: eyebrow }),
|
|
20932
21982
|
/* @__PURE__ */ jsxs("div", { className: "ds:flex ds:flex-wrap ds:items-start ds:justify-between ds:gap-3", children: [
|
|
20933
|
-
/* @__PURE__ */ jsx(
|
|
21983
|
+
/* @__PURE__ */ jsx(
|
|
21984
|
+
Heading,
|
|
21985
|
+
{
|
|
21986
|
+
level: headingLevel,
|
|
21987
|
+
size: titleSize,
|
|
21988
|
+
className: titleSize ? void 0 : "ds:text-[26px] ds:leading-tight ds:tracking-tight",
|
|
21989
|
+
children: title
|
|
21990
|
+
}
|
|
21991
|
+
),
|
|
20934
21992
|
actions && /* @__PURE__ */ jsx("div", { className: "ds:flex ds:shrink-0 ds:items-center ds:gap-2", children: actions })
|
|
20935
21993
|
] }),
|
|
20936
21994
|
description && /* @__PURE__ */ jsx("p", { className: "ds:text-fg-3 ds:mt-2 ds:max-w-2xl ds:text-sm ds:leading-relaxed", children: description }),
|
|
@@ -21310,66 +22368,25 @@ var DataTableResultsCount = forwardRef(
|
|
|
21310
22368
|
);
|
|
21311
22369
|
DataTableResultsCount.displayName = "DataTableResultsCount";
|
|
21312
22370
|
var DataTableHead = forwardRef(
|
|
21313
|
-
function DataTableHead2(
|
|
21314
|
-
return /* @__PURE__ */ jsx(
|
|
21315
|
-
"thead",
|
|
21316
|
-
{
|
|
21317
|
-
ref,
|
|
21318
|
-
...slot(dataTableAnatomy, "header"),
|
|
21319
|
-
className: cn("ds:[&_tr]:border-rule ds:[&_tr]:border-b", className),
|
|
21320
|
-
...props
|
|
21321
|
-
}
|
|
21322
|
-
);
|
|
22371
|
+
function DataTableHead2(props, ref) {
|
|
22372
|
+
return /* @__PURE__ */ jsx(TableHeader, { ref, ...slot(dataTableAnatomy, "header"), ...props });
|
|
21323
22373
|
}
|
|
21324
22374
|
);
|
|
21325
22375
|
DataTableHead.displayName = "DataTableHead";
|
|
21326
22376
|
var DataTableBody = forwardRef(
|
|
21327
|
-
function DataTableBody2(
|
|
21328
|
-
return /* @__PURE__ */ jsx(
|
|
21329
|
-
"tbody",
|
|
21330
|
-
{
|
|
21331
|
-
ref,
|
|
21332
|
-
...slot(dataTableAnatomy, "body"),
|
|
21333
|
-
className: cn("ds:[&_tr:last-child]:border-0", className),
|
|
21334
|
-
...props
|
|
21335
|
-
}
|
|
21336
|
-
);
|
|
22377
|
+
function DataTableBody2(props, ref) {
|
|
22378
|
+
return /* @__PURE__ */ jsx(TableBody, { ref, ...slot(dataTableAnatomy, "body"), ...props });
|
|
21337
22379
|
}
|
|
21338
22380
|
);
|
|
21339
22381
|
DataTableBody.displayName = "DataTableBody";
|
|
21340
22382
|
var DataTableRow = forwardRef(
|
|
21341
|
-
function DataTableRow2(
|
|
21342
|
-
return /* @__PURE__ */ jsx(
|
|
21343
|
-
"tr",
|
|
21344
|
-
{
|
|
21345
|
-
ref,
|
|
21346
|
-
"data-state": selected ? "selected" : void 0,
|
|
21347
|
-
...slot(dataTableAnatomy, "row"),
|
|
21348
|
-
className: cn(
|
|
21349
|
-
"ds:border-rule-soft ds:border-b",
|
|
21350
|
-
microInteractions.selection,
|
|
21351
|
-
// Selected hover stays in the brand tint (G15) — when both states fire,
|
|
21352
|
-
// hover:bg-bg-2 was previously winning and dropping the row out of
|
|
21353
|
-
// the selected tint, which read as the row deselecting on hover.
|
|
21354
|
-
selected ? "ds:bg-brand-bg ds:hover:bg-brand-bg-hover" : "ds:hover:bg-surface-hover",
|
|
21355
|
-
className
|
|
21356
|
-
),
|
|
21357
|
-
...props
|
|
21358
|
-
}
|
|
21359
|
-
);
|
|
22383
|
+
function DataTableRow2(props, ref) {
|
|
22384
|
+
return /* @__PURE__ */ jsx(TableRow, { ref, ...slot(dataTableAnatomy, "row"), ...props });
|
|
21360
22385
|
}
|
|
21361
22386
|
);
|
|
21362
22387
|
DataTableRow.displayName = "DataTableRow";
|
|
21363
22388
|
var DataTableHeader = forwardRef(
|
|
21364
|
-
function DataTableHeader2({
|
|
21365
|
-
sortable = false,
|
|
21366
|
-
defaultSort,
|
|
21367
|
-
sort: controlledSort,
|
|
21368
|
-
onSortChange,
|
|
21369
|
-
children,
|
|
21370
|
-
className,
|
|
21371
|
-
...props
|
|
21372
|
-
}, ref) {
|
|
22389
|
+
function DataTableHeader2({ sortable = false, defaultSort, sort: controlledSort, onSortChange, children, ...props }, ref) {
|
|
21373
22390
|
const [uncontrolledSort, setUncontrolledSort] = useState(
|
|
21374
22391
|
defaultSort ?? null
|
|
21375
22392
|
);
|
|
@@ -21381,52 +22398,43 @@ var DataTableHeader = forwardRef(
|
|
|
21381
22398
|
if (!isControlled) setUncontrolledSort(next);
|
|
21382
22399
|
onSortChange?.(next);
|
|
21383
22400
|
}, [sortable, currentSort, isControlled, onSortChange]);
|
|
21384
|
-
const indicator = sortable ? /* @__PURE__ */ jsx(
|
|
21385
|
-
"span",
|
|
21386
|
-
{
|
|
21387
|
-
"aria-hidden": "true",
|
|
21388
|
-
...slot(dataTableAnatomy, "head-indicator"),
|
|
21389
|
-
className: cn(
|
|
21390
|
-
"ds:text-fg-5 ds:ml-1 ds:inline-flex ds:shrink-0 ds:items-center ds:justify-center",
|
|
21391
|
-
currentSort && "ds:text-fg-3"
|
|
21392
|
-
),
|
|
21393
|
-
children: currentSort === "asc" ? /* @__PURE__ */ jsx(ChevronUpIcon, { className: "ds:size-3", strokeWidth: 2.2 }) : currentSort === "desc" ? /* @__PURE__ */ jsx(ChevronDownIcon, { className: "ds:size-3", strokeWidth: 2.2 }) : /* @__PURE__ */ jsx(ChevronsUpDownIcon, { className: "ds:size-3", strokeWidth: 2 })
|
|
21394
|
-
}
|
|
21395
|
-
) : null;
|
|
21396
22401
|
const ariaSort = sortable ? currentSort === "asc" ? "ascending" : currentSort === "desc" ? "descending" : "none" : void 0;
|
|
21397
22402
|
return /* @__PURE__ */ jsx(
|
|
21398
|
-
|
|
22403
|
+
TableHead,
|
|
21399
22404
|
{
|
|
21400
22405
|
ref,
|
|
21401
22406
|
scope: "col",
|
|
21402
22407
|
"aria-sort": ariaSort,
|
|
21403
22408
|
...slot(dataTableAnatomy, "head"),
|
|
21404
22409
|
...stateAttributes({ state: currentSort ?? void 0 }),
|
|
21405
|
-
className: cn(
|
|
21406
|
-
"ds:h-11 ds:px-4 ds:py-2.5 ds:text-left ds:align-middle ds:whitespace-nowrap",
|
|
21407
|
-
"ds:font-sans ds:text-[14px] ds:font-medium ds:tracking-normal ds:normal-case",
|
|
21408
|
-
"ds:text-fg-3 ds:bg-surface-2",
|
|
21409
|
-
"ds:border-rule ds:border-b",
|
|
21410
|
-
"ds:[&:has([role=checkbox])]:pr-0",
|
|
21411
|
-
className
|
|
21412
|
-
),
|
|
21413
22410
|
...props,
|
|
21414
22411
|
children: sortable ? /* @__PURE__ */ jsxs(
|
|
21415
|
-
|
|
22412
|
+
Pressable,
|
|
21416
22413
|
{
|
|
21417
|
-
type: "button",
|
|
21418
22414
|
onClick: handleClick,
|
|
21419
22415
|
...slot(dataTableAnatomy, "head-button"),
|
|
21420
22416
|
className: cn(
|
|
21421
|
-
|
|
21422
|
-
|
|
21423
|
-
"ds
|
|
21424
|
-
"ds:
|
|
21425
|
-
"ds:
|
|
22417
|
+
// Mirrors the sort button of `TableHead` (table.tsx) on the
|
|
22418
|
+
// DataTable's own `head-button` slot.
|
|
22419
|
+
"ds:-mx-1 ds:-my-1 ds:inline-flex ds:items-center ds:gap-1 ds:rounded-icon ds:px-1 ds:py-1",
|
|
22420
|
+
"ds:font-sans ds:text-sm ds:font-medium ds:tracking-normal ds:normal-case ds:text-fg-3",
|
|
22421
|
+
"ds:transition-colors ds:duration-[var(--duration-fast)] ds:ease-[var(--ease-out-quart)] ds:motion-reduce:transition-none",
|
|
22422
|
+
"ds:hover:text-fg"
|
|
21426
22423
|
),
|
|
21427
22424
|
children: [
|
|
21428
22425
|
children,
|
|
21429
|
-
|
|
22426
|
+
/* @__PURE__ */ jsx(
|
|
22427
|
+
"span",
|
|
22428
|
+
{
|
|
22429
|
+
"aria-hidden": "true",
|
|
22430
|
+
...slot(dataTableAnatomy, "head-indicator"),
|
|
22431
|
+
className: cn(
|
|
22432
|
+
"ds:text-fg-5 ds:ml-1 ds:inline-flex ds:shrink-0 ds:items-center ds:justify-center",
|
|
22433
|
+
currentSort && "ds:text-fg-3"
|
|
22434
|
+
),
|
|
22435
|
+
children: currentSort === "asc" ? /* @__PURE__ */ jsx(ChevronUpIcon, { className: "ds:size-3", strokeWidth: 2.2 }) : currentSort === "desc" ? /* @__PURE__ */ jsx(ChevronDownIcon, { className: "ds:size-3", strokeWidth: 2.2 }) : /* @__PURE__ */ jsx(ChevronsUpDownIcon, { className: "ds:size-3", strokeWidth: 2 })
|
|
22436
|
+
}
|
|
22437
|
+
)
|
|
21430
22438
|
]
|
|
21431
22439
|
}
|
|
21432
22440
|
) : children
|
|
@@ -21435,35 +22443,21 @@ var DataTableHeader = forwardRef(
|
|
|
21435
22443
|
}
|
|
21436
22444
|
);
|
|
21437
22445
|
DataTableHeader.displayName = "DataTableHeader";
|
|
21438
|
-
var cellBase = "ds:px-4 ds:py-3 ds:align-middle";
|
|
21439
22446
|
var DataTableCell = forwardRef(
|
|
21440
|
-
function DataTableCell2(
|
|
21441
|
-
return /* @__PURE__ */ jsx(
|
|
21442
|
-
"td",
|
|
21443
|
-
{
|
|
21444
|
-
ref,
|
|
21445
|
-
...slot(dataTableAnatomy, "cell"),
|
|
21446
|
-
className: cn(
|
|
21447
|
-
cellBase,
|
|
21448
|
-
"ds:text-fg-2 ds:text-[13px]",
|
|
21449
|
-
"ds:[&:has([role=checkbox])]:pr-0",
|
|
21450
|
-
className
|
|
21451
|
-
),
|
|
21452
|
-
...props
|
|
21453
|
-
}
|
|
21454
|
-
);
|
|
22447
|
+
function DataTableCell2(props, ref) {
|
|
22448
|
+
return /* @__PURE__ */ jsx(TableCell, { ref, ...slot(dataTableAnatomy, "cell"), ...props });
|
|
21455
22449
|
}
|
|
21456
22450
|
);
|
|
21457
22451
|
DataTableCell.displayName = "DataTableCell";
|
|
21458
22452
|
var DataTableCellName = forwardRef(
|
|
21459
22453
|
function DataTableCellName2({ className, ...props }, ref) {
|
|
21460
22454
|
return /* @__PURE__ */ jsx(
|
|
21461
|
-
|
|
22455
|
+
TableCell,
|
|
21462
22456
|
{
|
|
21463
22457
|
ref,
|
|
21464
22458
|
...slot(dataTableAnatomy, "cell"),
|
|
21465
22459
|
...stateAttributes({ variant: "name" }),
|
|
21466
|
-
className: cn(
|
|
22460
|
+
className: cn("ds:font-display ds:text-fg ds:font-medium", className),
|
|
21467
22461
|
...props
|
|
21468
22462
|
}
|
|
21469
22463
|
);
|
|
@@ -21471,15 +22465,14 @@ var DataTableCellName = forwardRef(
|
|
|
21471
22465
|
);
|
|
21472
22466
|
DataTableCellName.displayName = "DataTableCellName";
|
|
21473
22467
|
var DataTableCellMono = forwardRef(
|
|
21474
|
-
function DataTableCellMono2({ className,
|
|
22468
|
+
function DataTableCellMono2({ className, ...props }, ref) {
|
|
21475
22469
|
return /* @__PURE__ */ jsx(
|
|
21476
|
-
|
|
22470
|
+
TableCell,
|
|
21477
22471
|
{
|
|
21478
22472
|
ref,
|
|
21479
22473
|
...slot(dataTableAnatomy, "cell"),
|
|
21480
22474
|
...stateAttributes({ variant: "mono" }),
|
|
21481
|
-
className: cn(
|
|
21482
|
-
style,
|
|
22475
|
+
className: cn("ds:font-sans ds:tabular-nums", className),
|
|
21483
22476
|
...props
|
|
21484
22477
|
}
|
|
21485
22478
|
);
|
|
@@ -21487,15 +22480,14 @@ var DataTableCellMono = forwardRef(
|
|
|
21487
22480
|
);
|
|
21488
22481
|
DataTableCellMono.displayName = "DataTableCellMono";
|
|
21489
22482
|
var DataTableCellId = forwardRef(
|
|
21490
|
-
function DataTableCellId2({ className,
|
|
22483
|
+
function DataTableCellId2({ className, ...props }, ref) {
|
|
21491
22484
|
return /* @__PURE__ */ jsx(
|
|
21492
|
-
|
|
22485
|
+
TableCell,
|
|
21493
22486
|
{
|
|
21494
22487
|
ref,
|
|
21495
22488
|
...slot(dataTableAnatomy, "cell"),
|
|
21496
22489
|
...stateAttributes({ variant: "id" }),
|
|
21497
|
-
className: cn(
|
|
21498
|
-
style,
|
|
22490
|
+
className: cn("ds:font-sans ds:text-fg-4 ds:text-xs ds:tabular-nums", className),
|
|
21499
22491
|
...props
|
|
21500
22492
|
}
|
|
21501
22493
|
);
|
|
@@ -21510,19 +22502,18 @@ var dueDateFormatter = new Intl.DateTimeFormat("en-US", {
|
|
|
21510
22502
|
year: "numeric"
|
|
21511
22503
|
});
|
|
21512
22504
|
var DataTableCellDue = forwardRef(
|
|
21513
|
-
function DataTableCellDue2({ value, children, className,
|
|
22505
|
+
function DataTableCellDue2({ value, children, className, ...props }, ref) {
|
|
21514
22506
|
const days = Math.floor((value.getTime() - Date.now()) / MS_PER_DAY);
|
|
21515
22507
|
const tone = days < 0 ? "ds:text-danger-fg ds:font-medium" : days < DUE_NEAR_THRESHOLD_DAYS ? "ds:text-warning-fg ds:font-medium" : "ds:text-fg-3";
|
|
21516
22508
|
const ariaState = days < 0 ? "overdue" : days < DUE_NEAR_THRESHOLD_DAYS ? "near" : "future";
|
|
21517
22509
|
return /* @__PURE__ */ jsx(
|
|
21518
|
-
|
|
22510
|
+
TableCell,
|
|
21519
22511
|
{
|
|
21520
22512
|
ref,
|
|
21521
22513
|
"data-due-state": ariaState,
|
|
21522
22514
|
...slot(dataTableAnatomy, "cell"),
|
|
21523
22515
|
...stateAttributes({ variant: "due" }),
|
|
21524
|
-
className: cn(
|
|
21525
|
-
style,
|
|
22516
|
+
className: cn("ds:font-sans ds:tabular-nums", tone, className),
|
|
21526
22517
|
...props,
|
|
21527
22518
|
children: children ?? dueDateFormatter.format(value)
|
|
21528
22519
|
}
|
|
@@ -21541,17 +22532,13 @@ var DataTableCheckbox = forwardRef(
|
|
|
21541
22532
|
className,
|
|
21542
22533
|
...props
|
|
21543
22534
|
}, ref) {
|
|
21544
|
-
const Cell = asHeader ?
|
|
22535
|
+
const Cell = asHeader ? TableHead : TableCell;
|
|
21545
22536
|
return /* @__PURE__ */ jsx(
|
|
21546
22537
|
Cell,
|
|
21547
22538
|
{
|
|
21548
22539
|
ref,
|
|
21549
22540
|
...slot(dataTableAnatomy, "checkbox-cell"),
|
|
21550
|
-
className: cn(
|
|
21551
|
-
"ds:w-8 ds:px-4 ds:py-3 ds:pr-0 ds:align-middle",
|
|
21552
|
-
asHeader && "ds:bg-surface-2 ds:border-rule ds:h-11 ds:border-b",
|
|
21553
|
-
className
|
|
21554
|
-
),
|
|
22541
|
+
className: cn("ds:w-8 ds:pr-0", className),
|
|
21555
22542
|
...props,
|
|
21556
22543
|
children: /* @__PURE__ */ jsx(
|
|
21557
22544
|
Checkbox,
|
|
@@ -21568,34 +22555,74 @@ var DataTableCheckbox = forwardRef(
|
|
|
21568
22555
|
}
|
|
21569
22556
|
);
|
|
21570
22557
|
DataTableCheckbox.displayName = "DataTableCheckbox";
|
|
21571
|
-
var
|
|
21572
|
-
|
|
21573
|
-
|
|
22558
|
+
var DEFAULT_WIDTHS = ["60%", "40%", "75%", "50%", "35%"];
|
|
22559
|
+
var TableLoading = forwardRef(
|
|
22560
|
+
function TableLoading2({
|
|
22561
|
+
columns,
|
|
22562
|
+
rows = 5,
|
|
22563
|
+
widths = DEFAULT_WIDTHS,
|
|
22564
|
+
label,
|
|
22565
|
+
messages: messagesProp,
|
|
22566
|
+
className,
|
|
22567
|
+
...props
|
|
22568
|
+
}, ref) {
|
|
22569
|
+
const messages = useDsMessages("tableStates", messagesProp);
|
|
22570
|
+
const cycle = widths.length > 0 ? widths : DEFAULT_WIDTHS;
|
|
21574
22571
|
return /* @__PURE__ */ jsx(
|
|
21575
|
-
|
|
22572
|
+
DataTableBody,
|
|
21576
22573
|
{
|
|
21577
22574
|
ref,
|
|
21578
|
-
|
|
21579
|
-
|
|
21580
|
-
|
|
21581
|
-
|
|
21582
|
-
|
|
21583
|
-
|
|
21584
|
-
pageSize,
|
|
21585
|
-
className: cn("ds:mt-4", className),
|
|
21586
|
-
...props
|
|
22575
|
+
"aria-busy": "true",
|
|
22576
|
+
"aria-label": label ?? messages.loading,
|
|
22577
|
+
"data-state": "loading",
|
|
22578
|
+
className,
|
|
22579
|
+
...props,
|
|
22580
|
+
children: Array.from({ length: rows }).map((_, r) => /* @__PURE__ */ jsx(DataTableRow, { className: "ds:hover:bg-transparent", children: Array.from({ length: columns }).map((_2, c) => /* @__PURE__ */ jsx(DataTableCell, { children: /* @__PURE__ */ jsx(Skeleton, { className: "ds:h-3.5", style: { width: cycle[c % cycle.length] } }) }, c)) }, r))
|
|
21587
22581
|
}
|
|
21588
22582
|
);
|
|
21589
22583
|
}
|
|
21590
22584
|
);
|
|
21591
|
-
|
|
22585
|
+
TableLoading.displayName = "TableLoading";
|
|
22586
|
+
var TableEmpty = forwardRef(function TableEmpty2({ columns, icon, title, description, action, messages: messagesProp, className, ...props }, ref) {
|
|
22587
|
+
const messages = useDsMessages("tableStates", messagesProp);
|
|
22588
|
+
return /* @__PURE__ */ jsx(DataTableBody, { ref, "data-state": "empty", className, ...props, children: /* @__PURE__ */ jsx(DataTableRow, { className: "ds:hover:bg-transparent", children: /* @__PURE__ */ jsx(DataTableCell, { colSpan: columns, className: "ds:p-0", children: /* @__PURE__ */ jsx(
|
|
22589
|
+
EmptyState,
|
|
22590
|
+
{
|
|
22591
|
+
size: "compact",
|
|
22592
|
+
icon,
|
|
22593
|
+
title: title ?? messages.empty,
|
|
22594
|
+
description,
|
|
22595
|
+
action
|
|
22596
|
+
}
|
|
22597
|
+
) }) }) });
|
|
22598
|
+
});
|
|
22599
|
+
TableEmpty.displayName = "TableEmpty";
|
|
22600
|
+
var TableError = forwardRef(function TableError2({ columns, icon, title, description, onRetry, action, messages, className, ...props }, ref) {
|
|
22601
|
+
return /* @__PURE__ */ jsx(DataTableBody, { ref, "data-state": "error", className, ...props, children: /* @__PURE__ */ jsx(DataTableRow, { className: "ds:hover:bg-transparent", children: /* @__PURE__ */ jsx(DataTableCell, { colSpan: columns, className: "ds:p-0", children: /* @__PURE__ */ jsx(
|
|
22602
|
+
ErrorState,
|
|
22603
|
+
{
|
|
22604
|
+
size: "compact",
|
|
22605
|
+
messages,
|
|
22606
|
+
icon,
|
|
22607
|
+
title,
|
|
22608
|
+
description,
|
|
22609
|
+
onRetry,
|
|
22610
|
+
action
|
|
22611
|
+
}
|
|
22612
|
+
) }) }) });
|
|
22613
|
+
});
|
|
22614
|
+
TableError.displayName = "TableError";
|
|
21592
22615
|
var ALL = "__all";
|
|
22616
|
+
var SEARCH_ONLY = "__search:";
|
|
21593
22617
|
function colStyle(width) {
|
|
21594
22618
|
if (!width) return void 0;
|
|
21595
22619
|
const flexible = width.match(/minmax\(\s*([\d.]+)px/);
|
|
21596
22620
|
if (flexible) return { minWidth: `${flexible[1]}px` };
|
|
21597
22621
|
return { width, minWidth: width };
|
|
21598
22622
|
}
|
|
22623
|
+
var toControllerSort = (sort) => sort === void 0 ? void 0 : sort && { columnId: sort.key, direction: sort.dir };
|
|
22624
|
+
var fromControllerSort = (sort) => sort && { key: sort.columnId, dir: sort.direction };
|
|
22625
|
+
var fieldText = (row, key) => String(row[key] ?? "");
|
|
21599
22626
|
function DataTableView({
|
|
21600
22627
|
columns,
|
|
21601
22628
|
data,
|
|
@@ -21603,6 +22630,12 @@ function DataTableView({
|
|
|
21603
22630
|
searchKeys = [],
|
|
21604
22631
|
searchPlaceholder = "Search\u2026",
|
|
21605
22632
|
initialSort = null,
|
|
22633
|
+
sorting: sortingProp,
|
|
22634
|
+
onSortingChange,
|
|
22635
|
+
page: pageProp,
|
|
22636
|
+
onPageChange,
|
|
22637
|
+
search: searchProp,
|
|
22638
|
+
onSearchChange,
|
|
21606
22639
|
onRowClick,
|
|
21607
22640
|
rowKey = "id",
|
|
21608
22641
|
pageSize = 15,
|
|
@@ -21610,86 +22643,93 @@ function DataTableView({
|
|
|
21610
22643
|
selection,
|
|
21611
22644
|
className
|
|
21612
22645
|
}) {
|
|
21613
|
-
const [
|
|
21614
|
-
const
|
|
21615
|
-
const
|
|
21616
|
-
|
|
21617
|
-
|
|
21618
|
-
|
|
21619
|
-
|
|
21620
|
-
|
|
21621
|
-
|
|
21622
|
-
|
|
21623
|
-
|
|
21624
|
-
|
|
21625
|
-
|
|
21626
|
-
|
|
21627
|
-
|
|
21628
|
-
|
|
21629
|
-
|
|
21630
|
-
|
|
21631
|
-
)
|
|
21632
|
-
if (!hit) return false;
|
|
21633
|
-
}
|
|
21634
|
-
return true;
|
|
21635
|
-
});
|
|
21636
|
-
if (sort) {
|
|
21637
|
-
const col = columns.find((c) => c.key === sort.key);
|
|
21638
|
-
const accessor = col?.sortValue ?? ((row) => row[sort.key]);
|
|
21639
|
-
const dir = sort.dir === "asc" ? 1 : -1;
|
|
21640
|
-
rows = [...rows].sort((a, b) => {
|
|
21641
|
-
let av = accessor(a);
|
|
21642
|
-
let bv = accessor(b);
|
|
21643
|
-
if (typeof av === "string") av = av.toLowerCase();
|
|
21644
|
-
if (typeof bv === "string") bv = bv.toLowerCase();
|
|
21645
|
-
if (av == null) av = sort.dir === "asc" ? "\uFFFF" : "";
|
|
21646
|
-
if (bv == null) bv = sort.dir === "asc" ? "\uFFFF" : "";
|
|
21647
|
-
return av < bv ? -dir : av > bv ? dir : 0;
|
|
22646
|
+
const [uncontrolledPage, setUncontrolledPage] = useState(1);
|
|
22647
|
+
const page = pageProp ?? uncontrolledPage;
|
|
22648
|
+
const controllerColumns = useMemo(() => {
|
|
22649
|
+
const searched = new Set(searchKeys);
|
|
22650
|
+
const result = columns.map((c) => ({
|
|
22651
|
+
id: c.key,
|
|
22652
|
+
header: c.header,
|
|
22653
|
+
sortable: c.sortable,
|
|
22654
|
+
sortValue: c.sortValue,
|
|
22655
|
+
searchable: searched.has(c.key),
|
|
22656
|
+
searchText: (row) => fieldText(row, c.key)
|
|
22657
|
+
}));
|
|
22658
|
+
for (const key of searchKeys) {
|
|
22659
|
+
if (columns.some((c) => c.key === key)) continue;
|
|
22660
|
+
result.push({
|
|
22661
|
+
id: `${SEARCH_ONLY}${key}`,
|
|
22662
|
+
header: null,
|
|
22663
|
+
searchable: true,
|
|
22664
|
+
searchText: (row) => fieldText(row, key)
|
|
21648
22665
|
});
|
|
21649
22666
|
}
|
|
21650
|
-
return
|
|
21651
|
-
}, [
|
|
21652
|
-
const
|
|
21653
|
-
|
|
21654
|
-
|
|
21655
|
-
|
|
22667
|
+
return result;
|
|
22668
|
+
}, [columns, searchKeys]);
|
|
22669
|
+
const filterDefinitions = useMemo(
|
|
22670
|
+
() => filters.map((filter) => ({
|
|
22671
|
+
id: filter.key,
|
|
22672
|
+
label: filter.label ?? filter.key,
|
|
22673
|
+
options: filter.options.map((o) => typeof o === "string" ? { value: o, label: o } : o),
|
|
22674
|
+
match: filter.match
|
|
22675
|
+
})),
|
|
22676
|
+
[filters]
|
|
22677
|
+
);
|
|
22678
|
+
const getRowId = useCallback((row) => String(row[rowKey]), [rowKey]);
|
|
22679
|
+
const selectedIds = selection?.selectedIds;
|
|
22680
|
+
const controlledSelection = useMemo(
|
|
22681
|
+
() => selectedIds ? Array.from(selectedIds) : void 0,
|
|
22682
|
+
[selectedIds]
|
|
22683
|
+
);
|
|
22684
|
+
const table = useDataTable({
|
|
22685
|
+
data,
|
|
22686
|
+
columns: controllerColumns,
|
|
22687
|
+
filterDefinitions,
|
|
22688
|
+
getRowId,
|
|
22689
|
+
isRowSelectable: selection?.isRowSelectable,
|
|
22690
|
+
sorting: toControllerSort(sortingProp),
|
|
22691
|
+
defaultSorting: toControllerSort(initialSort),
|
|
22692
|
+
onSortingChange: onSortingChange ? (next) => onSortingChange(fromControllerSort(next)) : void 0,
|
|
22693
|
+
pagination: { page, pageSize },
|
|
22694
|
+
onPaginationChange: (next) => {
|
|
22695
|
+
setUncontrolledPage(next.page);
|
|
22696
|
+
onPageChange?.(next.page);
|
|
22697
|
+
},
|
|
22698
|
+
// Without search keys nothing is searchable, so a query must not hide every row.
|
|
22699
|
+
search: searchKeys.length > 0 ? searchProp : "",
|
|
22700
|
+
onSearchChange,
|
|
22701
|
+
selection: controlledSelection,
|
|
22702
|
+
onSelectionChange: selection ? (next) => selection.onSelectionChange(new Set(next)) : void 0
|
|
22703
|
+
});
|
|
22704
|
+
const total = table.pagination.rowCount;
|
|
21656
22705
|
const hasToolbar = searchKeys.length > 0 || filters.length > 0;
|
|
21657
22706
|
const selectCol = selection != null;
|
|
21658
|
-
const idOf = (row) => String(row[rowKey]);
|
|
21659
22707
|
const canSelect = (row) => selection?.isRowSelectable?.(row) ?? true;
|
|
21660
|
-
const
|
|
21661
|
-
const
|
|
22708
|
+
const filteredScope = selection?.selectAllScope === "filtered";
|
|
22709
|
+
const scopeIds = selection ? filteredScope ? table.matchingRows.filter(canSelect).map(getRowId) : table.rows.filter((r) => r.selectable).map((r) => r.id) : [];
|
|
22710
|
+
const selectedInScope = scopeIds.filter((id) => table.selection.isSelected(id));
|
|
21662
22711
|
const allInScopeSelected = scopeIds.length > 0 && selectedInScope.length === scopeIds.length;
|
|
21663
22712
|
const someInScopeSelected = selectedInScope.length > 0 && !allInScopeSelected;
|
|
21664
22713
|
const toggleAll = () => {
|
|
21665
22714
|
if (!selection) return;
|
|
21666
|
-
|
|
21667
|
-
|
|
21668
|
-
|
|
21669
|
-
|
|
22715
|
+
if (!filteredScope) {
|
|
22716
|
+
table.selection.togglePage();
|
|
22717
|
+
} else if (allInScopeSelected) {
|
|
22718
|
+
const drop = new Set(scopeIds);
|
|
22719
|
+
table.selection.set(table.selection.value.filter((id) => !drop.has(id)));
|
|
22720
|
+
} else {
|
|
22721
|
+
table.selection.selectAllMatching();
|
|
21670
22722
|
}
|
|
21671
|
-
selection.onSelectionChange(next);
|
|
21672
|
-
};
|
|
21673
|
-
const toggleRow = (row) => {
|
|
21674
|
-
if (!selection) return;
|
|
21675
|
-
const id = idOf(row);
|
|
21676
|
-
const next = new Set(selection.selectedIds);
|
|
21677
|
-
if (next.has(id)) next.delete(id);
|
|
21678
|
-
else next.add(id);
|
|
21679
|
-
selection.onSelectionChange(next);
|
|
21680
22723
|
};
|
|
21681
|
-
const selectAllLabel =
|
|
22724
|
+
const selectAllLabel = filteredScope ? `Select all ${scopeIds.length} ${itemLabel}` : `Select all ${itemLabel} on this page`;
|
|
21682
22725
|
return /* @__PURE__ */ jsxs(DataTable, { withToolbar: hasToolbar, className, children: [
|
|
21683
22726
|
hasToolbar && /* @__PURE__ */ jsxs(DataTableToolbar, { children: [
|
|
21684
22727
|
searchKeys.length > 0 && /* @__PURE__ */ jsx(
|
|
21685
22728
|
DataTableSearch,
|
|
21686
22729
|
{
|
|
21687
22730
|
placeholder: searchPlaceholder,
|
|
21688
|
-
value: search,
|
|
21689
|
-
onChange: (e) =>
|
|
21690
|
-
setSearch(e.target.value);
|
|
21691
|
-
setPage(1);
|
|
21692
|
-
}
|
|
22731
|
+
value: table.search.value,
|
|
22732
|
+
onChange: (e) => table.search.set(e.target.value)
|
|
21693
22733
|
}
|
|
21694
22734
|
),
|
|
21695
22735
|
filters.map((filter) => {
|
|
@@ -21701,8 +22741,8 @@ function DataTableView({
|
|
|
21701
22741
|
Select,
|
|
21702
22742
|
{
|
|
21703
22743
|
options,
|
|
21704
|
-
value:
|
|
21705
|
-
onValueChange: (value) =>
|
|
22744
|
+
value: table.filters.get(filter.key) ?? ALL,
|
|
22745
|
+
onValueChange: (value) => table.filters.set(filter.key, value === ALL ? null : value),
|
|
21706
22746
|
"aria-label": filter.label ?? filter.key,
|
|
21707
22747
|
className: "ds:w-auto ds:min-w-[150px]"
|
|
21708
22748
|
},
|
|
@@ -21733,16 +22773,23 @@ function DataTableView({
|
|
|
21733
22773
|
DataTableHeader,
|
|
21734
22774
|
{
|
|
21735
22775
|
sortable: true,
|
|
21736
|
-
sort:
|
|
21737
|
-
onSortChange: (
|
|
22776
|
+
sort: table.sorting.getDirection(c.key),
|
|
22777
|
+
onSortChange: () => table.sorting.toggle(c.key),
|
|
21738
22778
|
className: c.align === "right" ? "ds:text-right ds:[&>button]:ml-auto" : void 0,
|
|
21739
22779
|
children: c.header
|
|
21740
22780
|
},
|
|
21741
22781
|
c.key
|
|
21742
|
-
) : /* @__PURE__ */ jsx(
|
|
22782
|
+
) : /* @__PURE__ */ jsx(
|
|
22783
|
+
DataTableHeader,
|
|
22784
|
+
{
|
|
22785
|
+
className: c.align === "right" ? "ds:text-right" : void 0,
|
|
22786
|
+
children: c.header
|
|
22787
|
+
},
|
|
22788
|
+
c.key
|
|
22789
|
+
)
|
|
21743
22790
|
)
|
|
21744
22791
|
] }) }),
|
|
21745
|
-
/* @__PURE__ */ jsx(DataTableBody, { children:
|
|
22792
|
+
/* @__PURE__ */ jsx(DataTableBody, { children: table.rows.length === 0 ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs(
|
|
21746
22793
|
DataTableCell,
|
|
21747
22794
|
{
|
|
21748
22795
|
colSpan: columns.length + (selectCol ? 1 : 0),
|
|
@@ -21753,40 +22800,63 @@ function DataTableView({
|
|
|
21753
22800
|
" match your filters."
|
|
21754
22801
|
]
|
|
21755
22802
|
}
|
|
21756
|
-
) }) :
|
|
22803
|
+
) }) : table.rows.map(({ id, row, selected, selectable }) => /* @__PURE__ */ jsxs(
|
|
21757
22804
|
DataTableRow,
|
|
21758
22805
|
{
|
|
21759
|
-
selected: selection ?
|
|
22806
|
+
selected: selection ? selected : void 0,
|
|
21760
22807
|
onClick: onRowClick ? () => onRowClick(row) : void 0,
|
|
21761
22808
|
className: onRowClick ? "ds:cursor-pointer" : void 0,
|
|
21762
22809
|
children: [
|
|
21763
22810
|
selection && /* @__PURE__ */ jsx(
|
|
21764
22811
|
DataTableCheckbox,
|
|
21765
22812
|
{
|
|
21766
|
-
checked:
|
|
21767
|
-
onCheckedChange: () =>
|
|
21768
|
-
disabled: !
|
|
21769
|
-
ariaLabel: selection.rowLabel?.(row) ?? `Select ${
|
|
22813
|
+
checked: selected,
|
|
22814
|
+
onCheckedChange: () => table.selection.toggle(id),
|
|
22815
|
+
disabled: !selectable,
|
|
22816
|
+
ariaLabel: selection.rowLabel?.(row) ?? `Select ${id}`,
|
|
21770
22817
|
onClick: (event) => event.stopPropagation()
|
|
21771
22818
|
}
|
|
21772
22819
|
),
|
|
21773
|
-
columns.map((c) => /* @__PURE__ */ jsx(
|
|
22820
|
+
columns.map((c) => /* @__PURE__ */ jsx(
|
|
22821
|
+
DataTableCell,
|
|
22822
|
+
{
|
|
22823
|
+
className: c.align === "right" ? "ds:text-right" : void 0,
|
|
22824
|
+
children: c.render ? c.render(row) : row[c.key] ?? /* @__PURE__ */ jsx(EmptyValue, {})
|
|
22825
|
+
},
|
|
22826
|
+
c.key
|
|
22827
|
+
))
|
|
21774
22828
|
]
|
|
21775
22829
|
},
|
|
21776
|
-
|
|
22830
|
+
id
|
|
21777
22831
|
)) })
|
|
21778
22832
|
] }),
|
|
21779
22833
|
/* @__PURE__ */ jsx(
|
|
21780
22834
|
DataTablePagination,
|
|
21781
22835
|
{
|
|
21782
|
-
|
|
21783
|
-
total,
|
|
22836
|
+
page: table.pagination.page,
|
|
22837
|
+
totalItems: total,
|
|
21784
22838
|
pageSize,
|
|
21785
|
-
onPageChange: setPage
|
|
22839
|
+
onPageChange: table.pagination.setPage
|
|
21786
22840
|
}
|
|
21787
22841
|
)
|
|
21788
22842
|
] });
|
|
21789
22843
|
}
|
|
22844
|
+
function EmptyValue() {
|
|
22845
|
+
return /* @__PURE__ */ jsx("span", { className: "ds:text-fg-5", children: "\u2014" });
|
|
22846
|
+
}
|
|
22847
|
+
function Dash() {
|
|
22848
|
+
return /* @__PURE__ */ jsx(EmptyValue, {});
|
|
22849
|
+
}
|
|
22850
|
+
function TagsCell({ items = [] }) {
|
|
22851
|
+
if (items.length === 0) return /* @__PURE__ */ jsx(EmptyValue, {});
|
|
22852
|
+
return /* @__PURE__ */ jsxs("span", { className: "ds:flex ds:items-center ds:gap-1.5", children: [
|
|
22853
|
+
/* @__PURE__ */ jsx("span", { className: "ds:bg-bg-2 ds:text-fg-3 ds:border-rule ds:rounded-pill ds:border ds:px-2 ds:py-0.5 ds:text-xs", children: items[0] }),
|
|
22854
|
+
items.length > 1 && /* @__PURE__ */ jsxs("span", { className: "ds:text-fg-4 ds:text-xs ds:tabular-nums", children: [
|
|
22855
|
+
"+",
|
|
22856
|
+
items.length - 1
|
|
22857
|
+
] })
|
|
22858
|
+
] });
|
|
22859
|
+
}
|
|
21790
22860
|
var toneClass = {
|
|
21791
22861
|
slate: "ds:bg-bg-3 ds:text-fg-3",
|
|
21792
22862
|
blue: "ds:bg-[color-mix(in_oklab,var(--color-brand-tax)_14%,transparent)] ds:text-[color:var(--color-brand-tax)]",
|
|
@@ -21795,9 +22865,6 @@ var toneClass = {
|
|
|
21795
22865
|
ok: "ds:bg-success-bg ds:text-success-fg",
|
|
21796
22866
|
rose: "ds:bg-danger-bg ds:text-danger-fg"
|
|
21797
22867
|
};
|
|
21798
|
-
function Dash() {
|
|
21799
|
-
return /* @__PURE__ */ jsx("span", { className: "ds:text-fg-5", children: "\u2014" });
|
|
21800
|
-
}
|
|
21801
22868
|
function StagePill({
|
|
21802
22869
|
tone = "slate",
|
|
21803
22870
|
dot = true,
|
|
@@ -21825,22 +22892,12 @@ function Assignee({ name }) {
|
|
|
21825
22892
|
] });
|
|
21826
22893
|
}
|
|
21827
22894
|
function MoneyCell({ value }) {
|
|
21828
|
-
if (!value) return /* @__PURE__ */ jsx(
|
|
22895
|
+
if (!value) return /* @__PURE__ */ jsx(EmptyValue, {});
|
|
21829
22896
|
return /* @__PURE__ */ jsxs("span", { className: "ds:text-fg ds:font-medium ds:tabular-nums", children: [
|
|
21830
22897
|
"$",
|
|
21831
22898
|
value.toLocaleString()
|
|
21832
22899
|
] });
|
|
21833
22900
|
}
|
|
21834
|
-
function TagsCell({ items = [] }) {
|
|
21835
|
-
if (items.length === 0) return /* @__PURE__ */ jsx(Dash, {});
|
|
21836
|
-
return /* @__PURE__ */ jsxs("span", { className: "ds:flex ds:items-center ds:gap-1.5", children: [
|
|
21837
|
-
/* @__PURE__ */ jsx("span", { className: "ds:bg-bg-2 ds:text-fg-3 ds:border-rule ds:rounded-pill ds:border ds:px-2 ds:py-0.5 ds:text-xs", children: items[0] }),
|
|
21838
|
-
items.length > 1 && /* @__PURE__ */ jsxs("span", { className: "ds:text-fg-4 ds:text-xs ds:tabular-nums", children: [
|
|
21839
|
-
"+",
|
|
21840
|
-
items.length - 1
|
|
21841
|
-
] })
|
|
21842
|
-
] });
|
|
21843
|
-
}
|
|
21844
22901
|
var DetailGrid = forwardRef(function DetailGrid2({ className, ...props }, ref) {
|
|
21845
22902
|
return /* @__PURE__ */ jsx(
|
|
21846
22903
|
"div",
|
|
@@ -23204,7 +24261,29 @@ var NotificationList = forwardRef(
|
|
|
23204
24261
|
);
|
|
23205
24262
|
NotificationList.displayName = "NotificationList";
|
|
23206
24263
|
var NotificationItem = forwardRef(
|
|
23207
|
-
function NotificationItem2({
|
|
24264
|
+
function NotificationItem2({
|
|
24265
|
+
title,
|
|
24266
|
+
body,
|
|
24267
|
+
typeLabel,
|
|
24268
|
+
client,
|
|
24269
|
+
meta,
|
|
24270
|
+
time,
|
|
24271
|
+
sender,
|
|
24272
|
+
icon,
|
|
24273
|
+
iconClassName,
|
|
24274
|
+
unread,
|
|
24275
|
+
className,
|
|
24276
|
+
...props
|
|
24277
|
+
}, ref) {
|
|
24278
|
+
const metaSlot = meta ?? client;
|
|
24279
|
+
const metaContent = metaSlot == null ? null : typeof metaSlot === "string" || typeof metaSlot === "number" ? /* @__PURE__ */ jsx(
|
|
24280
|
+
Badge,
|
|
24281
|
+
{
|
|
24282
|
+
variant: "outline",
|
|
24283
|
+
className: "ds:rounded-md ds:px-1.5 ds:py-0.5 ds:text-[11px] ds:font-medium",
|
|
24284
|
+
children: metaSlot
|
|
24285
|
+
}
|
|
24286
|
+
) : metaSlot;
|
|
23208
24287
|
return /* @__PURE__ */ jsxs(
|
|
23209
24288
|
"button",
|
|
23210
24289
|
{
|
|
@@ -23245,16 +24324,9 @@ var NotificationItem = forwardRef(
|
|
|
23245
24324
|
unread && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "ds:bg-brand ds:size-1.5 ds:shrink-0 ds:rounded-full" })
|
|
23246
24325
|
] }),
|
|
23247
24326
|
body && /* @__PURE__ */ jsx("p", { className: "ds:text-fg-3 ds:mt-0.5 ds:truncate ds:text-xs", children: body }),
|
|
23248
|
-
(typeLabel ||
|
|
24327
|
+
(typeLabel || metaContent || time) && /* @__PURE__ */ jsxs("div", { className: "ds:mt-1.5 ds:flex ds:items-center ds:gap-2", children: [
|
|
23249
24328
|
typeLabel && /* @__PURE__ */ jsx("span", { className: "ds:text-fg-4 ds:text-[11px]", children: typeLabel }),
|
|
23250
|
-
|
|
23251
|
-
Badge,
|
|
23252
|
-
{
|
|
23253
|
-
variant: "outline",
|
|
23254
|
-
className: "ds:rounded-md ds:px-1.5 ds:py-0.5 ds:text-[11px] ds:font-medium",
|
|
23255
|
-
children: client
|
|
23256
|
-
}
|
|
23257
|
-
),
|
|
24329
|
+
metaContent,
|
|
23258
24330
|
time && /* @__PURE__ */ jsx("span", { className: "ds:text-fg-4 ds:text-xs ds:whitespace-nowrap ds:tabular-nums", children: time })
|
|
23259
24331
|
] })
|
|
23260
24332
|
] })
|
|
@@ -23869,7 +24941,7 @@ var FilterChip = forwardRef(function FilterChip2({ active = false, size, count,
|
|
|
23869
24941
|
);
|
|
23870
24942
|
});
|
|
23871
24943
|
FilterChip.displayName = "FilterChip";
|
|
23872
|
-
var BulkActionBarContext =
|
|
24944
|
+
var BulkActionBarContext = React45.createContext({ tone: "surface" });
|
|
23873
24945
|
function actionClasses(tone, destructive) {
|
|
23874
24946
|
const base = cn(
|
|
23875
24947
|
"ds:inline-flex ds:h-8 ds:items-center ds:gap-1.5 ds:rounded-btn ds:px-3 ds:text-[13px] ds:font-medium",
|
|
@@ -23892,8 +24964,8 @@ function actionClasses(tone, destructive) {
|
|
|
23892
24964
|
destructive ? "ds:text-control-destructive-fg ds:hover:bg-control-destructive-hover-bg" : "ds:text-control-fg ds:hover:bg-control-hover-bg ds:hover:text-control-hover-fg"
|
|
23893
24965
|
);
|
|
23894
24966
|
}
|
|
23895
|
-
var BulkActionBarAction =
|
|
23896
|
-
const { tone } =
|
|
24967
|
+
var BulkActionBarAction = React45.forwardRef(function BulkActionBarAction2({ asChild = false, destructive, className, type, ...props }, ref) {
|
|
24968
|
+
const { tone } = React45.use(BulkActionBarContext);
|
|
23897
24969
|
const Comp = asChild ? Slot : "button";
|
|
23898
24970
|
return /* @__PURE__ */ jsx(
|
|
23899
24971
|
Comp,
|
|
@@ -23907,7 +24979,7 @@ var BulkActionBarAction = React44.forwardRef(function BulkActionBarAction2({ asC
|
|
|
23907
24979
|
});
|
|
23908
24980
|
BulkActionBarAction.displayName = "BulkActionBarAction";
|
|
23909
24981
|
function BulkActionBarSeparator({ className }) {
|
|
23910
|
-
const { tone } =
|
|
24982
|
+
const { tone } = React45.use(BulkActionBarContext);
|
|
23911
24983
|
return /* @__PURE__ */ jsx(
|
|
23912
24984
|
"span",
|
|
23913
24985
|
{
|
|
@@ -24402,8 +25474,16 @@ function DisplayMenu({
|
|
|
24402
25474
|
triggerIcon,
|
|
24403
25475
|
triggerLabel = "Display",
|
|
24404
25476
|
className,
|
|
25477
|
+
gutterPx,
|
|
24405
25478
|
flyoutSide = "auto"
|
|
24406
25479
|
}) {
|
|
25480
|
+
if (gutterPx !== void 0) {
|
|
25481
|
+
warnOnce(
|
|
25482
|
+
"C-SELECT-DEAD",
|
|
25483
|
+
"DisplayMenu.gutterPx",
|
|
25484
|
+
"`DisplayMenu gutterPx` has done nothing since 1.30 and is removed in 2.0: the panel anchors to its trigger. Delete the prop and any gutter measurement around it."
|
|
25485
|
+
);
|
|
25486
|
+
}
|
|
24407
25487
|
const [open, setOpen] = useState(false);
|
|
24408
25488
|
const [openKey, setOpenKey] = useState(null);
|
|
24409
25489
|
const [flyout, setFlyout] = useState({
|
|
@@ -24539,7 +25619,7 @@ function DisplayMenu({
|
|
|
24539
25619
|
setOpenKey(null);
|
|
24540
25620
|
}
|
|
24541
25621
|
},
|
|
24542
|
-
children: /* @__PURE__ */ jsxs("div", { ref: panelRef, className: "ds:relative", children: [
|
|
25622
|
+
children: /* @__PURE__ */ jsxs("div", { ref: panelRef, className: "ds:relative ds:isolate", children: [
|
|
24543
25623
|
/* @__PURE__ */ jsxs("div", { className: "ds:flex ds:items-center ds:gap-1.5 ds:border-b ds:border-rule ds:px-2.5 ds:py-1.5", children: [
|
|
24544
25624
|
/* @__PURE__ */ jsx(SearchIcon, { size: 13, className: "ds:shrink-0 ds:text-fg-3", "aria-hidden": "true" }),
|
|
24545
25625
|
/* @__PURE__ */ jsx(
|
|
@@ -24682,7 +25762,7 @@ function DisplayMenu({
|
|
|
24682
25762
|
// Column + overflow-hidden so the option list (the only flexible
|
|
24683
25763
|
// part) absorbs the height cap, while the search box and Clear
|
|
24684
25764
|
// footer stay pinned and fully visible.
|
|
24685
|
-
"ds:absolute ds:
|
|
25765
|
+
"ds:absolute ds:flex ds:flex-col ds:overflow-hidden ds:rounded-lg ds:border ds:border-rule ds:bg-surface ds:shadow-floating ds:motion-reduce:transition-none",
|
|
24686
25766
|
// -mx-1 lets the flyout tuck against the panel so there's no
|
|
24687
25767
|
// dead gap for the cursor to fall through on the way over.
|
|
24688
25768
|
flyout.side === "left" ? "ds:right-full ds:-mr-1" : "ds:left-full ds:-ml-1"
|
|
@@ -24782,30 +25862,35 @@ function DisplayMenu({
|
|
|
24782
25862
|
function EmptyRow({ label = "No matches" }) {
|
|
24783
25863
|
return /* @__PURE__ */ jsx("p", { className: "ds:px-2 ds:py-3 ds:text-center ds:text-[11px] ds:text-fg-3", children: label });
|
|
24784
25864
|
}
|
|
24785
|
-
var StickyStackContext =
|
|
24786
|
-
function StickyStack({
|
|
24787
|
-
|
|
24788
|
-
|
|
25865
|
+
var StickyStackContext = React45.createContext(null);
|
|
25866
|
+
function StickyStack({
|
|
25867
|
+
layers,
|
|
25868
|
+
top = 0,
|
|
25869
|
+
layerMode = "fixed",
|
|
25870
|
+
children
|
|
25871
|
+
}) {
|
|
25872
|
+
const [layerHeights, setLayerHeights] = React45.useState({});
|
|
25873
|
+
const normalizedLayers = React45.useMemo(() => {
|
|
24789
25874
|
const names = [...layers];
|
|
24790
25875
|
if (new Set(names).size !== names.length) {
|
|
24791
25876
|
throw new Error("StickyStack layer names must be unique.");
|
|
24792
25877
|
}
|
|
24793
25878
|
return names;
|
|
24794
25879
|
}, [layers]);
|
|
24795
|
-
const setLayerHeight =
|
|
25880
|
+
const setLayerHeight = React45.useCallback((name, height) => {
|
|
24796
25881
|
setLayerHeights((current) => {
|
|
24797
25882
|
if (current[name] === height) return current;
|
|
24798
25883
|
return { ...current, [name]: height };
|
|
24799
25884
|
});
|
|
24800
25885
|
}, []);
|
|
24801
|
-
const value =
|
|
24802
|
-
() => ({ layers: normalizedLayers, layerHeights, setLayerHeight, top }),
|
|
24803
|
-
[layerHeights, normalizedLayers, setLayerHeight, top]
|
|
25886
|
+
const value = React45.useMemo(
|
|
25887
|
+
() => ({ layers: normalizedLayers, layerHeights, setLayerHeight, top, layerMode }),
|
|
25888
|
+
[layerHeights, layerMode, normalizedLayers, setLayerHeight, top]
|
|
24804
25889
|
);
|
|
24805
25890
|
return /* @__PURE__ */ jsx(StickyStackContext, { value, children });
|
|
24806
25891
|
}
|
|
24807
25892
|
function useStickyStack(componentName) {
|
|
24808
|
-
const context =
|
|
25893
|
+
const context = React45.use(StickyStackContext);
|
|
24809
25894
|
if (!context) {
|
|
24810
25895
|
throw new Error(`${componentName} must be rendered inside StickyStack.`);
|
|
24811
25896
|
}
|
|
@@ -24828,20 +25913,21 @@ function stackOffset(context, layerName, includeNamedLayer) {
|
|
|
24828
25913
|
const base = cssLength(top);
|
|
24829
25914
|
return measuredOffset === 0 ? base : `calc(${base} + ${measuredOffset}px)`;
|
|
24830
25915
|
}
|
|
24831
|
-
var StickyStackLayer =
|
|
24832
|
-
function StickyStackLayer2({ name, hostClassName, className, children, style, ...props }, forwardedRef) {
|
|
25916
|
+
var StickyStackLayer = React45.forwardRef(
|
|
25917
|
+
function StickyStackLayer2({ name, hostClassName, layerMode, className, children, style, ...props }, forwardedRef) {
|
|
24833
25918
|
const context = useStickyStack("StickyStackLayer");
|
|
24834
25919
|
const { setLayerHeight } = context;
|
|
25920
|
+
const mode = layerMode ?? context.layerMode;
|
|
24835
25921
|
const top = stackOffset(context, name, false);
|
|
24836
|
-
const hostRef =
|
|
24837
|
-
const layerRef =
|
|
24838
|
-
const [bounds, setBounds] =
|
|
25922
|
+
const hostRef = React45.useRef(null);
|
|
25923
|
+
const layerRef = React45.useRef(null);
|
|
25924
|
+
const [bounds, setBounds] = React45.useState({
|
|
24839
25925
|
height: 0,
|
|
24840
25926
|
left: 0,
|
|
24841
25927
|
ready: false,
|
|
24842
25928
|
width: 0
|
|
24843
25929
|
});
|
|
24844
|
-
const setLayerRef =
|
|
25930
|
+
const setLayerRef = React45.useCallback(
|
|
24845
25931
|
(node) => {
|
|
24846
25932
|
layerRef.current = node;
|
|
24847
25933
|
if (typeof forwardedRef === "function") forwardedRef(node);
|
|
@@ -24849,7 +25935,7 @@ var StickyStackLayer = React44.forwardRef(
|
|
|
24849
25935
|
},
|
|
24850
25936
|
[forwardedRef]
|
|
24851
25937
|
);
|
|
24852
|
-
const measure =
|
|
25938
|
+
const measure = React45.useCallback(() => {
|
|
24853
25939
|
const host = hostRef.current;
|
|
24854
25940
|
const layer = layerRef.current;
|
|
24855
25941
|
if (!host || !layer) return;
|
|
@@ -24866,7 +25952,7 @@ var StickyStackLayer = React44.forwardRef(
|
|
|
24866
25952
|
);
|
|
24867
25953
|
setLayerHeight(name, next.height);
|
|
24868
25954
|
}, [name, setLayerHeight]);
|
|
24869
|
-
|
|
25955
|
+
React45.useLayoutEffect(() => {
|
|
24870
25956
|
measure();
|
|
24871
25957
|
let frame = 0;
|
|
24872
25958
|
const scheduleMeasure = () => {
|
|
@@ -24886,12 +25972,13 @@ var StickyStackLayer = React44.forwardRef(
|
|
|
24886
25972
|
setLayerHeight(name, 0);
|
|
24887
25973
|
};
|
|
24888
25974
|
}, [measure, name, setLayerHeight]);
|
|
25975
|
+
const pinned = mode === "fixed" && bounds.ready;
|
|
24889
25976
|
return /* @__PURE__ */ jsx(
|
|
24890
25977
|
"div",
|
|
24891
25978
|
{
|
|
24892
25979
|
ref: hostRef,
|
|
24893
25980
|
className: cn("ds:relative", hostClassName),
|
|
24894
|
-
style: { height:
|
|
25981
|
+
style: { height: pinned ? bounds.height : void 0 },
|
|
24895
25982
|
"data-sticky-stack-host": name,
|
|
24896
25983
|
children: /* @__PURE__ */ jsx(
|
|
24897
25984
|
"div",
|
|
@@ -24900,14 +25987,15 @@ var StickyStackLayer = React44.forwardRef(
|
|
|
24900
25987
|
className,
|
|
24901
25988
|
style: {
|
|
24902
25989
|
...style,
|
|
24903
|
-
position:
|
|
25990
|
+
position: pinned ? "fixed" : "sticky",
|
|
24904
25991
|
top,
|
|
24905
|
-
left:
|
|
24906
|
-
width:
|
|
25992
|
+
left: pinned ? bounds.left : void 0,
|
|
25993
|
+
width: pinned ? bounds.width : void 0,
|
|
24907
25994
|
boxSizing: "border-box",
|
|
24908
25995
|
zIndex: style?.zIndex ?? "var(--ds-z-sticky, var(--z-sticky))"
|
|
24909
25996
|
},
|
|
24910
25997
|
"data-sticky-stack-layer": name,
|
|
25998
|
+
"data-sticky-stack-mode": mode,
|
|
24911
25999
|
...props,
|
|
24912
26000
|
children
|
|
24913
26001
|
}
|
|
@@ -24917,7 +26005,7 @@ var StickyStackLayer = React44.forwardRef(
|
|
|
24917
26005
|
}
|
|
24918
26006
|
);
|
|
24919
26007
|
StickyStackLayer.displayName = "StickyStackLayer";
|
|
24920
|
-
var StickyStackSticky =
|
|
26008
|
+
var StickyStackSticky = React45.forwardRef(
|
|
24921
26009
|
function StickyStackSticky2({ after, className, style, ...props }, ref) {
|
|
24922
26010
|
const context = useStickyStack("StickyStackSticky");
|
|
24923
26011
|
const top = stackOffset(context, after, true);
|
|
@@ -24938,7 +26026,7 @@ var StickyStackSticky = React44.forwardRef(
|
|
|
24938
26026
|
}
|
|
24939
26027
|
);
|
|
24940
26028
|
StickyStackSticky.displayName = "StickyStackSticky";
|
|
24941
|
-
var StickyStackSectionHeader =
|
|
26029
|
+
var StickyStackSectionHeader = React45.forwardRef(function StickyStackSectionHeader2(props, ref) {
|
|
24942
26030
|
return /* @__PURE__ */ jsx(StickyStackSticky, { ref, "data-sticky-stack-section-header": "", ...props });
|
|
24943
26031
|
});
|
|
24944
26032
|
StickyStackSectionHeader.displayName = "StickyStackSectionHeader";
|
|
@@ -24948,7 +26036,7 @@ function defineStatusMap(map) {
|
|
|
24948
26036
|
if (map === void 0) return (entries) => entries;
|
|
24949
26037
|
return map;
|
|
24950
26038
|
}
|
|
24951
|
-
var ConfirmHostContext =
|
|
26039
|
+
var ConfirmHostContext = React45.createContext(null);
|
|
24952
26040
|
var isServer = typeof window === "undefined";
|
|
24953
26041
|
function missingHost(hook) {
|
|
24954
26042
|
if (process.env.NODE_ENV === "production" || process.env.NODE_ENV === "test") return;
|
|
@@ -24959,8 +26047,8 @@ function missingHost(hook) {
|
|
|
24959
26047
|
);
|
|
24960
26048
|
}
|
|
24961
26049
|
function useConfirm() {
|
|
24962
|
-
const host =
|
|
24963
|
-
return
|
|
26050
|
+
const host = React45.useContext(ConfirmHostContext);
|
|
26051
|
+
return React45.useMemo(() => {
|
|
24964
26052
|
if (host) return host.confirm;
|
|
24965
26053
|
return () => {
|
|
24966
26054
|
missingHost("useConfirm");
|
|
@@ -24969,8 +26057,8 @@ function useConfirm() {
|
|
|
24969
26057
|
}, [host]);
|
|
24970
26058
|
}
|
|
24971
26059
|
function usePrompt() {
|
|
24972
|
-
const host =
|
|
24973
|
-
return
|
|
26060
|
+
const host = React45.useContext(ConfirmHostContext);
|
|
26061
|
+
return React45.useMemo(() => {
|
|
24974
26062
|
if (host) return host.prompt;
|
|
24975
26063
|
return () => {
|
|
24976
26064
|
missingHost("usePrompt");
|
|
@@ -24979,12 +26067,12 @@ function usePrompt() {
|
|
|
24979
26067
|
}, [host]);
|
|
24980
26068
|
}
|
|
24981
26069
|
function ConfirmHost({ children }) {
|
|
24982
|
-
const [queue, setQueue] =
|
|
24983
|
-
const nextId =
|
|
24984
|
-
const enqueue =
|
|
26070
|
+
const [queue, setQueue] = React45.useState([]);
|
|
26071
|
+
const nextId = React45.useRef(0);
|
|
26072
|
+
const enqueue = React45.useCallback((request) => {
|
|
24985
26073
|
setQueue((previous) => [...previous, request]);
|
|
24986
26074
|
}, []);
|
|
24987
|
-
const value =
|
|
26075
|
+
const value = React45.useMemo(
|
|
24988
26076
|
() => ({
|
|
24989
26077
|
confirm: (options) => {
|
|
24990
26078
|
if (isServer) return Promise.resolve(false);
|
|
@@ -25002,7 +26090,7 @@ function ConfirmHost({ children }) {
|
|
|
25002
26090
|
[enqueue]
|
|
25003
26091
|
);
|
|
25004
26092
|
const current = queue[0];
|
|
25005
|
-
const settle =
|
|
26093
|
+
const settle = React45.useCallback(() => {
|
|
25006
26094
|
setQueue((previous) => previous.slice(1));
|
|
25007
26095
|
}, []);
|
|
25008
26096
|
return /* @__PURE__ */ jsxs(ConfirmHostContext, { value, children: [
|
|
@@ -25013,8 +26101,8 @@ function ConfirmHost({ children }) {
|
|
|
25013
26101
|
}
|
|
25014
26102
|
ConfirmHost.displayName = "ConfirmHost";
|
|
25015
26103
|
function useSettleOnce(resolve) {
|
|
25016
|
-
const done =
|
|
25017
|
-
return
|
|
26104
|
+
const done = React45.useRef(false);
|
|
26105
|
+
return React45.useCallback(
|
|
25018
26106
|
(value) => {
|
|
25019
26107
|
if (done.current) return;
|
|
25020
26108
|
done.current = true;
|
|
@@ -25037,7 +26125,7 @@ function HostedConfirm({
|
|
|
25037
26125
|
request,
|
|
25038
26126
|
onSettled
|
|
25039
26127
|
}) {
|
|
25040
|
-
const [open, setOpen] =
|
|
26128
|
+
const [open, setOpen] = React45.useState(true);
|
|
25041
26129
|
const settle = useSettleOnce(request.resolve);
|
|
25042
26130
|
return /* @__PURE__ */ jsx(
|
|
25043
26131
|
ConfirmDialog,
|
|
@@ -25062,8 +26150,8 @@ function HostedPrompt({
|
|
|
25062
26150
|
onSettled
|
|
25063
26151
|
}) {
|
|
25064
26152
|
const { options } = request;
|
|
25065
|
-
const [open, setOpen] =
|
|
25066
|
-
const [value, setValue] =
|
|
26153
|
+
const [open, setOpen] = React45.useState(true);
|
|
26154
|
+
const [value, setValue] = React45.useState(options.defaultValue ?? "");
|
|
25067
26155
|
const settle = useSettleOnce(request.resolve);
|
|
25068
26156
|
const empty = value.trim() === "";
|
|
25069
26157
|
const accessibleName = options.label === void 0 && typeof options.title === "string" ? options.title : void 0;
|
|
@@ -25129,6 +26217,512 @@ function DesignSystemProvider({
|
|
|
25129
26217
|
}
|
|
25130
26218
|
return /* @__PURE__ */ jsx(DesignSystemContext, { value, children: /* @__PURE__ */ jsx(LocaleProvider, { locale, children: /* @__PURE__ */ jsx(PortalContainerContext, { value: portalContainer, children: tree }) }) });
|
|
25131
26219
|
}
|
|
26220
|
+
var DataTablePatternContext = createContext(null);
|
|
26221
|
+
function usePattern(part) {
|
|
26222
|
+
const context = useContext(DataTablePatternContext);
|
|
26223
|
+
if (!context) {
|
|
26224
|
+
throw new Error(`<DataTablePattern.${part}> must be rendered inside <DataTablePattern>.`);
|
|
26225
|
+
}
|
|
26226
|
+
return context;
|
|
26227
|
+
}
|
|
26228
|
+
function Root26({
|
|
26229
|
+
table,
|
|
26230
|
+
children,
|
|
26231
|
+
selectable = false,
|
|
26232
|
+
loading = false,
|
|
26233
|
+
error = false,
|
|
26234
|
+
onRetry,
|
|
26235
|
+
sticky = false,
|
|
26236
|
+
classNames = {},
|
|
26237
|
+
messages: messagesOverride,
|
|
26238
|
+
className,
|
|
26239
|
+
style,
|
|
26240
|
+
ref,
|
|
26241
|
+
...props
|
|
26242
|
+
}) {
|
|
26243
|
+
const messages = useDsMessages("dataTable", messagesOverride);
|
|
26244
|
+
const [toolbarHeight, setToolbarHeight] = useState(0);
|
|
26245
|
+
const columnCount = table.columns.length + (selectable ? 1 : 0);
|
|
26246
|
+
const value = {
|
|
26247
|
+
table,
|
|
26248
|
+
selectable,
|
|
26249
|
+
loading,
|
|
26250
|
+
error,
|
|
26251
|
+
onRetry,
|
|
26252
|
+
sticky,
|
|
26253
|
+
classNames,
|
|
26254
|
+
messages,
|
|
26255
|
+
columnCount,
|
|
26256
|
+
reportToolbarHeight: setToolbarHeight
|
|
26257
|
+
};
|
|
26258
|
+
return /* @__PURE__ */ jsx(
|
|
26259
|
+
"div",
|
|
26260
|
+
{
|
|
26261
|
+
ref,
|
|
26262
|
+
...slot(dataTableAnatomy, "root"),
|
|
26263
|
+
"data-sticky": sticky ? "" : void 0,
|
|
26264
|
+
className: cn(
|
|
26265
|
+
// The card: one border and a quiet shadow around toolbar and table.
|
|
26266
|
+
// `overflow-clip` clips the header surfaces to the corners without
|
|
26267
|
+
// creating a scroll container, so sticky chrome sticks to the page.
|
|
26268
|
+
"ds:rounded-card ds:border-rule-strong ds:bg-surface ds:w-full ds:overflow-clip ds:border ds:shadow-quiet",
|
|
26269
|
+
className
|
|
26270
|
+
),
|
|
26271
|
+
style: sticky ? {
|
|
26272
|
+
...style,
|
|
26273
|
+
"--ds-data-table-toolbar-height": `${toolbarHeight}px`
|
|
26274
|
+
} : style,
|
|
26275
|
+
...props,
|
|
26276
|
+
children: /* @__PURE__ */ jsx(DataTablePatternContext.Provider, { value, children })
|
|
26277
|
+
}
|
|
26278
|
+
);
|
|
26279
|
+
}
|
|
26280
|
+
function useReportedHeight(element, report, enabled) {
|
|
26281
|
+
useEffect(() => {
|
|
26282
|
+
const node = element.current;
|
|
26283
|
+
if (!enabled || !node || typeof ResizeObserver === "undefined") return;
|
|
26284
|
+
const measure = () => report(node.getBoundingClientRect().height);
|
|
26285
|
+
measure();
|
|
26286
|
+
const observer = new ResizeObserver(measure);
|
|
26287
|
+
observer.observe(node);
|
|
26288
|
+
return () => {
|
|
26289
|
+
observer.disconnect();
|
|
26290
|
+
report(0);
|
|
26291
|
+
};
|
|
26292
|
+
}, [element, report, enabled]);
|
|
26293
|
+
}
|
|
26294
|
+
var STICKY_TOOLBAR_Z = "ds:z-[calc(var(--z-base)+3)]";
|
|
26295
|
+
var Toolbar3 = forwardRef(function Toolbar4({ className, ...props }, ref) {
|
|
26296
|
+
const { sticky, classNames, reportToolbarHeight } = usePattern("Toolbar");
|
|
26297
|
+
const ownRef = useRef(null);
|
|
26298
|
+
useReportedHeight(ownRef, reportToolbarHeight, sticky);
|
|
26299
|
+
return /* @__PURE__ */ jsx(
|
|
26300
|
+
"div",
|
|
26301
|
+
{
|
|
26302
|
+
ref: (node) => {
|
|
26303
|
+
ownRef.current = node;
|
|
26304
|
+
if (typeof ref === "function") ref(node);
|
|
26305
|
+
else if (ref) ref.current = node;
|
|
26306
|
+
},
|
|
26307
|
+
...slot(dataTableAnatomy, "toolbar"),
|
|
26308
|
+
className: cn(
|
|
26309
|
+
"ds:flex ds:flex-wrap ds:items-center ds:gap-2 ds:px-3 ds:py-2.5",
|
|
26310
|
+
"ds:border-rule ds:bg-surface ds:border-b",
|
|
26311
|
+
sticky && cn("ds:sticky ds:top-[var(--ds-data-table-sticky-top,0px)]", STICKY_TOOLBAR_Z),
|
|
26312
|
+
classNames.toolbar,
|
|
26313
|
+
className
|
|
26314
|
+
),
|
|
26315
|
+
...props
|
|
26316
|
+
}
|
|
26317
|
+
);
|
|
26318
|
+
});
|
|
26319
|
+
Toolbar3.displayName = "DataTablePattern.Toolbar";
|
|
26320
|
+
var Search = forwardRef(function Search2({ className, placeholder, size = "sm", "aria-label": ariaLabel, ...props }, ref) {
|
|
26321
|
+
const { table, classNames, messages } = usePattern("Search");
|
|
26322
|
+
return /* @__PURE__ */ jsx(
|
|
26323
|
+
SearchInput,
|
|
26324
|
+
{
|
|
26325
|
+
ref,
|
|
26326
|
+
size,
|
|
26327
|
+
value: table.search.value,
|
|
26328
|
+
onValueChange: table.search.set,
|
|
26329
|
+
placeholder: placeholder ?? messages.search,
|
|
26330
|
+
"aria-label": ariaLabel ?? messages.searchLabel,
|
|
26331
|
+
className: cn(
|
|
26332
|
+
"ds:w-[var(--ds-data-table-search-width,280px)] ds:max-w-full",
|
|
26333
|
+
classNames.search,
|
|
26334
|
+
className
|
|
26335
|
+
),
|
|
26336
|
+
...props
|
|
26337
|
+
}
|
|
26338
|
+
);
|
|
26339
|
+
});
|
|
26340
|
+
Search.displayName = "DataTablePattern.Search";
|
|
26341
|
+
var ALL2 = "__all__";
|
|
26342
|
+
function FilterControl({ definition }) {
|
|
26343
|
+
const { table, messages } = usePattern("Filters");
|
|
26344
|
+
const current = table.filters.get(definition.id);
|
|
26345
|
+
if (definition.multiple) {
|
|
26346
|
+
const values = Array.isArray(current) ? current : [];
|
|
26347
|
+
return /* @__PURE__ */ jsx(
|
|
26348
|
+
MultiSelect,
|
|
26349
|
+
{
|
|
26350
|
+
options: definition.options,
|
|
26351
|
+
value: values,
|
|
26352
|
+
onValueChange: (next) => table.filters.set(definition.id, next.length ? next : null),
|
|
26353
|
+
"aria-label": definition.label,
|
|
26354
|
+
placeholder: definition.label,
|
|
26355
|
+
size: "sm",
|
|
26356
|
+
className: "ds:w-auto ds:min-w-40"
|
|
26357
|
+
}
|
|
26358
|
+
);
|
|
26359
|
+
}
|
|
26360
|
+
const value = typeof current === "string" ? current : ALL2;
|
|
26361
|
+
return /* @__PURE__ */ jsx(
|
|
26362
|
+
Select,
|
|
26363
|
+
{
|
|
26364
|
+
options: [
|
|
26365
|
+
{ value: ALL2, label: `${messages.filterAll} ${definition.label}`.trim() },
|
|
26366
|
+
...definition.options.map((option) => ({
|
|
26367
|
+
value: option.value,
|
|
26368
|
+
label: option.label,
|
|
26369
|
+
disabled: option.disabled
|
|
26370
|
+
}))
|
|
26371
|
+
],
|
|
26372
|
+
value,
|
|
26373
|
+
onValueChange: (next) => table.filters.set(definition.id, next === ALL2 || !next ? null : next),
|
|
26374
|
+
"aria-label": definition.label,
|
|
26375
|
+
size: "sm",
|
|
26376
|
+
className: "ds:w-auto ds:min-w-40"
|
|
26377
|
+
}
|
|
26378
|
+
);
|
|
26379
|
+
}
|
|
26380
|
+
var Filters = forwardRef(function Filters2({ className, children, ...props }, ref) {
|
|
26381
|
+
const { table, classNames } = usePattern("Filters");
|
|
26382
|
+
if (table.filters.definitions.length === 0 && !children) return null;
|
|
26383
|
+
return /* @__PURE__ */ jsxs(
|
|
26384
|
+
"div",
|
|
26385
|
+
{
|
|
26386
|
+
ref,
|
|
26387
|
+
...slot(dataTableAnatomy, "filters"),
|
|
26388
|
+
className: cn("ds:flex ds:flex-wrap ds:items-center ds:gap-2", classNames.filters, className),
|
|
26389
|
+
...props,
|
|
26390
|
+
children: [
|
|
26391
|
+
table.filters.definitions.map((definition) => /* @__PURE__ */ jsx(FilterControl, { definition }, definition.id)),
|
|
26392
|
+
children
|
|
26393
|
+
]
|
|
26394
|
+
}
|
|
26395
|
+
);
|
|
26396
|
+
});
|
|
26397
|
+
Filters.displayName = "DataTablePattern.Filters";
|
|
26398
|
+
var ColumnsMenu = forwardRef(
|
|
26399
|
+
function ColumnsMenu2({ label, className, ...props }, ref) {
|
|
26400
|
+
const { table, classNames, messages } = usePattern("ColumnsMenu");
|
|
26401
|
+
const hideable = table.allColumns.filter((column) => column.hideable !== false);
|
|
26402
|
+
if (hideable.length === 0) return null;
|
|
26403
|
+
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
26404
|
+
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
26405
|
+
Button,
|
|
26406
|
+
{
|
|
26407
|
+
ref,
|
|
26408
|
+
variant: "outline",
|
|
26409
|
+
size: "sm",
|
|
26410
|
+
iconEnd: /* @__PURE__ */ jsx(ChevronDownIcon, { "aria-hidden": "true" }),
|
|
26411
|
+
className: cn(classNames["columns-menu"], className),
|
|
26412
|
+
...props,
|
|
26413
|
+
children: label ?? messages.columns
|
|
26414
|
+
}
|
|
26415
|
+
) }),
|
|
26416
|
+
/* @__PURE__ */ jsx(DropdownMenuContent, { align: "end", children: hideable.map((column) => /* @__PURE__ */ jsx(
|
|
26417
|
+
DropdownMenuCheckboxItem,
|
|
26418
|
+
{
|
|
26419
|
+
checked: table.columnVisibility.isVisible(column.id),
|
|
26420
|
+
onCheckedChange: (checked) => table.columnVisibility.setVisible(column.id, checked === true),
|
|
26421
|
+
onSelect: (event) => event.preventDefault(),
|
|
26422
|
+
children: column.header
|
|
26423
|
+
},
|
|
26424
|
+
column.id
|
|
26425
|
+
)) })
|
|
26426
|
+
] });
|
|
26427
|
+
}
|
|
26428
|
+
);
|
|
26429
|
+
ColumnsMenu.displayName = "DataTablePattern.ColumnsMenu";
|
|
26430
|
+
var STICKY_HEAD_TOP = "ds:top-[calc(var(--ds-data-table-sticky-top,0px)+var(--ds-data-table-toolbar-height,0px))]";
|
|
26431
|
+
function Content16({
|
|
26432
|
+
onRowClick,
|
|
26433
|
+
getRowLabel,
|
|
26434
|
+
loading: loadingSlot,
|
|
26435
|
+
error: errorSlot,
|
|
26436
|
+
empty: emptySlot,
|
|
26437
|
+
className,
|
|
26438
|
+
wrapperClassName,
|
|
26439
|
+
...props
|
|
26440
|
+
}) {
|
|
26441
|
+
const context = usePattern("Content");
|
|
26442
|
+
const table = context.table;
|
|
26443
|
+
const { selectable, loading, error, sticky, classNames, messages } = context;
|
|
26444
|
+
const { selection } = table;
|
|
26445
|
+
const body = loading ? loadingSlot ?? /* @__PURE__ */ jsx(LoadingSlot, {}) : error ? errorSlot ?? /* @__PURE__ */ jsx(ErrorSlot, {}) : table.rows.length === 0 ? emptySlot ?? /* @__PURE__ */ jsx(EmptySlot, {}) : /* @__PURE__ */ jsx(TableBody, { children: table.rows.map((model) => /* @__PURE__ */ jsxs(
|
|
26446
|
+
TableRow,
|
|
26447
|
+
{
|
|
26448
|
+
id: table.getRowDomId(model.id),
|
|
26449
|
+
selected: model.selected,
|
|
26450
|
+
interactive: Boolean(onRowClick),
|
|
26451
|
+
onClick: onRowClick ? () => onRowClick(model.row, model) : void 0,
|
|
26452
|
+
children: [
|
|
26453
|
+
selectable && /* @__PURE__ */ jsx(TableCell, { width: 32, className: "ds:pr-0", children: /* @__PURE__ */ jsx(
|
|
26454
|
+
Checkbox,
|
|
26455
|
+
{
|
|
26456
|
+
checked: model.selected,
|
|
26457
|
+
disabled: !model.selectable,
|
|
26458
|
+
onCheckedChange: () => selection.toggle(model.id),
|
|
26459
|
+
onClick: (event) => event.stopPropagation(),
|
|
26460
|
+
"aria-label": getRowLabel ? getRowLabel(model.row) : messages.selectRow
|
|
26461
|
+
}
|
|
26462
|
+
) }),
|
|
26463
|
+
table.columns.map((column) => /* @__PURE__ */ jsx(
|
|
26464
|
+
TableCell,
|
|
26465
|
+
{
|
|
26466
|
+
headers: table.getColumnId(column.id),
|
|
26467
|
+
align: column.align,
|
|
26468
|
+
numeric: column.numeric,
|
|
26469
|
+
children: table.renderCell(model, column)
|
|
26470
|
+
},
|
|
26471
|
+
column.id
|
|
26472
|
+
))
|
|
26473
|
+
]
|
|
26474
|
+
},
|
|
26475
|
+
model.id
|
|
26476
|
+
)) });
|
|
26477
|
+
return /* @__PURE__ */ jsxs(
|
|
26478
|
+
Table,
|
|
26479
|
+
{
|
|
26480
|
+
stickyHeader: sticky,
|
|
26481
|
+
wrapperClassName: cn(
|
|
26482
|
+
// The root is the card; the table's own frame goes.
|
|
26483
|
+
"ds:rounded-none ds:border-0 ds:shadow-none",
|
|
26484
|
+
// Sticky chrome sticks to the page, so the wrapper must not scroll.
|
|
26485
|
+
sticky && "ds:overflow-visible",
|
|
26486
|
+
classNames.content,
|
|
26487
|
+
wrapperClassName
|
|
26488
|
+
),
|
|
26489
|
+
className,
|
|
26490
|
+
...props,
|
|
26491
|
+
children: [
|
|
26492
|
+
/* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
26493
|
+
selectable && /* @__PURE__ */ jsx(TableHead, { width: 32, className: cn("ds:pr-0", sticky && STICKY_HEAD_TOP), children: /* @__PURE__ */ jsx(
|
|
26494
|
+
Checkbox,
|
|
26495
|
+
{
|
|
26496
|
+
checked: selection.allPageSelected ? true : selection.somePageSelected ? "indeterminate" : false,
|
|
26497
|
+
disabled: table.rows.every((model) => !model.selectable),
|
|
26498
|
+
onCheckedChange: () => selection.togglePage(),
|
|
26499
|
+
"aria-label": messages.selectAll
|
|
26500
|
+
}
|
|
26501
|
+
) }),
|
|
26502
|
+
table.columns.map((column) => /* @__PURE__ */ jsx(
|
|
26503
|
+
TableHead,
|
|
26504
|
+
{
|
|
26505
|
+
id: table.getColumnId(column.id),
|
|
26506
|
+
scope: "col",
|
|
26507
|
+
align: column.align,
|
|
26508
|
+
numeric: column.numeric,
|
|
26509
|
+
width: column.width,
|
|
26510
|
+
sort: column.sortable ? table.sorting.getDirection(column.id) : void 0,
|
|
26511
|
+
onSortChange: column.sortable ? (next) => table.sorting.set(next ? { columnId: column.id, direction: next } : null) : void 0,
|
|
26512
|
+
className: cn(sticky && STICKY_HEAD_TOP),
|
|
26513
|
+
children: column.header
|
|
26514
|
+
},
|
|
26515
|
+
column.id
|
|
26516
|
+
))
|
|
26517
|
+
] }) }),
|
|
26518
|
+
body
|
|
26519
|
+
]
|
|
26520
|
+
}
|
|
26521
|
+
);
|
|
26522
|
+
}
|
|
26523
|
+
var EmptySlot = forwardRef(
|
|
26524
|
+
function EmptySlot2(props, ref) {
|
|
26525
|
+
const { columnCount } = usePattern("Empty");
|
|
26526
|
+
return /* @__PURE__ */ jsx(TableEmpty, { ref, columns: columnCount, ...props });
|
|
26527
|
+
}
|
|
26528
|
+
);
|
|
26529
|
+
EmptySlot.displayName = "DataTablePattern.Empty";
|
|
26530
|
+
var LoadingSlot = forwardRef(
|
|
26531
|
+
function LoadingSlot2(props, ref) {
|
|
26532
|
+
const { columnCount } = usePattern("Loading");
|
|
26533
|
+
return /* @__PURE__ */ jsx(TableLoading, { ref, columns: columnCount, ...props });
|
|
26534
|
+
}
|
|
26535
|
+
);
|
|
26536
|
+
LoadingSlot.displayName = "DataTablePattern.Loading";
|
|
26537
|
+
var ErrorSlot = forwardRef(
|
|
26538
|
+
function ErrorSlot2({ description, onRetry, ...props }, ref) {
|
|
26539
|
+
const context = usePattern("Error");
|
|
26540
|
+
return /* @__PURE__ */ jsx(
|
|
26541
|
+
TableError,
|
|
26542
|
+
{
|
|
26543
|
+
ref,
|
|
26544
|
+
columns: context.columnCount,
|
|
26545
|
+
description: description ?? (typeof context.error === "string" ? context.error : void 0),
|
|
26546
|
+
onRetry: onRetry ?? context.onRetry,
|
|
26547
|
+
...props
|
|
26548
|
+
}
|
|
26549
|
+
);
|
|
26550
|
+
}
|
|
26551
|
+
);
|
|
26552
|
+
ErrorSlot.displayName = "DataTablePattern.Error";
|
|
26553
|
+
var PaginationSlot = forwardRef(
|
|
26554
|
+
function PaginationSlot2({ className, onPageSizeChange, pageSizeOptions, ...props }, ref) {
|
|
26555
|
+
const { table, classNames } = usePattern("Pagination");
|
|
26556
|
+
const { pagination } = table;
|
|
26557
|
+
return /* @__PURE__ */ jsx(
|
|
26558
|
+
Pagination,
|
|
26559
|
+
{
|
|
26560
|
+
ref,
|
|
26561
|
+
page: pagination.page,
|
|
26562
|
+
pageCount: pagination.pageCount,
|
|
26563
|
+
onPageChange: pagination.setPage,
|
|
26564
|
+
totalItems: pagination.rowCount,
|
|
26565
|
+
pageSize: pagination.pageSize,
|
|
26566
|
+
pageSizeOptions,
|
|
26567
|
+
onPageSizeChange: pageSizeOptions ? (size) => {
|
|
26568
|
+
pagination.setPageSize(size);
|
|
26569
|
+
onPageSizeChange?.(size);
|
|
26570
|
+
} : onPageSizeChange,
|
|
26571
|
+
className: cn(
|
|
26572
|
+
"ds:border-rule ds:border-t ds:px-3 ds:py-2",
|
|
26573
|
+
classNames.pagination,
|
|
26574
|
+
className
|
|
26575
|
+
),
|
|
26576
|
+
...props
|
|
26577
|
+
}
|
|
26578
|
+
);
|
|
26579
|
+
}
|
|
26580
|
+
);
|
|
26581
|
+
PaginationSlot.displayName = "DataTablePattern.Pagination";
|
|
26582
|
+
function BulkActions({ onClear, className, ...props }) {
|
|
26583
|
+
const { table, classNames } = usePattern("BulkActions");
|
|
26584
|
+
return /* @__PURE__ */ jsx(
|
|
26585
|
+
BulkActionBar,
|
|
26586
|
+
{
|
|
26587
|
+
variant: "table-inline",
|
|
26588
|
+
selectedCount: table.selection.count,
|
|
26589
|
+
onClear: onClear ?? table.selection.clear,
|
|
26590
|
+
className: cn(classNames["bulk-actions"], className),
|
|
26591
|
+
...props
|
|
26592
|
+
}
|
|
26593
|
+
);
|
|
26594
|
+
}
|
|
26595
|
+
BulkActions.displayName = "DataTablePattern.BulkActions";
|
|
26596
|
+
var DataTablePattern = Object.assign(Root26, {
|
|
26597
|
+
Toolbar: Toolbar3,
|
|
26598
|
+
Search,
|
|
26599
|
+
Filters,
|
|
26600
|
+
ColumnsMenu,
|
|
26601
|
+
Content: Content16,
|
|
26602
|
+
Empty: EmptySlot,
|
|
26603
|
+
Loading: LoadingSlot,
|
|
26604
|
+
Error: ErrorSlot,
|
|
26605
|
+
Pagination: PaginationSlot,
|
|
26606
|
+
BulkActions
|
|
26607
|
+
});
|
|
26608
|
+
function InfoHint({
|
|
26609
|
+
label,
|
|
26610
|
+
children,
|
|
26611
|
+
presentation = "tooltip",
|
|
26612
|
+
icon,
|
|
26613
|
+
size = "xs",
|
|
26614
|
+
side = "top",
|
|
26615
|
+
className,
|
|
26616
|
+
open,
|
|
26617
|
+
onOpenChange
|
|
26618
|
+
}) {
|
|
26619
|
+
const trigger = /* @__PURE__ */ jsx(
|
|
26620
|
+
IconButton,
|
|
26621
|
+
{
|
|
26622
|
+
label,
|
|
26623
|
+
variant: "ghost",
|
|
26624
|
+
intent: "neutral",
|
|
26625
|
+
size,
|
|
26626
|
+
className,
|
|
26627
|
+
tooltip: presentation === "tooltip" ? children : label,
|
|
26628
|
+
tooltipSide: side,
|
|
26629
|
+
icon: icon ?? /* @__PURE__ */ jsx(InfoIcon, { "aria-hidden": "true" })
|
|
26630
|
+
}
|
|
26631
|
+
);
|
|
26632
|
+
if (presentation === "tooltip") return trigger;
|
|
26633
|
+
return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange, children: [
|
|
26634
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: trigger }),
|
|
26635
|
+
/* @__PURE__ */ jsx(PopoverContent, { side, width: "sm", className: "ds:text-sm", children })
|
|
26636
|
+
] });
|
|
26637
|
+
}
|
|
26638
|
+
var ROW_CLASSES = "ds:w-full ds:justify-start";
|
|
26639
|
+
function PeoplePicker(props) {
|
|
26640
|
+
const {
|
|
26641
|
+
people,
|
|
26642
|
+
currentUserId,
|
|
26643
|
+
assignToMeLabel,
|
|
26644
|
+
assignToMeSlot,
|
|
26645
|
+
size = "md",
|
|
26646
|
+
...rest
|
|
26647
|
+
} = props;
|
|
26648
|
+
const messages = useDsMessages("peoplePicker");
|
|
26649
|
+
const byId = React45.useMemo(
|
|
26650
|
+
() => new Map(people.map((person) => [person.id, person])),
|
|
26651
|
+
[people]
|
|
26652
|
+
);
|
|
26653
|
+
const single = props.multiple !== true;
|
|
26654
|
+
const unassignedLabel = single ? props.unassignedLabel : void 0;
|
|
26655
|
+
const setSingle = (value) => {
|
|
26656
|
+
props.onValueChange?.(value);
|
|
26657
|
+
};
|
|
26658
|
+
const shortcuts = assignToMeSlot ?? (single && (currentUserId || unassignedLabel) || !single && currentUserId ? /* @__PURE__ */ jsxs("div", { className: "ds:border-rule ds:border-b ds:p-1", children: [
|
|
26659
|
+
currentUserId && /* @__PURE__ */ jsx(
|
|
26660
|
+
Button,
|
|
26661
|
+
{
|
|
26662
|
+
type: "button",
|
|
26663
|
+
variant: "ghost",
|
|
26664
|
+
size: "sm",
|
|
26665
|
+
className: cn(ROW_CLASSES, "ds:text-brand"),
|
|
26666
|
+
onClick: () => {
|
|
26667
|
+
if (single) {
|
|
26668
|
+
setSingle(currentUserId);
|
|
26669
|
+
return;
|
|
26670
|
+
}
|
|
26671
|
+
const current = props.value ?? [];
|
|
26672
|
+
if (!current.includes(currentUserId)) {
|
|
26673
|
+
props.onValueChange?.([...current, currentUserId]);
|
|
26674
|
+
}
|
|
26675
|
+
},
|
|
26676
|
+
children: assignToMeLabel ?? messages.assignToMe
|
|
26677
|
+
}
|
|
26678
|
+
),
|
|
26679
|
+
single && unassignedLabel && /* @__PURE__ */ jsx(
|
|
26680
|
+
Button,
|
|
26681
|
+
{
|
|
26682
|
+
type: "button",
|
|
26683
|
+
variant: "ghost",
|
|
26684
|
+
size: "sm",
|
|
26685
|
+
className: ROW_CLASSES,
|
|
26686
|
+
onClick: () => setSingle(null),
|
|
26687
|
+
children: unassignedLabel
|
|
26688
|
+
}
|
|
26689
|
+
)
|
|
26690
|
+
] }) : void 0);
|
|
26691
|
+
return /* @__PURE__ */ jsx(
|
|
26692
|
+
Combobox,
|
|
26693
|
+
{
|
|
26694
|
+
...rest,
|
|
26695
|
+
size,
|
|
26696
|
+
options: people,
|
|
26697
|
+
getOptionValue: (person) => person.id,
|
|
26698
|
+
getOptionLabel: (person) => person.name,
|
|
26699
|
+
getOptionDisabled: (person) => person.disabled === true,
|
|
26700
|
+
getOptionKeywords: (person) => person.description ? [person.description] : [],
|
|
26701
|
+
header: shortcuts,
|
|
26702
|
+
renderOption: (option) => {
|
|
26703
|
+
const person = byId.get(option.value);
|
|
26704
|
+
return /* @__PURE__ */ jsxs("span", { className: "ds:flex ds:min-w-0 ds:items-center ds:gap-2", children: [
|
|
26705
|
+
/* @__PURE__ */ jsx(Avatar, { size: "xs", name: option.label, src: person?.avatarSrc ?? void 0 }),
|
|
26706
|
+
/* @__PURE__ */ jsxs("span", { className: "ds:min-w-0", children: [
|
|
26707
|
+
/* @__PURE__ */ jsx("span", { className: "ds:block ds:truncate", children: option.label }),
|
|
26708
|
+
person?.description && /* @__PURE__ */ jsx("span", { className: "ds:text-fg-4 ds:block ds:truncate ds:text-xs", children: person.description })
|
|
26709
|
+
] })
|
|
26710
|
+
] });
|
|
26711
|
+
},
|
|
26712
|
+
...single ? {
|
|
26713
|
+
multiple: false,
|
|
26714
|
+
value: props.value,
|
|
26715
|
+
defaultValue: props.defaultValue,
|
|
26716
|
+
onValueChange: (value) => setSingle(value)
|
|
26717
|
+
} : {
|
|
26718
|
+
multiple: true,
|
|
26719
|
+
value: props.value,
|
|
26720
|
+
defaultValue: props.defaultValue,
|
|
26721
|
+
onValueChange: (value) => props.onValueChange?.(value)
|
|
26722
|
+
}
|
|
26723
|
+
}
|
|
26724
|
+
);
|
|
26725
|
+
}
|
|
25132
26726
|
function brandScope(product) {
|
|
25133
26727
|
return { "data-brand": product };
|
|
25134
26728
|
}
|
|
@@ -25154,6 +26748,6 @@ var BrandScope = forwardRef(function BrandScope2({ product, children, ...props }
|
|
|
25154
26748
|
});
|
|
25155
26749
|
BrandScope.displayName = "BrandScope";
|
|
25156
26750
|
|
|
25157
|
-
export { AIReceiptPanel, Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActivityEventItem, ActivityItem, ActivityList, AgreementPaneHeading, AgreementViewer, AiDraftCard, Alert, AlertCircleIcon, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AlertTriangleIcon, AlertTriangleSolidIcon, AppHeader, AppHeaderActions, AppHeaderBreadcrumb, AppHeaderSearch, AppHeaderTitle, ArchiveIcon, AreaChart, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowRightSmallIcon, ArrowUpIcon, AspectRatio, Assignee, AssureAuditBrandIcon, AssureBooksBrandIcon, AssureProBrandIcon, AssureTaxBrandIcon, AtSignIcon, AttachmentChip, AttentionItem, Avatar, BRAND_PRODUCTS, Badge, BarChartIcon, BellIcon, Blockquote, BoldIcon, BottomNav, BrainIcon, BrandScope, BrandScopeProvider, Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, BriefcaseIcon, Building2Icon, BuildingIcon, BulkActionBar, BulkActionBarAction, BulkActionBarSeparator, Button, COUNTRY_CODES, Calendar, CalendarIcon, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CategoryDivider, CategoryTag, ChannelTabs, ChatBubbleIcon, CheckCircle2Icon, CheckCircleSolidIcon, CheckIcon, Checkbox, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsDownUpIcon, ChevronsUpDownIcon, Chip, CircleDotIcon, CircleIcon, ClientRailGroupHeader, ClientRailItem, ClientSelect, ClipboardCheckIcon, ClockIcon, CloseIcon, Code, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComingSoon, CommandIcon, CommandPalette, ConfirmActionButton, ConfirmDialog, ConfirmHost, Content14 as Content, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyButton, CopyIcon, CornerDownLeftIcon, CountryFlag2 as CountryFlag, CountrySelect, CreditCardIcon, DATE_DISPLAY_PLACEHOLDER, DEFAULT_COMBOBOX_MESSAGES, DEFAULT_PHONE_FIELD_MESSAGES, DangerAction, Dash, DashGrid, DataItem, DataTable, DataTableBody, DataTableCell, DataTableCellDue, DataTableCellId, DataTableCellMono, DataTableCellName, DataTableCheckbox, DataTableHead, DataTableHeader, DataTablePagination, DataTableResultsCount, DataTableRow, DataTableSearch, DataTableSpacer, DataTableToolbar, DataTableView, DatePicker, DateRangePicker, DesignSystemProvider, DetailGrid, DetailMain, DetailSpine, DetailSpineHeader, DetailSpineSection, DetailSpineStats, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DismissibleChip, DisplayMenu, DocumentChecklist, DocumentDetailActions, DocumentDetailBody, DocumentDetailHeader, DocumentDetailMetaRow, DocumentDetailPanel, DocumentDetailRequester, DocumentDetailTitle, DocumentFileCard, DocumentFileLine, DocumentFileRow, DocumentIcon, DocumentList, DocumentListSection, DocumentRequestCard, DocumentRequestDetail, DocumentRequestField, DocumentRequestUpload, DocumentRow, DocumentSourceFilter, DocumentSourceTag, DocumentsWorkspaceLayout, DollarSignIcon, DonutChart, DownloadIcon, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmailMessageCard, EmptyState, EngagementCard, EngagementTimeline, EngagementTimelineStep, ExternalLinkIcon, ExtractIcon, EyeIcon, EyeOffIcon, Eyebrow, Field, FieldControl, FieldDescription, FieldError, Fieldset, FieldsetLegend, FileChip, FileIcon, FileReturnIcon, FileTextIcon, FileTypeBadge, FileUpload, FilterChip, FilterIcon, FlagIcon, FolderClosedIcon, FolderOpenIcon, FolderPlusIcon, FolderTree, FolderUpIcon, FormError, FormSection, FormSuccess, GlobeIcon, GoogleBrandIcon, Grid, GripVerticalIcon, Heading, HelpCircleIcon, HistoryIcon, HomeIcon, HoverCard, HoverCardContent, HoverCardPortal, HoverCardTrigger, ICON_TILE_TONE_TO_INTENT, IconAction, IconButton, IconTile, InboxIcon, InfoCircleSolidIcon, InfoIcon, Inline, Input, IntentBadge, ItalicIcon, Kanban, KanbanCard, KanbanColumn, KanbanIcon, Kbd, KbdHint, KeyIcon, KeyboardShortcutsDialog, KpiCard, Label4 as Label, LandmarkIcon, LayersIcon, LayoutDashboardIcon, LayoutGridIcon, LayoutListIcon, LightningIcon, Link2Icon, LinkAction, LinkButton, LinkIcon, ListChecksIcon, ListIcon, ListOrderedIcon, LoaderIcon, LoadingRows, LockIcon, LockKeyholeIcon, LockOpenIcon, LogOutIcon, Logo, MailIcon, Main, MapPinIcon, MasterDetailLayout, MaximizeIcon, MenuIcon, MessageBubble, MessageBubbleAction, MessageBubbleTombstone, MessageCircleIcon, MessageCircleWarningIcon, MessageComposer, MetadataGrid, MicIcon, MicrosoftBrandIcon, MinimizeIcon, MinusIcon, MissingDocumentsPanel, MoneyCell, MonitorIcon, MoonIcon, MoreHorizontalIcon, MoveIcon, MultiFilterPill, MultiSelect, MultiSelectField, MutedSpec, NewMenu, NotificationFilter, NotificationItem, NotificationList, NotificationPanel, NotificationPanelFooter, NotificationPanelHeader, NumberInput, Numeric, OTPInput, PROGRESS_LEGACY_TO_INTENT, PageHeader, PageHeaderSep, PageHeaderSpec, Pagination, PaletteIcon, PanelLeftCloseIcon, PanelLeftIcon, PanelRightIcon, PaperclipIcon, PauseIcon, PdfPreview, PenSignIcon, PenToolIcon, PencilIcon, PhoneCountryInput, PhoneField, PhoneIcon, PhoneInput, PlayIcon, PlusIcon, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverPortal, PopoverTrigger, Pressable, PrimaryAction, PriorityIcon, ProgressBar, ProgressRing, ProposalAddOn, ProposalBillingTerms, ProposalConsentGate, ProposalCustomPage, ProposalNote, ProposalPackageCard, ProposalPaymentCapture, ProposalPricingSummary, ProposalServiceRow, ProposalSignatureBlock, ProposalSignerList, QuestionnairePanel, Questions, RadioGroup3 as RadioGroup, RadioGroupItem, RankedBars, ReceiptIcon, RefreshCwIcon, ReplyIcon, ResponsiveDialog, RotateCcwIcon, RouteTransition, SERVICE_TONES, SPINNER_TONE_TO_INTENT, STATUS_DOT_TONE_TO_INTENT, SaveIcon, ScrollArea, ScrollBar, SearchIcon, SearchInput, SearchSelect, SecondaryAction, Section, SectionHead, SectionHeader, SegmentedProgress, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectRoot, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SelectableKpiCard, SendIcon, Separator4 as Separator, SettingsIcon, Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Shell, ShieldIcon, SideDrawer, Sidebar, SidebarBrand, SidebarBrandSwitcher, SidebarBrandSwitcherTile, SidebarBrandText, SidebarFooter, SidebarLink, SidebarLinkAction, SidebarLinkBadge, SidebarLinkGroup, SidebarLinkLabel, SidebarPinButton, SidebarProvider, SidebarSection, SidebarTrigger, SidebarUser, SigmaIcon, SignatureEditor, Skeleton, SkeletonCircle, SkeletonText, SlashIcon, Slider, SmartphoneIcon, SparkleIcon, SparklesIcon, Spinner, SpreadsheetPreview, Stack, StackedBarChart, StagePill, StarIcon, StarRating, Stat, StatusBadge, StatusDot, StatusIcon, StatusPill, Stepper, StickyActionBar, StickyStack, StickyStackLayer, StickyStackSectionHeader, StickyStackSticky, StopIcon, StrikethroughIcon, SubmitButton, SuggestionPills, SuiteProgress, SunIcon, Surface, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableIcon, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TagIcon, TagsCell, TeamIcon, TeamMemberSelect, Text, Textarea, ThemeScope, ThumbsDownIcon, ThumbsUpIcon, TimeLogger, TimeLoggerActions, TimeLoggerBillable, TimeLoggerContextRow, TimeLoggerEntry, TimeLoggerEntryList, TimeLoggerField, TimeLoggerFooter, TimeLoggerHeader, TimeLoggerNotes, TimeLoggerTimer, TimerIcon, ToastProvider, ToggleGroup, ToggleGroupItem, Toolbar, Tooltip, TooltipContent, TooltipPortal, TooltipProvider, TooltipTrigger, Trash2Icon, TrashIcon, TrashSolidIcon, TrendingDownIcon, TrendingUpIcon, UnderlineIcon, UploadIcon, UserCircleIcon, UserIcon, UsersIcon, VideoIcon, VisuallyHidden, Volume2Icon, VolumeXIcon, WorkflowIcon, XCircleSolidIcon, XIcon, YEAR_DISPLAY_PLACEHOLDER, ZoomInIcon, ZoomOutIcon, alertVariants, applyMask, applyYearMask, assetPath, attachmentChipVariants, badgeVariants, brandLabel, brandScope, buttonVariants, cardVariants, chipVariants2 as chipVariants, cn, colors, createIcon, dateToIso, defineStatusMap, displayToIso, fileTypeBadgeVariants, fileTypeFromName, filterChipVariants, formatClock, formatCurrency, formatDuration, getAssetBasePath, getFlagEmoji, iconButtonVariants, resolveIconTileVariants as iconTileVariants, inputVariants, isoToDate, isoToDisplay, isoToYear, labelVariants, parseDuration, parsePhoneForEditing, progressBarVariants, progressRingVariants, radii, reference, resolveBadgeAppearance, resolveButtonStyle, resolveChipStyle, searchInputVariants, serviceToneLabel, serviceToneStyle, setAssetBasePath, shadows, sidebarLinkBadgeVariants, spacing, spinnerVariants, starRatingVariants, statusDotVariants, suiteProgressFillVariants, surfaces, systemTokens, textareaVariants, typography, useBrandScope, useConfirm, useDsMessages, useFieldControl, usePrompt, useSidebarPeekLock, useSidebarState, useStopwatch, useToast, yearToIso };
|
|
26751
|
+
export { AIReceiptPanel, Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActivityEventItem, ActivityItem, ActivityList, AgreementPaneHeading, AgreementViewer, AiDraftCard, Alert, AlertCircleIcon, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AlertTriangleIcon, AlertTriangleSolidIcon, AppHeader, AppHeaderActions, AppHeaderBreadcrumb, AppHeaderSearch, AppHeaderTitle, ArchiveIcon, AreaChart, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowRightSmallIcon, ArrowUpIcon, AspectRatio, Assignee, AssureAuditBrandIcon, AssureBooksBrandIcon, AssureProBrandIcon, AssureTaxBrandIcon, AtSignIcon, AttachmentChip, AttentionItem, Avatar, AvatarGroup, BRAND_PRODUCTS, Badge, BarChartIcon, BellIcon, Blockquote, BoldIcon, BottomNav, BrainIcon, BrandScope, BrandScopeProvider, Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, BriefcaseIcon, Building2Icon, BuildingIcon, BulkActionBar, BulkActionBarAction, BulkActionBarSeparator, Button, COUNTRY_CODES, Calendar, CalendarIcon, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CategoryDivider, CategoryTag, ChannelTabs, ChatBubbleIcon, CheckCircle2Icon, CheckCircleSolidIcon, CheckIcon, Checkbox, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsDownUpIcon, ChevronsUpDownIcon, Chip, CircleDotIcon, CircleIcon, ClientRailGroupHeader, ClientRailItem, ClientSelect, ClipboardCheckIcon, ClockIcon, CloseIcon, Code, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComingSoon, CommandIcon, CommandPalette, ConfirmActionButton, ConfirmDialog, ConfirmHost, Content14 as Content, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyButton, CopyIcon, CornerDownLeftIcon, CountryFlag2 as CountryFlag, CountrySelect, CreditCardIcon, DATE_DISPLAY_PLACEHOLDER, DEFAULT_COMBOBOX_MESSAGES, DEFAULT_PHONE_FIELD_MESSAGES, DangerAction, Dash, DashGrid, DataItem, DataTable, DataTableBody, DataTableCell, DataTableCellDue, DataTableCellId, DataTableCellMono, DataTableCellName, DataTableCheckbox, DataTableHead, DataTableHeader, DataTablePagination, DataTablePattern, DataTableResultsCount, DataTableRow, DataTableSearch, DataTableSpacer, DataTableToolbar, DataTableView, DatePicker, DateRangePicker, DesignSystemProvider, DetailGrid, DetailMain, DetailSpine, DetailSpineHeader, DetailSpineSection, DetailSpineStats, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DismissibleChip, DisplayMenu, DocumentChecklist, DocumentDetailActions, DocumentDetailBody, DocumentDetailHeader, DocumentDetailMetaRow, DocumentDetailPanel, DocumentDetailRequester, DocumentDetailTitle, DocumentFileCard, DocumentFileLine, DocumentFileRow, DocumentIcon, DocumentList, DocumentListSection, DocumentRequestCard, DocumentRequestDetail, DocumentRequestField, DocumentRequestUpload, DocumentRow, DocumentSourceFilter, DocumentSourceTag, DocumentsWorkspaceLayout, DollarSignIcon, DonutChart, DownloadIcon, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmailMessageCard, EmptyState, EmptyValue, EngagementCard, EngagementTimeline, EngagementTimelineStep, ErrorState, ExternalLinkIcon, ExtractIcon, EyeIcon, EyeOffIcon, Eyebrow, Field, FieldControl, FieldDescription, FieldError, Fieldset, FieldsetLegend, FileChip, FileIcon, FileReturnIcon, FileTextIcon, FileTypeBadge, FileUpload, FilterChip, FilterIcon, FlagIcon, FolderClosedIcon, FolderOpenIcon, FolderPlusIcon, FolderTree, FolderUpIcon, FormError, FormSection, FormSuccess, GlobeIcon, GoogleBrandIcon, Grid, GripVerticalIcon, Heading, HelpCircleIcon, HistoryIcon, HomeIcon, HoverCard, HoverCardContent, HoverCardPortal, HoverCardTrigger, ICON_TILE_TONE_TO_INTENT, IconAction, IconButton, IconTile, InboxIcon, InfoCircleSolidIcon, InfoHint, InfoIcon, Inline, Input, IntentBadge, ItalicIcon, Kanban, KanbanCard, KanbanColumn, KanbanIcon, Kbd, KbdHint, KeyIcon, KeyboardShortcutsDialog, KpiCard, Label4 as Label, LandmarkIcon, LayersIcon, LayoutDashboardIcon, LayoutGridIcon, LayoutListIcon, LightningIcon, Link2Icon, LinkAction, LinkButton, LinkIcon, ListChecksIcon, ListIcon, ListOrderedIcon, LoaderIcon, LoadingRows, LockIcon, LockKeyholeIcon, LockOpenIcon, LogOutIcon, Logo, MailIcon, Main, MapPinIcon, MasterDetailLayout, MaximizeIcon, MenuIcon, MessageBubble, MessageBubbleAction, MessageBubbleTombstone, MessageCircleIcon, MessageCircleWarningIcon, MessageComposer, MetadataGrid, MicIcon, MicrosoftBrandIcon, MinimizeIcon, MinusIcon, MissingDocumentsPanel, MoneyCell, MonitorIcon, MoonIcon, MoreHorizontalIcon, MoveIcon, MultiFilterPill, MultiSelect, MultiSelectField, MutedSpec, NewMenu, NotificationFilter, NotificationItem, NotificationList, NotificationPanel, NotificationPanelFooter, NotificationPanelHeader, NumberInput, Numeric, OTPInput, PROGRESS_LEGACY_TO_INTENT, PageHeader, PageHeaderSep, PageHeaderSpec, Pagination, PaletteIcon, PanelLeftCloseIcon, PanelLeftIcon, PanelRightIcon, PaperclipIcon, PauseIcon, PdfPreview, PenSignIcon, PenToolIcon, PencilIcon, PeoplePicker, PhoneCountryInput, PhoneField, PhoneIcon, PhoneInput, PlayIcon, PlusIcon, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverPortal, PopoverTrigger, Pressable, PrimaryAction, PriorityIcon, ProgressBar, ProgressRing, ProposalAddOn, ProposalBillingTerms, ProposalConsentGate, ProposalCustomPage, ProposalNote, ProposalPackageCard, ProposalPaymentCapture, ProposalPricingSummary, ProposalServiceRow, ProposalSignatureBlock, ProposalSignerList, QuestionnairePanel, Questions, RadioGroup3 as RadioGroup, RadioGroupItem, RankedBars, ReceiptIcon, RefreshCwIcon, ReplyIcon, ResponsiveDialog, RotateCcwIcon, RouteTransition, SERVICE_TONES, SPINNER_TONE_TO_INTENT, STATUS_DOT_TONE_TO_INTENT, SaveIcon, ScrollArea, ScrollBar, SearchIcon, SearchInput, SearchSelect, SecondaryAction, Section, SectionCard, SectionHead, SectionHeader, SegmentedControl, SegmentedProgress, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectRoot, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SelectableKpiCard, SendIcon, Separator4 as Separator, SettingsIcon, Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Shell, ShieldIcon, SideDrawer, Sidebar, SidebarBrand, SidebarBrandSwitcher, SidebarBrandSwitcherTile, SidebarBrandText, SidebarDrawer, SidebarFooter, SidebarLink, SidebarLinkAction, SidebarLinkBadge, SidebarLinkGroup, SidebarLinkLabel, SidebarPinButton, SidebarProvider, SidebarSection, SidebarTrigger, SidebarUser, SigmaIcon, SignatureEditor, Skeleton, SkeletonCircle, SkeletonText, SlashIcon, Slider, SmartphoneIcon, SparkleIcon, SparklesIcon, Spinner, SpreadsheetPreview, Stack, StackedBarChart, StagePill, StarIcon, StarRating, Stat, StatusBadge, StatusDot, StatusIcon, StatusPill, Stepper, StickyActionBar, StickyStack, StickyStackLayer, StickyStackSectionHeader, StickyStackSticky, StopIcon, StrikethroughIcon, SubmitButton, SuggestionPills, SuiteProgress, SunIcon, Surface, Switch, Table, TableBody, TableCaption, TableCell, TableEmpty, TableError, TableFooter, TableHead, TableHeader, TableIcon, TableLoading, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TagIcon, TagsCell, TeamIcon, TeamMemberSelect, Text, Textarea, ThemeScope, ThumbsDownIcon, ThumbsUpIcon, TimeLogger, TimeLoggerActions, TimeLoggerBillable, TimeLoggerContextRow, TimeLoggerEntry, TimeLoggerEntryList, TimeLoggerField, TimeLoggerFooter, TimeLoggerHeader, TimeLoggerNotes, TimeLoggerTimer, TimerIcon, ToastProvider, ToggleGroup, ToggleGroupItem, Toolbar, Tooltip, TooltipContent, TooltipPortal, TooltipProvider, TooltipTrigger, Trash2Icon, TrashIcon, TrashSolidIcon, TrendingDownIcon, TrendingUpIcon, UnderlineIcon, UploadIcon, UserCircleIcon, UserIcon, UsersIcon, VideoIcon, VisuallyHidden, Volume2Icon, VolumeXIcon, WorkflowIcon, XCircleSolidIcon, XIcon, YEAR_DISPLAY_PLACEHOLDER, ZoomInIcon, ZoomOutIcon, alertVariants, applyMask, applyYearMask, assetPath, attachmentChipVariants, badgeVariants, brandLabel, brandScope, buttonVariants, cardVariants, chipVariants2 as chipVariants, cn, colors, compareSortValues, createIcon, dateToIso, defineStatusMap, displayToIso, fileTypeBadgeVariants, fileTypeFromName, filterChipVariants, formatClock, formatCurrency, formatDuration, getAssetBasePath, getFlagEmoji, iconButtonVariants, resolveIconTileVariants as iconTileVariants, inputVariants, isoToDate, isoToDisplay, isoToYear, labelVariants, nextSortDirection, parseDuration, parsePhoneForEditing, progressBarVariants, progressRingVariants, radii, reference, resolveBadgeAppearance, resolveButtonStyle, resolveChipStyle, searchInputVariants, serviceToneLabel, serviceToneStyle, setAssetBasePath, shadows, sidebarLinkBadgeVariants, spacing, spinnerVariants, starRatingVariants, statusDotVariants, suiteProgressFillVariants, surfaces, systemTokens, textareaVariants, typography, useBrandScope, useConfirm, useDataTable, useDsMessages, useFieldControl, usePrompt, useSidebarPeekLock, useSidebarState, useStopwatch, useToast, yearToIso };
|
|
25158
26752
|
//# sourceMappingURL=index.js.map
|
|
25159
26753
|
//# sourceMappingURL=index.js.map
|