An open source design system that's fully customizable and agent ready
TypeScript
fix(core): add missing xdsClassName hooks and use border tokens (#2244)
Cindy Zhang6376c80bb6f1
diff --git a/packages/core/src/AvatarGroup/XDSAvatarGroupOverflow.tsx b/packages/core/src/AvatarGroup/XDSAvatarGroupOverflow.tsxindex ab71370906..d03b1340c1 100644--- a/packages/core/src/AvatarGroup/XDSAvatarGroupOverflow.tsx+++ b/packages/core/src/AvatarGroup/XDSAvatarGroupOverflow.tsx@@ -21,6 +21,7 @@ import {fontWeightVars,radiusVars,} from '../theme/tokens.stylex';+import {xdsClassName, mergeProps} from '../utils';import {useXDSAvatarGroup} from './XDSAvatarGroupContext';const BORDER_WIDTH = 2;@@ -115,13 +116,16 @@ export function XDSAvatarGroupOverflow({type="button"onClick={onClick}aria-label={label}- {...stylex.props(- styles.base,- styles.button,- styles.overlap,- dynamicStyles.size(numericSize),- dynamicStyles.fontSize(numericSize),- dynamicStyles.overlap(-overlap),+ {...mergeProps(+ xdsClassName('avatar-group-overflow'),+ stylex.props(+ styles.base,+ styles.button,+ styles.overlap,+ dynamicStyles.size(numericSize),+ dynamicStyles.fontSize(numericSize),+ dynamicStyles.overlap(-overlap),+ ),)}>{content}</button>@@ -131,12 +135,15 @@ export function XDSAvatarGroupOverflow({return (<spanaria-label={label}- {...stylex.props(- styles.base,- styles.overlap,- dynamicStyles.size(numericSize),- dynamicStyles.fontSize(numericSize),- dynamicStyles.overlap(-overlap),+ {...mergeProps(+ xdsClassName('avatar-group-overflow'),+ stylex.props(+ styles.base,+ styles.overlap,+ dynamicStyles.size(numericSize),+ dynamicStyles.fontSize(numericSize),+ dynamicStyles.overlap(-overlap),+ ),)}>{content}</span>diff --git a/packages/core/src/Banner/XDSBanner.tsx b/packages/core/src/Banner/XDSBanner.tsxindex 56d9b09aa5..ab51065214 100644--- a/packages/core/src/Banner/XDSBanner.tsx+++ b/packages/core/src/Banner/XDSBanner.tsx@@ -34,6 +34,7 @@ import {radiusVars,fontWeightVars,typeScaleVars,+ borderVars,} from '../theme/tokens.stylex';import {xdsClassName, mergeProps} from '../utils';import {edgeCompSlot} from '../Layout/edgeCompensation.stylex';@@ -260,9 +261,9 @@ const styles = stylex.create({backgroundColor: colorVars['--color-background-card'],paddingBlock: spacingVars['--spacing-3'],paddingInline: spacingVars['--spacing-4'],- borderLeftWidth: 1,- borderRightWidth: 1,- borderBottomWidth: 1,+ borderLeftWidth: borderVars['--border-width'],+ borderRightWidth: borderVars['--border-width'],+ borderBottomWidth: borderVars['--border-width'],borderLeftStyle: 'solid',borderRightStyle: 'solid',borderBottomStyle: 'solid',diff --git a/packages/core/src/ButtonGroup/XDSButtonGroup.tsx b/packages/core/src/ButtonGroup/XDSButtonGroup.tsxindex bec618dbb7..a3a7de7f6d 100644--- a/packages/core/src/ButtonGroup/XDSButtonGroup.tsx+++ b/packages/core/src/ButtonGroup/XDSButtonGroup.tsx@@ -151,7 +151,7 @@ export function XDSButtonGroup({aria-disabled={isDisabled || undefined}data-testid={testId}{...mergeProps(- xdsClassName('button-group', {size}),+ xdsClassName('button-group', {size, orientation}),stylex.props(styles.group,orientation === 'vertical' && styles.vertical,diff --git a/packages/core/src/InputGroup/XDSInputGroupText.tsx b/packages/core/src/InputGroup/XDSInputGroupText.tsxindex 375e8fcf92..9728fbdc37 100644--- a/packages/core/src/InputGroup/XDSInputGroupText.tsx+++ b/packages/core/src/InputGroup/XDSInputGroupText.tsx@@ -25,7 +25,7 @@ import {typeScaleVars,borderVars,} from '../theme/tokens.stylex';-import {mergeProps} from '../utils';+import {xdsClassName, mergeProps} from '../utils';const styles = stylex.create({text: {@@ -106,7 +106,13 @@ export function XDSInputGroupText({style,}: XDSInputGroupTextProps) {return (- <div {...mergeProps(stylex.props(styles.text, xstyle), className, style)}>+ <div+ {...mergeProps(+ xdsClassName('input-group-text'),+ stylex.props(styles.text, xstyle),+ className,+ style,+ )}>{children}</div>);