@nurihaus/web-design-system 3.9.2 → 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/dist/.storybook/preview.d.ts +49 -0
- package/dist/ai/components.md +675 -105
- 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 +39 -14
- 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 +12 -5
- 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 +6 -2
- package/dist/components/collapsible-menu/collapsible-menu.stories.d.ts +12 -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 +33 -8
- 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 +18 -8
- 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 +15 -8
- 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 +13 -6
- 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 +17 -6
- 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-type.d.ts +2 -1
- package/dist/components/table/table.stories.d.ts +23 -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 +21 -6
- package/dist/components/tooltip/tooltip-type.d.ts +4 -1
- package/dist/components/tooltip/tooltip.stories.d.ts +11 -0
- package/dist/components.css +1924 -697
- package/dist/cta-button.js +94 -33
- package/dist/data-table.js +5 -3
- 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 +3992 -967
- 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/skeleton-group.js +445 -0
- package/dist/skeleton.js +24 -112
- package/dist/step-progress.js +125 -16
- package/dist/styles.css +2235 -777
- 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
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Color, LegacyVariant, Variant } from './button-type';
|
|
2
|
+
export interface Appearance {
|
|
3
|
+
color: Color;
|
|
4
|
+
variant: Variant;
|
|
5
|
+
}
|
|
6
|
+
/** ADR 0011 의 대응표. 다음 메이저에서 LegacyVariant 와 함께 지운다 */
|
|
7
|
+
export declare const LEGACY_VARIANT: {
|
|
8
|
+
readonly primary: {
|
|
9
|
+
readonly color: "primary";
|
|
10
|
+
readonly variant: "fill";
|
|
11
|
+
};
|
|
12
|
+
readonly secondary: {
|
|
13
|
+
readonly color: "primary";
|
|
14
|
+
readonly variant: "weak";
|
|
15
|
+
};
|
|
16
|
+
readonly ghost: {
|
|
17
|
+
readonly color: "primary";
|
|
18
|
+
readonly variant: "outline";
|
|
19
|
+
};
|
|
20
|
+
readonly neutral: {
|
|
21
|
+
readonly color: "primary";
|
|
22
|
+
readonly variant: "ghost";
|
|
23
|
+
};
|
|
24
|
+
readonly confirm: {
|
|
25
|
+
readonly color: "danger";
|
|
26
|
+
readonly variant: "fill";
|
|
27
|
+
};
|
|
28
|
+
readonly outlined: {
|
|
29
|
+
readonly color: "danger";
|
|
30
|
+
readonly variant: "outline";
|
|
31
|
+
};
|
|
32
|
+
readonly social: {
|
|
33
|
+
readonly color: "neutral";
|
|
34
|
+
readonly variant: "outline";
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
interface AppearanceProps {
|
|
38
|
+
color?: Color;
|
|
39
|
+
variant?: Variant | LegacyVariant;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* 옛 값으로 읽어야 하는 variant. `ghost` 는 옛 값(선 버튼)이자 새 값(바탕 없음)이라
|
|
43
|
+
* `color` 를 같이 준 쪽만 새 뜻이다. 옛 코드는 `color` 를 모른다.
|
|
44
|
+
*/
|
|
45
|
+
export declare const legacyVariantOf: ({ color, variant }: AppearanceProps) => LegacyVariant | undefined;
|
|
46
|
+
/** 넘겨받은 `color`·`variant` 를 새 두 축 한 쌍으로 정한다. 옛 값은 표로 옮기고, 같이 준 `color` 가 표보다 앞선다 */
|
|
47
|
+
export declare const resolveAppearance: (props: AppearanceProps) => Appearance;
|
|
48
|
+
/** 개발 빌드에서 옛 값마다 한 번 옮길 곳을 알린다 */
|
|
49
|
+
export declare const warnLegacyVariant: (legacy: LegacyVariant) => void;
|
|
50
|
+
export {};
|
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const colors: readonly ["primary", "neutral", "danger"];
|
|
2
|
+
export declare const variants: readonly ["fill", "weak", "outline", "ghost"];
|
|
3
|
+
/** ADR 0011 이전의 variant. `button-appearance.ts` 의 LEGACY_VARIANT 가 새 두 축으로 옮긴다. 다음 메이저에서 지운다 */
|
|
4
|
+
export declare const legacyVariants: readonly ["primary", "secondary", "ghost", "neutral", "confirm", "outlined", "social"];
|
|
2
5
|
export declare const sizes: readonly ["xs", "s", "m", "l", "xl"];
|
|
3
6
|
export declare const ctaButtonProps: {
|
|
4
|
-
|
|
7
|
+
color: {
|
|
5
8
|
type: "className";
|
|
6
9
|
className: string;
|
|
7
|
-
values: readonly ["primary", "
|
|
10
|
+
values: readonly ["primary", "neutral", "danger"];
|
|
8
11
|
default: "primary";
|
|
9
12
|
};
|
|
13
|
+
variant: {
|
|
14
|
+
type: "className";
|
|
15
|
+
className: string;
|
|
16
|
+
values: readonly ["fill", "weak", "outline", "ghost"];
|
|
17
|
+
default: "fill";
|
|
18
|
+
};
|
|
10
19
|
size: import("../../helpers/types/propsDef").ClassNamePropsType<readonly ["xs", "s", "m", "l", "xl"]>;
|
|
11
20
|
};
|
|
@@ -1,21 +1,31 @@
|
|
|
1
1
|
import { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
|
+
import { AppearProps, PressEffectProps } from '../../helpers/motion/motion-props';
|
|
2
3
|
import { AsChildProps } from '../../helpers/types/common-props';
|
|
3
4
|
import { TrackProps } from '../logging/logging-type';
|
|
4
|
-
import { sizes,
|
|
5
|
+
import { colors, legacyVariants, sizes, variants } from './button-props';
|
|
6
|
+
export type Color = (typeof colors)[number];
|
|
7
|
+
export type Variant = (typeof variants)[number];
|
|
8
|
+
/** @deprecated ADR 0011 이전의 variant. `color` × `variant` 로 옮긴다(usage.md 의 대응표). 다음 메이저에서 지운다 */
|
|
9
|
+
export type LegacyVariant = (typeof legacyVariants)[number];
|
|
5
10
|
export interface CommonButtonProps {
|
|
11
|
+
/** 글자 자리(너비)를 지킨 채 가리고 가운데에 로딩 표시를 띄운다. aria-busy 가 붙고 클릭은 무시한다 */
|
|
6
12
|
loading?: boolean;
|
|
7
13
|
}
|
|
8
14
|
export interface BaseButtonProps extends ComponentPropsWithRef<'button'>, CommonButtonProps, AsChildProps {
|
|
9
15
|
children?: ReactNode;
|
|
16
|
+
/** 주면 children 을 너비를 지키는 칸에 넣고, loading 동안 이것을 그 위에 띄운다 */
|
|
10
17
|
loadingComponent?: ReactNode;
|
|
11
18
|
}
|
|
12
|
-
export interface CTAButtonProps extends ComponentPropsWithRef<'button'>, CommonButtonProps, AsChildProps, TrackProps {
|
|
13
|
-
|
|
19
|
+
export interface CTAButtonProps extends ComponentPropsWithRef<'button'>, CommonButtonProps, AsChildProps, TrackProps, PressEffectProps, AppearProps {
|
|
20
|
+
/** 무슨 색. 역할 이름이고 토큰 이름이 아니다. 기본 `primary` */
|
|
21
|
+
color?: Color;
|
|
22
|
+
/** 얼마나 세게. 기본 `fill`. 옛 일곱 값은 한 마이너 동안 받는다. `color` 없는 `ghost` 는 옛 뜻(`primary · outline`)이다 */
|
|
23
|
+
variant?: Variant | LegacyVariant;
|
|
14
24
|
size?: (typeof sizes)[number];
|
|
15
25
|
text: string | ReactNode;
|
|
16
26
|
leftIcon?: ReactNode;
|
|
17
27
|
rightIcon?: ReactNode;
|
|
18
|
-
/** 버튼 오른쪽 위 모서리에 끼우는 말풍선(Callout) 글자. 글자는 움직이지 않는다. 로딩 중에는
|
|
28
|
+
/** 버튼 오른쪽 위 모서리에 끼우는 말풍선(Callout) 글자. 글자는 움직이지 않는다. 로딩 중에는 점(LoadingDots)과 바뀌어 숨는다 */
|
|
19
29
|
callout?: ReactNode;
|
|
20
30
|
/** 링크 요소 하나(`<a>`·라우터 Link)를 children 으로 주면 그 요소가 버튼 모양이 된다. 버튼 글자·아이콘은 그 안에 들어간다. loading 은 쓰지 않는다 */
|
|
21
31
|
children?: ReactNode;
|
|
@@ -1,13 +1,26 @@
|
|
|
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("./button-type").CTAButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
5
12
|
argTypes: {
|
|
13
|
+
color: {
|
|
14
|
+
control: {
|
|
15
|
+
type: "select";
|
|
16
|
+
};
|
|
17
|
+
options: readonly ["primary", "neutral", "danger"];
|
|
18
|
+
};
|
|
6
19
|
variant: {
|
|
7
20
|
control: {
|
|
8
21
|
type: "select";
|
|
9
22
|
};
|
|
10
|
-
options: readonly ["
|
|
23
|
+
options: readonly ["fill", "weak", "outline", "ghost"];
|
|
11
24
|
};
|
|
12
25
|
size: {
|
|
13
26
|
control: {
|
|
@@ -18,16 +31,34 @@ declare const meta: {
|
|
|
18
31
|
};
|
|
19
32
|
args: {
|
|
20
33
|
text: string;
|
|
21
|
-
|
|
34
|
+
color: "primary";
|
|
35
|
+
variant: "fill";
|
|
22
36
|
size: "l";
|
|
23
37
|
};
|
|
24
38
|
};
|
|
25
39
|
export default meta;
|
|
26
40
|
type Story = StoryObj<typeof meta>;
|
|
41
|
+
/** 기본 CTAButton 이다. 컨트롤에서 props 를 바꿔 본다. */
|
|
27
42
|
export declare const Default: Story;
|
|
28
|
-
|
|
43
|
+
/** color 줄마다 variant 넷을 늘어놓았다. 칸마다 위에서부터 기본·disabled·loading 이다. 호버는 마우스를 올려 본다. */
|
|
44
|
+
export declare const Matrix: Story;
|
|
45
|
+
/** ADR 0011 이전의 variant 일곱이다. 각각 라벨의 새 조합과 같은 모양이어야 한다. 개발 빌드에서는 값마다 한 번 콘솔 경고가 뜬다. 다음 메이저에서 지운다. */
|
|
46
|
+
export declare const Legacy: Story;
|
|
47
|
+
/** 크기별 버튼을 한 줄로 늘어놓았다. 높이와 글자 크기 차이를 본다. */
|
|
29
48
|
export declare const Sizes: Story;
|
|
49
|
+
/** loading 상태 버튼이다. 글자 자리에 점 세 개가 뜨는지 본다. */
|
|
30
50
|
export declare const Loading: Story;
|
|
51
|
+
/** disabled 버튼이다. 흐려진 모습을 본다. 눌렀을 때 흔들림은 MotionDisabledShake 에서 본다. */
|
|
31
52
|
export declare const Disabled: Story;
|
|
53
|
+
/** 왼쪽에 체크, 오른쪽에 아래 화살표 아이콘을 단 버튼이다. 아이콘과 글자 사이 간격을 본다. */
|
|
32
54
|
export declare const WithIcons: Story;
|
|
55
|
+
/** 다른 화면으로 옮겨 가는 버튼이다. 넘긴 링크 요소가 버튼 모양이 된다. */
|
|
33
56
|
export declare const AsLink: Story;
|
|
57
|
+
/** pressEffect 를 켠 버튼과 끈 버튼이다. 각각 누르고 있을 때 눌림 효과 차이를 비교한다. */
|
|
58
|
+
export declare const MotionPress: Story;
|
|
59
|
+
/** 왼쪽 버튼만 loading 이다. 아래 버튼으로 loading 을 껐다 켜며 두 버튼의 폭이 같게 유지되는지 본다. */
|
|
60
|
+
export declare const MotionLoadingKeepsWidth: Story;
|
|
61
|
+
/** fade·scale·slide 등장 효과를 단 버튼 세 개다. 다시 재생 버튼으로 0.4초 뒤 나타나는 모습을 반복해 본다. */
|
|
62
|
+
export declare const MotionAppear: Story;
|
|
63
|
+
/** disabled 버튼이다. 눌러서 옆으로 짧게 흔들리는지 본다. Firefox 에서는 흔들리지 않을 수 있다. */
|
|
64
|
+
export declare const MotionDisabledShake: Story;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { CTAButtonProps } from './button-type';
|
|
2
2
|
declare const CTAButton: import("react").ForwardRefExoticComponent<Omit<CTAButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
3
3
|
export default CTAButton;
|
|
4
|
-
export type { CTAButtonProps } from './button-type';
|
|
4
|
+
export type { CTAButtonProps, Color as CTAButtonColor, Variant as CTAButtonVariant, } from './button-type';
|
|
@@ -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("./callout-type").CalloutProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
|
|
5
12
|
argTypes: {
|
|
6
13
|
tail: {
|
|
@@ -16,7 +23,11 @@ declare const meta: {
|
|
|
16
23
|
};
|
|
17
24
|
export default meta;
|
|
18
25
|
type Story = StoryObj<typeof meta>;
|
|
26
|
+
/** 최근 사용 문구를 담은 기본 말풍선이다. */
|
|
19
27
|
export declare const Default: Story;
|
|
28
|
+
/** 꼬리 방향별 말풍선이다. 꼬리가 가리키는 쪽과 위치를 본다. */
|
|
20
29
|
export declare const Tails: Story;
|
|
21
30
|
/** CTAButton 의 callout prop — 버튼 오른쪽 위 모서리에 끼운다 */
|
|
22
31
|
export declare const OnButton: Story;
|
|
32
|
+
/** 나타날 때 꼬리에서 pop(enter strong) 한 뒤 세 번 둥실(attention float)하고 멈춘다. 버튼으로 다시 마운트한다 */
|
|
33
|
+
export declare const MotionEnter: Story;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ComponentPropsWithRef } from 'react';
|
|
2
|
+
import { PressEffectProps } from '../../helpers/motion/motion-props';
|
|
2
3
|
import { AsChildProps } from '../../helpers/types/common-props';
|
|
3
4
|
import { variant } from './card-props';
|
|
4
5
|
export interface BaseCardProps extends ComponentPropsWithRef<'div'>, AsChildProps {
|
|
5
6
|
}
|
|
6
|
-
export interface CardProps extends ComponentPropsWithRef<'div'>, AsChildProps {
|
|
7
|
+
export interface CardProps extends ComponentPropsWithRef<'div'>, AsChildProps, PressEffectProps {
|
|
7
8
|
variant?: (typeof variant)[number];
|
|
8
9
|
}
|
|
@@ -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("./card-type").CardProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
12
|
argTypes: {
|
|
6
13
|
variant: {
|
|
@@ -22,3 +29,5 @@ export declare const Variants: Story;
|
|
|
22
29
|
export declare const Link: Story;
|
|
23
30
|
/** 버튼 카드 */
|
|
24
31
|
export declare const Button: Story;
|
|
32
|
+
/** 링크 카드를 누르고 있으면 줄어든다. 아래는 pressEffect={false} */
|
|
33
|
+
export declare const MotionPress: Story;
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
export declare const sizes: readonly ["s", "m", "l"];
|
|
2
|
+
/** filled 는 보라 네모에 흰 체크, outlined 는 네모 없이 체크만(꺼짐 회색·켜짐 보라) */
|
|
3
|
+
export declare const variant: readonly ["filled", "outlined"];
|
|
2
4
|
export declare const checkBoxIndicatorProps: {
|
|
3
5
|
size: import("../../helpers/types/propsDef").ClassNamePropsType<readonly ["s", "m", "l"]>;
|
|
6
|
+
variant: {
|
|
7
|
+
type: "className";
|
|
8
|
+
className: string;
|
|
9
|
+
values: readonly ["filled", "outlined"];
|
|
10
|
+
default: "filled";
|
|
11
|
+
};
|
|
4
12
|
};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { ConfirmMotionProps, PressEffectProps } from '../../helpers/motion/motion-props';
|
|
2
3
|
import { AsChildProps } from '../../helpers/types/common-props';
|
|
3
4
|
import { TrackProps } from '../logging/logging-type';
|
|
4
|
-
import { sizes } from './check-box-props';
|
|
5
|
+
import { sizes, variant } from './check-box-props';
|
|
6
|
+
/** 체크박스는 세기를 고르지 않는다. 채움이 칸 안에서 퍼지므로 strong 의 넘침이 보이지 않는다 */
|
|
7
|
+
export type CheckBoxMotionProps = Pick<ConfirmMotionProps, 'delay'>;
|
|
5
8
|
export interface CheckBoxRootProps {
|
|
6
9
|
checked?: boolean;
|
|
7
10
|
onChange?: (checked: boolean) => void;
|
|
@@ -9,16 +12,17 @@ export interface CheckBoxRootProps {
|
|
|
9
12
|
disabled?: boolean;
|
|
10
13
|
className?: string;
|
|
11
14
|
}
|
|
12
|
-
export interface CheckBoxIndicatorProps extends
|
|
15
|
+
export interface CheckBoxIndicatorProps extends CheckBoxMotionProps {
|
|
13
16
|
className?: string;
|
|
14
17
|
}
|
|
15
18
|
export interface CheckBoxLabelProps extends AsChildProps {
|
|
16
19
|
preventChangeOnClick?: boolean;
|
|
17
20
|
className?: string;
|
|
18
21
|
}
|
|
19
|
-
export interface CheckBoxProps extends CheckBoxRootProps, TrackProps {
|
|
22
|
+
export interface CheckBoxProps extends CheckBoxRootProps, TrackProps, PressEffectProps, CheckBoxMotionProps {
|
|
20
23
|
label: string | ReactNode;
|
|
21
24
|
size?: (typeof sizes)[number];
|
|
25
|
+
variant?: (typeof variant)[number];
|
|
22
26
|
className?: string;
|
|
23
27
|
onClick?: (checked: boolean) => void;
|
|
24
28
|
}
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import type { StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import type { CheckBoxProps } from './check-box-type';
|
|
2
3
|
declare const meta: {
|
|
3
4
|
title: string;
|
|
4
|
-
component: import("react").ForwardRefExoticComponent<
|
|
5
|
+
component: import("react").ForwardRefExoticComponent<CheckBoxProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
parameters: {
|
|
7
|
+
docs: {
|
|
8
|
+
description: {
|
|
9
|
+
component: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
5
13
|
argTypes: {
|
|
6
14
|
size: {
|
|
7
15
|
control: {
|
|
@@ -9,6 +17,12 @@ declare const meta: {
|
|
|
9
17
|
};
|
|
10
18
|
options: readonly ["s", "m", "l"];
|
|
11
19
|
};
|
|
20
|
+
variant: {
|
|
21
|
+
control: {
|
|
22
|
+
type: "select";
|
|
23
|
+
};
|
|
24
|
+
options: readonly ["filled", "outlined"];
|
|
25
|
+
};
|
|
12
26
|
};
|
|
13
27
|
args: {
|
|
14
28
|
id: string;
|
|
@@ -17,8 +31,25 @@ declare const meta: {
|
|
|
17
31
|
};
|
|
18
32
|
export default meta;
|
|
19
33
|
type Story = StoryObj<typeof meta>;
|
|
34
|
+
/** 누를 때마다 체크가 바뀌는 기본 체크박스다. */
|
|
20
35
|
export declare const Default: Story;
|
|
36
|
+
/** 크기별 체크박스다. 상자와 라벨 크기 차이를 본다. */
|
|
21
37
|
export declare const Sizes: Story;
|
|
38
|
+
/** filled 는 보라 네모에 흰 체크, outlined 는 네모 없이 체크만. 둘 다 켜진 상태로 나란히 */
|
|
39
|
+
export declare const Variants: Story;
|
|
40
|
+
/** 체크된 상태로 고정된 체크박스다. */
|
|
22
41
|
export declare const Checked: Story;
|
|
42
|
+
/** disabled 체크박스를 체크 안 됨과 체크됨으로 나란히 그렸다. 두 상태 모두 흐려지는지 본다. */
|
|
23
43
|
export declare const Disabled: Story;
|
|
44
|
+
/** 라벨 없이 상자만 있는 체크박스다. */
|
|
24
45
|
export declare const WithoutLabel: Story;
|
|
46
|
+
/** 체크 칸을 누르고 있으면 줄어든다. 오른쪽은 pressEffect={false} */
|
|
47
|
+
export declare const MotionPress: Story;
|
|
48
|
+
/** 체크하면 보라 채움과 흰 체크가 짧게 떠오른다. 해제는 반대로 사라진다 */
|
|
49
|
+
export declare const MotionFill: Story;
|
|
50
|
+
/** 연타. 버튼은 70ms 마다 다섯 번 바꾼다. 전환이 중간에서 되돌아가도 깜빡이지 않아야 한다 */
|
|
51
|
+
export declare const MotionRapidToggle: Story;
|
|
52
|
+
/** delay 로 차례로 체크된다. 전체 동의를 누르면 아래 항목이 80ms 간격으로 따라온다 */
|
|
53
|
+
export declare const MotionDelay: Story;
|
|
54
|
+
/** disabled 를 누르면 흔들린다(pointerdown, Chromium) */
|
|
55
|
+
export declare const MotionDisabledShake: Story;
|
|
@@ -1 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
/** 칩이 놓이는 바탕의 무게. filled 는 페이지 바탕 위, outlined 는 카드·시트 안, ghost 는 촘촘하거나 보조 필터 */
|
|
2
|
+
export declare const variant: readonly ["filled", "outlined", "ghost"];
|
|
3
|
+
/** s 는 페이지 바탕 위(36), xs 는 카드·시트 안(28) */
|
|
4
|
+
export declare const sizes: readonly ["xs", "s"];
|
|
5
|
+
export declare const chipGroupProps: {
|
|
6
|
+
variant: {
|
|
7
|
+
type: "className";
|
|
8
|
+
className: string;
|
|
9
|
+
values: readonly ["filled", "outlined", "ghost"];
|
|
10
|
+
default: "filled";
|
|
11
|
+
};
|
|
12
|
+
size: import("../../helpers/types/propsDef").ClassNamePropsType<readonly ["xs", "s"]>;
|
|
13
|
+
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
|
+
import { PressEffectProps } from '../../helpers/motion/motion-props';
|
|
2
3
|
import { StyleProps } from '../../helpers/types/common-props';
|
|
3
4
|
import { TrackProps } from '../logging/logging-type';
|
|
5
|
+
import { sizes, variant } from './chip-group-props';
|
|
4
6
|
export interface ChipGroupItem {
|
|
5
7
|
id: string;
|
|
6
8
|
label: ReactNode;
|
|
@@ -8,13 +10,15 @@ export interface ChipGroupItem {
|
|
|
8
10
|
count?: number;
|
|
9
11
|
disabled?: boolean;
|
|
10
12
|
}
|
|
11
|
-
export interface ChipGroupProps extends StyleProps, TrackProps {
|
|
13
|
+
export interface ChipGroupProps extends StyleProps, TrackProps, PressEffectProps {
|
|
12
14
|
items: ChipGroupItem[];
|
|
13
15
|
value?: string;
|
|
14
16
|
defaultValue?: string;
|
|
15
17
|
onValueChange?: (id: string) => void;
|
|
16
18
|
/** 'aria-label' 로 붙는다 (예: '캠페인 종류') */
|
|
17
19
|
label: string;
|
|
20
|
+
variant?: (typeof variant)[number];
|
|
21
|
+
size?: (typeof sizes)[number];
|
|
18
22
|
}
|
|
19
23
|
export interface ChipGroupRootProps extends Omit<ComponentPropsWithRef<'div'>, 'defaultValue' | 'dir'> {
|
|
20
24
|
value: string;
|
|
@@ -1,7 +1,28 @@
|
|
|
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("./chip-group-type").ChipGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
12
|
+
argTypes: {
|
|
13
|
+
variant: {
|
|
14
|
+
control: {
|
|
15
|
+
type: "select";
|
|
16
|
+
};
|
|
17
|
+
options: readonly ["filled", "outlined", "ghost"];
|
|
18
|
+
};
|
|
19
|
+
size: {
|
|
20
|
+
control: {
|
|
21
|
+
type: "select";
|
|
22
|
+
};
|
|
23
|
+
options: readonly ["xs", "s"];
|
|
24
|
+
};
|
|
25
|
+
};
|
|
5
26
|
args: {
|
|
6
27
|
label: string;
|
|
7
28
|
items: ({
|
|
@@ -24,4 +45,13 @@ declare const meta: {
|
|
|
24
45
|
};
|
|
25
46
|
export default meta;
|
|
26
47
|
type Story = StoryObj<typeof meta>;
|
|
48
|
+
/** 캠페인 종류를 고르는 칩 묶음이다. 누르면 선택이 옮겨간다. 칩 옆 개수와 비활성인 이벤트 칩을 본다. */
|
|
27
49
|
export declare const Default: Story;
|
|
50
|
+
/** 바탕의 무게별 세 variant 를 같은 항목으로 나란히 놓았다. 고른 칩의 모양 차이를 본다. */
|
|
51
|
+
export declare const Variants: Story;
|
|
52
|
+
/** 두 크기. s 는 페이지 바탕 위, xs 는 카드·시트 안에 들어가는 크기다. */
|
|
53
|
+
export declare const Sizes: Story;
|
|
54
|
+
/** 카드 안에 들어간 outlined xs. 상자 안에서 채움 없이 가볍게 보이는지 본다. */
|
|
55
|
+
export declare const InCard: Story;
|
|
56
|
+
/** 칩을 누르고 있으면 줄어들고 어두워진다. 아래는 pressEffect={false} */
|
|
57
|
+
export declare const MotionPress: Story;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ComponentType, MouseEvent, ReactNode } from 'react';
|
|
1
|
+
import { CSSProperties, ComponentType, MouseEvent, ReactNode } from 'react';
|
|
2
|
+
import { PressEffectProps } from '../../helpers/motion/motion-props';
|
|
2
3
|
import { AsChildProps, StyleProps } from '../../helpers/types/common-props';
|
|
3
4
|
import { TrackProps } from '../logging/logging-type';
|
|
4
5
|
import { sizes } from './collapsible-menu-props';
|
|
@@ -41,12 +42,14 @@ export interface CollapsibleMenuSection {
|
|
|
41
42
|
export interface CollapsibleMenuLinkProps {
|
|
42
43
|
href: string;
|
|
43
44
|
className: string;
|
|
45
|
+
/** 펼침 순서(`--i`). className 처럼 링크 요소에 그대로 넘긴다 */
|
|
46
|
+
style?: CSSProperties;
|
|
44
47
|
children: ReactNode;
|
|
45
48
|
onClick: (e: MouseEvent) => void;
|
|
46
49
|
'aria-current'?: 'page';
|
|
47
50
|
'aria-disabled'?: 'true';
|
|
48
51
|
}
|
|
49
|
-
export interface CollapsibleMenuProps extends StyleProps, TrackProps {
|
|
52
|
+
export interface CollapsibleMenuProps extends StyleProps, TrackProps, PressEffectProps {
|
|
50
53
|
size?: (typeof sizes)[number];
|
|
51
54
|
/** 섹션 없는 항목. `sections` 와 함께 주면 `sections` 앞에 그린다. 섹션만 쓰면 `[]`. */
|
|
52
55
|
items: CollapsibleMenuItem[];
|
|
@@ -55,6 +58,7 @@ export interface CollapsibleMenuProps extends StyleProps, TrackProps {
|
|
|
55
58
|
activeKey?: string;
|
|
56
59
|
onActiveKeyChange?: (key: string) => void;
|
|
57
60
|
indent?: number;
|
|
61
|
+
/** 하위 메뉴가 있는 행 오른쪽의 화살표. 열리면 돈다. 기본은 아래 화살표 */
|
|
58
62
|
chevron?: ReactNode;
|
|
59
63
|
width?: number | string;
|
|
60
64
|
linkComponent?: ComponentType<CollapsibleMenuLinkProps>;
|
|
@@ -2,6 +2,13 @@ import type { StoryObj } from '@storybook/react-webpack5';
|
|
|
2
2
|
import { CollapsibleMenuItem } from './collapsible-menu-type';
|
|
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("./collapsible-menu-type").CollapsibleMenuProps & import("react").RefAttributes<HTMLElement>>;
|
|
6
13
|
argTypes: {
|
|
7
14
|
size: {
|
|
@@ -18,10 +25,15 @@ 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;
|
|
30
|
+
/** 크기별 메뉴를 나란히 놓았다. 줄 높이와 글자 크기 차이를 본다. */
|
|
22
31
|
export declare const Sizes: Story;
|
|
23
32
|
/** 자식이 있는 항목에 disabled 를 주면 그룹(Radix Collapsible root)이 접히지도 펼쳐지지도 않는다. */
|
|
24
33
|
export declare const Disabled: Story;
|
|
34
|
+
/** 직접 만든 링크 컴포넌트로 그린 메뉴다. Users 그룹이 펼쳐진 채 시작하고 User List 는 비활성이다. */
|
|
25
35
|
export declare const CustomLink: Story;
|
|
26
36
|
/** 섹션 제목 + 목록 묶음. 그룹은 `open`·`onOpenChange` 로 밖에서 열고, 접힌 사이드바 흉내로 Alt+클릭은 열지 않는다. */
|
|
27
37
|
export declare const Sections: Story;
|
|
38
|
+
/** 그룹을 열고 닫으면 화살표가 돌고 하위 메뉴 높이가 늘고 준다. 빠르게 연타해 중간에 뒤집혀도 끊기지 않는지 본다. 행을 누르고 있으면 배경이 한 단계 진해진다(크기는 줄지 않는다). 오른쪽은 pressEffect={false}. */
|
|
39
|
+
export declare const MotionExpand: 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("./description-list-type").DescriptionListProps & import("react").RefAttributes<HTMLDListElement>>;
|
|
5
12
|
args: {
|
|
6
13
|
items: {
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
|
-
import { DrawerCloseProps, DrawerDescriptionProps, DrawerRootProps, DrawerTitleProps, DrawerTriggerProps } from './drawer-type';
|
|
2
|
+
import { DrawerCloseProps, DrawerContentProps, DrawerDescriptionProps, DrawerRootProps, DrawerTitleProps, DrawerTriggerProps } from './drawer-type';
|
|
3
3
|
declare const DrawerRoot: {
|
|
4
4
|
(props: PropsWithChildren<DrawerRootProps>): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
displayName: string;
|
|
6
6
|
} & {
|
|
7
7
|
Trigger: import("react").ForwardRefExoticComponent<Omit<DrawerTriggerProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
8
|
-
Content: import("react").ForwardRefExoticComponent<Omit<
|
|
9
|
-
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;
|
|
10
|
-
}, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
8
|
+
Content: import("react").ForwardRefExoticComponent<Omit<DrawerContentProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
11
9
|
Title: import("react").ForwardRefExoticComponent<Omit<DrawerTitleProps, "ref"> & import("react").RefAttributes<HTMLHeadingElement>>;
|
|
12
10
|
Description: import("react").ForwardRefExoticComponent<Omit<DrawerDescriptionProps, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
13
11
|
Close: import("react").ForwardRefExoticComponent<Omit<DrawerCloseProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ComponentPropsWithRef, ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { EnterMotionProps, PresenceCallbackProps } from '../../helpers/motion/motion-props';
|
|
2
3
|
import { AsChildProps, StyleProps } from '../../helpers/types/common-props';
|
|
3
4
|
import { TrackProps } from '../logging/logging-type';
|
|
4
5
|
import { sides, sizes } from './drawer-props';
|
|
@@ -9,14 +10,20 @@ export interface DrawerRootProps {
|
|
|
9
10
|
}
|
|
10
11
|
export interface DrawerTriggerProps extends ComponentPropsWithRef<'button'>, AsChildProps {
|
|
11
12
|
}
|
|
12
|
-
export
|
|
13
|
+
export interface DrawerContentProps extends ComponentPropsWithRef<'div'> {
|
|
14
|
+
/** 패널을 그릴 요소. Radix `Dialog.Portal` 의 container. 없으면 document.body */
|
|
15
|
+
portalContainer?: HTMLElement;
|
|
16
|
+
/** 바깥 누름·Esc 로 닫히기 직전. `preventDefault()` 하면 열린 채로 남는다 */
|
|
17
|
+
onPointerDownOutside?: (event: Event) => void;
|
|
18
|
+
onEscapeKeyDown?: (event: KeyboardEvent) => void;
|
|
19
|
+
}
|
|
13
20
|
export interface DrawerTitleProps extends ComponentPropsWithRef<'h2'>, AsChildProps {
|
|
14
21
|
}
|
|
15
22
|
export interface DrawerDescriptionProps extends ComponentPropsWithRef<'p'>, AsChildProps {
|
|
16
23
|
}
|
|
17
24
|
export interface DrawerCloseProps extends ComponentPropsWithRef<'button'>, AsChildProps {
|
|
18
25
|
}
|
|
19
|
-
export interface DrawerProps extends DrawerRootProps, StyleProps, TrackProps {
|
|
26
|
+
export interface DrawerProps extends DrawerRootProps, StyleProps, TrackProps, EnterMotionProps, PresenceCallbackProps {
|
|
20
27
|
/** asChild 로 감싸 클릭하면 열리는 요소. 없으면 open·defaultOpen 으로만 연다 */
|
|
21
28
|
trigger?: ReactElement;
|
|
22
29
|
title: ReactNode;
|
|
@@ -26,4 +33,12 @@ export interface DrawerProps extends DrawerRootProps, StyleProps, TrackProps {
|
|
|
26
33
|
side?: (typeof sides)[number];
|
|
27
34
|
size?: (typeof sizes)[number];
|
|
28
35
|
showCloseIcon?: boolean;
|
|
36
|
+
/** false 면 바깥을 눌러도 닫히지 않고 패널이 좌우로 흔들린다. 기본 true */
|
|
37
|
+
closeOnOverlayClick?: boolean;
|
|
38
|
+
/** false 면 Esc 로 닫히지 않는다. 기본 true */
|
|
39
|
+
closeOnEscape?: boolean;
|
|
40
|
+
/** 패널을 그릴 요소. 없으면 document.body */
|
|
41
|
+
portalContainer?: HTMLElement;
|
|
42
|
+
/** 열린 동안 history 항목을 하나 쌓아 브라우저·기기의 뒤로 가기가 페이지 대신 패널을 닫는다. 기본 true */
|
|
43
|
+
closeOnBackEvent?: boolean;
|
|
29
44
|
}
|
|
@@ -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("./drawer-type").DrawerProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
12
|
argTypes: {
|
|
6
13
|
side: {
|
|
@@ -24,11 +31,25 @@ declare const meta: {
|
|
|
24
31
|
};
|
|
25
32
|
export default meta;
|
|
26
33
|
type Story = StoryObj<typeof meta>;
|
|
34
|
+
/** 열기 버튼을 누르면 상세 정보 서랍이 열린다. */
|
|
27
35
|
export declare const Default: Story;
|
|
36
|
+
/** 방향별 열기 버튼이다. 버튼마다 서랍이 어느 쪽에서 나오는지 본다. */
|
|
28
37
|
export declare const Sides: Story;
|
|
38
|
+
/** 크기별 열기 버튼이다. 서랍 폭 차이를 본다. */
|
|
29
39
|
export declare const Sizes: Story;
|
|
40
|
+
/** 화면 아래에서 올라오는 서랍이다. */
|
|
30
41
|
export declare const Bottom: Story;
|
|
42
|
+
/** 설명 문구와 취소·저장 버튼 줄을 단 서랍이다. 제목 아래 설명과 아래쪽 버튼 줄 배치를 본다. */
|
|
31
43
|
export declare const WithDescriptionAndFooter: Story;
|
|
44
|
+
/** 닫기 아이콘이 없는 서랍이다. 바깥을 누르거나 Esc 로 닫히는지 본다. */
|
|
32
45
|
export declare const WithoutCloseIcon: Story;
|
|
46
|
+
/** 본문이 40줄인 서랍이다. 본문만 스크롤되고 제목과 아래 버튼이 제자리에 있는지 본다. */
|
|
33
47
|
export declare const LongContent: Story;
|
|
48
|
+
/** 바깥 버튼으로 열고 닫는 서랍이다. 서랍 안에서 닫아도 버튼 문구가 열기로 돌아오는지 본다. */
|
|
34
49
|
export declare const Controlled: Story;
|
|
50
|
+
/** 같은 방향의 weak·strong 을 나란히 열어 본다. strong 은 스프링이라 끝에서 한 번 튄다. 퇴장은 둘이 같다. */
|
|
51
|
+
export declare const MotionStrength: Story;
|
|
52
|
+
/** 바깥을 눌러도 닫히지 않고 패널이 좌우로 흔들린다. Esc 도 막았다. 닫기는 X 나 버튼으로만 한다. */
|
|
53
|
+
export declare const MotionCloseOnOverlayClick: Story;
|
|
54
|
+
/** 열고 닫으면 애니메이션이 끝난 뒤 onEntered·onExited 가 불린다. */
|
|
55
|
+
export declare const MotionEnterExit: Story;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { PressEffectProps } from '../../helpers/motion/motion-props';
|
|
2
3
|
import { AsChildProps, StyleProps } from '../../helpers/types/common-props';
|
|
3
4
|
import { TrackProps } from '../logging/logging-type';
|
|
4
5
|
import { sizes } from './drop-down-props';
|
|
@@ -24,11 +25,12 @@ export interface DropDownContentProps extends AsChildProps, StyleProps {
|
|
|
24
25
|
}
|
|
25
26
|
export interface DropDownItemProps extends AsChildProps {
|
|
26
27
|
className?: string;
|
|
28
|
+
style?: CSSProperties;
|
|
27
29
|
value: string;
|
|
28
30
|
disabled?: boolean;
|
|
29
31
|
onClick?: () => void;
|
|
30
32
|
}
|
|
31
|
-
export interface DropDownProps extends StyleProps, TrackProps {
|
|
33
|
+
export interface DropDownProps extends StyleProps, TrackProps, PressEffectProps {
|
|
32
34
|
size?: (typeof sizes)[number];
|
|
33
35
|
defaultValue?: string;
|
|
34
36
|
value?: string;
|