sellmate-design-system-react 9.0.0-beta.3 → 9.0.0-beta.30

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.
Files changed (164) hide show
  1. package/AGENTS.md +599 -94
  2. package/README.md +111 -9
  3. package/dist/components/SBadge/README.md +24 -0
  4. package/dist/components/SBadge/SBadge.d.ts +1 -1
  5. package/dist/components/SBarcodeInput/README.md +9 -1
  6. package/dist/components/SBarcodeInput/SBarcodeInput.d.ts +7 -1
  7. package/dist/components/SButton/README.md +36 -0
  8. package/dist/components/SCalendar/README.md +13 -0
  9. package/dist/components/SCallout/README.md +15 -0
  10. package/dist/components/SCard/README.md +16 -0
  11. package/dist/components/SCard/SCard.d.ts +17 -2
  12. package/dist/components/SCheckbox/README.md +8 -0
  13. package/dist/components/SChipFilter/README.md +326 -13
  14. package/dist/components/SChipFilter/SChipFilter.d.ts +137 -58
  15. package/dist/components/SChipFilter/index.d.ts +1 -1
  16. package/dist/components/SChipInput/README.md +15 -1
  17. package/dist/components/SChipInput/SChipInput.d.ts +7 -1
  18. package/dist/components/SChipInput/index.d.ts +1 -1
  19. package/dist/components/SCircleProgress/README.md +8 -0
  20. package/dist/components/SConfirmModal/README.md +17 -1
  21. package/dist/components/SConfirmModal/SConfirmModal.d.ts +2 -2
  22. package/dist/components/SConfirmModal/index.d.ts +1 -1
  23. package/dist/components/SDatePicker/README.md +57 -2
  24. package/dist/components/SDatePicker/SDatePicker.d.ts +57 -4
  25. package/dist/components/SDatePicker/index.d.ts +1 -1
  26. package/dist/components/SDateRangePicker/README.md +17 -2
  27. package/dist/components/SDateRangePicker/SDateRangePicker.d.ts +16 -3
  28. package/dist/components/SDivider/README.md +5 -0
  29. package/dist/components/SDivider/SDivider.d.ts +11 -0
  30. package/dist/components/SDraggableItem/README.md +37 -0
  31. package/dist/components/SDraggableItem/SDraggableItem.d.ts +2 -0
  32. package/dist/components/SDraggableItem/index.d.ts +1 -1
  33. package/dist/components/SDraggableList/README.md +30 -0
  34. package/dist/components/SDraggableList/SDraggableList.d.ts +11 -0
  35. package/dist/components/SDraggableList/index.d.ts +1 -1
  36. package/dist/components/SDrawer/README.md +8 -0
  37. package/dist/components/SDropdownButton/README.md +19 -0
  38. package/dist/components/SEditor/EditorBody.d.ts +36 -0
  39. package/dist/components/SEditor/EditorToolbar.d.ts +93 -0
  40. package/dist/components/SEditor/README.md +203 -0
  41. package/dist/components/SEditor/SEditor.d.ts +114 -0
  42. package/dist/components/SEditor/editor-icons.d.ts +63 -0
  43. package/dist/components/SEditor/editor.config.d.ts +119 -0
  44. package/dist/components/SEditor/index.d.ts +8 -0
  45. package/dist/components/SEditor/tiptap-api.d.ts +29 -0
  46. package/dist/components/SEditor/use-is-mobile.d.ts +14 -0
  47. package/dist/components/SExpansionItem/README.md +36 -0
  48. package/dist/components/SExpansionItem/index.d.ts +1 -1
  49. package/dist/components/SField/README.md +27 -2
  50. package/dist/components/SField/SField.d.ts +22 -4
  51. package/dist/components/SFilePicker/README.md +15 -1
  52. package/dist/components/SFilePicker/SFilePicker.d.ts +7 -1
  53. package/dist/components/SFooter/README.md +25 -0
  54. package/dist/components/SFooter/SFooter.d.ts +4 -3
  55. package/dist/components/SForm/README.md +11 -0
  56. package/dist/components/SGhostButton/README.md +20 -4
  57. package/dist/components/SGnb/README.md +51 -0
  58. package/dist/components/SGnb/SGnb.d.ts +22 -0
  59. package/dist/components/SGnb/gnb.config.d.ts +7 -0
  60. package/dist/components/SGnb/index.d.ts +1 -1
  61. package/dist/components/SGnbSystem/README.md +121 -0
  62. package/dist/components/SGnbSystem/SGnbSystem.d.ts +93 -0
  63. package/dist/components/SGnbSystem/gnbSystem.config.d.ts +89 -0
  64. package/dist/components/SGnbSystem/index.d.ts +2 -0
  65. package/dist/components/SGuide/README.md +15 -0
  66. package/dist/components/SIcon/README.md +8 -0
  67. package/dist/components/SIcon/SIcon.d.ts +1 -1
  68. package/dist/components/SIcon/icons.gen.d.ts +2 -0
  69. package/dist/components/SImage/README.md +14 -0
  70. package/dist/components/SInput/README.md +3 -1
  71. package/dist/components/SInput/SInput.d.ts +7 -1
  72. package/dist/components/SKeyValueTable/README.md +87 -0
  73. package/dist/components/SKeyValueTable/SKeyValueTable.d.ts +14 -3
  74. package/dist/components/SKeyValueTable/index.d.ts +1 -1
  75. package/dist/components/SLayout/README.md +16 -0
  76. package/dist/components/SLayout/index.d.ts +1 -1
  77. package/dist/components/SLinearProgress/README.md +15 -0
  78. package/dist/components/SLinearProgress/SLinearProgress.d.ts +3 -0
  79. package/dist/components/SLinearProgress/index.d.ts +1 -1
  80. package/dist/components/SList/README.md +5 -1
  81. package/dist/components/SList/SList.d.ts +0 -2
  82. package/dist/components/SListItem/README.md +41 -0
  83. package/dist/components/SListItem/index.d.ts +1 -1
  84. package/dist/components/SLoadingModal/README.md +9 -1
  85. package/dist/components/SLoadingModal/SLoadingModal.d.ts +2 -2
  86. package/dist/components/SLoadingModal/index.d.ts +1 -1
  87. package/dist/components/SNumberInput/README.md +9 -1
  88. package/dist/components/SNumberInput/SNumberInput.d.ts +7 -1
  89. package/dist/components/SPage/README.md +41 -1
  90. package/dist/components/SPage/SPage.d.ts +24 -2
  91. package/dist/components/SPage/index.d.ts +1 -1
  92. package/dist/components/SPage/page.config.d.ts +8 -0
  93. package/dist/components/SPopover/README.md +15 -0
  94. package/dist/components/SPopup/README.md +19 -0
  95. package/dist/components/SPortal/README.md +14 -0
  96. package/dist/components/SRadio/README.md +20 -0
  97. package/dist/components/SRadioButton/README.md +18 -0
  98. package/dist/components/SRadioButton/SRadioButton.d.ts +1 -1
  99. package/dist/components/SRadioCard/README.md +78 -0
  100. package/dist/components/SRadioCard/SRadioCard.d.ts +29 -0
  101. package/dist/components/SRadioCard/SRadioCardGroup.d.ts +36 -0
  102. package/dist/components/SRadioCard/index.d.ts +2 -0
  103. package/dist/components/SScrollArea/README.md +14 -0
  104. package/dist/components/SSearchInput/README.md +63 -0
  105. package/dist/components/SSearchInput/SSearchInput.d.ts +52 -0
  106. package/dist/components/SSearchInput/index.d.ts +1 -0
  107. package/dist/components/SSectionHeaderCard/README.md +44 -20
  108. package/dist/components/SSectionHeaderCard/SSectionHeaderCard.d.ts +31 -14
  109. package/dist/components/SSectionHeaderCard/index.d.ts +1 -1
  110. package/dist/components/SSelect/README.md +24 -4
  111. package/dist/components/SSelect/SSelect.d.ts +14 -2
  112. package/dist/components/SSplitter/README.md +15 -0
  113. package/dist/components/SStepper/README.md +26 -0
  114. package/dist/components/SSwitch/README.md +13 -0
  115. package/dist/components/SSystemActionButton/README.md +134 -0
  116. package/dist/components/SSystemActionButton/SSystemActionButton.d.ts +79 -0
  117. package/dist/components/SSystemActionButton/index.d.ts +2 -0
  118. package/dist/components/SSystemActionButton/systemActionButton.config.d.ts +87 -0
  119. package/dist/components/STable/README.md +87 -1
  120. package/dist/components/STable/STable.d.ts +141 -11
  121. package/dist/components/STable/index.d.ts +1 -1
  122. package/dist/components/STabs/README.md +12 -1
  123. package/dist/components/STabs/STabs.d.ts +2 -4
  124. package/dist/components/STabs/index.d.ts +1 -1
  125. package/dist/components/STabs/tabs.config.d.ts +3 -4
  126. package/dist/components/STag/README.md +52 -0
  127. package/dist/components/STag/STag.d.ts +3 -1
  128. package/dist/components/STextLink/README.md +17 -0
  129. package/dist/components/STextLink/STextLink.d.ts +2 -0
  130. package/dist/components/STextarea/README.md +1 -1
  131. package/dist/components/STextarea/STextarea.d.ts +7 -1
  132. package/dist/components/STimePicker/README.md +15 -1
  133. package/dist/components/STimePicker/STimePicker.d.ts +7 -1
  134. package/dist/components/STimePicker/timepicker.config.d.ts +7 -0
  135. package/dist/components/STimeRangePicker/README.md +27 -1
  136. package/dist/components/STimeRangePicker/STimeRangePicker.d.ts +7 -1
  137. package/dist/components/SToast/README.md +24 -0
  138. package/dist/components/SToggle/README.md +8 -0
  139. package/dist/components/SToggle/index.d.ts +1 -1
  140. package/dist/components/STooltip/README.md +22 -0
  141. package/dist/components/STree/README.md +41 -0
  142. package/dist/components/STree/STree.d.ts +8 -0
  143. package/dist/components/STree/index.d.ts +1 -1
  144. package/dist/index.cjs +5483 -1150
  145. package/dist/index.cjs.map +1 -1
  146. package/dist/index.d.ts +6 -0
  147. package/dist/index.js +5458 -1149
  148. package/dist/index.js.map +1 -1
  149. package/dist/lib/field-width.d.ts +31 -0
  150. package/dist/lib/floating-height.d.ts +15 -0
  151. package/dist/lib/story-docs.d.ts +19 -3
  152. package/dist/lib/truncated-value-tooltip.d.ts +18 -0
  153. package/dist/llms-full.txt +2813 -193
  154. package/dist/llms.txt +604 -96
  155. package/dist/styles.css +1249 -135
  156. package/dist/theme.css +142 -16
  157. package/eslint/index.mjs +14 -0
  158. package/eslint/lib/table-column.mjs +26 -0
  159. package/eslint/rules/divider-vertical-height.mjs +137 -0
  160. package/eslint/rules/field-width-grade.d.mts +41 -0
  161. package/eslint/rules/field-width-grade.mjs +311 -0
  162. package/eslint/rules/table-column-width.mjs +110 -0
  163. package/eslint/scale.gen.mjs +5 -2
  164. package/package.json +11 -1
