@shoplflow/base 0.13.9 → 0.15.0
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 +141 -101
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +101 -12
- package/dist/index.d.ts +101 -12
- package/dist/index.js +69 -57
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -6,10 +6,10 @@ var framerMotion = require('framer-motion');
|
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var reactDom$1 = require('react-dom');
|
|
8
8
|
var utils = require('@shoplflow/utils');
|
|
9
|
-
var react = require('@emotion/react');
|
|
9
|
+
var react$1 = require('@emotion/react');
|
|
10
10
|
var Scrollbars = require('react-custom-scrollbars-2');
|
|
11
|
+
var react = require('@floating-ui/react');
|
|
11
12
|
var reactDom = require('@floating-ui/react-dom');
|
|
12
|
-
var react$1 = require('@floating-ui/react');
|
|
13
13
|
var ShoplAssets = require('@shoplflow/shopl-assets');
|
|
14
14
|
var HadaAssets = require('@shoplflow/hada-assets');
|
|
15
15
|
|
|
@@ -506,7 +506,7 @@ exports.MotionStack.Vertical = framerMotion.motion(Stack.Vertical);
|
|
|
506
506
|
exports.MotionStack.Horizontal = framerMotion.motion(Stack.Horizontal);
|
|
507
507
|
exports.Stack = Stack;
|
|
508
508
|
var setEllipsis = (maxLines) => {
|
|
509
|
-
return react.css`
|
|
509
|
+
return react$1.css`
|
|
510
510
|
display: -webkit-box;
|
|
511
511
|
line-clamp: ${maxLines};
|
|
512
512
|
-webkit-line-clamp: ${maxLines};
|
|
@@ -522,13 +522,13 @@ var StyledText = styled5__default.default.span`
|
|
|
522
522
|
${({ lineClamp }) => lineClamp && setEllipsis(lineClamp)};
|
|
523
523
|
text-align: ${({ textAlign }) => textAlign && textAlign};
|
|
524
524
|
white-space: ${({ whiteSpace }) => whiteSpace && whiteSpace};
|
|
525
|
-
${({ textDecorations }) => textDecorations && react.css`
|
|
525
|
+
${({ textDecorations }) => textDecorations && react$1.css`
|
|
526
526
|
text-decoration: ${textDecorations};
|
|
527
527
|
`};
|
|
528
|
-
${({ opacity }) => opacity && react.css`
|
|
528
|
+
${({ opacity }) => opacity && react$1.css`
|
|
529
529
|
opacity: ${opacity};
|
|
530
530
|
`}
|
|
531
|
-
${({ wordBreak }) => wordBreak && react.css`
|
|
531
|
+
${({ wordBreak }) => wordBreak && react$1.css`
|
|
532
532
|
word-break: ${wordBreak};
|
|
533
533
|
`};
|
|
534
534
|
`;
|
|
@@ -578,8 +578,8 @@ var MODAL_SIZE_M = 640;
|
|
|
578
578
|
var MODAL_SIZE_L = 768;
|
|
579
579
|
var MODAL_SIZE_XL = 1040;
|
|
580
580
|
var MODAL_SIZE_XXL = 1280;
|
|
581
|
-
var getModalWidthFromSize = (
|
|
582
|
-
switch (
|
|
581
|
+
var getModalWidthFromSize = (size2) => {
|
|
582
|
+
switch (size2) {
|
|
583
583
|
case "XXS":
|
|
584
584
|
return MODAL_SIZE_XXS;
|
|
585
585
|
case "XS":
|
|
@@ -600,12 +600,12 @@ var getModalWidthFromSize = (size) => {
|
|
|
600
600
|
};
|
|
601
601
|
var getModalBodyTopBottomPadding = (isIncludeHeader) => {
|
|
602
602
|
if (isIncludeHeader) {
|
|
603
|
-
return react.css`
|
|
603
|
+
return react$1.css`
|
|
604
604
|
padding-top: 16px;
|
|
605
605
|
padding-bottom: 24px;
|
|
606
606
|
`;
|
|
607
607
|
}
|
|
608
|
-
return react.css`
|
|
608
|
+
return react$1.css`
|
|
609
609
|
padding-top: 24px;
|
|
610
610
|
padding-bottom: 24px;
|
|
611
611
|
`;
|
|
@@ -645,14 +645,21 @@ var BodyContainer = styled5__default.default.div`
|
|
|
645
645
|
flex: 1;
|
|
646
646
|
${({ isIncludeHeader }) => getModalBodyTopBottomPadding(isIncludeHeader)}
|
|
647
647
|
`;
|
|
648
|
+
var ModalBodyContainerInner = styled5__default.default.div`
|
|
649
|
+
display: grid;
|
|
650
|
+
align-self: stretch;
|
|
651
|
+
flex-direction: column;
|
|
652
|
+
flex-grow: 1;
|
|
653
|
+
//스크롤 생성시 하단 padding 적용하기 위한 설정
|
|
654
|
+
height: calc(100%);
|
|
655
|
+
box-sizing: border-box;
|
|
656
|
+
`;
|
|
648
657
|
var ModalBodyContent = styled5__default.default.div`
|
|
649
658
|
display: flex;
|
|
650
659
|
flex-direction: column;
|
|
651
|
-
|
|
652
|
-
max-width: ${({ sizeVar }) => getModalWidthFromSize(sizeVar)}px;
|
|
660
|
+
height: 100%;
|
|
653
661
|
box-sizing: border-box;
|
|
654
662
|
padding: 0 24px;
|
|
655
|
-
overflow: hidden;
|
|
656
663
|
background: ${exports.colorTokens.neutral0};
|
|
657
664
|
`;
|
|
658
665
|
var FooterContainer = styled5__default.default.div`
|
|
@@ -718,6 +725,11 @@ var ModalFooter = ({ children }) => {
|
|
|
718
725
|
};
|
|
719
726
|
ModalFooter[exports.MODAL_FOOTER_KEY] = true;
|
|
720
727
|
var ModalFooter_default = ModalFooter;
|
|
728
|
+
var ScrollArea = (_a) => {
|
|
729
|
+
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
|
730
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Scrollbars__default.default, __spreadProps(__spreadValues({ autoHide: true, autoHideTimeout: 1e3, autoHideDuration: 200 }, rest), { "data-shoplflow": "ScrollArea", children }));
|
|
731
|
+
};
|
|
732
|
+
exports.ScrollArea = ScrollArea;
|
|
721
733
|
var ModalBody = ({
|
|
722
734
|
children,
|
|
723
735
|
isIncludeHeader = false,
|
|
@@ -752,20 +764,18 @@ var ModalBody = ({
|
|
|
752
764
|
const heightUnderMaxHeight = windowHeight - topBottomMargin - headerFooterHeight;
|
|
753
765
|
const heightOverMaxHeight = 1200 - topBottomMargin - headerFooterHeight;
|
|
754
766
|
return /* @__PURE__ */ jsxRuntime.jsx(BodyContainer, { isIncludeHeader, height: setAutoHeightMin(), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
755
|
-
|
|
767
|
+
exports.ScrollArea,
|
|
756
768
|
{
|
|
757
769
|
id: `scrollbar`,
|
|
770
|
+
universal: true,
|
|
758
771
|
autoHeight: !modalContainerHeight,
|
|
759
772
|
autoHeightMin: setAutoHeightMin(),
|
|
760
773
|
autoHeightMax: windowHeight > 1200 ? heightOverMaxHeight : heightUnderMaxHeight,
|
|
761
|
-
autoHide: true,
|
|
762
|
-
autoHideTimeout: 1e3,
|
|
763
|
-
autoHideDuration: 200,
|
|
764
774
|
style: {
|
|
765
775
|
height: "100%",
|
|
766
776
|
overflow: "hidden"
|
|
767
777
|
},
|
|
768
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(ModalBodyContent, { isIncludeHeader, sizeVar, children })
|
|
778
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ModalBodyContainerInner, { children: /* @__PURE__ */ jsxRuntime.jsx(ModalBodyContent, { isIncludeHeader, sizeVar, children }) })
|
|
769
779
|
}
|
|
770
780
|
) });
|
|
771
781
|
};
|
|
@@ -900,7 +910,7 @@ var getDisabledStyle = (disabled) => {
|
|
|
900
910
|
if (!disabled) {
|
|
901
911
|
return;
|
|
902
912
|
}
|
|
903
|
-
return react.css`
|
|
913
|
+
return react$1.css`
|
|
904
914
|
opacity: 50%;
|
|
905
915
|
cursor: not-allowed !important;
|
|
906
916
|
`;
|
|
@@ -917,7 +927,7 @@ var getLineTypographyBySizeVar = (sizeVar) => {
|
|
|
917
927
|
return "body2_400";
|
|
918
928
|
}
|
|
919
929
|
};
|
|
920
|
-
var solidStyle = ({ isSelected, color, radius }) => react.css`
|
|
930
|
+
var solidStyle = ({ isSelected, color, radius }) => react$1.css`
|
|
921
931
|
padding: 7px 12px;
|
|
922
932
|
gap: 4px;
|
|
923
933
|
background: ${exports.colorTokens.neutral150};
|
|
@@ -929,10 +939,10 @@ var solidStyle = ({ isSelected, color, radius }) => react.css`
|
|
|
929
939
|
background: ${exports.colorTokens.neutral200};
|
|
930
940
|
}
|
|
931
941
|
|
|
932
|
-
${radius && react.css`
|
|
942
|
+
${radius && react$1.css`
|
|
933
943
|
border-radius: ${exports.borderRadiusTokens.borderRadius16};
|
|
934
944
|
`};
|
|
935
|
-
${isSelected && react.css`
|
|
945
|
+
${isSelected && react$1.css`
|
|
936
946
|
background: ${exports.colorTokens[color]};
|
|
937
947
|
& > span {
|
|
938
948
|
color: ${exports.colorTokens["neutral0"]};
|
|
@@ -1027,7 +1037,7 @@ var getLineTypographyBySizeVar2 = (sizeVar) => {
|
|
|
1027
1037
|
return "body3_400";
|
|
1028
1038
|
}
|
|
1029
1039
|
};
|
|
1030
|
-
var lineStyle = ({ color }) => react.css`
|
|
1040
|
+
var lineStyle = ({ color }) => react$1.css`
|
|
1031
1041
|
background: ${exports.colorTokens.neutral0};
|
|
1032
1042
|
border: 1px solid ${exports.colorTokens[color]};
|
|
1033
1043
|
border-radius: ${exports.borderRadiusTokens.borderRadius20};
|
|
@@ -1041,15 +1051,15 @@ var lineStyle = ({ color }) => react.css`
|
|
|
1041
1051
|
var getStyleBySizeVar = (sizeVar) => {
|
|
1042
1052
|
switch (sizeVar) {
|
|
1043
1053
|
case "XS":
|
|
1044
|
-
return react.css`
|
|
1054
|
+
return react$1.css`
|
|
1045
1055
|
padding: 4px 8px;
|
|
1046
1056
|
`;
|
|
1047
1057
|
case "S":
|
|
1048
|
-
return react.css`
|
|
1058
|
+
return react$1.css`
|
|
1049
1059
|
padding: 7px 12px;
|
|
1050
1060
|
`;
|
|
1051
1061
|
default:
|
|
1052
|
-
return react.css`
|
|
1062
|
+
return react$1.css`
|
|
1053
1063
|
padding: 7px 12px;
|
|
1054
1064
|
`;
|
|
1055
1065
|
}
|
|
@@ -1113,7 +1123,7 @@ exports.ChipButton = ChipButton;
|
|
|
1113
1123
|
var getStyleByStyleVar = (styleVar, color, disabled) => {
|
|
1114
1124
|
switch (styleVar) {
|
|
1115
1125
|
case "PRIMARY":
|
|
1116
|
-
return react.css`
|
|
1126
|
+
return react$1.css`
|
|
1117
1127
|
border: 1px solid ${exports.colorTokens.primary400};
|
|
1118
1128
|
background-color: ${exports.colorTokens.primary300};
|
|
1119
1129
|
:hover {
|
|
@@ -1121,7 +1131,7 @@ var getStyleByStyleVar = (styleVar, color, disabled) => {
|
|
|
1121
1131
|
}
|
|
1122
1132
|
`;
|
|
1123
1133
|
case "SECONDARY":
|
|
1124
|
-
return react.css`
|
|
1134
|
+
return react$1.css`
|
|
1125
1135
|
border: 1px solid ${exports.colorTokens.neutral350};
|
|
1126
1136
|
background-color: ${exports.colorTokens.neutral0};
|
|
1127
1137
|
:hover {
|
|
@@ -1132,7 +1142,7 @@ var getStyleByStyleVar = (styleVar, color, disabled) => {
|
|
|
1132
1142
|
if (!color) {
|
|
1133
1143
|
throw new Error("Button\uC758 SOLID \uC18D\uC131\uC740 color\uB97C \uD544\uC218\uB85C \uBC1B\uC2B5\uB2C8\uB2E4.");
|
|
1134
1144
|
}
|
|
1135
|
-
return react.css`
|
|
1145
|
+
return react$1.css`
|
|
1136
1146
|
border: 1px solid ${exports.colorTokens[getNextColor(color)]};
|
|
1137
1147
|
background-color: ${exports.colorTokens[color]};
|
|
1138
1148
|
:hover {
|
|
@@ -1140,7 +1150,7 @@ var getStyleByStyleVar = (styleVar, color, disabled) => {
|
|
|
1140
1150
|
}
|
|
1141
1151
|
`;
|
|
1142
1152
|
case "GHOST":
|
|
1143
|
-
return react.css`
|
|
1153
|
+
return react$1.css`
|
|
1144
1154
|
border: 1px solid transparent;
|
|
1145
1155
|
background-color: transparent;
|
|
1146
1156
|
:hover {
|
|
@@ -1148,7 +1158,7 @@ var getStyleByStyleVar = (styleVar, color, disabled) => {
|
|
|
1148
1158
|
}
|
|
1149
1159
|
`;
|
|
1150
1160
|
default:
|
|
1151
|
-
return react.css`
|
|
1161
|
+
return react$1.css`
|
|
1152
1162
|
border: 1px solid ${exports.colorTokens.primary400};
|
|
1153
1163
|
background-color: ${exports.colorTokens.primary300};
|
|
1154
1164
|
`;
|
|
@@ -1157,17 +1167,17 @@ var getStyleByStyleVar = (styleVar, color, disabled) => {
|
|
|
1157
1167
|
var getStyleBySizeVar2 = (sizeVar) => {
|
|
1158
1168
|
switch (sizeVar) {
|
|
1159
1169
|
case "M":
|
|
1160
|
-
return react.css`
|
|
1170
|
+
return react$1.css`
|
|
1161
1171
|
min-width: 72px;
|
|
1162
1172
|
min-height: 40px;
|
|
1163
1173
|
`;
|
|
1164
1174
|
case "S":
|
|
1165
|
-
return react.css`
|
|
1175
|
+
return react$1.css`
|
|
1166
1176
|
min-width: 54px;
|
|
1167
1177
|
min-height: 32px;
|
|
1168
1178
|
`;
|
|
1169
1179
|
default:
|
|
1170
|
-
return react.css`
|
|
1180
|
+
return react$1.css`
|
|
1171
1181
|
min-width: 72px;
|
|
1172
1182
|
min-height: 40px;
|
|
1173
1183
|
`;
|
|
@@ -1254,21 +1264,21 @@ exports.buttonStyleVar = {
|
|
|
1254
1264
|
var getWidthAndHeightFromSizeVar = (sizeVar) => {
|
|
1255
1265
|
switch (sizeVar) {
|
|
1256
1266
|
case "M":
|
|
1257
|
-
return react.css`
|
|
1267
|
+
return react$1.css`
|
|
1258
1268
|
width: 40px;
|
|
1259
1269
|
min-width: 40px;
|
|
1260
1270
|
height: 40px;
|
|
1261
1271
|
min-height: 40px;
|
|
1262
1272
|
`;
|
|
1263
1273
|
case "S":
|
|
1264
|
-
return react.css`
|
|
1274
|
+
return react$1.css`
|
|
1265
1275
|
width: 32px;
|
|
1266
1276
|
min-width: 32px;
|
|
1267
1277
|
height: 32px;
|
|
1268
1278
|
min-height: 32px;
|
|
1269
1279
|
`;
|
|
1270
1280
|
default:
|
|
1271
|
-
return react.css`
|
|
1281
|
+
return react$1.css`
|
|
1272
1282
|
width: 40px;
|
|
1273
1283
|
min-width: 40px;
|
|
1274
1284
|
height: 40px;
|
|
@@ -1279,7 +1289,7 @@ var getWidthAndHeightFromSizeVar = (sizeVar) => {
|
|
|
1279
1289
|
var getStyleByStyleVar2 = (styleVar, color) => {
|
|
1280
1290
|
switch (styleVar) {
|
|
1281
1291
|
case "PRIMARY":
|
|
1282
|
-
return react.css`
|
|
1292
|
+
return react$1.css`
|
|
1283
1293
|
background: ${exports.colorTokens.primary300};
|
|
1284
1294
|
border: 1px solid ${exports.colorTokens.primary400};
|
|
1285
1295
|
&:hover {
|
|
@@ -1287,7 +1297,7 @@ var getStyleByStyleVar2 = (styleVar, color) => {
|
|
|
1287
1297
|
}
|
|
1288
1298
|
`;
|
|
1289
1299
|
case "SECONDARY":
|
|
1290
|
-
return react.css`
|
|
1300
|
+
return react$1.css`
|
|
1291
1301
|
background: ${exports.colorTokens.neutral0};
|
|
1292
1302
|
border: 1px solid ${exports.colorTokens.neutral350};
|
|
1293
1303
|
&:hover {
|
|
@@ -1298,7 +1308,7 @@ var getStyleByStyleVar2 = (styleVar, color) => {
|
|
|
1298
1308
|
if (!color) {
|
|
1299
1309
|
throw new Error("IconButton\uC758 SOLID \uC18D\uC131\uC740 color\uB97C \uD544\uC218\uB85C \uBC1B\uC2B5\uB2C8\uB2E4.");
|
|
1300
1310
|
}
|
|
1301
|
-
return react.css`
|
|
1311
|
+
return react$1.css`
|
|
1302
1312
|
border: 1px solid ${exports.colorTokens[getNextColor(color)]};
|
|
1303
1313
|
background: ${exports.colorTokens[color]};
|
|
1304
1314
|
&:hover {
|
|
@@ -1306,14 +1316,14 @@ var getStyleByStyleVar2 = (styleVar, color) => {
|
|
|
1306
1316
|
}
|
|
1307
1317
|
`;
|
|
1308
1318
|
case "GHOST":
|
|
1309
|
-
return react.css`
|
|
1319
|
+
return react$1.css`
|
|
1310
1320
|
border: 1px solid transparent;
|
|
1311
1321
|
&:hover {
|
|
1312
1322
|
background: ${exports.colorTokens.neutral400_5};
|
|
1313
1323
|
}
|
|
1314
1324
|
`;
|
|
1315
1325
|
default:
|
|
1316
|
-
return react.css`
|
|
1326
|
+
return react$1.css`
|
|
1317
1327
|
border: 1px solid ${exports.colorTokens.neutral200};
|
|
1318
1328
|
&:hover {
|
|
1319
1329
|
background: ${exports.colorTokens.neutral100};
|
|
@@ -1368,7 +1378,7 @@ exports.iconButtonStyleVar = {
|
|
|
1368
1378
|
SOLID: "SOLID",
|
|
1369
1379
|
GHOST: "GHOST"
|
|
1370
1380
|
};
|
|
1371
|
-
var informationStyle = react.css`
|
|
1381
|
+
var informationStyle = react$1.css`
|
|
1372
1382
|
background: ${exports.colorTokens.neutral100};
|
|
1373
1383
|
& > span {
|
|
1374
1384
|
color: ${exports.colorTokens.neutral600};
|
|
@@ -1377,7 +1387,7 @@ var informationStyle = react.css`
|
|
|
1377
1387
|
fill: ${exports.colorTokens.neutral600};
|
|
1378
1388
|
}
|
|
1379
1389
|
`;
|
|
1380
|
-
var alertStyle = react.css`
|
|
1390
|
+
var alertStyle = react$1.css`
|
|
1381
1391
|
background: ${exports.colorTokens.red100};
|
|
1382
1392
|
& > span {
|
|
1383
1393
|
align-self: center;
|
|
@@ -1426,10 +1436,8 @@ exports.CalloutTypes = {
|
|
|
1426
1436
|
ALERT: "ALERT"
|
|
1427
1437
|
};
|
|
1428
1438
|
exports.StyledPopper = styled5__default.default.div`
|
|
1429
|
-
display: flex;
|
|
1430
|
-
flex-direction: row;
|
|
1431
1439
|
width: ${({ width }) => width != null ? width : "fit-content"};
|
|
1432
|
-
height: ${({ height }) => height
|
|
1440
|
+
height: ${({ height }) => height && height};
|
|
1433
1441
|
`;
|
|
1434
1442
|
var PopperContext = React3.createContext(null);
|
|
1435
1443
|
var usePopper = () => {
|
|
@@ -1475,10 +1483,10 @@ var Popper = ({
|
|
|
1475
1483
|
const { refs, floatingStyles } = reactDom.useFloating({
|
|
1476
1484
|
strategy,
|
|
1477
1485
|
placement,
|
|
1478
|
-
whileElementsMounted: react
|
|
1486
|
+
whileElementsMounted: react.autoUpdate,
|
|
1479
1487
|
middleware: [
|
|
1480
|
-
react
|
|
1481
|
-
initialAutoPlacement && react
|
|
1488
|
+
react.offset(initialOffset),
|
|
1489
|
+
initialAutoPlacement && react.autoPlacement(__spreadValues({
|
|
1482
1490
|
crossAxis: false
|
|
1483
1491
|
}, initialAutoPlacement)),
|
|
1484
1492
|
...middlewares != null ? middlewares : []
|
|
@@ -1502,7 +1510,7 @@ exports.PopperPortal = React3.forwardRef(
|
|
|
1502
1510
|
const { floatingStyles, setFloating, isOpen } = usePopper();
|
|
1503
1511
|
const animation = initialAnimation != null ? initialAnimation : fadeInOut;
|
|
1504
1512
|
const refs = useMergeRefs(ref, setFloating);
|
|
1505
|
-
return /* @__PURE__ */ jsxRuntime.jsx(react
|
|
1513
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.FloatingPortal, { id: "popper-portal-key", children: /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: isOpen && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1506
1514
|
framerMotion.motion.div,
|
|
1507
1515
|
{
|
|
1508
1516
|
initial: animation.initial,
|
|
@@ -1518,8 +1526,8 @@ exports.PopperPortal = React3.forwardRef(
|
|
|
1518
1526
|
Popper.Trigger = exports.PopperTrigger;
|
|
1519
1527
|
Popper.Portal = exports.PopperPortal;
|
|
1520
1528
|
exports.Popper = Popper;
|
|
1521
|
-
exports.getDropdownHeightBySizeVar = (
|
|
1522
|
-
switch (
|
|
1529
|
+
exports.getDropdownHeightBySizeVar = (size2) => {
|
|
1530
|
+
switch (size2) {
|
|
1523
1531
|
case "M":
|
|
1524
1532
|
return "40px";
|
|
1525
1533
|
case "S":
|
|
@@ -1528,8 +1536,8 @@ exports.getDropdownHeightBySizeVar = (size) => {
|
|
|
1528
1536
|
return "40px";
|
|
1529
1537
|
}
|
|
1530
1538
|
};
|
|
1531
|
-
exports.getDropdownFontSizeBySizeVar = (
|
|
1532
|
-
switch (
|
|
1539
|
+
exports.getDropdownFontSizeBySizeVar = (size2) => {
|
|
1540
|
+
switch (size2) {
|
|
1533
1541
|
case "M":
|
|
1534
1542
|
return "body1_400";
|
|
1535
1543
|
case "S":
|
|
@@ -1538,40 +1546,40 @@ exports.getDropdownFontSizeBySizeVar = (size) => {
|
|
|
1538
1546
|
return "body1_400";
|
|
1539
1547
|
}
|
|
1540
1548
|
};
|
|
1541
|
-
exports.getDropdownStyleBySizeVar = (
|
|
1542
|
-
switch (
|
|
1549
|
+
exports.getDropdownStyleBySizeVar = (size2) => {
|
|
1550
|
+
switch (size2) {
|
|
1543
1551
|
case "M":
|
|
1544
|
-
return react.css`
|
|
1552
|
+
return react$1.css`
|
|
1545
1553
|
padding: 4px 4px 4px 12px;
|
|
1546
1554
|
`;
|
|
1547
1555
|
case "S":
|
|
1548
|
-
return react.css`
|
|
1556
|
+
return react$1.css`
|
|
1549
1557
|
padding: 4px 4px 4px 8px;
|
|
1550
1558
|
`;
|
|
1551
1559
|
default:
|
|
1552
|
-
return react.css`
|
|
1560
|
+
return react$1.css`
|
|
1553
1561
|
padding: 4px 4px 4px 12px;
|
|
1554
1562
|
`;
|
|
1555
1563
|
}
|
|
1556
1564
|
};
|
|
1557
|
-
exports.getDropdownIconSizeBySizeVar = (
|
|
1558
|
-
switch (
|
|
1565
|
+
exports.getDropdownIconSizeBySizeVar = (size2) => {
|
|
1566
|
+
switch (size2) {
|
|
1559
1567
|
case "S":
|
|
1560
|
-
return react.css`
|
|
1568
|
+
return react$1.css`
|
|
1561
1569
|
height: 24px;
|
|
1562
1570
|
width: 24px;
|
|
1563
1571
|
min-width: 24px;
|
|
1564
1572
|
min-height: 24px;
|
|
1565
1573
|
`;
|
|
1566
1574
|
case "M":
|
|
1567
|
-
return react.css`
|
|
1575
|
+
return react$1.css`
|
|
1568
1576
|
height: 32px;
|
|
1569
1577
|
width: 32px;
|
|
1570
1578
|
min-width: 32px;
|
|
1571
1579
|
min-height: 32px;
|
|
1572
1580
|
`;
|
|
1573
1581
|
default:
|
|
1574
|
-
return react.css`
|
|
1582
|
+
return react$1.css`
|
|
1575
1583
|
height: 32px;
|
|
1576
1584
|
width: 32px;
|
|
1577
1585
|
min-width: 32px;
|
|
@@ -1580,10 +1588,7 @@ exports.getDropdownIconSizeBySizeVar = (size) => {
|
|
|
1580
1588
|
}
|
|
1581
1589
|
};
|
|
1582
1590
|
exports.StyledDropdown = styled5__default.default.div`
|
|
1583
|
-
|
|
1584
|
-
width: fit-content;
|
|
1585
|
-
height: fit-content;
|
|
1586
|
-
flex-direction: row;
|
|
1591
|
+
width: ${({ width }) => width};
|
|
1587
1592
|
`;
|
|
1588
1593
|
exports.StyledDropdownContent = styled5__default.default.div`
|
|
1589
1594
|
display: flex;
|
|
@@ -1604,7 +1609,7 @@ exports.StyledDropdownButton = styled5__default.default.button`
|
|
|
1604
1609
|
gap: 8px;
|
|
1605
1610
|
cursor: pointer;
|
|
1606
1611
|
${({ sizeVar }) => sizeVar && exports.getDropdownStyleBySizeVar(sizeVar)};
|
|
1607
|
-
${({ disabled }) => disabled && react.css`
|
|
1612
|
+
${({ disabled }) => disabled && react$1.css`
|
|
1608
1613
|
cursor: not-allowed;
|
|
1609
1614
|
`}
|
|
1610
1615
|
`;
|
|
@@ -1664,8 +1669,8 @@ exports.IconSizeVariants = {
|
|
|
1664
1669
|
};
|
|
1665
1670
|
|
|
1666
1671
|
// src/components/Icon/Icon.styled.ts
|
|
1667
|
-
var getIconSize = (
|
|
1668
|
-
switch (
|
|
1672
|
+
var getIconSize = (size2) => {
|
|
1673
|
+
switch (size2) {
|
|
1669
1674
|
case exports.IconSizeVariants.XS:
|
|
1670
1675
|
return "12px";
|
|
1671
1676
|
case exports.IconSizeVariants.S:
|
|
@@ -1761,32 +1766,37 @@ var DropdownButton = React3.forwardRef(
|
|
|
1761
1766
|
);
|
|
1762
1767
|
}
|
|
1763
1768
|
);
|
|
1764
|
-
var DropdownContent =
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1769
|
+
var DropdownContent = (_a) => {
|
|
1770
|
+
var _b = _a, { children, width: initialWidth, type, onClick } = _b, rest = __objRest(_b, ["children", "width", "type", "onClick"]);
|
|
1771
|
+
const { width, setIsOpen, option } = useDropdown();
|
|
1772
|
+
const isFillType = type === "FILL";
|
|
1773
|
+
const contentWidth = isFillType ? `${width}px` : initialWidth;
|
|
1774
|
+
const returnCallbackByOption = () => {
|
|
1775
|
+
if (option === "OUTSIDE_CLICK") {
|
|
1776
|
+
return () => setIsOpen(false);
|
|
1777
|
+
}
|
|
1778
|
+
if (option === "CLICK") {
|
|
1779
|
+
return () => setIsOpen(false);
|
|
1780
|
+
}
|
|
1781
|
+
return utils.noop;
|
|
1782
|
+
};
|
|
1783
|
+
const handleClick = (e) => {
|
|
1784
|
+
onClick && onClick(e);
|
|
1785
|
+
if (option === "CLICK") {
|
|
1786
|
+
setIsOpen(false);
|
|
1787
|
+
}
|
|
1788
|
+
};
|
|
1789
|
+
return /* @__PURE__ */ jsxRuntime.jsx(utils.OutSideClick, { outsideClick: returnCallbackByOption(), children: /* @__PURE__ */ jsxRuntime.jsx(exports.StyledDropdownContent, __spreadProps(__spreadValues({ width: contentWidth, onClick: handleClick }, rest), { children })) });
|
|
1790
|
+
};
|
|
1791
|
+
var Dropdown = ({
|
|
1792
|
+
isOpen: initialIsOpen = false,
|
|
1793
|
+
trigger,
|
|
1794
|
+
popper,
|
|
1795
|
+
option = "CLICK",
|
|
1796
|
+
width = "100%"
|
|
1797
|
+
}) => {
|
|
1788
1798
|
const [triggerRef, setTriggerRef] = React3.useState(null);
|
|
1789
|
-
const [
|
|
1799
|
+
const [size2, setSize] = React3.useState({ width: 0, height: 0 });
|
|
1790
1800
|
const [isOpen, setIsOpen] = React3.useState(false);
|
|
1791
1801
|
React3.useEffect(() => {
|
|
1792
1802
|
if (triggerRef) {
|
|
@@ -1802,15 +1812,16 @@ var Dropdown = ({ isOpen: initialIsOpen, trigger, content, option = "OUTSIDE_CLI
|
|
|
1802
1812
|
}
|
|
1803
1813
|
setIsOpen(initialIsOpen);
|
|
1804
1814
|
}, [initialIsOpen]);
|
|
1805
|
-
return /* @__PURE__ */ jsxRuntime.jsx(exports.StyledDropdown, { "data-shoplflow": "Dropdown", children: /* @__PURE__ */ jsxRuntime.jsx(DropdownContext.Provider, { value: __spreadProps(__spreadValues({},
|
|
1815
|
+
return /* @__PURE__ */ jsxRuntime.jsx(exports.StyledDropdown, { "data-shoplflow": "Dropdown", width, children: /* @__PURE__ */ jsxRuntime.jsx(DropdownContext.Provider, { value: __spreadProps(__spreadValues({}, size2), { isOpen, setIsOpen, option }), children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1806
1816
|
exports.Popper,
|
|
1807
1817
|
{
|
|
1818
|
+
offset: 4,
|
|
1808
1819
|
autoPlacement: {
|
|
1809
1820
|
allowedPlacements: ["bottom-start", "top-start"]
|
|
1810
1821
|
},
|
|
1811
1822
|
children: [
|
|
1812
|
-
/* @__PURE__ */ jsxRuntime.jsx(exports.Popper.Trigger, { ref: setTriggerRef, isOpen, children: trigger }),
|
|
1813
|
-
/* @__PURE__ */ jsxRuntime.jsx(exports.Popper.Portal, { children:
|
|
1823
|
+
/* @__PURE__ */ jsxRuntime.jsx(exports.Popper.Trigger, { ref: setTriggerRef, isOpen, width, children: trigger }),
|
|
1824
|
+
/* @__PURE__ */ jsxRuntime.jsx(exports.Popper.Portal, { children: popper })
|
|
1814
1825
|
]
|
|
1815
1826
|
}
|
|
1816
1827
|
) }) });
|
|
@@ -2018,7 +2029,7 @@ exports.StyledInputButton = styled5__default.default.button`
|
|
|
2018
2029
|
gap: 4px;
|
|
2019
2030
|
padding: 4px 4px 4px 12px;
|
|
2020
2031
|
cursor: pointer;
|
|
2021
|
-
${({ disabled }) => disabled && react.css`
|
|
2032
|
+
${({ disabled }) => disabled && react$1.css`
|
|
2022
2033
|
cursor: not-allowed;
|
|
2023
2034
|
`}
|
|
2024
2035
|
`;
|
|
@@ -2291,5 +2302,34 @@ var MinusButton = React3.forwardRef((_a, ref) => {
|
|
|
2291
2302
|
] }) })) });
|
|
2292
2303
|
});
|
|
2293
2304
|
exports.MinusButton = MinusButton;
|
|
2305
|
+
|
|
2306
|
+
Object.defineProperty(exports, 'arrow', {
|
|
2307
|
+
enumerable: true,
|
|
2308
|
+
get: function () { return react.arrow; }
|
|
2309
|
+
});
|
|
2310
|
+
Object.defineProperty(exports, 'flip', {
|
|
2311
|
+
enumerable: true,
|
|
2312
|
+
get: function () { return react.flip; }
|
|
2313
|
+
});
|
|
2314
|
+
Object.defineProperty(exports, 'hide', {
|
|
2315
|
+
enumerable: true,
|
|
2316
|
+
get: function () { return react.hide; }
|
|
2317
|
+
});
|
|
2318
|
+
Object.defineProperty(exports, 'inline', {
|
|
2319
|
+
enumerable: true,
|
|
2320
|
+
get: function () { return react.inline; }
|
|
2321
|
+
});
|
|
2322
|
+
Object.defineProperty(exports, 'offset', {
|
|
2323
|
+
enumerable: true,
|
|
2324
|
+
get: function () { return react.offset; }
|
|
2325
|
+
});
|
|
2326
|
+
Object.defineProperty(exports, 'shift', {
|
|
2327
|
+
enumerable: true,
|
|
2328
|
+
get: function () { return react.shift; }
|
|
2329
|
+
});
|
|
2330
|
+
Object.defineProperty(exports, 'size', {
|
|
2331
|
+
enumerable: true,
|
|
2332
|
+
get: function () { return react.size; }
|
|
2333
|
+
});
|
|
2294
2334
|
//# sourceMappingURL=out.js.map
|
|
2295
2335
|
//# sourceMappingURL=index.cjs.map
|