@nurihaus/web-design-system 3.9.1 → 3.9.3
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/README.md +1 -1
- package/dist/.storybook/preview.d.ts +49 -0
- package/dist/ai/components.md +721 -111
- package/dist/ai/motion.md +156 -134
- package/dist/ai/tokens.md +295 -137
- package/dist/asset.js +328 -0
- package/dist/avatar.js +208 -33
- package/dist/bottom-nav.js +86 -6
- package/dist/breadcrumb.js +6 -3
- package/dist/card.js +5 -2
- package/dist/check-box.js +81 -45
- package/dist/chip-group.js +50 -12
- package/dist/chunk-1563.js +42 -18
- package/dist/chunk-1983.js +100 -0
- package/dist/chunk-3297.js +130 -0
- package/dist/chunk-3640.js +94 -0
- package/dist/chunk-3839.js +54 -0
- package/dist/chunk-4558.js +13 -2
- package/dist/chunk-4577.js +35 -0
- package/dist/chunk-5302.js +111 -0
- package/dist/{chunk-1657.js → chunk-5589.js} +41 -5
- package/dist/chunk-5670.js +122 -0
- package/dist/chunk-6302.js +10 -10
- package/dist/chunk-6706.js +64 -0
- package/dist/chunk-7302.js +66 -0
- package/dist/chunk-7460.js +204 -0
- package/dist/{chunk-6149.js → chunk-8377.js} +36 -2
- package/dist/chunk-8734.js +33 -0
- package/dist/chunk-8787.js +260 -0
- package/dist/chunk-8933.js +14 -2
- package/dist/chunk-910.js +82 -27
- package/dist/chunk-948.js +166 -0
- package/dist/collapsible-menu.js +109 -55
- package/dist/components/asset/asset-props.d.ts +43 -0
- package/dist/components/asset/asset-type.d.ts +38 -0
- package/dist/components/asset/asset.d.ts +21 -0
- package/dist/components/asset/asset.stories.d.ts +65 -0
- package/dist/components/asset/base-asset.d.ts +7 -0
- package/dist/components/avatar/avatar-props.d.ts +1 -0
- package/dist/components/avatar/avatar-type.d.ts +6 -4
- package/dist/components/avatar/avatar.stories.d.ts +10 -0
- package/dist/components/badge/badge-type.d.ts +10 -4
- package/dist/components/badge/badge.stories.d.ts +15 -0
- package/dist/components/bottom-bar/bottom-bar.stories.d.ts +14 -7
- package/dist/components/bottom-nav/bottom-nav-type.d.ts +2 -1
- package/dist/components/bottom-nav/bottom-nav.stories.d.ts +16 -1
- package/dist/components/breadcrumb/breadcrumb-type.d.ts +2 -1
- package/dist/components/breadcrumb/breadcrumb.stories.d.ts +15 -0
- package/dist/components/button/button-appearance.d.ts +50 -0
- package/dist/components/button/button-props.d.ts +12 -3
- package/dist/components/button/button-type.d.ts +14 -4
- package/dist/components/button/button.stories.d.ts +34 -3
- package/dist/components/button/cta-button.d.ts +1 -1
- package/dist/components/callout/callout.stories.d.ts +11 -0
- package/dist/components/card/card-type.d.ts +2 -1
- package/dist/components/card/card.stories.d.ts +9 -0
- package/dist/components/check-box/check-box-props.d.ts +8 -0
- package/dist/components/check-box/check-box-type.d.ts +7 -3
- package/dist/components/check-box/check-box.stories.d.ts +32 -1
- package/dist/components/chip-group/chip-group-props.d.ts +13 -1
- package/dist/components/chip-group/chip-group-type.d.ts +5 -1
- package/dist/components/chip-group/chip-group.stories.d.ts +30 -0
- package/dist/components/collapsible-menu/collapsible-menu-type.d.ts +28 -2
- package/dist/components/collapsible-menu/collapsible-menu.d.ts +1 -1
- package/dist/components/collapsible-menu/collapsible-menu.stories.d.ts +14 -0
- package/dist/components/description-list/description-list.stories.d.ts +7 -0
- package/dist/components/drawer/base-drawer.d.ts +2 -4
- package/dist/components/drawer/drawer-type.d.ts +17 -2
- package/dist/components/drawer/drawer.stories.d.ts +21 -0
- package/dist/components/drop-down/drop-down-type.d.ts +4 -2
- package/dist/components/drop-down/drop-down.stories.d.ts +16 -0
- package/dist/components/elements/text/text-props.d.ts +3 -3
- package/dist/components/elements/text/text-type.d.ts +3 -2
- package/dist/components/elements/text/text.stories.d.ts +13 -1
- package/dist/components/empty-state/empty-state.stories.d.ts +37 -12
- package/dist/components/icon/icon.stories.d.ts +11 -1
- package/dist/components/icon-button/icon-button-type.d.ts +2 -1
- package/dist/components/icon-button/icon-button.stories.d.ts +9 -0
- package/dist/components/list/list-group.stories.d.ts +7 -0
- package/dist/components/list/list-row.stories.d.ts +20 -10
- package/dist/components/list/list-type.d.ts +2 -1
- package/dist/components/loading/index.d.ts +4 -0
- package/dist/components/loading/inline-loading/base-inline-loading.d.ts +3 -2
- package/dist/components/loading/inline-loading/inline-loading-props.d.ts +3 -0
- package/dist/components/loading/inline-loading/inline-loading-type.d.ts +6 -6
- package/dist/components/loading/inline-loading/inline-loading.stories.d.ts +28 -2
- package/dist/components/loading/loading-dots/base-loading-dots.d.ts +4 -0
- package/dist/components/loading/loading-dots/loading-dots-props.d.ts +4 -0
- package/dist/components/loading/loading-dots/loading-dots-type.d.ts +6 -0
- package/dist/components/loading/loading-dots/loading-dots.d.ts +4 -0
- package/dist/components/loading/loading-dots/loading-dots.stories.d.ts +37 -0
- package/dist/components/loading/loading-props.d.ts +9 -0
- package/dist/components/loading/loading-type.d.ts +9 -0
- package/dist/components/loading/loading.stories.d.ts +15 -0
- package/dist/components/loading/overlay-loading/overlay-loading-type.d.ts +4 -0
- package/dist/components/loading/overlay-loading/overlay-loading.stories.d.ts +17 -0
- package/dist/components/loading/progress-bar/base-progress-bar.d.ts +3 -0
- package/dist/components/loading/progress-bar/progress-bar-props.d.ts +4 -0
- package/dist/components/loading/progress-bar/progress-bar-type.d.ts +19 -0
- package/dist/components/loading/progress-bar/progress-bar.d.ts +4 -0
- package/dist/components/loading/progress-bar/progress-bar.stories.d.ts +63 -0
- package/dist/components/loading/spinner/spinner-props.d.ts +4 -1
- package/dist/components/loading/spinner/spinner-type.d.ts +3 -1
- package/dist/components/loading/spinner/spinner.d.ts +2 -1
- package/dist/components/loading/spinner/spinner.stories.d.ts +30 -4
- package/dist/components/logging/logging.stories.d.ts +5 -0
- package/dist/components/media/media-thumbnail.stories.d.ts +9 -0
- package/dist/components/media/media-type.d.ts +2 -1
- package/dist/components/media/media-viewer.stories.d.ts +7 -0
- package/dist/components/message/message.stories.d.ts +19 -12
- package/dist/components/message-composer/message-composer-type.d.ts +2 -1
- package/dist/components/message-composer/message-composer.stories.d.ts +10 -0
- package/dist/components/modal/modal-type.d.ts +22 -3
- package/dist/components/modal/modal-with-double-button.stories.d.ts +15 -0
- package/dist/components/modal/modal.stories.d.ts +16 -0
- package/dist/components/motion/motion.stories.d.ts +7 -0
- package/dist/components/notice/notice-type.d.ts +1 -1
- package/dist/components/notice/notice.stories.d.ts +16 -9
- package/dist/components/overlay/overlay-context.d.ts +34 -0
- package/dist/components/overlay/overlay-provider.d.ts +6 -0
- package/dist/components/overlay/overlay-type.d.ts +45 -0
- package/dist/components/overlay/overlay.d.ts +4 -0
- package/dist/components/overlay/overlay.stories.d.ts +34 -0
- package/dist/components/overlay/use-dialog.d.ts +3 -0
- package/dist/components/overlay/use-toast.d.ts +3 -0
- package/dist/components/pagination/pagination-type.d.ts +2 -1
- package/dist/components/pagination/pagination.stories.d.ts +15 -0
- package/dist/components/radio/base-radio.d.ts +5 -2
- package/dist/components/radio/radio-type.d.ts +11 -3
- package/dist/components/radio/radio.stories.d.ts +20 -2
- package/dist/components/skeleton/base-skeleton.d.ts +7 -3
- package/dist/components/skeleton/skeleton-group-props.d.ts +4 -0
- package/dist/components/skeleton/skeleton-group-type.d.ts +47 -0
- package/dist/components/skeleton/skeleton-group.d.ts +4 -0
- package/dist/components/skeleton/skeleton-group.stories.d.ts +57 -0
- package/dist/components/skeleton/skeleton-type.d.ts +1 -0
- package/dist/components/skeleton/skeleton.stories.d.ts +20 -9
- package/dist/components/step-progress/step-progress-props.d.ts +10 -0
- package/dist/components/step-progress/step-progress-type.d.ts +22 -3
- package/dist/components/step-progress/step-progress.d.ts +1 -1
- package/dist/components/step-progress/step-progress.stories.d.ts +40 -0
- package/dist/components/switch/base-switch.d.ts +2 -4
- package/dist/components/switch/switch-type.d.ts +5 -2
- package/dist/components/switch/switch.stories.d.ts +22 -0
- package/dist/components/table/table-props.d.ts +9 -0
- package/dist/components/table/table-type.d.ts +7 -1
- package/dist/components/table/table.stories.d.ts +46 -0
- package/dist/components/tabs/tabs-type.d.ts +4 -1
- package/dist/components/tabs/tabs.stories.d.ts +17 -0
- package/dist/components/tag/tag-type.d.ts +2 -1
- package/dist/components/tag/tag.stories.d.ts +9 -0
- package/dist/components/text-area/base-text-area.d.ts +2 -1
- package/dist/components/text-area/text-area-type.d.ts +11 -3
- package/dist/components/text-area/text-area.stories.d.ts +15 -0
- package/dist/components/text-field/base-text-field.d.ts +12 -6
- package/dist/components/text-field/text-field-type.d.ts +37 -6
- package/dist/components/text-field/text-field.stories.d.ts +32 -5
- package/dist/components/toast/toast-type.d.ts +4 -1
- package/dist/components/toast/toast.stories.d.ts +28 -13
- package/dist/components/tooltip/tooltip-type.d.ts +4 -1
- package/dist/components/tooltip/tooltip.stories.d.ts +11 -0
- package/dist/components.css +2005 -672
- package/dist/cta-button.js +94 -33
- package/dist/data-table.js +38 -5
- package/dist/drawer.js +79 -13
- package/dist/drop-down.js +18 -10
- package/dist/helpers/hooks/useCloseOnBackEvent.d.ts +12 -0
- package/dist/helpers/hooks/useFieldClear.d.ts +21 -0
- package/dist/helpers/hooks/useReturnFocus.d.ts +9 -0
- package/dist/helpers/motion/appear.d.ts +3 -0
- package/dist/helpers/motion/effects.d.ts +9 -0
- package/dist/helpers/motion/motion-props.d.ts +35 -0
- package/dist/helpers/motion/stagger.d.ts +3 -0
- package/dist/helpers/motion/use-appear.d.ts +12 -0
- package/dist/helpers/motion/use-attention-handle.d.ts +7 -0
- package/dist/helpers/motion/use-confirm-spring.d.ts +7 -0
- package/dist/helpers/motion/use-effect-trigger.d.ts +11 -0
- package/dist/helpers/motion/use-hide-on-scroll.d.ts +12 -0
- package/dist/helpers/motion/use-presence-callbacks.d.ts +13 -0
- package/dist/icon-button.js +4 -2
- package/dist/icon-text-badge.js +27 -17
- package/dist/icon-text-option-badge.js +19 -13
- package/dist/index.d.ts +11 -4
- package/dist/index.js +4074 -989
- package/dist/list-row.js +5 -2
- package/dist/loading.js +200 -39
- package/dist/media-thumbnail.js +9 -5
- package/dist/message-composer.js +15 -11
- package/dist/modal-with-double-button.js +71 -53
- package/dist/modal.js +95 -29
- package/dist/notice.js +14 -8
- package/dist/option-badge.js +27 -17
- package/dist/overlay.js +1213 -0
- package/dist/pagination.js +11 -7
- package/dist/radio.js +117 -21
- package/dist/reset.css +4 -0
- package/dist/skeleton-group.js +445 -0
- package/dist/skeleton.js +24 -112
- package/dist/step-progress.js +125 -16
- package/dist/styles.css +2309 -756
- package/dist/switch.js +89 -17
- package/dist/tabs.js +77 -23
- package/dist/tag.js +4 -2
- package/dist/text-area.js +81 -31
- package/dist/text-field.js +160 -33
- package/dist/toast.js +98 -241
- package/dist/tokens/generated/motion.d.ts +21 -4
- package/dist/tokens/generated/semantic-admin.d.ts +103 -46
- package/dist/tokens/generated/semantic-app.d.ts +164 -16
- package/dist/tokens.css +578 -103
- package/dist/tokens.js +293 -71
- package/dist/tooltip.js +50 -22
- package/package.json +14 -1
- package/dist/chunk-5226.js +0 -79
|
@@ -2,6 +2,13 @@ import type { StoryObj } from '@storybook/react-webpack5';
|
|
|
2
2
|
import ModalWithDoubleButton from './modal-with-double-button';
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
|
+
parameters: {
|
|
6
|
+
docs: {
|
|
7
|
+
description: {
|
|
8
|
+
component: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
};
|
|
5
12
|
component: import("react").ForwardRefExoticComponent<import("./modal-type").ModalWithDoubleButtonProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
13
|
argTypes: {
|
|
7
14
|
size: {
|
|
@@ -14,9 +21,17 @@ declare const meta: {
|
|
|
14
21
|
};
|
|
15
22
|
export default meta;
|
|
16
23
|
type Story = StoryObj<typeof ModalWithDoubleButton.Column>;
|
|
24
|
+
/** 버튼 두 개를 세로로 쌓은 Column 모달이다. */
|
|
17
25
|
export declare const Default: Story;
|
|
26
|
+
/** 버튼 두 개를 가로로 놓은 Row 모달이다. 삭제 확인처럼 취소와 주 동작을 나란히 둔 모습이다. */
|
|
18
27
|
export declare const Row: Story;
|
|
19
28
|
/** 모달은 화면 가운데 하나만 뜨므로 size 는 Controls 에서 바꿔 본다. */
|
|
20
29
|
export declare const Size: Story;
|
|
30
|
+
/** 닫기 아이콘과 제목 아래 구분선을 켠 모달이다. */
|
|
21
31
|
export declare const WithCloseIconAndTitleLine: Story;
|
|
32
|
+
/** open 을 넘긴 모달이다. 오른쪽 위 X 가 진짜 닫기 버튼이 된다. 닫은 뒤 다시 열기 버튼으로 연다. */
|
|
33
|
+
export declare const CloseIconControlled: Story;
|
|
34
|
+
/** 약관처럼 본문이 긴 모달이다. 본문만 스크롤되고 위의 닫기 아이콘·제목과 아래 두 버튼은 제자리에 있다. */
|
|
35
|
+
export declare const LongContent: Story;
|
|
36
|
+
/** 오른쪽 저장 버튼이 disabled 인 모달이다. */
|
|
22
37
|
export declare const DisabledButton: Story;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import type { StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
+
parameters: {
|
|
5
|
+
docs: {
|
|
6
|
+
description: {
|
|
7
|
+
component: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
};
|
|
4
11
|
component: import("react").ForwardRefExoticComponent<import("./modal-type").ModalProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
12
|
argTypes: {
|
|
6
13
|
size: {
|
|
@@ -18,10 +25,19 @@ declare const meta: {
|
|
|
18
25
|
};
|
|
19
26
|
export default meta;
|
|
20
27
|
type Story = StoryObj<typeof meta>;
|
|
28
|
+
/** 열린 채 시작하는 기본 모달이다. 제목·설명·적용 버튼 배치를 본다. */
|
|
21
29
|
export declare const Default: Story;
|
|
22
30
|
/** 모달은 화면 가운데 하나만 뜨므로 size 는 Controls 에서 바꿔 본다. */
|
|
23
31
|
export declare const Size: Story;
|
|
32
|
+
/** 열기 버튼으로 열고 취소나 적용을 누르면 닫히는 모달이다. */
|
|
24
33
|
export declare const Controlled: Story;
|
|
34
|
+
/** 닫기 아이콘이 없는 모달이다. */
|
|
25
35
|
export declare const WithoutCloseIcon: Story;
|
|
36
|
+
/** 설명과 아래 버튼 줄이 없는 모달이다. 제목과 본문만 있을 때 여백을 본다. */
|
|
26
37
|
export declare const WithoutDescriptionAndFooter: Story;
|
|
38
|
+
/** 본문이 40줄인 모달이다. 본문만 스크롤되고 제목과 아래 버튼이 제자리에 있는지 본다. */
|
|
27
39
|
export declare const LongContent: Story;
|
|
40
|
+
/** 열면 가운데에서 커지며 들어오고 닫으면 작아지며 사라진다. 들어오고 나가는 동안에도 가운데에 머문다. */
|
|
41
|
+
export declare const MotionEnterExit: Story;
|
|
42
|
+
/** 바깥을 눌러도 닫히지 않고 창이 좌우로 흔들린다. Esc 도 막았다. 닫기는 버튼으로만 한다. */
|
|
43
|
+
export declare const MotionCloseOnOverlayClick: Story;
|
|
@@ -7,6 +7,11 @@ declare const meta: {
|
|
|
7
7
|
};
|
|
8
8
|
parameters: {
|
|
9
9
|
layout: string;
|
|
10
|
+
docs: {
|
|
11
|
+
description: {
|
|
12
|
+
component: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
10
15
|
};
|
|
11
16
|
};
|
|
12
17
|
export default meta;
|
|
@@ -21,3 +26,5 @@ export declare const Presets: Story;
|
|
|
21
26
|
export declare const Provider: Story;
|
|
22
27
|
/** OS 의 동작 줄이기 설정과, 그 설정이 CSS 시간 변수에 준 값을 보여 준다. 켜면 --motion-enter-duration 이 0ms 가 된다. */
|
|
23
28
|
export declare const ReducedMotion: Story;
|
|
29
|
+
/** 토큰마다 그 모션을 보여 주는 컴포넌트 스토리로 가는 목록. 툴바의 Motion 메뉴로 동작 줄이기를 켜고 비교한다. */
|
|
30
|
+
export declare const Gallery: Story;
|
|
@@ -14,7 +14,7 @@ export interface NoticeProps extends Omit<ComponentPropsWithRef<'div'>, 'title'>
|
|
|
14
14
|
title?: ReactNode;
|
|
15
15
|
/** 본문 글 */
|
|
16
16
|
children: ReactNode;
|
|
17
|
-
/** 본문 아래 작은 버튼(CTAButton xs·
|
|
17
|
+
/** 본문 아래 작은 버튼(CTAButton xs·primary·outline) 하나 */
|
|
18
18
|
action?: NoticeAction;
|
|
19
19
|
/** 조건부로 나타나는 안내만 준다. 나타날 때 흐려졌다 선명해진다 */
|
|
20
20
|
motion?: (typeof motion)[number];
|
|
@@ -2,6 +2,13 @@ import type { StoryObj } from '@storybook/react-webpack5';
|
|
|
2
2
|
import { motion, variant } from './notice-props';
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
|
+
parameters: {
|
|
6
|
+
docs: {
|
|
7
|
+
description: {
|
|
8
|
+
component: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
};
|
|
5
12
|
component: import("react").ForwardRefExoticComponent<Omit<import("./notice-type").NoticeProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
13
|
argTypes: {
|
|
7
14
|
variant: {
|
|
@@ -21,16 +28,10 @@ declare const meta: {
|
|
|
21
28
|
children: string;
|
|
22
29
|
};
|
|
23
30
|
decorators: ((Story: import("storybook/internal/csf").PartialStoryFn<import("@storybook/react-webpack5").ReactRenderer, {
|
|
24
|
-
|
|
25
|
-
children: import("react").ReactNode;
|
|
26
|
-
className?: string | undefined | undefined;
|
|
31
|
+
slot?: string | undefined | undefined;
|
|
27
32
|
style?: import("react").CSSProperties | undefined;
|
|
33
|
+
title?: import("react").ReactNode;
|
|
28
34
|
key?: import("react").Key | null | undefined;
|
|
29
|
-
color?: string | undefined | undefined;
|
|
30
|
-
content?: string | undefined | undefined;
|
|
31
|
-
translate?: "yes" | "no" | undefined | undefined;
|
|
32
|
-
motion?: (typeof motion)[number] | undefined;
|
|
33
|
-
slot?: string | undefined | undefined;
|
|
34
35
|
defaultChecked?: boolean | undefined | undefined;
|
|
35
36
|
defaultValue?: string | number | readonly string[] | undefined;
|
|
36
37
|
suppressContentEditableWarning?: boolean | undefined | undefined;
|
|
@@ -38,6 +39,7 @@ declare const meta: {
|
|
|
38
39
|
accessKey?: string | undefined | undefined;
|
|
39
40
|
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
|
|
40
41
|
autoFocus?: boolean | undefined | undefined;
|
|
42
|
+
className?: string | undefined | undefined;
|
|
41
43
|
contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
|
|
42
44
|
contextMenu?: string | undefined | undefined;
|
|
43
45
|
dir?: string | undefined | undefined;
|
|
@@ -49,9 +51,11 @@ declare const meta: {
|
|
|
49
51
|
nonce?: string | undefined | undefined;
|
|
50
52
|
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
51
53
|
tabIndex?: number | undefined | undefined;
|
|
54
|
+
translate?: "yes" | "no" | undefined | undefined;
|
|
52
55
|
radioGroup?: string | undefined | undefined;
|
|
53
56
|
role?: import("react").AriaRole | undefined;
|
|
54
57
|
about?: string | undefined | undefined;
|
|
58
|
+
content?: string | undefined | undefined;
|
|
55
59
|
datatype?: string | undefined | undefined;
|
|
56
60
|
inlist?: any;
|
|
57
61
|
prefix?: string | undefined | undefined;
|
|
@@ -63,6 +67,7 @@ declare const meta: {
|
|
|
63
67
|
vocab?: string | undefined | undefined;
|
|
64
68
|
autoCorrect?: string | undefined | undefined;
|
|
65
69
|
autoSave?: string | undefined | undefined;
|
|
70
|
+
color?: string | undefined | undefined;
|
|
66
71
|
itemProp?: string | undefined | undefined;
|
|
67
72
|
itemScope?: boolean | undefined | undefined;
|
|
68
73
|
itemType?: string | undefined | undefined;
|
|
@@ -128,6 +133,7 @@ declare const meta: {
|
|
|
128
133
|
"aria-valuemin"?: number | undefined | undefined;
|
|
129
134
|
"aria-valuenow"?: number | undefined | undefined;
|
|
130
135
|
"aria-valuetext"?: string | undefined | undefined;
|
|
136
|
+
children: import("react").ReactNode;
|
|
131
137
|
dangerouslySetInnerHTML?: {
|
|
132
138
|
__html: string | TrustedHTML;
|
|
133
139
|
} | undefined | undefined;
|
|
@@ -289,8 +295,9 @@ declare const meta: {
|
|
|
289
295
|
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
290
296
|
onTransitionEnd?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
291
297
|
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
292
|
-
|
|
298
|
+
motion?: (typeof motion)[number] | undefined;
|
|
293
299
|
variant?: (typeof variant)[number] | undefined;
|
|
300
|
+
action?: import("./notice-type").NoticeAction | undefined;
|
|
294
301
|
ref?: import("react").LegacyRef<HTMLDivElement> | undefined;
|
|
295
302
|
}>) => import("react/jsx-runtime").JSX.Element)[];
|
|
296
303
|
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Context, ReactElement } from 'react';
|
|
2
|
+
import { ConfirmResult } from './overlay-type';
|
|
3
|
+
/** Provider 가 그릴 때 넘기는 것. 열림과 퇴장 끝 알림은 Provider 가 쥔다 */
|
|
4
|
+
export interface OverlayRenderState {
|
|
5
|
+
open: boolean;
|
|
6
|
+
onExited: () => void;
|
|
7
|
+
portalContainer?: HTMLElement;
|
|
8
|
+
}
|
|
9
|
+
export type OverlayRender = (state: OverlayRenderState) => ReactElement;
|
|
10
|
+
/** 'closing' 이면 답은 이미 돌려줬고 퇴장 애니메이션이 끝나길 기다린다. 끝나면 스택에서 빠진다 */
|
|
11
|
+
export type OverlayPhase = 'open' | 'closing';
|
|
12
|
+
export type OverlayEntry = {
|
|
13
|
+
id: number;
|
|
14
|
+
kind: 'toast';
|
|
15
|
+
phase: OverlayPhase;
|
|
16
|
+
render: OverlayRender;
|
|
17
|
+
} | {
|
|
18
|
+
id: number;
|
|
19
|
+
kind: 'dialog';
|
|
20
|
+
phase: OverlayPhase;
|
|
21
|
+
render: OverlayRender;
|
|
22
|
+
resolve: (result: ConfirmResult) => void;
|
|
23
|
+
};
|
|
24
|
+
/** 같은 답을 두 번 줘도, 닫히는 중에 다시 줘도 처음 것만 남는다 */
|
|
25
|
+
export type SettleDialog = (result: ConfirmResult) => void;
|
|
26
|
+
export interface OverlayController {
|
|
27
|
+
openDialog: (build: (settle: SettleDialog) => OverlayRender) => Promise<ConfirmResult>;
|
|
28
|
+
closeTopDialog: () => void;
|
|
29
|
+
showToast: (build: (dismiss: () => void) => OverlayRender) => number;
|
|
30
|
+
dismissToast: (id: number) => void;
|
|
31
|
+
}
|
|
32
|
+
export declare const OverlayContext: Context<OverlayController | null>;
|
|
33
|
+
/** Provider 밖이면 던진다. 조용히 넘어가면 "확인을 눌렀는데 아무 일도 없다" 로 나타난다 */
|
|
34
|
+
export declare const useOverlayController: (hookName: string) => OverlayController;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { OverlayProviderProps } from './overlay-type';
|
|
2
|
+
/** 앱 루트에 한 번 둔다. useDialog · useToast 가 여는 오버레이를 children 뒤에 쌓아 그린다. ToastProvider 를 품는다 */
|
|
3
|
+
export declare const OverlayProvider: {
|
|
4
|
+
(props: OverlayProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { Color } from '../button/button-type';
|
|
3
|
+
import type { ToastProps, ToastProviderProps } from '../toast/toast-type';
|
|
4
|
+
export interface OverlayProviderProps extends Omit<ToastProviderProps, 'portalContainer'> {
|
|
5
|
+
/** 훅으로 연 대화상자와 토스트 자리를 그릴 요소. 없으면 document.body(토스트 자리는 Provider 가 놓인 자리) */
|
|
6
|
+
portalContainer?: HTMLElement;
|
|
7
|
+
}
|
|
8
|
+
/** `'cancel'` 은 취소 버튼, `'dismiss'` 는 Esc · 바깥 누름 · 뒤로 가기 · `close()` 로 닫은 것이다 */
|
|
9
|
+
export type ConfirmResult = 'confirm' | 'cancel' | 'dismiss';
|
|
10
|
+
export interface DialogAlertOptions {
|
|
11
|
+
title: ReactNode;
|
|
12
|
+
description?: ReactNode;
|
|
13
|
+
/** 기본 '확인' */
|
|
14
|
+
buttonText?: string;
|
|
15
|
+
/** Modal 의 `track`. 열고 닫을 때 `open` · `close` 를 보낸다 */
|
|
16
|
+
track?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface DialogConfirmOptions {
|
|
19
|
+
title: string;
|
|
20
|
+
description?: ReactNode;
|
|
21
|
+
/** 기본 '확인' */
|
|
22
|
+
confirmText?: string;
|
|
23
|
+
/** 기본 '취소' */
|
|
24
|
+
cancelText?: string;
|
|
25
|
+
/** 확인 버튼 색(ADR 0011). 기본 'primary' */
|
|
26
|
+
color?: Extract<Color, 'primary' | 'danger'>;
|
|
27
|
+
/** Promise 를 돌려주면 끝날 때까지 확인 버튼이 loading 이고 창이 닫히지 않는다. 거부되면 창은 열린 채 `confirm` 이 같은 오류로 거부된다 */
|
|
28
|
+
onConfirm?: () => void | Promise<void>;
|
|
29
|
+
/** 주면 열 때 `open`, 닫을 때 답(`ConfirmResult`)을 value 로 `close` 를 보낸다 */
|
|
30
|
+
track?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface UseDialogReturn {
|
|
33
|
+
/** 버튼 하나짜리 알림. 어떻게 닫혀도 resolve 된다 */
|
|
34
|
+
alert: (options: DialogAlertOptions) => Promise<void>;
|
|
35
|
+
confirm: (options: DialogConfirmOptions) => Promise<ConfirmResult>;
|
|
36
|
+
/** 맨 위 대화상자를 `'dismiss'` 로 닫는다. 열린 것이 없으면 아무 일도 없다 */
|
|
37
|
+
close: () => void;
|
|
38
|
+
}
|
|
39
|
+
export type ToastShowOptions = Pick<ToastProps, 'description' | 'variant' | 'action' | 'duration'>;
|
|
40
|
+
export interface UseToastReturn {
|
|
41
|
+
/** 토스트를 띄우고 id 를 바로 돌려준다 */
|
|
42
|
+
show: (title: ReactNode, options?: ToastShowOptions) => number;
|
|
43
|
+
/** 그 토스트를 닫는다. 이미 닫혔으면 아무 일도 없다 */
|
|
44
|
+
dismiss: (id: number) => void;
|
|
45
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { OverlayProvider } from './overlay-provider';
|
|
2
|
+
export { useDialog } from './use-dialog';
|
|
3
|
+
export { useToast } from './use-toast';
|
|
4
|
+
export type { OverlayProviderProps, ConfirmResult, DialogAlertOptions, DialogConfirmOptions, UseDialogReturn, ToastShowOptions, UseToastReturn, } from './overlay-type';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: {
|
|
5
|
+
(props: import("./overlay-type").OverlayProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
displayName: string;
|
|
7
|
+
};
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: string;
|
|
10
|
+
docs: {
|
|
11
|
+
description: {
|
|
12
|
+
component: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
args: {
|
|
17
|
+
children: null;
|
|
18
|
+
};
|
|
19
|
+
decorators: ((Story: import("storybook/internal/csf").PartialStoryFn<import("@storybook/react-webpack5").ReactRenderer, {
|
|
20
|
+
portalContainer?: HTMLElement | undefined;
|
|
21
|
+
label?: string | undefined;
|
|
22
|
+
children: import("react").ReactNode;
|
|
23
|
+
position?: typeof import("../toast/toast-props").positions[number] | undefined;
|
|
24
|
+
duration?: number | undefined;
|
|
25
|
+
}>) => import("react/jsx-runtime").JSX.Element)[];
|
|
26
|
+
};
|
|
27
|
+
export default meta;
|
|
28
|
+
type Story = StoryObj<typeof meta>;
|
|
29
|
+
/** 삭제는 confirm, 저장은 alert. 취소 버튼은 cancel, Esc·바깥 누름은 dismiss 로 답이 온다. */
|
|
30
|
+
export declare const Default: Story;
|
|
31
|
+
/** onConfirm 이 Promise 면 끝날 때까지 확인 버튼이 loading 이고 창이 열려 있다. 실패하면 창은 남고 오류 토스트가 뜬다. */
|
|
32
|
+
export declare const AsyncConfirm: Story;
|
|
33
|
+
/** show 는 id 를 바로 돌려준다. dismiss(id) 로 그 토스트만 닫는다. */
|
|
34
|
+
export declare const Toast: Story;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ComponentPropsWithRef } from 'react';
|
|
2
|
+
import { PressEffectProps } from '../../helpers/motion/motion-props';
|
|
2
3
|
import { TrackProps } from '../logging/logging-type';
|
|
3
4
|
import { sizes } from './pagination-props';
|
|
4
5
|
export interface PaginationRootProps extends ComponentPropsWithRef<'nav'> {
|
|
@@ -10,7 +11,7 @@ export interface PaginationItemProps extends ComponentPropsWithRef<'button'> {
|
|
|
10
11
|
disabled?: boolean;
|
|
11
12
|
}
|
|
12
13
|
export type PaginationEllipsisProps = ComponentPropsWithRef<'span'>;
|
|
13
|
-
export interface PaginationProps extends PaginationRootProps, TrackProps {
|
|
14
|
+
export interface PaginationProps extends PaginationRootProps, TrackProps, PressEffectProps {
|
|
14
15
|
totalPages: number;
|
|
15
16
|
page?: number;
|
|
16
17
|
defaultPage?: number;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import type { StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
+
parameters: {
|
|
5
|
+
docs: {
|
|
6
|
+
description: {
|
|
7
|
+
component: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
};
|
|
4
11
|
component: import("react").ForwardRefExoticComponent<Omit<import("./pagination-type").PaginationProps, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
5
12
|
argTypes: {
|
|
6
13
|
size: {
|
|
@@ -17,9 +24,17 @@ declare const meta: {
|
|
|
17
24
|
};
|
|
18
25
|
export default meta;
|
|
19
26
|
type Story = StoryObj<typeof meta>;
|
|
27
|
+
/** 10쪽 중 1쪽에서 시작하는 페이지 이동이다. */
|
|
20
28
|
export declare const Default: Story;
|
|
29
|
+
/** 5쪽에서 시작하는 페이지 이동이다. 쪽을 누르면 현재 쪽 표시가 옮겨간다. */
|
|
21
30
|
export declare const Controlled: Story;
|
|
31
|
+
/** 크기별 페이지 이동이다. */
|
|
22
32
|
export declare const Sizes: Story;
|
|
33
|
+
/** 20쪽 중 10쪽에서 siblingCount 0·1·2 를 비교한다. 현재 쪽 양옆에 보이는 쪽 수 차이를 본다. */
|
|
23
34
|
export declare const SiblingCount: Story;
|
|
35
|
+
/** 3쪽뿐인 페이지 이동이다. 생략 표시 없이 모든 쪽이 보이는지 본다. */
|
|
24
36
|
export declare const FewPages: Story;
|
|
37
|
+
/** disabled 페이지 이동이다. 눌러도 쪽이 바뀌지 않는다. */
|
|
25
38
|
export declare const Disabled: Story;
|
|
39
|
+
/** 버튼을 누르고 있으면 줄어들고 어두워진다. 아래는 pressEffect={false} */
|
|
40
|
+
export declare const MotionPress: Story;
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { PropsWithChildren, ReactNode } from 'react';
|
|
2
|
-
import { RadioButtonProps, RadioChipProps, RadioIndicatorProps, RadioLabelProps, RadioOptionGroupProps, RadioRootProps } from './radio-type';
|
|
2
|
+
import { RadioButtonProps, RadioChipProps, RadioIndicatorProps, RadioLabelProps, RadioOptionGroupProps, RadioOptionProps, RadioRootProps } from './radio-type';
|
|
3
3
|
declare const RadioRoot: {
|
|
4
4
|
(props: PropsWithChildren<RadioRootProps>): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
displayName: string;
|
|
6
6
|
} & {
|
|
7
7
|
OptionGroup: import("react").ForwardRefExoticComponent<Omit<PropsWithChildren<RadioOptionGroupProps>, "ref"> & import("react").RefAttributes<HTMLUListElement>>;
|
|
8
|
+
Option: import("react").ForwardRefExoticComponent<RadioOptionProps & {
|
|
9
|
+
children?: ReactNode | undefined;
|
|
10
|
+
} & import("react").RefAttributes<HTMLLIElement>>;
|
|
8
11
|
Button: import("react").ForwardRefExoticComponent<Omit<PropsWithChildren<RadioButtonProps>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
9
12
|
Chip: import("react").ForwardRefExoticComponent<Omit<RadioChipProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
10
13
|
Indicator: import("react").ForwardRefExoticComponent<RadioIndicatorProps & {
|
|
11
14
|
children?: ReactNode | undefined;
|
|
12
|
-
} & import("react").RefAttributes<
|
|
15
|
+
} & import("react").RefAttributes<HTMLSpanElement>>;
|
|
13
16
|
Label: import("react").ForwardRefExoticComponent<Omit<PropsWithChildren<RadioLabelProps>, "ref"> & import("react").RefAttributes<HTMLLabelElement>>;
|
|
14
17
|
};
|
|
15
18
|
export default RadioRoot;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
import { ComponentPropsWithRef } from 'react';
|
|
3
|
+
import { ConfirmMotionProps, PressEffectProps } from '../../helpers/motion/motion-props';
|
|
3
4
|
import { AsChildProps } from '../../helpers/types/common-props';
|
|
4
5
|
import { TrackProps } from '../logging/logging-type';
|
|
5
6
|
import { variant } from './radio-props';
|
|
@@ -15,6 +16,12 @@ export interface RadioRootProps {
|
|
|
15
16
|
export type RadioOption = RadioRootProps['options'][number];
|
|
16
17
|
export interface RadioOptionGroupProps extends ComponentPropsWithRef<'ul'>, AsChildProps {
|
|
17
18
|
}
|
|
19
|
+
export interface RadioOptionProps {
|
|
20
|
+
className?: string;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
/** 칩은 버튼 자체가 role='radio' 라 li 의 목록 의미를 뺀다 */
|
|
23
|
+
role?: 'none';
|
|
24
|
+
}
|
|
18
25
|
export interface RadioLabelProps extends ComponentPropsWithRef<'label'>, AsChildProps {
|
|
19
26
|
id: string;
|
|
20
27
|
disabled?: boolean;
|
|
@@ -25,10 +32,11 @@ export interface RadioButtonProps extends ComponentPropsWithRef<'button'>, AsChi
|
|
|
25
32
|
export interface RadioChipProps extends Omit<ComponentPropsWithRef<'button'>, 'id'> {
|
|
26
33
|
id: string;
|
|
27
34
|
}
|
|
28
|
-
export interface RadioIndicatorProps extends
|
|
35
|
+
export interface RadioIndicatorProps extends AsChildProps, ConfirmMotionProps {
|
|
29
36
|
id: string;
|
|
37
|
+
className?: string;
|
|
30
38
|
}
|
|
31
|
-
export interface RadioProps extends RadioRootProps, TrackProps {
|
|
39
|
+
export interface RadioProps extends RadioRootProps, TrackProps, PressEffectProps, ConfirmMotionProps {
|
|
32
40
|
/** `chip` 이면 선택지를 칩으로 가로로 늘어놓는다. 칩 전체가 라디오다 */
|
|
33
41
|
variant?: (typeof variant)[number];
|
|
34
42
|
/** 선택지 묶음의 'aria-label' (예: '배송 방법') */
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import type { StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
+
parameters: {
|
|
5
|
+
docs: {
|
|
6
|
+
description: {
|
|
7
|
+
component: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
};
|
|
4
11
|
component: import("react").ForwardRefExoticComponent<import("./radio-type").RadioProps & import("react").RefAttributes<HTMLUListElement>>;
|
|
5
12
|
argTypes: {
|
|
6
13
|
variant: {
|
|
@@ -19,10 +26,21 @@ declare const meta: {
|
|
|
19
26
|
};
|
|
20
27
|
export default meta;
|
|
21
28
|
type Story = StoryObj<typeof meta>;
|
|
29
|
+
/** 게시물 공개 범위를 고르는 라디오다. 아무것도 고르지 않은 채 시작한다. */
|
|
22
30
|
export declare const Default: Story;
|
|
31
|
+
/** 팔로워만이 골라진 채 시작한다. */
|
|
23
32
|
export declare const Selected: Story;
|
|
33
|
+
/** 고를 수 없는 선택지는 흐려지고 눌러도 골라지지 않는다. 왜 막혔는지 라벨에 적는다. */
|
|
24
34
|
export declare const Disabled: Story;
|
|
25
|
-
/** label 은 ReactNode 도 받는다. */
|
|
26
|
-
export declare const
|
|
35
|
+
/** label 은 ReactNode 도 받는다. 설명이 붙어 두 줄이 되면 동그라미는 첫 줄에 맞춘다. */
|
|
36
|
+
export declare const WithDescription: Story;
|
|
37
|
+
/** 실제 화면처럼 카드 안에서 쓴 모습이다. 질문 제목, 선택지, 저장 버튼 순서로 놓는다. */
|
|
38
|
+
export declare const InForm: Story;
|
|
39
|
+
/** 동그란 버튼을 누르고 있으면 줄어든다. 오른쪽은 pressEffect={false} */
|
|
40
|
+
export declare const MotionPress: Story;
|
|
41
|
+
/** 점 스프링. 왼쪽 weak(기본), 오른쪽 strong. 빠르게 번갈아 눌러도 지금 크기에서 이어 간다 */
|
|
42
|
+
export declare const MotionStrength: Story;
|
|
43
|
+
/** 막힌 선택지(버튼이나 라벨)를 누르면 그 줄이 흔들린다(pointerdown, Chromium) */
|
|
44
|
+
export declare const MotionDisabledShake: Story;
|
|
27
45
|
/** 폼 안의 짧은 선택지. 처음에는 아무것도 고르지 않는다. */
|
|
28
46
|
export declare const Chip: Story;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
declare const
|
|
1
|
+
declare const BaseSkeletonRoot: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
2
2
|
ref?: ((instance: HTMLSpanElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
3
|
-
}, "ref"> & import("react").RefAttributes<HTMLSpanElement
|
|
4
|
-
|
|
3
|
+
}, "ref"> & import("react").RefAttributes<HTMLSpanElement>> & {
|
|
4
|
+
Group: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
5
|
+
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
6
|
+
}, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
7
|
+
};
|
|
8
|
+
export default BaseSkeletonRoot;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SkeletonBlock, SkeletonPattern } from './skeleton-group-type';
|
|
2
|
+
export declare const patterns: readonly ["list", "listWithIcon", "titleList", "card", "table"];
|
|
3
|
+
/** 패턴마다 위에서부터 그릴 블록. repeat 은 마지막 블록을 되풀이한다 */
|
|
4
|
+
export declare const PATTERNS: Record<SkeletonPattern, SkeletonBlock[]>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { StyleProps } from '../../helpers/types/common-props';
|
|
2
|
+
import type { PrimitiveTokens } from '../../tokens/generated';
|
|
3
|
+
import type { patterns } from './skeleton-group-props';
|
|
4
|
+
/** --spacing-* 의 이름. tokens/figma.json 에서 생성된 primitive.spacing 의 키다 */
|
|
5
|
+
export type SpacingToken = keyof PrimitiveTokens['spacing'];
|
|
6
|
+
export type SkeletonPattern = (typeof patterns)[number];
|
|
7
|
+
/** 묶음이 그리는 블록 하나. row 는 블록을 가로로 놓는다 */
|
|
8
|
+
export type SkeletonBlock = {
|
|
9
|
+
kind: 'title';
|
|
10
|
+
} | {
|
|
11
|
+
kind: 'subtitle';
|
|
12
|
+
} | {
|
|
13
|
+
kind: 'text';
|
|
14
|
+
lines: number;
|
|
15
|
+
} | {
|
|
16
|
+
kind: 'circle';
|
|
17
|
+
} | {
|
|
18
|
+
kind: 'rect';
|
|
19
|
+
} | {
|
|
20
|
+
kind: 'card';
|
|
21
|
+
} | {
|
|
22
|
+
kind: 'spacer';
|
|
23
|
+
size: SpacingToken;
|
|
24
|
+
} | {
|
|
25
|
+
kind: 'row';
|
|
26
|
+
items: SkeletonBlock[];
|
|
27
|
+
};
|
|
28
|
+
/** custom 에 쓰는 이름. text 는 한 줄, spacer:{n} 은 --spacing-{n} 만큼 더 띄운다 */
|
|
29
|
+
export type SkeletonCustomToken = Exclude<SkeletonBlock['kind'], 'spacer' | 'row'> | `spacer:${SpacingToken}`;
|
|
30
|
+
interface SkeletonGroupCommonProps extends StyleProps {
|
|
31
|
+
/** 마지막 블록을 몇 번 그릴지. 목록·표 패턴의 마지막 블록은 행이다. 기본 3 */
|
|
32
|
+
repeat?: number;
|
|
33
|
+
/** 블록마다 Skeleton 의 shimmer 를 켠다. 기본 true */
|
|
34
|
+
animated?: boolean;
|
|
35
|
+
/** 영역의 이름. 기본 '불러오는 중' */
|
|
36
|
+
'aria-label'?: string;
|
|
37
|
+
}
|
|
38
|
+
export type SkeletonGroupProps = SkeletonGroupCommonProps & ({
|
|
39
|
+
/** 미리 정한 모양. 기본 'list' */
|
|
40
|
+
pattern?: SkeletonPattern;
|
|
41
|
+
custom?: never;
|
|
42
|
+
} | {
|
|
43
|
+
pattern?: never;
|
|
44
|
+
/** 위에서부터 그릴 블록 이름. pattern 과 함께 쓰지 않는다 */
|
|
45
|
+
custom: SkeletonCustomToken[];
|
|
46
|
+
});
|
|
47
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { SkeletonGroupProps } from './skeleton-group-type';
|
|
2
|
+
declare const SkeletonGroup: import("react").ForwardRefExoticComponent<SkeletonGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
3
|
+
export default SkeletonGroup;
|
|
4
|
+
export type { SkeletonBlock, SkeletonCustomToken, SkeletonGroupProps, SkeletonPattern, SpacingToken, } from './skeleton-group-type';
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import { SkeletonGroupProps, SkeletonPattern } from './skeleton-group-type';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
parameters: {
|
|
6
|
+
docs: {
|
|
7
|
+
description: {
|
|
8
|
+
component: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
component: import("react").ForwardRefExoticComponent<SkeletonGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
13
|
+
argTypes: {
|
|
14
|
+
pattern: {
|
|
15
|
+
control: {
|
|
16
|
+
type: "select";
|
|
17
|
+
};
|
|
18
|
+
options: readonly ["list", "listWithIcon", "titleList", "card", "table"];
|
|
19
|
+
};
|
|
20
|
+
repeat: {
|
|
21
|
+
control: {
|
|
22
|
+
type: "number";
|
|
23
|
+
min: number;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
animated: {
|
|
27
|
+
control: {
|
|
28
|
+
type: "boolean";
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
args: {
|
|
33
|
+
pattern: "list";
|
|
34
|
+
repeat: number;
|
|
35
|
+
animated: true;
|
|
36
|
+
};
|
|
37
|
+
decorators: ((Story: import("storybook/internal/csf").PartialStoryFn<import("@storybook/react-webpack5").ReactRenderer, {
|
|
38
|
+
'aria-label'?: string | undefined;
|
|
39
|
+
repeat?: number | undefined;
|
|
40
|
+
animated?: boolean | undefined;
|
|
41
|
+
pattern?: SkeletonPattern | undefined;
|
|
42
|
+
}>) => import("react/jsx-runtime").JSX.Element)[];
|
|
43
|
+
};
|
|
44
|
+
export default meta;
|
|
45
|
+
type Story = StoryObj<typeof meta>;
|
|
46
|
+
/** list 패턴이다. 한 줄 글을 repeat 만큼 그린다. */
|
|
47
|
+
export declare const Default: Story;
|
|
48
|
+
/** 다섯 패턴을 나란히 본다. repeat 은 마지막 블록(목록·표는 행)을 되풀이한다. */
|
|
49
|
+
export declare const Patterns: Story;
|
|
50
|
+
/** 원 하나와 두 줄 글을 한 행으로 그리는 아이콘 목록이다. */
|
|
51
|
+
export declare const ListWithIcon: Story;
|
|
52
|
+
/** 머리 행 하나와 본문 행을 사각형 칸으로 그리는 표다. */
|
|
53
|
+
export declare const Table: Story;
|
|
54
|
+
/** custom 으로 블록 순서를 직접 적는다. spacer:24 는 --spacing-24 만큼 더 띄운다. */
|
|
55
|
+
export declare const Custom: Story;
|
|
56
|
+
/** animated 를 끄면 모든 블록이 shimmer 없이 바탕만 보인다. */
|
|
57
|
+
export declare const Static: Story;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ComponentPropsWithRef } from 'react';
|
|
2
2
|
import { shapes } from './skeleton-props';
|
|
3
3
|
export type BaseSkeletonProps = ComponentPropsWithRef<'span'>;
|
|
4
|
+
export type BaseSkeletonGroupProps = ComponentPropsWithRef<'div'>;
|
|
4
5
|
export interface SkeletonProps extends BaseSkeletonProps {
|
|
5
6
|
shape?: (typeof shapes)[number];
|
|
6
7
|
width?: number | string;
|