refactor(antares): rebuild form controls with field primitives#234
refactor(antares): rebuild form controls with field primitives#234egaitan-godaddy wants to merge 19 commits into
Conversation
🦋 Changeset detectedLatest commit: 3267f92 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Docs Site PreviewPreview URL: https://godaddy.github.io/antares/pr-234-site/ Preview will be automatically deleted when this PR is closed. |
📚 Storybook PreviewPreview URL: https://godaddy.github.io/antares/pr-234-storybook/ Preview will be automatically deleted when this PR is closed. |
There was a problem hiding this comment.
Pull request overview
This PR refactors Antares form controls away from the monolithic internal FieldFrame and into composable field primitives (Field, FieldLabel, FieldGroup, etc.), then rebuilds TextField, NumberField, Select, RadioGroup, and CheckboxGroup on top of those primitives. It also introduces standalone ListBox / ListBoxItem primitives and updates stories/tests/snapshots accordingly, while adding a size?: 'sm' | 'md' visual prop to several boxed fields.
Changes:
- Introduces new internal field primitives (
components/_internal/field) and removes the legacycomponents/_internal/field-frame. - Rebuilds
TextField,NumberField,Select,Radio,Checkbox, and their group components to use the primitives; adds small/medium sizing examples + tests. - Adds a public
ListBox/ListBoxItemprimitive and updates exports + documentation.
Reviewed changes
Copilot reviewed 89 out of 89 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/@godaddy/antares/index.ts | Updates public exports for new ListBox API and revised Select exports. |
| packages/@godaddy/antares/exports/Select.ts | Updates subpath export to match new Select surface (SelectKey, fewer exports). |
| packages/@godaddy/antares/exports/ListBox.ts | Adds subpath export for new ListBox primitive. |
| packages/@godaddy/antares/components/text-field/text-field.stories.tsx | Adds size control + new “Sizes” story. |
| packages/@godaddy/antares/components/text-field/test/text-field.visual.test.tsx | Adds visual coverage for the new sizes example. |
| packages/@godaddy/antares/components/text-field/test/text-field.node.test.tsx | Adds SSR snapshot coverage for sizes (expects data-size="sm"). |
| packages/@godaddy/antares/components/text-field/test/snapshots/text-field.node.test.tsx.snap | Updates snapshots to new field primitive markup + adds sizes snapshot. |
| packages/@godaddy/antares/components/text-field/src/index.tsx | Rebuilds TextField on Field* primitives and adds size prop wiring. |
| packages/@godaddy/antares/components/text-field/src/index.module.css | Removes old .multiline rule (textarea sizing now handled by primitives). |
| packages/@godaddy/antares/components/text-field/examples/text-field-playground.tsx | Adds size passthrough in playground. |
| packages/@godaddy/antares/components/text-field/examples/sizes.tsx | Adds example showing md vs sm TextField. |
| packages/@godaddy/antares/components/select/test/select.visual.test.tsx | Adds visual regression tests for rebuilt Select examples. |
| packages/@godaddy/antares/components/select/test/select.node.test.tsx | Replaces old snapshot set with updated examples and size assertions. |
| packages/@godaddy/antares/components/select/test/select.browser.test.tsx | Updates interaction tests to new examples and new invalid-from-form behavior. |
| packages/@godaddy/antares/components/select/test/snapshots/select.node.test.tsx.snap | Updates snapshots for new Select structure and examples. |
| packages/@godaddy/antares/components/select/src/index.tsx | Rebuilds Select using Field* primitives + Popover + ListBox; trims API surface. |
| packages/@godaddy/antares/components/select/src/index.module.css | Replaces legacy Select styling with minimal SelectValue + icon styling (rest comes from primitives). |
| packages/@godaddy/antares/components/select/select.stories.tsx | Renames/reorganizes stories to match new examples and adds size control. |
| packages/@godaddy/antares/components/select/README.mdx | Rewrites docs to match new API and examples; removes sections for dropped APIs. |
| packages/@godaddy/antares/components/select/examples/sizes.tsx | Adds example demonstrating md vs sm Select. |
| packages/@godaddy/antares/components/select/examples/select-validation.tsx | Removes deprecated/old validation example (replaced by invalid + form examples). |
| packages/@godaddy/antares/components/select/examples/select-sizes.tsx | Removes old sizes example file (replaced with new one). |
| packages/@godaddy/antares/components/select/examples/select-sections.tsx | Removes old sections example (SelectSection/SelectHeader removed). |
| packages/@godaddy/antares/components/select/examples/select-render-props.tsx | Removes render-props example (render-function children removed). |
| packages/@godaddy/antares/components/select/examples/select-label-styles.tsx | Removes label-style examples (labelStyle removed). |
| packages/@godaddy/antares/components/select/examples/select-dynamic.tsx | Removes dynamic items example (items prop removed). |
| packages/@godaddy/antares/components/select/examples/select-controlled.tsx | Removes legacy controlled example (replaced with new controlled example). |
| packages/@godaddy/antares/components/select/examples/playground.tsx | Updates playground to the new Select API and default args. |
| packages/@godaddy/antares/components/select/examples/multiple.tsx | Adds new multiple-selection example using new controlled API. |
| packages/@godaddy/antares/components/select/examples/invalid.tsx | Renames/repurposes invalid example to exercise error rendering + required indicator. |
| packages/@godaddy/antares/components/select/examples/form.tsx | Adds native form submission example (incl. required validation). |
| packages/@godaddy/antares/components/select/examples/disabled.tsx | Renames disabled example and aligns to new API. |
| packages/@godaddy/antares/components/select/examples/controlled.tsx | Adds new controlled example using value/onChange. |
| packages/@godaddy/antares/components/select/examples/basic.tsx | Adds new basic example component used across docs/tests. |
| packages/@godaddy/antares/components/radio/src/index.tsx | Migrates from deprecated RAC Radio to RadioField + RadioButton and uses field primitives for group layout. |
| packages/@godaddy/antares/components/radio/src/index.module.css | Removes label-required/error styles now handled by primitives; adds minor UX tweak (user-select: none). |
| packages/@godaddy/antares/components/popover/src/index.tsx | Adjusts Popover container/content props typing; moves elevation/rounding to the popover root; adds content class merging. |
| packages/@godaddy/antares/components/popover/src/index.module.css | Adds .content { overflow: auto; }. |
| packages/@godaddy/antares/components/number-field/test/number-field.visual.test.tsx | Adds visual coverage for NumberField sizes example. |
| packages/@godaddy/antares/components/number-field/test/number-field.node.test.tsx | Adds SSR snapshot coverage for sizes (expects data-size="sm"). |
| packages/@godaddy/antares/components/number-field/test/snapshots/number-field.node.test.tsx.snap | Updates snapshots to new primitives markup + adds sizes snapshot. |
| packages/@godaddy/antares/components/number-field/src/index.tsx | Rebuilds NumberField on field primitives and adds size prop. |
| packages/@godaddy/antares/components/number-field/number-field.stories.tsx | Adds sizes story and size playground control. |
| packages/@godaddy/antares/components/number-field/examples/sizes.tsx | Adds example showing md vs sm NumberField. |
| packages/@godaddy/antares/components/number-field/examples/number-field-playground.tsx | Adds size to playground props and passes through. |
| packages/@godaddy/antares/components/modal/test/snapshots/modal.node.test.tsx.snap | Updates snapshots due to RadioGroup structural changes. |
| packages/@godaddy/antares/components/listbox/test/listbox.node.test.tsx | Adds SSR snapshot tests for ListBox examples. |
| packages/@godaddy/antares/components/listbox/test/listbox.browser.test.tsx | Adds browser interaction tests for ListBox selection behaviors. |
| packages/@godaddy/antares/components/listbox/test/snapshots/listbox.node.test.tsx.snap | Adds initial snapshots for ListBox examples. |
| packages/@godaddy/antares/components/listbox/src/index.tsx | Introduces new ListBox/ListBoxItem wrapper components over RAC with Flex layout + textValue derivation. |
| packages/@godaddy/antares/components/listbox/src/index.module.css | Adds baseline ListBoxItem styling and state selectors. |
| packages/@godaddy/antares/components/listbox/README.mdx | Adds docs for new public ListBox primitive. |
| packages/@godaddy/antares/components/listbox/listbox.stories.tsx | Adds Storybook stories + playground for ListBox. |
| packages/@godaddy/antares/components/listbox/examples/playground.tsx | Adds playground example for ListBox. |
| packages/@godaddy/antares/components/listbox/examples/multiple.tsx | Adds multiple-selection example. |
| packages/@godaddy/antares/components/listbox/examples/controlled.tsx | Adds controlled single-selection example. |
| packages/@godaddy/antares/components/listbox/examples/basic.tsx | Adds basic single-selection example. |
| packages/@godaddy/antares/components/checkbox/src/index.tsx | Migrates to CheckboxField + CheckboxButton and uses field primitives for group label/description/error. |
| packages/@godaddy/antares/components/checkbox/src/index.module.css | Removes label-required/error styles now handled by primitives; adds user-select: none. |
| packages/@godaddy/antares/components/checkbox/README.mdx | Updates docs: direction → orientation. |
| packages/@godaddy/antares/components/checkbox/examples/playground.tsx | Updates example prop from direction to orientation. |
| packages/@godaddy/antares/components/checkbox/examples/horizontal.tsx | Updates example to use orientation="horizontal". |
| packages/@godaddy/antares/components/checkbox/checkbox.stories.tsx | Updates Storybook controls/args to orientation. |
| packages/@godaddy/antares/components/button/src/index.module.css | Lowers specificity using :where(:not(.inline)). |
| packages/@godaddy/antares/components/_internal/field/test/field.node.test.tsx | Updates internal field primitive SSR tests from FieldFrame to FieldGroup. |
| packages/@godaddy/antares/components/_internal/field/test/field.browser.test.tsx | Updates internal field primitive browser tests from FieldFrame to FieldGroup. |
| packages/@godaddy/antares/components/_internal/field/test/snapshots/field.node.test.tsx.snap | Adds new snapshots for FieldGroup examples. |
| packages/@godaddy/antares/components/_internal/field/src/index.tsx | Adds new internal primitives (Field, FieldLabel, FieldGroup, Input/TextArea, FieldButton, etc.). |
| packages/@godaddy/antares/components/_internal/field/src/index.module.css | Adds shared field primitive styling, markers, sizing cascade, and state styles. |
| packages/@godaddy/antares/components/_internal/field/README.mdx | Adds internal documentation for field primitives and composition model. |
| packages/@godaddy/antares/components/_internal/field/field.stories.tsx | Adds Storybook stories for internal primitives (for development reference). |
| packages/@godaddy/antares/components/_internal/field/examples/trailing-control.tsx | Adds internal example demonstrating trailing control composition. |
| packages/@godaddy/antares/components/_internal/field/examples/leading-control.tsx | Adds internal example demonstrating leading control composition. |
| packages/@godaddy/antares/components/_internal/field/examples/icon-accessories.tsx | Adds internal example demonstrating icon + button accessories. |
| packages/@godaddy/antares/components/_internal/field/examples/field-playground.tsx | Adds playground wrapper for FieldGroup basic example. |
| packages/@godaddy/antares/components/_internal/field/examples/basic.tsx | Adds basic composed example for Field primitives. |
| packages/@godaddy/antares/components/_internal/field-frame/test/snapshots/field-frame.node.test.tsx.snap | Removes legacy FieldFrame snapshots. |
| packages/@godaddy/antares/components/_internal/field-frame/src/index.tsx | Removes legacy FieldFrame implementation. |
| packages/@godaddy/antares/components/_internal/field-frame/src/index.module.css | Removes legacy FieldFrame styling. |
| packages/@godaddy/antares/components/_internal/field-frame/README.mdx | Removes legacy FieldFrame docs. |
| packages/@godaddy/antares/components/_internal/field-frame/field-frame.stories.tsx | Removes legacy FieldFrame Storybook stories. |
| packages/@godaddy/antares/components/_internal/field-frame/examples/trailing-control.tsx | Removes legacy FieldFrame example. |
| packages/@godaddy/antares/components/_internal/field-frame/examples/leading-control.tsx | Removes legacy FieldFrame example. |
| packages/@godaddy/antares/components/_internal/field-frame/examples/icon-accessories.tsx | Removes legacy FieldFrame example. |
| packages/@godaddy/antares/components/_internal/field-frame/examples/field-frame-playground.tsx | Removes legacy FieldFrame playground example. |
| packages/@godaddy/antares/components/_internal/field-frame/examples/basic.tsx | Removes legacy FieldFrame basic example. |
| .changeset/field-frame.md | Adds changeset describing the refactor, new primitives, and breaking changes. |
|
/update-screenshots |
📸 Updating screenshots... View workflow run |
🎉 Successfully updated and committed screenshots! |
… RACTextFieldProps Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ts/field Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…r with Select Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…des Promise) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…and FieldSelect Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
/update-screenshots |
📸 Updating screenshots... View workflow run |
✅ No screenshot changes detected. Screenshots are already up to date. |
…ding Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
/update-screenshots |
📸 Updating screenshots... View workflow run |
🎉 Successfully updated and committed screenshots! |
Summary
Select
TextField
NumberField
Checkbox
Radio
Field
This PR refactors the current
FieldFrameinto a set of composable field primitives. Presentation and layout are handled by these primitives, while context wiring is delegated internally to RAC, removing the need for manual context wiring on our side. Also, all components and primitives are now aligned with the Design Specs.Field,FieldLabel,FieldGroup,FieldDescription,FieldError,FieldInput,FieldTextArea, andFieldButton.TextField,NumberField,Checkbox,Radio, andSelecton top of these primitives.size?: 'sm' | 'md'prop onTextField,NumberField, andSelect. Thesmsize aligns with the Figma design specs.ListBoxandListBoxItemprimitives.Selecton top of the field primitives, along withPopoverandListBox.RadioandCheckboxfrom the deprecated RACRadioandCheckboxcomponents toRadioField+RadioButtonandCheckboxField+CheckboxButton.RadioGroupandCheckboxGroupon top of the field primitives so labels, descriptions, required indicators, and error rendering are consistent across all field components.