@mondrianai/runyourai-design-system 0.0.29 → 0.0.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -622,6 +622,8 @@ interface ModalButtonProps {
622
622
  }
623
623
  interface ModalProps {
624
624
  id?: string;
625
+ /** 패널 너비: sm 400px / md 430px / lg 480px (기본: lg) */
626
+ size?: 'sm' | 'md' | 'lg';
625
627
  /**
626
628
  * 모달을 여는 트리거 — render prop 패턴.
627
629
  * open 함수를 인자로 받아 원하는 요소에 직접 연결.
@@ -648,17 +650,19 @@ interface ModalProps {
648
650
  * footer 버튼 렌더 방식
649
651
  * confirm — 취소 + default(검정) 확인 버튼
650
652
  * danger — 취소 + destructive(빨강) 확인 버튼
651
- * dialog — footer 없음 (children으로 모든 콘텐츠 처리)
653
+ * dialog — 기본 버튼 없음 (필요하면 footer로 직접 제공)
652
654
  */
653
655
  variant?: 'confirm' | 'danger' | 'dialog';
654
656
  /** 모달 제목 */
655
657
  title: string;
656
- /** 제목 아래 부제목 (선택) */
658
+ /** 본문 첫 항목으로 표시하는 설명 (선택) */
657
659
  description?: string;
658
- /** 우상단 X 닫기 버튼 표시 여부 (기본: true) */
660
+ /** 우상단 X 닫기 버튼 표시 여부 (기본: false). 기본 닫기는 footer·ESC·오버레이를 사용한다. */
659
661
  showCloseButton?: boolean;
660
- /** 모달 본문 */
662
+ /** 모달 본문. 직접 자식 항목 사이에는 12px 간격이 적용된다. 중첩 그룹도 gap-3을 사용한다. */
661
663
  children?: React$1.ReactNode;
664
+ /** dialog 변형의 하단 버튼. 본문과 16px 간격을 적용한다. */
665
+ footer?: React$1.ReactNode;
662
666
  /** 취소 버튼 커스터마이즈 (label 기본: "취소") */
663
667
  cancelButtonProps?: ModalButtonProps;
664
668
  /** 확인 버튼 커스터마이즈 (label 기본: "확인") */
@@ -683,7 +687,7 @@ interface ModalProps {
683
687
  * modal=false로 모달 격리를 해제하고 SDK를 소유한 원본 콘텐츠를 유지한다.
684
688
  * 외부 포털과 stacking level을 조율할 때는 className과 overlayClassName을 함께 사용한다.
685
689
  */
686
- declare function Modal({ id, trigger, open: openProp, onOpenChange, modal, variant, title, description, showCloseButton, children, cancelButtonProps, confirmButtonProps, onConfirm, onCancel, closeOnOverlayClick, overlayClassName, className, }: ModalProps): react_jsx_runtime.JSX.Element;
690
+ declare function Modal({ id, size, trigger, open: openProp, onOpenChange, modal, variant, title, description, showCloseButton, children, footer, cancelButtonProps, confirmButtonProps, onConfirm, onCancel, closeOnOverlayClick, overlayClassName, className, }: ModalProps): react_jsx_runtime.JSX.Element;
687
691
 
688
692
  declare const Menubar: React$1.ForwardRefExoticComponent<Omit<Menubar$1.MenubarProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
689
693
  declare const MenubarMenu: {
package/dist/index.d.ts CHANGED
@@ -622,6 +622,8 @@ interface ModalButtonProps {
622
622
  }
623
623
  interface ModalProps {
624
624
  id?: string;
625
+ /** 패널 너비: sm 400px / md 430px / lg 480px (기본: lg) */
626
+ size?: 'sm' | 'md' | 'lg';
625
627
  /**
626
628
  * 모달을 여는 트리거 — render prop 패턴.
627
629
  * open 함수를 인자로 받아 원하는 요소에 직접 연결.
@@ -648,17 +650,19 @@ interface ModalProps {
648
650
  * footer 버튼 렌더 방식
649
651
  * confirm — 취소 + default(검정) 확인 버튼
650
652
  * danger — 취소 + destructive(빨강) 확인 버튼
651
- * dialog — footer 없음 (children으로 모든 콘텐츠 처리)
653
+ * dialog — 기본 버튼 없음 (필요하면 footer로 직접 제공)
652
654
  */
653
655
  variant?: 'confirm' | 'danger' | 'dialog';
654
656
  /** 모달 제목 */
655
657
  title: string;
656
- /** 제목 아래 부제목 (선택) */
658
+ /** 본문 첫 항목으로 표시하는 설명 (선택) */
657
659
  description?: string;
658
- /** 우상단 X 닫기 버튼 표시 여부 (기본: true) */
660
+ /** 우상단 X 닫기 버튼 표시 여부 (기본: false). 기본 닫기는 footer·ESC·오버레이를 사용한다. */
659
661
  showCloseButton?: boolean;
660
- /** 모달 본문 */
662
+ /** 모달 본문. 직접 자식 항목 사이에는 12px 간격이 적용된다. 중첩 그룹도 gap-3을 사용한다. */
661
663
  children?: React$1.ReactNode;
664
+ /** dialog 변형의 하단 버튼. 본문과 16px 간격을 적용한다. */
665
+ footer?: React$1.ReactNode;
662
666
  /** 취소 버튼 커스터마이즈 (label 기본: "취소") */
663
667
  cancelButtonProps?: ModalButtonProps;
664
668
  /** 확인 버튼 커스터마이즈 (label 기본: "확인") */
@@ -683,7 +687,7 @@ interface ModalProps {
683
687
  * modal=false로 모달 격리를 해제하고 SDK를 소유한 원본 콘텐츠를 유지한다.
684
688
  * 외부 포털과 stacking level을 조율할 때는 className과 overlayClassName을 함께 사용한다.
685
689
  */
686
- declare function Modal({ id, trigger, open: openProp, onOpenChange, modal, variant, title, description, showCloseButton, children, cancelButtonProps, confirmButtonProps, onConfirm, onCancel, closeOnOverlayClick, overlayClassName, className, }: ModalProps): react_jsx_runtime.JSX.Element;
690
+ declare function Modal({ id, size, trigger, open: openProp, onOpenChange, modal, variant, title, description, showCloseButton, children, footer, cancelButtonProps, confirmButtonProps, onConfirm, onCancel, closeOnOverlayClick, overlayClassName, className, }: ModalProps): react_jsx_runtime.JSX.Element;
687
691
 
688
692
  declare const Menubar: React$1.ForwardRefExoticComponent<Omit<Menubar$1.MenubarProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
689
693
  declare const MenubarMenu: {
package/dist/index.js CHANGED
@@ -4395,6 +4395,7 @@ function withIconSize(icon) {
4395
4395
  }
4396
4396
  function Modal({
4397
4397
  id,
4398
+ size = "lg",
4398
4399
  trigger,
4399
4400
  open: openProp,
4400
4401
  onOpenChange,
@@ -4402,8 +4403,9 @@ function Modal({
4402
4403
  variant = "confirm",
4403
4404
  title,
4404
4405
  description,
4405
- showCloseButton = true,
4406
+ showCloseButton = false,
4406
4407
  children,
4408
+ footer,
4407
4409
  cancelButtonProps,
4408
4410
  confirmButtonProps,
4409
4411
  onConfirm,
@@ -4512,40 +4514,32 @@ function Modal({
4512
4514
  },
4513
4515
  className: cn(
4514
4516
  "fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2",
4515
- "max-h-[calc(100dvh-2rem)] w-120 overflow-y-auto",
4516
- "bg-background border border-border rounded-2xl shadow-modal flex flex-col gap-4 p-6",
4517
+ "max-h-[calc(100dvh-2rem)] max-w-modal-viewport overflow-y-auto",
4518
+ { sm: "w-100", md: "w-107.5", lg: "w-120" }[size],
4519
+ "bg-background border border-border rounded-2xl shadow-modal flex flex-col p-5",
4517
4520
  "data-[state=open]:animate-in data-[state=closed]:animate-out",
4518
4521
  "data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0",
4519
4522
  "duration-200 data-[state=closed]:duration-150",
4520
4523
  className
4521
4524
  ),
4522
4525
  children: [
4523
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
4524
- "div",
4525
- {
4526
- className: cn(
4527
- "flex flex-col w-full",
4528
- description ? "gap-1" : "gap-0"
4529
- ),
4530
- children: [
4531
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-start justify-between w-full", children: [
4532
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_radix_ui12.Dialog.Title, { className: "flex-1 text-left text-lg font-semibold leading-7 tracking-tight text-foreground", children: title }),
4533
- showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
4534
- "button",
4535
- {
4536
- type: "button",
4537
- onClick: handleClose,
4538
- className: "flex size-5 items-center justify-center ml-2 shrink-0 opacity-70 hover:opacity-100 transition-opacity cursor-pointer",
4539
- children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Icon, { name: "x", className: "size-4 text-foreground" })
4540
- }
4541
- )
4542
- ] }),
4543
- description && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_radix_ui12.Dialog.Description, { className: "text-sm font-normal leading-5 tracking-tight text-muted-foreground", children: description })
4544
- ]
4545
- }
4546
- ),
4547
- children && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "w-full text-left", children }),
4548
- variant !== "dialog" && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex gap-2 items-center justify-end w-full", children: [
4526
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { "data-slot": "modal-header", className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-start justify-between w-full", children: [
4527
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_radix_ui12.Dialog.Title, { className: "flex-1 text-left text-lg font-semibold leading-7 tracking-tight text-foreground", children: title }),
4528
+ showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
4529
+ "button",
4530
+ {
4531
+ type: "button",
4532
+ onClick: handleClose,
4533
+ className: "flex size-5 items-center justify-center ml-2 shrink-0 opacity-70 hover:opacity-100 transition-opacity cursor-pointer",
4534
+ children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Icon, { name: "x", className: "size-4 text-foreground" })
4535
+ }
4536
+ )
4537
+ ] }) }),
4538
+ (description || children) && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { "data-slot": "modal-body", className: "mt-3 flex w-full flex-col gap-3 text-left", children: [
4539
+ description && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_radix_ui12.Dialog.Description, { className: "text-sm font-normal leading-5 tracking-tight text-muted-foreground", children: description }),
4540
+ children
4541
+ ] }),
4542
+ variant === "dialog" ? footer && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { "data-slot": "modal-footer", className: "mt-4 flex gap-2 items-center justify-end w-full", children: footer }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { "data-slot": "modal-footer", className: "mt-4 flex gap-2 items-center justify-end w-full", children: [
4549
4543
  /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
4550
4544
  Button,
4551
4545
  {