sellmate-design-system-react 0.1.9 → 0.1.11
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 +3 -1
- package/dist/components/SActionModal/SActionModal.cjs.map +1 -1
- package/dist/components/SActionModal/SActionModal.js +3 -1
- package/dist/components/SActionModal/SActionModal.js.map +1 -1
- package/dist/components/SBarcodeInput/SBarcodeInput.cjs +16 -3
- package/dist/components/SBarcodeInput/SBarcodeInput.cjs.map +1 -1
- package/dist/components/SBarcodeInput/SBarcodeInput.d.ts +3 -1
- package/dist/components/SBarcodeInput/SBarcodeInput.js +16 -3
- package/dist/components/SBarcodeInput/SBarcodeInput.js.map +1 -1
- package/dist/components/SCalendar/SCalendar.cjs +2 -0
- package/dist/components/SCalendar/SCalendar.cjs.map +1 -1
- package/dist/components/SCalendar/SCalendar.js +2 -0
- package/dist/components/SCalendar/SCalendar.js.map +1 -1
- package/dist/components/SChip/SChip.cjs +2 -0
- package/dist/components/SChip/SChip.cjs.map +1 -1
- package/dist/components/SChip/SChip.js +2 -0
- package/dist/components/SChip/SChip.js.map +1 -1
- package/dist/components/SChipInput/SChipInput.cjs +22 -4
- package/dist/components/SChipInput/SChipInput.cjs.map +1 -1
- package/dist/components/SChipInput/SChipInput.d.ts +5 -0
- package/dist/components/SChipInput/SChipInput.js +22 -4
- package/dist/components/SChipInput/SChipInput.js.map +1 -1
- package/dist/components/SChipInput/index.d.ts +1 -1
- package/dist/components/SCircleProgress/SCircleProgress.cjs +69 -50
- package/dist/components/SCircleProgress/SCircleProgress.cjs.map +1 -1
- package/dist/components/SCircleProgress/SCircleProgress.d.ts +2 -0
- package/dist/components/SCircleProgress/SCircleProgress.js +69 -50
- package/dist/components/SCircleProgress/SCircleProgress.js.map +1 -1
- package/dist/components/SConfirmModal/SConfirmModal.cjs +13 -10
- package/dist/components/SConfirmModal/SConfirmModal.cjs.map +1 -1
- package/dist/components/SConfirmModal/SConfirmModal.d.ts +7 -4
- package/dist/components/SConfirmModal/SConfirmModal.js +13 -10
- package/dist/components/SConfirmModal/SConfirmModal.js.map +1 -1
- package/dist/components/SDatePicker/SDatePicker.cjs +16 -3
- package/dist/components/SDatePicker/SDatePicker.cjs.map +1 -1
- package/dist/components/SDatePicker/SDatePicker.d.ts +3 -1
- package/dist/components/SDatePicker/SDatePicker.js +16 -3
- package/dist/components/SDatePicker/SDatePicker.js.map +1 -1
- package/dist/components/SDateRangePicker/SDateRangePicker.cjs +16 -3
- package/dist/components/SDateRangePicker/SDateRangePicker.cjs.map +1 -1
- package/dist/components/SDateRangePicker/SDateRangePicker.d.ts +3 -1
- package/dist/components/SDateRangePicker/SDateRangePicker.js +16 -3
- package/dist/components/SDateRangePicker/SDateRangePicker.js.map +1 -1
- package/dist/components/SDropdownButton/SDropdownButton.cjs +2 -0
- package/dist/components/SDropdownButton/SDropdownButton.cjs.map +1 -1
- package/dist/components/SDropdownButton/SDropdownButton.js +2 -0
- package/dist/components/SDropdownButton/SDropdownButton.js.map +1 -1
- package/dist/components/SField/SField.cjs +14 -3
- package/dist/components/SField/SField.cjs.map +1 -1
- package/dist/components/SField/SField.d.ts +4 -1
- package/dist/components/SField/SField.js +14 -3
- package/dist/components/SField/SField.js.map +1 -1
- package/dist/components/SFilePicker/SFilePicker.cjs +51 -19
- package/dist/components/SFilePicker/SFilePicker.cjs.map +1 -1
- package/dist/components/SFilePicker/SFilePicker.d.ts +4 -2
- package/dist/components/SFilePicker/SFilePicker.js +50 -19
- package/dist/components/SFilePicker/SFilePicker.js.map +1 -1
- package/dist/components/SGhostButton/SGhostButton.cjs +2 -0
- package/dist/components/SGhostButton/SGhostButton.cjs.map +1 -1
- package/dist/components/SGhostButton/SGhostButton.js +2 -0
- package/dist/components/SGhostButton/SGhostButton.js.map +1 -1
- package/dist/components/SGuide/SGuide.cjs +2 -0
- package/dist/components/SGuide/SGuide.cjs.map +1 -1
- package/dist/components/SGuide/SGuide.js +2 -0
- package/dist/components/SGuide/SGuide.js.map +1 -1
- package/dist/components/SInput/SInput.cjs +16 -3
- package/dist/components/SInput/SInput.cjs.map +1 -1
- package/dist/components/SInput/SInput.d.ts +4 -1
- package/dist/components/SInput/SInput.js +16 -3
- package/dist/components/SInput/SInput.js.map +1 -1
- package/dist/components/SKeyValueTable/SKeyValueTable.cjs +530 -219
- package/dist/components/SKeyValueTable/SKeyValueTable.cjs.map +1 -1
- package/dist/components/SKeyValueTable/SKeyValueTable.d.ts +27 -6
- package/dist/components/SKeyValueTable/SKeyValueTable.js +529 -218
- package/dist/components/SKeyValueTable/SKeyValueTable.js.map +1 -1
- package/dist/components/SLoadingContainer/SLoadingContainer.cjs +69 -50
- package/dist/components/SLoadingContainer/SLoadingContainer.cjs.map +1 -1
- package/dist/components/SLoadingContainer/SLoadingContainer.js +69 -50
- package/dist/components/SLoadingContainer/SLoadingContainer.js.map +1 -1
- package/dist/components/SLoadingContainer/loading.cjs +69 -50
- package/dist/components/SLoadingContainer/loading.cjs.map +1 -1
- package/dist/components/SLoadingContainer/loading.js +69 -50
- package/dist/components/SLoadingContainer/loading.js.map +1 -1
- package/dist/components/SLoadingModal/SLoadingModal.cjs +75 -51
- package/dist/components/SLoadingModal/SLoadingModal.cjs.map +1 -1
- package/dist/components/SLoadingModal/SLoadingModal.d.ts +3 -1
- package/dist/components/SLoadingModal/SLoadingModal.js +75 -51
- package/dist/components/SLoadingModal/SLoadingModal.js.map +1 -1
- package/dist/components/SModalContainer/SModalContainer.cjs +3 -1
- package/dist/components/SModalContainer/SModalContainer.cjs.map +1 -1
- package/dist/components/SModalContainer/SModalContainer.js +3 -1
- package/dist/components/SModalContainer/SModalContainer.js.map +1 -1
- package/dist/components/SNumberInput/SNumberInput.cjs +16 -3
- package/dist/components/SNumberInput/SNumberInput.cjs.map +1 -1
- package/dist/components/SNumberInput/SNumberInput.d.ts +2 -0
- package/dist/components/SNumberInput/SNumberInput.js +16 -3
- package/dist/components/SNumberInput/SNumberInput.js.map +1 -1
- package/dist/components/SPopover/SPopover.cjs +2 -0
- package/dist/components/SPopover/SPopover.cjs.map +1 -1
- package/dist/components/SPopover/SPopover.js +2 -0
- package/dist/components/SPopover/SPopover.js.map +1 -1
- package/dist/components/SPortal/SPortal.cjs +2 -0
- package/dist/components/SPortal/SPortal.cjs.map +1 -1
- package/dist/components/SPortal/SPortal.js +2 -0
- package/dist/components/SPortal/SPortal.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 +530 -258
- package/dist/components/SSelect/SSelect.cjs.map +1 -1
- package/dist/components/SSelect/SSelect.d.ts +4 -2
- package/dist/components/SSelect/SSelect.js +531 -258
- package/dist/components/SSelect/SSelect.js.map +1 -1
- package/dist/components/STable/STable.cjs +603 -309
- package/dist/components/STable/STable.cjs.map +1 -1
- package/dist/components/STable/STable.js +604 -309
- package/dist/components/STable/STable.js.map +1 -1
- package/dist/components/STextLink/STextLink.cjs +2 -0
- package/dist/components/STextLink/STextLink.cjs.map +1 -1
- package/dist/components/STextLink/STextLink.js +2 -0
- package/dist/components/STextLink/STextLink.js.map +1 -1
- package/dist/components/STextarea/STextarea.cjs +16 -3
- package/dist/components/STextarea/STextarea.cjs.map +1 -1
- package/dist/components/STextarea/STextarea.d.ts +2 -0
- package/dist/components/STextarea/STextarea.js +16 -3
- package/dist/components/STextarea/STextarea.js.map +1 -1
- package/dist/components/SToast/SToast.cjs +2 -0
- package/dist/components/SToast/SToast.cjs.map +1 -1
- package/dist/components/SToast/SToast.js +2 -0
- package/dist/components/SToast/SToast.js.map +1 -1
- package/dist/components/SToast/SToastContainer.cjs +2 -0
- package/dist/components/SToast/SToastContainer.cjs.map +1 -1
- package/dist/components/SToast/SToastContainer.js +2 -0
- package/dist/components/SToast/SToastContainer.js.map +1 -1
- package/dist/components/STooltip/STooltip.cjs +3 -1
- package/dist/components/STooltip/STooltip.cjs.map +1 -1
- package/dist/components/STooltip/STooltip.js +3 -1
- package/dist/components/STooltip/STooltip.js.map +1 -1
- package/dist/index.cjs +522 -248
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +523 -248
- package/dist/index.js.map +1 -1
- package/dist/lib/portal-container.d.ts +7 -0
- package/dist/styles.css +123 -58
- package/dist/theme.css +45 -21
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var react = require('react');
|
|
5
|
+
var Ariakit = require('@ariakit/react');
|
|
5
6
|
var clsx = require('clsx');
|
|
6
7
|
var tailwindMerge = require('tailwind-merge');
|
|
7
8
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -25,6 +26,7 @@ function _interopNamespace(e) {
|
|
|
25
26
|
return Object.freeze(n);
|
|
26
27
|
}
|
|
27
28
|
|
|
29
|
+
var Ariakit__namespace = /*#__PURE__*/_interopNamespace(Ariakit);
|
|
28
30
|
var RPopover2__namespace = /*#__PURE__*/_interopNamespace(RPopover2);
|
|
29
31
|
|
|
30
32
|
var twMerge = tailwindMerge.extendTailwindMerge({
|
|
@@ -2893,7 +2895,9 @@ var FLOATING_SLIDE_ANIM = [
|
|
|
2893
2895
|
"data-[state=closed]:data-[side=right]:animate-floating-out-right"
|
|
2894
2896
|
].join(" ");
|
|
2895
2897
|
var PortalContainerContext = react.createContext(null);
|
|
2898
|
+
var InsideModalContext = react.createContext(false);
|
|
2896
2899
|
PortalContainerContext.Provider;
|
|
2900
|
+
InsideModalContext.Provider;
|
|
2897
2901
|
function usePortalContainer() {
|
|
2898
2902
|
return react.useContext(PortalContainerContext) ?? void 0;
|
|
2899
2903
|
}
|
|
@@ -3148,7 +3152,7 @@ var STooltip = react.forwardRef(function STooltip2({
|
|
|
3148
3152
|
if (disabled || body == null) return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: triggerNode });
|
|
3149
3153
|
const isHover = trigger === "hover";
|
|
3150
3154
|
const contentClass = cn(
|
|
3151
|
-
"z-50 max-w-xs rounded-[6px] px-[16px] py-[12px] text-[12px] leading-[20px]
|
|
3155
|
+
"z-50 max-w-xs rounded-[6px] px-[16px] py-[12px] text-[12px] leading-[20px]",
|
|
3152
3156
|
FLOATING_SLIDE_ANIM,
|
|
3153
3157
|
className
|
|
3154
3158
|
);
|
|
@@ -3254,6 +3258,7 @@ var SField = react.forwardRef(function SField2({
|
|
|
3254
3258
|
name,
|
|
3255
3259
|
label = "",
|
|
3256
3260
|
icon,
|
|
3261
|
+
iconColor,
|
|
3257
3262
|
labelTooltip = "",
|
|
3258
3263
|
labelTooltipProps,
|
|
3259
3264
|
labelWidth,
|
|
@@ -3331,7 +3336,15 @@ var SField = react.forwardRef(function SField2({
|
|
|
3331
3336
|
lineHeight: `${s.lineHeight}px`
|
|
3332
3337
|
},
|
|
3333
3338
|
children: [
|
|
3334
|
-
icon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3339
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3340
|
+
SIcon,
|
|
3341
|
+
{
|
|
3342
|
+
name: icon,
|
|
3343
|
+
size: s.icon,
|
|
3344
|
+
color: iconColor,
|
|
3345
|
+
style: { marginRight: s.labelGap }
|
|
3346
|
+
}
|
|
3347
|
+
),
|
|
3335
3348
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap", children: label }),
|
|
3336
3349
|
(labelTooltip !== "" || labelTooltipProps) && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0", style: { marginLeft: s.labelGap }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3337
3350
|
STooltip,
|
|
@@ -3381,7 +3394,7 @@ var SField = react.forwardRef(function SField2({
|
|
|
3381
3394
|
borderBottomLeftRadius: s.radius - 1
|
|
3382
3395
|
},
|
|
3383
3396
|
children: [
|
|
3384
|
-
icon && !label && /* @__PURE__ */ jsxRuntime.jsx(SIcon, { name: icon, size: s.icon }),
|
|
3397
|
+
icon && !label && /* @__PURE__ */ jsxRuntime.jsx(SIcon, { name: icon, size: s.icon, color: iconColor }),
|
|
3385
3398
|
effectiveAddonLabel
|
|
3386
3399
|
]
|
|
3387
3400
|
}
|
|
@@ -3566,6 +3579,7 @@ function SFilePicker({
|
|
|
3566
3579
|
label,
|
|
3567
3580
|
labelWidth,
|
|
3568
3581
|
icon,
|
|
3582
|
+
iconColor,
|
|
3569
3583
|
labelTooltip,
|
|
3570
3584
|
labelTooltipProps,
|
|
3571
3585
|
addonLabel,
|
|
@@ -3580,7 +3594,10 @@ function SFilePicker({
|
|
|
3580
3594
|
const autoId = react.useId();
|
|
3581
3595
|
const resolvedName = name ?? autoId;
|
|
3582
3596
|
const inputRef = react.useRef(null);
|
|
3597
|
+
const contentBoxRef = react.useRef(null);
|
|
3583
3598
|
const [ruleError, setRuleError] = react.useState("");
|
|
3599
|
+
const [listOpen, setListOpen] = react.useState(false);
|
|
3600
|
+
const portalContainer = usePortalContainer();
|
|
3584
3601
|
const files = multiple ? Array.isArray(value) ? value : [] : value && !Array.isArray(value) ? value : null;
|
|
3585
3602
|
const hasFiles = multiple ? files.length > 0 : !!files;
|
|
3586
3603
|
const displayText = !hasFiles ? placeholder : multiple ? files.map((f) => f.name).join(", ") : files.name;
|
|
@@ -3634,10 +3651,12 @@ function SFilePicker({
|
|
|
3634
3651
|
e.stopPropagation();
|
|
3635
3652
|
if (disabled) return;
|
|
3636
3653
|
onValueChange?.(multiple ? [] : null);
|
|
3654
|
+
setListOpen(false);
|
|
3637
3655
|
};
|
|
3638
3656
|
const removeChip = (i) => {
|
|
3639
3657
|
const next = files.filter((_, idx) => idx !== i);
|
|
3640
3658
|
onValueChange?.(next);
|
|
3659
|
+
if (next.length === 0) setListOpen(false);
|
|
3641
3660
|
};
|
|
3642
3661
|
const open = () => {
|
|
3643
3662
|
if (!disabled) inputRef.current?.click();
|
|
@@ -3648,9 +3667,12 @@ function SFilePicker({
|
|
|
3648
3667
|
const iconSize = size === "md" ? 20 : 16;
|
|
3649
3668
|
const gapCls = size === "md" ? "gap-[var(--cmp-filepicker-md-gap)]" : "gap-[var(--cmp-filepicker-sm-gap)]";
|
|
3650
3669
|
const inlinePlaceholder = inline && !disabled && !hasFiles;
|
|
3651
|
-
const
|
|
3670
|
+
const showListbox = multiple && useMultipleListBox;
|
|
3671
|
+
const filesArr = multiple ? files : [];
|
|
3672
|
+
const contentInner = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3652
3673
|
"div",
|
|
3653
3674
|
{
|
|
3675
|
+
ref: contentBoxRef,
|
|
3654
3676
|
className: cn("group/filepicker flex h-full w-full items-center", gapCls),
|
|
3655
3677
|
style: { padding: inline ? 0 : `0 ${padX}` },
|
|
3656
3678
|
children: [
|
|
@@ -3705,25 +3727,34 @@ function SFilePicker({
|
|
|
3705
3727
|
]
|
|
3706
3728
|
}
|
|
3707
3729
|
),
|
|
3730
|
+
showListbox && hasFiles && !disabled && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3731
|
+
Ariakit__namespace.PopoverDisclosure,
|
|
3732
|
+
{
|
|
3733
|
+
render: /* @__PURE__ */ jsxRuntime.jsx(SGhostButton, { icon: "caretDown", size: "xxs", ariaLabel: "toggle file list" }),
|
|
3734
|
+
className: cn("shrink-0 transition-transform duration-150", listOpen && "rotate-180")
|
|
3735
|
+
}
|
|
3736
|
+
),
|
|
3708
3737
|
!disabled && hasFiles && /* @__PURE__ */ jsxRuntime.jsx(SGhostButton, { icon: "close", size: "xxs", ariaLabel: "clear", onClick: clear })
|
|
3709
3738
|
]
|
|
3710
3739
|
}
|
|
3711
3740
|
);
|
|
3712
|
-
const
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3741
|
+
const content = showListbox ? /* @__PURE__ */ jsxRuntime.jsxs(Ariakit__namespace.PopoverProvider, { open: listOpen, setOpen: setListOpen, placement: "bottom-start", children: [
|
|
3742
|
+
contentInner,
|
|
3743
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3744
|
+
Ariakit__namespace.Popover,
|
|
3745
|
+
{
|
|
3746
|
+
portal: true,
|
|
3747
|
+
portalElement: portalContainer,
|
|
3748
|
+
gutter: 4,
|
|
3749
|
+
unmountOnHide: true,
|
|
3750
|
+
getAnchorRect: () => contentBoxRef.current?.getBoundingClientRect() ?? null,
|
|
3751
|
+
style: { minWidth: contentBoxRef.current?.offsetWidth },
|
|
3752
|
+
className: "z-50 box-border flex flex-col items-start gap-[8px] rounded-[var(--cmp-listBox-radius)] bg-[var(--cmp-listBox-bg)] p-[8px] shadow-[2px_2px_12px_2px_rgba(0,0,0,0.1)]",
|
|
3753
|
+
children: filesArr.map((f, i) => /* @__PURE__ */ jsxRuntime.jsx(SChip, { value: f.name, editable: false, onRemove: () => removeChip(i) }, i))
|
|
3754
|
+
}
|
|
3755
|
+
)
|
|
3756
|
+
] }) : contentInner;
|
|
3757
|
+
const chips = multiple && !useMultipleListBox && filesArr.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-[8px] flex flex-wrap gap-[8px]", children: filesArr.map((f, i) => /* @__PURE__ */ jsxRuntime.jsx(SChip, { value: f.name, editable: false, onRemove: () => removeChip(i) }, i)) });
|
|
3727
3758
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, style, children: [
|
|
3728
3759
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3729
3760
|
SField,
|
|
@@ -3732,6 +3763,7 @@ function SFilePicker({
|
|
|
3732
3763
|
label,
|
|
3733
3764
|
labelWidth,
|
|
3734
3765
|
icon,
|
|
3766
|
+
iconColor,
|
|
3735
3767
|
labelTooltip,
|
|
3736
3768
|
labelTooltipProps,
|
|
3737
3769
|
addonLabel,
|