sellmate-design-system-react 9.0.0-beta.2 → 9.0.0-beta.21

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 (132) hide show
  1. package/AGENTS.md +488 -90
  2. package/README.md +101 -0
  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 +288 -5
  14. package/dist/components/SChipFilter/SChipFilter.d.ts +95 -40
  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/SCircleProgress/README.md +8 -0
  19. package/dist/components/SConfirmModal/README.md +16 -0
  20. package/dist/components/SDatePicker/README.md +60 -4
  21. package/dist/components/SDatePicker/SDatePicker.d.ts +61 -5
  22. package/dist/components/SDatePicker/index.d.ts +1 -1
  23. package/dist/components/SDateRangePicker/README.md +17 -2
  24. package/dist/components/SDateRangePicker/SDateRangePicker.d.ts +16 -3
  25. package/dist/components/SDivider/README.md +4 -0
  26. package/dist/components/SDraggableItem/README.md +37 -0
  27. package/dist/components/SDraggableItem/SDraggableItem.d.ts +2 -0
  28. package/dist/components/SDraggableList/README.md +29 -0
  29. package/dist/components/SDraggableList/SDraggableList.d.ts +10 -0
  30. package/dist/components/SDraggableList/index.d.ts +1 -1
  31. package/dist/components/SDrawer/README.md +8 -0
  32. package/dist/components/SDropdownButton/README.md +19 -0
  33. package/dist/components/SEditor/EditorBody.d.ts +40 -0
  34. package/dist/components/SEditor/EditorToolbar.d.ts +87 -0
  35. package/dist/components/SEditor/README.md +230 -0
  36. package/dist/components/SEditor/SEditor.d.ts +124 -0
  37. package/dist/components/SEditor/editor-icons.d.ts +59 -0
  38. package/dist/components/SEditor/editor.config.d.ts +85 -0
  39. package/dist/components/SEditor/index.d.ts +2 -0
  40. package/dist/components/SEditor/tiptap-api.d.ts +29 -0
  41. package/dist/components/SEditor/use-is-mobile.d.ts +14 -0
  42. package/dist/components/SExpansionItem/README.md +36 -0
  43. package/dist/components/SField/README.md +27 -2
  44. package/dist/components/SField/SField.d.ts +22 -4
  45. package/dist/components/SFilePicker/README.md +15 -1
  46. package/dist/components/SFilePicker/SFilePicker.d.ts +7 -1
  47. package/dist/components/SFooter/README.md +25 -0
  48. package/dist/components/SFooter/SFooter.d.ts +4 -3
  49. package/dist/components/SForm/README.md +11 -0
  50. package/dist/components/SGhostButton/README.md +20 -2
  51. package/dist/components/SGnb/README.md +45 -0
  52. package/dist/components/SGnb/gnb.config.d.ts +7 -0
  53. package/dist/components/SGuide/README.md +15 -0
  54. package/dist/components/SIcon/README.md +4 -0
  55. package/dist/components/SIcon/SIcon.d.ts +1 -1
  56. package/dist/components/SIcon/icons.gen.d.ts +2 -0
  57. package/dist/components/SImage/README.md +14 -0
  58. package/dist/components/SInput/README.md +3 -1
  59. package/dist/components/SInput/SInput.d.ts +7 -1
  60. package/dist/components/SKeyValueTable/README.md +87 -0
  61. package/dist/components/SKeyValueTable/SKeyValueTable.d.ts +14 -3
  62. package/dist/components/SLayout/README.md +16 -0
  63. package/dist/components/SLinearProgress/README.md +8 -0
  64. package/dist/components/SList/README.md +5 -1
  65. package/dist/components/SList/SList.d.ts +0 -2
  66. package/dist/components/SListItem/README.md +41 -0
  67. package/dist/components/SLoadingModal/README.md +8 -0
  68. package/dist/components/SNumberInput/README.md +9 -1
  69. package/dist/components/SNumberInput/SNumberInput.d.ts +7 -1
  70. package/dist/components/SPage/README.md +41 -1
  71. package/dist/components/SPage/SPage.d.ts +24 -2
  72. package/dist/components/SPage/index.d.ts +1 -1
  73. package/dist/components/SPage/page.config.d.ts +8 -0
  74. package/dist/components/SPopover/README.md +15 -0
  75. package/dist/components/SPopup/README.md +19 -0
  76. package/dist/components/SPortal/README.md +14 -0
  77. package/dist/components/SRadio/README.md +20 -0
  78. package/dist/components/SRadioButton/README.md +18 -0
  79. package/dist/components/SScrollArea/README.md +14 -0
  80. package/dist/components/SSearchInput/README.md +61 -0
  81. package/dist/components/SSearchInput/SSearchInput.d.ts +52 -0
  82. package/dist/components/SSearchInput/index.d.ts +1 -0
  83. package/dist/components/SSectionHeaderCard/README.md +44 -20
  84. package/dist/components/SSectionHeaderCard/SSectionHeaderCard.d.ts +31 -14
  85. package/dist/components/SSectionHeaderCard/index.d.ts +1 -1
  86. package/dist/components/SSelect/README.md +23 -3
  87. package/dist/components/SSelect/SSelect.d.ts +13 -1
  88. package/dist/components/SSplitter/README.md +15 -0
  89. package/dist/components/SStepper/README.md +26 -0
  90. package/dist/components/SSwitch/README.md +13 -0
  91. package/dist/components/STable/README.md +72 -1
  92. package/dist/components/STable/STable.d.ts +129 -11
  93. package/dist/components/STable/index.d.ts +1 -1
  94. package/dist/components/STabs/README.md +12 -1
  95. package/dist/components/STabs/STabs.d.ts +2 -4
  96. package/dist/components/STabs/index.d.ts +1 -1
  97. package/dist/components/STabs/tabs.config.d.ts +3 -4
  98. package/dist/components/STag/README.md +47 -0
  99. package/dist/components/STextLink/README.md +17 -0
  100. package/dist/components/STextLink/STextLink.d.ts +2 -0
  101. package/dist/components/STextarea/README.md +1 -1
  102. package/dist/components/STextarea/STextarea.d.ts +7 -1
  103. package/dist/components/STimePicker/README.md +15 -1
  104. package/dist/components/STimePicker/STimePicker.d.ts +7 -1
  105. package/dist/components/STimePicker/timepicker.config.d.ts +7 -0
  106. package/dist/components/STimeRangePicker/README.md +27 -1
  107. package/dist/components/STimeRangePicker/STimeRangePicker.d.ts +7 -1
  108. package/dist/components/SToast/README.md +24 -0
  109. package/dist/components/SToggle/README.md +8 -0
  110. package/dist/components/STooltip/README.md +22 -0
  111. package/dist/components/STree/README.md +41 -0
  112. package/dist/components/STree/STree.d.ts +8 -0
  113. package/dist/components/STree/index.d.ts +1 -1
  114. package/dist/index.cjs +4266 -750
  115. package/dist/index.cjs.map +1 -1
  116. package/dist/index.d.ts +3 -0
  117. package/dist/index.js +4249 -750
  118. package/dist/index.js.map +1 -1
  119. package/dist/lib/field-width.d.ts +31 -0
  120. package/dist/lib/story-docs.d.ts +19 -3
  121. package/dist/lib/truncated-value-tooltip.d.ts +18 -0
  122. package/dist/llms-full.txt +2337 -183
  123. package/dist/llms.txt +490 -92
  124. package/dist/styles.css +684 -41
  125. package/dist/theme.css +22 -6
  126. package/eslint/index.mjs +10 -0
  127. package/eslint/lib/table-column.mjs +26 -0
  128. package/eslint/rules/field-width-grade.d.mts +41 -0
  129. package/eslint/rules/field-width-grade.mjs +311 -0
  130. package/eslint/rules/table-column-width.mjs +110 -0
  131. package/eslint/scale.gen.mjs +3 -0
  132. package/package.json +13 -1
