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
|
@@ -23,7 +23,7 @@ export interface SFilePickerProps {
|
|
|
23
23
|
/** 인라인 표시 — SField 테두리 박스만 사라지고 label/rules/hint 는 그대로 동작 */
|
|
24
24
|
inline?: boolean;
|
|
25
25
|
multiple?: boolean;
|
|
26
|
-
/** multiple
|
|
26
|
+
/** multiple 파일 목록을 필드 아래 칩 대신, caret(▼) 클릭 시 열리는 리스트박스 카드로 표시 (바깥 클릭 시 닫힘) */
|
|
27
27
|
useMultipleListBox?: boolean;
|
|
28
28
|
accept?: string;
|
|
29
29
|
maxFileSize?: number | string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { forwardRef, createContext, useState, useRef, useImperativeHandle, useEffect, useContext, useId } from 'react';
|
|
3
|
+
import * as Ariakit from '@ariakit/react';
|
|
3
4
|
import { clsx } from 'clsx';
|
|
4
5
|
import { extendTailwindMerge } from 'tailwind-merge';
|
|
5
6
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -3126,7 +3127,7 @@ var STooltip = forwardRef(function STooltip2({
|
|
|
3126
3127
|
if (disabled || body == null) return /* @__PURE__ */ jsx(Fragment, { children: triggerNode });
|
|
3127
3128
|
const isHover = trigger === "hover";
|
|
3128
3129
|
const contentClass = cn(
|
|
3129
|
-
"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]",
|
|
3130
3131
|
FLOATING_SLIDE_ANIM,
|
|
3131
3132
|
className
|
|
3132
3133
|
);
|
|
@@ -3558,7 +3559,10 @@ function SFilePicker({
|
|
|
3558
3559
|
const autoId = useId();
|
|
3559
3560
|
const resolvedName = name ?? autoId;
|
|
3560
3561
|
const inputRef = useRef(null);
|
|
3562
|
+
const contentBoxRef = useRef(null);
|
|
3561
3563
|
const [ruleError, setRuleError] = useState("");
|
|
3564
|
+
const [listOpen, setListOpen] = useState(false);
|
|
3565
|
+
const portalContainer = usePortalContainer();
|
|
3562
3566
|
const files = multiple ? Array.isArray(value) ? value : [] : value && !Array.isArray(value) ? value : null;
|
|
3563
3567
|
const hasFiles = multiple ? files.length > 0 : !!files;
|
|
3564
3568
|
const displayText = !hasFiles ? placeholder : multiple ? files.map((f) => f.name).join(", ") : files.name;
|
|
@@ -3612,10 +3616,12 @@ function SFilePicker({
|
|
|
3612
3616
|
e.stopPropagation();
|
|
3613
3617
|
if (disabled) return;
|
|
3614
3618
|
onValueChange?.(multiple ? [] : null);
|
|
3619
|
+
setListOpen(false);
|
|
3615
3620
|
};
|
|
3616
3621
|
const removeChip = (i) => {
|
|
3617
3622
|
const next = files.filter((_, idx) => idx !== i);
|
|
3618
3623
|
onValueChange?.(next);
|
|
3624
|
+
if (next.length === 0) setListOpen(false);
|
|
3619
3625
|
};
|
|
3620
3626
|
const open = () => {
|
|
3621
3627
|
if (!disabled) inputRef.current?.click();
|
|
@@ -3626,9 +3632,12 @@ function SFilePicker({
|
|
|
3626
3632
|
const iconSize = size === "md" ? 20 : 16;
|
|
3627
3633
|
const gapCls = size === "md" ? "gap-[var(--cmp-filepicker-md-gap)]" : "gap-[var(--cmp-filepicker-sm-gap)]";
|
|
3628
3634
|
const inlinePlaceholder = inline && !disabled && !hasFiles;
|
|
3629
|
-
const
|
|
3635
|
+
const showListbox = multiple && useMultipleListBox;
|
|
3636
|
+
const filesArr = multiple ? files : [];
|
|
3637
|
+
const contentInner = /* @__PURE__ */ jsxs(
|
|
3630
3638
|
"div",
|
|
3631
3639
|
{
|
|
3640
|
+
ref: contentBoxRef,
|
|
3632
3641
|
className: cn("group/filepicker flex h-full w-full items-center", gapCls),
|
|
3633
3642
|
style: { padding: inline ? 0 : `0 ${padX}` },
|
|
3634
3643
|
children: [
|
|
@@ -3683,25 +3692,34 @@ function SFilePicker({
|
|
|
3683
3692
|
]
|
|
3684
3693
|
}
|
|
3685
3694
|
),
|
|
3695
|
+
showListbox && hasFiles && !disabled && /* @__PURE__ */ jsx(
|
|
3696
|
+
Ariakit.PopoverDisclosure,
|
|
3697
|
+
{
|
|
3698
|
+
render: /* @__PURE__ */ jsx(SGhostButton, { icon: "caretDown", size: "xxs", ariaLabel: "toggle file list" }),
|
|
3699
|
+
className: cn("shrink-0 transition-transform duration-150", listOpen && "rotate-180")
|
|
3700
|
+
}
|
|
3701
|
+
),
|
|
3686
3702
|
!disabled && hasFiles && /* @__PURE__ */ jsx(SGhostButton, { icon: "close", size: "xxs", ariaLabel: "clear", onClick: clear })
|
|
3687
3703
|
]
|
|
3688
3704
|
}
|
|
3689
3705
|
);
|
|
3690
|
-
const
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3706
|
+
const content = showListbox ? /* @__PURE__ */ jsxs(Ariakit.PopoverProvider, { open: listOpen, setOpen: setListOpen, placement: "bottom-start", children: [
|
|
3707
|
+
contentInner,
|
|
3708
|
+
/* @__PURE__ */ jsx(
|
|
3709
|
+
Ariakit.Popover,
|
|
3710
|
+
{
|
|
3711
|
+
portal: true,
|
|
3712
|
+
portalElement: portalContainer,
|
|
3713
|
+
gutter: 4,
|
|
3714
|
+
unmountOnHide: true,
|
|
3715
|
+
getAnchorRect: () => contentBoxRef.current?.getBoundingClientRect() ?? null,
|
|
3716
|
+
style: { minWidth: contentBoxRef.current?.offsetWidth },
|
|
3717
|
+
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)]",
|
|
3718
|
+
children: filesArr.map((f, i) => /* @__PURE__ */ jsx(SChip, { value: f.name, editable: false, onRemove: () => removeChip(i) }, i))
|
|
3719
|
+
}
|
|
3720
|
+
)
|
|
3721
|
+
] }) : contentInner;
|
|
3722
|
+
const chips = multiple && !useMultipleListBox && filesArr.length > 0 && /* @__PURE__ */ jsx("div", { className: "mt-[8px] flex flex-wrap gap-[8px]", children: filesArr.map((f, i) => /* @__PURE__ */ jsx(SChip, { value: f.name, editable: false, onRemove: () => removeChip(i) }, i)) });
|
|
3705
3723
|
return /* @__PURE__ */ jsxs("div", { className, style, children: [
|
|
3706
3724
|
/* @__PURE__ */ jsx(
|
|
3707
3725
|
SField,
|