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
|
@@ -1,10 +1,31 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var react = require('react');
|
|
4
|
+
var RTooltip = require('@radix-ui/react-tooltip');
|
|
4
5
|
var clsx = require('clsx');
|
|
5
6
|
var tailwindMerge = require('tailwind-merge');
|
|
6
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
8
|
|
|
9
|
+
function _interopNamespace(e) {
|
|
10
|
+
if (e && e.__esModule) return e;
|
|
11
|
+
var n = Object.create(null);
|
|
12
|
+
if (e) {
|
|
13
|
+
Object.keys(e).forEach(function (k) {
|
|
14
|
+
if (k !== 'default') {
|
|
15
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
16
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return e[k]; }
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
n.default = e;
|
|
24
|
+
return Object.freeze(n);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
var RTooltip__namespace = /*#__PURE__*/_interopNamespace(RTooltip);
|
|
28
|
+
|
|
8
29
|
// src/components/STextLink/STextLink.tsx
|
|
9
30
|
var twMerge = tailwindMerge.extendTailwindMerge({
|
|
10
31
|
extend: {
|
|
@@ -144,6 +165,31 @@ function resolveColor(input, fallback) {
|
|
|
144
165
|
if (input === null || input === void 0 || input === "") return fallback;
|
|
145
166
|
return isColorKey(input) ? `var(--color-${input.replace(/_/g, "-")})` : input;
|
|
146
167
|
}
|
|
168
|
+
|
|
169
|
+
// src/lib/floating-anim.ts
|
|
170
|
+
var FLOATING_SLIDE_ANIM = [
|
|
171
|
+
"data-[state=open]:data-[side=top]:animate-floating-in-top",
|
|
172
|
+
"data-[state=delayed-open]:data-[side=top]:animate-floating-in-top",
|
|
173
|
+
"data-[state=instant-open]:data-[side=top]:animate-floating-in-top",
|
|
174
|
+
"data-[state=closed]:data-[side=top]:animate-floating-out-top",
|
|
175
|
+
"data-[state=open]:data-[side=bottom]:animate-floating-in-bottom",
|
|
176
|
+
"data-[state=delayed-open]:data-[side=bottom]:animate-floating-in-bottom",
|
|
177
|
+
"data-[state=instant-open]:data-[side=bottom]:animate-floating-in-bottom",
|
|
178
|
+
"data-[state=closed]:data-[side=bottom]:animate-floating-out-bottom",
|
|
179
|
+
"data-[state=open]:data-[side=left]:animate-floating-in-left",
|
|
180
|
+
"data-[state=delayed-open]:data-[side=left]:animate-floating-in-left",
|
|
181
|
+
"data-[state=instant-open]:data-[side=left]:animate-floating-in-left",
|
|
182
|
+
"data-[state=closed]:data-[side=left]:animate-floating-out-left",
|
|
183
|
+
"data-[state=open]:data-[side=right]:animate-floating-in-right",
|
|
184
|
+
"data-[state=delayed-open]:data-[side=right]:animate-floating-in-right",
|
|
185
|
+
"data-[state=instant-open]:data-[side=right]:animate-floating-in-right",
|
|
186
|
+
"data-[state=closed]:data-[side=right]:animate-floating-out-right"
|
|
187
|
+
].join(" ");
|
|
188
|
+
var PortalContainerContext = react.createContext(null);
|
|
189
|
+
PortalContainerContext.Provider;
|
|
190
|
+
function usePortalContainer() {
|
|
191
|
+
return react.useContext(PortalContainerContext) ?? void 0;
|
|
192
|
+
}
|
|
147
193
|
var Icon_add = (p) => {
|
|
148
194
|
const { size = 24, ...rest } = p;
|
|
149
195
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2851,6 +2897,87 @@ var SIcon = react.forwardRef(function SIcon2({ name, size = 24, color, rotate, l
|
|
|
2851
2897
|
}
|
|
2852
2898
|
);
|
|
2853
2899
|
});
|
|
2900
|
+
|
|
2901
|
+
// src/components/STag/tag.config.ts
|
|
2902
|
+
var TAG_SIZE_CONFIG = {
|
|
2903
|
+
xs: {
|
|
2904
|
+
height: 20,
|
|
2905
|
+
paddingX: 8,
|
|
2906
|
+
gap: 4,
|
|
2907
|
+
radius: 6,
|
|
2908
|
+
iconSize: 12,
|
|
2909
|
+
fontSize: 11,
|
|
2910
|
+
fontWeight: 500,
|
|
2911
|
+
lineHeight: 18
|
|
2912
|
+
},
|
|
2913
|
+
sm: {
|
|
2914
|
+
height: 24,
|
|
2915
|
+
paddingX: 8,
|
|
2916
|
+
gap: 4,
|
|
2917
|
+
radius: 6,
|
|
2918
|
+
iconSize: 16,
|
|
2919
|
+
fontSize: 12,
|
|
2920
|
+
fontWeight: 700,
|
|
2921
|
+
lineHeight: 20
|
|
2922
|
+
},
|
|
2923
|
+
md: {
|
|
2924
|
+
height: 28,
|
|
2925
|
+
paddingX: 12,
|
|
2926
|
+
gap: 6,
|
|
2927
|
+
radius: 8,
|
|
2928
|
+
iconSize: 16,
|
|
2929
|
+
fontSize: 14,
|
|
2930
|
+
fontWeight: 700,
|
|
2931
|
+
lineHeight: 24
|
|
2932
|
+
}
|
|
2933
|
+
};
|
|
2934
|
+
var STag = react.forwardRef(function STag2({
|
|
2935
|
+
shape = "square",
|
|
2936
|
+
size = "sm",
|
|
2937
|
+
color = "grey",
|
|
2938
|
+
label = "",
|
|
2939
|
+
icon,
|
|
2940
|
+
iconLeft = true,
|
|
2941
|
+
width,
|
|
2942
|
+
className,
|
|
2943
|
+
style,
|
|
2944
|
+
...rest
|
|
2945
|
+
}, ref) {
|
|
2946
|
+
const s = TAG_SIZE_CONFIG[size];
|
|
2947
|
+
const contentColor = `var(--cmp-tag-${color}-content)`;
|
|
2948
|
+
const iconNode = icon ? /* @__PURE__ */ jsxRuntime.jsx(SIcon, { name: icon, size: s.iconSize, color: contentColor }) : null;
|
|
2949
|
+
const resolvedWidth = typeof width === "number" ? `${width}px` : width;
|
|
2950
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2951
|
+
"span",
|
|
2952
|
+
{
|
|
2953
|
+
ref,
|
|
2954
|
+
"aria-label": label || "tag",
|
|
2955
|
+
className: cn(
|
|
2956
|
+
"box-border inline-flex w-fit select-none items-center justify-center whitespace-nowrap",
|
|
2957
|
+
className
|
|
2958
|
+
),
|
|
2959
|
+
style: {
|
|
2960
|
+
minHeight: s.height,
|
|
2961
|
+
padding: `0 ${s.paddingX}px`,
|
|
2962
|
+
gap: s.gap,
|
|
2963
|
+
borderRadius: shape === "pill" ? 999 : s.radius,
|
|
2964
|
+
fontSize: s.fontSize,
|
|
2965
|
+
fontWeight: s.fontWeight,
|
|
2966
|
+
lineHeight: `${s.lineHeight}px`,
|
|
2967
|
+
background: `var(--cmp-tag-${color}-bg)`,
|
|
2968
|
+
color: contentColor,
|
|
2969
|
+
...resolvedWidth != null ? { width: resolvedWidth } : {},
|
|
2970
|
+
...style
|
|
2971
|
+
},
|
|
2972
|
+
...rest,
|
|
2973
|
+
children: [
|
|
2974
|
+
icon && iconLeft && iconNode,
|
|
2975
|
+
label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex min-w-0 items-center justify-center", children: label }),
|
|
2976
|
+
icon && !iconLeft && iconNode
|
|
2977
|
+
]
|
|
2978
|
+
}
|
|
2979
|
+
);
|
|
2980
|
+
});
|
|
2854
2981
|
var SIZE_CONFIG = {
|
|
2855
2982
|
sm: {
|
|
2856
2983
|
gap: 4,
|
|
@@ -2884,6 +3011,7 @@ var STextLink = react.forwardRef(function STextLink2({
|
|
|
2884
3011
|
className,
|
|
2885
3012
|
onClick,
|
|
2886
3013
|
children,
|
|
3014
|
+
style,
|
|
2887
3015
|
...rest
|
|
2888
3016
|
}, ref) {
|
|
2889
3017
|
const s = SIZE_CONFIG[size];
|
|
@@ -2892,13 +3020,13 @@ var STextLink = react.forwardRef(function STextLink2({
|
|
|
2892
3020
|
const handle = () => {
|
|
2893
3021
|
if (!disabled) onClick?.();
|
|
2894
3022
|
};
|
|
2895
|
-
|
|
3023
|
+
const portalContainer = usePortalContainer();
|
|
3024
|
+
const link = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2896
3025
|
"span",
|
|
2897
3026
|
{
|
|
2898
3027
|
ref,
|
|
2899
3028
|
role: "button",
|
|
2900
3029
|
tabIndex: disabled ? -1 : 0,
|
|
2901
|
-
title: tooltipText,
|
|
2902
3030
|
onClick: handle,
|
|
2903
3031
|
onKeyDown: (e) => {
|
|
2904
3032
|
if (e.key === "Enter" || e.key === " ") {
|
|
@@ -2913,7 +3041,7 @@ var STextLink = react.forwardRef(function STextLink2({
|
|
|
2913
3041
|
disabled && "cursor-not-allowed",
|
|
2914
3042
|
className
|
|
2915
3043
|
),
|
|
2916
|
-
style: { gap: s.gap, color: contentColor },
|
|
3044
|
+
style: { gap: s.gap, color: contentColor, ...style },
|
|
2917
3045
|
...rest,
|
|
2918
3046
|
children: [
|
|
2919
3047
|
icon && /* @__PURE__ */ jsxRuntime.jsx(SIcon, { name: icon, size: s.iconSize, color: resolvedIconColor }),
|
|
@@ -2936,6 +3064,12 @@ var STextLink = react.forwardRef(function STextLink2({
|
|
|
2936
3064
|
]
|
|
2937
3065
|
}
|
|
2938
3066
|
);
|
|
3067
|
+
const text = (tooltipText ?? "").trim();
|
|
3068
|
+
if (text === "") return link;
|
|
3069
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RTooltip__namespace.Provider, { delayDuration: 200, children: /* @__PURE__ */ jsxRuntime.jsxs(RTooltip__namespace.Root, { children: [
|
|
3070
|
+
/* @__PURE__ */ jsxRuntime.jsx(RTooltip__namespace.Trigger, { asChild: true, children: link }),
|
|
3071
|
+
/* @__PURE__ */ jsxRuntime.jsx(RTooltip__namespace.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxRuntime.jsx(RTooltip__namespace.Content, { side: "top", sideOffset: 4, className: cn("z-50", FLOATING_SLIDE_ANIM), children: /* @__PURE__ */ jsxRuntime.jsx(STag, { shape: "square", size: "xs", color: "grey", label: text }) }) })
|
|
3072
|
+
] }) });
|
|
2939
3073
|
});
|
|
2940
3074
|
|
|
2941
3075
|
exports.STextLink = STextLink;
|