@shoplflow/base 0.31.11 → 0.31.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 CHANGED
@@ -4720,31 +4720,6 @@ var DatePickerWrapper = styled6__default.default.div`
4720
4720
  }
4721
4721
  }
4722
4722
  `;
4723
- styled6__default.default.div`
4724
- display: flex;
4725
- justify-content: center;
4726
- align-items: center;
4727
- position: relative;
4728
- width: 100%;
4729
- height: 32px;
4730
- gap: 8px;
4731
- `;
4732
- styled6__default.default.p`
4733
- font-size: 18px;
4734
- color: ${exports.colorTokens.neutral700};
4735
- cursor: pointer;
4736
- `;
4737
- styled6__default.default.div`
4738
- position: absolute;
4739
- z-index: 10;
4740
- top: 3rem;
4741
-
4742
- border: 1px solid #eaeaea;
4743
- box-shadow: 0px 10px 30px 0px rgba(51, 51, 51, 0.2);
4744
- .react-datepicker {
4745
- border: 1px solid #eaeaea;
4746
- }
4747
- `;
4748
4723
  var Container5 = styled6__default.default.div`
4749
4724
  border-radius: 4px;
4750
4725
  background-color: ${exports.colorTokens.neutral0};
@@ -4754,6 +4729,7 @@ var Container5 = styled6__default.default.div`
4754
4729
  position: relative;
4755
4730
  top: 0px;
4756
4731
  left: 0px;
4732
+ width: 60px;
4757
4733
 
4758
4734
  & .simplebar-placeholder {
4759
4735
  height: 0px !important;
@@ -4784,8 +4760,14 @@ var OptionListItem = styled6__default.default.li`
4784
4760
  font-size: 14px;
4785
4761
  font-weight: 500;
4786
4762
  line-height: 18px;
4787
- text-align: left;
4788
- white-space: break-spaces;
4763
+ text-align: center;
4764
+ display: -webkit-box;
4765
+ line-clamp: 2;
4766
+ -webkit-line-clamp: 2;
4767
+ -webkit-box-orient: vertical;
4768
+ overflow: hidden;
4769
+ word-break: break-all;
4770
+ text-overflow: ellipsis;
4789
4771
  cursor: pointer;
4790
4772
  border-radius: 4px;
4791
4773
  background-color: ${({ isActive }) => isActive && exports.colorTokens.primary300};
@@ -4796,6 +4778,7 @@ var OptionListItem = styled6__default.default.li`
4796
4778
  }
4797
4779
  `;
4798
4780
  var YearSelect = ({ optionList, className, parentClassName, activeValue, maxHeight, onClick }) => {
4781
+ var _a, _b;
4799
4782
  const optionListRef = React3.useRef([]);
4800
4783
  const parentRef = React3.useRef(null);
4801
4784
  const [isAllRefMounted, setIsAllRefMounted] = React3.useState(false);
@@ -4805,23 +4788,25 @@ var YearSelect = ({ optionList, className, parentClassName, activeValue, maxHeig
4805
4788
  React3.useEffect(() => {
4806
4789
  setIsOpened(isOpened);
4807
4790
  }, []);
4791
+ const height = Math.min((_b = (_a = parentRef.current) == null ? void 0 : _a.scrollHeight) != null ? _b : 0, Number(maxHeight));
4808
4792
  React3.useEffect(() => {
4809
- var _a, _b, _c, _d, _e, _f;
4793
+ var _a2, _b2, _c, _d, _e, _f;
4810
4794
  if (!isAllRefMounted || !activeValue || !maxHeight) {
4811
4795
  return;
4812
4796
  }
4813
4797
  const selectedOptionIndex = optionList.findIndex((option) => (option == null ? void 0 : option.value) === activeValue);
4814
- const heightPerOption = (_b = (_a = optionListRef.current[selectedOptionIndex]) == null ? void 0 : _a.offsetHeight) != null ? _b : 0;
4798
+ const heightPerOption = (_b2 = (_a2 = optionListRef.current[selectedOptionIndex]) == null ? void 0 : _a2.offsetHeight) != null ? _b2 : 0;
4815
4799
  const parentHeight = (_e = (_d = (_c = optionListRef.current[selectedOptionIndex]) == null ? void 0 : _c.closest("ul")) == null ? void 0 : _d.clientHeight) != null ? _e : 0;
4816
4800
  if (heightPerOption * (selectedOptionIndex + 1) >= parentHeight) {
4817
4801
  (_f = parentRef.current) == null ? void 0 : _f.scrollTo({ top: heightPerOption * selectedOptionIndex });
4818
4802
  }
4819
4803
  }, [isAllRefMounted, activeValue, maxHeight]);
4820
- return /* @__PURE__ */ jsxRuntime.jsx(Container5, { className: `${parentClassName} ${className}`, children: /* @__PURE__ */ jsxRuntime.jsx(OptionList, { ref: parentRef, maxHeight, children: /* @__PURE__ */ jsxRuntime.jsx(
4804
+ return /* @__PURE__ */ jsxRuntime.jsx(Container5, { className: `${parentClassName} ${className}`, children: /* @__PURE__ */ jsxRuntime.jsx(OptionList, { ref: parentRef, maxHeight, style: { height }, children: /* @__PURE__ */ jsxRuntime.jsx(
4821
4805
  SimpleBarReact__default.default,
4822
4806
  {
4823
4807
  style: {
4824
- maxHeight
4808
+ maxHeight,
4809
+ height
4825
4810
  },
4826
4811
  placeholder: void 0,
4827
4812
  children: optionList == null ? void 0 : optionList.map((option, index) => /* @__PURE__ */ jsxRuntime.jsx(