Skip to content

docs: add documentation for calendar and date field components#3276

Draft
anna-lach wants to merge 1 commit into
mainfrom
docs/2253-date-field-document-component-on-the-documentation-website
Draft

docs: add documentation for calendar and date field components#3276
anna-lach wants to merge 1 commit into
mainfrom
docs/2253-date-field-document-component-on-the-documentation-website

Conversation

@anna-lach
Copy link
Copy Markdown
Collaborator

This pull request introduces comprehensive documentation and registration for two new form components: Calendar and Date Field. It adds detailed usage guides, accessibility documentation, code examples, and supporting metadata for both components, as well as registers them within the design system's component loader. Additionally, it updates the status of some existing components to "ready".

New Component Documentation and Registration

Calendar Component:

  • Added new documentation files: overview (calendar.md), usage guidance (usage.md), accessibility details (accessibility.md), code examples (code.md), and metadata (calendar.json) for the Calendar and Month view components. These cover anatomy, states, behaviors, keyboard interactions, WAI-ARIA attributes, and configuration options. [1] [2] [3] [4] [5]
  • Registered the Calendar component in the system loader (slds-components.ts).

Date Field Component:

  • Added new documentation files: overview (date-field.md), usage guidance (usage.md), accessibility details (accessibility.md), code examples (code.md), and metadata (date-field.json) for the Date Field component. These include details on anatomy, behaviors, keyboard support, ARIA attributes, select-only mode, and validation. [1] [2] [3] [4] [5]
  • Registered the Date Field component in the system loader (slds-components.ts).

Component Status Updates

Status Changes:

  • Updated the status of the Callout and Tool bar components from "new" to "ready" in their respective documentation files, reflecting their production readiness. [1] [2]

Copilot AI review requested due to automatic review settings May 7, 2026 08:23
@anna-lach anna-lach linked an issue May 7, 2026 that may be closed by this pull request
4 tasks
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 7, 2026

⚠️ No Changeset found

Latest commit: 16ce5be

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

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

💥 An error occurred when fetching the changed packages and changesets in this PR
Some errors occurred when validating the changesets config:
The package "@sl-design-system/grid" depends on the ignored package "@sl-design-system/example-data", but "@sl-design-system/grid" is not being ignored. Please add "@sl-design-system/grid" to the `ignore` option.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

🕸 Website preview

You can view a preview here (commit 16ce5bee09651ef519a6f9c34c3df8c3e4ed7dee).

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

🕸 Storybook preview

You can view a preview here (commit 16ce5bee09651ef519a6f9c34c3df8c3e4ed7dee).

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds website documentation and site registration for the new Calendar and Date field form components, and updates a couple of existing component docs to “ready” status.

Changes:

  • Register @sl-design-system/calendar and @sl-design-system/date-field in the website component loader.
  • Add new documentation pages (overview/usage/accessibility/code) and metadata JSON for Calendar and Date field.
  • Mark Callout and Tool bar documentation status as ready.

Reviewed changes

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

Show a summary per file
File Description
website/src/ts/scripts/slds-components.ts Registers Calendar and Date field so they load on the documentation site.
website/src/categories/components/tool-bar/tool-bar.md Updates Tool bar navigation status to ready.
website/src/categories/components/callout/callout.md Updates Callout navigation status to ready.
website/src/categories/components/calendar/calendar.md Adds Calendar component overview frontmatter page.
website/src/categories/components/calendar/usage.md Adds Calendar usage guidance and behavior documentation.
website/src/categories/components/calendar/accessibility.md Adds Calendar keyboard/ARIA accessibility documentation.
website/src/categories/components/calendar/code.md Adds Calendar code examples and API description mapping.
website/src/categories/components/calendar/calendar.json Adds Calendar component metadata (tag names/selectors, status).
website/src/categories/components/date-field/date-field.md Adds Date field component overview frontmatter page.
website/src/categories/components/date-field/usage.md Adds Date field usage guidance and behavior documentation.
website/src/categories/components/date-field/accessibility.md Adds Date field keyboard/ARIA accessibility documentation.
website/src/categories/components/date-field/code.md Adds Date field code examples and API description mapping.
website/src/categories/components/date-field/date-field.json Adds Date field component metadata (tag name/selector, status).

Click a day or focus it with the keyboard and press `Enter` / `Space` to select it. Selecting a date emits an `sl-change` event.

### Navigating months and years
Use the navigation buttons in the header, or use `Page Up` / `Page Down` (and `Shift + Page Up` / `Shift + Page Down`) to move between months and years from the keyboard.
Comment on lines +21 to +23
|Page Up/Down| Moves focus to the same day in the previous or next month. |
|Shift + Page Up/Down| Moves focus to the same day in the previous or next year. |
|Home/End| Moves focus to the first or last day of the current week. |
Comment on lines +23 to +25
|Page Up/Down (in calendar)| Moves focus to the same day in the previous or next month. |
|Shift + Page Up/Down (in calendar)| Moves focus to the same day in the previous or next year. |
|Home/End (in calendar)| Moves focus to the first or last day of the current month. |
Comment on lines +92 to +94
### Free Typing (Default)
Users can type any valid date matching the locale-aware format. The component validates for format, parsability, and the optional `min` / `max` range when the field loses focus.

The Calendar may not be the best choice in the following scenarios:

### Quick, known date entry
When users already know the exact date and just need to type it (for example a birth date), prefer the [Date Field](/categories/components/date-field/usage) which combines free typing with a popover calendar.
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.

[Calendar] Document component on the documentation website [Date field] Document component on the documentation website

2 participants