@flytedan/flytebot-design-system 0.67.0 → 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 +11 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/styles/components.css +11 -2
package/dist/index.js
CHANGED
|
@@ -1682,7 +1682,7 @@ function Tabs({ tabs = [], value, onChange, className = "", ...rest }) {
|
|
|
1682
1682
|
observer.observe(el);
|
|
1683
1683
|
return () => observer.disconnect();
|
|
1684
1684
|
}, [measure, tabs]);
|
|
1685
|
-
React16.
|
|
1685
|
+
const revealActive = React16.useCallback(() => {
|
|
1686
1686
|
const el = strip.current;
|
|
1687
1687
|
const active = el?.querySelector('[aria-selected="true"]');
|
|
1688
1688
|
if (!el || !active || el.scrollWidth <= el.clientWidth) return;
|
|
@@ -1691,7 +1691,16 @@ function Tabs({ tabs = [], value, onChange, className = "", ...rest }) {
|
|
|
1691
1691
|
if (tab.left < box.left + FADE_WIDTH) el.scrollLeft += tab.left - box.left - FADE_WIDTH;
|
|
1692
1692
|
else if (tab.right > box.right - FADE_WIDTH) el.scrollLeft += tab.right - box.right + FADE_WIDTH;
|
|
1693
1693
|
measure();
|
|
1694
|
-
}, [
|
|
1694
|
+
}, [measure]);
|
|
1695
|
+
React16.useLayoutEffect(revealActive, [value, revealActive]);
|
|
1696
|
+
const tabKeys = tabs.map((t) => typeof t === "string" ? t : t.value).join(",");
|
|
1697
|
+
React16.useLayoutEffect(() => {
|
|
1698
|
+
const el = strip.current;
|
|
1699
|
+
if (!el || typeof ResizeObserver === "undefined") return;
|
|
1700
|
+
const observer = new ResizeObserver(revealActive);
|
|
1701
|
+
for (const tab of Array.from(el.children)) observer.observe(tab);
|
|
1702
|
+
return () => observer.disconnect();
|
|
1703
|
+
}, [tabKeys, revealActive]);
|
|
1695
1704
|
return /* @__PURE__ */ jsx23(
|
|
1696
1705
|
"div",
|
|
1697
1706
|
{
|