@@ -1,12 +1,14 @@
1
1
  import { type HTMLAttributes, type ReactNode } from 'react';
2
+ import { type SFooterButton } from '../SFooter';
2
3
  export type SSectionHeaderCardBodyChildren = ReactNode;
3
4
  export type SSectionHeaderCardChildren = ReactNode;
4
5
  export type SSectionHeaderCardThickness = false | 'default' | 'accent';
5
6
  export type SSectionHeaderCardTitleSize = 'xs' | 'sm';
6
7
  export type SSectionHeaderCardBodyPadding = 'default' | 'wide' | 'none';
7
- export interface SSectionHeaderCardHeaderProps extends Omit<HTMLAttributes<HTMLDivElement>, 'slot' | 'title'> {
8
+ export type SSectionHeaderCardBodyBackground = 'frame' | 'neutral';
9
+ export interface SSectionHeaderCardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'slot' | 'title'> {
8
10
  /** 헤더 제목 */
9
- title: ReactNode;
11
+ title?: ReactNode;
10
12
  /** 제목 크기 */
11
13
  titleSize?: SSectionHeaderCardTitleSize;
12
14
  /** 제목 앞 점 표시 여부 */
@@ -21,21 +23,36 @@ export interface SSectionHeaderCardHeaderProps extends Omit<HTMLAttributes<HTMLD
21
23
  slot?: ReactNode;
22
24
  /** 상단 border 색상 타입. false면 표시하지 않습니다. */
23
25
  thickness?: SSectionHeaderCardThickness;
24
- }
25
- export interface SSectionHeaderCardBodyProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
26
- /** 바디 슬롯. 특정 컴포넌트 타입으로 제한하지 않습니다. */
27
- children?: SSectionHeaderCardBodyChildren;
26
+ /** 헤더 영역 클래스 */
27
+ headerClassName?: string;
28
28
  /**
29
- * 안쪽 여백. 기본은 `default`.
29
+ * 바디 안쪽 여백. 기본은 `default`.
30
30
  * 성격이 다른 요소가 세 종류 이상 섞인 영역에만 `wide`, 표를 가장자리까지 채울 때만 `none`.
31
31
  */
32
32
  padding?: SSectionHeaderCardBodyPadding;
33
- }
34
- export interface SSectionHeaderCardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
35
- /** SSectionHeaderCard 슬롯. 특정 컴포넌트 타입으로 제한하지 않습니다. */
33
+ /**
34
+ * 본문 배경. 기본은 `frame` 카드가 깐 흰 면을 그대로 쓴다.
35
+ *
36
+ * `neutral` 은 바탕을 한 단계 눌러앉혀, 흰 면 덩어리(표·리스트)가 여럿일 때 그것들이
37
+ * **"면 위에 놓인 객체"로 읽히게** 한다. 위계를 한 단계 더 주고 싶을 때 고르는 선택지이며,
38
+ * **기본값이 틀린 것은 아니다** — 표·리스트는 테두리·라운드·헤더 줄과 간격을 이미 갖고 있어
39
+ * 흰 바탕에서도 경계가 읽힌다.
40
+ *
41
+ * 깔아도 **효과가 없는** 자리가 있다 — 덩어리가 가장자리까지 차는 경우(`padding="none"` 으로
42
+ * 표를 채우면 바탕이 완전히 가려진다), 덩어리에 회색 면이 섞인 경우(그 덩어리가 바탕에 묻힌다),
43
+ * 맨 텍스트나 폼 컨트롤만 있는 본문(떠오를 흰 면이 없다).
44
+ */
45
+ background?: SSectionHeaderCardBodyBackground;
46
+ /**
47
+ * 하단 액션 영역 좌측 슬롯. 보조 버튼(취소·목록 등)이 오는 자리다.
48
+ * `footerLeft` 또는 `button` 중 하나라도 있으면 하단 액션 영역이 렌더된다.
49
+ */
50
+ footerLeft?: ReactNode;
51
+ /** 하단 액션 영역 우측 주 액션 버튼 */
52
+ button?: SFooterButton;
53
+ /** 하단 액션 영역 클래스 */
54
+ footerClassName?: string;
55
+ /** 바디 콘텐츠. 특정 컴포넌트 타입으로 제한하지 않습니다. */
36
56
  children?: SSectionHeaderCardChildren;
