kui-complex 0.0.122 → 0.0.123

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
@@ -30,6 +30,7 @@ type ButtonsPanelProps = {
30
30
  onChange?: (value: number) => void
31
31
  startComponent?: ReactNode
32
32
  endComponent?: ReactNode
33
+ navigate?: (path: string) => void
33
34
  }
34
35
 
35
36
  /** @jsxImportSource @emotion/react */
package/index.js CHANGED
@@ -160,12 +160,17 @@ var inactiveStyles = css(templateObject_2$p || (templateObject_2$p = __makeTempl
160
160
  var templateObject_1$F, templateObject_2$p;
161
161
 
162
162
  var ButtonsPanel = forwardRef(function (_a, ref) {
163
- var tabs = _a.tabs, tabPanels = _a.tabPanels, paths = _a.paths, activeTab = _a.activeTab, isSticky = _a.isSticky, onChange = _a.onChange, startComponent = _a.startComponent, endComponent = _a.endComponent, otherProps = __rest(_a, ["tabs", "tabPanels", "paths", "activeTab", "isSticky", "onChange", "startComponent", "endComponent"]);
163
+ var tabs = _a.tabs, tabPanels = _a.tabPanels, paths = _a.paths, activeTab = _a.activeTab, isSticky = _a.isSticky, onChange = _a.onChange, startComponent = _a.startComponent, endComponent = _a.endComponent, navigate = _a.navigate, otherProps = __rest(_a, ["tabs", "tabPanels", "paths", "activeTab", "isSticky", "onChange", "startComponent", "endComponent", "navigate"]);
164
164
  var _b = React.useState(Number(activeTab)), value = _b[0], setValue = _b[1];
165
165
  var handleChange = function (newValue) {
166
166
  setValue(newValue);
167
- if (paths && paths.length)
168
- updateQueryParams(paths[newValue]);
167
+ if (paths === null || paths === void 0 ? void 0 : paths.length) {
168
+ var path = paths[newValue];
169
+ if (navigate)
170
+ navigate(path);
171
+ else
172
+ updateQueryParams(path);
173
+ }
169
174
  if (onChange)
170
175
  onChange(newValue);
171
176
  };