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

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.js CHANGED
@@ -6,12 +6,14 @@ var utils = require('@exem-ui/core/utils');
6
6
  var React = require('react');
7
7
  var jsxRuntime = require('react/jsx-runtime');
8
8
  var reactSlot = require('@radix-ui/react-slot');
9
+ var button = require('@base-ui/react/button');
9
10
  var CheckboxPrimitive = require('@radix-ui/react-checkbox');
10
11
  var RadioGroupPrimitive = require('@radix-ui/react-radio-group');
11
12
  var SwitchPrimitives = require('@radix-ui/react-switch');
12
13
  var reactDayPicker = require('react-day-picker');
13
14
  var DropdownMenuPrimitive = require('@radix-ui/react-dropdown-menu');
14
- var DialogPrimitive = require('@radix-ui/react-dialog');
15
+ var dialog = require('@base-ui/react/dialog');
16
+ var DialogPrimitive2 = require('@radix-ui/react-dialog');
15
17
  var reResizable = require('re-resizable');
16
18
  var progress = require('@base-ui/react/progress');
17
19
  var sonner = require('sonner');
@@ -39,7 +41,7 @@ var CheckboxPrimitive__namespace = /*#__PURE__*/_interopNamespace(CheckboxPrimit
39
41
  var RadioGroupPrimitive__namespace = /*#__PURE__*/_interopNamespace(RadioGroupPrimitive);
40
42
  var SwitchPrimitives__namespace = /*#__PURE__*/_interopNamespace(SwitchPrimitives);
41
43
  var DropdownMenuPrimitive__namespace = /*#__PURE__*/_interopNamespace(DropdownMenuPrimitive);
42
- var DialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(DialogPrimitive);
44
+ var DialogPrimitive2__namespace = /*#__PURE__*/_interopNamespace(DialogPrimitive2);
43
45
 
44
46
  var SIZE_CONFIG = {
45
47
  xsmall: {
@@ -428,185 +430,114 @@ Breadcrumb.Ellipsis.displayName = "Breadcrumb.Ellipsis";
428
430
  var colorStyles = {
429
431
  primary: {
430
432
  solid: {
431
- button: "bg-solid-primary-default hover:bg-solid-primary-hovered disabled:bg-solid-primary-disabled",
432
- icon: "text-icon-inverse group-disabled/button:text-icon-inverse",
433
- text: "text-text-inverse group-disabled/button:text-text-inverse"
433
+ root: "bg-solid-primary-default text-text-inverse hover:bg-solid-primary-hovered data-[disabled]:bg-solid-primary-disabled data-[disabled]:text-text-inverse",
434
+ icon: "text-icon-inverse group-data-[disabled]/button:text-icon-inverse"
434
435
  },
435
436
  assistive: {
436
- button: "bg-elevation-elevation-2 hover:bg-elevation-elevation-3 disabled:bg-elevation-elevation-2",
437
- icon: "text-icon-secondary group-disabled/button:text-icon-disabled",
438
- text: "text-text-secondary group-disabled/button:text-text-disabled"
437
+ root: "bg-elevation-elevation-2 text-text-secondary hover:bg-elevation-elevation-3 data-[disabled]:bg-elevation-elevation-2 data-[disabled]:text-text-disabled",
438
+ icon: "text-icon-secondary group-data-[disabled]/button:text-icon-disabled"
439
439
  },
440
440
  outlined: {
441
- button: "border border-border-primary disabled:border-border-primary hover:bg-elevation-elevation-2",
442
- icon: "text-icon-secondary group-disabled/button:text-icon-disabled",
443
- text: "text-text-secondary group-disabled/button:text-text-disabled"
441
+ root: "border border-border-primary text-text-secondary hover:bg-elevation-elevation-2 data-[disabled]:border-border-primary data-[disabled]:text-text-disabled",
442
+ icon: "text-icon-secondary group-data-[disabled]/button:text-icon-disabled"
444
443
  },
445
444
  invisible: {
446
- button: "hover:bg-elevation-elevation-2",
447
- icon: "text-icon-secondary group-disabled/button:text-icon-disabled",
448
- text: "text-text-secondary group-disabled/button:text-text-disabled"
445
+ root: "text-text-secondary hover:bg-elevation-elevation-2 data-[disabled]:text-text-disabled",
446
+ icon: "text-icon-secondary group-data-[disabled]/button:text-icon-disabled"
449
447
  }
450
448
  },
451
449
  accent: {
452
450
  solid: {
453
- button: "bg-solid-accent-default hover:bg-solid-accent-hovered disabled:bg-solid-accent-disabled",
454
- icon: "text-icon-static-light group-disabled/button:text-icon-inverse-disabled",
455
- text: "text-text-static-light group-disabled/button:text-text-inverse-disabled"
451
+ root: "bg-solid-accent-default text-text-static-light hover:bg-solid-accent-hovered data-[disabled]:bg-solid-accent-disabled data-[disabled]:text-text-inverse-disabled",
452
+ icon: "text-icon-static-light group-data-[disabled]/button:text-icon-inverse-disabled"
456
453
  },
457
454
  assistive: {
458
- button: "bg-elevation-accent-0 hover:bg-elevation-accent-1 disabled:bg-elevation-accent-0",
459
- icon: "text-text-accent group-disabled/button:text-text-accent-disabled",
460
- text: "text-text-accent group-disabled/button:text-text-accent-disabled"
455
+ root: "bg-elevation-accent-0 text-text-accent hover:bg-elevation-accent-1 data-[disabled]:bg-elevation-accent-0 data-[disabled]:text-text-accent-disabled",
456
+ icon: "text-text-accent group-data-[disabled]/button:text-text-accent-disabled"
461
457
  },
462
458
  outlined: {
463
- button: "border border-border-primary disabled:border-border-primary hover:bg-elevation-accent-0",
464
- icon: "text-text-accent group-disabled/button:text-text-accent-disabled",
465
- text: "text-text-accent group-disabled/button:text-text-accent-disabled"
459
+ root: "border border-border-primary text-text-accent hover:bg-elevation-accent-0 data-[disabled]:border-border-primary data-[disabled]:text-text-accent-disabled",
460
+ icon: "text-text-accent group-data-[disabled]/button:text-text-accent-disabled"
466
461
  },
467
462
  invisible: {
468
- button: "hover:bg-elevation-accent-0",
469
- icon: "text-text-accent group-disabled/button:text-text-accent-disabled",
470
- text: "text-text-accent group-disabled/button:text-text-accent-disabled"
463
+ root: "text-text-accent hover:bg-elevation-accent-0 data-[disabled]:text-text-accent-disabled",
464
+ icon: "text-text-accent group-data-[disabled]/button:text-text-accent-disabled"
471
465
  }
472
466
  },
473
467
  critical: {
474
468
  solid: {
475
- button: "bg-solid-critical-default hover:bg-solid-critical-hovered disabled:bg-solid-critical-disabled",
476
- icon: "text-icon-static-light group-disabled/button:text-icon-inverse-disabled",
477
- text: "text-text-static-light group-disabled/button:text-text-inverse-disabled"
469
+ root: "bg-solid-critical-default text-text-static-light hover:bg-solid-critical-hovered data-[disabled]:bg-solid-critical-disabled data-[disabled]:text-text-inverse-disabled",
470
+ icon: "text-icon-static-light group-data-[disabled]/button:text-icon-inverse-disabled"
478
471
  },
479
472
  assistive: {
480
- button: "bg-elevation-critical-0 hover:bg-elevation-critical-1 disabled:bg-elevation-critical-0",
481
- icon: "text-text-critical group-disabled/button:text-text-critical-disabled",
482
- text: "text-text-critical group-disabled/button:text-text-critical-disabled"
473
+ root: "bg-elevation-critical-0 text-text-critical hover:bg-elevation-critical-1 data-[disabled]:bg-elevation-critical-0 data-[disabled]:text-text-critical-disabled",
474
+ icon: "text-text-critical group-data-[disabled]/button:text-text-critical-disabled"
483
475
  },
484
476
  outlined: {
485
- button: "border border-border-primary disabled:border-border-primary hover:bg-elevation-critical-0",
486
- icon: "text-text-critical group-disabled/button:text-text-critical-disabled",
487
- text: "text-text-critical group-disabled/button:text-text-critical-disabled"
477
+ root: "border border-border-primary text-text-critical hover:bg-elevation-critical-0 data-[disabled]:border-border-primary data-[disabled]:text-text-critical-disabled",
478
+ icon: "text-text-critical group-data-[disabled]/button:text-text-critical-disabled"
488
479
  },
489
480
  invisible: {
490
- button: "hover:bg-elevation-critical-0",
491
- icon: "text-text-critical group-disabled/button:text-text-critical-disabled",
492
- text: "text-text-critical group-disabled/button:text-text-critical-disabled"
481
+ root: "text-text-critical hover:bg-elevation-critical-0 data-[disabled]:text-text-critical-disabled",
482
+ icon: "text-text-critical group-data-[disabled]/button:text-text-critical-disabled"
493
483
  }
494
484
  }
495
485
  };
496
486
  var buttonVariants = utils.cva(
497
- "inline-flex w-fit shrink-0 cursor-pointer flex-row items-center justify-center rounded-medium transition-colors focus-visible:outline-none disabled:pointer-events-none disabled:cursor-not-allowed",
487
+ "inline-flex w-fit shrink-0 cursor-pointer flex-row items-center justify-center rounded-medium transition-colors focus-visible:outline-none data-[disabled]:pointer-events-none data-[disabled]:cursor-not-allowed",
498
488
  {
499
- compoundVariants: [
500
- // Primary 색상 조합
501
- { className: colorStyles.primary.solid.button, color: "primary", variant: "solid" },
502
- { className: colorStyles.primary.assistive.button, color: "primary", variant: "assistive" },
503
- { className: colorStyles.primary.outlined.button, color: "primary", variant: "outlined" },
504
- { className: colorStyles.primary.invisible.button, color: "primary", variant: "invisible" },
505
- // Accent 색상 조합
506
- { className: colorStyles.accent.solid.button, color: "accent", variant: "solid" },
507
- { className: colorStyles.accent.assistive.button, color: "accent", variant: "assistive" },
508
- { className: colorStyles.accent.outlined.button, color: "accent", variant: "outlined" },
509
- { className: colorStyles.accent.invisible.button, color: "accent", variant: "invisible" },
510
- // Critical 색상 조합
511
- { className: colorStyles.critical.solid.button, color: "critical", variant: "solid" },
512
- { className: colorStyles.critical.assistive.button, color: "critical", variant: "assistive" },
513
- { className: colorStyles.critical.outlined.button, color: "critical", variant: "outlined" },
514
- { className: colorStyles.critical.invisible.button, color: "critical", variant: "invisible" },
515
- // background 표면은 outlined/invisible 에서만 추가
516
- {
517
- className: "bg-elevation-elevation-0",
518
- background: "fill",
519
- variant: ["outlined", "invisible"]
520
- }
521
- ],
522
489
  defaultVariants: {
523
- background: "none",
524
- color: "primary",
525
- size: "medium",
526
- variant: "solid"
490
+ size: "medium"
527
491
  },
528
492
  variants: {
529
- background: {
530
- none: "",
531
- fill: ""
532
- },
533
- color: {
534
- accent: "",
535
- critical: "",
536
- primary: ""
537
- },
538
493
  size: {
539
494
  xsmall: "h-6 gap-0 px-1 text-body-3 font-medium",
540
495
  small: "h-7 gap-0.5 px-1.5 text-body-2 font-medium",
541
496
  medium: "h-8 gap-0.5 px-2 text-body-2 font-medium",
542
497
  large: "h-10 gap-1 px-2.5 text-body-1 font-medium",
543
498
  xlarge: "h-12 gap-1 px-3 text-title-2 font-medium"
544
- },
545
- variant: {
546
- solid: "",
547
- assistive: "",
548
- outlined: "",
549
- invisible: ""
550
499
  }
551
500
  }
552
501
  }
553
502
  );
554
- var IconSizeMap = {
503
+ var iconSizeMap = {
555
504
  xsmall: chunk6MFMQCL5_js.iconSizes.sm,
556
505
  small: chunk6MFMQCL5_js.iconSizes.sm,
557
506
  medium: chunk6MFMQCL5_js.iconSizes.sm,
558
507
  large: chunk6MFMQCL5_js.iconSizes.md,
559
508
  xlarge: chunk6MFMQCL5_js.iconSizes.lg
560
509
  };
561
- var Button = React.forwardRef(
562
- ({
563
- className,
564
- variant = "solid",
565
- color = "primary",
566
- background,
567
- size = "medium",
568
- icon,
569
- children,
570
- ...props
571
- }, ref) => {
572
- const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
573
- icon && React.cloneElement(icon, {
574
- className: utils.cn("shrink-0", colorStyles[color][variant].icon, icon.props.className),
575
- size: icon.props.size ?? IconSizeMap[size]
576
- }),
577
- children != null && /* @__PURE__ */ jsxRuntime.jsx(
578
- "span",
579
- {
580
- className: utils.cn(
581
- "min-w-0 truncate",
582
- size === "xlarge" ? "px-1" : "px-0.5",
583
- colorStyles[color][variant].text
584
- ),
585
- children
586
- }
587
- )
588
- ] });
589
- return /* @__PURE__ */ jsxRuntime.jsx(
590
- "button",
591
- {
592
- className: utils.cn(
593
- buttonVariants({
594
- background,
595
- className,
596
- color,
597
- size,
598
- variant
599
- }),
600
- "group/button"
601
- ),
602
- ref,
603
- ...props,
604
- children: content
605
- }
606
- );
607
- }
608
- );
609
- Button.displayName = "Button";
510
+ function Button({
511
+ className,
512
+ variant = "solid",
513
+ color = "primary",
514
+ background,
515
+ size = "medium",
516
+ icon,
517
+ children,
518
+ ...props
519
+ }) {
520
+ return /* @__PURE__ */ jsxRuntime.jsxs(
521
+ button.Button,
522
+ {
523
+ className: utils.cn(
524
+ buttonVariants({ size }),
525
+ colorStyles[color][variant].root,
526
+ background === "fill" && (variant === "outlined" || variant === "invisible") && "bg-elevation-elevation-0",
527
+ "group/button",
528
+ className
529
+ ),
530
+ ...props,
531
+ children: [
532
+ icon && React.cloneElement(icon, {
533
+ className: utils.cn("shrink-0", colorStyles[color][variant].icon, icon.props.className),
534
+ size: icon.props.size ?? iconSizeMap[size]
535
+ }),
536
+ children != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: utils.cn("min-w-0 truncate", size === "xlarge" ? "px-1" : "px-0.5"), children })
537
+ ]
538
+ }
539
+ );
540
+ }
610
541
  var iconButtonSizeClasses = {
611
542
  xsmall: "size-6",
612
543
  small: "size-7",
@@ -614,73 +545,85 @@ var iconButtonSizeClasses = {
614
545
  large: "size-10",
615
546
  xlarge: "size-12"
616
547
  };
617
- var IconButton = React.forwardRef(
618
- ({ className, tooltip, icon, size = "medium", ...props }, ref) => {
619
- const buttonProps = {
548
+ function IconButton({
549
+ className,
550
+ tooltip,
551
+ icon,
552
+ size = "medium",
553
+ "aria-label": ariaLabel,
554
+ "aria-labelledby": ariaLabelledBy,
555
+ ...props
556
+ }) {
557
+ const tooltipLabel = typeof tooltip === "string" ? tooltip : void 0;
558
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkSX23SDUY_js.ConditionalTooltip, { tooltip, children: /* @__PURE__ */ jsxRuntime.jsx(
559
+ Button,
560
+ {
561
+ "aria-label": ariaLabel ?? (ariaLabelledBy === void 0 ? tooltipLabel : void 0),
562
+ "aria-labelledby": ariaLabelledBy,
620
563
  className: utils.cn(iconButtonSizeClasses[size], "px-0", className),
621
564
  icon,
622
565
  size,
623
566
  ...props
624
- };
625
- return /* @__PURE__ */ jsxRuntime.jsx(chunkSX23SDUY_js.ConditionalTooltip, { tooltip, children: /* @__PURE__ */ jsxRuntime.jsx(Button, { ref, ...buttonProps }) });
626
- }
627
- );
628
- IconButton.displayName = "IconButton";
629
- var ButtonGroup = React.forwardRef(
630
- ({
631
- variant = "contained",
632
- iconOnly = false,
633
- hasBackground = false,
634
- size = "medium",
635
- items,
636
- className
637
- }, ref) => {
638
- if (items.length === 0) {
639
- return null;
640
567
  }
641
- const isOutlined = variant === "outlined";
642
- return /* @__PURE__ */ jsxRuntime.jsx(
643
- "div",
644
- {
645
- ref,
646
- className: utils.cn(
647
- "inline-flex items-center overflow-hidden rounded-medium",
648
- hasBackground && "bg-elevation-elevation-0",
649
- className
650
- ),
651
- role: "group",
652
- children: items.map((item, index) => {
653
- const isFirst = index === 0;
654
- const isLast = index === items.length - 1;
655
- const roundedClasses = utils.cn("rounded-none", {
656
- "rounded-l-medium": isFirst,
657
- "rounded-r-medium": isLast
658
- });
659
- const dividerClasses = !isOutlined && !isLast ? "border-r border-border-primary" : "";
660
- const mergeClasses = isOutlined && !isFirst ? "-ml-px" : "";
661
- const hoverClasses = isOutlined ? "relative hover:z-10" : "";
662
- if (iconOnly) {
663
- const iconBaseProps = {
664
- className: utils.cn(roundedClasses, dividerClasses, mergeClasses, hoverClasses),
665
- icon: item.icon,
666
- onClick: item.onClick,
667
- size
668
- };
669
- return /* @__PURE__ */ jsxRuntime.jsx(chunkSX23SDUY_js.ConditionalTooltip, { tooltip: item.tooltip, children: variant === "contained" ? /* @__PURE__ */ jsxRuntime.jsx(IconButton, { ...iconBaseProps, variant: "assistive" }) : /* @__PURE__ */ jsxRuntime.jsx(IconButton, { ...iconBaseProps, color: "primary", variant: "outlined" }) }, item.id);
670
- }
671
- const buttonBaseProps = {
672
- className: utils.cn(roundedClasses, dividerClasses, mergeClasses, hoverClasses),
673
- icon: item.icon,
674
- onClick: item.onClick,
675
- size
676
- };
677
- return /* @__PURE__ */ jsxRuntime.jsx(chunkSX23SDUY_js.ConditionalTooltip, { tooltip: item.tooltip, children: variant === "contained" ? /* @__PURE__ */ jsxRuntime.jsx(Button, { ...buttonBaseProps, variant: "assistive", children: item.label }) : /* @__PURE__ */ jsxRuntime.jsx(Button, { ...buttonBaseProps, color: "primary", variant: "outlined", children: item.label }) }, item.id);
678
- })
679
- }
680
- );
568
+ ) });
569
+ }
570
+ function ButtonGroup({
571
+ variant = "contained",
572
+ iconOnly = false,
573
+ hasBackground = false,
574
+ size = "medium",
575
+ items,
576
+ className,
577
+ ...props
578
+ }) {
579
+ if (items.length === 0) {
580
+ return null;
681
581
  }
682
- );
683
- ButtonGroup.displayName = "ButtonGroup";
582
+ const isOutlined = variant === "outlined";
583
+ const buttonVariantProps = isOutlined ? { color: "primary", variant: "outlined" } : { variant: "assistive" };
584
+ return /* @__PURE__ */ jsxRuntime.jsx(
585
+ "div",
586
+ {
587
+ ...props,
588
+ className: utils.cn(
589
+ "inline-flex items-center overflow-hidden rounded-medium",
590
+ hasBackground && "bg-elevation-elevation-0",
591
+ className
592
+ ),
593
+ role: "group",
594
+ children: items.map((item, index) => {
595
+ const isFirst = index === 0;
596
+ const isLast = index === items.length - 1;
597
+ const roundedClasses = utils.cn("rounded-none", {
598
+ "rounded-l-medium": isFirst,
599
+ "rounded-r-medium": isLast
600
+ });
601
+ const dividerClasses = !isOutlined && !isLast ? "border-r border-border-primary" : "";
602
+ const mergeClasses = isOutlined && !isFirst ? "-ml-px" : "";
603
+ const hoverClasses = isOutlined ? "relative hover:z-10" : "";
604
+ const buttonBaseProps = {
605
+ className: utils.cn(roundedClasses, dividerClasses, mergeClasses, hoverClasses),
606
+ onClick: item.onClick,
607
+ size,
608
+ ...buttonVariantProps
609
+ };
610
+ if (iconOnly) {
611
+ return /* @__PURE__ */ jsxRuntime.jsx(
612
+ IconButton,
613
+ {
614
+ ...buttonBaseProps,
615
+ "aria-label": item.label,
616
+ icon: item.icon,
617
+ tooltip: item.tooltip
618
+ },
619
+ item.id
620
+ );
621
+ }
622
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkSX23SDUY_js.ConditionalTooltip, { tooltip: item.tooltip, children: /* @__PURE__ */ jsxRuntime.jsx(Button, { ...buttonBaseProps, icon: item.icon, children: item.label }) }, item.id);
623
+ })
624
+ }
625
+ );
626
+ }
684
627
  var containerVariants = utils.cva("inline-flex items-center", {
685
628
  variants: {
686
629
  size: {
@@ -1457,113 +1400,76 @@ TextField.displayName = "TextField";
1457
1400
  TextField.Label.displayName = "TextField.Label";
1458
1401
  TextField.Input.displayName = "TextField.Input";
1459
1402
  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
1403
  var MODAL_PADDING = {
1499
1404
  body: "px-4 pb-4",
1500
1405
  footer: "px-4 py-3"
1501
1406
  };
1407
+ var MODAL_TRANSITION = "transition-[transform,scale,opacity] duration-200 data-[starting-style]:opacity-0 data-[ending-style]:opacity-0";
1502
1408
  var ModalContext = React.createContext({ size: "default" });
1503
- var ModalRoot = (props) => /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Root, { ...props });
1504
- var Modal = ModalRoot;
1505
- Modal.Trigger = React.forwardRef(
1506
- (props, ref) => /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Trigger, { ref, ...props })
1507
- );
1508
- Modal.Portal = (props) => /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Portal, { ...props });
1509
- Modal.Close = React.forwardRef(({ size, ...props }, ref) => {
1510
- const { size: modalSize } = React.useContext(ModalContext);
1511
- return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
1512
- Button,
1513
- {
1514
- ...props,
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,
1409
+ function ModalRoot(props) {
1410
+ return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Root, { ...props });
1411
+ }
1412
+ function ModalTrigger(props) {
1413
+ return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Trigger, { "data-slot": "modal-trigger", ...props });
1414
+ }
1415
+ function ModalPortal(props) {
1416
+ return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Portal, { ...props });
1417
+ }
1418
+ function ModalOverlay({ className, ...props }) {
1419
+ return /* @__PURE__ */ jsxRuntime.jsx(
1420
+ dialog.Dialog.Backdrop,
1524
1421
  {
1525
- ref,
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
- ),
1422
+ "data-slot": "modal-overlay",
1423
+ className: utils.cn("fixed inset-0 z-50 bg-component-dim", MODAL_TRANSITION, className),
1530
1424
  ...props
1531
1425
  }
1532
- )
1533
- );
1534
- Modal.Content = React.forwardRef(
1535
- ({ className, children, size = "default", onInteractOutside, onEscapeKeyDown, ...props }, ref) => {
1536
- const isFullSize = size === "fullsize";
1537
- const dismissGuard = useOverlayDismissGuard({ onEscapeKeyDown, onInteractOutside });
1538
- return /* @__PURE__ */ jsxRuntime.jsx(ModalContext.Provider, { value: { size }, children: /* @__PURE__ */ jsxRuntime.jsxs(Modal.Portal, { children: [
1539
- /* @__PURE__ */ jsxRuntime.jsx(Modal.Overlay, {}),
1540
- /* @__PURE__ */ jsxRuntime.jsx(
1541
- DialogPrimitive__namespace.Content,
1426
+ );
1427
+ }
1428
+ function ModalClose({ size, ...props }) {
1429
+ const { size: modalSize } = React.useContext(ModalContext);
1430
+ return /* @__PURE__ */ jsxRuntime.jsx(
1431
+ dialog.Dialog.Close,
1432
+ {
1433
+ render: /* @__PURE__ */ jsxRuntime.jsx(
1434
+ Button,
1542
1435
  {
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
1436
  ...props,
1555
- ...dismissGuard,
1556
- children
1437
+ variant: "assistive",
1438
+ size: size ?? (modalSize === "fullsize" ? "large" : "medium")
1557
1439
  }
1558
1440
  )
1559
- ] }) });
1560
- }
1561
- );
1562
- Modal.Header = React.forwardRef(
1563
- ({ className, line = false, rightSlot, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
1441
+ }
1442
+ );
1443
+ }
1444
+ function ModalContent({ className, children, size = "default", ...props }) {
1445
+ const isFullSize = size === "fullsize";
1446
+ return /* @__PURE__ */ jsxRuntime.jsx(ModalContext.Provider, { value: { size }, children: /* @__PURE__ */ jsxRuntime.jsxs(ModalPortal, { children: [
1447
+ /* @__PURE__ */ jsxRuntime.jsx(ModalOverlay, {}),
1448
+ /* @__PURE__ */ jsxRuntime.jsx(
1449
+ dialog.Dialog.Popup,
1450
+ {
1451
+ "data-slot": "modal-content",
1452
+ className: utils.cn(
1453
+ // 공통 스타일
1454
+ "fixed z-50 flex flex-col rounded-strong border border-border-primary bg-background-primary",
1455
+ MODAL_TRANSITION,
1456
+ isFullSize ? "inset-0 m-10" : (
1457
+ // 콘텐츠 높이를 따르되 뷰포트를 넘지 않는다. 넘치면 Body만 스크롤된다.
1458
+ "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"
1459
+ ),
1460
+ className
1461
+ ),
1462
+ ...props,
1463
+ children
1464
+ }
1465
+ )
1466
+ ] }) });
1467
+ }
1468
+ function ModalHeader({ className, line = false, rightSlot, children, ...props }) {
1469
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1564
1470
  "div",
1565
1471
  {
1566
- ref,
1472
+ "data-slot": "modal-header",
1567
1473
  className: utils.cn(
1568
1474
  "flex shrink-0 flex-row items-center gap-2 pl-4 pr-2 min-h-12",
1569
1475
  line && "border-b border-border-primary",
@@ -1573,8 +1479,9 @@ Modal.Header = React.forwardRef(
1573
1479
  children: [
1574
1480
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-1 flex-row items-center gap-1", children }),
1575
1481
  rightSlot === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(
1576
- DialogPrimitive__namespace.Close,
1482
+ dialog.Dialog.Close,
1577
1483
  {
1484
+ "data-slot": "modal-close-icon",
1578
1485
  className: utils.cn(
1579
1486
  "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
1487
  ),
@@ -1583,42 +1490,57 @@ Modal.Header = React.forwardRef(
1583
1490
  ) : rightSlot
1584
1491
  ]
1585
1492
  }
1586
- )
1587
- );
1588
- Modal.Body = React.forwardRef(
1589
- ({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1493
+ );
1494
+ }
1495
+ function ModalBody({
1496
+ className,
1497
+ children,
1498
+ scroll = true,
1499
+ horizontalScroll = false,
1500
+ ...props
1501
+ }) {
1502
+ const content = /* @__PURE__ */ jsxRuntime.jsx("div", { className: utils.cn(MODAL_PADDING.body, className), children });
1503
+ return /* @__PURE__ */ jsxRuntime.jsx(
1590
1504
  "div",
1591
1505
  {
1592
- ref,
1506
+ "data-slot": "modal-body",
1593
1507
  className: utils.cn(
1594
- "flex-1 flex flex-col min-h-0 h-full",
1595
- "[&_[data-slot=scroll-area-viewport]>div]:h-full"
1508
+ "flex-1 flex flex-col min-h-0",
1509
+ scroll && "h-full [&_[data-slot=scroll-area-viewport]>div]:h-full"
1596
1510
  ),
1597
1511
  ...props,
1598
- children: /* @__PURE__ */ jsxRuntime.jsx(chunkSX23SDUY_js.ScrollArea, { className: "h-full flex flex-col", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: utils.cn(MODAL_PADDING.body, className), children }) })
1512
+ children: scroll ? /* @__PURE__ */ jsxRuntime.jsx(chunkSX23SDUY_js.ScrollArea, { className: "h-full flex flex-col", disableHorizontalScroll: !horizontalScroll, children: content }) : content
1599
1513
  }
1600
- )
1601
- );
1602
- Modal.Footer = React.forwardRef(
1603
- ({ className, line = true, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1514
+ );
1515
+ }
1516
+ function ModalFooter({ className, line = true, ...props }) {
1517
+ const { size } = React.useContext(ModalContext);
1518
+ return /* @__PURE__ */ jsxRuntime.jsx(
1604
1519
  "div",
1605
1520
  {
1606
- ref,
1521
+ "data-slot": "modal-footer",
1607
1522
  className: utils.cn(
1608
- "flex flex-row items-center justify-between min-h-14 gap-3",
1523
+ "flex flex-row items-center justify-between gap-3",
1524
+ size === "fullsize" ? "min-h-16" : "min-h-14",
1609
1525
  line && "border-t border-border-primary",
1610
1526
  MODAL_PADDING.footer,
1611
1527
  className
1612
1528
  ),
1613
1529
  ...props
1614
1530
  }
1615
- )
1616
- );
1617
- Modal.FooterDescription = React.forwardRef(
1618
- ({ className, error = false, icon, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
1531
+ );
1532
+ }
1533
+ function ModalFooterDescription({
1534
+ className,
1535
+ error = false,
1536
+ icon,
1537
+ children,
1538
+ ...props
1539
+ }) {
1540
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1619
1541
  "div",
1620
1542
  {
1621
- ref,
1543
+ "data-slot": "modal-footer-description",
1622
1544
  className: utils.cn(
1623
1545
  "flex flex-row items-center gap-1 text-body-3",
1624
1546
  error ? "text-text-critical" : "text-text-tertiary",
@@ -1630,59 +1552,125 @@ Modal.FooterDescription = React.forwardRef(
1630
1552
  children
1631
1553
  ]
1632
1554
  }
1633
- )
1634
- );
1635
- Modal.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 }));
1636
- Modal.Action = React.forwardRef(
1637
- ({ color = "primary", size, ...props }, ref) => {
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,
1555
+ );
1556
+ }
1557
+ function ModalActions({ className, ...props }) {
1558
+ return /* @__PURE__ */ jsxRuntime.jsx(
1559
+ "div",
1654
1560
  {
1655
- ref,
1561
+ "data-slot": "modal-actions",
1562
+ className: utils.cn("ml-auto flex flex-row items-center gap-2", className),
1563
+ ...props
1564
+ }
1565
+ );
1566
+ }
1567
+ function ModalAction({ color = "primary", size, ...props }) {
1568
+ const { size: modalSize } = React.useContext(ModalContext);
1569
+ return /* @__PURE__ */ jsxRuntime.jsx(
1570
+ dialog.Dialog.Close,
1571
+ {
1572
+ render: /* @__PURE__ */ jsxRuntime.jsx(
1573
+ Button,
1574
+ {
1575
+ ...props,
1576
+ color,
1577
+ variant: "solid",
1578
+ size: size ?? (modalSize === "fullsize" ? "large" : "medium")
1579
+ }
1580
+ )
1581
+ }
1582
+ );
1583
+ }
1584
+ function ModalTitle({ className, ...props }) {
1585
+ return /* @__PURE__ */ jsxRuntime.jsx(
1586
+ dialog.Dialog.Title,
1587
+ {
1588
+ "data-slot": "modal-title",
1656
1589
  className: utils.cn(
1657
1590
  "text-body-1 font-semibold leading-none tracking-tight text-text-primary",
1658
1591
  className
1659
1592
  ),
1660
1593
  ...props
1661
1594
  }
1662
- )
1595
+ );
1596
+ }
1597
+ function ModalDescription({ className, ...props }) {
1598
+ return /* @__PURE__ */ jsxRuntime.jsx(
1599
+ dialog.Dialog.Description,
1600
+ {
1601
+ "data-slot": "modal-description",
1602
+ className: utils.cn("text-body-2 text-text-tertiary", className),
1603
+ ...props
1604
+ }
1605
+ );
1606
+ }
1607
+ ModalRoot.displayName = "Modal";
1608
+ ModalTrigger.displayName = "Modal.Trigger";
1609
+ ModalPortal.displayName = "Modal.Portal";
1610
+ ModalClose.displayName = "Modal.Close";
1611
+ ModalOverlay.displayName = "Modal.Overlay";
1612
+ ModalContent.displayName = "Modal.Content";
1613
+ ModalHeader.displayName = "Modal.Header";
1614
+ ModalBody.displayName = "Modal.Body";
1615
+ ModalFooter.displayName = "Modal.Footer";
1616
+ ModalFooterDescription.displayName = "Modal.FooterDescription";
1617
+ ModalActions.displayName = "Modal.Actions";
1618
+ ModalAction.displayName = "Modal.Action";
1619
+ ModalTitle.displayName = "Modal.Title";
1620
+ ModalDescription.displayName = "Modal.Description";
1621
+ var Modal = Object.assign(ModalRoot, {
1622
+ Trigger: ModalTrigger,
1623
+ Portal: ModalPortal,
1624
+ Close: ModalClose,
1625
+ Overlay: ModalOverlay,
1626
+ Content: ModalContent,
1627
+ Header: ModalHeader,
1628
+ Body: ModalBody,
1629
+ Footer: ModalFooter,
1630
+ FooterDescription: ModalFooterDescription,
1631
+ Actions: ModalActions,
1632
+ Action: ModalAction,
1633
+ Title: ModalTitle,
1634
+ Description: ModalDescription
1635
+ });
1636
+
1637
+ // src/hooks/useOverlayDismissGuard.ts
1638
+ var isBaseUiPopupOpen = () => Boolean(
1639
+ document.querySelector('[data-base-ui-portal] [data-slot="combobox-content"][data-open]')
1663
1640
  );
1664
- Modal.Description = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1665
- DialogPrimitive__namespace.Description,
1666
- {
1667
- ref,
1668
- className: utils.cn("text-body-2 text-text-tertiary", className),
1669
- ...props
1641
+ var isTargetInsideBaseUiPopup = (target) => target instanceof Element && Boolean(target.closest("[data-base-ui-portal]"));
1642
+ var shouldPreventDismissForSelect = (target) => {
1643
+ const isSelectOpen = Boolean(
1644
+ document.querySelector('[data-radix-select-content][data-state="open"]')
1645
+ );
1646
+ if (isSelectOpen) {
1647
+ return true;
1670
1648
  }
1671
- ));
1672
- Modal.displayName = "Modal";
1673
- Modal.Trigger.displayName = "Modal.Trigger";
1674
- Modal.Portal.displayName = "Modal.Portal";
1675
- Modal.Close.displayName = "Modal.Close";
1676
- Modal.Overlay.displayName = "Modal.Overlay";
1677
- Modal.Content.displayName = "Modal.Content";
1678
- Modal.Header.displayName = "Modal.Header";
1679
- Modal.Body.displayName = "Modal.Body";
1680
- Modal.Footer.displayName = "Modal.Footer";
1681
- Modal.FooterDescription.displayName = "Modal.FooterDescription";
1682
- Modal.Actions.displayName = "Modal.Actions";
1683
- Modal.Action.displayName = "Modal.Action";
1684
- Modal.Title.displayName = "Modal.Title";
1685
- Modal.Description.displayName = "Modal.Description";
1649
+ if (!(target instanceof Element)) {
1650
+ return false;
1651
+ }
1652
+ return Boolean(
1653
+ target.closest("[data-radix-select-content]") || target.closest("[data-radix-select-viewport]")
1654
+ );
1655
+ };
1656
+ function useOverlayDismissGuard({
1657
+ onInteractOutside,
1658
+ onEscapeKeyDown
1659
+ }) {
1660
+ const handleInteractOutside = (event) => {
1661
+ if (shouldPreventDismissForSelect(event.target) || isTargetInsideBaseUiPopup(event.target)) {
1662
+ event.preventDefault();
1663
+ }
1664
+ onInteractOutside?.(event);
1665
+ };
1666
+ const handleEscapeKeyDown = (event) => {
1667
+ if (isBaseUiPopupOpen()) {
1668
+ event.preventDefault();
1669
+ }
1670
+ onEscapeKeyDown?.(event);
1671
+ };
1672
+ return { onEscapeKeyDown: handleEscapeKeyDown, onInteractOutside: handleInteractOutside };
1673
+ }
1686
1674
 
1687
1675
  // src/sheet/sheetResize.ts
1688
1676
  var SHEET_EDGE_GAP = "[--sheet-edge-gap:40px]";
@@ -1809,18 +1797,18 @@ var SHEET_RESIZE_SIDE_CLASSES = {
1809
1797
  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
1798
  };
1811
1799
  var SheetContext = React.createContext({ side: "right" });
1812
- var SheetRoot = (props) => /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Root, { ...props });
1800
+ var SheetRoot = (props) => /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive2__namespace.Root, { ...props });
1813
1801
  var Sheet = SheetRoot;
