@atom-learning/components 2.32.3-beta.0 → 2.34.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/CHANGELOG.md +8 -0
- package/README.md +11 -5
- package/dist/components/accordion/Accordion.js +1 -0
- package/dist/components/accordion/Accordion.js.map +1 -0
- package/dist/components/accordion/AccordionContent.js +1 -0
- package/dist/components/accordion/AccordionContent.js.map +1 -0
- package/dist/components/accordion/AccordionItem.js +2 -1
- package/dist/components/accordion/AccordionItem.js.map +1 -0
- package/dist/components/accordion/AccordionTrigger.js +2 -1
- package/dist/components/accordion/AccordionTrigger.js.map +1 -0
- package/dist/components/action-icon/ActionIcon.constants.js +1 -0
- package/dist/components/action-icon/ActionIcon.constants.js.map +1 -0
- package/dist/components/action-icon/ActionIcon.js +1 -0
- package/dist/components/action-icon/ActionIcon.js.map +1 -0
- package/dist/components/alert-dialog/AlertDialog.js +1 -0
- package/dist/components/alert-dialog/AlertDialog.js.map +1 -0
- package/dist/components/alert-dialog/AlertDialogContent.js +1 -0
- package/dist/components/alert-dialog/AlertDialogContent.js.map +1 -0
- package/dist/components/alert-dialog/alert-context/AlertContext.js +1 -0
- package/dist/components/alert-dialog/alert-context/AlertContext.js.map +1 -0
- package/dist/components/alert-dialog/alert-context/AlertDialog.js +1 -0
- package/dist/components/alert-dialog/alert-context/AlertDialog.js.map +1 -0
- package/dist/components/alert-dialog/alert-context/reducer.js +1 -0
- package/dist/components/alert-dialog/alert-context/reducer.js.map +1 -0
- package/dist/components/avatar/Avatar.js +2 -1
- package/dist/components/avatar/Avatar.js.map +1 -0
- package/dist/components/avatar/AvatarIcon.js +1 -0
- package/dist/components/avatar/AvatarIcon.js.map +1 -0
- package/dist/components/avatar/AvatarImage.js +1 -0
- package/dist/components/avatar/AvatarImage.js.map +1 -0
- package/dist/components/avatar/AvatarInitial.js +1 -0
- package/dist/components/avatar/AvatarInitial.js.map +1 -0
- package/dist/components/avatar/AvatarPlaceholder.js +1 -0
- package/dist/components/avatar/AvatarPlaceholder.js.map +1 -0
- package/dist/components/badge/Badge.js +1 -0
- package/dist/components/badge/Badge.js.map +1 -0
- package/dist/components/box/Box.js +1 -0
- package/dist/components/box/Box.js.map +1 -0
- package/dist/components/button/Button.js +1 -0
- package/dist/components/button/Button.js.map +1 -0
- package/dist/components/calendar/Calendar.js +2 -1
- package/dist/components/calendar/Calendar.js.map +1 -0
- package/dist/components/calendar/Day.js +1 -0
- package/dist/components/calendar/Day.js.map +1 -0
- package/dist/components/calendar/constants.js +1 -0
- package/dist/components/calendar/constants.js.map +1 -0
- package/dist/components/carousel/Carousel.js +1 -0
- package/dist/components/carousel/Carousel.js.map +1 -0
- package/dist/components/carousel/CarouselArrows.js +2 -1
- package/dist/components/carousel/CarouselArrows.js.map +1 -0
- package/dist/components/carousel/CarouselPagination.js +1 -0
- package/dist/components/carousel/CarouselPagination.js.map +1 -0
- package/dist/components/carousel/CarouselSlide.js +2 -1
- package/dist/components/carousel/CarouselSlide.js.map +1 -0
- package/dist/components/carousel/CarouselSlider.js +1 -0
- package/dist/components/carousel/CarouselSlider.js.map +1 -0
- package/dist/components/checkbox/Checkbox.js +1 -0
- package/dist/components/checkbox/Checkbox.js.map +1 -0
- package/dist/components/checkbox-field/CheckboxField.js +2 -1
- package/dist/components/checkbox-field/CheckboxField.js.map +1 -0
- package/dist/components/chip/Chip.js +2 -1
- package/dist/components/chip/Chip.js.map +1 -0
- package/dist/components/chip/ChipGroup.js +2 -1
- package/dist/components/chip/ChipGroup.js.map +1 -0
- package/dist/components/chip-dismissible-group/ChipDismissibleGroupItem.js +1 -0
- package/dist/components/chip-dismissible-group/ChipDismissibleGroupItem.js.map +1 -0
- package/dist/components/chip-dismissible-group/ChipDismissibleGroupRoot.js +2 -1
- package/dist/components/chip-dismissible-group/ChipDismissibleGroupRoot.js.map +1 -0
- package/dist/components/chip-dismissible-group/index.js +1 -0
- package/dist/components/chip-dismissible-group/index.js.map +1 -0
- package/dist/components/chip-toggle-group/ChipToggleGroupItem.js +1 -0
- package/dist/components/chip-toggle-group/ChipToggleGroupItem.js.map +1 -0
- package/dist/components/chip-toggle-group/ChipToggleGroupRoot.js +1 -0
- package/dist/components/chip-toggle-group/ChipToggleGroupRoot.js.map +1 -0
- package/dist/components/chip-toggle-group/index.js +1 -0
- package/dist/components/chip-toggle-group/index.js.map +1 -0
- package/dist/components/combobox/Combobox.js +1 -0
- package/dist/components/combobox/Combobox.js.map +1 -0
- package/dist/components/combobox/ComboboxInput.js +1 -0
- package/dist/components/combobox/ComboboxInput.js.map +1 -0
- package/dist/components/combobox/ComboboxList.js +1 -0
- package/dist/components/combobox/ComboboxList.js.map +1 -0
- package/dist/components/combobox/ComboboxOption.js +1 -0
- package/dist/components/combobox/ComboboxOption.js.map +1 -0
- package/dist/components/combobox/ComboboxPopover.js +1 -0
- package/dist/components/combobox/ComboboxPopover.js.map +1 -0
- package/dist/components/data-table/DataTable.js +2 -1
- package/dist/components/data-table/DataTable.js.map +1 -0
- package/dist/components/data-table/DataTable.types.js +1 -0
- package/dist/components/data-table/DataTable.types.js.map +1 -0
- package/dist/components/data-table/DataTableBody.js +2 -1
- package/dist/components/data-table/DataTableBody.js.map +1 -0
- package/dist/components/data-table/DataTableContext.js +1 -0
- package/dist/components/data-table/DataTableContext.js.map +1 -0
- package/dist/components/data-table/DataTableDataCell.js +2 -1
- package/dist/components/data-table/DataTableDataCell.js.map +1 -0
- package/dist/components/data-table/DataTableError.js +1 -0
- package/dist/components/data-table/DataTableError.js.map +1 -0
- package/dist/components/data-table/DataTableGlobalFilter.js +2 -1
- package/dist/components/data-table/DataTableGlobalFilter.js.map +1 -0
- package/dist/components/data-table/DataTableHead.js +1 -0
- package/dist/components/data-table/DataTableHead.js.map +1 -0
- package/dist/components/data-table/DataTableHeaderCell.js +1 -0
- package/dist/components/data-table/DataTableHeaderCell.js.map +1 -0
- package/dist/components/data-table/DataTableLoading.js +1 -0
- package/dist/components/data-table/DataTableLoading.js.map +1 -0
- package/dist/components/data-table/DataTableRow.js +2 -1
- package/dist/components/data-table/DataTableRow.js.map +1 -0
- package/dist/components/data-table/DataTableTable.js +2 -1
- package/dist/components/data-table/DataTableTable.js.map +1 -0
- package/dist/components/data-table/drag-and-drop/DragAndDropContainer.js +1 -0
- package/dist/components/data-table/drag-and-drop/DragAndDropContainer.js.map +1 -0
- package/dist/components/data-table/drag-and-drop/DragAndDropTable.js +1 -0
- package/dist/components/data-table/drag-and-drop/DragAndDropTable.js.map +1 -0
- package/dist/components/data-table/drag-and-drop/DragAndDropTableBody.js +1 -0
- package/dist/components/data-table/drag-and-drop/DragAndDropTableBody.js.map +1 -0
- package/dist/components/data-table/drag-and-drop/DraggableRow.js +2 -1
- package/dist/components/data-table/drag-and-drop/DraggableRow.js.map +1 -0
- package/dist/components/data-table/drag-and-drop/Handle.js +2 -1
- package/dist/components/data-table/drag-and-drop/Handle.js.map +1 -0
- package/dist/components/data-table/getNewAsyncData.js +1 -0
- package/dist/components/data-table/getNewAsyncData.js.map +1 -0
- package/dist/components/data-table/pagination/Pagination.js +1 -0
- package/dist/components/data-table/pagination/Pagination.js.map +1 -0
- package/dist/components/data-table/pagination/PaginationButtons.js +1 -0
- package/dist/components/data-table/pagination/PaginationButtons.js.map +1 -0
- package/dist/components/data-table/usePagination.js +1 -0
- package/dist/components/data-table/usePagination.js.map +1 -0
- package/dist/components/data-table/useSorting.js +1 -0
- package/dist/components/data-table/useSorting.js.map +1 -0
- package/dist/components/date-field/DateField.js +1 -0
- package/dist/components/date-field/DateField.js.map +1 -0
- package/dist/components/date-input/DateInput.js +1 -0
- package/dist/components/date-input/DateInput.js.map +1 -0
- package/dist/components/date-input/constants.js +1 -0
- package/dist/components/date-input/constants.js.map +1 -0
- package/dist/components/date-input/use-date.js +1 -0
- package/dist/components/date-input/use-date.js.map +1 -0
- package/dist/components/dialog/Dialog.js +1 -0
- package/dist/components/dialog/Dialog.js.map +1 -0
- package/dist/components/dialog/DialogBackground.js +1 -0
- package/dist/components/dialog/DialogBackground.js.map +1 -0
- package/dist/components/dialog/DialogClose.js +1 -0
- package/dist/components/dialog/DialogClose.js.map +1 -0
- package/dist/components/dialog/DialogContent.js +1 -0
- package/dist/components/dialog/DialogContent.js.map +1 -0
- package/dist/components/dismissible/DismissibleRoot.js +2 -1
- package/dist/components/dismissible/DismissibleRoot.js.map +1 -0
- package/dist/components/dismissible/DismissibleTrigger.js +2 -1
- package/dist/components/dismissible/DismissibleTrigger.js.map +1 -0
- package/dist/components/dismissible/index.js +1 -0
- package/dist/components/dismissible/index.js.map +1 -0
- package/dist/components/dismissible-group/DismissibleGroupItem.js +1 -0
- package/dist/components/dismissible-group/DismissibleGroupItem.js.map +1 -0
- package/dist/components/dismissible-group/DismissibleGroupRoot.js +1 -0
- package/dist/components/dismissible-group/DismissibleGroupRoot.js.map +1 -0
- package/dist/components/dismissible-group/index.js +1 -0
- package/dist/components/dismissible-group/index.js.map +1 -0
- package/dist/components/divider/Divider.js +1 -0
- package/dist/components/divider/Divider.js.map +1 -0
- package/dist/components/dropdown-menu/DropdownMenu.js +1 -0
- package/dist/components/dropdown-menu/DropdownMenu.js.map +1 -0
- package/dist/components/dropdown-menu/DropdownMenuContent.js +1 -0
- package/dist/components/dropdown-menu/DropdownMenuContent.js.map +1 -0
- package/dist/components/dropdown-menu/DropdownMenuItem.js +1 -0
- package/dist/components/dropdown-menu/DropdownMenuItem.js.map +1 -0
- package/dist/components/dropdown-menu/DropdownMenuLinkItem.js +2 -1
- package/dist/components/dropdown-menu/DropdownMenuLinkItem.js.map +1 -0
- package/dist/components/dropdown-menu/DropdownMenuSeparator.js +1 -0
- package/dist/components/dropdown-menu/DropdownMenuSeparator.js.map +1 -0
- package/dist/components/dropdown-menu/DropdownMenuTrigger.js +1 -0
- package/dist/components/dropdown-menu/DropdownMenuTrigger.js.map +1 -0
- package/dist/components/empty-state/EmptyState.js +1 -0
- package/dist/components/empty-state/EmptyState.js.map +1 -0
- package/dist/components/empty-state/EmptyStateBody.js +1 -0
- package/dist/components/empty-state/EmptyStateBody.js.map +1 -0
- package/dist/components/empty-state/EmptyStateImage.js +1 -0
- package/dist/components/empty-state/EmptyStateImage.js.map +1 -0
- package/dist/components/empty-state/EmptyStateTitle.js +1 -0
- package/dist/components/empty-state/EmptyStateTitle.js.map +1 -0
- package/dist/components/field-wrapper/FieldDescription.js +2 -1
- package/dist/components/field-wrapper/FieldDescription.js.map +1 -0
- package/dist/components/field-wrapper/FieldWrapper.js +1 -0
- package/dist/components/field-wrapper/FieldWrapper.js.map +1 -0
- package/dist/components/field-wrapper/InlineFieldWrapper.js +2 -1
- package/dist/components/field-wrapper/InlineFieldWrapper.js.map +1 -0
- package/dist/components/file-input/FileInput.js +2 -1
- package/dist/components/file-input/FileInput.js.map +1 -0
- package/dist/components/flex/Flex.js +1 -0
- package/dist/components/flex/Flex.js.map +1 -0
- package/dist/components/form/Form.js +1 -0
- package/dist/components/form/Form.js.map +1 -0
- package/dist/components/form/Form.types.js +1 -0
- package/dist/components/form/Form.types.js.map +1 -0
- package/dist/components/form/useFieldError.js +1 -0
- package/dist/components/form/useFieldError.js.map +1 -0
- package/dist/components/grid/Grid.js +2 -1
- package/dist/components/grid/Grid.js.map +1 -0
- package/dist/components/heading/Heading.js +2 -1
- package/dist/components/heading/Heading.js.map +1 -0
- package/dist/components/icon/Icon.js +2 -1
- package/dist/components/icon/Icon.js.map +1 -0
- package/dist/components/image/Image.js +1 -0
- package/dist/components/image/Image.js.map +1 -0
- package/dist/components/inline-message/InlineMessage.config.js +1 -0
- package/dist/components/inline-message/InlineMessage.config.js.map +1 -0
- package/dist/components/inline-message/InlineMessage.js +2 -1
- package/dist/components/inline-message/InlineMessage.js.map +1 -0
- package/dist/components/input/Input.js +1 -0
- package/dist/components/input/Input.js.map +1 -0
- package/dist/components/input-field/InputField.js +1 -0
- package/dist/components/input-field/InputField.js.map +1 -0
- package/dist/components/label/Label.js +2 -1
- package/dist/components/label/Label.js.map +1 -0
- package/dist/components/link/Link.js +2 -1
- package/dist/components/link/Link.js.map +1 -0
- package/dist/components/list/List.js +2 -1
- package/dist/components/list/List.js.map +1 -0
- package/dist/components/loader/Loader.js +1 -0
- package/dist/components/loader/Loader.js.map +1 -0
- package/dist/components/markdown-content/MarkdownContent.js +1 -0
- package/dist/components/markdown-content/MarkdownContent.js.map +1 -0
- package/dist/components/markdown-content/components/MarkdownCode.js +1 -0
- package/dist/components/markdown-content/components/MarkdownCode.js.map +1 -0
- package/dist/components/markdown-content/components/MarkdownEmphasis.js +2 -1
- package/dist/components/markdown-content/components/MarkdownEmphasis.js.map +1 -0
- package/dist/components/markdown-content/components/MarkdownHeading.js +2 -1
- package/dist/components/markdown-content/components/MarkdownHeading.js.map +1 -0
- package/dist/components/markdown-content/components/MarkdownImage.js +2 -1
- package/dist/components/markdown-content/components/MarkdownImage.js.map +1 -0
- package/dist/components/markdown-content/components/MarkdownInlineCode.js +2 -1
- package/dist/components/markdown-content/components/MarkdownInlineCode.js.map +1 -0
- package/dist/components/markdown-content/components/MarkdownLink.js +2 -1
- package/dist/components/markdown-content/components/MarkdownLink.js.map +1 -0
- package/dist/components/markdown-content/components/MarkdownList.js +1 -0
- package/dist/components/markdown-content/components/MarkdownList.js.map +1 -0
- package/dist/components/markdown-content/components/MarkdownListItem.js +2 -1
- package/dist/components/markdown-content/components/MarkdownListItem.js.map +1 -0
- package/dist/components/markdown-content/components/MarkdownParagraph.js +2 -1
- package/dist/components/markdown-content/components/MarkdownParagraph.js.map +1 -0
- package/dist/components/markdown-content/components/MarkdownStrong.js +2 -1
- package/dist/components/markdown-content/components/MarkdownStrong.js.map +1 -0
- package/dist/components/markdown-content/components/MarkdownText.js +1 -0
- package/dist/components/markdown-content/components/MarkdownText.js.map +1 -0
- package/dist/components/markdown-content/components/MarkdownThematicBreak.js +2 -1
- package/dist/components/markdown-content/components/MarkdownThematicBreak.js.map +1 -0
- package/dist/components/navigation/NavigationMenu.js +1 -0
- package/dist/components/navigation/NavigationMenu.js.map +1 -0
- package/dist/components/navigation/NavigationMenu.styles.js +1 -0
- package/dist/components/navigation/NavigationMenu.styles.js.map +1 -0
- package/dist/components/navigation/NavigationMenuContext.js +1 -0
- package/dist/components/navigation/NavigationMenuContext.js.map +1 -0
- package/dist/components/navigation/NavigationMenuDropdown.js +1 -0
- package/dist/components/navigation/NavigationMenuDropdown.js.map +1 -0
- package/dist/components/navigation/NavigationMenuDropdownContent.js +2 -1
- package/dist/components/navigation/NavigationMenuDropdownContent.js.map +1 -0
- package/dist/components/navigation/NavigationMenuDropdownItem.js +1 -0
- package/dist/components/navigation/NavigationMenuDropdownItem.js.map +1 -0
- package/dist/components/navigation/NavigationMenuDropdownTrigger.js +1 -0
- package/dist/components/navigation/NavigationMenuDropdownTrigger.js.map +1 -0
- package/dist/components/navigation/NavigationMenuLink.js +2 -1
- package/dist/components/navigation/NavigationMenuLink.js.map +1 -0
- package/dist/components/navigation/preventHover.js +1 -0
- package/dist/components/navigation/preventHover.js.map +1 -0
- package/dist/components/notification-badge/NotificationBadge.js +2 -1
- package/dist/components/notification-badge/NotificationBadge.js.map +1 -0
- package/dist/components/number-input/NumberInput.js +2 -1
- package/dist/components/number-input/NumberInput.js.map +1 -0
- package/dist/components/number-input/NumberInputStepper.js +1 -0
- package/dist/components/number-input/NumberInputStepper.js.map +1 -0
- package/dist/components/number-input-field/NumberInputField.js +2 -1
- package/dist/components/number-input-field/NumberInputField.js.map +1 -0
- package/dist/components/password-field/PasswordField.js +1 -0
- package/dist/components/password-field/PasswordField.js.map +1 -0
- package/dist/components/password-input/PasswordInput.js +1 -0
- package/dist/components/password-input/PasswordInput.js.map +1 -0
- package/dist/components/popover/Popover.js +1 -0
- package/dist/components/popover/Popover.js.map +1 -0
- package/dist/components/popover/PopoverContent.js +2 -1
- package/dist/components/popover/PopoverContent.js.map +1 -0
- package/dist/components/progress-bar/ProgressBar.js +1 -0
- package/dist/components/progress-bar/ProgressBar.js.map +1 -0
- package/dist/components/radio-button/RadioButton.js +2 -1
- package/dist/components/radio-button/RadioButton.js.map +1 -0
- package/dist/components/radio-button/RadioButtonGroup.js +1 -0
- package/dist/components/radio-button/RadioButtonGroup.js.map +1 -0
- package/dist/components/radio-button-field/RadioButtonField.js +2 -1
- package/dist/components/radio-button-field/RadioButtonField.js.map +1 -0
- package/dist/components/radio-button-field/RadioField.js +2 -1
- package/dist/components/radio-button-field/RadioField.js.map +1 -0
- package/dist/components/radio-card/RadioCard.js +1 -0
- package/dist/components/radio-card/RadioCard.js.map +1 -0
- package/dist/components/radio-card/RadioCardGroup.js +2 -1
- package/dist/components/radio-card/RadioCardGroup.js.map +1 -0
- package/dist/components/search-field/SearchField.js +1 -0
- package/dist/components/search-field/SearchField.js.map +1 -0
- package/dist/components/search-input/SearchInput.d.ts +2 -0
- package/dist/components/search-input/SearchInput.js +2 -1
- package/dist/components/search-input/SearchInput.js.map +1 -0
- package/dist/components/select/Select.js +1 -0
- package/dist/components/select/Select.js.map +1 -0
- package/dist/components/select-field/SelectField.js +2 -1
- package/dist/components/select-field/SelectField.js.map +1 -0
- package/dist/components/sidedrawer/Sidedrawer.js +1 -0
- package/dist/components/sidedrawer/Sidedrawer.js.map +1 -0
- package/dist/components/sidedrawer/Sidedrawer.styles.js +1 -0
- package/dist/components/sidedrawer/Sidedrawer.styles.js.map +1 -0
- package/dist/components/sidedrawer/SidedrawerAccordion/SidedrawerAccordionContent.js +2 -1
- package/dist/components/sidedrawer/SidedrawerAccordion/SidedrawerAccordionContent.js.map +1 -0
- package/dist/components/sidedrawer/SidedrawerAccordion/SidedrawerAccordionItem.js +1 -0
- package/dist/components/sidedrawer/SidedrawerAccordion/SidedrawerAccordionItem.js.map +1 -0
- package/dist/components/sidedrawer/SidedrawerAccordion/SidedrawerAccordionRoot.js +1 -0
- package/dist/components/sidedrawer/SidedrawerAccordion/SidedrawerAccordionRoot.js.map +1 -0
- package/dist/components/sidedrawer/SidedrawerAccordion/SidedrawerAccordionTrigger.js +1 -0
- package/dist/components/sidedrawer/SidedrawerAccordion/SidedrawerAccordionTrigger.js.map +1 -0
- package/dist/components/sidedrawer/SidedrawerBody.js +1 -0
- package/dist/components/sidedrawer/SidedrawerBody.js.map +1 -0
- package/dist/components/sidedrawer/SidedrawerClose.js +1 -0
- package/dist/components/sidedrawer/SidedrawerClose.js.map +1 -0
- package/dist/components/sidedrawer/SidedrawerContent.js +2 -1
- package/dist/components/sidedrawer/SidedrawerContent.js.map +1 -0
- package/dist/components/sidedrawer/SidedrawerFooter.js +1 -0
- package/dist/components/sidedrawer/SidedrawerFooter.js.map +1 -0
- package/dist/components/sidedrawer/SidedrawerHeader.js +1 -0
- package/dist/components/sidedrawer/SidedrawerHeader.js.map +1 -0
- package/dist/components/sidedrawer/SidedrawerItem.js +1 -0
- package/dist/components/sidedrawer/SidedrawerItem.js.map +1 -0
- package/dist/components/sidedrawer/SidedrawerOverlay.js +1 -0
- package/dist/components/sidedrawer/SidedrawerOverlay.js.map +1 -0
- package/dist/components/sidedrawer/SidedrawerTrigger.js +1 -0
- package/dist/components/sidedrawer/SidedrawerTrigger.js.map +1 -0
- package/dist/components/slider/Slider.d.ts +2 -1
- package/dist/components/slider/Slider.js +2 -1
- package/dist/components/slider/Slider.js.map +1 -0
- package/dist/components/slider/SliderSteps.js +1 -0
- package/dist/components/slider/SliderSteps.js.map +1 -0
- package/dist/components/slider/SliderValue.js +1 -0
- package/dist/components/slider/SliderValue.js.map +1 -0
- package/dist/components/slider-field/SliderField.js +2 -1
- package/dist/components/slider-field/SliderField.js.map +1 -0
- package/dist/components/stack/Stack.js +1 -0
- package/dist/components/stack/Stack.js.map +1 -0
- package/dist/components/stack-content/StackContent.js +2 -1
- package/dist/components/stack-content/StackContent.js.map +1 -0
- package/dist/components/stepper/Stepper.js +1 -0
- package/dist/components/stepper/Stepper.js.map +1 -0
- package/dist/components/stepper/StepperStepBack.js +2 -1
- package/dist/components/stepper/StepperStepBack.js.map +1 -0
- package/dist/components/stepper/StepperStepBullet.js +1 -0
- package/dist/components/stepper/StepperStepBullet.js.map +1 -0
- package/dist/components/stepper/StepperStepContainer.js +1 -0
- package/dist/components/stepper/StepperStepContainer.js.map +1 -0
- package/dist/components/stepper/StepperStepForward.js +1 -0
- package/dist/components/stepper/StepperStepForward.js.map +1 -0
- package/dist/components/stepper/StepperStepLabel.js +1 -0
- package/dist/components/stepper/StepperStepLabel.js.map +1 -0
- package/dist/components/stepper/StepperSteps.js +1 -0
- package/dist/components/stepper/StepperSteps.js.map +1 -0
- package/dist/components/stepper/stepper-context/StepperContext.js +1 -0
- package/dist/components/stepper/stepper-context/StepperContext.js.map +1 -0
- package/dist/components/stepper/types.js +1 -0
- package/dist/components/stepper/types.js.map +1 -0
- package/dist/components/switch/Switch.js +1 -0
- package/dist/components/switch/Switch.js.map +1 -0
- package/dist/components/table/Table.d.ts +1 -5
- package/dist/components/table/Table.js +2 -1
- package/dist/components/table/Table.js.map +1 -0
- package/dist/components/table/TableBody.js +2 -1
- package/dist/components/table/TableBody.js.map +1 -0
- package/dist/components/table/TableCell.js +1 -0
- package/dist/components/table/TableCell.js.map +1 -0
- package/dist/components/table/TableFooter.js +1 -0
- package/dist/components/table/TableFooter.js.map +1 -0
- package/dist/components/table/TableFooterCell.js +1 -0
- package/dist/components/table/TableFooterCell.js.map +1 -0
- package/dist/components/table/TableHeader.js +2 -1
- package/dist/components/table/TableHeader.js.map +1 -0
- package/dist/components/table/TableHeaderCell.js +1 -0
- package/dist/components/table/TableHeaderCell.js.map +1 -0
- package/dist/components/table/TableRow.js +2 -1
- package/dist/components/table/TableRow.js.map +1 -0
- package/dist/components/tabs/Tabs.js +2 -1
- package/dist/components/tabs/Tabs.js.map +1 -0
- package/dist/components/tabs/TabsContent.js +1 -0
- package/dist/components/tabs/TabsContent.js.map +1 -0
- package/dist/components/tabs/TabsTrigger.js +2 -1
- package/dist/components/tabs/TabsTrigger.js.map +1 -0
- package/dist/components/tabs/TabsTriggerList.js +2 -1
- package/dist/components/tabs/TabsTriggerList.js.map +1 -0
- package/dist/components/text/Text.js +2 -1
- package/dist/components/text/Text.js.map +1 -0
- package/dist/components/textarea/Textarea.js +1 -0
- package/dist/components/textarea/Textarea.js.map +1 -0
- package/dist/components/textarea-field/TextareaField.js +1 -0
- package/dist/components/textarea-field/TextareaField.js.map +1 -0
- package/dist/components/toast/Toast.js +2 -1
- package/dist/components/toast/Toast.js.map +1 -0
- package/dist/components/toast/ToastProvider.js +2 -1
- package/dist/components/toast/ToastProvider.js.map +1 -0
- package/dist/components/toggle-group/ToggleGroupButton.js +2 -1
- package/dist/components/toggle-group/ToggleGroupButton.js.map +1 -0
- package/dist/components/toggle-group/ToggleGroupItem.js +1 -0
- package/dist/components/toggle-group/ToggleGroupItem.js.map +1 -0
- package/dist/components/toggle-group/ToggleGroupRoot.js +1 -0
- package/dist/components/toggle-group/ToggleGroupRoot.js.map +1 -0
- package/dist/components/toggle-group/index.js +1 -0
- package/dist/components/toggle-group/index.js.map +1 -0
- package/dist/components/tooltip/Tooltip.js +1 -0
- package/dist/components/tooltip/Tooltip.js.map +1 -0
- package/dist/components/tooltip/TooltipContent.js +2 -1
- package/dist/components/tooltip/TooltipContent.js.map +1 -0
- package/dist/components/top-bar/TopBar.js +1 -0
- package/dist/components/top-bar/TopBar.js.map +1 -0
- package/dist/components/top-bar/TopBarActionIcon.js +1 -0
- package/dist/components/top-bar/TopBarActionIcon.js.map +1 -0
- package/dist/components/top-bar/TopBarBrand.js +1 -0
- package/dist/components/top-bar/TopBarBrand.js.map +1 -0
- package/dist/components/video/Video.js +2 -1
- package/dist/components/video/Video.js.map +1 -0
- package/dist/constants/zIndices.js +1 -0
- package/dist/constants/zIndices.js.map +1 -0
- package/dist/docgen.json +1 -1
- package/dist/experiments/color-scheme/ColorScheme.js +2 -1
- package/dist/experiments/color-scheme/ColorScheme.js.map +1 -0
- package/dist/experiments/color-scheme/blue.json.js +1 -0
- package/dist/experiments/color-scheme/blue.json.js.map +1 -0
- package/dist/experiments/color-scheme/generateAlphaColors.js +1 -0
- package/dist/experiments/color-scheme/generateAlphaColors.js.map +1 -0
- package/dist/experiments/color-scheme/slate.json.js +1 -0
- package/dist/experiments/color-scheme/slate.json.js.map +1 -0
- package/dist/experiments/color-scheme/stitches.colorscheme.config.js +1 -0
- package/dist/experiments/color-scheme/stitches.colorscheme.config.js.map +1 -0
- package/dist/index.cjs.js +2 -1
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -0
- package/dist/stitches.js +1 -0
- package/dist/stitches.js.map +1 -0
- package/dist/utilities/create-theme-variants/createThemeVariants.js +1 -0
- package/dist/utilities/create-theme-variants/createThemeVariants.js.map +1 -0
- package/dist/utilities/css-wrapper/CSSWrapper.js +1 -0
- package/dist/utilities/css-wrapper/CSSWrapper.js.map +1 -0
- package/dist/utilities/hooks/useCallbackRef.js +2 -1
- package/dist/utilities/hooks/useCallbackRef.js.map +1 -0
- package/dist/utilities/hooks/useIsMountedRef.js +1 -0
- package/dist/utilities/hooks/useIsMountedRef.js.map +1 -0
- package/dist/utilities/hooks/useWindowScrollPosition.js +1 -0
- package/dist/utilities/hooks/useWindowScrollPosition.js.map +1 -0
- package/dist/utilities/hooks/useWindowSize.js +1 -0
- package/dist/utilities/hooks/useWindowSize.js.map +1 -0
- package/dist/utilities/optionally-visually-hidden-container/OptionallyVisuallyHiddenContainer.js +1 -0
- package/dist/utilities/optionally-visually-hidden-container/OptionallyVisuallyHiddenContainer.js.map +1 -0
- package/dist/utilities/override-stitches-variant-value/overrideStitchesVariantValue.js +1 -0
- package/dist/utilities/override-stitches-variant-value/overrideStitchesVariantValue.js.map +1 -0
- package/dist/utilities/style/capsize.js +1 -0
- package/dist/utilities/style/capsize.js.map +1 -0
- package/dist/utilities/style/encode-background-icon.js +1 -0
- package/dist/utilities/style/encode-background-icon.js.map +1 -0
- package/dist/utilities/style/focus-visible-style-block.js +1 -0
- package/dist/utilities/style/focus-visible-style-block.js.map +1 -0
- package/dist/utilities/style/keyframe-animations.js +1 -0
- package/dist/utilities/style/keyframe-animations.js.map +1 -0
- package/package.json +6 -6
- package/dist/components/table/TableStickyColumnsContainer.d.ts +0 -9
- package/dist/components/table/TableStickyColumnsContainer.js +0 -1
- package/dist/docs/Accordion.mdx +0 -94
- package/dist/docs/ActionIcon.mdx +0 -87
- package/dist/docs/AlertDialog.mdx +0 -40
- package/dist/docs/Avatar.mdx +0 -129
- package/dist/docs/Badge.mdx +0 -55
- package/dist/docs/Box.mdx +0 -52
- package/dist/docs/Button.mdx +0 -68
- package/dist/docs/CONTRIBUTING.md +0 -224
- package/dist/docs/CSSWrapper.mdx +0 -10
- package/dist/docs/Carousel.mdx +0 -88
- package/dist/docs/Checkbox.mdx +0 -19
- package/dist/docs/CheckboxField.mdx +0 -14
- package/dist/docs/Chip.mdx +0 -118
- package/dist/docs/ChipDismissibleGroup.mdx +0 -33
- package/dist/docs/ChipToggleGroup.mdx +0 -27
- package/dist/docs/Combobox.mdx +0 -44
- package/dist/docs/DataTable.mdx +0 -279
- package/dist/docs/DateField.mdx +0 -20
- package/dist/docs/DateInput.mdx +0 -87
- package/dist/docs/Dialog.mdx +0 -68
- package/dist/docs/Dismissible.mdx +0 -48
- package/dist/docs/DismissibleGroup.mdx +0 -29
- package/dist/docs/Divider.mdx +0 -16
- package/dist/docs/DropdownMenu.mdx +0 -30
- package/dist/docs/EmptyState.mdx +0 -23
- package/dist/docs/FieldWrapper.mdx +0 -30
- package/dist/docs/FileInput.mdx +0 -45
- package/dist/docs/Flex.mdx +0 -16
- package/dist/docs/Form.mdx +0 -411
- package/dist/docs/Grid.mdx +0 -28
- package/dist/docs/Heading.mdx +0 -30
- package/dist/docs/Icon.mdx +0 -30
- package/dist/docs/Image.mdx +0 -14
- package/dist/docs/InlineMessage.mdx +0 -52
- package/dist/docs/Input.mdx +0 -24
- package/dist/docs/InputField.mdx +0 -26
- package/dist/docs/Label.mdx +0 -32
- package/dist/docs/Link.mdx +0 -53
- package/dist/docs/List.mdx +0 -38
- package/dist/docs/Loader.mdx +0 -16
- package/dist/docs/MarkdownContent.mdx +0 -77
- package/dist/docs/NavigationMenu.mdx +0 -144
- package/dist/docs/NotificationBadge.mdx +0 -35
- package/dist/docs/NumberInput.mdx +0 -37
- package/dist/docs/NumberInputField.mdx +0 -26
- package/dist/docs/PasswordField.mdx +0 -23
- package/dist/docs/PasswordInput.mdx +0 -15
- package/dist/docs/Popover.mdx +0 -29
- package/dist/docs/ProgressBar.mdx +0 -56
- package/dist/docs/README.mdx +0 -79
- package/dist/docs/RadioButton.mdx +0 -10
- package/dist/docs/RadioButtonField.mdx +0 -25
- package/dist/docs/RadioCard.mdx +0 -62
- package/dist/docs/SearchField.mdx +0 -26
- package/dist/docs/SearchInput.mdx +0 -13
- package/dist/docs/Select.mdx +0 -56
- package/dist/docs/SelectField.mdx +0 -17
- package/dist/docs/Sidedrawer.mdx +0 -155
- package/dist/docs/Slider.mdx +0 -117
- package/dist/docs/SliderField.mdx +0 -35
- package/dist/docs/Stack.mdx +0 -24
- package/dist/docs/StackContent.mdx +0 -32
- package/dist/docs/Stepper.mdx +0 -154
- package/dist/docs/Styling.mdx +0 -85
- package/dist/docs/Switch.mdx +0 -28
- package/dist/docs/Table.mdx +0 -146
- package/dist/docs/Tabs.mdx +0 -76
- package/dist/docs/Text.mdx +0 -24
- package/dist/docs/Textarea.mdx +0 -12
- package/dist/docs/TextareaField.mdx +0 -21
- package/dist/docs/Toast.mdx +0 -20
- package/dist/docs/ToggleGroup.mdx +0 -88
- package/dist/docs/Tooltip.mdx +0 -25
- package/dist/docs/TopBar.mdx +0 -95
- package/dist/docs/Video.mdx +0 -12
- package/dist/docs/accessibility.mdx +0 -67
- package/dist/docs/coreconcepts.mdx +0 -77
- package/dist/docs/introduction.mdx +0 -33
- package/dist/docs/versioning.mdx +0 -40
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Field Wrapper
|
|
3
|
-
component: FieldWrapper,InlineFieldWrapper
|
|
4
|
-
description: A utility component to help with composing consistent form fields
|
|
5
|
-
category: Form primitives
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
`FieldWrapper` renders a `Label` and (when applicable) a `InlineMessage`. Use it to wrap any type of input to create a consistent set of form fields.
|
|
9
|
-
|
|
10
|
-
```tsx preview
|
|
11
|
-
<FieldWrapper label="Example Field" fieldId="example">
|
|
12
|
-
<Input name="example" id="example" />
|
|
13
|
-
</FieldWrapper>
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
`InlineFieldWrapper` does the same but renders the label inline with the input, for example:`Checkbox`es and `Radio`s.
|
|
17
|
-
|
|
18
|
-
```tsx preview
|
|
19
|
-
<InlineFieldWrapper label="Example Checkbox">
|
|
20
|
-
<Checkbox name="example2" id="example2" />
|
|
21
|
-
</InlineFieldWrapper>
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
It can also be used alongside components like `Input`, `Select` or `Switch` when you may require some condensed inline fields. You can use the `direction` and `align` props to handle how the label is positioned relative to the component, in this case the label is placed on the right with `direction="reverse"` and it's aligned centrally with the switch.
|
|
25
|
-
|
|
26
|
-
```tsx preview
|
|
27
|
-
<InlineFieldWrapper direction="reverse" align="center" label="Toggle a field">
|
|
28
|
-
<Switch />
|
|
29
|
-
</InlineFieldWrapper>
|
|
30
|
-
```
|
package/dist/docs/FileInput.mdx
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: File Input
|
|
3
|
-
component: FileInput
|
|
4
|
-
description: FileInput is the lowest-level input component for the file type
|
|
5
|
-
category: Form primitives
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
`FileInput` is a specialised input that allows file uploads.
|
|
9
|
-
|
|
10
|
-
```jsx preview
|
|
11
|
-
<FileInput>Upload</FileInput>
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
## Required props
|
|
15
|
-
|
|
16
|
-
The required props `FileInput` needs are: `onSelect` and `children`.
|
|
17
|
-
|
|
18
|
-
`onSelect` is a callback that accepts the file selection (as a `FileList`), when the user interacts with the file browser interface. The file selection can then be used by the parent, for example: to be passed in a `POST` API call to be saved.
|
|
19
|
-
|
|
20
|
-
**Note:** The action of uploading the file to a backend is the parent's responsibility.
|
|
21
|
-
|
|
22
|
-
`children` is used to add text to the visible button.
|
|
23
|
-
|
|
24
|
-
## Multiple files
|
|
25
|
-
|
|
26
|
-
The input can also accept multiple files at once, via the `multiple` prop.
|
|
27
|
-
|
|
28
|
-
```jsx preview
|
|
29
|
-
<FileInput onSelect={(fileSelection) => console.log(fileSelection)} multiple>
|
|
30
|
-
Upload
|
|
31
|
-
</FileInput>
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## Restricting the MIME type
|
|
35
|
-
|
|
36
|
-
The `accept` prop makes the input filter out unwanted file types and prevent the user from selecting them.
|
|
37
|
-
|
|
38
|
-
```jsx preview
|
|
39
|
-
<FileInput
|
|
40
|
-
onSelect={(fileSelection) => console.log(fileSelection)}
|
|
41
|
-
accept="application/pdf"
|
|
42
|
-
>
|
|
43
|
-
Upload
|
|
44
|
-
</FileInput>
|
|
45
|
-
```
|
package/dist/docs/Flex.mdx
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Flex
|
|
3
|
-
component: Flex
|
|
4
|
-
description: The Flex component is a light abstraction over Box that sets its rendering context to flex
|
|
5
|
-
category: Layout
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
`Flex` shares the same API as `Box`, so you can access `as` and `css` to apply the correct semantic element and contextually relevant styles.
|
|
9
|
-
|
|
10
|
-
```tsx preview
|
|
11
|
-
<Flex css={{ justifyContent: 'space-between', width: '100%' }}>
|
|
12
|
-
<Box css={{ bg: '$primary', size: '$6' }} />
|
|
13
|
-
<Box css={{ bg: '$primary', size: '$6' }} />
|
|
14
|
-
<Box css={{ bg: '$primary', size: '$6' }} />
|
|
15
|
-
</Flex>
|
|
16
|
-
```
|
package/dist/docs/Form.mdx
DELETED
|
@@ -1,411 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Form
|
|
3
|
-
component: Form
|
|
4
|
-
description: Form abstracts form validation logic away from the view code
|
|
5
|
-
category: Form fields
|
|
6
|
-
priority: 1
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## General
|
|
10
|
-
|
|
11
|
-
`Form` is a wrapper around an HTML `form` element and the `react-hook-form` library. It manages the call to `useForm()`, renders a `<FormProvider>` and manages validation. When validation happens depends on the `validationMode` prop, which accepts `"onBlur" | "onSubmit"` and defaults to `"onBlur"`.
|
|
12
|
-
|
|
13
|
-
`Form` is compatible with all our field components (i.e. `InputField`, not `Input`) and is also compatible with custom fields so long as they call `useFormContext()` and use:
|
|
14
|
-
|
|
15
|
-
- `register` or `control` to register with the form per `react-hook-form`’s docs
|
|
16
|
-
- `errors` to display any errors for the relevant field
|
|
17
|
-
|
|
18
|
-
Custom field components should also accept a `validation` prop of type `ValidationOptions` and apply it to the field when present.
|
|
19
|
-
|
|
20
|
-
Here’s an example using a simplified version of our `InputField`:
|
|
21
|
-
|
|
22
|
-
```tsx
|
|
23
|
-
const InputField = ({ label, name, validation }) => {
|
|
24
|
-
const { register, errors } = useFormContext()
|
|
25
|
-
const ref = validation ? register(validation) : register
|
|
26
|
-
|
|
27
|
-
const error = errors[name]?.message
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
<FieldWrapper label={label} error={error} fieldId={name}>
|
|
31
|
-
<Input id={name} name={name} ref={ref} />
|
|
32
|
-
</FieldWrapper>
|
|
33
|
-
)
|
|
34
|
-
}
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
## Form submission
|
|
38
|
-
|
|
39
|
-
To handle form submission, `onSubmit` and optional `onError` callback props can be passed to Form. If there are any validation errors present `onError` will be called, in case of no errors the `onSubmit` will be called instead.
|
|
40
|
-
|
|
41
|
-
## ValidationOptions
|
|
42
|
-
|
|
43
|
-
The `ValidationOptions` type provides preset logic for common validation and processing patterns. You can also define your own custom logic.
|
|
44
|
-
|
|
45
|
-
### Basic validation
|
|
46
|
-
|
|
47
|
-
The `required` property accepts a `message` and a `value`. `value` is a boolean that represents whether the field is required. That pattern is only necessary when
|
|
48
|
-
deciding dynamically whether to make a field required. If it will always be required, you can pass a `string` containing the error message instead. The following two inputs are equivalent:
|
|
49
|
-
|
|
50
|
-
```tsx
|
|
51
|
-
<Form>
|
|
52
|
-
<InputField
|
|
53
|
-
name="name"
|
|
54
|
-
label="Name"
|
|
55
|
-
validation={{
|
|
56
|
-
required: {
|
|
57
|
-
value: true,
|
|
58
|
-
message: 'You must have a name'
|
|
59
|
-
}
|
|
60
|
-
}}
|
|
61
|
-
/>
|
|
62
|
-
<InputField
|
|
63
|
-
name="name"
|
|
64
|
-
label="Name"
|
|
65
|
-
validation={{
|
|
66
|
-
required: 'You must have a name'
|
|
67
|
-
}}
|
|
68
|
-
/>
|
|
69
|
-
<Button>Submit</Button>
|
|
70
|
-
</Form>
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
The following properties take a `message` and a `value`:
|
|
74
|
-
|
|
75
|
-
- `min`
|
|
76
|
-
- `max`
|
|
77
|
-
- `minLength`
|
|
78
|
-
- `maxLength`
|
|
79
|
-
- `pattern`
|
|
80
|
-
|
|
81
|
-
For example:
|
|
82
|
-
|
|
83
|
-
```tsx
|
|
84
|
-
<Form>
|
|
85
|
-
<InputField
|
|
86
|
-
type="number"
|
|
87
|
-
name="numCats"
|
|
88
|
-
label="Number of cats"
|
|
89
|
-
validation={{
|
|
90
|
-
min: {
|
|
91
|
-
value: 3,
|
|
92
|
-
message: 'You must have at least 3 cats!'
|
|
93
|
-
}
|
|
94
|
-
}}
|
|
95
|
-
/>
|
|
96
|
-
<InputField
|
|
97
|
-
name="faveName"
|
|
98
|
-
label="Favourite cat name"
|
|
99
|
-
validation={{
|
|
100
|
-
maxLength: {
|
|
101
|
-
value: 20,
|
|
102
|
-
message: 'Cats hate long names!'
|
|
103
|
-
}
|
|
104
|
-
}}
|
|
105
|
-
/>
|
|
106
|
-
<Button>Submit</Button>
|
|
107
|
-
</Form>
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
Note that when specifying a `pattern`, the `value` is a `RegExp`. For the other basic properties listed here, `value` is a `number`.
|
|
111
|
-
|
|
112
|
-
### Custom validation
|
|
113
|
-
|
|
114
|
-
The `validate` property accepts a function of type `(value: any) => boolean | string`. Its single argument is the current value of the field. It should return `true` if the value passes validation and a `string` containing an error if not.
|
|
115
|
-
|
|
116
|
-
```tsx
|
|
117
|
-
<Form>
|
|
118
|
-
<InputField
|
|
119
|
-
name="faveVowel"
|
|
120
|
-
label="Favourite vowel"
|
|
121
|
-
validation={{
|
|
122
|
-
validate: (value) => {
|
|
123
|
-
return (
|
|
124
|
-
['A', 'E', 'I', 'O', 'U'].contains(value) || 'That’s not a vowel!'
|
|
125
|
-
)
|
|
126
|
-
}
|
|
127
|
-
}}
|
|
128
|
-
/>
|
|
129
|
-
<Button>Submit</Button>
|
|
130
|
-
</Form>
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
### Basic processing
|
|
134
|
-
|
|
135
|
-
The following properties accept boolean values:
|
|
136
|
-
|
|
137
|
-
- `valueAsNumber`
|
|
138
|
-
- `valueAsDate`
|
|
139
|
-
|
|
140
|
-
These properties only apply to text inputs. If `true`, the value will be converted to the relevant type after validation.
|
|
141
|
-
|
|
142
|
-
### Custom processing
|
|
143
|
-
|
|
144
|
-
The `process` property accepts a function of type `(value: any) => any`. It can be used to process the value after validation.
|
|
145
|
-
|
|
146
|
-
## Persisting form data
|
|
147
|
-
|
|
148
|
-
`Form` is integrated with `react-hook-form-persist`'s package to save form data into session storage:
|
|
149
|
-
|
|
150
|
-
- send `persist` prop to Form component to persist form data in sessionStorage
|
|
151
|
-
- `persist` object has a required `id`, an optional `storage` prop and optional `include` or `exclude` arrays with reference to the input's names
|
|
152
|
-
- `include` will only save the listed inputs to session storage and `exclude` will exclude the listed inputs
|
|
153
|
-
- if both `include` and `exclude` are sent it will ignore `include` and use only `exclude`
|
|
154
|
-
- if no `storage` prop is sent, it will default to use sessionStorage, however you can override this by sending `local` to use localStorage
|
|
155
|
-
- persisted form data in sessionStorage or localStorage will populate form with `defaultValues` on refresh
|
|
156
|
-
|
|
157
|
-
Here's an example using the `persist` prop:
|
|
158
|
-
|
|
159
|
-
```tsx
|
|
160
|
-
<Form persist={{ id: 'nameAndSecret', exclude: ['secret'], storage: 'local' }}>
|
|
161
|
-
<InputField
|
|
162
|
-
name="name"
|
|
163
|
-
label="Name"
|
|
164
|
-
validation={{ required: 'Name is required' }}
|
|
165
|
-
/>
|
|
166
|
-
<InputField
|
|
167
|
-
name="secret"
|
|
168
|
-
label="Secret"
|
|
169
|
-
validation={{ required: 'Secret is required' }}
|
|
170
|
-
/>
|
|
171
|
-
<Button type="submit">Submit</Button>
|
|
172
|
-
</Form>
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
## Composing form field components
|
|
176
|
-
|
|
177
|
-
It’s easy to compose your own custom form fields from the low-level components in this library (`Input`, `Label`, `InlineMessage` etc) but there are some requirements that your new
|
|
178
|
-
field must meet in order to be fully compatible with our `Form`.
|
|
179
|
-
|
|
180
|
-
### Props
|
|
181
|
-
|
|
182
|
-
Your custom form field component must take the props specified in [General](#General)
|
|
183
|
-
|
|
184
|
-
#### error
|
|
185
|
-
|
|
186
|
-
`error` should be displayed in a `InlineMessage` when present. You don’t need to pass `error` to your component manually; the `Form` will pass it in automatically when appropriate.
|
|
187
|
-
|
|
188
|
-
To properly retrieve the error in both static and dynamic fields it is necessary to use the `useFieldError` hook stored in the form directory, that accepts a field name parameter.
|
|
189
|
-
|
|
190
|
-
#### validation
|
|
191
|
-
|
|
192
|
-
`validation` allows users of your component to add custom validation rules to it as specified above
|
|
193
|
-
|
|
194
|
-
#### register
|
|
195
|
-
|
|
196
|
-
If you don’t need to add any default validation to your component, then pass `register?.(validation)` down to the `Input` (or `Select`, etc) component’s `ref` prop.
|
|
197
|
-
If you do want to add default validation, pass something like this:
|
|
198
|
-
|
|
199
|
-
```ts
|
|
200
|
-
register?.({
|
|
201
|
-
maxLength: { value: 2, message: 'short data only!' },
|
|
202
|
-
...validation
|
|
203
|
-
})
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
(but check that validation is truthy first, or default it to an empty object!). Note that optional chaining is important here to protect from runtime errors if your field gets rendered outside of a `Form`.
|
|
207
|
-
|
|
208
|
-
### Examples
|
|
209
|
-
|
|
210
|
-
Here are two email input field examples. The first is a wrapper around an `InputField` and the second is manually composed from lower-level components. If wrapping `InputField` is an option then you should take it,
|
|
211
|
-
but for more complex use cases you can use the manual composition here as a guide.
|
|
212
|
-
|
|
213
|
-
```tsx
|
|
214
|
-
const EmailField = ({ name, register, error, validation = {}, ...rest }) => (
|
|
215
|
-
<InputField
|
|
216
|
-
name={name}
|
|
217
|
-
css={{ mb: '$3' }}
|
|
218
|
-
autoComplete="email"
|
|
219
|
-
label="Email address"
|
|
220
|
-
type="email"
|
|
221
|
-
register={register}
|
|
222
|
-
validation={{
|
|
223
|
-
required: 'email address is required',
|
|
224
|
-
pattern: {
|
|
225
|
-
value: /.+@.+\..+/,
|
|
226
|
-
message: 'please enter a valid email address'
|
|
227
|
-
},
|
|
228
|
-
...validation
|
|
229
|
-
}}
|
|
230
|
-
error={error}
|
|
231
|
-
{...rest}
|
|
232
|
-
/>
|
|
233
|
-
)
|
|
234
|
-
```
|
|
235
|
-
|
|
236
|
-
```tsx
|
|
237
|
-
const EmailField = ({ css, name, validation, required, ...rest }) => {
|
|
238
|
-
const { errors, register } = useFormContext()
|
|
239
|
-
|
|
240
|
-
const ref = validation ? register(validation) : register
|
|
241
|
-
const error = errors[name]?.message
|
|
242
|
-
|
|
243
|
-
return (
|
|
244
|
-
<FieldWrapper css={css} label="Email address" fieldId={name}>
|
|
245
|
-
<Input
|
|
246
|
-
name={name}
|
|
247
|
-
id={name}
|
|
248
|
-
type="email"
|
|
249
|
-
autoComplete="email"
|
|
250
|
-
ref={register?.({
|
|
251
|
-
required: 'email address is required',
|
|
252
|
-
pattern: {
|
|
253
|
-
value: /.+@.+\..+/,
|
|
254
|
-
message: 'please enter a valid email address'
|
|
255
|
-
},
|
|
256
|
-
...validation
|
|
257
|
-
})}
|
|
258
|
-
error={error}
|
|
259
|
-
{...rest}
|
|
260
|
-
/>
|
|
261
|
-
{error && <InlineMessage css={{ mt: '$1' }}>{error}</InlineMessage>}
|
|
262
|
-
</FieldWrapper>
|
|
263
|
-
)
|
|
264
|
-
}
|
|
265
|
-
```
|
|
266
|
-
|
|
267
|
-
## Accessing form data outside of fields
|
|
268
|
-
|
|
269
|
-
The same object that `useFormContext` returns is available in an optional render prop function, making it easy to use the current form state to determine whether a button should be disabled or read the current value of a specific field. Note that if `render` is provided, `Form` should not be given any children. An error will be thrown if both are provided.
|
|
270
|
-
|
|
271
|
-
```tsx
|
|
272
|
-
<Form
|
|
273
|
-
onSubmit={console.log}
|
|
274
|
-
render={({ formState }) => (
|
|
275
|
-
<>
|
|
276
|
-
<InputField
|
|
277
|
-
label="Name"
|
|
278
|
-
name="name"
|
|
279
|
-
validation={{ required: 'This field is required!' }}
|
|
280
|
-
/>
|
|
281
|
-
<Button type="submit" disabled={!formState.isValid}>
|
|
282
|
-
Submit
|
|
283
|
-
</Button>
|
|
284
|
-
</>
|
|
285
|
-
)}
|
|
286
|
-
/>
|
|
287
|
-
```
|
|
288
|
-
|
|
289
|
-
To access field value, another render prop that can be used is `watch(fieldName: string)`. If there were no default values provided for the form, on the first render, the `watch` function will return undefined.
|
|
290
|
-
|
|
291
|
-
```tsx
|
|
292
|
-
<Form
|
|
293
|
-
onSubmit={console.log}
|
|
294
|
-
render={({ watch }) => {
|
|
295
|
-
const currentFieldValue = watch('name')
|
|
296
|
-
|
|
297
|
-
return (
|
|
298
|
-
<>
|
|
299
|
-
<InputField
|
|
300
|
-
label="Name"
|
|
301
|
-
name="name"
|
|
302
|
-
validation={{ required: 'This field is required!' }}
|
|
303
|
-
/>
|
|
304
|
-
<Button type="submit" disabled={!formState.isValid}>
|
|
305
|
-
Submit
|
|
306
|
-
</Button>
|
|
307
|
-
</>
|
|
308
|
-
)
|
|
309
|
-
}}
|
|
310
|
-
/>
|
|
311
|
-
```
|
|
312
|
-
|
|
313
|
-
You can also name your `render` function:
|
|
314
|
-
|
|
315
|
-
```tsx
|
|
316
|
-
const SomeFormContent = ({ formState }) => (
|
|
317
|
-
<>
|
|
318
|
-
<InputField
|
|
319
|
-
label="Name"
|
|
320
|
-
name="name"
|
|
321
|
-
validation={{ required: 'This field is required!' }}
|
|
322
|
-
/>
|
|
323
|
-
<Button type="submit" disabled={!formState.isValid}>
|
|
324
|
-
Submit
|
|
325
|
-
</Button>
|
|
326
|
-
</>
|
|
327
|
-
)
|
|
328
|
-
|
|
329
|
-
const SomeForm = () => <Form onSubmit={console.log} render={SomeFormContent} />
|
|
330
|
-
```
|
|
331
|
-
|
|
332
|
-
## Dynamic fields - useFieldArray()
|
|
333
|
-
|
|
334
|
-
[React-hook-form docs v6](https://react-hook-form.com/v6/api/#useFieldArray)
|
|
335
|
-
|
|
336
|
-
To work with dynamically created fields `Form` exposes another render prop, `useFieldArray`. It exposes the following methods and objects:
|
|
337
|
-
|
|
338
|
-
- `fields`: fields is an object keeping all the dynamic fields stored in the field array. Each entry in the field array can have multiple values (e.g { field: 'test', field2: true, field3: [ 'item1', 'item2' ] }, for example for input, checkbox and select)
|
|
339
|
-
- `append` and `prepend` are used to insert dynamic fields at the start and end of the array
|
|
340
|
-
- `remove` and `insert` add or remove items at specified index
|
|
341
|
-
- `move` and `swap` are used to reposition items in the array
|
|
342
|
-
|
|
343
|
-
There are a few rules that need to be followed to make the dynamic fields work correctly in the context of the form:
|
|
344
|
-
|
|
345
|
-
- For the mapping to work correctly, instead of using the index from a `map()` or some other id, it is required to pass ids generated by the `useFieldArray` hook.
|
|
346
|
-
- Each dynamic field needs to take a default value from the fields object
|
|
347
|
-
- Each field name needs to be in a specific format `fieldArrayName[index].fieldName`, where index is the second arg of `map` function
|
|
348
|
-
- To initialize the useFieldArray hook a control object either from `useFormContext` or a Form render prop needs to be used.
|
|
349
|
-
|
|
350
|
-
```tsx
|
|
351
|
-
const { fields } = useFieldArray({
|
|
352
|
-
control,
|
|
353
|
-
name: 'testArray'
|
|
354
|
-
})
|
|
355
|
-
|
|
356
|
-
//////
|
|
357
|
-
|
|
358
|
-
{
|
|
359
|
-
fields.map((field, index) => (
|
|
360
|
-
<CheckboxField
|
|
361
|
-
defaultChecked={field.checkbox}
|
|
362
|
-
label="Label"
|
|
363
|
-
name={`testArray[${index}].field2`}
|
|
364
|
-
key={field.id}
|
|
365
|
-
/>
|
|
366
|
-
))
|
|
367
|
-
}
|
|
368
|
-
```
|
|
369
|
-
|
|
370
|
-
Example:
|
|
371
|
-
|
|
372
|
-
```tsx
|
|
373
|
-
<Form
|
|
374
|
-
defaultValues={{
|
|
375
|
-
testArray: [
|
|
376
|
-
{ field1: 'test', field2: true },
|
|
377
|
-
{ field1: 'test2', field2: true }
|
|
378
|
-
]
|
|
379
|
-
}}
|
|
380
|
-
render={({ control }) => {
|
|
381
|
-
const { fields, append, remove } = useFieldArray({
|
|
382
|
-
control,
|
|
383
|
-
name: 'testArray'
|
|
384
|
-
})
|
|
385
|
-
|
|
386
|
-
return (
|
|
387
|
-
<>
|
|
388
|
-
{fields.map((field, index) => (
|
|
389
|
-
<div key={field.id}>
|
|
390
|
-
<InputField
|
|
391
|
-
label="Input"
|
|
392
|
-
name={`testArray[${index}].field1`}
|
|
393
|
-
defaultValue={field.field1}
|
|
394
|
-
/>
|
|
395
|
-
<CheckboxField
|
|
396
|
-
label="Checkbox"
|
|
397
|
-
name={`testArray[${index}].field2`}
|
|
398
|
-
defaultChecked={field.field2}
|
|
399
|
-
/>
|
|
400
|
-
</div>
|
|
401
|
-
))}
|
|
402
|
-
|
|
403
|
-
<button onClick={() => append({ field1: 'test', field2: false })}>
|
|
404
|
-
Add Item
|
|
405
|
-
</button>
|
|
406
|
-
<button onClick={() => remove(0)}>Remove first item</button>
|
|
407
|
-
</>
|
|
408
|
-
)
|
|
409
|
-
}}
|
|
410
|
-
/>
|
|
411
|
-
```
|
package/dist/docs/Grid.mdx
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Grid
|
|
3
|
-
component: Grid
|
|
4
|
-
description: The Grid component implements a simple CSS grid with auto-fit columns
|
|
5
|
-
category: Layout
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
The `gap` prop specifies the distance between items in the grid using the theme's `space` scale and the `minItemSize` prop specifies, in any valid CSS units, the minimum size of each grid item.
|
|
9
|
-
|
|
10
|
-
**Note:** Passing percentage values into `minItemSize` will result in unintuitive behaviour. E.g. `minItemSize="50%"` will result in only one item per row because `50%` `width` + any `gap` between the items means the total width of the row will be `50%` + `50%` + `gap` which will wrap the second item onto the next line.
|
|
11
|
-
|
|
12
|
-
```tsx preview
|
|
13
|
-
<Grid minItemSize="10em" gap="3" css={{ width: '100%' }}>
|
|
14
|
-
{Array.from(Array(6)).map((_, i) => (
|
|
15
|
-
<Box key={i} css={{ bg: '$primary', height: '10em' }} />
|
|
16
|
-
))}
|
|
17
|
-
</Grid>
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
Should you need further control of the size of grid items, you can pass `maxItemSize`, which accepts the same value types as `minItemSize`. This is useful when you wish to control the width of items that may or may not fill the container width based on content, so they do not stretch to fill the width.
|
|
21
|
-
|
|
22
|
-
```tsx
|
|
23
|
-
<Grid minItemSize="10em" maxItemSize="10em" gap="3" css={{ width: '100%' }}>
|
|
24
|
-
{Array.from(Array(3)).map((_, i) => (
|
|
25
|
-
<Box key={i} css={{ bg: '$primary', height: '10em' }} />
|
|
26
|
-
))}
|
|
27
|
-
</Grid>
|
|
28
|
-
```
|
package/dist/docs/Heading.mdx
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Heading
|
|
3
|
-
component: Heading
|
|
4
|
-
description: Use Heading to define a semantically relevant title to a component, section or page
|
|
5
|
-
category: Content
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
It should be used for all headings, whether it’s for a page, `section`, card, etc.
|
|
9
|
-
|
|
10
|
-
`Heading`’s `as` prop defaults to `h2` but also accepts `h1`, `h3`, `h4`, `h5`, `h6`. Follow [semantic HTML guidelines](https://webaim.org/techniques/semanticstructure/) when deciding which element to use. Also note that the size of a heading is controlled separately to which element is used.
|
|
11
|
-
|
|
12
|
-
## Sizes
|
|
13
|
-
|
|
14
|
-
```tsx preview
|
|
15
|
-
<Heading size="xs">The lowest level heading</Heading>
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
```tsx preview
|
|
19
|
-
<Heading size="sm">
|
|
20
|
-
A heading for an individual block of content, e.g. a card
|
|
21
|
-
</Heading>
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
```tsx preview
|
|
25
|
-
<Heading>A subheading in a page. This is the default size.</Heading>
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
```tsx preview
|
|
29
|
-
<Heading size="lg">A page heading.</Heading>
|
|
30
|
-
```
|
package/dist/docs/Icon.mdx
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Icon
|
|
3
|
-
component: Icon
|
|
4
|
-
description: A standardised way to render icons, ensuring that only the icons you use are included in your output
|
|
5
|
-
category: Content
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
`Icon` is a light wrapper component that provides a standardised set of styles to the icon in use. It requires an SVG from our icon library to be passed into the `is` prop.
|
|
9
|
-
|
|
10
|
-
```tsx preview
|
|
11
|
-
<Stack gap="4">
|
|
12
|
-
<Icon is={BatteryMedium} />
|
|
13
|
-
<Icon is={Crossing} />
|
|
14
|
-
<Icon is={EyeCrossed} />
|
|
15
|
-
<Icon is={Paperclip} />
|
|
16
|
-
<Icon is={Sun} />
|
|
17
|
-
<Icon is={Wheelchair} />
|
|
18
|
-
</Stack>
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
Ensure that you pair the imported icon (in this case `Brightness`) with the `Icon` component to render in a consistent and reliable way. Review the available icons on the [icon listing page](/theme/icons)
|
|
22
|
-
|
|
23
|
-
```tsx
|
|
24
|
-
import { Icon } from '@atom-learning/components'
|
|
25
|
-
import { Brightness } from '@atom-learning/icons'
|
|
26
|
-
|
|
27
|
-
const Component = () => (
|
|
28
|
-
<Icon is={Brightness} size="md" css={{ color: '$primary' }} />
|
|
29
|
-
)
|
|
30
|
-
```
|
package/dist/docs/Image.mdx
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Image
|
|
3
|
-
component: Image
|
|
4
|
-
category: Media
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
The `Image` component renders an `img` element with basic styling to stop it from overflowing its parent element or expanding beyond its natural size and distorting.
|
|
8
|
-
|
|
9
|
-
```tsx preview
|
|
10
|
-
<Image
|
|
11
|
-
src="https://atomlearning.co.uk/images/key-img.png"
|
|
12
|
-
alt="An Atom Learning user riding a pencil rocket"
|
|
13
|
-
/>
|
|
14
|
-
```
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Inline Message
|
|
3
|
-
component: InlineMessage
|
|
4
|
-
description: Inline feedback message with an optional icon
|
|
5
|
-
category: Feedback
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
Inline messages consist of an inline feedback message in the form of simple text that inform the user of relevant information, revealed in context.
|
|
9
|
-
|
|
10
|
-
```tsx preview
|
|
11
|
-
<InlineMessage>This is an Inline Message</InlineMessage>
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
## Theme
|
|
15
|
-
|
|
16
|
-
These are the available `theme`s for this component: `success`, `warning`, `error`, `neutral` and `info`. The default is `error` (due to most frequent context).
|
|
17
|
-
|
|
18
|
-
```tsx preview
|
|
19
|
-
<>
|
|
20
|
-
<InlineMessage theme="error">This is an error Inline Message</InlineMessage>
|
|
21
|
-
<InlineMessage theme="warning">
|
|
22
|
-
This is a warning Inline Message
|
|
23
|
-
</InlineMessage>
|
|
24
|
-
<InlineMessage theme="success">
|
|
25
|
-
This is a success Inline Message
|
|
26
|
-
</InlineMessage>
|
|
27
|
-
<InlineMessage theme="info">This is an info Inline Message</InlineMessage>
|
|
28
|
-
<InlineMessage theme="neutral">
|
|
29
|
-
This is a neutral Inline Message
|
|
30
|
-
</InlineMessage>
|
|
31
|
-
</>
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## Size
|
|
35
|
-
|
|
36
|
-
These are the available `size`s for this component: `xs`, `sm` and `md`. The default is `sm`
|
|
37
|
-
|
|
38
|
-
```tsx preview
|
|
39
|
-
<>
|
|
40
|
-
<InlineMessage size="xs">This is an xs Inline Message</InlineMessage>
|
|
41
|
-
<InlineMessage size="sm">This is a sm Inline Message</InlineMessage>
|
|
42
|
-
<InlineMessage size="md">This is a md Inline Message</InlineMessage>
|
|
43
|
-
</>
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
## Icon
|
|
47
|
-
|
|
48
|
-
Each theme has a specific icon it should export, so showing or hiding an icon is simply done using the `showIcon` prop. Default is `true`.
|
|
49
|
-
|
|
50
|
-
```tsx preview
|
|
51
|
-
<InlineMessage showIcon={false}>This is an Inline Message</InlineMessage>
|
|
52
|
-
```
|
package/dist/docs/Input.mdx
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Input
|
|
3
|
-
component: Input
|
|
4
|
-
description: Input is the lowest-level input component for text and number types
|
|
5
|
-
category: Form primitives
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
Inputs should be accompanied by labels, so rather than using `Input` directly in a UI,
|
|
9
|
-
it’s normally best to use a field component, which combines an `Input` with a `Label` and
|
|
10
|
-
displays validation errors. If none of the existing field components suit your needs,
|
|
11
|
-
it might be worth adding a new one.
|
|
12
|
-
|
|
13
|
-
`Input` accepts a subset of the `types` that an HTML `input` element because we have more specialised
|
|
14
|
-
components for the others (e.g. `Checkbox`, `Radio`).
|
|
15
|
-
|
|
16
|
-
```tsx live
|
|
17
|
-
<Input placeholder="Placeholder text" css={{ width: 300 }} />
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Accessibility
|
|
21
|
-
|
|
22
|
-
While `Input` accepts `"number"` for its `type` prop, this does not render `<input type="number"/>`. Instead,
|
|
23
|
-
it renders `<input type="text" inputmode="numeric" pattern=[0-9]*/>` to tell browsers to show a numeric keyboard
|
|
24
|
-
while avoiding the [UX and accessibility problems associated with `type="number"`](https://technology.blog.gov.uk/2020/02/24/why-the-gov-uk-design-system-team-changed-the-input-type-for-numbers/).
|