sellmate-design-system-react 0.1.7 → 0.1.8
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 +10 -2
- package/dist/components/SActionModal/SActionModal.cjs.map +1 -1
- package/dist/components/SActionModal/SActionModal.js +10 -2
- package/dist/components/SActionModal/SActionModal.js.map +1 -1
- package/dist/components/SBarcodeInput/SBarcodeInput.cjs +8 -0
- package/dist/components/SBarcodeInput/SBarcodeInput.cjs.map +1 -1
- package/dist/components/SBarcodeInput/SBarcodeInput.js +8 -0
- package/dist/components/SBarcodeInput/SBarcodeInput.js.map +1 -1
- package/dist/components/SCalendar/SCalendar.cjs +8 -0
- package/dist/components/SCalendar/SCalendar.cjs.map +1 -1
- package/dist/components/SCalendar/SCalendar.js +8 -0
- package/dist/components/SCalendar/SCalendar.js.map +1 -1
- package/dist/components/SChip/SChip.cjs +8 -0
- package/dist/components/SChip/SChip.cjs.map +1 -1
- package/dist/components/SChip/SChip.js +8 -0
- package/dist/components/SChip/SChip.js.map +1 -1
- package/dist/components/SChipInput/SChipInput.cjs +25 -14
- package/dist/components/SChipInput/SChipInput.cjs.map +1 -1
- package/dist/components/SChipInput/SChipInput.js +24 -14
- package/dist/components/SChipInput/SChipInput.js.map +1 -1
- package/dist/components/SCircleProgress/SCircleProgress.cjs +3 -3
- package/dist/components/SCircleProgress/SCircleProgress.cjs.map +1 -1
- package/dist/components/SCircleProgress/SCircleProgress.js +3 -3
- 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 +26 -9
- package/dist/components/SDatePicker/SDatePicker.cjs.map +1 -1
- package/dist/components/SDatePicker/SDatePicker.js +26 -9
- package/dist/components/SDatePicker/SDatePicker.js.map +1 -1
- package/dist/components/SDateRangePicker/SDateRangePicker.cjs +26 -9
- package/dist/components/SDateRangePicker/SDateRangePicker.cjs.map +1 -1
- package/dist/components/SDateRangePicker/SDateRangePicker.js +26 -9
- package/dist/components/SDateRangePicker/SDateRangePicker.js.map +1 -1
- package/dist/components/SDropdownButton/SDropdownButton.cjs +48 -1
- package/dist/components/SDropdownButton/SDropdownButton.cjs.map +1 -1
- package/dist/components/SDropdownButton/SDropdownButton.js +49 -2
- package/dist/components/SDropdownButton/SDropdownButton.js.map +1 -1
- package/dist/components/SField/SField.cjs +8 -0
- package/dist/components/SField/SField.cjs.map +1 -1
- package/dist/components/SField/SField.js +8 -0
- package/dist/components/SField/SField.js.map +1 -1
- package/dist/components/SFilePicker/SFilePicker.cjs +8 -0
- package/dist/components/SFilePicker/SFilePicker.cjs.map +1 -1
- package/dist/components/SFilePicker/SFilePicker.js +8 -0
- 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 +8 -0
- package/dist/components/SInput/SInput.cjs.map +1 -1
- package/dist/components/SInput/SInput.js +8 -0
- package/dist/components/SInput/SInput.js.map +1 -1
- package/dist/components/SKeyValueTable/SKeyValueTable.cjs +48 -21
- package/dist/components/SKeyValueTable/SKeyValueTable.cjs.map +1 -1
- package/dist/components/SKeyValueTable/SKeyValueTable.js +48 -21
- package/dist/components/SKeyValueTable/SKeyValueTable.js.map +1 -1
- package/dist/components/SLoadingContainer/SLoadingContainer.cjs +3 -3
- package/dist/components/SLoadingContainer/SLoadingContainer.cjs.map +1 -1
- package/dist/components/SLoadingContainer/SLoadingContainer.js +3 -3
- package/dist/components/SLoadingContainer/SLoadingContainer.js.map +1 -1
- package/dist/components/SLoadingContainer/loading.cjs +3 -3
- package/dist/components/SLoadingContainer/loading.cjs.map +1 -1
- package/dist/components/SLoadingContainer/loading.js +3 -3
- package/dist/components/SLoadingContainer/loading.js.map +1 -1
- package/dist/components/SLoadingModal/SLoadingModal.cjs +12 -4
- package/dist/components/SLoadingModal/SLoadingModal.cjs.map +1 -1
- package/dist/components/SLoadingModal/SLoadingModal.js +12 -4
- 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 +8 -0
- package/dist/components/SNumberInput/SNumberInput.cjs.map +1 -1
- package/dist/components/SNumberInput/SNumberInput.js +8 -0
- package/dist/components/SNumberInput/SNumberInput.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 +10 -1
- package/dist/components/SSelect/SSelect.cjs.map +1 -1
- package/dist/components/SSelect/SSelect.js +10 -1
- package/dist/components/SSelect/SSelect.js.map +1 -1
- package/dist/components/STable/STable.cjs +13 -4
- package/dist/components/STable/STable.cjs.map +1 -1
- package/dist/components/STable/STable.js +13 -4
- 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 +8 -0
- package/dist/components/STextarea/STextarea.cjs.map +1 -1
- package/dist/components/STextarea/STextarea.js +8 -0
- 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 +8 -0
- package/dist/components/SToast/SToastContainer.cjs.map +1 -1
- package/dist/components/SToast/SToastContainer.js +8 -0
- package/dist/components/SToast/SToastContainer.js.map +1 -1
- package/dist/components/STooltip/STooltip.cjs +8 -0
- package/dist/components/STooltip/STooltip.cjs.map +1 -1
- package/dist/components/STooltip/STooltip.js +8 -0
- package/dist/components/STooltip/STooltip.js.map +1 -1
- package/dist/index.cjs +119 -59
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +118 -59
- 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 +127 -42
- package/dist/theme.css +45 -20
- package/package.json +1 -1
|
@@ -20,7 +20,7 @@ export interface STextLinkProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'o
|
|
|
20
20
|
disabled?: boolean;
|
|
21
21
|
/** 크기 */
|
|
22
22
|
size?: STextLinkSize;
|
|
23
|
-
/** 호버 시
|
|
23
|
+
/** 호버 시 표시할 툴팁 텍스트 (회색 STag 스타일) */
|
|
24
24
|
tooltipText?: string;
|
|
25
25
|
onClick?: () => void;
|
|
26
26
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { forwardRef } from 'react';
|
|
1
|
+
import { createContext, forwardRef, useContext } from 'react';
|
|
2
|
+
import * as RTooltip from '@radix-ui/react-tooltip';
|
|
2
3
|
import { clsx } from 'clsx';
|
|
3
4
|
import { extendTailwindMerge } from 'tailwind-merge';
|
|
4
5
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
@@ -142,6 +143,31 @@ function resolveColor(input, fallback) {
|
|
|
142
143
|
if (input === null || input === void 0 || input === "") return fallback;
|
|
143
144
|
return isColorKey(input) ? `var(--color-${input.replace(/_/g, "-")})` : input;
|
|
144
145
|
}
|
|
146
|
+
|
|
147
|
+
// src/lib/floating-anim.ts
|
|
148
|
+
var FLOATING_SLIDE_ANIM = [
|
|
149
|
+
"data-[state=open]:data-[side=top]:animate-floating-in-top",
|
|
150
|
+
"data-[state=delayed-open]:data-[side=top]:animate-floating-in-top",
|
|
151
|
+
"data-[state=instant-open]:data-[side=top]:animate-floating-in-top",
|
|
152
|
+
"data-[state=closed]:data-[side=top]:animate-floating-out-top",
|
|
153
|
+
"data-[state=open]:data-[side=bottom]:animate-floating-in-bottom",
|
|
154
|
+
"data-[state=delayed-open]:data-[side=bottom]:animate-floating-in-bottom",
|
|
155
|
+
"data-[state=instant-open]:data-[side=bottom]:animate-floating-in-bottom",
|
|
156
|
+
"data-[state=closed]:data-[side=bottom]:animate-floating-out-bottom",
|
|
157
|
+
"data-[state=open]:data-[side=left]:animate-floating-in-left",
|
|
158
|
+
"data-[state=delayed-open]:data-[side=left]:animate-floating-in-left",
|
|
159
|
+
"data-[state=instant-open]:data-[side=left]:animate-floating-in-left",
|
|
160
|
+
"data-[state=closed]:data-[side=left]:animate-floating-out-left",
|
|
161
|
+
"data-[state=open]:data-[side=right]:animate-floating-in-right",
|
|
162
|
+
"data-[state=delayed-open]:data-[side=right]:animate-floating-in-right",
|
|
163
|
+
"data-[state=instant-open]:data-[side=right]:animate-floating-in-right",
|
|
164
|
+
"data-[state=closed]:data-[side=right]:animate-floating-out-right"
|
|
165
|
+
].join(" ");
|
|
166
|
+
var PortalContainerContext = createContext(null);
|
|
167
|
+
PortalContainerContext.Provider;
|
|
168
|
+
function usePortalContainer() {
|
|
169
|
+
return useContext(PortalContainerContext) ?? void 0;
|
|
170
|
+
}
|
|
145
171
|
var Icon_add = (p) => {
|
|
146
172
|
const { size = 24, ...rest } = p;
|
|
147
173
|
return /* @__PURE__ */ jsx(
|
|
@@ -2849,6 +2875,87 @@ var SIcon = forwardRef(function SIcon2({ name, size = 24, color, rotate, label,
|
|
|
2849
2875
|
}
|
|
2850
2876
|
);
|
|
2851
2877
|
});
|
|
2878
|
+
|
|
2879
|
+
// src/components/STag/tag.config.ts
|
|
2880
|
+
var TAG_SIZE_CONFIG = {
|
|
2881
|
+
xs: {
|
|
2882
|
+
height: 20,
|
|
2883
|
+
paddingX: 8,
|
|
2884
|
+
gap: 4,
|
|
2885
|
+
radius: 6,
|
|
2886
|
+
iconSize: 12,
|
|
2887
|
+
fontSize: 11,
|
|
2888
|
+
fontWeight: 500,
|
|
2889
|
+
lineHeight: 18
|
|
2890
|
+
},
|
|
2891
|
+
sm: {
|
|
2892
|
+
height: 24,
|
|
2893
|
+
paddingX: 8,
|
|
2894
|
+
gap: 4,
|
|
2895
|
+
radius: 6,
|
|
2896
|
+
iconSize: 16,
|
|
2897
|
+
fontSize: 12,
|
|
2898
|
+
fontWeight: 700,
|
|
2899
|
+
lineHeight: 20
|
|
2900
|
+
},
|
|
2901
|
+
md: {
|
|
2902
|
+
height: 28,
|
|
2903
|
+
paddingX: 12,
|
|
2904
|
+
gap: 6,
|
|
2905
|
+
radius: 8,
|
|
2906
|
+
iconSize: 16,
|
|
2907
|
+
fontSize: 14,
|
|
2908
|
+
fontWeight: 700,
|
|
2909
|
+
lineHeight: 24
|
|
2910
|
+
}
|
|
2911
|
+
};
|
|
2912
|
+
var STag = forwardRef(function STag2({
|
|
2913
|
+
shape = "square",
|
|
2914
|
+
size = "sm",
|
|
2915
|
+
color = "grey",
|
|
2916
|
+
label = "",
|
|
2917
|
+
icon,
|
|
2918
|
+
iconLeft = true,
|
|
2919
|
+
width,
|
|
2920
|
+
className,
|
|
2921
|
+
style,
|
|
2922
|
+
...rest
|
|
2923
|
+
}, ref) {
|
|
2924
|
+
const s = TAG_SIZE_CONFIG[size];
|
|
2925
|
+
const contentColor = `var(--cmp-tag-${color}-content)`;
|
|
2926
|
+
const iconNode = icon ? /* @__PURE__ */ jsx(SIcon, { name: icon, size: s.iconSize, color: contentColor }) : null;
|
|
2927
|
+
const resolvedWidth = typeof width === "number" ? `${width}px` : width;
|
|
2928
|
+
return /* @__PURE__ */ jsxs(
|
|
2929
|
+
"span",
|
|
2930
|
+
{
|
|
2931
|
+
ref,
|
|
2932
|
+
"aria-label": label || "tag",
|
|
2933
|
+
className: cn(
|
|
2934
|
+
"box-border inline-flex w-fit select-none items-center justify-center whitespace-nowrap",
|
|
2935
|
+
className
|
|
2936
|
+
),
|
|
2937
|
+
style: {
|
|
2938
|
+
minHeight: s.height,
|
|
2939
|
+
padding: `0 ${s.paddingX}px`,
|
|
2940
|
+
gap: s.gap,
|
|
2941
|
+
borderRadius: shape === "pill" ? 999 : s.radius,
|
|
2942
|
+
fontSize: s.fontSize,
|
|
2943
|
+
fontWeight: s.fontWeight,
|
|
2944
|
+
lineHeight: `${s.lineHeight}px`,
|
|
2945
|
+
background: `var(--cmp-tag-${color}-bg)`,
|
|
2946
|
+
color: contentColor,
|
|
2947
|
+
...resolvedWidth != null ? { width: resolvedWidth } : {},
|
|
2948
|
+
...style
|
|
2949
|
+
},
|
|
2950
|
+
...rest,
|
|
2951
|
+
children: [
|
|
2952
|
+
icon && iconLeft && iconNode,
|
|
2953
|
+
label && /* @__PURE__ */ jsx("span", { className: "inline-flex min-w-0 items-center justify-center", children: label }),
|
|
2954
|
+
icon && !iconLeft && iconNode
|
|
2955
|
+
]
|
|
2956
|
+
}
|
|
2957
|
+
);
|
|
2958
|
+
});
|
|
2852
2959
|
var SIZE_CONFIG = {
|
|
2853
2960
|
sm: {
|
|
2854
2961
|
gap: 4,
|
|
@@ -2882,6 +2989,7 @@ var STextLink = forwardRef(function STextLink2({
|
|
|
2882
2989
|
className,
|
|
2883
2990
|
onClick,
|
|
2884
2991
|
children,
|
|
2992
|
+
style,
|
|
2885
2993
|
...rest
|
|
2886
2994
|
}, ref) {
|
|
2887
2995
|
const s = SIZE_CONFIG[size];
|
|
@@ -2890,13 +2998,13 @@ var STextLink = forwardRef(function STextLink2({
|
|
|
2890
2998
|
const handle = () => {
|
|
2891
2999
|
if (!disabled) onClick?.();
|
|
2892
3000
|
};
|
|
2893
|
-
|
|
3001
|
+
const portalContainer = usePortalContainer();
|
|
3002
|
+
const link = /* @__PURE__ */ jsxs(
|
|
2894
3003
|
"span",
|
|
2895
3004
|
{
|
|
2896
3005
|
ref,
|
|
2897
3006
|
role: "button",
|
|
2898
3007
|
tabIndex: disabled ? -1 : 0,
|
|
2899
|
-
title: tooltipText,
|
|
2900
3008
|
onClick: handle,
|
|
2901
3009
|
onKeyDown: (e) => {
|
|
2902
3010
|
if (e.key === "Enter" || e.key === " ") {
|
|
@@ -2911,7 +3019,7 @@ var STextLink = forwardRef(function STextLink2({
|
|
|
2911
3019
|
disabled && "cursor-not-allowed",
|
|
2912
3020
|
className
|
|
2913
3021
|
),
|
|
2914
|
-
style: { gap: s.gap, color: contentColor },
|
|
3022
|
+
style: { gap: s.gap, color: contentColor, ...style },
|
|
2915
3023
|
...rest,
|
|
2916
3024
|
children: [
|
|
2917
3025
|
icon && /* @__PURE__ */ jsx(SIcon, { name: icon, size: s.iconSize, color: resolvedIconColor }),
|
|
@@ -2934,6 +3042,12 @@ var STextLink = forwardRef(function STextLink2({
|
|
|
2934
3042
|
]
|
|
2935
3043
|
}
|
|
2936
3044
|
);
|
|
3045
|
+
const text = (tooltipText ?? "").trim();
|
|
3046
|
+
if (text === "") return link;
|
|
3047
|
+
return /* @__PURE__ */ jsx(RTooltip.Provider, { delayDuration: 200, children: /* @__PURE__ */ jsxs(RTooltip.Root, { children: [
|
|
3048
|
+
/* @__PURE__ */ jsx(RTooltip.Trigger, { asChild: true, children: link }),
|
|
3049
|
+
/* @__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 }) }) })
|
|
3050
|
+
] }) });
|
|
2937
3051
|
});
|
|
2938
3052
|
|
|
2939
3053
|
export { STextLink };
|