kui-complex 0.0.82 → 0.0.83

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/index.d.ts CHANGED
@@ -93,23 +93,23 @@ declare const CalendarStandardHeader: React.ForwardRefExoticComponent<CalendarHe
93
93
 
94
94
  declare const DesktopInputWithMonthPicker: React.ForwardRefExoticComponent<Pick<any, string | number | symbol> & React.RefAttributes<HTMLDivElement>>;
95
95
 
96
- type TabPanelVariants = "grey" | "white"
97
-
98
- type MenuPanelProps = {
99
- tabs: { label: string }[]
100
- tabPanels: ReactNode[]
101
- paths: string[]
102
- activeTab: number | null
103
- variant?: TabPanelVariants
96
+ type TabPanelVariants = "grey" | "white"
97
+
98
+ type MenuPanelProps = {
99
+ tabs: string[]
100
+ tabPanels: ReactNode[]
101
+ paths: string[]
102
+ activeTab: number | null
103
+ variant?: TabPanelVariants
104
104
  }
105
105
 
106
- type DesktopMenuPanelProps = {
107
- tabs: { label: string }[]
108
- active: number | null
109
- handleClick: (index: number) => void
110
- variant: TabPanelVariants
111
- isScrolling: boolean
112
- setIsScrolling: (val: boolean) => void
106
+ type DesktopMenuPanelProps = {
107
+ tabs: string[]
108
+ active: number | null
109
+ handleClick: (index: number) => void
110
+ variant: TabPanelVariants
111
+ isScrolling: boolean
112
+ setIsScrolling: (val: boolean) => void
113
113
  }
114
114
 
115
115
  /** @jsxImportSource @emotion/react */
@@ -179,14 +179,14 @@ declare const InputWithDatePicker: React.ForwardRefExoticComponent<Pick<{
179
179
 
180
180
  declare const InputWithMonthPicker: <T extends FieldValues>(props: any) => JSX.Element;
181
181
 
182
- type TabItemProps = {
183
- tab: { label: string }
184
- active: number | null
185
- index: number
186
- handleClick: (index: number) => void
187
- offset: number
188
- isScrolling: boolean
189
- setIsScrolling: (val: boolean) => void
182
+ type TabItemProps = {
183
+ tab: string
184
+ active: number | null
185
+ index: number
186
+ handleClick: (index: number) => void
187
+ offset: number
188
+ isScrolling: boolean
189
+ setIsScrolling: (val: boolean) => void
190
190
  }
191
191
 
192
192
  /** @jsxImportSource @emotion/react */
@@ -199,13 +199,13 @@ declare const MenuPanel: React.ForwardRefExoticComponent<MenuPanelProps & React.
199
199
 
200
200
  declare const MobileInputWithMonthPicker: React.ForwardRefExoticComponent<Pick<any, string | number | symbol> & React.RefAttributes<HTMLDivElement>>;
201
201
 
202
- type MobileMenuPanelProps = {
203
- tabs: { label: string }[]
204
- active: number | null
205
- handleClick: (index: number) => void
206
- variant: TabPanelVariants
207
- isScrolling: boolean
208
- setIsScrolling: (val: boolean) => void
202
+ type MobileMenuPanelProps = {
203
+ tabs: string[]
204
+ active: number | null
205
+ handleClick: (index: number) => void
206
+ variant: TabPanelVariants
207
+ isScrolling: boolean
208
+ setIsScrolling: (val: boolean) => void
209
209
  }
210
210
 
211
211
  /** @jsxImportSource @emotion/react */
package/index.js CHANGED
@@ -484,7 +484,7 @@ var MenuItem = forwardRef(function (_a, ref) {
484
484
  };
485
485
  useEffect(function () {
486
486
  if (active === index) {
487
- scroller.scrollTo(tab.label, { offset: offset });
487
+ scroller.scrollTo(tab, { offset: offset });
488
488
  }
489
489
  Events.scrollEvent.register("begin", function (to, element) {
490
490
  startScrolling();
@@ -500,7 +500,7 @@ var MenuItem = forwardRef(function (_a, ref) {
500
500
  Events.scrollEvent.remove("end");
501
501
  };
502
502
  }, []);
503
- return (jsx$1(Link$1, __assign({ to: tab.label, spy: true, smooth: true, duration: 500, offset: offset, onSetActive: handleSelect }, { children: jsx$1(ButtonWrapper$2, __assign({ ref: ref }, { children: jsx$1(Button, __assign({ variant: Number(active) === index ? "orange" : "transparentWithBorder", size: "xs", css: Number(active) !== index && disabledStyles }, { children: tab.label })) })) })));
503
+ return (jsx$1(Link$1, __assign({ to: tab, spy: true, smooth: true, duration: 500, offset: offset, onSetActive: handleSelect }, { children: jsx$1(ButtonWrapper$2, __assign({ ref: ref }, { children: jsx$1(Button, __assign({ variant: Number(active) === index ? "orange" : "transparentWithBorder", size: "xs", css: Number(active) !== index && disabledStyles }, { children: tab })) })) })));
504
504
  });
505
505
  var ButtonWrapper$2 = styled.div(templateObject_1$s || (templateObject_1$s = __makeTemplateObject(["\n margin-right: 8px;\n width: max-content;\n max-width: 150px;\n @media (max-width: 900px) {\n max-width: unset;\n }\n"], ["\n margin-right: 8px;\n width: max-content;\n max-width: 150px;\n @media (max-width: 900px) {\n max-width: unset;\n }\n"])));
506
506
  var disabledStyles = css(templateObject_2$h || (templateObject_2$h = __makeTemplateObject(["\n p {\n color: ", ";\n font-weight: 400;\n },\n"], ["\n p {\n color: ", ";\n font-weight: 400;\n },\n"])), theme.palette.grey.seventy);
@@ -508,7 +508,7 @@ var templateObject_1$s, templateObject_2$h;
508
508
 
509
509
  var DesktopMenuPanel = forwardRef(function (_a, ref) {
510
510
  var tabs = _a.tabs, variant = _a.variant, other = __rest(_a, ["tabs", "variant"]);
511
- return (jsx$1(Wrapper$3, __assign({ container: true, css: variant === "white" && { background: "white" }, ref: ref }, { children: tabs.map(function (tab, index) { return (jsx$1(Grid, __assign({ item: true }, { children: jsx$1(MenuItem, __assign({ tab: tab, index: index, offset: -121 }, other), tab.label) }), index)); }) })));
511
+ return (jsx$1(Wrapper$3, __assign({ container: true, css: variant === "white" && { background: "white" }, ref: ref }, { children: tabs.map(function (tab, index) { return (jsx$1(Grid, __assign({ item: true }, { children: jsx$1(MenuItem, __assign({ tab: tab, index: index, offset: -121 }, other), tab) }), index)); }) })));
512
512
  });
513
513
  var Wrapper$3 = styled(Grid)(templateObject_1$r || (templateObject_1$r = __makeTemplateObject(["\n position: sticky;\n top: 49px;\n left: 0;\n z-index: 11;\n background-color: ", ";\n padding: 16px 16px 24px;\n @media (max-width: 900px) {\n justify-content: space-between;\n }\n @media (max-width: 765px) {\n display: none;\n }\n"], ["\n position: sticky;\n top: 49px;\n left: 0;\n z-index: 11;\n background-color: ", ";\n padding: 16px 16px 24px;\n @media (max-width: 900px) {\n justify-content: space-between;\n }\n @media (max-width: 765px) {\n display: none;\n }\n"])), theme.palette.background.light1);
514
514
  var templateObject_1$r;
@@ -863,7 +863,7 @@ var MobileMenuPanel = forwardRef(function (_a, ref) {
863
863
  }, 16);
864
864
  handleClick(index);
865
865
  };
866
- return (jsx$1(Wrapper, __assign({ css: variant === "white" && { background: "white" }, ref: ref }, { children: jsx$1(Swiper, __assign({ spaceBetween: 8, slidesPerView: "auto", slideToClickedSlide: true, ref: swiperRef }, { children: tabs.map(function (tab, index) { return (jsx$1(SlideWrapper, { children: jsx$1(MenuItem, __assign({ tab: tab, index: index, handleClick: slideTo, offset: -121 }, other), tab.label) }, index)); }) })) })));
866
+ return (jsx$1(Wrapper, __assign({ css: variant === "white" && { background: "white" }, ref: ref }, { children: jsx$1(Swiper, __assign({ spaceBetween: 8, slidesPerView: "auto", slideToClickedSlide: true, ref: swiperRef }, { children: tabs.map(function (tab, index) { return (jsx$1(SlideWrapper, { children: jsx$1(MenuItem, __assign({ tab: tab, index: index, handleClick: slideTo, offset: -121 }, other), tab) }, index)); }) })) })));
867
867
  });
868
868
  var Wrapper = styled.div(templateObject_1$k || (templateObject_1$k = __makeTemplateObject(["\n position: sticky;\n top: 49px;\n left: 0;\n z-index: 11;\n background: ", ";\n padding: 16px 0 24px;\n @media (min-width: 766px) {\n display: none;\n }\n"], ["\n position: sticky;\n top: 49px;\n left: 0;\n z-index: 11;\n background: ", ";\n padding: 16px 0 24px;\n @media (min-width: 766px) {\n display: none;\n }\n"])), theme.palette.background.light1);
869
869
  var SlideWrapper = styled.div(templateObject_2$b || (templateObject_2$b = __makeTemplateObject(["\n width: max-content !important;\n &:first-of-type {\n padding-left: 16px;\n }\n"], ["\n width: max-content !important;\n &:first-of-type {\n padding-left: 16px;\n }\n"])));
@@ -912,7 +912,7 @@ var MenuPanel = forwardRef(function (_a, ref) {
912
912
  if (width === 0) {
913
913
  return null;
914
914
  }
915
- return (jsxs("div", __assign({ ref: ref }, { children: [width > 765 ? (jsx$1(DesktopMenuPanel, { tabs: tabs, active: value, handleClick: handleClick, variant: variant, isScrolling: isScrolling, setIsScrolling: setIsScrolling })) : (jsx$1(MobileMenuPanel, { tabs: tabs, active: value, handleClick: handleClick, variant: variant, isScrolling: isScrolling, setIsScrolling: setIsScrolling })), tabPanels.map(function (item, index) { return (jsx$1("div", __assign({ css: index === tabPanels.length - 1 && fullHeightStyles }, { children: jsx$1(Element, __assign({ name: tabs[index].label, "data-index": index }, { children: item }), index) }), index)); })] })));
915
+ return (jsxs("div", __assign({ ref: ref }, { children: [width > 765 ? (jsx$1(DesktopMenuPanel, { tabs: tabs, active: value, handleClick: handleClick, variant: variant, isScrolling: isScrolling, setIsScrolling: setIsScrolling })) : (jsx$1(MobileMenuPanel, { tabs: tabs, active: value, handleClick: handleClick, variant: variant, isScrolling: isScrolling, setIsScrolling: setIsScrolling })), tabPanels.map(function (item, index) { return (jsx$1("div", __assign({ css: index === tabPanels.length - 1 && fullHeightStyles }, { children: jsx$1(Element, __assign({ name: tabs[index], "data-index": index }, { children: item }), index) }), index)); })] })));
916
916
  });
917
917
  MenuPanel.defaultProps = {
918
918
  variant: "grey",