@linzjs/lui 17.8.1 → 17.9.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/lui.esm.js CHANGED
@@ -834,10 +834,17 @@ var LuiTabsGroup = function (props) {
834
834
  return (React__default.createElement("div", { className: "LuiTabsGroup " + (props.justify ? 'LuiTabsGroup--justified' : ''), role: "tablist", "aria-label": props.ariaLabel }, props.children));
835
835
  };
836
836
 
837
- var LuiTabsPanel = function (props) {
837
+ var LuiTabsPanel = function (_a) {
838
+ var children = _a.children, panel = _a.panel, _b = _a.mode, mode = _b === void 0 ? 'eager' : _b;
838
839
  var context = useContext(LuiTabsContext);
839
- var active = context.activePanel === props.panel;
840
- return (React__default.createElement("div", { className: clsx('LuiTabsPanel', active && 'LuiTabsPanel--active'), id: props.panel + "-tab-panel", role: "tabpanel", "aria-labelledby": props.panel + "-tab" }, props.children));
840
+ var _c = useState(mode === 'eager'), shouldShow = _c[0], setShouldShow = _c[1];
841
+ var active = context.activePanel === panel;
842
+ useEffect(function () {
843
+ if (active && !shouldShow) {
844
+ setShouldShow(true);
845
+ }
846
+ }, [active, shouldShow]);
847
+ return (React__default.createElement("div", { className: clsx('LuiTabsPanel', active && 'LuiTabsPanel--active'), id: panel + "-tab-panel", role: "tabpanel", "aria-labelledby": panel + "-tab" }, shouldShow ? children : null));
841
848
  };
842
849
 
843
850
  var LuiTabsPanelSwitch = function (props) {