infinity-ui-elements 1.9.13 → 1.9.16
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/components/BottomSheet/BottomSheet.d.ts +90 -0
- package/dist/components/BottomSheet/BottomSheet.d.ts.map +1 -0
- package/dist/components/BottomSheet/BottomSheet.stories.d.ts +28 -0
- package/dist/components/BottomSheet/BottomSheet.stories.d.ts.map +1 -0
- package/dist/components/BottomSheet/index.d.ts +3 -0
- package/dist/components/BottomSheet/index.d.ts.map +1 -0
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +0 -14
- package/dist/components/DateRangePicker/DateRangePicker.d.ts.map +1 -1
- package/dist/components/ListItem/ListItem.d.ts.map +1 -1
- package/dist/components/Modal/Modal.d.ts +1 -1
- package/dist/components/Modal/Modal.d.ts.map +1 -1
- package/dist/components/TabItem/TabItem.d.ts +2 -2
- package/dist/components/TabItem/TabItem.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.d.ts +1 -1
- package/dist/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.stories.d.ts +0 -4
- package/dist/components/Tabs/Tabs.stories.d.ts.map +1 -1
- package/dist/index.css +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +211 -342
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +211 -343
- package/dist/index.js.map +1 -1
- package/package.json +4 -5
- package/dist/components/Chip/Chip.d.ts +0 -40
- package/dist/components/Chip/Chip.d.ts.map +0 -1
- package/dist/components/Chip/Chip.stories.d.ts +0 -12
- package/dist/components/Chip/Chip.stories.d.ts.map +0 -1
- package/dist/components/Chip/index.d.ts +0 -3
- package/dist/components/Chip/index.d.ts.map +0 -1
- package/dist/components/Table/DetailPanel.d.ts +0 -10
- package/dist/components/Table/DetailPanel.d.ts.map +0 -1
package/dist/index.esm.js
CHANGED
|
@@ -198,10 +198,10 @@ const buttonVariants = cva("items-center gap-3 justify-center whitespace-nowrap
|
|
|
198
198
|
white: "",
|
|
199
199
|
},
|
|
200
200
|
size: {
|
|
201
|
-
xsmall: "
|
|
202
|
-
small: "
|
|
203
|
-
medium: "
|
|
204
|
-
large: "
|
|
201
|
+
xsmall: "h-[28px] px-3 rounded-medium text-body-small-medium",
|
|
202
|
+
small: "h-[32px] px-4 rounded-medium text-body-small-medium",
|
|
203
|
+
medium: "h-[36px] px-5 py-2 rounded-large text-body-medium-medium",
|
|
204
|
+
large: "h-[44px] px-6 rounded-large text-body-large-medium",
|
|
205
205
|
},
|
|
206
206
|
isIconOnly: {
|
|
207
207
|
true: "aspect-square p-0",
|
|
@@ -498,7 +498,7 @@ const Button = React.forwardRef(({ className, variant = "primary", color = "prim
|
|
|
498
498
|
}
|
|
499
499
|
return `var(--color-action-ink-${color}-normal)`;
|
|
500
500
|
};
|
|
501
|
-
const buttonContent = (jsxs(Fragment, { children: [isLoading && !isIconOnly && (jsx(PulseLoader, { color: getLoaderColor(), size: 10 })), isLoading && isIconOnly && (jsx(ClipLoader, { color: getLoaderColor(), size: 20 })), !isLoading && leadingIcon && jsx("span", { children: leadingIcon }), !isIconOnly && !isLoading && children, isIconOnly && !isLoading && children, !isLoading && trailingIcon && jsx("span", { children: trailingIcon })] }));
|
|
501
|
+
const buttonContent = (jsxs(Fragment, { children: [isLoading && !isIconOnly && (jsx(PulseLoader, { color: getLoaderColor(), size: 10 })), isLoading && isIconOnly && (jsx(ClipLoader, { color: getLoaderColor(), size: 20 })), !isLoading && leadingIcon && (jsx("span", { className: "mr-2", children: leadingIcon })), !isIconOnly && !isLoading && children, isIconOnly && !isLoading && children, !isLoading && trailingIcon && jsx("span", { children: trailingIcon })] }));
|
|
502
502
|
return (jsx(Comp, { className: cn(buttonVariants({
|
|
503
503
|
variant,
|
|
504
504
|
color,
|
|
@@ -1317,6 +1317,183 @@ const Badge = React.forwardRef(({ className, variant, size, color, showDot = fal
|
|
|
1317
1317
|
});
|
|
1318
1318
|
Badge.displayName = "Badge";
|
|
1319
1319
|
|
|
1320
|
+
const dividerVariants = cva("", {
|
|
1321
|
+
variants: {
|
|
1322
|
+
orientation: {
|
|
1323
|
+
horizontal: "w-full",
|
|
1324
|
+
vertical: "h-full",
|
|
1325
|
+
},
|
|
1326
|
+
thickness: {
|
|
1327
|
+
thinner: "",
|
|
1328
|
+
thin: "",
|
|
1329
|
+
thick: "",
|
|
1330
|
+
thicker: "",
|
|
1331
|
+
},
|
|
1332
|
+
lineStyle: {
|
|
1333
|
+
solid: "border-solid",
|
|
1334
|
+
dashed: "border-dashed",
|
|
1335
|
+
},
|
|
1336
|
+
variant: {
|
|
1337
|
+
normal: "",
|
|
1338
|
+
subtle: "",
|
|
1339
|
+
muted: "",
|
|
1340
|
+
},
|
|
1341
|
+
},
|
|
1342
|
+
compoundVariants: [
|
|
1343
|
+
// Horizontal orientation with thickness
|
|
1344
|
+
{
|
|
1345
|
+
orientation: "horizontal",
|
|
1346
|
+
thickness: "thinner",
|
|
1347
|
+
class: "border-t-[0.5px]",
|
|
1348
|
+
},
|
|
1349
|
+
{
|
|
1350
|
+
orientation: "horizontal",
|
|
1351
|
+
thickness: "thin",
|
|
1352
|
+
class: "border-t-[1px]",
|
|
1353
|
+
},
|
|
1354
|
+
{
|
|
1355
|
+
orientation: "horizontal",
|
|
1356
|
+
thickness: "thick",
|
|
1357
|
+
class: "border-t-[2px]",
|
|
1358
|
+
},
|
|
1359
|
+
{
|
|
1360
|
+
orientation: "horizontal",
|
|
1361
|
+
thickness: "thicker",
|
|
1362
|
+
class: "border-t-[3px]",
|
|
1363
|
+
},
|
|
1364
|
+
// Vertical orientation with thickness
|
|
1365
|
+
{
|
|
1366
|
+
orientation: "vertical",
|
|
1367
|
+
thickness: "thinner",
|
|
1368
|
+
class: "border-l-[0.5px]",
|
|
1369
|
+
},
|
|
1370
|
+
{
|
|
1371
|
+
orientation: "vertical",
|
|
1372
|
+
thickness: "thin",
|
|
1373
|
+
class: "border-l-[1px]",
|
|
1374
|
+
},
|
|
1375
|
+
{
|
|
1376
|
+
orientation: "vertical",
|
|
1377
|
+
thickness: "thick",
|
|
1378
|
+
class: "border-l-[2px]",
|
|
1379
|
+
},
|
|
1380
|
+
{
|
|
1381
|
+
orientation: "vertical",
|
|
1382
|
+
thickness: "thicker",
|
|
1383
|
+
class: "border-l-[3px]",
|
|
1384
|
+
},
|
|
1385
|
+
// Normal variant colors
|
|
1386
|
+
{
|
|
1387
|
+
variant: "normal",
|
|
1388
|
+
class: "border-surface-outline-neutral-normal",
|
|
1389
|
+
},
|
|
1390
|
+
// Subtle variant colors
|
|
1391
|
+
{
|
|
1392
|
+
variant: "subtle",
|
|
1393
|
+
class: "border-surface-outline-neutral-subtle",
|
|
1394
|
+
},
|
|
1395
|
+
// Muted variant colors
|
|
1396
|
+
{
|
|
1397
|
+
variant: "muted",
|
|
1398
|
+
class: "border-surface-outline-neutral-muted",
|
|
1399
|
+
},
|
|
1400
|
+
],
|
|
1401
|
+
defaultVariants: {
|
|
1402
|
+
orientation: "horizontal",
|
|
1403
|
+
thickness: "thin",
|
|
1404
|
+
lineStyle: "solid",
|
|
1405
|
+
variant: "normal",
|
|
1406
|
+
},
|
|
1407
|
+
});
|
|
1408
|
+
const Divider = React.forwardRef(({ className, orientation = "horizontal", thickness = "thin", lineStyle = "solid", variant = "normal", ...props }, ref) => {
|
|
1409
|
+
return (jsx("div", { ref: ref, role: "separator", "aria-orientation": orientation, className: cn(dividerVariants({ orientation, thickness, lineStyle, variant }), className), ...props }));
|
|
1410
|
+
});
|
|
1411
|
+
Divider.displayName = "Divider";
|
|
1412
|
+
|
|
1413
|
+
const BottomSheet = React.forwardRef(({ isOpen, onClose, title, description, footer, children, variant = "default", showCloseButton = true, showDragHandle = true, closeOnOverlayClick = true, closeOnEscape = true, closeOnSwipeDown = true, maxHeight = "90vh", className, contentClassName, headerClassName, bodyClassName, footerClassName, overlayClassName, ariaLabel, ariaDescribedBy, }, ref) => {
|
|
1414
|
+
const sheetRef = React.useRef(null);
|
|
1415
|
+
const contentRef = ref || sheetRef;
|
|
1416
|
+
const [isClosing, setIsClosing] = React.useState(false);
|
|
1417
|
+
const [touchStart, setTouchStart] = React.useState(null);
|
|
1418
|
+
const [touchEnd, setTouchEnd] = React.useState(null);
|
|
1419
|
+
// Handle escape key
|
|
1420
|
+
React.useEffect(() => {
|
|
1421
|
+
if (!isOpen || !closeOnEscape || !onClose)
|
|
1422
|
+
return;
|
|
1423
|
+
const handleEscape = (e) => {
|
|
1424
|
+
if (e.key === "Escape") {
|
|
1425
|
+
handleClose();
|
|
1426
|
+
}
|
|
1427
|
+
};
|
|
1428
|
+
document.addEventListener("keydown", handleEscape);
|
|
1429
|
+
return () => document.removeEventListener("keydown", handleEscape);
|
|
1430
|
+
}, [isOpen, closeOnEscape, onClose]);
|
|
1431
|
+
// Prevent body scroll when bottom sheet is open
|
|
1432
|
+
React.useEffect(() => {
|
|
1433
|
+
if (isOpen) {
|
|
1434
|
+
document.body.style.overflow = "hidden";
|
|
1435
|
+
}
|
|
1436
|
+
else {
|
|
1437
|
+
document.body.style.overflow = "";
|
|
1438
|
+
}
|
|
1439
|
+
return () => {
|
|
1440
|
+
document.body.style.overflow = "";
|
|
1441
|
+
};
|
|
1442
|
+
}, [isOpen]);
|
|
1443
|
+
// Reset closing state when opening
|
|
1444
|
+
React.useEffect(() => {
|
|
1445
|
+
if (isOpen) {
|
|
1446
|
+
setIsClosing(false);
|
|
1447
|
+
}
|
|
1448
|
+
}, [isOpen]);
|
|
1449
|
+
// Handle close with animation
|
|
1450
|
+
const handleClose = () => {
|
|
1451
|
+
if (!onClose)
|
|
1452
|
+
return;
|
|
1453
|
+
setIsClosing(true);
|
|
1454
|
+
// Wait for animation to complete before calling onClose
|
|
1455
|
+
setTimeout(() => {
|
|
1456
|
+
onClose();
|
|
1457
|
+
setIsClosing(false);
|
|
1458
|
+
}, 300); // Match animation duration
|
|
1459
|
+
};
|
|
1460
|
+
// Handle overlay click
|
|
1461
|
+
const handleOverlayClick = (e) => {
|
|
1462
|
+
if (closeOnOverlayClick && e.target === e.currentTarget) {
|
|
1463
|
+
handleClose();
|
|
1464
|
+
}
|
|
1465
|
+
};
|
|
1466
|
+
// Handle touch events for swipe down
|
|
1467
|
+
const handleTouchStart = (e) => {
|
|
1468
|
+
if (!closeOnSwipeDown)
|
|
1469
|
+
return;
|
|
1470
|
+
setTouchEnd(null);
|
|
1471
|
+
setTouchStart(e.targetTouches[0].clientY);
|
|
1472
|
+
};
|
|
1473
|
+
const handleTouchMove = (e) => {
|
|
1474
|
+
if (!closeOnSwipeDown)
|
|
1475
|
+
return;
|
|
1476
|
+
setTouchEnd(e.targetTouches[0].clientY);
|
|
1477
|
+
};
|
|
1478
|
+
const handleTouchEnd = () => {
|
|
1479
|
+
if (!closeOnSwipeDown || !touchStart || !touchEnd)
|
|
1480
|
+
return;
|
|
1481
|
+
const distance = touchEnd - touchStart;
|
|
1482
|
+
const isSwipeDown = distance > 100; // Minimum swipe distance
|
|
1483
|
+
if (isSwipeDown) {
|
|
1484
|
+
handleClose();
|
|
1485
|
+
}
|
|
1486
|
+
setTouchStart(null);
|
|
1487
|
+
setTouchEnd(null);
|
|
1488
|
+
};
|
|
1489
|
+
// Don't render if not open and not closing
|
|
1490
|
+
if (!isOpen && !isClosing)
|
|
1491
|
+
return null;
|
|
1492
|
+
const hasHeader = title || description;
|
|
1493
|
+
return (jsxs("div", { className: cn("fixed inset-0 z-9999 flex items-end justify-center", className), role: "dialog", "aria-modal": "true", "aria-label": ariaLabel || title, "aria-describedby": ariaDescribedBy, children: [jsx("div", { className: cn("absolute inset-0 z-0 bg-black/50 backdrop-blur-sm transition-opacity duration-300", isClosing ? "opacity-0" : "opacity-100", overlayClassName), onClick: handleOverlayClick, "aria-hidden": "true" }), jsxs("div", { ref: contentRef, className: cn("relative z-10 w-full transition-transform duration-300", "flex flex-col overflow-hidden", variant === "default" && "bg-white rounded-t-2xl shadow-xl", isClosing ? "animate-slide-out-bottom" : "animate-slide-in-bottom", contentClassName), style: { maxHeight }, onTouchStart: handleTouchStart, onTouchMove: handleTouchMove, onTouchEnd: handleTouchEnd, children: [showDragHandle && variant === "default" && (jsx("div", { className: "flex justify-center pt-3 pb-2", children: jsx("div", { className: "w-10 h-1 bg-neutral-300 rounded-full" }) })), hasHeader && (jsxs("div", { className: cn("flex items-start justify-between gap-4", variant === "default" && "px-6", variant === "default" && !showDragHandle && "pt-6", variant === "default" && showDragHandle && "pt-2", variant === "default" && !description && "pb-4", variant === "default" && description && "pb-2", headerClassName), children: [jsxs("div", { className: "flex-1", children: [title && (jsx(Text, { as: "h2", variant: "body", size: "large", weight: "semibold", color: "default", children: title })), description && (jsx(Text, { as: "p", variant: "body", size: "small", weight: "regular", color: "subtle", className: "mt-1", children: description }))] }), showCloseButton && onClose && (jsx(IconButton, { icon: "close", onClick: handleClose, color: "neutral", size: "small", "aria-label": "Close bottom sheet", className: "shrink-0" }))] })), !hasHeader && showCloseButton && onClose && (jsx("div", { className: cn("absolute z-10", variant === "default" && "top-4 right-4"), children: jsx(IconButton, { icon: "close", onClick: handleClose, color: "neutral", size: "small", "aria-label": "Close bottom sheet" }) })), jsx("div", { className: cn("flex-1 overflow-y-auto", variant === "default" && "px-6", variant === "default" && hasHeader && "py-4", variant === "default" && !hasHeader && !showDragHandle && "pt-6 pb-4", variant === "default" && !hasHeader && showDragHandle && "pt-2 pb-4", variant === "default" && !footer && "pb-6", bodyClassName), children: children }), footer && (jsxs("div", { className: "flex flex-col", children: [variant === "default" && (jsx(Divider, { thickness: "thin", variant: "muted" })), jsx("div", { className: cn("flex items-center justify-end gap-3", variant === "default" && "px-6 py-4", footerClassName), children: footer })] }))] })] }));
|
|
1494
|
+
});
|
|
1495
|
+
BottomSheet.displayName = "BottomSheet";
|
|
1496
|
+
|
|
1320
1497
|
const buttonGroupVariants = cva("inline-flex", {
|
|
1321
1498
|
variants: {
|
|
1322
1499
|
variant: {
|
|
@@ -1655,175 +1832,6 @@ const Checkbox = React.forwardRef(({ label, errorText, size = "medium", validati
|
|
|
1655
1832
|
});
|
|
1656
1833
|
Checkbox.displayName = "Checkbox";
|
|
1657
1834
|
|
|
1658
|
-
const chipVariants = cva("inline-flex items-center justify-center whitespace-nowrap rounded-full border transition-colors focus-visible:outline-none focus-visible:ring-2 disabled:pointer-events-none", {
|
|
1659
|
-
variants: {
|
|
1660
|
-
intent: {
|
|
1661
|
-
primary: "",
|
|
1662
|
-
positive: "",
|
|
1663
|
-
negative: "",
|
|
1664
|
-
},
|
|
1665
|
-
selection: {
|
|
1666
|
-
default: "",
|
|
1667
|
-
light: "",
|
|
1668
|
-
intense: "",
|
|
1669
|
-
},
|
|
1670
|
-
size: {
|
|
1671
|
-
xsmall: "h-[24px] px-3 gap-2 text-body-small-medium",
|
|
1672
|
-
small: "h-[28px] px-4 gap-2 text-body-medium-medium",
|
|
1673
|
-
medium: "h-[36px] px-5 gap-3 text-body-large-medium",
|
|
1674
|
-
large: "h-[44px] px-6 gap-3 text-heading-medium-medium",
|
|
1675
|
-
},
|
|
1676
|
-
isDisabled: {
|
|
1677
|
-
true: "cursor-not-allowed",
|
|
1678
|
-
false: "cursor-pointer",
|
|
1679
|
-
},
|
|
1680
|
-
},
|
|
1681
|
-
compoundVariants: [
|
|
1682
|
-
// Selection: default (neutral chip, intent influences focus ring/border)
|
|
1683
|
-
{
|
|
1684
|
-
selection: "default",
|
|
1685
|
-
class: `
|
|
1686
|
-
bg-surface-fill-neutral-intense
|
|
1687
|
-
text-action-ink-neutral-normal
|
|
1688
|
-
border-action-outline-neutral-faded
|
|
1689
|
-
hover:bg-action-fill-neutral-faded-hover
|
|
1690
|
-
hover:border-action-outline-neutral-faded-hover
|
|
1691
|
-
active:bg-action-fill-neutral-faded-activated
|
|
1692
|
-
active:border-action-outline-neutral-faded-activated
|
|
1693
|
-
disabled:bg-surface-fill-neutral-moderate
|
|
1694
|
-
disabled:text-surface-ink-neutral-disabled
|
|
1695
|
-
disabled:border-action-outline-neutral-disabled
|
|
1696
|
-
`,
|
|
1697
|
-
},
|
|
1698
|
-
{
|
|
1699
|
-
selection: "default",
|
|
1700
|
-
intent: "primary",
|
|
1701
|
-
class: "focus-visible:ring-action-outline-primary-faded-hover focus-visible:border-action-outline-primary-faded-hover",
|
|
1702
|
-
},
|
|
1703
|
-
{
|
|
1704
|
-
selection: "default",
|
|
1705
|
-
intent: "positive",
|
|
1706
|
-
class: "focus-visible:ring-action-outline-positive-faded-hover focus-visible:border-action-outline-positive-faded-hover",
|
|
1707
|
-
},
|
|
1708
|
-
{
|
|
1709
|
-
selection: "default",
|
|
1710
|
-
intent: "negative",
|
|
1711
|
-
class: "focus-visible:ring-action-outline-negative-faded-hover focus-visible:border-action-outline-negative-faded-hover",
|
|
1712
|
-
},
|
|
1713
|
-
// Selection: light
|
|
1714
|
-
{
|
|
1715
|
-
selection: "light",
|
|
1716
|
-
intent: "primary",
|
|
1717
|
-
class: `
|
|
1718
|
-
bg-action-fill-primary-faded
|
|
1719
|
-
text-action-ink-primary-normal
|
|
1720
|
-
border-action-outline-primary-faded
|
|
1721
|
-
hover:bg-action-fill-primary-faded-hover
|
|
1722
|
-
hover:border-action-outline-primary-faded-hover
|
|
1723
|
-
active:bg-action-fill-primary-faded-activated
|
|
1724
|
-
active:border-action-outline-primary-faded-activated
|
|
1725
|
-
focus-visible:ring-action-outline-primary-faded-hover
|
|
1726
|
-
disabled:bg-action-fill-primary-disabled
|
|
1727
|
-
disabled:text-action-ink-primary-disabled
|
|
1728
|
-
disabled:border-action-outline-primary-disabled
|
|
1729
|
-
`,
|
|
1730
|
-
},
|
|
1731
|
-
{
|
|
1732
|
-
selection: "light",
|
|
1733
|
-
intent: "positive",
|
|
1734
|
-
class: `
|
|
1735
|
-
bg-action-fill-positive-faded
|
|
1736
|
-
text-action-ink-positive-normal
|
|
1737
|
-
border-action-outline-positive-faded
|
|
1738
|
-
hover:bg-action-fill-positive-faded-hover
|
|
1739
|
-
hover:border-action-outline-positive-faded-hover
|
|
1740
|
-
active:bg-action-fill-positive-faded-activated
|
|
1741
|
-
active:border-action-outline-positive-faded-activated
|
|
1742
|
-
focus-visible:ring-action-outline-positive-faded-hover
|
|
1743
|
-
disabled:bg-action-fill-positive-disabled
|
|
1744
|
-
disabled:text-action-ink-positive-disabled
|
|
1745
|
-
disabled:border-action-outline-positive-disabled
|
|
1746
|
-
`,
|
|
1747
|
-
},
|
|
1748
|
-
{
|
|
1749
|
-
selection: "light",
|
|
1750
|
-
intent: "negative",
|
|
1751
|
-
class: `
|
|
1752
|
-
bg-action-fill-negative-faded
|
|
1753
|
-
text-action-ink-negative-normal
|
|
1754
|
-
border-action-outline-negative-faded
|
|
1755
|
-
hover:bg-action-fill-negative-faded-hover
|
|
1756
|
-
hover:border-action-outline-negative-faded-hover
|
|
1757
|
-
active:bg-action-fill-negative-faded-activated
|
|
1758
|
-
active:border-action-outline-negative-faded-activated
|
|
1759
|
-
focus-visible:ring-action-outline-negative-faded-hover
|
|
1760
|
-
disabled:bg-action-fill-negative-disabled
|
|
1761
|
-
disabled:text-action-ink-negative-disabled
|
|
1762
|
-
disabled:border-action-outline-negative-disabled
|
|
1763
|
-
`,
|
|
1764
|
-
},
|
|
1765
|
-
// Selection: intense
|
|
1766
|
-
{
|
|
1767
|
-
selection: "intense",
|
|
1768
|
-
intent: "primary",
|
|
1769
|
-
class: `
|
|
1770
|
-
bg-action-fill-primary-default
|
|
1771
|
-
text-action-ink-on-primary-normal
|
|
1772
|
-
border-transparent
|
|
1773
|
-
hover:bg-action-fill-primary-hover
|
|
1774
|
-
active:bg-action-fill-primary-activated
|
|
1775
|
-
focus-visible:ring-action-outline-primary-faded-hover
|
|
1776
|
-
disabled:bg-action-fill-primary-disabled
|
|
1777
|
-
disabled:text-action-ink-primary-disabled
|
|
1778
|
-
`,
|
|
1779
|
-
},
|
|
1780
|
-
{
|
|
1781
|
-
selection: "intense",
|
|
1782
|
-
intent: "positive",
|
|
1783
|
-
class: `
|
|
1784
|
-
bg-action-fill-positive-default
|
|
1785
|
-
text-action-ink-on-primary-normal
|
|
1786
|
-
border-transparent
|
|
1787
|
-
hover:bg-action-fill-positive-hover
|
|
1788
|
-
active:bg-action-fill-positive-activated
|
|
1789
|
-
focus-visible:ring-action-outline-positive-faded-hover
|
|
1790
|
-
disabled:bg-action-fill-positive-disabled
|
|
1791
|
-
disabled:text-action-ink-positive-disabled
|
|
1792
|
-
`,
|
|
1793
|
-
},
|
|
1794
|
-
{
|
|
1795
|
-
selection: "intense",
|
|
1796
|
-
intent: "negative",
|
|
1797
|
-
class: `
|
|
1798
|
-
bg-action-fill-negative-default
|
|
1799
|
-
text-action-ink-on-primary-normal
|
|
1800
|
-
border-transparent
|
|
1801
|
-
hover:bg-action-fill-negative-hover
|
|
1802
|
-
active:bg-action-fill-negative-activated
|
|
1803
|
-
focus-visible:ring-action-outline-negative-faded-hover
|
|
1804
|
-
disabled:bg-action-fill-negative-disabled
|
|
1805
|
-
disabled:text-action-ink-negative-disabled
|
|
1806
|
-
`,
|
|
1807
|
-
},
|
|
1808
|
-
],
|
|
1809
|
-
defaultVariants: {
|
|
1810
|
-
intent: "primary",
|
|
1811
|
-
selection: "default",
|
|
1812
|
-
size: "medium",
|
|
1813
|
-
isDisabled: false,
|
|
1814
|
-
},
|
|
1815
|
-
});
|
|
1816
|
-
const Chip = React.forwardRef(({ className, intent = "primary", selection = "default", size = "medium", isDisabled = false, leadingComponent, trailingComponent, disabled, children, type, ...props }, ref) => {
|
|
1817
|
-
const finalDisabled = Boolean(disabled || isDisabled);
|
|
1818
|
-
return (jsxs("button", { ref: ref, type: type ?? "button", disabled: finalDisabled, className: cn(chipVariants({
|
|
1819
|
-
intent,
|
|
1820
|
-
selection,
|
|
1821
|
-
size,
|
|
1822
|
-
isDisabled: finalDisabled,
|
|
1823
|
-
}), className), ...props, children: [leadingComponent && (jsx("span", { className: "inline-flex items-center", children: leadingComponent })), jsx("span", { className: "inline-flex items-center", children: children }), trailingComponent && (jsx("span", { className: "inline-flex items-center", children: trailingComponent }))] }));
|
|
1824
|
-
});
|
|
1825
|
-
Chip.displayName = "Chip";
|
|
1826
|
-
|
|
1827
1835
|
const counterVariants = cva("inline-flex items-center justify-center transition-colors", {
|
|
1828
1836
|
variants: {
|
|
1829
1837
|
size: {
|
|
@@ -2613,7 +2621,7 @@ const DatePicker = React.forwardRef(({ className, value: controlledValue, defaul
|
|
|
2613
2621
|
});
|
|
2614
2622
|
DatePicker.displayName = "DatePicker";
|
|
2615
2623
|
|
|
2616
|
-
const listItemVariants = cva("flex
|
|
2624
|
+
const listItemVariants = cva("flex items-start gap-3 p-3 rounded-medium transition-colors cursor-pointer", {
|
|
2617
2625
|
variants: {
|
|
2618
2626
|
variant: {
|
|
2619
2627
|
default: `hover:bg-action-fill-neutral-faded
|
|
@@ -2679,7 +2687,7 @@ const ListItem = React.forwardRef(({ className, type = "single", leadingIcon, ti
|
|
|
2679
2687
|
variant,
|
|
2680
2688
|
isDisabled,
|
|
2681
2689
|
isSelected: type === "multiple" ? internalSelected : false,
|
|
2682
|
-
}),
|
|
2690
|
+
}), containerClassName), onClick: handleClick, role: type === "multiple" ? "checkbox" : "button", "aria-checked": type === "multiple" ? internalSelected : undefined, "aria-disabled": isDisabled, tabIndex: isDisabled ? -1 : 0, ...props, children: [type === "multiple" && (jsx(Checkbox, { checked: internalSelected, onChange: handleCheckboxChange, isDisabled: isDisabled, size: checkboxSize, className: "shrink-0 mt-0.5" })), leadingIcon && (jsx("div", { className: cn(`shrink-0 flex items-center justify-center mt-0.5`, variant === "primary"
|
|
2683
2691
|
? "text-action-ink-primary-normal"
|
|
2684
2692
|
: variant === "negative"
|
|
2685
2693
|
? "text-action-ink-negative-normal"
|
|
@@ -2814,7 +2822,7 @@ const formatMonthYear = (date) => {
|
|
|
2814
2822
|
year: "numeric",
|
|
2815
2823
|
});
|
|
2816
2824
|
};
|
|
2817
|
-
const DateRangePicker = React.forwardRef(({ className, value: controlledValue, defaultValue, onChange, placeholder = "Select date range", isDisabled = false, size = "medium",
|
|
2825
|
+
const DateRangePicker = React.forwardRef(({ className, value: controlledValue, defaultValue, onChange, placeholder = "Select date range", isDisabled = false, size = "medium", triggerClassName, calendarClassName, minDate, maxDate, formatDate = formatDateDefault, presets = defaultPresets, showPresets = true, selectedPresetLabel, ...props }, ref) => {
|
|
2818
2826
|
const [uncontrolledValue, setUncontrolledValue] = React.useState(defaultValue || { startDate: null, endDate: null });
|
|
2819
2827
|
const [tempValue, setTempValue] = React.useState(defaultValue || { startDate: null, endDate: null });
|
|
2820
2828
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
@@ -3037,19 +3045,14 @@ const DateRangePicker = React.forwardRef(({ className, value: controlledValue, d
|
|
|
3037
3045
|
}
|
|
3038
3046
|
return placeholder;
|
|
3039
3047
|
};
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
? "text-surface-ink-neutral-disabled"
|
|
3049
|
-
: "text-surface-ink-neutral-muted") }), jsx("span", { className: cn("flex-1 text-left truncate", !hasValue && "text-surface-ink-neutral-muted", isDisabled && "text-surface-ink-neutral-disabled"), children: displayText }), jsx(Icon, { name: "chevronDown", size: 16, className: cn("shrink-0 transition-transform", isDisabled
|
|
3050
|
-
? "text-surface-ink-neutral-disabled"
|
|
3051
|
-
: "text-surface-ink-neutral-muted", isOpen && "rotate-180") })] }));
|
|
3052
|
-
return (jsxs("div", { ref: datePickerRef, className: cn("relative w-fit", className), children: [triggerElement, typeof document !== "undefined" &&
|
|
3048
|
+
return (jsxs("div", { ref: datePickerRef, className: cn("relative w-fit", className), children: [jsxs("div", { className: cn(dateRangePickerVariants({
|
|
3049
|
+
size,
|
|
3050
|
+
isDisabled,
|
|
3051
|
+
}), "cursor-pointer", triggerClassName), onClick: !isDisabled ? toggleOpen : undefined, role: "button", "aria-haspopup": "dialog", "aria-expanded": isOpen, "aria-disabled": isDisabled, ...props, children: [jsx(Calendar, { className: cn("shrink-0 w-4 h-4", isDisabled
|
|
3052
|
+
? "text-surface-ink-neutral-disabled"
|
|
3053
|
+
: "text-surface-ink-neutral-muted") }), jsx("span", { className: cn("flex-1 text-left truncate", !hasValue && "text-surface-ink-neutral-muted", isDisabled && "text-surface-ink-neutral-disabled"), children: getDisplayText() }), jsx(Icon, { name: "chevronDown", size: 16, className: cn("shrink-0 transition-transform", isDisabled
|
|
3054
|
+
? "text-surface-ink-neutral-disabled"
|
|
3055
|
+
: "text-surface-ink-neutral-muted", isOpen && "rotate-180") })] }), typeof document !== "undefined" &&
|
|
3053
3056
|
isOpen &&
|
|
3054
3057
|
!isDisabled &&
|
|
3055
3058
|
(() => {
|
|
@@ -3068,7 +3071,7 @@ const DateRangePicker = React.forwardRef(({ className, value: controlledValue, d
|
|
|
3068
3071
|
? `${window.innerHeight - position.bottom - gap - 10}px`
|
|
3069
3072
|
: `${position.top - gap - 10}px`,
|
|
3070
3073
|
overflowY: "auto",
|
|
3071
|
-
}, className: cn("bg-surface-fill-neutral-intense rounded-large shadow-lg border
|
|
3074
|
+
}, className: cn("bg-surface-fill-neutral-intense rounded-large shadow-lg border border-surface-outline-neutral-subtle", calendarClassName), onClick: (e) => e.stopPropagation(), children: jsxs("div", { className: "flex", children: [showPresets && presets.length > 0 && (jsx("div", { className: "w-48 border-r border-surface-outline-neutral-subtle p-4 flex flex-col", children: presets.map((preset) => (jsx(ListItem, { title: preset.label, type: "single", showChevron: false, isSelected: selectedPreset === preset.value, onClick: () => handlePresetClick(preset), containerClassName: "mb-1 last:mb-0" }, preset.value))) })), jsxs("div", { className: "p-4", children: [jsxs("div", { className: "flex gap-6", children: [jsxs("div", { className: "flex flex-col gap-3", children: [jsx("div", { className: "flex flex-col px-3", children: jsx("p", { className: "text-body-small-medium", children: "Start Date" }) }), jsxs("div", { className: "flex flex-col p-5 rounded-[8px] bg-surface-fill-neutral-moderate", children: [jsxs("div", { className: "flex items-center justify-between mb-3 px-3", children: [jsx("h3", { className: "text-body-small-medium font-medium text-surface-ink-neutral-normal", children: formatMonthYear(startMonth) }), jsxs("div", { className: "flex items-center gap-2", children: [jsx("button", { onClick: handlePrevStartMonth, className: "p-1 hover:bg-surface-fill-neutral-faded rounded transition-colors", "aria-label": "Previous month", children: jsx(ChevronLeft, { className: "w-4 h-4 text-surface-ink-neutral-normal" }) }), jsx("button", { onClick: handleNextStartMonth, className: "p-1 hover:bg-surface-fill-neutral-faded rounded transition-colors", "aria-label": "Next month", children: jsx(ChevronRight, { className: "w-4 h-4 text-surface-ink-neutral-normal" }) })] })] }), jsx("div", { className: "date-range-calendar-wrapper", children: jsx(Calendar$1, { onChange: handleStartDateChange, value: tempValue.startDate, minDate: minDateParsed ?? undefined, maxDate: tempValue.endDate
|
|
3072
3075
|
? tempValue.endDate
|
|
3073
3076
|
: maxDateParsed ?? undefined, activeStartDate: startMonth, onActiveStartDateChange: ({ activeStartDate, }) => {
|
|
3074
3077
|
if (activeStartDate)
|
|
@@ -3100,113 +3103,20 @@ const DateRangePicker = React.forwardRef(({ className, value: controlledValue, d
|
|
|
3100
3103
|
"SAT",
|
|
3101
3104
|
];
|
|
3102
3105
|
return weekdayNames[date.getDay()];
|
|
3103
|
-
} }) })] })] })] })
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3106
|
+
} }) })] })] })] }), jsxs("div", { className: "mt-4 pt-4 border-t border-surface-outline-neutral-subtle flex items-center justify-between", children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("div", { className: "w-2 h-2 rounded-full bg-action-fill-primary-default" }), jsx("span", { className: "text-sm text-surface-ink-neutral-normal", children: tempValue.startDate && tempValue.endDate
|
|
3107
|
+
? isSameDay(tempValue.startDate, tempValue.endDate)
|
|
3108
|
+
? "Today"
|
|
3109
|
+
: `${formatDate(tempValue.startDate)} - ${formatDate(tempValue.endDate)}`
|
|
3110
|
+
: tempValue.startDate
|
|
3111
|
+
? `From ${formatDate(tempValue.startDate)}`
|
|
3112
|
+
: tempValue.endDate
|
|
3113
|
+
? `Until ${formatDate(tempValue.endDate)}`
|
|
3114
|
+
: "No selection" })] }), jsxs("div", { className: "flex items-center gap-2", children: [jsx(Button, { variant: "secondary", color: "neutral", size: "small", onClick: handleCancel, children: "Cancel" }), jsx(Button, { variant: "primary", color: "primary", size: "small", onClick: handleApply, children: "Apply date range" })] })] })] })] }) }));
|
|
3112
3115
|
return createPortal(calendarPopup, document.body);
|
|
3113
3116
|
})()] }));
|
|
3114
3117
|
});
|
|
3115
3118
|
DateRangePicker.displayName = "DateRangePicker";
|
|
3116
3119
|
|
|
3117
|
-
const dividerVariants = cva("", {
|
|
3118
|
-
variants: {
|
|
3119
|
-
orientation: {
|
|
3120
|
-
horizontal: "w-full",
|
|
3121
|
-
vertical: "h-full",
|
|
3122
|
-
},
|
|
3123
|
-
thickness: {
|
|
3124
|
-
thinner: "",
|
|
3125
|
-
thin: "",
|
|
3126
|
-
thick: "",
|
|
3127
|
-
thicker: "",
|
|
3128
|
-
},
|
|
3129
|
-
lineStyle: {
|
|
3130
|
-
solid: "border-solid",
|
|
3131
|
-
dashed: "border-dashed",
|
|
3132
|
-
},
|
|
3133
|
-
variant: {
|
|
3134
|
-
normal: "",
|
|
3135
|
-
subtle: "",
|
|
3136
|
-
muted: "",
|
|
3137
|
-
},
|
|
3138
|
-
},
|
|
3139
|
-
compoundVariants: [
|
|
3140
|
-
// Horizontal orientation with thickness
|
|
3141
|
-
{
|
|
3142
|
-
orientation: "horizontal",
|
|
3143
|
-
thickness: "thinner",
|
|
3144
|
-
class: "border-t-[0.5px]",
|
|
3145
|
-
},
|
|
3146
|
-
{
|
|
3147
|
-
orientation: "horizontal",
|
|
3148
|
-
thickness: "thin",
|
|
3149
|
-
class: "border-t-[1px]",
|
|
3150
|
-
},
|
|
3151
|
-
{
|
|
3152
|
-
orientation: "horizontal",
|
|
3153
|
-
thickness: "thick",
|
|
3154
|
-
class: "border-t-[2px]",
|
|
3155
|
-
},
|
|
3156
|
-
{
|
|
3157
|
-
orientation: "horizontal",
|
|
3158
|
-
thickness: "thicker",
|
|
3159
|
-
class: "border-t-[3px]",
|
|
3160
|
-
},
|
|
3161
|
-
// Vertical orientation with thickness
|
|
3162
|
-
{
|
|
3163
|
-
orientation: "vertical",
|
|
3164
|
-
thickness: "thinner",
|
|
3165
|
-
class: "border-l-[0.5px]",
|
|
3166
|
-
},
|
|
3167
|
-
{
|
|
3168
|
-
orientation: "vertical",
|
|
3169
|
-
thickness: "thin",
|
|
3170
|
-
class: "border-l-[1px]",
|
|
3171
|
-
},
|
|
3172
|
-
{
|
|
3173
|
-
orientation: "vertical",
|
|
3174
|
-
thickness: "thick",
|
|
3175
|
-
class: "border-l-[2px]",
|
|
3176
|
-
},
|
|
3177
|
-
{
|
|
3178
|
-
orientation: "vertical",
|
|
3179
|
-
thickness: "thicker",
|
|
3180
|
-
class: "border-l-[3px]",
|
|
3181
|
-
},
|
|
3182
|
-
// Normal variant colors
|
|
3183
|
-
{
|
|
3184
|
-
variant: "normal",
|
|
3185
|
-
class: "border-surface-outline-neutral-normal",
|
|
3186
|
-
},
|
|
3187
|
-
// Subtle variant colors
|
|
3188
|
-
{
|
|
3189
|
-
variant: "subtle",
|
|
3190
|
-
class: "border-surface-outline-neutral-subtle",
|
|
3191
|
-
},
|
|
3192
|
-
// Muted variant colors
|
|
3193
|
-
{
|
|
3194
|
-
variant: "muted",
|
|
3195
|
-
class: "border-surface-outline-neutral-muted",
|
|
3196
|
-
},
|
|
3197
|
-
],
|
|
3198
|
-
defaultVariants: {
|
|
3199
|
-
orientation: "horizontal",
|
|
3200
|
-
thickness: "thin",
|
|
3201
|
-
lineStyle: "solid",
|
|
3202
|
-
variant: "normal",
|
|
3203
|
-
},
|
|
3204
|
-
});
|
|
3205
|
-
const Divider = React.forwardRef(({ className, orientation = "horizontal", thickness = "thin", lineStyle = "solid", variant = "normal", ...props }, ref) => {
|
|
3206
|
-
return (jsx("div", { ref: ref, role: "separator", "aria-orientation": orientation, className: cn(dividerVariants({ orientation, thickness, lineStyle, variant }), className), ...props }));
|
|
3207
|
-
});
|
|
3208
|
-
Divider.displayName = "Divider";
|
|
3209
|
-
|
|
3210
3120
|
const DropdownMenu = React.forwardRef(({ items = [], customContent, customContentClassName, sectionHeading, isLoading = false, isEmpty = false, emptyTitle = "No Search Results Found", emptyDescription = "Add description of what the user can search for here.", emptyLinkText = "Link to support site", onEmptyLinkClick, primaryButtonText = "Primary", secondaryButtonText = "Secondary", onPrimaryClick, onSecondaryClick, showChevron = false, emptyIcon, disableFooter = false, showFooter, footerLayout = "horizontal", onClose, focusedIndex = -1, className, width = "auto", maxHeight = "400px", }, ref) => {
|
|
3211
3121
|
const renderContent = () => {
|
|
3212
3122
|
if (isLoading) {
|
|
@@ -3429,7 +3339,7 @@ const Modal = React.forwardRef(({ isOpen, onClose, title, description, footer, c
|
|
|
3429
3339
|
if (!isOpen)
|
|
3430
3340
|
return null;
|
|
3431
3341
|
const hasHeader = title || description;
|
|
3432
|
-
return (jsxs("div", { className: cn("fixed inset-0 z-9999 flex items-center justify-center p-4", className), role: "dialog", "aria-modal": "true", "aria-label": ariaLabel || title, "aria-describedby": ariaDescribedBy, children: [jsx("div", { className: cn("absolute inset-0 z-0 bg-black/50 backdrop-blur-sm transition-opacity", overlayClassName), onClick: handleOverlayClick, "aria-hidden": "true" }), jsxs("div", { ref: contentRef, className: cn("relative transition-all z-10", "flex flex-col max-h-[90vh]", variant === "default" && "w-full bg-white rounded-large shadow-xl", variant === "default" && sizeConfig[size], contentClassName), children: [hasHeader && (jsxs("div", { className: cn("flex items-start justify-between gap-4 px-6 pt-6", !description && "pb-4", description && "pb-2", headerClassName), children: [jsxs("div", { className: "flex-1", children: [title && (jsx(Text, { as: "h2", variant: "body", size: "large", weight: "semibold", color: "default", children: title })), description && (jsx(Text, { as: "p", variant: "body", size: "small", weight: "regular", color: "subtle", className: "mt-1", children: description }))] }), showCloseButton && onClose && (jsx(IconButton, { icon: "close", onClick: onClose, color: "neutral", size: "small", "aria-label": "Close modal", className: "shrink-0" }))] })), !hasHeader && showCloseButton && onClose && (jsx("div", { className: "absolute top-4 right-4
|
|
3342
|
+
return (jsxs("div", { className: cn("fixed inset-0 z-9999 flex items-center justify-center p-4", className), role: "dialog", "aria-modal": "true", "aria-label": ariaLabel || title, "aria-describedby": ariaDescribedBy, children: [jsx("div", { className: cn("absolute inset-0 z-0 bg-black/50 backdrop-blur-sm transition-opacity", overlayClassName), onClick: handleOverlayClick, "aria-hidden": "true" }), jsxs("div", { ref: contentRef, className: cn("relative transition-all z-10", "flex flex-col max-h-[90vh]", variant === "default" && "w-full bg-white rounded-large shadow-xl", variant === "default" && sizeConfig[size], contentClassName), children: [hasHeader && (jsxs("div", { className: cn("flex items-start justify-between gap-4", variant === "default" && "px-6 pt-6", variant === "default" && !description && "pb-4", variant === "default" && description && "pb-2", headerClassName), children: [jsxs("div", { className: "flex-1", children: [title && (jsx(Text, { as: "h2", variant: "body", size: "large", weight: "semibold", color: "default", children: title })), description && (jsx(Text, { as: "p", variant: "body", size: "small", weight: "regular", color: "subtle", className: "mt-1", children: description }))] }), showCloseButton && onClose && (jsx(IconButton, { icon: "close", onClick: onClose, color: "neutral", size: "small", "aria-label": "Close modal", className: "shrink-0" }))] })), !hasHeader && showCloseButton && onClose && (jsx("div", { className: cn("absolute z-10", variant === "default" && "top-4 right-4"), children: jsx(IconButton, { icon: "close", onClick: onClose, color: "neutral", size: "small", "aria-label": "Close modal" }) })), jsx("div", { className: cn("flex-1 overflow-y-auto", variant === "default" && "px-6", variant === "default" && hasHeader && "py-4", variant === "default" && !hasHeader && "pt-6 pb-4", variant === "default" && !footer && "pb-6", bodyClassName), children: children }), footer && (jsxs("div", { className: "flex flex-col", children: [variant === "default" && (jsx(Divider, { thickness: "thin", variant: "muted" })), jsx("div", { className: cn("flex items-center justify-end gap-3", variant === "default" && "px-6 py-4", footerClassName), children: footer })] }))] })] }));
|
|
3433
3343
|
});
|
|
3434
3344
|
Modal.displayName = "Modal";
|
|
3435
3345
|
|
|
@@ -4788,7 +4698,7 @@ const switchVariants = cva("relative inline-flex items-center shrink-0 cursor-po
|
|
|
4788
4698
|
false: "",
|
|
4789
4699
|
},
|
|
4790
4700
|
isDisabled: {
|
|
4791
|
-
true: "cursor-not-allowed
|
|
4701
|
+
true: "cursor-not-allowed opacity-60",
|
|
4792
4702
|
false: "",
|
|
4793
4703
|
},
|
|
4794
4704
|
isFocused: {
|
|
@@ -5224,12 +5134,11 @@ function AvatarCell({ name, initials, avatar, subtitle, color = "a1", className,
|
|
|
5224
5134
|
return (jsxs("div", { className: cn("flex items-center gap-3", className), children: [avatar ? (jsx("img", { src: avatar, alt: name, className: "w-10 h-10 rounded-full object-cover" })) : (jsx("div", { className: cn("w-10 h-10 rounded-full flex items-center justify-center text-body-medium-medium", `bg-${color}`), children: initials || name.charAt(0).toUpperCase() })), jsxs("div", { className: "flex flex-col", children: [jsx("div", { className: "text-body-medium-medium text-surface-ink-neutral-normal", children: name }), subtitle && (jsx("div", { className: "text-body-small-regular text-surface-ink-neutral-muted", children: subtitle }))] })] }));
|
|
5225
5135
|
}
|
|
5226
5136
|
|
|
5227
|
-
const tabItemVariants = cva(`inline-flex items-center justify-center gap-3 whitespace-nowrap transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 relative cursor-pointer`, {
|
|
5137
|
+
const tabItemVariants = cva(`inline-flex items-center justify-center gap-3 whitespace-nowrap transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 relative cursor-pointer -mb-[1.5px]`, {
|
|
5228
5138
|
variants: {
|
|
5229
5139
|
variant: {
|
|
5230
|
-
bordered: "border-b-[1.5px]
|
|
5231
|
-
borderless: "border-b-[1.5px]
|
|
5232
|
-
segmented: "rounded-lg",
|
|
5140
|
+
bordered: "border-b-[1.5px]",
|
|
5141
|
+
borderless: "border-b-[1.5px]",
|
|
5233
5142
|
},
|
|
5234
5143
|
size: {
|
|
5235
5144
|
small: "px-2 py-3 h-9",
|
|
@@ -5302,44 +5211,6 @@ const tabItemVariants = cva(`inline-flex items-center justify-center gap-3 white
|
|
|
5302
5211
|
isDisabled: true,
|
|
5303
5212
|
class: "text-text-body-disabled border-b-transparent",
|
|
5304
5213
|
},
|
|
5305
|
-
// Segmented variant - not selected
|
|
5306
|
-
{
|
|
5307
|
-
variant: "segmented",
|
|
5308
|
-
isSelected: false,
|
|
5309
|
-
isDisabled: false,
|
|
5310
|
-
class: `text-action-ink-neutral-muted
|
|
5311
|
-
hover:text-action-ink-neutral-subtle
|
|
5312
|
-
hover:bg-action-fill-neutral-faded-hover`,
|
|
5313
|
-
},
|
|
5314
|
-
// Segmented variant - selected
|
|
5315
|
-
{
|
|
5316
|
-
variant: "segmented",
|
|
5317
|
-
isSelected: true,
|
|
5318
|
-
isDisabled: false,
|
|
5319
|
-
class: "bg-action-fill-primary-faded text-action-ink-primary-subtle hover:text-action-ink-primary-normal",
|
|
5320
|
-
},
|
|
5321
|
-
// Segmented variant - disabled
|
|
5322
|
-
{
|
|
5323
|
-
variant: "segmented",
|
|
5324
|
-
isDisabled: true,
|
|
5325
|
-
class: "text-text-body-disabled bg-transparent",
|
|
5326
|
-
},
|
|
5327
|
-
// Segmented variant - size overrides (more compact)
|
|
5328
|
-
{
|
|
5329
|
-
variant: "segmented",
|
|
5330
|
-
size: "small",
|
|
5331
|
-
class: "px-3 py-1.5 h-auto! rounded-[4px]",
|
|
5332
|
-
},
|
|
5333
|
-
{
|
|
5334
|
-
variant: "segmented",
|
|
5335
|
-
size: "medium",
|
|
5336
|
-
class: "px-4 py-2 h-auto! rounded-[4px]",
|
|
5337
|
-
},
|
|
5338
|
-
{
|
|
5339
|
-
variant: "segmented",
|
|
5340
|
-
size: "large",
|
|
5341
|
-
class: "py-2 px-4 h-auto! rounded-[4px]",
|
|
5342
|
-
},
|
|
5343
5214
|
],
|
|
5344
5215
|
defaultVariants: {
|
|
5345
5216
|
variant: "bordered",
|
|
@@ -5375,11 +5246,9 @@ const Tabs = React.forwardRef(({ tabs, selectedTabId, defaultSelectedTabId, onTa
|
|
|
5375
5246
|
};
|
|
5376
5247
|
// Get the active tab content
|
|
5377
5248
|
const activeTab = tabs.find((tab) => tab.id === activeTabId);
|
|
5378
|
-
return (jsxs("div", { ref: ref, className: cn("w-full", className), ...props, children: [jsx("div", { role: "tablist", className: cn("inline-flex items-center", {
|
|
5249
|
+
return (jsxs("div", { ref: ref, className: cn("w-full", className), ...props, children: [jsx("div", { role: "tablist", className: cn("inline-flex items-center gap-4", {
|
|
5379
5250
|
"w-full": isFullWidth,
|
|
5380
|
-
"
|
|
5381
|
-
"border-b-[1.5px] border-surface-outline-neutral-muted": variant === "bordered",
|
|
5382
|
-
"gap-1 p-1 rounded-xl bg-surface-background-neutral-faded-default": variant === "segmented",
|
|
5251
|
+
"border-b border-b-[1.5px] border-surface-outline-neutral-muted": variant === "bordered",
|
|
5383
5252
|
}, tabListClassName), children: tabs.map((tab) => (jsx(TabItem, { id: String(tab.id), leadingComponent: tab.leadingComponent, title: tab.title, trailingComponent: tab.trailingComponent, isSelected: tab.id === activeTabId, isDisabled: tab.isDisabled, variant: variant, size: size, isFullWidth: isFullWidth, onClick: () => !tab.isDisabled && handleTabClick(tab.id) }, tab.id))) }), renderContent && activeTab?.content && (jsx("div", { role: "tabpanel", className: cn("mt-4", contentClassName), "aria-labelledby": String(activeTabId), children: activeTab.content }))] }));
|
|
5384
5253
|
});
|
|
5385
5254
|
Tabs.displayName = "Tabs";
|
|
@@ -6163,5 +6032,5 @@ const UploadBox = React.forwardRef(({ label, helperText, errorText, successText,
|
|
|
6163
6032
|
});
|
|
6164
6033
|
UploadBox.displayName = "UploadBox";
|
|
6165
6034
|
|
|
6166
|
-
export { Alert, Amount, Avatar, AvatarCell, Badge, Button, ButtonGroup, Checkbox,
|
|
6035
|
+
export { Alert, Amount, Avatar, AvatarCell, Badge, BottomSheet, Button, ButtonGroup, Checkbox, Counter, DatePicker, DateRangePicker, Divider, Dropdown, DropdownMenu, FormFooter, FormHeader, Icon, IconButton, IconCell, Link, ListItem, Modal, NumberCell, Pagination, Radio, RadioGroup, SearchableDropdown, Select, SelectTextField, SidePanel, Skeleton, SlotCell, SpacerCell, Switch, TabItem, Table, TableDetailPanel, Tabs, Text, TextArea, TextField, Toast, ToastProvider, Tooltip, UploadBox, alertVariants, avatarVariants, badgeVariants, buttonGroupVariants, buttonVariants, checkboxVariants, cn, counterVariants, datePickerVariants, dateRangePickerVariants, dropdownVariants, getAvailableIcons, hasIcon, iconButtonVariants, iconRegistry, linkVariants, listItemVariants, paginationVariants, radioVariants, selectTriggerVariants, switchVariants, tableCellVariants, tableHeaderVariants, tableVariants, textAreaVariants, textFieldVariants, tooltipVariants, uploadBoxVariants, useToast };
|
|
6167
6036
|
//# sourceMappingURL=index.esm.js.map
|