@react-md/core 1.0.0-next.4 → 1.0.0-next.6
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/.turbo/turbo-build.log +5 -5
- package/CHANGELOG.md +12 -0
- package/dist/CoreProviders.js.map +1 -0
- package/dist/NoSsr.js.map +1 -0
- package/dist/SsrProvider.js.map +1 -0
- package/dist/_core.scss +157 -240
- package/dist/_utils.scss +10 -0
- package/dist/app-bar/AppBar.js.map +1 -0
- package/dist/app-bar/AppBarTitle.js.map +1 -0
- package/dist/app-bar/_app-bar.scss +95 -93
- package/dist/avatar/Avatar.js.map +1 -0
- package/dist/avatar/_avatar.scss +49 -47
- package/dist/avatar/styles.js.map +1 -0
- package/dist/badge/Badge.js.map +1 -0
- package/dist/badge/_badge.scss +19 -17
- package/dist/box/Box.js.map +1 -0
- package/dist/box/_box.scss +57 -55
- package/dist/box/styles.js.map +1 -0
- package/dist/button/AsyncButton.js.map +1 -0
- package/dist/button/Button.js.map +1 -0
- package/dist/button/ButtonUnstyled.js.map +1 -0
- package/dist/button/FloatingActionButton.js.map +1 -0
- package/dist/button/TooltippedButton.js.map +1 -0
- package/dist/button/_button.scss +122 -120
- package/dist/button/buttonStyles.js.map +1 -0
- package/dist/button/buttonUnstyledStyles.js.map +1 -0
- package/dist/card/Card.js.map +1 -0
- package/dist/card/CardContent.js.map +1 -0
- package/dist/card/CardFooter.js.map +1 -0
- package/dist/card/CardHeader.js.map +1 -0
- package/dist/card/CardSubtitle.js.map +1 -0
- package/dist/card/CardTitle.js.map +1 -0
- package/dist/card/ClickableCard.js.map +1 -0
- package/dist/card/_card.scss +72 -70
- package/dist/card/styles.js.map +1 -0
- package/dist/chip/Chip.js.map +1 -0
- package/dist/chip/_chip.scss +105 -103
- package/dist/chip/styles.js.map +1 -0
- package/dist/cssUtils.js.map +1 -0
- package/dist/delegateEvent.js.map +1 -0
- package/dist/dialog/Dialog.js.map +1 -0
- package/dist/dialog/DialogContainer.js.map +1 -0
- package/dist/dialog/DialogContent.js.map +1 -0
- package/dist/dialog/DialogFooter.js.map +1 -0
- package/dist/dialog/DialogHeader.js.map +1 -0
- package/dist/dialog/DialogTitle.js.map +1 -0
- package/dist/dialog/FixedDialog.js.map +1 -0
- package/dist/dialog/NestedDialogProvider.js.map +1 -0
- package/dist/dialog/_dialog.scss +128 -126
- package/dist/dialog/styles.js.map +1 -0
- package/dist/divider/Divider.js.map +1 -0
- package/dist/divider/_divider.scss +24 -22
- package/dist/divider/styles.js.map +1 -0
- package/dist/draggable/_draggable.scss +16 -12
- package/dist/draggable/useDraggable.js.map +1 -0
- package/dist/draggable/utils.js.map +1 -0
- package/dist/expansion-panel/ExpansionList.js.map +1 -0
- package/dist/expansion-panel/ExpansionPanel.js.map +1 -0
- package/dist/expansion-panel/ExpansionPanelHeader.js.map +1 -0
- package/dist/expansion-panel/_expansion-panel.scss +69 -52
- package/dist/expansion-panel/useExpansionList.js.map +1 -0
- package/dist/expansion-panel/useExpansionPanels.js.map +1 -0
- package/dist/focus/useFocusContainer.js.map +1 -0
- package/dist/focus/utils.js.map +1 -0
- package/dist/form/Checkbox.js.map +1 -0
- package/dist/form/Fieldset.js.map +1 -0
- package/dist/form/FileInput.js.map +1 -0
- package/dist/form/Form.d.ts +1 -1
- package/dist/form/Form.js +28 -0
- package/dist/form/Form.js.map +1 -0
- package/dist/form/FormMessage.js.map +1 -0
- package/dist/form/FormMessageContainer.js.map +1 -0
- package/dist/form/FormMessageCounter.js.map +1 -0
- package/dist/form/InputToggle.js.map +1 -0
- package/dist/form/InputToggleIcon.js.map +1 -0
- package/dist/form/Label.js.map +1 -0
- package/dist/form/Legend.js.map +1 -0
- package/dist/form/MenuItemCheckbox.js.map +1 -0
- package/dist/form/MenuItemFileInput.js.map +1 -0
- package/dist/form/MenuItemInputToggle.js.map +1 -0
- package/dist/form/MenuItemRadio.js.map +1 -0
- package/dist/form/MenuItemSwitch.js.map +1 -0
- package/dist/form/MenuItemTextField.js.map +1 -0
- package/dist/form/NativeSelect.js.map +1 -0
- package/dist/form/OptGroup.js.map +1 -0
- package/dist/form/Option.js.map +1 -0
- package/dist/form/Password.js.map +1 -0
- package/dist/form/Radio.js.map +1 -0
- package/dist/form/Select.js.map +1 -0
- package/dist/form/SelectValue.js.map +1 -0
- package/dist/form/Slider.js.map +1 -0
- package/dist/form/SliderContainer.js.map +1 -0
- package/dist/form/SliderMark.js.map +1 -0
- package/dist/form/SliderMarkLabel.js.map +1 -0
- package/dist/form/SliderThumb.js.map +1 -0
- package/dist/form/SliderTrack.js.map +1 -0
- package/dist/form/SliderValueMarks.js.map +1 -0
- package/dist/form/SliderValueTooltip.js.map +1 -0
- package/dist/form/Switch.js.map +1 -0
- package/dist/form/SwitchTrack.js.map +1 -0
- package/dist/form/TextArea.js.map +1 -0
- package/dist/form/TextField.js.map +1 -0
- package/dist/form/TextFieldAddon.js.map +1 -0
- package/dist/form/TextFieldContainer.js.map +1 -0
- package/dist/form/TextFieldContainerStyles.js.map +1 -0
- package/dist/form/_form.scss +1175 -1127
- package/dist/form/fileUtils.js.map +1 -0
- package/dist/form/formConfig.js.map +1 -0
- package/dist/form/formMessageStyles.js.map +1 -0
- package/dist/form/inputToggleStyles.js.map +1 -0
- package/dist/form/nativeSelectStyles.js.map +1 -0
- package/dist/form/optionStyles.js.map +1 -0
- package/dist/form/passwordStyles.js.map +1 -0
- package/dist/form/selectStyles.js.map +1 -0
- package/dist/form/selectUtils.js.map +1 -0
- package/dist/form/sliderUtils.js.map +1 -0
- package/dist/form/switchStyles.js.map +1 -0
- package/dist/form/textAreaStyles.js.map +1 -0
- package/dist/form/textFieldStyles.js.map +1 -0
- package/dist/form/types.js.map +1 -0
- package/dist/form/useCheckboxGroup.js.map +1 -0
- package/dist/form/useFileUpload.js.map +1 -0
- package/dist/form/useListboxProvider.js.map +1 -0
- package/dist/form/useNumberField.js.map +1 -0
- package/dist/form/useRadioGroup.js.map +1 -0
- package/dist/form/useRangeSlider.js.map +1 -0
- package/dist/form/useResizingTextArea.js.map +1 -0
- package/dist/form/useSlider.js.map +1 -0
- package/dist/form/useTextField.js.map +1 -0
- package/dist/form/utils.js.map +1 -0
- package/dist/form/validation.js.map +1 -0
- package/dist/hoverMode/useHoverMode.js.map +1 -0
- package/dist/hoverMode/useHoverModeProvider.js.map +1 -0
- package/dist/icon/FontIcon.js.map +1 -0
- package/dist/icon/IconRotator.js.map +1 -0
- package/dist/icon/MaterialIcon.js.map +1 -0
- package/dist/icon/MaterialSymbol.js.map +1 -0
- package/dist/icon/SVGIcon.js.map +1 -0
- package/dist/icon/TextIconSpacing.js.map +1 -0
- package/dist/icon/_icon.scss +64 -62
- package/dist/icon/iconConfig.js.map +1 -0
- package/dist/icon/material.js.map +1 -0
- package/dist/icon/materialConfig.js.map +1 -0
- package/dist/icon/styles.js.map +1 -0
- package/dist/index.js.map +1 -0
- package/dist/interaction/Ripple.js.map +1 -0
- package/dist/interaction/RippleContainer.js.map +1 -0
- package/dist/interaction/UserInteractionModeProvider.js.map +1 -0
- package/dist/interaction/_interaction.scss +39 -35
- package/dist/interaction/config.js.map +1 -0
- package/dist/interaction/types.js.map +1 -0
- package/dist/interaction/useElementInteraction.js.map +1 -0
- package/dist/interaction/useHigherContrastChildren.js.map +1 -0
- package/dist/interaction/utils.js.map +1 -0
- package/dist/layout/LayoutAppBar.js.map +1 -0
- package/dist/layout/LayoutNav.js.map +1 -0
- package/dist/layout/LayoutWindowSplitter.js.map +1 -0
- package/dist/layout/Main.js.map +1 -0
- package/dist/layout/_layout.scss +68 -67
- package/dist/layout/layoutNavStyles.js.map +1 -0
- package/dist/layout/layoutWindowSplitterStyles.js.map +1 -0
- package/dist/layout/mainStyles.js.map +1 -0
- package/dist/layout/useExpandableLayout.js.map +1 -0
- package/dist/layout/useHorizontalLayoutTransition.js.map +1 -0
- package/dist/layout/useLayoutAppBarHeight.js.map +1 -0
- package/dist/layout/useLayoutTree.js.map +1 -0
- package/dist/layout/useLayoutWindowSplitter.js.map +1 -0
- package/dist/layout/useMainTabIndex.js.map +1 -0
- package/dist/layout/useResizableLayout.js.map +1 -0
- package/dist/layout/useTemporaryLayout.js.map +1 -0
- package/dist/link/Link.js.map +1 -0
- package/dist/link/SkipToMainContent.js.map +1 -0
- package/dist/link/_link.scss +52 -50
- package/dist/link/styles.js.map +1 -0
- package/dist/list/List.js.map +1 -0
- package/dist/list/ListItem.js.map +1 -0
- package/dist/list/ListItemAddon.js.map +1 -0
- package/dist/list/ListItemChildren.js.map +1 -0
- package/dist/list/ListItemLink.js.map +1 -0
- package/dist/list/ListItemText.js.map +1 -0
- package/dist/list/ListSubheader.js.map +1 -0
- package/dist/list/_list.scss +124 -122
- package/dist/list/getListItemHeight.js.map +1 -0
- package/dist/list/listItemStyles.js.map +1 -0
- package/dist/list/types.js.map +1 -0
- package/dist/media-queries/AppSizeProvider.js.map +1 -0
- package/dist/media-queries/appSize.js.map +1 -0
- package/dist/media-queries/useMediaQuery.js.map +1 -0
- package/dist/menu/DropdownMenu.js.map +1 -0
- package/dist/menu/Menu.js.map +1 -0
- package/dist/menu/MenuBar.js.map +1 -0
- package/dist/menu/MenuButton.js.map +1 -0
- package/dist/menu/MenuConfigurationProvider.js.map +1 -0
- package/dist/menu/MenuItem.js.map +1 -0
- package/dist/menu/MenuItemButton.js.map +1 -0
- package/dist/menu/MenuItemGroup.js.map +1 -0
- package/dist/menu/MenuItemSeparator.js.map +1 -0
- package/dist/menu/MenuSheet.js.map +1 -0
- package/dist/menu/MenuVisibilityProvider.js.map +1 -0
- package/dist/menu/MenuWidget.js.map +1 -0
- package/dist/menu/MenuWidgetKeyboardProvider.js.map +1 -0
- package/dist/menu/_menu.scss +9 -7
- package/dist/menu/useContextMenu.js.map +1 -0
- package/dist/menu/useMenuBarProvider.js.map +1 -0
- package/dist/menu/utils.js.map +1 -0
- package/dist/movement/constants.js.map +1 -0
- package/dist/movement/findMatchIndex.js.map +1 -0
- package/dist/movement/types.js.map +1 -0
- package/dist/movement/useKeyboardMovementProvider.js.map +1 -0
- package/dist/movement/utils.js.map +1 -0
- package/dist/overlay/Overlay.js.map +1 -0
- package/dist/overlay/_overlay.scss +25 -23
- package/dist/overlay/overlayStyles.js.map +1 -0
- package/dist/portal/Portal.js.map +1 -0
- package/dist/portal/PortalContainerProvider.js.map +1 -0
- package/dist/positioning/constants.js.map +1 -0
- package/dist/positioning/createHorizontalPosition.js.map +1 -0
- package/dist/positioning/createVerticalPosition.js.map +1 -0
- package/dist/positioning/getFixedPosition.js.map +1 -0
- package/dist/positioning/types.js.map +1 -0
- package/dist/positioning/useFixedPositioning.js.map +1 -0
- package/dist/positioning/utils.js.map +1 -0
- package/dist/progress/CircularProgress.js.map +1 -0
- package/dist/progress/LinearProgress.js.map +1 -0
- package/dist/progress/_progress.scss +11 -6
- package/dist/progress/getProgressA11y.js.map +1 -0
- package/dist/progress/types.js.map +1 -0
- package/dist/responsive-item/ResponsiveItemContainer.js.map +1 -0
- package/dist/responsive-item/ResponsiveItemOverlay.js.map +1 -0
- package/dist/responsive-item/_responsive-item.scss +91 -89
- package/dist/responsive-item/styles.js.map +1 -0
- package/dist/scroll/ScrollLock.js.map +1 -0
- package/dist/scroll/getScrollbarWidth.js.map +1 -0
- package/dist/scroll/useScrollLock.js.map +1 -0
- package/dist/segmented-button/SegmentedButton.js.map +1 -0
- package/dist/segmented-button/SegmentedButtonContainer.js.map +1 -0
- package/dist/segmented-button/_segmented-button.scss +54 -49
- package/dist/segmented-button/segmentedButtonContainerStyles.js.map +1 -0
- package/dist/segmented-button/segmentedButtonStyles.js.map +1 -0
- package/dist/sheet/Sheet.js.map +1 -0
- package/dist/sheet/_sheet.scss +84 -82
- package/dist/sheet/styles.js.map +1 -0
- package/dist/snackbar/DefaultToastRenderer.js.map +1 -0
- package/dist/snackbar/Snackbar.js.map +1 -0
- package/dist/snackbar/Toast.js.map +1 -0
- package/dist/snackbar/ToastActionButton.js.map +1 -0
- package/dist/snackbar/ToastCloseButton.js.map +1 -0
- package/dist/snackbar/ToastContent.js.map +1 -0
- package/dist/snackbar/ToastManager.js.map +1 -0
- package/dist/snackbar/ToastManagerProvider.js.map +1 -0
- package/dist/snackbar/_snackbar.scss +128 -123
- package/dist/snackbar/snackbarStyles.js.map +1 -0
- package/dist/snackbar/toastContentStyles.js.map +1 -0
- package/dist/snackbar/toastStyles.js.map +1 -0
- package/dist/snackbar/useCurrentToastActions.js.map +1 -0
- package/dist/suspense/CircularProgressSuspense.js.map +1 -0
- package/dist/suspense/NullSuspense.js.map +1 -0
- package/dist/table/Table.js.map +1 -0
- package/dist/table/TableBody.js.map +1 -0
- package/dist/table/TableCell.js.map +1 -0
- package/dist/table/TableCellContent.js.map +1 -0
- package/dist/table/TableCheckbox.js.map +1 -0
- package/dist/table/TableConfigurationProvider.js.map +1 -0
- package/dist/table/TableContainer.js.map +1 -0
- package/dist/table/TableContainerProvider.js.map +1 -0
- package/dist/table/TableFooter.js.map +1 -0
- package/dist/table/TableHeader.js.map +1 -0
- package/dist/table/TableRadio.js.map +1 -0
- package/dist/table/TableRow.js.map +1 -0
- package/dist/table/_table.scss +159 -157
- package/dist/table/tableCellStyles.js.map +1 -0
- package/dist/table/tableContainerStyles.js.map +1 -0
- package/dist/table/tableFooterStyles.js.map +1 -0
- package/dist/table/tableHeaderStyles.js.map +1 -0
- package/dist/table/tableRowStyles.js.map +1 -0
- package/dist/table/tableStyles.js.map +1 -0
- package/dist/table/types.js.map +1 -0
- package/dist/tabs/Tab.js.map +1 -0
- package/dist/tabs/TabList.js.map +1 -0
- package/dist/tabs/TabListScrollButton.js.map +1 -0
- package/dist/tabs/_tabs.scss +10 -8
- package/dist/tabs/tabIndicatorStyles.js.map +1 -0
- package/dist/tabs/tabListScrollButtonStyles.js.map +1 -0
- package/dist/tabs/tabListStyles.js.map +1 -0
- package/dist/tabs/tabStyles.js.map +1 -0
- package/dist/tabs/useTabList.js.map +1 -0
- package/dist/tabs/useTabs.js.map +1 -0
- package/dist/tabs/utils.js.map +1 -0
- package/dist/test-utils/IntersectionObserver.js.map +1 -0
- package/dist/test-utils/ResizeObserver.js.map +1 -0
- package/dist/test-utils/data-testid.js.map +1 -0
- package/dist/test-utils/index.js.map +1 -0
- package/dist/test-utils/jest-setup.js.map +1 -0
- package/dist/test-utils/matchMedia.js.map +1 -0
- package/dist/test-utils/polyfills/IntersectionObserver.js.map +1 -0
- package/dist/test-utils/polyfills/ResizeObserver.js.map +1 -0
- package/dist/test-utils/polyfills/index.js.map +1 -0
- package/dist/test-utils/polyfills/matchMedia.js.map +1 -0
- package/dist/test-utils/polyfills/offsetParent.js.map +1 -0
- package/dist/test-utils/polyfills/scrollIntoView.js.map +1 -0
- package/dist/test-utils/render.js.map +1 -0
- package/dist/test-utils/timers.js.map +1 -0
- package/dist/theme/LocalStorageColorSchemeProvider.js.map +1 -0
- package/dist/theme/ThemeProvider.js.map +1 -0
- package/dist/theme/colors.js.map +1 -0
- package/dist/theme/cssVars.js.map +1 -0
- package/dist/theme/types.js.map +1 -0
- package/dist/theme/useCSSVariables.js.map +1 -0
- package/dist/theme/useColorScheme.js.map +1 -0
- package/dist/theme/useColorSchemeMetaTag.js.map +1 -0
- package/dist/theme/useColorSchemeProvider.js.map +1 -0
- package/dist/theme/usePrefersColorScheme.js.map +1 -0
- package/dist/theme/utils.js.map +1 -0
- package/dist/tooltip/Tooltip.js.map +1 -0
- package/dist/tooltip/TooltipHoverModeProvider.js.map +1 -0
- package/dist/tooltip/_tooltip.scss +60 -58
- package/dist/tooltip/constants.js.map +1 -0
- package/dist/tooltip/tooltipStyles.js.map +1 -0
- package/dist/tooltip/useTooltip.js.map +1 -0
- package/dist/tooltip/useTooltipPosition.js.map +1 -0
- package/dist/tooltip/utils.js.map +1 -0
- package/dist/transition/CSSTransition.js.map +1 -0
- package/dist/transition/Collapse.js.map +1 -0
- package/dist/transition/CrossFade.js.map +1 -0
- package/dist/transition/ScaleTransition.js.map +1 -0
- package/dist/transition/SkeletonPlaceholder.js.map +1 -0
- package/dist/transition/Slide.js.map +1 -0
- package/dist/transition/SlideContainer.js.map +1 -0
- package/dist/transition/_transition.scss +44 -39
- package/dist/transition/collapseStyles.js.map +1 -0
- package/dist/transition/config.js.map +1 -0
- package/dist/transition/maxWidthTransition.js.map +1 -0
- package/dist/transition/skeletonPlaceholderUtils.js.map +1 -0
- package/dist/transition/types.js.map +1 -0
- package/dist/transition/useCSSTransition.js.map +1 -0
- package/dist/transition/useCarousel.js.map +1 -0
- package/dist/transition/useCollapseTransition.js.map +1 -0
- package/dist/transition/useCrossFadeTransition.js.map +1 -0
- package/dist/transition/useMaxWidthTransition.js.map +1 -0
- package/dist/transition/useScaleTransition.js.map +1 -0
- package/dist/transition/useSkeletonPlaceholder.js.map +1 -0
- package/dist/transition/useSlideTransition.js.map +1 -0
- package/dist/transition/useTransition.js.map +1 -0
- package/dist/transition/utils.js.map +1 -0
- package/dist/tree/DefaultTreeItemRenderer.js.map +1 -0
- package/dist/tree/Tree.js.map +1 -0
- package/dist/tree/TreeGroup.js.map +1 -0
- package/dist/tree/TreeItem.js.map +1 -0
- package/dist/tree/TreeItemExpander.js.map +1 -0
- package/dist/tree/TreeProvider.js.map +1 -0
- package/dist/tree/_tree.scss +83 -81
- package/dist/tree/styles.js.map +1 -0
- package/dist/tree/types.js.map +1 -0
- package/dist/tree/useTree.js.map +1 -0
- package/dist/tree/useTreeExpansion.js.map +1 -0
- package/dist/tree/useTreeItems.js.map +1 -0
- package/dist/tree/useTreeMovement.js.map +1 -0
- package/dist/tree/useTreeSelection.js.map +1 -0
- package/dist/tree/utils.js.map +1 -0
- package/dist/types.js.map +1 -0
- package/dist/typography/SrOnly.js.map +1 -0
- package/dist/typography/TextContainer.js.map +1 -0
- package/dist/typography/Typography.js.map +1 -0
- package/dist/typography/WritingDirectionProvider.js.map +1 -0
- package/dist/typography/_typography.scss +58 -49
- package/dist/useAsyncAction.js.map +1 -0
- package/dist/useDebouncedFunction.js.map +1 -0
- package/dist/useDropzone.js.map +1 -0
- package/dist/useElementSize.js.map +1 -0
- package/dist/useEnsuredId.js.map +1 -0
- package/dist/useEnsuredRef.js.map +1 -0
- package/dist/useEnsuredState.js.map +1 -0
- package/dist/useHtmlClassName.js.map +1 -0
- package/dist/useIntersectionObserver.js.map +1 -0
- package/dist/useIsomorphicLayoutEffect.js.map +1 -0
- package/dist/useLocalStorage.js.map +1 -0
- package/dist/useOrientation.js.map +1 -0
- package/dist/usePageInactive.js.map +1 -0
- package/dist/useResizeListener.js.map +1 -0
- package/dist/useResizeObserver.js.map +1 -0
- package/dist/useThrottledFunction.js.map +1 -0
- package/dist/useToggle.js.map +1 -0
- package/dist/useUnmounted.js.map +1 -0
- package/dist/useWindowSize.js.map +1 -0
- package/dist/utils/RenderRecursively.js.map +1 -0
- package/dist/utils/alphaNumericSort.js.map +1 -0
- package/dist/utils/applyRef.js.map +1 -0
- package/dist/utils/bem.js.map +1 -0
- package/dist/utils/filters.js.map +1 -0
- package/dist/utils/getClientPosition.js.map +1 -0
- package/dist/utils/getMiddleOfRange.js.map +1 -0
- package/dist/utils/getPercentage.js.map +1 -0
- package/dist/utils/getRangeDefaultValue.js.map +1 -0
- package/dist/utils/getRangeSteps.js.map +1 -0
- package/dist/utils/identity.js.map +1 -0
- package/dist/utils/isElementVisible.js.map +1 -0
- package/dist/utils/loop.js.map +1 -0
- package/dist/utils/nearest.js.map +1 -0
- package/dist/utils/parseCssLengthUnit.js.map +1 -0
- package/dist/utils/randomInt.js.map +1 -0
- package/dist/utils/wait.js.map +1 -0
- package/dist/utils/withinRange.js.map +1 -0
- package/dist/window-splitter/WindowSplitter.js.map +1 -0
- package/dist/window-splitter/_window-splitter.scss +72 -70
- package/dist/window-splitter/useWindowSplitter.js.map +1 -0
- package/package.json +2 -2
- package/src/_core.scss +157 -240
- package/src/_utils.scss +10 -0
- package/src/app-bar/_app-bar.scss +95 -93
- package/src/avatar/_avatar.scss +49 -47
- package/src/badge/_badge.scss +19 -17
- package/src/box/_box.scss +57 -55
- package/src/button/_button.scss +122 -120
- package/src/card/_card.scss +72 -70
- package/src/chip/_chip.scss +105 -103
- package/src/dialog/_dialog.scss +128 -126
- package/src/divider/_divider.scss +24 -22
- package/src/draggable/_draggable.scss +16 -12
- package/src/expansion-panel/_expansion-panel.scss +69 -52
- package/src/form/Form.tsx +2 -1
- package/src/form/_form.scss +1175 -1127
- package/src/icon/_icon.scss +64 -62
- package/src/interaction/_interaction.scss +39 -35
- package/src/layout/_layout.scss +68 -67
- package/src/link/_link.scss +52 -50
- package/src/list/_list.scss +124 -122
- package/src/menu/_menu.scss +9 -7
- package/src/overlay/_overlay.scss +25 -23
- package/src/progress/_progress.scss +11 -6
- package/src/responsive-item/_responsive-item.scss +91 -89
- package/src/segmented-button/_segmented-button.scss +54 -49
- package/src/sheet/_sheet.scss +84 -82
- package/src/snackbar/_snackbar.scss +128 -123
- package/src/table/_table.scss +159 -157
- package/src/tabs/_tabs.scss +10 -8
- package/src/tooltip/_tooltip.scss +60 -58
- package/src/transition/_transition.scss +44 -39
- package/src/tree/_tree.scss +83 -81
- package/src/typography/_typography.scss +58 -49
- package/src/window-splitter/_window-splitter.scss +72 -70
- package/tsconfig.json +2 -2
- package/.turbo/turbo-lint.log +0 -12
- package/.turbo/turbo-test.log +0 -179
- package/.turbo/turbo-typecheck.log +0 -4
- package/dist/src/CoreProviders.js.map +0 -1
- package/dist/src/NoSsr.js.map +0 -1
- package/dist/src/SsrProvider.js.map +0 -1
- package/dist/src/app-bar/AppBar.js.map +0 -1
- package/dist/src/app-bar/AppBarTitle.js.map +0 -1
- package/dist/src/avatar/Avatar.js.map +0 -1
- package/dist/src/avatar/styles.js.map +0 -1
- package/dist/src/badge/Badge.js.map +0 -1
- package/dist/src/box/Box.js.map +0 -1
- package/dist/src/box/styles.js.map +0 -1
- package/dist/src/button/AsyncButton.js.map +0 -1
- package/dist/src/button/Button.js.map +0 -1
- package/dist/src/button/ButtonUnstyled.js.map +0 -1
- package/dist/src/button/FloatingActionButton.js.map +0 -1
- package/dist/src/button/TooltippedButton.js.map +0 -1
- package/dist/src/button/buttonStyles.js.map +0 -1
- package/dist/src/button/buttonUnstyledStyles.js.map +0 -1
- package/dist/src/card/Card.js.map +0 -1
- package/dist/src/card/CardContent.js.map +0 -1
- package/dist/src/card/CardFooter.js.map +0 -1
- package/dist/src/card/CardHeader.js.map +0 -1
- package/dist/src/card/CardSubtitle.js.map +0 -1
- package/dist/src/card/CardTitle.js.map +0 -1
- package/dist/src/card/ClickableCard.js.map +0 -1
- package/dist/src/card/styles.js.map +0 -1
- package/dist/src/chip/Chip.js.map +0 -1
- package/dist/src/chip/styles.js.map +0 -1
- package/dist/src/cssUtils.js.map +0 -1
- package/dist/src/delegateEvent.js.map +0 -1
- package/dist/src/dialog/Dialog.js.map +0 -1
- package/dist/src/dialog/DialogContainer.js.map +0 -1
- package/dist/src/dialog/DialogContent.js.map +0 -1
- package/dist/src/dialog/DialogFooter.js.map +0 -1
- package/dist/src/dialog/DialogHeader.js.map +0 -1
- package/dist/src/dialog/DialogTitle.js.map +0 -1
- package/dist/src/dialog/FixedDialog.js.map +0 -1
- package/dist/src/dialog/NestedDialogProvider.js.map +0 -1
- package/dist/src/dialog/styles.js.map +0 -1
- package/dist/src/divider/Divider.js.map +0 -1
- package/dist/src/divider/styles.js.map +0 -1
- package/dist/src/draggable/useDraggable.js.map +0 -1
- package/dist/src/draggable/utils.js.map +0 -1
- package/dist/src/expansion-panel/ExpansionList.js.map +0 -1
- package/dist/src/expansion-panel/ExpansionPanel.js.map +0 -1
- package/dist/src/expansion-panel/ExpansionPanelHeader.js.map +0 -1
- package/dist/src/expansion-panel/useExpansionList.js.map +0 -1
- package/dist/src/expansion-panel/useExpansionPanels.js.map +0 -1
- package/dist/src/focus/useFocusContainer.js.map +0 -1
- package/dist/src/focus/utils.js.map +0 -1
- package/dist/src/form/Checkbox.js.map +0 -1
- package/dist/src/form/Fieldset.js.map +0 -1
- package/dist/src/form/FileInput.js.map +0 -1
- package/dist/src/form/Form.js +0 -27
- package/dist/src/form/Form.js.map +0 -1
- package/dist/src/form/FormMessage.js.map +0 -1
- package/dist/src/form/FormMessageContainer.js.map +0 -1
- package/dist/src/form/FormMessageCounter.js.map +0 -1
- package/dist/src/form/InputToggle.js.map +0 -1
- package/dist/src/form/InputToggleIcon.js.map +0 -1
- package/dist/src/form/Label.js.map +0 -1
- package/dist/src/form/Legend.js.map +0 -1
- package/dist/src/form/MenuItemCheckbox.js.map +0 -1
- package/dist/src/form/MenuItemFileInput.js.map +0 -1
- package/dist/src/form/MenuItemInputToggle.js.map +0 -1
- package/dist/src/form/MenuItemRadio.js.map +0 -1
- package/dist/src/form/MenuItemSwitch.js.map +0 -1
- package/dist/src/form/MenuItemTextField.js.map +0 -1
- package/dist/src/form/NativeSelect.js.map +0 -1
- package/dist/src/form/OptGroup.js.map +0 -1
- package/dist/src/form/Option.js.map +0 -1
- package/dist/src/form/Password.js.map +0 -1
- package/dist/src/form/Radio.js.map +0 -1
- package/dist/src/form/Select.js.map +0 -1
- package/dist/src/form/SelectValue.js.map +0 -1
- package/dist/src/form/Slider.js.map +0 -1
- package/dist/src/form/SliderContainer.js.map +0 -1
- package/dist/src/form/SliderMark.js.map +0 -1
- package/dist/src/form/SliderMarkLabel.js.map +0 -1
- package/dist/src/form/SliderThumb.js.map +0 -1
- package/dist/src/form/SliderTrack.js.map +0 -1
- package/dist/src/form/SliderValueMarks.js.map +0 -1
- package/dist/src/form/SliderValueTooltip.js.map +0 -1
- package/dist/src/form/Switch.js.map +0 -1
- package/dist/src/form/SwitchTrack.js.map +0 -1
- package/dist/src/form/TextArea.js.map +0 -1
- package/dist/src/form/TextField.js.map +0 -1
- package/dist/src/form/TextFieldAddon.js.map +0 -1
- package/dist/src/form/TextFieldContainer.js.map +0 -1
- package/dist/src/form/TextFieldContainerStyles.js.map +0 -1
- package/dist/src/form/fileUtils.js.map +0 -1
- package/dist/src/form/formConfig.js.map +0 -1
- package/dist/src/form/formMessageStyles.js.map +0 -1
- package/dist/src/form/inputToggleStyles.js.map +0 -1
- package/dist/src/form/nativeSelectStyles.js.map +0 -1
- package/dist/src/form/optionStyles.js.map +0 -1
- package/dist/src/form/passwordStyles.js.map +0 -1
- package/dist/src/form/selectStyles.js.map +0 -1
- package/dist/src/form/selectUtils.js.map +0 -1
- package/dist/src/form/sliderUtils.js.map +0 -1
- package/dist/src/form/switchStyles.js.map +0 -1
- package/dist/src/form/textAreaStyles.js.map +0 -1
- package/dist/src/form/textFieldStyles.js.map +0 -1
- package/dist/src/form/types.js.map +0 -1
- package/dist/src/form/useCheckboxGroup.js.map +0 -1
- package/dist/src/form/useFileUpload.js.map +0 -1
- package/dist/src/form/useListboxProvider.js.map +0 -1
- package/dist/src/form/useNumberField.js.map +0 -1
- package/dist/src/form/useRadioGroup.js.map +0 -1
- package/dist/src/form/useRangeSlider.js.map +0 -1
- package/dist/src/form/useResizingTextArea.js.map +0 -1
- package/dist/src/form/useSlider.js.map +0 -1
- package/dist/src/form/useTextField.js.map +0 -1
- package/dist/src/form/utils.js.map +0 -1
- package/dist/src/form/validation.js.map +0 -1
- package/dist/src/hoverMode/useHoverMode.js.map +0 -1
- package/dist/src/hoverMode/useHoverModeProvider.js.map +0 -1
- package/dist/src/icon/FontIcon.js.map +0 -1
- package/dist/src/icon/IconRotator.js.map +0 -1
- package/dist/src/icon/MaterialIcon.js.map +0 -1
- package/dist/src/icon/MaterialSymbol.js.map +0 -1
- package/dist/src/icon/SVGIcon.js.map +0 -1
- package/dist/src/icon/TextIconSpacing.js.map +0 -1
- package/dist/src/icon/iconConfig.js.map +0 -1
- package/dist/src/icon/material.js.map +0 -1
- package/dist/src/icon/materialConfig.js.map +0 -1
- package/dist/src/icon/styles.js.map +0 -1
- package/dist/src/index.js.map +0 -1
- package/dist/src/interaction/Ripple.js.map +0 -1
- package/dist/src/interaction/RippleContainer.js.map +0 -1
- package/dist/src/interaction/UserInteractionModeProvider.js.map +0 -1
- package/dist/src/interaction/config.js.map +0 -1
- package/dist/src/interaction/types.js.map +0 -1
- package/dist/src/interaction/useElementInteraction.js.map +0 -1
- package/dist/src/interaction/useHigherContrastChildren.js.map +0 -1
- package/dist/src/interaction/utils.js.map +0 -1
- package/dist/src/layout/LayoutAppBar.js.map +0 -1
- package/dist/src/layout/LayoutNav.js.map +0 -1
- package/dist/src/layout/LayoutWindowSplitter.js.map +0 -1
- package/dist/src/layout/Main.js.map +0 -1
- package/dist/src/layout/layoutNavStyles.js.map +0 -1
- package/dist/src/layout/layoutWindowSplitterStyles.js.map +0 -1
- package/dist/src/layout/mainStyles.js.map +0 -1
- package/dist/src/layout/useExpandableLayout.js.map +0 -1
- package/dist/src/layout/useHorizontalLayoutTransition.js.map +0 -1
- package/dist/src/layout/useLayoutAppBarHeight.js.map +0 -1
- package/dist/src/layout/useLayoutTree.js.map +0 -1
- package/dist/src/layout/useLayoutWindowSplitter.js.map +0 -1
- package/dist/src/layout/useMainTabIndex.js.map +0 -1
- package/dist/src/layout/useResizableLayout.js.map +0 -1
- package/dist/src/layout/useTemporaryLayout.js.map +0 -1
- package/dist/src/link/Link.js.map +0 -1
- package/dist/src/link/SkipToMainContent.js.map +0 -1
- package/dist/src/link/styles.js.map +0 -1
- package/dist/src/list/List.js.map +0 -1
- package/dist/src/list/ListItem.js.map +0 -1
- package/dist/src/list/ListItemAddon.js.map +0 -1
- package/dist/src/list/ListItemChildren.js.map +0 -1
- package/dist/src/list/ListItemLink.js.map +0 -1
- package/dist/src/list/ListItemText.js.map +0 -1
- package/dist/src/list/ListSubheader.js.map +0 -1
- package/dist/src/list/getListItemHeight.js.map +0 -1
- package/dist/src/list/listItemStyles.js.map +0 -1
- package/dist/src/list/types.js.map +0 -1
- package/dist/src/media-queries/AppSizeProvider.js.map +0 -1
- package/dist/src/media-queries/appSize.js.map +0 -1
- package/dist/src/media-queries/useMediaQuery.js.map +0 -1
- package/dist/src/menu/DropdownMenu.js.map +0 -1
- package/dist/src/menu/Menu.js.map +0 -1
- package/dist/src/menu/MenuBar.js.map +0 -1
- package/dist/src/menu/MenuButton.js.map +0 -1
- package/dist/src/menu/MenuConfigurationProvider.js.map +0 -1
- package/dist/src/menu/MenuItem.js.map +0 -1
- package/dist/src/menu/MenuItemButton.js.map +0 -1
- package/dist/src/menu/MenuItemGroup.js.map +0 -1
- package/dist/src/menu/MenuItemSeparator.js.map +0 -1
- package/dist/src/menu/MenuSheet.js.map +0 -1
- package/dist/src/menu/MenuVisibilityProvider.js.map +0 -1
- package/dist/src/menu/MenuWidget.js.map +0 -1
- package/dist/src/menu/MenuWidgetKeyboardProvider.js.map +0 -1
- package/dist/src/menu/useContextMenu.js.map +0 -1
- package/dist/src/menu/useMenuBarProvider.js.map +0 -1
- package/dist/src/menu/utils.js.map +0 -1
- package/dist/src/movement/constants.js.map +0 -1
- package/dist/src/movement/findMatchIndex.js.map +0 -1
- package/dist/src/movement/types.js.map +0 -1
- package/dist/src/movement/useKeyboardMovementProvider.js.map +0 -1
- package/dist/src/movement/utils.js.map +0 -1
- package/dist/src/overlay/Overlay.js.map +0 -1
- package/dist/src/overlay/overlayStyles.js.map +0 -1
- package/dist/src/portal/Portal.js.map +0 -1
- package/dist/src/portal/PortalContainerProvider.js.map +0 -1
- package/dist/src/positioning/constants.js.map +0 -1
- package/dist/src/positioning/createHorizontalPosition.js.map +0 -1
- package/dist/src/positioning/createVerticalPosition.js.map +0 -1
- package/dist/src/positioning/getFixedPosition.js.map +0 -1
- package/dist/src/positioning/types.js.map +0 -1
- package/dist/src/positioning/useFixedPositioning.js.map +0 -1
- package/dist/src/positioning/utils.js.map +0 -1
- package/dist/src/progress/CircularProgress.js.map +0 -1
- package/dist/src/progress/LinearProgress.js.map +0 -1
- package/dist/src/progress/getProgressA11y.js.map +0 -1
- package/dist/src/progress/types.js.map +0 -1
- package/dist/src/responsive-item/ResponsiveItemContainer.js.map +0 -1
- package/dist/src/responsive-item/ResponsiveItemOverlay.js.map +0 -1
- package/dist/src/responsive-item/styles.js.map +0 -1
- package/dist/src/scroll/ScrollLock.js.map +0 -1
- package/dist/src/scroll/getScrollbarWidth.js.map +0 -1
- package/dist/src/scroll/useScrollLock.js.map +0 -1
- package/dist/src/segmented-button/SegmentedButton.js.map +0 -1
- package/dist/src/segmented-button/SegmentedButtonContainer.js.map +0 -1
- package/dist/src/segmented-button/segmentedButtonContainerStyles.js.map +0 -1
- package/dist/src/segmented-button/segmentedButtonStyles.js.map +0 -1
- package/dist/src/sheet/Sheet.js.map +0 -1
- package/dist/src/sheet/styles.js.map +0 -1
- package/dist/src/snackbar/DefaultToastRenderer.js.map +0 -1
- package/dist/src/snackbar/Snackbar.js.map +0 -1
- package/dist/src/snackbar/Toast.js.map +0 -1
- package/dist/src/snackbar/ToastActionButton.js.map +0 -1
- package/dist/src/snackbar/ToastCloseButton.js.map +0 -1
- package/dist/src/snackbar/ToastContent.js.map +0 -1
- package/dist/src/snackbar/ToastManager.js.map +0 -1
- package/dist/src/snackbar/ToastManagerProvider.js.map +0 -1
- package/dist/src/snackbar/snackbarStyles.js.map +0 -1
- package/dist/src/snackbar/toastContentStyles.js.map +0 -1
- package/dist/src/snackbar/toastStyles.js.map +0 -1
- package/dist/src/snackbar/useCurrentToastActions.js.map +0 -1
- package/dist/src/suspense/CircularProgressSuspense.js.map +0 -1
- package/dist/src/suspense/NullSuspense.js.map +0 -1
- package/dist/src/table/Table.js.map +0 -1
- package/dist/src/table/TableBody.js.map +0 -1
- package/dist/src/table/TableCell.js.map +0 -1
- package/dist/src/table/TableCellContent.js.map +0 -1
- package/dist/src/table/TableCheckbox.js.map +0 -1
- package/dist/src/table/TableConfigurationProvider.js.map +0 -1
- package/dist/src/table/TableContainer.js.map +0 -1
- package/dist/src/table/TableContainerProvider.js.map +0 -1
- package/dist/src/table/TableFooter.js.map +0 -1
- package/dist/src/table/TableHeader.js.map +0 -1
- package/dist/src/table/TableRadio.js.map +0 -1
- package/dist/src/table/TableRow.js.map +0 -1
- package/dist/src/table/tableCellStyles.js.map +0 -1
- package/dist/src/table/tableContainerStyles.js.map +0 -1
- package/dist/src/table/tableFooterStyles.js.map +0 -1
- package/dist/src/table/tableHeaderStyles.js.map +0 -1
- package/dist/src/table/tableRowStyles.js.map +0 -1
- package/dist/src/table/tableStyles.js.map +0 -1
- package/dist/src/table/types.js.map +0 -1
- package/dist/src/tabs/Tab.js.map +0 -1
- package/dist/src/tabs/TabList.js.map +0 -1
- package/dist/src/tabs/TabListScrollButton.js.map +0 -1
- package/dist/src/tabs/tabIndicatorStyles.js.map +0 -1
- package/dist/src/tabs/tabListScrollButtonStyles.js.map +0 -1
- package/dist/src/tabs/tabListStyles.js.map +0 -1
- package/dist/src/tabs/tabStyles.js.map +0 -1
- package/dist/src/tabs/useTabList.js.map +0 -1
- package/dist/src/tabs/useTabs.js.map +0 -1
- package/dist/src/tabs/utils.js.map +0 -1
- package/dist/src/test-utils/IntersectionObserver.js.map +0 -1
- package/dist/src/test-utils/ResizeObserver.js.map +0 -1
- package/dist/src/test-utils/data-testid.js.map +0 -1
- package/dist/src/test-utils/index.js.map +0 -1
- package/dist/src/test-utils/jest-setup.js.map +0 -1
- package/dist/src/test-utils/matchMedia.js.map +0 -1
- package/dist/src/test-utils/polyfills/IntersectionObserver.js.map +0 -1
- package/dist/src/test-utils/polyfills/ResizeObserver.js.map +0 -1
- package/dist/src/test-utils/polyfills/index.js.map +0 -1
- package/dist/src/test-utils/polyfills/matchMedia.js.map +0 -1
- package/dist/src/test-utils/polyfills/offsetParent.js.map +0 -1
- package/dist/src/test-utils/polyfills/scrollIntoView.js.map +0 -1
- package/dist/src/test-utils/render.js.map +0 -1
- package/dist/src/test-utils/timers.js.map +0 -1
- package/dist/src/theme/LocalStorageColorSchemeProvider.js.map +0 -1
- package/dist/src/theme/ThemeProvider.js.map +0 -1
- package/dist/src/theme/colors.js.map +0 -1
- package/dist/src/theme/cssVars.js.map +0 -1
- package/dist/src/theme/types.js.map +0 -1
- package/dist/src/theme/useCSSVariables.js.map +0 -1
- package/dist/src/theme/useColorScheme.js.map +0 -1
- package/dist/src/theme/useColorSchemeMetaTag.js.map +0 -1
- package/dist/src/theme/useColorSchemeProvider.js.map +0 -1
- package/dist/src/theme/usePrefersColorScheme.js.map +0 -1
- package/dist/src/theme/utils.js.map +0 -1
- package/dist/src/tooltip/Tooltip.js.map +0 -1
- package/dist/src/tooltip/TooltipHoverModeProvider.js.map +0 -1
- package/dist/src/tooltip/constants.js.map +0 -1
- package/dist/src/tooltip/tooltipStyles.js.map +0 -1
- package/dist/src/tooltip/useTooltip.js.map +0 -1
- package/dist/src/tooltip/useTooltipPosition.js.map +0 -1
- package/dist/src/tooltip/utils.js.map +0 -1
- package/dist/src/transition/CSSTransition.js.map +0 -1
- package/dist/src/transition/Collapse.js.map +0 -1
- package/dist/src/transition/CrossFade.js.map +0 -1
- package/dist/src/transition/ScaleTransition.js.map +0 -1
- package/dist/src/transition/SkeletonPlaceholder.js.map +0 -1
- package/dist/src/transition/Slide.js.map +0 -1
- package/dist/src/transition/SlideContainer.js.map +0 -1
- package/dist/src/transition/collapseStyles.js.map +0 -1
- package/dist/src/transition/config.js.map +0 -1
- package/dist/src/transition/maxWidthTransition.js.map +0 -1
- package/dist/src/transition/skeletonPlaceholderUtils.js.map +0 -1
- package/dist/src/transition/types.js.map +0 -1
- package/dist/src/transition/useCSSTransition.js.map +0 -1
- package/dist/src/transition/useCarousel.js.map +0 -1
- package/dist/src/transition/useCollapseTransition.js.map +0 -1
- package/dist/src/transition/useCrossFadeTransition.js.map +0 -1
- package/dist/src/transition/useMaxWidthTransition.js.map +0 -1
- package/dist/src/transition/useScaleTransition.js.map +0 -1
- package/dist/src/transition/useSkeletonPlaceholder.js.map +0 -1
- package/dist/src/transition/useSlideTransition.js.map +0 -1
- package/dist/src/transition/useTransition.js.map +0 -1
- package/dist/src/transition/utils.js.map +0 -1
- package/dist/src/tree/DefaultTreeItemRenderer.js.map +0 -1
- package/dist/src/tree/Tree.js.map +0 -1
- package/dist/src/tree/TreeGroup.js.map +0 -1
- package/dist/src/tree/TreeItem.js.map +0 -1
- package/dist/src/tree/TreeItemExpander.js.map +0 -1
- package/dist/src/tree/TreeProvider.js.map +0 -1
- package/dist/src/tree/styles.js.map +0 -1
- package/dist/src/tree/types.js.map +0 -1
- package/dist/src/tree/useTree.js.map +0 -1
- package/dist/src/tree/useTreeExpansion.js.map +0 -1
- package/dist/src/tree/useTreeItems.js.map +0 -1
- package/dist/src/tree/useTreeMovement.js.map +0 -1
- package/dist/src/tree/useTreeSelection.js.map +0 -1
- package/dist/src/tree/utils.js.map +0 -1
- package/dist/src/types.js.map +0 -1
- package/dist/src/typography/SrOnly.js.map +0 -1
- package/dist/src/typography/TextContainer.js.map +0 -1
- package/dist/src/typography/Typography.js.map +0 -1
- package/dist/src/typography/WritingDirectionProvider.js.map +0 -1
- package/dist/src/useAsyncAction.js.map +0 -1
- package/dist/src/useDebouncedFunction.js.map +0 -1
- package/dist/src/useDropzone.js.map +0 -1
- package/dist/src/useElementSize.js.map +0 -1
- package/dist/src/useEnsuredId.js.map +0 -1
- package/dist/src/useEnsuredRef.js.map +0 -1
- package/dist/src/useEnsuredState.js.map +0 -1
- package/dist/src/useHtmlClassName.js.map +0 -1
- package/dist/src/useIntersectionObserver.js.map +0 -1
- package/dist/src/useIsomorphicLayoutEffect.js.map +0 -1
- package/dist/src/useLocalStorage.js.map +0 -1
- package/dist/src/useOrientation.js.map +0 -1
- package/dist/src/usePageInactive.js.map +0 -1
- package/dist/src/useResizeListener.js.map +0 -1
- package/dist/src/useResizeObserver.js.map +0 -1
- package/dist/src/useThrottledFunction.js.map +0 -1
- package/dist/src/useToggle.js.map +0 -1
- package/dist/src/useUnmounted.js.map +0 -1
- package/dist/src/useWindowSize.js.map +0 -1
- package/dist/src/utils/RenderRecursively.js.map +0 -1
- package/dist/src/utils/alphaNumericSort.js.map +0 -1
- package/dist/src/utils/applyRef.js.map +0 -1
- package/dist/src/utils/bem.js.map +0 -1
- package/dist/src/utils/filters.js.map +0 -1
- package/dist/src/utils/getClientPosition.js.map +0 -1
- package/dist/src/utils/getMiddleOfRange.js.map +0 -1
- package/dist/src/utils/getPercentage.js.map +0 -1
- package/dist/src/utils/getRangeDefaultValue.js.map +0 -1
- package/dist/src/utils/getRangeSteps.js.map +0 -1
- package/dist/src/utils/identity.js.map +0 -1
- package/dist/src/utils/isElementVisible.js.map +0 -1
- package/dist/src/utils/loop.js.map +0 -1
- package/dist/src/utils/nearest.js.map +0 -1
- package/dist/src/utils/parseCssLengthUnit.js.map +0 -1
- package/dist/src/utils/randomInt.js.map +0 -1
- package/dist/src/utils/wait.js.map +0 -1
- package/dist/src/utils/withinRange.js.map +0 -1
- package/dist/src/window-splitter/WindowSplitter.js.map +0 -1
- package/dist/src/window-splitter/useWindowSplitter.js.map +0 -1
- /package/dist/{src/CoreProviders.js → CoreProviders.js} +0 -0
- /package/dist/{src/NoSsr.js → NoSsr.js} +0 -0
- /package/dist/{src/SsrProvider.js → SsrProvider.js} +0 -0
- /package/dist/{src/app-bar → app-bar}/AppBar.js +0 -0
- /package/dist/{src/app-bar → app-bar}/AppBarTitle.js +0 -0
- /package/dist/{src/avatar → avatar}/Avatar.js +0 -0
- /package/dist/{src/avatar → avatar}/styles.js +0 -0
- /package/dist/{src/badge → badge}/Badge.js +0 -0
- /package/dist/{src/box → box}/Box.js +0 -0
- /package/dist/{src/box → box}/styles.js +0 -0
- /package/dist/{src/button → button}/AsyncButton.js +0 -0
- /package/dist/{src/button → button}/Button.js +0 -0
- /package/dist/{src/button → button}/ButtonUnstyled.js +0 -0
- /package/dist/{src/button → button}/FloatingActionButton.js +0 -0
- /package/dist/{src/button → button}/TooltippedButton.js +0 -0
- /package/dist/{src/button → button}/buttonStyles.js +0 -0
- /package/dist/{src/button → button}/buttonUnstyledStyles.js +0 -0
- /package/dist/{src/card → card}/Card.js +0 -0
- /package/dist/{src/card → card}/CardContent.js +0 -0
- /package/dist/{src/card → card}/CardFooter.js +0 -0
- /package/dist/{src/card → card}/CardHeader.js +0 -0
- /package/dist/{src/card → card}/CardSubtitle.js +0 -0
- /package/dist/{src/card → card}/CardTitle.js +0 -0
- /package/dist/{src/card → card}/ClickableCard.js +0 -0
- /package/dist/{src/card → card}/styles.js +0 -0
- /package/dist/{src/chip → chip}/Chip.js +0 -0
- /package/dist/{src/chip → chip}/styles.js +0 -0
- /package/dist/{src/cssUtils.js → cssUtils.js} +0 -0
- /package/dist/{src/delegateEvent.js → delegateEvent.js} +0 -0
- /package/dist/{src/dialog → dialog}/Dialog.js +0 -0
- /package/dist/{src/dialog → dialog}/DialogContainer.js +0 -0
- /package/dist/{src/dialog → dialog}/DialogContent.js +0 -0
- /package/dist/{src/dialog → dialog}/DialogFooter.js +0 -0
- /package/dist/{src/dialog → dialog}/DialogHeader.js +0 -0
- /package/dist/{src/dialog → dialog}/DialogTitle.js +0 -0
- /package/dist/{src/dialog → dialog}/FixedDialog.js +0 -0
- /package/dist/{src/dialog → dialog}/NestedDialogProvider.js +0 -0
- /package/dist/{src/dialog → dialog}/styles.js +0 -0
- /package/dist/{src/divider → divider}/Divider.js +0 -0
- /package/dist/{src/divider → divider}/styles.js +0 -0
- /package/dist/{src/draggable → draggable}/useDraggable.js +0 -0
- /package/dist/{src/draggable → draggable}/utils.js +0 -0
- /package/dist/{src/expansion-panel → expansion-panel}/ExpansionList.js +0 -0
- /package/dist/{src/expansion-panel → expansion-panel}/ExpansionPanel.js +0 -0
- /package/dist/{src/expansion-panel → expansion-panel}/ExpansionPanelHeader.js +0 -0
- /package/dist/{src/expansion-panel → expansion-panel}/useExpansionList.js +0 -0
- /package/dist/{src/expansion-panel → expansion-panel}/useExpansionPanels.js +0 -0
- /package/dist/{src/focus → focus}/useFocusContainer.js +0 -0
- /package/dist/{src/focus → focus}/utils.js +0 -0
- /package/dist/{src/form → form}/Checkbox.js +0 -0
- /package/dist/{src/form → form}/Fieldset.js +0 -0
- /package/dist/{src/form → form}/FileInput.js +0 -0
- /package/dist/{src/form → form}/FormMessage.js +0 -0
- /package/dist/{src/form → form}/FormMessageContainer.js +0 -0
- /package/dist/{src/form → form}/FormMessageCounter.js +0 -0
- /package/dist/{src/form → form}/InputToggle.js +0 -0
- /package/dist/{src/form → form}/InputToggleIcon.js +0 -0
- /package/dist/{src/form → form}/Label.js +0 -0
- /package/dist/{src/form → form}/Legend.js +0 -0
- /package/dist/{src/form → form}/MenuItemCheckbox.js +0 -0
- /package/dist/{src/form → form}/MenuItemFileInput.js +0 -0
- /package/dist/{src/form → form}/MenuItemInputToggle.js +0 -0
- /package/dist/{src/form → form}/MenuItemRadio.js +0 -0
- /package/dist/{src/form → form}/MenuItemSwitch.js +0 -0
- /package/dist/{src/form → form}/MenuItemTextField.js +0 -0
- /package/dist/{src/form → form}/NativeSelect.js +0 -0
- /package/dist/{src/form → form}/OptGroup.js +0 -0
- /package/dist/{src/form → form}/Option.js +0 -0
- /package/dist/{src/form → form}/Password.js +0 -0
- /package/dist/{src/form → form}/Radio.js +0 -0
- /package/dist/{src/form → form}/Select.js +0 -0
- /package/dist/{src/form → form}/SelectValue.js +0 -0
- /package/dist/{src/form → form}/Slider.js +0 -0
- /package/dist/{src/form → form}/SliderContainer.js +0 -0
- /package/dist/{src/form → form}/SliderMark.js +0 -0
- /package/dist/{src/form → form}/SliderMarkLabel.js +0 -0
- /package/dist/{src/form → form}/SliderThumb.js +0 -0
- /package/dist/{src/form → form}/SliderTrack.js +0 -0
- /package/dist/{src/form → form}/SliderValueMarks.js +0 -0
- /package/dist/{src/form → form}/SliderValueTooltip.js +0 -0
- /package/dist/{src/form → form}/Switch.js +0 -0
- /package/dist/{src/form → form}/SwitchTrack.js +0 -0
- /package/dist/{src/form → form}/TextArea.js +0 -0
- /package/dist/{src/form → form}/TextField.js +0 -0
- /package/dist/{src/form → form}/TextFieldAddon.js +0 -0
- /package/dist/{src/form → form}/TextFieldContainer.js +0 -0
- /package/dist/{src/form → form}/TextFieldContainerStyles.js +0 -0
- /package/dist/{src/form → form}/fileUtils.js +0 -0
- /package/dist/{src/form → form}/formConfig.js +0 -0
- /package/dist/{src/form → form}/formMessageStyles.js +0 -0
- /package/dist/{src/form → form}/inputToggleStyles.js +0 -0
- /package/dist/{src/form → form}/nativeSelectStyles.js +0 -0
- /package/dist/{src/form → form}/optionStyles.js +0 -0
- /package/dist/{src/form → form}/passwordStyles.js +0 -0
- /package/dist/{src/form → form}/selectStyles.js +0 -0
- /package/dist/{src/form → form}/selectUtils.js +0 -0
- /package/dist/{src/form → form}/sliderUtils.js +0 -0
- /package/dist/{src/form → form}/switchStyles.js +0 -0
- /package/dist/{src/form → form}/textAreaStyles.js +0 -0
- /package/dist/{src/form → form}/textFieldStyles.js +0 -0
- /package/dist/{src/form → form}/types.js +0 -0
- /package/dist/{src/form → form}/useCheckboxGroup.js +0 -0
- /package/dist/{src/form → form}/useFileUpload.js +0 -0
- /package/dist/{src/form → form}/useListboxProvider.js +0 -0
- /package/dist/{src/form → form}/useNumberField.js +0 -0
- /package/dist/{src/form → form}/useRadioGroup.js +0 -0
- /package/dist/{src/form → form}/useRangeSlider.js +0 -0
- /package/dist/{src/form → form}/useResizingTextArea.js +0 -0
- /package/dist/{src/form → form}/useSlider.js +0 -0
- /package/dist/{src/form → form}/useTextField.js +0 -0
- /package/dist/{src/form → form}/utils.js +0 -0
- /package/dist/{src/form → form}/validation.js +0 -0
- /package/dist/{src/hoverMode → hoverMode}/useHoverMode.js +0 -0
- /package/dist/{src/hoverMode → hoverMode}/useHoverModeProvider.js +0 -0
- /package/dist/{src/icon → icon}/FontIcon.js +0 -0
- /package/dist/{src/icon → icon}/IconRotator.js +0 -0
- /package/dist/{src/icon → icon}/MaterialIcon.js +0 -0
- /package/dist/{src/icon → icon}/MaterialSymbol.js +0 -0
- /package/dist/{src/icon → icon}/SVGIcon.js +0 -0
- /package/dist/{src/icon → icon}/TextIconSpacing.js +0 -0
- /package/dist/{src/icon → icon}/iconConfig.js +0 -0
- /package/dist/{src/icon → icon}/material.js +0 -0
- /package/dist/{src/icon → icon}/materialConfig.js +0 -0
- /package/dist/{src/icon → icon}/styles.js +0 -0
- /package/dist/{src/index.js → index.js} +0 -0
- /package/dist/{src/interaction → interaction}/Ripple.js +0 -0
- /package/dist/{src/interaction → interaction}/RippleContainer.js +0 -0
- /package/dist/{src/interaction → interaction}/UserInteractionModeProvider.js +0 -0
- /package/dist/{src/interaction → interaction}/config.js +0 -0
- /package/dist/{src/interaction → interaction}/types.js +0 -0
- /package/dist/{src/interaction → interaction}/useElementInteraction.js +0 -0
- /package/dist/{src/interaction → interaction}/useHigherContrastChildren.js +0 -0
- /package/dist/{src/interaction → interaction}/utils.js +0 -0
- /package/dist/{src/layout → layout}/LayoutAppBar.js +0 -0
- /package/dist/{src/layout → layout}/LayoutNav.js +0 -0
- /package/dist/{src/layout → layout}/LayoutWindowSplitter.js +0 -0
- /package/dist/{src/layout → layout}/Main.js +0 -0
- /package/dist/{src/layout → layout}/layoutNavStyles.js +0 -0
- /package/dist/{src/layout → layout}/layoutWindowSplitterStyles.js +0 -0
- /package/dist/{src/layout → layout}/mainStyles.js +0 -0
- /package/dist/{src/layout → layout}/useExpandableLayout.js +0 -0
- /package/dist/{src/layout → layout}/useHorizontalLayoutTransition.js +0 -0
- /package/dist/{src/layout → layout}/useLayoutAppBarHeight.js +0 -0
- /package/dist/{src/layout → layout}/useLayoutTree.js +0 -0
- /package/dist/{src/layout → layout}/useLayoutWindowSplitter.js +0 -0
- /package/dist/{src/layout → layout}/useMainTabIndex.js +0 -0
- /package/dist/{src/layout → layout}/useResizableLayout.js +0 -0
- /package/dist/{src/layout → layout}/useTemporaryLayout.js +0 -0
- /package/dist/{src/link → link}/Link.js +0 -0
- /package/dist/{src/link → link}/SkipToMainContent.js +0 -0
- /package/dist/{src/link → link}/styles.js +0 -0
- /package/dist/{src/list → list}/List.js +0 -0
- /package/dist/{src/list → list}/ListItem.js +0 -0
- /package/dist/{src/list → list}/ListItemAddon.js +0 -0
- /package/dist/{src/list → list}/ListItemChildren.js +0 -0
- /package/dist/{src/list → list}/ListItemLink.js +0 -0
- /package/dist/{src/list → list}/ListItemText.js +0 -0
- /package/dist/{src/list → list}/ListSubheader.js +0 -0
- /package/dist/{src/list → list}/getListItemHeight.js +0 -0
- /package/dist/{src/list → list}/listItemStyles.js +0 -0
- /package/dist/{src/list → list}/types.js +0 -0
- /package/dist/{src/media-queries → media-queries}/AppSizeProvider.js +0 -0
- /package/dist/{src/media-queries → media-queries}/appSize.js +0 -0
- /package/dist/{src/media-queries → media-queries}/useMediaQuery.js +0 -0
- /package/dist/{src/menu → menu}/DropdownMenu.js +0 -0
- /package/dist/{src/menu → menu}/Menu.js +0 -0
- /package/dist/{src/menu → menu}/MenuBar.js +0 -0
- /package/dist/{src/menu → menu}/MenuButton.js +0 -0
- /package/dist/{src/menu → menu}/MenuConfigurationProvider.js +0 -0
- /package/dist/{src/menu → menu}/MenuItem.js +0 -0
- /package/dist/{src/menu → menu}/MenuItemButton.js +0 -0
- /package/dist/{src/menu → menu}/MenuItemGroup.js +0 -0
- /package/dist/{src/menu → menu}/MenuItemSeparator.js +0 -0
- /package/dist/{src/menu → menu}/MenuSheet.js +0 -0
- /package/dist/{src/menu → menu}/MenuVisibilityProvider.js +0 -0
- /package/dist/{src/menu → menu}/MenuWidget.js +0 -0
- /package/dist/{src/menu → menu}/MenuWidgetKeyboardProvider.js +0 -0
- /package/dist/{src/menu → menu}/useContextMenu.js +0 -0
- /package/dist/{src/menu → menu}/useMenuBarProvider.js +0 -0
- /package/dist/{src/menu → menu}/utils.js +0 -0
- /package/dist/{src/movement → movement}/constants.js +0 -0
- /package/dist/{src/movement → movement}/findMatchIndex.js +0 -0
- /package/dist/{src/movement → movement}/types.js +0 -0
- /package/dist/{src/movement → movement}/useKeyboardMovementProvider.js +0 -0
- /package/dist/{src/movement → movement}/utils.js +0 -0
- /package/dist/{src/overlay → overlay}/Overlay.js +0 -0
- /package/dist/{src/overlay → overlay}/overlayStyles.js +0 -0
- /package/dist/{src/portal → portal}/Portal.js +0 -0
- /package/dist/{src/portal → portal}/PortalContainerProvider.js +0 -0
- /package/dist/{src/positioning → positioning}/constants.js +0 -0
- /package/dist/{src/positioning → positioning}/createHorizontalPosition.js +0 -0
- /package/dist/{src/positioning → positioning}/createVerticalPosition.js +0 -0
- /package/dist/{src/positioning → positioning}/getFixedPosition.js +0 -0
- /package/dist/{src/positioning → positioning}/types.js +0 -0
- /package/dist/{src/positioning → positioning}/useFixedPositioning.js +0 -0
- /package/dist/{src/positioning → positioning}/utils.js +0 -0
- /package/dist/{src/progress → progress}/CircularProgress.js +0 -0
- /package/dist/{src/progress → progress}/LinearProgress.js +0 -0
- /package/dist/{src/progress → progress}/getProgressA11y.js +0 -0
- /package/dist/{src/progress → progress}/types.js +0 -0
- /package/dist/{src/responsive-item → responsive-item}/ResponsiveItemContainer.js +0 -0
- /package/dist/{src/responsive-item → responsive-item}/ResponsiveItemOverlay.js +0 -0
- /package/dist/{src/responsive-item → responsive-item}/styles.js +0 -0
- /package/dist/{src/scroll → scroll}/ScrollLock.js +0 -0
- /package/dist/{src/scroll → scroll}/getScrollbarWidth.js +0 -0
- /package/dist/{src/scroll → scroll}/useScrollLock.js +0 -0
- /package/dist/{src/segmented-button → segmented-button}/SegmentedButton.js +0 -0
- /package/dist/{src/segmented-button → segmented-button}/SegmentedButtonContainer.js +0 -0
- /package/dist/{src/segmented-button → segmented-button}/segmentedButtonContainerStyles.js +0 -0
- /package/dist/{src/segmented-button → segmented-button}/segmentedButtonStyles.js +0 -0
- /package/dist/{src/sheet → sheet}/Sheet.js +0 -0
- /package/dist/{src/sheet → sheet}/styles.js +0 -0
- /package/dist/{src/snackbar → snackbar}/DefaultToastRenderer.js +0 -0
- /package/dist/{src/snackbar → snackbar}/Snackbar.js +0 -0
- /package/dist/{src/snackbar → snackbar}/Toast.js +0 -0
- /package/dist/{src/snackbar → snackbar}/ToastActionButton.js +0 -0
- /package/dist/{src/snackbar → snackbar}/ToastCloseButton.js +0 -0
- /package/dist/{src/snackbar → snackbar}/ToastContent.js +0 -0
- /package/dist/{src/snackbar → snackbar}/ToastManager.js +0 -0
- /package/dist/{src/snackbar → snackbar}/ToastManagerProvider.js +0 -0
- /package/dist/{src/snackbar → snackbar}/snackbarStyles.js +0 -0
- /package/dist/{src/snackbar → snackbar}/toastContentStyles.js +0 -0
- /package/dist/{src/snackbar → snackbar}/toastStyles.js +0 -0
- /package/dist/{src/snackbar → snackbar}/useCurrentToastActions.js +0 -0
- /package/dist/{src/suspense → suspense}/CircularProgressSuspense.js +0 -0
- /package/dist/{src/suspense → suspense}/NullSuspense.js +0 -0
- /package/dist/{src/table → table}/Table.js +0 -0
- /package/dist/{src/table → table}/TableBody.js +0 -0
- /package/dist/{src/table → table}/TableCell.js +0 -0
- /package/dist/{src/table → table}/TableCellContent.js +0 -0
- /package/dist/{src/table → table}/TableCheckbox.js +0 -0
- /package/dist/{src/table → table}/TableConfigurationProvider.js +0 -0
- /package/dist/{src/table → table}/TableContainer.js +0 -0
- /package/dist/{src/table → table}/TableContainerProvider.js +0 -0
- /package/dist/{src/table → table}/TableFooter.js +0 -0
- /package/dist/{src/table → table}/TableHeader.js +0 -0
- /package/dist/{src/table → table}/TableRadio.js +0 -0
- /package/dist/{src/table → table}/TableRow.js +0 -0
- /package/dist/{src/table → table}/tableCellStyles.js +0 -0
- /package/dist/{src/table → table}/tableContainerStyles.js +0 -0
- /package/dist/{src/table → table}/tableFooterStyles.js +0 -0
- /package/dist/{src/table → table}/tableHeaderStyles.js +0 -0
- /package/dist/{src/table → table}/tableRowStyles.js +0 -0
- /package/dist/{src/table → table}/tableStyles.js +0 -0
- /package/dist/{src/table → table}/types.js +0 -0
- /package/dist/{src/tabs → tabs}/Tab.js +0 -0
- /package/dist/{src/tabs → tabs}/TabList.js +0 -0
- /package/dist/{src/tabs → tabs}/TabListScrollButton.js +0 -0
- /package/dist/{src/tabs → tabs}/tabIndicatorStyles.js +0 -0
- /package/dist/{src/tabs → tabs}/tabListScrollButtonStyles.js +0 -0
- /package/dist/{src/tabs → tabs}/tabListStyles.js +0 -0
- /package/dist/{src/tabs → tabs}/tabStyles.js +0 -0
- /package/dist/{src/tabs → tabs}/useTabList.js +0 -0
- /package/dist/{src/tabs → tabs}/useTabs.js +0 -0
- /package/dist/{src/tabs → tabs}/utils.js +0 -0
- /package/dist/{src/test-utils → test-utils}/IntersectionObserver.js +0 -0
- /package/dist/{src/test-utils → test-utils}/ResizeObserver.js +0 -0
- /package/dist/{src/test-utils → test-utils}/data-testid.js +0 -0
- /package/dist/{src/test-utils → test-utils}/index.js +0 -0
- /package/dist/{src/test-utils → test-utils}/jest-setup.js +0 -0
- /package/dist/{src/test-utils → test-utils}/matchMedia.js +0 -0
- /package/dist/{src/test-utils → test-utils}/polyfills/IntersectionObserver.js +0 -0
- /package/dist/{src/test-utils → test-utils}/polyfills/ResizeObserver.js +0 -0
- /package/dist/{src/test-utils → test-utils}/polyfills/index.js +0 -0
- /package/dist/{src/test-utils → test-utils}/polyfills/matchMedia.js +0 -0
- /package/dist/{src/test-utils → test-utils}/polyfills/offsetParent.js +0 -0
- /package/dist/{src/test-utils → test-utils}/polyfills/scrollIntoView.js +0 -0
- /package/dist/{src/test-utils → test-utils}/render.js +0 -0
- /package/dist/{src/test-utils → test-utils}/timers.js +0 -0
- /package/dist/{src/theme → theme}/LocalStorageColorSchemeProvider.js +0 -0
- /package/dist/{src/theme → theme}/ThemeProvider.js +0 -0
- /package/dist/{src/theme → theme}/colors.js +0 -0
- /package/dist/{src/theme → theme}/cssVars.js +0 -0
- /package/dist/{src/theme → theme}/types.js +0 -0
- /package/dist/{src/theme → theme}/useCSSVariables.js +0 -0
- /package/dist/{src/theme → theme}/useColorScheme.js +0 -0
- /package/dist/{src/theme → theme}/useColorSchemeMetaTag.js +0 -0
- /package/dist/{src/theme → theme}/useColorSchemeProvider.js +0 -0
- /package/dist/{src/theme → theme}/usePrefersColorScheme.js +0 -0
- /package/dist/{src/theme → theme}/utils.js +0 -0
- /package/dist/{src/tooltip → tooltip}/Tooltip.js +0 -0
- /package/dist/{src/tooltip → tooltip}/TooltipHoverModeProvider.js +0 -0
- /package/dist/{src/tooltip → tooltip}/constants.js +0 -0
- /package/dist/{src/tooltip → tooltip}/tooltipStyles.js +0 -0
- /package/dist/{src/tooltip → tooltip}/useTooltip.js +0 -0
- /package/dist/{src/tooltip → tooltip}/useTooltipPosition.js +0 -0
- /package/dist/{src/tooltip → tooltip}/utils.js +0 -0
- /package/dist/{src/transition → transition}/CSSTransition.js +0 -0
- /package/dist/{src/transition → transition}/Collapse.js +0 -0
- /package/dist/{src/transition → transition}/CrossFade.js +0 -0
- /package/dist/{src/transition → transition}/ScaleTransition.js +0 -0
- /package/dist/{src/transition → transition}/SkeletonPlaceholder.js +0 -0
- /package/dist/{src/transition → transition}/Slide.js +0 -0
- /package/dist/{src/transition → transition}/SlideContainer.js +0 -0
- /package/dist/{src/transition → transition}/collapseStyles.js +0 -0
- /package/dist/{src/transition → transition}/config.js +0 -0
- /package/dist/{src/transition → transition}/maxWidthTransition.js +0 -0
- /package/dist/{src/transition → transition}/skeletonPlaceholderUtils.js +0 -0
- /package/dist/{src/transition → transition}/types.js +0 -0
- /package/dist/{src/transition → transition}/useCSSTransition.js +0 -0
- /package/dist/{src/transition → transition}/useCarousel.js +0 -0
- /package/dist/{src/transition → transition}/useCollapseTransition.js +0 -0
- /package/dist/{src/transition → transition}/useCrossFadeTransition.js +0 -0
- /package/dist/{src/transition → transition}/useMaxWidthTransition.js +0 -0
- /package/dist/{src/transition → transition}/useScaleTransition.js +0 -0
- /package/dist/{src/transition → transition}/useSkeletonPlaceholder.js +0 -0
- /package/dist/{src/transition → transition}/useSlideTransition.js +0 -0
- /package/dist/{src/transition → transition}/useTransition.js +0 -0
- /package/dist/{src/transition → transition}/utils.js +0 -0
- /package/dist/{src/tree → tree}/DefaultTreeItemRenderer.js +0 -0
- /package/dist/{src/tree → tree}/Tree.js +0 -0
- /package/dist/{src/tree → tree}/TreeGroup.js +0 -0
- /package/dist/{src/tree → tree}/TreeItem.js +0 -0
- /package/dist/{src/tree → tree}/TreeItemExpander.js +0 -0
- /package/dist/{src/tree → tree}/TreeProvider.js +0 -0
- /package/dist/{src/tree → tree}/styles.js +0 -0
- /package/dist/{src/tree → tree}/types.js +0 -0
- /package/dist/{src/tree → tree}/useTree.js +0 -0
- /package/dist/{src/tree → tree}/useTreeExpansion.js +0 -0
- /package/dist/{src/tree → tree}/useTreeItems.js +0 -0
- /package/dist/{src/tree → tree}/useTreeMovement.js +0 -0
- /package/dist/{src/tree → tree}/useTreeSelection.js +0 -0
- /package/dist/{src/tree → tree}/utils.js +0 -0
- /package/dist/{src/types.js → types.js} +0 -0
- /package/dist/{src/typography → typography}/SrOnly.js +0 -0
- /package/dist/{src/typography → typography}/TextContainer.js +0 -0
- /package/dist/{src/typography → typography}/Typography.js +0 -0
- /package/dist/{src/typography → typography}/WritingDirectionProvider.js +0 -0
- /package/dist/{src/useAsyncAction.js → useAsyncAction.js} +0 -0
- /package/dist/{src/useDebouncedFunction.js → useDebouncedFunction.js} +0 -0
- /package/dist/{src/useDropzone.js → useDropzone.js} +0 -0
- /package/dist/{src/useElementSize.js → useElementSize.js} +0 -0
- /package/dist/{src/useEnsuredId.js → useEnsuredId.js} +0 -0
- /package/dist/{src/useEnsuredRef.js → useEnsuredRef.js} +0 -0
- /package/dist/{src/useEnsuredState.js → useEnsuredState.js} +0 -0
- /package/dist/{src/useHtmlClassName.js → useHtmlClassName.js} +0 -0
- /package/dist/{src/useIntersectionObserver.js → useIntersectionObserver.js} +0 -0
- /package/dist/{src/useIsomorphicLayoutEffect.js → useIsomorphicLayoutEffect.js} +0 -0
- /package/dist/{src/useLocalStorage.js → useLocalStorage.js} +0 -0
- /package/dist/{src/useOrientation.js → useOrientation.js} +0 -0
- /package/dist/{src/usePageInactive.js → usePageInactive.js} +0 -0
- /package/dist/{src/useResizeListener.js → useResizeListener.js} +0 -0
- /package/dist/{src/useResizeObserver.js → useResizeObserver.js} +0 -0
- /package/dist/{src/useThrottledFunction.js → useThrottledFunction.js} +0 -0
- /package/dist/{src/useToggle.js → useToggle.js} +0 -0
- /package/dist/{src/useUnmounted.js → useUnmounted.js} +0 -0
- /package/dist/{src/useWindowSize.js → useWindowSize.js} +0 -0
- /package/dist/{src/utils → utils}/RenderRecursively.js +0 -0
- /package/dist/{src/utils → utils}/alphaNumericSort.js +0 -0
- /package/dist/{src/utils → utils}/applyRef.js +0 -0
- /package/dist/{src/utils → utils}/bem.js +0 -0
- /package/dist/{src/utils → utils}/filters.js +0 -0
- /package/dist/{src/utils → utils}/getClientPosition.js +0 -0
- /package/dist/{src/utils → utils}/getMiddleOfRange.js +0 -0
- /package/dist/{src/utils → utils}/getPercentage.js +0 -0
- /package/dist/{src/utils → utils}/getRangeDefaultValue.js +0 -0
- /package/dist/{src/utils → utils}/getRangeSteps.js +0 -0
- /package/dist/{src/utils → utils}/identity.js +0 -0
- /package/dist/{src/utils → utils}/isElementVisible.js +0 -0
- /package/dist/{src/utils → utils}/loop.js +0 -0
- /package/dist/{src/utils → utils}/nearest.js +0 -0
- /package/dist/{src/utils → utils}/parseCssLengthUnit.js +0 -0
- /package/dist/{src/utils → utils}/randomInt.js +0 -0
- /package/dist/{src/utils → utils}/wait.js +0 -0
- /package/dist/{src/utils → utils}/withinRange.js +0 -0
- /package/dist/{src/window-splitter → window-splitter}/WindowSplitter.js +0 -0
- /package/dist/{src/window-splitter → window-splitter}/useWindowSplitter.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/positioning/createHorizontalPosition.ts"],"sourcesContent":["import type { XCoordConfig } from \"./utils.js\";\nimport {\n getCenterXCoord,\n getInnerLeftCoord,\n getInnerRightCoord,\n getLeftCoord,\n getRightCoord,\n} from \"./utils.js\";\nimport type { FixedPositionOptions, HorizontalPosition } from \"./types.js\";\n\n/**\n * @internal\n */\ninterface XPosition {\n left: number;\n right?: number;\n width?: number;\n minWidth?: number;\n actualX: HorizontalPosition;\n}\n\n/**\n * @internal\n */\nexport interface FixConfig extends XCoordConfig {\n vwMargin: number;\n screenRight: number;\n disableSwapping: boolean;\n}\n\n/**\n * @internal\n */\nexport interface CreateHorizontalPositionOptions\n extends Required<\n Pick<\n FixedPositionOptions,\n \"vwMargin\" | \"xMargin\" | \"width\" | \"disableSwapping\"\n >\n > {\n x: HorizontalPosition;\n vw: number;\n elWidth: number;\n initialX?: number;\n containerRect: DOMRect;\n}\n\n/**\n * Attempts to position the fixed element so that it will appear to the left of\n * the container element but also within the viewport boundaries. When swapping\n * is enabled, it will attempt to swap to the right position if it can't fit\n * within the viewport to the left. If it can't fit in the viewport even after\n * being swapped to the right or swapping is disabled, it will be positioned to\n * the viewport left boundary.\n *\n * @internal\n */\nexport function createAnchoredLeft(config: FixConfig): XPosition {\n const { vwMargin, screenRight, elWidth, disableSwapping } = config;\n\n let left = getLeftCoord(config);\n let actualX: HorizontalPosition = \"left\";\n if (left >= vwMargin) {\n return { actualX, left };\n }\n\n const swappedLeft = getRightCoord(config);\n if (disableSwapping || swappedLeft + elWidth > screenRight) {\n left = vwMargin;\n } else {\n left = swappedLeft;\n actualX = \"right\";\n }\n\n return { actualX, left };\n}\n\n/**\n * Attempts to position the fixed element so that it will appear to the\n * inner-left of the container element but also within the viewport boundaries.\n * When swapping is enabled, it will attempt to swap to the right position if it\n * can't fit within the viewport to the left. If it can't fit in the viewport\n * even after being swapped to the right or swapping is disabled, it will be\n * positioned to the viewport left boundary.\n *\n * @internal\n */\nexport function createAnchoredInnerLeft(config: FixConfig): XPosition {\n const { vwMargin, screenRight, elWidth, disableSwapping } = config;\n\n let left = getInnerLeftCoord(config);\n let actualX: HorizontalPosition = \"inner-left\";\n if (left + elWidth <= screenRight && left >= vwMargin) {\n return { actualX, left };\n }\n\n if (disableSwapping) {\n if (left + elWidth > screenRight) {\n left = screenRight - elWidth;\n } else {\n left = vwMargin;\n }\n\n return { actualX, left };\n }\n\n const swappedLeft = getInnerRightCoord(config);\n if (swappedLeft < vwMargin) {\n left = vwMargin;\n } else if (swappedLeft + elWidth > screenRight) {\n left = screenRight - elWidth;\n actualX = \"inner-right\";\n } else {\n left = swappedLeft;\n actualX = \"inner-right\";\n }\n\n return { actualX, left };\n}\n\n/**\n * Attempts to position the fixed element so that it will appear at the center\n * of the container element but also within the viewport boundaries. If the\n * centered element can't fit within the viewport, it will use the vwMargin\n * value if it overflowed to the left, it'll position to the screen right\n * boundary.\n *\n * @internal\n */\nexport function createAnchoredCenter(config: FixConfig): XPosition {\n const { vwMargin, screenRight, elWidth } = config;\n let left = getCenterXCoord(config);\n if (left < vwMargin) {\n left = vwMargin;\n } else if (left + elWidth > screenRight || left < vwMargin) {\n left = screenRight - elWidth;\n }\n\n return { actualX: \"center\", left };\n}\n\n/**\n * Attempts to position the fixed element so that it will appear to the\n * inner-right of the container element but also within the viewport boundaries.\n * When swapping is enabled, it will attempt to swap to the inner-left position\n * if it can't fit within the viewport to the right. If it can't fit in the\n * viewport even after being swapped to the left or swapping is disabled, it\n * will be positioned to the viewport right boundary.\n *\n * @internal\n */\nexport function createAnchoredInnerRight(config: FixConfig): XPosition {\n const { screenRight, vwMargin, elWidth, disableSwapping } = config;\n\n let left = getInnerRightCoord(config);\n let actualX: HorizontalPosition = \"inner-right\";\n if (left >= vwMargin) {\n return { actualX, left: Math.min(left, screenRight - elWidth) };\n }\n\n const swappedLeft = getInnerLeftCoord(config);\n if (disableSwapping || swappedLeft + elWidth > screenRight) {\n left = vwMargin;\n } else {\n left = Math.max(swappedLeft, vwMargin);\n actualX = \"inner-left\";\n }\n\n return { actualX, left };\n}\n\n/**\n * Attempts to position the fixed element so that it will appear to the right of\n * the container element but also within the viewport boundaries. When swapping\n * is enabled, it will attempt to swap to the left position if it can't fit\n * within the viewport to the right. If it can't fit in the viewport even after\n * being swapped to the left or swapping is disabled, it will be positioned to\n * the viewport right boundary.\n *\n * @internal\n */\nexport function createAnchoredRight(config: FixConfig): XPosition {\n const { screenRight, vwMargin, elWidth, disableSwapping } = config;\n\n let left = getRightCoord(config);\n let actualX: HorizontalPosition = \"right\";\n if (left + elWidth <= screenRight) {\n return { actualX, left };\n }\n\n const swappedLeft = getLeftCoord(config);\n if (disableSwapping || swappedLeft < vwMargin) {\n left = screenRight - elWidth;\n } else {\n left = swappedLeft;\n actualX = \"left\";\n }\n\n return { actualX, left };\n}\n\nexport interface EqualWidthOptions\n extends Pick<\n CreateHorizontalPositionOptions,\n \"x\" | \"elWidth\" | \"xMargin\" | \"vwMargin\" | \"containerRect\" | \"initialX\"\n > {\n screenRight: number;\n isMinWidth: boolean;\n}\n\n/**\n * @internal\n */\nexport function createEqualWidth(options: EqualWidthOptions): XPosition {\n const {\n x,\n elWidth,\n xMargin,\n vwMargin,\n initialX,\n containerRect,\n screenRight,\n isMinWidth,\n } = options;\n\n let left = initialX ?? containerRect.left + xMargin;\n\n let width: number | undefined = containerRect.width - xMargin * 2;\n let minWidth: number | undefined;\n let right: number | undefined;\n if (isMinWidth) {\n minWidth = width;\n // if the fixed element has a width greater than the element it is fixed to,\n // update the width to be the fixed element's width. since the \"min-width\"\n // option is only possible for horizontally centered elements, need to then\n // update the `left` position again.\n if (elWidth > width) {\n left -= (elWidth - width) / 2;\n minWidth = elWidth;\n }\n\n width = undefined;\n const elRight = left + elWidth;\n if (elRight > screenRight) {\n left -= elRight - screenRight;\n right = vwMargin;\n }\n\n left = Math.max(vwMargin, left);\n }\n\n // going to assume that the container element is visible in the DOM and just\n // make the fixed element have the same left and right corners\n return {\n left,\n right,\n width,\n minWidth,\n actualX: x,\n };\n}\n\n/**\n * Creates the horizontal position for a fixed element with the provided\n * options.\n * @internal\n */\nexport function createHorizontalPosition(\n options: CreateHorizontalPositionOptions\n): XPosition {\n const {\n x,\n vw,\n vwMargin,\n xMargin,\n width,\n elWidth,\n initialX,\n containerRect,\n disableSwapping,\n } = options;\n\n const screenRight = vw - vwMargin;\n if (width === \"min\" || width === \"equal\") {\n return createEqualWidth({\n x,\n vwMargin,\n xMargin,\n elWidth,\n initialX,\n containerRect,\n screenRight,\n isMinWidth: width === \"min\",\n });\n }\n\n if (elWidth > vw - vwMargin * 2) {\n // if the element's width is greater than the viewport's width minus the\n // margin on both sides, just make the element span the entire viewport with\n // the margin\n return {\n left: vwMargin,\n right: vwMargin,\n actualX: x,\n };\n }\n\n const config: FixConfig = {\n vwMargin,\n xMargin,\n elWidth,\n initialX,\n screenRight,\n containerRect,\n disableSwapping,\n };\n\n switch (x) {\n case \"left\":\n return createAnchoredLeft(config);\n case \"inner-left\":\n return createAnchoredInnerLeft(config);\n case \"center\":\n return createAnchoredCenter(config);\n case \"inner-right\":\n return createAnchoredInnerRight(config);\n case \"right\":\n return createAnchoredRight(config);\n }\n}\n"],"names":["getCenterXCoord","getInnerLeftCoord","getInnerRightCoord","getLeftCoord","getRightCoord","createAnchoredLeft","config","vwMargin","screenRight","elWidth","disableSwapping","left","actualX","swappedLeft","createAnchoredInnerLeft","createAnchoredCenter","createAnchoredInnerRight","Math","min","max","createAnchoredRight","createEqualWidth","options","x","xMargin","initialX","containerRect","isMinWidth","width","minWidth","right","undefined","elRight","createHorizontalPosition","vw"],"mappings":"AACA,SACEA,eAAe,EACfC,iBAAiB,EACjBC,kBAAkB,EAClBC,YAAY,EACZC,aAAa,QACR,aAAa;AAwCpB;;;;;;;;;CASC,GACD,OAAO,SAASC,mBAAmBC,MAAiB;IAClD,MAAM,EAAEC,QAAQ,EAAEC,WAAW,EAAEC,OAAO,EAAEC,eAAe,EAAE,GAAGJ;IAE5D,IAAIK,OAAOR,aAAaG;IACxB,IAAIM,UAA8B;IAClC,IAAID,QAAQJ,UAAU;QACpB,OAAO;YAAEK;YAASD;QAAK;IACzB;IAEA,MAAME,cAAcT,cAAcE;IAClC,IAAII,mBAAmBG,cAAcJ,UAAUD,aAAa;QAC1DG,OAAOJ;IACT,OAAO;QACLI,OAAOE;QACPD,UAAU;IACZ;IAEA,OAAO;QAAEA;QAASD;IAAK;AACzB;AAEA;;;;;;;;;CASC,GACD,OAAO,SAASG,wBAAwBR,MAAiB;IACvD,MAAM,EAAEC,QAAQ,EA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;IAC5E,8DAA8D;IAC9D,OAAO;QACLA;QACAmB;QACAF;QACAC;QACAjB,SAASW;IACX;AACF;AAEA;;;;CAIC,GACD,OAAO,SAASU,yBACdX,OAAwC;IAExC,MAAM,EACJC,CAAC,EACDW,EAAE,EACF3B,QAAQ,EACRiB,OAAO,EACPI,KAAK,EACLnB,OAAO,EACPgB,QAAQ,EACRC,aAAa,EACbhB,eAAe,EAChB,GAAGY;IAEJ,MAAMd,cAAc0B,KAAK3B;IACzB,IAAIqB,UAAU,SAASA,UAAU,SAAS;QACxC,OAAOP,iBAAiB;YACtBE;YACAhB;YACAiB;YACAf;YACAgB;YACAC;YACAlB;YACAmB,YAAYC,UAAU;QACxB;IACF;IAEA,IAAInB,UAAUyB,KAAK3B,WAAW,GAAG;QAC/B,wEAAwE;QACxE,4EAA4E;QAC5E,aAAa;QACb,OAAO;YACLI,MAAMJ;YACNuB,OAAOvB;YACPK,SAASW;QACX;IACF;IAEA,MAAMjB,SAAoB;QACxBC;QACAiB;QACAf;QACAgB;QACAjB;QACAkB;QACAhB;IACF;IAEA,OAAQa;QACN,KAAK;YACH,OAAOlB,mBAAmBC;QAC5B,KAAK;YACH,OAAOQ,wBAAwBR;QACjC,KAAK;YACH,OAAOS,qBAAqBT;QAC9B,KAAK;YACH,OAAOU,yBAAyBV;QAClC,KAAK;YACH,OAAOc,oBAAoBd;IAC/B;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/positioning/createVerticalPosition.ts"],"sourcesContent":["import type { YCoordConfig } from \"./utils.js\";\nimport {\n getAboveCoord,\n getBelowCoord,\n getBottomCoord,\n getCenterYCoord,\n getTopCoord,\n} from \"./utils.js\";\nimport type { FixedPositionOptions, VerticalPosition } from \"./types.js\";\n\n/** @internal */\ninterface YPosition {\n top: number;\n bottom?: number;\n actualY: VerticalPosition;\n /** @remarks \\@since 6.0.0 */\n transformOriginY?: number;\n}\n\n/** @internal */\nexport interface FixConfig extends YCoordConfig {\n vhMargin: number;\n screenBottom: number;\n preventOverlap: boolean;\n disableSwapping: boolean;\n disableVHBounds: boolean;\n}\n\n/** @internal */\nexport interface CreateVerticalPositionOptions\n extends Required<\n Pick<\n FixedPositionOptions,\n | \"yMargin\"\n | \"vhMargin\"\n | \"preventOverlap\"\n | \"disableSwapping\"\n | \"disableVHBounds\"\n >\n > {\n y: VerticalPosition;\n vh: number;\n initialY?: number;\n elHeight: number;\n containerRect: DOMRect;\n}\n\n/**\n * Attempts to position the fixed element so that it will appear completely\n * above the container element but also within the viewport boundaries. When\n * swapping is enabled, it will attempt to swap to the below position if it\n * can't fit within the viewport above the container element. If it can't fit in\n * the viewport even after being swapped below or swapping is disabled, it will\n * be positioned to the top viewport boundary.\n *\n * @internal\n */\nexport function createAnchoredAbove(config: FixConfig): YPosition {\n const {\n yMargin,\n vhMargin,\n screenBottom,\n elHeight,\n containerRect,\n preventOverlap,\n disableSwapping,\n disableVHBounds,\n } = config;\n let top = getAboveCoord(config);\n let actualY: VerticalPosition = \"above\";\n\n if (disableVHBounds) {\n // can't actually allow a top value as a negative number since browsers\n // won't scroll upwards past the normal page top\n return { actualY, top: Math.max(0, top) };\n }\n\n if (top > vhMargin) {\n // don't need to do anything else since the top is still in the viewport and\n // since it's positioned above, we already know it can't overlap the\n // container element\n return { actualY, top };\n }\n\n const swappedTop = getBelowCoord(config);\n if (disableSwapping || swappedTop + elHeight > screenBottom) {\n top = Math.min(top, vhMargin);\n } else {\n actualY = \"below\";\n top = swappedTop;\n }\n\n let bottom: number | undefined;\n if (\n preventOverlap &&\n // can't overlap if it's positioned below\n actualY === \"above\" &&\n top + elHeight > containerRect.top\n ) {\n bottom = screenBottom - containerRect.top + yMargin;\n }\n\n return { actualY, top, bottom };\n}\n\n/**\n * Attempts to position the fixed element so that it will appear fixed to the\n * top of the container element but also within the viewport boundaries. When\n * swapping is enabled, it will attempt to swap to the bottom position if it\n * can't fit within the viewport. If it can't fit in the viewport even after\n * being swapped to the bottom position or swapping is disabled, it will be\n * positioned to the top viewport boundary.\n *\n * @internal\n */\nexport function createAnchoredTop(config: FixConfig): YPosition {\n const { vhMargin, screenBottom, elHeight, disableSwapping, disableVHBounds } =\n config;\n let top = getTopCoord(config);\n let actualY: VerticalPosition = \"top\";\n\n if (disableVHBounds || top + elHeight <= screenBottom) {\n return { actualY, top };\n }\n\n const swappedTop = getBottomCoord(config);\n if (disableSwapping || swappedTop < vhMargin) {\n top = Math.max(top, vhMargin);\n } else {\n actualY = \"bottom\";\n top = swappedTop;\n }\n\n return { actualY, top };\n}\n\n/**\n * Attempts to position the fixed element so that it will appear at the center\n * of the container element but also within the viewport boundaries. If the\n * entered element can't fit within the viewport, it'll update the top value\n * to either be the vhMargin or position to the screen bottom boundary\n *\n * @internal\n */\nexport function createAnchoredCenter(config: FixConfig): YPosition {\n const { vhMargin, screenBottom, elHeight, disableVHBounds } = config;\n let top = getCenterYCoord(config);\n const actualY: VerticalPosition = \"center\";\n if (disableVHBounds) {\n return { actualY, top: Math.max(0, top) };\n }\n\n top = Math.max(vhMargin, top);\n if (top + elHeight > screenBottom) {\n top = screenBottom - elHeight;\n }\n\n return { actualY, top };\n}\n\n/**\n * Attempts to position the fixed element so that it will appear fixed to the\n * bottom of the container element but also within the viewport boundaries. When\n * swapping is enabled, it will attempt to swap to the top position if it can't\n * fit within the viewport. If it can't fit in the viewport even after being\n * swapped to the top position or swapping is disabled, it will be positioned to\n * the bottom viewport boundary.\n *\n * @internal\n */\nexport function createAnchoredBottom(config: FixConfig): YPosition {\n const { vhMargin, screenBottom, elHeight, disableSwapping, disableVHBounds } =\n config;\n let top = getBottomCoord(config);\n let actualY: VerticalPosition = \"bottom\";\n if (disableVHBounds || top > vhMargin) {\n return { actualY, top };\n }\n\n const swappedTop = getTopCoord(config);\n if (disableSwapping || swappedTop + elHeight > screenBottom) {\n top = Math.min(top, screenBottom - elHeight);\n } else {\n actualY = \"top\";\n top = swappedTop;\n }\n\n return { actualY, top };\n}\n\n/**\n * Attempts to position the fixed element so that it will appear completely\n * below the container element but also within the viewport boundaries. When\n * swapping is enabled, it will attempt to swap to the above position if it\n * can't fit within the viewport below the container element. If it can't fit in\n * the viewport even after being swapped above or swapping is disabled, it will\n * be positioned to the bottom viewport boundary.\n *\n * @internal\n */\nexport function createAnchoredBelow(config: FixConfig): YPosition {\n const {\n yMargin,\n vhMargin,\n elHeight,\n screenBottom,\n containerRect,\n preventOverlap,\n disableSwapping,\n disableVHBounds,\n } = config;\n let top = getBelowCoord(config);\n let actualY: VerticalPosition = \"below\";\n if (disableVHBounds || top + elHeight <= screenBottom) {\n return { actualY, top };\n }\n\n if (preventOverlap) {\n const availableTop = containerRect.top - yMargin;\n if (disableSwapping || availableTop < screenBottom - top) {\n return {\n actualY,\n top,\n bottom: vhMargin,\n };\n }\n\n return {\n actualY: \"above\",\n top: Math.max(vhMargin, availableTop - elHeight),\n // this makes it so that the bottom of the fixed element is the top of the container\n // element. this ensures that it won't ever overlap the container element\n bottom: window.innerHeight - availableTop,\n };\n }\n\n const swappedTop = getAboveCoord(config);\n if (disableSwapping || swappedTop < vhMargin) {\n top = Math.min(top, screenBottom - elHeight);\n } else {\n actualY = \"above\";\n top = swappedTop;\n }\n\n return { actualY, top };\n}\n\n/**\n * Creates the vertical position for a fixed element with the provided options.\n *\n * @internal\n */\nexport function createVerticalPosition(\n options: CreateVerticalPositionOptions\n): YPosition {\n const {\n y,\n vh,\n vhMargin,\n yMargin,\n elHeight,\n initialY,\n containerRect,\n disableSwapping,\n preventOverlap,\n disableVHBounds,\n } = options;\n\n if (!disableVHBounds && !preventOverlap && elHeight > vh - vhMargin * 2) {\n // the element is too big to be displayed in the viewport, so just span the\n // full viewport excluding margins\n return {\n top: vhMargin,\n bottom: vhMargin,\n actualY: \"center\",\n transformOriginY: containerRect.top,\n };\n }\n\n const config: FixConfig = {\n vhMargin,\n yMargin,\n elHeight,\n initialY,\n containerRect,\n screenBottom: vh - vhMargin,\n preventOverlap,\n disableSwapping,\n disableVHBounds,\n };\n\n switch (y) {\n case \"above\":\n return createAnchoredAbove(config);\n case \"top\":\n return createAnchoredTop(config);\n case \"center\":\n return createAnchoredCenter(config);\n case \"bottom\":\n return createAnchoredBottom(config);\n case \"below\":\n return createAnchoredBelow(config);\n }\n}\n"],"names":["getAboveCoord","getBelowCoord","getBottomCoord","getCenterYCoord","getTopCoord","createAnchoredAbove","config","yMargin","vhMargin","screenBottom","elHeight","containerRect","preventOverlap","disableSwapping","disableVHBounds","top","actualY","Math","max","swappedTop","min","bottom","createAnchoredTop","createAnchoredCenter","createAnchoredBottom","createAnchoredBelow","availableTop","window","innerHeight","createVerticalPosition","options","y","vh","initialY","transformOriginY"],"mappings":"AACA,SACEA,aAAa,EACbC,aAAa,EACbC,cAAc,EACdC,eAAe,EACfC,WAAW,QACN,aAAa;AAwCpB;;;;;;;;;CASC,GACD,OAAO,SAASC,oBAAoBC,MAAiB;IACnD,MAAM,EACJC,OAAO,EACPC,QAAQ,EACRC,YAAY,EACZC,QAAQ,EACRC,aAAa,EACbC,cAAc,EACdC,eAAe,EACfC,eAAe,EAChB,GAAGR;IACJ,IAAIS,MAAMf,cAAcM;IACxB,IAAIU,UAA4B;IAEhC,IAAIF,iBAAiB;QACnB,uEAAuE;QACvE,gDAAgD;QAChD,OAAO;YAAEE;YAASD,KAAKE,KAAKC,GAAG,CAAC,GAAGH;QAAK;IAC1C;IAEA,IAAIA,MAAMP,UAAU;QAClB,4EAA4E;QAC5E,oEAAoE;QACpE,oBAAoB;QACpB,OAAO;YAAEQ;YAASD;QAAI;IACxB;IAEA,MAAMI,aAAalB,cAAcK;IACjC,IAAIO,mBAAmBM,aAAaT,WAAWD,cAAc;QAC3DM,MAAME,KAAKG,GAAG,CAACL,KAAKP;IACtB,OAAO;QACLQ,UAAU;QACVD,MAAMI;IACR;IAEA,IAAIE;IACJ,IACET,kBACA,yCAAyC;IACzCI,YAAY,WACZD,MAAML,WAAWC,cAAcI,GAAG,EAClC;QACAM,SAASZ,eAAeE,cAAc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AAkBF,WAAWsB,KAAKxB,WAAW,GAAG;QACvE,2EAA2E;QAC3E,kCAAkC;QAClC,OAAO;YACLO,KAAKP;YACLa,QAAQb;YACRQ,SAAS;YACTkB,kBAAkBvB,cAAcI,GAAG;QACrC;IACF;IAEA,MAAMT,SAAoB;QACxBE;QACAD;QACAG;QACAuB;QACAtB;QACAF,cAAcuB,KAAKxB;QACnBI;QACAC;QACAC;IACF;IAEA,OAAQiB;QACN,KAAK;YACH,OAAO1B,oBAAoBC;QAC7B,KAAK;YACH,OAAOgB,kBAAkBhB;QAC3B,KAAK;YACH,OAAOiB,qBAAqBjB;QAC9B,KAAK;YACH,OAAOkB,qBAAqBlB;QAC9B,KAAK;YACH,OAAOmB,oBAAoBnB;IAC/B;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/positioning/getFixedPosition.ts"],"sourcesContent":["import { getScrollbarWidth } from \"../scroll/getScrollbarWidth.js\";\nimport { BELOW_CENTER_ANCHOR } from \"./constants.js\";\nimport { createHorizontalPosition } from \"./createHorizontalPosition.js\";\nimport { createVerticalPosition } from \"./createVerticalPosition.js\";\nimport type { FixedPosition, FixedPositionOptions } from \"./types.js\";\nimport {\n findSizingContainer,\n getElementRect,\n getTransformOrigin,\n} from \"./utils.js\";\n\n/**\n * This is used when there is no `container` element so that some styles can\n * still be created. The main use-case for this is context menus and when the\n * `initialX` and `initialY` options have been provided.\n *\n * @internal\n * @remarks \\@since 5.0.0\n */\nconst FALLBACK_DOM_RECT: DOMRect = {\n x: 0,\n y: 0,\n height: 0,\n width: 0,\n left: 0,\n right: 0,\n top: 0,\n bottom: 0,\n toJSON() {\n // do nothing\n },\n};\n\n/**\n * One of the most complicated functions in this project that will attempt to\n * position an element relative to another container element while still being\n * visible within the viewport. Below is the logical flow for attempting to fix\n * the element to the container:\n *\n * No Container: If there is no container element, return the provided x and y\n * positions and no styles since there's nothing we can use to calculate the\n * position.\n *\n * No Element: If the container was provided but the element to position does\n * not exist, return an style object containing the `left` and `top` values for\n * the container and apply as many of the positioning options as possible so\n * that the styles are \"as close as possible\" before the fixed element is added\n * to the DOM. This will also return the provided x and y positions since\n * nothing could be swapped around yet.\n *\n * Container and Element: If both the container and fixed element were provided,\n * apply all the positioning options to the `left` and `top` values of the\n * container based on the sizes of both elements.\n *\n * Now that the `left` and `top` values were applied, check to see if the\n * element is fully visible within the viewport with the provided positioning\n * options. If it is fully visible, do nothing else. If it isn't... follow the\n * next flow:\n *\n * First, check the horizontal sizes and make sure that the element is still\n * within the viewport with the provided view width margin. If it isn't, first\n * try to swap only to a `right` style instead of left to see if that fixes it,\n * otherwise keep both the `left` and `right` styles.\n */\nexport function getFixedPosition(options: FixedPositionOptions): FixedPosition {\n const {\n element,\n anchor = BELOW_CENTER_ANCHOR,\n initialX,\n vwMargin = 16,\n vhMargin = 16,\n xMargin = 0,\n yMargin = 0,\n width: widthType = \"auto\",\n preventOverlap = false,\n transformOrigin = false,\n disableSwapping = false,\n disableVHBounds = false,\n } = options;\n let { initialY } = options;\n const container = findSizingContainer(options.container);\n\n if (process.env.NODE_ENV !== \"production\") {\n if (preventOverlap && anchor.y !== \"above\" && anchor.y !== \"below\") {\n throw new Error(\n 'Unable to prevent overlap when the vertical anchor is not `\"above\"` or `\"below\"`'\n );\n }\n }\n\n if (!element) {\n return {\n actualX: anchor.x,\n actualY: anchor.y,\n style: {\n left: initialX,\n top: initialY,\n position: disableVHBounds ? \"absolute\" : \"fixed\",\n transformOrigin: transformOrigin\n ? getTransformOrigin({ x: anchor.x, y: anchor.y })\n : undefined,\n },\n };\n }\n\n const containerRect = container?.getBoundingClientRect() ?? FALLBACK_DOM_RECT;\n const vh = window.innerHeight;\n const vw = window.innerWidth;\n\n const { minWidth: elMinWidth } = element.style;\n // Note: This makes it \"min-content\" or \"min-container-width\"\n if (widthType === \"min\") {\n element.style.overflow = \"visible\";\n element.style.minWidth = \"\";\n }\n const elementRect = getElementRect(element);\n const { height } = elementRect;\n let elWidth = elementRect.width;\n if (widthType === \"min\") {\n elWidth += getScrollbarWidth();\n element.style.overflow = \"\";\n element.style.minWidth = elMinWidth;\n }\n if (disableVHBounds) {\n const dialog = element.closest(\"[role='dialog']\");\n if (!dialog) {\n initialY = (initialY ?? 0) + window.scrollY;\n }\n }\n\n const { left, right, width, minWidth, actualX } = createHorizontalPosition({\n x: anchor.x,\n vw,\n vwMargin,\n xMargin,\n width: widthType,\n elWidth,\n initialX,\n containerRect,\n disableSwapping,\n });\n const { top, bottom, actualY, transformOriginY } = createVerticalPosition({\n y: anchor.y,\n vh,\n vhMargin,\n yMargin,\n initialY,\n elHeight: height,\n containerRect,\n disableSwapping,\n preventOverlap,\n disableVHBounds,\n });\n\n return {\n actualX,\n actualY,\n style: {\n left,\n top,\n right,\n bottom,\n width,\n minWidth,\n position: disableVHBounds ? \"absolute\" : \"fixed\",\n transformOrigin: transformOrigin\n ? getTransformOrigin({\n x: actualX,\n y: actualY,\n transformOriginY,\n })\n : undefined,\n },\n };\n}\n"],"names":["getScrollbarWidth","BELOW_CENTER_ANCHOR","createHorizontalPosition","createVerticalPosition","findSizingContainer","getElementRect","getTransformOrigin","FALLBACK_DOM_RECT","x","y","height","width","left","right","top","bottom","toJSON","getFixedPosition","options","element","anchor","initialX","vwMargin","vhMargin","xMargin","yMargin","widthType","preventOverlap","transformOrigin","disableSwapping","disableVHBounds","initialY","container","process","env","NODE_ENV","Error","actualX","actualY","style","position","undefined","containerRect","getBoundingClientRect","vh","window","innerHeight","vw","innerWidth","minWidth","elMinWidth","overflow","elementRect","elWidth","dialog","closest","scrollY","transformOriginY","elHeight"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,iCAAiC;AACnE,SAASC,mBAAmB,QAAQ,iBAAiB;AACrD,SAASC,wBAAwB,QAAQ,gCAAgC;AACzE,SAASC,sBAAsB,QAAQ,8BAA8B;AAErE,SACEC,mBAAmB,EACnBC,cAAc,EACdC,kBAAkB,QACb,aAAa;AAEpB;;;;;;;CAOC,GACD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Ib,cAAc,OAAO;QACvBP,QAAQoB,KAAK,CAACY,QAAQ,GAAG;QACzBhC,QAAQoB,KAAK,CAACU,QAAQ,GAAG;IAC3B;IACA,MAAMG,cAAc/C,eAAec;IACnC,MAAM,EAAET,MAAM,EAAE,GAAG0C;IACnB,IAAIC,UAAUD,YAAYzC,KAAK;IAC/B,IAAIe,cAAc,OAAO;QACvB2B,WAAWrD;QACXmB,QAAQoB,KAAK,CAACY,QAAQ,GAAG;QACzBhC,QAAQoB,KAAK,CAACU,QAAQ,GAAGC;IAC3B;IACA,IAAIpB,iBAAiB;QACnB,MAAMwB,SAASnC,QAAQoC,OAAO,CAAC;QAC/B,IAAI,CAACD,QAAQ;YACXvB,WAAW,AAACA,CAAAA,YAAY,CAAA,IAAKc,OAAOW,OAAO;QAC7C;IACF;IAEA,MAAM,EAAE5C,IAAI,EAAEC,KAAK,EAAEF,KAAK,EAAEsC,QAAQ,EAAEZ,OAAO,EAAE,GAAGnC,yBAAyB;QACzEM,GAAGY,OAAOZ,CAAC;QACXuC;QACAzB;QACAE;QACAb,OAAOe;QACP2B;QACAhC;QACAqB;QACAb;IACF;IACA,MAAM,EAAEf,GAAG,EAAEC,MAAM,EAAEuB,OAAO,EAAEmB,gBAAgB,EAAE,GAAGtD,uBAAuB;QACxEM,GAAGW,OAAOX,CAAC;QACXmC;QACArB;QACAE;QACAM;QACA2B,UAAUhD;QACVgC;QACAb;QACAF;QACAG;IACF;IAEA,OAAO;QACLO;QACAC;QACAC,OAAO;YACL3B;YACAE;YACAD;YACAE;YACAJ;YACAsC;YACAT,UAAUV,kBAAkB,aAAa;YACzCF,iBAAiBA,kBACbtB,mBAAmB;gBACjBE,GAAG6B;gBACH5B,GAAG6B;gBACHmB;YACF,KACAhB;QACN;IACF;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/positioning/types.ts"],"sourcesContent":["/**\n * Above:\n * - the container top is in-line with the bottom of the element.\n *\n * Below:\n * - the container bottom is in-line with the top of the element\n *\n * Center:\n * - the container center is in-line with the top of the element\n *\n * Top:\n * - the container top is in-line with the top of the element\n *\n * Bottom:\n * - the container bottom is in-line with the bottom of the element\n */\nexport type VerticalPosition = \"above\" | \"below\" | \"center\" | \"top\" | \"bottom\";\n\n/**\n * Left:\n * - the container left is in-line with the right of the element\n *\n * Right:\n * - the container right is in-line with the left of the element\n *\n * Center:\n * - the container's horizontal center point will be aligned with the element's\n * horizontal center point\n *\n * Inner Left:\n * - the container's left is in-line with the left of the element\n *\n * Inner Right:\n * - the container's right is in-line with the right of the element\n */\nexport type HorizontalPosition =\n | \"left\"\n | \"right\"\n | \"center\"\n | \"inner-left\"\n | \"inner-right\";\n\n/**\n * An object containing the x and y positions to anchor a fixed element to\n * another container element.\n */\nexport interface PositionAnchor {\n x: HorizontalPosition;\n y: VerticalPosition;\n}\n\n/**\n * A \"simple\" version of all the positioning options. These are generally used\n * across all of react-md as it'll use the \"center\" version of the opposite type\n * when creating a fixed position.\n */\nexport type SimplePosition = \"above\" | \"below\" | \"left\" | \"right\";\n\n/**\n * An optional configuration for calculating and setting the width of the\n * element relative to the width of the container. When this value is set to\n * `\"auto\"` (default), the width will be based on content width but still\n * ensuring it can fit within the viewport. Setting this to `\"equal\"` will just\n * apply the container's width to the fixed element. Finally, setting this to\n * `\"min\"` will set the container's width as the `minWidth` for the fixed\n * element so that it is at least the same width as the container.\n *\n * If this is set to `\"equal\"` or `\"min\"` and the horizontal anchor is not set\n * to `\"center\"`, an error will be thrown.\n *\n * @defaultValue `\"auto\"`\n */\nexport type PositionWidth = \"auto\" | \"equal\" | \"min\";\n\nexport interface InitialCoords {\n /**\n * The initial x value to use when calculating the position instead of\n * finding the container element to determine the the correct position. All\n * the other positioning logic will still be in effect to ensure the element\n * will be visible within the viewport.\n */\n initialX?: number;\n\n /**\n * The initial y value to use when calculating the position instead of\n * finding the container element to determine the the correct position. All\n * the other positioning logic will still be in effect to ensure the element\n * will be visible within the viewport.\n */\n initialY?: number;\n}\n\n/** @remarks \\@since 4.0.0 */\nexport interface CalculateFixedPositionOptions extends InitialCoords {\n /**\n * The configuration to anchor the fixed element to the container element.\n *\n * @defaultValue `BELOW_CENTER_ANCHOR`\n */\n anchor?: PositionAnchor;\n\n /**\n * The viewwidth margin to apply so that the element doesn't need to be\n * directly on the screen edge.\n *\n * @defaultValue `16`\n */\n vwMargin?: number;\n\n /**\n * The viewwidth margin to apply so that the element doesn't need to be\n * directly on the screen edge.\n *\n * @defaultValue `16`\n */\n vhMargin?: number;\n\n /**\n * The container width margin to apply so that the element doesn't need to be\n * directly on the container's edge.\n *\n * @defaultValue `0`\n */\n xMargin?: number;\n\n /**\n * The container height margin to apply so that the element doesn't need to be\n * directly on the container's edge\n *\n * @defaultValue `0`\n */\n yMargin?: number;\n\n /** {@inheritDoc PositionWidth} */\n width?: PositionWidth;\n\n /**\n * Boolean if the style object should include the `transformOrigin` value\n * based on the x and y positions.\n *\n * @defaultValue `false`\n */\n transformOrigin?: boolean;\n\n /**\n * Boolean if the fixed element should no longer be able to overlap the\n * container element. This is useful for autocomplete menus or other\n * components that retain focus on the container element while the fixed\n * element becomes visible.\n *\n * @defaultValue `false`\n */\n preventOverlap?: boolean;\n\n /**\n * Boolean if the auto-swapping behavior should be disabled. It's normally\n * recommended to not disable this since it'll allow elements to appear off\n * screen.\n *\n * @defaultValue `false`\n * @remarks \\@since 5.0.0 This will always be `true` if the\n * {@link FixedPositionOptions.container} is `null`.\n * \\@remarks \\@since 6.0.0 Allow this to be `false` while the `container` is\n * null. I can't figure out why I prevented that.\n */\n disableSwapping?: boolean;\n\n /**\n * Boolean if the fixed positioning should no longer prevent the fixed element\n * to be positioned within the viewport. This is nice if you want to allow for\n * full page scrolling instead and manually set a max-height on your element.\n *\n * @defaultValue `false`\n */\n disableVHBounds?: boolean;\n}\n\nexport interface FixedPositionOptions extends CalculateFixedPositionOptions {\n /**\n * The container element that the `element` should be fixed to.\n */\n container: HTMLElement | null;\n\n /**\n * The element that is fixed to a `container` element.\n */\n element: HTMLElement | null;\n}\n\n/**\n * This is more of a private interface that is used to help show how fixed\n * elements are placed within the viewport. Most of the time the `top` and\n * `left` values will be provided, but there are a few flows where the `right`\n * and `bottom` could be added or the `top` and `left` are removed.\n *\n * The `width` values will only be used when the `equalWidth` or `minEqualWidth`\n * options are enabled.\n *\n * @internal\n */\nexport interface Coords {\n top?: number;\n right?: number;\n bottom?: number;\n left?: number;\n width?: number;\n minWidth?: number;\n}\n\n/**\n * The style object that should be applied to the fixed element so it will be\n * fixed to the container element. This will be `undefined` if the container\n * element doesn't exist within the DOM.\n *\n * Note: The fixed element styles **will not** contain styles for `z-index` or\n * `background-color` so you'll need to add that manually.\n *\n * @remarks \\@since 4.0.0\n */\nexport interface FixedPositionStyle extends Coords {\n /**\n * This will be `\"fixed\"` unless\n * {@link CalculateFixedPositionOptions.disableVHBounds} is set to `true`.\n */\n position: \"fixed\" | \"absolute\";\n\n /**\n * This will be `undefined` unless\n * {@link CalculateFixedPositionOptions.transformOrigin} is set to `true`\n */\n transformOrigin?: string;\n}\n\n/**\n * Since the position can be \"swapped\" to help fit the fixed element within the\n * viewport, this interface is used to contain the calculated positions as well\n * as an optional style object to apply.\n */\nexport interface FixedPosition {\n /**\n * The calculated horizontal position that can be used to compare to the\n * provided horizontal position anchor if additional manual updates should be\n * applied.\n */\n actualX: HorizontalPosition;\n\n /**\n * The calculated vertical position that can be used to compare to the\n * provided horizontal position anchor if additional manual updates should be\n * applied.\n */\n actualY: VerticalPosition;\n /** {@inheritDoc FixedPositionStyle} */\n style?: FixedPositionStyle;\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GA0ND;;;;CAIC,GACD,WAgBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/positioning/useFixedPositioning.ts"],"sourcesContent":["\"use client\";\nimport type { CSSProperties, Ref, RefCallback, RefObject } from \"react\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport { delegateEvent } from \"../delegateEvent.js\";\nimport type { TransitionCallbacks } from \"../transition/types.js\";\nimport { useEnsuredRef } from \"../useEnsuredRef.js\";\nimport { useIsomorphicLayoutEffect } from \"../useIsomorphicLayoutEffect.js\";\nimport { BELOW_CENTER_ANCHOR } from \"./constants.js\";\nimport { getFixedPosition } from \"./getFixedPosition.js\";\nimport type { CalculateFixedPositionOptions } from \"./types.js\";\nimport { isWithinViewport } from \"./utils.js\";\n\nconst noop = (): undefined => undefined;\n\n/**\n * @remarks \\@since 4.0.0\n */\nexport type FixedPositioningTransitionCallbacks = Pick<\n TransitionCallbacks,\n \"onEnter\" | \"onEntering\" | \"onEntered\" | \"onExited\"\n>;\n\n/**\n * This options should be passed to the {@link useCSSTransition} for the styling\n * and positioning to work correctly.\n *\n * @typeParam E - An HTMLElement type used for the ref required for the\n * transition.\n * @remarks \\@since 4.0.0\n */\nexport interface FixedPositioningTransitionOptions<E extends HTMLElement>\n extends FixedPositioningTransitionCallbacks {\n /** {@inheritDoc TransitionOptions.nodeRef} */\n nodeRef?: Ref<E>;\n}\n\n/**\n * @typeParam FixedToElement - An HTMLElement type for the static element.\n * @typeParam FixedElement - An HTMLElement type for the fixed element.\n * @remarks \\@since 4.0.0\n */\nexport interface FixedPositioningScrollData<\n FixedToElement extends HTMLElement,\n FixedElement extends HTMLElement,\n> {\n fixedElement: FixedElement;\n fixedToElement: FixedToElement;\n\n /**\n * Boolean if the {@link fixedToElement} is visible within the viewport.\n */\n visible: boolean;\n}\n\n/**\n * This function is called when the page is scrolled while the fixed element is\n * visible. This is generally used to reposition the fixed element or hide it if\n * it is no longer visible within the viewport.\n *\n * @typeParam FixedToElement - An HTMLElement type for the static element.\n * @typeParam FixedElement - An HTMLElement type for the fixed element.\n * @param event - The scroll event\n * @param data - The {@link FixedPositioningScrollData} that can be used for\n * custom scroll behavior.\n * @remarks \\@since 4.0.0\n */\nexport type TransitionScrollCallback<\n FixedToElement extends HTMLElement,\n FixedElement extends HTMLElement,\n> = (\n event: Event,\n data: Readonly<FixedPositioningScrollData<FixedToElement, FixedElement>>\n) => void;\n\n/**\n * @typeParam FixedToElement - An HTMLElement type for the static element.\n * @typeParam FixedElement - An HTMLElement type for the fixed element.\n * @remarks \\@since 4.0.0\n */\nexport interface FixedPositioningOptions<\n FixedToElement extends HTMLElement,\n FixedElement extends HTMLElement,\n> extends FixedPositioningTransitionOptions<FixedElement>,\n CalculateFixedPositionOptions {\n /**\n * An optional style that will be merged with the fixed positioning required\n * styles.\n *\n * @see {@link FixedPositionStyle}\n */\n style?: CSSProperties;\n\n /**\n * A ref pointing to an element that another element should be fixed to. This\n * **must** be provided for the positioning to work.\n */\n fixedTo: RefObject<FixedToElement>;\n\n /**\n * An optional function that can be used to override positioning options if\n * some options require the element to be in the DOM for specific\n * calculations.\n */\n getFixedPositionOptions?(): CalculateFixedPositionOptions;\n\n /**\n * An optional function to call if the page resizes while the `FixedElement`\n * is visible.\n */\n onResize?: EventListener;\n /** @see {@link TransitionScrollCallback} */\n onScroll?: TransitionScrollCallback<FixedToElement, FixedElement>;\n}\n\n/**\n * @typeParam E - An HTMLElement type for the fixed element.\n * @remarks \\@since 4.0.0\n */\nexport interface FixedPositioningHookReturnValue<E extends HTMLElement> {\n /**\n * A ref that should be passed to a component for the fixed positioning\n * behavior to work correctly.\n *\n * This should really only be used if the {@link TransitionOptions} is not\n * being used.\n */\n ref: RefCallback<E>;\n\n /**\n * @see {@link FixedPositionStyle}\n */\n style: CSSProperties;\n\n /**\n * This should really only be used if the {@link transitionOptions} is not\n * being used.\n */\n callbacks: Readonly<Required<FixedPositioningTransitionCallbacks>>;\n\n /**\n * A function that can be called to update the style for the fixed element.\n */\n updateStyle(): void;\n\n /** {@inheritDoc FixedPositioningTransitionOptions} */\n transitionOptions: Readonly<Required<FixedPositioningTransitionOptions<E>>>;\n}\n\n/**\n * This hook is used to attach a temporary (fixed) element to another element\n * within the page. In other words, this is a way to have an element with\n * `position: fixed` as if it were `position: absolute` to a parent element that\n * had `position: relative`.\n *\n * @example\n * Simple Example\n * ```tsx\n * import { ReactElement, useRef, useState } from \"react\";\n * import { Button, useCSSTransition, useFixedPositioning } from \"@react-md/core\";\n *\n * function Example(): ReactElement {\n * const fixedTo = useRef<HTMLButtonElement>(null);\n * const [transitionIn, setTransitionIn] = useState(false);\n * const { style, transitionOptions } = useFixedPositioning({\n * fixedTo,\n * });\n * const { elementProps, rendered } = useCSSTransition({\n * ...transitionOptions,\n * transitionIn,\n * temporary: true,\n * timeout: {\n * enter: 200,\n * exit: 150,\n * },\n * classNames: {\n * enter: \"enter\",\n * enterActive: \"enter--active\",\n * exit: \"exit\",\n * exitActive: \"exit--active\",\n * },\n * });\n *\n * return (\n * <>\n * <Button\n * ref={fixedTo}\n * onClick={() => setTransitionIn(!transitionIn)}\n * >\n * Toggle\n * </Button>\n * {rendered && (\n * <div {...elementProps} style={style}>\n * Fixed Temporary Element\n * </div>\n * )}\n * </>\n * );\n * }\n * ```\n *\n * @typeParam FixedToElement - An HTMLElement type for the static element.\n * @typeParam FixedElement - An HTMLElement type for the fixed element.\n * @remarks \\@since 4.0.0\n */\nexport function useFixedPositioning<\n FixedToElement extends HTMLElement,\n FixedElement extends HTMLElement,\n>(\n options: FixedPositioningOptions<FixedToElement, FixedElement>\n): FixedPositioningHookReturnValue<FixedElement> {\n const {\n style: propStyle,\n nodeRef,\n fixedTo,\n onEnter = noop,\n onEntering = noop,\n onEntered = noop,\n onExited = noop,\n anchor = BELOW_CENTER_ANCHOR,\n disableSwapping,\n disableVHBounds,\n initialX,\n initialY,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n getFixedPositionOptions = noop,\n onScroll,\n onResize = noop,\n } = options;\n\n const [active, setActive] = useState(false);\n const [ref, refHandler] = useEnsuredRef(nodeRef);\n const optionsRef = useRef({\n ref,\n fixedTo,\n anchor,\n disableSwapping,\n disableVHBounds,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n getFixedPositionOptions,\n } as const);\n useIsomorphicLayoutEffect(() => {\n optionsRef.current = {\n ref,\n fixedTo,\n anchor,\n disableSwapping,\n disableVHBounds,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n getFixedPositionOptions,\n };\n }, [\n ref,\n fixedTo,\n anchor,\n disableSwapping,\n disableVHBounds,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n getFixedPositionOptions,\n ]);\n const [style, setStyle] = useState<CSSProperties | undefined>(\n () =>\n getFixedPosition({\n container: ref.current,\n element: fixedTo.current,\n anchor,\n disableSwapping,\n disableVHBounds,\n initialX,\n initialY,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n ...getFixedPositionOptions(),\n }).style\n );\n\n const updateStyle = useCallback(() => {\n const {\n ref,\n fixedTo,\n anchor,\n disableSwapping,\n disableVHBounds,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n getFixedPositionOptions,\n } = optionsRef.current;\n const element = ref.current;\n const container = fixedTo.current;\n const { style } = getFixedPosition({\n container,\n element,\n anchor,\n disableSwapping,\n disableVHBounds,\n initialX,\n initialY,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n ...getFixedPositionOptions(),\n });\n\n setStyle(style);\n setActive(!!element && !element.hidden);\n\n // Only changing the initialX and initialY should cause the useEffect below\n // to trigger, which is why everything else is set in a ref.\n }, [initialX, initialY]);\n\n useEffect(() => {\n if (!active) {\n return;\n }\n\n const resizeCallback = (event: Event): void => {\n onResize(event);\n updateStyle();\n };\n const scrollCallback = (event: Event): void => {\n const fixedElement = ref.current;\n const fixedToElement = fixedTo.current;\n if (onScroll && fixedElement && fixedToElement) {\n onScroll(event, {\n visible: isWithinViewport({ fixedElement, fixedToElement }),\n fixedElement,\n fixedToElement,\n });\n }\n\n updateStyle();\n };\n\n const resizeHandler = delegateEvent(\"resize\", window, true);\n const scrollHandler = delegateEvent(\"scroll\", window, true, {\n passive: true,\n });\n resizeHandler.add(resizeCallback);\n scrollHandler.add(scrollCallback);\n return () => {\n resizeHandler.remove(resizeCallback);\n scrollHandler.remove(scrollCallback);\n };\n }, [active, fixedTo, onResize, onScroll, ref, updateStyle]);\n\n useEffect(() => {\n if (!ref.current || !ref.current.hidden) {\n updateStyle();\n }\n }, [ref, updateStyle]);\n\n const callbacks: Required<FixedPositioningTransitionCallbacks> = {\n onEnter(appearing) {\n onEnter(appearing);\n updateStyle();\n },\n onEntering(appearing) {\n onEntering(appearing);\n updateStyle();\n },\n onEntered(appearing) {\n onEntered(appearing);\n updateStyle();\n },\n onExited() {\n onExited();\n setActive(false);\n },\n };\n\n return {\n ref: refHandler,\n style: { ...style, ...propStyle },\n callbacks,\n updateStyle,\n transitionOptions: {\n ...callbacks,\n nodeRef: refHandler,\n },\n };\n}\n"],"names":["useCallback","useEffect","useRef","useState","delegateEvent","useEnsuredRef","useIsomorphicLayoutEffect","BELOW_CENTER_ANCHOR","getFixedPosition","isWithinViewport","noop","undefined","useFixedPositioning","options","style","propStyle","nodeRef","fixedTo","onEnter","onEntering","onEntered","onExited","anchor","disableSwapping","disableVHBounds","initialX","initialY","preventOverlap","transformOrigin","vhMargin","vwMargin","width","xMargin","yMargin","getFixedPositionOptions","onScroll","onResize","active","setActive","ref","refHandler","optionsRef","current","setStyle","container","element","updateStyle","hidden","resizeCallback","event","scrollCallback","fixedElement","fixedToElement","visible","resizeHandler","window","scrollHandler","passive","add","remove","callbacks","appearing","transitionOptions"],"mappings":"AAAA;AAEA,SAASA,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAQ;AACjE,SAASC,aAAa,QAAQ,sBAAsB;AAEpD,SAASC,aAAa,QAAQ,sBAAsB;AACpD,SAASC,yBAAyB,QAAQ,kC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cAAcG,MAAM,CAACT;QACvB;IACF,GAAG;QAACb;QAAQpB;QAASmB;QAAUD;QAAUI;QAAKO;KAAY;IAE1D7C,UAAU;QACR,IAAI,CAACsC,IAAIG,OAAO,IAAI,CAACH,IAAIG,OAAO,CAACK,MAAM,EAAE;YACvCD;QACF;IACF,GAAG;QAACP;QAAKO;KAAY;IAErB,MAAMc,YAA2D;QAC/D1C,SAAQ2C,SAAS;YACf3C,QAAQ2C;YACRf;QACF;QACA3B,YAAW0C,SAAS;YAClB1C,WAAW0C;YACXf;QACF;QACA1B,WAAUyC,SAAS;YACjBzC,UAAUyC;YACVf;QACF;QACAzB;YACEA;YACAiB,UAAU;QACZ;IACF;IAEA,OAAO;QACLC,KAAKC;QACL1B,OAAO;YAAE,GAAGA,KAAK;YAAE,GAAGC,SAAS;QAAC;QAChC6C;QACAd;QACAgB,mBAAmB;YACjB,GAAGF,SAAS;YACZ5C,SAASwB;QACX;IACF;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/positioning/utils.ts"],"sourcesContent":["import type { PositionAnchor } from \"./types.js\";\n\n/** @internal */\nexport interface XCoordConfig {\n xMargin: number;\n elWidth: number;\n initialX?: number;\n containerRect: DOMRect;\n}\n\n/** @internal */\nexport interface YCoordConfig {\n yMargin: number;\n elHeight: number;\n initialY?: number;\n containerRect: DOMRect;\n}\n\ntype Left = number;\ntype Top = number;\n\n/**\n * Creates the `left` style value for an element that should be fixed to the\n * (outer) left of the container element. So the right bounds of the fixed\n * element will be equal to the left bounds of the container element (before the\n * xMargin is applied).\n *\n * @internal\n */\nexport function getLeftCoord({\n xMargin,\n elWidth,\n initialX,\n containerRect,\n}: XCoordConfig): Left {\n return (initialX ?? containerRect.left) - elWidth - xMargin;\n}\n\n/**\n * Creates the `left` style value for an element that should be fixed to the\n * inner-left of the container element. So the left bounds of both the container\n * and fixed elements will overlap (before the xMargin is applied)\n *\n * @internal\n */\nexport function getInnerLeftCoord({\n xMargin,\n initialX,\n containerRect,\n}: XCoordConfig): Left {\n return (initialX ?? containerRect.left) + xMargin;\n}\n\n/**\n * Creates the `left` style value for an element that should be fixed to the\n * center of the container element. So the center point of the fixed element\n * should be the center point of the container element.\n *\n * Note: Unlike all the other horizontal positioning logic, the center position\n * does not use the xMargin.\n *\n * @internal\n */\nexport function getCenterXCoord({\n elWidth,\n initialX,\n containerRect,\n}: XCoordConfig): Left {\n const containerCenter = containerRect.width / 2;\n const elementCenter = elWidth / 2;\n return (initialX ?? containerRect.left + containerCenter) - elementCenter;\n}\n\n/**\n * Creates the `left` style value for an element that should be fixed to the\n * inner-right of the container element. So the right bounds for both the\n * container and fixed elements will overlap (before the xMargin is applied).\n *\n * @internal\n */\nexport function getInnerRightCoord({\n xMargin,\n elWidth,\n initialX,\n containerRect,\n}: XCoordConfig): Left {\n return (\n (initialX ?? containerRect.left + containerRect.width) - elWidth - xMargin\n );\n}\n\n/**\n * Creates the `left` style value for an element that should be fixed to the\n * (outer) right of the container element. So the left bounds of the fixed\n * element will overlap with the right bounds of the container element (before\n * the xMargin is applied).\n *\n * @internal\n */\nexport function getRightCoord({\n xMargin,\n initialX,\n containerRect,\n}: XCoordConfig): Left {\n return (initialX ?? containerRect.left + containerRect.width) + xMargin;\n}\n\n/**\n * Creates the `top` style value for an element that should be fixed above the\n * container element. So the bottom bounds of the fixed element will overlap\n * with the top bounds of the container element (before the yMargin is applied).\n *\n * @internal\n */\nexport function getAboveCoord({\n yMargin,\n initialY,\n elHeight,\n containerRect,\n}: YCoordConfig): Top {\n return (initialY ?? containerRect.top) - elHeight - yMargin;\n}\n\n/**\n * Creates the `top` style value for an element that should be fixed to the top\n * of the container element. So the top bounds for both the container and fixed\n * elements will overlap (before the yMargin is applied).\n *\n * @internal\n */\nexport function getTopCoord({\n yMargin,\n initialY,\n containerRect,\n}: YCoordConfig): Top {\n return (initialY ?? containerRect.top) + yMargin;\n}\n\n/**\n * Creates the `top` style value for an element that should be fixed vertically\n * centered relative to the container element. So the vertical center point for\n * the fixed element should overlap the vertical center point of the container\n * element.\n *\n * Note: Unlike all the other vertical positioning logic, the center position\n * does not use the yMargin.\n *\n * @internal\n */\nexport function getCenterYCoord({\n yMargin,\n elHeight,\n initialY,\n containerRect,\n}: YCoordConfig): Top {\n const containerCenter = containerRect.height / 2;\n const elementCenter = elHeight / 2;\n return (\n (initialY ?? containerRect.top + containerCenter + yMargin) - elementCenter\n );\n}\n\n/**\n * Creates the `top` style value for an element that should be fixed to the\n * bottom of the container element. So the top bounds of the fixed element\n * should overlap the bottom bounds of the container element (before the yMargin\n * is applied).\n *\n * @internal\n */\nexport function getBottomCoord({\n yMargin,\n initialY,\n elHeight,\n containerRect,\n}: YCoordConfig): Top {\n return (\n (initialY ?? containerRect.top + containerRect.height) - elHeight - yMargin\n );\n}\n\n/**\n * Creates the `top` style value for an element that should be fixed to the\n * bottom of the container element. So the bottom bounds of both the container\n * and fixed elements should overlap (before the yMargin is applied).\n *\n * @internal\n */\nexport function getBelowCoord({\n yMargin,\n initialY,\n containerRect,\n}: YCoordConfig): Top {\n return (initialY ?? containerRect.top + containerRect.height) + yMargin;\n}\n\n/**\n * @remarks \\@since 6.0.0\n * @internal\n */\nexport interface TransformOriginOptions extends PositionAnchor {\n transformOriginY?: number;\n}\n\n/**\n * This is a simple util that'll generate a css `transform-origin` string so\n * that the fixed element can animate from the correct point based on the\n * provided anchor.\n *\n * @param options - The anchor that should be used to create the transform origin\n * for.\n * @returns the transform origin string\n * @internal\n */\nexport function getTransformOrigin(options: TransformOriginOptions): string {\n const { transformOriginY: yPosition } = options;\n\n let x = \"0\";\n switch (options.x) {\n case \"right\":\n case \"inner-left\":\n x = \"0\";\n break;\n case \"center\":\n x = \"50%\";\n break;\n case \"left\":\n case \"inner-right\":\n x = \"100%\";\n break;\n default:\n x = \"0\";\n }\n\n let y = \"0\";\n if (typeof yPosition === \"number\") {\n y = `${yPosition}px`;\n } else {\n switch (options.y) {\n case \"above\":\n case \"bottom\":\n y = \"100%\";\n break;\n case \"center\":\n y = \"50%\";\n break;\n case \"below\":\n case \"top\":\n y = \"0\";\n break;\n default:\n y = \"0\";\n }\n }\n\n return `${x} ${y}`;\n}\n\n/**\n * Attempts to find a sizing container based on the provided HTMLElement. By\n * default, the sizing element will just be the provided element unless:\n * - the item has a known role within react-md that can target known classes\n * - the item has a `data-sizing-selector` attribute that is a valid query\n * selector for the nested item.\n *\n * NOTE: The `data-sizing-selector` will be run from the current element instead\n * of the `document`.\n *\n * @param el - The element to find a sizing container for.\n * @returns the sizing container relative to the provided element, or `null` if\n * none could be found.\n * @throws This error will be thrown if using the `data-query-selector` and the\n * query selector does not return an element on the page.\n * @internal\n */\nexport function findSizingContainer(\n el: HTMLElement | null\n): HTMLElement | null {\n if (!el) {\n return null;\n }\n\n if (/(tree|list)item/.test(el.getAttribute(\"role\") || \"\")) {\n const content = el.querySelector(\n \".rmd-tree-item__content, .rmd-item-text\"\n ) as HTMLElement;\n if (content) {\n return content;\n }\n } else if (el.getAttribute(\"type\") === \"file\") {\n const label = document.querySelector<HTMLLabelElement>(`[for=\"${el.id}\"]`);\n if (label) {\n return label;\n }\n }\n\n const data = el.getAttribute(\"data-sizing-selector\");\n if (data) {\n const content = el.querySelector(data) as HTMLElement;\n if (content) {\n return content;\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error(\n \"Unable to find a child element using the `data-sizing-selector`\"\n );\n }\n }\n\n return el;\n}\n\n/**\n * This util is used to get the \"true\" `element.getBoundingClientRect()` that\n * ensures that transitions using transforms don't mess up the sizing so that\n * position calculations are easier to do.\n *\n * @param element - The element to get a rect for.\n * @returns either a DOMRect for the element\n * @internal\n */\nexport function getElementRect(element: HTMLElement): DOMRect {\n const cloned = element.cloneNode(true) as HTMLElement;\n // remove the id so there won't be two elements with the same id on the page\n cloned.removeAttribute(\"id\");\n\n // remove the role just in case the role would alert screen readers once added\n // to the dom\n cloned.removeAttribute(\"role\");\n\n // ensure the cloned node won't shift the page or be visible\n cloned.style.position = \"fixed\";\n cloned.style.visibility = \"hidden\";\n\n // reset positioning to get a \"pure\" calculation. otherwise this will mess up\n // the height and width if the element is able to line wrap.\n cloned.style.left = \"\";\n cloned.style.top = \"\";\n cloned.style.right = \"\";\n cloned.style.bottom = \"\";\n\n // reset transforms so that custom animations don't mess with the sizing\n cloned.style.transform = \"none\";\n\n const parent = element.parentElement || document.body;\n parent.appendChild(cloned);\n\n const rect = cloned.getBoundingClientRect();\n parent.removeChild(cloned);\n\n return rect;\n}\n\n/**\n * @remarks \\@since 4.0.0\n * @internal\n */\ninterface IsWithinViewportOptions {\n fixedElement: HTMLElement;\n fixedToElement: HTMLElement;\n}\n\n/**\n * @remarks \\@since 4.0.0\n * @internal\n */\nexport function isWithinViewport(options: IsWithinViewportOptions): boolean {\n const { fixedElement, fixedToElement } = options;\n const fixedElementRect = fixedElement.getBoundingClientRect();\n const fixedToElementRect = fixedToElement.getBoundingClientRect();\n const vh = window.innerHeight;\n const vw = window.innerWidth;\n const top = Math.min(fixedElementRect.top, fixedToElementRect.top);\n const right = Math.max(fixedElementRect.right, fixedToElementRect.right);\n const bottom = Math.max(fixedElementRect.bottom, fixedToElementRect.bottom);\n const left = Math.min(fixedElementRect.left, fixedToElementRect.left);\n\n return bottom >= 0 && top <= vh && right >= 0 && left <= vw;\n}\n"],"names":["getLeftCoord","xMargin","elWidth","initialX","containerRect","left","getInnerLeftCoord","getCenterXCoord","containerCenter","width","elementCenter","getInnerRightCoord","getRightCoord","getAboveCoord","yMargin","initialY","elHeight","top","getTopCoord","getCenterYCoord","height","getBottomCoord","getBelowCoord","getTransformOrigin","options","transformOriginY","yPosition","x","y","findSizingContainer","el","test","getAttribute","content","querySelector","label","document","id","data","process","env","NODE_ENV","Error","getElementRect","element","cloned","cloneNode","removeAttribute","style","position","visibility","right","bottom","transform","parent","parentElement","body","appendChild","rect","getBoundingClientRect","removeChild","isWithinViewport","fixedElement","fixedToElement","fixedElementRect","fixedToElementRect","vh","window","innerHeight","vw","innerWid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AEzB,MAAMC,SAASV,QAAQW,aAAa,IAAInB,SAASoB,IAAI;IACrDF,OAAOG,WAAW,CAACZ;IAEnB,MAAMa,OAAOb,OAAOc,qBAAqB;IACzCL,OAAOM,WAAW,CAACf;IAEnB,OAAOa;AACT;AAWA;;;CAGC,GACD,OAAO,SAASG,iBAAiBrC,OAAgC;IAC/D,MAAM,EAAEsC,YAAY,EAAEC,cAAc,EAAE,GAAGvC;IACzC,MAAMwC,mBAAmBF,aAAaH,qBAAqB;IAC3D,MAAMM,qBAAqBF,eAAeJ,qBAAqB;IAC/D,MAAMO,KAAKC,OAAOC,WAAW;IAC7B,MAAMC,KAAKF,OAAOG,UAAU;IAC5B,MAAMrD,MAAMsD,KAAKC,GAAG,CAACR,iBAAiB/C,GAAG,EAAEgD,mBAAmBhD,GAAG;IACjE,MAAMkC,QAAQoB,KAAKE,GAAG,CAACT,iBAAiBb,KAAK,EAAEc,mBAAmBd,KAAK;IACvE,MAAMC,SAASmB,KAAKE,GAAG,CAACT,iBAAiBZ,MAAM,EAAEa,mBAAmBb,MAAM;IAC1E,MAAM/C,OAAOkE,KAAKC,GAAG,CAACR,iBAAiB3D,IAAI,EAAE4D,mBAAmB5D,IAAI;IAEpE,OAAO+C,UAAU,KAAKnC,OAAOiD,MAAMf,SAAS,KAAK9C,QAAQgE;AAC3D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/progress/CircularProgress.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport {\n forwardRef,\n useMemo,\n type CSSProperties,\n type HTMLAttributes,\n} from \"react\";\nimport { cssUtils } from \"../cssUtils.js\";\nimport { type LabelRequiredForA11y } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { bem } from \"../utils/bem.js\";\nimport { getPercentage } from \"../utils/getPercentage.js\";\nimport { type ProgressProps } from \"./types.js\";\n\n/**\n * @remarks \\@since 6.0.0\n * Removed the `determinateRotateDegrees` prop since the determinate state no\n * longer rotates while increasing value.\n * Added the `disableShrink` prop.\n * Renamed the `small` prop to `dense` to match other components.\n */\nexport interface CircularProgressProps\n extends Omit<HTMLAttributes<HTMLSpanElement>, \"id\">,\n ProgressProps {\n /**\n * An optional style to apply to the svg within the circular progress. The\n * values of this style object will be merged with the current determinate\n * style (if it exists).\n */\n svgStyle?: CSSProperties;\n\n /**\n * An optional className to apply to the svg within the circular progress.\n */\n svgClassName?: string;\n\n /**\n * An optional style to apply to the circle within the circular progress. The\n * values of this style object will be merged with the current determinate\n * style (if it exists).\n */\n circleStyle?: CSSProperties;\n\n /**\n * An optional className to apply to the circle within the circular progress.\n */\n circleClassName?: string;\n\n /**\n * The radius for the circle. It is generally recommended to have the radius\n * be 1/2 of the viewbox and minus a few more pixels so that there is some\n * surrounding padding. You probably shouldn't really be changing this prop\n * though.\n *\n * @defaultValue `30`\n */\n radius?: number;\n\n /**\n * The center point for the circle. This should be half of the `viewBox` prop\n * 99% of the time and probably won't be changed.\n *\n * @defaultValue `33`\n */\n center?: number;\n\n /**\n * The viewbox for the child svg. I wouldn't recommend changing this value as\n * you will also need to update the `dashoffset` in both Sass and this prop to\n * get the animation to look nice again.\n *\n * @defaultValue `0 0 66 66`\n */\n viewBox?: string;\n\n /**\n * The `stroke-dashoffset` for the circle within the SVG. You probably won't\n * be changing this value that much as it should match the\n * `$rmd-progress-circle-dashoffset` Sass variable. This is really just used\n * to help to create the determinate progress animation.\n *\n * @defaultValue `187`\n */\n dashoffset?: number;\n\n /**\n * Boolean if the circular progress should be centered using left and right\n * margins.\n *\n * @defaultValue `false`\n */\n disableCentered?: boolean;\n\n /**\n * Set to `true` to render as a smaller size.\n *\n * @defaultValue `false`\n * @remarks\n * \\@since 2.3.0\n * \\@since 6.0.0 Renamed from `small`\n */\n dense?: boolean;\n\n /**\n * Set this to `true` to update the indeterminate behavior to only rotate\n * which will increase performance during CPU-intensive tasks or when many\n * loading spinners are displayed at once on the page.\n *\n * @defaultValue `false`\n * @remarks \\@since 6.0.0\n */\n disableShrink?: boolean;\n}\n\nconst styles = bem(\"rmd-circular-progress\");\n\n/**\n * **Server Component**\n *\n * @example\n * Indeterminate Example\n * ```tsx\n * import { CircularProgress } from \"@react-md/core\":\n * import { type ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return <CircularProgress aria-label=\"Loading\" />;\n * }\n * ```\n *\n * @example\n * Determinate Example\n * ```tsx\n * import { CircularProgress } from \"@react-md/core\":\n * import { useState, type ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * // a number from 0 - 100\n * const [progress, setProgress] = useState(0);\n *\n * return <CircularProgress aria-label=\"File upload\" value={progress} />;\n * }\n * ```\n *\n * @remarks \\@since 6.0.0 Updated the determinate circular progress to no longer\n * rotate while increasing the value and require a label for accessibility.\n */\nexport const CircularProgress = forwardRef<\n HTMLSpanElement,\n LabelRequiredForA11y<CircularProgressProps>\n>(function CircularProgress(props, ref) {\n const {\n id: propId,\n className,\n svgStyle,\n svgClassName,\n circleStyle: propCircleStyle,\n circleClassName,\n value,\n min = 0,\n max = 100,\n radius = 30,\n center = 33,\n viewBox = \"0 0 66 66\",\n theme = \"primary\",\n dense = false,\n dashoffset = 187,\n disableShrink = false,\n disableCentered = false,\n disableTransition = false,\n ...remaining\n } = props;\n\n const id = useEnsuredId(propId, \"circular-progress\");\n let progress: number | undefined;\n if (typeof value === \"number\") {\n progress = getPercentage({ min, max, value, validate: true });\n }\n\n const circleStyle = useMemo(() => {\n if (typeof progress !== \"number\") {\n return propCircleStyle;\n }\n\n return {\n ...propCircleStyle,\n strokeDashoffset: dashoffset - dashoffset * progress,\n };\n }, [progress, propCircleStyle, dashoffset]);\n\n const determinate = typeof progress === \"number\";\n const indeterminate = !determinate;\n return (\n <span\n {...remaining}\n id={id}\n ref={ref}\n role=\"progressbar\"\n aria-valuemin={min}\n aria-valuemax={max}\n aria-valuenow={value}\n className={cnb(\n styles({ dense, centered: !disableCentered }),\n theme !== \"current-color\" && cssUtils({ textColor: theme }),\n className\n )}\n >\n <svg\n style={svgStyle}\n className={cnb(\n styles(\"svg\", {\n determinate,\n indeterminate: indeterminate && !disableShrink,\n \"rotate-only\": indeterminate && disableShrink,\n }),\n svgClassName\n )}\n viewBox={viewBox}\n >\n <circle\n style={circleStyle}\n className={cnb(\n styles(\"circle\", {\n animate: !disableTransition && determinate,\n determinate,\n indeterminate: indeterminate && !disableShrink,\n \"rotate-only\": indeterminate && disableShrink,\n }),\n circleClassName\n )}\n r={radius}\n cx={center}\n cy={center}\n />\n </svg>\n </span>\n );\n});\n"],"names":["cnb","forwardRef","useMemo","cssUtils","useEnsuredId","bem","getPercentage","styles","CircularProgress","props","ref","id","propId","className","svgStyle","svgClassName","circleStyle","propCircleStyle","circleClassName","value","min","max","radius","center","viewBox","theme","dense","dashoffset","disableShrink","disableCentered","disableTransition","remaining","progress","validate","strokeDashoffset","determinate","indeterminate","span","role","aria-valuemin","aria-valuemax","aria-valuenow","centered","textColor","svg","style","circle","animate","r","cx","cy"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SACEC,UAAU,EACVC,OAAO,QAGF,QAAQ;AACf,SAASC,QAAQ,QAAQ,iBAAiB;AAE1C,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,GAAG,QAAQ,kBAAkB;AACtC,SAASC,aAAa,QAAQ,4BAA4B;AAuG1D,MAAMC,SAASF,IAAI;AAEnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BC,GACD,OAAO,MAAMG,iCAAmBP,WAG9B,SAASO,iBAAiBC,KAAK,EAAEC,GAAG;IACpC,MAAM,EACJC,IAAIC,MAAM,EACVC,SAAS,EACTC,QAAQ,EACRC,YAAY,EACZC,aAAaC,eAAe,EAC5BC,eAAe,EACfC,KAAK,EACLC,MAAM,CAAC,EACPC,MAAM,GAAG,EACTC,SAAS,EAAE,EACXC,SAAS,EAAE,EACXC,UAAU,WAAW,EACrBC,QAAQ,SAAS,EACjBC,QAAQ,KAAK,EACbC,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],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport {\n forwardRef,\n useMemo,\n type CSSProperties,\n type HTMLAttributes,\n} from \"react\";\nimport { cssUtils } from \"../cssUtils.js\";\nimport { type LabelRequiredForA11y } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { bem } from \"../utils/bem.js\";\nimport { getPercentage } from \"../utils/getPercentage.js\";\nimport { type ProgressProps } from \"./types.js\";\n\n/**\n * @remarks \\@since 6.0.0 Added the `theme` prop\n */\nexport interface LinearProgressProps\n extends Omit<HTMLAttributes<HTMLSpanElement>, \"id\" | \"children\">,\n ProgressProps {\n /**\n * An optional style to apply to the progress bar. This will be merged with\n * the current width or height tracking the progress when a `value` is also\n * provided.\n */\n barStyle?: CSSProperties;\n\n /**\n * An optional className to apply to the progress bar.\n */\n barClassName?: string;\n\n /**\n * Boolean if the progress should be reversed. This will change the progress\n * direction from `left-to-right` to be `right-to-left`. If the current\n * language is a rtl language and this prop is enabled, the direction will\n * still be `left-to-right`.\n *\n * @defaultValue `false`\n */\n reverse?: boolean;\n\n /**\n * Boolean if the progress should be vertical instead of horizontal. When\n * this prop is set, you should also set the `verticalHeight` prop to a height\n * value you want for your progress bar.\n *\n * @defaultValue `false`\n */\n vertical?: boolean;\n\n /**\n * Since there isn't really a good way to have \"auto height\", you'll need to\n * manually set the progress bar's height with this prop to some pixel value.\n * If you'd prefer to set the height in Sass/css, set this value to `null`\n * instead since this value would be passed down as a `height` inline style.\n *\n * @defaultValue `240`\n */\n verticalHeight?: number | null;\n}\n\nconst styles = bem(\"rmd-linear-progress\");\n\n/**\n * **Server Component**\n *\n * @example\n * Indeterminate Example\n * ```tsx\n * import { LinearProgress } from \"@react-md/core\";\n * import { type ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return <LinearProgress aria-label=\"Loading\" />;\n * }\n * ```\n *\n * @example\n * Determinate Example\n * ```tsx\n * import { LinearProgress } from \"@react-md/core\";\n * import { useState, type ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * // a number from 0 - 100\n * const [progress, setProgress] = useState(0);\n *\n * return <LinearProgress aria-label=\"File upload\" value={progress} />;\n * }\n * ```\n *\n * @remarks \\@since 6.0.0 Supports rendering as any of the theme colors and\n * requires a label for accessibility.\n */\nexport const LinearProgress = forwardRef<\n HTMLSpanElement,\n LabelRequiredForA11y<LinearProgressProps>\n>(function LinearProgress(props, ref) {\n const {\n id: propId,\n style: propStyle,\n className,\n barStyle: propBarStyle,\n barClassName,\n min = 0,\n max = 100,\n value,\n reverse = false,\n theme = \"primary\",\n disableTransition = false,\n vertical = false,\n verticalHeight = 240,\n ...remaining\n } = props;\n\n const id = useEnsuredId(propId, \"linear-progress\");\n const style = useMemo(() => {\n if (!vertical || verticalHeight === null) {\n return propStyle;\n }\n\n return {\n ...propStyle,\n height: verticalHeight,\n };\n }, [propStyle, vertical, verticalHeight]);\n\n let progress: number | undefined;\n if (typeof value === \"number\") {\n progress = getPercentage({ min, max, value, validate: true });\n }\n const barStyle = useMemo(() => {\n if (typeof progress !== \"number\") {\n return propBarStyle;\n }\n\n const key = vertical ? \"height\" : \"width\";\n return {\n ...propBarStyle,\n [key]: `${progress * 100}%`,\n };\n }, [progress, propBarStyle, vertical]);\n\n const determinate = typeof progress === \"number\";\n const indeterminate = !determinate;\n return (\n <span\n {...remaining}\n id={id}\n ref={ref}\n style={style}\n role=\"progressbar\"\n aria-valuemin={min}\n aria-valuemax={max}\n aria-valuenow={value}\n className={cnb(\n styles({\n vertical,\n horizontal: !vertical,\n determinate,\n indeterminate,\n }),\n theme !== \"current-color\" && cssUtils({ textColor: theme }),\n className\n )}\n >\n <span\n style={barStyle}\n className={cnb(\n styles(\"bar\", {\n vertical,\n \"vertical-reverse\": vertical && reverse,\n horizontal: !vertical,\n \"horizontal-reverse\": !vertical && reverse,\n animate: !disableTransition && determinate,\n determinate,\n indeterminate,\n \"determinate-reverse\": determinate && reverse && !vertical,\n \"determinate-vertical-reverse\": determinate && reverse && vertical,\n \"indeterminate-reverse\": indeterminate && reverse && !vertical,\n \"indeterminate-vertical\": indeterminate && vertical,\n \"indeterminate-vertical-reverse\":\n indeterminate && reverse && vertical,\n }),\n barClassName\n )}\n />\n </span>\n );\n});\n"],"names":["cnb","forwardRef","useMemo","cssUtils","useEnsuredId","bem","getPercentage","styles","LinearProgress","props","ref","id","propId","style","propStyle","className","barStyle","propBarStyle","barClassName","min","max","value","reverse","theme","disableTransition","vertical","verticalHeight","remaining","height","progress","validate","key","determinate","indeterminate","span","role","aria-valuemin","aria-valuemax","aria-valuenow","horizontal","textColor","animate"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SACEC,UAAU,EACVC,OAAO,QAGF,QAAQ;AACf,SAASC,QAAQ,QAAQ,iBAAiB;AAE1C,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,GAAG,QAAQ,kBAAkB;AACtC,SAASC,aAAa,QAAQ,4BAA4B;AAmD1D,MAAMC,SAASF,IAAI;AAEnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BC,GACD,OAAO,MAAMG,+BAAiBP,WAG5B,SAASO,eAAeC,KAAK,EAAEC,GAAG;IAClC,MAAM,EACJC,IAAIC,MAAM,EACVC,OAAOC,SAAS,EAChBC,SAAS,EACTC,UAAUC,YAAY,EACtBC,YAAY,EACZC,MAAM,CAAC,EACPC,MAAM,GAAG,EACTC,KAAK,EACLC,UAAU,KAAK,EACfC,QAAQ,SAAS,EACjBC,oBAAoB,KAAK,EACzBC,WAAW,KAAK,EAChBC,iBAAiB,GAAG,EACpB,GAAGC,WACJ,GAAGlB;IAEJ,MAAME,KAAKP,aAAaQ,QAAQ;IAChC,MAAMC,QAAQX,QAAQ;QACpB,IAAI,CAACuB,YAAYC,mBAAmB,MAAM;YACxC,OAAOZ;QACT;QAEA,OAAO;YACL,GAAGA,SAAS;YACZc,QAAQF;QACV;IACF,GAAG;QAACZ;QAAWW;QAAUC;KAAe;IAExC,IAAIG;IACJ,IAAI,OAAOR,UAAU,UAAU;QAC7BQ,WAAWvB,cAAc;YAAEa;YAAKC;YAAKC;YAAOS,UAAU;QAAK;IAC7D;IACA,MAAMd,WAAWd,QAAQ;QACvB,IAAI,OAAO2B,aAAa,UAAU;YAChC,OAAOZ;QACT;QAEA,MAAMc,MAAMN,WAAW,WAAW;QAClC,OAAO;YACL,GAAGR,YAAY;YACf,CAACc,IAAI,EAAE,CAAC,EAAEF,WAAW,IAAI,CAAC,CAAC;QAC7B;IACF,GAAG;QAACA;QAAUZ;QAAcQ;KAAS;IAErC,MAAMO,cAAc,OAAOH,aAAa;IACxC,MAAMI,gBAAgB,CAACD;IACvB,qBACE,KAACE;QACE,GAAGP,SAAS;QACbhB,IAAIA;QACJD,KAAKA;QACLG,OAAOA;QACPsB,MAAK;QACLC,iBAAejB;QACfkB,iBAAejB;QACfkB,iBAAejB;QACfN,WAAWf,IACTO,OAAO;YACLkB;YACAc,YAAY,CAACd;YACbO;YACAC;QACF,IACAV,UAAU,mBAAmBpB,SAAS;YAAEqC,WAAWjB;QAAM,IACzDR;kBAGF,cAAA,KAACmB;YACCrB,OAAOG;YACPD,WAAWf,IACTO,OAAO,OAAO;gBACZkB;gBACA,oBAAoBA,YAAYH;gBAChCiB,YAAY,CAACd;gBACb,sBAAsB,CAACA,YAAYH;gBACnCmB,SAAS,CAACjB,qBAAqBQ;gBAC/BA;gBACAC;gBACA,uBAAuBD,eAAeV,WAAW,CAACG;gBAClD,gCAAgCO,eAAeV,WAAWG;gBAC1D,yBAAyBQ,iBAAiBX,WAAW,CAACG;gBACtD,0BAA0BQ,iBAAiBR;gBAC3C,kCACEQ,iBAAiBX,WAAWG;YAChC,IACAP;;;AAKV,GAAG"}
|
|
@@ -561,12 +561,17 @@ $variables: (
|
|
|
561
561
|
}
|
|
562
562
|
}
|
|
563
563
|
|
|
564
|
-
@mixin styles {
|
|
565
|
-
@
|
|
566
|
-
|
|
567
|
-
|
|
564
|
+
@mixin styles($disable-layer: false) {
|
|
565
|
+
@include utils.optional-layer(
|
|
566
|
+
overlay,
|
|
567
|
+
$disable-layer or ($disable-circular and $disable-linear)
|
|
568
|
+
) {
|
|
569
|
+
@if not $disable-circular {
|
|
570
|
+
@include _circular-progress;
|
|
571
|
+
}
|
|
568
572
|
|
|
569
|
-
|
|
570
|
-
|
|
573
|
+
@if not $disable-linear {
|
|
574
|
+
@include _linear-progress;
|
|
575
|
+
}
|
|
571
576
|
}
|
|
572
577
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/progress/getProgressA11y.ts"],"sourcesContent":["export interface ProgressA11y {\n \"aria-busy\": true;\n \"aria-describedby\": string;\n}\n\n/**\n * An extremely simple util that can be used to get the required a11y props for\n * another component that relies on a progress component.\n *\n * @param progressId - The id for the progress bar\n * @param progressing - Boolean if the progress bar is visible and progressing\n */\nexport function getProgressA11y(\n progressId: string,\n progressing: boolean\n): ProgressA11y | undefined {\n if (!progressing) {\n return undefined;\n }\n\n return {\n \"aria-busy\": true,\n \"aria-describedby\": progressId,\n };\n}\n"],"names":["getProgressA11y","progressId","progressing","undefined"],"mappings":"AAKA;;;;;;CAMC,GACD,OAAO,SAASA,gBACdC,UAAkB,EAClBC,WAAoB;IAEpB,IAAI,CAACA,aAAa;QAChB,OAAOC;IACT;IAEA,OAAO;QACL,aAAa;QACb,oBAAoBF;IACtB;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/progress/types.ts"],"sourcesContent":["import { type ThemeColor } from \"../cssUtils.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-progress-background-color\"?: string;\n \"--rmd-progress-color\"?: string;\n \"--rmd-progress-circular-size\"?: string | number;\n \"--rmd-progress-circular-stroke-width\"?: number;\n \"--rmd-progress-linear-size\"?: string | number;\n }\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type ProgressTheme = ThemeColor | \"current-color\";\n\n/**\n * The base progress props for both the linear and circular progress components.\n *\n * @remarks \\@since 6.0.0 Added the `theme` prop.\n */\nexport interface ProgressProps {\n /**\n * The id for the progress component. This is required for accessibility since\n * the progress will 99% of the time be describing the progress of something\n * else within the page. The element that is loading or tracking progress\n * should also be updated to have `aria-busy=\"true\"` and\n * `aria-describedby=\"THIS_ID\"`.\n *\n * @defaultValue `\"circular-progress-\" useId() || \"linear-progress-\" + useId()`\n * @remarks \\@since 6.0.0 This prop is now optional.\n */\n id?: string;\n\n /**\n * The min value for the progress component. This is used to determine the\n * current progress percentage for screen readers and styles.\n *\n * @defaultValue `0`\n */\n min?: number;\n\n /**\n * The max value for the progress component. This is used to determine the\n * current progress percentage for screen readers and styles.\n *\n * @defaultValue `100`\n */\n max?: number;\n\n /**\n * The current value for the progress component. If this prop is omitted, the\n * progress component will be put in an \"indeterminate\" state which will just\n * infinitely loop an animation until it is unmounted.\n *\n * This value will be passed down as a percentage based on the `min` and `max`\n * props so that screen readers can be notified of changes.\n */\n value?: number;\n\n /**\n * Boolean if the determinate progress versions should animate when the value\n * changes. This should really only be enabled if you aren't getting quick\n * progress updates or the updates happen in chunks.\n *\n * @defaultValue `false`\n * @remarks \\@since 6.0.0 This was renamed from `animate` to\n * `disableTransition`.\n */\n disableTransition?: boolean;\n\n /**\n * @defaultValue `\"primary\"`\n * @remarks \\@since 6.0.0\n */\n theme?: ProgressTheme;\n}\n"],"names":[],"mappings":"AAiBA;;;;CAIC,GACD,WAuDC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/responsive-item/ResponsiveItemContainer.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { forwardRef, type HTMLAttributes } from \"react\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-responsive-item-container\");\n\n/** @remarks \\@since 6.0.0 */\nexport interface ResponsiveItemContainerClassNameOptions {\n className?: string;\n\n /**\n * Set this to `true` if the container should gain the following styles:\n *\n * ```scss\n * display: block;\n * width: 100%;\n * ```\n *\n * @defaultValue `false`\n */\n fullWidth?: boolean;\n\n /**\n * Set this to a custom aspect ratio to use.\n *\n * @example\n * Valid Aspect Ratios\n * ```tsx\n * aspectRatio=\"16-9\"\n * aspectRatio=\"9-16\"\n * aspectRatio=\"3-4\"\n * aspectRatio=\"4-3\"\n * aspectRatio=\"1-1\"\n * ```\n *\n * These values are based on the `core.$responsive-item-aspect-ratios` map.\n *\n * @defaultValue `\"\"`\n */\n aspectRatio?: `${number}-${number}`;\n\n /**\n * Set this to `\"manual\"` if you want to manually specify which elements are\n * responsive items using custom class names. You probably don't really want\n * to use this.\n *\n * Set this to `\"auto\"` to automatically update all visual media that appear\n * as a child in this component to a responsive item.\n *\n * Set this to `\"container\"` to automatically update all visual media that\n * appear as a child in this component to be a responsive item that scales to\n * the container's dimensions.\n *\n * Note: The `\"auto\"` and `\"container\"` values use the\n * `core.$responsive-item-selectors` value for their behavior.\n *\n * @defaultValue `\"auto\"`\n */\n responsive?: \"auto\" | \"manual\" | \"container\";\n}\n\n/** @remarks \\@since 6.0.0 */\nexport function responsiveItemContainer(\n options: ResponsiveItemContainerClassNameOptions = {}\n): string {\n const {\n className,\n fullWidth = false,\n aspectRatio = \"\",\n responsive = \"auto\",\n } = options;\n\n return cnb(\n styles({\n auto: responsive !== \"manual\",\n \"auto-scale\": responsive === \"container\",\n \"aspect-ratio\": aspectRatio,\n [aspectRatio]: aspectRatio,\n \"full-width\": fullWidth,\n }),\n className\n );\n}\n\n/**\n * @remarks\n * \\@since 6.0.0 Renamed from `MediaContainerProps` to\n * `ResponsiveItemContainerProps`\n * \\@since 6.0.0 The `height` and `width` props were removed in favor of the\n * `aspectRatio` props since the latest typescript string interpolation supports\n * enforcing the correct format.\n * \\@since 6.0.0 The `auto` prop was removed in favor of the new\n * {@link ResponsiveItemContainerProps.responsive} prop.\n */\nexport interface ResponsiveItemContainerProps\n extends HTMLAttributes<HTMLSpanElement>,\n ResponsiveItemContainerClassNameOptions {}\n\n/**\n * **Server Component**\n *\n * @example\n * Image Example\n * ```tsx\n * import { ResponsiveItemContainer } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <ResponsiveItemContainer>\n * <img alt=\"\" src=\"/some-image.png\" />\n * </ResponsiveItemContainer>\n * );\n * }\n * ```\n *\n * @example\n * Iframe Example\n * ```tsx\n * import { ResponsiveItemContainer } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <ResponsiveItemContainer>\n * <iframe\n * src=\"https://youtube.com/some-video-url\"\n * title=\"Some YouTube video\"\n * allowFullScreen\n * />\n * </ResponsiveItemContainer>\n * );\n * }\n * ```\n *\n * @example\n * Forced Aspect Ratio\n * ```tsx\n * import { ResponsiveItemContainer } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <ResponsiveItemContainer aspectRatio=\"16-9\">\n * <img alt=\"\" src=\"/some-image.png\" />\n * </ResponsiveItemContainer>\n * );\n * }\n * ```\n *\n * @remarks \\@since 6.0.0 Renamed from `MediaContainer` to\n * `ResponsiveItemContainer` and renders a `<span>` instead of a `<div>`.\n */\nexport const ResponsiveItemContainer = forwardRef<\n HTMLSpanElement,\n ResponsiveItemContainerProps\n>(function ResponsiveItemContainer(props, ref) {\n const {\n className,\n fullWidth = false,\n aspectRatio,\n responsive = \"auto\",\n children,\n ...remaining\n } = props;\n\n return (\n <span\n {...remaining}\n ref={ref}\n className={responsiveItemContainer({\n className,\n fullWidth,\n aspectRatio,\n responsive,\n })}\n >\n {children}\n </span>\n );\n});\n"],"names":["cnb","forwardRef","bem","styles","responsiveItemContainer","options","className","fullWidth","aspectRatio","responsive","auto","ResponsiveItemContainer","props","ref","children","remaining","span"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,UAAU,QAA6B,QAAQ;AACxD,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AAyDnB,2BAA2B,GAC3B,OAAO,SAASE,wBACdC,UAAmD,CAAC,CAAC;IAErD,MAAM,EACJC,SAAS,EACTC,YAAY,KAAK,EACjBC,cAAc,EAAE,EAChBC,aAAa,MAAM,EACpB,GAAGJ;IAEJ,OAAOL,IACLG,OAAO;QACLO,MAAMD,eAAe;QACrB,cAAcA,eAAe;QAC7B,gBAAgBD;QAChB,CAACA,YAAY,EAAEA;QACf,cAAcD;IAChB,IACAD;AAEJ;AAgBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsDC,GACD,OAAO,MAAMK,wCAA0BV,WAGrC,SAASU,wBAAwBC,KAAK,EAAEC,GAAG;IAC3C,MAAM,EACJP,SAAS,EACTC,YAAY,KAAK,EACjBC,WAAW,EACXC,aAAa,MAAM,EACnBK,QAAQ,EACR,GAAGC,WACJ,GAAGH;IAEJ,qBACE,KAACI;QACE,GAAGD,SAAS;QACbF,KAAKA;QACLP,WAAWF,wBAAwB;YACjCE;YACAC;YACAC;YACAC;QACF;kBAECK;;AAGP,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/responsive-item/ResponsiveItemOverlay.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { forwardRef, type HTMLAttributes } from \"react\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-responsive-item-overlay\");\n\n/**\n * The overlay positions relative to the `MediaContainer` component. Most of\n * the sizes are self-explanatory, but the `middle` position will be centered\n * vertically while `center` will be centered `horizontally`.\n *\n * @remarks \\@since 6.0.0 Renamed from `MediaOverlayPosition` to\n * `ResponsiveItemOverlayProps`.\n */\nexport type ResponsiveItemOverlayPosition =\n | \"top\"\n | \"right\"\n | \"bottom\"\n | \"left\"\n | \"middle\"\n | \"center\"\n | \"absolute-center\";\n\n/** @remarks \\@since 6.0.0 */\nexport interface ResponsiveItemOverlayClassNameOptions {\n className?: string;\n /** @defaultValue `\"bottom\"` */\n position?: ResponsiveItemOverlayPosition;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport function responsiveItemOverlay(\n options: ResponsiveItemOverlayClassNameOptions = {}\n): string {\n const { className, position = \"bottom\" } = options;\n\n return cnb(\n styles({\n [position]: true,\n horizontal:\n position !== \"top\" && position !== \"bottom\" && position !== \"middle\",\n }),\n className\n );\n}\n\n/**\n * @remarks \\@since 6.0.0 Renamed from `MediaOverlayProps` to\n * `ResponsiveItemOverlayProps`.\n */\nexport interface ResponsiveItemOverlayProps\n extends HTMLAttributes<HTMLSpanElement>,\n ResponsiveItemOverlayClassNameOptions {}\n\n/**\n * **Server Component**\n *\n * @example\n * Simple Example\n * ```tsx\n * import { ResponsiveItemContainer, ResponsiveItemOverlay } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <ResponsiveItemContainer>\n * <img alt=\"\" src=\"/some-image.png\" />\n * <ResponsiveItemOverlay>\n * <Typography type=\"headline-5\" margin=\"none\">\n * This appears at the bottom by default.\n * </Typography>\n * </ResponsiveItemOverlay>\n * </ResponsiveItemContainer>\n * );\n * }\n * ```\n *\n * @see {@link ResponsiveItemOverlayPosition}\n *\n * @remarks \\@since 6.0.0 Renamed from `MediaOverlay` to `ResponsiveItemOverlay`\n * and renders as a `<span>` instead of a `<div>`.\n */\nexport const ResponsiveItemOverlay = forwardRef<\n HTMLSpanElement,\n ResponsiveItemOverlayProps\n>(function ResponsiveItemOverlay(props, ref) {\n const { className, children, position = \"bottom\", ...remaining } = props;\n\n return (\n <span\n {...remaining}\n ref={ref}\n className={responsiveItemOverlay({ className, position })}\n >\n {children}\n </span>\n );\n});\n"],"names":["cnb","forwardRef","bem","styles","responsiveItemOverlay","options","className","position","horizontal","ResponsiveItemOverlay","props","ref","children","remaining","span"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,UAAU,QAA6B,QAAQ;AACxD,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AA0BnB;;CAEC,GACD,OAAO,SAASE,sBACdC,UAAiD,CAAC,CAAC;IAEnD,MAAM,EAAEC,SAAS,EAAEC,WAAW,QAAQ,EAAE,GAAGF;IAE3C,OAAOL,IACLG,OAAO;QACL,CAACI,SAAS,EAAE;QACZC,YACED,aAAa,SAASA,aAAa,YAAYA,aAAa;IAChE,IACAD;AAEJ;AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BC,GACD,OAAO,MAAMG,sCAAwBR,WAGnC,SAASQ,sBAAsBC,KAAK,EAAEC,GAAG;IACzC,MAAM,EAAEL,SAAS,EAAEM,QAAQ,EAAEL,WAAW,QAAQ,EAAE,GAAGM,WAAW,GAAGH;IAEnE,qBACE,KAACI;QACE,GAAGD,SAAS;QACbF,KAAKA;QACLL,WAAWF,sBAAsB;YAAEE;YAAWC;QAAS;kBAEtDK;;AAGP,GAAG"}
|
|
@@ -58,134 +58,136 @@ $disable-aspect-ratios: not list.length(map.keys($aspect-ratios)) !default;
|
|
|
58
58
|
padding-bottom: math.percentage(math.div($height, $width));
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
@mixin styles {
|
|
61
|
+
@mixin styles($disable-layer: false) {
|
|
62
62
|
@if not $disable-everything {
|
|
63
|
-
@
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
63
|
+
@include utils.optional-layer(responsive-item, $disable-layer) {
|
|
64
|
+
@if not $disable-item {
|
|
65
|
+
.rmd-responsive-item {
|
|
66
|
+
@include responsive-item;
|
|
67
|
+
|
|
68
|
+
@if not $disable-scale-to-container {
|
|
69
|
+
&--scale {
|
|
70
|
+
@include scale-to-container;
|
|
71
|
+
}
|
|
70
72
|
}
|
|
71
|
-
}
|
|
72
73
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
@if not $disable-aspect-ratios {
|
|
75
|
+
&--aspect-ratio {
|
|
76
|
+
@include forced-aspect-ratio;
|
|
77
|
+
}
|
|
76
78
|
}
|
|
77
79
|
}
|
|
78
80
|
}
|
|
79
|
-
}
|
|
80
81
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
.rmd-responsive-item-container {
|
|
83
|
+
display: inline-block;
|
|
84
|
+
position: relative;
|
|
84
85
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
86
|
+
@if not $disable-auto {
|
|
87
|
+
&--auto {
|
|
88
|
+
@each $selector in $selectors {
|
|
89
|
+
#{$selector} {
|
|
90
|
+
@include responsive-item;
|
|
91
|
+
}
|
|
90
92
|
}
|
|
91
93
|
}
|
|
92
|
-
}
|
|
93
94
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
@if not $disable-auto-scale {
|
|
96
|
+
&--auto-scale {
|
|
97
|
+
@each $selector in $selectors {
|
|
98
|
+
#{$selector} {
|
|
99
|
+
@include scale-to-container;
|
|
100
|
+
}
|
|
99
101
|
}
|
|
100
102
|
}
|
|
101
103
|
}
|
|
102
104
|
}
|
|
103
|
-
}
|
|
104
105
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
@if not $disable-full-width {
|
|
107
|
+
&--full-width {
|
|
108
|
+
display: block;
|
|
109
|
+
width: 100%;
|
|
110
|
+
}
|
|
109
111
|
}
|
|
110
|
-
}
|
|
111
112
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
113
|
+
@if not $disable-aspect-ratios {
|
|
114
|
+
&--aspect-ratio {
|
|
115
|
+
display: block;
|
|
116
|
+
height: 0;
|
|
117
|
+
overflow: hidden;
|
|
118
|
+
padding: 0;
|
|
118
119
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
@each $selector in $selectors {
|
|
121
|
+
#{$selector} {
|
|
122
|
+
@include forced-aspect-ratio;
|
|
123
|
+
}
|
|
122
124
|
}
|
|
123
125
|
}
|
|
124
|
-
}
|
|
125
126
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
@each $suffix, $ratio-list in $aspect-ratios {
|
|
128
|
+
&--#{$suffix} {
|
|
129
|
+
@include aspect-ratio(nth($ratio-list, 1), nth($ratio-list, 2));
|
|
130
|
+
}
|
|
129
131
|
}
|
|
130
132
|
}
|
|
131
133
|
}
|
|
132
|
-
}
|
|
133
134
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
135
|
+
@if not $disable-overlay {
|
|
136
|
+
.rmd-responsive-item-overlay {
|
|
137
|
+
background-color: $background-color;
|
|
138
|
+
color: $color;
|
|
139
|
+
padding: $overlay-padding;
|
|
140
|
+
position: absolute;
|
|
141
|
+
z-index: 0;
|
|
142
|
+
|
|
143
|
+
@if not $disable-overlay-top {
|
|
144
|
+
&--top {
|
|
145
|
+
inset: 0 0 auto;
|
|
146
|
+
}
|
|
145
147
|
}
|
|
146
|
-
}
|
|
147
148
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
@if not $disable-overlay-bottom {
|
|
150
|
+
&--bottom {
|
|
151
|
+
inset: auto 0 0;
|
|
152
|
+
}
|
|
151
153
|
}
|
|
152
|
-
}
|
|
153
154
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
155
|
+
&--horizontal {
|
|
156
|
+
inset: 0 auto;
|
|
157
|
+
width: $overlay-horizontal-width;
|
|
158
|
+
}
|
|
158
159
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
160
|
+
@if not $disable-overlay-left {
|
|
161
|
+
&--left {
|
|
162
|
+
@include utils.auto-rtl(left, 0);
|
|
163
|
+
}
|
|
162
164
|
}
|
|
163
|
-
}
|
|
164
165
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
166
|
+
@if not $disable-overlay-right {
|
|
167
|
+
&--right {
|
|
168
|
+
@include utils.auto-rtl(right, 0);
|
|
169
|
+
}
|
|
168
170
|
}
|
|
169
|
-
}
|
|
170
171
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
172
|
+
@if not $disable-overlay-middle {
|
|
173
|
+
&--middle {
|
|
174
|
+
inset: auto 0 50%;
|
|
175
|
+
transform: translate3d(0, 50%, 0);
|
|
176
|
+
}
|
|
175
177
|
}
|
|
176
|
-
}
|
|
177
178
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
179
|
+
@if not $disable-overlay-center {
|
|
180
|
+
&--center {
|
|
181
|
+
inset: 0 50% 0 auto;
|
|
182
|
+
transform: translate3d(50%, 0, 0);
|
|
183
|
+
}
|
|
182
184
|
}
|
|
183
|
-
}
|
|
184
185
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
186
|
+
@if not $disable-overlay-absolute-center {
|
|
187
|
+
&--absolute-center {
|
|
188
|
+
inset: auto 50% 50% auto;
|
|
189
|
+
transform: translate3d(50%, 50%, 0);
|
|
190
|
+
}
|
|
189
191
|
}
|
|
190
192
|
}
|
|
191
193
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/responsive-item/styles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-responsive-item\");\n\n/** @remarks \\@since 6.0.0 */\nexport interface ResponsiveItemClassNameOptions {\n className?: string;\n\n /**\n * Set this to `true` to apply the following styles:\n * ```scss\n * max-height: 100%;\n * max-width: 100%;\n * object-fit: contain;\n * ```\n *\n * This is useful for displaying images in a full page dialog so that scroll\n * bars do not appear while maintaining the correct aspect ratio for the item.\n *\n * @defaultValue `false`\n */\n scaleToContainer?: boolean;\n\n /**\n * Set this to `true` to force a specific aspect ratio.\n *\n * Note: This will only work if the parent element has applied the correct\n * {@link ResponsiveItemContainerStyles} as well.\n *\n * @defaultValue `false`\n */\n forcedAspectRatio?: boolean;\n}\n\n/**\n * Applies the visual media responsive styles manually if you cannot use the\n * `ResponsiveItemContainer` component.\n *\n * @remarks \\@since 6.0.0\n */\nexport function responsiveItem(\n options: ResponsiveItemClassNameOptions = {}\n): string {\n const {\n className,\n scaleToContainer = false,\n forcedAspectRatio = false,\n } = options;\n\n return cnb(\n styles({\n scale: scaleToContainer,\n \"aspect-ratio\": forcedAspectRatio,\n }),\n className\n );\n}\n"],"names":["cnb","bem","styles","responsiveItem","options","className","scaleToContainer","forcedAspectRatio","scale"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AAgCnB;;;;;CAKC,GACD,OAAO,SAASE,eACdC,UAA0C,CAAC,CAAC;IAE5C,MAAM,EACJC,SAAS,EACTC,mBAAmB,KAAK,EACxBC,oBAAoB,KAAK,EAC1B,GAAGH;IAEJ,OAAOJ,IACLE,OAAO;QACLM,OAAOF;QACP,gBAAgBC;IAClB,IACAF;AAEJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/scroll/ScrollLock.tsx"],"sourcesContent":["\"use client\";\nimport { useScrollLock } from \"./useScrollLock.js\";\n\n/**\n * **Client Component**\n *\n * This is a convenience component that can be used within transitionable\n * components to ensure the scroll lock is active only while the element is\n * rendered.\n *\n * @remarks \\@since 6.0.0\n */\nexport function ScrollLock(): null {\n useScrollLock(true);\n return null;\n}\n"],"names":["useScrollLock","ScrollLock"],"mappings":"AAAA;AACA,SAASA,aAAa,QAAQ,qBAAqB;AAEnD;;;;;;;;CAQC,GACD,OAAO,SAASC;IACdD,cAAc;IACd,OAAO;AACT"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/scroll/getScrollbarWidth.ts"],"sourcesContent":["let cache: number | undefined;\n\n/**\n * @internal\n */\nexport function getScrollbarWidth(force = false): number {\n /* istanbul ignore if */\n if (typeof window === \"undefined\") {\n return 0;\n }\n\n let value = cache;\n if (!force && typeof value === \"number\") {\n return value;\n }\n\n const outer = document.createElement(\"div\");\n outer.style.visibility = \"hidden\";\n outer.style.overflow = \"scroll\";\n document.body.appendChild(outer);\n\n const inner = document.createElement(\"div\");\n outer.appendChild(inner);\n\n // the scrollbar width can be determined by comparing the width of the parent\n // element that has scrollbars to the child element that does not.\n value = outer.offsetWidth - inner.offsetWidth;\n cache = value;\n document.body.removeChild(outer);\n\n return value;\n}\n"],"names":["cache","getScrollbarWidth","force","window","value","outer","document","createElement","style","visibility","overflow","body","appendChild","inner","offsetWidth","removeChild"],"mappings":"AAAA,IAAIA;AAEJ;;CAEC,GACD,OAAO,SAASC,kBAAkBC,QAAQ,KAAK;IAC7C,sBAAsB,GACtB,IAAI,OAAOC,WAAW,aAAa;QACjC,OAAO;IACT;IAEA,IAAIC,QAAQJ;IACZ,IAAI,CAACE,SAAS,OAAOE,UAAU,UAAU;QACvC,OAAOA;IACT;IAEA,MAAMC,QAAQC,SAASC,aAAa,CAAC;IACrCF,MAAMG,KAAK,CAACC,UAAU,GAAG;IACzBJ,MAAMG,KAAK,CAACE,QAAQ,GAAG;IACvBJ,SAASK,IAAI,CAACC,WAAW,CAACP;IAE1B,MAAMQ,QAAQP,SAASC,aAAa,CAAC;IACrCF,MAAMO,WAAW,CAACC;IAElB,6EAA6E;IAC7E,kEAAkE;IAClET,QAAQC,MAAMS,WAAW,GAAGD,MAAMC,WAAW;IAC7Cd,QAAQI;IACRE,SAASK,IAAI,CAACI,WAAW,CAACV;IAE1B,OAAOD;AACT"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/scroll/useScrollLock.ts"],"sourcesContent":["\"use client\";\nimport { useEffect } from \"react\";\nimport { getScrollbarWidth } from \"./getScrollbarWidth.js\";\n\nexport const SCROLLBAR_SIZE_VAR = \"--rmd-scrollbar-size\";\n\n// this is really just so that nested dialogs will work correctly. Only the\n// first created dialog should prevent scroll locking on the `document.body`\nlet isLocked = false;\n\n/**\n *\n * @internal\n * @remarks\n * \\@since 6.0.0 No longer support scroll locking elements other than\n * the `document.body` since it's more reliable to scroll lock with an overlay.\n * \\@since 6.0.0 Now applies `paddingRight` equal to the current OS's\n * scrollbar width if there is a full page scrollbar to prevent layout shifting.\n *\n * @param locked - The `document.body` will not be scrollable when this is\n * `true`.\n */\nexport function useScrollLock(locked: boolean): void {\n useEffect(() => {\n if (isLocked || !locked) {\n return;\n }\n\n isLocked = true;\n\n const size = `${getScrollbarWidth()}px`;\n const el = document.body;\n const { paddingRight } = el.style;\n const isScrollbarVisible = el.scrollHeight > el.offsetHeight;\n\n el.style.overflow = \"hidden\";\n if (isScrollbarVisible) {\n el.style.setProperty(SCROLLBAR_SIZE_VAR, size);\n el.style.paddingRight = `var(${SCROLLBAR_SIZE_VAR})`;\n }\n\n return () => {\n isLocked = false;\n\n el.style.removeProperty(SCROLLBAR_SIZE_VAR);\n el.style.overflow = \"\";\n if (isScrollbarVisible) {\n el.style.paddingRight = paddingRight;\n }\n };\n }, [locked]);\n}\n"],"names":["useEffect","getScrollbarWidth","SCROLLBAR_SIZE_VAR","isLocked","useScrollLock","locked","size","el","document","body","paddingRight","style","isScrollbarVisible","scrollHeight","offsetHeight","overflow","setProperty","removeProperty"],"mappings":"AAAA;AACA,SAASA,SAAS,QAAQ,QAAQ;AAClC,SAASC,iBAAiB,QAAQ,yBAAyB;AAE3D,OAAO,MAAMC,qBAAqB,uBAAuB;AAEzD,2EAA2E;AAC3E,4EAA4E;AAC5E,IAAIC,WAAW;AAEf;;;;;;;;;;;CAWC,GACD,OAAO,SAASC,cAAcC,MAAe;IAC3CL,UAAU;QACR,IAAIG,YAAY,CAACE,QAAQ;YACvB;QACF;QAEAF,WAAW;QAEX,MAAMG,OAAO,CAAC,EAAEL,oBAAoB,EAAE,CAAC;QACvC,MAAMM,KAAKC,SAASC,IAAI;QACxB,MAAM,EAAEC,YAAY,EAAE,GAAGH,GAAGI,KAAK;QACjC,MAAMC,qBAAqBL,GAAGM,YAAY,GAAGN,GAAGO,YAAY;QAE5DP,GAAGI,KAAK,CAACI,QAAQ,GAAG;QACpB,IAAIH,oBAAoB;YACtBL,GAAGI,KAAK,CAACK,WAAW,CAACd,oBAAoBI;YACzCC,GAAGI,KAAK,CAACD,YAAY,GAAG,CAAC,IAAI,EAAER,mBAAmB,CAAC,CAAC;QACtD;QAEA,OAAO;YACLC,WAAW;YAEXI,GAAGI,KAAK,CAACM,cAAc,CAACf;YACxBK,GAAGI,KAAK,CAACI,QAAQ,GAAG;YACpB,IAAIH,oBAAoB;gBACtBL,GAAGI,KAAK,CAACD,YAAY,GAAGA;YAC1B;QACF;IACF,GAAG;QAACL;KAAO;AACb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/segmented-button/SegmentedButton.tsx"],"sourcesContent":["\"use client\";\nimport { forwardRef, type ButtonHTMLAttributes, type ReactNode } from \"react\";\nimport { getIcon } from \"../icon/iconConfig.js\";\nimport { useElementInteraction } from \"../interaction/useElementInteraction.js\";\nimport { useHigherContrastChildren } from \"../interaction/useHigherContrastChildren.js\";\nimport { useMaxWidthTransition } from \"../transition/useMaxWidthTransition.js\";\nimport { segmentedButton } from \"./segmentedButtonStyles.js\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface SegmentedButtonProps\n extends ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * Set this to `true` to apply selected styles and an optional\n * {@link selectedIcon}\n *\n * @defaultValue `false`\n */\n selected?: boolean;\n\n /** @defaultValue `getIcon(\"selected\")` */\n selectedIcon?: ReactNode;\n\n /**\n * An optional className to apply when {@link selected} is `true`.\n */\n selectedClassName?: string;\n\n /**\n * Set this to `true` to not render the {@link selectedIcon} when\n * {@link selected} is `true`.\n *\n * @defaultValue `false`\n */\n disableSelectedIcon?: boolean;\n\n /**\n * Set this to `true` to disable the {@link selectedIcon} enter/exit\n * transition and instead just use `display: none`.\n *\n * @defaultValue `false`\n */\n disableSelectedTransition?: boolean;\n\n /**\n * An optional addon to render before the {@link children} and after the\n * {@link selectedIcon}. This is only useful when rendering text children so\n * it can appear above the interaction states.\n */\n leftAddon?: ReactNode;\n\n /**\n * An optional addon to render after the {@link children}. This is only useful\n * when rendering text children so it can appear above the interaction states.\n */\n rightAddon?: ReactNode;\n}\n\n/**\n * **Client Component**\n *\n * @example\n * Simple Example\n * ```tsx\n * import {\n * SegmentedButton,\n * SegmentedButtonContainer,\n * } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n * import { useState } from \"react\";\n *\n * function Example(): ReactElement {\n * const [value, setValue] = useState(\"a\");\n * return (\n * <SegmentedButtonContainer>\n * <SegmentedButton\n * onClick={() => setValue(\"a\")}\n * selected={value === \"a\"}\n * >\n * First\n * </SegmentedButton>\n * <SegmentedButton\n * onClick={() => setValue(\"b\")}\n * selected={value === \"b\"}\n * >\n * Second\n * </SegmentedButton>\n * <SegmentedButton\n * onClick={() => setValue(\"c\")}\n * selected={value === \"c\"}\n * disableSelectedIcon\n * >\n * Third\n * </SegmentedButton>\n * </SegmentedButtonContainer>\n * );\n * }\n * ```\n *\n * @remarks \\@since 6.0.0\n */\nexport const SegmentedButton = forwardRef<\n HTMLButtonElement,\n SegmentedButtonProps\n>(function SegmentedButton(props, ref) {\n const {\n className,\n type = \"button\",\n leftAddon,\n rightAddon,\n children: propChildren,\n selected,\n selectedIcon: propSelectedIcon,\n selectedClassName,\n disableSelectedIcon,\n disableSelectedTransition,\n onBlur,\n onClick,\n onKeyDown,\n onKeyUp,\n onMouseDown,\n onMouseUp,\n onMouseLeave,\n onDragStart,\n onTouchStart,\n onTouchEnd,\n onTouchMove,\n disabled,\n ...remaining\n } = props;\n\n const children = useHigherContrastChildren(propChildren);\n const selectedIconNode = getIcon(\"selected\", propSelectedIcon);\n const selectedIcon = useMaxWidthTransition({\n element: selectedIconNode,\n transitionIn: !!selected,\n disabled: disableSelectedIcon,\n disableTransition: disableSelectedTransition,\n });\n const { pressedClassName, handlers, ripples } = useElementInteraction({\n onBlur,\n onClick,\n onKeyDown,\n onKeyUp,\n onMouseDown,\n onMouseUp,\n onMouseLeave,\n onDragStart,\n onTouchStart,\n onTouchEnd,\n onTouchMove,\n disabled,\n });\n\n return (\n <button\n {...remaining}\n {...handlers}\n aria-pressed={selected}\n ref={ref}\n type={type}\n disabled={disabled}\n className={segmentedButton({\n className,\n selected,\n selectedClassName,\n pressedClassName,\n })}\n >\n {!disableSelectedIcon && selectedIcon}\n {leftAddon}\n {children}\n {rightAddon}\n {ripples}\n </button>\n );\n});\n"],"names":["forwardRef","getIcon","useElementInteraction","useHigherContrastChildren","useMaxWidthTransition","segmentedButton","SegmentedButton","props","ref","className","type","leftAddon","rightAddon","children","propChildren","selected","selectedIcon","propSelectedIcon","selectedClassName","disableSelectedIcon","disableSelectedTransition","onBlur","onClick","onKeyDown","onKeyUp","onMouseDown","onMouseUp","onMouseLeave","onDragStart","onTouchStart","onTouchEnd","onTouchMove","disabled","remaining","selectedIconNode","element","transitionIn","disableTransition","pressedClassName","handlers","ripples","button","aria-pressed"],"mappings":"AAAA;;AACA,SAASA,UAAU,QAAmD,QAAQ;AAC9E,SAASC,OAAO,QAAQ,wBAAwB;AAChD,SAASC,qBAAqB,QAAQ,0CAA0C;AAChF,SAASC,yBAAyB,QAAQ,8CAA8C;AACxF,SAASC,qBAAqB,QAAQ,yCAAyC;AAC/E,SAASC,eAAe,QAAQ,6BAA6B;AAqD7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0CC,GACD,OAAO,MAAMC,gCAAkBN,WAG7B,SAASM,gBAAgBC,KAAK,EAAEC,GAAG;IACnC,MAAM,EACJC,SAAS,EACTC,OAAO,QAAQ,EACfC,SAAS,EACTC,UAAU,EACVC,UAAUC,YAAY,EACtBC,QAAQ,EACRC,cAAcC,gBAAgB,EAC9BC,iBAAiB,EACjBC,mBAAmB,EACnBC,yBAAyB,EACzBC,MAAM,EACNC,OAAO,EACPC,SAAS,EACTC,OAAO,EACPC,WAAW,EACXC,SAAS,EACTC,YAAY,EACZC,WAAW,EACXC,YAAY,EACZC,UAAU,EACVC,WAAW,EACXC,QAAQ,EACR,GAAGC,WACJ,GAAG1B;IAEJ,MAAMM,WAAWV,0BAA0BW;IAC3C,MAAMoB,mBAAmBjC,QAAQ,YAAYgB;IAC7C,MAAMD,eAAeZ,sBAAsB;QACzC+B,SAASD;QACTE,cAAc,CAAC,CAACrB;QAChBiB,UAAUb;QACVkB,mBAAmBjB;IACrB;IACA,MAAM,EAAEkB,gBAAgB,EAAEC,QAAQ,EAAEC,OAAO,EAAE,GAAGtC,sBAAsB;QACpEmB;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;IACF;IAEA,qBACE,MAACS;QACE,GAAGR,SAAS;QACZ,GAAGM,QAAQ;QACZG,gBAAc3B;QACdP,KAAKA;QACLE,MAAMA;QACNsB,UAAUA;QACVvB,WAAWJ,gBAAgB;YACzBI;YACAM;YACAG;YACAoB;QACF;;YAEC,CAACnB,uBAAuBH;YACxBL;YACAE;YACAD;YACA4B;;;AAGP,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/segmented-button/SegmentedButtonContainer.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes, type ReactNode } from \"react\";\nimport {\n segmentedButtonContainerStyles,\n type SegmentedButtonContainerClassNameOptions,\n} from \"./segmentedButtonContainerStyles.js\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface SegmentedButtonContainerProps\n extends HTMLAttributes<HTMLDivElement>,\n SegmentedButtonContainerClassNameOptions {\n children: ReactNode;\n}\n\n/**\n * **Server Component**\n *\n * Simple wrapper `div` to apply the segmented button container styles. You can\n * just use the {@link segmentedButtonContainerStyles} util function instead.\n *\n * @example\n * Without This Component\n * ```tsx\n * import {\n * SegmentedButton,\n * segmentedButtonContainerStyles,\n * } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * import { CustomWrapperComponent } from \"./CustomWrapperComponent.jsx\";\n *\n * function Example(): ReactElement {\n * return (\n * <CustomWrapperComponent className={segmentedButtonContainerStyles()}>\n * <SegmentedButton>One</SegmentedButton>\n * <SegmentedButton>Two</SegmentedButton>\n * <SegmentedButton>Three</SegmentedButton>\n * </CustomWrapperComponent>\n * );\n * }\n * ```\n *\n * @remarks \\@since 6.0.0\n */\nexport const SegmentedButtonContainer = forwardRef<\n HTMLDivElement,\n SegmentedButtonContainerProps\n>(function SegmentedButtonContainer(props, ref) {\n const { className, disableFullWidth, children, ...remaining } = props;\n\n return (\n <div\n {...remaining}\n ref={ref}\n className={segmentedButtonContainerStyles({\n className,\n disableFullWidth,\n })}\n >\n {children}\n </div>\n );\n});\n"],"names":["forwardRef","segmentedButtonContainerStyles","SegmentedButtonContainer","props","ref","className","disableFullWidth","children","remaining","div"],"mappings":";AAAA,SAASA,UAAU,QAA6C,QAAQ;AACxE,SACEC,8BAA8B,QAEzB,sCAAsC;AAW7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BC,GACD,OAAO,MAAMC,yCAA2BF,WAGtC,SAASE,yBAAyBC,KAAK,EAAEC,GAAG;IAC5C,MAAM,EAAEC,SAAS,EAAEC,gBAAgB,EAAEC,QAAQ,EAAE,GAAGC,WAAW,GAAGL;IAEhE,qBACE,KAACM;QACE,GAAGD,SAAS;QACbJ,KAAKA;QACLC,WAAWJ,+BAA+B;YACxCI;YACAC;QACF;kBAECC;;AAGP,GAAG"}
|