@astryxdesign/core 0.1.4-canary.360fc9c → 0.1.4-canary.37c19d3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astryxdesign/core",
3
- "version": "0.1.4-canary.360fc9c",
3
+ "version": "0.1.4-canary.37c19d3",
4
4
  "displayName": "XDS Core",
5
5
  "description": "The component library. Accessible, themeable React components with built-in spacing, dark mode, and StyleX styling.",
6
6
  "author": "Meta Open Source",
package/src/Card/Card.tsx CHANGED
@@ -44,10 +44,8 @@ import {themeProps} from '../utils/themeProps';
44
44
  * - Non-semantic palette: `blue | cyan | gray | green | orange | pink | purple | red | teal | yellow`
45
45
  * Each uses the corresponding `--color-background-<name>` token (20% opacity tint).
46
46
  *
47
- * Only `default` draws a visible border. Its border width is subtracted from
48
- * the padding so the total inset (border + padding) equals the padding token —
49
- * keeping content geometry faithful to the spacing scale and identical to the
50
- * borderless variants. Themes can override borderWidth/borderColor.
47
+ * All variants include a transparent border to prevent layout jitter
48
+ * when switching variants. Themes can override borderWidth/borderColor.
51
49
  */
52
50
  export type CardVariant =
53
51
  | 'default'
@@ -73,18 +71,12 @@ const styles = stylex.create({
73
71
  '--_card-radius': radiusVars['--radius-container'],
74
72
  borderRadius: 'var(--_card-radius)',
75
73
  overflow: 'clip',
76
- },
77
- // The border is drawn *inside* the padding — its width is subtracted from
78
- // each side — so total inset (border + padding) equals the padding token
79
- // rather than exceeding it by the border width.
80
- withBorder: {
81
74
  borderWidth: borderVars['--border-width'],
82
75
  borderStyle: 'solid',
76
+ borderColor: 'transparent',
77
+ },
78
+ withBorder: {
83
79
  borderColor: colorVars['--color-border-emphasized'],
84
- paddingInlineStart: `calc(var(--container-padding-inline-start) - ${borderVars['--border-width']})`,
85
- paddingInlineEnd: `calc(var(--container-padding-inline-end) - ${borderVars['--border-width']})`,
86
- paddingBlockStart: `calc(var(--container-padding-block-start) - ${borderVars['--border-width']})`,
87
- paddingBlockEnd: `calc(var(--container-padding-block-end) - ${borderVars['--border-width']})`,
88
80
  },
89
81
  // Fixed-height cards scroll content; overflow: auto also clips to border-radius
90
82
  scrollable: {
@@ -274,6 +266,7 @@ export function Card({
274
266
  stylex.props(
275
267
  styles.card,
276
268
  variantStyles[variant],
269
+ variant === 'default' && styles.withBorder,
277
270
  hasFixedHeight && styles.scrollable,
278
271
  dynamicStyles.sizing(
279
272
  width ?? null,
@@ -303,9 +296,6 @@ export function Card({
303
296
  !useThemeDefault &&
304
297
  effectivePadding !== 4 &&
305
298
  containerPaddingBlockEndVarStyles[effectivePadding],
306
- // Applied after the container padding so the border-inset calc wins;
307
- // it reads the --container-padding-* vars set above.
308
- variant === 'default' && styles.withBorder,
309
299
  xstyle,
310
300
  ),
311
301
  className,
@@ -201,11 +201,11 @@ export function InputGroup({
201
201
  labelTooltip={labelTooltip}>
202
202
  <div
203
203
  ref={ref}
204
- data-testid={testId}
205
- {...rest}
206
204
  role="group"
207
205
  aria-labelledby={labelID}
208
206
  aria-describedby={describedByIDs}
207
+ data-testid={testId}
208
+ {...rest}
209
209
  {...mergeProps(
210
210
  themeProps('input-group', {
211
211
  size,
package/src/Item/Item.tsx CHANGED
@@ -470,9 +470,9 @@ export function Item({
470
470
  return (
471
471
  <Component
472
472
  ref={ref as React.Ref<never>}
473
- {...restProps}
474
473
  aria-selected={isSelected || undefined}
475
474
  aria-disabled={isDisabled || undefined}
475
+ {...restProps}
476
476
  {...mergeProps(
477
477
  themeProps('item', {density, align}),
478
478
  stylex.props(
@@ -279,8 +279,7 @@ function areRowPropsEqual<T extends Record<string, unknown>>(
279
279
  return true;
280
280
  }
281
281
 
282
- // Different object reference - compare values. This is intentionally a
283
- // one-level shallow compare: nested fields rely on reference identity.
282
+ // Different object reference - compare values
284
283
  const prevItem = prevProps.item;
285
284
  const nextItem = nextProps.item;
286
285
  const keys = Object.keys(nextItem);