@moda/om 18.5.0 → 19.0.0

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.js CHANGED
@@ -11471,21 +11471,25 @@ var Tag = function Tag(_ref) {
11471
11471
  }, /*#__PURE__*/React.createElement(Exit16, null)));
11472
11472
  };
11473
11473
 
11474
- var _excluded$4 = ["tabs", "onTabClicked", "activeTab", "className"];
11474
+ var _excluded$4 = ["tabs", "onTabClicked", "defaultActiveTab", "activeTab", "className"];
11475
11475
  var Tabs = function Tabs(_ref) {
11476
11476
  var tabs = _ref.tabs,
11477
11477
  onTabClicked = _ref.onTabClicked,
11478
+ defaultActiveTab = _ref.defaultActiveTab,
11478
11479
  activeTab = _ref.activeTab,
11479
11480
  className = _ref.className,
11480
11481
  rest = _objectWithoutProperties(_ref, _excluded$4);
11481
- var _useState = React.useState(activeTab || tabs[0].name),
11482
+ var _useState = React.useState(activeTab || defaultActiveTab || tabs[0].name),
11482
11483
  _useState2 = _slicedToArray(_useState, 2),
11483
11484
  activePanel = _useState2[0],
11484
11485
  setActivePanel = _useState2[1];
11485
11486
  var handleTabClick = function handleTabClick(tabName) {
11486
- setActivePanel(tabName);
11487
+ if (!activeTab) setActivePanel(tabName);
11487
11488
  if (onTabClicked) onTabClicked(tabName);
11488
11489
  };
11490
+ React.useEffect(function () {
11491
+ if (activeTab) setActivePanel(activeTab);
11492
+ }, [activeTab]);
11489
11493
  return /*#__PURE__*/React.createElement("div", _extends$1({
11490
11494
  className: classNames('Tabs', className)
11491
11495
  }, rest), /*#__PURE__*/React.createElement(TabList, {