@react-md/core 1.0.0-next.11 → 1.0.0-next.12
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 +22 -22
- package/.turbo/turbo-lint.log +12 -0
- package/.turbo/turbo-typecheck.log +1 -1
- package/CHANGELOG.md +6 -0
- package/dist/CoreProviders.js.map +1 -1
- package/dist/NoSsr.js.map +1 -1
- package/dist/RootHtml.js.map +1 -1
- package/dist/SsrProvider.js.map +1 -1
- package/dist/app-bar/AppBar.js.map +1 -1
- package/dist/app-bar/AppBarTitle.d.ts +2 -1
- package/dist/app-bar/AppBarTitle.js.map +1 -1
- package/dist/avatar/Avatar.js.map +1 -1
- package/dist/avatar/styles.js.map +1 -1
- package/dist/badge/Badge.js.map +1 -1
- package/dist/box/Box.js.map +1 -1
- package/dist/box/styles.js.map +1 -1
- package/dist/button/AsyncButton.js.map +1 -1
- package/dist/button/Button.js.map +1 -1
- package/dist/button/ButtonUnstyled.js.map +1 -1
- package/dist/button/FloatingActionButton.js.map +1 -1
- package/dist/button/TooltippedButton.js.map +1 -1
- package/dist/button/buttonStyles.js.map +1 -1
- package/dist/button/buttonUnstyledStyles.js.map +1 -1
- package/dist/card/Card.js.map +1 -1
- package/dist/card/CardContent.js.map +1 -1
- package/dist/card/CardFooter.js.map +1 -1
- package/dist/card/CardHeader.js.map +1 -1
- package/dist/card/CardSubtitle.js.map +1 -1
- package/dist/card/CardTitle.js.map +1 -1
- package/dist/card/ClickableCard.js.map +1 -1
- package/dist/card/styles.js.map +1 -1
- package/dist/chip/Chip.js.map +1 -1
- package/dist/chip/styles.js.map +1 -1
- package/dist/cssUtils.js.map +1 -1
- package/dist/delegateEvent.js.map +1 -1
- package/dist/dialog/Dialog.js.map +1 -1
- package/dist/dialog/DialogContainer.js.map +1 -1
- package/dist/dialog/DialogContent.js.map +1 -1
- package/dist/dialog/DialogFooter.js.map +1 -1
- package/dist/dialog/DialogHeader.js.map +1 -1
- package/dist/dialog/DialogTitle.d.ts +2 -1
- package/dist/dialog/DialogTitle.js.map +1 -1
- package/dist/dialog/FixedDialog.js.map +1 -1
- package/dist/dialog/NestedDialogProvider.js.map +1 -1
- package/dist/dialog/styles.js.map +1 -1
- package/dist/divider/Divider.js.map +1 -1
- package/dist/divider/styles.js.map +1 -1
- package/dist/draggable/useDraggable.js.map +1 -1
- package/dist/draggable/utils.js.map +1 -1
- package/dist/expansion-panel/ExpansionList.js.map +1 -1
- package/dist/expansion-panel/ExpansionPanel.js.map +1 -1
- package/dist/expansion-panel/ExpansionPanelHeader.d.ts +2 -1
- package/dist/expansion-panel/ExpansionPanelHeader.js +1 -1
- package/dist/expansion-panel/ExpansionPanelHeader.js.map +1 -1
- package/dist/expansion-panel/useExpansionList.js.map +1 -1
- package/dist/expansion-panel/useExpansionPanels.js.map +1 -1
- package/dist/focus/useFocusContainer.js.map +1 -1
- package/dist/focus/utils.js.map +1 -1
- package/dist/form/Checkbox.js.map +1 -1
- package/dist/form/Fieldset.js.map +1 -1
- package/dist/form/FileInput.js.map +1 -1
- package/dist/form/Form.js.map +1 -1
- package/dist/form/FormMessage.js.map +1 -1
- package/dist/form/FormMessageContainer.js.map +1 -1
- package/dist/form/FormMessageCounter.js.map +1 -1
- package/dist/form/InputToggle.js.map +1 -1
- package/dist/form/InputToggleIcon.js.map +1 -1
- package/dist/form/Label.js.map +1 -1
- package/dist/form/Legend.js.map +1 -1
- package/dist/form/MenuItemCheckbox.js.map +1 -1
- package/dist/form/MenuItemFileInput.js.map +1 -1
- package/dist/form/MenuItemInputToggle.js.map +1 -1
- package/dist/form/MenuItemRadio.js.map +1 -1
- package/dist/form/MenuItemSwitch.js.map +1 -1
- package/dist/form/MenuItemTextField.js.map +1 -1
- package/dist/form/NativeSelect.js.map +1 -1
- package/dist/form/OptGroup.js.map +1 -1
- package/dist/form/Option.js.map +1 -1
- package/dist/form/Password.js.map +1 -1
- package/dist/form/Radio.js.map +1 -1
- package/dist/form/ResizingTextAreaWrapper.js.map +1 -1
- package/dist/form/Select.js.map +1 -1
- package/dist/form/SelectedOption.js.map +1 -1
- package/dist/form/Slider.js.map +1 -1
- package/dist/form/SliderContainer.js.map +1 -1
- package/dist/form/SliderMark.js.map +1 -1
- package/dist/form/SliderMarkLabel.d.ts +2 -1
- package/dist/form/SliderMarkLabel.js.map +1 -1
- package/dist/form/SliderThumb.js.map +1 -1
- package/dist/form/SliderTrack.js.map +1 -1
- package/dist/form/SliderValueMarks.js.map +1 -1
- package/dist/form/SliderValueTooltip.js.map +1 -1
- package/dist/form/Switch.js.map +1 -1
- package/dist/form/SwitchTrack.js.map +1 -1
- package/dist/form/TextArea.js.map +1 -1
- package/dist/form/TextField.js.map +1 -1
- package/dist/form/TextFieldAddon.js.map +1 -1
- package/dist/form/TextFieldContainer.js.map +1 -1
- package/dist/form/fileUtils.js.map +1 -1
- package/dist/form/formConfig.js.map +1 -1
- package/dist/form/formMessageStyles.js.map +1 -1
- package/dist/form/inputToggleStyles.js.map +1 -1
- package/dist/form/menuItemInputToggleStyles.js.map +1 -1
- package/dist/form/nativeSelectStyles.js.map +1 -1
- package/dist/form/optionStyles.js.map +1 -1
- package/dist/form/passwordStyles.js.map +1 -1
- package/dist/form/selectStyles.js.map +1 -1
- package/dist/form/selectUtils.js.map +1 -1
- package/dist/form/sliderUtils.js.map +1 -1
- package/dist/form/switchStyles.js.map +1 -1
- package/dist/form/textAreaStyles.js.map +1 -1
- package/dist/form/textFieldContainerStyles.js.map +1 -1
- package/dist/form/textFieldStyles.js.map +1 -1
- package/dist/form/types.js.map +1 -1
- package/dist/form/useCheckboxGroup.js.map +1 -1
- package/dist/form/useCombobox.js.map +1 -1
- package/dist/form/useEditableCombobox.js.map +1 -1
- package/dist/form/useFileUpload.js.map +1 -1
- package/dist/form/useFormReset.js.map +1 -1
- package/dist/form/useListboxProvider.js.map +1 -1
- package/dist/form/useNumberField.js.map +1 -1
- package/dist/form/useRadioGroup.js.map +1 -1
- package/dist/form/useRangeSlider.js.map +1 -1
- package/dist/form/useResizingTextArea.js.map +1 -1
- package/dist/form/useSelectCombobox.js.map +1 -1
- package/dist/form/useSlider.js.map +1 -1
- package/dist/form/useTextField.js.map +1 -1
- package/dist/form/utils.js.map +1 -1
- package/dist/form/validation.js.map +1 -1
- package/dist/hoverMode/useHoverMode.js.map +1 -1
- package/dist/hoverMode/useHoverModeProvider.js.map +1 -1
- package/dist/icon/FontIcon.js.map +1 -1
- package/dist/icon/IconRotator.js.map +1 -1
- package/dist/icon/MaterialIcon.js.map +1 -1
- package/dist/icon/MaterialSymbol.js.map +1 -1
- package/dist/icon/SVGIcon.js.map +1 -1
- package/dist/icon/TextIconSpacing.js.map +1 -1
- package/dist/icon/iconConfig.js.map +1 -1
- package/dist/icon/material.js.map +1 -1
- package/dist/icon/materialConfig.js.map +1 -1
- package/dist/icon/styles.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/interaction/Ripple.js.map +1 -1
- package/dist/interaction/RippleContainer.js.map +1 -1
- package/dist/interaction/UserInteractionModeProvider.js.map +1 -1
- package/dist/interaction/config.js.map +1 -1
- package/dist/interaction/types.js.map +1 -1
- package/dist/interaction/useElementInteraction.js.map +1 -1
- package/dist/interaction/useHigherContrastChildren.js.map +1 -1
- package/dist/interaction/utils.js.map +1 -1
- package/dist/layout/LayoutAppBar.js.map +1 -1
- package/dist/layout/LayoutNav.js.map +1 -1
- package/dist/layout/LayoutWindowSplitter.js.map +1 -1
- package/dist/layout/Main.js.map +1 -1
- package/dist/layout/layoutNavStyles.js.map +1 -1
- package/dist/layout/layoutWindowSplitterStyles.js.map +1 -1
- package/dist/layout/mainStyles.js.map +1 -1
- package/dist/layout/useExpandableLayout.js.map +1 -1
- package/dist/layout/useHorizontalLayoutTransition.js.map +1 -1
- package/dist/layout/useLayoutAppBarHeight.js.map +1 -1
- package/dist/layout/useLayoutTree.js.map +1 -1
- package/dist/layout/useLayoutWindowSplitter.js.map +1 -1
- package/dist/layout/useMainTabIndex.js.map +1 -1
- package/dist/layout/useResizableLayout.js.map +1 -1
- package/dist/layout/useTemporaryLayout.js.map +1 -1
- package/dist/link/Link.js.map +1 -1
- package/dist/link/SkipToMainContent.js.map +1 -1
- package/dist/link/styles.js.map +1 -1
- package/dist/list/List.js.map +1 -1
- package/dist/list/ListItem.js.map +1 -1
- package/dist/list/ListItemAddon.js.map +1 -1
- package/dist/list/ListItemChildren.js.map +1 -1
- package/dist/list/ListItemLink.js.map +1 -1
- package/dist/list/ListItemText.js.map +1 -1
- package/dist/list/ListSubheader.js.map +1 -1
- package/dist/list/getListItemHeight.js.map +1 -1
- package/dist/list/listItemStyles.js.map +1 -1
- package/dist/list/types.js.map +1 -1
- package/dist/media-queries/AppSizeProvider.js.map +1 -1
- package/dist/media-queries/appSize.js.map +1 -1
- package/dist/media-queries/useMediaQuery.js.map +1 -1
- package/dist/menu/DropdownMenu.js.map +1 -1
- package/dist/menu/Menu.js.map +1 -1
- package/dist/menu/MenuBar.js.map +1 -1
- package/dist/menu/MenuButton.js.map +1 -1
- package/dist/menu/MenuConfigurationProvider.js.map +1 -1
- package/dist/menu/MenuItem.js.map +1 -1
- package/dist/menu/MenuItemButton.js.map +1 -1
- package/dist/menu/MenuItemCircularProgress.js.map +1 -1
- package/dist/menu/MenuItemGroup.js.map +1 -1
- package/dist/menu/MenuItemSeparator.js.map +1 -1
- package/dist/menu/MenuSheet.js.map +1 -1
- package/dist/menu/MenuVisibilityProvider.js.map +1 -1
- package/dist/menu/MenuWidget.js.map +1 -1
- package/dist/menu/MenuWidgetKeyboardProvider.js.map +1 -1
- package/dist/menu/useContextMenu.js.map +1 -1
- package/dist/menu/useMenuBarProvider.js.map +1 -1
- package/dist/menu/utils.js.map +1 -1
- package/dist/movement/constants.js.map +1 -1
- package/dist/movement/findMatchIndex.js.map +1 -1
- package/dist/movement/types.js.map +1 -1
- package/dist/movement/useKeyboardMovementProvider.js.map +1 -1
- package/dist/movement/utils.js.map +1 -1
- package/dist/overlay/Overlay.js.map +1 -1
- package/dist/overlay/overlayStyles.js.map +1 -1
- package/dist/portal/Portal.js.map +1 -1
- package/dist/portal/PortalContainerProvider.js.map +1 -1
- package/dist/positioning/constants.js.map +1 -1
- package/dist/positioning/createHorizontalPosition.js.map +1 -1
- package/dist/positioning/createVerticalPosition.js.map +1 -1
- package/dist/positioning/getFixedPosition.js.map +1 -1
- package/dist/positioning/types.js.map +1 -1
- package/dist/positioning/useFixedPositioning.js.map +1 -1
- package/dist/positioning/utils.js.map +1 -1
- package/dist/progress/CircularProgress.js.map +1 -1
- package/dist/progress/LinearProgress.js.map +1 -1
- package/dist/progress/getProgressA11y.js.map +1 -1
- package/dist/progress/types.js.map +1 -1
- package/dist/responsive-item/ResponsiveItemContainer.js.map +1 -1
- package/dist/responsive-item/ResponsiveItemOverlay.js.map +1 -1
- package/dist/responsive-item/styles.js.map +1 -1
- package/dist/scroll/ScrollLock.js.map +1 -1
- package/dist/scroll/getScrollbarWidth.js.map +1 -1
- package/dist/scroll/useScrollLock.js.map +1 -1
- package/dist/searching/caseInsensitive.js.map +1 -1
- package/dist/searching/fuzzy.js.map +1 -1
- package/dist/searching/toSearchQuery.js.map +1 -1
- package/dist/searching/types.js.map +1 -1
- package/dist/searching/useFuzzyMatch.js.map +1 -1
- package/dist/searching/utils.js.map +1 -1
- package/dist/segmented-button/SegmentedButton.js.map +1 -1
- package/dist/segmented-button/SegmentedButtonContainer.js.map +1 -1
- package/dist/segmented-button/segmentedButtonContainerStyles.js.map +1 -1
- package/dist/segmented-button/segmentedButtonStyles.js.map +1 -1
- package/dist/sheet/Sheet.js.map +1 -1
- package/dist/sheet/styles.js.map +1 -1
- package/dist/snackbar/DefaultToastRenderer.js.map +1 -1
- package/dist/snackbar/Snackbar.js.map +1 -1
- package/dist/snackbar/Toast.js.map +1 -1
- package/dist/snackbar/ToastActionButton.js.map +1 -1
- package/dist/snackbar/ToastCloseButton.js.map +1 -1
- package/dist/snackbar/ToastContent.js.map +1 -1
- package/dist/snackbar/ToastManager.js.map +1 -1
- package/dist/snackbar/ToastManagerProvider.js.map +1 -1
- package/dist/snackbar/snackbarStyles.js.map +1 -1
- package/dist/snackbar/toastContentStyles.js.map +1 -1
- package/dist/snackbar/toastStyles.js.map +1 -1
- package/dist/snackbar/useCurrentToastActions.js.map +1 -1
- package/dist/suspense/CircularProgressSuspense.js.map +1 -1
- package/dist/suspense/NullSuspense.js.map +1 -1
- package/dist/table/Table.js.map +1 -1
- package/dist/table/TableBody.js.map +1 -1
- package/dist/table/TableCell.js.map +1 -1
- package/dist/table/TableCellContent.js.map +1 -1
- package/dist/table/TableCheckbox.js.map +1 -1
- package/dist/table/TableConfigurationProvider.js.map +1 -1
- package/dist/table/TableContainer.js.map +1 -1
- package/dist/table/TableContainerProvider.js.map +1 -1
- package/dist/table/TableFooter.js.map +1 -1
- package/dist/table/TableHeader.js.map +1 -1
- package/dist/table/TableRadio.js.map +1 -1
- package/dist/table/TableRow.js.map +1 -1
- package/dist/table/tableCellStyles.js.map +1 -1
- package/dist/table/tableContainerStyles.js.map +1 -1
- package/dist/table/tableFooterStyles.js.map +1 -1
- package/dist/table/tableHeaderStyles.js.map +1 -1
- package/dist/table/tableRowStyles.js.map +1 -1
- package/dist/table/tableStyles.js.map +1 -1
- package/dist/table/types.js.map +1 -1
- package/dist/tabs/Tab.js.map +1 -1
- package/dist/tabs/TabList.js.map +1 -1
- package/dist/tabs/TabListScrollButton.js.map +1 -1
- package/dist/tabs/tabIndicatorStyles.js.map +1 -1
- package/dist/tabs/tabListScrollButtonStyles.js.map +1 -1
- package/dist/tabs/tabListStyles.js.map +1 -1
- package/dist/tabs/tabStyles.js.map +1 -1
- package/dist/tabs/useTabList.js.map +1 -1
- package/dist/tabs/useTabs.js.map +1 -1
- package/dist/tabs/utils.js.map +1 -1
- package/dist/test-utils/IntersectionObserver.js.map +1 -1
- package/dist/test-utils/ResizeObserver.js.map +1 -1
- package/dist/test-utils/data-testid.js.map +1 -1
- package/dist/test-utils/index.js.map +1 -1
- package/dist/test-utils/jest-setup.js.map +1 -1
- package/dist/test-utils/matchMedia.js.map +1 -1
- package/dist/test-utils/polyfills/IntersectionObserver.js.map +1 -1
- package/dist/test-utils/polyfills/ResizeObserver.js.map +1 -1
- package/dist/test-utils/polyfills/TextDecoder.js.map +1 -1
- package/dist/test-utils/polyfills/TextEncoder.js.map +1 -1
- package/dist/test-utils/polyfills/index.js.map +1 -1
- package/dist/test-utils/polyfills/matchMedia.js.map +1 -1
- package/dist/test-utils/polyfills/offsetParent.js.map +1 -1
- package/dist/test-utils/polyfills/scrollIntoView.js.map +1 -1
- package/dist/test-utils/render.js.map +1 -1
- package/dist/test-utils/timers.js.map +1 -1
- package/dist/theme/LocalStorageColorSchemeProvider.js.map +1 -1
- package/dist/theme/ThemeProvider.js.map +1 -1
- package/dist/theme/colors.js.map +1 -1
- package/dist/theme/cssVars.js.map +1 -1
- package/dist/theme/types.js.map +1 -1
- package/dist/theme/useCSSVariables.js.map +1 -1
- package/dist/theme/useColorScheme.js.map +1 -1
- package/dist/theme/useColorSchemeMetaTag.js.map +1 -1
- package/dist/theme/useColorSchemeProvider.js.map +1 -1
- package/dist/theme/usePrefersColorScheme.js.map +1 -1
- package/dist/theme/utils.js.map +1 -1
- package/dist/tooltip/Tooltip.js.map +1 -1
- package/dist/tooltip/TooltipHoverModeProvider.js.map +1 -1
- package/dist/tooltip/constants.js.map +1 -1
- package/dist/tooltip/tooltipStyles.js.map +1 -1
- package/dist/tooltip/useTooltip.js.map +1 -1
- package/dist/tooltip/useTooltipPosition.js.map +1 -1
- package/dist/tooltip/utils.js.map +1 -1
- package/dist/transition/CSSTransition.js.map +1 -1
- package/dist/transition/Collapse.js.map +1 -1
- package/dist/transition/CrossFade.js.map +1 -1
- package/dist/transition/ScaleTransition.js.map +1 -1
- package/dist/transition/SkeletonPlaceholder.js.map +1 -1
- package/dist/transition/Slide.js.map +1 -1
- package/dist/transition/SlideContainer.js.map +1 -1
- package/dist/transition/collapseStyles.js.map +1 -1
- package/dist/transition/config.js.map +1 -1
- package/dist/transition/maxWidthTransition.js.map +1 -1
- package/dist/transition/skeletonPlaceholderUtils.js.map +1 -1
- package/dist/transition/types.js.map +1 -1
- package/dist/transition/useCSSTransition.js.map +1 -1
- package/dist/transition/useCarousel.js.map +1 -1
- package/dist/transition/useCollapseTransition.js.map +1 -1
- package/dist/transition/useCrossFadeTransition.js.map +1 -1
- package/dist/transition/useMaxWidthTransition.js.map +1 -1
- package/dist/transition/useScaleTransition.js.map +1 -1
- package/dist/transition/useSkeletonPlaceholder.js.map +1 -1
- package/dist/transition/useSlideTransition.js.map +1 -1
- package/dist/transition/useTransition.js.map +1 -1
- package/dist/transition/utils.js.map +1 -1
- package/dist/tree/DefaultTreeItemRenderer.js.map +1 -1
- package/dist/tree/Tree.js.map +1 -1
- package/dist/tree/TreeGroup.js.map +1 -1
- package/dist/tree/TreeItem.js.map +1 -1
- package/dist/tree/TreeItemExpander.js.map +1 -1
- package/dist/tree/TreeProvider.js.map +1 -1
- package/dist/tree/styles.js.map +1 -1
- package/dist/tree/types.js.map +1 -1
- package/dist/tree/useTree.js.map +1 -1
- package/dist/tree/useTreeExpansion.js.map +1 -1
- package/dist/tree/useTreeItems.js.map +1 -1
- package/dist/tree/useTreeMovement.js.map +1 -1
- package/dist/tree/useTreeSelection.js.map +1 -1
- package/dist/tree/utils.js.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/typography/SrOnly.js.map +1 -1
- package/dist/typography/TextContainer.d.ts +1 -40
- package/dist/typography/TextContainer.js +1 -30
- package/dist/typography/TextContainer.js.map +1 -1
- package/dist/typography/Typography.d.ts +1 -112
- package/dist/typography/Typography.js +1 -89
- package/dist/typography/Typography.js.map +1 -1
- package/dist/typography/WritingDirectionProvider.js.map +1 -1
- package/dist/typography/textContainerStyles.d.ts +40 -0
- package/dist/typography/textContainerStyles.js +32 -0
- package/dist/typography/textContainerStyles.js.map +1 -0
- package/dist/typography/typographyStyles.d.ts +112 -0
- package/dist/typography/typographyStyles.js +91 -0
- package/dist/typography/typographyStyles.js.map +1 -0
- package/dist/useAsyncAction.js.map +1 -1
- package/dist/useDebouncedFunction.js.map +1 -1
- package/dist/useDropzone.js.map +1 -1
- package/dist/useElementSize.js.map +1 -1
- package/dist/useEnsuredId.js.map +1 -1
- package/dist/useEnsuredRef.js.map +1 -1
- package/dist/useEnsuredState.js.map +1 -1
- package/dist/useHtmlClassName.js.map +1 -1
- package/dist/useIntersectionObserver.js.map +1 -1
- package/dist/useIsomorphicLayoutEffect.js.map +1 -1
- package/dist/useLocalStorage.js.map +1 -1
- package/dist/useOrientation.js.map +1 -1
- package/dist/usePageInactive.js.map +1 -1
- package/dist/useResizeListener.js.map +1 -1
- package/dist/useResizeObserver.js.map +1 -1
- package/dist/useThrottledFunction.js.map +1 -1
- package/dist/useToggle.js.map +1 -1
- package/dist/useUnmounted.js.map +1 -1
- package/dist/useWindowSize.js.map +1 -1
- package/dist/utils/RenderRecursively.js.map +1 -1
- package/dist/utils/alphaNumericSort.js.map +1 -1
- package/dist/utils/applyRef.js.map +1 -1
- package/dist/utils/bem.js.map +1 -1
- package/dist/utils/getClientPosition.js.map +1 -1
- package/dist/utils/getMiddleOfRange.js.map +1 -1
- package/dist/utils/getPercentage.js.map +1 -1
- package/dist/utils/getRangeDefaultValue.js.map +1 -1
- package/dist/utils/getRangeSteps.js.map +1 -1
- package/dist/utils/identity.js.map +1 -1
- package/dist/utils/isElementVisible.js.map +1 -1
- package/dist/utils/loop.js.map +1 -1
- package/dist/utils/nearest.js.map +1 -1
- package/dist/utils/parseCssLengthUnit.js.map +1 -1
- package/dist/utils/randomInt.js.map +1 -1
- package/dist/utils/wait.js.map +1 -1
- package/dist/utils/withinRange.js.map +1 -1
- package/dist/window-splitter/WindowSplitter.js.map +1 -1
- package/dist/window-splitter/useWindowSplitter.js.map +1 -1
- package/package.json +11 -350
- package/src/app-bar/AppBarTitle.tsx +2 -5
- package/src/dialog/DialogTitle.tsx +1 -1
- package/src/expansion-panel/ExpansionPanelHeader.tsx +3 -6
- package/src/form/SliderMarkLabel.tsx +1 -1
- package/src/index.ts +3 -1
- package/src/typography/TextContainer.tsx +4 -53
- package/src/typography/Typography.tsx +5 -145
- package/src/typography/__tests__/TextContainer.tsx +2 -1
- package/src/typography/__tests__/Typography.tsx +2 -1
- package/src/typography/textContainerStyles.ts +53 -0
- package/src/typography/typographyStyles.ts +145 -0
- package/tsconfig.types.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/layout/LayoutNav.tsx"],"sourcesContent":["\"use client\";\nimport { cnb } from \"cnbuilder\";\nimport { forwardRef, type HTMLAttributes, type ReactNode } from \"react\";\nimport {\n DEFAULT_SHEET_CLASSNAMES,\n DEFAULT_SHEET_TIMEOUT,\n} from \"../sheet/Sheet.js\";\nimport { sheet, type BaseSheetClassNameOptions } from \"../sheet/styles.js\";\nimport {\n type CSSTransitionClassNames,\n type TransitionActions,\n type TransitionCallbacks,\n type TransitionTimeout,\n} from \"../transition/types.js\";\nimport { useCSSTransition } from \"../transition/useCSSTransition.js\";\nimport { layoutNav } from \"./layoutNavStyles.js\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface LayoutNavProps\n extends HTMLAttributes<HTMLDivElement>,\n BaseSheetClassNameOptions,\n TransitionCallbacks,\n TransitionActions {\n children: ReactNode;\n\n /**\n * The component to render as.\n *\n * @defaultValue `\"nav\"`\n */\n as?: \"nav\" | \"div\";\n\n /**\n * Set this to `true` to display the navigation.\n */\n expanded: boolean;\n\n /**\n * Set this to `true` to force the navigation to appear below the fixed app\n * bar.\n *\n * @defaultValue `false`\n */\n appBarOffset?: boolean;\n\n /** @defaultValue {@link DEFAULT_SHEET_TIMEOUT} */\n timeout?: TransitionTimeout;\n /** @defaultValue {@link DEFAULT_SHEET_CLASSNAMES} */\n classNames?: CSSTransitionClassNames;\n}\n\n/**\n * **Client Component**\n *\n * This component is used to render a persistent navigation on the left of the\n * page. There is some built-in functionality to support resizing with the\n * `LayoutWindowSplitter` and expandable layouts. Do not use this component for\n * temporary navigation and instead use a `Sheet`.\n *\n * @example\n * Full Height Layout\n * ```tsx\n * \"use client\";\n * import {\n * LayoutAppBar,\n * LayoutNav,\n * Main,\n * useHorizontalLayoutTransition,\n * } from \"@react-md/core\";\n * import type { ReactElement, PropsWithChildren } from \"react\";\n *\n * function Layout({ children }: PropsWithChildren): ReactElement {\n * const { elementProps } = useHorizontalLayoutTransition({\n * transitionIn: true,\n * });\n *\n * return (\n * <>\n * <LayoutAppBar {...elementProps}>\n * <YourAppBarContent />\n * </LayoutAppBar>\n * <LayoutNav expanded>\n * <YourNavigationComponent />\n * </LayoutNav>\n * <Main navOffset appBarOffset {...elementProps}>\n * {children}\n * </Main>\n * </>\n * );\n * }\n * ```\n *\n * @example\n * Toggleable Layout\n * ```tsx\n * \"use client\";\n * import {\n * LayoutNav,\n * Main,\n * useHorizontalLayoutTransition,\n * useToggle,\n * } from \"@react-md/core\";\n * import MenuIcon from \"@react-md/material-icons/MenuIcon\";\n * import { cnb } from \"cnbuilder\";\n * import type { ReactElement, PropsWithChildren } from \"react\";\n *\n * function Layout({ children }: PropsWithChildren): ReactElement {\n * const { toggled: expanded, toggle } = useToggle();\n * const { elementProps } = useHorizontalLayoutTransition({\n * transitionIn: expanded,\n * });\n *\n * return (\n * <>\n * <LayoutAppBar {...elementProps}>\n * <Button\n * aria-label=\"Navigation\"\n * onClick={toggle}\n * buttonType=\"icon\"\n * >\n * <MenuIcon />\n * </Button>\n * <YourAppBarContent />\n * </LayoutAppBar>\n * <LayoutNav expanded>\n * <YourNavigationComponent />\n * </LayoutNav>\n * <Main navOffset={expanded} appBarOffset {...elementProps}>\n * {children}\n * </Main>\n * </>\n * );\n * }\n * ```\n *\n * @remarks \\@since 6.0.0\n */\nexport const LayoutNav = forwardRef<HTMLDivElement, LayoutNavProps>(\n function LayoutNav(props, ref) {\n const {\n as: Component = \"nav\",\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-label\": ariaLabel = Component == \"nav\" && !ariaLabelledBy\n ? \"Navigation\"\n : undefined,\n expanded,\n children,\n className,\n timeout = DEFAULT_SHEET_TIMEOUT,\n classNames = DEFAULT_SHEET_CLASSNAMES,\n appear,\n enter,\n exit,\n onEnter,\n onEntering,\n onEntered,\n onExit,\n onExited,\n onExiting,\n appBarOffset,\n ...remaining\n } = props;\n const { elementProps } = useCSSTransition({\n nodeRef: ref,\n timeout,\n className: cnb(\n layoutNav({ appBarOffset }),\n sheet({\n className,\n horizontalSize: \"none\",\n disableOverlay: true,\n })\n ),\n classNames,\n enter,\n exit,\n appear,\n onEnter,\n onEntering,\n onEntered,\n onExit,\n onExited,\n onExiting,\n exitedHidden: true,\n transitionIn: expanded,\n });\n\n return (\n <Component\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n {...remaining}\n {...elementProps}\n >\n {children}\n </Component>\n );\n }\n);\n"],"names":["cnb","forwardRef","DEFAULT_SHEET_CLASSNAMES","DEFAULT_SHEET_TIMEOUT","sheet","useCSSTransition","layoutNav","LayoutNav","props","ref","as","Component","ariaLabelledBy","ariaLabel","undefined","expanded","children","className","timeout","classNames","appear","enter","exit","onEnter","onEntering","onEntered","onExit","onExited","onExiting","appBarOffset","remaining","elementProps","nodeRef","horizontalSize","disableOverlay","exitedHidden","transitionIn","aria-label","aria-labelledby"],"mappings":"AAAA;;AACA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,UAAU,QAA6C,QAAQ;AACxE,SACEC,wBAAwB,EACxBC,qBAAqB,QAChB,oBAAoB;AAC3B,SAASC,KAAK,QAAwC,qBAAqB;AAO3E,SAASC,gBAAgB,QAAQ,oCAAoC;AACrE,SAASC,SAAS,QAAQ,uBAAuB;AAsCjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqFC,GACD,OAAO,MAAMC,0BAAYN,WACvB,SAASM,UAAUC,KAAK,EAAEC,GAAG;IAC3B,MAAM,EACJC,IAAIC,YAAY,KAAK,EACrB,mBAAmBC,cAAc,EACjC,cAAcC,YAAYF,aAAa,SAAS,CAACC,iBAC7C,eACAE,SAAS,EACbC,QAAQ,EACRC,QAAQ,EACRC,SAAS,EACTC,UAAUf,qBAAqB,EAC/BgB,aAAajB,wBAAwB,EACrCkB,MAAM,EACNC,KAAK,EACLC,IAAI,EACJC,OAAO,EACPC,UAAU,EACVC,SAAS,EACTC,MAAM,EACNC,QAAQ,EACRC,SAAS,EACTC,YAAY,EACZ,GAAGC,WACJ,GAAGtB;IACJ,MAAM,EAAEuB,YAAY,EAAE,GAAG1B,iBAAiB;QACxC2B,SAASvB;QACTS;QACAD,WAAWjB,IACTM,UAAU;YAAEuB;QAAa,IACzBzB,MAAM;YACJa;YACAgB,gBAAgB;YAChBC,gBAAgB;QAClB;QAEFf;QACAE;QACAC;QACAF;QACAG;QACAC;QACAC;QACAC;QACAC;QACAC;QACAO,cAAc;QACdC,cAAcrB;IAChB;IAEA,qBACE,KAACJ;QACC0B,cAAYxB;QACZyB,mBAAiB1B;QAChB,GAAGkB,SAAS;QACZ,GAAGC,YAAY;kBAEff;;AAGP,GACA"}
|
|
1
|
+
{"version":3,"sources":["../../src/layout/LayoutNav.tsx"],"sourcesContent":["\"use client\";\nimport { cnb } from \"cnbuilder\";\nimport { forwardRef, type HTMLAttributes, type ReactNode } from \"react\";\nimport {\n DEFAULT_SHEET_CLASSNAMES,\n DEFAULT_SHEET_TIMEOUT,\n} from \"../sheet/Sheet.js\";\nimport { sheet, type BaseSheetClassNameOptions } from \"../sheet/styles.js\";\nimport {\n type CSSTransitionClassNames,\n type TransitionActions,\n type TransitionCallbacks,\n type TransitionTimeout,\n} from \"../transition/types.js\";\nimport { useCSSTransition } from \"../transition/useCSSTransition.js\";\nimport { layoutNav } from \"./layoutNavStyles.js\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface LayoutNavProps\n extends HTMLAttributes<HTMLDivElement>,\n BaseSheetClassNameOptions,\n TransitionCallbacks,\n TransitionActions {\n children: ReactNode;\n\n /**\n * The component to render as.\n *\n * @defaultValue `\"nav\"`\n */\n as?: \"nav\" | \"div\";\n\n /**\n * Set this to `true` to display the navigation.\n */\n expanded: boolean;\n\n /**\n * Set this to `true` to force the navigation to appear below the fixed app\n * bar.\n *\n * @defaultValue `false`\n */\n appBarOffset?: boolean;\n\n /** @defaultValue {@link DEFAULT_SHEET_TIMEOUT} */\n timeout?: TransitionTimeout;\n /** @defaultValue {@link DEFAULT_SHEET_CLASSNAMES} */\n classNames?: CSSTransitionClassNames;\n}\n\n/**\n * **Client Component**\n *\n * This component is used to render a persistent navigation on the left of the\n * page. There is some built-in functionality to support resizing with the\n * `LayoutWindowSplitter` and expandable layouts. Do not use this component for\n * temporary navigation and instead use a `Sheet`.\n *\n * @example\n * Full Height Layout\n * ```tsx\n * \"use client\";\n * import {\n * LayoutAppBar,\n * LayoutNav,\n * Main,\n * useHorizontalLayoutTransition,\n * } from \"@react-md/core\";\n * import type { ReactElement, PropsWithChildren } from \"react\";\n *\n * function Layout({ children }: PropsWithChildren): ReactElement {\n * const { elementProps } = useHorizontalLayoutTransition({\n * transitionIn: true,\n * });\n *\n * return (\n * <>\n * <LayoutAppBar {...elementProps}>\n * <YourAppBarContent />\n * </LayoutAppBar>\n * <LayoutNav expanded>\n * <YourNavigationComponent />\n * </LayoutNav>\n * <Main navOffset appBarOffset {...elementProps}>\n * {children}\n * </Main>\n * </>\n * );\n * }\n * ```\n *\n * @example\n * Toggleable Layout\n * ```tsx\n * \"use client\";\n * import {\n * LayoutNav,\n * Main,\n * useHorizontalLayoutTransition,\n * useToggle,\n * } from \"@react-md/core\";\n * import MenuIcon from \"@react-md/material-icons/MenuIcon\";\n * import { cnb } from \"cnbuilder\";\n * import type { ReactElement, PropsWithChildren } from \"react\";\n *\n * function Layout({ children }: PropsWithChildren): ReactElement {\n * const { toggled: expanded, toggle } = useToggle();\n * const { elementProps } = useHorizontalLayoutTransition({\n * transitionIn: expanded,\n * });\n *\n * return (\n * <>\n * <LayoutAppBar {...elementProps}>\n * <Button\n * aria-label=\"Navigation\"\n * onClick={toggle}\n * buttonType=\"icon\"\n * >\n * <MenuIcon />\n * </Button>\n * <YourAppBarContent />\n * </LayoutAppBar>\n * <LayoutNav expanded>\n * <YourNavigationComponent />\n * </LayoutNav>\n * <Main navOffset={expanded} appBarOffset {...elementProps}>\n * {children}\n * </Main>\n * </>\n * );\n * }\n * ```\n *\n * @remarks \\@since 6.0.0\n */\nexport const LayoutNav = forwardRef<HTMLDivElement, LayoutNavProps>(\n function LayoutNav(props, ref) {\n const {\n as: Component = \"nav\",\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-label\": ariaLabel = Component == \"nav\" && !ariaLabelledBy\n ? \"Navigation\"\n : undefined,\n expanded,\n children,\n className,\n timeout = DEFAULT_SHEET_TIMEOUT,\n classNames = DEFAULT_SHEET_CLASSNAMES,\n appear,\n enter,\n exit,\n onEnter,\n onEntering,\n onEntered,\n onExit,\n onExited,\n onExiting,\n appBarOffset,\n ...remaining\n } = props;\n const { elementProps } = useCSSTransition({\n nodeRef: ref,\n timeout,\n className: cnb(\n layoutNav({ appBarOffset }),\n sheet({\n className,\n horizontalSize: \"none\",\n disableOverlay: true,\n })\n ),\n classNames,\n enter,\n exit,\n appear,\n onEnter,\n onEntering,\n onEntered,\n onExit,\n onExited,\n onExiting,\n exitedHidden: true,\n transitionIn: expanded,\n });\n\n return (\n <Component\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n {...remaining}\n {...elementProps}\n >\n {children}\n </Component>\n );\n }\n);\n"],"names":["cnb","forwardRef","DEFAULT_SHEET_CLASSNAMES","DEFAULT_SHEET_TIMEOUT","sheet","useCSSTransition","layoutNav","LayoutNav","props","ref","as","Component","ariaLabelledBy","ariaLabel","undefined","expanded","children","className","timeout","classNames","appear","enter","exit","onEnter","onEntering","onEntered","onExit","onExited","onExiting","appBarOffset","remaining","elementProps","nodeRef","horizontalSize","disableOverlay","exitedHidden","transitionIn","aria-label","aria-labelledby"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AACA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,UAAU,QAA6C,QAAQ;AACxE,SACEC,wBAAwB,EACxBC,qBAAqB,QAChB,oBAAoB;AAC3B,SAASC,KAAK,QAAwC,qBAAqB;AAO3E,SAASC,gBAAgB,QAAQ,oCAAoC;AACrE,SAASC,SAAS,QAAQ,uBAAuB;AAsCjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqFC,GACD,OAAO,MAAMC,0BAAYN,WACvB,SAASM,UAAUC,KAAK,EAAEC,GAAG;IAC3B,MAAM,EACJC,IAAIC,YAAY,KAAK,EACrB,mBAAmBC,cAAc,EACjC,cAAcC,YAAYF,aAAa,SAAS,CAACC,iBAC7C,eACAE,SAAS,EACbC,QAAQ,EACRC,QAAQ,EACRC,SAAS,EACTC,UAAUf,qBAAqB,EAC/BgB,aAAajB,wBAAwB,EACrCkB,MAAM,EACNC,KAAK,EACLC,IAAI,EACJC,OAAO,EACPC,UAAU,EACVC,SAAS,EACTC,MAAM,EACNC,QAAQ,EACRC,SAAS,EACTC,YAAY,EACZ,GAAGC,WACJ,GAAGtB;IACJ,MAAM,EAAEuB,YAAY,EAAE,GAAG1B,iBAAiB;QACxC2B,SAASvB;QACTS;QACAD,WAAWjB,IACTM,UAAU;YAAEuB;QAAa,IACzBzB,MAAM;YACJa;YACAgB,gBAAgB;YAChBC,gBAAgB;QAClB;QAEFf;QACAE;QACAC;QACAF;QACAG;QACAC;QACAC;QACAC;QACAC;QACAC;QACAO,cAAc;QACdC,cAAcrB;IAChB;IAEA,qBACE,KAACJ;QACC0B,cAAYxB;QACZyB,mBAAiB1B;QAChB,GAAGkB,SAAS;QACZ,GAAGC,YAAY;kBAEff;;AAGP,GACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/layout/LayoutWindowSplitter.tsx"],"sourcesContent":["\"use client\";\nimport { forwardRef, useMemo } from \"react\";\nimport { type DefinedCSSVariableName } from \"../theme/types.js\";\nimport { useCSSVariables } from \"../theme/useCSSVariables.js\";\nimport {\n WindowSplitter,\n type BaseWindowSplitterProps,\n} from \"../window-splitter/WindowSplitter.js\";\nimport { type WindowSplitterWidgetProps } from \"../window-splitter/useWindowSplitter.js\";\nimport {\n layoutWindowSplitter,\n type LayoutWindowSplitterClassNameOptions,\n} from \"./layoutWindowSplitterStyles.js\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface LayoutWindowSplitterProps\n extends WindowSplitterWidgetProps<HTMLButtonElement>,\n Omit<\n BaseWindowSplitterProps,\n keyof WindowSplitterWidgetProps<HTMLButtonElement>\n >,\n LayoutWindowSplitterClassNameOptions {\n /** @defaultValue `\"Resize Navigation\"` */\n \"aria-label\"?: string;\n\n /**\n * The current navigation width (in px).\n */\n navWidth: number;\n}\n\n/**\n * **Client Component**\n *\n * This component is used to resize the `LayoutNav` component.\n *\n * @see {@link useResizableExpandableLayout} for a default implementation for\n * this component.\n *\n * @example\n * Dynamic Resizing\n * ```tsx\n * import {\n * LayoutNav,\n * LayoutWindowSplitter,\n * Main,\n * NoSsr,\n * useWindowSize,\n * useWindowSplitter,\n * } from \"@react-md/core\";\n * import type { ReactElement, PropsWithChildren } from \"react\"\n *\n * function MyWindowSplitter(): ReactElement {\n * const { width } = useWindowSize({ disableHeight: true });\n * const min = 96;\n * const max = Math.max(600, width * .7);\n *\n * const { value, splitterProps } = useWindowSplitter({\n * min,\n * max,\n * defaultValue: 256,\n * });\n *\n * return (\n * <LayoutWindowSplitter\n * aria-controls=\"layout-nav-id\"\n * {...splitterProps}\n * value={value}\n * />\n * );\n * }\n *\n * function Layout({ children }: PropsWithChildren): ReactElement {\n * return (\n * <>\n * <LayoutNav id=\"layout-nav\" {...otherProps}>\n * <YourNavigation />\n * </LayoutNav>\n * // only required when using SSR\n * <NoSsr>\n * <MyWindowSplitter />\n * </NoSsr>\n * <Main navOffset>\n * {children}\n * </Main>\n * </>\n * );\n * }\n * ```\n *\n * @remarks \\@since 6.0.0\n */\nexport const LayoutWindowSplitter = forwardRef<\n HTMLButtonElement,\n LayoutWindowSplitterProps\n>(function LayoutWindowSplitter(props, ref) {\n const {\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-label\": ariaLabel = ariaLabelledBy ? undefined : \"Resize Navigation\",\n appBarOffset,\n disableResponsive,\n className,\n navWidth,\n ...remaining\n } = props;\n\n useCSSVariables<DefinedCSSVariableName>(\n useMemo(\n () => [{ name: \"--rmd-layout-size\", value: `${navWidth}px` }],\n [navWidth]\n )\n );\n\n return (\n <WindowSplitter\n {...remaining}\n ref={ref}\n aria-label={ariaLabel as string}\n aria-labelledby={ariaLabelledBy}\n className={layoutWindowSplitter({\n appBarOffset,\n disableResponsive,\n className,\n })}\n />\n );\n});\n"],"names":["forwardRef","useMemo","useCSSVariables","WindowSplitter","layoutWindowSplitter","LayoutWindowSplitter","props","ref","ariaLabelledBy","ariaLabel","undefined","appBarOffset","disableResponsive","className","navWidth","remaining","name","value","aria-label","aria-labelledby"],"mappings":"AAAA;;AACA,SAASA,UAAU,EAAEC,OAAO,QAAQ,QAAQ;AAE5C,SAASC,eAAe,QAAQ,8BAA8B;AAC9D,SACEC,cAAc,QAET,uCAAuC;AAE9C,SACEC,oBAAoB,QAEf,kCAAkC;AAqBzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4DC,GACD,OAAO,MAAMC,qCAAuBL,WAGlC,SAASK,qBAAqBC,KAAK,EAAEC,GAAG;IACxC,MAAM,EACJ,mBAAmBC,cAAc,EACjC,cAAcC,YAAYD,iBAAiBE,YAAY,mBAAmB,EAC1EC,YAAY,EACZC,iBAAiB,EACjBC,SAAS,EACTC,QAAQ,EACR,GAAGC,WACJ,GAAGT;IAEJJ,gBACED,QACE,IAAM;YAAC;gBAAEe,MAAM;gBAAqBC,OAAO,CAAC,EAAEH,SAAS,EAAE,CAAC;YAAC;SAAE,EAC7D;QAACA;KAAS;IAId,qBACE,KAACX;QACE,GAAGY,SAAS;QACbR,KAAKA;QACLW,cAAYT;QACZU,mBAAiBX;QACjBK,WAAWT,qBAAqB;YAC9BO;YACAC;YACAC;QACF;;AAGN,GAAG"}
|
|
1
|
+
{"version":3,"sources":["../../src/layout/LayoutWindowSplitter.tsx"],"sourcesContent":["\"use client\";\nimport { forwardRef, useMemo } from \"react\";\nimport { type DefinedCSSVariableName } from \"../theme/types.js\";\nimport { useCSSVariables } from \"../theme/useCSSVariables.js\";\nimport {\n WindowSplitter,\n type BaseWindowSplitterProps,\n} from \"../window-splitter/WindowSplitter.js\";\nimport { type WindowSplitterWidgetProps } from \"../window-splitter/useWindowSplitter.js\";\nimport {\n layoutWindowSplitter,\n type LayoutWindowSplitterClassNameOptions,\n} from \"./layoutWindowSplitterStyles.js\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface LayoutWindowSplitterProps\n extends WindowSplitterWidgetProps<HTMLButtonElement>,\n Omit<\n BaseWindowSplitterProps,\n keyof WindowSplitterWidgetProps<HTMLButtonElement>\n >,\n LayoutWindowSplitterClassNameOptions {\n /** @defaultValue `\"Resize Navigation\"` */\n \"aria-label\"?: string;\n\n /**\n * The current navigation width (in px).\n */\n navWidth: number;\n}\n\n/**\n * **Client Component**\n *\n * This component is used to resize the `LayoutNav` component.\n *\n * @see {@link useResizableExpandableLayout} for a default implementation for\n * this component.\n *\n * @example\n * Dynamic Resizing\n * ```tsx\n * import {\n * LayoutNav,\n * LayoutWindowSplitter,\n * Main,\n * NoSsr,\n * useWindowSize,\n * useWindowSplitter,\n * } from \"@react-md/core\";\n * import type { ReactElement, PropsWithChildren } from \"react\"\n *\n * function MyWindowSplitter(): ReactElement {\n * const { width } = useWindowSize({ disableHeight: true });\n * const min = 96;\n * const max = Math.max(600, width * .7);\n *\n * const { value, splitterProps } = useWindowSplitter({\n * min,\n * max,\n * defaultValue: 256,\n * });\n *\n * return (\n * <LayoutWindowSplitter\n * aria-controls=\"layout-nav-id\"\n * {...splitterProps}\n * value={value}\n * />\n * );\n * }\n *\n * function Layout({ children }: PropsWithChildren): ReactElement {\n * return (\n * <>\n * <LayoutNav id=\"layout-nav\" {...otherProps}>\n * <YourNavigation />\n * </LayoutNav>\n * // only required when using SSR\n * <NoSsr>\n * <MyWindowSplitter />\n * </NoSsr>\n * <Main navOffset>\n * {children}\n * </Main>\n * </>\n * );\n * }\n * ```\n *\n * @remarks \\@since 6.0.0\n */\nexport const LayoutWindowSplitter = forwardRef<\n HTMLButtonElement,\n LayoutWindowSplitterProps\n>(function LayoutWindowSplitter(props, ref) {\n const {\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-label\": ariaLabel = ariaLabelledBy ? undefined : \"Resize Navigation\",\n appBarOffset,\n disableResponsive,\n className,\n navWidth,\n ...remaining\n } = props;\n\n useCSSVariables<DefinedCSSVariableName>(\n useMemo(\n () => [{ name: \"--rmd-layout-size\", value: `${navWidth}px` }],\n [navWidth]\n )\n );\n\n return (\n <WindowSplitter\n {...remaining}\n ref={ref}\n aria-label={ariaLabel as string}\n aria-labelledby={ariaLabelledBy}\n className={layoutWindowSplitter({\n appBarOffset,\n disableResponsive,\n className,\n })}\n />\n );\n});\n"],"names":["forwardRef","useMemo","useCSSVariables","WindowSplitter","layoutWindowSplitter","LayoutWindowSplitter","props","ref","ariaLabelledBy","ariaLabel","undefined","appBarOffset","disableResponsive","className","navWidth","remaining","name","value","aria-label","aria-labelledby"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AACA,SAASA,UAAU,EAAEC,OAAO,QAAQ,QAAQ;AAE5C,SAASC,eAAe,QAAQ,8BAA8B;AAC9D,SACEC,cAAc,QAET,uCAAuC;AAE9C,SACEC,oBAAoB,QAEf,kCAAkC;AAqBzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4DC,GACD,OAAO,MAAMC,qCAAuBL,WAGlC,SAASK,qBAAqBC,KAAK,EAAEC,GAAG;IACxC,MAAM,EACJ,mBAAmBC,cAAc,EACjC,cAAcC,YAAYD,iBAAiBE,YAAY,mBAAmB,EAC1EC,YAAY,EACZC,iBAAiB,EACjBC,SAAS,EACTC,QAAQ,EACR,GAAGC,WACJ,GAAGT;IAEJJ,gBACED,QACE,IAAM;YAAC;gBAAEe,MAAM;gBAAqBC,OAAO,CAAC,EAAEH,SAAS,EAAE,CAAC;YAAC;SAAE,EAC7D;QAACA;KAAS;IAId,qBACE,KAACX;QACE,GAAGY,SAAS;QACbR,KAAKA;QACLW,cAAYT;QACZU,mBAAiBX;QACjBK,WAAWT,qBAAqB;YAC9BO;YACAC;YACAC;QACF;;AAGN,GAAG"}
|
package/dist/layout/Main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/layout/Main.tsx"],"sourcesContent":["\"use client\";\nimport {\n forwardRef,\n type ElementType,\n type HTMLAttributes,\n type ReactNode,\n type Ref,\n} from \"react\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { main, type MainClassNameOptions } from \"./mainStyles.js\";\nimport { useMainTabIndex } from \"./useMainTabIndex.js\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type CustomMainElement = ElementType<\n HTMLAttributes<HTMLElement> & {\n ref: Ref<HTMLElement>;\n className?: string;\n tabIndex?: number;\n }\n>;\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface MainProps\n extends HTMLAttributes<HTMLElement>,\n MainClassNameOptions {\n /**\n * @defaultValue `\"main\"`\n */\n as?: CustomMainElement;\n children: ReactNode;\n}\n\n/**\n * **Client Component**\n *\n * This component is really only used to dynamically set the `tabIndex` to `-1`\n * while using a keyboard for the `SkipToMainContent` component's focus behavior\n * to work correctly. If you don't need that functionality, use the {@link main}\n * style utility instead.\n *\n * @example\n * Styles Only\n * ```tsx\n * import { main as mainStyles } from \"@react-md/core\":\n *\n * function MyCustomMainElement({ children }) {\n * return (\n * <main\n * className={mainStyles({\n * navOffset: true,\n * appBarOffset: true,\n * })}\n * >\n * {children}\n * </main>\n * );\n * }\n * ```\n *\n * @remarks \\@since 6.0.0 Renamed from `LayoutMain` removed a lot of\n * functionality to keep this component simple.\n */\nexport const Main = forwardRef<HTMLElement, MainProps>(\n function Main(props, ref) {\n const {\n as: Component = \"main\",\n id: propId,\n className,\n children,\n tabIndex: propTabIndex,\n navOffset,\n appBarOffset,\n ...remaining\n } = props;\n const id = useEnsuredId(propId, \"main\");\n const tabIndex = useMainTabIndex(propTabIndex);\n\n return (\n <Component\n {...remaining}\n id={id}\n ref={ref}\n className={main({ navOffset, appBarOffset, className })}\n tabIndex={tabIndex}\n >\n {children}\n </Component>\n );\n }\n);\n"],"names":["forwardRef","useEnsuredId","main","useMainTabIndex","Main","props","ref","as","Component","id","propId","className","children","tabIndex","propTabIndex","navOffset","appBarOffset","remaining"],"mappings":"AAAA;;AACA,SACEA,UAAU,QAKL,QAAQ;AACf,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,IAAI,QAAmC,kBAAkB;AAClE,SAASC,eAAe,QAAQ,uBAAuB;AA0BvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BC,GACD,OAAO,MAAMC,qBAAOJ,WAClB,SAASI,KAAKC,KAAK,EAAEC,GAAG;IACtB,MAAM,EACJC,IAAIC,YAAY,MAAM,EACtBC,IAAIC,MAAM,EACVC,SAAS,EACTC,QAAQ,EACRC,UAAUC,YAAY,EACtBC,SAAS,EACTC,YAAY,EACZ,GAAGC,WACJ,GAAGZ;IACJ,MAAMI,KAAKR,aAAaS,QAAQ;IAChC,MAAMG,WAAWV,gBAAgBW;IAEjC,qBACE,KAACN;QACE,GAAGS,SAAS;QACbR,IAAIA;QACJH,KAAKA;QACLK,WAAWT,KAAK;YAAEa;YAAWC;YAAcL;QAAU;QACrDE,UAAUA;kBAETD;;AAGP,GACA"}
|
|
1
|
+
{"version":3,"sources":["../../src/layout/Main.tsx"],"sourcesContent":["\"use client\";\nimport {\n forwardRef,\n type ElementType,\n type HTMLAttributes,\n type ReactNode,\n type Ref,\n} from \"react\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { main, type MainClassNameOptions } from \"./mainStyles.js\";\nimport { useMainTabIndex } from \"./useMainTabIndex.js\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type CustomMainElement = ElementType<\n HTMLAttributes<HTMLElement> & {\n ref: Ref<HTMLElement>;\n className?: string;\n tabIndex?: number;\n }\n>;\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface MainProps\n extends HTMLAttributes<HTMLElement>,\n MainClassNameOptions {\n /**\n * @defaultValue `\"main\"`\n */\n as?: CustomMainElement;\n children: ReactNode;\n}\n\n/**\n * **Client Component**\n *\n * This component is really only used to dynamically set the `tabIndex` to `-1`\n * while using a keyboard for the `SkipToMainContent` component's focus behavior\n * to work correctly. If you don't need that functionality, use the {@link main}\n * style utility instead.\n *\n * @example\n * Styles Only\n * ```tsx\n * import { main as mainStyles } from \"@react-md/core\":\n *\n * function MyCustomMainElement({ children }) {\n * return (\n * <main\n * className={mainStyles({\n * navOffset: true,\n * appBarOffset: true,\n * })}\n * >\n * {children}\n * </main>\n * );\n * }\n * ```\n *\n * @remarks \\@since 6.0.0 Renamed from `LayoutMain` removed a lot of\n * functionality to keep this component simple.\n */\nexport const Main = forwardRef<HTMLElement, MainProps>(\n function Main(props, ref) {\n const {\n as: Component = \"main\",\n id: propId,\n className,\n children,\n tabIndex: propTabIndex,\n navOffset,\n appBarOffset,\n ...remaining\n } = props;\n const id = useEnsuredId(propId, \"main\");\n const tabIndex = useMainTabIndex(propTabIndex);\n\n return (\n <Component\n {...remaining}\n id={id}\n ref={ref}\n className={main({ navOffset, appBarOffset, className })}\n tabIndex={tabIndex}\n >\n {children}\n </Component>\n );\n }\n);\n"],"names":["forwardRef","useEnsuredId","main","useMainTabIndex","Main","props","ref","as","Component","id","propId","className","children","tabIndex","propTabIndex","navOffset","appBarOffset","remaining"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AACA,SACEA,UAAU,QAKL,QAAQ;AACf,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,IAAI,QAAmC,kBAAkB;AAClE,SAASC,eAAe,QAAQ,uBAAuB;AA0BvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BC,GACD,OAAO,MAAMC,qBAAOJ,WAClB,SAASI,KAAKC,KAAK,EAAEC,GAAG;IACtB,MAAM,EACJC,IAAIC,YAAY,MAAM,EACtBC,IAAIC,MAAM,EACVC,SAAS,EACTC,QAAQ,EACRC,UAAUC,YAAY,EACtBC,SAAS,EACTC,YAAY,EACZ,GAAGC,WACJ,GAAGZ;IACJ,MAAMI,KAAKR,aAAaS,QAAQ;IAChC,MAAMG,WAAWV,gBAAgBW;IAEjC,qBACE,KAACN;QACE,GAAGS,SAAS;QACbR,IAAIA;QACJH,KAAKA;QACLK,WAAWT,KAAK;YAAEa;YAAWC;YAAcL;QAAU;QACrDE,UAAUA;kBAETD;;AAGP,GACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/layout/layoutNavStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-layout-nav\");\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface LayoutNavClassNameOptions {\n className?: string;\n\n /**\n * Set this to `true` if the nav should appear below the fixed app bar.\n *\n * @defaultValue `false`\n */\n appBarOffset?: boolean;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport function layoutNav(options: LayoutNavClassNameOptions = {}): string {\n const { className, appBarOffset } = options;\n\n return cnb(styles({ \"offset-v\": appBarOffset }), className);\n}\n"],"names":["cnb","bem","styles","layoutNav","options","className","appBarOffset"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AAgBnB;;CAEC,GACD,OAAO,SAASE,UAAUC,UAAqC,CAAC,CAAC;IAC/D,MAAM,EAAEC,SAAS,EAAEC,YAAY,EAAE,GAAGF;IAEpC,OAAOJ,IAAIE,OAAO;QAAE,YAAYI;IAAa,IAAID;AACnD"}
|
|
1
|
+
{"version":3,"sources":["../../src/layout/layoutNavStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-layout-nav\");\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface LayoutNavClassNameOptions {\n className?: string;\n\n /**\n * Set this to `true` if the nav should appear below the fixed app bar.\n *\n * @defaultValue `false`\n */\n appBarOffset?: boolean;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport function layoutNav(options: LayoutNavClassNameOptions = {}): string {\n const { className, appBarOffset } = options;\n\n return cnb(styles({ \"offset-v\": appBarOffset }), className);\n}\n"],"names":["cnb","bem","styles","layoutNav","options","className","appBarOffset"],"rangeMappings":";;;;;;;;;;","mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AAgBnB;;CAEC,GACD,OAAO,SAASE,UAAUC,UAAqC,CAAC,CAAC;IAC/D,MAAM,EAAEC,SAAS,EAAEC,YAAY,EAAE,GAAGF;IAEpC,OAAOJ,IAAIE,OAAO;QAAE,YAAYI;IAAa,IAAID;AACnD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/layout/layoutWindowSplitterStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-layout-splitter\");\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface LayoutWindowSplitterClassNameOptions {\n className?: string;\n\n /**\n * Set this to `true` if the window splitter should stop below the fixed app\n * bar.\n *\n * @defaultValue `false`\n */\n appBarOffset?: boolean;\n\n /**\n * Set this to `true` if the window splitter should no longer automatically be\n * hidden on for any viewport below the `$layout-navigation-breakpoint`\n * (default phone).\n *\n * @defaultValue `false`\n */\n disableResponsive?: boolean;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport function layoutWindowSplitter(\n options: LayoutWindowSplitterClassNameOptions = {}\n): string {\n const { className, appBarOffset, disableResponsive } = options;\n\n return cnb(\n styles({\n \"offset-v\": appBarOffset,\n responsive: !disableResponsive,\n }),\n className\n );\n}\n"],"names":["cnb","bem","styles","layoutWindowSplitter","options","className","appBarOffset","disableResponsive","responsive"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AA0BnB;;CAEC,GACD,OAAO,SAASE,qBACdC,UAAgD,CAAC,CAAC;IAElD,MAAM,EAAEC,SAAS,EAAEC,YAAY,EAAEC,iBAAiB,EAAE,GAAGH;IAEvD,OAAOJ,IACLE,OAAO;QACL,YAAYI;QACZE,YAAY,CAACD;IACf,IACAF;AAEJ"}
|
|
1
|
+
{"version":3,"sources":["../../src/layout/layoutWindowSplitterStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-layout-splitter\");\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface LayoutWindowSplitterClassNameOptions {\n className?: string;\n\n /**\n * Set this to `true` if the window splitter should stop below the fixed app\n * bar.\n *\n * @defaultValue `false`\n */\n appBarOffset?: boolean;\n\n /**\n * Set this to `true` if the window splitter should no longer automatically be\n * hidden on for any viewport below the `$layout-navigation-breakpoint`\n * (default phone).\n *\n * @defaultValue `false`\n */\n disableResponsive?: boolean;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport function layoutWindowSplitter(\n options: LayoutWindowSplitterClassNameOptions = {}\n): string {\n const { className, appBarOffset, disableResponsive } = options;\n\n return cnb(\n styles({\n \"offset-v\": appBarOffset,\n responsive: !disableResponsive,\n }),\n className\n );\n}\n"],"names":["cnb","bem","styles","layoutWindowSplitter","options","className","appBarOffset","disableResponsive","responsive"],"rangeMappings":";;;;;;;;;;;","mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AA0BnB;;CAEC,GACD,OAAO,SAASE,qBACdC,UAAgD,CAAC,CAAC;IAElD,MAAM,EAAEC,SAAS,EAAEC,YAAY,EAAEC,iBAAiB,EAAE,GAAGH;IAEvD,OAAOJ,IACLE,OAAO;QACL,YAAYI;QACZE,YAAY,CAACD;IACf,IACAF;AAEJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/layout/mainStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-layout-main\");\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface MainClassNameOptions {\n className?: string;\n\n /**\n * Set this to `true` to apply `margin-left` equal to the current navigation\n * width. If you want this value to animate, use the `useMainClassName` hook\n * instead.\n *\n * @defaultValue `false`\n */\n navOffset?: boolean;\n\n /**\n * Set this to `true` to apply `padding-top` equal to the height of the main\n * app bar so that content is not covered.\n *\n * @see {@link useLayoutAppBarHeight}\n * @defaultValue `false`\n */\n appBarOffset?: boolean;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport function main(options: MainClassNameOptions = {}): string {\n const { navOffset, appBarOffset, className } = options;\n\n return cnb(\n styles({\n \"offset-v\": appBarOffset,\n }),\n navOffset && \"rmd-layout-h--active\",\n className\n );\n}\n"],"names":["cnb","bem","styles","main","options","navOffset","appBarOffset","className"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AA2BnB;;CAEC,GACD,OAAO,SAASE,KAAKC,UAAgC,CAAC,CAAC;IACrD,MAAM,EAAEC,SAAS,EAAEC,YAAY,EAAEC,SAAS,EAAE,GAAGH;IAE/C,OAAOJ,IACLE,OAAO;QACL,YAAYI;IACd,IACAD,aAAa,wBACbE;AAEJ"}
|
|
1
|
+
{"version":3,"sources":["../../src/layout/mainStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-layout-main\");\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface MainClassNameOptions {\n className?: string;\n\n /**\n * Set this to `true` to apply `margin-left` equal to the current navigation\n * width. If you want this value to animate, use the `useMainClassName` hook\n * instead.\n *\n * @defaultValue `false`\n */\n navOffset?: boolean;\n\n /**\n * Set this to `true` to apply `padding-top` equal to the height of the main\n * app bar so that content is not covered.\n *\n * @see {@link useLayoutAppBarHeight}\n * @defaultValue `false`\n */\n appBarOffset?: boolean;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport function main(options: MainClassNameOptions = {}): string {\n const { navOffset, appBarOffset, className } = options;\n\n return cnb(\n styles({\n \"offset-v\": appBarOffset,\n }),\n navOffset && \"rmd-layout-h--active\",\n className\n );\n}\n"],"names":["cnb","bem","styles","main","options","navOffset","appBarOffset","className"],"rangeMappings":";;;;;;;;;;","mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AA2BnB;;CAEC,GACD,OAAO,SAASE,KAAKC,UAAgC,CAAC,CAAC;IACrD,MAAM,EAAEC,SAAS,EAAEC,YAAY,EAAEC,SAAS,EAAE,GAAGH;IAE/C,OAAOJ,IACLE,OAAO;QACL,YAAYI;IACd,IACAD,aAAa,wBACbE;AAEJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/layout/useExpandableLayout.ts"],"sourcesContent":["\"use client\";\nimport { useAppSize } from \"../media-queries/AppSizeProvider.js\";\nimport type { CSSTransitionElementProps } from \"../transition/types.js\";\nimport type { CssPosition, UseStateInitializer } from \"../types.js\";\nimport { useToggle } from \"../useToggle.js\";\nimport type { LayoutNavProps } from \"./LayoutNav.js\";\nimport type { HorizontalLayoutTransitionOptions } from \"./useHorizontalLayoutTransition.js\";\nimport { useHorizontalLayoutTransition } from \"./useHorizontalLayoutTransition.js\";\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { useResizableLayout } from \"./useResizableLayout.js\";\nimport type {\n ProvidedTemporaryLayoutAppBarProps,\n ProvidedTemporaryLayoutMainProps,\n TemporaryLayoutImplementation,\n TemporaryLayoutOptions,\n} from \"./useTemporaryLayout.js\";\nimport { useTemporaryLayout } from \"./useTemporaryLayout.js\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface ExpandableLayoutOptions extends TemporaryLayoutOptions {\n /** @defaultValue `\"fixed\"` */\n appBarPosition?: CssPosition;\n\n /** @defaultValue `false` */\n defaultExpanded?: UseStateInitializer<boolean>;\n\n /**\n * Set this to `true` if the expandable navigation should be the full height\n * of the screen. This will also update the app bar so that it is not covered\n * by the navigation. The default behavior is to place the navigation below\n * the fixed header.\n *\n * @defaultValue `false`\n */\n fullHeightNav?: boolean;\n\n /** @see {@link HorizontalLayoutTransitionOptions} */\n transitionProps?: Omit<HorizontalLayoutTransitionOptions, \"transitionIn\">;\n\n /**\n * Set this to `\"desktop\"` if you want to use the temporary navigation until\n * the viewport is at least desktop width instead of tablet.\n *\n * @defaultValue `\"tablet\"`\n */\n temporaryUntil?: \"tablet\" | \"desktop\";\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface ProvidedLayoutMainProps\n extends ProvidedTemporaryLayoutMainProps,\n CSSTransitionElementProps<HTMLElement> {}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type ProvidedLayoutNavProps = Pick<\n LayoutNavProps,\n \"expanded\" | \"appBarOffset\"\n>;\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type ProvidedLayoutAppBarProps = ProvidedTemporaryLayoutAppBarProps &\n Partial<CSSTransitionElementProps<HTMLElement>>;\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface ExpandableLayoutImplementation\n extends TemporaryLayoutImplementation {\n temporary: boolean;\n expanded: boolean;\n expandNavigation(): void;\n collapseNavigation(): void;\n toggleNavigation(): void;\n appBarProps: ProvidedLayoutAppBarProps;\n mainProps: ProvidedLayoutMainProps;\n expandableNavProps: ProvidedLayoutNavProps;\n}\n\n/**\n * @example\n * Main USage\n * ```tsx\n * import {\n * AppBarTitle,\n * Button,\n * LayoutAppBar,\n * LayoutNav,\n * Main,\n * Sheet,\n * useExpandableLayout,\n * } from \"@react-md/core\";\n * import type { ReactElement, ReactNode } from \"react\";\n *\n * import { CustomNavigation } from \"./CustomNavigation\";\n *\n * export interface LayoutProps {\n * children: ReactNode;\n * }\n *\n * export function Layout(props: LayoutProps): ReactElement {\n * const { children } = props;\n *\n * // choose whichever one for your app\n * // nextjs app dir\n * const pathname = usePathname();\n * // nextjs pages\n * const { pathname } = useRouter();\n * // react router\n * const { pathname } = useHistory();\n *\n * const {\n * temporary,\n * appBarProps,\n * expandableNavProps,\n * mainProps,\n * navToggleProps,\n * temporaryNavProps,\n * windowSplitterProps,\n * } = useExpandableLayout({ pathname });\n *\n * return {\n * <>\n * <LayoutAppBar {...appBarProps}>\n * <Button {...navToggleProps} />\n * <AppBarTitle>Hello, world!</AppBarTitle>\n * </LayoutAppBar>\n * <LayoutNav {...expandableNavProps}>\n * <CustomNavigation />\n * </LayoutNav>\n * {temporary && (\n * <Sheet {...temporaryNavProps}>\n * <CustomNavigation />\n * </Sheet>\n * )}\n * <Main {...mainProps}>{children}</Main>\n * </>\n * }\n * }\n * ```\n *\n * @remarks \\@since 6.0.0\n * @see {@link useResizableLayout}\n */\nexport function useExpandableLayout(\n options: ExpandableLayoutOptions\n): ExpandableLayoutImplementation {\n const {\n defaultExpanded = false,\n fullHeightNav = false,\n transitionProps,\n temporaryUntil = \"tablet\",\n ...temporaryOptions\n } = options;\n\n const {\n appBarProps,\n mainProps,\n navToggleProps,\n temporaryNavProps,\n hideTemporaryNav,\n showTemporaryNav,\n visible,\n } = useTemporaryLayout(temporaryOptions);\n\n const {\n toggled: expanded,\n enable: expandNavigation,\n disable: collapseNavigation,\n toggle: toggleNavigation,\n } = useToggle(defaultExpanded);\n const { elementProps } = useHorizontalLayoutTransition({\n ...transitionProps,\n transitionIn: expanded,\n });\n const { isPhone, isDesktop } = useAppSize();\n const temporary = isPhone || (temporaryUntil === \"desktop\" && !isDesktop);\n\n return {\n visible,\n temporary,\n hideTemporaryNav,\n showTemporaryNav,\n expanded,\n expandNavigation,\n collapseNavigation,\n toggleNavigation,\n appBarProps: {\n ...appBarProps,\n ...(fullHeightNav ? elementProps : {}),\n },\n mainProps: {\n ...mainProps,\n ...elementProps,\n },\n temporaryNavProps,\n expandableNavProps: {\n expanded,\n appBarOffset: !fullHeightNav,\n },\n navToggleProps: {\n ...navToggleProps,\n onClick() {\n if (temporary) {\n showTemporaryNav();\n } else {\n toggleNavigation();\n }\n },\n },\n };\n}\n"],"names":["useAppSize","useToggle","useHorizontalLayoutTransition","useTemporaryLayout","useExpandableLayout","options","defaultExpanded","fullHeightNav","transitionProps","temporaryUntil","temporaryOptions","appBarProps","mainProps","navToggleProps","temporaryNavProps","hideTemporaryNav","showTemporaryNav","visible","toggled","expanded","enable","expandNavigation","disable","collapseNavigation","toggle","toggleNavigation","elementProps","transitionIn","isPhone","isDesktop","temporary","expandableNavProps","appBarOffset","onClick"],"mappings":"AAAA;AACA,SAASA,UAAU,QAAQ,sCAAsC;AAGjE,SAASC,SAAS,QAAQ,kBAAkB;AAG5C,SAASC,6BAA6B,QAAQ,qCAAqC;AASnF,SAASC,kBAAkB,QAAQ,0BAA0B;AAsE7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgEC,GACD,OAAO,SAASC,oBACdC,OAAgC;IAEhC,MAAM,EACJC,kBAAkB,KAAK,EACvBC,gBAAgB,KAAK,EACrBC,eAAe,EACfC,iBAAiB,QAAQ,EACzB,GAAGC,kBACJ,GAAGL;IAEJ,MAAM,EACJM,WAAW,EACXC,SAAS,EACTC,cAAc,EACdC,iBAAiB,EACjBC,gBAAgB,EAChBC,gBAAgB,EAChBC,OAAO,EACR,GAAGd,mBAAmBO;IAEvB,MAAM,EACJQ,SAASC,QAAQ,EACjBC,QAAQC,gBAAgB,EACxBC,SAASC,kBAAkB,EAC3BC,QAAQC,gBAAgB,EACzB,GAAGxB,UAAUK;IACd,MAAM,EAAEoB,YAAY,EAAE,GAAGxB,8BAA8B;QACrD,GAAGM,eAAe;QAClBmB,cAAcR;IAChB;IACA,MAAM,EAAES,OAAO,EAAEC,SAAS,EAAE,GAAG7B;IAC/B,MAAM8B,YAAYF,WAAYnB,mBAAmB,aAAa,CAACoB;IAE/D,OAAO;QACLZ;QACAa;QACAf;QACAC;QACAG;QACAE;QACAE;QACAE;QACAd,aAAa;YACX,GAAGA,WAAW;YACd,GAAIJ,gBAAgBmB,eAAe,CAAC,CAAC;QACvC;QACAd,WAAW;YACT,GAAGA,SAAS;YACZ,GAAGc,YAAY;QACjB;QACAZ;QACAiB,oBAAoB;YAClBZ;YACAa,cAAc,CAACzB;QACjB;QACAM,gBAAgB;YACd,GAAGA,cAAc;YACjBoB;gBACE,IAAIH,WAAW;oBACbd;gBACF,OAAO;oBACLS;gBACF;YACF;QACF;IACF;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../src/layout/useExpandableLayout.ts"],"sourcesContent":["\"use client\";\nimport { useAppSize } from \"../media-queries/AppSizeProvider.js\";\nimport type { CSSTransitionElementProps } from \"../transition/types.js\";\nimport type { CssPosition, UseStateInitializer } from \"../types.js\";\nimport { useToggle } from \"../useToggle.js\";\nimport type { LayoutNavProps } from \"./LayoutNav.js\";\nimport type { HorizontalLayoutTransitionOptions } from \"./useHorizontalLayoutTransition.js\";\nimport { useHorizontalLayoutTransition } from \"./useHorizontalLayoutTransition.js\";\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { useResizableLayout } from \"./useResizableLayout.js\";\nimport type {\n ProvidedTemporaryLayoutAppBarProps,\n ProvidedTemporaryLayoutMainProps,\n TemporaryLayoutImplementation,\n TemporaryLayoutOptions,\n} from \"./useTemporaryLayout.js\";\nimport { useTemporaryLayout } from \"./useTemporaryLayout.js\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface ExpandableLayoutOptions extends TemporaryLayoutOptions {\n /** @defaultValue `\"fixed\"` */\n appBarPosition?: CssPosition;\n\n /** @defaultValue `false` */\n defaultExpanded?: UseStateInitializer<boolean>;\n\n /**\n * Set this to `true` if the expandable navigation should be the full height\n * of the screen. This will also update the app bar so that it is not covered\n * by the navigation. The default behavior is to place the navigation below\n * the fixed header.\n *\n * @defaultValue `false`\n */\n fullHeightNav?: boolean;\n\n /** @see {@link HorizontalLayoutTransitionOptions} */\n transitionProps?: Omit<HorizontalLayoutTransitionOptions, \"transitionIn\">;\n\n /**\n * Set this to `\"desktop\"` if you want to use the temporary navigation until\n * the viewport is at least desktop width instead of tablet.\n *\n * @defaultValue `\"tablet\"`\n */\n temporaryUntil?: \"tablet\" | \"desktop\";\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface ProvidedLayoutMainProps\n extends ProvidedTemporaryLayoutMainProps,\n CSSTransitionElementProps<HTMLElement> {}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type ProvidedLayoutNavProps = Pick<\n LayoutNavProps,\n \"expanded\" | \"appBarOffset\"\n>;\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type ProvidedLayoutAppBarProps = ProvidedTemporaryLayoutAppBarProps &\n Partial<CSSTransitionElementProps<HTMLElement>>;\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface ExpandableLayoutImplementation\n extends TemporaryLayoutImplementation {\n temporary: boolean;\n expanded: boolean;\n expandNavigation(): void;\n collapseNavigation(): void;\n toggleNavigation(): void;\n appBarProps: ProvidedLayoutAppBarProps;\n mainProps: ProvidedLayoutMainProps;\n expandableNavProps: ProvidedLayoutNavProps;\n}\n\n/**\n * @example\n * Main USage\n * ```tsx\n * import {\n * AppBarTitle,\n * Button,\n * LayoutAppBar,\n * LayoutNav,\n * Main,\n * Sheet,\n * useExpandableLayout,\n * } from \"@react-md/core\";\n * import type { ReactElement, ReactNode } from \"react\";\n *\n * import { CustomNavigation } from \"./CustomNavigation\";\n *\n * export interface LayoutProps {\n * children: ReactNode;\n * }\n *\n * export function Layout(props: LayoutProps): ReactElement {\n * const { children } = props;\n *\n * // choose whichever one for your app\n * // nextjs app dir\n * const pathname = usePathname();\n * // nextjs pages\n * const { pathname } = useRouter();\n * // react router\n * const { pathname } = useHistory();\n *\n * const {\n * temporary,\n * appBarProps,\n * expandableNavProps,\n * mainProps,\n * navToggleProps,\n * temporaryNavProps,\n * windowSplitterProps,\n * } = useExpandableLayout({ pathname });\n *\n * return {\n * <>\n * <LayoutAppBar {...appBarProps}>\n * <Button {...navToggleProps} />\n * <AppBarTitle>Hello, world!</AppBarTitle>\n * </LayoutAppBar>\n * <LayoutNav {...expandableNavProps}>\n * <CustomNavigation />\n * </LayoutNav>\n * {temporary && (\n * <Sheet {...temporaryNavProps}>\n * <CustomNavigation />\n * </Sheet>\n * )}\n * <Main {...mainProps}>{children}</Main>\n * </>\n * }\n * }\n * ```\n *\n * @remarks \\@since 6.0.0\n * @see {@link useResizableLayout}\n */\nexport function useExpandableLayout(\n options: ExpandableLayoutOptions\n): ExpandableLayoutImplementation {\n const {\n defaultExpanded = false,\n fullHeightNav = false,\n transitionProps,\n temporaryUntil = \"tablet\",\n ...temporaryOptions\n } = options;\n\n const {\n appBarProps,\n mainProps,\n navToggleProps,\n temporaryNavProps,\n hideTemporaryNav,\n showTemporaryNav,\n visible,\n } = useTemporaryLayout(temporaryOptions);\n\n const {\n toggled: expanded,\n enable: expandNavigation,\n disable: collapseNavigation,\n toggle: toggleNavigation,\n } = useToggle(defaultExpanded);\n const { elementProps } = useHorizontalLayoutTransition({\n ...transitionProps,\n transitionIn: expanded,\n });\n const { isPhone, isDesktop } = useAppSize();\n const temporary = isPhone || (temporaryUntil === \"desktop\" && !isDesktop);\n\n return {\n visible,\n temporary,\n hideTemporaryNav,\n showTemporaryNav,\n expanded,\n expandNavigation,\n collapseNavigation,\n toggleNavigation,\n appBarProps: {\n ...appBarProps,\n ...(fullHeightNav ? elementProps : {}),\n },\n mainProps: {\n ...mainProps,\n ...elementProps,\n },\n temporaryNavProps,\n expandableNavProps: {\n expanded,\n appBarOffset: !fullHeightNav,\n },\n navToggleProps: {\n ...navToggleProps,\n onClick() {\n if (temporary) {\n showTemporaryNav();\n } else {\n toggleNavigation();\n }\n },\n },\n };\n}\n"],"names":["useAppSize","useToggle","useHorizontalLayoutTransition","useTemporaryLayout","useExpandableLayout","options","defaultExpanded","fullHeightNav","transitionProps","temporaryUntil","temporaryOptions","appBarProps","mainProps","navToggleProps","temporaryNavProps","hideTemporaryNav","showTemporaryNav","visible","toggled","expanded","enable","expandNavigation","disable","collapseNavigation","toggle","toggleNavigation","elementProps","transitionIn","isPhone","isDesktop","temporary","expandableNavProps","appBarOffset","onClick"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AACA,SAASA,UAAU,QAAQ,sCAAsC;AAGjE,SAASC,SAAS,QAAQ,kBAAkB;AAG5C,SAASC,6BAA6B,QAAQ,qCAAqC;AASnF,SAASC,kBAAkB,QAAQ,0BAA0B;AAsE7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgEC,GACD,OAAO,SAASC,oBACdC,OAAgC;IAEhC,MAAM,EACJC,kBAAkB,KAAK,EACvBC,gBAAgB,KAAK,EACrBC,eAAe,EACfC,iBAAiB,QAAQ,EACzB,GAAGC,kBACJ,GAAGL;IAEJ,MAAM,EACJM,WAAW,EACXC,SAAS,EACTC,cAAc,EACdC,iBAAiB,EACjBC,gBAAgB,EAChBC,gBAAgB,EAChBC,OAAO,EACR,GAAGd,mBAAmBO;IAEvB,MAAM,EACJQ,SAASC,QAAQ,EACjBC,QAAQC,gBAAgB,EACxBC,SAASC,kBAAkB,EAC3BC,QAAQC,gBAAgB,EACzB,GAAGxB,UAAUK;IACd,MAAM,EAAEoB,YAAY,EAAE,GAAGxB,8BAA8B;QACrD,GAAGM,eAAe;QAClBmB,cAAcR;IAChB;IACA,MAAM,EAAES,OAAO,EAAEC,SAAS,EAAE,GAAG7B;IAC/B,MAAM8B,YAAYF,WAAYnB,mBAAmB,aAAa,CAACoB;IAE/D,OAAO;QACLZ;QACAa;QACAf;QACAC;QACAG;QACAE;QACAE;QACAE;QACAd,aAAa;YACX,GAAGA,WAAW;YACd,GAAIJ,gBAAgBmB,eAAe,CAAC,CAAC;QACvC;QACAd,WAAW;YACT,GAAGA,SAAS;YACZ,GAAGc,YAAY;QACjB;QACAZ;QACAiB,oBAAoB;YAClBZ;YACAa,cAAc,CAACzB;QACjB;QACAM,gBAAgB;YACd,GAAGA,cAAc;YACjBoB;gBACE,IAAIH,WAAW;oBACbd;gBACF,OAAO;oBACLS;gBACF;YACF;QACF;IACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/layout/useHorizontalLayoutTransition.ts"],"sourcesContent":["\"use client\";\nimport { cnb } from \"cnbuilder\";\nimport { DEFAULT_SHEET_TIMEOUT } from \"../sheet/Sheet.js\";\nimport type {\n CSSTransitionClassNames,\n CSSTransitionHookReturnValue,\n PreconfiguredCSSTransitionOptions,\n TransitionTimeout,\n} from \"../transition/types.js\";\nimport { useCSSTransition } from \"../transition/useCSSTransition.js\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport const DEFAULT_HORIZONTAL_LAYOUT_TRANSITION_CLASSNAMES = {\n appearDone: \"rmd-layout-h--active\",\n enter: \"rmd-layout-h--enter\",\n enterActive: \"rmd-layout-h--active\",\n enterDone: \"rmd-layout-h--active\",\n exit: \"rmd-layout-h--exit\",\n} satisfies Readonly<CSSTransitionClassNames>;\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface HorizontalLayoutTransitionOptions\n extends PreconfiguredCSSTransitionOptions<HTMLElement> {\n /**\n * @see {@link DEFAULT_SHEET_TIMEOUT}\n * @defaultValue `DEFAULT_SHEET_TIMEOUT`\n */\n timeout?: TransitionTimeout;\n /**\n * @see {@link DEFAULT_HORIZONTAL_LAYOUT_TRANSITION_CLASSNAMES}\n * @defaultValue `DEFAULT_HORIZONTAL_LAYOUT_TRANSITION_CLASSNAMES`\n */\n classNames?: CSSTransitionClassNames;\n}\n\n/**\n * @example\n * ```tsx\n * import { LayoutAppBar, Main, useHorizontalLayoutTransition } from \"@react-md/core\";\n * import type { ReactElement, ReactNode } from \"react\";\n *\n * interface Props {\n * title: ReactNode;\n * children: ReactNode;\n * }\n *\n * export default function Example({ title, children }: Props): ReactElement {\n * const { toggled: staticNavExpanded, toggle: toggleStaticNav } = useToggle();\n * const { elementProps, className } = useHorizontalLayoutTransition({\n * transitionIn: staticNavExpanded,\n * });\n *\n * return (\n * <>\n * <LayoutAppBar className={className}>\n * <Button\n * aria-label=\"Navigation\"\n * buttonType=\"icon\"\n * onClick={toggleStaticNav}\n * >\n * <MenuOutlinedIcon />\n * '</Button>\n * {title}\n * </LayoutAppBar>\n * <Main {...elementProps}>\n * {children}\n * </Main>\n * </>\n * );\n * }\n * ```\n *\n * @remarks \\@since 6.0.0\n */\nexport function useHorizontalLayoutTransition<\n E extends HTMLElement = HTMLElement,\n>(options: HorizontalLayoutTransitionOptions): CSSTransitionHookReturnValue<E> {\n return useCSSTransition({\n timeout: DEFAULT_SHEET_TIMEOUT,\n classNames: DEFAULT_HORIZONTAL_LAYOUT_TRANSITION_CLASSNAMES,\n ...options,\n className: cnb(\"rmd-layout-h\", options.className),\n });\n}\n"],"names":["cnb","DEFAULT_SHEET_TIMEOUT","useCSSTransition","DEFAULT_HORIZONTAL_LAYOUT_TRANSITION_CLASSNAMES","appearDone","enter","enterActive","enterDone","exit","useHorizontalLayoutTransition","options","timeout","classNames","className"],"mappings":"AAAA;AACA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,qBAAqB,QAAQ,oBAAoB;AAO1D,SAASC,gBAAgB,QAAQ,oCAAoC;AAErE;;CAEC,GACD,OAAO,MAAMC,kDAAkD;IAC7DC,YAAY;IACZC,OAAO;IACPC,aAAa;IACbC,WAAW;IACXC,MAAM;AACR,EAA8C;AAmB9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCC,GACD,OAAO,SAASC,8BAEdC,OAA0C;IAC1C,OAAOR,iBAAiB;QACtBS,SAASV;QACTW,YAAYT;QACZ,GAAGO,OAAO;QACVG,WAAWb,IAAI,gBAAgBU,QAAQG,SAAS;IAClD;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../src/layout/useHorizontalLayoutTransition.ts"],"sourcesContent":["\"use client\";\nimport { cnb } from \"cnbuilder\";\nimport { DEFAULT_SHEET_TIMEOUT } from \"../sheet/Sheet.js\";\nimport type {\n CSSTransitionClassNames,\n CSSTransitionHookReturnValue,\n PreconfiguredCSSTransitionOptions,\n TransitionTimeout,\n} from \"../transition/types.js\";\nimport { useCSSTransition } from \"../transition/useCSSTransition.js\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport const DEFAULT_HORIZONTAL_LAYOUT_TRANSITION_CLASSNAMES = {\n appearDone: \"rmd-layout-h--active\",\n enter: \"rmd-layout-h--enter\",\n enterActive: \"rmd-layout-h--active\",\n enterDone: \"rmd-layout-h--active\",\n exit: \"rmd-layout-h--exit\",\n} satisfies Readonly<CSSTransitionClassNames>;\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface HorizontalLayoutTransitionOptions\n extends PreconfiguredCSSTransitionOptions<HTMLElement> {\n /**\n * @see {@link DEFAULT_SHEET_TIMEOUT}\n * @defaultValue `DEFAULT_SHEET_TIMEOUT`\n */\n timeout?: TransitionTimeout;\n /**\n * @see {@link DEFAULT_HORIZONTAL_LAYOUT_TRANSITION_CLASSNAMES}\n * @defaultValue `DEFAULT_HORIZONTAL_LAYOUT_TRANSITION_CLASSNAMES`\n */\n classNames?: CSSTransitionClassNames;\n}\n\n/**\n * @example\n * ```tsx\n * import { LayoutAppBar, Main, useHorizontalLayoutTransition } from \"@react-md/core\";\n * import type { ReactElement, ReactNode } from \"react\";\n *\n * interface Props {\n * title: ReactNode;\n * children: ReactNode;\n * }\n *\n * export default function Example({ title, children }: Props): ReactElement {\n * const { toggled: staticNavExpanded, toggle: toggleStaticNav } = useToggle();\n * const { elementProps, className } = useHorizontalLayoutTransition({\n * transitionIn: staticNavExpanded,\n * });\n *\n * return (\n * <>\n * <LayoutAppBar className={className}>\n * <Button\n * aria-label=\"Navigation\"\n * buttonType=\"icon\"\n * onClick={toggleStaticNav}\n * >\n * <MenuOutlinedIcon />\n * '</Button>\n * {title}\n * </LayoutAppBar>\n * <Main {...elementProps}>\n * {children}\n * </Main>\n * </>\n * );\n * }\n * ```\n *\n * @remarks \\@since 6.0.0\n */\nexport function useHorizontalLayoutTransition<\n E extends HTMLElement = HTMLElement,\n>(options: HorizontalLayoutTransitionOptions): CSSTransitionHookReturnValue<E> {\n return useCSSTransition({\n timeout: DEFAULT_SHEET_TIMEOUT,\n classNames: DEFAULT_HORIZONTAL_LAYOUT_TRANSITION_CLASSNAMES,\n ...options,\n className: cnb(\"rmd-layout-h\", options.className),\n });\n}\n"],"names":["cnb","DEFAULT_SHEET_TIMEOUT","useCSSTransition","DEFAULT_HORIZONTAL_LAYOUT_TRANSITION_CLASSNAMES","appearDone","enter","enterActive","enterDone","exit","useHorizontalLayoutTransition","options","timeout","classNames","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AACA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,qBAAqB,QAAQ,oBAAoB;AAO1D,SAASC,gBAAgB,QAAQ,oCAAoC;AAErE;;CAEC,GACD,OAAO,MAAMC,kDAAkD;IAC7DC,YAAY;IACZC,OAAO;IACPC,aAAa;IACbC,WAAW;IACXC,MAAM;AACR,EAA8C;AAmB9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCC,GACD,OAAO,SAASC,8BAEdC,OAA0C;IAC1C,OAAOR,iBAAiB;QACtBS,SAASV;QACTW,YAAYT;QACZ,GAAGO,OAAO;QACVG,WAAWb,IAAI,gBAAgBU,QAAQG,SAAS;IAClD;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/layout/useLayoutAppBarHeight.ts"],"sourcesContent":["\"use client\";\nimport type { Ref, RefCallback } from \"react\";\nimport { useMemo } from \"react\";\nimport type { DefinedCSSVariableName } from \"../theme/types.js\";\nimport type { CSSVariable } from \"../theme/useCSSVariables.js\";\nimport { useElementSize } from \"../useElementSize.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-layout-size\"?: string;\n \"--rmd-layout-header-height\"?: string;\n }\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface LayoutAppBarHeightResult {\n height: number | undefined;\n variables: readonly CSSVariable<DefinedCSSVariableName>[];\n appBarRef: RefCallback<HTMLDivElement>;\n}\n\n/**\n * @example\n * Main Usage\n * ```tsx\n * import type { PropsWithChildren, ReactElement } from \"react\";\n * import {\n * AppBar,\n * useCSSVariables,\n * useLayoutAppBarHeight\n * } from \"@react-md/core\";\n *\n * export function LayoutHeader({ children }: PropsWithChildren): ReactElement {\n * const { appBarRef, variables } = useLayoutAppBarHeight();\n * useCSSVariables(variables);\n *\n * return (\n * <AppBar ref={appBarRef} {...customProps}>\n * <CustomChildren />\n * </AppBar>\n * );\n * };\n * ```\n *\n * @example\n * Inline Variables\n * ```tsx\n * import type { PropsWithChildren, ReactElement } from \"react\";\n * import {\n * AppBar,\n * useCSSVariables,\n * useLayoutAppBarHeight\n * } from \"@react-md/core\";\n *\n * export function Layout({ children }: PropsWithChildren): ReactElement {\n * const { appBarRef, variables } = useLayoutAppBarHeight();\n * const inlineStyle = useCSSVariables(variables, true);\n *\n * return (\n * <div style={inlineStyle}>\n * <AppBar ref={appBarRef} {...customProps}>\n * <CustomChildren />\n * </AppBar>\n * {children}\n * </div>\n * );\n * };\n * ```\n *\n * @remarks \\@since 6.0.0\n */\nexport function useLayoutAppBarHeight(\n ref?: Ref<HTMLDivElement>\n): LayoutAppBarHeightResult {\n const { height, elementRef } = useElementSize({\n ref,\n disableWidth: true,\n });\n const variables = useMemo<CSSVariable<DefinedCSSVariableName>[]>(() => {\n if (Number.isNaN(height)) {\n return [];\n }\n\n return [{ name: \"--rmd-layout-header-height\", value: `${height}px` }];\n }, [height]);\n\n return {\n height,\n variables,\n appBarRef: elementRef,\n };\n}\n"],"names":["useMemo","useElementSize","useLayoutAppBarHeight","ref","height","elementRef","disableWidth","variables","Number","isNaN","name","value","appBarRef"],"mappings":"AAAA;AAEA,SAASA,OAAO,QAAQ,QAAQ;AAGhC,SAASC,cAAc,QAAQ,uBAAuB;AAkBtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiDC,GACD,OAAO,SAASC,sBACdC,GAAyB;IAEzB,MAAM,EAAEC,MAAM,EAAEC,UAAU,EAAE,GAAGJ,eAAe;QAC5CE;QACAG,cAAc;IAChB;IACA,MAAMC,YAAYP,QAA+C;QAC/D,IAAIQ,OAAOC,KAAK,CAACL,SAAS;YACxB,OAAO,EAAE;QACX;QAEA,OAAO;YAAC;gBAAEM,MAAM;gBAA8BC,OAAO,CAAC,EAAEP,OAAO,EAAE,CAAC;YAAC;SAAE;IACvE,GAAG;QAACA;KAAO;IAEX,OAAO;QACLA;QACAG;QACAK,WAAWP;IACb;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../src/layout/useLayoutAppBarHeight.ts"],"sourcesContent":["\"use client\";\nimport type { Ref, RefCallback } from \"react\";\nimport { useMemo } from \"react\";\nimport type { DefinedCSSVariableName } from \"../theme/types.js\";\nimport type { CSSVariable } from \"../theme/useCSSVariables.js\";\nimport { useElementSize } from \"../useElementSize.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-layout-size\"?: string;\n \"--rmd-layout-header-height\"?: string;\n }\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface LayoutAppBarHeightResult {\n height: number | undefined;\n variables: readonly CSSVariable<DefinedCSSVariableName>[];\n appBarRef: RefCallback<HTMLDivElement>;\n}\n\n/**\n * @example\n * Main Usage\n * ```tsx\n * import type { PropsWithChildren, ReactElement } from \"react\";\n * import {\n * AppBar,\n * useCSSVariables,\n * useLayoutAppBarHeight\n * } from \"@react-md/core\";\n *\n * export function LayoutHeader({ children }: PropsWithChildren): ReactElement {\n * const { appBarRef, variables } = useLayoutAppBarHeight();\n * useCSSVariables(variables);\n *\n * return (\n * <AppBar ref={appBarRef} {...customProps}>\n * <CustomChildren />\n * </AppBar>\n * );\n * };\n * ```\n *\n * @example\n * Inline Variables\n * ```tsx\n * import type { PropsWithChildren, ReactElement } from \"react\";\n * import {\n * AppBar,\n * useCSSVariables,\n * useLayoutAppBarHeight\n * } from \"@react-md/core\";\n *\n * export function Layout({ children }: PropsWithChildren): ReactElement {\n * const { appBarRef, variables } = useLayoutAppBarHeight();\n * const inlineStyle = useCSSVariables(variables, true);\n *\n * return (\n * <div style={inlineStyle}>\n * <AppBar ref={appBarRef} {...customProps}>\n * <CustomChildren />\n * </AppBar>\n * {children}\n * </div>\n * );\n * };\n * ```\n *\n * @remarks \\@since 6.0.0\n */\nexport function useLayoutAppBarHeight(\n ref?: Ref<HTMLDivElement>\n): LayoutAppBarHeightResult {\n const { height, elementRef } = useElementSize({\n ref,\n disableWidth: true,\n });\n const variables = useMemo<CSSVariable<DefinedCSSVariableName>[]>(() => {\n if (Number.isNaN(height)) {\n return [];\n }\n\n return [{ name: \"--rmd-layout-header-height\", value: `${height}px` }];\n }, [height]);\n\n return {\n height,\n variables,\n appBarRef: elementRef,\n };\n}\n"],"names":["useMemo","useElementSize","useLayoutAppBarHeight","ref","height","elementRef","disableWidth","variables","Number","isNaN","name","value","appBarRef"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,SAASA,OAAO,QAAQ,QAAQ;AAGhC,SAASC,cAAc,QAAQ,uBAAuB;AAkBtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiDC,GACD,OAAO,SAASC,sBACdC,GAAyB;IAEzB,MAAM,EAAEC,MAAM,EAAEC,UAAU,EAAE,GAAGJ,eAAe;QAC5CE;QACAG,cAAc;IAChB;IACA,MAAMC,YAAYP,QAA+C;QAC/D,IAAIQ,OAAOC,KAAK,CAACL,SAAS;YACxB,OAAO,EAAE;QACX;QAEA,OAAO;YAAC;gBAAEM,MAAM;gBAA8BC,OAAO,CAAC,EAAEP,OAAO,EAAE,CAAC;YAAC;SAAE;IACvE,GAAG;QAACA;KAAO;IAEX,OAAO;QACLA;QACAG;QACAK,WAAWP;IACb;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/layout/useLayoutTree.ts"],"sourcesContent":["\"use client\";\nimport { useEffect, useMemo } from \"react\";\nimport type { TreeProps } from \"../tree/Tree.js\";\nimport type {\n DefaultTreeItemNode,\n TreeData,\n TreeItemDefaultIds,\n TreeItemNode,\n} from \"../tree/types.js\";\nimport type { TreeImplementation } from \"../tree/useTree.js\";\nimport { useTreeExpansion } from \"../tree/useTreeExpansion.js\";\nimport { getTreeItemsFrom } from \"../tree/utils.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * @internal\n */\nconst getParentIds = (\n itemId: string,\n navItems: TreeData<TreeItemNode>\n): readonly string[] =>\n getTreeItemsFrom(navItems, itemId).map(({ itemId }) => itemId);\n\n/**\n * @remarks \\@since 6.0.0 Removed the `linkComponent` option.\n */\nexport interface LayoutTreeOptions<\n T extends TreeItemNode = DefaultTreeItemNode,\n> {\n /**\n * The current pathname which is used as the tree `itemId`.\n */\n pathname: string;\n\n /**\n * @example\n * ```tsx\n * const navItems = {\n * \"/\": {\n * itemId: \"/\",\n * parentId: null,\n * children: \"Home\",\n * leftAddon: <HomeIcon />,\n * to: \"/\",\n * },\n * \"/route-1\": {\n * itemId: \"/route-1\",\n * parentId: null,\n * children: \"Route 1\",\n * leftAddon: <TvIcon />,\n * to: \"/route-1\",\n * },\n * \"/route-2\": {\n * itemId: \"/route-2\",\n * parentId: null,\n * children: \"Route 2\",\n * leftAddon: <AppsIcon />,\n * to: \"/route-2\",\n * },\n * \"/route-3\": {\n * itemId: \"/route-3\",\n * parentId: null,\n * children: \"Route 3\",\n * leftAddon: <BookIcon />,\n * to: \"/route-3\",\n * },\n * } satisfies TreeData;\n * ```\n */\n navItems: TreeData<T>;\n\n /**\n * @defaultValue `getParentIds(pathname, navItems)`\n */\n defaultExpandedIds?: TreeItemDefaultIds;\n}\n\n/**\n * @remarks \\@since 6.0.0 Renamed from `LayoutNavigationState`, removed the\n * `linkComponent`, and remap `navItems` to `data` so it can be passed to the\n * `Tree` component.\n */\nexport interface LayoutTreeImplementation<\n T extends TreeItemNode = DefaultTreeItemNode,\n> extends Pick<TreeProps<T>, \"data\">,\n TreeImplementation {}\n\n/**\n * Before considering to use a `Tree` for site navigation, it is important to\n * understand:\n * - There is a lot of functionality required to implement the tree widget so\n * your bundle size will increase\n * - A pattern more suited for typical site navigation with expandable groups of\n * links is the disclosure pattern.\n * - @see https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/\n *\n * @see https://www.w3.org/WAI/ARIA/apg/patterns/treeview/examples/treeview-navigation/\n *\n * This is a pretty reasonable default implementation for having a navigation\n * tree within the Layout component. The way it'll work is that the current\n * route will be the only selected item within the tree. When the pathname\n * changes, the selectedIds will be updated to only be the current pathname once\n * again.\n *\n * This means that you can use whatever routing library or history provider that\n * ensures that your layout re-renders on a path change.\n *\n * @example\n * ```tsx\n * import { Tree, useLayoutTree } from \"@react-md/core\";\n * import type { TreeData } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * // choose your routing library...\n * import { Link, useLocation } from \"react-router\";\n *\n * const navItems = {\n * \"/\": {\n * itemId: \"/\",\n * parentId: null,\n * children: \"Home\",\n * leftAddon: <HomeIcon />,\n * to: \"/\",\n * },\n * \"/route-1\": {\n * itemId: \"/route-1\",\n * parentId: null,\n * children: \"Route 1\",\n * leftAddon: <TvIcon />,\n * to: \"/route-1\",\n * },\n * \"/route-2\": {\n * itemId: \"/route-2\",\n * parentId: null,\n * children: \"Route 2\",\n * leftAddon: <AppsIcon />,\n * to: \"/route-2\",\n * },\n * \"/route-3\": {\n * itemId: \"/route-3\",\n * parentId: null,\n * children: \"Route 3\",\n * leftAddon: <BookIcon />,\n * to: \"/route-3\",\n * },\n * } satisfies TreeData;\n *\n * function Example(): ReactElement {\n * const { pathname } = useLocation();\n * const tree = useLayoutTree({\n * navItems,\n * pathname,\n * });\n *\n * return (\n * <Tree\n * {...tree}\n * aria-label=\"Navigation\"\n * linkComponent={Link}\n * />\n * );\n * }\n * ```\n *\n * @remarks \\@since 6.0.0 Renamed from `useLayoutNavigation`.\n */\nexport function useLayoutTree(\n options: LayoutTreeOptions\n): LayoutTreeImplementation {\n const { defaultExpandedIds, navItems, pathname } = options;\n\n const selectedIds = useMemo(() => new Set([pathname]), [pathname]);\n const { expandedIds, expandMultipleTreeItems, toggleTreeItemExpansion } =\n useTreeExpansion(\n defaultExpandedIds ?? (() => getParentIds(pathname, navItems))\n );\n\n useEffect(() => {\n expandMultipleTreeItems((prevExpandedIds) => {\n const nextExpandedIds = new Set([\n ...prevExpandedIds,\n ...getParentIds(pathname, navItems),\n ]);\n\n return nextExpandedIds;\n });\n }, [expandMultipleTreeItems, pathname, navItems]);\n\n return {\n data: navItems,\n multiSelect: false,\n selectedIds,\n expandedIds,\n expandMultipleTreeItems,\n toggleTreeItemExpansion,\n toggleTreeItemSelection: noop,\n selectMultipleTreeItems: noop,\n };\n}\n"],"names":["useEffect","useMemo","useTreeExpansion","getTreeItemsFrom","noop","getParentIds","itemId","navItems","map","useLayoutTree","options","defaultExpandedIds","pathname","selectedIds","Set","expandedIds","expandMultipleTreeItems","toggleTreeItemExpansion","prevExpandedIds","nextExpandedIds","data","multiSelect","toggleTreeItemSelection","selectMultipleTreeItems"],"mappings":"AAAA;AACA,SAASA,SAAS,EAAEC,OAAO,QAAQ,QAAQ;AAS3C,SAASC,gBAAgB,QAAQ,8BAA8B;AAC/D,SAASC,gBAAgB,QAAQ,mBAAmB;AAEpD,MAAMC,OAAO;AACX,aAAa;AACf;AAEA;;CAEC,GACD,MAAMC,eAAe,CACnBC,QACAC,WAEAJ,iBAAiBI,UAAUD,QAAQE,GAAG,CAAC,CAAC,EAAEF,MAAM,EAAE,GAAKA;AAkEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8EC,GACD,OAAO,SAASG,cACdC,OAA0B;IAE1B,MAAM,EAAEC,kBAAkB,EAAEJ,QAAQ,EAAEK,QAAQ,EAAE,GAAGF;IAEnD,MAAMG,cAAcZ,QAAQ,IAAM,IAAIa,IAAI;YAACF;SAAS,GAAG;QAACA;KAAS;IACjE,MAAM,EAAEG,WAAW,EAAEC,uBAAuB,EAAEC,uBAAuB,EAAE,GACrEf,iBACES,sBAAuB,CAAA,IAAMN,aAAaO,UAAUL,SAAQ;IAGhEP,UAAU;QACRgB,wBAAwB,CAACE;YACvB,MAAMC,kBAAkB,IAAIL,IAAI;mBAC3BI;mBACAb,aAAaO,UAAUL;aAC3B;YAED,OAAOY;QACT;IACF,GAAG;QAACH;QAAyBJ;QAAUL;KAAS;IAEhD,OAAO;QACLa,MAAMb;QACNc,aAAa;QACbR;QACAE;QACAC;QACAC;QACAK,yBAAyBlB;QACzBmB,yBAAyBnB;IAC3B;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../src/layout/useLayoutTree.ts"],"sourcesContent":["\"use client\";\nimport { useEffect, useMemo } from \"react\";\nimport type { TreeProps } from \"../tree/Tree.js\";\nimport type {\n DefaultTreeItemNode,\n TreeData,\n TreeItemDefaultIds,\n TreeItemNode,\n} from \"../tree/types.js\";\nimport type { TreeImplementation } from \"../tree/useTree.js\";\nimport { useTreeExpansion } from \"../tree/useTreeExpansion.js\";\nimport { getTreeItemsFrom } from \"../tree/utils.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * @internal\n */\nconst getParentIds = (\n itemId: string,\n navItems: TreeData<TreeItemNode>\n): readonly string[] =>\n getTreeItemsFrom(navItems, itemId).map(({ itemId }) => itemId);\n\n/**\n * @remarks \\@since 6.0.0 Removed the `linkComponent` option.\n */\nexport interface LayoutTreeOptions<\n T extends TreeItemNode = DefaultTreeItemNode,\n> {\n /**\n * The current pathname which is used as the tree `itemId`.\n */\n pathname: string;\n\n /**\n * @example\n * ```tsx\n * const navItems = {\n * \"/\": {\n * itemId: \"/\",\n * parentId: null,\n * children: \"Home\",\n * leftAddon: <HomeIcon />,\n * to: \"/\",\n * },\n * \"/route-1\": {\n * itemId: \"/route-1\",\n * parentId: null,\n * children: \"Route 1\",\n * leftAddon: <TvIcon />,\n * to: \"/route-1\",\n * },\n * \"/route-2\": {\n * itemId: \"/route-2\",\n * parentId: null,\n * children: \"Route 2\",\n * leftAddon: <AppsIcon />,\n * to: \"/route-2\",\n * },\n * \"/route-3\": {\n * itemId: \"/route-3\",\n * parentId: null,\n * children: \"Route 3\",\n * leftAddon: <BookIcon />,\n * to: \"/route-3\",\n * },\n * } satisfies TreeData;\n * ```\n */\n navItems: TreeData<T>;\n\n /**\n * @defaultValue `getParentIds(pathname, navItems)`\n */\n defaultExpandedIds?: TreeItemDefaultIds;\n}\n\n/**\n * @remarks \\@since 6.0.0 Renamed from `LayoutNavigationState`, removed the\n * `linkComponent`, and remap `navItems` to `data` so it can be passed to the\n * `Tree` component.\n */\nexport interface LayoutTreeImplementation<\n T extends TreeItemNode = DefaultTreeItemNode,\n> extends Pick<TreeProps<T>, \"data\">,\n TreeImplementation {}\n\n/**\n * Before considering to use a `Tree` for site navigation, it is important to\n * understand:\n * - There is a lot of functionality required to implement the tree widget so\n * your bundle size will increase\n * - A pattern more suited for typical site navigation with expandable groups of\n * links is the disclosure pattern.\n * - @see https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/\n *\n * @see https://www.w3.org/WAI/ARIA/apg/patterns/treeview/examples/treeview-navigation/\n *\n * This is a pretty reasonable default implementation for having a navigation\n * tree within the Layout component. The way it'll work is that the current\n * route will be the only selected item within the tree. When the pathname\n * changes, the selectedIds will be updated to only be the current pathname once\n * again.\n *\n * This means that you can use whatever routing library or history provider that\n * ensures that your layout re-renders on a path change.\n *\n * @example\n * ```tsx\n * import { Tree, useLayoutTree } from \"@react-md/core\";\n * import type { TreeData } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * // choose your routing library...\n * import { Link, useLocation } from \"react-router\";\n *\n * const navItems = {\n * \"/\": {\n * itemId: \"/\",\n * parentId: null,\n * children: \"Home\",\n * leftAddon: <HomeIcon />,\n * to: \"/\",\n * },\n * \"/route-1\": {\n * itemId: \"/route-1\",\n * parentId: null,\n * children: \"Route 1\",\n * leftAddon: <TvIcon />,\n * to: \"/route-1\",\n * },\n * \"/route-2\": {\n * itemId: \"/route-2\",\n * parentId: null,\n * children: \"Route 2\",\n * leftAddon: <AppsIcon />,\n * to: \"/route-2\",\n * },\n * \"/route-3\": {\n * itemId: \"/route-3\",\n * parentId: null,\n * children: \"Route 3\",\n * leftAddon: <BookIcon />,\n * to: \"/route-3\",\n * },\n * } satisfies TreeData;\n *\n * function Example(): ReactElement {\n * const { pathname } = useLocation();\n * const tree = useLayoutTree({\n * navItems,\n * pathname,\n * });\n *\n * return (\n * <Tree\n * {...tree}\n * aria-label=\"Navigation\"\n * linkComponent={Link}\n * />\n * );\n * }\n * ```\n *\n * @remarks \\@since 6.0.0 Renamed from `useLayoutNavigation`.\n */\nexport function useLayoutTree(\n options: LayoutTreeOptions\n): LayoutTreeImplementation {\n const { defaultExpandedIds, navItems, pathname } = options;\n\n const selectedIds = useMemo(() => new Set([pathname]), [pathname]);\n const { expandedIds, expandMultipleTreeItems, toggleTreeItemExpansion } =\n useTreeExpansion(\n defaultExpandedIds ?? (() => getParentIds(pathname, navItems))\n );\n\n useEffect(() => {\n expandMultipleTreeItems((prevExpandedIds) => {\n const nextExpandedIds = new Set([\n ...prevExpandedIds,\n ...getParentIds(pathname, navItems),\n ]);\n\n return nextExpandedIds;\n });\n }, [expandMultipleTreeItems, pathname, navItems]);\n\n return {\n data: navItems,\n multiSelect: false,\n selectedIds,\n expandedIds,\n expandMultipleTreeItems,\n toggleTreeItemExpansion,\n toggleTreeItemSelection: noop,\n selectMultipleTreeItems: noop,\n };\n}\n"],"names":["useEffect","useMemo","useTreeExpansion","getTreeItemsFrom","noop","getParentIds","itemId","navItems","map","useLayoutTree","options","defaultExpandedIds","pathname","selectedIds","Set","expandedIds","expandMultipleTreeItems","toggleTreeItemExpansion","prevExpandedIds","nextExpandedIds","data","multiSelect","toggleTreeItemSelection","selectMultipleTreeItems"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AACA,SAASA,SAAS,EAAEC,OAAO,QAAQ,QAAQ;AAS3C,SAASC,gBAAgB,QAAQ,8BAA8B;AAC/D,SAASC,gBAAgB,QAAQ,mBAAmB;AAEpD,MAAMC,OAAO;AACX,aAAa;AACf;AAEA;;CAEC,GACD,MAAMC,eAAe,CACnBC,QACAC,WAEAJ,iBAAiBI,UAAUD,QAAQE,GAAG,CAAC,CAAC,EAAEF,MAAM,EAAE,GAAKA;AAkEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8EC,GACD,OAAO,SAASG,cACdC,OAA0B;IAE1B,MAAM,EAAEC,kBAAkB,EAAEJ,QAAQ,EAAEK,QAAQ,EAAE,GAAGF;IAEnD,MAAMG,cAAcZ,QAAQ,IAAM,IAAIa,IAAI;YAACF;SAAS,GAAG;QAACA;KAAS;IACjE,MAAM,EAAEG,WAAW,EAAEC,uBAAuB,EAAEC,uBAAuB,EAAE,GACrEf,iBACES,sBAAuB,CAAA,IAAMN,aAAaO,UAAUL,SAAQ;IAGhEP,UAAU;QACRgB,wBAAwB,CAACE;YACvB,MAAMC,kBAAkB,IAAIL,IAAI;mBAC3BI;mBACAb,aAAaO,UAAUL;aAC3B;YAED,OAAOY;QACT;IACF,GAAG;QAACH;QAAyBJ;QAAUL;KAAS;IAEhD,OAAO;QACLa,MAAMb;QACNc,aAAa;QACbR;QACAE;QACAC;QACAC;QACAK,yBAAyBlB;QACzBmB,yBAAyBnB;IAC3B;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/layout/useLayoutWindowSplitter.ts"],"sourcesContent":["\"use client\";\nimport { type UncontrolledDraggableOptions } from \"../draggable/useDraggable.js\";\nimport { type UseStateInitializer } from \"../types.js\";\nimport { useWindowSize } from \"../useWindowSize.js\";\nimport {\n useWindowSplitter,\n type WindowSplitterImplementation,\n type WindowSplitterOptions,\n type WindowSplitterWidgetProps,\n} from \"../window-splitter/useWindowSplitter.js\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface LayoutWindowSplitterOptions\n extends Omit<WindowSplitterOptions, \"min\" | \"max\"> {\n /**\n * @see {@link WindowSplitterOptions.min}\n * @defaultValue `96`\n */\n min?: number;\n\n /**\n * This is the minimum max value that can be allowed while resizing the\n * browser. I don't know the best way to describe it, but the `max` value is\n * determined by:\n *\n * ```ts\n * const { width } = useWindowSize({ disableHeight: true });\n * const max = Math.max(maxMinimum, width * windowPercentage);\n * ```\n *\n * @defaultValue `600`\n */\n maxMinimum?: number;\n\n /**\n * This will be multiplied by the current window's width to determine the\n * dynamic max value for the window splitter.\n *\n * @see {@link maxMinimum}\n * @defaultValue `0.45`\n */\n windowPercentage?: number;\n\n /** @defaultValue `256` */\n defaultValue?: UseStateInitializer<number>;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface ProvidedLayoutWindowSplitterProps\n extends WindowSplitterWidgetProps<HTMLButtonElement> {\n /** @defaultValue {@link WindowSplitterImplementation.value} */\n navWidth: number;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface LayoutWindowSplitterImplementation\n extends WindowSplitterImplementation {\n splitterProps: ProvidedLayoutWindowSplitterProps;\n}\n\n/**\n * A custom window splitter implementation to be used with the\n * `LayoutWindowSplitter` that will dynamically configure the max width to be a\n * percentage of the current window's width.\n *\n * Note: This will automatically save the width in local storage as\n * `\"navWidth\"`. See the example below if you do not want to use local storage.\n *\n * @example\n * Without this hook\n * ```tsx\n * import { useWindowSize, useWindowSplitter } from \"@react-md/core\";\n * import type { ProvidedLayoutWindowSplitterProps } from \"@react-md/core\";\n *\n * export function useMyLayoutWindowSplitter(): ProvidedLayoutWindowSplitterProps {\n * const { width } = useWindowSize({ disableHeight: true });\n * const { splitterProps, value } = useWindowSplitter({\n * min: 96,\n * max: Math.max(maxMinimum, width * 0.45),\n * maxMinimum: 600,\n * });\n *\n * return {\n * ...splitterProps,\n * navWidth: value,\n * };\n * }\n *\n * function MyLayout() {\n * const splitterProps = useMyLayoutWindowSplitter();\n *\n * return (\n * <LayoutWindowSplitter\n * {...splitterProps}\n * aria-controls=\"layout-nav-id\"\n * />\n * );\n * }\n * ```\n *\n * @see {@link useResizableLayout} For a pre-built solution.\n * @remarks \\@since 6.0.0\n */\nexport function useLayoutWindowSplitter(\n options: LayoutWindowSplitterOptions = {}\n): LayoutWindowSplitterImplementation {\n const {\n min = 96,\n maxMinimum = 600,\n windowPercentage = 0.45,\n defaultValue = 256,\n ...remaining\n } = options;\n const { width } = useWindowSize({ disableHeight: true });\n const implementation = useWindowSplitter({\n min,\n max: Math.max(maxMinimum, width * windowPercentage),\n defaultValue,\n // type cast so it doesn't complain about defaultValue being provided with\n // value. That's mostly for public api usage\n ...(remaining as UncontrolledDraggableOptions),\n });\n\n return {\n ...implementation,\n splitterProps: {\n ...implementation.splitterProps,\n navWidth: implementation.value,\n },\n };\n}\n"],"names":["useWindowSize","useWindowSplitter","useLayoutWindowSplitter","options","min","maxMinimum","windowPercentage","defaultValue","remaining","width","disableHeight","implementation","max","Math","splitterProps","navWidth","value"],"mappings":"AAAA;AAGA,SAASA,aAAa,QAAQ,sBAAsB;AACpD,SACEC,iBAAiB,QAIZ,0CAA0C;AAyDjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0CC,GACD,OAAO,SAASC,wBACdC,UAAuC,CAAC,CAAC;IAEzC,MAAM,EACJC,MAAM,EAAE,EACRC,aAAa,GAAG,EAChBC,mBAAmB,IAAI,EACvBC,eAAe,GAAG,EAClB,GAAGC,WACJ,GAAGL;IACJ,MAAM,EAAEM,KAAK,EAAE,GAAGT,cAAc;QAAEU,eAAe;IAAK;IACtD,MAAMC,iBAAiBV,kBAAkB;QACvCG;QACAQ,KAAKC,KAAKD,GAAG,CAACP,YAAYI,QAAQH;QAClCC;QACA,0EAA0E;QAC1E,4CAA4C;QAC5C,GAAIC,SAAS;IACf;IAEA,OAAO;QACL,GAAGG,cAAc;QACjBG,eAAe;YACb,GAAGH,eAAeG,aAAa;YAC/BC,UAAUJ,eAAeK,KAAK;QAChC;IACF;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../src/layout/useLayoutWindowSplitter.ts"],"sourcesContent":["\"use client\";\nimport { type UncontrolledDraggableOptions } from \"../draggable/useDraggable.js\";\nimport { type UseStateInitializer } from \"../types.js\";\nimport { useWindowSize } from \"../useWindowSize.js\";\nimport {\n useWindowSplitter,\n type WindowSplitterImplementation,\n type WindowSplitterOptions,\n type WindowSplitterWidgetProps,\n} from \"../window-splitter/useWindowSplitter.js\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface LayoutWindowSplitterOptions\n extends Omit<WindowSplitterOptions, \"min\" | \"max\"> {\n /**\n * @see {@link WindowSplitterOptions.min}\n * @defaultValue `96`\n */\n min?: number;\n\n /**\n * This is the minimum max value that can be allowed while resizing the\n * browser. I don't know the best way to describe it, but the `max` value is\n * determined by:\n *\n * ```ts\n * const { width } = useWindowSize({ disableHeight: true });\n * const max = Math.max(maxMinimum, width * windowPercentage);\n * ```\n *\n * @defaultValue `600`\n */\n maxMinimum?: number;\n\n /**\n * This will be multiplied by the current window's width to determine the\n * dynamic max value for the window splitter.\n *\n * @see {@link maxMinimum}\n * @defaultValue `0.45`\n */\n windowPercentage?: number;\n\n /** @defaultValue `256` */\n defaultValue?: UseStateInitializer<number>;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface ProvidedLayoutWindowSplitterProps\n extends WindowSplitterWidgetProps<HTMLButtonElement> {\n /** @defaultValue {@link WindowSplitterImplementation.value} */\n navWidth: number;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface LayoutWindowSplitterImplementation\n extends WindowSplitterImplementation {\n splitterProps: ProvidedLayoutWindowSplitterProps;\n}\n\n/**\n * A custom window splitter implementation to be used with the\n * `LayoutWindowSplitter` that will dynamically configure the max width to be a\n * percentage of the current window's width.\n *\n * Note: This will automatically save the width in local storage as\n * `\"navWidth\"`. See the example below if you do not want to use local storage.\n *\n * @example\n * Without this hook\n * ```tsx\n * import { useWindowSize, useWindowSplitter } from \"@react-md/core\";\n * import type { ProvidedLayoutWindowSplitterProps } from \"@react-md/core\";\n *\n * export function useMyLayoutWindowSplitter(): ProvidedLayoutWindowSplitterProps {\n * const { width } = useWindowSize({ disableHeight: true });\n * const { splitterProps, value } = useWindowSplitter({\n * min: 96,\n * max: Math.max(maxMinimum, width * 0.45),\n * maxMinimum: 600,\n * });\n *\n * return {\n * ...splitterProps,\n * navWidth: value,\n * };\n * }\n *\n * function MyLayout() {\n * const splitterProps = useMyLayoutWindowSplitter();\n *\n * return (\n * <LayoutWindowSplitter\n * {...splitterProps}\n * aria-controls=\"layout-nav-id\"\n * />\n * );\n * }\n * ```\n *\n * @see {@link useResizableLayout} For a pre-built solution.\n * @remarks \\@since 6.0.0\n */\nexport function useLayoutWindowSplitter(\n options: LayoutWindowSplitterOptions = {}\n): LayoutWindowSplitterImplementation {\n const {\n min = 96,\n maxMinimum = 600,\n windowPercentage = 0.45,\n defaultValue = 256,\n ...remaining\n } = options;\n const { width } = useWindowSize({ disableHeight: true });\n const implementation = useWindowSplitter({\n min,\n max: Math.max(maxMinimum, width * windowPercentage),\n defaultValue,\n // type cast so it doesn't complain about defaultValue being provided with\n // value. That's mostly for public api usage\n ...(remaining as UncontrolledDraggableOptions),\n });\n\n return {\n ...implementation,\n splitterProps: {\n ...implementation.splitterProps,\n navWidth: implementation.value,\n },\n };\n}\n"],"names":["useWindowSize","useWindowSplitter","useLayoutWindowSplitter","options","min","maxMinimum","windowPercentage","defaultValue","remaining","width","disableHeight","implementation","max","Math","splitterProps","navWidth","value"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAGA,SAASA,aAAa,QAAQ,sBAAsB;AACpD,SACEC,iBAAiB,QAIZ,0CAA0C;AAyDjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0CC,GACD,OAAO,SAASC,wBACdC,UAAuC,CAAC,CAAC;IAEzC,MAAM,EACJC,MAAM,EAAE,EACRC,aAAa,GAAG,EAChBC,mBAAmB,IAAI,EACvBC,eAAe,GAAG,EAClB,GAAGC,WACJ,GAAGL;IACJ,MAAM,EAAEM,KAAK,EAAE,GAAGT,cAAc;QAAEU,eAAe;IAAK;IACtD,MAAMC,iBAAiBV,kBAAkB;QACvCG;QACAQ,KAAKC,KAAKD,GAAG,CAACP,YAAYI,QAAQH;QAClCC;QACA,0EAA0E;QAC1E,4CAA4C;QAC5C,GAAIC,SAAS;IACf;IAEA,OAAO;QACL,GAAGG,cAAc;QACjBG,eAAe;YACb,GAAGH,eAAeG,aAAa;YAC/BC,UAAUJ,eAAeK,KAAK;QAChC;IACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/layout/useMainTabIndex.ts"],"sourcesContent":["\"use client\";\nimport { useUserInteractionMode } from \"../interaction/UserInteractionModeProvider.js\";\n\n/**\n * This hook is used to return a tab index of `-1` whenever the user is using a\n * keyboard for the `SkipToMainContent` to work correctly.\n *\n * @remarks \\@since 6.0.0\n */\nexport function useMainTabIndex(tabIndex?: number): number | undefined {\n const keyboard = useUserInteractionMode() === \"keyboard\";\n if (keyboard && typeof tabIndex === \"undefined\") {\n tabIndex = -1;\n }\n\n return tabIndex;\n}\n"],"names":["useUserInteractionMode","useMainTabIndex","tabIndex","keyboard"],"mappings":"AAAA;AACA,SAASA,sBAAsB,QAAQ,gDAAgD;AAEvF;;;;;CAKC,GACD,OAAO,SAASC,gBAAgBC,QAAiB;IAC/C,MAAMC,WAAWH,6BAA6B;IAC9C,IAAIG,YAAY,OAAOD,aAAa,aAAa;QAC/CA,WAAW,CAAC;IACd;IAEA,OAAOA;AACT"}
|
|
1
|
+
{"version":3,"sources":["../../src/layout/useMainTabIndex.ts"],"sourcesContent":["\"use client\";\nimport { useUserInteractionMode } from \"../interaction/UserInteractionModeProvider.js\";\n\n/**\n * This hook is used to return a tab index of `-1` whenever the user is using a\n * keyboard for the `SkipToMainContent` to work correctly.\n *\n * @remarks \\@since 6.0.0\n */\nexport function useMainTabIndex(tabIndex?: number): number | undefined {\n const keyboard = useUserInteractionMode() === \"keyboard\";\n if (keyboard && typeof tabIndex === \"undefined\") {\n tabIndex = -1;\n }\n\n return tabIndex;\n}\n"],"names":["useUserInteractionMode","useMainTabIndex","tabIndex","keyboard"],"rangeMappings":";;;;;;;;;;;;;","mappings":"AAAA;AACA,SAASA,sBAAsB,QAAQ,gDAAgD;AAEvF;;;;;CAKC,GACD,OAAO,SAASC,gBAAgBC,QAAiB;IAC/C,MAAMC,WAAWH,6BAA6B;IAC9C,IAAIG,YAAY,OAAOD,aAAa,aAAa;QAC/CA,WAAW,CAAC;IACd;IAEA,OAAOA;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/layout/useResizableLayout.ts"],"sourcesContent":["import { useEnsuredId } from \"../useEnsuredId.js\";\nimport { DISPLAY_NONE_CLASS } from \"../utils/isElementVisible.js\";\nimport { type LayoutWindowSplitterProps } from \"./LayoutWindowSplitter.js\";\nimport {\n type ExpandableLayoutImplementation,\n type ExpandableLayoutOptions,\n type ProvidedLayoutNavProps,\n} from \"./useExpandableLayout.js\";\nimport { useExpandableLayout } from \"./useExpandableLayout.js\";\nimport {\n useLayoutWindowSplitter,\n type LayoutWindowSplitterOptions,\n} from \"./useLayoutWindowSplitter.js\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface ResizableLayoutOptions\n extends ExpandableLayoutOptions,\n LayoutWindowSplitterOptions {\n /**\n * This id will be used as the `aria-controls` prop for the\n * `LayoutWindowSplitter` and should be applied to the `LayoutNav` as an `id`.\n *\n * @defaultValue `\"layout-nav\" + useId()`\n */\n navId?: string;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface ProvidedResizableLayoutNavProps\n extends ProvidedLayoutNavProps {\n id: string;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface ResizableLayoutImplementation\n extends ExpandableLayoutImplementation {\n expandableNavProps: ProvidedResizableLayoutNavProps;\n windowSplitterProps: LayoutWindowSplitterProps;\n}\n\n/**\n * @example\n * Main USage\n * ```tsx\n * import {\n * AppBarTitle,\n * Button,\n * LayoutAppBar,\n * LayoutNav,\n * LayoutWindowSplitter,\n * Main,\n * Sheet,\n * useResizableLayout,\n * } from \"@react-md/core\";\n * import type { ReactElement, ReactNode } from \"react\";\n *\n * import { CustomNavigation } from \"./CustomNavigation\";\n *\n * export interface LayoutProps {\n * children: ReactNode;\n * }\n *\n * export function Layout(props: LayoutProps): ReactElement {\n * const { children } = props;\n *\n * // choose whichever one for your app\n * // nextjs app dir\n * const pathname = usePathname();\n * // nextjs pages\n * const { pathname } = useRouter();\n * // react router\n * const { pathname } = useHistory();\n *\n * const {\n * isPhone,\n * appBarProps,\n * expandableNavProps,\n * mainProps,\n * navToggleProps,\n * temporaryNavProps,\n * windowSplitterProps,\n * } = useResizableLayout({ pathname });\n *\n * return {\n * <>\n * <LayoutAppBar {...appBarProps}>\n * <Button {...navToggleProps} />\n * <AppBarTitle>Hello, world!</AppBarTitle>\n * </LayoutAppBar>\n * <LayoutNav {...expandableNavProps}>\n * <CustomNavigation />\n * </LayoutNav>\n * <LayoutWindowSplitter {...windowSplitterProps} />\n * {isPhone && (\n * <Sheet {...temporaryNavProps}>\n * <CustomNavigation />\n * </Sheet>\n * )}\n * <Main {...mainProps}>{children}</Main>\n * </>\n * }\n * }\n * ```\n * @remarks \\@since 6.0.0\n */\nexport function useResizableLayout(\n options: ResizableLayoutOptions\n): ResizableLayoutImplementation {\n const {\n navId: propNavId,\n pathname,\n appBarPosition = \"fixed\",\n fullHeightNav = false,\n defaultVisible,\n defaultExpanded,\n ...splitterOptions\n } = options;\n const navId = useEnsuredId(propNavId, \"layout-nav\");\n const { splitterProps, ...windowSplitter } =\n useLayoutWindowSplitter(splitterOptions);\n const expandableLayout = useExpandableLayout({\n pathname,\n appBarPosition,\n fullHeightNav,\n defaultExpanded,\n defaultVisible,\n });\n const { expandableNavProps, expanded } = expandableLayout;\n\n return {\n ...expandableLayout,\n ...windowSplitter,\n expandableNavProps: {\n id: navId,\n ...expandableNavProps,\n },\n windowSplitterProps: {\n ...splitterProps,\n \"aria-controls\": navId,\n appBarOffset: !fullHeightNav,\n className: (!expanded && DISPLAY_NONE_CLASS) || undefined,\n },\n };\n}\n"],"names":["useEnsuredId","DISPLAY_NONE_CLASS","useExpandableLayout","useLayoutWindowSplitter","useResizableLayout","options","navId","propNavId","pathname","appBarPosition","fullHeightNav","defaultVisible","defaultExpanded","splitterOptions","splitterProps","windowSplitter","expandableLayout","expandableNavProps","expanded","id","windowSplitterProps","appBarOffset","className","undefined"],"mappings":"AAAA,SAASA,YAAY,QAAQ,qBAAqB;AAClD,SAASC,kBAAkB,QAAQ,+BAA+B;AAOlE,SAASC,mBAAmB,QAAQ,2BAA2B;AAC/D,SACEC,uBAAuB,QAElB,+BAA+B;AAkCtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgEC,GACD,OAAO,SAASC,mBACdC,OAA+B;IAE/B,MAAM,EACJC,OAAOC,SAAS,EAChBC,QAAQ,EACRC,iBAAiB,OAAO,EACxBC,gBAAgB,KAAK,EACrBC,cAAc,EACdC,eAAe,EACf,GAAGC,iBACJ,GAAGR;IACJ,MAAMC,QAAQN,aAAaO,WAAW;IACtC,MAAM,EAAEO,aAAa,EAAE,GAAGC,gBAAgB,GACxCZ,wBAAwBU;IAC1B,MAAMG,mBAAmBd,oBAAoB;QAC3CM;QACAC;QACAC;QACAE;QACAD;IACF;IACA,MAAM,EAAEM,kBAAkB,EAAEC,QAAQ,EAAE,GAAGF;IAEzC,OAAO;QACL,GAAGA,gBAAgB;QACnB,GAAGD,cAAc;QACjBE,oBAAoB;YAClBE,IAAIb;YACJ,GAAGW,kBAAkB;QACvB;QACAG,qBAAqB;YACnB,GAAGN,aAAa;YAChB,iBAAiBR;YACjBe,cAAc,CAACX;YACfY,WAAW,AAAC,CAACJ,YAAYjB,sBAAuBsB;QAClD;IACF;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../src/layout/useResizableLayout.ts"],"sourcesContent":["import { useEnsuredId } from \"../useEnsuredId.js\";\nimport { DISPLAY_NONE_CLASS } from \"../utils/isElementVisible.js\";\nimport { type LayoutWindowSplitterProps } from \"./LayoutWindowSplitter.js\";\nimport {\n type ExpandableLayoutImplementation,\n type ExpandableLayoutOptions,\n type ProvidedLayoutNavProps,\n} from \"./useExpandableLayout.js\";\nimport { useExpandableLayout } from \"./useExpandableLayout.js\";\nimport {\n useLayoutWindowSplitter,\n type LayoutWindowSplitterOptions,\n} from \"./useLayoutWindowSplitter.js\";\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface ResizableLayoutOptions\n extends ExpandableLayoutOptions,\n LayoutWindowSplitterOptions {\n /**\n * This id will be used as the `aria-controls` prop for the\n * `LayoutWindowSplitter` and should be applied to the `LayoutNav` as an `id`.\n *\n * @defaultValue `\"layout-nav\" + useId()`\n */\n navId?: string;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface ProvidedResizableLayoutNavProps\n extends ProvidedLayoutNavProps {\n id: string;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface ResizableLayoutImplementation\n extends ExpandableLayoutImplementation {\n expandableNavProps: ProvidedResizableLayoutNavProps;\n windowSplitterProps: LayoutWindowSplitterProps;\n}\n\n/**\n * @example\n * Main USage\n * ```tsx\n * import {\n * AppBarTitle,\n * Button,\n * LayoutAppBar,\n * LayoutNav,\n * LayoutWindowSplitter,\n * Main,\n * Sheet,\n * useResizableLayout,\n * } from \"@react-md/core\";\n * import type { ReactElement, ReactNode } from \"react\";\n *\n * import { CustomNavigation } from \"./CustomNavigation\";\n *\n * export interface LayoutProps {\n * children: ReactNode;\n * }\n *\n * export function Layout(props: LayoutProps): ReactElement {\n * const { children } = props;\n *\n * // choose whichever one for your app\n * // nextjs app dir\n * const pathname = usePathname();\n * // nextjs pages\n * const { pathname } = useRouter();\n * // react router\n * const { pathname } = useHistory();\n *\n * const {\n * isPhone,\n * appBarProps,\n * expandableNavProps,\n * mainProps,\n * navToggleProps,\n * temporaryNavProps,\n * windowSplitterProps,\n * } = useResizableLayout({ pathname });\n *\n * return {\n * <>\n * <LayoutAppBar {...appBarProps}>\n * <Button {...navToggleProps} />\n * <AppBarTitle>Hello, world!</AppBarTitle>\n * </LayoutAppBar>\n * <LayoutNav {...expandableNavProps}>\n * <CustomNavigation />\n * </LayoutNav>\n * <LayoutWindowSplitter {...windowSplitterProps} />\n * {isPhone && (\n * <Sheet {...temporaryNavProps}>\n * <CustomNavigation />\n * </Sheet>\n * )}\n * <Main {...mainProps}>{children}</Main>\n * </>\n * }\n * }\n * ```\n * @remarks \\@since 6.0.0\n */\nexport function useResizableLayout(\n options: ResizableLayoutOptions\n): ResizableLayoutImplementation {\n const {\n navId: propNavId,\n pathname,\n appBarPosition = \"fixed\",\n fullHeightNav = false,\n defaultVisible,\n defaultExpanded,\n ...splitterOptions\n } = options;\n const navId = useEnsuredId(propNavId, \"layout-nav\");\n const { splitterProps, ...windowSplitter } =\n useLayoutWindowSplitter(splitterOptions);\n const expandableLayout = useExpandableLayout({\n pathname,\n appBarPosition,\n fullHeightNav,\n defaultExpanded,\n defaultVisible,\n });\n const { expandableNavProps, expanded } = expandableLayout;\n\n return {\n ...expandableLayout,\n ...windowSplitter,\n expandableNavProps: {\n id: navId,\n ...expandableNavProps,\n },\n windowSplitterProps: {\n ...splitterProps,\n \"aria-controls\": navId,\n appBarOffset: !fullHeightNav,\n className: (!expanded && DISPLAY_NONE_CLASS) || undefined,\n },\n };\n}\n"],"names":["useEnsuredId","DISPLAY_NONE_CLASS","useExpandableLayout","useLayoutWindowSplitter","useResizableLayout","options","navId","propNavId","pathname","appBarPosition","fullHeightNav","defaultVisible","defaultExpanded","splitterOptions","splitterProps","windowSplitter","expandableLayout","expandableNavProps","expanded","id","windowSplitterProps","appBarOffset","className","undefined"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,YAAY,QAAQ,qBAAqB;AAClD,SAASC,kBAAkB,QAAQ,+BAA+B;AAOlE,SAASC,mBAAmB,QAAQ,2BAA2B;AAC/D,SACEC,uBAAuB,QAElB,+BAA+B;AAkCtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgEC,GACD,OAAO,SAASC,mBACdC,OAA+B;IAE/B,MAAM,EACJC,OAAOC,SAAS,EAChBC,QAAQ,EACRC,iBAAiB,OAAO,EACxBC,gBAAgB,KAAK,EACrBC,cAAc,EACdC,eAAe,EACf,GAAGC,iBACJ,GAAGR;IACJ,MAAMC,QAAQN,aAAaO,WAAW;IACtC,MAAM,EAAEO,aAAa,EAAE,GAAGC,gBAAgB,GACxCZ,wBAAwBU;IAC1B,MAAMG,mBAAmBd,oBAAoB;QAC3CM;QACAC;QACAC;QACAE;QACAD;IACF;IACA,MAAM,EAAEM,kBAAkB,EAAEC,QAAQ,EAAE,GAAGF;IAEzC,OAAO;QACL,GAAGA,gBAAgB;QACnB,GAAGD,cAAc;QACjBE,oBAAoB;YAClBE,IAAIb;YACJ,GAAGW,kBAAkB;QACvB;QACAG,qBAAqB;YACnB,GAAGN,aAAa;YAChB,iBAAiBR;YACjBe,cAAc,CAACX;YACfY,WAAW,AAAC,CAACJ,YAAYjB,sBAAuBsB;QAClD;IACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/layout/useTemporaryLayout.ts"],"sourcesContent":["\"use client\";\nimport type { PropsWithChildren } from \"react\";\nimport { useEffect } from \"react\";\nimport type { AppBarProps } from \"../app-bar/AppBar.js\";\nimport type { ButtonProps } from \"../button/Button.js\";\nimport { getIcon } from \"../icon/iconConfig.js\";\nimport type { SheetProps } from \"../sheet/Sheet.js\";\nimport type { CssPosition, UseStateInitializer } from \"../types.js\";\nimport { useToggle } from \"../useToggle.js\";\nimport type { MainProps } from \"./Main.js\";\n\nexport interface TemporaryLayoutOptions {\n /**\n * This is used to automatically hide the temporary navigation whenever the\n * route changes. Set this to `null` if you want to handle closing yourself.\n */\n pathname: string | null;\n\n /** @defaultValue `\"fixed\"` */\n appBarPosition?: CssPosition;\n\n /** @defaultValue `false` */\n defaultVisible?: UseStateInitializer<boolean>;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type ProvidedLayoutNavToggleProps = PropsWithChildren<\n Pick<Required<ButtonProps>, \"aria-label\" | \"buttonType\" | \"onClick\">\n>;\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type ProvidedTemporaryLayoutNavProps = Pick<\n Required<SheetProps>,\n \"aria-label\" | \"visible\" | \"onRequestClose\"\n>;\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type ProvidedTemporaryLayoutMainProps = Required<\n Pick<MainProps, \"appBarOffset\">\n>;\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type ProvidedTemporaryLayoutAppBarProps = Required<\n Pick<AppBarProps, \"position\">\n>;\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface TemporaryLayoutImplementation {\n visible: boolean;\n showTemporaryNav(): void;\n hideTemporaryNav(): void;\n appBarProps: ProvidedTemporaryLayoutAppBarProps;\n mainProps: ProvidedTemporaryLayoutMainProps;\n navToggleProps: ProvidedLayoutNavToggleProps;\n temporaryNavProps: ProvidedTemporaryLayoutNavProps;\n}\n\n/**\n * @example\n * ```tsx\n * import {\n * AppBar,\n * AppBarTitle,\n * Button,\n * Main,\n * Sheet,\n * useTemporaryLayout,\n * } from \"@react-md/core\";\n * import type { ReactElement, ReactNode } from \"react\";\n *\n * import { CustomNavigation } from \"./CustomNavigation.jsx\";\n *\n * export interface LayoutProps {\n * children: ReactNode;\n * }\n *\n * export function Layout(props: LayoutProps): ReactElement {\n * const { children } = props;\n *\n * // choose whichever one for your app\n * // nextjs app dir\n * const pathname = usePathname();\n * // nextjs pages\n * const { pathname } = useRouter();\n * // react router\n * const { pathname } = useHistory();\n *\n * const {\n * mainProps,\n * navToggleProps,\n * temporaryNavProps,\n * } = useTemporaryLayout({ pathname });\n *\n * return (\n * <>\n * <AppBar position=\"fixed\">\n * <Button {...navToggleProps} />\n * <AppBarTitle>Hello, world!</AppBarTitle>\n * </AppBar>\n * <Main {...mainProps}>{children}</Main>\n * <Sheet {...temporaryNavProps}>\n * <CustomNavigation />\n * </Sheet>\n * </>\n * );\n * }\n * ```\n *\n * @remarks \\@since 6.0.0\n */\nexport function useTemporaryLayout(\n options: TemporaryLayoutOptions\n): TemporaryLayoutImplementation {\n const {\n pathname,\n defaultVisible = false,\n appBarPosition = \"fixed\",\n } = options;\n\n const menuIcon = getIcon(\"menu\");\n const {\n toggled: visible,\n enable: showTemporaryNav,\n disable: hideTemporaryNav,\n } = useToggle(defaultVisible);\n\n // hide the temporary nav whenever the route changes\n useEffect(() => {\n if (pathname !== null) {\n hideTemporaryNav();\n }\n }, [hideTemporaryNav, pathname]);\n\n return {\n visible,\n showTemporaryNav,\n hideTemporaryNav,\n appBarProps: {\n position: appBarPosition,\n },\n mainProps: {\n appBarOffset: appBarPosition !== \"static\",\n },\n temporaryNavProps: {\n \"aria-label\": \"Navigation\",\n visible,\n onRequestClose: hideTemporaryNav,\n },\n navToggleProps: {\n \"aria-label\": \"Navigation\",\n buttonType: \"icon\",\n children: menuIcon,\n onClick() {\n showTemporaryNav();\n },\n },\n };\n}\n"],"names":["useEffect","getIcon","useToggle","useTemporaryLayout","options","pathname","defaultVisible","appBarPosition","menuIcon","toggled","visible","enable","showTemporaryNav","disable","hideTemporaryNav","appBarProps","position","mainProps","appBarOffset","temporaryNavProps","onRequestClose","navToggleProps","buttonType","children","onClick"],"mappings":"AAAA;AAEA,SAASA,SAAS,QAAQ,QAAQ;AAGlC,SAASC,OAAO,QAAQ,wBAAwB;AAGhD,SAASC,SAAS,QAAQ,kBAAkB;AA2D5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoDC,GACD,OAAO,SAASC,mBACdC,OAA+B;IAE/B,MAAM,EACJC,QAAQ,EACRC,iBAAiB,KAAK,EACtBC,iBAAiB,OAAO,EACzB,GAAGH;IAEJ,MAAMI,WAAWP,QAAQ;IACzB,MAAM,EACJQ,SAASC,OAAO,EAChBC,QAAQC,gBAAgB,EACxBC,SAASC,gBAAgB,EAC1B,GAAGZ,UAAUI;IAEd,oDAAoD;IACpDN,UAAU;QACR,IAAIK,aAAa,MAAM;YACrBS;QACF;IACF,GAAG;QAACA;QAAkBT;KAAS;IAE/B,OAAO;QACLK;QACAE;QACAE;QACAC,aAAa;YACXC,UAAUT;QACZ;QACAU,WAAW;YACTC,cAAcX,mBAAmB;QACnC;QACAY,mBAAmB;YACjB,cAAc;YACdT;YACAU,gBAAgBN;QAClB;QACAO,gBAAgB;YACd,cAAc;YACdC,YAAY;YACZC,UAAUf;YACVgB;gBACEZ;YACF;QACF;IACF;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../src/layout/useTemporaryLayout.ts"],"sourcesContent":["\"use client\";\nimport type { PropsWithChildren } from \"react\";\nimport { useEffect } from \"react\";\nimport type { AppBarProps } from \"../app-bar/AppBar.js\";\nimport type { ButtonProps } from \"../button/Button.js\";\nimport { getIcon } from \"../icon/iconConfig.js\";\nimport type { SheetProps } from \"../sheet/Sheet.js\";\nimport type { CssPosition, UseStateInitializer } from \"../types.js\";\nimport { useToggle } from \"../useToggle.js\";\nimport type { MainProps } from \"./Main.js\";\n\nexport interface TemporaryLayoutOptions {\n /**\n * This is used to automatically hide the temporary navigation whenever the\n * route changes. Set this to `null` if you want to handle closing yourself.\n */\n pathname: string | null;\n\n /** @defaultValue `\"fixed\"` */\n appBarPosition?: CssPosition;\n\n /** @defaultValue `false` */\n defaultVisible?: UseStateInitializer<boolean>;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type ProvidedLayoutNavToggleProps = PropsWithChildren<\n Pick<Required<ButtonProps>, \"aria-label\" | \"buttonType\" | \"onClick\">\n>;\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type ProvidedTemporaryLayoutNavProps = Pick<\n Required<SheetProps>,\n \"aria-label\" | \"visible\" | \"onRequestClose\"\n>;\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type ProvidedTemporaryLayoutMainProps = Required<\n Pick<MainProps, \"appBarOffset\">\n>;\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type ProvidedTemporaryLayoutAppBarProps = Required<\n Pick<AppBarProps, \"position\">\n>;\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface TemporaryLayoutImplementation {\n visible: boolean;\n showTemporaryNav(): void;\n hideTemporaryNav(): void;\n appBarProps: ProvidedTemporaryLayoutAppBarProps;\n mainProps: ProvidedTemporaryLayoutMainProps;\n navToggleProps: ProvidedLayoutNavToggleProps;\n temporaryNavProps: ProvidedTemporaryLayoutNavProps;\n}\n\n/**\n * @example\n * ```tsx\n * import {\n * AppBar,\n * AppBarTitle,\n * Button,\n * Main,\n * Sheet,\n * useTemporaryLayout,\n * } from \"@react-md/core\";\n * import type { ReactElement, ReactNode } from \"react\";\n *\n * import { CustomNavigation } from \"./CustomNavigation.jsx\";\n *\n * export interface LayoutProps {\n * children: ReactNode;\n * }\n *\n * export function Layout(props: LayoutProps): ReactElement {\n * const { children } = props;\n *\n * // choose whichever one for your app\n * // nextjs app dir\n * const pathname = usePathname();\n * // nextjs pages\n * const { pathname } = useRouter();\n * // react router\n * const { pathname } = useHistory();\n *\n * const {\n * mainProps,\n * navToggleProps,\n * temporaryNavProps,\n * } = useTemporaryLayout({ pathname });\n *\n * return (\n * <>\n * <AppBar position=\"fixed\">\n * <Button {...navToggleProps} />\n * <AppBarTitle>Hello, world!</AppBarTitle>\n * </AppBar>\n * <Main {...mainProps}>{children}</Main>\n * <Sheet {...temporaryNavProps}>\n * <CustomNavigation />\n * </Sheet>\n * </>\n * );\n * }\n * ```\n *\n * @remarks \\@since 6.0.0\n */\nexport function useTemporaryLayout(\n options: TemporaryLayoutOptions\n): TemporaryLayoutImplementation {\n const {\n pathname,\n defaultVisible = false,\n appBarPosition = \"fixed\",\n } = options;\n\n const menuIcon = getIcon(\"menu\");\n const {\n toggled: visible,\n enable: showTemporaryNav,\n disable: hideTemporaryNav,\n } = useToggle(defaultVisible);\n\n // hide the temporary nav whenever the route changes\n useEffect(() => {\n if (pathname !== null) {\n hideTemporaryNav();\n }\n }, [hideTemporaryNav, pathname]);\n\n return {\n visible,\n showTemporaryNav,\n hideTemporaryNav,\n appBarProps: {\n position: appBarPosition,\n },\n mainProps: {\n appBarOffset: appBarPosition !== \"static\",\n },\n temporaryNavProps: {\n \"aria-label\": \"Navigation\",\n visible,\n onRequestClose: hideTemporaryNav,\n },\n navToggleProps: {\n \"aria-label\": \"Navigation\",\n buttonType: \"icon\",\n children: menuIcon,\n onClick() {\n showTemporaryNav();\n },\n },\n };\n}\n"],"names":["useEffect","getIcon","useToggle","useTemporaryLayout","options","pathname","defaultVisible","appBarPosition","menuIcon","toggled","visible","enable","showTemporaryNav","disable","hideTemporaryNav","appBarProps","position","mainProps","appBarOffset","temporaryNavProps","onRequestClose","navToggleProps","buttonType","children","onClick"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,SAASA,SAAS,QAAQ,QAAQ;AAGlC,SAASC,OAAO,QAAQ,wBAAwB;AAGhD,SAASC,SAAS,QAAQ,kBAAkB;AA2D5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoDC,GACD,OAAO,SAASC,mBACdC,OAA+B;IAE/B,MAAM,EACJC,QAAQ,EACRC,iBAAiB,KAAK,EACtBC,iBAAiB,OAAO,EACzB,GAAGH;IAEJ,MAAMI,WAAWP,QAAQ;IACzB,MAAM,EACJQ,SAASC,OAAO,EAChBC,QAAQC,gBAAgB,EACxBC,SAASC,gBAAgB,EAC1B,GAAGZ,UAAUI;IAEd,oDAAoD;IACpDN,UAAU;QACR,IAAIK,aAAa,MAAM;YACrBS;QACF;IACF,GAAG;QAACA;QAAkBT;KAAS;IAE/B,OAAO;QACLK;QACAE;QACAE;QACAC,aAAa;YACXC,UAAUT;QACZ;QACAU,WAAW;YACTC,cAAcX,mBAAmB;QACnC;QACAY,mBAAmB;YACjB,cAAc;YACdT;YACAU,gBAAgBN;QAClB;QACAO,gBAAgB;YACd,cAAc;YACdC,YAAY;YACZC,UAAUf;YACVgB;gBACEZ;YACF;QACF;IACF;AACF"}
|
package/dist/link/Link.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/link/Link.tsx"],"sourcesContent":["import {\n forwardRef,\n type AnchorHTMLAttributes,\n type ForwardRefExoticComponent,\n} from \"react\";\nimport { link, type LinkClassNameOptions } from \"./styles.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-link-color\"?: string;\n \"--rmd-link-visited-color\"?: string;\n \"--rmd-link-hover-color\"?: string;\n }\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type CustomLinkComponent =\n | ForwardRefExoticComponent<{ href: string }>\n | ForwardRefExoticComponent<{ to: string }>\n | \"a\";\n\n/**\n * @remarks\n * \\@since 6.0.0 Removed the `preventMaliciousTarget` prop since browsers\n * default to `rel=noopener` after updating the {@link https://github.com/whatwg/html/issues/4078|spec}.\n * \\@since 6.0.0 Removed the `component` prop since all you need for link\n * behavior is `className=\"rmd-link\"`.\n * \\@since 6.0.0 The `href` prop is required.\n * \\@since 6.0.0 Removed the `flexCentered` prop since it is now the default\n * styles.\n */\nexport interface LinkProps\n extends AnchorHTMLAttributes<HTMLAnchorElement>,\n LinkClassNameOptions {\n /**\n * All links **must** have a valid href.\n */\n href: string;\n\n /**\n * Set this to `true` if your link contains icons that should be centered and\n * spaced with additional text. This is not used by default so that links can\n * correctly line wrap while rendered within paragraphs of text.\n *\n * @defaultValue `false`\n */\n flex?: boolean;\n}\n\n/**\n * **Server Component**\n *\n * @example\n * Simple Example\n * ```tsx\n * import { Link, Typography } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Element(): ReactElement {\n * return (\n * <Typography>\n * Here is a paragraph of text with a {\" \"}\n * <Link href=\"/some-url\">link to some content</Link>.\n * </Typography>\n * );\n * }\n * ```\n *\n *\n * @remarks\n * \\@since 6.0.0 Removed the `preventMaliciousTarget` prop since browsers\n * default to `rel=noopener` after updating the {@link https://github.com/whatwg/html/issues/4078|spec}.\n * \\@since 6.0.0 Removed the `component` prop since all you need for link\n * behavior is `className=\"rmd-link\"`.\n * \\@since 6.0.0 The `href` prop is required.\n * \\@since 6.0.0 Removed the `flexCentered` prop since it is now the default\n * styles.\n */\nexport const Link = forwardRef<HTMLAnchorElement, LinkProps>(\n function Link(props, ref) {\n const { className, flex, children, ...remaining } = props;\n\n return (\n <a {...remaining} ref={ref} className={link({ flex, className })}>\n {children}\n </a>\n );\n }\n);\n"],"names":["forwardRef","link","Link","props","ref","className","flex","children","remaining","a"],"mappings":";AAAA,SACEA,UAAU,QAGL,QAAQ;AACf,SAASC,IAAI,QAAmC,cAAc;AA8C9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BC,GACD,OAAO,MAAMC,qBAAOF,WAClB,SAASE,KAAKC,KAAK,EAAEC,GAAG;IACtB,MAAM,EAAEC,SAAS,EAAEC,IAAI,EAAEC,QAAQ,EAAE,GAAGC,WAAW,GAAGL;IAEpD,qBACE,KAACM;QAAG,GAAGD,SAAS;QAAEJ,KAAKA;QAAKC,WAAWJ,KAAK;YAAEK;YAAMD;QAAU;kBAC3DE;;AAGP,GACA"}
|
|
1
|
+
{"version":3,"sources":["../../src/link/Link.tsx"],"sourcesContent":["import {\n forwardRef,\n type AnchorHTMLAttributes,\n type ForwardRefExoticComponent,\n} from \"react\";\nimport { link, type LinkClassNameOptions } from \"./styles.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-link-color\"?: string;\n \"--rmd-link-visited-color\"?: string;\n \"--rmd-link-hover-color\"?: string;\n }\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type CustomLinkComponent =\n | ForwardRefExoticComponent<{ href: string }>\n | ForwardRefExoticComponent<{ to: string }>\n | \"a\";\n\n/**\n * @remarks\n * \\@since 6.0.0 Removed the `preventMaliciousTarget` prop since browsers\n * default to `rel=noopener` after updating the {@link https://github.com/whatwg/html/issues/4078|spec}.\n * \\@since 6.0.0 Removed the `component` prop since all you need for link\n * behavior is `className=\"rmd-link\"`.\n * \\@since 6.0.0 The `href` prop is required.\n * \\@since 6.0.0 Removed the `flexCentered` prop since it is now the default\n * styles.\n */\nexport interface LinkProps\n extends AnchorHTMLAttributes<HTMLAnchorElement>,\n LinkClassNameOptions {\n /**\n * All links **must** have a valid href.\n */\n href: string;\n\n /**\n * Set this to `true` if your link contains icons that should be centered and\n * spaced with additional text. This is not used by default so that links can\n * correctly line wrap while rendered within paragraphs of text.\n *\n * @defaultValue `false`\n */\n flex?: boolean;\n}\n\n/**\n * **Server Component**\n *\n * @example\n * Simple Example\n * ```tsx\n * import { Link, Typography } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Element(): ReactElement {\n * return (\n * <Typography>\n * Here is a paragraph of text with a {\" \"}\n * <Link href=\"/some-url\">link to some content</Link>.\n * </Typography>\n * );\n * }\n * ```\n *\n *\n * @remarks\n * \\@since 6.0.0 Removed the `preventMaliciousTarget` prop since browsers\n * default to `rel=noopener` after updating the {@link https://github.com/whatwg/html/issues/4078|spec}.\n * \\@since 6.0.0 Removed the `component` prop since all you need for link\n * behavior is `className=\"rmd-link\"`.\n * \\@since 6.0.0 The `href` prop is required.\n * \\@since 6.0.0 Removed the `flexCentered` prop since it is now the default\n * styles.\n */\nexport const Link = forwardRef<HTMLAnchorElement, LinkProps>(\n function Link(props, ref) {\n const { className, flex, children, ...remaining } = props;\n\n return (\n <a {...remaining} ref={ref} className={link({ flex, className })}>\n {children}\n </a>\n );\n }\n);\n"],"names":["forwardRef","link","Link","props","ref","className","flex","children","remaining","a"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,SACEA,UAAU,QAGL,QAAQ;AACf,SAASC,IAAI,QAAmC,cAAc;AA8C9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BC,GACD,OAAO,MAAMC,qBAAOF,WAClB,SAASE,KAAKC,KAAK,EAAEC,GAAG;IACtB,MAAM,EAAEC,SAAS,EAAEC,IAAI,EAAEC,QAAQ,EAAE,GAAGC,WAAW,GAAGL;IAEpD,qBACE,KAACM;QAAG,GAAGD,SAAS;QAAEJ,KAAKA;QAAKC,WAAWJ,KAAK;YAAEK;YAAMD;QAAU;kBAC3DE;;AAGP,GACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/link/SkipToMainContent.tsx"],"sourcesContent":["\"use client\";\nimport { forwardRef, useEffect, useRef, type ReactNode } from \"react\";\nimport { Link, type LinkProps } from \"./Link.js\";\nimport {\n skipToMainContent,\n type SKipToMainContentClassNameOptions,\n} from \"./styles.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\nconst getMainElement = (mainId: string): HTMLElement | null =>\n mainId\n ? document.getElementById(mainId)\n : document.querySelector<HTMLElement>('main,[role=\"main\"]');\n\n/**\n * @remarks\n * \\@since 6.0.0 The {@link mainId} is optional\n */\nexport interface SkipToMainContentProps\n extends Omit<LinkProps, \"href\">,\n SKipToMainContentClassNameOptions {\n id?: string;\n\n /**\n * An optional id for the main element. When this is not provided, the main\n * element will be found by:\n *\n * ```ts\n * document.querySelector('main,[role=\"main\"]');\n * ```\n */\n mainId?: string;\n\n /**\n * @defaultValue `\"Skip to main content\"`\n */\n children?: ReactNode;\n}\n\n/**\n * **Client Component**\n *\n * @remarks\n * \\@since 6.0.0 Throws an error after rendering if no main element can be found\n * with the provided `mainId` in development mode. The previous behavior would\n * only log an error after being clicked.\n */\nexport const SkipToMainContent = forwardRef<\n HTMLAnchorElement,\n SkipToMainContentProps\n>(function SkipToMainContent(props, ref) {\n const {\n id = \"skip-to-main\",\n className,\n children = \"Skip to main content\",\n mainId = \"\",\n onClick = noop,\n unstyled = false,\n ...remaining\n } = props;\n\n const mainNodeRef = useRef<HTMLElement | null>(null);\n // want to warn the developer about missing main element in development\n // immediately to help prevent errors, but in production this can be lazy\n // initialized only once a keyboard user focuses and clicks this element\n if (process.env.NODE_ENV !== \"production\") {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useEffect(() => {\n mainNodeRef.current = getMainElement(mainId);\n\n if (!mainNodeRef.current) {\n const foundMainId = document.querySelector('main,[role=\"main\"]')?.id;\n let message = `Unable to find a main element to focus`;\n if (mainId) {\n message += ` with an id of \"${mainId}\"`;\n\n if (foundMainId) {\n message += ` but a main element was found with an id of \"${foundMainId}\".`;\n }\n }\n if (!foundMainId) {\n message +=\n '. There should be at least one <main> element or an element with role=\"main\" on the page for accessibility.';\n }\n\n throw new Error(message);\n }\n }, [mainId]);\n }\n\n return (\n <Link\n {...remaining}\n id={id}\n ref={ref}\n href={`#${mainId}`}\n onClick={(event) => {\n onClick(event);\n if (event.isPropagationStopped()) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n\n // see comment above useEffect\n mainNodeRef.current ||= getMainElement(mainId);\n mainNodeRef.current?.focus();\n }}\n className={skipToMainContent({\n unstyled,\n className,\n })}\n >\n {children}\n </Link>\n );\n});\n"],"names":["forwardRef","useEffect","useRef","Link","skipToMainContent","noop","getMainElement","mainId","document","getElementById","querySelector","SkipToMainContent","props","ref","id","className","children","onClick","unstyled","remaining","mainNodeRef","process","env","NODE_ENV","current","foundMainId","message","Error","href","event","isPropagationStopped","preventDefault","stopPropagation","focus"],"mappings":"AAAA;;AACA,SAASA,UAAU,EAAEC,SAAS,EAAEC,MAAM,QAAwB,QAAQ;AACtE,SAASC,IAAI,QAAwB,YAAY;AACjD,SACEC,iBAAiB,QAEZ,cAAc;AAErB,MAAMC,OAAO;AACX,aAAa;AACf;AAEA,MAAMC,iBAAiB,CAACC,SACtBA,SACIC,SAASC,cAAc,CAACF,UACxBC,SAASE,aAAa,CAAc;AA2B1C;;;;;;;CAOC,GACD,OAAO,MAAMC,kCAAoBX,WAG/B,SAASW,kBAAkBC,KAAK,EAAEC,GAAG;IACrC,MAAM,EACJC,KAAK,cAAc,EACnBC,SAAS,EACTC,WAAW,sBAAsB,EACjCT,SAAS,EAAE,EACXU,UAAUZ,IAAI,EACda,WAAW,KAAK,EAChB,GAAGC,WACJ,GAAGP;IAEJ,MAAMQ,cAAclB,OAA2B;IAC/C,uEAAuE;IACvE,yEAAyE;IACzE,wEAAwE;IACxE,IAAImB,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,sDAAsD;QACtDtB,UAAU;YACRmB,YAAYI,OAAO,GAAGlB,eAAeC;YAErC,IAAI,CAACa,YAAYI,OAAO,EAAE;gBACxB,MAAMC,cAAcjB,SAASE,aAAa,CAAC,uBAAuBI;gBAClE,IAAIY,UAAU,CAAC,sCAAsC,CAAC;gBACtD,IAAInB,QAAQ;oBACVmB,WAAW,CAAC,gBAAgB,EAAEnB,OAAO,CAAC,CAAC;oBAEvC,IAAIkB,aAAa;wBACfC,WAAW,CAAC,6CAA6C,EAAED,YAAY,EAAE,CAAC;oBAC5E;gBACF;gBACA,IAAI,CAACA,aAAa;oBAChBC,WACE;gBACJ;gBAEA,MAAM,IAAIC,MAAMD;YAClB;QACF,GAAG;YAACnB;SAAO;IACb;IAEA,qBACE,KAACJ;QACE,GAAGgB,SAAS;QACbL,IAAIA;QACJD,KAAKA;QACLe,MAAM,CAAC,CAAC,EAAErB,OAAO,CAAC;QAClBU,SAAS,CAACY;YACRZ,QAAQY;YACR,IAAIA,MAAMC,oBAAoB,IAAI;gBAChC;YACF;YAEAD,MAAME,cAAc;YACpBF,MAAMG,eAAe;YAErB,8BAA8B;YAC9BZ,YAAYI,OAAO,KAAKlB,eAAeC;YACvCa,YAAYI,OAAO,EAAES;QACvB;QACAlB,WAAWX,kBAAkB;YAC3Bc;YACAH;QACF;kBAECC;;AAGP,GAAG"}
|
|
1
|
+
{"version":3,"sources":["../../src/link/SkipToMainContent.tsx"],"sourcesContent":["\"use client\";\nimport { forwardRef, useEffect, useRef, type ReactNode } from \"react\";\nimport { Link, type LinkProps } from \"./Link.js\";\nimport {\n skipToMainContent,\n type SKipToMainContentClassNameOptions,\n} from \"./styles.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\nconst getMainElement = (mainId: string): HTMLElement | null =>\n mainId\n ? document.getElementById(mainId)\n : document.querySelector<HTMLElement>('main,[role=\"main\"]');\n\n/**\n * @remarks\n * \\@since 6.0.0 The {@link mainId} is optional\n */\nexport interface SkipToMainContentProps\n extends Omit<LinkProps, \"href\">,\n SKipToMainContentClassNameOptions {\n id?: string;\n\n /**\n * An optional id for the main element. When this is not provided, the main\n * element will be found by:\n *\n * ```ts\n * document.querySelector('main,[role=\"main\"]');\n * ```\n */\n mainId?: string;\n\n /**\n * @defaultValue `\"Skip to main content\"`\n */\n children?: ReactNode;\n}\n\n/**\n * **Client Component**\n *\n * @remarks\n * \\@since 6.0.0 Throws an error after rendering if no main element can be found\n * with the provided `mainId` in development mode. The previous behavior would\n * only log an error after being clicked.\n */\nexport const SkipToMainContent = forwardRef<\n HTMLAnchorElement,\n SkipToMainContentProps\n>(function SkipToMainContent(props, ref) {\n const {\n id = \"skip-to-main\",\n className,\n children = \"Skip to main content\",\n mainId = \"\",\n onClick = noop,\n unstyled = false,\n ...remaining\n } = props;\n\n const mainNodeRef = useRef<HTMLElement | null>(null);\n // want to warn the developer about missing main element in development\n // immediately to help prevent errors, but in production this can be lazy\n // initialized only once a keyboard user focuses and clicks this element\n if (process.env.NODE_ENV !== \"production\") {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useEffect(() => {\n mainNodeRef.current = getMainElement(mainId);\n\n if (!mainNodeRef.current) {\n const foundMainId = document.querySelector('main,[role=\"main\"]')?.id;\n let message = `Unable to find a main element to focus`;\n if (mainId) {\n message += ` with an id of \"${mainId}\"`;\n\n if (foundMainId) {\n message += ` but a main element was found with an id of \"${foundMainId}\".`;\n }\n }\n if (!foundMainId) {\n message +=\n '. There should be at least one <main> element or an element with role=\"main\" on the page for accessibility.';\n }\n\n throw new Error(message);\n }\n }, [mainId]);\n }\n\n return (\n <Link\n {...remaining}\n id={id}\n ref={ref}\n href={`#${mainId}`}\n onClick={(event) => {\n onClick(event);\n if (event.isPropagationStopped()) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n\n // see comment above useEffect\n mainNodeRef.current ||= getMainElement(mainId);\n mainNodeRef.current?.focus();\n }}\n className={skipToMainContent({\n unstyled,\n className,\n })}\n >\n {children}\n </Link>\n );\n});\n"],"names":["forwardRef","useEffect","useRef","Link","skipToMainContent","noop","getMainElement","mainId","document","getElementById","querySelector","SkipToMainContent","props","ref","id","className","children","onClick","unstyled","remaining","mainNodeRef","process","env","NODE_ENV","current","foundMainId","message","Error","href","event","isPropagationStopped","preventDefault","stopPropagation","focus"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AACA,SAASA,UAAU,EAAEC,SAAS,EAAEC,MAAM,QAAwB,QAAQ;AACtE,SAASC,IAAI,QAAwB,YAAY;AACjD,SACEC,iBAAiB,QAEZ,cAAc;AAErB,MAAMC,OAAO;AACX,aAAa;AACf;AAEA,MAAMC,iBAAiB,CAACC,SACtBA,SACIC,SAASC,cAAc,CAACF,UACxBC,SAASE,aAAa,CAAc;AA2B1C;;;;;;;CAOC,GACD,OAAO,MAAMC,kCAAoBX,WAG/B,SAASW,kBAAkBC,KAAK,EAAEC,GAAG;IACrC,MAAM,EACJC,KAAK,cAAc,EACnBC,SAAS,EACTC,WAAW,sBAAsB,EACjCT,SAAS,EAAE,EACXU,UAAUZ,IAAI,EACda,WAAW,KAAK,EAChB,GAAGC,WACJ,GAAGP;IAEJ,MAAMQ,cAAclB,OAA2B;IAC/C,uEAAuE;IACvE,yEAAyE;IACzE,wEAAwE;IACxE,IAAImB,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,sDAAsD;QACtDtB,UAAU;YACRmB,YAAYI,OAAO,GAAGlB,eAAeC;YAErC,IAAI,CAACa,YAAYI,OAAO,EAAE;gBACxB,MAAMC,cAAcjB,SAASE,aAAa,CAAC,uBAAuBI;gBAClE,IAAIY,UAAU,CAAC,sCAAsC,CAAC;gBACtD,IAAInB,QAAQ;oBACVmB,WAAW,CAAC,gBAAgB,EAAEnB,OAAO,CAAC,CAAC;oBAEvC,IAAIkB,aAAa;wBACfC,WAAW,CAAC,6CAA6C,EAAED,YAAY,EAAE,CAAC;oBAC5E;gBACF;gBACA,IAAI,CAACA,aAAa;oBAChBC,WACE;gBACJ;gBAEA,MAAM,IAAIC,MAAMD;YAClB;QACF,GAAG;YAACnB;SAAO;IACb;IAEA,qBACE,KAACJ;QACE,GAAGgB,SAAS;QACbL,IAAIA;QACJD,KAAKA;QACLe,MAAM,CAAC,CAAC,EAAErB,OAAO,CAAC;QAClBU,SAAS,CAACY;YACRZ,QAAQY;YACR,IAAIA,MAAMC,oBAAoB,IAAI;gBAChC;YACF;YAEAD,MAAME,cAAc;YACpBF,MAAMG,eAAe;YAErB,8BAA8B;YAC9BZ,YAAYI,OAAO,KAAKlB,eAAeC;YACvCa,YAAYI,OAAO,EAAES;QACvB;QACAlB,WAAWX,kBAAkB;YAC3Bc;YACAH;QACF;kBAECC;;AAGP,GAAG"}
|
package/dist/link/styles.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/link/styles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-link\");\n\n/** @remarks \\@since 6.0.0 */\nexport interface LinkClassNameOptions {\n className?: string;\n\n /** @defaultValue `false` */\n flex?: boolean;\n}\n\n/**\n * This really doesn't do much at this time since it only merges `rmd-link` with\n * the optional className. This was mostly added just for convention purposes.\n *\n * @remarks \\@since 6.0.0\n */\nexport function link(options: LinkClassNameOptions = {}): string {\n const { flex, className } = options;\n\n return cnb(styles({ flex }), className);\n}\n\n/** @remarks \\@since 6.0.0 */\nexport interface SKipToMainContentClassNameOptions {\n className?: string;\n\n /**\n * @defaultValue `false`\n */\n unstyled?: boolean;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport function skipToMainContent(\n options: SKipToMainContentClassNameOptions = {}\n): string {\n const { unstyled = false, className } = options;\n\n return cnb(\n styles({\n skip: true,\n \"skip-styled\": !unstyled,\n }),\n className\n );\n}\n"],"names":["cnb","bem","styles","link","options","flex","className","skipToMainContent","unstyled","skip"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AAUnB;;;;;CAKC,GACD,OAAO,SAASE,KAAKC,UAAgC,CAAC,CAAC;IACrD,MAAM,EAAEC,IAAI,EAAEC,SAAS,EAAE,GAAGF;IAE5B,OAAOJ,IAAIE,OAAO;QAAEG;IAAK,IAAIC;AAC/B;AAYA;;CAEC,GACD,OAAO,SAASC,kBACdH,UAA6C,CAAC,CAAC;IAE/C,MAAM,EAAEI,WAAW,KAAK,EAAEF,SAAS,EAAE,GAAGF;IAExC,OAAOJ,IACLE,OAAO;QACLO,MAAM;QACN,eAAe,CAACD;IAClB,IACAF;AAEJ"}
|
|
1
|
+
{"version":3,"sources":["../../src/link/styles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-link\");\n\n/** @remarks \\@since 6.0.0 */\nexport interface LinkClassNameOptions {\n className?: string;\n\n /** @defaultValue `false` */\n flex?: boolean;\n}\n\n/**\n * This really doesn't do much at this time since it only merges `rmd-link` with\n * the optional className. This was mostly added just for convention purposes.\n *\n * @remarks \\@since 6.0.0\n */\nexport function link(options: LinkClassNameOptions = {}): string {\n const { flex, className } = options;\n\n return cnb(styles({ flex }), className);\n}\n\n/** @remarks \\@since 6.0.0 */\nexport interface SKipToMainContentClassNameOptions {\n className?: string;\n\n /**\n * @defaultValue `false`\n */\n unstyled?: boolean;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport function skipToMainContent(\n options: SKipToMainContentClassNameOptions = {}\n): string {\n const { unstyled = false, className } = options;\n\n return cnb(\n styles({\n skip: true,\n \"skip-styled\": !unstyled,\n }),\n className\n );\n}\n"],"names":["cnb","bem","styles","link","options","flex","className","skipToMainContent","unstyled","skip"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AAUnB;;;;;CAKC,GACD,OAAO,SAASE,KAAKC,UAAgC,CAAC,CAAC;IACrD,MAAM,EAAEC,IAAI,EAAEC,SAAS,EAAE,GAAGF;IAE5B,OAAOJ,IAAIE,OAAO;QAAEG;IAAK,IAAIC;AAC/B;AAYA;;CAEC,GACD,OAAO,SAASC,kBACdH,UAA6C,CAAC,CAAC;IAE/C,MAAM,EAAEI,WAAW,KAAK,EAAEF,SAAS,EAAE,GAAGF;IAExC,OAAOJ,IACLE,OAAO;QACLO,MAAM;QACN,eAAe,CAACD;IAClB,IACAF;AAEJ"}
|
package/dist/list/List.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/list/List.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { forwardRef, type HTMLAttributes } from \"react\";\nimport { bem } from \"../utils/bem.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-list-padding-h\"?: string | number;\n \"--rmd-list-padding-v\"?: string | number;\n }\n}\n\nconst styles = bem(\"rmd-list\");\n\n/** @remarks \\@since 6.0.0 */\nexport interface ListClassNameOptions {\n className?: string;\n\n /** @defaultValue `false` */\n dense?: boolean;\n\n /** @defaultValue `false` */\n horizontal?: boolean;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport function list(options: ListClassNameOptions = {}): string {\n const { dense = false, horizontal = false, className } = options;\n\n return cnb(styles({ dense, horizontal }), className);\n}\n\nexport type ListElement = HTMLUListElement | HTMLOListElement;\n\nexport interface ListProps extends HTMLAttributes<ListElement> {\n /**\n * @defaultValue `\"none\"`\n */\n role?: HTMLAttributes<ListElement>[\"role\"];\n\n /**\n * Set to `true` to decrease the amount of padding and font size within the\n * list.\n *\n * @defaultValue `false`\n */\n dense?: boolean;\n\n /**\n * Set this to `true` to render as `<ol>` instead of `<ul>` when the children\n * are in a specific order. For example: steps within a recipe.\n *\n * @defaultValue `false`\n */\n ordered?: boolean;\n\n /**\n * Set this to `true` to render horizontally instead of vertically.\n *\n * @defaultValue `false`\n */\n horizontal?: boolean;\n}\n\n/**\n * **Server Component**\n *\n * The `List` component is used to render a collection of clickable actions\n * vertically or horizontally and does not include the default `ol`/`ul` styles.\n *\n * @example\n * Simple Example\n * ```tsx\n * import { List, ListItem, ListItemLink } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <List>\n * <ListItem\n * onClick={() => {\n * // do something\n * }}\n * >\n * Item 1\n * </ListItem>\n * <ListItem\n * onClick={() => {\n * // do something\n * }}\n * >\n * Item 2\n * </ListItem>\n * <ListItem\n * onClick={() => {\n * // do something\n * }}\n * >\n * Item 3\n * </ListItem>\n * <ListItemLink href=\"/some-route\">Link Example</ListItemLink>\n * </List>\n * );\n * }\n * ```\n */\nexport const List = forwardRef<ListElement, ListProps>(\n function List(props, ref) {\n const {\n className,\n children,\n role = \"none\",\n dense = false,\n ordered = false,\n horizontal = false,\n ...remaining\n } = props;\n const Component = (ordered ? \"ol\" : \"ul\") as \"ul\";\n return (\n <Component\n {...remaining}\n ref={ref}\n role={role}\n className={list({\n dense,\n horizontal,\n className,\n })}\n >\n {children}\n </Component>\n );\n }\n);\n"],"names":["cnb","forwardRef","bem","styles","list","options","dense","horizontal","className","List","props","ref","children","role","ordered","remaining","Component"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,UAAU,QAA6B,QAAQ;AACxD,SAASC,GAAG,QAAQ,kBAAkB;AAStC,MAAMC,SAASD,IAAI;AAanB;;CAEC,GACD,OAAO,SAASE,KAAKC,UAAgC,CAAC,CAAC;IACrD,MAAM,EAAEC,QAAQ,KAAK,EAAEC,aAAa,KAAK,EAAEC,SAAS,EAAE,GAAGH;IAEzD,OAAOL,IAAIG,OAAO;QAAEG;QAAOC;IAAW,IAAIC;AAC5C;AAkCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyCC,GACD,OAAO,MAAMC,qBAAOR,WAClB,SAASQ,KAAKC,KAAK,EAAEC,GAAG;IACtB,MAAM,EACJH,SAAS,EACTI,QAAQ,EACRC,OAAO,MAAM,EACbP,QAAQ,KAAK,EACbQ,UAAU,KAAK,EACfP,aAAa,KAAK,EAClB,GAAGQ,WACJ,GAAGL;IACJ,MAAMM,YAAaF,UAAU,OAAO;IACpC,qBACE,KAACE;QACE,GAAGD,SAAS;QACbJ,KAAKA;QACLE,MAAMA;QACNL,WAAWJ,KAAK;YACdE;YACAC;YACAC;QACF;kBAECI;;AAGP,GACA"}
|
|
1
|
+
{"version":3,"sources":["../../src/list/List.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { forwardRef, type HTMLAttributes } from \"react\";\nimport { bem } from \"../utils/bem.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-list-padding-h\"?: string | number;\n \"--rmd-list-padding-v\"?: string | number;\n }\n}\n\nconst styles = bem(\"rmd-list\");\n\n/** @remarks \\@since 6.0.0 */\nexport interface ListClassNameOptions {\n className?: string;\n\n /** @defaultValue `false` */\n dense?: boolean;\n\n /** @defaultValue `false` */\n horizontal?: boolean;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport function list(options: ListClassNameOptions = {}): string {\n const { dense = false, horizontal = false, className } = options;\n\n return cnb(styles({ dense, horizontal }), className);\n}\n\nexport type ListElement = HTMLUListElement | HTMLOListElement;\n\nexport interface ListProps extends HTMLAttributes<ListElement> {\n /**\n * @defaultValue `\"none\"`\n */\n role?: HTMLAttributes<ListElement>[\"role\"];\n\n /**\n * Set to `true` to decrease the amount of padding and font size within the\n * list.\n *\n * @defaultValue `false`\n */\n dense?: boolean;\n\n /**\n * Set this to `true` to render as `<ol>` instead of `<ul>` when the children\n * are in a specific order. For example: steps within a recipe.\n *\n * @defaultValue `false`\n */\n ordered?: boolean;\n\n /**\n * Set this to `true` to render horizontally instead of vertically.\n *\n * @defaultValue `false`\n */\n horizontal?: boolean;\n}\n\n/**\n * **Server Component**\n *\n * The `List` component is used to render a collection of clickable actions\n * vertically or horizontally and does not include the default `ol`/`ul` styles.\n *\n * @example\n * Simple Example\n * ```tsx\n * import { List, ListItem, ListItemLink } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <List>\n * <ListItem\n * onClick={() => {\n * // do something\n * }}\n * >\n * Item 1\n * </ListItem>\n * <ListItem\n * onClick={() => {\n * // do something\n * }}\n * >\n * Item 2\n * </ListItem>\n * <ListItem\n * onClick={() => {\n * // do something\n * }}\n * >\n * Item 3\n * </ListItem>\n * <ListItemLink href=\"/some-route\">Link Example</ListItemLink>\n * </List>\n * );\n * }\n * ```\n */\nexport const List = forwardRef<ListElement, ListProps>(\n function List(props, ref) {\n const {\n className,\n children,\n role = \"none\",\n dense = false,\n ordered = false,\n horizontal = false,\n ...remaining\n } = props;\n const Component = (ordered ? \"ol\" : \"ul\") as \"ul\";\n return (\n <Component\n {...remaining}\n ref={ref}\n role={role}\n className={list({\n dense,\n horizontal,\n className,\n })}\n >\n {children}\n </Component>\n );\n }\n);\n"],"names":["cnb","forwardRef","bem","styles","list","options","dense","horizontal","className","List","props","ref","children","role","ordered","remaining","Component"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,UAAU,QAA6B,QAAQ;AACxD,SAASC,GAAG,QAAQ,kBAAkB;AAStC,MAAMC,SAASD,IAAI;AAanB;;CAEC,GACD,OAAO,SAASE,KAAKC,UAAgC,CAAC,CAAC;IACrD,MAAM,EAAEC,QAAQ,KAAK,EAAEC,aAAa,KAAK,EAAEC,SAAS,EAAE,GAAGH;IAEzD,OAAOL,IAAIG,OAAO;QAAEG;QAAOC;IAAW,IAAIC;AAC5C;AAkCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyCC,GACD,OAAO,MAAMC,qBAAOR,WAClB,SAASQ,KAAKC,KAAK,EAAEC,GAAG;IACtB,MAAM,EACJH,SAAS,EACTI,QAAQ,EACRC,OAAO,MAAM,EACbP,QAAQ,KAAK,EACbQ,UAAU,KAAK,EACfP,aAAa,KAAK,EAClB,GAAGQ,WACJ,GAAGL;IACJ,MAAMM,YAAaF,UAAU,OAAO;IACpC,qBACE,KAACE;QACE,GAAGD,SAAS;QACbJ,KAAKA;QACLE,MAAMA;QACNL,WAAWJ,KAAK;YACdE;YACAC;YACAC;QACF;kBAECI;;AAGP,GACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/list/ListItem.tsx"],"sourcesContent":["\"use client\";\nimport { forwardRef, type HTMLAttributes } from \"react\";\nimport { useElementInteraction } from \"../interaction/useElementInteraction.js\";\nimport { useHigherContrastChildren } from \"../interaction/useHigherContrastChildren.js\";\nimport { getListItemHeight } from \"./getListItemHeight.js\";\nimport { ListItemChildren } from \"./ListItemChildren.js\";\nimport { listItem } from \"./listItemStyles.js\";\nimport { type ListItemChildrenProps, type ListItemHeight } from \"./types.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-list-item-keyline\"?: string | number;\n \"--rmd-list-item-padding-h\"?: string | number;\n \"--rmd-list-item-padding-v\"?: string | number;\n \"--rmd-list-item-height\"?: string | number;\n \"--rmd-list-item-medium-height\"?: string | number;\n \"--rmd-list-item-large-height\"?: string | number;\n \"--rmd-list-item-extra-large-height\"?: string | number;\n \"--rmd-list-item-multiline-clamp\"?: string | number;\n \"--rmd-list-item-multiline-height\"?: string | number;\n \"--rmd-list-item-media-size\"?: string | number;\n \"--rmd-list-item-media-spacing\"?: string | number;\n \"--rmd-list-item-text-multiline-height\"?: string | number;\n }\n}\n\n/**\n * @remarks \\@since 6.0.0 Renamed `threeLines` to `multiline` since it can\n * support more than three lines of text.\n */\nexport interface ListItemProps\n extends HTMLAttributes<HTMLLIElement>,\n ListItemChildrenProps {\n /**\n * @defaultValue `\"button\"`\n */\n role?: HTMLAttributes<HTMLLIElement>[\"role\"];\n\n /**\n * @defaultValue `disabled ? -1 : 0`\n */\n tabIndex?: number;\n\n /**\n * @see {@link ListItemHeight}\n * @defaultValue `\"auto\"`\n */\n height?: ListItemHeight;\n\n /**\n * @defaultValue `false`\n */\n multiline?: boolean;\n\n /**\n * @defaultValue `false`\n */\n disabled?: boolean;\n\n /**\n * Note: This does nothing if the `disabled` prop is not enabled.\n *\n * @defaultValue `false`\n * @remarks \\@since 2.4.3\n */\n disabledOpacity?: boolean;\n\n /**\n * Set this to `false` if the list item should not gain the interaction\n * states: hover, focus, press, etc. This is kind of like being disabled\n * without the disabled styles being applied.\n *\n * @defaultValue `role === \"presentation\"`\n */\n presentational?: boolean;\n}\n\n/**\n * **Client Component**\n *\n * The `ListItem` is used to create a clickable/focusable button within a\n * `List` and removes the normal `<li>` styles.\n *\n * @example\n * Simple Example\n * ```tsx\n * import { List, ListItem } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <List>\n * <ListItem\n * onClick={() => {\n * // do something\n * }}\n * >\n * Item 1\n * </ListItem>\n * <ListItem\n * onClick={() => {\n * // do something\n * }}\n * secondaryText={<span>Some <strong>additional</strong> content.</span>}\n * >\n * Item 2\n * </ListItem>\n * </List>\n * );\n * );\n * }\n * ```\n *\n * @example\n * Applying Addons Example\n * ```tsx\n * import { List, ListItem } from \"@react-md/core\";\n * import FavoriteIcon from \"@react-md/material-icons/FavoriteIcon\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <List>\n * <ListItem leftAddon={<FavoriteIcon />}>\n * Item 1\n * </ListItem>\n * <ListItem rightAddon={<FavoriteIcon />}>\n * Item 2\n * </ListItem>\n * <ListItem\n * leftAddon={<FavoriteIcon />}\n * rightAddon={<img alt=\"\" src=\"/some-image.png\" />}\n * rightAddonType=\"media\"\n * >\n * Item 3\n * </ListItem>\n * </List>\n * );\n * );\n * }\n * ```\n */\nexport const ListItem = forwardRef<HTMLLIElement, ListItemProps>(\n function ListItem(props, ref) {\n const {\n className,\n textProps,\n textClassName,\n secondaryTextClassName,\n primaryText,\n secondaryText,\n secondaryTextProps,\n disableTextChildren = false,\n height: propHeight,\n leftAddon,\n leftAddonType,\n leftAddonPosition,\n leftAddonClassName,\n leftAddonForceWrap,\n rightAddon,\n rightAddonType,\n rightAddonPosition,\n rightAddonClassName,\n rightAddonForceWrap,\n disableLeftAddonSpacing,\n disableLeftAddonCenteredMedia,\n disableRightAddonCenteredMedia,\n multiline = false,\n disabled = false,\n disabledOpacity = false,\n role = \"button\",\n onBlur,\n onClick,\n onKeyDown,\n onKeyUp,\n onMouseDown,\n onMouseUp,\n onMouseLeave,\n onDragStart,\n onTouchStart,\n onTouchEnd,\n onTouchMove,\n tabIndex: propTabIndex,\n children: propChildren,\n presentational = role === \"presentation\",\n ...remaining\n } = props;\n\n let tabIndex = propTabIndex;\n if (!presentational && typeof tabIndex === \"undefined\") {\n tabIndex = disabled ? -1 : 0;\n }\n\n const { pressedClassName, ripples, handlers } = 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: disabled || presentational,\n });\n const children = useHigherContrastChildren(\n propChildren,\n !disableTextChildren\n );\n\n const height = getListItemHeight({\n height: propHeight,\n leftAddon,\n leftAddonType,\n rightAddon,\n rightAddonType,\n secondaryText,\n });\n\n return (\n <li\n {...remaining}\n {...handlers}\n aria-disabled={disabled || undefined}\n ref={ref}\n role={role}\n tabIndex={tabIndex}\n className={listItem({\n className,\n height,\n disabled,\n disabledOpacity,\n multiline,\n clickable: !presentational,\n pressedClassName,\n })}\n >\n <ListItemChildren\n multiline={multiline}\n textClassName={textClassName}\n secondaryTextClassName={secondaryTextClassName}\n disableTextChildren={disableTextChildren}\n primaryText={primaryText}\n textProps={textProps}\n secondaryText={secondaryText}\n secondaryTextProps={secondaryTextProps}\n leftAddon={leftAddon}\n leftAddonType={leftAddonType}\n leftAddonPosition={leftAddonPosition}\n leftAddonClassName={leftAddonClassName}\n leftAddonForceWrap={leftAddonForceWrap}\n rightAddon={rightAddon}\n rightAddonType={rightAddonType}\n rightAddonPosition={rightAddonPosition}\n rightAddonClassName={rightAddonClassName}\n rightAddonForceWrap={rightAddonForceWrap}\n disableLeftAddonSpacing={disableLeftAddonSpacing}\n disableLeftAddonCenteredMedia={disableLeftAddonCenteredMedia}\n disableRightAddonCenteredMedia={disableRightAddonCenteredMedia}\n >\n {children}\n </ListItemChildren>\n {ripples}\n </li>\n );\n }\n);\n"],"names":["forwardRef","useElementInteraction","useHigherContrastChildren","getListItemHeight","ListItemChildren","listItem","ListItem","props","ref","className","textProps","textClassName","secondaryTextClassName","primaryText","secondaryText","secondaryTextProps","disableTextChildren","height","propHeight","leftAddon","leftAddonType","leftAddonPosition","leftAddonClassName","leftAddonForceWrap","rightAddon","rightAddonType","rightAddonPosition","rightAddonClassName","rightAddonForceWrap","disableLeftAddonSpacing","disableLeftAddonCenteredMedia","disableRightAddonCenteredMedia","multiline","disabled","disabledOpacity","role","onBlur","onClick","onKeyDown","onKeyUp","onMouseDown","onMouseUp","onMouseLeave","onDragStart","onTouchStart","onTouchEnd","onTouchMove","tabIndex","propTabIndex","children","propChildren","presentational","remaining","pressedClassName","ripples","handlers","li","aria-disabled","undefined","clickable"],"mappings":"AAAA;;AACA,SAASA,UAAU,QAA6B,QAAQ;AACxD,SAASC,qBAAqB,QAAQ,0CAA0C;AAChF,SAASC,yBAAyB,QAAQ,8CAA8C;AACxF,SAASC,iBAAiB,QAAQ,yBAAyB;AAC3D,SAASC,gBAAgB,QAAQ,wBAAwB;AACzD,SAASC,QAAQ,QAAQ,sBAAsB;AAuE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgEC,GACD,OAAO,MAAMC,yBAAWN,WACtB,SAASM,SAASC,KAAK,EAAEC,GAAG;IAC1B,MAAM,EACJC,SAAS,EACTC,SAAS,EACTC,aAAa,EACbC,sBAAsB,EACtBC,WAAW,EACXC,aAAa,EACbC,kBAAkB,EAClBC,sBAAsB,KAAK,EAC3BC,QAAQC,UAAU,EAClBC,SAAS,EACTC,aAAa,EACbC,iBAAiB,EACjBC,kBAAkB,EAClBC,kBAAkB,EAClBC,UAAU,EACVC,cAAc,EACdC,kBAAkB,EAClBC,mBAAmB,EACnBC,mBAAmB,EACnBC,uBAAuB,EACvBC,6BAA6B,EAC7BC,8BAA8B,EAC9BC,YAAY,KAAK,EACjBC,WAAW,KAAK,EAChBC,kBAAkB,KAAK,EACvBC,OAAO,QAAQ,EACfC,MAAM,EACNC,OAAO,EACPC,SAAS,EACTC,OAAO,EACPC,WAAW,EACXC,SAAS,EACTC,YAAY,EACZC,WAAW,EACXC,YAAY,EACZC,UAAU,EACVC,WAAW,EACXC,UAAUC,YAAY,EACtBC,UAAUC,YAAY,EACtBC,iBAAiBhB,SAAS,cAAc,EACxC,GAAGiB,WACJ,GAAG7C;IAEJ,IAAIwC,WAAWC;IACf,IAAI,CAACG,kBAAkB,OAAOJ,aAAa,aAAa;QACtDA,WAAWd,WAAW,CAAC,IAAI;IAC7B;IAEA,MAAM,EAAEoB,gBAAgB,EAAEC,OAAO,EAAEC,QAAQ,EAAE,GAAGtD,sBAAsB;QACpEmC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAb,UAAUA,YAAYkB;IACxB;IACA,MAAMF,WAAW/C,0BACfgD,cACA,CAAClC;IAGH,MAAMC,SAASd,kBAAkB;QAC/Bc,QAAQC;QACRC;QACAC;QACAI;QACAC;QACAX;IACF;IAEA,qBACE,MAAC0C;QACE,GAAGJ,SAAS;QACZ,GAAGG,QAAQ;QACZE,iBAAexB,YAAYyB;QAC3BlD,KAAKA;QACL2B,MAAMA;QACNY,UAAUA;QACVtC,WAAWJ,SAAS;YAClBI;YACAQ;YACAgB;YACAC;YACAF;YACA2B,WAAW,CAACR;YACZE;QACF;;0BAEA,KAACjD;gBACC4B,WAAWA;gBACXrB,eAAeA;gBACfC,wBAAwBA;gBACxBI,qBAAqBA;gBACrBH,aAAaA;gBACbH,WAAWA;gBACXI,eAAeA;gBACfC,oBAAoBA;gBACpBI,WAAWA;gBACXC,eAAeA;gBACfC,mBAAmBA;gBACnBC,oBAAoBA;gBACpBC,oBAAoBA;gBACpBC,YAAYA;gBACZC,gBAAgBA;gBAChBC,oBAAoBA;gBACpBC,qBAAqBA;gBACrBC,qBAAqBA;gBACrBC,yBAAyBA;gBACzBC,+BAA+BA;gBAC/BC,gCAAgCA;0BAE/BkB;;YAEFK;;;AAGP,GACA"}
|
|
1
|
+
{"version":3,"sources":["../../src/list/ListItem.tsx"],"sourcesContent":["\"use client\";\nimport { forwardRef, type HTMLAttributes } from \"react\";\nimport { useElementInteraction } from \"../interaction/useElementInteraction.js\";\nimport { useHigherContrastChildren } from \"../interaction/useHigherContrastChildren.js\";\nimport { getListItemHeight } from \"./getListItemHeight.js\";\nimport { ListItemChildren } from \"./ListItemChildren.js\";\nimport { listItem } from \"./listItemStyles.js\";\nimport { type ListItemChildrenProps, type ListItemHeight } from \"./types.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-list-item-keyline\"?: string | number;\n \"--rmd-list-item-padding-h\"?: string | number;\n \"--rmd-list-item-padding-v\"?: string | number;\n \"--rmd-list-item-height\"?: string | number;\n \"--rmd-list-item-medium-height\"?: string | number;\n \"--rmd-list-item-large-height\"?: string | number;\n \"--rmd-list-item-extra-large-height\"?: string | number;\n \"--rmd-list-item-multiline-clamp\"?: string | number;\n \"--rmd-list-item-multiline-height\"?: string | number;\n \"--rmd-list-item-media-size\"?: string | number;\n \"--rmd-list-item-media-spacing\"?: string | number;\n \"--rmd-list-item-text-multiline-height\"?: string | number;\n }\n}\n\n/**\n * @remarks \\@since 6.0.0 Renamed `threeLines` to `multiline` since it can\n * support more than three lines of text.\n */\nexport interface ListItemProps\n extends HTMLAttributes<HTMLLIElement>,\n ListItemChildrenProps {\n /**\n * @defaultValue `\"button\"`\n */\n role?: HTMLAttributes<HTMLLIElement>[\"role\"];\n\n /**\n * @defaultValue `disabled ? -1 : 0`\n */\n tabIndex?: number;\n\n /**\n * @see {@link ListItemHeight}\n * @defaultValue `\"auto\"`\n */\n height?: ListItemHeight;\n\n /**\n * @defaultValue `false`\n */\n multiline?: boolean;\n\n /**\n * @defaultValue `false`\n */\n disabled?: boolean;\n\n /**\n * Note: This does nothing if the `disabled` prop is not enabled.\n *\n * @defaultValue `false`\n * @remarks \\@since 2.4.3\n */\n disabledOpacity?: boolean;\n\n /**\n * Set this to `false` if the list item should not gain the interaction\n * states: hover, focus, press, etc. This is kind of like being disabled\n * without the disabled styles being applied.\n *\n * @defaultValue `role === \"presentation\"`\n */\n presentational?: boolean;\n}\n\n/**\n * **Client Component**\n *\n * The `ListItem` is used to create a clickable/focusable button within a\n * `List` and removes the normal `<li>` styles.\n *\n * @example\n * Simple Example\n * ```tsx\n * import { List, ListItem } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <List>\n * <ListItem\n * onClick={() => {\n * // do something\n * }}\n * >\n * Item 1\n * </ListItem>\n * <ListItem\n * onClick={() => {\n * // do something\n * }}\n * secondaryText={<span>Some <strong>additional</strong> content.</span>}\n * >\n * Item 2\n * </ListItem>\n * </List>\n * );\n * );\n * }\n * ```\n *\n * @example\n * Applying Addons Example\n * ```tsx\n * import { List, ListItem } from \"@react-md/core\";\n * import FavoriteIcon from \"@react-md/material-icons/FavoriteIcon\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <List>\n * <ListItem leftAddon={<FavoriteIcon />}>\n * Item 1\n * </ListItem>\n * <ListItem rightAddon={<FavoriteIcon />}>\n * Item 2\n * </ListItem>\n * <ListItem\n * leftAddon={<FavoriteIcon />}\n * rightAddon={<img alt=\"\" src=\"/some-image.png\" />}\n * rightAddonType=\"media\"\n * >\n * Item 3\n * </ListItem>\n * </List>\n * );\n * );\n * }\n * ```\n */\nexport const ListItem = forwardRef<HTMLLIElement, ListItemProps>(\n function ListItem(props, ref) {\n const {\n className,\n textProps,\n textClassName,\n secondaryTextClassName,\n primaryText,\n secondaryText,\n secondaryTextProps,\n disableTextChildren = false,\n height: propHeight,\n leftAddon,\n leftAddonType,\n leftAddonPosition,\n leftAddonClassName,\n leftAddonForceWrap,\n rightAddon,\n rightAddonType,\n rightAddonPosition,\n rightAddonClassName,\n rightAddonForceWrap,\n disableLeftAddonSpacing,\n disableLeftAddonCenteredMedia,\n disableRightAddonCenteredMedia,\n multiline = false,\n disabled = false,\n disabledOpacity = false,\n role = \"button\",\n onBlur,\n onClick,\n onKeyDown,\n onKeyUp,\n onMouseDown,\n onMouseUp,\n onMouseLeave,\n onDragStart,\n onTouchStart,\n onTouchEnd,\n onTouchMove,\n tabIndex: propTabIndex,\n children: propChildren,\n presentational = role === \"presentation\",\n ...remaining\n } = props;\n\n let tabIndex = propTabIndex;\n if (!presentational && typeof tabIndex === \"undefined\") {\n tabIndex = disabled ? -1 : 0;\n }\n\n const { pressedClassName, ripples, handlers } = 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: disabled || presentational,\n });\n const children = useHigherContrastChildren(\n propChildren,\n !disableTextChildren\n );\n\n const height = getListItemHeight({\n height: propHeight,\n leftAddon,\n leftAddonType,\n rightAddon,\n rightAddonType,\n secondaryText,\n });\n\n return (\n <li\n {...remaining}\n {...handlers}\n aria-disabled={disabled || undefined}\n ref={ref}\n role={role}\n tabIndex={tabIndex}\n className={listItem({\n className,\n height,\n disabled,\n disabledOpacity,\n multiline,\n clickable: !presentational,\n pressedClassName,\n })}\n >\n <ListItemChildren\n multiline={multiline}\n textClassName={textClassName}\n secondaryTextClassName={secondaryTextClassName}\n disableTextChildren={disableTextChildren}\n primaryText={primaryText}\n textProps={textProps}\n secondaryText={secondaryText}\n secondaryTextProps={secondaryTextProps}\n leftAddon={leftAddon}\n leftAddonType={leftAddonType}\n leftAddonPosition={leftAddonPosition}\n leftAddonClassName={leftAddonClassName}\n leftAddonForceWrap={leftAddonForceWrap}\n rightAddon={rightAddon}\n rightAddonType={rightAddonType}\n rightAddonPosition={rightAddonPosition}\n rightAddonClassName={rightAddonClassName}\n rightAddonForceWrap={rightAddonForceWrap}\n disableLeftAddonSpacing={disableLeftAddonSpacing}\n disableLeftAddonCenteredMedia={disableLeftAddonCenteredMedia}\n disableRightAddonCenteredMedia={disableRightAddonCenteredMedia}\n >\n {children}\n </ListItemChildren>\n {ripples}\n </li>\n );\n }\n);\n"],"names":["forwardRef","useElementInteraction","useHigherContrastChildren","getListItemHeight","ListItemChildren","listItem","ListItem","props","ref","className","textProps","textClassName","secondaryTextClassName","primaryText","secondaryText","secondaryTextProps","disableTextChildren","height","propHeight","leftAddon","leftAddonType","leftAddonPosition","leftAddonClassName","leftAddonForceWrap","rightAddon","rightAddonType","rightAddonPosition","rightAddonClassName","rightAddonForceWrap","disableLeftAddonSpacing","disableLeftAddonCenteredMedia","disableRightAddonCenteredMedia","multiline","disabled","disabledOpacity","role","onBlur","onClick","onKeyDown","onKeyUp","onMouseDown","onMouseUp","onMouseLeave","onDragStart","onTouchStart","onTouchEnd","onTouchMove","tabIndex","propTabIndex","children","propChildren","presentational","remaining","pressedClassName","ripples","handlers","li","aria-disabled","undefined","clickable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AACA,SAASA,UAAU,QAA6B,QAAQ;AACxD,SAASC,qBAAqB,QAAQ,0CAA0C;AAChF,SAASC,yBAAyB,QAAQ,8CAA8C;AACxF,SAASC,iBAAiB,QAAQ,yBAAyB;AAC3D,SAASC,gBAAgB,QAAQ,wBAAwB;AACzD,SAASC,QAAQ,QAAQ,sBAAsB;AAuE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgEC,GACD,OAAO,MAAMC,yBAAWN,WACtB,SAASM,SAASC,KAAK,EAAEC,GAAG;IAC1B,MAAM,EACJC,SAAS,EACTC,SAAS,EACTC,aAAa,EACbC,sBAAsB,EACtBC,WAAW,EACXC,aAAa,EACbC,kBAAkB,EAClBC,sBAAsB,KAAK,EAC3BC,QAAQC,UAAU,EAClBC,SAAS,EACTC,aAAa,EACbC,iBAAiB,EACjBC,kBAAkB,EAClBC,kBAAkB,EAClBC,UAAU,EACVC,cAAc,EACdC,kBAAkB,EAClBC,mBAAmB,EACnBC,mBAAmB,EACnBC,uBAAuB,EACvBC,6BAA6B,EAC7BC,8BAA8B,EAC9BC,YAAY,KAAK,EACjBC,WAAW,KAAK,EAChBC,kBAAkB,KAAK,EACvBC,OAAO,QAAQ,EACfC,MAAM,EACNC,OAAO,EACPC,SAAS,EACTC,OAAO,EACPC,WAAW,EACXC,SAAS,EACTC,YAAY,EACZC,WAAW,EACXC,YAAY,EACZC,UAAU,EACVC,WAAW,EACXC,UAAUC,YAAY,EACtBC,UAAUC,YAAY,EACtBC,iBAAiBhB,SAAS,cAAc,EACxC,GAAGiB,WACJ,GAAG7C;IAEJ,IAAIwC,WAAWC;IACf,IAAI,CAACG,kBAAkB,OAAOJ,aAAa,aAAa;QACtDA,WAAWd,WAAW,CAAC,IAAI;IAC7B;IAEA,MAAM,EAAEoB,gBAAgB,EAAEC,OAAO,EAAEC,QAAQ,EAAE,GAAGtD,sBAAsB;QACpEmC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAb,UAAUA,YAAYkB;IACxB;IACA,MAAMF,WAAW/C,0BACfgD,cACA,CAAClC;IAGH,MAAMC,SAASd,kBAAkB;QAC/Bc,QAAQC;QACRC;QACAC;QACAI;QACAC;QACAX;IACF;IAEA,qBACE,MAAC0C;QACE,GAAGJ,SAAS;QACZ,GAAGG,QAAQ;QACZE,iBAAexB,YAAYyB;QAC3BlD,KAAKA;QACL2B,MAAMA;QACNY,UAAUA;QACVtC,WAAWJ,SAAS;YAClBI;YACAQ;YACAgB;YACAC;YACAF;YACA2B,WAAW,CAACR;YACZE;QACF;;0BAEA,KAACjD;gBACC4B,WAAWA;gBACXrB,eAAeA;gBACfC,wBAAwBA;gBACxBI,qBAAqBA;gBACrBH,aAAaA;gBACbH,WAAWA;gBACXI,eAAeA;gBACfC,oBAAoBA;gBACpBI,WAAWA;gBACXC,eAAeA;gBACfC,mBAAmBA;gBACnBC,oBAAoBA;gBACpBC,oBAAoBA;gBACpBC,YAAYA;gBACZC,gBAAgBA;gBAChBC,oBAAoBA;gBACpBC,qBAAqBA;gBACrBC,qBAAqBA;gBACrBC,yBAAyBA;gBACzBC,+BAA+BA;gBAC/BC,gCAAgCA;0BAE/BkB;;YAEFK;;;AAGP,GACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/list/ListItemAddon.tsx"],"sourcesContent":["import { type ReactElement, type ReactNode } from \"react\";\nimport {\n TextIconSpacing,\n type TextIconSpacingProps,\n} from \"../icon/TextIconSpacing.js\";\nimport {\n listItemAddon,\n type ListItemAddonClassNameOptions,\n} from \"./listItemStyles.js\";\n\nexport interface ListItemAddonProps\n extends Omit<TextIconSpacingProps, \"icon\" | \"iconAfter\" | \"forceIconWrap\">,\n ListItemAddonClassNameOptions {\n /**\n * The addon that should be rendered.\n */\n addon: ReactNode;\n\n /**\n * @defaultValue `type === \"media\" || type === \"large-media\"`\n */\n forceAddonWrap?: boolean;\n}\n\n/**\n * **Server Component**\n *\n * The `ListItemAddon` is used to create an addon to the left or right of the\n * text/children of a `ListItem`.\n *\n * @internal\n */\nexport function ListItemAddon(props: ListItemAddonProps): ReactElement {\n const {\n className,\n children,\n addon,\n addonAfter,\n type = \"icon\",\n position,\n forceAddonWrap,\n disableCenteredMedia,\n disableBeforeSpacing,\n ...remaining\n } = props;\n\n const isMedia = type === \"media\" || type === \"large-media\";\n\n return (\n <TextIconSpacing\n {...remaining}\n icon={addon}\n forceIconWrap={forceAddonWrap ?? isMedia}\n className={listItemAddon({\n type,\n position,\n className,\n addonAfter,\n disableBeforeSpacing,\n disableCenteredMedia,\n })}\n iconAfter={addonAfter}\n >\n {children}\n </TextIconSpacing>\n );\n}\n"],"names":["TextIconSpacing","listItemAddon","ListItemAddon","props","className","children","addon","addonAfter","type","position","forceAddonWrap","disableCenteredMedia","disableBeforeSpacing","remaining","isMedia","icon","forceIconWrap","iconAfter"],"mappings":";AACA,SACEA,eAAe,QAEV,6BAA6B;AACpC,SACEC,aAAa,QAER,sBAAsB;AAgB7B;;;;;;;CAOC,GACD,OAAO,SAASC,cAAcC,KAAyB;IACrD,MAAM,EACJC,SAAS,EACTC,QAAQ,EACRC,KAAK,EACLC,UAAU,EACVC,OAAO,MAAM,EACbC,QAAQ,EACRC,cAAc,EACdC,oBAAoB,EACpBC,oBAAoB,EACpB,GAAGC,WACJ,GAAGV;IAEJ,MAAMW,UAAUN,SAAS,WAAWA,SAAS;IAE7C,qBACE,KAACR;QACE,GAAGa,SAAS;QACbE,MAAMT;QACNU,eAAeN,kBAAkBI;QACjCV,WAAWH,cAAc;YACvBO;YACAC;YACAL;YACAG;YACAK;YACAD;QACF;QACAM,WAAWV;kBAEVF;;AAGP"}
|
|
1
|
+
{"version":3,"sources":["../../src/list/ListItemAddon.tsx"],"sourcesContent":["import { type ReactElement, type ReactNode } from \"react\";\nimport {\n TextIconSpacing,\n type TextIconSpacingProps,\n} from \"../icon/TextIconSpacing.js\";\nimport {\n listItemAddon,\n type ListItemAddonClassNameOptions,\n} from \"./listItemStyles.js\";\n\nexport interface ListItemAddonProps\n extends Omit<TextIconSpacingProps, \"icon\" | \"iconAfter\" | \"forceIconWrap\">,\n ListItemAddonClassNameOptions {\n /**\n * The addon that should be rendered.\n */\n addon: ReactNode;\n\n /**\n * @defaultValue `type === \"media\" || type === \"large-media\"`\n */\n forceAddonWrap?: boolean;\n}\n\n/**\n * **Server Component**\n *\n * The `ListItemAddon` is used to create an addon to the left or right of the\n * text/children of a `ListItem`.\n *\n * @internal\n */\nexport function ListItemAddon(props: ListItemAddonProps): ReactElement {\n const {\n className,\n children,\n addon,\n addonAfter,\n type = \"icon\",\n position,\n forceAddonWrap,\n disableCenteredMedia,\n disableBeforeSpacing,\n ...remaining\n } = props;\n\n const isMedia = type === \"media\" || type === \"large-media\";\n\n return (\n <TextIconSpacing\n {...remaining}\n icon={addon}\n forceIconWrap={forceAddonWrap ?? isMedia}\n className={listItemAddon({\n type,\n position,\n className,\n addonAfter,\n disableBeforeSpacing,\n disableCenteredMedia,\n })}\n iconAfter={addonAfter}\n >\n {children}\n </TextIconSpacing>\n );\n}\n"],"names":["TextIconSpacing","listItemAddon","ListItemAddon","props","className","children","addon","addonAfter","type","position","forceAddonWrap","disableCenteredMedia","disableBeforeSpacing","remaining","isMedia","icon","forceIconWrap","iconAfter"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AACA,SACEA,eAAe,QAEV,6BAA6B;AACpC,SACEC,aAAa,QAER,sBAAsB;AAgB7B;;;;;;;CAOC,GACD,OAAO,SAASC,cAAcC,KAAyB;IACrD,MAAM,EACJC,SAAS,EACTC,QAAQ,EACRC,KAAK,EACLC,UAAU,EACVC,OAAO,MAAM,EACbC,QAAQ,EACRC,cAAc,EACdC,oBAAoB,EACpBC,oBAAoB,EACpB,GAAGC,WACJ,GAAGV;IAEJ,MAAMW,UAAUN,SAAS,WAAWA,SAAS;IAE7C,qBACE,KAACR;QACE,GAAGa,SAAS;QACbE,MAAMT;QACNU,eAAeN,kBAAkBI;QACjCV,WAAWH,cAAc;YACvBO;YACAC;YACAL;YACAG;YACAK;YACAD;QACF;QACAM,WAAWV;kBAEVF;;AAGP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/list/ListItemChildren.tsx"],"sourcesContent":["import { type ReactElement } from \"react\";\nimport { ListItemAddon } from \"./ListItemAddon.js\";\nimport { ListItemText } from \"./ListItemText.js\";\nimport { type ListItemChildrenProps } from \"./types.js\";\n\n/**\n * **Server Component**\n *\n * The `ListItemChildren` component is used to create a styled list item that\n * can have optional addons to the left or right of the children in the form of\n * icons, avatars, or media. The `children` can be replaced by the `primaryText`\n * and `secondaryText` props to create stacked text spanning two or more lines\n * with the default behavior of using `line-clamp` at three lines.\n *\n * Note: This will return a `React.Fragment` of the children and does not wrap\n * in a DOM node for styling. The parent component should normally have\n * `display: flex` for the styling to work.\n *\n * @example\n * Custom Component Usage\n * ```tsx\n * import { ListItemChildren } from \"@react-md/core\";\n * import FavoriteIcon from \"@react-md/material-icons/FavoriteIcon\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <div style={{ display: \"flex\" }}>\n * <ListItemChildren\n * leftAddon={<FavoriteIcon />}\n * rightAddon={<img alt=\"\" src=\"/some-image.png\" />}\n * rightAddonType=\"media\"\n * secondaryText={<span>Some <strong>additional</strong> content.</span>}\n * >\n * Content\n * </ListItemChildren>\n * </div>\n * );\n * }\n * ```\n */\nexport function ListItemChildren(props: ListItemChildrenProps): ReactElement {\n const {\n multiline,\n textProps,\n textClassName,\n secondaryTextClassName,\n disableTextChildren,\n primaryText,\n secondaryText,\n secondaryTextProps,\n leftAddon,\n leftAddonType = \"icon\",\n leftAddonPosition = \"middle\",\n leftAddonClassName,\n leftAddonForceWrap,\n disableLeftAddonSpacing,\n disableLeftAddonCenteredMedia,\n rightAddon,\n rightAddonType = \"icon\",\n rightAddonPosition = \"middle\",\n rightAddonClassName,\n rightAddonForceWrap,\n disableRightAddonCenteredMedia,\n children: propChildren,\n } = props;\n\n const stringifiedChildren =\n typeof propChildren === \"number\" ? `${propChildren}` : propChildren;\n\n let children = stringifiedChildren;\n if (primaryText || secondaryText || !disableTextChildren) {\n children = (\n <ListItemText\n {...textProps}\n className={textClassName}\n secondaryText={secondaryText}\n secondaryTextProps={secondaryTextProps}\n secondaryTextClamped={multiline}\n secondaryTextClassName={secondaryTextClassName}\n >\n {(!disableTextChildren && children) || primaryText}\n </ListItemText>\n );\n }\n\n children = (\n <ListItemAddon\n addon={leftAddon}\n type={leftAddonType}\n position={leftAddonPosition}\n className={leftAddonClassName}\n forceAddonWrap={leftAddonForceWrap}\n disableBeforeSpacing={disableLeftAddonSpacing}\n disableCenteredMedia={disableLeftAddonCenteredMedia}\n >\n {children}\n </ListItemAddon>\n );\n children = (\n <ListItemAddon\n addon={rightAddon}\n addonAfter\n type={rightAddonType}\n position={rightAddonPosition}\n className={rightAddonClassName}\n forceAddonWrap={rightAddonForceWrap}\n disableCenteredMedia={disableRightAddonCenteredMedia}\n >\n {children}\n </ListItemAddon>\n );\n\n return (\n <>\n {children}\n {(primaryText && stringifiedChildren) || null}\n </>\n );\n}\n"],"names":["ListItemAddon","ListItemText","ListItemChildren","props","multiline","textProps","textClassName","secondaryTextClassName","disableTextChildren","primaryText","secondaryText","secondaryTextProps","leftAddon","leftAddonType","leftAddonPosition","leftAddonClassName","leftAddonForceWrap","disableLeftAddonSpacing","disableLeftAddonCenteredMedia","rightAddon","rightAddonType","rightAddonPosition","rightAddonClassName","rightAddonForceWrap","disableRightAddonCenteredMedia","children","propChildren","stringifiedChildren","className","secondaryTextClamped","addon","type","position","forceAddonWrap","disableBeforeSpacing","disableCenteredMedia","addonAfter"],"mappings":";AACA,SAASA,aAAa,QAAQ,qBAAqB;AACnD,SAASC,YAAY,QAAQ,oBAAoB;AAGjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCC,GACD,OAAO,SAASC,iBAAiBC,KAA4B;IAC3D,MAAM,EACJC,SAAS,EACTC,SAAS,EACTC,aAAa,EACbC,sBAAsB,EACtBC,mBAAmB,EACnBC,WAAW,EACXC,aAAa,EACbC,kBAAkB,EAClBC,SAAS,EACTC,gBAAgB,MAAM,EACtBC,oBAAoB,QAAQ,EAC5BC,kBAAkB,EAClBC,kBAAkB,EAClBC,uBAAuB,EACvBC,6BAA6B,EAC7BC,UAAU,EACVC,iBAAiB,MAAM,EACvBC,qBAAqB,QAAQ,EAC7BC,mBAAmB,EACnBC,mBAAmB,EACnBC,8BAA8B,EAC9BC,UAAUC,YAAY,EACvB,GAAGvB;IAEJ,MAAMwB,sBACJ,OAAOD,iBAAiB,WAAW,CAAC,EAAEA,aAAa,CAAC,GAAGA;IAEzD,IAAID,WAAWE;IACf,IAAIlB,eAAeC,iBAAiB,CAACF,qBAAqB;QACxDiB,yBACE,KAACxB;YACE,GAAGI,SAAS;YACbuB,WAAWtB;YACXI,eAAeA;YACfC,oBAAoBA;YACpBkB,sBAAsBzB;YACtBG,wBAAwBA;sBAEvB,AAAC,CAACC,uBAAuBiB,YAAahB;;IAG7C;IAEAgB,yBACE,KAACzB;QACC8B,OAAOlB;QACPmB,MAAMlB;QACNmB,UAAUlB;QACVc,WAAWb;QACXkB,gBAAgBjB;QAChBkB,sBAAsBjB;QACtBkB,sBAAsBjB;kBAErBO;;IAGLA,yBACE,KAACzB;QACC8B,OAAOX;QACPiB,UAAU;QACVL,MAAMX;QACNY,UAAUX;QACVO,WAAWN;QACXW,gBAAgBV;QAChBY,sBAAsBX;kBAErBC;;IAIL,qBACE;;YACGA;YACChB,eAAekB,uBAAwB;;;AAG/C"}
|
|
1
|
+
{"version":3,"sources":["../../src/list/ListItemChildren.tsx"],"sourcesContent":["import { type ReactElement } from \"react\";\nimport { ListItemAddon } from \"./ListItemAddon.js\";\nimport { ListItemText } from \"./ListItemText.js\";\nimport { type ListItemChildrenProps } from \"./types.js\";\n\n/**\n * **Server Component**\n *\n * The `ListItemChildren` component is used to create a styled list item that\n * can have optional addons to the left or right of the children in the form of\n * icons, avatars, or media. The `children` can be replaced by the `primaryText`\n * and `secondaryText` props to create stacked text spanning two or more lines\n * with the default behavior of using `line-clamp` at three lines.\n *\n * Note: This will return a `React.Fragment` of the children and does not wrap\n * in a DOM node for styling. The parent component should normally have\n * `display: flex` for the styling to work.\n *\n * @example\n * Custom Component Usage\n * ```tsx\n * import { ListItemChildren } from \"@react-md/core\";\n * import FavoriteIcon from \"@react-md/material-icons/FavoriteIcon\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <div style={{ display: \"flex\" }}>\n * <ListItemChildren\n * leftAddon={<FavoriteIcon />}\n * rightAddon={<img alt=\"\" src=\"/some-image.png\" />}\n * rightAddonType=\"media\"\n * secondaryText={<span>Some <strong>additional</strong> content.</span>}\n * >\n * Content\n * </ListItemChildren>\n * </div>\n * );\n * }\n * ```\n */\nexport function ListItemChildren(props: ListItemChildrenProps): ReactElement {\n const {\n multiline,\n textProps,\n textClassName,\n secondaryTextClassName,\n disableTextChildren,\n primaryText,\n secondaryText,\n secondaryTextProps,\n leftAddon,\n leftAddonType = \"icon\",\n leftAddonPosition = \"middle\",\n leftAddonClassName,\n leftAddonForceWrap,\n disableLeftAddonSpacing,\n disableLeftAddonCenteredMedia,\n rightAddon,\n rightAddonType = \"icon\",\n rightAddonPosition = \"middle\",\n rightAddonClassName,\n rightAddonForceWrap,\n disableRightAddonCenteredMedia,\n children: propChildren,\n } = props;\n\n const stringifiedChildren =\n typeof propChildren === \"number\" ? `${propChildren}` : propChildren;\n\n let children = stringifiedChildren;\n if (primaryText || secondaryText || !disableTextChildren) {\n children = (\n <ListItemText\n {...textProps}\n className={textClassName}\n secondaryText={secondaryText}\n secondaryTextProps={secondaryTextProps}\n secondaryTextClamped={multiline}\n secondaryTextClassName={secondaryTextClassName}\n >\n {(!disableTextChildren && children) || primaryText}\n </ListItemText>\n );\n }\n\n children = (\n <ListItemAddon\n addon={leftAddon}\n type={leftAddonType}\n position={leftAddonPosition}\n className={leftAddonClassName}\n forceAddonWrap={leftAddonForceWrap}\n disableBeforeSpacing={disableLeftAddonSpacing}\n disableCenteredMedia={disableLeftAddonCenteredMedia}\n >\n {children}\n </ListItemAddon>\n );\n children = (\n <ListItemAddon\n addon={rightAddon}\n addonAfter\n type={rightAddonType}\n position={rightAddonPosition}\n className={rightAddonClassName}\n forceAddonWrap={rightAddonForceWrap}\n disableCenteredMedia={disableRightAddonCenteredMedia}\n >\n {children}\n </ListItemAddon>\n );\n\n return (\n <>\n {children}\n {(primaryText && stringifiedChildren) || null}\n </>\n );\n}\n"],"names":["ListItemAddon","ListItemText","ListItemChildren","props","multiline","textProps","textClassName","secondaryTextClassName","disableTextChildren","primaryText","secondaryText","secondaryTextProps","leftAddon","leftAddonType","leftAddonPosition","leftAddonClassName","leftAddonForceWrap","disableLeftAddonSpacing","disableLeftAddonCenteredMedia","rightAddon","rightAddonType","rightAddonPosition","rightAddonClassName","rightAddonForceWrap","disableRightAddonCenteredMedia","children","propChildren","stringifiedChildren","className","secondaryTextClamped","addon","type","position","forceAddonWrap","disableBeforeSpacing","disableCenteredMedia","addonAfter"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AACA,SAASA,aAAa,QAAQ,qBAAqB;AACnD,SAASC,YAAY,QAAQ,oBAAoB;AAGjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCC,GACD,OAAO,SAASC,iBAAiBC,KAA4B;IAC3D,MAAM,EACJC,SAAS,EACTC,SAAS,EACTC,aAAa,EACbC,sBAAsB,EACtBC,mBAAmB,EACnBC,WAAW,EACXC,aAAa,EACbC,kBAAkB,EAClBC,SAAS,EACTC,gBAAgB,MAAM,EACtBC,oBAAoB,QAAQ,EAC5BC,kBAAkB,EAClBC,kBAAkB,EAClBC,uBAAuB,EACvBC,6BAA6B,EAC7BC,UAAU,EACVC,iBAAiB,MAAM,EACvBC,qBAAqB,QAAQ,EAC7BC,mBAAmB,EACnBC,mBAAmB,EACnBC,8BAA8B,EAC9BC,UAAUC,YAAY,EACvB,GAAGvB;IAEJ,MAAMwB,sBACJ,OAAOD,iBAAiB,WAAW,CAAC,EAAEA,aAAa,CAAC,GAAGA;IAEzD,IAAID,WAAWE;IACf,IAAIlB,eAAeC,iBAAiB,CAACF,qBAAqB;QACxDiB,yBACE,KAACxB;YACE,GAAGI,SAAS;YACbuB,WAAWtB;YACXI,eAAeA;YACfC,oBAAoBA;YACpBkB,sBAAsBzB;YACtBG,wBAAwBA;sBAEvB,AAAC,CAACC,uBAAuBiB,YAAahB;;IAG7C;IAEAgB,yBACE,KAACzB;QACC8B,OAAOlB;QACPmB,MAAMlB;QACNmB,UAAUlB;QACVc,WAAWb;QACXkB,gBAAgBjB;QAChBkB,sBAAsBjB;QACtBkB,sBAAsBjB;kBAErBO;;IAGLA,yBACE,KAACzB;QACC8B,OAAOX;QACPiB,UAAU;QACVL,MAAMX;QACNY,UAAUX;QACVO,WAAWN;QACXW,gBAAgBV;QAChBY,sBAAsBX;kBAErBC;;IAIL,qBACE;;YACGA;YACChB,eAAekB,uBAAwB;;;AAG/C"}
|