bonprix-design-system 0.66.0 → 0.67.0
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/dist/components/Alert/Alert.js +105 -0
- package/dist/components/Alert/Alert.js.map +1 -0
- package/dist/components/Alert/index.js +7 -0
- package/dist/components/Alert/index.js.map +1 -0
- package/dist/components/BottomSheet/BottomSheet.js +172 -0
- package/dist/components/BottomSheet/BottomSheet.js.map +1 -0
- package/dist/components/BottomSheet/BottomSheetContext.js +13 -0
- package/dist/components/BottomSheet/BottomSheetContext.js.map +1 -0
- package/dist/components/BottomSheet/index.js +7 -0
- package/dist/components/BottomSheet/index.js.map +1 -0
- package/dist/components/BottomSheet/useConsumeBottomSheet.js +8 -0
- package/dist/components/BottomSheet/useConsumeBottomSheet.js.map +1 -0
- package/dist/components/BottomSheet/useCreateBottomSheet.js +18 -0
- package/dist/components/BottomSheet/useCreateBottomSheet.js.map +1 -0
- package/dist/components/Breadcrumb/Breadcrumb.js +55 -0
- package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -0
- package/dist/components/Breadcrumb/index.js +7 -0
- package/dist/components/Breadcrumb/index.js.map +1 -0
- package/dist/components/Buttons/BadgeIconButton/BadgeIconButton.js +29 -0
- package/dist/components/Buttons/BadgeIconButton/BadgeIconButton.js.map +1 -0
- package/dist/components/Buttons/BadgeIconButton/index.js +7 -0
- package/dist/components/Buttons/BadgeIconButton/index.js.map +1 -0
- package/dist/components/Buttons/Button/Button.js +50 -0
- package/dist/components/Buttons/Button/Button.js.map +1 -0
- package/dist/components/Buttons/Button/index.js +7 -0
- package/dist/components/Buttons/Button/index.js.map +1 -0
- package/dist/components/ButtonsSection/ButtonsSection.js +19 -0
- package/dist/components/ButtonsSection/ButtonsSection.js.map +1 -0
- package/dist/components/ButtonsSection/PrimaryButton.js +13 -0
- package/dist/components/ButtonsSection/PrimaryButton.js.map +1 -0
- package/dist/components/ButtonsSection/SecondaryButton.js +14 -0
- package/dist/components/ButtonsSection/SecondaryButton.js.map +1 -0
- package/dist/components/ButtonsSection/index.js +9 -0
- package/dist/components/ButtonsSection/index.js.map +1 -0
- package/dist/components/Carousel/Carousel.js +101 -0
- package/dist/components/Carousel/Carousel.js.map +1 -0
- package/dist/components/Carousel/CarouselArrow.js +59 -0
- package/dist/components/Carousel/CarouselArrow.js.map +1 -0
- package/dist/components/Carousel/index.js +7 -0
- package/dist/components/Carousel/index.js.map +1 -0
- package/dist/components/CarouselV2/CarouselArrow.js +64 -0
- package/dist/components/CarouselV2/CarouselArrow.js.map +1 -0
- package/dist/components/CarouselV2/CarouselV2.js +128 -0
- package/dist/components/CarouselV2/CarouselV2.js.map +1 -0
- package/dist/components/CarouselV2/PositionIndicator/PositionIndicator.js +18 -0
- package/dist/components/CarouselV2/PositionIndicator/PositionIndicator.js.map +1 -0
- package/dist/components/CarouselV2/Slide/Slide.js +25 -0
- package/dist/components/CarouselV2/Slide/Slide.js.map +1 -0
- package/dist/components/CarouselV2/Slides/Slides.js +37 -0
- package/dist/components/CarouselV2/Slides/Slides.js.map +1 -0
- package/dist/components/CarouselV2/carouselContext.js +20 -0
- package/dist/components/CarouselV2/carouselContext.js.map +1 -0
- package/dist/components/CarouselV2/index.js +7 -0
- package/dist/components/CarouselV2/index.js.map +1 -0
- package/dist/components/CarouselV2/useConsumeCarousel.js +8 -0
- package/dist/components/CarouselV2/useConsumeCarousel.js.map +1 -0
- package/dist/components/CarouselV2/useCreateCarousel.js +161 -0
- package/dist/components/CarouselV2/useCreateCarousel.js.map +1 -0
- package/dist/components/CarouselV2/useSimulateTouch.js +30 -0
- package/dist/components/CarouselV2/useSimulateTouch.js.map +1 -0
- package/dist/components/CarouselV2/useStart.js +18 -0
- package/dist/components/CarouselV2/useStart.js.map +1 -0
- package/dist/components/CarouselV2/utils.js +41 -0
- package/dist/components/CarouselV2/utils.js.map +1 -0
- package/dist/components/Checkboxes/Checkbox/Checkbox.js +30 -0
- package/dist/components/Checkboxes/Checkbox/Checkbox.js.map +1 -0
- package/dist/components/Checkboxes/CheckboxBase.js +73 -0
- package/dist/components/Checkboxes/CheckboxBase.js.map +1 -0
- package/dist/components/Checkboxes/CheckboxGroup/CheckboxGroup.js +40 -0
- package/dist/components/Checkboxes/CheckboxGroup/CheckboxGroup.js.map +1 -0
- package/dist/components/Checkboxes/CheckboxGroup/CheckboxGroupContext.js +17 -0
- package/dist/components/Checkboxes/CheckboxGroup/CheckboxGroupContext.js.map +1 -0
- package/dist/components/Checkboxes/CheckboxGroup/CheckboxGroupItem/CheckboxGroupItem.js +23 -0
- package/dist/components/Checkboxes/CheckboxGroup/CheckboxGroupItem/CheckboxGroupItem.js.map +1 -0
- package/dist/components/Checkboxes/CheckboxGroup/CheckboxGroupItem/index.js +7 -0
- package/dist/components/Checkboxes/CheckboxGroup/CheckboxGroupItem/index.js.map +1 -0
- package/dist/components/Dialog/Dialog.js +61 -0
- package/dist/components/Dialog/Dialog.js.map +1 -0
- package/dist/components/FeatureHint/FeatureHint.js +25 -0
- package/dist/components/FeatureHint/FeatureHint.js.map +1 -0
- package/dist/components/FeatureHint/index.js +7 -0
- package/dist/components/FeatureHint/index.js.map +1 -0
- package/dist/components/Image/Image.js +62 -0
- package/dist/components/Image/Image.js.map +1 -0
- package/dist/components/Image/index.js +7 -0
- package/dist/components/Image/index.js.map +1 -0
- package/dist/components/InputFields/BaseInputField/BaseInputField.js +128 -0
- package/dist/components/InputFields/BaseInputField/BaseInputField.js.map +1 -0
- package/dist/components/InputFields/BaseInputField/index.js +7 -0
- package/dist/components/InputFields/BaseInputField/index.js.map +1 -0
- package/dist/components/InputFields/PasswordField/PasswordField.js +21 -0
- package/dist/components/InputFields/PasswordField/PasswordField.js.map +1 -0
- package/dist/components/InputFields/PasswordField/index.js +7 -0
- package/dist/components/InputFields/PasswordField/index.js.map +1 -0
- package/dist/components/InputFields/SearchField/SearchField.js +18 -0
- package/dist/components/InputFields/SearchField/SearchField.js.map +1 -0
- package/dist/components/InputFields/SearchField/index.js +7 -0
- package/dist/components/InputFields/SearchField/index.js.map +1 -0
- package/dist/components/InputFields/TextField/TextField.js +37 -0
- package/dist/components/InputFields/TextField/TextField.js.map +1 -0
- package/dist/components/InputFields/TextField/constants.js +14 -0
- package/dist/components/InputFields/TextField/constants.js.map +1 -0
- package/dist/components/InputFields/TextField/index.js +7 -0
- package/dist/components/InputFields/TextField/index.js.map +1 -0
- package/dist/components/InputHelperText/InputHelperText.js +20 -0
- package/dist/components/InputHelperText/InputHelperText.js.map +1 -0
- package/dist/components/InputHelperText/index.js +7 -0
- package/dist/components/InputHelperText/index.js.map +1 -0
- package/dist/components/InputHelperTextSection/InputHelperTextSection.js +21 -0
- package/dist/components/InputHelperTextSection/InputHelperTextSection.js.map +1 -0
- package/dist/components/InputHelperTextSection/index.js +7 -0
- package/dist/components/InputHelperTextSection/index.js.map +1 -0
- package/dist/components/InputWrapper/InputWrapper.js +108 -0
- package/dist/components/InputWrapper/InputWrapper.js.map +1 -0
- package/dist/components/InputWrapper/index.js +7 -0
- package/dist/components/InputWrapper/index.js.map +1 -0
- package/dist/components/Link/Link.js +88 -0
- package/dist/components/Link/Link.js.map +1 -0
- package/dist/components/Link/index.js +7 -0
- package/dist/components/Link/index.js.map +1 -0
- package/dist/components/LinkGroup/LinkGroup.js +47 -0
- package/dist/components/LinkGroup/LinkGroup.js.map +1 -0
- package/dist/components/LinkGroup/index.js +7 -0
- package/dist/components/LinkGroup/index.js.map +1 -0
- package/dist/components/List/List.js +23 -0
- package/dist/components/List/List.js.map +1 -0
- package/dist/components/List/ListItem/ListItem.js +69 -0
- package/dist/components/List/ListItem/ListItem.js.map +1 -0
- package/dist/components/List/ListItem/index.js +7 -0
- package/dist/components/List/ListItem/index.js.map +1 -0
- package/dist/components/List/index.js +7 -0
- package/dist/components/List/index.js.map +1 -0
- package/dist/components/Modal/Modal.js +29 -0
- package/dist/components/Modal/Modal.js.map +1 -0
- package/dist/components/Notification/Notification.js +62 -0
- package/dist/components/Notification/Notification.js.map +1 -0
- package/dist/components/Overlay/Overlay.js +73 -0
- package/dist/components/Overlay/Overlay.js.map +1 -0
- package/dist/components/Pagination/Pagination.js +63 -0
- package/dist/components/Pagination/Pagination.js.map +1 -0
- package/dist/components/Pagination/PaginationArrow.js +17 -0
- package/dist/components/Pagination/PaginationArrow.js.map +1 -0
- package/dist/components/Pagination/PaginationItem.js +33 -0
- package/dist/components/Pagination/PaginationItem.js.map +1 -0
- package/dist/components/Pagination/index.js +8 -0
- package/dist/components/Pagination/index.js.map +1 -0
- package/dist/components/Pagination/utils.js +31 -0
- package/dist/components/Pagination/utils.js.map +1 -0
- package/dist/components/PriceStacked/PriceStacked.js +105 -0
- package/dist/components/PriceStacked/PriceStacked.js.map +1 -0
- package/dist/components/PriceStacked/index.js +7 -0
- package/dist/components/PriceStacked/index.js.map +1 -0
- package/dist/{index.css → components/RadioGroup/RadioGroup.css} +1 -1
- package/dist/components/RadioGroup/RadioGroup2.js +52 -0
- package/dist/components/RadioGroup/RadioGroup2.js.map +1 -0
- package/dist/components/RadioGroup/RadioGroupContext.js +11 -0
- package/dist/components/RadioGroup/RadioGroupContext.js.map +1 -0
- package/dist/components/RadioGroup/RadioGroupItem.js +50 -0
- package/dist/components/RadioGroup/RadioGroupItem.js.map +1 -0
- package/dist/components/RadioGroup/index.js +7 -0
- package/dist/components/RadioGroup/index.js.map +1 -0
- package/dist/components/RadioGroup/useConsumeRadioGroup.js +8 -0
- package/dist/components/RadioGroup/useConsumeRadioGroup.js.map +1 -0
- package/dist/components/Rating/Rating.js +80 -0
- package/dist/components/Rating/Rating.js.map +1 -0
- package/dist/components/Rating/index.js +7 -0
- package/dist/components/Rating/index.js.map +1 -0
- package/dist/components/RemovedItemPlaceholder/RemovedItemPlaceholder.js +29 -0
- package/dist/components/RemovedItemPlaceholder/RemovedItemPlaceholder.js.map +1 -0
- package/dist/components/RemovedItemPlaceholder/index.js +7 -0
- package/dist/components/RemovedItemPlaceholder/index.js.map +1 -0
- package/dist/components/Select/Select.js +95 -0
- package/dist/components/Select/Select.js.map +1 -0
- package/dist/components/Select/SelectItem.js +31 -0
- package/dist/components/Select/SelectItem.js.map +1 -0
- package/dist/components/Select/index.js +7 -0
- package/dist/components/Select/index.js.map +1 -0
- package/dist/components/SelectionControlGroup/SelectionControlGroup.js +42 -0
- package/dist/components/SelectionControlGroup/SelectionControlGroup.js.map +1 -0
- package/dist/components/ShowMoreList/ShowMoreList.js +109 -0
- package/dist/components/ShowMoreList/ShowMoreList.js.map +1 -0
- package/dist/components/ShowMoreList/ShowMoreListItem/ShowMoreListItem.js +12 -0
- package/dist/components/ShowMoreList/ShowMoreListItem/ShowMoreListItem.js.map +1 -0
- package/dist/components/ShowMoreList/ShowMoreListItem/index.js +7 -0
- package/dist/components/ShowMoreList/ShowMoreListItem/index.js.map +1 -0
- package/dist/components/ShowMoreList/useShowMoreListHeight.js +30 -0
- package/dist/components/ShowMoreList/useShowMoreListHeight.js.map +1 -0
- package/dist/components/ShowMoreList/useShowMoreListItems.js +16 -0
- package/dist/components/ShowMoreList/useShowMoreListItems.js.map +1 -0
- package/dist/components/ShowMoreList/useShowMoreListStates.js +54 -0
- package/dist/components/ShowMoreList/useShowMoreListStates.js.map +1 -0
- package/dist/components/SideSheet/SideSheet.js +169 -0
- package/dist/components/SideSheet/SideSheet.js.map +1 -0
- package/dist/components/SideSheet/SideSheetContext.js +11 -0
- package/dist/components/SideSheet/SideSheetContext.js.map +1 -0
- package/dist/components/SideSheet/styles.css +1 -0
- package/dist/components/SideSheet/useConsumeSideSheet.js +8 -0
- package/dist/components/SideSheet/useConsumeSideSheet.js.map +1 -0
- package/dist/components/StepNavi/StepNavi.js +34 -0
- package/dist/components/StepNavi/StepNavi.js.map +1 -0
- package/dist/components/StepNavi/StepNaviStep.js +53 -0
- package/dist/components/StepNavi/StepNaviStep.js.map +1 -0
- package/dist/components/StepNavi/index.js +7 -0
- package/dist/components/StepNavi/index.js.map +1 -0
- package/dist/components/TabGroup/TabGroup.js +30 -0
- package/dist/components/TabGroup/TabGroup.js.map +1 -0
- package/dist/components/TabGroup/TabGroupContent/TabGroupContent.js +13 -0
- package/dist/components/TabGroup/TabGroupContent/TabGroupContent.js.map +1 -0
- package/dist/components/TabGroup/TabGroupContent/index.js +7 -0
- package/dist/components/TabGroup/TabGroupContent/index.js.map +1 -0
- package/dist/components/TabGroup/TabGroupContext.js +11 -0
- package/dist/components/TabGroup/TabGroupContext.js.map +1 -0
- package/dist/components/TabGroup/TabGroupItem/TabGroupItem.js +68 -0
- package/dist/components/TabGroup/TabGroupItem/TabGroupItem.js.map +1 -0
- package/dist/components/TabGroup/TabGroupList/TabGroupList.js +26 -0
- package/dist/components/TabGroup/TabGroupList/TabGroupList.js.map +1 -0
- package/dist/components/TabGroup/index.js +7 -0
- package/dist/components/TabGroup/index.js.map +1 -0
- package/dist/components/TabGroup/tabStyleClasses.js +6 -0
- package/dist/components/TabGroup/tabStyleClasses.js.map +1 -0
- package/dist/components/TabGroup/useTabGroup.js +8 -0
- package/dist/components/TabGroup/useTabGroup.js.map +1 -0
- package/dist/components/Textarea/Textarea.js +98 -0
- package/dist/components/Textarea/Textarea.js.map +1 -0
- package/dist/components/Textarea/index.js +7 -0
- package/dist/components/Textarea/index.js.map +1 -0
- package/dist/components/ThemeForcer/ThemeForcer.js +15 -0
- package/dist/components/ThemeForcer/ThemeForcer.js.map +1 -0
- package/dist/components/ThemeForcer/index.js +7 -0
- package/dist/components/ThemeForcer/index.js.map +1 -0
- package/dist/contexts/ZIndexContext.js +8 -0
- package/dist/contexts/ZIndexContext.js.map +1 -0
- package/dist/hooks/useAnimation.js +17 -0
- package/dist/hooks/useAnimation.js.map +1 -0
- package/dist/hooks/useBreakpointBetween.js +13 -0
- package/dist/hooks/useBreakpointBetween.js.map +1 -0
- package/dist/hooks/useBreakpointCurrent.js +17 -0
- package/dist/hooks/useBreakpointCurrent.js.map +1 -0
- package/dist/hooks/useBreakpointDown.js +11 -0
- package/dist/hooks/useBreakpointDown.js.map +1 -0
- package/dist/hooks/useBreakpointUp.js +11 -0
- package/dist/hooks/useBreakpointUp.js.map +1 -0
- package/dist/hooks/useInnerOpen.js +14 -0
- package/dist/hooks/useInnerOpen.js.map +1 -0
- package/dist/hooks/useIsClient.js +10 -0
- package/dist/hooks/useIsClient.js.map +1 -0
- package/dist/hooks/useSubcomponent.js +37 -0
- package/dist/hooks/useSubcomponent.js.map +1 -0
- package/dist/hooks/useZIndex.js +8 -0
- package/dist/hooks/useZIndex.js.map +1 -0
- package/dist/index.d.ts +1 -109
- package/dist/index.js +56 -55960
- package/dist/internal-components/dist/index.js +4388 -0
- package/dist/internal-components/dist/index.js.map +1 -0
- package/dist/main/tailwind.config.js +86 -0
- package/dist/main/tailwind.config.js.map +1 -0
- package/dist/main/tailwindTokens.js +107 -0
- package/dist/main/tailwindTokens.js.map +1 -0
- package/dist/react/accordion/dist/index.js +8007 -0
- package/dist/react/accordion/dist/index.js.map +1 -0
- package/dist/react/availability/dist/index.js +26 -0
- package/dist/react/availability/dist/index.js.map +1 -0
- package/dist/react/benefit-tag/dist/index.js +33 -0
- package/dist/react/benefit-tag/dist/index.js.map +1 -0
- package/dist/react/collapsible/dist/index.js +7516 -0
- package/dist/react/collapsible/dist/index.js.map +1 -0
- package/dist/react/container/dist/index.js +14 -0
- package/dist/react/container/dist/index.js.map +1 -0
- package/dist/react/figurine/dist/index.js +38 -0
- package/dist/react/figurine/dist/index.js.map +1 -0
- package/dist/react/grid/dist/index.js +1335 -0
- package/dist/react/grid/dist/index.js.map +1 -0
- package/dist/react/icon/dist/index.js +1441 -0
- package/dist/react/icon/dist/index.js.map +1 -0
- package/dist/react/icon-button/dist/index.js +4434 -0
- package/dist/react/icon-button/dist/index.js.map +1 -0
- package/dist/react/illustration/dist/index.js +47 -0
- package/dist/react/illustration/dist/index.js.map +1 -0
- package/dist/react/logo/dist/index.js +1356 -0
- package/dist/react/logo/dist/index.js.map +1 -0
- package/dist/react/price/dist/index.js +193 -0
- package/dist/react/price/dist/index.js.map +1 -0
- package/dist/react/spinner/dist/index.js +35 -0
- package/dist/react/spinner/dist/index.js.map +1 -0
- package/dist/react/switch/dist/index.js +2082 -0
- package/dist/react/switch/dist/index.js.map +1 -0
- package/dist/react/tooltip/dist/index.js +3681 -0
- package/dist/react/tooltip/dist/index.js.map +1 -0
- package/dist/react/typography/dist/index.js +1327 -0
- package/dist/react/typography/dist/index.js.map +1 -0
- package/dist/styles/component-variables.css +213 -0
- package/dist/styles/dark-theme-variables.css +0 -1
- package/dist/styles/default-variables.css +3 -1
- package/dist/styles/legacy-component-variables.css +8 -0
- package/dist/styles/light-theme-variables.css +0 -1
- package/dist/styles/variables.css +2 -0
- package/dist/styles/web-components.css +4 -0
- package/dist/utils/breakpoints.js +33 -0
- package/dist/utils/breakpoints.js.map +1 -0
- package/dist/utils/dist/index.js +38 -0
- package/dist/utils/dist/index.js.map +1 -0
- package/dist/utils/tailwindVariants.js +7 -0
- package/dist/utils/tailwindVariants.js.map +1 -0
- package/dist/web-components/accordion/accordion-item/index.js +35 -0
- package/dist/web-components/accordion/accordion-item/index.js.map +1 -0
- package/dist/web-components/accordion/accordion.css +1 -0
- package/dist/web-components/accordion/index.js +7 -0
- package/dist/web-components/accordion/index.js.map +1 -0
- package/dist/web-components/benefit-tag/benefit-tag.css +1 -0
- package/dist/web-components/benefit-tag/index.js +23 -0
- package/dist/web-components/benefit-tag/index.js.map +1 -0
- package/dist/web-components/collapsible/collapsible.css +1 -0
- package/dist/web-components/collapsible/index.js +79 -0
- package/dist/web-components/collapsible/index.js.map +1 -0
- package/dist/web-components/feature-hint/feature-hint.css +1 -0
- package/dist/web-components/feature-hint/index.js +130 -0
- package/dist/web-components/feature-hint/index.js.map +1 -0
- package/dist/web-components.d.ts +0 -108
- package/dist/web-components.js +15 -575
- package/dist/web-components.js.map +1 -1
- package/package.json +40 -39
- package/dist/floating-ui.utils.dom-Duw-ePvN.js +0 -540
- package/dist/floating-ui.utils.dom-Duw-ePvN.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/web-components.css +0 -1
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import e from "../../react/icon/dist/index.js";
|
|
3
|
+
import t from "../../react/icon-button/dist/index.js";
|
|
4
|
+
import n from "../../react/typography/dist/index.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
7
|
+
import { tv as a } from "tailwind-variants";
|
|
8
|
+
//#region src/components/Alert/Alert.tsx
|
|
9
|
+
var o = a({
|
|
10
|
+
slots: {
|
|
11
|
+
root: "preflight m-0 flex justify-between items-start p-5 rounded gap-4",
|
|
12
|
+
iconAndContent: "flex gap-2",
|
|
13
|
+
content: "typography-body1 text-clr-on-bg-high gap-0.5 pt-0.5",
|
|
14
|
+
title: "",
|
|
15
|
+
icon: ""
|
|
16
|
+
},
|
|
17
|
+
variants: {
|
|
18
|
+
status: {
|
|
19
|
+
success: {
|
|
20
|
+
root: "bg-clr-bg-success",
|
|
21
|
+
title: "text-clr-fg-success",
|
|
22
|
+
icon: "fill-clr-fg-success"
|
|
23
|
+
},
|
|
24
|
+
info: {
|
|
25
|
+
root: "bg-clr-bg-info",
|
|
26
|
+
title: "text-clr-fg-info",
|
|
27
|
+
icon: "fill-clr-fg-info"
|
|
28
|
+
},
|
|
29
|
+
warning: {
|
|
30
|
+
root: "bg-clr-bg-alert",
|
|
31
|
+
title: "text-clr-fg-alert",
|
|
32
|
+
icon: "fill-clr-fg-alert"
|
|
33
|
+
},
|
|
34
|
+
error: {
|
|
35
|
+
root: "bg-clr-bg-error",
|
|
36
|
+
title: "text-clr-fg-error",
|
|
37
|
+
icon: "fill-clr-fg-error"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
alertVariant: {
|
|
41
|
+
primary: { title: "text-clr-on-bg-high" },
|
|
42
|
+
secondary: { root: "p-0 rounded-none bg-transparent" }
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}), s = {
|
|
46
|
+
warning: {
|
|
47
|
+
icon: "alert",
|
|
48
|
+
label: "Warnung"
|
|
49
|
+
},
|
|
50
|
+
info: {
|
|
51
|
+
icon: "hint",
|
|
52
|
+
label: "Hinweis"
|
|
53
|
+
},
|
|
54
|
+
success: {
|
|
55
|
+
icon: "success",
|
|
56
|
+
label: "Erfolg"
|
|
57
|
+
},
|
|
58
|
+
error: {
|
|
59
|
+
icon: "error",
|
|
60
|
+
label: "Fehler"
|
|
61
|
+
}
|
|
62
|
+
}, c = ({ isOpen: a, variant: c = "primary", status: l, title: u, children: d, showCloseIcon: f = !0, onClose: p = () => null, nonCritical: m = !1, titleTag: h = "h2" }) => {
|
|
63
|
+
let { root: g, content: _, title: v, iconAndContent: y, icon: b } = o({
|
|
64
|
+
status: l,
|
|
65
|
+
alertVariant: c
|
|
66
|
+
});
|
|
67
|
+
if (!a) return null;
|
|
68
|
+
let x = s[l].icon, S = s[l].label;
|
|
69
|
+
return /* @__PURE__ */ i("div", {
|
|
70
|
+
className: g(),
|
|
71
|
+
role: m ? void 0 : "alert",
|
|
72
|
+
"aria-label": S,
|
|
73
|
+
"data-bpds": "alert",
|
|
74
|
+
"data-bpds-status": l,
|
|
75
|
+
"data-bpds-variant": c,
|
|
76
|
+
children: [/* @__PURE__ */ i("div", {
|
|
77
|
+
className: y(),
|
|
78
|
+
children: [/* @__PURE__ */ r(e, {
|
|
79
|
+
variant: x,
|
|
80
|
+
className: b()
|
|
81
|
+
}), /* @__PURE__ */ i("div", {
|
|
82
|
+
className: _(),
|
|
83
|
+
children: [u && /* @__PURE__ */ r("div", {
|
|
84
|
+
className: v(),
|
|
85
|
+
children: /* @__PURE__ */ r(n, {
|
|
86
|
+
variant: "h6",
|
|
87
|
+
color: "inherit",
|
|
88
|
+
component: h,
|
|
89
|
+
children: u
|
|
90
|
+
})
|
|
91
|
+
}), d]
|
|
92
|
+
})]
|
|
93
|
+
}), f && /* @__PURE__ */ r(t, {
|
|
94
|
+
variant: "tertiary",
|
|
95
|
+
icon: "closer",
|
|
96
|
+
size: "small",
|
|
97
|
+
label: "Schließen",
|
|
98
|
+
onClick: p
|
|
99
|
+
})]
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
//#endregion
|
|
103
|
+
export { c as default };
|
|
104
|
+
|
|
105
|
+
//# sourceMappingURL=Alert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Alert.js","names":[],"sources":["../../../src/components/Alert/Alert.tsx"],"sourcesContent":["\"use client\";\n\nimport Icon, { type IconType } from \"@bonprix-ds/react-icon\";\nimport IconButton from \"@bonprix-ds/react-icon-button\";\nimport Typography from \"@bonprix-ds/react-typography\";\nimport React, { FC } from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { levels, values } from \"./constants\";\n\nconst generateClasses = tv({\n slots: {\n root: \"preflight m-0 flex justify-between items-start p-5 rounded gap-4\",\n iconAndContent: \"flex gap-2\",\n content: \"typography-body1 text-clr-on-bg-high gap-0.5 pt-0.5\",\n title: \"\",\n icon: \"\",\n },\n variants: {\n status: {\n success: {\n root: \"bg-clr-bg-success\",\n title: \"text-clr-fg-success\",\n icon: \"fill-clr-fg-success\",\n },\n info: {\n root: \"bg-clr-bg-info\",\n title: \"text-clr-fg-info\",\n icon: \"fill-clr-fg-info\",\n },\n warning: {\n root: \"bg-clr-bg-alert\",\n title: \"text-clr-fg-alert\",\n icon: \"fill-clr-fg-alert\",\n },\n error: {\n root: \"bg-clr-bg-error\",\n title: \"text-clr-fg-error\",\n icon: \"fill-clr-fg-error\",\n },\n },\n alertVariant: {\n primary: {\n title: \"text-clr-on-bg-high\",\n },\n secondary: {\n root: \"p-0 rounded-none bg-transparent\",\n },\n },\n },\n});\n\ntype StatusLevel = (typeof levels)[number];\ntype VariantValue = (typeof values)[number];\n\nexport interface Props {\n /** Toggles the visibility of the component. Must be used in conjunction with `onClose`. */\n isOpen: boolean;\n /** The status of the alert. The colors and the icon of the component will adjust appropriately to signal the status level.*/\n status: StatusLevel;\n /** The message of the alert. */\n children: string;\n /** Callback, which is triggered when the visibility of the component (opened/closed) changes. Should be used to control the component from the outside, if the user clicks on the close icon. */\n onClose?: () => void;\n /** Variant of the alert. Depends on the prominence level you require. */\n variant?: VariantValue;\n /** An optional title of the alert. The titel sums up the message briefly. */\n title?: string;\n /** Controls, if the close icon should be shown. When the alert shoulnd't be closed actively, this property can be set to `false`. */\n showCloseIcon?: boolean;\n /** Removes role=\"alert\" from component if set to `true`. The alert content is not read by assistive technologies right away then. */\n nonCritical?: boolean;\n /** If `title` is used, you can define the used header element. */\n titleTag?: \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\";\n}\n\ninterface AlertMap {\n icon: IconType;\n label: string;\n}\n\nconst alertVariants: Record<StatusLevel, AlertMap> = {\n warning: {\n icon: \"alert\",\n label: \"Warnung\",\n },\n info: {\n icon: \"hint\",\n label: \"Hinweis\",\n },\n success: {\n icon: \"success\",\n label: \"Erfolg\",\n },\n error: {\n icon: \"error\",\n label: \"Fehler\",\n },\n};\n\nconst Alert: FC<Props> = ({\n isOpen,\n variant = \"primary\",\n status,\n title,\n children,\n showCloseIcon = true,\n onClose = () => null,\n nonCritical = false,\n titleTag = \"h2\",\n}) => {\n const { root, content, title: titleStyle, iconAndContent, icon } = generateClasses({ status, alertVariant: variant });\n if (!isOpen) return null;\n\n const iconVariant = alertVariants[status].icon;\n const statusAriaLabel = alertVariants[status].label;\n const closeLabel = \"Schließen\";\n\n return (\n <div\n className={root()}\n role={nonCritical ? undefined : \"alert\"}\n aria-label={statusAriaLabel}\n data-bpds=\"alert\"\n data-bpds-status={status}\n data-bpds-variant={variant}\n >\n <div className={iconAndContent()}>\n <Icon variant={iconVariant} className={icon()} />\n <div className={content()}>\n {title && (\n <div className={titleStyle()}>\n <Typography variant=\"h6\" color=\"inherit\" component={titleTag}>\n {title}\n </Typography>\n </div>\n )}\n {children}\n </div>\n </div>\n {showCloseIcon && <IconButton variant=\"tertiary\" icon=\"closer\" size=\"small\" label={closeLabel} onClick={onClose} />}\n </div>\n );\n};\n\nexport default Alert;\n"],"mappings":";;;;;;;;AAUA,IAAM,IAAkB,EAAG;CACzB,OAAO;EACL,MAAM;EACN,gBAAgB;EAChB,SAAS;EACT,OAAO;EACP,MAAM;CACR;CACA,UAAU;EACR,QAAQ;GACN,SAAS;IACP,MAAM;IACN,OAAO;IACP,MAAM;GACR;GACA,MAAM;IACJ,MAAM;IACN,OAAO;IACP,MAAM;GACR;GACA,SAAS;IACP,MAAM;IACN,OAAO;IACP,MAAM;GACR;GACA,OAAO;IACL,MAAM;IACN,OAAO;IACP,MAAM;GACR;EACF;EACA,cAAc;GACZ,SAAS,EACP,OAAO,sBACT;GACA,WAAW,EACT,MAAM,kCACR;EACF;CACF;AACF,CAAC,GA+BK,IAA+C;CACnD,SAAS;EACP,MAAM;EACN,OAAO;CACT;CACA,MAAM;EACJ,MAAM;EACN,OAAO;CACT;CACA,SAAS;EACP,MAAM;EACN,OAAO;CACT;CACA,OAAO;EACL,MAAM;EACN,OAAO;CACT;AACF,GAEM,KAAoB,EACxB,WACA,aAAU,WACV,WACA,UACA,aACA,mBAAgB,IAChB,mBAAgB,MAChB,iBAAc,IACd,cAAW,WACP;CACJ,IAAM,EAAE,SAAM,YAAS,OAAO,GAAY,mBAAgB,YAAS,EAAgB;EAAE;EAAQ,cAAc;CAAQ,CAAC;CACpH,IAAI,CAAC,GAAQ,OAAO;CAEpB,IAAM,IAAc,EAAc,EAAO,CAAC,MACpC,IAAkB,EAAc,EAAO,CAAC;CAG9C,OACE,kBAAC,OAAD;EACE,WAAW,EAAK;EAChB,MAAM,IAAc,KAAA,IAAY;EAChC,cAAY;EACZ,aAAU;EACV,oBAAkB;EAClB,qBAAmB;YANrB,CAQE,kBAAC,OAAD;GAAK,WAAW,EAAe;aAA/B,CACE,kBAAC,GAAD;IAAM,SAAS;IAAa,WAAW,EAAK;GAAI,CAAA,GAChD,kBAAC,OAAD;IAAK,WAAW,EAAQ;cAAxB,CACG,KACC,kBAAC,OAAD;KAAK,WAAW,EAAW;eACzB,kBAAC,GAAD;MAAY,SAAQ;MAAK,OAAM;MAAU,WAAW;gBACjD;KACS,CAAA;IACT,CAAA,GAEN,CACE;KACF;MACJ,KAAiB,kBAAC,GAAD;GAAY,SAAQ;GAAW,MAAK;GAAS,MAAK;GAAQ,OAAO;GAAY,SAAS;EAAU,CAAA,CAC/G;;AAET"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/Alert/index.ts"],"sourcesContent":["import Alert from \"./Alert\";\n\nexport default Alert;\nexport type { Props as AlertProps } from \"./Alert\";\nexport * from \"./constants\";\n"],"mappings":";;AAEA,IAAA,IAAe"}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import e from "../../react/icon-button/dist/index.js";
|
|
3
|
+
import t from "../../react/typography/dist/index.js";
|
|
4
|
+
import { usePrefersReducedMotion as n } from "../../utils/dist/index.js";
|
|
5
|
+
import r from "../Buttons/Button/index.js";
|
|
6
|
+
import i from "../../contexts/ZIndexContext.js";
|
|
7
|
+
import a from "../../hooks/useInnerOpen.js";
|
|
8
|
+
import { backdrop as o } from "../../utils/tailwindVariants.js";
|
|
9
|
+
import s from "./BottomSheetContext.js";
|
|
10
|
+
import c from "./useConsumeBottomSheet.js";
|
|
11
|
+
import l from "./useCreateBottomSheet.js";
|
|
12
|
+
import { useId as u } from "react";
|
|
13
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
14
|
+
import { tv as p } from "tailwind-variants";
|
|
15
|
+
import { Sheet as m } from "react-modal-sheet";
|
|
16
|
+
//#region src/components/BottomSheet/BottomSheet.tsx
|
|
17
|
+
var h = p({
|
|
18
|
+
slots: {
|
|
19
|
+
root: "preflight block",
|
|
20
|
+
container: "shadow-none rounded-none bg-clr-bg-modal max-h-[calc(100%-64px)]",
|
|
21
|
+
header: "px-4 py-3",
|
|
22
|
+
titleAndIcons: "flex gap-2 items-center touch-pan-down",
|
|
23
|
+
contentWrapper: "flex flex-col w-full",
|
|
24
|
+
content: [
|
|
25
|
+
"typography-body1 text-clr-primary",
|
|
26
|
+
"*:flex *:-mx-0.5 *:px-0.5",
|
|
27
|
+
"*:min-h-0"
|
|
28
|
+
],
|
|
29
|
+
dragHandleContainer: "h-6 flex justify-center items-center shrink-0",
|
|
30
|
+
dragHandle: "h-1 w-8 rounded-full bg-clr-on-bg-low",
|
|
31
|
+
buttonSection: "w-full flex flex-col gap-3 px-4 pt-4 shrink-0 touch-pan-down",
|
|
32
|
+
backdrop: o(),
|
|
33
|
+
scrollArea: "scroll-area"
|
|
34
|
+
},
|
|
35
|
+
variants: { disableHorizontalPadding: {
|
|
36
|
+
false: { scrollArea: "px-4" },
|
|
37
|
+
true: ""
|
|
38
|
+
} }
|
|
39
|
+
}), g = ({ children: e, isOpen: t, onClose: r, onBack: o, zIndex: c = 2, ref: p }) => {
|
|
40
|
+
let g = n(), { root: _, container: v, dragHandleContainer: y, dragHandle: b, content: x, contentWrapper: S, backdrop: C } = h(), { isShown: w, scrollRef: T, scrollPosition: E } = l({ isOpen: t }), D = E === "middle" || E === "bottom", { innerOpen: O } = a(w), k = u();
|
|
41
|
+
return /* @__PURE__ */ f(m, {
|
|
42
|
+
isOpen: O,
|
|
43
|
+
onClose: r,
|
|
44
|
+
className: _(),
|
|
45
|
+
detent: "content",
|
|
46
|
+
"data-bpds": "bottom-sheet",
|
|
47
|
+
prefersReducedMotion: g,
|
|
48
|
+
style: {
|
|
49
|
+
"--touch-action": D ? "initial" : "pan-down",
|
|
50
|
+
pointerEvents: void 0
|
|
51
|
+
},
|
|
52
|
+
role: "dialog",
|
|
53
|
+
avoidKeyboard: !1,
|
|
54
|
+
"aria-labelledby": k,
|
|
55
|
+
children: [/* @__PURE__ */ f(m.Container, {
|
|
56
|
+
className: v(),
|
|
57
|
+
ref: p,
|
|
58
|
+
style: {
|
|
59
|
+
zIndex: c,
|
|
60
|
+
pointerEvents: void 0
|
|
61
|
+
},
|
|
62
|
+
children: [/* @__PURE__ */ d(m.Header, {
|
|
63
|
+
unstyled: !0,
|
|
64
|
+
className: y(),
|
|
65
|
+
children: /* @__PURE__ */ d(m.DragIndicator, {
|
|
66
|
+
unstyled: !0,
|
|
67
|
+
className: b()
|
|
68
|
+
})
|
|
69
|
+
}), /* @__PURE__ */ d(i.Provider, {
|
|
70
|
+
value: 1e4,
|
|
71
|
+
children: /* @__PURE__ */ d(s.Provider, {
|
|
72
|
+
value: {
|
|
73
|
+
scrollRef: T,
|
|
74
|
+
scrollPosition: E,
|
|
75
|
+
onClose: r,
|
|
76
|
+
onBack: o,
|
|
77
|
+
titleId: k
|
|
78
|
+
},
|
|
79
|
+
children: /* @__PURE__ */ d(m.Content, {
|
|
80
|
+
className: x(),
|
|
81
|
+
disableScroll: !0,
|
|
82
|
+
disableDrag: D,
|
|
83
|
+
style: { paddingBottom: "max(var(--keyboard-inset-height, 0px), var(--app-safe-area-inset-bottom, 1rem))" },
|
|
84
|
+
children: /* @__PURE__ */ d("div", {
|
|
85
|
+
className: S(),
|
|
86
|
+
children: e
|
|
87
|
+
})
|
|
88
|
+
})
|
|
89
|
+
})
|
|
90
|
+
})]
|
|
91
|
+
}), /* @__PURE__ */ d(m.Backdrop, {
|
|
92
|
+
"aria-label": "Bottom Sheet schließen",
|
|
93
|
+
onTap: r,
|
|
94
|
+
className: C(),
|
|
95
|
+
style: { zIndex: c - 1 }
|
|
96
|
+
})]
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
g.displayName = "BottomSheet", g.Title = ({ children: n, subline: r, level: i = "h3" }) => {
|
|
100
|
+
let { onBack: a, onClose: o, titleId: s } = c(), { header: l, titleAndIcons: u } = h();
|
|
101
|
+
return /* @__PURE__ */ f("div", {
|
|
102
|
+
className: l(),
|
|
103
|
+
children: [/* @__PURE__ */ f("div", {
|
|
104
|
+
className: u(),
|
|
105
|
+
children: [
|
|
106
|
+
a && /* @__PURE__ */ d(e, {
|
|
107
|
+
onClick: a,
|
|
108
|
+
icon: "arrow-left",
|
|
109
|
+
label: "Zurück",
|
|
110
|
+
variant: "tertiary",
|
|
111
|
+
size: "small"
|
|
112
|
+
}),
|
|
113
|
+
/* @__PURE__ */ d(t, {
|
|
114
|
+
variant: "bonprix-h6",
|
|
115
|
+
component: i,
|
|
116
|
+
className: "grow line-clamp-2",
|
|
117
|
+
id: s,
|
|
118
|
+
children: n
|
|
119
|
+
}),
|
|
120
|
+
/* @__PURE__ */ d(e, {
|
|
121
|
+
onClick: o,
|
|
122
|
+
icon: "closer",
|
|
123
|
+
label: "Schließen",
|
|
124
|
+
variant: "tertiary",
|
|
125
|
+
size: "small"
|
|
126
|
+
})
|
|
127
|
+
]
|
|
128
|
+
}), r && /* @__PURE__ */ d(t, { children: r })]
|
|
129
|
+
});
|
|
130
|
+
}, g.Content = ({ children: e, disableHorizontalPadding: t = !1 }) => {
|
|
131
|
+
let { scrollRef: n } = c(), { scrollArea: r } = h({ disableHorizontalPadding: t });
|
|
132
|
+
return /* @__PURE__ */ d("div", {
|
|
133
|
+
ref: n,
|
|
134
|
+
className: r(),
|
|
135
|
+
"data-bpds-disable-horizontal-padding": t,
|
|
136
|
+
children: e
|
|
137
|
+
});
|
|
138
|
+
}, g.ButtonSection = ({ children: e }) => /* @__PURE__ */ d("div", {
|
|
139
|
+
className: "button-section w-full flex flex-col gap-3 px-4 pt-4 shrink-0 touch-pan-down",
|
|
140
|
+
children: e
|
|
141
|
+
}), g.PrimaryButton = ({ children: e, onClick: t, type: n = "button", form: i, icon: a, iconPosition: o, disabled: s, loading: l }) => {
|
|
142
|
+
let { onClose: u } = c();
|
|
143
|
+
return /* @__PURE__ */ d(r, {
|
|
144
|
+
variant: "primary",
|
|
145
|
+
onClick: (e) => {
|
|
146
|
+
t && t(e), u();
|
|
147
|
+
},
|
|
148
|
+
type: n,
|
|
149
|
+
form: i,
|
|
150
|
+
icon: a,
|
|
151
|
+
iconPosition: o,
|
|
152
|
+
size: "large",
|
|
153
|
+
disabled: s,
|
|
154
|
+
loading: l,
|
|
155
|
+
children: e
|
|
156
|
+
});
|
|
157
|
+
}, g.SecondaryButton = ({ children: e, icon: t, iconPosition: n }) => {
|
|
158
|
+
let { onClose: i } = c();
|
|
159
|
+
return /* @__PURE__ */ d(r, {
|
|
160
|
+
variant: "secondary",
|
|
161
|
+
type: "button",
|
|
162
|
+
onClick: i,
|
|
163
|
+
icon: t,
|
|
164
|
+
iconPosition: n,
|
|
165
|
+
size: "large",
|
|
166
|
+
children: e
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
//#endregion
|
|
170
|
+
export { g as default };
|
|
171
|
+
|
|
172
|
+
//# sourceMappingURL=BottomSheet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BottomSheet.js","names":[],"sources":["../../../src/components/BottomSheet/BottomSheet.tsx"],"sourcesContent":["\"use client\";\n\nimport { type IconType } from \"@bonprix-ds/react-icon\";\nimport IconButton from \"@bonprix-ds/react-icon-button\";\nimport Typography from \"@bonprix-ds/react-typography\";\nimport { ButtonTypeAttribute, TitleLevel, usePrefersReducedMotion } from \"@bonprix-ds/utils\";\nimport React, { FC, ReactNode, Ref, useId } from \"react\";\nimport { Sheet } from \"react-modal-sheet\";\nimport { tv } from \"tailwind-variants\";\n\nimport { Button } from \"@components/Buttons\";\nimport ZIndexContext from \"@contexts/ZIndexContext\";\nimport { useInnerOpen } from \"@hooks\";\nimport { backdrop } from \"@utils/tailwindVariants\";\n\nimport BottomSheetContext from \"./BottomSheetContext\";\nimport useConsumeBottomSheet from \"./useConsumeBottomSheet\";\nimport useCreateBottomSheet from \"./useCreateBottomSheet\";\n\nconst generateClasses = tv({\n slots: {\n root: \"preflight block\",\n container: \"shadow-none rounded-none bg-clr-bg-modal max-h-[calc(100%-64px)]\",\n header: \"px-4 py-3\",\n titleAndIcons: \"flex gap-2 items-center touch-pan-down\",\n contentWrapper: \"flex flex-col w-full\",\n content: [\n \"typography-body1 text-clr-primary\",\n // scroller must be a flexbox to fix scrollbar\n // scroller needs some padding to not cut off the focus-ring\n \"*:flex *:-mx-0.5 *:px-0.5\",\n // scroller must set min-h-0 in order to make scrolling work inside our flex context\n \"*:min-h-0\",\n ],\n dragHandleContainer: \"h-6 flex justify-center items-center shrink-0\",\n dragHandle: \"h-1 w-8 rounded-full bg-clr-on-bg-low\",\n buttonSection: \"w-full flex flex-col gap-3 px-4 pt-4 shrink-0 touch-pan-down\",\n backdrop: backdrop(),\n scrollArea: \"scroll-area\",\n },\n variants: {\n disableHorizontalPadding: {\n false: { scrollArea: \"px-4\" },\n true: \"\",\n },\n },\n});\n\ninterface SheetProps {\n /** All of the subcomponents should be placed inside this property. */\n children: ReactNode;\n /** Toggles the visibility of the sheet. Should be used in conjunction with the `onClose` property. */\n isOpen: boolean;\n /** Callback function, that is triggered when the sheet is attempted to be closed.\n *\n * It will be called in following cases:\n * - Click on backdrop\n * - Swipe down to close\n * - Click on \"close\" icon button in the upper-right corner\n * - Click on any button (PrimaryButton or SecondaryButton)\n *\n * Should be used in conjunction with `isOpen`. */\n onClose: () => void;\n /** Callback to execute when clicking back icon. */\n onBack?: () => void;\n /** The z-index of the sheet.. */\n zIndex?: number;\n}\n\ninterface SheetTitleProps {\n /** The text content. */\n children: string;\n /** An optional subline that is displayed right below the title. */\n subline?: string;\n /** The heading level for the title. */\n level?: TitleLevel;\n}\n\ninterface SheetButtonSectionProps {\n /** Primary and secondary buttons should be placed inside this section. */\n children: ReactNode;\n}\n\ninterface SheetContentProps {\n /** The content of the content section. */\n children: ReactNode;\n /** If `true`, the horizontal padding around the content will be removed. */\n disableHorizontalPadding?: boolean;\n}\n\nexport interface SheetButtonProps {\n /** The label of the button. */\n children: string;\n /** If used, an icon will be additionally shown. The value is a name of one icon from our icon set. */\n icon?: IconType;\n /** The position of the icon relative to the content. */\n iconPosition?: \"start\" | \"end\";\n}\n\ninterface SheetPrimaryButtonProps extends SheetButtonProps {\n /** Callback, which is triggered when the button is activated. */\n onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n /** The type attribute of the button. */\n type?: ButtonTypeAttribute;\n /** Standard HTML attribute. Read more on <a href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/button#form\">MDN, Button Element - form</a>. */\n form?: string;\n /** If `true`, the button will be disabled and thus not interactable. */\n disabled?: boolean;\n /** If `true`, a loading spinner will be shown instead of the content. */\n loading?: boolean;\n}\n\ninterface SheetSubcomponents {\n Title: typeof Title;\n Content: typeof Content;\n ButtonSection: typeof ButtonSection;\n PrimaryButton: typeof PrimaryButton;\n SecondaryButton: typeof SecondaryButton;\n}\n\nexport interface Props extends SheetProps {\n /** A reference to the root element of the sheet. */\n ref?: Ref<HTMLDivElement>;\n}\n\nconst BottomSheet: FC<Props> & SheetSubcomponents = ({ children, isOpen, onClose, onBack, zIndex = 2, ref }) => {\n // TODO: add aria-modal = true once we implemented the dialog pattern fully and i.e. manage the focus\n const prefersReducedMotion = usePrefersReducedMotion();\n const { root, container, dragHandleContainer, dragHandle, content, contentWrapper, backdrop } = generateClasses();\n const { isShown, scrollRef, scrollPosition } = useCreateBottomSheet({ isOpen });\n\n // When \"middle\" or \"bottom\", dragging is disabled to allow for regular scrolling.\n // When at \"top\", we need to enable drag to close. When `undefined`, the element is not scrollable and can be dragged, too.\n const disableDrag = scrollPosition === \"middle\" || scrollPosition === \"bottom\";\n\n const { innerOpen } = useInnerOpen(isShown);\n\n const titleId = useId();\n\n return (\n <Sheet\n isOpen={innerOpen}\n onClose={onClose}\n className={root()}\n detent=\"content\"\n data-bpds=\"bottom-sheet\"\n prefersReducedMotion={prefersReducedMotion}\n // @ts-expect-error setting custom properties is not recognized by React.CSSProperties\n // This is consumed by the inner ScrollArea to fix drag to close.\n // We remove `pointer-events` handling from the library because it interfers with a lot of things like opened Selects that wouldn't close etc.\n style={{ \"--touch-action\": disableDrag ? \"initial\" : \"pan-down\", pointerEvents: undefined }}\n role=\"dialog\"\n avoidKeyboard={false}\n aria-labelledby={titleId}\n >\n {/* We remove `pointer-events` handling from the library because it interfers with a lot of things like opened Selects that wouldn't close etc. */}\n <Sheet.Container className={container()} ref={ref} style={{ zIndex, pointerEvents: undefined }}>\n <Sheet.Header unstyled className={dragHandleContainer()}>\n <Sheet.DragIndicator unstyled className={dragHandle()} />\n </Sheet.Header>\n <ZIndexContext.Provider value={10000}>\n <BottomSheetContext.Provider value={{ scrollRef, scrollPosition, onClose, onBack, titleId }}>\n <Sheet.Content\n className={content()}\n // disable default scrolling\n disableScroll\n // Dragging is still managed by `Sheet.Content` so we control it here\n disableDrag={disableDrag}\n // Apply keyboard height as padding bottom to keep content above the keyboard\n style={{ paddingBottom: \"max(var(--keyboard-inset-height, 0px), var(--app-safe-area-inset-bottom, 1rem))\" }}\n >\n <div className={contentWrapper()}>{children}</div>\n </Sheet.Content>\n </BottomSheetContext.Provider>\n </ZIndexContext.Provider>\n </Sheet.Container>\n {/* TODO: Deactivate the animation, when the user prefers reduced motion: https://github.com/Temzasse/react-modal-sheet/issues/227 */}\n <Sheet.Backdrop aria-label=\"Bottom Sheet schließen\" onTap={onClose} className={backdrop()} style={{ zIndex: zIndex - 1 }} />\n </Sheet>\n );\n};\n\nexport default BottomSheet;\n\nconst Title = ({ children, subline, level = \"h3\" }: SheetTitleProps) => {\n const { onBack, onClose, titleId } = useConsumeBottomSheet();\n const { header, titleAndIcons } = generateClasses();\n return (\n <div className={header()}>\n <div className={titleAndIcons()}>\n {onBack && <IconButton onClick={onBack} icon=\"arrow-left\" label=\"Zurück\" variant=\"tertiary\" size=\"small\" />}\n <Typography variant=\"bonprix-h6\" component={level} className=\"grow line-clamp-2\" id={titleId}>\n {children}\n </Typography>\n <IconButton onClick={onClose} icon=\"closer\" label=\"Schließen\" variant=\"tertiary\" size=\"small\" />\n </div>\n {subline && <Typography>{subline}</Typography>}\n </div>\n );\n};\n\nconst Content = ({ children, disableHorizontalPadding = false }: SheetContentProps) => {\n const { scrollRef: setScrollRef } = useConsumeBottomSheet();\n const { scrollArea } = generateClasses({ disableHorizontalPadding });\n\n return (\n <div ref={setScrollRef} className={scrollArea()} data-bpds-disable-horizontal-padding={disableHorizontalPadding}>\n {children}\n </div>\n );\n};\n\nconst ButtonSection = ({ children }: SheetButtonSectionProps) => {\n return <div className=\"button-section w-full flex flex-col gap-3 px-4 pt-4 shrink-0 touch-pan-down\">{children}</div>;\n};\n\nconst PrimaryButton = ({ children, onClick, type = \"button\", form, icon, iconPosition, disabled, loading }: SheetPrimaryButtonProps) => {\n const { onClose } = useConsumeBottomSheet();\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n if (onClick) {\n onClick(event);\n }\n onClose();\n };\n return (\n <Button\n variant=\"primary\"\n onClick={handleClick}\n type={type}\n form={form}\n icon={icon}\n iconPosition={iconPosition}\n size=\"large\"\n disabled={disabled}\n loading={loading}\n >\n {children}\n </Button>\n );\n};\n\nconst SecondaryButton = ({ children, icon, iconPosition }: SheetButtonProps) => {\n const { onClose } = useConsumeBottomSheet();\n return (\n <Button variant=\"secondary\" type=\"button\" onClick={onClose} icon={icon} iconPosition={iconPosition} size=\"large\">\n {children}\n </Button>\n );\n};\n\nBottomSheet.displayName = \"BottomSheet\";\n\nBottomSheet.Title = Title;\nBottomSheet.Content = Content;\nBottomSheet.ButtonSection = ButtonSection;\nBottomSheet.PrimaryButton = PrimaryButton;\nBottomSheet.SecondaryButton = SecondaryButton;\n"],"mappings":";;;;;;;;;;;;;;;;AAmBA,IAAM,IAAkB,EAAG;CACzB,OAAO;EACL,MAAM;EACN,WAAW;EACX,QAAQ;EACR,eAAe;EACf,gBAAgB;EAChB,SAAS;GACP;GAGA;GAEA;EACF;EACA,qBAAqB;EACrB,YAAY;EACZ,eAAe;EACf,UAAU,EAAS;EACnB,YAAY;CACd;CACA,UAAU,EACR,0BAA0B;EACxB,OAAO,EAAE,YAAY,OAAO;EAC5B,MAAM;CACR,EACF;AACF,CAAC,GA+EK,KAA+C,EAAE,aAAU,WAAQ,YAAS,WAAQ,YAAS,GAAG,aAAU;CAE9G,IAAM,IAAuB,EAAwB,GAC/C,EAAE,SAAM,cAAW,wBAAqB,eAAY,YAAS,mBAAgB,gBAAa,EAAgB,GAC1G,EAAE,YAAS,cAAW,sBAAmB,EAAqB,EAAE,UAAO,CAAC,GAIxE,IAAc,MAAmB,YAAY,MAAmB,UAEhE,EAAE,iBAAc,EAAa,CAAO,GAEpC,IAAU,EAAM;CAEtB,OACE,kBAAC,GAAD;EACE,QAAQ;EACC;EACT,WAAW,EAAK;EAChB,QAAO;EACP,aAAU;EACY;EAItB,OAAO;GAAE,kBAAkB,IAAc,YAAY;GAAY,eAAe,KAAA;EAAU;EAC1F,MAAK;EACL,eAAe;EACf,mBAAiB;YAbnB,CAgBE,kBAAC,EAAM,WAAP;GAAiB,WAAW,EAAU;GAAQ;GAAK,OAAO;IAAE;IAAQ,eAAe,KAAA;GAAU;aAA7F,CACE,kBAAC,EAAM,QAAP;IAAc,UAAA;IAAS,WAAW,EAAoB;cACpD,kBAAC,EAAM,eAAP;KAAqB,UAAA;KAAS,WAAW,EAAW;IAAI,CAAA;GAC5C,CAAA,GACd,kBAAC,EAAc,UAAf;IAAwB,OAAO;cAC7B,kBAAC,EAAmB,UAApB;KAA6B,OAAO;MAAE;MAAW;MAAgB;MAAS;MAAQ;KAAQ;eACxF,kBAAC,EAAM,SAAP;MACE,WAAW,EAAQ;MAEnB,eAAA;MAEa;MAEb,OAAO,EAAE,eAAe,kFAAkF;gBAE1G,kBAAC,OAAD;OAAK,WAAW,EAAe;OAAI;MAAc,CAAA;KACpC,CAAA;IACY,CAAA;GACP,CAAA,CACT;MAEjB,kBAAC,EAAM,UAAP;GAAgB,cAAW;GAAyB,OAAO;GAAS,WAAW,EAAS;GAAG,OAAO,EAAE,QAAQ,IAAS,EAAE;EAAI,CAAA,CACtH;;AAEX;AAsEA,EAAY,cAAc,eAE1B,EAAY,SApEG,EAAE,aAAU,YAAS,WAAQ,WAA4B;CACtE,IAAM,EAAE,WAAQ,YAAS,eAAY,EAAsB,GACrD,EAAE,WAAQ,qBAAkB,EAAgB;CAClD,OACE,kBAAC,OAAD;EAAK,WAAW,EAAO;YAAvB,CACE,kBAAC,OAAD;GAAK,WAAW,EAAc;aAA9B;IACG,KAAU,kBAAC,GAAD;KAAY,SAAS;KAAQ,MAAK;KAAa,OAAM;KAAS,SAAQ;KAAW,MAAK;IAAS,CAAA;IAC1G,kBAAC,GAAD;KAAY,SAAQ;KAAa,WAAW;KAAO,WAAU;KAAoB,IAAI;KAClF;IACS,CAAA;IACZ,kBAAC,GAAD;KAAY,SAAS;KAAS,MAAK;KAAS,OAAM;KAAY,SAAQ;KAAW,MAAK;IAAS,CAAA;GAC5F;MACJ,KAAW,kBAAC,GAAD,EAAA,UAAa,EAAoB,CAAA,CAC1C;;AAET,GAsDA,EAAY,WApDK,EAAE,aAAU,8BAA2B,SAA+B;CACrF,IAAM,EAAE,WAAW,MAAiB,EAAsB,GACpD,EAAE,kBAAe,EAAgB,EAAE,4BAAyB,CAAC;CAEnE,OACE,kBAAC,OAAD;EAAK,KAAK;EAAc,WAAW,EAAW;EAAG,wCAAsC;EACpF;CACE,CAAA;AAET,GA4CA,EAAY,iBA1CW,EAAE,kBAChB,kBAAC,OAAD;CAAK,WAAU;CAA+E;AAAc,CAAA,GA0CrH,EAAY,iBAvCW,EAAE,aAAU,YAAS,UAAO,UAAU,SAAM,SAAM,iBAAc,aAAU,iBAAuC;CACtI,IAAM,EAAE,eAAY,EAAsB;CAO1C,OACE,kBAAC,GAAD;EACE,SAAQ;EACR,UATiB,MAA+C;GAIlE,AAHI,KACF,EAAQ,CAAK,GAEf,EAAQ;EACV;EAKU;EACA;EACA;EACQ;EACd,MAAK;EACK;EACD;EAER;CACK,CAAA;AAEZ,GAiBA,EAAY,mBAfa,EAAE,aAAU,SAAM,sBAAqC;CAC9E,IAAM,EAAE,eAAY,EAAsB;CAC1C,OACE,kBAAC,GAAD;EAAQ,SAAQ;EAAY,MAAK;EAAS,SAAS;EAAe;EAAoB;EAAc,MAAK;EACtG;CACK,CAAA;AAEZ"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContext as e } from "react";
|
|
3
|
+
//#region src/components/BottomSheet/BottomSheetContext.ts
|
|
4
|
+
var t = e({
|
|
5
|
+
scrollRef: () => null,
|
|
6
|
+
scrollPosition: void 0,
|
|
7
|
+
onClose: () => null,
|
|
8
|
+
onBack: () => null
|
|
9
|
+
});
|
|
10
|
+
//#endregion
|
|
11
|
+
export { t as default };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=BottomSheetContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BottomSheetContext.js","names":[],"sources":["../../../src/components/BottomSheet/BottomSheetContext.ts"],"sourcesContent":["\"use client\";\n\nimport { createContext } from \"react\";\nimport { useScrollPosition } from \"react-modal-sheet\";\n\nexport interface BottomSheetContextProps {\n scrollRef: ReturnType<typeof useScrollPosition>[\"scrollRef\"];\n scrollPosition: ReturnType<typeof useScrollPosition>[\"scrollPosition\"];\n onClose: () => void;\n onBack?: () => void;\n titleId?: string;\n}\n\nconst BottomSheetContext = createContext<BottomSheetContextProps>({\n scrollRef: () => null,\n scrollPosition: undefined,\n onClose: () => null,\n onBack: () => null,\n});\n\nexport default BottomSheetContext;\n"],"mappings":";;;AAaA,IAAM,IAAqB,EAAuC;CAChE,iBAAiB;CACjB,gBAAgB,KAAA;CAChB,eAAe;CACf,cAAc;AAChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/BottomSheet/index.ts"],"sourcesContent":["import BottomSheet from \"./BottomSheet\";\n\nexport default BottomSheet;\nexport type { Props as BottomSheetProps } from \"./BottomSheet\";\n"],"mappings":";;AAEA,IAAA,IAAe"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useConsumeBottomSheet.js","names":[],"sources":["../../../src/components/BottomSheet/useConsumeBottomSheet.ts"],"sourcesContent":["import { useContext } from \"react\";\n\nimport BottomSheetContext from \"./BottomSheetContext\";\n\nconst useConsumeBottomSheet = () => {\n return useContext(BottomSheetContext);\n};\n\nexport default useConsumeBottomSheet;\n"],"mappings":";;;AAIA,IAAM,UACG,EAAW,CAAkB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import e from "../../hooks/useBreakpointBetween.js";
|
|
2
|
+
import { useEffect as t } from "react";
|
|
3
|
+
import { useScrollPosition as n, useVirtualKeyboard as r } from "react-modal-sheet";
|
|
4
|
+
//#region src/components/BottomSheet/useCreateBottomSheet.ts
|
|
5
|
+
var i = ({ isOpen: i }) => {
|
|
6
|
+
let a = e("s", "m") && i, { scrollRef: o, scrollPosition: s } = n({ isEnabled: a });
|
|
7
|
+
return r({ isEnabled: i }), t(() => {
|
|
8
|
+
i ? document.dispatchEvent(new CustomEvent("app:enableSwipeToRefresh", { detail: { enable: !1 } })) : document.dispatchEvent(new CustomEvent("app:enableSwipeToRefresh", { detail: { enable: !0 } }));
|
|
9
|
+
}, [i]), {
|
|
10
|
+
isShown: a,
|
|
11
|
+
scrollRef: o,
|
|
12
|
+
scrollPosition: s
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { i as default };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=useCreateBottomSheet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCreateBottomSheet.js","names":[],"sources":["../../../src/components/BottomSheet/useCreateBottomSheet.ts"],"sourcesContent":["import { useEffect } from \"react\";\nimport { useScrollPosition, useVirtualKeyboard } from \"react-modal-sheet\";\n\nimport { useBreakpointBetween } from \"@hooks\";\n\ninterface UseBottomSheetProps {\n isOpen: boolean;\n}\n\nconst useCreateBottomSheet = ({ isOpen }: UseBottomSheetProps) => {\n const isSmallScreen = useBreakpointBetween(\"s\", \"m\");\n const isShown = isSmallScreen && isOpen;\n\n const { scrollRef, scrollPosition } = useScrollPosition({\n isEnabled: isShown,\n });\n\n useVirtualKeyboard({ isEnabled: isOpen });\n\n // Disable swipe-to-refresh for the app: // https://bonprix.atlassian.net/wiki/spaces/App/pages/368706073/Javascript\n useEffect(() => {\n if (isOpen) {\n document.dispatchEvent(new CustomEvent(\"app:enableSwipeToRefresh\", { detail: { enable: false } }));\n } else {\n document.dispatchEvent(new CustomEvent(\"app:enableSwipeToRefresh\", { detail: { enable: true } }));\n }\n }, [isOpen]);\n\n return {\n isShown,\n scrollRef,\n scrollPosition,\n };\n};\n\nexport default useCreateBottomSheet;\n"],"mappings":";;;;AASA,IAAM,KAAwB,EAAE,gBAAkC;CAEhE,IAAM,IADgB,EAAqB,KAAK,GAChC,KAAiB,GAE3B,EAAE,cAAW,sBAAmB,EAAkB,EACtD,WAAW,EACb,CAAC;CAaD,OAXA,EAAmB,EAAE,WAAW,EAAO,CAAC,GAGxC,QAAgB;EACd,AAAI,IACF,SAAS,cAAc,IAAI,YAAY,4BAA4B,EAAE,QAAQ,EAAE,QAAQ,GAAM,EAAE,CAAC,CAAC,IAEjG,SAAS,cAAc,IAAI,YAAY,4BAA4B,EAAE,QAAQ,EAAE,QAAQ,GAAK,EAAE,CAAC,CAAC;CAEpG,GAAG,CAAC,CAAM,CAAC,GAEJ;EACL;EACA;EACA;CACF;AACF"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import e from "../../react/icon/dist/index.js";
|
|
3
|
+
import t from "../../react/typography/dist/index.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
6
|
+
import { tv as i } from "tailwind-variants";
|
|
7
|
+
//#region src/components/Breadcrumb/Breadcrumb.tsx
|
|
8
|
+
var a = i({
|
|
9
|
+
base: "preflight flex flex-col gap-1 text-clr-on-bg-high",
|
|
10
|
+
slots: {
|
|
11
|
+
link: "flex items-center gap-1 group focus:outline-none",
|
|
12
|
+
icon: "w-7 h-7 fill-clr-on-bg-high",
|
|
13
|
+
previousPageContainer: "border border-transparent group-focus:border-clr-primary rounded-sm",
|
|
14
|
+
previousPage: ["typography-body1 pt-0.5 mx-0.5 border-b-2 border-transparent", "group-hover:border-clr-primary group-focus:group-hover:border-transparent"],
|
|
15
|
+
header: "flex gap-x-2 items-baseline flex-wrap",
|
|
16
|
+
iconWrapper: "min-w-7 min-h-7"
|
|
17
|
+
}
|
|
18
|
+
}), o = ({ currentPageTitle: i, previousPageTitle: o, previousPageUrl: s, hideHeader: c = !1, numberOfItemsText: l = "" }) => {
|
|
19
|
+
let { base: u, icon: d, previousPage: f, previousPageContainer: p, link: m, header: h, iconWrapper: g } = a();
|
|
20
|
+
return /* @__PURE__ */ r("div", {
|
|
21
|
+
className: u(),
|
|
22
|
+
"data-bpds": "breadcrumb",
|
|
23
|
+
"data-bpds-hide-header": c,
|
|
24
|
+
children: [/* @__PURE__ */ r("a", {
|
|
25
|
+
href: s,
|
|
26
|
+
className: m(),
|
|
27
|
+
children: [/* @__PURE__ */ n("span", {
|
|
28
|
+
className: g(),
|
|
29
|
+
children: /* @__PURE__ */ n(e, {
|
|
30
|
+
variant: "back",
|
|
31
|
+
className: d()
|
|
32
|
+
})
|
|
33
|
+
}), /* @__PURE__ */ n("span", {
|
|
34
|
+
className: p(),
|
|
35
|
+
children: /* @__PURE__ */ n("span", {
|
|
36
|
+
className: f(),
|
|
37
|
+
children: o
|
|
38
|
+
})
|
|
39
|
+
})]
|
|
40
|
+
}), c ? null : /* @__PURE__ */ r("div", {
|
|
41
|
+
className: h(),
|
|
42
|
+
children: [/* @__PURE__ */ n(t, {
|
|
43
|
+
variant: "bonprix-h3",
|
|
44
|
+
children: i
|
|
45
|
+
}), /* @__PURE__ */ n(t, {
|
|
46
|
+
color: "on-bg-low",
|
|
47
|
+
children: l
|
|
48
|
+
})]
|
|
49
|
+
})]
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
//#endregion
|
|
53
|
+
export { o as default };
|
|
54
|
+
|
|
55
|
+
//# sourceMappingURL=Breadcrumb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Breadcrumb.js","names":[],"sources":["../../../src/components/Breadcrumb/Breadcrumb.tsx"],"sourcesContent":["\"use client\";\n\nimport Icon from \"@bonprix-ds/react-icon\";\nimport Typography from \"@bonprix-ds/react-typography\";\nimport React, { FC } from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nconst generateClasses = tv({\n base: \"preflight flex flex-col gap-1 text-clr-on-bg-high\",\n slots: {\n link: \"flex items-center gap-1 group focus:outline-none\",\n icon: \"w-7 h-7 fill-clr-on-bg-high\",\n previousPageContainer: \"border border-transparent group-focus:border-clr-primary rounded-sm\",\n previousPage: [\n \"typography-body1 pt-0.5 mx-0.5 border-b-2 border-transparent\",\n \"group-hover:border-clr-primary group-focus:group-hover:border-transparent\",\n ],\n header: \"flex gap-x-2 items-baseline flex-wrap\",\n iconWrapper: \"min-w-7 min-h-7\",\n },\n});\n\nexport interface Props {\n /** Title of the current page. */\n currentPageTitle: string;\n /** Title of the previous page. */\n previousPageTitle: string;\n /** URL of the previous page */\n previousPageUrl: string;\n /** Will completely hide the title of the current page and the amount of items, if set to `true`. */\n hideHeader?: boolean;\n /** Text that should contain the amount of items for the channel or category page. */\n numberOfItemsText?: string;\n}\n\nconst Breadcrumb: FC<Props> = ({ currentPageTitle, previousPageTitle, previousPageUrl, hideHeader = false, numberOfItemsText = \"\" }) => {\n const { base, icon, previousPage, previousPageContainer, link, header, iconWrapper } = generateClasses();\n return (\n <div className={base()} data-bpds=\"breadcrumb\" data-bpds-hide-header={hideHeader}>\n <a href={previousPageUrl} className={link()}>\n <span className={iconWrapper()}>\n {/* Preserve size before icon loads to avoid flicker, until the way SVG is loaded changes */}\n <Icon variant=\"back\" className={icon()} />\n </span>\n\n <span className={previousPageContainer()}>\n <span className={previousPage()}>{previousPageTitle}</span>\n </span>\n </a>\n {hideHeader ? null : (\n <div className={header()}>\n <Typography variant=\"bonprix-h3\">{currentPageTitle}</Typography>\n <Typography color=\"on-bg-low\">{numberOfItemsText}</Typography>\n </div>\n )}\n </div>\n );\n};\n\nexport default Breadcrumb;\n"],"mappings":";;;;;;;AAOA,IAAM,IAAkB,EAAG;CACzB,MAAM;CACN,OAAO;EACL,MAAM;EACN,MAAM;EACN,uBAAuB;EACvB,cAAc,CACZ,gEACA,2EACF;EACA,QAAQ;EACR,aAAa;CACf;AACF,CAAC,GAeK,KAAyB,EAAE,qBAAkB,sBAAmB,oBAAiB,gBAAa,IAAO,uBAAoB,SAAS;CACtI,IAAM,EAAE,SAAM,SAAM,iBAAc,0BAAuB,SAAM,WAAQ,mBAAgB,EAAgB;CACvG,OACE,kBAAC,OAAD;EAAK,WAAW,EAAK;EAAG,aAAU;EAAa,yBAAuB;YAAtE,CACE,kBAAC,KAAD;GAAG,MAAM;GAAiB,WAAW,EAAK;aAA1C,CACE,kBAAC,QAAD;IAAM,WAAW,EAAY;cAE3B,kBAAC,GAAD;KAAM,SAAQ;KAAO,WAAW,EAAK;IAAI,CAAA;GACrC,CAAA,GAEN,kBAAC,QAAD;IAAM,WAAW,EAAsB;cACrC,kBAAC,QAAD;KAAM,WAAW,EAAa;eAAI;IAAwB,CAAA;GACtD,CAAA,CACL;MACF,IAAa,OACZ,kBAAC,OAAD;GAAK,WAAW,EAAO;aAAvB,CACE,kBAAC,GAAD;IAAY,SAAQ;cAAc;GAA6B,CAAA,GAC/D,kBAAC,GAAD;IAAY,OAAM;cAAa;GAA8B,CAAA,CAC1D;IAEJ;;AAET"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/Breadcrumb/index.ts"],"sourcesContent":["import Breadcrumb from \"./Breadcrumb\";\n\nexport default Breadcrumb;\nexport type { Props as BreadcrumbProps } from \"./Breadcrumb\";\n"],"mappings":";;AAEA,IAAA,IAAe"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import e from "../../../react/icon-button/dist/index.js";
|
|
3
|
+
import t from "react";
|
|
4
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
5
|
+
import { tv as i } from "tailwind-variants";
|
|
6
|
+
//#region src/components/Buttons/BadgeIconButton/BadgeIconButton.tsx
|
|
7
|
+
var a = i({
|
|
8
|
+
base: "preflight relative inline-block w-fit",
|
|
9
|
+
slots: { counter: "typography-body2 text-clr-on-primary-high absolute flex px-[5px] bg-clr-primary min-w-4 h-4 rounded-full start-6 top-1 pointer-events-none" }
|
|
10
|
+
}), o = ({ amount: i = 0, label: o, ...s }) => {
|
|
11
|
+
let c = i > 0, l = c ? o.replace(/(\s)*\.?(\s)*$/, `. ${i} artikel`) : o, u = t.cloneElement(/* @__PURE__ */ n(e, {
|
|
12
|
+
label: l,
|
|
13
|
+
...s,
|
|
14
|
+
variant: "tertiary"
|
|
15
|
+
}), { hasPadding: !0 }), d = i > 99 ? "99+" : i, { base: f, counter: p } = a();
|
|
16
|
+
return /* @__PURE__ */ r("span", {
|
|
17
|
+
className: f(),
|
|
18
|
+
"data-bpds": "badge-icon-button",
|
|
19
|
+
"data-bpds-amount": i,
|
|
20
|
+
children: [u, c && /* @__PURE__ */ n("span", {
|
|
21
|
+
className: p(),
|
|
22
|
+
children: d
|
|
23
|
+
})]
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
export { o as default };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=BadgeIconButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BadgeIconButton.js","names":[],"sources":["../../../../src/components/Buttons/BadgeIconButton/BadgeIconButton.tsx"],"sourcesContent":["\"use client\";\n\nimport { IconType } from \"@bonprix-ds/react-icon\";\nimport IconButton from \"@bonprix-ds/react-icon-button\";\nimport type { Anchor } from \"@bonprix-ds/utils\";\nimport React, { FC, Ref } from \"react\";\nimport { tv } from \"tailwind-variants\";\n\ninterface BaseProps {\n /** If used, an icon will be additionally shown. The value is a name of one icon from our icon set. */\n icon: IconType;\n /** An accessible label of the icon button. */\n label: string;\n /** Standard HTML global attribute. Read more on <a href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/id\">MDN, attributes - id</a>. */\n id?: string;\n /** Standard HTML global attribute. Controls, if the button can be focused and how. Read more on <a href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/tabindex\">MDN, Attributes - tabindex</a>. */\n tabIndex?: number;\n /** A number that is shown in the badge. It is quantitatively related to the context of the button. If the amount is zero, no badge will be shown. If the amount is more then 99, then the displayed value will be capped to \"99+\" */\n amount?: number;\n}\n\ninterface AsLink extends BaseProps, Anchor {\n /** If `true`, an anchor element will be rendered instead of a button. Also, link-specific properties `href`, `rel`and `target` will be available. Button-specific properties are not usable. */\n link: true;\n /** Callback, which is triggered when the button is activated. */\n onClick?: (event: React.MouseEvent<HTMLAnchorElement>) => void;\n /** A React ref to the underlying HTML anchor element. */\n ref?: Ref<HTMLAnchorElement>;\n}\n\ninterface AsButton extends BaseProps {\n link?: never;\n onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;\n /** A React ref to the underlying HTML button element. */\n ref?: Ref<HTMLButtonElement>;\n}\n\nexport type Props = AsLink | AsButton;\n\nconst generateClasses = tv({\n base: \"preflight relative inline-block w-fit\",\n slots: {\n counter:\n \"typography-body2 text-clr-on-primary-high absolute flex px-[5px] bg-clr-primary min-w-4 h-4 rounded-full start-6 top-1 pointer-events-none\",\n },\n});\n\nconst BadgeIconButton: FC<Props> = ({ amount = 0, label, ...props }) => {\n const badgeVisible = amount > 0;\n const SRlabel = badgeVisible ? label.replace(/(\\s)*\\.?(\\s)*$/, `. ${amount} artikel`) : label;\n const newIconButton = React.cloneElement(<IconButton label={SRlabel} {...props} variant=\"tertiary\" />, {\n hasPadding: true,\n });\n const badgeCounter = amount > 99 ? \"99+\" : amount;\n const { base, counter } = generateClasses();\n return (\n <span className={base()} data-bpds=\"badge-icon-button\" data-bpds-amount={amount}>\n {newIconButton}\n {badgeVisible && <span className={counter()}>{badgeCounter}</span>}\n </span>\n );\n};\nexport default BadgeIconButton;\n"],"mappings":";;;;;;AAuCA,IAAM,IAAkB,EAAG;CACzB,MAAM;CACN,OAAO,EACL,SACE,6IACJ;AACF,CAAC,GAEK,KAA8B,EAAE,YAAS,GAAG,UAAO,GAAG,QAAY;CACtE,IAAM,IAAe,IAAS,GACxB,IAAU,IAAe,EAAM,QAAQ,kBAAkB,KAAK,EAAO,SAAS,IAAI,GAClF,IAAgB,EAAM,aAAa,kBAAC,GAAD;EAAY,OAAO;EAAS,GAAI;EAAO,SAAQ;CAAY,CAAA,GAAG,EACrG,YAAY,GACd,CAAC,GACK,IAAe,IAAS,KAAK,QAAQ,GACrC,EAAE,SAAM,eAAY,EAAgB;CAC1C,OACE,kBAAC,QAAD;EAAM,WAAW,EAAK;EAAG,aAAU;EAAoB,oBAAkB;YAAzE,CACG,GACA,KAAgB,kBAAC,QAAD;GAAM,WAAW,EAAQ;aAAI;EAAmB,CAAA,CAC7D;;AAEV"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/Buttons/BadgeIconButton/index.ts"],"sourcesContent":["import BadgeIconButton from \"./BadgeIconButton\";\n\nexport default BadgeIconButton;\nexport type { Props as BadgeIconButtonProps } from \"./BadgeIconButton\";\n"],"mappings":";;AAEA,IAAA,IAAe"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { BaseButton as e } from "../../../internal-components/dist/index.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/Buttons/Button/Button.tsx
|
|
6
|
+
var n = ({ children: n, icon: r, iconPosition: i = "start", contentWidth: a = !1, id: o, variant: s = "primary", tabIndex: c, size: l, ...u }) => {
|
|
7
|
+
let d = {
|
|
8
|
+
children: n,
|
|
9
|
+
icon: r,
|
|
10
|
+
iconPosition: i,
|
|
11
|
+
contentWidth: a,
|
|
12
|
+
id: o,
|
|
13
|
+
variant: s,
|
|
14
|
+
tabIndex: c,
|
|
15
|
+
size: l
|
|
16
|
+
};
|
|
17
|
+
if (u.link) {
|
|
18
|
+
let { href: r, rel: i, target: a, onClick: o, ref: s } = u;
|
|
19
|
+
return /* @__PURE__ */ t(e, {
|
|
20
|
+
...d,
|
|
21
|
+
link: !0,
|
|
22
|
+
href: r,
|
|
23
|
+
rel: i,
|
|
24
|
+
target: a,
|
|
25
|
+
onClick: o,
|
|
26
|
+
componentName: "button",
|
|
27
|
+
size: l,
|
|
28
|
+
ref: s,
|
|
29
|
+
children: n
|
|
30
|
+
});
|
|
31
|
+
} else {
|
|
32
|
+
let { disabled: r, loading: i, onClick: a, type: o, form: s, ref: c } = u;
|
|
33
|
+
return /* @__PURE__ */ t(e, {
|
|
34
|
+
...d,
|
|
35
|
+
loading: i,
|
|
36
|
+
disabled: r,
|
|
37
|
+
onClick: a,
|
|
38
|
+
type: o,
|
|
39
|
+
form: s,
|
|
40
|
+
componentName: "button",
|
|
41
|
+
size: l,
|
|
42
|
+
ref: c,
|
|
43
|
+
children: n
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
//#endregion
|
|
48
|
+
export { n as default };
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=Button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.js","names":[],"sources":["../../../../src/components/Buttons/Button/Button.tsx"],"sourcesContent":["\"use client\";\n\nimport { BaseButton } from \"@bonprix-ds/internal-components\";\nimport type { IconType } from \"@bonprix-ds/react-icon\";\nimport type { Anchor, ButtonSize } from \"@bonprix-ds/utils\";\nimport React, { FC, Ref } from \"react\";\n\ninterface BaseProps {\n /** The visible content of the component. */\n children: string;\n /** If used, an icon will be additionally shown. The value is a name of one icon from our icon set. */\n icon?: IconType;\n /** The position of the icon relative to the content. */\n iconPosition?: \"start\" | \"end\";\n /** If true, the width of the component will shrink to the width of the content. */\n contentWidth?: boolean;\n /** Standard HTML global attribute. Read more on <a href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/id\">MDN, attributes - id</a>. */\n id?: string;\n /** The variant of the button. Choose one depending on the type and desired prominence. */\n variant?: \"primary\" | \"secondary\" | \"tertiary\";\n /** Size of the button. */\n size?: Exclude<ButtonSize, \"small\">;\n /** Standard HTML global attribute. Controls, if the button can be focused and how. Read more on <a href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/tabindex\">MDN, Attributes - tabindex</a>. */\n tabIndex?: number;\n}\ninterface AsLink extends BaseProps, Anchor {\n /** If `true`, an anchor element will be rendered instead of a button. Also, link-specific properties `href`, `rel`and `target` will be available. Button-specific properties are not usable. */\n link: true;\n /** Callback, which is triggered when the link is clicked. */\n onClick?: (event: React.MouseEvent<HTMLAnchorElement>) => void;\n type?: never;\n /** A React ref to the underlying HTML anchor element. */\n ref?: Ref<HTMLAnchorElement>;\n}\ninterface AsButton extends BaseProps {\n link?: never;\n /** If `true`, the button will be disabled and thus not interactable. Only usable when the property `link` is set to `false`. */\n disabled?: boolean;\n /** If `true`, a loading spinner will be shown instead of the content. Only usable when the property `link` is set to `false`. */\n loading?: boolean;\n /** Standard HTML attribute. Read more on <a href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/button#form\">MDN, Button Element - form</a>. Only usable when the property `link` is set to `false`. */\n form?: string;\n /** A React ref to the underlying HTML button element. */\n ref?: Ref<HTMLButtonElement>;\n}\n\ntype ButtonVariantProps = AsButton & {\n /** Callback, which is triggered when the button is activated. */\n onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;\n /** Standard HTML attribute. Read more on <a href=\"https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/button#type\">MDN, Button Element - type</a>. */\n type?: \"button\";\n};\n\ntype SubmitResetVariantProps = AsButton & {\n onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n type?: \"submit\" | \"reset\";\n};\n\nexport type Props = AsLink | SubmitResetVariantProps | ButtonVariantProps;\n\nconst Button: FC<Props> = ({\n children,\n icon,\n iconPosition = \"start\",\n contentWidth = false,\n id,\n variant = \"primary\",\n tabIndex,\n size,\n ...unionProps\n}) => {\n const commonProps = { children, icon, iconPosition, contentWidth, id, variant, tabIndex, size };\n if (unionProps.link) {\n const { href, rel, target, onClick, ref } = unionProps;\n return (\n <BaseButton\n {...commonProps}\n link\n href={href}\n rel={rel}\n target={target}\n onClick={onClick}\n componentName=\"button\"\n size={size}\n ref={ref}\n >\n {children}\n </BaseButton>\n );\n } else {\n const { disabled, loading, onClick, type, form, ref } = unionProps;\n return (\n <BaseButton\n {...commonProps}\n loading={loading}\n disabled={disabled}\n onClick={onClick}\n type={type}\n form={form}\n componentName=\"button\"\n size={size}\n ref={ref}\n >\n {children}\n </BaseButton>\n );\n }\n};\n\nexport default Button;\n"],"mappings":";;;;;AA4DA,IAAM,KAAqB,EACzB,aACA,SACA,kBAAe,SACf,kBAAe,IACf,OACA,aAAU,WACV,aACA,SACA,GAAG,QACC;CACJ,IAAM,IAAc;EAAE;EAAU;EAAM;EAAc;EAAc;EAAI;EAAS;EAAU;CAAK;CAC9F,IAAI,EAAW,MAAM;EACnB,IAAM,EAAE,SAAM,QAAK,WAAQ,YAAS,WAAQ;EAC5C,OACE,kBAAC,GAAD;GACE,GAAI;GACJ,MAAA;GACM;GACD;GACG;GACC;GACT,eAAc;GACR;GACD;GAEJ;EACS,CAAA;CAEhB,OAAO;EACL,IAAM,EAAE,aAAU,YAAS,YAAS,SAAM,SAAM,WAAQ;EACxD,OACE,kBAAC,GAAD;GACE,GAAI;GACK;GACC;GACD;GACH;GACA;GACN,eAAc;GACR;GACD;GAEJ;EACS,CAAA;CAEhB;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/Buttons/Button/index.ts"],"sourcesContent":["import Button from \"./Button\";\n\nexport default Button;\nexport type { Props as ButtonProps } from \"./Button\";\n"],"mappings":";;AAEA,IAAA,IAAe"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import e from "../../hooks/useSubcomponent.js";
|
|
3
|
+
import t from "./PrimaryButton.js";
|
|
4
|
+
import n from "./SecondaryButton.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import { jsxs as r } from "react/jsx-runtime";
|
|
7
|
+
import { tv as i } from "tailwind-variants";
|
|
8
|
+
//#region src/components/ButtonsSection/ButtonsSection.tsx
|
|
9
|
+
var a = i({ slots: { root: "flex justify-center flex-wrap gap-3" } }), o = ({ owner: i, primary: o, secondary: s, fullWidthButtons: c = !1, classes: l = "" }) => {
|
|
10
|
+
let { getSingleChildFromSubcomponent: u, printBadConstructionMessage: d } = e([o, s]), f = { contentWidth: !c }, { root: p } = a();
|
|
11
|
+
return o ? /* @__PURE__ */ r("div", {
|
|
12
|
+
className: p({ class: l }),
|
|
13
|
+
children: [u(n, s ?? null, f), u(t, o, f)]
|
|
14
|
+
}) : (d(`${i}'s ButtonSection`), null);
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { o as default };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=ButtonsSection.js.map
|