sellmate-design-system-react 0.1.7 → 0.1.9
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 +11 -3
- package/dist/components/SActionModal/SActionModal.cjs.map +1 -1
- package/dist/components/SActionModal/SActionModal.js +11 -3
- package/dist/components/SActionModal/SActionModal.js.map +1 -1
- package/dist/components/SBarcodeInput/SBarcodeInput.cjs +226 -209
- package/dist/components/SBarcodeInput/SBarcodeInput.cjs.map +1 -1
- package/dist/components/SBarcodeInput/SBarcodeInput.js +226 -209
- package/dist/components/SBarcodeInput/SBarcodeInput.js.map +1 -1
- package/dist/components/SCalendar/SCalendar.cjs +9 -1
- package/dist/components/SCalendar/SCalendar.cjs.map +1 -1
- package/dist/components/SCalendar/SCalendar.js +9 -1
- package/dist/components/SCalendar/SCalendar.js.map +1 -1
- package/dist/components/SChip/SChip.cjs +9 -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 +9 -1
- package/dist/components/SChip/SChip.js.map +1 -1
- package/dist/components/SChipInput/SChipInput.cjs +260 -235
- package/dist/components/SChipInput/SChipInput.cjs.map +1 -1
- package/dist/components/SChipInput/SChipInput.js +259 -235
- package/dist/components/SChipInput/SChipInput.js.map +1 -1
- package/dist/components/SCircleProgress/SCircleProgress.cjs +56 -58
- package/dist/components/SCircleProgress/SCircleProgress.cjs.map +1 -1
- package/dist/components/SCircleProgress/SCircleProgress.js +56 -58
- package/dist/components/SCircleProgress/SCircleProgress.js.map +1 -1
- package/dist/components/SConfirmModal/SConfirmModal.cjs +9 -1
- package/dist/components/SConfirmModal/SConfirmModal.cjs.map +1 -1
- package/dist/components/SConfirmModal/SConfirmModal.js +9 -1
- package/dist/components/SConfirmModal/SConfirmModal.js.map +1 -1
- package/dist/components/SDatePicker/SDatePicker.cjs +247 -221
- package/dist/components/SDatePicker/SDatePicker.cjs.map +1 -1
- package/dist/components/SDatePicker/SDatePicker.js +247 -221
- package/dist/components/SDatePicker/SDatePicker.js.map +1 -1
- package/dist/components/SDateRangePicker/SDateRangePicker.cjs +308 -256
- package/dist/components/SDateRangePicker/SDateRangePicker.cjs.map +1 -1
- package/dist/components/SDateRangePicker/SDateRangePicker.js +308 -256
- package/dist/components/SDateRangePicker/SDateRangePicker.js.map +1 -1
- package/dist/components/SDropdownButton/SDropdownButton.cjs +51 -4
- package/dist/components/SDropdownButton/SDropdownButton.cjs.map +1 -1
- package/dist/components/SDropdownButton/SDropdownButton.js +52 -5
- package/dist/components/SDropdownButton/SDropdownButton.js.map +1 -1
- package/dist/components/SField/SField.cjs +226 -21
- package/dist/components/SField/SField.cjs.map +1 -1
- package/dist/components/SField/SField.d.ts +11 -0
- package/dist/components/SField/SField.js +226 -21
- package/dist/components/SField/SField.js.map +1 -1
- package/dist/components/SFilePicker/SFilePicker.cjs +306 -278
- package/dist/components/SFilePicker/SFilePicker.cjs.map +1 -1
- package/dist/components/SFilePicker/SFilePicker.d.ts +4 -2
- package/dist/components/SFilePicker/SFilePicker.js +306 -278
- package/dist/components/SFilePicker/SFilePicker.js.map +1 -1
- package/dist/components/SGhostButton/SGhostButton.cjs +8 -0
- package/dist/components/SGhostButton/SGhostButton.cjs.map +1 -1
- package/dist/components/SGhostButton/SGhostButton.js +8 -0
- package/dist/components/SGhostButton/SGhostButton.js.map +1 -1
- package/dist/components/SGuide/SGuide.cjs +12 -1
- package/dist/components/SGuide/SGuide.cjs.map +1 -1
- package/dist/components/SGuide/SGuide.js +12 -1
- package/dist/components/SGuide/SGuide.js.map +1 -1
- package/dist/components/SInput/SInput.cjs +226 -209
- package/dist/components/SInput/SInput.cjs.map +1 -1
- package/dist/components/SInput/SInput.js +226 -209
- package/dist/components/SInput/SInput.js.map +1 -1
- package/dist/components/SKeyValueTable/SKeyValueTable.cjs +640 -453
- package/dist/components/SKeyValueTable/SKeyValueTable.cjs.map +1 -1
- package/dist/components/SKeyValueTable/SKeyValueTable.d.ts +3 -1
- package/dist/components/SKeyValueTable/SKeyValueTable.js +640 -453
- package/dist/components/SKeyValueTable/SKeyValueTable.js.map +1 -1
- package/dist/components/SLoadingContainer/SLoadingContainer.cjs +64 -58
- package/dist/components/SLoadingContainer/SLoadingContainer.cjs.map +1 -1
- package/dist/components/SLoadingContainer/SLoadingContainer.js +64 -58
- package/dist/components/SLoadingContainer/SLoadingContainer.js.map +1 -1
- package/dist/components/SLoadingContainer/loading.cjs +64 -58
- package/dist/components/SLoadingContainer/loading.cjs.map +1 -1
- package/dist/components/SLoadingContainer/loading.js +64 -58
- package/dist/components/SLoadingContainer/loading.js.map +1 -1
- package/dist/components/SLoadingModal/SLoadingModal.cjs +68 -61
- package/dist/components/SLoadingModal/SLoadingModal.cjs.map +1 -1
- package/dist/components/SLoadingModal/SLoadingModal.js +68 -61
- package/dist/components/SLoadingModal/SLoadingModal.js.map +1 -1
- package/dist/components/SModalContainer/SModalContainer.cjs +9 -1
- package/dist/components/SModalContainer/SModalContainer.cjs.map +1 -1
- package/dist/components/SModalContainer/SModalContainer.js +9 -1
- package/dist/components/SModalContainer/SModalContainer.js.map +1 -1
- package/dist/components/SNumberInput/SNumberInput.cjs +334 -50
- package/dist/components/SNumberInput/SNumberInput.cjs.map +1 -1
- package/dist/components/SNumberInput/SNumberInput.d.ts +2 -0
- package/dist/components/SNumberInput/SNumberInput.js +334 -50
- 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/SPopover/SPopover.cjs +20 -3
- package/dist/components/SPopover/SPopover.cjs.map +1 -1
- package/dist/components/SPopover/SPopover.js +20 -4
- package/dist/components/SPopover/SPopover.js.map +1 -1
- package/dist/components/SPopup/SPopup.cjs +2 -2
- package/dist/components/SPopup/SPopup.cjs.map +1 -1
- package/dist/components/SPopup/SPopup.js +2 -2
- package/dist/components/SPopup/SPopup.js.map +1 -1
- package/dist/components/SPortal/SPortal.cjs +8 -0
- package/dist/components/SPortal/SPortal.cjs.map +1 -1
- package/dist/components/SPortal/SPortal.js +8 -0
- package/dist/components/SPortal/SPortal.js.map +1 -1
- package/dist/components/SSelect/SSelect.cjs +76 -32
- package/dist/components/SSelect/SSelect.cjs.map +1 -1
- package/dist/components/SSelect/SSelect.js +76 -32
- package/dist/components/SSelect/SSelect.js.map +1 -1
- package/dist/components/STable/STable.cjs +133 -91
- package/dist/components/STable/STable.cjs.map +1 -1
- package/dist/components/STable/STable.js +133 -91
- package/dist/components/STable/STable.js.map +1 -1
- package/dist/components/STextLink/STextLink.cjs +137 -3
- package/dist/components/STextLink/STextLink.cjs.map +1 -1
- package/dist/components/STextLink/STextLink.d.ts +1 -1
- package/dist/components/STextLink/STextLink.js +118 -4
- package/dist/components/STextLink/STextLink.js.map +1 -1
- package/dist/components/STextarea/STextarea.cjs +226 -21
- package/dist/components/STextarea/STextarea.cjs.map +1 -1
- package/dist/components/STextarea/STextarea.js +226 -21
- package/dist/components/STextarea/STextarea.js.map +1 -1
- package/dist/components/SToast/SToast.cjs +8 -0
- package/dist/components/SToast/SToast.cjs.map +1 -1
- package/dist/components/SToast/SToast.js +8 -0
- package/dist/components/SToast/SToast.js.map +1 -1
- package/dist/components/SToast/SToastContainer.cjs +11 -3
- package/dist/components/SToast/SToastContainer.cjs.map +1 -1
- package/dist/components/SToast/SToastContainer.js +11 -3
- package/dist/components/SToast/SToastContainer.js.map +1 -1
- package/dist/components/STooltip/STooltip.cjs +217 -14
- package/dist/components/STooltip/STooltip.cjs.map +1 -1
- package/dist/components/STooltip/STooltip.js +217 -14
- package/dist/components/STooltip/STooltip.js.map +1 -1
- package/dist/index.cjs +532 -300
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +531 -300
- package/dist/index.js.map +1 -1
- package/dist/lib/floating-anim.cjs +8 -0
- package/dist/lib/floating-anim.cjs.map +1 -1
- package/dist/lib/floating-anim.d.ts +5 -1
- package/dist/lib/floating-anim.js +8 -0
- package/dist/lib/floating-anim.js.map +1 -1
- package/dist/styles.css +175 -66
- package/dist/theme.css +49 -22
- package/package.json +1 -1
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
import { forwardRef, createContext, useState, useRef, useImperativeHandle, useEffect, useId, useMemo, useContext } from 'react';
|
|
3
3
|
import { clsx } from 'clsx';
|
|
4
4
|
import { extendTailwindMerge } from 'tailwind-merge';
|
|
5
|
-
import { jsx,
|
|
6
|
-
import * as
|
|
5
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
6
|
+
import * as RPopover2 from '@radix-ui/react-popover';
|
|
7
|
+
import * as RTooltip from '@radix-ui/react-tooltip';
|
|
7
8
|
|
|
8
9
|
var twMerge = extendTailwindMerge({
|
|
9
10
|
extend: {
|
|
@@ -2854,12 +2855,20 @@ var SIcon = forwardRef(function SIcon2({ name, size = 24, color, rotate, label,
|
|
|
2854
2855
|
// src/lib/floating-anim.ts
|
|
2855
2856
|
var FLOATING_SLIDE_ANIM = [
|
|
2856
2857
|
"data-[state=open]:data-[side=top]:animate-floating-in-top",
|
|
2858
|
+
"data-[state=delayed-open]:data-[side=top]:animate-floating-in-top",
|
|
2859
|
+
"data-[state=instant-open]:data-[side=top]:animate-floating-in-top",
|
|
2857
2860
|
"data-[state=closed]:data-[side=top]:animate-floating-out-top",
|
|
2858
2861
|
"data-[state=open]:data-[side=bottom]:animate-floating-in-bottom",
|
|
2862
|
+
"data-[state=delayed-open]:data-[side=bottom]:animate-floating-in-bottom",
|
|
2863
|
+
"data-[state=instant-open]:data-[side=bottom]:animate-floating-in-bottom",
|
|
2859
2864
|
"data-[state=closed]:data-[side=bottom]:animate-floating-out-bottom",
|
|
2860
2865
|
"data-[state=open]:data-[side=left]:animate-floating-in-left",
|
|
2866
|
+
"data-[state=delayed-open]:data-[side=left]:animate-floating-in-left",
|
|
2867
|
+
"data-[state=instant-open]:data-[side=left]:animate-floating-in-left",
|
|
2861
2868
|
"data-[state=closed]:data-[side=left]:animate-floating-out-left",
|
|
2862
2869
|
"data-[state=open]:data-[side=right]:animate-floating-in-right",
|
|
2870
|
+
"data-[state=delayed-open]:data-[side=right]:animate-floating-in-right",
|
|
2871
|
+
"data-[state=instant-open]:data-[side=right]:animate-floating-in-right",
|
|
2863
2872
|
"data-[state=closed]:data-[side=right]:animate-floating-out-right"
|
|
2864
2873
|
].join(" ");
|
|
2865
2874
|
var PortalContainerContext = createContext(null);
|
|
@@ -2867,11 +2876,200 @@ PortalContainerContext.Provider;
|
|
|
2867
2876
|
function usePortalContainer() {
|
|
2868
2877
|
return useContext(PortalContainerContext) ?? void 0;
|
|
2869
2878
|
}
|
|
2879
|
+
|
|
2880
|
+
// src/components/STag/tag.config.ts
|
|
2881
|
+
var TAG_SIZE_CONFIG = {
|
|
2882
|
+
xs: {
|
|
2883
|
+
height: 20,
|
|
2884
|
+
paddingX: 8,
|
|
2885
|
+
gap: 4,
|
|
2886
|
+
radius: 6,
|
|
2887
|
+
iconSize: 12,
|
|
2888
|
+
fontSize: 11,
|
|
2889
|
+
fontWeight: 500,
|
|
2890
|
+
lineHeight: 18
|
|
2891
|
+
},
|
|
2892
|
+
sm: {
|
|
2893
|
+
height: 24,
|
|
2894
|
+
paddingX: 8,
|
|
2895
|
+
gap: 4,
|
|
2896
|
+
radius: 6,
|
|
2897
|
+
iconSize: 16,
|
|
2898
|
+
fontSize: 12,
|
|
2899
|
+
fontWeight: 700,
|
|
2900
|
+
lineHeight: 20
|
|
2901
|
+
},
|
|
2902
|
+
md: {
|
|
2903
|
+
height: 28,
|
|
2904
|
+
paddingX: 12,
|
|
2905
|
+
gap: 6,
|
|
2906
|
+
radius: 8,
|
|
2907
|
+
iconSize: 16,
|
|
2908
|
+
fontSize: 14,
|
|
2909
|
+
fontWeight: 700,
|
|
2910
|
+
lineHeight: 24
|
|
2911
|
+
}
|
|
2912
|
+
};
|
|
2913
|
+
var STag = forwardRef(function STag2({
|
|
2914
|
+
shape = "square",
|
|
2915
|
+
size = "sm",
|
|
2916
|
+
color = "grey",
|
|
2917
|
+
label = "",
|
|
2918
|
+
icon,
|
|
2919
|
+
iconLeft = true,
|
|
2920
|
+
width,
|
|
2921
|
+
className,
|
|
2922
|
+
style,
|
|
2923
|
+
...rest
|
|
2924
|
+
}, ref) {
|
|
2925
|
+
const s = TAG_SIZE_CONFIG[size];
|
|
2926
|
+
const contentColor = `var(--cmp-tag-${color}-content)`;
|
|
2927
|
+
const iconNode = icon ? /* @__PURE__ */ jsx(SIcon, { name: icon, size: s.iconSize, color: contentColor }) : null;
|
|
2928
|
+
const resolvedWidth = typeof width === "number" ? `${width}px` : width;
|
|
2929
|
+
return /* @__PURE__ */ jsxs(
|
|
2930
|
+
"span",
|
|
2931
|
+
{
|
|
2932
|
+
ref,
|
|
2933
|
+
"aria-label": label || "tag",
|
|
2934
|
+
className: cn(
|
|
2935
|
+
"box-border inline-flex w-fit select-none items-center justify-center whitespace-nowrap",
|
|
2936
|
+
className
|
|
2937
|
+
),
|
|
2938
|
+
style: {
|
|
2939
|
+
minHeight: s.height,
|
|
2940
|
+
padding: `0 ${s.paddingX}px`,
|
|
2941
|
+
gap: s.gap,
|
|
2942
|
+
borderRadius: shape === "pill" ? 999 : s.radius,
|
|
2943
|
+
fontSize: s.fontSize,
|
|
2944
|
+
fontWeight: s.fontWeight,
|
|
2945
|
+
lineHeight: `${s.lineHeight}px`,
|
|
2946
|
+
background: `var(--cmp-tag-${color}-bg)`,
|
|
2947
|
+
color: contentColor,
|
|
2948
|
+
...resolvedWidth != null ? { width: resolvedWidth } : {},
|
|
2949
|
+
...style
|
|
2950
|
+
},
|
|
2951
|
+
...rest,
|
|
2952
|
+
children: [
|
|
2953
|
+
icon && iconLeft && iconNode,
|
|
2954
|
+
label && /* @__PURE__ */ jsx("span", { className: "inline-flex min-w-0 items-center justify-center", children: label }),
|
|
2955
|
+
icon && !iconLeft && iconNode
|
|
2956
|
+
]
|
|
2957
|
+
}
|
|
2958
|
+
);
|
|
2959
|
+
});
|
|
2960
|
+
var SIZE = {
|
|
2961
|
+
xxs: { icon: 12, radius: "sm" },
|
|
2962
|
+
xs: { icon: 16, radius: "sm" },
|
|
2963
|
+
sm: { icon: 20, radius: "sm" },
|
|
2964
|
+
md: { icon: 24, radius: "md" },
|
|
2965
|
+
lg: { icon: 32, radius: "md" }
|
|
2966
|
+
};
|
|
2967
|
+
var TOOLTIP_HIDE_DELAY_MS = 100;
|
|
2968
|
+
function SGhostButton({
|
|
2969
|
+
icon,
|
|
2970
|
+
size = "sm",
|
|
2971
|
+
intent = "default",
|
|
2972
|
+
ariaLabel = "",
|
|
2973
|
+
tooltipText,
|
|
2974
|
+
disabled = false,
|
|
2975
|
+
onClick,
|
|
2976
|
+
className,
|
|
2977
|
+
style
|
|
2978
|
+
}) {
|
|
2979
|
+
const portalContainer = usePortalContainer();
|
|
2980
|
+
const [open, setOpen] = useState(false);
|
|
2981
|
+
const hideTimer = useRef(void 0);
|
|
2982
|
+
const cancelHide = () => {
|
|
2983
|
+
if (hideTimer.current) {
|
|
2984
|
+
clearTimeout(hideTimer.current);
|
|
2985
|
+
hideTimer.current = void 0;
|
|
2986
|
+
}
|
|
2987
|
+
};
|
|
2988
|
+
const openNow = () => {
|
|
2989
|
+
cancelHide();
|
|
2990
|
+
setOpen(true);
|
|
2991
|
+
};
|
|
2992
|
+
const startHide = () => {
|
|
2993
|
+
cancelHide();
|
|
2994
|
+
hideTimer.current = setTimeout(() => setOpen(false), TOOLTIP_HIDE_DELAY_MS);
|
|
2995
|
+
};
|
|
2996
|
+
const s = SIZE[size];
|
|
2997
|
+
const contentColor = disabled ? intent === "inverse" ? "var(--cmp-ghostButton-inverse-disabled)" : "var(--cmp-ghostButton-icon-disabled)" : `var(--cmp-ghostButton-${intent}-content)`;
|
|
2998
|
+
const btn = /* @__PURE__ */ jsxs(
|
|
2999
|
+
"button",
|
|
3000
|
+
{
|
|
3001
|
+
type: "button",
|
|
3002
|
+
disabled,
|
|
3003
|
+
"aria-disabled": disabled ? "true" : void 0,
|
|
3004
|
+
"aria-label": ariaLabel.trim() || void 0,
|
|
3005
|
+
tabIndex: disabled ? -1 : void 0,
|
|
3006
|
+
onClick: (e) => {
|
|
3007
|
+
if (disabled) {
|
|
3008
|
+
e.preventDefault();
|
|
3009
|
+
return;
|
|
3010
|
+
}
|
|
3011
|
+
onClick?.(e);
|
|
3012
|
+
},
|
|
3013
|
+
className: cn(
|
|
3014
|
+
"group relative box-border inline-flex items-center justify-center border-none bg-transparent p-0 transition-shadow",
|
|
3015
|
+
disabled ? "cursor-not-allowed" : "cursor-pointer",
|
|
3016
|
+
"focus-visible:outline-none focus-visible:shadow-[0_0_0_2px_var(--cmp-ghostButton-action-hover-bg)]",
|
|
3017
|
+
className
|
|
3018
|
+
),
|
|
3019
|
+
style: {
|
|
3020
|
+
width: `var(--cmp-ghostButton-${size}-size)`,
|
|
3021
|
+
height: `var(--cmp-ghostButton-${size}-size)`,
|
|
3022
|
+
borderRadius: `var(--cmp-ghostButton-radius-${s.radius})`,
|
|
3023
|
+
...style
|
|
3024
|
+
},
|
|
3025
|
+
children: [
|
|
3026
|
+
!disabled && /* @__PURE__ */ jsx(
|
|
3027
|
+
"span",
|
|
3028
|
+
{
|
|
3029
|
+
"aria-hidden": true,
|
|
3030
|
+
className: "pointer-events-none absolute inset-0 rounded-[inherit] opacity-0 transition-opacity duration-200 group-hover:opacity-5",
|
|
3031
|
+
style: { background: `var(--cmp-ghostButton-${intent}-hover-bg)` }
|
|
3032
|
+
}
|
|
3033
|
+
),
|
|
3034
|
+
/* @__PURE__ */ jsx(SIcon, { name: icon, size: s.icon, color: contentColor })
|
|
3035
|
+
]
|
|
3036
|
+
}
|
|
3037
|
+
);
|
|
3038
|
+
const text = (tooltipText ?? "").trim();
|
|
3039
|
+
if (text === "") return btn;
|
|
3040
|
+
return /* @__PURE__ */ jsxs(RPopover2.Root, { open, onOpenChange: setOpen, children: [
|
|
3041
|
+
/* @__PURE__ */ jsx(RPopover2.Anchor, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
3042
|
+
"span",
|
|
3043
|
+
{
|
|
3044
|
+
className: "inline-flex",
|
|
3045
|
+
onMouseEnter: openNow,
|
|
3046
|
+
onMouseLeave: startHide,
|
|
3047
|
+
onFocus: openNow,
|
|
3048
|
+
onBlur: startHide,
|
|
3049
|
+
children: btn
|
|
3050
|
+
}
|
|
3051
|
+
) }),
|
|
3052
|
+
/* @__PURE__ */ jsx(RPopover2.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx(
|
|
3053
|
+
RPopover2.Content,
|
|
3054
|
+
{
|
|
3055
|
+
side: "top",
|
|
3056
|
+
sideOffset: 4,
|
|
3057
|
+
className: cn("z-50", FLOATING_SLIDE_ANIM),
|
|
3058
|
+
"aria-hidden": true,
|
|
3059
|
+
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
3060
|
+
onMouseEnter: cancelHide,
|
|
3061
|
+
onMouseLeave: startHide,
|
|
3062
|
+
children: /* @__PURE__ */ jsx(STag, { shape: "square", size: "xs", color: "grey", label: text })
|
|
3063
|
+
}
|
|
3064
|
+
) })
|
|
3065
|
+
] });
|
|
3066
|
+
}
|
|
2870
3067
|
var HIDE_DELAY_MS = 100;
|
|
2871
3068
|
function useBody(content, message = []) {
|
|
2872
3069
|
if (content != null) return content;
|
|
2873
3070
|
if (message.length === 0) return null;
|
|
2874
|
-
|
|
3071
|
+
const singleLine = message.length === 1;
|
|
3072
|
+
return /* @__PURE__ */ jsx(Fragment, { children: message.map((line, i) => /* @__PURE__ */ jsx("div", { className: singleLine ? "leading-[24px]" : void 0, children: line }, i)) });
|
|
2875
3073
|
}
|
|
2876
3074
|
var STooltip = forwardRef(function STooltip2({
|
|
2877
3075
|
content,
|
|
@@ -2929,7 +3127,7 @@ var STooltip = forwardRef(function STooltip2({
|
|
|
2929
3127
|
if (disabled || body == null) return /* @__PURE__ */ jsx(Fragment, { children: triggerNode });
|
|
2930
3128
|
const isHover = trigger === "hover";
|
|
2931
3129
|
const contentClass = cn(
|
|
2932
|
-
"z-50 max-w-xs rounded-[6px] px-[16px] py-[12px] text-[12px] leading-[20px]",
|
|
3130
|
+
"z-50 max-w-xs rounded-[6px] px-[16px] py-[12px] text-[12px] leading-[20px] shadow-[2px_2px_12px_2px_rgba(0,0,0,0.1)]",
|
|
2933
3131
|
FLOATING_SLIDE_ANIM,
|
|
2934
3132
|
className
|
|
2935
3133
|
);
|
|
@@ -2939,10 +3137,10 @@ var STooltip = forwardRef(function STooltip2({
|
|
|
2939
3137
|
fontWeight: tooltipType === "default" ? 500 : 700,
|
|
2940
3138
|
...style
|
|
2941
3139
|
};
|
|
2942
|
-
return /* @__PURE__ */ jsxs(
|
|
3140
|
+
return /* @__PURE__ */ jsxs(RPopover2.Root, { open, onOpenChange: setOpen, children: [
|
|
2943
3141
|
isHover ? (
|
|
2944
3142
|
// hover: Anchor(위치 기준) + 직접 mouse 핸들러 — 클릭으로 토글되지 않도록 Trigger 미사용
|
|
2945
|
-
/* @__PURE__ */ jsx(
|
|
3143
|
+
/* @__PURE__ */ jsx(RPopover2.Anchor, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
2946
3144
|
"span",
|
|
2947
3145
|
{
|
|
2948
3146
|
className: "inline-flex",
|
|
@@ -2953,9 +3151,9 @@ var STooltip = forwardRef(function STooltip2({
|
|
|
2953
3151
|
children: triggerNode
|
|
2954
3152
|
}
|
|
2955
3153
|
) })
|
|
2956
|
-
) : /* @__PURE__ */ jsx(
|
|
2957
|
-
/* @__PURE__ */ jsx(
|
|
2958
|
-
|
|
3154
|
+
) : /* @__PURE__ */ jsx(RPopover2.Trigger, { asChild: true, children: triggerNode }),
|
|
3155
|
+
/* @__PURE__ */ jsx(RPopover2.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxs(
|
|
3156
|
+
RPopover2.Content,
|
|
2959
3157
|
{
|
|
2960
3158
|
side: placement,
|
|
2961
3159
|
sideOffset: 8,
|
|
@@ -2974,15 +3172,21 @@ var STooltip = forwardRef(function STooltip2({
|
|
|
2974
3172
|
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-[12px]", children: [
|
|
2975
3173
|
/* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1", children: body }),
|
|
2976
3174
|
useClose && /* @__PURE__ */ jsx(
|
|
2977
|
-
|
|
3175
|
+
SGhostButton,
|
|
2978
3176
|
{
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
3177
|
+
icon: "close",
|
|
3178
|
+
size: "xs",
|
|
3179
|
+
intent: tooltipType === "default" ? "inverse" : "default",
|
|
3180
|
+
ariaLabel: "\uB2EB\uAE30",
|
|
3181
|
+
className: "shrink-0",
|
|
3182
|
+
onClick: () => {
|
|
3183
|
+
cancelHide();
|
|
3184
|
+
setOpen(false);
|
|
3185
|
+
}
|
|
2982
3186
|
}
|
|
2983
3187
|
)
|
|
2984
3188
|
] }),
|
|
2985
|
-
/* @__PURE__ */ jsx(
|
|
3189
|
+
/* @__PURE__ */ jsx(RPopover2.Arrow, { width: 16, height: 12, style: { fill: bg } })
|
|
2986
3190
|
]
|
|
2987
3191
|
}
|
|
2988
3192
|
) })
|
|
@@ -3016,8 +3220,8 @@ function useFormField(field) {
|
|
|
3016
3220
|
}, [ctx, name]);
|
|
3017
3221
|
}
|
|
3018
3222
|
var FIELD_SIZE = {
|
|
3019
|
-
sm: { height: 28, radius: 4, fieldGap: 12, labelGap: 6, fontSize: 12, lineHeight: 20, icon:
|
|
3020
|
-
md: { height: 36, radius: 6, fieldGap: 16, labelGap: 8, fontSize: 14, lineHeight: 24, icon:
|
|
3223
|
+
sm: { height: 28, radius: 4, fieldGap: 12, labelGap: 6, fontSize: 12, lineHeight: 20, icon: 16 },
|
|
3224
|
+
md: { height: 36, radius: 6, fieldGap: 16, labelGap: 8, fontSize: 14, lineHeight: 24, icon: 16 }
|
|
3021
3225
|
};
|
|
3022
3226
|
var ALIGN = {
|
|
3023
3227
|
start: "flex-start",
|
|
@@ -3032,6 +3236,7 @@ var SField = forwardRef(function SField2({
|
|
|
3032
3236
|
labelTooltip = "",
|
|
3033
3237
|
labelTooltipProps,
|
|
3034
3238
|
labelWidth,
|
|
3239
|
+
labelHeight,
|
|
3035
3240
|
size = "sm",
|
|
3036
3241
|
addonLabel = "",
|
|
3037
3242
|
addonAlign = "start",
|
|
@@ -3046,6 +3251,7 @@ var SField = forwardRef(function SField2({
|
|
|
3046
3251
|
readOnly = false,
|
|
3047
3252
|
width,
|
|
3048
3253
|
multiline = false,
|
|
3254
|
+
borderless = false,
|
|
3049
3255
|
children,
|
|
3050
3256
|
className,
|
|
3051
3257
|
style,
|
|
@@ -3079,8 +3285,8 @@ var SField = forwardRef(function SField2({
|
|
|
3079
3285
|
const resolvedSuccess = status === "pass";
|
|
3080
3286
|
const showError = resolvedError && errorMessage !== "";
|
|
3081
3287
|
const interactive = !disabled && !readOnly;
|
|
3082
|
-
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)";
|
|
3083
|
-
const bgColor = disabled ? "var(--color-grey-30)" : readOnly ? "var(--sys-color-field-bg-readOnly)" : "var(--sys-color-field-bg-default)";
|
|
3288
|
+
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)";
|
|
3289
|
+
const bgColor = borderless ? "transparent" : disabled ? "var(--color-grey-30)" : readOnly ? "var(--sys-color-field-bg-readOnly)" : "var(--sys-color-field-bg-default)";
|
|
3084
3290
|
const textColor = disabled ? "var(--color-grey-65)" : readOnly ? "var(--sys-color-field-text-readOnly)" : "var(--sys-color-field-text-default)";
|
|
3085
3291
|
return /* @__PURE__ */ jsx(
|
|
3086
3292
|
"div",
|
|
@@ -3097,7 +3303,7 @@ var SField = forwardRef(function SField2({
|
|
|
3097
3303
|
{
|
|
3098
3304
|
className: "flex shrink-0 items-center font-bold text-(--sys-color-field-text-default)",
|
|
3099
3305
|
style: {
|
|
3100
|
-
height: s.height,
|
|
3306
|
+
height: cssLen(labelHeight) ?? s.height,
|
|
3101
3307
|
marginRight: s.fieldGap,
|
|
3102
3308
|
width: cssLen(labelWidth),
|
|
3103
3309
|
fontSize: s.fontSize,
|
|
@@ -3123,14 +3329,14 @@ var SField = forwardRef(function SField2({
|
|
|
3123
3329
|
{
|
|
3124
3330
|
className: cn(
|
|
3125
3331
|
"relative box-border flex min-w-0 items-stretch overflow-hidden border border-solid border-(--field-bc)",
|
|
3126
|
-
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]",
|
|
3332
|
+
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]",
|
|
3127
3333
|
disabled && "cursor-not-allowed"
|
|
3128
3334
|
),
|
|
3129
3335
|
style: {
|
|
3130
3336
|
// @ts-expect-error CSS 변수
|
|
3131
3337
|
"--field-bc": borderColor,
|
|
3132
3338
|
// focused/hovered prop이 명시된 경우 강조를 즉시 반영
|
|
3133
|
-
...interactive && focused ? { boxShadow: "0px 0px 4px 0px #0071ff66" } : {},
|
|
3339
|
+
...interactive && !borderless && focused ? { boxShadow: "0px 0px 4px 0px #0071ff66" } : {},
|
|
3134
3340
|
...multiline ? { minHeight: s.height } : { height: s.height },
|
|
3135
3341
|
"width": cssLen(width),
|
|
3136
3342
|
"borderRadius": s.radius,
|
|
@@ -3169,200 +3375,12 @@ var SField = forwardRef(function SField2({
|
|
|
3169
3375
|
}
|
|
3170
3376
|
);
|
|
3171
3377
|
});
|
|
3172
|
-
|
|
3173
|
-
// src/components/STag/tag.config.ts
|
|
3174
|
-
var TAG_SIZE_CONFIG = {
|
|
3175
|
-
xs: {
|
|
3176
|
-
height: 20,
|
|
3177
|
-
paddingX: 8,
|
|
3178
|
-
gap: 4,
|
|
3179
|
-
radius: 6,
|
|
3180
|
-
iconSize: 12,
|
|
3181
|
-
fontSize: 11,
|
|
3182
|
-
fontWeight: 500,
|
|
3183
|
-
lineHeight: 18
|
|
3184
|
-
},
|
|
3185
|
-
sm: {
|
|
3186
|
-
height: 24,
|
|
3187
|
-
paddingX: 8,
|
|
3188
|
-
gap: 4,
|
|
3189
|
-
radius: 6,
|
|
3190
|
-
iconSize: 16,
|
|
3191
|
-
fontSize: 12,
|
|
3192
|
-
fontWeight: 700,
|
|
3193
|
-
lineHeight: 20
|
|
3194
|
-
},
|
|
3195
|
-
md: {
|
|
3196
|
-
height: 28,
|
|
3197
|
-
paddingX: 12,
|
|
3198
|
-
gap: 6,
|
|
3199
|
-
radius: 8,
|
|
3200
|
-
iconSize: 16,
|
|
3201
|
-
fontSize: 14,
|
|
3202
|
-
fontWeight: 700,
|
|
3203
|
-
lineHeight: 24
|
|
3204
|
-
}
|
|
3205
|
-
};
|
|
3206
|
-
var STag = forwardRef(function STag2({
|
|
3207
|
-
shape = "square",
|
|
3208
|
-
size = "sm",
|
|
3209
|
-
color = "grey",
|
|
3210
|
-
label = "",
|
|
3211
|
-
icon,
|
|
3212
|
-
iconLeft = true,
|
|
3213
|
-
width,
|
|
3214
|
-
className,
|
|
3215
|
-
style,
|
|
3216
|
-
...rest
|
|
3217
|
-
}, ref) {
|
|
3218
|
-
const s = TAG_SIZE_CONFIG[size];
|
|
3219
|
-
const contentColor = `var(--cmp-tag-${color}-content)`;
|
|
3220
|
-
const iconNode = icon ? /* @__PURE__ */ jsx(SIcon, { name: icon, size: s.iconSize, color: contentColor }) : null;
|
|
3221
|
-
const resolvedWidth = typeof width === "number" ? `${width}px` : width;
|
|
3222
|
-
return /* @__PURE__ */ jsxs(
|
|
3223
|
-
"span",
|
|
3224
|
-
{
|
|
3225
|
-
ref,
|
|
3226
|
-
"aria-label": label || "tag",
|
|
3227
|
-
className: cn(
|
|
3228
|
-
"box-border inline-flex w-fit select-none items-center justify-center whitespace-nowrap",
|
|
3229
|
-
className
|
|
3230
|
-
),
|
|
3231
|
-
style: {
|
|
3232
|
-
minHeight: s.height,
|
|
3233
|
-
padding: `0 ${s.paddingX}px`,
|
|
3234
|
-
gap: s.gap,
|
|
3235
|
-
borderRadius: shape === "pill" ? 999 : s.radius,
|
|
3236
|
-
fontSize: s.fontSize,
|
|
3237
|
-
fontWeight: s.fontWeight,
|
|
3238
|
-
lineHeight: `${s.lineHeight}px`,
|
|
3239
|
-
background: `var(--cmp-tag-${color}-bg)`,
|
|
3240
|
-
color: contentColor,
|
|
3241
|
-
...resolvedWidth != null ? { width: resolvedWidth } : {},
|
|
3242
|
-
...style
|
|
3243
|
-
},
|
|
3244
|
-
...rest,
|
|
3245
|
-
children: [
|
|
3246
|
-
icon && iconLeft && iconNode,
|
|
3247
|
-
label && /* @__PURE__ */ jsx("span", { className: "inline-flex min-w-0 items-center justify-center", children: label }),
|
|
3248
|
-
icon && !iconLeft && iconNode
|
|
3249
|
-
]
|
|
3250
|
-
}
|
|
3251
|
-
);
|
|
3252
|
-
});
|
|
3253
|
-
var SIZE = {
|
|
3254
|
-
xxs: { icon: 12, radius: "sm" },
|
|
3255
|
-
xs: { icon: 16, radius: "sm" },
|
|
3256
|
-
sm: { icon: 20, radius: "sm" },
|
|
3257
|
-
md: { icon: 24, radius: "md" },
|
|
3258
|
-
lg: { icon: 32, radius: "md" }
|
|
3259
|
-
};
|
|
3260
|
-
var TOOLTIP_HIDE_DELAY_MS = 100;
|
|
3261
|
-
function SGhostButton({
|
|
3262
|
-
icon,
|
|
3263
|
-
size = "sm",
|
|
3264
|
-
intent = "default",
|
|
3265
|
-
ariaLabel = "",
|
|
3266
|
-
tooltipText,
|
|
3267
|
-
disabled = false,
|
|
3268
|
-
onClick,
|
|
3269
|
-
className,
|
|
3270
|
-
style
|
|
3271
|
-
}) {
|
|
3272
|
-
const portalContainer = usePortalContainer();
|
|
3273
|
-
const [open, setOpen] = useState(false);
|
|
3274
|
-
const hideTimer = useRef(void 0);
|
|
3275
|
-
const cancelHide = () => {
|
|
3276
|
-
if (hideTimer.current) {
|
|
3277
|
-
clearTimeout(hideTimer.current);
|
|
3278
|
-
hideTimer.current = void 0;
|
|
3279
|
-
}
|
|
3280
|
-
};
|
|
3281
|
-
const openNow = () => {
|
|
3282
|
-
cancelHide();
|
|
3283
|
-
setOpen(true);
|
|
3284
|
-
};
|
|
3285
|
-
const startHide = () => {
|
|
3286
|
-
cancelHide();
|
|
3287
|
-
hideTimer.current = setTimeout(() => setOpen(false), TOOLTIP_HIDE_DELAY_MS);
|
|
3288
|
-
};
|
|
3289
|
-
const s = SIZE[size];
|
|
3290
|
-
const contentColor = disabled ? intent === "inverse" ? "var(--cmp-ghostButton-inverse-disabled)" : "var(--cmp-ghostButton-icon-disabled)" : `var(--cmp-ghostButton-${intent}-content)`;
|
|
3291
|
-
const btn = /* @__PURE__ */ jsxs(
|
|
3292
|
-
"button",
|
|
3293
|
-
{
|
|
3294
|
-
type: "button",
|
|
3295
|
-
disabled,
|
|
3296
|
-
"aria-disabled": disabled ? "true" : void 0,
|
|
3297
|
-
"aria-label": ariaLabel.trim() || void 0,
|
|
3298
|
-
tabIndex: disabled ? -1 : void 0,
|
|
3299
|
-
onClick: (e) => {
|
|
3300
|
-
if (disabled) {
|
|
3301
|
-
e.preventDefault();
|
|
3302
|
-
return;
|
|
3303
|
-
}
|
|
3304
|
-
onClick?.(e);
|
|
3305
|
-
},
|
|
3306
|
-
className: cn(
|
|
3307
|
-
"group relative box-border inline-flex items-center justify-center border-none bg-transparent p-0 transition-shadow",
|
|
3308
|
-
disabled ? "cursor-not-allowed" : "cursor-pointer",
|
|
3309
|
-
"focus-visible:outline-none focus-visible:shadow-[0_0_0_2px_var(--cmp-ghostButton-action-hover-bg)]",
|
|
3310
|
-
className
|
|
3311
|
-
),
|
|
3312
|
-
style: {
|
|
3313
|
-
width: `var(--cmp-ghostButton-${size}-size)`,
|
|
3314
|
-
height: `var(--cmp-ghostButton-${size}-size)`,
|
|
3315
|
-
borderRadius: `var(--cmp-ghostButton-radius-${s.radius})`,
|
|
3316
|
-
...style
|
|
3317
|
-
},
|
|
3318
|
-
children: [
|
|
3319
|
-
!disabled && /* @__PURE__ */ jsx(
|
|
3320
|
-
"span",
|
|
3321
|
-
{
|
|
3322
|
-
"aria-hidden": true,
|
|
3323
|
-
className: "pointer-events-none absolute inset-0 rounded-[inherit] opacity-0 transition-opacity duration-200 group-hover:opacity-5",
|
|
3324
|
-
style: { background: `var(--cmp-ghostButton-${intent}-hover-bg)` }
|
|
3325
|
-
}
|
|
3326
|
-
),
|
|
3327
|
-
/* @__PURE__ */ jsx(SIcon, { name: icon, size: s.icon, color: contentColor })
|
|
3328
|
-
]
|
|
3329
|
-
}
|
|
3330
|
-
);
|
|
3331
|
-
const text = (tooltipText ?? "").trim();
|
|
3332
|
-
if (text === "") return btn;
|
|
3333
|
-
return /* @__PURE__ */ jsxs(RPopover.Root, { open, onOpenChange: setOpen, children: [
|
|
3334
|
-
/* @__PURE__ */ jsx(RPopover.Anchor, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
3335
|
-
"span",
|
|
3336
|
-
{
|
|
3337
|
-
className: "inline-flex",
|
|
3338
|
-
onMouseEnter: openNow,
|
|
3339
|
-
onMouseLeave: startHide,
|
|
3340
|
-
onFocus: openNow,
|
|
3341
|
-
onBlur: startHide,
|
|
3342
|
-
children: btn
|
|
3343
|
-
}
|
|
3344
|
-
) }),
|
|
3345
|
-
/* @__PURE__ */ jsx(RPopover.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx(
|
|
3346
|
-
RPopover.Content,
|
|
3347
|
-
{
|
|
3348
|
-
side: "top",
|
|
3349
|
-
sideOffset: 4,
|
|
3350
|
-
className: cn("z-50", FLOATING_SLIDE_ANIM),
|
|
3351
|
-
"aria-hidden": true,
|
|
3352
|
-
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
3353
|
-
onMouseEnter: cancelHide,
|
|
3354
|
-
onMouseLeave: startHide,
|
|
3355
|
-
children: /* @__PURE__ */ jsx(STag, { shape: "square", size: "xs", color: "grey", label: text })
|
|
3356
|
-
}
|
|
3357
|
-
) })
|
|
3358
|
-
] });
|
|
3359
|
-
}
|
|
3360
3378
|
var SChip = forwardRef(function SChip2({
|
|
3361
3379
|
name,
|
|
3362
3380
|
value = "",
|
|
3363
3381
|
error: errorProp = false,
|
|
3364
3382
|
disabled = false,
|
|
3365
|
-
editable =
|
|
3383
|
+
editable = false,
|
|
3366
3384
|
showRemove = true,
|
|
3367
3385
|
placeholder = "",
|
|
3368
3386
|
rules,
|
|
@@ -3537,6 +3555,7 @@ var STextLink = forwardRef(function STextLink2({
|
|
|
3537
3555
|
className,
|
|
3538
3556
|
onClick,
|
|
3539
3557
|
children,
|
|
3558
|
+
style,
|
|
3540
3559
|
...rest
|
|
3541
3560
|
}, ref) {
|
|
3542
3561
|
const s = SIZE_CONFIG[size];
|
|
@@ -3545,13 +3564,13 @@ var STextLink = forwardRef(function STextLink2({
|
|
|
3545
3564
|
const handle = () => {
|
|
3546
3565
|
if (!disabled) onClick?.();
|
|
3547
3566
|
};
|
|
3548
|
-
|
|
3567
|
+
const portalContainer = usePortalContainer();
|
|
3568
|
+
const link = /* @__PURE__ */ jsxs(
|
|
3549
3569
|
"span",
|
|
3550
3570
|
{
|
|
3551
3571
|
ref,
|
|
3552
3572
|
role: "button",
|
|
3553
3573
|
tabIndex: disabled ? -1 : 0,
|
|
3554
|
-
title: tooltipText,
|
|
3555
3574
|
onClick: handle,
|
|
3556
3575
|
onKeyDown: (e) => {
|
|
3557
3576
|
if (e.key === "Enter" || e.key === " ") {
|
|
@@ -3566,7 +3585,7 @@ var STextLink = forwardRef(function STextLink2({
|
|
|
3566
3585
|
disabled && "cursor-not-allowed",
|
|
3567
3586
|
className
|
|
3568
3587
|
),
|
|
3569
|
-
style: { gap: s.gap, color: contentColor },
|
|
3588
|
+
style: { gap: s.gap, color: contentColor, ...style },
|
|
3570
3589
|
...rest,
|
|
3571
3590
|
children: [
|
|
3572
3591
|
icon && /* @__PURE__ */ jsx(SIcon, { name: icon, size: s.iconSize, color: resolvedIconColor }),
|
|
@@ -3589,6 +3608,12 @@ var STextLink = forwardRef(function STextLink2({
|
|
|
3589
3608
|
]
|
|
3590
3609
|
}
|
|
3591
3610
|
);
|
|
3611
|
+
const text = (tooltipText ?? "").trim();
|
|
3612
|
+
if (text === "") return link;
|
|
3613
|
+
return /* @__PURE__ */ jsx(RTooltip.Provider, { delayDuration: 200, children: /* @__PURE__ */ jsxs(RTooltip.Root, { children: [
|
|
3614
|
+
/* @__PURE__ */ jsx(RTooltip.Trigger, { asChild: true, children: link }),
|
|
3615
|
+
/* @__PURE__ */ jsx(RTooltip.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx(RTooltip.Content, { side: "top", sideOffset: 4, className: cn("z-50", FLOATING_SLIDE_ANIM), children: /* @__PURE__ */ jsx(STag, { shape: "square", size: "xs", color: "grey", label: text }) }) })
|
|
3616
|
+
] }) });
|
|
3592
3617
|
});
|
|
3593
3618
|
function SPortal({
|
|
3594
3619
|
open,
|
|
@@ -3613,7 +3638,7 @@ function SPortal({
|
|
|
3613
3638
|
}) {
|
|
3614
3639
|
const portalContainer = usePortalContainer();
|
|
3615
3640
|
return /* @__PURE__ */ jsxs(
|
|
3616
|
-
|
|
3641
|
+
RPopover2.Root,
|
|
3617
3642
|
{
|
|
3618
3643
|
open,
|
|
3619
3644
|
onOpenChange: (next) => {
|
|
@@ -3621,9 +3646,9 @@ function SPortal({
|
|
|
3621
3646
|
if (!next) onClose?.();
|
|
3622
3647
|
},
|
|
3623
3648
|
children: [
|
|
3624
|
-
/* @__PURE__ */ jsx(
|
|
3625
|
-
/* @__PURE__ */ jsx(
|
|
3626
|
-
|
|
3649
|
+
/* @__PURE__ */ jsx(RPopover2.Anchor, { virtualRef: anchorRef }),
|
|
3650
|
+
/* @__PURE__ */ jsx(RPopover2.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx(
|
|
3651
|
+
RPopover2.Content,
|
|
3627
3652
|
{
|
|
3628
3653
|
side: placement,
|
|
3629
3654
|
align,
|
|
@@ -3671,7 +3696,7 @@ var SChipInput = forwardRef(function SChipInput2({
|
|
|
3671
3696
|
disabledChips = [],
|
|
3672
3697
|
size = "sm",
|
|
3673
3698
|
disabled = false,
|
|
3674
|
-
placeholder = "\uC785\uB825\
|
|
3699
|
+
placeholder = "\uD0DC\uADF8 \uC785\uB825 (Enter\uB85C \uB4F1\uB85D / \uCF64\uB9C8\uB85C \uAD6C\uBD84 / \uB744\uC5B4\uC4F0\uAE30 \uBD88\uAC00)",
|
|
3675
3700
|
name,
|
|
3676
3701
|
rules,
|
|
3677
3702
|
error,
|
|
@@ -3822,6 +3847,7 @@ var SChipInput = forwardRef(function SChipInput2({
|
|
|
3822
3847
|
{
|
|
3823
3848
|
label,
|
|
3824
3849
|
labelWidth,
|
|
3850
|
+
labelHeight: `calc(var(--cmp-chipInput-${size}-minHeight) + 2px)`,
|
|
3825
3851
|
icon,
|
|
3826
3852
|
labelTooltip,
|
|
3827
3853
|
labelTooltipProps,
|
|
@@ -3892,9 +3918,11 @@ var SChipInput = forwardRef(function SChipInput2({
|
|
|
3892
3918
|
paddingInline: isFieldFilled ? "var(--cmp-chip-paddingX)" : void 0,
|
|
3893
3919
|
borderWidth: isFieldFilled ? "var(--cmp-chip-border-width)" : void 0,
|
|
3894
3920
|
borderStyle: isFieldFilled ? "solid" : void 0,
|
|
3895
|
-
|
|
3921
|
+
// 작성중 필드는 SChip의 editable 수정중(editing) 스타일과 동일하게 —
|
|
3922
|
+
// bg/보더/글자색 모두 focus 토큰을 사용한다.
|
|
3923
|
+
borderColor: isFieldFilled ? "var(--cmp-chip-border-focus)" : void 0,
|
|
3896
3924
|
borderRadius: isFieldFilled ? "var(--cmp-chip-radius)" : 0,
|
|
3897
|
-
background: isFieldFilled ? "var(--cmp-chip-bg-
|
|
3925
|
+
background: isFieldFilled ? "var(--cmp-chip-bg-focus)" : "transparent",
|
|
3898
3926
|
overflow: "hidden"
|
|
3899
3927
|
},
|
|
3900
3928
|
children: [
|
|
@@ -3903,7 +3931,7 @@ var SChipInput = forwardRef(function SChipInput2({
|
|
|
3903
3931
|
{
|
|
3904
3932
|
"aria-hidden": true,
|
|
3905
3933
|
className: cn(
|
|
3906
|
-
"invisible col-start-1 row-start-1 whitespace-pre font-
|
|
3934
|
+
"invisible col-start-1 row-start-1 whitespace-pre font-normal",
|
|
3907
3935
|
size === "md" ? "text-14 leading-24" : "text-12 leading-20"
|
|
3908
3936
|
),
|
|
3909
3937
|
children: inputValue !== "" ? inputValue : values.length === 0 ? placeholder : ""
|
|
@@ -3916,12 +3944,14 @@ var SChipInput = forwardRef(function SChipInput2({
|
|
|
3916
3944
|
name: resolvedName,
|
|
3917
3945
|
size: 1,
|
|
3918
3946
|
className: cn(
|
|
3919
|
-
"s-chip-input__input col-start-1 row-start-1 w-full border-0 bg-transparent p-0 font-
|
|
3947
|
+
"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",
|
|
3920
3948
|
size === "md" ? "text-14 leading-24" : "text-12 leading-20"
|
|
3921
3949
|
),
|
|
3922
3950
|
style: {
|
|
3923
3951
|
minWidth: "1ch",
|
|
3924
|
-
height
|
|
3952
|
+
// height는 지정하지 않고 line-height(20/24px)에 맞춰 자동 크기로 둔다.
|
|
3953
|
+
// var(--cmp-chip-height)(24px)로 고정하면 네이티브 <input>이 남는 세로 여백에
|
|
3954
|
+
// 텍스트를 아래로 밀어 넣어, 확정된 chip 텍스트보다 2px 낮게 보인다.
|
|
3925
3955
|
margin: 0,
|
|
3926
3956
|
overflow: "hidden",
|
|
3927
3957
|
textOverflow: "ellipsis"
|
|
@@ -3966,7 +3996,7 @@ var SChipInput = forwardRef(function SChipInput2({
|
|
|
3966
3996
|
showMetaInfo && /* @__PURE__ */ jsxs(
|
|
3967
3997
|
"div",
|
|
3968
3998
|
{
|
|
3969
|
-
className: "s-chip-input__meta flex items-center gap-8",
|
|
3999
|
+
className: "s-chip-input__meta ml-auto flex items-center gap-8",
|
|
3970
4000
|
onMouseDown: (e) => e.preventDefault(),
|
|
3971
4001
|
children: [
|
|
3972
4002
|
/* @__PURE__ */ jsx(
|
|
@@ -3976,17 +4006,11 @@ var SChipInput = forwardRef(function SChipInput2({
|
|
|
3976
4006
|
style: { width: 1, height: 12, backgroundColor: "#E1E1E1" }
|
|
3977
4007
|
}
|
|
3978
4008
|
),
|
|
3979
|
-
showMaxCount && /* @__PURE__ */ jsxs(
|
|
3980
|
-
"
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
"\uCD5C\uB300 ",
|
|
3985
|
-
maxCount,
|
|
3986
|
-
"\uAC1C"
|
|
3987
|
-
]
|
|
3988
|
-
}
|
|
3989
|
-
),
|
|
4009
|
+
showMaxCount && /* @__PURE__ */ jsxs("span", { className: "s-chip-input__max-count text-12 text-(--cmp-chipInput-text-placeholder)", children: [
|
|
4010
|
+
"\uCD5C\uB300 ",
|
|
4011
|
+
maxCount,
|
|
4012
|
+
"\uAC1C"
|
|
4013
|
+
] }),
|
|
3990
4014
|
showResetLink && /* @__PURE__ */ jsx(
|
|
3991
4015
|
STextLink,
|
|
3992
4016
|
{
|