proposals/IconButton/decisions.md40 lines · View on GitHub
Decisions
Base is the unmodified v2 IconButton (IconButton.tsx, icon-button.css, stories). Proposal changes go on top.
Icon, Tooltip and types come from the published package; mergeClasses is a local stand-in (the port uses the real one).
Strict-null fixes only, behavior unchanged: icon2Name defaults to undefined instead of null, refs typed HTMLDivElement, title uses undefined instead of null. v2 isn't strict, this repo is.
Storybook: both Button proposals sit under Proposals/Buttons/ (Button, Icon Button).
Superseded 2026-10-21: the isAgentic boolean. The bullets below describe the first model (isAgentic plus hasBorder) and are kept as history. The current API is variant='agentic' (see "Agentic is a variant, not a boolean" below): always bordered, hasBorder does not apply, no isAgentic prop. Do not read them as current.
isAgentic boolean modifier, same model as Button (not a variant or a separate component). AI gradient (--pds-gradient-ai-active) as the border, same token as Button, the agentic Spinner and pds-ai-active-border.
Only the standard variant supports it (the secondary-style one); reverse and critical warn in dev. Open: should critical or reverse get a border too?
isAgentic recolors the border; it needs hasBorder. Agentic + border = AI gradient border; border alone = plain border; neither = borderless icon. Without hasBorder, isAgentic changes nothing (an earlier version drew the border on its own, which read as a second kind of border).
Implementation: transparent border + gradient on the border-box, fill layers on the padding-box, opaque surface layer under translucent fills. The fill is a custom property (--icon-button-fill) so hover, active and pressed swap it. Pressed uses the secondary active background instead of v2's border-color fill, which the gradient can't provide.
Storybook defaults hasBorder and isAgentic to true (handoff). Sizes shows a borderless row and a bordered row; the bordered row follows the isAgentic control (on = AI gradient border, off = default gray).
Primary variant and working state: Send is an icon button (2026-10-21)
Decision:variant='primary' (filled like a primary Button) and isWorking (a spinner replaces the icon; disabled; aria-busy) were added, and the SendButton proposal was removed. Send's three states come from props: iconName='paperPlane', isWorking, iconName='stop'. The stop icon (a filled square) was added to the Icon wrapper. Disabled, including working, is one 40% fade of the whole button, as the SendButton had it. isWorking has no color prop; the spinner is currentColor (the SendButton's spinnerColor was unused).
Why: the designer decided the Send button should be a variant of the icon button with the primary fill, not a separate component.
Port impact: one component fewer to port. IconButton now imports the Spinner proposal, so Spinner is ported first. The Icon wrapper gains stop.
Open:isAgentic is not offered on primary; does Send need it? A voice (waveform) state for an empty field was never built.
Agentic is a variant, not a boolean (2026-10-21)
Decision:isAgentic was replaced by variant='agentic', the same way Send became variant='primary': an extension of the existing Icon Button, not a separate component (the Agentic Button, Agentic Menu Button and Agentic Split Button are separate). The agentic variant always has the gradient border, so hasBorder does not apply to it, and the "needs hasBorder" rule is gone. The Menu Button's icon-only trigger moved to the Agentic Menu Button, which uses variant='agentic'.
Why: the designer decided the agentic icon button should be an extension of the Icon Button, like Send.
Port impact:isAgentic is not ported; add the agentic value to variant. The CSS is the same gradient-border technique.
2xs size (2026-11-18)
Decision:size='2xs' is a 24px box (--pds-spacing-xl) with a 14px (s) icon, the s spinner and a tooltip offset of 4. The proposal went back from ready-for-dev to in-progress while it is reopened.
Why: Agent Tree's tool icons on a card were too big at xs (28px box, 16px icon). 24px is the smallest box that meets the WCAG 2.2 minimum target size, so nothing smaller was drawn. The designer named it 2xs (2026-11-18). The xs button's icon is one step up from s's (decision earlier in this file), so 2xs takes the icon one step down from xs: s.
Port impact: adds a size value and a CSS rule to the PDS IconButton; the five dependents (Agentic Menu Button, Chat Attachment, Chat Panel, Composer, Feedback Bar) are unchanged. The spinner has no size under s; the handoff of isWorking at 2xs is the s spinner (about the size of the icon box).
Open: is the s (about 16px) spinner too big in a 24px box? Not looked at.
2026-11-20: Spinner now comes from the package
Decision:IconButton.tsx imports Spinner and SpinnerSize from @pantheon-systems/pds-toolkit-react, not from ../Spinner/Spinner.
Why:isWorking only needs the plain spinner with color='currentColor'. The package Spinner (beta.21) takes color as a string and sets --spinner-color the same way as the local copy, so the render is equivalent. The local Spinner's extras (color='agentic', hasAvatar) are not used here.
Port impact: the earlier note that IconButton depends on the Spinner proposal is gone. isWorking has no dependency on a proposal, so it can ship without Spinner.
Open items kept as they were: no workingLabel prop (recommendation: leave it out; the caller changes ariaLabel).