@shoplflow/base 0.32.8 → 0.32.10

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 CHANGED
@@ -1852,7 +1852,7 @@ var Callout = (_a) => {
1852
1852
  };
1853
1853
  var CalloutText = (_a) => {
1854
1854
  var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
1855
- return /* @__PURE__ */ jsxRuntime.jsx(exports.Text, __spreadProps(__spreadValues({}, rest), { typography: "body3_400", children }));
1855
+ return /* @__PURE__ */ jsxRuntime.jsx(exports.Text, __spreadProps(__spreadValues({}, rest), { typography: "paragraph2", children }));
1856
1856
  };
1857
1857
  var CalloutIcon = ({ iconSource }) => {
1858
1858
  return /* @__PURE__ */ jsxRuntime.jsx(StyledCalloutIcon, { as: iconSource });
@@ -4805,6 +4805,7 @@ var OptionListItem = styled6__default.default.li`
4805
4805
  }
4806
4806
  `;
4807
4807
  var YearSelect = ({ optionList, className, parentClassName, activeValue, maxHeight, onClick }) => {
4808
+ var _a;
4808
4809
  const optionListRef = React3.useRef([]);
4809
4810
  const parentRef = React3.useRef(null);
4810
4811
  const [isAllRefMounted, setIsAllRefMounted] = React3.useState(false);
@@ -4814,20 +4815,20 @@ var YearSelect = ({ optionList, className, parentClassName, activeValue, maxHeig
4814
4815
  React3.useEffect(() => {
4815
4816
  setIsOpened(isOpened);
4816
4817
  }, []);
4817
- const height = Math.min(optionList.length * 32, Number(parseInt(maxHeight || "0")));
4818
+ const height = Math.min(((_a = optionList == null ? void 0 : optionList.length) != null ? _a : 0) * 32, Number(parseInt(maxHeight || "0")));
4818
4819
  React3.useEffect(() => {
4819
- var _a, _b, _c, _d, _e, _f;
4820
+ var _a2, _b, _c, _d, _e, _f;
4820
4821
  if (!isAllRefMounted || !activeValue || !maxHeight) {
4821
4822
  return;
4822
4823
  }
4823
4824
  const selectedOptionIndex = optionList.findIndex((option) => (option == null ? void 0 : option.value) === activeValue);
4824
- const heightPerOption = (_b = (_a = optionListRef.current[selectedOptionIndex]) == null ? void 0 : _a.offsetHeight) != null ? _b : 0;
4825
+ const heightPerOption = (_b = (_a2 = optionListRef.current[selectedOptionIndex]) == null ? void 0 : _a2.offsetHeight) != null ? _b : 0;
4825
4826
  const parentHeight = (_e = (_d = (_c = optionListRef.current[selectedOptionIndex]) == null ? void 0 : _c.closest("ul")) == null ? void 0 : _d.clientHeight) != null ? _e : 0;
4826
4827
  if (heightPerOption * (selectedOptionIndex + 1) >= parentHeight) {
4827
4828
  (_f = parentRef.current) == null ? void 0 : _f.scrollTo({ top: heightPerOption * selectedOptionIndex });
4828
4829
  }
4829
4830
  }, [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(
4831
+ return /* @__PURE__ */ jsxRuntime.jsx(Container5, { className: `${parentClassName} ${className}`, children: /* @__PURE__ */ jsxRuntime.jsx(OptionList, { ref: parentRef, maxHeight, style: { height }, className, children: /* @__PURE__ */ jsxRuntime.jsx(
4831
4832
  SimpleBarReact__default.default,
4832
4833
  {
4833
4834
  style: {
@@ -4835,6 +4836,7 @@ var YearSelect = ({ optionList, className, parentClassName, activeValue, maxHeig
4835
4836
  height
4836
4837
  },
4837
4838
  placeholder: void 0,
4839
+ className,
4838
4840
  children: optionList == null ? void 0 : optionList.map((option, index) => /* @__PURE__ */ jsxRuntime.jsx(
4839
4841
  OptionListItem,
4840
4842
  {
@@ -4847,6 +4849,7 @@ var YearSelect = ({ optionList, className, parentClassName, activeValue, maxHeig
4847
4849
  optionListRef.current[index] = el;
4848
4850
  index + 1 === optionList.length && setIsAllRefMounted(true);
4849
4851
  },
4852
+ className,
4850
4853
  children: option.label
4851
4854
  },
4852
4855
  option.value
@@ -4863,7 +4866,8 @@ var YearStepper = ({
4863
4866
  increaseYear,
4864
4867
  changeYear,
4865
4868
  minDate,
4866
- maxDate
4869
+ maxDate,
4870
+ className
4867
4871
  }) => {
4868
4872
  const [isOpen, setIsOpen] = utils.useOutsideClick({
4869
4873
  selector: ".react-datepicker-year-stepper"
@@ -4874,7 +4878,7 @@ var YearStepper = ({
4874
4878
  () => Array.from({ length: endYear - startYear + 1 }).fill(0).map((_, index) => ({ value: startYear + index, label: `${startYear + index}` })),
4875
4879
  [startYear, endYear]
4876
4880
  );
4877
- return /* @__PURE__ */ jsxRuntime.jsxs(Header, { className: "calendarHeader", children: [
4881
+ return /* @__PURE__ */ jsxRuntime.jsxs(Header, { className: `calendarHeader ${className}`, children: [
4878
4882
  /* @__PURE__ */ jsxRuntime.jsx(
4879
4883
  exports.IconButton,
4880
4884
  {
@@ -4889,7 +4893,7 @@ var YearStepper = ({
4889
4893
  /* @__PURE__ */ jsxRuntime.jsx(exports.Popper.Trigger, { isOpen, children: /* @__PURE__ */ jsxRuntime.jsx(
4890
4894
  Month,
4891
4895
  {
4892
- className: "react-datepicker-year-stepper",
4896
+ className: `react-datepicker-year-stepper ${className}`,
4893
4897
  onClick: (event) => {
4894
4898
  event.stopPropagation();
4895
4899
  setIsOpen((prev) => !prev);
@@ -4900,13 +4904,13 @@ var YearStepper = ({
4900
4904
  /* @__PURE__ */ jsxRuntime.jsx(exports.Popper.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
4901
4905
  YearSelect_default,
4902
4906
  {
4903
- className: "react-datepicker-year-stepper",
4907
+ className: `react-datepicker-year-stepper ${className}`,
4904
4908
  optionList: OptionList2,
4905
4909
  onClick: ({ value }) => {
4906
4910
  changeYear(value);
4907
4911
  setIsOpen(false);
4908
4912
  },
4909
- parentClassName: "react-datepicker-year-stepper",
4913
+ parentClassName: `react-datepicker-year-stepper ${className}`,
4910
4914
  maxHeight: `200px`,
4911
4915
  activeValue: date.getFullYear()
4912
4916
  }
@@ -4937,27 +4941,28 @@ var MonthStepper = ({
4937
4941
  locale: locale$1,
4938
4942
  sizeVar,
4939
4943
  prevMonthButtonDisabled,
4940
- nextMonthButtonDisabled
4944
+ nextMonthButtonDisabled,
4945
+ className
4941
4946
  }) => {
4942
4947
  const [isOpen, setIsOpen] = utils.useOutsideClick({
4943
4948
  selector: ".react-datepicker__header"
4944
4949
  });
4945
- return /* @__PURE__ */ jsxRuntime.jsxs(Header, { className: "calendarHeader", children: [
4950
+ return /* @__PURE__ */ jsxRuntime.jsxs(Header, { className: `calendarHeader ${className}`, children: [
4946
4951
  /* @__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
4952
  /* @__PURE__ */ jsxRuntime.jsx(
4948
4953
  Month,
4949
4954
  {
4950
- className: "react-datepicker__header",
4955
+ className: `react-datepicker__header ${className}`,
4951
4956
  onClick: () => {
4952
4957
  setIsOpen((prev) => !prev);
4953
4958
  },
4954
4959
  children: /* @__PURE__ */ jsxRuntime.jsx(exports.Text, { typography: sizeVar === "M" ? "title1_700" : "body1_700", children: `${date.getFullYear()}.${monthDate.getMonth() + 1}` })
4955
4960
  }
4956
4961
  ),
4957
- isOpen && /* @__PURE__ */ jsxRuntime.jsx(DatePickerWrapper, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "datepicker-header-wrapper", children: /* @__PURE__ */ jsxRuntime.jsx(
4962
+ isOpen && /* @__PURE__ */ jsxRuntime.jsx(DatePickerWrapper, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: `datepicker-header-wrapper ${className}`, children: /* @__PURE__ */ jsxRuntime.jsx(
4958
4963
  DatePicker2__default.default,
4959
4964
  {
4960
- className: "datepicker-custom-month",
4965
+ className: `datepicker-custom-month ${className}`,
4961
4966
  onChange: (date2) => {
4962
4967
  if (!date2) {
4963
4968
  return;
@@ -4974,7 +4979,7 @@ var MonthStepper = ({
4974
4979
  maxDate,
4975
4980
  locale: locale$1 != null ? locale$1 : locale.ko,
4976
4981
  showMonthYearPicker: true,
4977
- renderCustomHeader: (props) => /* @__PURE__ */ jsxRuntime.jsx(YearStepper_default, __spreadProps(__spreadValues({}, props), { minDate, maxDate })),
4982
+ renderCustomHeader: (props) => /* @__PURE__ */ jsxRuntime.jsx(YearStepper_default, __spreadProps(__spreadValues({}, props), { minDate, maxDate, className })),
4978
4983
  showFourColumnMonthYearPicker: true
4979
4984
  }
4980
4985
  ) }) }),
@@ -4990,7 +4995,8 @@ var DayDatepicker = (_a) => {
4990
4995
  maxDate,
4991
4996
  calendarType,
4992
4997
  locale,
4993
- fixedHeight = true
4998
+ fixedHeight = true,
4999
+ className
4994
5000
  } = _b, rest = __objRest(_b, [
4995
5001
  "sizeVar",
4996
5002
  "children",
@@ -4998,18 +5004,30 @@ var DayDatepicker = (_a) => {
4998
5004
  "maxDate",
4999
5005
  "calendarType",
5000
5006
  "locale",
5001
- "fixedHeight"
5007
+ "fixedHeight",
5008
+ "className"
5002
5009
  ]);
5003
5010
  const Wrapper2 = sizeVar === "S" ? SmallStyledDayDatepickerWrapper : StyledDayDatepicker;
5004
5011
  if (calendarType.type === "range") {
5005
- return /* @__PURE__ */ jsxRuntime.jsx(Wrapper2, { "data-shoplflow": "DayDatepicker", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "dayDatepickerArea", children: /* @__PURE__ */ jsxRuntime.jsx(
5012
+ return /* @__PURE__ */ jsxRuntime.jsx(Wrapper2, { "data-shoplflow": "DayDatepicker", className, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${"dayDatepickerArea"}${className ? ` ${className}` : ""}`, children: /* @__PURE__ */ jsxRuntime.jsx(
5006
5013
  DatePicker2__default.default,
5007
5014
  __spreadProps(__spreadValues({
5008
5015
  inline: true,
5009
- renderCustomHeader: (props) => /* @__PURE__ */ jsxRuntime.jsx(MonthStepper_default, __spreadProps(__spreadValues({ sizeVar: sizeVar || "M" }, props), { minDate, maxDate, locale })),
5016
+ renderCustomHeader: (props) => /* @__PURE__ */ jsxRuntime.jsx(
5017
+ MonthStepper_default,
5018
+ __spreadProps(__spreadValues({
5019
+ sizeVar: sizeVar || "M"
5020
+ }, props), {
5021
+ minDate,
5022
+ maxDate,
5023
+ locale,
5024
+ className
5025
+ })
5026
+ ),
5010
5027
  renderDayContents: (dayOfMonth) => {
5011
5028
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "each-day", children: dayOfMonth });
5012
- }
5029
+ },
5030
+ className
5013
5031
  }, rest), {
5014
5032
  minDate,
5015
5033
  maxDate,
@@ -5023,11 +5041,21 @@ var DayDatepicker = (_a) => {
5023
5041
  ) }) });
5024
5042
  }
5025
5043
  if (calendarType.type === "multiple") {
5026
- return /* @__PURE__ */ jsxRuntime.jsx(Wrapper2, { "data-shoplflow": "DayDatepicker", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "dayDatepickerArea", children: /* @__PURE__ */ jsxRuntime.jsx(
5044
+ return /* @__PURE__ */ jsxRuntime.jsx(Wrapper2, { "data-shoplflow": "DayDatepicker", className, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${"dayDatepickerArea"}${className ? ` ${className}` : ""}`, children: /* @__PURE__ */ jsxRuntime.jsx(
5027
5045
  DatePicker2__default.default,
5028
5046
  __spreadProps(__spreadValues({
5029
5047
  inline: true,
5030
- renderCustomHeader: (props) => /* @__PURE__ */ jsxRuntime.jsx(MonthStepper_default, __spreadProps(__spreadValues({ sizeVar: sizeVar || "M" }, props), { minDate, maxDate, locale })),
5048
+ renderCustomHeader: (props) => /* @__PURE__ */ jsxRuntime.jsx(
5049
+ MonthStepper_default,
5050
+ __spreadProps(__spreadValues({
5051
+ sizeVar: sizeVar || "M"
5052
+ }, props), {
5053
+ minDate,
5054
+ maxDate,
5055
+ locale,
5056
+ className
5057
+ })
5058
+ ),
5031
5059
  renderDayContents: (dayOfMonth) => {
5032
5060
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "each-day", children: dayOfMonth });
5033
5061
  }
@@ -5042,11 +5070,21 @@ var DayDatepicker = (_a) => {
5042
5070
  })
5043
5071
  ) }) });
5044
5072
  }
5045
- return /* @__PURE__ */ jsxRuntime.jsx(Wrapper2, { "data-shoplflow": "DayDatepicker", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "dayDatepickerArea", children: /* @__PURE__ */ jsxRuntime.jsx(
5073
+ return /* @__PURE__ */ jsxRuntime.jsx(Wrapper2, { "data-shoplflow": "DayDatepicker", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${"dayDatepickerArea"}${className ? ` ${className}` : ""}`, children: /* @__PURE__ */ jsxRuntime.jsx(
5046
5074
  DatePicker2__default.default,
5047
5075
  __spreadProps(__spreadValues({
5048
5076
  inline: true,
5049
- renderCustomHeader: (props) => /* @__PURE__ */ jsxRuntime.jsx(MonthStepper_default, __spreadProps(__spreadValues({ sizeVar: sizeVar || "M" }, props), { minDate, maxDate, locale })),
5077
+ renderCustomHeader: (props) => /* @__PURE__ */ jsxRuntime.jsx(
5078
+ MonthStepper_default,
5079
+ __spreadProps(__spreadValues({
5080
+ sizeVar: sizeVar || "M"
5081
+ }, props), {
5082
+ minDate,
5083
+ maxDate,
5084
+ locale,
5085
+ className
5086
+ })
5087
+ ),
5050
5088
  renderDayContents: (dayOfMonth) => {
5051
5089
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "each-day", children: dayOfMonth });
5052
5090
  }