@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,611 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"id": "Components-MultilineTextInput",
|
|
4
|
+
"title": "Multiline text input",
|
|
5
|
+
"exportName": "MultilineTextInput",
|
|
6
|
+
"description": "A multi-line text input allows users to enter longer blocks of text across multiple lines. It is suitable for paragraphs, descriptions, or any input requiring more than a single line.",
|
|
7
|
+
"lifecycleState": "Stable",
|
|
8
|
+
"order": 999,
|
|
9
|
+
"repoPath": "packages/nimbus/src/components/multiline-text-input/multiline-text-input.mdx",
|
|
10
|
+
"menu": [
|
|
11
|
+
"Components",
|
|
12
|
+
"Inputs",
|
|
13
|
+
"Multiline text input"
|
|
14
|
+
],
|
|
15
|
+
"route": "components/inputs/multiline-text-input",
|
|
16
|
+
"tags": [
|
|
17
|
+
"component",
|
|
18
|
+
"form"
|
|
19
|
+
],
|
|
20
|
+
"toc": [
|
|
21
|
+
{
|
|
22
|
+
"value": "Overview",
|
|
23
|
+
"href": "#overview",
|
|
24
|
+
"depth": 2,
|
|
25
|
+
"numbering": [
|
|
26
|
+
1,
|
|
27
|
+
1
|
|
28
|
+
],
|
|
29
|
+
"parent": "root"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"value": "Resources",
|
|
33
|
+
"href": "#resources",
|
|
34
|
+
"depth": 3,
|
|
35
|
+
"numbering": [
|
|
36
|
+
1,
|
|
37
|
+
1,
|
|
38
|
+
1
|
|
39
|
+
],
|
|
40
|
+
"parent": "root"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"value": "Variables",
|
|
44
|
+
"href": "#variables",
|
|
45
|
+
"depth": 2,
|
|
46
|
+
"numbering": [
|
|
47
|
+
1,
|
|
48
|
+
2
|
|
49
|
+
],
|
|
50
|
+
"parent": "root"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"value": "Visual options",
|
|
54
|
+
"href": "#visual-options",
|
|
55
|
+
"depth": 3,
|
|
56
|
+
"numbering": [
|
|
57
|
+
1,
|
|
58
|
+
2,
|
|
59
|
+
1
|
|
60
|
+
],
|
|
61
|
+
"parent": "root"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"value": "Sizes",
|
|
65
|
+
"href": "#sizes",
|
|
66
|
+
"depth": 4,
|
|
67
|
+
"numbering": [
|
|
68
|
+
1,
|
|
69
|
+
2,
|
|
70
|
+
1,
|
|
71
|
+
1
|
|
72
|
+
],
|
|
73
|
+
"parent": "root"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"value": "Resizability",
|
|
77
|
+
"href": "#resizability",
|
|
78
|
+
"depth": 4,
|
|
79
|
+
"numbering": [
|
|
80
|
+
1,
|
|
81
|
+
2,
|
|
82
|
+
1,
|
|
83
|
+
2
|
|
84
|
+
],
|
|
85
|
+
"parent": "root"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"value": "Minimum and maximum row allowance",
|
|
89
|
+
"href": "#minimum-and-maximum-row-allowance",
|
|
90
|
+
"depth": 3,
|
|
91
|
+
"numbering": [
|
|
92
|
+
1,
|
|
93
|
+
2,
|
|
94
|
+
2
|
|
95
|
+
],
|
|
96
|
+
"parent": "root"
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
"layout": "app-frame",
|
|
100
|
+
"tabs": [
|
|
101
|
+
{
|
|
102
|
+
"key": "overview",
|
|
103
|
+
"title": "Overview",
|
|
104
|
+
"order": 0
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"key": "guidelines",
|
|
108
|
+
"title": "Guidelines",
|
|
109
|
+
"order": 2
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"key": "dev",
|
|
113
|
+
"title": "Implementation",
|
|
114
|
+
"order": 3
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"key": "a11y",
|
|
118
|
+
"title": "Accessibility",
|
|
119
|
+
"order": 4
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
},
|
|
123
|
+
"mdx": "\n## Overview\n\nA multi-line text input allows users to enter multiple lines of text. It expands\nvertically to accommodate more content.\n\n### Resources\n\nDeep dive into implementation details and access the Nimbus design library.\n\n[Figma Library](https://www.figma.com/design/gHbAJGfcrCv7f2bgzUQgHq/NIMBUS-Guidelines?node-id=2602-6001&m=dev)\n\n## Variables\n\nGet familiar with the features.\n\n### Visual options\n\nThis component supports different sizes, medium (default) and small (for compact\nuses).\n\n#### Sizes\n\n```jsx live\nconst App = () => (\n <Stack direction=\"row\" gap=\"400\" alignItems=\"flex-start\">\n <MultilineTextInput\n size=\"md\"\n placeholder=\"Medium textarea\"\n aria-label=\"Medium input\"\n value=\"I am a medium size, and used as a default.\"\n />\n <MultilineTextInput\n size=\"sm\"\n placeholder=\"Small textarea\"\n aria-label=\"Small input\"\n value=\"This is the small size for compact uses.\"\n />\n </Stack>\n );\n```\n\n#### Resizability\n\nUsers can resize the input vertically using a handle, and it can grow with the\ncontent added.\n\n```jsx live\nconst App = () => (\n <Stack direction=\"row\" gap=\"400\" alignItems=\"flex-start\">\n <MultilineTextInput\n size=\"md\"\n placeholder=\"Medium textarea\"\n aria-label=\"Medium input\"\n value=\"Resize me by dragging the icon in the lower right corner. I can only move up and down to adjust the height of this element.\"\n />\n <MultilineTextInput\n size=\"md\"\n placeholder=\"Medium textarea less content\"\n aria-label=\"Medium input\"\n value=\"Add more text and I will grow to contain it. Additionally, you can set a max height.\"\n />\n </Stack>\n );\n```\n\n### Minimum and maximum row allowance\n\nA min. rows property sets the initial minimum visible height (e.g., 2 rows). A\nmax. rows property sets the maximum visible height before the content becomes\nscrollable (e.g., 5 rows).\n\n```jsx live\nconst App = () => (\n <MultilineTextInput\n size=\"md\"\n placeholder=\"placeholder with min row\"\n aria-label=\"Medium input\"\n value=\"Lorem ipsum dolor sit amet, consectetur adipiscing elit\"\n rows={5}\n />\n);\n```\n",
|
|
124
|
+
"views": {
|
|
125
|
+
"overview": {
|
|
126
|
+
"mdx": "\n## Overview\n\nA multi-line text input allows users to enter multiple lines of text. It expands\nvertically to accommodate more content.\n\n### Resources\n\nDeep dive into implementation details and access the Nimbus design library.\n\n[Figma Library](https://www.figma.com/design/gHbAJGfcrCv7f2bgzUQgHq/NIMBUS-Guidelines?node-id=2602-6001&m=dev)\n\n## Variables\n\nGet familiar with the features.\n\n### Visual options\n\nThis component supports different sizes, medium (default) and small (for compact\nuses).\n\n#### Sizes\n\n```jsx live\nconst App = () => (\n <Stack direction=\"row\" gap=\"400\" alignItems=\"flex-start\">\n <MultilineTextInput\n size=\"md\"\n placeholder=\"Medium textarea\"\n aria-label=\"Medium input\"\n value=\"I am a medium size, and used as a default.\"\n />\n <MultilineTextInput\n size=\"sm\"\n placeholder=\"Small textarea\"\n aria-label=\"Small input\"\n value=\"This is the small size for compact uses.\"\n />\n </Stack>\n );\n```\n\n#### Resizability\n\nUsers can resize the input vertically using a handle, and it can grow with the\ncontent added.\n\n```jsx live\nconst App = () => (\n <Stack direction=\"row\" gap=\"400\" alignItems=\"flex-start\">\n <MultilineTextInput\n size=\"md\"\n placeholder=\"Medium textarea\"\n aria-label=\"Medium input\"\n value=\"Resize me by dragging the icon in the lower right corner. I can only move up and down to adjust the height of this element.\"\n />\n <MultilineTextInput\n size=\"md\"\n placeholder=\"Medium textarea less content\"\n aria-label=\"Medium input\"\n value=\"Add more text and I will grow to contain it. Additionally, you can set a max height.\"\n />\n </Stack>\n );\n```\n\n### Minimum and maximum row allowance\n\nA min. rows property sets the initial minimum visible height (e.g., 2 rows). A\nmax. rows property sets the maximum visible height before the content becomes\nscrollable (e.g., 5 rows).\n\n```jsx live\nconst App = () => (\n <MultilineTextInput\n size=\"md\"\n placeholder=\"placeholder with min row\"\n aria-label=\"Medium input\"\n value=\"Lorem ipsum dolor sit amet, consectetur adipiscing elit\"\n rows={5}\n />\n);\n```\n",
|
|
127
|
+
"toc": [
|
|
128
|
+
{
|
|
129
|
+
"value": "Overview",
|
|
130
|
+
"href": "#overview",
|
|
131
|
+
"depth": 2,
|
|
132
|
+
"numbering": [
|
|
133
|
+
1,
|
|
134
|
+
1
|
|
135
|
+
],
|
|
136
|
+
"parent": "root"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"value": "Resources",
|
|
140
|
+
"href": "#resources",
|
|
141
|
+
"depth": 3,
|
|
142
|
+
"numbering": [
|
|
143
|
+
1,
|
|
144
|
+
1,
|
|
145
|
+
1
|
|
146
|
+
],
|
|
147
|
+
"parent": "root"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"value": "Variables",
|
|
151
|
+
"href": "#variables",
|
|
152
|
+
"depth": 2,
|
|
153
|
+
"numbering": [
|
|
154
|
+
1,
|
|
155
|
+
2
|
|
156
|
+
],
|
|
157
|
+
"parent": "root"
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"value": "Visual options",
|
|
161
|
+
"href": "#visual-options",
|
|
162
|
+
"depth": 3,
|
|
163
|
+
"numbering": [
|
|
164
|
+
1,
|
|
165
|
+
2,
|
|
166
|
+
1
|
|
167
|
+
],
|
|
168
|
+
"parent": "root"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"value": "Sizes",
|
|
172
|
+
"href": "#sizes",
|
|
173
|
+
"depth": 4,
|
|
174
|
+
"numbering": [
|
|
175
|
+
1,
|
|
176
|
+
2,
|
|
177
|
+
1,
|
|
178
|
+
1
|
|
179
|
+
],
|
|
180
|
+
"parent": "root"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"value": "Resizability",
|
|
184
|
+
"href": "#resizability",
|
|
185
|
+
"depth": 4,
|
|
186
|
+
"numbering": [
|
|
187
|
+
1,
|
|
188
|
+
2,
|
|
189
|
+
1,
|
|
190
|
+
2
|
|
191
|
+
],
|
|
192
|
+
"parent": "root"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"value": "Minimum and maximum row allowance",
|
|
196
|
+
"href": "#minimum-and-maximum-row-allowance",
|
|
197
|
+
"depth": 3,
|
|
198
|
+
"numbering": [
|
|
199
|
+
1,
|
|
200
|
+
2,
|
|
201
|
+
2
|
|
202
|
+
],
|
|
203
|
+
"parent": "root"
|
|
204
|
+
}
|
|
205
|
+
]
|
|
206
|
+
},
|
|
207
|
+
"a11y": {
|
|
208
|
+
"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 <MultilineTextInput\n size=\"md\"\n placeholder=\"well described placeholder\"\n aria-label=\"lorem ipsum text\"\n value=\"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\"\n rows={5}\n />\n)\n```\n\n### Accessibility standards\n\n- Always provide a visible label for the input.\n- If a visible label is not used, provide an aria-label or aria-labelledby for\n screen readers.\n- Ensure sufficient color contrast for all elements (text, borders).\n- Communicate errors clearly, using both visual cues (e.g., color) and\n descriptive error messages.\n- Clearly indicate the focused state.\n\n### Resources\n\n- [Adobe Spectrum TextArea](https://www.google.com/search?q=https://spectrum.adobe.com/components/textarea/)\n- [React Spectrum TextArea](https://react-spectrum.adobe.com/react-spectrum/TextArea.html)\n",
|
|
209
|
+
"toc": [
|
|
210
|
+
{
|
|
211
|
+
"value": "Accessibility",
|
|
212
|
+
"href": "#accessibility",
|
|
213
|
+
"depth": 2,
|
|
214
|
+
"numbering": [
|
|
215
|
+
1,
|
|
216
|
+
1
|
|
217
|
+
],
|
|
218
|
+
"parent": "root"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"value": "Accessibility standards",
|
|
222
|
+
"href": "#accessibility-standards",
|
|
223
|
+
"depth": 3,
|
|
224
|
+
"numbering": [
|
|
225
|
+
1,
|
|
226
|
+
1,
|
|
227
|
+
1
|
|
228
|
+
],
|
|
229
|
+
"parent": "root"
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"value": "Resources",
|
|
233
|
+
"href": "#resources",
|
|
234
|
+
"depth": 3,
|
|
235
|
+
"numbering": [
|
|
236
|
+
1,
|
|
237
|
+
1,
|
|
238
|
+
2
|
|
239
|
+
],
|
|
240
|
+
"parent": "root"
|
|
241
|
+
}
|
|
242
|
+
]
|
|
243
|
+
},
|
|
244
|
+
"dev": {
|
|
245
|
+
"mdx": "\n## Getting started\n\n### Import\n\n```tsx\nimport { MultilineTextInput, type MultilineTextInputProps } from '@commercetools/nimbus';\n```\n\n### Basic usage\n\nThe simplest implementation uses uncontrolled mode:\n\n```jsx live-dev\nconst App = () => (\n <MultilineTextInput placeholder=\"Enter your message\" />\n)\n```\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 <MultilineTextInput size=\"sm\" placeholder=\"Small textarea\" />\n <MultilineTextInput size=\"md\" placeholder=\"Medium textarea (default)\" />\n </Stack>\n)\n```\n\n### Visual variants\n\nChoose between `solid` and `ghost` variants to match your design context:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"column\" gap=\"400\">\n <MultilineTextInput variant=\"solid\" placeholder=\"Solid variant (default)\" />\n <MultilineTextInput variant=\"ghost\" placeholder=\"Ghost variant\" />\n </Stack>\n)\n```\n\n### Leading elements\n\nAdd icons, buttons, or other elements at the start of the textarea using the `leadingElement` prop:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"column\" gap=\"400\">\n <MultilineTextInput\n placeholder=\"Add a comment...\"\n leadingElement={<Icons.Comment />}\n />\n <MultilineTextInput\n placeholder=\"Describe the issue...\"\n leadingElement={<Icons.ReportProblem />}\n />\n </Stack>\n)\n```\n\n**Behavioral notes:**\n- Elements automatically respect text direction (LTR/RTL)\n- Leading element appears at the start (left in LTR, right in RTL)\n- Icon sizing automatically adjusts based on the `size` prop\n\n### Rows configuration\n\nControl the visible number of text rows using the `rows` prop:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"column\" gap=\"400\">\n <Text fontSize=\"sm\" color=\"neutral.11\">Default (1 row):</Text>\n <MultilineTextInput\n placeholder=\"Single row textarea\"\n />\n\n <Text fontSize=\"sm\" color=\"neutral.11\">3 rows:</Text>\n <MultilineTextInput\n rows={3}\n placeholder=\"Three rows textarea\"\n />\n\n <Text fontSize=\"sm\" color=\"neutral.11\">6 rows:</Text>\n <MultilineTextInput\n rows={6}\n placeholder=\"Six rows textarea\"\n />\n </Stack>\n)\n```\n\n**Behavioral notes:**\n- Default is 1 row if not specified\n- Users can manually resize vertically using the resize handle\n- Larger `rows` values provide more visible space for longer content\n\n### Auto-grow functionality\n\nEnable automatic height adjustment based on content using the `autoGrow` prop:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"column\" gap=\"400\">\n <Text fontSize=\"sm\" color=\"neutral.11\">\n Auto-grow enabled - type multiple lines to see it expand:\n </Text>\n <MultilineTextInput\n autoGrow\n placeholder=\"Start typing... This textarea will grow automatically!\"\n />\n\n <Text fontSize=\"sm\" color=\"neutral.11\">\n Auto-grow with max height constraint:\n </Text>\n <MultilineTextInput\n autoGrow\n maxHeight=\"3200\"\n placeholder=\"Grows up to max height, then scrolls\"\n />\n </Stack>\n)\n```\n\n**Behavioral notes:**\n- Textarea automatically expands as you type more lines\n- Automatically shrinks when you delete content\n- Manual resize handle remains available with auto-grow\n- Use `maxHeight` to limit expansion and enable scrolling beyond that point\n- Use `minH` and `maxH` style props for height constraints\n\n### Disabled state\n\nDisable textarea interaction with the `isDisabled` prop:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"column\" gap=\"400\">\n <MultilineTextInput placeholder=\"Enabled textarea\" />\n <MultilineTextInput placeholder=\"Disabled textarea\" isDisabled />\n <MultilineTextInput\n value=\"Disabled with content\"\n isDisabled\n onChange={() => {}}\n />\n </Stack>\n)\n```\n\n### Invalid state\n\nMark textareas as invalid for validation feedback:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"column\" gap=\"400\">\n <MultilineTextInput\n placeholder=\"Valid textarea\"\n value=\"This message meets requirements\"\n onChange={() => {}}\n />\n <MultilineTextInput\n placeholder=\"Invalid textarea\"\n value=\"Too short\"\n isInvalid\n onChange={() => {}}\n />\n </Stack>\n)\n```\n\n### Read-only state\n\nUse `isReadOnly` to display content without allowing editing:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"column\" gap=\"400\">\n <MultilineTextInput\n value=\"This content is editable\"\n onChange={() => {}}\n />\n <MultilineTextInput\n value=\"This content is read-only and cannot be modified\"\n isReadOnly\n onChange={() => {}}\n />\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<string>('');\n\n return (\n <Stack direction=\"column\" gap=\"400\">\n <MultilineTextInput\n placeholder=\"Type something...\"\n defaultValue=\"\"\n onChange={(value) => {\n setDisplayValue(value);\n }}\n />\n <Text fontSize=\"sm\">Current value: {displayValue || '(empty)'}</Text>\n </Stack>\n );\n}\n```\n\nUse uncontrolled mode when you need to capture the textarea value without managing state yourself.\n\n**Note:** MultilineTextInput's `onChange` receives the string value directly, not an event object.\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<MultilineTextInputProps[\"value\"]>('');\n\n return (\n <Stack direction=\"column\" gap=\"400\">\n <MultilineTextInput\n value={value}\n onChange={setValue}\n placeholder=\"Type your message...\"\n rows={3}\n />\n <Text fontSize=\"sm\">\n {value ? `Character count: ${value.length}` : 'Start typing...'}\n </Text>\n <Button onClick={() => setValue('')} size=\"xs\">\n Clear\n </Button>\n </Stack>\n );\n}\n```\n\nUse controlled mode when you need to:\n- Synchronize the value with external state\n- Validate or transform input values\n- Clear or programmatically set the value\n- React to changes in real-time (e.g., character counting)\n\n## Component requirements\n\n## Accessibility\n\nThe MultilineTextInput handles most accessibility requirements internally. However, you must always associate an internationalized label with the component. Visual labels are preferable, and can be set by:\n\n- Using the `MultilineTextInputField` pattern component (recommended)\n- Associating a `<label>` element with the `MultilineTextInput` using `aria-labelledby`:\n\n```tsx\n<label id=\"description-label\">\n {msg.format(descriptionMessage)}\n</label>\n<MultilineTextInput aria-labelledby=\"description-label\" />\n```\n\n- Associating a `<label>` element with the `MultilineTextInput` using `htmlFor`:\n\n```tsx\n<label htmlFor=\"description-textarea\">\n {msg.format(descriptionMessage)}\n</label>\n<MultilineTextInput id=\"description-textarea\" />\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<MultilineTextInput aria-label={msg.format(descriptionMessage)} />\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 = \"product-description-textarea\";\n\nexport const DescriptionField = () => (\n <MultilineTextInput id={PERSISTENT_ID} placeholder=\"Description\" />\n);\n```\n\n#### Keyboard navigation\n\nThe component supports full keyboard interaction:\n- `Tab` / `Shift+Tab`: Navigate to/from the textarea field\n- `Arrow keys`: Move cursor within the text (all directions for multi-line navigation)\n- `Home` / `End`: Move cursor to start/end of current line\n- `Ctrl+Home` / `Ctrl+End`: Move cursor to start/end of entire text\n- `Ctrl+A` / `Cmd+A`: Select all text\n- `Enter`: Insert new line\n- Standard text editing shortcuts: Cut, Copy, Paste, Undo, Redo\n\n#### Click-to-focus behavior\n\nClicking anywhere within the textarea container (including leading element area) will focus the textarea field, providing a larger interactive target for better usability.\n\n## API reference\n\n<PropsTable id=\"MultilineTextInput\" />\n\n## Common patterns\n\n### Comment input with character limit\n\nTrack character count and enforce limits for user-generated content:\n\n```jsx live-dev\nconst App = () => {\n const [comment, setComment] = useState<string>('');\n const maxLength = 280;\n const remaining = maxLength - comment.length;\n const isOverLimit = remaining < 0;\n\n return (\n <Stack direction=\"column\" gap=\"400\">\n <MultilineTextInput\n value={comment}\n onChange={setComment}\n placeholder=\"Share your thoughts...\"\n rows={4}\n isInvalid={isOverLimit}\n leadingElement={<Icons.Comment />}\n />\n <Stack direction=\"row\" justifyContent=\"space-between\">\n <Text fontSize=\"sm\" color={isOverLimit ? 'critical.11' : 'neutral.11'}>\n {remaining} characters remaining\n </Text>\n <Button\n size=\"xs\"\n isDisabled={comment.length === 0 || isOverLimit}\n >\n Post Comment\n </Button>\n </Stack>\n </Stack>\n );\n}\n```\n\n### Auto-growing feedback form\n\nCreate responsive form fields that adapt to content length:\n\n```jsx live-dev\nconst App = () => {\n const [feedback, setFeedback] = useState<string>('');\n const wordCount = feedback.trim().split(/\\s+/).filter(Boolean).length;\n\n return (\n <Stack direction=\"column\" gap=\"400\">\n <Text fontWeight=\"semibold\">Share Your Feedback</Text>\n <MultilineTextInput\n autoGrow\n value={feedback}\n onChange={setFeedback}\n placeholder=\"Tell us about your experience...\"\n minH=\"1600\"\n maxH=\"4800\"\n leadingElement={<Icons.Feedback />}\n />\n <Stack direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\">\n <Text fontSize=\"sm\" color=\"neutral.11\">\n {wordCount} {wordCount === 1 ? 'word' : 'words'}\n </Text>\n <Button size=\"xs\" isDisabled={wordCount < 10}>\n Submit Feedback\n </Button>\n </Stack>\n </Stack>\n );\n}\n```\n\n### Multi-field form with validation\n\nCombine multiple textareas in a form with validation states:\n\n```jsx live-dev\nconst App = () => {\n const [title, setTitle] = useState<string>('');\n const [description, setDescription] = useState<string>('');\n const [touched, setTouched] = useState({ title: false, description: false });\n\n const titleError = touched.title && title.length < 5;\n const descError = touched.description && description.length < 20;\n\n return (\n <Stack direction=\"column\" gap=\"600\">\n <Stack direction=\"column\" gap=\"300\">\n <Text fontWeight=\"semibold\">Title *</Text>\n <MultilineTextInput\n value={title}\n onChange={setTitle}\n onBlur={() => setTouched(prev => ({ ...prev, title: true }))}\n placeholder=\"Brief summary (minimum 5 characters)\"\n rows={1}\n isInvalid={titleError}\n isRequired\n />\n {titleError && (\n <Text fontSize=\"sm\" color=\"critical.11\">\n Title must be at least 5 characters\n </Text>\n )}\n </Stack>\n\n <Stack direction=\"column\" gap=\"300\">\n <Text fontWeight=\"semibold\">Description *</Text>\n <MultilineTextInput\n autoGrow\n value={description}\n onChange={setDescription}\n onBlur={() => setTouched(prev => ({ ...prev, description: true }))}\n placeholder=\"Detailed explanation (minimum 20 characters)\"\n minH=\"2400\"\n maxH=\"4800\"\n isInvalid={descError}\n isRequired\n />\n {descError && (\n <Text fontSize=\"sm\" color=\"critical.11\">\n Description must be at least 20 characters\n </Text>\n )}\n </Stack>\n\n <Button\n isDisabled={!title || !description || titleError || descError}\n >\n Submit\n </Button>\n </Stack>\n );\n}\n```\n\n## Testing your implementation\n\nThese examples demonstrate how to test your implementation when using MultilineTextInput 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 component renders with expected elements\n\n```tsx\nimport { describe, it, expect, vi } from \"vitest\";\nimport { render, screen } from \"@testing-library/react\";\nimport userEvent from \"@testing-library/user-event\";\nimport { MultilineTextInput, NimbusProvider } from \"@commercetools/nimbus\";\nimport { useState } from \"react\";\n\ndescribe(\"MultilineTextInput - Basic rendering\", () => {\n it(\"renders textarea element\", () => {\n render(\n <NimbusProvider>\n <MultilineTextInput aria-label=\"Description\" />\n </NimbusProvider>\n );\n\n const textarea = screen.getByRole(\"textbox\", { name: /description/i });\n expect(textarea).toBeInTheDocument();\n expect(textarea.tagName).toBe(\"TEXTAREA\");\n });\n\n it(\"renders with placeholder text\", () => {\n render(\n <NimbusProvider>\n <MultilineTextInput\n placeholder=\"Enter your message\"\n aria-label=\"Message\"\n />\n </NimbusProvider>\n );\n\n expect(\n screen.getByPlaceholderText(/enter your message/i)\n ).toBeInTheDocument();\n });\n\n it(\"renders with specified number of rows\", () => {\n render(\n <NimbusProvider>\n <MultilineTextInput rows={5} aria-label=\"Description\" />\n </NimbusProvider>\n );\n\n const textarea = screen.getByRole(\"textbox\");\n expect(textarea).toHaveAttribute(\"rows\", \"5\");\n });\n});\n```\n\n### Interaction Tests\n\nTest user interactions with the textarea\n\n```tsx\nimport { describe, it, expect, vi } from \"vitest\";\nimport { render, screen } from \"@testing-library/react\";\nimport userEvent from \"@testing-library/user-event\";\nimport { MultilineTextInput, NimbusProvider } from \"@commercetools/nimbus\";\nimport { useState } from \"react\";\n\ndescribe(\"MultilineTextInput - Interactions\", () => {\n it(\"handles typing multi-line text\", async () => {\n const user = userEvent.setup();\n render(\n <NimbusProvider>\n <MultilineTextInput aria-label=\"Message\" />\n </NimbusProvider>\n );\n\n const textarea = screen.getByRole(\"textbox\");\n await user.type(textarea, \"First line{Enter}Second line\");\n\n expect(textarea).toHaveValue(\"First line\\nSecond line\");\n });\n\n it(\"calls onChange with typed value\", async () => {\n const user = userEvent.setup();\n const handleChange = vi.fn();\n render(\n <NimbusProvider>\n <MultilineTextInput onChange={handleChange} aria-label=\"Message\" />\n </NimbusProvider>\n );\n\n const textarea = screen.getByRole(\"textbox\");\n await user.type(textarea, \"Hello\");\n\n expect(handleChange).toHaveBeenCalledWith(\"Hello\");\n });\n\n it(\"handles controlled mode updates\", async () => {\n const { rerender } = render(\n <NimbusProvider>\n <MultilineTextInput\n value=\"Initial\"\n onChange={() => {}}\n aria-label=\"Message\"\n />\n </NimbusProvider>\n );\n\n const textarea = screen.getByRole(\"textbox\");\n expect(textarea).toHaveValue(\"Initial\");\n\n rerender(\n <NimbusProvider>\n <MultilineTextInput\n value=\"Updated\"\n onChange={() => {}}\n aria-label=\"Message\"\n />\n </NimbusProvider>\n );\n\n expect(textarea).toHaveValue(\"Updated\");\n });\n});\n```\n\n### Testing States\n\nVerify different component states render correctly\n\n```tsx\nimport { describe, it, expect, vi } from \"vitest\";\nimport { render, screen } from \"@testing-library/react\";\nimport userEvent from \"@testing-library/user-event\";\nimport { MultilineTextInput, NimbusProvider } from \"@commercetools/nimbus\";\nimport { useState } from \"react\";\n\ndescribe(\"MultilineTextInput - States\", () => {\n it(\"handles disabled state\", async () => {\n const user = userEvent.setup();\n render(\n <NimbusProvider>\n <MultilineTextInput isDisabled aria-label=\"Message\" />\n </NimbusProvider>\n );\n\n const textarea = screen.getByRole(\"textbox\");\n expect(textarea).toBeDisabled();\n\n // Verify cannot type when disabled\n await user.type(textarea, \"Test\");\n expect(textarea).toHaveValue(\"\");\n });\n\n it(\"handles invalid state\", () => {\n render(\n <NimbusProvider>\n <MultilineTextInput isInvalid aria-label=\"Message\" />\n </NimbusProvider>\n );\n\n const textarea = screen.getByRole(\"textbox\");\n expect(textarea).toHaveAttribute(\"data-invalid\", \"true\");\n });\n\n it(\"handles required state\", () => {\n render(\n <NimbusProvider>\n <MultilineTextInput isRequired aria-label=\"Message\" />\n </NimbusProvider>\n );\n\n const textarea = screen.getByRole(\"textbox\");\n expect(textarea).toHaveAttribute(\"aria-required\", \"true\");\n });\n\n it(\"handles read-only state\", () => {\n render(\n <NimbusProvider>\n <MultilineTextInput\n isReadOnly\n value=\"Read-only content\"\n onChange={() => {}}\n aria-label=\"Message\"\n />\n </NimbusProvider>\n );\n\n const textarea = screen.getByRole(\"textbox\");\n expect(textarea).toHaveAttribute(\"readonly\");\n });\n});\n```\n\n### Testing with Character Limits\n\nTest application logic for character counting and validation\n\n```tsx\nimport { describe, it, expect, vi } from \"vitest\";\nimport { render, screen } from \"@testing-library/react\";\nimport userEvent from \"@testing-library/user-event\";\nimport { MultilineTextInput, NimbusProvider } from \"@commercetools/nimbus\";\nimport { useState } from \"react\";\n\ndescribe(\"MultilineTextInput - Character limit\", () => {\n it(\"enforces character limit validation\", async () => {\n const user = userEvent.setup();\n const maxLength = 50;\n\n const TestComponent = () => {\n const [value, setValue] = useState(\"\");\n const isOverLimit = value.length > maxLength;\n\n return (\n <>\n <MultilineTextInput\n value={value}\n onChange={setValue}\n isInvalid={isOverLimit}\n aria-label=\"Comment\"\n />\n <div data-testid=\"char-count\">\n {value.length}/{maxLength}\n </div>\n </>\n );\n };\n\n render(\n <NimbusProvider>\n <TestComponent />\n </NimbusProvider>\n );\n\n const textarea = screen.getByRole(\"textbox\");\n const longText = \"a\".repeat(60); // Exceeds limit\n\n await user.type(textarea, longText);\n\n expect(textarea).toHaveAttribute(\"data-invalid\", \"true\");\n expect(screen.getByTestId(\"char-count\")).toHaveTextContent(\"60/50\");\n });\n});\n```\n\n\n## Resources\n\n- [Storybook](https://nimbus-storybook.vercel.app/?path=/docs/components-multilinetextinput--docs)\n- [React Aria TextField](https://react-spectrum.adobe.com/react-aria/TextField.html)\n- [ARIA Textbox Pattern](https://www.w3.org/WAI/ARIA/apg/patterns/textbox/)\n",
|
|
246
|
+
"toc": [
|
|
247
|
+
{
|
|
248
|
+
"value": "Getting started",
|
|
249
|
+
"href": "#getting-started",
|
|
250
|
+
"depth": 2,
|
|
251
|
+
"numbering": [
|
|
252
|
+
1,
|
|
253
|
+
1
|
|
254
|
+
],
|
|
255
|
+
"parent": "root"
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"value": "Import",
|
|
259
|
+
"href": "#import",
|
|
260
|
+
"depth": 3,
|
|
261
|
+
"numbering": [
|
|
262
|
+
1,
|
|
263
|
+
1,
|
|
264
|
+
1
|
|
265
|
+
],
|
|
266
|
+
"parent": "root"
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"value": "Basic usage",
|
|
270
|
+
"href": "#basic-usage",
|
|
271
|
+
"depth": 3,
|
|
272
|
+
"numbering": [
|
|
273
|
+
1,
|
|
274
|
+
1,
|
|
275
|
+
2
|
|
276
|
+
],
|
|
277
|
+
"parent": "root"
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"value": "Usage examples",
|
|
281
|
+
"href": "#usage-examples",
|
|
282
|
+
"depth": 2,
|
|
283
|
+
"numbering": [
|
|
284
|
+
1,
|
|
285
|
+
2
|
|
286
|
+
],
|
|
287
|
+
"parent": "root"
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
"value": "Size options",
|
|
291
|
+
"href": "#size-options",
|
|
292
|
+
"depth": 3,
|
|
293
|
+
"numbering": [
|
|
294
|
+
1,
|
|
295
|
+
2,
|
|
296
|
+
1
|
|
297
|
+
],
|
|
298
|
+
"parent": "root"
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
"value": "Visual variants",
|
|
302
|
+
"href": "#visual-variants",
|
|
303
|
+
"depth": 3,
|
|
304
|
+
"numbering": [
|
|
305
|
+
1,
|
|
306
|
+
2,
|
|
307
|
+
2
|
|
308
|
+
],
|
|
309
|
+
"parent": "root"
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
"value": "Leading elements",
|
|
313
|
+
"href": "#leading-elements",
|
|
314
|
+
"depth": 3,
|
|
315
|
+
"numbering": [
|
|
316
|
+
1,
|
|
317
|
+
2,
|
|
318
|
+
3
|
|
319
|
+
],
|
|
320
|
+
"parent": "root"
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
"value": "Rows configuration",
|
|
324
|
+
"href": "#rows-configuration",
|
|
325
|
+
"depth": 3,
|
|
326
|
+
"numbering": [
|
|
327
|
+
1,
|
|
328
|
+
2,
|
|
329
|
+
4
|
|
330
|
+
],
|
|
331
|
+
"parent": "root"
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
"value": "Auto-grow functionality",
|
|
335
|
+
"href": "#auto-grow-functionality",
|
|
336
|
+
"depth": 3,
|
|
337
|
+
"numbering": [
|
|
338
|
+
1,
|
|
339
|
+
2,
|
|
340
|
+
5
|
|
341
|
+
],
|
|
342
|
+
"parent": "root"
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
"value": "Disabled state",
|
|
346
|
+
"href": "#disabled-state",
|
|
347
|
+
"depth": 3,
|
|
348
|
+
"numbering": [
|
|
349
|
+
1,
|
|
350
|
+
2,
|
|
351
|
+
6
|
|
352
|
+
],
|
|
353
|
+
"parent": "root"
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
"value": "Invalid state",
|
|
357
|
+
"href": "#invalid-state",
|
|
358
|
+
"depth": 3,
|
|
359
|
+
"numbering": [
|
|
360
|
+
1,
|
|
361
|
+
2,
|
|
362
|
+
7
|
|
363
|
+
],
|
|
364
|
+
"parent": "root"
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
"value": "Read-only state",
|
|
368
|
+
"href": "#read-only-state",
|
|
369
|
+
"depth": 3,
|
|
370
|
+
"numbering": [
|
|
371
|
+
1,
|
|
372
|
+
2,
|
|
373
|
+
8
|
|
374
|
+
],
|
|
375
|
+
"parent": "root"
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
"value": "Uncontrolled mode",
|
|
379
|
+
"href": "#uncontrolled-mode",
|
|
380
|
+
"depth": 3,
|
|
381
|
+
"numbering": [
|
|
382
|
+
1,
|
|
383
|
+
2,
|
|
384
|
+
9
|
|
385
|
+
],
|
|
386
|
+
"parent": "root"
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
"value": "Controlled mode",
|
|
390
|
+
"href": "#controlled-mode",
|
|
391
|
+
"depth": 3,
|
|
392
|
+
"numbering": [
|
|
393
|
+
1,
|
|
394
|
+
2,
|
|
395
|
+
10
|
|
396
|
+
],
|
|
397
|
+
"parent": "root"
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
"value": "Component requirements",
|
|
401
|
+
"href": "#component-requirements",
|
|
402
|
+
"depth": 2,
|
|
403
|
+
"numbering": [
|
|
404
|
+
1,
|
|
405
|
+
3
|
|
406
|
+
],
|
|
407
|
+
"parent": "root"
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
"value": "Accessibility",
|
|
411
|
+
"href": "#accessibility",
|
|
412
|
+
"depth": 2,
|
|
413
|
+
"numbering": [
|
|
414
|
+
1,
|
|
415
|
+
4
|
|
416
|
+
],
|
|
417
|
+
"parent": "root"
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
"value": "Keyboard navigation",
|
|
421
|
+
"href": "#keyboard-navigation",
|
|
422
|
+
"depth": 4,
|
|
423
|
+
"numbering": [
|
|
424
|
+
1,
|
|
425
|
+
4,
|
|
426
|
+
1,
|
|
427
|
+
1
|
|
428
|
+
],
|
|
429
|
+
"parent": "root"
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
"value": "Click-to-focus behavior",
|
|
433
|
+
"href": "#click-to-focus-behavior",
|
|
434
|
+
"depth": 4,
|
|
435
|
+
"numbering": [
|
|
436
|
+
1,
|
|
437
|
+
4,
|
|
438
|
+
1,
|
|
439
|
+
2
|
|
440
|
+
],
|
|
441
|
+
"parent": "root"
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
"value": "API reference",
|
|
445
|
+
"href": "#api-reference",
|
|
446
|
+
"depth": 2,
|
|
447
|
+
"numbering": [
|
|
448
|
+
1,
|
|
449
|
+
5
|
|
450
|
+
],
|
|
451
|
+
"parent": "root"
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
"value": "Common patterns",
|
|
455
|
+
"href": "#common-patterns",
|
|
456
|
+
"depth": 2,
|
|
457
|
+
"numbering": [
|
|
458
|
+
1,
|
|
459
|
+
6
|
|
460
|
+
],
|
|
461
|
+
"parent": "root"
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
"value": "Comment input with character limit",
|
|
465
|
+
"href": "#comment-input-with-character-limit",
|
|
466
|
+
"depth": 3,
|
|
467
|
+
"numbering": [
|
|
468
|
+
1,
|
|
469
|
+
6,
|
|
470
|
+
1
|
|
471
|
+
],
|
|
472
|
+
"parent": "root"
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
"value": "Auto-growing feedback form",
|
|
476
|
+
"href": "#auto-growing-feedback-form",
|
|
477
|
+
"depth": 3,
|
|
478
|
+
"numbering": [
|
|
479
|
+
1,
|
|
480
|
+
6,
|
|
481
|
+
2
|
|
482
|
+
],
|
|
483
|
+
"parent": "root"
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
"value": "Multi-field form with validation",
|
|
487
|
+
"href": "#multi-field-form-with-validation",
|
|
488
|
+
"depth": 3,
|
|
489
|
+
"numbering": [
|
|
490
|
+
1,
|
|
491
|
+
6,
|
|
492
|
+
3
|
|
493
|
+
],
|
|
494
|
+
"parent": "root"
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
"value": "Testing your implementation",
|
|
498
|
+
"href": "#testing-your-implementation",
|
|
499
|
+
"depth": 2,
|
|
500
|
+
"numbering": [
|
|
501
|
+
1,
|
|
502
|
+
7
|
|
503
|
+
],
|
|
504
|
+
"parent": "root"
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
"value": "Basic Rendering Tests",
|
|
508
|
+
"href": "#basic-rendering-tests",
|
|
509
|
+
"depth": 3,
|
|
510
|
+
"numbering": [
|
|
511
|
+
1,
|
|
512
|
+
7,
|
|
513
|
+
1
|
|
514
|
+
],
|
|
515
|
+
"parent": "root"
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
"value": "Interaction Tests",
|
|
519
|
+
"href": "#interaction-tests",
|
|
520
|
+
"depth": 3,
|
|
521
|
+
"numbering": [
|
|
522
|
+
1,
|
|
523
|
+
7,
|
|
524
|
+
2
|
|
525
|
+
],
|
|
526
|
+
"parent": "root"
|
|
527
|
+
},
|
|
528
|
+
{
|
|
529
|
+
"value": "Testing States",
|
|
530
|
+
"href": "#testing-states",
|
|
531
|
+
"depth": 3,
|
|
532
|
+
"numbering": [
|
|
533
|
+
1,
|
|
534
|
+
7,
|
|
535
|
+
3
|
|
536
|
+
],
|
|
537
|
+
"parent": "root"
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
"value": "Testing with Character Limits",
|
|
541
|
+
"href": "#testing-with-character-limits",
|
|
542
|
+
"depth": 3,
|
|
543
|
+
"numbering": [
|
|
544
|
+
1,
|
|
545
|
+
7,
|
|
546
|
+
4
|
|
547
|
+
],
|
|
548
|
+
"parent": "root"
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
"value": "Resources",
|
|
552
|
+
"href": "#resources",
|
|
553
|
+
"depth": 2,
|
|
554
|
+
"numbering": [
|
|
555
|
+
1,
|
|
556
|
+
8
|
|
557
|
+
],
|
|
558
|
+
"parent": "root"
|
|
559
|
+
}
|
|
560
|
+
]
|
|
561
|
+
},
|
|
562
|
+
"guidelines": {
|
|
563
|
+
"mdx": "\n## Guidelines\n\nNumber input guidelines focus on clear labels, suitable ranges, easy interaction\nvia keyboard and buttons, and strong error handling, all while following WCAG\naccessibility rules.\n\n### Best practices\n\n- **Labels:** Always include a concise and clear label using sentence case.\n Labels should not be hidden. In the rare case where context is sufficient and\n label can be absent, review the design with an accessibility expert.\n- **Placeholder text:** Use concise placeholder text to provide an example or\n hint about the expected content. If consistent help is needed for context,\n utilize an info icon or use helper text below the field, as placeholder text\n disappears when a user interacts with the field, and some find it difficult to\n read placeholder text.\n- **Initial height:** Set an appropriate initial height (min. rows) that\n accommodates the typical expected input length without requiring immediate\n scrolling or resizing\n- **Maximum height:** Define a reasonable max. rows to prevent the input from\n growing excessively large and pushing other content off-screen. Once the\n maximum is reached, the content should become scrollable.\n- **Resizability:** Enable resizing when users might need to view more content\n at once or prefer a larger input area. Ensure the resize handle is visually\n clear and functional.\n- **Validation:**\n - Provide clear and concise error messages below the input field, replacing\n any helper text.\n - Highlight errors visually, for example, with a red border and an error icon.\n - Validate input for any specified constraints (e.g., character limits,\n required fields).\n\n### Usage\n\nA multi-line text input is used when users need to enter extended textual\ninformation, providing ample space and flexibility.\n\n> [!TIP]\\\n> When to use\n\n- Collecting descriptions, comments, or notes.\n- Allowing users to write full sentences or paragraphs.\n- When the length of the expected input is variable and could range from a few\n words to multiple paragraphs.\n- When the user needs to see a significant portion of their input at once.\n\n> [!CAUTION]\\\n> When not to use\n\n- For single-line inputs (e.g., names, email addresses); use a single-line text\n input.\n- For highly structured data that would be better handled with multiple specific\n input fields (e.g., separate fields for street, city, state).\n- When character limits are very strict and a precise visual count is required\n (though character counters can be added).\n\n### Labeling and sizing\n\nProviding clear labels and contextual information aids users to fill out the\ncorrect information.\n\n> [!TIP]\\\n> **Do**\n>\n> - Do always include a label.\n> - Do include helper text to guide users.\n> - Do set an appropriate initial height.\n\n```jsx live\nconst App = () => (\n <MultilineTextInput\n size=\"md\"\n placeholder=\"well described placeholder\"\n aria-label=\"Medium input\"\n value=\"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\"\n rows={5}\n />\n)\n```\n\n> [!CAUTION]\\\n> **Don't**\n>\n> - Don’t use for single-line inputs.\n> - Don’t hide labels.\n\n```jsx live\nconst App = () => (\n <MultilineTextInput\n size=\"md\"\n placeholder=\"well described placeholder\"\n aria-label=\"Medium input\"\n value=\"1:30\"\n />\n)\n```\n",
|
|
564
|
+
"toc": [
|
|
565
|
+
{
|
|
566
|
+
"value": "Guidelines",
|
|
567
|
+
"href": "#guidelines",
|
|
568
|
+
"depth": 2,
|
|
569
|
+
"numbering": [
|
|
570
|
+
1,
|
|
571
|
+
1
|
|
572
|
+
],
|
|
573
|
+
"parent": "root"
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
"value": "Best practices",
|
|
577
|
+
"href": "#best-practices",
|
|
578
|
+
"depth": 3,
|
|
579
|
+
"numbering": [
|
|
580
|
+
1,
|
|
581
|
+
1,
|
|
582
|
+
1
|
|
583
|
+
],
|
|
584
|
+
"parent": "root"
|
|
585
|
+
},
|
|
586
|
+
{
|
|
587
|
+
"value": "Usage",
|
|
588
|
+
"href": "#usage",
|
|
589
|
+
"depth": 3,
|
|
590
|
+
"numbering": [
|
|
591
|
+
1,
|
|
592
|
+
1,
|
|
593
|
+
2
|
|
594
|
+
],
|
|
595
|
+
"parent": "root"
|
|
596
|
+
},
|
|
597
|
+
{
|
|
598
|
+
"value": "Labeling and sizing",
|
|
599
|
+
"href": "#labeling-and-sizing",
|
|
600
|
+
"depth": 3,
|
|
601
|
+
"numbering": [
|
|
602
|
+
1,
|
|
603
|
+
1,
|
|
604
|
+
3
|
|
605
|
+
],
|
|
606
|
+
"parent": "root"
|
|
607
|
+
}
|
|
608
|
+
]
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
}
|