@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
package/dist/ai/components.md
CHANGED
|
@@ -22,12 +22,14 @@ import '@nurihaus/web-design-system/components.css';
|
|
|
22
22
|
|
|
23
23
|
**size 는 전역 이름이다.** `xs · s · m · l · xl` 다섯 개뿐이고, 컴포넌트는 그중 지원하는 것만 받는다(props 표 참고). 같은 글자는 한 줄에 나란히 놓이는 컨트롤(CTAButton · DropDown · TextField)에서 같은 높이다. px 는 `tokens.md` 의 `--control-height-*` 같은 변수에 있고, 컴포넌트에 숫자로 높이를 주지 않는다.
|
|
24
24
|
|
|
25
|
-
**색은 variant 가 정한다.**
|
|
25
|
+
**색은 variant 가 정한다.** IconButton · OptionBadge · IconTextBadge · IconTextOptionBadge 는 `variant` 로 글자·배경·테두리 색이 묶여서 정해진다. 색 prop 은 없다. CTAButton 은 `color`(`primary` · `neutral` · `danger`) × `variant`(`fill` · `weak` · `outline` · `ghost`) 두 축이다. 이 `color` 는 역할 이름이고 토큰 이름을 받지 않는다(ADR 0011). 색을 받는 컴포넌트는 Text(`color`, 토큰 이름만) 하나다. 로딩 가족(Spinner · InlineLoading · OverlayLoading · ProgressBar · LoadingDots)도 `variant`(`neutral` · `brand` · `inverse`)로 색을 고르고, 표 밖의 색은 `className` 이나 `style` 의 `color` 로 덮는다.
|
|
26
26
|
|
|
27
|
-
**커스텀은 `className` 과 `style` 로 한다.** 모든 컴포넌트가 둘을 받아 루트 요소에 붙인다(TextField 는 입력 상자, DataTable 은 `<table>`). variant 가 정한 색을 className 으로 덮으려면 `.cta-button.variant-
|
|
27
|
+
**커스텀은 `className` 과 `style` 로 한다.** 모든 컴포넌트가 둘을 받아 루트 요소에 붙인다(TextField 는 입력 상자, DataTable 은 `<table>`). variant 가 정한 색을 className 으로 덮으려면 `.cta-button.color-primary.variant-fill` 보다 구체적인 선택자가 필요하다. 색·간격·글자 값은 `tokens.md` 의 변수만 쓴다.
|
|
28
28
|
|
|
29
29
|
**상태는 prop 으로 넘긴다.** `disabled`, `loading`, `isError`, `open`, `checked` 처럼 컴포넌트가 받는 상태 prop 을 쓰고, 클래스를 직접 붙여 상태를 흉내 내지 않는다. 값이 있는 컴포넌트는 `value`/`onValueChange`(제어) 또는 `defaultValue`(비제어) 둘 중 하나로 쓴다.
|
|
30
30
|
|
|
31
|
+
**로딩은 무엇이 기다리는지로 고른다.** 누른 버튼은 CTAButton `loading`(점 셋), 모양을 아는 첫 화면은 Skeleton, 모양을 모르는 영역·더 불러오기는 InlineLoading, 진행률을 아는 작업은 ProgressBar, 문장 끝과 글자 한 줄 자리(버튼 글자, 더 보기 행, 보내기)는 LoadingDots, 화면을 막아야 하면 OverlayLoading(진행률을 알면 `progress`), 다른 요소 안에 딸린 링은 Spinner 다. 화면에 혼자 놓이는 로딩은 글자가 있는 InlineLoading 이고, 글자 없는 링만 보이면 어딘가에 딸린 Spinner 다. 모두 `size`(s · m · l) · `variant`(neutral · brand · inverse) · `delay` 이름이 같다. 링·점·막대를 직접 그리지 않는다. 한 컴포넌트의 로딩 모양은 하나다. CTAButton 은 LoadingDots 뿐이고 링·막대로 바꿀 수 없다.
|
|
32
|
+
|
|
31
33
|
**Tooltip 이 여러 개면 `TooltipProvider` 로 감싼다.** 앱 루트에 한 번 두면 된다. 조건이 맞을 때만 띄우려면 `open` 을 제어하지 말고 `disabled` 를 쓴다.
|
|
32
34
|
|
|
33
35
|
**사용 로그는 `track` 으로 남긴다.** 앱 루트에 `LogProvider` 를 한 번 두고 `onEvent` 에서 로그 수집기로 보낸다. 컴포넌트에 `track="report/download"` 처럼 개발자가 정한 이름을 주면 아래 상호작용이 이벤트로 나간다. `component` 는 컴포넌트의 displayName 이다(Checkbox 는 `'CheckBox'`).
|
|
@@ -37,6 +39,7 @@ import '@nurihaus/web-design-system/components.css';
|
|
|
37
39
|
| CTAButton · IconButton | 누를 때 | `click` | 없음 |
|
|
38
40
|
| DataTable | `onClickRow` 가 있는 헤더 칸을 누를 때 | `click` | 그 칸의 `id` |
|
|
39
41
|
| Modal · Drawer | 열고 닫을 때 | `open` · `close` | 없음 |
|
|
42
|
+
| `useDialog().confirm` | 열고 닫을 때. `component` 는 `'ModalWithDoubleButton'` | `open` · `close` | `close` 는 답 `'confirm'` · `'cancel'` · `'dismiss'` |
|
|
40
43
|
| Tabs · DropDown · ChipGroup · Radio | 고를 때 | `change` | 탭 id · 옵션 value · 칩 id · 선택지 id |
|
|
41
44
|
| Checkbox · Switch | 켜고 끌 때 | `change` | `'on'` · `'off'` |
|
|
42
45
|
| Pagination | 페이지가 바뀔 때 | `change` | 페이지 번호(문자열) |
|
|
@@ -53,12 +56,33 @@ import '@nurihaus/web-design-system/components.css';
|
|
|
53
56
|
|
|
54
57
|
`value` 에는 개발자가 정한 id 만 들어가고 사용자가 입력한 글자는 들어가지 않는다. TextField · TextArea 가 값을 싣지 않는 것도 그래서다. 더 붙일 값은 `trackProps` 로 준다. `LogProvider` 가 없거나 `track` 이 없으면 아무것도 보내지 않는다. 컴포넌트 밖의 로그(화면 진입 등)는 `useLog` 를 쓴다.
|
|
55
58
|
|
|
56
|
-
Avatar · OptionBadge · IconTextBadge · IconTextOptionBadge · Skeleton · Text · Icon · StepProgress · Spinner · InlineLoading · OverlayLoading · ListGroup · DescriptionList · EmptyState · MessageThread · Message · MessageEvent · BottomBar 는 상호작용 핸들러가 없어 `track` 을 받지 않는다. Card 도 받지 않는다 — 누르는 카드는 asChild 로 넘긴 링크·버튼이 로그를 맡는다. ModalWithDoubleButton 은 `left` · `right` 가 CTAButton props 라 거기에 `track` 을 준다. Notice 는 `action` 에 `track` 을 주면 그 버튼(CTAButton)이 보낸다. EmptyState 의 버튼은 넘긴 CTAButton 에 준다.
|
|
59
|
+
Avatar · OptionBadge · IconTextBadge · IconTextOptionBadge · Skeleton · Text · Icon · StepProgress · Spinner · InlineLoading · OverlayLoading · ProgressBar · LoadingDots · ListGroup · DescriptionList · EmptyState · MessageThread · Message · MessageEvent · BottomBar 는 상호작용 핸들러가 없어 `track` 을 받지 않는다. Card 도 받지 않는다 — 누르는 카드는 asChild 로 넘긴 링크·버튼이 로그를 맡는다. ModalWithDoubleButton 은 `left` · `right` 가 CTAButton props 라 거기에 `track` 을 준다. Notice 는 `action` 에 `track` 을 주면 그 버튼(CTAButton)이 보낸다. EmptyState 의 버튼은 넘긴 CTAButton 에 준다.
|
|
60
|
+
|
|
61
|
+
**모션은 토큰이 정하고 prop 으로만 조절한다.** 앱 루트에 `MotionProvider` 를 한 번 두면 Checkbox · Radio · Switch 의 확정 피드백이 스프링으로 움직이고, OS 의 "동작 줄이기" 설정을 따른다. 없어도 그려지지만 스프링이 돌지 않는다. CSS 전환·키프레임은 Provider 와 상관없이 돌고, 동작 줄이기에서는 시간이 0 이 된다. 어느 컴포넌트에 어떤 모션이 붙는지는 `motion.md` 의 매핑표가 정하고, 아래 prop 으로만 켜고 끈다. 없는 모션을 className 으로 흉내 내지 않는다.
|
|
62
|
+
|
|
63
|
+
| prop | 모양 | 받는 컴포넌트 | 뜻 |
|
|
64
|
+
| --- | --- | --- | --- |
|
|
65
|
+
| `pressEffect` | `boolean`, 기본 `true` | CTAButton · ChipGroup · Tabs · BottomNav · Checkbox · Radio · Switch · Pagination · Breadcrumb · DropDown(선택지만) · CollapsibleMenu · DataTable · Card(asChild 만) · ListRow(딤만) · Tag(지우기 버튼) · MessageComposer(보내기 버튼) · MediaThumbnail · IconButton | 누르는 동안 살짝 줄고 어두워진다. `false` 로 끈다 |
|
|
66
|
+
| `motion` | `'weak' \| 'strong'`, 기본 `'weak'` | Radio · Switch(확정 바운스) · Tooltip · Drawer(등장 세기) | 세기. strong 은 튀는 스프링. Checkbox 는 채움이라 세기가 없다 |
|
|
67
|
+
| `delay` | ms `number` | Checkbox · Radio · Switch | 확정 피드백을 늦춘다 |
|
|
68
|
+
| `onEntered` · `onExited` | `() => void` | Modal · ModalWithDoubleButton(`open` 을 넘길 때) · Drawer · Toast · Tooltip | 등장·퇴장 애니메이션이 끝난 뒤 한 번. 동작 줄이기에서도 한 번 불린다 |
|
|
69
|
+
| `closeOnOverlayClick` · `closeOnEscape` | `boolean`, 기본 `true` | Modal · Drawer | `false` 면 닫히지 않고 창이 좌우로 살짝 흔들린다 |
|
|
70
|
+
| `closeOnBackEvent` | `boolean`, 기본 `true` | Modal · Drawer · ModalWithDoubleButton(`open` 을 넘길 때) | 뒤로 가기가 페이지 대신 창을 닫는다. 다른 길로 닫으면 쌓은 history 항목을 되돌린다 |
|
|
71
|
+
| `appear` | `{ animation: 'fade' \| 'scale' \| 'slide', delay?: ms }` | CTAButton · BottomNav | 화면에 들어온 뒤 `delay` 만큼 숨었다가 나타난다. 한 화면에 하나만 |
|
|
72
|
+
| `animated` | `boolean`, 기본 `true` | StepProgress · ProgressBar | `current`·`value` 가 바뀔 때 막대가 차오른다. 첫 렌더는 움직이지 않는다 |
|
|
73
|
+
| `stagger` · `delay` | `boolean \| ms` · ms | StepProgress | 첫 렌더에 단계가 차례로 나타난다 |
|
|
74
|
+
| `hideOnScroll` · `hideOnScrollThreshold` | `boolean` · px, 기본 1 | BottomNav | 아래로 스크롤하면 숨고 위로 올리면 돌아온다 |
|
|
75
|
+
| `loading` | `boolean` | CTAButton | 너비를 유지한 채 글자 대신 점 셋(LoadingDots, 글자색). `aria-busy`, 클릭 무시 |
|
|
76
|
+
| `delay` | `boolean`, 기본 `true` | Spinner · InlineLoading · OverlayLoading · ProgressBar · LoadingDots | 300ms 안에 끝나면 보이지 않는다. 자리와 role 은 처음부터 있다 |
|
|
77
|
+
| `effectRef` | `Ref<AttentionHandle>` | OptionBadge · IconTextBadge · IconTextOptionBadge | `effectRef.current.shine(n)` · `blink(n)` 으로 주목을 끈다. 자동 재생은 없다 |
|
|
78
|
+
|
|
79
|
+
disabled 인 CTAButton · Checkbox · Radio · Switch 를 누르면 흔들려서 막혔음을 알린다. prop 이 없고 Chromium 의 pointerdown 으로 동작한다. 모달의 바깥 클릭이 막혔을 때도 같은 흔들림이다.
|
|
57
80
|
|
|
58
81
|
**없는 것은 지어내지 않는다.** 이 문서 끝의 "아직 없는 것" 표에 있는 컴포넌트는 없다. 없는 prop · variant · 토큰 이름도 만들지 않는다. 틀린 variant 나 size 값은 타입 오류가 난다.
|
|
59
82
|
|
|
60
83
|
## 목록
|
|
61
84
|
|
|
85
|
+
- [Asset](#asset)
|
|
62
86
|
- [Avatar](#avatar)
|
|
63
87
|
- [CTAButton](#ctabutton)
|
|
64
88
|
- [IconButton](#iconbutton)
|
|
@@ -78,6 +102,7 @@ Avatar · OptionBadge · IconTextBadge · IconTextOptionBadge · Skeleton · Tex
|
|
|
78
102
|
- [Modal](#modal)
|
|
79
103
|
- [Drawer](#drawer)
|
|
80
104
|
- [Skeleton](#skeleton)
|
|
105
|
+
- [SkeletonGroup](#skeletongroup)
|
|
81
106
|
- [Breadcrumb](#breadcrumb)
|
|
82
107
|
- [DropDown](#dropdown)
|
|
83
108
|
- [CollapsibleMenu](#collapsiblemenu)
|
|
@@ -89,6 +114,8 @@ Avatar · OptionBadge · IconTextBadge · IconTextOptionBadge · Skeleton · Tex
|
|
|
89
114
|
- [Spinner](#spinner)
|
|
90
115
|
- [InlineLoading](#inlineloading)
|
|
91
116
|
- [OverlayLoading](#overlayloading)
|
|
117
|
+
- [ProgressBar](#progressbar)
|
|
118
|
+
- [LoadingDots](#loadingdots)
|
|
92
119
|
- [Icon](#icon)
|
|
93
120
|
- [BottomNav](#bottomnav)
|
|
94
121
|
- [StepProgress](#stepprogress)
|
|
@@ -109,6 +136,102 @@ Avatar · OptionBadge · IconTextBadge · IconTextOptionBadge · Skeleton · Tex
|
|
|
109
136
|
- [MediaViewer](#mediaviewer)
|
|
110
137
|
- [LogProvider](#logprovider)
|
|
111
138
|
- [MotionProvider](#motionprovider)
|
|
139
|
+
- [OverlayProvider](#overlayprovider)
|
|
140
|
+
|
|
141
|
+
## Asset
|
|
142
|
+
|
|
143
|
+
```ts
|
|
144
|
+
import { Asset } from '@nurihaus/web-design-system/asset'; // 이 컴포넌트만 싣는다 (권장)
|
|
145
|
+
import { Asset } from '@nurihaus/web-design-system'; // 루트. 첫 로드 JS 가 커진다
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
**언제 쓴다.** 목록 행 앞의 아이콘 타일, 상품·가게 썸네일, 사진이 없을 때의 이니셜처럼 틀에 담긴 그림 하나를 보여 줄 때 쓴다. `Asset.Frame` 이 모양·크기·바탕을 정하고, 안에 `Asset.Image`·`Asset.Icon`·`Asset.Text` 중 하나를 넣는다.
|
|
149
|
+
|
|
150
|
+
**쓰지 않는다.** 사람 프로필 사진에는 Avatar 를 쓴다(불러오지 못하면 기본 그림이 나온다). 눌러서 크게 보는 사진·영상은 MediaThumbnail 을 쓴다.
|
|
151
|
+
|
|
152
|
+
### Asset.Frame
|
|
153
|
+
|
|
154
|
+
틀이다. `shape` 는 `square`(기본)·`circle`·`squircle`·`card`, `size` 는 모양마다 고를 수 있는 것이 다르다. square 는 xs~xl, circle·squircle 은 s~xl, card 는 m~xl 이고 표에 없는 조합은 타입 오류다. 같은 크기 이름이면 square·circle·squircle 은 같은 상자다. `background` 는 `none`(기본, 감싼 곳의 글자색을 물려받는다)·`neutral`·`primary`. `accessory` 에 넣은 요소는 틀 밖 모서리(`accessoryPosition`, 기본 `bottom-right`)에 겹치고 틀이 자르지 않는다. `overlap` 을 준 틀끼리 나란히 두면 옆으로 겹친다. `className`·`style`·`ref` 는 틀 요소에 붙는다.
|
|
155
|
+
|
|
156
|
+
```tsx
|
|
157
|
+
<Asset.Frame shape="circle" size="m" background="primary" accessory={<span>N</span>}>
|
|
158
|
+
<Asset.Text>NH</Asset.Text>
|
|
159
|
+
</Asset.Frame>
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Asset.Image
|
|
163
|
+
|
|
164
|
+
틀을 채우는 사진이다. `alt` 는 필수다(꾸밈 사진이면 `alt=""`). `fit` 은 `cover`(기본, 잘라서 채움)·`contain`(다 보이게 줄임). 모서리는 틀 모양대로 잘린다.
|
|
165
|
+
|
|
166
|
+
```tsx
|
|
167
|
+
<Asset.Frame shape="card" size="l">
|
|
168
|
+
<Asset.Image src="https://placehold.co/120x120" alt="상품 사진" fit="cover" />
|
|
169
|
+
</Asset.Frame>
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Asset.Icon
|
|
173
|
+
|
|
174
|
+
틀 가운데 아이콘이다. Icon 의 prop 을 받되 `size` 는 받지 않는다. 크기는 틀의 절반이고 색은 틀 바탕을 따른다.
|
|
175
|
+
|
|
176
|
+
```tsx
|
|
177
|
+
<Asset.Frame shape="squircle" size="s" background="neutral">
|
|
178
|
+
<Asset.Icon name="bell" />
|
|
179
|
+
</Asset.Frame>
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Asset.Text
|
|
183
|
+
|
|
184
|
+
틀 가운데 짧은 글(이니셜 두 글자 안팎)이다. 글자 크기는 틀 크기를, 색은 틀 바탕을 따른다.
|
|
185
|
+
|
|
186
|
+
```tsx
|
|
187
|
+
<Asset.Frame shape="circle" size="s" background="primary">
|
|
188
|
+
<Asset.Text>NH</Asset.Text>
|
|
189
|
+
</Asset.Frame>
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
**모션.** 없음. onClick 을 받지 않는 표시용 틀이다. 누를 수 있게 하려면 쓰는 쪽이 버튼으로 감싸고 그 버튼이 press 를 받는다.
|
|
193
|
+
|
|
194
|
+
### Asset.Frame props
|
|
195
|
+
|
|
196
|
+
| prop | 타입 | 필수 | 기본값 |
|
|
197
|
+
| --- | --- | --- | --- |
|
|
198
|
+
| `accessory` | `ReactNode` | | |
|
|
199
|
+
| `overlap` | `boolean` | | |
|
|
200
|
+
| `background` | `'neutral' \| 'primary' \| 'none'` | | `'none'` |
|
|
201
|
+
| `accessoryPosition` | `'top-left' \| 'top-right' \| 'bottom-left' \| 'bottom-right'` | | `'bottom-right'` |
|
|
202
|
+
| `shape` | `'square' \| 'circle' \| 'squircle' \| 'card'` | | `'square'` |
|
|
203
|
+
| `size` | `'xs' \| 's' \| 'm' \| 'l' \| 'xl'` | | `'m'` |
|
|
204
|
+
|
|
205
|
+
이 밖에 React·HTML 기본 속성 266개를 받는다.
|
|
206
|
+
|
|
207
|
+
### Asset.Icon props
|
|
208
|
+
|
|
209
|
+
| prop | 타입 | 필수 | 기본값 |
|
|
210
|
+
| --- | --- | --- | --- |
|
|
211
|
+
| `label` | `string` | | |
|
|
212
|
+
| `name` | `'circle' \| 'link' \| 'image' \| 'x' \| 'warning' \| 'copy' \| 'house' \| 'megaphone-simple' \| 'chats-circle' \| 'user-circle' \| 'bell' \| 'caret-left' \| 'magnifying-glass' \| 'dots-three' \| 'gear-six' \| 'chat-circle' \| 'paper-plane-tilt' \| 'plus' \| 'camera' \| 'video-camera' \| 'play' \| 'upload-simple' \| 'calendar-blank' \| 'clock' \| 'map-pin' \| 'truck' \| 'ticket' \| 'qr-code' \| 'sparkle' \| 'gift' \| 'wallet' \| 'bank' \| 'credit-card' \| 'check-circle' \| 'check' \| 'info' \| 'question' \| 'lock' \| 'pencil-simple' \| 'trash' \| 'share-network' \| 'eye' \| 'sliders-horizontal' \| 'heart' \| 'star' \| 'globe' \| 'sign-out' \| 'caret-right' \| 'arrow-right' \| 'instagram-logo' \| 'tiktok-logo' \| 'youtube-logo'` | 예 | |
|
|
213
|
+
| `weight` | `'fill' \| 'regular'` | | |
|
|
214
|
+
|
|
215
|
+
이 밖에 React·HTML 기본 속성 474개를 받는다.
|
|
216
|
+
|
|
217
|
+
### Asset.Image props
|
|
218
|
+
|
|
219
|
+
| prop | 타입 | 필수 | 기본값 |
|
|
220
|
+
| --- | --- | --- | --- |
|
|
221
|
+
| `alt` | `string` | 예 | |
|
|
222
|
+
| `fit` | `'contain' \| 'cover'` | | `'cover'` |
|
|
223
|
+
|
|
224
|
+
이 밖에 React·HTML 기본 속성 277개를 받는다.
|
|
225
|
+
|
|
226
|
+
### Asset.Text props
|
|
227
|
+
|
|
228
|
+
| prop | 타입 | 필수 | 기본값 |
|
|
229
|
+
| --- | --- | --- | --- |
|
|
230
|
+
| `children` | `string` | 예 | |
|
|
231
|
+
| `className` | `string` | | |
|
|
232
|
+
| `style` | `CSSProperties` | | |
|
|
233
|
+
|
|
234
|
+
이 밖에 React·HTML 기본 속성 2개를 받는다.
|
|
112
235
|
|
|
113
236
|
## Avatar
|
|
114
237
|
|
|
@@ -131,12 +254,12 @@ import { Avatar } from '@nurihaus/web-design-system'; // 루트. 첫
|
|
|
131
254
|
|
|
132
255
|
| prop | 타입 | 필수 | 기본값 |
|
|
133
256
|
| --- | --- | --- | --- |
|
|
134
|
-
| `size` | `'s' \| 'm' \| 'l' \| 'xl'` | 예 | `'m'` |
|
|
135
257
|
| `badgeOption` | `ReactNode` | | |
|
|
136
|
-
| `src` | `string` | | |
|
|
137
|
-
| `alt` | `string` | | |
|
|
138
|
-
| `className` | `string` | | |
|
|
139
258
|
| `style` | `CSSProperties` | | |
|
|
259
|
+
| `className` | `string` | | |
|
|
260
|
+
| `size` | `'s' \| 'm' \| 'l' \| 'xl'` | 예 | `'m'` |
|
|
261
|
+
| `alt` | `string` | | |
|
|
262
|
+
| `src` | `string` | | |
|
|
140
263
|
|
|
141
264
|
이 밖에 React·HTML 기본 속성 2개를 받는다.
|
|
142
265
|
|
|
@@ -147,45 +270,61 @@ import { CTAButton } from '@nurihaus/web-design-system/cta-button'; // 이 컴
|
|
|
147
270
|
import { CTAButton } from '@nurihaus/web-design-system'; // 루트. 첫 로드 JS 가 커진다
|
|
148
271
|
```
|
|
149
272
|
|
|
150
|
-
**언제 쓴다.** 저장, 확인, 다음 단계처럼 사용자가 실행하는 동작 버튼에 쓴다. `variant
|
|
273
|
+
**언제 쓴다.** 저장, 확인, 다음 단계처럼 사용자가 실행하는 동작 버튼에 쓴다. 색은 `color`, 세기는 `variant` 두 축으로 고른다. 기본은 `color="primary" variant="fill"` 이다. Google·Apple·Facebook 로그인 버튼은 `color="neutral" variant="outline"`(흰 바탕·회색 선·검정 글자, 공급자 가이드)에 공급자 로고를 `leftIcon`으로 준다. `callout`을 주면 버튼 오른쪽 위 모서리에 말풍선(Callout)을 끼운다(예: "최근 사용") — 버튼 글자는 움직이지 않고 자리는 DS 가 잡는다. 말풍선 글자도 버튼 안이라 버튼의 접근 가능한 이름에 이어진다(스크린 리더도 "최근 사용"을 듣는다). 다른 화면으로 옮겨 가는 버튼은 `asChild` 를 주고 링크 요소(`<a>`·라우터 Link) 하나를 children 으로 준다 — 그 링크가 버튼 모양이 되고 글자·아이콘은 링크 안에 들어간다. 링크에는 `loading` 을 쓰지 않는다.
|
|
274
|
+
|
|
275
|
+
- `color`: `primary`(보라) · `neutral`(회색·검정) · `danger`(빨강). 역할 이름이고 토큰 이름이 아니다. 조합 밖의 색은 `className` 으로 덮는다(선택자는 `.cta-button.color-primary.variant-fill` 보다 구체적이어야 한다).
|
|
276
|
+
- `variant`: `fill`(채움) · `weak`(연한 바탕) · `outline`(흰 바탕·선) · `ghost`(바탕 없음). 호버 색도 조합마다 토큰이 정하고, `disabled` 는 조합과 상관없이 회색 바탕·흰 글자다.
|
|
277
|
+
- 옛 `variant` 일곱은 다음 메이저까지만 받고 개발 빌드에서 한 번 경고한다. `primary` → 기본값, `secondary` → `weak`, `ghost` → `outline`, `neutral` → `color="primary" variant="ghost"`, `confirm` → `color="danger"`, `outlined` → `color="danger" variant="outline"`, `social` → `color="neutral" variant="outline"`.
|
|
278
|
+
- `ghost` 는 옛 값(선 버튼)과 이름이 겹친다. `color` 없이 쓴 `variant="ghost"` 는 옛 뜻(`primary · outline`)이다. 바탕 없는 버튼은 `color` 를 같이 적는다.
|
|
279
|
+
- `loading`: 글자는 자리를 지킨 채 가려지고 점 세 개(LoadingDots)가 글자색으로 가운데에 뜬다. 버튼 너비가 변하지 않는다. `aria-busy="true"` 가 붙고 클릭은 무시된다(`onClick`·`track` 로그·폼 제출 모두 일어나지 않는다). 말풍선(`callout`)은 그동안 숨는다.
|
|
280
|
+
- `pressEffect`: 누르는 동안 살짝 작아지고 어두워진다. 기본 `true`, `false` 면 끈다. `loading` 중에는 꺼진다.
|
|
281
|
+
- `appear`: `{ animation: 'fade' | 'scale' | 'slide', delay?: ms }`. 처음 그릴 때 한 번 나타난다. `delay` 동안은 자리를 지킨 채 보이지 않는다. 눈에 띄어야 하는 다음 행동 버튼에만 준다.
|
|
282
|
+
- `disabled` 버튼을 누르면 옆으로 짧게 흔들린다(따로 켜지 않는다). 흔들림은 disabled 버튼에 오는 pointerdown 으로 건다. Chromium 은 보내지만 Firefox 는 보내지 않을 수 있어 그때는 흔들리지 않는다.
|
|
151
283
|
|
|
152
284
|
**쓰지 않는다.** 확인과 취소 두 버튼을 가진 대화상자는 버튼을 직접 배치하지 말고 ModalWithDoubleButton을 쓴다. 화면 안의 패널 전환은 Tabs, 사이드 메뉴 항목은 CollapsibleMenu를 쓴다.
|
|
153
285
|
|
|
154
286
|
```tsx
|
|
155
287
|
<>
|
|
156
|
-
<CTAButton
|
|
288
|
+
<CTAButton size="m" text="저장" onClick={() => {}} />
|
|
289
|
+
<CTAButton color="danger" variant="weak" text="삭제" />
|
|
290
|
+
<CTAButton color="primary" variant="ghost" size="s" text="더 보기" />
|
|
291
|
+
<CTAButton text="참여하기" appear={{ animation: 'slide', delay: 600 }} />
|
|
157
292
|
<CTAButton
|
|
158
|
-
|
|
293
|
+
color="neutral"
|
|
294
|
+
variant="outline"
|
|
159
295
|
size="l"
|
|
160
296
|
text="Google로 계속하기"
|
|
161
297
|
leftIcon={<img src="/icons/google.svg" alt="" />}
|
|
162
298
|
callout="최근 사용"
|
|
163
299
|
/>
|
|
164
|
-
<CTAButton asChild
|
|
300
|
+
<CTAButton asChild size="l" text="홈으로">
|
|
165
301
|
<a href="/" />
|
|
166
302
|
</CTAButton>
|
|
167
303
|
</>
|
|
168
304
|
```
|
|
169
305
|
|
|
170
|
-
**모션.** press · reject · appear(opt) · busy(`loading`). 토큰 값과 규칙은 `motion.md`.
|
|
306
|
+
**모션.** press(`pressEffect`) · reject · appear(opt, `appear`) · busy(`loading`). 토큰 값과 규칙은 `motion.md`.
|
|
171
307
|
|
|
172
308
|
### props
|
|
173
309
|
|
|
174
310
|
| prop | 타입 | 필수 | 기본값 |
|
|
175
311
|
| --- | --- | --- | --- |
|
|
176
|
-
| `asChild` | `boolean` | | |
|
|
177
|
-
| `size` | `'xs' \| 's' \| 'm' \| 'l' \| 'xl'` | | `'m'` |
|
|
178
312
|
| `track` | `string` | | |
|
|
179
313
|
| `text` | `ReactNode` | 예 | |
|
|
314
|
+
| `color` | `'neutral' \| 'primary' \| 'danger'` | | `'primary'` |
|
|
180
315
|
| `children` | `ReactNode` | | |
|
|
181
|
-
| `
|
|
316
|
+
| `size` | `'xs' \| 's' \| 'm' \| 'l' \| 'xl'` | | `'m'` |
|
|
317
|
+
| `loading` | `boolean` | | |
|
|
318
|
+
| `variant` | `'fill' \| 'neutral' \| 'primary' \| 'outlined' \| 'outline' \| 'weak' \| 'ghost' \| 'secondary' \| 'confirm' \| 'social'` | | `'fill'` |
|
|
182
319
|
| `leftIcon` | `ReactNode` | | |
|
|
183
320
|
| `rightIcon` | `ReactNode` | | |
|
|
184
321
|
| `callout` | `ReactNode` | | |
|
|
185
|
-
| `
|
|
322
|
+
| `asChild` | `boolean` | | |
|
|
186
323
|
| `trackProps` | `Record<string, string \| number \| boolean>` | | |
|
|
324
|
+
| `pressEffect` | `boolean` | | `true` |
|
|
325
|
+
| `appear` | `{ animation: AppearAnimation; delay?: number \| undefined; }` | | |
|
|
187
326
|
|
|
188
|
-
이 밖에 React·HTML 기본 속성
|
|
327
|
+
이 밖에 React·HTML 기본 속성 274개를 받는다.
|
|
189
328
|
|
|
190
329
|
## IconButton
|
|
191
330
|
|
|
@@ -196,6 +335,8 @@ import { IconButton } from '@nurihaus/web-design-system'; // 루트.
|
|
|
196
335
|
|
|
197
336
|
**언제 쓴다.** 글자 없이 아이콘 하나로 뜻이 통하는 버튼에 쓴다(뒤로, 알림, 첨부, 떠 있는 추가 버튼). `icon` 은 Icon 이름, `label` 은 버튼의 이름(aria-label)이라 꼭 준다. `variant` 는 `ghost`(기본, 바탕 없이 회색 아이콘, 누르는 동안 회색 원)·`secondary`(연보라)·`primary`(진보라). `size` 는 `s`(36)·`m`(44, 기본)·`l`(56)이고 보이는 크기가 작아도 누르는 자리는 44 이상이다. 다른 화면으로 옮겨 가는 버튼은 `asChild` 를 주고 링크 요소 하나를 children 으로 준다 — 그 링크가 버튼 모양이 되고 아이콘은 링크 안에 들어간다. 떠 있는 버튼은 감싸는 요소에 자리(`position: fixed` 등)·모양(`border-radius`)·그림자(`--shadow-floating`)를 준다 — 버튼 자체의 `className` 으로 `position` 을 덮으면 CSS 가 실리는 순서에 따라 DS 의 `position: relative`(터치 영역 기준)가 이긴다. `className`·`style` 은 버튼(또는 링크)에 붙는다.
|
|
198
337
|
|
|
338
|
+
- `pressEffect`(기본 `true`): 누르는 동안 살짝 줄어든다. `false`면 끈다. ghost 의 회색 원은 그대로 보인다.
|
|
339
|
+
|
|
199
340
|
**쓰지 않는다.** 글자가 있는 버튼은 CTAButton 을 쓴다. 칩의 지우기는 Tag 의 `onRemove`, 대화 보내기는 MessageComposer 를 쓴다.
|
|
200
341
|
|
|
201
342
|
```tsx
|
|
@@ -207,20 +348,21 @@ import { IconButton } from '@nurihaus/web-design-system'; // 루트.
|
|
|
207
348
|
</>
|
|
208
349
|
```
|
|
209
350
|
|
|
210
|
-
**모션.** press. 토큰 값과 규칙은 `motion.md`.
|
|
351
|
+
**모션.** press(`pressEffect`). 토큰 값과 규칙은 `motion.md`.
|
|
211
352
|
|
|
212
353
|
### props
|
|
213
354
|
|
|
214
355
|
| prop | 타입 | 필수 | 기본값 |
|
|
215
356
|
| --- | --- | --- | --- |
|
|
216
|
-
| `asChild` | `boolean` | | |
|
|
217
|
-
| `size` | `'s' \| 'm' \| 'l'` | | `defaultSize` |
|
|
218
357
|
| `label` | `string` | 예 | |
|
|
219
358
|
| `track` | `string` | | |
|
|
220
359
|
| `children` | `ReactNode` | | |
|
|
221
|
-
| `
|
|
360
|
+
| `size` | `'s' \| 'm' \| 'l'` | | `defaultSize` |
|
|
361
|
+
| `variant` | `'primary' \| 'ghost' \| 'secondary'` | | `'ghost'` |
|
|
362
|
+
| `asChild` | `boolean` | | |
|
|
222
363
|
| `trackProps` | `Record<string, string \| number \| boolean>` | | |
|
|
223
|
-
| `
|
|
364
|
+
| `pressEffect` | `boolean` | | `true` |
|
|
365
|
+
| `icon` | `'circle' \| 'link' \| 'image' \| 'x' \| 'warning' \| 'copy' \| 'house' \| 'megaphone-simple' \| 'chats-circle' \| 'user-circle' \| 'bell' \| 'caret-left' \| 'magnifying-glass' \| 'dots-three' \| 'gear-six' \| 'chat-circle' \| 'paper-plane-tilt' \| 'plus' \| 'camera' \| 'video-camera' \| 'play' \| 'upload-simple' \| 'calendar-blank' \| 'clock' \| 'map-pin' \| 'truck' \| 'ticket' \| 'qr-code' \| 'sparkle' \| 'gift' \| 'wallet' \| 'bank' \| 'credit-card' \| 'check-circle' \| 'check' \| 'info' \| 'question' \| 'lock' \| 'pencil-simple' \| 'trash' \| 'share-network' \| 'eye' \| 'sliders-horizontal' \| 'heart' \| 'star' \| 'globe' \| 'sign-out' \| 'caret-right' \| 'arrow-right' \| 'instagram-logo' \| 'tiktok-logo' \| 'youtube-logo'` | 예 | |
|
|
224
366
|
|
|
225
367
|
이 밖에 React·HTML 기본 속성 275개를 받는다.
|
|
226
368
|
|
|
@@ -239,7 +381,7 @@ import { Callout } from '@nurihaus/web-design-system'; // 루트.
|
|
|
239
381
|
<>
|
|
240
382
|
<Callout text="최근 사용" />
|
|
241
383
|
<Callout text="새 기능" tail="top-end" />
|
|
242
|
-
<CTAButton variant="
|
|
384
|
+
<CTAButton color="neutral" variant="outline" size="l" text="Google로 계속하기" callout="최근 사용" />
|
|
243
385
|
</>
|
|
244
386
|
```
|
|
245
387
|
|
|
@@ -265,6 +407,17 @@ import { OptionBadge } from '@nurihaus/web-design-system'; // 루트
|
|
|
265
407
|
|
|
266
408
|
**쓰지 않는다.** 아이콘이 함께 필요하면 IconTextBadge를, 아이콘과 텍스트 오른쪽에 수치 같은 부가 값까지 붙여야 하면 IconTextOptionBadge를 쓴다. 클릭 동작이 필요한 요소에는 CTAButton을 쓴다.
|
|
267
409
|
|
|
410
|
+
`effectRef` 에 ref 를 넘기면 `shine(times?)`·`blink(times?)` 로 배지를 반짝이게 할 수 있다. 값이 새로 생긴 순간처럼 눈길을 끌어야 할 때 쓰는 쪽이 부른다. 마운트할 때 저절로 부르거나 계속 반복하지 않는다. `times` 는 반복 횟수(기본 1)이고, 재생 중에 다시 부르면 처음부터 다시 센다. 동작 줄이기 설정이면 보이지 않는다. 타입 `AttentionHandle` 은 패키지 루트에서 가져온다. `ref` 는 그대로 배지 루트 요소다.
|
|
411
|
+
|
|
412
|
+
```ts
|
|
413
|
+
import { useRef } from 'react';
|
|
414
|
+
import { OptionBadge, type AttentionHandle } from '@nurihaus/web-design-system';
|
|
415
|
+
|
|
416
|
+
const fx = useRef<AttentionHandle>(null);
|
|
417
|
+
// <OptionBadge effectRef={fx} option="새 메시지" variant="primary" />
|
|
418
|
+
fx.current?.shine();
|
|
419
|
+
```
|
|
420
|
+
|
|
268
421
|
```tsx
|
|
269
422
|
<OptionBadge option="진행 중" variant="primary" size="s" width="fit-content" />
|
|
270
423
|
```
|
|
@@ -281,8 +434,9 @@ import { OptionBadge } from '@nurihaus/web-design-system'; // 루트
|
|
|
281
434
|
| `option` | `ReactNode` | 예 | |
|
|
282
435
|
| `style` | `CSSProperties` | | |
|
|
283
436
|
| `tooltip` | `{ content: ReactNode; position?: 'bottom' \| 'left' \| 'right' \| 'top' \| undefined; delayDuration?: number \| undefined; }` | | |
|
|
284
|
-
| `asChild` | `boolean` | | |
|
|
285
437
|
| `className` | `string` | | |
|
|
438
|
+
| `asChild` | `boolean` | | |
|
|
439
|
+
| `effectRef` | `Ref<AttentionHandle>` | | |
|
|
286
440
|
|
|
287
441
|
이 밖에 React·HTML 기본 속성 2개를 받는다.
|
|
288
442
|
|
|
@@ -297,6 +451,17 @@ import { IconTextBadge } from '@nurihaus/web-design-system'; // 루
|
|
|
297
451
|
|
|
298
452
|
**쓰지 않는다.** 아이콘 없이 텍스트만 있으면 OptionBadge를 쓴다. 오른쪽에 부가 값을 붙여야 하면 IconTextOptionBadge를 쓴다.
|
|
299
453
|
|
|
454
|
+
`effectRef` 는 OptionBadge 와 같다. `shine(times?)`·`blink(times?)` 를 쓰는 쪽이 필요한 순간에 부른다. `AttentionHandle` 은 패키지 루트에서 가져온다.
|
|
455
|
+
|
|
456
|
+
```ts
|
|
457
|
+
import { useRef } from 'react';
|
|
458
|
+
import { IconTextBadge, type AttentionHandle } from '@nurihaus/web-design-system';
|
|
459
|
+
|
|
460
|
+
const fx = useRef<AttentionHandle>(null);
|
|
461
|
+
// <IconTextBadge effectRef={fx} icon={…} text="Instagram" />
|
|
462
|
+
fx.current?.blink(3);
|
|
463
|
+
```
|
|
464
|
+
|
|
300
465
|
```tsx
|
|
301
466
|
<IconTextBadge
|
|
302
467
|
icon={<img src="https://placehold.co/18x18" alt="" />}
|
|
@@ -320,8 +485,9 @@ import { IconTextBadge } from '@nurihaus/web-design-system'; // 루
|
|
|
320
485
|
| `text` | `ReactNode` | 예 | |
|
|
321
486
|
| `style` | `CSSProperties` | | |
|
|
322
487
|
| `tooltip` | `{ content: ReactNode; position?: 'bottom' \| 'left' \| 'right' \| 'top' \| undefined; delayDuration?: number \| undefined; }` | | |
|
|
323
|
-
| `asChild` | `boolean` | | |
|
|
324
488
|
| `className` | `string` | | |
|
|
489
|
+
| `asChild` | `boolean` | | |
|
|
490
|
+
| `effectRef` | `Ref<AttentionHandle>` | | |
|
|
325
491
|
|
|
326
492
|
이 밖에 React·HTML 기본 속성 2개를 받는다.
|
|
327
493
|
|
|
@@ -336,6 +502,17 @@ import { IconTextOptionBadge } from '@nurihaus/web-design-system'; /
|
|
|
336
502
|
|
|
337
503
|
**쓰지 않는다.** 이 배지는 `tooltip`을 받지 않으므로 툴팁이 필요하면 IconTextBadge를 쓴다. 부가 값이 없으면 IconTextBadge나 OptionBadge를 쓴다.
|
|
338
504
|
|
|
505
|
+
`effectRef` 는 OptionBadge 와 같다. 부가 값이 바뀐 순간 `shine(times?)`·`blink(times?)` 를 부른다. `AttentionHandle` 은 패키지 루트에서 가져온다.
|
|
506
|
+
|
|
507
|
+
```ts
|
|
508
|
+
import { useRef } from 'react';
|
|
509
|
+
import { IconTextOptionBadge, type AttentionHandle } from '@nurihaus/web-design-system';
|
|
510
|
+
|
|
511
|
+
const fx = useRef<AttentionHandle>(null);
|
|
512
|
+
// <IconTextOptionBadge effectRef={fx} icon={…} text="Instagram" option="2.5K" />
|
|
513
|
+
fx.current?.shine();
|
|
514
|
+
```
|
|
515
|
+
|
|
339
516
|
```tsx
|
|
340
517
|
<IconTextOptionBadge
|
|
341
518
|
icon={<img src="https://placehold.co/18x18" alt="" />}
|
|
@@ -360,6 +537,7 @@ import { IconTextOptionBadge } from '@nurihaus/web-design-system'; /
|
|
|
360
537
|
| `option` | `ReactNode` | 예 | |
|
|
361
538
|
| `style` | `CSSProperties` | | |
|
|
362
539
|
| `className` | `string` | | |
|
|
540
|
+
| `effectRef` | `Ref<AttentionHandle>` | | |
|
|
363
541
|
|
|
364
542
|
이 밖에 React·HTML 기본 속성 2개를 받는다.
|
|
365
543
|
|
|
@@ -376,6 +554,8 @@ import { DataTable } from '@nurihaus/web-design-system'; // 루트.
|
|
|
376
554
|
|
|
377
555
|
`track`을 주면 `onClickRow`가 있는 `rows` 항목(헤더 칸)을 누를 때 `click`과 그 `id`를 `value`에 담아 사용 로그로 보낸다. `onClickRow`가 없는 칸과 본문 셀은 보내지 않는다.
|
|
378
556
|
|
|
557
|
+
- `pressEffect`(기본 `true`): `onClickRow`가 있는 헤더 칸과 `onClickCell`이 있는 본문 셀을 누르는 동안 어두워진다. 핸들러가 없는 칸에는 붙지 않는다. `false`면 끈다.
|
|
558
|
+
|
|
379
559
|
**쓰지 않는다.** 정렬, 페이지네이션, 행 선택, 빈 상태 표시는 내장되어 있지 않으므로 데이터를 바깥에서 가공해 넘기고 빈 목록은 따로 그린다. 헤더는 위에 고정되고 `fixedRowsIndex`로 왼쪽 열을 고정할 수 있지만, 그 외의 표 동작이 필요하면 직접 만든다.
|
|
380
560
|
|
|
381
561
|
```tsx
|
|
@@ -395,7 +575,7 @@ import { DataTable } from '@nurihaus/web-design-system'; // 루트.
|
|
|
395
575
|
/>
|
|
396
576
|
```
|
|
397
577
|
|
|
398
|
-
**모션.** press · attention(opt). 토큰 값과 규칙은 `motion.md`.
|
|
578
|
+
**모션.** press(`pressEffect`) · attention(opt). 토큰 값과 규칙은 `motion.md`.
|
|
399
579
|
|
|
400
580
|
### props
|
|
401
581
|
|
|
@@ -411,6 +591,7 @@ import { DataTable } from '@nurihaus/web-design-system'; // 루트.
|
|
|
411
591
|
| `className` | `string` | | |
|
|
412
592
|
| `track` | `string` | | |
|
|
413
593
|
| `trackProps` | `Record<string, string \| number \| boolean>` | | |
|
|
594
|
+
| `pressEffect` | `boolean` | | `true` |
|
|
414
595
|
|
|
415
596
|
이 밖에 React·HTML 기본 속성 2개를 받는다.
|
|
416
597
|
|
|
@@ -421,9 +602,16 @@ import { TextField } from '@nurihaus/web-design-system/text-field'; // 이 컴
|
|
|
421
602
|
import { TextField } from '@nurihaus/web-design-system'; // 루트. 첫 로드 JS 가 커진다
|
|
422
603
|
```
|
|
423
604
|
|
|
424
|
-
**언제 쓴다.** 한 줄 텍스트를 입력받을 때 쓴다. 위 라벨(`title`), 아래 안내 문구(`helperText`), 좌우 아이콘을 함께 붙일 수 있고, `isError`가 true면 `helperText`가
|
|
605
|
+
**언제 쓴다.** 한 줄 텍스트를 입력받을 때 쓴다. 위 라벨(`title`), 아래 안내 문구(`helperText`), 좌우 아이콘을 함께 붙일 수 있고, `isError`가 true면 입력 상자 테두리와 `helperText`가 빨개지고 input 에 `aria-invalid`가 붙는다. 포커스하면 보라 테두리에 연보라 후광이 생긴다(오류면 연빨강). `readOnly`는 옅은 회색 바탕, `disabled`는 회색 바탕이다.
|
|
425
606
|
|
|
426
|
-
`track`을 주면 포커스가 빠질 때 값이 포커스를 받을 때와 다르면 `change`를 한 번 사용 로그로 보낸다. 값은 싣지 않는다. 사용자가 입력한 글자는 로그에 들어가지 않는다.
|
|
607
|
+
`track`을 주면 포커스가 빠질 때 값이 포커스를 받을 때와 다르면 `change`를 한 번 사용 로그로 보낸다. 값은 싣지 않는다. 사용자가 입력한 글자는 로그에 들어가지 않는다. `format`을 쓰면 raw 값끼리 비교한다.
|
|
608
|
+
|
|
609
|
+
입력 상자 안쪽 칸은 `leftIcon` → `prefix` → input → `suffix` → 버튼(지우기, 비밀번호 보기) → `rightIcon` 순서로 놓인다.
|
|
610
|
+
|
|
611
|
+
- `prefix`·`suffix`는 input 앞뒤에 붙는 고정 글(`₩`, `원`, `@`, `.com`)이다. 입력값에는 들어가지 않는다.
|
|
612
|
+
- `format={{ transform, reset }}`을 주면 `value`·`defaultValue`·`onChange`는 raw 값을 주고받고 input에는 `transform(raw)`가 보인다. `onChange`의 `event.target.value`는 이미 `reset`으로 되돌린 raw 값이다. `reset`이 없으면 화면 글을 그대로 raw로 쓴다. `transform`이 글자를 끼워 넣으면(하이픈 등) 입력 중 커서가 끝으로 옮겨갈 수 있다. `maxLength`는 화면 글 길이에 걸리므로 raw 길이 제한은 `reset`에서 자른다.
|
|
613
|
+
- `clearable`이면 값이 있고 포커스가 입력 상자 안에 있을 때 지우기 버튼(X, `aria-label` '입력 지우기')이 뜬다. 누르면 포커스는 input에 남고 `onChange`가 `''`로 불린 뒤 `onClear`가 불린다. `disabled`·`readOnly`면 뜨지 않는다.
|
|
614
|
+
- `passwordToggle`은 `type='password'`일 때만 보기·숨기기 버튼을 붙인다. 누르면 input `type`이 `text`·`password`로 바뀌고 `aria-pressed`와 `aria-label`('비밀번호 보기'·'비밀번호 숨기기')이 따라 바뀌며 `onVisibilityChange(visible)`가 불린다.
|
|
427
615
|
|
|
428
616
|
**쓰지 않는다.** 여러 줄 입력은 지원하지 않는다(`<input>`만 렌더한다). 정해진 값 중에서 고르는 입력은 DropDown이나 Radio를 쓴다.
|
|
429
617
|
|
|
@@ -439,27 +627,34 @@ import { TextField } from '@nurihaus/web-design-system'; // 루트.
|
|
|
439
627
|
/>
|
|
440
628
|
```
|
|
441
629
|
|
|
442
|
-
**모션.**
|
|
630
|
+
**모션.** press(opt). 토큰 값과 규칙은 `motion.md`.
|
|
443
631
|
|
|
444
632
|
### props
|
|
445
633
|
|
|
446
634
|
| prop | 타입 | 필수 | 기본값 |
|
|
447
635
|
| --- | --- | --- | --- |
|
|
448
|
-
| `className` | `string` | | |
|
|
449
|
-
| `size` | `'xs' \| 's' \| 'm' \| 'l' \| 'xl'` | 예 | `'s'` |
|
|
450
636
|
| `title` | `ReactNode` | | |
|
|
451
637
|
| `track` | `string` | | |
|
|
638
|
+
| `defaultValue` | `string` | | |
|
|
639
|
+
| `className` | `string` | | |
|
|
640
|
+
| `prefix` | `ReactNode` | | |
|
|
641
|
+
| `size` | `'xs' \| 's' \| 'm' \| 'l' \| 'xl'` | 예 | `'s'` |
|
|
452
642
|
| `name` | `string` | 예 | |
|
|
643
|
+
| `width` | `string \| number` | 예 | `'100%'` |
|
|
644
|
+
| `format` | `TextFieldFormat` | | |
|
|
453
645
|
| `value` | `string` | | |
|
|
454
|
-
| `defaultValue` | `string` | | |
|
|
455
646
|
| `leftIcon` | `ReactNode` | | |
|
|
456
647
|
| `rightIcon` | `ReactNode` | | |
|
|
457
648
|
| `trackProps` | `Record<string, string \| number \| boolean>` | | |
|
|
458
|
-
| `
|
|
649
|
+
| `suffix` | `ReactNode` | | |
|
|
650
|
+
| `clearable` | `boolean` | | |
|
|
651
|
+
| `onClear` | `(() => void)` | | |
|
|
652
|
+
| `passwordToggle` | `boolean` | | |
|
|
653
|
+
| `onVisibilityChange` | `((visible: boolean) => void)` | | |
|
|
459
654
|
| `helperText` | `ReactNode` | | |
|
|
460
655
|
| `isError` | `boolean` | | |
|
|
461
656
|
|
|
462
|
-
이 밖에 React·HTML 기본 속성
|
|
657
|
+
이 밖에 React·HTML 기본 속성 288개를 받는다.
|
|
463
658
|
|
|
464
659
|
## Radio
|
|
465
660
|
|
|
@@ -474,6 +669,11 @@ import { Radio } from '@nurihaus/web-design-system'; // 루트. 첫
|
|
|
474
669
|
|
|
475
670
|
`track`을 주면 선택지를 누를 때 `change`와 그 선택지 `id`를 `value`에 담아 사용 로그로 보낸다.
|
|
476
671
|
|
|
672
|
+
- `pressEffect`(기본 `true`): 동그란 버튼(칩이면 칩)을 누르는 동안 살짝 줄어든다. `false`면 끈다.
|
|
673
|
+
- `motion`(`'weak'` 기본 · `'strong'`): 고른 점이 커지고 옛 점이 작아지는 스프링의 세기다. `'strong'`은 한 번 튀어 오른다. 앱 루트의 `MotionProvider` 아래에서만 움직이고, 없으면 움직임 없이 고름만 바뀐다.
|
|
674
|
+
- `delay`(ms, 기본 `0`): 고름이 바뀐 뒤 스프링이 출발하기까지 기다리는 시간이다.
|
|
675
|
+
- `disabled` 선택지(버튼이나 라벨)를 누르면 그 줄이 좌우로 흔들린다. 꺼진 버튼에도 오는 `pointerdown`으로 알아채므로 Chromium 에서 동작하고 Firefox 는 보내지 않을 수 있다.
|
|
676
|
+
|
|
477
677
|
**쓰지 않는다.** 여러 개를 동시에 고르면 Checkbox를 쓴다. 선택지가 많아 모두 펼치기 어려우면 DropDown을 쓴다. 목록을 거르는 필터 칩은 ChipGroup을 쓴다(늘 하나가 골라져 있다).
|
|
478
678
|
|
|
479
679
|
```tsx
|
|
@@ -488,7 +688,7 @@ import { Radio } from '@nurihaus/web-design-system'; // 루트. 첫
|
|
|
488
688
|
/>
|
|
489
689
|
```
|
|
490
690
|
|
|
491
|
-
**모션.** press · confirm. 토큰 값과 규칙은 `motion.md`.
|
|
691
|
+
**모션.** press(`pressEffect`) · confirm(`motion`, `delay`). 토큰 값과 규칙은 `motion.md`.
|
|
492
692
|
|
|
493
693
|
### props
|
|
494
694
|
|
|
@@ -501,6 +701,9 @@ import { Radio } from '@nurihaus/web-design-system'; // 루트. 첫
|
|
|
501
701
|
| `onChange` | `((id: string \| null) => void)` | | |
|
|
502
702
|
| `track` | `string` | | |
|
|
503
703
|
| `trackProps` | `Record<string, string \| number \| boolean>` | | |
|
|
704
|
+
| `pressEffect` | `boolean` | | `true` |
|
|
705
|
+
| `motion` | `MotionStrength` | | |
|
|
706
|
+
| `delay` | `number` | | |
|
|
504
707
|
|
|
505
708
|
이 밖에 React·HTML 기본 속성 2개를 받는다.
|
|
506
709
|
|
|
@@ -515,13 +718,19 @@ import { Checkbox } from '@nurihaus/web-design-system'; // 루트.
|
|
|
515
718
|
|
|
516
719
|
`track`을 주면 체크 상태가 바뀔 때마다 `change`와 `'on'`·`'off'`를 `value`에 담아 사용 로그로 보낸다. 이벤트의 `component`는 displayName 인 `'CheckBox'`다.
|
|
517
720
|
|
|
721
|
+
- `variant`(`'filled'` 기본 · `'outlined'`): filled 는 체크하면 칸이 보라색으로 차고 흰 체크가 보인다. outlined 는 네모 없이 체크만 있다. 꺼지면 회색 체크, 켜지면 보라 체크로 바뀐다.
|
|
722
|
+
- `pressEffect`(기본 `true`): 체크 칸을 누르는 동안 살짝 줄어든다. `false`면 끈다.
|
|
723
|
+
- 체크하면 보라 채움과 흰 체크가 짧게 떠오르고, 해제하면 사라진다(CSS 전환이라 `MotionProvider` 가 없어도 움직인다). 세기 prop 은 없다.
|
|
724
|
+
- `delay`(ms, 기본 `0`): 체크가 바뀐 뒤 색이 바뀌기까지 기다리는 시간이다. 전체 동의 뒤 항목이 차례로 켜지는 연출에 쓴다.
|
|
725
|
+
- `disabled`인 체크박스를 누르면 좌우로 흔들린다. 꺼진 버튼에도 오는 `pointerdown`으로 알아채므로 Chromium 에서 동작하고 Firefox 는 보내지 않을 수 있다.
|
|
726
|
+
|
|
518
727
|
**쓰지 않는다.** 여러 선택지 중 하나만 골라야 하면 Radio를, 목록에서 값 하나를 고르면 DropDown을 쓴다.
|
|
519
728
|
|
|
520
729
|
```tsx
|
|
521
730
|
<Checkbox id="agree-terms" label="약관에 동의합니다" checked={false} onChange={() => {}} />
|
|
522
731
|
```
|
|
523
732
|
|
|
524
|
-
**모션.** press · confirm. 토큰 값과 규칙은 `motion.md`.
|
|
733
|
+
**모션.** press(`pressEffect`) · confirm(`delay`). 토큰 값과 규칙은 `motion.md`.
|
|
525
734
|
|
|
526
735
|
### props
|
|
527
736
|
|
|
@@ -529,6 +738,7 @@ import { Checkbox } from '@nurihaus/web-design-system'; // 루트.
|
|
|
529
738
|
| --- | --- | --- | --- |
|
|
530
739
|
| `label` | `ReactNode` | 예 | |
|
|
531
740
|
| `size` | `'s' \| 'm' \| 'l'` | | `'m'` |
|
|
741
|
+
| `variant` | `'outlined' \| 'filled'` | | `'filled'` |
|
|
532
742
|
| `className` | `string` | | |
|
|
533
743
|
| `onClick` | `((checked: boolean) => void)` | | |
|
|
534
744
|
| `checked` | `boolean` | | |
|
|
@@ -537,6 +747,8 @@ import { Checkbox } from '@nurihaus/web-design-system'; // 루트.
|
|
|
537
747
|
| `disabled` | `boolean` | | |
|
|
538
748
|
| `track` | `string` | | |
|
|
539
749
|
| `trackProps` | `Record<string, string \| number \| boolean>` | | |
|
|
750
|
+
| `pressEffect` | `boolean` | | `true` |
|
|
751
|
+
| `delay` | `number` | | |
|
|
540
752
|
|
|
541
753
|
이 밖에 React·HTML 기본 속성 2개를 받는다.
|
|
542
754
|
|
|
@@ -551,28 +763,36 @@ import { Switch } from '@nurihaus/web-design-system'; // 루트. 첫
|
|
|
551
763
|
|
|
552
764
|
`track`을 주면 켜짐 상태가 바뀔 때마다 `change`와 `'on'`·`'off'`를 `value`에 담아 사용 로그로 보낸다.
|
|
553
765
|
|
|
766
|
+
- `pressEffect`(기본 `true`): 트랙을 누르는 동안 살짝 줄어든다. `false`면 끈다.
|
|
767
|
+
- `motion`(`'weak'` 기본 · `'strong'`): 손잡이가 옮겨 가는 스프링의 세기다. `'strong'`은 끝에서 한 번 튄다. 빠르게 연달아 눌러도 지금 위치에서 이어 움직인다. 앱 루트의 `MotionProvider` 아래에서만 움직이고, 없으면 손잡이가 바로 제자리로 간다.
|
|
768
|
+
- `delay`(ms, 기본 `0`): 켜짐이 바뀐 뒤 손잡이가 출발하기까지 기다리는 시간이다.
|
|
769
|
+
- `disabled`인 스위치를 누르면 좌우로 흔들린다. 꺼진 버튼에도 오는 `pointerdown`으로 알아채므로 Chromium 에서 동작하고 Firefox 는 보내지 않을 수 있다.
|
|
770
|
+
|
|
554
771
|
**쓰지 않는다.** 제출 버튼을 눌러야 반영되는 폼 항목이나 동의 여부는 Checkbox를, 여러 선택지 중 하나는 Radio를 쓴다.
|
|
555
772
|
|
|
556
773
|
```tsx
|
|
557
774
|
<Switch id="push-alarm" label="푸시 알림 받기" checked={true} onChange={() => {}} />
|
|
558
775
|
```
|
|
559
776
|
|
|
560
|
-
**모션.** press · confirm. 토큰 값과 규칙은 `motion.md`.
|
|
777
|
+
**모션.** press(`pressEffect`) · confirm(`motion`, `delay`). 토큰 값과 규칙은 `motion.md`.
|
|
561
778
|
|
|
562
779
|
### props
|
|
563
780
|
|
|
564
781
|
| prop | 타입 | 필수 | 기본값 |
|
|
565
782
|
| --- | --- | --- | --- |
|
|
566
|
-
| `className` | `string` | | |
|
|
567
|
-
| `size` | `'s' \| 'm' \| 'l'` | | `'m'` |
|
|
568
783
|
| `label` | `ReactNode` | | |
|
|
569
784
|
| `track` | `string` | | |
|
|
570
|
-
| `disabled` | `boolean` | | |
|
|
571
785
|
| `defaultChecked` | `boolean` | | |
|
|
786
|
+
| `className` | `string` | | |
|
|
572
787
|
| `id` | `string` | 예 | |
|
|
573
788
|
| `onChange` | `((checked: boolean) => void)` | | |
|
|
789
|
+
| `size` | `'s' \| 'm' \| 'l'` | | `'m'` |
|
|
790
|
+
| `disabled` | `boolean` | | |
|
|
574
791
|
| `trackProps` | `Record<string, string \| number \| boolean>` | | |
|
|
792
|
+
| `pressEffect` | `boolean` | | `true` |
|
|
793
|
+
| `motion` | `MotionStrength` | | |
|
|
575
794
|
| `checked` | `boolean` | | |
|
|
795
|
+
| `delay` | `number` | | |
|
|
576
796
|
|
|
577
797
|
이 밖에 React·HTML 기본 속성 270개를 받는다.
|
|
578
798
|
|
|
@@ -583,32 +803,36 @@ import { TextArea } from '@nurihaus/web-design-system/text-area'; // 이 컴
|
|
|
583
803
|
import { TextArea } from '@nurihaus/web-design-system'; // 루트. 첫 로드 JS 가 커진다
|
|
584
804
|
```
|
|
585
805
|
|
|
586
|
-
**언제 쓴다.** 메모·설명처럼 여러 줄 텍스트를 입력받을 때 쓴다. 위 라벨(`title`), 아래 안내 문구(`helperText`)를 함께 붙일 수 있고, `isError`가 true면 `helperText`가
|
|
806
|
+
**언제 쓴다.** 메모·설명처럼 여러 줄 텍스트를 입력받을 때 쓴다. 위 라벨(`title`), 아래 안내 문구(`helperText`)를 함께 붙일 수 있고, `isError`가 true면 입력 상자 테두리와 `helperText`가 빨개지고 textarea 에 `aria-invalid`가 붙는다. 모양(테두리·포커스 후광·읽기 전용·disabled)은 TextField 와 같다. 높이는 `rows`가 정하고 `size`는 글자 크기와 안쪽 여백만 바꾼다. `resize`는 `'vertical'`(기본)·`'none'` 중 고른다. `className`·`style`은 textarea를 감싸는 테두리 요소에 붙고, `ref`는 textarea 요소를 가리킨다.
|
|
587
807
|
|
|
588
808
|
`track`을 주면 포커스가 빠질 때 값이 포커스를 받을 때와 다르면 `change`를 한 번 사용 로그로 보낸다. 값은 싣지 않는다. 사용자가 입력한 글자는 로그에 들어가지 않는다.
|
|
589
809
|
|
|
810
|
+
- `clearable`이면 값이 있고 포커스가 입력 상자 안에 있을 때 첫 줄 오른쪽에 지우기 버튼(X, `aria-label` '입력 지우기')이 뜬다. 누르면 포커스는 textarea에 남고 `onChange`가 `''`로 불린 뒤 `onClear`가 불린다. `disabled`·`readOnly`면 뜨지 않는다.
|
|
811
|
+
|
|
590
812
|
**쓰지 않는다.** 한 줄 입력은 TextField를 쓴다. 정해진 값 중에서 고르는 입력은 DropDown이나 Radio를 쓴다.
|
|
591
813
|
|
|
592
814
|
```tsx
|
|
593
815
|
<TextArea name="memo" title="메모" placeholder="내용을 입력하세요" rows={4} />
|
|
594
816
|
```
|
|
595
817
|
|
|
596
|
-
**모션.**
|
|
818
|
+
**모션.** press(opt). 토큰 값과 규칙은 `motion.md`.
|
|
597
819
|
|
|
598
820
|
### props
|
|
599
821
|
|
|
600
822
|
| prop | 타입 | 필수 | 기본값 |
|
|
601
823
|
| --- | --- | --- | --- |
|
|
602
|
-
| `className` | `string` | | |
|
|
603
|
-
| `size` | `'s' \| 'm'` | | `'s'` |
|
|
604
824
|
| `title` | `ReactNode` | | |
|
|
605
825
|
| `track` | `string` | | |
|
|
826
|
+
| `defaultValue` | `string` | | |
|
|
827
|
+
| `className` | `string` | | |
|
|
828
|
+
| `size` | `'s' \| 'm'` | | `'s'` |
|
|
606
829
|
| `name` | `string` | 예 | |
|
|
830
|
+
| `width` | `string \| number` | | `'100%'` |
|
|
607
831
|
| `value` | `string` | | |
|
|
608
|
-
| `defaultValue` | `string` | | |
|
|
609
832
|
| `trackProps` | `Record<string, string \| number \| boolean>` | | |
|
|
610
|
-
| `width` | `string \| number` | | `'100%'` |
|
|
611
833
|
| `resize` | `'none' \| 'vertical'` | | `'vertical'` |
|
|
834
|
+
| `clearable` | `boolean` | | |
|
|
835
|
+
| `onClear` | `(() => void)` | | |
|
|
612
836
|
| `helperText` | `ReactNode` | | |
|
|
613
837
|
| `isError` | `boolean` | | |
|
|
614
838
|
|
|
@@ -621,7 +845,11 @@ import { Toast } from '@nurihaus/web-design-system/toast'; // 이 컴포넌트
|
|
|
621
845
|
import { Toast } from '@nurihaus/web-design-system'; // 루트. 첫 로드 JS 가 커진다
|
|
622
846
|
```
|
|
623
847
|
|
|
624
|
-
**언제 쓴다.** 저장 완료·삭제 완료처럼 사용자의 행동 결과를 짧게 알리고 스스로 사라져야 할 때 쓴다. `title`은 필수, `description`은 한 줄 보충 설명이다. `variant`(`default · secondary · success · warning · error`)가 바탕색을 정한다. 기본은 Tooltip과 같은 진보라, `secondary`는 CTAButton
|
|
848
|
+
**언제 쓴다.** 저장 완료·삭제 완료처럼 사용자의 행동 결과를 짧게 알리고 스스로 사라져야 할 때 쓴다. `title`은 필수, `description`은 한 줄 보충 설명이다. `variant`(`default · secondary · success · warning · error`)가 바탕색을 정한다. 기본은 Tooltip과 같은 진보라, `secondary`는 CTAButton `weak`와 같은 연보라(어두운 글자), `success`는 초록, `warning`은 주황, `error`는 CTAButton `danger`와 같은 빨강이고 이 셋은 앞에 상태 아이콘(체크·느낌표·X)이 붙는다. secondary 외에는 글자가 흰색이다. `action`을 주면 되돌리기 같은 작은 버튼(CTAButton xs·`neutral`·`fill`)이 하나 붙고 누르면 토스트가 닫힌다. `showClose={false}`로 닫기 버튼을 뺄 수 있다. `duration`(ms)은 이 토스트만의 표시 시간이다. `className`·`style`은 토스트 루트(`li`)에 붙는다. 반드시 ToastProvider 안에서 쓴다.
|
|
849
|
+
|
|
850
|
+
- `onEntered`는 등장 애니메이션이 끝난 뒤, `onExited`는 퇴장 애니메이션이 끝나 토스트가 사라진 뒤 한 번 불린다. 시간이 다 되거나 밀어서 스스로 닫힐 때도 불린다. reduced-motion 이면 열고 닫는 즉시 불린다.
|
|
851
|
+
|
|
852
|
+
뒤로 가기로 닫는 `closeOnBackEvent` 는 없다. 토스트는 화면을 막지 않고 스스로 사라지기 때문이다. state 없이 띄우려면 `useToast().show` 를 쓴다(OverlayProvider).
|
|
625
853
|
|
|
626
854
|
**쓰지 않는다.** 사용자의 확인이나 선택이 필요한 내용은 ModalWithDoubleButton을 쓴다. 입력 오류처럼 그 자리에서 고쳐야 하는 안내는 TextField의 helper text를 쓴다.
|
|
627
855
|
|
|
@@ -629,16 +857,16 @@ import { Toast } from '@nurihaus/web-design-system'; // 루트. 첫
|
|
|
629
857
|
<Toast open title="저장했습니다" description="변경 사항이 반영됐습니다." variant="success" onOpenChange={() => {}} />
|
|
630
858
|
```
|
|
631
859
|
|
|
632
|
-
**모션.** enter · exit. 토큰 값과 규칙은 `motion.md`.
|
|
860
|
+
**모션.** enter(`onEntered`) · exit(`onExited`). 토큰 값과 규칙은 `motion.md`.
|
|
633
861
|
|
|
634
862
|
### props
|
|
635
863
|
|
|
636
864
|
| prop | 타입 | 필수 | 기본값 |
|
|
637
865
|
| --- | --- | --- | --- |
|
|
638
|
-
| `className` | `string` | | |
|
|
639
866
|
| `style` | `CSSProperties` | | |
|
|
640
867
|
| `title` | `ReactNode` | 예 | |
|
|
641
868
|
| `track` | `string` | | |
|
|
869
|
+
| `className` | `string` | | |
|
|
642
870
|
| `onPause` | `(() => void)` | | |
|
|
643
871
|
| `variant` | `'success' \| 'warning' \| 'secondary' \| 'default' \| 'error'` | | `'default'` |
|
|
644
872
|
| `trackProps` | `Record<string, string \| number \| boolean>` | | |
|
|
@@ -650,6 +878,8 @@ import { Toast } from '@nurihaus/web-design-system'; // 루트. 첫
|
|
|
650
878
|
| `description` | `ReactNode` | | |
|
|
651
879
|
| `action` | `ToastAction` | | |
|
|
652
880
|
| `showClose` | `boolean` | | `true` |
|
|
881
|
+
| `onEntered` | `(() => void)` | | |
|
|
882
|
+
| `onExited` | `(() => void)` | | |
|
|
653
883
|
|
|
654
884
|
이 밖에 React·HTML 기본 속성 262개를 받는다.
|
|
655
885
|
|
|
@@ -660,9 +890,9 @@ import { ToastProvider } from '@nurihaus/web-design-system/toast'; // 이 컴
|
|
|
660
890
|
import { ToastProvider } from '@nurihaus/web-design-system'; // 루트. 첫 로드 JS 가 커진다
|
|
661
891
|
```
|
|
662
892
|
|
|
663
|
-
**언제 쓴다.** 앱 루트에 한 번 둔다. 토스트가 쌓이는 자리(Viewport)를 그리고 `position`(`top-right · bottom-right · bottom-center`, 기본 `bottom-right`)으로 화면 어느 모서리에 둘지 고른다. `duration`(ms)은 안의 모든 Toast 에 적용되는 기본 표시 시간이다(기본 5000). Toast 가 `duration`을 주면 그 값이 앞선다. `label`은 스크린 리더가 읽는 이름이고 기본은 `알림`이다. 다른 언어 서비스에서만 바꾼다.
|
|
893
|
+
**언제 쓴다.** 앱 루트에 한 번 둔다. 토스트가 쌓이는 자리(Viewport)를 그리고 `position`(`top-right · bottom-right · bottom-center`, 기본 `bottom-right`)으로 화면 어느 모서리에 둘지 고른다. `duration`(ms)은 안의 모든 Toast 에 적용되는 기본 표시 시간이다(기본 5000). Toast 가 `duration`을 주면 그 값이 앞선다. `label`은 스크린 리더가 읽는 이름이고 기본은 `알림`이다. 다른 언어 서비스에서만 바꾼다. `portalContainer`를 주면 토스트 자리를 그 요소 안에 그린다. 없으면 Provider 가 놓인 자리에 그린다.
|
|
664
894
|
|
|
665
|
-
**쓰지 않는다.** 화면마다 여러 개 두지 않는다. Provider 가 둘이면 토스트 자리가 둘로 갈린다.
|
|
895
|
+
**쓰지 않는다.** 화면마다 여러 개 두지 않는다. Provider 가 둘이면 토스트 자리가 둘로 갈린다. OverlayProvider 가 이것을 품으므로 OverlayProvider 를 두면 ToastProvider 는 두지 않는다. ToastProvider 는 한 마이너 동안 남고 다음 메이저에서 지운다(ADR 0010).
|
|
666
896
|
|
|
667
897
|
```tsx
|
|
668
898
|
<ToastProvider position="bottom-right" duration={5000}>
|
|
@@ -680,6 +910,7 @@ import { ToastProvider } from '@nurihaus/web-design-system'; // 루
|
|
|
680
910
|
| `duration` | `number` | | |
|
|
681
911
|
| `position` | `'top-right' \| 'bottom-right' \| 'bottom-center'` | | `'bottom-right'` |
|
|
682
912
|
| `label` | `string` | | `'알림'` |
|
|
913
|
+
| `portalContainer` | `HTMLElement` | | |
|
|
683
914
|
|
|
684
915
|
## Pagination
|
|
685
916
|
|
|
@@ -692,22 +923,25 @@ import { Pagination } from '@nurihaus/web-design-system'; // 루트.
|
|
|
692
923
|
|
|
693
924
|
`track`을 주면 페이지가 바뀔 때 `change`와 새 페이지 번호(문자열)를 `value`에 담아 사용 로그로 보낸다. 현재 페이지를 다시 누르면 보내지 않는다.
|
|
694
925
|
|
|
926
|
+
- `pressEffect`(기본 `true`): 페이지·이전·다음 버튼을 누르는 동안 살짝 줄어들고 어두워진다. `false`면 끈다.
|
|
927
|
+
|
|
695
928
|
**쓰지 않는다.** 스크롤로 계속 불러오는 목록이나 "더 보기" 버튼으로 이어 붙이는 목록에는 쓰지 않는다. 화면 안의 내용 영역을 바꾸는 탭 전환은 Tabs를 쓴다.
|
|
696
929
|
|
|
697
930
|
```tsx
|
|
698
931
|
<Pagination totalPages={10} page={3} onPageChange={() => {}} />
|
|
699
932
|
```
|
|
700
933
|
|
|
701
|
-
**모션.** press. 토큰 값과 규칙은 `motion.md`.
|
|
934
|
+
**모션.** press(`pressEffect`). 토큰 값과 규칙은 `motion.md`.
|
|
702
935
|
|
|
703
936
|
### props
|
|
704
937
|
|
|
705
938
|
| prop | 타입 | 필수 | 기본값 |
|
|
706
939
|
| --- | --- | --- | --- |
|
|
707
|
-
| `size` | `'s' \| 'm'` | | `'m'` |
|
|
708
940
|
| `track` | `string` | | |
|
|
941
|
+
| `size` | `'s' \| 'm'` | | `'m'` |
|
|
709
942
|
| `disabled` | `boolean` | | |
|
|
710
943
|
| `trackProps` | `Record<string, string \| number \| boolean>` | | |
|
|
944
|
+
| `pressEffect` | `boolean` | | `true` |
|
|
711
945
|
| `page` | `number` | | |
|
|
712
946
|
| `totalPages` | `number` | 예 | |
|
|
713
947
|
| `defaultPage` | `number` | | |
|
|
@@ -725,7 +959,15 @@ import { Modal } from '@nurihaus/web-design-system'; // 루트. 첫
|
|
|
725
959
|
|
|
726
960
|
**언제 쓴다.** 제목과 본문, 버튼 영역이 자유로운 일반 대화상자에 쓴다. `open · defaultOpen · onOpenChange`로 열고 닫고, `trigger`를 주면 그 요소를 클릭해 열린다. `title`은 필수이고 dialog의 접근성 이름이 된다. `footer`에는 CTAButton 을 넣는다. `className`·`style`은 dialog 요소(Content)에 붙는다. X 아이콘(`showCloseIcon`, 기본 true)·Escape·오버레이 클릭으로 닫힌다.
|
|
727
961
|
|
|
728
|
-
|
|
962
|
+
- 본문(`children`)이 길면 본문만 스크롤된다. 창은 화면 안에 머물고, 제목·X 아이콘과 `footer` 버튼은 제자리에 있다.
|
|
963
|
+
- `closeOnOverlayClick={false}`면 바깥을 눌러도 닫히지 않고 창이 좌우로 한 번 흔들린다. 기본 true.
|
|
964
|
+
- `closeOnEscape={false}`면 Escape 로 닫히지 않는다. 기본 true.
|
|
965
|
+
- `closeOnBackEvent`(기본 true)면 열린 동안 history 항목을 하나 쌓아, 브라우저·기기의 뒤로 가기가 페이지를 떠나지 않고 창을 닫는다. 이때도 `onOpenChange(false)` 가 불린다. 버튼·Esc 로 닫으면 쌓은 항목을 `history.back()` 으로 되돌린다. 겹쳐 열면 나중에 연 것부터 닫힌다. 주소가 바뀌어야 하는 화면 단위 오버레이에서는 `false` 로 끄고 라우터로 연다.
|
|
966
|
+
- `portalContainer`를 주면 창을 그 요소 안에 그린다. 없으면 document.body.
|
|
967
|
+
- `trigger` 없이 부모가 열면 닫힐 때 포커스가 연 요소로 돌아온다. 그 요소가 사라졌으면 돌려놓지 않는다.
|
|
968
|
+
- `onEntered`는 등장 애니메이션이 끝난 뒤, `onExited`는 퇴장 애니메이션이 끝나 창이 사라진 뒤 한 번 불린다. reduced-motion 이면 열고 닫는 즉시 불린다.
|
|
969
|
+
|
|
970
|
+
**쓰지 않는다.** 확인·취소 두 버튼으로 끝나는 확인 대화상자는 ModalWithDoubleButton 을 쓴다. 결과 알림처럼 묻고 끝나는 창은 state 를 두지 말고 `useDialog().alert` 로 연다(OverlayProvider).
|
|
729
971
|
|
|
730
972
|
```tsx
|
|
731
973
|
<Modal
|
|
@@ -739,7 +981,7 @@ import { Modal } from '@nurihaus/web-design-system'; // 루트. 첫
|
|
|
739
981
|
</Modal>
|
|
740
982
|
```
|
|
741
983
|
|
|
742
|
-
**모션.** enter · exit. 토큰 값과 규칙은 `motion.md`.
|
|
984
|
+
**모션.** enter(`onEntered`) · exit(`onExited`) · reject(opt). 토큰 값과 규칙은 `motion.md`.
|
|
743
985
|
|
|
744
986
|
### props
|
|
745
987
|
|
|
@@ -752,6 +994,10 @@ import { Modal } from '@nurihaus/web-design-system'; // 루트. 첫
|
|
|
752
994
|
| `footer` | `ReactNode` | | |
|
|
753
995
|
| `showCloseIcon` | `boolean` | | `true` |
|
|
754
996
|
| `size` | `'s' \| 'm' \| 'l'` | | `'m'` |
|
|
997
|
+
| `closeOnOverlayClick` | `boolean` | | `true` |
|
|
998
|
+
| `closeOnEscape` | `boolean` | | `true` |
|
|
999
|
+
| `portalContainer` | `HTMLElement` | | |
|
|
1000
|
+
| `closeOnBackEvent` | `boolean` | | `true` |
|
|
755
1001
|
| `open` | `boolean` | | |
|
|
756
1002
|
| `defaultOpen` | `boolean` | | |
|
|
757
1003
|
| `onOpenChange` | `((open: boolean) => void)` | | |
|
|
@@ -759,6 +1005,8 @@ import { Modal } from '@nurihaus/web-design-system'; // 루트. 첫
|
|
|
759
1005
|
| `style` | `CSSProperties` | | |
|
|
760
1006
|
| `track` | `string` | | |
|
|
761
1007
|
| `trackProps` | `Record<string, string \| number \| boolean>` | | |
|
|
1008
|
+
| `onEntered` | `(() => void)` | | |
|
|
1009
|
+
| `onExited` | `(() => void)` | | |
|
|
762
1010
|
|
|
763
1011
|
이 밖에 React·HTML 기본 속성 2개를 받는다.
|
|
764
1012
|
|
|
@@ -771,6 +1019,13 @@ import { Drawer } from '@nurihaus/web-design-system'; // 루트. 첫
|
|
|
771
1019
|
|
|
772
1020
|
**언제 쓴다.** 상세 정보나 필터처럼 현재 화면을 떠나지 않고 옆이나 아래에서 패널을 꺼내 보여줄 때 쓴다. `trigger`에 넘긴 요소를 클릭하면 열리고, `open`·`defaultOpen`·`onOpenChange`로 제어한다. `title`은 필수이며 dialog 의 접근성 이름이 된다. `side`(`right`·`left`·`bottom`, 기본 `right`)와 `size`(`s`·`m`·`l`, 기본 `m`)로 방향과 폭(bottom 은 높이)을 고른다. Escape·바깥 클릭·X 버튼으로 닫히고, `className`·`style`은 패널에 붙는다.
|
|
773
1021
|
|
|
1022
|
+
- `motion`(`weak`·`strong`, 기본 `weak`)은 등장 세기다. `strong`은 스프링으로 끝에서 한 번 튄다. 퇴장은 같다.
|
|
1023
|
+
- `closeOnOverlayClick={false}`면 바깥을 눌러도 닫히지 않고 패널이 좌우로 한 번 흔들린다. 기본 true.
|
|
1024
|
+
- `closeOnEscape={false}`면 Escape 로 닫히지 않는다. 기본 true.
|
|
1025
|
+
- `closeOnBackEvent`(기본 true)면 열린 동안 history 항목을 하나 쌓아, 브라우저·기기의 뒤로 가기가 페이지를 떠나지 않고 패널을 닫는다. 이때도 `onOpenChange(false)` 가 불린다. 버튼·Esc 로 닫으면 쌓은 항목을 `history.back()` 으로 되돌린다. 겹쳐 열면 나중에 연 것부터 닫힌다. 주소가 바뀌어야 하는 화면 단위 오버레이에서는 `false` 로 끄고 라우터로 연다.
|
|
1026
|
+
- `portalContainer`를 주면 패널을 그 요소 안에 그린다. 없으면 document.body.
|
|
1027
|
+
- `onEntered`는 등장 애니메이션이 끝난 뒤, `onExited`는 퇴장 애니메이션이 끝나 패널이 사라진 뒤 한 번 불린다. reduced-motion 이면 열고 닫는 즉시 불린다.
|
|
1028
|
+
|
|
774
1029
|
**쓰지 않는다.** 삭제 확인처럼 결정 하나만 받는 짧은 대화상자는 ModalWithDoubleButton 을 쓴다. 페이지 자체 내비게이션이나 항상 보이는 사이드바에는 쓰지 않는다.
|
|
775
1030
|
|
|
776
1031
|
```tsx
|
|
@@ -779,7 +1034,7 @@ import { Drawer } from '@nurihaus/web-design-system'; // 루트. 첫
|
|
|
779
1034
|
</Drawer>
|
|
780
1035
|
```
|
|
781
1036
|
|
|
782
|
-
**모션.** enter · exit. 토큰 값과 규칙은 `motion.md`.
|
|
1037
|
+
**모션.** enter(`motion`, `onEntered`) · exit(`onExited`) · reject(opt). 토큰 값과 규칙은 `motion.md`.
|
|
783
1038
|
|
|
784
1039
|
### props
|
|
785
1040
|
|
|
@@ -793,6 +1048,10 @@ import { Drawer } from '@nurihaus/web-design-system'; // 루트. 첫
|
|
|
793
1048
|
| `side` | `'bottom' \| 'left' \| 'right'` | | `'right'` |
|
|
794
1049
|
| `size` | `'s' \| 'm' \| 'l'` | | `'m'` |
|
|
795
1050
|
| `showCloseIcon` | `boolean` | | `true` |
|
|
1051
|
+
| `closeOnOverlayClick` | `boolean` | | `true` |
|
|
1052
|
+
| `closeOnEscape` | `boolean` | | `true` |
|
|
1053
|
+
| `portalContainer` | `HTMLElement` | | |
|
|
1054
|
+
| `closeOnBackEvent` | `boolean` | | `true` |
|
|
796
1055
|
| `open` | `boolean` | | |
|
|
797
1056
|
| `defaultOpen` | `boolean` | | |
|
|
798
1057
|
| `onOpenChange` | `((open: boolean) => void)` | | |
|
|
@@ -800,6 +1059,9 @@ import { Drawer } from '@nurihaus/web-design-system'; // 루트. 첫
|
|
|
800
1059
|
| `style` | `CSSProperties` | | |
|
|
801
1060
|
| `track` | `string` | | |
|
|
802
1061
|
| `trackProps` | `Record<string, string \| number \| boolean>` | | |
|
|
1062
|
+
| `motion` | `MotionStrength` | | `'weak'` |
|
|
1063
|
+
| `onEntered` | `(() => void)` | | |
|
|
1064
|
+
| `onExited` | `(() => void)` | | |
|
|
803
1065
|
|
|
804
1066
|
이 밖에 React·HTML 기본 속성 2개를 받는다.
|
|
805
1067
|
|
|
@@ -824,14 +1086,55 @@ import { Skeleton } from '@nurihaus/web-design-system'; // 루트.
|
|
|
824
1086
|
|
|
825
1087
|
| prop | 타입 | 필수 | 기본값 |
|
|
826
1088
|
| --- | --- | --- | --- |
|
|
827
|
-
| `width` | `string \| number` | | `'100%'` |
|
|
828
|
-
| `height` | `string \| number` | | |
|
|
829
1089
|
| `shape` | `'circle' \| 'rect' \| 'text'` | | `'text'` |
|
|
1090
|
+
| `height` | `string \| number` | | |
|
|
1091
|
+
| `width` | `string \| number` | | `'100%'` |
|
|
830
1092
|
| `lines` | `number` | | `1` |
|
|
831
1093
|
| `animated` | `boolean` | | `true` |
|
|
832
1094
|
|
|
833
1095
|
이 밖에 React·HTML 기본 속성 266개를 받는다.
|
|
834
1096
|
|
|
1097
|
+
## SkeletonGroup
|
|
1098
|
+
|
|
1099
|
+
```ts
|
|
1100
|
+
import { SkeletonGroup } from '@nurihaus/web-design-system/skeleton-group'; // 이 컴포넌트만 싣는다 (권장)
|
|
1101
|
+
import { SkeletonGroup } from '@nurihaus/web-design-system'; // 루트. 첫 로드 JS 가 커진다
|
|
1102
|
+
```
|
|
1103
|
+
|
|
1104
|
+
**언제 쓴다.** 목록·카드·표처럼 자주 쓰는 모양의 로딩 자리를 Skeleton 여러 개로 한 번에 그릴 때 쓴다. 루트는 `role="status"`·`aria-busy` 인 `div` 이고 `aria-label`(기본 `'불러오는 중'`)로 한 번 알린다. 안의 Skeleton 은 낭독기에 숨는다. `className`·`style` 은 루트에 붙는다.
|
|
1105
|
+
|
|
1106
|
+
- `pattern`: `'list' | 'listWithIcon' | 'titleList' | 'card' | 'table'`, 기본 `'list'`. list 는 한 줄 글, listWithIcon 은 원과 두 줄 글을 나란히 놓은 행, titleList 는 제목 뒤 글 줄, card 는 카드 사각형·제목 뒤 글 줄, table 은 머리 행 하나 뒤 사각형 칸 네 개짜리 본문 행이다.
|
|
1107
|
+
- `custom`: `pattern` 대신 위에서부터 그릴 블록 이름 배열. `'title' | 'subtitle' | 'text' | 'circle' | 'rect' | 'card' | 'spacer:{n}'`. `text` 는 한 줄 글, `spacer:16` 은 블록 사이 간격 위에 `--spacing-16` 만큼 더 띄운다. `n` 은 `--spacing-*` 에 있는 이름(`SpacingToken`)만 되고 `'spacer:13'` 은 타입 오류다. `pattern` 과 함께 주면 타입 오류다.
|
|
1108
|
+
- `repeat`: 마지막 블록을 몇 번 그릴지. 기본 `3`. 목록·표 패턴의 마지막 블록은 행이라 행 수가 된다. 앞 블록(제목, 표 머리 행)은 한 번만 그린다.
|
|
1109
|
+
- `animated`: 블록마다 Skeleton 의 shimmer 를 켠다. 기본 `true`.
|
|
1110
|
+
- 블록 치수는 `styles/token/size.css` 의 `--skeleton-block-*` 이다. 바꾸려면 쓰는 쪽이 `className` 으로 변수를 덮는다.
|
|
1111
|
+
|
|
1112
|
+
**쓰지 않는다.** 뼈대 하나만 필요하면 Skeleton 을 쓴다. 들어올 내용의 모양이 패턴과 다르면 `custom` 으로 적고, 그래도 맞지 않으면 Skeleton 을 직접 조합한다. 짧은 처리 중 표시는 InlineLoading 을 쓴다.
|
|
1113
|
+
|
|
1114
|
+
```tsx
|
|
1115
|
+
<SkeletonGroup pattern="listWithIcon" repeat={4} aria-label="주문 목록 불러오는 중" />
|
|
1116
|
+
```
|
|
1117
|
+
|
|
1118
|
+
```tsx
|
|
1119
|
+
<SkeletonGroup custom={['title', 'spacer:16', 'text']} repeat={2} />
|
|
1120
|
+
```
|
|
1121
|
+
|
|
1122
|
+
**모션.** busy(`animated`). 토큰 값과 규칙은 `motion.md`.
|
|
1123
|
+
|
|
1124
|
+
### props
|
|
1125
|
+
|
|
1126
|
+
| prop | 타입 | 필수 | 기본값 |
|
|
1127
|
+
| --- | --- | --- | --- |
|
|
1128
|
+
| `repeat` | `number` | | `3` |
|
|
1129
|
+
| `animated` | `boolean` | | `true` |
|
|
1130
|
+
| `aria-label` | `string` | | |
|
|
1131
|
+
| `className` | `string` | | |
|
|
1132
|
+
| `style` | `CSSProperties` | | |
|
|
1133
|
+
| `pattern` | `'card' \| 'table' \| 'list' \| 'listWithIcon' \| 'titleList'` | | `'list'` |
|
|
1134
|
+
| `custom` | `SkeletonCustomToken[]` | | |
|
|
1135
|
+
|
|
1136
|
+
이 밖에 React·HTML 기본 속성 2개를 받는다.
|
|
1137
|
+
|
|
835
1138
|
## Breadcrumb
|
|
836
1139
|
|
|
837
1140
|
```ts
|
|
@@ -843,6 +1146,8 @@ import { Breadcrumb } from '@nurihaus/web-design-system'; // 루트.
|
|
|
843
1146
|
|
|
844
1147
|
`track`을 주면 링크 항목을 누를 때 `navigate`와 그 항목의 `id`를 `value`에 담아 사용 로그로 보낸다. 마지막(현재 위치) 항목은 링크가 아니라 보내지 않는다.
|
|
845
1148
|
|
|
1149
|
+
- `pressEffect`(기본 `true`): 링크 항목(알약)을 누르는 동안 살짝 줄고 어두워진다. `href`가 없는 글자 항목과 현재 위치에는 붙지 않는다. `false`면 끈다.
|
|
1150
|
+
|
|
846
1151
|
**쓰지 않는다.** 같은 깊이의 화면을 오가는 데는 Tabs를, 사이드바 메뉴에는 CollapsibleMenu를 쓴다. 계층이 한 단계뿐이면 쓰지 않는다.
|
|
847
1152
|
|
|
848
1153
|
```tsx
|
|
@@ -855,7 +1160,7 @@ import { Breadcrumb } from '@nurihaus/web-design-system'; // 루트.
|
|
|
855
1160
|
/>
|
|
856
1161
|
```
|
|
857
1162
|
|
|
858
|
-
**모션.** press. 토큰 값과 규칙은 `motion.md`.
|
|
1163
|
+
**모션.** press(`pressEffect`). 토큰 값과 규칙은 `motion.md`.
|
|
859
1164
|
|
|
860
1165
|
### props
|
|
861
1166
|
|
|
@@ -870,6 +1175,7 @@ import { Breadcrumb } from '@nurihaus/web-design-system'; // 루트.
|
|
|
870
1175
|
| `style` | `CSSProperties` | | |
|
|
871
1176
|
| `track` | `string` | | |
|
|
872
1177
|
| `trackProps` | `Record<string, string \| number \| boolean>` | | |
|
|
1178
|
+
| `pressEffect` | `boolean` | | `true` |
|
|
873
1179
|
|
|
874
1180
|
이 밖에 React·HTML 기본 속성 2개를 받는다.
|
|
875
1181
|
|
|
@@ -882,6 +1188,9 @@ import { DropDown } from '@nurihaus/web-design-system'; // 루트.
|
|
|
882
1188
|
|
|
883
1189
|
**언제 쓴다.** 펼쳐지는 목록에서 값 하나를 고를 때 쓴다. 보통 `options`를 넘기고, 목록 영역을 직접 그려야 하면 `renderOption`을 쓰되 이때는 항목 선택 처리와 닫기(`close`)를 직접 해야 한다.
|
|
884
1190
|
|
|
1191
|
+
- 목록은 열릴 때 트리거 쪽에서 펼쳐지고 선택지가 위에서부터 차례로 나타난다(`motion.md` 의 unfold). 끄는 prop 은 없다.
|
|
1192
|
+
- `pressEffect={false}`면 선택지를 누를 때 배경이 한 단계 진해지는 눌림 효과(딤)를 뺀다. 기본 true. 트리거는 입력 상자라 눌림이 없고 열림(목록 등장·화살표 회전)이 피드백이다. `renderOption`으로 그린 목록에는 붙지 않는다.
|
|
1193
|
+
|
|
885
1194
|
**쓰지 않는다.** 여러 값을 동시에 고르는 다중 선택은 지원하지 않는다. 선택지가 적어 모두 펼쳐 보여주는 편이 나으면 Radio를, 페이지 이동 메뉴는 CollapsibleMenu를 쓴다.
|
|
886
1195
|
|
|
887
1196
|
```tsx
|
|
@@ -899,7 +1208,7 @@ import { DropDown } from '@nurihaus/web-design-system'; // 루트.
|
|
|
899
1208
|
/>
|
|
900
1209
|
```
|
|
901
1210
|
|
|
902
|
-
**모션.** press ·
|
|
1211
|
+
**모션.** press(`pressEffect`) · unfold · expand. 토큰 값과 규칙은 `motion.md`.
|
|
903
1212
|
|
|
904
1213
|
### props
|
|
905
1214
|
|
|
@@ -927,6 +1236,7 @@ import { DropDown } from '@nurihaus/web-design-system'; // 루트.
|
|
|
927
1236
|
| `style` | `CSSProperties` | | |
|
|
928
1237
|
| `track` | `string` | | |
|
|
929
1238
|
| `trackProps` | `Record<string, string \| number \| boolean>` | | |
|
|
1239
|
+
| `pressEffect` | `boolean` | | `true` |
|
|
930
1240
|
|
|
931
1241
|
이 밖에 React·HTML 기본 속성 2개를 받는다.
|
|
932
1242
|
|
|
@@ -937,7 +1247,10 @@ import { CollapsibleMenu } from '@nurihaus/web-design-system/collapsible-menu';
|
|
|
937
1247
|
import { CollapsibleMenu } from '@nurihaus/web-design-system'; // 루트. 첫 로드 JS 가 커진다
|
|
938
1248
|
```
|
|
939
1249
|
|
|
940
|
-
**언제 쓴다.** 사이드바 같은 세로 내비게이션 메뉴에 쓴다. `children`이 있는 항목은 펼치고 접는 그룹이 되고, 없는 항목은 `href`가 있으면 링크, 없으면 버튼으로 렌더되며, `activeKey` 항목과 그 상위 그룹이 강조된다. 링크는 기본으로 `<a>`다. 라우터의 링크로 바꾸려면 `linkComponent`에 넘긴다. 받는 props는 `href`·`className`·`children`·`onClick`·`aria-current`·`aria-disabled`이고, 그대로 링크에 전달하면 된다.
|
|
1250
|
+
**언제 쓴다.** 사이드바 같은 세로 내비게이션 메뉴에 쓴다. `children`이 있는 항목은 펼치고 접는 그룹이 되고, 없는 항목은 `href`가 있으면 링크, 없으면 버튼으로 렌더되며, `activeKey` 항목과 그 상위 그룹이 강조된다. 링크는 기본으로 `<a>`다. 라우터의 링크로 바꾸려면 `linkComponent`에 넘긴다. 받는 props는 `href`·`className`·`style`·`children`·`onClick`·`aria-current`·`aria-disabled`이고, 그대로 링크에 전달하면 된다. `style`은 펼침 순서라 빠뜨리면 하위 메뉴 링크가 순서 없이 한꺼번에 나타난다.
|
|
1251
|
+
|
|
1252
|
+
- 하위 메뉴가 있는 행은 오른쪽에 아래 화살표를 그리고 열리면 돌린다. 하위 메뉴는 높이가 늘고 줄며 열리고 닫힌다. `chevron`에 다른 아이콘을 넘기면 그것을 돌린다.
|
|
1253
|
+
- `pressEffect={false}`면 행을 누를 때 배경이 한 단계 진해지는 눌림 효과(딤)를 뺀다. 기본 true.
|
|
941
1254
|
|
|
942
1255
|
`track`을 주면 링크·버튼 항목을 고를 때 `navigate`와 그 항목의 `key`를 `value`에 담아 사용 로그로 보낸다. 그룹을 펼치고 접는 것은 보내지 않는다.
|
|
943
1256
|
|
|
@@ -1004,7 +1317,7 @@ import Link from 'next/link';
|
|
|
1004
1317
|
/>
|
|
1005
1318
|
```
|
|
1006
1319
|
|
|
1007
|
-
**모션.** press · expand. 토큰 값과 규칙은 `motion.md`.
|
|
1320
|
+
**모션.** press(`pressEffect`) · expand · unfold. 토큰 값과 규칙은 `motion.md`.
|
|
1008
1321
|
|
|
1009
1322
|
### props
|
|
1010
1323
|
|
|
@@ -1025,6 +1338,7 @@ import Link from 'next/link';
|
|
|
1025
1338
|
| `style` | `CSSProperties` | | |
|
|
1026
1339
|
| `track` | `string` | | |
|
|
1027
1340
|
| `trackProps` | `Record<string, string \| number \| boolean>` | | |
|
|
1341
|
+
| `pressEffect` | `boolean` | | `true` |
|
|
1028
1342
|
|
|
1029
1343
|
이 밖에 React·HTML 기본 속성 2개를 받는다.
|
|
1030
1344
|
|
|
@@ -1035,12 +1349,12 @@ import { Text } from '@nurihaus/web-design-system/text'; // 이 컴포넌트
|
|
|
1035
1349
|
import { Text } from '@nurihaus/web-design-system'; // 루트. 첫 로드 JS 가 커진다
|
|
1036
1350
|
```
|
|
1037
1351
|
|
|
1038
|
-
**언제 쓴다.** 제목, 본문, 설명처럼 화면에 글자를 표시할 때 쓴다. `size`와 `weight`로 타이포그래피 토큰을, `color`로
|
|
1352
|
+
**언제 쓴다.** 제목, 본문, 설명처럼 화면에 글자를 표시할 때 쓴다. `size`와 `weight`로 타이포그래피 토큰을, `color`로 색을 고르고(의미 이름 `text-primary`·`text-secondary`… 는 다크를 따라가고, 원시 이름 `grey-scale-900` 은 라이트 값에 묶인다), `as`로 태그를 고른다(기본값 `p`).
|
|
1039
1353
|
|
|
1040
1354
|
**쓰지 않는다.** 클릭 가능한 텍스트에는 쓰지 않는다. `onClick`, `id` 같은 HTML 속성은 타입상 받지만 요소에 전달되지 않고 `className`과 `style`만 전달된다. 버튼 문구는 CTAButton의 `text`에 문자열로 넘긴다.
|
|
1041
1355
|
|
|
1042
1356
|
```tsx
|
|
1043
|
-
<Text as="h2" text="캠페인 목록" size="xl" weight="bold" color="
|
|
1357
|
+
<Text as="h2" text="캠페인 목록" size="xl" weight="bold" color="text-body" />
|
|
1044
1358
|
```
|
|
1045
1359
|
|
|
1046
1360
|
**모션.** 없음. 글자만 그린다.
|
|
@@ -1052,12 +1366,12 @@ import { Text } from '@nurihaus/web-design-system'; // 루트. 첫
|
|
|
1052
1366
|
| `text` | `ReactNode` | 예 | |
|
|
1053
1367
|
| `size` | `'base' \| 'xl' \| 'xsm' \| 'sm' \| 'lg' \| '2xl' \| '3xl' \| '4xl' \| '5xl' \| '6xl'` | 예 | |
|
|
1054
1368
|
| `weight` | `'regular' \| 'medium' \| 'semibold' \| 'bold' \| 'extrabold'` | 예 | |
|
|
1055
|
-
| `color` | `'transparent' \| 'purple-50' \| 'purple-100' \| 'purple-200' \| 'purple-300' \| 'purple-400' \| 'purple-500' \| 'purple-600' \| 'purple-700' \| 'purple-800' \| 'purple-900' \| 'grey-scale-50' \| 'grey-scale-100' \| 'grey-scale-200' \| 'grey-scale-300' \| 'grey-scale-400' \| 'grey-scale-500' \| 'grey-scale-600' \| 'grey-scale-700' \| 'grey-scale-800' \| 'grey-scale-900' \| 'accent-red-50' \| 'accent-red-100' \| 'accent-red-200' \| 'accent-red-300' \| 'accent-red-400' \| 'accent-red-500' \| 'accent-red-600' \| 'accent-red-700' \| 'accent-red-800' \| 'accent-red-900' \| 'accent-pink-50' \| 'accent-pink-100' \| 'accent-pink-200' \| 'accent-pink-300' \| 'accent-pink-400' \| 'accent-pink-500' \| 'accent-pink-600' \| 'accent-pink-700' \| 'accent-pink-800' \| 'accent-pink-900' \| 'accent-magenta-50' \| 'accent-magenta-100' \| 'accent-magenta-200' \| 'accent-magenta-300' \| 'accent-magenta-400' \| 'accent-magenta-500' \| 'accent-magenta-600' \| 'accent-magenta-700' \| 'accent-magenta-800' \| 'accent-magenta-900' \| 'accent-blue-50' \| 'accent-blue-100' \| 'accent-blue-200' \| 'accent-blue-300' \| 'accent-blue-400' \| 'accent-blue-500' \| 'accent-blue-600' \| 'accent-blue-700' \| 'accent-blue-800' \| 'accent-blue-900' \| 'accent-mint-50' \| 'accent-mint-100' \| 'accent-mint-200' \| 'accent-mint-300' \| 'accent-mint-400' \| 'accent-mint-500' \| 'accent-mint-600' \| 'accent-mint-700' \| 'accent-mint-800' \| 'accent-mint-900' \| 'accent-green-50' \| 'accent-green-100' \| 'accent-green-200' \| 'accent-green-300' \| 'accent-green-400' \| 'accent-green-500' \| 'accent-green-600' \| 'accent-green-700' \| 'accent-green-800' \| 'accent-green-900' \| 'accent-yellow-50' \| 'accent-yellow-100' \| 'accent-yellow-200' \| 'accent-yellow-300' \| 'accent-yellow-400' \| 'accent-yellow-500' \| 'accent-yellow-600' \| 'accent-yellow-700' \| 'accent-yellow-800' \| 'accent-yellow-900' \| 'accent-orange-50' \| 'accent-orange-100' \| 'accent-orange-200' \| 'accent-orange-300' \| 'accent-orange-400' \| 'accent-orange-500' \| 'accent-orange-600' \| 'accent-orange-700' \| 'accent-orange-800' \| 'accent-orange-900' \| 'black' \| 'white'` | | |
|
|
1369
|
+
| `color` | `'transparent' \| 'text-primary' \| 'text-body' \| 'text-secondary' \| 'text-tertiary' \| 'text-muted' \| 'text-placeholder' \| 'text-disabled' \| 'text-inverse' \| 'text-on-brand' \| 'text-on-brand-subtle' \| 'text-on-overlay' \| 'text-on-disabled' \| 'text-brand' \| 'text-brand-active' \| 'text-brand-emphasis' \| 'text-brand-secondary' \| 'text-danger' \| 'text-error' \| 'text-success' \| 'text-warning' \| 'purple-50' \| 'purple-100' \| 'purple-200' \| 'purple-300' \| 'purple-400' \| 'purple-500' \| 'purple-600' \| 'purple-700' \| 'purple-800' \| 'purple-900' \| 'grey-scale-50' \| 'grey-scale-100' \| 'grey-scale-200' \| 'grey-scale-300' \| 'grey-scale-400' \| 'grey-scale-500' \| 'grey-scale-600' \| 'grey-scale-700' \| 'grey-scale-800' \| 'grey-scale-900' \| 'accent-red-50' \| 'accent-red-100' \| 'accent-red-200' \| 'accent-red-300' \| 'accent-red-400' \| 'accent-red-500' \| 'accent-red-600' \| 'accent-red-700' \| 'accent-red-800' \| 'accent-red-900' \| 'accent-pink-50' \| 'accent-pink-100' \| 'accent-pink-200' \| 'accent-pink-300' \| 'accent-pink-400' \| 'accent-pink-500' \| 'accent-pink-600' \| 'accent-pink-700' \| 'accent-pink-800' \| 'accent-pink-900' \| 'accent-magenta-50' \| 'accent-magenta-100' \| 'accent-magenta-200' \| 'accent-magenta-300' \| 'accent-magenta-400' \| 'accent-magenta-500' \| 'accent-magenta-600' \| 'accent-magenta-700' \| 'accent-magenta-800' \| 'accent-magenta-900' \| 'accent-blue-50' \| 'accent-blue-100' \| 'accent-blue-200' \| 'accent-blue-300' \| 'accent-blue-400' \| 'accent-blue-500' \| 'accent-blue-600' \| 'accent-blue-700' \| 'accent-blue-800' \| 'accent-blue-900' \| 'accent-mint-50' \| 'accent-mint-100' \| 'accent-mint-200' \| 'accent-mint-300' \| 'accent-mint-400' \| 'accent-mint-500' \| 'accent-mint-600' \| 'accent-mint-700' \| 'accent-mint-800' \| 'accent-mint-900' \| 'accent-green-50' \| 'accent-green-100' \| 'accent-green-200' \| 'accent-green-300' \| 'accent-green-400' \| 'accent-green-500' \| 'accent-green-600' \| 'accent-green-700' \| 'accent-green-800' \| 'accent-green-900' \| 'accent-yellow-50' \| 'accent-yellow-100' \| 'accent-yellow-200' \| 'accent-yellow-300' \| 'accent-yellow-400' \| 'accent-yellow-500' \| 'accent-yellow-600' \| 'accent-yellow-700' \| 'accent-yellow-800' \| 'accent-yellow-900' \| 'accent-orange-50' \| 'accent-orange-100' \| 'accent-orange-200' \| 'accent-orange-300' \| 'accent-orange-400' \| 'accent-orange-500' \| 'accent-orange-600' \| 'accent-orange-700' \| 'accent-orange-800' \| 'accent-orange-900' \| 'black' \| 'white'` | | |
|
|
1056
1370
|
| `textDecoration` | `TextDecoration<string \| number>` | | |
|
|
1057
1371
|
| `textAlign` | `TextAlign` | | |
|
|
1058
1372
|
| `wordBreak` | `WordBreak` | | |
|
|
1059
1373
|
| `whiteSpace` | `WhiteSpace` | | |
|
|
1060
|
-
| `as` | `'h1' \| 'h2' \| 'h3' \| 'h4' \| 'h5' \| 'h6' \| 'p' \| '
|
|
1374
|
+
| `as` | `'span' \| 'h1' \| 'h2' \| 'h3' \| 'h4' \| 'h5' \| 'h6' \| 'p' \| 'strong'` | | |
|
|
1061
1375
|
|
|
1062
1376
|
이 밖에 React·HTML 기본 속성 265개를 받는다.
|
|
1063
1377
|
|
|
@@ -1070,6 +1384,9 @@ import { Tooltip } from '@nurihaus/web-design-system'; // 루트.
|
|
|
1070
1384
|
|
|
1071
1385
|
**언제 쓴다.** 아이콘이나 짧은 라벨에 마우스를 올렸을 때 짧은 설명을 띄울 때 쓴다. `trigger`에는 DOM 요소 하나(예: `<span>`)를 넘기고 `direction`으로 뜨는 방향을 고른다. 조건이 맞을 때만 띄우려면 `open`을 제어하지 말고 `disabled`를 쓴다(예: 사이드바가 접혔을 때만 `disabled={!collapsed}`). `disabled`이면 `trigger`만 그려 툴팁이 열린 채 남지 않는다.
|
|
1072
1386
|
|
|
1387
|
+
- `motion`(`weak`·`strong`, 기본 `weak`)은 등장 세기다. `strong`은 스프링으로 끝에서 한 번 튄다. 툴팁은 뜨는 방향의 반대쪽, 곧 트리거 쪽에서 밀려 나오고 흐려지며 사라진다.
|
|
1388
|
+
- `onEntered`는 등장 애니메이션이 끝난 뒤, `onExited`는 퇴장 애니메이션이 끝나 툴팁이 사라진 뒤 한 번 불린다. reduced-motion 이면 열고 닫는 즉시 불린다.
|
|
1389
|
+
|
|
1073
1390
|
`track`을 주면 툴팁이 열릴 때 `show`를 사용 로그로 보낸다. 닫힐 때와 `disabled`일 때는 보내지 않는다.
|
|
1074
1391
|
|
|
1075
1392
|
**쓰지 않는다.** 툴팁 안에 링크나 버튼처럼 클릭할 내용을 넣지 않는다. 툴팁 위로 마우스를 옮기면 닫힌다. 배지에 설명을 붙일 때는 OptionBadge, IconTextBadge의 `tooltip` prop을 쓴다.
|
|
@@ -1078,7 +1395,7 @@ import { Tooltip } from '@nurihaus/web-design-system'; // 루트.
|
|
|
1078
1395
|
<Tooltip trigger={<span>도움말</span>} content="최근 30일 기준입니다." direction="top" disabled={false} />
|
|
1079
1396
|
```
|
|
1080
1397
|
|
|
1081
|
-
**모션.** enter · exit. 토큰 값과 규칙은 `motion.md`.
|
|
1398
|
+
**모션.** enter(`motion`, `onEntered`) · exit(`onExited`). 토큰 값과 규칙은 `motion.md`.
|
|
1082
1399
|
|
|
1083
1400
|
### props
|
|
1084
1401
|
|
|
@@ -1095,6 +1412,9 @@ import { Tooltip } from '@nurihaus/web-design-system'; // 루트.
|
|
|
1095
1412
|
| `disableHoverableContent` | `boolean` | | |
|
|
1096
1413
|
| `track` | `string` | | |
|
|
1097
1414
|
| `trackProps` | `Record<string, string \| number \| boolean>` | | |
|
|
1415
|
+
| `motion` | `MotionStrength` | | `'weak'` |
|
|
1416
|
+
| `onEntered` | `(() => void)` | | |
|
|
1417
|
+
| `onExited` | `(() => void)` | | |
|
|
1098
1418
|
|
|
1099
1419
|
이 밖에 React·HTML 기본 속성 2개를 받는다.
|
|
1100
1420
|
|
|
@@ -1136,6 +1456,10 @@ import { Tabs } from '@nurihaus/web-design-system'; // 루트. 첫
|
|
|
1136
1456
|
|
|
1137
1457
|
**언제 쓴다.** 같은 화면 안에서 여러 패널 중 하나를 골라 보여줄 때 쓴다. `items`의 각 항목이 탭 라벨과 패널 내용을 함께 가지며, `defaultValue`나 `value`를 주지 않으면 처음에 어떤 탭도 선택되지 않는다.
|
|
1138
1458
|
|
|
1459
|
+
- `pressEffect`(기본 `true`): 탭을 누르는 동안 선택 배경과 같은 보라 색조로 살짝 어두워진다(줄어들지는 않는다). 떼면 인디케이터가 그 자리로 미끄러진다. `false`면 끈다.
|
|
1460
|
+
- `fullWidth`(기본 `false`): 탭들이 목록 너비를 똑같이 나눠 갖는다. 탭이 두세 개뿐인 모바일 화면에 쓴다.
|
|
1461
|
+
- `underline` 목록이 넘쳐 가로로 밀려 있으면 왼쪽 끝에 화살표가 나타나고, 누르면 처음 탭으로 스크롤한다.
|
|
1462
|
+
|
|
1139
1463
|
**쓰지 않는다.** 다른 페이지로 이동하는 내비게이션은 CollapsibleMenu를 쓴다. 폼에서 값 하나를 고르는 입력은 Radio를 쓴다.
|
|
1140
1464
|
|
|
1141
1465
|
```tsx
|
|
@@ -1149,21 +1473,23 @@ import { Tabs } from '@nurihaus/web-design-system'; // 루트. 첫
|
|
|
1149
1473
|
/>
|
|
1150
1474
|
```
|
|
1151
1475
|
|
|
1152
|
-
**모션.** press ·
|
|
1476
|
+
**모션.** press(`pressEffect`) · indicate · enter. 토큰 값과 규칙은 `motion.md`.
|
|
1153
1477
|
|
|
1154
1478
|
### props
|
|
1155
1479
|
|
|
1156
1480
|
| prop | 타입 | 필수 | 기본값 |
|
|
1157
1481
|
| --- | --- | --- | --- |
|
|
1158
1482
|
| `items` | `TabsItem[]` | 예 | |
|
|
1159
|
-
| `variant` | `'
|
|
1483
|
+
| `variant` | `'filled' \| 'underline'` | | `'underline'` |
|
|
1160
1484
|
| `value` | `TabsValue` | | |
|
|
1161
1485
|
| `defaultValue` | `TabsValue` | | |
|
|
1162
1486
|
| `onValueChange` | `((id: TabsValue) => void)` | | |
|
|
1487
|
+
| `fullWidth` | `boolean` | | `false` |
|
|
1163
1488
|
| `className` | `string` | | |
|
|
1164
1489
|
| `style` | `CSSProperties` | | |
|
|
1165
1490
|
| `track` | `string` | | |
|
|
1166
1491
|
| `trackProps` | `Record<string, string \| number \| boolean>` | | |
|
|
1492
|
+
| `pressEffect` | `boolean` | | `true` |
|
|
1167
1493
|
|
|
1168
1494
|
이 밖에 React·HTML 기본 속성 2개를 받는다.
|
|
1169
1495
|
|
|
@@ -1174,9 +1500,9 @@ import { ModalWithDoubleButton } from '@nurihaus/web-design-system/modal-with-do
|
|
|
1174
1500
|
import { ModalWithDoubleButton } from '@nurihaus/web-design-system'; // 루트. 첫 로드 JS 가 커진다
|
|
1175
1501
|
```
|
|
1176
1502
|
|
|
1177
|
-
**언제 쓴다.** 삭제 확인처럼 제목, 설명, 버튼 두 개로 된 확인 대화상자에 쓴다. `ModalWithDoubleButton.Row`는 버튼을 가로로, `ModalWithDoubleButton.Column`은 세로로 배치하며, `left`와 `right`는 CTAButton props를 그대로 받는다.
|
|
1503
|
+
**언제 쓴다.** 삭제 확인처럼 제목, 설명, 버튼 두 개로 된 확인 대화상자에 쓴다. `ModalWithDoubleButton.Row`는 버튼을 가로로, `ModalWithDoubleButton.Column`은 세로로 배치하며, `left`와 `right`는 CTAButton props를 그대로 받는다. `content`가 길면 `content`만 스크롤되고 X 아이콘·제목과 두 버튼은 제자리에 있다.
|
|
1178
1504
|
|
|
1179
|
-
**열고 닫기.** `open`·`onOpenChange`를 넘기면 부모가 열림을 정한다. 열리면 포커스가 창 안으로 들어가고, Esc·바깥 누름·X 아이콘(`showCloseIcon`)·두 버튼이 `onOpenChange(false)`를 부르며, 닫히면 포커스가 연 요소로 돌아온다. 바텀시트 안의 삭제 확인처럼 키보드로 닿아야 하는 곳은 이 방식으로 쓴다.
|
|
1505
|
+
**열고 닫기.** `open`·`onOpenChange`를 넘기면 부모가 열림을 정한다. 열리면 포커스가 창 안으로 들어가고, Esc·바깥 누름·X 아이콘(`showCloseIcon`)·두 버튼이 `onOpenChange(false)`를 부르며, 닫히면 포커스가 연 요소로 돌아온다. 바텀시트 안의 삭제 확인처럼 키보드로 닿아야 하는 곳은 이 방식으로 쓴다. 이때 `onEntered` · `onExited` 가 Modal 과 같이 불리고, `closeOnBackEvent`(기본 true)면 뒤로 가기가 페이지를 떠나지 않고 `onOpenChange(false)` 를 부른다(버튼·Esc 로 닫으면 쌓은 history 항목을 되돌린다), `portalContainer` 를 주면 그 요소 안에 그린다. 답만 받으면 되는 삭제 확인은 state 없이 `useDialog().confirm` 으로 연다(OverlayProvider).
|
|
1180
1506
|
|
|
1181
1507
|
```tsx
|
|
1182
1508
|
<ModalWithDoubleButton.Row
|
|
@@ -1198,11 +1524,11 @@ import { ModalWithDoubleButton } from '@nurihaus/web-design-system';
|
|
|
1198
1524
|
title="항목을 삭제할까요?"
|
|
1199
1525
|
subTitle="삭제하면 되돌릴 수 없습니다."
|
|
1200
1526
|
left={{ text: '취소', onClick: () => {} }}
|
|
1201
|
-
right={{ text: '삭제',
|
|
1527
|
+
right={{ text: '삭제', color: 'danger', onClick: () => {} }}
|
|
1202
1528
|
/>
|
|
1203
1529
|
```
|
|
1204
1530
|
|
|
1205
|
-
**모션.** enter · exit. 토큰 값과 규칙은 `motion.md`.
|
|
1531
|
+
**모션.** enter(`onEntered`) · exit(`onExited`). 토큰 값과 규칙은 `motion.md`.
|
|
1206
1532
|
|
|
1207
1533
|
### ModalWithDoubleButton.Row props
|
|
1208
1534
|
|
|
@@ -1219,6 +1545,10 @@ import { ModalWithDoubleButton } from '@nurihaus/web-design-system';
|
|
|
1219
1545
|
| `left` | `CTAButtonProps` | 예 | |
|
|
1220
1546
|
| `right` | `CTAButtonProps` | 예 | |
|
|
1221
1547
|
| `size` | `'s' \| 'm' \| 'l'` | | `'m'` |
|
|
1548
|
+
| `portalContainer` | `HTMLElement` | | |
|
|
1549
|
+
| `closeOnBackEvent` | `boolean` | | `true` |
|
|
1550
|
+
| `onEntered` | `(() => void)` | | |
|
|
1551
|
+
| `onExited` | `(() => void)` | | |
|
|
1222
1552
|
|
|
1223
1553
|
이 밖에 React·HTML 기본 속성 2개를 받는다.
|
|
1224
1554
|
|
|
@@ -1237,6 +1567,10 @@ import { ModalWithDoubleButton } from '@nurihaus/web-design-system';
|
|
|
1237
1567
|
| `left` | `CTAButtonProps` | 예 | |
|
|
1238
1568
|
| `right` | `CTAButtonProps` | 예 | |
|
|
1239
1569
|
| `size` | `'s' \| 'm' \| 'l'` | | `'m'` |
|
|
1570
|
+
| `portalContainer` | `HTMLElement` | | |
|
|
1571
|
+
| `closeOnBackEvent` | `boolean` | | `true` |
|
|
1572
|
+
| `onEntered` | `(() => void)` | | |
|
|
1573
|
+
| `onExited` | `(() => void)` | | |
|
|
1240
1574
|
|
|
1241
1575
|
이 밖에 React·HTML 기본 속성 2개를 받는다.
|
|
1242
1576
|
|
|
@@ -1247,15 +1581,20 @@ import { Spinner } from '@nurihaus/web-design-system/loading'; // 이 컴포
|
|
|
1247
1581
|
import { Spinner } from '@nurihaus/web-design-system'; // 루트. 첫 로드 JS 가 커진다
|
|
1248
1582
|
```
|
|
1249
1583
|
|
|
1250
|
-
**언제 쓴다.**
|
|
1584
|
+
**언제 쓴다.** 아이콘 자리처럼 글자 한 줄보다 좁은 자리(IconButton, 입력창 끝)에 딸린 기다림에 쓴다. 링 하나만 돌고 글자가 없다. 무엇을 기다리는지는 감싸는 요소가 보여 준다. InlineLoading · OverlayLoading 이 이 링을 쓴다. 버튼은 점(LoadingDots)이다.
|
|
1585
|
+
|
|
1586
|
+
- `size`: `'s' | 'm' | 'l'`, 기본 `'m'`. 16·20·40px. 선 두께도 함께 바뀐다.
|
|
1587
|
+
- `variant`: `'neutral' | 'brand' | 'inverse'`, 기본 `'neutral'`. 흰 바탕의 회색, 보라, 보라·어두운 바탕 위의 흰색. 표에 없는 색은 `className`·`style` 의 `color` 로 덮는다(우선순위 0).
|
|
1588
|
+
- `delay`: 기본 `true`. 300ms 안에 끝나면 보이지 않는다. 자리는 처음부터 잡는다. 바로 보여야 하면 `false`.
|
|
1589
|
+
- 화면 읽기 프로그램에 알리지 않는다. 감싸는 요소가 `aria-busy` 나 글자로 알린다. 화면에 혼자 놓이면 InlineLoading 을 쓴다.
|
|
1251
1590
|
|
|
1252
|
-
**쓰지 않는다.** 버튼 로딩은 CTAButton의 `loading
|
|
1591
|
+
**쓰지 않는다.** 버튼 로딩은 CTAButton 의 `loading`, 영역을 채우거나 글자를 붙이면 InlineLoading, 진행률을 알면 ProgressBar, 화면 전체를 막으면 OverlayLoading 을 쓴다. 컴포넌트 안에서 링·점·막대를 따로 그리지 않는다(빌드 R21).
|
|
1253
1592
|
|
|
1254
1593
|
```tsx
|
|
1255
|
-
<Spinner
|
|
1594
|
+
<Spinner size="s" variant="brand" />
|
|
1256
1595
|
```
|
|
1257
1596
|
|
|
1258
|
-
**모션.** busy. 토큰 값과 규칙은 `motion.md`.
|
|
1597
|
+
**모션.** busy(`delay`). 토큰 값과 규칙은 `motion.md`.
|
|
1259
1598
|
|
|
1260
1599
|
### props
|
|
1261
1600
|
|
|
@@ -1263,6 +1602,9 @@ import { Spinner } from '@nurihaus/web-design-system'; // 루트.
|
|
|
1263
1602
|
| --- | --- | --- | --- |
|
|
1264
1603
|
| `className` | `string` | | |
|
|
1265
1604
|
| `style` | `CSSProperties` | | |
|
|
1605
|
+
| `size` | `'s' \| 'm' \| 'l'` | | |
|
|
1606
|
+
| `variant` | `'neutral' \| 'brand' \| 'inverse'` | | |
|
|
1607
|
+
| `delay` | `boolean` | | `true` |
|
|
1266
1608
|
|
|
1267
1609
|
이 밖에 React·HTML 기본 속성 2개를 받는다.
|
|
1268
1610
|
|
|
@@ -1273,24 +1615,32 @@ import { InlineLoading } from '@nurihaus/web-design-system/loading'; // 이
|
|
|
1273
1615
|
import { InlineLoading } from '@nurihaus/web-design-system'; // 루트. 첫 로드 JS 가 커진다
|
|
1274
1616
|
```
|
|
1275
1617
|
|
|
1276
|
-
**언제 쓴다.**
|
|
1618
|
+
**언제 쓴다.** 화면에 혼자 놓이는 로딩이다. 목록 끝에서 더 불러올 때나 들어올 내용의 모양을 모르는 영역을 채울 때 쓴다. 링 옆에 글자를 두고 `role="status"` 로 알린다. 글자가 있어서 링만 있는 Spinner 와 구분된다.
|
|
1277
1619
|
|
|
1278
|
-
|
|
1620
|
+
- `label`: 링 옆 글자. 기본 `'불러오는 중'`. 무엇을 기다리는지 쓴다(예: '댓글을 불러오는 중'). 링과 같은 색이다. `false` 면 정말 좁은 자리라 글자를 빼고 `aria-label="불러오는 중"` 만 단다.
|
|
1621
|
+
- `size`·`variant`·`delay`: Spinner 와 같다. `s`·`m` 은 가로로, `l` 은 세로로 놓여 빈 영역 가운데를 채운다.
|
|
1622
|
+
- `justifyContent`: `'flex-start' | 'center' | 'flex-end' | 'space-between'`, 기본 `'flex-start'`.
|
|
1623
|
+
- 예전의 `size={24}` 같은 px 숫자는 받지 않는다. `'s' | 'm' | 'l'` 로 바꾼다.
|
|
1624
|
+
|
|
1625
|
+
**쓰지 않는다.** 모양을 아는 첫 화면은 Skeleton, 다른 조작을 막아야 하면 OverlayLoading, 버튼 안 로딩은 CTAButton 의 `loading`, 다른 요소 안에 딸린 링은 Spinner 를 쓴다.
|
|
1279
1626
|
|
|
1280
1627
|
```tsx
|
|
1281
|
-
<InlineLoading
|
|
1628
|
+
<InlineLoading label="댓글을 불러오는 중" justifyContent="center" />
|
|
1282
1629
|
```
|
|
1283
1630
|
|
|
1284
|
-
**모션.** busy. 토큰 값과 규칙은 `motion.md`.
|
|
1631
|
+
**모션.** busy(`delay`). 토큰 값과 규칙은 `motion.md`.
|
|
1285
1632
|
|
|
1286
1633
|
### props
|
|
1287
1634
|
|
|
1288
1635
|
| prop | 타입 | 필수 | 기본값 |
|
|
1289
1636
|
| --- | --- | --- | --- |
|
|
1290
|
-
| `
|
|
1637
|
+
| `label` | `ReactNode` | | `DEFAULT_LABEL` |
|
|
1291
1638
|
| `justifyContent` | `'center' \| 'flex-start' \| 'flex-end' \| 'space-between'` | | `'flex-start'` |
|
|
1292
1639
|
| `className` | `string` | | |
|
|
1293
1640
|
| `style` | `CSSProperties` | | |
|
|
1641
|
+
| `size` | `'s' \| 'm' \| 'l'` | | `'m'` |
|
|
1642
|
+
| `variant` | `'neutral' \| 'brand' \| 'inverse'` | | `'neutral'` |
|
|
1643
|
+
| `delay` | `boolean` | | `true` |
|
|
1294
1644
|
|
|
1295
1645
|
이 밖에 React·HTML 기본 속성 2개를 받는다.
|
|
1296
1646
|
|
|
@@ -1301,15 +1651,20 @@ import { OverlayLoading } from '@nurihaus/web-design-system/loading'; // 이
|
|
|
1301
1651
|
import { OverlayLoading } from '@nurihaus/web-design-system'; // 루트. 첫 로드 JS 가 커진다
|
|
1302
1652
|
```
|
|
1303
1653
|
|
|
1304
|
-
**언제 쓴다.**
|
|
1654
|
+
**언제 쓴다.** 저장·결제처럼 끝날 때까지 화면 전체 조작을 막아야 할 때 쓴다. 화면 전체를 반투명 배경으로 덮고 가운데에 흰 Spinner(l)와 `message` 를 띄운다. `open` 이 false 면 아무것도 렌더하지 않는다.
|
|
1655
|
+
|
|
1656
|
+
- `progress`: 0~100. 주면 Spinner 대신 흰 ProgressBar 를 그린다. 여러 장을 올리는 업로드처럼 막아야 하고 진행률도 알 때 쓴다. 막대의 이름은 `message` 다.
|
|
1657
|
+
- `delay`: 기본 `true`. 300ms 안에 끝나면 덮개가 보이지 않는다. 조작은 처음부터 막는다.
|
|
1658
|
+
- `backdropOpacity`: 기본 0.6. `zIndex`: 기본 1200.
|
|
1659
|
+
- `open` 이 true 가 되면 흐리게 나타나고 false 면 애니메이션 없이 바로 사라진다.
|
|
1305
1660
|
|
|
1306
|
-
**쓰지 않는다.** 화면 일부만
|
|
1661
|
+
**쓰지 않는다.** 화면 일부만 기다리면 InlineLoading, 버튼 하나만 처리 중이면 CTAButton 의 `loading` 을 쓴다.
|
|
1307
1662
|
|
|
1308
1663
|
```tsx
|
|
1309
|
-
<OverlayLoading open={true} message="
|
|
1664
|
+
<OverlayLoading open={true} message="사진 올리는 중 2/5" progress={40} />
|
|
1310
1665
|
```
|
|
1311
1666
|
|
|
1312
|
-
**모션.** busy · enter
|
|
1667
|
+
**모션.** busy(`delay`) · enter. 토큰 값과 규칙은 `motion.md`.
|
|
1313
1668
|
|
|
1314
1669
|
### props
|
|
1315
1670
|
|
|
@@ -1317,6 +1672,8 @@ import { OverlayLoading } from '@nurihaus/web-design-system'; // 루
|
|
|
1317
1672
|
| --- | --- | --- | --- |
|
|
1318
1673
|
| `open` | `boolean` | | `true` |
|
|
1319
1674
|
| `message` | `string` | | |
|
|
1675
|
+
| `progress` | `number` | | |
|
|
1676
|
+
| `delay` | `boolean` | | `true` |
|
|
1320
1677
|
| `backdropOpacity` | `number` | | `0.6` |
|
|
1321
1678
|
| `zIndex` | `number` | | `1200` |
|
|
1322
1679
|
| `className` | `string` | | |
|
|
@@ -1324,6 +1681,79 @@ import { OverlayLoading } from '@nurihaus/web-design-system'; // 루
|
|
|
1324
1681
|
|
|
1325
1682
|
이 밖에 React·HTML 기본 속성 2개를 받는다.
|
|
1326
1683
|
|
|
1684
|
+
## ProgressBar
|
|
1685
|
+
|
|
1686
|
+
```ts
|
|
1687
|
+
import { ProgressBar } from '@nurihaus/web-design-system/loading'; // 이 컴포넌트만 싣는다 (권장)
|
|
1688
|
+
import { ProgressBar } from '@nurihaus/web-design-system'; // 루트. 첫 로드 JS 가 커진다
|
|
1689
|
+
```
|
|
1690
|
+
|
|
1691
|
+
**언제 쓴다.** 업로드·내보내기처럼 진행률을 아는 작업에 쓴다. `value` 를 빼면 끝을 모르는 진행이라 막대가 왼쪽에서 오른쪽으로 지난다(페이지 위쪽의 가는 진행 표시 등). `role="progressbar"` 와 `aria-valuenow` 를 단다.
|
|
1692
|
+
|
|
1693
|
+
- `label`: 필수. `aria-label` 로 붙는다(예: '업로드 진행률').
|
|
1694
|
+
- `value`: 0~`max`. 밖의 값은 끝으로 맞춘다. 없거나 `null` 이면 끝을 모르는 진행이다.
|
|
1695
|
+
- `max`: 기본 100.
|
|
1696
|
+
- `animated`: 기본 `true`. `value` 가 바뀌면 막대가 차오른다. 처음 그릴 때는 전환이 없다.
|
|
1697
|
+
- `size`: `'s' | 'm' | 'l'`, 기본 `'m'`. 두께 2·4·8px. 폭은 부모를 채운다.
|
|
1698
|
+
- `variant`: 기본 `'brand'`(막대는 채움 자체가 정보라서). `'neutral'`·`'inverse'` 는 Spinner 와 같다.
|
|
1699
|
+
- `delay`: Spinner 와 같다.
|
|
1700
|
+
|
|
1701
|
+
**쓰지 않는다.** 단계 이름이 있는 진행은 StepProgress, 진행률을 모르면 InlineLoading 을 쓴다.
|
|
1702
|
+
|
|
1703
|
+
```tsx
|
|
1704
|
+
<ProgressBar value={40} label="업로드 진행률" />
|
|
1705
|
+
```
|
|
1706
|
+
|
|
1707
|
+
**모션.** busy(`animated`, `delay`) · progress(`animated`). 토큰 값과 규칙은 `motion.md`.
|
|
1708
|
+
|
|
1709
|
+
### props
|
|
1710
|
+
|
|
1711
|
+
| prop | 타입 | 필수 | 기본값 |
|
|
1712
|
+
| --- | --- | --- | --- |
|
|
1713
|
+
| `value` | `number \| null` | | |
|
|
1714
|
+
| `max` | `number` | | `100` |
|
|
1715
|
+
| `animated` | `boolean` | | `true` |
|
|
1716
|
+
| `label` | `string` | 예 | |
|
|
1717
|
+
| `className` | `string` | | |
|
|
1718
|
+
| `style` | `CSSProperties` | | |
|
|
1719
|
+
| `size` | `'s' \| 'm' \| 'l'` | | `'m'` |
|
|
1720
|
+
| `variant` | `'neutral' \| 'brand' \| 'inverse'` | | |
|
|
1721
|
+
| `delay` | `boolean` | | `true` |
|
|
1722
|
+
|
|
1723
|
+
이 밖에 React·HTML 기본 속성 2개를 받는다.
|
|
1724
|
+
|
|
1725
|
+
## LoadingDots
|
|
1726
|
+
|
|
1727
|
+
```ts
|
|
1728
|
+
import { LoadingDots } from '@nurihaus/web-design-system/loading'; // 이 컴포넌트만 싣는다 (권장)
|
|
1729
|
+
import { LoadingDots } from '@nurihaus/web-design-system'; // 루트. 첫 로드 JS 가 커진다
|
|
1730
|
+
```
|
|
1731
|
+
|
|
1732
|
+
**언제 쓴다.** "저장 중", "답변을 쓰는 중"처럼 문장 끝에 붙는 기다림과, 글자 한 줄 자리의 기다림(더 보기 행, 보내기 칸)에 쓴다. CTAButton 의 `loading` 도 안에서 이것을 띄운다. 점 셋이 차례로 밝아진다. 장식이라 `aria-hidden` 이고 상태는 곁의 글자가 알린다.
|
|
1733
|
+
|
|
1734
|
+
- `size`: `'s' | 'm' | 'l'`, 기본 `'m'`. 점 지름 4·6·8px. 본문 글자 옆에는 `s`.
|
|
1735
|
+
- `variant`·`delay`: Spinner 와 같다.
|
|
1736
|
+
|
|
1737
|
+
**쓰지 않는다.** 글자 없이 기다림만 보이면 Spinner 나 InlineLoading, 버튼 로딩은 CTAButton 의 `loading` 을 쓴다.
|
|
1738
|
+
|
|
1739
|
+
```tsx
|
|
1740
|
+
<LoadingDots size="s" variant="brand" />
|
|
1741
|
+
```
|
|
1742
|
+
|
|
1743
|
+
**모션.** busy(`delay`). 토큰 값과 규칙은 `motion.md`.
|
|
1744
|
+
|
|
1745
|
+
### props
|
|
1746
|
+
|
|
1747
|
+
| prop | 타입 | 필수 | 기본값 |
|
|
1748
|
+
| --- | --- | --- | --- |
|
|
1749
|
+
| `className` | `string` | | |
|
|
1750
|
+
| `style` | `CSSProperties` | | |
|
|
1751
|
+
| `size` | `'s' \| 'm' \| 'l'` | | |
|
|
1752
|
+
| `variant` | `'neutral' \| 'brand' \| 'inverse'` | | |
|
|
1753
|
+
| `delay` | `boolean` | | `true` |
|
|
1754
|
+
|
|
1755
|
+
이 밖에 React·HTML 기본 속성 2개를 받는다.
|
|
1756
|
+
|
|
1327
1757
|
## Icon
|
|
1328
1758
|
|
|
1329
1759
|
```ts
|
|
@@ -1357,9 +1787,9 @@ import { Icon } from '@nurihaus/web-design-system'; // 루트. 첫
|
|
|
1357
1787
|
|
|
1358
1788
|
| prop | 타입 | 필수 | 기본값 |
|
|
1359
1789
|
| --- | --- | --- | --- |
|
|
1360
|
-
| `size` | `'xs' \| 's' \| 'm' \| 'l' \| 'xl'` | | `'l'` |
|
|
1361
1790
|
| `label` | `string` | | |
|
|
1362
|
-
| `
|
|
1791
|
+
| `size` | `'xs' \| 's' \| 'm' \| 'l' \| 'xl'` | | `'l'` |
|
|
1792
|
+
| `name` | `'circle' \| 'link' \| 'image' \| 'x' \| 'warning' \| 'copy' \| 'house' \| 'megaphone-simple' \| 'chats-circle' \| 'user-circle' \| 'bell' \| 'caret-left' \| 'magnifying-glass' \| 'dots-three' \| 'gear-six' \| 'chat-circle' \| 'paper-plane-tilt' \| 'plus' \| 'camera' \| 'video-camera' \| 'play' \| 'upload-simple' \| 'calendar-blank' \| 'clock' \| 'map-pin' \| 'truck' \| 'ticket' \| 'qr-code' \| 'sparkle' \| 'gift' \| 'wallet' \| 'bank' \| 'credit-card' \| 'check-circle' \| 'check' \| 'info' \| 'question' \| 'lock' \| 'pencil-simple' \| 'trash' \| 'share-network' \| 'eye' \| 'sliders-horizontal' \| 'heart' \| 'star' \| 'globe' \| 'sign-out' \| 'caret-right' \| 'arrow-right' \| 'instagram-logo' \| 'tiktok-logo' \| 'youtube-logo'` | 예 | |
|
|
1363
1793
|
| `weight` | `'fill' \| 'regular'` | | |
|
|
1364
1794
|
|
|
1365
1795
|
이 밖에 React·HTML 기본 속성 474개를 받는다.
|
|
@@ -1379,6 +1809,11 @@ import { BottomNav } from '@nurihaus/web-design-system'; // 루트.
|
|
|
1379
1809
|
|
|
1380
1810
|
배지는 `badge` 로 단다. `count` 가 없으면 점, 있으면 숫자(99 넘으면 99+)다. `label` 은 화면 낭독기가 읽는 말이다.
|
|
1381
1811
|
|
|
1812
|
+
- `pressEffect`: 탭을 누르는 동안 살짝 작아진다. 기본 `true`, `false` 면 끈다.
|
|
1813
|
+
- `appear`: `{ animation: 'fade' | 'scale' | 'slide', delay?: ms }`. 처음 그릴 때 한 번 나타난다. 화면에 들어온 뒤 탭 바를 늦게 띄울 때 쓴다.
|
|
1814
|
+
- `hideOnScroll`: `true` 면 아래로 스크롤할 때 화면 밖으로 내리고 위로 스크롤하거나 맨 위에 오면 다시 올린다. 기본 `false`. 숨긴 동안에도 `aria-hidden` 은 달지 않고, 키보드로 탭에 들어오면 다시 올라온다.
|
|
1815
|
+
- `hideOnScrollThreshold`: 같은 방향으로 이만큼(px) 움직여야 숨기거나 올린다. 기본 `1`. 스크롤은 window 기준이다.
|
|
1816
|
+
|
|
1382
1817
|
**쓰지 않는다.** 같은 화면 안에서 패널을 바꾸는 것은 Tabs, 목록을 거르는 것은 ChipGroup 을 쓴다. 앱 웹뷰처럼 앱이 탭 바를 직접 그리는 곳에서는 그리지 않는다. 데스크톱 사이드바는 CollapsibleMenu 를 쓴다.
|
|
1383
1818
|
|
|
1384
1819
|
Next.js 에서는 `next/link` 의 `Link` 를 그대로 넘긴다.
|
|
@@ -1393,6 +1828,7 @@ import Link from 'next/link';
|
|
|
1393
1828
|
<BottomNav
|
|
1394
1829
|
label="주 메뉴"
|
|
1395
1830
|
value="home"
|
|
1831
|
+
hideOnScroll
|
|
1396
1832
|
items={[
|
|
1397
1833
|
{ id: 'home', label: '홈', icon: 'house', href: '/', badge: { label: '새 소식' } },
|
|
1398
1834
|
{ id: 'campaigns', label: '캠페인', icon: 'megaphone-simple', href: '/campaigns' },
|
|
@@ -1402,7 +1838,7 @@ import Link from 'next/link';
|
|
|
1402
1838
|
/>
|
|
1403
1839
|
```
|
|
1404
1840
|
|
|
1405
|
-
**모션.** press ·
|
|
1841
|
+
**모션.** press(`pressEffect`) · indicate · appear(opt, `appear`) · dismiss-on-scroll(opt, `hideOnScroll`). 토큰 값과 규칙은 `motion.md`.
|
|
1406
1842
|
|
|
1407
1843
|
### props
|
|
1408
1844
|
|
|
@@ -1416,6 +1852,10 @@ import Link from 'next/link';
|
|
|
1416
1852
|
| `style` | `CSSProperties` | | |
|
|
1417
1853
|
| `track` | `string` | | |
|
|
1418
1854
|
| `trackProps` | `Record<string, string \| number \| boolean>` | | |
|
|
1855
|
+
| `pressEffect` | `boolean` | | `true` |
|
|
1856
|
+
| `appear` | `{ animation: AppearAnimation; delay?: number \| undefined; }` | | |
|
|
1857
|
+
| `hideOnScroll` | `boolean` | | `false` |
|
|
1858
|
+
| `hideOnScrollThreshold` | `number` | | `1` |
|
|
1419
1859
|
|
|
1420
1860
|
이 밖에 React·HTML 기본 속성 2개를 받는다.
|
|
1421
1861
|
|
|
@@ -1428,6 +1868,14 @@ import { StepProgress } from '@nurihaus/web-design-system'; // 루
|
|
|
1428
1868
|
|
|
1429
1869
|
**언제 쓴다.** 정해진 단계를 차례로 밟는 일에서 "지금 어디까지 왔나"를 막대로 보여 준다(캠페인 진행: 가이드 → 제품 → 결과 제출 → 승인 → 보상). 단계마다 막대 하나가 끝남·지금·남음으로 칠해진다. `current` 는 지금 단계 순번(0부터)이고, `steps.length` 를 넘기면 모두 끝난 것이다. `labelVisibility="current"` 면 지금 단계 이름만 보인다(카드 안처럼 좁을 때). 다른 이름은 화면 낭독기가 읽는다. `label` 은 목록의 이름이다. `className`·`style` 은 `<ol>` 에 붙는다.
|
|
1430
1870
|
|
|
1871
|
+
- `size`: `'s' | 'm' | 'l'`, 기본 `'m'`. 막대 두께 2·4·8px(ProgressBar 와 같다)와 이름 글자·간격이 함께 바뀐다. 카드 안의 작은 표시는 `s`, 화면 위쪽의 주된 진행 표시는 `l`.
|
|
1872
|
+
- `animated`: `current` 가 바뀌면 막대가 왼쪽부터 차오르거나 줄어든다. 처음 그릴 때는 전환 없이 그린다. 기본 `true`, `false` 면 바로 바뀐다.
|
|
1873
|
+
- `stagger`: 처음 그릴 때 단계를 왼쪽부터 차례로 보인다. `true` 면 토큰 간격, 숫자면 단계 사이 간격(ms). `animated` 가 `true` 일 때만 돈다. 기본 `false`. 처음 그린 뒤 `steps` 가 늘어도 다시 돌지 않는다.
|
|
1874
|
+
- `delay`: `stagger` 의 첫 단계가 나타나기 전 기다리는 시간(ms).
|
|
1875
|
+
- `variant`: `'bar' | 'icon'`, 기본 `'bar'`. `'icon'` 이면 단계마다 둥근 표시를 칸 가운데에 두고 이음선으로 잇는다. 남은 단계는 테두리만 있는 표시에 단계의 아이콘이나 1부터의 번호, 지금 단계는 브랜드 색으로 채운 표시, 끝난 단계는 옅은 브랜드 색 표시다. 이음선은 지나간 단계에서 다음 단계까지 채워지고 `animated` 면 차오른다. 긴 이름은 말줄임 없이 줄을 바꾼다. 단계마다 아이콘이나 번호가 뜻을 더할 때(화면 위쪽 큰 진행 표시) 쓴다.
|
|
1876
|
+
- `checkForFinish`: `variant="icon"` 에서 끝난 단계의 표시를 체크로 바꾼다. 기본 `true`. `false` 면 끝난 단계도 자기 아이콘·번호를 끝남 색으로 둔다. `variant="bar"` 에서는 아무 일도 하지 않는다.
|
|
1877
|
+
- `steps` 의 항목은 이름(`ReactNode`) 또는 `StepItem`(`{ label, icon? }`)이다. `icon` 은 `variant="icon"` 의 표시 안에 들어간다(`<Icon name="gift" />`). 크기는 `size` 가 맞춘다. 두 모양을 섞어 써도 된다.
|
|
1878
|
+
|
|
1431
1879
|
**쓰지 않는다.** 단계를 눌러 이동하지 않는다(버튼이 없다). 다음 행동 버튼은 이 컴포넌트 밖, 카드에 둔다. 로딩 진행률(%)에는 쓰지 않는다.
|
|
1432
1880
|
|
|
1433
1881
|
```tsx
|
|
@@ -1436,19 +1884,39 @@ import { StepProgress } from '@nurihaus/web-design-system'; // 루
|
|
|
1436
1884
|
steps={['가이드', '제품', '결과 제출', '승인', '보상']}
|
|
1437
1885
|
current={2}
|
|
1438
1886
|
labelVisibility="current"
|
|
1887
|
+
stagger
|
|
1888
|
+
/>
|
|
1889
|
+
```
|
|
1890
|
+
|
|
1891
|
+
```tsx
|
|
1892
|
+
<StepProgress
|
|
1893
|
+
label="진행 단계"
|
|
1894
|
+
variant="icon"
|
|
1895
|
+
steps={[
|
|
1896
|
+
{ label: '가이드', icon: <Icon name="info" /> },
|
|
1897
|
+
{ label: '제품', icon: <Icon name="gift" /> },
|
|
1898
|
+
'결과 제출',
|
|
1899
|
+
]}
|
|
1900
|
+
current={1}
|
|
1439
1901
|
/>
|
|
1440
1902
|
```
|
|
1441
1903
|
|
|
1442
|
-
**모션.** progress · reveal(opt). 토큰 값과 규칙은 `motion.md`.
|
|
1904
|
+
**모션.** progress(`animated`) · reveal(opt, `animated`, `stagger`, `delay`). 토큰 값과 규칙은 `motion.md`.
|
|
1443
1905
|
|
|
1444
1906
|
### props
|
|
1445
1907
|
|
|
1446
1908
|
| prop | 타입 | 필수 | 기본값 |
|
|
1447
1909
|
| --- | --- | --- | --- |
|
|
1448
|
-
| `steps` | `ReactNode[]` | 예 | |
|
|
1910
|
+
| `steps` | `(ReactNode \| StepItem)[]` | 예 | |
|
|
1449
1911
|
| `current` | `number` | 예 | |
|
|
1912
|
+
| `size` | `'s' \| 'm' \| 'l'` | | `'m'` |
|
|
1450
1913
|
| `labelVisibility` | `'all' \| 'current'` | | `'all'` |
|
|
1914
|
+
| `variant` | `'icon' \| 'bar'` | | `'bar'` |
|
|
1915
|
+
| `checkForFinish` | `boolean` | | `true` |
|
|
1451
1916
|
| `label` | `string` | 예 | |
|
|
1917
|
+
| `animated` | `boolean` | | `true` |
|
|
1918
|
+
| `stagger` | `number \| boolean` | | `false` |
|
|
1919
|
+
| `delay` | `number` | | |
|
|
1452
1920
|
| `className` | `string` | | |
|
|
1453
1921
|
| `style` | `CSSProperties` | | |
|
|
1454
1922
|
|
|
@@ -1463,6 +1931,10 @@ import { ChipGroup } from '@nurihaus/web-design-system'; // 루트.
|
|
|
1463
1931
|
|
|
1464
1932
|
**언제 쓴다.** 목록 위에서 하나를 골라 목록을 거르는 필터다. 고르면 바로 `onValueChange` 가 불리고 적용 버튼은 없다. 늘 하나가 골라져 있고 고른 칩을 다시 눌러도 풀리지 않는다. `value`·`defaultValue` 가 없으면 첫 칩을 고른다. 넘치면 가로로 밀어서 본다. `count` 를 주면 라벨 옆에 개수가 붙는다. 0 인 칩은 `disabled` 로 막을 수 있다. 좌우 화살표 키로 칩 사이를 옮긴다. `label` 은 그룹의 이름이다. `className`·`style` 은 그룹(`role="group"`)에 붙는다.
|
|
1465
1933
|
|
|
1934
|
+
- `variant`(`'filled'` 기본 · `'outlined'` · `'ghost'`): 칩이 놓이는 바탕의 무게로 고른다. `filled` 는 페이지 바탕 위에 혼자 서서 목록을 거를 때(연회색 바탕과 선, 고르면 보라 채움). `outlined` 는 카드·시트·모달처럼 이미 상자 안에 들어갈 때(선만, 고르면 보라 선과 보라 글자). `ghost` 는 칩이 많거나 촘촘할 때, 또는 주 필터 옆의 보조 필터일 때(글자만, 고르면 연보라 바탕). 한 화면에 묶음이 둘이면 주 필터가 `filled`, 보조가 `ghost`. 같은 묶음 안에서 섞지 않는다.
|
|
1935
|
+
- `size`(`'s'` 기본 · `'xs'`): `s`(36px)는 페이지 바탕 위, `xs`(28px)는 카드·시트 안에서 `outlined`·`ghost` 와 함께 쓴다.
|
|
1936
|
+
- `pressEffect`(기본 `true`): 칩을 누르는 동안 살짝 줄어들고 어두워진다. `false`면 끈다.
|
|
1937
|
+
|
|
1466
1938
|
**쓰지 않는다.** 같은 화면 안에서 패널 내용을 바꾸는 것은 Tabs, 폼에서 값 하나를 고르는 입력은 Radio, 화면을 옮기는 메뉴는 BottomNav 를 쓴다. 여러 개를 함께 고르는 필터는 아직 없다.
|
|
1467
1939
|
|
|
1468
1940
|
```tsx
|
|
@@ -1479,7 +1951,7 @@ import { ChipGroup } from '@nurihaus/web-design-system'; // 루트.
|
|
|
1479
1951
|
/>
|
|
1480
1952
|
```
|
|
1481
1953
|
|
|
1482
|
-
**모션.** press · confirm. 토큰 값과 규칙은 `motion.md`.
|
|
1954
|
+
**모션.** press(`pressEffect`) · confirm. 토큰 값과 규칙은 `motion.md`.
|
|
1483
1955
|
|
|
1484
1956
|
### props
|
|
1485
1957
|
|
|
@@ -1490,10 +1962,13 @@ import { ChipGroup } from '@nurihaus/web-design-system'; // 루트.
|
|
|
1490
1962
|
| `defaultValue` | `string` | | |
|
|
1491
1963
|
| `onValueChange` | `((id: string) => void)` | | |
|
|
1492
1964
|
| `label` | `string` | 예 | |
|
|
1965
|
+
| `variant` | `'outlined' \| 'ghost' \| 'filled'` | | `'filled'` |
|
|
1966
|
+
| `size` | `'xs' \| 's'` | | `'s'` |
|
|
1493
1967
|
| `className` | `string` | | |
|
|
1494
1968
|
| `style` | `CSSProperties` | | |
|
|
1495
1969
|
| `track` | `string` | | |
|
|
1496
1970
|
| `trackProps` | `Record<string, string \| number \| boolean>` | | |
|
|
1971
|
+
| `pressEffect` | `boolean` | | `true` |
|
|
1497
1972
|
|
|
1498
1973
|
이 밖에 React·HTML 기본 속성 2개를 받는다.
|
|
1499
1974
|
|
|
@@ -1506,6 +1981,8 @@ import { Card } from '@nurihaus/web-design-system'; // 루트. 첫
|
|
|
1506
1981
|
|
|
1507
1982
|
**언제 쓴다.** 목록이나 홈에서 내용 한 묶음을 흰 면(`variant="default"`) 또는 연보라 면(`variant="tinted"`)에 담을 때 쓴다. 안은 세로로 쌓이고 사이 간격은 정해져 있다. 누르면 다른 화면으로 가는 카드는 `asChild` 를 주고 링크 요소(`<a>`·라우터 Link) 하나를 children 으로 준다 — 그 링크가 카드가 되고 내용은 링크의 children 으로 쓴다. 링크·버튼 카드만 누를 때 살짝 줄어든다. `className`·`style` 은 루트(asChild 면 그 링크)에 붙는다.
|
|
1508
1983
|
|
|
1984
|
+
- `pressEffect`(기본 `true`): `asChild` 로 넘긴 링크·버튼 카드를 누르는 동안 살짝 줄어든다. 보기만 하는 카드에는 붙지 않는다. `false`면 끈다.
|
|
1985
|
+
|
|
1509
1986
|
**쓰지 않는다.** 설정·메뉴처럼 줄지어 놓이는 항목은 ListGroup 과 ListRow 를 쓴다. 이름과 값을 나란히 보여 주는 요약은 DescriptionList 를 쓴다.
|
|
1510
1987
|
|
|
1511
1988
|
```tsx
|
|
@@ -1523,14 +2000,15 @@ import { Card } from '@nurihaus/web-design-system'; // 루트. 첫
|
|
|
1523
2000
|
</>
|
|
1524
2001
|
```
|
|
1525
2002
|
|
|
1526
|
-
**모션.** press · attention(opt). 토큰 값과 규칙은 `motion.md`.
|
|
2003
|
+
**모션.** press(`pressEffect`) · attention(opt). 토큰 값과 규칙은 `motion.md`.
|
|
1527
2004
|
|
|
1528
2005
|
### props
|
|
1529
2006
|
|
|
1530
2007
|
| prop | 타입 | 필수 | 기본값 |
|
|
1531
2008
|
| --- | --- | --- | --- |
|
|
1532
|
-
| `asChild` | `boolean` | | |
|
|
1533
2009
|
| `variant` | `'default' \| 'tinted'` | | `'default'` |
|
|
2010
|
+
| `asChild` | `boolean` | | |
|
|
2011
|
+
| `pressEffect` | `boolean` | | `true` |
|
|
1534
2012
|
|
|
1535
2013
|
이 밖에 React·HTML 기본 속성 266개를 받는다.
|
|
1536
2014
|
|
|
@@ -1573,6 +2051,8 @@ import { ListRow } from '@nurihaus/web-design-system'; // 루트.
|
|
|
1573
2051
|
|
|
1574
2052
|
**언제 쓴다.** ListGroup 안의 한 줄에 쓴다. `label` 이 이름, `description` 이 아래 보조 글, `leading` 이 왼쪽(Icon size m 이나 Avatar), `trailing` 이 오른쪽(값 글자, OptionBadge, Switch)이다. 다른 화면으로 가는 줄은 `asChild` 를 주고 링크 요소(`<a>`·라우터 Link) 하나를 children 으로 준다 — 그 링크가 줄이 되고 내용은 링크 안에 들어간다. 그 자리에서 동작하는 줄은 `onClick` 을 주면 button 이 된다. 누르는 줄은 오른쪽 끝에 화살표가 기본으로 붙고 `chevron={false}` 로 숨긴다. 누르면 배경이 잠깐 어두워진다. `className`·`style` 은 줄(button·링크) 자체에 붙는다.
|
|
1575
2053
|
|
|
2054
|
+
- `pressEffect`(기본 `true`): `onClick`·`asChild` 가 있는 줄을 누르는 동안 배경이 어두워진다. 크기는 줄지 않는다. 보기만 하는 줄에는 붙지 않는다. `false`면 끈다.
|
|
2055
|
+
|
|
1576
2056
|
**쓰지 않는다.** `trailing` 에 Switch 같은 버튼을 둔 줄에는 `onClick`·`asChild` 를 주지 않는다 — 버튼 안에 버튼이 들어간다. 줄을 ListGroup 밖에 홀로 두지 않는다. 사용 로그는 넘기는 링크·핸들러에서 남긴다.
|
|
1577
2057
|
|
|
1578
2058
|
```tsx
|
|
@@ -1588,18 +2068,19 @@ import { ListRow } from '@nurihaus/web-design-system'; // 루트.
|
|
|
1588
2068
|
</ListGroup>
|
|
1589
2069
|
```
|
|
1590
2070
|
|
|
1591
|
-
**모션.** press · attention(opt). 토큰 값과 규칙은 `motion.md`.
|
|
2071
|
+
**모션.** press(`pressEffect`) · attention(opt). 토큰 값과 규칙은 `motion.md`.
|
|
1592
2072
|
|
|
1593
2073
|
### props
|
|
1594
2074
|
|
|
1595
2075
|
| prop | 타입 | 필수 | 기본값 |
|
|
1596
2076
|
| --- | --- | --- | --- |
|
|
1597
|
-
| `asChild` | `boolean` | | |
|
|
1598
2077
|
| `label` | `ReactNode` | 예 | |
|
|
1599
2078
|
| `track` | `string` | | |
|
|
1600
2079
|
| `children` | `ReactNode` | | |
|
|
1601
2080
|
| `onClick` | `MouseEventHandler<HTMLElement>` | | |
|
|
2081
|
+
| `asChild` | `boolean` | | |
|
|
1602
2082
|
| `trackProps` | `Record<string, string \| number \| boolean>` | | |
|
|
2083
|
+
| `pressEffect` | `boolean` | | `true` |
|
|
1603
2084
|
| `description` | `ReactNode` | | |
|
|
1604
2085
|
| `chevron` | `boolean` | | |
|
|
1605
2086
|
| `leading` | `ReactNode` | | |
|
|
@@ -1647,7 +2128,7 @@ import { Notice } from '@nurihaus/web-design-system/notice'; // 이 컴포넌
|
|
|
1647
2128
|
import { Notice } from '@nurihaus/web-design-system'; // 루트. 첫 로드 JS 가 커진다
|
|
1648
2129
|
```
|
|
1649
2130
|
|
|
1650
|
-
**언제 쓴다.** 카드·바텀시트·폼 안에 머무르며 상태나 주의를 알릴 때 쓴다(예: "검토 중입니다", "저장하지 못했습니다"). `variant`(`neutral` 기본·`success`·`warning`·`danger`)가 바탕색·글자색과 앞 아이콘(정보·체크·경고·경고)을 정한다. `danger` 는 `role="alert"` 라 화면 낭독기가 바로 읽는다. 다른 variant 에 role 이 필요하면 쓰는 쪽이 `role` 을 준다(그 값이 앞선다). `title` 은 본문 위 굵은 한 줄, `children` 이 본문이다. `action`(`{ label, onClick, loading?, track? }`)을 주면 본문 아래 작은 버튼(CTAButton xs
|
|
2131
|
+
**언제 쓴다.** 카드·바텀시트·폼 안에 머무르며 상태나 주의를 알릴 때 쓴다(예: "검토 중입니다", "저장하지 못했습니다"). `variant`(`neutral` 기본·`success`·`warning`·`danger`)가 바탕색·글자색과 앞 아이콘(정보·체크·경고·경고)을 정한다. `danger` 는 `role="alert"` 라 화면 낭독기가 바로 읽는다. 다른 variant 에 role 이 필요하면 쓰는 쪽이 `role` 을 준다(그 값이 앞선다). `title` 은 본문 위 굵은 한 줄, `children` 이 본문이다. `action`(`{ label, onClick, loading?, track? }`)을 주면 본문 아래 작은 버튼(CTAButton xs·`primary`·`outline`)이 하나 붙는다. `loading` 이면 버튼이 Spinner 로 바뀌고 처리 중에는 `onClick` 을 다시 부르지 않는다. 조건에 따라 나타나는 안내만 `motion`(`weak`·`strong`)을 준다 — 나타날 때 흐려졌다 선명해진다. 사라질 때는 움직이지 않는다. `className`·`style` 은 루트(`div`)에 붙는다.
|
|
1651
2132
|
|
|
1652
2133
|
**쓰지 않는다.** 행동 결과를 잠깐 알리고 스스로 사라져야 하면 Toast 를 쓴다. 입력칸 하나의 오류는 TextField 의 helper text 를 쓴다. 목록이 비었거나 화면 전체를 채우는 안내는 EmptyState 를 쓴다.
|
|
1653
2134
|
|
|
@@ -1682,13 +2163,29 @@ import { EmptyState } from '@nurihaus/web-design-system'; // 루트.
|
|
|
1682
2163
|
|
|
1683
2164
|
**쓰지 않는다.** 카드 안에서 상태를 짧게 알리는 안내는 Notice 를 쓴다. 불러오는 중에는 Skeleton 이나 로딩 컴포넌트를 쓴다.
|
|
1684
2165
|
|
|
2166
|
+
**상황에서 고른다.** 자주 나오는 아홉 상황의 아이콘 · `variant` · 버튼이 정해져 있다(Storybook `Components/EmptyState` 의 Situations 와 상황별 스토리). 실사용은 이 표에서 고르고 글자만 화면에 맞게 바꾼다. 새 조합을 만들지 않는다. 표에 없는 상황이면 표와 스토리에 행을 더한다.
|
|
2167
|
+
|
|
2168
|
+
| 상황 | `icon` | `variant` | 제목 · 설명 | `action` |
|
|
2169
|
+
| --- | --- | --- | --- | --- |
|
|
2170
|
+
| 빈 목록 | 그 목록의 아이콘(`megaphone-simple` 등) | `default` | "아직 받은 제안이 없어요" · "새 제안이 오면 여기에 보여 드릴게요." | 없음. 만들기 흐름이 있으면 `variant="weak"` 버튼 |
|
|
2171
|
+
| 검색 결과 없음 | `magnifying-glass` | `default` | "검색 결과가 없어요" · "다른 검색어로 다시 찾아보세요." | 없음 |
|
|
2172
|
+
| 필터 결과 없음 | `sliders-horizontal` | `default` | "조건에 맞는 항목이 없어요" · "필터를 바꾸거나 초기화해 보세요." | `variant="weak"` "필터 초기화" |
|
|
2173
|
+
| 불러오기 실패 | `warning` | `neutral` | "불러오지 못했어요" · "잠시 뒤 다시 시도해 주세요." | `variant="weak"` "다시 시도" |
|
|
2174
|
+
| 연결 끊김 | `globe` | `neutral` | "인터넷에 연결되지 않았어요" · "연결을 확인한 뒤 다시 시도해 주세요." | `variant="weak"` "다시 시도" |
|
|
2175
|
+
| 권한 없음 | `lock` | `neutral` | "볼 수 없는 화면이에요" · "접근 권한이 필요해요. 관리자에게 요청해 주세요." | `color="neutral" variant="outline"` "돌아가기" |
|
|
2176
|
+
| 찾을 수 없음 | `question` | `neutral` | "페이지를 찾을 수 없어요" · "주소가 바뀌었거나 삭제된 것 같아요." | `variant="weak"` "홈으로" |
|
|
2177
|
+
| 준비 중 | `sparkle` | `neutral` | "준비 중이에요" · 설명 없음 | 없음 |
|
|
2178
|
+
| 모두 완료 | `check-circle` | `default` | "모두 처리했어요" · "새로 들어오면 여기에 보여 드릴게요." | 없음 |
|
|
2179
|
+
|
|
2180
|
+
버튼 크기는 `s` 다. 다시 시도 · 초기화처럼 되돌리는 행동은 `weak`, 화면을 떠나는 행동(돌아가기)은 `color="neutral" variant="outline"` 이다.
|
|
2181
|
+
|
|
1685
2182
|
```tsx
|
|
1686
2183
|
<EmptyState
|
|
1687
2184
|
icon="warning"
|
|
1688
2185
|
variant="neutral"
|
|
1689
2186
|
title="불러오지 못했어요"
|
|
1690
2187
|
description="잠시 뒤 다시 시도해 주세요."
|
|
1691
|
-
action={<CTAButton size="s" variant="
|
|
2188
|
+
action={<CTAButton size="s" variant="weak" text="다시 시도" />}
|
|
1692
2189
|
/>
|
|
1693
2190
|
```
|
|
1694
2191
|
|
|
@@ -1700,7 +2197,7 @@ import { EmptyState } from '@nurihaus/web-design-system'; // 루트.
|
|
|
1700
2197
|
| --- | --- | --- | --- |
|
|
1701
2198
|
| `title` | `ReactNode` | 예 | |
|
|
1702
2199
|
| `variant` | `'neutral' \| 'default'` | | `'default'` |
|
|
1703
|
-
| `icon` | `'
|
|
2200
|
+
| `icon` | `'circle' \| 'link' \| 'image' \| 'x' \| 'warning' \| 'copy' \| 'house' \| 'megaphone-simple' \| 'chats-circle' \| 'user-circle' \| 'bell' \| 'caret-left' \| 'magnifying-glass' \| 'dots-three' \| 'gear-six' \| 'chat-circle' \| 'paper-plane-tilt' \| 'plus' \| 'camera' \| 'video-camera' \| 'play' \| 'upload-simple' \| 'calendar-blank' \| 'clock' \| 'map-pin' \| 'truck' \| 'ticket' \| 'qr-code' \| 'sparkle' \| 'gift' \| 'wallet' \| 'bank' \| 'credit-card' \| 'check-circle' \| 'check' \| 'info' \| 'question' \| 'lock' \| 'pencil-simple' \| 'trash' \| 'share-network' \| 'eye' \| 'sliders-horizontal' \| 'heart' \| 'star' \| 'globe' \| 'sign-out' \| 'caret-right' \| 'arrow-right' \| 'instagram-logo' \| 'tiktok-logo' \| 'youtube-logo'` | 예 | |
|
|
1704
2201
|
| `description` | `ReactNode` | | |
|
|
1705
2202
|
| `action` | `ReactNode` | | |
|
|
1706
2203
|
|
|
@@ -1715,6 +2212,8 @@ import { Tag } from '@nurihaus/web-design-system'; // 루트. 첫
|
|
|
1715
2212
|
|
|
1716
2213
|
**언제 쓴다.** 고른 값을 보여 주고 하나씩 지울 수 있게 할 때 쓴다(예: 여러 개 고른 나라). `text` 가 글자다. `onRemove` 를 주면 오른쪽에 X 버튼이 붙고, 누르면 `onRemove` 가 불린다. 이때 `removeLabel`(X 버튼을 읽어 줄 이름, 예: "대한민국 지우기")도 꼭 준다 — 앱 언어로 쓰는 쪽이 정한다. `onRemove` 가 없으면 지울 수 없는 표시용 태그다. `track` 을 주면 X 를 누를 때 `click` 을 보낸다. `className`·`style` 은 루트(`span`)에 붙는다. 여러 개를 늘어놓을 때 줄 바꿈·간격은 쓰는 쪽 컨테이너가 정한다.
|
|
1717
2214
|
|
|
2215
|
+
- `pressEffect`(기본 `true`): 지우기 버튼(X)을 누르는 동안 살짝 줄어든다. `false`면 끈다.
|
|
2216
|
+
|
|
1718
2217
|
**쓰지 않는다.** 목록을 걸러 낼 선택지는 ChipGroup 을 쓴다. 상태값·분류 라벨은 OptionBadge 를 쓴다.
|
|
1719
2218
|
|
|
1720
2219
|
```tsx
|
|
@@ -1724,7 +2223,7 @@ import { Tag } from '@nurihaus/web-design-system'; // 루트. 첫
|
|
|
1724
2223
|
</>
|
|
1725
2224
|
```
|
|
1726
2225
|
|
|
1727
|
-
**모션.** press. 토큰 값과 규칙은 `motion.md`.
|
|
2226
|
+
**모션.** press(`pressEffect`). 토큰 값과 규칙은 `motion.md`.
|
|
1728
2227
|
|
|
1729
2228
|
### props
|
|
1730
2229
|
|
|
@@ -1733,6 +2232,7 @@ import { Tag } from '@nurihaus/web-design-system'; // 루트. 첫
|
|
|
1733
2232
|
| `track` | `string` | | |
|
|
1734
2233
|
| `text` | `ReactNode` | 예 | |
|
|
1735
2234
|
| `trackProps` | `Record<string, string \| number \| boolean>` | | |
|
|
2235
|
+
| `pressEffect` | `boolean` | | `true` |
|
|
1736
2236
|
| `onRemove` | `(() => void)` | | |
|
|
1737
2237
|
| `removeLabel` | `string` | | |
|
|
1738
2238
|
|
|
@@ -1791,10 +2291,10 @@ import { Message } from '@nurihaus/web-design-system'; // 루트.
|
|
|
1791
2291
|
| prop | 타입 | 필수 | 기본값 |
|
|
1792
2292
|
| --- | --- | --- | --- |
|
|
1793
2293
|
| `time` | `ReactNode` | | |
|
|
2294
|
+
| `media` | `ReactNode` | | |
|
|
1794
2295
|
| `name` | `ReactNode` | | |
|
|
1795
2296
|
| `motion` | `'strong' \| 'weak'` | | |
|
|
1796
2297
|
| `side` | `'end' \| 'start'` | | `'start'` |
|
|
1797
|
-
| `media` | `ReactNode` | | |
|
|
1798
2298
|
| `dateTime` | `string` | | |
|
|
1799
2299
|
|
|
1800
2300
|
이 밖에 React·HTML 기본 속성 267개를 받는다.
|
|
@@ -1833,6 +2333,8 @@ import { MessageComposer } from '@nurihaus/web-design-system'; //
|
|
|
1833
2333
|
|
|
1834
2334
|
**언제 쓴다.** 대화 화면 아래의 메시지 입력 줄이다. 입력 칸은 글자만큼 늘어나다가(다섯 줄쯤) 그 뒤로는 칸 안에서 스크롤한다. Enter 는 줄바꿈이고 보내기는 오른쪽 버튼으로만 한다. 값은 `value`·`defaultValue`·`onValueChange(value)` 로 다룬다. 보낼 수 있으면 버튼을 눌렀을 때 `onSend(value)` 가 불린다. **값을 스스로 비우지 않는다** — 보내기에 성공하면 쓰는 쪽이 `value` 를 비운다. 보낼 수 있는지는 기본으로 값이 공백만이 아닐 때다. 첨부만 보내는 화면은 `canSend` 를 직접 준다. 보낼 수 없거나 `disabled` 면 버튼이 회색(`aria-disabled`)이고 눌러도 보내지 않고 흔들린다. `loading` 동안은 Spinner 를 돌리고 보내지 않는다. `label`·`sendLabel` 은 입력 칸·보내기 버튼의 이름(aria-label)이다. `autoFocus` 는 사용자가 방금 입력을 연 화면(예: 다시 문의하기를 고른 뒤)에서만 준다. `maxLength` 는 입력 칸 최대 글자 수다. `leading` 은 입력 칸 왼쪽(첨부 아이콘 버튼), `attachments` 는 입력 줄 위(첨부 썸네일) 자리다. `track` 을 주면 실제로 보낼 때 `click` 을 한 번 보낸다(입력한 글은 싣지 않는다). `className`·`style`·`ref` 는 루트 `<div>` 에 붙는다. 화면 아래에 붙이려면 BottomBar 안에 둔다.
|
|
1835
2335
|
|
|
2336
|
+
- `pressEffect`(기본 `true`): 보내기 버튼을 누르는 동안 살짝 줄어든다. `loading` 중에는 꺼진다. `false`면 끈다.
|
|
2337
|
+
|
|
1836
2338
|
**쓰지 않는다.** 폼의 여러 줄 입력은 TextArea, 한 줄 입력은 TextField 를 쓴다.
|
|
1837
2339
|
|
|
1838
2340
|
```tsx
|
|
@@ -1846,7 +2348,7 @@ import { MessageComposer } from '@nurihaus/web-design-system'; //
|
|
|
1846
2348
|
</BottomBar>
|
|
1847
2349
|
```
|
|
1848
2350
|
|
|
1849
|
-
**모션.** press · reject · busy(`loading`). 토큰 값과 규칙은 `motion.md`.
|
|
2351
|
+
**모션.** press(`pressEffect`) · reject · busy(`loading`). 토큰 값과 규칙은 `motion.md`.
|
|
1850
2352
|
|
|
1851
2353
|
### props
|
|
1852
2354
|
|
|
@@ -1870,6 +2372,7 @@ import { MessageComposer } from '@nurihaus/web-design-system'; //
|
|
|
1870
2372
|
| `style` | `CSSProperties` | | |
|
|
1871
2373
|
| `track` | `string` | | |
|
|
1872
2374
|
| `trackProps` | `Record<string, string \| number \| boolean>` | | |
|
|
2375
|
+
| `pressEffect` | `boolean` | | `true` |
|
|
1873
2376
|
|
|
1874
2377
|
이 밖에 React·HTML 기본 속성 2개를 받는다.
|
|
1875
2378
|
|
|
@@ -1886,8 +2389,8 @@ import { BottomBar } from '@nurihaus/web-design-system'; // 루트.
|
|
|
1886
2389
|
|
|
1887
2390
|
```tsx
|
|
1888
2391
|
<BottomBar>
|
|
1889
|
-
<CTAButton variant="
|
|
1890
|
-
<CTAButton
|
|
2392
|
+
<CTAButton variant="outline" size="l" text="거절" />
|
|
2393
|
+
<CTAButton size="l" text="수락" />
|
|
1891
2394
|
</BottomBar>
|
|
1892
2395
|
```
|
|
1893
2396
|
|
|
@@ -1908,6 +2411,8 @@ import { MediaThumbnail } from '@nurihaus/web-design-system'; // 루
|
|
|
1908
2411
|
|
|
1909
2412
|
**언제 쓴다.** 사진·영상을 작은 썸네일로 보여 주고 누르면 화면 안에서 크게 볼 때 쓴다. 앱 웹뷰에서 원본 주소로 이동하면 앱을 벗어나므로 링크 대신 쓴다. `type`(`image`·`video`, 기본 `image`), `size`(`s` 64·`m` 96 정사각형, `l` 폭을 채우되 240 까지 4:3 — 말풍선 안). 올리는 중이면 `loading`, 실패하면 `invalid` 를 준다. 둘 다 누르면 열리지 않는다. `onRemove`·`removeLabel` 을 주면 오른쪽 위에 지우기 버튼이 생긴다. `closeLabel` 은 뷰어 닫기 버튼 이름이라 필수다. 영상처럼 `alt` 가 없으면 `viewLabel` 이 버튼 이름이 된다. `className`·`style` 은 감싸는 div 에 붙는다.
|
|
1910
2413
|
|
|
2414
|
+
- `pressEffect`(기본 `true`): 썸네일을 누르는 동안 살짝 줄어든다. 지우기 버튼에는 붙지 않는다. `false`면 끈다.
|
|
2415
|
+
|
|
1911
2416
|
**쓰지 않는다.** 누를 일 없는 사람 사진은 Avatar 를 쓴다. 썸네일 없이 버튼 하나로 크게 보이려면 MediaViewer 의 `trigger` 를 쓴다.
|
|
1912
2417
|
|
|
1913
2418
|
```tsx
|
|
@@ -1921,7 +2426,7 @@ import { MediaThumbnail } from '@nurihaus/web-design-system'; // 루
|
|
|
1921
2426
|
/>
|
|
1922
2427
|
```
|
|
1923
2428
|
|
|
1924
|
-
**모션.** press · busy(`loading`). 토큰 값과 규칙은 `motion.md`.
|
|
2429
|
+
**모션.** press(`pressEffect`) · busy(`loading`). 토큰 값과 규칙은 `motion.md`.
|
|
1925
2430
|
|
|
1926
2431
|
### props
|
|
1927
2432
|
|
|
@@ -1941,6 +2446,7 @@ import { MediaThumbnail } from '@nurihaus/web-design-system'; // 루
|
|
|
1941
2446
|
| `style` | `CSSProperties` | | |
|
|
1942
2447
|
| `track` | `string` | | |
|
|
1943
2448
|
| `trackProps` | `Record<string, string \| number \| boolean>` | | |
|
|
2449
|
+
| `pressEffect` | `boolean` | | `true` |
|
|
1944
2450
|
|
|
1945
2451
|
이 밖에 React·HTML 기본 속성 2개를 받는다.
|
|
1946
2452
|
|
|
@@ -2037,6 +2543,70 @@ import { MotionProvider } from '@nurihaus/web-design-system'; // 루
|
|
|
2037
2543
|
| `reducedMotion` | `'user' \| 'always' \| 'never'` | | `'user'` |
|
|
2038
2544
|
| `children` | `ReactNode` | | |
|
|
2039
2545
|
|
|
2546
|
+
## OverlayProvider
|
|
2547
|
+
|
|
2548
|
+
```ts
|
|
2549
|
+
import { OverlayProvider } from '@nurihaus/web-design-system/overlay'; // 이 컴포넌트만 싣는다 (권장)
|
|
2550
|
+
import { OverlayProvider } from '@nurihaus/web-design-system'; // 루트. 첫 로드 JS 가 커진다
|
|
2551
|
+
```
|
|
2552
|
+
|
|
2553
|
+
**언제 쓴다.** 앱 루트에 한 번 두고 `useDialog` · `useToast` 로 대화상자와 토스트를 연다. 두 훅은 `@nurihaus/web-design-system/overlay` 에서도 나온다. 안에 ToastProvider 를 품으므로 ToastProvider 를 따로 두지 않는다. `duration` · `position` · `label` 은 ToastProvider 와 같은 이름, 같은 뜻이다. `portalContainer` 를 주면 훅으로 연 대화상자와 토스트 자리를 그 요소 안에 그린다. 훅이 연 오버레이는 children 뒤에 쌓이고 나중에 연 것이 위다. 답은 닫기로 정한 순간 돌아오고, 창은 퇴장 애니메이션이 끝난 뒤 사라진다.
|
|
2554
|
+
|
|
2555
|
+
고르는 기준은 오버레이가 무엇을 대표하느냐다. 질문이고 답이 오면 끝나는 것(삭제 확인, 결과 알림)은 훅으로 열고 부르는 자리에서 `await` 한다. 편집 폼이 든 Drawer 처럼 열린 채 상태를 주고받는 것은 선언형 Modal · Drawer 를 쓴다.
|
|
2556
|
+
|
|
2557
|
+
**쓰지 않는다.** 화면마다 여러 개 두지 않는다. 훅은 렌더 중에 부르지 않는다. 렌더마다 창이 열린다. 버튼 핸들러·effect 안에서만 부른다. Provider 밖에서 훅을 부르면 오류를 던진다.
|
|
2558
|
+
|
|
2559
|
+
```tsx
|
|
2560
|
+
<OverlayProvider position="bottom-right">
|
|
2561
|
+
<CTAButton text="삭제" color="danger" onClick={() => {}} />
|
|
2562
|
+
</OverlayProvider>
|
|
2563
|
+
```
|
|
2564
|
+
|
|
2565
|
+
### useDialog
|
|
2566
|
+
|
|
2567
|
+
`{ alert, confirm, close }` 를 돌려준다.
|
|
2568
|
+
|
|
2569
|
+
- `alert({ title, description?, buttonText?, track? })` 는 버튼 하나짜리 Modal 을 연다. 버튼 글자 기본은 `확인`, X 아이콘은 없다. 버튼·Esc·바깥 누름 어느 쪽으로 닫혀도 resolve 된다.
|
|
2570
|
+
- `confirm({ title, description?, confirmText?, cancelText?, color?, onConfirm?, track? })` 는 ModalWithDoubleButton.Row 를 연다. 왼쪽이 취소(기본 `취소`), 오른쪽이 확인(기본 `확인`)이고 `color`(`primary` · `danger`, 기본 `primary`)가 확인 버튼 색이다. 답은 `'confirm' | 'cancel' | 'dismiss'` 셋이다. `cancel` 은 취소 버튼, `dismiss` 는 Esc · 바깥 누름 · 뒤로 가기 · `close()` 다.
|
|
2571
|
+
- `onConfirm` 이 Promise 를 돌려주면 끝날 때까지 확인 버튼이 `loading` 이고 취소 버튼은 막히며 창은 어떤 길로도 닫히지 않는다. 끝나면 `'confirm'` 으로 닫힌다. 거부되면 창은 열린 채 남고 `confirm` 이 같은 오류로 거부된다. `try` 로 받아 오류 토스트를 띄운다.
|
|
2572
|
+
- `track` 을 주면 alert 는 Modal 과 같이 `open` · `close` 를, confirm 은 열 때 `open`, 닫을 때 답을 `value` 로 `close` 를 보낸다(`component` 는 `'ModalWithDoubleButton'`).
|
|
2573
|
+
- `close()` 는 맨 위 대화상자를 `'dismiss'` 로 닫는다. 열린 것이 없으면 아무 일도 없다.
|
|
2574
|
+
- 닫히면 포커스가 `alert` · `confirm` 을 부른 요소로 돌아간다. 그 요소가 그사이 사라졌으면(목록 행 삭제) 돌려놓지 않는다.
|
|
2575
|
+
|
|
2576
|
+
```ts
|
|
2577
|
+
const { confirm } = useDialog();
|
|
2578
|
+
|
|
2579
|
+
const onDelete = async () => {
|
|
2580
|
+
if ((await confirm({ title: '삭제할까요?', confirmText: '삭제', color: 'danger' })) !== 'confirm') return;
|
|
2581
|
+
await deleteItem();
|
|
2582
|
+
};
|
|
2583
|
+
```
|
|
2584
|
+
|
|
2585
|
+
### useToast
|
|
2586
|
+
|
|
2587
|
+
`{ show, dismiss }` 를 돌려준다. `show(title, { description?, variant?, action?, duration? })` 는 Toast 를 띄우고 id 를 바로 돌려준다. 기다리지 않는다. 옵션은 Toast props 와 같은 뜻이다. `dismiss(id)` 는 그 토스트를 닫는다. 이미 닫혔으면 아무 일도 없다.
|
|
2588
|
+
|
|
2589
|
+
```ts
|
|
2590
|
+
const { show } = useToast();
|
|
2591
|
+
const id = show('저장했습니다', { variant: 'success' });
|
|
2592
|
+
```
|
|
2593
|
+
|
|
2594
|
+
### useBottomSheet
|
|
2595
|
+
|
|
2596
|
+
아직 없다. BottomSheet 컴포넌트와 함께 나온다.
|
|
2597
|
+
|
|
2598
|
+
**모션.** 없음. 토스트 자리와 훅이 연 오버레이만 그린다. 모션은 그 안의 Modal · ModalWithDoubleButton · Toast 가 받는다.
|
|
2599
|
+
|
|
2600
|
+
### props
|
|
2601
|
+
|
|
2602
|
+
| prop | 타입 | 필수 | 기본값 |
|
|
2603
|
+
| --- | --- | --- | --- |
|
|
2604
|
+
| `portalContainer` | `HTMLElement` | | |
|
|
2605
|
+
| `label` | `string` | | |
|
|
2606
|
+
| `children` | `ReactNode` | 예 | |
|
|
2607
|
+
| `position` | `'top-right' \| 'bottom-right' \| 'bottom-center'` | | |
|
|
2608
|
+
| `duration` | `number` | | |
|
|
2609
|
+
|
|
2040
2610
|
## 아직 없는 것
|
|
2041
2611
|
|
|
2042
2612
|
아래는 디자인 시스템에 없다. 비슷한 이름의 컴포넌트를 지어내 import 하지 않는다.
|