@eqtylab/equality 2.3.3 → 2.4.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/dist/avatar.module.module.css.module.css +17 -13
- package/dist/dropdown-menu.module.module.css.module.css +49 -3
- package/dist/index.cjs +572 -213
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +19 -5
- package/dist/index.d.ts +19 -5
- package/dist/index.js +544 -187
- package/dist/index.js.map +1 -1
- package/dist/theme.module.module.css.module.css +65 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React14 from 'react';
|
|
2
2
|
import { forwardRef, useRef, useMemo, useEffect, useSyncExternalStore, useState, useCallback, useLayoutEffect, createElement } from 'react';
|
|
3
3
|
import { cva } from 'class-variance-authority';
|
|
4
4
|
import styles2 from './alert.module.module.css.module.css';
|
|
5
5
|
import * as LucideIcons from 'lucide-react';
|
|
6
|
-
import { Check, ChevronRight, Circle, ChevronDown, ChevronUp, X, SearchIcon, CalendarDays, ChevronLeft, Grid3X3, List, AlertOctagon, Home,
|
|
6
|
+
import { Check, ChevronRight, Search, Circle, ChevronDown, ChevronUp, X, SearchIcon, CalendarDays, ChevronLeft, Grid3X3, List, AlertOctagon, Home, ArrowUp, ArrowDown, ArrowUpDown, TriangleAlert } from 'lucide-react';
|
|
7
7
|
import styles from './icon.module.module.css.module.css';
|
|
8
8
|
import { clsx } from 'clsx';
|
|
9
9
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -161,9 +161,9 @@ var Icon = forwardRef(
|
|
|
161
161
|
throw new Error(`Icon "${icon}" not found in lucide-react`);
|
|
162
162
|
}
|
|
163
163
|
renderedIcon = /* @__PURE__ */ jsx(LucideIcon, { className: cn(styles["icon"]) });
|
|
164
|
-
} else if (
|
|
164
|
+
} else if (React14.isValidElement(icon)) {
|
|
165
165
|
const existingProps = icon.props;
|
|
166
|
-
renderedIcon =
|
|
166
|
+
renderedIcon = React14.cloneElement(
|
|
167
167
|
icon,
|
|
168
168
|
{
|
|
169
169
|
...existingProps,
|
|
@@ -208,7 +208,7 @@ var defaultVariantIcons = {
|
|
|
208
208
|
warning: "OctagonAlert",
|
|
209
209
|
danger: "TriangleAlert"
|
|
210
210
|
};
|
|
211
|
-
var Alert =
|
|
211
|
+
var Alert = React14.forwardRef(
|
|
212
212
|
({ className, variant, title, description, icon, ...props }, ref) => {
|
|
213
213
|
const effectiveIcon = icon === void 0 ? variant ? defaultVariantIcons[variant] : void 0 : icon;
|
|
214
214
|
return /* @__PURE__ */ jsxs(
|
|
@@ -261,7 +261,7 @@ var buttonVariants = cva(styles3["button"], {
|
|
|
261
261
|
size: "md"
|
|
262
262
|
}
|
|
263
263
|
});
|
|
264
|
-
var Button =
|
|
264
|
+
var Button = React14.forwardRef(
|
|
265
265
|
({ className, variant, size, asChild = false, prefix, suffix, children, ...props }, ref) => {
|
|
266
266
|
const isLink = "href" in props && props.href;
|
|
267
267
|
if (isLink) {
|
|
@@ -304,7 +304,7 @@ Button.displayName = "Button";
|
|
|
304
304
|
var AlertDialog = AlertDialogPrimitive.Root;
|
|
305
305
|
var AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
306
306
|
var AlertDialogPortal = ({ children }) => /* @__PURE__ */ jsx(AlertDialogPrimitive.Portal, { container: getThemeProviderRoot(), children });
|
|
307
|
-
var AlertDialogOverlay =
|
|
307
|
+
var AlertDialogOverlay = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
308
308
|
AlertDialogPrimitive.Overlay,
|
|
309
309
|
{
|
|
310
310
|
className: cn(styles4["alert-dialog-overlay"], className),
|
|
@@ -313,7 +313,7 @@ var AlertDialogOverlay = React16.forwardRef(({ className, ...props }, ref) => /*
|
|
|
313
313
|
}
|
|
314
314
|
));
|
|
315
315
|
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
316
|
-
var AlertDialogContent =
|
|
316
|
+
var AlertDialogContent = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [
|
|
317
317
|
/* @__PURE__ */ jsx(AlertDialogOverlay, {}),
|
|
318
318
|
/* @__PURE__ */ jsx(
|
|
319
319
|
AlertDialogPrimitive.Content,
|
|
@@ -329,7 +329,7 @@ var AlertDialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsx("div",
|
|
|
329
329
|
AlertDialogHeader.displayName = "AlertDialogHeader";
|
|
330
330
|
var AlertDialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn(styles4["alert-dialog-footer"], className), ...props });
|
|
331
331
|
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
332
|
-
var AlertDialogTitle =
|
|
332
|
+
var AlertDialogTitle = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
333
333
|
AlertDialogPrimitive.Title,
|
|
334
334
|
{
|
|
335
335
|
ref,
|
|
@@ -338,7 +338,7 @@ var AlertDialogTitle = React16.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
338
338
|
}
|
|
339
339
|
));
|
|
340
340
|
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
341
|
-
var AlertDialogDescription =
|
|
341
|
+
var AlertDialogDescription = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
342
342
|
AlertDialogPrimitive.Description,
|
|
343
343
|
{
|
|
344
344
|
ref,
|
|
@@ -347,7 +347,7 @@ var AlertDialogDescription = React16.forwardRef(({ className, ...props }, ref) =
|
|
|
347
347
|
}
|
|
348
348
|
));
|
|
349
349
|
AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
|
|
350
|
-
var AlertDialogAction =
|
|
350
|
+
var AlertDialogAction = React14.forwardRef(({ className, variant = "primary", size = "sm", prefix, suffix, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
351
351
|
AlertDialogPrimitive.Action,
|
|
352
352
|
{
|
|
353
353
|
ref,
|
|
@@ -361,7 +361,7 @@ var AlertDialogAction = React16.forwardRef(({ className, variant = "primary", si
|
|
|
361
361
|
}
|
|
362
362
|
));
|
|
363
363
|
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
364
|
-
var AlertDialogCancel =
|
|
364
|
+
var AlertDialogCancel = React14.forwardRef(({ className, variant = "tertiary", size = "sm", prefix, suffix, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
365
365
|
AlertDialogPrimitive.Cancel,
|
|
366
366
|
{
|
|
367
367
|
ref,
|
|
@@ -375,7 +375,7 @@ var AlertDialogCancel = React16.forwardRef(({ className, variant = "tertiary", s
|
|
|
375
375
|
}
|
|
376
376
|
));
|
|
377
377
|
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
378
|
-
var Avatar =
|
|
378
|
+
var Avatar = React14.forwardRef(
|
|
379
379
|
({ className, size = "md", shape = "circle", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
380
380
|
AvatarPrimitive.Root,
|
|
381
381
|
{
|
|
@@ -386,9 +386,9 @@ var Avatar = React16.forwardRef(
|
|
|
386
386
|
)
|
|
387
387
|
);
|
|
388
388
|
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
389
|
-
var AvatarImage =
|
|
389
|
+
var AvatarImage = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(AvatarPrimitive.Image, { ref, className: cn(styles5["avatar-image"], className), ...props }));
|
|
390
390
|
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
391
|
-
var AvatarFallback =
|
|
391
|
+
var AvatarFallback = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
392
392
|
AvatarPrimitive.Fallback,
|
|
393
393
|
{
|
|
394
394
|
ref,
|
|
@@ -401,7 +401,7 @@ var TooltipProvider = TooltipPrimitive.Provider;
|
|
|
401
401
|
var Tooltip = TooltipPrimitive.Root;
|
|
402
402
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
403
403
|
var TooltipPortal = ({ children }) => /* @__PURE__ */ jsx(TooltipPrimitive.Portal, { container: getThemeProviderRoot(), children });
|
|
404
|
-
var TooltipContent =
|
|
404
|
+
var TooltipContent = React14.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(TooltipPortal, { children: /* @__PURE__ */ jsxs(
|
|
405
405
|
TooltipPrimitive.Content,
|
|
406
406
|
{
|
|
407
407
|
ref,
|
|
@@ -519,10 +519,10 @@ function Badge({
|
|
|
519
519
|
}
|
|
520
520
|
);
|
|
521
521
|
}
|
|
522
|
-
var BarGraphSegment =
|
|
522
|
+
var BarGraphSegment = React14.forwardRef(
|
|
523
523
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
524
524
|
({ value, color, label, tooltip, className, style, ...props }, ref) => {
|
|
525
|
-
const tooltipId =
|
|
525
|
+
const tooltipId = React14.useId();
|
|
526
526
|
return (
|
|
527
527
|
// Widths are proportional (`value / sum`): each segment grows by its `value`
|
|
528
528
|
// within the flex row, so the parent never needs to know the total.
|
|
@@ -573,9 +573,9 @@ var barVariants = cva(styles8["bar"], {
|
|
|
573
573
|
size: "md"
|
|
574
574
|
}
|
|
575
575
|
});
|
|
576
|
-
var BarGraph =
|
|
576
|
+
var BarGraph = React14.forwardRef(
|
|
577
577
|
({ className, children, showLabels = false, size, ...props }, ref) => {
|
|
578
|
-
const validChildren =
|
|
578
|
+
const validChildren = React14.Children.toArray(children).filter(React14.isValidElement);
|
|
579
579
|
const segments = validChildren.filter(
|
|
580
580
|
(child) => child.type === BarGraphSegment
|
|
581
581
|
);
|
|
@@ -937,7 +937,7 @@ var CardContentHeader = forwardRef(
|
|
|
937
937
|
);
|
|
938
938
|
CardContentHeader.displayName = "CardContentHeader";
|
|
939
939
|
var cardElevationVariants = generateElevationVariants(styles12, "card", ELEVATION.RAISED);
|
|
940
|
-
var Card =
|
|
940
|
+
var Card = React14.forwardRef(({ className, hoverGradientClassName, elevation = ELEVATION.RAISED, ...props }, ref) => {
|
|
941
941
|
const shouldHaveHoverStyle = props.onClick !== void 0;
|
|
942
942
|
return /* @__PURE__ */ jsxs(
|
|
943
943
|
"div",
|
|
@@ -958,28 +958,28 @@ var Card = React16.forwardRef(({ className, hoverGradientClassName, elevation =
|
|
|
958
958
|
);
|
|
959
959
|
});
|
|
960
960
|
Card.displayName = "Card";
|
|
961
|
-
var CardHeader =
|
|
961
|
+
var CardHeader = React14.forwardRef(
|
|
962
962
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn(styles12["card-header"], className), ...props })
|
|
963
963
|
);
|
|
964
964
|
CardHeader.displayName = "CardHeader";
|
|
965
|
-
var CardTitle =
|
|
965
|
+
var CardTitle = React14.forwardRef(
|
|
966
966
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn(styles12["card-title"], className), ...props })
|
|
967
967
|
);
|
|
968
968
|
CardTitle.displayName = "CardTitle";
|
|
969
|
-
var CardDescription =
|
|
969
|
+
var CardDescription = React14.forwardRef(
|
|
970
970
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn(styles12["card-description"], className), ...props })
|
|
971
971
|
);
|
|
972
972
|
CardDescription.displayName = "CardDescription";
|
|
973
|
-
var CardContent =
|
|
973
|
+
var CardContent = React14.forwardRef(
|
|
974
974
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn(styles12["card-content"], className), ...props })
|
|
975
975
|
);
|
|
976
976
|
CardContent.displayName = "CardContent";
|
|
977
|
-
var CardFooter =
|
|
977
|
+
var CardFooter = React14.forwardRef(
|
|
978
978
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn(styles12["card-footer"], className), ...props })
|
|
979
979
|
);
|
|
980
980
|
CardFooter.displayName = "CardFooter";
|
|
981
981
|
var CheckIcon = Check;
|
|
982
|
-
var Checkbox =
|
|
982
|
+
var Checkbox = React14.forwardRef(
|
|
983
983
|
({ className, icon: Icon3, size = "md", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
984
984
|
CheckboxPrimitive.Root,
|
|
985
985
|
{
|
|
@@ -1065,7 +1065,7 @@ function CopyButton({
|
|
|
1065
1065
|
className,
|
|
1066
1066
|
onClick
|
|
1067
1067
|
}) {
|
|
1068
|
-
const [copied, setCopied] =
|
|
1068
|
+
const [copied, setCopied] = React14.useState(false);
|
|
1069
1069
|
const handleCopy = async () => {
|
|
1070
1070
|
try {
|
|
1071
1071
|
if (navigator.clipboard && navigator.clipboard.writeText) {
|
|
@@ -1263,7 +1263,7 @@ var Dialog = DialogPrimitive.Root;
|
|
|
1263
1263
|
var DialogTrigger = DialogPrimitive.Trigger;
|
|
1264
1264
|
var DialogPortal = ({ children }) => /* @__PURE__ */ jsx(DialogPrimitive.Portal, { container: getThemeProviderRoot(), children });
|
|
1265
1265
|
var DialogClose = DialogPrimitive.Close;
|
|
1266
|
-
var DialogOverlay =
|
|
1266
|
+
var DialogOverlay = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1267
1267
|
DialogPrimitive.Overlay,
|
|
1268
1268
|
{
|
|
1269
1269
|
ref,
|
|
@@ -1272,7 +1272,7 @@ var DialogOverlay = React16.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
1272
1272
|
}
|
|
1273
1273
|
));
|
|
1274
1274
|
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
1275
|
-
var DialogContainer =
|
|
1275
|
+
var DialogContainer = React14.forwardRef(({ className, children, size = "md", ...props }, ref) => /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
1276
1276
|
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
1277
1277
|
/* @__PURE__ */ jsx(
|
|
1278
1278
|
DialogPrimitive.Content,
|
|
@@ -1292,12 +1292,12 @@ DialogContainer.displayName = DialogPrimitive.Content.displayName;
|
|
|
1292
1292
|
var DialogHeaderIcon = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn(styles16["dialog-header-icon"], className), ...props });
|
|
1293
1293
|
DialogHeaderIcon.displayName = "DialogHeaderIcon";
|
|
1294
1294
|
var DialogHeader = ({ className, children, ...props }) => {
|
|
1295
|
-
const childrenArray =
|
|
1295
|
+
const childrenArray = React14.Children.toArray(children);
|
|
1296
1296
|
const icon = childrenArray.find(
|
|
1297
|
-
(child) =>
|
|
1297
|
+
(child) => React14.isValidElement(child) && child.type === DialogHeaderIcon
|
|
1298
1298
|
);
|
|
1299
1299
|
const otherChildren = childrenArray.filter(
|
|
1300
|
-
(child) => !(
|
|
1300
|
+
(child) => !(React14.isValidElement(child) && child.type === DialogHeaderIcon)
|
|
1301
1301
|
);
|
|
1302
1302
|
return /* @__PURE__ */ jsxs("div", { className: cn(styles16["dialog-header"], className), ...props, children: [
|
|
1303
1303
|
icon,
|
|
@@ -1308,9 +1308,9 @@ var DialogHeader = ({ className, children, ...props }) => {
|
|
|
1308
1308
|
DialogHeader.displayName = "DialogHeader";
|
|
1309
1309
|
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn(styles16["dialog-footer"], className), ...props });
|
|
1310
1310
|
DialogFooter.displayName = "DialogFooter";
|
|
1311
|
-
var DialogTitle =
|
|
1311
|
+
var DialogTitle = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(DialogPrimitive.Title, { ref, className: cn(styles16["dialog-title"], className), ...props }));
|
|
1312
1312
|
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
1313
|
-
var DialogDescription =
|
|
1313
|
+
var DialogDescription = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1314
1314
|
DialogPrimitive.Description,
|
|
1315
1315
|
{
|
|
1316
1316
|
ref,
|
|
@@ -1423,7 +1423,7 @@ function CommandShortcut({ className, ...props }) {
|
|
|
1423
1423
|
var Popover = PopoverPrimitive.Root;
|
|
1424
1424
|
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
1425
1425
|
var PopoverPortal = ({ children }) => /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { container: getThemeProviderRoot(), children });
|
|
1426
|
-
var PopoverContent =
|
|
1426
|
+
var PopoverContent = React14.forwardRef(({ className, align = "center", sideOffset = 4, arrow = false, children, ...props }, ref) => /* @__PURE__ */ jsx(PopoverPortal, { children: /* @__PURE__ */ jsxs(
|
|
1427
1427
|
PopoverPrimitive.Content,
|
|
1428
1428
|
{
|
|
1429
1429
|
ref,
|
|
@@ -1733,7 +1733,7 @@ Drawer.displayName = "Drawer";
|
|
|
1733
1733
|
var DrawerTrigger = Drawer$1.Trigger;
|
|
1734
1734
|
var DrawerPortal = ({ children }) => /* @__PURE__ */ jsx(Drawer$1.Portal, { container: getThemeProviderRoot(), children });
|
|
1735
1735
|
var DrawerClose = Drawer$1.Close;
|
|
1736
|
-
var DrawerOverlay =
|
|
1736
|
+
var DrawerOverlay = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1737
1737
|
Drawer$1.Overlay,
|
|
1738
1738
|
{
|
|
1739
1739
|
ref,
|
|
@@ -1742,7 +1742,7 @@ var DrawerOverlay = React16.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
1742
1742
|
}
|
|
1743
1743
|
));
|
|
1744
1744
|
DrawerOverlay.displayName = Drawer$1.Overlay.displayName;
|
|
1745
|
-
var DrawerContent =
|
|
1745
|
+
var DrawerContent = React14.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(DrawerPortal, { children: [
|
|
1746
1746
|
/* @__PURE__ */ jsx(DrawerOverlay, {}),
|
|
1747
1747
|
/* @__PURE__ */ jsxs(
|
|
1748
1748
|
Drawer$1.Content,
|
|
@@ -1760,7 +1760,7 @@ var DrawerContent = React16.forwardRef(({ className, children, ...props }, ref)
|
|
|
1760
1760
|
DrawerContent.displayName = "DrawerContent";
|
|
1761
1761
|
var DrawerHeader = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn(styles21["drawer-header"], className), ...props });
|
|
1762
1762
|
DrawerHeader.displayName = "DrawerHeader";
|
|
1763
|
-
var DrawerHeaderActions =
|
|
1763
|
+
var DrawerHeaderActions = React14.forwardRef(({ className, rowSpan, style, ...props }, ref) => {
|
|
1764
1764
|
return /* @__PURE__ */ jsx(
|
|
1765
1765
|
"div",
|
|
1766
1766
|
{
|
|
@@ -1774,9 +1774,9 @@ var DrawerHeaderActions = React16.forwardRef(({ className, rowSpan, style, ...pr
|
|
|
1774
1774
|
DrawerHeaderActions.displayName = "DrawerHeaderActions";
|
|
1775
1775
|
var DrawerFooter = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn(styles21["drawer-footer"], className), ...props });
|
|
1776
1776
|
DrawerFooter.displayName = "DrawerFooter";
|
|
1777
|
-
var DrawerTitle =
|
|
1777
|
+
var DrawerTitle = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Drawer$1.Title, { ref, className: cn(styles21["drawer-title"], className), ...props }));
|
|
1778
1778
|
DrawerTitle.displayName = Drawer$1.Title.displayName;
|
|
1779
|
-
var DrawerDescription =
|
|
1779
|
+
var DrawerDescription = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1780
1780
|
Drawer$1.Description,
|
|
1781
1781
|
{
|
|
1782
1782
|
ref,
|
|
@@ -1790,30 +1790,173 @@ DrawerInnerContent.displayName = "DrawerInnerContent";
|
|
|
1790
1790
|
var CheckIcon2 = Check;
|
|
1791
1791
|
var ChevronRightIcon2 = ChevronRight;
|
|
1792
1792
|
var CircleIcon = Circle;
|
|
1793
|
-
var
|
|
1793
|
+
var SearchIcon2 = Search;
|
|
1794
|
+
var DropdownMenuSearchContext = React14.createContext(null);
|
|
1795
|
+
var useDropdownMenuSearch = () => React14.useContext(DropdownMenuSearchContext);
|
|
1796
|
+
var useIsSearching = () => {
|
|
1797
|
+
const ctx = useDropdownMenuSearch();
|
|
1798
|
+
return !!ctx && ctx.query.trim().length > 0;
|
|
1799
|
+
};
|
|
1800
|
+
var DropdownMenuBreadcrumbContext = React14.createContext([]);
|
|
1801
|
+
var useBreadcrumbAncestry = () => React14.useContext(DropdownMenuBreadcrumbContext);
|
|
1802
|
+
function getNodeText(node) {
|
|
1803
|
+
if (node == null || typeof node === "boolean") return "";
|
|
1804
|
+
if (typeof node === "string" || typeof node === "number") return String(node);
|
|
1805
|
+
if (Array.isArray(node)) return node.map(getNodeText).join("");
|
|
1806
|
+
if (React14.isValidElement(node)) {
|
|
1807
|
+
return getNodeText(node.props.children);
|
|
1808
|
+
}
|
|
1809
|
+
return "";
|
|
1810
|
+
}
|
|
1811
|
+
var SUB_CONTENT_NAME = "DropdownMenuSubContent";
|
|
1812
|
+
var SUB_TRIGGER_NAME = "DropdownMenuSubTrigger";
|
|
1813
|
+
function hasDisplayName(node, name) {
|
|
1814
|
+
return React14.isValidElement(node) && typeof node.type !== "string" && node.type.displayName === name;
|
|
1815
|
+
}
|
|
1816
|
+
var isSubContent = (node) => hasDisplayName(node, SUB_CONTENT_NAME);
|
|
1817
|
+
var isSubTrigger = (node) => hasDisplayName(node, SUB_TRIGGER_NAME);
|
|
1818
|
+
function findSubContentChildren(nodes) {
|
|
1819
|
+
let result = null;
|
|
1820
|
+
let done = false;
|
|
1821
|
+
const walk = (ns) => {
|
|
1822
|
+
React14.Children.forEach(ns, (child) => {
|
|
1823
|
+
if (done || !React14.isValidElement(child)) return;
|
|
1824
|
+
if (isSubContent(child)) {
|
|
1825
|
+
result = child.props.children ?? null;
|
|
1826
|
+
done = true;
|
|
1827
|
+
return;
|
|
1828
|
+
}
|
|
1829
|
+
const nested = child.props.children;
|
|
1830
|
+
if (nested != null) walk(nested);
|
|
1831
|
+
});
|
|
1832
|
+
};
|
|
1833
|
+
walk(nodes);
|
|
1834
|
+
return result;
|
|
1835
|
+
}
|
|
1836
|
+
function getSubTriggerLabel(nodes) {
|
|
1837
|
+
const trigger = React14.Children.toArray(nodes).find(isSubTrigger);
|
|
1838
|
+
return trigger ? getNodeText(trigger.props.children) : "";
|
|
1839
|
+
}
|
|
1840
|
+
function useFilterableItem(textValue, children) {
|
|
1841
|
+
const ctx = useDropdownMenuSearch();
|
|
1842
|
+
const id = React14.useId();
|
|
1843
|
+
const query = ctx?.query.trim().toLowerCase() ?? "";
|
|
1844
|
+
const visible = !query || (textValue ?? getNodeText(children)).toLowerCase().includes(query);
|
|
1845
|
+
const enabled = ctx?.enabled ?? false;
|
|
1846
|
+
const registerItem = ctx?.registerItem;
|
|
1847
|
+
const unregisterItem = ctx?.unregisterItem;
|
|
1848
|
+
React14.useEffect(() => {
|
|
1849
|
+
if (!enabled || !registerItem || !unregisterItem) return;
|
|
1850
|
+
registerItem(id, visible);
|
|
1851
|
+
return () => unregisterItem(id);
|
|
1852
|
+
}, [enabled, registerItem, unregisterItem, id, visible]);
|
|
1853
|
+
return visible;
|
|
1854
|
+
}
|
|
1855
|
+
var DropdownMenu = ({
|
|
1856
|
+
children,
|
|
1857
|
+
onOpenChange,
|
|
1858
|
+
...props
|
|
1859
|
+
}) => {
|
|
1860
|
+
const [enabled, setEnabled] = React14.useState(false);
|
|
1861
|
+
const [visible, setVisible] = React14.useState(false);
|
|
1862
|
+
const [query, setQuery] = React14.useState("");
|
|
1863
|
+
const [focusSignal, setFocusSignal] = React14.useState(0);
|
|
1864
|
+
const requestFocus = React14.useCallback(() => setFocusSignal((n) => n + 1), []);
|
|
1865
|
+
const [listId, setListId] = React14.useState(void 0);
|
|
1866
|
+
const itemsRef = React14.useRef(/* @__PURE__ */ new Map());
|
|
1867
|
+
const [matchCount, setMatchCount] = React14.useState(0);
|
|
1868
|
+
const recount = React14.useCallback(() => {
|
|
1869
|
+
let count2 = 0;
|
|
1870
|
+
itemsRef.current.forEach((matches) => {
|
|
1871
|
+
if (matches) count2 += 1;
|
|
1872
|
+
});
|
|
1873
|
+
setMatchCount(count2);
|
|
1874
|
+
}, []);
|
|
1875
|
+
const registerItem = React14.useCallback(
|
|
1876
|
+
(id, matches) => {
|
|
1877
|
+
itemsRef.current.set(id, matches);
|
|
1878
|
+
recount();
|
|
1879
|
+
},
|
|
1880
|
+
[recount]
|
|
1881
|
+
);
|
|
1882
|
+
const unregisterItem = React14.useCallback(
|
|
1883
|
+
(id) => {
|
|
1884
|
+
itemsRef.current.delete(id);
|
|
1885
|
+
recount();
|
|
1886
|
+
},
|
|
1887
|
+
[recount]
|
|
1888
|
+
);
|
|
1889
|
+
const reveal = React14.useCallback((seed) => {
|
|
1890
|
+
setVisible(true);
|
|
1891
|
+
setQuery(seed);
|
|
1892
|
+
}, []);
|
|
1893
|
+
const handleOpenChange = React14.useCallback(
|
|
1894
|
+
(open) => {
|
|
1895
|
+
if (open) {
|
|
1896
|
+
setVisible(false);
|
|
1897
|
+
setQuery("");
|
|
1898
|
+
}
|
|
1899
|
+
onOpenChange?.(open);
|
|
1900
|
+
},
|
|
1901
|
+
[onOpenChange]
|
|
1902
|
+
);
|
|
1903
|
+
const value = React14.useMemo(
|
|
1904
|
+
() => ({
|
|
1905
|
+
enabled,
|
|
1906
|
+
setEnabled,
|
|
1907
|
+
visible,
|
|
1908
|
+
reveal,
|
|
1909
|
+
query,
|
|
1910
|
+
setQuery,
|
|
1911
|
+
focusSignal,
|
|
1912
|
+
requestFocus,
|
|
1913
|
+
listId,
|
|
1914
|
+
setListId,
|
|
1915
|
+
registerItem,
|
|
1916
|
+
unregisterItem,
|
|
1917
|
+
matchCount
|
|
1918
|
+
}),
|
|
1919
|
+
[
|
|
1920
|
+
enabled,
|
|
1921
|
+
visible,
|
|
1922
|
+
reveal,
|
|
1923
|
+
query,
|
|
1924
|
+
focusSignal,
|
|
1925
|
+
requestFocus,
|
|
1926
|
+
listId,
|
|
1927
|
+
registerItem,
|
|
1928
|
+
unregisterItem,
|
|
1929
|
+
matchCount
|
|
1930
|
+
]
|
|
1931
|
+
);
|
|
1932
|
+
return /* @__PURE__ */ jsx(DropdownMenuSearchContext.Provider, { value, children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.Root, { onOpenChange: handleOpenChange, ...props, children }) });
|
|
1933
|
+
};
|
|
1794
1934
|
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
1795
1935
|
var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
1796
1936
|
var DropdownMenuPortal = ({ children }) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { container: getThemeProviderRoot(), children });
|
|
1797
|
-
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
1798
1937
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
1799
|
-
var DropdownMenuSubTrigger =
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
className
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
)
|
|
1938
|
+
var DropdownMenuSubTrigger = React14.forwardRef(({ className, inset, children, ...props }, ref) => {
|
|
1939
|
+
const searching = useIsSearching();
|
|
1940
|
+
if (searching) return null;
|
|
1941
|
+
return /* @__PURE__ */ jsxs(
|
|
1942
|
+
DropdownMenuPrimitive.SubTrigger,
|
|
1943
|
+
{
|
|
1944
|
+
ref,
|
|
1945
|
+
className: cn(
|
|
1946
|
+
styles22["dropdown-menu-trigger"],
|
|
1947
|
+
inset && styles22["dropdown-menu-inset"],
|
|
1948
|
+
className
|
|
1949
|
+
),
|
|
1950
|
+
...props,
|
|
1951
|
+
children: [
|
|
1952
|
+
children,
|
|
1953
|
+
/* @__PURE__ */ jsx(ChevronRightIcon2, { className: "ml-auto" })
|
|
1954
|
+
]
|
|
1955
|
+
}
|
|
1956
|
+
);
|
|
1957
|
+
});
|
|
1815
1958
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
1816
|
-
var DropdownMenuSubContent =
|
|
1959
|
+
var DropdownMenuSubContent = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1817
1960
|
DropdownMenuPrimitive.SubContent,
|
|
1818
1961
|
{
|
|
1819
1962
|
ref,
|
|
@@ -1821,75 +1964,275 @@ var DropdownMenuSubContent = React16.forwardRef(({ className, ...props }, ref) =
|
|
|
1821
1964
|
...props
|
|
1822
1965
|
}
|
|
1823
1966
|
));
|
|
1824
|
-
DropdownMenuSubContent.displayName =
|
|
1825
|
-
var
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1967
|
+
DropdownMenuSubContent.displayName = SUB_CONTENT_NAME;
|
|
1968
|
+
var DropdownMenuSub = ({
|
|
1969
|
+
children,
|
|
1970
|
+
...props
|
|
1971
|
+
}) => {
|
|
1972
|
+
const searching = useIsSearching();
|
|
1973
|
+
const parentAncestry = useBreadcrumbAncestry();
|
|
1974
|
+
if (searching) {
|
|
1975
|
+
const label = getSubTriggerLabel(children);
|
|
1976
|
+
const ancestry = label ? [...parentAncestry, label] : parentAncestry;
|
|
1977
|
+
return /* @__PURE__ */ jsx(DropdownMenuBreadcrumbContext.Provider, { value: ancestry, children: findSubContentChildren(children) });
|
|
1978
|
+
}
|
|
1979
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Sub, { ...props, children });
|
|
1980
|
+
};
|
|
1981
|
+
var MENU_ITEM_SELECTOR = '[role="menuitem"]:not([data-disabled]),[role="menuitemcheckbox"]:not([data-disabled]),[role="menuitemradio"]:not([data-disabled])';
|
|
1982
|
+
var DropdownMenuContent = React14.forwardRef(({ className, sideOffset = 4, onKeyDown, children, ...props }, ref) => {
|
|
1983
|
+
const ctx = useDropdownMenuSearch();
|
|
1984
|
+
const setListId = ctx?.setListId;
|
|
1985
|
+
const searching = !!ctx && ctx.query.trim().length > 0;
|
|
1986
|
+
const resultCount = ctx?.matchCount ?? 0;
|
|
1987
|
+
const composedContentRef = React14.useCallback(
|
|
1988
|
+
(node) => {
|
|
1989
|
+
assignRefs(node, ref);
|
|
1990
|
+
setListId?.(node?.id || void 0);
|
|
1991
|
+
},
|
|
1992
|
+
[ref, setListId]
|
|
1993
|
+
);
|
|
1994
|
+
return /* @__PURE__ */ jsx(DropdownMenuPortal, { children: /* @__PURE__ */ jsxs(
|
|
1995
|
+
DropdownMenuPrimitive.Content,
|
|
1996
|
+
{
|
|
1997
|
+
ref: composedContentRef,
|
|
1998
|
+
sideOffset,
|
|
1999
|
+
className: cn(styles22["dropdown-menu-content"], className),
|
|
2000
|
+
onKeyDown: (event) => {
|
|
2001
|
+
onKeyDown?.(event);
|
|
2002
|
+
if (!ctx?.enabled) return;
|
|
2003
|
+
if (event.key === "ArrowUp" && ctx.visible) {
|
|
2004
|
+
const itemTarget = event.target?.closest(
|
|
2005
|
+
MENU_ITEM_SELECTOR
|
|
2006
|
+
);
|
|
2007
|
+
const items = Array.from(
|
|
2008
|
+
event.currentTarget.querySelectorAll(MENU_ITEM_SELECTOR)
|
|
2009
|
+
);
|
|
2010
|
+
if (itemTarget && items[0] === itemTarget) {
|
|
2011
|
+
event.preventDefault();
|
|
2012
|
+
ctx.requestFocus();
|
|
2013
|
+
return;
|
|
2014
|
+
}
|
|
2015
|
+
}
|
|
2016
|
+
if (event.defaultPrevented) return;
|
|
2017
|
+
const isPrintable = event.key.length === 1 && !event.metaKey && !event.ctrlKey && !event.altKey && /\S/.test(event.key);
|
|
2018
|
+
if (!isPrintable) return;
|
|
2019
|
+
const target = event.target;
|
|
2020
|
+
if (target?.closest?.("[data-dropdown-search]")) return;
|
|
2021
|
+
event.preventDefault();
|
|
2022
|
+
if (!ctx.visible) {
|
|
2023
|
+
ctx.reveal(event.key);
|
|
2024
|
+
} else {
|
|
2025
|
+
ctx.setQuery(ctx.query + event.key);
|
|
2026
|
+
ctx.requestFocus();
|
|
2027
|
+
}
|
|
2028
|
+
},
|
|
2029
|
+
...props,
|
|
2030
|
+
children: [
|
|
2031
|
+
ctx?.enabled ? /* @__PURE__ */ jsx("div", { className: "sr-only", role: "status", "aria-live": "polite", children: searching && resultCount > 0 ? `${resultCount} result${resultCount === 1 ? "" : "s"} available` : null }) : null,
|
|
2032
|
+
children
|
|
2033
|
+
]
|
|
2034
|
+
}
|
|
2035
|
+
) });
|
|
2036
|
+
});
|
|
1834
2037
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
ref
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
2038
|
+
function assignRefs(node, ...refs) {
|
|
2039
|
+
refs.forEach((ref) => {
|
|
2040
|
+
if (typeof ref === "function") ref(node);
|
|
2041
|
+
else if (ref) ref.current = node;
|
|
2042
|
+
});
|
|
2043
|
+
}
|
|
2044
|
+
var DropdownMenuSearch = React14.forwardRef(
|
|
2045
|
+
({
|
|
2046
|
+
className,
|
|
2047
|
+
placeholder = "Search...",
|
|
2048
|
+
icon,
|
|
2049
|
+
/* Render the input immediately instead of revealing on first keypress */
|
|
2050
|
+
alwaysVisible = false,
|
|
2051
|
+
onKeyDown,
|
|
2052
|
+
/* Pulled out of props so the placeholder fallback below isn't overwritten by the spread */
|
|
2053
|
+
"aria-label": ariaLabel,
|
|
1845
2054
|
...props
|
|
2055
|
+
}, forwardedRef) => {
|
|
2056
|
+
const ctx = useDropdownMenuSearch();
|
|
2057
|
+
if (!ctx) {
|
|
2058
|
+
throw new Error("DropdownMenuSearch must be used within a DropdownMenu");
|
|
2059
|
+
}
|
|
2060
|
+
const { setEnabled, reveal, visible, focusSignal } = ctx;
|
|
2061
|
+
const inputRef = React14.useRef(null);
|
|
2062
|
+
React14.useEffect(() => {
|
|
2063
|
+
setEnabled(true);
|
|
2064
|
+
return () => setEnabled(false);
|
|
2065
|
+
}, [setEnabled]);
|
|
2066
|
+
React14.useEffect(() => {
|
|
2067
|
+
if (!visible) return;
|
|
2068
|
+
const el = inputRef.current;
|
|
2069
|
+
if (!el) return;
|
|
2070
|
+
el.focus();
|
|
2071
|
+
const end = el.value.length;
|
|
2072
|
+
el.setSelectionRange(end, end);
|
|
2073
|
+
}, [visible, focusSignal]);
|
|
2074
|
+
React14.useEffect(() => {
|
|
2075
|
+
if (alwaysVisible && !visible) reveal("");
|
|
2076
|
+
}, [alwaysVisible, visible, reveal]);
|
|
2077
|
+
if (!alwaysVisible && !visible) return null;
|
|
2078
|
+
return /* @__PURE__ */ jsxs("div", { className: styles22["dropdown-menu-search"], children: [
|
|
2079
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "flex shrink-0", children: icon ?? /* @__PURE__ */ jsx(SearchIcon2, { className: styles22["icon-size"] }) }),
|
|
2080
|
+
/* @__PURE__ */ jsx(
|
|
2081
|
+
"input",
|
|
2082
|
+
{
|
|
2083
|
+
ref: (node) => {
|
|
2084
|
+
assignRefs(node, inputRef, forwardedRef);
|
|
2085
|
+
},
|
|
2086
|
+
"data-dropdown-search": "",
|
|
2087
|
+
className: cn(styles22["dropdown-menu-search-input"], className),
|
|
2088
|
+
value: ctx.query,
|
|
2089
|
+
placeholder,
|
|
2090
|
+
"aria-label": ariaLabel ?? placeholder,
|
|
2091
|
+
role: "searchbox",
|
|
2092
|
+
"aria-controls": ctx.listId,
|
|
2093
|
+
"aria-autocomplete": "list",
|
|
2094
|
+
onChange: (event) => ctx.setQuery(event.target.value),
|
|
2095
|
+
onKeyDown: (event) => {
|
|
2096
|
+
onKeyDown?.(event);
|
|
2097
|
+
if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
2098
|
+
const menu = event.currentTarget.closest('[role="menu"]');
|
|
2099
|
+
const items = menu ? Array.from(menu.querySelectorAll(MENU_ITEM_SELECTOR)) : [];
|
|
2100
|
+
if (items.length) {
|
|
2101
|
+
event.preventDefault();
|
|
2102
|
+
(event.key === "ArrowUp" ? items[items.length - 1] : items[0]).focus();
|
|
2103
|
+
}
|
|
2104
|
+
return;
|
|
2105
|
+
}
|
|
2106
|
+
if (["Enter", "Escape", "Tab"].includes(event.key)) return;
|
|
2107
|
+
event.stopPropagation();
|
|
2108
|
+
},
|
|
2109
|
+
...props
|
|
2110
|
+
}
|
|
2111
|
+
)
|
|
2112
|
+
] });
|
|
1846
2113
|
}
|
|
1847
|
-
)
|
|
2114
|
+
);
|
|
2115
|
+
DropdownMenuSearch.displayName = "DropdownMenuSearch";
|
|
2116
|
+
var DropdownMenuEmpty = ({
|
|
2117
|
+
className,
|
|
2118
|
+
children,
|
|
2119
|
+
...props
|
|
2120
|
+
}) => {
|
|
2121
|
+
const ctx = useDropdownMenuSearch();
|
|
2122
|
+
if (!ctx) return null;
|
|
2123
|
+
const query = ctx.query.trim();
|
|
2124
|
+
const isEmpty = !!query && ctx.matchCount === 0;
|
|
2125
|
+
return /* @__PURE__ */ jsx(
|
|
2126
|
+
"div",
|
|
2127
|
+
{
|
|
2128
|
+
role: "status",
|
|
2129
|
+
"aria-live": "polite",
|
|
2130
|
+
className: isEmpty ? cn(styles22["dropdown-menu-empty"], className) : void 0,
|
|
2131
|
+
...props,
|
|
2132
|
+
children: isEmpty ? children : null
|
|
2133
|
+
}
|
|
2134
|
+
);
|
|
2135
|
+
};
|
|
2136
|
+
DropdownMenuEmpty.displayName = "DropdownMenuEmpty";
|
|
2137
|
+
var ItemBreadcrumb = () => {
|
|
2138
|
+
const ancestry = useBreadcrumbAncestry();
|
|
2139
|
+
if (!ancestry.length) return null;
|
|
2140
|
+
return /* @__PURE__ */ jsx("span", { className: styles22["dropdown-menu-breadcrumb"], "aria-hidden": "true", children: ancestry.map((crumb, index) => /* @__PURE__ */ jsxs(React14.Fragment, { children: [
|
|
2141
|
+
crumb,
|
|
2142
|
+
/* @__PURE__ */ jsx(ChevronRightIcon2, {})
|
|
2143
|
+
] }, index)) });
|
|
2144
|
+
};
|
|
2145
|
+
var DropdownMenuItem = React14.forwardRef(({ className, inset, variant = "neutral", textValue, children, ...props }, ref) => {
|
|
2146
|
+
const visible = useFilterableItem(textValue, children);
|
|
2147
|
+
if (!visible) return null;
|
|
2148
|
+
return /* @__PURE__ */ jsxs(
|
|
2149
|
+
DropdownMenuPrimitive.Item,
|
|
2150
|
+
{
|
|
2151
|
+
ref,
|
|
2152
|
+
textValue,
|
|
2153
|
+
className: cn(
|
|
2154
|
+
styles22["dropdown-menu-item"],
|
|
2155
|
+
inset && styles22["dropdown-menu-inset"],
|
|
2156
|
+
variant === "danger" && styles22["dropdown-menu-item-danger"],
|
|
2157
|
+
className
|
|
2158
|
+
),
|
|
2159
|
+
...props,
|
|
2160
|
+
children: [
|
|
2161
|
+
/* @__PURE__ */ jsx(ItemBreadcrumb, {}),
|
|
2162
|
+
children
|
|
2163
|
+
]
|
|
2164
|
+
}
|
|
2165
|
+
);
|
|
2166
|
+
});
|
|
1848
2167
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
1849
|
-
var DropdownMenuCheckboxItem =
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
))
|
|
2168
|
+
var DropdownMenuCheckboxItem = React14.forwardRef(({ className, children, checked, textValue, ...props }, ref) => {
|
|
2169
|
+
const visible = useFilterableItem(textValue, children);
|
|
2170
|
+
if (!visible) return null;
|
|
2171
|
+
return /* @__PURE__ */ jsxs(
|
|
2172
|
+
DropdownMenuPrimitive.CheckboxItem,
|
|
2173
|
+
{
|
|
2174
|
+
ref,
|
|
2175
|
+
textValue,
|
|
2176
|
+
className: cn(styles22["dropdown-menu-checkbox-item"], className),
|
|
2177
|
+
checked,
|
|
2178
|
+
...props,
|
|
2179
|
+
children: [
|
|
2180
|
+
/* @__PURE__ */ jsx("span", { className: styles22["dropdown-menu-item-indicator-checkbox"], children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon2, { className: styles22["icon-size"] }) }) }),
|
|
2181
|
+
/* @__PURE__ */ jsx(ItemBreadcrumb, {}),
|
|
2182
|
+
children
|
|
2183
|
+
]
|
|
2184
|
+
}
|
|
2185
|
+
);
|
|
2186
|
+
});
|
|
1862
2187
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
1863
|
-
var DropdownMenuRadioItem =
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
))
|
|
2188
|
+
var DropdownMenuRadioItem = React14.forwardRef(({ className, children, textValue, ...props }, ref) => {
|
|
2189
|
+
const visible = useFilterableItem(textValue, children);
|
|
2190
|
+
if (!visible) return null;
|
|
2191
|
+
return /* @__PURE__ */ jsxs(
|
|
2192
|
+
DropdownMenuPrimitive.RadioItem,
|
|
2193
|
+
{
|
|
2194
|
+
ref,
|
|
2195
|
+
textValue,
|
|
2196
|
+
className: cn(styles22["dropdown-menu-radio-item"], className),
|
|
2197
|
+
...props,
|
|
2198
|
+
children: [
|
|
2199
|
+
/* @__PURE__ */ jsx("span", { className: styles22["dropdown-menu-item-indicator-radio"], children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CircleIcon, { className: styles22["radio-icon"] }) }) }),
|
|
2200
|
+
/* @__PURE__ */ jsx(ItemBreadcrumb, {}),
|
|
2201
|
+
children
|
|
2202
|
+
]
|
|
2203
|
+
}
|
|
2204
|
+
);
|
|
2205
|
+
});
|
|
1875
2206
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
1876
|
-
var DropdownMenuLabel =
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
2207
|
+
var DropdownMenuLabel = React14.forwardRef(({ className, inset, ...props }, ref) => {
|
|
2208
|
+
const searching = useIsSearching();
|
|
2209
|
+
if (searching) return null;
|
|
2210
|
+
return /* @__PURE__ */ jsx(
|
|
2211
|
+
DropdownMenuPrimitive.Label,
|
|
2212
|
+
{
|
|
2213
|
+
ref,
|
|
2214
|
+
className: cn(
|
|
2215
|
+
styles22["dropdown-menu-label"],
|
|
2216
|
+
inset && styles22["dropdown-menu-inset"],
|
|
2217
|
+
className
|
|
2218
|
+
),
|
|
2219
|
+
...props
|
|
2220
|
+
}
|
|
2221
|
+
);
|
|
2222
|
+
});
|
|
1884
2223
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
1885
|
-
var DropdownMenuSeparator =
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
)
|
|
2224
|
+
var DropdownMenuSeparator = React14.forwardRef(({ className, ...props }, ref) => {
|
|
2225
|
+
const searching = useIsSearching();
|
|
2226
|
+
if (searching) return null;
|
|
2227
|
+
return /* @__PURE__ */ jsx(
|
|
2228
|
+
DropdownMenuPrimitive.Separator,
|
|
2229
|
+
{
|
|
2230
|
+
ref,
|
|
2231
|
+
className: cn(styles22["dropdown-menu-separator"], className),
|
|
2232
|
+
...props
|
|
2233
|
+
}
|
|
2234
|
+
);
|
|
2235
|
+
});
|
|
1893
2236
|
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
1894
2237
|
var DropdownMenuShortcut = ({ className, ...props }) => {
|
|
1895
2238
|
return /* @__PURE__ */ jsx("span", { className: cn(styles22["dropdown-menu-shortcut"], className), ...props });
|
|
@@ -1923,7 +2266,10 @@ var FilterDropdown = ({
|
|
|
1923
2266
|
onClearAll,
|
|
1924
2267
|
buttonClassName,
|
|
1925
2268
|
contentClassName,
|
|
1926
|
-
disabled = false
|
|
2269
|
+
disabled = false,
|
|
2270
|
+
searchable = false,
|
|
2271
|
+
searchPlaceholder = "Search filters...",
|
|
2272
|
+
emptyPlaceholder = "No filters found"
|
|
1927
2273
|
}) => {
|
|
1928
2274
|
const hasSelectedFilters = selectedFilters.length > 0;
|
|
1929
2275
|
const filteredOptions = options.filter(
|
|
@@ -1951,6 +2297,10 @@ var FilterDropdown = ({
|
|
|
1951
2297
|
align: "end",
|
|
1952
2298
|
className: cn(styles24["dropdown-menu-content"], contentClassName),
|
|
1953
2299
|
children: [
|
|
2300
|
+
searchable && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2301
|
+
/* @__PURE__ */ jsx(DropdownMenuSearch, { placeholder: searchPlaceholder }),
|
|
2302
|
+
/* @__PURE__ */ jsx(DropdownMenuEmpty, { children: emptyPlaceholder })
|
|
2303
|
+
] }),
|
|
1954
2304
|
/* @__PURE__ */ jsxs(DropdownMenuLabel, { children: [
|
|
1955
2305
|
"Filters",
|
|
1956
2306
|
hasSelectedFilters && /* @__PURE__ */ jsx(Button, { variant: "link", size: "sm", onClick: onClearAll, children: "Clear all" })
|
|
@@ -1975,18 +2325,18 @@ var FilterDropdown = ({
|
|
|
1975
2325
|
] });
|
|
1976
2326
|
};
|
|
1977
2327
|
var labelVariants = cva(styles25["label"]);
|
|
1978
|
-
var Label2 =
|
|
2328
|
+
var Label2 = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(LabelPrimitive.Root, { ref, className: cn(labelVariants(), className), ...props }));
|
|
1979
2329
|
Label2.displayName = LabelPrimitive.Root.displayName;
|
|
1980
2330
|
var Form = FormProvider;
|
|
1981
|
-
var FormFieldContext =
|
|
2331
|
+
var FormFieldContext = React14.createContext({});
|
|
1982
2332
|
var FormField = ({
|
|
1983
2333
|
...props
|
|
1984
2334
|
}) => {
|
|
1985
2335
|
return /* @__PURE__ */ jsx(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsx(Controller, { ...props }) });
|
|
1986
2336
|
};
|
|
1987
2337
|
var useFormField = () => {
|
|
1988
|
-
const fieldContext =
|
|
1989
|
-
const itemContext =
|
|
2338
|
+
const fieldContext = React14.useContext(FormFieldContext);
|
|
2339
|
+
const itemContext = React14.useContext(FormItemContext);
|
|
1990
2340
|
const { getFieldState, formState } = useFormContext();
|
|
1991
2341
|
const fieldState = getFieldState(fieldContext.name, formState);
|
|
1992
2342
|
if (!fieldContext) {
|
|
@@ -2002,15 +2352,15 @@ var useFormField = () => {
|
|
|
2002
2352
|
...fieldState
|
|
2003
2353
|
};
|
|
2004
2354
|
};
|
|
2005
|
-
var FormItemContext =
|
|
2006
|
-
var FormItem =
|
|
2355
|
+
var FormItemContext = React14.createContext({});
|
|
2356
|
+
var FormItem = React14.forwardRef(
|
|
2007
2357
|
({ className, ...props }, ref) => {
|
|
2008
|
-
const id =
|
|
2358
|
+
const id = React14.useId();
|
|
2009
2359
|
return /* @__PURE__ */ jsx(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsx("div", { ref, className: cn(styles26["form-item"], className), ...props }) });
|
|
2010
2360
|
}
|
|
2011
2361
|
);
|
|
2012
2362
|
FormItem.displayName = "FormItem";
|
|
2013
|
-
var FormLabel =
|
|
2363
|
+
var FormLabel = React14.forwardRef(({ className, ...props }, ref) => {
|
|
2014
2364
|
const { error, formItemId } = useFormField();
|
|
2015
2365
|
return /* @__PURE__ */ jsx(
|
|
2016
2366
|
Label2,
|
|
@@ -2023,7 +2373,7 @@ var FormLabel = React16.forwardRef(({ className, ...props }, ref) => {
|
|
|
2023
2373
|
);
|
|
2024
2374
|
});
|
|
2025
2375
|
FormLabel.displayName = "FormLabel";
|
|
2026
|
-
var FormControl =
|
|
2376
|
+
var FormControl = React14.forwardRef(({ ...props }, ref) => {
|
|
2027
2377
|
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
2028
2378
|
return /* @__PURE__ */ jsx(
|
|
2029
2379
|
Slot,
|
|
@@ -2037,7 +2387,7 @@ var FormControl = React16.forwardRef(({ ...props }, ref) => {
|
|
|
2037
2387
|
);
|
|
2038
2388
|
});
|
|
2039
2389
|
FormControl.displayName = "FormControl";
|
|
2040
|
-
var FormDescription =
|
|
2390
|
+
var FormDescription = React14.forwardRef(({ className, ...props }, ref) => {
|
|
2041
2391
|
const { formDescriptionId } = useFormField();
|
|
2042
2392
|
return /* @__PURE__ */ jsx(
|
|
2043
2393
|
"p",
|
|
@@ -2050,7 +2400,7 @@ var FormDescription = React16.forwardRef(({ className, ...props }, ref) => {
|
|
|
2050
2400
|
);
|
|
2051
2401
|
});
|
|
2052
2402
|
FormDescription.displayName = "FormDescription";
|
|
2053
|
-
var FormMessage =
|
|
2403
|
+
var FormMessage = React14.forwardRef(({ className, children, ...props }, ref) => {
|
|
2054
2404
|
const { error, formMessageId } = useFormField();
|
|
2055
2405
|
const body = error ? String(error?.message ?? "") : children;
|
|
2056
2406
|
if (!body) {
|
|
@@ -2084,7 +2434,7 @@ var InfoCard = ({
|
|
|
2084
2434
|
] })
|
|
2085
2435
|
] }) }) });
|
|
2086
2436
|
};
|
|
2087
|
-
var Input =
|
|
2437
|
+
var Input = React14.forwardRef(
|
|
2088
2438
|
({ className, type, prefix, suffix, ...props }, ref) => {
|
|
2089
2439
|
return /* @__PURE__ */ jsxs("div", { className: cn(styles28["input-wrapper"], className), children: [
|
|
2090
2440
|
prefix && /* @__PURE__ */ jsx("span", { className: styles28["input-prefix"], children: prefix }),
|
|
@@ -2260,12 +2610,12 @@ var ChevronUpIcon = ChevronUp;
|
|
|
2260
2610
|
var Select = SelectPrimitive.Root;
|
|
2261
2611
|
var SelectGroup = SelectPrimitive.Group;
|
|
2262
2612
|
var SelectValue = SelectPrimitive.Value;
|
|
2263
|
-
var SelectTrigger =
|
|
2613
|
+
var SelectTrigger = React14.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(SelectPrimitive.Trigger, { ref, className: cn(styles35["select-trigger"], className), ...props, children: [
|
|
2264
2614
|
children,
|
|
2265
2615
|
/* @__PURE__ */ jsx(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx(ChevronDownIcon2, { className: cn(styles35["select-icon"], styles35["select-icon--low-opacity"]) }) })
|
|
2266
2616
|
] }));
|
|
2267
2617
|
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
2268
|
-
var SelectScrollUpButton =
|
|
2618
|
+
var SelectScrollUpButton = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2269
2619
|
SelectPrimitive.ScrollUpButton,
|
|
2270
2620
|
{
|
|
2271
2621
|
ref,
|
|
@@ -2275,7 +2625,7 @@ var SelectScrollUpButton = React16.forwardRef(({ className, ...props }, ref) =>
|
|
|
2275
2625
|
}
|
|
2276
2626
|
));
|
|
2277
2627
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
2278
|
-
var SelectScrollDownButton =
|
|
2628
|
+
var SelectScrollDownButton = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2279
2629
|
SelectPrimitive.ScrollDownButton,
|
|
2280
2630
|
{
|
|
2281
2631
|
ref,
|
|
@@ -2291,7 +2641,7 @@ var selectContentElevationVariants = generateElevationVariants(
|
|
|
2291
2641
|
"select-content",
|
|
2292
2642
|
ELEVATION.OVERLAY
|
|
2293
2643
|
);
|
|
2294
|
-
var SelectContent =
|
|
2644
|
+
var SelectContent = React14.forwardRef(({ className, children, position = "popper", elevation = ELEVATION.OVERLAY, ...props }, ref) => /* @__PURE__ */ jsx(SelectPortal, { children: /* @__PURE__ */ jsxs(
|
|
2295
2645
|
SelectPrimitive.Content,
|
|
2296
2646
|
{
|
|
2297
2647
|
ref,
|
|
@@ -2320,14 +2670,14 @@ var SelectContent = React16.forwardRef(({ className, children, position = "poppe
|
|
|
2320
2670
|
}
|
|
2321
2671
|
) }));
|
|
2322
2672
|
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
2323
|
-
var SelectLabel =
|
|
2673
|
+
var SelectLabel = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.Label, { ref, className: cn(styles35["select-label"], className), ...props }));
|
|
2324
2674
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
2325
|
-
var SelectItem =
|
|
2675
|
+
var SelectItem = React14.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(SelectPrimitive.Item, { ref, className: cn(styles35["select-item"], className), ...props, children: [
|
|
2326
2676
|
/* @__PURE__ */ jsx("span", { className: styles35["select-item-indicator"], children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon3, { className: styles35["select-icon"] }) }) }),
|
|
2327
2677
|
/* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })
|
|
2328
2678
|
] }));
|
|
2329
2679
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
2330
|
-
var SelectSeparator =
|
|
2680
|
+
var SelectSeparator = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2331
2681
|
SelectPrimitive.Separator,
|
|
2332
2682
|
{
|
|
2333
2683
|
ref,
|
|
@@ -2470,7 +2820,7 @@ var Pagination = ({
|
|
|
2470
2820
|
var PanelLabel = ({ className, label }) => {
|
|
2471
2821
|
return /* @__PURE__ */ jsx("div", { className: cn(styles37["panel-label"], className), children: label });
|
|
2472
2822
|
};
|
|
2473
|
-
var Progress =
|
|
2823
|
+
var Progress = React14.forwardRef(
|
|
2474
2824
|
({ className, value, color = "primary", ...props }, ref) => /* @__PURE__ */ jsx(ProgressPrimitive.Root, { ref, className: cn(styles38["progress"], className), ...props, children: /* @__PURE__ */ jsx(
|
|
2475
2825
|
ProgressPrimitive.Indicator,
|
|
2476
2826
|
{
|
|
@@ -2536,24 +2886,24 @@ function ProgressIndicator({
|
|
|
2536
2886
|
"aria-label": ariaLabel = "Progress",
|
|
2537
2887
|
...props
|
|
2538
2888
|
}) {
|
|
2539
|
-
const stepChildren =
|
|
2889
|
+
const stepChildren = React14.Children.toArray(children);
|
|
2540
2890
|
const stepCount = stepChildren.length;
|
|
2541
2891
|
const hasActive = currentIndex >= 0 && currentIndex < stepCount;
|
|
2542
2892
|
const segmentSize = stepCount > 0 ? 100 / stepCount : 0;
|
|
2543
2893
|
const isLastStep = currentIndex === stepCount - 1;
|
|
2544
2894
|
const fillSize = hasActive ? isLastStep ? 100 : (currentIndex + 0.5) * segmentSize : 0;
|
|
2545
2895
|
const steps = stepChildren.map((child, index) => {
|
|
2546
|
-
if (!
|
|
2896
|
+
if (!React14.isValidElement(child) || child.type !== ProgressIndicatorStep) {
|
|
2547
2897
|
throw new Error("ProgressIndicator only accepts <ProgressIndicatorStep> children.");
|
|
2548
2898
|
}
|
|
2549
|
-
return
|
|
2899
|
+
return React14.cloneElement(child, {
|
|
2550
2900
|
index,
|
|
2551
2901
|
currentIndex,
|
|
2552
2902
|
elevation
|
|
2553
2903
|
});
|
|
2554
2904
|
});
|
|
2555
2905
|
const interactive = stepChildren.some((child) => {
|
|
2556
|
-
if (!
|
|
2906
|
+
if (!React14.isValidElement(child)) return false;
|
|
2557
2907
|
const stepProps = child.props;
|
|
2558
2908
|
return Boolean(stepProps.href || stepProps.onClick);
|
|
2559
2909
|
});
|
|
@@ -2721,7 +3071,10 @@ var RadioDropdown = ({
|
|
|
2721
3071
|
options,
|
|
2722
3072
|
selectedValue,
|
|
2723
3073
|
onSelect,
|
|
2724
|
-
className
|
|
3074
|
+
className,
|
|
3075
|
+
searchable = false,
|
|
3076
|
+
searchPlaceholder = "Search options...",
|
|
3077
|
+
emptyPlaceholder = "No options found"
|
|
2725
3078
|
}) => {
|
|
2726
3079
|
const selectedOption = options.find((opt) => opt.value === selectedValue);
|
|
2727
3080
|
const hasSelectedCount = selectedOption?.count !== void 0;
|
|
@@ -2737,6 +3090,10 @@ var RadioDropdown = ({
|
|
|
2737
3090
|
/* @__PURE__ */ jsx(ChevronDownIcon3, { className: styles41["chevron-icon"] })
|
|
2738
3091
|
] }) }),
|
|
2739
3092
|
/* @__PURE__ */ jsxs(DropdownMenuContent, { align: "end", className: styles41["dropdown-menu-content"], children: [
|
|
3093
|
+
searchable && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3094
|
+
/* @__PURE__ */ jsx(DropdownMenuSearch, { placeholder: searchPlaceholder }),
|
|
3095
|
+
/* @__PURE__ */ jsx(DropdownMenuEmpty, { children: emptyPlaceholder })
|
|
3096
|
+
] }),
|
|
2740
3097
|
/* @__PURE__ */ jsx(DropdownMenuLabel, { children: label }),
|
|
2741
3098
|
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
2742
3099
|
/* @__PURE__ */ jsx(DropdownMenuRadioGroup, { value: selectedValue, onValueChange: onSelect, children: filteredOptions.map((option) => {
|
|
@@ -2750,7 +3107,7 @@ var RadioDropdown = ({
|
|
|
2750
3107
|
] });
|
|
2751
3108
|
};
|
|
2752
3109
|
var CircleIcon2 = Circle;
|
|
2753
|
-
var RadioGroup2 =
|
|
3110
|
+
var RadioGroup2 = React14.forwardRef(({ className, ...props }, ref) => {
|
|
2754
3111
|
return /* @__PURE__ */ jsx(
|
|
2755
3112
|
RadioGroupPrimitive.Root,
|
|
2756
3113
|
{
|
|
@@ -2761,7 +3118,7 @@ var RadioGroup2 = React16.forwardRef(({ className, ...props }, ref) => {
|
|
|
2761
3118
|
);
|
|
2762
3119
|
});
|
|
2763
3120
|
RadioGroup2.displayName = RadioGroupPrimitive.Root.displayName;
|
|
2764
|
-
var RadioGroupItem =
|
|
3121
|
+
var RadioGroupItem = React14.forwardRef(({ className, ...props }, ref) => {
|
|
2765
3122
|
return /* @__PURE__ */ jsx(
|
|
2766
3123
|
RadioGroupPrimitive.Item,
|
|
2767
3124
|
{
|
|
@@ -2773,13 +3130,13 @@ var RadioGroupItem = React16.forwardRef(({ className, ...props }, ref) => {
|
|
|
2773
3130
|
);
|
|
2774
3131
|
});
|
|
2775
3132
|
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
2776
|
-
var ScrollArea =
|
|
3133
|
+
var ScrollArea = React14.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(ScrollAreaPrimitive.Root, { ref, className: cn(styles43["scroll-area"], className), ...props, children: [
|
|
2777
3134
|
/* @__PURE__ */ jsx(ScrollAreaPrimitive.Viewport, { className: styles43["scroll-area-viewport"], children }),
|
|
2778
3135
|
/* @__PURE__ */ jsx(ScrollBar, {}),
|
|
2779
3136
|
/* @__PURE__ */ jsx(ScrollAreaPrimitive.Corner, {})
|
|
2780
3137
|
] }));
|
|
2781
3138
|
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
2782
|
-
var ScrollBar =
|
|
3139
|
+
var ScrollBar = React14.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2783
3140
|
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
|
2784
3141
|
{
|
|
2785
3142
|
ref,
|
|
@@ -2795,7 +3152,7 @@ var ScrollBar = React16.forwardRef(({ className, orientation = "vertical", ...pr
|
|
|
2795
3152
|
}
|
|
2796
3153
|
));
|
|
2797
3154
|
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
2798
|
-
var
|
|
3155
|
+
var SearchIcon3 = Search;
|
|
2799
3156
|
var SearchBar = ({
|
|
2800
3157
|
searchQuery,
|
|
2801
3158
|
setSearchQuery,
|
|
@@ -2815,7 +3172,7 @@ var SearchBar = ({
|
|
|
2815
3172
|
value: searchQuery,
|
|
2816
3173
|
onChange: handleChange,
|
|
2817
3174
|
className: styles44["input"],
|
|
2818
|
-
prefix: /* @__PURE__ */ jsx(
|
|
3175
|
+
prefix: /* @__PURE__ */ jsx(SearchIcon3, { className: styles44["search-icon"] }),
|
|
2819
3176
|
suffix: searchQuery && /* @__PURE__ */ jsx(
|
|
2820
3177
|
IconButton,
|
|
2821
3178
|
{
|
|
@@ -2914,7 +3271,7 @@ var SegmentedControls = ({
|
|
|
2914
3271
|
)
|
|
2915
3272
|
] });
|
|
2916
3273
|
};
|
|
2917
|
-
var Separator3 =
|
|
3274
|
+
var Separator3 = React14.forwardRef(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2918
3275
|
SeparatorPrimitive.Root,
|
|
2919
3276
|
{
|
|
2920
3277
|
ref,
|
|
@@ -2933,7 +3290,7 @@ var Sheet = DialogPrimitive.Root;
|
|
|
2933
3290
|
var SheetTrigger = DialogPrimitive.Trigger;
|
|
2934
3291
|
var SheetClose = DialogPrimitive.Close;
|
|
2935
3292
|
var SheetPortal = ({ children }) => /* @__PURE__ */ jsx(DialogPrimitive.Portal, { container: getThemeProviderRoot(), children });
|
|
2936
|
-
var SheetOverlay =
|
|
3293
|
+
var SheetOverlay = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(DialogPrimitive.Overlay, { className: cn(styles48["sheet-overlay"], className), ...props, ref }));
|
|
2937
3294
|
SheetOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
2938
3295
|
var sheetVariants = cva(styles48["sheet-content"], {
|
|
2939
3296
|
variants: {
|
|
@@ -2948,7 +3305,7 @@ var sheetVariants = cva(styles48["sheet-content"], {
|
|
|
2948
3305
|
side: "right"
|
|
2949
3306
|
}
|
|
2950
3307
|
});
|
|
2951
|
-
var SheetContainer =
|
|
3308
|
+
var SheetContainer = React14.forwardRef(({ side = "right", className, children, ...props }, ref) => /* @__PURE__ */ jsxs(SheetPortal, { children: [
|
|
2952
3309
|
/* @__PURE__ */ jsx(SheetOverlay, {}),
|
|
2953
3310
|
/* @__PURE__ */ jsx(DialogPrimitive.Content, { ref, className: cn(sheetVariants({ side }), className), ...props, children })
|
|
2954
3311
|
] }));
|
|
@@ -2956,12 +3313,12 @@ SheetContainer.displayName = DialogPrimitive.Content.displayName;
|
|
|
2956
3313
|
var SheetHeaderIcon = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn(styles48["sheet-header-icon"], className), ...props });
|
|
2957
3314
|
SheetHeaderIcon.displayName = "SheetHeaderIcon";
|
|
2958
3315
|
var SheetHeader = ({ className, children, ...props }) => {
|
|
2959
|
-
const childrenArray =
|
|
3316
|
+
const childrenArray = React14.Children.toArray(children);
|
|
2960
3317
|
const icon = childrenArray.find(
|
|
2961
|
-
(child) =>
|
|
3318
|
+
(child) => React14.isValidElement(child) && child.type === SheetHeaderIcon
|
|
2962
3319
|
);
|
|
2963
3320
|
const otherChildren = childrenArray.filter(
|
|
2964
|
-
(child) => !(
|
|
3321
|
+
(child) => !(React14.isValidElement(child) && child.type === SheetHeaderIcon)
|
|
2965
3322
|
);
|
|
2966
3323
|
return /* @__PURE__ */ jsxs("div", { className: cn(styles48["sheet-header"], className), ...props, children: [
|
|
2967
3324
|
icon,
|
|
@@ -2972,9 +3329,9 @@ var SheetHeader = ({ className, children, ...props }) => {
|
|
|
2972
3329
|
SheetHeader.displayName = "SheetHeader";
|
|
2973
3330
|
var SheetFooter = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn(styles48["sheet-footer"], className), ...props });
|
|
2974
3331
|
SheetFooter.displayName = "SheetFooter";
|
|
2975
|
-
var SheetTitle =
|
|
3332
|
+
var SheetTitle = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(DialogPrimitive.Title, { ref, className: cn(styles48["sheet-title"], className), ...props }));
|
|
2976
3333
|
SheetTitle.displayName = DialogPrimitive.Title.displayName;
|
|
2977
|
-
var SheetDescription =
|
|
3334
|
+
var SheetDescription = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2978
3335
|
DialogPrimitive.Description,
|
|
2979
3336
|
{
|
|
2980
3337
|
ref,
|
|
@@ -3059,7 +3416,7 @@ function SortSelector({
|
|
|
3059
3416
|
)
|
|
3060
3417
|
] });
|
|
3061
3418
|
}
|
|
3062
|
-
var Switch =
|
|
3419
|
+
var Switch = React14.forwardRef(
|
|
3063
3420
|
({ className, size = "md", variant = "default", thumbIcon, ...props }, ref) => {
|
|
3064
3421
|
const iconSize = size === "sm" ? "xs" : size === "md" ? "sm" : "md";
|
|
3065
3422
|
return /* @__PURE__ */ jsx(
|
|
@@ -3097,7 +3454,7 @@ function SortButton({
|
|
|
3097
3454
|
] });
|
|
3098
3455
|
}
|
|
3099
3456
|
var tableElevationVariants = generateElevationVariants(styles53, "table", ELEVATION.RAISED);
|
|
3100
|
-
var TableContainer =
|
|
3457
|
+
var TableContainer = React14.forwardRef(({ className, style, elevation = ELEVATION.RAISED, border, columns, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3101
3458
|
"div",
|
|
3102
3459
|
{
|
|
3103
3460
|
className: cn(
|
|
@@ -3111,7 +3468,7 @@ var TableContainer = React16.forwardRef(({ className, style, elevation = ELEVATI
|
|
|
3111
3468
|
}
|
|
3112
3469
|
));
|
|
3113
3470
|
TableContainer.displayName = "Table";
|
|
3114
|
-
var TableHeader =
|
|
3471
|
+
var TableHeader = React14.forwardRef(({ className, sticky = false, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3115
3472
|
"thead",
|
|
3116
3473
|
{
|
|
3117
3474
|
ref,
|
|
@@ -3125,11 +3482,11 @@ var TableHeader = React16.forwardRef(({ className, sticky = false, ...props }, r
|
|
|
3125
3482
|
}
|
|
3126
3483
|
));
|
|
3127
3484
|
TableHeader.displayName = "TableHeader";
|
|
3128
|
-
var TableBody =
|
|
3485
|
+
var TableBody = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("tbody", { ref, className: cn(styles53["table-body"], className), ...props }));
|
|
3129
3486
|
TableBody.displayName = "TableBody";
|
|
3130
|
-
var TableFooter =
|
|
3487
|
+
var TableFooter = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("tfoot", { ref, className: cn(styles53["table-footer"], className), ...props }));
|
|
3131
3488
|
TableFooter.displayName = "TableFooter";
|
|
3132
|
-
var TableRow =
|
|
3489
|
+
var TableRow = React14.forwardRef(
|
|
3133
3490
|
({ className, clickable, href, hrefLabel = "View details", children, onClick, ...props }, ref) => {
|
|
3134
3491
|
const isClickable = clickable || !!href;
|
|
3135
3492
|
const handleClick = (e) => {
|
|
@@ -3160,18 +3517,18 @@ var TableRow = React16.forwardRef(
|
|
|
3160
3517
|
}
|
|
3161
3518
|
);
|
|
3162
3519
|
TableRow.displayName = "TableRow";
|
|
3163
|
-
var TableHead =
|
|
3520
|
+
var TableHead = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("th", { ref, className: cn(styles53["table-head"], className), ...props }));
|
|
3164
3521
|
TableHead.displayName = "TableHead";
|
|
3165
|
-
var TableCell =
|
|
3522
|
+
var TableCell = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("td", { ref, className: cn(styles53["table-cell"], className), ...props }));
|
|
3166
3523
|
TableCell.displayName = "TableCell";
|
|
3167
|
-
var TableCaption =
|
|
3524
|
+
var TableCaption = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("caption", { ref, className: cn(styles53["table-caption"], className), ...props }));
|
|
3168
3525
|
TableCaption.displayName = "TableCaption";
|
|
3169
3526
|
var TabsContainer = TabsPrimitive.Root;
|
|
3170
|
-
var TabsList =
|
|
3527
|
+
var TabsList = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(TabsPrimitive.List, { ref, className: cn(styles54["tabs-list"], className), ...props }));
|
|
3171
3528
|
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
3172
|
-
var TabsTrigger =
|
|
3529
|
+
var TabsTrigger = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(TabsPrimitive.Trigger, { ref, className: cn(styles54["tabs-trigger"], className), ...props }));
|
|
3173
3530
|
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
3174
|
-
var TabsContent =
|
|
3531
|
+
var TabsContent = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(TabsPrimitive.Content, { ref, className: cn(styles54["tabs-content"], className), ...props }));
|
|
3175
3532
|
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
3176
3533
|
var Tabs = ({
|
|
3177
3534
|
id,
|
|
@@ -3250,7 +3607,7 @@ var Tabs = ({
|
|
|
3250
3607
|
}
|
|
3251
3608
|
);
|
|
3252
3609
|
};
|
|
3253
|
-
var Textarea =
|
|
3610
|
+
var Textarea = React14.forwardRef(
|
|
3254
3611
|
({ className, ...props }, ref) => {
|
|
3255
3612
|
return /* @__PURE__ */ jsx("textarea", { className: cn(styles56["textarea"], className), ref, ...props });
|
|
3256
3613
|
}
|
|
@@ -3312,12 +3669,12 @@ function FormatDate({
|
|
|
3312
3669
|
...props
|
|
3313
3670
|
}) {
|
|
3314
3671
|
const missing = isMissing(date);
|
|
3315
|
-
const parsed =
|
|
3316
|
-
const [now, setNow] =
|
|
3317
|
-
const [mounted, setMounted] =
|
|
3672
|
+
const parsed = React14.useMemo(() => isMissing(date) ? null : toDate(date), [date]);
|
|
3673
|
+
const [now, setNow] = React14.useState(() => /* @__PURE__ */ new Date());
|
|
3674
|
+
const [mounted, setMounted] = React14.useState(false);
|
|
3318
3675
|
const isRelative = displayAs === "relative";
|
|
3319
|
-
|
|
3320
|
-
|
|
3676
|
+
React14.useEffect(() => setMounted(true), []);
|
|
3677
|
+
React14.useEffect(() => {
|
|
3321
3678
|
if (!isRelative || !live) return;
|
|
3322
3679
|
const id = setInterval(() => setNow(/* @__PURE__ */ new Date()), LIVE_INTERVAL_MS);
|
|
3323
3680
|
return () => clearInterval(id);
|
|
@@ -3358,7 +3715,7 @@ function FormatDate({
|
|
|
3358
3715
|
}
|
|
3359
3716
|
var XIcon2 = X;
|
|
3360
3717
|
var ToastProvider = ToastPrimitives.Provider;
|
|
3361
|
-
var ToastViewport =
|
|
3718
|
+
var ToastViewport = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3362
3719
|
ToastPrimitives.Viewport,
|
|
3363
3720
|
{
|
|
3364
3721
|
ref,
|
|
@@ -3380,7 +3737,7 @@ var toastVariants = cva(styles58["toast"], {
|
|
|
3380
3737
|
variant: "default"
|
|
3381
3738
|
}
|
|
3382
3739
|
});
|
|
3383
|
-
var ToastContainer =
|
|
3740
|
+
var ToastContainer = React14.forwardRef(({ className, variant, ...props }, ref) => {
|
|
3384
3741
|
return /* @__PURE__ */ jsx(
|
|
3385
3742
|
ToastPrimitives.Root,
|
|
3386
3743
|
{
|
|
@@ -3391,13 +3748,13 @@ var ToastContainer = React16.forwardRef(({ className, variant, ...props }, ref)
|
|
|
3391
3748
|
);
|
|
3392
3749
|
});
|
|
3393
3750
|
ToastContainer.displayName = ToastPrimitives.Root.displayName;
|
|
3394
|
-
var ToastAction =
|
|
3751
|
+
var ToastAction = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(ToastPrimitives.Action, { ref, className: cn(styles58["toast-action"], className), ...props }));
|
|
3395
3752
|
ToastAction.displayName = ToastPrimitives.Action.displayName;
|
|
3396
|
-
var ToastClose =
|
|
3753
|
+
var ToastClose = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(ToastPrimitives.Close, { ref, className: cn(styles58["toast-close"], className), ...props, children: /* @__PURE__ */ jsx(XIcon2, { className: styles58["toast-close-icon"] }) }));
|
|
3397
3754
|
ToastClose.displayName = ToastPrimitives.Close.displayName;
|
|
3398
|
-
var ToastTitle =
|
|
3755
|
+
var ToastTitle = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(ToastPrimitives.Title, { ref, className: cn(styles58["toast-title"], className), ...props }));
|
|
3399
3756
|
ToastTitle.displayName = ToastPrimitives.Title.displayName;
|
|
3400
|
-
var ToastDescription =
|
|
3757
|
+
var ToastDescription = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3401
3758
|
ToastPrimitives.Description,
|
|
3402
3759
|
{
|
|
3403
3760
|
ref,
|
|
@@ -3710,6 +4067,6 @@ var ThemeProvider = ({ customVars, children }) => {
|
|
|
3710
4067
|
] });
|
|
3711
4068
|
};
|
|
3712
4069
|
|
|
3713
|
-
export { Alert, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, BarGraph, BarGraphSegment, BgGradient, Button, Card, CardContent, CardContentHeader, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CodeBlock, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ControlStatusBadge, CopyButton, DateRangePicker, Dialog, DialogClose, DialogContainer, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogHeaderIcon, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DisplayField, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerHeaderActions, DrawerInnerContent, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, ELEVATION, EmptyTableState, FilterDropdown, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, FormatDate, Heading, Icon, IconButton, InfoCard, Input, Label2 as Label, ListOrGridViewToggle, LoadingOverlay, MetricCard, MotionCollapsibleContent, NotFound, Pagination, PanelLabel, Popover, PopoverContent, PopoverTrigger, Progress, ProgressIndicator, ProgressIndicatorStep, RadialGraph, RadioDropdown, RadioGroup2 as RadioGroup, RadioGroupItem, ResourceBadge, ScrollArea, ScrollBar, SearchBar, SectionHeading, SegmentedControls, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator3 as Separator, Sheet, SheetClose, SheetContainer, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetHeaderIcon, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, SortButton, SortSelector, Spinner, Switch, TableBody, TableCaption, TableCell, TableContainer, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContainer, TabsContent, TabsList, TabsTrigger, Textarea, ThemeProvider, Toast, ToastAction, ToastClose, ToastContainer, ToastDescription, ToastProvider, ToastRoot, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TruncatedDescription, badgeVariants, buttonVariants, reducer, toast, useFormField, useTheme, useToast };
|
|
4070
|
+
export { Alert, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, BarGraph, BarGraphSegment, BgGradient, Button, Card, CardContent, CardContentHeader, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CodeBlock, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ControlStatusBadge, CopyButton, DateRangePicker, Dialog, DialogClose, DialogContainer, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogHeaderIcon, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DisplayField, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerHeaderActions, DrawerInnerContent, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuEmpty, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSearch, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, ELEVATION, EmptyTableState, FilterDropdown, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, FormatDate, Heading, Icon, IconButton, InfoCard, Input, Label2 as Label, ListOrGridViewToggle, LoadingOverlay, MetricCard, MotionCollapsibleContent, NotFound, Pagination, PanelLabel, Popover, PopoverContent, PopoverTrigger, Progress, ProgressIndicator, ProgressIndicatorStep, RadialGraph, RadioDropdown, RadioGroup2 as RadioGroup, RadioGroupItem, ResourceBadge, ScrollArea, ScrollBar, SearchBar, SectionHeading, SegmentedControls, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator3 as Separator, Sheet, SheetClose, SheetContainer, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetHeaderIcon, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, SortButton, SortSelector, Spinner, Switch, TableBody, TableCaption, TableCell, TableContainer, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContainer, TabsContent, TabsList, TabsTrigger, Textarea, ThemeProvider, Toast, ToastAction, ToastClose, ToastContainer, ToastDescription, ToastProvider, ToastRoot, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TruncatedDescription, badgeVariants, buttonVariants, reducer, toast, useFormField, useTheme, useToast };
|
|
3714
4071
|
//# sourceMappingURL=index.js.map
|
|
3715
4072
|
//# sourceMappingURL=index.js.map
|