@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.d.cts CHANGED
@@ -1291,7 +1291,7 @@ declare type DayCalendarType = {
1291
1291
  handleDayRangeChange: (dates: [Date | null, Date | null]) => void;
1292
1292
  };
1293
1293
  declare type DayDatepickerSizeVariantType = $Values<typeof DayDatepickerSizeVariants>;
1294
- declare type DayDatepickerProps = Pick<DatePickerProps, 'highlightDates' | 'startDate' | 'endDate' | 'locale' | 'selectedDates' | 'selected' | 'children' | 'excludeDates' | 'calendarStartDay' | 'fixedHeight'> & DayDatepickerOptionProps;
1294
+ declare type DayDatepickerProps = Pick<DatePickerProps, 'highlightDates' | 'startDate' | 'endDate' | 'locale' | 'selectedDates' | 'selected' | 'children' | 'excludeDates' | 'calendarStartDay' | 'fixedHeight' | 'className'> & DayDatepickerOptionProps;
1295
1295
  declare type DayDatepickerOptionProps = {
1296
1296
  /**
1297
1297
  * 캘린더 타입
@@ -1305,9 +1305,10 @@ declare type DayDatepickerHeaderCustomProps = ReactDatePickerCustomHeaderProps &
1305
1305
  minDate?: Date;
1306
1306
  maxDate?: Date;
1307
1307
  locale?: Locale;
1308
+ className?: string;
1308
1309
  };
1309
1310
 
1310
- declare const DayDatepicker: ({ sizeVar, children, minDate, maxDate, calendarType, locale, fixedHeight, ...rest }: DayDatepickerProps) => react_jsx_runtime.JSX.Element;
1311
+ declare const DayDatepicker: ({ sizeVar, children, minDate, maxDate, calendarType, locale, fixedHeight, className, ...rest }: DayDatepickerProps) => react_jsx_runtime.JSX.Element;
1311
1312
 
1312
1313
  declare type MonthClickDateInfo = {
1313
1314
  startDate?: Date;
package/dist/index.d.ts CHANGED
@@ -1291,7 +1291,7 @@ declare type DayCalendarType = {
1291
1291
  handleDayRangeChange: (dates: [Date | null, Date | null]) => void;
1292
1292
  };
1293
1293
  declare type DayDatepickerSizeVariantType = $Values<typeof DayDatepickerSizeVariants>;
1294
- declare type DayDatepickerProps = Pick<DatePickerProps, 'highlightDates' | 'startDate' | 'endDate' | 'locale' | 'selectedDates' | 'selected' | 'children' | 'excludeDates' | 'calendarStartDay' | 'fixedHeight'> & DayDatepickerOptionProps;
1294
+ declare type DayDatepickerProps = Pick<DatePickerProps, 'highlightDates' | 'startDate' | 'endDate' | 'locale' | 'selectedDates' | 'selected' | 'children' | 'excludeDates' | 'calendarStartDay' | 'fixedHeight' | 'className'> & DayDatepickerOptionProps;
1295
1295
  declare type DayDatepickerOptionProps = {
1296
1296
  /**
1297
1297
  * 캘린더 타입
@@ -1305,9 +1305,10 @@ declare type DayDatepickerHeaderCustomProps = ReactDatePickerCustomHeaderProps &
1305
1305
  minDate?: Date;
1306
1306
  maxDate?: Date;
1307
1307
  locale?: Locale;
1308
+ className?: string;
1308
1309
  };
1309
1310
 
1310
- declare const DayDatepicker: ({ sizeVar, children, minDate, maxDate, calendarType, locale, fixedHeight, ...rest }: DayDatepickerProps) => react_jsx_runtime.JSX.Element;
1311
+ declare const DayDatepicker: ({ sizeVar, children, minDate, maxDate, calendarType, locale, fixedHeight, className, ...rest }: DayDatepickerProps) => react_jsx_runtime.JSX.Element;
1311
1312
 
1312
1313
  declare type MonthClickDateInfo = {
1313
1314
  startDate?: Date;
package/dist/index.js CHANGED
@@ -1825,7 +1825,7 @@ var Callout = (_a) => {
1825
1825
  };
1826
1826
  var CalloutText = (_a) => {
1827
1827
  var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
1828
- return /* @__PURE__ */ jsx(Text_default, __spreadProps(__spreadValues({}, rest), { typography: "body3_400", children }));
1828
+ return /* @__PURE__ */ jsx(Text_default, __spreadProps(__spreadValues({}, rest), { typography: "paragraph2", children }));
1829
1829
  };
