Skip to content

DS 2.0: Chip component - #87

Open
librowski wants to merge 8 commits into
ds2-pipeline-prepfrom
ds2-chips
Open

DS 2.0: Chip component#87
librowski wants to merge 8 commits into
ds2-pipeline-prepfrom
ds2-chips

Conversation

@librowski

@librowski librowski commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Adds the Chip component and swaps the first consumer onto it.

  • Chip in @workflowbuilder/ui: solid and outline treatments, sizes sxl, optional prefix icon and close affordance, per the DS 2.0 "Chips and Tag" component set.
  • The chip color tokens and --wb-radius-50 land in _provisional.css until the token export ships them; the light-theme outline overlay is a color-mix() because gray-100-85 does not exist in the exported palette.
  • The SDK dynamic-conditions counter tag renders with Chip; the local .tag treatment and its background variable go away.
  • Docs page with example and generated props table. Chip defines no ax-public-* variables (deprecated contract), so the CSS variables section renders the standard empty state.

Not swapped here: branch-card.module.css uses accent (acc2) chip colors this token factory does not cover; it migrates with the token pipeline switch.

Component-layer checklist (template for the remaining DS 2.0 layers)

  • Component matches the Figma component set (variants, sizes, metrics)
  • Missing tokens defined in _provisional.css, aliased to --ax-* per theme
  • Registered in vite componentEntries and the root barrel
  • Docs: page + example + COMPONENTS entry in ui-components.mjs
  • SDK consumers swapped, or deferred with a stated reason
  • Changesets: ui minor (new component), sdk patch (visual swap)
  • build:lib, docs build, stylelint, typecheck, tests green

@librowski librowski changed the title ds2 chips DS 2.0: Chip component Aug 20, 2026
@librowski
librowski force-pushed the ds2-chips branch 2 times, most recently from b1054f4 to b5b44d1 Compare August 20, 2026 22:33
Compact tag in the DS 2.0 solid and outline treatments, four sizes,
optional prefix icon and close affordance. Sized and colored per the
Chips and Tag component set in the DS 2.0 Figma file; the chip tokens
and wb/radius/50 live in _provisional.css until the token export ships
them. The outline background is two stacked fills by design: the brand
surface under a translucent theme overlay.
The local .tag treatment is replaced by the UI Chip component; the
class keeps only its layout margins and the tag background variable
goes away with it.
Example, usage snippet, and generated props table. The component
defines no ax-public-* variables (deprecated contract), so the CSS
variables section renders the standard empty state.
The dark outline overlay aliased gray-900-75, whose exported value is
the documented pre-2.0 bug (50% alpha instead of 75) - mixed from
gray-900 directly, like the light theme already does. The close button
gets the standard focus-visible ring. Variant and Size are renamed to
ChipVariant/ChipSize and exported - the bare names shadowed two
existing public types and rendered misleadingly in the generated props
table. Chip now forwards its ref and native span attributes, and the
close affordance takes an overridable closeLabel. The outline stroke
is an inset ring instead of a border so outline and solid chips render
the same width. Spacing metrics bind the space/size primitives from
the provisional set.
The label doc records why it is a string (it feeds the close
affordance's accessible name) and size gets a description - its TSDoc
was only a default tag, which the generated props table does not
surface, leaving an empty cell.
The Figma component strokes with strokeAlign OUTSIDE; the inset ring
came from an unverified review claim of an inside stroke and ate one
pixel of the chip's padding.
Version labels in prose age badly; prop docs carry only defaults and
the close-affordance contract, and the two CSS notes state their
invariant without narrating the source.
The token names carry the layering (inset under overlay) and the
outer box-shadow ring is a standard idiom.
@librowski
librowski marked this pull request as ready for review August 21, 2026 08:03
return (
<span ref={ref} {...rest} className={clsx(styles['chip'], styles[variant], styles[size], className)}>
{prefixIcon && <span className={styles['icon']}>{prefixIcon}</span>}
<span className="wb-text-label-s">{label}</span>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The typography page added in #84 recommends label-l-emphasized for "Buttons and chips", but Chip renders its label with wb-text-label-s (10px, weight 400) across all sizes, including xl. One of the two seems off. If the "Chips and Tag" component set in Figma really specifies Label/S Regular for every chip size, could we adjust the recommendation table in typography.mdx (or scope it to buttons only) so the docs don't contradict the component? And if not, should the chip label scale with size?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants