An open source design system that's fully customizable and agent ready
TypeScript
fix(Button): at the default text size a labelled button renders exactly as before (#10678)
Cindy Zhang544442239d0a
diff --git a/.changeset/butter-button-keeps-height.md b/.changeset/butter-button-keeps-height.mdindex 4127169af2..1fed33d4e3 100644--- a/.changeset/butter-button-keeps-height.md+++ b/.changeset/butter-button-keeps-height.md@@ -2,6 +2,6 @@'@astryxdesign/theme-butter': patch----[fix] Butter's labelled buttons keep their element heights now that a `Button`'s size is a minimum height: the theme no longer adds block padding to buttons.+[fix] Butter's buttons take inline padding only and use `Button`'s own block padding. Their height is unchanged.@cixzhangdiff --git a/.changeset/button-grows-with-text.md b/.changeset/button-grows-with-text.mdindex ce6e56f61e..4eba203da1 100644--- a/.changeset/button-grows-with-text.md+++ b/.changeset/button-grows-with-text.md@@ -2,6 +2,6 @@'@astryxdesign/core': patch----[fix] A labelled `Button`'s size is now a minimum height: a label larger than the element size grows the button, so the label stays inside it. At the default text size Buttons keep their size, and icon-only buttons keep their fixed square. A caller `height` override no longer brings a labelled Button below its size; override `minHeight` instead. A theme or caller block padding on a labelled Button now counts toward its height, so it can make the button taller than its size.+[fix] A labelled `Button` grows with its label when the text size grows: its height is its size, or one line of its label when that is taller, so the label stays inside the button. At the default text size Buttons render exactly as before, a caller's `height` still applies, and icon-only buttons keep their fixed square.@cixzhangdiff --git a/.changeset/table-filter-header-actions-keep-size.md b/.changeset/table-filter-header-actions-keep-size.mdindex d11e38e72d..677c5ba02d 100644--- a/.changeset/table-filter-header-actions-keep-size.md+++ b/.changeset/table-filter-header-actions-keep-size.md@@ -2,6 +2,6 @@'@astryxdesign/cli': patch----[fix] The `table-filter` template's link-style header actions keep their compact height now that a labelled `Button`'s size is a minimum height.+[fix] The `table-filter` template's link-style header actions set `minHeight: 0` with their auto height, so no minimum holds them taller than their text.@cixzhangdiff --git a/docs/specs/components/Button/Button.spec.md b/docs/specs/components/Button/Button.spec.mdindex b8a92da60b..886edf00b3 100644--- a/docs/specs/components/Button/Button.spec.md+++ b/docs/specs/components/Button/Button.spec.md@@ -126,7 +126,7 @@ Consumer migration instructions belong in consumer docs and release notes.| FR1 | Without link mode Button renders one native `<button>` with `type="button"` unless `type` says otherwise; `name`, `value`, and `form` reach that element. | `family:buttons` FR2; current source and tests || FR2 | Content renders in this order: the leading `icon` slot, the label text (`children` when supplied, else `label`), then `endContent`. Icon-only renders the icon alone and omits the label text and `endContent`. `endContent` inherits the Button's text color. | `family:buttons` AV2; current source and tests || FR3 | An Astryx Icon in the `icon` slot without an explicit size renders `sm` in `sm` and `md` Buttons and `md` in `lg` Buttons; an explicit Icon size wins. | `family:buttons` FR7; current source |-| FR4 | Height comes from the shared element size for the resolved size, as a minimum that grows with a set text size under `spec:AST-102` FR4, so a label stays inside its own button: an explicit `size` wins, then the nearest size provider, then `md`. A labelled button has no block padding, so its label's line box decides any height above the minimum. Icon-only is square (`--button-icon-only-aspect`, default `1 / 1`) with no padding and keeps the element size, since its glyph does not grow with the text. | `family:buttons` FR7; `architecture:component-size-cascade` INV3–INV5 |+| FR4 | Height comes from the shared element size for the resolved size: an explicit `size` wins, then the nearest size provider, then `md`. A labelled button's height is that element size, or one line of its label when the line is taller, so under a set text size (`spec:AST-102` FR4) the label stays inside its own button; at the default text size the height is the element size, and a caller's height replaces it. Icon-only is square (`--button-icon-only-aspect`, default `1 / 1`) with no padding and keeps the element size, since its glyph does not grow with the text. | `family:buttons` FR7; `architecture:component-size-cascade` INV3–INV5 || FR5 | The label stays on one line. A labelled Button may shrink in a row, never exceeds its container's inline size, and truncates the label with an ellipsis. An explicit `width` applies in button and link modes and is still capped at the container. Icon-only does not shrink and is not capped. | Current source and tests || FR6 | On activation `onClick` runs first. If it calls `preventDefault()`, `clickAction` does not run. Otherwise `clickAction` runs, and the Button is pending until its promise settles. | `family:buttons` FR5; current source and tests || FR7 | A fire-once `clickAction` runs once per in-flight action: a second activation while it is pending, including a same-tick double-click, does nothing. With `isInterruptible`, a pending Button stays operable and each activation starts a new `clickAction`. | `family:buttons` FR5; current source and tests |@@ -209,12 +209,14 @@ Consumer migration instructions belong in consumer docs and release notes.disabled Buttons MUST expose `aria-disabled="true"` on the focusable element(`spec:AST-085` FR5). Implementation gap: a disabled Button without a tooltipexposes native `disabled` instead (FR10).-- **AR6 — Target size.** Every Button is at least 28 CSS pixels tall. With the+- **AR6 — Target size.** Every Button is at least 28 CSS pixels tall, unless a+ caller's height replaces its size (FR4). With thedefault square aspect and no `width`, an icon-only Button is at least 28 by28; a labelled Button can shrink in a crowded row only down to its 24 CSSpixels of inline padding. Both meet the WCAG 2.5.8 24 by 24 minimum. A caller`width` or a theme icon-only aspect that makes a Button narrower than 24 CSS- pixels leaves its target size to that caller or theme.+ pixels, or a caller height under 24 CSS pixels, leaves its target size to that+ caller or theme.Implementation gap: Button's hover and pressed overlays on the dark accent giveits label 4.35:1 and 4.02:1, under 4.5:1.@@ -257,36 +259,36 @@ anatomy-theming map.## Verification map-| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |-| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------- |-| FR1, FR2, AR1 | `Button.test.tsx` label, children, icon-only, end-content presence, and `type` cases; `Button.a11y.test.tsx`; `Button.a11y.chromium.spec.ts` | Text, icon-only, composed label, end content, submit type | A lost name, a wrong default `type`, or end content in icon-only fails. | `audit:Button/anatomy` |-| FR1, FR2 (gaps) | Evidence gap: no test passes `name`, `value`, or `form`, or asserts the order of icon, label, and end content | — | — | `audit:Button/anatomy` |-| FR3 | Evidence gap: no Button-level test of the text-mode icon slot default | `sm`, `md`, `lg` with an unsized Icon | — | `audit:Button/anatomy` |-| FR4 | `ButtonTextSize.interaction.browser.spec.ts` (a label larger than the element size grows its button; the default size keeps the element size). Evidence gap: no test asserts the explicit `size`, then nearest provider, then `md` order | `sm`, `md`, `lg`; inside a size provider | — | `audit:Button/layout` |-| FR5 | `Button.test.tsx` width and narrow-row suites; InputGroup addon case | Numeric and string width, link mode, icon-only, grouped | A Button that overflows its row, stops truncating, or squeezes icon-only fails. | `audit:Button/layout` |-| FR6, FR7 | `Button.test.tsx` click, double-click, and interruptible suites | onClick then clickAction; preventDefault; double-click; re-click | Order flips, a prevented click runs the action, or a fire-once action runs twice fails. | `audit:Button/behavior` |-| FR8, AR4 | `Button.test.tsx` loading, spinner shade, and live-region suites | `isLoading`; pending `clickAction`; first render loading | Missing `aria-busy`, a wrong Spinner shade, or a live region mounted with text fails. | `audit:Button/behavior` |-| FR8 (hide and delay) | Evidence gap: no test asserts the hidden content, the reveal delay, or the reduced-motion path; the shipped Spinner fade fails the fine-pointer reduced-motion clause (Current-state impact) | `isLoading`; pending `clickAction`; interruptible | Under reduced motion with a fine pointer, a Spinner opacity below 1 after the loading state starts. | `audit:Button/behavior` |-| FR8 (outer size) | Evidence gap: no test measures that a pending Button keeps its outer size | Loading text, icon-only, and end-content Buttons | — | `audit:Button/layout` |-| FR9, FR10, AR5 | `Button.test.tsx` aria-disabled, busy-only, and native-disabled suites; `Button.a11y.chromium.spec.ts` | Busy-only, tooltip-disabled, disabled, disabled and loading | A busy Button loses focus, an inert Button fires, or a click reaches an ancestor fails. Native-disabled assertions match the FR10 gap. | `audit:Button/accessibility` |-| FR11 | `Button.test.tsx` link-mode suites | Link, busy-only link, disabled `href` | A disabled link navigates or a busy link turns into a `<button>` fails. | `audit:Button/behavior` |-| FR12 | `Button.a11y.chromium.spec.ts` described state | Disabled with tooltip | A tooltip that does not describe the Button fails. | `audit:Button/accessibility` |-| FR12 (placement and order) | Evidence gap: no test asserts that the tooltip opens above the Button or that its id follows a caller `aria-describedby` | Tooltip with and without a caller description | — | `audit:Button/accessibility` |-| FR13, FR14 | `Button.test.tsx` theme-target and elevation suites; `ButtonGroup.test.tsx` "reports flat on a member, since the group owns the surface" for the grouped `data-elevation="none"` | `secondary` target attributes; every elevation tier | A missing target, or a `data-elevation` other than the effective tier, fails. | `audit:Button/theming` |-| FR13 (painted shadow) | Evidence gap: no test reads the painted shadow, so a grouped Button that paints its own shadow, or swapped tier shadows, would pass | Standalone tiers; grouped member | — | `audit:Button/theming` |-| FR14 (per variant) | Evidence gap: `data-variant` is asserted for `secondary` only | Other variants | — | `audit:Button/theming` |-| FR15 | `Button.test.tsx` touch pressed-state suite | Touch press on and fading | Losing the touch press arm or its release fade fails. | `audit:Button/behavior` |-| FR15 (disabled paint) | `pressFeedback.test.ts` "paints nothing on a disabled surface, and does not light the row around it" for the touch press. Evidence gap: no test of the hover and pressed overlays or the mouse scale on a Button exposed as disabled | Native disabled; `aria-disabled` | A disabled surface that takes the touch press fails. | `audit:Button/behavior` |-| FR15 (reduced motion) | `ReducedMotionPress.a11y.chromium.spec.ts` ("a pressed button never scales under reduced motion, with a mouse or a finger (DR1)") | Mouse press; touch press | A computed transform other than `none` or `scale(1)` during the press. | `audit:Button/behavior` |-| `spec:AST-094` FR42 | `Button.hitArea.test.tsx`: a standalone and a link Button take the touch band on their content wrapper, and a caller's `::after` stays on the button; a disabled, busy-only or grouped Button, or a Button whose tracking group draws its band, takes none | standalone; link; caller `::after`; disabled; busy-only; grouped; tracking group draws the band | A Button without the band fails. So does a disabled, busy-only or grouped Button with its own, or a Button with its own whose tracking group draws its band. | `audit:Button/behavior` |-| FR15 (hover and mouse scale) | Evidence gap: no test asserts the hover overlay or the 0.98 mouse-press scale | Hover; mouse press, standalone and grouped | — | `audit:Button/behavior` |-| FR16 | `edgeCompensation.test.tsx` Button data-attribute suite | Ghost and primary | A ghost Button without the marker, or a primary Button with it, fails. | `audit:Button/layout` |-| FR17 | `Button.test.tsx` ref suites and the caller `aria-disabled`/`aria-busy` case | Initial render and rerender; caller `aria-busy` and `aria-disabled` | A dropped or detached ref, or a dropped caller `aria-busy` or `aria-disabled`, fails. Evidence gap: no test asserts that a caller `aria-disabled` leaves the Button operable. | `audit:Button/behavior` |-| ORD1, ORD5 | Evidence gap: no test asserts size precedence (see FR4) or that caller `xstyle`, `className`, and `style` win over Button's own styles | — | — | `audit:Button/behavior` |-| ORD4 | `Button.test.tsx` icon-only and composed-label cases. Evidence gap: no test asserts the `aria-label` set while pending or when `children` differs from `label`, or the content name with icon-slot or end-content text | Icon-only; composed label | An icon-only Button without `aria-label`, or a composed label that gains one, fails. | `audit:Button/accessibility` |-| AR2 | `Button.a11y.chromium.spec.ts` activation and tab-reachability checks. Evidence gap: no test of Enter activation in link mode | Text and icon-only Buttons | A Button that Enter or Space does not activate, or that Tab skips, fails. | `audit:Button/accessibility` |-| AR3 | Evidence gap: no test asserts the focus outline or the destructive error-colored ring | Keyboard focus; destructive | — | `audit:Button/accessibility` |-| AR6, PR1 | Evidence gap: no test measures the target size or asserts that an idle Button schedules nothing | — | — | `audit:Button/behavior` |+| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |+| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------- |+| FR1, FR2, AR1 | `Button.test.tsx` label, children, icon-only, end-content presence, and `type` cases; `Button.a11y.test.tsx`; `Button.a11y.chromium.spec.ts` | Text, icon-only, composed label, end content, submit type | A lost name, a wrong default `type`, or end content in icon-only fails. | `audit:Button/anatomy` |+| FR1, FR2 (gaps) | Evidence gap: no test passes `name`, `value`, or `form`, or asserts the order of icon, label, and end content | — | — | `audit:Button/anatomy` |+| FR3 | Evidence gap: no Button-level test of the text-mode icon slot default | `sm`, `md`, `lg` with an unsized Icon | — | `audit:Button/anatomy` |+| FR4 | `ButtonTextSize.interaction.browser.spec.ts` (a label larger than the element size grows its button; at the default text size the Neutral and Butter themes' labelled buttons keep their element heights); `Button.test.tsx` default size geometry (a caller's height and the block padding hold). Evidence gap: no test asserts the explicit `size`, then nearest provider, then `md` order | `sm`, `md`, `lg`; inside a size provider | — | `audit:Button/layout` |+| FR5 | `Button.test.tsx` width and narrow-row suites; InputGroup addon case | Numeric and string width, link mode, icon-only, grouped | A Button that overflows its row, stops truncating, or squeezes icon-only fails. | `audit:Button/layout` |+| FR6, FR7 | `Button.test.tsx` click, double-click, and interruptible suites | onClick then clickAction; preventDefault; double-click; re-click | Order flips, a prevented click runs the action, or a fire-once action runs twice fails. | `audit:Button/behavior` |+| FR8, AR4 | `Button.test.tsx` loading, spinner shade, and live-region suites | `isLoading`; pending `clickAction`; first render loading | Missing `aria-busy`, a wrong Spinner shade, or a live region mounted with text fails. | `audit:Button/behavior` |+| FR8 (hide and delay) | Evidence gap: no test asserts the hidden content, the reveal delay, or the reduced-motion path; the shipped Spinner fade fails the fine-pointer reduced-motion clause (Current-state impact) | `isLoading`; pending `clickAction`; interruptible | Under reduced motion with a fine pointer, a Spinner opacity below 1 after the loading state starts. | `audit:Button/behavior` |+| FR8 (outer size) | Evidence gap: no test measures that a pending Button keeps its outer size | Loading text, icon-only, and end-content Buttons | — | `audit:Button/layout` |+| FR9, FR10, AR5 | `Button.test.tsx` aria-disabled, busy-only, and native-disabled suites; `Button.a11y.chromium.spec.ts` | Busy-only, tooltip-disabled, disabled, disabled and loading | A busy Button loses focus, an inert Button fires, or a click reaches an ancestor fails. Native-disabled assertions match the FR10 gap. | `audit:Button/accessibility` |+| FR11 | `Button.test.tsx` link-mode suites | Link, busy-only link, disabled `href` | A disabled link navigates or a busy link turns into a `<button>` fails. | `audit:Button/behavior` |+| FR12 | `Button.a11y.chromium.spec.ts` described state | Disabled with tooltip | A tooltip that does not describe the Button fails. | `audit:Button/accessibility` |+| FR12 (placement and order) | Evidence gap: no test asserts that the tooltip opens above the Button or that its id follows a caller `aria-describedby` | Tooltip with and without a caller description | — | `audit:Button/accessibility` |+| FR13, FR14 | `Button.test.tsx` theme-target and elevation suites; `ButtonGroup.test.tsx` "reports flat on a member, since the group owns the surface" for the grouped `data-elevation="none"` | `secondary` target attributes; every elevation tier | A missing target, or a `data-elevation` other than the effective tier, fails. | `audit:Button/theming` |+| FR13 (painted shadow) | Evidence gap: no test reads the painted shadow, so a grouped Button that paints its own shadow, or swapped tier shadows, would pass | Standalone tiers; grouped member | — | `audit:Button/theming` |+| FR14 (per variant) | Evidence gap: `data-variant` is asserted for `secondary` only | Other variants | — | `audit:Button/theming` |+| FR15 | `Button.test.tsx` touch pressed-state suite | Touch press on and fading | Losing the touch press arm or its release fade fails. | `audit:Button/behavior` |+| FR15 (disabled paint) | `pressFeedback.test.ts` "paints nothing on a disabled surface, and does not light the row around it" for the touch press. Evidence gap: no test of the hover and pressed overlays or the mouse scale on a Button exposed as disabled | Native disabled; `aria-disabled` | A disabled surface that takes the touch press fails. | `audit:Button/behavior` |+| FR15 (reduced motion) | `ReducedMotionPress.a11y.chromium.spec.ts` ("a pressed button never scales under reduced motion, with a mouse or a finger (DR1)") | Mouse press; touch press | A computed transform other than `none` or `scale(1)` during the press. | `audit:Button/behavior` |+| `spec:AST-094` FR42 | `Button.hitArea.test.tsx`: a standalone and a link Button take the touch band on their content wrapper, and a caller's `::after` stays on the button; a disabled, busy-only or grouped Button, or a Button whose tracking group draws its band, takes none | standalone; link; caller `::after`; disabled; busy-only; grouped; tracking group draws the band | A Button without the band fails. So does a disabled, busy-only or grouped Button with its own, or a Button with its own whose tracking group draws its band. | `audit:Button/behavior` |+| FR15 (hover and mouse scale) | Evidence gap: no test asserts the hover overlay or the 0.98 mouse-press scale | Hover; mouse press, standalone and grouped | — | `audit:Button/behavior` |+| FR16 | `edgeCompensation.test.tsx` Button data-attribute suite | Ghost and primary | A ghost Button without the marker, or a primary Button with it, fails. | `audit:Button/layout` |+| FR17 | `Button.test.tsx` ref suites and the caller `aria-disabled`/`aria-busy` case | Initial render and rerender; caller `aria-busy` and `aria-disabled` | A dropped or detached ref, or a dropped caller `aria-busy` or `aria-disabled`, fails. Evidence gap: no test asserts that a caller `aria-disabled` leaves the Button operable. | `audit:Button/behavior` |+| ORD1, ORD5 | Evidence gap: no test asserts size precedence (see FR4) or that caller `xstyle`, `className`, and `style` win over Button's own styles | — | — | `audit:Button/behavior` |+| ORD4 | `Button.test.tsx` icon-only and composed-label cases. Evidence gap: no test asserts the `aria-label` set while pending or when `children` differs from `label`, or the content name with icon-slot or end-content text | Icon-only; composed label | An icon-only Button without `aria-label`, or a composed label that gains one, fails. | `audit:Button/accessibility` |+| AR2 | `Button.a11y.chromium.spec.ts` activation and tab-reachability checks. Evidence gap: no test of Enter activation in link mode | Text and icon-only Buttons | A Button that Enter or Space does not activate, or that Tab skips, fails. | `audit:Button/accessibility` |+| AR3 | Evidence gap: no test asserts the focus outline or the destructive error-colored ring | Keyboard focus; destructive | — | `audit:Button/accessibility` |+| AR6, PR1 | Evidence gap: no test measures the target size or asserts that an idle Button schedules nothing | — | — | `audit:Button/behavior` |## Current-state impactdiff --git a/packages/cli/assets/templates/themes/butter/butterTheme.ts b/packages/cli/assets/templates/themes/butter/butterTheme.tsindex e022683c77..8b8d0bbcd2 100644--- a/packages/cli/assets/templates/themes/butter/butterTheme.ts+++ b/packages/cli/assets/templates/themes/butter/butterTheme.ts@@ -394,8 +394,7 @@ export const butterTheme = defineTheme({// Radius intentionally not pinned, so buttons keep core's// `var(--_button-radius, --radius-element)`: standalone buttons stay 8px,// while the chat composer (which sets --_button-radius) rounds them fully.- // Inline padding only: a labelled button's size is its minimum height,- // and block padding would add to it.+ // Inline padding only. Button sets its own block padding and height.base: {paddingInline: 'var(--spacing-4)',},diff --git a/packages/core/src/AlertDialog/AlertDialog.test.tsx b/packages/core/src/AlertDialog/AlertDialog.test.tsxindex cf9c809f4d..f70fa87043 100644--- a/packages/core/src/AlertDialog/AlertDialog.test.tsx+++ b/packages/core/src/AlertDialog/AlertDialog.test.tsx@@ -291,7 +291,7 @@ describe('AlertDialog', () => {for (const button of buttons) {const computed = getComputedStyle(button);expect(computed.whiteSpace).toBe('nowrap');- expect(computed.minHeight).toBe('var(--size-element-md)');+ expect(computed.height).toBe('max(var(--size-element-md),1lh)');expect(computed.maxWidth).toBe('100%');}});diff --git a/packages/core/src/Button/Button.test.tsx b/packages/core/src/Button/Button.test.tsxindex ac7dac70ea..f158a0d2ed 100644--- a/packages/core/src/Button/Button.test.tsx+++ b/packages/core/src/Button/Button.test.tsx@@ -831,6 +831,31 @@ describe('Button', () => {}});+ describe('default size geometry (FR4)', () => {+ const callerStyles = stylex.create({+ short: {height: '20px', paddingBlock: 0},+ });++ // A caller's height decides a labelled button's height, as before the+ // button grew with its label: no minimum holds it at the element size.+ it("keeps a caller's height on a labelled button", () => {+ render(<Button label="More" size="sm" xstyle={callerStyles.short} />);+ const button = screen.getByRole('button', {name: 'More'});+ const computed = getComputedStyle(button);+ expect(computed.height).toBe('20px');+ expect(['', '0px', 'auto']).toContain(computed.minHeight);+ });++ it('pads a labelled button by its block padding, as before', () => {+ render(<Button label="Save" size="sm" />);+ const computed = getComputedStyle(+ screen.getByRole('button', {name: 'Save'}),+ );+ expect(computed.paddingBlock).toBe('var(--spacing-2)');+ expect(['', '0px', 'auto']).toContain(computed.minHeight);+ });+ });+describe('in a narrow row', () => {// jsdom has no layout, so these assert the computed declarations that// produce the behavior. The real-browser widths are in the PR evidence.diff --git a/packages/core/src/Button/Button.tsx b/packages/core/src/Button/Button.tsxindex ec82bfb96e..56f96bee71 100644--- a/packages/core/src/Button/Button.tsx+++ b/packages/core/src/Button/Button.tsx@@ -119,6 +119,7 @@ const styles = stylex.create({alignItems: 'center',justifyContent: 'center',gap: spacingVars['--spacing-2'],+ paddingBlock: spacingVars['--spacing-2'],paddingInline: spacingVars['--spacing-3'],borderWidth: 0,borderStyle: 'none',@@ -269,12 +270,13 @@ const dynamicStyles = stylex.create({width: (width: SizeValue | null) => ({width}),});-// A label can outgrow the element size when the text size grows. The size is-// a minimum, so the button grows and its label stays inside the tap target.+// At the default text size one label line is shorter than the element size,+// so a caller's height still replaces this one. A larger text size makes the+// line taller, and the button grows with its label.const sizeStyles = stylex.create({- sm: {minHeight: sizeVars['--size-element-sm']},- md: {minHeight: sizeVars['--size-element-md']},- lg: {minHeight: sizeVars['--size-element-lg']},+ sm: {height: `max(${sizeVars['--size-element-sm']}, 1lh)`},+ md: {height: `max(${sizeVars['--size-element-md']}, 1lh)`},+ lg: {height: `max(${sizeVars['--size-element-lg']}, 1lh)`},});// An icon-only button holds its glyph, which does not grow with the text, sodiff --git a/packages/core/src/Button/__tests__/ButtonTextSize.interaction.browser.spec.ts b/packages/core/src/Button/__tests__/ButtonTextSize.interaction.browser.spec.tsindex 76a1f2deac..761e38b82b 100644--- a/packages/core/src/Button/__tests__/ButtonTextSize.interaction.browser.spec.ts+++ b/packages/core/src/Button/__tests__/ButtonTextSize.interaction.browser.spec.ts@@ -60,8 +60,8 @@ async function readButtons(page: Page) {);}-// Butter pads its buttons inline only, so its labelled buttons keep their-// element heights too.+// Each theme's labelled buttons keep exactly their element heights at the+// default text size, block padding included.for (const theme of ['neutral', 'butter']) {test(`at the default text size each size keeps its element height: ${theme}`, async ({page,@@ -69,9 +69,17 @@ for (const theme of ['neutral', 'butter']) {await openStory(page, 'size-variants', theme);const fits = await page.evaluate(() =>[...document.querySelectorAll<HTMLElement>('#storybook-root button')].map(- button =>- Math.round(button.getBoundingClientRect().height) ===- Math.round(parseFloat(getComputedStyle(button).minHeight)),+ button => {+ const probe = document.createElement('div');+ probe.style.height = `var(--size-element-${button.dataset.size})`;+ button.parentElement?.append(probe);+ const expected = probe.getBoundingClientRect().height;+ probe.remove();+ return (+ expected > 0 &&+ Math.abs(button.getBoundingClientRect().height - expected) < 0.5+ );+ },),);expect(fits).toEqual([true, true, true]);diff --git a/packages/core/src/DateInput/TouchDateField.tsx b/packages/core/src/DateInput/TouchDateField.tsxindex bde7818fbf..b008859348 100644--- a/packages/core/src/DateInput/TouchDateField.tsx+++ b/packages/core/src/DateInput/TouchDateField.tsx@@ -353,10 +353,7 @@ const styles = stylex.create({* honours.*/resetButton: {- minBlockSize: {- default: sizeVars['--size-element-sm'],- '@media (pointer: coarse)': TOUCH_TARGET,- },+ minBlockSize: {default: null, '@media (pointer: coarse)': TOUCH_TARGET},},/*** The month and year, and the toggle into the wheels. Leading, so it readsdiff --git a/packages/core/src/DateTimeInput/TouchDateTimeField.tsx b/packages/core/src/DateTimeInput/TouchDateTimeField.tsxindex cbc318345b..e3200bd140 100644--- a/packages/core/src/DateTimeInput/TouchDateTimeField.tsx+++ b/packages/core/src/DateTimeInput/TouchDateTimeField.tsx@@ -352,7 +352,7 @@ const styles = stylex.create({},touchResetButton: {minBlockSize: {- default: sizeVars['--size-element-sm'],+ default: null,'@media (pointer: coarse)': dateInputTouchSizes.daySize,},},diff --git a/packages/core/src/Toast/ToastViewport.test.tsx b/packages/core/src/Toast/ToastViewport.test.tsxindex 2b60c4eb41..f25bb83e1a 100644--- a/packages/core/src/Toast/ToastViewport.test.tsx+++ b/packages/core/src/Toast/ToastViewport.test.tsx@@ -205,8 +205,8 @@ describe('Toast responsive layout', () => {expect(getComputedStyle(endArea).height).toBe('calc(var(--text-body-size) * var(--text-body-leading))',);- expect(getComputedStyle(actionControl).minHeight).toBe(- 'var(--size-element-lg)',+ expect(getComputedStyle(actionControl).height).toBe(+ 'max(var(--size-element-lg),1lh)',);expect(getComputedStyle(dismissControl).height).toBe('var(--size-element-sm)',diff --git a/packages/themes/butter/src/butterTheme.ts b/packages/themes/butter/src/butterTheme.tsindex e022683c77..8b8d0bbcd2 100644--- a/packages/themes/butter/src/butterTheme.ts+++ b/packages/themes/butter/src/butterTheme.ts@@ -394,8 +394,7 @@ export const butterTheme = defineTheme({// Radius intentionally not pinned, so buttons keep core's// `var(--_button-radius, --radius-element)`: standalone buttons stay 8px,// while the chat composer (which sets --_button-radius) rounds them fully.- // Inline padding only: a labelled button's size is its minimum height,- // and block padding would add to it.+ // Inline padding only. Button sets its own block padding and height.base: {paddingInline: 'var(--spacing-4)',},