1814
1802
  Sheet.Trigger = React.forwardRef(
1815
- (props, ref) => /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Trigger, { ref, ...props })
1803
+ (props, ref) => /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive2__namespace.Trigger, { ref, ...props })
1816
1804
  );
1817
- Sheet.Portal = (props) => /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Portal, { ...props });
1805
+ Sheet.Portal = (props) => /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive2__namespace.Portal, { ...props });
1818
1806
  Sheet.Close = React.forwardRef(
1819
- (props, ref) => /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Close, { ref, ...props })
1807
+ (props, ref) => /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive2__namespace.Close, { ref, ...props })
1820
1808
  );
1821
1809
  Sheet.Overlay = React.forwardRef(
1822
1810
  ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1823
- DialogPrimitive__namespace.Overlay,
1811
+ DialogPrimitive2__namespace.Overlay,
1824
1812
  {
1825
1813
  ref,
1826
1814
  className: utils.cn(
@@ -1847,7 +1835,7 @@ Sheet.Content = React.forwardRef(
1847
1835
  return /* @__PURE__ */ jsxRuntime.jsx(SheetContext.Provider, { value: { side }, children: /* @__PURE__ */ jsxRuntime.jsxs(Sheet.Portal, { children: [
1848
1836
  /* @__PURE__ */ jsxRuntime.jsx(Sheet.Overlay, {}),
1849
1837
  /* @__PURE__ */ jsxRuntime.jsx(
1850
- DialogPrimitive__namespace.Content,
1838
+ DialogPrimitive2__namespace.Content,
1851
1839
  {
1852
1840
  ref,
1853
1841
  className: utils.cn(
@@ -1867,7 +1855,7 @@ Sheet.Content = React.forwardRef(
1867
1855
  Sheet.Header = React.forwardRef(
1868
1856
  ({ className, line = true, rightSlot, children, ...props }, ref) => {
1869
1857
  const rightElement = rightSlot === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(
1870
- DialogPrimitive__namespace.Close,
1858
+ DialogPrimitive2__namespace.Close,
1871
1859
  {
1872
1860
  className: utils.cn(
1873
1861
  "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 +1941,7 @@ Sheet.FooterDescription = React.forwardRef(
1953
1941
  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
1942
  Sheet.Title = React.forwardRef(
1955
1943
  ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1956
- DialogPrimitive__namespace.Title,
1944
+ DialogPrimitive2__namespace.Title,
1957
1945
  {
1958
1946
  ref,
1959
1947
  className: utils.cn(
@@ -1965,7 +1953,7 @@ Sheet.Title = React.forwardRef(
1965
1953
  )
1966
1954
  );
1967
1955
  Sheet.Description = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1968
- DialogPrimitive__namespace.Description,
1956
+ DialogPrimitive2__namespace.Description,
1969
1957
  {
1970
1958
  ref,
1971
1959
  className: utils.cn("text-body-2 text-text-tertiary", className),
@@ -1985,77 +1973,111 @@ Sheet.FooterDescription.displayName = "Sheet.FooterDescription";
1985
1973
  Sheet.Actions.displayName = "Sheet.Actions";
1986
1974
  Sheet.Title.displayName = "Sheet.Title";
1987
1975
  Sheet.Description.displayName = "Sheet.Description";
1976
+ var MESSAGE_BOX_TRANSITION = "transition-[transform,scale,opacity] duration-200 data-[starting-style]:opacity-0 data-[ending-style]:opacity-0";
1988
1977
  var MessageBoxContext = React.createContext({ variant: "default" });
1989
- var MessageBoxRoot = (props) => /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Root, { ...props });
1990
- var MessageBox = MessageBoxRoot;
1991
- MessageBox.Trigger = React.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Trigger, { ref, ...props }));
1992
- MessageBox.Content = React.forwardRef(({ className, children, variant = "default", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(MessageBoxContext.Provider, { value: { variant }, children: /* @__PURE__ */ jsxRuntime.jsxs(DialogPrimitive__namespace.Portal, { children: [
1993
- /* @__PURE__ */ jsxRuntime.jsx(
1994
- DialogPrimitive__namespace.Overlay,
1978
+ function MessageBoxRoot(props) {
1979
+ return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Root, { ...props });
1980
+ }
1981
+ function MessageBoxTrigger(props) {
1982
+ return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Trigger, { "data-slot": "message-box-trigger", ...props });
1983
+ }
1984
+ function MessageBoxContent({
1985
+ className,
1986
+ children,
1987
+ variant = "default",
1988
+ ...props
1989
+ }) {
1990
+ return /* @__PURE__ */ jsxRuntime.jsx(MessageBoxContext.Provider, { value: { variant }, children: /* @__PURE__ */ jsxRuntime.jsxs(dialog.Dialog.Portal, { children: [
1991
+ /* @__PURE__ */ jsxRuntime.jsx(
1992
+ dialog.Dialog.Backdrop,
1993
+ {
1994
+ "data-slot": "message-box-overlay",
1995
+ className: utils.cn("fixed inset-0 z-50 bg-component-dim", MESSAGE_BOX_TRANSITION)
1996
+ }
1997
+ ),
1998
+ /* @__PURE__ */ jsxRuntime.jsx(
1999
+ dialog.Dialog.Popup,
2000
+ {
2001
+ "data-slot": "message-box-content",
2002
+ className: utils.cn(
2003
+ "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",
2004
+ MESSAGE_BOX_TRANSITION,
2005
+ "data-[starting-style]:scale-95 data-[ending-style]:scale-95",
2006
+ className
2007
+ ),
2008
+ ...props,
2009
+ children
2010
+ }
2011
+ )
2012
+ ] }) });
2013
+ }
2014
+ function MessageBoxTitle({ className, ...props }) {
2015
+ return /* @__PURE__ */ jsxRuntime.jsx(
2016
+ dialog.Dialog.Title,
1995
2017
  {
1996
- className: utils.cn(
1997
- "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"
1998
- )
2018
+ "data-slot": "message-box-title",
2019
+ className: utils.cn("w-full text-body-1 font-semibold text-text-primary", className),
2020
+ ...props
1999
2021
  }
2000
- ),
2001
- /* @__PURE__ */ jsxRuntime.jsx(
2002
- DialogPrimitive__namespace.Content,
2022
+ );
2023
+ }
2024
+ function MessageBoxDescription({ className, ...props }) {
2025
+ return /* @__PURE__ */ jsxRuntime.jsx(
2026
+ dialog.Dialog.Description,
2003
2027
  {
2004
- ref,
2005
- className: utils.cn(
2006
- "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%]",
2007
- className
2008
- ),
2009
- ...props,
2010
- children
2028
+ "data-slot": "message-box-description",
2029
+ className: utils.cn("w-full text-body-2 text-text-secondary", className),
2030
+ ...props
2011
2031
  }
2012
- )
2013
- ] }) }));
2014
- MessageBox.Title = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
2015
- DialogPrimitive__namespace.Title,
2016
- {
2017
- ref,
2018
- className: utils.cn("w-full text-body-1 font-semibold text-text-primary", className),
2019
- ...props
2020
- }
2021
- ));
2022
- MessageBox.Description = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
2023
- DialogPrimitive__namespace.Description,
2024
- {
2025
- ref,
2026
- className: utils.cn("w-full text-body-2 text-text-secondary", className),
2027
- ...props
2028
- }
2029
- ));
2030
- MessageBox.Actions = React.forwardRef(
2031
- ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: utils.cn("flex flex-row gap-2", className), ...props })
2032
- );
2033
- MessageBox.Cancel = React.forwardRef(
2034
- ({ size = "medium", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(Button, { ref, variant: "assistive", size, ...props }) })
2035
- );
2036
- MessageBox.Action = React.forwardRef(
2037
- ({ size = "medium", ...props }, ref) => {
2038
- const { variant } = React.useContext(MessageBoxContext);
2039
- return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
2040
- Button,
2041
- {
2042
- ref,
2043
- color: variant === "critical" ? "critical" : "primary",
2044
- variant: "solid",
2045
- size,
2046
- ...props
2047
- }
2048
- ) });
2049
- }
2050
- );
2051
- MessageBox.displayName = "MessageBox";
2052
- MessageBox.Trigger.displayName = "MessageBox.Trigger";
2053
- MessageBox.Content.displayName = "MessageBox.Content";
2054
- MessageBox.Title.displayName = "MessageBox.Title";
2055
- MessageBox.Description.displayName = "MessageBox.Description";
2056
- MessageBox.Actions.displayName = "MessageBox.Actions";
2057
- MessageBox.Cancel.displayName = "MessageBox.Cancel";
2058
- MessageBox.Action.displayName = "MessageBox.Action";
2032
+ );
2033
+ }
2034
+ function MessageBoxActions({ className, ...props }) {
2035
+ return /* @__PURE__ */ jsxRuntime.jsx(
2036
+ "div",
2037
+ {
2038
+ "data-slot": "message-box-actions",
2039
+ className: utils.cn("flex flex-row gap-2", className),
2040
+ ...props
2041
+ }
2042
+ );
2043
+ }
2044
+ function MessageBoxCancel({ size = "medium", ...props }) {
2045
+ return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Close, { render: /* @__PURE__ */ jsxRuntime.jsx(Button, { ...props, variant: "assistive", size }) });
2046
+ }
2047
+ function MessageBoxAction({ size = "medium", ...props }) {
2048
+ const { variant } = React.useContext(MessageBoxContext);
2049
+ return /* @__PURE__ */ jsxRuntime.jsx(
2050
+ dialog.Dialog.Close,
2051
+ {
2052
+ render: /* @__PURE__ */ jsxRuntime.jsx(
2053
+ Button,
2054
+ {
2055
+ ...props,
2056
+ color: variant === "critical" ? "critical" : "primary",
2057
+ variant: "solid",
2058
+ size
2059
+ }
2060
+ )
2061
+ }
2062
+ );
2063
+ }
2064
+ MessageBoxRoot.displayName = "MessageBox";
2065
+ MessageBoxTrigger.displayName = "MessageBox.Trigger";
2066
+ MessageBoxContent.displayName = "MessageBox.Content";
2067
+ MessageBoxTitle.displayName = "MessageBox.Title";
2068
+ MessageBoxDescription.displayName = "MessageBox.Description";
2069
+ MessageBoxActions.displayName = "MessageBox.Actions";
2070
+ MessageBoxCancel.displayName = "MessageBox.Cancel";
2071
+ MessageBoxAction.displayName = "MessageBox.Action";
2072
+ var MessageBox = Object.assign(MessageBoxRoot, {
2073
+ Trigger: MessageBoxTrigger,
2074
+ Content: MessageBoxContent,
2075
+ Title: MessageBoxTitle,
2076
+ Description: MessageBoxDescription,
2077
+ Actions: MessageBoxActions,
2078
+ Cancel: MessageBoxCancel,
2079
+ Action: MessageBoxAction
2080
+ });
2059
2081
  var containerVariants4 = utils.cva("inset-0 z-[49] flex items-center justify-center", {
2060
2082
  variants: {
2061
2083
  position: {