Feature/3518 Pill shaped form controls - #3594
Conversation
…, and time fields
…ped-form-controls
…e and number fields
…d-button and date-field
…e-field, search-field, and related components
…ll shape support for various form controls, add 'AllLarge' story with large (rect) form controls
…ust date field styling
…ort and adjust button paddings
🦋 Changeset detectedLatest commit: 0a713c2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 packages
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
🕸 Preview deploys |
…ext field, select button, and time field
…ped-form-controls # Conflicts: # packages/components/combobox/src/combobox.ts
There was a problem hiding this comment.
Pull request overview
Adds pill-shaped and large variants across form controls and aligns supporting stories and styles.
Changes:
- Adds
shapeandsizeAPIs 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.
There was a problem hiding this comment.
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 newPillstory), 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.scssby 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));
}
}
There was a problem hiding this comment.
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 inonPrefixSlotChangeas well and add the mirrored host attribute/style that removespadding-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-150trailing padding from the base rule. Issue #3518 requires pill selects to use--sl-size-175on both sides, so the control is currently asymmetric. Add the correspondingpadding-inline-endhere (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-250padding with zero. The newPillstory has nostep-buttons, so it renders asymmetrically. Limit this reset to pill fields that actually render step buttons; button-free fields should retain the inheritedTextFieldpill padding.
:host([shape='pill']:is(:not([size='lg']), [size='lg'])) {
padding-inline-end: 0;
}
a11ymiko
left a comment
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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-fieldalways 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 usespace.175on 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-colorto the focused host, but the host has no outline width/style; the actualoutlinedeclaration 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.
|
In date field, number field and time field the border of the field button should be |
|
|
||
| export const AllLarge: Story = { | ||
| args: { | ||
| fields: ({ disabled }) => html` |
There was a problem hiding this comment.
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'); | ||
| }); | ||
|
|
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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> |
| disabled | ||
| shape="pill" | ||
| size="lg" | ||
| value="Value"></sl-text-field> |
| <sl-time-field size="lg"></sl-time-field> | ||
| </sl-form-field> | ||
| </div> | ||
| </section> |
There was a problem hiding this comment.
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.







Pill shaped form controls: