kui-complex 0.0.80 → 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/cjs/index.js CHANGED
@@ -516,7 +516,7 @@ var MenuItem = React.forwardRef(function (_a, ref) {
516
516
  };
517
517
  React.useEffect(function () {
518
518
  if (active === index) {
519
- reactScroll.scroller.scrollTo(tab.label, { offset: offset });
519
+ reactScroll.scroller.scrollTo(tab, { offset: offset });
520
520
  }
521
521
  reactScroll.Events.scrollEvent.register("begin", function (to, element) {
522
522
  startScrolling();
@@ -532,7 +532,7 @@ var MenuItem = React.forwardRef(function (_a, ref) {
532
532
  reactScroll.Events.scrollEvent.remove("end");
533
533
  };
534
534
  }, []);
535
- return (jsxRuntime$1.jsx(reactScroll.Link, __assign({ to: tab.label, spy: true, smooth: true, duration: 500, offset: offset, onSetActive: handleSelect }, { children: jsxRuntime$1.jsx(ButtonWrapper$2, __assign({ ref: ref }, { children: jsxRuntime$1.jsx(kuiBasic.Button, __assign({ variant: Number(active) === index ? "orange" : "transparentWithBorder", size: "xs", css: Number(active) !== index && disabledStyles }, { children: tab.label })) })) })));
535
+ return (jsxRuntime$1.jsx(reactScroll.Link, __assign({ to: tab, spy: true, smooth: true, duration: 500, offset: offset, onSetActive: handleSelect }, { children: jsxRuntime$1.jsx(ButtonWrapper$2, __assign({ ref: ref }, { children: jsxRuntime$1.jsx(kuiBasic.Button, __assign({ variant: Number(active) === index ? "orange" : "transparentWithBorder", size: "xs", css: Number(active) !== index && disabledStyles }, { children: tab })) })) })));
536
536
  });
537
537
  var ButtonWrapper$2 = styled__default["default"].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"])));
538
538
  var disabledStyles = react.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"])), kuiBasic.theme.palette.grey.seventy);
@@ -540,7 +540,7 @@ var templateObject_1$s, templateObject_2$h;
540
540
 
541
541
  var DesktopMenuPanel = React.forwardRef(function (_a, ref) {
542
542
  var tabs = _a.tabs, variant = _a.variant, other = __rest(_a, ["tabs", "variant"]);
543
- return (jsxRuntime$1.jsx(Wrapper$3, __assign({ container: true, css: variant === "white" && { background: "white" }, ref: ref }, { children: tabs.map(function (tab, index) { return (jsxRuntime$1.jsx(kuiBasic.Grid, __assign({ item: true }, { children: jsxRuntime$1.jsx(MenuItem, __assign({ tab: tab, index: index, offset: -121 }, other), tab.label) }), index)); }) })));
543
+ return (jsxRuntime$1.jsx(Wrapper$3, __assign({ container: true, css: variant === "white" && { background: "white" }, ref: ref }, { children: tabs.map(function (tab, index) { return (jsxRuntime$1.jsx(kuiBasic.Grid, __assign({ item: true }, { children: jsxRuntime$1.jsx(MenuItem, __assign({ tab: tab, index: index, offset: -121 }, other), tab) }), index)); }) })));
544
544
  });
545
545
  var Wrapper$3 = styled__default["default"](kuiBasic.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"])), kuiBasic.theme.palette.background.light1);
546
546
  var templateObject_1$r;
@@ -895,7 +895,7 @@ var MobileMenuPanel = React.forwardRef(function (_a, ref) {
895
895
  }, 16);
896
896
  handleClick(index);
897
897
  };
898
- return (jsxRuntime$1.jsx(Wrapper, __assign({ css: variant === "white" && { background: "white" }, ref: ref }, { children: jsxRuntime$1.jsx(Swiper__default["default"], __assign({ spaceBetween: 8, slidesPerView: "auto", slideToClickedSlide: true, ref: swiperRef }, { children: tabs.map(function (tab, index) { return (jsxRuntime$1.jsx(SlideWrapper, { children: jsxRuntime$1.jsx(MenuItem, __assign({ tab: tab, index: index, handleClick: slideTo, offset: -121 }, other), tab.label) }, index)); }) })) })));
898
+ return (jsxRuntime$1.jsx(Wrapper, __assign({ css: variant === "white" && { background: "white" }, ref: ref }, { children: jsxRuntime$1.jsx(Swiper__default["default"], __assign({ spaceBetween: 8, slidesPerView: "auto", slideToClickedSlide: true, ref: swiperRef }, { children: tabs.map(function (tab, index) { return (jsxRuntime$1.jsx(SlideWrapper, { children: jsxRuntime$1.jsx(MenuItem, __assign({ tab: tab, index: index, handleClick: slideTo, offset: -121 }, other), tab) }, index)); }) })) })));
899
899
  });