1830
1830
  var CalloutIcon = ({ iconSource }) => {
1831
1831
  return /* @__PURE__ */ jsx(StyledCalloutIcon, { as: iconSource });
@@ -4778,6 +4778,7 @@ var OptionListItem = styled6.li`
4778
4778
  }
4779
4779
  `;
4780
4780
  var YearSelect = ({ optionList, className, parentClassName, activeValue, maxHeight, onClick }) => {
4781
+ var _a;
4781
4782
  const optionListRef = useRef([]);
4782
4783
  const parentRef = useRef(null);
4783
4784
  const [isAllRefMounted, setIsAllRefMounted] = useState(false);
@@ -4787,20 +4788,20 @@ var YearSelect = ({ optionList, className, parentClassName, activeValue, maxHeig
4787
4788
  useEffect(() => {
4788
4789
  setIsOpened(isOpened);
4789
4790
  }, []);
4790
- const height = Math.min(optionList.length * 32, Number(parseInt(maxHeight || "0")));
4791
+ const height = Math.min(((_a = optionList == null ? void 0 : optionList.length) != null ? _a : 0) * 32, Number(parseInt(maxHeight || "0")));
4791
4792
  useEffect(() => {
4792
- var _a, _b, _c, _d, _e, _f;
4793
+ var _a2, _b, _c, _d, _e, _f;
4793
4794
  if (!isAllRefMounted || !activeValue || !maxHeight) {
4794
4795
  return;
4795
4796
  }
4796
4797
  const selectedOptionIndex = optionList.findIndex((option) => (option == null ? void 0 : option.value) === activeValue);
4797
- const heightPerOption = (_b = (_a = optionListRef.current[selectedOptionIndex]) == null ? void 0 : _a.offsetHeight) != null ? _b : 0;
4798
+ const heightPerOption = (_b = (_a2 = optionListRef.current[selectedOptionIndex]) == null ? void 0 : _a2.offsetHeight) != null ? _b : 0;
4798
4799
  const parentHeight = (_e = (_d = (_c = optionListRef.current[selectedOptionIndex]) == null ? void 0 : _c.closest("ul")) == null ? void 0 : _d.clientHeight) != null ? _e : 0;
4799
4800
  if (heightPerOption * (selectedOptionIndex + 1) >= parentHeight) {
4800
4801
  (_f = parentRef.current) == null ? void 0 : _f.scrollTo({ top: heightPerOption * selectedOptionIndex });
4801
4802
  }
4802
4803
  }, [isAllRefMounted, activeValue, maxHeight]);
4803
- return /* @__PURE__ */ jsx(Container5, { className: `${parentClassName} ${className}`, children: /* @__PURE__ */ jsx(OptionList, { ref: parentRef, maxHeight, style: { height }, children: /* @__PURE__ */ jsx(
4804
+ return /* @__PURE__ */ jsx(Container5, { className: `${parentClassName} ${className}`, children: /* @__PURE__ */ jsx(OptionList, { ref: parentRef, maxHeight, style: { height }, className, children: /* @__PURE__ */ jsx(
4804
4805
  SimpleBarReact,
4805
4806
  {
4806
4807
  style: {
@@ -4808,6 +4809,7 @@ var YearSelect = ({ optionList, className, parentClassName, activeValue, maxHeig
4808
4809
  height
4809
4810
  },
4810
4811
  placeholder: void 0,
4812
+ className,
4811
4813
  children: optionList == null ? void 0 : optionList.map((option, index) => /* @__PURE__ */ jsx(
4812
4814
  OptionListItem,
4813
4815
  {
@@ -4820,6 +4822,7 @@ var YearSelect = ({ optionList, className, parentClassName, activeValue, maxHeig
4820
4822
  optionListRef.current[index] = el;
4821
4823
  index + 1 === optionList.length && setIsAllRefMounted(true);
4822
4824
  },
4825
+ className,
4823
4826
  children: option.label
4824
4827
  },
4825
4828
  option.value
@@ -4836,7 +4839,8 @@ var YearStepper = ({
4836
4839
  increaseYear,
4837
4840
  changeYear,
4838
4841
  minDate,
4839
- maxDate
4842
+ maxDate,
4843
+ className
4840
4844
  }) => {
4841
4845
  const [isOpen, setIsOpen] = useOutsideClick({
4842
4846
  selector: ".react-datepicker-year-stepper"
@@ -4847,7 +4851,7 @@ var YearStepper = ({
4847
4851
  () => Array.from({ length: endYear - startYear + 1 }).fill(0).map((_, index) => ({ value: startYear + index, label: `${startYear + index}` })),
4848
4852
  [startYear, endYear]
4849
4853
  );
4850
- return /* @__PURE__ */ jsxs(Header, { className: "calendarHeader", children: [
4854
+ return /* @__PURE__ */ jsxs(Header, { className: `calendarHeader ${className}`, children: [
4851
4855
  /* @__PURE__ */ jsx(
4852
4856
  IconButton_default,
4853
4857
  {
@@ -4862,7 +4866,7 @@ var YearStepper = ({
4862
4866
  /* @__PURE__ */ jsx(Popper_default.Trigger, { isOpen, children: /* @__PURE__ */ jsx(
4863
4867
  Month,
4864
4868
  {
4865
- className: "react-datepicker-year-stepper",
4869
+ className: `react-datepicker-year-stepper ${className}`,
4866
4870
  onClick: (event) => {
4867
4871
  event.stopPropagation();
4868
4872
  setIsOpen((prev) => !prev);
@@ -4873,13 +4877,13 @@ var YearStepper = ({
4873
4877
  /* @__PURE__ */ jsx(Popper_default.Portal, { children: /* @__PURE__ */ jsx(
4874
4878
  YearSelect_default,
4875
4879
  {
4876
- className: "react-datepicker-year-stepper",
4880
+ className: `react-datepicker-year-stepper ${className}`,
4877
4881
  optionList: OptionList2,
4878
4882
  onClick: ({ value }) => {
4879
4883
  changeYear(value);
4880
4884
  setIsOpen(false);
4881
4885
  },
4882
- parentClassName: "react-datepicker-year-stepper",
4886
+ parentClassName: `react-datepicker-year-stepper ${className}`,
4883
4887
  maxHeight: `200px`,
4884
4888
  activeValue: date.getFullYear()
4885
4889
  }
@@ -4910,27 +4914,28 @@ var MonthStepper = ({
4910
4914
  locale,
4911
4915
  sizeVar,
4912
4916
  prevMonthButtonDisabled,
4913
- nextMonthButtonDisabled
4917
+ nextMonthButtonDisabled,
4918
+ className
4914
4919
  }) => {
4915
4920
  const [isOpen, setIsOpen] = useOutsideClick({
4916
4921
  selector: ".react-datepicker__header"
4917
4922
  });
4918
- return /* @__PURE__ */ jsxs(Header, { className: "calendarHeader", children: [
4923
+ return /* @__PURE__ */ jsxs(Header, { className: `calendarHeader ${className}`, children: [
4919
4924
  /* @__PURE__ */ jsx(IconButton_default, { styleVar: "GHOST", sizeVar: "S", onClick: decreaseMonth, disabled: prevMonthButtonDisabled, children: /* @__PURE__ */ jsx(Icon_default, { iconSource: LeftArrowIcon, sizeVar: "XS", color: prevMonthButtonDisabled ? "neutral200" : "neutral700" }) }),
4920
4925
  /* @__PURE__ */ jsx(
4921
4926
  Month,
4922
4927
  {
4923
- className: "react-datepicker__header",
4928
+ className: `react-datepicker__header ${className}`,
4924
4929
  onClick: () => {
4925
4930
  setIsOpen((prev) => !prev);
4926
4931
  },
4927
4932
  children: /* @__PURE__ */ jsx(Text_default, { typography: sizeVar === "M" ? "title1_700" : "body1_700", children: `${date.getFullYear()}.${monthDate.getMonth() + 1}` })
4928
4933
  }
4929
4934
  ),
4930
- isOpen && /* @__PURE__ */ jsx(DatePickerWrapper, { children: /* @__PURE__ */ jsx("div", { className: "datepicker-header-wrapper", children: /* @__PURE__ */ jsx(
4935
+ isOpen && /* @__PURE__ */ jsx(DatePickerWrapper, { children: /* @__PURE__ */ jsx("div", { className: `datepicker-header-wrapper ${className}`, children: /* @__PURE__ */ jsx(
4931
4936
  DatePicker2,
4932
4937
  {
4933
- className: "datepicker-custom-month",
4938
+ className: `datepicker-custom-month ${className}`,
4934
4939
  onChange: (date2) => {
4935
4940
  if (!date2) {
4936
4941
  return;
@@ -4947,7 +4952,7 @@ var MonthStepper = ({
4947
4952
  maxDate,
4948
4953
  locale: locale != null ? locale : ko,
4949
4954
  showMonthYearPicker: true,
4950
- renderCustomHeader: (props) => /* @__PURE__ */ jsx(YearStepper_default, __spreadProps(__spreadValues({}, props), { minDate, maxDate })),
4955
+ renderCustomHeader: (props) => /* @__PURE__ */ jsx(YearStepper_default, __spreadProps(__spreadValues({}, props), { minDate, maxDate, className })),
4951
4956
  showFourColumnMonthYearPicker: true
4952
4957
  }
4953
4958
  ) }) }),
@@ -4963,7 +4968,8 @@ var DayDatepicker = (_a) => {
4963
4968
  maxDate,
4964
4969
  calendarType,
4965
4970
  locale,
4966
- fixedHeight = true
4971
+ fixedHeight = true,
4972
+ className
4967
4973
  } = _b, rest = __objRest(_b, [
4968
4974
  "sizeVar",
4969
4975
  "children",
@@ -4971,18 +4977,30 @@ var DayDatepicker = (_a) => {
4971
4977
  "maxDate",
4972
4978
  "calendarType",
4973
4979
  "locale",
4974
- "fixedHeight"
4980
+ "fixedHeight",
4981
+ "className"
4975
4982
  ]);
4976
4983
  const Wrapper2 = sizeVar === "S" ? SmallStyledDayDatepickerWrapper : StyledDayDatepicker;
4977
4984
  if (calendarType.type === "range") {
4978
- return /* @__PURE__ */ jsx(Wrapper2, { "data-shoplflow": "DayDatepicker", children: /* @__PURE__ */ jsx("div", { className: "dayDatepickerArea", children: /* @__PURE__ */ jsx(
4985
+ return /* @__PURE__ */ jsx(Wrapper2, { "data-shoplflow": "DayDatepicker", className, children: /* @__PURE__ */ jsx("div", { className: `${"dayDatepickerArea"}${className ? ` ${className}` : ""}`, children: /* @__PURE__ */ jsx(
4979
4986
  DatePicker2,
4980
4987
  __spreadProps(__spreadValues({
4981
4988
  inline: true,
4982
- renderCustomHeader: (props) => /* @__PURE__ */ jsx(MonthStepper_default, __spreadProps(__spreadValues({ sizeVar: sizeVar || "M" }, props), { minDate, maxDate, locale })),
4989
+ renderCustomHeader: (props) => /* @__PURE__ */ jsx(
4990
+ MonthStepper_default,
4991
+ __spreadProps(__spreadValues({
4992
+ sizeVar: sizeVar || "M"
4993
+ }, props), {
4994
+ minDate,
4995
+ maxDate,
4996
+ locale,
4997
+ className
4998
+ })
4999
+ ),
4983
5000
  renderDayContents: (dayOfMonth) => {
4984
5001
  return /* @__PURE__ */ jsx("div", { className: "each-day", children: dayOfMonth });
4985
- }
5002
+ },
5003
+ className
4986
5004
  }, rest), {
4987
5005
  minDate,
4988
5006
  maxDate,
@@ -4996,11 +5014,21 @@ var DayDatepicker = (_a) => {
4996
5014
  ) }) });
4997
5015
  }
4998
5016
  if (calendarType.type === "multiple") {
4999
- return /* @__PURE__ */ jsx(Wrapper2, { "data-shoplflow": "DayDatepicker", children: /* @__PURE__ */ jsx("div", { className: "dayDatepickerArea", children: /* @__PURE__ */ jsx(
5017
+ return /* @__PURE__ */ jsx(Wrapper2, { "data-shoplflow": "DayDatepicker", className, children: /* @__PURE__ */ jsx("div", { className: `${"dayDatepickerArea"}${className ? ` ${className}` : ""}`, children: /* @__PURE__ */ jsx(
5000
5018
  DatePicker2,
5001
5019
  __spreadProps(__spreadValues({
5002
5020
  inline: true,
5003
- renderCustomHeader: (props) => /* @__PURE__ */ jsx(MonthStepper_default, __spreadProps(__spreadValues({ sizeVar: sizeVar || "M" }, props), { minDate, maxDate, locale })),
5021
+ renderCustomHeader: (props) => /* @__PURE__ */ jsx(
5022
+ MonthStepper_default,
5023
+ __spreadProps(__spreadValues({
5024
+ sizeVar: sizeVar || "M"
5025
+ }, props), {
5026
+ minDate,
5027
+ maxDate,
5028
+ locale,
5029
+ className
5030
+ })
5031
+ ),
5004
5032
  renderDayContents: (dayOfMonth) => {
5005
5033
  return /* @__PURE__ */ jsx("div", { className: "each-day", children: dayOfMonth });
5006
5034
  }
@@ -5015,11 +5043,21 @@ var DayDatepicker = (_a) => {
5015
5043
  })
5016
5044
  ) }) });
5017
5045
  }
5018
- return /* @__PURE__ */ jsx(Wrapper2, { "data-shoplflow": "DayDatepicker", children: /* @__PURE__ */ jsx("div", { className: "dayDatepickerArea", children: /* @__PURE__ */ jsx(
5046
+ return /* @__PURE__ */ jsx(Wrapper2, { "data-shoplflow": "DayDatepicker", children: /* @__PURE__ */ jsx("div", { className: `${"dayDatepickerArea"}${className ? ` ${className}` : ""}`, children: /* @__PURE__ */ jsx(
5019
5047
  DatePicker2,
5020
5048
  __spreadProps(__spreadValues({
5021
5049
  inline: true,
5022
- renderCustomHeader: (props) => /* @__PURE__ */ jsx(MonthStepper_default, __spreadProps(__spreadValues({ sizeVar: sizeVar || "M" }, props), { minDate, maxDate, locale })),
5050
+ renderCustomHeader: (props) => /* @__PURE__ */ jsx(
5051
+ MonthStepper_default,
5052
+ __spreadProps(__spreadValues({
5053
+ sizeVar: sizeVar || "M"
5054
+ }, props), {
5055
+ minDate,
5056
+ maxDate,
5057
+ locale,
5058
+ className
5059
+ })
5060
+ ),
5023
5061
  renderDayContents: (dayOfMonth) => {
5024
5062
  return /* @__PURE__ */ jsx("div", { className: "each-day", children: dayOfMonth });
5025
5063
  }