sellmate-design-system-react 0.1.3 → 0.1.5

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 (165) hide show
  1. package/dist/components/SActionModal/SActionModal.cjs +129 -1
  2. package/dist/components/SActionModal/SActionModal.cjs.map +1 -1
  3. package/dist/components/SActionModal/SActionModal.js +129 -1
  4. package/dist/components/SActionModal/SActionModal.js.map +1 -1
  5. package/dist/components/SBarcodeInput/SBarcodeInput.cjs +157 -4
  6. package/dist/components/SBarcodeInput/SBarcodeInput.cjs.map +1 -1
  7. package/dist/components/SBarcodeInput/SBarcodeInput.js +158 -5
  8. package/dist/components/SBarcodeInput/SBarcodeInput.js.map +1 -1
  9. package/dist/components/SButton/SButton.cjs +129 -1
  10. package/dist/components/SButton/SButton.cjs.map +1 -1
  11. package/dist/components/SButton/SButton.js +129 -1
  12. package/dist/components/SButton/SButton.js.map +1 -1
  13. package/dist/components/SCalendar/SCalendar.cjs +131 -3
  14. package/dist/components/SCalendar/SCalendar.cjs.map +1 -1
  15. package/dist/components/SCalendar/SCalendar.d.ts +3 -1
  16. package/dist/components/SCalendar/SCalendar.js +131 -3
  17. package/dist/components/SCalendar/SCalendar.js.map +1 -1
  18. package/dist/components/SCallout/SCallout.cjs +129 -1
  19. package/dist/components/SCallout/SCallout.cjs.map +1 -1
  20. package/dist/components/SCallout/SCallout.js +129 -1
  21. package/dist/components/SCallout/SCallout.js.map +1 -1
  22. package/dist/components/SCheckbox/SCheckbox.cjs +130 -2
  23. package/dist/components/SCheckbox/SCheckbox.cjs.map +1 -1
  24. package/dist/components/SCheckbox/SCheckbox.js +130 -2
  25. package/dist/components/SCheckbox/SCheckbox.js.map +1 -1
  26. package/dist/components/SChip/SChip.cjs +130 -3
  27. package/dist/components/SChip/SChip.cjs.map +1 -1
  28. package/dist/components/SChip/SChip.js +130 -3
  29. package/dist/components/SChip/SChip.js.map +1 -1
  30. package/dist/components/SChipInput/SChipInput.cjs +154 -4
  31. package/dist/components/SChipInput/SChipInput.cjs.map +1 -1
  32. package/dist/components/SChipInput/SChipInput.js +154 -4
  33. package/dist/components/SChipInput/SChipInput.js.map +1 -1
  34. package/dist/components/SConfirmModal/SConfirmModal.cjs +129 -1
  35. package/dist/components/SConfirmModal/SConfirmModal.cjs.map +1 -1
  36. package/dist/components/SConfirmModal/SConfirmModal.js +129 -1
  37. package/dist/components/SConfirmModal/SConfirmModal.js.map +1 -1
  38. package/dist/components/SDatePicker/SDatePicker.cjs +159 -6
  39. package/dist/components/SDatePicker/SDatePicker.cjs.map +1 -1
  40. package/dist/components/SDatePicker/SDatePicker.js +159 -6
  41. package/dist/components/SDatePicker/SDatePicker.js.map +1 -1
  42. package/dist/components/SDateRangePicker/SDateRangePicker.cjs +157 -4
  43. package/dist/components/SDateRangePicker/SDateRangePicker.cjs.map +1 -1
  44. package/dist/components/SDateRangePicker/SDateRangePicker.js +157 -4
  45. package/dist/components/SDateRangePicker/SDateRangePicker.js.map +1 -1
  46. package/dist/components/SDropdownButton/SDropdownButton.cjs +129 -1
  47. package/dist/components/SDropdownButton/SDropdownButton.cjs.map +1 -1
  48. package/dist/components/SDropdownButton/SDropdownButton.js +129 -1
  49. package/dist/components/SDropdownButton/SDropdownButton.js.map +1 -1
  50. package/dist/components/SField/SField.cjs +130 -2
  51. package/dist/components/SField/SField.cjs.map +1 -1
  52. package/dist/components/SField/SField.js +130 -2
  53. package/dist/components/SField/SField.js.map +1 -1
  54. package/dist/components/SFilePicker/SFilePicker.cjs +157 -4
  55. package/dist/components/SFilePicker/SFilePicker.cjs.map +1 -1
  56. package/dist/components/SFilePicker/SFilePicker.js +157 -4
  57. package/dist/components/SFilePicker/SFilePicker.js.map +1 -1
  58. package/dist/components/SForm/SForm.cjs +91 -0
  59. package/dist/components/SForm/SForm.cjs.map +1 -0
  60. package/dist/components/SForm/SForm.d.ts +33 -0
  61. package/dist/components/SForm/SForm.js +89 -0
  62. package/dist/components/SForm/SForm.js.map +1 -0
  63. package/dist/components/SForm/index.d.ts +1 -0
  64. package/dist/components/SGhostButton/SGhostButton.cjs +129 -1
  65. package/dist/components/SGhostButton/SGhostButton.cjs.map +1 -1
  66. package/dist/components/SGhostButton/SGhostButton.js +129 -1
  67. package/dist/components/SGhostButton/SGhostButton.js.map +1 -1
  68. package/dist/components/SGuide/SGuide.cjs +129 -1
  69. package/dist/components/SGuide/SGuide.cjs.map +1 -1
  70. package/dist/components/SGuide/SGuide.js +129 -1
  71. package/dist/components/SGuide/SGuide.js.map +1 -1
  72. package/dist/components/SIcon/SIcon.cjs +129 -1
  73. package/dist/components/SIcon/SIcon.cjs.map +1 -1
  74. package/dist/components/SIcon/SIcon.d.ts +3 -2
  75. package/dist/components/SIcon/SIcon.js +129 -1
  76. package/dist/components/SIcon/SIcon.js.map +1 -1
  77. package/dist/components/SInput/SInput.cjs +157 -4
  78. package/dist/components/SInput/SInput.cjs.map +1 -1
  79. package/dist/components/SInput/SInput.js +158 -5
  80. package/dist/components/SInput/SInput.js.map +1 -1
  81. package/dist/components/SKeyValueTable/SKeyValueTable.cjs +214 -7
  82. package/dist/components/SKeyValueTable/SKeyValueTable.cjs.map +1 -1
  83. package/dist/components/SKeyValueTable/SKeyValueTable.js +214 -7
  84. package/dist/components/SKeyValueTable/SKeyValueTable.js.map +1 -1
  85. package/dist/components/SLoadingModal/SLoadingModal.cjs +129 -1
  86. package/dist/components/SLoadingModal/SLoadingModal.cjs.map +1 -1
  87. package/dist/components/SLoadingModal/SLoadingModal.js +129 -1
  88. package/dist/components/SLoadingModal/SLoadingModal.js.map +1 -1
  89. package/dist/components/SModalContainer/SModalContainer.cjs +129 -1
  90. package/dist/components/SModalContainer/SModalContainer.cjs.map +1 -1
  91. package/dist/components/SModalContainer/SModalContainer.js +129 -1
  92. package/dist/components/SModalContainer/SModalContainer.js.map +1 -1
  93. package/dist/components/SNumberInput/SNumberInput.cjs +157 -4
  94. package/dist/components/SNumberInput/SNumberInput.cjs.map +1 -1
  95. package/dist/components/SNumberInput/SNumberInput.js +157 -4
  96. package/dist/components/SNumberInput/SNumberInput.js.map +1 -1
  97. package/dist/components/SPagination/SPagination.cjs +129 -1
  98. package/dist/components/SPagination/SPagination.cjs.map +1 -1
  99. package/dist/components/SPagination/SPagination.js +129 -1
  100. package/dist/components/SPagination/SPagination.js.map +1 -1
  101. package/dist/components/SPopover/SPopover.cjs +129 -1
  102. package/dist/components/SPopover/SPopover.cjs.map +1 -1
  103. package/dist/components/SPopover/SPopover.d.ts +3 -1
  104. package/dist/components/SPopover/SPopover.js +129 -1
  105. package/dist/components/SPopover/SPopover.js.map +1 -1
  106. package/dist/components/SPopup/SPopup.cjs +129 -1
  107. package/dist/components/SPopup/SPopup.cjs.map +1 -1
  108. package/dist/components/SPopup/SPopup.js +129 -1
  109. package/dist/components/SPopup/SPopup.js.map +1 -1
  110. package/dist/components/SSelect/SSelect.cjs +157 -4
  111. package/dist/components/SSelect/SSelect.cjs.map +1 -1
  112. package/dist/components/SSelect/SSelect.js +158 -5
  113. package/dist/components/SSelect/SSelect.js.map +1 -1
  114. package/dist/components/STable/STable.cjs +161 -6
  115. package/dist/components/STable/STable.cjs.map +1 -1
  116. package/dist/components/STable/STable.d.ts +3 -1
  117. package/dist/components/STable/STable.js +161 -6
  118. package/dist/components/STable/STable.js.map +1 -1
  119. package/dist/components/STabs/STabs.cjs +129 -1
  120. package/dist/components/STabs/STabs.cjs.map +1 -1
  121. package/dist/components/STabs/STabs.js +129 -1
  122. package/dist/components/STabs/STabs.js.map +1 -1
  123. package/dist/components/STag/STag.cjs +129 -1
  124. package/dist/components/STag/STag.cjs.map +1 -1
  125. package/dist/components/STag/STag.js +129 -1
  126. package/dist/components/STag/STag.js.map +1 -1
  127. package/dist/components/STextLink/STextLink.cjs +129 -1
  128. package/dist/components/STextLink/STextLink.cjs.map +1 -1
  129. package/dist/components/STextLink/STextLink.d.ts +3 -2
  130. package/dist/components/STextLink/STextLink.js +129 -1
  131. package/dist/components/STextLink/STextLink.js.map +1 -1
  132. package/dist/components/STextarea/STextarea.cjs +157 -4
  133. package/dist/components/STextarea/STextarea.cjs.map +1 -1
  134. package/dist/components/STextarea/STextarea.js +158 -5
  135. package/dist/components/STextarea/STextarea.js.map +1 -1
  136. package/dist/components/SToast/SToast.cjs +129 -1
  137. package/dist/components/SToast/SToast.cjs.map +1 -1
  138. package/dist/components/SToast/SToast.js +129 -1
  139. package/dist/components/SToast/SToast.js.map +1 -1
  140. package/dist/components/SToast/SToastContainer.cjs +129 -1
  141. package/dist/components/SToast/SToastContainer.cjs.map +1 -1
  142. package/dist/components/SToast/SToastContainer.js +129 -1
  143. package/dist/components/SToast/SToastContainer.js.map +1 -1
  144. package/dist/components/STooltip/STooltip.cjs +130 -2
  145. package/dist/components/STooltip/STooltip.cjs.map +1 -1
  146. package/dist/components/STooltip/STooltip.d.ts +3 -1
  147. package/dist/components/STooltip/STooltip.js +130 -2
  148. package/dist/components/STooltip/STooltip.js.map +1 -1
  149. package/dist/index.cjs +311 -8
  150. package/dist/index.cjs.map +1 -1
  151. package/dist/index.d.ts +2 -0
  152. package/dist/index.js +308 -9
  153. package/dist/index.js.map +1 -1
  154. package/dist/lib/color.cjs +135 -0
  155. package/dist/lib/color.cjs.map +1 -0
  156. package/dist/lib/color.d.ts +28 -0
  157. package/dist/lib/color.js +131 -0
  158. package/dist/lib/color.js.map +1 -0
  159. package/dist/lib/form.cjs +23 -0
  160. package/dist/lib/form.cjs.map +1 -1
  161. package/dist/lib/form.d.ts +25 -0
  162. package/dist/lib/form.js +21 -1
  163. package/dist/lib/form.js.map +1 -1
  164. package/dist/styles.css +35 -3
  165. package/package.json +1 -1
