@react-md/core 1.0.0-next.8 → 1.0.0-next.9
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/.stylelintrc.json +14 -0
- package/.turbo/turbo-build.log +5 -5
- package/.turbo/turbo-lint.log +13 -0
- package/CHANGELOG.md +9 -0
- package/README.md +39 -24
- package/coverage/clover.xml +1013 -404
- package/coverage/coverage-final.json +9 -2
- package/coverage/lcov-report/AutoComplete.tsx.html +283 -0
- package/coverage/lcov-report/RootHtml.tsx.html +370 -0
- package/coverage/lcov-report/Select.tsx.html +1411 -0
- package/coverage/lcov-report/autocomplete/AutoComplete.tsx.html +283 -0
- package/coverage/lcov-report/autocomplete/Autocomplete.tsx.html +283 -0
- package/coverage/lcov-report/autocomplete/index.html +161 -0
- package/coverage/lcov-report/autocomplete/useAutoComplete.ts.html +775 -0
- package/coverage/lcov-report/autocomplete/useAutocomplete.ts.html +775 -0
- package/coverage/lcov-report/autocomplete/useInlineAutoComplete.ts.html +340 -0
- package/coverage/lcov-report/autocomplete/useInlineAutocomplete.ts.html +346 -0
- package/coverage/lcov-report/autocomplete/utils.ts.html +106 -0
- package/coverage/lcov-report/avatar/Avatar.tsx.html +162 -99
- package/coverage/lcov-report/avatar/index.html +19 -34
- package/coverage/lcov-report/avatar/styles.ts.html +1 -1
- package/coverage/lcov-report/button/Button.tsx.html +85 -85
- package/coverage/lcov-report/button/index.html +12 -12
- package/coverage/lcov-report/dialog/DialogFooter.tsx.html +36 -36
- package/coverage/lcov-report/dialog/DialogHeader.tsx.html +26 -26
- package/coverage/lcov-report/dialog/index.html +34 -19
- package/coverage/lcov-report/form/AutoComplete.tsx.html +283 -0
- package/coverage/lcov-report/form/Form.tsx.html +22 -22
- package/coverage/lcov-report/form/OptGroup.tsx.html +169 -166
- package/coverage/lcov-report/form/Option.tsx.html +727 -0
- package/coverage/lcov-report/form/Select.tsx.html +962 -1112
- package/coverage/lcov-report/form/SelectOriginal.tsx.html +1630 -0
- package/coverage/lcov-report/form/SelectV2.tsx.html +1024 -0
- package/coverage/lcov-report/form/SelectedOption.tsx.html +250 -0
- package/coverage/lcov-report/form/index.html +57 -12
- package/coverage/lcov-report/form/selectUtils.ts.html +188 -221
- package/coverage/lcov-report/form/useAutoComplete.ts.html +787 -0
- package/coverage/lcov-report/form/useCombobox.ts.html +454 -460
- package/coverage/lcov-report/form/useComboboxList.ts.html +108 -93
- package/coverage/lcov-report/form/useFormReset.ts.html +229 -0
- package/coverage/lcov-report/form/useInlineAutoComplete.ts.html +379 -0
- package/coverage/lcov-report/form/useSelectCombobox.ts.html +499 -0
- package/coverage/lcov-report/form/utils.ts.html +209 -170
- package/coverage/lcov-report/icon/FontIcon.tsx.html +28 -28
- package/coverage/lcov-report/icon/MaterialIcon.tsx.html +235 -0
- package/coverage/lcov-report/icon/index.html +1 -1
- package/coverage/lcov-report/index.html +36 -21
- package/coverage/lcov-report/media-queries/appSize.ts.html +1 -1
- package/coverage/lcov-report/media-queries/index.html +1 -1
- package/coverage/lcov-report/menu/DropdownMenu.tsx.html +188 -188
- package/coverage/lcov-report/menu/Menu.tsx.html +271 -265
- package/coverage/lcov-report/menu/MenuItem.tsx.html +292 -0
- package/coverage/lcov-report/menu/MenuVisibilityProvider.tsx.html +48 -33
- package/coverage/lcov-report/menu/index.html +45 -15
- package/coverage/lcov-report/menu/useContextMenu.ts.html +490 -0
- package/coverage/lcov-report/movement/index.html +19 -19
- package/coverage/lcov-report/movement/useKeyboardMovementProvider.ts.html +422 -383
- package/coverage/lcov-report/positioning/constants.ts.html +463 -0
- package/coverage/lcov-report/positioning/index.html +30 -30
- package/coverage/lcov-report/positioning/useFixedPositioning.ts.html +1321 -0
- package/coverage/lcov-report/progress/CircularProgress.tsx.html +184 -184
- package/coverage/lcov-report/progress/index.html +19 -34
- package/coverage/lcov-report/searching/caseInsensitive.ts.html +685 -0
- package/coverage/lcov-report/searching/fuzzy.ts.html +610 -0
- package/coverage/lcov-report/searching/index.html +161 -0
- package/coverage/lcov-report/searching/toSearchQuery.ts.html +139 -0
- package/coverage/lcov-report/searching/utils.ts.html +247 -0
- package/coverage/lcov-report/src/CoreProviders.tsx.html +20 -20
- package/coverage/lcov-report/src/NoSsr.tsx.html +1 -1
- package/coverage/lcov-report/src/RootHtml.tsx.html +370 -0
- package/coverage/lcov-report/src/SsrProvider.tsx.html +10 -10
- package/coverage/lcov-report/src/app-bar/AppBar.tsx.html +1 -1
- package/coverage/lcov-report/src/app-bar/AppBarTitle.tsx.html +1 -1
- package/coverage/lcov-report/src/app-bar/index.html +1 -1
- package/coverage/lcov-report/src/avatar/Avatar.tsx.html +1 -1
- package/coverage/lcov-report/src/avatar/index.html +1 -1
- package/coverage/lcov-report/src/avatar/styles.ts.html +1 -1
- package/coverage/lcov-report/src/badge/Badge.tsx.html +1 -1
- package/coverage/lcov-report/src/badge/index.html +1 -1
- package/coverage/lcov-report/src/box/Box.tsx.html +1 -1
- package/coverage/lcov-report/src/box/index.html +1 -1
- package/coverage/lcov-report/src/box/styles.ts.html +1 -1
- package/coverage/lcov-report/src/button/AsyncButton.tsx.html +1 -1
- package/coverage/lcov-report/src/button/Button.tsx.html +1 -1
- package/coverage/lcov-report/src/button/ButtonUnstyled.tsx.html +1 -1
- package/coverage/lcov-report/src/button/FloatingActionButton.tsx.html +1 -1
- package/coverage/lcov-report/src/button/TooltippedButton.tsx.html +1 -1
- package/coverage/lcov-report/src/button/buttonStyles.ts.html +1 -1
- package/coverage/lcov-report/src/button/buttonUnstyledStyles.ts.html +1 -1
- package/coverage/lcov-report/src/button/index.html +1 -1
- package/coverage/lcov-report/src/card/Card.tsx.html +1 -1
- package/coverage/lcov-report/src/card/CardContent.tsx.html +1 -1
- package/coverage/lcov-report/src/card/CardFooter.tsx.html +1 -1
- package/coverage/lcov-report/src/card/CardHeader.tsx.html +1 -1
- package/coverage/lcov-report/src/card/CardSubtitle.tsx.html +1 -1
- package/coverage/lcov-report/src/card/CardTitle.tsx.html +1 -1
- package/coverage/lcov-report/src/card/ClickableCard.tsx.html +1 -1
- package/coverage/lcov-report/src/card/index.html +1 -1
- package/coverage/lcov-report/src/card/styles.ts.html +1 -1
- package/coverage/lcov-report/src/chip/Chip.tsx.html +1 -1
- package/coverage/lcov-report/src/chip/index.html +1 -1
- package/coverage/lcov-report/src/chip/styles.ts.html +1 -1
- package/coverage/lcov-report/src/cssUtils.ts.html +53 -53
- package/coverage/lcov-report/src/delegateEvent.ts.html +1 -1
- package/coverage/lcov-report/src/dialog/Dialog.tsx.html +1 -1
- package/coverage/lcov-report/src/dialog/DialogContainer.tsx.html +1 -1
- package/coverage/lcov-report/src/dialog/DialogContent.tsx.html +1 -1
- package/coverage/lcov-report/src/dialog/DialogFooter.tsx.html +1 -1
- package/coverage/lcov-report/src/dialog/DialogHeader.tsx.html +1 -1
- package/coverage/lcov-report/src/dialog/DialogTitle.tsx.html +1 -1
- package/coverage/lcov-report/src/dialog/FixedDialog.tsx.html +1 -1
- package/coverage/lcov-report/src/dialog/NestedDialogProvider.ts.html +1 -1
- package/coverage/lcov-report/src/dialog/index.html +1 -1
- package/coverage/lcov-report/src/dialog/styles.ts.html +1 -1
- package/coverage/lcov-report/src/divider/Divider.tsx.html +1 -1
- package/coverage/lcov-report/src/divider/index.html +1 -1
- package/coverage/lcov-report/src/divider/styles.ts.html +1 -1
- package/coverage/lcov-report/src/draggable/index.html +1 -1
- package/coverage/lcov-report/src/draggable/useDraggable.ts.html +1 -1
- package/coverage/lcov-report/src/draggable/utils.ts.html +1 -1
- package/coverage/lcov-report/src/expansion-panel/ExpansionList.tsx.html +1 -1
- package/coverage/lcov-report/src/expansion-panel/ExpansionPanel.tsx.html +1 -1
- package/coverage/lcov-report/src/expansion-panel/ExpansionPanelHeader.tsx.html +1 -1
- package/coverage/lcov-report/src/expansion-panel/index.html +1 -1
- package/coverage/lcov-report/src/expansion-panel/useExpansionList.ts.html +1 -1
- package/coverage/lcov-report/src/expansion-panel/useExpansionPanels.ts.html +1 -1
- package/coverage/lcov-report/src/focus/index.html +1 -1
- package/coverage/lcov-report/src/focus/useFocusContainer.ts.html +1 -1
- package/coverage/lcov-report/src/focus/utils.ts.html +1 -1
- package/coverage/lcov-report/src/form/AutoComplete.tsx.html +283 -0
- package/coverage/lcov-report/src/form/Checkbox.tsx.html +1 -1
- package/coverage/lcov-report/src/form/Fieldset.tsx.html +1 -1
- package/coverage/lcov-report/src/form/FileInput.tsx.html +1 -1
- package/coverage/lcov-report/src/form/Form.tsx.html +11 -8
- package/coverage/lcov-report/src/form/FormMessage.tsx.html +1 -1
- package/coverage/lcov-report/src/form/FormMessageContainer.tsx.html +1 -1
- package/coverage/lcov-report/src/form/FormMessageCounter.tsx.html +1 -1
- package/coverage/lcov-report/src/form/InputToggle.tsx.html +1 -1
- package/coverage/lcov-report/src/form/InputToggleIcon.tsx.html +56 -56
- package/coverage/lcov-report/src/form/Label.tsx.html +1 -1
- package/coverage/lcov-report/src/form/Legend.tsx.html +1 -1
- package/coverage/lcov-report/src/form/MenuItemCheckbox.tsx.html +3 -3
- package/coverage/lcov-report/src/form/MenuItemFileInput.tsx.html +1 -1
- package/coverage/lcov-report/src/form/MenuItemInputToggle.tsx.html +178 -232
- package/coverage/lcov-report/src/form/MenuItemRadio.tsx.html +3 -3
- package/coverage/lcov-report/src/form/MenuItemSwitch.tsx.html +1 -1
- package/coverage/lcov-report/src/form/MenuItemTextField.tsx.html +1 -1
- package/coverage/lcov-report/src/form/NativeSelect.tsx.html +1 -1
- package/coverage/lcov-report/src/form/OptGroup.tsx.html +1 -1
- package/coverage/lcov-report/src/form/Option.tsx.html +1 -1
- package/coverage/lcov-report/src/form/Password.tsx.html +1 -1
- package/coverage/lcov-report/src/form/Radio.tsx.html +1 -1
- package/coverage/lcov-report/src/form/Select.tsx.html +894 -1146
- package/coverage/lcov-report/src/form/SelectValue.tsx.html +1 -1
- package/coverage/lcov-report/src/form/Slider.tsx.html +1 -1
- package/coverage/lcov-report/src/form/SliderContainer.tsx.html +1 -1
- package/coverage/lcov-report/src/form/SliderMark.tsx.html +1 -1
- package/coverage/lcov-report/src/form/SliderMarkLabel.tsx.html +1 -1
- package/coverage/lcov-report/src/form/SliderThumb.tsx.html +1 -1
- package/coverage/lcov-report/src/form/SliderTrack.tsx.html +1 -1
- package/coverage/lcov-report/src/form/SliderValueMarks.tsx.html +1 -1
- package/coverage/lcov-report/src/form/SliderValueTooltip.tsx.html +1 -1
- package/coverage/lcov-report/src/form/Switch.tsx.html +1 -1
- package/coverage/lcov-report/src/form/SwitchTrack.tsx.html +1 -1
- package/coverage/lcov-report/src/form/TextArea.tsx.html +1 -1
- package/coverage/lcov-report/src/form/TextField.tsx.html +1 -1
- package/coverage/lcov-report/src/form/TextFieldAddon.tsx.html +1 -1
- package/coverage/lcov-report/src/form/TextFieldContainer.tsx.html +1 -1
- package/coverage/lcov-report/src/form/TextFieldContainerStyles.ts.html +1 -1
- package/coverage/lcov-report/src/form/fileUtils.ts.html +1 -1
- package/coverage/lcov-report/src/form/formConfig.ts.html +1 -1
- package/coverage/lcov-report/src/form/formMessageStyles.ts.html +1 -1
- package/coverage/lcov-report/src/form/index.html +30 -900
- package/coverage/lcov-report/src/form/inputToggleStyles.ts.html +30 -30
- package/coverage/lcov-report/src/form/menuItemInputToggleStyles.ts.html +319 -0
- package/coverage/lcov-report/src/form/nativeSelectStyles.ts.html +1 -1
- package/coverage/lcov-report/src/form/optionStyles.ts.html +1 -1
- package/coverage/lcov-report/src/form/passwordStyles.ts.html +1 -1
- package/coverage/lcov-report/src/form/selectStyles.ts.html +1 -1
- package/coverage/lcov-report/src/form/selectUtils.ts.html +1 -1
- package/coverage/lcov-report/src/form/sliderUtils.ts.html +1 -1
- package/coverage/lcov-report/src/form/switchStyles.ts.html +1 -1
- package/coverage/lcov-report/src/form/textAreaStyles.ts.html +1 -1
- package/coverage/lcov-report/src/form/textFieldStyles.ts.html +1 -1
- package/coverage/lcov-report/src/form/useAutoComplete.ts.html +787 -0
- package/coverage/lcov-report/src/form/useCheckboxGroup.ts.html +1 -1
- package/coverage/lcov-report/src/form/useCombobox.ts.html +943 -457
- package/coverage/lcov-report/src/form/useEditableCombobox.ts.html +502 -0
- package/coverage/lcov-report/src/form/useFileUpload.ts.html +1 -1
- package/coverage/lcov-report/src/form/useInlineAutoComplete.ts.html +109 -0
- package/coverage/lcov-report/src/form/useListboxProvider.ts.html +1 -1
- package/coverage/lcov-report/src/form/useNumberField.ts.html +1 -1
- package/coverage/lcov-report/src/form/useRadioGroup.ts.html +1 -1
- package/coverage/lcov-report/src/form/useRangeSlider.ts.html +1 -1
- package/coverage/lcov-report/src/form/useResizingTextArea.ts.html +1 -1
- package/coverage/lcov-report/src/form/useSelectCombobox.ts.html +295 -0
- package/coverage/lcov-report/src/form/useSlider.ts.html +1 -1
- package/coverage/lcov-report/src/form/useTextField.ts.html +1 -1
- package/coverage/lcov-report/src/form/utils.ts.html +200 -170
- package/coverage/lcov-report/src/form/validation.ts.html +1 -1
- package/coverage/lcov-report/src/hoverMode/index.html +1 -1
- package/coverage/lcov-report/src/hoverMode/useHoverMode.ts.html +1 -1
- package/coverage/lcov-report/src/hoverMode/useHoverModeProvider.ts.html +1 -1
- package/coverage/lcov-report/src/icon/FontIcon.tsx.html +28 -28
- package/coverage/lcov-report/src/icon/IconRotator.tsx.html +1 -1
- package/coverage/lcov-report/src/icon/MaterialIcon.tsx.html +1 -1
- package/coverage/lcov-report/src/icon/MaterialSymbol.tsx.html +1 -1
- package/coverage/lcov-report/src/icon/SVGIcon.tsx.html +1 -1
- package/coverage/lcov-report/src/icon/TextIconSpacing.tsx.html +51 -51
- package/coverage/lcov-report/src/icon/iconConfig.tsx.html +10 -10
- package/coverage/lcov-report/src/icon/index.html +1 -1
- package/coverage/lcov-report/src/icon/material.ts.html +1 -1
- package/coverage/lcov-report/src/icon/materialConfig.ts.html +1 -1
- package/coverage/lcov-report/src/icon/styles.ts.html +38 -38
- package/coverage/lcov-report/src/index.html +9 -354
- package/coverage/lcov-report/src/interaction/Ripple.tsx.html +1 -1
- package/coverage/lcov-report/src/interaction/RippleContainer.tsx.html +1 -1
- package/coverage/lcov-report/src/interaction/UserInteractionModeProvider.tsx.html +87 -87
- package/coverage/lcov-report/src/interaction/config.ts.html +7 -7
- package/coverage/lcov-report/src/interaction/index.html +1 -1
- package/coverage/lcov-report/src/interaction/useElementInteraction.tsx.html +83 -83
- package/coverage/lcov-report/src/interaction/useHigherContrastChildren.tsx.html +7 -7
- package/coverage/lcov-report/src/interaction/utils.ts.html +1 -1
- package/coverage/lcov-report/src/layout/LayoutAppBar.tsx.html +1 -1
- package/coverage/lcov-report/src/layout/LayoutNav.tsx.html +1 -1
- package/coverage/lcov-report/src/layout/LayoutWindowSplitter.tsx.html +1 -1
- package/coverage/lcov-report/src/layout/Main.tsx.html +1 -1
- package/coverage/lcov-report/src/layout/index.html +1 -1
- package/coverage/lcov-report/src/layout/layoutNavStyles.ts.html +1 -1
- package/coverage/lcov-report/src/layout/layoutWindowSplitterStyles.ts.html +1 -1
- package/coverage/lcov-report/src/layout/mainStyles.ts.html +1 -1
- package/coverage/lcov-report/src/layout/useExpandableLayout.ts.html +1 -1
- package/coverage/lcov-report/src/layout/useHorizontalLayoutTransition.ts.html +1 -1
- package/coverage/lcov-report/src/layout/useLayoutAppBarHeight.ts.html +1 -1
- package/coverage/lcov-report/src/layout/useLayoutTree.ts.html +1 -1
- package/coverage/lcov-report/src/layout/useLayoutWindowSplitter.ts.html +1 -1
- package/coverage/lcov-report/src/layout/useMainTabIndex.ts.html +1 -1
- package/coverage/lcov-report/src/layout/useResizableLayout.ts.html +1 -1
- package/coverage/lcov-report/src/layout/useTemporaryLayout.ts.html +1 -1
- package/coverage/lcov-report/src/link/Link.tsx.html +1 -1
- package/coverage/lcov-report/src/link/SkipToMainContent.tsx.html +1 -1
- package/coverage/lcov-report/src/link/index.html +1 -1
- package/coverage/lcov-report/src/link/styles.ts.html +1 -1
- package/coverage/lcov-report/src/list/List.tsx.html +30 -30
- package/coverage/lcov-report/src/list/ListItem.tsx.html +124 -124
- package/coverage/lcov-report/src/list/ListItemAddon.tsx.html +35 -35
- package/coverage/lcov-report/src/list/ListItemChildren.tsx.html +79 -79
- package/coverage/lcov-report/src/list/ListItemLink.tsx.html +2 -2
- package/coverage/lcov-report/src/list/ListItemText.tsx.html +35 -35
- package/coverage/lcov-report/src/list/ListSubheader.tsx.html +1 -1
- package/coverage/lcov-report/src/list/getListItemHeight.ts.html +44 -47
- package/coverage/lcov-report/src/list/index.html +5 -5
- package/coverage/lcov-report/src/list/listItemStyles.ts.html +65 -65
- package/coverage/lcov-report/src/media-queries/AppSizeProvider.tsx.html +49 -49
- package/coverage/lcov-report/src/media-queries/appSize.ts.html +1 -1
- package/coverage/lcov-report/src/media-queries/index.html +1 -1
- package/coverage/lcov-report/src/media-queries/useMediaQuery.ts.html +24 -24
- package/coverage/lcov-report/src/menu/DropdownMenu.tsx.html +1 -1
- package/coverage/lcov-report/src/menu/Menu.tsx.html +3 -3
- package/coverage/lcov-report/src/menu/MenuBar.tsx.html +1 -1
- package/coverage/lcov-report/src/menu/MenuButton.tsx.html +1 -1
- package/coverage/lcov-report/src/menu/MenuConfigurationProvider.tsx.html +1 -1
- package/coverage/lcov-report/src/menu/MenuItem.tsx.html +1 -1
- package/coverage/lcov-report/src/menu/MenuItemButton.tsx.html +1 -1
- package/coverage/lcov-report/src/menu/MenuItemGroup.tsx.html +1 -1
- package/coverage/lcov-report/src/menu/MenuItemSeparator.tsx.html +1 -1
- package/coverage/lcov-report/src/menu/MenuSheet.tsx.html +1 -1
- package/coverage/lcov-report/src/menu/MenuVisibilityProvider.tsx.html +1 -1
- package/coverage/lcov-report/src/menu/MenuWidget.tsx.html +1 -1
- package/coverage/lcov-report/src/menu/MenuWidgetKeyboardProvider.tsx.html +1 -1
- package/coverage/lcov-report/src/menu/index.html +1 -1
- package/coverage/lcov-report/src/menu/useContextMenu.ts.html +1 -1
- package/coverage/lcov-report/src/menu/useMenuBarProvider.ts.html +1 -1
- package/coverage/lcov-report/src/menu/utils.ts.html +1 -1
- package/coverage/lcov-report/src/movement/constants.ts.html +1 -1
- package/coverage/lcov-report/src/movement/findMatchIndex.ts.html +1 -1
- package/coverage/lcov-report/src/movement/index.html +17 -62
- package/coverage/lcov-report/src/movement/useKeyboardMovementProvider.ts.html +1 -1
- package/coverage/lcov-report/src/movement/utils.ts.html +143 -119
- package/coverage/lcov-report/src/overlay/Overlay.tsx.html +1 -1
- package/coverage/lcov-report/src/overlay/index.html +1 -1
- package/coverage/lcov-report/src/overlay/overlayStyles.ts.html +1 -1
- package/coverage/lcov-report/src/portal/Portal.tsx.html +1 -1
- package/coverage/lcov-report/src/portal/PortalContainerProvider.tsx.html +36 -36
- package/coverage/lcov-report/src/portal/index.html +1 -1
- package/coverage/lcov-report/src/positioning/constants.ts.html +1 -1
- package/coverage/lcov-report/src/positioning/createHorizontalPosition.ts.html +1 -1
- package/coverage/lcov-report/src/positioning/createVerticalPosition.ts.html +1 -1
- package/coverage/lcov-report/src/positioning/getFixedPosition.ts.html +1 -1
- package/coverage/lcov-report/src/positioning/index.html +1 -1
- package/coverage/lcov-report/src/positioning/useFixedPositioning.ts.html +1 -1
- package/coverage/lcov-report/src/positioning/utils.ts.html +1 -1
- package/coverage/lcov-report/src/progress/CircularProgress.tsx.html +81 -81
- package/coverage/lcov-report/src/progress/LinearProgress.tsx.html +1 -1
- package/coverage/lcov-report/src/progress/getProgressA11y.ts.html +1 -1
- package/coverage/lcov-report/src/progress/index.html +1 -1
- package/coverage/lcov-report/src/responsive-item/ResponsiveItemContainer.tsx.html +1 -1
- package/coverage/lcov-report/src/responsive-item/ResponsiveItemOverlay.tsx.html +1 -1
- package/coverage/lcov-report/src/responsive-item/index.html +1 -1
- package/coverage/lcov-report/src/responsive-item/styles.ts.html +1 -1
- package/coverage/lcov-report/src/scroll/ScrollLock.tsx.html +1 -1
- package/coverage/lcov-report/src/scroll/getScrollbarWidth.ts.html +1 -1
- package/coverage/lcov-report/src/scroll/index.html +1 -1
- package/coverage/lcov-report/src/scroll/useScrollLock.ts.html +1 -1
- package/coverage/lcov-report/src/segmented-button/SegmentedButton.tsx.html +1 -1
- package/coverage/lcov-report/src/segmented-button/SegmentedButtonContainer.tsx.html +1 -1
- package/coverage/lcov-report/src/segmented-button/index.html +1 -1
- package/coverage/lcov-report/src/segmented-button/segmentedButtonContainerStyles.ts.html +1 -1
- package/coverage/lcov-report/src/segmented-button/segmentedButtonStyles.ts.html +1 -1
- package/coverage/lcov-report/src/sheet/Sheet.tsx.html +1 -1
- package/coverage/lcov-report/src/sheet/index.html +1 -1
- package/coverage/lcov-report/src/sheet/styles.ts.html +1 -1
- package/coverage/lcov-report/src/snackbar/DefaultToastRenderer.tsx.html +1 -1
- package/coverage/lcov-report/src/snackbar/Snackbar.tsx.html +1 -1
- package/coverage/lcov-report/src/snackbar/Toast.tsx.html +1 -1
- package/coverage/lcov-report/src/snackbar/ToastActionButton.tsx.html +1 -1
- package/coverage/lcov-report/src/snackbar/ToastCloseButton.tsx.html +1 -1
- package/coverage/lcov-report/src/snackbar/ToastContent.tsx.html +1 -1
- package/coverage/lcov-report/src/snackbar/ToastManager.tsx.html +1 -1
- package/coverage/lcov-report/src/snackbar/ToastManagerProvider.tsx.html +1 -1
- package/coverage/lcov-report/src/snackbar/index.html +1 -1
- package/coverage/lcov-report/src/snackbar/snackbarStyles.ts.html +1 -1
- package/coverage/lcov-report/src/snackbar/toastContentStyles.ts.html +1 -1
- package/coverage/lcov-report/src/snackbar/toastStyles.ts.html +1 -1
- package/coverage/lcov-report/src/snackbar/useCurrentToastActions.ts.html +1 -1
- package/coverage/lcov-report/src/suspense/CircularProgressSuspense.tsx.html +142 -142
- package/coverage/lcov-report/src/suspense/NullSuspense.tsx.html +88 -88
- package/coverage/lcov-report/src/suspense/index.html +32 -32
- package/coverage/lcov-report/src/table/Table.tsx.html +1 -1
- package/coverage/lcov-report/src/table/TableBody.tsx.html +1 -1
- package/coverage/lcov-report/src/table/TableCell.tsx.html +1 -1
- package/coverage/lcov-report/src/table/TableCellContent.tsx.html +1 -1
- package/coverage/lcov-report/src/table/TableCheckbox.tsx.html +1 -1
- package/coverage/lcov-report/src/table/TableConfigurationProvider.tsx.html +1 -1
- package/coverage/lcov-report/src/table/TableContainer.tsx.html +1 -1
- package/coverage/lcov-report/src/table/TableContainerProvider.tsx.html +1 -1
- package/coverage/lcov-report/src/table/TableFooter.tsx.html +1 -1
- package/coverage/lcov-report/src/table/TableHeader.tsx.html +1 -1
- package/coverage/lcov-report/src/table/TableRadio.tsx.html +1 -1
- package/coverage/lcov-report/src/table/TableRow.tsx.html +1 -1
- package/coverage/lcov-report/src/table/index.html +1 -1
- package/coverage/lcov-report/src/table/tableCellStyles.ts.html +1 -1
- package/coverage/lcov-report/src/table/tableContainerStyles.ts.html +1 -1
- package/coverage/lcov-report/src/table/tableFooterStyles.ts.html +1 -1
- package/coverage/lcov-report/src/table/tableHeaderStyles.ts.html +1 -1
- package/coverage/lcov-report/src/table/tableRowStyles.ts.html +1 -1
- package/coverage/lcov-report/src/table/tableStyles.ts.html +1 -1
- package/coverage/lcov-report/src/tabs/Tab.tsx.html +1 -1
- package/coverage/lcov-report/src/tabs/TabList.tsx.html +1 -1
- package/coverage/lcov-report/src/tabs/TabListScrollButton.tsx.html +1 -1
- package/coverage/lcov-report/src/tabs/index.html +1 -1
- package/coverage/lcov-report/src/tabs/tabIndicatorStyles.ts.html +1 -1
- package/coverage/lcov-report/src/tabs/tabListScrollButtonStyles.ts.html +1 -1
- package/coverage/lcov-report/src/tabs/tabListStyles.ts.html +1 -1
- package/coverage/lcov-report/src/tabs/tabStyles.ts.html +1 -1
- package/coverage/lcov-report/src/tabs/useTabList.ts.html +1 -1
- package/coverage/lcov-report/src/tabs/useTabs.ts.html +1 -1
- package/coverage/lcov-report/src/tabs/utils.ts.html +1 -1
- package/coverage/lcov-report/src/test-utils/IntersectionObserver.ts.html +1 -1
- package/coverage/lcov-report/src/test-utils/ResizeObserver.ts.html +1 -1
- package/coverage/lcov-report/src/test-utils/data-testid.ts.html +18 -6
- package/coverage/lcov-report/src/test-utils/drag.ts.html +1 -1
- package/coverage/lcov-report/src/test-utils/index.html +7 -7
- package/coverage/lcov-report/src/test-utils/jest-setup.ts.html +9 -9
- package/coverage/lcov-report/src/test-utils/matchMedia.ts.html +4 -4
- package/coverage/lcov-report/src/test-utils/polyfills/IntersectionObserver.ts.html +4 -4
- package/coverage/lcov-report/src/test-utils/polyfills/ResizeObserver.ts.html +3 -3
- package/coverage/lcov-report/src/test-utils/polyfills/TextDecoder.ts.html +106 -0
- package/coverage/lcov-report/src/test-utils/polyfills/TextEncoder.ts.html +100 -0
- package/coverage/lcov-report/src/test-utils/polyfills/index.html +1 -1
- package/coverage/lcov-report/src/test-utils/polyfills/matchMedia.ts.html +6 -6
- package/coverage/lcov-report/src/test-utils/polyfills/offsetParent.ts.html +14 -14
- package/coverage/lcov-report/src/test-utils/polyfills/scrollIntoView.ts.html +5 -5
- package/coverage/lcov-report/src/test-utils/render.tsx.html +21 -21
- package/coverage/lcov-report/src/test-utils/root-html-environment.ts.html +85 -0
- package/coverage/lcov-report/src/test-utils/timers.ts.html +1 -1
- package/coverage/lcov-report/src/theme/LocalStorageColorSchemeProvider.tsx.html +1 -1
- package/coverage/lcov-report/src/theme/ThemeProvider.tsx.html +1 -1
- package/coverage/lcov-report/src/theme/colors.ts.html +1 -1
- package/coverage/lcov-report/src/theme/cssVars.ts.html +1 -1
- package/coverage/lcov-report/src/theme/index.html +1 -1
- package/coverage/lcov-report/src/theme/useCSSVariables.ts.html +1 -1
- package/coverage/lcov-report/src/theme/useColorScheme.ts.html +1 -1
- package/coverage/lcov-report/src/theme/useColorSchemeMetaTag.ts.html +1 -1
- package/coverage/lcov-report/src/theme/useColorSchemeProvider.ts.html +1 -1
- package/coverage/lcov-report/src/theme/usePrefersColorScheme.ts.html +1 -1
- package/coverage/lcov-report/src/theme/utils.ts.html +1 -1
- package/coverage/lcov-report/src/tooltip/Tooltip.tsx.html +1 -1
- package/coverage/lcov-report/src/tooltip/TooltipHoverModeProvider.tsx.html +1 -1
- package/coverage/lcov-report/src/tooltip/constants.ts.html +1 -1
- package/coverage/lcov-report/src/tooltip/index.html +1 -1
- package/coverage/lcov-report/src/tooltip/tooltipStyles.ts.html +1 -1
- package/coverage/lcov-report/src/tooltip/useTooltip.ts.html +1 -1
- package/coverage/lcov-report/src/tooltip/useTooltipPosition.ts.html +1 -1
- package/coverage/lcov-report/src/tooltip/utils.ts.html +1 -1
- package/coverage/lcov-report/src/transition/CSSTransition.tsx.html +1 -1
- package/coverage/lcov-report/src/transition/Collapse.tsx.html +1 -1
- package/coverage/lcov-report/src/transition/CrossFade.tsx.html +1 -1
- package/coverage/lcov-report/src/transition/ScaleTransition.tsx.html +1 -1
- package/coverage/lcov-report/src/transition/SkeletonPlaceholder.tsx.html +1 -1
- package/coverage/lcov-report/src/transition/Slide.tsx.html +1 -1
- package/coverage/lcov-report/src/transition/SlideContainer.tsx.html +1 -1
- package/coverage/lcov-report/src/transition/collapseStyles.ts.html +13 -13
- package/coverage/lcov-report/src/transition/config.ts.html +3 -3
- package/coverage/lcov-report/src/transition/index.html +7 -7
- package/coverage/lcov-report/src/transition/maxWidthTransition.ts.html +1 -1
- package/coverage/lcov-report/src/transition/skeletonPlaceholderUtils.ts.html +1 -1
- package/coverage/lcov-report/src/transition/useCSSTransition.ts.html +1 -1
- package/coverage/lcov-report/src/transition/useCarousel.ts.html +1 -1
- package/coverage/lcov-report/src/transition/useCollapseTransition.ts.html +96 -150
- package/coverage/lcov-report/src/transition/useCrossFadeTransition.ts.html +1 -1
- package/coverage/lcov-report/src/transition/useMaxWidthTransition.ts.html +1 -1
- package/coverage/lcov-report/src/transition/useScaleTransition.ts.html +1 -1
- package/coverage/lcov-report/src/transition/useSkeletonPlaceholder.ts.html +1 -1
- package/coverage/lcov-report/src/transition/useSlideTransition.ts.html +1 -1
- package/coverage/lcov-report/src/transition/useTransition.ts.html +152 -152
- package/coverage/lcov-report/src/transition/utils.ts.html +14 -14
- package/coverage/lcov-report/src/tree/DefaultTreeItemRenderer.tsx.html +1 -1
- package/coverage/lcov-report/src/tree/Tree.tsx.html +1 -1
- package/coverage/lcov-report/src/tree/TreeGroup.tsx.html +45 -45
- package/coverage/lcov-report/src/tree/TreeItem.tsx.html +1 -1
- package/coverage/lcov-report/src/tree/TreeItemExpander.tsx.html +1 -1
- package/coverage/lcov-report/src/tree/TreeProvider.tsx.html +8 -8
- package/coverage/lcov-report/src/tree/index.html +1 -1
- package/coverage/lcov-report/src/tree/styles.ts.html +5 -5
- package/coverage/lcov-report/src/tree/useTree.ts.html +1 -1
- package/coverage/lcov-report/src/tree/useTreeExpansion.ts.html +1 -1
- package/coverage/lcov-report/src/tree/useTreeItems.ts.html +1 -1
- package/coverage/lcov-report/src/tree/useTreeMovement.ts.html +1 -1
- package/coverage/lcov-report/src/tree/useTreeSelection.ts.html +1 -1
- package/coverage/lcov-report/src/tree/utils.ts.html +1 -1
- package/coverage/lcov-report/src/typography/SrOnly.tsx.html +12 -12
- package/coverage/lcov-report/src/typography/TextContainer.tsx.html +1 -1
- package/coverage/lcov-report/src/typography/Typography.tsx.html +94 -94
- package/coverage/lcov-report/src/typography/WritingDirectionProvider.tsx.html +1 -1
- package/coverage/lcov-report/src/typography/index.html +1 -1
- package/coverage/lcov-report/src/useAsyncAction.ts.html +1 -1
- package/coverage/lcov-report/src/useDebouncedFunction.ts.html +1 -1
- package/coverage/lcov-report/src/useDropzone.ts.html +1 -1
- package/coverage/lcov-report/src/useElementSize.ts.html +1 -1
- package/coverage/lcov-report/src/useEnsuredId.ts.html +8 -8
- package/coverage/lcov-report/src/useEnsuredRef.ts.html +11 -11
- package/coverage/lcov-report/src/useEnsuredState.ts.html +16 -16
- package/coverage/lcov-report/src/useHtmlClassName.ts.html +1 -1
- package/coverage/lcov-report/src/useIntersectionObserver.ts.html +1 -1
- package/coverage/lcov-report/src/useIsomorphicLayoutEffect.ts.html +1 -1
- package/coverage/lcov-report/src/useLocalStorage.ts.html +1 -1
- package/coverage/lcov-report/src/useOrientation.ts.html +32 -32
- package/coverage/lcov-report/src/usePageInactive.ts.html +1 -1
- package/coverage/lcov-report/src/useResizeListener.ts.html +1 -1
- package/coverage/lcov-report/src/useResizeObserver.ts.html +23 -23
- package/coverage/lcov-report/src/useThrottledFunction.ts.html +1 -1
- package/coverage/lcov-report/src/useToggle.ts.html +1 -1
- package/coverage/lcov-report/src/useUnmounted.ts.html +1 -1
- package/coverage/lcov-report/src/useWindowSize.ts.html +1 -1
- package/coverage/lcov-report/src/utils/RenderRecursively.tsx.html +1 -1
- package/coverage/lcov-report/src/utils/alphaNumericSort.ts.html +1 -1
- package/coverage/lcov-report/src/utils/applyRef.ts.html +1 -1
- package/coverage/lcov-report/src/utils/bem.ts.html +50 -50
- package/coverage/lcov-report/src/utils/filters.ts.html +357 -84
- package/coverage/lcov-report/src/utils/getClientPosition.ts.html +1 -1
- package/coverage/lcov-report/src/utils/getMiddleOfRange.ts.html +1 -1
- package/coverage/lcov-report/src/utils/getPercentage.ts.html +1 -1
- package/coverage/lcov-report/src/utils/getRangeDefaultValue.ts.html +1 -1
- package/coverage/lcov-report/src/utils/getRangeSteps.ts.html +1 -1
- package/coverage/lcov-report/src/utils/identity.ts.html +1 -1
- package/coverage/lcov-report/src/utils/index.html +13 -268
- package/coverage/lcov-report/src/utils/isElementVisible.ts.html +1 -1
- package/coverage/lcov-report/src/utils/loop.ts.html +1 -1
- package/coverage/lcov-report/src/utils/nearest.ts.html +1 -1
- package/coverage/lcov-report/src/utils/parseCssLengthUnit.ts.html +1 -1
- package/coverage/lcov-report/src/utils/randomInt.ts.html +1 -1
- package/coverage/lcov-report/src/utils/wait.ts.html +1 -1
- package/coverage/lcov-report/src/utils/withinRange.ts.html +1 -1
- package/coverage/lcov-report/src/window-splitter/WindowSplitter.tsx.html +1 -1
- package/coverage/lcov-report/src/window-splitter/index.html +1 -1
- package/coverage/lcov-report/src/window-splitter/useWindowSplitter.ts.html +1 -1
- package/coverage/lcov-report/transition/config.ts.html +5 -5
- package/coverage/lcov-report/transition/index.html +1 -1
- package/coverage/lcov-report/transition/useScaleTransition.ts.html +535 -0
- package/coverage/lcov-report/useAutoComplete.ts.html +787 -0
- package/coverage/lcov-report/useCollapseTransition.ts.html +166 -211
- package/coverage/lcov-report/useCombobox.ts.html +1513 -0
- package/coverage/lcov-report/useInlineAutoComplete.ts.html +379 -0
- package/coverage/lcov-report/useSelectCombobox.ts.html +295 -0
- package/coverage/lcov-report/utils/alphaNumericSort.ts.html +11 -50
- package/coverage/lcov-report/utils/filters.ts.html +1056 -201
- package/coverage/lcov-report/utils/index.html +10 -10
- package/coverage/lcov-report/utils/searching.ts.html +85 -0
- package/coverage/lcov-report/utils.ts.html +109 -277
- package/coverage/lcov.info +928 -259
- package/dist/RootHtml.d.ts +62 -0
- package/dist/RootHtml.js +49 -0
- package/dist/RootHtml.js.map +1 -0
- package/dist/avatar/Avatar.d.ts +14 -0
- package/dist/avatar/Avatar.js +5 -2
- package/dist/avatar/Avatar.js.map +1 -1
- package/dist/dialog/FixedDialog.d.ts +5 -4
- package/dist/dialog/FixedDialog.js +5 -4
- package/dist/dialog/FixedDialog.js.map +1 -1
- package/dist/form/NativeSelect.d.ts +5 -2
- package/dist/form/NativeSelect.js.map +1 -1
- package/dist/form/Option.js +3 -2
- package/dist/form/Option.js.map +1 -1
- package/dist/form/Select.d.ts +105 -15
- package/dist/form/Select.js +160 -249
- package/dist/form/Select.js.map +1 -1
- package/dist/form/SelectedOption.d.ts +21 -0
- package/dist/form/SelectedOption.js +37 -0
- package/dist/form/SelectedOption.js.map +1 -0
- package/dist/form/TextField.d.ts +2 -2
- package/dist/form/TextField.js.map +1 -1
- package/dist/form/_form.scss +8 -13
- package/dist/form/selectUtils.d.ts +1 -3
- package/dist/form/selectUtils.js +2 -10
- package/dist/form/selectUtils.js.map +1 -1
- package/dist/form/types.d.ts +6 -6
- package/dist/form/types.js.map +1 -1
- package/dist/form/useCombobox.d.ts +157 -0
- package/dist/form/useCombobox.js +206 -0
- package/dist/form/useCombobox.js.map +1 -0
- package/dist/form/useEditableCombobox.d.ts +15 -0
- package/dist/form/useEditableCombobox.js +101 -0
- package/dist/form/useEditableCombobox.js.map +1 -0
- package/dist/form/useFormReset.d.ts +16 -0
- package/dist/form/useFormReset.js +32 -0
- package/dist/form/useFormReset.js.map +1 -0
- package/dist/form/useListboxProvider.d.ts +1 -0
- package/dist/form/useListboxProvider.js +1 -0
- package/dist/form/useListboxProvider.js.map +1 -1
- package/dist/form/useSelectCombobox.d.ts +17 -0
- package/dist/form/useSelectCombobox.js +36 -0
- package/dist/form/useSelectCombobox.js.map +1 -0
- package/dist/form/utils.d.ts +11 -1
- package/dist/form/utils.js +6 -0
- package/dist/form/utils.js.map +1 -1
- package/dist/index.d.ts +14 -1
- package/dist/index.js +14 -1
- package/dist/index.js.map +1 -1
- package/dist/menu/Menu.js +12 -1
- package/dist/menu/Menu.js.map +1 -1
- package/dist/menu/useContextMenu.d.ts +3 -3
- package/dist/menu/useContextMenu.js +3 -3
- package/dist/menu/useContextMenu.js.map +1 -1
- package/dist/movement/types.d.ts +40 -21
- package/dist/movement/types.js.map +1 -1
- package/dist/movement/useKeyboardMovementProvider.js +15 -4
- package/dist/movement/useKeyboardMovementProvider.js.map +1 -1
- package/dist/movement/utils.d.ts +7 -2
- package/dist/movement/utils.js +10 -0
- package/dist/movement/utils.js.map +1 -1
- package/dist/positioning/useFixedPositioning.js +0 -8
- package/dist/positioning/useFixedPositioning.js.map +1 -1
- package/dist/searching/caseInsensitive.d.ts +150 -0
- package/dist/searching/caseInsensitive.js +30 -0
- package/dist/searching/caseInsensitive.js.map +1 -0
- package/dist/searching/fuzzy.d.ts +128 -0
- package/dist/searching/fuzzy.js +54 -0
- package/dist/searching/fuzzy.js.map +1 -0
- package/dist/searching/toSearchQuery.d.ts +5 -0
- package/dist/searching/toSearchQuery.js +13 -0
- package/dist/searching/toSearchQuery.js.map +1 -0
- package/dist/searching/types.d.ts +28 -0
- package/dist/searching/types.js +5 -0
- package/dist/searching/types.js.map +1 -0
- package/dist/searching/utils.d.ts +21 -0
- package/dist/searching/utils.js +28 -0
- package/dist/searching/utils.js.map +1 -0
- package/dist/test-utils/IntersectionObserver.d.ts +12 -0
- package/dist/test-utils/ResizeObserver.d.ts +172 -0
- package/dist/test-utils/data-testid.d.ts +7 -0
- package/dist/test-utils/data-testid.js +1 -0
- package/dist/test-utils/data-testid.js.map +1 -1
- package/dist/test-utils/drag.d.ts +26 -0
- package/dist/test-utils/index.d.ts +7 -0
- package/dist/test-utils/jest-setup.d.ts +1 -0
- package/dist/test-utils/matchMedia.d.ts +101 -0
- package/dist/test-utils/polyfills/IntersectionObserver.d.ts +1 -0
- package/dist/test-utils/polyfills/ResizeObserver.d.ts +1 -0
- package/dist/test-utils/polyfills/TextDecoder.d.ts +1 -0
- package/dist/test-utils/polyfills/TextDecoder.js +8 -0
- package/dist/test-utils/polyfills/TextDecoder.js.map +1 -0
- package/dist/test-utils/polyfills/TextEncoder.d.ts +1 -0
- package/dist/test-utils/polyfills/TextEncoder.js +6 -0
- package/dist/test-utils/polyfills/TextEncoder.js.map +1 -0
- package/dist/test-utils/polyfills/index.d.ts +7 -0
- package/dist/test-utils/polyfills/index.js +2 -0
- package/dist/test-utils/polyfills/index.js.map +1 -1
- package/dist/test-utils/polyfills/matchMedia.d.ts +1 -0
- package/dist/test-utils/polyfills/offsetParent.d.ts +1 -0
- package/dist/test-utils/polyfills/scrollIntoView.d.ts +1 -0
- package/dist/test-utils/render.d.ts +13 -0
- package/dist/test-utils/timers.d.ts +39 -0
- package/dist/transition/useCollapseTransition.d.ts +3 -18
- package/dist/transition/useCollapseTransition.js +1 -10
- package/dist/transition/useCollapseTransition.js.map +1 -1
- package/dist/transition/utils.js +7 -2
- package/dist/transition/utils.js.map +1 -1
- package/dist/useEnsuredState.d.ts +1 -1
- package/dist/useEnsuredState.js.map +1 -1
- package/dist/utils/alphaNumericSort.d.ts +1 -1
- package/dist/utils/alphaNumericSort.js +2 -10
- package/dist/utils/alphaNumericSort.js.map +1 -1
- package/jest.config.ts +4 -0
- package/package.json +14 -13
- package/src/RootHtml.tsx +95 -0
- package/src/__tests__/RootHtml.node.tsx +46 -0
- package/src/__tests__/__snapshots__/RootHtml.node.tsx.snap +19 -0
- package/src/avatar/Avatar.tsx +24 -3
- package/src/avatar/__tests__/Avatar.tsx +1 -1
- package/src/avatar/__tests__/__snapshots__/Avatar.tsx.snap +6 -6
- package/src/dialog/FixedDialog.tsx +5 -4
- package/src/form/NativeSelect.tsx +6 -3
- package/src/form/Option.tsx +8 -2
- package/src/form/Select.tsx +251 -335
- package/src/form/SelectedOption.tsx +55 -0
- package/src/form/TextField.tsx +2 -2
- package/src/form/__tests__/Select.tsx +439 -0
- package/src/form/__tests__/__snapshots__/Select.tsx.snap +492 -0
- package/src/form/__tests__/useFormReset.tsx +195 -0
- package/src/form/_form.scss +8 -13
- package/src/form/selectUtils.ts +3 -14
- package/src/form/types.ts +6 -6
- package/src/form/useCombobox.ts +523 -0
- package/src/form/useEditableCombobox.ts +139 -0
- package/src/form/useFormReset.ts +48 -0
- package/src/form/useListboxProvider.ts +2 -0
- package/src/form/useSelectCombobox.ts +70 -0
- package/src/form/utils.ts +17 -4
- package/src/index.ts +14 -1
- package/src/menu/Menu.tsx +9 -1
- package/src/menu/__tests__/__snapshots__/useContextMenu.tsx.snap +54 -0
- package/src/menu/__tests__/useContextMenu.tsx +41 -0
- package/src/menu/useContextMenu.ts +3 -3
- package/src/movement/types.ts +50 -25
- package/src/movement/useKeyboardMovementProvider.ts +21 -8
- package/src/movement/utils.ts +12 -2
- package/src/positioning/__tests__/__snapshots__/useFixedPositioning.tsx.snap +0 -32
- package/src/positioning/__tests__/useFixedPositioning.tsx +0 -14
- package/src/positioning/useFixedPositioning.ts +0 -6
- package/src/searching/__tests__/caseInsensitive.ts +165 -0
- package/src/searching/__tests__/fuzzy.ts +169 -0
- package/src/searching/__tests__/toSearchQuery.ts +21 -0
- package/src/searching/caseInsensitive.ts +200 -0
- package/src/searching/fuzzy.ts +175 -0
- package/src/searching/toSearchQuery.ts +18 -0
- package/src/searching/types.ts +34 -0
- package/src/searching/utils.ts +54 -0
- package/src/test-utils/data-testid.ts +5 -1
- package/src/test-utils/polyfills/TextDecoder.ts +7 -0
- package/src/test-utils/polyfills/TextEncoder.ts +5 -0
- package/src/test-utils/polyfills/index.ts +2 -0
- package/src/transition/__tests__/utils.ts +25 -0
- package/src/transition/useCollapseTransition.ts +6 -24
- package/src/transition/utils.ts +10 -5
- package/src/useEnsuredState.ts +1 -1
- package/src/utils/alphaNumericSort.ts +3 -16
- package/tsconfig.json +2 -2
- package/tsconfig.types.json +1 -1
- package/dist/form/SelectValue.d.ts +0 -17
- package/dist/form/SelectValue.js +0 -32
- package/dist/form/SelectValue.js.map +0 -1
- package/dist/utils/filters.d.ts +0 -196
- package/dist/utils/filters.js +0 -67
- package/dist/utils/filters.js.map +0 -1
- package/src/form/SelectValue.tsx +0 -39
- package/src/utils/filters.ts +0 -320
package/src/form/Select.tsx
CHANGED
|
@@ -1,58 +1,48 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cnb } from "cnbuilder";
|
|
3
3
|
import {
|
|
4
|
-
useEffect,
|
|
5
4
|
useMemo,
|
|
6
5
|
useRef,
|
|
7
6
|
useState,
|
|
8
7
|
type ChangeEvent,
|
|
8
|
+
type HTMLAttributes,
|
|
9
|
+
type InputHTMLAttributes,
|
|
9
10
|
type ReactElement,
|
|
10
11
|
type ReactNode,
|
|
11
12
|
type Ref,
|
|
12
13
|
} from "react";
|
|
14
|
+
import { type BoxProps } from "../box/Box.js";
|
|
13
15
|
import { IconRotator } from "../icon/IconRotator.js";
|
|
14
16
|
import { getIcon } from "../icon/iconConfig.js";
|
|
15
17
|
import { Menu, type MenuProps } from "../menu/Menu.js";
|
|
16
|
-
import {
|
|
18
|
+
import { KeyboardMovementProvider } from "../movement/useKeyboardMovementProvider.js";
|
|
17
19
|
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
import { BELOW_CENTER_ANCHOR } from "../positioning/constants.js";
|
|
23
|
-
import {
|
|
24
|
-
type TransitionEnterHandler,
|
|
25
|
-
type TransitionExitHandler,
|
|
26
|
-
} from "../transition/types.js";
|
|
20
|
+
type LabelA11y,
|
|
21
|
+
type PropsWithRef,
|
|
22
|
+
type RequireAtLeastOne,
|
|
23
|
+
} from "../types.js";
|
|
27
24
|
import { useEnsuredId } from "../useEnsuredId.js";
|
|
28
25
|
import { useEnsuredRef } from "../useEnsuredRef.js";
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
|
|
26
|
+
import { label as labelStyles } from "./Label.js";
|
|
27
|
+
import { SelectedOption } from "./SelectedOption.js";
|
|
28
|
+
import {
|
|
29
|
+
TextFieldContainer,
|
|
30
|
+
type TextFieldContainerProps,
|
|
31
|
+
} from "./TextFieldContainer.js";
|
|
33
32
|
import { getFormConfig } from "./formConfig.js";
|
|
34
33
|
import { select } from "./selectStyles.js";
|
|
35
34
|
import { extractOptionsFromChildren } from "./selectUtils.js";
|
|
36
|
-
import {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
} from "./
|
|
40
|
-
import {
|
|
41
|
-
import { triggerManualChangeEvent, tryToSubmitRelatedForm } from "./utils.js";
|
|
35
|
+
import { textField } from "./textFieldStyles.js";
|
|
36
|
+
import { type UserAgentAutocompleteProps } from "./types.js";
|
|
37
|
+
import { useFormReset } from "./useFormReset.js";
|
|
38
|
+
import { ListboxProvider, type ListboxContext } from "./useListboxProvider.js";
|
|
39
|
+
import { useSelectCombobox } from "./useSelectCombobox.js";
|
|
42
40
|
|
|
43
41
|
const EMPTY_STRING = "" as const;
|
|
44
42
|
const noop = (): void => {
|
|
45
43
|
// do nothing
|
|
46
44
|
};
|
|
47
45
|
|
|
48
|
-
const getNonDisabledOptions = (
|
|
49
|
-
container: HTMLElement
|
|
50
|
-
): readonly HTMLElement[] => [
|
|
51
|
-
...container.querySelectorAll<HTMLLIElement>(
|
|
52
|
-
'[role="option"]:not([aria-disabled])'
|
|
53
|
-
),
|
|
54
|
-
];
|
|
55
|
-
|
|
56
46
|
/**
|
|
57
47
|
* This is a convenience type for casting the `event.currentTarget.value` of a
|
|
58
48
|
* `Select`'s change event to be union of available values.
|
|
@@ -103,16 +93,19 @@ export type SelectChangeEvent<Value extends string> =
|
|
|
103
93
|
* @remarks \@since 6.0.0 Rewritten with a new API.
|
|
104
94
|
*/
|
|
105
95
|
export interface SelectProps<Value extends string>
|
|
106
|
-
extends Omit<
|
|
107
|
-
|
|
108
|
-
|
|
96
|
+
extends Omit<TextFieldContainerProps, "label">,
|
|
97
|
+
Pick<InputHTMLAttributes<HTMLInputElement>, "form" | "required">,
|
|
98
|
+
UserAgentAutocompleteProps {
|
|
109
99
|
/**
|
|
110
|
-
*
|
|
111
|
-
* stores the current value. This is really only useful if you'd like to keep
|
|
112
|
-
* this component uncontrolled and access the value through
|
|
113
|
-
* `inputRef.current.value`.
|
|
100
|
+
* @defaultValue `"select-" + useId()`
|
|
114
101
|
*/
|
|
115
|
-
|
|
102
|
+
id?: string;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Optional placeholder text or element to render while no options have been
|
|
106
|
+
* selected.
|
|
107
|
+
*/
|
|
108
|
+
placeholder?: ReactNode;
|
|
116
109
|
|
|
117
110
|
/**
|
|
118
111
|
* Set this to a custom dropdown icon or `null` to not render a dropdown icon.
|
|
@@ -138,6 +131,30 @@ export interface SelectProps<Value extends string>
|
|
|
138
131
|
/** @see {@link SelectChangeEvent} */
|
|
139
132
|
onChange?(event: SelectChangeEvent<Value>): void;
|
|
140
133
|
|
|
134
|
+
/**
|
|
135
|
+
* An optional floating label to display like other form fields.
|
|
136
|
+
*/
|
|
137
|
+
label?: ReactNode;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Optional props to pass to the `<span>` that surrounds the {@link label}
|
|
141
|
+
*/
|
|
142
|
+
labelProps?: PropsWithRef<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* An optional ref to pass to the hidden `<input type="text" />` element that
|
|
146
|
+
* stores the current value. This is really only useful if you'd like to keep
|
|
147
|
+
* this component uncontrolled and access the value through
|
|
148
|
+
* `inputRef.current.value`.
|
|
149
|
+
*/
|
|
150
|
+
inputRef?: Ref<HTMLInputElement>;
|
|
151
|
+
inputProps?: InputHTMLAttributes<HTMLInputElement>;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* A ref for the container `<div>` element.
|
|
155
|
+
*/
|
|
156
|
+
containerRef?: Ref<HTMLDivElement>;
|
|
157
|
+
|
|
141
158
|
/**
|
|
142
159
|
* Any additional props to provide to the `Menu` component that renders all
|
|
143
160
|
* the `Option`s.
|
|
@@ -145,19 +162,28 @@ export interface SelectProps<Value extends string>
|
|
|
145
162
|
* The menu will always have these default values unless explicity
|
|
146
163
|
* overwritten by this prop:
|
|
147
164
|
*
|
|
148
|
-
* - `aria-labelledby={
|
|
165
|
+
* - `aria-labelledby={label ? labelId : id}` -- this will be undefined if
|
|
166
|
+
* `aria-label` is provided
|
|
149
167
|
* - `anchor={BELOW_CENTER_ANCHOR}`
|
|
150
168
|
* - `width="min"`
|
|
151
169
|
*/
|
|
152
170
|
menuProps?: Omit<MenuProps, "visible" | "onRequestClose" | "fixedTo">;
|
|
153
171
|
|
|
154
172
|
/**
|
|
155
|
-
*
|
|
156
|
-
*
|
|
173
|
+
* Any additional props to pass to the div that contains the current visible
|
|
174
|
+
* option.
|
|
175
|
+
*/
|
|
176
|
+
selectedOptionProps?: BoxProps;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Set this to `true` if all the `Option` components should display the
|
|
180
|
+
* selected icon after the children instead of before.
|
|
181
|
+
*
|
|
182
|
+
* @see {@link disableSelectedIcon} to remove the selected icon instead.
|
|
157
183
|
*
|
|
158
184
|
* @defaultValue `false`
|
|
159
185
|
*/
|
|
160
|
-
|
|
186
|
+
selectedIconAfter?: boolean;
|
|
161
187
|
|
|
162
188
|
/**
|
|
163
189
|
* Set this to `true` to prevent the current option from rendering the
|
|
@@ -165,7 +191,15 @@ export interface SelectProps<Value extends string>
|
|
|
165
191
|
*
|
|
166
192
|
* @defaultValue `false`
|
|
167
193
|
*/
|
|
168
|
-
|
|
194
|
+
disableOptionAddon?: boolean;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Set this to `true` to update all the `Option` components to no longer
|
|
198
|
+
* render an icon while selected.
|
|
199
|
+
*
|
|
200
|
+
* @defaultValue `false`
|
|
201
|
+
*/
|
|
202
|
+
disableSelectedIcon?: boolean;
|
|
169
203
|
|
|
170
204
|
/**
|
|
171
205
|
* This should be the available `Option`s for the select to choose from. It
|
|
@@ -178,345 +212,227 @@ export interface SelectProps<Value extends string>
|
|
|
178
212
|
/**
|
|
179
213
|
* **Client Component**
|
|
180
214
|
*
|
|
215
|
+
* @example
|
|
216
|
+
* Simple Example
|
|
217
|
+
* ```tsx
|
|
218
|
+
* import { Select, Option } from "react-md";
|
|
219
|
+
* import { useState, type ReactElement } from "react";
|
|
220
|
+
*
|
|
221
|
+
* function Example(): ReactElement {
|
|
222
|
+
* const [value, setValue] = useState("");
|
|
223
|
+
*
|
|
224
|
+
* return (
|
|
225
|
+
* <Select
|
|
226
|
+
* label="Select"
|
|
227
|
+
* value={value}
|
|
228
|
+
* onChange={(event) => setValue(event.currentTarget.value)}
|
|
229
|
+
* placeholder="Select a value"
|
|
230
|
+
* >
|
|
231
|
+
* <Option value="a">Option 1</Option>
|
|
232
|
+
* <Option value="b">Option 2</Option>
|
|
233
|
+
* <Option value="c">Option 3</Option>
|
|
234
|
+
* <Option value="d">Option 4</Option>
|
|
235
|
+
* </Select>
|
|
236
|
+
* );
|
|
237
|
+
* }
|
|
238
|
+
* ```
|
|
239
|
+
*
|
|
240
|
+
* @example
|
|
241
|
+
* Testing
|
|
242
|
+
* ```tsx
|
|
243
|
+
* rmdRender(
|
|
244
|
+
* <Select label="Select" selectedOptionProps={{ "data-testid": "selected" }}>
|
|
245
|
+
* <Option value="a">Option 1</Option>
|
|
246
|
+
* <Option value="b">Option 2</Option>
|
|
247
|
+
* <Option value="c">Option 3</Option>
|
|
248
|
+
* <Option value="d">Option 4</Option>
|
|
249
|
+
* </Select>
|
|
250
|
+
* );
|
|
251
|
+
*
|
|
252
|
+
* const user = userEvent.setup();
|
|
253
|
+
* const select = screen.getByRole("combobox", { name: "Select" });
|
|
254
|
+
* const selected = screen.getByTestId("selected")
|
|
255
|
+
* const selectInput = screen.getByRole("textbox", { hidden: true });
|
|
256
|
+
* expect(selected).toHaveTextContent("");
|
|
257
|
+
* expect(selectInput).toHaveValue("");
|
|
258
|
+
*
|
|
259
|
+
* await user.click(select);
|
|
260
|
+
* await user.click(screen.getByRole("option"), { name: "Option 2" });
|
|
261
|
+
*
|
|
262
|
+
* expect(selected).toHaveTextContent("Option 2");
|
|
263
|
+
* expect(selectInput).toHaveValue("b");
|
|
264
|
+
* ```
|
|
265
|
+
*
|
|
181
266
|
* @remarks \@since 6.0.0 Rewritten with a new API.
|
|
182
267
|
*/
|
|
183
268
|
export function Select<Value extends string>(
|
|
184
|
-
props: SelectProps<Value>
|
|
269
|
+
props: RequireAtLeastOne<SelectProps<Value>, "label" | keyof LabelA11y>
|
|
185
270
|
): ReactElement {
|
|
186
271
|
const {
|
|
187
|
-
id
|
|
272
|
+
id,
|
|
273
|
+
form,
|
|
274
|
+
autoCompleteValue,
|
|
275
|
+
autoComplete = autoCompleteValue,
|
|
276
|
+
name = autoCompleteValue,
|
|
188
277
|
className,
|
|
189
|
-
|
|
278
|
+
onClick,
|
|
279
|
+
onFocus,
|
|
280
|
+
onKeyDown,
|
|
190
281
|
inputRef: propInputRef,
|
|
191
|
-
|
|
282
|
+
inputProps,
|
|
283
|
+
containerRef,
|
|
284
|
+
placeholder,
|
|
192
285
|
menuProps = {},
|
|
193
|
-
|
|
286
|
+
label,
|
|
287
|
+
labelProps = {},
|
|
288
|
+
selectedOptionProps,
|
|
194
289
|
icon: propIcon,
|
|
195
290
|
value,
|
|
196
291
|
defaultValue,
|
|
197
292
|
theme: propTheme,
|
|
198
293
|
onChange = noop,
|
|
199
|
-
leftAddon,
|
|
200
294
|
rightAddon: propRightAddon,
|
|
201
|
-
|
|
295
|
+
active = false,
|
|
296
|
+
required,
|
|
297
|
+
selectedIconAfter = false,
|
|
298
|
+
disableOptionAddon = false,
|
|
202
299
|
disableSelectedIcon = false,
|
|
203
300
|
children,
|
|
204
301
|
...remaining
|
|
205
302
|
} = props;
|
|
206
|
-
const {
|
|
303
|
+
const { dense, error, disabled } = props;
|
|
207
304
|
|
|
208
|
-
const
|
|
209
|
-
const
|
|
210
|
-
const
|
|
211
|
-
const
|
|
305
|
+
const comboboxId = useEnsuredId(id, "select");
|
|
306
|
+
const inputId = useEnsuredId(inputProps?.id, "select-value");
|
|
307
|
+
const selectLabelId = useEnsuredId(labelProps.id, "select-label");
|
|
308
|
+
const labelId = label ? selectLabelId : undefined;
|
|
212
309
|
|
|
213
|
-
const
|
|
214
|
-
const [inputRef, inputRefCallback] = useEnsuredRef(propInputRef);
|
|
215
|
-
const [containerRef, containerRefCallback] = useEnsuredRef(
|
|
216
|
-
propContainerProps.ref
|
|
217
|
-
);
|
|
218
|
-
const [menuRef, menuRefCallback] = useEnsuredRef(menuProps.nodeRef);
|
|
219
|
-
const [currentValue, setCurrentValue] = useState(() => {
|
|
310
|
+
const [localValue, setLocalValue] = useState(() => {
|
|
220
311
|
if (typeof defaultValue !== "undefined") {
|
|
221
312
|
return defaultValue;
|
|
222
313
|
}
|
|
223
314
|
|
|
224
315
|
return typeof value !== "undefined" ? value : EMPTY_STRING;
|
|
225
316
|
});
|
|
317
|
+
const currentValue = typeof value === "undefined" ? localValue : value;
|
|
226
318
|
const initialValue = useRef(currentValue);
|
|
319
|
+
const { options, currentOption } = extractOptionsFromChildren(
|
|
320
|
+
children,
|
|
321
|
+
currentValue
|
|
322
|
+
);
|
|
227
323
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
const handleReset = (): void => {
|
|
244
|
-
triggerManualChangeEvent(select, initialValue.current);
|
|
245
|
-
};
|
|
246
|
-
|
|
247
|
-
formElement.addEventListener("reset", handleReset);
|
|
248
|
-
return () => {
|
|
249
|
-
formElement.removeEventListener("reset", handleReset);
|
|
250
|
-
};
|
|
251
|
-
}, [form, inputRef]);
|
|
252
|
-
|
|
253
|
-
const { options, searchValues, currentOption, currentIndex } =
|
|
254
|
-
extractOptionsFromChildren(
|
|
255
|
-
children,
|
|
256
|
-
typeof value === "undefined" ? currentValue : value
|
|
257
|
-
);
|
|
258
|
-
const totalOptions = options.length - 1;
|
|
259
|
-
|
|
260
|
-
let rightAddon = propRightAddon;
|
|
261
|
-
if (typeof rightAddon === "undefined" && icon) {
|
|
262
|
-
rightAddon = <IconRotator rotated={visible}>{icon}</IconRotator>;
|
|
263
|
-
}
|
|
324
|
+
const { visible, comboboxProps, movementContext, getMenuProps } =
|
|
325
|
+
useSelectCombobox({
|
|
326
|
+
form,
|
|
327
|
+
value: currentValue,
|
|
328
|
+
values: options,
|
|
329
|
+
onClick,
|
|
330
|
+
onFocus,
|
|
331
|
+
onKeyDown,
|
|
332
|
+
disabled,
|
|
333
|
+
popupId: menuProps.id,
|
|
334
|
+
popupRef: menuProps.nodeRef,
|
|
335
|
+
comboboxId,
|
|
336
|
+
comboboxRef: containerRef,
|
|
337
|
+
});
|
|
264
338
|
|
|
265
|
-
const
|
|
339
|
+
const [inputRef, inputRefCallback] = useEnsuredRef(propInputRef);
|
|
340
|
+
useFormReset({
|
|
341
|
+
form,
|
|
342
|
+
elementRef: inputRef,
|
|
343
|
+
defaultValue: initialValue.current,
|
|
344
|
+
});
|
|
345
|
+
const listboxContext = useMemo<ListboxContext>(
|
|
266
346
|
() => ({
|
|
267
347
|
inputRef,
|
|
268
|
-
currentValue
|
|
348
|
+
currentValue,
|
|
349
|
+
selectedIconAfter,
|
|
269
350
|
disableSelectedIcon,
|
|
270
351
|
}),
|
|
271
|
-
[currentValue, disableSelectedIcon, inputRef,
|
|
352
|
+
[currentValue, disableSelectedIcon, inputRef, selectedIconAfter]
|
|
272
353
|
);
|
|
273
354
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
tabIndex: disabled ? -1 : 0,
|
|
281
|
-
} as const;
|
|
282
|
-
const {
|
|
283
|
-
movementProps,
|
|
284
|
-
movementContext,
|
|
285
|
-
currentFocusIndex,
|
|
286
|
-
setActiveDescendantId,
|
|
287
|
-
} = useKeyboardMovementProvider<HTMLDivElement>({
|
|
288
|
-
onFocus: propContainerProps.onFocus,
|
|
289
|
-
onClick(event) {
|
|
290
|
-
propContainerProps.onClick?.(event);
|
|
291
|
-
if (disabled) {
|
|
292
|
-
return;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
show();
|
|
296
|
-
},
|
|
297
|
-
onKeyDown(event) {
|
|
298
|
-
propContainerProps.onKeyDown?.(event);
|
|
299
|
-
if (disabled) {
|
|
300
|
-
return;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
if (visible) {
|
|
304
|
-
if (event.key === "Escape" || event.key === "Tab") {
|
|
305
|
-
event.stopPropagation();
|
|
306
|
-
hide();
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
return;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
if (isSearchableEvent(event)) {
|
|
313
|
-
event.stopPropagation();
|
|
314
|
-
|
|
315
|
-
const nextIndex = findMatchIndex({
|
|
316
|
-
value: event.key,
|
|
317
|
-
values: searchValues,
|
|
318
|
-
startIndex: event.shiftKey ? -1 : currentIndex,
|
|
319
|
-
});
|
|
320
|
-
|
|
321
|
-
if (nextIndex !== -1) {
|
|
322
|
-
triggerManualChangeEvent(inputRef.current, options[nextIndex].value);
|
|
323
|
-
}
|
|
324
|
-
return;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
switch (event.key) {
|
|
328
|
-
case " ":
|
|
329
|
-
event.preventDefault();
|
|
330
|
-
event.stopPropagation();
|
|
331
|
-
show();
|
|
332
|
-
break;
|
|
333
|
-
case "Enter":
|
|
334
|
-
tryToSubmitRelatedForm(event, form);
|
|
335
|
-
break;
|
|
336
|
-
case "Home":
|
|
337
|
-
event.preventDefault();
|
|
338
|
-
event.stopPropagation();
|
|
339
|
-
if (currentIndex !== 0) {
|
|
340
|
-
triggerManualChangeEvent(inputRef.current, options[0].value);
|
|
341
|
-
}
|
|
342
|
-
break;
|
|
343
|
-
case "End":
|
|
344
|
-
event.preventDefault();
|
|
345
|
-
event.stopPropagation();
|
|
346
|
-
if (currentIndex !== totalOptions) {
|
|
347
|
-
triggerManualChangeEvent(
|
|
348
|
-
inputRef.current,
|
|
349
|
-
options[totalOptions].value
|
|
350
|
-
);
|
|
351
|
-
}
|
|
352
|
-
break;
|
|
353
|
-
case "ArrowDown":
|
|
354
|
-
case "ArrowUp": {
|
|
355
|
-
event.preventDefault();
|
|
356
|
-
event.stopPropagation();
|
|
357
|
-
|
|
358
|
-
const increment = event.key === "ArrowDown";
|
|
359
|
-
if (currentIndex === -1 && !increment) {
|
|
360
|
-
// this matches the native select behavior where it will do
|
|
361
|
-
// nothing if there is no current value
|
|
362
|
-
return;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
const nextIndex = loop({
|
|
366
|
-
max: totalOptions,
|
|
367
|
-
value: currentIndex,
|
|
368
|
-
minmax: true,
|
|
369
|
-
increment,
|
|
370
|
-
});
|
|
371
|
-
|
|
372
|
-
triggerManualChangeEvent(inputRef.current, options[nextIndex].value);
|
|
373
|
-
break;
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
},
|
|
377
|
-
loopable: false,
|
|
378
|
-
searchable: true,
|
|
379
|
-
programmatic: true,
|
|
380
|
-
includeDisabled: false,
|
|
381
|
-
tabIndexBehavior: "virtual",
|
|
382
|
-
getDefaultFocusedIndex(focusOptions) {
|
|
383
|
-
if (typeof menuProps.getDefaultFocusedIndex === "function") {
|
|
384
|
-
return menuProps.getDefaultFocusedIndex(focusOptions);
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
const val = typeof value === "undefined" ? currentValue : value;
|
|
388
|
-
return options.findIndex((option) => option.value === val);
|
|
389
|
-
},
|
|
390
|
-
getFocusableElements() {
|
|
391
|
-
const menu = menuRef.current;
|
|
392
|
-
if (!menu) {
|
|
393
|
-
return [];
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
return [
|
|
397
|
-
...menu.querySelectorAll<HTMLLIElement>(
|
|
398
|
-
'[role="option"]:not([aria-disabled])'
|
|
399
|
-
),
|
|
400
|
-
];
|
|
401
|
-
},
|
|
402
|
-
});
|
|
403
|
-
|
|
404
|
-
const containerProps: Required<SelectProps<Value>>["containerProps"] = {
|
|
405
|
-
...propContainerProps,
|
|
406
|
-
...movementProps,
|
|
407
|
-
...a11yProps,
|
|
408
|
-
ref: containerRefCallback,
|
|
409
|
-
};
|
|
410
|
-
|
|
411
|
-
const { onEntering, onEntered, onExiting, onExited, disableTransition } =
|
|
412
|
-
menuProps;
|
|
413
|
-
const handleMounting =
|
|
414
|
-
(callback: TransitionEnterHandler | undefined = noop, skipped: boolean) =>
|
|
415
|
-
(appearing: boolean) => {
|
|
416
|
-
callback(appearing);
|
|
417
|
-
|
|
418
|
-
const menu = menuRef.current;
|
|
419
|
-
if (!menu || skipped) {
|
|
420
|
-
return;
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
// Since the keyboard movement behavior is tied to the
|
|
424
|
-
// `TextFieldContainer` or `input` element instead of the menu for this
|
|
425
|
-
// widget, the focus index and active descendant must manually be updated
|
|
426
|
-
// whenever the menu becomes visible. Without this, no items will be
|
|
427
|
-
// focused until the first keyboard event that would move focus
|
|
428
|
-
const val = typeof value === "undefined" ? currentValue : value;
|
|
429
|
-
const focusables = getNonDisabledOptions(menu);
|
|
430
|
-
const index = Math.max(
|
|
431
|
-
0,
|
|
432
|
-
options.findIndex((option) => option.value === val)
|
|
433
|
-
);
|
|
434
|
-
focusables[index].scrollIntoView({ block: "nearest" });
|
|
435
|
-
currentFocusIndex.current = index;
|
|
436
|
-
setActiveDescendantId(focusables[index]?.id || "");
|
|
437
|
-
};
|
|
438
|
-
|
|
439
|
-
const handleUnmounting =
|
|
440
|
-
(callback: TransitionExitHandler | undefined = noop, skipped = false) =>
|
|
441
|
-
(): void => {
|
|
442
|
-
callback();
|
|
355
|
+
const icon = getIcon("dropdown", propIcon);
|
|
356
|
+
const theme = getFormConfig("theme", propTheme);
|
|
357
|
+
let rightAddon = propRightAddon;
|
|
358
|
+
if (typeof rightAddon === "undefined" && icon) {
|
|
359
|
+
rightAddon = <IconRotator rotated={visible}>{icon}</IconRotator>;
|
|
360
|
+
}
|
|
443
361
|
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
setActiveDescendantId("");
|
|
450
|
-
}
|
|
451
|
-
};
|
|
362
|
+
let listboxLabelledBy = menuProps["aria-labelledby"];
|
|
363
|
+
const listboxLabel = menuProps["aria-label"];
|
|
364
|
+
if (!listboxLabel && !listboxLabelledBy) {
|
|
365
|
+
listboxLabelledBy = labelId || comboboxId;
|
|
366
|
+
}
|
|
452
367
|
|
|
453
368
|
return (
|
|
454
369
|
<ListboxProvider value={listboxContext}>
|
|
455
370
|
<KeyboardMovementProvider value={movementContext}>
|
|
456
|
-
<
|
|
371
|
+
<TextFieldContainer
|
|
372
|
+
aria-labelledby={labelId}
|
|
457
373
|
{...remaining}
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
ref={inputRefCallback}
|
|
461
|
-
containerProps={containerProps}
|
|
462
|
-
type="text"
|
|
463
|
-
tabIndex={-1}
|
|
374
|
+
{...comboboxProps}
|
|
375
|
+
label={!!label}
|
|
464
376
|
theme={theme}
|
|
465
|
-
value={value}
|
|
466
|
-
defaultValue={defaultValue}
|
|
467
377
|
active={active || visible}
|
|
468
|
-
leftAddon={leftAddon}
|
|
469
|
-
rightAddon={rightAddon}
|
|
470
378
|
className={cnb("rmd-select-container", className)}
|
|
471
|
-
|
|
472
|
-
theme,
|
|
473
|
-
className: inputClassName,
|
|
474
|
-
})}
|
|
475
|
-
onChange={(event) => {
|
|
476
|
-
onChange(event as SelectChangeEvent<Value>);
|
|
477
|
-
if (typeof value !== "undefined") {
|
|
478
|
-
return;
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
const nextValue = event.currentTarget.value;
|
|
482
|
-
const valueAsNumber = parseFloat(nextValue);
|
|
483
|
-
const nextOption = options.find(
|
|
484
|
-
(option) =>
|
|
485
|
-
// need to compare both here since
|
|
486
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
487
|
-
// @ts-expect-error
|
|
488
|
-
option.value === nextValue || option.value === valueAsNumber
|
|
489
|
-
);
|
|
490
|
-
|
|
491
|
-
setCurrentValue(
|
|
492
|
-
nextOption ? nextOption.value : initialValue.current
|
|
493
|
-
);
|
|
494
|
-
}}
|
|
379
|
+
rightAddon={rightAddon}
|
|
495
380
|
>
|
|
496
|
-
<
|
|
497
|
-
|
|
381
|
+
<SelectedOption
|
|
382
|
+
option={currentOption}
|
|
383
|
+
placeholder={placeholder}
|
|
384
|
+
disableAddon={disableOptionAddon}
|
|
385
|
+
{...selectedOptionProps}
|
|
386
|
+
/>
|
|
387
|
+
<input
|
|
388
|
+
aria-hidden
|
|
389
|
+
id={inputId}
|
|
390
|
+
ref={inputRefCallback}
|
|
391
|
+
type="text"
|
|
392
|
+
autoComplete={autoComplete}
|
|
393
|
+
name={name}
|
|
394
|
+
tabIndex={-1}
|
|
395
|
+
disabled={disabled}
|
|
396
|
+
required={required}
|
|
397
|
+
placeholder=" "
|
|
398
|
+
{...inputProps}
|
|
399
|
+
value={value}
|
|
400
|
+
defaultValue={defaultValue}
|
|
401
|
+
className={cnb(select({ theme }), textField())}
|
|
402
|
+
onChange={(event) => {
|
|
403
|
+
onChange(event as SelectChangeEvent<Value>);
|
|
404
|
+
if (typeof value !== "undefined") {
|
|
405
|
+
return;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
const nextValue = event.currentTarget.value;
|
|
409
|
+
const nextOption = options.find((option) => option === nextValue);
|
|
410
|
+
|
|
411
|
+
setLocalValue(nextOption ?? initialValue.current);
|
|
412
|
+
}}
|
|
413
|
+
/>
|
|
414
|
+
{label && (
|
|
415
|
+
<span
|
|
416
|
+
{...labelProps}
|
|
417
|
+
id={labelId}
|
|
418
|
+
className={labelStyles({
|
|
419
|
+
dense,
|
|
420
|
+
error,
|
|
421
|
+
disabled,
|
|
422
|
+
active: active || visible,
|
|
423
|
+
floating: true,
|
|
424
|
+
floatingActive: !!placeholder || !!currentOption,
|
|
425
|
+
className: labelProps.className,
|
|
426
|
+
})}
|
|
427
|
+
>
|
|
428
|
+
{label}
|
|
429
|
+
</span>
|
|
430
|
+
)}
|
|
431
|
+
</TextFieldContainer>
|
|
498
432
|
<Menu
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
width="min"
|
|
503
|
-
{...menuProps}
|
|
504
|
-
ref={menuRefCallback}
|
|
505
|
-
visible={visible}
|
|
506
|
-
fixedTo={containerRef}
|
|
507
|
-
onRequestClose={hide}
|
|
508
|
-
onEntering={handleMounting(onEntering, false)}
|
|
509
|
-
onEntered={handleMounting(onEntered, !disableTransition)}
|
|
510
|
-
onExiting={handleUnmounting(onExiting, false)}
|
|
511
|
-
onExited={handleUnmounting(onExited, !disableTransition)}
|
|
512
|
-
sheetProps={{
|
|
513
|
-
...menuProps.sheetProps,
|
|
514
|
-
onEntering: handleMounting(menuProps.sheetProps?.onEntering, false),
|
|
515
|
-
onEntered: handleMounting(
|
|
516
|
-
menuProps.sheetProps?.onEntered,
|
|
517
|
-
!disableTransition
|
|
518
|
-
),
|
|
519
|
-
}}
|
|
433
|
+
{...getMenuProps(menuProps)}
|
|
434
|
+
aria-label={listboxLabel}
|
|
435
|
+
aria-labelledby={listboxLabelledBy as string}
|
|
520
436
|
>
|
|
521
437
|
{children}
|
|
522
438
|
</Menu>
|