@shoplflow/base 0.13.6 → 0.13.8
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/index.cjs +88 -84
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +24 -24
- package/dist/index.d.ts +24 -24
- package/dist/index.js +88 -84
- package/dist/index.js.map +1 -1
- package/package.json +9 -3
package/dist/index.cjs
CHANGED
|
@@ -1110,7 +1110,7 @@ var ChipButton = (_a) => {
|
|
|
1110
1110
|
);
|
|
1111
1111
|
};
|
|
1112
1112
|
exports.ChipButton = ChipButton;
|
|
1113
|
-
var getStyleByStyleVar = (styleVar, disabled) => {
|
|
1113
|
+
var getStyleByStyleVar = (styleVar, color, disabled) => {
|
|
1114
1114
|
switch (styleVar) {
|
|
1115
1115
|
case "PRIMARY":
|
|
1116
1116
|
return react.css`
|
|
@@ -1129,11 +1129,14 @@ var getStyleByStyleVar = (styleVar, disabled) => {
|
|
|
1129
1129
|
}
|
|
1130
1130
|
`;
|
|
1131
1131
|
case "SOLID":
|
|
1132
|
+
if (!color) {
|
|
1133
|
+
throw new Error("Button\uC758 SOLID \uC18D\uC131\uC740 color\uB97C \uD544\uC218\uB85C \uBC1B\uC2B5\uB2C8\uB2E4.");
|
|
1134
|
+
}
|
|
1132
1135
|
return react.css`
|
|
1133
|
-
border: 1px solid ${exports.colorTokens
|
|
1134
|
-
background-color: ${exports.colorTokens
|
|
1136
|
+
border: 1px solid ${exports.colorTokens[getNextColor(color)]};
|
|
1137
|
+
background-color: ${exports.colorTokens[color]};
|
|
1135
1138
|
:hover {
|
|
1136
|
-
background-color: ${
|
|
1139
|
+
background-color: ${exports.colorTokens[getNextColor(color)]};
|
|
1137
1140
|
}
|
|
1138
1141
|
`;
|
|
1139
1142
|
case "GHOST":
|
|
@@ -1180,7 +1183,7 @@ var StyledButton = styled5__default.default.button`
|
|
|
1180
1183
|
padding: 0 12px;
|
|
1181
1184
|
border-radius: 6px;
|
|
1182
1185
|
cursor: pointer;
|
|
1183
|
-
${({ styleVar, disabled }) => getStyleByStyleVar(styleVar, disabled)};
|
|
1186
|
+
${({ styleVar, color, disabled }) => getStyleByStyleVar(styleVar, color, disabled)};
|
|
1184
1187
|
${({ sizeVar }) => getStyleBySizeVar2(sizeVar)};
|
|
1185
1188
|
${({ disabled }) => getDisabledStyle(disabled)};
|
|
1186
1189
|
`;
|
|
@@ -1273,27 +1276,47 @@ var getWidthAndHeightFromSizeVar = (sizeVar) => {
|
|
|
1273
1276
|
`;
|
|
1274
1277
|
}
|
|
1275
1278
|
};
|
|
1276
|
-
var getStyleByStyleVar2 = (styleVar) => {
|
|
1279
|
+
var getStyleByStyleVar2 = (styleVar, color) => {
|
|
1277
1280
|
switch (styleVar) {
|
|
1281
|
+
case "PRIMARY":
|
|
1282
|
+
return react.css`
|
|
1283
|
+
background: ${exports.colorTokens.primary300};
|
|
1284
|
+
border: 1px solid ${exports.colorTokens.primary400};
|
|
1285
|
+
&:hover {
|
|
1286
|
+
background: ${exports.colorTokens.primary400};
|
|
1287
|
+
}
|
|
1288
|
+
`;
|
|
1289
|
+
case "SECONDARY":
|
|
1290
|
+
return react.css`
|
|
1291
|
+
background: ${exports.colorTokens.neutral0};
|
|
1292
|
+
border: 1px solid ${exports.colorTokens.neutral350};
|
|
1293
|
+
&:hover {
|
|
1294
|
+
background: ${exports.colorTokens.neutral100};
|
|
1295
|
+
}
|
|
1296
|
+
`;
|
|
1278
1297
|
case "SOLID":
|
|
1298
|
+
if (!color) {
|
|
1299
|
+
throw new Error("IconButton\uC758 SOLID \uC18D\uC131\uC740 color\uB97C \uD544\uC218\uB85C \uBC1B\uC2B5\uB2C8\uB2E4.");
|
|
1300
|
+
}
|
|
1279
1301
|
return react.css`
|
|
1280
|
-
border: 1px solid ${exports.colorTokens
|
|
1302
|
+
border: 1px solid ${exports.colorTokens[getNextColor(color)]};
|
|
1303
|
+
background: ${exports.colorTokens[color]};
|
|
1281
1304
|
&:hover {
|
|
1282
|
-
background
|
|
1305
|
+
background: ${exports.colorTokens[getNextColor(color)]};
|
|
1283
1306
|
}
|
|
1284
1307
|
`;
|
|
1285
1308
|
case "GHOST":
|
|
1286
1309
|
return react.css`
|
|
1287
1310
|
border: 1px solid transparent;
|
|
1288
1311
|
&:hover {
|
|
1289
|
-
background
|
|
1312
|
+
background: ${exports.colorTokens.neutral400_5};
|
|
1290
1313
|
}
|
|
1291
1314
|
`;
|
|
1292
1315
|
default:
|
|
1293
1316
|
return react.css`
|
|
1294
1317
|
border: 1px solid ${exports.colorTokens.neutral200};
|
|
1295
1318
|
&:hover {
|
|
1296
|
-
background
|
|
1319
|
+
background: ${exports.colorTokens.neutral100};
|
|
1297
1320
|
}
|
|
1298
1321
|
`;
|
|
1299
1322
|
}
|
|
@@ -1304,9 +1327,9 @@ var StyledIconButton = styled5__default.default.button`
|
|
|
1304
1327
|
border-radius: ${exports.borderRadiusTokens.borderRadius06};
|
|
1305
1328
|
justify-content: center;
|
|
1306
1329
|
align-items: center;
|
|
1307
|
-
background
|
|
1330
|
+
background: ${exports.colorTokens.neutral0};
|
|
1308
1331
|
cursor: pointer;
|
|
1309
|
-
${({ styleVar }) => getStyleByStyleVar2(styleVar)};
|
|
1332
|
+
${({ styleVar, color }) => getStyleByStyleVar2(styleVar, color)};
|
|
1310
1333
|
${({ sizeVar }) => getWidthAndHeightFromSizeVar(sizeVar)};
|
|
1311
1334
|
${({ disabled }) => getDisabledStyle(disabled)};
|
|
1312
1335
|
& > svg {
|
|
@@ -1314,62 +1337,20 @@ var StyledIconButton = styled5__default.default.button`
|
|
|
1314
1337
|
height: 20px;
|
|
1315
1338
|
}
|
|
1316
1339
|
`;
|
|
1317
|
-
|
|
1318
|
-
// src/components/Icon/Icon.types.ts
|
|
1319
|
-
exports.IconSizeVariants = {
|
|
1320
|
-
XS: "XS",
|
|
1321
|
-
S: "S",
|
|
1322
|
-
M: "M",
|
|
1323
|
-
L: "L",
|
|
1324
|
-
XL: "XL"
|
|
1325
|
-
};
|
|
1326
|
-
|
|
1327
|
-
// src/components/Icon/Icon.styled.ts
|
|
1328
|
-
var getIconSize = (size) => {
|
|
1329
|
-
switch (size) {
|
|
1330
|
-
case exports.IconSizeVariants.XS:
|
|
1331
|
-
return "12px";
|
|
1332
|
-
case exports.IconSizeVariants.S:
|
|
1333
|
-
return "20px";
|
|
1334
|
-
case exports.IconSizeVariants.M:
|
|
1335
|
-
return "24px";
|
|
1336
|
-
case exports.IconSizeVariants.L:
|
|
1337
|
-
return "30px";
|
|
1338
|
-
case exports.IconSizeVariants.XL:
|
|
1339
|
-
return "36px";
|
|
1340
|
-
default:
|
|
1341
|
-
return "24px";
|
|
1342
|
-
}
|
|
1343
|
-
};
|
|
1344
|
-
exports.StyledIcon = styled5__default.default.svg`
|
|
1345
|
-
width: ${({ sizeVar }) => sizeVar && getIconSize(sizeVar)};
|
|
1346
|
-
min-width: ${({ sizeVar }) => sizeVar && getIconSize(sizeVar)};
|
|
1347
|
-
height: ${({ sizeVar }) => sizeVar && getIconSize(sizeVar)};
|
|
1348
|
-
min-height: ${({ sizeVar }) => sizeVar && getIconSize(sizeVar)};
|
|
1349
|
-
|
|
1350
|
-
& > path {
|
|
1351
|
-
fill: ${({ color }) => color && exports.colorTokens[color]};
|
|
1352
|
-
}
|
|
1353
|
-
`;
|
|
1354
|
-
var Icon = React3.forwardRef((_a, ref) => {
|
|
1355
|
-
var _b = _a, { iconSource } = _b, rest = __objRest(_b, ["iconSource"]);
|
|
1356
|
-
return /* @__PURE__ */ jsxRuntime.jsx(exports.StyledIcon, __spreadProps(__spreadValues({ as: iconSource, ref }, rest), { "data-shoplflow": "Icon" }));
|
|
1357
|
-
});
|
|
1358
|
-
exports.Icon = Icon;
|
|
1359
1340
|
var IconButton = React3.forwardRef(
|
|
1360
1341
|
(_a, ref) => {
|
|
1361
|
-
var _b = _a, { styleVar, sizeVar, disabled,
|
|
1342
|
+
var _b = _a, { styleVar, sizeVar, disabled, children, color } = _b, rest = __objRest(_b, ["styleVar", "sizeVar", "disabled", "children", "color"]);
|
|
1362
1343
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1363
1344
|
StyledIconButton,
|
|
1364
1345
|
__spreadProps(__spreadValues({
|
|
1365
1346
|
styleVar,
|
|
1366
1347
|
sizeVar,
|
|
1367
1348
|
disabled,
|
|
1368
|
-
|
|
1349
|
+
color,
|
|
1369
1350
|
ref
|
|
1370
1351
|
}, rest), {
|
|
1371
1352
|
"data-shoplflow": "IconButton",
|
|
1372
|
-
children
|
|
1353
|
+
children
|
|
1373
1354
|
})
|
|
1374
1355
|
);
|
|
1375
1356
|
}
|
|
@@ -1382,6 +1363,8 @@ exports.iconButtonSizeVar = {
|
|
|
1382
1363
|
M: "M"
|
|
1383
1364
|
};
|
|
1384
1365
|
exports.iconButtonStyleVar = {
|
|
1366
|
+
PRIMARY: "PRIMARY",
|
|
1367
|
+
SECONDARY: "SECONDARY",
|
|
1385
1368
|
SOLID: "SOLID",
|
|
1386
1369
|
GHOST: "GHOST"
|
|
1387
1370
|
};
|
|
@@ -1670,6 +1653,48 @@ var InputWrapper = styled5__default.default.label`
|
|
|
1670
1653
|
overflow: hidden;
|
|
1671
1654
|
${({ disabled }) => getDisabledStyle(disabled)};
|
|
1672
1655
|
`;
|
|
1656
|
+
|
|
1657
|
+
// src/components/Icon/Icon.types.ts
|
|
1658
|
+
exports.IconSizeVariants = {
|
|
1659
|
+
XS: "XS",
|
|
1660
|
+
S: "S",
|
|
1661
|
+
M: "M",
|
|
1662
|
+
L: "L",
|
|
1663
|
+
XL: "XL"
|
|
1664
|
+
};
|
|
1665
|
+
|
|
1666
|
+
// src/components/Icon/Icon.styled.ts
|
|
1667
|
+
var getIconSize = (size) => {
|
|
1668
|
+
switch (size) {
|
|
1669
|
+
case exports.IconSizeVariants.XS:
|
|
1670
|
+
return "12px";
|
|
1671
|
+
case exports.IconSizeVariants.S:
|
|
1672
|
+
return "20px";
|
|
1673
|
+
case exports.IconSizeVariants.M:
|
|
1674
|
+
return "24px";
|
|
1675
|
+
case exports.IconSizeVariants.L:
|
|
1676
|
+
return "30px";
|
|
1677
|
+
case exports.IconSizeVariants.XL:
|
|
1678
|
+
return "36px";
|
|
1679
|
+
default:
|
|
1680
|
+
return "24px";
|
|
1681
|
+
}
|
|
1682
|
+
};
|
|
1683
|
+
exports.StyledIcon = styled5__default.default.svg`
|
|
1684
|
+
width: ${({ sizeVar }) => sizeVar && getIconSize(sizeVar)};
|
|
1685
|
+
min-width: ${({ sizeVar }) => sizeVar && getIconSize(sizeVar)};
|
|
1686
|
+
height: ${({ sizeVar }) => sizeVar && getIconSize(sizeVar)};
|
|
1687
|
+
min-height: ${({ sizeVar }) => sizeVar && getIconSize(sizeVar)};
|
|
1688
|
+
|
|
1689
|
+
& > path {
|
|
1690
|
+
fill: ${({ color }) => color && exports.colorTokens[color]};
|
|
1691
|
+
}
|
|
1692
|
+
`;
|
|
1693
|
+
var Icon = React3.forwardRef((_a, ref) => {
|
|
1694
|
+
var _b = _a, { iconSource } = _b, rest = __objRest(_b, ["iconSource"]);
|
|
1695
|
+
return /* @__PURE__ */ jsxRuntime.jsx(exports.StyledIcon, __spreadProps(__spreadValues({ as: iconSource, ref }, rest), { "data-shoplflow": "Icon" }));
|
|
1696
|
+
});
|
|
1697
|
+
exports.Icon = Icon;
|
|
1673
1698
|
var DropdownButton = React3.forwardRef(
|
|
1674
1699
|
(_a, ref) => {
|
|
1675
1700
|
var _b = _a, { width, onClick, sizeVar = "M", placeholder, value, disabled, leftSource } = _b, rest = __objRest(_b, ["width", "onClick", "sizeVar", "placeholder", "value", "disabled", "leftSource"]);
|
|
@@ -1968,26 +1993,14 @@ var Input = React3.forwardRef(
|
|
|
1968
1993
|
),
|
|
1969
1994
|
/* @__PURE__ */ jsxRuntime.jsxs(RightElementWrapper, { children: [
|
|
1970
1995
|
maxLength && isFocused && /* @__PURE__ */ jsxRuntime.jsx(TextCounter_default, { currentLength: String(text).length, maxLength }),
|
|
1971
|
-
isFocused && Boolean(String(text).length > 0) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
sizeVar: "S",
|
|
1975
|
-
onClick: handleOnClear,
|
|
1976
|
-
styleVar: "GHOST",
|
|
1977
|
-
iconSource: assetFunction("DeleteIcon"),
|
|
1978
|
-
color: "neutral600"
|
|
1979
|
-
}
|
|
1980
|
-
),
|
|
1981
|
-
initialType === "password" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1982
|
-
exports.IconButton,
|
|
1996
|
+
isFocused && Boolean(String(text).length > 0) && /* @__PURE__ */ jsxRuntime.jsx(exports.IconButton, { sizeVar: "S", onClick: handleOnClear, styleVar: "GHOST", children: /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { iconSource: assetFunction("DeleteIcon"), color: "neutral600" }) }),
|
|
1997
|
+
initialType === "password" && /* @__PURE__ */ jsxRuntime.jsx(exports.IconButton, { sizeVar: "S", onClick: handleTogglePasswordType, styleVar: "GHOST", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1998
|
+
exports.Icon,
|
|
1983
1999
|
{
|
|
1984
|
-
sizeVar: "S",
|
|
1985
|
-
onClick: handleTogglePasswordType,
|
|
1986
|
-
styleVar: "GHOST",
|
|
1987
2000
|
color: "neutral600",
|
|
1988
2001
|
iconSource: assetFunction(type === "password" ? "ViewOffIcon" : "ViewOnIcon")
|
|
1989
2002
|
}
|
|
1990
|
-
)
|
|
2003
|
+
) })
|
|
1991
2004
|
] })
|
|
1992
2005
|
]
|
|
1993
2006
|
}
|
|
@@ -2001,6 +2014,7 @@ exports.StyledInputButton = styled5__default.default.button`
|
|
|
2001
2014
|
align-items: center;
|
|
2002
2015
|
justify-content: space-between;
|
|
2003
2016
|
width: 100%;
|
|
2017
|
+
background: ${exports.colorTokens.neutral0};
|
|
2004
2018
|
gap: 4px;
|
|
2005
2019
|
padding: 4px 4px 4px 12px;
|
|
2006
2020
|
cursor: pointer;
|
|
@@ -2086,17 +2100,7 @@ var InputButton = React3.forwardRef(
|
|
|
2086
2100
|
children: /* @__PURE__ */ jsxRuntime.jsxs(exports.StyledInputButton, __spreadProps(__spreadValues({}, rest), { onClick: handleOnClick, disabled, ref, children: [
|
|
2087
2101
|
text && text.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(exports.Text, { typography: "body1_400", color: "neutral700", textOverflow: "ellipsis", lineClamp: 1, children: text }) : /* @__PURE__ */ jsxRuntime.jsx(exports.Text, { typography: "body1_400", color: "neutral350", textOverflow: "ellipsis", lineClamp: 1, children: placeholder }),
|
|
2088
2102
|
/* @__PURE__ */ jsxRuntime.jsxs(exports.Stack.Horizontal, { align: "center", children: [
|
|
2089
|
-
value && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2090
|
-
exports.IconButton,
|
|
2091
|
-
{
|
|
2092
|
-
sizeVar: "S",
|
|
2093
|
-
onClick: handleOnClear,
|
|
2094
|
-
styleVar: "GHOST",
|
|
2095
|
-
iconSource: assetFunction("DeleteIcon"),
|
|
2096
|
-
color: "neutral600",
|
|
2097
|
-
disabled
|
|
2098
|
-
}
|
|
2099
|
-
),
|
|
2103
|
+
value && /* @__PURE__ */ jsxRuntime.jsx(exports.IconButton, { sizeVar: "S", onClick: handleOnClear, styleVar: "GHOST", disabled, children: /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { iconSource: assetFunction("DeleteIcon"), color: "neutral600" }) }),
|
|
2100
2104
|
rightSource
|
|
2101
2105
|
] })
|
|
2102
2106
|
] }))
|