@skodaflow/web-library 8.2.0 → 8.3.1
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/cjs/components/advancedTable/agGrid.d.ts +15 -0
- package/cjs/components/advancedTable/agGrid.js +1 -1
- package/cjs/components/advancedTable/agGrid.js.map +1 -1
- package/cjs/components/advancedTable/agGridIcons.d.ts +8 -2
- package/cjs/components/advancedTable/agGridIcons.js +1 -1
- package/cjs/components/advancedTable/agGridIcons.js.map +1 -1
- package/cjs/components/advancedTable/agGridSkodaTheme.js +1 -1
- package/cjs/components/advancedTable/agGridSkodaTheme.js.map +1 -1
- package/cjs/components/bottomSheet/BottomSheet.d.ts +3 -0
- package/cjs/components/bottomSheet/BottomSheet.js.map +1 -1
- package/cjs/components/carousel/Autoplay.d.ts +10 -5
- package/cjs/components/carousel/Autoplay.js +1 -1
- package/cjs/components/carousel/Autoplay.js.map +1 -1
- package/cjs/components/carousel/Navigation.d.ts +2 -2
- package/cjs/components/carousel/Navigation.js +1 -1
- package/cjs/components/carousel/Navigation.js.map +1 -1
- package/cjs/components/carousel/hooks.js +1 -1
- package/cjs/components/carousel/hooks.js.map +1 -1
- package/cjs/components/code/Code.d.ts +8 -0
- package/cjs/components/code/Code.js +2 -0
- package/cjs/components/code/Code.js.map +1 -0
- package/cjs/components/code/index.d.ts +1 -0
- package/cjs/components/errorContent/ErrorContent.js +1 -1
- package/cjs/components/errorContent/ErrorContent.js.map +1 -1
- package/cjs/components/footer/FooterIconButton.d.ts +1 -1
- package/cjs/components/footer/FooterIconButton.js.map +1 -1
- package/cjs/components/footer/FooterMenu.js +1 -1
- package/cjs/components/footer/FooterMenu.js.map +1 -1
- package/cjs/components/footer/FooterMenuCollapse.d.ts +25 -0
- package/cjs/components/footer/FooterMenuCollapse.js +2 -0
- package/cjs/components/footer/FooterMenuCollapse.js.map +1 -0
- package/cjs/components/header/Header.js +1 -1
- package/cjs/components/header/Header.js.map +1 -1
- package/cjs/components/header/HeaderLogo.d.ts +1 -1
- package/cjs/components/header/HeaderNavigationHero.d.ts +1 -1
- package/cjs/components/header/HeaderNavigationHero.js.map +1 -1
- package/cjs/components/header/HeaderNavigationLink.js +1 -1
- package/cjs/components/header/HeaderNavigationLink.js.map +1 -1
- package/cjs/components/icon/filled/CarChargingFilledIcon.d.ts +6 -0
- package/cjs/components/icon/filled/CarChargingFilledIcon.js +2 -0
- package/cjs/components/icon/filled/CarChargingFilledIcon.js.map +1 -0
- package/cjs/components/icon/filled/EmissionLabelFilledIcon.d.ts +6 -0
- package/cjs/components/icon/filled/EmissionLabelFilledIcon.js +2 -0
- package/cjs/components/icon/filled/EmissionLabelFilledIcon.js.map +1 -0
- package/cjs/components/icon/filled/PictureErrorFilledIcon.d.ts +6 -0
- package/cjs/components/icon/filled/PictureErrorFilledIcon.js +2 -0
- package/cjs/components/icon/filled/PictureErrorFilledIcon.js.map +1 -0
- package/cjs/components/icon/filled/PowerpassFilledIcon.d.ts +6 -0
- package/cjs/components/icon/filled/PowerpassFilledIcon.js +2 -0
- package/cjs/components/icon/filled/PowerpassFilledIcon.js.map +1 -0
- package/cjs/components/icon/filled/index.d.ts +4 -0
- package/cjs/components/icon/icon.definitions.js +1 -1
- package/cjs/components/icon/icon.definitions.js.map +1 -1
- package/cjs/components/icon/stroke/CarChargingIcon.d.ts +6 -0
- package/cjs/components/icon/stroke/CarChargingIcon.js +2 -0
- package/cjs/components/icon/stroke/CarChargingIcon.js.map +1 -0
- package/cjs/components/icon/stroke/EmissionLabelIcon.d.ts +6 -0
- package/cjs/components/icon/stroke/EmissionLabelIcon.js +2 -0
- package/cjs/components/icon/stroke/EmissionLabelIcon.js.map +1 -0
- package/cjs/components/icon/stroke/PictureErrorIcon.d.ts +6 -0
- package/cjs/components/icon/stroke/PictureErrorIcon.js +2 -0
- package/cjs/components/icon/stroke/PictureErrorIcon.js.map +1 -0
- package/cjs/components/icon/stroke/PowerpassIcon.d.ts +6 -0
- package/cjs/components/icon/stroke/PowerpassIcon.js +2 -0
- package/cjs/components/icon/stroke/PowerpassIcon.js.map +1 -0
- package/cjs/components/icon/stroke/index.d.ts +4 -0
- package/cjs/components/index.d.ts +1 -0
- package/cjs/components/label/Label.js +1 -1
- package/cjs/components/label/Label.js.map +1 -1
- package/cjs/components/notification/NotificationCenterHeaderButton.d.ts +1 -1
- package/cjs/components/playPauseButton/PlayPauseButton.d.ts +1 -1
- package/cjs/components/promptBar/PromptAttachments.js +1 -1
- package/cjs/components/promptBar/PromptAttachments.js.map +1 -1
- package/cjs/components/promptBar/PromptSubmitIconButton.d.ts +1 -1
- package/cjs/components/promptBar/PromptSubmitIconButton.js +1 -1
- package/cjs/components/promptBar/PromptSubmitIconButton.js.map +1 -1
- package/cjs/components/quickLink/QuickLink.js +1 -1
- package/cjs/components/quickLink/QuickLink.js.map +1 -1
- package/cjs/components/search/Search.js +1 -1
- package/cjs/components/search/Search.js.map +1 -1
- package/cjs/components/skodaThemeProvider/SkodaThemeProvider.js +1 -1
- package/cjs/components/skodaThemeProvider/SkodaThemeProvider.js.map +1 -1
- package/cjs/components/skodaThemeProvider/plugins/stylisContainerPlugin.d.ts +1 -2
- package/cjs/components/skodaThemeProvider/plugins/stylisContainerPlugin.js +1 -1
- package/cjs/components/skodaThemeProvider/plugins/stylisContainerPlugin.js.map +1 -1
- package/cjs/components/textAndCta/AppStoreButton.js +1 -1
- package/cjs/components/textAndCta/AppStoreButton.js.map +1 -1
- package/cjs/components/textAndCta/TextAndCta.d.ts +1 -1
- package/cjs/components/tooltipHeader/TooltipHeader.d.ts +2 -1
- package/cjs/components/upload/Upload.d.ts +1 -1
- package/cjs/components/upload/components/uploadList/UploadListItem.d.ts +1 -1
- package/cjs/components/upload/components/uploadPreview/UploadPreviewImage.d.ts +1 -1
- package/cjs/components/upload/components/uploadWrapper/UploadContent.d.ts +2 -2
- package/cjs/components/upload/components/uploadWrapper/UploadWrapper.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/materialui/autocomplete/autocomplete.theme.js +1 -1
- package/cjs/materialui/autocomplete/autocomplete.theme.js.map +1 -1
- package/cjs/materialui/badge/badge.theme.js +1 -1
- package/cjs/materialui/badge/badge.theme.js.map +1 -1
- package/cjs/materialui/button/buttonBase.theme.js +1 -1
- package/cjs/materialui/button/buttonBase.theme.js.map +1 -1
- package/cjs/materialui/card/Card.js +1 -1
- package/cjs/materialui/card/Card.js.map +1 -1
- package/cjs/materialui/card/card.theme.js +1 -1
- package/cjs/materialui/card/card.theme.js.map +1 -1
- package/cjs/materialui/datepicker/datecalendar.theme.d.ts +1178 -1178
- package/cjs/materialui/datepicker/digitalclock.theme.d.ts +1176 -1176
- package/cjs/materialui/dialog/DialogTitle.js +1 -1
- package/cjs/materialui/dialog/DialogTitle.js.map +1 -1
- package/cjs/materialui/slider/SliderValues.d.ts +5 -0
- package/cjs/materialui/slider/SliderValues.js +1 -1
- package/cjs/materialui/slider/SliderValues.js.map +1 -1
- package/cjs/materialui/stepper/StepLabelIcon.d.ts +1 -1
- package/cjs/materialui/stepper/StepLabelIcon.js +1 -1
- package/cjs/materialui/stepper/StepLabelIcon.js.map +1 -1
- package/cjs/materialui/switch/switch.theme.js +1 -1
- package/cjs/materialui/switch/switch.theme.js.map +1 -1
- package/cjs/materialui/table/stories/actions.d.ts +1 -1
- package/cjs/materialui/table/stories/basic.d.ts +1 -1
- package/cjs/materialui/table/stories/interactive.d.ts +1 -1
- package/cjs/materialui/table/stories/pagination.d.ts +3 -3
- package/cjs/materialui/table/stories/scrollbar.d.ts +1 -1
- package/cjs/materialui/table/stories/selectSort.d.ts +1 -1
- package/cjs/materialui/table/stories/small.d.ts +1 -1
- package/cjs/materialui/table/tablePagination.theme.js +1 -1
- package/cjs/materialui/table/tablePagination.theme.js.map +1 -1
- package/cjs/materialui/tabs/TabPanel.d.ts +2 -2
- package/cjs/materialui/tabs/TabsScrollButton.d.ts +1 -1
- package/cjs/materialui/tabs/tabs.theme.js +1 -1
- package/cjs/materialui/tabs/tabs.theme.js.map +1 -1
- package/cjs/materialui/textfield/inputBase.theme.js +1 -1
- package/cjs/materialui/textfield/inputBase.theme.js.map +1 -1
- package/cjs/materialui/textfield/inputLabel.theme.js +1 -1
- package/cjs/materialui/textfield/inputLabel.theme.js.map +1 -1
- package/cjs/materialui/theme/paletteDark.theme.js +1 -1
- package/cjs/materialui/theme/paletteDark.theme.js.map +1 -1
- package/cjs/materialui/theme/theme.extensions.d.ts +10 -0
- package/cjs/materialui/themeProvider/baseline.theme.js +1 -1
- package/cjs/materialui/themeProvider/baseline.theme.js.map +1 -1
- package/cjs/materialui/typography/typography.theme.d.ts +4 -0
- package/cjs/materialui/typography/typography.theme.js +1 -1
- package/cjs/materialui/typography/typography.theme.js.map +1 -1
- package/components/advancedTable/agGrid.d.ts +15 -0
- package/components/advancedTable/agGrid.js +1 -1
- package/components/advancedTable/agGrid.js.map +1 -1
- package/components/advancedTable/agGridIcons.d.ts +8 -2
- package/components/advancedTable/agGridIcons.js +1 -1
- package/components/advancedTable/agGridIcons.js.map +1 -1
- package/components/advancedTable/agGridSkodaTheme.js +1 -1
- package/components/advancedTable/agGridSkodaTheme.js.map +1 -1
- package/components/bottomSheet/BottomSheet.d.ts +3 -0
- package/components/bottomSheet/BottomSheet.js.map +1 -1
- package/components/carousel/Autoplay.d.ts +10 -5
- package/components/carousel/Autoplay.js +1 -1
- package/components/carousel/Autoplay.js.map +1 -1
- package/components/carousel/Navigation.d.ts +2 -2
- package/components/carousel/Navigation.js +1 -1
- package/components/carousel/Navigation.js.map +1 -1
- package/components/carousel/hooks.js +1 -1
- package/components/carousel/hooks.js.map +1 -1
- package/components/code/Code.d.ts +8 -0
- package/components/code/Code.js +2 -0
- package/components/code/Code.js.map +1 -0
- package/components/code/index.d.ts +1 -0
- package/components/errorContent/ErrorContent.js +1 -1
- package/components/errorContent/ErrorContent.js.map +1 -1
- package/components/footer/FooterIconButton.d.ts +1 -1
- package/components/footer/FooterIconButton.js.map +1 -1
- package/components/footer/FooterMenu.js +1 -1
- package/components/footer/FooterMenu.js.map +1 -1
- package/components/footer/FooterMenuCollapse.d.ts +25 -0
- package/components/footer/FooterMenuCollapse.js +2 -0
- package/components/footer/FooterMenuCollapse.js.map +1 -0
- package/components/header/Header.js +1 -1
- package/components/header/Header.js.map +1 -1
- package/components/header/HeaderLogo.d.ts +1 -1
- package/components/header/HeaderNavigationHero.d.ts +1 -1
- package/components/header/HeaderNavigationHero.js.map +1 -1
- package/components/header/HeaderNavigationLink.js +1 -1
- package/components/header/HeaderNavigationLink.js.map +1 -1
- package/components/icon/filled/CarChargingFilledIcon.d.ts +6 -0
- package/components/icon/filled/CarChargingFilledIcon.js +2 -0
- package/components/icon/filled/CarChargingFilledIcon.js.map +1 -0
- package/components/icon/filled/EmissionLabelFilledIcon.d.ts +6 -0
- package/components/icon/filled/EmissionLabelFilledIcon.js +2 -0
- package/components/icon/filled/EmissionLabelFilledIcon.js.map +1 -0
- package/components/icon/filled/PictureErrorFilledIcon.d.ts +6 -0
- package/components/icon/filled/PictureErrorFilledIcon.js +2 -0
- package/components/icon/filled/PictureErrorFilledIcon.js.map +1 -0
- package/components/icon/filled/PowerpassFilledIcon.d.ts +6 -0
- package/components/icon/filled/PowerpassFilledIcon.js +2 -0
- package/components/icon/filled/PowerpassFilledIcon.js.map +1 -0
- package/components/icon/filled/index.d.ts +4 -0
- package/components/icon/icon.definitions.js +1 -1
- package/components/icon/icon.definitions.js.map +1 -1
- package/components/icon/stroke/CarChargingIcon.d.ts +6 -0
- package/components/icon/stroke/CarChargingIcon.js +2 -0
- package/components/icon/stroke/CarChargingIcon.js.map +1 -0
- package/components/icon/stroke/EmissionLabelIcon.d.ts +6 -0
- package/components/icon/stroke/EmissionLabelIcon.js +2 -0
- package/components/icon/stroke/EmissionLabelIcon.js.map +1 -0
- package/components/icon/stroke/PictureErrorIcon.d.ts +6 -0
- package/components/icon/stroke/PictureErrorIcon.js +2 -0
- package/components/icon/stroke/PictureErrorIcon.js.map +1 -0
- package/components/icon/stroke/PowerpassIcon.d.ts +6 -0
- package/components/icon/stroke/PowerpassIcon.js +2 -0
- package/components/icon/stroke/PowerpassIcon.js.map +1 -0
- package/components/icon/stroke/index.d.ts +4 -0
- package/components/index.d.ts +1 -0
- package/components/label/Label.js +1 -1
- package/components/label/Label.js.map +1 -1
- package/components/notification/NotificationCenterHeaderButton.d.ts +1 -1
- package/components/playPauseButton/PlayPauseButton.d.ts +1 -1
- package/components/promptBar/PromptAttachments.js +1 -1
- package/components/promptBar/PromptAttachments.js.map +1 -1
- package/components/promptBar/PromptSubmitIconButton.d.ts +1 -1
- package/components/promptBar/PromptSubmitIconButton.js +1 -1
- package/components/promptBar/PromptSubmitIconButton.js.map +1 -1
- package/components/quickLink/QuickLink.js +1 -1
- package/components/quickLink/QuickLink.js.map +1 -1
- package/components/search/Search.js +1 -1
- package/components/search/Search.js.map +1 -1
- package/components/skodaThemeProvider/SkodaThemeProvider.js +1 -1
- package/components/skodaThemeProvider/SkodaThemeProvider.js.map +1 -1
- package/components/skodaThemeProvider/plugins/stylisContainerPlugin.d.ts +1 -2
- package/components/skodaThemeProvider/plugins/stylisContainerPlugin.js +1 -1
- package/components/skodaThemeProvider/plugins/stylisContainerPlugin.js.map +1 -1
- package/components/textAndCta/AppStoreButton.js +1 -1
- package/components/textAndCta/AppStoreButton.js.map +1 -1
- package/components/textAndCta/TextAndCta.d.ts +1 -1
- package/components/tooltipHeader/TooltipHeader.d.ts +2 -1
- package/components/upload/Upload.d.ts +1 -1
- package/components/upload/components/uploadList/UploadListItem.d.ts +1 -1
- package/components/upload/components/uploadPreview/UploadPreviewImage.d.ts +1 -1
- package/components/upload/components/uploadWrapper/UploadContent.d.ts +2 -2
- package/components/upload/components/uploadWrapper/UploadWrapper.d.ts +1 -1
- package/index.js +1 -1
- package/materialui/autocomplete/autocomplete.theme.js +1 -1
- package/materialui/autocomplete/autocomplete.theme.js.map +1 -1
- package/materialui/badge/badge.theme.js +1 -1
- package/materialui/badge/badge.theme.js.map +1 -1
- package/materialui/button/buttonBase.theme.js +1 -1
- package/materialui/button/buttonBase.theme.js.map +1 -1
- package/materialui/card/Card.js +1 -1
- package/materialui/card/Card.js.map +1 -1
- package/materialui/card/card.theme.js +1 -1
- package/materialui/card/card.theme.js.map +1 -1
- package/materialui/datepicker/datecalendar.theme.d.ts +1178 -1178
- package/materialui/datepicker/digitalclock.theme.d.ts +1176 -1176
- package/materialui/dialog/DialogTitle.js +1 -1
- package/materialui/dialog/DialogTitle.js.map +1 -1
- package/materialui/slider/SliderValues.d.ts +5 -0
- package/materialui/slider/SliderValues.js +1 -1
- package/materialui/slider/SliderValues.js.map +1 -1
- package/materialui/stepper/StepLabelIcon.d.ts +1 -1
- package/materialui/stepper/StepLabelIcon.js +1 -1
- package/materialui/stepper/StepLabelIcon.js.map +1 -1
- package/materialui/switch/switch.theme.js +1 -1
- package/materialui/switch/switch.theme.js.map +1 -1
- package/materialui/table/stories/actions.d.ts +1 -1
- package/materialui/table/stories/basic.d.ts +1 -1
- package/materialui/table/stories/interactive.d.ts +1 -1
- package/materialui/table/stories/pagination.d.ts +3 -3
- package/materialui/table/stories/scrollbar.d.ts +1 -1
- package/materialui/table/stories/selectSort.d.ts +1 -1
- package/materialui/table/stories/small.d.ts +1 -1
- package/materialui/table/tablePagination.theme.js +1 -1
- package/materialui/table/tablePagination.theme.js.map +1 -1
- package/materialui/tabs/TabPanel.d.ts +2 -2
- package/materialui/tabs/TabsScrollButton.d.ts +1 -1
- package/materialui/tabs/tabs.theme.js +1 -1
- package/materialui/tabs/tabs.theme.js.map +1 -1
- package/materialui/textfield/inputBase.theme.js +1 -1
- package/materialui/textfield/inputBase.theme.js.map +1 -1
- package/materialui/textfield/inputLabel.theme.js +1 -1
- package/materialui/textfield/inputLabel.theme.js.map +1 -1
- package/materialui/theme/paletteDark.theme.js +1 -1
- package/materialui/theme/paletteDark.theme.js.map +1 -1
- package/materialui/theme/theme.extensions.d.ts +10 -0
- package/materialui/themeProvider/baseline.theme.js +1 -1
- package/materialui/themeProvider/baseline.theme.js.map +1 -1
- package/materialui/typography/typography.theme.d.ts +4 -0
- package/materialui/typography/typography.theme.js +1 -1
- package/materialui/typography/typography.theme.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorContent.js","sources":["../../../../../src/components/errorContent/ErrorContent.tsx"],"sourcesContent":["import { Box, BoxProps, Typography, TypographyProps } from '@mui/material';\nimport React, { ElementType, FC, forwardRef, ReactNode } from 'react';\nimport { sxOverride } from '@/src/utils/sxOverride';\n\nexport interface ErrorContentProps extends BoxProps<ElementType> {\n /**\n * Error Status code, eg. 404 or 500\n */\n status?: ReactNode;\n /**\n * Short message describing the error\n */\n message?: ReactNode;\n /**\n * Longer description of the error\n */\n description?: ReactNode;\n /**\n * Actions that user can interact with\n */\n actions?: ReactNode;\n /**\n * Stacktrace of an error\n */\n stacktrace?: ReactNode;\n /**\n * Properties passed to status code\n */\n statusProps?: TypographyProps<ElementType>;\n /**\n * Properties passed to message\n */\n messageProps?: TypographyProps<ElementType>;\n /**\n * Properties passed to description\n */\n descriptionProps?: TypographyProps<ElementType>;\n /**\n * Properties passed to wrapper of actions\n */\n actionsProps?: BoxProps<ElementType>;\n /**\n * Properties passed to code stacktrace\n */\n stacktraceProps?: BoxProps<ElementType>;\n}\n\n/**\n * Component that renders an information about error\n */\nexport const ErrorContent: FC<ErrorContentProps> = forwardRef(\n (\n {\n sx,\n children,\n status,\n message,\n actions,\n description,\n stacktrace,\n statusProps,\n messageProps,\n descriptionProps,\n actionsProps,\n stacktraceProps,\n ...rest\n },\n ref,\n ) => {\n const { sx: actionsSx, ...restActions } = actionsProps ?? {};\n const { sx: stacktraceSx, ...restStacktrace } = stacktraceProps ?? {};\n\n return (\n <Box\n sx={sxOverride(\n {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n gap: { xs: 2, md: 4 },\n textAlign: 'center',\n margin: '0 auto',\n width: '600px',\n maxWidth: '100%',\n p: 2,\n },\n sx,\n )}\n ref={ref}\n {...rest}\n >\n {status && (\n <Typography component=\"h1\" variant=\"display\" data-testid=\"ErrorContent.status\" {...statusProps}>\n {status}\n </Typography>\n )}\n {message && (\n <Typography component=\"h2\" variant=\"h3\" data-testid=\"ErrorContent.message\" {...messageProps}>\n {message}\n </Typography>\n )}\n {description && (\n <Typography data-testid=\"ErrorContent.description\" {...descriptionProps}>\n {description}\n </Typography>\n )}\n {children}\n {actions && (\n <Box\n sx={sxOverride(\n {\n display: 'flex',\n gap: 1,\n flexDirection: { xs: 'column', md: 'row' },\n alignItems: { xs: 'stretch', md: 'center' },\n justifyContent: 'center',\n },\n actionsSx,\n )}\n data-testid=\"ErrorContent.actions\"\n {...restActions}\n >\n {actions}\n </Box>\n )}\n {stacktrace && (\n <Box\n component=\"code\"\n sx={sxOverride(\n {\n display: 'block',\n border: 1,\n borderColor: 'divider',\n
|
|
1
|
+
{"version":3,"file":"ErrorContent.js","sources":["../../../../../src/components/errorContent/ErrorContent.tsx"],"sourcesContent":["import { Box, BoxProps, Typography, TypographyProps } from '@mui/material';\nimport React, { ElementType, FC, forwardRef, ReactNode } from 'react';\nimport { sxOverride } from '@/src/utils/sxOverride';\n\nexport interface ErrorContentProps extends BoxProps<ElementType> {\n /**\n * Error Status code, eg. 404 or 500\n */\n status?: ReactNode;\n /**\n * Short message describing the error\n */\n message?: ReactNode;\n /**\n * Longer description of the error\n */\n description?: ReactNode;\n /**\n * Actions that user can interact with\n */\n actions?: ReactNode;\n /**\n * Stacktrace of an error\n */\n stacktrace?: ReactNode;\n /**\n * Properties passed to status code\n */\n statusProps?: TypographyProps<ElementType>;\n /**\n * Properties passed to message\n */\n messageProps?: TypographyProps<ElementType>;\n /**\n * Properties passed to description\n */\n descriptionProps?: TypographyProps<ElementType>;\n /**\n * Properties passed to wrapper of actions\n */\n actionsProps?: BoxProps<ElementType>;\n /**\n * Properties passed to code stacktrace\n */\n stacktraceProps?: BoxProps<ElementType>;\n}\n\n/**\n * Component that renders an information about error\n */\nexport const ErrorContent: FC<ErrorContentProps> = forwardRef(\n (\n {\n sx,\n children,\n status,\n message,\n actions,\n description,\n stacktrace,\n statusProps,\n messageProps,\n descriptionProps,\n actionsProps,\n stacktraceProps,\n ...rest\n },\n ref,\n ) => {\n const { sx: actionsSx, ...restActions } = actionsProps ?? {};\n const { sx: stacktraceSx, ...restStacktrace } = stacktraceProps ?? {};\n\n return (\n <Box\n sx={sxOverride(\n {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n gap: { xs: 2, md: 4 },\n textAlign: 'center',\n margin: '0 auto',\n width: '600px',\n maxWidth: '100%',\n p: 2,\n },\n sx,\n )}\n ref={ref}\n {...rest}\n >\n {status && (\n <Typography component=\"h1\" variant=\"display\" data-testid=\"ErrorContent.status\" {...statusProps}>\n {status}\n </Typography>\n )}\n {message && (\n <Typography component=\"h2\" variant=\"h3\" data-testid=\"ErrorContent.message\" {...messageProps}>\n {message}\n </Typography>\n )}\n {description && (\n <Typography data-testid=\"ErrorContent.description\" {...descriptionProps}>\n {description}\n </Typography>\n )}\n {children}\n {actions && (\n <Box\n sx={sxOverride(\n {\n display: 'flex',\n gap: 1,\n flexDirection: { xs: 'column', md: 'row' },\n alignItems: { xs: 'stretch', md: 'center' },\n justifyContent: 'center',\n },\n actionsSx,\n )}\n data-testid=\"ErrorContent.actions\"\n {...restActions}\n >\n {actions}\n </Box>\n )}\n {stacktrace && (\n <Box\n component=\"code\"\n sx={sxOverride(\n {\n display: 'block',\n border: 1,\n borderColor: 'divider',\n overflow: 'auto',\n py: 1,\n px: 2,\n borderRadius: '8px',\n textAlign: 'left',\n alignSelf: 'stretch',\n },\n stacktraceSx,\n )}\n data-testid=\"ErrorContent.stacktrace\"\n {...restStacktrace}\n >\n {stacktrace}\n </Box>\n )}\n </Box>\n );\n },\n);\n"],"names":["ErrorContent","forwardRef","sx","children","status","message","actions","description","stacktrace","statusProps","messageProps","descriptionProps","actionsProps","stacktraceProps","rest","ref","actionsSx","restActions","stacktraceSx","restStacktrace","_jsxs","Box","sxOverride","display","flexDirection","alignItems","justifyContent","gap","xs","md","textAlign","margin","width","maxWidth","p","_jsx","Typography","component","variant","border","borderColor","overflow","py","px","borderRadius","alignSelf"],"mappings":"gJAkDO,MAAMA,EAAsCC,EAAAA,WACjD,EAEIC,KACAC,WACAC,SACAC,UACAC,UACAC,cACAC,aACAC,cACAC,eACAC,mBACAC,eACAC,qBACGC,GAELC,KAEA,MAAQb,GAAIc,KAAcC,GAAgBL,GAAgB,CAAA,GAClDV,GAAIgB,KAAiBC,GAAmBN,GAAmB,CAAA,EAEnE,OACEO,OAACC,EAAAA,KACCnB,GAAIoB,EAAAA,WACF,CACEC,QAAS,OACTC,cAAe,SACfC,WAAY,SACZC,eAAgB,SAChBC,IAAK,CAAEC,GAAI,EAAGC,GAAI,GAClBC,UAAW,SACXC,OAAQ,SACRC,MAAO,QACPC,SAAU,OACVC,EAAG,GAELhC,GAEFa,IAAKA,KACDD,EAAIX,SAAA,CAEPC,GACC+B,EAAAA,IAACC,aAAU,CAACC,UAAU,KAAKC,QAAQ,UAAS,cAAa,yBAA0B7B,EAAWN,SAC3FC,IAGJC,GACC8B,MAACC,EAAAA,YAAWC,UAAU,KAAKC,QAAQ,KAAI,cAAa,0BAA2B5B,EAAYP,SACxFE,IAGJE,GACC4B,EAAAA,IAACC,EAAAA,WAAU,CAAA,cAAa,8BAA+BzB,EAAgBR,SACpEI,IAGJJ,EACAG,GACC6B,EAAAA,IAACd,EAAAA,KACCnB,GAAIoB,EAAAA,WACF,CACEC,QAAS,OACTI,IAAK,EACLH,cAAe,CAAEI,GAAI,SAAUC,GAAI,OACnCJ,WAAY,CAAEG,GAAI,UAAWC,GAAI,UACjCH,eAAgB,UAElBV,GACD,cACW,0BACRC,EAAWd,SAEdG,IAGJE,GACC2B,EAAAA,IAACd,MAAG,CACFgB,UAAU,OACVnC,GAAIoB,aACF,CACEC,QAAS,QACTgB,OAAQ,EACRC,YAAa,UACbC,SAAU,OACVC,GAAI,EACJC,GAAI,EACJC,aAAc,MACdd,UAAW,OACXe,UAAW,WAEb3B,GACD,cACW,6BACRC,EAAchB,SAEjBK"}
|
|
@@ -3,6 +3,6 @@ import { IconButtonProps } from '@mui/material';
|
|
|
3
3
|
export interface FooterIconButtonProps extends IconButtonProps<ElementType> {
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* IconButton for the footer, can be used for social media
|
|
7
7
|
*/
|
|
8
8
|
export declare const FooterIconButton: FC<FooterIconButtonProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FooterIconButton.js","sources":["../../../../../src/components/footer/FooterIconButton.tsx"],"sourcesContent":["import React, { ElementType, FC, ForwardedRef, forwardRef } from 'react';\nimport { IconButton, IconButtonProps } from '@mui/material';\n\nexport interface FooterIconButtonProps extends IconButtonProps<ElementType> {}\n\n/**\n *
|
|
1
|
+
{"version":3,"file":"FooterIconButton.js","sources":["../../../../../src/components/footer/FooterIconButton.tsx"],"sourcesContent":["import React, { ElementType, FC, ForwardedRef, forwardRef } from 'react';\nimport { IconButton, IconButtonProps } from '@mui/material';\n\nexport interface FooterIconButtonProps extends IconButtonProps<ElementType> {}\n\n/**\n * IconButton for the footer, can be used for social media\n */\nexport const FooterIconButton: FC<FooterIconButtonProps> = forwardRef(({ children, ...rest }, ref) => {\n return (\n <IconButton\n size=\"medium\"\n color=\"white\"\n ref={ref as ForwardedRef<HTMLButtonElement>}\n data-testid=\"FooterIconButton\"\n {...rest}\n >\n {children}\n </IconButton>\n );\n});\n"],"names":["FooterIconButton","forwardRef","children","rest","ref","_jsx","IconButton","size","color"],"mappings":"8FAQO,MAAMA,EAA8CC,EAAAA,WAAW,EAAGC,cAAaC,GAAQC,IAE1FC,EAAAA,IAACC,EAAAA,WAAU,CACTC,KAAK,SACLC,MAAM,QACNJ,IAAKA,EAAsC,cAC/B,sBACRD,EAAID,SAEPA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),o=require("react"),r=require("./FooterAccordion.js"),t=require("./FooterMenuCollapse.js"),n=require("../../utils/sxOverride/sxOverride.js");const i=o.forwardRef(({sx:i,children:a,label:s,accordionSummaryProps:d,contentProps:c,variant:l="auto",...u},p)=>{const{sx:x,...v}=c??{},{sx:f,...m}=d??{},y=e=>"list"===l?"&":e.breakpoints.up("lg"),[M,b]=o.useState(!1);return e.jsx(r.FooterAccordion,{ref:p,"data-testid":"FooterMenu",expanded:"list"===l||M,onChange:(e,o)=>b(o),variant:"standard",..."auto"===l&&{slots:{transition:t.FooterMenuCollapse}},sx:n.sxOverride(e=>({flexBasis:{lg:"20%"},borderColor:"onSurface.os700",..."accordion"!==l&&{[y(e)]:{border:"none"}}}),i),accordionSummaryProps:{"data-testid":"FooterMenu.label",sx:n.sxOverride(e=>({padding:"14px 0","& .MuiLink-root":{...e.typography.subheadline,p:0,"&, &:hover":{textDecoration:"none",color:"common.white"}},..."accordion"!==l&&{[y(e)]:{padding:"18px 0 8px",overflow:"visible","&&:not(.Mui-disabled)":{cursor:"unset"},"& .MuiAccordionSummary-expandIconWrapper":{display:"none"}}}}),f),...m},label:s,contentProps:{component:"div","data-testid":"FooterMenu.content",sx:n.sxOverride(e=>({display:"flex",alignItems:"flex-start",justifyContent:"flex-start",flexDirection:"column",gap:1.5,"& .MuiLink-root":{...e.typography.caption2,p:0,"&, &:hover":{textDecoration:"none",color:"onSurface.os200"}}}),x),...v},...u,children:a})});exports.FooterMenu=i;
|
|
2
2
|
//# sourceMappingURL=FooterMenu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FooterMenu.js","sources":["../../../../../src/components/footer/FooterMenu.tsx"],"sourcesContent":["import React, { FC, forwardRef, useState } from 'react';\nimport { Theme
|
|
1
|
+
{"version":3,"file":"FooterMenu.js","sources":["../../../../../src/components/footer/FooterMenu.tsx"],"sourcesContent":["import React, { FC, forwardRef, useState } from 'react';\nimport { Theme } from '@mui/material';\nimport { FooterAccordion, FooterAccordionProps } from './FooterAccordion';\nimport { FooterMenuCollapse } from './FooterMenuCollapse';\nimport { sxOverride } from '@/src/utils/sxOverride';\n\nexport interface FooterMenuProps extends Omit<FooterAccordionProps, 'variant' | 'children'> {\n /**\n * Items in the menu\n */\n children?: React.ReactNode;\n /**\n * Variant of the menu\n * - auto: renders on large resolution as list and on mobile as accordion\n * - list: renders as list with title\n * - accordion: renders as collapsible accordion\n * @default auto\n */\n variant?: 'auto' | 'list' | 'accordion';\n}\n\n/**\n * Section for the secondary links, copyright and optional button\n */\nexport const FooterMenu: FC<FooterMenuProps> = forwardRef(\n ({ sx, children, label, accordionSummaryProps, contentProps, variant = 'auto', ...rest }, ref) => {\n const { sx: contentSx, ...restContent } = contentProps ?? {};\n const { sx: accSummarySx, ...restAccSummary } = accordionSummaryProps ?? {};\n // variant is static, so no media query is needed (renders correctly during pre-render);\n // for auto, the desktop \"list\" look is applied from the lg breakpoint up, always for list\n const listLookSelector = (theme: Theme) => (variant === 'list' ? '&' : theme.breakpoints.up('lg'));\n const [expanded, setExpanded] = useState(false);\n\n return (\n <FooterAccordion\n ref={ref}\n data-testid=\"FooterMenu\"\n expanded={variant === 'list' ? true : expanded}\n onChange={(_, v) => setExpanded(v)}\n variant=\"standard\"\n {...(variant === 'auto' && { slots: { transition: FooterMenuCollapse } })}\n sx={sxOverride(\n (theme) => ({\n // spacing in the FooterSectionMenu, take max 1/5 of space\n flexBasis: { lg: '20%' },\n borderColor: 'onSurface.os700',\n ...(variant !== 'accordion' && {\n [listLookSelector(theme)]: { border: 'none' },\n }),\n }),\n sx,\n )}\n accordionSummaryProps={{\n ['data-testid']: 'FooterMenu.label',\n sx: sxOverride(\n (theme) => ({\n // adjust proportions\n padding: '14px 0',\n // manipulates style of links inside\n '& .MuiLink-root': {\n ...theme.typography.subheadline,\n p: 0,\n '&, &:hover': {\n textDecoration: 'none',\n color: 'common.white',\n },\n },\n // non-collapsible \"list\" appearance (always for list, desktop+ for auto)\n ...(variant !== 'accordion' && {\n [listLookSelector(theme)]: {\n // adjust proportions to be closer to menu\n padding: '18px 0 8px',\n // allow overflow of focus ring\n overflow: 'visible',\n // no longer clickable\n '&&:not(.Mui-disabled)': {\n cursor: 'unset',\n },\n // hide icon\n '& .MuiAccordionSummary-expandIconWrapper': {\n display: 'none',\n },\n },\n }),\n }),\n accSummarySx,\n ),\n ...restAccSummary,\n }}\n label={label}\n contentProps={{\n component: 'div',\n ['data-testid']: 'FooterMenu.content',\n sx: sxOverride(\n (theme) => ({\n display: 'flex',\n alignItems: 'flex-start',\n justifyContent: 'flex-start',\n flexDirection: 'column',\n gap: 1.5,\n // manipulates style of links inside\n '& .MuiLink-root': {\n ...theme.typography.caption2,\n p: 0,\n '&, &:hover': {\n textDecoration: 'none',\n color: 'onSurface.os200',\n },\n },\n }),\n contentSx,\n ),\n ...restContent,\n }}\n {...rest}\n >\n {children}\n </FooterAccordion>\n );\n },\n);\n"],"names":["FooterMenu","forwardRef","sx","children","label","accordionSummaryProps","contentProps","variant","rest","ref","contentSx","restContent","accSummarySx","restAccSummary","listLookSelector","theme","breakpoints","up","expanded","setExpanded","useState","_jsx","FooterAccordion","onChange","_","v","slots","transition","FooterMenuCollapse","sxOverride","flexBasis","lg","borderColor","border","padding","typography","subheadline","p","textDecoration","color","overflow","cursor","display","component","alignItems","justifyContent","flexDirection","gap","caption2"],"mappings":"4LAwBO,MAAMA,EAAkCC,EAAAA,WAC7C,EAAGC,KAAIC,WAAUC,QAAOC,wBAAuBC,eAAcC,UAAU,UAAWC,GAAQC,KACxF,MAAQP,GAAIQ,KAAcC,GAAgBL,GAAgB,CAAA,GAClDJ,GAAIU,KAAiBC,GAAmBR,GAAyB,CAAA,EAGnES,EAAoBC,GAA8B,SAAZR,EAAqB,IAAMQ,EAAMC,YAAYC,GAAG,OACrFC,EAAUC,GAAeC,EAAAA,UAAS,GAEzC,OACEC,EAAAA,IAACC,EAAAA,gBAAe,CACdb,IAAKA,EAAG,cACI,aACZS,SAAsB,SAAZX,GAA4BW,EACtCK,SAAU,CAACC,EAAGC,IAAMN,EAAYM,GAChClB,QAAQ,cACS,SAAZA,GAAsB,CAAEmB,MAAO,CAAEC,WAAYC,EAAAA,qBAClD1B,GAAI2B,EAAAA,WACDd,IAAK,CAEJe,UAAW,CAAEC,GAAI,OACjBC,YAAa,qBACG,cAAZzB,GAA2B,CAC7B,CAACO,EAAiBC,IAAS,CAAEkB,OAAQ,WAGzC/B,GAEFG,sBAAuB,CACrB,cAAiB,mBACjBH,GAAI2B,EAAAA,WACDd,IAAK,CAEJmB,QAAS,SAET,kBAAmB,IACdnB,EAAMoB,WAAWC,YACpBC,EAAG,EACH,aAAc,CACZC,eAAgB,OAChBC,MAAO,oBAIK,cAAZhC,GAA2B,CAC7B,CAACO,EAAiBC,IAAS,CAEzBmB,QAAS,aAETM,SAAU,UAEV,wBAAyB,CACvBC,OAAQ,SAGV,2CAA4C,CAC1CC,QAAS,YAKjB9B,MAECC,GAELT,MAAOA,EACPE,aAAc,CACZqC,UAAW,MACX,cAAiB,qBACjBzC,GAAI2B,EAAAA,WACDd,IAAK,CACJ2B,QAAS,OACTE,WAAY,aACZC,eAAgB,aAChBC,cAAe,SACfC,IAAK,IAEL,kBAAmB,IACdhC,EAAMoB,WAAWa,SACpBX,EAAG,EACH,aAAc,CACZC,eAAgB,OAChBC,MAAO,sBAIb7B,MAECC,MAEDH,EAAIL,SAEPA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ElementType, FC, ReactNode } from 'react';
|
|
2
|
+
import { BoxProps } from '@mui/material';
|
|
3
|
+
export interface FooterMenuCollapseProps extends BoxProps<ElementType> {
|
|
4
|
+
/**
|
|
5
|
+
* Expanded state, provided by the Accordion transition slot
|
|
6
|
+
*/
|
|
7
|
+
in?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Transition duration in ms, 0 disables the animation (provided by the transition slot)
|
|
10
|
+
*/
|
|
11
|
+
timeout?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Ignored owner state forwarded by the transition slot
|
|
14
|
+
*/
|
|
15
|
+
ownerState?: unknown;
|
|
16
|
+
/**
|
|
17
|
+
* Collapsible content
|
|
18
|
+
*/
|
|
19
|
+
children?: ReactNode;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* CSS-only collapse used as the Accordion transition slot, so auto footer menus render
|
|
23
|
+
* expanded from desktop up without a JS media query (renders correctly during pre-render)
|
|
24
|
+
*/
|
|
25
|
+
export declare const FooterMenuCollapse: FC<FooterMenuCollapseProps>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("@mui/material"),i=require("../../utils/sxOverride/sxOverride.js");const a=r.forwardRef(({in:r,timeout:a,sx:s,children:d,ownerState:n,...o},u)=>e.jsx(t.Box,{ref:u,"data-expanded":`${!!r}`,sx:i.sxOverride(e=>({display:"grid",gridTemplateRows:"0fr",transition:e.transitions.create("grid-template-rows",{duration:"number"==typeof a?a:e.transitions.duration.standard}),'&[data-expanded="true"]':{gridTemplateRows:"1fr"},"& > *":{minHeight:"0",overflow:"hidden"},[e.breakpoints.up("lg")]:{gridTemplateRows:"1fr"}}),s),...o,children:d}));exports.FooterMenuCollapse=a;
|
|
2
|
+
//# sourceMappingURL=FooterMenuCollapse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FooterMenuCollapse.js","sources":["../../../../../src/components/footer/FooterMenuCollapse.tsx"],"sourcesContent":["import React, { ElementType, FC, forwardRef, ReactNode } from 'react';\nimport { Box, BoxProps } from '@mui/material';\nimport { sxOverride } from '@/src/utils/sxOverride';\n\nexport interface FooterMenuCollapseProps extends BoxProps<ElementType> {\n /**\n * Expanded state, provided by the Accordion transition slot\n */\n in?: boolean;\n /**\n * Transition duration in ms, 0 disables the animation (provided by the transition slot)\n */\n timeout?: number;\n /**\n * Ignored owner state forwarded by the transition slot\n */\n ownerState?: unknown;\n /**\n * Collapsible content\n */\n children?: ReactNode;\n}\n\n/**\n * CSS-only collapse used as the Accordion transition slot, so auto footer menus render\n * expanded from desktop up without a JS media query (renders correctly during pre-render)\n */\nexport const FooterMenuCollapse: FC<FooterMenuCollapseProps> = forwardRef(\n ({ in: expanded, timeout, sx, children, ownerState: _ownerState, ...rest }, ref) => (\n <Box\n ref={ref}\n data-expanded={`${!!expanded}`}\n sx={sxOverride(\n (theme) => ({\n display: 'grid',\n // collapsed on mobile, the row track animates open/closed\n gridTemplateRows: '0fr',\n transition: theme.transitions.create('grid-template-rows', {\n duration: typeof timeout === 'number' ? timeout : theme.transitions.duration.standard,\n }),\n '&[data-expanded=\"true\"]': {\n gridTemplateRows: '1fr',\n },\n // clip the content while the track is collapsed\n '& > *': {\n minHeight: '0',\n overflow: 'hidden',\n },\n // always open from desktop up, replaces the removed media query\n [theme.breakpoints.up('lg')]: {\n gridTemplateRows: '1fr',\n },\n }),\n sx,\n )}\n {...rest}\n >\n {children}\n </Box>\n ),\n);\n"],"names":["FooterMenuCollapse","forwardRef","in","expanded","timeout","sx","children","ownerState","_ownerState","rest","ref","_jsx","Box","sxOverride","theme","display","gridTemplateRows","transition","transitions","create","duration","standard","minHeight","overflow","breakpoints","up"],"mappings":"gJA2BO,MAAMA,EAAkDC,EAAAA,WAC7D,EAAGC,GAAIC,EAAUC,UAASC,KAAIC,WAAUC,WAAYC,KAAgBC,GAAQC,IAC1EC,EAAAA,IAACC,EAAAA,KACCF,IAAKA,EAAG,gBACO,KAAKP,IACpBE,GAAIQ,EAAAA,WACDC,IAAK,CACJC,QAAS,OAETC,iBAAkB,MAClBC,WAAYH,EAAMI,YAAYC,OAAO,qBAAsB,CACzDC,SAA6B,iBAAZhB,EAAuBA,EAAUU,EAAMI,YAAYE,SAASC,WAE/E,0BAA2B,CACzBL,iBAAkB,OAGpB,QAAS,CACPM,UAAW,IACXC,SAAU,UAGZ,CAACT,EAAMU,YAAYC,GAAG,OAAQ,CAC5BT,iBAAkB,SAGtBX,MAEEI,WAEHH"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("../../utils/sxOverride/sxOverride.js"),o=require("@mui/material"),s=require("../icon/stroke/MenuIcon.js"),i=require("../icon/stroke/CloseIcon.js"),n=require("../focusring/focusring.js"),a=require("./HeaderButton.js"),l=require("./HeaderLanguageSelect.js"),d=require("./HeaderNavigationLink.js"),u=require("./HeaderNavigationHero.js"),c=require("./HeaderNavigationMenu.js");const x=r.forwardRef(({children:x,logo:p,buttons:g,visibleButtons:h,mobile:
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("../../utils/sxOverride/sxOverride.js"),o=require("@mui/material"),s=require("../icon/stroke/MenuIcon.js"),i=require("../icon/stroke/CloseIcon.js"),n=require("../focusring/focusring.js"),a=require("./HeaderButton.js"),l=require("./HeaderLanguageSelect.js"),d=require("./HeaderNavigationLink.js"),u=require("./HeaderNavigationHero.js"),c=require("./HeaderNavigationMenu.js");const x=r.forwardRef(({children:x,logo:p,buttons:g,visibleButtons:h,mobile:m,open:b,setOpen:f,inContainer:v=!1,toolbarProps:j,logoProps:y,contentProps:H,mobileContentProps:k,buttonsProps:B,menuButtonProps:I,menuIcon:q,closeMenuIcon:C,drawerProps:M,...O},P)=>{const S=o.useTheme(),w=o.useMediaQuery(S.breakpoints.down("lg")),E=void 0===m?w:m,{sx:N,...$}=y??{},{sx:F,...L}=H??{},{sx:T,...R}=k??{},{sx:V,...z}=B??{},{sx:A,slotProps:D,...G}=M??{},{paper:Q,backdrop:W,...J}=D??{},{sx:K,...U}=Q??{},{sx:X,...Y}=W??{},[Z,_]=r.useState(!1),ee=b??Z,re=f??_,[te,oe,se]=r.useMemo(()=>{function e(t,o,s){const i=[];return r.Children.forEach(t,(t,n)=>{t?.type===r.Fragment?i.push(...e(t.props.children,o,`${s}-n`)):r.isValidElement(t)&&[a.HeaderButton,l.HeaderLanguageSelect,d.HeaderNavigationLink,u.HeaderNavigationHero,c.HeaderNavigationMenu].includes(t?.type)&&o?i.push(r.cloneElement(t,{extend:!0,key:`${s}-${n}`})):"string"==typeof t?i.push(t):r.isValidElement(t)&&i.push(r.cloneElement(t,{key:`${s}-${n}`}))}),i?.length?i:void 0}const t=e(x,E,"children");if(h){const r=!0===h?void 0:e(h,!1,"visibleButtons"),o=e(g,E,"restButton");return E?[t,r,o]:[t,[...r||[],...o||[]],void 0]}return[t,e(g,!1,"buttons"),void 0]},[x,h,g,E]);return e.jsxs(e.Fragment,{children:[e.jsx(o.AppBar,{ref:P,"data-testid":"Header",...O,children:e.jsxs(o.Toolbar,{disableGutters:!v,...j,children:[p&&e.jsx(o.Box,{"data-testid":"Header.logo",sx:t.sxOverride({color:"dark"===S.palette.mode?"brand.secondary":"brand.tertiary",flexShrink:"0",display:"flex",alignItems:"center",justifyContent:"flex-start","& .MuiLink-root":{display:"block",position:"relative",py:1,...n.getFocusRingStyle(S),"&.Mui-focusVisible":{boxShadow:"none"}},"& .MuiSvgIcon-root":{display:"block"}},N),...$,children:p}),e.jsx(o.Box,{sx:t.sxOverride({minWidth:"0",flexGrow:"1",alignSelf:"stretch",display:"flex",alignItems:"stretch",justifyContent:"flex-start",gap:{lg:2,xl:4},...!E&&p&&{pl:4},mb:"-1px"},F),"data-testid":"Header.nav",...L,children:!E&&te}),(oe||E&&(te||se))&&e.jsxs(o.Box,{sx:t.sxOverride({display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.25,mr:{xs:-1,lg:0}},V),"data-testid":"Header.btns",...z,children:[oe,E&&(te||se)&&e.jsx(a.HeaderButton,{"aria-label":"Toggle menu",extend:!1,onClick:()=>re(e=>!e),...I,children:ee?C||e.jsx(i.CloseIcon,{}):q||e.jsx(s.MenuIcon,{})},"menu")]})]})}),E&&(te||se)&&e.jsxs(o.Drawer,{disablePortal:!0,disableEnforceFocus:!0,disableAutoFocus:!0,anchor:"top",open:ee,onClose:()=>re(!1),sx:t.sxOverride({zIndex:S.zIndex.appBar-10,top:S.mixins.toolbar.minHeight,bottom:"auto",height:`calc(100vh - ${S.mixins.toolbar.minHeight})`,position:"absolute"},A),slotProps:{backdrop:{sx:t.sxOverride({position:"absolute"},X),...Y},paper:{sx:t.sxOverride({position:"absolute",height:"100%",display:"grid",gridTemplateRows:"auto max-content"},K),...U},...J},...G,children:[e.jsx(o.Box,{sx:t.sxOverride({p:2,overflow:"auto"},T),"data-testid":"Header.mobilenav",...R,children:te}),se&&e.jsx(o.Box,{sx:{p:2,pt:0},children:e.jsx(o.Box,{sx:{pt:.75,display:"flex",flexDirection:"column-reverse",alignItems:"stretch",justifyContent:"flex-start",borderTop:1,borderColor:"dark"===S.palette.mode?"onSurface.os700":"surface.secondary"},children:se})})]})]})});exports.Header=x;
|
|
2
2
|
//# sourceMappingURL=Header.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.js","sources":["../../../../../src/components/header/Header.tsx"],"sourcesContent":["import React, {\n FC,\n useState,\n forwardRef,\n ReactNode,\n ElementType,\n Children,\n cloneElement,\n useMemo,\n Fragment,\n isValidElement,\n} from 'react';\nimport { sxOverride } from '@/src/utils/sxOverride';\nimport {\n AppBar,\n AppBarProps,\n BackdropProps,\n Box,\n BoxProps,\n Drawer,\n DrawerProps,\n PaperProps,\n Toolbar,\n ToolbarProps,\n useMediaQuery,\n useTheme,\n} from '@mui/material';\nimport { MenuIcon } from '@/src/components/icon/stroke/MenuIcon';\nimport { CloseIcon } from '@/src/components/icon/stroke/CloseIcon';\nimport { getFocusRingStyle } from '@/src/components/focusring/focusring';\nimport { HeaderButton, HeaderButtonProps } from './HeaderButton';\nimport { HeaderLanguageSelect } from './HeaderLanguageSelect';\nimport { HeaderNavigationLink } from './HeaderNavigationLink';\nimport { HeaderNavigationHero } from './HeaderNavigationHero';\nimport { HeaderNavigationMenu } from './HeaderNavigationMenu';\n\nexport interface HeaderProps extends Omit<AppBarProps, 'color'> {\n /**\n * Logo component\n */\n logo?: ReactNode;\n /**\n * Wrap the navigation into container\n * @default false\n */\n inContainer?: boolean;\n /**\n * ActionButtons on the right side\n */\n buttons?: ReactNode;\n /**\n * ActionButtons on the right side that stays visible even on mobile\n */\n visibleButtons?: ReactNode | true;\n /**\n * Controls if mobile version of Header should be shown, this collapses children into mobile menu\n *\n * @default undefined, leads to usage useMediaQuery(theme.breakpoints.down('lg'))\n */\n mobile?: boolean;\n /**\n * Controls open/close state of mobile menu\n */\n open?: boolean;\n /**\n * Function to toggle open state of menu\n */\n setOpen?: (open: boolean) => void;\n /**\n * Properties applied to toolbar container\n */\n toolbarProps?: ToolbarProps<ElementType>;\n /**\n * Properties applied to logo wrapper\n */\n logoProps?: BoxProps<ElementType>;\n /**\n * Properties applied to content wrapper\n */\n contentProps?: BoxProps<ElementType>;\n /**\n * Properties applied to content wrapper in drawer\n */\n mobileContentProps?: BoxProps<ElementType>;\n /**\n * Properties applied to button wrapper\n */\n buttonsProps?: BoxProps<ElementType>;\n /**\n * Properties applied to hamburger menu\n */\n menuButtonProps?: HeaderButtonProps;\n /**\n * Icon of the hamburger menu\n */\n menuIcon?: ReactNode;\n /**\n * Icon of the close hamburger menu\n */\n closeMenuIcon?: ReactNode;\n /**\n * Props applied to mobile drawer\n */\n drawerProps?: DrawerProps;\n}\n\n/**\n * Component to render Header with navigation and action buttons at the top of the page\n */\nexport const Header: FC<HeaderProps> = forwardRef(\n (\n {\n children,\n logo,\n buttons,\n visibleButtons,\n mobile: propMobile,\n open: propOpen,\n setOpen: propSetOpen,\n inContainer = false,\n toolbarProps,\n logoProps,\n contentProps,\n mobileContentProps,\n buttonsProps,\n menuButtonProps,\n menuIcon,\n closeMenuIcon,\n drawerProps,\n ...rest\n },\n ref,\n ) => {\n const theme = useTheme();\n const downLg = useMediaQuery(theme.breakpoints.down('lg'));\n // determine if mobile condition is controlled or default downLg\n const mobile = propMobile === undefined ? downLg : propMobile;\n const { sx: logoSx, ...restLogo } = logoProps ?? {};\n const { sx: contentSx, ...restContent } = contentProps ?? {};\n const { sx: mobileContentSx, ...restMobileContent } = mobileContentProps ?? {};\n const { sx: buttonsSx, ...restButtons } = buttonsProps ?? {};\n const { sx: drawerSx, slotProps: drawerSlotProps, ...restDrawer } = drawerProps ?? {};\n const { paper: drawerPaperProps, backdrop: drawerBackdropProps, ...restDrawerSlotProps } = drawerSlotProps ?? {};\n const { sx: drawerPaperSx, ...restDrawerPaper } = (drawerPaperProps as PaperProps) ?? {};\n const { sx: drawerBackdropSx, ...restDrawerBackdrop } = (drawerBackdropProps as BackdropProps) ?? {};\n const [rawOpen, rawSetOpen] = useState(false);\n const open = propOpen ?? rawOpen;\n const setOpen: React.Dispatch<React.SetStateAction<boolean>> = propSetOpen ?? rawSetOpen;\n\n /**\n * Process child nodes\n */\n const [processedChildren, processedButtons, drawerButtons] = useMemo(() => {\n function flatten(nodes, extend, keyid) {\n const result = [];\n Children.forEach(nodes, (child, idx) => {\n if (child?.type === Fragment) {\n result.push(...flatten(child.props.children, extend, `${keyid}-n`));\n } else if (\n isValidElement(child) &&\n [\n HeaderButton,\n HeaderLanguageSelect,\n HeaderNavigationLink,\n HeaderNavigationHero,\n HeaderNavigationMenu,\n ].includes(child?.type as FC) &&\n extend\n ) {\n result.push(\n cloneElement(child, {\n extend: true,\n key: `${keyid}-${idx}`,\n } as HeaderButtonProps),\n );\n } else {\n if (typeof child === 'string') {\n result.push(child);\n } else {\n result.push(cloneElement(child, { key: `${keyid}-${idx}` }));\n }\n }\n });\n return result?.length ? result : undefined;\n }\n\n const flattenedChildren = flatten(children, mobile, 'children');\n // check if we have visibleButtons property\n if (visibleButtons) {\n const flattenedVisibleButtons =\n visibleButtons === true ? undefined : flatten(visibleButtons, false, 'visibleButtons');\n const flattenedRestButtons = flatten(buttons, mobile, 'restButton');\n // mobile\n if (mobile) {\n // split visible buttons and put buttons in drawer\n return [flattenedChildren, flattenedVisibleButtons, flattenedRestButtons];\n } else {\n // on PC, all buttons are visible\n return [flattenedChildren, [...(flattenedVisibleButtons || []), ...(flattenedRestButtons || [])], undefined];\n }\n } else {\n // in case visibleButtons property is not provided, do not put buttons into drawer at all\n return [flattenedChildren, flatten(buttons, false, 'buttons'), undefined];\n }\n }, [children, visibleButtons, buttons, mobile]);\n\n return (\n <>\n <AppBar ref={ref} data-testid=\"Header\" {...rest}>\n <Toolbar disableGutters={!inContainer} {...toolbarProps}>\n {logo && (\n <Box\n data-testid=\"Header.logo\"\n sx={sxOverride(\n {\n color: theme.palette.mode === 'dark' ? 'brand.secondary' : 'brand.tertiary',\n flexShrink: '0',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'flex-start',\n // restyle wrapper link, same style is applied in HeaderLogo\n '& .MuiLink-root': {\n display: 'block',\n position: 'relative',\n py: 1,\n // add proper focus ring\n ...getFocusRingStyle(theme),\n // remove default link box shadow\n '&.Mui-focusVisible': {\n boxShadow: 'none',\n },\n },\n '& .MuiSvgIcon-root': {\n display: 'block',\n },\n },\n logoSx,\n )}\n {...restLogo}\n >\n {logo}\n </Box>\n )}\n <Box\n sx={sxOverride(\n {\n minWidth: '0',\n flexGrow: '1',\n alignSelf: 'stretch',\n display: 'flex',\n alignItems: 'stretch',\n justifyContent: 'flex-start',\n gap: { lg: 2, xl: 4 },\n ...(!mobile &&\n logo && {\n // increase size between logo and nav\n pl: 4,\n }),\n // move directly into border\n mb: '-1px',\n },\n contentSx,\n )}\n data-testid=\"Header.nav\"\n {...restContent}\n >\n {!mobile && processedChildren}\n </Box>\n {(processedButtons || (mobile && (processedChildren || drawerButtons))) && (\n <Box\n sx={sxOverride(\n {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'flex-end',\n gap: 0.25,\n mr: { xs: -1, lg: 0 },\n },\n buttonsSx,\n )}\n data-testid=\"Header.btns\"\n {...restButtons}\n >\n {processedButtons}\n {mobile && (processedChildren || drawerButtons) && (\n <HeaderButton\n key=\"menu\"\n aria-label=\"Toggle menu\"\n extend={false}\n onClick={() => setOpen((prev: boolean) => !prev)}\n {...menuButtonProps}\n >\n {open ? closeMenuIcon || <CloseIcon /> : menuIcon || <MenuIcon />}\n </HeaderButton>\n )}\n </Box>\n )}\n </Toolbar>\n </AppBar>\n {mobile && (processedChildren || drawerButtons) && (\n <Drawer\n disablePortal\n disableEnforceFocus\n disableAutoFocus\n anchor=\"top\"\n open={open}\n onClose={() => setOpen(false)}\n sx={sxOverride(\n {\n // bellow Header, above SecondaryNavigation\n zIndex: theme.zIndex.appBar - 10,\n // header offset\n top: theme.mixins.toolbar.minHeight,\n bottom: 'auto',\n height: `calc(100vh - ${theme.mixins.toolbar.minHeight})`,\n // adjust position\n position: 'absolute',\n },\n drawerSx,\n )}\n slotProps={{\n backdrop: {\n sx: sxOverride(\n {\n position: 'absolute',\n },\n drawerBackdropSx,\n ),\n ...restDrawerBackdrop,\n },\n paper: {\n sx: sxOverride(\n {\n position: 'absolute',\n height: '100%',\n display: 'grid',\n gridTemplateRows: 'auto max-content',\n },\n drawerPaperSx,\n ),\n ...restDrawerPaper,\n },\n ...restDrawerSlotProps,\n }}\n {...restDrawer}\n >\n <Box\n sx={sxOverride(\n {\n p: 2,\n overflow: 'auto',\n },\n mobileContentSx,\n )}\n data-testid=\"Header.mobilenav\"\n {...restMobileContent}\n >\n {processedChildren}\n </Box>\n {drawerButtons && (\n <Box sx={{ p: 2, pt: 0 }}>\n <Box\n sx={{\n pt: 0.75,\n display: 'flex',\n flexDirection: 'column-reverse',\n alignItems: 'stretch',\n justifyContent: 'flex-start',\n // border from appbar.theme.ts\n borderTop: 1,\n borderColor: theme.palette.mode === 'dark' ? 'onSurface.os700' : 'surface.secondary',\n }}\n >\n {drawerButtons}\n </Box>\n </Box>\n )}\n </Drawer>\n )}\n </>\n );\n },\n);\n"],"names":["Header","forwardRef","children","logo","buttons","visibleButtons","mobile","propMobile","open","propOpen","setOpen","propSetOpen","inContainer","toolbarProps","logoProps","contentProps","mobileContentProps","buttonsProps","menuButtonProps","menuIcon","closeMenuIcon","drawerProps","rest","ref","theme","useTheme","downLg","useMediaQuery","breakpoints","down","undefined","sx","logoSx","restLogo","contentSx","restContent","mobileContentSx","restMobileContent","buttonsSx","restButtons","drawerSx","slotProps","drawerSlotProps","restDrawer","paper","drawerPaperProps","backdrop","drawerBackdropProps","restDrawerSlotProps","drawerPaperSx","restDrawerPaper","drawerBackdropSx","restDrawerBackdrop","rawOpen","rawSetOpen","useState","processedChildren","processedButtons","drawerButtons","useMemo","flatten","nodes","extend","keyid","result","Children","forEach","child","idx","type","Fragment","push","props","isValidElement","HeaderButton","HeaderLanguageSelect","HeaderNavigationLink","HeaderNavigationHero","HeaderNavigationMenu","includes","cloneElement","key","length","flattenedChildren","flattenedVisibleButtons","flattenedRestButtons","_jsxs","_Fragment","_jsx","AppBar","Toolbar","disableGutters","Box","sxOverride","color","palette","mode","flexShrink","display","alignItems","justifyContent","position","py","getFocusRingStyle","boxShadow","minWidth","flexGrow","alignSelf","gap","lg","xl","pl","mb","mr","xs","onClick","prev","CloseIcon","MenuIcon","Drawer","disablePortal","disableEnforceFocus","disableAutoFocus","anchor","onClose","zIndex","appBar","top","mixins","toolbar","minHeight","bottom","height","gridTemplateRows","p","overflow","pt","flexDirection","borderTop","borderColor"],"mappings":"mcA6GO,MAAMA,EAA0BC,EAAAA,WACrC,EAEIC,WACAC,OACAC,UACAC,iBACAC,OAAQC,EACRC,KAAMC,EACNC,QAASC,EACTC,eAAc,EACdC,eACAC,YACAC,eACAC,qBACAC,eACAC,kBACAC,WACAC,gBACAC,iBACGC,GAELC,KAEA,MAAMC,EAAQC,EAAAA,WACRC,EAASC,EAAAA,cAAcH,EAAMI,YAAYC,KAAK,OAE9CvB,OAAwBwB,IAAfvB,EAA2BmB,EAASnB,GAC3CwB,GAAIC,KAAWC,GAAanB,GAAa,CAAA,GACzCiB,GAAIG,KAAcC,GAAgBpB,GAAgB,CAA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XZ,QAAQ,EACRqD,QAAS,IAAMzG,GAAS0G,IAAmBA,MACvClG,EAAehB,SAElBM,GAAOY,GAAiBoE,EAAAA,IAAC6B,EAAAA,UAAS,CAAA,GAAMlG,GAAYqE,EAAAA,IAAC8B,EAAAA,SAAQ,CAAA,IAN1D,gBAafhH,IAAWkD,IAAqBE,KAC/B4B,EAAAA,KAACiC,EAAAA,OAAM,CACLC,eAAa,EACbC,qBAAmB,EACnBC,kBAAgB,EAChBC,OAAO,MACPnH,KAAMA,GACNoH,QAAS,IAAMlH,IAAQ,GACvBqB,GAAI8D,aACF,CAEEgC,OAAQrG,EAAMqG,OAAOC,OAAS,GAE9BC,IAAKvG,EAAMwG,OAAOC,QAAQC,UAC1BC,OAAQ,OACRC,OAAQ,gBAAgB5G,EAAMwG,OAAOC,QAAQC,aAE7C7B,SAAU,YAEZ7D,GAEFC,UAAW,CACTK,SAAU,CACRf,GAAI8D,EAAAA,WACF,CACEQ,SAAU,YAEZlD,MAECC,GAELR,MAAO,CACLb,GAAI8D,EAAAA,WACF,CACEQ,SAAU,WACV+B,OAAQ,OACRlC,QAAS,OACTmC,iBAAkB,oBAEpBpF,MAECC,MAEFF,MAEDL,YAEJ6C,EAAAA,IAACI,OACC7D,GAAI8D,aACF,CACEyC,EAAG,EACHC,SAAU,QAEZnG,GACD,cACW,sBACRC,EAAiBnC,SAEpBsD,KAEFE,IACC8B,MAACI,EAAAA,IAAG,CAAC7D,GAAI,CAAEuG,EAAG,EAAGE,GAAI,GAAGtI,SACtBsF,EAAAA,IAACI,MAAG,CACF7D,GAAI,CACFyG,GAAI,IACJtC,QAAS,OACTuC,cAAe,iBACftC,WAAY,UACZC,eAAgB,aAEhBsC,UAAW,EACXC,YAAoC,SAAvBnH,EAAMuE,QAAQC,KAAkB,kBAAoB,qBAClE9F,SAEAwD"}
|
|
1
|
+
{"version":3,"file":"Header.js","sources":["../../../../../src/components/header/Header.tsx"],"sourcesContent":["import React, {\n FC,\n useState,\n forwardRef,\n ReactNode,\n ElementType,\n Children,\n cloneElement,\n useMemo,\n Fragment,\n isValidElement,\n} from 'react';\nimport { sxOverride } from '@/src/utils/sxOverride';\nimport {\n AppBar,\n AppBarProps,\n BackdropProps,\n Box,\n BoxProps,\n Drawer,\n DrawerProps,\n PaperProps,\n Toolbar,\n ToolbarProps,\n useMediaQuery,\n useTheme,\n} from '@mui/material';\nimport { MenuIcon } from '@/src/components/icon/stroke/MenuIcon';\nimport { CloseIcon } from '@/src/components/icon/stroke/CloseIcon';\nimport { getFocusRingStyle } from '@/src/components/focusring/focusring';\nimport { HeaderButton, HeaderButtonProps } from './HeaderButton';\nimport { HeaderLanguageSelect } from './HeaderLanguageSelect';\nimport { HeaderNavigationLink } from './HeaderNavigationLink';\nimport { HeaderNavigationHero } from './HeaderNavigationHero';\nimport { HeaderNavigationMenu } from './HeaderNavigationMenu';\n\nexport interface HeaderProps extends Omit<AppBarProps, 'color'> {\n /**\n * Logo component\n */\n logo?: ReactNode;\n /**\n * Wrap the navigation into container\n * @default false\n */\n inContainer?: boolean;\n /**\n * ActionButtons on the right side\n */\n buttons?: ReactNode;\n /**\n * ActionButtons on the right side that stays visible even on mobile\n */\n visibleButtons?: ReactNode | true;\n /**\n * Controls if mobile version of Header should be shown, this collapses children into mobile menu\n *\n * @default undefined, leads to usage useMediaQuery(theme.breakpoints.down('lg'))\n */\n mobile?: boolean;\n /**\n * Controls open/close state of mobile menu\n */\n open?: boolean;\n /**\n * Function to toggle open state of menu\n */\n setOpen?: (open: boolean) => void;\n /**\n * Properties applied to toolbar container\n */\n toolbarProps?: ToolbarProps<ElementType>;\n /**\n * Properties applied to logo wrapper\n */\n logoProps?: BoxProps<ElementType>;\n /**\n * Properties applied to content wrapper\n */\n contentProps?: BoxProps<ElementType>;\n /**\n * Properties applied to content wrapper in drawer\n */\n mobileContentProps?: BoxProps<ElementType>;\n /**\n * Properties applied to button wrapper\n */\n buttonsProps?: BoxProps<ElementType>;\n /**\n * Properties applied to hamburger menu\n */\n menuButtonProps?: HeaderButtonProps;\n /**\n * Icon of the hamburger menu\n */\n menuIcon?: ReactNode;\n /**\n * Icon of the close hamburger menu\n */\n closeMenuIcon?: ReactNode;\n /**\n * Props applied to mobile drawer\n */\n drawerProps?: DrawerProps;\n}\n\n/**\n * Component to render Header with navigation and action buttons at the top of the page\n */\nexport const Header: FC<HeaderProps> = forwardRef(\n (\n {\n children,\n logo,\n buttons,\n visibleButtons,\n mobile: propMobile,\n open: propOpen,\n setOpen: propSetOpen,\n inContainer = false,\n toolbarProps,\n logoProps,\n contentProps,\n mobileContentProps,\n buttonsProps,\n menuButtonProps,\n menuIcon,\n closeMenuIcon,\n drawerProps,\n ...rest\n },\n ref,\n ) => {\n const theme = useTheme();\n const downLg = useMediaQuery(theme.breakpoints.down('lg'));\n // determine if mobile condition is controlled or default downLg\n const mobile = propMobile === undefined ? downLg : propMobile;\n const { sx: logoSx, ...restLogo } = logoProps ?? {};\n const { sx: contentSx, ...restContent } = contentProps ?? {};\n const { sx: mobileContentSx, ...restMobileContent } = mobileContentProps ?? {};\n const { sx: buttonsSx, ...restButtons } = buttonsProps ?? {};\n const { sx: drawerSx, slotProps: drawerSlotProps, ...restDrawer } = drawerProps ?? {};\n const { paper: drawerPaperProps, backdrop: drawerBackdropProps, ...restDrawerSlotProps } = drawerSlotProps ?? {};\n const { sx: drawerPaperSx, ...restDrawerPaper } = (drawerPaperProps as PaperProps) ?? {};\n const { sx: drawerBackdropSx, ...restDrawerBackdrop } = (drawerBackdropProps as BackdropProps) ?? {};\n const [rawOpen, rawSetOpen] = useState(false);\n const open = propOpen ?? rawOpen;\n const setOpen: React.Dispatch<React.SetStateAction<boolean>> = propSetOpen ?? rawSetOpen;\n\n /**\n * Process child nodes\n */\n const [processedChildren, processedButtons, drawerButtons] = useMemo(() => {\n function flatten(nodes, extend, keyid) {\n const result = [];\n Children.forEach(nodes, (child, idx) => {\n if (child?.type === Fragment) {\n result.push(...flatten(child.props.children, extend, `${keyid}-n`));\n } else if (\n isValidElement(child) &&\n [\n HeaderButton,\n HeaderLanguageSelect,\n HeaderNavigationLink,\n HeaderNavigationHero,\n HeaderNavigationMenu,\n ].includes(child?.type as FC) &&\n extend\n ) {\n result.push(\n cloneElement(child, {\n extend: true,\n key: `${keyid}-${idx}`,\n } as HeaderButtonProps),\n );\n } else {\n if (typeof child === 'string') {\n result.push(child);\n } else if (isValidElement(child)) {\n result.push(cloneElement(child, { key: `${keyid}-${idx}` }));\n }\n }\n });\n return result?.length ? result : undefined;\n }\n\n const flattenedChildren = flatten(children, mobile, 'children');\n // check if we have visibleButtons property\n if (visibleButtons) {\n const flattenedVisibleButtons =\n visibleButtons === true ? undefined : flatten(visibleButtons, false, 'visibleButtons');\n const flattenedRestButtons = flatten(buttons, mobile, 'restButton');\n // mobile\n if (mobile) {\n // split visible buttons and put buttons in drawer\n return [flattenedChildren, flattenedVisibleButtons, flattenedRestButtons];\n } else {\n // on PC, all buttons are visible\n return [flattenedChildren, [...(flattenedVisibleButtons || []), ...(flattenedRestButtons || [])], undefined];\n }\n } else {\n // in case visibleButtons property is not provided, do not put buttons into drawer at all\n return [flattenedChildren, flatten(buttons, false, 'buttons'), undefined];\n }\n }, [children, visibleButtons, buttons, mobile]);\n\n return (\n <>\n <AppBar ref={ref} data-testid=\"Header\" {...rest}>\n <Toolbar disableGutters={!inContainer} {...toolbarProps}>\n {logo && (\n <Box\n data-testid=\"Header.logo\"\n sx={sxOverride(\n {\n color: theme.palette.mode === 'dark' ? 'brand.secondary' : 'brand.tertiary',\n flexShrink: '0',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'flex-start',\n // restyle wrapper link, same style is applied in HeaderLogo\n '& .MuiLink-root': {\n display: 'block',\n position: 'relative',\n py: 1,\n // add proper focus ring\n ...getFocusRingStyle(theme),\n // remove default link box shadow\n '&.Mui-focusVisible': {\n boxShadow: 'none',\n },\n },\n '& .MuiSvgIcon-root': {\n display: 'block',\n },\n },\n logoSx,\n )}\n {...restLogo}\n >\n {logo}\n </Box>\n )}\n <Box\n sx={sxOverride(\n {\n minWidth: '0',\n flexGrow: '1',\n alignSelf: 'stretch',\n display: 'flex',\n alignItems: 'stretch',\n justifyContent: 'flex-start',\n gap: { lg: 2, xl: 4 },\n ...(!mobile &&\n logo && {\n // increase size between logo and nav\n pl: 4,\n }),\n // move directly into border\n mb: '-1px',\n },\n contentSx,\n )}\n data-testid=\"Header.nav\"\n {...restContent}\n >\n {!mobile && processedChildren}\n </Box>\n {(processedButtons || (mobile && (processedChildren || drawerButtons))) && (\n <Box\n sx={sxOverride(\n {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'flex-end',\n gap: 0.25,\n mr: { xs: -1, lg: 0 },\n },\n buttonsSx,\n )}\n data-testid=\"Header.btns\"\n {...restButtons}\n >\n {processedButtons}\n {mobile && (processedChildren || drawerButtons) && (\n <HeaderButton\n key=\"menu\"\n aria-label=\"Toggle menu\"\n extend={false}\n onClick={() => setOpen((prev: boolean) => !prev)}\n {...menuButtonProps}\n >\n {open ? closeMenuIcon || <CloseIcon /> : menuIcon || <MenuIcon />}\n </HeaderButton>\n )}\n </Box>\n )}\n </Toolbar>\n </AppBar>\n {mobile && (processedChildren || drawerButtons) && (\n <Drawer\n disablePortal\n disableEnforceFocus\n disableAutoFocus\n anchor=\"top\"\n open={open}\n onClose={() => setOpen(false)}\n sx={sxOverride(\n {\n // bellow Header, above SecondaryNavigation\n zIndex: theme.zIndex.appBar - 10,\n // header offset\n top: theme.mixins.toolbar.minHeight,\n bottom: 'auto',\n height: `calc(100vh - ${theme.mixins.toolbar.minHeight})`,\n // adjust position\n position: 'absolute',\n },\n drawerSx,\n )}\n slotProps={{\n backdrop: {\n sx: sxOverride(\n {\n position: 'absolute',\n },\n drawerBackdropSx,\n ),\n ...restDrawerBackdrop,\n },\n paper: {\n sx: sxOverride(\n {\n position: 'absolute',\n height: '100%',\n display: 'grid',\n gridTemplateRows: 'auto max-content',\n },\n drawerPaperSx,\n ),\n ...restDrawerPaper,\n },\n ...restDrawerSlotProps,\n }}\n {...restDrawer}\n >\n <Box\n sx={sxOverride(\n {\n p: 2,\n overflow: 'auto',\n },\n mobileContentSx,\n )}\n data-testid=\"Header.mobilenav\"\n {...restMobileContent}\n >\n {processedChildren}\n </Box>\n {drawerButtons && (\n <Box sx={{ p: 2, pt: 0 }}>\n <Box\n sx={{\n pt: 0.75,\n display: 'flex',\n flexDirection: 'column-reverse',\n alignItems: 'stretch',\n justifyContent: 'flex-start',\n // border from appbar.theme.ts\n borderTop: 1,\n borderColor: theme.palette.mode === 'dark' ? 'onSurface.os700' : 'surface.secondary',\n }}\n >\n {drawerButtons}\n </Box>\n </Box>\n )}\n </Drawer>\n )}\n </>\n );\n },\n);\n"],"names":["Header","forwardRef","children","logo","buttons","visibleButtons","mobile","propMobile","open","propOpen","setOpen","propSetOpen","inContainer","toolbarProps","logoProps","contentProps","mobileContentProps","buttonsProps","menuButtonProps","menuIcon","closeMenuIcon","drawerProps","rest","ref","theme","useTheme","downLg","useMediaQuery","breakpoints","down","undefined","sx","logoSx","restLogo","contentSx","restContent","mobileContentSx","restMobileContent","buttonsSx","restButtons","drawerSx","slotProps","drawerSlotProps","restDrawer","paper","drawerPaperProps","backdrop","drawerBackdropProps","restDrawerSlotProps","drawerPaperSx","restDrawerPaper","drawerBackdropSx","restDrawerBackdrop","rawOpen","rawSetOpen","useState","processedChildren","processedButtons","drawerButtons","useMemo","flatten","nodes","extend","keyid","result","Children","forEach","child","idx","type","Fragment","push","props","isValidElement","HeaderButton","HeaderLanguageSelect","HeaderNavigationLink","HeaderNavigationHero","HeaderNavigationMenu","includes","cloneElement","key","length","flattenedChildren","flattenedVisibleButtons","flattenedRestButtons","_jsxs","_Fragment","_jsx","AppBar","Toolbar","disableGutters","Box","sxOverride","color","palette","mode","flexShrink","display","alignItems","justifyContent","position","py","getFocusRingStyle","boxShadow","minWidth","flexGrow","alignSelf","gap","lg","xl","pl","mb","mr","xs","onClick","prev","CloseIcon","MenuIcon","Drawer","disablePortal","disableEnforceFocus","disableAutoFocus","anchor","onClose","zIndex","appBar","top","mixins","toolbar","minHeight","bottom","height","gridTemplateRows","p","overflow","pt","flexDirection","borderTop","borderColor"],"mappings":"mcA6GO,MAAMA,EAA0BC,EAAAA,WACrC,EAEIC,WACAC,OACAC,UACAC,iBACAC,OAAQC,EACRC,KAAMC,EACNC,QAASC,EACTC,eAAc,EACdC,eACAC,YACAC,eACAC,qBACAC,eACAC,kBACAC,WACAC,gBACAC,iBACGC,GAELC,KAEA,MAAMC,EAAQC,EAAAA,WACRC,EAASC,EAAAA,cAAcH,EAAMI,YAAYC,KAAK,OAE9CvB,OAAwBwB,IAAfvB,EAA2BmB,EAASnB,GAC3CwB,GAAIC,KAAWC,GAAanB,GAAa,CAAA,GACzCiB,GAAIG,KAAcC,GAAgBpB,GAAgB,CAAA,GAClDgB,GAAIK,KAAoBC,GAAsBrB,GAAsB,CAAA,GACpEe,GAAIO,KAAcC,GAAgBtB,GAAgB,CAAA,GAClDc,GAAIS,EAAUC,UAAWC,KAAoBC,GAAetB,GAAe,CAAA,GAC3EuB,MAAOC,EAAkBC,SAAUC,KAAwBC,GAAwBN,GAAmB,CAAA,GACtGX,GAAIkB,KAAkBC,GAAqBL,GAAmC,CAAA,GAC9Ed,GAAIoB,KAAqBC,GAAwBL,GAAyC,CAAA,GAC3FM,EAASC,GAAcC,EAAAA,UAAS,GACjC/C,GAAOC,GAAY4C,EACnB3C,GAAyDC,GAAe2C,GAKvEE,GAAmBC,GAAkBC,IAAiBC,EAAAA,QAAQ,KACnE,SAASC,EAAQC,EAAOC,EAAQC,GAC9B,MAAMC,EAAS,GA6Bf,OA5BAC,EAAAA,SAASC,QAAQL,EAAO,CAACM,EAAOC,KAC1BD,GAAOE,OAASC,WAClBN,EAAOO,QAAQX,EAAQO,EAAMK,MAAMtE,SAAU4D,EAAQ,GAAGC,QAExDU,EAAAA,eAAeN,IACf,CACEO,EAAAA,aACAC,EAAAA,qBACAC,EAAAA,qBACAC,EAAA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,iBAAkB,oBAEpBpF,MAECC,MAEFF,MAEDL,YAEJ6C,EAAAA,IAACI,OACC7D,GAAI8D,aACF,CACEyC,EAAG,EACHC,SAAU,QAEZnG,GACD,cACW,sBACRC,EAAiBnC,SAEpBsD,KAEFE,IACC8B,MAACI,EAAAA,IAAG,CAAC7D,GAAI,CAAEuG,EAAG,EAAGE,GAAI,GAAGtI,SACtBsF,EAAAA,IAACI,MAAG,CACF7D,GAAI,CACFyG,GAAI,IACJtC,QAAS,OACTuC,cAAe,iBACftC,WAAY,UACZC,eAAgB,aAEhBsC,UAAW,EACXC,YAAoC,SAAvBnH,EAAMuE,QAAQC,KAAkB,kBAAoB,qBAClE9F,SAEAwD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FC, ElementType } from 'react';
|
|
2
2
|
import { LinkProps } from '@mui/material';
|
|
3
|
-
import { LogoProps } from '
|
|
3
|
+
import { LogoProps } from '../logo/Logo';
|
|
4
4
|
export interface HeaderLogoProps extends LinkProps<ElementType> {
|
|
5
5
|
/**
|
|
6
6
|
* Properties applied to Logo component
|
|
@@ -31,7 +31,7 @@ export interface HeaderNavigationHeroProps extends HeaderNavigationLinkProps {
|
|
|
31
31
|
/**
|
|
32
32
|
* Props applied to Collapse component
|
|
33
33
|
*/
|
|
34
|
-
|
|
34
|
+
collapseProps?: CollapseProps;
|
|
35
35
|
/**
|
|
36
36
|
* Props applied to Portal if disableBackdrop property is not provided
|
|
37
37
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderNavigationHero.js","sources":["../../../../../src/components/header/HeaderNavigationHero.tsx"],"sourcesContent":["import React, { FC, forwardRef, useState, ElementType, useRef } from 'react';\nimport {\n Collapse,\n Backdrop,\n ClickAwayListener,\n Box,\n BoxProps,\n Portal,\n Container,\n ClickAwayListenerProps,\n ContainerProps,\n PortalProps,\n BackdropProps,\n CollapseProps,\n useMediaQuery,\n Theme,\n useTheme,\n} from '@mui/material';\nimport { sxOverride } from '@/src/utils/sxOverride';\nimport { ChevronDownIcon } from '@/src/components/icon/stroke/ChevronDownIcon';\nimport { HeaderNavigationLink, HeaderNavigationLinkProps } from './HeaderNavigationLink';\n\nexport interface HeaderNavigationHeroProps extends HeaderNavigationLinkProps {\n /**\n * Wrap the content into container\n * @default false\n */\n inContainer?: boolean;\n /**\n * Controls appearance of backdrop when content opens\n * @default false\n */\n disableBackdrop?: boolean;\n /**\n * Props applied to ClickAwayListener\n */\n clickAwayListenerProps?: Omit<ClickAwayListenerProps, 'children'>;\n /**\n * Props applied to main wrapper of content\n */\n contentProps?: BoxProps<ElementType>;\n /**\n * Props applied to main wrapper before collapsible\n */\n wrapperProps?: BoxProps<ElementType>;\n /**\n * Props applied to Container if inContainer property is provided\n */\n containerProps?: ContainerProps;\n /**\n * Props applied to Collapse component\n */\n collapseProp?: CollapseProps;\n /**\n * Props applied to Portal if disableBackdrop property is not provided\n */\n portalProps?: PortalProps;\n /**\n * Props applied to Backdrop if disableBackdrop property is not provided\n */\n backdropProps?: BackdropProps;\n}\n\n/**\n * HeaderNavigationLink with the integration of the complex hero menu\n */\nexport const HeaderNavigationHero: FC<HeaderNavigationHeroProps> = forwardRef(\n (\n {\n children,\n sx,\n label,\n icon,\n extend,\n inContainer = false,\n disableBackdrop = false,\n onClick,\n clickAwayListenerProps,\n contentProps,\n wrapperProps,\n containerProps,\n collapseProps,\n portalProps,\n backdropProps,\n ...rest\n },\n ref,\n ) => {\n const buttonRef = useRef(null);\n const [open, setOpen] = useState(false);\n const theme = useTheme();\n const downLg = useMediaQuery<Theme>(theme.breakpoints.down('lg'));\n const mobile = extend === undefined ? downLg : extend;\n const { sx: backdropSx, ...restBackdrop } = backdropProps ?? {};\n const { sx: wrapperSx, ...restWrapper } = wrapperProps ?? {};\n const { sx: contentSx, ...restContent } = contentProps ?? {};\n\n return (\n <>\n <HeaderNavigationLink\n active={open}\n extend={extend}\n icon={\n icon || (\n <ChevronDownIcon\n sx={{\n '&&&': {\n fontSize: extend === undefined ? { xs: '20px', lg: '14px' } : ['20px', '14px'][+!extend],\n },\n color:\n extend === undefined\n ? {\n xs: theme.palette.mode === 'dark' ? 'onSurface.os300' : 'onSurface.os700',\n lg: 'currentColor',\n }\n : [theme.palette.mode === 'dark' ? 'onSurface.os300' : 'onSurface.os700', 'currentColor'][\n +!extend\n ],\n transform: `rotate(${open ? '180' : '0'}deg)`,\n transition:\n extend === undefined\n ? {\n xs: theme.transitions.create('transform', {\n duration: theme.transitions.duration.shortest,\n }),\n lg: 'none',\n }\n : [\n theme.transitions.create('transform', {\n duration: theme.transitions.duration.shortest,\n }),\n 'none',\n ][+!extend],\n }}\n />\n )\n }\n onClick={(e) => {\n onClick?.(e);\n setOpen((prev) => !prev);\n }}\n sx={sxOverride(\n {\n justifyContent:\n extend === undefined\n ? { xs: 'space-between', lg: 'flex-start' }\n : ['space-between', 'flex-start'][+!extend],\n },\n sx,\n )}\n ref={ref ?? buttonRef}\n data-testid=\"HeaderNavigationHero\"\n {...rest}\n >\n {label}\n </HeaderNavigationLink>\n <ClickAwayListener\n onClickAway={(e) =>\n !((ref as React.RefObject<HTMLButtonElement>) ?? buttonRef)?.current?.contains(e?.target as Node) &&\n setOpen(false)\n }\n {...clickAwayListenerProps}\n >\n <Box\n sx={sxOverride(\n {\n position: extend === undefined ? { xs: 'static', lg: 'absolute' } : ['static', 'absolute'][+!extend],\n zIndex: '10',\n left: '0',\n right: '0',\n top: theme.mixins.toolbar.minHeight,\n maxHeight: `calc(100vh - ${theme.mixins.toolbar.minHeight})`,\n overflow: 'auto',\n },\n wrapperSx,\n )}\n {...restWrapper}\n >\n <Collapse in={open} {...collapseProps}>\n <Box\n sx={sxOverride(\n {\n backgroundColor:\n extend === undefined\n ? {\n xs: 'unset',\n lg: theme.palette.mode === 'dark' ? 'surface.primary' : 'background.primary',\n }\n : ['unset', theme.palette.mode === 'dark' ? 'surface.primary' : 'background.primary'][+!extend],\n py: extend === undefined ? { xs: 0, lg: 2 } : [0, 2][+!extend],\n px: extend === undefined ? { xs: 1, lg: 2 } : [1, 2][+!extend],\n ...(inContainer && {\n px: 0,\n }),\n },\n contentSx,\n )}\n {...restContent}\n >\n {inContainer ? (\n <Container maxWidth=\"xl\" {...containerProps}>\n {children}\n </Container>\n ) : (\n children\n )}\n </Box>\n </Collapse>\n </Box>\n </ClickAwayListener>\n {!disableBackdrop && !mobile && (\n <Portal {...portalProps}>\n <Backdrop open={open} sx={sxOverride({ zIndex: theme.zIndex.appBar - 50 }, backdropSx)} {...restBackdrop} />\n </Portal>\n )}\n </>\n );\n },\n);\n"],"names":["HeaderNavigationHero","forwardRef","children","sx","label","icon","extend","inContainer","disableBackdrop","onClick","clickAwayListenerProps","contentProps","wrapperProps","containerProps","collapseProps","portalProps","backdropProps","rest","ref","buttonRef","useRef","open","setOpen","useState","theme","useTheme","downLg","useMediaQuery","breakpoints","down","mobile","undefined","backdropSx","restBackdrop","wrapperSx","restWrapper","contentSx","restContent","_jsxs","_jsx","HeaderNavigationLink","active","ChevronDownIcon","fontSize","xs","lg","color","palette","mode","transform","transition","transitions","create","duration","shortest","e","prev","sxOverride","justifyContent","ClickAwayListener","onClickAway","current","contains","target","Box","position","zIndex","left","right","top","mixins","toolbar","minHeight","maxHeight","overflow","Collapse","in","backgroundColor","py","px","Container","maxWidth","Portal","Backdrop","appBar"],"mappings":"4OAkEaA,EAAsDC,EAAAA,WACjE,EAEIC,WACAC,KACAC,QACAC,OACAC,SACAC,eAAc,EACdC,mBAAkB,EAClBC,UACAC,yBACAC,eACAC,eACAC,iBACAC,gBACAC,cACAC,mBACGC,GAELC,KAEA,MAAMC,EAAYC,EAAAA,OAAO,OAClBC,EAAMC,GAAWC,EAAAA,UAAS,GAC3BC,EAAQC,EAAAA,WACRC,EAASC,EAAAA,cAAqBH,EAAMI,YAAYC,KAAK,OACrDC,OAAoBC,IAAXzB,EAAuBoB,EAASpB,GACvCH,GAAI6B,KAAeC,GAAiBjB,GAAiB,CAAA,GACrDb,GAAI+B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GAC7F4D,OAAQ,KACRC,KAAM,IACNC,MAAO,IACPC,IAAK7C,EAAM8C,OAAOC,QAAQC,UAC1BC,UAAW,gBAAgBjD,EAAM8C,OAAOC,QAAQC,aAChDE,SAAU,QAEZxC,MAEEC,WAEJI,EAAAA,IAACoC,EAAAA,UAASC,GAAIvD,KAAUP,WACtByB,EAAAA,IAACyB,EAAAA,KACC7D,GAAIsD,aACF,CACEoB,qBACa9C,IAAXzB,EACI,CACEsC,GAAI,QACJC,GAA2B,SAAvBrB,EAAMuB,QAAQC,KAAkB,kBAAoB,sBAE1D,CAAC,QAAgC,SAAvBxB,EAAMuB,QAAQC,KAAkB,kBAAoB,wBAAwB1C,GAC5FwE,QAAe/C,IAAXzB,EAAuB,CAAEsC,GAAI,EAAGC,GAAI,GAAM,CAAC,EAAG,KAAKvC,GACvDyE,QAAehD,IAAXzB,EAAuB,CAAEsC,GAAI,EAAGC,GAAI,GAAM,CAAC,EAAG,KAAKvC,MACnDC,GAAe,CACjBwE,GAAI,IAGR3C,MAEEC,EAAWnC,SAEdK,EACCgC,EAAAA,IAACyC,YAAS,CAACC,SAAS,QAASpE,EAAcX,SACxCA,eASXM,IAAoBsB,GACpBS,MAAC2C,EAAAA,OAAM,IAAKnE,EAAWb,SACrBqC,EAAAA,IAAC4C,WAAQ,CAAC9D,KAAMA,EAAMlB,GAAIsD,aAAW,CAAES,OAAQ1C,EAAM0C,OAAOkB,OAAS,IAAMpD,MAAiBC"}
|
|
1
|
+
{"version":3,"file":"HeaderNavigationHero.js","sources":["../../../../../src/components/header/HeaderNavigationHero.tsx"],"sourcesContent":["import React, { FC, forwardRef, useState, ElementType, useRef } from 'react';\nimport {\n Collapse,\n Backdrop,\n ClickAwayListener,\n Box,\n BoxProps,\n Portal,\n Container,\n ClickAwayListenerProps,\n ContainerProps,\n PortalProps,\n BackdropProps,\n CollapseProps,\n useMediaQuery,\n Theme,\n useTheme,\n} from '@mui/material';\nimport { sxOverride } from '@/src/utils/sxOverride';\nimport { ChevronDownIcon } from '@/src/components/icon/stroke/ChevronDownIcon';\nimport { HeaderNavigationLink, HeaderNavigationLinkProps } from './HeaderNavigationLink';\n\nexport interface HeaderNavigationHeroProps extends HeaderNavigationLinkProps {\n /**\n * Wrap the content into container\n * @default false\n */\n inContainer?: boolean;\n /**\n * Controls appearance of backdrop when content opens\n * @default false\n */\n disableBackdrop?: boolean;\n /**\n * Props applied to ClickAwayListener\n */\n clickAwayListenerProps?: Omit<ClickAwayListenerProps, 'children'>;\n /**\n * Props applied to main wrapper of content\n */\n contentProps?: BoxProps<ElementType>;\n /**\n * Props applied to main wrapper before collapsible\n */\n wrapperProps?: BoxProps<ElementType>;\n /**\n * Props applied to Container if inContainer property is provided\n */\n containerProps?: ContainerProps;\n /**\n * Props applied to Collapse component\n */\n collapseProps?: CollapseProps;\n /**\n * Props applied to Portal if disableBackdrop property is not provided\n */\n portalProps?: PortalProps;\n /**\n * Props applied to Backdrop if disableBackdrop property is not provided\n */\n backdropProps?: BackdropProps;\n}\n\n/**\n * HeaderNavigationLink with the integration of the complex hero menu\n */\nexport const HeaderNavigationHero: FC<HeaderNavigationHeroProps> = forwardRef(\n (\n {\n children,\n sx,\n label,\n icon,\n extend,\n inContainer = false,\n disableBackdrop = false,\n onClick,\n clickAwayListenerProps,\n contentProps,\n wrapperProps,\n containerProps,\n collapseProps,\n portalProps,\n backdropProps,\n ...rest\n },\n ref,\n ) => {\n const buttonRef = useRef(null);\n const [open, setOpen] = useState(false);\n const theme = useTheme();\n const downLg = useMediaQuery<Theme>(theme.breakpoints.down('lg'));\n const mobile = extend === undefined ? downLg : extend;\n const { sx: backdropSx, ...restBackdrop } = backdropProps ?? {};\n const { sx: wrapperSx, ...restWrapper } = wrapperProps ?? {};\n const { sx: contentSx, ...restContent } = contentProps ?? {};\n\n return (\n <>\n <HeaderNavigationLink\n active={open}\n extend={extend}\n icon={\n icon || (\n <ChevronDownIcon\n sx={{\n '&&&': {\n fontSize: extend === undefined ? { xs: '20px', lg: '14px' } : ['20px', '14px'][+!extend],\n },\n color:\n extend === undefined\n ? {\n xs: theme.palette.mode === 'dark' ? 'onSurface.os300' : 'onSurface.os700',\n lg: 'currentColor',\n }\n : [theme.palette.mode === 'dark' ? 'onSurface.os300' : 'onSurface.os700', 'currentColor'][\n +!extend\n ],\n transform: `rotate(${open ? '180' : '0'}deg)`,\n transition:\n extend === undefined\n ? {\n xs: theme.transitions.create('transform', {\n duration: theme.transitions.duration.shortest,\n }),\n lg: 'none',\n }\n : [\n theme.transitions.create('transform', {\n duration: theme.transitions.duration.shortest,\n }),\n 'none',\n ][+!extend],\n }}\n />\n )\n }\n onClick={(e) => {\n onClick?.(e);\n setOpen((prev) => !prev);\n }}\n sx={sxOverride(\n {\n justifyContent:\n extend === undefined\n ? { xs: 'space-between', lg: 'flex-start' }\n : ['space-between', 'flex-start'][+!extend],\n },\n sx,\n )}\n ref={ref ?? buttonRef}\n data-testid=\"HeaderNavigationHero\"\n {...rest}\n >\n {label}\n </HeaderNavigationLink>\n <ClickAwayListener\n onClickAway={(e) =>\n !((ref as React.RefObject<HTMLButtonElement>) ?? buttonRef)?.current?.contains(e?.target as Node) &&\n setOpen(false)\n }\n {...clickAwayListenerProps}\n >\n <Box\n sx={sxOverride(\n {\n position: extend === undefined ? { xs: 'static', lg: 'absolute' } : ['static', 'absolute'][+!extend],\n zIndex: '10',\n left: '0',\n right: '0',\n top: theme.mixins.toolbar.minHeight,\n maxHeight: `calc(100vh - ${theme.mixins.toolbar.minHeight})`,\n overflow: 'auto',\n },\n wrapperSx,\n )}\n {...restWrapper}\n >\n <Collapse in={open} {...collapseProps}>\n <Box\n sx={sxOverride(\n {\n backgroundColor:\n extend === undefined\n ? {\n xs: 'unset',\n lg: theme.palette.mode === 'dark' ? 'surface.primary' : 'background.primary',\n }\n : ['unset', theme.palette.mode === 'dark' ? 'surface.primary' : 'background.primary'][+!extend],\n py: extend === undefined ? { xs: 0, lg: 2 } : [0, 2][+!extend],\n px: extend === undefined ? { xs: 1, lg: 2 } : [1, 2][+!extend],\n ...(inContainer && {\n px: 0,\n }),\n },\n contentSx,\n )}\n {...restContent}\n >\n {inContainer ? (\n <Container maxWidth=\"xl\" {...containerProps}>\n {children}\n </Container>\n ) : (\n children\n )}\n </Box>\n </Collapse>\n </Box>\n </ClickAwayListener>\n {!disableBackdrop && !mobile && (\n <Portal {...portalProps}>\n <Backdrop open={open} sx={sxOverride({ zIndex: theme.zIndex.appBar - 50 }, backdropSx)} {...restBackdrop} />\n </Portal>\n )}\n </>\n );\n },\n);\n"],"names":["HeaderNavigationHero","forwardRef","children","sx","label","icon","extend","inContainer","disableBackdrop","onClick","clickAwayListenerProps","contentProps","wrapperProps","containerProps","collapseProps","portalProps","backdropProps","rest","ref","buttonRef","useRef","open","setOpen","useState","theme","useTheme","downLg","useMediaQuery","breakpoints","down","mobile","undefined","backdropSx","restBackdrop","wrapperSx","restWrapper","contentSx","restContent","_jsxs","_jsx","HeaderNavigationLink","active","ChevronDownIcon","fontSize","xs","lg","color","palette","mode","transform","transition","transitions","create","duration","shortest","e","prev","sxOverride","justifyContent","ClickAwayListener","onClickAway","current","contains","target","Box","position","zIndex","left","right","top","mixins","toolbar","minHeight","maxHeight","overflow","Collapse","in","backgroundColor","py","px","Container","maxWidth","Portal","Backdrop","appBar"],"mappings":"4OAkEaA,EAAsDC,EAAAA,WACjE,EAEIC,WACAC,KACAC,QACAC,OACAC,SACAC,eAAc,EACdC,mBAAkB,EAClBC,UACAC,yBACAC,eACAC,eACAC,iBACAC,gBACAC,cACAC,mBACGC,GAELC,KAEA,MAAMC,EAAYC,EAAAA,OAAO,OAClBC,EAAMC,GAAWC,EAAAA,UAAS,GAC3BC,EAAQC,EAAAA,WACRC,EAASC,EAAAA,cAAqBH,EAAMI,YAAYC,KAAK,OACrDC,OAAoBC,IAAXzB,EAAuBoB,EAASpB,GACvCH,GAAI6B,KAAeC,GAAiBjB,GAAiB,CAAA,GACrDb,GAAI+B,KAAcC,GAAgBvB,GAAgB,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AM,IACNC,MAAO,IACPC,IAAK7C,EAAM8C,OAAOC,QAAQC,UAC1BC,UAAW,gBAAgBjD,EAAM8C,OAAOC,QAAQC,aAChDE,SAAU,QAEZxC,MAEEC,WAEJI,EAAAA,IAACoC,EAAAA,UAASC,GAAIvD,KAAUP,WACtByB,EAAAA,IAACyB,EAAAA,KACC7D,GAAIsD,aACF,CACEoB,qBACa9C,IAAXzB,EACI,CACEsC,GAAI,QACJC,GAA2B,SAAvBrB,EAAMuB,QAAQC,KAAkB,kBAAoB,sBAE1D,CAAC,QAAgC,SAAvBxB,EAAMuB,QAAQC,KAAkB,kBAAoB,wBAAwB1C,GAC5FwE,QAAe/C,IAAXzB,EAAuB,CAAEsC,GAAI,EAAGC,GAAI,GAAM,CAAC,EAAG,KAAKvC,GACvDyE,QAAehD,IAAXzB,EAAuB,CAAEsC,GAAI,EAAGC,GAAI,GAAM,CAAC,EAAG,KAAKvC,MACnDC,GAAe,CACjBwE,GAAI,IAGR3C,MAEEC,EAAWnC,SAEdK,EACCgC,EAAAA,IAACyC,YAAS,CAACC,SAAS,QAASpE,EAAcX,SACxCA,eASXM,IAAoBsB,GACpBS,MAAC2C,EAAAA,OAAM,IAAKnE,EAAWb,SACrBqC,EAAAA,IAAC4C,WAAQ,CAAC9D,KAAMA,EAAMlB,GAAIsD,aAAW,CAAES,OAAQ1C,EAAM0C,OAAOkB,OAAS,IAAMpD,MAAiBC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),o=require("react"),t=require("@mui/material"),r=require("../../utils/sxOverride/sxOverride.js"),i=require("../icon/stroke/ArrowTopRightIcon.js"),a=require("../focusring/focusring.js"),s=require("../../materialui/button/interactive.js"),l=require("../../materialui/typography/typography.theme.js");const n=o.forwardRef(({sx:n,children:d,label:c,icon:x,active:p=!1,external:g=!1,extend:u,labelWrapperProps:v,labelProps:b,selectedLabelProps:y,...f},h)=>{const m=t.useTheme(),{sx:k,...L}=v??{},{sx:w,...N}=b??{},{sx:j,...H}=y??{},F=o.useMemo(()=>g?e.jsx(i.ArrowTopRightIcon,{}):x,[x,g]);return e.jsxs(t.ButtonBase,{sx:r.sxOverride({...m.typography.list,...void 0===u?{[m.breakpoints.down("lg")]:{...l.getTypography("body","rtl"===m.direction,"large")}}:[{"&&":{...l.getTypography("body","rtl"===m.direction,"large")}},{}][+!u],position:"relative",zIndex:"100",display:void 0===u?{xs:"flex",lg:"inline-flex"}:["flex","inline-flex"][+!u],width:void 0===u?{xs:"100%",lg:"auto"}:["100%","auto"][+!u],gap:.5,alignItems:"center",justifyContent:"flex-start",py:void 0===u?{xs:2,lg:1}:[2,1][+!u],px:void 0===u?{xs:1,lg:.5}:[1,.5][+!u],transition:"transform 0.3s ease-out, color 0.3s ease-out, background-color 0.3s ease-out, border-color 0.3s ease-out, box-shadow 0.3s ease-out, opacity 0.3s ease-out","& .MuiSvgIcon-root":{fontSize:"14px"},"&:after":{content:void 0===u?{xs:"none",lg:'""'}:["none",'""'][+!u],position:"absolute",left:"0",right:"0",bottom:"0",height:"1px",backgroundColor:"transparent",...p&&{height:"2px",backgroundColor:"text.primary"}},"&.Mui-disabled":{color:"disabled.tertiary"},...s.getInteractiveStyle({color:"dark"===m.palette.mode?"onSurface.os300":"onSurface.os700","&&:after":{backgroundColor:"transparent"},"& .FlowHeaderNavigationLink-label":{opacity:"1"},"& .FlowHeaderNavigationLink-selectedLabel":{opacity:"0"},...p&&{color:"text.primary","&&:after":{backgroundColor:"text.primary"},"& .FlowHeaderNavigationLink-label":{opacity:"0"},"& .FlowHeaderNavigationLink-selectedLabel":{opacity:"1"}}},{color:"text.primary","&&:after":{backgroundColor:"text.primary"},"& .FlowHeaderNavigationLink-label":{opacity:"0"},"& .FlowHeaderNavigationLink-selectedLabel":{opacity:"1"}}),...a.getFocusRingStyle(m),"&&:before":{borderRadius:"4px",top:void 0===u?{xs:"0",lg:"2px"}:["0","2px"][+!u],bottom:void 0===u?{xs:"0",lg:"-2px"}:["0","-2px"][+!u]}},n),ref:h,"data-testid":"HeaderNavigationLink",...f,children:[(d||c)&&e.jsxs(t.Box,{className:"FlowHeaderNavigationLink-labelWrapper",sx:r.sxOverride({display:"inline-flex",alignItems:"center",justifyContent:"center",textAlign:"center",position:"relative"},k),...L,children:[e.jsx(t.Box,{className:"FlowHeaderNavigationLink-label",sx:r.sxOverride({position:"absolute",left:void 0===u?{xs:"0",lg:"auto"}:["0","auto"][+!u]},w),...N,children:d||c}),e.jsx(t.Box,{className:"FlowHeaderNavigationLink-selectedLabel",sx:r.sxOverride({fontWeight:"700",opacity:"0",position:"relative"},j),"aria-hidden":"true",...H,children:d||c})]}),F]})});exports.HeaderNavigationLink=n;
|
|
2
2
|
//# sourceMappingURL=HeaderNavigationLink.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderNavigationLink.js","sources":["../../../../../src/components/header/HeaderNavigationLink.tsx"],"sourcesContent":["import React, { useMemo, ElementType, FC, forwardRef, ReactNode, ForwardedRef } from 'react';\nimport { ButtonBase, ButtonBaseProps, Box, BoxProps, useTheme } from '@mui/material';\nimport { sxOverride } from '@/src/utils/sxOverride';\nimport { ArrowTopRightIcon } from '@/src/components/icon/stroke/ArrowTopRightIcon';\nimport { getFocusRingStyle } from '@/src/components/focusring/focusring';\nimport { getInteractiveStyle } from '@/src/materialui/button/interactive';\nimport { getTypography } from '@/src/materialui/typography/typography.theme';\n\nexport interface HeaderNavigationLinkProps extends ButtonBaseProps<ElementType> {\n /**\n * Displayed navigation text, can be provided as children as well\n */\n label?: ReactNode;\n /**\n * Marks item currently active\n * @default false\n */\n active?: boolean;\n /**\n * Indicates external link\n * @default false\n */\n external?: boolean;\n /**\n * Expect icon component that will be rendered after the label\n */\n icon?: ReactNode;\n /**\n * Change link into extended mobile version\n */\n extend?: boolean;\n /**\n * Properties applied to wrapper of label\n */\n labelWrapperProps?: BoxProps<ElementType>;\n /**\n * Properties applied to default label\n */\n labelProps?: BoxProps<ElementType>;\n /**\n * Properties applied to selected label\n */\n selectedLabelProps?: BoxProps<ElementType>;\n}\n\n/**\n * Component to render styled button in the header\n */\nexport const HeaderNavigationLink: FC<HeaderNavigationLinkProps> = forwardRef(\n (\n {\n sx,\n children,\n label,\n icon,\n active = false,\n external = false,\n extend,\n labelWrapperProps,\n labelProps,\n selectedLabelProps,\n ...rest\n },\n ref,\n ) => {\n const theme = useTheme();\n const { sx: labelWrapperSx, ...restLabelWrapper } = labelWrapperProps ?? {};\n const { sx: labelSx, ...restLabel } = labelProps ?? {};\n const { sx: selectedLabelSx, ...restSelectedLabel } = selectedLabelProps ?? {};\n const linkIcon = useMemo(() => {\n return external ? <ArrowTopRightIcon /> : icon;\n }, [icon, external]);\n\n return (\n <ButtonBase\n sx={sxOverride(\n {\n ...theme.typography.list,\n ...(extend === undefined\n ? {\n [theme.breakpoints.down('lg')]: {\n // switch to 'large body' typography according to Figma\n ...getTypography('body', theme.direction === 'rtl', 'large'),\n },\n }\n : [\n {\n '&&': {\n ...getTypography('body', theme.direction === 'rtl', 'large'),\n },\n },\n {},\n ][+!extend]),\n position: 'relative',\n zIndex: '100',\n // icon and text next to each other\n display: extend === undefined ? { xs: 'flex', lg: 'inline-flex' } : ['flex', 'inline-flex'][+!extend],\n width: extend === undefined ? { xs: '100%', lg: 'auto' } : ['100%', 'auto'][+!extend],\n gap: 0.5,\n alignItems: 'center',\n justifyContent: 'flex-start',\n py: extend === undefined ? { xs: 2, lg: 1 } : [2, 1][+!extend],\n px: extend === undefined ? { xs: 1, lg: 0.5 } : [1, 0.5][+!extend],\n transition:\n 'transform 0.3s ease-out, color 0.3s ease-out, background-color 0.3s ease-out, border-color 0.3s ease-out, box-shadow 0.3s ease-out, opacity 0.3s ease-out',\n // size of icon\n '& .MuiSvgIcon-root': {\n fontSize: '14px',\n },\n // bottom border\n '&:after': {\n content: extend === undefined ? { xs: 'none', lg: '\"\"' } : ['none', '\"\"'][+!extend],\n position: 'absolute',\n left: '0',\n right: '0',\n // move directly into border of appbar\n bottom: '0',\n height: '1px',\n backgroundColor: 'transparent.transparent',\n ...(active && {\n height: '2px',\n backgroundColor: 'text.primary',\n }),\n },\n // disabled style\n '&.Mui-disabled': {\n color: 'disabled.tertiary',\n },\n // interactive style\n ...getInteractiveStyle(\n {\n color: theme.palette.mode === 'dark' ? 'onSurface.os300' : 'onSurface.os700',\n '&&:after': {\n backgroundColor: 'transparent.transparent',\n },\n '& .FlowHeaderNavigationLink-label': {\n opacity: '1',\n },\n '& .FlowHeaderNavigationLink-selectedLabel': {\n opacity: '0',\n },\n // active state is same as hover state\n ...(active && {\n color: 'text.primary',\n '&&:after': {\n backgroundColor: 'text.primary',\n },\n '& .FlowHeaderNavigationLink-label': {\n opacity: '0',\n },\n '& .FlowHeaderNavigationLink-selectedLabel': {\n opacity: '1',\n },\n }),\n },\n {\n color: 'text.primary',\n '&&:after': {\n backgroundColor: 'text.primary',\n },\n '& .FlowHeaderNavigationLink-label': {\n opacity: '0',\n },\n '& .FlowHeaderNavigationLink-selectedLabel': {\n opacity: '1',\n },\n },\n ),\n ...getFocusRingStyle(theme),\n // adjust focus ring\n '&&:before': {\n borderRadius: '4px',\n // make sure top border is not cropped\n top: extend === undefined ? { xs: '0', lg: '2px' } : ['0', '2px'][+!extend],\n bottom: extend === undefined ? { xs: '0', lg: '-2px' } : ['0', '-2px'][+!extend],\n },\n },\n sx,\n )}\n ref={ref as ForwardedRef<HTMLButtonElement>}\n data-testid=\"HeaderNavigationLink\"\n {...rest}\n >\n {(children || label) && (\n <Box\n className=\"FlowHeaderNavigationLink-labelWrapper\"\n sx={sxOverride(\n {\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n textAlign: 'center',\n position: 'relative',\n },\n labelWrapperSx,\n )}\n {...restLabelWrapper}\n >\n <Box\n className=\"FlowHeaderNavigationLink-label\"\n sx={sxOverride(\n {\n position: 'absolute',\n left: extend === undefined ? { xs: '0', lg: 'auto' } : ['0', 'auto'][+!extend],\n },\n labelSx,\n )}\n {...restLabel}\n >\n {children || label}\n </Box>\n <Box\n className=\"FlowHeaderNavigationLink-selectedLabel\"\n sx={sxOverride(\n {\n fontWeight: '700',\n opacity: '0',\n position: 'relative',\n },\n selectedLabelSx,\n )}\n aria-hidden=\"true\"\n {...restSelectedLabel}\n >\n {children || label}\n </Box>\n </Box>\n )}\n {linkIcon}\n </ButtonBase>\n );\n },\n);\n"],"names":["HeaderNavigationLink","forwardRef","sx","children","label","icon","active","external","extend","labelWrapperProps","labelProps","selectedLabelProps","rest","ref","theme","useTheme","labelWrapperSx","restLabelWrapper","labelSx","restLabel","selectedLabelSx","restSelectedLabel","linkIcon","useMemo","_jsx","ArrowTopRightIcon","_jsxs","ButtonBase","sxOverride","typography","list","undefined","breakpoints","down","getTypography","direction","position","zIndex","display","xs","lg","width","gap","alignItems","justifyContent","py","px","transition","fontSize","content","left","right","bottom","height","backgroundColor","color","getInteractiveStyle","palette","mode","opacity","getFocusRingStyle","borderRadius","top","Box","className","textAlign","fontWeight"],"mappings":"yVAgDO,MAAMA,EAAsDC,EAAAA,WACjE,EAEIC,KACAC,WACAC,QACAC,OACAC,UAAS,EACTC,YAAW,EACXC,SACAC,oBACAC,aACAC,wBACGC,GAELC,KAEA,MAAMC,EAAQC,EAAAA,YACNb,GAAIc,KAAmBC,GAAqBR,GAAqB,CAAA,GACjEP,GAAIgB,KAAYC,GAAcT,GAAc,CAAA,GAC5CR,GAAIkB,KAAoBC,GAAsBV,GAAsB,CAAA,EACtEW,EAAWC,EAAAA,QAAQ,IAChBhB,EAAWiB,EAAAA,IAACC,oBAAiB,CAAA,GAAMpB,EACzC,CAACA,EAAME,IAEV,OACEmB,OAACC,EAAAA,YACCzB,GAAI0B,EAAAA,WACF,IACKd,EAAMe,WAAWC,aACLC,IAAXvB,EACA,CACE,CAACM,EAAMkB,YAAYC,KAAK,OAAQ,IAE3BC,EAAAA,cAAc,OAA4B,QAApBpB,E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ACX+C,aAAc,MAEdC,SAAgB/B,IAAXvB,EAAuB,CAAE+B,GAAI,IAAKC,GAAI,OAAU,CAAC,IAAK,SAAShC,GACpE4C,YAAmBrB,IAAXvB,EAAuB,CAAE+B,GAAI,IAAKC,GAAI,QAAW,CAAC,IAAK,UAAUhC,KAG7EN,GAEFW,IAAKA,EAAsC,cAC/B,0BACRD,EAAIT,SAAA,EAENA,GAAYC,IACZsB,EAAAA,KAACqC,EAAAA,IAAG,CACFC,UAAU,wCACV9D,GAAI0B,aACF,CACEU,QAAS,cACTK,WAAY,SACZC,eAAgB,SAChBqB,UAAW,SACX7B,SAAU,YAEZpB,MAEEC,YAEJO,EAAAA,IAACuC,EAAAA,IAAG,CACFC,UAAU,iCACV9D,GAAI0B,EAAAA,WACF,CACEQ,SAAU,WACVc,UAAiBnB,IAAXvB,EAAuB,CAAE+B,GAAI,IAAKC,GAAI,QAAW,CAAC,IAAK,UAAUhC,IAEzEU,MAEEC,WAEHhB,GAAYC,IAEfoB,EAAAA,IAACuC,EAAAA,IAAG,CACFC,UAAU,yCACV9D,GAAI0B,EAAAA,WACF,CACEsC,WAAY,MACZP,QAAS,IACTvB,SAAU,YAEZhB,GACD,cACW,UACRC,EAAiBlB,SAEpBA,GAAYC,OAIlBkB"}
|
|
1
|
+
{"version":3,"file":"HeaderNavigationLink.js","sources":["../../../../../src/components/header/HeaderNavigationLink.tsx"],"sourcesContent":["import React, { useMemo, ElementType, FC, forwardRef, ReactNode, ForwardedRef } from 'react';\nimport { ButtonBase, ButtonBaseProps, Box, BoxProps, useTheme } from '@mui/material';\nimport { sxOverride } from '@/src/utils/sxOverride';\nimport { ArrowTopRightIcon } from '@/src/components/icon/stroke/ArrowTopRightIcon';\nimport { getFocusRingStyle } from '@/src/components/focusring/focusring';\nimport { getInteractiveStyle } from '@/src/materialui/button/interactive';\nimport { getTypography } from '@/src/materialui/typography/typography.theme';\n\nexport interface HeaderNavigationLinkProps extends ButtonBaseProps<ElementType> {\n /**\n * Displayed navigation text, can be provided as children as well\n */\n label?: ReactNode;\n /**\n * Marks item currently active\n * @default false\n */\n active?: boolean;\n /**\n * Indicates external link\n * @default false\n */\n external?: boolean;\n /**\n * Expect icon component that will be rendered after the label\n */\n icon?: ReactNode;\n /**\n * Change link into extended mobile version\n */\n extend?: boolean;\n /**\n * Properties applied to wrapper of label\n */\n labelWrapperProps?: BoxProps<ElementType>;\n /**\n * Properties applied to default label\n */\n labelProps?: BoxProps<ElementType>;\n /**\n * Properties applied to selected label\n */\n selectedLabelProps?: BoxProps<ElementType>;\n}\n\n/**\n * Component to render styled button in the header\n */\nexport const HeaderNavigationLink: FC<HeaderNavigationLinkProps> = forwardRef(\n (\n {\n sx,\n children,\n label,\n icon,\n active = false,\n external = false,\n extend,\n labelWrapperProps,\n labelProps,\n selectedLabelProps,\n ...rest\n },\n ref,\n ) => {\n const theme = useTheme();\n const { sx: labelWrapperSx, ...restLabelWrapper } = labelWrapperProps ?? {};\n const { sx: labelSx, ...restLabel } = labelProps ?? {};\n const { sx: selectedLabelSx, ...restSelectedLabel } = selectedLabelProps ?? {};\n const linkIcon = useMemo(() => {\n return external ? <ArrowTopRightIcon /> : icon;\n }, [icon, external]);\n\n return (\n <ButtonBase\n sx={sxOverride(\n {\n ...theme.typography.list,\n ...(extend === undefined\n ? {\n [theme.breakpoints.down('lg')]: {\n // switch to 'large body' typography according to Figma\n ...getTypography('body', theme.direction === 'rtl', 'large'),\n },\n }\n : [\n {\n '&&': {\n ...getTypography('body', theme.direction === 'rtl', 'large'),\n },\n },\n {},\n ][+!extend]),\n position: 'relative',\n zIndex: '100',\n // icon and text next to each other\n display: extend === undefined ? { xs: 'flex', lg: 'inline-flex' } : ['flex', 'inline-flex'][+!extend],\n width: extend === undefined ? { xs: '100%', lg: 'auto' } : ['100%', 'auto'][+!extend],\n gap: 0.5,\n alignItems: 'center',\n justifyContent: 'flex-start',\n py: extend === undefined ? { xs: 2, lg: 1 } : [2, 1][+!extend],\n px: extend === undefined ? { xs: 1, lg: 0.5 } : [1, 0.5][+!extend],\n transition:\n 'transform 0.3s ease-out, color 0.3s ease-out, background-color 0.3s ease-out, border-color 0.3s ease-out, box-shadow 0.3s ease-out, opacity 0.3s ease-out',\n // size of icon\n '& .MuiSvgIcon-root': {\n fontSize: '14px',\n },\n // bottom border\n '&:after': {\n content: extend === undefined ? { xs: 'none', lg: '\"\"' } : ['none', '\"\"'][+!extend],\n position: 'absolute',\n left: '0',\n right: '0',\n // move directly into border of appbar\n bottom: '0',\n height: '1px',\n backgroundColor: 'transparent',\n ...(active && {\n height: '2px',\n backgroundColor: 'text.primary',\n }),\n },\n // disabled style\n '&.Mui-disabled': {\n color: 'disabled.tertiary',\n },\n // interactive style\n ...getInteractiveStyle(\n {\n color: theme.palette.mode === 'dark' ? 'onSurface.os300' : 'onSurface.os700',\n '&&:after': {\n backgroundColor: 'transparent',\n },\n '& .FlowHeaderNavigationLink-label': {\n opacity: '1',\n },\n '& .FlowHeaderNavigationLink-selectedLabel': {\n opacity: '0',\n },\n // active state is same as hover state\n ...(active && {\n color: 'text.primary',\n '&&:after': {\n backgroundColor: 'text.primary',\n },\n '& .FlowHeaderNavigationLink-label': {\n opacity: '0',\n },\n '& .FlowHeaderNavigationLink-selectedLabel': {\n opacity: '1',\n },\n }),\n },\n {\n color: 'text.primary',\n '&&:after': {\n backgroundColor: 'text.primary',\n },\n '& .FlowHeaderNavigationLink-label': {\n opacity: '0',\n },\n '& .FlowHeaderNavigationLink-selectedLabel': {\n opacity: '1',\n },\n },\n ),\n ...getFocusRingStyle(theme),\n // adjust focus ring\n '&&:before': {\n borderRadius: '4px',\n // make sure top border is not cropped\n top: extend === undefined ? { xs: '0', lg: '2px' } : ['0', '2px'][+!extend],\n bottom: extend === undefined ? { xs: '0', lg: '-2px' } : ['0', '-2px'][+!extend],\n },\n },\n sx,\n )}\n ref={ref as ForwardedRef<HTMLButtonElement>}\n data-testid=\"HeaderNavigationLink\"\n {...rest}\n >\n {(children || label) && (\n <Box\n className=\"FlowHeaderNavigationLink-labelWrapper\"\n sx={sxOverride(\n {\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n textAlign: 'center',\n position: 'relative',\n },\n labelWrapperSx,\n )}\n {...restLabelWrapper}\n >\n <Box\n className=\"FlowHeaderNavigationLink-label\"\n sx={sxOverride(\n {\n position: 'absolute',\n left: extend === undefined ? { xs: '0', lg: 'auto' } : ['0', 'auto'][+!extend],\n },\n labelSx,\n )}\n {...restLabel}\n >\n {children || label}\n </Box>\n <Box\n className=\"FlowHeaderNavigationLink-selectedLabel\"\n sx={sxOverride(\n {\n fontWeight: '700',\n opacity: '0',\n position: 'relative',\n },\n selectedLabelSx,\n )}\n aria-hidden=\"true\"\n {...restSelectedLabel}\n >\n {children || label}\n </Box>\n </Box>\n )}\n {linkIcon}\n </ButtonBase>\n );\n },\n);\n"],"names":["HeaderNavigationLink","forwardRef","sx","children","label","icon","active","external","extend","labelWrapperProps","labelProps","selectedLabelProps","rest","ref","theme","useTheme","labelWrapperSx","restLabelWrapper","labelSx","restLabel","selectedLabelSx","restSelectedLabel","linkIcon","useMemo","_jsx","ArrowTopRightIcon","_jsxs","ButtonBase","sxOverride","typography","list","undefined","breakpoints","down","getTypography","direction","position","zIndex","display","xs","lg","width","gap","alignItems","justifyContent","py","px","transition","fontSize","content","left","right","bottom","height","backgroundColor","color","getInteractiveStyle","palette","mode","opacity","getFocusRingStyle","borderRadius","top","Box","className","textAlign","fontWeight"],"mappings":"yVAgDO,MAAMA,EAAsDC,EAAAA,WACjE,EAEIC,KACAC,WACAC,QACAC,OACAC,UAAS,EACTC,YAAW,EACXC,SACAC,oBACAC,aACAC,wBACGC,GAELC,KAEA,MAAMC,EAAQC,EAAAA,YACNb,GAAIc,KAAmBC,GAAqBR,GAAqB,CAAA,GACjEP,GAAIgB,KAAYC,GAAcT,GAAc,CAAA,GAC5CR,GAAIkB,KAAoBC,GAAsBV,GAAsB,CAAA,EACtEW,EAAWC,EAAAA,QAAQ,IACh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ACZiD,MAAO,eACP,WAAY,CACVD,gBAAiB,gBAEnB,oCAAqC,CACnCK,QAAS,KAEX,4CAA6C,CAC3CA,QAAS,OAIf,CACEJ,MAAO,eACP,WAAY,CACVD,gBAAiB,gBAEnB,oCAAqC,CACnCK,QAAS,KAEX,4CAA6C,CAC3CA,QAAS,UAIZC,EAAAA,kBAAkB9C,GAErB,YAAa,CACX+C,aAAc,MAEdC,SAAgB/B,IAAXvB,EAAuB,CAAE+B,GAAI,IAAKC,GAAI,OAAU,CAAC,IAAK,SAAShC,GACpE4C,YAAmBrB,IAAXvB,EAAuB,CAAE+B,GAAI,IAAKC,GAAI,QAAW,CAAC,IAAK,UAAUhC,KAG7EN,GAEFW,IAAKA,EAAsC,cAC/B,0BACRD,EAAIT,SAAA,EAENA,GAAYC,IACZsB,EAAAA,KAACqC,EAAAA,IAAG,CACFC,UAAU,wCACV9D,GAAI0B,aACF,CACEU,QAAS,cACTK,WAAY,SACZC,eAAgB,SAChBqB,UAAW,SACX7B,SAAU,YAEZpB,MAEEC,YAEJO,EAAAA,IAACuC,EAAAA,IAAG,CACFC,UAAU,iCACV9D,GAAI0B,EAAAA,WACF,CACEQ,SAAU,WACVc,UAAiBnB,IAAXvB,EAAuB,CAAE+B,GAAI,IAAKC,GAAI,QAAW,CAAC,IAAK,UAAUhC,IAEzEU,MAEEC,WAEHhB,GAAYC,IAEfoB,EAAAA,IAACuC,EAAAA,IAAG,CACFC,UAAU,yCACV9D,GAAI0B,EAAAA,WACF,CACEsC,WAAY,MACZP,QAAS,IACTvB,SAAU,YAEZhB,GACD,cACW,UACRC,EAAiBlB,SAEpBA,GAAYC,OAIlBkB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var r=require("react/jsx-runtime"),e=require("react"),C=require("@mui/material");const H=e.forwardRef((e,H)=>r.jsxs(C.SvgIcon,{viewBox:"2 2 20 20",ref:H,...e,children:[r.jsx("path",{d:"M10.7998 5.40039C10.7999 9.04523 13.7546 12.0008 17.3994 12.001C18.3073 12.001 19.1727 11.817 19.96 11.4854V17.1016C19.9596 18.2011 19.0801 19.1013 17.9805 19.1016C17.1205 19.1016 16.2406 18.5808 16.0205 17.501H7.98047C7.76043 18.5806 6.88031 19.1014 6.02051 19.1016C4.92072 19.1016 4.04038 18.2013 4.04004 17.1016V11.2607L4.52051 10.2812H3.08008V8.68164H5.28027L6.95996 5.20117H10.8047C10.8027 5.26728 10.7998 5.33381 10.7998 5.40039ZM7.08008 14.0615H9.58008C10.24 14.6214 11.0802 14.9814 12 14.9814C12.9198 14.9814 13.76 14.6213 14.4199 14.0615H16.9199V12.5615H13.8398C13.4198 13.1412 12.7598 13.5215 12 13.5215C11.2402 13.5215 10.5802 13.1413 10.1602 12.5615H7.08008V14.0615Z"}),r.jsx("path",{d:"M16.4912 10.4764L21.2367 4.69855H17.6224L19.2778 1.08008H17.7604L13.0149 6.85796H16.6292L14.9738 10.4764H16.4912Z"})]}));exports.CarChargingFilledIcon=H;
|
|
2
|
+
//# sourceMappingURL=CarChargingFilledIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CarChargingFilledIcon.js","sources":["../../../../../../src/components/icon/filled/CarChargingFilledIcon.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { SvgIcon, SvgIconProps } from '@mui/material';\n\n/**\n * Flow brand exclusive icon\n */\nexport const CarChargingFilledIcon: React.FC<SvgIconProps> = forwardRef((props, ref) => {\n return (\n <SvgIcon viewBox=\"2 2 20 20\" ref={ref} {...props}>\n <path d=\"M10.7998 5.40039C10.7999 9.04523 13.7546 12.0008 17.3994 12.001C18.3073 12.001 19.1727 11.817 19.96 11.4854V17.1016C19.9596 18.2011 19.0801 19.1013 17.9805 19.1016C17.1205 19.1016 16.2406 18.5808 16.0205 17.501H7.98047C7.76043 18.5806 6.88031 19.1014 6.02051 19.1016C4.92072 19.1016 4.04038 18.2013 4.04004 17.1016V11.2607L4.52051 10.2812H3.08008V8.68164H5.28027L6.95996 5.20117H10.8047C10.8027 5.26728 10.7998 5.33381 10.7998 5.40039ZM7.08008 14.0615H9.58008C10.24 14.6214 11.0802 14.9814 12 14.9814C12.9198 14.9814 13.76 14.6213 14.4199 14.0615H16.9199V12.5615H13.8398C13.4198 13.1412 12.7598 13.5215 12 13.5215C11.2402 13.5215 10.5802 13.1413 10.1602 12.5615H7.08008V14.0615Z\" />\n <path d=\"M16.4912 10.4764L21.2367 4.69855H17.6224L19.2778 1.08008H17.7604L13.0149 6.85796H16.6292L14.9738 10.4764H16.4912Z\" />\n </SvgIcon>\n );\n});\n"],"names":["CarChargingFilledIcon","forwardRef","props","ref","_jsxs","SvgIcon","viewBox","children","_jsx","d"],"mappings":"8FAMO,MAAMA,EAAgDC,EAAAA,WAAW,CAACC,EAAOC,IAE5EC,EAAAA,KAACC,UAAO,CAACC,QAAQ,YAAYH,IAAKA,KAASD,EAAKK,SAAA,CAC9CC,EAAAA,IAAA,OAAA,CAAMC,EAAE,2qBACRD,EAAAA,IAAA,OAAA,CAAMC,EAAE"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),r=require("react"),i=require("@mui/material");const L=r.forwardRef((r,L)=>e.jsx(i.SvgIcon,{viewBox:"2 2 20 20",ref:L,...r,children:e.jsx("path",{d:"M20.5986 15.7471L21 16.2266L20.5986 16.7061L16.8506 21.1992L16.627 21.4678H3V12.4805H17.873L20.5986 15.7471ZM12.3564 2.27344L16.1045 6.82422L16.502 7.30566L13.3887 10.9854H16.627L16.6289 10.9883H3V2H12.1318L12.3564 2.27344Z"})}));exports.EmissionLabelFilledIcon=L;
|
|
2
|
+
//# sourceMappingURL=EmissionLabelFilledIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmissionLabelFilledIcon.js","sources":["../../../../../../src/components/icon/filled/EmissionLabelFilledIcon.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { SvgIcon, SvgIconProps } from '@mui/material';\n\n/**\n * Flow brand exclusive icon\n */\nexport const EmissionLabelFilledIcon: React.FC<SvgIconProps> = forwardRef((props, ref) => {\n return (\n <SvgIcon viewBox=\"2 2 20 20\" ref={ref} {...props}>\n <path d=\"M20.5986 15.7471L21 16.2266L20.5986 16.7061L16.8506 21.1992L16.627 21.4678H3V12.4805H17.873L20.5986 15.7471ZM12.3564 2.27344L16.1045 6.82422L16.502 7.30566L13.3887 10.9854H16.627L16.6289 10.9883H3V2H12.1318L12.3564 2.27344Z\" />\n </SvgIcon>\n );\n});\n"],"names":["EmissionLabelFilledIcon","forwardRef","props","ref","_jsx","SvgIcon","viewBox","d"],"mappings":"8FAMO,MAAMA,EAAkDC,EAAAA,WAAW,CAACC,EAAOC,IAE9EC,EAAAA,IAACC,EAAAA,QAAO,CAACC,QAAQ,YAAYH,IAAKA,KAASD,WACzCE,EAAAA,IAAA,OAAA,CAAMG,EAAE"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var r=require("react/jsx-runtime"),e=require("react"),i=require("@mui/material");const t=e.forwardRef((e,t)=>r.jsx(i.SvgIcon,{viewBox:"2 2 20 20",ref:t,...e,children:r.jsx("path",{d:"M22.0459 3.03418L2.9707 22.1094L1.69727 20.8369L4.12012 18.4141V4.0791H18.4551L20.7725 1.76172L22.0459 3.03418ZM19.8799 19.8389H7.78711L9.42676 18.1992H18.2402V9.38574L19.8799 7.74609V19.8389ZM5.75977 16.7744L16.8154 5.71875H5.75977V16.7744ZM17.7803 16.4395H11.1865L14.6338 12.9912L17.7803 16.4395ZM9.28027 7.81934C10.0201 7.81942 10.6599 8.43894 10.6602 9.17871C10.6602 9.91866 10.0202 10.539 9.28027 10.5391C8.54027 10.5391 7.90039 9.91871 7.90039 9.17871C7.90062 8.43888 8.5404 7.81934 9.28027 7.81934Z"})}));exports.PictureErrorFilledIcon=t;
|
|
2
|
+
//# sourceMappingURL=PictureErrorFilledIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PictureErrorFilledIcon.js","sources":["../../../../../../src/components/icon/filled/PictureErrorFilledIcon.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { SvgIcon, SvgIconProps } from '@mui/material';\n\n/**\n * Flow brand exclusive icon\n */\nexport const PictureErrorFilledIcon: React.FC<SvgIconProps> = forwardRef((props, ref) => {\n return (\n <SvgIcon viewBox=\"2 2 20 20\" ref={ref} {...props}>\n <path d=\"M22.0459 3.03418L2.9707 22.1094L1.69727 20.8369L4.12012 18.4141V4.0791H18.4551L20.7725 1.76172L22.0459 3.03418ZM19.8799 19.8389H7.78711L9.42676 18.1992H18.2402V9.38574L19.8799 7.74609V19.8389ZM5.75977 16.7744L16.8154 5.71875H5.75977V16.7744ZM17.7803 16.4395H11.1865L14.6338 12.9912L17.7803 16.4395ZM9.28027 7.81934C10.0201 7.81942 10.6599 8.43894 10.6602 9.17871C10.6602 9.91866 10.0202 10.539 9.28027 10.5391C8.54027 10.5391 7.90039 9.91871 7.90039 9.17871C7.90062 8.43888 8.5404 7.81934 9.28027 7.81934Z\" />\n </SvgIcon>\n );\n});\n"],"names":["PictureErrorFilledIcon","forwardRef","props","ref","_jsx","SvgIcon","viewBox","d"],"mappings":"8FAMO,MAAMA,EAAiDC,EAAAA,WAAW,CAACC,EAAOC,IAE7EC,EAAAA,IAACC,EAAAA,QAAO,CAACC,QAAQ,YAAYH,IAAKA,KAASD,WACzCE,EAAAA,IAAA,OAAA,CAAMG,EAAE"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),r=require("react"),i=require("@mui/material");const s=r.forwardRef((r,s)=>e.jsx(i.SvgIcon,{viewBox:"2 2 20 20",ref:s,...r,children:e.jsx("path",{d:"M11.6046 6.75L17.25 12.3449L11.6035 17.9914H6.75L12.0906 12.6507L12.3992 12.3421L12.0893 12.0349L6.7567 6.75H11.6046Z"})}));exports.PowerpassFilledIcon=s;
|
|
2
|
+
//# sourceMappingURL=PowerpassFilledIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PowerpassFilledIcon.js","sources":["../../../../../../src/components/icon/filled/PowerpassFilledIcon.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { SvgIcon, SvgIconProps } from '@mui/material';\n\n/**\n * Flow brand exclusive icon\n */\nexport const PowerpassFilledIcon: React.FC<SvgIconProps> = forwardRef((props, ref) => {\n return (\n <SvgIcon viewBox=\"2 2 20 20\" ref={ref} {...props}>\n <path d=\"M11.6046 6.75L17.25 12.3449L11.6035 17.9914H6.75L12.0906 12.6507L12.3992 12.3421L12.0893 12.0349L6.7567 6.75H11.6046Z\" />\n </SvgIcon>\n );\n});\n"],"names":["PowerpassFilledIcon","forwardRef","props","ref","_jsx","SvgIcon","viewBox","d"],"mappings":"8FAMO,MAAMA,EAA8CC,EAAAA,WAAW,CAACC,EAAOC,IAE1EC,EAAAA,IAACC,EAAAA,QAAO,CAACC,QAAQ,YAAYH,IAAKA,KAASD,WACzCE,EAAAA,IAAA,OAAA,CAAMG,EAAE"}
|
|
@@ -82,6 +82,7 @@ export * from './CameraFilledIcon';
|
|
|
82
82
|
export * from './CampingFilledIcon';
|
|
83
83
|
export * from './CarAccidentFilledIcon';
|
|
84
84
|
export * from './CarBackFilledIcon';
|
|
85
|
+
export * from './CarChargingFilledIcon';
|
|
85
86
|
export * from './CarComparisonFilledIcon';
|
|
86
87
|
export * from './CarHandFilledIcon';
|
|
87
88
|
export * from './CarInfoFilledIcon';
|
|
@@ -159,6 +160,7 @@ export * from './DraghandleFilledIcon';
|
|
|
159
160
|
export * from './EditFilledIcon';
|
|
160
161
|
export * from './ElectricChargerFilledIcon';
|
|
161
162
|
export * from './ElectricChargerOffFilledIcon';
|
|
163
|
+
export * from './EmissionLabelFilledIcon';
|
|
162
164
|
export * from './EmptystateFilledIcon';
|
|
163
165
|
export * from './EngineFilledIcon';
|
|
164
166
|
export * from './EngineOilFilledIcon';
|
|
@@ -242,6 +244,7 @@ export * from './PasteFilledIcon';
|
|
|
242
244
|
export * from './PercentageFilledIcon';
|
|
243
245
|
export * from './PetFilledIcon';
|
|
244
246
|
export * from './PhoneFilledIcon';
|
|
247
|
+
export * from './PictureErrorFilledIcon';
|
|
245
248
|
export * from './PictureFilledIcon';
|
|
246
249
|
export * from './PiggybankFilledIcon';
|
|
247
250
|
export * from './PlugCCSType1FilledIcon';
|
|
@@ -251,6 +254,7 @@ export * from './PlugType1FilledIcon';
|
|
|
251
254
|
export * from './PlugType2FilledIcon';
|
|
252
255
|
export * from './PlugFilledIcon';
|
|
253
256
|
export * from './PlusFilledIcon';
|
|
257
|
+
export * from './PowerpassFilledIcon';
|
|
254
258
|
export * from './PremiumLFilledIcon';
|
|
255
259
|
export * from './PremiumMFilledIcon';
|
|
256
260
|
export * from './PremiumSFilledIcon';
|