sellmate-design-system-react 0.1.8 → 0.1.10
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 +1 -1
- package/dist/components/SActionModal/SActionModal.cjs.map +1 -1
- package/dist/components/SActionModal/SActionModal.js +1 -1
- package/dist/components/SActionModal/SActionModal.js.map +1 -1
- package/dist/components/SBarcodeInput/SBarcodeInput.cjs +217 -208
- package/dist/components/SBarcodeInput/SBarcodeInput.cjs.map +1 -1
- package/dist/components/SBarcodeInput/SBarcodeInput.js +217 -208
- package/dist/components/SBarcodeInput/SBarcodeInput.js.map +1 -1
- package/dist/components/SCalendar/SCalendar.cjs +1 -1
- package/dist/components/SCalendar/SCalendar.cjs.map +1 -1
- package/dist/components/SCalendar/SCalendar.js +1 -1
- package/dist/components/SCalendar/SCalendar.js.map +1 -1
- package/dist/components/SChip/SChip.cjs +1 -1
- package/dist/components/SChip/SChip.cjs.map +1 -1
- package/dist/components/SChip/SChip.d.ts +1 -1
- package/dist/components/SChip/SChip.js +1 -1
- package/dist/components/SChip/SChip.js.map +1 -1
- package/dist/components/SChipInput/SChipInput.cjs +234 -220
- package/dist/components/SChipInput/SChipInput.cjs.map +1 -1
- package/dist/components/SChipInput/SChipInput.js +234 -220
- package/dist/components/SChipInput/SChipInput.js.map +1 -1
- package/dist/components/SCircleProgress/SCircleProgress.cjs +31 -14
- package/dist/components/SCircleProgress/SCircleProgress.cjs.map +1 -1
- package/dist/components/SCircleProgress/SCircleProgress.d.ts +2 -0
- package/dist/components/SCircleProgress/SCircleProgress.js +31 -14
- package/dist/components/SCircleProgress/SCircleProgress.js.map +1 -1
- package/dist/components/SDatePicker/SDatePicker.cjs +222 -213
- package/dist/components/SDatePicker/SDatePicker.cjs.map +1 -1
- package/dist/components/SDatePicker/SDatePicker.js +222 -213
- package/dist/components/SDatePicker/SDatePicker.js.map +1 -1
- package/dist/components/SDateRangePicker/SDateRangePicker.cjs +297 -262
- package/dist/components/SDateRangePicker/SDateRangePicker.cjs.map +1 -1
- package/dist/components/SDateRangePicker/SDateRangePicker.js +297 -262
- package/dist/components/SDateRangePicker/SDateRangePicker.js.map +1 -1
- package/dist/components/SDropdownButton/SDropdownButton.cjs +4 -4
- package/dist/components/SDropdownButton/SDropdownButton.cjs.map +1 -1
- package/dist/components/SDropdownButton/SDropdownButton.js +4 -4
- package/dist/components/SDropdownButton/SDropdownButton.js.map +1 -1
- package/dist/components/SField/SField.cjs +217 -20
- package/dist/components/SField/SField.cjs.map +1 -1
- package/dist/components/SField/SField.d.ts +11 -0
- package/dist/components/SField/SField.js +217 -20
- package/dist/components/SField/SField.js.map +1 -1
- package/dist/components/SFilePicker/SFilePicker.cjs +315 -276
- package/dist/components/SFilePicker/SFilePicker.cjs.map +1 -1
- package/dist/components/SFilePicker/SFilePicker.d.ts +4 -2
- package/dist/components/SFilePicker/SFilePicker.js +314 -276
- package/dist/components/SFilePicker/SFilePicker.js.map +1 -1
- package/dist/components/SInput/SInput.cjs +217 -208
- package/dist/components/SInput/SInput.cjs.map +1 -1
- package/dist/components/SInput/SInput.js +217 -208
- package/dist/components/SInput/SInput.js.map +1 -1
- package/dist/components/SKeyValueTable/SKeyValueTable.cjs +631 -450
- package/dist/components/SKeyValueTable/SKeyValueTable.cjs.map +1 -1
- package/dist/components/SKeyValueTable/SKeyValueTable.d.ts +3 -1
- package/dist/components/SKeyValueTable/SKeyValueTable.js +631 -450
- package/dist/components/SKeyValueTable/SKeyValueTable.js.map +1 -1
- package/dist/components/SLoadingContainer/SLoadingContainer.cjs +39 -14
- package/dist/components/SLoadingContainer/SLoadingContainer.cjs.map +1 -1
- package/dist/components/SLoadingContainer/SLoadingContainer.js +39 -14
- package/dist/components/SLoadingContainer/SLoadingContainer.js.map +1 -1
- package/dist/components/SLoadingContainer/loading.cjs +39 -14
- package/dist/components/SLoadingContainer/loading.cjs.map +1 -1
- package/dist/components/SLoadingContainer/loading.js +39 -14
- package/dist/components/SLoadingContainer/loading.js.map +1 -1
- package/dist/components/SLoadingModal/SLoadingModal.cjs +37 -16
- package/dist/components/SLoadingModal/SLoadingModal.cjs.map +1 -1
- package/dist/components/SLoadingModal/SLoadingModal.d.ts +3 -1
- package/dist/components/SLoadingModal/SLoadingModal.js +37 -16
- package/dist/components/SLoadingModal/SLoadingModal.js.map +1 -1
- package/dist/components/SNumberInput/SNumberInput.cjs +325 -49
- package/dist/components/SNumberInput/SNumberInput.cjs.map +1 -1
- package/dist/components/SNumberInput/SNumberInput.d.ts +2 -0
- package/dist/components/SNumberInput/SNumberInput.js +325 -49
- package/dist/components/SNumberInput/SNumberInput.js.map +1 -1
- package/dist/components/SPagination/SPagination.cjs +1 -1
- package/dist/components/SPagination/SPagination.cjs.map +1 -1
- package/dist/components/SPagination/SPagination.js +1 -1
- package/dist/components/SPagination/SPagination.js.map +1 -1
- package/dist/components/SRadio/SRadioGroup.cjs +1 -1
- package/dist/components/SRadio/SRadioGroup.cjs.map +1 -1
- package/dist/components/SRadio/SRadioGroup.js +1 -1
- package/dist/components/SRadio/SRadioGroup.js.map +1 -1
- package/dist/components/SSelect/SSelect.cjs +71 -32
- package/dist/components/SSelect/SSelect.cjs.map +1 -1
- package/dist/components/SSelect/SSelect.js +71 -32
- package/dist/components/SSelect/SSelect.js.map +1 -1
- package/dist/components/STable/STable.cjs +108 -49
- package/dist/components/STable/STable.cjs.map +1 -1
- package/dist/components/STable/STable.js +108 -49
- package/dist/components/STable/STable.js.map +1 -1
- package/dist/components/STextarea/STextarea.cjs +217 -20
- package/dist/components/STextarea/STextarea.cjs.map +1 -1
- package/dist/components/STextarea/STextarea.js +217 -20
- package/dist/components/STextarea/STextarea.js.map +1 -1
- package/dist/components/SToast/SToastContainer.cjs +3 -3
- package/dist/components/SToast/SToastContainer.cjs.map +1 -1
- package/dist/components/SToast/SToastContainer.js +3 -3
- package/dist/components/SToast/SToastContainer.js.map +1 -1
- package/dist/components/STooltip/STooltip.cjs +208 -13
- package/dist/components/STooltip/STooltip.cjs.map +1 -1
- package/dist/components/STooltip/STooltip.js +208 -13
- package/dist/components/STooltip/STooltip.js.map +1 -1
- package/dist/index.cjs +439 -221
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +439 -221
- package/dist/index.js.map +1 -1
- package/dist/styles.css +113 -48
- package/dist/theme.css +49 -23
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ var react = require('react');
|
|
|
5
5
|
var clsx = require('clsx');
|
|
6
6
|
var tailwindMerge = require('tailwind-merge');
|
|
7
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
-
var
|
|
8
|
+
var RPopover2 = require('@radix-ui/react-popover');
|
|
9
9
|
var RTooltip = require('@radix-ui/react-tooltip');
|
|
10
10
|
|
|
11
11
|
function _interopNamespace(e) {
|
|
@@ -26,7 +26,7 @@ function _interopNamespace(e) {
|
|
|
26
26
|
return Object.freeze(n);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
var
|
|
29
|
+
var RPopover2__namespace = /*#__PURE__*/_interopNamespace(RPopover2);
|
|
30
30
|
var RTooltip__namespace = /*#__PURE__*/_interopNamespace(RTooltip);
|
|
31
31
|
|
|
32
32
|
var twMerge = tailwindMerge.extendTailwindMerge({
|
|
@@ -2899,11 +2899,200 @@ PortalContainerContext.Provider;
|
|
|
2899
2899
|
function usePortalContainer() {
|
|
2900
2900
|
return react.useContext(PortalContainerContext) ?? void 0;
|
|
2901
2901
|
}
|
|
2902
|
+
|
|
2903
|
+
// src/components/STag/tag.config.ts
|
|
2904
|
+
var TAG_SIZE_CONFIG = {
|
|
2905
|
+
xs: {
|
|
2906
|
+
height: 20,
|
|
2907
|
+
paddingX: 8,
|
|
2908
|
+
gap: 4,
|
|
2909
|
+
radius: 6,
|
|
2910
|
+
iconSize: 12,
|
|
2911
|
+
fontSize: 11,
|
|
2912
|
+
fontWeight: 500,
|
|
2913
|
+
lineHeight: 18
|
|
2914
|
+
},
|
|
2915
|
+
sm: {
|
|
2916
|
+
height: 24,
|
|
2917
|
+
paddingX: 8,
|
|
2918
|
+
gap: 4,
|
|
2919
|
+
radius: 6,
|
|
2920
|
+
iconSize: 16,
|
|
2921
|
+
fontSize: 12,
|
|
2922
|
+
fontWeight: 700,
|
|
2923
|
+
lineHeight: 20
|
|
2924
|
+
},
|
|
2925
|
+
md: {
|
|
2926
|
+
height: 28,
|
|
2927
|
+
paddingX: 12,
|
|
2928
|
+
gap: 6,
|
|
2929
|
+
radius: 8,
|
|
2930
|
+
iconSize: 16,
|
|
2931
|
+
fontSize: 14,
|
|
2932
|
+
fontWeight: 700,
|
|
2933
|
+
lineHeight: 24
|
|
2934
|
+
}
|
|
2935
|
+
};
|
|
2936
|
+
var STag = react.forwardRef(function STag2({
|
|
2937
|
+
shape = "square",
|
|
2938
|
+
size = "sm",
|
|
2939
|
+
color = "grey",
|
|
2940
|
+
label = "",
|
|
2941
|
+
icon,
|
|
2942
|
+
iconLeft = true,
|
|
2943
|
+
width,
|
|
2944
|
+
className,
|
|
2945
|
+
style,
|
|
2946
|
+
...rest
|
|
2947
|
+
}, ref) {
|
|
2948
|
+
const s = TAG_SIZE_CONFIG[size];
|
|
2949
|
+
const contentColor = `var(--cmp-tag-${color}-content)`;
|
|
2950
|
+
const iconNode = icon ? /* @__PURE__ */ jsxRuntime.jsx(SIcon, { name: icon, size: s.iconSize, color: contentColor }) : null;
|
|
2951
|
+
const resolvedWidth = typeof width === "number" ? `${width}px` : width;
|
|
2952
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2953
|
+
"span",
|
|
2954
|
+
{
|
|
2955
|
+
ref,
|
|
2956
|
+
"aria-label": label || "tag",
|
|
2957
|
+
className: cn(
|
|
2958
|
+
"box-border inline-flex w-fit select-none items-center justify-center whitespace-nowrap",
|
|
2959
|
+
className
|
|
2960
|
+
),
|
|
2961
|
+
style: {
|
|
2962
|
+
minHeight: s.height,
|
|
2963
|
+
padding: `0 ${s.paddingX}px`,
|
|
2964
|
+
gap: s.gap,
|
|
2965
|
+
borderRadius: shape === "pill" ? 999 : s.radius,
|
|
2966
|
+
fontSize: s.fontSize,
|
|
2967
|
+
fontWeight: s.fontWeight,
|
|
2968
|
+
lineHeight: `${s.lineHeight}px`,
|
|
2969
|
+
background: `var(--cmp-tag-${color}-bg)`,
|
|
2970
|
+
color: contentColor,
|
|
2971
|
+
...resolvedWidth != null ? { width: resolvedWidth } : {},
|
|
2972
|
+
...style
|
|
2973
|
+
},
|
|
2974
|
+
...rest,
|
|
2975
|
+
children: [
|
|
2976
|
+
icon && iconLeft && iconNode,
|
|
2977
|
+
label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex min-w-0 items-center justify-center", children: label }),
|
|
2978
|
+
icon && !iconLeft && iconNode
|
|
2979
|
+
]
|
|
2980
|
+
}
|
|
2981
|
+
);
|
|
2982
|
+
});
|
|
2983
|
+
var SIZE = {
|
|
2984
|
+
xxs: { icon: 12, radius: "sm" },
|
|
2985
|
+
xs: { icon: 16, radius: "sm" },
|
|
2986
|
+
sm: { icon: 20, radius: "sm" },
|
|
2987
|
+
md: { icon: 24, radius: "md" },
|
|
2988
|
+
lg: { icon: 32, radius: "md" }
|
|
2989
|
+
};
|
|
2990
|
+
var TOOLTIP_HIDE_DELAY_MS = 100;
|
|
2991
|
+
function SGhostButton({
|
|
2992
|
+
icon,
|
|
2993
|
+
size = "sm",
|
|
2994
|
+
intent = "default",
|
|
2995
|
+
ariaLabel = "",
|
|
2996
|
+
tooltipText,
|
|
2997
|
+
disabled = false,
|
|
2998
|
+
onClick,
|
|
2999
|
+
className,
|
|
3000
|
+
style
|
|
3001
|
+
}) {
|
|
3002
|
+
const portalContainer = usePortalContainer();
|
|
3003
|
+
const [open, setOpen] = react.useState(false);
|
|
3004
|
+
const hideTimer = react.useRef(void 0);
|
|
3005
|
+
const cancelHide = () => {
|
|
3006
|
+
if (hideTimer.current) {
|
|
3007
|
+
clearTimeout(hideTimer.current);
|
|
3008
|
+
hideTimer.current = void 0;
|
|
3009
|
+
}
|
|
3010
|
+
};
|
|
3011
|
+
const openNow = () => {
|
|
3012
|
+
cancelHide();
|
|
3013
|
+
setOpen(true);
|
|
3014
|
+
};
|
|
3015
|
+
const startHide = () => {
|
|
3016
|
+
cancelHide();
|
|
3017
|
+
hideTimer.current = setTimeout(() => setOpen(false), TOOLTIP_HIDE_DELAY_MS);
|
|
3018
|
+
};
|
|
3019
|
+
const s = SIZE[size];
|
|
3020
|
+
const contentColor = disabled ? intent === "inverse" ? "var(--cmp-ghostButton-inverse-disabled)" : "var(--cmp-ghostButton-icon-disabled)" : `var(--cmp-ghostButton-${intent}-content)`;
|
|
3021
|
+
const btn = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3022
|
+
"button",
|
|
3023
|
+
{
|
|
3024
|
+
type: "button",
|
|
3025
|
+
disabled,
|
|
3026
|
+
"aria-disabled": disabled ? "true" : void 0,
|
|
3027
|
+
"aria-label": ariaLabel.trim() || void 0,
|
|
3028
|
+
tabIndex: disabled ? -1 : void 0,
|
|
3029
|
+
onClick: (e) => {
|
|
3030
|
+
if (disabled) {
|
|
3031
|
+
e.preventDefault();
|
|
3032
|
+
return;
|
|
3033
|
+
}
|
|
3034
|
+
onClick?.(e);
|
|
3035
|
+
},
|
|
3036
|
+
className: cn(
|
|
3037
|
+
"group relative box-border inline-flex items-center justify-center border-none bg-transparent p-0 transition-shadow",
|
|
3038
|
+
disabled ? "cursor-not-allowed" : "cursor-pointer",
|
|
3039
|
+
"focus-visible:outline-none focus-visible:shadow-[0_0_0_2px_var(--cmp-ghostButton-action-hover-bg)]",
|
|
3040
|
+
className
|
|
3041
|
+
),
|
|
3042
|
+
style: {
|
|
3043
|
+
width: `var(--cmp-ghostButton-${size}-size)`,
|
|
3044
|
+
height: `var(--cmp-ghostButton-${size}-size)`,
|
|
3045
|
+
borderRadius: `var(--cmp-ghostButton-radius-${s.radius})`,
|
|
3046
|
+
...style
|
|
3047
|
+
},
|
|
3048
|
+
children: [
|
|
3049
|
+
!disabled && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3050
|
+
"span",
|
|
3051
|
+
{
|
|
3052
|
+
"aria-hidden": true,
|
|
3053
|
+
className: "pointer-events-none absolute inset-0 rounded-[inherit] opacity-0 transition-opacity duration-200 group-hover:opacity-5",
|
|
3054
|
+
style: { background: `var(--cmp-ghostButton-${intent}-hover-bg)` }
|
|
3055
|
+
}
|
|
3056
|
+
),
|
|
3057
|
+
/* @__PURE__ */ jsxRuntime.jsx(SIcon, { name: icon, size: s.icon, color: contentColor })
|
|
3058
|
+
]
|
|
3059
|
+
}
|
|
3060
|
+
);
|
|
3061
|
+
const text = (tooltipText ?? "").trim();
|
|
3062
|
+
if (text === "") return btn;
|
|
3063
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(RPopover2__namespace.Root, { open, onOpenChange: setOpen, children: [
|
|
3064
|
+
/* @__PURE__ */ jsxRuntime.jsx(RPopover2__namespace.Anchor, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3065
|
+
"span",
|
|
3066
|
+
{
|
|
3067
|
+
className: "inline-flex",
|
|
3068
|
+
onMouseEnter: openNow,
|
|
3069
|
+
onMouseLeave: startHide,
|
|
3070
|
+
onFocus: openNow,
|
|
3071
|
+
onBlur: startHide,
|
|
3072
|
+
children: btn
|
|
3073
|
+
}
|
|
3074
|
+
) }),
|
|
3075
|
+
/* @__PURE__ */ jsxRuntime.jsx(RPopover2__namespace.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3076
|
+
RPopover2__namespace.Content,
|
|
3077
|
+
{
|
|
3078
|
+
side: "top",
|
|
3079
|
+
sideOffset: 4,
|
|
3080
|
+
className: cn("z-50", FLOATING_SLIDE_ANIM),
|
|
3081
|
+
"aria-hidden": true,
|
|
3082
|
+
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
3083
|
+
onMouseEnter: cancelHide,
|
|
3084
|
+
onMouseLeave: startHide,
|
|
3085
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(STag, { shape: "square", size: "xs", color: "grey", label: text })
|
|
3086
|
+
}
|
|
3087
|
+
) })
|
|
3088
|
+
] });
|
|
3089
|
+
}
|
|
2902
3090
|
var HIDE_DELAY_MS = 100;
|
|
2903
3091
|
function useBody(content, message = []) {
|
|
2904
3092
|
if (content != null) return content;
|
|
2905
3093
|
if (message.length === 0) return null;
|
|
2906
|
-
|
|
3094
|
+
const singleLine = message.length === 1;
|
|
3095
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: message.map((line, i) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: singleLine ? "leading-[24px]" : void 0, children: line }, i)) });
|
|
2907
3096
|
}
|
|
2908
3097
|
var STooltip = react.forwardRef(function STooltip2({
|
|
2909
3098
|
content,
|
|
@@ -2971,10 +3160,10 @@ var STooltip = react.forwardRef(function STooltip2({
|
|
|
2971
3160
|
fontWeight: tooltipType === "default" ? 500 : 700,
|
|
2972
3161
|
...style
|
|
2973
3162
|
};
|
|
2974
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3163
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(RPopover2__namespace.Root, { open, onOpenChange: setOpen, children: [
|
|
2975
3164
|
isHover ? (
|
|
2976
3165
|
// hover: Anchor(위치 기준) + 직접 mouse 핸들러 — 클릭으로 토글되지 않도록 Trigger 미사용
|
|
2977
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3166
|
+
/* @__PURE__ */ jsxRuntime.jsx(RPopover2__namespace.Anchor, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2978
3167
|
"span",
|
|
2979
3168
|
{
|
|
2980
3169
|
className: "inline-flex",
|
|
@@ -2985,9 +3174,9 @@ var STooltip = react.forwardRef(function STooltip2({
|
|
|
2985
3174
|
children: triggerNode
|
|
2986
3175
|
}
|
|
2987
3176
|
) })
|
|
2988
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2989
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2990
|
-
|
|
3177
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(RPopover2__namespace.Trigger, { asChild: true, children: triggerNode }),
|
|
3178
|
+
/* @__PURE__ */ jsxRuntime.jsx(RPopover2__namespace.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3179
|
+
RPopover2__namespace.Content,
|
|
2991
3180
|
{
|
|
2992
3181
|
side: placement,
|
|
2993
3182
|
sideOffset: 8,
|
|
@@ -3006,15 +3195,21 @@ var STooltip = react.forwardRef(function STooltip2({
|
|
|
3006
3195
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-[12px]", children: [
|
|
3007
3196
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0 flex-1", children: body }),
|
|
3008
3197
|
useClose && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3009
|
-
|
|
3198
|
+
SGhostButton,
|
|
3010
3199
|
{
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3200
|
+
icon: "close",
|
|
3201
|
+
size: "xs",
|
|
3202
|
+
intent: tooltipType === "default" ? "inverse" : "default",
|
|
3203
|
+
ariaLabel: "\uB2EB\uAE30",
|
|
3204
|
+
className: "shrink-0",
|
|
3205
|
+
onClick: () => {
|
|
3206
|
+
cancelHide();
|
|
3207
|
+
setOpen(false);
|
|
3208
|
+
}
|
|
3014
3209
|
}
|
|
3015
3210
|
)
|
|
3016
3211
|
] }),
|
|
3017
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3212
|
+
/* @__PURE__ */ jsxRuntime.jsx(RPopover2__namespace.Arrow, { width: 16, height: 12, style: { fill: bg } })
|
|
3018
3213
|
]
|
|
3019
3214
|
}
|
|
3020
3215
|
) })
|
|
@@ -3048,8 +3243,8 @@ function useFormField(field) {
|
|
|
3048
3243
|
}, [ctx, name]);
|
|
3049
3244
|
}
|
|
3050
3245
|
var FIELD_SIZE = {
|
|
3051
|
-
sm: { height: 28, radius: 4, fieldGap: 12, labelGap: 6, fontSize: 12, lineHeight: 20, icon:
|
|
3052
|
-
md: { height: 36, radius: 6, fieldGap: 16, labelGap: 8, fontSize: 14, lineHeight: 24, icon:
|
|
3246
|
+
sm: { height: 28, radius: 4, fieldGap: 12, labelGap: 6, fontSize: 12, lineHeight: 20, icon: 16 },
|
|
3247
|
+
md: { height: 36, radius: 6, fieldGap: 16, labelGap: 8, fontSize: 14, lineHeight: 24, icon: 16 }
|
|
3053
3248
|
};
|
|
3054
3249
|
var ALIGN = {
|
|
3055
3250
|
start: "flex-start",
|
|
@@ -3064,6 +3259,7 @@ var SField = react.forwardRef(function SField2({
|
|
|
3064
3259
|
labelTooltip = "",
|
|
3065
3260
|
labelTooltipProps,
|
|
3066
3261
|
labelWidth,
|
|
3262
|
+
labelHeight,
|
|
3067
3263
|
size = "sm",
|
|
3068
3264
|
addonLabel = "",
|
|
3069
3265
|
addonAlign = "start",
|
|
@@ -3078,6 +3274,7 @@ var SField = react.forwardRef(function SField2({
|
|
|
3078
3274
|
readOnly = false,
|
|
3079
3275
|
width,
|
|
3080
3276
|
multiline = false,
|
|
3277
|
+
borderless = false,
|
|
3081
3278
|
children,
|
|
3082
3279
|
className,
|
|
3083
3280
|
style,
|
|
@@ -3111,8 +3308,8 @@ var SField = react.forwardRef(function SField2({
|
|
|
3111
3308
|
const resolvedSuccess = status === "pass";
|
|
3112
3309
|
const showError = resolvedError && errorMessage !== "";
|
|
3113
3310
|
const interactive = !disabled && !readOnly;
|
|
3114
|
-
const borderColor = disabled ? "var(--color-grey-45)" : interactive && focused ? "var(--sys-color-field-border-focus)" : resolvedSuccess ? "var(--sys-color-field-border-success)" : resolvedError ? "var(--sys-color-field-border-danger)" : "var(--sys-color-field-border-default)";
|
|
3115
|
-
const bgColor = disabled ? "var(--color-grey-30)" : readOnly ? "var(--sys-color-field-bg-readOnly)" : "var(--sys-color-field-bg-default)";
|
|
3311
|
+
const borderColor = borderless ? "transparent" : disabled ? "var(--color-grey-45)" : interactive && focused ? "var(--sys-color-field-border-focus)" : resolvedSuccess ? "var(--sys-color-field-border-success)" : resolvedError ? "var(--sys-color-field-border-danger)" : "var(--sys-color-field-border-default)";
|
|
3312
|
+
const bgColor = borderless ? "transparent" : disabled ? "var(--color-grey-30)" : readOnly ? "var(--sys-color-field-bg-readOnly)" : "var(--sys-color-field-bg-default)";
|
|
3116
3313
|
const textColor = disabled ? "var(--color-grey-65)" : readOnly ? "var(--sys-color-field-text-readOnly)" : "var(--sys-color-field-text-default)";
|
|
3117
3314
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3118
3315
|
"div",
|
|
@@ -3129,7 +3326,7 @@ var SField = react.forwardRef(function SField2({
|
|
|
3129
3326
|
{
|
|
3130
3327
|
className: "flex shrink-0 items-center font-bold text-(--sys-color-field-text-default)",
|
|
3131
3328
|
style: {
|
|
3132
|
-
height: s.height,
|
|
3329
|
+
height: cssLen(labelHeight) ?? s.height,
|
|
3133
3330
|
marginRight: s.fieldGap,
|
|
3134
3331
|
width: cssLen(labelWidth),
|
|
3135
3332
|
fontSize: s.fontSize,
|
|
@@ -3155,14 +3352,14 @@ var SField = react.forwardRef(function SField2({
|
|
|
3155
3352
|
{
|
|
3156
3353
|
className: cn(
|
|
3157
3354
|
"relative box-border flex min-w-0 items-stretch overflow-hidden border border-solid border-(--field-bc)",
|
|
3158
|
-
interactive && "hover:border-(--sys-color-field-border-focus) hover:shadow-[0px_0px_4px_0px_#0071ff66] focus-within:border-(--sys-color-field-border-focus) focus-within:shadow-[0px_0px_4px_0px_#0071ff66]",
|
|
3355
|
+
interactive && !borderless && "hover:border-(--sys-color-field-border-focus) hover:shadow-[0px_0px_4px_0px_#0071ff66] focus-within:border-(--sys-color-field-border-focus) focus-within:shadow-[0px_0px_4px_0px_#0071ff66]",
|
|
3159
3356
|
disabled && "cursor-not-allowed"
|
|
3160
3357
|
),
|
|
3161
3358
|
style: {
|
|
3162
3359
|
// @ts-expect-error CSS 변수
|
|
3163
3360
|
"--field-bc": borderColor,
|
|
3164
3361
|
// focused/hovered prop이 명시된 경우 강조를 즉시 반영
|
|
3165
|
-
...interactive && focused ? { boxShadow: "0px 0px 4px 0px #0071ff66" } : {},
|
|
3362
|
+
...interactive && !borderless && focused ? { boxShadow: "0px 0px 4px 0px #0071ff66" } : {},
|
|
3166
3363
|
...multiline ? { minHeight: s.height } : { height: s.height },
|
|
3167
3364
|
"width": cssLen(width),
|
|
3168
3365
|
"borderRadius": s.radius,
|
|
@@ -3201,200 +3398,12 @@ var SField = react.forwardRef(function SField2({
|
|
|
3201
3398
|
}
|
|
3202
3399
|
);
|
|
3203
3400
|
});
|
|
3204
|
-
|
|
3205
|
-
// src/components/STag/tag.config.ts
|
|
3206
|
-
var TAG_SIZE_CONFIG = {
|
|
3207
|
-
xs: {
|
|
3208
|
-
height: 20,
|
|
3209
|
-
paddingX: 8,
|
|
3210
|
-
gap: 4,
|
|
3211
|
-
radius: 6,
|
|
3212
|
-
iconSize: 12,
|
|
3213
|
-
fontSize: 11,
|
|
3214
|
-
fontWeight: 500,
|
|
3215
|
-
lineHeight: 18
|
|
3216
|
-
},
|
|
3217
|
-
sm: {
|
|
3218
|
-
height: 24,
|
|
3219
|
-
paddingX: 8,
|
|
3220
|
-
gap: 4,
|
|
3221
|
-
radius: 6,
|
|
3222
|
-
iconSize: 16,
|
|
3223
|
-
fontSize: 12,
|
|
3224
|
-
fontWeight: 700,
|
|
3225
|
-
lineHeight: 20
|
|
3226
|
-
},
|
|
3227
|
-
md: {
|
|
3228
|
-
height: 28,
|
|
3229
|
-
paddingX: 12,
|
|
3230
|
-
gap: 6,
|
|
3231
|
-
radius: 8,
|
|
3232
|
-
iconSize: 16,
|
|
3233
|
-
fontSize: 14,
|
|
3234
|
-
fontWeight: 700,
|
|
3235
|
-
lineHeight: 24
|
|
3236
|
-
}
|
|
3237
|
-
};
|
|
3238
|
-
var STag = react.forwardRef(function STag2({
|
|
3239
|
-
shape = "square",
|
|
3240
|
-
size = "sm",
|
|
3241
|
-
color = "grey",
|
|
3242
|
-
label = "",
|
|
3243
|
-
icon,
|
|
3244
|
-
iconLeft = true,
|
|
3245
|
-
width,
|
|
3246
|
-
className,
|
|
3247
|
-
style,
|
|
3248
|
-
...rest
|
|
3249
|
-
}, ref) {
|
|
3250
|
-
const s = TAG_SIZE_CONFIG[size];
|
|
3251
|
-
const contentColor = `var(--cmp-tag-${color}-content)`;
|
|
3252
|
-
const iconNode = icon ? /* @__PURE__ */ jsxRuntime.jsx(SIcon, { name: icon, size: s.iconSize, color: contentColor }) : null;
|
|
3253
|
-
const resolvedWidth = typeof width === "number" ? `${width}px` : width;
|
|
3254
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3255
|
-
"span",
|
|
3256
|
-
{
|
|
3257
|
-
ref,
|
|
3258
|
-
"aria-label": label || "tag",
|
|
3259
|
-
className: cn(
|
|
3260
|
-
"box-border inline-flex w-fit select-none items-center justify-center whitespace-nowrap",
|
|
3261
|
-
className
|
|
3262
|
-
),
|
|
3263
|
-
style: {
|
|
3264
|
-
minHeight: s.height,
|
|
3265
|
-
padding: `0 ${s.paddingX}px`,
|
|
3266
|
-
gap: s.gap,
|
|
3267
|
-
borderRadius: shape === "pill" ? 999 : s.radius,
|
|
3268
|
-
fontSize: s.fontSize,
|
|
3269
|
-
fontWeight: s.fontWeight,
|
|
3270
|
-
lineHeight: `${s.lineHeight}px`,
|
|
3271
|
-
background: `var(--cmp-tag-${color}-bg)`,
|
|
3272
|
-
color: contentColor,
|
|
3273
|
-
...resolvedWidth != null ? { width: resolvedWidth } : {},
|
|
3274
|
-
...style
|
|
3275
|
-
},
|
|
3276
|
-
...rest,
|
|
3277
|
-
children: [
|
|
3278
|
-
icon && iconLeft && iconNode,
|
|
3279
|
-
label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex min-w-0 items-center justify-center", children: label }),
|
|
3280
|
-
icon && !iconLeft && iconNode
|
|
3281
|
-
]
|
|
3282
|
-
}
|
|
3283
|
-
);
|
|
3284
|
-
});
|
|
3285
|
-
var SIZE = {
|
|
3286
|
-
xxs: { icon: 12, radius: "sm" },
|
|
3287
|
-
xs: { icon: 16, radius: "sm" },
|
|
3288
|
-
sm: { icon: 20, radius: "sm" },
|
|
3289
|
-
md: { icon: 24, radius: "md" },
|
|
3290
|
-
lg: { icon: 32, radius: "md" }
|
|
3291
|
-
};
|
|
3292
|
-
var TOOLTIP_HIDE_DELAY_MS = 100;
|
|
3293
|
-
function SGhostButton({
|
|
3294
|
-
icon,
|
|
3295
|
-
size = "sm",
|
|
3296
|
-
intent = "default",
|
|
3297
|
-
ariaLabel = "",
|
|
3298
|
-
tooltipText,
|
|
3299
|
-
disabled = false,
|
|
3300
|
-
onClick,
|
|
3301
|
-
className,
|
|
3302
|
-
style
|
|
3303
|
-
}) {
|
|
3304
|
-
const portalContainer = usePortalContainer();
|
|
3305
|
-
const [open, setOpen] = react.useState(false);
|
|
3306
|
-
const hideTimer = react.useRef(void 0);
|
|
3307
|
-
const cancelHide = () => {
|
|
3308
|
-
if (hideTimer.current) {
|
|
3309
|
-
clearTimeout(hideTimer.current);
|
|
3310
|
-
hideTimer.current = void 0;
|
|
3311
|
-
}
|
|
3312
|
-
};
|
|
3313
|
-
const openNow = () => {
|
|
3314
|
-
cancelHide();
|
|
3315
|
-
setOpen(true);
|
|
3316
|
-
};
|
|
3317
|
-
const startHide = () => {
|
|
3318
|
-
cancelHide();
|
|
3319
|
-
hideTimer.current = setTimeout(() => setOpen(false), TOOLTIP_HIDE_DELAY_MS);
|
|
3320
|
-
};
|
|
3321
|
-
const s = SIZE[size];
|
|
3322
|
-
const contentColor = disabled ? intent === "inverse" ? "var(--cmp-ghostButton-inverse-disabled)" : "var(--cmp-ghostButton-icon-disabled)" : `var(--cmp-ghostButton-${intent}-content)`;
|
|
3323
|
-
const btn = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3324
|
-
"button",
|
|
3325
|
-
{
|
|
3326
|
-
type: "button",
|
|
3327
|
-
disabled,
|
|
3328
|
-
"aria-disabled": disabled ? "true" : void 0,
|
|
3329
|
-
"aria-label": ariaLabel.trim() || void 0,
|
|
3330
|
-
tabIndex: disabled ? -1 : void 0,
|
|
3331
|
-
onClick: (e) => {
|
|
3332
|
-
if (disabled) {
|
|
3333
|
-
e.preventDefault();
|
|
3334
|
-
return;
|
|
3335
|
-
}
|
|
3336
|
-
onClick?.(e);
|
|
3337
|
-
},
|
|
3338
|
-
className: cn(
|
|
3339
|
-
"group relative box-border inline-flex items-center justify-center border-none bg-transparent p-0 transition-shadow",
|
|
3340
|
-
disabled ? "cursor-not-allowed" : "cursor-pointer",
|
|
3341
|
-
"focus-visible:outline-none focus-visible:shadow-[0_0_0_2px_var(--cmp-ghostButton-action-hover-bg)]",
|
|
3342
|
-
className
|
|
3343
|
-
),
|
|
3344
|
-
style: {
|
|
3345
|
-
width: `var(--cmp-ghostButton-${size}-size)`,
|
|
3346
|
-
height: `var(--cmp-ghostButton-${size}-size)`,
|
|
3347
|
-
borderRadius: `var(--cmp-ghostButton-radius-${s.radius})`,
|
|
3348
|
-
...style
|
|
3349
|
-
},
|
|
3350
|
-
children: [
|
|
3351
|
-
!disabled && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3352
|
-
"span",
|
|
3353
|
-
{
|
|
3354
|
-
"aria-hidden": true,
|
|
3355
|
-
className: "pointer-events-none absolute inset-0 rounded-[inherit] opacity-0 transition-opacity duration-200 group-hover:opacity-5",
|
|
3356
|
-
style: { background: `var(--cmp-ghostButton-${intent}-hover-bg)` }
|
|
3357
|
-
}
|
|
3358
|
-
),
|
|
3359
|
-
/* @__PURE__ */ jsxRuntime.jsx(SIcon, { name: icon, size: s.icon, color: contentColor })
|
|
3360
|
-
]
|
|
3361
|
-
}
|
|
3362
|
-
);
|
|
3363
|
-
const text = (tooltipText ?? "").trim();
|
|
3364
|
-
if (text === "") return btn;
|
|
3365
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(RPopover__namespace.Root, { open, onOpenChange: setOpen, children: [
|
|
3366
|
-
/* @__PURE__ */ jsxRuntime.jsx(RPopover__namespace.Anchor, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3367
|
-
"span",
|
|
3368
|
-
{
|
|
3369
|
-
className: "inline-flex",
|
|
3370
|
-
onMouseEnter: openNow,
|
|
3371
|
-
onMouseLeave: startHide,
|
|
3372
|
-
onFocus: openNow,
|
|
3373
|
-
onBlur: startHide,
|
|
3374
|
-
children: btn
|
|
3375
|
-
}
|
|
3376
|
-
) }),
|
|
3377
|
-
/* @__PURE__ */ jsxRuntime.jsx(RPopover__namespace.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3378
|
-
RPopover__namespace.Content,
|
|
3379
|
-
{
|
|
3380
|
-
side: "top",
|
|
3381
|
-
sideOffset: 4,
|
|
3382
|
-
className: cn("z-50", FLOATING_SLIDE_ANIM),
|
|
3383
|
-
"aria-hidden": true,
|
|
3384
|
-
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
3385
|
-
onMouseEnter: cancelHide,
|
|
3386
|
-
onMouseLeave: startHide,
|
|
3387
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(STag, { shape: "square", size: "xs", color: "grey", label: text })
|
|
3388
|
-
}
|
|
3389
|
-
) })
|
|
3390
|
-
] });
|
|
3391
|
-
}
|
|
3392
3401
|
var SChip = react.forwardRef(function SChip2({
|
|
3393
3402
|
name,
|
|
3394
3403
|
value = "",
|
|
3395
3404
|
error: errorProp = false,
|
|
3396
3405
|
disabled = false,
|
|
3397
|
-
editable =
|
|
3406
|
+
editable = false,
|
|
3398
3407
|
showRemove = true,
|
|
3399
3408
|
placeholder = "",
|
|
3400
3409
|
rules,
|
|
@@ -3652,7 +3661,7 @@ function SPortal({
|
|
|
3652
3661
|
}) {
|
|
3653
3662
|
const portalContainer = usePortalContainer();
|
|
3654
3663
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3655
|
-
|
|
3664
|
+
RPopover2__namespace.Root,
|
|
3656
3665
|
{
|
|
3657
3666
|
open,
|
|
3658
3667
|
onOpenChange: (next) => {
|
|
@@ -3660,9 +3669,9 @@ function SPortal({
|
|
|
3660
3669
|
if (!next) onClose?.();
|
|
3661
3670
|
},
|
|
3662
3671
|
children: [
|
|
3663
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3664
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3665
|
-
|
|
3672
|
+
/* @__PURE__ */ jsxRuntime.jsx(RPopover2__namespace.Anchor, { virtualRef: anchorRef }),
|
|
3673
|
+
/* @__PURE__ */ jsxRuntime.jsx(RPopover2__namespace.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3674
|
+
RPopover2__namespace.Content,
|
|
3666
3675
|
{
|
|
3667
3676
|
side: placement,
|
|
3668
3677
|
align,
|
|
@@ -3710,7 +3719,7 @@ var SChipInput = react.forwardRef(function SChipInput2({
|
|
|
3710
3719
|
disabledChips = [],
|
|
3711
3720
|
size = "sm",
|
|
3712
3721
|
disabled = false,
|
|
3713
|
-
placeholder = "\uC785\uB825\
|
|
3722
|
+
placeholder = "\uD0DC\uADF8 \uC785\uB825 (Enter\uB85C \uB4F1\uB85D / \uCF64\uB9C8\uB85C \uAD6C\uBD84 / \uB744\uC5B4\uC4F0\uAE30 \uBD88\uAC00)",
|
|
3714
3723
|
name,
|
|
3715
3724
|
rules,
|
|
3716
3725
|
error,
|
|
@@ -3861,6 +3870,7 @@ var SChipInput = react.forwardRef(function SChipInput2({
|
|
|
3861
3870
|
{
|
|
3862
3871
|
label,
|
|
3863
3872
|
labelWidth,
|
|
3873
|
+
labelHeight: `calc(var(--cmp-chipInput-${size}-minHeight) + 2px)`,
|
|
3864
3874
|
icon,
|
|
3865
3875
|
labelTooltip,
|
|
3866
3876
|
labelTooltipProps,
|
|
@@ -3931,9 +3941,11 @@ var SChipInput = react.forwardRef(function SChipInput2({
|
|
|
3931
3941
|
paddingInline: isFieldFilled ? "var(--cmp-chip-paddingX)" : void 0,
|
|
3932
3942
|
borderWidth: isFieldFilled ? "var(--cmp-chip-border-width)" : void 0,
|
|
3933
3943
|
borderStyle: isFieldFilled ? "solid" : void 0,
|
|
3934
|
-
|
|
3944
|
+
// 작성중 필드는 SChip의 editable 수정중(editing) 스타일과 동일하게 —
|
|
3945
|
+
// bg/보더/글자색 모두 focus 토큰을 사용한다.
|
|
3946
|
+
borderColor: isFieldFilled ? "var(--cmp-chip-border-focus)" : void 0,
|
|
3935
3947
|
borderRadius: isFieldFilled ? "var(--cmp-chip-radius)" : 0,
|
|
3936
|
-
background: isFieldFilled ? "var(--cmp-chip-bg-
|
|
3948
|
+
background: isFieldFilled ? "var(--cmp-chip-bg-focus)" : "transparent",
|
|
3937
3949
|
overflow: "hidden"
|
|
3938
3950
|
},
|
|
3939
3951
|
children: [
|
|
@@ -3942,7 +3954,7 @@ var SChipInput = react.forwardRef(function SChipInput2({
|
|
|
3942
3954
|
{
|
|
3943
3955
|
"aria-hidden": true,
|
|
3944
3956
|
className: cn(
|
|
3945
|
-
"invisible col-start-1 row-start-1 whitespace-pre font-
|
|
3957
|
+
"invisible col-start-1 row-start-1 whitespace-pre font-normal",
|
|
3946
3958
|
size === "md" ? "text-14 leading-24" : "text-12 leading-20"
|
|
3947
3959
|
),
|
|
3948
3960
|
children: inputValue !== "" ? inputValue : values.length === 0 ? placeholder : ""
|
|
@@ -3955,12 +3967,14 @@ var SChipInput = react.forwardRef(function SChipInput2({
|
|
|
3955
3967
|
name: resolvedName,
|
|
3956
3968
|
size: 1,
|
|
3957
3969
|
className: cn(
|
|
3958
|
-
"s-chip-input__input col-start-1 row-start-1 w-full border-0 bg-transparent p-0 font-
|
|
3970
|
+
"s-chip-input__input col-start-1 row-start-1 w-full border-0 bg-transparent p-0 font-normal text-(--cmp-chip-content-focus) outline-none placeholder:text-(--cmp-chipInput-text-placeholder) disabled:cursor-not-allowed",
|
|
3959
3971
|
size === "md" ? "text-14 leading-24" : "text-12 leading-20"
|
|
3960
3972
|
),
|
|
3961
3973
|
style: {
|
|
3962
3974
|
minWidth: "1ch",
|
|
3963
|
-
height
|
|
3975
|
+
// height는 지정하지 않고 line-height(20/24px)에 맞춰 자동 크기로 둔다.
|
|
3976
|
+
// var(--cmp-chip-height)(24px)로 고정하면 네이티브 <input>이 남는 세로 여백에
|
|
3977
|
+
// 텍스트를 아래로 밀어 넣어, 확정된 chip 텍스트보다 2px 낮게 보인다.
|
|
3964
3978
|
margin: 0,
|
|
3965
3979
|
overflow: "hidden",
|
|
3966
3980
|
textOverflow: "ellipsis"
|
|
@@ -4005,7 +4019,7 @@ var SChipInput = react.forwardRef(function SChipInput2({
|
|
|
4005
4019
|
showMetaInfo && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4006
4020
|
"div",
|
|
4007
4021
|
{
|
|
4008
|
-
className: "s-chip-input__meta flex items-center gap-8",
|
|
4022
|
+
className: "s-chip-input__meta ml-auto flex items-center gap-8",
|
|
4009
4023
|
onMouseDown: (e) => e.preventDefault(),
|
|
4010
4024
|
children: [
|
|
4011
4025
|
/* @__PURE__ */ jsxRuntime.jsx(
|