@shoplflow/base 0.46.12 → 0.46.14
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 +202 -204
- package/dist/index.d.cts +72 -72
- package/dist/index.d.ts +72 -72
- package/dist/index.js +52 -54
- package/package.json +2 -8
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var React = require('react');
|
|
4
4
|
var styled6 = require('@emotion/styled');
|
|
5
5
|
var framerMotion = require('framer-motion');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -39,7 +39,7 @@ function _interopNamespace(e) {
|
|
|
39
39
|
return Object.freeze(n);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
var
|
|
42
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
43
43
|
var styled6__default = /*#__PURE__*/_interopDefault(styled6);
|
|
44
44
|
var Scrollbars__default = /*#__PURE__*/_interopDefault(Scrollbars);
|
|
45
45
|
var ShoplAssets__namespace = /*#__PURE__*/_interopNamespace(ShoplAssets);
|
|
@@ -161,13 +161,13 @@ var require_classnames = __commonJS({
|
|
|
161
161
|
}
|
|
162
162
|
});
|
|
163
163
|
exports.useDomain = (domain = "SHOPL") => {
|
|
164
|
-
const [domainType, setDomainType] =
|
|
165
|
-
|
|
164
|
+
const [domainType, setDomainType] = React.useState(void 0);
|
|
165
|
+
React.useEffect(() => {
|
|
166
166
|
if (domain) {
|
|
167
167
|
setDomainType(domain);
|
|
168
168
|
}
|
|
169
169
|
}, [domain]);
|
|
170
|
-
|
|
170
|
+
React.useEffect(() => {
|
|
171
171
|
if (!domainType) {
|
|
172
172
|
return;
|
|
173
173
|
}
|
|
@@ -329,7 +329,7 @@ exports.AvatarSizeVariants = {
|
|
|
329
329
|
};
|
|
330
330
|
|
|
331
331
|
// src/components/Avatar/version.ts
|
|
332
|
-
exports.AVATAR_VERSION = "2.1.
|
|
332
|
+
exports.AVATAR_VERSION = "2.1.2";
|
|
333
333
|
|
|
334
334
|
// src/styles/tokens.ts
|
|
335
335
|
var fontWeightRegular = "var(--font-weight-regular)";
|
|
@@ -552,7 +552,7 @@ exports.StyledStack = styled6__default.default.div`
|
|
|
552
552
|
border-radius: ${({ radius }) => radius && exports.borderRadiusTokens[radius]};
|
|
553
553
|
animation: 0.2s all ease-in-out;
|
|
554
554
|
`;
|
|
555
|
-
var createStackComponent = (stackOption) =>
|
|
555
|
+
var createStackComponent = (stackOption) => React.forwardRef(function Stack2(_h, ref) {
|
|
556
556
|
var _i = _h, {
|
|
557
557
|
as = "div",
|
|
558
558
|
spacing = stackOption == null ? void 0 : stackOption.spacing,
|
|
@@ -608,7 +608,7 @@ exports.MotionStack.Horizontal = framerMotion.motion(Stack.Horizontal);
|
|
|
608
608
|
exports.Stack = Stack;
|
|
609
609
|
|
|
610
610
|
// src/components/Stack/version.ts
|
|
611
|
-
exports.STACK_VERSION = "2.0.
|
|
611
|
+
exports.STACK_VERSION = "2.0.1";
|
|
612
612
|
exports.StyledStackContainer = styled6__default.default.div`
|
|
613
613
|
display: flex;
|
|
614
614
|
width: ${({ width }) => width};
|
|
@@ -629,7 +629,7 @@ exports.StyledStackContainer = styled6__default.default.div`
|
|
|
629
629
|
border-radius: ${({ radius }) => radius && exports.borderRadiusTokens[radius]};
|
|
630
630
|
animation: 0.2s all ease-in-out;
|
|
631
631
|
`;
|
|
632
|
-
var createStackComponent2 = (stackOption) =>
|
|
632
|
+
var createStackComponent2 = (stackOption) => React.forwardRef(function Stack2(_j, ref) {
|
|
633
633
|
var _k = _j, {
|
|
634
634
|
as = "div",
|
|
635
635
|
spacing = stackOption == null ? void 0 : stackOption.spacing,
|
|
@@ -691,7 +691,7 @@ exports.MotionStackContainer.Horizontal = framerMotion.motion(StackContainer.Hor
|
|
|
691
691
|
exports.StackContainer = StackContainer;
|
|
692
692
|
|
|
693
693
|
// src/components/StackContainer/version.ts
|
|
694
|
-
exports.STACK_CONTAINER_VERSION = "2.0.
|
|
694
|
+
exports.STACK_CONTAINER_VERSION = "2.0.1";
|
|
695
695
|
var setEllipsis = (maxLines) => {
|
|
696
696
|
return react$1.css`
|
|
697
697
|
display: -webkit-box;
|
|
@@ -721,7 +721,7 @@ var StyledText = styled6__default.default.span`
|
|
|
721
721
|
word-break: ${wordBreak};
|
|
722
722
|
`};
|
|
723
723
|
`;
|
|
724
|
-
var Text =
|
|
724
|
+
var Text = React.forwardRef(
|
|
725
725
|
(_a, ref) => {
|
|
726
726
|
var _b = _a, {
|
|
727
727
|
children,
|
|
@@ -765,7 +765,7 @@ var Text = React3.forwardRef(
|
|
|
765
765
|
exports.Text = Text;
|
|
766
766
|
|
|
767
767
|
// src/components/Text/version.ts
|
|
768
|
-
exports.TEXT_VERSION = "2.0.
|
|
768
|
+
exports.TEXT_VERSION = "2.0.2";
|
|
769
769
|
var MODAL_SIZE_XXS = 400;
|
|
770
770
|
var MODAL_SIZE_XS = 500;
|
|
771
771
|
var MODAL_SIZE_S = 560;
|
|
@@ -933,8 +933,8 @@ exports.ModalSize = {
|
|
|
933
933
|
exports.MODAL_HEADER_KEY = Symbol("MODAL_HEADER");
|
|
934
934
|
exports.MODAL_FOOTER_KEY = Symbol("MODAL_FOOTER");
|
|
935
935
|
var useViewportSizeObserver = () => {
|
|
936
|
-
const [size2, setSize] =
|
|
937
|
-
|
|
936
|
+
const [size2, setSize] = React.useState({ width: window.innerWidth, height: window.innerHeight });
|
|
937
|
+
React.useEffect(() => {
|
|
938
938
|
const handleResize = () => {
|
|
939
939
|
setSize({ width: window.innerWidth, height: window.innerHeight });
|
|
940
940
|
};
|
|
@@ -943,7 +943,7 @@ var useViewportSizeObserver = () => {
|
|
|
943
943
|
}, []);
|
|
944
944
|
return size2;
|
|
945
945
|
};
|
|
946
|
-
var ModalOptionContext =
|
|
946
|
+
var ModalOptionContext = React.createContext({
|
|
947
947
|
topHeight: 0,
|
|
948
948
|
bottomHeight: 0,
|
|
949
949
|
setTopHeight: utils.noop,
|
|
@@ -952,12 +952,12 @@ var ModalOptionContext = React3.createContext({
|
|
|
952
952
|
clearBottomHeight: utils.noop
|
|
953
953
|
});
|
|
954
954
|
var ModalOptionContextProvider = ({ children }) => {
|
|
955
|
-
const [topHeight, setTopHeight] =
|
|
956
|
-
const [bottomHeight, setBottomHeight] =
|
|
957
|
-
const clearTopHeight =
|
|
955
|
+
const [topHeight, setTopHeight] = React.useState(0);
|
|
956
|
+
const [bottomHeight, setBottomHeight] = React.useState(0);
|
|
957
|
+
const clearTopHeight = React.useCallback(() => {
|
|
958
958
|
setTopHeight(0);
|
|
959
959
|
}, []);
|
|
960
|
-
const clearBottomHeight =
|
|
960
|
+
const clearBottomHeight = React.useCallback(() => {
|
|
961
961
|
setBottomHeight(0);
|
|
962
962
|
}, []);
|
|
963
963
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -981,9 +981,9 @@ var ModalContainer = (_a) => {
|
|
|
981
981
|
const { height: windowHeight } = useViewportSizeObserver();
|
|
982
982
|
const topBottomMargin = 64;
|
|
983
983
|
const heightWidthMargin = height ? height + topBottomMargin : void 0;
|
|
984
|
-
const childrenArray =
|
|
984
|
+
const childrenArray = React__namespace.default.Children.toArray(children);
|
|
985
985
|
const findHeader = childrenArray.find((child) => {
|
|
986
|
-
if (!
|
|
986
|
+
if (!React__namespace.default.isValidElement(child)) {
|
|
987
987
|
return child;
|
|
988
988
|
}
|
|
989
989
|
if (child.type[exports.MODAL_HEADER_KEY]) {
|
|
@@ -991,18 +991,18 @@ var ModalContainer = (_a) => {
|
|
|
991
991
|
}
|
|
992
992
|
});
|
|
993
993
|
const findFooter = childrenArray.find((child) => {
|
|
994
|
-
if (!
|
|
994
|
+
if (!React__namespace.default.isValidElement(child)) {
|
|
995
995
|
return child;
|
|
996
996
|
}
|
|
997
997
|
if (child.type[exports.MODAL_FOOTER_KEY]) {
|
|
998
998
|
return child;
|
|
999
999
|
}
|
|
1000
1000
|
});
|
|
1001
|
-
const addPropInChildren =
|
|
1002
|
-
if (!
|
|
1001
|
+
const addPropInChildren = React__namespace.default.Children.map(childrenArray, (child) => {
|
|
1002
|
+
if (!React__namespace.default.isValidElement(child)) {
|
|
1003
1003
|
return child;
|
|
1004
1004
|
}
|
|
1005
|
-
return
|
|
1005
|
+
return React__namespace.default.cloneElement(child, {
|
|
1006
1006
|
isIncludeHeader: Boolean(findHeader),
|
|
1007
1007
|
isIncludeFooter: Boolean(findFooter),
|
|
1008
1008
|
sizeVar: rest.sizeVar,
|
|
@@ -1017,17 +1017,17 @@ var ModalFooter = ({ children }) => {
|
|
|
1017
1017
|
};
|
|
1018
1018
|
ModalFooter[exports.MODAL_FOOTER_KEY] = true;
|
|
1019
1019
|
var ModalFooter_default = ModalFooter;
|
|
1020
|
-
var ScrollArea =
|
|
1020
|
+
var ScrollArea = React.forwardRef((_a, ref) => {
|
|
1021
1021
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
|
1022
|
-
const scrollRef =
|
|
1022
|
+
const scrollRef = React.useRef(null);
|
|
1023
1023
|
const mergeRef = utils.useMergeRefs(scrollRef, ref);
|
|
1024
|
-
const [windowWidth, setWindowWidth] =
|
|
1025
|
-
const [windowHeight, setWindowHeight] =
|
|
1026
|
-
const onResize =
|
|
1024
|
+
const [windowWidth, setWindowWidth] = React.useState(window.innerWidth);
|
|
1025
|
+
const [windowHeight, setWindowHeight] = React.useState(window.innerHeight);
|
|
1026
|
+
const onResize = React.useCallback(() => {
|
|
1027
1027
|
setWindowWidth(window.innerWidth);
|
|
1028
1028
|
setWindowHeight(window.innerHeight);
|
|
1029
1029
|
}, []);
|
|
1030
|
-
|
|
1030
|
+
React.useEffect(() => {
|
|
1031
1031
|
window.addEventListener("resize", onResize);
|
|
1032
1032
|
return () => {
|
|
1033
1033
|
window.removeEventListener("resize", onResize);
|
|
@@ -1048,9 +1048,9 @@ var ScrollArea = React3.forwardRef((_a, ref) => {
|
|
|
1048
1048
|
exports.ScrollArea = ScrollArea;
|
|
1049
1049
|
|
|
1050
1050
|
// src/components/ScrollArea/version.ts
|
|
1051
|
-
exports.SCROLL_AREA_VERSION = "2.0.
|
|
1051
|
+
exports.SCROLL_AREA_VERSION = "2.0.1";
|
|
1052
1052
|
var useModalOption = () => {
|
|
1053
|
-
const context =
|
|
1053
|
+
const context = React.useContext(ModalOptionContext);
|
|
1054
1054
|
if (!context) {
|
|
1055
1055
|
throw new Error(`useModalOption cannot be called outside the ModalOptionProvider`);
|
|
1056
1056
|
}
|
|
@@ -1070,7 +1070,7 @@ var ModalBody = ({
|
|
|
1070
1070
|
const headerHeight = 64;
|
|
1071
1071
|
const footerHeight = 72;
|
|
1072
1072
|
const topBottomMargin = 64;
|
|
1073
|
-
const getHeaderFooterHeight =
|
|
1073
|
+
const getHeaderFooterHeight = React.useCallback(() => {
|
|
1074
1074
|
let result = 0;
|
|
1075
1075
|
if (isIncludeHeader) {
|
|
1076
1076
|
result += headerHeight;
|
|
@@ -1080,7 +1080,7 @@ var ModalBody = ({
|
|
|
1080
1080
|
}
|
|
1081
1081
|
return result;
|
|
1082
1082
|
}, [isIncludeFooter, isIncludeHeader]);
|
|
1083
|
-
const headerFooterHeight =
|
|
1083
|
+
const headerFooterHeight = React.useMemo(() => getHeaderFooterHeight(), [getHeaderFooterHeight]);
|
|
1084
1084
|
const setAutoHeightMin = () => {
|
|
1085
1085
|
if (sizeVar === "FULL") {
|
|
1086
1086
|
return windowHeight - headerFooterHeight - heightToDeduct;
|
|
@@ -1163,9 +1163,9 @@ var ModalHeader = ({ children }) => {
|
|
|
1163
1163
|
ModalHeader[exports.MODAL_HEADER_KEY] = true;
|
|
1164
1164
|
var ModalHeader_default = ModalHeader;
|
|
1165
1165
|
var ModalTop = ({ children }) => {
|
|
1166
|
-
const [topRef, setTopRef] =
|
|
1166
|
+
const [topRef, setTopRef] = React.useState(null);
|
|
1167
1167
|
const { setTopHeight, clearTopHeight } = useModalOption();
|
|
1168
|
-
|
|
1168
|
+
React.useEffect(() => {
|
|
1169
1169
|
if (!topRef || !setTopHeight) {
|
|
1170
1170
|
return;
|
|
1171
1171
|
}
|
|
@@ -1185,9 +1185,9 @@ var ModalTop = ({ children }) => {
|
|
|
1185
1185
|
};
|
|
1186
1186
|
var ModalTop_default = ModalTop;
|
|
1187
1187
|
var ModalBottom = ({ children }) => {
|
|
1188
|
-
const [bottomRef, setBottomRef] =
|
|
1188
|
+
const [bottomRef, setBottomRef] = React.useState(null);
|
|
1189
1189
|
const { setBottomHeight, clearBottomHeight } = useModalOption();
|
|
1190
|
-
|
|
1190
|
+
React.useEffect(() => {
|
|
1191
1191
|
if (!bottomRef || !setBottomHeight) {
|
|
1192
1192
|
return;
|
|
1193
1193
|
}
|
|
@@ -1205,28 +1205,28 @@ var ModalBottom = ({ children }) => {
|
|
|
1205
1205
|
}, [bottomRef, setBottomHeight, clearBottomHeight]);
|
|
1206
1206
|
return /* @__PURE__ */ jsxRuntime.jsx(BottomContainer, { ref: setBottomRef, children });
|
|
1207
1207
|
};
|
|
1208
|
-
exports.ModalHandlerContext =
|
|
1208
|
+
exports.ModalHandlerContext = React.createContext({
|
|
1209
1209
|
addModal: utils.noop,
|
|
1210
1210
|
removeModal: utils.noop
|
|
1211
1211
|
});
|
|
1212
|
-
exports.ModalContext =
|
|
1212
|
+
exports.ModalContext = React.createContext([]);
|
|
1213
1213
|
|
|
1214
1214
|
// src/components/Modal/hooks/useModalValue.ts
|
|
1215
1215
|
exports.useModalValue = () => {
|
|
1216
|
-
const modal =
|
|
1216
|
+
const modal = React.useContext(exports.ModalContext);
|
|
1217
1217
|
return {
|
|
1218
1218
|
modal
|
|
1219
1219
|
};
|
|
1220
1220
|
};
|
|
1221
1221
|
exports.useHandleModal = () => {
|
|
1222
|
-
const { addModal, removeModal } =
|
|
1222
|
+
const { addModal, removeModal } = React.useContext(exports.ModalHandlerContext);
|
|
1223
1223
|
return {
|
|
1224
1224
|
addModal,
|
|
1225
1225
|
removeModal
|
|
1226
1226
|
};
|
|
1227
1227
|
};
|
|
1228
1228
|
var ModalProvider = ({ children }) => {
|
|
1229
|
-
const [openedModals, setOpenedModals] =
|
|
1229
|
+
const [openedModals, setOpenedModals] = React.useState([]);
|
|
1230
1230
|
const addModal = (component, id, zIndex) => {
|
|
1231
1231
|
setOpenedModals((modals) => {
|
|
1232
1232
|
if (modals) {
|
|
@@ -1272,8 +1272,8 @@ var ModalProvider = ({ children }) => {
|
|
|
1272
1272
|
return;
|
|
1273
1273
|
}
|
|
1274
1274
|
};
|
|
1275
|
-
const dispatch =
|
|
1276
|
-
|
|
1275
|
+
const dispatch = React.useMemo(() => ({ addModal, removeModal }), []);
|
|
1276
|
+
React.useEffect(() => {
|
|
1277
1277
|
if (openedModals.length !== 1) {
|
|
1278
1278
|
return;
|
|
1279
1279
|
}
|
|
@@ -1282,7 +1282,7 @@ var ModalProvider = ({ children }) => {
|
|
|
1282
1282
|
document.body.style.cssText = "overflow:unset";
|
|
1283
1283
|
};
|
|
1284
1284
|
}, [openedModals.length]);
|
|
1285
|
-
|
|
1285
|
+
React.useEffect(() => {
|
|
1286
1286
|
const closeAllModals = () => {
|
|
1287
1287
|
setOpenedModals([]);
|
|
1288
1288
|
};
|
|
@@ -1296,7 +1296,7 @@ var ModalProvider = ({ children }) => {
|
|
|
1296
1296
|
var ModalProvider_default = ModalProvider;
|
|
1297
1297
|
|
|
1298
1298
|
// src/components/Modal/version.ts
|
|
1299
|
-
exports.MODAL_VERSION = "2.0.
|
|
1299
|
+
exports.MODAL_VERSION = "2.0.1";
|
|
1300
1300
|
|
|
1301
1301
|
// src/components/Modal/index.ts
|
|
1302
1302
|
exports.Modal = {
|
|
@@ -1309,7 +1309,7 @@ exports.Modal = {
|
|
|
1309
1309
|
};
|
|
1310
1310
|
|
|
1311
1311
|
// src/components/BackDrop/version.ts
|
|
1312
|
-
exports.BACK_DROP_VERSION = "2.0.
|
|
1312
|
+
exports.BACK_DROP_VERSION = "2.0.1";
|
|
1313
1313
|
var getContainerStylesBySizeVar = (sizeVar) => {
|
|
1314
1314
|
switch (sizeVar) {
|
|
1315
1315
|
case "S":
|
|
@@ -1409,17 +1409,17 @@ var StyledSwitch = styled6__default.default.input`
|
|
|
1409
1409
|
}
|
|
1410
1410
|
`;
|
|
1411
1411
|
var useOnToggle = (selected, defaultSelected) => {
|
|
1412
|
-
const [isToggle, setIsToggle] =
|
|
1412
|
+
const [isToggle, setIsToggle] = React.useState(false);
|
|
1413
1413
|
const isControlled = selected !== void 0;
|
|
1414
1414
|
const handleToggle = () => {
|
|
1415
1415
|
!isControlled && setIsToggle((prev) => !prev);
|
|
1416
1416
|
};
|
|
1417
|
-
|
|
1417
|
+
React.useEffect(() => {
|
|
1418
1418
|
if (isControlled) {
|
|
1419
1419
|
setIsToggle(selected);
|
|
1420
1420
|
}
|
|
1421
1421
|
}, [isControlled, selected]);
|
|
1422
|
-
|
|
1422
|
+
React.useEffect(() => {
|
|
1423
1423
|
if (!isControlled && defaultSelected !== void 0) {
|
|
1424
1424
|
setIsToggle(defaultSelected);
|
|
1425
1425
|
}
|
|
@@ -1470,7 +1470,7 @@ exports.SwitchSizeVariants = {
|
|
|
1470
1470
|
};
|
|
1471
1471
|
|
|
1472
1472
|
// src/components/Switch/version.ts
|
|
1473
|
-
exports.SWITCH_VERSION = "2.0.
|
|
1473
|
+
exports.SWITCH_VERSION = "2.0.1";
|
|
1474
1474
|
|
|
1475
1475
|
// src/components/Chips/ChipToggle/ChipToggle.types.ts
|
|
1476
1476
|
exports.ChipToggleStyleVariants = {
|
|
@@ -1718,7 +1718,7 @@ var ChipButton = (_a) => {
|
|
|
1718
1718
|
exports.ChipButton = ChipButton;
|
|
1719
1719
|
|
|
1720
1720
|
// src/components/Chips/version.ts
|
|
1721
|
-
exports.CHIPS_VERSION = "2.0.
|
|
1721
|
+
exports.CHIPS_VERSION = "2.0.1";
|
|
1722
1722
|
var getStyleByStyleVar = (styleVar, color, disabled) => {
|
|
1723
1723
|
const domain = exports.getDomain();
|
|
1724
1724
|
const secondaryBorderColor = domain === "hada" ? exports.colorTokens.hada150 : exports.colorTokens.neutral350;
|
|
@@ -1835,7 +1835,7 @@ var LoadingSpinner = ({ color = "neutral0" }) => {
|
|
|
1835
1835
|
] });
|
|
1836
1836
|
};
|
|
1837
1837
|
var LoadingSpinner_default = LoadingSpinner;
|
|
1838
|
-
var Button =
|
|
1838
|
+
var Button = React.forwardRef(
|
|
1839
1839
|
(_a, ref) => {
|
|
1840
1840
|
var _b = _a, {
|
|
1841
1841
|
styleVar = "PRIMARY",
|
|
@@ -2018,7 +2018,7 @@ var StyledIconButton = styled6__default.default.button`
|
|
|
2018
2018
|
height: ${({ iconSizeVar }) => getIconSizeFromSizeVar(iconSizeVar)};
|
|
2019
2019
|
}
|
|
2020
2020
|
`;
|
|
2021
|
-
var IconButton =
|
|
2021
|
+
var IconButton = React.forwardRef(
|
|
2022
2022
|
(_a, ref) => {
|
|
2023
2023
|
var _b = _a, {
|
|
2024
2024
|
styleVar,
|
|
@@ -2043,7 +2043,7 @@ var IconButton = React3.forwardRef(
|
|
|
2043
2043
|
"isLoading",
|
|
2044
2044
|
"type"
|
|
2045
2045
|
]);
|
|
2046
|
-
const [isHovered, setIsHovered] =
|
|
2046
|
+
const [isHovered, setIsHovered] = React.useState(false);
|
|
2047
2047
|
const handleOnMouseEnter = (e) => {
|
|
2048
2048
|
setIsHovered(true);
|
|
2049
2049
|
onMouseEnter && onMouseEnter(e);
|
|
@@ -2110,9 +2110,9 @@ var StyledPopper = styled6__default.default.div`
|
|
|
2110
2110
|
width: ${({ width }) => width != null ? width : "fit-content"};
|
|
2111
2111
|
height: ${({ height }) => height && height};
|
|
2112
2112
|
`;
|
|
2113
|
-
var PopperContext =
|
|
2113
|
+
var PopperContext = React.createContext(null);
|
|
2114
2114
|
var usePopper = () => {
|
|
2115
|
-
const context =
|
|
2115
|
+
const context = React__namespace.useContext(PopperContext);
|
|
2116
2116
|
if (context === null) {
|
|
2117
2117
|
throw new Error("usePopper must be used within a PopperProvider");
|
|
2118
2118
|
}
|
|
@@ -2128,7 +2128,7 @@ function assignRef(ref, value) {
|
|
|
2128
2128
|
}
|
|
2129
2129
|
try {
|
|
2130
2130
|
ref.current = value;
|
|
2131
|
-
} catch (
|
|
2131
|
+
} catch (_error) {
|
|
2132
2132
|
throw new Error(`Cannot assign value '${String(value)}' to ref '${String(ref)}'`);
|
|
2133
2133
|
}
|
|
2134
2134
|
}
|
|
@@ -2140,7 +2140,7 @@ function mergeRefs(...refs) {
|
|
|
2140
2140
|
};
|
|
2141
2141
|
}
|
|
2142
2142
|
function useMergeRefs2(...refs) {
|
|
2143
|
-
return
|
|
2143
|
+
return React.useMemo(() => mergeRefs(...refs), refs);
|
|
2144
2144
|
}
|
|
2145
2145
|
var Popper = ({
|
|
2146
2146
|
placement,
|
|
@@ -2150,7 +2150,7 @@ var Popper = ({
|
|
|
2150
2150
|
middlewares,
|
|
2151
2151
|
children
|
|
2152
2152
|
}) => {
|
|
2153
|
-
const [isOpen, setIsOpen] =
|
|
2153
|
+
const [isOpen, setIsOpen] = React.useState(false);
|
|
2154
2154
|
const _a = reactDom.useFloating({
|
|
2155
2155
|
strategy,
|
|
2156
2156
|
placement,
|
|
@@ -2171,18 +2171,18 @@ var Popper = ({
|
|
|
2171
2171
|
}
|
|
2172
2172
|
);
|
|
2173
2173
|
};
|
|
2174
|
-
exports.PopperTrigger =
|
|
2174
|
+
exports.PopperTrigger = React.forwardRef(
|
|
2175
2175
|
(_a, ref) => {
|
|
2176
2176
|
var _b = _a, { children, isOpen = false } = _b, rest = __objRest(_b, ["children", "isOpen"]);
|
|
2177
2177
|
const { setReference, setIsOpen } = usePopper();
|
|
2178
2178
|
const refs = useMergeRefs2(ref, setReference);
|
|
2179
|
-
|
|
2179
|
+
React.useEffect(() => {
|
|
2180
2180
|
setIsOpen(isOpen);
|
|
2181
2181
|
}, [isOpen, setIsOpen]);
|
|
2182
2182
|
return /* @__PURE__ */ jsxRuntime.jsx(StyledPopper, __spreadProps(__spreadValues({ ref: refs, "data-shoplflow": "Popper" }, rest), { children }));
|
|
2183
2183
|
}
|
|
2184
2184
|
);
|
|
2185
|
-
exports.PopperPortal =
|
|
2185
|
+
exports.PopperPortal = React.forwardRef(
|
|
2186
2186
|
({ children, animation: initialAnimation, zIndex }, ref) => {
|
|
2187
2187
|
const { floatingStyles, setFloating, isOpen } = usePopper();
|
|
2188
2188
|
const animation2 = initialAnimation != null ? initialAnimation : fadeInOut;
|
|
@@ -2212,7 +2212,7 @@ Popper.Portal = exports.PopperPortal;
|
|
|
2212
2212
|
exports.Popper = Popper;
|
|
2213
2213
|
|
|
2214
2214
|
// src/components/Popper/version.ts
|
|
2215
|
-
exports.POPPER_VERSION = "2.0.
|
|
2215
|
+
exports.POPPER_VERSION = "2.0.1";
|
|
2216
2216
|
var Container2 = styled6__default.default.div`
|
|
2217
2217
|
display: flex;
|
|
2218
2218
|
align-items: center;
|
|
@@ -2241,7 +2241,7 @@ var IconButton2 = styled6__default.default.button`
|
|
|
2241
2241
|
}
|
|
2242
2242
|
`;
|
|
2243
2243
|
var MUNUS_BUTTON_SYMBOL_KEY = Symbol("SHOPLFLOW_MUNUS_BUTTON");
|
|
2244
|
-
var MinusButton =
|
|
2244
|
+
var MinusButton = React.forwardRef((_a, ref) => {
|
|
2245
2245
|
var _b = _a, { onClick, color = "neutral300" } = _b, rest = __objRest(_b, ["onClick", "color"]);
|
|
2246
2246
|
return /* @__PURE__ */ jsxRuntime.jsx(Container2, { "data-shoplflow": "minusButton", children: /* @__PURE__ */ jsxRuntime.jsx(IconButton2, __spreadProps(__spreadValues({ color, onClick, ref }, rest), { children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
2247
2247
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2265,9 +2265,8 @@ var MinusButton = React3.forwardRef((_a, ref) => {
|
|
|
2265
2265
|
MinusButton[MUNUS_BUTTON_SYMBOL_KEY] = true;
|
|
2266
2266
|
exports.MinusButton = MinusButton;
|
|
2267
2267
|
var getStylesByStyleVariant = (styleVariant, isSelected, isHovered, readOnly) => {
|
|
2268
|
-
const
|
|
2269
|
-
const
|
|
2270
|
-
const primaryHoverColor = domain === "hada" ? exports.colorTokens.neutral700 : exports.colorTokens.primary400;
|
|
2268
|
+
const primaryColor = exports.colorTokens.primary300;
|
|
2269
|
+
const primaryHoverColor = exports.colorTokens.primary400;
|
|
2271
2270
|
switch (styleVariant) {
|
|
2272
2271
|
case "PRIMARY":
|
|
2273
2272
|
if (isSelected) {
|
|
@@ -2363,7 +2362,7 @@ var Container3 = styled6__default.default.button`
|
|
|
2363
2362
|
background-color: transparent;
|
|
2364
2363
|
`;
|
|
2365
2364
|
exports.CHECKBOX_SYMBOL_KEY = Symbol("SHOPLFLOW_CHECKBOX");
|
|
2366
|
-
var Checkbox =
|
|
2365
|
+
var Checkbox = React.forwardRef(
|
|
2367
2366
|
(_a, ref) => {
|
|
2368
2367
|
var _b = _a, {
|
|
2369
2368
|
defaultSelected,
|
|
@@ -2387,7 +2386,7 @@ var Checkbox = React3.forwardRef(
|
|
|
2387
2386
|
"id"
|
|
2388
2387
|
]);
|
|
2389
2388
|
const [selected, toggleSelected] = useOnToggle(isSelected, defaultSelected);
|
|
2390
|
-
const [isHovered, toggleHovered] =
|
|
2389
|
+
const [isHovered, toggleHovered] = React.useState(false);
|
|
2391
2390
|
const handleMouseLeave = (e) => {
|
|
2392
2391
|
toggleHovered(false);
|
|
2393
2392
|
onMouseLeave && onMouseLeave(e);
|
|
@@ -2448,9 +2447,8 @@ exports.CheckboxStyleVariants = {
|
|
|
2448
2447
|
LINE: "LINE"
|
|
2449
2448
|
};
|
|
2450
2449
|
var getSelectedStyle = (isHovered) => {
|
|
2451
|
-
const
|
|
2452
|
-
const
|
|
2453
|
-
const selectedHoverStrokeColor = domain === "hada" ? exports.colorTokens.neutral700 : exports.colorTokens.primary400;
|
|
2450
|
+
const selectedStrokeColor = exports.colorTokens.primary300;
|
|
2451
|
+
const selectedHoverStrokeColor = exports.colorTokens.primary400;
|
|
2454
2452
|
return react$1.css`
|
|
2455
2453
|
& > svg > circle {
|
|
2456
2454
|
stroke: ${selectedStrokeColor};
|
|
@@ -2497,7 +2495,7 @@ exports.RADIO_SYMBOL_KEY = Symbol("SHOPLFLOW_RADIO");
|
|
|
2497
2495
|
var Radio = (_a) => {
|
|
2498
2496
|
var _b = _a, { isSelected, defaultSelected, disabled, onClick, onMouseEnter, onMouseLeave } = _b, rest = __objRest(_b, ["isSelected", "defaultSelected", "disabled", "onClick", "onMouseEnter", "onMouseLeave"]);
|
|
2499
2497
|
const [selected, toggleSelected] = useOnToggle(isSelected, defaultSelected);
|
|
2500
|
-
const [isHovered, toggleHovered] =
|
|
2498
|
+
const [isHovered, toggleHovered] = React.useState(false);
|
|
2501
2499
|
const handleMouseLeave = (e) => {
|
|
2502
2500
|
toggleHovered(false);
|
|
2503
2501
|
onMouseLeave && onMouseLeave(e);
|
|
@@ -2529,7 +2527,7 @@ Radio[exports.RADIO_SYMBOL_KEY] = true;
|
|
|
2529
2527
|
exports.Radio = Radio;
|
|
2530
2528
|
|
|
2531
2529
|
// src/components/ControlButtons/version.ts
|
|
2532
|
-
exports.CONTROL_BUTTONS_VERSION = "2.0.
|
|
2530
|
+
exports.CONTROL_BUTTONS_VERSION = "2.0.3";
|
|
2533
2531
|
|
|
2534
2532
|
// src/components/Menu/Menu.styled.ts
|
|
2535
2533
|
var getStylesBySizeVar = (sizeVar) => {
|
|
@@ -2607,7 +2605,7 @@ var Menu = (_a) => {
|
|
|
2607
2605
|
"disabled"
|
|
2608
2606
|
]);
|
|
2609
2607
|
const [selected, handleToggle] = useOnToggle(isSelected, defaultSelected);
|
|
2610
|
-
const LeftSourceClone = leftSource ?
|
|
2608
|
+
const LeftSourceClone = leftSource ? React__namespace.default.cloneElement(leftSource, __spreadProps(__spreadValues({}, rest), {
|
|
2611
2609
|
isSelected
|
|
2612
2610
|
})) : leftSource;
|
|
2613
2611
|
const handleOnClick = (e) => {
|
|
@@ -2641,10 +2639,10 @@ exports.MenuSizeVariants = {
|
|
|
2641
2639
|
};
|
|
2642
2640
|
|
|
2643
2641
|
// src/components/Menu/version.ts
|
|
2644
|
-
exports.MENU_VERSION = "2.0.
|
|
2645
|
-
exports.DropdownButtonContext =
|
|
2642
|
+
exports.MENU_VERSION = "2.0.1";
|
|
2643
|
+
exports.DropdownButtonContext = React.createContext(null);
|
|
2646
2644
|
exports.useDropdownButtonContext = () => {
|
|
2647
|
-
const context =
|
|
2645
|
+
const context = React.useContext(exports.DropdownButtonContext);
|
|
2648
2646
|
if (!context) {
|
|
2649
2647
|
throw new Error("DropdownButtonContext must be used within a DropdownButton component");
|
|
2650
2648
|
}
|
|
@@ -2686,14 +2684,14 @@ exports.StyledIcon = styled6__default.default.svg`
|
|
|
2686
2684
|
fill: ${({ color }) => color && exports.colorTokens[color]};
|
|
2687
2685
|
}
|
|
2688
2686
|
`;
|
|
2689
|
-
var Icon =
|
|
2687
|
+
var Icon = React.forwardRef((_a, ref) => {
|
|
2690
2688
|
var _b = _a, { iconSource } = _b, rest = __objRest(_b, ["iconSource"]);
|
|
2691
2689
|
return /* @__PURE__ */ jsxRuntime.jsx(exports.StyledIcon, __spreadProps(__spreadValues({ as: iconSource, ref }, rest), { "data-shoplflow": "Icon" }));
|
|
2692
2690
|
});
|
|
2693
2691
|
exports.Icon = Icon;
|
|
2694
2692
|
|
|
2695
2693
|
// src/components/Icon/version.ts
|
|
2696
|
-
exports.ICON_VERSION = "2.0.
|
|
2694
|
+
exports.ICON_VERSION = "2.0.1";
|
|
2697
2695
|
var DropdownButtonMenu = (_a) => {
|
|
2698
2696
|
var _b = _a, { onClick, children } = _b, rest = __objRest(_b, ["onClick", "children"]);
|
|
2699
2697
|
const { setIsOpen } = exports.useDropdownButtonContext();
|
|
@@ -2731,7 +2729,7 @@ var DropdownButton = (_a) => {
|
|
|
2731
2729
|
"styleVar",
|
|
2732
2730
|
"floatingZIndex"
|
|
2733
2731
|
]);
|
|
2734
|
-
const selector =
|
|
2732
|
+
const selector = React.useRef(`shoplflow-${crypto.randomUUID()}-dropdown-button`).current;
|
|
2735
2733
|
const [isOpen, setIsOpen] = utils.useOutsideClick({
|
|
2736
2734
|
selector: `.${selector}`,
|
|
2737
2735
|
useOutsideScroll: true
|
|
@@ -2880,9 +2878,9 @@ var StyledSplitButton = styled6__default.default.button`
|
|
|
2880
2878
|
${({ sizeVar }) => getStyleBySizeVar3(sizeVar)};
|
|
2881
2879
|
${({ disabled }) => getDisabledStyle(disabled)}
|
|
2882
2880
|
`;
|
|
2883
|
-
exports.SplitButtonContext =
|
|
2881
|
+
exports.SplitButtonContext = React.createContext(null);
|
|
2884
2882
|
exports.useSplitButtonContext = () => {
|
|
2885
|
-
const context =
|
|
2883
|
+
const context = React.useContext(exports.SplitButtonContext);
|
|
2886
2884
|
if (!context) {
|
|
2887
2885
|
throw new Error("SplitButtonContext must be used within a SplitButton component");
|
|
2888
2886
|
}
|
|
@@ -2933,7 +2931,7 @@ var SplitButton = (_a) => {
|
|
|
2933
2931
|
"lineClamp",
|
|
2934
2932
|
"text"
|
|
2935
2933
|
]);
|
|
2936
|
-
const selector =
|
|
2934
|
+
const selector = React.useRef(`shoplflow-${crypto.randomUUID()}-split-button`).current;
|
|
2937
2935
|
const [isOpen, setIsOpen] = utils.useOutsideClick({
|
|
2938
2936
|
selector: `.${selector}`,
|
|
2939
2937
|
useOutsideScroll: true
|
|
@@ -3013,7 +3011,7 @@ exports.SplitButtonStyleVariants = {
|
|
|
3013
3011
|
};
|
|
3014
3012
|
|
|
3015
3013
|
// src/components/Buttons/version.ts
|
|
3016
|
-
exports.BUTTONS_VERSION = "2.0.
|
|
3014
|
+
exports.BUTTONS_VERSION = "2.0.4";
|
|
3017
3015
|
var informationStyle = react$1.css`
|
|
3018
3016
|
background: ${exports.colorTokens.neutral400_5};
|
|
3019
3017
|
& > svg > circle {
|
|
@@ -3090,7 +3088,7 @@ var BulletHelperText = (_a) => {
|
|
|
3090
3088
|
};
|
|
3091
3089
|
var NormalHelperText = (_a) => {
|
|
3092
3090
|
var _b = _a, { color, position, children } = _b, rest = __objRest(_b, ["color", "position", "children"]);
|
|
3093
|
-
const getPositionStyle =
|
|
3091
|
+
const getPositionStyle = React.useCallback(() => {
|
|
3094
3092
|
switch (position) {
|
|
3095
3093
|
case "PRESET-TOP":
|
|
3096
3094
|
return {
|
|
@@ -3147,7 +3145,7 @@ exports.CalloutTypes = {
|
|
|
3147
3145
|
};
|
|
3148
3146
|
|
|
3149
3147
|
// src/components/Callout/version.ts
|
|
3150
|
-
exports.CALLOUT_VERSION = "2.1.
|
|
3148
|
+
exports.CALLOUT_VERSION = "2.1.5";
|
|
3151
3149
|
var StyledDropdown = styled6__default.default.div`
|
|
3152
3150
|
width: ${({ width }) => width};
|
|
3153
3151
|
`;
|
|
@@ -3160,9 +3158,9 @@ var StyledDropdownContent = styled6__default.default.div`
|
|
|
3160
3158
|
border-radius: 6px;
|
|
3161
3159
|
box-shadow: ${exports.boxShadowTokens.dropShadow};
|
|
3162
3160
|
`;
|
|
3163
|
-
var DropdownContext =
|
|
3161
|
+
var DropdownContext = React.createContext(null);
|
|
3164
3162
|
var useDropdown = () => {
|
|
3165
|
-
const context =
|
|
3163
|
+
const context = React.useContext(DropdownContext);
|
|
3166
3164
|
if (context === null) {
|
|
3167
3165
|
throw new Error("useDropdown must be used within a DropdownProvider");
|
|
3168
3166
|
}
|
|
@@ -3329,7 +3327,7 @@ var DropdownButtonIcon = styled6__default.default.div`
|
|
|
3329
3327
|
|
|
3330
3328
|
${({ disabled }) => getDisabledStyle2(disabled)};
|
|
3331
3329
|
`;
|
|
3332
|
-
var DropdownTriggerButton =
|
|
3330
|
+
var DropdownTriggerButton = React.forwardRef(
|
|
3333
3331
|
(_a, ref) => {
|
|
3334
3332
|
var _b = _a, {
|
|
3335
3333
|
width = "100%",
|
|
@@ -3355,7 +3353,7 @@ var DropdownTriggerButton = React3.forwardRef(
|
|
|
3355
3353
|
"onClear"
|
|
3356
3354
|
]);
|
|
3357
3355
|
const { isOpen, setIsOpen } = useDropdown();
|
|
3358
|
-
const [isHovered, setIsHovered] =
|
|
3356
|
+
const [isHovered, setIsHovered] = React.useState(false);
|
|
3359
3357
|
const handleOnClick = (e) => {
|
|
3360
3358
|
if (!disabled) {
|
|
3361
3359
|
onClick && onClick(e);
|
|
@@ -3381,8 +3379,8 @@ var DropdownTriggerButton = React3.forwardRef(
|
|
|
3381
3379
|
}
|
|
3382
3380
|
return "neutral700";
|
|
3383
3381
|
};
|
|
3384
|
-
const LeftSourceClone = leftSource ?
|
|
3385
|
-
const RightSourceClone = rightSource ?
|
|
3382
|
+
const LeftSourceClone = leftSource ? React.cloneElement(leftSource, __spreadProps(__spreadValues({}, leftSource.props), { disabled })) : leftSource;
|
|
3383
|
+
const RightSourceClone = rightSource ? React.cloneElement(rightSource, __spreadProps(__spreadValues({}, rightSource.props), { disabled })) : rightSource;
|
|
3386
3384
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3387
3385
|
StyledDropdownButtonWrapper,
|
|
3388
3386
|
{
|
|
@@ -3480,10 +3478,10 @@ var Dropdown = ({
|
|
|
3480
3478
|
offset: offset4 = 4,
|
|
3481
3479
|
placement
|
|
3482
3480
|
}) => {
|
|
3483
|
-
const [triggerRef, setTriggerRef] =
|
|
3484
|
-
const [size2, setSize] =
|
|
3485
|
-
const [isOpen, setIsOpen] =
|
|
3486
|
-
|
|
3481
|
+
const [triggerRef, setTriggerRef] = React.useState(null);
|
|
3482
|
+
const [size2, setSize] = React.useState({ width: 0, height: 0 });
|
|
3483
|
+
const [isOpen, setIsOpen] = React.useState(false);
|
|
3484
|
+
React.useEffect(() => {
|
|
3487
3485
|
if (triggerRef) {
|
|
3488
3486
|
setSize({
|
|
3489
3487
|
width: triggerRef.offsetWidth,
|
|
@@ -3491,7 +3489,7 @@ var Dropdown = ({
|
|
|
3491
3489
|
});
|
|
3492
3490
|
}
|
|
3493
3491
|
}, [triggerRef, width]);
|
|
3494
|
-
|
|
3492
|
+
React.useEffect(() => {
|
|
3495
3493
|
if (initialIsOpen === void 0) {
|
|
3496
3494
|
return;
|
|
3497
3495
|
}
|
|
@@ -3524,7 +3522,7 @@ exports.DropdownOptionVariants = {
|
|
|
3524
3522
|
};
|
|
3525
3523
|
|
|
3526
3524
|
// src/components/Dropdown/version.ts
|
|
3527
|
-
exports.DROPDOWN_VERSION = "2.0.
|
|
3525
|
+
exports.DROPDOWN_VERSION = "2.0.1";
|
|
3528
3526
|
var StyledList = styled6__default.default.li`
|
|
3529
3527
|
display: flex;
|
|
3530
3528
|
flex-direction: row;
|
|
@@ -3548,7 +3546,7 @@ var StyledText2Rows = styled6__default.default.div`
|
|
|
3548
3546
|
`;
|
|
3549
3547
|
var List = (_a) => {
|
|
3550
3548
|
var _b = _a, { children, leftSource, rightSource, style } = _b, rest = __objRest(_b, ["children", "leftSource", "rightSource", "style"]);
|
|
3551
|
-
const LeftSourceClone = leftSource ?
|
|
3549
|
+
const LeftSourceClone = leftSource ? React__namespace.default.cloneElement(leftSource, __spreadValues({}, rest)) : leftSource;
|
|
3552
3550
|
if (!children && rightSource) {
|
|
3553
3551
|
throw new Error("RightSource\uB294 children\uC774 \uD544\uC218\uB85C \uD3EC\uD568\uB418\uC5B4\uC57C\uD569\uB2C8\uB2E4.");
|
|
3554
3552
|
}
|
|
@@ -3568,7 +3566,7 @@ List.Text2Rows = exports.Text2Rows;
|
|
|
3568
3566
|
exports.List = List;
|
|
3569
3567
|
|
|
3570
3568
|
// src/components/List/version.ts
|
|
3571
|
-
exports.LIST_VERSION = "2.0.
|
|
3569
|
+
exports.LIST_VERSION = "2.0.2";
|
|
3572
3570
|
var getTypographyBySize = (size2) => {
|
|
3573
3571
|
switch (size2) {
|
|
3574
3572
|
case "XS":
|
|
@@ -3698,7 +3696,7 @@ exports.TagSizeVariants = {
|
|
|
3698
3696
|
};
|
|
3699
3697
|
|
|
3700
3698
|
// src/components/Tag/version.ts
|
|
3701
|
-
exports.TAG_VERSION = "2.0.
|
|
3699
|
+
exports.TAG_VERSION = "2.0.1";
|
|
3702
3700
|
var StyledTree = styled6__default.default(framerMotion.motion.ul)`
|
|
3703
3701
|
display: flex;
|
|
3704
3702
|
flex-direction: column;
|
|
@@ -3755,8 +3753,8 @@ var AnimateKey = {
|
|
|
3755
3753
|
};
|
|
3756
3754
|
var Tree = (_a) => {
|
|
3757
3755
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
|
3758
|
-
const [isMounted, setIsMounted] =
|
|
3759
|
-
|
|
3756
|
+
const [isMounted, setIsMounted] = React__namespace.default.useState(false);
|
|
3757
|
+
React.useEffect(() => {
|
|
3760
3758
|
setIsMounted(true);
|
|
3761
3759
|
}, []);
|
|
3762
3760
|
if (!isMounted) {
|
|
@@ -3786,14 +3784,14 @@ exports.TreeItem = (_a) => {
|
|
|
3786
3784
|
"disabled",
|
|
3787
3785
|
"onClick"
|
|
3788
3786
|
]);
|
|
3789
|
-
const [isOpened, setIsOpened] =
|
|
3790
|
-
const uniqueId =
|
|
3791
|
-
const CloneChildren =
|
|
3792
|
-
if (!
|
|
3787
|
+
const [isOpened, setIsOpened] = React__namespace.default.useState(initialIsOpen != null ? initialIsOpen : false);
|
|
3788
|
+
const uniqueId = React.useId();
|
|
3789
|
+
const CloneChildren = React__namespace.default.Children.map(children, (child) => {
|
|
3790
|
+
if (!React__namespace.default.isValidElement(child)) {
|
|
3793
3791
|
return child;
|
|
3794
3792
|
}
|
|
3795
3793
|
if (child.type[exports.TREE_SYMBOL_KEY]) {
|
|
3796
|
-
return
|
|
3794
|
+
return React__namespace.default.cloneElement(child, {
|
|
3797
3795
|
depth: depth + 1
|
|
3798
3796
|
});
|
|
3799
3797
|
}
|
|
@@ -3809,18 +3807,18 @@ exports.TreeItem = (_a) => {
|
|
|
3809
3807
|
}
|
|
3810
3808
|
return onClick(e);
|
|
3811
3809
|
};
|
|
3812
|
-
const LeftSourceClone = leftSource ?
|
|
3810
|
+
const LeftSourceClone = leftSource ? React__namespace.default.cloneElement(leftSource, __spreadValues(__spreadValues({
|
|
3813
3811
|
disabled,
|
|
3814
3812
|
onClick
|
|
3815
3813
|
}, rest), leftSource.props)) : leftSource;
|
|
3816
|
-
|
|
3814
|
+
React.useEffect(() => {
|
|
3817
3815
|
if (isOpen !== void 0) {
|
|
3818
3816
|
setIsOpened(isOpen);
|
|
3819
3817
|
}
|
|
3820
3818
|
}, [isOpen]);
|
|
3821
3819
|
const isLastTree = !children && depth > 0;
|
|
3822
3820
|
return /* @__PURE__ */ jsxRuntime.jsxs(StyledTreeItemWrapper, { hasBackground: isOpened || isLastTree, children: [
|
|
3823
|
-
/* @__PURE__ */
|
|
3821
|
+
/* @__PURE__ */ React.createElement(
|
|
3824
3822
|
StyledTreeItem,
|
|
3825
3823
|
__spreadValues(__spreadProps(__spreadValues({
|
|
3826
3824
|
disabled,
|
|
@@ -3858,7 +3856,7 @@ Tree.Item = exports.TreeItem;
|
|
|
3858
3856
|
exports.Tree = Tree;
|
|
3859
3857
|
|
|
3860
3858
|
// src/components/Tree/version.ts
|
|
3861
|
-
exports.TREE_VERSION = "2.0.
|
|
3859
|
+
exports.TREE_VERSION = "2.0.1";
|
|
3862
3860
|
var StyledInput = styled6__default.default.input`
|
|
3863
3861
|
padding: ${({ sizeVar }) => sizeVar === "S" ? "0 8px" : "4px 12px"};
|
|
3864
3862
|
background-color: transparent;
|
|
@@ -3937,7 +3935,7 @@ var TextCounter = ({ currentLength, maxLength, isError }) => {
|
|
|
3937
3935
|
] });
|
|
3938
3936
|
};
|
|
3939
3937
|
var TextCounter_default = TextCounter;
|
|
3940
|
-
|
|
3938
|
+
React.createContext({
|
|
3941
3939
|
domain: "SHOPL",
|
|
3942
3940
|
handleToggleTheme: () => {
|
|
3943
3941
|
}
|
|
@@ -4032,7 +4030,7 @@ var getNumberLimitRange = (value, min, max) => {
|
|
|
4032
4030
|
}
|
|
4033
4031
|
return String(value);
|
|
4034
4032
|
};
|
|
4035
|
-
var Input =
|
|
4033
|
+
var Input = React.forwardRef(
|
|
4036
4034
|
(_a, ref) => {
|
|
4037
4035
|
var _b = _a, {
|
|
4038
4036
|
onFocus,
|
|
@@ -4085,20 +4083,20 @@ var Input = React3.forwardRef(
|
|
|
4085
4083
|
"rightSourceStyle",
|
|
4086
4084
|
"leftSource"
|
|
4087
4085
|
]);
|
|
4088
|
-
const [text, setText] =
|
|
4089
|
-
const [isFocused, setIsFocused] =
|
|
4090
|
-
const [type, setType] =
|
|
4091
|
-
const [isHovered, setIsHovered] =
|
|
4092
|
-
const uniqueId =
|
|
4093
|
-
const inputRef =
|
|
4086
|
+
const [text, setText] = React.useState("");
|
|
4087
|
+
const [isFocused, setIsFocused] = React.useState(Boolean(initIsFocused));
|
|
4088
|
+
const [type, setType] = React.useState(initialType);
|
|
4089
|
+
const [isHovered, setIsHovered] = React.useState(false);
|
|
4090
|
+
const uniqueId = React.useId();
|
|
4091
|
+
const inputRef = React__namespace.default.useRef(null);
|
|
4094
4092
|
const refs = useMergeRefs2(ref, inputRef);
|
|
4095
|
-
const convertToString =
|
|
4093
|
+
const convertToString = React.useCallback((value2) => {
|
|
4096
4094
|
if (typeof value2 !== "number") {
|
|
4097
4095
|
return typeof value2 === "string" ? value2 : value2.join("");
|
|
4098
4096
|
}
|
|
4099
4097
|
return String(value2);
|
|
4100
4098
|
}, []);
|
|
4101
|
-
const sliceText =
|
|
4099
|
+
const sliceText = React.useCallback(
|
|
4102
4100
|
(value2) => {
|
|
4103
4101
|
if (maxLength && value2.length > maxLength) {
|
|
4104
4102
|
return value2.slice(0, maxLength);
|
|
@@ -4154,14 +4152,14 @@ var Input = React3.forwardRef(
|
|
|
4154
4152
|
setType("password");
|
|
4155
4153
|
}
|
|
4156
4154
|
};
|
|
4157
|
-
|
|
4155
|
+
React.useEffect(() => {
|
|
4158
4156
|
if (defaultValue !== void 0) {
|
|
4159
4157
|
const convertString = convertToString(defaultValue);
|
|
4160
4158
|
const slicedText = sliceText(convertString);
|
|
4161
4159
|
setText(slicedText);
|
|
4162
4160
|
}
|
|
4163
4161
|
}, [convertToString, defaultValue, maxLength, sliceText]);
|
|
4164
|
-
|
|
4162
|
+
React.useEffect(() => {
|
|
4165
4163
|
var _a2;
|
|
4166
4164
|
if (value !== void 0) {
|
|
4167
4165
|
const convertString = convertToString(value);
|
|
@@ -4170,11 +4168,11 @@ var Input = React3.forwardRef(
|
|
|
4170
4168
|
setText(slicedText);
|
|
4171
4169
|
}
|
|
4172
4170
|
}, [convertToString, maxLength, sliceText, value]);
|
|
4173
|
-
|
|
4171
|
+
React.useEffect(() => {
|
|
4174
4172
|
setType(initialType);
|
|
4175
4173
|
}, [initialType]);
|
|
4176
4174
|
const height = sizeVar === "M" ? "40px" : "32px";
|
|
4177
|
-
|
|
4175
|
+
React.useEffect(() => {
|
|
4178
4176
|
if (typeof initIsFocused === "undefined") {
|
|
4179
4177
|
return;
|
|
4180
4178
|
}
|
|
@@ -4271,7 +4269,7 @@ var StyledInputButtonContent = styled6__default.default.input`
|
|
|
4271
4269
|
color: ${exports.colorTokens.neutral350};
|
|
4272
4270
|
}
|
|
4273
4271
|
`;
|
|
4274
|
-
var InputButton =
|
|
4272
|
+
var InputButton = React.forwardRef(
|
|
4275
4273
|
(_a, ref) => {
|
|
4276
4274
|
var _b = _a, {
|
|
4277
4275
|
value,
|
|
@@ -4299,10 +4297,10 @@ var InputButton = React3.forwardRef(
|
|
|
4299
4297
|
"width"
|
|
4300
4298
|
]);
|
|
4301
4299
|
var _a2, _b2;
|
|
4302
|
-
const [text, setText] =
|
|
4303
|
-
const [isHovered, setIsHovered] =
|
|
4304
|
-
const prevValue =
|
|
4305
|
-
const convertToString =
|
|
4300
|
+
const [text, setText] = React.useState((_a2 = value != null ? value : defaultValue) != null ? _a2 : "");
|
|
4301
|
+
const [isHovered, setIsHovered] = React.useState(false);
|
|
4302
|
+
const prevValue = React.useRef((_b2 = value != null ? value : defaultValue) != null ? _b2 : "");
|
|
4303
|
+
const convertToString = React.useCallback((value2) => {
|
|
4306
4304
|
if (typeof value2 !== "number") {
|
|
4307
4305
|
return typeof value2 === "string" ? value2 : value2.join("");
|
|
4308
4306
|
}
|
|
@@ -4327,7 +4325,7 @@ var InputButton = React3.forwardRef(
|
|
|
4327
4325
|
const handleOnMouseLeave = () => {
|
|
4328
4326
|
setIsHovered(false);
|
|
4329
4327
|
};
|
|
4330
|
-
|
|
4328
|
+
React.useEffect(() => {
|
|
4331
4329
|
if (prevValue.current === value) {
|
|
4332
4330
|
return;
|
|
4333
4331
|
}
|
|
@@ -4337,7 +4335,7 @@ var InputButton = React3.forwardRef(
|
|
|
4337
4335
|
prevValue.current = convertString;
|
|
4338
4336
|
}
|
|
4339
4337
|
}, [convertToString, value]);
|
|
4340
|
-
|
|
4338
|
+
React.useEffect(() => {
|
|
4341
4339
|
if (prevValue.current === value) {
|
|
4342
4340
|
return;
|
|
4343
4341
|
}
|
|
@@ -4389,9 +4387,9 @@ var StyledTextarea = styled6__default.default.textarea`
|
|
|
4389
4387
|
color: ${exports.colorTokens.neutral350};
|
|
4390
4388
|
}
|
|
4391
4389
|
`;
|
|
4392
|
-
var TextAreaContext =
|
|
4390
|
+
var TextAreaContext = React.createContext(null);
|
|
4393
4391
|
var useTextArea = () => {
|
|
4394
|
-
const context =
|
|
4392
|
+
const context = React.useContext(TextAreaContext);
|
|
4395
4393
|
if (!context) {
|
|
4396
4394
|
throw new Error("useTextArea must be used within a TextAreaProvider");
|
|
4397
4395
|
}
|
|
@@ -4404,7 +4402,7 @@ var MaxLength = () => {
|
|
|
4404
4402
|
}
|
|
4405
4403
|
return /* @__PURE__ */ jsxRuntime.jsx(StackContainer, { padding: "0 0 0 4px", children: /* @__PURE__ */ jsxRuntime.jsx(TextCounter_default, { currentLength: String(text).length, maxLength }) });
|
|
4406
4404
|
};
|
|
4407
|
-
var TextArea =
|
|
4405
|
+
var TextArea = React.forwardRef(
|
|
4408
4406
|
(_a, ref) => {
|
|
4409
4407
|
var _b = _a, {
|
|
4410
4408
|
name,
|
|
@@ -4443,9 +4441,9 @@ var TextArea = React3.forwardRef(
|
|
|
4443
4441
|
"leftSource",
|
|
4444
4442
|
"rightSource"
|
|
4445
4443
|
]);
|
|
4446
|
-
const [text, setText] =
|
|
4447
|
-
const [isFocused, setIsFocused] =
|
|
4448
|
-
const [isHovered, setIsHovered] =
|
|
4444
|
+
const [text, setText] = React.useState("");
|
|
4445
|
+
const [isFocused, setIsFocused] = React.useState(false);
|
|
4446
|
+
const [isHovered, setIsHovered] = React.useState(false);
|
|
4449
4447
|
const handleOnMouseEnter = () => {
|
|
4450
4448
|
setIsHovered(true);
|
|
4451
4449
|
};
|
|
@@ -4470,7 +4468,7 @@ var TextArea = React3.forwardRef(
|
|
|
4470
4468
|
}
|
|
4471
4469
|
return String(value2);
|
|
4472
4470
|
};
|
|
4473
|
-
|
|
4471
|
+
React.useEffect(() => {
|
|
4474
4472
|
if (defaultValue) {
|
|
4475
4473
|
const convertString = convertToString(defaultValue);
|
|
4476
4474
|
if (maxLength && convertString.length > maxLength) {
|
|
@@ -4479,7 +4477,7 @@ var TextArea = React3.forwardRef(
|
|
|
4479
4477
|
setText(convertString);
|
|
4480
4478
|
}
|
|
4481
4479
|
}, [defaultValue, maxLength]);
|
|
4482
|
-
|
|
4480
|
+
React.useEffect(() => {
|
|
4483
4481
|
if (value) {
|
|
4484
4482
|
const convertString = convertToString(value);
|
|
4485
4483
|
if (maxLength && convertString.length > maxLength) {
|
|
@@ -4488,7 +4486,7 @@ var TextArea = React3.forwardRef(
|
|
|
4488
4486
|
setText(convertToString(value));
|
|
4489
4487
|
}
|
|
4490
4488
|
}, [maxLength, value]);
|
|
4491
|
-
const uniqueId =
|
|
4489
|
+
const uniqueId = React.useId();
|
|
4492
4490
|
const contextValue = {
|
|
4493
4491
|
text,
|
|
4494
4492
|
maxLength
|
|
@@ -4587,7 +4585,7 @@ var SelectInputButton = (_a) => {
|
|
|
4587
4585
|
"rightSource",
|
|
4588
4586
|
"sizeVar"
|
|
4589
4587
|
]);
|
|
4590
|
-
const [isHovered, setIsHovered] =
|
|
4588
|
+
const [isHovered, setIsHovered] = React.useState(false);
|
|
4591
4589
|
const handleOnClick = (e) => {
|
|
4592
4590
|
e.preventDefault();
|
|
4593
4591
|
e.stopPropagation();
|
|
@@ -4645,7 +4643,7 @@ var SelectInputButton = (_a) => {
|
|
|
4645
4643
|
exports.SelectInputButton = SelectInputButton;
|
|
4646
4644
|
|
|
4647
4645
|
// src/components/Inputs/version.ts
|
|
4648
|
-
exports.INPUTS_VERSION = "2.0.
|
|
4646
|
+
exports.INPUTS_VERSION = "2.0.1";
|
|
4649
4647
|
var StyledTooltipContent = styled6__default.default.div`
|
|
4650
4648
|
background-color: ${exports.colorTokens.neutral700};
|
|
4651
4649
|
padding: 4px 8px;
|
|
@@ -4678,14 +4676,14 @@ var Tooltip = (_a) => {
|
|
|
4678
4676
|
"triggerWidth",
|
|
4679
4677
|
"portalRef"
|
|
4680
4678
|
]);
|
|
4681
|
-
const [isOpen, setIsOpen] =
|
|
4682
|
-
const showHandler =
|
|
4679
|
+
const [isOpen, setIsOpen] = React.useState(false);
|
|
4680
|
+
const showHandler = React.useCallback(() => {
|
|
4683
4681
|
if (open === void 0) {
|
|
4684
4682
|
setIsOpen(true);
|
|
4685
4683
|
}
|
|
4686
4684
|
onOpenChange == null ? void 0 : onOpenChange(true);
|
|
4687
4685
|
}, [open, onOpenChange]);
|
|
4688
|
-
const hideHandler =
|
|
4686
|
+
const hideHandler = React.useCallback(() => {
|
|
4689
4687
|
if (open === void 0) {
|
|
4690
4688
|
setIsOpen(false);
|
|
4691
4689
|
}
|
|
@@ -4723,10 +4721,10 @@ Tooltip.Content = TooltipContent;
|
|
|
4723
4721
|
exports.Tooltip = Tooltip;
|
|
4724
4722
|
|
|
4725
4723
|
// src/components/Tooltip/version.ts
|
|
4726
|
-
exports.TOOLTIP_VERSION = "2.0.
|
|
4727
|
-
exports.TabsContext =
|
|
4724
|
+
exports.TOOLTIP_VERSION = "2.0.1";
|
|
4725
|
+
exports.TabsContext = React.createContext(null);
|
|
4728
4726
|
exports.useTabs = () => {
|
|
4729
|
-
const context =
|
|
4727
|
+
const context = React.useContext(exports.TabsContext);
|
|
4730
4728
|
if (context === null) {
|
|
4731
4729
|
throw new Error("useTabs should be used in Tabs");
|
|
4732
4730
|
}
|
|
@@ -4903,12 +4901,12 @@ var Tab = (_a) => {
|
|
|
4903
4901
|
"activeColor"
|
|
4904
4902
|
]);
|
|
4905
4903
|
const { activeTab, setActiveTab } = exports.useTabs();
|
|
4906
|
-
const [isHover, setIsHover] =
|
|
4904
|
+
const [isHover, setIsHover] = React.useState(false);
|
|
4907
4905
|
const isActive = value === activeTab;
|
|
4908
|
-
const hoverHandler =
|
|
4906
|
+
const hoverHandler = React.useCallback(() => {
|
|
4909
4907
|
setIsHover(true);
|
|
4910
4908
|
}, []);
|
|
4911
|
-
const unhoverHandler =
|
|
4909
|
+
const unhoverHandler = React.useCallback(() => {
|
|
4912
4910
|
setIsHover(false);
|
|
4913
4911
|
}, []);
|
|
4914
4912
|
const clickHandler = (event) => {
|
|
@@ -4958,8 +4956,8 @@ var Tab = (_a) => {
|
|
|
4958
4956
|
);
|
|
4959
4957
|
};
|
|
4960
4958
|
var Tabs = ({ children, initialTab, onChange }) => {
|
|
4961
|
-
const [activeTab, setActiveTab] =
|
|
4962
|
-
|
|
4959
|
+
const [activeTab, setActiveTab] = React.useState(initialTab);
|
|
4960
|
+
React.useEffect(() => {
|
|
4963
4961
|
if (!onChange || !activeTab) {
|
|
4964
4962
|
return;
|
|
4965
4963
|
}
|
|
@@ -4990,7 +4988,7 @@ exports.TabSizeVariants = {
|
|
|
4990
4988
|
};
|
|
4991
4989
|
|
|
4992
4990
|
// src/components/Tabs/version.ts
|
|
4993
|
-
exports.TABS_VERSION = "2.0.
|
|
4991
|
+
exports.TABS_VERSION = "2.0.1";
|
|
4994
4992
|
var PaginationWrapper = styled6__default.default.div`
|
|
4995
4993
|
display: flex;
|
|
4996
4994
|
align-items: center;
|
|
@@ -5150,7 +5148,7 @@ Pagination.SizeSelector = PaginationSizeSelector_default;
|
|
|
5150
5148
|
exports.Pagination = Pagination;
|
|
5151
5149
|
|
|
5152
5150
|
// src/components/Pagination/version.ts
|
|
5153
|
-
exports.PAGINATION_VERSION = "2.0.
|
|
5151
|
+
exports.PAGINATION_VERSION = "2.0.1";
|
|
5154
5152
|
var getLabelStyleBySizeVar = (sizeVar) => {
|
|
5155
5153
|
switch (sizeVar) {
|
|
5156
5154
|
case "S": {
|
|
@@ -5221,9 +5219,9 @@ var StyledToggleInnerInput = styled6__default.default.input`
|
|
|
5221
5219
|
opacity: 0;
|
|
5222
5220
|
visibility: hidden;
|
|
5223
5221
|
`;
|
|
5224
|
-
var ToggleButtonContext =
|
|
5222
|
+
var ToggleButtonContext = React.createContext(null);
|
|
5225
5223
|
var useToggleButton = () => {
|
|
5226
|
-
const context =
|
|
5224
|
+
const context = React.useContext(ToggleButtonContext);
|
|
5227
5225
|
if (!context) {
|
|
5228
5226
|
throw new Error("ToggleInnerButton \uCEF4\uD3EC\uB10C\uD2B8\uB294 ToggleButton \uB0B4\uBD80\uC5D0\uC11C \uC0AC\uC6A9\uD574\uC8FC\uC138\uC694");
|
|
5229
5227
|
}
|
|
@@ -5249,12 +5247,12 @@ var ToggleButton = (_a) => {
|
|
|
5249
5247
|
]);
|
|
5250
5248
|
return /* @__PURE__ */ jsxRuntime.jsx(ToggleButtonContext.Provider, { value: { fixedWidth, targetName, onChange, selectedValue, sizeVar, disabled }, children: /* @__PURE__ */ jsxRuntime.jsx(StyledToggleButton, __spreadProps(__spreadValues({ "data-shoplflow": "ToggleButton", "aria-disabled": disabled }, rest), { children })) });
|
|
5251
5249
|
};
|
|
5252
|
-
var ToggleInnerRadio =
|
|
5250
|
+
var ToggleInnerRadio = React.forwardRef(
|
|
5253
5251
|
(_a, ref) => {
|
|
5254
5252
|
var _b = _a, { label, disabled: itemDisabled, value, id } = _b, rest = __objRest(_b, ["label", "disabled", "value", "id"]);
|
|
5255
5253
|
const { fixedWidth, onChange, targetName, selectedValue, sizeVar, disabled: groupDisabled } = useToggleButton();
|
|
5256
5254
|
const disabled = groupDisabled || itemDisabled;
|
|
5257
|
-
const labelRef =
|
|
5255
|
+
const labelRef = React.useRef(null);
|
|
5258
5256
|
let selected = false;
|
|
5259
5257
|
if (selectedValue && selectedValue === value) {
|
|
5260
5258
|
selected = true;
|
|
@@ -5321,7 +5319,7 @@ exports.ToggleButtonSizeVariants = {
|
|
|
5321
5319
|
};
|
|
5322
5320
|
|
|
5323
5321
|
// src/components/ToggleButton/version.ts
|
|
5324
|
-
exports.TOGGLE_BUTTON_VERSION = "2.0.
|
|
5322
|
+
exports.TOGGLE_BUTTON_VERSION = "2.0.2";
|
|
5325
5323
|
var SmallStyledDayDatepickerWrapper = styled6__default.default.div`
|
|
5326
5324
|
display: flex;
|
|
5327
5325
|
width: 280px;
|
|
@@ -5905,18 +5903,18 @@ var OptionListItem = styled6__default.default.li`
|
|
|
5905
5903
|
`;
|
|
5906
5904
|
var YearSelect = ({ optionList, className, parentClassName, activeValue, maxHeight, onClick }) => {
|
|
5907
5905
|
var _a;
|
|
5908
|
-
const optionListRef =
|
|
5909
|
-
const parentRef =
|
|
5910
|
-
const simpleBarContentRef =
|
|
5911
|
-
const [isAllRefMounted, setIsAllRefMounted] =
|
|
5906
|
+
const optionListRef = React.useRef([]);
|
|
5907
|
+
const parentRef = React.useRef(null);
|
|
5908
|
+
const simpleBarContentRef = React.useRef(null);
|
|
5909
|
+
const [isAllRefMounted, setIsAllRefMounted] = React.useState(false);
|
|
5912
5910
|
const [isOpened, setIsOpened] = utils.useOutsideClick({
|
|
5913
5911
|
selector: `.${parentClassName}` || ""
|
|
5914
5912
|
});
|
|
5915
|
-
|
|
5913
|
+
React.useEffect(() => {
|
|
5916
5914
|
setIsOpened(isOpened);
|
|
5917
5915
|
}, []);
|
|
5918
5916
|
const height = Math.min(((_a = optionList == null ? void 0 : optionList.length) != null ? _a : 0) * 32, Number(parseInt(maxHeight || "0")));
|
|
5919
|
-
|
|
5917
|
+
React.useEffect(() => {
|
|
5920
5918
|
var _a2, _b, _c, _d, _e, _f, _g;
|
|
5921
5919
|
if (!isAllRefMounted || !activeValue || !maxHeight) {
|
|
5922
5920
|
return;
|
|
@@ -5974,7 +5972,7 @@ var YearStepper = ({
|
|
|
5974
5972
|
});
|
|
5975
5973
|
const startYear = minDate ? minDate.getFullYear() : 2e3;
|
|
5976
5974
|
const endYear = maxDate ? maxDate.getFullYear() : 2100;
|
|
5977
|
-
const OptionList2 =
|
|
5975
|
+
const OptionList2 = React.useMemo(
|
|
5978
5976
|
() => Array.from({ length: endYear - startYear + 1 }).fill(0).map((_, index) => ({ value: startYear + index, label: `${startYear + index}` })).sort((a, b) => b.value - a.value),
|
|
5979
5977
|
[startYear, endYear]
|
|
5980
5978
|
);
|
|
@@ -6322,14 +6320,14 @@ var MonthDatepicker = ({
|
|
|
6322
6320
|
onlySingleMonth,
|
|
6323
6321
|
sizeVar = "M"
|
|
6324
6322
|
}) => {
|
|
6325
|
-
const [currentDate, setCurrentDate] =
|
|
6326
|
-
const [selectedStartMonthAndYear, setSelectedStartMonthAndYear] =
|
|
6323
|
+
const [currentDate, setCurrentDate] = React.useState(initStartDate || /* @__PURE__ */ new Date());
|
|
6324
|
+
const [selectedStartMonthAndYear, setSelectedStartMonthAndYear] = React.useState(
|
|
6327
6325
|
initStartDate ? [initStartDate.getMonth() + 1, initStartDate.getFullYear()] : null
|
|
6328
6326
|
);
|
|
6329
|
-
const [selectedEndMonthAndYear, setSelectedEndMonthAndYear] =
|
|
6327
|
+
const [selectedEndMonthAndYear, setSelectedEndMonthAndYear] = React.useState(
|
|
6330
6328
|
initEndDate ? [initEndDate.getMonth() + 1, initEndDate.getFullYear()] : null
|
|
6331
6329
|
);
|
|
6332
|
-
const Months =
|
|
6330
|
+
const Months = React.useMemo(() => {
|
|
6333
6331
|
return Array.from({ length: 12 }).map((_, index) => index + 1);
|
|
6334
6332
|
}, []);
|
|
6335
6333
|
const clickMonth = (month, year) => {
|
|
@@ -6555,7 +6553,7 @@ var AnnualDatepicker = ({
|
|
|
6555
6553
|
handleYearClick,
|
|
6556
6554
|
disabledYears
|
|
6557
6555
|
}) => {
|
|
6558
|
-
const [selectedYear, setSelectedYear] =
|
|
6556
|
+
const [selectedYear, setSelectedYear] = React.useState(currentYear || (/* @__PURE__ */ new Date()).getFullYear());
|
|
6559
6557
|
const Years = Array.from({ length: endYear - startYear + 1 }).map((_, index) => startYear + index);
|
|
6560
6558
|
const clickYear = (year) => {
|
|
6561
6559
|
setSelectedYear(year);
|
|
@@ -6714,15 +6712,15 @@ var WeekDatepicker = ({
|
|
|
6714
6712
|
onlySingleWeek
|
|
6715
6713
|
}) => {
|
|
6716
6714
|
const year = initStartDate ? dateFns.getISOWeekYear(initStartDate) : dateFns.getISOWeekYear(/* @__PURE__ */ new Date());
|
|
6717
|
-
const [currentDate, setCurrentDate] =
|
|
6718
|
-
const [selectedStartWeekAndYear, setSelectedStartWeekAndYear] =
|
|
6715
|
+
const [currentDate, setCurrentDate] = React.useState(new Date(year, 5, 5));
|
|
6716
|
+
const [selectedStartWeekAndYear, setSelectedStartWeekAndYear] = React.useState(
|
|
6719
6717
|
initStartDate ? [dateFns.getISOWeek(initStartDate || /* @__PURE__ */ new Date()), dateFns.getISOWeekYear(initStartDate || /* @__PURE__ */ new Date())] : null
|
|
6720
6718
|
);
|
|
6721
|
-
const [selectedEndWeekAndYear, setSelectedEndWeekAndYear] =
|
|
6719
|
+
const [selectedEndWeekAndYear, setSelectedEndWeekAndYear] = React.useState(
|
|
6722
6720
|
initEndDate ? [dateFns.getISOWeek(initEndDate || /* @__PURE__ */ new Date()), dateFns.getISOWeekYear(initEndDate || /* @__PURE__ */ new Date())] : null
|
|
6723
6721
|
);
|
|
6724
6722
|
const selectedYear = currentDate.getFullYear();
|
|
6725
|
-
const Years =
|
|
6723
|
+
const Years = React.useMemo(() => {
|
|
6726
6724
|
return Array.from({ length: getWeeksInYear(selectedYear) }).map((_, index) => {
|
|
6727
6725
|
return String(index + 1).padStart(2, "0");
|
|
6728
6726
|
});
|
|
@@ -6879,7 +6877,7 @@ var WeekDatepicker = ({
|
|
|
6879
6877
|
exports.WeekDatepicker = WeekDatepicker;
|
|
6880
6878
|
|
|
6881
6879
|
// src/components/Datepickers/version.ts
|
|
6882
|
-
exports.DATEPICKERS_VERSION = "2.0.
|
|
6880
|
+
exports.DATEPICKERS_VERSION = "2.0.3";
|
|
6883
6881
|
var StyledNumberCombobox = styled6__default.default.div``;
|
|
6884
6882
|
var IconWrapper2 = styled6__default.default(framerMotion.motion.div)`
|
|
6885
6883
|
display: flex;
|
|
@@ -6916,8 +6914,8 @@ var NumberCombobox = (_a) => {
|
|
|
6916
6914
|
"className",
|
|
6917
6915
|
"floatingZIndex"
|
|
6918
6916
|
]);
|
|
6919
|
-
const selector =
|
|
6920
|
-
const inputRef =
|
|
6917
|
+
const selector = React.useRef(`shoplflow-${crypto.randomUUID()}-number-combobox`).current;
|
|
6918
|
+
const inputRef = React.useRef(null);
|
|
6921
6919
|
const [isOpen, setIsOpen] = utils.useOutsideClick({
|
|
6922
6920
|
selector: `.${selector}`,
|
|
6923
6921
|
useOutsideScroll: true
|
|
@@ -7073,7 +7071,7 @@ exports.NumberComboboxSizeVariants = {
|
|
|
7073
7071
|
};
|
|
7074
7072
|
|
|
7075
7073
|
// src/components/Comboboxs/version.ts
|
|
7076
|
-
exports.COMBOBOXS_VERSION = "2.0.
|
|
7074
|
+
exports.COMBOBOXS_VERSION = "2.0.1";
|
|
7077
7075
|
var animation = react$1.keyframes`
|
|
7078
7076
|
0% {
|
|
7079
7077
|
transform: translateX(-100%);
|
|
@@ -7124,7 +7122,7 @@ var Skeleton = ({ styleVar = "rectangle", width = "50px", height = "20px" }) =>
|
|
|
7124
7122
|
exports.Skeleton = Skeleton;
|
|
7125
7123
|
|
|
7126
7124
|
// src/components/Skeleton/version.ts
|
|
7127
|
-
exports.SKELETON_VERSION = "2.0.
|
|
7125
|
+
exports.SKELETON_VERSION = "2.0.1";
|
|
7128
7126
|
|
|
7129
7127
|
// src/components/Slider/Slider.types.ts
|
|
7130
7128
|
exports.SLIDER_Z_INDEX = {
|
|
@@ -7300,8 +7298,8 @@ var useSlider = ({ bounds, step, range, handleRange, isDisabled = false }) => {
|
|
|
7300
7298
|
const { min, max } = bounds;
|
|
7301
7299
|
validateRange({ min, max, range });
|
|
7302
7300
|
validateStep({ min, max, step });
|
|
7303
|
-
const trackRef =
|
|
7304
|
-
const updateRange =
|
|
7301
|
+
const trackRef = React.useRef(null);
|
|
7302
|
+
const updateRange = React.useCallback(
|
|
7305
7303
|
(index, newValue) => {
|
|
7306
7304
|
const newRange = [range.min, range.max];
|
|
7307
7305
|
if (index === 0) {
|
|
@@ -7313,7 +7311,7 @@ var useSlider = ({ bounds, step, range, handleRange, isDisabled = false }) => {
|
|
|
7313
7311
|
},
|
|
7314
7312
|
[range, handleRange]
|
|
7315
7313
|
);
|
|
7316
|
-
const handleMouseDown =
|
|
7314
|
+
const handleMouseDown = React.useCallback(
|
|
7317
7315
|
(index) => (e) => {
|
|
7318
7316
|
if (isDisabled) {
|
|
7319
7317
|
return;
|
|
@@ -7338,7 +7336,7 @@ var useSlider = ({ bounds, step, range, handleRange, isDisabled = false }) => {
|
|
|
7338
7336
|
},
|
|
7339
7337
|
[isDisabled, min, max, step, updateRange]
|
|
7340
7338
|
);
|
|
7341
|
-
const handleClickTrack =
|
|
7339
|
+
const handleClickTrack = React.useCallback(
|
|
7342
7340
|
(e) => {
|
|
7343
7341
|
if (isDisabled || !trackRef.current) {
|
|
7344
7342
|
return;
|
|
@@ -7357,7 +7355,7 @@ var useSlider = ({ bounds, step, range, handleRange, isDisabled = false }) => {
|
|
|
7357
7355
|
},
|
|
7358
7356
|
[isDisabled, min, max, step, range, updateRange]
|
|
7359
7357
|
);
|
|
7360
|
-
const positions =
|
|
7358
|
+
const positions = React.useMemo(() => {
|
|
7361
7359
|
const startPosition = getPositionPercentage(0, [range.min, range.max], { min, max });
|
|
7362
7360
|
const endPosition = getPositionPercentage(1, [range.min, range.max], { min, max });
|
|
7363
7361
|
const width = endPosition - startPosition;
|
|
@@ -7416,9 +7414,9 @@ var Slider = ({
|
|
|
7416
7414
|
exports.Slider = Slider;
|
|
7417
7415
|
|
|
7418
7416
|
// src/components/Slider/version.ts
|
|
7419
|
-
exports.SLIDER_VERSION = "2.0.
|
|
7420
|
-
var SearchBarContext =
|
|
7421
|
-
var useSearchBarContext = () =>
|
|
7417
|
+
exports.SLIDER_VERSION = "2.0.1";
|
|
7418
|
+
var SearchBarContext = React.createContext({});
|
|
7419
|
+
var useSearchBarContext = () => React.useContext(SearchBarContext);
|
|
7422
7420
|
var SearchBarProvider = ({
|
|
7423
7421
|
children,
|
|
7424
7422
|
useFlexibleWidth,
|
|
@@ -7454,8 +7452,8 @@ var SearchBarInput = (_a) => {
|
|
|
7454
7452
|
"maxLength"
|
|
7455
7453
|
]);
|
|
7456
7454
|
const { useFlexibleWidth, isSelected } = useSearchBarContext();
|
|
7457
|
-
const [text, setText] =
|
|
7458
|
-
const debouncedOnChange =
|
|
7455
|
+
const [text, setText] = React.useState("");
|
|
7456
|
+
const debouncedOnChange = React.useRef(
|
|
7459
7457
|
utils.debounce(
|
|
7460
7458
|
(event) => {
|
|
7461
7459
|
const newValue = event.target.value;
|
|
@@ -7482,11 +7480,11 @@ var SearchBarInput = (_a) => {
|
|
|
7482
7480
|
debouncedOnChange(event);
|
|
7483
7481
|
}
|
|
7484
7482
|
};
|
|
7485
|
-
const handleOnClear =
|
|
7483
|
+
const handleOnClear = React.useCallback(() => {
|
|
7486
7484
|
setText("");
|
|
7487
7485
|
onClear == null ? void 0 : onClear();
|
|
7488
7486
|
}, [onClear]);
|
|
7489
|
-
const handleKeyDown =
|
|
7487
|
+
const handleKeyDown = React.useCallback(
|
|
7490
7488
|
(event) => {
|
|
7491
7489
|
if (type === "default" && event.key === "Enter") {
|
|
7492
7490
|
onSearch == null ? void 0 : onSearch(text);
|
|
@@ -7494,7 +7492,7 @@ var SearchBarInput = (_a) => {
|
|
|
7494
7492
|
},
|
|
7495
7493
|
[onSearch, text, type]
|
|
7496
7494
|
);
|
|
7497
|
-
const handleIconClick =
|
|
7495
|
+
const handleIconClick = React.useCallback(() => {
|
|
7498
7496
|
if (type === "default") {
|
|
7499
7497
|
onSearch == null ? void 0 : onSearch(text);
|
|
7500
7498
|
}
|
|
@@ -7613,10 +7611,10 @@ var SearchBar = (_a) => {
|
|
|
7613
7611
|
selector: ".search-bar",
|
|
7614
7612
|
onClose: () => setIsSelected(false)
|
|
7615
7613
|
});
|
|
7616
|
-
const handleContainerClick =
|
|
7614
|
+
const handleContainerClick = React.useCallback(() => {
|
|
7617
7615
|
setIsSelected(true);
|
|
7618
7616
|
}, [setIsSelected]);
|
|
7619
|
-
const containerWidth =
|
|
7617
|
+
const containerWidth = React.useMemo(() => {
|
|
7620
7618
|
if (!useFlexibleWidth) {
|
|
7621
7619
|
return width;
|
|
7622
7620
|
}
|
|
@@ -7642,7 +7640,7 @@ SearchBar.Category = SearchBarCategory;
|
|
|
7642
7640
|
SearchBar.Input = SearchBarInput;
|
|
7643
7641
|
|
|
7644
7642
|
// src/components/SearchBar/version.ts
|
|
7645
|
-
exports.SEARCH_BAR_VERSION = "2.0.
|
|
7643
|
+
exports.SEARCH_BAR_VERSION = "2.0.1";
|
|
7646
7644
|
|
|
7647
7645
|
// src/components/SearchBar/index.ts
|
|
7648
7646
|
exports.SearchBar = SearchBar;
|
|
@@ -7660,7 +7658,7 @@ var SpaceMarginWrapper = styled6__default.default(framerMotion.motion.div)`
|
|
|
7660
7658
|
height: 100%;
|
|
7661
7659
|
`;
|
|
7662
7660
|
var ModalPortal = () => {
|
|
7663
|
-
const modal =
|
|
7661
|
+
const modal = React.useContext(exports.ModalContext);
|
|
7664
7662
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: reactDom$1.createPortal(
|
|
7665
7663
|
/* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: modal.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(BackDrop_default, { zIndex: item.zIndex, children: /* @__PURE__ */ jsxRuntime.jsx(SpaceMarginWrapper, { children: item.component }) }, index)) }),
|
|
7666
7664
|
document.body
|