Skip to content

Commit e087c20

Browse files
bradpottsCopilot
andcommitted
Add size, fullWidth, pill to select/textarea recipes
Extends `getSelectClasses` and `getTextareaClasses` with `size` (sm/md/lg), `fullWidth`, and `pill` options to match `getInputClasses` structural parity. Moves size-specific padding and typography into dedicated modifier classes in components.css. Updates tests, README, CHANGELOG, and TODO accordingly. Bumps `@phcdevworks/spectre-tokens` to ^3.3.0 and refreshes dev dependency patch versions (typescript-eslint, postcss, prettier, tailwindcss). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 2094866 commit e087c20

9 files changed

Lines changed: 305 additions & 119 deletions

File tree

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,22 @@ reflects package releases published to npm.
66

77
## [Unreleased]
88

9+
Contract change type: additive
10+
11+
### Added
12+
13+
- **Select/Textarea size and shape options**: `getSelectClasses` and
14+
`getTextareaClasses` gained `size` (`sm` `md` `lg`), `fullWidth`, and
15+
`pill` options, matching `getInputClasses`'s structural option shape.
16+
Resolves the Phase 5 P0 downstream ask from `spectre-components` for
17+
partial option parity. `invalid`/`success`/`loading` state colors remain
18+
out of scope — `component.select`/`component.textarea` have no color
19+
roles for those states in the published tokens (only
20+
`bg`/`border`/`text`/`placeholder`/`disabled`/`focusBorder`), unlike
21+
`component.input`'s `--sp-component-input-role-*` group. Filed as a new
22+
token gap rather than reusing input's role tokens or inventing local
23+
values.
24+
925
## [2.6.0] - 2026-06-28
1026

1127
Release Title: Semantic Primitives and Form-Field Recipes

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,8 @@ All options are optional and fall back to sensible defaults.
282282
| Footer | `getFooterClasses` ||| `bordered` `fullWidth` |
283283
| Checkbox | `getCheckboxClasses` ||| `checked` `disabled` |
284284
| Radio | `getRadioClasses` ||| `checked` `disabled` |
285-
| Select | `getSelectClasses` | || `disabled` `focused` |
286-
| Textarea | `getTextareaClasses` | || `disabled` `focused` |
285+
| Select | `getSelectClasses` | size: `sm` `md` `lg` || `fullWidth` `pill` `disabled` `focused` |
286+
| Textarea | `getTextareaClasses` | size: `sm` `md` `lg` || `fullWidth` `pill` `disabled` `focused` |
287287
| Fieldset | `getFieldsetClasses` ||| `disabled` |
288288
| Label | `getLabelClasses` ||| `disabled` `required` |
289289

TODO.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,40 @@ All six landed together with CSS, recipes, manifest, README, changelog, and
586586
`active`/`disabled`/`hovered`/`focused` flags — add `level` alongside
587587
them, do not create a parallel options shape.
588588

589+
- [x] `getSelectClasses`/`getTextareaClasses` only supported `{disabled,
590+
focused}` — missing `size`, `fullWidth`, `pill`, and `invalid`/
591+
`success`/`loading` state, unlike `getInputClasses`'s full option set
592+
**Requested by Downstream**: `project-design/spectre-components`
593+
(added 2026-06-29), found while wiring `sp-select`/`sp-textarea` to
594+
these new Phase 4e recipes — see
595+
`project-design/spectre-components/TODO.md` Phase 6 P0.
596+
- **Decision: partial parity, resolved 2026-06-30.** Added `size` (`sm` |
597+
`md` | `lg`), `fullWidth`, and `pill` to both recipes, following the
598+
same `resolveOption`/const-map pattern `getInputClasses` establishes
599+
(`SELECT_SIZES`/`TEXTAREA_SIZES`). These are pure layout/shape options —
600+
no color tokens needed — so they were safe to add immediately.
601+
- **`invalid`/`success`/`loading` state deliberately deferred — new token
602+
gap, not a local fallback.** Checked the published
603+
`@phcdevworks/spectre-tokens@3.2.0` dist CSS directly:
604+
`component.select`/`component.textarea` only emit
605+
`bg`/`border`/`text`/`placeholder`/`disabled`/`focusBorder` roles. There
606+
is no `--sp-select-border-invalid` / `--sp-select-bg-success` equivalent
607+
of `component.input`'s `--sp-component-input-role-border-error` /
608+
`-bg-error` / `-border-success` / `-bg-success` group. Reusing input's
609+
role tokens for select/textarea would blur the per-component token
610+
namespace boundary `CLAUDE.md` requires staying distinct; inventing
611+
local color values would violate the zero-raw-value rule. Filed as a new
612+
ask for `project-design/spectre-tokens`: publish
613+
`component.select.border.invalid` / `.bg.invalid` /
614+
`.border.success`/`.bg.success` (and the `component.textarea`
615+
equivalents) before this package adds `invalid`/`success`/`loading`
616+
options to either recipe.
617+
- `spectre-components`'s `sp-select`/`sp-textarea` can now adopt the new
618+
`size`/`fullWidth`/`pill` options from these recipes, but must keep
619+
using `getInputClasses()` (or an equivalent local mapping) for
620+
`invalid`/`success`/`loading` visuals until the token gap above is
621+
closed — see `project-design/spectre-components/TODO.md` Phase 6 P0.
622+
589623
- [x] Add regression coverage for downstream integration issues
590624
- Prefer focused contract tests over broad fixture expansion.
591625

0 commit comments

Comments
 (0)