sellmate-design-system-react 0.8.3 → 0.8.4
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/SBarcodeInput/SBarcodeInput.cjs +78 -2
- package/dist/components/SBarcodeInput/SBarcodeInput.cjs.map +1 -1
- package/dist/components/SBarcodeInput/SBarcodeInput.js +78 -2
- package/dist/components/SBarcodeInput/SBarcodeInput.js.map +1 -1
- package/dist/components/SChipInput/SChipInput.cjs +78 -2
- package/dist/components/SChipInput/SChipInput.cjs.map +1 -1
- package/dist/components/SChipInput/SChipInput.js +78 -2
- package/dist/components/SChipInput/SChipInput.js.map +1 -1
- package/dist/components/SDatePicker/SDatePicker.cjs +78 -2
- package/dist/components/SDatePicker/SDatePicker.cjs.map +1 -1
- package/dist/components/SDatePicker/SDatePicker.js +78 -2
- package/dist/components/SDatePicker/SDatePicker.js.map +1 -1
- package/dist/components/SDateRangePicker/SDateRangePicker.cjs +78 -2
- package/dist/components/SDateRangePicker/SDateRangePicker.cjs.map +1 -1
- package/dist/components/SDateRangePicker/SDateRangePicker.js +78 -2
- package/dist/components/SDateRangePicker/SDateRangePicker.js.map +1 -1
- package/dist/components/SField/SField.cjs +78 -2
- package/dist/components/SField/SField.cjs.map +1 -1
- package/dist/components/SField/SField.js +78 -2
- package/dist/components/SField/SField.js.map +1 -1
- package/dist/components/SFilePicker/SFilePicker.cjs +78 -2
- package/dist/components/SFilePicker/SFilePicker.cjs.map +1 -1
- package/dist/components/SFilePicker/SFilePicker.js +78 -2
- package/dist/components/SFilePicker/SFilePicker.js.map +1 -1
- package/dist/components/SInput/SInput.cjs +78 -2
- package/dist/components/SInput/SInput.cjs.map +1 -1
- package/dist/components/SInput/SInput.js +78 -2
- package/dist/components/SInput/SInput.js.map +1 -1
- package/dist/components/SKeyValueTable/SKeyValueTable.cjs +224 -118
- package/dist/components/SKeyValueTable/SKeyValueTable.cjs.map +1 -1
- package/dist/components/SKeyValueTable/SKeyValueTable.js +224 -118
- package/dist/components/SKeyValueTable/SKeyValueTable.js.map +1 -1
- package/dist/components/SNumberInput/SNumberInput.cjs +78 -2
- package/dist/components/SNumberInput/SNumberInput.cjs.map +1 -1
- package/dist/components/SNumberInput/SNumberInput.js +78 -2
- package/dist/components/SNumberInput/SNumberInput.js.map +1 -1
- package/dist/components/SSelect/SSelect.cjs +155 -49
- package/dist/components/SSelect/SSelect.cjs.map +1 -1
- package/dist/components/SSelect/SSelect.js +155 -49
- package/dist/components/SSelect/SSelect.js.map +1 -1
- package/dist/components/SSelect/select.config.d.ts +7 -0
- package/dist/components/STable/STable.cjs +155 -49
- package/dist/components/STable/STable.cjs.map +1 -1
- package/dist/components/STable/STable.js +155 -49
- package/dist/components/STable/STable.js.map +1 -1
- package/dist/components/STextarea/STextarea.cjs +78 -2
- package/dist/components/STextarea/STextarea.cjs.map +1 -1
- package/dist/components/STextarea/STextarea.js +78 -2
- package/dist/components/STextarea/STextarea.js.map +1 -1
- package/dist/components/STimePicker/STimePicker.cjs +78 -2
- package/dist/components/STimePicker/STimePicker.cjs.map +1 -1
- package/dist/components/STimePicker/STimePicker.js +78 -2
- package/dist/components/STimePicker/STimePicker.js.map +1 -1
- package/dist/components/STimeRangePicker/STimeRangePicker.cjs +78 -2
- package/dist/components/STimeRangePicker/STimeRangePicker.cjs.map +1 -1
- package/dist/components/STimeRangePicker/STimeRangePicker.js +78 -2
- package/dist/components/STimeRangePicker/STimeRangePicker.js.map +1 -1
- package/dist/components/STooltip/STooltip.cjs +78 -2
- package/dist/components/STooltip/STooltip.cjs.map +1 -1
- package/dist/components/STooltip/STooltip.d.ts +1 -1
- package/dist/components/STooltip/STooltip.js +78 -2
- package/dist/components/STooltip/STooltip.js.map +1 -1
- package/dist/index.cjs +155 -49
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +155 -49
- package/dist/index.js.map +1 -1
- package/dist/styles.css +4 -8
- package/package.json +1 -1
|
@@ -3202,7 +3202,14 @@ function useBody(content, message = []) {
|
|
|
3202
3202
|
if (content != null) return content;
|
|
3203
3203
|
if (message.length === 0) return null;
|
|
3204
3204
|
const singleLine = message.length === 1;
|
|
3205
|
-
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: message.map((line, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3205
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: message.map((line, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3206
|
+
"div",
|
|
3207
|
+
{
|
|
3208
|
+
className: singleLine ? "leading-[24px]" : void 0,
|
|
3209
|
+
dangerouslySetInnerHTML: { __html: sanitizeInlineHtml(line) }
|
|
3210
|
+
},
|
|
3211
|
+
i
|
|
3212
|
+
)) });
|
|
3206
3213
|
}
|
|
3207
3214
|
var STooltip = react.forwardRef(function STooltip2({
|
|
3208
3215
|
content,
|
|
@@ -3260,7 +3267,7 @@ var STooltip = react.forwardRef(function STooltip2({
|
|
|
3260
3267
|
if (disabled || body == null) return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: triggerNode });
|
|
3261
3268
|
const isHover = trigger === "hover";
|
|
3262
3269
|
const contentClass = cn(
|
|
3263
|
-
"z-50
|
|
3270
|
+
"z-50 w-fit whitespace-nowrap rounded-[6px] px-[16px] py-[12px] text-[12px] leading-[20px]",
|
|
3264
3271
|
FLOATING_SLIDE_ANIM,
|
|
3265
3272
|
className
|
|
3266
3273
|
);
|
|
@@ -3611,6 +3618,16 @@ function flattenOptions(options, depth = 1) {
|
|
|
3611
3618
|
return out;
|
|
3612
3619
|
}
|
|
3613
3620
|
var selectableOptions = (flat) => flat.filter((o) => !o.isGroup && !o.disabled);
|
|
3621
|
+
function collectGroupLeafValues(flat, groupIndex) {
|
|
3622
|
+
const group = flat[groupIndex];
|
|
3623
|
+
if (group == null || !group.isGroup) return [];
|
|
3624
|
+
const values = [];
|
|
3625
|
+
for (let i = groupIndex + 1; i < flat.length; i++) {
|
|
3626
|
+
if (flat[i].depth <= group.depth) break;
|
|
3627
|
+
if (!flat[i].isGroup && !flat[i].disabled) values.push(flat[i].value);
|
|
3628
|
+
}
|
|
3629
|
+
return values;
|
|
3630
|
+
}
|
|
3614
3631
|
var isHtmlLabel = (label) => /<[a-z][\s\S]*>/i.test(label);
|
|
3615
3632
|
var extractText = (html) => html.replace(/<[^>]*>/g, "");
|
|
3616
3633
|
var SEARCH_THRESHOLD = 11;
|
|
@@ -3736,16 +3753,31 @@ var SSelect = react.forwardRef(function SSelect2({
|
|
|
3736
3753
|
const allValues = selectable.map((o) => o.value);
|
|
3737
3754
|
const allSelected = allValues.length > 0 && allValues.every((v) => selected.includes(v));
|
|
3738
3755
|
const hasItems = filtered.some((o) => !o.isGroup);
|
|
3756
|
+
const groupLeafValues = react.useMemo(() => {
|
|
3757
|
+
const map = /* @__PURE__ */ new Map();
|
|
3758
|
+
filtered.forEach((o, i) => {
|
|
3759
|
+
if (o.isGroup) map.set(i, collectGroupLeafValues(filtered, i));
|
|
3760
|
+
});
|
|
3761
|
+
return map;
|
|
3762
|
+
}, [filtered]);
|
|
3739
3763
|
const navigableItems = react.useMemo(() => {
|
|
3740
3764
|
const items = [];
|
|
3741
3765
|
if (multi && useSelectAll && allValues.length > 0) {
|
|
3742
|
-
items.push({
|
|
3766
|
+
items.push({ key: "__select_all__", isSelectAll: true });
|
|
3743
3767
|
}
|
|
3744
|
-
filtered.forEach((o) => {
|
|
3745
|
-
if (
|
|
3768
|
+
filtered.forEach((o, i) => {
|
|
3769
|
+
if (o.disabled) return;
|
|
3770
|
+
if (o.isGroup) {
|
|
3771
|
+
if (!multi) return;
|
|
3772
|
+
const leafValues = groupLeafValues.get(i) ?? [];
|
|
3773
|
+
if (leafValues.length === 0) return;
|
|
3774
|
+
items.push({ key: `__group_${i}__`, isGroup: true, leafValues });
|
|
3775
|
+
} else {
|
|
3776
|
+
items.push({ key: o.value, value: o.value });
|
|
3777
|
+
}
|
|
3746
3778
|
});
|
|
3747
3779
|
return items;
|
|
3748
|
-
}, [allValues.length, filtered, multi, useSelectAll]);
|
|
3780
|
+
}, [allValues.length, filtered, groupLeafValues, multi, useSelectAll]);
|
|
3749
3781
|
const triggerText = (() => {
|
|
3750
3782
|
if (selected.length === 0) return placeholder;
|
|
3751
3783
|
if (multi) {
|
|
@@ -3767,6 +3799,17 @@ var SSelect = react.forwardRef(function SSelect2({
|
|
|
3767
3799
|
const handleSelectAll = () => {
|
|
3768
3800
|
emit(allSelected ? [] : allValues);
|
|
3769
3801
|
};
|
|
3802
|
+
const handleToggleGroup = (leafValues) => {
|
|
3803
|
+
if (leafValues.length === 0) return;
|
|
3804
|
+
const selectedSet = new Set(selected);
|
|
3805
|
+
const allSelectedInGroup = leafValues.every((v) => selectedSet.has(v));
|
|
3806
|
+
if (allSelectedInGroup) {
|
|
3807
|
+
const remove = new Set(leafValues);
|
|
3808
|
+
emit(selected.filter((v) => !remove.has(v)));
|
|
3809
|
+
} else {
|
|
3810
|
+
emit([...selected, ...leafValues.filter((v) => !selectedSet.has(v))]);
|
|
3811
|
+
}
|
|
3812
|
+
};
|
|
3770
3813
|
react.useEffect(() => {
|
|
3771
3814
|
if (!open) {
|
|
3772
3815
|
setFocusedIndex(-1);
|
|
@@ -3807,6 +3850,10 @@ var SSelect = react.forwardRef(function SSelect2({
|
|
|
3807
3850
|
handleSelectAll();
|
|
3808
3851
|
return;
|
|
3809
3852
|
}
|
|
3853
|
+
if (focused.isGroup) {
|
|
3854
|
+
handleToggleGroup(focused.leafValues ?? []);
|
|
3855
|
+
return;
|
|
3856
|
+
}
|
|
3810
3857
|
handleSelect(focused.value);
|
|
3811
3858
|
};
|
|
3812
3859
|
const handleKeyDown = (event) => {
|
|
@@ -3970,20 +4017,20 @@ var SSelect = react.forwardRef(function SSelect2({
|
|
|
3970
4017
|
items: filtered,
|
|
3971
4018
|
multi,
|
|
3972
4019
|
selected,
|
|
3973
|
-
|
|
4020
|
+
groupLeafValues,
|
|
4021
|
+
focusedValue: navigableItems[focusedIndex]?.key,
|
|
3974
4022
|
showSelectAll: multi && useSelectAll && allValues.length > 0,
|
|
3975
4023
|
selectAllLabel: allSelectedLabel,
|
|
3976
4024
|
selectAllSelected: allSelected,
|
|
3977
4025
|
onSelectAll: handleSelectAll,
|
|
3978
4026
|
onSelect: handleSelect,
|
|
3979
|
-
|
|
3980
|
-
|
|
4027
|
+
onToggleGroup: handleToggleGroup,
|
|
4028
|
+
onHoverValue: (key) => {
|
|
4029
|
+
if (key == null) {
|
|
3981
4030
|
setFocusedIndex(-1);
|
|
3982
4031
|
return;
|
|
3983
4032
|
}
|
|
3984
|
-
const index = navigableItems.findIndex(
|
|
3985
|
-
(item) => item.isSelectAll ? value2 === "__select_all__" : item.value === value2
|
|
3986
|
-
);
|
|
4033
|
+
const index = navigableItems.findIndex((item) => item.key === key);
|
|
3987
4034
|
if (index >= 0) setFocusedIndex(index);
|
|
3988
4035
|
}
|
|
3989
4036
|
}
|
|
@@ -4002,20 +4049,23 @@ function ItemList({
|
|
|
4002
4049
|
items,
|
|
4003
4050
|
multi,
|
|
4004
4051
|
selected,
|
|
4052
|
+
groupLeafValues,
|
|
4005
4053
|
focusedValue,
|
|
4006
4054
|
showSelectAll,
|
|
4007
4055
|
selectAllLabel,
|
|
4008
4056
|
selectAllSelected,
|
|
4009
4057
|
onSelectAll,
|
|
4010
4058
|
onSelect,
|
|
4059
|
+
onToggleGroup,
|
|
4011
4060
|
onHoverValue
|
|
4012
4061
|
}) {
|
|
4062
|
+
const selectedSet = react.useMemo(() => new Set(selected), [selected]);
|
|
4013
4063
|
const itemBase = cn(
|
|
4014
4064
|
"group flex w-full cursor-pointer select-none items-center gap-[8px] border-none bg-transparent text-left text-[12px] leading-[20px] outline-none",
|
|
4015
4065
|
"text-[color:var(--cmp-listItem-content-default)]",
|
|
4016
4066
|
"disabled:cursor-not-allowed disabled:text-[color:var(--cmp-listItem-content-disabled)]"
|
|
4017
4067
|
);
|
|
4018
|
-
const activeClass = "hover:bg-[var(--cmp-listItem-bg-hover)] hover:text-[color:var(--cmp-listItem-content-hover)] focus:bg-[var(--cmp-listItem-bg-hover)] focus:text-[color:var(--cmp-listItem-content-hover)]";
|
|
4068
|
+
const activeClass = "hover:bg-[var(--cmp-listItem-bg-hover)] hover:text-[color:var(--cmp-listItem-content-hover)] focus-visible:bg-[var(--cmp-listItem-bg-hover)] focus-visible:text-[color:var(--cmp-listItem-content-hover)]";
|
|
4019
4069
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { role: "listbox", "aria-multiselectable": multi || void 0, children: [
|
|
4020
4070
|
showSelectAll && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4021
4071
|
"button",
|
|
@@ -4032,23 +4082,7 @@ function ItemList({
|
|
|
4032
4082
|
onMouseLeave: () => onHoverValue(null),
|
|
4033
4083
|
onClick: onSelectAll,
|
|
4034
4084
|
children: [
|
|
4035
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4036
|
-
"span",
|
|
4037
|
-
{
|
|
4038
|
-
className: cn(
|
|
4039
|
-
"flex h-[16px] w-[16px] flex-shrink-0 items-center justify-center rounded-[2px] border border-solid",
|
|
4040
|
-
selectAllSelected ? focusedValue === "__select_all__" ? "border-[color:var(--cmp-checkbox-checked-border-inverse)] bg-[var(--cmp-checkbox-checked-bg-default)]" : "border-[color:var(--cmp-checkbox-checked-bg-default)] bg-[var(--cmp-checkbox-checked-bg-default)]" : "border-[color:var(--cmp-checkbox-unchecked-border-default)] bg-[var(--cmp-checkbox-unchecked-bg-default)]"
|
|
4041
|
-
),
|
|
4042
|
-
children: selectAllSelected && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4043
|
-
SIcon,
|
|
4044
|
-
{
|
|
4045
|
-
name: "checkboxCheck",
|
|
4046
|
-
size: 12,
|
|
4047
|
-
color: "var(--cmp-checkbox-checked-icon-default)"
|
|
4048
|
-
}
|
|
4049
|
-
)
|
|
4050
|
-
}
|
|
4051
|
-
),
|
|
4085
|
+
/* @__PURE__ */ jsxRuntime.jsx(CheckboxBox, { state: selectAllSelected, focused: focusedValue === "__select_all__" }),
|
|
4052
4086
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 truncate", children: selectAllLabel })
|
|
4053
4087
|
]
|
|
4054
4088
|
}
|
|
@@ -4058,12 +4092,71 @@ function ItemList({
|
|
|
4058
4092
|
const rowKey = `${o.value}-${idx}`;
|
|
4059
4093
|
if (o.isGroup) {
|
|
4060
4094
|
const isDepth1 = o.depth === 1;
|
|
4095
|
+
const groupTone = isDepth1 ? "border-t border-solid border-[color:var(--cmp-listItem-depth1-border-color)] bg-[var(--cmp-listItem-depth1-bg-default)] font-bold" : "bg-[var(--cmp-listItem-depth2-middle-bg)] font-medium";
|
|
4096
|
+
if (multi) {
|
|
4097
|
+
const leafValues = groupLeafValues.get(idx) ?? [];
|
|
4098
|
+
const total = leafValues.length;
|
|
4099
|
+
const selectedCount = leafValues.reduce((n, v) => selectedSet.has(v) ? n + 1 : n, 0);
|
|
4100
|
+
const groupState = total === 0 || selectedCount === 0 ? false : selectedCount === total ? true : null;
|
|
4101
|
+
const groupDisabled = o.disabled || total === 0;
|
|
4102
|
+
const groupFocused = focusedValue === `__group_${idx}__`;
|
|
4103
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4104
|
+
"button",
|
|
4105
|
+
{
|
|
4106
|
+
type: "button",
|
|
4107
|
+
role: "option",
|
|
4108
|
+
"aria-selected": groupState === true,
|
|
4109
|
+
disabled: groupDisabled,
|
|
4110
|
+
"data-select-focused": groupFocused ? "true" : void 0,
|
|
4111
|
+
"data-select-active": groupFocused ? "true" : void 0,
|
|
4112
|
+
className: cn(
|
|
4113
|
+
"flex w-full select-none items-center gap-[8px] border-none py-[4px] pr-[12px] text-left text-[12px] leading-[20px] text-[color:var(--cmp-listItem-content-default)]",
|
|
4114
|
+
groupTone,
|
|
4115
|
+
groupDisabled ? "cursor-not-allowed text-[color:var(--cmp-listItem-content-disabled)]" : "cursor-pointer",
|
|
4116
|
+
groupDisabled && isDepth1 && "bg-[var(--cmp-listItem-depth1-bg-disabled)]",
|
|
4117
|
+
// 포커스 하이라이트는 depth 배경보다 뒤에 둬 tailwind-merge 로 이기게 한다.
|
|
4118
|
+
groupFocused && !groupDisabled && "bg-[var(--cmp-listItem-bg-hover)] text-[color:var(--cmp-listItem-content-hover)]"
|
|
4119
|
+
),
|
|
4120
|
+
style: { paddingLeft: padLeft },
|
|
4121
|
+
onMouseEnter: () => onHoverValue(`__group_${idx}__`),
|
|
4122
|
+
onMouseLeave: () => onHoverValue(null),
|
|
4123
|
+
onClick: () => onToggleGroup(leafValues),
|
|
4124
|
+
children: [
|
|
4125
|
+
/* @__PURE__ */ jsxRuntime.jsx(CheckboxBox, { state: groupState, disabled: groupDisabled, focused: groupFocused }),
|
|
4126
|
+
isHtmlLabel(o.label) ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4127
|
+
"span",
|
|
4128
|
+
{
|
|
4129
|
+
className: "min-w-0 truncate",
|
|
4130
|
+
dangerouslySetInnerHTML: { __html: sanitizeInlineHtml(o.label) }
|
|
4131
|
+
}
|
|
4132
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate", children: o.label }),
|
|
4133
|
+
total > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4134
|
+
"span",
|
|
4135
|
+
{
|
|
4136
|
+
className: cn(
|
|
4137
|
+
"shrink-0 font-medium",
|
|
4138
|
+
groupFocused ? "text-white" : "text-[color:var(--cmp-listItem-content-disabled)]"
|
|
4139
|
+
),
|
|
4140
|
+
children: [
|
|
4141
|
+
"(",
|
|
4142
|
+
selectedCount,
|
|
4143
|
+
"/",
|
|
4144
|
+
total,
|
|
4145
|
+
")"
|
|
4146
|
+
]
|
|
4147
|
+
}
|
|
4148
|
+
)
|
|
4149
|
+
]
|
|
4150
|
+
},
|
|
4151
|
+
rowKey
|
|
4152
|
+
);
|
|
4153
|
+
}
|
|
4061
4154
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4062
4155
|
"div",
|
|
4063
4156
|
{
|
|
4064
4157
|
className: cn(
|
|
4065
4158
|
"select-none py-[4px] pr-[12px] text-[12px] leading-[20px] text-[color:var(--cmp-listItem-content-default)]",
|
|
4066
|
-
|
|
4159
|
+
groupTone,
|
|
4067
4160
|
// 하위가 전부 비활성이면(select.config 에서 bubble-up) 어미 그룹도 비활성 처리:
|
|
4068
4161
|
// 텍스트는 회색(#888), depth1 그룹은 파란 배경 대신 회색(#EEE)으로 (depth2 는 #F6F6F6 유지)
|
|
4069
4162
|
o.disabled && "cursor-not-allowed text-[color:var(--cmp-listItem-content-disabled)]",
|
|
@@ -4099,25 +4192,11 @@ function ItemList({
|
|
|
4099
4192
|
onClick: () => onSelect(o.value),
|
|
4100
4193
|
children: [
|
|
4101
4194
|
multi && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4102
|
-
|
|
4195
|
+
CheckboxBox,
|
|
4103
4196
|
{
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
// 비활성: 회색 채움(#E1E1E1) + 회색 테두리(#CCCCCC)
|
|
4108
|
-
"cursor-not-allowed border-[color:var(--cmp-checkbox-border-disabled)] bg-[var(--cmp-checkbox-bg-disabled)]"
|
|
4109
|
-
) : cn(
|
|
4110
|
-
isSelected ? focusedValue === o.value ? "border-[color:var(--cmp-checkbox-checked-border-inverse)] bg-[var(--cmp-checkbox-checked-bg-default)]" : "border-[color:var(--cmp-checkbox-checked-bg-default)] bg-[var(--cmp-checkbox-checked-bg-default)]" : "border-[color:var(--cmp-checkbox-unchecked-border-default)] bg-[var(--cmp-checkbox-unchecked-bg-default)]"
|
|
4111
|
-
)
|
|
4112
|
-
),
|
|
4113
|
-
children: isSelected && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4114
|
-
SIcon,
|
|
4115
|
-
{
|
|
4116
|
-
name: "checkboxCheck",
|
|
4117
|
-
size: 12,
|
|
4118
|
-
color: o.disabled ? "var(--cmp-checkbox-checked-icon-disabled)" : "var(--cmp-checkbox-checked-icon-default)"
|
|
4119
|
-
}
|
|
4120
|
-
)
|
|
4197
|
+
state: isSelected,
|
|
4198
|
+
disabled: o.disabled,
|
|
4199
|
+
focused: focusedValue === o.value
|
|
4121
4200
|
}
|
|
4122
4201
|
),
|
|
4123
4202
|
isHtmlLabel(o.label) ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4134,6 +4213,33 @@ function ItemList({
|
|
|
4134
4213
|
})
|
|
4135
4214
|
] });
|
|
4136
4215
|
}
|
|
4216
|
+
function CheckboxBox({
|
|
4217
|
+
state,
|
|
4218
|
+
disabled = false,
|
|
4219
|
+
focused = false
|
|
4220
|
+
}) {
|
|
4221
|
+
const filled = state === true || state === null;
|
|
4222
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4223
|
+
"span",
|
|
4224
|
+
{
|
|
4225
|
+
className: cn(
|
|
4226
|
+
"flex h-[16px] w-[16px] flex-shrink-0 items-center justify-center rounded-[2px] border border-solid",
|
|
4227
|
+
disabled ? (
|
|
4228
|
+
// 비활성: 회색 채움(#E1E1E1) + 회색 테두리(#CCCCCC)
|
|
4229
|
+
"cursor-not-allowed border-[color:var(--cmp-checkbox-border-disabled)] bg-[var(--cmp-checkbox-bg-disabled)]"
|
|
4230
|
+
) : filled ? focused ? "border-[color:var(--cmp-checkbox-checked-border-inverse)] bg-[var(--cmp-checkbox-checked-bg-default)]" : "border-[color:var(--cmp-checkbox-checked-bg-default)] bg-[var(--cmp-checkbox-checked-bg-default)]" : "border-[color:var(--cmp-checkbox-unchecked-border-default)] bg-[var(--cmp-checkbox-unchecked-bg-default)]"
|
|
4231
|
+
),
|
|
4232
|
+
children: filled && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4233
|
+
SIcon,
|
|
4234
|
+
{
|
|
4235
|
+
name: state === null ? "checkboxIndeterminate" : "checkboxCheck",
|
|
4236
|
+
size: 12,
|
|
4237
|
+
color: disabled ? "var(--cmp-checkbox-checked-icon-disabled)" : "var(--cmp-checkbox-checked-icon-default)"
|
|
4238
|
+
}
|
|
4239
|
+
)
|
|
4240
|
+
}
|
|
4241
|
+
);
|
|
4242
|
+
}
|
|
4137
4243
|
|
|
4138
4244
|
exports.SSelect = SSelect;
|
|
4139
4245
|
//# sourceMappingURL=SSelect.cjs.map
|