@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,232 +1,296 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { useRef, useState, Children, useEffect, useCallback, useImperativeHandle } from "react";
|
|
5
|
+
import { create } from "../../helpers/bem.js";
|
|
6
|
+
import styles from "./Carousel.module.scss.js";
|
|
7
|
+
import { NEXT, PREV, handleTouchStart, handleTouchMove, handleTouchEnd, handleMouseUp, handleMouseDown } from "./Carousel.services.js";
|
|
8
|
+
import { Lottie } from "../lottie/Lottie.js";
|
|
9
|
+
import { Button } from "../button/Button.js";
|
|
10
|
+
const bem = create(styles, "Carousel");
|
|
11
|
+
const Carousel = /* @__PURE__ */ __name(({
|
|
12
|
+
ref,
|
|
13
|
+
autoplay,
|
|
14
|
+
enableControl,
|
|
15
|
+
itemsToShow = 1,
|
|
16
|
+
className,
|
|
17
|
+
classNameControls,
|
|
18
|
+
classNameButtons,
|
|
19
|
+
classNameWrapper,
|
|
20
|
+
classNameItem,
|
|
21
|
+
classNameDots,
|
|
22
|
+
classNameDot,
|
|
23
|
+
onKeyDown,
|
|
24
|
+
onMouseEnter,
|
|
25
|
+
onMouseLeave,
|
|
26
|
+
onTouchEnd,
|
|
27
|
+
onTouchMove,
|
|
28
|
+
onTouchStart,
|
|
29
|
+
onMouseDown,
|
|
30
|
+
onMouseUp,
|
|
31
|
+
children,
|
|
32
|
+
...props
|
|
30
33
|
}) => {
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
const carouselContainerRef = useRef(null);
|
|
35
|
+
const touchStartX = useRef(0);
|
|
36
|
+
const touchEndX = useRef(0);
|
|
37
|
+
const mouseStartX = useRef(0);
|
|
38
|
+
const mouseEndX = useRef(0);
|
|
39
|
+
const [mobileTutorialVisible, setMobileTutorialVisible] = useState(true);
|
|
40
|
+
const [currentIndex, setCurrentIndex] = useState(itemsToShow);
|
|
41
|
+
const [mouseActive, setMouseActive] = useState(false);
|
|
42
|
+
const [isPlaying, setIsPlaying] = useState(Boolean(autoplay));
|
|
43
|
+
const [isTransitioning, setIsTransitioning] = useState(false);
|
|
44
|
+
const childrenArray = Children.toArray(children);
|
|
45
|
+
const [items, setItems] = useState([]);
|
|
46
|
+
const numItems = childrenArray.length;
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
const newItems = [
|
|
49
|
+
...childrenArray.slice(-itemsToShow),
|
|
50
|
+
...childrenArray,
|
|
51
|
+
...childrenArray.slice(0, itemsToShow)
|
|
37
52
|
];
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
53
|
+
if (newItems !== items) {
|
|
54
|
+
setItems(newItems);
|
|
55
|
+
setCurrentIndex(itemsToShow);
|
|
56
|
+
}
|
|
57
|
+
}, [itemsToShow]);
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
const timeout = setTimeout(() => {
|
|
60
|
+
setMobileTutorialVisible(false);
|
|
42
61
|
}, 1500);
|
|
43
|
-
return () => clearTimeout(
|
|
62
|
+
return () => clearTimeout(timeout);
|
|
44
63
|
}, []);
|
|
45
|
-
const
|
|
46
|
-
(
|
|
47
|
-
if (
|
|
48
|
-
|
|
49
|
-
let
|
|
50
|
-
|
|
51
|
-
|
|
64
|
+
const slide = useCallback(
|
|
65
|
+
(direction) => {
|
|
66
|
+
if (isTransitioning) return;
|
|
67
|
+
setIsTransitioning(true);
|
|
68
|
+
let newIndex = currentIndex;
|
|
69
|
+
if (direction === NEXT) {
|
|
70
|
+
newIndex = currentIndex + 1;
|
|
71
|
+
} else if (direction === PREV) {
|
|
72
|
+
newIndex = currentIndex - 1;
|
|
73
|
+
}
|
|
74
|
+
setCurrentIndex(newIndex);
|
|
75
|
+
setTimeout(() => {
|
|
76
|
+
if (newIndex >= numItems + itemsToShow) {
|
|
77
|
+
setCurrentIndex(itemsToShow);
|
|
78
|
+
setIsTransitioning(false);
|
|
79
|
+
} else if (newIndex < itemsToShow) {
|
|
80
|
+
setCurrentIndex(numItems);
|
|
81
|
+
setIsTransitioning(false);
|
|
82
|
+
} else {
|
|
83
|
+
setIsTransitioning(false);
|
|
84
|
+
}
|
|
52
85
|
}, 300);
|
|
53
86
|
},
|
|
54
|
-
[
|
|
87
|
+
[isTransitioning, currentIndex, itemsToShow, numItems]
|
|
55
88
|
);
|
|
56
|
-
|
|
57
|
-
if (typeof
|
|
58
|
-
let
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
89
|
+
useEffect(() => {
|
|
90
|
+
if (typeof autoplay !== "number" || autoplay <= 0) return;
|
|
91
|
+
let interval;
|
|
92
|
+
if (isPlaying) {
|
|
93
|
+
interval = setInterval(() => {
|
|
94
|
+
slide(NEXT);
|
|
95
|
+
}, autoplay);
|
|
96
|
+
}
|
|
97
|
+
return () => {
|
|
98
|
+
clearInterval(interval);
|
|
63
99
|
};
|
|
64
|
-
}, [
|
|
65
|
-
const
|
|
66
|
-
(
|
|
67
|
-
if (
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
100
|
+
}, [slide, isPlaying, autoplay]);
|
|
101
|
+
const slideToIndex = useCallback(
|
|
102
|
+
(index) => {
|
|
103
|
+
if (isTransitioning) return;
|
|
104
|
+
setIsTransitioning(true);
|
|
105
|
+
const targetIndex = index + itemsToShow;
|
|
106
|
+
setCurrentIndex(targetIndex);
|
|
107
|
+
setTimeout(() => {
|
|
108
|
+
if (targetIndex >= numItems + itemsToShow) {
|
|
109
|
+
setCurrentIndex(targetIndex - numItems);
|
|
110
|
+
setIsTransitioning(false);
|
|
111
|
+
} else if (targetIndex < itemsToShow) {
|
|
112
|
+
setCurrentIndex(numItems + targetIndex);
|
|
113
|
+
setIsTransitioning(false);
|
|
114
|
+
} else {
|
|
115
|
+
setIsTransitioning(false);
|
|
116
|
+
}
|
|
72
117
|
}, 300);
|
|
73
118
|
},
|
|
74
|
-
[
|
|
119
|
+
[isTransitioning, itemsToShow, numItems]
|
|
75
120
|
);
|
|
76
|
-
|
|
77
|
-
slidePrev: () =>
|
|
78
|
-
slideNext: () =>
|
|
79
|
-
carouselContainer:
|
|
121
|
+
useImperativeHandle(ref, () => ({
|
|
122
|
+
slidePrev: /* @__PURE__ */ __name(() => slide(PREV), "slidePrev"),
|
|
123
|
+
slideNext: /* @__PURE__ */ __name(() => slide(NEXT), "slideNext"),
|
|
124
|
+
carouselContainer: carouselContainerRef.current
|
|
80
125
|
}));
|
|
81
|
-
const
|
|
126
|
+
const handleMouseEnter = useCallback(
|
|
82
127
|
(e) => {
|
|
83
|
-
|
|
128
|
+
onMouseEnter == null ? void 0 : onMouseEnter(e);
|
|
129
|
+
setIsPlaying(false);
|
|
84
130
|
},
|
|
85
|
-
[
|
|
86
|
-
)
|
|
131
|
+
[onMouseEnter]
|
|
132
|
+
);
|
|
133
|
+
const handleMouseLeave = useCallback(
|
|
87
134
|
(e) => {
|
|
88
|
-
|
|
135
|
+
onMouseLeave == null ? void 0 : onMouseLeave(e);
|
|
136
|
+
setIsPlaying(true);
|
|
89
137
|
},
|
|
90
|
-
[
|
|
91
|
-
)
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
138
|
+
[onMouseLeave]
|
|
139
|
+
);
|
|
140
|
+
const getTransformValue = /* @__PURE__ */ __name(() => {
|
|
141
|
+
const offset = -currentIndex * (100 / itemsToShow);
|
|
142
|
+
return `translateX(${offset}%)`;
|
|
143
|
+
}, "getTransformValue");
|
|
144
|
+
const renderDots = useCallback(
|
|
145
|
+
() => numItems > 0 && /* @__PURE__ */ jsx("span", { className: bem("dots", void 0, classNameDots), children: childrenArray.map((_, i) => {
|
|
146
|
+
const isActive = i === (currentIndex - itemsToShow + numItems) % numItems;
|
|
147
|
+
return /* @__PURE__ */ jsx(
|
|
95
148
|
"button",
|
|
96
149
|
{
|
|
97
150
|
tabIndex: 0,
|
|
98
|
-
className:
|
|
151
|
+
className: bem(
|
|
99
152
|
"dots__dot",
|
|
100
153
|
{
|
|
101
|
-
"is-active":
|
|
154
|
+
"is-active": isActive
|
|
102
155
|
},
|
|
103
|
-
|
|
156
|
+
classNameDot
|
|
104
157
|
),
|
|
105
|
-
onClick: () =>
|
|
106
|
-
onKeyDown: (
|
|
158
|
+
onClick: /* @__PURE__ */ __name(() => slideToIndex(i), "onClick"),
|
|
159
|
+
onKeyDown: /* @__PURE__ */ __name((e) => e.key === "Enter" && slideToIndex(i), "onKeyDown")
|
|
107
160
|
},
|
|
108
|
-
`carousel-dot-${
|
|
161
|
+
`carousel-dot-${i}`
|
|
109
162
|
);
|
|
110
163
|
}) }),
|
|
111
164
|
[
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
165
|
+
numItems,
|
|
166
|
+
childrenArray,
|
|
167
|
+
currentIndex,
|
|
168
|
+
classNameDots,
|
|
169
|
+
classNameDot,
|
|
170
|
+
itemsToShow,
|
|
171
|
+
slideToIndex
|
|
119
172
|
]
|
|
120
173
|
);
|
|
121
|
-
|
|
174
|
+
if (numItems === 0) {
|
|
175
|
+
return null;
|
|
176
|
+
}
|
|
177
|
+
return /* @__PURE__ */ jsxs(
|
|
122
178
|
"div",
|
|
123
179
|
{
|
|
124
180
|
"aria-label": "Carousel",
|
|
125
181
|
role: "button",
|
|
126
182
|
tabIndex: 0,
|
|
127
|
-
...
|
|
128
|
-
ref:
|
|
129
|
-
className:
|
|
183
|
+
...props,
|
|
184
|
+
ref: carouselContainerRef,
|
|
185
|
+
className: bem(
|
|
130
186
|
void 0,
|
|
131
187
|
{
|
|
132
|
-
"is-active":
|
|
188
|
+
"is-active": mouseActive
|
|
133
189
|
},
|
|
134
|
-
|
|
190
|
+
className
|
|
135
191
|
),
|
|
136
|
-
onMouseEnter:
|
|
137
|
-
onMouseLeave:
|
|
138
|
-
onKeyDown: (e) => {
|
|
139
|
-
|
|
192
|
+
onMouseEnter: handleMouseEnter,
|
|
193
|
+
onMouseLeave: handleMouseLeave,
|
|
194
|
+
onKeyDown: /* @__PURE__ */ __name((e) => {
|
|
195
|
+
onKeyDown == null ? void 0 : onKeyDown(e);
|
|
196
|
+
switch (e.key) {
|
|
140
197
|
case "ArrowLeft":
|
|
141
|
-
|
|
198
|
+
slide("NEXT");
|
|
142
199
|
break;
|
|
143
200
|
case "ArrowRight":
|
|
144
|
-
|
|
201
|
+
slide("PREV");
|
|
145
202
|
break;
|
|
146
203
|
}
|
|
147
|
-
},
|
|
148
|
-
onMouseDown: (e) => {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
204
|
+
}, "onKeyDown"),
|
|
205
|
+
onMouseDown: /* @__PURE__ */ __name((e) => {
|
|
206
|
+
onMouseDown == null ? void 0 : onMouseDown(e);
|
|
207
|
+
handleMouseDown(e, mouseStartX);
|
|
208
|
+
setMouseActive(true);
|
|
209
|
+
}, "onMouseDown"),
|
|
210
|
+
onMouseUp: /* @__PURE__ */ __name((e) => {
|
|
211
|
+
onMouseUp == null ? void 0 : onMouseUp(e);
|
|
212
|
+
handleMouseUp(e, mouseStartX, mouseEndX, slide);
|
|
213
|
+
setMouseActive(false);
|
|
214
|
+
}, "onMouseUp"),
|
|
215
|
+
onTouchEnd: /* @__PURE__ */ __name((e) => {
|
|
216
|
+
onTouchEnd == null ? void 0 : onTouchEnd(e);
|
|
217
|
+
handleTouchEnd(touchStartX, touchEndX, slide);
|
|
218
|
+
}, "onTouchEnd"),
|
|
219
|
+
onTouchMove: /* @__PURE__ */ __name((e) => {
|
|
220
|
+
onTouchMove == null ? void 0 : onTouchMove(e);
|
|
221
|
+
handleTouchMove(e, touchEndX);
|
|
222
|
+
}, "onTouchMove"),
|
|
223
|
+
onTouchStart: /* @__PURE__ */ __name((e) => {
|
|
224
|
+
onTouchStart == null ? void 0 : onTouchStart(e);
|
|
225
|
+
handleTouchStart(e, touchStartX);
|
|
226
|
+
}, "onTouchStart"),
|
|
163
227
|
children: [
|
|
164
|
-
/* @__PURE__ */
|
|
228
|
+
/* @__PURE__ */ jsx(
|
|
165
229
|
"div",
|
|
166
230
|
{
|
|
167
|
-
className:
|
|
231
|
+
className: bem("wrapper", void 0, classNameWrapper),
|
|
168
232
|
style: {
|
|
169
|
-
transform:
|
|
170
|
-
transition:
|
|
233
|
+
transform: getTransformValue(),
|
|
234
|
+
transition: isTransitioning ? "transform 0.3s ease-in-out" : "none"
|
|
171
235
|
},
|
|
172
|
-
children:
|
|
236
|
+
children: items.map((child, i) => /* @__PURE__ */ jsx(
|
|
173
237
|
"div",
|
|
174
238
|
{
|
|
175
|
-
className:
|
|
239
|
+
className: bem("item", void 0, classNameItem),
|
|
176
240
|
style: {
|
|
177
|
-
width: `${100 /
|
|
241
|
+
width: `${100 / itemsToShow}%`
|
|
178
242
|
},
|
|
179
|
-
children:
|
|
243
|
+
children: child
|
|
180
244
|
},
|
|
181
|
-
`carousel-item-${
|
|
245
|
+
`carousel-item-${i}`
|
|
182
246
|
))
|
|
183
247
|
}
|
|
184
248
|
),
|
|
185
|
-
/* @__PURE__ */
|
|
249
|
+
/* @__PURE__ */ jsx(
|
|
186
250
|
"div",
|
|
187
251
|
{
|
|
188
|
-
className:
|
|
189
|
-
"is-hidden": !
|
|
252
|
+
className: bem("mobile__tutorial", {
|
|
253
|
+
"is-hidden": !Boolean(mobileTutorialVisible)
|
|
190
254
|
}),
|
|
191
|
-
children: /* @__PURE__ */
|
|
255
|
+
children: /* @__PURE__ */ jsx("div", { className: bem("mobile__tutorial__animation"), children: /* @__PURE__ */ jsx(Lottie, { animationName: "Swipe" }) })
|
|
192
256
|
}
|
|
193
257
|
),
|
|
194
|
-
/* @__PURE__ */
|
|
195
|
-
|
|
196
|
-
|
|
258
|
+
/* @__PURE__ */ jsxs("footer", { className: bem("controls", void 0, classNameControls), children: [
|
|
259
|
+
Boolean(enableControl) && /* @__PURE__ */ jsx(
|
|
260
|
+
Button,
|
|
197
261
|
{
|
|
198
262
|
"aria-label": "Swipe one slide backwards",
|
|
199
|
-
className:
|
|
263
|
+
className: bem("button", void 0, classNameButtons),
|
|
200
264
|
variant: "outlined",
|
|
201
265
|
iconProps: {
|
|
202
266
|
name: "ArrowLeft01Icon",
|
|
203
267
|
size: "md",
|
|
204
268
|
color: "white"
|
|
205
269
|
},
|
|
206
|
-
onClick: () =>
|
|
270
|
+
onClick: /* @__PURE__ */ __name(() => slide(PREV), "onClick")
|
|
207
271
|
}
|
|
208
272
|
),
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
273
|
+
renderDots(),
|
|
274
|
+
Boolean(enableControl) && /* @__PURE__ */ jsx(
|
|
275
|
+
Button,
|
|
212
276
|
{
|
|
213
277
|
"aria-label": "Swipe one slide forwards",
|
|
214
|
-
className:
|
|
278
|
+
className: bem("button", void 0, classNameButtons),
|
|
215
279
|
variant: "outlined",
|
|
216
280
|
iconProps: {
|
|
217
281
|
name: "ArrowRight01Icon",
|
|
218
282
|
size: "md",
|
|
219
283
|
color: "white"
|
|
220
284
|
},
|
|
221
|
-
onClick: () =>
|
|
285
|
+
onClick: /* @__PURE__ */ __name(() => slide(NEXT), "onClick")
|
|
222
286
|
}
|
|
223
287
|
)
|
|
224
288
|
] })
|
|
225
289
|
]
|
|
226
290
|
}
|
|
227
291
|
);
|
|
228
|
-
};
|
|
229
|
-
|
|
292
|
+
}, "Carousel");
|
|
293
|
+
Carousel.displayName = "Carousel";
|
|
230
294
|
export {
|
|
231
|
-
|
|
295
|
+
Carousel
|
|
232
296
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
const
|
|
1
|
+
const gradientMove = "gradientMove";
|
|
2
|
+
const fadeInKeyframe = "fadeInKeyframe";
|
|
3
|
+
const styles = {
|
|
2
4
|
"prokodo-Carousel": "prokodo-Carousel",
|
|
3
5
|
"prokodo-Carousel--is-active": "prokodo-Carousel--is-active",
|
|
4
6
|
"prokodo-Carousel__wrapper": "prokodo-Carousel__wrapper",
|
|
@@ -11,11 +13,11 @@ const o = "gradientMove", r = "fadeInKeyframe", _ = {
|
|
|
11
13
|
"prokodo-Carousel__dots": "prokodo-Carousel__dots",
|
|
12
14
|
"prokodo-Carousel__dots__dot": "prokodo-Carousel__dots__dot",
|
|
13
15
|
"prokodo-Carousel__dots__dot--is-active": "prokodo-Carousel__dots__dot--is-active",
|
|
14
|
-
gradientMove
|
|
15
|
-
fadeInKeyframe
|
|
16
|
+
gradientMove,
|
|
17
|
+
fadeInKeyframe
|
|
16
18
|
};
|
|
17
19
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
styles as default,
|
|
21
|
+
fadeInKeyframe,
|
|
22
|
+
gradientMove
|
|
21
23
|
};
|
|
@@ -1,22 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
const NEXT = "NEXT";
|
|
4
|
+
const PREV = "PREV";
|
|
5
|
+
const handleTouchStart = /* @__PURE__ */ __name((e, touchStartX) => {
|
|
6
|
+
var _a;
|
|
7
|
+
touchStartX.current = ((_a = e.targetTouches[0]) == null ? void 0 : _a.clientX) ?? 0;
|
|
8
|
+
}, "handleTouchStart");
|
|
9
|
+
const handleTouchMove = /* @__PURE__ */ __name((e, touchEndX) => {
|
|
10
|
+
var _a;
|
|
11
|
+
touchEndX.current = ((_a = e.targetTouches[0]) == null ? void 0 : _a.clientX) ?? 0;
|
|
12
|
+
}, "handleTouchMove");
|
|
13
|
+
const handleTouchEnd = /* @__PURE__ */ __name((touchStartX, touchEndX, slide) => {
|
|
14
|
+
if (touchStartX.current - touchEndX.current > 50) {
|
|
15
|
+
slide("NEXT");
|
|
16
|
+
}
|
|
17
|
+
if (touchStartX.current - touchEndX.current < -50) {
|
|
18
|
+
slide("PREV");
|
|
19
|
+
}
|
|
20
|
+
}, "handleTouchEnd");
|
|
21
|
+
const handleMouseDown = /* @__PURE__ */ __name((e, mouseStartX) => {
|
|
22
|
+
mouseStartX.current = e.clientX;
|
|
23
|
+
}, "handleMouseDown");
|
|
24
|
+
const handleMouseUp = /* @__PURE__ */ __name((e, mouseStartX, mouseEndX, slide) => {
|
|
25
|
+
mouseEndX.current = e.clientX;
|
|
26
|
+
if (mouseStartX.current - mouseEndX.current > 50) {
|
|
27
|
+
slide("NEXT");
|
|
28
|
+
}
|
|
29
|
+
if (mouseStartX.current - mouseEndX.current < -50) {
|
|
30
|
+
slide("PREV");
|
|
31
|
+
}
|
|
32
|
+
}, "handleMouseUp");
|
|
14
33
|
export {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
34
|
+
NEXT,
|
|
35
|
+
PREV,
|
|
36
|
+
handleMouseDown,
|
|
37
|
+
handleMouseUp,
|
|
38
|
+
handleTouchEnd,
|
|
39
|
+
handleTouchMove,
|
|
40
|
+
handleTouchStart
|
|
22
41
|
};
|
|
@@ -1,51 +1,59 @@
|
|
|
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 { jsxs, jsx } from "react/jsx-runtime";
|
|
4
|
+
import { memo, useCallback } from "react";
|
|
5
|
+
import { create } from "../../helpers/bem.js";
|
|
6
|
+
import styles from "./Chip.module.scss.js";
|
|
7
|
+
const bem = create(styles, "Chip");
|
|
8
|
+
const Chip = memo(
|
|
6
9
|
({
|
|
7
|
-
label
|
|
8
|
-
icon
|
|
9
|
-
variant
|
|
10
|
-
color
|
|
11
|
-
className
|
|
12
|
-
onDelete
|
|
13
|
-
onClick
|
|
14
|
-
onKeyDown
|
|
10
|
+
label,
|
|
11
|
+
icon,
|
|
12
|
+
variant = "filled",
|
|
13
|
+
color = "primary",
|
|
14
|
+
className,
|
|
15
|
+
onDelete,
|
|
16
|
+
onClick,
|
|
17
|
+
onKeyDown
|
|
15
18
|
}) => {
|
|
16
|
-
const
|
|
17
|
-
(
|
|
18
|
-
(
|
|
19
|
+
const handleKeyDown = useCallback(
|
|
20
|
+
(e) => {
|
|
21
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
22
|
+
e.preventDefault();
|
|
23
|
+
onKeyDown == null ? void 0 : onKeyDown(e);
|
|
24
|
+
}
|
|
19
25
|
},
|
|
20
|
-
[
|
|
21
|
-
)
|
|
26
|
+
[onKeyDown]
|
|
27
|
+
);
|
|
28
|
+
const isClickable = !!onClick;
|
|
22
29
|
return (
|
|
23
30
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
24
|
-
/* @__PURE__ */
|
|
31
|
+
/* @__PURE__ */ jsxs(
|
|
25
32
|
"div",
|
|
26
33
|
{
|
|
27
|
-
"aria-label": typeof
|
|
28
|
-
role:
|
|
29
|
-
tabIndex:
|
|
30
|
-
className:
|
|
34
|
+
"aria-label": typeof label === "string" ? label : void 0,
|
|
35
|
+
role: isClickable ? "button" : void 0,
|
|
36
|
+
tabIndex: isClickable ? 0 : -1,
|
|
37
|
+
className: bem(
|
|
31
38
|
void 0,
|
|
32
|
-
{ [
|
|
33
|
-
|
|
39
|
+
{ [variant]: !!variant, [color]: !!color },
|
|
40
|
+
className
|
|
34
41
|
),
|
|
35
|
-
onClick: (
|
|
36
|
-
onKeyDown:
|
|
42
|
+
onClick: /* @__PURE__ */ __name((e) => isClickable && (onClick == null ? void 0 : onClick(e)), "onClick"),
|
|
43
|
+
onKeyDown: isClickable || onKeyDown ? handleKeyDown : void 0,
|
|
37
44
|
children: [
|
|
38
|
-
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
|
|
45
|
+
icon,
|
|
46
|
+
/* @__PURE__ */ jsx("span", { className: bem("label"), children: label }),
|
|
47
|
+
onDelete && /* @__PURE__ */ jsx(
|
|
41
48
|
"button",
|
|
42
49
|
{
|
|
43
50
|
"aria-label": "delete",
|
|
44
|
-
className:
|
|
51
|
+
className: bem("delete"),
|
|
45
52
|
type: "button",
|
|
46
|
-
onClick: (
|
|
47
|
-
|
|
48
|
-
|
|
53
|
+
onClick: /* @__PURE__ */ __name((e) => {
|
|
54
|
+
e.stopPropagation();
|
|
55
|
+
onDelete(e);
|
|
56
|
+
}, "onClick"),
|
|
49
57
|
children: "× "
|
|
50
58
|
}
|
|
51
59
|
)
|
|
@@ -55,7 +63,7 @@ const s = v(n, "Chip"), x = h(
|
|
|
55
63
|
);
|
|
56
64
|
}
|
|
57
65
|
);
|
|
58
|
-
|
|
66
|
+
Chip.displayName = "Chip";
|
|
59
67
|
export {
|
|
60
|
-
|
|
68
|
+
Chip
|
|
61
69
|
};
|