feat(antares): add DateField component#201
Conversation
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: afd3583 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 |
📚 Storybook PreviewPreview URL: https://godaddy.github.io/antares/pr-201-storybook/ Preview will be automatically deleted when this PR is closed. |
Docs Site PreviewPreview URL: https://godaddy.github.io/antares/pr-201-site/ Preview will be automatically deleted when this PR is closed. |
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Drop verbose @example/@see blocks on each prop and tighten the component summary, matching the TextField docstring style.
|
/update-screenshots |
📸 Updating screenshots... View workflow run |
🎉 Successfully updated and committed screenshots! |
…ateField component
|
/update-screenshots |
📸 Updating screenshots... View workflow run |
🎉 Successfully updated and committed screenshots! |
|
/update-screenshots |
📸 Updating screenshots... View workflow run |
🎉 Successfully updated and committed screenshots! |
There was a problem hiding this comment.
Pull request overview
Adds a new DateField component to @godaddy/antares (a segmented Year/Month/Day date input built on react-aria-components), along with supporting exports, docs, and tests. It also updates the shared internal FieldFrame styling to normalize font-related behavior across field-based inputs (DateField/TextField/NumberField).
Changes:
- Introduces
DateFieldcomponent implementation, styles, Storybook stories, examples, and README docs. - Adds comprehensive browser/node/visual tests (plus SSR snapshots) for
DateField. - Updates
FieldFrameCSS (font inheritance/line-height) and wires up public exports + dependency on@internationalized/date.
Reviewed changes
Copilot reviewed 23 out of 45 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/@godaddy/antares/package.json | Adds @internationalized/date dependency required for CalendarDate typing/usage. |
| packages/@godaddy/antares/index.ts | Exposes DateField (and I18nProvider) from the public API surface. |
| packages/@godaddy/antares/exports/DateField.ts | Adds subpath export for DateField (+ I18nProvider). |
| packages/@godaddy/antares/components/date-field/src/index.tsx | Implements DateField wrapper around RAC DateField using FieldFrame. |
| packages/@godaddy/antares/components/date-field/src/index.module.css | Adds DateField-specific layout/segment styling. |
| packages/@godaddy/antares/components/date-field/README.mdx | Documents DateField usage, date typing (CalendarDate), and i18n expectations. |
| packages/@godaddy/antares/components/date-field/date-field.stories.tsx | Adds Storybook stories for all examples + playground. |
| packages/@godaddy/antares/components/date-field/examples/basic.tsx | Basic usage example. |
| packages/@godaddy/antares/components/date-field/examples/controlled.tsx | Controlled value/onChange example. |
| packages/@godaddy/antares/components/date-field/examples/date-field-playground.tsx | Storybook playground wrapper and args surface. |
| packages/@godaddy/antares/components/date-field/examples/disabled-required-readonly.tsx | Demonstrates disabled/required/read-only states. |
| packages/@godaddy/antares/components/date-field/examples/form.tsx | Demonstrates native form submission behavior via name. |
| packages/@godaddy/antares/components/date-field/examples/min-max.tsx | Demonstrates minValue/maxValue bounds. |
| packages/@godaddy/antares/components/date-field/examples/with-default-value.tsx | Demonstrates defaultValue initialization. |
| packages/@godaddy/antares/components/date-field/examples/with-description.tsx | Demonstrates description helper text. |
| packages/@godaddy/antares/components/date-field/examples/with-error.tsx | Demonstrates isInvalid + errorMessage. |
| packages/@godaddy/antares/components/date-field/examples/with-i18n.tsx | Demonstrates I18nProvider locale overrides (LTR + RTL). |
| packages/@godaddy/antares/components/date-field/test/date-field.browser.test.tsx | Adds interaction/state assertions for browser runtime. |
| packages/@godaddy/antares/components/date-field/test/date-field.node.test.tsx | Adds SSR snapshot/assertion coverage for examples. |
| packages/@godaddy/antares/components/date-field/test/date-field.visual.test.tsx | Adds screenshot coverage across example variants. |
| packages/@godaddy/antares/components/date-field/test/snapshots/date-field.node.test.tsx.snap | Stores SSR snapshots for DateField examples. |
| packages/@godaddy/antares/components/_internal/field-frame/src/index.module.css | Adjusts shared field frame font/line-height handling. |
| .changeset/date-field-component.md | Publishes @godaddy/antares minor release notes for DateField. |
… locale support for tests
ccfe3a4 to
dc23a05
Compare
| } | ||
|
|
||
| input.input { | ||
| padding-block: var(--sp-md); |
| > | ||
| {(segment) => <RACDateSegment segment={segment} className={styles.segment} />} |
There was a problem hiding this comment.
To be consisten with other components, use a named function instead please
| placeholderValue?: CalendarDate; | ||
|
|
||
| /** Helper text shown below the frame. */ | ||
| description?: string; |
There was a problem hiding this comment.
If I'm not wrong yo don't need to re-define again description, errormessage and lable because (as far as I know) the Docs Site would autoextract them from the inherited interface
|
|
||
| export const Props = getComponentDocs(DateField); | ||
|
|
||
| export const Default = getStory(DateFieldBasicExample); |
There was a problem hiding this comment.
In other stories file, this is named Basic
Basic = getStory(DateFieldBasicExample)
|
|
||
| it('renders with-error example', function withError() { | ||
| const result = renderToString(withTestLocale(<DateFieldWithErrorExample />)); | ||
| expect(result).toContain('data-invalid'); |
There was a problem hiding this comment.
in my opinion all node test should have toMatchSnapshot
| gap="sm" | ||
| > | ||
| <Flex | ||
| as={RACDateInput} |
There was a problem hiding this comment.
I think it would be useful to have the reference for this field. Can you please ad forwardRef
| } | ||
|
|
||
| &[data-invalid] { | ||
| color: var(--color-feedback-critical-strong, #ae1302); |
There was a problem hiding this comment.
here you are missing the legacy token
| "@bento/icon": "^0.2.0", | ||
| "@bento/svg-parser": "^0.1.1", | ||
| "@bento/use-data-attributes": "^0.1.1", | ||
| "@internationalized/date": "^3.12.2", |
There was a problem hiding this comment.
you are missing the package-lock.json changes associated to this change


DateFieldcomponent — a segmented date input (Year/Month/Day). This is the first date component of the date-components family (DatePicker,DateRangePicker,Calendar,RangeCalendar).I18NProvidercomponent re-exported from RAC, as it is useful for date components that need to manage locales.I18NProvider,@internationalized/dateis not re-exported because it is a date utilities package that RAC components already expect users to import directly, we are just following the same direction.field-frameupdates to fix inconsistences across font properties (font, line-height) in date-field, text-field and number-field along with screenshot updates.Storybook preview