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.
- package/dist/components/SActionModal/SActionModal.cjs +129 -1
- package/dist/components/SActionModal/SActionModal.cjs.map +1 -1
- package/dist/components/SActionModal/SActionModal.js +129 -1
- package/dist/components/SActionModal/SActionModal.js.map +1 -1
- package/dist/components/SBarcodeInput/SBarcodeInput.cjs +157 -4
- package/dist/components/SBarcodeInput/SBarcodeInput.cjs.map +1 -1
- package/dist/components/SBarcodeInput/SBarcodeInput.js +158 -5
- package/dist/components/SBarcodeInput/SBarcodeInput.js.map +1 -1
- package/dist/components/SButton/SButton.cjs +129 -1
- package/dist/components/SButton/SButton.cjs.map +1 -1
- package/dist/components/SButton/SButton.js +129 -1
- package/dist/components/SButton/SButton.js.map +1 -1
- package/dist/components/SCalendar/SCalendar.cjs +131 -3
- package/dist/components/SCalendar/SCalendar.cjs.map +1 -1
- package/dist/components/SCalendar/SCalendar.d.ts +3 -1
- package/dist/components/SCalendar/SCalendar.js +131 -3
- package/dist/components/SCalendar/SCalendar.js.map +1 -1
- package/dist/components/SCallout/SCallout.cjs +129 -1
- package/dist/components/SCallout/SCallout.cjs.map +1 -1
- package/dist/components/SCallout/SCallout.js +129 -1
- package/dist/components/SCallout/SCallout.js.map +1 -1
- package/dist/components/SCheckbox/SCheckbox.cjs +130 -2
- package/dist/components/SCheckbox/SCheckbox.cjs.map +1 -1
- package/dist/components/SCheckbox/SCheckbox.js +130 -2
- package/dist/components/SCheckbox/SCheckbox.js.map +1 -1
- package/dist/components/SChip/SChip.cjs +130 -3
- package/dist/components/SChip/SChip.cjs.map +1 -1
- package/dist/components/SChip/SChip.js +130 -3
- package/dist/components/SChip/SChip.js.map +1 -1
- package/dist/components/SChipInput/SChipInput.cjs +154 -4
- package/dist/components/SChipInput/SChipInput.cjs.map +1 -1
- package/dist/components/SChipInput/SChipInput.js +154 -4
- package/dist/components/SChipInput/SChipInput.js.map +1 -1
- package/dist/components/SConfirmModal/SConfirmModal.cjs +129 -1
- package/dist/components/SConfirmModal/SConfirmModal.cjs.map +1 -1
- package/dist/components/SConfirmModal/SConfirmModal.js +129 -1
- package/dist/components/SConfirmModal/SConfirmModal.js.map +1 -1
- package/dist/components/SDatePicker/SDatePicker.cjs +159 -6
- package/dist/components/SDatePicker/SDatePicker.cjs.map +1 -1
- package/dist/components/SDatePicker/SDatePicker.js +159 -6
- package/dist/components/SDatePicker/SDatePicker.js.map +1 -1
- package/dist/components/SDateRangePicker/SDateRangePicker.cjs +157 -4
- package/dist/components/SDateRangePicker/SDateRangePicker.cjs.map +1 -1
- package/dist/components/SDateRangePicker/SDateRangePicker.js +157 -4
- package/dist/components/SDateRangePicker/SDateRangePicker.js.map +1 -1
- package/dist/components/SDropdownButton/SDropdownButton.cjs +129 -1
- package/dist/components/SDropdownButton/SDropdownButton.cjs.map +1 -1
- package/dist/components/SDropdownButton/SDropdownButton.js +129 -1
- package/dist/components/SDropdownButton/SDropdownButton.js.map +1 -1
- package/dist/components/SField/SField.cjs +130 -2
- package/dist/components/SField/SField.cjs.map +1 -1
- package/dist/components/SField/SField.js +130 -2
- package/dist/components/SField/SField.js.map +1 -1
- package/dist/components/SFilePicker/SFilePicker.cjs +157 -4
- package/dist/components/SFilePicker/SFilePicker.cjs.map +1 -1
- package/dist/components/SFilePicker/SFilePicker.js +157 -4
- package/dist/components/SFilePicker/SFilePicker.js.map +1 -1
- package/dist/components/SForm/SForm.cjs +91 -0
- package/dist/components/SForm/SForm.cjs.map +1 -0
- package/dist/components/SForm/SForm.d.ts +33 -0
- package/dist/components/SForm/SForm.js +89 -0
- package/dist/components/SForm/SForm.js.map +1 -0
- package/dist/components/SForm/index.d.ts +1 -0
- package/dist/components/SGhostButton/SGhostButton.cjs +129 -1
- package/dist/components/SGhostButton/SGhostButton.cjs.map +1 -1
- package/dist/components/SGhostButton/SGhostButton.js +129 -1
- package/dist/components/SGhostButton/SGhostButton.js.map +1 -1
- package/dist/components/SGuide/SGuide.cjs +129 -1
- package/dist/components/SGuide/SGuide.cjs.map +1 -1
- package/dist/components/SGuide/SGuide.js +129 -1
- package/dist/components/SGuide/SGuide.js.map +1 -1
- package/dist/components/SIcon/SIcon.cjs +129 -1
- package/dist/components/SIcon/SIcon.cjs.map +1 -1
- package/dist/components/SIcon/SIcon.d.ts +3 -2
- package/dist/components/SIcon/SIcon.js +129 -1
- package/dist/components/SIcon/SIcon.js.map +1 -1
- package/dist/components/SInput/SInput.cjs +157 -4
- package/dist/components/SInput/SInput.cjs.map +1 -1
- package/dist/components/SInput/SInput.js +158 -5
- package/dist/components/SInput/SInput.js.map +1 -1
- package/dist/components/SKeyValueTable/SKeyValueTable.cjs +214 -7
- package/dist/components/SKeyValueTable/SKeyValueTable.cjs.map +1 -1
- package/dist/components/SKeyValueTable/SKeyValueTable.js +214 -7
- package/dist/components/SKeyValueTable/SKeyValueTable.js.map +1 -1
- package/dist/components/SLoadingModal/SLoadingModal.cjs +129 -1
- package/dist/components/SLoadingModal/SLoadingModal.cjs.map +1 -1
- package/dist/components/SLoadingModal/SLoadingModal.js +129 -1
- package/dist/components/SLoadingModal/SLoadingModal.js.map +1 -1
- package/dist/components/SModalContainer/SModalContainer.cjs +129 -1
- package/dist/components/SModalContainer/SModalContainer.cjs.map +1 -1
- package/dist/components/SModalContainer/SModalContainer.js +129 -1
- package/dist/components/SModalContainer/SModalContainer.js.map +1 -1
- package/dist/components/SNumberInput/SNumberInput.cjs +157 -4
- package/dist/components/SNumberInput/SNumberInput.cjs.map +1 -1
- package/dist/components/SNumberInput/SNumberInput.js +157 -4
- package/dist/components/SNumberInput/SNumberInput.js.map +1 -1
- package/dist/components/SPagination/SPagination.cjs +129 -1
- package/dist/components/SPagination/SPagination.cjs.map +1 -1
- package/dist/components/SPagination/SPagination.js +129 -1
- package/dist/components/SPagination/SPagination.js.map +1 -1
- package/dist/components/SPopover/SPopover.cjs +129 -1
- package/dist/components/SPopover/SPopover.cjs.map +1 -1
- package/dist/components/SPopover/SPopover.d.ts +3 -1
- package/dist/components/SPopover/SPopover.js +129 -1
- package/dist/components/SPopover/SPopover.js.map +1 -1
- package/dist/components/SPopup/SPopup.cjs +129 -1
- package/dist/components/SPopup/SPopup.cjs.map +1 -1
- package/dist/components/SPopup/SPopup.js +129 -1
- package/dist/components/SPopup/SPopup.js.map +1 -1
- package/dist/components/SSelect/SSelect.cjs +157 -4
- package/dist/components/SSelect/SSelect.cjs.map +1 -1
- package/dist/components/SSelect/SSelect.js +158 -5
- package/dist/components/SSelect/SSelect.js.map +1 -1
- package/dist/components/STable/STable.cjs +161 -6
- package/dist/components/STable/STable.cjs.map +1 -1
- package/dist/components/STable/STable.d.ts +3 -1
- package/dist/components/STable/STable.js +161 -6
- package/dist/components/STable/STable.js.map +1 -1
- package/dist/components/STabs/STabs.cjs +129 -1
- package/dist/components/STabs/STabs.cjs.map +1 -1
- package/dist/components/STabs/STabs.js +129 -1
- package/dist/components/STabs/STabs.js.map +1 -1
- package/dist/components/STag/STag.cjs +129 -1
- package/dist/components/STag/STag.cjs.map +1 -1
- package/dist/components/STag/STag.js +129 -1
- package/dist/components/STag/STag.js.map +1 -1
- package/dist/components/STextLink/STextLink.cjs +129 -1
- package/dist/components/STextLink/STextLink.cjs.map +1 -1
- package/dist/components/STextLink/STextLink.d.ts +3 -2
- package/dist/components/STextLink/STextLink.js +129 -1
- package/dist/components/STextLink/STextLink.js.map +1 -1
- package/dist/components/STextarea/STextarea.cjs +157 -4
- package/dist/components/STextarea/STextarea.cjs.map +1 -1
- package/dist/components/STextarea/STextarea.js +158 -5
- package/dist/components/STextarea/STextarea.js.map +1 -1
- package/dist/components/SToast/SToast.cjs +129 -1
- package/dist/components/SToast/SToast.cjs.map +1 -1
- package/dist/components/SToast/SToast.js +129 -1
- package/dist/components/SToast/SToast.js.map +1 -1
- package/dist/components/SToast/SToastContainer.cjs +129 -1
- package/dist/components/SToast/SToastContainer.cjs.map +1 -1
- package/dist/components/SToast/SToastContainer.js +129 -1
- package/dist/components/SToast/SToastContainer.js.map +1 -1
- package/dist/components/STooltip/STooltip.cjs +130 -2
- package/dist/components/STooltip/STooltip.cjs.map +1 -1
- package/dist/components/STooltip/STooltip.d.ts +3 -1
- package/dist/components/STooltip/STooltip.js +130 -2
- package/dist/components/STooltip/STooltip.js.map +1 -1
- package/dist/index.cjs +311 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +308 -9
- package/dist/index.js.map +1 -1
- package/dist/lib/color.cjs +135 -0
- package/dist/lib/color.cjs.map +1 -0
- package/dist/lib/color.d.ts +28 -0
- package/dist/lib/color.js +131 -0
- package/dist/lib/color.js.map +1 -0
- package/dist/lib/form.cjs +23 -0
- package/dist/lib/form.cjs.map +1 -1
- package/dist/lib/form.d.ts +25 -0
- package/dist/lib/form.js +21 -1
- package/dist/lib/form.js.map +1 -1
- package/dist/styles.css +35 -3
- package/package.json +1 -1
|
@@ -34,6 +34,134 @@ var RPopover__namespace = /*#__PURE__*/_interopNamespace(RPopover);
|
|
|
34
34
|
function cn(...inputs) {
|
|
35
35
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
36
36
|
}
|
|
37
|
+
|
|
38
|
+
// src/lib/color.ts
|
|
39
|
+
var COLOR_KEYS = [
|
|
40
|
+
"white",
|
|
41
|
+
"black",
|
|
42
|
+
"grey_10",
|
|
43
|
+
"grey_20",
|
|
44
|
+
"grey_25",
|
|
45
|
+
"grey_30",
|
|
46
|
+
"grey_35",
|
|
47
|
+
"grey_45",
|
|
48
|
+
"grey_50",
|
|
49
|
+
"grey_55",
|
|
50
|
+
"grey_60",
|
|
51
|
+
"grey_65",
|
|
52
|
+
"grey_70",
|
|
53
|
+
"grey_80",
|
|
54
|
+
"grey_85",
|
|
55
|
+
"grey_90",
|
|
56
|
+
"grey_95",
|
|
57
|
+
"grey_05",
|
|
58
|
+
"red_15",
|
|
59
|
+
"red_20",
|
|
60
|
+
"red_30",
|
|
61
|
+
"red_45",
|
|
62
|
+
"red_60",
|
|
63
|
+
"red_70",
|
|
64
|
+
"red_75",
|
|
65
|
+
"red_80",
|
|
66
|
+
"red_85",
|
|
67
|
+
"red_90",
|
|
68
|
+
"red_95",
|
|
69
|
+
"red_99",
|
|
70
|
+
"orange_10",
|
|
71
|
+
"orange_20",
|
|
72
|
+
"orange_35",
|
|
73
|
+
"orange_45",
|
|
74
|
+
"orange_55",
|
|
75
|
+
"orange_60",
|
|
76
|
+
"orange_65",
|
|
77
|
+
"orange_75",
|
|
78
|
+
"orange_85",
|
|
79
|
+
"orange_90",
|
|
80
|
+
"orange_95",
|
|
81
|
+
"orange_99",
|
|
82
|
+
"yellow_10",
|
|
83
|
+
"yellow_20",
|
|
84
|
+
"yellow_25",
|
|
85
|
+
"yellow_30",
|
|
86
|
+
"yellow_40",
|
|
87
|
+
"yellow_45",
|
|
88
|
+
"yellow_50",
|
|
89
|
+
"yellow_60",
|
|
90
|
+
"yellow_70",
|
|
91
|
+
"yellow_80",
|
|
92
|
+
"yellow_90",
|
|
93
|
+
"yellow_95",
|
|
94
|
+
"olive_10",
|
|
95
|
+
"olive_15",
|
|
96
|
+
"olive_20",
|
|
97
|
+
"olive_30",
|
|
98
|
+
"olive_45",
|
|
99
|
+
"olive_55",
|
|
100
|
+
"olive_65",
|
|
101
|
+
"olive_70",
|
|
102
|
+
"olive_80",
|
|
103
|
+
"olive_90",
|
|
104
|
+
"olive_95",
|
|
105
|
+
"olive_05",
|
|
106
|
+
"green_15",
|
|
107
|
+
"green_25",
|
|
108
|
+
"green_45",
|
|
109
|
+
"green_55",
|
|
110
|
+
"green_65",
|
|
111
|
+
"green_70",
|
|
112
|
+
"green_75",
|
|
113
|
+
"green_80",
|
|
114
|
+
"green_85",
|
|
115
|
+
"green_90",
|
|
116
|
+
"green_95",
|
|
117
|
+
"green_99",
|
|
118
|
+
"steelblue_10",
|
|
119
|
+
"steelblue_25",
|
|
120
|
+
"steelblue_45",
|
|
121
|
+
"steelblue_60",
|
|
122
|
+
"steelblue_65",
|
|
123
|
+
"steelblue_70",
|
|
124
|
+
"steelblue_75",
|
|
125
|
+
"steelblue_80",
|
|
126
|
+
"steelblue_85",
|
|
127
|
+
"steelblue_90",
|
|
128
|
+
"steelblue_95",
|
|
129
|
+
"steelblue_99",
|
|
130
|
+
"oceanblue_15",
|
|
131
|
+
"oceanblue_25",
|
|
132
|
+
"oceanblue_50",
|
|
133
|
+
"oceanblue_60",
|
|
134
|
+
"oceanblue_65",
|
|
135
|
+
"oceanblue_70",
|
|
136
|
+
"oceanblue_75",
|
|
137
|
+
"oceanblue_80",
|
|
138
|
+
"oceanblue_85",
|
|
139
|
+
"oceanblue_90",
|
|
140
|
+
"oceanblue_95",
|
|
141
|
+
"oceanblue_99",
|
|
142
|
+
"brilliantblue_10",
|
|
143
|
+
"brilliantblue_20",
|
|
144
|
+
"brilliantblue_25",
|
|
145
|
+
"brilliantblue_40",
|
|
146
|
+
"brilliantblue_50",
|
|
147
|
+
"brilliantblue_60",
|
|
148
|
+
"brilliantblue_70",
|
|
149
|
+
"brilliantblue_75",
|
|
150
|
+
"brilliantblue_80",
|
|
151
|
+
"brilliantblue_85",
|
|
152
|
+
"brilliantblue_90",
|
|
153
|
+
"brilliantblue_95",
|
|
154
|
+
"brilliantblue_99",
|
|
155
|
+
"brilliantblue_05"
|
|
156
|
+
];
|
|
157
|
+
var KEY_SET = new Set(COLOR_KEYS);
|
|
158
|
+
function isColorKey(input) {
|
|
159
|
+
return KEY_SET.has(input);
|
|
160
|
+
}
|
|
161
|
+
function resolveColor(input, fallback) {
|
|
162
|
+
if (input === null || input === void 0 || input === "") return fallback;
|
|
163
|
+
return isColorKey(input) ? `var(--color-${input.replace(/_/g, "-")})` : input;
|
|
164
|
+
}
|
|
37
165
|
var Icon_add = (p) => {
|
|
38
166
|
const { size = 24, ...rest } = p;
|
|
39
167
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2733,7 +2861,7 @@ var SIcon = react.forwardRef(function SIcon2({ name, size = 24, color, rotate, l
|
|
|
2733
2861
|
{
|
|
2734
2862
|
ref,
|
|
2735
2863
|
className: cn("inline-flex items-center justify-center", rotateClass, className),
|
|
2736
|
-
style: { color, ...style },
|
|
2864
|
+
style: { color: resolveColor(color), ...style },
|
|
2737
2865
|
role: label ? "img" : void 0,
|
|
2738
2866
|
"aria-label": label,
|
|
2739
2867
|
"aria-hidden": label ? void 0 : true,
|
|
@@ -2766,7 +2894,7 @@ function SCheckbox({
|
|
|
2766
2894
|
onValueChange(false);
|
|
2767
2895
|
}
|
|
2768
2896
|
};
|
|
2769
|
-
const boxBg = disabled ? "var(--cmp-checkbox-bg-disabled)" :
|
|
2897
|
+
const boxBg = disabled ? "var(--cmp-checkbox-bg-disabled)" : inverse ? "transparent" : isChecked ? "var(--cmp-checkbox-checked-bg-default)" : "var(--cmp-checkbox-unchecked-bg-default)";
|
|
2770
2898
|
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)";
|
|
2771
2899
|
const iconColor = disabled ? "var(--cmp-checkbox-checked-icon-disabled)" : "var(--cmp-checkbox-checked-icon-default)";
|
|
2772
2900
|
const labelColor = disabled ? "var(--cmp-checkbox-label-disabled)" : inverse ? "var(--cmp-checkbox-label-inverse)" : "var(--cmp-checkbox-label-default)";
|
|
@@ -3002,7 +3130,7 @@ var HIDE_DELAY_MS = 100;
|
|
|
3002
3130
|
function useBody(content, message = []) {
|
|
3003
3131
|
if (content != null) return content;
|
|
3004
3132
|
if (message.length === 0) return null;
|
|
3005
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3133
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: message.map((line, i) => /* @__PURE__ */ jsxRuntime.jsx("div", { children: line }, i)) });
|
|
3006
3134
|
}
|
|
3007
3135
|
var STooltip = react.forwardRef(function STooltip2({
|
|
3008
3136
|
content,
|
|
@@ -3120,8 +3248,6 @@ var STooltip = react.forwardRef(function STooltip2({
|
|
|
3120
3248
|
] });
|
|
3121
3249
|
});
|
|
3122
3250
|
STooltip.displayName = "STooltip";
|
|
3123
|
-
|
|
3124
|
-
// src/lib/form.ts
|
|
3125
3251
|
function runRules(value, rules) {
|
|
3126
3252
|
if (!rules || rules.length === 0) return "";
|
|
3127
3253
|
for (const rule of rules) {
|
|
@@ -3130,6 +3256,24 @@ function runRules(value, rules) {
|
|
|
3130
3256
|
}
|
|
3131
3257
|
return "";
|
|
3132
3258
|
}
|
|
3259
|
+
var FormContext = react.createContext(null);
|
|
3260
|
+
function useFormContext() {
|
|
3261
|
+
return react.useContext(FormContext);
|
|
3262
|
+
}
|
|
3263
|
+
function useFormField(field) {
|
|
3264
|
+
const ctx = useFormContext();
|
|
3265
|
+
const cbRef = react.useRef(field);
|
|
3266
|
+
cbRef.current = field;
|
|
3267
|
+
const name = field.name ?? "";
|
|
3268
|
+
react.useEffect(() => {
|
|
3269
|
+
if (!ctx) return;
|
|
3270
|
+
return ctx.register({
|
|
3271
|
+
name,
|
|
3272
|
+
validate: () => cbRef.current.validate(),
|
|
3273
|
+
resetValidation: () => cbRef.current.resetValidation()
|
|
3274
|
+
});
|
|
3275
|
+
}, [ctx, name]);
|
|
3276
|
+
}
|
|
3133
3277
|
var FIELD_SIZE = {
|
|
3134
3278
|
sm: { height: 28, radius: 4, fieldGap: 12, labelGap: 6, fontSize: 12, lineHeight: 20, icon: 12 },
|
|
3135
3279
|
md: { height: 36, radius: 6, fieldGap: 16, labelGap: 8, fontSize: 14, lineHeight: 24, icon: 12 }
|
|
@@ -3422,6 +3566,15 @@ var SSelect = react.forwardRef(function SSelect2({
|
|
|
3422
3566
|
const arr = Array.isArray(value) ? value : [value];
|
|
3423
3567
|
return arr.map((v) => v != null && typeof v === "object" ? v.value : v).filter((v) => v != null && v !== "").map(String);
|
|
3424
3568
|
}, [value]);
|
|
3569
|
+
useFormField({
|
|
3570
|
+
name,
|
|
3571
|
+
validate: () => {
|
|
3572
|
+
const msg = runRules(multi ? selected : selected[0] ?? "", rules);
|
|
3573
|
+
setRuleError(msg);
|
|
3574
|
+
return msg === "";
|
|
3575
|
+
},
|
|
3576
|
+
resetValidation: () => setRuleError("")
|
|
3577
|
+
});
|
|
3425
3578
|
const emit = (next) => {
|
|
3426
3579
|
if (!onValueChange) return;
|
|
3427
3580
|
const mapped = next.map(
|
|
@@ -4096,8 +4249,10 @@ var STable = react.forwardRef(function STable2({
|
|
|
4096
4249
|
{
|
|
4097
4250
|
className: cn(
|
|
4098
4251
|
// 원본 .td: 컬럼 폭에 맞춰 내용 말줄임(overflow hidden + ellipsis) + 행 구분선(border-b)
|
|
4252
|
+
// 셀 배경은 흰색으로 채워 뒤 배경이 비치지 않게 하고, hover 시 행 배경(grey_05)을 따른다.
|
|
4099
4253
|
"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)]",
|
|
4100
|
-
|
|
4254
|
+
rowBg,
|
|
4255
|
+
"group-hover:bg-[var(--color-grey-05)]",
|
|
4101
4256
|
stickyShadowClass(i),
|
|
4102
4257
|
col.tdClass
|
|
4103
4258
|
),
|