@@ -1,4 +1,5 @@
1
1
  import { type CSSProperties, type ReactNode } from 'react';
2
+ import { type SColor } from '../../lib/color';
2
3
  import { type SIconName } from '../SIcon';
3
4
  import { type SSelectOption } from '../SSelect';
4
5
  export type SRow = Record<string, any>;
@@ -18,7 +19,8 @@ export interface STableColumn {
18
19
  format?: (value: any, row: SRow) => string;
19
20
  visible?: boolean;
20
21
  icon?: SIconName;
21
- iconColor?: string;
22
+ /** 헤더 아이콘 색상. 팔레트 키(`grey_65`, `red_95` …) 또는 임의 CSS 색상 */
23
+ iconColor?: SColor;
22
24
  /** 셀 커스텀 렌더 (React 확장) */
23
25
  render?: (row: SRow, value: any) => ReactNode;
24
26
  tdClass?: string;
@@ -10,6 +10,134 @@ import * as RPopover from '@radix-ui/react-popover';
10
10
  function cn(...inputs) {
11
11
  return twMerge(clsx(inputs));
12
12
  }
13
+
14
+ // src/lib/color.ts
15
+ var COLOR_KEYS = [
16
+ "white",
17
+ "black",
18
+ "grey_10",
19
+ "grey_20",
20
+ "grey_25",
21
+ "grey_30",
22
+ "grey_35",
23
+ "grey_45",
24
+ "grey_50",
25
+ "grey_55",
26
+ "grey_60",
27
+ "grey_65",
28
+ "grey_70",
29
+ "grey_80",
30
+ "grey_85",
31
+ "grey_90",
32
+ "grey_95",
33
+ "grey_05",
34
+ "red_15",
35
+ "red_20",
36
+ "red_30",
37
+ "red_45",
38
+ "red_60",
39
+ "red_70",
40
+ "red_75",
41
+ "red_80",
42
+ "red_85",
43
+ "red_90",
44
+ "red_95",
45
+ "red_99",
46
+ "orange_10",
47
+ "orange_20",
48
+ "orange_35",
49
+ "orange_45",
50
+ "orange_55",
51
+ "orange_60",
52
+ "orange_65",
53
+ "orange_75",
54
+ "orange_85",
55
+ "orange_90",
56
+ "orange_95",
57
+ "orange_99",
58
+ "yellow_10",
59
+ "yellow_20",
60
+ "yellow_25",
61
+ "yellow_30",
62
+ "yellow_40",
63
+ "yellow_45",
64
+ "yellow_50",
65
+ "yellow_60",
66
+ "yellow_70",
67
+ "yellow_80",
68
+ "yellow_90",
69
+ "yellow_95",
70
+ "olive_10",
71
+ "olive_15",
72
+ "olive_20",
73
+ "olive_30",
74
+ "olive_45",
75
+ "olive_55",
76
+ "olive_65",
77
+ "olive_70",
78
+ "olive_80",
79
+ "olive_90",
80
+ "olive_95",
81
+ "olive_05",
82
+ "green_15",
83
+ "green_25",
84
+ "green_45",
85
+ "green_55",
86
+ "green_65",
87
+ "green_70",
88
+ "green_75",
89
+ "green_80",
90
+ "green_85",
91
+ "green_90",
92
+ "green_95",
93
+ "green_99",
94
+ "steelblue_10",
95
+ "steelblue_25",
96
+ "steelblue_45",
97
+ "steelblue_60",
98
+ "steelblue_65",
99
+ "steelblue_70",
100
+ "steelblue_75",
101
+ "steelblue_80",
102
+ "steelblue_85",
103
+ "steelblue_90",
104
+ "steelblue_95",
105
+ "steelblue_99",
106
+ "oceanblue_15",
107
+ "oceanblue_25",
108
+ "oceanblue_50",
109
+ "oceanblue_60",
110
+ "oceanblue_65",
111
+ "oceanblue_70",
112
+ "oceanblue_75",
113
+ "oceanblue_80",
114
+ "oceanblue_85",
115
+ "oceanblue_90",
116
+ "oceanblue_95",
117
+ "oceanblue_99",
118
+ "brilliantblue_10",
119
+ "brilliantblue_20",
120
+ "brilliantblue_25",
121
+ "brilliantblue_40",
122
+ "brilliantblue_50",
123
+ "brilliantblue_60",
124
+ "brilliantblue_70",
125
+ "brilliantblue_75",
126
+ "brilliantblue_80",
127
+ "brilliantblue_85",
128
+ "brilliantblue_90",
129
+ "brilliantblue_95",
130
+ "brilliantblue_99",
131
+ "brilliantblue_05"
132
+ ];
133
+ var KEY_SET = new Set(COLOR_KEYS);
134
+ function isColorKey(input) {
135
+ return KEY_SET.has(input);
136
+ }
137
+ function resolveColor(input, fallback) {
138
+ if (input === null || input === void 0 || input === "") return fallback;
139
+ return isColorKey(input) ? `var(--color-${input.replace(/_/g, "-")})` : input;
140
+ }
13
141
  var Icon_add = (p) => {
14
142
  const { size = 24, ...rest } = p;
15
143
  return /* @__PURE__ */ jsx(
@@ -2709,7 +2837,7 @@ var SIcon = forwardRef(function SIcon2({ name, size = 24, color, rotate, label,
2709
2837
  {
2710
2838
  ref,
2711
2839
  className: cn("inline-flex items-center justify-center", rotateClass, className),
2712
- style: { color, ...style },
2840
+ style: { color: resolveColor(color), ...style },
2713
2841
  role: label ? "img" : void 0,
2714
2842
  "aria-label": label,
2715
2843
  "aria-hidden": label ? void 0 : true,
@@ -2742,7 +2870,7 @@ function SCheckbox({
2742
2870
  onValueChange(false);
2743
2871
  }
2744
2872
  };
2745
- const boxBg = disabled ? "var(--cmp-checkbox-bg-disabled)" : isChecked && !inverse ? "var(--cmp-checkbox-checked-bg-default)" : "transparent";
2873
+ const boxBg = disabled ? "var(--cmp-checkbox-bg-disabled)" : inverse ? "transparent" : isChecked ? "var(--cmp-checkbox-checked-bg-default)" : "var(--cmp-checkbox-unchecked-bg-default)";
2746
2874
  const boxBorder = disabled ? "var(--cmp-checkbox-border-disabled)" : inverse ? "var(--cmp-checkbox-checked-border-inverse)" : isChecked ? "var(--cmp-checkbox-checked-bg-default)" : "var(--cmp-checkbox-unchecked-border-default)";
2747
2875
  const iconColor = disabled ? "var(--cmp-checkbox-checked-icon-disabled)" : "var(--cmp-checkbox-checked-icon-default)";
2748
2876
  const labelColor = disabled ? "var(--cmp-checkbox-label-disabled)" : inverse ? "var(--cmp-checkbox-label-inverse)" : "var(--cmp-checkbox-label-default)";
@@ -2978,7 +3106,7 @@ var HIDE_DELAY_MS = 100;
2978
3106
  function useBody(content, message = []) {
2979
3107
  if (content != null) return content;
2980
3108
  if (message.length === 0) return null;
2981
- return /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-[12px]", children: message.map((line, i) => /* @__PURE__ */ jsx("span", { children: line }, i)) });
3109
+ return /* @__PURE__ */ jsx(Fragment, { children: message.map((line, i) => /* @__PURE__ */ jsx("div", { children: line }, i)) });
2982
3110
  }
2983
3111
  var STooltip = forwardRef(function STooltip2({
2984
3112
  content,
@@ -3096,8 +3224,6 @@ var STooltip = forwardRef(function STooltip2({
3096
3224
  ] });
3097
3225
  });
3098
3226
  STooltip.displayName = "STooltip";
3099
-
3100
- // src/lib/form.ts
3101
3227
  function runRules(value, rules) {
3102
3228
  if (!rules || rules.length === 0) return "";
3103
3229
  for (const rule of rules) {
@@ -3106,6 +3232,24 @@ function runRules(value, rules) {
3106
3232
  }
3107
3233
  return "";
3108
3234
  }
3235
+ var FormContext = createContext(null);
3236
+ function useFormContext() {
3237
+ return useContext(FormContext);
3238
+ }
3239
+ function useFormField(field) {
3240
+ const ctx = useFormContext();
3241
+ const cbRef = useRef(field);
3242
+ cbRef.current = field;
3243
+ const name = field.name ?? "";
3244
+ useEffect(() => {
3245
+ if (!ctx) return;
3246
+ return ctx.register({
3247
+ name,
3248
+ validate: () => cbRef.current.validate(),
3249
+ resetValidation: () => cbRef.current.resetValidation()
3250
+ });
3251
+ }, [ctx, name]);
3252
+ }
3109
3253
  var FIELD_SIZE = {
3110
3254
  sm: { height: 28, radius: 4, fieldGap: 12, labelGap: 6, fontSize: 12, lineHeight: 20, icon: 12 },
3111
3255
  md: { height: 36, radius: 6, fieldGap: 16, labelGap: 8, fontSize: 14, lineHeight: 24, icon: 12 }
@@ -3398,6 +3542,15 @@ var SSelect = forwardRef(function SSelect2({
3398
3542
  const arr = Array.isArray(value) ? value : [value];
3399
3543
  return arr.map((v) => v != null && typeof v === "object" ? v.value : v).filter((v) => v != null && v !== "").map(String);
3400
3544
  }, [value]);
3545
+ useFormField({
3546
+ name,
3547
+ validate: () => {
3548
+ const msg = runRules(multi ? selected : selected[0] ?? "", rules);
3549
+ setRuleError(msg);
3550
+ return msg === "";
3551
+ },
3552
+ resetValidation: () => setRuleError("")
3553
+ });
3401
3554
  const emit = (next) => {
3402
3555
  if (!onValueChange) return;
3403
3556
  const mapped = next.map(
@@ -4072,8 +4225,10 @@ var STable = forwardRef(function STable2({
4072
4225
  {
4073
4226
  className: cn(
4074
4227
  // 원본 .td: 컬럼 폭에 맞춰 내용 말줄임(overflow hidden + ellipsis) + 행 구분선(border-b)
4228
+ // 셀 배경은 흰색으로 채워 뒤 배경이 비치지 않게 하고, hover 시 행 배경(grey_05)을 따른다.
4075
4229
  "overflow-hidden text-ellipsis whitespace-nowrap border-b border-solid border-[color:var(--cmp-table-border-color)] px-[16px] text-[12px] leading-[20px] text-[color:var(--sys-color-fg-primary)]",
4076
- stickyInfo(i).isSticky && cn(rowBg, "group-hover:bg-[var(--color-grey-05)]"),
4230
+ rowBg,
4231
+ "group-hover:bg-[var(--color-grey-05)]",
4077
4232
  stickyShadowClass(i),
4078
4233
  col.tdClass
4079
4234
  ),