@flytedan/flytebot-design-system 0.67.1 → 0.67.2

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 CHANGED
@@ -2828,7 +2828,7 @@ function Tabs({ tabs = [], value, onChange, className = "", ...rest }) {
2828
2828
  observer.observe(el);
2829
2829
  return () => observer.disconnect();
2830
2830
  }, [measure, tabs]);
2831
- React16.useLayoutEffect(() => {
2831
+ const revealActive = React16.useCallback(() => {
2832
2832
  const el = strip.current;
2833
2833
  const active = el?.querySelector('[aria-selected="true"]');
2834
2834
  if (!el || !active || el.scrollWidth <= el.clientWidth) return;
@@ -2837,7 +2837,16 @@ function Tabs({ tabs = [], value, onChange, className = "", ...rest }) {
2837
2837
  if (tab.left < box.left + FADE_WIDTH) el.scrollLeft += tab.left - box.left - FADE_WIDTH;
2838
2838
  else if (tab.right > box.right - FADE_WIDTH) el.scrollLeft += tab.right - box.right + FADE_WIDTH;
2839
2839
  measure();
2840
- }, [value, measure]);
2840
+ }, [measure]);
2841
+ React16.useLayoutEffect(revealActive, [value, revealActive]);
2842
+ const tabKeys = tabs.map((t) => typeof t === "string" ? t : t.value).join(",");
2843
+ React16.useLayoutEffect(() => {
2844
+ const el = strip.current;
2845
+ if (!el || typeof ResizeObserver === "undefined") return;
2846
+ const observer = new ResizeObserver(revealActive);
2847
+ for (const tab of Array.from(el.children)) observer.observe(tab);
2848
+ return () => observer.disconnect();
2849
+ }, [tabKeys, revealActive]);
2841
2850
  return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
2842
2851
  "div",
2843
2852
  {