sellmate-design-system-react 0.1.9 → 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/SBarcodeInput/SBarcodeInput.cjs +1 -1
- package/dist/components/SBarcodeInput/SBarcodeInput.cjs.map +1 -1
- package/dist/components/SBarcodeInput/SBarcodeInput.js +1 -1
- package/dist/components/SBarcodeInput/SBarcodeInput.js.map +1 -1
- package/dist/components/SChipInput/SChipInput.cjs +1 -1
- package/dist/components/SChipInput/SChipInput.cjs.map +1 -1
- package/dist/components/SChipInput/SChipInput.js +1 -1
- package/dist/components/SChipInput/SChipInput.js.map +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/SDatePicker/SDatePicker.cjs +1 -1
- package/dist/components/SDatePicker/SDatePicker.cjs.map +1 -1
- package/dist/components/SDatePicker/SDatePicker.js +1 -1
- package/dist/components/SDatePicker/SDatePicker.js.map +1 -1
- package/dist/components/SDateRangePicker/SDateRangePicker.cjs +1 -1
- package/dist/components/SDateRangePicker/SDateRangePicker.cjs.map +1 -1
- package/dist/components/SDateRangePicker/SDateRangePicker.js +1 -1
- package/dist/components/SDateRangePicker/SDateRangePicker.js.map +1 -1
- package/dist/components/SField/SField.cjs +1 -1
- package/dist/components/SField/SField.cjs.map +1 -1
- package/dist/components/SField/SField.js +1 -1
- package/dist/components/SField/SField.js.map +1 -1
- package/dist/components/SFilePicker/SFilePicker.cjs +36 -17
- package/dist/components/SFilePicker/SFilePicker.cjs.map +1 -1
- package/dist/components/SFilePicker/SFilePicker.d.ts +1 -1
- package/dist/components/SFilePicker/SFilePicker.js +35 -17
- package/dist/components/SFilePicker/SFilePicker.js.map +1 -1
- package/dist/components/SInput/SInput.cjs +1 -1
- package/dist/components/SInput/SInput.cjs.map +1 -1
- package/dist/components/SInput/SInput.js +1 -1
- package/dist/components/SInput/SInput.js.map +1 -1
- package/dist/components/SKeyValueTable/SKeyValueTable.cjs +43 -22
- package/dist/components/SKeyValueTable/SKeyValueTable.cjs.map +1 -1
- package/dist/components/SKeyValueTable/SKeyValueTable.js +43 -22
- 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 +72 -50
- package/dist/components/SLoadingModal/SLoadingModal.cjs.map +1 -1
- package/dist/components/SLoadingModal/SLoadingModal.d.ts +3 -1
- package/dist/components/SLoadingModal/SLoadingModal.js +72 -50
- package/dist/components/SLoadingModal/SLoadingModal.js.map +1 -1
- package/dist/components/SNumberInput/SNumberInput.cjs +1 -1
- package/dist/components/SNumberInput/SNumberInput.cjs.map +1 -1
- package/dist/components/SNumberInput/SNumberInput.js +1 -1
- package/dist/components/SNumberInput/SNumberInput.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 +8 -4
- package/dist/components/SSelect/SSelect.cjs.map +1 -1
- package/dist/components/SSelect/SSelect.js +8 -4
- package/dist/components/SSelect/SSelect.js.map +1 -1
- package/dist/components/STable/STable.cjs +82 -56
- package/dist/components/STable/STable.cjs.map +1 -1
- package/dist/components/STable/STable.js +82 -56
- package/dist/components/STable/STable.js.map +1 -1
- package/dist/components/STextarea/STextarea.cjs +1 -1
- package/dist/components/STextarea/STextarea.cjs.map +1 -1
- package/dist/components/STextarea/STextarea.js +1 -1
- package/dist/components/STextarea/STextarea.js.map +1 -1
- package/dist/components/STooltip/STooltip.cjs +1 -1
- package/dist/components/STooltip/STooltip.cjs.map +1 -1
- package/dist/components/STooltip/STooltip.js +1 -1
- package/dist/components/STooltip/STooltip.js.map +1 -1
- package/dist/index.cjs +120 -74
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +120 -74
- package/dist/index.js.map +1 -1
- package/dist/styles.css +62 -21
- 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({
|
|
@@ -3148,7 +3150,7 @@ var STooltip = react.forwardRef(function STooltip2({
|
|
|
3148
3150
|
if (disabled || body == null) return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: triggerNode });
|
|
3149
3151
|
const isHover = trigger === "hover";
|
|
3150
3152
|
const contentClass = cn(
|
|
3151
|
-
"z-50 max-w-xs rounded-[6px] px-[16px] py-[12px] text-[12px] leading-[20px]
|
|
3153
|
+
"z-50 max-w-xs rounded-[6px] px-[16px] py-[12px] text-[12px] leading-[20px]",
|
|
3152
3154
|
FLOATING_SLIDE_ANIM,
|
|
3153
3155
|
className
|
|
3154
3156
|
);
|
|
@@ -3580,7 +3582,10 @@ function SFilePicker({
|
|
|
3580
3582
|
const autoId = react.useId();
|
|
3581
3583
|
const resolvedName = name ?? autoId;
|
|
3582
3584
|
const inputRef = react.useRef(null);
|
|
3585
|
+
const contentBoxRef = react.useRef(null);
|
|
3583
3586
|
const [ruleError, setRuleError] = react.useState("");
|
|
3587
|
+
const [listOpen, setListOpen] = react.useState(false);
|
|
3588
|
+
const portalContainer = usePortalContainer();
|
|
3584
3589
|
const files = multiple ? Array.isArray(value) ? value : [] : value && !Array.isArray(value) ? value : null;
|
|
3585
3590
|
const hasFiles = multiple ? files.length > 0 : !!files;
|
|
3586
3591
|
const displayText = !hasFiles ? placeholder : multiple ? files.map((f) => f.name).join(", ") : files.name;
|
|
@@ -3634,10 +3639,12 @@ function SFilePicker({
|
|
|
3634
3639
|
e.stopPropagation();
|
|
3635
3640
|
if (disabled) return;
|
|
3636
3641
|
onValueChange?.(multiple ? [] : null);
|
|
3642
|
+
setListOpen(false);
|
|
3637
3643
|
};
|
|
3638
3644
|
const removeChip = (i) => {
|
|
3639
3645
|
const next = files.filter((_, idx) => idx !== i);
|
|
3640
3646
|
onValueChange?.(next);
|
|
3647
|
+
if (next.length === 0) setListOpen(false);
|
|
3641
3648
|
};
|
|
3642
3649
|
const open = () => {
|
|
3643
3650
|
if (!disabled) inputRef.current?.click();
|
|
@@ -3648,9 +3655,12 @@ function SFilePicker({
|
|
|
3648
3655
|
const iconSize = size === "md" ? 20 : 16;
|
|
3649
3656
|
const gapCls = size === "md" ? "gap-[var(--cmp-filepicker-md-gap)]" : "gap-[var(--cmp-filepicker-sm-gap)]";
|
|
3650
3657
|
const inlinePlaceholder = inline && !disabled && !hasFiles;
|
|
3651
|
-
const
|
|
3658
|
+
const showListbox = multiple && useMultipleListBox;
|
|
3659
|
+
const filesArr = multiple ? files : [];
|
|
3660
|
+
const contentInner = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3652
3661
|
"div",
|
|
3653
3662
|
{
|
|
3663
|
+
ref: contentBoxRef,
|
|
3654
3664
|
className: cn("group/filepicker flex h-full w-full items-center", gapCls),
|
|
3655
3665
|
style: { padding: inline ? 0 : `0 ${padX}` },
|
|
3656
3666
|
children: [
|
|
@@ -3705,25 +3715,34 @@ function SFilePicker({
|
|
|
3705
3715
|
]
|
|
3706
3716
|
}
|
|
3707
3717
|
),
|
|
3718
|
+
showListbox && hasFiles && !disabled && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3719
|
+
Ariakit__namespace.PopoverDisclosure,
|
|
3720
|
+
{
|
|
3721
|
+
render: /* @__PURE__ */ jsxRuntime.jsx(SGhostButton, { icon: "caretDown", size: "xxs", ariaLabel: "toggle file list" }),
|
|
3722
|
+
className: cn("shrink-0 transition-transform duration-150", listOpen && "rotate-180")
|
|
3723
|
+
}
|
|
3724
|
+
),
|
|
3708
3725
|
!disabled && hasFiles && /* @__PURE__ */ jsxRuntime.jsx(SGhostButton, { icon: "close", size: "xxs", ariaLabel: "clear", onClick: clear })
|
|
3709
3726
|
]
|
|
3710
3727
|
}
|
|
3711
3728
|
);
|
|
3712
|
-
const
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3729
|
+
const content = showListbox ? /* @__PURE__ */ jsxRuntime.jsxs(Ariakit__namespace.PopoverProvider, { open: listOpen, setOpen: setListOpen, placement: "bottom-start", children: [
|
|
3730
|
+
contentInner,
|
|
3731
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3732
|
+
Ariakit__namespace.Popover,
|
|
3733
|
+
{
|
|
3734
|
+
portal: true,
|
|
3735
|
+
portalElement: portalContainer,
|
|
3736
|
+
gutter: 4,
|
|
3737
|
+
unmountOnHide: true,
|
|
3738
|
+
getAnchorRect: () => contentBoxRef.current?.getBoundingClientRect() ?? null,
|
|
3739
|
+
style: { minWidth: contentBoxRef.current?.offsetWidth },
|
|
3740
|
+
className: "z-50 box-border flex flex-col items-stretch 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)]",
|
|
3741
|
+
children: filesArr.map((f, i) => /* @__PURE__ */ jsxRuntime.jsx(SChip, { value: f.name, editable: false, onRemove: () => removeChip(i) }, i))
|
|
3742
|
+
}
|
|
3743
|
+
)
|
|
3744
|
+
] }) : contentInner;
|
|
3745
|
+
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
3746
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, style, children: [
|
|
3728
3747
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3729
3748
|
SField,
|