sellmate-design-system-react 0.6.0 → 0.6.1
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/SGnb/SGnb.cjs +21 -3
- package/dist/components/SGnb/SGnb.cjs.map +1 -1
- package/dist/components/SGnb/SGnb.js +21 -3
- package/dist/components/SGnb/SGnb.js.map +1 -1
- package/dist/components/SStepper/SStepper.cjs +3019 -0
- package/dist/components/SStepper/SStepper.cjs.map +1 -0
- package/dist/components/SStepper/SStepper.d.ts +16 -0
- package/dist/components/SStepper/SStepper.js +3017 -0
- package/dist/components/SStepper/SStepper.js.map +1 -0
- package/dist/components/SStepper/index.d.ts +2 -0
- package/dist/components/SStepper/stepper.config.d.ts +42 -0
- package/dist/index.cjs +197 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +196 -15
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export * from './components/SLayout';
|
|
|
29
29
|
export * from './components/SPage';
|
|
30
30
|
export * from './components/STabs';
|
|
31
31
|
export * from './components/SPagination';
|
|
32
|
+
export * from './components/SStepper';
|
|
32
33
|
export * from './components/STable';
|
|
33
34
|
export * from './components/SKeyValueTable';
|
|
34
35
|
export * from './components/SToast';
|
package/dist/index.js
CHANGED
|
@@ -5244,9 +5244,24 @@ var SGnb = forwardRef(function SGnb2({
|
|
|
5244
5244
|
onMouseEnter: () => setHoveredKey(item.value),
|
|
5245
5245
|
onMouseLeave: () => setHoveredKey((prev) => prev === item.value ? null : prev),
|
|
5246
5246
|
children: [
|
|
5247
|
-
depth === 1 && item.icon && /* @__PURE__ */ jsx(
|
|
5247
|
+
depth === 1 && item.icon && /* @__PURE__ */ jsx(
|
|
5248
|
+
SIcon,
|
|
5249
|
+
{
|
|
5250
|
+
name: item.icon,
|
|
5251
|
+
size: M.depth1Icon,
|
|
5252
|
+
color: isSelected ? C.itemColorActive : C.itemIcon,
|
|
5253
|
+
className: "shrink-0"
|
|
5254
|
+
}
|
|
5255
|
+
),
|
|
5248
5256
|
/* @__PURE__ */ jsxs("span", { className: "min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap flex flex-no-wrap items-center", children: [
|
|
5249
|
-
depth > 1 && iconBranch ? /* @__PURE__ */ jsx(
|
|
5257
|
+
depth > 1 && iconBranch ? /* @__PURE__ */ jsx(
|
|
5258
|
+
"div",
|
|
5259
|
+
{
|
|
5260
|
+
className: "w-[20px] flex items-center justify-center mr-[8px]",
|
|
5261
|
+
style: { height: M.itemLineHeight },
|
|
5262
|
+
children: "-"
|
|
5263
|
+
}
|
|
5264
|
+
) : null,
|
|
5250
5265
|
item.label
|
|
5251
5266
|
] }),
|
|
5252
5267
|
item.tag !== void 0 && item.tag !== "" && /* @__PURE__ */ jsx(
|
|
@@ -5305,10 +5320,11 @@ var SGnb = forwardRef(function SGnb2({
|
|
|
5305
5320
|
}, [layout, railHasLeaf, showMenu]);
|
|
5306
5321
|
const railFolded = folded && header === "fix";
|
|
5307
5322
|
const rootWidth = header === "full" ? "100%" : folded ? GNB_COMMON.foldWidth : bodyWidth;
|
|
5323
|
+
const rightBorder = color === "light" ? `1px solid ${C.topBorder}` : void 0;
|
|
5308
5324
|
const rootStyle = {
|
|
5309
5325
|
width: rootWidth,
|
|
5310
5326
|
transition: `width ${GNB_FOLD_MS}ms ease-out`,
|
|
5311
|
-
...header === "full" ? { gridArea: "1 / 1 / -1 / -1", pointerEvents: "none" } : { backgroundColor: C.panelBg },
|
|
5327
|
+
...header === "full" ? { gridArea: "1 / 1 / -1 / -1", pointerEvents: "none" } : { backgroundColor: C.panelBg, borderRight: rightBorder },
|
|
5312
5328
|
...style
|
|
5313
5329
|
};
|
|
5314
5330
|
const hideAfterSlide = (hidden) => `visibility 0s linear ${hidden ? `${GNB_FOLD_MS}ms` : "0s"}`;
|
|
@@ -5475,6 +5491,8 @@ var SGnb = forwardRef(function SGnb2({
|
|
|
5475
5491
|
paddingTop: M.bodyPaddingY,
|
|
5476
5492
|
paddingBottom: M.bodyPaddingY,
|
|
5477
5493
|
backgroundColor: C.panelBg,
|
|
5494
|
+
// full 은 상단바가 전폭이라 루트가 오른쪽 선을 못 그린다 → 메뉴 오른쪽(페이지 경계)이 대신 그린다.
|
|
5495
|
+
borderRight: header === "full" ? rightBorder : void 0,
|
|
5478
5496
|
pointerEvents: "auto"
|
|
5479
5497
|
},
|
|
5480
5498
|
children: /* @__PURE__ */ jsx("ul", { className: "m-0 flex list-none flex-col p-0", children: menuItems.map((item) => renderItem(item, 1)) })
|
|
@@ -5731,6 +5749,169 @@ function SPagination({
|
|
|
5731
5749
|
}
|
|
5732
5750
|
);
|
|
5733
5751
|
}
|
|
5752
|
+
|
|
5753
|
+
// src/components/SStepper/stepper.config.ts
|
|
5754
|
+
var STEPPER_SIZES = ["sm", "lg"];
|
|
5755
|
+
var V2 = (path) => `var(--cmp-stepper-${path})`;
|
|
5756
|
+
var STEPPER_SIZE_CONFIG = {
|
|
5757
|
+
sm: {
|
|
5758
|
+
sequenceSize: V2("sm-sequence-size"),
|
|
5759
|
+
fontSize: "12px",
|
|
5760
|
+
lineHeight: "20px",
|
|
5761
|
+
fontWeightActive: 700,
|
|
5762
|
+
fontWeightDefault: 500
|
|
5763
|
+
},
|
|
5764
|
+
lg: {
|
|
5765
|
+
sequenceSize: V2("lg-sequence-size"),
|
|
5766
|
+
fontSize: "14px",
|
|
5767
|
+
lineHeight: "24px",
|
|
5768
|
+
fontWeightActive: 700,
|
|
5769
|
+
fontWeightDefault: 500
|
|
5770
|
+
}
|
|
5771
|
+
};
|
|
5772
|
+
var STEPPER_LAYOUT = {
|
|
5773
|
+
containerGap: V2("container-gap"),
|
|
5774
|
+
itemGap: V2("item-gap"),
|
|
5775
|
+
dashWidth: V2("dash-width"),
|
|
5776
|
+
sequenceRadius: V2("sequence-radius"),
|
|
5777
|
+
sequenceBorderWidth: V2("sequence-border-witdh"),
|
|
5778
|
+
sequenceIcon: V2("sequence-icon")
|
|
5779
|
+
};
|
|
5780
|
+
var STEPPER_COLORS = {
|
|
5781
|
+
dash: V2("dash-color"),
|
|
5782
|
+
sequenceBorder: {
|
|
5783
|
+
active: V2("sequence-border-active"),
|
|
5784
|
+
default: V2("sequence-border-default"),
|
|
5785
|
+
completed: V2("sequence-border-completed")
|
|
5786
|
+
},
|
|
5787
|
+
sequenceBg: {
|
|
5788
|
+
active: V2("sequence-bg-active"),
|
|
5789
|
+
default: V2("sequence-bg-default"),
|
|
5790
|
+
completed: V2("sequence-bg-completed")
|
|
5791
|
+
},
|
|
5792
|
+
sequenceText: {
|
|
5793
|
+
active: V2("sequence-text-active"),
|
|
5794
|
+
default: V2("sequence-text-default")
|
|
5795
|
+
},
|
|
5796
|
+
text: {
|
|
5797
|
+
active: V2("text-active"),
|
|
5798
|
+
default: V2("text-default")
|
|
5799
|
+
}
|
|
5800
|
+
};
|
|
5801
|
+
function getItemValue(item, index) {
|
|
5802
|
+
return item.value ?? String(index + 1);
|
|
5803
|
+
}
|
|
5804
|
+
function SStepper({
|
|
5805
|
+
items,
|
|
5806
|
+
value,
|
|
5807
|
+
size = "sm",
|
|
5808
|
+
ariaLabel = "\uC9C4\uD589 \uB2E8\uACC4",
|
|
5809
|
+
className,
|
|
5810
|
+
style
|
|
5811
|
+
}) {
|
|
5812
|
+
const config = STEPPER_SIZE_CONFIG[size];
|
|
5813
|
+
const activeIndex = Math.max(
|
|
5814
|
+
0,
|
|
5815
|
+
items.findIndex((item, index) => getItemValue(item, index) === value)
|
|
5816
|
+
);
|
|
5817
|
+
const getState = (index) => {
|
|
5818
|
+
if (index < activeIndex) return "completed";
|
|
5819
|
+
if (index === activeIndex) return "active";
|
|
5820
|
+
return "default";
|
|
5821
|
+
};
|
|
5822
|
+
return /* @__PURE__ */ jsx(
|
|
5823
|
+
"div",
|
|
5824
|
+
{
|
|
5825
|
+
role: "list",
|
|
5826
|
+
"aria-label": ariaLabel,
|
|
5827
|
+
className: cn("inline-flex items-center", className),
|
|
5828
|
+
style: {
|
|
5829
|
+
gap: STEPPER_LAYOUT.containerGap,
|
|
5830
|
+
fontSize: config.fontSize,
|
|
5831
|
+
lineHeight: config.lineHeight,
|
|
5832
|
+
...style
|
|
5833
|
+
},
|
|
5834
|
+
children: items.map((item, index) => {
|
|
5835
|
+
const state2 = getState(index);
|
|
5836
|
+
const itemStyle = {
|
|
5837
|
+
gap: STEPPER_LAYOUT.itemGap,
|
|
5838
|
+
color: state2 === "active" ? STEPPER_COLORS.text.active : STEPPER_COLORS.text.default,
|
|
5839
|
+
fontWeight: state2 === "active" ? config.fontWeightActive : config.fontWeightDefault
|
|
5840
|
+
};
|
|
5841
|
+
const sequenceStyle = {
|
|
5842
|
+
width: config.sequenceSize,
|
|
5843
|
+
height: config.sequenceSize,
|
|
5844
|
+
flexBasis: config.sequenceSize,
|
|
5845
|
+
borderRadius: STEPPER_LAYOUT.sequenceRadius,
|
|
5846
|
+
borderWidth: STEPPER_LAYOUT.sequenceBorderWidth,
|
|
5847
|
+
borderColor: STEPPER_COLORS.sequenceBorder[state2],
|
|
5848
|
+
background: STEPPER_COLORS.sequenceBg[state2],
|
|
5849
|
+
color: state2 === "completed" ? STEPPER_COLORS.text.default : STEPPER_COLORS.sequenceText[state2]
|
|
5850
|
+
};
|
|
5851
|
+
const content = /* @__PURE__ */ jsxs(
|
|
5852
|
+
"span",
|
|
5853
|
+
{
|
|
5854
|
+
role: "listitem",
|
|
5855
|
+
"aria-current": state2 === "active" ? "step" : void 0,
|
|
5856
|
+
className: "inline-flex items-center whitespace-nowrap",
|
|
5857
|
+
style: itemStyle,
|
|
5858
|
+
children: [
|
|
5859
|
+
/* @__PURE__ */ jsx(
|
|
5860
|
+
"span",
|
|
5861
|
+
{
|
|
5862
|
+
"aria-hidden": true,
|
|
5863
|
+
className: "box-border inline-flex shrink-0 items-center justify-center border border-solid font-bold",
|
|
5864
|
+
style: sequenceStyle,
|
|
5865
|
+
children: state2 === "completed" ? /* @__PURE__ */ jsx(SIcon, { name: "check", size: STEPPER_LAYOUT.sequenceIcon, color: "currentColor" }) : index + 1
|
|
5866
|
+
}
|
|
5867
|
+
),
|
|
5868
|
+
/* @__PURE__ */ jsx("span", { children: item.label })
|
|
5869
|
+
]
|
|
5870
|
+
}
|
|
5871
|
+
);
|
|
5872
|
+
return /* @__PURE__ */ jsxs(
|
|
5873
|
+
"span",
|
|
5874
|
+
{
|
|
5875
|
+
className: "inline-flex items-center",
|
|
5876
|
+
style: { gap: STEPPER_LAYOUT.containerGap },
|
|
5877
|
+
children: [
|
|
5878
|
+
content,
|
|
5879
|
+
index < items.length - 1 && /* @__PURE__ */ jsx(
|
|
5880
|
+
"span",
|
|
5881
|
+
{
|
|
5882
|
+
"aria-hidden": true,
|
|
5883
|
+
className: "inline-flex h-px shrink-0 items-center",
|
|
5884
|
+
style: { width: STEPPER_LAYOUT.dashWidth, color: STEPPER_COLORS.dash },
|
|
5885
|
+
children: /* @__PURE__ */ jsx(
|
|
5886
|
+
"svg",
|
|
5887
|
+
{
|
|
5888
|
+
width: "20",
|
|
5889
|
+
height: "1",
|
|
5890
|
+
viewBox: "0 0 20 1",
|
|
5891
|
+
fill: "none",
|
|
5892
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5893
|
+
children: /* @__PURE__ */ jsx(
|
|
5894
|
+
"line",
|
|
5895
|
+
{
|
|
5896
|
+
y1: "0.5",
|
|
5897
|
+
x2: "20",
|
|
5898
|
+
y2: "0.5",
|
|
5899
|
+
stroke: "#888888",
|
|
5900
|
+
strokeDasharray: "4 4"
|
|
5901
|
+
}
|
|
5902
|
+
)
|
|
5903
|
+
}
|
|
5904
|
+
)
|
|
5905
|
+
}
|
|
5906
|
+
)
|
|
5907
|
+
]
|
|
5908
|
+
},
|
|
5909
|
+
getItemValue(item, index)
|
|
5910
|
+
);
|
|
5911
|
+
})
|
|
5912
|
+
}
|
|
5913
|
+
);
|
|
5914
|
+
}
|
|
5734
5915
|
function SCheckbox({
|
|
5735
5916
|
value = false,
|
|
5736
5917
|
val,
|
|
@@ -10168,15 +10349,15 @@ var SBarcodeInput = forwardRef(
|
|
|
10168
10349
|
);
|
|
10169
10350
|
|
|
10170
10351
|
// src/components/STimePicker/timepicker.config.ts
|
|
10171
|
-
var
|
|
10352
|
+
var V3 = (path) => `var(--cmp-timepicker-${path})`;
|
|
10172
10353
|
var TIMEPICKER_SIZES = ["sm", "md"];
|
|
10173
10354
|
var TIMEPICKER_SIZE_CONFIG = {
|
|
10174
10355
|
sm: {
|
|
10175
|
-
height:
|
|
10176
|
-
paddingX:
|
|
10177
|
-
gap:
|
|
10178
|
-
icon:
|
|
10179
|
-
radius:
|
|
10356
|
+
height: V3("sm-height"),
|
|
10357
|
+
paddingX: V3("sm-paddingX"),
|
|
10358
|
+
gap: V3("sm-gap"),
|
|
10359
|
+
icon: V3("sm-icon"),
|
|
10360
|
+
radius: V3("sm-radius"),
|
|
10180
10361
|
// TODO: component.timepicker 토큰에 typography가 추가되면 CSS 변수로 교체한다.
|
|
10181
10362
|
fontSize: 12,
|
|
10182
10363
|
lineHeight: 20,
|
|
@@ -10184,11 +10365,11 @@ var TIMEPICKER_SIZE_CONFIG = {
|
|
|
10184
10365
|
fieldMinWidth: 128
|
|
10185
10366
|
},
|
|
10186
10367
|
md: {
|
|
10187
|
-
height:
|
|
10188
|
-
paddingX:
|
|
10189
|
-
gap:
|
|
10190
|
-
icon:
|
|
10191
|
-
radius:
|
|
10368
|
+
height: V3("md-height"),
|
|
10369
|
+
paddingX: V3("md-paddingX"),
|
|
10370
|
+
gap: V3("md-gap"),
|
|
10371
|
+
icon: V3("md-icon"),
|
|
10372
|
+
radius: V3("md-radius"),
|
|
10192
10373
|
// TODO: component.timepicker 토큰에 typography가 추가되면 CSS 변수로 교체한다.
|
|
10193
10374
|
fontSize: 14,
|
|
10194
10375
|
lineHeight: 24,
|
|
@@ -11017,6 +11198,6 @@ function STimeRangePicker({
|
|
|
11017
11198
|
);
|
|
11018
11199
|
}
|
|
11019
11200
|
|
|
11020
|
-
export { BADGE_COLORS, BUTTON_COLORS, BUTTON_SIZES, COLOR_KEYS, GNB_COLORS, GNB_COMMON, GNB_FOLD_MS, GNB_HEADER, GNB_MENU, GNB_MENU_WIDTH, GNB_RAIL, GNB_RAIL_WIDTH, ICONS, SActionModal, SBadge, SBarcodeInput, SButton, SCalendar, SCallout, SCard, SCheckbox, SChip, SChipInput, SCircleProgress, SConfirmModal, SDatePicker, SDateRangePicker, SDivider, SDropdownButton, SField, SFilePicker, SForm, SGhostButton, SGnb, SGuide, SIcon, SInput, SKeyValueTable, SLayout, SLayoutContext, SLinearProgress, SLoadingContainer, SLoadingModal, SLoadingViewport, SNumberInput, SPage, SPagination, SPopover, SPopup, SPortal, SRadio, SRadioButton, SRadioGroup, SSelect, SSwitch, STable, STabs, STag, STextLink, STextarea, STimePicker, STimeRangePicker, SToast, SToastContainer, SToggle, STooltip, TAG_COLORS, TAG_SHAPES, TAG_SIZES, TIMEPICKER_SIZES, TIMEPICKER_SIZE_CONFIG, buttonPreset, cn, findGnbAncestors, findGnbRailValue, isColorKey, loading, resolveColor, useSLayout };
|
|
11201
|
+
export { BADGE_COLORS, BUTTON_COLORS, BUTTON_SIZES, COLOR_KEYS, GNB_COLORS, GNB_COMMON, GNB_FOLD_MS, GNB_HEADER, GNB_MENU, GNB_MENU_WIDTH, GNB_RAIL, GNB_RAIL_WIDTH, ICONS, SActionModal, SBadge, SBarcodeInput, SButton, SCalendar, SCallout, SCard, SCheckbox, SChip, SChipInput, SCircleProgress, SConfirmModal, SDatePicker, SDateRangePicker, SDivider, SDropdownButton, SField, SFilePicker, SForm, SGhostButton, SGnb, SGuide, SIcon, SInput, SKeyValueTable, SLayout, SLayoutContext, SLinearProgress, SLoadingContainer, SLoadingModal, SLoadingViewport, SNumberInput, SPage, SPagination, SPopover, SPopup, SPortal, SRadio, SRadioButton, SRadioGroup, SSelect, SStepper, SSwitch, STEPPER_SIZES, STable, STabs, STag, STextLink, STextarea, STimePicker, STimeRangePicker, SToast, SToastContainer, SToggle, STooltip, TAG_COLORS, TAG_SHAPES, TAG_SIZES, TIMEPICKER_SIZES, TIMEPICKER_SIZE_CONFIG, buttonPreset, cn, findGnbAncestors, findGnbRailValue, isColorKey, loading, resolveColor, useSLayout };
|
|
11021
11202
|
//# sourceMappingURL=index.js.map
|
|
11022
11203
|
//# sourceMappingURL=index.js.map
|