37
57
  }
38
- export declare const SSectionHeaderCard: import("react").ForwardRefExoticComponent<SSectionHeaderCardProps & import("react").RefAttributes<HTMLDivElement>> & {
39
- Header: import("react").ForwardRefExoticComponent<SSectionHeaderCardHeaderProps & import("react").RefAttributes<HTMLDivElement>>;
40
- Body: import("react").ForwardRefExoticComponent<SSectionHeaderCardBodyProps & import("react").RefAttributes<HTMLDivElement>>;
41
- };
58
+ export declare const SSectionHeaderCard: import("react").ForwardRefExoticComponent<SSectionHeaderCardProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -1 +1 @@
1
- export { SSectionHeaderCard, type SSectionHeaderCardBodyChildren, type SSectionHeaderCardBodyPadding, type SSectionHeaderCardBodyProps, type SSectionHeaderCardChildren, type SSectionHeaderCardHeaderProps, type SSectionHeaderCardProps, type SSectionHeaderCardThickness, type SSectionHeaderCardTitleSize, } from './SSectionHeaderCard';
1
+ export { SSectionHeaderCard, type SSectionHeaderCardBodyBackground, type SSectionHeaderCardBodyChildren, type SSectionHeaderCardBodyPadding, type SSectionHeaderCardChildren, type SSectionHeaderCardProps, type SSectionHeaderCardThickness, type SSectionHeaderCardTitleSize, } from './SSectionHeaderCard';
@@ -18,6 +18,7 @@
18
18
  | `allSelectedLabel?` | `string` | `'전체'` | 전체선택 레이블 |
19
19
  | `placeholder?` | `string` | `'선택'` | placeholder |
20
20
  | `disabled?` | `boolean` | `false` | 비활성 |
21
+ | `clearable?` | `boolean` | `false` | 선택값 지우기(×) 버튼 노출. 선택값이 있고 비활성이 아닐 때만 나타나며, 누르면 드롭다운을 열지 않고 값만 비운다. |
21
22
  | `error?` | `boolean` | `false` | 에러 상태 |
22
23
  | `rules?` | `Rule[]` | — | 유효성 규칙 — 닫힐 때 자동 검증 |
23
24
  | `labelTooltipProps?` | `Partial<STooltipProps>` | — | 레이블 툴팁 상세 옵션 |
@@ -33,7 +34,7 @@
33
34
  | `addonAlign?` | `SFieldAddonAlign` | — | 어드온 정렬 |
34
35
  | `hint?` | `string` | — | |
35
36
  | `errorMessage?` | `string` | — | |
36
- | `width?` | `number \| string` | — | |
37
+ | `width?` | `SFieldWidth` | | 컨트롤 너비 폭 등급(`'xs' | 'sm' | 'md' | 'lg' | 'xl'`) · 숫자=px · CSS 길이. 등급은 `--cmp-field-width-*` 토큰으로 풀리므로 토큰이 바뀌면 화면이 따라간다. 값 길이에 상한이 없으면 `"100%"` 로 두어 행 전체를 쓴다. 셀렉트는 `maxLength` 개념이 없어 목록 최장값을 담는 등급으로 고른다. |
37
38
  | `className?` | `string` | — | |
38
39
  | `style?` | `CSSProperties` | — | |
39
40
 
@@ -51,6 +52,25 @@
51
52
  | `focus` | `() => void` | 트리거 버튼에 포커스 (sdFocus) |
52
53
  | `open` | `() => void` | 드롭다운 열기 (sdOpen) |
53
54
 
55
+ ## Types
56
+
57
+ ### SSelectOption
58
+
59
+ ```ts
60
+ export interface SSelectOption {
61
+ value: string | number;
62
+ label: string;
63
+ disabled?: boolean;
64
+ children?: SSelectOption[];
65
+ }
66
+ ```
67
+
68
+ ### SSelectType
69
+
70
+ ```ts
71
+ export type SSelectType = 'default' | 'multi' | 'default_depth' | 'multi_depth';
72
+ ```
73
+
54
74
  ## Dependencies
55
75
 
56
76
  ### Used by
@@ -61,18 +81,18 @@
61
81
  ### Depends on
62
82
 
63
83
  - [SField](../SField)
64
- - [SGhostButton](../SGhostButton)
65
84
  - [SIcon](../SIcon)
66
85
  - [SPortal](../SPortal)
86
+ - [SSearchInput](../SSearchInput)
67
87
 
68
88
  ### Graph
69
89
 
