sellmate-design-system-react 0.8.3 → 0.9.0
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/SGnb/SGnb.cjs +58 -16
- package/dist/components/SGnb/SGnb.cjs.map +1 -1
- package/dist/components/SGnb/SGnb.d.ts +15 -0
- package/dist/components/SGnb/SGnb.js +58 -16
- package/dist/components/SGnb/SGnb.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 +209 -65
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +209 -65
- package/dist/index.js.map +1 -1
- package/dist/styles.css +35 -8
- package/package.json +1 -1
|
@@ -3180,7 +3180,14 @@ function useBody(content, message = []) {
|
|
|
3180
3180
|
if (content != null) return content;
|
|
3181
3181
|
if (message.length === 0) return null;
|
|
3182
3182
|
const singleLine = message.length === 1;
|
|
3183
|
-
return /* @__PURE__ */ jsx(Fragment, { children: message.map((line, i) => /* @__PURE__ */ jsx(
|
|
3183
|
+
return /* @__PURE__ */ jsx(Fragment, { children: message.map((line, i) => /* @__PURE__ */ jsx(
|
|
3184
|
+
"div",
|
|
3185
|
+
{
|
|
3186
|
+
className: singleLine ? "leading-[24px]" : void 0,
|
|
3187
|
+
dangerouslySetInnerHTML: { __html: sanitizeInlineHtml(line) }
|
|
3188
|
+
},
|
|
3189
|
+
i
|
|
3190
|
+
)) });
|
|
3184
3191
|
}
|
|
3185
3192
|
var STooltip = forwardRef(function STooltip2({
|
|
3186
3193
|
content,
|
|
@@ -3238,7 +3245,7 @@ var STooltip = forwardRef(function STooltip2({
|
|
|
3238
3245
|
if (disabled || body == null) return /* @__PURE__ */ jsx(Fragment, { children: triggerNode });
|
|
3239
3246
|
const isHover = trigger === "hover";
|
|
3240
3247
|
const contentClass = cn(
|
|
3241
|
-
"z-50
|
|
3248
|
+
"z-50 w-fit whitespace-nowrap rounded-[6px] px-[16px] py-[12px] text-[12px] leading-[20px]",
|
|
3242
3249
|
FLOATING_SLIDE_ANIM,
|
|
3243
3250
|
className
|
|
3244
3251
|
);
|
|
@@ -3589,6 +3596,16 @@ function flattenOptions(options, depth = 1) {
|
|
|
3589
3596
|
return out;
|
|
3590
3597
|
}
|
|
3591
3598
|
var selectableOptions = (flat) => flat.filter((o) => !o.isGroup && !o.disabled);
|
|
3599
|
+
function collectGroupLeafValues(flat, groupIndex) {
|
|
3600
|
+
const group = flat[groupIndex];
|
|
3601
|
+
if (group == null || !group.isGroup) return [];
|
|
3602
|
+
const values = [];
|
|
3603
|
+
for (let i = groupIndex + 1; i < flat.length; i++) {
|
|
3604
|
+
if (flat[i].depth <= group.depth) break;
|
|
3605
|
+
if (!flat[i].isGroup && !flat[i].disabled) values.push(flat[i].value);
|
|
3606
|
+
}
|
|
3607
|
+
return values;
|
|
3608
|
+
}
|
|
3592
3609
|
var isHtmlLabel = (label) => /<[a-z][\s\S]*>/i.test(label);
|
|
3593
3610
|
var extractText = (html) => html.replace(/<[^>]*>/g, "");
|
|
3594
3611
|
var SEARCH_THRESHOLD = 11;
|
|
@@ -3714,16 +3731,31 @@ var SSelect = forwardRef(function SSelect2({
|
|
|
3714
3731
|
const allValues = selectable.map((o) => o.value);
|
|
3715
3732
|
const allSelected = allValues.length > 0 && allValues.every((v) => selected.includes(v));
|
|
3716
3733
|
const hasItems = filtered.some((o) => !o.isGroup);
|
|
3734
|
+
const groupLeafValues = useMemo(() => {
|
|
3735
|
+
const map = /* @__PURE__ */ new Map();
|
|
3736
|
+
filtered.forEach((o, i) => {
|
|
3737
|
+
if (o.isGroup) map.set(i, collectGroupLeafValues(filtered, i));
|
|
3738
|
+
});
|
|
3739
|
+
return map;
|
|
3740
|
+
}, [filtered]);
|
|
3717
3741
|
const navigableItems = useMemo(() => {
|
|
3718
3742
|
const items = [];
|
|
3719
3743
|
if (multi && useSelectAll && allValues.length > 0) {
|
|
3720
|
-
items.push({
|
|
3744
|
+
items.push({ key: "__select_all__", isSelectAll: true });
|
|
3721
3745
|
}
|
|
3722
|
-
filtered.forEach((o) => {
|
|
3723
|
-
if (
|
|
3746
|
+
filtered.forEach((o, i) => {
|
|
3747
|
+
if (o.disabled) return;
|
|
3748
|
+
if (o.isGroup) {
|
|
3749
|
+
if (!multi) return;
|
|
3750
|
+
const leafValues = groupLeafValues.get(i) ?? [];
|
|
3751
|
+
if (leafValues.length === 0) return;
|
|
3752
|
+
items.push({ key: `__group_${i}__`, isGroup: true, leafValues });
|
|
3753
|
+
} else {
|
|
3754
|
+
items.push({ key: o.value, value: o.value });
|
|
3755
|
+
}
|
|
3724
3756
|
});
|
|
3725
3757
|
return items;
|
|
3726
|
-
}, [allValues.length, filtered, multi, useSelectAll]);
|
|
3758
|
+
}, [allValues.length, filtered, groupLeafValues, multi, useSelectAll]);
|
|
3727
3759
|
const triggerText = (() => {
|
|
3728
3760
|
if (selected.length === 0) return placeholder;
|
|
3729
3761
|
if (multi) {
|
|
@@ -3745,6 +3777,17 @@ var SSelect = forwardRef(function SSelect2({
|
|
|
3745
3777
|
const handleSelectAll = () => {
|
|
3746
3778
|
emit(allSelected ? [] : allValues);
|
|
3747
3779
|
};
|
|
3780
|
+
const handleToggleGroup = (leafValues) => {
|
|
3781
|
+
if (leafValues.length === 0) return;
|
|
3782
|
+
const selectedSet = new Set(selected);
|
|
3783
|
+
const allSelectedInGroup = leafValues.every((v) => selectedSet.has(v));
|
|
3784
|
+
if (allSelectedInGroup) {
|
|
3785
|
+
const remove = new Set(leafValues);
|
|
3786
|
+
emit(selected.filter((v) => !remove.has(v)));
|
|
3787
|
+
} else {
|
|
3788
|
+
emit([...selected, ...leafValues.filter((v) => !selectedSet.has(v))]);
|
|
3789
|
+
}
|
|
3790
|
+
};
|
|
3748
3791
|
useEffect(() => {
|
|
3749
3792
|
if (!open) {
|
|
3750
3793
|
setFocusedIndex(-1);
|
|
@@ -3785,6 +3828,10 @@ var SSelect = forwardRef(function SSelect2({
|
|
|
3785
3828
|
handleSelectAll();
|
|
3786
3829
|
return;
|
|
3787
3830
|
}
|
|
3831
|
+
if (focused.isGroup) {
|
|
3832
|
+
handleToggleGroup(focused.leafValues ?? []);
|
|
3833
|
+
return;
|
|
3834
|
+
}
|
|
3788
3835
|
handleSelect(focused.value);
|
|
3789
3836
|
};
|
|
3790
3837
|
const handleKeyDown = (event) => {
|
|
@@ -3948,20 +3995,20 @@ var SSelect = forwardRef(function SSelect2({
|
|
|
3948
3995
|
items: filtered,
|
|
3949
3996
|
multi,
|
|
3950
3997
|
selected,
|
|
3951
|
-
|
|
3998
|
+
groupLeafValues,
|
|
3999
|
+
focusedValue: navigableItems[focusedIndex]?.key,
|
|
3952
4000
|
showSelectAll: multi && useSelectAll && allValues.length > 0,
|
|
3953
4001
|
selectAllLabel: allSelectedLabel,
|
|
3954
4002
|
selectAllSelected: allSelected,
|
|
3955
4003
|
onSelectAll: handleSelectAll,
|
|
3956
4004
|
onSelect: handleSelect,
|
|
3957
|
-
|
|
3958
|
-
|
|
4005
|
+
onToggleGroup: handleToggleGroup,
|
|
4006
|
+
onHoverValue: (key) => {
|
|
4007
|
+
if (key == null) {
|
|
3959
4008
|
setFocusedIndex(-1);
|
|
3960
4009
|
return;
|
|
3961
4010
|
}
|
|
3962
|
-
const index = navigableItems.findIndex(
|
|
3963
|
-
(item) => item.isSelectAll ? value2 === "__select_all__" : item.value === value2
|
|
3964
|
-
);
|
|
4011
|
+
const index = navigableItems.findIndex((item) => item.key === key);
|
|
3965
4012
|
if (index >= 0) setFocusedIndex(index);
|
|
3966
4013
|
}
|
|
3967
4014
|
}
|
|
@@ -3980,20 +4027,23 @@ function ItemList({
|
|
|
3980
4027
|
items,
|
|
3981
4028
|
multi,
|
|
3982
4029
|
selected,
|
|
4030
|
+
groupLeafValues,
|
|
3983
4031
|
focusedValue,
|
|
3984
4032
|
showSelectAll,
|
|
3985
4033
|
selectAllLabel,
|
|
3986
4034
|
selectAllSelected,
|
|
3987
4035
|
onSelectAll,
|
|
3988
4036
|
onSelect,
|
|
4037
|
+
onToggleGroup,
|
|
3989
4038
|
onHoverValue
|
|
3990
4039
|
}) {
|
|
4040
|
+
const selectedSet = useMemo(() => new Set(selected), [selected]);
|
|
3991
4041
|
const itemBase = cn(
|
|
3992
4042
|
"group flex w-full cursor-pointer select-none items-center gap-[8px] border-none bg-transparent text-left text-[12px] leading-[20px] outline-none",
|
|
3993
4043
|
"text-[color:var(--cmp-listItem-content-default)]",
|
|
3994
4044
|
"disabled:cursor-not-allowed disabled:text-[color:var(--cmp-listItem-content-disabled)]"
|
|
3995
4045
|
);
|
|
3996
|
-
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)]";
|
|
4046
|
+
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)]";
|
|
3997
4047
|
return /* @__PURE__ */ jsxs("div", { role: "listbox", "aria-multiselectable": multi || void 0, children: [
|
|
3998
4048
|
showSelectAll && /* @__PURE__ */ jsxs(
|
|
3999
4049
|
"button",
|
|
@@ -4010,23 +4060,7 @@ function ItemList({
|
|
|
4010
4060
|
onMouseLeave: () => onHoverValue(null),
|
|
4011
4061
|
onClick: onSelectAll,
|
|
4012
4062
|
children: [
|
|
4013
|
-
/* @__PURE__ */ jsx(
|
|
4014
|
-
"span",
|
|
4015
|
-
{
|
|
4016
|
-
className: cn(
|
|
4017
|
-
"flex h-[16px] w-[16px] flex-shrink-0 items-center justify-center rounded-[2px] border border-solid",
|
|
4018
|
-
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)]"
|
|
4019
|
-
),
|
|
4020
|
-
children: selectAllSelected && /* @__PURE__ */ jsx(
|
|
4021
|
-
SIcon,
|
|
4022
|
-
{
|
|
4023
|
-
name: "checkboxCheck",
|
|
4024
|
-
size: 12,
|
|
4025
|
-
color: "var(--cmp-checkbox-checked-icon-default)"
|
|
4026
|
-
}
|
|
4027
|
-
)
|
|
4028
|
-
}
|
|
4029
|
-
),
|
|
4063
|
+
/* @__PURE__ */ jsx(CheckboxBox, { state: selectAllSelected, focused: focusedValue === "__select_all__" }),
|
|
4030
4064
|
/* @__PURE__ */ jsx("span", { className: "flex-1 truncate", children: selectAllLabel })
|
|
4031
4065
|
]
|
|
4032
4066
|
}
|
|
@@ -4036,12 +4070,71 @@ function ItemList({
|
|
|
4036
4070
|
const rowKey = `${o.value}-${idx}`;
|
|
4037
4071
|
if (o.isGroup) {
|
|
4038
4072
|
const isDepth1 = o.depth === 1;
|
|
4073
|
+
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";
|
|
4074
|
+
if (multi) {
|
|
4075
|
+
const leafValues = groupLeafValues.get(idx) ?? [];
|
|
4076
|
+
const total = leafValues.length;
|
|
4077
|
+
const selectedCount = leafValues.reduce((n, v) => selectedSet.has(v) ? n + 1 : n, 0);
|
|
4078
|
+
const groupState = total === 0 || selectedCount === 0 ? false : selectedCount === total ? true : null;
|
|
4079
|
+
const groupDisabled = o.disabled || total === 0;
|
|
4080
|
+
const groupFocused = focusedValue === `__group_${idx}__`;
|
|
4081
|
+
return /* @__PURE__ */ jsxs(
|
|
4082
|
+
"button",
|
|
4083
|
+
{
|
|
4084
|
+
type: "button",
|
|
4085
|
+
role: "option",
|
|
4086
|
+
"aria-selected": groupState === true,
|
|
4087
|
+
disabled: groupDisabled,
|
|
4088
|
+
"data-select-focused": groupFocused ? "true" : void 0,
|
|
4089
|
+
"data-select-active": groupFocused ? "true" : void 0,
|
|
4090
|
+
className: cn(
|
|
4091
|
+
"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)]",
|
|
4092
|
+
groupTone,
|
|
4093
|
+
groupDisabled ? "cursor-not-allowed text-[color:var(--cmp-listItem-content-disabled)]" : "cursor-pointer",
|
|
4094
|
+
groupDisabled && isDepth1 && "bg-[var(--cmp-listItem-depth1-bg-disabled)]",
|
|
4095
|
+
// 포커스 하이라이트는 depth 배경보다 뒤에 둬 tailwind-merge 로 이기게 한다.
|
|
4096
|
+
groupFocused && !groupDisabled && "bg-[var(--cmp-listItem-bg-hover)] text-[color:var(--cmp-listItem-content-hover)]"
|
|
4097
|
+
),
|
|
4098
|
+
style: { paddingLeft: padLeft },
|
|
4099
|
+
onMouseEnter: () => onHoverValue(`__group_${idx}__`),
|
|
4100
|
+
onMouseLeave: () => onHoverValue(null),
|
|
4101
|
+
onClick: () => onToggleGroup(leafValues),
|
|
4102
|
+
children: [
|
|
4103
|
+
/* @__PURE__ */ jsx(CheckboxBox, { state: groupState, disabled: groupDisabled, focused: groupFocused }),
|
|
4104
|
+
isHtmlLabel(o.label) ? /* @__PURE__ */ jsx(
|
|
4105
|
+
"span",
|
|
4106
|
+
{
|
|
4107
|
+
className: "min-w-0 truncate",
|
|
4108
|
+
dangerouslySetInnerHTML: { __html: sanitizeInlineHtml(o.label) }
|
|
4109
|
+
}
|
|
4110
|
+
) : /* @__PURE__ */ jsx("span", { className: "min-w-0 truncate", children: o.label }),
|
|
4111
|
+
total > 0 && /* @__PURE__ */ jsxs(
|
|
4112
|
+
"span",
|
|
4113
|
+
{
|
|
4114
|
+
className: cn(
|
|
4115
|
+
"shrink-0 font-medium",
|
|
4116
|
+
groupFocused ? "text-white" : "text-[color:var(--cmp-listItem-content-disabled)]"
|
|
4117
|
+
),
|
|
4118
|
+
children: [
|
|
4119
|
+
"(",
|
|
4120
|
+
selectedCount,
|
|
4121
|
+
"/",
|
|
4122
|
+
total,
|
|
4123
|
+
")"
|
|
4124
|
+
]
|
|
4125
|
+
}
|
|
4126
|
+
)
|
|
4127
|
+
]
|
|
4128
|
+
},
|
|
4129
|
+
rowKey
|
|
4130
|
+
);
|
|
4131
|
+
}
|
|
4039
4132
|
return /* @__PURE__ */ jsx(
|
|
4040
4133
|
"div",
|
|
4041
4134
|
{
|
|
4042
4135
|
className: cn(
|
|
4043
4136
|
"select-none py-[4px] pr-[12px] text-[12px] leading-[20px] text-[color:var(--cmp-listItem-content-default)]",
|
|
4044
|
-
|
|
4137
|
+
groupTone,
|
|
4045
4138
|
// 하위가 전부 비활성이면(select.config 에서 bubble-up) 어미 그룹도 비활성 처리:
|
|
4046
4139
|
// 텍스트는 회색(#888), depth1 그룹은 파란 배경 대신 회색(#EEE)으로 (depth2 는 #F6F6F6 유지)
|
|
4047
4140
|
o.disabled && "cursor-not-allowed text-[color:var(--cmp-listItem-content-disabled)]",
|
|
@@ -4077,25 +4170,11 @@ function ItemList({
|
|
|
4077
4170
|
onClick: () => onSelect(o.value),
|
|
4078
4171
|
children: [
|
|
4079
4172
|
multi && /* @__PURE__ */ jsx(
|
|
4080
|
-
|
|
4173
|
+
CheckboxBox,
|
|
4081
4174
|
{
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
// 비활성: 회색 채움(#E1E1E1) + 회색 테두리(#CCCCCC)
|
|
4086
|
-
"cursor-not-allowed border-[color:var(--cmp-checkbox-border-disabled)] bg-[var(--cmp-checkbox-bg-disabled)]"
|
|
4087
|
-
) : cn(
|
|
4088
|
-
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)]"
|
|
4089
|
-
)
|
|
4090
|
-
),
|
|
4091
|
-
children: isSelected && /* @__PURE__ */ jsx(
|
|
4092
|
-
SIcon,
|
|
4093
|
-
{
|
|
4094
|
-
name: "checkboxCheck",
|
|
4095
|
-
size: 12,
|
|
4096
|
-
color: o.disabled ? "var(--cmp-checkbox-checked-icon-disabled)" : "var(--cmp-checkbox-checked-icon-default)"
|
|
4097
|
-
}
|
|
4098
|
-
)
|
|
4175
|
+
state: isSelected,
|
|
4176
|
+
disabled: o.disabled,
|
|
4177
|
+
focused: focusedValue === o.value
|
|
4099
4178
|
}
|
|
4100
4179
|
),
|
|
4101
4180
|
isHtmlLabel(o.label) ? /* @__PURE__ */ jsx(
|
|
@@ -4112,6 +4191,33 @@ function ItemList({
|
|
|
4112
4191
|
})
|
|
4113
4192
|
] });
|
|
4114
4193
|
}
|
|
4194
|
+
function CheckboxBox({
|
|
4195
|
+
state,
|
|
4196
|
+
disabled = false,
|
|
4197
|
+
focused = false
|
|
4198
|
+
}) {
|
|
4199
|
+
const filled = state === true || state === null;
|
|
4200
|
+
return /* @__PURE__ */ jsx(
|
|
4201
|
+
"span",
|
|
4202
|
+
{
|
|
4203
|
+
className: cn(
|
|
4204
|
+
"flex h-[16px] w-[16px] flex-shrink-0 items-center justify-center rounded-[2px] border border-solid",
|
|
4205
|
+
disabled ? (
|
|
4206
|
+
// 비활성: 회색 채움(#E1E1E1) + 회색 테두리(#CCCCCC)
|
|
4207
|
+
"cursor-not-allowed border-[color:var(--cmp-checkbox-border-disabled)] bg-[var(--cmp-checkbox-bg-disabled)]"
|
|
4208
|
+
) : 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)]"
|
|
4209
|
+
),
|
|
4210
|
+
children: filled && /* @__PURE__ */ jsx(
|
|
4211
|
+
SIcon,
|
|
4212
|
+
{
|
|
4213
|
+
name: state === null ? "checkboxIndeterminate" : "checkboxCheck",
|
|
4214
|
+
size: 12,
|
|
4215
|
+
color: disabled ? "var(--cmp-checkbox-checked-icon-disabled)" : "var(--cmp-checkbox-checked-icon-default)"
|
|
4216
|
+
}
|
|
4217
|
+
)
|
|
4218
|
+
}
|
|
4219
|
+
);
|
|
4220
|
+
}
|
|
4115
4221
|
|
|
4116
4222
|
export { SSelect };
|
|
4117
4223
|
//# sourceMappingURL=SSelect.js.map
|