@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.d.mts +195 -46
- package/dist/index.d.ts +195 -46
- package/dist/index.js +314 -234
- package/dist/index.mjs +313 -233
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -11,7 +11,8 @@ var RadioGroupPrimitive = require('@radix-ui/react-radio-group');
|
|
|
11
11
|
var SwitchPrimitives = require('@radix-ui/react-switch');
|
|
12
12
|
var reactDayPicker = require('react-day-picker');
|
|
13
13
|
var DropdownMenuPrimitive = require('@radix-ui/react-dropdown-menu');
|
|
14
|
-
var
|
|
14
|
+
var dialog = require('@base-ui/react/dialog');
|
|
15
|
+
var DialogPrimitive2 = require('@radix-ui/react-dialog');
|
|
15
16
|
var reResizable = require('re-resizable');
|
|
16
17
|
var progress = require('@base-ui/react/progress');
|
|
17
18
|
var sonner = require('sonner');
|
|
@@ -39,7 +40,7 @@ var CheckboxPrimitive__namespace = /*#__PURE__*/_interopNamespace(CheckboxPrimit
|
|
|
39
40
|
var RadioGroupPrimitive__namespace = /*#__PURE__*/_interopNamespace(RadioGroupPrimitive);
|
|
40
41
|
var SwitchPrimitives__namespace = /*#__PURE__*/_interopNamespace(SwitchPrimitives);
|
|
41
42
|
var DropdownMenuPrimitive__namespace = /*#__PURE__*/_interopNamespace(DropdownMenuPrimitive);
|
|
42
|
-
var
|
|
43
|
+
var DialogPrimitive2__namespace = /*#__PURE__*/_interopNamespace(DialogPrimitive2);
|
|
43
44
|
|
|
44
45
|
var SIZE_CONFIG = {
|
|
45
46
|
xsmall: {
|
|
@@ -1457,113 +1458,76 @@ TextField.displayName = "TextField";
|
|
|
1457
1458
|
TextField.Label.displayName = "TextField.Label";
|
|
1458
1459
|
TextField.Input.displayName = "TextField.Input";
|
|
1459
1460
|
TextField.Description.displayName = "TextField.Description";
|
|
1460
|
-
|
|
1461
|
-
// src/hooks/useOverlayDismissGuard.ts
|
|
1462
|
-
var isBaseUiPopupOpen = () => Boolean(
|
|
1463
|
-
document.querySelector('[data-base-ui-portal] [data-slot="combobox-content"][data-open]')
|
|
1464
|
-
);
|
|
1465
|
-
var isTargetInsideBaseUiPopup = (target) => target instanceof Element && Boolean(target.closest("[data-base-ui-portal]"));
|
|
1466
|
-
var shouldPreventDismissForSelect = (target) => {
|
|
1467
|
-
const isSelectOpen = Boolean(
|
|
1468
|
-
document.querySelector('[data-radix-select-content][data-state="open"]')
|
|
1469
|
-
);
|
|
1470
|
-
if (isSelectOpen) {
|
|
1471
|
-
return true;
|
|
1472
|
-
}
|
|
1473
|
-
if (!(target instanceof Element)) {
|
|
1474
|
-
return false;
|
|
1475
|
-
}
|
|
1476
|
-
return Boolean(
|
|
1477
|
-
target.closest("[data-radix-select-content]") || target.closest("[data-radix-select-viewport]")
|
|
1478
|
-
);
|
|
1479
|
-
};
|
|
1480
|
-
function useOverlayDismissGuard({
|
|
1481
|
-
onInteractOutside,
|
|
1482
|
-
onEscapeKeyDown
|
|
1483
|
-
}) {
|
|
1484
|
-
const handleInteractOutside = (event) => {
|
|
1485
|
-
if (shouldPreventDismissForSelect(event.target) || isTargetInsideBaseUiPopup(event.target)) {
|
|
1486
|
-
event.preventDefault();
|
|
1487
|
-
}
|
|
1488
|
-
onInteractOutside?.(event);
|
|
1489
|
-
};
|
|
1490
|
-
const handleEscapeKeyDown = (event) => {
|
|
1491
|
-
if (isBaseUiPopupOpen()) {
|
|
1492
|
-
event.preventDefault();
|
|
1493
|
-
}
|
|
1494
|
-
onEscapeKeyDown?.(event);
|
|
1495
|
-
};
|
|
1496
|
-
return { onEscapeKeyDown: handleEscapeKeyDown, onInteractOutside: handleInteractOutside };
|
|
1497
|
-
}
|
|
1498
1461
|
var MODAL_PADDING = {
|
|
1499
1462
|
body: "px-4 pb-4",
|
|
1500
1463
|
footer: "px-4 py-3"
|
|
1501
1464
|
};
|
|
1465
|
+
var MODAL_TRANSITION = "transition-[transform,scale,opacity] duration-200 data-[starting-style]:opacity-0 data-[ending-style]:opacity-0";
|
|
1502
1466
|
var ModalContext = React.createContext({ size: "default" });
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
);
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
ref,
|
|
1516
|
-
variant: "assistive",
|
|
1517
|
-
size: size ?? (modalSize === "fullsize" ? "large" : "medium")
|
|
1518
|
-
}
|
|
1519
|
-
) });
|
|
1520
|
-
});
|
|
1521
|
-
Modal.Overlay = React.forwardRef(
|
|
1522
|
-
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1523
|
-
DialogPrimitive__namespace.Overlay,
|
|
1467
|
+
function ModalRoot(props) {
|
|
1468
|
+
return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Root, { ...props });
|
|
1469
|
+
}
|
|
1470
|
+
function ModalTrigger(props) {
|
|
1471
|
+
return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Trigger, { "data-slot": "modal-trigger", ...props });
|
|
1472
|
+
}
|
|
1473
|
+
function ModalPortal(props) {
|
|
1474
|
+
return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Portal, { ...props });
|
|
1475
|
+
}
|
|
1476
|
+
function ModalOverlay({ className, ...props }) {
|
|
1477
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1478
|
+
dialog.Dialog.Backdrop,
|
|
1524
1479
|
{
|
|
1525
|
-
|
|
1526
|
-
className: utils.cn(
|
|
1527
|
-
"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",
|
|
1528
|
-
className
|
|
1529
|
-
),
|
|
1480
|
+
"data-slot": "modal-overlay",
|
|
1481
|
+
className: utils.cn("fixed inset-0 z-50 bg-component-dim", MODAL_TRANSITION, className),
|
|
1530
1482
|
...props
|
|
1531
1483
|
}
|
|
1532
|
-
)
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1540
|
-
|
|
1541
|
-
DialogPrimitive__namespace.Content,
|
|
1484
|
+
);
|
|
1485
|
+
}
|
|
1486
|
+
function ModalClose({ size, ...props }) {
|
|
1487
|
+
const { size: modalSize } = React.useContext(ModalContext);
|
|
1488
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1489
|
+
dialog.Dialog.Close,
|
|
1490
|
+
{
|
|
1491
|
+
render: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1492
|
+
Button,
|
|
1542
1493
|
{
|
|
1543
|
-
ref,
|
|
1544
|
-
className: utils.cn(
|
|
1545
|
-
// 공통 스타일
|
|
1546
|
-
"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",
|
|
1547
|
-
// fullsize일 때
|
|
1548
|
-
isFullSize ? "inset-0 m-10" : (
|
|
1549
|
-
// 일반 모달일 때
|
|
1550
|
-
"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%]"
|
|
1551
|
-
),
|
|
1552
|
-
className
|
|
1553
|
-
),
|
|
1554
1494
|
...props,
|
|
1555
|
-
|
|
1556
|
-
|
|
1495
|
+
variant: "assistive",
|
|
1496
|
+
size: size ?? (modalSize === "fullsize" ? "large" : "medium")
|
|
1557
1497
|
}
|
|
1558
1498
|
)
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1499
|
+
}
|
|
1500
|
+
);
|
|
1501
|
+
}
|
|
1502
|
+
function ModalContent({ className, children, size = "default", ...props }) {
|
|
1503
|
+
const isFullSize = size === "fullsize";
|
|
1504
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ModalContext.Provider, { value: { size }, children: /* @__PURE__ */ jsxRuntime.jsxs(ModalPortal, { children: [
|
|
1505
|
+
/* @__PURE__ */ jsxRuntime.jsx(ModalOverlay, {}),
|
|
1506
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1507
|
+
dialog.Dialog.Popup,
|
|
1508
|
+
{
|
|
1509
|
+
"data-slot": "modal-content",
|
|
1510
|
+
className: utils.cn(
|
|
1511
|
+
// 공통 스타일
|
|
1512
|
+
"fixed z-50 flex flex-col rounded-strong border border-border-primary bg-background-primary",
|
|
1513
|
+
MODAL_TRANSITION,
|
|
1514
|
+
isFullSize ? "inset-0 m-10" : (
|
|
1515
|
+
// 콘텐츠 높이를 따르되 뷰포트를 넘지 않는다. 넘치면 Body만 스크롤된다.
|
|
1516
|
+
"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"
|
|
1517
|
+
),
|
|
1518
|
+
className
|
|
1519
|
+
),
|
|
1520
|
+
...props,
|
|
1521
|
+
children
|
|
1522
|
+
}
|
|
1523
|
+
)
|
|
1524
|
+
] }) });
|
|
1525
|
+
}
|
|
1526
|
+
function ModalHeader({ className, line = false, rightSlot, children, ...props }) {
|
|
1527
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1564
1528
|
"div",
|
|
1565
1529
|
{
|
|
1566
|
-
|
|
1530
|
+
"data-slot": "modal-header",
|
|
1567
1531
|
className: utils.cn(
|
|
1568
1532
|
"flex shrink-0 flex-row items-center gap-2 pl-4 pr-2 min-h-12",
|
|
1569
1533
|
line && "border-b border-border-primary",
|
|
@@ -1573,8 +1537,9 @@ Modal.Header = React.forwardRef(
|
|
|
1573
1537
|
children: [
|
|
1574
1538
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-1 flex-row items-center gap-1", children }),
|
|
1575
1539
|
rightSlot === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1576
|
-
|
|
1540
|
+
dialog.Dialog.Close,
|
|
1577
1541
|
{
|
|
1542
|
+
"data-slot": "modal-close-icon",
|
|
1578
1543
|
className: utils.cn(
|
|
1579
1544
|
"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"
|
|
1580
1545
|
),
|
|
@@ -1583,42 +1548,57 @@ Modal.Header = React.forwardRef(
|
|
|
1583
1548
|
) : rightSlot
|
|
1584
1549
|
]
|
|
1585
1550
|
}
|
|
1586
|
-
)
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1551
|
+
);
|
|
1552
|
+
}
|
|
1553
|
+
function ModalBody({
|
|
1554
|
+
className,
|
|
1555
|
+
children,
|
|
1556
|
+
scroll = true,
|
|
1557
|
+
horizontalScroll = false,
|
|
1558
|
+
...props
|
|
1559
|
+
}) {
|
|
1560
|
+
const content = /* @__PURE__ */ jsxRuntime.jsx("div", { className: utils.cn(MODAL_PADDING.body, className), children });
|
|
1561
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1590
1562
|
"div",
|
|
1591
1563
|
{
|
|
1592
|
-
|
|
1564
|
+
"data-slot": "modal-body",
|
|
1593
1565
|
className: utils.cn(
|
|
1594
|
-
"flex-1 flex flex-col min-h-0
|
|
1595
|
-
"[&_[data-slot=scroll-area-viewport]>div]:h-full"
|
|
1566
|
+
"flex-1 flex flex-col min-h-0",
|
|
1567
|
+
scroll && "h-full [&_[data-slot=scroll-area-viewport]>div]:h-full"
|
|
1596
1568
|
),
|
|
1597
1569
|
...props,
|
|
1598
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(chunkSX23SDUY_js.ScrollArea, { className: "h-full flex flex-col",
|
|
1570
|
+
children: scroll ? /* @__PURE__ */ jsxRuntime.jsx(chunkSX23SDUY_js.ScrollArea, { className: "h-full flex flex-col", disableHorizontalScroll: !horizontalScroll, children: content }) : content
|
|
1599
1571
|
}
|
|
1600
|
-
)
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1572
|
+
);
|
|
1573
|
+
}
|
|
1574
|
+
function ModalFooter({ className, line = true, ...props }) {
|
|
1575
|
+
const { size } = React.useContext(ModalContext);
|
|
1576
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1604
1577
|
"div",
|
|
1605
1578
|
{
|
|
1606
|
-
|
|
1579
|
+
"data-slot": "modal-footer",
|
|
1607
1580
|
className: utils.cn(
|
|
1608
|
-
"flex flex-row items-center justify-between
|
|
1581
|
+
"flex flex-row items-center justify-between gap-3",
|
|
1582
|
+
size === "fullsize" ? "min-h-16" : "min-h-14",
|
|
1609
1583
|
line && "border-t border-border-primary",
|
|
1610
1584
|
MODAL_PADDING.footer,
|
|
1611
1585
|
className
|
|
1612
1586
|
),
|
|
1613
1587
|
...props
|
|
1614
1588
|
}
|
|
1615
|
-
)
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1589
|
+
);
|
|
1590
|
+
}
|
|
1591
|
+
function ModalFooterDescription({
|
|
1592
|
+
className,
|
|
1593
|
+
error = false,
|
|
1594
|
+
icon,
|
|
1595
|
+
children,
|
|
1596
|
+
...props
|
|
1597
|
+
}) {
|
|
1598
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1619
1599
|
"div",
|
|
1620
1600
|
{
|
|
1621
|
-
|
|
1601
|
+
"data-slot": "modal-footer-description",
|
|
1622
1602
|
className: utils.cn(
|
|
1623
1603
|
"flex flex-row items-center gap-1 text-body-3",
|
|
1624
1604
|
error ? "text-text-critical" : "text-text-tertiary",
|
|
@@ -1630,59 +1610,125 @@ Modal.FooterDescription = React.forwardRef(
|
|
|
1630
1610
|
children
|
|
1631
1611
|
]
|
|
1632
1612
|
}
|
|
1633
|
-
)
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
const { size: modalSize } = React.useContext(ModalContext);
|
|
1639
|
-
return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1640
|
-
Button,
|
|
1641
|
-
{
|
|
1642
|
-
...props,
|
|
1643
|
-
ref,
|
|
1644
|
-
color,
|
|
1645
|
-
variant: "solid",
|
|
1646
|
-
size: size ?? (modalSize === "fullsize" ? "large" : "medium")
|
|
1647
|
-
}
|
|
1648
|
-
) });
|
|
1649
|
-
}
|
|
1650
|
-
);
|
|
1651
|
-
Modal.Title = React.forwardRef(
|
|
1652
|
-
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1653
|
-
DialogPrimitive__namespace.Title,
|
|
1613
|
+
);
|
|
1614
|
+
}
|
|
1615
|
+
function ModalActions({ className, ...props }) {
|
|
1616
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1617
|
+
"div",
|
|
1654
1618
|
{
|
|
1655
|
-
|
|
1619
|
+
"data-slot": "modal-actions",
|
|
1620
|
+
className: utils.cn("ml-auto flex flex-row items-center gap-2", className),
|
|
1621
|
+
...props
|
|
1622
|
+
}
|
|
1623
|
+
);
|
|
1624
|
+
}
|
|
1625
|
+
function ModalAction({ color = "primary", size, ...props }) {
|
|
1626
|
+
const { size: modalSize } = React.useContext(ModalContext);
|
|
1627
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1628
|
+
dialog.Dialog.Close,
|
|
1629
|
+
{
|
|
1630
|
+
render: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1631
|
+
Button,
|
|
1632
|
+
{
|
|
1633
|
+
...props,
|
|
1634
|
+
color,
|
|
1635
|
+
variant: "solid",
|
|
1636
|
+
size: size ?? (modalSize === "fullsize" ? "large" : "medium")
|
|
1637
|
+
}
|
|
1638
|
+
)
|
|
1639
|
+
}
|
|
1640
|
+
);
|
|
1641
|
+
}
|
|
1642
|
+
function ModalTitle({ className, ...props }) {
|
|
1643
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1644
|
+
dialog.Dialog.Title,
|
|
1645
|
+
{
|
|
1646
|
+
"data-slot": "modal-title",
|
|
1656
1647
|
className: utils.cn(
|
|
1657
1648
|
"text-body-1 font-semibold leading-none tracking-tight text-text-primary",
|
|
1658
1649
|
className
|
|
1659
1650
|
),
|
|
1660
1651
|
...props
|
|
1661
1652
|
}
|
|
1662
|
-
)
|
|
1653
|
+
);
|
|
1654
|
+
}
|
|
1655
|
+
function ModalDescription({ className, ...props }) {
|
|
1656
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1657
|
+
dialog.Dialog.Description,
|
|
1658
|
+
{
|
|
1659
|
+
"data-slot": "modal-description",
|
|
1660
|
+
className: utils.cn("text-body-2 text-text-tertiary", className),
|
|
1661
|
+
...props
|
|
1662
|
+
}
|
|
1663
|
+
);
|
|
1664
|
+
}
|
|
1665
|
+
ModalRoot.displayName = "Modal";
|
|
1666
|
+
ModalTrigger.displayName = "Modal.Trigger";
|
|
1667
|
+
ModalPortal.displayName = "Modal.Portal";
|
|
1668
|
+
ModalClose.displayName = "Modal.Close";
|
|
1669
|
+
ModalOverlay.displayName = "Modal.Overlay";
|
|
1670
|
+
ModalContent.displayName = "Modal.Content";
|
|
1671
|
+
ModalHeader.displayName = "Modal.Header";
|
|
1672
|
+
ModalBody.displayName = "Modal.Body";
|
|
1673
|
+
ModalFooter.displayName = "Modal.Footer";
|
|
1674
|
+
ModalFooterDescription.displayName = "Modal.FooterDescription";
|
|
1675
|
+
ModalActions.displayName = "Modal.Actions";
|
|
1676
|
+
ModalAction.displayName = "Modal.Action";
|
|
1677
|
+
ModalTitle.displayName = "Modal.Title";
|
|
1678
|
+
ModalDescription.displayName = "Modal.Description";
|
|
1679
|
+
var Modal = Object.assign(ModalRoot, {
|
|
1680
|
+
Trigger: ModalTrigger,
|
|
1681
|
+
Portal: ModalPortal,
|
|
1682
|
+
Close: ModalClose,
|
|
1683
|
+
Overlay: ModalOverlay,
|
|
1684
|
+
Content: ModalContent,
|
|
1685
|
+
Header: ModalHeader,
|
|
1686
|
+
Body: ModalBody,
|
|
1687
|
+
Footer: ModalFooter,
|
|
1688
|
+
FooterDescription: ModalFooterDescription,
|
|
1689
|
+
Actions: ModalActions,
|
|
1690
|
+
Action: ModalAction,
|
|
1691
|
+
Title: ModalTitle,
|
|
1692
|
+
Description: ModalDescription
|
|
1693
|
+
});
|
|
1694
|
+
|
|
1695
|
+
// src/hooks/useOverlayDismissGuard.ts
|
|
1696
|
+
var isBaseUiPopupOpen = () => Boolean(
|
|
1697
|
+
document.querySelector('[data-base-ui-portal] [data-slot="combobox-content"][data-open]')
|
|
1663
1698
|
);
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1699
|
+
var isTargetInsideBaseUiPopup = (target) => target instanceof Element && Boolean(target.closest("[data-base-ui-portal]"));
|
|
1700
|
+
var shouldPreventDismissForSelect = (target) => {
|
|
1701
|
+
const isSelectOpen = Boolean(
|
|
1702
|
+
document.querySelector('[data-radix-select-content][data-state="open"]')
|
|
1703
|
+
);
|
|
1704
|
+
if (isSelectOpen) {
|
|
1705
|
+
return true;
|
|
1670
1706
|
}
|
|
1671
|
-
))
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1707
|
+
if (!(target instanceof Element)) {
|
|
1708
|
+
return false;
|
|
1709
|
+
}
|
|
1710
|
+
return Boolean(
|
|
1711
|
+
target.closest("[data-radix-select-content]") || target.closest("[data-radix-select-viewport]")
|
|
1712
|
+
);
|
|
1713
|
+
};
|
|
1714
|
+
function useOverlayDismissGuard({
|
|
1715
|
+
onInteractOutside,
|
|
1716
|
+
onEscapeKeyDown
|
|
1717
|
+
}) {
|
|
1718
|
+
const handleInteractOutside = (event) => {
|
|
1719
|
+
if (shouldPreventDismissForSelect(event.target) || isTargetInsideBaseUiPopup(event.target)) {
|
|
1720
|
+
event.preventDefault();
|
|
1721
|
+
}
|
|
1722
|
+
onInteractOutside?.(event);
|
|
1723
|
+
};
|
|
1724
|
+
const handleEscapeKeyDown = (event) => {
|
|
1725
|
+
if (isBaseUiPopupOpen()) {
|
|
1726
|
+
event.preventDefault();
|
|
1727
|
+
}
|
|
1728
|
+
onEscapeKeyDown?.(event);
|
|
1729
|
+
};
|
|
1730
|
+
return { onEscapeKeyDown: handleEscapeKeyDown, onInteractOutside: handleInteractOutside };
|
|
1731
|
+
}
|
|
1686
1732
|
|
|
1687
1733
|
// src/sheet/sheetResize.ts
|
|
1688
1734
|
var SHEET_EDGE_GAP = "[--sheet-edge-gap:40px]";
|
|
@@ -1809,18 +1855,18 @@ var SHEET_RESIZE_SIDE_CLASSES = {
|
|
|
1809
1855
|
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"
|
|
1810
1856
|
};
|
|
1811
1857
|
var SheetContext = React.createContext({ side: "right" });
|
|
1812
|
-
var SheetRoot = (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1858
|
+
var SheetRoot = (props) => /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive2__namespace.Root, { ...props });
|
|
1813
1859
|
var Sheet = SheetRoot;
|
|
1814
1860
|
Sheet.Trigger = React.forwardRef(
|
|
1815
|
-
(props, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1861
|
+
(props, ref) => /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive2__namespace.Trigger, { ref, ...props })
|
|
1816
1862
|
);
|
|
1817
|
-
Sheet.Portal = (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1863
|
+
Sheet.Portal = (props) => /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive2__namespace.Portal, { ...props });
|
|
1818
1864
|
Sheet.Close = React.forwardRef(
|
|
1819
|
-
(props, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1865
|
+
(props, ref) => /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive2__namespace.Close, { ref, ...props })
|
|
1820
1866
|
);
|
|
1821
1867
|
Sheet.Overlay = React.forwardRef(
|
|
1822
1868
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1823
|
-
|
|
1869
|
+
DialogPrimitive2__namespace.Overlay,
|
|
1824
1870
|
{
|
|
1825
1871
|
ref,
|
|
1826
1872
|
className: utils.cn(
|
|
@@ -1847,7 +1893,7 @@ Sheet.Content = React.forwardRef(
|
|
|
1847
1893
|
return /* @__PURE__ */ jsxRuntime.jsx(SheetContext.Provider, { value: { side }, children: /* @__PURE__ */ jsxRuntime.jsxs(Sheet.Portal, { children: [
|
|
1848
1894
|
/* @__PURE__ */ jsxRuntime.jsx(Sheet.Overlay, {}),
|
|
1849
1895
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1850
|
-
|
|
1896
|
+
DialogPrimitive2__namespace.Content,
|
|
1851
1897
|
{
|
|
1852
1898
|
ref,
|
|
1853
1899
|
className: utils.cn(
|
|
@@ -1867,7 +1913,7 @@ Sheet.Content = React.forwardRef(
|
|
|
1867
1913
|
Sheet.Header = React.forwardRef(
|
|
1868
1914
|
({ className, line = true, rightSlot, children, ...props }, ref) => {
|
|
1869
1915
|
const rightElement = rightSlot === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1870
|
-
|
|
1916
|
+
DialogPrimitive2__namespace.Close,
|
|
1871
1917
|
{
|
|
1872
1918
|
className: utils.cn(
|
|
1873
1919
|
"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"
|
|
@@ -1953,7 +1999,7 @@ Sheet.FooterDescription = React.forwardRef(
|
|
|
1953
1999
|
Sheet.Actions = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: utils.cn("ml-auto flex flex-row items-center gap-2", className), ...props }));
|
|
1954
2000
|
Sheet.Title = React.forwardRef(
|
|
1955
2001
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1956
|
-
|
|
2002
|
+
DialogPrimitive2__namespace.Title,
|
|
1957
2003
|
{
|
|
1958
2004
|
ref,
|
|
1959
2005
|
className: utils.cn(
|
|
@@ -1965,7 +2011,7 @@ Sheet.Title = React.forwardRef(
|
|
|
1965
2011
|
)
|
|
1966
2012
|
);
|
|
1967
2013
|
Sheet.Description = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1968
|
-
|
|
2014
|
+
DialogPrimitive2__namespace.Description,
|
|
1969
2015
|
{
|
|
1970
2016
|
ref,
|
|
1971
2017
|
className: utils.cn("text-body-2 text-text-tertiary", className),
|
|
@@ -1985,77 +2031,111 @@ Sheet.FooterDescription.displayName = "Sheet.FooterDescription";
|
|
|
1985
2031
|
Sheet.Actions.displayName = "Sheet.Actions";
|
|
1986
2032
|
Sheet.Title.displayName = "Sheet.Title";
|
|
1987
2033
|
Sheet.Description.displayName = "Sheet.Description";
|
|
2034
|
+
var MESSAGE_BOX_TRANSITION = "transition-[transform,scale,opacity] duration-200 data-[starting-style]:opacity-0 data-[ending-style]:opacity-0";
|
|
1988
2035
|
var MessageBoxContext = React.createContext({ variant: "default" });
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1994
|
-
|
|
2036
|
+
function MessageBoxRoot(props) {
|
|
2037
|
+
return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Root, { ...props });
|
|
2038
|
+
}
|
|
2039
|
+
function MessageBoxTrigger(props) {
|
|
2040
|
+
return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Trigger, { "data-slot": "message-box-trigger", ...props });
|
|
2041
|
+
}
|
|
2042
|
+
function MessageBoxContent({
|
|
2043
|
+
className,
|
|
2044
|
+
children,
|
|
2045
|
+
variant = "default",
|
|
2046
|
+
...props
|
|
2047
|
+
}) {
|
|
2048
|
+
return /* @__PURE__ */ jsxRuntime.jsx(MessageBoxContext.Provider, { value: { variant }, children: /* @__PURE__ */ jsxRuntime.jsxs(dialog.Dialog.Portal, { children: [
|
|
2049
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2050
|
+
dialog.Dialog.Backdrop,
|
|
2051
|
+
{
|
|
2052
|
+
"data-slot": "message-box-overlay",
|
|
2053
|
+
className: utils.cn("fixed inset-0 z-50 bg-component-dim", MESSAGE_BOX_TRANSITION)
|
|
2054
|
+
}
|
|
2055
|
+
),
|
|
2056
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2057
|
+
dialog.Dialog.Popup,
|
|
2058
|
+
{
|
|
2059
|
+
"data-slot": "message-box-content",
|
|
2060
|
+
className: utils.cn(
|
|
2061
|
+
"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",
|
|
2062
|
+
MESSAGE_BOX_TRANSITION,
|
|
2063
|
+
"data-[starting-style]:scale-95 data-[ending-style]:scale-95",
|
|
2064
|
+
className
|
|
2065
|
+
),
|
|
2066
|
+
...props,
|
|
2067
|
+
children
|
|
2068
|
+
}
|
|
2069
|
+
)
|
|
2070
|
+
] }) });
|
|
2071
|
+
}
|
|
2072
|
+
function MessageBoxTitle({ className, ...props }) {
|
|
2073
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2074
|
+
dialog.Dialog.Title,
|
|
1995
2075
|
{
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
2076
|
+
"data-slot": "message-box-title",
|
|
2077
|
+
className: utils.cn("w-full text-body-1 font-semibold text-text-primary", className),
|
|
2078
|
+
...props
|
|
1999
2079
|
}
|
|
2000
|
-
)
|
|
2001
|
-
|
|
2002
|
-
|
|
2080
|
+
);
|
|
2081
|
+
}
|
|
2082
|
+
function MessageBoxDescription({ className, ...props }) {
|
|
2083
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2084
|
+
dialog.Dialog.Description,
|
|
2003
2085
|
{
|
|
2004
|
-
|
|
2005
|
-
className: utils.cn(
|
|
2006
|
-
|
|
2007
|
-
className
|
|
2008
|
-
),
|
|
2009
|
-
...props,
|
|
2010
|
-
children
|
|
2086
|
+
"data-slot": "message-box-description",
|
|
2087
|
+
className: utils.cn("w-full text-body-2 text-text-secondary", className),
|
|
2088
|
+
...props
|
|
2011
2089
|
}
|
|
2012
|
-
)
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
}
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
MessageBox
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2090
|
+
);
|
|
2091
|
+
}
|
|
2092
|
+
function MessageBoxActions({ className, ...props }) {
|
|
2093
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2094
|
+
"div",
|
|
2095
|
+
{
|
|
2096
|
+
"data-slot": "message-box-actions",
|
|
2097
|
+
className: utils.cn("flex flex-row gap-2", className),
|
|
2098
|
+
...props
|
|
2099
|
+
}
|
|
2100
|
+
);
|
|
2101
|
+
}
|
|
2102
|
+
function MessageBoxCancel({ size = "medium", ...props }) {
|
|
2103
|
+
return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Close, { render: /* @__PURE__ */ jsxRuntime.jsx(Button, { ...props, variant: "assistive", size }) });
|
|
2104
|
+
}
|
|
2105
|
+
function MessageBoxAction({ size = "medium", ...props }) {
|
|
2106
|
+
const { variant } = React.useContext(MessageBoxContext);
|
|
2107
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2108
|
+
dialog.Dialog.Close,
|
|
2109
|
+
{
|
|
2110
|
+
render: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2111
|
+
Button,
|
|
2112
|
+
{
|
|
2113
|
+
...props,
|
|
2114
|
+
color: variant === "critical" ? "critical" : "primary",
|
|
2115
|
+
variant: "solid",
|
|
2116
|
+
size
|
|
2117
|
+
}
|
|
2118
|
+
)
|
|
2119
|
+
}
|
|
2120
|
+
);
|
|
2121
|
+
}
|
|
2122
|
+
MessageBoxRoot.displayName = "MessageBox";
|
|
2123
|
+
MessageBoxTrigger.displayName = "MessageBox.Trigger";
|
|
2124
|
+
MessageBoxContent.displayName = "MessageBox.Content";
|
|
2125
|
+
MessageBoxTitle.displayName = "MessageBox.Title";
|
|
2126
|
+
MessageBoxDescription.displayName = "MessageBox.Description";
|
|
2127
|
+
MessageBoxActions.displayName = "MessageBox.Actions";
|
|
2128
|
+
MessageBoxCancel.displayName = "MessageBox.Cancel";
|
|
2129
|
+
MessageBoxAction.displayName = "MessageBox.Action";
|
|
2130
|
+
var MessageBox = Object.assign(MessageBoxRoot, {
|
|
2131
|
+
Trigger: MessageBoxTrigger,
|
|
2132
|
+
Content: MessageBoxContent,
|
|
2133
|
+
Title: MessageBoxTitle,
|
|
2134
|
+
Description: MessageBoxDescription,
|
|
2135
|
+
Actions: MessageBoxActions,
|
|
2136
|
+
Cancel: MessageBoxCancel,
|
|
2137
|
+
Action: MessageBoxAction
|
|
2138
|
+
});
|
|
2059
2139
|
var containerVariants4 = utils.cva("inset-0 z-[49] flex items-center justify-center", {
|
|
2060
2140
|
variants: {
|
|
2061
2141
|
position: {
|