An open source design system that's fully customizable and agent ready
TypeScript
fix(core): carousel bleed + tab indicator sync at 1px (#2470)
Cindy Zhang09000c66778f
diff --git a/packages/core/src/Carousel/XDSCarousel.tsx b/packages/core/src/Carousel/XDSCarousel.tsxindex 884cd88e97..163553a4cd 100644--- a/packages/core/src/Carousel/XDSCarousel.tsx+++ b/packages/core/src/Carousel/XDSCarousel.tsx@@ -7,7 +7,8 @@* @input Uses React, StyleX, useScrollOverflow, useXDSLayer, XDSButton, XDSIcon, theme tokens* @output Exports XDSCarousel component* @position Horizontal scroll container with fade-edge overflow indication,- * optional prev/next buttons on the top layer, and scroll-snap.+ * optional prev/next buttons on the top layer, scroll-snap, and a 1px+ * visual bleed allowance for child selection indicators.** SYNC: When modified, update:* - /packages/core/src/Carousel/index.ts (exports)@@ -88,13 +89,18 @@ const styles = stylex.create({alignItems: 'center',minWidth: 0,maxWidth: '100%',- overflowX: 'hidden',+ overflow: 'clip',+ overflowClipMargin: '1px',},scroller: {display: 'flex',alignItems: 'center',overflowX: 'auto',overflowY: 'hidden',+ /* eslint-disable @xds/no-hardcoded-styles -- 1px bleed for tab indicator; no token at this size */+ paddingBottom: '1px',+ marginBottom: '-1px',+ /* eslint-enable @xds/no-hardcoded-styles */overscrollBehaviorX: 'contain',scrollBehavior: {default: 'smooth',diff --git a/packages/core/src/TabList/XDSTab.tsx b/packages/core/src/TabList/XDSTab.tsxindex 1a8085adb5..e3fc80ff0e 100644--- a/packages/core/src/TabList/XDSTab.tsx+++ b/packages/core/src/TabList/XDSTab.tsx@@ -6,7 +6,8 @@* @file XDSTab.tsx* @input Uses React, StyleX, XDSTabListContext* @output Exports XDSTab component and XDSTabProps type- * @position Core tab item; renders as button or anchor in navigation+ * @position Core tab item; renders as button or anchor in navigation with a+ * divider-overlay selected indicator** SYNC: When modified, update:* - /packages/core/src/TabList/TabList.doc.mjs@@ -129,7 +130,7 @@ const styles = stylex.create({},indicator: {position: 'absolute',- bottom: 'var(--_tab-indicator-bottom, -1px)',+ bottom: '-1px',left: spacingVars['--spacing-3'],right: spacingVars['--spacing-3'],height: '2px',diff --git a/packages/core/src/TabList/XDSTabMenu.tsx b/packages/core/src/TabList/XDSTabMenu.tsxindex 73996cd126..f9b5dfa657 100644--- a/packages/core/src/TabList/XDSTabMenu.tsx+++ b/packages/core/src/TabList/XDSTabMenu.tsx@@ -6,7 +6,8 @@* @file XDSTabMenu.tsx* @input Uses React, StyleX, useXDSPopover, XDSTabListContext* @output Exports XDSTabMenu component, XDSTabMenuProps type, XDSTabMenuOption type- * @position Menu trigger button; opens dropdown of overflow menu items+ * @position Menu trigger button; opens dropdown of overflow menu items and+ * mirrors selected tab indicator positioning** SYNC: When modified, update:* - /packages/core/src/TabList/TabList.doc.mjs@@ -120,7 +121,7 @@ const styles = stylex.create({},indicator: {position: 'absolute',- bottom: '-2px',+ bottom: '-1px',left: spacingVars['--spacing-3'],right: spacingVars['--spacing-3'],height: '2px',