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.cjs
CHANGED
|
@@ -5272,9 +5272,24 @@ var SGnb = react.forwardRef(function SGnb2({
|
|
|
5272
5272
|
onMouseEnter: () => setHoveredKey(item.value),
|
|
5273
5273
|
onMouseLeave: () => setHoveredKey((prev) => prev === item.value ? null : prev),
|
|
5274
5274
|
children: [
|
|
5275
|
-
depth === 1 && item.icon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5275
|
+
depth === 1 && item.icon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5276
|
+
SIcon,
|
|
5277
|
+
{
|
|
5278
|
+
name: item.icon,
|
|
5279
|
+
size: M.depth1Icon,
|
|
5280
|
+
color: isSelected ? C.itemColorActive : C.itemIcon,
|
|
5281
|
+
className: "shrink-0"
|
|
5282
|
+
}
|
|
5283
|
+
),
|
|
5276
5284
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap flex flex-no-wrap items-center", children: [
|
|
5277
|
-
depth > 1 && iconBranch ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
5285
|
+
depth > 1 && iconBranch ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
5286
|
+
"div",
|
|
5287
|
+
{
|
|
5288
|
+
className: "w-[20px] flex items-center justify-center mr-[8px]",
|
|
5289
|
+
style: { height: M.itemLineHeight },
|
|
5290
|
+
children: "-"
|
|
5291
|
+
}
|
|
5292
|
+
) : null,
|
|
5278
5293
|
item.label
|
|
5279
5294
|
] }),
|
|
5280
5295
|
item.tag !== void 0 && item.tag !== "" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5333,10 +5348,11 @@ var SGnb = react.forwardRef(function SGnb2({
|
|
|
5333
5348
|
}, [layout, railHasLeaf, showMenu]);
|
|
5334
5349
|
const railFolded = folded && header === "fix";
|
|
5335
5350
|
const rootWidth = header === "full" ? "100%" : folded ? GNB_COMMON.foldWidth : bodyWidth;
|
|
5351
|
+
const rightBorder = color === "light" ? `1px solid ${C.topBorder}` : void 0;
|
|
5336
5352
|
const rootStyle = {
|
|
5337
5353
|
width: rootWidth,
|
|
5338
5354
|
transition: `width ${GNB_FOLD_MS}ms ease-out`,
|
|
5339
|
-
...header === "full" ? { gridArea: "1 / 1 / -1 / -1", pointerEvents: "none" } : { backgroundColor: C.panelBg },
|
|
5355
|
+
...header === "full" ? { gridArea: "1 / 1 / -1 / -1", pointerEvents: "none" } : { backgroundColor: C.panelBg, borderRight: rightBorder },
|
|
5340
5356
|
...style
|
|
5341
5357
|
};
|
|
5342
5358
|
const hideAfterSlide = (hidden) => `visibility 0s linear ${hidden ? `${GNB_FOLD_MS}ms` : "0s"}`;
|
|
@@ -5503,6 +5519,8 @@ var SGnb = react.forwardRef(function SGnb2({
|
|
|
5503
5519
|
paddingTop: M.bodyPaddingY,
|
|
5504
5520
|
paddingBottom: M.bodyPaddingY,
|
|
5505
5521
|
backgroundColor: C.panelBg,
|
|
5522
|
+
// full 은 상단바가 전폭이라 루트가 오른쪽 선을 못 그린다 → 메뉴 오른쪽(페이지 경계)이 대신 그린다.
|
|
5523
|
+
borderRight: header === "full" ? rightBorder : void 0,
|
|
5506
5524
|
pointerEvents: "auto"
|
|
5507
5525
|
},
|
|
5508
5526
|
children: /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "m-0 flex list-none flex-col p-0", children: menuItems.map((item) => renderItem(item, 1)) })
|
|
@@ -5759,6 +5777,169 @@ function SPagination({
|
|
|
5759
5777
|
}
|
|
5760
5778
|
);
|
|
5761
5779
|
}
|
|
5780
|
+
|
|
5781
|
+
// src/components/SStepper/stepper.config.ts
|
|
5782
|
+
var STEPPER_SIZES = ["sm", "lg"];
|
|
5783
|
+
var V2 = (path) => `var(--cmp-stepper-${path})`;
|
|
5784
|
+
var STEPPER_SIZE_CONFIG = {
|
|
5785
|
+
sm: {
|
|
5786
|
+
sequenceSize: V2("sm-sequence-size"),
|
|
5787
|
+
fontSize: "12px",
|
|
5788
|
+
lineHeight: "20px",
|
|
5789
|
+
fontWeightActive: 700,
|
|
5790
|
+
fontWeightDefault: 500
|
|
5791
|
+
},
|
|
5792
|
+
lg: {
|
|
5793
|
+
sequenceSize: V2("lg-sequence-size"),
|
|
5794
|
+
fontSize: "14px",
|
|
5795
|
+
lineHeight: "24px",
|
|
5796
|
+
fontWeightActive: 700,
|
|
5797
|
+
fontWeightDefault: 500
|
|
5798
|
+
}
|
|
5799
|
+
};
|
|
5800
|
+
var STEPPER_LAYOUT = {
|
|
5801
|
+
containerGap: V2("container-gap"),
|
|
5802
|
+
itemGap: V2("item-gap"),
|
|
5803
|
+
dashWidth: V2("dash-width"),
|
|
5804
|
+
sequenceRadius: V2("sequence-radius"),
|
|
5805
|
+
sequenceBorderWidth: V2("sequence-border-witdh"),
|
|
5806
|
+
sequenceIcon: V2("sequence-icon")
|
|
5807
|
+
};
|
|
5808
|
+
var STEPPER_COLORS = {
|
|
5809
|
+
dash: V2("dash-color"),
|
|
5810
|
+
sequenceBorder: {
|
|
5811
|
+
active: V2("sequence-border-active"),
|
|
5812
|
+
default: V2("sequence-border-default"),
|
|
5813
|
+
completed: V2("sequence-border-completed")
|
|
5814
|
+
},
|
|
5815
|
+
sequenceBg: {
|
|
5816
|
+
active: V2("sequence-bg-active"),
|
|
5817
|
+
default: V2("sequence-bg-default"),
|
|
5818
|
+
completed: V2("sequence-bg-completed")
|
|
5819
|
+
},
|
|
5820
|
+
sequenceText: {
|
|
5821
|
+
active: V2("sequence-text-active"),
|
|
5822
|
+
default: V2("sequence-text-default")
|
|
5823
|
+
},
|
|
5824
|
+
text: {
|
|
5825
|
+
active: V2("text-active"),
|
|
5826
|
+
default: V2("text-default")
|
|
5827
|
+
}
|
|
5828
|
+
};
|
|
5829
|
+
function getItemValue(item, index) {
|
|
5830
|
+
return item.value ?? String(index + 1);
|
|
5831
|
+
}
|
|
5832
|
+
function SStepper({
|
|
5833
|
+
items,
|
|
5834
|
+
value,
|
|
5835
|
+
size = "sm",
|
|
5836
|
+
ariaLabel = "\uC9C4\uD589 \uB2E8\uACC4",
|
|
5837
|
+
className,
|
|
5838
|
+
style
|
|
5839
|
+
}) {
|
|
5840
|
+
const config = STEPPER_SIZE_CONFIG[size];
|
|
5841
|
+
const activeIndex = Math.max(
|
|
5842
|
+
0,
|
|
5843
|
+
items.findIndex((item, index) => getItemValue(item, index) === value)
|
|
5844
|
+
);
|
|
5845
|
+
const getState = (index) => {
|
|
5846
|
+
if (index < activeIndex) return "completed";
|
|
5847
|
+
if (index === activeIndex) return "active";
|
|
5848
|
+
return "default";
|
|
5849
|
+
};
|
|
5850
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5851
|
+
"div",
|
|
5852
|
+
{
|
|
5853
|
+
role: "list",
|
|
5854
|
+
"aria-label": ariaLabel,
|
|
5855
|
+
className: cn("inline-flex items-center", className),
|
|
5856
|
+
style: {
|
|
5857
|
+
gap: STEPPER_LAYOUT.containerGap,
|
|
5858
|
+
fontSize: config.fontSize,
|
|
5859
|
+
lineHeight: config.lineHeight,
|
|
5860
|
+
...style
|
|
5861
|
+
},
|
|
5862
|
+
children: items.map((item, index) => {
|
|
5863
|
+
const state2 = getState(index);
|
|
5864
|
+
const itemStyle = {
|
|
5865
|
+
gap: STEPPER_LAYOUT.itemGap,
|
|
5866
|
+
color: state2 === "active" ? STEPPER_COLORS.text.active : STEPPER_COLORS.text.default,
|
|
5867
|
+
fontWeight: state2 === "active" ? config.fontWeightActive : config.fontWeightDefault
|
|
5868
|
+
};
|
|
5869
|
+
const sequenceStyle = {
|
|
5870
|
+
width: config.sequenceSize,
|
|
5871
|
+
height: config.sequenceSize,
|
|
5872
|
+
flexBasis: config.sequenceSize,
|
|
5873
|
+
borderRadius: STEPPER_LAYOUT.sequenceRadius,
|
|
5874
|
+
borderWidth: STEPPER_LAYOUT.sequenceBorderWidth,
|
|
5875
|
+
borderColor: STEPPER_COLORS.sequenceBorder[state2],
|
|
5876
|
+
background: STEPPER_COLORS.sequenceBg[state2],
|
|
5877
|
+
color: state2 === "completed" ? STEPPER_COLORS.text.default : STEPPER_COLORS.sequenceText[state2]
|
|
5878
|
+
};
|
|
5879
|
+
const content = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5880
|
+
"span",
|
|
5881
|
+
{
|
|
5882
|
+
role: "listitem",
|
|
5883
|
+
"aria-current": state2 === "active" ? "step" : void 0,
|
|
5884
|
+
className: "inline-flex items-center whitespace-nowrap",
|
|
5885
|
+
style: itemStyle,
|
|
5886
|
+
children: [
|
|
5887
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5888
|
+
"span",
|
|
5889
|
+
{
|
|
5890
|
+
"aria-hidden": true,
|
|
5891
|
+
className: "box-border inline-flex shrink-0 items-center justify-center border border-solid font-bold",
|
|
5892
|
+
style: sequenceStyle,
|
|
5893
|
+
children: state2 === "completed" ? /* @__PURE__ */ jsxRuntime.jsx(SIcon, { name: "check", size: STEPPER_LAYOUT.sequenceIcon, color: "currentColor" }) : index + 1
|
|
5894
|
+
}
|
|
5895
|
+
),
|
|
5896
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: item.label })
|
|
5897
|
+
]
|
|
5898
|
+
}
|
|
5899
|
+
);
|
|
5900
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5901
|
+
"span",
|
|
5902
|
+
{
|
|
5903
|
+
className: "inline-flex items-center",
|
|
5904
|
+
style: { gap: STEPPER_LAYOUT.containerGap },
|
|
5905
|
+
children: [
|
|
5906
|
+
content,
|
|
5907
|
+
index < items.length - 1 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5908
|
+
"span",
|
|
5909
|
+
{
|
|
5910
|
+
"aria-hidden": true,
|
|
5911
|
+
className: "inline-flex h-px shrink-0 items-center",
|
|
5912
|
+
style: { width: STEPPER_LAYOUT.dashWidth, color: STEPPER_COLORS.dash },
|
|
5913
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5914
|
+
"svg",
|
|
5915
|
+
{
|
|
5916
|
+
width: "20",
|
|
5917
|
+
height: "1",
|
|
5918
|
+
viewBox: "0 0 20 1",
|
|
5919
|
+
fill: "none",
|
|
5920
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5921
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5922
|
+
"line",
|
|
5923
|
+
{
|
|
5924
|
+
y1: "0.5",
|
|
5925
|
+
x2: "20",
|
|
5926
|
+
y2: "0.5",
|
|
5927
|
+
stroke: "#888888",
|
|
5928
|
+
strokeDasharray: "4 4"
|
|
5929
|
+
}
|
|
5930
|
+
)
|
|
5931
|
+
}
|
|
5932
|
+
)
|
|
5933
|
+
}
|
|
5934
|
+
)
|
|
5935
|
+
]
|
|
5936
|
+
},
|
|
5937
|
+
getItemValue(item, index)
|
|
5938
|
+
);
|
|
5939
|
+
})
|
|
5940
|
+
}
|
|
5941
|
+
);
|
|
5942
|
+
}
|
|
5762
5943
|
function SCheckbox({
|
|
5763
5944
|
value = false,
|
|
5764
5945
|
val,
|
|
@@ -10196,15 +10377,15 @@ var SBarcodeInput = react.forwardRef(
|
|
|
10196
10377
|
);
|
|
10197
10378
|
|
|
10198
10379
|
// src/components/STimePicker/timepicker.config.ts
|
|
10199
|
-
var
|
|
10380
|
+
var V3 = (path) => `var(--cmp-timepicker-${path})`;
|
|
10200
10381
|
var TIMEPICKER_SIZES = ["sm", "md"];
|
|
10201
10382
|
var TIMEPICKER_SIZE_CONFIG = {
|
|
10202
10383
|
sm: {
|
|
10203
|
-
height:
|
|
10204
|
-
paddingX:
|
|
10205
|
-
gap:
|
|
10206
|
-
icon:
|
|
10207
|
-
radius:
|
|
10384
|
+
height: V3("sm-height"),
|
|
10385
|
+
paddingX: V3("sm-paddingX"),
|
|
10386
|
+
gap: V3("sm-gap"),
|
|
10387
|
+
icon: V3("sm-icon"),
|
|
10388
|
+
radius: V3("sm-radius"),
|
|
10208
10389
|
// TODO: component.timepicker 토큰에 typography가 추가되면 CSS 변수로 교체한다.
|
|
10209
10390
|
fontSize: 12,
|
|
10210
10391
|
lineHeight: 20,
|
|
@@ -10212,11 +10393,11 @@ var TIMEPICKER_SIZE_CONFIG = {
|
|
|
10212
10393
|
fieldMinWidth: 128
|
|
10213
10394
|
},
|
|
10214
10395
|
md: {
|
|
10215
|
-
height:
|
|
10216
|
-
paddingX:
|
|
10217
|
-
gap:
|
|
10218
|
-
icon:
|
|
10219
|
-
radius:
|
|
10396
|
+
height: V3("md-height"),
|
|
10397
|
+
paddingX: V3("md-paddingX"),
|
|
10398
|
+
gap: V3("md-gap"),
|
|
10399
|
+
icon: V3("md-icon"),
|
|
10400
|
+
radius: V3("md-radius"),
|
|
10220
10401
|
// TODO: component.timepicker 토큰에 typography가 추가되면 CSS 변수로 교체한다.
|
|
10221
10402
|
fontSize: 14,
|
|
10222
10403
|
lineHeight: 24,
|
|
@@ -11099,7 +11280,9 @@ exports.SRadio = SRadio;
|
|
|
11099
11280
|
exports.SRadioButton = SRadioButton;
|
|
11100
11281
|
exports.SRadioGroup = SRadioGroup;
|
|
11101
11282
|
exports.SSelect = SSelect;
|
|
11283
|
+
exports.SStepper = SStepper;
|
|
11102
11284
|
exports.SSwitch = SSwitch;
|
|
11285
|
+
exports.STEPPER_SIZES = STEPPER_SIZES;
|
|
11103
11286
|
exports.STable = STable;
|
|
11104
11287
|
exports.STabs = STabs;
|
|
11105
11288
|
exports.STag = STag;
|