Skip to content

Feature/3518 Pill shaped form controls - #3594

Open
anna-lach wants to merge 22 commits into
mainfrom
feature/3518-pill-shaped-form-controls
Open

Feature/3518 Pill shaped form controls#3594
anna-lach wants to merge 22 commits into
mainfrom
feature/3518-pill-shaped-form-controls

Conversation

@anna-lach

@anna-lach anna-lach commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Pill shaped form controls:

  • combobox
  • date-field
  • number-field
  • search-field
  • select
  • text-field
  • time-field

@anna-lach anna-lach linked an issue Aug 12, 2026 that may be closed by this pull request
15 tasks
@changeset-bot

changeset-bot Bot commented Aug 12, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0a713c2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 10 packages
Name Type
@sl-design-system/tag Minor
@sl-design-system/text-field Minor
@sl-design-system/select Minor
@sl-design-system/date-field Minor
@sl-design-system/search-field Minor
@sl-design-system/combobox Minor
@sl-design-system/number-field Minor
@sl-design-system/time-field Minor
@sl-design-system/grid Patch
@sl-design-system/angular Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

…ped-form-controls

# Conflicts:
#	packages/components/tag/src/tag-list.scss
@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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.

Pull request overview

Adds pill-shaped and large variants across form controls and aligns supporting stories and styles.

Changes:

  • Adds shape and size APIs to relevant controls.
  • Updates control, button, tag, and responsive styling.
  • Expands Storybook coverage and propagation tests.

Reviewed changes

Copilot reviewed 31 out of 31 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
packages/components/time-field/src/time-field.ts Adds shape and size APIs.
packages/components/time-field/src/time-field.stories.ts Adds variant controls and pill story.
packages/components/time-field/src/time-field.scss Styles pill and large variants.
packages/components/text-field/src/text-field.ts Adds the shape API.
packages/components/text-field/src/text-field.stories.ts Adds pill controls and story.
packages/components/text-field/src/text-field.scss Styles pill variants.
packages/components/text-field/src/field-button.scss Revises embedded button styling.
packages/components/tag/src/tag-list.scss Styles pill-shaped stacked tags.
packages/components/select/src/select.ts Adds and propagates shape.
packages/components/select/src/select.stories.ts Adds pill controls and story.
packages/components/select/src/select.spec.ts Tests shape propagation.
packages/components/select/src/select.scss Styles pill clear buttons.
packages/components/select/src/select-button.ts Adds mirrored shape support.
packages/components/select/src/select-button.scss Styles pill select buttons.
packages/components/search-field/src/search-field.ts Exposes shape and size APIs.
packages/components/search-field/src/search-field.stories.ts Adds pill and large stories.
packages/components/search-field/src/search-field.scss Styles pill search fields.
packages/components/number-field/src/number-field.stories.ts Adds pill controls and story.
packages/components/number-field/src/number-field.scss Styles pill step-button layouts.
packages/components/grid/src/stories/selection.stories.ts Reformats story markup.
packages/components/form/src/form.stories.ts Adds number, large, and pill examples.
packages/components/date-field/src/date-field.ts Adds shape and size APIs.
packages/components/date-field/src/date-field.stories.ts Adds variant controls and pill story.
packages/components/date-field/src/date-field.scss Styles pill and large variants.
packages/components/combobox/src/single.stories.ts Adds single-select pill story.
packages/components/combobox/src/multiple.stories.ts Adds multi-select pill story.
packages/components/combobox/src/combobox.ts Adds and propagates shape.
packages/components/combobox/src/combobox.stories.ts Expands pill examples.
packages/components/combobox/src/combobox.spec.ts Tests shape propagation.
packages/components/combobox/src/combobox.scss Styles pill combobox tags.
packages/components/card/src/card.scss Removes redundant whitespace.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/components/tag/src/tag-list.scss Outdated
Comment thread packages/components/text-field/src/field-button.scss
Comment thread packages/components/text-field/src/text-field.scss
Comment thread packages/components/date-field/src/date-field.scss
Comment thread packages/components/time-field/src/time-field.scss

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 31 out of 31 changed files in this pull request and generated no new comments.

Suppressed comments (2)

packages/components/number-field/src/number-field.scss:20

  • This selector matches every pill-shaped number field because an element is always either [size='lg'] or :not([size='lg']). It therefore removes the inherited right padding even when no step buttons exist (including the new Pill story), contradicting issue #3518's 175/250 right-padding requirement and leaving the control asymmetric. Limit the reset to pill fields that actually render step buttons.
:host([shape='pill']:is(:not([size='lg']), [size='lg'])) {
  padding-inline-end: 0;
}

packages/components/select/src/select-button.scss:48

  • The medium pill variant only increases the leading wrapper padding; the host still uses the base 150 end padding from line 22. Issue #3518 specifies 175 on both sides, so medium pill selects remain asymmetric. Add matching end padding here and update the clear-button inset in select.scss by the same amount so clearable selects stay aligned.
:host([shape='pill']) {
  border-radius: var(--sl-size-borderRadius-full);

  .wrapper {
    padding-inline-start: calc(var(--sl-size-175) - var(--sl-size-borderWidth-default));
  }
}

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 39 out of 39 changed files in this pull request and generated no new comments.

Suppressed comments (3)

