@commercetools/nimbus-mcp 0.1.0 → 2.10.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 +10913 -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-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 +82 -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 +278 -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,661 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"id": "Components-ProgressBar",
|
|
4
|
+
"title": "Progress bar",
|
|
5
|
+
"exportName": "ProgressBar",
|
|
6
|
+
"description": "A linear visual indicator that displays the loading or completion state of an ongoing process. It can represent either determinate or indeterminate progress.",
|
|
7
|
+
"lifecycleState": "Stable",
|
|
8
|
+
"order": 999,
|
|
9
|
+
"repoPath": "packages/nimbus/src/components/progress-bar/progress-bar.mdx",
|
|
10
|
+
"menu": [
|
|
11
|
+
"Components",
|
|
12
|
+
"Feedback",
|
|
13
|
+
"Progress bar"
|
|
14
|
+
],
|
|
15
|
+
"route": "components/feedback/progress-bar",
|
|
16
|
+
"tags": [
|
|
17
|
+
"component",
|
|
18
|
+
"progress",
|
|
19
|
+
"loading"
|
|
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": "Visuals",
|
|
55
|
+
"href": "#visuals",
|
|
56
|
+
"depth": 3,
|
|
57
|
+
"numbering": [
|
|
58
|
+
1,
|
|
59
|
+
2,
|
|
60
|
+
1
|
|
61
|
+
],
|
|
62
|
+
"parent": "root"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"value": "On white background",
|
|
66
|
+
"href": "#on-white-background",
|
|
67
|
+
"depth": 4,
|
|
68
|
+
"numbering": [
|
|
69
|
+
1,
|
|
70
|
+
2,
|
|
71
|
+
1,
|
|
72
|
+
1
|
|
73
|
+
],
|
|
74
|
+
"parent": "root"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"value": "On dark background",
|
|
78
|
+
"href": "#on-dark-background",
|
|
79
|
+
"depth": 4,
|
|
80
|
+
"numbering": [
|
|
81
|
+
1,
|
|
82
|
+
2,
|
|
83
|
+
1,
|
|
84
|
+
2
|
|
85
|
+
],
|
|
86
|
+
"parent": "root"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"value": "Size",
|
|
90
|
+
"href": "#size",
|
|
91
|
+
"depth": 3,
|
|
92
|
+
"numbering": [
|
|
93
|
+
1,
|
|
94
|
+
2,
|
|
95
|
+
2
|
|
96
|
+
],
|
|
97
|
+
"parent": "root"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"value": "Layouts",
|
|
101
|
+
"href": "#layouts",
|
|
102
|
+
"depth": 3,
|
|
103
|
+
"numbering": [
|
|
104
|
+
1,
|
|
105
|
+
2,
|
|
106
|
+
3
|
|
107
|
+
],
|
|
108
|
+
"parent": "root"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"value": "Animation logic",
|
|
112
|
+
"href": "#animation-logic",
|
|
113
|
+
"depth": 3,
|
|
114
|
+
"numbering": [
|
|
115
|
+
1,
|
|
116
|
+
2,
|
|
117
|
+
4
|
|
118
|
+
],
|
|
119
|
+
"parent": "root"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"value": "Dynamic",
|
|
123
|
+
"href": "#dynamic",
|
|
124
|
+
"depth": 4,
|
|
125
|
+
"numbering": [
|
|
126
|
+
1,
|
|
127
|
+
2,
|
|
128
|
+
4,
|
|
129
|
+
1
|
|
130
|
+
],
|
|
131
|
+
"parent": "root"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"value": "Static",
|
|
135
|
+
"href": "#static",
|
|
136
|
+
"depth": 4,
|
|
137
|
+
"numbering": [
|
|
138
|
+
1,
|
|
139
|
+
2,
|
|
140
|
+
4,
|
|
141
|
+
2
|
|
142
|
+
],
|
|
143
|
+
"parent": "root"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"value": "Indeterminate",
|
|
147
|
+
"href": "#indeterminate",
|
|
148
|
+
"depth": 4,
|
|
149
|
+
"numbering": [
|
|
150
|
+
1,
|
|
151
|
+
2,
|
|
152
|
+
4,
|
|
153
|
+
3
|
|
154
|
+
],
|
|
155
|
+
"parent": "root"
|
|
156
|
+
}
|
|
157
|
+
],
|
|
158
|
+
"figmaLink": "https://www.figma.com/design/AvtPX6g7OGGCRvNlatGOIY/NIMBUS-design-system?node-id=5748-36984&m=dev",
|
|
159
|
+
"layout": "app-frame",
|
|
160
|
+
"tabs": [
|
|
161
|
+
{
|
|
162
|
+
"key": "overview",
|
|
163
|
+
"title": "Overview",
|
|
164
|
+
"order": 0
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"key": "guidelines",
|
|
168
|
+
"title": "Guidelines",
|
|
169
|
+
"order": 2
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"key": "dev",
|
|
173
|
+
"title": "Implementation",
|
|
174
|
+
"order": 3
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"key": "a11y",
|
|
178
|
+
"title": "Accessibility",
|
|
179
|
+
"order": 4
|
|
180
|
+
}
|
|
181
|
+
]
|
|
182
|
+
},
|
|
183
|
+
"mdx": "\n## Overview\n\nA progress bar's primary usage is to visually communicate to the user that a\nprocess is ongoing. If used in combination with a flow or tasks, a progress bar\ncan give a visual indicator of where they currently are in the process and\nestimate how much is left to complete the task.\n\n### Resources\n\nDeep dive into implementation details and access the Nimbus design library.\n\n[Figma library](https://www.figma.com/design/AvtPX6g7OGGCRvNlatGOIY/NIMBUS-design-system?node-id=5748-36984&m=dev)\n\n## Variables\n\nGet familiar with the features.\n\n### Visuals\n\n#### On white background\n\nMost common, progress bar is used on white backgrounds.\n\n```jsx live\nconst App = () => (\n <ProgressBar\n value={50}\n label=\"\"\n colorPalette=\"primary\"\n />\n)\n```\n\n#### On dark background\n\nIf being used on a dark background, use the contrast variant.\n\n```jsx live\nconst App = () => (\n <Box bg=\"neutral.9\" p=\"600\">\n <ProgressBar\n value={50}\n label=\"\"\n variant=\"contrast\"\n colorPalette=\"primary\"\n />\n </Box>\n)\n```\n\n### Size\n\nThere are two sizes to progress bar: the default size is medium (md) and\n2x-small (2xs).\n\n```jsx live\nconst App = () => (\n <Stack direction=\"column\" gap=\"50\" alignItems=\"stretch\">\n <ProgressBar\n value={75}\n label=\"\"\n size=\"2xs\"\n colorPalette=\"primary\"\n />\n <ProgressBar\n value={75}\n label=\"\"\n size=\"md\"\n colorPalette=\"primary\"\n />\n </Stack>\n)\n```\n\n### Layouts\n\nCustomizable layouts for different use cases, and to fit the UI best.\n\n```jsx live\nconst App = () => (\n <Stack direction=\"column\" gap=\"200\" alignItems=\"stretch\">\n <ProgressBar\n value={50}\n label=\"Stacked label\"\n layout=\"stacked\"\n colorPalette=\"primary\"\n />\n <ProgressBar\n value={50}\n label=\"Inline label\"\n layout=\"inline\"\n colorPalette=\"primary\"\n />\n </Stack>\n)\n```\n\n### Animation logic\n\nTwo options for loading animations based on timing.\n\n#### Dynamic\n\nA determinate progress bar indicates a specific percentage of completion. This\nis useful when the total time or size of a task is known. For dynamic loading,\nthe color gradient is animated.\n\n```jsx live\nconst App = () => {\n const [value, setValue] = React.useState(0);\n const [isRunning, setIsRunning] = React.useState(false);\n\n React.useEffect(() => {\n if (!isRunning) return;\n\n const interval = setInterval(() => {\n setValue((prev) => {\n if (prev >= 100) {\n setIsRunning(false);\n return 100;\n }\n return prev + 10;\n });\n }, 500);\n\n return () => clearInterval(interval);\n }, [isRunning]);\n\n const handleStart = () => {\n setValue(0);\n setIsRunning(true);\n };\n\n return (\n <Stack direction=\"column\" gap=\"400\" alignItems=\"stretch\">\n <ProgressBar\n value={value}\n label=\"Loading...\"\n colorPalette=\"primary\"\n />\n <Button\n onClick={handleStart}\n isDisabled={isRunning}\n width=\"fit-content\"\n colorPalette=\"primary\"\n variant=\"solid\"\n >\n Start\n </Button>\n </Stack>\n )\n}\n```\n\n#### Static\n\nA static loading bar allows a viewer to know where they are currently in the\nprocess. Static progress bars do not have an animated color gradient.\n\n```jsx live\nconst App = () => {\n const [currentLesson, setCurrentLesson] = React.useState(5);\n const totalLessons = 10;\n const progress = (currentLesson / totalLessons) * 100;\n\n const handleNextLesson = () => {\n if (currentLesson < totalLessons) {\n setCurrentLesson(prev => prev + 1);\n }\n };\n\n return (\n <Stack direction=\"column\" gap=\"400\" alignItems=\"stretch\">\n <ProgressBar\n value={progress}\n label=\"Lessons completed\"\n colorPalette=\"primary\"\n />\n <Button\n variant=\"outline\"\n width=\"fit-content\"\n onClick={handleNextLesson}\n isDisabled={currentLesson >= totalLessons}\n >\n Next lesson\n </Button>\n </Stack>\n )\n}\n```\n\n#### Indeterminate\n\nAn indeterminate progress bar shows that an operation is in progress without\nindicating how much of it is complete. This is useful for tasks with an unknown\nduration.\n\n```jsx live\nconst App = () => (\n <ProgressBar\n isIndeterminate={true}\n label=\"Uploading your files...\"\n colorPalette=\"primary\"\n />\n)\n```\n",
|
|
184
|
+
"views": {
|
|
185
|
+
"overview": {
|
|
186
|
+
"mdx": "\n## Overview\n\nA progress bar's primary usage is to visually communicate to the user that a\nprocess is ongoing. If used in combination with a flow or tasks, a progress bar\ncan give a visual indicator of where they currently are in the process and\nestimate how much is left to complete the task.\n\n### Resources\n\nDeep dive into implementation details and access the Nimbus design library.\n\n[Figma library](https://www.figma.com/design/AvtPX6g7OGGCRvNlatGOIY/NIMBUS-design-system?node-id=5748-36984&m=dev)\n\n## Variables\n\nGet familiar with the features.\n\n### Visuals\n\n#### On white background\n\nMost common, progress bar is used on white backgrounds.\n\n```jsx live\nconst App = () => (\n <ProgressBar\n value={50}\n label=\"\"\n colorPalette=\"primary\"\n />\n)\n```\n\n#### On dark background\n\nIf being used on a dark background, use the contrast variant.\n\n```jsx live\nconst App = () => (\n <Box bg=\"neutral.9\" p=\"600\">\n <ProgressBar\n value={50}\n label=\"\"\n variant=\"contrast\"\n colorPalette=\"primary\"\n />\n </Box>\n)\n```\n\n### Size\n\nThere are two sizes to progress bar: the default size is medium (md) and\n2x-small (2xs).\n\n```jsx live\nconst App = () => (\n <Stack direction=\"column\" gap=\"50\" alignItems=\"stretch\">\n <ProgressBar\n value={75}\n label=\"\"\n size=\"2xs\"\n colorPalette=\"primary\"\n />\n <ProgressBar\n value={75}\n label=\"\"\n size=\"md\"\n colorPalette=\"primary\"\n />\n </Stack>\n)\n```\n\n### Layouts\n\nCustomizable layouts for different use cases, and to fit the UI best.\n\n```jsx live\nconst App = () => (\n <Stack direction=\"column\" gap=\"200\" alignItems=\"stretch\">\n <ProgressBar\n value={50}\n label=\"Stacked label\"\n layout=\"stacked\"\n colorPalette=\"primary\"\n />\n <ProgressBar\n value={50}\n label=\"Inline label\"\n layout=\"inline\"\n colorPalette=\"primary\"\n />\n </Stack>\n)\n```\n\n### Animation logic\n\nTwo options for loading animations based on timing.\n\n#### Dynamic\n\nA determinate progress bar indicates a specific percentage of completion. This\nis useful when the total time or size of a task is known. For dynamic loading,\nthe color gradient is animated.\n\n```jsx live\nconst App = () => {\n const [value, setValue] = React.useState(0);\n const [isRunning, setIsRunning] = React.useState(false);\n\n React.useEffect(() => {\n if (!isRunning) return;\n\n const interval = setInterval(() => {\n setValue((prev) => {\n if (prev >= 100) {\n setIsRunning(false);\n return 100;\n }\n return prev + 10;\n });\n }, 500);\n\n return () => clearInterval(interval);\n }, [isRunning]);\n\n const handleStart = () => {\n setValue(0);\n setIsRunning(true);\n };\n\n return (\n <Stack direction=\"column\" gap=\"400\" alignItems=\"stretch\">\n <ProgressBar\n value={value}\n label=\"Loading...\"\n colorPalette=\"primary\"\n />\n <Button\n onClick={handleStart}\n isDisabled={isRunning}\n width=\"fit-content\"\n colorPalette=\"primary\"\n variant=\"solid\"\n >\n Start\n </Button>\n </Stack>\n )\n}\n```\n\n#### Static\n\nA static loading bar allows a viewer to know where they are currently in the\nprocess. Static progress bars do not have an animated color gradient.\n\n```jsx live\nconst App = () => {\n const [currentLesson, setCurrentLesson] = React.useState(5);\n const totalLessons = 10;\n const progress = (currentLesson / totalLessons) * 100;\n\n const handleNextLesson = () => {\n if (currentLesson < totalLessons) {\n setCurrentLesson(prev => prev + 1);\n }\n };\n\n return (\n <Stack direction=\"column\" gap=\"400\" alignItems=\"stretch\">\n <ProgressBar\n value={progress}\n label=\"Lessons completed\"\n colorPalette=\"primary\"\n />\n <Button\n variant=\"outline\"\n width=\"fit-content\"\n onClick={handleNextLesson}\n isDisabled={currentLesson >= totalLessons}\n >\n Next lesson\n </Button>\n </Stack>\n )\n}\n```\n\n#### Indeterminate\n\nAn indeterminate progress bar shows that an operation is in progress without\nindicating how much of it is complete. This is useful for tasks with an unknown\nduration.\n\n```jsx live\nconst App = () => (\n <ProgressBar\n isIndeterminate={true}\n label=\"Uploading your files...\"\n colorPalette=\"primary\"\n />\n)\n```\n",
|
|
187
|
+
"toc": [
|
|
188
|
+
{
|
|
189
|
+
"value": "Overview",
|
|
190
|
+
"href": "#overview",
|
|
191
|
+
"depth": 2,
|
|
192
|
+
"numbering": [
|
|
193
|
+
1,
|
|
194
|
+
1
|
|
195
|
+
],
|
|
196
|
+
"parent": "root"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"value": "Resources",
|
|
200
|
+
"href": "#resources",
|
|
201
|
+
"depth": 3,
|
|
202
|
+
"numbering": [
|
|
203
|
+
1,
|
|
204
|
+
1,
|
|
205
|
+
1
|
|
206
|
+
],
|
|
207
|
+
"parent": "root"
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"value": "Variables",
|
|
211
|
+
"href": "#variables",
|
|
212
|
+
"depth": 2,
|
|
213
|
+
"numbering": [
|
|
214
|
+
1,
|
|
215
|
+
2
|
|
216
|
+
],
|
|
217
|
+
"parent": "root"
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"value": "Visuals",
|
|
221
|
+
"href": "#visuals",
|
|
222
|
+
"depth": 3,
|
|
223
|
+
"numbering": [
|
|
224
|
+
1,
|
|
225
|
+
2,
|
|
226
|
+
1
|
|
227
|
+
],
|
|
228
|
+
"parent": "root"
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"value": "On white background",
|
|
232
|
+
"href": "#on-white-background",
|
|
233
|
+
"depth": 4,
|
|
234
|
+
"numbering": [
|
|
235
|
+
1,
|
|
236
|
+
2,
|
|
237
|
+
1,
|
|
238
|
+
1
|
|
239
|
+
],
|
|
240
|
+
"parent": "root"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"value": "On dark background",
|
|
244
|
+
"href": "#on-dark-background",
|
|
245
|
+
"depth": 4,
|
|
246
|
+
"numbering": [
|
|
247
|
+
1,
|
|
248
|
+
2,
|
|
249
|
+
1,
|
|
250
|
+
2
|
|
251
|
+
],
|
|
252
|
+
"parent": "root"
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"value": "Size",
|
|
256
|
+
"href": "#size",
|
|
257
|
+
"depth": 3,
|
|
258
|
+
"numbering": [
|
|
259
|
+
1,
|
|
260
|
+
2,
|
|
261
|
+
2
|
|
262
|
+
],
|
|
263
|
+
"parent": "root"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"value": "Layouts",
|
|
267
|
+
"href": "#layouts",
|
|
268
|
+
"depth": 3,
|
|
269
|
+
"numbering": [
|
|
270
|
+
1,
|
|
271
|
+
2,
|
|
272
|
+
3
|
|
273
|
+
],
|
|
274
|
+
"parent": "root"
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"value": "Animation logic",
|
|
278
|
+
"href": "#animation-logic",
|
|
279
|
+
"depth": 3,
|
|
280
|
+
"numbering": [
|
|
281
|
+
1,
|
|
282
|
+
2,
|
|
283
|
+
4
|
|
284
|
+
],
|
|
285
|
+
"parent": "root"
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"value": "Dynamic",
|
|
289
|
+
"href": "#dynamic",
|
|
290
|
+
"depth": 4,
|
|
291
|
+
"numbering": [
|
|
292
|
+
1,
|
|
293
|
+
2,
|
|
294
|
+
4,
|
|
295
|
+
1
|
|
296
|
+
],
|
|
297
|
+
"parent": "root"
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
"value": "Static",
|
|
301
|
+
"href": "#static",
|
|
302
|
+
"depth": 4,
|
|
303
|
+
"numbering": [
|
|
304
|
+
1,
|
|
305
|
+
2,
|
|
306
|
+
4,
|
|
307
|
+
2
|
|
308
|
+
],
|
|
309
|
+
"parent": "root"
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
"value": "Indeterminate",
|
|
313
|
+
"href": "#indeterminate",
|
|
314
|
+
"depth": 4,
|
|
315
|
+
"numbering": [
|
|
316
|
+
1,
|
|
317
|
+
2,
|
|
318
|
+
4,
|
|
319
|
+
3
|
|
320
|
+
],
|
|
321
|
+
"parent": "root"
|
|
322
|
+
}
|
|
323
|
+
]
|
|
324
|
+
},
|
|
325
|
+
"a11y": {
|
|
326
|
+
"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 <ProgressBar value={40} label=\"Loading...\" />\n)\n```\n\n### Accessibility standards\n\n- **Use ARIA attributes:** Use `aria-valuenow`, `aria-valuemin`, and\n `aria-valuemax` to specify the current value, minimum value, and maximum value\n of a determinate progress bar.\n- **Provide an accessible label:** Use `aria-label` or `aria-labelledby` to give\n the progress bar a descriptive name.\n- **Announce changes:** Use aria-live regions to announce changes in progress to\n screen reader users.\n- **Provide clear status:** Use text to indicate the current state (e.g.,\n 'uploading', 'complete') for users who cannot see the visual component.\n- **Do not rely on color alone:** Use icons or text labels to indicate status,\n such as an error state, for users with color vision deficiency.\n",
|
|
327
|
+
"toc": [
|
|
328
|
+
{
|
|
329
|
+
"value": "Accessibility",
|
|
330
|
+
"href": "#accessibility",
|
|
331
|
+
"depth": 2,
|
|
332
|
+
"numbering": [
|
|
333
|
+
1,
|
|
334
|
+
1
|
|
335
|
+
],
|
|
336
|
+
"parent": "root"
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
"value": "Accessibility standards",
|
|
340
|
+
"href": "#accessibility-standards",
|
|
341
|
+
"depth": 3,
|
|
342
|
+
"numbering": [
|
|
343
|
+
1,
|
|
344
|
+
1,
|
|
345
|
+
1
|
|
346
|
+
],
|
|
347
|
+
"parent": "root"
|
|
348
|
+
}
|
|
349
|
+
]
|
|
350
|
+
},
|
|
351
|
+
"dev": {
|
|
352
|
+
"mdx": "\n\n## Getting started\n\n### Import\n\n```tsx\nimport { ProgressBar, type ProgressBarProps } from '@commercetools/nimbus';\n```\n\n### Basic usage\n\nThe simplest implementation requires a `value` and a `label`. The default range is 0 to 100.\n\n```jsx live-dev\nconst App = () => (\n <ProgressBar value={40} label=\"Loading...\" />\n)\n```\n\n## Usage examples\n\n### Size options\n\nThe `2xs` and `md` (default) size variants are available to match your interface density:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"column\" gap=\"400\">\n <ProgressBar value={60} size=\"2xs\" label=\"Extra small (2xs)\" />\n <ProgressBar value={60} size=\"md\" label=\"Medium (md)\" />\n </Stack>\n)\n```\n\n### Visual variants\n\nChoose between `solid` (default) and `contrast` variants to match your design context:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"column\" gap=\"400\">\n <ProgressBar value={75} variant=\"solid\" label=\"Solid variant\" />\n <Box bg=\"primary.9\" p=\"400\" borderRadius=\"200\">\n <ProgressBar value={75} variant=\"contrast\" label=\"Contrast variant\" />\n </Box>\n </Stack>\n)\n```\n\n### Layout options\n\nThe `layout` prop controls the positioning of the label and value text:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"column\" gap=\"600\">\n <ProgressBar\n value={50}\n layout=\"stacked\"\n label=\"Stacked (default)\"\n />\n <ProgressBar\n value={50}\n layout=\"inline\"\n label=\"Inline\"\n />\n <ProgressBar\n value={50}\n layout=\"minimal\"\n aria-label=\"Minimal (no visual label)\"\n />\n </Stack>\n)\n```\n\n> [!TIP]\\\n> When using `layout=\"minimal\"`, the visual label is hidden. You **must** provide an `aria-label` for accessibility.\n\n### Indeterminate state\n\nUse the `isIndeterminate` prop when the progress duration is unknown. The bar will show an animated loading state:\n\n```jsx live-dev\nconst App = () => (\n <ProgressBar\n isIndeterminate\n label=\"Processing...\"\n />\n)\n```\n\n### Dynamic vs. Static progress\n\nThe `isDynamic` prop indicates whether the progress represents an active, ongoing process (like a download) or a static indicator (like a step in a wizard).\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"column\" gap=\"600\">\n <Stack gap=\"200\">\n <ProgressBar\n value={65}\n isDynamic={true}\n label=\"Dynamic progress\"\n />\n <Text fontSize=\"sm\" color=\"gray.600\">\n Used for active processes (uploads, downloads).\n </Text>\n </Stack>\n\n <Stack gap=\"200\">\n <ProgressBar\n value={60}\n isDynamic={false}\n label=\"Static progress\"\n />\n <Text fontSize=\"sm\" color=\"gray.600\">\n Used for static indicators (wizard steps, capacity).\n </Text>\n </Stack>\n </Stack>\n)\n```\n\n### Custom formatting\n\nUse `formatOptions` to customize how the value is displayed. This accepts standard `Intl.NumberFormatOptions`.\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"column\" gap=\"400\">\n <ProgressBar\n value={75}\n label=\"Percentage (default)\"\n formatOptions={{ style: \"percent\" }}\n />\n <ProgressBar\n value={1500}\n maxValue={2000}\n label=\"Currency\"\n formatOptions={{ style: \"currency\", currency: \"USD\" }}\n />\n <ProgressBar\n value={42}\n label=\"Storage\"\n formatOptions={{ style: \"unit\", unit: \"gigabyte\" }}\n />\n </Stack>\n)\n```\n\n### Color palettes\n\nThe `colorPalette` prop allows you to theme the progress bar using the system color tokens:\n\n```jsx live-dev\nconst App = () => (\n <Stack direction=\"column\" gap=\"400\">\n <ProgressBar value={80} colorPalette=\"primary\" label=\"Primary\" />\n <ProgressBar value={60} colorPalette=\"green\" label=\"Green\" />\n <ProgressBar value={40} colorPalette=\"red\" label=\"Red\" />\n <ProgressBar value={90} colorPalette=\"orange\" label=\"Orange\" />\n </Stack>\n)\n```\n\n## Component requirements\n\n## Accessibility\n\nThe ProgressBar handles most accessibility requirements internally using `role=\"progressbar\"`. However, you must always ensure the component has an accessible label.\n\n- **Visual Label**: Use the `label` prop. This automatically associates the label with the progress bar.\n- **Hidden Label**: If using `layout=\"minimal\"` or hiding the label, use `aria-label` to describe the progress bar.\n\n```tsx\n// ✅ Accessible with visible label\n<ProgressBar value={50} label=\"Loading files\" />\n\n// ✅ Accessible with hidden label\n<ProgressBar value={50} layout=\"minimal\" aria-label=\"Loading files\" />\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 = \"upload-progress-bar\";\n\nexport const Example = () => (\n <ProgressBar id={PERSISTENT_ID} value={45} label=\"Upload\" />\n);\n```\n\n## API reference\n\n<PropsTable id=\"ProgressBar\" />\n\n## Common patterns\n\n### Simulated file upload\n\nThis example demonstrates how to update the progress bar value dynamically to simulate a file upload process.\n\n```jsx live-dev\nconst App = () => {\n const [progress, setProgress] = useState(0);\n const [isRunning, setIsRunning] = useState(false);\n\n useEffect(() => {\n let timer;\n if (isRunning && progress < 100) {\n timer = setInterval(() => {\n setProgress((prev) => Math.min(prev + Math.random() * 10, 100));\n }, 500);\n } else if (progress >= 100) {\n setIsRunning(false);\n }\n return () => clearInterval(timer);\n }, [isRunning, progress]);\n\n const handleStart = () => {\n setProgress(0);\n setIsRunning(true);\n };\n\n return (\n <Stack direction=\"column\" gap=\"400\">\n <ProgressBar\n value={progress}\n label={progress < 100 ? \"Uploading...\" : \"Upload Complete\"}\n colorPalette={progress < 100 ? \"primary\" : \"green\"}\n />\n <Button\n onClick={handleStart}\n disabled={isRunning}\n variant=\"secondary\"\n width=\"fit-content\"\n >\n {progress === 100 ? \"Restart Upload\" : \"Start Upload\"}\n </Button>\n </Stack>\n );\n}\n```\n\n## Testing your implementation\n\nThese examples demonstrate how to test your implementation when using ProgressBar 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 and accessibility attributes\n\n```tsx\nimport { describe, it, expect } from \"vitest\";\nimport { render, screen } from \"@testing-library/react\";\nimport { ProgressBar, NimbusProvider } from \"@commercetools/nimbus\";\n\ndescribe(\"ProgressBar - Basic rendering\", () => {\n it(\"renders progress bar element\", () => {\n render(\n <NimbusProvider>\n <ProgressBar value={50} label=\"Loading\" />\n </NimbusProvider>\n );\n\n const progressBar = screen.getByRole(\"progressbar\");\n expect(progressBar).toBeInTheDocument();\n });\n\n it(\"renders with correct aria-label from label prop\", () => {\n render(\n <NimbusProvider>\n <ProgressBar value={75} label=\"Upload progress\" />\n </NimbusProvider>\n );\n\n const progressBar = screen.getByRole(\"progressbar\", {\n name: /upload progress/i,\n });\n expect(progressBar).toBeInTheDocument();\n });\n\n it(\"renders with aria-label when provided\", () => {\n render(\n <NimbusProvider>\n <ProgressBar value={50} layout=\"minimal\" aria-label=\"File processing\" />\n </NimbusProvider>\n );\n\n expect(\n screen.getByRole(\"progressbar\", { name: /file processing/i })\n ).toBeInTheDocument();\n });\n\n it(\"has correct aria-valuenow attribute\", () => {\n render(\n <NimbusProvider>\n <ProgressBar value={60} label=\"Progress\" />\n </NimbusProvider>\n );\n\n const progressBar = screen.getByRole(\"progressbar\");\n expect(progressBar).toHaveAttribute(\"aria-valuenow\", \"60\");\n });\n});\n```\n\n### Testing Value Ranges\n\nTest different value ranges and custom min/max values\n\n```tsx\nimport { describe, it, expect } from \"vitest\";\nimport { render, screen } from \"@testing-library/react\";\nimport { ProgressBar, NimbusProvider } from \"@commercetools/nimbus\";\n\ndescribe(\"ProgressBar - Value ranges\", () => {\n it(\"handles default range (0-100)\", () => {\n render(\n <NimbusProvider>\n <ProgressBar value={50} label=\"Progress\" />\n </NimbusProvider>\n );\n\n const progressBar = screen.getByRole(\"progressbar\");\n expect(progressBar).toHaveAttribute(\"aria-valuenow\", \"50\");\n expect(progressBar).toHaveAttribute(\"aria-valuemin\", \"0\");\n expect(progressBar).toHaveAttribute(\"aria-valuemax\", \"100\");\n });\n\n it(\"handles custom min and max values\", () => {\n render(\n <NimbusProvider>\n <ProgressBar value={50} minValue={0} maxValue={200} label=\"Custom\" />\n </NimbusProvider>\n );\n\n const progressBar = screen.getByRole(\"progressbar\");\n expect(progressBar).toHaveAttribute(\"aria-valuenow\", \"50\");\n expect(progressBar).toHaveAttribute(\"aria-valuemin\", \"0\");\n expect(progressBar).toHaveAttribute(\"aria-valuemax\", \"200\");\n });\n\n it(\"handles boundary values\", () => {\n const { rerender } = render(\n <NimbusProvider>\n <ProgressBar value={0} label=\"Start\" />\n </NimbusProvider>\n );\n\n expect(screen.getByRole(\"progressbar\")).toHaveAttribute(\n \"aria-valuenow\",\n \"0\"\n );\n\n rerender(\n <NimbusProvider>\n <ProgressBar value={100} label=\"Complete\" />\n </NimbusProvider>\n );\n\n expect(screen.getByRole(\"progressbar\")).toHaveAttribute(\n \"aria-valuenow\",\n \"100\"\n );\n });\n});\n```\n\n### Testing Indeterminate State\n\nTest indeterminate progress behavior\n\n```tsx\nimport { describe, it, expect } from \"vitest\";\nimport { render, screen } from \"@testing-library/react\";\nimport { ProgressBar, NimbusProvider } from \"@commercetools/nimbus\";\n\ndescribe(\"ProgressBar - Indeterminate state\", () => {\n it(\"renders indeterminate progress\", () => {\n render(\n <NimbusProvider>\n <ProgressBar isIndeterminate label=\"Loading\" />\n </NimbusProvider>\n );\n\n const progressBar = screen.getByRole(\"progressbar\");\n expect(progressBar).toBeInTheDocument();\n });\n\n it(\"does not have aria-valuenow when indeterminate\", () => {\n render(\n <NimbusProvider>\n <ProgressBar isIndeterminate label=\"Processing\" />\n </NimbusProvider>\n );\n\n const progressBar = screen.getByRole(\"progressbar\");\n expect(progressBar).not.toHaveAttribute(\"aria-valuenow\");\n });\n});\n```\n\n### Testing Dynamic Value Updates\n\nTest that the progress bar reflects value changes\n\n```tsx\nimport { describe, it, expect } from \"vitest\";\nimport { render, screen } from \"@testing-library/react\";\nimport { ProgressBar, NimbusProvider } from \"@commercetools/nimbus\";\n\ndescribe(\"ProgressBar - Dynamic updates\", () => {\n it(\"updates aria-valuenow when value prop changes\", () => {\n const { rerender } = render(\n <NimbusProvider>\n <ProgressBar value={25} label=\"Progress\" />\n </NimbusProvider>\n );\n\n const progressBar = screen.getByRole(\"progressbar\");\n expect(progressBar).toHaveAttribute(\"aria-valuenow\", \"25\");\n\n rerender(\n <NimbusProvider>\n <ProgressBar value={75} label=\"Progress\" />\n </NimbusProvider>\n );\n\n expect(progressBar).toHaveAttribute(\"aria-valuenow\", \"75\");\n });\n\n it(\"handles incremental updates\", () => {\n const { rerender } = render(\n <NimbusProvider>\n <ProgressBar value={0} label=\"Upload\" />\n </NimbusProvider>\n );\n\n let progressBar = screen.getByRole(\"progressbar\");\n expect(progressBar).toHaveAttribute(\"aria-valuenow\", \"0\");\n\n // Simulate incremental progress updates\n [25, 50, 75, 100].forEach((value) => {\n rerender(\n <NimbusProvider>\n <ProgressBar value={value} label=\"Upload\" />\n </NimbusProvider>\n );\n\n progressBar = screen.getByRole(\"progressbar\");\n expect(progressBar).toHaveAttribute(\"aria-valuenow\", String(value));\n });\n });\n});\n```\n\n### Testing Layout Variants\n\nTest different layout configurations\n\n```tsx\nimport { describe, it, expect } from \"vitest\";\nimport { render, screen } from \"@testing-library/react\";\nimport { ProgressBar, NimbusProvider } from \"@commercetools/nimbus\";\n\ndescribe(\"ProgressBar - Layout variants\", () => {\n it(\"renders stacked layout (default)\", () => {\n render(\n <NimbusProvider>\n <ProgressBar value={50} layout=\"stacked\" label=\"Stacked\" />\n </NimbusProvider>\n );\n\n expect(screen.getByRole(\"progressbar\")).toBeInTheDocument();\n });\n\n it(\"renders inline layout\", () => {\n render(\n <NimbusProvider>\n <ProgressBar value={50} layout=\"inline\" label=\"Inline\" />\n </NimbusProvider>\n );\n\n expect(screen.getByRole(\"progressbar\")).toBeInTheDocument();\n });\n\n it(\"renders minimal layout with aria-label\", () => {\n render(\n <NimbusProvider>\n <ProgressBar\n value={50}\n layout=\"minimal\"\n aria-label=\"Minimal progress\"\n />\n </NimbusProvider>\n );\n\n expect(\n screen.getByRole(\"progressbar\", { name: /minimal progress/i })\n ).toBeInTheDocument();\n });\n});\n```\n\n### Testing Custom Format Options\n\nTest custom number formatting\n\n```tsx\nimport { describe, it, expect } from \"vitest\";\nimport { render, screen } from \"@testing-library/react\";\nimport { ProgressBar, NimbusProvider } from \"@commercetools/nimbus\";\n\ndescribe(\"ProgressBar - Format options\", () => {\n it(\"renders with percentage format\", () => {\n render(\n <NimbusProvider>\n <ProgressBar\n value={75}\n label=\"Percentage\"\n formatOptions={{ style: \"percent\" }}\n />\n </NimbusProvider>\n );\n\n const progressBar = screen.getByRole(\"progressbar\");\n expect(progressBar).toHaveAttribute(\"aria-valuenow\", \"75\");\n });\n\n it(\"renders with currency format\", () => {\n render(\n <NimbusProvider>\n <ProgressBar\n value={1500}\n maxValue={2000}\n label=\"Budget\"\n formatOptions={{ style: \"currency\", currency: \"USD\" }}\n />\n </NimbusProvider>\n );\n\n const progressBar = screen.getByRole(\"progressbar\");\n expect(progressBar).toHaveAttribute(\"aria-valuenow\", \"1500\");\n expect(progressBar).toHaveAttribute(\"aria-valuemax\", \"2000\");\n });\n\n it(\"renders with unit format\", () => {\n render(\n <NimbusProvider>\n <ProgressBar\n value={42}\n maxValue={100}\n label=\"Storage\"\n formatOptions={{ style: \"unit\", unit: \"gigabyte\" }}\n />\n </NimbusProvider>\n );\n\n const progressBar = screen.getByRole(\"progressbar\");\n expect(progressBar).toHaveAttribute(\"aria-valuenow\", \"42\");\n });\n});\n```\n\n\n## Resources\n\n- [Storybook](https://nimbus-storybook.vercel.app/?path=/docs/components-progressbar--docs)\n- [React Aria ProgressBar](https://react-spectrum.adobe.com/react-aria/ProgressBar.html)\n\n",
|
|
353
|
+
"toc": [
|
|
354
|
+
{
|
|
355
|
+
"value": "Getting started",
|
|
356
|
+
"href": "#getting-started",
|
|
357
|
+
"depth": 2,
|
|
358
|
+
"numbering": [
|
|
359
|
+
1,
|
|
360
|
+
1
|
|
361
|
+
],
|
|
362
|
+
"parent": "root"
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
"value": "Import",
|
|
366
|
+
"href": "#import",
|
|
367
|
+
"depth": 3,
|
|
368
|
+
"numbering": [
|
|
369
|
+
1,
|
|
370
|
+
1,
|
|
371
|
+
1
|
|
372
|
+
],
|
|
373
|
+
"parent": "root"
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
"value": "Basic usage",
|
|
377
|
+
"href": "#basic-usage",
|
|
378
|
+
"depth": 3,
|
|
379
|
+
"numbering": [
|
|
380
|
+
1,
|
|
381
|
+
1,
|
|
382
|
+
2
|
|
383
|
+
],
|
|
384
|
+
"parent": "root"
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
"value": "Usage examples",
|
|
388
|
+
"href": "#usage-examples",
|
|
389
|
+
"depth": 2,
|
|
390
|
+
"numbering": [
|
|
391
|
+
1,
|
|
392
|
+
2
|
|
393
|
+
],
|
|
394
|
+
"parent": "root"
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
"value": "Size options",
|
|
398
|
+
"href": "#size-options",
|
|
399
|
+
"depth": 3,
|
|
400
|
+
"numbering": [
|
|
401
|
+
1,
|
|
402
|
+
2,
|
|
403
|
+
1
|
|
404
|
+
],
|
|
405
|
+
"parent": "root"
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
"value": "Visual variants",
|
|
409
|
+
"href": "#visual-variants",
|
|
410
|
+
"depth": 3,
|
|
411
|
+
"numbering": [
|
|
412
|
+
1,
|
|
413
|
+
2,
|
|
414
|
+
2
|
|
415
|
+
],
|
|
416
|
+
"parent": "root"
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
"value": "Layout options",
|
|
420
|
+
"href": "#layout-options",
|
|
421
|
+
"depth": 3,
|
|
422
|
+
"numbering": [
|
|
423
|
+
1,
|
|
424
|
+
2,
|
|
425
|
+
3
|
|
426
|
+
],
|
|
427
|
+
"parent": "root"
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
"value": "Indeterminate state",
|
|
431
|
+
"href": "#indeterminate-state",
|
|
432
|
+
"depth": 3,
|
|
433
|
+
"numbering": [
|
|
434
|
+
1,
|
|
435
|
+
2,
|
|
436
|
+
4
|
|
437
|
+
],
|
|
438
|
+
"parent": "root"
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
"value": "Dynamic vs. Static progress",
|
|
442
|
+
"href": "#dynamic-vs-static-progress",
|
|
443
|
+
"depth": 3,
|
|
444
|
+
"numbering": [
|
|
445
|
+
1,
|
|
446
|
+
2,
|
|
447
|
+
5
|
|
448
|
+
],
|
|
449
|
+
"parent": "root"
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
"value": "Custom formatting",
|
|
453
|
+
"href": "#custom-formatting",
|
|
454
|
+
"depth": 3,
|
|
455
|
+
"numbering": [
|
|
456
|
+
1,
|
|
457
|
+
2,
|
|
458
|
+
6
|
|
459
|
+
],
|
|
460
|
+
"parent": "root"
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
"value": "Color palettes",
|
|
464
|
+
"href": "#color-palettes",
|
|
465
|
+
"depth": 3,
|
|
466
|
+
"numbering": [
|
|
467
|
+
1,
|
|
468
|
+
2,
|
|
469
|
+
7
|
|
470
|
+
],
|
|
471
|
+
"parent": "root"
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
"value": "Component requirements",
|
|
475
|
+
"href": "#component-requirements",
|
|
476
|
+
"depth": 2,
|
|
477
|
+
"numbering": [
|
|
478
|
+
1,
|
|
479
|
+
3
|
|
480
|
+
],
|
|
481
|
+
"parent": "root"
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
"value": "Accessibility",
|
|
485
|
+
"href": "#accessibility",
|
|
486
|
+
"depth": 2,
|
|
487
|
+
"numbering": [
|
|
488
|
+
1,
|
|
489
|
+
4
|
|
490
|
+
],
|
|
491
|
+
"parent": "root"
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
"value": "API reference",
|
|
495
|
+
"href": "#api-reference",
|
|
496
|
+
"depth": 2,
|
|
497
|
+
"numbering": [
|
|
498
|
+
1,
|
|
499
|
+
5
|
|
500
|
+
],
|
|
501
|
+
"parent": "root"
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
"value": "Common patterns",
|
|
505
|
+
"href": "#common-patterns",
|
|
506
|
+
"depth": 2,
|
|
507
|
+
"numbering": [
|
|
508
|
+
1,
|
|
509
|
+
6
|
|
510
|
+
],
|
|
511
|
+
"parent": "root"
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
"value": "Simulated file upload",
|
|
515
|
+
"href": "#simulated-file-upload",
|
|
516
|
+
"depth": 3,
|
|
517
|
+
"numbering": [
|
|
518
|
+
1,
|
|
519
|
+
6,
|
|
520
|
+
1
|
|
521
|
+
],
|
|
522
|
+
"parent": "root"
|
|
523
|
+
},
|
|
524
|
+
{
|
|
525
|
+
"value": "Testing your implementation",
|
|
526
|
+
"href": "#testing-your-implementation",
|
|
527
|
+
"depth": 2,
|
|
528
|
+
"numbering": [
|
|
529
|
+
1,
|
|
530
|
+
7
|
|
531
|
+
],
|
|
532
|
+
"parent": "root"
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
"value": "Basic Rendering Tests",
|
|
536
|
+
"href": "#basic-rendering-tests",
|
|
537
|
+
"depth": 3,
|
|
538
|
+
"numbering": [
|
|
539
|
+
1,
|
|
540
|
+
7,
|
|
541
|
+
1
|
|
542
|
+
],
|
|
543
|
+
"parent": "root"
|
|
544
|
+
},
|
|
545
|
+
{
|
|
546
|
+
"value": "Testing Value Ranges",
|
|
547
|
+
"href": "#testing-value-ranges",
|
|
548
|
+
"depth": 3,
|
|
549
|
+
"numbering": [
|
|
550
|
+
1,
|
|
551
|
+
7,
|
|
552
|
+
2
|
|
553
|
+
],
|
|
554
|
+
"parent": "root"
|
|
555
|
+
},
|
|
556
|
+
{
|
|
557
|
+
"value": "Testing Indeterminate State",
|
|
558
|
+
"href": "#testing-indeterminate-state",
|
|
559
|
+
"depth": 3,
|
|
560
|
+
"numbering": [
|
|
561
|
+
1,
|
|
562
|
+
7,
|
|
563
|
+
3
|
|
564
|
+
],
|
|
565
|
+
"parent": "root"
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
"value": "Testing Dynamic Value Updates",
|
|
569
|
+
"href": "#testing-dynamic-value-updates",
|
|
570
|
+
"depth": 3,
|
|
571
|
+
"numbering": [
|
|
572
|
+
1,
|
|
573
|
+
7,
|
|
574
|
+
4
|
|
575
|
+
],
|
|
576
|
+
"parent": "root"
|
|
577
|
+
},
|
|
578
|
+
{
|
|
579
|
+
"value": "Testing Layout Variants",
|
|
580
|
+
"href": "#testing-layout-variants",
|
|
581
|
+
"depth": 3,
|
|
582
|
+
"numbering": [
|
|
583
|
+
1,
|
|
584
|
+
7,
|
|
585
|
+
5
|
|
586
|
+
],
|
|
587
|
+
"parent": "root"
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
"value": "Testing Custom Format Options",
|
|
591
|
+
"href": "#testing-custom-format-options",
|
|
592
|
+
"depth": 3,
|
|
593
|
+
"numbering": [
|
|
594
|
+
1,
|
|
595
|
+
7,
|
|
596
|
+
6
|
|
597
|
+
],
|
|
598
|
+
"parent": "root"
|
|
599
|
+
},
|
|
600
|
+
{
|
|
601
|
+
"value": "Resources",
|
|
602
|
+
"href": "#resources",
|
|
603
|
+
"depth": 2,
|
|
604
|
+
"numbering": [
|
|
605
|
+
1,
|
|
606
|
+
8
|
|
607
|
+
],
|
|
608
|
+
"parent": "root"
|
|
609
|
+
}
|
|
610
|
+
]
|
|
611
|
+
},
|
|
612
|
+
"guidelines": {
|
|
613
|
+
"mdx": "\n## Guidelines\n\nProgress bar guidelines aim to provide clear and consistent visual feedback to\nusers during processing delays, ensuring they understand the system is active\nand preventing frustration by indicating that they need to wait.\n\n### Best practices\n\n- **Communicate the process:** Always provide a clear label describing the\n process the progress bar is tracking, like 'uploading file' or 'submitting\n form'.\n- **Show progress with numbers:** Include a percentage or a fraction (e.g., 50%\n or 10/20) to give users a precise understanding of the progress.\n- **Provide feedback on status:** Use text to indicate the current state, such\n as 'uploading,' 'complete,' or 'error.'\n- **Keep it moving:** The progress bar should not stop or go backward. If a task\n is paused, the bar should also pause, and the label should reflect the new\n status.\n- **Use the right type:** Use a determinate bar for tasks with a known end\n point. Use an indeterminate bar for tasks with an unknown duration.\n- **Be accessible:** Ensure the progress bar is accessible to screen readers by\n using proper ARIA attributes like `aria-valuenow`, `aria-valuemin`,\n `aria-valuemax`, and `aria-label`.\n\n### Usage\n\nProgress bars communicate the status of ongoing operations to users, reducing\nuncertainty and improving perceived performance.\n\n> [!TIP]\\\n> When to use\n\n- **When a process takes a few seconds or longer:** A progress bar is useful for\n tasks that are not instantaneous. For short delays, a spinner or loading\n skeleton may be more appropriate.\n- **When the progress of a task can be quantified:** A progress bar is best for\n tasks with a known beginning and end, where a percentage or specific value can\n be tracked.\n- **To manage user expectations:** When users know a process is underway and can\n see its progress, it reduces anxiety and provides a sense of control.\n- **To provide a visual indicator of progress:** A progress bar is a clear\n visual cue that something is happening in the background, preventing users\n from thinking the application has frozen or crashed.\n\n> [!CAUTION]\\\n> When not to use\n\n- **For instantaneous tasks:** Do not use a progress bar for a task that takes\n less than a second to complete. The visual appearance and disappearance of the\n bar can be distracting.\n- **When the process cannot be measured:** Avoid using a determinate progress\n bar if the total time or progress is unknown. This can lead to misleading\n information and a poor user experience. An indeterminate progress bar or a\n spinner is a better choice in this case.\n- **When providing an indefinite loading state:** For a task with an unknown or\n infinite duration, use a spinner to indicate that a process is running without\n implying a specific completion time.\n\n### Progress bar uses\n\nBe clear when using progress bar within the interface. It is important to let\nthe user know what is happening within working processes.\n\n> [!TIP]\\\n> **Do**\n>\n> - Do use a determinate progress bar when the total time or size is known. This\n> provides a clear sense of progress and completion.\n> - Do provide a label for context. Labels help users understand what the\n> progress bar represents.\n> - Do use a progress bar for user-initiated tasks. It gives the user a sense of\n> control and feedback on their actions.\n> - Do ensure the progress bar is responsive. It should adapt to different\n> screen sizes without distorting the design.\n\n```jsx live\nconst App = () => {\n const [indexingKey, setIndexingKey] = React.useState(0);\n const [progress, setProgress] = React.useState(0);\n\n React.useEffect(() => {\n if (indexingKey === 0) return;\n\n setProgress(0);\n const interval = setInterval(() => {\n setProgress((prev) => {\n if (prev >= 100) {\n clearInterval(interval);\n return 100;\n }\n return prev + 5;\n });\n }, 300);\n\n return () => clearInterval(interval);\n }, [indexingKey]);\n\n const handleIndexClick = () => {\n setIndexingKey((prev) => prev + 1);\n };\n\n return (\n <Stack direction=\"column\" gap=\"400\" alignItems=\"stretch\">\n <Alert.Root tone=\"info\" variant=\"outlined\">\n <Alert.Description>\n Indexing your project catalog. You can keep using the Merchant Center in the meantime but your changes will be applied only after the process has finished. We will notify you once we are done.\n </Alert.Description>\n </Alert.Root>\n {indexingKey > 0 && (\n <ProgressBar\n value={progress}\n label=\"Indexing projects...\"\n colorPalette=\"primary\"\n />\n )}\n <Button\n variant=\"solid\"\n colorPalette=\"primary\"\n width=\"fit-content\"\n onClick={handleIndexClick}\n >\n Index the project catalog\n </Button>\n </Stack>\n )\n}\n```\n\n> [!CAUTION]\\\n> **Don't**\n>\n> - Don't use a determinate progress bar for tasks with an unknown duration. Use\n> an indeterminate bar instead to avoid misleading the user.\n> - Don't show a progress bar without providing the context needed to understand\n> what is being loaded.\n> - Don't use multiple progress bars for a single task. One bar should be\n> sufficient to represent the overall progress.\n> - Don't show erratic animation with a progress bar, simplify tasks so that it\n> can be estimated in a single bar or use an indeterminate animation instead.\n> - Don't use a progress bar for system-initiated background tasks. These tasks\n> should be handled without user intervention or visible indicators.\n\n```jsx live\nconst App = () => {\n const [isRunning, setIsRunning] = React.useState(false);\n const [value, setValue] = React.useState(0);\n\n React.useEffect(() => {\n if (!isRunning) return;\n\n setValue(0);\n const interval = setInterval(() => {\n setValue((prev) => {\n // Simulate erratic progress\n const change = Math.random() > 0.5 ? 15 : -10;\n const newValue = prev + change;\n if (newValue > 100) return 100;\n if (newValue < 0) return 0;\n return newValue;\n });\n }, 800);\n\n return () => clearInterval(interval);\n }, [isRunning]);\n\n const handleStart = () => {\n setValue(0);\n setIsRunning(true);\n };\n\n return (\n <Stack direction=\"column\" gap=\"400\" alignItems=\"stretch\">\n <ProgressBar\n value={value}\n label=\"Don't do: erratic progress loading\"\n colorPalette=\"primary\"\n />\n <Button\n onClick={handleStart}\n isDisabled={isRunning}\n width=\"fit-content\"\n colorPalette=\"primary\"\n variant=\"solid\"\n >\n Start\n </Button>\n </Stack>\n )\n}\n```\n",
|
|
614
|
+
"toc": [
|
|
615
|
+
{
|
|
616
|
+
"value": "Guidelines",
|
|
617
|
+
"href": "#guidelines",
|
|
618
|
+
"depth": 2,
|
|
619
|
+
"numbering": [
|
|
620
|
+
1,
|
|
621
|
+
1
|
|
622
|
+
],
|
|
623
|
+
"parent": "root"
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
"value": "Best practices",
|
|
627
|
+
"href": "#best-practices",
|
|
628
|
+
"depth": 3,
|
|
629
|
+
"numbering": [
|
|
630
|
+
1,
|
|
631
|
+
1,
|
|
632
|
+
1
|
|
633
|
+
],
|
|
634
|
+
"parent": "root"
|
|
635
|
+
},
|
|
636
|
+
{
|
|
637
|
+
"value": "Usage",
|
|
638
|
+
"href": "#usage",
|
|
639
|
+
"depth": 3,
|
|
640
|
+
"numbering": [
|
|
641
|
+
1,
|
|
642
|
+
1,
|
|
643
|
+
2
|
|
644
|
+
],
|
|
645
|
+
"parent": "root"
|
|
646
|
+
},
|
|
647
|
+
{
|
|
648
|
+
"value": "Progress bar uses",
|
|
649
|
+
"href": "#progress-bar-uses",
|
|
650
|
+
"depth": 3,
|
|
651
|
+
"numbering": [
|
|
652
|
+
1,
|
|
653
|
+
1,
|
|
654
|
+
3
|
|
655
|
+
],
|
|
656
|
+
"parent": "root"
|
|
657
|
+
}
|
|
658
|
+
]
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
}
|