bonprix-design-system 0.69.2 → 0.70.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/BottomSheet/BottomSheet.js +11 -6
- package/dist/components/BottomSheet/BottomSheet.js.map +1 -1
- package/dist/components/Carousel/Carousel.js +49 -52
- package/dist/components/Carousel/Carousel.js.map +1 -1
- package/dist/components/Dialog/Dialog.js +45 -38
- package/dist/components/Dialog/Dialog.js.map +1 -1
- package/dist/components/InputFields/BaseInputField/BaseInputField.js +48 -46
- package/dist/components/InputFields/BaseInputField/BaseInputField.js.map +1 -1
- package/dist/components/InputFields/EmailField/EmailField.js +14 -0
- package/dist/components/InputFields/EmailField/EmailField.js.map +1 -0
- package/dist/components/InputFields/EmailField/index.js +7 -0
- package/dist/components/InputFields/EmailField/index.js.map +1 -0
- package/dist/components/InputFields/PasswordField/PasswordField.js.map +1 -1
- package/dist/components/InputFields/SearchField/SearchField.js.map +1 -1
- package/dist/components/InputFields/TextField/TextField.js +17 -18
- package/dist/components/InputFields/TextField/TextField.js.map +1 -1
- package/dist/components/InputFields/TextField/index.js.map +1 -1
- package/dist/components/Link/Link.js +1 -1
- package/dist/components/Link/Link.js.map +1 -1
- package/dist/components/SideSheet/SideSheet.js +2 -2
- package/dist/components/SideSheet/SideSheet.js.map +1 -1
- package/dist/components/TabGroup/tabStyleClasses.js +1 -1
- package/dist/components/TabGroup/tabStyleClasses.js.map +1 -1
- package/dist/components/Textarea/Textarea.js.map +1 -1
- package/dist/components/index.js +42 -38
- package/dist/hooks/index.js +2 -2
- package/dist/index.d.ts +225 -81
- package/dist/index.js +17 -16
- package/dist/styles/component-variables.css +5 -7
- package/dist/styles/dark-theme-variables.css +4 -0
- package/dist/styles/default-variables.css +82 -38
- package/dist/styles/fonts.css +1 -1
- package/dist/styles/light-theme-variables.css +4 -0
- package/dist/tailwind.config.js +1 -1
- package/dist/tailwind.config.js.map +1 -1
- package/dist/tailwindTokens.js +15 -9
- package/dist/tailwindTokens.js.map +1 -1
- package/dist/web-components.d.ts +110 -0
- package/package.json +43 -40
- package/dist/components/ButtonsSection/ButtonsSection.js +0 -19
- package/dist/components/ButtonsSection/ButtonsSection.js.map +0 -1
- package/dist/components/ButtonsSection/PrimaryButton.js +0 -13
- package/dist/components/ButtonsSection/PrimaryButton.js.map +0 -1
- package/dist/components/ButtonsSection/SecondaryButton.js +0 -14
- package/dist/components/ButtonsSection/SecondaryButton.js.map +0 -1
- package/dist/components/ButtonsSection/index.js +0 -9
- package/dist/components/ButtonsSection/index.js.map +0 -1
- package/dist/components/InputFields/TextField/constants.js +0 -14
- package/dist/components/InputFields/TextField/constants.js.map +0 -1
|
@@ -34,7 +34,7 @@ var h = c({
|
|
|
34
34
|
false: { scrollArea: "px-4" },
|
|
35
35
|
true: ""
|
|
36
36
|
} }
|
|
37
|
-
}), g = ({ children: e, isOpen: n, onClose: i, onBack: o, zIndex: c =
|
|
37
|
+
}), g = ({ children: e, isOpen: n, onClose: i, onBack: o, zIndex: c = 9999, ref: d }) => {
|
|
38
38
|
let g = p(), { root: _, container: v, dragHandleContainer: y, dragHandle: b, content: x, contentWrapper: S, backdrop: C } = h(), { isShown: w, scrollRef: T, scrollPosition: E } = a({ isOpen: n }), D = E === "middle" || E === "bottom", { innerOpen: O } = t(w), k = s();
|
|
39
39
|
return /* @__PURE__ */ u(m, {
|
|
40
40
|
isOpen: O,
|
|
@@ -43,14 +43,19 @@ var h = c({
|
|
|
43
43
|
detent: "content",
|
|
44
44
|
"data-bpds": "bottom-sheet",
|
|
45
45
|
prefersReducedMotion: g,
|
|
46
|
-
style: {
|
|
46
|
+
style: {
|
|
47
|
+
"--touch-action": D ? "initial" : "pan-down",
|
|
48
|
+
pointerEvents: void 0,
|
|
49
|
+
visibility: O ? "visible" : "hidden",
|
|
50
|
+
zIndex: c
|
|
51
|
+
},
|
|
47
52
|
role: "dialog",
|
|
48
53
|
avoidKeyboard: !1,
|
|
49
54
|
"aria-labelledby": k,
|
|
50
55
|
children: [/* @__PURE__ */ u(m.Container, {
|
|
51
56
|
className: v(),
|
|
52
57
|
ref: d,
|
|
53
|
-
style: {
|
|
58
|
+
style: { pointerEvents: void 0 },
|
|
54
59
|
children: [/* @__PURE__ */ l(m.Header, {
|
|
55
60
|
unstyled: !0,
|
|
56
61
|
className: y(),
|
|
@@ -59,7 +64,7 @@ var h = c({
|
|
|
59
64
|
className: b()
|
|
60
65
|
})
|
|
61
66
|
}), /* @__PURE__ */ l(f.Provider, {
|
|
62
|
-
value:
|
|
67
|
+
value: c,
|
|
63
68
|
children: /* @__PURE__ */ l(r.Provider, {
|
|
64
69
|
value: {
|
|
65
70
|
scrollRef: T,
|
|
@@ -83,8 +88,7 @@ var h = c({
|
|
|
83
88
|
}), /* @__PURE__ */ l(m.Backdrop, {
|
|
84
89
|
"aria-label": "Bottom Sheet schließen",
|
|
85
90
|
onTap: i,
|
|
86
|
-
className: C()
|
|
87
|
-
style: { zIndex: c - 1 }
|
|
91
|
+
className: C()
|
|
88
92
|
})]
|
|
89
93
|
});
|
|
90
94
|
};
|
|
@@ -125,6 +129,7 @@ g.displayName = "BottomSheet", g.Title = ({ children: e, subline: t, level: n =
|
|
|
125
129
|
ref: n,
|
|
126
130
|
className: r(),
|
|
127
131
|
"data-bpds-disable-horizontal-padding": t,
|
|
132
|
+
tabIndex: 0,
|
|
128
133
|
children: e
|
|
129
134
|
});
|
|
130
135
|
}, g.ButtonSection = ({ children: e }) => /* @__PURE__ */ l("div", {
|
|
@@ -1 +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 { TitleLevel, usePrefersReducedMotion, ZIndexContext } from \"@bonprix-ds/utils\";\nimport React, { ComponentProps, ElementType, FC, ReactNode, RefObject, useId } from \"react\";\nimport { Sheet } from \"react-modal-sheet\";\nimport { tv } from \"tailwind-variants\";\n\nimport { Button } from \"@components/Buttons\";\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%-4rem)]\",\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 backdrop: backdrop(),\n scrollArea: \"scroll-area relative\",\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\ninterface SheetButtonBaseProps {\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\nexport type SheetButtonProps<C extends ElementType> = SheetButtonBaseProps & {\n /** The semantic component to render the Button. Preferrably `\"button\"`. Defaults to `\"button\"`. Native props will be passed to this component. */\n component?: C;\n} & Omit<ComponentProps<C>, keyof SheetButtonBaseProps | \"component\">;\n\ntype SheetPrimaryButtonProps<C extends ElementType> = SheetButtonProps<C> & {\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?: RefObject<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 style={{ \"--touch-action\": disableDrag ? \"initial\" : \"pan-down\" }}\n role=\"dialog\"\n avoidKeyboard={false}\n aria-labelledby={titleId}\n >\n <Sheet.Container className={container()} ref={ref} style={{ zIndex }}>\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, 0rem), 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 = <C extends ElementType>({\n children,\n icon,\n iconPosition,\n loading,\n component = \"button\" as C,\n ...props\n}: SheetPrimaryButtonProps<C>) => {\n const Component: ElementType = component;\n const { onClick, type = \"button\", ...otherProps } = props;\n const { onClose } = useConsumeBottomSheet();\n const handleClick = (event: React.MouseEvent) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n onClick?.(event);\n onClose();\n };\n return (\n <Button\n component={Component}\n {...otherProps}\n variant=\"primary\"\n onClick={handleClick}\n type={type}\n icon={icon}\n iconPosition={iconPosition}\n size=\"large\"\n loading={loading}\n >\n {children}\n </Button>\n );\n};\n\nconst SecondaryButton = <C extends ElementType>({\n children,\n icon,\n iconPosition,\n component = \"button\" as C,\n ...props\n}: SheetButtonProps<C>) => {\n const Component: ElementType = component;\n const { onClose } = useConsumeBottomSheet();\n return (\n <Button\n component={Component}\n {...props}\n variant=\"secondary\"\n type=\"button\"\n onClick={onClose}\n icon={icon}\n iconPosition={iconPosition}\n size=\"large\"\n >\n {children}\n </Button>\n );\n};\n\nBottomSheet.displayName = \"BottomSheet\";\n\nBottomSheet.Title = Title;\nBottomSheet.Content = Content;\nBottomSheet.ButtonSection = ButtonSection;\nBottomSheet.PrimaryButton = PrimaryButton;\nBott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DkC,EAC5C,aACA,SACA,iBACA,YACA,eAAY,UACZ,GAAG,QAC6B;CAChC,IAAM,IAAyB,GACzB,EAAE,YAAS,UAAO,UAAU,GAAG,MAAe,GAC9C,EAAE,eAAY,EAAsB,GACpC,KAAe,MAA4B;EAG/C,AADA,IAAU,CAAK,GACf,EAAQ;CACV;CACA,OACE,kBAAC,GAAD;EACE,WAAW;EACX,GAAI;EACJ,SAAQ;EACR,SAAS;EACH;EACA;EACQ;EACd,MAAK;EACI;EAER;CACK,CAAA;AAEZ,GAiCA,EAAY,mBA/BoC,EAC9C,aACA,SACA,iBACA,eAAY,UACZ,GAAG,QACsB;CACzB,IAAM,IAAyB,GACzB,EAAE,eAAY,EAAsB;CAC1C,OACE,kBAAC,GAAD;EACE,WAAW;EACX,GAAI;EACJ,SAAQ;EACR,MAAK;EACL,SAAS;EACH;EACQ;EACd,MAAK;EAEJ;CACK,CAAA;AAEZ"}
|
|
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 { TitleLevel, usePrefersReducedMotion, ZIndexContext } from \"@bonprix-ds/utils\";\nimport React, { ComponentProps, ElementType, FC, ReactNode, RefObject, useId } from \"react\";\nimport { Sheet } from \"react-modal-sheet\";\nimport { tv } from \"tailwind-variants\";\n\nimport { Button } from \"@components/Buttons\";\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%-4rem)]\",\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 backdrop: backdrop(),\n scrollArea: \"scroll-area relative\",\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\ninterface SheetButtonBaseProps {\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\nexport type SheetButtonProps<C extends ElementType> = SheetButtonBaseProps & {\n /** The semantic component to render the Button. Preferrably `\"button\"`. Defaults to `\"button\"`. Native props will be passed to this component. */\n component?: C;\n} & Omit<ComponentProps<C>, keyof SheetButtonBaseProps | \"component\">;\n\ntype SheetPrimaryButtonProps<C extends ElementType> = SheetButtonProps<C> & {\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?: RefObject<HTMLDivElement>;\n}\n\nconst BottomSheet: FC<Props> & SheetSubcomponents = ({ children, isOpen, onClose, onBack, zIndex = 9999, 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 style={{\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 \"--touch-action\": disableDrag ? \"initial\" : \"pan-down\",\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 pointerEvents: undefined,\n // When removing react-modal-sheet's pointerEvents handling, we need to adjust visibility because we can no longer rely on `pointer-events: none` being set on the wrapper that spans the whole page even when closed.\n visibility: innerOpen ? \"visible\" : \"hidden\",\n zIndex: zIndex,\n }}\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={{ pointerEvents: undefined }}>\n <Sheet.Header unstyled className={dragHandleContainer()}>\n <Sheet.DragIndicator unstyled className={dragHandle()} />\n </Sheet.Header>\n <ZIndexContext.Provider value={zIndex}>\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, 0rem), 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()} />\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 return (\n <div ref={setScrollRef} className={scrollArea()} data-bpds-disable-horizontal-padding={disableHorizontalPadding} tabIndex={0}>\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 = <C extends ElementType>({\n children,\n icon,\n iconPosition,\n loading,\n component = \"button\" as C,\n ...props\n}: SheetPrimaryButtonProps<C>) => {\n const Component: ElementType = component;\n const { onClick, type = \"button\", ...otherProps } = props;\n const { onClose } = useConsumeBottomSheet();\n const handleClick = (event: React.MouseEvent) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n onClick?.(event);\n onClose();\n };\n return (\n <Button\n component={Component}\n {...otherProps}\n variant=\"primary\"\n onClick={handleClick}\n type={type}\n icon={icon}\n iconPosition={iconPosition}\n size=\"large\"\n loading={loading}\n >\n {children}\n </Button>\n );\n};\n\nconst SecondaryButton = <C extends ElementType>({\n children,\n icon,\n iconPosition,\n component = \"button\" as C,\n ...props\n}: SheetButtonProps<C>) => {\n const Component: ElementType = component;\n const { onClose } = useConsumeBottomSheet();\n return (\n <Button\n component={Component}\n {...props}\n variant=\"secondary\"\n type=\"button\"\n onClick={onClose}\n icon={icon}\n iconPosition={iconPosition}\n size=\"large\"\n >\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":";;;;;;;;;;;;;;;AAkBA,IAAM,IAAkB,EAAG;CACzB,OAAO;EACL,MAAM;EACN,WAAW;EACX,QA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E,YAAS,UAAO,UAAU,GAAG,MAAe,GAC9C,EAAE,eAAY,EAAsB,GACpC,KAAe,MAA4B;EAG/C,AADA,IAAU,CAAK,GACf,EAAQ;CACV;CACA,OACE,kBAAC,GAAD;EACE,WAAW;EACX,GAAI;EACJ,SAAQ;EACR,SAAS;EACH;EACA;EACQ;EACd,MAAK;EACI;EAER;CACK,CAAA;AAEZ,GAiCA,EAAY,mBA/BoC,EAC9C,aACA,SACA,iBACA,eAAY,UACZ,GAAG,QACsB;CACzB,IAAM,IAAyB,GACzB,EAAE,eAAY,EAAsB;CAC1C,OACE,kBAAC,GAAD;EACE,WAAW;EACX,GAAI;EACJ,SAAQ;EACR,MAAK;EACL,SAAS;EACH;EACQ;EACd,MAAK;EAEJ;CACK,CAAA;AAEZ"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import t from "./CarouselArrow.js";
|
|
2
|
+
import e from "./CarouselArrow.js";
|
|
4
3
|
import "react";
|
|
5
|
-
import { tv as
|
|
6
|
-
import { jsx as
|
|
7
|
-
import { Splide as
|
|
4
|
+
import { tv as t } from "tailwind-variants";
|
|
5
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
6
|
+
import { Splide as i, SplideSlide as a, SplideTrack as o } from "@splidejs/react-splide";
|
|
8
7
|
//#region src/components/Carousel/Carousel.tsx
|
|
9
|
-
var
|
|
8
|
+
var s = t({
|
|
10
9
|
slots: {
|
|
11
10
|
root: "",
|
|
12
11
|
buttons: "",
|
|
@@ -25,21 +24,19 @@ var c = n({
|
|
|
25
24
|
},
|
|
26
25
|
never: ""
|
|
27
26
|
} }
|
|
28
|
-
}),
|
|
29
|
-
let {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
padding: b,
|
|
40
|
-
start: S,
|
|
27
|
+
}), c = ({ children: t, label: a, perPage: c = 1, perMove: l = 1, rewind: u = !1, buttonsContrast: d = !1, invertButtons: f = !1, focus: p, gap: m = 20, showArrows: h = "always", pagination: g = !0, onMove: _, padding: v, disableHorizontalPadding: y = !1, start: b = 0, disableDrag: x = !1, paginationRef: S }) => {
|
|
28
|
+
let { root: C, buttons: w, paginationClass: T, page: E } = s({ showArrows: h }), D = {
|
|
29
|
+
perPage: c,
|
|
30
|
+
perMove: l,
|
|
31
|
+
type: u ? "loop" : "slide",
|
|
32
|
+
focus: p,
|
|
33
|
+
gap: m,
|
|
34
|
+
arrows: h !== "never",
|
|
35
|
+
pagination: g,
|
|
36
|
+
padding: v,
|
|
37
|
+
start: b,
|
|
41
38
|
lazyLoad: "nearby",
|
|
42
|
-
classes: { page:
|
|
39
|
+
classes: { page: E() },
|
|
43
40
|
i18n: {
|
|
44
41
|
prev: "vorherige Ansicht",
|
|
45
42
|
next: "nächste Ansicht",
|
|
@@ -54,50 +51,50 @@ var c = n({
|
|
|
54
51
|
slide: "slide",
|
|
55
52
|
slideLabel: "%s von %s"
|
|
56
53
|
},
|
|
57
|
-
drag: !
|
|
54
|
+
drag: !x
|
|
58
55
|
};
|
|
59
|
-
return /* @__PURE__ */ i
|
|
60
|
-
"aria-label":
|
|
61
|
-
options:
|
|
56
|
+
return /* @__PURE__ */ r(i, {
|
|
57
|
+
"aria-label": a,
|
|
58
|
+
options: D,
|
|
62
59
|
hasTrack: !1,
|
|
63
|
-
onMove: (e, t, n) =>
|
|
60
|
+
onMove: (e, t, n) => _?.(t, n),
|
|
64
61
|
"data-bpds": "carousel",
|
|
65
|
-
"data-bpds-per-page":
|
|
66
|
-
"data-bpds-per-move":
|
|
67
|
-
"data-bpds-rewind":
|
|
68
|
-
"data-bpds-buttons-contrast":
|
|
69
|
-
"data-bpds-invert-buttons":
|
|
70
|
-
"data-bpds-disable-horizontal-padding":
|
|
71
|
-
"data-bpds-gap":
|
|
72
|
-
"data-bpds-padding":
|
|
73
|
-
"data-bpds-pagination":
|
|
74
|
-
"data-bpds-show-arrows":
|
|
75
|
-
className:
|
|
62
|
+
"data-bpds-per-page": c,
|
|
63
|
+
"data-bpds-per-move": l,
|
|
64
|
+
"data-bpds-rewind": u,
|
|
65
|
+
"data-bpds-buttons-contrast": d,
|
|
66
|
+
"data-bpds-invert-buttons": f,
|
|
67
|
+
"data-bpds-disable-horizontal-padding": y,
|
|
68
|
+
"data-bpds-gap": m,
|
|
69
|
+
"data-bpds-padding": v,
|
|
70
|
+
"data-bpds-pagination": g,
|
|
71
|
+
"data-bpds-show-arrows": h,
|
|
72
|
+
className: C(),
|
|
76
73
|
children: [
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
className: `splide__arrows ${
|
|
79
|
-
children: [/* @__PURE__ */
|
|
80
|
-
invertButtons:
|
|
74
|
+
/* @__PURE__ */ r("div", {
|
|
75
|
+
className: `splide__arrows ${w()}`,
|
|
76
|
+
children: [/* @__PURE__ */ n(e, {
|
|
77
|
+
invertButtons: f,
|
|
81
78
|
position: "left",
|
|
82
|
-
buttonsContrast:
|
|
83
|
-
disableHorizontalPadding:
|
|
84
|
-
}), /* @__PURE__ */
|
|
85
|
-
invertButtons:
|
|
79
|
+
buttonsContrast: d,
|
|
80
|
+
disableHorizontalPadding: y
|
|
81
|
+
}), /* @__PURE__ */ n(e, {
|
|
82
|
+
invertButtons: f,
|
|
86
83
|
position: "right",
|
|
87
|
-
buttonsContrast:
|
|
88
|
-
disableHorizontalPadding:
|
|
84
|
+
buttonsContrast: d,
|
|
85
|
+
disableHorizontalPadding: y
|
|
89
86
|
})]
|
|
90
87
|
}),
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
/* @__PURE__ */
|
|
93
|
-
className:
|
|
94
|
-
ref:
|
|
88
|
+
/* @__PURE__ */ n(o, { children: t }),
|
|
89
|
+
/* @__PURE__ */ n("ul", {
|
|
90
|
+
className: T(),
|
|
91
|
+
ref: S
|
|
95
92
|
})
|
|
96
93
|
]
|
|
97
94
|
});
|
|
98
95
|
};
|
|
99
|
-
|
|
96
|
+
c.displayName = "Carousel", c.Slide = a, a.displayName = "Carousel.Slide";
|
|
100
97
|
//#endregion
|
|
101
|
-
export {
|
|
98
|
+
export { c as default };
|
|
102
99
|
|
|
103
100
|
//# sourceMappingURL=Carousel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Carousel.js","names":[],"sources":["../../../src/components/Carousel/Carousel.tsx"],"sourcesContent":["\"use client\";\n\n/* eslint-disable @typescript-eslint/no-unsafe-
|
|
1
|
+
{"version":3,"file":"Carousel.js","names":[],"sources":["../../../src/components/Carousel/Carousel.tsx"],"sourcesContent":["\"use client\";\n\n/* eslint-disable @typescript-eslint/no-unsafe-assignment */\nimport React, { ComponentPropsWithoutRef, FC, ReactElement, Ref } from \"react\";\nimport { tv } from \"tailwind-variants\";\n// @ts-expect-error: Splide does not export its types correctly and hasn't been maintained for a few years now, so we are not expecting that to change. This component will be replaced soon, so we'll not take effort to fix or patch this.\nimport { Options, Splide, SplideSlide, SplideTrack } from \"@splidejs/react-splide\";\n\nimport CarouselArrow from \"./CarouselArrow\";\n\nconst generateClasses = tv({\n slots: {\n root: \"\",\n buttons: \"\",\n paginationClass: \"splide__pagination flex gap-1 absolute start-0 end-0 bottom-2 px-4 py-0 z-1\",\n page: [\n \"splide__pagination__page block p-0 relative bg-clr-on-bg-low w-3 h-0.25 m-0 opacity-100 border-none rounded-none transform-none transition-all\",\n \"[&.is-active]:bg-clr-black [&.is-active]:h-1\",\n \"after:content-[''] after:absolute after:start-0 after:-mt-1 after:h-2 after:w-3 after:cursor-pointer [&.is-active]:after:content-[]\",\n ],\n },\n variants: {\n showArrows: {\n always: \"\",\n hover: {\n root: \"group/crsl\",\n buttons: \"hidden group-hover/crsl:flex\",\n },\n never: \"\",\n },\n },\n});\n\ninterface Subcomponents {\n Slide: typeof SplideSlide;\n}\n\ntype SlideElement = ReactElement<ComponentPropsWithoutRef<typeof SplideSlide>, typeof SplideSlide>;\n\nexport interface Props {\n /** The content of the carousel. Here, Carousel.Slide subcomponents should be placed. */\n children: SlideElement | SlideElement[];\n /** Sets accessible label with help of `aria-label`. */\n label: string;\n /** Amount of slides to show per page. */\n perPage?: number;\n /** Amount of slides to move on each transition. */\n perMove?: number;\n /** If set to `true`, the carousel will loop back to the first slide after reaching the last one. */\n rewind?: boolean;\n /** If set to `true`, the primary variant of icon buttons will be used to achieve a high contrast. */\n buttonsContrast?: boolean;\n /** If set to `true`, the color of the arrow buttons will be inverted. */\n invertButtons?: boolean;\n /** If set to `true`, the horizontal padding for the arrow buttons will be removed. */\n disableHorizontalPadding?: boolean;\n /** Determines which slide should be active if there are multiple slides in a page */\n focus?: number | \"center\";\n /** The gap between the slides in pixels. */\n gap?: number;\n /** Manages the behavior of the arrow icon buttons. */\n showArrows?: \"always\" | \"hover\" | \"never\";\n /** Toggles the visibility of page indicators. */\n pagination?: boolean;\n /** Callback function that is called when the slide changes. */\n onMove?: (destIndex: number, prevIndex: number) => void;\n /** Sets padding left/right or top/bottom of the carousel. The CSS format is acceptable */\n padding?: Options[\"padding\"];\n /** The index of the initial slide to be displayed */\n start?: number;\n /** If `true`, disables dragging/swiping between slides. Can be used to control touch events and implement further gestures like pinch/zoom. */\n disableDrag?: boolean;\n /** Ref to the pagination element. Can be used to control pagination from outside of the Carousel component. */\n paginationRef?: Ref<HTMLUListElement>;\n}\n\ntype SplideProps = ComponentPropsWithoutRef<typeof Splide>;\ntype SplideOptions = SplideProps[\"options\"];\n\nconst Carousel: FC<Props> & Subcomponents = ({\n children,\n label,\n perPage = 1,\n perMove = 1,\n rewind = false,\n buttonsContrast = false,\n invertButtons = false,\n focus,\n gap = 20,\n showArrows = \"always\",\n pagination = true,\n onMove,\n padding,\n disableHorizontalPadding = false,\n start = 0,\n disableDrag = false,\n paginationRef,\n}) => {\n const { root, buttons, paginationClass, page } = generateClasses({ showArrows });\n\n const options: SplideOptions = {\n perPage,\n perMove,\n type: rewind ? \"loop\" : \"slide\",\n focus,\n gap,\n arrows: showArrows !== \"never\",\n pagination,\n padding,\n start,\n lazyLoad: \"nearby\",\n classes: { page: page() },\n i18n: {\n prev: \"vorherige Ansicht\",\n next: \"nächste Ansicht\",\n first: \"erste Ansicht\",\n last: \"letzte Ansicht\",\n slideX: \"gehe zu Ansicht %s\",\n pageX: \"gehe zu Seite %s\",\n play: \"starte Wiedergabe\",\n pause: \"pausiere Wiedergabe\",\n carousel: \"carousel\",\n select: \"wähle eine Ansicht aus\",\n slide: \"slide\",\n slideLabel: \"%s von %s\",\n },\n drag: !disableDrag,\n };\n\n return (\n <Splide\n aria-label={label}\n options={options}\n hasTrack={false}\n onMove={(_slide: unknown, destIndex: number, prevIndex: number) => onMove?.(destIndex, prevIndex)}\n data-bpds=\"carousel\"\n data-bpds-per-page={perPage}\n data-bpds-per-move={perMove}\n data-bpds-rewind={rewind}\n data-bpds-buttons-contrast={buttonsContrast}\n data-bpds-invert-buttons={invertButtons}\n data-bpds-disable-horizontal-padding={disableHorizontalPadding}\n data-bpds-gap={gap}\n data-bpds-padding={padding}\n data-bpds-pagination={pagination}\n data-bpds-show-arrows={showArrows}\n className={root()}\n >\n <div className={`splide__arrows ${buttons()}`}>\n <CarouselArrow\n invertButtons={invertButtons}\n position=\"left\"\n buttonsContrast={buttonsContrast}\n disableHorizontalPadding={disableHorizontalPadding}\n />\n <CarouselArrow\n invertButtons={invertButtons}\n position=\"right\"\n buttonsContrast={buttonsContrast}\n disableHorizontalPadding={disableHorizontalPadding}\n />\n </div>\n <SplideTrack>{children}</SplideTrack>\n <ul className={paginationClass()} ref={paginationRef} />\n </Splide>\n );\n};\n\nCarousel.displayName = \"Carousel\";\n\nCarousel.Slide = SplideSlide;\n// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\nSplideSlide.displayName = \"Carousel.Slide\";\n\nexport default Carousel;\n"],"mappings":";;;;;;;AAUA,IAAM,IAAkB,EAAG;CACzB,OAAO;EACL,MAAM;EACN,SAAS;EACT,iB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kBAAC,MAAD;IAAI,WAAW,EAAgB;IAAG,KAAK;GAAgB,CAAA;EACjD;;AAEZ;AAEA,EAAS,cAAc,YAEvB,EAAS,QAAQ,GAEjB,EAAY,cAAc"}
|
|
@@ -1,61 +1,68 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import e from "
|
|
3
|
-
import
|
|
2
|
+
import e from "../Buttons/Button/index.js";
|
|
3
|
+
import t from "../../hooks/useInnerOpen.js";
|
|
4
4
|
import n from "../Overlay/Overlay.js";
|
|
5
|
-
import r from "../ButtonsSection/PrimaryButton.js";
|
|
6
|
-
import i from "../ButtonsSection/SecondaryButton.js";
|
|
7
|
-
import a from "../ButtonsSection/index.js";
|
|
8
5
|
import "react";
|
|
9
|
-
import { tv as
|
|
10
|
-
import { jsx as
|
|
11
|
-
import * as
|
|
6
|
+
import { tv as r } from "tailwind-variants";
|
|
7
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
8
|
+
import * as a from "@radix-ui/react-dialog";
|
|
12
9
|
//#region src/components/Dialog/Dialog.tsx
|
|
13
|
-
var
|
|
10
|
+
var o = r({ slots: {
|
|
14
11
|
title: "typography-bonprix-h4 text-clr-primary px-10",
|
|
15
12
|
wrapper: "flex flex-col gap-5 h-full",
|
|
16
13
|
scrollArea: "px-10 h-full scroll-area relative",
|
|
17
14
|
contentWrapper: "flex flex-col overflow-hidden",
|
|
18
|
-
buttonSection: "px-10"
|
|
19
|
-
} }),
|
|
20
|
-
let {
|
|
21
|
-
return
|
|
22
|
-
isOpen:
|
|
23
|
-
onClose:
|
|
24
|
-
zIndex:
|
|
15
|
+
buttonSection: "px-10 flex justify-center flex-wrap gap-3"
|
|
16
|
+
} }), s = ({ isOpen: e, onClose: r, zIndex: a, children: s }) => {
|
|
17
|
+
let { wrapper: c } = o(), { innerOpen: l } = t(e);
|
|
18
|
+
return /* @__PURE__ */ i(n, {
|
|
19
|
+
isOpen: l,
|
|
20
|
+
onClose: r,
|
|
21
|
+
zIndex: a,
|
|
25
22
|
isDialog: !0,
|
|
26
23
|
componentName: "dialog",
|
|
27
|
-
children: /* @__PURE__ */
|
|
28
|
-
className:
|
|
29
|
-
children:
|
|
30
|
-
p,
|
|
31
|
-
m,
|
|
32
|
-
h && /* @__PURE__ */ s(a, {
|
|
33
|
-
owner: "Dialog",
|
|
34
|
-
primary: h,
|
|
35
|
-
secondary: g,
|
|
36
|
-
classes: v()
|
|
37
|
-
})
|
|
38
|
-
]
|
|
24
|
+
children: /* @__PURE__ */ i("div", {
|
|
25
|
+
className: c(),
|
|
26
|
+
children: s
|
|
39
27
|
})
|
|
40
28
|
});
|
|
41
|
-
},
|
|
42
|
-
let { title: t } =
|
|
43
|
-
return /* @__PURE__ */
|
|
29
|
+
}, c = ({ children: e }) => {
|
|
30
|
+
let { title: t } = o();
|
|
31
|
+
return /* @__PURE__ */ i(a.Title, {
|
|
44
32
|
className: t(),
|
|
45
33
|
children: e
|
|
46
34
|
});
|
|
47
|
-
},
|
|
48
|
-
let { scrollArea: t, contentWrapper: n } =
|
|
49
|
-
return /* @__PURE__ */
|
|
35
|
+
}, l = ({ children: e }) => {
|
|
36
|
+
let { scrollArea: t, contentWrapper: n } = o();
|
|
37
|
+
return /* @__PURE__ */ i("div", {
|
|
50
38
|
className: t(),
|
|
51
|
-
children: /* @__PURE__ */
|
|
39
|
+
children: /* @__PURE__ */ i("div", {
|
|
52
40
|
className: n(),
|
|
53
41
|
children: e
|
|
54
42
|
})
|
|
55
43
|
});
|
|
56
|
-
}
|
|
57
|
-
|
|
44
|
+
}, u = ({ children: e }) => {
|
|
45
|
+
let { buttonSection: t } = o();
|
|
46
|
+
return /* @__PURE__ */ i("div", {
|
|
47
|
+
className: t(),
|
|
48
|
+
children: e
|
|
49
|
+
});
|
|
50
|
+
}, d = ({ children: t, component: n = "button", ...r }) => /* @__PURE__ */ i(e, {
|
|
51
|
+
component: n,
|
|
52
|
+
...r,
|
|
53
|
+
contentWidth: !0,
|
|
54
|
+
size: "large",
|
|
55
|
+
children: t
|
|
56
|
+
}), f = ({ children: t, component: n = "button", ...r }) => /* @__PURE__ */ i(e, {
|
|
57
|
+
component: n,
|
|
58
|
+
...r,
|
|
59
|
+
contentWidth: !0,
|
|
60
|
+
variant: "secondary",
|
|
61
|
+
size: "large",
|
|
62
|
+
children: t
|
|
63
|
+
});
|
|
64
|
+
s.displayName = "Dialog", s.Title = c, c.displayName = "Dialog.Title", s.Content = l, l.displayName = "Dialog.Content", s.ButtonSection = u, u.displayName = "Dialog.ButtonSection", s.PrimaryButton = d, Object.assign(d, { displayName: "Dialog.PrimaryButton" }), s.SecondaryButton = f, Object.assign(f, { displayName: "Dialog.SecondaryButton" });
|
|
58
65
|
//#endregion
|
|
59
|
-
export {
|
|
66
|
+
export { s as default };
|
|
60
67
|
|
|
61
68
|
//# sourceMappingURL=Dialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.js","names":[],"sources":["../../../src/components/Dialog/Dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport React, { FC, FunctionComponent, ReactNode } from \"react\";\nimport { tv } from \"tailwind-variants\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\n\nimport
|
|
1
|
+
{"version":3,"file":"Dialog.js","names":[],"sources":["../../../src/components/Dialog/Dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport React, { ComponentProps, ElementType, FC, FunctionComponent, ReactNode } from \"react\";\nimport { tv } from \"tailwind-variants\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\n\nimport { Button } from \"@components/Buttons\";\nimport Overlay from \"@components/Overlay\";\nimport { useInnerOpen } from \"@hooks\";\n\nconst generateClasses = tv({\n slots: {\n title: \"typography-bonprix-h4 text-clr-primary px-10\",\n wrapper: \"flex flex-col gap-5 h-full\",\n scrollArea: \"px-10 h-full scroll-area relative\",\n contentWrapper: \"flex flex-col overflow-hidden\",\n buttonSection: \"px-10 flex justify-center flex-wrap gap-3\",\n },\n});\n\ninterface DialogSubcomponents {\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 {\n /** Controls the visibility of the dialog. Should be used in conjunction with `onClose`. */\n isOpen: boolean;\n /** Here, all of the subcomponents should be placed. */\n children: ReactNode;\n /** Callback function that is called when the dialog is supposed to be closed. Should be used in conjunction with `isOpen` property. */\n onClose: () => void;\n /** The z-index of the dialog. */\n zIndex?: number;\n}\n\ninterface DialogTitleProps {\n /** The title to display in the dialog. */\n children: string;\n}\n\ninterface DialogContentProps {\n /** The content to display in the dialog. */\n children: ReactNode;\n}\n\ninterface DialogButtonSectionProps {\n /** Primary and secondary buttons should be placed inside this section. */\n children: ReactNode;\n}\n\ntype DialogButtonProps<C extends ElementType> = {\n /** The button text to render. */\n children: string;\n /** The semantic component to render the Button. Preferrably `\"button\"`. Defaults to `\"button\"`. Native props will be passed to this component. */\n component?: C;\n} & Omit<ComponentProps<C>, \"component\">;\n\nconst Dialog: FC<Props> & DialogSubcomponents = ({ isOpen, onClose, zIndex, children }) => {\n const { wrapper } = generateClasses();\n const { innerOpen } = useInnerOpen(isOpen);\n\n return (\n <Overlay isOpen={innerOpen} onClose={onClose} zIndex={zIndex} isDialog componentName=\"dialog\">\n <div className={wrapper()}>{children}</div>\n </Overlay>\n );\n};\n\nconst Title: FC<DialogTitleProps> = ({ children }) => {\n const { title } = generateClasses();\n\n return <DialogPrimitive.Title className={title()}>{children}</DialogPrimitive.Title>;\n};\n\nconst Content: FC<DialogContentProps> = ({ children }) => {\n const { scrollArea, contentWrapper } = generateClasses();\n\n return (\n <div className={scrollArea()}>\n <div className={contentWrapper()}>{children}</div>\n </div>\n );\n};\n\nconst ButtonSection: FC<DialogButtonSectionProps> = ({ children }) => {\n const { buttonSection } = generateClasses();\n\n return <div className={buttonSection()}>{children}</div>;\n};\n\nconst PrimaryButton = <C extends ElementType>({ children, component = \"button\" as C, ...props }: DialogButtonProps<C>) => {\n const Component: ElementType = component;\n return (\n <Button component={Component} {...props} contentWidth size=\"large\">\n {children}\n </Button>\n );\n};\n\nconst SecondaryButton = <C extends ElementType>({ children, component = \"button\" as C, ...props }: DialogButtonProps<C>) => {\n const Component: ElementType = component;\n return (\n <Button component={Component} {...props} contentWidth variant=\"secondary\" size=\"large\">\n {children}\n </Button>\n );\n};\n\nDialog.displayName = \"Dialog\";\n\nDialog.Title = Title;\nTitle.displayName = \"Dialog.Title\";\n\nDialog.Content = Content;\nContent.displayName = \"Dialog.Content\";\n\nDialog.ButtonSection = ButtonSection;\nButtonSection.displayName = \"Dialog.ButtonSection\";\n\nDialog.PrimaryButton = PrimaryButton;\nObject.assign(PrimaryButton, {\n displayName: \"Dialog.PrimaryButton\",\n} satisfies Pick<FunctionComponent, \"displayName\">);\n\nDialog.SecondaryButton = SecondaryButton;\nObject.assign(SecondaryButton, {\n displayName: \"Dialog.SecondaryButton\",\n} satisfies Pick<FunctionComponent, \"displayName\">);\n\nexport default Dialog;\n"],"mappings":";;;;;;;;;AAUA,IAAM,IAAkB,EAAG,EACzB,OAAO;CACL,OAAO;CACP,SAAS;CACT,YAAY;CACZ,gBAAgB;CAChB,eAAe;AACjB,EACF,CAAC,GA2CK,KAA2C,EAAE,WAAQ,YAAS,WAAQ,kBAAe;CACzF,IAAM,EAAE,eAAY,EAAgB,GAC9B,EAAE,iBAAc,EAAa,CAAM;CAEzC,OACE,kBAAC,GAAD;EAAS,QAAQ;EAAoB;EAAiB;EAAQ,UAAA;EAAS,eAAc;EACnF,UAAA,kBAAC,OAAD;GAAK,WAAW,EAAQ;GAAI;EAAc,CAAA;CACnC,CAAA;AAEb,GAEM,KAA+B,EAAE,kBAAe;CACpD,IAAM,EAAE,aAAU,EAAgB;CAElC,OAAO,kBAAC,EAAgB,OAAjB;EAAuB,WAAW,EAAM;EAAI;CAAgC,CAAA;AACrF,GAEM,KAAmC,EAAE,kBAAe;CACxD,IAAM,EAAE,eAAY,sBAAmB,EAAgB;CAEvD,OACE,kBAAC,OAAD;EAAK,WAAW,EAAW;EACzB,UAAA,kBAAC,OAAD;GAAK,WAAW,EAAe;GAAI;EAAc,CAAA;CAC9C,CAAA;AAET,GAEM,KAA+C,EAAE,kBAAe;CACpE,IAAM,EAAE,qBAAkB,EAAgB;CAE1C,OAAO,kBAAC,OAAD;EAAK,WAAW,EAAc;EAAI;CAAc,CAAA;AACzD,GAEM,KAAwC,EAAE,aAAU,eAAY,UAAe,GAAG,QAGpF,kBAAC,GAAD;CAAmB;CAAW,GAAI;CAAO,cAAA;CAAa,MAAK;CACxD;AACK,CAAA,GAIN,KAA0C,EAAE,aAAU,eAAY,UAAe,GAAG,QAGtF,kBAAC,GAAD;CAAmB;CAAW,GAAI;CAAO,cAAA;CAAa,SAAQ;CAAY,MAAK;CAC5E;AACK,CAAA;AAIZ,EAAO,cAAc,UAErB,EAAO,QAAQ,GACf,EAAM,cAAc,gBAEpB,EAAO,UAAU,GACjB,EAAQ,cAAc,kBAEtB,EAAO,gBAAgB,GACvB,EAAc,cAAc,wBAE5B,EAAO,gBAAgB,GACvB,OAAO,OAAO,GAAe,EAC3B,aAAa,uBACf,CAAkD,GAElD,EAAO,kBAAkB,GACzB,OAAO,OAAO,GAAiB,EAC7B,aAAa,yBACf,CAAkD"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import t from "
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { InputWrapper as c } from "@bonprix-ds/internal-components";
|
|
1
|
+
import e from "@bonprix-ds/react-icon-button";
|
|
2
|
+
import { useId as t, useRef as n, useState as r } from "react";
|
|
3
|
+
import { tv as i } from "tailwind-variants";
|
|
4
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
|
+
import { InputWrapper as s } from "@bonprix-ds/internal-components";
|
|
7
6
|
//#region src/components/InputFields/BaseInputField/BaseInputField.tsx
|
|
8
|
-
var
|
|
7
|
+
var c = i({
|
|
9
8
|
slots: {
|
|
10
9
|
root: "preflight w-full group",
|
|
11
10
|
container: "input flex gap-3 px-3 py-[0.6875rem]",
|
|
@@ -24,7 +23,10 @@ var l = a({
|
|
|
24
23
|
false: ""
|
|
25
24
|
},
|
|
26
25
|
hideClear: { true: { input: "h-6" } },
|
|
27
|
-
error: {
|
|
26
|
+
error: {
|
|
27
|
+
true: "",
|
|
28
|
+
false: ""
|
|
29
|
+
}
|
|
28
30
|
},
|
|
29
31
|
compoundVariants: [{
|
|
30
32
|
hasValue: !0,
|
|
@@ -34,31 +36,31 @@ var l = a({
|
|
|
34
36
|
iconSeparator: "group-hover:visible group-focus-within:visible"
|
|
35
37
|
}
|
|
36
38
|
}]
|
|
37
|
-
}),
|
|
38
|
-
let F =
|
|
39
|
+
}), l = ({ type: i, onFocus: l, onBlur: u, onKeyDown: d, onKeyUp: ee, inputRef: f, label: p, name: m, id: h, helperText: g = "", errorText: _ = "", disabled: v = !1, required: y = !1, error: b = !1, inputMode: x, pattern: S, autoComplete: C, autoCorrect: w, spellCheck: te, minLength: T, maxLength: E, hideClear: D = !1, describedBy: O, buttonIcon: k, iconButtonType: A = "button", onIconButtonClick: j, iconButtonLabel: M, componentName: N, ...P }) => {
|
|
40
|
+
let F = t(), I = h ?? F, L = t(), R = t(), z;
|
|
39
41
|
z = P.value === void 0 ? !!P.defaultValue : !!P.value;
|
|
40
|
-
let [B, V] =
|
|
42
|
+
let [B, V] = r(!1), [H, U] = r(z), W = H || B, G = n(null), K = f ?? G, { root: q, container: J, input: Y, buttonSection: X, clearButton: Z, iconSeparator: Q } = c({
|
|
41
43
|
disabled: v,
|
|
42
44
|
hasValue: H,
|
|
43
45
|
hideClear: D,
|
|
44
46
|
error: b
|
|
45
|
-
}),
|
|
46
|
-
V(!0),
|
|
47
|
-
},
|
|
48
|
-
V(!1),
|
|
49
|
-
},
|
|
47
|
+
}), ne = () => {
|
|
48
|
+
V(!0), l && l();
|
|
49
|
+
}, re = () => {
|
|
50
|
+
V(!1), u && u();
|
|
51
|
+
}, ie = (e) => {
|
|
50
52
|
let t = e.currentTarget.value;
|
|
51
53
|
P.onChange?.(t), H !== !!t && U(!!t);
|
|
52
|
-
},
|
|
53
|
-
P.value ? P.onChange("") :
|
|
54
|
-
},
|
|
55
|
-
return g && ($ = L), b && _ && ($ = $ ? $ + " " + R : R), O && ($ = $ ? $ + " " + O : O), /* @__PURE__ */
|
|
56
|
-
className:
|
|
54
|
+
}, ae = () => {
|
|
55
|
+
P.value ? P.onChange("") : K.current && (K.current.value = ""), U(!1), K.current?.focus();
|
|
56
|
+
}, oe = k && !D, se = !D || k, $;
|
|
57
|
+
return g && ($ = L), b && _ && ($ = $ ? $ + " " + R : R), O && ($ = $ ? $ + " " + O : O), /* @__PURE__ */ a("div", {
|
|
58
|
+
className: q(),
|
|
57
59
|
"data-fix-chrome-page-load-autofill": !0,
|
|
58
|
-
children: /* @__PURE__ */
|
|
59
|
-
label:
|
|
60
|
+
children: /* @__PURE__ */ a(s, {
|
|
61
|
+
label: p,
|
|
60
62
|
id: I,
|
|
61
|
-
labelFloated:
|
|
63
|
+
labelFloated: W,
|
|
62
64
|
disabled: v,
|
|
63
65
|
required: y,
|
|
64
66
|
helperText: g,
|
|
@@ -67,47 +69,47 @@ var l = a({
|
|
|
67
69
|
errorText: _,
|
|
68
70
|
errorTextId: R,
|
|
69
71
|
componentName: N,
|
|
70
|
-
children: /* @__PURE__ */
|
|
71
|
-
className:
|
|
72
|
-
children: [/* @__PURE__ */
|
|
72
|
+
children: /* @__PURE__ */ o("div", {
|
|
73
|
+
className: J(),
|
|
74
|
+
children: [/* @__PURE__ */ a("input", {
|
|
73
75
|
...P,
|
|
74
|
-
type:
|
|
75
|
-
className:
|
|
76
|
+
type: i,
|
|
77
|
+
className: Y(),
|
|
76
78
|
id: I,
|
|
77
|
-
name:
|
|
78
|
-
onChange:
|
|
79
|
-
onFocus:
|
|
80
|
-
onBlur:
|
|
81
|
-
onKeyDown:
|
|
82
|
-
onKeyUp:
|
|
79
|
+
name: m,
|
|
80
|
+
onChange: ie,
|
|
81
|
+
onFocus: ne,
|
|
82
|
+
onBlur: re,
|
|
83
|
+
onKeyDown: d,
|
|
84
|
+
onKeyUp: ee,
|
|
83
85
|
inputMode: x,
|
|
84
86
|
pattern: S,
|
|
85
87
|
autoComplete: C,
|
|
86
88
|
autoCorrect: w,
|
|
87
|
-
spellCheck:
|
|
88
|
-
ref:
|
|
89
|
+
spellCheck: te,
|
|
90
|
+
ref: K,
|
|
89
91
|
minLength: T,
|
|
90
92
|
maxLength: E,
|
|
91
93
|
required: y,
|
|
92
94
|
"aria-describedby": $,
|
|
93
95
|
"aria-invalid": b ? "true" : void 0,
|
|
94
96
|
disabled: v
|
|
95
|
-
}),
|
|
96
|
-
className:
|
|
97
|
+
}), se && /* @__PURE__ */ o("div", {
|
|
98
|
+
className: X(),
|
|
97
99
|
children: [
|
|
98
|
-
!D && /* @__PURE__ */
|
|
99
|
-
className:
|
|
100
|
-
children: /* @__PURE__ */
|
|
100
|
+
!D && /* @__PURE__ */ a("div", {
|
|
101
|
+
className: Z(),
|
|
102
|
+
children: /* @__PURE__ */ a(e, {
|
|
101
103
|
variant: "tertiary",
|
|
102
104
|
size: "small",
|
|
103
105
|
type: "button",
|
|
104
106
|
icon: "closer",
|
|
105
|
-
onClick:
|
|
107
|
+
onClick: ae,
|
|
106
108
|
label: "Eingabe löschen"
|
|
107
109
|
})
|
|
108
110
|
}),
|
|
109
|
-
|
|
110
|
-
k && /* @__PURE__ */
|
|
111
|
+
oe && /* @__PURE__ */ a("span", { className: Q() }),
|
|
112
|
+
k && /* @__PURE__ */ a(e, {
|
|
111
113
|
variant: "tertiary",
|
|
112
114
|
size: "small",
|
|
113
115
|
type: A,
|
|
@@ -123,6 +125,6 @@ var l = a({
|
|
|
123
125
|
});
|
|
124
126
|
};
|
|
125
127
|
//#endregion
|
|
126
|
-
export {
|
|
128
|
+
export { l as default };
|
|
127
129
|
|
|
128
130
|
//# sourceMappingURL=BaseInputField.js.map
|