70
90
  ```mermaid
71
91
  graph TD;
72
92
  SSelect --> SField
73
- SSelect --> SGhostButton
74
93
  SSelect --> SIcon
75
94
  SSelect --> SPortal
95
+ SSelect --> SSearchInput
76
96
  SKeyValueTable --> SSelect
77
97
  STable --> SSelect
78
98
  style SSelect fill:#f9f,stroke:#333,stroke-width:4px
@@ -5,6 +5,7 @@ import { type SIconName } from '../SIcon';
5
5
  import { type SColor } from '../../lib/color';
6
6
  import { type STooltipProps } from '../STooltip';
7
7
  import { type SSelectOption, type SSelectType } from './select.config';
8
+ import { type SFieldWidth } from '../../lib/field-width';
8
9
  export type { SSelectOption, SSelectType } from './select.config';
9
10
  export interface SSelectHandle {
10
11
  /** 트리거 버튼에 포커스 (sdFocus) */
@@ -37,6 +38,11 @@ export interface SSelectProps {
37
38
  placeholder?: string;
38
39
  /** 비활성 */
39
40
  disabled?: boolean;
41
+ /**
42
+ * 선택값 지우기(×) 버튼 노출. 선택값이 있고 비활성이 아닐 때만 나타나며,
43
+ * 누르면 드롭다운을 열지 않고 값만 비운다.
44
+ */
45
+ clearable?: boolean;
40
46
  /** 에러 상태 */
41
47
  error?: boolean;
42
48
  /** 유효성 규칙 — 닫힐 때 자동 검증 */
@@ -62,7 +68,13 @@ export interface SSelectProps {
62
68
  addonAlign?: SFieldAddonAlign;
63
69
  hint?: string;
64
70
  errorMessage?: string;
65
- width?: number | string;
71
+ /**
72
+ * 컨트롤 너비 — 폭 등급(`'xs' | 'sm' | 'md' | 'lg' | 'xl'`) · 숫자=px · CSS 길이.
73
+ * 등급은 `--cmp-field-width-*` 토큰으로 풀리므로 토큰이 바뀌면 화면이 따라간다.
74
+ * 값 길이에 상한이 없으면 `"100%"` 로 두어 행 전체를 쓴다.
75
+ * 셀렉트는 `maxLength` 개념이 없어 목록 최장값을 담는 등급으로 고른다.
76
+ */
77
+ width?: SFieldWidth;
66
78
  className?: string;
67
79
  style?: CSSProperties;
68
80
  }
@@ -25,3 +25,18 @@
25
25
  |-------|------|-------------|
26
26
  | `onValueChange` | `(value: number) => void` | 크기가 확정될 때. emitImmediately 가 아니면 드래그를 놓는 순간 한 번만 온다 |
27
27
 
28
+ ## Types
29
+
30
+ ### SSplitterUnit
31
+
32
+ ```ts
33
+ /** 모델·limits 를 읽는 단위. Quasar QSplitter 의 `unit` 과 같다. */
34
+ export type SSplitterUnit = (typeof SSPLITTER_UNITS)[number];
35
+ ```
36
+
37
+ ### SSPLITTER_UNITS
38
+
39
+ ```ts
40
+ export const SSPLITTER_UNITS = ['%', 'px'] as const;
41
+ ```
42
+
@@ -30,6 +30,32 @@
30
30
  | `showItemTooltip` | `() => void` | error 아이템 중 첫 번째에 툴팁을 연다. error 아이템이 없으면 아무 일도 일어나지 않는다. |
31
31
  | `hideItemTooltip` | `() => void` | 열려있는 커스텀 툴팁을 닫는다. 활성 단계(value prop)가 바뀌면 별도 호출 없이도 자동으로 닫힌다. |
32
32
 
33
+ ## Types
34
+
35
+ ### SStepperItem
36
+
37
+ ```ts
38
+ export type SStepperItem = {
39
+ label: string;
40
+ value?: string;
41
+ group?: string;
42
+ completed?: boolean;
43
+ error?: boolean;
44
+ };
45
+ ```
46
+
47
+ ### SStepperSize
48
+
49
+ ```ts
50
+ export type SStepperSize = (typeof STEPPER_SIZES)[number];
51
+ ```
52
+
53
+ ### STEPPER_SIZES
54
+
55
+ ```ts
56
+ export const STEPPER_SIZES = ['sm', 'lg'] as const;
57
+ ```
58
+
33
59
  ## Dependencies
34
60
 
35
61
  ### Depends on
@@ -22,3 +22,16 @@
22
22
  |-------|------|-------------|
23
23
  | `onValueChange` | `(value: boolean) => void` | 변경 (sdUpdate) |
24
24
 
25
+ ## Dependencies
26
+
27
+ ### Used by
28
+
29
+ - [SKeyValueTable](../SKeyValueTable)
30
+
31
+ ### Graph
32
+
33
+ ```mermaid
34
+ graph TD;
35
+ SKeyValueTable --> SSwitch
36
+ style SSwitch fill:#f9f,stroke:#333,stroke-width:4px
37
+ ```
@@ -13,20 +13,23 @@
13
13
  | `rowKey?` | `string` | `'id'` | 행 식별 필드 |
14
14
  | `selectable?` | `boolean` | `false` | 행 선택 체크박스 |
15
15
  | `selected?` | `SRow[]` | `[]` | |
16
+ | `sort?` | `STableSort \| null` | `null` | 정렬 상태 (controlled). `null`·미지정이면 정렬 없음. 컴포넌트는 정렬 상태를 갖지 않는다 — 서버 정렬이면 이 값이 곧 조회 조건이고, 뒤로가기·새로고침·링크 공유로 복원돼야 하므로 진실은 URL·store 쪽에 있어야 한다. 행을 실제로 정렬하는 것도 소비 앱 몫이다 (`STable` 은 받은 순서대로 그린다). |
16
17
  | `resizable?` | `boolean` | `false` | 컬럼 너비 조절 |
17
18
  | `width?` | `string` | — | |
18
19
  | `height?` | `string` | — | |
19
20
  | `stickyHeader?` | `boolean` | — | |
20
21
  | `stickyColumn?` | `STableStickyColumn` | — | 고정할 좌/우 컬럼 수 |
21
22
  | `radius?` | `'default' \| 'useTop' \| 'full'` | `'default'` | border-radius 제어 |
23
+ | `bordered?` | `boolean` | `true` | 바깥 테두리. 기본은 `true`. `SSectionHeaderCard` 의 `padding="none"` 안에 넣어 카드 가장자리까지 채울 때 `false` 로 끈다 — 카드가 이미 바깥 테두리를 그리므로, 켜 두면 1px 두 개가 나란히 놓여 그 변만 2px 로 보인다. 페이지네이션 바의 테두리와 1px 겹침(`-mt-px`)도 함께 꺼진다. 본문 테두리가 없으면 겹칠 대상이 없어, 그대로 두면 페이지네이션만 테두리를 갖고 1px 어긋난다. |
22
24
  | `noDataLabel?` | `string` | `'데이터가 없습니다.'` | |
23
25
  | `noDataSlot?` | `ReactNode` | — | 데이터가 없을 때 body 영역 전체를 대체하는 슬롯. 지정하면 `noDataLabel` 대신 이 콘텐츠가 헤더 아래 영역을 채우며, 버튼 등 인터랙션도 동작한다. |
24
26
  | `isLoading?` | `boolean` | `false` | |
25
- | `dense?` | `boolean` | `false` | |
27
+ | `dense?` | `boolean` | `false` | 행 높이를 좁게 (세로 여백만 줄인다 — 좌우 패딩은 그대로) |
26
28
  | `noHover?` | `boolean` | `false` | true면 행에 마우스를 올려도 hover 배경(grey_05)을 표시하지 않는다 |
27
29
  | `pagination?` | `STablePagination` | — | 페이지네이션 (있으면 하단 표시) |
28
30
  | `useInternalPagination?` | `boolean` | `false` | 테이블 내부에서 페이지네이션을 직접 관리 (rows를 내부 슬라이싱) |
29
31
  | `useRowsPerPageSelect?` | `boolean` | `false` | 페이지당 행 수 셀렉트 표시 |
32
+ | `useDensityToggle?` | `boolean` | `false` | 페이지네이션 바에 밀도 토글(`좁게 보기` · `넓게 보기`) 표시. **페이지네이션이 있을 때만 나타난다** — 토글이 사는 곳이 그 바이기 때문이다. `onDenseChange` 와 함께 준다. 밀도는 컴포넌트가 갖지 않으므로, 핸들러 없이 켜면 눌러도 아무 일도 일어나지 않는다. |
30
33
  | `rowsPerPageOption?` | `SSelectOption[]` | `DEFAULT_ROWS_PER_PAGE_OPTION` | |
31
34
  | `useVirtualScroll?` | `boolean` | `false` | 가상 스크롤 |
32
35
  | `rowHeight?` | `number` | — | |
@@ -41,6 +44,8 @@
41
44
  | Event | Type | Description |
42
45
  |-------|------|-------------|
43
46
  | `onSelectedChange` | `(rows: SRow[]) => void` | |
47
+ | `onSortChange` | `(sort: STableSort \| null) => void` | 정렬 헤더 클릭 (`asc → desc → 해제` 3단). 해제되면 `null` 이 온다. 다중 정렬은 1차 안에서 지원하지 않는다. |
48
+ | `onDenseChange` | `(dense: boolean) => void` | 밀도 변경 (`useDensityToggle` 로 띄운 토글을 눌렀을 때). 컴포넌트는 밀도 상태를 갖지 않는다 — `dense` 가 곧 현재 상태이고, 그 진실은 페이지에 있다. 사용자가 고른 밀도를 다음 방문까지 기억해 두는 것(로컬 저장 등)도 페이지 몫이다. |
44
49
  | `onPageChange` | `(page: number) => void` | |
45
50
  | `onRowsPerPageChange` | `(perPage: number) => void` | |
46
51
  | `onVirtualUpdate` | `(range: { from: number; to: number }) => void` | |
@@ -59,15 +64,77 @@
59
64
  | `updateRowSelect` | `(row: SRow) => void` | 단일 행 선택 토글 (sd-table updateRowSelect) — onSelectedChange 발생 |
60
65
  | `toggleSelectAll` | `(checked: boolean, rows: SRow[]) => void` | 주어진 행들 전체 선택/해제 (sd-table toggleSelectAll) — onSelectedChange 발생 |
61
66
 
67
+ ## Types
68
+
69
+ ### STableColumn
70
+
71
+ ```ts
72
+ /**
73
+ * `autoWidth` 스페이서 열은 값을 그리지 않으므로 `field` 를 생략할 수 있다.
74
+ * 그 밖의 열은 값 접근자가 있어야 한다.
75
+ */
76
+ export type STableColumn = STableColumnBase &
77
+ (
78
+ { autoWidth: true; field?: STableColumnField } | { autoWidth?: false; field: STableColumnField }
79
+ );
80
+ ```
81
+
82
+ ### SRow
83
+
84
+ ```ts
85
+ export type SRow = Record<string, any>;
86
+ ```
87
+
88
+ ### STableSort
89
+
90
+ ```ts
91
+ /** 정렬 상태 — 어느 열을 어느 방향으로 정렬했는가 */
92
+ export interface STableSort {
93
+ /** 정렬 기준 컬럼의 `name` */
94
+ name: string;
95
+ dir: 'asc' | 'desc';
96
+ }
97
+ ```
98
+
99
+ ### STableStickyColumn
100
+
101
+ ```ts
102
+ export interface STableStickyColumn {
103
+ left?: number;
104
+ right?: number;
105
+ }
106
+ ```
107
+
108
+ ### STablePagination
109
+
110
+ ```ts
111
+ export interface STablePagination {
112
+ page: number;
113
+ rowsPerPage: number;
114
+ lastPage?: number;
115
+ }
116
+ ```
117
+
118
+ ### STableColumnField
119
+
120
+ ```ts
121
+ /** 값 접근: 필드명 또는 접근 함수 */
122
+ export type STableColumnField = string | ((row: SRow) => any);
123
+ ```
124
+
62
125
  ## Dependencies
63
126
 
64
127
  ### Depends on
65
128
 
66
129
  - [SCheckbox](../SCheckbox)
67
130
  - [SCircleProgress](../SCircleProgress)
131
+ - [SDivider](../SDivider)
132
+ - [SGhostButton](../SGhostButton)
68
133
  - [SIcon](../SIcon)
69
134
  - [SPagination](../SPagination)
70
135
  - [SSelect](../SSelect)
136
+ - [STextLink](../STextLink)
137
+ - [STooltip](../STooltip)
71
138
 
72
139
  ### Graph
73
140
 
@@ -75,8 +142,12 @@
75
142
  graph TD;
76
143
  STable --> SCheckbox
77
144
  STable --> SCircleProgress
145
+ STable --> SDivider
146
+ STable --> SGhostButton
78
147
  STable --> SIcon
79
148
  STable --> SPagination
80
149
  STable --> SSelect
150
+ STable --> STextLink
151
+ STable --> STooltip
81
152
  style STable fill:#f9f,stroke:#333,stroke-width:4px
82
153
  ```
