@prokodo/ui 0.0.26 → 0.0.28
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/README.md +89 -45
- package/dist/_virtual/_commonjsHelpers.js +6 -3
- package/dist/_virtual/index.js +5 -5
- package/dist/_virtual/index2.js +2 -2
- package/dist/_virtual/index3.js +2 -2
- package/dist/_virtual/react-is.development.js +2 -2
- package/dist/_virtual/react-is.production.min.js +2 -2
- package/dist/assets/images/card_background_primary_1.webp.js +2 -2
- package/dist/assets/images/card_background_primary_2.webp.js +2 -2
- package/dist/assets/images/card_background_primary_3.webp.js +2 -2
- package/dist/assets/images/card_background_primary_4.webp.js +2 -2
- package/dist/assets/images/card_background_secondary_1.webp.js +2 -2
- package/dist/assets/images/card_background_secondary_2.webp.js +2 -2
- package/dist/assets/images/card_background_secondary_3.webp.js +2 -2
- package/dist/assets/images/card_background_secondary_4.webp.js +2 -2
- package/dist/components/accordion/Accordion.js +82 -74
- package/dist/components/accordion/Accordion.module.scss.js +11 -8
- package/dist/components/accordion/index.js +2 -2
- package/dist/components/animated/Animated.js +61 -40
- package/dist/components/animated/Animated.module.scss.js +8 -6
- package/dist/components/animated/index.js +2 -2
- package/dist/components/animatedText/AnimatedText.js +36 -27
- package/dist/components/animatedText/index.js +2 -2
- package/dist/components/avatar/Avatar.js +62 -54
- package/dist/components/avatar/Avatar.module.scss.js +8 -6
- package/dist/components/avatar/index.js +2 -2
- package/dist/components/base-link/BaseLink.js +39 -27
- package/dist/components/base-link/index.js +2 -2
- package/dist/components/button/Button.client.js +100 -0
- package/dist/components/button/Button.js +15 -82
- package/dist/components/button/Button.lazy.js +20 -0
- package/dist/components/button/Button.module.scss.js +8 -6
- package/dist/components/button/Button.server.js +77 -0
- package/dist/components/button/index.js +2 -2
- package/dist/components/calendly/Calendly.js +99 -60
- package/dist/components/calendly/index.js +2 -2
- package/dist/components/card/Card.js +167 -141
- package/dist/components/card/Card.module.scss.js +11 -8
- package/dist/components/card/index.js +2 -2
- package/dist/components/carousel/Carousel.js +209 -145
- package/dist/components/carousel/Carousel.module.scss.js +8 -6
- package/dist/components/carousel/Carousel.services.js +39 -20
- package/dist/components/carousel/index.js +2 -2
- package/dist/components/chip/Chip.js +44 -36
- package/dist/components/chip/Chip.module.scss.js +8 -6
- package/dist/components/chip/index.js +2 -2
- package/dist/components/datePicker/DatePicker.js +106 -69
- package/dist/components/datePicker/index.js +2 -2
- package/dist/components/dialog/Dialog.js +106 -93
- package/dist/components/dialog/Dialog.module.scss.js +8 -6
- package/dist/components/dialog/index.js +2 -2
- package/dist/components/drawer/Drawer.js +78 -64
- package/dist/components/drawer/Drawer.module.scss.js +20 -14
- package/dist/components/drawer/index.js +4 -4
- package/dist/components/form/Form.js +229 -165
- package/dist/components/form/Form.module.scss.js +8 -6
- package/dist/components/form/FormField.js +63 -60
- package/dist/components/form/FormField.module.scss.js +8 -6
- package/dist/components/form/FormResponse.js +37 -41
- package/dist/components/form/FormResponse.module.scss.js +8 -6
- package/dist/components/form/index.js +4 -4
- package/dist/components/grid/Grid.js +14 -11
- package/dist/components/grid/Grid.module.scss.js +8 -6
- package/dist/components/grid/GridRow.js +20 -17
- package/dist/components/grid/GridRow.module.scss.js +8 -6
- package/dist/components/grid/index.js +4 -4
- package/dist/components/headline/Headline.client.js +85 -0
- package/dist/components/headline/Headline.module.scss.js +8 -6
- package/dist/components/headline/Headline.server.js +73 -0
- package/dist/components/headline/Headline.variants.js +9 -0
- package/dist/components/headline/index.js +4 -3
- package/dist/components/icon/Icon.js +27 -22
- package/dist/components/icon/Icon.module.scss.js +8 -6
- package/dist/components/icon/index.js +3 -3
- package/dist/components/image/Image.js +30 -24
- package/dist/components/image/Image.module.scss.js +8 -6
- package/dist/components/image/index.js +2 -2
- package/dist/components/image-text/ImageText.js +80 -81
- package/dist/components/image-text/ImageText.module.scss.js +8 -6
- package/dist/components/image-text/index.js +2 -2
- package/dist/components/input/Input.js +147 -131
- package/dist/components/input/Input.module.scss.js +11 -8
- package/dist/components/input/InputValidation.js +50 -31
- package/dist/components/input/index.js +2 -2
- package/dist/components/inputOTP/InputOTP.js +90 -57
- package/dist/components/inputOTP/InputOTP.module.scss.js +8 -6
- package/dist/components/inputOTP/index.js +2 -2
- package/dist/components/label/Label.js +64 -63
- package/dist/components/label/Label.module.scss.js +8 -6
- package/dist/components/label/index.js +2 -2
- package/dist/components/link/Link.js +53 -48
- package/dist/components/link/Link.module.scss.js +8 -6
- package/dist/components/link/index.js +2 -2
- package/dist/components/list/List.js +120 -104
- package/dist/components/list/List.module.scss.js +8 -6
- package/dist/components/list/index.js +2 -2
- package/dist/components/loading/Loading.js +21 -20
- package/dist/components/loading/Loading.module.scss.js +11 -8
- package/dist/components/loading/index.js +2 -2
- package/dist/components/lottie/Lottie.js +47 -37
- package/dist/components/lottie/Lottie.module.scss.js +8 -6
- package/dist/components/lottie/LottieAnimations.js +2 -2
- package/dist/components/lottie/index.js +2 -2
- package/dist/components/map/Map.js +59 -42
- package/dist/components/map/index.js +2 -2
- package/dist/components/post-item/PostItem.js +81 -76
- package/dist/components/post-item/PostItem.module.scss.js +8 -6
- package/dist/components/post-item/PostItemAuthor.js +24 -23
- package/dist/components/post-item/PostItemAuthor.module.scss.js +8 -6
- package/dist/components/post-item/index.js +4 -4
- package/dist/components/post-teaser/PostTeaser.js +96 -92
- package/dist/components/post-teaser/PostTeaser.module.scss.js +8 -6
- package/dist/components/post-teaser/index.js +2 -2
- package/dist/components/post-widget/PostWidget.js +81 -80
- package/dist/components/post-widget/PostWidget.module.scss.js +8 -6
- package/dist/components/post-widget/index.js +2 -2
- package/dist/components/post-widget-carousel/PostWidgetCarousel.js +96 -90
- package/dist/components/post-widget-carousel/PostWidgetCarousel.module.scss.js +8 -6
- package/dist/components/post-widget-carousel/index.js +2 -2
- package/dist/components/quote/Quote.js +48 -47
- package/dist/components/quote/Quote.module.scss.js +8 -6
- package/dist/components/quote/index.js +2 -2
- package/dist/components/rich-text/RichText.js +114 -100
- package/dist/components/rich-text/RichText.module.scss.js +8 -6
- package/dist/components/rich-text/index.js +2 -2
- package/dist/components/select/Select.js +148 -127
- package/dist/components/select/Select.module.scss.js +17 -12
- package/dist/components/select/index.js +2 -2
- package/dist/components/skeleton/Skeleton.js +21 -18
- package/dist/components/skeleton/Skeleton.module.scss.js +8 -6
- package/dist/components/skeleton/index.js +2 -2
- package/dist/components/slider/Slider.js +74 -65
- package/dist/components/slider/Slider.module.scss.js +8 -6
- package/dist/components/slider/index.js +2 -2
- package/dist/components/stepper/Stepper.js +85 -69
- package/dist/components/stepper/Stepper.module.scss.js +8 -6
- package/dist/components/stepper/index.js +2 -2
- package/dist/components/switch/Switch.js +69 -63
- package/dist/components/switch/Switch.module.scss.js +8 -6
- package/dist/components/switch/index.js +2 -2
- package/dist/components/table/Table.js +48 -45
- package/dist/components/table/Table.module.scss.js +8 -6
- package/dist/components/table/index.js +2 -2
- package/dist/components/teaser/Teaser.js +66 -65
- package/dist/components/teaser/Teaser.module.scss.js +8 -6
- package/dist/components/teaser/index.js +2 -2
- package/dist/constants/project.js +2 -2
- package/dist/helpers/bem.js +17 -9
- package/dist/helpers/calculation.js +4 -2
- package/dist/helpers/validations.js +12 -6
- package/dist/hooks/useGoogleMaps.js +19 -14
- package/dist/hooks/useHydrationReady.js +26 -0
- package/dist/index.js +84 -84
- package/dist/node_modules/.pnpm/@floating-ui_core@1.7.0/node_modules/@floating-ui/core/dist/floating-ui.core.js +354 -251
- package/dist/node_modules/.pnpm/@floating-ui_dom@1.7.0/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +555 -309
- package/dist/node_modules/.pnpm/@floating-ui_react-dom@2.1.2_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +221 -141
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.9/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +167 -109
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.9/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +130 -88
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/Option/Option.js +91 -77
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/Option/optionClasses.js +10 -7
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/Portal/Portal.js +54 -40
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/Select/Select.js +192 -163
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/Select/selectClasses.js +10 -7
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/Slider/Slider.js +287 -242
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/Slider/sliderClasses.js +10 -7
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/Switch/Switch.js +112 -97
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/Switch/switchClasses.js +10 -7
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/Unstable_Popup/Popup.js +135 -115
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/Unstable_Popup/PopupContext.js +6 -4
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/Unstable_Popup/popupClasses.js +10 -7
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/generateUtilityClass/index.js +15 -10
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/generateUtilityClasses/index.js +11 -7
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/useButton/useButton.js +160 -73
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/useCompound/useCompoundItem.js +25 -18
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/useCompound/useCompoundParent.js +63 -36
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/useList/ListContext.js +6 -4
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/useList/listActions.types.js +2 -2
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/useList/listReducer.js +233 -138
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/useList/useList.js +189 -128
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/useList/useListItem.js +72 -52
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/useOption/useOption.js +72 -53
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/useOption/useOptionContextStabilizer.js +30 -22
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/useSelect/SelectProvider.js +34 -28
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/useSelect/defaultOptionStringifier.js +15 -7
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/useSelect/selectReducer.js +49 -40
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/useSelect/useSelect.js +341 -222
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/useSelect/useSelect.types.js +2 -2
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/useSlider/useSlider.js +550 -353
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/useSwitch/useSwitch.js +79 -50
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/useTransition/TransitionContext.js +6 -4
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/useTransition/useTransitionTrigger.js +51 -23
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/utils/ClassNameConfigurator.js +21 -10
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/utils/areArraysEqual.js +6 -3
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/utils/combineHooksSlotProps.js +14 -10
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/utils/isHostComponent.js +6 -3
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/utils/resolveComponentProps.js +9 -3
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/utils/useControllableReducer.js +91 -60
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/utils/useRootElementName.js +20 -12
- package/dist/node_modules/.pnpm/@mui_base@5.0.0-beta.58_@types_react@19.1.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@mui/base/utils/useTextNavigation.js +21 -10
- package/dist/node_modules/.pnpm/@mui_utils@6.0.0-rc.0_@types_react@19.1.0_react@19.1.0/node_modules/@mui/utils/esm/HTMLElementType/HTMLElementType.js +16 -5
- package/dist/node_modules/.pnpm/@mui_utils@6.0.0-rc.0_@types_react@19.1.0_react@19.1.0/node_modules/@mui/utils/esm/appendOwnerState/appendOwnerState.js +13 -7
- package/dist/node_modules/.pnpm/@mui_utils@6.0.0-rc.0_@types_react@19.1.0_react@19.1.0/node_modules/@mui/utils/esm/chainPropTypes/chainPropTypes.js +11 -5
- package/dist/node_modules/.pnpm/@mui_utils@6.0.0-rc.0_@types_react@19.1.0_react@19.1.0/node_modules/@mui/utils/esm/clamp/clamp.js +6 -3
- package/dist/node_modules/.pnpm/@mui_utils@6.0.0-rc.0_@types_react@19.1.0_react@19.1.0/node_modules/@mui/utils/esm/composeClasses/composeClasses.js +19 -11
- package/dist/node_modules/.pnpm/@mui_utils@6.0.0-rc.0_@types_react@19.1.0_react@19.1.0/node_modules/@mui/utils/esm/exactProp/exactProp.js +17 -8
- package/dist/node_modules/.pnpm/@mui_utils@6.0.0-rc.0_@types_react@19.1.0_react@19.1.0/node_modules/@mui/utils/esm/extractEventHandlers/extractEventHandlers.js +12 -7
- package/dist/node_modules/.pnpm/@mui_utils@6.0.0-rc.0_@types_react@19.1.0_react@19.1.0/node_modules/@mui/utils/esm/generateUtilityClass/generateUtilityClass.js +2 -2
- package/dist/node_modules/.pnpm/@mui_utils@6.0.0-rc.0_@types_react@19.1.0_react@19.1.0/node_modules/@mui/utils/esm/getReactNodeRef/getReactNodeRef.js +11 -5
- package/dist/node_modules/.pnpm/@mui_utils@6.0.0-rc.0_@types_react@19.1.0_react@19.1.0/node_modules/@mui/utils/esm/isFocusVisible/isFocusVisible.js +11 -7
- package/dist/node_modules/.pnpm/@mui_utils@6.0.0-rc.0_@types_react@19.1.0_react@19.1.0/node_modules/@mui/utils/esm/isHostComponent/isHostComponent.js +6 -3
- package/dist/node_modules/.pnpm/@mui_utils@6.0.0-rc.0_@types_react@19.1.0_react@19.1.0/node_modules/@mui/utils/esm/mergeSlotProps/mergeSlotProps.js +61 -38
- package/dist/node_modules/.pnpm/@mui_utils@6.0.0-rc.0_@types_react@19.1.0_react@19.1.0/node_modules/@mui/utils/esm/omitEventHandlers/omitEventHandlers.js +12 -7
- package/dist/node_modules/.pnpm/@mui_utils@6.0.0-rc.0_@types_react@19.1.0_react@19.1.0/node_modules/@mui/utils/esm/ownerDocument/ownerDocument.js +6 -3
- package/dist/node_modules/.pnpm/@mui_utils@6.0.0-rc.0_@types_react@19.1.0_react@19.1.0/node_modules/@mui/utils/esm/resolveComponentProps/resolveComponentProps.js +9 -3
- package/dist/node_modules/.pnpm/@mui_utils@6.0.0-rc.0_@types_react@19.1.0_react@19.1.0/node_modules/@mui/utils/esm/setRef/setRef.js +10 -3
- package/dist/node_modules/.pnpm/@mui_utils@6.0.0-rc.0_@types_react@19.1.0_react@19.1.0/node_modules/@mui/utils/esm/useControlled/useControlled.js +31 -22
- package/dist/node_modules/.pnpm/@mui_utils@6.0.0-rc.0_@types_react@19.1.0_react@19.1.0/node_modules/@mui/utils/esm/useEnhancedEffect/useEnhancedEffect.js +3 -3
- package/dist/node_modules/.pnpm/@mui_utils@6.0.0-rc.0_@types_react@19.1.0_react@19.1.0/node_modules/@mui/utils/esm/useEventCallback/useEventCallback.js +13 -9
- package/dist/node_modules/.pnpm/@mui_utils@6.0.0-rc.0_@types_react@19.1.0_react@19.1.0/node_modules/@mui/utils/esm/useForkRef/useForkRef.js +17 -9
- package/dist/node_modules/.pnpm/@mui_utils@6.0.0-rc.0_@types_react@19.1.0_react@19.1.0/node_modules/@mui/utils/esm/useId/useId.js +23 -14
- package/dist/node_modules/.pnpm/@mui_utils@6.0.0-rc.0_@types_react@19.1.0_react@19.1.0/node_modules/@mui/utils/esm/useSlotProps/useSlotProps.js +30 -23
- package/dist/node_modules/.pnpm/@mui_utils@6.0.0-rc.0_@types_react@19.1.0_react@19.1.0/node_modules/@mui/utils/esm/visuallyHidden/visuallyHidden.js +2 -2
- package/dist/node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js +17 -13
- package/dist/node_modules/.pnpm/object-assign@4.1.1/node_modules/object-assign/index.js +67 -38
- package/dist/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/checkPropTypes.js +55 -37
- package/dist/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/factoryWithThrowingShims.js +56 -43
- package/dist/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/factoryWithTypeCheckers.js +404 -243
- package/dist/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js +20 -14
- package/dist/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/lib/ReactPropTypesSecret.js +12 -7
- package/dist/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/lib/has.js +11 -4
- package/dist/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.development.js +170 -82
- package/dist/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.production.min.js +91 -58
- package/dist/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/index.js +17 -7
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/components/button/Button.client.d.ts +3 -0
- package/dist/types/components/button/Button.d.ts +3 -3
- package/dist/types/components/button/Button.lazy.d.ts +3 -0
- package/dist/types/components/button/Button.server.d.ts +3 -0
- package/dist/types/components/button/index.d.ts +1 -1
- package/dist/types/components/form/FormResponse.d.ts +1 -1
- package/dist/types/components/headline/Headline.client.d.ts +3 -0
- package/dist/types/components/headline/Headline.model.d.ts +1 -0
- package/dist/types/components/headline/Headline.server.d.ts +3 -0
- package/dist/types/components/headline/Headline.variants.d.ts +2 -0
- package/dist/types/components/headline/index.d.ts +2 -1
- package/dist/types/components/label/Label.d.ts +1 -1
- package/dist/types/hooks/useHydrationReady.d.ts +5 -0
- package/dist/ui.css +9592 -1
- package/package.json +1 -1
- package/dist/components/headline/Headline.js +0 -71
- package/dist/types/components/headline/Headline.d.ts +0 -4
|
@@ -1,150 +1,211 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { ListActionTypes } from "./listActions.types.js";
|
|
5
|
+
import { listReducer } from "./listReducer.js";
|
|
6
|
+
import { useControllableReducer } from "../utils/useControllableReducer.js";
|
|
7
|
+
import { areArraysEqual } from "../utils/areArraysEqual.js";
|
|
8
|
+
import { useTextNavigation } from "../utils/useTextNavigation.js";
|
|
9
|
+
import useForkRef from "../../../../../@mui_utils@6.0.0-rc.0_@types_react@19.1.0_react@19.1.0/node_modules/@mui/utils/esm/useForkRef/useForkRef.js";
|
|
10
|
+
import extractEventHandlers from "../../../../../@mui_utils@6.0.0-rc.0_@types_react@19.1.0_react@19.1.0/node_modules/@mui/utils/esm/extractEventHandlers/extractEventHandlers.js";
|
|
11
|
+
const EMPTY_OBJECT = {};
|
|
12
|
+
const NOOP = /* @__PURE__ */ __name(() => {
|
|
13
|
+
}, "NOOP");
|
|
14
|
+
const defaultItemComparer = /* @__PURE__ */ __name((optionA, optionB) => optionA === optionB, "defaultItemComparer");
|
|
15
|
+
const defaultIsItemDisabled = /* @__PURE__ */ __name(() => false, "defaultIsItemDisabled");
|
|
16
|
+
const defaultItemStringifier = /* @__PURE__ */ __name((item) => typeof item === "string" ? item : String(item), "defaultItemStringifier");
|
|
17
|
+
const defaultGetInitialState = /* @__PURE__ */ __name(() => ({
|
|
11
18
|
highlightedValue: null,
|
|
12
19
|
selectedValues: []
|
|
13
|
-
});
|
|
14
|
-
function
|
|
20
|
+
}), "defaultGetInitialState");
|
|
21
|
+
function useList(params) {
|
|
15
22
|
const {
|
|
16
|
-
controlledProps
|
|
17
|
-
disabledItemsFocusable
|
|
18
|
-
disableListWrap
|
|
19
|
-
focusManagement
|
|
20
|
-
getInitialState
|
|
21
|
-
getItemDomElement
|
|
22
|
-
getItemId
|
|
23
|
-
isItemDisabled
|
|
24
|
-
rootRef:
|
|
25
|
-
onStateChange
|
|
26
|
-
items
|
|
27
|
-
itemComparer
|
|
28
|
-
getItemAsString
|
|
29
|
-
onChange
|
|
30
|
-
onHighlightChange
|
|
31
|
-
onItemsChange
|
|
32
|
-
orientation
|
|
33
|
-
pageSize
|
|
34
|
-
reducerActionContext
|
|
35
|
-
selectionMode
|
|
36
|
-
stateReducer:
|
|
37
|
-
componentName
|
|
38
|
-
} =
|
|
23
|
+
controlledProps = EMPTY_OBJECT,
|
|
24
|
+
disabledItemsFocusable = false,
|
|
25
|
+
disableListWrap = false,
|
|
26
|
+
focusManagement = "activeDescendant",
|
|
27
|
+
getInitialState = defaultGetInitialState,
|
|
28
|
+
getItemDomElement,
|
|
29
|
+
getItemId,
|
|
30
|
+
isItemDisabled = defaultIsItemDisabled,
|
|
31
|
+
rootRef: externalListRef,
|
|
32
|
+
onStateChange = NOOP,
|
|
33
|
+
items,
|
|
34
|
+
itemComparer = defaultItemComparer,
|
|
35
|
+
getItemAsString = defaultItemStringifier,
|
|
36
|
+
onChange,
|
|
37
|
+
onHighlightChange,
|
|
38
|
+
onItemsChange,
|
|
39
|
+
orientation = "vertical",
|
|
40
|
+
pageSize = 5,
|
|
41
|
+
reducerActionContext = EMPTY_OBJECT,
|
|
42
|
+
selectionMode = "single",
|
|
43
|
+
stateReducer: externalReducer,
|
|
44
|
+
componentName = "useList"
|
|
45
|
+
} = params;
|
|
39
46
|
if (process.env.NODE_ENV !== "production") {
|
|
40
|
-
if (
|
|
47
|
+
if (focusManagement === "DOM" && getItemDomElement == null) {
|
|
41
48
|
throw new Error("useList: The `getItemDomElement` prop is required when using the `DOM` focus management.");
|
|
42
|
-
|
|
49
|
+
}
|
|
50
|
+
if (focusManagement === "activeDescendant" && getItemId == null) {
|
|
43
51
|
throw new Error("useList: The `getItemId` prop is required when using the `activeDescendant` focus management.");
|
|
52
|
+
}
|
|
44
53
|
}
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
54
|
+
const listRef = React.useRef(null);
|
|
55
|
+
const handleRef = useForkRef(externalListRef, listRef);
|
|
56
|
+
const handleHighlightChange = React.useCallback((event, value, reason) => {
|
|
57
|
+
var _a;
|
|
58
|
+
onHighlightChange == null ? void 0 : onHighlightChange(event, value, reason);
|
|
59
|
+
if (focusManagement === "DOM" && value != null && (reason === ListActionTypes.itemClick || reason === ListActionTypes.keyDown || reason === ListActionTypes.textNavigation)) {
|
|
60
|
+
(_a = getItemDomElement == null ? void 0 : getItemDomElement(value)) == null ? void 0 : _a.focus();
|
|
61
|
+
}
|
|
62
|
+
}, [getItemDomElement, onHighlightChange, focusManagement]);
|
|
63
|
+
const stateComparers = React.useMemo(() => ({
|
|
64
|
+
highlightedValue: itemComparer,
|
|
65
|
+
selectedValues: /* @__PURE__ */ __name((valuesArray1, valuesArray2) => areArraysEqual(valuesArray1, valuesArray2, itemComparer), "selectedValues")
|
|
66
|
+
}), [itemComparer]);
|
|
67
|
+
const handleStateChange = React.useCallback((event, field, value, reason, state2) => {
|
|
68
|
+
onStateChange == null ? void 0 : onStateChange(event, field, value, reason, state2);
|
|
69
|
+
switch (field) {
|
|
53
70
|
case "highlightedValue":
|
|
54
|
-
|
|
71
|
+
handleHighlightChange(event, value, reason);
|
|
55
72
|
break;
|
|
56
73
|
case "selectedValues":
|
|
57
|
-
|
|
74
|
+
onChange == null ? void 0 : onChange(event, value, reason);
|
|
58
75
|
break;
|
|
59
76
|
}
|
|
60
|
-
}, [
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
})
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
77
|
+
}, [handleHighlightChange, onChange, onStateChange]);
|
|
78
|
+
const listActionContext = React.useMemo(() => {
|
|
79
|
+
return {
|
|
80
|
+
disabledItemsFocusable,
|
|
81
|
+
disableListWrap,
|
|
82
|
+
focusManagement,
|
|
83
|
+
isItemDisabled,
|
|
84
|
+
itemComparer,
|
|
85
|
+
items,
|
|
86
|
+
getItemAsString,
|
|
87
|
+
onHighlightChange: handleHighlightChange,
|
|
88
|
+
orientation,
|
|
89
|
+
pageSize,
|
|
90
|
+
selectionMode,
|
|
91
|
+
stateComparers
|
|
92
|
+
};
|
|
93
|
+
}, [disabledItemsFocusable, disableListWrap, focusManagement, isItemDisabled, itemComparer, items, getItemAsString, handleHighlightChange, orientation, pageSize, selectionMode, stateComparers]);
|
|
94
|
+
const initialState = getInitialState();
|
|
95
|
+
const reducer = externalReducer ?? listReducer;
|
|
96
|
+
const actionContext = React.useMemo(() => ({
|
|
97
|
+
...reducerActionContext,
|
|
98
|
+
...listActionContext
|
|
99
|
+
}), [reducerActionContext, listActionContext]);
|
|
100
|
+
const [state, dispatch] = useControllableReducer({
|
|
101
|
+
reducer,
|
|
102
|
+
actionContext,
|
|
103
|
+
initialState,
|
|
104
|
+
controlledProps,
|
|
105
|
+
stateComparers,
|
|
106
|
+
onStateChange: handleStateChange,
|
|
107
|
+
componentName
|
|
108
|
+
});
|
|
109
|
+
const {
|
|
110
|
+
highlightedValue,
|
|
111
|
+
selectedValues
|
|
112
|
+
} = state;
|
|
113
|
+
const handleTextNavigation = useTextNavigation((searchString, event) => dispatch({
|
|
114
|
+
type: ListActionTypes.textNavigation,
|
|
115
|
+
event,
|
|
116
|
+
searchString
|
|
117
|
+
}));
|
|
118
|
+
const previousItems = React.useRef([]);
|
|
119
|
+
React.useEffect(() => {
|
|
120
|
+
if (areArraysEqual(previousItems.current, items, itemComparer)) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
dispatch({
|
|
124
|
+
type: ListActionTypes.itemsChange,
|
|
95
125
|
event: null,
|
|
96
|
-
items
|
|
97
|
-
previousItems:
|
|
98
|
-
})
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
126
|
+
items,
|
|
127
|
+
previousItems: previousItems.current
|
|
128
|
+
});
|
|
129
|
+
previousItems.current = items;
|
|
130
|
+
onItemsChange == null ? void 0 : onItemsChange(items);
|
|
131
|
+
}, [items, itemComparer, dispatch, onItemsChange]);
|
|
132
|
+
const createHandleKeyDown = /* @__PURE__ */ __name((externalHandlers) => (event) => {
|
|
133
|
+
var _a;
|
|
134
|
+
(_a = externalHandlers.onKeyDown) == null ? void 0 : _a.call(externalHandlers, event);
|
|
135
|
+
if (event.defaultMuiPrevented) {
|
|
103
136
|
return;
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
137
|
+
}
|
|
138
|
+
const keysToPreventDefault = ["Home", "End", "PageUp", "PageDown"];
|
|
139
|
+
if (orientation === "vertical") {
|
|
140
|
+
keysToPreventDefault.push("ArrowUp", "ArrowDown");
|
|
141
|
+
} else {
|
|
142
|
+
keysToPreventDefault.push("ArrowLeft", "ArrowRight");
|
|
143
|
+
}
|
|
144
|
+
if (focusManagement === "activeDescendant") {
|
|
145
|
+
keysToPreventDefault.push(" ", "Enter");
|
|
146
|
+
}
|
|
147
|
+
if (keysToPreventDefault.includes(event.key)) {
|
|
148
|
+
event.preventDefault();
|
|
149
|
+
}
|
|
150
|
+
dispatch({
|
|
151
|
+
type: ListActionTypes.keyDown,
|
|
152
|
+
key: event.key,
|
|
153
|
+
event
|
|
154
|
+
});
|
|
155
|
+
handleTextNavigation(event);
|
|
156
|
+
}, "createHandleKeyDown");
|
|
157
|
+
const createHandleBlur = /* @__PURE__ */ __name((externalHandlers) => (event) => {
|
|
158
|
+
var _a, _b;
|
|
159
|
+
(_a = externalHandlers.onBlur) == null ? void 0 : _a.call(externalHandlers, event);
|
|
160
|
+
if (event.defaultMuiPrevented) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
if ((_b = listRef.current) == null ? void 0 : _b.contains(event.relatedTarget)) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
dispatch({
|
|
167
|
+
type: ListActionTypes.blur,
|
|
168
|
+
event
|
|
169
|
+
});
|
|
170
|
+
}, "createHandleBlur");
|
|
171
|
+
const getRootProps = /* @__PURE__ */ __name((externalProps = {}) => {
|
|
172
|
+
const externalEventHandlers = extractEventHandlers(externalProps);
|
|
118
173
|
return {
|
|
119
|
-
...
|
|
120
|
-
"aria-activedescendant":
|
|
121
|
-
tabIndex:
|
|
122
|
-
ref:
|
|
123
|
-
...
|
|
124
|
-
onBlur:
|
|
125
|
-
onKeyDown:
|
|
174
|
+
...externalProps,
|
|
175
|
+
"aria-activedescendant": focusManagement === "activeDescendant" && highlightedValue != null ? getItemId(highlightedValue) : void 0,
|
|
176
|
+
tabIndex: focusManagement === "DOM" ? -1 : 0,
|
|
177
|
+
ref: handleRef,
|
|
178
|
+
...externalEventHandlers,
|
|
179
|
+
onBlur: createHandleBlur(externalEventHandlers),
|
|
180
|
+
onKeyDown: createHandleKeyDown(externalEventHandlers)
|
|
126
181
|
};
|
|
127
|
-
},
|
|
128
|
-
|
|
182
|
+
}, "getRootProps");
|
|
183
|
+
const getItemState = React.useCallback((item) => {
|
|
184
|
+
const selected = (selectedValues ?? []).some((value) => value != null && itemComparer(item, value));
|
|
185
|
+
const highlighted = highlightedValue != null && itemComparer(item, highlightedValue);
|
|
186
|
+
const focusable = focusManagement === "DOM";
|
|
129
187
|
return {
|
|
130
|
-
focusable
|
|
131
|
-
highlighted
|
|
132
|
-
selected
|
|
188
|
+
focusable,
|
|
189
|
+
highlighted,
|
|
190
|
+
selected
|
|
133
191
|
};
|
|
134
|
-
}, [
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
192
|
+
}, [itemComparer, selectedValues, highlightedValue, focusManagement]);
|
|
193
|
+
const contextValue = React.useMemo(() => ({
|
|
194
|
+
dispatch,
|
|
195
|
+
getItemState
|
|
196
|
+
}), [dispatch, getItemState]);
|
|
197
|
+
React.useDebugValue({
|
|
198
|
+
state
|
|
199
|
+
});
|
|
200
|
+
return {
|
|
201
|
+
contextValue,
|
|
202
|
+
dispatch,
|
|
203
|
+
getRootProps,
|
|
204
|
+
rootRef: handleRef,
|
|
205
|
+
state
|
|
146
206
|
};
|
|
147
207
|
}
|
|
208
|
+
__name(useList, "useList");
|
|
148
209
|
export {
|
|
149
|
-
|
|
210
|
+
useList
|
|
150
211
|
};
|
|
@@ -1,61 +1,81 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { ListActionTypes } from "./listActions.types.js";
|
|
5
|
+
import { ListContext } from "./ListContext.js";
|
|
6
|
+
import extractEventHandlers from "../../../../../@mui_utils@6.0.0-rc.0_@types_react@19.1.0_react@19.1.0/node_modules/@mui/utils/esm/extractEventHandlers/extractEventHandlers.js";
|
|
7
|
+
function useListItem(parameters) {
|
|
6
8
|
const {
|
|
7
|
-
handlePointerOverEvents
|
|
8
|
-
item
|
|
9
|
-
} =
|
|
10
|
-
|
|
9
|
+
handlePointerOverEvents = false,
|
|
10
|
+
item
|
|
11
|
+
} = parameters;
|
|
12
|
+
const listContext = React.useContext(ListContext);
|
|
13
|
+
if (!listContext) {
|
|
11
14
|
throw new Error("useListItem must be used within a ListProvider");
|
|
15
|
+
}
|
|
12
16
|
const {
|
|
13
|
-
dispatch
|
|
14
|
-
getItemState
|
|
15
|
-
} =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
17
|
+
dispatch,
|
|
18
|
+
getItemState
|
|
19
|
+
} = listContext;
|
|
20
|
+
const {
|
|
21
|
+
highlighted,
|
|
22
|
+
selected,
|
|
23
|
+
focusable
|
|
24
|
+
} = getItemState(item);
|
|
25
|
+
const createHandleClick = React.useCallback((externalHandlers) => (event) => {
|
|
26
|
+
var _a;
|
|
27
|
+
(_a = externalHandlers.onClick) == null ? void 0 : _a.call(externalHandlers, event);
|
|
28
|
+
if (event.defaultPrevented) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (process.env.NODE_ENV !== "production") {
|
|
32
|
+
if (item === void 0) {
|
|
33
|
+
throw new Error(["MUI: The `item` provided to useListItem() is undefined.", "This should happen only during server-side rendering under React 17."].join("\n"));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
dispatch({
|
|
37
|
+
type: ListActionTypes.itemClick,
|
|
38
|
+
item,
|
|
39
|
+
event
|
|
40
|
+
});
|
|
41
|
+
}, [dispatch, item]);
|
|
42
|
+
const createHandlePointerOver = React.useCallback((externalHandlers) => (event) => {
|
|
43
|
+
var _a;
|
|
44
|
+
(_a = externalHandlers.onMouseOver) == null ? void 0 : _a.call(externalHandlers, event);
|
|
45
|
+
if (event.defaultPrevented) {
|
|
46
|
+
return;
|
|
30
47
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
throw new Error(["MUI: The `item` provided to useListItem() is undefined.", "This should happen only during server-side rendering under React 17."].join(`
|
|
36
|
-
`));
|
|
37
|
-
n({
|
|
38
|
-
type: c.itemHover,
|
|
39
|
-
item: i,
|
|
40
|
-
event: t
|
|
41
|
-
});
|
|
48
|
+
if (process.env.NODE_ENV !== "production") {
|
|
49
|
+
if (item === void 0) {
|
|
50
|
+
throw new Error(["MUI: The `item` provided to useListItem() is undefined.", "This should happen only during server-side rendering under React 17."].join("\n"));
|
|
51
|
+
}
|
|
42
52
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
dispatch({
|
|
54
|
+
type: ListActionTypes.itemHover,
|
|
55
|
+
item,
|
|
56
|
+
event
|
|
57
|
+
});
|
|
58
|
+
}, [dispatch, item]);
|
|
59
|
+
let tabIndex;
|
|
60
|
+
if (focusable) {
|
|
61
|
+
tabIndex = highlighted ? 0 : -1;
|
|
62
|
+
}
|
|
63
|
+
const getRootProps = /* @__PURE__ */ __name((externalProps = {}) => {
|
|
64
|
+
const externalEventHandlers = extractEventHandlers(externalProps);
|
|
65
|
+
return {
|
|
66
|
+
...externalProps,
|
|
67
|
+
onClick: createHandleClick(externalEventHandlers),
|
|
68
|
+
onPointerOver: handlePointerOverEvents ? createHandlePointerOver(externalEventHandlers) : void 0,
|
|
69
|
+
tabIndex
|
|
70
|
+
};
|
|
71
|
+
}, "getRootProps");
|
|
72
|
+
return {
|
|
73
|
+
getRootProps,
|
|
74
|
+
highlighted,
|
|
75
|
+
selected
|
|
57
76
|
};
|
|
58
77
|
}
|
|
78
|
+
__name(useListItem, "useListItem");
|
|
59
79
|
export {
|
|
60
|
-
|
|
80
|
+
useListItem
|
|
61
81
|
};
|
|
@@ -1,63 +1,82 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { combineHooksSlotProps } from "../utils/combineHooksSlotProps.js";
|
|
5
|
+
import { useListItem } from "../useList/useListItem.js";
|
|
6
|
+
import { useButton } from "../useButton/useButton.js";
|
|
7
|
+
import useId from "../../../../../@mui_utils@6.0.0-rc.0_@types_react@19.1.0_react@19.1.0/node_modules/@mui/utils/esm/useId/useId.js";
|
|
8
|
+
import { useCompoundItem } from "../useCompound/useCompoundItem.js";
|
|
9
|
+
import useForkRef from "../../../../../@mui_utils@6.0.0-rc.0_@types_react@19.1.0_react@19.1.0/node_modules/@mui/utils/esm/useForkRef/useForkRef.js";
|
|
10
|
+
import extractEventHandlers from "../../../../../@mui_utils@6.0.0-rc.0_@types_react@19.1.0_react@19.1.0/node_modules/@mui/utils/esm/extractEventHandlers/extractEventHandlers.js";
|
|
11
|
+
function useOption(params) {
|
|
10
12
|
const {
|
|
11
|
-
value
|
|
12
|
-
label
|
|
13
|
-
disabled
|
|
14
|
-
rootRef:
|
|
15
|
-
id:
|
|
16
|
-
} =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
label: i,
|
|
31
|
-
value: t,
|
|
32
|
-
ref: u,
|
|
33
|
-
id: s
|
|
34
|
-
}), [r, i, t, s]), {
|
|
35
|
-
index: y
|
|
36
|
-
} = K(t, w), f = M(a, u, b), D = (o) => (e) => {
|
|
37
|
-
var n;
|
|
38
|
-
(n = o.onKeyDown) == null || n.call(o, e), !e.defaultMuiPrevented && [" ", "Enter"].includes(e.key) && (e.defaultMuiPrevented = !0);
|
|
39
|
-
}, I = (o = {}) => ({
|
|
40
|
-
onKeyDown: D(o)
|
|
13
|
+
value,
|
|
14
|
+
label,
|
|
15
|
+
disabled,
|
|
16
|
+
rootRef: optionRefParam,
|
|
17
|
+
id: idParam
|
|
18
|
+
} = params;
|
|
19
|
+
const {
|
|
20
|
+
getRootProps: getListItemProps,
|
|
21
|
+
highlighted,
|
|
22
|
+
selected
|
|
23
|
+
} = useListItem({
|
|
24
|
+
item: value
|
|
25
|
+
});
|
|
26
|
+
const {
|
|
27
|
+
getRootProps: getButtonProps,
|
|
28
|
+
rootRef: buttonRefHandler
|
|
29
|
+
} = useButton({
|
|
30
|
+
disabled,
|
|
31
|
+
focusableWhenDisabled: true
|
|
41
32
|
});
|
|
33
|
+
const id = useId(idParam);
|
|
34
|
+
const optionRef = React.useRef(null);
|
|
35
|
+
const selectOption = React.useMemo(() => ({
|
|
36
|
+
disabled,
|
|
37
|
+
label,
|
|
38
|
+
value,
|
|
39
|
+
ref: optionRef,
|
|
40
|
+
id
|
|
41
|
+
}), [disabled, label, value, id]);
|
|
42
|
+
const {
|
|
43
|
+
index
|
|
44
|
+
} = useCompoundItem(value, selectOption);
|
|
45
|
+
const handleRef = useForkRef(optionRefParam, optionRef, buttonRefHandler);
|
|
46
|
+
const createHandleKeyDown = /* @__PURE__ */ __name((otherHandlers) => (event) => {
|
|
47
|
+
var _a;
|
|
48
|
+
(_a = otherHandlers.onKeyDown) == null ? void 0 : _a.call(otherHandlers, event);
|
|
49
|
+
if (event.defaultMuiPrevented) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if ([" ", "Enter"].includes(event.key)) {
|
|
53
|
+
event.defaultMuiPrevented = true;
|
|
54
|
+
}
|
|
55
|
+
}, "createHandleKeyDown");
|
|
56
|
+
const getOwnHandlers = /* @__PURE__ */ __name((otherHandlers = {}) => ({
|
|
57
|
+
onKeyDown: createHandleKeyDown(otherHandlers)
|
|
58
|
+
}), "getOwnHandlers");
|
|
42
59
|
return {
|
|
43
|
-
getRootProps: (
|
|
44
|
-
const
|
|
60
|
+
getRootProps: /* @__PURE__ */ __name((externalProps = {}) => {
|
|
61
|
+
const externalEventHandlers = extractEventHandlers(externalProps);
|
|
62
|
+
const getCombinedRootProps = combineHooksSlotProps(getListItemProps, combineHooksSlotProps(getButtonProps, getOwnHandlers));
|
|
45
63
|
return {
|
|
46
|
-
...
|
|
47
|
-
...
|
|
48
|
-
...
|
|
49
|
-
id
|
|
50
|
-
ref:
|
|
64
|
+
...externalProps,
|
|
65
|
+
...externalEventHandlers,
|
|
66
|
+
...getCombinedRootProps(externalEventHandlers),
|
|
67
|
+
id,
|
|
68
|
+
ref: handleRef,
|
|
51
69
|
role: "option",
|
|
52
|
-
"aria-selected":
|
|
70
|
+
"aria-selected": selected
|
|
53
71
|
};
|
|
54
|
-
},
|
|
55
|
-
highlighted
|
|
56
|
-
index
|
|
57
|
-
selected
|
|
58
|
-
rootRef:
|
|
72
|
+
}, "getRootProps"),
|
|
73
|
+
highlighted,
|
|
74
|
+
index,
|
|
75
|
+
selected,
|
|
76
|
+
rootRef: handleRef
|
|
59
77
|
};
|
|
60
78
|
}
|
|
79
|
+
__name(useOption, "useOption");
|
|
61
80
|
export {
|
|
62
|
-
|
|
81
|
+
useOption
|
|
63
82
|
};
|