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
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type CSSProperties } from 'react';
|
|
2
2
|
import { type SFieldSize, type SFieldAddonAlign, type SFieldStatus } from '../SField';
|
|
3
3
|
import { type SIconName } from '../SIcon';
|
|
4
|
+
import { type SColor } from '../../lib/color';
|
|
4
5
|
import { type Rule } from '../../lib/form';
|
|
5
6
|
import { type STooltipProps } from '../STooltip';
|
|
6
7
|
export type SFilePickerValue = File[] | File | null;
|
|
@@ -23,7 +24,7 @@ export interface SFilePickerProps {
|
|
|
23
24
|
/** 인라인 표시 — SField 테두리 박스만 사라지고 label/rules/hint 는 그대로 동작 */
|
|
24
25
|
inline?: boolean;
|
|
25
26
|
multiple?: boolean;
|
|
26
|
-
/** multiple
|
|
27
|
+
/** multiple 파일 목록을 필드 아래 칩 대신, caret(▼) 클릭 시 열리는 리스트박스 카드로 표시 (바깥 클릭 시 닫힘) */
|
|
27
28
|
useMultipleListBox?: boolean;
|
|
28
29
|
accept?: string;
|
|
29
30
|
maxFileSize?: number | string;
|
|
@@ -36,6 +37,7 @@ export interface SFilePickerProps {
|
|
|
36
37
|
label?: string;
|
|
37
38
|
labelWidth?: number | string;
|
|
38
39
|
icon?: SIconName;
|
|
40
|
+
iconColor?: SColor;
|
|
39
41
|
labelTooltip?: string;
|
|
40
42
|
labelTooltipProps?: Partial<STooltipProps>;
|
|
41
43
|
addonLabel?: string;
|
|
@@ -48,4 +50,4 @@ export interface SFilePickerProps {
|
|
|
48
50
|
style?: CSSProperties;
|
|
49
51
|
}
|
|
50
52
|
/** SFilePicker — sd-file-picker 포팅. 단일/다중 파일 + 크기·개수 검증 + 칩 목록. */
|
|
51
|
-
export declare function SFilePicker({ value, onValueChange, onReject, placeholder, disabled, focused, hovered, inline, multiple, useMultipleListBox, accept, maxFileSize, maxTotalSize, maxFiles, name, rules, status, size, label, labelWidth, icon, labelTooltip, labelTooltipProps, addonLabel, addonAlign, hint, error, errorMessage, width, className, style, }: SFilePickerProps): import("react").JSX.Element;
|
|
53
|
+
export declare function SFilePicker({ value, onValueChange, onReject, placeholder, disabled, focused, hovered, inline, multiple, useMultipleListBox, accept, maxFileSize, maxTotalSize, maxFiles, name, rules, status, size, label, labelWidth, icon, iconColor, labelTooltip, labelTooltipProps, addonLabel, addonAlign, hint, error, errorMessage, width, className, style, }: SFilePickerProps): import("react").JSX.Element;
|
|
@@ -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';
|
|
@@ -2871,7 +2872,9 @@ var FLOATING_SLIDE_ANIM = [
|
|
|
2871
2872
|
"data-[state=closed]:data-[side=right]:animate-floating-out-right"
|
|
2872
2873
|
].join(" ");
|
|
2873
2874
|
var PortalContainerContext = createContext(null);
|
|
2875
|
+
var InsideModalContext = createContext(false);
|
|
2874
2876
|
PortalContainerContext.Provider;
|
|
2877
|
+
InsideModalContext.Provider;
|
|
2875
2878
|
function usePortalContainer() {
|
|
2876
2879
|
return useContext(PortalContainerContext) ?? void 0;
|
|
2877
2880
|
}
|
|
@@ -3126,7 +3129,7 @@ var STooltip = forwardRef(function STooltip2({
|
|
|
3126
3129
|
if (disabled || body == null) return /* @__PURE__ */ jsx(Fragment, { children: triggerNode });
|
|
3127
3130
|
const isHover = trigger === "hover";
|
|
3128
3131
|
const contentClass = cn(
|
|
3129
|
-
"z-50 max-w-xs rounded-[6px] px-[16px] py-[12px] text-[12px] leading-[20px]
|
|
3132
|
+
"z-50 max-w-xs rounded-[6px] px-[16px] py-[12px] text-[12px] leading-[20px]",
|
|
3130
3133
|
FLOATING_SLIDE_ANIM,
|
|
3131
3134
|
className
|
|
3132
3135
|
);
|
|
@@ -3232,6 +3235,7 @@ var SField = forwardRef(function SField2({
|
|
|
3232
3235
|
name,
|
|
3233
3236
|
label = "",
|
|
3234
3237
|
icon,
|
|
3238
|
+
iconColor,
|
|
3235
3239
|
labelTooltip = "",
|
|
3236
3240
|
labelTooltipProps,
|
|
3237
3241
|
labelWidth,
|
|
@@ -3309,7 +3313,15 @@ var SField = forwardRef(function SField2({
|
|
|
3309
3313
|
lineHeight: `${s.lineHeight}px`
|
|
3310
3314
|
},
|
|
3311
3315
|
children: [
|
|
3312
|
-
icon && /* @__PURE__ */ jsx(
|
|
3316
|
+
icon && /* @__PURE__ */ jsx(
|
|
3317
|
+
SIcon,
|
|
3318
|
+
{
|
|
3319
|
+
name: icon,
|
|
3320
|
+
size: s.icon,
|
|
3321
|
+
color: iconColor,
|
|
3322
|
+
style: { marginRight: s.labelGap }
|
|
3323
|
+
}
|
|
3324
|
+
),
|
|
3313
3325
|
/* @__PURE__ */ jsx("span", { className: "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap", children: label }),
|
|
3314
3326
|
(labelTooltip !== "" || labelTooltipProps) && /* @__PURE__ */ jsx("span", { className: "shrink-0", style: { marginLeft: s.labelGap }, children: /* @__PURE__ */ jsx(
|
|
3315
3327
|
STooltip,
|
|
@@ -3359,7 +3371,7 @@ var SField = forwardRef(function SField2({
|
|
|
3359
3371
|
borderBottomLeftRadius: s.radius - 1
|
|
3360
3372
|
},
|
|
3361
3373
|
children: [
|
|
3362
|
-
icon && !label && /* @__PURE__ */ jsx(SIcon, { name: icon, size: s.icon }),
|
|
3374
|
+
icon && !label && /* @__PURE__ */ jsx(SIcon, { name: icon, size: s.icon, color: iconColor }),
|
|
3363
3375
|
effectiveAddonLabel
|
|
3364
3376
|
]
|
|
3365
3377
|
}
|
|
@@ -3544,6 +3556,7 @@ function SFilePicker({
|
|
|
3544
3556
|
label,
|
|
3545
3557
|
labelWidth,
|
|
3546
3558
|
icon,
|
|
3559
|
+
iconColor,
|
|
3547
3560
|
labelTooltip,
|
|
3548
3561
|
labelTooltipProps,
|
|
3549
3562
|
addonLabel,
|
|
@@ -3558,7 +3571,10 @@ function SFilePicker({
|
|
|
3558
3571
|
const autoId = useId();
|
|
3559
3572
|
const resolvedName = name ?? autoId;
|
|
3560
3573
|
const inputRef = useRef(null);
|
|
3574
|
+
const contentBoxRef = useRef(null);
|
|
3561
3575
|
const [ruleError, setRuleError] = useState("");
|
|
3576
|
+
const [listOpen, setListOpen] = useState(false);
|
|
3577
|
+
const portalContainer = usePortalContainer();
|
|
3562
3578
|
const files = multiple ? Array.isArray(value) ? value : [] : value && !Array.isArray(value) ? value : null;
|
|
3563
3579
|
const hasFiles = multiple ? files.length > 0 : !!files;
|
|
3564
3580
|
const displayText = !hasFiles ? placeholder : multiple ? files.map((f) => f.name).join(", ") : files.name;
|
|
@@ -3612,10 +3628,12 @@ function SFilePicker({
|
|
|
3612
3628
|
e.stopPropagation();
|
|
3613
3629
|
if (disabled) return;
|
|
3614
3630
|
onValueChange?.(multiple ? [] : null);
|
|
3631
|
+
setListOpen(false);
|
|
3615
3632
|
};
|
|
3616
3633
|
const removeChip = (i) => {
|
|
3617
3634
|
const next = files.filter((_, idx) => idx !== i);
|
|
3618
3635
|
onValueChange?.(next);
|
|
3636
|
+
if (next.length === 0) setListOpen(false);
|
|
3619
3637
|
};
|
|
3620
3638
|
const open = () => {
|
|
3621
3639
|
if (!disabled) inputRef.current?.click();
|
|
@@ -3626,9 +3644,12 @@ function SFilePicker({
|
|
|
3626
3644
|
const iconSize = size === "md" ? 20 : 16;
|
|
3627
3645
|
const gapCls = size === "md" ? "gap-[var(--cmp-filepicker-md-gap)]" : "gap-[var(--cmp-filepicker-sm-gap)]";
|
|
3628
3646
|
const inlinePlaceholder = inline && !disabled && !hasFiles;
|
|
3629
|
-
const
|
|
3647
|
+
const showListbox = multiple && useMultipleListBox;
|
|
3648
|
+
const filesArr = multiple ? files : [];
|
|
3649
|
+
const contentInner = /* @__PURE__ */ jsxs(
|
|
3630
3650
|
"div",
|
|
3631
3651
|
{
|
|
3652
|
+
ref: contentBoxRef,
|
|
3632
3653
|
className: cn("group/filepicker flex h-full w-full items-center", gapCls),
|
|
3633
3654
|
style: { padding: inline ? 0 : `0 ${padX}` },
|
|
3634
3655
|
children: [
|
|
@@ -3683,25 +3704,34 @@ function SFilePicker({
|
|
|
3683
3704
|
]
|
|
3684
3705
|
}
|
|
3685
3706
|
),
|
|
3707
|
+
showListbox && hasFiles && !disabled && /* @__PURE__ */ jsx(
|
|
3708
|
+
Ariakit.PopoverDisclosure,
|
|
3709
|
+
{
|
|
3710
|
+
render: /* @__PURE__ */ jsx(SGhostButton, { icon: "caretDown", size: "xxs", ariaLabel: "toggle file list" }),
|
|
3711
|
+
className: cn("shrink-0 transition-transform duration-150", listOpen && "rotate-180")
|
|
3712
|
+
}
|
|
3713
|
+
),
|
|
3686
3714
|
!disabled && hasFiles && /* @__PURE__ */ jsx(SGhostButton, { icon: "close", size: "xxs", ariaLabel: "clear", onClick: clear })
|
|
3687
3715
|
]
|
|
3688
3716
|
}
|
|
3689
3717
|
);
|
|
3690
|
-
const
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3718
|
+
const content = showListbox ? /* @__PURE__ */ jsxs(Ariakit.PopoverProvider, { open: listOpen, setOpen: setListOpen, placement: "bottom-start", children: [
|
|
3719
|
+
contentInner,
|
|
3720
|
+
/* @__PURE__ */ jsx(
|
|
3721
|
+
Ariakit.Popover,
|
|
3722
|
+
{
|
|
3723
|
+
portal: true,
|
|
3724
|
+
portalElement: portalContainer,
|
|
3725
|
+
gutter: 4,
|
|
3726
|
+
unmountOnHide: true,
|
|
3727
|
+
getAnchorRect: () => contentBoxRef.current?.getBoundingClientRect() ?? null,
|
|
3728
|
+
style: { minWidth: contentBoxRef.current?.offsetWidth },
|
|
3729
|
+
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)]",
|
|
3730
|
+
children: filesArr.map((f, i) => /* @__PURE__ */ jsx(SChip, { value: f.name, editable: false, onRemove: () => removeChip(i) }, i))
|
|
3731
|
+
}
|
|
3732
|
+
)
|
|
3733
|
+
] }) : contentInner;
|
|
3734
|
+
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
3735
|
return /* @__PURE__ */ jsxs("div", { className, style, children: [
|
|
3706
3736
|
/* @__PURE__ */ jsx(
|
|
3707
3737
|
SField,
|
|
@@ -3710,6 +3740,7 @@ function SFilePicker({
|
|
|
3710
3740
|
label,
|
|
3711
3741
|
labelWidth,
|
|
3712
3742
|
icon,
|
|
3743
|
+
iconColor,
|
|
3713
3744
|
labelTooltip,
|
|
3714
3745
|
labelTooltipProps,
|
|
3715
3746
|
addonLabel,
|