@commercetools/nimbus-mcp 0.1.0 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +63 -14
- package/data/docs/route-manifest.json +10998 -0
- package/data/docs/routes/components-accessibility-visually-hidden.json +388 -0
- package/data/docs/routes/components-accessibility.json +34 -0
- package/data/docs/routes/components-buttons-button.json +715 -0
- package/data/docs/routes/components-buttons-icon-button.json +852 -0
- package/data/docs/routes/components-buttons-icon-toggle-button.json +594 -0
- package/data/docs/routes/components-buttons-split-button.json +670 -0
- package/data/docs/routes/components-buttons-toggle-button-group.json +722 -0
- package/data/docs/routes/components-buttons-toggle-button.json +689 -0
- package/data/docs/routes/components-buttons.json +36 -0
- package/data/docs/routes/components-data-display-badge.json +555 -0
- package/data/docs/routes/components-data-display-card.json +338 -0
- package/data/docs/routes/components-data-display-data-table.json +855 -0
- package/data/docs/routes/components-data-display-draggable-list.json +596 -0
- package/data/docs/routes/components-data-display-table.json +472 -0
- package/data/docs/routes/components-data-display-tag-group.json +535 -0
- package/data/docs/routes/components-data-display.json +34 -0
- package/data/docs/routes/components-feedback-alert.json +696 -0
- package/data/docs/routes/components-feedback-dialog.json +682 -0
- package/data/docs/routes/components-feedback-drawer.json +600 -0
- package/data/docs/routes/components-feedback-loading-spinner.json +415 -0
- package/data/docs/routes/components-feedback-progress-bar.json +661 -0
- package/data/docs/routes/components-feedback-toast.json +1040 -0
- package/data/docs/routes/components-feedback-tooltip.json +510 -0
- package/data/docs/routes/components-feedback.json +34 -0
- package/data/docs/routes/components-forms-field-errors.json +557 -0
- package/data/docs/routes/components-forms-form-field.json +848 -0
- package/data/docs/routes/components-forms-group.json +427 -0
- package/data/docs/routes/components-forms-localized-field.json +770 -0
- package/data/docs/routes/components-forms.json +37 -0
- package/data/docs/routes/components-inputs-calendar.json +611 -0
- package/data/docs/routes/components-inputs-checkbox.json +774 -0
- package/data/docs/routes/components-inputs-combo-box.json +761 -0
- package/data/docs/routes/components-inputs-date-input.json +628 -0
- package/data/docs/routes/components-inputs-date-picker.json +709 -0
- package/data/docs/routes/components-inputs-date-range-picker.json +599 -0
- package/data/docs/routes/components-inputs-money-input.json +721 -0
- package/data/docs/routes/components-inputs-multiline-text-input.json +611 -0
- package/data/docs/routes/components-inputs-number-input.json +647 -0
- package/data/docs/routes/components-inputs-password-input.json +576 -0
- package/data/docs/routes/components-inputs-radio-input.json +583 -0
- package/data/docs/routes/components-inputs-range-calendar.json +607 -0
- package/data/docs/routes/components-inputs-rich-text-input.json +599 -0
- package/data/docs/routes/components-inputs-scoped-search-input.json +570 -0
- package/data/docs/routes/components-inputs-search-input.json +588 -0
- package/data/docs/routes/components-inputs-select-input.json +960 -0
- package/data/docs/routes/components-inputs-switch.json +720 -0
- package/data/docs/routes/components-inputs-text-input.json +566 -0
- package/data/docs/routes/components-inputs-time-input.json +775 -0
- package/data/docs/routes/components-inputs.json +34 -0
- package/data/docs/routes/components-layout-box.json +501 -0
- package/data/docs/routes/components-layout-defaultpage.json +748 -0
- package/data/docs/routes/components-layout-flex.json +587 -0
- package/data/docs/routes/components-layout-grid.json +393 -0
- package/data/docs/routes/components-layout-modalpage.json +716 -0
- package/data/docs/routes/components-layout-pagecontent.json +673 -0
- package/data/docs/routes/components-layout-scrollarea.json +428 -0
- package/data/docs/routes/components-layout-separator.json +461 -0
- package/data/docs/routes/components-layout-simple-grid.json +519 -0
- package/data/docs/routes/components-layout-spacer.json +573 -0
- package/data/docs/routes/components-layout-stack.json +481 -0
- package/data/docs/routes/components-layout.json +34 -0
- package/data/docs/routes/components-media-avatar.json +427 -0
- package/data/docs/routes/components-media-icon.json +663 -0
- package/data/docs/routes/components-media-image.json +511 -0
- package/data/docs/routes/components-media-inline-svg.json +586 -0
- package/data/docs/routes/components-media.json +34 -0
- package/data/docs/routes/components-navigation-accordion.json +643 -0
- package/data/docs/routes/components-navigation-collapsible-motion.json +628 -0
- package/data/docs/routes/components-navigation-link.json +554 -0
- package/data/docs/routes/components-navigation-menu.json +546 -0
- package/data/docs/routes/components-navigation-pagination.json +502 -0
- package/data/docs/routes/components-navigation-steps.json +629 -0
- package/data/docs/routes/components-navigation-tabnav.json +546 -0
- package/data/docs/routes/components-navigation-tabs.json +635 -0
- package/data/docs/routes/components-navigation-toolbar.json +549 -0
- package/data/docs/routes/components-navigation.json +34 -0
- package/data/docs/routes/components-typography-code.json +39 -0
- package/data/docs/routes/components-typography-heading.json +402 -0
- package/data/docs/routes/components-typography-kbd.json +399 -0
- package/data/docs/routes/components-typography-list.json +593 -0
- package/data/docs/routes/components-typography-text.json +444 -0
- package/data/docs/routes/components-typography.json +34 -0
- package/data/docs/routes/components-utilities-nimbus-i18n-provider.json +295 -0
- package/data/docs/routes/components-utilities-nimbus-provider.json +663 -0
- package/data/docs/routes/components-utilities.json +34 -0
- package/data/docs/routes/components.json +33 -0
- package/data/docs/routes/home-contribute-adrs-adr0001-consumer-component-apis.json +314 -0
- package/data/docs/routes/home-contribute-adrs-adr0002-compound-component-extraction.json +160 -0
- package/data/docs/routes/home-contribute-adrs-adr0003-component-lifecycle-states.json +460 -0
- package/data/docs/routes/home-contribute-adrs.json +205 -0
- package/data/docs/routes/home-contribute-development-setup.json +213 -0
- package/data/docs/routes/home-contribute-stats.json +36 -0
- package/data/docs/routes/home-contribute.json +36 -0
- package/data/docs/routes/home-design-tokens-aspect-ratios.json +36 -0
- package/data/docs/routes/home-design-tokens-borders.json +35 -0
- package/data/docs/routes/home-design-tokens-colors.json +157 -0
- package/data/docs/routes/home-design-tokens-other-animations.json +119 -0
- package/data/docs/routes/home-design-tokens-other-blurs.json +36 -0
- package/data/docs/routes/home-design-tokens-other-breakpoints.json +61 -0
- package/data/docs/routes/home-design-tokens-other-cursors.json +36 -0
- package/data/docs/routes/home-design-tokens-other-z-indices.json +39 -0
- package/data/docs/routes/home-design-tokens-other.json +35 -0
- package/data/docs/routes/home-design-tokens-radii.json +59 -0
- package/data/docs/routes/home-design-tokens-shadows.json +57 -0
- package/data/docs/routes/home-design-tokens-sizes.json +137 -0
- package/data/docs/routes/home-design-tokens-spacing.json +36 -0
- package/data/docs/routes/home-design-tokens-typography.json +184 -0
- package/data/docs/routes/home-design-tokens.json +34 -0
- package/data/docs/routes/home-getting-started-core-concepts.json +301 -0
- package/data/docs/routes/home-getting-started-installation.json +621 -0
- package/data/docs/routes/home-getting-started-mcp-server-overview.json +139 -0
- package/data/docs/routes/home-getting-started-mcp-server-setup.json +316 -0
- package/data/docs/routes/home-getting-started-release-process.json +294 -0
- package/data/docs/routes/home-getting-started-testing-setup.json +296 -0
- package/data/docs/routes/home-playground-markdown.json +638 -0
- package/data/docs/routes/home-playground-toc.json +169 -0
- package/data/docs/routes/home-playground.json +34 -0
- package/data/docs/routes/home-style-props-background.json +236 -0
- package/data/docs/routes/home-style-props-border.json +310 -0
- package/data/docs/routes/home-style-props-display.json +120 -0
- package/data/docs/routes/home-style-props-effects.json +116 -0
- package/data/docs/routes/home-style-props-filters.json +396 -0
- package/data/docs/routes/home-style-props-flex-and-grid.json +496 -0
- package/data/docs/routes/home-style-props-interactivity.json +356 -0
- package/data/docs/routes/home-style-props-layout.json +422 -0
- package/data/docs/routes/home-style-props-list.json +116 -0
- package/data/docs/routes/home-style-props-sizing.json +244 -0
- package/data/docs/routes/home-style-props-spacing.json +228 -0
- package/data/docs/routes/home-style-props-svg.json +96 -0
- package/data/docs/routes/home-style-props-tables.json +116 -0
- package/data/docs/routes/home-style-props-transforms.json +216 -0
- package/data/docs/routes/home-style-props-transitions.json +216 -0
- package/data/docs/routes/home-style-props-typography.json +536 -0
- package/data/docs/routes/home-style-props.json +33 -0
- package/data/docs/routes/home.json +32 -0
- package/data/docs/routes/hooks-usecopytoclipboard.json +76 -0
- package/data/docs/routes/hooks-usehotkeys.json +117 -0
- package/data/docs/routes/hooks.json +33 -0
- package/data/docs/routes/icons.json +32 -0
- package/data/docs/routes/patterns-fields-date-range-picker-field.json +393 -0
- package/data/docs/routes/patterns-fields-money-input-field.json +415 -0
- package/data/docs/routes/patterns-fields-multiline-text-input-field.json +404 -0
- package/data/docs/routes/patterns-fields-number-input-field.json +470 -0
- package/data/docs/routes/patterns-fields-password-input-field.json +319 -0
- package/data/docs/routes/patterns-fields-search-input-field.json +382 -0
- package/data/docs/routes/patterns-fields-text-input-field.json +404 -0
- package/data/docs/routes/patterns-fields.json +78 -0
- package/data/docs/routes/patterns.json +34 -0
- package/data/docs/search-index.json +1 -0
- package/data/docs/types/Accordion.json +12 -0
- package/data/docs/types/AccordionContent.json +286 -0
- package/data/docs/types/AccordionHeader.json +891 -0
- package/data/docs/types/AccordionHeaderRightContent.json +27 -0
- package/data/docs/types/AccordionItem.json +242 -0
- package/data/docs/types/AccordionRoot.json +162 -0
- package/data/docs/types/Alert.json +12 -0
- package/data/docs/types/AlertActions.json +11 -0
- package/data/docs/types/AlertDescription.json +118 -0
- package/data/docs/types/AlertDismissButton.json +937 -0
- package/data/docs/types/AlertRoot.json +42 -0
- package/data/docs/types/AlertTitle.json +118 -0
- package/data/docs/types/Avatar.json +125 -0
- package/data/docs/types/Badge.json +64 -0
- package/data/docs/types/Body.json +67 -0
- package/data/docs/types/Box.json +85 -0
- package/data/docs/types/Button.json +1015 -0
- package/data/docs/types/Calendar.json +565 -0
- package/data/docs/types/Caption.json +67 -0
- package/data/docs/types/Card.json +12 -0
- package/data/docs/types/CardContent.json +27 -0
- package/data/docs/types/CardHeader.json +27 -0
- package/data/docs/types/CardRoot.json +106 -0
- package/data/docs/types/Cell.json +227 -0
- package/data/docs/types/Checkbox.json +897 -0
- package/data/docs/types/Code.json +112 -0
- package/data/docs/types/CollapsibleMotionContent.json +35 -0
- package/data/docs/types/CollapsibleMotionRoot.json +99 -0
- package/data/docs/types/CollapsibleMotionTrigger.json +71 -0
- package/data/docs/types/Column.json +101 -0
- package/data/docs/types/ColumnGroup.json +101 -0
- package/data/docs/types/ColumnHeader.json +193 -0
- package/data/docs/types/ComboBoxListBox.json +751 -0
- package/data/docs/types/ComboBoxOption.json +672 -0
- package/data/docs/types/ComboBoxPopover.json +786 -0
- package/data/docs/types/ComboBoxRoot.json +747 -0
- package/data/docs/types/ComboBoxSection.json +277 -0
- package/data/docs/types/ComboBoxTrigger.json +70 -0
- package/data/docs/types/Content.json +33 -0
- package/data/docs/types/DataTable.json +596 -0
- package/data/docs/types/DataTableBody.json +223 -0
- package/data/docs/types/DataTableFooter.json +27 -0
- package/data/docs/types/DataTableHeader.json +269 -0
- package/data/docs/types/DataTableManager.json +11 -0
- package/data/docs/types/DataTableRoot.json +590 -0
- package/data/docs/types/DataTableTable.json +271 -0
- package/data/docs/types/DateInput.json +792 -0
- package/data/docs/types/DatePicker.json +700 -0
- package/data/docs/types/DateRangePicker.json +936 -0
- package/data/docs/types/DateRangePickerField.json +1047 -0
- package/data/docs/types/DefaultPage.json +12 -0
- package/data/docs/types/DefaultPageActions.json +27 -0
- package/data/docs/types/DefaultPageBackLink.json +213 -0
- package/data/docs/types/DefaultPageContent.json +27 -0
- package/data/docs/types/DefaultPageFooter.json +27 -0
- package/data/docs/types/DefaultPageHeader.json +27 -0
- package/data/docs/types/DefaultPageRoot.json +106 -0
- package/data/docs/types/DefaultPageSubtitle.json +27 -0
- package/data/docs/types/DefaultPageTabNav.json +28 -0
- package/data/docs/types/DefaultPageTitle.json +27 -0
- package/data/docs/types/DialogBody.json +27 -0
- package/data/docs/types/DialogCloseTrigger.json +939 -0
- package/data/docs/types/DialogContent.json +27 -0
- package/data/docs/types/DialogFooter.json +27 -0
- package/data/docs/types/DialogHeader.json +27 -0
- package/data/docs/types/DialogRoot.json +138 -0
- package/data/docs/types/DialogTitle.json +27 -0
- package/data/docs/types/DialogTrigger.json +80 -0
- package/data/docs/types/DraggableList.json +12 -0
- package/data/docs/types/DraggableListField.json +894 -0
- package/data/docs/types/DraggableListItem.json +574 -0
- package/data/docs/types/DraggableListRoot.json +745 -0
- package/data/docs/types/Drawer.json +12 -0
- package/data/docs/types/DrawerBody.json +27 -0
- package/data/docs/types/DrawerCloseTrigger.json +939 -0
- package/data/docs/types/DrawerContent.json +27 -0
- package/data/docs/types/DrawerFooter.json +27 -0
- package/data/docs/types/DrawerHeader.json +27 -0
- package/data/docs/types/DrawerRoot.json +142 -0
- package/data/docs/types/DrawerTitle.json +27 -0
- package/data/docs/types/DrawerTrigger.json +80 -0
- package/data/docs/types/FieldErrors.getBuiltInMessage.json +11 -0
- package/data/docs/types/FieldErrors.getCustomMessage.json +9 -0
- package/data/docs/types/FieldErrors.json +109 -0
- package/data/docs/types/Flex.json +238 -0
- package/data/docs/types/Footer.json +67 -0
- package/data/docs/types/FormFieldDescription.json +11 -0
- package/data/docs/types/FormFieldError.json +11 -0
- package/data/docs/types/FormFieldInfoBox.json +27 -0
- package/data/docs/types/FormFieldInput.json +11 -0
- package/data/docs/types/FormFieldLabel.json +11 -0
- package/data/docs/types/FormFieldRoot.json +148 -0
- package/data/docs/types/Grid.json +253 -0
- package/data/docs/types/GridProps.json +11 -0
- package/data/docs/types/Group.json +143 -0
- package/data/docs/types/Header.json +67 -0
- package/data/docs/types/Heading.json +109 -0
- package/data/docs/types/Icon.json +112 -0
- package/data/docs/types/IconButton.json +1019 -0
- package/data/docs/types/IconToggleButton.json +787 -0
- package/data/docs/types/Image.json +373 -0
- package/data/docs/types/Indicator.json +67 -0
- package/data/docs/types/InlineSvg.json +98 -0
- package/data/docs/types/Item.json +67 -0
- package/data/docs/types/Kbd.json +118 -0
- package/data/docs/types/Link.json +380 -0
- package/data/docs/types/List.json +12 -0
- package/data/docs/types/ListIndicator.json +70 -0
- package/data/docs/types/ListItem.json +70 -0
- package/data/docs/types/ListRoot.json +124 -0
- package/data/docs/types/LoadingSpinner.json +87 -0
- package/data/docs/types/LocalizedField.json +460 -0
- package/data/docs/types/LocalizedStringFormatter.json +9 -0
- package/data/docs/types/MakeElementFocusable.json +196 -0
- package/data/docs/types/MenuContent.json +111 -0
- package/data/docs/types/MenuItem.json +671 -0
- package/data/docs/types/MenuRoot.json +670 -0
- package/data/docs/types/MenuSection.json +364 -0
- package/data/docs/types/MenuSubmenu.json +111 -0
- package/data/docs/types/MenuSubmenuTrigger.json +67 -0
- package/data/docs/types/MenuTrigger.json +906 -0
- package/data/docs/types/ModalPage.json +12 -0
- package/data/docs/types/ModalPageActions.json +27 -0
- package/data/docs/types/ModalPageContent.json +27 -0
- package/data/docs/types/ModalPageFooter.json +27 -0
- package/data/docs/types/ModalPageHeader.json +27 -0
- package/data/docs/types/ModalPageRoot.json +87 -0
- package/data/docs/types/ModalPageSubtitle.json +27 -0
- package/data/docs/types/ModalPageTabNav.json +28 -0
- package/data/docs/types/ModalPageTitle.json +27 -0
- package/data/docs/types/ModalPageTopBar.json +57 -0
- package/data/docs/types/MoneyInput.isEmpty.json +40 -0
- package/data/docs/types/MoneyInput.json +282 -0
- package/data/docs/types/MoneyInputField.json +379 -0
- package/data/docs/types/MoneyInputFieldProps.json +9 -0
- package/data/docs/types/MultilineTextInput.json +1194 -0
- package/data/docs/types/MultilineTextInputField.json +1269 -0
- package/data/docs/types/MultilineTextInputFieldProps.json +9 -0
- package/data/docs/types/NimbusI18nProvider.json +42 -0
- package/data/docs/types/NimbusI18nProviderProps.json +9 -0
- package/data/docs/types/NimbusProvider.json +270 -0
- package/data/docs/types/NumberInput.json +952 -0
- package/data/docs/types/NumberInputField.json +1004 -0
- package/data/docs/types/NumberInputFieldProps.json +9 -0
- package/data/docs/types/PageContent.json +11 -0
- package/data/docs/types/PageContentColumn.json +99 -0
- package/data/docs/types/PageContentRoot.json +114 -0
- package/data/docs/types/Pagination.json +159 -0
- package/data/docs/types/PasswordInput.json +1120 -0
- package/data/docs/types/PasswordInputField.json +1216 -0
- package/data/docs/types/PasswordInputFieldProps.json +9 -0
- package/data/docs/types/ProgressBar.json +280 -0
- package/data/docs/types/RadioInputOption.json +550 -0
- package/data/docs/types/RadioInputRoot.json +514 -0
- package/data/docs/types/RangeCalendar.json +618 -0
- package/data/docs/types/RichTextInput.json +134 -0
- package/data/docs/types/Root.json +122 -0
- package/data/docs/types/Row.json +67 -0
- package/data/docs/types/ScopedSearchInput.isEmpty.json +40 -0
- package/data/docs/types/ScopedSearchInput.json +253 -0
- package/data/docs/types/ScrollArea.json +179 -0
- package/data/docs/types/ScrollAreaElementIds.json +9 -0
- package/data/docs/types/ScrollAreaProps.json +9 -0
- package/data/docs/types/SearchInput.json +1165 -0
- package/data/docs/types/SearchInputField.json +1240 -0
- package/data/docs/types/Select.json +12 -0
- package/data/docs/types/SelectOption.json +572 -0
- package/data/docs/types/SelectOptionGroup.json +215 -0
- package/data/docs/types/SelectOptions.json +693 -0
- package/data/docs/types/SelectRoot.json +926 -0
- package/data/docs/types/Separator.json +65 -0
- package/data/docs/types/SimpleGrid.json +291 -0
- package/data/docs/types/Spacer.json +27 -0
- package/data/docs/types/SpacerProps.json +9 -0
- package/data/docs/types/SplitButton.json +203 -0
- package/data/docs/types/Stack.json +144 -0
- package/data/docs/types/Steps.json +12 -0
- package/data/docs/types/StepsChangeDetails.json +9 -0
- package/data/docs/types/StepsCompletedContent.json +28 -0
- package/data/docs/types/StepsCompletedContentProps.json +9 -0
- package/data/docs/types/StepsContent.json +43 -0
- package/data/docs/types/StepsContentProps.json +9 -0
- package/data/docs/types/StepsDescription.json +28 -0
- package/data/docs/types/StepsDescriptionProps.json +9 -0
- package/data/docs/types/StepsIndicator.json +28 -0
- package/data/docs/types/StepsIndicatorProps.json +9 -0
- package/data/docs/types/StepsItem.json +43 -0
- package/data/docs/types/StepsItemProps.json +9 -0
- package/data/docs/types/StepsList.json +28 -0
- package/data/docs/types/StepsListProps.json +9 -0
- package/data/docs/types/StepsNextTrigger.json +62 -0
- package/data/docs/types/StepsNextTriggerProps.json +9 -0
- package/data/docs/types/StepsNumber.json +28 -0
- package/data/docs/types/StepsNumberProps.json +9 -0
- package/data/docs/types/StepsPrevTrigger.json +62 -0
- package/data/docs/types/StepsPrevTriggerProps.json +9 -0
- package/data/docs/types/StepsRoot.json +183 -0
- package/data/docs/types/StepsRootProps.json +11 -0
- package/data/docs/types/StepsSeparator.json +28 -0
- package/data/docs/types/StepsSeparatorProps.json +9 -0
- package/data/docs/types/StepsStatus.json +57 -0
- package/data/docs/types/StepsStatusProps.json +9 -0
- package/data/docs/types/StepsTitle.json +28 -0
- package/data/docs/types/StepsTitleProps.json +9 -0
- package/data/docs/types/StepsTrigger.json +47 -0
- package/data/docs/types/StepsTriggerProps.json +9 -0
- package/data/docs/types/Switch.json +371 -0
- package/data/docs/types/TabListProps.json +9 -0
- package/data/docs/types/TabNav.json +12 -0
- package/data/docs/types/TabNavItem.json +300 -0
- package/data/docs/types/TabNavItemProps.json +9 -0
- package/data/docs/types/TabNavProps.json +9 -0
- package/data/docs/types/TabNavRoot.json +80 -0
- package/data/docs/types/TabPanelProps.json +9 -0
- package/data/docs/types/TabPanelsProps.json +9 -0
- package/data/docs/types/TabProps.json +9 -0
- package/data/docs/types/Table.json +9 -0
- package/data/docs/types/TableBody.json +67 -0
- package/data/docs/types/TableBodyProps.json +9 -0
- package/data/docs/types/TableCaption.json +67 -0
- package/data/docs/types/TableCaptionProps.json +9 -0
- package/data/docs/types/TableCell.json +227 -0
- package/data/docs/types/TableCellProps.json +9 -0
- package/data/docs/types/TableColumn.json +101 -0
- package/data/docs/types/TableColumnGroup.json +101 -0
- package/data/docs/types/TableColumnGroupProps.json +9 -0
- package/data/docs/types/TableColumnHeader.json +193 -0
- package/data/docs/types/TableColumnHeaderProps.json +9 -0
- package/data/docs/types/TableColumnProps.json +9 -0
- package/data/docs/types/TableFooter.json +67 -0
- package/data/docs/types/TableFooterProps.json +9 -0
- package/data/docs/types/TableHeader.json +67 -0
- package/data/docs/types/TableHeaderProps.json +9 -0
- package/data/docs/types/TableRoot.json +365 -0
- package/data/docs/types/TableRootProps.json +12 -0
- package/data/docs/types/TableRow.json +67 -0
- package/data/docs/types/TableRowProps.json +9 -0
- package/data/docs/types/TableScrollArea.json +82 -0
- package/data/docs/types/TableScrollAreaProps.json +9 -0
- package/data/docs/types/Tabs.json +12 -0
- package/data/docs/types/TabsList.json +110 -0
- package/data/docs/types/TabsPanel.json +112 -0
- package/data/docs/types/TabsPanels.json +108 -0
- package/data/docs/types/TabsRoot.json +211 -0
- package/data/docs/types/TabsTab.json +174 -0
- package/data/docs/types/TagGroup.json +12 -0
- package/data/docs/types/TagGroupRoot.json +306 -0
- package/data/docs/types/TagGroupTag.json +595 -0
- package/data/docs/types/TagGroupTagList.json +166 -0
- package/data/docs/types/Text.json +119 -0
- package/data/docs/types/TextInput.json +1156 -0
- package/data/docs/types/TextInputField.json +1263 -0
- package/data/docs/types/TimeInput.json +752 -0
- package/data/docs/types/ToastAction.json +9 -0
- package/data/docs/types/ToastManagerApi.json +9 -0
- package/data/docs/types/ToastOptions.json +9 -0
- package/data/docs/types/ToastOutlet.json +12 -0
- package/data/docs/types/ToastPlacement.json +9 -0
- package/data/docs/types/ToastPromiseOptions.json +9 -0
- package/data/docs/types/ToastType.json +9 -0
- package/data/docs/types/ToastVariant.json +9 -0
- package/data/docs/types/ToggleButton.json +789 -0
- package/data/docs/types/ToggleButtonGroup.json +9 -0
- package/data/docs/types/ToggleButtonGroupButton.json +331 -0
- package/data/docs/types/ToggleButtonGroupRoot.json +269 -0
- package/data/docs/types/Toolbar.json +176 -0
- package/data/docs/types/Tooltip.json +12 -0
- package/data/docs/types/TooltipContent.json +372 -0
- package/data/docs/types/TooltipRoot.json +179 -0
- package/data/docs/types/Trigger.json +69 -0
- package/data/docs/types/VisuallyHidden.json +93 -0
- package/data/docs/types/__object.json +12 -0
- package/data/docs/types/filters.json +11 -0
- package/data/docs/types/manifest.json +280 -0
- package/data/docs/types/toast.json +234 -0
- package/data/docs/types/useColorMode.json +13 -0
- package/data/docs/types/useColorModeValue.json +13 -0
- package/data/docs/types/useColorScheme.json +12 -0
- package/data/docs/types/useLocalizedStringFormatter.json +14 -0
- package/data/icons.json +21940 -0
- package/data/tokens.json +40061 -0
- package/dist/index.js +2516 -17
- package/package.json +25 -6
- package/dist/data-loader.d.ts +0 -102
- package/dist/data-loader.js +0 -104
- package/dist/index.d.ts +0 -13
- package/dist/server.d.ts +0 -9
- package/dist/server.js +0 -22
- package/dist/server.spec.d.ts +0 -1
- package/dist/server.spec.js +0 -69
- package/dist/tools/list-components.d.ts +0 -9
- package/dist/tools/list-components.js +0 -42
- package/dist/types.d.ts +0 -28
- package/dist/types.js +0 -4
- package/src/data-loader.ts +0 -226
- package/src/index.ts +0 -29
- package/src/server.spec.ts +0 -86
- package/src/server.ts +0 -28
- package/src/tools/list-components.ts +0 -49
- package/src/types.ts +0 -31
- package/tsconfig.json +0 -14
- package/vitest.config.ts +0 -9
|
@@ -0,0 +1,628 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"id": "Components-DateInput",
|
|
4
|
+
"title": "Date input",
|
|
5
|
+
"exportName": "DateInput",
|
|
6
|
+
"description": "A date input component allows users to enter a specific date.",
|
|
7
|
+
"lifecycleState": "Stable",
|
|
8
|
+
"order": 999,
|
|
9
|
+
"repoPath": "packages/nimbus/src/components/date-input/date-input.mdx",
|
|
10
|
+
"menu": [
|
|
11
|
+
"Components",
|
|
12
|
+
"Inputs",
|
|
13
|
+
"Date input"
|
|
14
|
+
],
|
|
15
|
+
"route": "components/inputs/date-input",
|
|
16
|
+
"tags": [
|
|
17
|
+
"component",
|
|
18
|
+
"date",
|
|
19
|
+
"calendar"
|
|
20
|
+
],
|
|
21
|
+
"toc": [
|
|
22
|
+
{
|
|
23
|
+
"value": "Overview",
|
|
24
|
+
"href": "#overview",
|
|
25
|
+
"depth": 2,
|
|
26
|
+
"numbering": [
|
|
27
|
+
1,
|
|
28
|
+
1
|
|
29
|
+
],
|
|
30
|
+
"parent": "root"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"value": "Resources",
|
|
34
|
+
"href": "#resources",
|
|
35
|
+
"depth": 3,
|
|
36
|
+
"numbering": [
|
|
37
|
+
1,
|
|
38
|
+
1,
|
|
39
|
+
1
|
|
40
|
+
],
|
|
41
|
+
"parent": "root"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"value": "Variables",
|
|
45
|
+
"href": "#variables",
|
|
46
|
+
"depth": 2,
|
|
47
|
+
"numbering": [
|
|
48
|
+
1,
|
|
49
|
+
2
|
|
50
|
+
],
|
|
51
|
+
"parent": "root"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"value": "Visual options",
|
|
55
|
+
"href": "#visual-options",
|
|
56
|
+
"depth": 3,
|
|
57
|
+
"numbering": [
|
|
58
|
+
1,
|
|
59
|
+
2,
|
|
60
|
+
1
|
|
61
|
+
],
|
|
62
|
+
"parent": "root"
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"layout": "app-frame",
|
|
66
|
+
"tabs": [
|
|
67
|
+
{
|
|
68
|
+
"key": "overview",
|
|
69
|
+
"title": "Overview",
|
|
70
|
+
"order": 0
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"key": "guidelines",
|
|
74
|
+
"title": "Guidelines",
|
|
75
|
+
"order": 2
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"key": "dev",
|
|
79
|
+
"title": "Implementation",
|
|
80
|
+
"order": 3
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"key": "a11y",
|
|
84
|
+
"title": "Accessibility",
|
|
85
|
+
"order": 4
|
|
86
|
+
}
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
"mdx": "\n## Overview\n\nThe date input field uses a conventional date format, such as mm/dd/yyyy, which\nis localized based on the user's region. Users can type a date directly into the\nfield. The component automatically formats the input as the user types.\n\n### Resources\n\nDeep dive into implementation details and access the Nimbus design library.\n\n[Figma Link](https://www.figma.com/design/AvtPX6g7OGGCRvNlatGOIY?node-id=5818-15933#1436729216)\n[Storybook Link](https://nimbus-storybook.vercel.app/?path=/docs/components-date-dateinput--docs)\n\n## Variables\n\nGet familiar with the features.\n\n### Visual options\n\n**Medium**\n\n```jsx live\nconst App = () => <DateInput aria-label=\"Enter a date\"/>\n```\n\n**Small**\n\n```jsx live\nconst App = () => <DateInput size=\"sm\" aria-label=\"Enter a date\"/>\n```\n",
|
|
90
|
+
"views": {
|
|
91
|
+
"overview": {
|
|
92
|
+
"mdx": "\n## Overview\n\nThe date input field uses a conventional date format, such as mm/dd/yyyy, which\nis localized based on the user's region. Users can type a date directly into the\nfield. The component automatically formats the input as the user types.\n\n### Resources\n\nDeep dive into implementation details and access the Nimbus design library.\n\n[Figma Link](https://www.figma.com/design/AvtPX6g7OGGCRvNlatGOIY?node-id=5818-15933#1436729216)\n[Storybook Link](https://nimbus-storybook.vercel.app/?path=/docs/components-date-dateinput--docs)\n\n## Variables\n\nGet familiar with the features.\n\n### Visual options\n\n**Medium**\n\n```jsx live\nconst App = () => <DateInput aria-label=\"Enter a date\"/>\n```\n\n**Small**\n\n```jsx live\nconst App = () => <DateInput size=\"sm\" aria-label=\"Enter a date\"/>\n```\n",
|
|
93
|
+
"toc": [
|
|
94
|
+
{
|
|
95
|
+
"value": "Overview",
|
|
96
|
+
"href": "#overview",
|
|
97
|
+
"depth": 2,
|
|
98
|
+
"numbering": [
|
|
99
|
+
1,
|
|
100
|
+
1
|
|
101
|
+
],
|
|
102
|
+
"parent": "root"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"value": "Resources",
|
|
106
|
+
"href": "#resources",
|
|
107
|
+
"depth": 3,
|
|
108
|
+
"numbering": [
|
|
109
|
+
1,
|
|
110
|
+
1,
|
|
111
|
+
1
|
|
112
|
+
],
|
|
113
|
+
"parent": "root"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"value": "Variables",
|
|
117
|
+
"href": "#variables",
|
|
118
|
+
"depth": 2,
|
|
119
|
+
"numbering": [
|
|
120
|
+
1,
|
|
121
|
+
2
|
|
122
|
+
],
|
|
123
|
+
"parent": "root"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"value": "Visual options",
|
|
127
|
+
"href": "#visual-options",
|
|
128
|
+
"depth": 3,
|
|
129
|
+
"numbering": [
|
|
130
|
+
1,
|
|
131
|
+
2,
|
|
132
|
+
1
|
|
133
|
+
],
|
|
134
|
+
"parent": "root"
|
|
135
|
+
}
|
|
136
|
+
]
|
|
137
|
+
},
|
|
138
|
+
"a11y": {
|
|
139
|
+
"mdx": "\n## Accessibility\n\nAccessibility ensures that digital content and functionality are usable by\neveryone, including people with disabilities, by addressing visual, auditory,\ncognitive, and physical limitations.\n\n```jsx live\nconst App = () => (\n <DateInput aria-label=\"Enter a date\" />\n);\n```\n\n### Accessibility standards\n\n- Ensure the input field has a clear, descriptive label that is programmatically\n associated with the input element.\n- The component should be fully operable using a keyboard.\n- The focus order must be logical and predictable.\n- The component should be compatible with screen readers, announcing its\n purpose, state, and any validation errors.\n- Error messages should be clearly linked to the input field they refer to and\n be announced by screen readers.\n- Maintain sufficient color contrast for text and other visual elements to\n ensure readability.\n- The input field and any interactive elements should have large enough touch\n targets for mobile users.\n- The date format should align with the user's regional settings and be easily\n understandable.\n- Use appropriate autocomplete attributes, such as birthday, to assist users and\n improve form-filling.\n",
|
|
140
|
+
"toc": [
|
|
141
|
+
{
|
|
142
|
+
"value": "Accessibility",
|
|
143
|
+
"href": "#accessibility",
|
|
144
|
+
"depth": 2,
|
|
145
|
+
"numbering": [
|
|
146
|
+
1,
|
|
147
|
+
1
|
|
148
|
+
],
|
|
149
|
+
"parent": "root"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"value": "Accessibility standards",
|
|
153
|
+
"href": "#accessibility-standards",
|
|
154
|
+
"depth": 3,
|
|
155
|
+
"numbering": [
|
|
156
|
+
1,
|
|
157
|
+
1,
|
|
158
|
+
1
|
|
159
|
+
],
|
|
160
|
+
"parent": "root"
|
|
161
|
+
}
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
"dev": {
|
|
165
|
+
"mdx": "\n## Getting started\n\n### Import\n\n```tsx\nimport { DateInput, type DateInputProps } from '@commercetools/nimbus';\n```\n\n### Basic usage\n\nThe simplest implementation uses uncontrolled mode with an accessible label:\n\n```jsx live-dev\nconst App = () => (\n <DateInput aria-label=\"Enter a date\" />\n)\n```\n\n## Working with date values\n\nThe DateInput component relies on `@internationalized/date`'s date types for type-safe date handling. This library provides calendar-system-aware date representations that work correctly across different locales and time zones.\n\n### Date types\n\nThe library provides several date types, each with different levels of precision:\n\n```tsx\nimport { CalendarDate, CalendarDateTime, ZonedDateTime } from '@internationalized/date';\n\n// Date only (no time component)\nconst date = new CalendarDate(2025, 6, 15);\n\n// Date and time (no timezone)\nconst dateTime = new CalendarDateTime(2025, 6, 15, 14, 30, 0);\n\n// Date, time, and timezone\nconst zonedDateTime = new ZonedDateTime(\n 2025,\n 6,\n 15,\n 'America/New_York',\n -4 * 60 * 60 * 1000,\n 14,\n 30,\n 0\n);\n```\n\n### Creating date values\n\nUse the appropriate constructor based on the precision you need:\n\n```tsx\nimport { CalendarDate, CalendarDateTime } from '@internationalized/date';\n\n// For date-only inputs\nconst birthDate = new CalendarDate(1990, 5, 15);\n\n// For date and time inputs\nconst appointmentTime = new CalendarDateTime(2025, 12, 25, 10, 30, 0);\n```\n\n### Converting to strings\n\nUse the `toString()` method to convert date values to ISO 8601 format:\n\n```tsx\nconst date = new CalendarDate(2025, 6, 15);\ndate.toString(); // \"2025-06-15\"\n\nconst dateTime = new CalendarDateTime(2025, 6, 15, 14, 30, 0);\ndateTime.toString(); // \"2025-06-15T14:30:00\"\n```\n\n> [!TIP]\\\n> See [@internationalized/date documentation](https://react-spectrum.adobe.com/internationalized/date/) for complete API reference and advanced usage.\n\n## Usage examples\n\n### Size options\n\nThe `sm` and `md` size variants are available to match your interface density:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"column\" gap=\"400\">\n <DateInput size=\"sm\" aria-label=\"Small date input\" />\n <DateInput size=\"md\" aria-label=\"Medium date input\" />\n </Stack>\n)\n```\n\n### Visual variants\n\nChoose between `solid`, `ghost`, and `plain` variants to match your design context:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"column\" gap=\"400\">\n <DateInput variant=\"solid\" aria-label=\"Solid variant\" />\n <DateInput variant=\"ghost\" aria-label=\"Ghost variant\" />\n <DateInput variant=\"plain\" aria-label=\"Plain variant\" />\n </Stack>\n)\n```\n\n**Behavioral differences:**\n- `variant=\"solid\"`: Outlined input with background, suitable for forms\n- `variant=\"ghost\"`: Subtle background on hover, suitable for inline editing\n- `variant=\"plain\"`: No background or border, suitable for minimal interfaces\n\n### Leading and trailing elements\n\nAdd icons or interactive elements to enhance the input:\n\n```jsx live-dev\nconst App = () => {\n const [date, setDate] = useState(null);\n\n return (\n <Stack direction=\"column\" gap=\"400\">\n <DateInput\n leadingElement={<Icons.CalendarMonth />}\n aria-label=\"Date with calendar icon\"\n />\n <DateInput\n trailingElement={\n <IconButton\n size=\"xs\"\n variant=\"ghost\"\n aria-label=\"Clear date\"\n onPress={() => setDate(null)}\n >\n <Icons.Close />\n </IconButton>\n }\n value={date}\n onChange={setDate}\n aria-label=\"Date with clear button\"\n />\n <DateInput\n leadingElement={<Icons.Event />}\n trailingElement={<Icons.ArrowDropDown />}\n aria-label=\"Date with both icons\"\n />\n </Stack>\n );\n}\n```\n\n### Granularity control\n\nThe `granularity` prop controls which date/time segments are displayed:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"column\" gap=\"400\">\n <Stack direction=\"column\" gap=\"100\">\n <Text fontSize=\"sm\" fontWeight=\"600\">Day (date only)</Text>\n <DateInput\n granularity=\"day\"\n defaultValue={new CalendarDate(2025, 6, 15)}\n aria-label=\"Day granularity\"\n />\n </Stack>\n <Stack direction=\"column\" gap=\"100\">\n <Text fontSize=\"sm\" fontWeight=\"600\">Hour (date + hour)</Text>\n <DateInput\n granularity=\"hour\"\n defaultValue={new CalendarDateTime(2025, 6, 15, 14, 0, 0)}\n aria-label=\"Hour granularity\"\n />\n </Stack>\n <Stack direction=\"column\" gap=\"100\">\n <Text fontSize=\"sm\" fontWeight=\"600\">Minute (date + hour + minute)</Text>\n <DateInput\n granularity=\"minute\"\n defaultValue={new CalendarDateTime(2025, 6, 15, 14, 30, 0)}\n aria-label=\"Minute granularity\"\n />\n </Stack>\n <Stack direction=\"column\" gap=\"100\">\n <Text fontSize=\"sm\" fontWeight=\"600\">Second (full precision)</Text>\n <DateInput\n granularity=\"second\"\n defaultValue={new CalendarDateTime(2025, 6, 15, 14, 30, 45)}\n aria-label=\"Second granularity\"\n />\n </Stack>\n </Stack>\n)\n```\n\n### Hour cycle\n\nControl the time display format using the `hourCycle` prop when working with time values:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"column\" gap=\"400\">\n <Stack direction=\"column\" gap=\"100\">\n <Text fontSize=\"sm\" fontWeight=\"600\">12-hour format (2:30 PM)</Text>\n <DateInput\n defaultValue={new CalendarDateTime(2025, 6, 15, 14, 30, 0)}\n hourCycle={12}\n granularity=\"minute\"\n aria-label=\"12-hour format\"\n />\n </Stack>\n <Stack direction=\"column\" gap=\"100\">\n <Text fontSize=\"sm\" fontWeight=\"600\">24-hour format (14:30)</Text>\n <DateInput\n defaultValue={new CalendarDateTime(2025, 6, 15, 14, 30, 0)}\n hourCycle={24}\n granularity=\"minute\"\n aria-label=\"24-hour format\"\n />\n </Stack>\n </Stack>\n)\n```\n\n### Leading zeros\n\nControl whether single-digit values display with leading zeros:\n\n```jsx live-dev\nconst App = () => {\n const singleDigitDate = new CalendarDate(2025, 3, 5);\n\n return (\n <Stack direction=\"column\" gap=\"400\">\n <Stack direction=\"column\" gap=\"100\">\n <Text fontSize=\"sm\" fontWeight=\"600\">Default (locale-determined)</Text>\n <DateInput\n defaultValue={singleDigitDate}\n aria-label=\"Default leading zeros\"\n />\n </Stack>\n <Stack direction=\"column\" gap=\"100\">\n <Text fontSize=\"sm\" fontWeight=\"600\">Force leading zeros (05/03/2025)</Text>\n <DateInput\n defaultValue={singleDigitDate}\n shouldForceLeadingZeros={true}\n aria-label=\"With leading zeros\"\n />\n </Stack>\n <Stack direction=\"column\" gap=\"100\">\n <Text fontSize=\"sm\" fontWeight=\"600\">No leading zeros (5/3/2025)</Text>\n <DateInput\n defaultValue={singleDigitDate}\n shouldForceLeadingZeros={false}\n aria-label=\"Without leading zeros\"\n />\n </Stack>\n </Stack>\n );\n}\n```\n\n### Time zone handling\n\nWhen using `ZonedDateTime` values, control time zone display with the `hideTimeZone` prop:\n\n```jsx live-dev\nconst App = () => {\n const zonedDateTime = new ZonedDateTime(\n 2025,\n 6,\n 15,\n 'America/New_York',\n -4 * 60 * 60 * 1000,\n 14,\n 30,\n 0\n );\n\n return (\n <Stack direction=\"column\" gap=\"400\">\n <Stack direction=\"column\" gap=\"100\">\n <Text fontSize=\"sm\" fontWeight=\"600\">With time zone displayed</Text>\n <DateInput\n defaultValue={zonedDateTime}\n hideTimeZone={false}\n granularity=\"minute\"\n aria-label=\"Date with timezone\"\n />\n </Stack>\n <Stack direction=\"column\" gap=\"100\">\n <Text fontSize=\"sm\" fontWeight=\"600\">Time zone hidden</Text>\n <DateInput\n defaultValue={zonedDateTime}\n hideTimeZone={true}\n granularity=\"minute\"\n aria-label=\"Date without timezone\"\n />\n </Stack>\n </Stack>\n );\n}\n```\n\n### Placeholder values\n\nSet a starting point for keyboard input when the field is empty using `placeholderValue`:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"column\" gap=\"400\">\n <Stack direction=\"column\" gap=\"100\">\n <Text fontSize=\"sm\" fontWeight=\"600\">With placeholder (starts at 2025-06-15)</Text>\n <DateInput\n placeholderValue={new CalendarDate(2025, 6, 15)}\n aria-label=\"Date with placeholder\"\n />\n </Stack>\n <Stack direction=\"column\" gap=\"100\">\n <Text fontSize=\"sm\" fontWeight=\"600\">Without placeholder (starts at today)</Text>\n <DateInput aria-label=\"Date without placeholder\" />\n </Stack>\n </Stack>\n)\n```\n\n### Min/max validation\n\nRestrict date selection to a specific range using `minValue` and `maxValue`:\n\n```jsx live-dev\nconst App = () => {\n const [date, setDate] = useState(null);\n const minDate = new CalendarDate(2025, 6, 1);\n const maxDate = new CalendarDate(2025, 6, 30);\n \n const isInvalid = date && (\n date.compare(minDate) < 0 || \n date.compare(maxDate) > 0\n );\n\n return (\n <FormField.Root isInvalid={!!isInvalid}>\n <FormField.Label>Select a date in June 2025</FormField.Label>\n <FormField.Input>\n <DateInput\n value={date}\n onChange={setDate}\n minValue={minDate}\n maxValue={maxDate}\n aria-label=\"Date range validation\"\n />\n </FormField.Input>\n <FormField.Description>\n Valid range: June 1-30, 2025\n </FormField.Description>\n {isInvalid && (\n <FormField.Error>\n Date must be between {minDate.toString()} and {maxDate.toString()}\n </FormField.Error>\n )}\n </FormField.Root>\n );\n}\n```\n\n### Custom validation\n\nImplement custom validation logic beyond min/max constraints:\n\n```jsx live-dev\nconst App = () => {\n const [date, setDate] = useState(null);\n\n const isBusinessDay = (dateValue) => {\n if (!dateValue) return true;\n const dayOfWeek = dateValue.toDate('UTC').getDay();\n return dayOfWeek >= 1 && dayOfWeek <= 5;\n };\n\n const isInvalid = date && !isBusinessDay(date);\n\n return (\n <FormField.Root isInvalid={!!isInvalid}>\n <FormField.Label>Select a business day</FormField.Label>\n <FormField.Input>\n <DateInput\n value={date}\n onChange={setDate}\n defaultValue={new CalendarDate(2025, 6, 17)}\n aria-label=\"Business days only\"\n />\n </FormField.Input>\n <FormField.Description>\n Only Monday through Friday are allowed\n </FormField.Description>\n {isInvalid && (\n <FormField.Error>\n Please select a business day (Monday-Friday)\n </FormField.Error>\n )}\n <Text fontSize=\"sm\" mt=\"200\">\n Status: {date ? (isBusinessDay(date) ? '✅ Valid' : '❌ Invalid') : 'Not selected'}\n </Text>\n </FormField.Root>\n );\n}\n```\n\n### State variations\n\nDateInput supports disabled, read-only, required, and invalid states:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"column\" gap=\"400\">\n <Stack direction=\"column\" gap=\"100\">\n <Text fontSize=\"sm\" fontWeight=\"600\">Default</Text>\n <DateInput\n defaultValue={new CalendarDate(2025, 6, 15)}\n aria-label=\"Default state\"\n />\n </Stack>\n <Stack direction=\"column\" gap=\"100\">\n <Text fontSize=\"sm\" fontWeight=\"600\">Disabled</Text>\n <DateInput\n defaultValue={new CalendarDate(2025, 6, 15)}\n isDisabled\n aria-label=\"Disabled state\"\n />\n </Stack>\n <Stack direction=\"column\" gap=\"100\">\n <Text fontSize=\"sm\" fontWeight=\"600\">Read-only</Text>\n <DateInput\n defaultValue={new CalendarDate(2025, 6, 15)}\n isReadOnly\n aria-label=\"Read-only state\"\n />\n </Stack>\n <Stack direction=\"column\" gap=\"100\">\n <Text fontSize=\"sm\" fontWeight=\"600\">Required</Text>\n <DateInput\n isRequired\n aria-label=\"Required state\"\n />\n </Stack>\n <Stack direction=\"column\" gap=\"100\">\n <Text fontSize=\"sm\" fontWeight=\"600\">Invalid</Text>\n <DateInput\n defaultValue={new CalendarDate(2025, 6, 15)}\n isInvalid\n aria-label=\"Invalid state\"\n />\n </Stack>\n </Stack>\n)\n```\n\n### Uncontrolled mode\n\nFor simpler use cases, use uncontrolled mode with `defaultValue` and `onChange`:\n\n```jsx live-dev\nconst App = () => {\n const [displayValue, setDisplayValue] = useState('No date selected');\n\n return (\n <Stack direction=\"column\" gap=\"400\">\n <DateInput\n defaultValue={new CalendarDate(2025, 6, 15)}\n onChange={(value) => {\n setDisplayValue(value ? value.toString() : 'No date selected');\n }}\n aria-label=\"Uncontrolled date input\"\n />\n <Text fontSize=\"sm\">Selected: {displayValue}</Text>\n </Stack>\n );\n}\n```\n\nUse uncontrolled mode when you need to capture the selected date without managing state yourself.\n\n### Controlled mode\n\nFor scenarios requiring programmatic control or coordination with other components, use controlled mode:\n\n```jsx live-dev\nconst App = () => {\n const [value, setValue] = useState(new CalendarDate(2025, 6, 15));\n\n return (\n <Stack direction=\"column\" gap=\"400\">\n <DateInput\n value={value}\n onChange={setValue}\n aria-label=\"Controlled date input\"\n />\n <Text fontSize=\"sm\">\n {value ? `Selected: ${value.toString()}` : 'No selection'}\n </Text>\n <Stack direction=\"row\" gap=\"200\">\n <Button onPress={() => setValue(new CalendarDate(2025, 1, 1))}>\n Set to Jan 1\n </Button>\n <Button onPress={() => setValue(new CalendarDate(2025, 12, 31))}>\n Set to Dec 31\n </Button>\n <Button onPress={() => setValue(null)}>\n Clear\n </Button>\n </Stack>\n </Stack>\n );\n}\n```\n\nUse controlled mode when you need to:\n- Synchronize the value with external state\n- Validate or transform selections\n- Clear or programmatically set the value\n\n### Internationalization\n\nDateInput automatically adapts to different locales when wrapped with `NimbusI18nProvider`:\n\n```jsx live-dev\nconst App = () => {\n const [locale, setLocale] = useState('en-US');\n const dateValue = new CalendarDate(2025, 6, 15);\n\n return (\n <Stack direction=\"column\" gap=\"400\">\n <Stack direction=\"row\" gap=\"200\">\n <Button\n variant={locale === 'en-US' ? 'solid' : 'outline'}\n onPress={() => setLocale('en-US')}\n >\n English (US)\n </Button>\n <Button\n variant={locale === 'de-DE' ? 'solid' : 'outline'}\n onPress={() => setLocale('de-DE')}\n >\n German\n </Button>\n <Button\n variant={locale === 'ja-JP' ? 'solid' : 'outline'}\n onPress={() => setLocale('ja-JP')}\n >\n Japanese\n </Button>\n </Stack>\n <NimbusI18nProvider locale={locale}>\n <DateInput\n defaultValue={dateValue}\n aria-label=\"Localized date input\"\n />\n </NimbusI18nProvider>\n <Text fontSize=\"sm\">Current locale: {locale}</Text>\n </Stack>\n );\n}\n```\n\n## Component requirements\n\n### Date value requirements\n\nAll date values **must** use `@internationalized/date` types:\n- `CalendarDate` for date-only inputs (year, month, day)\n- `CalendarDateTime` for date and time without timezone\n- `ZonedDateTime` for date, time, and timezone information\n\n## Accessibility\n\nThe DateInput handles most accessibility requirements internally through React Aria's DateField. However, you must always associate an internationalized label with the component. Visual labels are preferable, and can be set by:\n\n- Wrapping the DateInput in a FormField (recommended for forms):\n\n```tsx\n<FormField.Root>\n <FormField.Label>Birth Date</FormField.Label>\n <FormField.Input>\n <DateInput />\n </FormField.Input>\n</FormField.Root>\n```\n\n- Associating a `<label>` element with the DateInput using `aria-labelledby`:\n\n```tsx\n<label id=\"label-id\">\n {msg.format(labelMessage)}\n</label>\n<DateInput aria-labelledby=\"label-id\" />\n```\n\nIf your design requires that the label should not be visible, the label should be set using the `aria-label` prop:\n\n```tsx\n<DateInput aria-label={msg.format(labelMessage)} />\n```\n\nIf your use case requires tracking and analytics for this component, it is good practice to add a **persistent**, **unique** id to the component:\n\n```tsx\nconst PERSISTENT_ID = \"example-date-input\";\n\nexport const Example = () => (\n <DateInput id={PERSISTENT_ID} aria-label=\"Enter date\" />\n);\n```\n\n#### Keyboard navigation\n\nThe component supports full keyboard interaction for navigating and editing date segments:\n- `Tab` / `Shift+Tab`: Move between date segments (day, month, year, hour, etc.)\n- `Arrow Up` / `Arrow Down`: Increment or decrement the focused segment\n- `Page Up` / `Page Down`: Increment or decrement the focused segment by larger steps\n- `Home` / `End`: Set segment to minimum or maximum value\n- `0-9`: Type digits to set segment value\n- `Backspace`: Clear the focused segment\n\n## API reference\n\n<PropsTable id=\"DateInput\" />\n\n## Common patterns\n\n### Date of birth input\n\nA common pattern for capturing user birth dates with validation:\n\n```jsx live-dev\nconst App = () => {\n const [birthDate, setBirthDate] = useState(null);\n const today = new CalendarDate(2025, 12, 2);\n const minDate = new CalendarDate(1900, 1, 1);\n \n const isInvalid = birthDate && (\n birthDate.compare(minDate) < 0 || \n birthDate.compare(today) > 0\n );\n\n return (\n <FormField.Root isInvalid={!!isInvalid}>\n <FormField.Label>Date of Birth</FormField.Label>\n <FormField.Input>\n <DateInput\n value={birthDate}\n onChange={setBirthDate}\n minValue={minDate}\n maxValue={today}\n placeholderValue={new CalendarDate(1990, 1, 1)}\n aria-label=\"Date of birth\"\n />\n </FormField.Input>\n <FormField.Description>\n Enter your birth date\n </FormField.Description>\n {isInvalid && (\n <FormField.Error>\n Please enter a valid birth date\n </FormField.Error>\n )}\n </FormField.Root>\n );\n}\n```\n\n### Appointment scheduler\n\nA pattern for scheduling appointments with time selection:\n\n```jsx live-dev\nconst App = () => {\n const [appointmentTime, setAppointmentTime] = useState(\n new CalendarDateTime(2025, 12, 15, 10, 0, 0)\n );\n \n const businessHoursStart = 9;\n const businessHoursEnd = 17;\n \n const isInvalidTime = appointmentTime && (\n appointmentTime.hour < businessHoursStart || \n appointmentTime.hour >= businessHoursEnd\n );\n\n return (\n <FormField.Root isInvalid={isInvalidTime}>\n <FormField.Label>Appointment Time</FormField.Label>\n <FormField.Input>\n <DateInput\n value={appointmentTime}\n onChange={setAppointmentTime}\n granularity=\"minute\"\n hourCycle={12}\n leadingElement={<Icons.Schedule />}\n aria-label=\"Appointment time\"\n />\n </FormField.Input>\n <FormField.Description>\n Select a time between 9:00 AM and 5:00 PM\n </FormField.Description>\n {isInvalidTime && (\n <FormField.Error>\n Please select a time during business hours (9 AM - 5 PM)\n </FormField.Error>\n )}\n {appointmentTime && !isInvalidTime && (\n <Text fontSize=\"sm\" mt=\"200\">\n ✅ Appointment scheduled for {appointmentTime.toString()}\n </Text>\n )}\n </FormField.Root>\n );\n}\n```\n\n### Event date range start\n\nPattern for the start date of an event range (pairs with DateRangePicker):\n\n```jsx live-dev\nconst App = () => {\n const [startDate, setStartDate] = useState(new CalendarDate(2025, 12, 10));\n const [endDate, setEndDate] = useState(new CalendarDate(2025, 12, 15));\n const today = new CalendarDate(2025, 12, 2);\n \n const isInvalid = startDate && endDate && startDate.compare(endDate) > 0;\n\n return (\n <Stack direction=\"column\" gap=\"400\">\n <FormField.Root isInvalid={isInvalid}>\n <FormField.Label>Event Start Date</FormField.Label>\n <FormField.Input>\n <DateInput\n value={startDate}\n onChange={setStartDate}\n minValue={today}\n maxValue={endDate}\n leadingElement={<Icons.Event />}\n aria-label=\"Event start date\"\n />\n </FormField.Input>\n {isInvalid && (\n <FormField.Error>\n Start date must be before end date\n </FormField.Error>\n )}\n </FormField.Root>\n \n <FormField.Root>\n <FormField.Label>Event End Date</FormField.Label>\n <FormField.Input>\n <DateInput\n value={endDate}\n onChange={setEndDate}\n minValue={startDate || today}\n leadingElement={<Icons.Event />}\n aria-label=\"Event end date\"\n />\n </FormField.Input>\n </FormField.Root>\n \n <Text fontSize=\"sm\">\n Event duration: {startDate && endDate ? \n `${endDate.compare(startDate) + 1} day(s)` : \n 'Select dates'}\n </Text>\n </Stack>\n );\n}\n```\n\n## Testing your implementation\n\nThese examples demonstrate how to test your implementation when using DateInput within your application. As the component's internal functionality is already tested by Nimbus, these patterns help you verify your integration and application-specific logic.\n\n### Basic Rendering Tests\n\nVerify the DateInput renders with expected elements and date segments\n\n```tsx\nimport { describe, it, expect, vi } from \"vitest\";\nimport { render, screen, waitFor } from \"@testing-library/react\";\nimport userEvent from \"@testing-library/user-event\";\nimport { DateInput, NimbusProvider } from \"@commercetools/nimbus\";\nimport { CalendarDate, CalendarDateTime } from \"@internationalized/date\";\n\ndescribe(\"DateInput - Basic rendering\", () => {\n it(\"renders date input with segments\", () => {\n render(\n <NimbusProvider>\n <DateInput aria-label=\"Enter a date\" />\n </NimbusProvider>\n );\n\n // DateInput uses role=\"group\" for the overall field\n expect(screen.getByRole(\"group\")).toBeInTheDocument();\n });\n\n it(\"renders with default value\", () => {\n const defaultDate = new CalendarDate(2025, 6, 15);\n\n render(\n <NimbusProvider>\n <DateInput\n defaultValue={defaultDate}\n aria-label=\"Date with default value\"\n />\n </NimbusProvider>\n );\n\n // Verify segments contain the default values\n expect(screen.getByRole(\"group\")).toBeInTheDocument();\n // Find month value\n expect(screen.getByText(\"6\")).toBeInTheDocument();\n });\n\n it(\"renders with leading element\", () => {\n render(\n <NimbusProvider>\n <DateInput\n leadingElement={<span data-testid=\"leading-icon\">📅</span>}\n aria-label=\"Date with icon\"\n />\n </NimbusProvider>\n );\n\n expect(screen.getByTestId(\"leading-icon\")).toBeInTheDocument();\n });\n\n it(\"renders with trailing element\", () => {\n render(\n <NimbusProvider>\n <DateInput\n trailingElement={<span data-testid=\"trailing-icon\">✕</span>}\n aria-label=\"Date with trailing icon\"\n />\n </NimbusProvider>\n );\n\n expect(screen.getByTestId(\"trailing-icon\")).toBeInTheDocument();\n });\n});\n```\n\n### Interaction Tests\n\nTest user interactions with date segments and keyboard navigation\n\n```tsx\nimport { describe, it, expect, vi } from \"vitest\";\nimport { render, screen, waitFor } from \"@testing-library/react\";\nimport userEvent from \"@testing-library/user-event\";\nimport { DateInput, NimbusProvider } from \"@commercetools/nimbus\";\nimport { CalendarDate, CalendarDateTime } from \"@internationalized/date\";\n\ndescribe(\"DateInput - Interactions\", () => {\n it(\"calls onChange when date value changes\", async () => {\n const user = userEvent.setup();\n const handleChange = vi.fn();\n\n render(\n <NimbusProvider>\n <DateInput\n onChange={handleChange}\n defaultValue={new CalendarDate(2025, 1, 15)}\n aria-label=\"Interactive date input\"\n />\n </NimbusProvider>\n );\n\n const group = screen.getByRole(\"group\");\n const segments = group.querySelectorAll('[role=\"spinbutton\"]');\n\n // Focus first segment (month) and use arrow up to increment\n if (segments[0]) {\n await user.click(segments[0]);\n await user.keyboard(\"{ArrowUp}\");\n\n // onChange should be called with a DateValue (month changed from 1 to 2)\n await waitFor(() => {\n expect(handleChange).toHaveBeenCalled();\n const newValue = handleChange.mock.calls[0][0];\n expect(newValue).toBeInstanceOf(CalendarDate);\n });\n }\n });\n\n it(\"allows keyboard navigation between segments\", async () => {\n const user = userEvent.setup();\n\n render(\n <NimbusProvider>\n <DateInput\n defaultValue={new CalendarDate(2025, 6, 15)}\n aria-label=\"Date for keyboard navigation\"\n />\n </NimbusProvider>\n );\n\n const group = screen.getByRole(\"group\");\n const segments = group.querySelectorAll('[role=\"spinbutton\"]');\n\n // Focus first segment\n if (segments[0]) {\n await user.click(segments[0]);\n expect(segments[0]).toHaveFocus();\n\n // Tab to next segment\n await user.keyboard(\"{Tab}\");\n expect(segments[1]).toHaveFocus();\n }\n });\n\n it(\"increments segment value with arrow up\", async () => {\n const user = userEvent.setup();\n const handleChange = vi.fn();\n\n render(\n <NimbusProvider>\n <DateInput\n defaultValue={new CalendarDate(2025, 6, 15)}\n onChange={handleChange}\n aria-label=\"Date for arrow key test\"\n />\n </NimbusProvider>\n );\n\n const group = screen.getByRole(\"group\");\n const segments = group.querySelectorAll('[role=\"spinbutton\"]');\n\n if (segments[0]) {\n await user.click(segments[0]);\n await user.keyboard(\"{ArrowUp}\");\n\n await waitFor(() => {\n expect(handleChange).toHaveBeenCalled();\n });\n }\n });\n});\n```\n\n### Controlled Mode Tests\n\nTest controlled component behavior with value and onChange\n\n```tsx\nimport { describe, it, expect, vi } from \"vitest\";\nimport { render, screen, waitFor } from \"@testing-library/react\";\nimport userEvent from \"@testing-library/user-event\";\nimport { DateInput, NimbusProvider } from \"@commercetools/nimbus\";\nimport { CalendarDate, CalendarDateTime } from \"@internationalized/date\";\n\ndescribe(\"DateInput - Controlled mode\", () => {\n it(\"accepts and displays controlled value\", () => {\n const date = new CalendarDate(2025, 12, 25);\n\n render(\n <NimbusProvider>\n <DateInput\n value={date}\n onChange={vi.fn()}\n aria-label=\"Controlled date\"\n />\n </NimbusProvider>\n );\n\n expect(screen.getByRole(\"group\")).toBeInTheDocument();\n });\n\n it(\"calls onChange with new value when changed\", async () => {\n const user = userEvent.setup();\n const handleChange = vi.fn();\n const initialDate = new CalendarDate(2025, 6, 15);\n\n render(\n <NimbusProvider>\n <DateInput\n value={initialDate}\n onChange={handleChange}\n aria-label=\"Controlled with onChange\"\n />\n </NimbusProvider>\n );\n\n const group = screen.getByRole(\"group\");\n const segments = group.querySelectorAll('[role=\"spinbutton\"]');\n\n if (segments[0]) {\n await user.click(segments[0]);\n await user.keyboard(\"{ArrowUp}\");\n\n await waitFor(() => {\n expect(handleChange).toHaveBeenCalled();\n const newValue = handleChange.mock.calls[0][0];\n expect(newValue).toBeInstanceOf(CalendarDate);\n });\n }\n });\n\n it(\"updates when value prop changes\", () => {\n const { rerender } = render(\n <NimbusProvider>\n <DateInput\n value={new CalendarDate(2025, 1, 1)}\n onChange={vi.fn()}\n aria-label=\"Date that will change\"\n />\n </NimbusProvider>\n );\n\n expect(screen.getByRole(\"group\")).toBeInTheDocument();\n\n rerender(\n <NimbusProvider>\n <DateInput\n value={new CalendarDate(2025, 12, 31)}\n onChange={vi.fn()}\n aria-label=\"Date that will change\"\n />\n </NimbusProvider>\n );\n\n expect(screen.getByRole(\"group\")).toBeInTheDocument();\n });\n});\n```\n\n### State Tests\n\nTest various states: disabled, read-only, required, invalid\n\n```tsx\nimport { describe, it, expect, vi } from \"vitest\";\nimport { render, screen, waitFor } from \"@testing-library/react\";\nimport userEvent from \"@testing-library/user-event\";\nimport { DateInput, NimbusProvider } from \"@commercetools/nimbus\";\nimport { CalendarDate, CalendarDateTime } from \"@internationalized/date\";\n\ndescribe(\"DateInput - States\", () => {\n it(\"applies disabled state\", () => {\n render(\n <NimbusProvider>\n <DateInput\n isDisabled\n defaultValue={new CalendarDate(2025, 6, 15)}\n aria-label=\"Disabled date\"\n />\n </NimbusProvider>\n );\n\n const group = screen.getByRole(\"group\");\n expect(group).toHaveAttribute(\"data-disabled\", \"true\");\n });\n\n it(\"applies read-only state\", () => {\n render(\n <NimbusProvider>\n <DateInput\n isReadOnly\n defaultValue={new CalendarDate(2025, 6, 15)}\n aria-label=\"Read-only date\"\n />\n </NimbusProvider>\n );\n\n const group = screen.getByRole(\"group\");\n expect(group).toHaveAttribute(\"data-readonly\", \"true\");\n });\n\n it(\"applies required state\", () => {\n render(\n <NimbusProvider>\n <DateInput isRequired aria-label=\"Required date\" />\n </NimbusProvider>\n );\n\n const group = screen.getByRole(\"group\");\n // Verify component renders when required\n expect(group).toBeInTheDocument();\n });\n\n it(\"applies invalid state\", () => {\n render(\n <NimbusProvider>\n <DateInput\n isInvalid\n defaultValue={new CalendarDate(2025, 6, 15)}\n aria-label=\"Invalid date\"\n />\n </NimbusProvider>\n );\n\n const group = screen.getByRole(\"group\");\n expect(group).toHaveAttribute(\"data-invalid\", \"true\");\n });\n});\n```\n\n### Granularity Tests\n\nTest different granularity levels (day, hour, minute, second)\n\n```tsx\nimport { describe, it, expect, vi } from \"vitest\";\nimport { render, screen, waitFor } from \"@testing-library/react\";\nimport userEvent from \"@testing-library/user-event\";\nimport { DateInput, NimbusProvider } from \"@commercetools/nimbus\";\nimport { CalendarDate, CalendarDateTime } from \"@internationalized/date\";\n\ndescribe(\"DateInput - Granularity\", () => {\n it(\"renders day granularity with date segments only\", () => {\n render(\n <NimbusProvider>\n <DateInput\n granularity=\"day\"\n defaultValue={new CalendarDate(2025, 6, 15)}\n aria-label=\"Day granularity\"\n />\n </NimbusProvider>\n );\n\n const group = screen.getByRole(\"group\");\n const segments = group.querySelectorAll('[role=\"spinbutton\"]');\n\n // Should have segments for month, day, year (3 segments)\n expect(segments.length).toBeGreaterThanOrEqual(3);\n });\n\n it(\"renders minute granularity with date and time segments\", () => {\n render(\n <NimbusProvider>\n <DateInput\n granularity=\"minute\"\n defaultValue={new CalendarDateTime(2025, 6, 15, 14, 30, 0)}\n aria-label=\"Minute granularity\"\n />\n </NimbusProvider>\n );\n\n const group = screen.getByRole(\"group\");\n const segments = group.querySelectorAll('[role=\"spinbutton\"]');\n\n // Should have segments for month, day, year, hour, minute (5+ segments)\n expect(segments.length).toBeGreaterThanOrEqual(5);\n });\n\n it(\"renders second granularity with full precision\", () => {\n render(\n <NimbusProvider>\n <DateInput\n granularity=\"second\"\n defaultValue={new CalendarDateTime(2025, 6, 15, 14, 30, 45)}\n aria-label=\"Second granularity\"\n />\n </NimbusProvider>\n );\n\n const group = screen.getByRole(\"group\");\n const segments = group.querySelectorAll('[role=\"spinbutton\"]');\n\n // Should have segments for month, day, year, hour, minute, second (6+ segments)\n expect(segments.length).toBeGreaterThanOrEqual(6);\n });\n});\n```\n\n\n## Resources\n\n- [Storybook](https://nimbus-storybook.vercel.app/?path=/docs/components-date-dateinput--docs)\n- [React Aria DateField](https://react-spectrum.adobe.com/react-aria/DateField.html)\n- [ARIA Date Pattern](https://www.w3.org/WAI/ARIA/apg/patterns/spinbutton/)\n- [@internationalized/date](https://react-spectrum.adobe.com/internationalized/date/)\n",
|
|
166
|
+
"toc": [
|
|
167
|
+
{
|
|
168
|
+
"value": "Getting started",
|
|
169
|
+
"href": "#getting-started",
|
|
170
|
+
"depth": 2,
|
|
171
|
+
"numbering": [
|
|
172
|
+
1,
|
|
173
|
+
1
|
|
174
|
+
],
|
|
175
|
+
"parent": "root"
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"value": "Import",
|
|
179
|
+
"href": "#import",
|
|
180
|
+
"depth": 3,
|
|
181
|
+
"numbering": [
|
|
182
|
+
1,
|
|
183
|
+
1,
|
|
184
|
+
1
|
|
185
|
+
],
|
|
186
|
+
"parent": "root"
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"value": "Basic usage",
|
|
190
|
+
"href": "#basic-usage",
|
|
191
|
+
"depth": 3,
|
|
192
|
+
"numbering": [
|
|
193
|
+
1,
|
|
194
|
+
1,
|
|
195
|
+
2
|
|
196
|
+
],
|
|
197
|
+
"parent": "root"
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"value": "Working with date values",
|
|
201
|
+
"href": "#working-with-date-values",
|
|
202
|
+
"depth": 2,
|
|
203
|
+
"numbering": [
|
|
204
|
+
1,
|
|
205
|
+
2
|
|
206
|
+
],
|
|
207
|
+
"parent": "root"
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"value": "Date types",
|
|
211
|
+
"href": "#date-types",
|
|
212
|
+
"depth": 3,
|
|
213
|
+
"numbering": [
|
|
214
|
+
1,
|
|
215
|
+
2,
|
|
216
|
+
1
|
|
217
|
+
],
|
|
218
|
+
"parent": "root"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"value": "Creating date values",
|
|
222
|
+
"href": "#creating-date-values",
|
|
223
|
+
"depth": 3,
|
|
224
|
+
"numbering": [
|
|
225
|
+
1,
|
|
226
|
+
2,
|
|
227
|
+
2
|
|
228
|
+
],
|
|
229
|
+
"parent": "root"
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"value": "Converting to strings",
|
|
233
|
+
"href": "#converting-to-strings",
|
|
234
|
+
"depth": 3,
|
|
235
|
+
"numbering": [
|
|
236
|
+
1,
|
|
237
|
+
2,
|
|
238
|
+
3
|
|
239
|
+
],
|
|
240
|
+
"parent": "root"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"value": "Usage examples",
|
|
244
|
+
"href": "#usage-examples",
|
|
245
|
+
"depth": 2,
|
|
246
|
+
"numbering": [
|
|
247
|
+
1,
|
|
248
|
+
3
|
|
249
|
+
],
|
|
250
|
+
"parent": "root"
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
"value": "Size options",
|
|
254
|
+
"href": "#size-options",
|
|
255
|
+
"depth": 3,
|
|
256
|
+
"numbering": [
|
|
257
|
+
1,
|
|
258
|
+
3,
|
|
259
|
+
1
|
|
260
|
+
],
|
|
261
|
+
"parent": "root"
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
"value": "Visual variants",
|
|
265
|
+
"href": "#visual-variants",
|
|
266
|
+
"depth": 3,
|
|
267
|
+
"numbering": [
|
|
268
|
+
1,
|
|
269
|
+
3,
|
|
270
|
+
2
|
|
271
|
+
],
|
|
272
|
+
"parent": "root"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"value": "Leading and trailing elements",
|
|
276
|
+
"href": "#leading-and-trailing-elements",
|
|
277
|
+
"depth": 3,
|
|
278
|
+
"numbering": [
|
|
279
|
+
1,
|
|
280
|
+
3,
|
|
281
|
+
3
|
|
282
|
+
],
|
|
283
|
+
"parent": "root"
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"value": "Granularity control",
|
|
287
|
+
"href": "#granularity-control",
|
|
288
|
+
"depth": 3,
|
|
289
|
+
"numbering": [
|
|
290
|
+
1,
|
|
291
|
+
3,
|
|
292
|
+
4
|
|
293
|
+
],
|
|
294
|
+
"parent": "root"
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
"value": "Hour cycle",
|
|
298
|
+
"href": "#hour-cycle",
|
|
299
|
+
"depth": 3,
|
|
300
|
+
"numbering": [
|
|
301
|
+
1,
|
|
302
|
+
3,
|
|
303
|
+
5
|
|
304
|
+
],
|
|
305
|
+
"parent": "root"
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
"value": "Leading zeros",
|
|
309
|
+
"href": "#leading-zeros",
|
|
310
|
+
"depth": 3,
|
|
311
|
+
"numbering": [
|
|
312
|
+
1,
|
|
313
|
+
3,
|
|
314
|
+
6
|
|
315
|
+
],
|
|
316
|
+
"parent": "root"
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
"value": "Time zone handling",
|
|
320
|
+
"href": "#time-zone-handling",
|
|
321
|
+
"depth": 3,
|
|
322
|
+
"numbering": [
|
|
323
|
+
1,
|
|
324
|
+
3,
|
|
325
|
+
7
|
|
326
|
+
],
|
|
327
|
+
"parent": "root"
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
"value": "Placeholder values",
|
|
331
|
+
"href": "#placeholder-values",
|
|
332
|
+
"depth": 3,
|
|
333
|
+
"numbering": [
|
|
334
|
+
1,
|
|
335
|
+
3,
|
|
336
|
+
8
|
|
337
|
+
],
|
|
338
|
+
"parent": "root"
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
"value": "Min/max validation",
|
|
342
|
+
"href": "#minmax-validation",
|
|
343
|
+
"depth": 3,
|
|
344
|
+
"numbering": [
|
|
345
|
+
1,
|
|
346
|
+
3,
|
|
347
|
+
9
|
|
348
|
+
],
|
|
349
|
+
"parent": "root"
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
"value": "Custom validation",
|
|
353
|
+
"href": "#custom-validation",
|
|
354
|
+
"depth": 3,
|
|
355
|
+
"numbering": [
|
|
356
|
+
1,
|
|
357
|
+
3,
|
|
358
|
+
10
|
|
359
|
+
],
|
|
360
|
+
"parent": "root"
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
"value": "State variations",
|
|
364
|
+
"href": "#state-variations",
|
|
365
|
+
"depth": 3,
|
|
366
|
+
"numbering": [
|
|
367
|
+
1,
|
|
368
|
+
3,
|
|
369
|
+
11
|
|
370
|
+
],
|
|
371
|
+
"parent": "root"
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
"value": "Uncontrolled mode",
|
|
375
|
+
"href": "#uncontrolled-mode",
|
|
376
|
+
"depth": 3,
|
|
377
|
+
"numbering": [
|
|
378
|
+
1,
|
|
379
|
+
3,
|
|
380
|
+
12
|
|
381
|
+
],
|
|
382
|
+
"parent": "root"
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
"value": "Controlled mode",
|
|
386
|
+
"href": "#controlled-mode",
|
|
387
|
+
"depth": 3,
|
|
388
|
+
"numbering": [
|
|
389
|
+
1,
|
|
390
|
+
3,
|
|
391
|
+
13
|
|
392
|
+
],
|
|
393
|
+
"parent": "root"
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
"value": "Internationalization",
|
|
397
|
+
"href": "#internationalization",
|
|
398
|
+
"depth": 3,
|
|
399
|
+
"numbering": [
|
|
400
|
+
1,
|
|
401
|
+
3,
|
|
402
|
+
14
|
|
403
|
+
],
|
|
404
|
+
"parent": "root"
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
"value": "Component requirements",
|
|
408
|
+
"href": "#component-requirements",
|
|
409
|
+
"depth": 2,
|
|
410
|
+
"numbering": [
|
|
411
|
+
1,
|
|
412
|
+
4
|
|
413
|
+
],
|
|
414
|
+
"parent": "root"
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
"value": "Date value requirements",
|
|
418
|
+
"href": "#date-value-requirements",
|
|
419
|
+
"depth": 3,
|
|
420
|
+
"numbering": [
|
|
421
|
+
1,
|
|
422
|
+
4,
|
|
423
|
+
1
|
|
424
|
+
],
|
|
425
|
+
"parent": "root"
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
"value": "Accessibility",
|
|
429
|
+
"href": "#accessibility",
|
|
430
|
+
"depth": 2,
|
|
431
|
+
"numbering": [
|
|
432
|
+
1,
|
|
433
|
+
5
|
|
434
|
+
],
|
|
435
|
+
"parent": "root"
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
"value": "Keyboard navigation",
|
|
439
|
+
"href": "#keyboard-navigation",
|
|
440
|
+
"depth": 4,
|
|
441
|
+
"numbering": [
|
|
442
|
+
1,
|
|
443
|
+
5,
|
|
444
|
+
1,
|
|
445
|
+
1
|
|
446
|
+
],
|
|
447
|
+
"parent": "root"
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
"value": "API reference",
|
|
451
|
+
"href": "#api-reference",
|
|
452
|
+
"depth": 2,
|
|
453
|
+
"numbering": [
|
|
454
|
+
1,
|
|
455
|
+
6
|
|
456
|
+
],
|
|
457
|
+
"parent": "root"
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
"value": "Common patterns",
|
|
461
|
+
"href": "#common-patterns",
|
|
462
|
+
"depth": 2,
|
|
463
|
+
"numbering": [
|
|
464
|
+
1,
|
|
465
|
+
7
|
|
466
|
+
],
|
|
467
|
+
"parent": "root"
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
"value": "Date of birth input",
|
|
471
|
+
"href": "#date-of-birth-input",
|
|
472
|
+
"depth": 3,
|
|
473
|
+
"numbering": [
|
|
474
|
+
1,
|
|
475
|
+
7,
|
|
476
|
+
1
|
|
477
|
+
],
|
|
478
|
+
"parent": "root"
|
|
479
|
+
},
|
|
480
|
+
{
|
|
481
|
+
"value": "Appointment scheduler",
|
|
482
|
+
"href": "#appointment-scheduler",
|
|
483
|
+
"depth": 3,
|
|
484
|
+
"numbering": [
|
|
485
|
+
1,
|
|
486
|
+
7,
|
|
487
|
+
2
|
|
488
|
+
],
|
|
489
|
+
"parent": "root"
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
"value": "Event date range start",
|
|
493
|
+
"href": "#event-date-range-start",
|
|
494
|
+
"depth": 3,
|
|
495
|
+
"numbering": [
|
|
496
|
+
1,
|
|
497
|
+
7,
|
|
498
|
+
3
|
|
499
|
+
],
|
|
500
|
+
"parent": "root"
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
"value": "Testing your implementation",
|
|
504
|
+
"href": "#testing-your-implementation",
|
|
505
|
+
"depth": 2,
|
|
506
|
+
"numbering": [
|
|
507
|
+
1,
|
|
508
|
+
8
|
|
509
|
+
],
|
|
510
|
+
"parent": "root"
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
"value": "Basic Rendering Tests",
|
|
514
|
+
"href": "#basic-rendering-tests",
|
|
515
|
+
"depth": 3,
|
|
516
|
+
"numbering": [
|
|
517
|
+
1,
|
|
518
|
+
8,
|
|
519
|
+
1
|
|
520
|
+
],
|
|
521
|
+
"parent": "root"
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
"value": "Interaction Tests",
|
|
525
|
+
"href": "#interaction-tests",
|
|
526
|
+
"depth": 3,
|
|
527
|
+
"numbering": [
|
|
528
|
+
1,
|
|
529
|
+
8,
|
|
530
|
+
2
|
|
531
|
+
],
|
|
532
|
+
"parent": "root"
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
"value": "Controlled Mode Tests",
|
|
536
|
+
"href": "#controlled-mode-tests",
|
|
537
|
+
"depth": 3,
|
|
538
|
+
"numbering": [
|
|
539
|
+
1,
|
|
540
|
+
8,
|
|
541
|
+
3
|
|
542
|
+
],
|
|
543
|
+
"parent": "root"
|
|
544
|
+
},
|
|
545
|
+
{
|
|
546
|
+
"value": "State Tests",
|
|
547
|
+
"href": "#state-tests",
|
|
548
|
+
"depth": 3,
|
|
549
|
+
"numbering": [
|
|
550
|
+
1,
|
|
551
|
+
8,
|
|
552
|
+
4
|
|
553
|
+
],
|
|
554
|
+
"parent": "root"
|
|
555
|
+
},
|
|
556
|
+
{
|
|
557
|
+
"value": "Granularity Tests",
|
|
558
|
+
"href": "#granularity-tests",
|
|
559
|
+
"depth": 3,
|
|
560
|
+
"numbering": [
|
|
561
|
+
1,
|
|
562
|
+
8,
|
|
563
|
+
5
|
|
564
|
+
],
|
|
565
|
+
"parent": "root"
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
"value": "Resources",
|
|
569
|
+
"href": "#resources",
|
|
570
|
+
"depth": 2,
|
|
571
|
+
"numbering": [
|
|
572
|
+
1,
|
|
573
|
+
9
|
|
574
|
+
],
|
|
575
|
+
"parent": "root"
|
|
576
|
+
}
|
|
577
|
+
]
|
|
578
|
+
},
|
|
579
|
+
"guidelines": {
|
|
580
|
+
"mdx": "\n## Guidelines\n\nDate input guidelines establish a standardized approach for creating intuitive\nand accessible date input components, ensuring consistency in presentation and\ninteraction for selecting dates across all applications.\n\n### Best practices\n\n- **Use a clear placeholder.** Provide a placeholder in a conventional date\n format to guide the user (e.g., mm/dd/yyyy).\n- **Provide clear validation.** Offer clear, concise error messages for\n incorrect or invalid input.\n- **Format automatically.** Format the date as the user types to reduce errors\n and improve usability.\n- **Use for specific dates.** Use this component when a user needs to enter a\n known date. Avoid using it for date ranges or when a calendar view would be\n more beneficial.\n- **Ensure accessibility.** The input field will have a clear accessible label\n and be compatible with screen readers.\n\n### Usage\n\nA date input component allows users to enter a specific date. The component\nprovides a single input field for manual entry. Use this component when a\ncalendar selection is unnecessary or when a user is likely to know the specific\ndate they need to enter.\n\n> [!TIP]\\\n> When to use\n\n- **Entering a known date.** Use when the user knows the specific date, such as\n a birth date, an expiration date, or a past event.\n- **A calendar is not necessary.** Use when a calendar popover would be an\n unnecessary step for the user, simplifying the user experience.\n\n> [!CAUTION]\\\n> When not to use\n\n- **Selecting a date range.** Do not use a single date input to select a start\n and end date. Use a date range picker instead.\n- **Choosing an unknown date.** Avoid using this component when the user needs\n to browse or select a date they don't already know, such as setting a date for\n promotion or setting a range for expecting for a shipment. In these cases, a\n calendar popover is more effective.\n\n### Basic interactions\n\nClear labels and concise messaging are crucial for a date input to ensure users\nunderstand what date information is required and how to provide it correctly.\n\n> [!TIP]\\\n> **Do**\n>\n> - Do provide a clear placeholder in a conventional date format.\n> - Do automatically format the date as the user types.\n> - Do provide validation and clear error messages.\n> - Do use this component when a user needs to enter a known, specific date.\n\n```jsx live\nconst App = () => (\n <FormField.Root>\n <FormField.Label>Birth Date</FormField.Label>\n <FormField.Input>\n <DateInput aria-label=\"Birth date\" width=\"1/3\" />\n </FormField.Input>\n </FormField.Root>\n);\n```\n\n> [!CAUTION]\\\n> **Don't**\n>\n> - Don't use a generic placeholder like \"enter date.\"\n> - Don't require the user to manually enter separators like \"/\" or \"-\".\n> - Don't allow invalid dates to be submitted without feedback.\n> - Don't use this component when a calendar selection would be more helpful or\n> when selecting a date range.\n\n```jsx live\nconst App = () => (\n <FormField.Root isInvalid>\n <FormField.Input>\n <DateInput aria-label=\"Date\" width=\"1/3\" />\n </FormField.Input>\n <FormField.Error>Your date is not a valid input</FormField.Error>\n </FormField.Root>\n);\n```\n",
|
|
581
|
+
"toc": [
|
|
582
|
+
{
|
|
583
|
+
"value": "Guidelines",
|
|
584
|
+
"href": "#guidelines",
|
|
585
|
+
"depth": 2,
|
|
586
|
+
"numbering": [
|
|
587
|
+
1,
|
|
588
|
+
1
|
|
589
|
+
],
|
|
590
|
+
"parent": "root"
|
|
591
|
+
},
|
|
592
|
+
{
|
|
593
|
+
"value": "Best practices",
|
|
594
|
+
"href": "#best-practices",
|
|
595
|
+
"depth": 3,
|
|
596
|
+
"numbering": [
|
|
597
|
+
1,
|
|
598
|
+
1,
|
|
599
|
+
1
|
|
600
|
+
],
|
|
601
|
+
"parent": "root"
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
"value": "Usage",
|
|
605
|
+
"href": "#usage",
|
|
606
|
+
"depth": 3,
|
|
607
|
+
"numbering": [
|
|
608
|
+
1,
|
|
609
|
+
1,
|
|
610
|
+
2
|
|
611
|
+
],
|
|
612
|
+
"parent": "root"
|
|
613
|
+
},
|
|
614
|
+
{
|
|
615
|
+
"value": "Basic interactions",
|
|
616
|
+
"href": "#basic-interactions",
|
|
617
|
+
"depth": 3,
|
|
618
|
+
"numbering": [
|
|
619
|
+
1,
|
|
620
|
+
1,
|
|
621
|
+
3
|
|
622
|
+
],
|
|
623
|
+
"parent": "root"
|
|
624
|
+
}
|
|
625
|
+
]
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
}
|