@@ -1,6 +1,4 @@
1
1
  import { type CSSProperties, type ReactNode } from 'react';
2
- import { type SColor } from '../../lib/color';
3
- import { type SIconName } from '../SIcon';
4
2
  import { type SSelectOption } from '../SSelect';
5
3
  export type SRow = Record<string, any>;
6
4
  /** `STableColumn.renderCell`에 전달되는 컨텍스트 */
@@ -20,24 +18,88 @@ export interface STableCellContext {
20
18
  /** STable이 이 셀에 적용하려던 스타일 (패딩·정렬·폭·sticky offset 포함) */
21
19
  style: CSSProperties;
22
20
  }
23
- export interface STableColumn {
21
+ /** 접근: 필드명 또는 접근 함수 */
22
+ export type STableColumnField = string | ((row: SRow) => any);
23
+ interface STableColumnBase {
24
24
  name: string;
25
25
  label: string;
26
- /** 값 접근: 필드명 또는 접근 함수 */
27
- field: string | ((row: SRow) => any);
28
26
  align?: 'left' | 'center' | 'right';
29
- width?: string;
30
- /** 고정폭 없이 자동 너비 (sticky/resize 계산에서 제외) */
27
+ /**
28
+ * 컬럼 너비. **px 로만 준다** 숫자는 px 로 해석하고, 문자열은 `'120px'` 형태만 받는다.
29
+ *
30
+ * % · `clamp()` · `min()` 은 쓰지 않는다. 폭은 `<colgroup>` 의 `<col width>` 로 들어가는데
31
+ * 테이블이 `table-fixed` 라 함수형 값은 계산되지 않고 통째로 무시된다 — 화면은 조용히
32
+ * auto 폭으로 떨어진다. `'30%'` 는 더 나쁘게 30px 로 읽힌다.
33
+ *
34
+ * 생략하면 기본 120px 이다. 내용이 들어가는 열은 값 길이에 맞춰 폭을 명시한다 —
35
+ * 폭을 주지 않은 열만 다른 열에 눌려 무너지거나 늘어난다.
36
+ */
37
+ width?: number | `${number}px`;
38
+ /**
39
+ * 고정폭 없이 남은 폭을 흡수한다 (sticky/resize 계산에서 제외).
40
+ *
41
+ * **남은 폭을 먹는 스페이서 열 하나에만 쓴다.** 내용이 들어가는 열에 주면 폭이 다른 열에
42
+ * 좌우돼 화면마다 달라진다 — 내용 열은 px 로 폭을 명시한다.
43
+ */
31
44
  autoWidth?: boolean;
32
- /** 리사이즈 최소/최대 너비 (px) */
45
+ /**
46
+ * 리사이즈 하한/상한 (px). **`resizable` 로 끄는 손잡이의 이동 범위일 뿐, 레이아웃에는
47
+ * 관여하지 않는다** — 폭을 주지 않은 열이 이 값 안에서 잡히는 것이 아니다.
48
+ */
33
49
  minWidth?: number;
34
50
  maxWidth?: number;
35
51
  /** 표시 포맷 */
36
52
  format?: (value: any, row: SRow) => string;
37
53
  visible?: boolean;
38
- icon?: SIconName;
39
- /** 헤더 아이콘 색상. 팔레트 (`grey_65`, `red_95` …) 또는 임의 CSS 색상 */
40
- iconColor?: SColor;
54
+ /**
55
+ * 헤더 라벨 도움말 툴팁 ( 항목이 한 줄). `SKeyValueTable` `field.helpText` 같은 역할
56
+ * 라벨만으로 뜻이 통하지 않는 컬럼의 산출 기준·단위를 설명한다.
57
+ *
58
+ * `renderHeader` 로 헤더를 통째로 교체하면 그리지 않는다 (헤더 전체가 소비 앱 책임).
59
+ */
60
+ helpText?: string[];
61
+ /**
62
+ * 라벨 뒤 필수 표시(`*`). `SKeyValueTable` 의 `field.required` 와 같은 규칙 —
63
+ * 그 열의 값을 반드시 채워야 하는 입력 열에만 쓴다.
64
+ *
65
+ * `renderHeader` 로 헤더를 통째로 교체하면 그리지 않는다 (헤더 전체가 소비 앱 책임).
66
+ */
67
+ required?: boolean;
68
+ /**
69
+ * 셀 값을 직접 고칠 수 있는 열. 라벨 뒤에 `pageEdit` 표식이 붙는다.
70
+ *
71
+ * **표식일 뿐 버튼이 아니다** — 실제로 고치는 UI 는 셀(`render`)이 그린다. 표식만 켜 두면
72
+ * 고칠 수 있다고 해 놓고 고칠 방법이 없는 열이 된다.
73
+ *
74
+ * `renderHeader` 로 헤더를 통째로 교체하면 그리지 않는다 (헤더 전체가 소비 앱 책임).
75
+ */
76
+ editable?: boolean;
77
+ /**
78
+ * 셀을 눌러 다른 화면으로 넘어가는 열. 라벨 뒤에 `pageMove` 표식이 붙는다.
79
+ *
80
+ * **표식일 뿐 버튼이 아니다** — 넘어가는 것은 셀(`render`)의 링크·클릭이 한다.
81
+ *
82
+ * `renderHeader` 로 헤더를 통째로 교체하면 그리지 않는다 (헤더 전체가 소비 앱 책임).
83
+ */
84
+ navigable?: boolean;
85
+ /**
86
+ * 정렬 가능한 열인지. 켜면 헤더 라벨 뒤에 정렬 버튼이 붙는다 — 누르는 곳은 그 버튼뿐이고
87
+ * 헤더 셀 전체가 클릭 영역이 되지는 않는다.
88
+ *
89
+ * 정렬 상태는 컴포넌트가 갖지 않는다 — `STable` 의 `sort` · `onSortChange` 로 주고받는다.
90
+ * `renderHeader` 로 헤더를 통째로 교체하면 버튼도 그리지 않는다 (헤더 전체가 소비 앱 책임).
91
+ */
92
+ sortable?: boolean;
93
+ /**
94
+ * 셀에 무엇이 들어가는지. 좌우 여백이 여기서 갈린다 — 기본은 `text`(넓게).
95
+ *
96
+ * 자기 폭을 가진 컨트롤(`SInput`·`SNumberInput`·`SSelect` 등)이 들어가는 열은 `control` 로 준다.
97
+ * 텍스트와 같은 넓은 여백을 두면 컨트롤이 쓸 폭이 그만큼 줄어 같은 열 폭에서도 좁아 보인다.
98
+ *
99
+ * `SKeyValueTable` 은 `field.type` 으로 이 판정을 스스로 하지만, `STable` 의 셀은 소비 앱이 넘긴
100
+ * 임의의 `render` 결과라 컴포넌트가 알 수 없다. 그래서 열 단위로 받는다.
101
+ */
102
+ contentType?: 'text' | 'control';
41
103
  /** 셀 커스텀 렌더 (React 확장) — `<td>` 안쪽 내용만 교체한다 */
42
104
  render?: (row: SRow, value: any) => ReactNode;
43
105
  /**
@@ -59,6 +121,17 @@ export interface STableColumn {
59
121
  thClass?: string;
60
122
  thStyle?: CSSProperties;
61
123
  }
124
+ /**
125
+ * `autoWidth` 스페이서 열은 값을 그리지 않으므로 `field` 를 생략할 수 있다.
126
+ * 그 밖의 열은 값 접근자가 있어야 한다.
127
+ */
128
+ export type STableColumn = STableColumnBase & ({
129
+ autoWidth: true;
130
+ field?: STableColumnField;
131
+ } | {
132
+ autoWidth?: false;
133
+ field: STableColumnField;
134
+ });
62
135
  export interface STablePagination {
63
136
  page: number;
64
137
  rowsPerPage: number;
@@ -68,6 +141,12 @@ export interface STableStickyColumn {
68
141
  left?: number;
69
142
  right?: number;
70
143
  }
144
+ /** 정렬 상태 — 어느 열을 어느 방향으로 정렬했는가 */
145
+ export interface STableSort {
146
+ /** 정렬 기준 컬럼의 `name` */
147
+ name: string;
148
+ dir: 'asc' | 'desc';
149
+ }
71
150
  /** STable ref 명령형 API (sd-table @Method 대응) */
72
151
  export interface STableHandle {
73
152
  /** 행 선택 여부 */
@@ -99,6 +178,19 @@ export interface STableProps {
99
178
  selectable?: boolean;
100
179
  selected?: SRow[];
101
180
  onSelectedChange?: (rows: SRow[]) => void;
181
+ /**
182
+ * 정렬 상태 (controlled). `null`·미지정이면 정렬 없음.
183
+ *
184
+ * 컴포넌트는 정렬 상태를 갖지 않는다 — 서버 정렬이면 이 값이 곧 조회 조건이고,
185
+ * 뒤로가기·새로고침·링크 공유로 복원돼야 하므로 진실은 URL·store 쪽에 있어야 한다.
186
+ * 행을 실제로 정렬하는 것도 소비 앱 몫이다 (`STable` 은 받은 순서대로 그린다).
187
+ */
188
+ sort?: STableSort | null;
189
+ /**
190
+ * 정렬 헤더 클릭 (`asc → desc → 해제` 3단). 해제되면 `null` 이 온다.
191
+ * 다중 정렬은 1차 안에서 지원하지 않는다.
192
+ */
193
+ onSortChange?: (sort: STableSort | null) => void;
102
194
  /** 컬럼 너비 조절 */
103
195
  resizable?: boolean;
104
196
  width?: string;
@@ -109,6 +201,16 @@ export interface STableProps {
109
201
  stickyColumn?: STableStickyColumn;
110
202
  /** border-radius 제어 */
111
203
  radius?: 'default' | 'useTop' | 'full';
204
+ /**
205
+ * 바깥 테두리. 기본은 `true`.
206
+ *
207
+ * `SSectionHeaderCard` 의 `padding="none"` 안에 넣어 카드 가장자리까지 채울 때 `false` 로 끈다 —
208
+ * 카드가 이미 바깥 테두리를 그리므로, 켜 두면 1px 두 개가 나란히 놓여 그 변만 2px 로 보인다.
209
+ *
210
+ * 페이지네이션 바의 테두리와 1px 겹침(`-mt-px`)도 함께 꺼진다. 본문 테두리가 없으면 겹칠 대상이
211
+ * 없어, 그대로 두면 페이지네이션만 테두리를 갖고 1px 어긋난다.
212
+ */
213
+ bordered?: boolean;
112
214
  noDataLabel?: string;
113
215
  /**
114
216
  * 데이터가 없을 때 body 영역 전체를 대체하는 슬롯.
@@ -116,7 +218,14 @@ export interface STableProps {
116
218
  */
117
219
  noDataSlot?: ReactNode;
118
220
  isLoading?: boolean;
221
+ /** 행 높이를 좁게 (세로 여백만 줄인다 — 좌우 패딩은 그대로) */
119
222
  dense?: boolean;
223
+ /**
224
+ * 밀도 변경 (`useDensityToggle` 로 띄운 토글을 눌렀을 때). 컴포넌트는 밀도 상태를 갖지 않는다 —
225
+ * `dense` 가 곧 현재 상태이고, 그 진실은 페이지에 있다. 사용자가 고른 밀도를 다음 방문까지
226
+ * 기억해 두는 것(로컬 저장 등)도 페이지 몫이다.
227
+ */
228
+ onDenseChange?: (dense: boolean) => void;
120
229
  /** true면 행에 마우스를 올려도 hover 배경(grey_05)을 표시하지 않는다 */
121
230
  noHover?: boolean;
122
231
  /** 페이지네이션 (있으면 하단 표시) */
@@ -126,6 +235,14 @@ export interface STableProps {
126
235
  useInternalPagination?: boolean;
127
236
  /** 페이지당 행 수 셀렉트 표시 */
128
237
  useRowsPerPageSelect?: boolean;
238
+ /**
239
+ * 페이지네이션 바에 밀도 토글(`좁게 보기` · `넓게 보기`) 표시.
240
+ *
241
+ * **페이지네이션이 있을 때만 나타난다** — 토글이 사는 곳이 그 바이기 때문이다.
242
+ * `onDenseChange` 와 함께 준다. 밀도는 컴포넌트가 갖지 않으므로, 핸들러 없이 켜면 눌러도
243
+ * 아무 일도 일어나지 않는다.
244
+ */
245
+ useDensityToggle?: boolean;
129
246
  rowsPerPageOption?: SSelectOption[];
130
247
  onRowsPerPageChange?: (perPage: number) => void;
131
248
  /** 가상 스크롤 */
@@ -155,3 +272,4 @@ export interface STableProps {
155
272
  * 내부 페이지네이션 + rows-per-page + 가상 스크롤 + 로딩 + dense.
156
273
  */
157
274
  export declare const STable: import("react").ForwardRefExoticComponent<STableProps & import("react").RefAttributes<STableHandle>>;
275
+ export {};
@@ -1 +1 @@
1
- export { STable, type STableProps, type STableColumn, type STableCellContext, type STablePagination, type STableStickyColumn, type STableHandle, type SRow, } from './STable';
1
+ export { STable, type STableProps, type STableColumn, type STableColumnField, type STableSort, type STableCellContext, type STablePagination, type STableStickyColumn, type STableHandle, type SRow, } from './STable';
@@ -10,7 +10,6 @@
10
10
  |------|------|---------|-------------|
11
11
  | `value` | `string` | — | 현재 선택된 탭 value |
12
12
  | `tabs` | `STabOption[]` | — | 탭 옵션 목록 |
13
- | `size?` | `STabSize` | `'md'` | 탭 크기 (main 전용) |
14
13
  | `isSub?` | `boolean` | `false` | 서브 탭(밑줄형) 스타일 |
15
14
  | `vertical?` | `boolean` | `false` | 세로 배치 (sub 전용 — main 폴더형은 항상 가로) |
16
15
  | `className?` | `string` | — | |
@@ -22,6 +21,18 @@
22
21
  |-------|------|-------------|
23
22
  | `onValueChange` | `(value: string) => void` | 탭 변경 (sdUpdate) |
24
23
 
24
+ ## Types
25
+
26
+ ### STabOption
27
+
28
+ ```ts
29
+ export interface STabOption {
30
+ label: string;
31
+ value: string;
32
+ badge?: string | number;
33
+ }
34
+ ```
35
+
25
36
  ## Dependencies
26
37
 
27
38
  ### Depends on
@@ -1,5 +1,5 @@
1
1
  import { type CSSProperties } from 'react';
2
- import { type STabSize, type STabOption } from './tabs.config';
2
+ import { type STabOption } from './tabs.config';
3
3
  export interface STabsProps {
4
4
  /** 현재 선택된 탭 value */
5
5
  value: string;
@@ -7,8 +7,6 @@ export interface STabsProps {
7
7
  tabs: STabOption[];
8
8
  /** 탭 변경 (sdUpdate) */
9
9
  onValueChange?: (value: string) => void;
10
- /** 탭 크기 (main 전용) */
11
- size?: STabSize;
12
10
  /** 서브 탭(밑줄형) 스타일 */
13
11
  isSub?: boolean;
14
12
  /** 세로 배치 (sub 전용 — main 폴더형은 항상 가로) */
@@ -21,4 +19,4 @@ export interface STabsProps {
21
19
  * main = 폴더형(탭 줄에 파란 baseline, 탭은 위쪽만 둥글고 하단 테두리 없음),
22
20
  * sub = 밑줄형(선택 시 하단 라인). 뱃지(STag), 세로 배치, value 제어 + onValueChange(sdUpdate).
23
21
  */
24
- export declare function STabs({ value, tabs, onValueChange, size, isSub, vertical, className, style, }: STabsProps): import("react").JSX.Element;
22
+ export declare function STabs({ value, tabs, onValueChange, isSub, vertical, className, style, }: STabsProps): import("react").JSX.Element;
@@ -1,2 +1,2 @@
1
1
  export { STabs, type STabsProps } from './STabs';
2
- export { type STabOption, type STabSize } from './tabs.config';
2
+ export { type STabOption } from './tabs.config';
@@ -1,14 +1,13 @@
1
- export type STabSize = 'md' | 'lg';
2
1
  export interface STabOption {
3
2
  label: string;
4
3
  value: string;
5
4
  badge?: string | number;
6
5
  }
7
- /** main(분절형) 사이즈별 레이아웃 — size는 높이·패딩만 바꾸고 폰트는 고정 */
8
- export declare const TAB_MAIN_SIZE: Record<STabSize, {
6
+ /** main(분절형) 레이아웃 */
7
+ export declare const TAB_MAIN_SIZE: {
9
8
  height: number;
10
9
  paddingX: number;
11
- }>;
10
+ };
12
11
  /** 탭 타이포 (main/sub 공통, token: typography.navigation.sm) */
13
12
  export declare const TAB_TYPOGRAPHY: {
14
13
  fontSize: number;