sellmate-design-system-react 9.0.0-beta.4 → 9.0.0-beta.41
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/AGENTS.md +670 -95
- package/README.md +111 -9
- package/dist/components/SAccountListBox/AccountListBoxPortal.d.ts +31 -0
- package/dist/components/SAccountListBox/README.md +86 -0
- package/dist/components/SAccountListBox/SAccountListBox.d.ts +79 -0
- package/dist/components/SAccountListBox/SystemMenuPortal.d.ts +58 -0
- package/dist/components/SAccountListBox/accountListBox.config.d.ts +64 -0
- package/dist/components/SAccountListBox/index.d.ts +2 -0
- package/dist/components/SBadge/README.md +26 -0
- package/dist/components/SBadge/SBadge.d.ts +1 -1
- package/dist/components/SBarcodeInput/README.md +12 -4
- package/dist/components/SBarcodeInput/SBarcodeInput.d.ts +10 -2
- package/dist/components/SButton/README.md +38 -0
- package/dist/components/SCalendar/README.md +13 -0
- package/dist/components/SCalendarBoard/CalendarDayCard.d.ts +38 -0
- package/dist/components/SCalendarBoard/CalendarDayEventListBox.d.ts +26 -0
- package/dist/components/SCalendarBoard/CalendarEventButton.d.ts +13 -0
- package/dist/components/SCalendarBoard/CalendarMoreButton.d.ts +12 -0
- package/dist/components/SCalendarBoard/README.md +137 -0
- package/dist/components/SCalendarBoard/SCalendarBoard.d.ts +68 -0
- package/dist/components/SCalendarBoard/calendarBoard.config.d.ts +33 -0
- package/dist/components/SCalendarBoard/index.d.ts +3 -0
- package/dist/components/SCalendarBoard/types.d.ts +31 -0
- package/dist/components/SCallout/README.md +16 -1
- package/dist/components/SCallout/SCallout.d.ts +9 -4
- package/dist/components/SCard/README.md +16 -0
- package/dist/components/SCard/SCard.d.ts +17 -2
- package/dist/components/SCheckbox/README.md +8 -0
- package/dist/components/SChipFilter/README.md +339 -14
- package/dist/components/SChipFilter/SChipFilter.d.ts +150 -60
- package/dist/components/SChipFilter/index.d.ts +1 -1
- package/dist/components/SChipInput/README.md +16 -2
- package/dist/components/SChipInput/SChipInput.d.ts +8 -2
- package/dist/components/SChipInput/index.d.ts +1 -1
- package/dist/components/SCircleProgress/README.md +8 -0
- package/dist/components/SConfirmModal/README.md +11 -3
- package/dist/components/SConfirmModal/SConfirmModal.d.ts +16 -8
- package/dist/components/SDatePicker/README.md +20 -2
- package/dist/components/SDatePicker/SDatePicker.d.ts +27 -4
- package/dist/components/SDateRangePicker/README.md +19 -4
- package/dist/components/SDateRangePicker/SDateRangePicker.d.ts +19 -6
- package/dist/components/SDivider/README.md +7 -0
- package/dist/components/SDivider/SDivider.d.ts +11 -0
- package/dist/components/SDraggableItem/README.md +37 -0
- package/dist/components/SDraggableItem/SDraggableItem.d.ts +2 -0
- package/dist/components/SDraggableItem/index.d.ts +1 -1
- package/dist/components/SDraggableList/README.md +30 -0
- package/dist/components/SDraggableList/SDraggableList.d.ts +11 -0
- package/dist/components/SDraggableList/index.d.ts +1 -1
- package/dist/components/SDrawer/README.md +8 -0
- package/dist/components/SDropdownButton/README.md +19 -0
- package/dist/components/SEditor/EditorBody.d.ts +36 -0
- package/dist/components/SEditor/EditorToolbar.d.ts +93 -0
- package/dist/components/SEditor/README.md +203 -0
- package/dist/components/SEditor/SEditor.d.ts +114 -0
- package/dist/components/SEditor/editor-icons.d.ts +63 -0
- package/dist/components/SEditor/editor.config.d.ts +119 -0
- package/dist/components/SEditor/index.d.ts +8 -0
- package/dist/components/SEditor/tiptap-api.d.ts +29 -0
- package/dist/components/SEditor/use-is-mobile.d.ts +14 -0
- package/dist/components/SExpansionItem/README.md +36 -0
- package/dist/components/SExpansionItem/index.d.ts +1 -1
- package/dist/components/SField/README.md +29 -5
- package/dist/components/SField/SField.d.ts +20 -8
- package/dist/components/SFilePicker/README.md +18 -4
- package/dist/components/SFilePicker/SFilePicker.d.ts +11 -5
- package/dist/components/SFooter/README.md +25 -0
- package/dist/components/SFooter/SFooter.d.ts +4 -3
- package/dist/components/SForm/README.md +12 -1
- package/dist/components/SForm/SForm.d.ts +2 -2
- package/dist/components/SGhostButton/README.md +22 -4
- package/dist/components/SGnb/README.md +57 -6
- package/dist/components/SGnb/SGnb.d.ts +58 -8
- package/dist/components/SGnb/gnb.config.d.ts +12 -5
- package/dist/components/SGnb/index.d.ts +1 -1
- package/dist/components/SGnbSystem/README.md +186 -0
- package/dist/components/SGnbSystem/SGnbSystem.d.ts +179 -0
- package/dist/components/SGnbSystem/gnbSystem.config.d.ts +122 -0
- package/dist/components/SGnbSystem/index.d.ts +2 -0
- package/dist/components/SGuide/README.md +15 -0
- package/dist/components/SIcon/README.md +10 -0
- package/dist/components/SIcon/SIcon.d.ts +1 -1
- package/dist/components/SIcon/icons.gen.d.ts +4 -0
- package/dist/components/SImage/README.md +15 -1
- package/dist/components/SImage/SImage.d.ts +2 -2
- package/dist/components/SInput/README.md +6 -4
- package/dist/components/SInput/SInput.d.ts +10 -4
- package/dist/components/SKeyValueTable/README.md +86 -0
- package/dist/components/SKeyValueTable/SKeyValueTable.d.ts +6 -2
- package/dist/components/SKeyValueTable/index.d.ts +1 -1
- package/dist/components/SLayout/README.md +22 -1
- package/dist/components/SLayout/SLayout.d.ts +6 -2
- package/dist/components/SLayout/index.d.ts +1 -1
- package/dist/components/SLinearProgress/README.md +15 -0
- package/dist/components/SLinearProgress/SLinearProgress.d.ts +3 -0
- package/dist/components/SLinearProgress/index.d.ts +1 -1
- package/dist/components/SList/README.md +15 -3
- package/dist/components/SList/SList.d.ts +7 -5
- package/dist/components/SList/index.d.ts +1 -1
- package/dist/components/SListItem/README.md +41 -0
- package/dist/components/SListItem/index.d.ts +1 -1
- package/dist/components/SLoadingContainer/loading.d.ts +18 -2
- package/dist/components/SLoadingModal/README.md +10 -2
- package/dist/components/SLoadingModal/SLoadingModal.d.ts +4 -4
- package/dist/components/SLoadingModal/index.d.ts +1 -1
- package/dist/components/SModal/README.md +1 -1
- package/dist/components/SNumberInput/README.md +14 -6
- package/dist/components/SNumberInput/SNumberInput.d.ts +12 -4
- package/dist/components/SPage/README.md +87 -5
- package/dist/components/SPage/SPage.d.ts +29 -9
- package/dist/components/SPage/SPageHeader.d.ts +31 -13
- package/dist/components/SPage/index.d.ts +2 -2
- package/dist/components/SPage/page-column.d.ts +34 -0
- package/dist/components/SPage/page-width.d.ts +23 -0
- package/dist/components/SPage/page.config.d.ts +18 -0
- package/dist/components/SPopover/README.md +15 -0
- package/dist/components/SPopup/README.md +27 -2
- package/dist/components/SPopup/SPopup.d.ts +7 -3
- package/dist/components/SPopup/index.d.ts +1 -1
- package/dist/components/SPortal/README.md +18 -0
- package/dist/components/SRadio/README.md +20 -0
- package/dist/components/SRadioButton/README.md +18 -0
- package/dist/components/SRadioButton/SRadioButton.d.ts +1 -1
- package/dist/components/SRadioCard/README.md +78 -0
- package/dist/components/SRadioCard/SRadioCard.d.ts +29 -0
- package/dist/components/SRadioCard/SRadioCardGroup.d.ts +36 -0
- package/dist/components/SRadioCard/index.d.ts +2 -0
- package/dist/components/SScrollArea/README.md +27 -0
- package/dist/components/SSearchInput/README.md +63 -0
- package/dist/components/SSearchInput/SSearchInput.d.ts +52 -0
- package/dist/components/SSearchInput/index.d.ts +1 -0
- package/dist/components/SSectionHeaderCard/README.md +37 -0
- package/dist/components/SSectionHeaderCard/SSectionHeaderCard.d.ts +10 -0
- package/dist/components/SSelect/README.md +29 -11
- package/dist/components/SSelect/SSelect.d.ts +28 -8
- package/dist/components/SSplitter/README.md +17 -2
- package/dist/components/SSplitter/SSplitter.d.ts +7 -3
- package/dist/components/SStepper/README.md +26 -0
- package/dist/components/SSwitch/README.md +13 -1
- package/dist/components/SSwitch/SSwitch.d.ts +1 -3
- package/dist/components/SSystemActionButton/README.md +221 -0
- package/dist/components/SSystemActionButton/SSystemActionButton.d.ts +161 -0
- package/dist/components/SSystemActionButton/index.d.ts +2 -0
- package/dist/components/SSystemActionButton/systemActionButton.config.d.ts +93 -0
- package/dist/components/STable/README.md +94 -10
- package/dist/components/STable/STable.d.ts +130 -22
- package/dist/components/STable/index.d.ts +1 -1
- package/dist/components/STabs/README.md +13 -2
- package/dist/components/STabs/STabs.d.ts +3 -5
- package/dist/components/STabs/index.d.ts +1 -1
- package/dist/components/STabs/tabs.config.d.ts +3 -4
- package/dist/components/STag/README.md +52 -0
- package/dist/components/STag/STag.d.ts +3 -1
- package/dist/components/STextLink/README.md +19 -1
- package/dist/components/STextLink/STextLink.d.ts +5 -1
- package/dist/components/STextarea/README.md +4 -4
- package/dist/components/STextarea/STextarea.d.ts +10 -4
- package/dist/components/STimePicker/README.md +16 -2
- package/dist/components/STimePicker/STimePicker.d.ts +11 -5
- package/dist/components/STimePicker/timepicker.config.d.ts +4 -2
- package/dist/components/STimeRangePicker/README.md +28 -2
- package/dist/components/STimeRangePicker/STimeRangePicker.d.ts +11 -5
- package/dist/components/SToast/README.md +25 -1
- package/dist/components/SToast/SToast.d.ts +2 -2
- package/dist/components/SToggle/README.md +8 -0
- package/dist/components/SToggle/index.d.ts +1 -1
- package/dist/components/STooltip/README.md +25 -1
- package/dist/components/STooltip/STooltip.d.ts +1 -1
- package/dist/components/STree/README.md +44 -3
- package/dist/components/STree/STree.d.ts +24 -4
- package/dist/components/STree/index.d.ts +1 -1
- package/dist/docs/Gallery.d.ts +9 -0
- package/dist/docs/gallery-previews.d.ts +24 -0
- package/dist/index.cjs +10890 -5322
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.js +10852 -5322
- package/dist/index.js.map +1 -1
- package/dist/lib/doc-sections.d.ts +35 -0
- package/dist/lib/field-width.d.ts +31 -0
- package/dist/lib/floating-height.d.ts +15 -0
- package/dist/lib/story-docs.d.ts +19 -3
- package/dist/lib/truncated-value-tooltip.d.ts +18 -0
- package/dist/llms-full.txt +3396 -297
- package/dist/llms.txt +675 -97
- package/dist/playground/categories.d.ts +19 -0
- package/dist/styles.css +1731 -166
- package/dist/theme.css +216 -24
- package/eslint/index.mjs +14 -0
- package/eslint/lib/table-column.mjs +26 -0
- package/eslint/rules/divider-vertical-height.mjs +137 -0
- package/eslint/rules/field-width-grade.d.mts +41 -0
- package/eslint/rules/field-width-grade.mjs +311 -0
- package/eslint/rules/table-column-width.mjs +110 -0
- package/eslint/scale.gen.mjs +5 -2
- package/package.json +13 -1
|
@@ -22,15 +22,15 @@
|
|
|
22
22
|
| `error?` | `boolean` | `false` | 에러 상태 |
|
|
23
23
|
| `errorMessage?` | `string` | `''` | 에러 메시지 |
|
|
24
24
|
| `status?` | `SFieldStatus` | — | 필드 상태 — 'error' | 'pass' | 'default'. 'pass'면 초록 테두리 |
|
|
25
|
-
| `focused?` | `boolean` | `false` | 포커스
|
|
26
|
-
| `hovered?` | `boolean` | `false` | 호버
|
|
25
|
+
| `focused?` | `boolean` | `false` | 포커스 상태를 밖에서 지정한다. 필드를 감싼 쪽이 포커스를 쥐고 있어(커스텀 트리거·복합 컨트롤) 필드 자신은 `:focus-within` 이 걸리지 않을 때 쓴다. 켜면 강조 테두리·링이 error/pass 보다 우선한다. |
|
|
26
|
+
| `hovered?` | `boolean` | `false` | 호버 상태를 밖에서 지정한다. `focused` 와 같은 이유로 쓰며, 강조도 같다 — 실제 `:hover` 와 구분되지 않는 모양이어야 밖에서 흉내 낸 것이 티가 나지 않는다. |
|
|
27
27
|
| `rules?` | `Rule[]` | — | 유효성 규칙 (검증은 컨트롤에서 수행, API 패리티) |
|
|
28
28
|
| `hint?` | `string` | `''` | 하단 힌트 |
|
|
29
29
|
| `disabled?` | `boolean` | `false` | 비활성 |
|
|
30
30
|
| `readOnly?` | `boolean` | `false` | 읽기 전용 (회색 배경) |
|
|
31
|
-
| `width?` | `
|
|
32
|
-
| `minWidth?` | `
|
|
33
|
-
| `maxWidth?` | `
|
|
31
|
+
| `width?` | `SFieldWidth` | — | 컨트롤 너비. 지정하면 필드가 부모 폭을 다 먹지 않고 (레이블 + width) 만큼만 차지한다. 다른 요소와 나란히 놓으려면 부모를 flex 로 두면 된다. **폭 등급(`'xs' | 'sm' | 'md' | 'lg' | 'xl'`)으로 준다** — `--cmp-field-width-*` 토큰으로 풀리므로 토큰이 바뀌면 화면이 따라간다. 등급은 `maxLength`(= 스키마 상한)로 고르고, 상한이 `xl` 을 넘거나 상한이 없으면 `"100%"` 로 둔다. (`sellmate/field-width-grade` 가 검사한다) 숫자는 px, 그 밖의 문자열은 CSS 길이 그대로다. |
|
|
32
|
+
| `minWidth?` | `SFieldWidth` | — | 컨트롤 최소 너비 (등급 · 숫자=px · CSS 길이). 하한선만 지정하며 필드는 계속 부모 폭을 채운다 |
|
|
33
|
+
| `maxWidth?` | `SFieldWidth` | — | 컨트롤 최대 너비 (등급 · 숫자=px · CSS 길이). 상한선만 지정하며 필드는 그 아래에서 부모 폭을 채운다. `width` 와 달리 hug 로 전환하지 않는다 — 부모가 좁으면 같이 좁아지고, 넓어도 여기서 멈춘다. 값 길이가 정해진 컨트롤(날짜·시간)이 `width="100%"` 를 받아 행 전체로 늘어나는 것을 막는 데 쓴다. **라벨은 상한에 들어가지 않는다** — 라벨은 컨트롤의 형제라 이 상한 밖이다. `addonLabel` 은 테두리 박스 안이라 상한을 나눠 먹으므로, `labelWidth`(= addon 폭)만큼 상한을 자동으로 늘린다. addon 이 있는데 `labelWidth` 가 없으면 폭을 알 수 없어 상한을 걸지 않는다 — 컨트롤이 잘리는 것보다 넓은 편이 낫다. |
|
|
34
34
|
| `multiline?` | `boolean` | `false` | 멀티라인(textarea) — 컨트롤 높이를 고정하지 않고 min-height만 적용 |
|
|
35
35
|
| `borderless?` | `boolean` | `false` | 테두리 박스 제거 (inline 컨트롤용) — border/배경/hover·focus 강조만 사라지고 label·hint·errorMessage 등 나머지 필드 구성은 그대로 동작한다. |
|
|
36
36
|
| `children?` | `ReactNode` | — | 실제 컨트롤 (input/select 등) — 테두리 없이 렌더, 테두리는 SField가 제공 |
|
|
@@ -50,6 +50,26 @@
|
|
|
50
50
|
|--------|------|-------------|
|
|
51
51
|
| `focus` | `() => void` | 내부 컨트롤에 포커스하고 필드를 화면에 스크롤합니다. |
|
|
52
52
|
|
|
53
|
+
## Types
|
|
54
|
+
|
|
55
|
+
### SFieldSize
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
export type SFieldSize = 'sm' | 'md';
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### SFieldAddonAlign
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
export type SFieldAddonAlign = 'start' | 'center' | 'end';
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### SFieldStatus
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
export type SFieldStatus = 'default' | 'pass' | 'error';
|
|
71
|
+
```
|
|
72
|
+
|
|
53
73
|
## Dependencies
|
|
54
74
|
|
|
55
75
|
### Used by
|
|
@@ -58,9 +78,11 @@
|
|
|
58
78
|
- [SChipInput](../SChipInput)
|
|
59
79
|
- [SDatePicker](../SDatePicker)
|
|
60
80
|
- [SDateRangePicker](../SDateRangePicker)
|
|
81
|
+
- [SEditor](../SEditor)
|
|
61
82
|
- [SFilePicker](../SFilePicker)
|
|
62
83
|
- [SInput](../SInput)
|
|
63
84
|
- [SNumberInput](../SNumberInput)
|
|
85
|
+
- [SSearchInput](../SSearchInput)
|
|
64
86
|
- [SSelect](../SSelect)
|
|
65
87
|
- [STextarea](../STextarea)
|
|
66
88
|
- [STimePicker](../STimePicker)
|
|
@@ -81,9 +103,11 @@ graph TD;
|
|
|
81
103
|
SChipInput --> SField
|
|
82
104
|
SDatePicker --> SField
|
|
83
105
|
SDateRangePicker --> SField
|
|
106
|
+
SEditor --> SField
|
|
84
107
|
SFilePicker --> SField
|
|
85
108
|
SInput --> SField
|
|
86
109
|
SNumberInput --> SField
|
|
110
|
+
SSearchInput --> SField
|
|
87
111
|
SSelect --> SField
|
|
88
112
|
STextarea --> SField
|
|
89
113
|
STimePicker --> SField
|
|
@@ -3,6 +3,7 @@ import { type SIconName } from '../SIcon';
|
|
|
3
3
|
import { type STooltipProps } from '../STooltip';
|
|
4
4
|
import { type SColor } from '../../lib/color';
|
|
5
5
|
import { type Rule } from '../../lib/form';
|
|
6
|
+
import { type SFieldWidth } from '../../lib/field-width';
|
|
6
7
|
export type SFieldSize = 'sm' | 'md';
|
|
7
8
|
export type SFieldAddonAlign = 'start' | 'center' | 'end';
|
|
8
9
|
export type SFieldStatus = 'default' | 'pass' | 'error';
|
|
@@ -44,9 +45,15 @@ export interface SFieldProps {
|
|
|
44
45
|
errorMessage?: string;
|
|
45
46
|
/** 필드 상태 — 'error' | 'pass' | 'default'. 'pass'면 초록 테두리 */
|
|
46
47
|
status?: SFieldStatus;
|
|
47
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* 포커스 상태를 밖에서 지정한다. 필드를 감싼 쪽이 포커스를 쥐고 있어(커스텀 트리거·복합 컨트롤)
|
|
50
|
+
* 필드 자신은 `:focus-within` 이 걸리지 않을 때 쓴다. 켜면 강조 테두리·링이 error/pass 보다 우선한다.
|
|
51
|
+
*/
|
|
48
52
|
focused?: boolean;
|
|
49
|
-
/**
|
|
53
|
+
/**
|
|
54
|
+
* 호버 상태를 밖에서 지정한다. `focused` 와 같은 이유로 쓰며, 강조도 같다 —
|
|
55
|
+
* 실제 `:hover` 와 구분되지 않는 모양이어야 밖에서 흉내 낸 것이 티가 나지 않는다.
|
|
56
|
+
*/
|
|
50
57
|
hovered?: boolean;
|
|
51
58
|
/** 유효성 규칙 (검증은 컨트롤에서 수행, API 패리티) */
|
|
52
59
|
rules?: Rule[];
|
|
@@ -57,14 +64,19 @@ export interface SFieldProps {
|
|
|
57
64
|
/** 읽기 전용 (회색 배경) */
|
|
58
65
|
readOnly?: boolean;
|
|
59
66
|
/**
|
|
60
|
-
* 컨트롤
|
|
67
|
+
* 컨트롤 너비. 지정하면 필드가 부모 폭을 다 먹지 않고 (레이블 + width) 만큼만 차지한다.
|
|
61
68
|
* 다른 요소와 나란히 놓으려면 부모를 flex 로 두면 된다.
|
|
69
|
+
*
|
|
70
|
+
* **폭 등급(`'xs' | 'sm' | 'md' | 'lg' | 'xl'`)으로 준다** — `--cmp-field-width-*` 토큰으로 풀리므로
|
|
71
|
+
* 토큰이 바뀌면 화면이 따라간다. 등급은 `maxLength`(= 스키마 상한)로 고르고, 상한이 `xl` 을
|
|
72
|
+
* 넘거나 상한이 없으면 `"100%"` 로 둔다. (`sellmate/field-width-grade` 가 검사한다)
|
|
73
|
+
* 숫자는 px, 그 밖의 문자열은 CSS 길이 그대로다.
|
|
62
74
|
*/
|
|
63
|
-
width?:
|
|
64
|
-
/** 컨트롤 최소 너비 (숫자=px). 하한선만 지정하며 필드는 계속 부모 폭을 채운다 */
|
|
65
|
-
minWidth?:
|
|
75
|
+
width?: SFieldWidth;
|
|
76
|
+
/** 컨트롤 최소 너비 (등급 · 숫자=px · CSS 길이). 하한선만 지정하며 필드는 계속 부모 폭을 채운다 */
|
|
77
|
+
minWidth?: SFieldWidth;
|
|
66
78
|
/**
|
|
67
|
-
* 컨트롤 최대 너비 (숫자=px). 상한선만 지정하며 필드는 그 아래에서 부모 폭을 채운다.
|
|
79
|
+
* 컨트롤 최대 너비 (등급 · 숫자=px · CSS 길이). 상한선만 지정하며 필드는 그 아래에서 부모 폭을 채운다.
|
|
68
80
|
*
|
|
69
81
|
* `width` 와 달리 hug 로 전환하지 않는다 — 부모가 좁으면 같이 좁아지고, 넓어도 여기서 멈춘다.
|
|
70
82
|
* 값 길이가 정해진 컨트롤(날짜·시간)이 `width="100%"` 를 받아 행 전체로 늘어나는 것을 막는 데 쓴다.
|
|
@@ -74,7 +86,7 @@ export interface SFieldProps {
|
|
|
74
86
|
* 상한을 자동으로 늘린다. addon 이 있는데 `labelWidth` 가 없으면 폭을 알 수 없어 상한을
|
|
75
87
|
* 걸지 않는다 — 컨트롤이 잘리는 것보다 넓은 편이 낫다.
|
|
76
88
|
*/
|
|
77
|
-
maxWidth?:
|
|
89
|
+
maxWidth?: SFieldWidth;
|
|
78
90
|
/** 멀티라인(textarea) — 컨트롤 높이를 고정하지 않고 min-height만 적용 */
|
|
79
91
|
multiline?: boolean;
|
|
80
92
|
/**
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
| `value?` | `SFilePickerValue` | `null` | |
|
|
12
12
|
| `placeholder?` | `string` | `'Click to upload'` | |
|
|
13
13
|
| `disabled?` | `boolean` | `false` | |
|
|
14
|
-
| `focused?` | `boolean` | `false` | 포커스
|
|
15
|
-
| `hovered?` | `boolean` | `false` | 호버
|
|
14
|
+
| `focused?` | `boolean` | `false` | 포커스 상태를 밖에서 지정한다 — 강조 테두리·링이 즉시 걸린다 (SField 로 그대로 넘어간다) |
|
|
15
|
+
| `hovered?` | `boolean` | `false` | 호버 상태를 밖에서 지정한다 — 강조는 `focused` 와 같다 (SField 로 그대로 넘어간다) |
|
|
16
16
|
| `inline?` | `boolean` | `false` | 인라인 표시 — SField 테두리 박스만 사라지고 label/rules/hint 는 그대로 동작 |
|
|
17
17
|
| `multiple?` | `boolean` | `false` | |
|
|
18
|
-
| `
|
|
18
|
+
| `showMultipleListBox?` | `boolean` | `false` | multiple 파일 목록을 필드 아래 칩 대신, caret(▼) 클릭 시 열리는 리스트박스 카드로 표시 (바깥 클릭 시 닫힘) |
|
|
19
19
|
| `accept?` | `string` | — | |
|
|
20
20
|
| `maxFileSize?` | `number \| string` | — | |
|
|
21
21
|
| `maxTotalSize?` | `number \| string` | — | |
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
| `hint?` | `string` | — | |
|
|
36
36
|
| `error?` | `boolean` | — | |
|
|
37
37
|
| `errorMessage?` | `string` | — | |
|
|
38
|
-
| `width?` | `
|
|
38
|
+
| `width?` | `SFieldWidth` | — | 컨트롤 너비 — 폭 등급(`'xs' | 'sm' | 'md' | 'lg' | 'xl'`) · 숫자=px · CSS 길이. 등급은 `--cmp-field-width-*` 토큰으로 풀리므로 토큰이 바뀌면 화면이 따라간다. 값 길이에 상한이 없으면 `"100%"` 로 두어 행 전체를 쓴다. |
|
|
39
39
|
| `className?` | `string` | — | |
|
|
40
40
|
| `style?` | `CSSProperties` | — | |
|
|
41
41
|
|
|
@@ -46,6 +46,20 @@
|
|
|
46
46
|
| `onValueChange` | `(value: SFilePickerValue) => void` | 파일 변경 (sdUpdate) |
|
|
47
47
|
| `onReject` | `(detail: { files: File[]; reason: SFilePickerRejectReason }) => void` | 제한 초과 거부 (sdReject) |
|
|
48
48
|
|
|
49
|
+
## Types
|
|
50
|
+
|
|
51
|
+
### SFilePickerValue
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
export type SFilePickerValue = File[] | File | null;
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### SFilePickerRejectReason
|
|
58
|
+
|
|
59
|
+
```ts
|
|
60
|
+
export type SFilePickerRejectReason = 'max-file-size' | 'max-total-size' | 'max-files';
|
|
61
|
+
```
|
|
62
|
+
|
|
49
63
|
## Dependencies
|
|
50
64
|
|
|
51
65
|
### Used by
|
|
@@ -4,6 +4,7 @@ import { type SIconName } from '../SIcon';
|
|
|
4
4
|
import { type SColor } from '../../lib/color';
|
|
5
5
|
import { type Rule } from '../../lib/form';
|
|
6
6
|
import { type STooltipProps } from '../STooltip';
|
|
7
|
+
import { type SFieldWidth } from '../../lib/field-width';
|
|
7
8
|
export type SFilePickerValue = File[] | File | null;
|
|
8
9
|
export type SFilePickerRejectReason = 'max-file-size' | 'max-total-size' | 'max-files';
|
|
9
10
|
export interface SFilePickerProps {
|
|
@@ -17,15 +18,15 @@ export interface SFilePickerProps {
|
|
|
17
18
|
}) => void;
|
|
18
19
|
placeholder?: string;
|
|
19
20
|
disabled?: boolean;
|
|
20
|
-
/** 포커스
|
|
21
|
+
/** 포커스 상태를 밖에서 지정한다 — 강조 테두리·링이 즉시 걸린다 (SField 로 그대로 넘어간다) */
|
|
21
22
|
focused?: boolean;
|
|
22
|
-
/** 호버
|
|
23
|
+
/** 호버 상태를 밖에서 지정한다 — 강조는 `focused` 와 같다 (SField 로 그대로 넘어간다) */
|
|
23
24
|
hovered?: boolean;
|
|
24
25
|
/** 인라인 표시 — SField 테두리 박스만 사라지고 label/rules/hint 는 그대로 동작 */
|
|
25
26
|
inline?: boolean;
|
|
26
27
|
multiple?: boolean;
|
|
27
28
|
/** multiple 파일 목록을 필드 아래 칩 대신, caret(▼) 클릭 시 열리는 리스트박스 카드로 표시 (바깥 클릭 시 닫힘) */
|
|
28
|
-
|
|
29
|
+
showMultipleListBox?: boolean;
|
|
29
30
|
accept?: string;
|
|
30
31
|
maxFileSize?: number | string;
|
|
31
32
|
maxTotalSize?: number | string;
|
|
@@ -45,9 +46,14 @@ export interface SFilePickerProps {
|
|
|
45
46
|
hint?: string;
|
|
46
47
|
error?: boolean;
|
|
47
48
|
errorMessage?: string;
|
|
48
|
-
|
|
49
|
+
/**
|
|
50
|
+
* 컨트롤 너비 — 폭 등급(`'xs' | 'sm' | 'md' | 'lg' | 'xl'`) · 숫자=px · CSS 길이.
|
|
51
|
+
* 등급은 `--cmp-field-width-*` 토큰으로 풀리므로 토큰이 바뀌면 화면이 따라간다.
|
|
52
|
+
* 값 길이에 상한이 없으면 `"100%"` 로 두어 행 전체를 쓴다.
|
|
53
|
+
*/
|
|
54
|
+
width?: SFieldWidth;
|
|
49
55
|
className?: string;
|
|
50
56
|
style?: CSSProperties;
|
|
51
57
|
}
|
|
52
58
|
/** SFilePicker — sd-file-picker 포팅. 단일/다중 파일 + 크기·개수 검증 + 칩 목록. */
|
|
53
|
-
export declare function SFilePicker({ value, onValueChange, onReject, placeholder, disabled, focused, hovered, inline, multiple,
|
|
59
|
+
export declare function SFilePicker({ value, onValueChange, onReject, placeholder, disabled, focused, hovered, inline, multiple, showMultipleListBox, accept, maxFileSize, maxTotalSize, maxFiles, name, rules, status, size, label, labelWidth, icon, iconColor, labelTooltip, labelTooltipProps, addonLabel, addonAlign, hint, error, errorMessage, width, className, style, }: SFilePickerProps): import("react").JSX.Element;
|
|
@@ -16,13 +16,36 @@
|
|
|
16
16
|
| `leftClassName?` | `string` | — | |
|
|
17
17
|
| `style?` | `CSSProperties` | — | |
|
|
18
18
|
|
|
19
|
+
## Types
|
|
20
|
+
|
|
21
|
+
### SFooterBg
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
export type SFooterBg = 'white' | 'grey';
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### SFooterButton
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
export interface SFooterButton {
|
|
31
|
+
label?: string;
|
|
32
|
+
color?: SButtonColor;
|
|
33
|
+
outline?: boolean;
|
|
34
|
+
size?: SButtonSize;
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
onClick?: () => void;
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
19
40
|
## Dependencies
|
|
20
41
|
|
|
21
42
|
### Used by
|
|
22
43
|
|
|
23
44
|
- [SActionModal](../SActionModal)
|
|
45
|
+
- [SCard](../SCard)
|
|
24
46
|
- [SDrawer](../SDrawer)
|
|
25
47
|
- [SPopup](../SPopup)
|
|
48
|
+
- [SSectionHeaderCard](../SSectionHeaderCard)
|
|
26
49
|
|
|
27
50
|
### Depends on
|
|
28
51
|
|
|
@@ -34,7 +57,9 @@
|
|
|
34
57
|
graph TD;
|
|
35
58
|
SFooter --> SButton
|
|
36
59
|
SActionModal --> SFooter
|
|
60
|
+
SCard --> SFooter
|
|
37
61
|
SDrawer --> SFooter
|
|
38
62
|
SPopup --> SFooter
|
|
63
|
+
SSectionHeaderCard --> SFooter
|
|
39
64
|
style SFooter fill:#f9f,stroke:#333,stroke-width:4px
|
|
40
65
|
```
|
|
@@ -11,7 +11,7 @@ export interface SFooterButton {
|
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* @internal
|
|
14
|
-
*
|
|
14
|
+
* 모달·드로어·팝업·카드 하단 영역 공통 props.
|
|
15
15
|
*/
|
|
16
16
|
export interface SFooterProps {
|
|
17
17
|
/** 배경색 */
|
|
@@ -27,10 +27,11 @@ export interface SFooterProps {
|
|
|
27
27
|
style?: CSSProperties;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
|
-
* SFooter —
|
|
30
|
+
* SFooter — 오버레이·카드 내부 전용 footer.
|
|
31
31
|
*
|
|
32
32
|
* @internal
|
|
33
|
-
* SActionModal/SConfirmModal/SDrawer/SPopup 의 하단 액션 영역만
|
|
33
|
+
* SActionModal/SConfirmModal/SDrawer/SPopup 과 SCard/SSectionHeaderCard 의 하단 액션 영역만
|
|
34
|
+
* 공통화한다. 소비자는 호스트 컴포넌트의 `footerLeft`·`button` prop 으로만 닿는다 —
|
|
34
35
|
* 패키지 public export 에 추가하지 말 것.
|
|
35
36
|
*/
|
|
36
37
|
export declare function SFooter({ bg, left, button, children, className, leftClassName, style, }: SFooterProps): import("react").JSX.Element;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
| Prop | Type | Default | Description |
|
|
10
10
|
|------|------|---------|-------------|
|
|
11
|
-
| `
|
|
11
|
+
| `formClassName?` | `string` | — | form 엘리먼트에 추가할 클래스 (sd-form formClassName 대응) |
|
|
12
12
|
| `children?` | `ReactNode` | — | |
|
|
13
13
|
| `className?` | `string` | — | |
|
|
14
14
|
| `style?` | `CSSProperties` | — | |
|
|
@@ -29,3 +29,14 @@
|
|
|
29
29
|
| `reset` | `() => void` | resetValidation 별칭 — sd-form sdReset 대응. 값 리셋은 소비자(value/onChange) 책임 |
|
|
30
30
|
| `focusFirstInvalid` | `() => void` | 첫 번째 실패 필드로 포커스 이동 |
|
|
31
31
|
|
|
32
|
+
## Types
|
|
33
|
+
|
|
34
|
+
### SFormValidationError
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
export interface SFormValidationError {
|
|
38
|
+
/** 검증에 실패한 필드 name 목록 (DOM 순서) */
|
|
39
|
+
names: string[];
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
@@ -15,8 +15,8 @@ export interface SFormHandle {
|
|
|
15
15
|
focusFirstInvalid: () => void;
|
|
16
16
|
}
|
|
17
17
|
export interface SFormProps {
|
|
18
|
-
/** form 엘리먼트에 추가할 클래스 (sd-form
|
|
19
|
-
|
|
18
|
+
/** form 엘리먼트에 추가할 클래스 (sd-form formClassName 대응) */
|
|
19
|
+
formClassName?: string;
|
|
20
20
|
/** 모든 필드 검증 통과 후 발생 (sd-form sdSubmit 대응) */
|
|
21
21
|
onSubmit?: () => void;
|
|
22
22
|
/** 검증 실패 시 실패한 필드 name 목록 전달 (sd-form sdValidationError 대응) */
|
|
@@ -27,14 +27,29 @@
|
|
|
27
27
|
|-------|------|-------------|
|
|
28
28
|
| `onClick` | `(e: MouseEvent<HTMLButtonElement>) => void` | 클릭 (sdClick) |
|
|
29
29
|
|
|
30
|
+
## Types
|
|
31
|
+
|
|
32
|
+
### SGhostButtonSize
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
export type SGhostButtonSize = 'xxs' | 'xs' | 'sm' | 'md' | 'lg';
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### SGhostButtonIntent
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
export type SGhostButtonIntent = 'default' | 'danger' | 'action' | 'subAction' | 'inverse';
|
|
42
|
+
```
|
|
43
|
+
|
|
30
44
|
## Dependencies
|
|
31
45
|
|
|
32
46
|
### Used by
|
|
33
47
|
|
|
34
48
|
- [SBarcodeInput](../SBarcodeInput)
|
|
35
49
|
- [SCalendar](../SCalendar)
|
|
50
|
+
- [SCalendarBoard](../SCalendarBoard)
|
|
36
51
|
- [SChip](../SChip)
|
|
37
|
-
- [
|
|
52
|
+
- [SDatePicker](../SDatePicker)
|
|
38
53
|
- [SDateRangePicker](../SDateRangePicker)
|
|
39
54
|
- [SFilePicker](../SFilePicker)
|
|
40
55
|
- [SGnb](../SGnb)
|
|
@@ -44,7 +59,8 @@
|
|
|
44
59
|
- [SOverlayHeader](../SOverlayHeader)
|
|
45
60
|
- [SPage](../SPage)
|
|
46
61
|
- [SPopover](../SPopover)
|
|
47
|
-
- [
|
|
62
|
+
- [SSearchInput](../SSearchInput)
|
|
63
|
+
- [STable](../STable)
|
|
48
64
|
- [STimePicker](../STimePicker)
|
|
49
65
|
- [STimeRangePicker](../STimeRangePicker)
|
|
50
66
|
- [SToast](../SToast)
|
|
@@ -64,8 +80,9 @@ graph TD;
|
|
|
64
80
|
SGhostButton --> STag
|
|
65
81
|
SBarcodeInput --> SGhostButton
|
|
66
82
|
SCalendar --> SGhostButton
|
|
83
|
+
SCalendarBoard --> SGhostButton
|
|
67
84
|
SChip --> SGhostButton
|
|
68
|
-
|
|
85
|
+
SDatePicker --> SGhostButton
|
|
69
86
|
SDateRangePicker --> SGhostButton
|
|
70
87
|
SFilePicker --> SGhostButton
|
|
71
88
|
SGnb --> SGhostButton
|
|
@@ -75,7 +92,8 @@ graph TD;
|
|
|
75
92
|
SOverlayHeader --> SGhostButton
|
|
76
93
|
SPage --> SGhostButton
|
|
77
94
|
SPopover --> SGhostButton
|
|
78
|
-
|
|
95
|
+
SSearchInput --> SGhostButton
|
|
96
|
+
STable --> SGhostButton
|
|
79
97
|
STimePicker --> SGhostButton
|
|
80
98
|
STimeRangePicker --> SGhostButton
|
|
81
99
|
SToast --> SGhostButton
|
|
@@ -9,16 +9,16 @@
|
|
|
9
9
|
| Prop | Type | Default | Description |
|
|
10
10
|
|------|------|---------|-------------|
|
|
11
11
|
| `type?` | `SGnbType` | — | 메뉴 스타일: box(라운드) / belt(풀폭 행). 미지정 시 SLayout 의 type 을 따른다. |
|
|
12
|
-
| `header?` | `SGnbHeader` | — | 상단바 구조: fix(GNB 폭 고정) / full(레이아웃 전폭). 미지정 시 SLayout 의 header 를 따른다. 단,
|
|
12
|
+
| `header?` | `SGnbHeader` | — | 상단바 구조: fix(GNB 폭 고정) / full(레이아웃 전폭). 미지정 시 SLayout 의 header 를 따른다. 단, showRail 이고 레일에 children 없는 아이템이 있으면 메뉴 폭이 출렁이므로 full 로 강제된다. |
|
|
13
13
|
| `color?` | `SGnbColor` | `'light'` | 색상 테마: light / dark |
|
|
14
|
-
| `items` | `SGnbMenuItem[]` | — | 메뉴 트리 (depth1 → depth2 → depth3).
|
|
15
|
-
| `
|
|
14
|
+
| `items` | `SGnbMenuItem[]` | — | 메뉴 트리 (depth1 → depth2 → depth3). showRail 이면 첫 depth 가 레일이 되고 그 children 이 depth1 이 된다. |
|
|
15
|
+
| `showRail?` | `boolean` | — | 좌측 레일 사용 여부. 켜면 items 의 첫 depth 가 아이콘+라벨 버튼의 세로 레일로 서고, 선택된 레일 아이템의 children 이 오른쪽 메뉴 패널에 깔린다. 미지정 시 SLayout 의 showRail 을 따른다. children 없는 레일 아이템이 활성이면 메뉴 패널은 렌더되지 않고 레일만 남는다. |
|
|
16
16
|
| `value?` | `string` | `''` | 현재 선택된 아이템 value |
|
|
17
17
|
| `folded?` | `boolean` | — | 접힘(레일) 상태. 미지정 시 SLayout 의 folded 를 따른다. |
|
|
18
18
|
| `logo?` | `ReactNode` | — | 상단바 로고 영역 (slot). header="full" 이면 폭이 140px 로 고정된다. |
|
|
19
19
|
| `topContent?` | `ReactNode` | — | 상단바 로고 오른쪽 슬롯 (검색·액션 등). 로고와 16px 띄고 남는 폭을 모두 차지하므로 안에서 자유롭게 정렬한다. 상단바가 전폭인 header="full" 에서만 렌더된다 (fix 는 상단바가 좁은 GNB 컬럼 안이라 놓을 자리가 없다). |
|
|
20
|
-
| `railTop?` | `ReactNode` | — | 레일 상단 고정 슬롯. 레일 아이템이 많아 넘치면 아이템 목록(ul)만 스크롤되고 이 슬롯은 레일 상단(상단바 바로 아래)에 붙어 고정된다.
|
|
21
|
-
| `railFooter?` | `ReactNode` | — | 레일 하단 고정 슬롯. 레일 아이템이 많아 넘치면 아이템 목록(ul)만 스크롤되고 이 슬롯은 레일 하단에 붙어 고정된다.
|
|
20
|
+
| `railTop?` | `ReactNode` | — | 레일 상단 고정 슬롯. 레일 아이템이 많아 넘치면 아이템 목록(ul)만 스크롤되고 이 슬롯은 레일 상단(상단바 바로 아래)에 붙어 고정된다. showRail 일 때만 렌더된다. |
|
|
21
|
+
| `railFooter?` | `ReactNode` | — | 레일 하단 고정 슬롯. 레일 아이템이 많아 넘치면 아이템 목록(ul)만 스크롤되고 이 슬롯은 레일 하단에 붙어 고정된다. showRail 일 때만 렌더된다. |
|
|
22
22
|
| `menuTop?` | `ReactNode` | — | 메뉴 상단 고정 슬롯. 메뉴 아이템이 많아 넘치면 메뉴 목록(ul)만 스크롤되고 이 슬롯은 메뉴 상단에 붙어 고정된다. 메뉴가 렌더될 때만(showMenu) 나타난다. |
|
|
23
23
|
| `menuFooter?` | `ReactNode` | — | 메뉴 하단 고정 슬롯. 메뉴 아이템이 많아 넘치면 메뉴 목록(ul)만 스크롤되고 이 슬롯은 메뉴 하단에 붙어 고정된다. 메뉴가 렌더될 때만(showMenu) 나타난다. |
|
|
24
24
|
| `foldedTop?` | `ReactNode` | — | 접힘(fix 레일) 상단 고정 슬롯. 접으면 본문이 빠져나가며 rail/menu top 도 사라지므로, 48px 폴드 레일 상단(상단바 바로 아래)에 붙는 별도 슬롯이다. header="fix" 로 접혔을 때만 나타난다. |
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
| `resizable?` | `boolean` | `false` | 메뉴 폭을 드래그로 조절할 수 있게 한다. 레일 폭은 고정이고 **메뉴 컬럼만** 늘고 준다. 조절선은 GNB 컬럼의 오른쪽 경계 전체다 — fix 는 상단바 높이까지, full 은 상단바가 전폭이라 본문 높이까지. 접혀 있거나 깔 메뉴가 없으면(레일 리프가 활성) 조절선이 나오지 않는다. |
|
|
27
27
|
| `menuWidth?` | `number` | — | 메뉴 폭(px). 주면 controlled — onMenuWidthChange 로 직접 갱신해야 움직인다 |
|
|
28
28
|
| `defaultMenuWidth?` | `number` | — | 메뉴 초기 폭(px). uncontrolled |
|
|
29
|
+
| `system?` | `ReactNode` | — | system 슬롯(`SGnbSystem`). 놓이는 자리와 형태는 `header` 가 정한다. - fix : GNB 맨 아래 세로 판. 펼치면 메뉴 컬럼 바닥에, 접히면 `foldedFooter` 아래 레일 바닥에 여백 없이 붙는다. showRail 에서 메뉴가 없는 레일 아이템이 활성이면 메뉴 컬럼째 사라지므로 이 슬롯도 함께 빠진다. - full: 전폭 상단바 오른쪽 끝에 가로 한 줄로 선다. 상단바는 접어도 남으므로 조각들도 늘 남는다. 색·형태는 GNB 가 내려주므로 SGnbSystem 에 다시 넘기지 않아도 된다. |
|
|
29
30
|
| `ariaLabel?` | `string` | `'global navigation'` | 메뉴 landmark(nav) 의 접근성 레이블. 한 화면에 nav 가 여럿일 때 구분한다. |
|
|
30
31
|
|
|
31
32
|
#### Events
|
|
@@ -34,12 +35,61 @@
|
|
|
34
35
|
|-------|------|-------------|
|
|
35
36
|
| `onValueChange` | `(value: string) => void` | 선택 변경 (sdUpdate) |
|
|
36
37
|
| `onRailChange` | `(value: string) => void` | 레일 선택 변경. 레일 아이템을 눌러 패널이 바뀔 때 알린다(선택 상태는 SGnb 가 자체 관리). |
|
|
37
|
-
| `
|
|
38
|
+
| `onFoldedChange` | `(folded: boolean) => void` | 접힘 토글 (sdFoldChange) |
|
|
38
39
|
| `onLauncherClick` | `() => void` | 앱런처(그리드) 버튼 클릭. 미지정 시 런처 버튼을 렌더하지 않는다. 접힘 레일(fix)에는 폴드 버튼만 남으므로 표시되지 않는다. |
|
|
39
40
|
| `onMenuWidthChange` | `(width: number) => void` | 메뉴 폭이 확정될 때(드래그를 놓거나 방향키 조작). 드래그하는 동안에는 오지 않는다 |
|
|
40
41
|
|
|
42
|
+
## Types
|
|
43
|
+
|
|
44
|
+
### SGnbType
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
/** 메뉴 스타일: box = 라운드/좁은 들여쓰기, belt = 풀폭 행/넓은 들여쓰기 */
|
|
48
|
+
export type SGnbType = 'box' | 'belt';
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### SGnbHeader
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
/** 상단바 구조: fix = GNB 폭에 고정, full = 레이아웃 전폭 */
|
|
55
|
+
export type SGnbHeader = 'fix' | 'full';
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### SGnbColor
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
/** 색상(테마): light / dark */
|
|
62
|
+
export type SGnbColor = 'light' | 'dark';
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### SGnbMenuItem
|
|
66
|
+
|
|
67
|
+
```ts
|
|
68
|
+
/** GNB 메뉴 아이템 (재귀 트리). depth1 → depth2 → depth3. */
|
|
69
|
+
export interface SGnbMenuItem {
|
|
70
|
+
/** 표시 텍스트 */
|
|
71
|
+
label: string;
|
|
72
|
+
/** 고유 식별값 (선택 상태 비교 기준) */
|
|
73
|
+
value: string;
|
|
74
|
+
/** depth1 전용 아이콘명 */
|
|
75
|
+
icon?: SIconName;
|
|
76
|
+
/** 우측 Tag 뱃지 텍스트 */
|
|
77
|
+
tag?: string;
|
|
78
|
+
/** 뱃지 색. 미지정 시 blue. */
|
|
79
|
+
tagColor?: STagColor;
|
|
80
|
+
/** 비활성 여부 */
|
|
81
|
+
disabled?: boolean;
|
|
82
|
+
/** 하위 아이템 (있으면 펼침/접힘 대상) */
|
|
83
|
+
children?: SGnbMenuItem[];
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
41
87
|
## Dependencies
|
|
42
88
|
|
|
89
|
+
### Used by
|
|
90
|
+
|
|
91
|
+
- [SGnbSystem](../SGnbSystem)
|
|
92
|
+
|
|
43
93
|
### Depends on
|
|
44
94
|
|
|
45
95
|
- [SGhostButton](../SGhostButton)
|
|
@@ -55,5 +105,6 @@ graph TD;
|
|
|
55
105
|
SGnb --> SIcon
|
|
56
106
|
SGnb --> SLayout
|
|
57
107
|
SGnb --> STag
|
|
108
|
+
SGnbSystem --> SGnb
|
|
58
109
|
style SGnb fill:#f9f,stroke:#333,stroke-width:4px
|
|
59
110
|
```
|
|
@@ -1,23 +1,63 @@
|
|
|
1
1
|
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
import type { SGnbSystemPlacement } from '../SGnbSystem/gnbSystem.config';
|
|
2
3
|
import { type SGnbType, type SGnbHeader, type SGnbColor, type SGnbMenuItem } from './gnb.config';
|
|
4
|
+
/**
|
|
5
|
+
* SGnb 가 `system` 슬롯에 내려주는 값. 슬롯에 놓인 SGnbSystem 이 이걸 읽어
|
|
6
|
+
* 색과 형태(가로/세로 · 펼침/접힘)를 GNB 에 맞춘다 — 앱이 같은 값을 두 번 넘기지 않게 한다.
|
|
7
|
+
*
|
|
8
|
+
* 슬롯이 어디에 놓이는지는 header 가 정한다.
|
|
9
|
+
* - fix : 메뉴 컬럼 바닥 · 접힘 레일 바닥 → `placement: 'panel'` (세로 판)
|
|
10
|
+
* - full: 전폭 상단바 오른쪽 끝 → `placement: 'top'` (판 없이 가로 한 줄)
|
|
11
|
+
*
|
|
12
|
+
* `folded` 는 GNB 의 접힘 상태가 아니라 **그 자리가 접힌 레일인지**다. panel 은 두 곳에 놓이고
|
|
13
|
+
* (메뉴 컬럼 바닥 · 접힘 레일 바닥) 각 자리가 자기 형태를 못 박으므로, 접는 동안 아직 미끄러져
|
|
14
|
+
* 나가는 중인 메뉴 컬럼의 패널이 min 형태로 튀지 않는다.
|
|
15
|
+
*
|
|
16
|
+
* 그래서 fix 로 접혀 있는 동안 슬롯 내용은 **두 자리에 함께 마운트된다** — 미끄러져 나간 메뉴
|
|
17
|
+
* 컬럼(잔상)과 레일 바닥(실물). `active` 가 그 둘을 가른다.
|
|
18
|
+
*/
|
|
19
|
+
export interface SGnbSystemContextValue {
|
|
20
|
+
/** GNB 색 */
|
|
21
|
+
color: SGnbColor;
|
|
22
|
+
/** 이 자리가 접힌(48px) 레일인지. `placement: 'top'` 에서는 뜻이 없다 */
|
|
23
|
+
folded: boolean;
|
|
24
|
+
/** 이 자리가 세로 판인지 전폭 상단바인지 */
|
|
25
|
+
placement: SGnbSystemPlacement;
|
|
26
|
+
/**
|
|
27
|
+
* 이 자리가 지금 화면에 살아 있는 자리인가. 접힌 GNB 의 메뉴 컬럼처럼 밖으로 미끄러져 나가
|
|
28
|
+
* 잔상으로만 남는 자리는 `false` 다.
|
|
29
|
+
*
|
|
30
|
+
* 잔상에서도 계정 리스트박스 같은 **떠 있는 층은 함께 숨지 않는다** — SPortal 로 문서 최상단에
|
|
31
|
+
* 그려져 컬럼의 `visibility: hidden` 이 닿지 않기 때문이다. 그래서 잔상이 된 자리는 열어 둔
|
|
32
|
+
* 것을 스스로 닫아야 하고, 그 신호가 이 값이다.
|
|
33
|
+
*/
|
|
34
|
+
active: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* 이 자리가 메뉴 기본 폭(GNB_MENU_WIDTH)보다 좁은가 — `resizable` 로 줄인 메뉴 컬럼이 그렇다.
|
|
37
|
+
* 좁아진 판에서는 알림 개수를 적을 가로가 모자라 개수 대신 점 배지가 붙는다.
|
|
38
|
+
* 없으면 좁지 않은 것으로 본다(접힘 레일·상단바는 자기 규칙을 따르므로 이 값과 무관하다).
|
|
39
|
+
*/
|
|
40
|
+
narrow?: boolean;
|
|
41
|
+
}
|
|
42
|
+
export declare const SGnbSystemContext: import("react").Context<SGnbSystemContextValue | null>;
|
|
3
43
|
export interface SGnbProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'> {
|
|
4
44
|
/** 메뉴 스타일: box(라운드) / belt(풀폭 행). 미지정 시 SLayout 의 type 을 따른다. */
|
|
5
45
|
type?: SGnbType;
|
|
6
46
|
/**
|
|
7
47
|
* 상단바 구조: fix(GNB 폭 고정) / full(레이아웃 전폭). 미지정 시 SLayout 의 header 를 따른다.
|
|
8
|
-
* 단,
|
|
48
|
+
* 단, showRail 이고 레일에 children 없는 아이템이 있으면 메뉴 폭이 출렁이므로 full 로 강제된다.
|
|
9
49
|
*/
|
|
10
50
|
header?: SGnbHeader;
|
|
11
51
|
/** 색상 테마: light / dark */
|
|
12
52
|
color?: SGnbColor;
|
|
13
|
-
/** 메뉴 트리 (depth1 → depth2 → depth3).
|
|
53
|
+
/** 메뉴 트리 (depth1 → depth2 → depth3). showRail 이면 첫 depth 가 레일이 되고 그 children 이 depth1 이 된다. */
|
|
14
54
|
items: SGnbMenuItem[];
|
|
15
55
|
/**
|
|
16
56
|
* 좌측 레일 사용 여부. 켜면 items 의 첫 depth 가 아이콘+라벨 버튼의 세로 레일로 서고,
|
|
17
|
-
* 선택된 레일 아이템의 children 이 오른쪽 메뉴 패널에 깔린다. 미지정 시 SLayout 의
|
|
57
|
+
* 선택된 레일 아이템의 children 이 오른쪽 메뉴 패널에 깔린다. 미지정 시 SLayout 의 showRail 을 따른다.
|
|
18
58
|
* children 없는 레일 아이템이 활성이면 메뉴 패널은 렌더되지 않고 레일만 남는다.
|
|
19
59
|
*/
|
|
20
|
-
|
|
60
|
+
showRail?: boolean;
|
|
21
61
|
/** 현재 선택된 아이템 value */
|
|
22
62
|
value?: string;
|
|
23
63
|
/** 선택 변경 (sdUpdate) */
|
|
@@ -27,7 +67,7 @@ export interface SGnbProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'>
|
|
|
27
67
|
/** 접힘(레일) 상태. 미지정 시 SLayout 의 folded 를 따른다. */
|
|
28
68
|
folded?: boolean;
|
|
29
69
|
/** 접힘 토글 (sdFoldChange) */
|
|
30
|
-
|
|
70
|
+
onFoldedChange?: (folded: boolean) => void;
|
|
31
71
|
/** 앱런처(그리드) 버튼 클릭. 미지정 시 런처 버튼을 렌더하지 않는다. 접힘 레일(fix)에는 폴드 버튼만 남으므로 표시되지 않는다. */
|
|
32
72
|
onLauncherClick?: () => void;
|
|
33
73
|
/** 상단바 로고 영역 (slot). header="full" 이면 폭이 140px 로 고정된다. */
|
|
@@ -40,12 +80,12 @@ export interface SGnbProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'>
|
|
|
40
80
|
topContent?: ReactNode;
|
|
41
81
|
/**
|
|
42
82
|
* 레일 상단 고정 슬롯. 레일 아이템이 많아 넘치면 아이템 목록(ul)만 스크롤되고
|
|
43
|
-
* 이 슬롯은 레일 상단(상단바 바로 아래)에 붙어 고정된다.
|
|
83
|
+
* 이 슬롯은 레일 상단(상단바 바로 아래)에 붙어 고정된다. showRail 일 때만 렌더된다.
|
|
44
84
|
*/
|
|
45
85
|
railTop?: ReactNode;
|
|
46
86
|
/**
|
|
47
87
|
* 레일 하단 고정 슬롯. 레일 아이템이 많아 넘치면 아이템 목록(ul)만 스크롤되고
|
|
48
|
-
* 이 슬롯은 레일 하단에 붙어 고정된다.
|
|
88
|
+
* 이 슬롯은 레일 하단에 붙어 고정된다. showRail 일 때만 렌더된다.
|
|
49
89
|
*/
|
|
50
90
|
railFooter?: ReactNode;
|
|
51
91
|
/**
|
|
@@ -80,6 +120,15 @@ export interface SGnbProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'>
|
|
|
80
120
|
defaultMenuWidth?: number;
|
|
81
121
|
/** 메뉴 폭이 확정될 때(드래그를 놓거나 방향키 조작). 드래그하는 동안에는 오지 않는다 */
|
|
82
122
|
onMenuWidthChange?: (width: number) => void;
|
|
123
|
+
/**
|
|
124
|
+
* system 슬롯(`SGnbSystem`). 놓이는 자리와 형태는 `header` 가 정한다.
|
|
125
|
+
* - fix : GNB 맨 아래 세로 판. 펼치면 메뉴 컬럼 바닥에, 접히면 `foldedFooter` 아래 레일 바닥에
|
|
126
|
+
* 여백 없이 붙는다. showRail 에서 메뉴가 없는 레일 아이템이 활성이면 메뉴 컬럼째 사라지므로
|
|
127
|
+
* 이 슬롯도 함께 빠진다.
|
|
128
|
+
* - full: 전폭 상단바 오른쪽 끝에 가로 한 줄로 선다. 상단바는 접어도 남으므로 조각들도 늘 남는다.
|
|
129
|
+
* 색·형태는 GNB 가 내려주므로 SGnbSystem 에 다시 넘기지 않아도 된다.
|
|
130
|
+
*/
|
|
131
|
+
system?: ReactNode;
|
|
83
132
|
/** 메뉴 landmark(nav) 의 접근성 레이블. 한 화면에 nav 가 여럿일 때 구분한다. */
|
|
84
133
|
ariaLabel?: string;
|
|
85
134
|
}
|
|
@@ -91,8 +140,9 @@ export interface SGnbProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'>
|
|
|
91
140
|
* header 가 배치와 접힘 형태를 정한다:
|
|
92
141
|
* - fix: 상단바가 GNB 컬럼(메뉴 폭) 안에 있다. 접으면 48px 세로 레일로 좁혀지고 상단바에는 폴드 버튼만 남는다.
|
|
93
142
|
* - full: 상단바가 레이아웃 전폭을 가로지르고 그 아래 [메뉴 | 페이지]. 접으면 메뉴만 사라진다.
|
|
143
|
+
* system 조각들도 메뉴 바닥이 아니라 이 상단바 오른쪽 끝으로 올라온다.
|
|
94
144
|
*
|
|
95
|
-
*
|
|
145
|
+
* showRail 이면 items 의 첫 depth 가 좌측 레일(아이콘+라벨 68px)로 서고, 선택된 레일 아이템의
|
|
96
146
|
* children 이 메뉴 패널의 depth1 이 된다 — 트리는 그대로 두고 어디부터 그릴지만 바뀐다.
|
|
97
147
|
* children 없는 레일 아이템은 자기 자신이 선택(리프)이라 메뉴 패널을 렌더하지 않는다. 이런 리프가
|
|
98
148
|
* 하나라도 있으면 활성에 따라 메뉴 폭이 출렁이므로 header 는 full 로 강제해 상단바를 전폭에 고정한다.
|