@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/{FlatTooltip-DqHMNx-V.d.mts → FlatTooltip-CQYzMWkr.d.mts} +1 -1
- package/dist/{FlatTooltip-DqHMNx-V.d.ts → FlatTooltip-CQYzMWkr.d.ts} +1 -1
- package/dist/flat/index.d.mts +2 -2
- package/dist/flat/index.d.ts +2 -2
- package/dist/index.d.mts +218 -72
- package/dist/index.d.ts +218 -72
- package/dist/index.js +446 -424
- package/dist/index.mjs +447 -425
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { overlayListVariants, commonInputVariants, textFieldVariants, ScrollArea, ConditionalTooltip } from './chunk-4JSE66SD.mjs';
|
|
2
2
|
export { ColorPalette, ColorPaletteColors, Combobox, ComboboxContent, ComboboxDescription, ComboboxEmpty, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSearch, ComboboxTrigger, ComboboxValue, DEFAULT_COLOR, ScrollArea, ScrollBar, Segment, Select, Tabs, Tooltip, colorPaletteColorClasses, getColorPaletteColor, isInPalette } from './chunk-4JSE66SD.mjs';
|
|
3
3
|
import { X, MoreHorizontal, iconSizes, Minus, Check, Person, Loading, Warning, Info, Error as Error$1, ChevronLeft, ChevronRight } from './chunk-4QQPDTTI.mjs';
|
|
4
4
|
import { cva, cn } from '@exem-ui/core/utils';
|
|
5
5
|
import * as React from 'react';
|
|
6
|
-
import { forwardRef, Fragment,
|
|
6
|
+
import { forwardRef, Fragment, useId, createContext, useContext, useState, cloneElement } from 'react';
|
|
7
7
|
import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
8
8
|
import { Slot } from '@radix-ui/react-slot';
|
|
9
|
+
import { Button as Button$1 } from '@base-ui/react/button';
|
|
9
10
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
10
11
|
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
11
12
|
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
12
13
|
import { DayPicker } from 'react-day-picker';
|
|
13
14
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
14
|
-
import
|
|
15
|
+
import { Dialog } from '@base-ui/react/dialog';
|
|
16
|
+
import * as DialogPrimitive2 from '@radix-ui/react-dialog';
|
|
15
17
|
import { Resizable } from 're-resizable';
|
|
16
18
|
import { Progress as Progress$1 } from '@base-ui/react/progress';
|
|
17
19
|
import { toast as toast$1, Toaster as Toaster$1 } from 'sonner';
|
|
@@ -403,185 +405,114 @@ Breadcrumb.Ellipsis.displayName = "Breadcrumb.Ellipsis";
|
|
|
403
405
|
var colorStyles = {
|
|
404
406
|
primary: {
|
|
405
407
|
solid: {
|
|
406
|
-
|
|
407
|
-
icon: "text-icon-inverse group-disabled/button:text-icon-inverse"
|
|
408
|
-
text: "text-text-inverse group-disabled/button:text-text-inverse"
|
|
408
|
+
root: "bg-solid-primary-default text-text-inverse hover:bg-solid-primary-hovered data-[disabled]:bg-solid-primary-disabled data-[disabled]:text-text-inverse",
|
|
409
|
+
icon: "text-icon-inverse group-data-[disabled]/button:text-icon-inverse"
|
|
409
410
|
},
|
|
410
411
|
assistive: {
|
|
411
|
-
|
|
412
|
-
icon: "text-icon-secondary group-disabled/button:text-icon-disabled"
|
|
413
|
-
text: "text-text-secondary group-disabled/button:text-text-disabled"
|
|
412
|
+
root: "bg-elevation-elevation-2 text-text-secondary hover:bg-elevation-elevation-3 data-[disabled]:bg-elevation-elevation-2 data-[disabled]:text-text-disabled",
|
|
413
|
+
icon: "text-icon-secondary group-data-[disabled]/button:text-icon-disabled"
|
|
414
414
|
},
|
|
415
415
|
outlined: {
|
|
416
|
-
|
|
417
|
-
icon: "text-icon-secondary group-disabled/button:text-icon-disabled"
|
|
418
|
-
text: "text-text-secondary group-disabled/button:text-text-disabled"
|
|
416
|
+
root: "border border-border-primary text-text-secondary hover:bg-elevation-elevation-2 data-[disabled]:border-border-primary data-[disabled]:text-text-disabled",
|
|
417
|
+
icon: "text-icon-secondary group-data-[disabled]/button:text-icon-disabled"
|
|
419
418
|
},
|
|
420
419
|
invisible: {
|
|
421
|
-
|
|
422
|
-
icon: "text-icon-secondary group-disabled/button:text-icon-disabled"
|
|
423
|
-
text: "text-text-secondary group-disabled/button:text-text-disabled"
|
|
420
|
+
root: "text-text-secondary hover:bg-elevation-elevation-2 data-[disabled]:text-text-disabled",
|
|
421
|
+
icon: "text-icon-secondary group-data-[disabled]/button:text-icon-disabled"
|
|
424
422
|
}
|
|
425
423
|
},
|
|
426
424
|
accent: {
|
|
427
425
|
solid: {
|
|
428
|
-
|
|
429
|
-
icon: "text-icon-static-light group-disabled/button:text-icon-inverse-disabled"
|
|
430
|
-
text: "text-text-static-light group-disabled/button:text-text-inverse-disabled"
|
|
426
|
+
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",
|
|
427
|
+
icon: "text-icon-static-light group-data-[disabled]/button:text-icon-inverse-disabled"
|
|
431
428
|
},
|
|
432
429
|
assistive: {
|
|
433
|
-
|
|
434
|
-
icon: "text-text-accent group-disabled/button:text-text-accent-disabled"
|
|
435
|
-
text: "text-text-accent group-disabled/button:text-text-accent-disabled"
|
|
430
|
+
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",
|
|
431
|
+
icon: "text-text-accent group-data-[disabled]/button:text-text-accent-disabled"
|
|
436
432
|
},
|
|
437
433
|
outlined: {
|
|
438
|
-
|
|
439
|
-
icon: "text-text-accent group-disabled/button:text-text-accent-disabled"
|
|
440
|
-
text: "text-text-accent group-disabled/button:text-text-accent-disabled"
|
|
434
|
+
root: "border border-border-primary text-text-accent hover:bg-elevation-accent-0 data-[disabled]:border-border-primary data-[disabled]:text-text-accent-disabled",
|
|
435
|
+
icon: "text-text-accent group-data-[disabled]/button:text-text-accent-disabled"
|
|
441
436
|
},
|
|
442
437
|
invisible: {
|
|
443
|
-
|
|
444
|
-
icon: "text-text-accent group-disabled/button:text-text-accent-disabled"
|
|
445
|
-
text: "text-text-accent group-disabled/button:text-text-accent-disabled"
|
|
438
|
+
root: "text-text-accent hover:bg-elevation-accent-0 data-[disabled]:text-text-accent-disabled",
|
|
439
|
+
icon: "text-text-accent group-data-[disabled]/button:text-text-accent-disabled"
|
|
446
440
|
}
|
|
447
441
|
},
|
|
448
442
|
critical: {
|
|
449
443
|
solid: {
|
|
450
|
-
|
|
451
|
-
icon: "text-icon-static-light group-disabled/button:text-icon-inverse-disabled"
|
|
452
|
-
text: "text-text-static-light group-disabled/button:text-text-inverse-disabled"
|
|
444
|
+
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",
|
|
445
|
+
icon: "text-icon-static-light group-data-[disabled]/button:text-icon-inverse-disabled"
|
|
453
446
|
},
|
|
454
447
|
assistive: {
|
|
455
|
-
|
|
456
|
-
icon: "text-text-critical group-disabled/button:text-text-critical-disabled"
|
|
457
|
-
text: "text-text-critical group-disabled/button:text-text-critical-disabled"
|
|
448
|
+
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",
|
|
449
|
+
icon: "text-text-critical group-data-[disabled]/button:text-text-critical-disabled"
|
|
458
450
|
},
|
|
459
451
|
outlined: {
|
|
460
|
-
|
|
461
|
-
icon: "text-text-critical group-disabled/button:text-text-critical-disabled"
|
|
462
|
-
text: "text-text-critical group-disabled/button:text-text-critical-disabled"
|
|
452
|
+
root: "border border-border-primary text-text-critical hover:bg-elevation-critical-0 data-[disabled]:border-border-primary data-[disabled]:text-text-critical-disabled",
|
|
453
|
+
icon: "text-text-critical group-data-[disabled]/button:text-text-critical-disabled"
|
|
463
454
|
},
|
|
464
455
|
invisible: {
|
|
465
|
-
|
|
466
|
-
icon: "text-text-critical group-disabled/button:text-text-critical-disabled"
|
|
467
|
-
text: "text-text-critical group-disabled/button:text-text-critical-disabled"
|
|
456
|
+
root: "text-text-critical hover:bg-elevation-critical-0 data-[disabled]:text-text-critical-disabled",
|
|
457
|
+
icon: "text-text-critical group-data-[disabled]/button:text-text-critical-disabled"
|
|
468
458
|
}
|
|
469
459
|
}
|
|
470
460
|
};
|
|
471
461
|
var buttonVariants = cva(
|
|
472
|
-
"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",
|
|
462
|
+
"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",
|
|
473
463
|
{
|
|
474
|
-
compoundVariants: [
|
|
475
|
-
// Primary 색상 조합
|
|
476
|
-
{ className: colorStyles.primary.solid.button, color: "primary", variant: "solid" },
|
|
477
|
-
{ className: colorStyles.primary.assistive.button, color: "primary", variant: "assistive" },
|
|
478
|
-
{ className: colorStyles.primary.outlined.button, color: "primary", variant: "outlined" },
|
|
479
|
-
{ className: colorStyles.primary.invisible.button, color: "primary", variant: "invisible" },
|
|
480
|
-
// Accent 색상 조합
|
|
481
|
-
{ className: colorStyles.accent.solid.button, color: "accent", variant: "solid" },
|
|
482
|
-
{ className: colorStyles.accent.assistive.button, color: "accent", variant: "assistive" },
|
|
483
|
-
{ className: colorStyles.accent.outlined.button, color: "accent", variant: "outlined" },
|
|
484
|
-
{ className: colorStyles.accent.invisible.button, color: "accent", variant: "invisible" },
|
|
485
|
-
// Critical 색상 조합
|
|
486
|
-
{ className: colorStyles.critical.solid.button, color: "critical", variant: "solid" },
|
|
487
|
-
{ className: colorStyles.critical.assistive.button, color: "critical", variant: "assistive" },
|
|
488
|
-
{ className: colorStyles.critical.outlined.button, color: "critical", variant: "outlined" },
|
|
489
|
-
{ className: colorStyles.critical.invisible.button, color: "critical", variant: "invisible" },
|
|
490
|
-
// background 표면은 outlined/invisible 에서만 추가
|
|
491
|
-
{
|
|
492
|
-
className: "bg-elevation-elevation-0",
|
|
493
|
-
background: "fill",
|
|
494
|
-
variant: ["outlined", "invisible"]
|
|
495
|
-
}
|
|
496
|
-
],
|
|
497
464
|
defaultVariants: {
|
|
498
|
-
|
|
499
|
-
color: "primary",
|
|
500
|
-
size: "medium",
|
|
501
|
-
variant: "solid"
|
|
465
|
+
size: "medium"
|
|
502
466
|
},
|
|
503
467
|
variants: {
|
|
504
|
-
background: {
|
|
505
|
-
none: "",
|
|
506
|
-
fill: ""
|
|
507
|
-
},
|
|
508
|
-
color: {
|
|
509
|
-
accent: "",
|
|
510
|
-
critical: "",
|
|
511
|
-
primary: ""
|
|
512
|
-
},
|
|
513
468
|
size: {
|
|
514
469
|
xsmall: "h-6 gap-0 px-1 text-body-3 font-medium",
|
|
515
470
|
small: "h-7 gap-0.5 px-1.5 text-body-2 font-medium",
|
|
516
471
|
medium: "h-8 gap-0.5 px-2 text-body-2 font-medium",
|
|
517
472
|
large: "h-10 gap-1 px-2.5 text-body-1 font-medium",
|
|
518
473
|
xlarge: "h-12 gap-1 px-3 text-title-2 font-medium"
|
|
519
|
-
},
|
|
520
|
-
variant: {
|
|
521
|
-
solid: "",
|
|
522
|
-
assistive: "",
|
|
523
|
-
outlined: "",
|
|
524
|
-
invisible: ""
|
|
525
474
|
}
|
|
526
475
|
}
|
|
527
476
|
}
|
|
528
477
|
);
|
|
529
|
-
var
|
|
478
|
+
var iconSizeMap = {
|
|
530
479
|
xsmall: iconSizes.sm,
|
|
531
480
|
small: iconSizes.sm,
|
|
532
481
|
medium: iconSizes.sm,
|
|
533
482
|
large: iconSizes.md,
|
|
534
483
|
xlarge: iconSizes.lg
|
|
535
484
|
};
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
"
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
),
|
|
560
|
-
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
className: cn(
|
|
568
|
-
buttonVariants({
|
|
569
|
-
background,
|
|
570
|
-
className,
|
|
571
|
-
color,
|
|
572
|
-
size,
|
|
573
|
-
variant
|
|
574
|
-
}),
|
|
575
|
-
"group/button"
|
|
576
|
-
),
|
|
577
|
-
ref,
|
|
578
|
-
...props,
|
|
579
|
-
children: content
|
|
580
|
-
}
|
|
581
|
-
);
|
|
582
|
-
}
|
|
583
|
-
);
|
|
584
|
-
Button.displayName = "Button";
|
|
485
|
+
function Button({
|
|
486
|
+
className,
|
|
487
|
+
variant = "solid",
|
|
488
|
+
color = "primary",
|
|
489
|
+
background,
|
|
490
|
+
size = "medium",
|
|
491
|
+
icon,
|
|
492
|
+
children,
|
|
493
|
+
...props
|
|
494
|
+
}) {
|
|
495
|
+
return /* @__PURE__ */ jsxs(
|
|
496
|
+
Button$1,
|
|
497
|
+
{
|
|
498
|
+
className: cn(
|
|
499
|
+
buttonVariants({ size }),
|
|
500
|
+
colorStyles[color][variant].root,
|
|
501
|
+
background === "fill" && (variant === "outlined" || variant === "invisible") && "bg-elevation-elevation-0",
|
|
502
|
+
"group/button",
|
|
503
|
+
className
|
|
504
|
+
),
|
|
505
|
+
...props,
|
|
506
|
+
children: [
|
|
507
|
+
icon && cloneElement(icon, {
|
|
508
|
+
className: cn("shrink-0", colorStyles[color][variant].icon, icon.props.className),
|
|
509
|
+
size: icon.props.size ?? iconSizeMap[size]
|
|
510
|
+
}),
|
|
511
|
+
children != null && /* @__PURE__ */ jsx("span", { className: cn("min-w-0 truncate", size === "xlarge" ? "px-1" : "px-0.5"), children })
|
|
512
|
+
]
|
|
513
|
+
}
|
|
514
|
+
);
|
|
515
|
+
}
|
|
585
516
|
var iconButtonSizeClasses = {
|
|
586
517
|
xsmall: "size-6",
|
|
587
518
|
small: "size-7",
|
|
@@ -589,73 +520,85 @@ var iconButtonSizeClasses = {
|
|
|
589
520
|
large: "size-10",
|
|
590
521
|
xlarge: "size-12"
|
|
591
522
|
};
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
523
|
+
function IconButton({
|
|
524
|
+
className,
|
|
525
|
+
tooltip,
|
|
526
|
+
icon,
|
|
527
|
+
size = "medium",
|
|
528
|
+
"aria-label": ariaLabel,
|
|
529
|
+
"aria-labelledby": ariaLabelledBy,
|
|
530
|
+
...props
|
|
531
|
+
}) {
|
|
532
|
+
const tooltipLabel = typeof tooltip === "string" ? tooltip : void 0;
|
|
533
|
+
return /* @__PURE__ */ jsx(ConditionalTooltip, { tooltip, children: /* @__PURE__ */ jsx(
|
|
534
|
+
Button,
|
|
535
|
+
{
|
|
536
|
+
"aria-label": ariaLabel ?? (ariaLabelledBy === void 0 ? tooltipLabel : void 0),
|
|
537
|
+
"aria-labelledby": ariaLabelledBy,
|
|
595
538
|
className: cn(iconButtonSizeClasses[size], "px-0", className),
|
|
596
539
|
icon,
|
|
597
540
|
size,
|
|
598
541
|
...props
|
|
599
|
-
};
|
|
600
|
-
return /* @__PURE__ */ jsx(ConditionalTooltip, { tooltip, children: /* @__PURE__ */ jsx(Button, { ref, ...buttonProps }) });
|
|
601
|
-
}
|
|
602
|
-
);
|
|
603
|
-
IconButton.displayName = "IconButton";
|
|
604
|
-
var ButtonGroup = forwardRef(
|
|
605
|
-
({
|
|
606
|
-
variant = "contained",
|
|
607
|
-
iconOnly = false,
|
|
608
|
-
hasBackground = false,
|
|
609
|
-
size = "medium",
|
|
610
|
-
items,
|
|
611
|
-
className
|
|
612
|
-
}, ref) => {
|
|
613
|
-
if (items.length === 0) {
|
|
614
|
-
return null;
|
|
615
542
|
}
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
const isLast = index === items.length - 1;
|
|
630
|
-
const roundedClasses = cn("rounded-none", {
|
|
631
|
-
"rounded-l-medium": isFirst,
|
|
632
|
-
"rounded-r-medium": isLast
|
|
633
|
-
});
|
|
634
|
-
const dividerClasses = !isOutlined && !isLast ? "border-r border-border-primary" : "";
|
|
635
|
-
const mergeClasses = isOutlined && !isFirst ? "-ml-px" : "";
|
|
636
|
-
const hoverClasses = isOutlined ? "relative hover:z-10" : "";
|
|
637
|
-
if (iconOnly) {
|
|
638
|
-
const iconBaseProps = {
|
|
639
|
-
className: cn(roundedClasses, dividerClasses, mergeClasses, hoverClasses),
|
|
640
|
-
icon: item.icon,
|
|
641
|
-
onClick: item.onClick,
|
|
642
|
-
size
|
|
643
|
-
};
|
|
644
|
-
return /* @__PURE__ */ jsx(ConditionalTooltip, { tooltip: item.tooltip, children: variant === "contained" ? /* @__PURE__ */ jsx(IconButton, { ...iconBaseProps, variant: "assistive" }) : /* @__PURE__ */ jsx(IconButton, { ...iconBaseProps, color: "primary", variant: "outlined" }) }, item.id);
|
|
645
|
-
}
|
|
646
|
-
const buttonBaseProps = {
|
|
647
|
-
className: cn(roundedClasses, dividerClasses, mergeClasses, hoverClasses),
|
|
648
|
-
icon: item.icon,
|
|
649
|
-
onClick: item.onClick,
|
|
650
|
-
size
|
|
651
|
-
};
|
|
652
|
-
return /* @__PURE__ */ jsx(ConditionalTooltip, { tooltip: item.tooltip, children: variant === "contained" ? /* @__PURE__ */ jsx(Button, { ...buttonBaseProps, variant: "assistive", children: item.label }) : /* @__PURE__ */ jsx(Button, { ...buttonBaseProps, color: "primary", variant: "outlined", children: item.label }) }, item.id);
|
|
653
|
-
})
|
|
654
|
-
}
|
|
655
|
-
);
|
|
543
|
+
) });
|
|
544
|
+
}
|
|
545
|
+
function ButtonGroup({
|
|
546
|
+
variant = "contained",
|
|
547
|
+
iconOnly = false,
|
|
548
|
+
hasBackground = false,
|
|
549
|
+
size = "medium",
|
|
550
|
+
items,
|
|
551
|
+
className,
|
|
552
|
+
...props
|
|
553
|
+
}) {
|
|
554
|
+
if (items.length === 0) {
|
|
555
|
+
return null;
|
|
656
556
|
}
|
|
657
|
-
|
|
658
|
-
|
|
557
|
+
const isOutlined = variant === "outlined";
|
|
558
|
+
const buttonVariantProps = isOutlined ? { color: "primary", variant: "outlined" } : { variant: "assistive" };
|
|
559
|
+
return /* @__PURE__ */ jsx(
|
|
560
|
+
"div",
|
|
561
|
+
{
|
|
562
|
+
...props,
|
|
563
|
+
className: cn(
|
|
564
|
+
"inline-flex items-center overflow-hidden rounded-medium",
|
|
565
|
+
hasBackground && "bg-elevation-elevation-0",
|
|
566
|
+
className
|
|
567
|
+
),
|
|
568
|
+
role: "group",
|
|
569
|
+
children: items.map((item, index) => {
|
|
570
|
+
const isFirst = index === 0;
|
|
571
|
+
const isLast = index === items.length - 1;
|
|
572
|
+
const roundedClasses = cn("rounded-none", {
|
|
573
|
+
"rounded-l-medium": isFirst,
|
|
574
|
+
"rounded-r-medium": isLast
|
|
575
|
+
});
|
|
576
|
+
const dividerClasses = !isOutlined && !isLast ? "border-r border-border-primary" : "";
|
|
577
|
+
const mergeClasses = isOutlined && !isFirst ? "-ml-px" : "";
|
|
578
|
+
const hoverClasses = isOutlined ? "relative hover:z-10" : "";
|
|
579
|
+
const buttonBaseProps = {
|
|
580
|
+
className: cn(roundedClasses, dividerClasses, mergeClasses, hoverClasses),
|
|
581
|
+
onClick: item.onClick,
|
|
582
|
+
size,
|
|
583
|
+
...buttonVariantProps
|
|
584
|
+
};
|
|
585
|
+
if (iconOnly) {
|
|
586
|
+
return /* @__PURE__ */ jsx(
|
|
587
|
+
IconButton,
|
|
588
|
+
{
|
|
589
|
+
...buttonBaseProps,
|
|
590
|
+
"aria-label": item.label,
|
|
591
|
+
icon: item.icon,
|
|
592
|
+
tooltip: item.tooltip
|
|
593
|
+
},
|
|
594
|
+
item.id
|
|
595
|
+
);
|
|
596
|
+
}
|
|
597
|
+
return /* @__PURE__ */ jsx(ConditionalTooltip, { tooltip: item.tooltip, children: /* @__PURE__ */ jsx(Button, { ...buttonBaseProps, icon: item.icon, children: item.label }) }, item.id);
|
|
598
|
+
})
|
|
599
|
+
}
|
|
600
|
+
);
|
|
601
|
+
}
|
|
659
602
|
var containerVariants = cva("inline-flex items-center", {
|
|
660
603
|
variants: {
|
|
661
604
|
size: {
|
|
@@ -1432,113 +1375,76 @@ TextField.displayName = "TextField";
|
|
|
1432
1375
|
TextField.Label.displayName = "TextField.Label";
|
|
1433
1376
|
TextField.Input.displayName = "TextField.Input";
|
|
1434
1377
|
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
1378
|
var MODAL_PADDING = {
|
|
1474
1379
|
body: "px-4 pb-4",
|
|
1475
1380
|
footer: "px-4 py-3"
|
|
1476
1381
|
};
|
|
1382
|
+
var MODAL_TRANSITION = "transition-[transform,scale,opacity] duration-200 data-[starting-style]:opacity-0 data-[ending-style]:opacity-0";
|
|
1477
1383
|
var ModalContext = createContext({ size: "default" });
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
);
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
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,
|
|
1384
|
+
function ModalRoot(props) {
|
|
1385
|
+
return /* @__PURE__ */ jsx(Dialog.Root, { ...props });
|
|
1386
|
+
}
|
|
1387
|
+
function ModalTrigger(props) {
|
|
1388
|
+
return /* @__PURE__ */ jsx(Dialog.Trigger, { "data-slot": "modal-trigger", ...props });
|
|
1389
|
+
}
|
|
1390
|
+
function ModalPortal(props) {
|
|
1391
|
+
return /* @__PURE__ */ jsx(Dialog.Portal, { ...props });
|
|
1392
|
+
}
|
|
1393
|
+
function ModalOverlay({ className, ...props }) {
|
|
1394
|
+
return /* @__PURE__ */ jsx(
|
|
1395
|
+
Dialog.Backdrop,
|
|
1499
1396
|
{
|
|
1500
|
-
|
|
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
|
-
),
|
|
1397
|
+
"data-slot": "modal-overlay",
|
|
1398
|
+
className: cn("fixed inset-0 z-50 bg-component-dim", MODAL_TRANSITION, className),
|
|
1505
1399
|
...props
|
|
1506
1400
|
}
|
|
1507
|
-
)
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
/* @__PURE__ */ jsx(
|
|
1515
|
-
|
|
1516
|
-
DialogPrimitive.Content,
|
|
1401
|
+
);
|
|
1402
|
+
}
|
|
1403
|
+
function ModalClose({ size, ...props }) {
|
|
1404
|
+
const { size: modalSize } = useContext(ModalContext);
|
|
1405
|
+
return /* @__PURE__ */ jsx(
|
|
1406
|
+
Dialog.Close,
|
|
1407
|
+
{
|
|
1408
|
+
render: /* @__PURE__ */ jsx(
|
|
1409
|
+
Button,
|
|
1517
1410
|
{
|
|
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
1411
|
...props,
|
|
1530
|
-
|
|
1531
|
-
|
|
1412
|
+
variant: "assistive",
|
|
1413
|
+
size: size ?? (modalSize === "fullsize" ? "large" : "medium")
|
|
1532
1414
|
}
|
|
1533
1415
|
)
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1416
|
+
}
|
|
1417
|
+
);
|
|
1418
|
+
}
|
|
1419
|
+
function ModalContent({ className, children, size = "default", ...props }) {
|
|
1420
|
+
const isFullSize = size === "fullsize";
|
|
1421
|
+
return /* @__PURE__ */ jsx(ModalContext.Provider, { value: { size }, children: /* @__PURE__ */ jsxs(ModalPortal, { children: [
|
|
1422
|
+
/* @__PURE__ */ jsx(ModalOverlay, {}),
|
|
1423
|
+
/* @__PURE__ */ jsx(
|
|
1424
|
+
Dialog.Popup,
|
|
1425
|
+
{
|
|
1426
|
+
"data-slot": "modal-content",
|
|
1427
|
+
className: cn(
|
|
1428
|
+
// 공통 스타일
|
|
1429
|
+
"fixed z-50 flex flex-col rounded-strong border border-border-primary bg-background-primary",
|
|
1430
|
+
MODAL_TRANSITION,
|
|
1431
|
+
isFullSize ? "inset-0 m-10" : (
|
|
1432
|
+
// 콘텐츠 높이를 따르되 뷰포트를 넘지 않는다. 넘치면 Body만 스크롤된다.
|
|
1433
|
+
"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"
|
|
1434
|
+
),
|
|
1435
|
+
className
|
|
1436
|
+
),
|
|
1437
|
+
...props,
|
|
1438
|
+
children
|
|
1439
|
+
}
|
|
1440
|
+
)
|
|
1441
|
+
] }) });
|
|
1442
|
+
}
|
|
1443
|
+
function ModalHeader({ className, line = false, rightSlot, children, ...props }) {
|
|
1444
|
+
return /* @__PURE__ */ jsxs(
|
|
1539
1445
|
"div",
|
|
1540
1446
|
{
|
|
1541
|
-
|
|
1447
|
+
"data-slot": "modal-header",
|
|
1542
1448
|
className: cn(
|
|
1543
1449
|
"flex shrink-0 flex-row items-center gap-2 pl-4 pr-2 min-h-12",
|
|
1544
1450
|
line && "border-b border-border-primary",
|
|
@@ -1548,8 +1454,9 @@ Modal.Header = forwardRef(
|
|
|
1548
1454
|
children: [
|
|
1549
1455
|
/* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-row items-center gap-1", children }),
|
|
1550
1456
|
rightSlot === void 0 ? /* @__PURE__ */ jsx(
|
|
1551
|
-
|
|
1457
|
+
Dialog.Close,
|
|
1552
1458
|
{
|
|
1459
|
+
"data-slot": "modal-close-icon",
|
|
1553
1460
|
className: cn(
|
|
1554
1461
|
"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
1462
|
),
|
|
@@ -1558,42 +1465,57 @@ Modal.Header = forwardRef(
|
|
|
1558
1465
|
) : rightSlot
|
|
1559
1466
|
]
|
|
1560
1467
|
}
|
|
1561
|
-
)
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1468
|
+
);
|
|
1469
|
+
}
|
|
1470
|
+
function ModalBody({
|
|
1471
|
+
className,
|
|
1472
|
+
children,
|
|
1473
|
+
scroll = true,
|
|
1474
|
+
horizontalScroll = false,
|
|
1475
|
+
...props
|
|
1476
|
+
}) {
|
|
1477
|
+
const content = /* @__PURE__ */ jsx("div", { className: cn(MODAL_PADDING.body, className), children });
|
|
1478
|
+
return /* @__PURE__ */ jsx(
|
|
1565
1479
|
"div",
|
|
1566
1480
|
{
|
|
1567
|
-
|
|
1481
|
+
"data-slot": "modal-body",
|
|
1568
1482
|
className: cn(
|
|
1569
|
-
"flex-1 flex flex-col min-h-0
|
|
1570
|
-
"[&_[data-slot=scroll-area-viewport]>div]:h-full"
|
|
1483
|
+
"flex-1 flex flex-col min-h-0",
|
|
1484
|
+
scroll && "h-full [&_[data-slot=scroll-area-viewport]>div]:h-full"
|
|
1571
1485
|
),
|
|
1572
1486
|
...props,
|
|
1573
|
-
children: /* @__PURE__ */ jsx(ScrollArea, { className: "h-full flex flex-col",
|
|
1487
|
+
children: scroll ? /* @__PURE__ */ jsx(ScrollArea, { className: "h-full flex flex-col", disableHorizontalScroll: !horizontalScroll, children: content }) : content
|
|
1574
1488
|
}
|
|
1575
|
-
)
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1489
|
+
);
|
|
1490
|
+
}
|
|
1491
|
+
function ModalFooter({ className, line = true, ...props }) {
|
|
1492
|
+
const { size } = useContext(ModalContext);
|
|
1493
|
+
return /* @__PURE__ */ jsx(
|
|
1579
1494
|
"div",
|
|
1580
1495
|
{
|
|
1581
|
-
|
|
1496
|
+
"data-slot": "modal-footer",
|
|
1582
1497
|
className: cn(
|
|
1583
|
-
"flex flex-row items-center justify-between
|
|
1498
|
+
"flex flex-row items-center justify-between gap-3",
|
|
1499
|
+
size === "fullsize" ? "min-h-16" : "min-h-14",
|
|
1584
1500
|
line && "border-t border-border-primary",
|
|
1585
1501
|
MODAL_PADDING.footer,
|
|
1586
1502
|
className
|
|
1587
1503
|
),
|
|
1588
1504
|
...props
|
|
1589
1505
|
}
|
|
1590
|
-
)
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1506
|
+
);
|
|
1507
|
+
}
|
|
1508
|
+
function ModalFooterDescription({
|
|
1509
|
+
className,
|
|
1510
|
+
error = false,
|
|
1511
|
+
icon,
|
|
1512
|
+
children,
|
|
1513
|
+
...props
|
|
1514
|
+
}) {
|
|
1515
|
+
return /* @__PURE__ */ jsxs(
|
|
1594
1516
|
"div",
|
|
1595
1517
|
{
|
|
1596
|
-
|
|
1518
|
+
"data-slot": "modal-footer-description",
|
|
1597
1519
|
className: cn(
|
|
1598
1520
|
"flex flex-row items-center gap-1 text-body-3",
|
|
1599
1521
|
error ? "text-text-critical" : "text-text-tertiary",
|
|
@@ -1605,59 +1527,125 @@ Modal.FooterDescription = forwardRef(
|
|
|
1605
1527
|
children
|
|
1606
1528
|
]
|
|
1607
1529
|
}
|
|
1608
|
-
)
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
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,
|
|
1530
|
+
);
|
|
1531
|
+
}
|
|
1532
|
+
function ModalActions({ className, ...props }) {
|
|
1533
|
+
return /* @__PURE__ */ jsx(
|
|
1534
|
+
"div",
|
|
1629
1535
|
{
|
|
1630
|
-
|
|
1536
|
+
"data-slot": "modal-actions",
|
|
1537
|
+
className: cn("ml-auto flex flex-row items-center gap-2", className),
|
|
1538
|
+
...props
|
|
1539
|
+
}
|
|
1540
|
+
);
|
|
1541
|
+
}
|
|
1542
|
+
function ModalAction({ color = "primary", size, ...props }) {
|
|
1543
|
+
const { size: modalSize } = useContext(ModalContext);
|
|
1544
|
+
return /* @__PURE__ */ jsx(
|
|
1545
|
+
Dialog.Close,
|
|
1546
|
+
{
|
|
1547
|
+
render: /* @__PURE__ */ jsx(
|
|
1548
|
+
Button,
|
|
1549
|
+
{
|
|
1550
|
+
...props,
|
|
1551
|
+
color,
|
|
1552
|
+
variant: "solid",
|
|
1553
|
+
size: size ?? (modalSize === "fullsize" ? "large" : "medium")
|
|
1554
|
+
}
|
|
1555
|
+
)
|
|
1556
|
+
}
|
|
1557
|
+
);
|
|
1558
|
+
}
|
|
1559
|
+
function ModalTitle({ className, ...props }) {
|
|
1560
|
+
return /* @__PURE__ */ jsx(
|
|
1561
|
+
Dialog.Title,
|
|
1562
|
+
{
|
|
1563
|
+
"data-slot": "modal-title",
|
|
1631
1564
|
className: cn(
|
|
1632
1565
|
"text-body-1 font-semibold leading-none tracking-tight text-text-primary",
|
|
1633
1566
|
className
|
|
1634
1567
|
),
|
|
1635
1568
|
...props
|
|
1636
1569
|
}
|
|
1637
|
-
)
|
|
1570
|
+
);
|
|
1571
|
+
}
|
|
1572
|
+
function ModalDescription({ className, ...props }) {
|
|
1573
|
+
return /* @__PURE__ */ jsx(
|
|
1574
|
+
Dialog.Description,
|
|
1575
|
+
{
|
|
1576
|
+
"data-slot": "modal-description",
|
|
1577
|
+
className: cn("text-body-2 text-text-tertiary", className),
|
|
1578
|
+
...props
|
|
1579
|
+
}
|
|
1580
|
+
);
|
|
1581
|
+
}
|
|
1582
|
+
ModalRoot.displayName = "Modal";
|
|
1583
|
+
ModalTrigger.displayName = "Modal.Trigger";
|
|
1584
|
+
ModalPortal.displayName = "Modal.Portal";
|
|
1585
|
+
ModalClose.displayName = "Modal.Close";
|
|
1586
|
+
ModalOverlay.displayName = "Modal.Overlay";
|
|
1587
|
+
ModalContent.displayName = "Modal.Content";
|
|
1588
|
+
ModalHeader.displayName = "Modal.Header";
|
|
1589
|
+
ModalBody.displayName = "Modal.Body";
|
|
1590
|
+
ModalFooter.displayName = "Modal.Footer";
|
|
1591
|
+
ModalFooterDescription.displayName = "Modal.FooterDescription";
|
|
1592
|
+
ModalActions.displayName = "Modal.Actions";
|
|
1593
|
+
ModalAction.displayName = "Modal.Action";
|
|
1594
|
+
ModalTitle.displayName = "Modal.Title";
|
|
1595
|
+
ModalDescription.displayName = "Modal.Description";
|
|
1596
|
+
var Modal = Object.assign(ModalRoot, {
|
|
1597
|
+
Trigger: ModalTrigger,
|
|
1598
|
+
Portal: ModalPortal,
|
|
1599
|
+
Close: ModalClose,
|
|
1600
|
+
Overlay: ModalOverlay,
|
|
1601
|
+
Content: ModalContent,
|
|
1602
|
+
Header: ModalHeader,
|
|
1603
|
+
Body: ModalBody,
|
|
1604
|
+
Footer: ModalFooter,
|
|
1605
|
+
FooterDescription: ModalFooterDescription,
|
|
1606
|
+
Actions: ModalActions,
|
|
1607
|
+
Action: ModalAction,
|
|
1608
|
+
Title: ModalTitle,
|
|
1609
|
+
Description: ModalDescription
|
|
1610
|
+
});
|
|
1611
|
+
|
|
1612
|
+
// src/hooks/useOverlayDismissGuard.ts
|
|
1613
|
+
var isBaseUiPopupOpen = () => Boolean(
|
|
1614
|
+
document.querySelector('[data-base-ui-portal] [data-slot="combobox-content"][data-open]')
|
|
1638
1615
|
);
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1616
|
+
var isTargetInsideBaseUiPopup = (target) => target instanceof Element && Boolean(target.closest("[data-base-ui-portal]"));
|
|
1617
|
+
var shouldPreventDismissForSelect = (target) => {
|
|
1618
|
+
const isSelectOpen = Boolean(
|
|
1619
|
+
document.querySelector('[data-radix-select-content][data-state="open"]')
|
|
1620
|
+
);
|
|
1621
|
+
if (isSelectOpen) {
|
|
1622
|
+
return true;
|
|
1645
1623
|
}
|
|
1646
|
-
))
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1624
|
+
if (!(target instanceof Element)) {
|
|
1625
|
+
return false;
|
|
1626
|
+
}
|
|
1627
|
+
return Boolean(
|
|
1628
|
+
target.closest("[data-radix-select-content]") || target.closest("[data-radix-select-viewport]")
|
|
1629
|
+
);
|
|
1630
|
+
};
|
|
1631
|
+
function useOverlayDismissGuard({
|
|
1632
|
+
onInteractOutside,
|
|
1633
|
+
onEscapeKeyDown
|
|
1634
|
+
}) {
|
|
1635
|
+
const handleInteractOutside = (event) => {
|
|
1636
|
+
if (shouldPreventDismissForSelect(event.target) || isTargetInsideBaseUiPopup(event.target)) {
|
|
1637
|
+
event.preventDefault();
|
|
1638
|
+
}
|
|
1639
|
+
onInteractOutside?.(event);
|
|
1640
|
+
};
|
|
1641
|
+
const handleEscapeKeyDown = (event) => {
|
|
1642
|
+
if (isBaseUiPopupOpen()) {
|
|
1643
|
+
event.preventDefault();
|
|
1644
|
+
}
|
|
1645
|
+
onEscapeKeyDown?.(event);
|
|
1646
|
+
};
|
|
1647
|
+
return { onEscapeKeyDown: handleEscapeKeyDown, onInteractOutside: handleInteractOutside };
|
|
1648
|
+
}
|
|
1661
1649
|
|
|
1662
1650
|
// src/sheet/sheetResize.ts
|
|
1663
1651
|
var SHEET_EDGE_GAP = "[--sheet-edge-gap:40px]";
|
|
@@ -1784,18 +1772,18 @@ var SHEET_RESIZE_SIDE_CLASSES = {
|
|
|
1784
1772
|
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
1773
|
};
|
|
1786
1774
|
var SheetContext = createContext({ side: "right" });
|
|
1787
|
-
var SheetRoot = (props) => /* @__PURE__ */ jsx(
|
|
1775
|
+
var SheetRoot = (props) => /* @__PURE__ */ jsx(DialogPrimitive2.Root, { ...props });
|
|
1788
1776
|
var Sheet = SheetRoot;
|
|
1789
1777
|
Sheet.Trigger = forwardRef(
|
|
1790
|
-
(props, ref) => /* @__PURE__ */ jsx(
|
|
1778
|
+
(props, ref) => /* @__PURE__ */ jsx(DialogPrimitive2.Trigger, { ref, ...props })
|
|
1791
1779
|
);
|
|
1792
|
-
Sheet.Portal = (props) => /* @__PURE__ */ jsx(
|
|
1780
|
+
Sheet.Portal = (props) => /* @__PURE__ */ jsx(DialogPrimitive2.Portal, { ...props });
|
|
1793
1781
|
Sheet.Close = forwardRef(
|
|
1794
|
-
(props, ref) => /* @__PURE__ */ jsx(
|
|
1782
|
+
(props, ref) => /* @__PURE__ */ jsx(DialogPrimitive2.Close, { ref, ...props })
|
|
1795
1783
|
);
|
|
1796
1784
|
Sheet.Overlay = forwardRef(
|
|
1797
1785
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1798
|
-
|
|
1786
|
+
DialogPrimitive2.Overlay,
|
|
1799
1787
|
{
|
|
1800
1788
|
ref,
|
|
1801
1789
|
className: cn(
|
|
@@ -1822,7 +1810,7 @@ Sheet.Content = forwardRef(
|
|
|
1822
1810
|
return /* @__PURE__ */ jsx(SheetContext.Provider, { value: { side }, children: /* @__PURE__ */ jsxs(Sheet.Portal, { children: [
|
|
1823
1811
|
/* @__PURE__ */ jsx(Sheet.Overlay, {}),
|
|
1824
1812
|
/* @__PURE__ */ jsx(
|
|
1825
|
-
|
|
1813
|
+
DialogPrimitive2.Content,
|
|
1826
1814
|
{
|
|
1827
1815
|
ref,
|
|
1828
1816
|
className: cn(
|
|
@@ -1842,7 +1830,7 @@ Sheet.Content = forwardRef(
|
|
|
1842
1830
|
Sheet.Header = forwardRef(
|
|
1843
1831
|
({ className, line = true, rightSlot, children, ...props }, ref) => {
|
|
1844
1832
|
const rightElement = rightSlot === void 0 ? /* @__PURE__ */ jsx(
|
|
1845
|
-
|
|
1833
|
+
DialogPrimitive2.Close,
|
|
1846
1834
|
{
|
|
1847
1835
|
className: cn(
|
|
1848
1836
|
"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 +1916,7 @@ Sheet.FooterDescription = forwardRef(
|
|
|
1928
1916
|
Sheet.Actions = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("ml-auto flex flex-row items-center gap-2", className), ...props }));
|
|
1929
1917
|
Sheet.Title = forwardRef(
|
|
1930
1918
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1931
|
-
|
|
1919
|
+
DialogPrimitive2.Title,
|
|
1932
1920
|
{
|
|
1933
1921
|
ref,
|
|
1934
1922
|
className: cn(
|
|
@@ -1940,7 +1928,7 @@ Sheet.Title = forwardRef(
|
|
|
1940
1928
|
)
|
|
1941
1929
|
);
|
|
1942
1930
|
Sheet.Description = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1943
|
-
|
|
1931
|
+
DialogPrimitive2.Description,
|
|
1944
1932
|
{
|
|
1945
1933
|
ref,
|
|
1946
1934
|
className: cn("text-body-2 text-text-tertiary", className),
|
|
@@ -1960,77 +1948,111 @@ Sheet.FooterDescription.displayName = "Sheet.FooterDescription";
|
|
|
1960
1948
|
Sheet.Actions.displayName = "Sheet.Actions";
|
|
1961
1949
|
Sheet.Title.displayName = "Sheet.Title";
|
|
1962
1950
|
Sheet.Description.displayName = "Sheet.Description";
|
|
1951
|
+
var MESSAGE_BOX_TRANSITION = "transition-[transform,scale,opacity] duration-200 data-[starting-style]:opacity-0 data-[ending-style]:opacity-0";
|
|
1963
1952
|
var MessageBoxContext = createContext({ variant: "default" });
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
/* @__PURE__ */ jsx(
|
|
1969
|
-
|
|
1953
|
+
function MessageBoxRoot(props) {
|
|
1954
|
+
return /* @__PURE__ */ jsx(Dialog.Root, { ...props });
|
|
1955
|
+
}
|
|
1956
|
+
function MessageBoxTrigger(props) {
|
|
1957
|
+
return /* @__PURE__ */ jsx(Dialog.Trigger, { "data-slot": "message-box-trigger", ...props });
|
|
1958
|
+
}
|
|
1959
|
+
function MessageBoxContent({
|
|
1960
|
+
className,
|
|
1961
|
+
children,
|
|
1962
|
+
variant = "default",
|
|
1963
|
+
...props
|
|
1964
|
+
}) {
|
|
1965
|
+
return /* @__PURE__ */ jsx(MessageBoxContext.Provider, { value: { variant }, children: /* @__PURE__ */ jsxs(Dialog.Portal, { children: [
|
|
1966
|
+
/* @__PURE__ */ jsx(
|
|
1967
|
+
Dialog.Backdrop,
|
|
1968
|
+
{
|
|
1969
|
+
"data-slot": "message-box-overlay",
|
|
1970
|
+
className: cn("fixed inset-0 z-50 bg-component-dim", MESSAGE_BOX_TRANSITION)
|
|
1971
|
+
}
|
|
1972
|
+
),
|
|
1973
|
+
/* @__PURE__ */ jsx(
|
|
1974
|
+
Dialog.Popup,
|
|
1975
|
+
{
|
|
1976
|
+
"data-slot": "message-box-content",
|
|
1977
|
+
className: cn(
|
|
1978
|
+
"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",
|
|
1979
|
+
MESSAGE_BOX_TRANSITION,
|
|
1980
|
+
"data-[starting-style]:scale-95 data-[ending-style]:scale-95",
|
|
1981
|
+
className
|
|
1982
|
+
),
|
|
1983
|
+
...props,
|
|
1984
|
+
children
|
|
1985
|
+
}
|
|
1986
|
+
)
|
|
1987
|
+
] }) });
|
|
1988
|
+
}
|
|
1989
|
+
function MessageBoxTitle({ className, ...props }) {
|
|
1990
|
+
return /* @__PURE__ */ jsx(
|
|
1991
|
+
Dialog.Title,
|
|
1970
1992
|
{
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1993
|
+
"data-slot": "message-box-title",
|
|
1994
|
+
className: cn("w-full text-body-1 font-semibold text-text-primary", className),
|
|
1995
|
+
...props
|
|
1974
1996
|
}
|
|
1975
|
-
)
|
|
1976
|
-
|
|
1977
|
-
|
|
1997
|
+
);
|
|
1998
|
+
}
|
|
1999
|
+
function MessageBoxDescription({ className, ...props }) {
|
|
2000
|
+
return /* @__PURE__ */ jsx(
|
|
2001
|
+
Dialog.Description,
|
|
1978
2002
|
{
|
|
1979
|
-
|
|
1980
|
-
className: cn(
|
|
1981
|
-
|
|
1982
|
-
className
|
|
1983
|
-
),
|
|
1984
|
-
...props,
|
|
1985
|
-
children
|
|
2003
|
+
"data-slot": "message-box-description",
|
|
2004
|
+
className: cn("w-full text-body-2 text-text-secondary", className),
|
|
2005
|
+
...props
|
|
1986
2006
|
}
|
|
1987
|
-
)
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
}
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
MessageBox
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2007
|
+
);
|
|
2008
|
+
}
|
|
2009
|
+
function MessageBoxActions({ className, ...props }) {
|
|
2010
|
+
return /* @__PURE__ */ jsx(
|
|
2011
|
+
"div",
|
|
2012
|
+
{
|
|
2013
|
+
"data-slot": "message-box-actions",
|
|
2014
|
+
className: cn("flex flex-row gap-2", className),
|
|
2015
|
+
...props
|
|
2016
|
+
}
|
|
2017
|
+
);
|
|
2018
|
+
}
|
|
2019
|
+
function MessageBoxCancel({ size = "medium", ...props }) {
|
|
2020
|
+
return /* @__PURE__ */ jsx(Dialog.Close, { render: /* @__PURE__ */ jsx(Button, { ...props, variant: "assistive", size }) });
|
|
2021
|
+
}
|
|
2022
|
+
function MessageBoxAction({ size = "medium", ...props }) {
|
|
2023
|
+
const { variant } = useContext(MessageBoxContext);
|
|
2024
|
+
return /* @__PURE__ */ jsx(
|
|
2025
|
+
Dialog.Close,
|
|
2026
|
+
{
|
|
2027
|
+
render: /* @__PURE__ */ jsx(
|
|
2028
|
+
Button,
|
|
2029
|
+
{
|
|
2030
|
+
...props,
|
|
2031
|
+
color: variant === "critical" ? "critical" : "primary",
|
|
2032
|
+
variant: "solid",
|
|
2033
|
+
size
|
|
2034
|
+
}
|
|
2035
|
+
)
|
|
2036
|
+
}
|
|
2037
|
+
);
|
|
2038
|
+
}
|
|
2039
|
+
MessageBoxRoot.displayName = "MessageBox";
|
|
2040
|
+
MessageBoxTrigger.displayName = "MessageBox.Trigger";
|
|
2041
|
+
MessageBoxContent.displayName = "MessageBox.Content";
|
|
2042
|
+
MessageBoxTitle.displayName = "MessageBox.Title";
|
|
2043
|
+
MessageBoxDescription.displayName = "MessageBox.Description";
|
|
2044
|
+
MessageBoxActions.displayName = "MessageBox.Actions";
|
|
2045
|
+
MessageBoxCancel.displayName = "MessageBox.Cancel";
|
|
2046
|
+
MessageBoxAction.displayName = "MessageBox.Action";
|
|
2047
|
+
var MessageBox = Object.assign(MessageBoxRoot, {
|
|
2048
|
+
Trigger: MessageBoxTrigger,
|
|
2049
|
+
Content: MessageBoxContent,
|
|
2050
|
+
Title: MessageBoxTitle,
|
|
2051
|
+
Description: MessageBoxDescription,
|
|
2052
|
+
Actions: MessageBoxActions,
|
|
2053
|
+
Cancel: MessageBoxCancel,
|
|
2054
|
+
Action: MessageBoxAction
|
|
2055
|
+
});
|
|
2034
2056
|
var containerVariants4 = cva("inset-0 z-[49] flex items-center justify-center", {
|
|
2035
2057
|
variants: {
|
|
2036
2058
|
position: {
|