@shoplflow/base 0.46.12 → 0.46.13
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 +200 -201
- package/dist/index.d.cts +72 -72
- package/dist/index.d.ts +72 -72
- package/dist/index.js +50 -51
- package/package.json +1 -7
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(
|
|
@@ -2363,7 +2363,7 @@ var Container3 = styled6__default.default.button`
|
|
|
2363
2363
|
background-color: transparent;
|
|
2364
2364
|
`;
|
|
2365
2365
|
exports.CHECKBOX_SYMBOL_KEY = Symbol("SHOPLFLOW_CHECKBOX");
|
|
2366
|
-
var Checkbox =
|
|
2366
|
+
var Checkbox = React.forwardRef(
|
|
2367
2367
|
(_a, ref) => {
|
|
2368
2368
|
var _b = _a, {
|
|
2369
2369
|
defaultSelected,
|
|
@@ -2387,7 +2387,7 @@ var Checkbox = React3.forwardRef(
|
|
|
2387
2387
|
"id"
|
|
2388
2388
|
]);
|
|
2389
2389
|
const [selected, toggleSelected] = useOnToggle(isSelected, defaultSelected);
|
|
2390
|
-
const [isHovered, toggleHovered] =
|
|
2390
|
+
const [isHovered, toggleHovered] = React.useState(false);
|
|
2391
2391
|
const handleMouseLeave = (e) => {
|
|
2392
2392
|
toggleHovered(false);
|
|
2393
2393
|
onMouseLeave && onMouseLeave(e);
|
|
@@ -2448,9 +2448,8 @@ exports.CheckboxStyleVariants = {
|
|
|
2448
2448
|
LINE: "LINE"
|
|
2449
2449
|
};
|
|
2450
2450
|
var getSelectedStyle = (isHovered) => {
|
|
2451
|
-
const
|
|
2452
|
-
const
|
|
2453
|
-
const selectedHoverStrokeColor = domain === "hada" ? exports.colorTokens.neutral700 : exports.colorTokens.primary400;
|
|
2451
|
+
const selectedStrokeColor = exports.colorTokens.primary300;
|
|
2452
|
+
const selectedHoverStrokeColor = exports.colorTokens.primary400;
|
|
2454
2453
|
return react$1.css`
|
|
2455
2454
|
& > svg > circle {
|
|
2456
2455
|
stroke: ${selectedStrokeColor};
|
|
@@ -2497,7 +2496,7 @@ exports.RADIO_SYMBOL_KEY = Symbol("SHOPLFLOW_RADIO");
|
|
|
2497
2496
|
var Radio = (_a) => {
|
|
2498
2497
|
var _b = _a, { isSelected, defaultSelected, disabled, onClick, onMouseEnter, onMouseLeave } = _b, rest = __objRest(_b, ["isSelected", "defaultSelected", "disabled", "onClick", "onMouseEnter", "onMouseLeave"]);
|
|
2499
2498
|
const [selected, toggleSelected] = useOnToggle(isSelected, defaultSelected);
|
|
2500
|
-
const [isHovered, toggleHovered] =
|
|
2499
|
+
const [isHovered, toggleHovered] = React.useState(false);
|
|
2501
2500
|
const handleMouseLeave = (e) => {
|
|
2502
2501
|
toggleHovered(false);
|
|
2503
2502
|
onMouseLeave && onMouseLeave(e);
|
|
@@ -2529,7 +2528,7 @@ Radio[exports.RADIO_SYMBOL_KEY] = true;
|
|
|
2529
2528
|
exports.Radio = Radio;
|
|
2530
2529
|
|
|
2531
2530
|
// src/components/ControlButtons/version.ts
|
|
2532
|
-
exports.CONTROL_BUTTONS_VERSION = "2.0.
|
|
2531
|
+
exports.CONTROL_BUTTONS_VERSION = "2.0.2";
|
|
2533
2532
|
|
|
2534
2533
|
// src/components/Menu/Menu.styled.ts
|
|
2535
2534
|
var getStylesBySizeVar = (sizeVar) => {
|
|
@@ -2607,7 +2606,7 @@ var Menu = (_a) => {
|
|
|
2607
2606
|
"disabled"
|
|
2608
2607
|
]);
|
|
2609
2608
|
const [selected, handleToggle] = useOnToggle(isSelected, defaultSelected);
|
|
2610
|
-
const LeftSourceClone = leftSource ?
|
|
2609
|
+
const LeftSourceClone = leftSource ? React__namespace.default.cloneElement(leftSource, __spreadProps(__spreadValues({}, rest), {
|
|
2611
2610
|
isSelected
|
|
2612
2611
|
})) : leftSource;
|
|
2613
2612
|
const handleOnClick = (e) => {
|
|
@@ -2641,10 +2640,10 @@ exports.MenuSizeVariants = {
|
|
|
2641
2640
|
};
|
|
2642
2641
|
|
|
2643
2642
|
// src/components/Menu/version.ts
|
|
2644
|
-
exports.MENU_VERSION = "2.0.
|
|
2645
|
-
exports.DropdownButtonContext =
|
|
2643
|
+
exports.MENU_VERSION = "2.0.1";
|
|
2644
|
+
exports.DropdownButtonContext = React.createContext(null);
|
|
2646
2645
|
exports.useDropdownButtonContext = () => {
|
|
2647
|
-
const context =
|
|
2646
|
+
const context = React.useContext(exports.DropdownButtonContext);
|
|
2648
2647
|
if (!context) {
|
|
2649
2648
|
throw new Error("DropdownButtonContext must be used within a DropdownButton component");
|
|
2650
2649
|
}
|
|
@@ -2686,14 +2685,14 @@ exports.StyledIcon = styled6__default.default.svg`
|
|
|
2686
2685
|
fill: ${({ color }) => color && exports.colorTokens[color]};
|
|
2687
2686
|
}
|
|
2688
2687
|
`;
|
|
2689
|
-
var Icon =
|
|
2688
|
+
var Icon = React.forwardRef((_a, ref) => {
|
|
2690
2689
|
var _b = _a, { iconSource } = _b, rest = __objRest(_b, ["iconSource"]);
|
|
2691
2690
|
return /* @__PURE__ */ jsxRuntime.jsx(exports.StyledIcon, __spreadProps(__spreadValues({ as: iconSource, ref }, rest), { "data-shoplflow": "Icon" }));
|
|
2692
2691
|
});
|
|
2693
2692
|
exports.Icon = Icon;
|
|
2694
2693
|
|
|
2695
2694
|
// src/components/Icon/version.ts
|
|
2696
|
-
exports.ICON_VERSION = "2.0.
|
|
2695
|
+
exports.ICON_VERSION = "2.0.1";
|
|
2697
2696
|
var DropdownButtonMenu = (_a) => {
|
|
2698
2697
|
var _b = _a, { onClick, children } = _b, rest = __objRest(_b, ["onClick", "children"]);
|
|
2699
2698
|
const { setIsOpen } = exports.useDropdownButtonContext();
|
|
@@ -2731,7 +2730,7 @@ var DropdownButton = (_a) => {
|
|
|
2731
2730
|
"styleVar",
|
|
2732
2731
|
"floatingZIndex"
|
|
2733
2732
|
]);
|
|
2734
|
-
const selector =
|
|
2733
|
+
const selector = React.useRef(`shoplflow-${crypto.randomUUID()}-dropdown-button`).current;
|
|
2735
2734
|
const [isOpen, setIsOpen] = utils.useOutsideClick({
|
|
2736
2735
|
selector: `.${selector}`,
|
|
2737
2736
|
useOutsideScroll: true
|
|
@@ -2880,9 +2879,9 @@ var StyledSplitButton = styled6__default.default.button`
|
|
|
2880
2879
|
${({ sizeVar }) => getStyleBySizeVar3(sizeVar)};
|
|
2881
2880
|
${({ disabled }) => getDisabledStyle(disabled)}
|
|
2882
2881
|
`;
|
|
2883
|
-
exports.SplitButtonContext =
|
|
2882
|
+
exports.SplitButtonContext = React.createContext(null);
|
|
2884
2883
|
exports.useSplitButtonContext = () => {
|
|
2885
|
-
const context =
|
|
2884
|
+
const context = React.useContext(exports.SplitButtonContext);
|
|
2886
2885
|
if (!context) {
|
|
2887
2886
|
throw new Error("SplitButtonContext must be used within a SplitButton component");
|
|
2888
2887
|
}
|
|
@@ -2933,7 +2932,7 @@ var SplitButton = (_a) => {
|
|
|
2933
2932
|
"lineClamp",
|
|
2934
2933
|
"text"
|
|
2935
2934
|
]);
|
|
2936
|
-
const selector =
|
|
2935
|
+
const selector = React.useRef(`shoplflow-${crypto.randomUUID()}-split-button`).current;
|
|
2937
2936
|
const [isOpen, setIsOpen] = utils.useOutsideClick({
|
|
2938
2937
|
selector: `.${selector}`,
|
|
2939
2938
|
useOutsideScroll: true
|
|
@@ -3013,7 +3012,7 @@ exports.SplitButtonStyleVariants = {
|
|
|
3013
3012
|
};
|
|
3014
3013
|
|
|
3015
3014
|
// src/components/Buttons/version.ts
|
|
3016
|
-
exports.BUTTONS_VERSION = "2.0.
|
|
3015
|
+
exports.BUTTONS_VERSION = "2.0.4";
|
|
3017
3016
|
var informationStyle = react$1.css`
|
|
3018
3017
|
background: ${exports.colorTokens.neutral400_5};
|
|
3019
3018
|
& > svg > circle {
|
|
@@ -3090,7 +3089,7 @@ var BulletHelperText = (_a) => {
|
|
|
3090
3089
|
};
|
|
3091
3090
|
var NormalHelperText = (_a) => {
|
|
3092
3091
|
var _b = _a, { color, position, children } = _b, rest = __objRest(_b, ["color", "position", "children"]);
|
|
3093
|
-
const getPositionStyle =
|
|
3092
|
+
const getPositionStyle = React.useCallback(() => {
|
|
3094
3093
|
switch (position) {
|
|
3095
3094
|
case "PRESET-TOP":
|
|
3096
3095
|
return {
|
|
@@ -3147,7 +3146,7 @@ exports.CalloutTypes = {
|
|
|
3147
3146
|
};
|
|
3148
3147
|
|
|
3149
3148
|
// src/components/Callout/version.ts
|
|
3150
|
-
exports.CALLOUT_VERSION = "2.1.
|
|
3149
|
+
exports.CALLOUT_VERSION = "2.1.5";
|
|
3151
3150
|
var StyledDropdown = styled6__default.default.div`
|
|
3152
3151
|
width: ${({ width }) => width};
|
|
3153
3152
|
`;
|
|
@@ -3160,9 +3159,9 @@ var StyledDropdownContent = styled6__default.default.div`
|
|
|
3160
3159
|
border-radius: 6px;
|
|
3161
3160
|
box-shadow: ${exports.boxShadowTokens.dropShadow};
|
|
3162
3161
|
`;
|
|
3163
|
-
var DropdownContext =
|
|
3162
|
+
var DropdownContext = React.createContext(null);
|
|
3164
3163
|
var useDropdown = () => {
|
|
3165
|
-
const context =
|
|
3164
|
+
const context = React.useContext(DropdownContext);
|
|
3166
3165
|
if (context === null) {
|
|
3167
3166
|
throw new Error("useDropdown must be used within a DropdownProvider");
|
|
3168
3167
|
}
|
|
@@ -3329,7 +3328,7 @@ var DropdownButtonIcon = styled6__default.default.div`
|
|
|
3329
3328
|
|
|
3330
3329
|
${({ disabled }) => getDisabledStyle2(disabled)};
|
|
3331
3330
|
`;
|
|
3332
|
-
var DropdownTriggerButton =
|
|
3331
|
+
var DropdownTriggerButton = React.forwardRef(
|
|
3333
3332
|
(_a, ref) => {
|
|
3334
3333
|
var _b = _a, {
|
|
3335
3334
|
width = "100%",
|
|
@@ -3355,7 +3354,7 @@ var DropdownTriggerButton = React3.forwardRef(
|
|
|
3355
3354
|
"onClear"
|
|
3356
3355
|
]);
|
|
3357
3356
|
const { isOpen, setIsOpen } = useDropdown();
|
|
3358
|
-
const [isHovered, setIsHovered] =
|
|
3357
|
+
const [isHovered, setIsHovered] = React.useState(false);
|
|
3359
3358
|
const handleOnClick = (e) => {
|
|
3360
3359
|
if (!disabled) {
|
|
3361
3360
|
onClick && onClick(e);
|
|
@@ -3381,8 +3380,8 @@ var DropdownTriggerButton = React3.forwardRef(
|
|
|
3381
3380
|
}
|
|
3382
3381
|
return "neutral700";
|
|
3383
3382
|
};
|
|
3384
|
-
const LeftSourceClone = leftSource ?
|
|
3385
|
-
const RightSourceClone = rightSource ?
|
|
3383
|
+
const LeftSourceClone = leftSource ? React.cloneElement(leftSource, __spreadProps(__spreadValues({}, leftSource.props), { disabled })) : leftSource;
|
|
3384
|
+
const RightSourceClone = rightSource ? React.cloneElement(rightSource, __spreadProps(__spreadValues({}, rightSource.props), { disabled })) : rightSource;
|
|
3386
3385
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3387
3386
|
StyledDropdownButtonWrapper,
|
|
3388
3387
|
{
|
|
@@ -3480,10 +3479,10 @@ var Dropdown = ({
|
|
|
3480
3479
|
offset: offset4 = 4,
|
|
3481
3480
|
placement
|
|
3482
3481
|
}) => {
|
|
3483
|
-
const [triggerRef, setTriggerRef] =
|
|
3484
|
-
const [size2, setSize] =
|
|
3485
|
-
const [isOpen, setIsOpen] =
|
|
3486
|
-
|
|
3482
|
+
const [triggerRef, setTriggerRef] = React.useState(null);
|
|
3483
|
+
const [size2, setSize] = React.useState({ width: 0, height: 0 });
|
|
3484
|
+
const [isOpen, setIsOpen] = React.useState(false);
|
|
3485
|
+
React.useEffect(() => {
|
|
3487
3486
|
if (triggerRef) {
|
|
3488
3487
|
setSize({
|
|
3489
3488
|
width: triggerRef.offsetWidth,
|
|
@@ -3491,7 +3490,7 @@ var Dropdown = ({
|
|
|
3491
3490
|
});
|
|
3492
3491
|
}
|
|
3493
3492
|
}, [triggerRef, width]);
|
|
3494
|
-
|
|
3493
|
+
React.useEffect(() => {
|
|
3495
3494
|
if (initialIsOpen === void 0) {
|
|
3496
3495
|
return;
|
|
3497
3496
|
}
|
|
@@ -3524,7 +3523,7 @@ exports.DropdownOptionVariants = {
|
|
|
3524
3523
|
};
|
|
3525
3524
|
|
|
3526
3525
|
// src/components/Dropdown/version.ts
|
|
3527
|
-
exports.DROPDOWN_VERSION = "2.0.
|
|
3526
|
+
exports.DROPDOWN_VERSION = "2.0.1";
|
|
3528
3527
|
var StyledList = styled6__default.default.li`
|
|
3529
3528
|
display: flex;
|
|
3530
3529
|
flex-direction: row;
|
|
@@ -3548,7 +3547,7 @@ var StyledText2Rows = styled6__default.default.div`
|
|
|
3548
3547
|
`;
|
|
3549
3548
|
var List = (_a) => {
|
|
3550
3549
|
var _b = _a, { children, leftSource, rightSource, style } = _b, rest = __objRest(_b, ["children", "leftSource", "rightSource", "style"]);
|
|
3551
|
-
const LeftSourceClone = leftSource ?
|
|
3550
|
+
const LeftSourceClone = leftSource ? React__namespace.default.cloneElement(leftSource, __spreadValues({}, rest)) : leftSource;
|
|
3552
3551
|
if (!children && rightSource) {
|
|
3553
3552
|
throw new Error("RightSource\uB294 children\uC774 \uD544\uC218\uB85C \uD3EC\uD568\uB418\uC5B4\uC57C\uD569\uB2C8\uB2E4.");
|
|
3554
3553
|
}
|
|
@@ -3568,7 +3567,7 @@ List.Text2Rows = exports.Text2Rows;
|
|
|
3568
3567
|
exports.List = List;
|
|
3569
3568
|
|
|
3570
3569
|
// src/components/List/version.ts
|
|
3571
|
-
exports.LIST_VERSION = "2.0.
|
|
3570
|
+
exports.LIST_VERSION = "2.0.2";
|
|
3572
3571
|
var getTypographyBySize = (size2) => {
|
|
3573
3572
|
switch (size2) {
|
|
3574
3573
|
case "XS":
|
|
@@ -3698,7 +3697,7 @@ exports.TagSizeVariants = {
|
|
|
3698
3697
|
};
|
|
3699
3698
|
|
|
3700
3699
|
// src/components/Tag/version.ts
|
|
3701
|
-
exports.TAG_VERSION = "2.0.
|
|
3700
|
+
exports.TAG_VERSION = "2.0.1";
|
|
3702
3701
|
var StyledTree = styled6__default.default(framerMotion.motion.ul)`
|
|
3703
3702
|
display: flex;
|
|
3704
3703
|
flex-direction: column;
|
|
@@ -3755,8 +3754,8 @@ var AnimateKey = {
|
|
|
3755
3754
|
};
|
|
3756
3755
|
var Tree = (_a) => {
|
|
3757
3756
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
|
3758
|
-
const [isMounted, setIsMounted] =
|
|
3759
|
-
|
|
3757
|
+
const [isMounted, setIsMounted] = React__namespace.default.useState(false);
|
|
3758
|
+
React.useEffect(() => {
|
|
3760
3759
|
setIsMounted(true);
|
|
3761
3760
|
}, []);
|
|
3762
3761
|
if (!isMounted) {
|
|
@@ -3786,14 +3785,14 @@ exports.TreeItem = (_a) => {
|
|
|
3786
3785
|
"disabled",
|
|
3787
3786
|
"onClick"
|
|
3788
3787
|
]);
|
|
3789
|
-
const [isOpened, setIsOpened] =
|
|
3790
|
-
const uniqueId =
|
|
3791
|
-
const CloneChildren =
|
|
3792
|
-
if (!
|
|
3788
|
+
const [isOpened, setIsOpened] = React__namespace.default.useState(initialIsOpen != null ? initialIsOpen : false);
|
|
3789
|
+
const uniqueId = React.useId();
|
|
3790
|
+
const CloneChildren = React__namespace.default.Children.map(children, (child) => {
|
|
3791
|
+
if (!React__namespace.default.isValidElement(child)) {
|
|
3793
3792
|
return child;
|
|
3794
3793
|
}
|
|
3795
3794
|
if (child.type[exports.TREE_SYMBOL_KEY]) {
|
|
3796
|
-
return
|
|
3795
|
+
return React__namespace.default.cloneElement(child, {
|
|
3797
3796
|
depth: depth + 1
|
|
3798
3797
|
});
|
|
3799
3798
|
}
|
|
@@ -3809,18 +3808,18 @@ exports.TreeItem = (_a) => {
|
|
|
3809
3808
|
}
|
|
3810
3809
|
return onClick(e);
|
|
3811
3810
|
};
|
|
3812
|
-
const LeftSourceClone = leftSource ?
|
|
3811
|
+
const LeftSourceClone = leftSource ? React__namespace.default.cloneElement(leftSource, __spreadValues(__spreadValues({
|
|
3813
3812
|
disabled,
|
|
3814
3813
|
onClick
|
|
3815
3814
|
}, rest), leftSource.props)) : leftSource;
|
|
3816
|
-
|
|
3815
|
+
React.useEffect(() => {
|
|
3817
3816
|
if (isOpen !== void 0) {
|
|
3818
3817
|
setIsOpened(isOpen);
|
|
3819
3818
|
}
|
|
3820
3819
|
}, [isOpen]);
|
|
3821
3820
|
const isLastTree = !children && depth > 0;
|
|
3822
3821
|
return /* @__PURE__ */ jsxRuntime.jsxs(StyledTreeItemWrapper, { hasBackground: isOpened || isLastTree, children: [
|
|
3823
|
-
/* @__PURE__ */
|
|
3822
|
+
/* @__PURE__ */ React.createElement(
|
|
3824
3823
|
StyledTreeItem,
|
|
3825
3824
|
__spreadValues(__spreadProps(__spreadValues({
|
|
3826
3825
|
disabled,
|
|
@@ -3858,7 +3857,7 @@ Tree.Item = exports.TreeItem;
|
|
|
3858
3857
|
exports.Tree = Tree;
|
|
3859
3858
|
|
|
3860
3859
|
// src/components/Tree/version.ts
|
|
3861
|
-
exports.TREE_VERSION = "2.0.
|
|
3860
|
+
exports.TREE_VERSION = "2.0.1";
|
|
3862
3861
|
var StyledInput = styled6__default.default.input`
|
|
3863
3862
|
padding: ${({ sizeVar }) => sizeVar === "S" ? "0 8px" : "4px 12px"};
|
|
3864
3863
|
background-color: transparent;
|
|
@@ -3937,7 +3936,7 @@ var TextCounter = ({ currentLength, maxLength, isError }) => {
|
|
|
3937
3936
|
] });
|
|
3938
3937
|
};
|
|
3939
3938
|
var TextCounter_default = TextCounter;
|
|
3940
|
-
|
|
3939
|
+
React.createContext({
|
|
3941
3940
|
domain: "SHOPL",
|
|
3942
3941
|
handleToggleTheme: () => {
|
|
3943
3942
|
}
|
|
@@ -4032,7 +4031,7 @@ var getNumberLimitRange = (value, min, max) => {
|
|
|
4032
4031
|
}
|
|
4033
4032
|
return String(value);
|
|
4034
4033
|
};
|
|
4035
|
-
var Input =
|
|
4034
|
+
var Input = React.forwardRef(
|
|
4036
4035
|
(_a, ref) => {
|
|
4037
4036
|
var _b = _a, {
|
|
4038
4037
|
onFocus,
|
|
@@ -4085,20 +4084,20 @@ var Input = React3.forwardRef(
|
|
|
4085
4084
|
"rightSourceStyle",
|
|
4086
4085
|
"leftSource"
|
|
4087
4086
|
]);
|
|
4088
|
-
const [text, setText] =
|
|
4089
|
-
const [isFocused, setIsFocused] =
|
|
4090
|
-
const [type, setType] =
|
|
4091
|
-
const [isHovered, setIsHovered] =
|
|
4092
|
-
const uniqueId =
|
|
4093
|
-
const inputRef =
|
|
4087
|
+
const [text, setText] = React.useState("");
|
|
4088
|
+
const [isFocused, setIsFocused] = React.useState(Boolean(initIsFocused));
|
|
4089
|
+
const [type, setType] = React.useState(initialType);
|
|
4090
|
+
const [isHovered, setIsHovered] = React.useState(false);
|
|
4091
|
+
const uniqueId = React.useId();
|
|
4092
|
+
const inputRef = React__namespace.default.useRef(null);
|
|
4094
4093
|
const refs = useMergeRefs2(ref, inputRef);
|
|
4095
|
-
const convertToString =
|
|
4094
|
+
const convertToString = React.useCallback((value2) => {
|
|
4096
4095
|
if (typeof value2 !== "number") {
|
|
4097
4096
|
return typeof value2 === "string" ? value2 : value2.join("");
|
|
4098
4097
|
}
|
|
4099
4098
|
return String(value2);
|
|
4100
4099
|
}, []);
|
|
4101
|
-
const sliceText =
|
|
4100
|
+
const sliceText = React.useCallback(
|
|
4102
4101
|
(value2) => {
|
|
4103
4102
|
if (maxLength && value2.length > maxLength) {
|
|
4104
4103
|
return value2.slice(0, maxLength);
|
|
@@ -4154,14 +4153,14 @@ var Input = React3.forwardRef(
|
|
|
4154
4153
|
setType("password");
|
|
4155
4154
|
}
|
|
4156
4155
|
};
|
|
4157
|
-
|
|
4156
|
+
React.useEffect(() => {
|
|
4158
4157
|
if (defaultValue !== void 0) {
|
|
4159
4158
|
const convertString = convertToString(defaultValue);
|
|
4160
4159
|
const slicedText = sliceText(convertString);
|
|
4161
4160
|
setText(slicedText);
|
|
4162
4161
|
}
|
|
4163
4162
|
}, [convertToString, defaultValue, maxLength, sliceText]);
|
|
4164
|
-
|
|
4163
|
+
React.useEffect(() => {
|
|
4165
4164
|
var _a2;
|
|
4166
4165
|
if (value !== void 0) {
|
|
4167
4166
|
const convertString = convertToString(value);
|
|
@@ -4170,11 +4169,11 @@ var Input = React3.forwardRef(
|
|
|
4170
4169
|
setText(slicedText);
|
|
4171
4170
|
}
|
|
4172
4171
|
}, [convertToString, maxLength, sliceText, value]);
|
|
4173
|
-
|
|
4172
|
+
React.useEffect(() => {
|
|
4174
4173
|
setType(initialType);
|
|
4175
4174
|
}, [initialType]);
|
|
4176
4175
|
const height = sizeVar === "M" ? "40px" : "32px";
|
|
4177
|
-
|
|
4176
|
+
React.useEffect(() => {
|
|
4178
4177
|
if (typeof initIsFocused === "undefined") {
|
|
4179
4178
|
return;
|
|
4180
4179
|
}
|
|
@@ -4271,7 +4270,7 @@ var StyledInputButtonContent = styled6__default.default.input`
|
|
|
4271
4270
|
color: ${exports.colorTokens.neutral350};
|
|
4272
4271
|
}
|
|
4273
4272
|
`;
|
|
4274
|
-
var InputButton =
|
|
4273
|
+
var InputButton = React.forwardRef(
|
|
4275
4274
|
(_a, ref) => {
|
|
4276
4275
|
var _b = _a, {
|
|
4277
4276
|
value,
|
|
@@ -4299,10 +4298,10 @@ var InputButton = React3.forwardRef(
|
|
|
4299
4298
|
"width"
|
|
4300
4299
|
]);
|
|
4301
4300
|
var _a2, _b2;
|
|
4302
|
-
const [text, setText] =
|
|
4303
|
-
const [isHovered, setIsHovered] =
|
|
4304
|
-
const prevValue =
|
|
4305
|
-
const convertToString =
|
|
4301
|
+
const [text, setText] = React.useState((_a2 = value != null ? value : defaultValue) != null ? _a2 : "");
|
|
4302
|
+
const [isHovered, setIsHovered] = React.useState(false);
|
|
4303
|
+
const prevValue = React.useRef((_b2 = value != null ? value : defaultValue) != null ? _b2 : "");
|
|
4304
|
+
const convertToString = React.useCallback((value2) => {
|
|
4306
4305
|
if (typeof value2 !== "number") {
|
|
4307
4306
|
return typeof value2 === "string" ? value2 : value2.join("");
|
|
4308
4307
|
}
|
|
@@ -4327,7 +4326,7 @@ var InputButton = React3.forwardRef(
|
|
|
4327
4326
|
const handleOnMouseLeave = () => {
|
|
4328
4327
|
setIsHovered(false);
|
|
4329
4328
|
};
|
|
4330
|
-
|
|
4329
|
+
React.useEffect(() => {
|
|
4331
4330
|
if (prevValue.current === value) {
|
|
4332
4331
|
return;
|
|
4333
4332
|
}
|
|
@@ -4337,7 +4336,7 @@ var InputButton = React3.forwardRef(
|
|
|
4337
4336
|
prevValue.current = convertString;
|
|
4338
4337
|
}
|
|
4339
4338
|
}, [convertToString, value]);
|
|
4340
|
-
|
|
4339
|
+
React.useEffect(() => {
|
|
4341
4340
|
if (prevValue.current === value) {
|
|
4342
4341
|
return;
|
|
4343
4342
|
}
|
|
@@ -4389,9 +4388,9 @@ var StyledTextarea = styled6__default.default.textarea`
|
|
|
4389
4388
|
color: ${exports.colorTokens.neutral350};
|
|
4390
4389
|
}
|
|
4391
4390
|
`;
|
|
4392
|
-
var TextAreaContext =
|
|
4391
|
+
var TextAreaContext = React.createContext(null);
|
|
4393
4392
|
var useTextArea = () => {
|
|
4394
|
-
const context =
|
|
4393
|
+
const context = React.useContext(TextAreaContext);
|
|
4395
4394
|
if (!context) {
|
|
4396
4395
|
throw new Error("useTextArea must be used within a TextAreaProvider");
|
|
4397
4396
|
}
|
|
@@ -4404,7 +4403,7 @@ var MaxLength = () => {
|
|
|
4404
4403
|
}
|
|
4405
4404
|
return /* @__PURE__ */ jsxRuntime.jsx(StackContainer, { padding: "0 0 0 4px", children: /* @__PURE__ */ jsxRuntime.jsx(TextCounter_default, { currentLength: String(text).length, maxLength }) });
|
|
4406
4405
|
};
|
|
4407
|
-
var TextArea =
|
|
4406
|
+
var TextArea = React.forwardRef(
|
|
4408
4407
|
(_a, ref) => {
|
|
4409
4408
|
var _b = _a, {
|
|
4410
4409
|
name,
|
|
@@ -4443,9 +4442,9 @@ var TextArea = React3.forwardRef(
|
|
|
4443
4442
|
"leftSource",
|
|
4444
4443
|
"rightSource"
|
|
4445
4444
|
]);
|
|
4446
|
-
const [text, setText] =
|
|
4447
|
-
const [isFocused, setIsFocused] =
|
|
4448
|
-
const [isHovered, setIsHovered] =
|
|
4445
|
+
const [text, setText] = React.useState("");
|
|
4446
|
+
const [isFocused, setIsFocused] = React.useState(false);
|
|
4447
|
+
const [isHovered, setIsHovered] = React.useState(false);
|
|
4449
4448
|
const handleOnMouseEnter = () => {
|
|
4450
4449
|
setIsHovered(true);
|
|
4451
4450
|
};
|
|
@@ -4470,7 +4469,7 @@ var TextArea = React3.forwardRef(
|
|
|
4470
4469
|
}
|
|
4471
4470
|
return String(value2);
|
|
4472
4471
|
};
|
|
4473
|
-
|
|
4472
|
+
React.useEffect(() => {
|
|
4474
4473
|
if (defaultValue) {
|
|
4475
4474
|
const convertString = convertToString(defaultValue);
|
|
4476
4475
|
if (maxLength && convertString.length > maxLength) {
|
|
@@ -4479,7 +4478,7 @@ var TextArea = React3.forwardRef(
|
|
|
4479
4478
|
setText(convertString);
|
|
4480
4479
|
}
|
|
4481
4480
|
}, [defaultValue, maxLength]);
|
|
4482
|
-
|
|
4481
|
+
React.useEffect(() => {
|
|
4483
4482
|
if (value) {
|
|
4484
4483
|
const convertString = convertToString(value);
|
|
4485
4484
|
if (maxLength && convertString.length > maxLength) {
|
|
@@ -4488,7 +4487,7 @@ var TextArea = React3.forwardRef(
|
|
|
4488
4487
|
setText(convertToString(value));
|
|
4489
4488
|
}
|
|
4490
4489
|
}, [maxLength, value]);
|
|
4491
|
-
const uniqueId =
|
|
4490
|
+
const uniqueId = React.useId();
|
|
4492
4491
|
const contextValue = {
|
|
4493
4492
|
text,
|
|
4494
4493
|
maxLength
|
|
@@ -4587,7 +4586,7 @@ var SelectInputButton = (_a) => {
|
|
|
4587
4586
|
"rightSource",
|
|
4588
4587
|
"sizeVar"
|
|
4589
4588
|
]);
|
|
4590
|
-
const [isHovered, setIsHovered] =
|
|
4589
|
+
const [isHovered, setIsHovered] = React.useState(false);
|
|
4591
4590
|
const handleOnClick = (e) => {
|
|
4592
4591
|
e.preventDefault();
|
|
4593
4592
|
e.stopPropagation();
|
|
@@ -4645,7 +4644,7 @@ var SelectInputButton = (_a) => {
|
|
|
4645
4644
|
exports.SelectInputButton = SelectInputButton;
|
|
4646
4645
|
|
|
4647
4646
|
// src/components/Inputs/version.ts
|
|
4648
|
-
exports.INPUTS_VERSION = "2.0.
|
|
4647
|
+
exports.INPUTS_VERSION = "2.0.1";
|
|
4649
4648
|
var StyledTooltipContent = styled6__default.default.div`
|
|
4650
4649
|
background-color: ${exports.colorTokens.neutral700};
|
|
4651
4650
|
padding: 4px 8px;
|
|
@@ -4678,14 +4677,14 @@ var Tooltip = (_a) => {
|
|
|
4678
4677
|
"triggerWidth",
|
|
4679
4678
|
"portalRef"
|
|
4680
4679
|
]);
|
|
4681
|
-
const [isOpen, setIsOpen] =
|
|
4682
|
-
const showHandler =
|
|
4680
|
+
const [isOpen, setIsOpen] = React.useState(false);
|
|
4681
|
+
const showHandler = React.useCallback(() => {
|
|
4683
4682
|
if (open === void 0) {
|
|
4684
4683
|
setIsOpen(true);
|
|
4685
4684
|
}
|
|
4686
4685
|
onOpenChange == null ? void 0 : onOpenChange(true);
|
|
4687
4686
|
}, [open, onOpenChange]);
|
|
4688
|
-
const hideHandler =
|
|
4687
|
+
const hideHandler = React.useCallback(() => {
|
|
4689
4688
|
if (open === void 0) {
|
|
4690
4689
|
setIsOpen(false);
|
|
4691
4690
|
}
|
|
@@ -4723,10 +4722,10 @@ Tooltip.Content = TooltipContent;
|
|
|
4723
4722
|
exports.Tooltip = Tooltip;
|
|
4724
4723
|
|
|
4725
4724
|
// src/components/Tooltip/version.ts
|
|
4726
|
-
exports.TOOLTIP_VERSION = "2.0.
|
|
4727
|
-
exports.TabsContext =
|
|
4725
|
+
exports.TOOLTIP_VERSION = "2.0.1";
|
|
4726
|
+
exports.TabsContext = React.createContext(null);
|
|
4728
4727
|
exports.useTabs = () => {
|
|
4729
|
-
const context =
|
|
4728
|
+
const context = React.useContext(exports.TabsContext);
|
|
4730
4729
|
if (context === null) {
|
|
4731
4730
|
throw new Error("useTabs should be used in Tabs");
|
|
4732
4731
|
}
|
|
@@ -4903,12 +4902,12 @@ var Tab = (_a) => {
|
|
|
4903
4902
|
"activeColor"
|
|
4904
4903
|
]);
|
|
4905
4904
|
const { activeTab, setActiveTab } = exports.useTabs();
|
|
4906
|
-
const [isHover, setIsHover] =
|
|
4905
|
+
const [isHover, setIsHover] = React.useState(false);
|
|
4907
4906
|
const isActive = value === activeTab;
|
|
4908
|
-
const hoverHandler =
|
|
4907
|
+
const hoverHandler = React.useCallback(() => {
|
|
4909
4908
|
setIsHover(true);
|
|
4910
4909
|
}, []);
|
|
4911
|
-
const unhoverHandler =
|
|
4910
|
+
const unhoverHandler = React.useCallback(() => {
|
|
4912
4911
|
setIsHover(false);
|
|
4913
4912
|
}, []);
|
|
4914
4913
|
const clickHandler = (event) => {
|
|
@@ -4958,8 +4957,8 @@ var Tab = (_a) => {
|
|
|
4958
4957
|
);
|
|
4959
4958
|
};
|
|
4960
4959
|
var Tabs = ({ children, initialTab, onChange }) => {
|
|
4961
|
-
const [activeTab, setActiveTab] =
|
|
4962
|
-
|
|
4960
|
+
const [activeTab, setActiveTab] = React.useState(initialTab);
|
|
4961
|
+
React.useEffect(() => {
|
|
4963
4962
|
if (!onChange || !activeTab) {
|
|
4964
4963
|
return;
|
|
4965
4964
|
}
|
|
@@ -4990,7 +4989,7 @@ exports.TabSizeVariants = {
|
|
|
4990
4989
|
};
|
|
4991
4990
|
|
|
4992
4991
|
// src/components/Tabs/version.ts
|
|
4993
|
-
exports.TABS_VERSION = "2.0.
|
|
4992
|
+
exports.TABS_VERSION = "2.0.1";
|
|
4994
4993
|
var PaginationWrapper = styled6__default.default.div`
|
|
4995
4994
|
display: flex;
|
|
4996
4995
|
align-items: center;
|
|
@@ -5150,7 +5149,7 @@ Pagination.SizeSelector = PaginationSizeSelector_default;
|
|
|
5150
5149
|
exports.Pagination = Pagination;
|
|
5151
5150
|
|
|
5152
5151
|
// src/components/Pagination/version.ts
|
|
5153
|
-
exports.PAGINATION_VERSION = "2.0.
|
|
5152
|
+
exports.PAGINATION_VERSION = "2.0.1";
|
|
5154
5153
|
var getLabelStyleBySizeVar = (sizeVar) => {
|
|
5155
5154
|
switch (sizeVar) {
|
|
5156
5155
|
case "S": {
|
|
@@ -5221,9 +5220,9 @@ var StyledToggleInnerInput = styled6__default.default.input`
|
|
|
5221
5220
|
opacity: 0;
|
|
5222
5221
|
visibility: hidden;
|
|
5223
5222
|
`;
|
|
5224
|
-
var ToggleButtonContext =
|
|
5223
|
+
var ToggleButtonContext = React.createContext(null);
|
|
5225
5224
|
var useToggleButton = () => {
|
|
5226
|
-
const context =
|
|
5225
|
+
const context = React.useContext(ToggleButtonContext);
|
|
5227
5226
|
if (!context) {
|
|
5228
5227
|
throw new Error("ToggleInnerButton \uCEF4\uD3EC\uB10C\uD2B8\uB294 ToggleButton \uB0B4\uBD80\uC5D0\uC11C \uC0AC\uC6A9\uD574\uC8FC\uC138\uC694");
|
|
5229
5228
|
}
|
|
@@ -5249,12 +5248,12 @@ var ToggleButton = (_a) => {
|
|
|
5249
5248
|
]);
|
|
5250
5249
|
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
5250
|
};
|
|
5252
|
-
var ToggleInnerRadio =
|
|
5251
|
+
var ToggleInnerRadio = React.forwardRef(
|
|
5253
5252
|
(_a, ref) => {
|
|
5254
5253
|
var _b = _a, { label, disabled: itemDisabled, value, id } = _b, rest = __objRest(_b, ["label", "disabled", "value", "id"]);
|
|
5255
5254
|
const { fixedWidth, onChange, targetName, selectedValue, sizeVar, disabled: groupDisabled } = useToggleButton();
|
|
5256
5255
|
const disabled = groupDisabled || itemDisabled;
|
|
5257
|
-
const labelRef =
|
|
5256
|
+
const labelRef = React.useRef(null);
|
|
5258
5257
|
let selected = false;
|
|
5259
5258
|
if (selectedValue && selectedValue === value) {
|
|
5260
5259
|
selected = true;
|
|
@@ -5321,7 +5320,7 @@ exports.ToggleButtonSizeVariants = {
|
|
|
5321
5320
|
};
|
|
5322
5321
|
|
|
5323
5322
|
// src/components/ToggleButton/version.ts
|
|
5324
|
-
exports.TOGGLE_BUTTON_VERSION = "2.0.
|
|
5323
|
+
exports.TOGGLE_BUTTON_VERSION = "2.0.2";
|
|
5325
5324
|
var SmallStyledDayDatepickerWrapper = styled6__default.default.div`
|
|
5326
5325
|
display: flex;
|
|
5327
5326
|
width: 280px;
|
|
@@ -5905,18 +5904,18 @@ var OptionListItem = styled6__default.default.li`
|
|
|
5905
5904
|
`;
|
|
5906
5905
|
var YearSelect = ({ optionList, className, parentClassName, activeValue, maxHeight, onClick }) => {
|
|
5907
5906
|
var _a;
|
|
5908
|
-
const optionListRef =
|
|
5909
|
-
const parentRef =
|
|
5910
|
-
const simpleBarContentRef =
|
|
5911
|
-
const [isAllRefMounted, setIsAllRefMounted] =
|
|
5907
|
+
const optionListRef = React.useRef([]);
|
|
5908
|
+
const parentRef = React.useRef(null);
|
|
5909
|
+
const simpleBarContentRef = React.useRef(null);
|
|
5910
|
+
const [isAllRefMounted, setIsAllRefMounted] = React.useState(false);
|
|
5912
5911
|
const [isOpened, setIsOpened] = utils.useOutsideClick({
|
|
5913
5912
|
selector: `.${parentClassName}` || ""
|
|
5914
5913
|
});
|
|
5915
|
-
|
|
5914
|
+
React.useEffect(() => {
|
|
5916
5915
|
setIsOpened(isOpened);
|
|
5917
5916
|
}, []);
|
|
5918
5917
|
const height = Math.min(((_a = optionList == null ? void 0 : optionList.length) != null ? _a : 0) * 32, Number(parseInt(maxHeight || "0")));
|
|
5919
|
-
|
|
5918
|
+
React.useEffect(() => {
|
|
5920
5919
|
var _a2, _b, _c, _d, _e, _f, _g;
|
|
5921
5920
|
if (!isAllRefMounted || !activeValue || !maxHeight) {
|
|
5922
5921
|
return;
|
|
@@ -5974,7 +5973,7 @@ var YearStepper = ({
|
|
|
5974
5973
|
});
|
|
5975
5974
|
const startYear = minDate ? minDate.getFullYear() : 2e3;
|
|
5976
5975
|
const endYear = maxDate ? maxDate.getFullYear() : 2100;
|
|
5977
|
-
const OptionList2 =
|
|
5976
|
+
const OptionList2 = React.useMemo(
|
|
5978
5977
|
() => Array.from({ length: endYear - startYear + 1 }).fill(0).map((_, index) => ({ value: startYear + index, label: `${startYear + index}` })).sort((a, b) => b.value - a.value),
|
|
5979
5978
|
[startYear, endYear]
|
|
5980
5979
|
);
|
|
@@ -6322,14 +6321,14 @@ var MonthDatepicker = ({
|
|
|
6322
6321
|
onlySingleMonth,
|
|
6323
6322
|
sizeVar = "M"
|
|
6324
6323
|
}) => {
|
|
6325
|
-
const [currentDate, setCurrentDate] =
|
|
6326
|
-
const [selectedStartMonthAndYear, setSelectedStartMonthAndYear] =
|
|
6324
|
+
const [currentDate, setCurrentDate] = React.useState(initStartDate || /* @__PURE__ */ new Date());
|
|
6325
|
+
const [selectedStartMonthAndYear, setSelectedStartMonthAndYear] = React.useState(
|
|
6327
6326
|
initStartDate ? [initStartDate.getMonth() + 1, initStartDate.getFullYear()] : null
|
|
6328
6327
|
);
|
|
6329
|
-
const [selectedEndMonthAndYear, setSelectedEndMonthAndYear] =
|
|
6328
|
+
const [selectedEndMonthAndYear, setSelectedEndMonthAndYear] = React.useState(
|
|
6330
6329
|
initEndDate ? [initEndDate.getMonth() + 1, initEndDate.getFullYear()] : null
|
|
6331
6330
|
);
|
|
6332
|
-
const Months =
|
|
6331
|
+
const Months = React.useMemo(() => {
|
|
6333
6332
|
return Array.from({ length: 12 }).map((_, index) => index + 1);
|
|
6334
6333
|
}, []);
|
|
6335
6334
|
const clickMonth = (month, year) => {
|
|
@@ -6555,7 +6554,7 @@ var AnnualDatepicker = ({
|
|
|
6555
6554
|
handleYearClick,
|
|
6556
6555
|
disabledYears
|
|
6557
6556
|
}) => {
|
|
6558
|
-
const [selectedYear, setSelectedYear] =
|
|
6557
|
+
const [selectedYear, setSelectedYear] = React.useState(currentYear || (/* @__PURE__ */ new Date()).getFullYear());
|
|
6559
6558
|
const Years = Array.from({ length: endYear - startYear + 1 }).map((_, index) => startYear + index);
|
|
6560
6559
|
const clickYear = (year) => {
|
|
6561
6560
|
setSelectedYear(year);
|
|
@@ -6714,15 +6713,15 @@ var WeekDatepicker = ({
|
|
|
6714
6713
|
onlySingleWeek
|
|
6715
6714
|
}) => {
|
|
6716
6715
|
const year = initStartDate ? dateFns.getISOWeekYear(initStartDate) : dateFns.getISOWeekYear(/* @__PURE__ */ new Date());
|
|
6717
|
-
const [currentDate, setCurrentDate] =
|
|
6718
|
-
const [selectedStartWeekAndYear, setSelectedStartWeekAndYear] =
|
|
6716
|
+
const [currentDate, setCurrentDate] = React.useState(new Date(year, 5, 5));
|
|
6717
|
+
const [selectedStartWeekAndYear, setSelectedStartWeekAndYear] = React.useState(
|
|
6719
6718
|
initStartDate ? [dateFns.getISOWeek(initStartDate || /* @__PURE__ */ new Date()), dateFns.getISOWeekYear(initStartDate || /* @__PURE__ */ new Date())] : null
|
|
6720
6719
|
);
|
|
6721
|
-
const [selectedEndWeekAndYear, setSelectedEndWeekAndYear] =
|
|
6720
|
+
const [selectedEndWeekAndYear, setSelectedEndWeekAndYear] = React.useState(
|
|
6722
6721
|
initEndDate ? [dateFns.getISOWeek(initEndDate || /* @__PURE__ */ new Date()), dateFns.getISOWeekYear(initEndDate || /* @__PURE__ */ new Date())] : null
|
|
6723
6722
|
);
|
|
6724
6723
|
const selectedYear = currentDate.getFullYear();
|
|
6725
|
-
const Years =
|
|
6724
|
+
const Years = React.useMemo(() => {
|
|
6726
6725
|
return Array.from({ length: getWeeksInYear(selectedYear) }).map((_, index) => {
|
|
6727
6726
|
return String(index + 1).padStart(2, "0");
|
|
6728
6727
|
});
|
|
@@ -6879,7 +6878,7 @@ var WeekDatepicker = ({
|
|
|
6879
6878
|
exports.WeekDatepicker = WeekDatepicker;
|
|
6880
6879
|
|
|
6881
6880
|
// src/components/Datepickers/version.ts
|
|
6882
|
-
exports.DATEPICKERS_VERSION = "2.0.
|
|
6881
|
+
exports.DATEPICKERS_VERSION = "2.0.3";
|
|
6883
6882
|
var StyledNumberCombobox = styled6__default.default.div``;
|
|
6884
6883
|
var IconWrapper2 = styled6__default.default(framerMotion.motion.div)`
|
|
6885
6884
|
display: flex;
|
|
@@ -6916,8 +6915,8 @@ var NumberCombobox = (_a) => {
|
|
|
6916
6915
|
"className",
|
|
6917
6916
|
"floatingZIndex"
|
|
6918
6917
|
]);
|
|
6919
|
-
const selector =
|
|
6920
|
-
const inputRef =
|
|
6918
|
+
const selector = React.useRef(`shoplflow-${crypto.randomUUID()}-number-combobox`).current;
|
|
6919
|
+
const inputRef = React.useRef(null);
|
|
6921
6920
|
const [isOpen, setIsOpen] = utils.useOutsideClick({
|
|
6922
6921
|
selector: `.${selector}`,
|
|
6923
6922
|
useOutsideScroll: true
|
|
@@ -7073,7 +7072,7 @@ exports.NumberComboboxSizeVariants = {
|
|
|
7073
7072
|
};
|
|
7074
7073
|
|
|
7075
7074
|
// src/components/Comboboxs/version.ts
|
|
7076
|
-
exports.COMBOBOXS_VERSION = "2.0.
|
|
7075
|
+
exports.COMBOBOXS_VERSION = "2.0.1";
|
|
7077
7076
|
var animation = react$1.keyframes`
|
|
7078
7077
|
0% {
|
|
7079
7078
|
transform: translateX(-100%);
|
|
@@ -7124,7 +7123,7 @@ var Skeleton = ({ styleVar = "rectangle", width = "50px", height = "20px" }) =>
|
|
|
7124
7123
|
exports.Skeleton = Skeleton;
|
|
7125
7124
|
|
|
7126
7125
|
// src/components/Skeleton/version.ts
|
|
7127
|
-
exports.SKELETON_VERSION = "2.0.
|
|
7126
|
+
exports.SKELETON_VERSION = "2.0.1";
|
|
7128
7127
|
|
|
7129
7128
|
// src/components/Slider/Slider.types.ts
|
|
7130
7129
|
exports.SLIDER_Z_INDEX = {
|
|
@@ -7300,8 +7299,8 @@ var useSlider = ({ bounds, step, range, handleRange, isDisabled = false }) => {
|
|
|
7300
7299
|
const { min, max } = bounds;
|
|
7301
7300
|
validateRange({ min, max, range });
|
|
7302
7301
|
validateStep({ min, max, step });
|
|
7303
|
-
const trackRef =
|
|
7304
|
-
const updateRange =
|
|
7302
|
+
const trackRef = React.useRef(null);
|
|
7303
|
+
const updateRange = React.useCallback(
|
|
7305
7304
|
(index, newValue) => {
|
|
7306
7305
|
const newRange = [range.min, range.max];
|
|
7307
7306
|
if (index === 0) {
|
|
@@ -7313,7 +7312,7 @@ var useSlider = ({ bounds, step, range, handleRange, isDisabled = false }) => {
|
|
|
7313
7312
|
},
|
|
7314
7313
|
[range, handleRange]
|
|
7315
7314
|
);
|
|
7316
|
-
const handleMouseDown =
|
|
7315
|
+
const handleMouseDown = React.useCallback(
|
|
7317
7316
|
(index) => (e) => {
|
|
7318
7317
|
if (isDisabled) {
|
|
7319
7318
|
return;
|
|
@@ -7338,7 +7337,7 @@ var useSlider = ({ bounds, step, range, handleRange, isDisabled = false }) => {
|
|
|
7338
7337
|
},
|
|
7339
7338
|
[isDisabled, min, max, step, updateRange]
|
|
7340
7339
|
);
|
|
7341
|
-
const handleClickTrack =
|
|
7340
|
+
const handleClickTrack = React.useCallback(
|
|
7342
7341
|
(e) => {
|
|
7343
7342
|
if (isDisabled || !trackRef.current) {
|
|
7344
7343
|
return;
|
|
@@ -7357,7 +7356,7 @@ var useSlider = ({ bounds, step, range, handleRange, isDisabled = false }) => {
|
|
|
7357
7356
|
},
|
|
7358
7357
|
[isDisabled, min, max, step, range, updateRange]
|
|
7359
7358
|
);
|
|
7360
|
-
const positions =
|
|
7359
|
+
const positions = React.useMemo(() => {
|
|
7361
7360
|
const startPosition = getPositionPercentage(0, [range.min, range.max], { min, max });
|
|
7362
7361
|
const endPosition = getPositionPercentage(1, [range.min, range.max], { min, max });
|
|
7363
7362
|
const width = endPosition - startPosition;
|
|
@@ -7416,9 +7415,9 @@ var Slider = ({
|
|
|
7416
7415
|
exports.Slider = Slider;
|
|
7417
7416
|
|
|
7418
7417
|
// src/components/Slider/version.ts
|
|
7419
|
-
exports.SLIDER_VERSION = "2.0.
|
|
7420
|
-
var SearchBarContext =
|
|
7421
|
-
var useSearchBarContext = () =>
|
|
7418
|
+
exports.SLIDER_VERSION = "2.0.1";
|
|
7419
|
+
var SearchBarContext = React.createContext({});
|
|
7420
|
+
var useSearchBarContext = () => React.useContext(SearchBarContext);
|
|
7422
7421
|
var SearchBarProvider = ({
|
|
7423
7422
|
children,
|
|
7424
7423
|
useFlexibleWidth,
|
|
@@ -7454,8 +7453,8 @@ var SearchBarInput = (_a) => {
|
|
|
7454
7453
|
"maxLength"
|
|
7455
7454
|
]);
|
|
7456
7455
|
const { useFlexibleWidth, isSelected } = useSearchBarContext();
|
|
7457
|
-
const [text, setText] =
|
|
7458
|
-
const debouncedOnChange =
|
|
7456
|
+
const [text, setText] = React.useState("");
|
|
7457
|
+
const debouncedOnChange = React.useRef(
|
|
7459
7458
|
utils.debounce(
|
|
7460
7459
|
(event) => {
|
|
7461
7460
|
const newValue = event.target.value;
|
|
@@ -7482,11 +7481,11 @@ var SearchBarInput = (_a) => {
|
|
|
7482
7481
|
debouncedOnChange(event);
|
|
7483
7482
|
}
|
|
7484
7483
|
};
|
|
7485
|
-
const handleOnClear =
|
|
7484
|
+
const handleOnClear = React.useCallback(() => {
|
|
7486
7485
|
setText("");
|
|
7487
7486
|
onClear == null ? void 0 : onClear();
|
|
7488
7487
|
}, [onClear]);
|
|
7489
|
-
const handleKeyDown =
|
|
7488
|
+
const handleKeyDown = React.useCallback(
|
|
7490
7489
|
(event) => {
|
|
7491
7490
|
if (type === "default" && event.key === "Enter") {
|
|
7492
7491
|
onSearch == null ? void 0 : onSearch(text);
|
|
@@ -7494,7 +7493,7 @@ var SearchBarInput = (_a) => {
|
|
|
7494
7493
|
},
|
|
7495
7494
|
[onSearch, text, type]
|
|
7496
7495
|
);
|
|
7497
|
-
const handleIconClick =
|
|
7496
|
+
const handleIconClick = React.useCallback(() => {
|
|
7498
7497
|
if (type === "default") {
|
|
7499
7498
|
onSearch == null ? void 0 : onSearch(text);
|
|
7500
7499
|
}
|
|
@@ -7613,10 +7612,10 @@ var SearchBar = (_a) => {
|
|
|
7613
7612
|
selector: ".search-bar",
|
|
7614
7613
|
onClose: () => setIsSelected(false)
|
|
7615
7614
|
});
|
|
7616
|
-
const handleContainerClick =
|
|
7615
|
+
const handleContainerClick = React.useCallback(() => {
|
|
7617
7616
|
setIsSelected(true);
|
|
7618
7617
|
}, [setIsSelected]);
|
|
7619
|
-
const containerWidth =
|
|
7618
|
+
const containerWidth = React.useMemo(() => {
|
|
7620
7619
|
if (!useFlexibleWidth) {
|
|
7621
7620
|
return width;
|
|
7622
7621
|
}
|
|
@@ -7642,7 +7641,7 @@ SearchBar.Category = SearchBarCategory;
|
|
|
7642
7641
|
SearchBar.Input = SearchBarInput;
|
|
7643
7642
|
|
|
7644
7643
|
// src/components/SearchBar/version.ts
|
|
7645
|
-
exports.SEARCH_BAR_VERSION = "2.0.
|
|
7644
|
+
exports.SEARCH_BAR_VERSION = "2.0.1";
|
|
7646
7645
|
|
|
7647
7646
|
// src/components/SearchBar/index.ts
|
|
7648
7647
|
exports.SearchBar = SearchBar;
|
|
@@ -7660,7 +7659,7 @@ var SpaceMarginWrapper = styled6__default.default(framerMotion.motion.div)`
|
|
|
7660
7659
|
height: 100%;
|
|
7661
7660
|
`;
|
|
7662
7661
|
var ModalPortal = () => {
|
|
7663
|
-
const modal =
|
|
7662
|
+
const modal = React.useContext(exports.ModalContext);
|
|
7664
7663
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: reactDom$1.createPortal(
|
|
7665
7664
|
/* @__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
7665
|
document.body
|