@shoplflow/base 0.32.9 → 0.32.11
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 +66 -75
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -57
- package/dist/index.d.ts +4 -57
- package/dist/index.js +68 -77
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -652,6 +652,7 @@ var StyledText = styled6__default.default.span`
|
|
|
652
652
|
${({ lineClamp }) => lineClamp && setEllipsis(lineClamp)};
|
|
653
653
|
text-align: ${({ textAlign }) => textAlign && textAlign};
|
|
654
654
|
white-space: ${({ whiteSpace }) => whiteSpace && whiteSpace};
|
|
655
|
+
text-overflow: ${({ textOverflow }) => textOverflow && textOverflow};
|
|
655
656
|
${({ textDecorations }) => textDecorations && react$1.css`
|
|
656
657
|
text-decoration: ${textDecorations};
|
|
657
658
|
`};
|
|
@@ -671,6 +672,7 @@ var Text = React3.forwardRef(
|
|
|
671
672
|
color = "neutral700",
|
|
672
673
|
display = "inline-block",
|
|
673
674
|
textAlign = "start",
|
|
675
|
+
textOverflow,
|
|
674
676
|
className,
|
|
675
677
|
as
|
|
676
678
|
} = _b, rest = __objRest(_b, [
|
|
@@ -680,6 +682,7 @@ var Text = React3.forwardRef(
|
|
|
680
682
|
"color",
|
|
681
683
|
"display",
|
|
682
684
|
"textAlign",
|
|
685
|
+
"textOverflow",
|
|
683
686
|
"className",
|
|
684
687
|
"as"
|
|
685
688
|
]);
|
|
@@ -692,6 +695,7 @@ var Text = React3.forwardRef(
|
|
|
692
695
|
color,
|
|
693
696
|
display,
|
|
694
697
|
textAlign,
|
|
698
|
+
textOverflow,
|
|
695
699
|
as
|
|
696
700
|
}, rest), {
|
|
697
701
|
"data-shoplflow": "Text",
|
|
@@ -4805,6 +4809,7 @@ var OptionListItem = styled6__default.default.li`
|
|
|
4805
4809
|
}
|
|
4806
4810
|
`;
|
|
4807
4811
|
var YearSelect = ({ optionList, className, parentClassName, activeValue, maxHeight, onClick }) => {
|
|
4812
|
+
var _a;
|
|
4808
4813
|
const optionListRef = React3.useRef([]);
|
|
4809
4814
|
const parentRef = React3.useRef(null);
|
|
4810
4815
|
const [isAllRefMounted, setIsAllRefMounted] = React3.useState(false);
|
|
@@ -4814,20 +4819,20 @@ var YearSelect = ({ optionList, className, parentClassName, activeValue, maxHeig
|
|
|
4814
4819
|
React3.useEffect(() => {
|
|
4815
4820
|
setIsOpened(isOpened);
|
|
4816
4821
|
}, []);
|
|
4817
|
-
const height = Math.min(optionList.length * 32, Number(parseInt(maxHeight || "0")));
|
|
4822
|
+
const height = Math.min(((_a = optionList == null ? void 0 : optionList.length) != null ? _a : 0) * 32, Number(parseInt(maxHeight || "0")));
|
|
4818
4823
|
React3.useEffect(() => {
|
|
4819
|
-
var
|
|
4824
|
+
var _a2, _b, _c, _d, _e, _f;
|
|
4820
4825
|
if (!isAllRefMounted || !activeValue || !maxHeight) {
|
|
4821
4826
|
return;
|
|
4822
4827
|
}
|
|
4823
4828
|
const selectedOptionIndex = optionList.findIndex((option) => (option == null ? void 0 : option.value) === activeValue);
|
|
4824
|
-
const heightPerOption = (_b = (
|
|
4829
|
+
const heightPerOption = (_b = (_a2 = optionListRef.current[selectedOptionIndex]) == null ? void 0 : _a2.offsetHeight) != null ? _b : 0;
|
|
4825
4830
|
const parentHeight = (_e = (_d = (_c = optionListRef.current[selectedOptionIndex]) == null ? void 0 : _c.closest("ul")) == null ? void 0 : _d.clientHeight) != null ? _e : 0;
|
|
4826
4831
|
if (heightPerOption * (selectedOptionIndex + 1) >= parentHeight) {
|
|
4827
4832
|
(_f = parentRef.current) == null ? void 0 : _f.scrollTo({ top: heightPerOption * selectedOptionIndex });
|
|
4828
4833
|
}
|
|
4829
4834
|
}, [isAllRefMounted, activeValue, maxHeight]);
|
|
4830
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Container5, { className: `${parentClassName} ${className}`, children: /* @__PURE__ */ jsxRuntime.jsx(OptionList, { ref: parentRef, maxHeight, style: { height }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4835
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Container5, { className: `${parentClassName} ${className}`, children: /* @__PURE__ */ jsxRuntime.jsx(OptionList, { ref: parentRef, maxHeight, style: { height }, className, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4831
4836
|
SimpleBarReact__default.default,
|
|
4832
4837
|
{
|
|
4833
4838
|
style: {
|
|
@@ -4835,6 +4840,7 @@ var YearSelect = ({ optionList, className, parentClassName, activeValue, maxHeig
|
|
|
4835
4840
|
height
|
|
4836
4841
|
},
|
|
4837
4842
|
placeholder: void 0,
|
|
4843
|
+
className,
|
|
4838
4844
|
children: optionList == null ? void 0 : optionList.map((option, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4839
4845
|
OptionListItem,
|
|
4840
4846
|
{
|
|
@@ -4847,6 +4853,7 @@ var YearSelect = ({ optionList, className, parentClassName, activeValue, maxHeig
|
|
|
4847
4853
|
optionListRef.current[index] = el;
|
|
4848
4854
|
index + 1 === optionList.length && setIsAllRefMounted(true);
|
|
4849
4855
|
},
|
|
4856
|
+
className,
|
|
4850
4857
|
children: option.label
|
|
4851
4858
|
},
|
|
4852
4859
|
option.value
|
|
@@ -4863,7 +4870,8 @@ var YearStepper = ({
|
|
|
4863
4870
|
increaseYear,
|
|
4864
4871
|
changeYear,
|
|
4865
4872
|
minDate,
|
|
4866
|
-
maxDate
|
|
4873
|
+
maxDate,
|
|
4874
|
+
className
|
|
4867
4875
|
}) => {
|
|
4868
4876
|
const [isOpen, setIsOpen] = utils.useOutsideClick({
|
|
4869
4877
|
selector: ".react-datepicker-year-stepper"
|
|
@@ -4874,7 +4882,7 @@ var YearStepper = ({
|
|
|
4874
4882
|
() => Array.from({ length: endYear - startYear + 1 }).fill(0).map((_, index) => ({ value: startYear + index, label: `${startYear + index}` })),
|
|
4875
4883
|
[startYear, endYear]
|
|
4876
4884
|
);
|
|
4877
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(Header, { className:
|
|
4885
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Header, { className: `calendarHeader ${className}`, children: [
|
|
4878
4886
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4879
4887
|
exports.IconButton,
|
|
4880
4888
|
{
|
|
@@ -4889,7 +4897,7 @@ var YearStepper = ({
|
|
|
4889
4897
|
/* @__PURE__ */ jsxRuntime.jsx(exports.Popper.Trigger, { isOpen, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4890
4898
|
Month,
|
|
4891
4899
|
{
|
|
4892
|
-
className:
|
|
4900
|
+
className: `react-datepicker-year-stepper ${className}`,
|
|
4893
4901
|
onClick: (event) => {
|
|
4894
4902
|
event.stopPropagation();
|
|
4895
4903
|
setIsOpen((prev) => !prev);
|
|
@@ -4900,13 +4908,13 @@ var YearStepper = ({
|
|
|
4900
4908
|
/* @__PURE__ */ jsxRuntime.jsx(exports.Popper.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4901
4909
|
YearSelect_default,
|
|
4902
4910
|
{
|
|
4903
|
-
className:
|
|
4911
|
+
className: `react-datepicker-year-stepper ${className}`,
|
|
4904
4912
|
optionList: OptionList2,
|
|
4905
4913
|
onClick: ({ value }) => {
|
|
4906
4914
|
changeYear(value);
|
|
4907
4915
|
setIsOpen(false);
|
|
4908
4916
|
},
|
|
4909
|
-
parentClassName:
|
|
4917
|
+
parentClassName: `react-datepicker-year-stepper ${className}`,
|
|
4910
4918
|
maxHeight: `200px`,
|
|
4911
4919
|
activeValue: date.getFullYear()
|
|
4912
4920
|
}
|
|
@@ -4937,27 +4945,28 @@ var MonthStepper = ({
|
|
|
4937
4945
|
locale: locale$1,
|
|
4938
4946
|
sizeVar,
|
|
4939
4947
|
prevMonthButtonDisabled,
|
|
4940
|
-
nextMonthButtonDisabled
|
|
4948
|
+
nextMonthButtonDisabled,
|
|
4949
|
+
className
|
|
4941
4950
|
}) => {
|
|
4942
4951
|
const [isOpen, setIsOpen] = utils.useOutsideClick({
|
|
4943
4952
|
selector: ".react-datepicker__header"
|
|
4944
4953
|
});
|
|
4945
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(Header, { className:
|
|
4954
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Header, { className: `calendarHeader ${className}`, children: [
|
|
4946
4955
|
/* @__PURE__ */ jsxRuntime.jsx(exports.IconButton, { styleVar: "GHOST", sizeVar: "S", onClick: decreaseMonth, disabled: prevMonthButtonDisabled, children: /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { iconSource: ShoplAssets.LeftArrowIcon, sizeVar: "XS", color: prevMonthButtonDisabled ? "neutral200" : "neutral700" }) }),
|
|
4947
4956
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4948
4957
|
Month,
|
|
4949
4958
|
{
|
|
4950
|
-
className:
|
|
4959
|
+
className: `react-datepicker__header ${className}`,
|
|
4951
4960
|
onClick: () => {
|
|
4952
4961
|
setIsOpen((prev) => !prev);
|
|
4953
4962
|
},
|
|
4954
4963
|
children: /* @__PURE__ */ jsxRuntime.jsx(exports.Text, { typography: sizeVar === "M" ? "title1_700" : "body1_700", children: `${date.getFullYear()}.${monthDate.getMonth() + 1}` })
|
|
4955
4964
|
}
|
|
4956
4965
|
),
|
|
4957
|
-
isOpen && /* @__PURE__ */ jsxRuntime.jsx(DatePickerWrapper, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
4966
|
+
isOpen && /* @__PURE__ */ jsxRuntime.jsx(DatePickerWrapper, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: `datepicker-header-wrapper ${className}`, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4958
4967
|
DatePicker2__default.default,
|
|
4959
4968
|
{
|
|
4960
|
-
className:
|
|
4969
|
+
className: `datepicker-custom-month ${className}`,
|
|
4961
4970
|
onChange: (date2) => {
|
|
4962
4971
|
if (!date2) {
|
|
4963
4972
|
return;
|
|
@@ -4974,7 +4983,7 @@ var MonthStepper = ({
|
|
|
4974
4983
|
maxDate,
|
|
4975
4984
|
locale: locale$1 != null ? locale$1 : locale.ko,
|
|
4976
4985
|
showMonthYearPicker: true,
|
|
4977
|
-
renderCustomHeader: (props) => /* @__PURE__ */ jsxRuntime.jsx(YearStepper_default, __spreadProps(__spreadValues({}, props), { minDate, maxDate })),
|
|
4986
|
+
renderCustomHeader: (props) => /* @__PURE__ */ jsxRuntime.jsx(YearStepper_default, __spreadProps(__spreadValues({}, props), { minDate, maxDate, className })),
|
|
4978
4987
|
showFourColumnMonthYearPicker: true
|
|
4979
4988
|
}
|
|
4980
4989
|
) }) }),
|
|
@@ -4990,7 +4999,8 @@ var DayDatepicker = (_a) => {
|
|
|
4990
4999
|
maxDate,
|
|
4991
5000
|
calendarType,
|
|
4992
5001
|
locale,
|
|
4993
|
-
fixedHeight = true
|
|
5002
|
+
fixedHeight = true,
|
|
5003
|
+
className
|
|
4994
5004
|
} = _b, rest = __objRest(_b, [
|
|
4995
5005
|
"sizeVar",
|
|
4996
5006
|
"children",
|
|
@@ -4998,18 +5008,30 @@ var DayDatepicker = (_a) => {
|
|
|
4998
5008
|
"maxDate",
|
|
4999
5009
|
"calendarType",
|
|
5000
5010
|
"locale",
|
|
5001
|
-
"fixedHeight"
|
|
5011
|
+
"fixedHeight",
|
|
5012
|
+
"className"
|
|
5002
5013
|
]);
|
|
5003
5014
|
const Wrapper2 = sizeVar === "S" ? SmallStyledDayDatepickerWrapper : StyledDayDatepicker;
|
|
5004
5015
|
if (calendarType.type === "range") {
|
|
5005
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Wrapper2, { "data-shoplflow": "DayDatepicker", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "dayDatepickerArea"
|
|
5016
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Wrapper2, { "data-shoplflow": "DayDatepicker", className, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${"dayDatepickerArea"}${className ? ` ${className}` : ""}`, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5006
5017
|
DatePicker2__default.default,
|
|
5007
5018
|
__spreadProps(__spreadValues({
|
|
5008
5019
|
inline: true,
|
|
5009
|
-
renderCustomHeader: (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5020
|
+
renderCustomHeader: (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5021
|
+
MonthStepper_default,
|
|
5022
|
+
__spreadProps(__spreadValues({
|
|
5023
|
+
sizeVar: sizeVar || "M"
|
|
5024
|
+
}, props), {
|
|
5025
|
+
minDate,
|
|
5026
|
+
maxDate,
|
|
5027
|
+
locale,
|
|
5028
|
+
className
|
|
5029
|
+
})
|
|
5030
|
+
),
|
|
5010
5031
|
renderDayContents: (dayOfMonth) => {
|
|
5011
5032
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "each-day", children: dayOfMonth });
|
|
5012
|
-
}
|
|
5033
|
+
},
|
|
5034
|
+
className
|
|
5013
5035
|
}, rest), {
|
|
5014
5036
|
minDate,
|
|
5015
5037
|
maxDate,
|
|
@@ -5023,11 +5045,21 @@ var DayDatepicker = (_a) => {
|
|
|
5023
5045
|
) }) });
|
|
5024
5046
|
}
|
|
5025
5047
|
if (calendarType.type === "multiple") {
|
|
5026
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Wrapper2, { "data-shoplflow": "DayDatepicker", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "dayDatepickerArea"
|
|
5048
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Wrapper2, { "data-shoplflow": "DayDatepicker", className, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${"dayDatepickerArea"}${className ? ` ${className}` : ""}`, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5027
5049
|
DatePicker2__default.default,
|
|
5028
5050
|
__spreadProps(__spreadValues({
|
|
5029
5051
|
inline: true,
|
|
5030
|
-
renderCustomHeader: (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5052
|
+
renderCustomHeader: (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5053
|
+
MonthStepper_default,
|
|
5054
|
+
__spreadProps(__spreadValues({
|
|
5055
|
+
sizeVar: sizeVar || "M"
|
|
5056
|
+
}, props), {
|
|
5057
|
+
minDate,
|
|
5058
|
+
maxDate,
|
|
5059
|
+
locale,
|
|
5060
|
+
className
|
|
5061
|
+
})
|
|
5062
|
+
),
|
|
5031
5063
|
renderDayContents: (dayOfMonth) => {
|
|
5032
5064
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "each-day", children: dayOfMonth });
|
|
5033
5065
|
}
|
|
@@ -5042,11 +5074,21 @@ var DayDatepicker = (_a) => {
|
|
|
5042
5074
|
})
|
|
5043
5075
|
) }) });
|
|
5044
5076
|
}
|
|
5045
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Wrapper2, { "data-shoplflow": "DayDatepicker", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "dayDatepickerArea"
|
|
5077
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Wrapper2, { "data-shoplflow": "DayDatepicker", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${"dayDatepickerArea"}${className ? ` ${className}` : ""}`, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5046
5078
|
DatePicker2__default.default,
|
|
5047
5079
|
__spreadProps(__spreadValues({
|
|
5048
5080
|
inline: true,
|
|
5049
|
-
renderCustomHeader: (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5081
|
+
renderCustomHeader: (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5082
|
+
MonthStepper_default,
|
|
5083
|
+
__spreadProps(__spreadValues({
|
|
5084
|
+
sizeVar: sizeVar || "M"
|
|
5085
|
+
}, props), {
|
|
5086
|
+
minDate,
|
|
5087
|
+
maxDate,
|
|
5088
|
+
locale,
|
|
5089
|
+
className
|
|
5090
|
+
})
|
|
5091
|
+
),
|
|
5050
5092
|
renderDayContents: (dayOfMonth) => {
|
|
5051
5093
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "each-day", children: dayOfMonth });
|
|
5052
5094
|
}
|
|
@@ -5736,57 +5778,6 @@ var WeekDatepicker = ({
|
|
|
5736
5778
|
] });
|
|
5737
5779
|
};
|
|
5738
5780
|
exports.WeekDatepicker = WeekDatepicker;
|
|
5739
|
-
var Title = ({
|
|
5740
|
-
title,
|
|
5741
|
-
titleTypography = "body1_700",
|
|
5742
|
-
titleColor = "neutral700",
|
|
5743
|
-
total,
|
|
5744
|
-
description,
|
|
5745
|
-
tooltipPlacement = "right",
|
|
5746
|
-
isRequired,
|
|
5747
|
-
isShowHelpIcon,
|
|
5748
|
-
tooltipOffsetValue,
|
|
5749
|
-
tooltipMessage = "",
|
|
5750
|
-
rightSource
|
|
5751
|
-
}) => {
|
|
5752
|
-
const domain = exports.getDomain();
|
|
5753
|
-
const descriptionTypography = domain === "hada" ? "body2_400" : "body1_400";
|
|
5754
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(exports.Stack.Vertical, { width: "100%", children: [
|
|
5755
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5756
|
-
exports.StackContainer,
|
|
5757
|
-
{
|
|
5758
|
-
direction: "row",
|
|
5759
|
-
align: "center",
|
|
5760
|
-
width: "100%",
|
|
5761
|
-
minHeight: "40px",
|
|
5762
|
-
height: "auto",
|
|
5763
|
-
justify: "space-between",
|
|
5764
|
-
children: [
|
|
5765
|
-
/* @__PURE__ */ jsxRuntime.jsxs(exports.Stack.Horizontal, { align: "center", spacing: "spacing04", children: [
|
|
5766
|
-
/* @__PURE__ */ jsxRuntime.jsxs(exports.Text, { color: titleColor, typography: titleTypography, wordBreak: "break-all", children: [
|
|
5767
|
-
title,
|
|
5768
|
-
" ",
|
|
5769
|
-
isRequired && /* @__PURE__ */ jsxRuntime.jsx(exports.Text, { typography: "body1_700", color: "red300", children: "*" })
|
|
5770
|
-
] }),
|
|
5771
|
-
/* @__PURE__ */ jsxRuntime.jsx(exports.Text, { color: "primary300", typography: "body1_700", children: total }),
|
|
5772
|
-
isShowHelpIcon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5773
|
-
exports.Tooltip,
|
|
5774
|
-
{
|
|
5775
|
-
placement: tooltipPlacement,
|
|
5776
|
-
offset: tooltipOffsetValue,
|
|
5777
|
-
trigger: /* @__PURE__ */ jsxRuntime.jsx(ShoplAssets.HelpIcon, { width: 20, height: 20 }),
|
|
5778
|
-
popper: /* @__PURE__ */ jsxRuntime.jsx(exports.Tooltip.Content, { content: tooltipMessage })
|
|
5779
|
-
}
|
|
5780
|
-
)
|
|
5781
|
-
] }),
|
|
5782
|
-
rightSource && rightSource
|
|
5783
|
-
]
|
|
5784
|
-
}
|
|
5785
|
-
),
|
|
5786
|
-
description && /* @__PURE__ */ jsxRuntime.jsx(exports.StackContainer, { minHeight: "30px", height: "auto", children: /* @__PURE__ */ jsxRuntime.jsx(exports.Text, { typography: descriptionTypography, color: "neutral500", wordBreak: "break-all", children: description }) })
|
|
5787
|
-
] });
|
|
5788
|
-
};
|
|
5789
|
-
exports.Title = Title;
|
|
5790
5781
|
var SpaceMarginWrapper = styled6__default.default(framerMotion.motion.div)`
|
|
5791
5782
|
position: relative;
|
|
5792
5783
|
display: flex;
|