900
900
  var Wrapper = styled__default["default"].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"])), kuiBasic.theme.palette.background.light1);
901
901
  var SlideWrapper = styled__default["default"].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"])));
@@ -944,7 +944,7 @@ var MenuPanel = React.forwardRef(function (_a, ref) {
944
944
  if (width === 0) {
945
945
  return null;
946
946
  }
947
- return (jsxRuntime$1.jsxs("div", __assign({ ref: ref }, { children: [width > 765 ? (jsxRuntime$1.jsx(DesktopMenuPanel, { tabs: tabs, active: value, handleClick: handleClick, variant: variant, isScrolling: isScrolling, setIsScrolling: setIsScrolling })) : (jsxRuntime$1.jsx(MobileMenuPanel, { tabs: tabs, active: value, handleClick: handleClick, variant: variant, isScrolling: isScrolling, setIsScrolling: setIsScrolling })), tabPanels.map(function (item, index) { return (jsxRuntime$1.jsx("div", __assign({ css: index === tabPanels.length - 1 && fullHeightStyles }, { children: jsxRuntime$1.jsx(reactScroll.Element, __assign({ name: tabs[index].label, "data-index": index }, { children: item }), index) }), index)); })] })));
947
+ return (jsxRuntime$1.jsxs("div", __assign({ ref: ref }, { children: [width > 765 ? (jsxRuntime$1.jsx(DesktopMenuPanel, { tabs: tabs, active: value, handleClick: handleClick, variant: variant, isScrolling: isScrolling, setIsScrolling: setIsScrolling })) : (jsxRuntime$1.jsx(MobileMenuPanel, { tabs: tabs, active: value, handleClick: handleClick, variant: variant, isScrolling: isScrolling, setIsScrolling: setIsScrolling })), tabPanels.map(function (item, index) { return (jsxRuntime$1.jsx("div", __assign({ css: index === tabPanels.length - 1 && fullHeightStyles }, { children: jsxRuntime$1.jsx(reactScroll.Element, __assign({ name: tabs[index], "data-index": index }, { children: item }), index) }), index)); })] })));
948
948
  });
949
949
  MenuPanel.defaultProps = {
950
950
  variant: "grey",
@@ -956,7 +956,7 @@ var Switch = React.forwardRef(function (_a, ref) {
956
956
  var form = _a.form, name = _a.name, props = __rest(_a, ["form", "name"]);
957
957
  return (jsxRuntime$1.jsx(reactHookForm.Controller, { control: form === null || form === void 0 ? void 0 : form.control, name: name, render: function (_a) {
958
958
  var field = _a.field;
959
- return (jsxRuntime$1.jsx(kuiBasic.Switch, __assign({ checked: Boolean(field.value), onChange: field.onChange, "data-testid": name, ref: ref }, props)));
959
+ return (jsxRuntime$1.jsx(kuiBasic.Switch, __assign({ checked: Boolean(field.value), onChange: field.onChange, "data-testid": name, ref: ref, name: name }, props)));
960
960
  } }));
961
961
  });
962
962