packages/components/text-field/src/text-field.ts:103

  • Only suffix field buttons are tracked, so a <sl-field-button slot="prefix"> keeps the host's normal leading padding even though the new prefix button styling gives it the control's outer corner radii and divider. The result is an inset, disconnected leading button, while suffix buttons are flush. Track prefix field-button presence in onPrefixSlotChange as well and add the mirrored host attribute/style that removes padding-inline-start.
    packages/components/select/src/select-button.scss:48
  • The pill style updates only the leading padding; the medium select still keeps the rectangular --sl-size-150 trailing padding from the base rule. Issue #3518 requires pill selects to use --sl-size-175 on both sides, so the control is currently asymmetric. Add the corresponding padding-inline-end here (the more-specific large rule can continue to override it).
:host([shape='pill']) {
  border-radius: var(--sl-size-borderRadius-full);

  .wrapper {
    padding-inline-start: calc(var(--sl-size-175) - var(--sl-size-borderWidth-default));
  }

packages/components/number-field/src/number-field.scss:20

  • This selector matches every pill number field, including the documented/default case with no step buttons, and therefore overwrites the pill's trailing --sl-size-175/--sl-size-250 padding with zero. The new Pill story has no step-buttons, so it renders asymmetrically. Limit this reset to pill fields that actually render step buttons; button-free fields should retain the inherited TextField pill padding.
:host([shape='pill']:is(:not([size='lg']), [size='lg'])) {
  padding-inline-end: 0;
}

@a11ymiko a11ymiko left a comment

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.

Should lg size of rect number field with buttons on the edges have the same separators between buttons and form field as in Figma? Right now in storybook separators' height is shorter than form field height but in Figma they are the same height.

Storybook:
Image

Figma:

Image

@a11ymiko a11ymiko left a comment

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.

Should lg size of rect number field with buttons on the edges have the same hover effect on field buttons as in Figma? Right now in storybook hover makes less than whole button to change the background color but in Figma the whole button changes color on hover.

Storybook:
Image

Figma:

Image

@a11ymiko a11ymiko left a comment

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.

Maybe it's a good idea to add Pill shaped Date field, Number field, Search field, Select and Text field to All stories so they are more aligned with stories like Combobox > All where there are Pill shaped comboboxes?

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 38 out of 38 changed files in this pull request and generated no new comments.

Suppressed comments (3)

packages/components/text-field/src/field-button.scss:25

  • The new prefix edge styling cannot sit at the field edge: sl-text-field always retains its leading padding and gap, while only suffix field buttons trigger padding removal. A prefix field button therefore renders its rounded leading corners and separator inset inside the field. Track prefix-button presence and remove the leading padding/gap analogously to the suffix handling.
    packages/components/select/src/select-button.scss:48
  • The medium pill variant only increases the leading padding; the trailing padding still comes from the rectangular default (space.150). Issue #3518 explicitly requires pill selects to use space.175 on both sides, so the chevron side remains too tight. Set the host's trailing padding in this rule as well.
:host([shape='pill']) {
  border-radius: var(--sl-size-borderRadius-full);

  .wrapper {
    padding-inline-start: calc(var(--sl-size-175) - var(--sl-size-borderWidth-default));
  }

packages/components/text-field/src/field-button.scss:80

  • This now applies only outline-color to the focused host, but the host has no outline width/style; the actual outline declaration remains on the slotted icon below. Consequently the component's custom focus indicator is no longer activated when the field button receives keyboard focus. Either establish the full outline on the host or keep changing the icon's outline color.

@a11ymiko a11ymiko left a comment

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.

In Safari field buttons have different color of focus indicator than input field does. This color has not sufficient contrast and should be changed to be the same as color of focus indicator of input field.

Image

@a11ymiko
a11ymiko marked this pull request as ready for review August 18, 2026 13:51
@DanielleRameau

DanielleRameau commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

In date field, number field and time field the border of the field button should be color.border.disabled in disabled state.

Current
Screenshot 2026-08-18 at 16 28 17

Expected
Screenshot 2026-08-18 at 16 25 01

See: https://www.figma.com/design/CHpKrPIdXdbV2u7X8vizKI/Components-2.0?node-id=21216-220911&t=x2UmZDqgXEUBqRPH-4


export const AllLarge: Story = {
args: {
fields: ({ disabled }) => html`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

can you not make a function that prints the entire form, with only the settings you pass to it (so the size and shape)
That would make it a lot easier to maintain (and read 😁 )

expect(el).to.have.attribute('shape', 'pill');
expect(el.renderRoot.querySelector('sl-text-field')).to.have.attribute('shape', 'pill');
});

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

why have you added this to the tests here but not for some other components?
(i'm not sure this test add anything by the way; you're basically testing lit functionality; whether the 'reflects' property works)

shape="pill"
size="lg"
step-buttons="edges"
value="100"></sl-number-field>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

do we really need so many variants of the pill number field? what could be different between the default and the disabled one that isn't already tested in the rectangular variant?

disabled
shape="pill"
size="lg"
value="Value"></sl-search-field>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

same here, do we need all of these?

<sl-option>Value 1</sl-option>
<sl-option>Value 2</sl-option>
<sl-option>Value 3</sl-option>
</sl-select>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

same, so we need so many?

disabled
shape="pill"
size="lg"
value="Value"></sl-text-field>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

same

<sl-time-field size="lg"></sl-time-field>
</sl-form-field>
</div>
</section>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is a bit of a jumble; hard to see the logic in this page; maybe make groups?

Also "Min/Max" and "Custom steps" don't need to be here; they look exactly the same as the default. This all page is basically only for chromatic; you want all variants to be visible, but not more than necessary.

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.

Pill shaped form controls

5 participants