sellmate-design-system-react 9.0.0-beta.4 → 9.0.0-beta.40
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 +642 -88
- 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 +9 -1
- package/dist/components/SBarcodeInput/SBarcodeInput.d.ts +7 -1
- 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 +15 -1
- package/dist/components/SChipInput/SChipInput.d.ts +7 -1
- package/dist/components/SChipInput/index.d.ts +1 -1
- package/dist/components/SCircleProgress/README.md +8 -0
- package/dist/components/SConfirmModal/README.md +17 -1
- package/dist/components/SConfirmModal/SConfirmModal.d.ts +2 -2
- package/dist/components/SConfirmModal/index.d.ts +1 -1
- package/dist/components/SDatePicker/README.md +20 -2
- package/dist/components/SDatePicker/SDatePicker.d.ts +27 -4
- package/dist/components/SDateRangePicker/README.md +17 -2
- package/dist/components/SDateRangePicker/SDateRangePicker.d.ts +16 -3
- 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 +27 -3
- package/dist/components/SField/SField.d.ts +12 -6
- package/dist/components/SFilePicker/README.md +15 -1
- package/dist/components/SFilePicker/SFilePicker.d.ts +7 -1
- package/dist/components/SFooter/README.md +25 -0
- package/dist/components/SFooter/SFooter.d.ts +4 -3
- package/dist/components/SForm/README.md +11 -0
- package/dist/components/SGhostButton/README.md +22 -4
- package/dist/components/SGnb/README.md +51 -0
- package/dist/components/SGnb/SGnb.d.ts +50 -0
- package/dist/components/SGnb/gnb.config.d.ts +10 -3
- 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 +14 -0
- package/dist/components/SInput/README.md +3 -1
- package/dist/components/SInput/SInput.d.ts +7 -1
- 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 +21 -0
- package/dist/components/SLayout/SLayout.d.ts +4 -0
- 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 +5 -1
- package/dist/components/SList/SList.d.ts +0 -2
- 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 +9 -1
- package/dist/components/SLoadingModal/SLoadingModal.d.ts +2 -2
- package/dist/components/SLoadingModal/index.d.ts +1 -1
- package/dist/components/SNumberInput/README.md +9 -1
- package/dist/components/SNumberInput/SNumberInput.d.ts +7 -1
- package/dist/components/SPage/README.md +47 -4
- package/dist/components/SPage/SPage.d.ts +15 -10
- package/dist/components/SPage/SPageHeader.d.ts +18 -11
- package/dist/components/SPage/index.d.ts +1 -1
- package/dist/components/SPage/page-column.d.ts +25 -0
- package/dist/components/SPopover/README.md +15 -0
- package/dist/components/SPopup/README.md +19 -0
- 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 +24 -6
- package/dist/components/SSelect/SSelect.d.ts +14 -2
- package/dist/components/SSplitter/README.md +15 -0
- package/dist/components/SStepper/README.md +26 -0
- package/dist/components/SSwitch/README.md +13 -0
- 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 +86 -1
- package/dist/components/STable/STable.d.ts +121 -11
- package/dist/components/STable/index.d.ts +1 -1
- package/dist/components/STabs/README.md +12 -1
- package/dist/components/STabs/STabs.d.ts +2 -4
- 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 +18 -0
- package/dist/components/STextLink/STextLink.d.ts +4 -0
- package/dist/components/STextarea/README.md +1 -1
- package/dist/components/STextarea/STextarea.d.ts +7 -1
- package/dist/components/STimePicker/README.md +15 -1
- package/dist/components/STimePicker/STimePicker.d.ts +7 -1
- package/dist/components/STimePicker/timepicker.config.d.ts +4 -2
- package/dist/components/STimeRangePicker/README.md +27 -1
- package/dist/components/STimeRangePicker/STimeRangePicker.d.ts +7 -1
- package/dist/components/SToast/README.md +24 -0
- package/dist/components/SToggle/README.md +8 -0
- package/dist/components/SToggle/index.d.ts +1 -1
- package/dist/components/STooltip/README.md +24 -0
- package/dist/components/STree/README.md +41 -0
- package/dist/components/STree/STree.d.ts +8 -0
- 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 +10754 -5244
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.js +10718 -5244
- 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 +3263 -228
- package/dist/llms.txt +647 -90
- package/dist/playground/categories.d.ts +19 -0
- package/dist/styles.css +1725 -169
- 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
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { type CSSProperties } from 'react';
|
|
2
|
+
import type { Editor } from '@tiptap/core';
|
|
3
|
+
import { type SColor } from '../../lib/color';
|
|
4
|
+
import { type SFieldWidth } from '../../lib/field-width';
|
|
5
|
+
import { type Rule } from '../../lib/form';
|
|
6
|
+
import { type SFieldAddonAlign, type SFieldStatus } from '../SField';
|
|
7
|
+
import { type SIconName } from '../SIcon';
|
|
8
|
+
import { type STooltipProps } from '../STooltip';
|
|
9
|
+
/** ref 로 노출되는 조작 메서드 */
|
|
10
|
+
export interface SEditorHandle {
|
|
11
|
+
/** 편집 영역에 포커스 */
|
|
12
|
+
focus: () => void;
|
|
13
|
+
/** 포커스 해제 */
|
|
14
|
+
blur: () => void;
|
|
15
|
+
/** 현재 내용을 HTML 로 반환 (빈 문서면 빈 문자열) */
|
|
16
|
+
getHTML: () => string;
|
|
17
|
+
/** 현재 내용을 서식 없는 텍스트로 반환 */
|
|
18
|
+
getText: () => string;
|
|
19
|
+
/** 내용을 HTML 로 교체 (onValueChange 를 발생시키지 않는다) */
|
|
20
|
+
setHTML: (html: string) => void;
|
|
21
|
+
/** 내용을 비운다 */
|
|
22
|
+
clear: () => void;
|
|
23
|
+
/** tiptap 에디터 인스턴스 — 확장 명령이 필요할 때만 쓴다 */
|
|
24
|
+
editor: Editor | null;
|
|
25
|
+
}
|
|
26
|
+
export interface SEditorProps {
|
|
27
|
+
/** 값 (제어) — HTML 문자열 */
|
|
28
|
+
value?: string;
|
|
29
|
+
/** 초기값 (비제어) — HTML 문자열 */
|
|
30
|
+
defaultValue?: string;
|
|
31
|
+
/** 값 변경 (sdUpdate) — 빈 문서면 빈 문자열을 준다 */
|
|
32
|
+
onValueChange?: (html: string) => void;
|
|
33
|
+
/** 빈 문서에 보일 안내 문구 */
|
|
34
|
+
placeholder?: string;
|
|
35
|
+
/** 편집 영역 최소 높이 (숫자=px) */
|
|
36
|
+
minHeight?: number | string;
|
|
37
|
+
/** 편집 영역 최대 높이 (숫자=px). 넘으면 편집 영역 안에서만 스크롤한다 */
|
|
38
|
+
maxHeight?: number | string;
|
|
39
|
+
/**
|
|
40
|
+
* **글자에 거는 서식만** 남긴다 — 목록·정렬·인용·코드·링크·이미지·구분선이 빠진다.
|
|
41
|
+
* 막대와 버블 메뉴 양쪽에 함께 걸린다 (한쪽에만 남으면 아무것도 막지 못한다).
|
|
42
|
+
*
|
|
43
|
+
* 받은 글의 문단 구조까지 작성자를 따라가면 곤란한 자리 — 좁은 칸의 메모·사유·짧은
|
|
44
|
+
* 안내문 — 에 쓴다. 반대로 서식이 아예 필요 없다면 `SEditor` 가 아니라 `STextarea` 다.
|
|
45
|
+
*/
|
|
46
|
+
simple?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* 이미지 업로드 — 고른 파일을 저장하고 **표시할 URL 을 돌려준다.**
|
|
49
|
+
* 저장 위치는 앱마다 다르므로 DS 가 정하지 않는다. 이 훅이 없으면 툴바에서
|
|
50
|
+
* 이미지 항목이 빠진다 (본문에 base64 를 박지 않는다 — HTML 이 그대로 DB 로 실려 간다).
|
|
51
|
+
*/
|
|
52
|
+
onImageUpload?: (file: File) => Promise<string>;
|
|
53
|
+
/** 유효성 규칙 — blur 시 자동 검증 */
|
|
54
|
+
rules?: Rule[];
|
|
55
|
+
/** 필드 상태 ('default' | 'pass' | 'error') */
|
|
56
|
+
status?: SFieldStatus;
|
|
57
|
+
/** 포커스 상태 (제어/반영) */
|
|
58
|
+
focused?: boolean;
|
|
59
|
+
/** 호버 상태 (제어/반영) */
|
|
60
|
+
hovered?: boolean;
|
|
61
|
+
/** 폼 전송용 name */
|
|
62
|
+
name?: string;
|
|
63
|
+
/** 편집 영역 className */
|
|
64
|
+
editorClass?: string;
|
|
65
|
+
/** 편집 영역 style */
|
|
66
|
+
editorStyle?: CSSProperties;
|
|
67
|
+
/** 포커스 진입 */
|
|
68
|
+
onFocus?: () => void;
|
|
69
|
+
/** 포커스 이탈 */
|
|
70
|
+
onBlur?: () => void;
|
|
71
|
+
label?: string;
|
|
72
|
+
labelWidth?: number | string;
|
|
73
|
+
/** 레이블 영역 아이콘 */
|
|
74
|
+
icon?: SIconName;
|
|
75
|
+
iconColor?: SColor;
|
|
76
|
+
/** 레이블 툴팁 텍스트 */
|
|
77
|
+
labelTooltip?: string;
|
|
78
|
+
/** 레이블 툴팁 상세 옵션 */
|
|
79
|
+
labelTooltipProps?: Partial<STooltipProps>;
|
|
80
|
+
/** 우측 어드온 레이블 */
|
|
81
|
+
addonLabel?: string;
|
|
82
|
+
/** 어드온 정렬 */
|
|
83
|
+
addonAlign?: SFieldAddonAlign;
|
|
84
|
+
hint?: string;
|
|
85
|
+
error?: boolean;
|
|
86
|
+
errorMessage?: string;
|
|
87
|
+
/**
|
|
88
|
+
* 컨트롤 너비 — 폭 등급(`'xs' | 'sm' | 'md' | 'lg' | 'xl'`) · 숫자=px · CSS 길이.
|
|
89
|
+
* 본문 길이에 상한이 없으므로 기본은 `"100%"`(행 전체)다.
|
|
90
|
+
*/
|
|
91
|
+
width?: SFieldWidth;
|
|
92
|
+
disabled?: boolean;
|
|
93
|
+
readOnly?: boolean;
|
|
94
|
+
className?: string;
|
|
95
|
+
style?: CSSProperties;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* SEditor — tiptap 기반 리치 텍스트 에디터.
|
|
99
|
+
*
|
|
100
|
+
* 값은 **HTML 문자열**로 주고받는다. 들어온 HTML 은 tiptap 스키마가 파싱하므로 스키마에 없는
|
|
101
|
+
* 태그·속성(script·onerror …)은 그 자리에서 떨어져 나간다 — 별도 살균기를 거치지 않는다.
|
|
102
|
+
* 테두리 박스·라벨·에러 표시는 `SField`(multiline) 가 소유하고, 이 컴포넌트는 그 안에
|
|
103
|
+
* 툴바와 편집 영역만 세로로 쌓는다.
|
|
104
|
+
*
|
|
105
|
+
* 글을 선택했을 때 그 위에 뜨는 서식 판(버블 메뉴)은 **끄고 켜는 것이 아니다** — 편집할 수
|
|
106
|
+
* 있으면 언제나 뜬다. 툴바까지 커서를 옮기지 않고 바로 서식을 거는 길이라 화면마다 있고
|
|
107
|
+
* 없고가 달라지면 그 자체가 학습 비용이 된다. 구성은 `simple` 이 툴바와 함께 정한다.
|
|
108
|
+
*
|
|
109
|
+
* tiptap 은 **마운트한 뒤에 불러온다** — 정적으로 묶으면 SEditor 를 한 번도 쓰지 않는 소비
|
|
110
|
+
* 앱까지 tiptap·prosemirror 를 번들에 지고 간다 (`tiptap-api.ts` 주석 참고). 불러오는 동안은
|
|
111
|
+
* 같은 크기의 빈 편집 영역이 자리를 지키므로 화면이 튀지 않고, 그 사이 `ref` 의 메서드는
|
|
112
|
+
* 아무 일도 하지 않는다 — `focus()` 만은 기억해 두었다가 준비되는 순간 흘려보낸다.
|
|
113
|
+
*/
|
|
114
|
+
export declare const SEditor: import("react").ForwardRefExoticComponent<SEditorProps & import("react").RefAttributes<SEditorHandle>>;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { SVGProps } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* SEditor 서식 툴바 아이콘 (로컬 전용).
|
|
4
|
+
*
|
|
5
|
+
* 공용 아이콘 셋(`SIcon` / `icons.gen.tsx`)은 디자인팀 소유이고 서식(bold·italic·정렬·목록 …)
|
|
6
|
+
* 아이콘이 아직 없다. 여기 있는 것들은 그 자리를 메우는 임시 도형이며, 정식 아이콘이 셋에
|
|
7
|
+
* 들어오면 이 파일을 지우고 `SIcon` 으로 교체한다. **다른 컴포넌트에서 import 하지 않는다.**
|
|
8
|
+
*
|
|
9
|
+
* 도형은 tiptap Simple Editor 템플릿의 아이콘 셋을 그대로 옮겼다
|
|
10
|
+
* (ueberdosis/tiptap-ui-components, MIT © 2025 Tiptap — `apps/web/src/components/tiptap-icons`).
|
|
11
|
+
* 24×24 격자에 획 굵기 2 의 면(fill) 도형이고 색은 전부 `currentColor` 를 따른다 — 버튼이
|
|
12
|
+
* 토큰으로 정한 색이 그대로 내려온다. 새 아이콘을 더할 때도 이 격자·굵기를 지킨다.
|
|
13
|
+
*
|
|
14
|
+
* 템플릿에 없어 직접 그린 것은 `IconTextColor`·`IconHorizontalRule`·`IconTable` 뿐이다
|
|
15
|
+
* (각 주석 참고).
|
|
16
|
+
*/
|
|
17
|
+
export type SEditorIconProps = {
|
|
18
|
+
size?: number | string;
|
|
19
|
+
} & SVGProps<SVGSVGElement>;
|
|
20
|
+
/** 제목 — 지금 단계의 도형을 보여 준다 (본문이면 단계 없는 H) */
|
|
21
|
+
export declare const IconHeading: ({ level, ...p }: SEditorIconProps & {
|
|
22
|
+
level?: 0 | 1 | 2 | 3;
|
|
23
|
+
}) => import("react").JSX.Element;
|
|
24
|
+
export declare const IconBold: (p: SEditorIconProps) => import("react").JSX.Element;
|
|
25
|
+
export declare const IconItalic: (p: SEditorIconProps) => import("react").JSX.Element;
|
|
26
|
+
export declare const IconUnderline: (p: SEditorIconProps) => import("react").JSX.Element;
|
|
27
|
+
export declare const IconStrike: (p: SEditorIconProps) => import("react").JSX.Element;
|
|
28
|
+
/** 인라인 코드 */
|
|
29
|
+
export declare const IconCode: (p: SEditorIconProps) => import("react").JSX.Element;
|
|
30
|
+
export declare const IconCodeBlock: (p: SEditorIconProps) => import("react").JSX.Element;
|
|
31
|
+
export declare const IconBlockquote: (p: SEditorIconProps) => import("react").JSX.Element;
|
|
32
|
+
export declare const IconAlignLeft: (p: SEditorIconProps) => import("react").JSX.Element;
|
|
33
|
+
export declare const IconAlignCenter: (p: SEditorIconProps) => import("react").JSX.Element;
|
|
34
|
+
export declare const IconAlignRight: (p: SEditorIconProps) => import("react").JSX.Element;
|
|
35
|
+
export declare const IconAlignJustify: (p: SEditorIconProps) => import("react").JSX.Element;
|
|
36
|
+
export declare const IconBulletList: (p: SEditorIconProps) => import("react").JSX.Element;
|
|
37
|
+
export declare const IconOrderedList: (p: SEditorIconProps) => import("react").JSX.Element;
|
|
38
|
+
export declare const IconTaskList: (p: SEditorIconProps) => import("react").JSX.Element;
|
|
39
|
+
export declare const IconLink: (p: SEditorIconProps) => import("react").JSX.Element;
|
|
40
|
+
/** 좁은 화면 툴바의 하위 뷰에서 되돌아가기 */
|
|
41
|
+
export declare const IconArrowLeft: (p: SEditorIconProps) => import("react").JSX.Element;
|
|
42
|
+
export declare const IconUndo: (p: SEditorIconProps) => import("react").JSX.Element;
|
|
43
|
+
export declare const IconRedo: (p: SEditorIconProps) => import("react").JSX.Element;
|
|
44
|
+
/**
|
|
45
|
+
* 글자색 — 템플릿에 없어 직접 그렸다 (Simple Editor 에는 글자색 항목이 없다).
|
|
46
|
+
*
|
|
47
|
+
* 나머지 아이콘이 면 도형이라 A 도 같은 굵기(2)로 보이도록 획으로 긋고 끝을 둥글렸다 —
|
|
48
|
+
* 템플릿의 막대(`rx=1` 인 2px 사각형)와 같은 인상이다. 지금 고른 색은 툴바 버튼이 아이콘
|
|
49
|
+
* 아래 막대로 따로 보여 준다.
|
|
50
|
+
*/
|
|
51
|
+
export declare const IconTextColor: (p: SEditorIconProps) => import("react").JSX.Element;
|
|
52
|
+
/**
|
|
53
|
+
* 표 — 템플릿에 없어 직접 그렸다 (Simple Editor 에는 표가 없다).
|
|
54
|
+
*
|
|
55
|
+
* 테두리를 획으로 긋지 않고 **칸 네 개를 면으로 찍는다** — 다른 아이콘이 모두 면 도형이라
|
|
56
|
+
* 16px 에서 획으로 그린 격자만 유독 흐려 보인다. 첫 줄이 헤더라 한 덩어리로 이어 붙였다.
|
|
57
|
+
*/
|
|
58
|
+
export declare const IconTable: (p: SEditorIconProps) => import("react").JSX.Element;
|
|
59
|
+
/**
|
|
60
|
+
* 구분선 — 템플릿에 없어 직접 그렸다 (Simple Editor 는 구분선 노드는 있지만 툴바 항목이 없다).
|
|
61
|
+
* 막대는 템플릿의 정렬 아이콘과 같은 규격(높이 2, `rx=1`)이다.
|
|
62
|
+
*/
|
|
63
|
+
export declare const IconHorizontalRule: (p: SEditorIconProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
import type { SColor } from '../../lib/color';
|
|
3
|
+
/** 툴바에 놓을 수 있는 항목. `'|'` 는 구분선이다. */
|
|
4
|
+
export declare const SEDITOR_TOOLBAR_ITEMS: readonly ["heading", "fontSize", "bold", "italic", "underline", "strike", "code", "color", "alignLeft", "alignCenter", "alignRight", "alignJustify", "bulletList", "orderedList", "taskList", "list", "blockquote", "codeBlock", "horizontalRule", "link", "image", "table", "undo", "redo"];
|
|
5
|
+
export type SEditorToolbarAction = (typeof SEDITOR_TOOLBAR_ITEMS)[number];
|
|
6
|
+
export type SEditorToolbarItem = SEditorToolbarAction | '|';
|
|
7
|
+
/**
|
|
8
|
+
* 기본 툴바 — 쓸 수 있는 것을 **모두** 보인다. 순서는 tiptap Simple Editor 템플릿을 따른다.
|
|
9
|
+
*
|
|
10
|
+
* 이력 → 블록(제목·글자 크기·목록·인용·코드블록) → 서식 → 정렬 → 삽입.
|
|
11
|
+
*
|
|
12
|
+
* 빠진 것은 `bulletList`·`orderedList`·`taskList` 뿐인데, 이 셋은 `list` 드롭다운 하나로
|
|
13
|
+
* 이미 들어와 있다 — 함께 놓으면 같은 명령이 툴바에 두 번 나온다. 목록을 드롭다운이 아니라
|
|
14
|
+
* 버튼 셋으로 펼치고 싶은 화면만 `toolbar` 로 직접 조합한다.
|
|
15
|
+
*
|
|
16
|
+
* `image` 는 `onImageUpload` 를 받았을 때만 그려진다 (훅이 없으면 저장할 곳이 없다).
|
|
17
|
+
*/
|
|
18
|
+
export declare const SEDITOR_DEFAULT_TOOLBAR: SEditorToolbarItem[];
|
|
19
|
+
/**
|
|
20
|
+
* 간단 툴바 (`simple`) — **글자에 거는 서식만** 남긴다.
|
|
21
|
+
*
|
|
22
|
+
* 목록·정렬·인용·코드·링크·이미지·구분선처럼 **글의 구조를 바꾸는** 항목을 뺀 구성이다.
|
|
23
|
+
* 받은 글이 다시 화면에 그려질 때 문단 구조까지 작성자를 따라가면 곤란한 자리 — 좁은 칸에
|
|
24
|
+
* 놓인 메모·사유·짧은 안내문 — 를 위한 것이다.
|
|
25
|
+
*
|
|
26
|
+
* 제목·글자 크기는 남긴다. 둘 다 글의 뼈대가 아니라 **글자의 크기**를 정하는 항목이라
|
|
27
|
+
* 강조를 거는 데 쓰이고, 이것까지 빼면 남는 것이 굵게·색뿐이라 `STextarea` 와 다를 바 없다.
|
|
28
|
+
*/
|
|
29
|
+
export declare const SEDITOR_SIMPLE_TOOLBAR: SEditorToolbarItem[];
|
|
30
|
+
/**
|
|
31
|
+
* 기본 버블 메뉴 — 글을 선택했을 때 그 위에 뜨는 판의 구성.
|
|
32
|
+
*
|
|
33
|
+
* tiptap Simple Editor 에는 버블 메뉴가 없다. 그래서 구성은 템플릿 툴바의 **서식 묶음**을
|
|
34
|
+
* 그대로 가져왔다 — 선택한 글에 바로 걸 수 있는 것만 남기고 블록(제목·목록·인용)·정렬·
|
|
35
|
+
* 삽입은 뺐다. 그것들은 커서만 있어도 되므로 막대에서 누르는 편이 낫다.
|
|
36
|
+
*
|
|
37
|
+
* 판은 선택 영역 위에 뜨는 한 줄이라 줄바꿈하지 않는다 — 항목을 늘릴 때 폭을 함께 본다.
|
|
38
|
+
*/
|
|
39
|
+
export declare const SEDITOR_DEFAULT_BUBBLE_MENU: SEditorToolbarItem[];
|
|
40
|
+
/**
|
|
41
|
+
* 간단 모드(`simple`)의 버블 메뉴 — 막대와 같은 범위로 맞춘다.
|
|
42
|
+
*
|
|
43
|
+
* 막대에서 링크·코드를 뺐는데 판에는 남아 있으면 간단 모드가 아무것도 막지 못한다.
|
|
44
|
+
* 선택한 글에 걸 수 있는 것은 두 곳이 같아야 한다.
|
|
45
|
+
*/
|
|
46
|
+
export declare const SEDITOR_SIMPLE_BUBBLE_MENU: SEditorToolbarItem[];
|
|
47
|
+
/** 제목 단계 — 본문 12px 위로 14 / 16 / 18 (DS 타이포 heading sm·md·lg) */
|
|
48
|
+
export declare const SEDITOR_HEADING_LEVELS: readonly [1, 2, 3];
|
|
49
|
+
export type SEditorHeadingLevel = (typeof SEDITOR_HEADING_LEVELS)[number];
|
|
50
|
+
export declare const SEDITOR_HEADING_LABELS: Record<SEditorHeadingLevel | 0, string>;
|
|
51
|
+
/**
|
|
52
|
+
* 글자 크기 선택지 (px) — 워드프로세서의 눈금과 같은 단계다.
|
|
53
|
+
*
|
|
54
|
+
* 화면의 본문 리듬은 DS 타이포 스케일(`--text-*`)이 잡는다. 이 목록은 그 리듬이 아니라
|
|
55
|
+
* **작성자가 글 안에서 직접 크기를 지정할 때** 쓰는 눈금이라 훨씬 넓다 — 24 이상은 안내문
|
|
56
|
+
* 표지·행사 배너처럼 본문이 아닌 글을 위한 것이다.
|
|
57
|
+
*
|
|
58
|
+
* **눈금을 좁히는 prop 은 없다** — 화면마다 고를 수 있는 크기가 다르면 같은 글이 어디에
|
|
59
|
+
* 붙느냐에 따라 다르게 보인다. 작성자가 리듬(AGENTS.md §2-1: 본문 12px)을 벗어나면 곤란한
|
|
60
|
+
* 자리라면 애초에 `SEditor` 가 아니라 `STextarea` 가 맞는 자리인지 먼저 본다.
|
|
61
|
+
*/
|
|
62
|
+
export declare const SEDITOR_FONT_SIZES: readonly [8, 9, 10, 11, 12, 14, 16, 18, 24, 30, 36, 48, 60, 72];
|
|
63
|
+
/**
|
|
64
|
+
* 크기를 지정하지 않은 문단이 실제로 보이는 크기 — 드롭다운의 `기본` 항목이 되돌리는 자리다.
|
|
65
|
+
* 제목(h1~h3)은 자기 크기를 따로 가지므로 이 값과 무관하다.
|
|
66
|
+
*/
|
|
67
|
+
export declare const SEDITOR_DEFAULT_FONT_SIZE = 12;
|
|
68
|
+
export interface SEditorColorOption {
|
|
69
|
+
/** 팔레트 칸의 접근성 레이블·툴팁 */
|
|
70
|
+
label: string;
|
|
71
|
+
/** 팔레트 키(`red_75` …) 또는 CSS 색상 문자열 */
|
|
72
|
+
color: SColor;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* 글자색 팔레트 — 역할 토큰(`--color-fg-*`)을 그대로 쓴다. 바꾸는 prop 은 없다.
|
|
76
|
+
*
|
|
77
|
+
* 저장되는 HTML 에 `style="color: var(--color-fg-danger)"` 형태로 남으므로 토큰이 바뀌면
|
|
78
|
+
* 이미 저장된 글도 따라간다. 대신 **DS `theme.css` 가 없는 환경(메일 본문 등)으로 그대로
|
|
79
|
+
* 내보내면 색이 풀린다** — 그런 반출이 필요하면 내보내는 쪽에서 토큰을 실제 색으로 푼다.
|
|
80
|
+
*/
|
|
81
|
+
export declare const SEDITOR_DEFAULT_COLORS: SEditorColorOption[];
|
|
82
|
+
/**
|
|
83
|
+
* ProseMirror 가 만드는 요소에 붙는 클래스 — 자식 선택자의 기준점이 된다.
|
|
84
|
+
*
|
|
85
|
+
* **아래 `SEDITOR_CONTENT_CLASS` 에서는 이 상수를 끼워 넣지 말고 이름을 그대로 적는다.**
|
|
86
|
+
* Tailwind 는 소스를 글자로 훑을 뿐 코드를 돌려 보지 않아 `` `[&_.${TASK_LIST_CLASS}]:pl-0` ``
|
|
87
|
+
* 같은 문자열에서는 클래스 후보를 찾지 못하고, 그 규칙이 통째로 CSS 에서 빠진다 — 화면에는
|
|
88
|
+
* 아무 에러 없이 스타일만 사라진다 (표 테두리가 통째로 없던 실제 사고).
|
|
89
|
+
*/
|
|
90
|
+
export declare const TASK_LIST_CLASS = "sd-editor-task-list";
|
|
91
|
+
export declare const TASK_ITEM_CLASS = "sd-editor-task-item";
|
|
92
|
+
export declare const IMAGE_CLASS = "sd-editor-image";
|
|
93
|
+
export declare const TABLE_CLASS = "sd-editor-table";
|
|
94
|
+
export declare const TABLE_ROW_CLASS = "sd-editor-table-row";
|
|
95
|
+
export declare const TABLE_HEADER_CLASS = "sd-editor-table-header";
|
|
96
|
+
export declare const TABLE_CELL_CLASS = "sd-editor-table-cell";
|
|
97
|
+
export interface SEditorExtensionOptions {
|
|
98
|
+
/** 빈 문서에 보일 문구를 그때그때 읽어 오는 게터 */
|
|
99
|
+
getPlaceholder: () => string;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* 편집 영역 안쪽 서식 스타일.
|
|
103
|
+
*
|
|
104
|
+
* ProseMirror 가 만드는 자식 요소(h1·ul·blockquote …)는 JSX 에 없어 클래스를 달 수 없고,
|
|
105
|
+
* Tailwind preflight 가 목록·제목의 기본 스타일을 지워 버린다. 이 패키지에는 컴포넌트 CSS
|
|
106
|
+
* 파일이 없으므로 arbitrary variant 로 자식 선택자를 직접 쓴다.
|
|
107
|
+
*/
|
|
108
|
+
export declare const SEDITOR_CONTENT_CLASS: string;
|
|
109
|
+
export interface SEditorContentStyleOptions {
|
|
110
|
+
minHeight?: number | string;
|
|
111
|
+
maxHeight?: number | string;
|
|
112
|
+
disabled?: boolean;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* 편집 영역(그리고 엔진을 불러오는 동안 그 자리를 대신하는 빈 영역)의 상자·타이포.
|
|
116
|
+
*
|
|
117
|
+
* 두 곳이 같은 값을 써야 로딩이 끝나는 순간 글이 튀지 않는다.
|
|
118
|
+
*/
|
|
119
|
+
export declare const editorContentStyle: ({ minHeight, maxHeight, disabled, }: SEditorContentStyleOptions) => CSSProperties;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { SEditor, type SEditorProps, type SEditorHandle } from './SEditor';
|
|
2
|
+
/**
|
|
3
|
+
* 여기 남은 것은 **저장된 HTML 이 어떻게 보이는지**를 알려 주는 값뿐이다 — 읽기 화면을
|
|
4
|
+
* 직접 그릴 때 쓴다. 툴바 구성(`SEDITOR_*_TOOLBAR`·`SEditorToolbarItem` …)·글자색
|
|
5
|
+
* 팔레트·글자 크기 눈금처럼 **에디터에 넘기던 값**은 그것을 바꾸는 prop 이 모두 없어져
|
|
6
|
+
* 내보내지 않는다. 툴바 구성은 `simple` 로만 고른다.
|
|
7
|
+
*/
|
|
8
|
+
export { SEDITOR_HEADING_LEVELS, SEDITOR_HEADING_LABELS, SEDITOR_DEFAULT_FONT_SIZE, type SEditorHeadingLevel, } from './editor.config';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { AnyExtension } from '@tiptap/core';
|
|
2
|
+
import { type SEditorExtensionOptions } from './editor.config';
|
|
3
|
+
type TiptapReact = typeof import('@tiptap/react');
|
|
4
|
+
type TiptapMenus = typeof import('@tiptap/react/menus');
|
|
5
|
+
/** 동적으로 불러온 tiptap — 이 객체를 거치지 않고는 에디터 코드가 tiptap 을 만지지 않는다. */
|
|
6
|
+
export interface TiptapApi {
|
|
7
|
+
useEditor: TiptapReact['useEditor'];
|
|
8
|
+
useEditorState: TiptapReact['useEditorState'];
|
|
9
|
+
EditorContent: TiptapReact['EditorContent'];
|
|
10
|
+
/** 선택 영역 위에 뜨는 판 — 자리는 floating-ui 가 잡는다 */
|
|
11
|
+
BubbleMenu: TiptapMenus['BubbleMenu'];
|
|
12
|
+
/** tiptap 확장 구성 — 아래 createExtensions 주석 참고 */
|
|
13
|
+
createExtensions: (options: SEditorExtensionOptions) => AnyExtension[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* tiptap 을 불러온다 (이미 불러왔으면 같은 약속을 돌려준다).
|
|
17
|
+
*
|
|
18
|
+
* 실패하면 캐시를 비워 다음 마운트가 다시 시도하게 한다 — 잠깐의 네트워크 문제로
|
|
19
|
+
* 그 세션 내내 에디터가 뜨지 않는 일을 막는다.
|
|
20
|
+
*/
|
|
21
|
+
export declare const loadTiptapApi: () => Promise<TiptapApi>;
|
|
22
|
+
/**
|
|
23
|
+
* 불러온 tiptap. 아직 준비되지 않았으면 `null`.
|
|
24
|
+
*
|
|
25
|
+
* 두 번째 마운트부터는 첫 렌더에 바로 값이 있어 빈 자리가 보이지 않는다.
|
|
26
|
+
* 서버 렌더에서는 언제나 `null` 이라 하이드레이션이 어긋나지 않는다.
|
|
27
|
+
*/
|
|
28
|
+
export declare const useTiptapApi: () => TiptapApi | null;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 좁은 화면인가 (SEditor 전용 — 다른 컴포넌트에서 import 하지 않는다).
|
|
3
|
+
*
|
|
4
|
+
* 이 DS 에는 브레이크포인트 개념이 없다. 여기에 필요한 이유는 하나뿐이라서 — 손가락으로
|
|
5
|
+
* 쓰는 좁은 화면에서는 툴바 위에 뜨는 팝오버(글자색 팔레트·링크 입력)가 화면 밖으로
|
|
6
|
+
* 밀리거나 소프트 키보드에 가린다 — 공용 `lib/` 로 올리지 않고 이 폴더에 둔다. 나중에
|
|
7
|
+
* DS 차원의 브레이크포인트가 생기면 그걸로 갈아끼운다.
|
|
8
|
+
*
|
|
9
|
+
* **뷰포트 폭**을 본다. 필드 자신의 폭이 아니다 — 넓은 화면에서 좁은 칸에 놓인 에디터는
|
|
10
|
+
* 팝오버를 띄울 자리가 옆에 얼마든지 있으므로 하위 뷰로 바꿀 이유가 없다.
|
|
11
|
+
*
|
|
12
|
+
* 서버 렌더와 첫 렌더에서는 언제나 `false` 다 (하이드레이션이 어긋나지 않게).
|
|
13
|
+
*/
|
|
14
|
+
export declare const useIsMobile: () => boolean;
|
|
@@ -31,6 +31,42 @@
|
|
|
31
31
|
|-------|------|-------------|
|
|
32
32
|
| `onToggle` | `(expanded: boolean, event: MouseEvent<HTMLButtonElement>) => void` | |
|
|
33
33
|
|
|
34
|
+
## Types
|
|
35
|
+
|
|
36
|
+
### SExpansionItemSupportingTextPosition
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
export type SExpansionItemSupportingTextPosition = 'right' | 'bottom';
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### SExpansionItemRenderProp
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
export type SExpansionItemRenderProp = (state: SExpansionItemRenderState) => ReactNode;
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### SExpansionItemInteraction
|
|
49
|
+
|
|
50
|
+
```ts
|
|
51
|
+
export type SExpansionItemInteraction = 'chevron';
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### SExpansionItemSize
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
export type SExpansionItemSize = 'sm' | 'md';
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### SExpansionItemRenderState
|
|
61
|
+
|
|
62
|
+
```ts
|
|
63
|
+
export interface SExpansionItemRenderState {
|
|
64
|
+
expanded: boolean;
|
|
65
|
+
selected: boolean;
|
|
66
|
+
disabled: boolean;
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
34
70
|
## Dependencies
|
|
35
71
|
|
|
36
72
|
### Used by
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { SExpansionItem, type SExpansionItemProps, type SExpansionItemRenderProp, type SExpansionItemRenderState, type SExpansionItemSupportingTextPosition, } from './SExpansionItem';
|
|
1
|
+
export { SExpansionItem, type SExpansionItemInteraction, type SExpansionItemProps, type SExpansionItemRenderProp, type SExpansionItemRenderState, type SExpansionItemSize, type SExpansionItemSupportingTextPosition, } from './SExpansionItem';
|
|
@@ -28,9 +28,9 @@
|
|
|
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';
|
|
@@ -57,14 +58,19 @@ export interface SFieldProps {
|
|
|
57
58
|
/** 읽기 전용 (회색 배경) */
|
|
58
59
|
readOnly?: boolean;
|
|
59
60
|
/**
|
|
60
|
-
* 컨트롤
|
|
61
|
+
* 컨트롤 너비. 지정하면 필드가 부모 폭을 다 먹지 않고 (레이블 + width) 만큼만 차지한다.
|
|
61
62
|
* 다른 요소와 나란히 놓으려면 부모를 flex 로 두면 된다.
|
|
63
|
+
*
|
|
64
|
+
* **폭 등급(`'xs' | 'sm' | 'md' | 'lg' | 'xl'`)으로 준다** — `--cmp-field-width-*` 토큰으로 풀리므로
|
|
65
|
+
* 토큰이 바뀌면 화면이 따라간다. 등급은 `maxLength`(= 스키마 상한)로 고르고, 상한이 `xl` 을
|
|
66
|
+
* 넘거나 상한이 없으면 `"100%"` 로 둔다. (`sellmate/field-width-grade` 가 검사한다)
|
|
67
|
+
* 숫자는 px, 그 밖의 문자열은 CSS 길이 그대로다.
|
|
62
68
|
*/
|
|
63
|
-
width?:
|
|
64
|
-
/** 컨트롤 최소 너비 (숫자=px). 하한선만 지정하며 필드는 계속 부모 폭을 채운다 */
|
|
65
|
-
minWidth?:
|
|
69
|
+
width?: SFieldWidth;
|
|
70
|
+
/** 컨트롤 최소 너비 (등급 · 숫자=px · CSS 길이). 하한선만 지정하며 필드는 계속 부모 폭을 채운다 */
|
|
71
|
+
minWidth?: SFieldWidth;
|
|
66
72
|
/**
|
|
67
|
-
* 컨트롤 최대 너비 (숫자=px). 상한선만 지정하며 필드는 그 아래에서 부모 폭을 채운다.
|
|
73
|
+
* 컨트롤 최대 너비 (등급 · 숫자=px · CSS 길이). 상한선만 지정하며 필드는 그 아래에서 부모 폭을 채운다.
|
|
68
74
|
*
|
|
69
75
|
* `width` 와 달리 hug 로 전환하지 않는다 — 부모가 좁으면 같이 좁아지고, 넓어도 여기서 멈춘다.
|
|
70
76
|
* 값 길이가 정해진 컨트롤(날짜·시간)이 `width="100%"` 를 받아 행 전체로 늘어나는 것을 막는 데 쓴다.
|
|
@@ -74,7 +80,7 @@ export interface SFieldProps {
|
|
|
74
80
|
* 상한을 자동으로 늘린다. addon 이 있는데 `labelWidth` 가 없으면 폭을 알 수 없어 상한을
|
|
75
81
|
* 걸지 않는다 — 컨트롤이 잘리는 것보다 넓은 편이 낫다.
|
|
76
82
|
*/
|
|
77
|
-
maxWidth?:
|
|
83
|
+
maxWidth?: SFieldWidth;
|
|
78
84
|
/** 멀티라인(textarea) — 컨트롤 높이를 고정하지 않고 min-height만 적용 */
|
|
79
85
|
multiline?: boolean;
|
|
80
86
|
/**
|
|
@@ -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 {
|
|
@@ -45,7 +46,12 @@ 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
|
}
|
|
@@ -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;
|
|
@@ -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
|
+
|