@@ -1,14 +1,19 @@
1
1
  import { type CSSProperties, type ReactNode } from 'react';
2
2
  import { type SDateRangeValue } from '../SDateRangePicker';
3
- export type SChipFilterType = 'single' | 'multi' | 'keyword' | 'date' | 'custom';
3
+ /** 필터가 값을 받는 방식. 각 값에 대응하는 필드 인터페이스가 따로 있다 —
4
+ * SChipFilterSelectField·SChipFilterSelectMultiField·SChipFilterKeywordField·
5
+ * SChipFilterDatePickerDayField·SChipFilterDatePickerRangeField·
6
+ * SChipFilterDatePickerStatisticsField·SChipFilterCustomField */
7
+ export type SChipFilterType = SChipFilterField['type'];
4
8
  export type SChipFilterOptionValue = string | number;
5
9
  export type SChipFilterMatchMode = 'contains' | 'exact' | 'excludes';
10
+ export type SChipFilterPeriodUnit = 'day' | 'month' | 'quarter' | 'half' | 'year' | 'custom';
6
11
  export interface SChipFilterOption {
7
12
  value: SChipFilterOptionValue;
8
13
  label: string;
9
14
  disabled?: boolean;
10
15
  }
11
- /** date 필드의 프리셋 라디오 항목 (오늘/지난 7일/사용자 지정 등) */
16
+ /** datepicker-range·datepicker-statistics 필드의 프리셋 라디오 항목 (오늘/지난 7일/일별/월별/사용자 지정 등) */
12
17
  export interface SChipFilterDatePreset {
13
18
  /** 프리셋 식별자 */
14
19
  value: string;
@@ -16,7 +21,8 @@ export interface SChipFilterDatePreset {
16
21
  label: string;
17
22
  /** true면 "사용자 지정" — 선택 시 날짜/기간 피커가 추가로 노출된다. resolve는 무시된다. */
18
23
  custom?: boolean;
19
- /** custom이 아닐 때 실제 값을 계산한다. 단일 날짜(string) 또는 기간([start,end]) 모두 가능 */
24
+ /** custom이 아닐 때 실제 값을 계산한다. 단일 날짜(string) 또는 기간([start,end]) 모두 가능 —
25
+ * datepicker-range 에서는 'd' 를 그 하루짜리 기간 ['d', 'd'] 와 같은 값으로 본다 */
20
26
  resolve?: () => string | SDateRangeValue;
21
27
  }
22
28
  /** keyword 필드에서 matchModes 활성 시 사용하는 값 형태 — 입력해 추가한 키워드 목록 */
@@ -24,59 +30,132 @@ export interface SChipFilterKeywordValue {
24
30
  keywords: string[];
25
31
  mode: SChipFilterMatchMode;
26
32
  }
33
+ /** datepicker-statistics 필드 값 — 선택 단위(unit)와 그 단위의 입력값(value)을 함께 보관한다 */
34
+ export interface SChipFilterPeriodValue {
35
+ unit: SChipFilterPeriodUnit;
36
+ value?: string | number | SDateRangeValue | null;
37
+ }
27
38
  /** custom 필드가 자유롭게 담는 값. 형태를 강제하지 않는다 — render에서 직접 정의한 그대로 읽고 쓴다 */
28
39
  export type SChipFilterCustomValue = Record<string, unknown>;
29
- export type SChipFilterValue = SChipFilterOptionValue | SChipFilterOptionValue[] | SDateRangeValue | SChipFilterKeywordValue | SChipFilterCustomValue | null | undefined;
40
+ export type SChipFilterValue = SChipFilterOptionValue | SChipFilterOptionValue[] | SDateRangeValue | SChipFilterKeywordValue | SChipFilterPeriodValue | SChipFilterCustomValue | null | undefined;
30
41
  export type SChipFilterValueMap = Record<string, SChipFilterValue>;
31
- export interface SChipFilterField {
42
+ /** 타입과 무관하게 모든 필터가 갖는 속성 */
43
+ export interface SChipFilterFieldBase {
32
44
  /** 필터 식별자 */
33
45
  key: string;
34
46
  /** 칩에 표시할 레이블 */
35
47
  label: string;
36
- /** 필터 타입 */
37
- type: SChipFilterType;
38
- /** single/multi/keyword 후보 목록 */
39
- options?: SChipFilterOption[];
40
48
  /** 필수 필터 표시. true면 값이 비어 있을 때 기본값(defaultValue 또는 타입별 내장 기본값)이
41
- * 자동으로 채워지고, clearable은 현재 값이 기본값과 같을 땐 숨겨지며 클릭 시 기본값으로 되돌아간다 */
49
+ * 자동으로 채워지고, clearable은 현재 값이 기본값과 같을 땐 숨겨지며 클릭 시 기본값으로 되돌아간다.
50
+ * 값이 채워졌다가 다시 비면(예: value를 제어하는 부모가 onReset에서 자기 상태를 비우는 경우)
51
+ * 기본값이 한 번 더 채워진다 — required 필드가 빈 채로 남으면 onSearch가 막히기 때문이다.
52
+ * 단 그 값을 부모가 value로 받아 주지 않으면 반복해서 채우지는 않는다 */
42
53
  required?: boolean;
43
- /** 초기값 및 clearable 클릭 시 되돌아갈 값. required 여부와 무관하게 적용된다 — 값이 비어 있으면
44
- * 마운트(또는 "필터 추가"로 활성화) 시 이 값이 자동으로 채워진다. required인데 지정하지 않으면
45
- * 타입별 내장 기본값(single: 첫 번째 옵션, date: 오늘 날짜)을 대신 쓴다 */
54
+ /** 고정 필터. true면 항상 노출되고 "필터 추가" 목록에는 나타나지 않으며 칩을 제거할 수 없다.
55
+ * required도 같은 효과를 낸다. 나머지 필드는 "필터 추가"에서 골랐거나 value에 값이 들어
56
+ * 있는 동안 노출된다 — 값으로 떠 있던 칩은 값이 비면 함께 빠지고, "필터 추가"로 꺼낸 칩은
57
+ * 값이 없어도 세션 동안 자리를 지킨다 */
58
+ fixed?: boolean;
59
+ /** 초기값 및 clearable 클릭 시 되돌아갈 값.
60
+ *
61
+ * **`fixed` 또는 `required` 필드에서만 쓴다.** 그 외 필드에 지정하면 무시하고 콘솔에 알린다 —
62
+ * 뺄 수 있는 필터는 처음에 바에 없는데, 값 맵에는 기본값이 채워져 **보이지도 지울 수도 없는
63
+ * 조건이 검색에 걸린다.** 칩을 지워 값을 비워도 "검색 초기화"가 그 값을 되돌려 놓아 필터가
64
+ * 조용히 되살아난다. 처음부터 값이 정해져 있어야 하는 필터라면 그것이 `fixed`·`required` 다.
65
+ *
66
+ * required인데 지정하지 않으면 타입별 내장 기본값(select: 첫 번째 옵션,
67
+ * datepicker-day·datepicker-range: 오늘 날짜)을 대신 쓴다. 인라인(radioButton) datepicker-range
68
+ * 필드는 팝오버 없이 바에 바로 노출되어 빈 상태로 둘 수 없으므로, 이 규칙과 무관하게 언제나
69
+ * 오늘이 채워진다 */
46
70
  defaultValue?: SChipFilterValue;
47
- /** 경고 테두리 표시 */
48
- warning?: boolean;
49
- /** 비활성 상태 */
71
+ /** 이 필터만 비활성. 바에 남아 있되 팝오버가 열리지 않고 clearable도 눌리지 않는다.
72
+ * 바 전체를 잠그려면 SChipFilterProps.disabled를 쓴다 — 둘은 OR로 합쳐진다 */
50
73
  disabled?: boolean;
51
- /** 처음부터 칩으로 노출할지 여부. false면 "필터 추가" 목록에만 나타나고, 거기서 고르기 전까지는
52
- * 필터 바에 보이지 않는다. activeKeys를 직접 제어하는 경우엔 초기 activeKeys 구성에만 참고되고
53
- * 이후엔 activeKeys가 우선한다 */
54
- defaultActive?: boolean;
55
- /** keyword 입력 placeholder */
74
+ }
75
+ /** 후보 목록에서 고르는 필터 — select·select-multi·keyword */
76
+ export interface SChipFilterOptionsField extends SChipFilterFieldBase {
77
+ /** 고를 수 있는 후보 목록 */
78
+ options?: SChipFilterOption[];
79
+ }
80
+ /** 프리셋으로 기간을 고르는 필터 — datepicker-range·datepicker-statistics */
81
+ export interface SChipFilterPresetsField extends SChipFilterFieldBase {
82
+ /** 프리셋 라디오 목록. 지정하지 않으면 타입별 기본 목록을 쓴다 —
83
+ * datepicker-range: 오늘·지난 7일·지난 30일·사용자 지정,
84
+ * datepicker-statistics: 일별·월별·분기별·반기별·연도별·사용자 지정.
85
+ * 프리셋 라디오 없이 캘린더(datepicker-range) 하나만 두려면 presets: [] 를 명시한다 */
86
+ presets?: SChipFilterDatePreset[];
87
+ /** 선택 가능 범위 */
88
+ selectable?: [string, string];
89
+ /** "사용자 지정" 프리셋으로 기간을 고를 때의 최대 선택 일수.
90
+ * 지정하지 않아도 presets에 custom 프리셋이 있으면 기본 90일이 적용된다 — 무제한 기간
91
+ * 집계·조회로 백엔드에 과도한 요청이 가는 것을 막기 위한 안전장치. 다른 상한이 필요하면
92
+ * 이 값을 직접 지정한다 */
93
+ maxRange?: number;
94
+ }
95
+ /** 후보 하나를 고른다 */
96
+ export interface SChipFilterSelectField extends SChipFilterOptionsField {
97
+ type: 'select';
98
+ }
99
+ /** 후보 여럿을 고른다 */
100
+ export interface SChipFilterSelectMultiField extends SChipFilterOptionsField {
101
+ type: 'select-multi';
102
+ }
103
+ /** keyword 필드의 입력 방식 — 무엇을 키워드 하나의 끝으로 볼지 */
104
+ export type SChipFilterKeywordInput = 'tag' | 'csv';
105
+ /** 키워드를 입력해 누적한다. options는 입력 중 후보로만 뜬다 */
106
+ export interface SChipFilterKeywordField extends SChipFilterOptionsField {
107
+ type: 'keyword';
108
+ /** 입력 placeholder */
56
109
  placeholder?: string;
57
- /** keyword 필드에 검색조건(포함/일치) 토글 표시 여부 */
110
+ /** 입력 방식. 기본 'tag' — Enter 로 하나씩 추가한다.
111
+ * 'csv' 는 쉼표도 구분자로 인정해, 쉼표를 치거나 쉼표가 섞인 텍스트를 붙여넣으면 그 자리에서
112
+ * 여러 개로 쪼개져 목록에 쌓인다(엑셀에서 복사한 코드 목록을 한 번에 넣는 용도).
113
+ * 쌓이는 목록도 값 형태도 'tag' 와 같다 — 구분자만 늘어난다. */
114
+ input?: SChipFilterKeywordInput;
115
+ /** 검색조건(포함/일치) 토글 표시 여부 */
58
116
  matchModes?: boolean;
59
- /** matchModes 활성 시 "미포함"까지 포함해 3개(포함/일치/미포함)로 노출할지. 기본 false — 기존처럼 2개(포함/일치)만 */
117
+ /** matchModes 활성 시 "미포함"까지 포함해 3개(포함/일치/미포함)로 노출할지.
118
+ * 기본 false — 2개(포함/일치)만 */
60
119
  excludeMode?: boolean;
61
- /** date 선택 가능 범위 */
120
+ }
121
+ /** 날짜 하나를 고른다 — 캘린더 트리거 하나만 놓인다. 프리셋으로 고르게 하거나 시작~종료를
122
+ * 받아야 하면 datepicker-range 다 */
123
+ export interface SChipFilterDatePickerDayField extends SChipFilterFieldBase {
124
+ type: 'datepicker-day';
125
+ /** 캘린더 트리거의 placeholder */
126
+ placeholder?: string;
127
+ /** 선택 가능 범위 */
62
128
  selectable?: [string, string];
63
- /** date 프리셋의 "사용자 지정" 기간 선택 시 최대 선택 일수 */
64
- maxRange?: number;
65
- /** date 필드의 프리셋 라디오 목록. 지정하지 않으면 기존처럼 단일 캘린더 트리거로 동작한다 */
66
- presets?: SChipFilterDatePreset[];
67
- /** presets 사용 시 UI 형태 — true: 필터 바에 세그먼트 라디오로 인라인 노출(팝오버 없음),
68
- * false(기본): 칩 클릭 시 팝오버 안에 세로 라디오 목록(+사용자 지정 선택 시 기간 피커) */
129
+ }
130
+ /** 기간(시작~종료)을 고른다. presets를 주면 프리셋 라디오 목록으로 고르고,
131
+ * 주지 않으면 기간 피커 하나만 놓인다 */
132
+ export interface SChipFilterDatePickerRangeField extends SChipFilterPresetsField {
133
+ type: 'datepicker-range';
134
+ /** presets를 필터 바에 세그먼트 라디오로 펼쳐 놓는다(팝오버 없음).
135
+ * 기본 false — 칩 클릭 시 팝오버 안에 세로 라디오 목록(+사용자 지정 선택 시 기간 피커) */
69
136
  radioButton?: boolean;
70
- /** type이 'custom'일 때 필터 바에 이 필드 자리에 놓일 노드를 직접 그린다. 칩+팝오버를 거치지 않고
71
- * 반환한 노드가 그대로 바에 노출된다 — SSelect를 그대로 놓거나 SInput을 바로 노출하는 식으로
72
- * 렌더 방식 자체를 완전히 자유롭게 구성한다. */
137
+ }
138
+ /** 집계 단위(일·월·분기·반기·연)와 그 단위의 값을 함께 고른다 */
139
+ export interface SChipFilterDatePickerStatisticsField extends SChipFilterPresetsField {
140
+ type: 'datepicker-statistics';
141
+ }
142
+ /** 칩+팝오버를 거치지 않고 바에 놓을 노드를 앱이 직접 그린다 */
143
+ export interface SChipFilterCustomField extends SChipFilterFieldBase {
144
+ type: 'custom';
145
+ /** 필터 바의 이 필드 자리에 놓일 노드를 직접 그린다. 반환한 노드가 그대로 바에 노출된다 —
146
+ * SSelect를 그대로 놓거나 SInput을 바로 노출하는 식으로 렌더 방식을 자유롭게 구성한다. */
73
147
  render?: (ctx: {
74
148
  value: SChipFilterValue;
75
149
  disabled?: boolean;
150
+ /** 속한 그룹이 rule을 위반하는 동안 true — 직접 그린 노드에도 경고 표시를 맞추라는 신호다 */
76
151
  warning?: boolean;
77
152
  onValueChange: (value: SChipFilterValue) => void;
78
153
  }) => ReactNode;
79
154
  }
155
+ /** 필터 하나의 정의. type에 따라 쓸 수 있는 속성이 달라진다 —
156
+ * options는 select·select-multi·keyword, presets·maxRange·radioButton은
157
+ * datepicker-range·datepicker-statistics, render는 custom 에만 있다 */
158
+ export type SChipFilterField = SChipFilterSelectField | SChipFilterSelectMultiField | SChipFilterDatePickerDayField | SChipFilterDatePickerRangeField | SChipFilterDatePickerStatisticsField | SChipFilterKeywordField | SChipFilterCustomField;
80
159
  export interface SChipFilterChangeDetail {
81
160
  key: string;
82
161
  value: SChipFilterValue;
@@ -92,7 +171,7 @@ export type SChipFilterGroupRule = {
92
171
  type: 'requireAny';
93
172
  dataGroupName?: string;
94
173
  };
95
- /** 필터를 그룹으로 묶어서 넘길 때의 단위. 그룹이 시작될 때마다 앞에 구분선이 붙는다. */
174
+ /** fields를 이루는 단위. 묶을 것이 없어도 한 그룹으로 감싸 넘긴다 — `[{ fields: [...] }]` */
96
175
  export interface SChipFilterGroup {
97
176
  fields: SChipFilterField[];
98
177
  /** 지정하면 이 규칙으로 그룹을 검증한다. values가 바뀔 때마다 즉시 재평가되는 실시간 검증이라 —
@@ -101,21 +180,27 @@ export interface SChipFilterGroup {
101
180
  rule?: SChipFilterGroupRule;
102
181
  /** rule을 만족하지 않을 때 그룹 중앙에 띄울 툴팁 메시지. 지정 안 하면 rule 종류에 따른 기본 문구를 쓴다 */
103
182
  tooltipMessage?: string;
183
+ /** 이 그룹 앞에 구분선을 넣을지. 검증(rule)과 구분선은 별개라 — 묶어서 검증만 하고 싶으면
184
+ * 주지 않는다. 첫 그룹에는 앞에 가를 것이 없으므로 무시된다(label을 지정했다면 그 구분선이
185
+ * 이미 있다) */
186
+ divider?: boolean;
104
187
  }
105
188
  export interface SChipFilterHandle {
106
189
  /** 특정 필터 편집 팝오버를 엽니다. */
107
190
  open: (key: string) => void;
108
- /** 모든 필터 값을 초기화합니다. */
191
+ /** 바를 처음 상태로 되돌립니다 — 모든 필터 값이 기본값(또는 null)으로 돌아가고, "필터 추가"로
192
+ * 꺼내 놓은 칩도 함께 빠져 fixed·required 필드만 남습니다. 열려 있던 편집 팝오버는 닫힙니다 */
109
193
  reset: () => void;
110
- /** fields를 그룹(SChipFilterGroup[])으로 넘겼을 때, 현재 값 기준으로 각 그룹의 rule을 만족하는지
111
- * 반환합니다. 경고 툴팁은 이 호출과 무관하게 rule 위반 상태인 동안 항상 실시간으로 떠 있으므로,
194
+ /** 현재 값 기준으로 각 그룹의 rule을 만족하는지, 그리고 required 필드가 모두 비어 있지 않은지
195
+ * 반환합니다. rule을 준 그룹이 없고 required 필드도 모두 값이 있으면 항상 true.
196
+ * 경고 툴팁은 이 호출과 무관하게 rule 위반 상태인 동안 항상 실시간으로 떠 있으므로,
112
197
  * 이 메서드는 그 상태를 그대로 읽어오는 용도다(예: 검색 버튼을 눌러도 되는지 사전 확인) */
113
198
  validate: () => boolean;
114
199
  }
115
200
  export interface SChipFilterProps {
116
- /** 필터 정의 목록. 그룹으로 묶으려면 SChipFilterGroup[]을 넘긴다 — 그룹이 시작될 때마다 앞에
117
- * 구분선이 자동으로 붙는다(showLabel·인접 그룹·인라인 date 필터와 중첩되지 않도록 처리됨). */
118
- fields?: SChipFilterField[] | SChipFilterGroup[];
201
+ /** 필터 정의 목록. 묶을 것이 없어도 한 그룹으로 감싸 넘긴다 — `[{ fields: [...] }]`.
202
+ * 그룹은 rule로 함께 검증하거나 divider로 갈라 놓을 때 나눈다. */
203
+ fields?: SChipFilterGroup[];
119
204
  /** 필터 값 맵 */
120
205
  value?: SChipFilterValueMap;
121
206
  /** 전체 값 변경 — 편집 중인 값이 바뀔 때마다(선택할 때마다) 호출된다. 실제 검색 실행은 onSearch를 쓴다 */
@@ -124,31 +209,25 @@ export interface SChipFilterProps {
124
209
  onFilterChange?: (detail: SChipFilterChangeDetail) => void;
125
210
  /** 실제 검색을 실행할 시점 — 편집 팝오버의 "검색" 버튼을 누르거나 팝오버가 닫힐 때(바깥 클릭·Esc·다른
126
211
  * 칩으로 전환 포함) 그 시점의 전체 값 맵과 함께 호출된다. 팝오버가 없는 필드(인라인 date 프리셋·custom,
127
- * clearable ×, 검색 초기화)는 값이 바뀌는 즉시 호출된다. dirty 체크가 기본 적용되어 있어 — 마지막으로
212
+ * clearable ×, 검색 초기화)는 값이 바뀌는 즉시 호출된다. keyword 필터에서 Enter 로 키워드를 추가할 때도
213
+ * 그 즉시 호출된다 — 팝오버는 열린 채라 키워드를 이어서 더 넣을 수 있고, 넣을 때마다 조회가 갱신된다. dirty 체크가 기본 적용되어 있어 — 마지막으로
128
214
  * 실제 검색이 실행된 값 맵과 비교해 하나라도 달라진 게 없으면(예: 팝오버를 열었다 아무것도 안 바꾸고
129
215
  * 닫는 경우) 호출되지 않는다. fields를 그룹으로 넘겼다면 rule을 만족하지 못한 그룹이 있는 동안엔
130
216
  * onSearch가 호출되지 않는다 — 해당 그룹의 경고 툴팁은 이 시점과 무관하게 값이 비어 있는 동안 항상
131
- * 실시간으로 떠 있다(별도로 validate()를 호출할 필요 없음) */
217
+ * 실시간으로 떠 있다(별도로 validate()를 호출할 필요 없음). required 필드가 비어 있는 동안에도
218
+ * 마찬가지로 호출되지 않는다 — 정상 설정(내장 기본값 또는 defaultValue)이라면 원래 비워지지
219
+ * 않지만, defaultValue 없는 select-multi·keyword·custom에 required만 준 오설정에서는 "검색
220
+ * 초기화"·clearable이 값을 null로 비울 수 있어 이때의 안전장치다 */
132
221
  onSearch?: (value: SChipFilterValueMap) => void;
133
- /** 노출 필터 key 목록. 지정하면 제어 컴포넌트로 동작 — "필터 추가"로 고른 필드를 이 배열에 직접
134
- * 넣어줘야 칩이 나타난다(onActiveKeysChange에서 받은 keys로 갱신). 지정하지 않으면 필드별
135
- * defaultActive 값을 기준으로 컴포넌트가 내부 상태로 관리하는 비제어 방식으로 동작한다 */
136
- activeKeys?: string[];
137
- /** 노출 필터 key 변경(칩 추가·제거) — 비제어 방식에서도 참고용으로 호출된다.
138
- * activeKeys를 직접 제어할 때는 이 값을 그대로 activeKeys에 반영해야 한다 */
139
- onActiveKeysChange?: (keys: string[]) => void;
140
- /** "검색 초기화" 클릭 — 모든 필드가 기본값(또는 null)으로 리셋된 뒤 호출된다 */
222
+ /** "검색 초기화" 클릭 — 모든 필드가 기본값(또는 null)으로 리셋되고 "필터 추가"로 꺼낸 칩이
223
+ * 바에서 빠진 뒤 호출된다 */
141
224
  onReset?: () => void;
142
- /** "필터 추가" 목록에서 항목을 골랐을 때 — activeKeys를 직접 제어 중이면 이 콜백에서
143
- * (또는 onActiveKeysChange에서) key를 activeKeys에 추가해줘야 칩이 실제로 나타난다.
144
- * activeKeys를 넘기지 않았다면(비제어) 별도 처리 없이도 컴포넌트가 알아서 칩을 노출한다 */
225
+ /** "필터 추가" 목록에서 항목을 골랐을 때 호출된다(알림). 칩 노출은 컴포넌트가 알아서 하므로
226
+ * 이 콜백에서 따로 해줄 일은 없다 */
145
227
  onAddFilter?: (key: string) => void;
146
- /** 좌측 태그 텍스트 */
228
+ /** 좌측 태그 텍스트. 지정하면 태그와 그 뒤 구분선이 함께 노출되고, 지정하지 않으면(undefined)
229
+ * 둘 다 생략된다 */
147
230
  label?: string;
148
- /** 좌측 태그(label)·구분선 표시 여부 */
149
- showLabel?: boolean;
150
- /** 필터 추가 버튼 표시 여부 */
151
- showAddButton?: boolean;
152
231
  /** 검색 초기화 링크 표시 여부 */
153
232
  showReset?: boolean;
154
233
  /** 바 비활성 상태 */
@@ -1 +1 @@
1
- export { SChipFilter, type SChipFilterChangeDetail, type SChipFilterDatePreset, type SChipFilterField, type SChipFilterGroup, type SChipFilterGroupRule, type SChipFilterHandle, type SChipFilterKeywordValue, type SChipFilterMatchMode, type SChipFilterOption, type SChipFilterOptionValue, type SChipFilterProps, type SChipFilterType, type SChipFilterValue, type SChipFilterValueMap, } from './SChipFilter';
1
+ export { SChipFilter, type SChipFilterChangeDetail, type SChipFilterCustomField, type SChipFilterCustomValue, type SChipFilterDatePickerDayField, type SChipFilterDatePickerRangeField, type SChipFilterDatePickerStatisticsField, type SChipFilterDatePreset, type SChipFilterField, type SChipFilterFieldBase, type SChipFilterGroup, type SChipFilterGroupRule, type SChipFilterHandle, type SChipFilterKeywordField, type SChipFilterKeywordInput, type SChipFilterKeywordValue, type SChipFilterMatchMode, type SChipFilterOption, type SChipFilterOptionValue, type SChipFilterOptionsField, type SChipFilterPeriodUnit, type SChipFilterPeriodValue, type SChipFilterPresetsField, type SChipFilterProps, type SChipFilterSelectField, type SChipFilterSelectMultiField, type SChipFilterType, type SChipFilterValue, type SChipFilterValueMap, } from './SChipFilter';
@@ -30,7 +30,7 @@
30
30
  | `labelWidth?` | `number \| string` | — | |
31
31
  | `hint?` | `string` | — | |
32
32
  | `errorMessage?` | `string` | — | |
33
- | `width?` | `number \| string` | — | |
33
+ | `width?` | `SFieldWidth` | — | 컨트롤 너비 — 폭 등급(`'xs' | 'sm' | 'md' | 'lg' | 'xl'`) · 숫자=px · CSS 길이. 등급은 `--cmp-field-width-*` 토큰으로 풀리므로 토큰이 바뀌면 화면이 따라간다. 값 길이에 상한이 없으면 `"100%"` 로 두어 행 전체를 쓴다. |
34
34
  | `status?` | `SFieldStatus` | — | |
35
35
  | `icon?` | `SIconName` | — | |
36
36
  | `iconColor?` | `SColor` | — | |
@@ -54,6 +54,20 @@
54
54
  |--------|------|-------------|
55
55
  | `focus` | `() => void` | 입력 필드에 포커스를 이동합니다. |
56
56
 
57
+ ## Types
58
+
59
+ ### SChipInputSize
60
+
61
+ ```ts
62
+ export type SChipInputSize = SFieldSize;
63
+ ```
64
+
65
+ ### SChipInputMetaPlacement
66
+
67
+ ```ts
68
+ export type SChipInputMetaPlacement = 'end' | 'inline';
69
+ ```
70
+
57
71
  ## Dependencies
58
72
 
59
73
  ### Depends on
@@ -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 SChipInputSize = SFieldSize;
8
9
  export type SChipInputMetaPlacement = 'end' | 'inline';
9
10
  /** ref로 노출되는 UX 메서드 (sd-chip-input @Method sdFocus 대응) */
@@ -50,7 +51,12 @@ export interface SChipInputProps {
50
51
  labelWidth?: number | string;
51
52
  hint?: string;
52
53
  errorMessage?: string;
53
- width?: number | string;
54
+ /**
55
+ * 컨트롤 너비 — 폭 등급(`'xs' | 'sm' | 'md' | 'lg' | 'xl'`) · 숫자=px · CSS 길이.
56
+ * 등급은 `--cmp-field-width-*` 토큰으로 풀리므로 토큰이 바뀌면 화면이 따라간다.
57
+ * 값 길이에 상한이 없으면 `"100%"` 로 두어 행 전체를 쓴다.
58
+ */
59
+ width?: SFieldWidth;
54
60
  status?: SFieldStatus;
55
61
  icon?: SIconName;
56
62
  iconColor?: SColor;
@@ -1 +1 @@
1
- export { SChipInput, type SChipInputMetaPlacement, type SChipInputProps, type SChipInputSize, } from './SChipInput';
1
+ export { SChipInput, type SChipInputHandle, type SChipInputMetaPlacement, type SChipInputProps, type SChipInputSize, } from './SChipInput';
@@ -17,6 +17,14 @@
17
17
  | `className?` | `string` | — | |
18
18
  | `style?` | `CSSProperties` | — | |
19
19
 
20
+ ## Types
21
+
22
+ ### SCircleProgressType
23
+
24
+ ```ts
25
+ export type SCircleProgressType = 'primary' | 'inverse' | 'error' | 'complete' | 'neutral';
26
+ ```
27
+
20
28
  ## Dependencies
21
29
 
22
30
  ### Used by
@@ -24,7 +24,7 @@
24
24
  | `optionSlot?` | `ReactNode` | — | 콘텐츠 박스에서 태그 오른쪽 커스텀 콘텐츠 (미지정 시 slotLabel 텍스트) |
25
25
  | `contentSlot?` | `ReactNode` | — | 콘텐츠 박스 바로 아래에 통으로 들어가는 커스텀 콘텐츠 (전체 폭) |
26
26
  | `mainButtonLabel?` | `string` | `'확인'` | 메인 버튼 |
27
- | `mainButtonName?` | `ConfirmModalMainButton` | — | 확인 버튼 프리셋 (없으면 type에 따라 자동 결정) |
27
+ | `mainButtonName?` | `SConfirmModalMainButton` | — | 확인 버튼 프리셋 (없으면 type에 따라 자동 결정) |
28
28
  | `subButtonLabel?` | `string` | — | 서브(취소) 버튼 |
29
29
 
30
30
  #### Events
@@ -36,6 +36,22 @@
36
36
  | `onCancel` | `() => void` | |
37
37
  | `onClose` | `() => void` | 닫기(X) 버튼 클릭 (sdClose) |
38
38
 
39
+ ## Types
40
+
41
+ ### SConfirmModalType
42
+
43
+ ```ts
44
+ export type SConfirmModalType = 'positive' | 'negative' | 'default';
45
+ ```
46
+
47
+ ### SConfirmModalMainButton
48
+
49
+ ```ts
50
+ /** 확인 버튼 프리셋 (sd-confirm-modal ConfirmModalMainButton) */
51
+ export type SConfirmModalMainButton =
52
+ 'primary_md' | 'primary_outline_md' | 'danger_md' | 'danger_outline_md' | 'neutral_outline_md';
53
+ ```
54
+
39
55
  ## Dependencies
40
56
 
41
57
  ### Used by
@@ -2,7 +2,7 @@ import { type ReactNode } from 'react';
2
2
  import { type STagColor, type STagShape, type STagSize } from '../STag';
3
3
  export type SConfirmModalType = 'positive' | 'negative' | 'default';
4
4
  /** 확인 버튼 프리셋 (sd-confirm-modal ConfirmModalMainButton) */
5
- export type ConfirmModalMainButton = 'primary_md' | 'primary_outline_md' | 'danger_md' | 'danger_outline_md' | 'neutral_outline_md';
5
+ export type SConfirmModalMainButton = 'primary_md' | 'primary_outline_md' | 'danger_md' | 'danger_outline_md' | 'neutral_outline_md';
6
6
  export interface SConfirmModalProps {
7
7
  open?: boolean;
8
8
  onOpenChange?: (open: boolean) => void;
@@ -34,7 +34,7 @@ export interface SConfirmModalProps {
34
34
  /** 메인 버튼 */
35
35
  mainButtonLabel?: string;
36
36
  /** 확인 버튼 프리셋 (없으면 type에 따라 자동 결정) */
37
- mainButtonName?: ConfirmModalMainButton;
37
+ mainButtonName?: SConfirmModalMainButton;
38
38
  /** 서브(취소) 버튼 */
39
39
  subButtonLabel?: string;
40
40
  /** 확인 버튼 클릭 (sdOk) */
@@ -1 +1 @@
1
- export { SConfirmModal, type SConfirmModalProps, type SConfirmModalType } from './SConfirmModal';
1
+ export { SConfirmModal, type SConfirmModalMainButton, type SConfirmModalProps, type SConfirmModalType, } from './SConfirmModal';
@@ -2,6 +2,25 @@
2
2
 
3
3
  > 자동 생성 문서 — `npm run docs:gen`. 소스: 각 컴포넌트의 Props/Handle 인터페이스 + import 의존성.
4
4
 
5
+ ### SDatePickerMonthListbox
6
+
7
+ #### Props
8
+
9
+ | Prop | Type | Default | Description |
10
+ |------|------|---------|-------------|
11
+ | `value?` | `string \| null` | — | 선택 월 (YYYY-MM) |
12
+ | `anchorYear?` | `number` | — | 연도 리스트가 처음 열릴 때 중앙에 둘 연도. 기본값은 올해 |
13
+ | `selectable?` | `[string, string]` | — | 선택 가능 범위 [시작, 종료] |
14
+ | `className?` | `string` | — | |
15
+ | `style?` | `CSSProperties` | — | |
16
+
17
+ #### Events
18
+
19
+ | Event | Type | Description |
20
+ |-------|------|-------------|
21
+ | `onValueChange` | `(value: string) => void` | |
22
+ | `onMonthSelect` | `(value: string) => void` | 월 컬럼에서 월을 선택했을 때 호출 |
23
+
5
24
  ### SDatePicker
6
25
 
7
26
  #### Props
@@ -14,7 +33,9 @@
14
33
  | `placeholder?` | `string` | — | |
15
34
  | `selectable?` | `[string, string]` | — | 선택 가능 범위 [시작, 종료] |
16
35
  | `disabled?` | `boolean` | `false` | |
17
- | `width?` | `number \| string` | — | |
36
+ | `clearable?` | `boolean` | `false` | 선택값 지우기 버튼. 값이 있을 때만 나타나고, 누르면 `onValueChange` 로 `null` 이 온다. **필수 입력 필드에는 켜지 않는다** — 지우면 다시 고르기 전까지 폼이 통과하지 못한다. `STimePicker` · `STimeRangePicker` · `SSelect` 의 `clearable` 과 같은 규칙이다. |
37
+ | `width?` | `SFieldWidth` | — | 컨트롤 너비 — 폭 등급(`'xs' | 'sm' | 'md' | 'lg' | 'xl'`) · 숫자=px · CSS 길이. 등급은 `--cmp-field-width-*` 토큰으로 풀리므로 토큰이 바뀌면 화면이 따라간다. 값 길이에 상한이 없으면 `"100%"` 로 두어 행 전체를 쓴다. |
38
+ | `maxWidth?` | `SFieldWidth` | — | 컨트롤 최대 너비 — 폭 등급 · 숫자=px · CSS 길이. 지정하지 않으면 값 길이(`YYYY-MM-DD`)에 맞춘 내장 상한(`size='md'` → `lg`, `'sm'` → `md`)이 걸려, `width="100%"` 를 받아도 행 전체로 늘어나지 않는다. 팝오버처럼 폭이 이미 좁게 정해진 자리에서 그 폭을 그대로 채워야 하면 `width="100%"` 와 함께 `maxWidth="100%"` 를 준다. `0` 은 상한을 아예 걸지 않는다 — 부모보다 넓어지는 것까지 허용해야 할 때만 쓴다. |
18
39
  | `name?` | `string` | — | |
19
40
  | `rules?` | `Rule[]` | — | |
20
41
  | `status?` | `SFieldStatus` | — | |
@@ -36,9 +57,41 @@
36
57
 
37
58
  | Event | Type | Description |
38
59
  |-------|------|-------------|
39
- | `onValueChange` | `(value: string) => void` | 선택 변경 (sdUpdate) |
60
+ | `onValueChange` | `(value: string \| null) => void` | 선택 변경 (sdUpdate). `clearable` 로 지우면 `null` 이 온다 |
40
61
  | `onViewChange` | `(view: { year: number; month: number }) => void` | 보이는 연·월 변경 (sdViewChange) |
41
62
 
63
+ ### SDatePickerYearListbox
64
+
65
+ #### Props
66
+
67
+ | Prop | Type | Default | Description |
68
+ |------|------|---------|-------------|
69
+ | `value?` | `string \| null` | — | 선택 연도 (YYYY) |
70
+ | `anchorYear?` | `number` | — | 리스트가 처음 열릴 때 중앙에 둘 연도. 기본값은 올해 |
71
+ | `selectable?` | `[string, string]` | — | 선택 가능 범위 [시작, 종료] |
72
+ | `className?` | `string` | — | |
73
+ | `style?` | `CSSProperties` | — | |
74
+
75
+ #### Events
76
+
77
+ | Event | Type | Description |
78
+ |-------|------|-------------|
79
+ | `onValueChange` | `(year: string) => void` | |
80
+
81
+ ## Types
82
+
83
+ ### SDatePickerMode
84
+
85
+ ```ts
86
+ export type SDatePickerMode = 'date' | 'month' | 'year';
87
+ ```
88
+
89
+ ### SDatePickerSize
90
+
91
+ ```ts
92
+ export type SDatePickerSize = SFieldSize;
93
+ ```
94
+
42
95
  ## Dependencies
43
96
 
44
97
  ### Used by
@@ -50,6 +103,7 @@
50
103
 
51
104
  - [SCalendar](../SCalendar)
52
105
  - [SField](../SField)
106
+ - [SGhostButton](../SGhostButton)
53
107
  - [SIcon](../SIcon)
54
108
 
55
109
  ### Graph
@@ -58,6 +112,7 @@
58
112
  graph TD;
59
113
  SDatePicker --> SCalendar
60
114
  SDatePicker --> SField
115
+ SDatePicker --> SGhostButton
61
116
  SDatePicker --> SIcon
62
117
  SChipFilter --> SDatePicker
63
118
  SKeyValueTable --> SDatePicker
@@ -4,13 +4,14 @@ 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 SDatePickerSize = SFieldSize;
8
9
  export type SDatePickerMode = 'date' | 'month' | 'year';
9
10
  export interface SDatePickerProps {
10
11
  /** 선택 값 (date: YYYY-MM-DD, month: YYYY-MM, year: YYYY) */
11
12
  value?: string | null;
12
- /** 선택 변경 (sdUpdate) */
13
- onValueChange?: (value: string) => void;
13
+ /** 선택 변경 (sdUpdate). `clearable` 로 지우면 `null` 이 온다 */
14
+ onValueChange?: (value: string | null) => void;
14
15
  /** 보이는 연·월 변경 (sdViewChange) */
15
16
  onViewChange?: (view: {
16
17
  year: number;
@@ -23,7 +24,29 @@ export interface SDatePickerProps {
23
24
  /** 선택 가능 범위 [시작, 종료] */
24
25
  selectable?: [string, string];
25
26
  disabled?: boolean;
26
- width?: number | string;
27
+ /**
28
+ * 선택값 지우기 버튼. 값이 있을 때만 나타나고, 누르면 `onValueChange` 로 `null` 이 온다.
29
+ *
30
+ * **필수 입력 필드에는 켜지 않는다** — 지우면 다시 고르기 전까지 폼이 통과하지 못한다.
31
+ * `STimePicker` · `STimeRangePicker` · `SSelect` 의 `clearable` 과 같은 규칙이다.
32
+ */
33
+ clearable?: boolean;
34
+ /**
35
+ * 컨트롤 너비 — 폭 등급(`'xs' | 'sm' | 'md' | 'lg' | 'xl'`) · 숫자=px · CSS 길이.
36
+ * 등급은 `--cmp-field-width-*` 토큰으로 풀리므로 토큰이 바뀌면 화면이 따라간다.
37
+ * 값 길이에 상한이 없으면 `"100%"` 로 두어 행 전체를 쓴다.
38
+ */
39
+ width?: SFieldWidth;
40
+ /**
41
+ * 컨트롤 최대 너비 — 폭 등급 · 숫자=px · CSS 길이. 지정하지 않으면 값 길이(`YYYY-MM-DD`)에 맞춘
42
+ * 내장 상한(`size='md'` → `lg`, `'sm'` → `md`)이 걸려, `width="100%"` 를 받아도 행 전체로
43
+ * 늘어나지 않는다.
44
+ *
45
+ * 팝오버처럼 폭이 이미 좁게 정해진 자리에서 그 폭을 그대로 채워야 하면 `width="100%"` 와 함께
46
+ * `maxWidth="100%"` 를 준다. `0` 은 상한을 아예 걸지 않는다 — 부모보다 넓어지는 것까지 허용해야
47
+ * 할 때만 쓴다.
48
+ */
49
+ maxWidth?: SFieldWidth;
27
50
  name?: string;
28
51
  rules?: Rule[];
29
52
  status?: SFieldStatus;
@@ -41,5 +64,35 @@ export interface SDatePickerProps {
41
64
  className?: string;
42
65
  style?: CSSProperties;
43
66
  }
67
+ export interface SDatePickerYearListboxProps {
68
+ /** 선택 연도 (YYYY) */
69
+ value?: string | null;
70
+ /** 리스트가 처음 열릴 때 중앙에 둘 연도. 기본값은 올해 */
71
+ anchorYear?: number;
72
+ /** 선택 가능 범위 [시작, 종료] */
73
+ selectable?: [string, string];
74
+ onValueChange?: (year: string) => void;
75
+ className?: string;
76
+ style?: CSSProperties;
77
+ }
78
+ /** SDatePickerYearListbox — SDatePicker의 연도 선택 listbox 조각.
79
+ * 자체 트리거/팝오버 없이 연도 리스트만 필요한 커스텀 조합에 재사용한다. */
80
+ export declare function SDatePickerYearListbox({ value, anchorYear, selectable, onValueChange, className, style, }: SDatePickerYearListboxProps): import("react").JSX.Element;
81
+ export interface SDatePickerMonthListboxProps {
82
+ /** 선택 월 (YYYY-MM) */
83
+ value?: string | null;
84
+ /** 연도 리스트가 처음 열릴 때 중앙에 둘 연도. 기본값은 올해 */
85
+ anchorYear?: number;
86
+ /** 선택 가능 범위 [시작, 종료] */
87
+ selectable?: [string, string];
88
+ onValueChange?: (value: string) => void;
89
+ /** 월 컬럼에서 월을 선택했을 때 호출 */
90
+ onMonthSelect?: (value: string) => void;
91
+ className?: string;
92
+ style?: CSSProperties;
93
+ }
94
+ /** SDatePickerMonthListbox — SDatePicker의 월 선택 listbox 조각.
95
+ * 자체 트리거/팝오버 없이 연도+월 리스트만 필요한 커스텀 조합에 재사용한다. */
96
+ export declare function SDatePickerMonthListbox({ value, anchorYear, selectable, onValueChange, onMonthSelect, className, style, }: SDatePickerMonthListboxProps): import("react").JSX.Element;
44
97
  /** SDatePicker — sd-date-picker 포팅. SField + SPopover(SCalendar). */
45
- export declare function SDatePicker({ value, onValueChange, onViewChange, mode, size, placeholder, selectable, disabled, width, name, rules, status, label, labelWidth, icon, iconColor, labelTooltip, labelTooltipProps, addonLabel, addonAlign, hint, error, errorMessage, className, style, }: SDatePickerProps): import("react").JSX.Element;
98
+ export declare function SDatePicker({ value, onValueChange, onViewChange, mode, size, placeholder, selectable, disabled, clearable, width, maxWidth, name, rules, status, label, labelWidth, icon, iconColor, labelTooltip, labelTooltipProps, addonLabel, addonAlign, hint, error, errorMessage, className, style, }: SDatePickerProps): import("react").JSX.Element;
@@ -1 +1 @@
1
- export { SDatePicker, type SDatePickerMode, type SDatePickerProps, type SDatePickerSize, } from './SDatePicker';
1
+ export { SDatePicker, SDatePickerMonthListbox, SDatePickerYearListbox, type SDatePickerMode, type SDatePickerMonthListboxProps, type SDatePickerProps, type SDatePickerSize, type SDatePickerYearListboxProps, } from './SDatePicker';