@react-md/core 1.0.0-next.7 → 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 +6 -6
- package/.turbo/turbo-lint.log +13 -12
- package/CHANGELOG.md +15 -0
- package/README.md +39 -24
- package/coverage/clover.xml +1013 -529
- package/coverage/coverage-final.json +9 -3
- package/coverage/lcov-report/AutoComplete.tsx.html +283 -0
- package/coverage/lcov-report/MenuItemCheckbox.tsx.html +223 -0
- package/coverage/lcov-report/MenuItemInputToggle.tsx.html +178 -232
- package/coverage/lcov-report/MenuItemRadio.tsx.html +436 -0
- package/coverage/lcov-report/RootHtml.tsx.html +370 -0
- package/coverage/lcov-report/Select.tsx.html +1411 -0
- package/coverage/lcov-report/SrOnly.tsx.html +328 -0
- package/coverage/lcov-report/Typography.tsx.html +1027 -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 +32 -32
- 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/menuItemInputToggleStyles.ts.html +319 -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 +900 -363
- package/dist/RootHtml.d.ts +62 -0
- package/dist/RootHtml.js +49 -0
- package/dist/RootHtml.js.map +1 -0
- package/dist/_core.scss +49 -43
- 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/badge/_badge.scss +23 -19
- 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/MenuItemInputToggle.d.ts +2 -15
- package/dist/form/MenuItemInputToggle.js +26 -37
- package/dist/form/MenuItemInputToggle.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 +47 -29
- package/dist/form/menuItemInputToggleStyles.d.ts +39 -0
- package/dist/form/menuItemInputToggleStyles.js +31 -0
- package/dist/form/menuItemInputToggleStyles.js.map +1 -0
- 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/icon/_icon.scss +7 -5
- package/dist/index.d.ts +15 -1
- package/dist/index.js +15 -1
- package/dist/index.js.map +1 -1
- package/dist/interaction/_interaction.scss +56 -44
- package/dist/list/types.d.ts +10 -1
- package/dist/list/types.js.map +1 -1
- package/dist/menu/Menu.js +12 -1
- package/dist/menu/Menu.js.map +1 -1
- package/dist/menu/_menu.scss +1 -0
- 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/theme/_theme.scss +192 -34
- 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/typography/SrOnly.d.ts +3 -3
- package/dist/typography/SrOnly.js +4 -4
- package/dist/typography/SrOnly.js.map +1 -1
- package/dist/typography/Typography.d.ts +19 -19
- package/dist/typography/Typography.js +19 -19
- package/dist/typography/Typography.js.map +1 -1
- package/dist/typography/_typography.scss +65 -25
- 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 +21 -20
- 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/_core.scss +49 -43
- 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/badge/_badge.scss +23 -19
- package/src/button/__tests__/__snapshots__/Button.tsx.snap +1 -1
- package/src/dialog/FixedDialog.tsx +5 -4
- package/src/form/MenuItemInputToggle.tsx +46 -64
- 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__/MenuItemCheckbox.tsx +53 -0
- package/src/form/__tests__/MenuItemRadio.tsx +53 -0
- package/src/form/__tests__/Select.tsx +439 -0
- package/src/form/__tests__/__snapshots__/FileInput.tsx.snap +23 -23
- package/src/form/__tests__/__snapshots__/MenuItemCheckbox.tsx.snap +96 -0
- package/src/form/__tests__/__snapshots__/MenuItemRadio.tsx.snap +96 -0
- package/src/form/__tests__/__snapshots__/Select.tsx.snap +492 -0
- package/src/form/__tests__/useFormReset.tsx +195 -0
- package/src/form/_form.scss +47 -29
- package/src/form/menuItemInputToggleStyles.ts +78 -0
- 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/icon/_icon.scss +7 -5
- package/src/index.ts +15 -1
- package/src/interaction/_interaction.scss +56 -44
- package/src/list/types.ts +12 -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/_menu.scss +1 -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/theme/_theme.scss +192 -34
- package/src/transition/__tests__/utils.ts +25 -0
- package/src/transition/useCollapseTransition.ts +6 -24
- package/src/transition/utils.ts +10 -5
- package/src/typography/SrOnly.tsx +9 -9
- package/src/typography/Typography.tsx +19 -19
- package/src/typography/__tests__/__snapshots__/SrOnly.tsx.snap +5 -5
- package/src/typography/_typography.scss +65 -25
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/form/MenuItemInputToggle.tsx"],"sourcesContent":["\"use client\";\nimport { cnb } from \"cnbuilder\";\nimport {\n forwardRef,\n type CSSProperties,\n type HTMLAttributes,\n type MouseEvent,\n type ReactNode,\n} from \"react\";\nimport { ListItem } from \"../list/ListItem.js\";\nimport {\n type ListItemAddonPosition,\n type ListItemAddonType,\n type ListItemHeight,\n} from \"../list/types.js\";\nimport { type PropsWithRef } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { bem } from \"../utils/bem.js\";\nimport {\n type IndeterminateCheckboxProps,\n type InputToggleIconProps,\n} from \"./InputToggle.js\";\nimport { InputToggleIcon } from \"./InputToggleIcon.js\";\nimport { SwitchTrack } from \"./SwitchTrack.js\";\nimport { type InputToggleSize } from \"./inputToggleStyles.js\";\n\nconst noop = (): void => {\n // do nothing\n};\nconst styles = bem(\"rmd-menu-item-input-toggle\");\n\n/** @remarks \\@since 6.0.0 */\nexport interface MenuItemInputToggleClassNameOptions {\n className?: string;\n type: \"radio\" | \"checkbox\" | \"switch\";\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport function menuItemInputToggle(\n options: MenuItemInputToggleClassNameOptions\n): string {\n const { className, type } = options;\n return cnb(\n `rmd-${type}-menu-item`,\n styles({ switch: type === \"switch\" }),\n className\n );\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type MenuItemInputToggleCheckedCallback = (\n checked: boolean,\n event: MouseEvent<HTMLLIElement>\n) => void;\n\n/** @remarks \\@since 2.8.0 */\nexport interface BaseMenuItemInputToggleProps\n extends HTMLAttributes<HTMLLIElement>,\n InputToggleIconProps {\n checked: boolean;\n onCheckedChange: MenuItemInputToggleCheckedCallback;\n\n /**\n * @defaultValue `\"menu-item-\" + useId()`\n */\n id?: string;\n\n /** @defaultValue `false` */\n disabled?: boolean;\n\n /**\n * Set this to `true` if the `Menu` should not close when the input toggle is\n * clicked. This can be useful when interacting with a checkbox group within a\n * menu or allowing the user to select multiple options before closing the\n * menu.\n *\n * @defaultValue `false`\n */\n preventMenuHideOnClick?: boolean;\n\n /**\n * This is set to `\"auto\"` by default so the icon shrinks back down to the\n * default icon size instead of relative to the current font size. You\n * probably don't want to change this since it'll also modify the height of\n * the menu item\n *\n * @defaultValue `\"auto\"`\n */\n size?: InputToggleSize;\n\n /** @defaultValue `\"auto\"` */\n height?: ListItemHeight;\n\n /** @defaultValue `false` */\n multiline?: boolean;\n\n /** @defaultValue `false` */\n disableTextChildren?: boolean;\n\n /** @defaultValue `false` */\n iconAfter?: boolean;\n\n addon?: ReactNode;\n addonType?: ListItemAddonType;\n addonPosition?: ListItemAddonPosition;\n\n /** @defaultValue `false` */\n addonForceWrap?: boolean;\n\n /** @defaultValue `false` */\n disableAddonCenteredMedia?: boolean;\n}\n\nexport interface MenuItemCheckboxProps\n extends BaseMenuItemInputToggleProps,\n IndeterminateCheckboxProps {}\n\nexport type MenuItemRadioProps = BaseMenuItemInputToggleProps;\n\n/**\n * @remarks\n * \\@since 2.8.0\n * \\@since 6.0.0 Added additional props for styling the track and ball.\n */\nexport interface MenuItemSwitchProps extends BaseMenuItemInputToggleProps {\n trackProps?: PropsWithRef<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;\n trackStyle?: CSSProperties;\n trackClassName?: string;\n ballProps?: PropsWithRef<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>;\n ballStyle?: CSSProperties;\n ballClassName?: string;\n}\n\n/**\n * @remarks\n * \\@since 2.8.0\n * \\@since 6.0.0 Updated to be a union of the different props to enforce the\n * correct props based on `type`\n */\nexport type MenuItemInputToggleProps =\n | (MenuItemCheckboxProps & { type: \"checkbox\" })\n | (MenuItemRadioProps & { type: \"radio\" })\n | (MenuItemSwitchProps & { type: \"switch\" });\n\n/**\n * **Client Component**\n *\n * This is a low-level component that should probably not be used externally and\n * instead the `MenuItemCheckbox`, `MenuItemRadio`, or `MenuItemSwitch` should\n * be used instead.\n *\n * @see {@link MenuItemCheckbox} for checkbox examples\n * @see {@link MenuItemRadio} for radio examples\n * @see {@link MenuItemSwitch} for switch examples\n * @remarks \\@since 2.8.0\n */\nexport const MenuItemInputToggle = forwardRef<\n HTMLLIElement,\n MenuItemInputToggleProps\n>(function MenuItemInputToggle(props, ref) {\n const {\n id: propId,\n type,\n disabled = false,\n checked,\n onCheckedChange,\n preventMenuHideOnClick = false,\n onClick = noop,\n className,\n tabIndex = -1,\n children,\n size = \"auto\",\n icon: propIcon,\n iconAfter = false,\n iconProps,\n iconStyle,\n iconClassName,\n checkedIcon,\n indeterminate,\n indeterminateIcon,\n addon,\n addonType,\n addonPosition,\n addonForceWrap,\n disableAddonCenteredMedia,\n ballProps,\n ballStyle,\n ballClassName,\n trackProps,\n trackStyle,\n trackClassName,\n ...remaining\n } = props as MenuItemSwitchProps &\n MenuItemCheckboxProps & { type: \"checkbox\" | \"radio\" | \"switch\" };\n const id = useEnsuredId(propId, \"menu-item\");\n\n let icon = propIcon;\n if (typeof propIcon === \"undefined\") {\n if (type === \"switch\") {\n icon = (\n <SwitchTrack\n style={trackStyle}\n {...trackProps}\n className={cnb(\n styles(\"track\"),\n trackClassName,\n trackProps?.className\n )}\n active={checked}\n ballProps={ballProps}\n ballStyle={ballStyle}\n ballClassName={cnb(styles(\"ball\"), ballClassName)}\n />\n );\n } else {\n icon = (\n <InputToggleIcon\n style={iconStyle}\n disableEm\n {...iconProps}\n className={cnb(styles(\"icon\"), iconClassName, iconProps?.className)}\n size={size}\n type={type}\n checked={checked}\n disabled={disabled}\n icon={propIcon}\n checkedIcon={checkedIcon}\n indeterminate={indeterminate}\n indeterminateIcon={indeterminateIcon}\n />\n );\n }\n }\n\n let leftAddon: ReactNode;\n let leftAddonType: ListItemAddonType | undefined;\n let leftAddonPosition: ListItemAddonPosition | undefined;\n let leftAddonForceWrap: boolean | undefined;\n let disableLeftAddonCenteredMedia: boolean | undefined;\n let rightAddon: ReactNode;\n let rightAddonType: ListItemAddonType | undefined;\n let rightAddonPosition: ListItemAddonPosition | undefined;\n let rightAddonForceWrap: boolean | undefined;\n let disableRightAddonCenteredMedia: boolean | undefined;\n if (iconAfter) {\n leftAddon = addon;\n leftAddonType = addonType;\n leftAddonPosition = addonPosition;\n leftAddonForceWrap = addonForceWrap;\n disableLeftAddonCenteredMedia = disableAddonCenteredMedia;\n rightAddon = icon;\n } else {\n leftAddon = icon;\n rightAddon = addon;\n rightAddonType = addonType;\n rightAddonPosition = addonPosition;\n rightAddonForceWrap = addonForceWrap;\n disableRightAddonCenteredMedia = disableAddonCenteredMedia;\n }\n\n return (\n <ListItem\n {...remaining}\n // I'm not actually sure if this is correct\n aria-checked={indeterminate && checked ? \"mixed\" : checked}\n id={id}\n role={type === \"radio\" ? \"menuitemradio\" : \"menuitemcheckbox\"}\n onClick={(event) => {\n onClick(event);\n onCheckedChange(!checked, event);\n\n if (preventMenuHideOnClick) {\n event.stopPropagation();\n }\n }}\n ref={ref}\n className={menuItemInputToggle({ type, className })}\n disabled={disabled}\n tabIndex={tabIndex}\n leftAddon={leftAddon}\n leftAddonType={leftAddonType}\n leftAddonPosition={leftAddonPosition}\n leftAddonForceWrap={leftAddonForceWrap}\n disableLeftAddonCenteredMedia={disableLeftAddonCenteredMedia}\n rightAddon={rightAddon}\n rightAddonType={rightAddonType}\n rightAddonPosition={rightAddonPosition}\n rightAddonForceWrap={rightAddonForceWrap}\n disableRightAddonCenteredMedia={disableRightAddonCenteredMedia}\n >\n {children}\n </ListItem>\n );\n});\n"],"names":["cnb","forwardRef","ListItem","useEnsuredId","bem","InputToggleIcon","SwitchTrack","noop","styles","menuItemInputToggle","options","className","type","switch","MenuItemInputToggle","props","ref","id","propId","disabled","checked","onCheckedChange","preventMenuHideOnClick","onClick","tabIndex","children","size","icon","propIcon","iconAfter","iconProps","iconStyle","iconClassName","checkedIcon","indeterminate","indeterminateIcon","addon","addonType","addonPosition","addonForceWrap","disableAddonCenteredMedia","ballProps","ballStyle","ballClassName","trackProps","trackStyle","trackClassName","remaining","style","active","disableEm","leftAddon","leftAddonType","leftAddonPosition","leftAddonForceWrap","disableLeftAddonCenteredMedia","rightAddon","rightAddonType","rightAddonPosition","rightAddonForceWrap","disableRightAddonCenteredMedia","aria-checked","role","event","stopPropagation"],"mappings":"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"}
|
|
1
|
+
{"version":3,"sources":["../../src/form/MenuItemInputToggle.tsx"],"sourcesContent":["\"use client\";\nimport { cnb } from \"cnbuilder\";\nimport {\n forwardRef,\n type CSSProperties,\n type HTMLAttributes,\n type MouseEvent,\n type ReactNode,\n} from \"react\";\nimport { ListItem } from \"../list/ListItem.js\";\nimport {\n type ListItemAddonPosition,\n type ListItemAddonType,\n type ListItemChildrenTextProps,\n type ListItemHeight,\n} from \"../list/types.js\";\nimport { type PropsWithRef } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport {\n type IndeterminateCheckboxProps,\n type InputToggleIconProps,\n} from \"./InputToggle.js\";\nimport { InputToggleIcon } from \"./InputToggleIcon.js\";\nimport { SwitchTrack } from \"./SwitchTrack.js\";\nimport { type InputToggleSize } from \"./inputToggleStyles.js\";\nimport {\n menuItemInputToggle,\n menuItemInputToggleBall,\n menuItemInputToggleIcon,\n menuItemInputToggleTrack,\n} from \"./menuItemInputToggleStyles.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type MenuItemInputToggleCheckedCallback = (\n checked: boolean,\n event: MouseEvent<HTMLLIElement>\n) => void;\n\n/** @remarks \\@since 2.8.0 */\nexport interface BaseMenuItemInputToggleProps\n extends HTMLAttributes<HTMLLIElement>,\n InputToggleIconProps,\n ListItemChildrenTextProps {\n checked: boolean;\n onCheckedChange: MenuItemInputToggleCheckedCallback;\n\n /**\n * @defaultValue `\"menu-item-\" + useId()`\n */\n id?: string;\n\n /** @defaultValue `false` */\n disabled?: boolean;\n\n /**\n * Set this to `true` if the `Menu` should not close when the input toggle is\n * clicked. This can be useful when interacting with a checkbox group within a\n * menu or allowing the user to select multiple options before closing the\n * menu.\n *\n * @defaultValue `false`\n */\n preventMenuHideOnClick?: boolean;\n\n /**\n * This is set to `\"auto\"` by default so the icon shrinks back down to the\n * default icon size instead of relative to the current font size. You\n * probably don't want to change this since it'll also modify the height of\n * the menu item\n *\n * @defaultValue `\"auto\"`\n */\n size?: InputToggleSize;\n\n /** @defaultValue `\"auto\"` */\n height?: ListItemHeight;\n\n /** @defaultValue `false` */\n iconAfter?: boolean;\n\n addon?: ReactNode;\n addonType?: ListItemAddonType;\n addonPosition?: ListItemAddonPosition;\n\n /** @defaultValue `false` */\n addonForceWrap?: boolean;\n\n /** @defaultValue `false` */\n disableAddonCenteredMedia?: boolean;\n}\n\nexport interface MenuItemCheckboxProps\n extends BaseMenuItemInputToggleProps,\n IndeterminateCheckboxProps {}\n\nexport type MenuItemRadioProps = BaseMenuItemInputToggleProps;\n\n/**\n * @remarks\n * \\@since 2.8.0\n * \\@since 6.0.0 Added additional props for styling the track and ball.\n */\nexport interface MenuItemSwitchProps extends BaseMenuItemInputToggleProps {\n trackProps?: PropsWithRef<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;\n trackStyle?: CSSProperties;\n trackClassName?: string;\n ballProps?: PropsWithRef<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>;\n ballStyle?: CSSProperties;\n ballClassName?: string;\n}\n\n/**\n * @remarks\n * \\@since 2.8.0\n * \\@since 6.0.0 Updated to be a union of the different props to enforce the\n * correct props based on `type`\n */\nexport type MenuItemInputToggleProps =\n | (MenuItemCheckboxProps & { type: \"checkbox\" })\n | (MenuItemRadioProps & { type: \"radio\" })\n | (MenuItemSwitchProps & { type: \"switch\" });\n\n/**\n * **Client Component**\n *\n * This is a low-level component that should probably not be used externally and\n * instead the `MenuItemCheckbox`, `MenuItemRadio`, or `MenuItemSwitch` should\n * be used instead.\n *\n * @see {@link MenuItemCheckbox} for checkbox examples\n * @see {@link MenuItemRadio} for radio examples\n * @see {@link MenuItemSwitch} for switch examples\n * @remarks \\@since 2.8.0\n */\nexport const MenuItemInputToggle = forwardRef<\n HTMLLIElement,\n MenuItemInputToggleProps\n>(function MenuItemInputToggle(props, ref) {\n const {\n id: propId,\n type,\n disabled = false,\n checked,\n onCheckedChange,\n preventMenuHideOnClick = false,\n onClick = noop,\n className,\n tabIndex = -1,\n children,\n size = \"auto\",\n icon: propIcon,\n iconAfter = false,\n iconProps,\n iconStyle,\n iconClassName,\n checkedIcon,\n indeterminate,\n indeterminateIcon,\n addon,\n addonType,\n addonPosition,\n addonForceWrap,\n disableAddonCenteredMedia,\n ballProps,\n ballStyle,\n ballClassName,\n trackProps,\n trackStyle,\n trackClassName,\n ...remaining\n } = props as MenuItemSwitchProps &\n MenuItemCheckboxProps & { type: \"checkbox\" | \"radio\" | \"switch\" };\n const id = useEnsuredId(propId, \"menu-item\");\n\n let icon = propIcon;\n if (type === \"switch\") {\n icon = (\n <SwitchTrack\n style={trackStyle}\n {...trackProps}\n className={cnb(\n menuItemInputToggleTrack(),\n trackClassName,\n trackProps?.className\n )}\n active={checked}\n ballProps={ballProps}\n ballStyle={ballStyle}\n ballClassName={cnb(menuItemInputToggleBall(), ballClassName)}\n />\n );\n } else {\n icon = (\n <InputToggleIcon\n style={iconStyle}\n disableEm\n {...iconProps}\n className={cnb(\n menuItemInputToggleIcon(),\n iconClassName,\n iconProps?.className\n )}\n size={size}\n type={type}\n checked={checked}\n disabled={disabled}\n icon={propIcon}\n checkedIcon={checkedIcon}\n indeterminate={indeterminate}\n indeterminateIcon={indeterminateIcon}\n />\n );\n }\n\n let leftAddon: ReactNode;\n let leftAddonType: ListItemAddonType | undefined;\n let leftAddonPosition: ListItemAddonPosition | undefined;\n let leftAddonForceWrap: boolean | undefined;\n let disableLeftAddonCenteredMedia: boolean | undefined;\n let rightAddon: ReactNode;\n let rightAddonType: ListItemAddonType | undefined;\n let rightAddonPosition: ListItemAddonPosition | undefined;\n let rightAddonForceWrap: boolean | undefined;\n let disableRightAddonCenteredMedia: boolean | undefined;\n if (iconAfter) {\n leftAddon = addon;\n leftAddonType = addonType;\n leftAddonPosition = addonPosition;\n leftAddonForceWrap = addonForceWrap;\n disableLeftAddonCenteredMedia = disableAddonCenteredMedia;\n rightAddon = icon;\n } else {\n leftAddon = icon;\n rightAddon = addon;\n rightAddonType = addonType;\n rightAddonPosition = addonPosition;\n rightAddonForceWrap = addonForceWrap;\n disableRightAddonCenteredMedia = disableAddonCenteredMedia;\n }\n\n return (\n <ListItem\n {...remaining}\n // I'm not actually sure if this is correct\n aria-checked={indeterminate && checked ? \"mixed\" : checked}\n id={id}\n role={type === \"radio\" ? \"menuitemradio\" : \"menuitemcheckbox\"}\n onClick={(event) => {\n onClick(event);\n onCheckedChange(!checked, event);\n\n if (preventMenuHideOnClick) {\n event.stopPropagation();\n }\n }}\n ref={ref}\n className={menuItemInputToggle({ type, className })}\n disabled={disabled}\n tabIndex={tabIndex}\n leftAddon={leftAddon}\n leftAddonType={leftAddonType}\n leftAddonPosition={leftAddonPosition}\n leftAddonForceWrap={leftAddonForceWrap}\n disableLeftAddonCenteredMedia={disableLeftAddonCenteredMedia}\n rightAddon={rightAddon}\n rightAddonType={rightAddonType}\n rightAddonPosition={rightAddonPosition}\n rightAddonForceWrap={rightAddonForceWrap}\n disableRightAddonCenteredMedia={disableRightAddonCenteredMedia}\n >\n {children}\n </ListItem>\n );\n});\n"],"names":["cnb","forwardRef","ListItem","useEnsuredId","InputToggleIcon","SwitchTrack","menuItemInputToggle","menuItemInputToggleBall","menuItemInputToggleIcon","menuItemInputToggleTrack","noop","MenuItemInputToggle","props","ref","id","propId","type","disabled","checked","onCheckedChange","preventMenuHideOnClick","onClick","className","tabIndex","children","size","icon","propIcon","iconAfter","iconProps","iconStyle","iconClassName","checkedIcon","indeterminate","indeterminateIcon","addon","addonType","addonPosition","addonForceWrap","disableAddonCenteredMedia","ballProps","ballStyle","ballClassName","trackProps","trackStyle","trackClassName","remaining","style","active","disableEm","leftAddon","leftAddonType","leftAddonPosition","leftAddonForceWrap","disableLeftAddonCenteredMedia","rightAddon","rightAddonType","rightAddonPosition","rightAddonForceWrap","disableRightAddonCenteredMedia","aria-checked","role","event","stopPropagation"],"mappings":"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"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { type CSSProperties, type HTMLAttributes, type ReactNode, type SelectHTMLAttributes } from "react";
|
|
2
2
|
import { type PropsWithRef } from "../types.js";
|
|
3
|
-
import { type FormFieldOptions, type
|
|
4
|
-
|
|
3
|
+
import { type FormFieldOptions, type UserAgentAutocompleteProps } from "./types.js";
|
|
4
|
+
/**
|
|
5
|
+
* @remarks \@since 6.0.0 Added support for {@link UserAgentAutocompleteProps}
|
|
6
|
+
*/
|
|
7
|
+
export interface NativeSelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, "autoComplete">, UserAgentAutocompleteProps, FormFieldOptions {
|
|
5
8
|
/**
|
|
6
9
|
* A custom dropdown icon to use instead of the browser's default select
|
|
7
10
|
* dropdown icon.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/form/NativeSelect.tsx"],"sourcesContent":["import {\n forwardRef,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n type SelectHTMLAttributes,\n} from \"react\";\nimport { getIcon } from \"../icon/iconConfig.js\";\nimport { type PropsWithRef } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { FormMessageContainer } from \"./FormMessageContainer.js\";\nimport { Label } from \"./Label.js\";\nimport { TextFieldContainer } from \"./TextFieldContainer.js\";\nimport { getFormConfig } from \"./formConfig.js\";\nimport { nativeSelect, nativeSelectContainer } from \"./nativeSelectStyles.js\";\nimport {\n type FormFieldOptions,\n type
|
|
1
|
+
{"version":3,"sources":["../../src/form/NativeSelect.tsx"],"sourcesContent":["import {\n forwardRef,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n type SelectHTMLAttributes,\n} from \"react\";\nimport { getIcon } from \"../icon/iconConfig.js\";\nimport { type PropsWithRef } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { FormMessageContainer } from \"./FormMessageContainer.js\";\nimport { Label } from \"./Label.js\";\nimport { TextFieldContainer } from \"./TextFieldContainer.js\";\nimport { getFormConfig } from \"./formConfig.js\";\nimport { nativeSelect, nativeSelectContainer } from \"./nativeSelectStyles.js\";\nimport {\n type FormFieldOptions,\n type UserAgentAutocompleteProps,\n} from \"./types.js\";\n\n/**\n * @remarks \\@since 6.0.0 Added support for {@link UserAgentAutocompleteProps}\n */\nexport interface NativeSelectProps\n extends Omit<SelectHTMLAttributes<HTMLSelectElement>, \"autoComplete\">,\n UserAgentAutocompleteProps,\n FormFieldOptions {\n /**\n * A custom dropdown icon to use instead of the browser's default select\n * dropdown icon.\n *\n * Set this to `null` if the browser's default icon should be used instead.\n *\n * @defaultValue `getIcon(\"dropdown\")`\n */\n icon?: ReactNode;\n\n /**\n * This applies custom inline styles to the `<select>` element since the\n * `style` prop is applied to the container element instead.\n */\n selectStyle?: CSSProperties;\n\n /**\n * This applies custom className to the `<select>` element since the\n * `className` prop is applied to the container element instead.\n */\n selectClassName?: string;\n\n /**\n * This should be a list of `<option>` elements for specific values within the\n * `<select>`.\n *\n * Check out the {@link NativeSelect} for examples around using \"placeholder\"\n * text and requiring a value to be selected.\n */\n children: ReactNode;\n\n /**\n * Optional props to provide to the {@link TextFieldContainer} component.\n * There probably isn't any real use for this prop other than if you need to\n * add a `ref` for some DOM behavior.\n */\n containerProps?: PropsWithRef<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;\n}\n\n/**\n * **Server Component**\n *\n * This component is a wrapper for the native `<select>` field that applies the\n * same theming as `TextField` and `TextArea` components. This component might\n * not be used much since the `Select` offers more styling options.\n *\n * @example\n * Simple Example\n * ```tsx\n * <NativeSelect label=\"Label\">\n * <option value=\"a\">Value 1</option>\n * <option value=\"b\">Value 2</option>\n * <option value=\"c\">Value 3</option>\n * <option value=\"d\">Value 4</option>\n * </NativeSelect>\n * ```\n *\n * @example\n * Required Value Example\n * ```tsx\n * function Example(): ReactElement {\n * // using `defaultValue=\"\"` makes it so the first option selected by default\n * // and considered an \"invalid\" value since it is `disabled`\n * //\n * // a `name` must be set with `required` so that the form validation will\n * // fire if the value is still the empty string when the form is submitted\n * //\n * // the first `<option>` is kind of like placeholder text since it doesn't\n * // have a value and is disabled by default\n *\n * return (\n * <NativeSelect\n * label=\"State\"\n * name=\"state\"\n * required\n * defaultValue=\"\"\n * >\n * <option value=\"\" disabled>Choose a state</option>\n * {states.map(({ name, code }) => (\n * <option key={code} value={code}>{name}</option>\n * ))}\n * </NativeSelect>\n * );\n * }\n * ```\n */\nexport const NativeSelect = forwardRef<HTMLSelectElement, NativeSelectProps>(\n function NativeSelect(props, ref) {\n const {\n id: propId,\n style,\n className,\n icon: propIcon,\n label,\n labelProps,\n labelStyle,\n labelClassName,\n selectStyle,\n selectClassName,\n autoCompleteValue,\n autoComplete = autoCompleteValue,\n name = autoCompleteValue,\n dense = false,\n error = false,\n active = false,\n inline = false,\n stretch = false,\n leftAddon,\n rightAddon: propRightAddon,\n leftAddonProps,\n rightAddonProps,\n disableLeftAddonStyles = false,\n disableRightAddonStyles = false,\n theme: propTheme,\n underlineDirection: propUnderlineDirection,\n messageProps,\n messageContainerProps,\n containerProps,\n children,\n ...remaining\n } = props;\n const { disabled = false, readOnly = false, multiple = false } = props;\n const id = useEnsuredId(propId, \"select\");\n const theme = getFormConfig(\"theme\", propTheme);\n const underlineDirection = getFormConfig(\n \"underlineDirection\",\n propUnderlineDirection\n );\n const icon = getIcon(\"dropdown\", propIcon);\n const underlined = theme === \"underline\" || theme === \"filled\";\n\n let rightAddon = propRightAddon;\n if (typeof propRightAddon === \"undefined\" && !multiple) {\n rightAddon = icon;\n }\n\n return (\n <FormMessageContainer\n {...messageContainerProps}\n messageProps={messageProps}\n >\n <TextFieldContainer\n {...containerProps}\n style={style}\n className={nativeSelectContainer({\n label: !!label,\n multiple,\n underlined,\n className,\n })}\n theme={theme}\n label={!!label}\n error={error}\n dense={dense}\n inline={inline}\n active={active}\n stretch={stretch}\n readOnly={readOnly}\n disabled={disabled}\n leftAddon={leftAddon}\n leftAddonProps={leftAddonProps}\n rightAddon={rightAddon}\n rightAddonProps={rightAddonProps}\n underlineDirection={underlineDirection}\n disableLeftAddonStyles={disableLeftAddonStyles}\n disableRightAddonStyles={disableRightAddonStyles}\n >\n <select\n {...remaining}\n id={id}\n ref={ref}\n autoComplete={autoComplete}\n name={name}\n disabled={disabled}\n style={selectStyle}\n className={nativeSelect({\n icon: !!icon,\n className: selectClassName,\n })}\n >\n {children}\n </select>\n {label && (\n <Label\n {...labelProps}\n htmlFor={id}\n style={labelProps?.style ?? labelStyle}\n className={labelProps?.className ?? labelClassName}\n floating\n dense={dense}\n error={error}\n active={active}\n disabled={disabled}\n >\n {label}\n </Label>\n )}\n </TextFieldContainer>\n </FormMessageContainer>\n );\n }\n);\n"],"names":["forwardRef","getIcon","useEnsuredId","FormMessageContainer","Label","TextFieldContainer","getFormConfig","nativeSelect","nativeSelectContainer","NativeSelect","props","ref","id","propId","style","className","icon","propIcon","label","labelProps","labelStyle","labelClassName","selectStyle","selectClassName","autoCompleteValue","autoComplete","name","dense","error","active","inline","stretch","leftAddon","rightAddon","propRightAddon","leftAddonProps","rightAddonProps","disableLeftAddonStyles","disableRightAddonStyles","theme","propTheme","underlineDirection","propUnderlineDirection","messageProps","messageContainerProps","containerProps","children","remaining","disabled","readOnly","multiple","underlined","select","htmlFor","floating"],"mappings":";AAAA,SACEA,UAAU,QAKL,QAAQ;AACf,SAASC,OAAO,QAAQ,wBAAwB;AAEhD,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,oBAAoB,QAAQ,4BAA4B;AACjE,SAASC,KAAK,QAAQ,aAAa;AACnC,SAASC,kBAAkB,QAAQ,0BAA0B;AAC7D,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAASC,YAAY,EAAEC,qBAAqB,QAAQ,0BAA0B;AAoD9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8CC,GACD,OAAO,MAAMC,6BAAeT,WAC1B,SAASS,aAAaC,KAAK,EAAEC,GAAG;IAC9B,MAAM,EACJC,IAAIC,MAAM,EACVC,KAAK,EACLC,SAAS,EACTC,MAAMC,QAAQ,EACdC,KAAK,EACLC,UAAU,EACVC,UAAU,EACVC,cAAc,EACdC,WAAW,EACXC,eAAe,EACfC,iBAAiB,EACjBC,eAAeD,iBAAiB,EAChCE,OAAOF,iBAAiB,EACxBG,QAAQ,KAAK,EACbC,QAAQ,KAAK,EACbC,SAAS,KAAK,EACdC,SAAS,KAAK,EACdC,UAAU,KAAK,EACfC,SAAS,EACTC,YAAYC,cAAc,EAC1BC,cAAc,EACdC,eAAe,EACfC,yBAAyB,KAAK,EAC9BC,0BAA0B,KAAK,EAC/BC,OAAOC,SAAS,EAChBC,oBAAoBC,sBAAsB,EAC1CC,YAAY,EACZC,qBAAqB,EACrBC,cAAc,EACdC,QAAQ,EACR,GAAGC,WACJ,GAAGrC;IACJ,MAAM,EAAEsC,WAAW,KAAK,EAAEC,WAAW,KAAK,EAAEC,WAAW,KAAK,EAAE,GAAGxC;IACjE,MAAME,KAAKV,aAAaW,QAAQ;IAChC,MAAM0B,QAAQjC,cAAc,SAASkC;IACrC,MAAMC,qBAAqBnC,cACzB,sBACAoC;IAEF,MAAM1B,OAAOf,QAAQ,YAAYgB;IACjC,MAAMkC,aAAaZ,UAAU,eAAeA,UAAU;IAEtD,IAAIN,aAAaC;IACjB,IAAI,OAAOA,mBAAmB,eAAe,CAACgB,UAAU;QACtDjB,aAAajB;IACf;IAEA,qBACE,KAACb;QACE,GAAGyC,qBAAqB;QACzBD,cAAcA;kBAEd,cAAA,MAACtC;YACE,GAAGwC,cAAc;YAClB/B,OAAOA;YACPC,WAAWP,sBAAsB;gBAC/BU,OAAO,CAAC,CAACA;gBACTgC;gBACAC;gBACApC;YACF;YACAwB,OAAOA;YACPrB,OAAO,CAAC,CAACA;YACTU,OAAOA;YACPD,OAAOA;YACPG,QAAQA;YACRD,QAAQA;YACRE,SAASA;YACTkB,UAAUA;YACVD,UAAUA;YACVhB,WAAWA;YACXG,gBAAgBA;YAChBF,YAAYA;YACZG,iBAAiBA;YACjBK,oBAAoBA;YACpBJ,wBAAwBA;YACxBC,yBAAyBA;;8BAEzB,KAACc;oBACE,GAAGL,SAAS;oBACbnC,IAAIA;oBACJD,KAAKA;oBACLc,cAAcA;oBACdC,MAAMA;oBACNsB,UAAUA;oBACVlC,OAAOQ;oBACPP,WAAWR,aAAa;wBACtBS,MAAM,CAAC,CAACA;wBACRD,WAAWQ;oBACb;8BAECuB;;gBAEF5B,uBACC,KAACd;oBACE,GAAGe,UAAU;oBACdkC,SAASzC;oBACTE,OAAOK,YAAYL,SAASM;oBAC5BL,WAAWI,YAAYJ,aAAaM;oBACpCiC,QAAQ;oBACR3B,OAAOA;oBACPC,OAAOA;oBACPC,QAAQA;oBACRmB,UAAUA;8BAET9B;;;;;AAMb,GACA"}
|
package/dist/form/Option.js
CHANGED
|
@@ -36,9 +36,10 @@ const noop = ()=>{
|
|
|
36
36
|
* \@since 6.0.0 Added the `value`, `selectedIcon`, `unselectedIcon`,
|
|
37
37
|
* `selectedIconAfter`, and `iconSpacingProps` props.
|
|
38
38
|
*/ export const Option = /*#__PURE__*/ forwardRef(function Option(props, ref) {
|
|
39
|
-
const { id: propId, role = "option", value, children: propChildren, onClick = noop, className, selectedIcon: propSelectedIcon, unselectedIcon: propUnselectedIcon, selectedIconAfter
|
|
39
|
+
const { id: propId, role = "option", value, children: propChildren, onClick = noop, className, selectedIcon: propSelectedIcon, unselectedIcon: propUnselectedIcon, selectedIconAfter: propSelectedIconAfter, textIconSpacingProps, leftAddon: propLeftAddon, leftAddonType, leftAddonClassName, rightAddon: propRightAddon, rightAddonType, rightAddonClassName, secondaryText, height: propHeight, disableTextChildren: propDisableTextChildren, ...remaining } = props;
|
|
40
40
|
const id = useEnsuredId(propId, "option");
|
|
41
|
-
const { inputRef, currentValue, disableSelectedIcon } = useListboxContext();
|
|
41
|
+
const { inputRef, currentValue, disableSelectedIcon, selectedIconAfter: contextSelectedIconAfter } = useListboxContext();
|
|
42
|
+
const selectedIconAfter = propSelectedIconAfter ?? contextSelectedIconAfter;
|
|
42
43
|
const selected = value === currentValue;
|
|
43
44
|
const selectedIcon = getIcon("selected", disableSelectedIcon ? null : propSelectedIcon);
|
|
44
45
|
const unselectedIcon = disableSelectedIcon ? null : propUnselectedIcon ?? DEFAULT_OPTION_UNSELECTED_ICON;
|
package/dist/form/Option.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/form/Option.tsx"],"sourcesContent":["\"use client\";\nimport { cnb } from \"cnbuilder\";\nimport { forwardRef, Fragment, type ReactNode } from \"react\";\nimport { getIcon } from \"../icon/iconConfig.js\";\nimport { icon } from \"../icon/styles.js\";\nimport {\n TextIconSpacing,\n type TextIconSpacingProps,\n} from \"../icon/TextIconSpacing.js\";\nimport { getListItemHeight } from \"../list/getListItemHeight.js\";\nimport { ListItemText } from \"../list/ListItemText.js\";\nimport { MenuItem, type MenuItemProps } from \"../menu/MenuItem.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { option } from \"./optionStyles.js\";\nimport { useListboxContext } from \"./useListboxProvider.js\";\nimport { triggerManualChangeEvent } from \"./utils.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * This icon is used while the option is unselected so that the selected and\n * unselected options have the same alignment.\n *\n * @remarks \\@since 6.0.0\n */\nexport const DEFAULT_OPTION_UNSELECTED_ICON = (\n <span className={icon({ type: \"svg\" })} />\n);\n\n/**\n * @remarks\n * \\@since 6.0.0 removed the `selected` and `focused` props.\n * \\@since 6.0.0 Added the `value`, `selectedIcon`, `unselectedIcon`,\n * `selectedIconAfter`, and `iconSpacingProps` props.\n */\nexport interface OptionProps extends MenuItemProps {\n /**\n * @defaultValue `\"option\"`\n */\n role?: string;\n\n value: string | number;\n\n /**\n * @defaultValue `getIcon(\"selected\")`\n */\n selectedIcon?: ReactNode;\n\n /**\n * @see {@link DEFAULT_OPTION_UNSELECTED_ICON}\n * @defaultValue `<span className=\"rmd-icon rmd-icon--svg\" />`\n */\n unselectedIcon?: ReactNode;\n\n /**\n * Set this to `true` of the {@link selectedIcon}/{@link unselectedIcon}\n * should appear as the {@link rightAddon} instead of the {@link leftAddon}.\n *\n * @defaultValue `false`\n */\n selectedIconAfter?: boolean;\n\n /**\n * Since the `selectedIcon`/`unselectedIcon` are rendered as\n * `leftAddon`/`rightAddon`, the provided `leftAddon`/`rightAddon` will be\n * wrapped in the {@link TextIconSpacing} component to maintain the correct\n * spacing. You can use this prop to provide any additional configuration to\n * the spacing.\n *\n * @example\n * ```tsx\n * <Option\n * leftAddon={<Avatar>A</Avatar>}\n * leftAddonType=\"avatar\"\n * value={0}\n * textIconSpacingProps={{\n * beforeClassName: \"my-custom-class-name\",\n * }}\n * >\n * Some Content\n * </Option>\n * ```\n */\n textIconSpacingProps?: Omit<TextIconSpacingProps, \"icon\" | \"children\">;\n}\n\n/**\n * **Client Component**\n *\n * This component is a wrapper around the {@link MenuItem} to implement custom\n * select option behavior.\n *\n * @remarks\n * \\@since 6.0.0 removed the `selected` and `focused` props.\n * \\@since 6.0.0 Added the `value`, `selectedIcon`, `unselectedIcon`,\n * `selectedIconAfter`, and `iconSpacingProps` props.\n */\nexport const Option = forwardRef<HTMLLIElement, OptionProps>(\n function Option(props, ref) {\n const {\n id: propId,\n role = \"option\",\n value,\n children: propChildren,\n onClick = noop,\n className,\n selectedIcon: propSelectedIcon,\n unselectedIcon: propUnselectedIcon,\n selectedIconAfter
|
|
1
|
+
{"version":3,"sources":["../../src/form/Option.tsx"],"sourcesContent":["\"use client\";\nimport { cnb } from \"cnbuilder\";\nimport { forwardRef, Fragment, type ReactNode } from \"react\";\nimport { getIcon } from \"../icon/iconConfig.js\";\nimport { icon } from \"../icon/styles.js\";\nimport {\n TextIconSpacing,\n type TextIconSpacingProps,\n} from \"../icon/TextIconSpacing.js\";\nimport { getListItemHeight } from \"../list/getListItemHeight.js\";\nimport { ListItemText } from \"../list/ListItemText.js\";\nimport { MenuItem, type MenuItemProps } from \"../menu/MenuItem.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { option } from \"./optionStyles.js\";\nimport { useListboxContext } from \"./useListboxProvider.js\";\nimport { triggerManualChangeEvent } from \"./utils.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * This icon is used while the option is unselected so that the selected and\n * unselected options have the same alignment.\n *\n * @remarks \\@since 6.0.0\n */\nexport const DEFAULT_OPTION_UNSELECTED_ICON = (\n <span className={icon({ type: \"svg\" })} />\n);\n\n/**\n * @remarks\n * \\@since 6.0.0 removed the `selected` and `focused` props.\n * \\@since 6.0.0 Added the `value`, `selectedIcon`, `unselectedIcon`,\n * `selectedIconAfter`, and `iconSpacingProps` props.\n */\nexport interface OptionProps extends MenuItemProps {\n /**\n * @defaultValue `\"option\"`\n */\n role?: string;\n\n value: string | number;\n\n /**\n * @defaultValue `getIcon(\"selected\")`\n */\n selectedIcon?: ReactNode;\n\n /**\n * @see {@link DEFAULT_OPTION_UNSELECTED_ICON}\n * @defaultValue `<span className=\"rmd-icon rmd-icon--svg\" />`\n */\n unselectedIcon?: ReactNode;\n\n /**\n * Set this to `true` of the {@link selectedIcon}/{@link unselectedIcon}\n * should appear as the {@link rightAddon} instead of the {@link leftAddon}.\n *\n * @defaultValue `false`\n */\n selectedIconAfter?: boolean;\n\n /**\n * Since the `selectedIcon`/`unselectedIcon` are rendered as\n * `leftAddon`/`rightAddon`, the provided `leftAddon`/`rightAddon` will be\n * wrapped in the {@link TextIconSpacing} component to maintain the correct\n * spacing. You can use this prop to provide any additional configuration to\n * the spacing.\n *\n * @example\n * ```tsx\n * <Option\n * leftAddon={<Avatar>A</Avatar>}\n * leftAddonType=\"avatar\"\n * value={0}\n * textIconSpacingProps={{\n * beforeClassName: \"my-custom-class-name\",\n * }}\n * >\n * Some Content\n * </Option>\n * ```\n */\n textIconSpacingProps?: Omit<TextIconSpacingProps, \"icon\" | \"children\">;\n}\n\n/**\n * **Client Component**\n *\n * This component is a wrapper around the {@link MenuItem} to implement custom\n * select option behavior.\n *\n * @remarks\n * \\@since 6.0.0 removed the `selected` and `focused` props.\n * \\@since 6.0.0 Added the `value`, `selectedIcon`, `unselectedIcon`,\n * `selectedIconAfter`, and `iconSpacingProps` props.\n */\nexport const Option = forwardRef<HTMLLIElement, OptionProps>(\n function Option(props, ref) {\n const {\n id: propId,\n role = \"option\",\n value,\n children: propChildren,\n onClick = noop,\n className,\n selectedIcon: propSelectedIcon,\n unselectedIcon: propUnselectedIcon,\n selectedIconAfter: propSelectedIconAfter,\n textIconSpacingProps,\n leftAddon: propLeftAddon,\n leftAddonType,\n leftAddonClassName,\n rightAddon: propRightAddon,\n rightAddonType,\n rightAddonClassName,\n secondaryText,\n height: propHeight,\n disableTextChildren: propDisableTextChildren,\n ...remaining\n } = props;\n\n const id = useEnsuredId(propId, \"option\");\n const {\n inputRef,\n currentValue,\n disableSelectedIcon,\n selectedIconAfter: contextSelectedIconAfter,\n } = useListboxContext();\n const selectedIconAfter = propSelectedIconAfter ?? contextSelectedIconAfter;\n const selected = value === currentValue;\n const selectedIcon = getIcon(\n \"selected\",\n disableSelectedIcon ? null : propSelectedIcon\n );\n const unselectedIcon = disableSelectedIcon\n ? null\n : propUnselectedIcon ?? DEFAULT_OPTION_UNSELECTED_ICON;\n const icon = selected ? selectedIcon : unselectedIcon;\n\n let leftAddon = propLeftAddon;\n let rightAddon = propRightAddon;\n let children = propChildren;\n let disableTextChildren = propDisableTextChildren;\n if (!selectedIconAfter && icon) {\n leftAddon = icon;\n if (propLeftAddon) {\n disableTextChildren = true;\n const Wrapper = propDisableTextChildren ? Fragment : ListItemText;\n\n children = (\n <TextIconSpacing {...textIconSpacingProps} icon={propLeftAddon}>\n <Wrapper>{children}</Wrapper>\n </TextIconSpacing>\n );\n }\n } else if (icon) {\n rightAddon = icon;\n if (propRightAddon) {\n disableTextChildren = true;\n const Wrapper = propDisableTextChildren ? Fragment : ListItemText;\n\n children = (\n <TextIconSpacing {...textIconSpacingProps} icon={propRightAddon}>\n <Wrapper>{children}</Wrapper>\n </TextIconSpacing>\n );\n }\n }\n\n const height = getListItemHeight({\n height: propHeight,\n leftAddon: leftAddon === icon ? null : leftAddon,\n leftAddonType,\n rightAddon: rightAddon === icon ? null : rightAddon,\n rightAddonType,\n secondaryText,\n });\n\n return (\n <MenuItem\n {...remaining}\n aria-selected={selected || undefined}\n id={id}\n ref={ref}\n role={role}\n onClick={(event) => {\n onClick(event);\n triggerManualChangeEvent(inputRef.current, value);\n }}\n className={option({ icon: !!icon, selected, className })}\n secondaryText={secondaryText}\n height={height}\n leftAddon={leftAddon}\n leftAddonType={leftAddonType}\n leftAddonClassName={cnb(\n leftAddon === icon && \"rmd-option__icon\",\n leftAddonClassName\n )}\n rightAddon={rightAddon}\n rightAddonType={rightAddonType}\n rightAddonClassName={cnb(\n rightAddon === icon && \"rmd-option__icon\",\n rightAddonClassName\n )}\n disableTextChildren={disableTextChildren}\n >\n {children}\n </MenuItem>\n );\n }\n);\n"],"names":["cnb","forwardRef","Fragment","getIcon","icon","TextIconSpacing","getListItemHeight","ListItemText","MenuItem","useEnsuredId","option","useListboxContext","triggerManualChangeEvent","noop","DEFAULT_OPTION_UNSELECTED_ICON","span","className","type","Option","props","ref","id","propId","role","value","children","propChildren","onClick","selectedIcon","propSelectedIcon","unselectedIcon","propUnselectedIcon","selectedIconAfter","propSelectedIconAfter","textIconSpacingProps","leftAddon","propLeftAddon","leftAddonType","leftAddonClassName","rightAddon","propRightAddon","rightAddonType","rightAddonClassName","secondaryText","height","propHeight","disableTextChildren","propDisableTextChildren","remaining","inputRef","currentValue","disableSelectedIcon","contextSelectedIconAfter","selected","Wrapper","aria-selected","undefined","event","current"],"mappings":"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"}
|
package/dist/form/Select.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { type ChangeEvent, type ReactElement, type ReactNode, type Ref } from "react";
|
|
1
|
+
import { type ChangeEvent, type HTMLAttributes, type InputHTMLAttributes, type ReactElement, type ReactNode, type Ref } from "react";
|
|
2
|
+
import { type BoxProps } from "../box/Box.js";
|
|
2
3
|
import { type MenuProps } from "../menu/Menu.js";
|
|
3
|
-
import { type
|
|
4
|
-
import { type
|
|
4
|
+
import { type LabelA11y, type PropsWithRef, type RequireAtLeastOne } from "../types.js";
|
|
5
|
+
import { type TextFieldContainerProps } from "./TextFieldContainer.js";
|
|
6
|
+
import { type UserAgentAutocompleteProps } from "./types.js";
|
|
5
7
|
/**
|
|
6
8
|
* This is a convenience type for casting the `event.currentTarget.value` of a
|
|
7
9
|
* `Select`'s change event to be union of available values.
|
|
@@ -53,14 +55,16 @@ export type SelectChangeEvent<Value extends string> = ChangeEvent<HTMLInputEleme
|
|
|
53
55
|
/**
|
|
54
56
|
* @remarks \@since 6.0.0 Rewritten with a new API.
|
|
55
57
|
*/
|
|
56
|
-
export interface SelectProps<Value extends string> extends Omit<
|
|
58
|
+
export interface SelectProps<Value extends string> extends Omit<TextFieldContainerProps, "label">, Pick<InputHTMLAttributes<HTMLInputElement>, "form" | "required">, UserAgentAutocompleteProps {
|
|
57
59
|
/**
|
|
58
|
-
*
|
|
59
|
-
* stores the current value. This is really only useful if you'd like to keep
|
|
60
|
-
* this component uncontrolled and access the value through
|
|
61
|
-
* `inputRef.current.value`.
|
|
60
|
+
* @defaultValue `"select-" + useId()`
|
|
62
61
|
*/
|
|
63
|
-
|
|
62
|
+
id?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Optional placeholder text or element to render while no options have been
|
|
65
|
+
* selected.
|
|
66
|
+
*/
|
|
67
|
+
placeholder?: ReactNode;
|
|
64
68
|
/**
|
|
65
69
|
* Set this to a custom dropdown icon or `null` to not render a dropdown icon.
|
|
66
70
|
*
|
|
@@ -81,6 +85,26 @@ export interface SelectProps<Value extends string> extends Omit<TextFieldProps,
|
|
|
81
85
|
defaultValue?: Value;
|
|
82
86
|
/** @see {@link SelectChangeEvent} */
|
|
83
87
|
onChange?(event: SelectChangeEvent<Value>): void;
|
|
88
|
+
/**
|
|
89
|
+
* An optional floating label to display like other form fields.
|
|
90
|
+
*/
|
|
91
|
+
label?: ReactNode;
|
|
92
|
+
/**
|
|
93
|
+
* Optional props to pass to the `<span>` that surrounds the {@link label}
|
|
94
|
+
*/
|
|
95
|
+
labelProps?: PropsWithRef<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>;
|
|
96
|
+
/**
|
|
97
|
+
* An optional ref to pass to the hidden `<input type="text" />` element that
|
|
98
|
+
* stores the current value. This is really only useful if you'd like to keep
|
|
99
|
+
* this component uncontrolled and access the value through
|
|
100
|
+
* `inputRef.current.value`.
|
|
101
|
+
*/
|
|
102
|
+
inputRef?: Ref<HTMLInputElement>;
|
|
103
|
+
inputProps?: InputHTMLAttributes<HTMLInputElement>;
|
|
104
|
+
/**
|
|
105
|
+
* A ref for the container `<div>` element.
|
|
106
|
+
*/
|
|
107
|
+
containerRef?: Ref<HTMLDivElement>;
|
|
84
108
|
/**
|
|
85
109
|
* Any additional props to provide to the `Menu` component that renders all
|
|
86
110
|
* the `Option`s.
|
|
@@ -88,25 +112,40 @@ export interface SelectProps<Value extends string> extends Omit<TextFieldProps,
|
|
|
88
112
|
* The menu will always have these default values unless explicity
|
|
89
113
|
* overwritten by this prop:
|
|
90
114
|
*
|
|
91
|
-
* - `aria-labelledby={
|
|
115
|
+
* - `aria-labelledby={label ? labelId : id}` -- this will be undefined if
|
|
116
|
+
* `aria-label` is provided
|
|
92
117
|
* - `anchor={BELOW_CENTER_ANCHOR}`
|
|
93
118
|
* - `width="min"`
|
|
94
119
|
*/
|
|
95
120
|
menuProps?: Omit<MenuProps, "visible" | "onRequestClose" | "fixedTo">;
|
|
96
121
|
/**
|
|
97
|
-
*
|
|
98
|
-
*
|
|
122
|
+
* Any additional props to pass to the div that contains the current visible
|
|
123
|
+
* option.
|
|
124
|
+
*/
|
|
125
|
+
selectedOptionProps?: BoxProps;
|
|
126
|
+
/**
|
|
127
|
+
* Set this to `true` if all the `Option` components should display the
|
|
128
|
+
* selected icon after the children instead of before.
|
|
129
|
+
*
|
|
130
|
+
* @see {@link disableSelectedIcon} to remove the selected icon instead.
|
|
99
131
|
*
|
|
100
132
|
* @defaultValue `false`
|
|
101
133
|
*/
|
|
102
|
-
|
|
134
|
+
selectedIconAfter?: boolean;
|
|
103
135
|
/**
|
|
104
136
|
* Set this to `true` to prevent the current option from rendering the
|
|
105
137
|
* `leftAddon` in the `TextFieldContainer`.
|
|
106
138
|
*
|
|
107
139
|
* @defaultValue `false`
|
|
108
140
|
*/
|
|
109
|
-
|
|
141
|
+
disableOptionAddon?: boolean;
|
|
142
|
+
/**
|
|
143
|
+
* Set this to `true` to update all the `Option` components to no longer
|
|
144
|
+
* render an icon while selected.
|
|
145
|
+
*
|
|
146
|
+
* @defaultValue `false`
|
|
147
|
+
*/
|
|
148
|
+
disableSelectedIcon?: boolean;
|
|
110
149
|
/**
|
|
111
150
|
* This should be the available `Option`s for the select to choose from. It
|
|
112
151
|
* can also contain `OptGroup` or any other elements but only clicking on an
|
|
@@ -117,6 +156,57 @@ export interface SelectProps<Value extends string> extends Omit<TextFieldProps,
|
|
|
117
156
|
/**
|
|
118
157
|
* **Client Component**
|
|
119
158
|
*
|
|
159
|
+
* @example
|
|
160
|
+
* Simple Example
|
|
161
|
+
* ```tsx
|
|
162
|
+
* import { Select, Option } from "react-md";
|
|
163
|
+
* import { useState, type ReactElement } from "react";
|
|
164
|
+
*
|
|
165
|
+
* function Example(): ReactElement {
|
|
166
|
+
* const [value, setValue] = useState("");
|
|
167
|
+
*
|
|
168
|
+
* return (
|
|
169
|
+
* <Select
|
|
170
|
+
* label="Select"
|
|
171
|
+
* value={value}
|
|
172
|
+
* onChange={(event) => setValue(event.currentTarget.value)}
|
|
173
|
+
* placeholder="Select a value"
|
|
174
|
+
* >
|
|
175
|
+
* <Option value="a">Option 1</Option>
|
|
176
|
+
* <Option value="b">Option 2</Option>
|
|
177
|
+
* <Option value="c">Option 3</Option>
|
|
178
|
+
* <Option value="d">Option 4</Option>
|
|
179
|
+
* </Select>
|
|
180
|
+
* );
|
|
181
|
+
* }
|
|
182
|
+
* ```
|
|
183
|
+
*
|
|
184
|
+
* @example
|
|
185
|
+
* Testing
|
|
186
|
+
* ```tsx
|
|
187
|
+
* rmdRender(
|
|
188
|
+
* <Select label="Select" selectedOptionProps={{ "data-testid": "selected" }}>
|
|
189
|
+
* <Option value="a">Option 1</Option>
|
|
190
|
+
* <Option value="b">Option 2</Option>
|
|
191
|
+
* <Option value="c">Option 3</Option>
|
|
192
|
+
* <Option value="d">Option 4</Option>
|
|
193
|
+
* </Select>
|
|
194
|
+
* );
|
|
195
|
+
*
|
|
196
|
+
* const user = userEvent.setup();
|
|
197
|
+
* const select = screen.getByRole("combobox", { name: "Select" });
|
|
198
|
+
* const selected = screen.getByTestId("selected")
|
|
199
|
+
* const selectInput = screen.getByRole("textbox", { hidden: true });
|
|
200
|
+
* expect(selected).toHaveTextContent("");
|
|
201
|
+
* expect(selectInput).toHaveValue("");
|
|
202
|
+
*
|
|
203
|
+
* await user.click(select);
|
|
204
|
+
* await user.click(screen.getByRole("option"), { name: "Option 2" });
|
|
205
|
+
*
|
|
206
|
+
* expect(selected).toHaveTextContent("Option 2");
|
|
207
|
+
* expect(selectInput).toHaveValue("b");
|
|
208
|
+
* ```
|
|
209
|
+
*
|
|
120
210
|
* @remarks \@since 6.0.0 Rewritten with a new API.
|
|
121
211
|
*/
|
|
122
|
-
export declare function Select<Value extends string>(props: SelectProps<Value>): ReactElement;
|
|
212
|
+
export declare function Select<Value extends string>(props: RequireAtLeastOne<SelectProps<Value>, "label" | keyof LabelA11y>): ReactElement;
|