@exem-ui/react 0.3.4-next.20260902003121 → 0.3.4-next.20260903042316

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/index.mjs CHANGED
@@ -11,7 +11,8 @@ import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
11
11
  import * as SwitchPrimitives from '@radix-ui/react-switch';
12
12
  import { DayPicker } from 'react-day-picker';
13
13
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
14
- import * as DialogPrimitive from '@radix-ui/react-dialog';
14
+ import { Dialog } from '@base-ui/react/dialog';
15
+ import * as DialogPrimitive2 from '@radix-ui/react-dialog';
15
16
  import { Resizable } from 're-resizable';
16
17
  import { Progress as Progress$1 } from '@base-ui/react/progress';
17
18
  import { toast as toast$1, Toaster as Toaster$1 } from 'sonner';
@@ -1432,113 +1433,76 @@ TextField.displayName = "TextField";
1432
1433
  TextField.Label.displayName = "TextField.Label";
1433
1434
  TextField.Input.displayName = "TextField.Input";
1434
1435
  TextField.Description.displayName = "TextField.Description";
1435
-
1436
- // src/hooks/useOverlayDismissGuard.ts
1437
- var isBaseUiPopupOpen = () => Boolean(
1438
- document.querySelector('[data-base-ui-portal] [data-slot="combobox-content"][data-open]')
1439
- );
1440
- var isTargetInsideBaseUiPopup = (target) => target instanceof Element && Boolean(target.closest("[data-base-ui-portal]"));
1441
- var shouldPreventDismissForSelect = (target) => {
1442
- const isSelectOpen = Boolean(
1443
- document.querySelector('[data-radix-select-content][data-state="open"]')
1444
- );
1445
- if (isSelectOpen) {
1446
- return true;
1447
- }
1448
- if (!(target instanceof Element)) {
1449
- return false;
1450
- }
1451
- return Boolean(
1452
- target.closest("[data-radix-select-content]") || target.closest("[data-radix-select-viewport]")
1453
- );
1454
- };
1455
- function useOverlayDismissGuard({
1456
- onInteractOutside,
1457
- onEscapeKeyDown
1458
- }) {
1459
- const handleInteractOutside = (event) => {
1460
- if (shouldPreventDismissForSelect(event.target) || isTargetInsideBaseUiPopup(event.target)) {
1461
- event.preventDefault();
1462
- }
1463
- onInteractOutside?.(event);
1464
- };
1465
- const handleEscapeKeyDown = (event) => {
1466
- if (isBaseUiPopupOpen()) {
1467
- event.preventDefault();
1468
- }
1469
- onEscapeKeyDown?.(event);
1470
- };
1471
- return { onEscapeKeyDown: handleEscapeKeyDown, onInteractOutside: handleInteractOutside };
1472
- }
1473
1436
  var MODAL_PADDING = {
1474
1437
  body: "px-4 pb-4",
1475
1438
  footer: "px-4 py-3"
1476
1439
  };
1440
+ var MODAL_TRANSITION = "transition-[transform,scale,opacity] duration-200 data-[starting-style]:opacity-0 data-[ending-style]:opacity-0";
1477
1441
  var ModalContext = createContext({ size: "default" });
