@cashdoc/cashdoc-cms-design-system 2.6.1 → 2.7.0
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.es.js +5922 -5926
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +57 -78
- package/dist/index.umd.js.map +1 -1
- package/dist/src/components/Modal/Modal.d.ts +21 -1
- package/dist/src/components/Popover/Popover.d.ts +17 -3
- package/dist/src/utils/portalContainer.d.ts +23 -0
- package/package.json +1 -1
|
@@ -3,8 +3,27 @@ import { default as React } from 'react';
|
|
|
3
3
|
export type ModalProps = {
|
|
4
4
|
open: boolean;
|
|
5
5
|
onOpenChange: (open: boolean) => void;
|
|
6
|
+
/**
|
|
7
|
+
* Radix Dialog의 `modal` 동작을 제어합니다. 기본값 `true`는 배경
|
|
8
|
+
* 상호작용을 차단하는 표준 모달 동작입니다. `false`로 두면 배경
|
|
9
|
+
* `pointer-events` 차단이 사라집니다.
|
|
10
|
+
*
|
|
11
|
+
* 모달 내부의 `TimePicker`/`DatePicker`/`Dropdown` 등 Popover 계열
|
|
12
|
+
* 컴포넌트는 기본값(`true`)에서도 자동으로 모달 내부에 portal되어
|
|
13
|
+
* 정상 동작하므로, 이 prop을 바꿀 필요는 일반적으로 없습니다.
|
|
14
|
+
*/
|
|
15
|
+
modal?: boolean;
|
|
6
16
|
icon?: React.ReactNode;
|
|
7
17
|
title?: React.ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* 스크린리더에 전달할 모달 설명 텍스트입니다. 지정하면 시각적으로는
|
|
20
|
+
* 숨겨진 채 `aria-describedby`로 연결됩니다.
|
|
21
|
+
*
|
|
22
|
+
* `children`은 `<div>` 컨테이너에 렌더되어 block 요소(픽커, 폼 등)를
|
|
23
|
+
* 안전하게 담을 수 있으므로, 접근성 설명이 필요하면 이 prop을 사용하세요.
|
|
24
|
+
* 지정하지 않으면 Radix의 설명 연결이 생략됩니다(시각/동작 영향 없음).
|
|
25
|
+
*/
|
|
26
|
+
description?: React.ReactNode;
|
|
8
27
|
children: React.ReactNode;
|
|
9
28
|
footer?: React.ReactNode;
|
|
10
29
|
className?: string;
|
|
@@ -97,7 +116,8 @@ export type ModalProps = {
|
|
|
97
116
|
* - **스크린 리더**:
|
|
98
117
|
* - `role="dialog"`: 대화상자임을 인식
|
|
99
118
|
* - `aria-labelledby`: title이 모달의 레이블로 연결됨
|
|
100
|
-
* - `aria-describedby`:
|
|
119
|
+
* - `aria-describedby`: `description` prop이 있으면 시각적으로 숨긴 설명으로
|
|
120
|
+
* 연결됨. `children`은 `<div>` 컨테이너에 렌더되어 block 요소도 안전함.
|
|
101
121
|
*
|
|
102
122
|
* - **포커스 트랩**: 모달이 열려있는 동안 포커스가 모달 내부에서만 순환합니다
|
|
103
123
|
* - **배경 스크롤 방지**: 모달이 열리면 body 스크롤이 자동으로 비활성화됩니다
|
|
@@ -2,7 +2,14 @@ import { ComponentPropsWithoutRef } from 'react';
|
|
|
2
2
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
3
3
|
export type PopoverProps = ComponentPropsWithoutRef<typeof PopoverPrimitive.Root>;
|
|
4
4
|
export type PopoverTriggerProps = ComponentPropsWithoutRef<typeof PopoverPrimitive.Trigger>;
|
|
5
|
-
export type PopoverContentProps = ComponentPropsWithoutRef<typeof PopoverPrimitive.Content
|
|
5
|
+
export type PopoverContentProps = ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> & {
|
|
6
|
+
/**
|
|
7
|
+
* 팝오버가 렌더될 portal container를 직접 지정합니다. 지정하지 않으면
|
|
8
|
+
* 상위 Modal 내부에서는 자동으로 모달 콘텐츠에, 그 밖에서는 `body`에
|
|
9
|
+
* 렌더됩니다. 일반적으로 지정할 필요가 없습니다.
|
|
10
|
+
*/
|
|
11
|
+
container?: HTMLElement | null;
|
|
12
|
+
};
|
|
6
13
|
/**
|
|
7
14
|
* 특정 요소 근처에 부가적인 정보나 컨트롤을 표시하는 플로팅 컴포넌트입니다.
|
|
8
15
|
*
|
|
@@ -35,7 +42,7 @@ export type PopoverContentProps = ComponentPropsWithoutRef<typeof PopoverPrimiti
|
|
|
35
42
|
* ### ✅ Do (권장 사항)
|
|
36
43
|
*
|
|
37
44
|
* - **명확한 트리거**: 사용자가 무엇을 클릭하면 팝오버가 열릴지 명확히 인지할 수 있는 버튼이나 아이콘을 사용하세요.
|
|
38
|
-
* - **적절한 배치**: `align` 속성을 조절하여 팝오버가 화면 밖으로 나가지 않도록 관리하세요. (기본값: '
|
|
45
|
+
* - **적절한 배치**: `align` 속성을 조절하여 팝오버가 화면 밖으로 나가지 않도록 관리하세요. (기본값: 'start' — 팝오버 왼쪽 보더가 트리거 왼쪽 선에 정렬)
|
|
39
46
|
*
|
|
40
47
|
* ### 🚫 Don't (주의/금지 사항)
|
|
41
48
|
*
|
|
@@ -78,5 +85,12 @@ export type PopoverContentProps = ComponentPropsWithoutRef<typeof PopoverPrimiti
|
|
|
78
85
|
*/
|
|
79
86
|
declare const Popover: import('react').FC<PopoverPrimitive.PopoverProps>;
|
|
80
87
|
declare const PopoverTrigger: import('react').ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
81
|
-
declare const PopoverContent: import('react').ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & import('react').RefAttributes<HTMLDivElement>, "ref"> &
|
|
88
|
+
declare const PopoverContent: import('react').ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & {
|
|
89
|
+
/**
|
|
90
|
+
* 팝오버가 렌더될 portal container를 직접 지정합니다. 지정하지 않으면
|
|
91
|
+
* 상위 Modal 내부에서는 자동으로 모달 콘텐츠에, 그 밖에서는 `body`에
|
|
92
|
+
* 렌더됩니다. 일반적으로 지정할 필요가 없습니다.
|
|
93
|
+
*/
|
|
94
|
+
container?: HTMLElement | null;
|
|
95
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
82
96
|
export { Popover, PopoverTrigger, PopoverContent };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 오버레이(Modal/Dialog)가 자신의 콘텐츠 DOM 노드를 자식 Popover 계열
|
|
3
|
+
* 컴포넌트에 전달하기 위한 컨텍스트입니다.
|
|
4
|
+
*
|
|
5
|
+
* Radix Dialog는 `modal=true`일 때 `body`에 `pointer-events: none`을
|
|
6
|
+
* 적용합니다. 그 결과 `body`로 portal되는 Popover content는 클릭이
|
|
7
|
+
* 막힙니다(시/분 선택 무반응 등). Modal이 자신의 Content 노드를 이
|
|
8
|
+
* 컨텍스트로 제공하면, 내부 Popover가 그 노드로 portal되어
|
|
9
|
+
* `pointer-events` 영향을 받지 않습니다.
|
|
10
|
+
*
|
|
11
|
+
* 값이 `null`이면(= Modal 밖) Popover는 Radix 기본값(`body`)으로
|
|
12
|
+
* portal됩니다. 따라서 단독 사용 시 동작 회귀가 없습니다.
|
|
13
|
+
*/
|
|
14
|
+
export declare const PortalContainerContext: import('react').Context<HTMLElement | null>;
|
|
15
|
+
/**
|
|
16
|
+
* Popover 계열 컴포넌트의 portal container를 결정합니다.
|
|
17
|
+
*
|
|
18
|
+
* 우선순위: 명시적 `container` prop → 상위 Modal 컨텍스트 → `undefined`.
|
|
19
|
+
*
|
|
20
|
+
* @param explicit 소비자가 직접 지정한 container. 있으면 최우선입니다.
|
|
21
|
+
* @returns portal 대상 DOM 노드. 없으면 `undefined`(Radix 기본 = body).
|
|
22
|
+
*/
|
|
23
|
+
export declare function usePortalContainer(explicit?: HTMLElement | null): HTMLElement | undefined;
|