1478
- var ModalRoot = (props) => /* @__PURE__ */ jsx(DialogPrimitive.Root, { ...props });
1479
- var Modal = ModalRoot;
1480
- Modal.Trigger = forwardRef(
1481
- (props, ref) => /* @__PURE__ */ jsx(DialogPrimitive.Trigger, { ref, ...props })
1482
- );
1483
- Modal.Portal = (props) => /* @__PURE__ */ jsx(DialogPrimitive.Portal, { ...props });
1484
- Modal.Close = forwardRef(({ size, ...props }, ref) => {
1485
- const { size: modalSize } = useContext(ModalContext);
1486
- return /* @__PURE__ */ jsx(DialogPrimitive.Close, { asChild: true, children: /* @__PURE__ */ jsx(
1487
- Button,
1488
- {
1489
- ...props,
1490
- ref,
1491
- variant: "assistive",
1492
- size: size ?? (modalSize === "fullsize" ? "large" : "medium")
1493
- }
1494
- ) });
1495
- });
1496
- Modal.Overlay = forwardRef(
1497
- ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1498
- DialogPrimitive.Overlay,
1442
+ function ModalRoot(props) {
1443
+ return /* @__PURE__ */ jsx(Dialog.Root, { ...props });
1444
+ }
1445
+ function ModalTrigger(props) {
1446
+ return /* @__PURE__ */ jsx(Dialog.Trigger, { "data-slot": "modal-trigger", ...props });
1447
+ }
1448
+ function ModalPortal(props) {
1449
+ return /* @__PURE__ */ jsx(Dialog.Portal, { ...props });
1450
+ }
1451
+ function ModalOverlay({ className, ...props }) {
1452
+ return /* @__PURE__ */ jsx(
1453
+ Dialog.Backdrop,
1499
1454
  {
1500
- ref,
1501
- className: cn(
1502
- "fixed inset-0 z-50 bg-component-dim data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
1503
- className
1504
- ),
1455
+ "data-slot": "modal-overlay",
1456
+ className: cn("fixed inset-0 z-50 bg-component-dim", MODAL_TRANSITION, className),
1505
1457
  ...props
1506
1458
  }
1507
- )
1508
- );
1509
- Modal.Content = forwardRef(
1510
- ({ className, children, size = "default", onInteractOutside, onEscapeKeyDown, ...props }, ref) => {
1511
- const isFullSize = size === "fullsize";
1512
- const dismissGuard = useOverlayDismissGuard({ onEscapeKeyDown, onInteractOutside });
1513
- return /* @__PURE__ */ jsx(ModalContext.Provider, { value: { size }, children: /* @__PURE__ */ jsxs(Modal.Portal, { children: [
1514
- /* @__PURE__ */ jsx(Modal.Overlay, {}),
1515
- /* @__PURE__ */ jsx(
1516
- DialogPrimitive.Content,
1459
+ );
1460
+ }
1461
+ function ModalClose({ size, ...props }) {
1462
+ const { size: modalSize } = useContext(ModalContext);
1463
+ return /* @__PURE__ */ jsx(
1464
+ Dialog.Close,
1465
+ {
1466
+ render: /* @__PURE__ */ jsx(
1467
+ Button,
1517
1468
  {
1518
- ref,
1519
- className: cn(
1520
- // 공통 스타일
1521
- "fixed z-50 flex flex-col rounded-strong border border-border-primary bg-background-primary duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
1522
- // fullsize일 때
1523
- isFullSize ? "inset-0 m-10" : (
1524
- // 일반 모달일 때
1525
- "left-[50%] top-[50%] max-w-[calc(100vw-32px)] max-h-[calc(100vh-80px)] w-[800px] h-[560px] translate-x-[-50%] translate-y-[-50%] shadow-strong data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]"
1526
- ),
1527
- className
1528
- ),
1529
1469
  ...props,
1530
- ...dismissGuard,
1531
- children
1470
+ variant: "assistive",
1471
+ size: size ?? (modalSize === "fullsize" ? "large" : "medium")
1532
1472
  }
1533
1473
  )
1534
- ] }) });
1535
- }
1536
- );
1537
- Modal.Header = forwardRef(
1538
- ({ className, line = false, rightSlot, children, ...props }, ref) => /* @__PURE__ */ jsxs(
1474
+ }
1475
+ );
1476
+ }
1477
+ function ModalContent({ className, children, size = "default", ...props }) {
1478
+ const isFullSize = size === "fullsize";
1479
+ return /* @__PURE__ */ jsx(ModalContext.Provider, { value: { size }, children: /* @__PURE__ */ jsxs(ModalPortal, { children: [
1480
+ /* @__PURE__ */ jsx(ModalOverlay, {}),
1481
+ /* @__PURE__ */ jsx(
1482
+ Dialog.Popup,
1483
+ {
1484
+ "data-slot": "modal-content",
1485
+ className: cn(
1486
+ // 공통 스타일
1487
+ "fixed z-50 flex flex-col rounded-strong border border-border-primary bg-background-primary",
1488
+ MODAL_TRANSITION,
1489
+ isFullSize ? "inset-0 m-10" : (
1490
+ // 콘텐츠 높이를 따르되 뷰포트를 넘지 않는다. 넘치면 Body만 스크롤된다.
1491
+ "left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-[800px] max-w-[calc(100vw-80px)] max-h-[calc(100vh-80px)] shadow-strong data-[starting-style]:scale-95 data-[ending-style]:scale-95"
1492
+ ),
1493
+ className
1494
+ ),
1495
+ ...props,
1496
+ children
1497
+ }
1498
+ )
1499
+ ] }) });
1500
+ }
1501
+ function ModalHeader({ className, line = false, rightSlot, children, ...props }) {
1502
+ return /* @__PURE__ */ jsxs(
1539
1503
  "div",
1540
1504
  {
1541
- ref,
1505
+ "data-slot": "modal-header",
1542
1506
  className: cn(
1543
1507
  "flex shrink-0 flex-row items-center gap-2 pl-4 pr-2 min-h-12",
1544
1508
  line && "border-b border-border-primary",
@@ -1548,8 +1512,9 @@ Modal.Header = forwardRef(
1548
1512
  children: [
1549
1513
  /* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-row items-center gap-1", children }),
1550
1514
  rightSlot === void 0 ? /* @__PURE__ */ jsx(
1551
- DialogPrimitive.Close,
1515
+ Dialog.Close,
1552
1516
  {
1517
+ "data-slot": "modal-close-icon",
1553
1518
  className: cn(
1554
1519
  "flex shrink-0 items-center justify-center size-8 rounded-medium text-icon-secondary transition-colors hover:bg-elevation-elevation-2 focus:outline-none disabled:pointer-events-none"
1555
1520
  ),
@@ -1558,42 +1523,57 @@ Modal.Header = forwardRef(
1558
1523
  ) : rightSlot
1559
1524
  ]
1560
1525
  }
1561
- )
1562
- );
1563
- Modal.Body = forwardRef(
1564
- ({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
1526
+ );
1527
+ }
1528
+ function ModalBody({
1529
+ className,
1530
+ children,
1531
+ scroll = true,
1532
+ horizontalScroll = false,
1533
+ ...props
1534
+ }) {
1535
+ const content = /* @__PURE__ */ jsx("div", { className: cn(MODAL_PADDING.body, className), children });
1536
+ return /* @__PURE__ */ jsx(
1565
1537
  "div",
1566
1538
  {
1567
- ref,
1539
+ "data-slot": "modal-body",
1568
1540
  className: cn(
1569
- "flex-1 flex flex-col min-h-0 h-full",
1570
- "[&_[data-slot=scroll-area-viewport]>div]:h-full"
1541
+ "flex-1 flex flex-col min-h-0",
1542
+ scroll && "h-full [&_[data-slot=scroll-area-viewport]>div]:h-full"
1571
1543
  ),
1572
1544
  ...props,
1573
- children: /* @__PURE__ */ jsx(ScrollArea, { className: "h-full flex flex-col", children: /* @__PURE__ */ jsx("div", { className: cn(MODAL_PADDING.body, className), children }) })
1545
+ children: scroll ? /* @__PURE__ */ jsx(ScrollArea, { className: "h-full flex flex-col", disableHorizontalScroll: !horizontalScroll, children: content }) : content
1574
1546
  }
1575
- )
1576
- );
1577
- Modal.Footer = forwardRef(
1578
- ({ className, line = true, ...props }, ref) => /* @__PURE__ */ jsx(
1547
+ );
1548
+ }
1549
+ function ModalFooter({ className, line = true, ...props }) {
1550
+ const { size } = useContext(ModalContext);
1551
+ return /* @__PURE__ */ jsx(
1579
1552
  "div",
1580
1553
  {
1581
- ref,
1554
+ "data-slot": "modal-footer",
1582
1555
  className: cn(
1583
- "flex flex-row items-center justify-between min-h-14 gap-3",
1556
+ "flex flex-row items-center justify-between gap-3",
1557
+ size === "fullsize" ? "min-h-16" : "min-h-14",
1584
1558
  line && "border-t border-border-primary",
1585
1559
  MODAL_PADDING.footer,
1586
1560
  className
1587
1561
  ),
1588
1562
  ...props
1589
1563
  }
1590
- )
1591
- );
1592
- Modal.FooterDescription = forwardRef(
1593
- ({ className, error = false, icon, children, ...props }, ref) => /* @__PURE__ */ jsxs(
1564
+ );
1565
+ }
1566
+ function ModalFooterDescription({
1567
+ className,
1568
+ error = false,
1569
+ icon,
1570
+ children,
1571
+ ...props
1572
+ }) {
1573
+ return /* @__PURE__ */ jsxs(
1594
1574
  "div",
1595
1575
  {
1596
- ref,
1576
+ "data-slot": "modal-footer-description",
1597
1577
  className: cn(
1598
1578
  "flex flex-row items-center gap-1 text-body-3",
1599
1579
  error ? "text-text-critical" : "text-text-tertiary",
@@ -1605,59 +1585,125 @@ Modal.FooterDescription = forwardRef(
1605
1585
  children
1606
1586
  ]
1607
1587
  }
1608
- )
1609
- );
1610
- Modal.Actions = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("ml-auto flex flex-row items-center gap-2", className), ...props }));
1611
- Modal.Action = forwardRef(
1612
- ({ color = "primary", size, ...props }, ref) => {
1613
- const { size: modalSize } = useContext(ModalContext);
1614
- return /* @__PURE__ */ jsx(DialogPrimitive.Close, { asChild: true, children: /* @__PURE__ */ jsx(
1615
- Button,
1616
- {
1617
- ...props,
1618
- ref,
1619
- color,
1620
- variant: "solid",
1621
- size: size ?? (modalSize === "fullsize" ? "large" : "medium")
1622
- }
1623
- ) });
1624
- }
1625
- );
1626
- Modal.Title = forwardRef(
1627
- ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1628
- DialogPrimitive.Title,
1588
+ );
1589
+ }
1590
+ function ModalActions({ className, ...props }) {
1591
+ return /* @__PURE__ */ jsx(
1592
+ "div",
1629
1593
  {
1630
- ref,
1594
+ "data-slot": "modal-actions",
1595
+ className: cn("ml-auto flex flex-row items-center gap-2", className),
1596
+ ...props
1597
+ }
1598
+ );
1599
+ }
1600
+ function ModalAction({ color = "primary", size, ...props }) {
1601
+ const { size: modalSize } = useContext(ModalContext);
1602
+ return /* @__PURE__ */ jsx(
1603
+ Dialog.Close,
1604
+ {
1605
+ render: /* @__PURE__ */ jsx(
1606
+ Button,
1607
+ {
1608
+ ...props,
1609
+ color,
1610
+ variant: "solid",
1611
+ size: size ?? (modalSize === "fullsize" ? "large" : "medium")
1612
+ }
1613
+ )
1614
+ }
1615
+ );
1616
+ }
1617
+ function ModalTitle({ className, ...props }) {
1618
+ return /* @__PURE__ */ jsx(
1619
+ Dialog.Title,
1620
+ {
1621
+ "data-slot": "modal-title",
1631
1622
  className: cn(
1632
1623
  "text-body-1 font-semibold leading-none tracking-tight text-text-primary",
1633
1624
  className
1634
1625
  ),
1635
1626
  ...props
1636
1627
  }
1637
- )
1628
+ );
1629
+ }
1630
+ function ModalDescription({ className, ...props }) {
1631
+ return /* @__PURE__ */ jsx(
1632
+ Dialog.Description,
1633
+ {
1634
+ "data-slot": "modal-description",
1635
+ className: cn("text-body-2 text-text-tertiary", className),
1636
+ ...props
1637
+ }
1638
+ );
1639
+ }
1640
+ ModalRoot.displayName = "Modal";
1641
+ ModalTrigger.displayName = "Modal.Trigger";
1642
+ ModalPortal.displayName = "Modal.Portal";
1643
+ ModalClose.displayName = "Modal.Close";
1644
+ ModalOverlay.displayName = "Modal.Overlay";
1645
+ ModalContent.displayName = "Modal.Content";
1646
+ ModalHeader.displayName = "Modal.Header";
1647
+ ModalBody.displayName = "Modal.Body";
1648
+ ModalFooter.displayName = "Modal.Footer";
1649
+ ModalFooterDescription.displayName = "Modal.FooterDescription";
1650
+ ModalActions.displayName = "Modal.Actions";
1651
+ ModalAction.displayName = "Modal.Action";
1652
+ ModalTitle.displayName = "Modal.Title";
1653
+ ModalDescription.displayName = "Modal.Description";
1654
+ var Modal = Object.assign(ModalRoot, {
1655
+ Trigger: ModalTrigger,
1656
+ Portal: ModalPortal,
1657
+ Close: ModalClose,
1658
+ Overlay: ModalOverlay,
1659
+ Content: ModalContent,
1660
+ Header: ModalHeader,
1661
+ Body: ModalBody,
1662
+ Footer: ModalFooter,
1663
+ FooterDescription: ModalFooterDescription,
1664
+ Actions: ModalActions,
1665
+ Action: ModalAction,
1666
+ Title: ModalTitle,
1667
+ Description: ModalDescription
1668
+ });
1669
+
1670
+ // src/hooks/useOverlayDismissGuard.ts
1671
+ var isBaseUiPopupOpen = () => Boolean(
1672
+ document.querySelector('[data-base-ui-portal] [data-slot="combobox-content"][data-open]')
1638
1673
  );
1639
- Modal.Description = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1640
- DialogPrimitive.Description,
1641
- {
1642
- ref,
1643
- className: cn("text-body-2 text-text-tertiary", className),
1644
- ...props
1674
+ var isTargetInsideBaseUiPopup = (target) => target instanceof Element && Boolean(target.closest("[data-base-ui-portal]"));
1675
+ var shouldPreventDismissForSelect = (target) => {
1676
+ const isSelectOpen = Boolean(
1677
+ document.querySelector('[data-radix-select-content][data-state="open"]')
1678
+ );
1679
+ if (isSelectOpen) {
1680
+ return true;
1645
1681
  }
1646
- ));
1647
- Modal.displayName = "Modal";
1648
- Modal.Trigger.displayName = "Modal.Trigger";
1649
- Modal.Portal.displayName = "Modal.Portal";
1650
- Modal.Close.displayName = "Modal.Close";
1651
- Modal.Overlay.displayName = "Modal.Overlay";
1652
- Modal.Content.displayName = "Modal.Content";
1653
- Modal.Header.displayName = "Modal.Header";
1654
- Modal.Body.displayName = "Modal.Body";
1655
- Modal.Footer.displayName = "Modal.Footer";
1656
- Modal.FooterDescription.displayName = "Modal.FooterDescription";
1657
- Modal.Actions.displayName = "Modal.Actions";
1658
- Modal.Action.displayName = "Modal.Action";
1659
- Modal.Title.displayName = "Modal.Title";
1660
- Modal.Description.displayName = "Modal.Description";
1682
+ if (!(target instanceof Element)) {
1683
+ return false;
1684
+ }
1685
+ return Boolean(
1686
+ target.closest("[data-radix-select-content]") || target.closest("[data-radix-select-viewport]")
1687
+ );
1688
+ };
1689
+ function useOverlayDismissGuard({
1690
+ onInteractOutside,
1691
+ onEscapeKeyDown
1692
+ }) {
1693
+ const handleInteractOutside = (event) => {
1694
+ if (shouldPreventDismissForSelect(event.target) || isTargetInsideBaseUiPopup(event.target)) {
1695
+ event.preventDefault();
1696
+ }
1697
+ onInteractOutside?.(event);
1698
+ };
1699
+ const handleEscapeKeyDown = (event) => {
1700
+ if (isBaseUiPopupOpen()) {
1701
+ event.preventDefault();
1702
+ }
1703
+ onEscapeKeyDown?.(event);
1704
+ };
1705
+ return { onEscapeKeyDown: handleEscapeKeyDown, onInteractOutside: handleInteractOutside };
1706
+ }
1661
1707
 
1662
1708
  // src/sheet/sheetResize.ts
1663
1709
  var SHEET_EDGE_GAP = "[--sheet-edge-gap:40px]";
@@ -1784,18 +1830,18 @@ var SHEET_RESIZE_SIDE_CLASSES = {
1784
1830
  bottom: "inset-x-0 bottom-0 max-h-[calc(100vh-var(--sheet-edge-gap))] data-[state=open]:slide-in-from-bottom data-[state=closed]:slide-out-to-bottom"
1785
1831
  };
1786
1832
  var SheetContext = createContext({ side: "right" });
1787
- var SheetRoot = (props) => /* @__PURE__ */ jsx(DialogPrimitive.Root, { ...props });
1833
+ var SheetRoot = (props) => /* @__PURE__ */ jsx(DialogPrimitive2.Root, { ...props });
1788
1834
  var Sheet = SheetRoot;
1789
1835
  Sheet.Trigger = forwardRef(
1790
- (props, ref) => /* @__PURE__ */ jsx(DialogPrimitive.Trigger, { ref, ...props })
1836
+ (props, ref) => /* @__PURE__ */ jsx(DialogPrimitive2.Trigger, { ref, ...props })
1791
1837
  );
1792
- Sheet.Portal = (props) => /* @__PURE__ */ jsx(DialogPrimitive.Portal, { ...props });
1838
+ Sheet.Portal = (props) => /* @__PURE__ */ jsx(DialogPrimitive2.Portal, { ...props });
1793
1839
  Sheet.Close = forwardRef(
1794
- (props, ref) => /* @__PURE__ */ jsx(DialogPrimitive.Close, { ref, ...props })
1840
+ (props, ref) => /* @__PURE__ */ jsx(DialogPrimitive2.Close, { ref, ...props })
1795
1841
  );
1796
1842
  Sheet.Overlay = forwardRef(
1797
1843
  ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1798
- DialogPrimitive.Overlay,
1844
+ DialogPrimitive2.Overlay,
1799
1845
  {
1800
1846
  ref,
1801
1847
  className: cn(
@@ -1822,7 +1868,7 @@ Sheet.Content = forwardRef(
1822
1868
  return /* @__PURE__ */ jsx(SheetContext.Provider, { value: { side }, children: /* @__PURE__ */ jsxs(Sheet.Portal, { children: [
1823
1869
  /* @__PURE__ */ jsx(Sheet.Overlay, {}),
1824
1870
  /* @__PURE__ */ jsx(
1825
- DialogPrimitive.Content,
1871
+ DialogPrimitive2.Content,
1826
1872
  {
1827
1873
  ref,
1828
1874
  className: cn(
@@ -1842,7 +1888,7 @@ Sheet.Content = forwardRef(
1842
1888
  Sheet.Header = forwardRef(
1843
1889
  ({ className, line = true, rightSlot, children, ...props }, ref) => {
1844
1890
  const rightElement = rightSlot === void 0 ? /* @__PURE__ */ jsx(
1845
- DialogPrimitive.Close,
1891
+ DialogPrimitive2.Close,
1846
1892
  {
1847
1893
  className: cn(
1848
1894
  "flex shrink-0 items-center justify-center size-8 rounded-medium text-icon-secondary transition-colors hover:bg-elevation-elevation-2 focus:outline-none disabled:pointer-events-none"
@@ -1928,7 +1974,7 @@ Sheet.FooterDescription = forwardRef(
1928
1974
  Sheet.Actions = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("ml-auto flex flex-row items-center gap-2", className), ...props }));
1929
1975
  Sheet.Title = forwardRef(
1930
1976
  ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1931
- DialogPrimitive.Title,
1977
+ DialogPrimitive2.Title,
1932
1978
  {
1933
1979
  ref,
1934
1980
  className: cn(
@@ -1940,7 +1986,7 @@ Sheet.Title = forwardRef(
1940
1986
  )
1941
1987
  );
1942
1988
  Sheet.Description = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1943
- DialogPrimitive.Description,
1989
+ DialogPrimitive2.Description,
1944
1990
  {
1945
1991
  ref,
1946
1992
  className: cn("text-body-2 text-text-tertiary", className),
@@ -1960,77 +2006,111 @@ Sheet.FooterDescription.displayName = "Sheet.FooterDescription";
1960
2006
  Sheet.Actions.displayName = "Sheet.Actions";
1961
2007
  Sheet.Title.displayName = "Sheet.Title";
1962
2008
  Sheet.Description.displayName = "Sheet.Description";
2009
+ var MESSAGE_BOX_TRANSITION = "transition-[transform,scale,opacity] duration-200 data-[starting-style]:opacity-0 data-[ending-style]:opacity-0";
1963
2010
  var MessageBoxContext = createContext({ variant: "default" });
1964
- var MessageBoxRoot = (props) => /* @__PURE__ */ jsx(DialogPrimitive.Root, { ...props });
1965
- var MessageBox = MessageBoxRoot;
1966
- MessageBox.Trigger = forwardRef((props, ref) => /* @__PURE__ */ jsx(DialogPrimitive.Trigger, { ref, ...props }));
1967
- MessageBox.Content = forwardRef(({ className, children, variant = "default", ...props }, ref) => /* @__PURE__ */ jsx(MessageBoxContext.Provider, { value: { variant }, children: /* @__PURE__ */ jsxs(DialogPrimitive.Portal, { children: [
1968
- /* @__PURE__ */ jsx(
1969
- DialogPrimitive.Overlay,
2011
+ function MessageBoxRoot(props) {
2012
+ return /* @__PURE__ */ jsx(Dialog.Root, { ...props });
2013
+ }
2014
+ function MessageBoxTrigger(props) {
2015
+ return /* @__PURE__ */ jsx(Dialog.Trigger, { "data-slot": "message-box-trigger", ...props });
2016
+ }
2017
+ function MessageBoxContent({
2018
+ className,
2019
+ children,
2020
+ variant = "default",
2021
+ ...props
2022
+ }) {
2023
+ return /* @__PURE__ */ jsx(MessageBoxContext.Provider, { value: { variant }, children: /* @__PURE__ */ jsxs(Dialog.Portal, { children: [
2024
+ /* @__PURE__ */ jsx(
2025
+ Dialog.Backdrop,
2026
+ {
2027
+ "data-slot": "message-box-overlay",
2028
+ className: cn("fixed inset-0 z-50 bg-component-dim", MESSAGE_BOX_TRANSITION)
2029
+ }
2030
+ ),
2031
+ /* @__PURE__ */ jsx(
2032
+ Dialog.Popup,
2033
+ {
2034
+ "data-slot": "message-box-content",
2035
+ className: cn(
2036
+ "fixed left-1/2 top-1/2 z-50 flex w-[400px] -translate-x-1/2 -translate-y-1/2 flex-col items-end gap-4 rounded-medium border border-border-primary bg-elevation-elevation-0 p-4 shadow-strong",
2037
+ MESSAGE_BOX_TRANSITION,
2038
+ "data-[starting-style]:scale-95 data-[ending-style]:scale-95",
2039
+ className
2040
+ ),
2041
+ ...props,
2042
+ children
2043
+ }
2044
+ )
2045
+ ] }) });
2046
+ }
2047
+ function MessageBoxTitle({ className, ...props }) {
2048
+ return /* @__PURE__ */ jsx(
2049
+ Dialog.Title,
1970
2050
  {
1971
- className: cn(
1972
- "fixed inset-0 z-50 bg-component-dim data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"
1973
- )
2051
+ "data-slot": "message-box-title",
2052
+ className: cn("w-full text-body-1 font-semibold text-text-primary", className),
2053
+ ...props
1974
2054
  }
1975
- ),
1976
- /* @__PURE__ */ jsx(
1977
- DialogPrimitive.Content,
2055
+ );
2056
+ }
2057
+ function MessageBoxDescription({ className, ...props }) {
2058
+ return /* @__PURE__ */ jsx(
2059
+ Dialog.Description,
1978
2060
  {
1979
- ref,
1980
- className: cn(
1981
- "fixed left-[50%] top-[50%] z-50 flex w-[400px] translate-x-[-50%] translate-y-[-50%] flex-col items-end gap-4 rounded-medium border border-border-primary bg-elevation-elevation-0 p-4 shadow-strong duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",
1982
- className
1983
- ),
1984
- ...props,
1985
- children
2061
+ "data-slot": "message-box-description",
2062
+ className: cn("w-full text-body-2 text-text-secondary", className),
2063
+ ...props
1986
2064
  }
1987
- )
1988
- ] }) }));
1989
- MessageBox.Title = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1990
- DialogPrimitive.Title,
1991
- {
1992
- ref,
1993
- className: cn("w-full text-body-1 font-semibold text-text-primary", className),
1994
- ...props
1995
- }
1996
- ));
1997
- MessageBox.Description = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1998
- DialogPrimitive.Description,
1999
- {
2000
- ref,
2001
- className: cn("w-full text-body-2 text-text-secondary", className),
2002
- ...props
2003
- }
2004
- ));
2005
- MessageBox.Actions = forwardRef(
2006
- ({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("flex flex-row gap-2", className), ...props })
2007
- );
2008
- MessageBox.Cancel = forwardRef(
2009
- ({ size = "medium", ...props }, ref) => /* @__PURE__ */ jsx(DialogPrimitive.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { ref, variant: "assistive", size, ...props }) })
2010
- );
2011
- MessageBox.Action = forwardRef(
2012
- ({ size = "medium", ...props }, ref) => {
2013
- const { variant } = useContext(MessageBoxContext);
2014
- return /* @__PURE__ */ jsx(DialogPrimitive.Close, { asChild: true, children: /* @__PURE__ */ jsx(
2015
- Button,
2016
- {
2017
- ref,
2018
- color: variant === "critical" ? "critical" : "primary",
2019
- variant: "solid",
2020
- size,
2021
- ...props
2022
- }
2023
- ) });
2024
- }
2025
- );
2026
- MessageBox.displayName = "MessageBox";
2027
- MessageBox.Trigger.displayName = "MessageBox.Trigger";
2028
- MessageBox.Content.displayName = "MessageBox.Content";
2029
- MessageBox.Title.displayName = "MessageBox.Title";
2030
- MessageBox.Description.displayName = "MessageBox.Description";
2031
- MessageBox.Actions.displayName = "MessageBox.Actions";
2032
- MessageBox.Cancel.displayName = "MessageBox.Cancel";
2033
- MessageBox.Action.displayName = "MessageBox.Action";
2065
+ );
2066
+ }
2067
+ function MessageBoxActions({ className, ...props }) {
2068
+ return /* @__PURE__ */ jsx(
2069
+ "div",
2070
+ {
2071
+ "data-slot": "message-box-actions",
2072
+ className: cn("flex flex-row gap-2", className),
2073
+ ...props
2074
+ }
2075
+ );
2076
+ }
2077
+ function MessageBoxCancel({ size = "medium", ...props }) {
2078
+ return /* @__PURE__ */ jsx(Dialog.Close, { render: /* @__PURE__ */ jsx(Button, { ...props, variant: "assistive", size }) });
2079
+ }
2080
+ function MessageBoxAction({ size = "medium", ...props }) {
2081
+ const { variant } = useContext(MessageBoxContext);
2082
+ return /* @__PURE__ */ jsx(
2083
+ Dialog.Close,
2084
+ {
2085
+ render: /* @__PURE__ */ jsx(
2086
+ Button,
2087
+ {
2088
+ ...props,
2089
+ color: variant === "critical" ? "critical" : "primary",
2090
+ variant: "solid",
2091
+ size
2092
+ }
2093
+ )
2094
+ }
2095
+ );
2096
+ }
2097
+ MessageBoxRoot.displayName = "MessageBox";
2098
+ MessageBoxTrigger.displayName = "MessageBox.Trigger";
2099
+ MessageBoxContent.displayName = "MessageBox.Content";
2100
+ MessageBoxTitle.displayName = "MessageBox.Title";
2101
+ MessageBoxDescription.displayName = "MessageBox.Description";
2102
+ MessageBoxActions.displayName = "MessageBox.Actions";
2103
+ MessageBoxCancel.displayName = "MessageBox.Cancel";
2104
+ MessageBoxAction.displayName = "MessageBox.Action";
2105
+ var MessageBox = Object.assign(MessageBoxRoot, {
2106
+ Trigger: MessageBoxTrigger,
2107
+ Content: MessageBoxContent,
2108
+ Title: MessageBoxTitle,
2109
+ Description: MessageBoxDescription,
2110
+ Actions: MessageBoxActions,
2111
+ Cancel: MessageBoxCancel,
2112
+ Action: MessageBoxAction
2113
+ });
2034
2114
  var containerVariants4 = cva("inset-0 z-[49] flex items-center justify-center", {
2035
2115
  variants: {
2036
2116
  position: {