@skodaflow/web-library 8.0.0 → 8.0.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/README.md +2 -2
- package/cjs/components/advancedTable/agGrid.js +1 -1
- package/cjs/components/advancedTable/agGrid.js.map +1 -1
- package/cjs/components/advancedTable/index.d.ts +1 -0
- package/cjs/components/carousel/Carousel.js +1 -1
- package/cjs/components/carousel/Carousel.js.map +1 -1
- package/cjs/components/carousel/Navigation.js +1 -1
- package/cjs/components/carousel/Navigation.js.map +1 -1
- package/cjs/components/carousel/Pagination.js +1 -1
- package/cjs/components/carousel/Pagination.js.map +1 -1
- package/cjs/components/carousel/Slide.js +1 -1
- package/cjs/components/carousel/Slide.js.map +1 -1
- package/cjs/components/playPauseButton/PlayPauseButton.d.ts +0 -2
- package/cjs/components/playPauseButton/PlayPauseButton.js.map +1 -1
- package/cjs/components/quickLink/QuickLink.js +1 -1
- package/cjs/components/quickLink/QuickLink.js.map +1 -1
- package/cjs/index.js +1 -1
- package/cjs/materialui/avatar/avatar.theme.js +1 -1
- package/cjs/materialui/avatar/avatar.theme.js.map +1 -1
- package/cjs/materialui/chip/chip.theme.js +1 -1
- package/cjs/materialui/chip/chip.theme.js.map +1 -1
- package/cjs/materialui/datepicker/PickersActionBar.js +1 -1
- package/cjs/materialui/datepicker/PickersActionBar.js.map +1 -1
- package/cjs/materialui/datepicker/PickersCalendarHeader.js +1 -1
- package/cjs/materialui/datepicker/PickersCalendarHeader.js.map +1 -1
- package/cjs/materialui/datepicker/datecalendar.theme.js.map +1 -1
- package/cjs/materialui/datepicker/datepicker.theme.d.ts +1 -0
- package/cjs/materialui/datepicker/datepicker.theme.js +1 -1
- package/cjs/materialui/datepicker/datepicker.theme.js.map +1 -1
- package/cjs/materialui/datepicker/datetimepicker.theme.d.ts +1 -0
- package/cjs/materialui/datepicker/datetimepicker.theme.js +1 -1
- package/cjs/materialui/datepicker/datetimepicker.theme.js.map +1 -1
- package/cjs/materialui/datepicker/daycalendar.theme.js +1 -1
- package/cjs/materialui/datepicker/daycalendar.theme.js.map +1 -1
- package/cjs/materialui/datepicker/index.d.ts +2 -2
- package/cjs/materialui/datepicker/pickerslayout.theme.d.ts +3 -0
- package/cjs/materialui/datepicker/pickerslayout.theme.js +2 -0
- package/cjs/materialui/datepicker/pickerslayout.theme.js.map +1 -0
- package/cjs/materialui/datepicker/timepicker.theme.d.ts +1 -0
- package/cjs/materialui/datepicker/timepicker.theme.js +1 -1
- package/cjs/materialui/datepicker/timepicker.theme.js.map +1 -1
- package/cjs/materialui/dialog/DialogTitle.d.ts +1 -1
- package/cjs/materialui/dialog/DialogTitle.js +1 -1
- package/cjs/materialui/dialog/DialogTitle.js.map +1 -1
- package/cjs/materialui/dialog/dialogTitle.theme.js +1 -1
- package/cjs/materialui/dialog/dialogTitle.theme.js.map +1 -1
- package/cjs/materialui/slider/slider.theme.js +1 -1
- package/cjs/materialui/slider/slider.theme.js.map +1 -1
- package/cjs/materialui/tabs/TabsScrollButton.js +1 -1
- package/cjs/materialui/tabs/TabsScrollButton.js.map +1 -1
- package/cjs/materialui/textfield/FormHelperText.js +1 -1
- package/cjs/materialui/textfield/FormHelperText.js.map +1 -1
- package/cjs/materialui/theme/theme.extensions.d.ts +10 -1
- package/cjs/materialui/theme/theme.js +1 -1
- package/cjs/materialui/theme/theme.js.map +1 -1
- package/cjs/materialui/theme/theme.zIndex.d.ts +1 -0
- package/cjs/materialui/theme/theme.zIndex.js +1 -1
- package/cjs/materialui/theme/theme.zIndex.js.map +1 -1
- package/cjs/utils/rgbaToRgb/index.d.ts +1 -0
- package/cjs/utils/rgbaToRgb/rgbaToRgb.d.ts +6 -0
- package/components/advancedTable/agGrid.js +1 -1
- package/components/advancedTable/agGrid.js.map +1 -1
- package/components/advancedTable/index.d.ts +1 -0
- package/components/carousel/Carousel.js +1 -1
- package/components/carousel/Carousel.js.map +1 -1
- package/components/carousel/Navigation.js +1 -1
- package/components/carousel/Navigation.js.map +1 -1
- package/components/carousel/Pagination.js +1 -1
- package/components/carousel/Pagination.js.map +1 -1
- package/components/carousel/Slide.js +1 -1
- package/components/carousel/Slide.js.map +1 -1
- package/components/playPauseButton/PlayPauseButton.d.ts +0 -2
- package/components/playPauseButton/PlayPauseButton.js.map +1 -1
- package/components/quickLink/QuickLink.js +1 -1
- package/components/quickLink/QuickLink.js.map +1 -1
- package/index.js +1 -1
- package/materialui/avatar/avatar.theme.js +1 -1
- package/materialui/avatar/avatar.theme.js.map +1 -1
- package/materialui/chip/chip.theme.js +1 -1
- package/materialui/chip/chip.theme.js.map +1 -1
- package/materialui/datepicker/PickersActionBar.js +1 -1
- package/materialui/datepicker/PickersActionBar.js.map +1 -1
- package/materialui/datepicker/PickersCalendarHeader.js +1 -1
- package/materialui/datepicker/PickersCalendarHeader.js.map +1 -1
- package/materialui/datepicker/datecalendar.theme.js.map +1 -1
- package/materialui/datepicker/datepicker.theme.d.ts +1 -0
- package/materialui/datepicker/datepicker.theme.js +1 -1
- package/materialui/datepicker/datepicker.theme.js.map +1 -1
- package/materialui/datepicker/datetimepicker.theme.d.ts +1 -0
- package/materialui/datepicker/datetimepicker.theme.js +1 -1
- package/materialui/datepicker/datetimepicker.theme.js.map +1 -1
- package/materialui/datepicker/daycalendar.theme.js +1 -1
- package/materialui/datepicker/daycalendar.theme.js.map +1 -1
- package/materialui/datepicker/index.d.ts +2 -2
- package/materialui/datepicker/pickerslayout.theme.d.ts +3 -0
- package/materialui/datepicker/pickerslayout.theme.js +2 -0
- package/materialui/datepicker/pickerslayout.theme.js.map +1 -0
- package/materialui/datepicker/timepicker.theme.d.ts +1 -0
- package/materialui/datepicker/timepicker.theme.js +1 -1
- package/materialui/datepicker/timepicker.theme.js.map +1 -1
- package/materialui/dialog/DialogTitle.d.ts +1 -1
- package/materialui/dialog/DialogTitle.js +1 -1
- package/materialui/dialog/DialogTitle.js.map +1 -1
- package/materialui/dialog/dialogTitle.theme.js +1 -1
- package/materialui/dialog/dialogTitle.theme.js.map +1 -1
- package/materialui/slider/slider.theme.js +1 -1
- package/materialui/slider/slider.theme.js.map +1 -1
- package/materialui/tabs/TabsScrollButton.js +1 -1
- package/materialui/tabs/TabsScrollButton.js.map +1 -1
- package/materialui/textfield/FormHelperText.js +1 -1
- package/materialui/textfield/FormHelperText.js.map +1 -1
- package/materialui/theme/theme.extensions.d.ts +10 -1
- package/materialui/theme/theme.js +1 -1
- package/materialui/theme/theme.js.map +1 -1
- package/materialui/theme/theme.zIndex.d.ts +1 -0
- package/materialui/theme/theme.zIndex.js +1 -1
- package/materialui/theme/theme.zIndex.js.map +1 -1
- package/package.json +1 -1
- package/utils/rgbaToRgb/index.d.ts +1 -0
- package/utils/rgbaToRgb/rgbaToRgb.d.ts +6 -0
- package/cjs/materialui/textfield/textfield.component.d.ts +0 -3
- package/materialui/textfield/textfield.component.d.ts +0 -3
package/README.md
CHANGED
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
|
|
8
8
|
## Documentation
|
|
9
9
|
|
|
10
|
-
Visit https://
|
|
10
|
+
Visit https://flow-library.skoda-auto.com/ to view the full documentation in the storybook.
|
|
11
11
|
|
|
12
12
|
## Resources
|
|
13
13
|
|
|
14
|
-
- [Storybook](https://
|
|
14
|
+
- [Storybook](https://flow-library.skoda-auto.com/)
|
|
15
15
|
- [Flow Design System](https://skoda-brand.com/hub/26)
|
|
16
16
|
- [@mui/material](https://mui.com/material-ui/getting-started/overview/)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var a=require("tslib"),e=require("react/jsx-runtime"),i=require("@mui/material"),n=require("react"),r=require("./agGridVariables.js"),o=require("./agGridSkodaTheme.js"),g=require("./agGridIcons.js");const t=a=>{const e=o.skodaAgThemeParams(a);return Object.assign(Object.assign({width:"100%",'&:not(:has([class*="ag-theme-params-"])),&.ag-theme-material':Object.assign({},r.agGridVariables(a)),".ag-row-last":{borderBottom:"none"},".ag-column-last .ag-header-cell-resize":{display:"none"},".ag-center-cols-container":{minWidth:"100%"},".ag-center-cols-viewport":{minHeight:"56px"},"& .ag-header-cell .ag-header-cell-text":{fontWeight:`${e.headerFontWeight}`},"& .ag-header-cell:not(.ag-column-last) > .ag-header-cell-resize.ag-hidden":{display:"block !important",cursor:"initial"},"& .ag-body-horizontal-scroll":{alignItems:"center",px:"22px",borderTop:"1px solid",borderTopColor:a.palette.surface.secondary,maxHeight:"none !important",height:"auto !important"},"& .ag-body-horizontal-scroll .ag-body-horizontal-scroll-viewport":{mt:"16px",mb:"23px"},"& .ag-body-horizontal-scroll.ag-invisible .ag-body-horizontal-scroll-viewport":{my:0},"& .ag-paging-panel":{justifyContent:"center",px:"24px"},"& .ag-paging-panel .ag-paging-page-size":{position:"absolute"},"& .ag-paging-panel .ag-paging-page-summary-panel":{marginLeft:"auto"},"& .ag-paging-row-summary-panel":{display:"none"},"& .ag-paging-description":{fontSize:"18px",px:"18px"},"& .ag-paging-panel .ag-paging-description span":{color:"text.primary",px:"2px"},"& .ag-paging-panel .ag-paging-description .ag-paging-number":{fontWeight:"700"},"& .ag-paging-panel .ag-paging-description span:last-child":{fontWeight:"300"},"& .ag-paging-panel .ag-icon-first, & .ag-paging-panel .ag-icon-last":{display:"none"},"& .ag-paging-panel .ag-picker-field-wrapper":{border:"none",px:"0",cursor:"pointer",minWidth:"auto"},"& .ag-paging-panel .ag-picker-field-display":{minWidth:"28px",width:"auto",pr:"6px",fontSize:"18px",fontWeight:"700",textAlign:"center"},"& .ag-paging-panel .ag-label":{mr:"6px",fontSize:"18px"},"& .ag-popup > *":{backgroundColor:"onSurface.os0",cursor:"pointer",borderRadius:"0px"},"& .skoda-ag-row-pointer .ag-row:hover":{cursor:"pointer"}},g.agGridCssIcons),{"& .ag-icon-asc, & .ag-icon-desc":{color:a.palette.onSurface.os600},"& .ag-icon-asc:hover, & .ag-icon-desc:hover":{color:a.palette.text.primary},"& .ag-header-cell-sortable .ag-sort-indicator-container:has(.ag-sort-descending-icon.ag-hidden) .ag-hidden:has(.ag-icon-asc)":{display:"inline-block !important"},"& .ag-header-cell-sortable .ag-hidden .ag-icon-asc::before":{content:'""',display:"flex",width:"17px",height:"17px",maskSize:"contain",maskRepeat:"no-repeat",maskPosition:"center",verticalAlign:"middle",maskImage:`url(data:image/svg+xml;utf8,${encodeURIComponent(g.agGridIconsDefinition.ascHover.svg)})`},"& .ag-header-cell-sortable .ag-hidden .ag-icon-asc:hover::before":{maskImage:`url(data:image/svg+xml;utf8,${encodeURIComponent(g.agGridIconsDefinition.asc.svg)})`},fontFamily:e.fontFamily})},s=n.forwardRef((n,r)=>{var{sx:o,children:g}=n,s=a.__rest(n,["sx","children"]);return e.jsx(i.Box,Object.assign({sx:a=>Object.assign(Object.assign({},t(a)),o),ref:r},s,{children:g}))});exports.SkodaAgGridProvider=s,exports.agGridStyles=t;
|
|
1
|
+
"use strict";var a=require("tslib"),e=require("react/jsx-runtime"),i=require("@mui/material"),n=require("react"),r=require("./agGridVariables.js"),o=require("./agGridSkodaTheme.js"),g=require("./agGridIcons.js");const t=a=>{const e=o.skodaAgThemeParams(a);return Object.assign(Object.assign({width:"100%","*":{maxWidth:"none"},'&:not(:has([class*="ag-theme-params-"])),&.ag-theme-material':Object.assign({},r.agGridVariables(a)),".ag-row-last":{borderBottom:"none"},".ag-column-last .ag-header-cell-resize":{display:"none"},".ag-center-cols-container":{minWidth:"100%"},".ag-center-cols-viewport":{minHeight:"56px"},"& .ag-header-cell .ag-header-cell-text":{fontWeight:`${e.headerFontWeight}`},"& .ag-header-cell:not(.ag-column-last) > .ag-header-cell-resize.ag-hidden":{display:"block !important",cursor:"initial"},"& .ag-body-horizontal-scroll":{alignItems:"center",px:"22px",borderTop:"1px solid",borderTopColor:a.palette.surface.secondary,maxHeight:"none !important",height:"auto !important"},"& .ag-body-horizontal-scroll .ag-body-horizontal-scroll-viewport":{mt:"16px",mb:"23px"},"& .ag-body-horizontal-scroll.ag-invisible .ag-body-horizontal-scroll-viewport":{my:0},"& .ag-paging-panel":{justifyContent:"center",px:"24px"},"& .ag-paging-panel .ag-paging-page-size":{position:"absolute"},"& .ag-paging-panel .ag-paging-page-summary-panel":{marginLeft:"auto"},"& .ag-paging-row-summary-panel":{display:"none"},"& .ag-paging-description":{fontSize:"18px",px:"18px"},"& .ag-paging-panel .ag-paging-description span":{color:"text.primary",px:"2px"},"& .ag-paging-panel .ag-paging-description .ag-paging-number":{fontWeight:"700"},"& .ag-paging-panel .ag-paging-description span:last-child":{fontWeight:"300"},"& .ag-paging-panel .ag-icon-first, & .ag-paging-panel .ag-icon-last":{display:"none"},"& .ag-paging-panel .ag-picker-field-wrapper":{border:"none",px:"0",cursor:"pointer",minWidth:"auto"},"& .ag-paging-panel .ag-picker-field-display":{minWidth:"28px",width:"auto",pr:"6px",fontSize:"18px",fontWeight:"700",textAlign:"center"},"& .ag-paging-panel .ag-label":{mr:"6px",fontSize:"18px"},"& .ag-popup > *":{backgroundColor:"onSurface.os0",cursor:"pointer",borderRadius:"0px"},"& .skoda-ag-row-pointer .ag-row:hover":{cursor:"pointer"}},g.agGridCssIcons),{"& .ag-icon-asc, & .ag-icon-desc":{color:a.palette.onSurface.os600},"& .ag-icon-asc:hover, & .ag-icon-desc:hover":{color:a.palette.text.primary},"& .ag-header-cell-sortable .ag-sort-indicator-container:has(.ag-sort-descending-icon.ag-hidden) .ag-hidden:has(.ag-icon-asc)":{display:"inline-block !important"},"& .ag-header-cell-sortable .ag-hidden .ag-icon-asc::before":{content:'""',display:"flex",width:"17px",height:"17px",maskSize:"contain",maskRepeat:"no-repeat",maskPosition:"center",verticalAlign:"middle",maskImage:`url(data:image/svg+xml;utf8,${encodeURIComponent(g.agGridIconsDefinition.ascHover.svg)})`},"& .ag-header-cell-sortable .ag-hidden .ag-icon-asc:hover::before":{maskImage:`url(data:image/svg+xml;utf8,${encodeURIComponent(g.agGridIconsDefinition.asc.svg)})`},fontFamily:e.fontFamily})},s=n.forwardRef((n,r)=>{var{sx:o,children:g}=n,s=a.__rest(n,["sx","children"]);return e.jsx(i.Box,Object.assign({sx:a=>Object.assign(Object.assign({},t(a)),o),ref:r},s,{children:g}))});exports.SkodaAgGridProvider=s,exports.agGridStyles=t;
|
|
2
2
|
//# sourceMappingURL=agGrid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agGrid.js","sources":["../../../../../src/components/advancedTable/agGrid.tsx"],"sourcesContent":["import { Box, BoxProps, CSSObject, Theme } from '@mui/material';\nimport React, { forwardRef } from 'react';\nimport { agGridVariables } from './agGridVariables';\nimport { skodaAgThemeParams } from './agGridSkodaTheme';\nimport { agGridCssIcons, agGridIconsDefinition } from './agGridIcons';\n\nexport const agGridStyles = (theme: Theme): CSSObject => {\n const agTheme = skodaAgThemeParams(theme);\n\n return {\n width: '100%',\n // Apply CSS variables only for non-themed tables of the old versions of ag grid (old versions of ag-grid, <v33, themes does not have ag-theme-params-* class)\n '&:not(:has([class*=\"ag-theme-params-\"])),&.ag-theme-material': {\n ...agGridVariables(theme),\n },\n\n '.ag-row-last': { borderBottom: 'none' },\n '.ag-column-last .ag-header-cell-resize': { display: 'none' },\n\n // Row lines full width\n '.ag-center-cols-container': {\n minWidth: '100%',\n },\n\n '.ag-center-cols-viewport': {\n // reduce to 1 row from default 150px\n minHeight: '56px',\n },\n\n // # Header styles\n '& .ag-header-cell .ag-header-cell-text': {\n fontWeight: `${agTheme.headerFontWeight}`,\n },\n\n // # Header Separators (only when column resizing is not activated and not for the last column)\n '& .ag-header-cell:not(.ag-column-last) > .ag-header-cell-resize.ag-hidden': {\n display: 'block !important',\n cursor: 'initial',\n },\n\n // # Horizontal Scrollbar\n '& .ag-body-horizontal-scroll': {\n alignItems: 'center',\n px: '22px',\n borderTop: '1px solid',\n borderTopColor: theme.palette.surface.secondary,\n maxHeight: 'none !important',\n height: 'auto !important',\n },\n '& .ag-body-horizontal-scroll .ag-body-horizontal-scroll-viewport': {\n mt: '16px',\n mb: '23px',\n },\n '& .ag-body-horizontal-scroll.ag-invisible .ag-body-horizontal-scroll-viewport': {\n my: 0,\n },\n\n // # Pagination styles\n '& .ag-paging-panel': {\n justifyContent: 'center',\n px: '24px',\n },\n\n // Pagination layout - rows per page centered, arrows right-aligned\n '& .ag-paging-panel .ag-paging-page-size': {\n position: 'absolute',\n },\n '& .ag-paging-panel .ag-paging-page-summary-panel': {\n marginLeft: 'auto',\n },\n\n // Disable pagination summary\n '& .ag-paging-row-summary-panel': {\n display: 'none',\n },\n\n // Text styling within pagination arrows\n '& .ag-paging-description': {\n fontSize: '18px',\n px: '18px',\n },\n '& .ag-paging-panel .ag-paging-description span': {\n color: 'text.primary',\n px: '2px',\n },\n '& .ag-paging-panel .ag-paging-description .ag-paging-number': {\n fontWeight: '700',\n },\n '& .ag-paging-panel .ag-paging-description span:last-child': {\n fontWeight: '300',\n },\n\n // Disable AG-grid pagination icons - start, end\n '& .ag-paging-panel .ag-icon-first, & .ag-paging-panel .ag-icon-last': {\n display: 'none',\n },\n\n // Pagination - rows per page\n '& .ag-paging-panel .ag-picker-field-wrapper': {\n border: 'none',\n px: '0',\n cursor: 'pointer',\n minWidth: 'auto',\n },\n '& .ag-paging-panel .ag-picker-field-display': {\n minWidth: '28px',\n width: 'auto',\n pr: '6px',\n fontSize: '18px',\n fontWeight: '700',\n textAlign: 'center',\n },\n '& .ag-paging-panel .ag-label': {\n mr: '6px',\n fontSize: '18px',\n },\n\n '& .ag-popup > *': {\n backgroundColor: 'onSurface.os0',\n cursor: 'pointer',\n borderRadius: '0px',\n },\n\n // # Opt-in className=\"skoda-ag-pointer\"\n '& .skoda-ag-row-pointer .ag-row:hover': {\n cursor: 'pointer',\n },\n\n // Additional icons\n ...agGridCssIcons,\n\n // Show icons according to the SkodaFlow design\n '& .ag-icon-asc, & .ag-icon-desc': {\n color: theme.palette.onSurface.os600,\n },\n '& .ag-icon-asc:hover, & .ag-icon-desc:hover': {\n color: theme.palette.text.primary,\n },\n '& .ag-header-cell-sortable .ag-sort-indicator-container:has(.ag-sort-descending-icon.ag-hidden) .ag-hidden:has(.ag-icon-asc)':\n {\n display: 'inline-block !important', // Ag grid also uses !important so we have to override it\n },\n\n '& .ag-header-cell-sortable .ag-hidden .ag-icon-asc::before': {\n content: '\"\"',\n display: 'flex',\n width: '17px',\n height: '17px',\n maskSize: 'contain',\n maskRepeat: 'no-repeat',\n maskPosition: 'center',\n verticalAlign: 'middle',\n maskImage: `url(data:image/svg+xml;utf8,${encodeURIComponent(agGridIconsDefinition.ascHover.svg)})`,\n },\n '& .ag-header-cell-sortable .ag-hidden .ag-icon-asc:hover::before': {\n maskImage: `url(data:image/svg+xml;utf8,${encodeURIComponent(agGridIconsDefinition.asc.svg)})`,\n },\n\n // Legacy class approach, no theme\n fontFamily: agTheme.fontFamily,\n };\n};\n\ninterface SkodaAgGridProviderProps extends BoxProps {}\n\n/**\n * A provider wrapper that applies Skoda AG Grid theming via sx.\n */\nexport const SkodaAgGridProvider: React.FC<SkodaAgGridProviderProps> = forwardRef(({ sx, children, ...rest }, ref) => {\n return (\n <Box\n sx={(theme) => ({\n ...agGridStyles(theme),\n ...sx,\n })}\n ref={ref}\n {...rest}\n >\n {children}\n </Box>\n );\n});\n"],"names":["agGridStyles","theme","agTheme","skodaAgThemeParams","Object","assign","width","agGridVariables","borderBottom","display","minWidth","minHeight","fontWeight","headerFontWeight","cursor","alignItems","px","borderTop","borderTopColor","palette","surface","secondary","maxHeight","height","mt","mb","my","justifyContent","position","marginLeft","fontSize","color","border","pr","textAlign","mr","backgroundColor","borderRadius","agGridCssIcons","onSurface","os600","text","primary","content","maskSize","maskRepeat","maskPosition","verticalAlign","maskImage","encodeURIComponent","agGridIconsDefinition","ascHover","svg","asc","fontFamily","SkodaAgGridProvider","forwardRef","_a","ref","sx","children","rest","__rest","_jsx","Box"],"mappings":"oNAMO,MAAMA,EAAgBC,IAC3B,MAAMC,EAAUC,EAAAA,mBAAmBF,GAEnC,OAAAG,OAAAC,OAAAD,OAAAC,OAAA,CACEC,MAAO,OAEP,+
|
|
1
|
+
{"version":3,"file":"agGrid.js","sources":["../../../../../src/components/advancedTable/agGrid.tsx"],"sourcesContent":["import { Box, BoxProps, CSSObject, Theme } from '@mui/material';\nimport React, { forwardRef } from 'react';\nimport { agGridVariables } from './agGridVariables';\nimport { skodaAgThemeParams } from './agGridSkodaTheme';\nimport { agGridCssIcons, agGridIconsDefinition } from './agGridIcons';\n\nexport const agGridStyles = (theme: Theme): CSSObject => {\n const agTheme = skodaAgThemeParams(theme);\n\n return {\n width: '100%',\n // support applying global style on all elements maxWidth: '100%'\n '*': {\n maxWidth: 'none',\n },\n // Apply CSS variables only for non-themed tables of the old versions of ag grid (old versions of ag-grid, <v33, themes does not have ag-theme-params-* class)\n '&:not(:has([class*=\"ag-theme-params-\"])),&.ag-theme-material': {\n ...agGridVariables(theme),\n },\n\n '.ag-row-last': { borderBottom: 'none' },\n '.ag-column-last .ag-header-cell-resize': { display: 'none' },\n\n // Row lines full width\n '.ag-center-cols-container': {\n minWidth: '100%',\n },\n\n '.ag-center-cols-viewport': {\n // reduce to 1 row from default 150px\n minHeight: '56px',\n },\n\n // # Header styles\n '& .ag-header-cell .ag-header-cell-text': {\n fontWeight: `${agTheme.headerFontWeight}`,\n },\n\n // # Header Separators (only when column resizing is not activated and not for the last column)\n '& .ag-header-cell:not(.ag-column-last) > .ag-header-cell-resize.ag-hidden': {\n display: 'block !important',\n cursor: 'initial',\n },\n\n // # Horizontal Scrollbar\n '& .ag-body-horizontal-scroll': {\n alignItems: 'center',\n px: '22px',\n borderTop: '1px solid',\n borderTopColor: theme.palette.surface.secondary,\n maxHeight: 'none !important',\n height: 'auto !important',\n },\n '& .ag-body-horizontal-scroll .ag-body-horizontal-scroll-viewport': {\n mt: '16px',\n mb: '23px',\n },\n '& .ag-body-horizontal-scroll.ag-invisible .ag-body-horizontal-scroll-viewport': {\n my: 0,\n },\n\n // # Pagination styles\n '& .ag-paging-panel': {\n justifyContent: 'center',\n px: '24px',\n },\n\n // Pagination layout - rows per page centered, arrows right-aligned\n '& .ag-paging-panel .ag-paging-page-size': {\n position: 'absolute',\n },\n '& .ag-paging-panel .ag-paging-page-summary-panel': {\n marginLeft: 'auto',\n },\n\n // Disable pagination summary\n '& .ag-paging-row-summary-panel': {\n display: 'none',\n },\n\n // Text styling within pagination arrows\n '& .ag-paging-description': {\n fontSize: '18px',\n px: '18px',\n },\n '& .ag-paging-panel .ag-paging-description span': {\n color: 'text.primary',\n px: '2px',\n },\n '& .ag-paging-panel .ag-paging-description .ag-paging-number': {\n fontWeight: '700',\n },\n '& .ag-paging-panel .ag-paging-description span:last-child': {\n fontWeight: '300',\n },\n\n // Disable AG-grid pagination icons - start, end\n '& .ag-paging-panel .ag-icon-first, & .ag-paging-panel .ag-icon-last': {\n display: 'none',\n },\n\n // Pagination - rows per page\n '& .ag-paging-panel .ag-picker-field-wrapper': {\n border: 'none',\n px: '0',\n cursor: 'pointer',\n minWidth: 'auto',\n },\n '& .ag-paging-panel .ag-picker-field-display': {\n minWidth: '28px',\n width: 'auto',\n pr: '6px',\n fontSize: '18px',\n fontWeight: '700',\n textAlign: 'center',\n },\n '& .ag-paging-panel .ag-label': {\n mr: '6px',\n fontSize: '18px',\n },\n\n '& .ag-popup > *': {\n backgroundColor: 'onSurface.os0',\n cursor: 'pointer',\n borderRadius: '0px',\n },\n\n // # Opt-in className=\"skoda-ag-pointer\"\n '& .skoda-ag-row-pointer .ag-row:hover': {\n cursor: 'pointer',\n },\n\n // Additional icons\n ...agGridCssIcons,\n\n // Show icons according to the SkodaFlow design\n '& .ag-icon-asc, & .ag-icon-desc': {\n color: theme.palette.onSurface.os600,\n },\n '& .ag-icon-asc:hover, & .ag-icon-desc:hover': {\n color: theme.palette.text.primary,\n },\n '& .ag-header-cell-sortable .ag-sort-indicator-container:has(.ag-sort-descending-icon.ag-hidden) .ag-hidden:has(.ag-icon-asc)':\n {\n display: 'inline-block !important', // Ag grid also uses !important so we have to override it\n },\n\n '& .ag-header-cell-sortable .ag-hidden .ag-icon-asc::before': {\n content: '\"\"',\n display: 'flex',\n width: '17px',\n height: '17px',\n maskSize: 'contain',\n maskRepeat: 'no-repeat',\n maskPosition: 'center',\n verticalAlign: 'middle',\n maskImage: `url(data:image/svg+xml;utf8,${encodeURIComponent(agGridIconsDefinition.ascHover.svg)})`,\n },\n '& .ag-header-cell-sortable .ag-hidden .ag-icon-asc:hover::before': {\n maskImage: `url(data:image/svg+xml;utf8,${encodeURIComponent(agGridIconsDefinition.asc.svg)})`,\n },\n\n // Legacy class approach, no theme\n fontFamily: agTheme.fontFamily,\n };\n};\n\ninterface SkodaAgGridProviderProps extends BoxProps {}\n\n/**\n * A provider wrapper that applies Skoda AG Grid theming via sx.\n */\nexport const SkodaAgGridProvider: React.FC<SkodaAgGridProviderProps> = forwardRef(({ sx, children, ...rest }, ref) => {\n return (\n <Box\n sx={(theme) => ({\n ...agGridStyles(theme),\n ...sx,\n })}\n ref={ref}\n {...rest}\n >\n {children}\n </Box>\n );\n});\n"],"names":["agGridStyles","theme","agTheme","skodaAgThemeParams","Object","assign","width","maxWidth","agGridVariables","borderBottom","display","minWidth","minHeight","fontWeight","headerFontWeight","cursor","alignItems","px","borderTop","borderTopColor","palette","surface","secondary","maxHeight","height","mt","mb","my","justifyContent","position","marginLeft","fontSize","color","border","pr","textAlign","mr","backgroundColor","borderRadius","agGridCssIcons","onSurface","os600","text","primary","content","maskSize","maskRepeat","maskPosition","verticalAlign","maskImage","encodeURIComponent","agGridIconsDefinition","ascHover","svg","asc","fontFamily","SkodaAgGridProvider","forwardRef","_a","ref","sx","children","rest","__rest","_jsx","Box"],"mappings":"oNAMO,MAAMA,EAAgBC,IAC3B,MAAMC,EAAUC,EAAAA,mBAAmBF,GAEnC,OAAAG,OAAAC,OAAAD,OAAAC,OAAA,CACEC,MAAO,OAEP,IAAK,CACHC,SAAU,QAGZ,+DAA8DH,OAAAC,OAAA,CAAA,EACzDG,EAAAA,gBAAgBP,IAGrB,eAAgB,CAAEQ,aAAc,QAChC,yCAA0C,CAAEC,QAAS,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C,mBAAmBC,EAAAA,sBAAsBC,SAASC,SAE9F,mEAAoE,CAClEJ,UAAW,+BAA+BC,mBAAmBC,EAAAA,sBAAsBG,IAAID,SAIzFE,WAAYrD,EAAQqD,cASXC,EAA0DC,EAAAA,WAAW,CAACC,EAA2BC,SAA3BC,GAAEA,EAAEC,SAAEA,GAAQH,EAAKI,EAAIC,EAAAA,OAAAL,EAAvB,mBACjF,OACEM,MAACC,EAAAA,IAAG7D,OAAAC,OAAA,CACFuD,GAAK3D,GAAUG,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EACVL,EAAaC,IACb2D,GAELD,IAAKA,GACDG,EAAI,CAAAD,SAEPA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("tslib"),i=require("react/jsx-runtime"),r=require("react"),t=require("@mui/material"),a=require("../../node_modules/swiper/swiper-react.js"),s=require("../../node_modules/swiper/modules/keyboard.js"),n=require("../../node_modules/swiper/modules/parallax.js"),o=require("../../node_modules/swiper/modules/autoplay.js"),p=require("../../node_modules/swiper/modules/effect-fade.js");const l=r.forwardRef((r,l)=>{var{children:d,sx:u,onInit:c,effect:w,autoplay:f,parallax:m,peekDistance:x=100,peekSpeed:h=150}=r,b=e.__rest(r,["children","sx","onInit","effect","autoplay","parallax","peekDistance","peekSpeed"]);return i.jsx(t.Box,Object.assign({component:a.Swiper,spaceBetween:0,autoHeight:!0,loop:!0,keyboard:{enabled:!0},modules:[s.default,..."fade"===w?[p.default]:[],...f?[o.default]:[],...m?[n.default]:[]],parallax:m,effect:w,autoplay:f,ref:l},b,{onSwiper:c,"data-peekspeed":h,sx:Object.assign(Object.assign(Object.assign({display:"block",ml:"auto",mr:"auto",p:"0",maxWidth:"100%",position:"relative",zIndex:
|
|
1
|
+
"use strict";var e=require("tslib"),i=require("react/jsx-runtime"),r=require("react"),t=require("@mui/material"),a=require("../../node_modules/swiper/swiper-react.js"),s=require("../../node_modules/swiper/modules/keyboard.js"),n=require("../../node_modules/swiper/modules/parallax.js"),o=require("../../node_modules/swiper/modules/autoplay.js"),p=require("../../node_modules/swiper/modules/effect-fade.js");const l=r.forwardRef((r,l)=>{var{children:d,sx:u,onInit:c,effect:w,autoplay:f,parallax:m,peekDistance:x=100,peekSpeed:h=150}=r,b=e.__rest(r,["children","sx","onInit","effect","autoplay","parallax","peekDistance","peekSpeed"]);return i.jsx(t.Box,Object.assign({component:a.Swiper,spaceBetween:0,autoHeight:!0,loop:!0,keyboard:{enabled:!0},modules:[s.default,..."fade"===w?[p.default]:[],...f?[o.default]:[],...m?[n.default]:[]],parallax:m,effect:w,autoplay:f,ref:l},b,{onSwiper:c,"data-peekspeed":h,sx:Object.assign(Object.assign(Object.assign({display:"block",ml:"auto",mr:"auto",p:"0",maxWidth:"100%",position:"relative",zIndex:e=>e.zIndex.carousel,overflow:"hidden",listStyle:"none","&.swiper-horizontal":{touchAction:"pan-y"},"&.swiper-vertical":{touchAction:"pan-x","& > .swiper-wrapper":{flexDirection:"column"}},"&.swiper-autoheight":{height:"auto","& > .swiper-wrapper":{alignItems:"flex-start",transitionProperty:"transform, height"}},"& .swiper-wrapper":{position:"relative",width:"100%",height:"100%",zIndex:e=>e.zIndex.carousel,display:"flex",transitionProperty:"transform",transitionTimingFunction:"var(--swiper-wrapper-transition-timing-function, initial)",boxSizing:"content-box",transform:"translate3d(0px, 0, 0)"}},"fade"!==w&&{"&.peeking .swiper-wrapper > .swiper-slide":{transitionProperty:"transform",transitionDuration:`${h}ms`,transitionTimingFunction:"var(--swiper-wrapper-transition-timing-function, initial)"},"&.peek-next .swiper-wrapper > .swiper-slide":{transform:e=>`translate3D(${"rtl"===e.direction?"":"-"}${x}px, 0, 0)`},"&.peek-prev .swiper-wrapper > .swiper-slide":{transform:e=>`translate3D(${"rtl"===e.direction?"-":""}${x}px, 0, 0)`}}),{".swiper-slide-invisible-blank":{visibility:"hidden"},".swiper-backface-hidden .swiper-slide":{transform:"translateZ(0)",WebkitBackfaceVisibility:"hidden",backfaceVisibility:"hidden"}}),u),children:d}))});exports.Carousel=l;
|
|
2
2
|
//# sourceMappingURL=Carousel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Carousel.js","sources":["../../../../../src/components/carousel/Carousel.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { Box, BoxProps } from '@mui/material';\nimport { Swiper, SwiperProps } from 'swiper/react';\nimport { Keyboard, EffectFade, Autoplay, Parallax } from 'swiper/modules';\n\nexport interface CarouselProps\n // `cssMode` not supported\n // instead of `navigation` use <CarouselNavigation />\n // instead of `pagination` use <CarouselPagination />\n // instead of `onSwiper` use `onInit`\n extends Omit<SwiperProps, 'children' | 'cssMode' | 'navigation' | 'pagination' | 'onSwiper'>,\n Omit<BoxProps, keyof Omit<SwiperProps, 'children'> | 'component'> {\n /**\n * Callback that receives Swiper instance\n */\n onInit?: SwiperProps['onSwiper'];\n /**\n * Travelled distance in px for peek effect\n * @default 100\n */\n peekDistance?: number;\n /**\n * Speed of peek effect\n * @default 150 (half of default Carousel's speed)\n */\n peekSpeed?: number;\n}\n\n/**\n * Modern mobile friendly carousel for slideshows, built with Swiper\n */\nexport const Carousel: React.FC<CarouselProps> = forwardRef(\n ({ children, sx, onInit, effect, autoplay, parallax, peekDistance = 100, peekSpeed = 150, ...rest }, ref) => {\n return (\n <Box\n component={Swiper}\n spaceBetween={0}\n autoHeight\n loop\n keyboard={{\n enabled: true,\n }}\n modules={[\n Keyboard,\n ...(effect === 'fade' ? [EffectFade] : []),\n ...(autoplay ? [Autoplay] : []),\n ...(parallax ? [Parallax] : []),\n ]}\n parallax={parallax}\n effect={effect}\n autoplay={autoplay}\n ref={ref}\n {...rest}\n onSwiper={onInit}\n data-peekspeed={peekSpeed}\n sx={{\n // generic root styling, based on the `import 'swiper/css'`\n display: 'block',\n ml: 'auto',\n mr: 'auto',\n p: '0',\n maxWidth: '100%',\n // ensure correct position\n position: 'relative',\n zIndex:
|
|
1
|
+
{"version":3,"file":"Carousel.js","sources":["../../../../../src/components/carousel/Carousel.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { Box, BoxProps } from '@mui/material';\nimport { Swiper, SwiperProps } from 'swiper/react';\nimport { Keyboard, EffectFade, Autoplay, Parallax } from 'swiper/modules';\n\nexport interface CarouselProps\n // `cssMode` not supported\n // instead of `navigation` use <CarouselNavigation />\n // instead of `pagination` use <CarouselPagination />\n // instead of `onSwiper` use `onInit`\n extends Omit<SwiperProps, 'children' | 'cssMode' | 'navigation' | 'pagination' | 'onSwiper'>,\n Omit<BoxProps, keyof Omit<SwiperProps, 'children'> | 'component'> {\n /**\n * Callback that receives Swiper instance\n */\n onInit?: SwiperProps['onSwiper'];\n /**\n * Travelled distance in px for peek effect\n * @default 100\n */\n peekDistance?: number;\n /**\n * Speed of peek effect\n * @default 150 (half of default Carousel's speed)\n */\n peekSpeed?: number;\n}\n\n/**\n * Modern mobile friendly carousel for slideshows, built with Swiper\n */\nexport const Carousel: React.FC<CarouselProps> = forwardRef(\n ({ children, sx, onInit, effect, autoplay, parallax, peekDistance = 100, peekSpeed = 150, ...rest }, ref) => {\n return (\n <Box\n component={Swiper}\n spaceBetween={0}\n autoHeight\n loop\n keyboard={{\n enabled: true,\n }}\n modules={[\n Keyboard,\n ...(effect === 'fade' ? [EffectFade] : []),\n ...(autoplay ? [Autoplay] : []),\n ...(parallax ? [Parallax] : []),\n ]}\n parallax={parallax}\n effect={effect}\n autoplay={autoplay}\n ref={ref}\n {...rest}\n onSwiper={onInit}\n data-peekspeed={peekSpeed}\n sx={{\n // generic root styling, based on the `import 'swiper/css'`\n display: 'block',\n ml: 'auto',\n mr: 'auto',\n p: '0',\n maxWidth: '100%',\n // ensure correct position\n position: 'relative',\n zIndex: (theme) => theme.zIndex.carousel,\n overflow: 'hidden',\n // support for ul-type\n listStyle: 'none',\n // variants\n '&.swiper-horizontal': {\n touchAction: 'pan-y',\n },\n '&.swiper-vertical': {\n touchAction: 'pan-x',\n '& > .swiper-wrapper': {\n flexDirection: 'column',\n },\n },\n '&.swiper-autoheight': {\n height: 'auto',\n '& > .swiper-wrapper': {\n alignItems: 'flex-start',\n transitionProperty: 'transform, height',\n },\n },\n // wrapper of all slides\n '& .swiper-wrapper': {\n position: 'relative',\n width: '100%',\n height: '100%',\n zIndex: (theme) => theme.zIndex.carousel,\n display: 'flex',\n transitionProperty: 'transform',\n transitionTimingFunction: 'var(--swiper-wrapper-transition-timing-function, initial)',\n boxSizing: 'content-box',\n transform: 'translate3d(0px, 0, 0)',\n },\n // peek effect\n ...(effect !== 'fade' && {\n '&.peeking .swiper-wrapper > .swiper-slide': {\n transitionProperty: 'transform',\n transitionDuration: `${peekSpeed}ms`,\n transitionTimingFunction: 'var(--swiper-wrapper-transition-timing-function, initial)',\n },\n '&.peek-next .swiper-wrapper > .swiper-slide': {\n transform: (theme) => `translate3D(${theme.direction === 'rtl' ? '' : '-'}${peekDistance}px, 0, 0)`,\n },\n '&.peek-prev .swiper-wrapper > .swiper-slide': {\n transform: (theme) => `translate3D(${theme.direction === 'rtl' ? '-' : ''}${peekDistance}px, 0, 0)`,\n },\n }),\n // swiper internal\n '.swiper-slide-invisible-blank': {\n visibility: 'hidden',\n },\n '.swiper-backface-hidden .swiper-slide': {\n transform: 'translateZ(0)',\n WebkitBackfaceVisibility: 'hidden',\n backfaceVisibility: 'hidden',\n },\n // does not include CSS Mode, 3D Shadows, lazy loading\n ...sx,\n }}\n >\n {children}\n </Box>\n );\n },\n);\n"],"names":["Carousel","forwardRef","_a","ref","children","sx","onInit","effect","autoplay","parallax","peekDistance","peekSpeed","rest","__rest","_jsx","Box","Object","assign","component","Swiper","spaceBetween","autoHeight","loop","keyboard","enabled","modules","Keyboard","EffectFade","Autoplay","Parallax","onSwiper","display","ml","mr","p","maxWidth","position","zIndex","theme","carousel","overflow","listStyle","touchAction","flexDirection","height","alignItems","transitionProperty","width","transitionTimingFunction","boxSizing","transform","transitionDuration","direction","visibility","WebkitBackfaceVisibility","backfaceVisibility"],"mappings":"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AAU,eAAmC,QAApBA,EAAMc,UAAsB,GAAK,MAAM1C,cAE9E,8CAA+C,CAC7CwC,UAAYZ,GAAU,eAAmC,QAApBA,EAAMc,UAAsB,IAAM,KAAK1C,gBAE9E,CAEF,gCAAiC,CAC/B2C,WAAY,UAEd,wCAAyC,CACvCH,UAAW,gBACXI,yBAA0B,SAC1BC,mBAAoB,YAGnBlD,GAAED,SAGNA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("tslib"),r=require("react/jsx-runtime"),s=require("react"),o=require("./hooks.js"),n=require("@mui/material"),t=require("../icon/stroke/ChevronLeftIcon.js"),i=require("../icon/stroke/ChevronRightIcon.js"),a=require("../icon/stroke/ArrowLeftIcon.js"),c=require("../icon/stroke/ArrowRightIcon.js"),l=require("../../materialui/button/interactive.js");exports.CarouselNavigation=function({carousel:u,peekEffect:d=!1,prevButtonProps:x,prevIconProps:p,PrevIconComponent:
|
|
1
|
+
"use strict";var e=require("tslib"),r=require("react/jsx-runtime"),s=require("react"),o=require("./hooks.js"),n=require("@mui/material"),t=require("../icon/stroke/ChevronLeftIcon.js"),i=require("../icon/stroke/ChevronRightIcon.js"),a=require("../icon/stroke/ArrowLeftIcon.js"),c=require("../icon/stroke/ArrowRightIcon.js"),l=require("../../materialui/button/interactive.js");exports.CarouselNavigation=function({carousel:u,peekEffect:d=!1,prevButtonProps:x,prevIconProps:p,PrevIconComponent:b,nextButtonProps:g,nextIconProps:j,NextIconComponent:v,arrows:m=!0,onBackground:I=!1,autoHideNavigation:f=!1}){var h,C,k;const O=o.useCarousel(),q=u||O,y="fade"!==(null===(h=null==q?void 0:q.params)||void 0===h?void 0:h.effect)&&d,M=n.useTheme(),P=n.useMediaQuery(M.breakpoints.up("md")),L=x||{},{sx:w}=L,B=e.__rest(L,["sx"]),E=g||{},{sx:N}=E,S=e.__rest(E,["sx"]),[A,R]=o.useCarouselPeekEffect(q),_=b||(m?a.ArrowLeftIcon:t.ChevronLeftIcon),z=v||(m?c.ArrowRightIcon:i.ChevronRightIcon),F=s.useMemo(()=>Object.assign(Object.assign({position:"absolute",zIndex:"100",top:"50%",width:{xs:"32px",md:"40px",xl:"44px"},height:{xs:"32px",md:"40px",xl:"44px"},mt:{xs:"-16px",md:"-20px",xl:"-22px"},"& .MuiSvgIcon-root":{fontSize:{xs:"17px",xl:"20px"}}},l.getInteractiveStyle({color:"text.primary",borderColor:I?"transparent.transparent":"onSurface.os100",backgroundColor:I?"transparent.transparent":"surface.primary"},{backgroundColor:"surface.secondary"})),{"&.Mui-disabled":{color:"disabled.tertiary",borderColor:I?"transparent.transparent":"disabled.secondary",backgroundColor:I?"transparent.transparent":"disabled.secondary"}}),[]);return f&&(null==q?void 0:q.isLocked)?null:r.jsxs(r.Fragment,{children:[r.jsx(n.IconButton,Object.assign({disabled:q&&!(null===(C=q.params)||void 0===C?void 0:C.loop)&&q.isBeginning,onClick:()=>{null==q||q.slidePrev(),y&&A&&R("reset")},onMouseEnter:()=>P&&y&&R("prev"),onMouseLeave:()=>y&&A&&R("reset"),sx:Object.assign(Object.assign(Object.assign({},F),{insetInlineStart:"16px"}),w),"aria-label":"Previous slide","aria-controls":"carousel",color:"surface",size:"medium"},B,{children:"rtl"===M.direction?r.jsx(z,Object.assign({},p)):r.jsx(_,Object.assign({},p))})),r.jsx(n.IconButton,Object.assign({disabled:q&&!(null===(k=q.params)||void 0===k?void 0:k.loop)&&q.isEnd,onClick:()=>{null==q||q.slideNext(),y&&A&&R("reset")},onMouseEnter:()=>P&&y&&R("next"),onMouseLeave:()=>y&&A&&R("reset"),sx:Object.assign(Object.assign(Object.assign({},F),{insetInlineEnd:"16px"}),N),"aria-label":"Next slide","aria-controls":"carousel",color:"surface"},S,{children:"rtl"===M.direction?r.jsx(_,Object.assign({},j)):r.jsx(z,Object.assign({},j))}))]})};
|
|
2
2
|
//# sourceMappingURL=Navigation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Navigation.js","sources":["../../../../../src/components/carousel/Navigation.tsx"],"sourcesContent":["import React, { useMemo, ComponentType } from 'react';\nimport { useCarousel, useCarouselPeekEffect } from './hooks';\nimport { useTheme, IconButton, IconButtonProps, SvgIconProps, useMediaQuery } from '@mui/material';\nimport type { Swiper as CarouselInstance } from 'swiper';\nimport { ChevronLeftIcon } from '@/src/components/icon/stroke/ChevronLeftIcon';\nimport { ChevronRightIcon } from '@/src/components/icon/stroke/ChevronRightIcon';\nimport { ArrowLeftIcon } from '@/src/components/icon/stroke/ArrowLeftIcon';\nimport { ArrowRightIcon } from '@/src/components/icon/stroke/ArrowRightIcon';\nimport { getInteractiveStyle } from '@/src/materialui/button/interactive';\n\nexport interface CarouselNavigationProps {\n /**\n * Optional Carousel instance from useCarouselInstance hook\n */\n carousel?: CarouselInstance;\n /**\n * Enable/disable peek effect on hover\n * @default: false\n */\n peekEffect?: boolean;\n /**\n * Previous Slide IconButton\n */\n prevButtonProps?: Partial<IconButtonProps>;\n /**\n * Previous icon props\n */\n prevIconProps?: SvgIconProps;\n /**\n * Previous icon node\n */\n PrevIconComponent?: ComponentType<SvgIconProps>;\n /**\n * Next Slide IconButton\n */\n nextButtonProps?: Partial<IconButtonProps>;\n /**\n * Previous icon props\n */\n nextIconProps?: SvgIconProps;\n /**\n * Next icon node\n */\n NextIconComponent?: ComponentType<SvgIconProps>;\n /**\n * Replaces Chevrons with Arrows\n * @default true\n */\n arrows?: boolean;\n /**\n * Enable if placing on a plain background (not on top of an image/video)\n * @default false\n */\n onBackground?: boolean;\n /**\n * Hide navigation buttons on case there are not enough slides for sliding\n * @default false\n */\n autoHideNavigation?: boolean;\n}\n\n/**\n * Left & Right navigation arrows\n */\nexport function CarouselNavigation({\n carousel: carouselProp,\n peekEffect: propPeekEffect = false,\n prevButtonProps,\n prevIconProps,\n PrevIconComponent,\n nextButtonProps,\n nextIconProps,\n NextIconComponent,\n arrows = true,\n onBackground = false,\n autoHideNavigation = false,\n}: CarouselNavigationProps) {\n const carouselHook = useCarousel();\n const carousel = carouselProp || carouselHook;\n const peekEffect = carousel?.
|
|
1
|
+
{"version":3,"file":"Navigation.js","sources":["../../../../../src/components/carousel/Navigation.tsx"],"sourcesContent":["import React, { useMemo, ComponentType } from 'react';\nimport { useCarousel, useCarouselPeekEffect } from './hooks';\nimport { useTheme, IconButton, IconButtonProps, SvgIconProps, useMediaQuery } from '@mui/material';\nimport type { Swiper as CarouselInstance } from 'swiper';\nimport { ChevronLeftIcon } from '@/src/components/icon/stroke/ChevronLeftIcon';\nimport { ChevronRightIcon } from '@/src/components/icon/stroke/ChevronRightIcon';\nimport { ArrowLeftIcon } from '@/src/components/icon/stroke/ArrowLeftIcon';\nimport { ArrowRightIcon } from '@/src/components/icon/stroke/ArrowRightIcon';\nimport { getInteractiveStyle } from '@/src/materialui/button/interactive';\n\nexport interface CarouselNavigationProps {\n /**\n * Optional Carousel instance from useCarouselInstance hook\n */\n carousel?: CarouselInstance;\n /**\n * Enable/disable peek effect on hover\n * @default: false\n */\n peekEffect?: boolean;\n /**\n * Previous Slide IconButton\n */\n prevButtonProps?: Partial<IconButtonProps>;\n /**\n * Previous icon props\n */\n prevIconProps?: SvgIconProps;\n /**\n * Previous icon node\n */\n PrevIconComponent?: ComponentType<SvgIconProps>;\n /**\n * Next Slide IconButton\n */\n nextButtonProps?: Partial<IconButtonProps>;\n /**\n * Previous icon props\n */\n nextIconProps?: SvgIconProps;\n /**\n * Next icon node\n */\n NextIconComponent?: ComponentType<SvgIconProps>;\n /**\n * Replaces Chevrons with Arrows\n * @default true\n */\n arrows?: boolean;\n /**\n * Enable if placing on a plain background (not on top of an image/video)\n * @default false\n */\n onBackground?: boolean;\n /**\n * Hide navigation buttons on case there are not enough slides for sliding\n * @default false\n */\n autoHideNavigation?: boolean;\n}\n\n/**\n * Left & Right navigation arrows\n */\nexport function CarouselNavigation({\n carousel: carouselProp,\n peekEffect: propPeekEffect = false,\n prevButtonProps,\n prevIconProps,\n PrevIconComponent,\n nextButtonProps,\n nextIconProps,\n NextIconComponent,\n arrows = true,\n onBackground = false,\n autoHideNavigation = false,\n}: CarouselNavigationProps) {\n const carouselHook = useCarousel();\n const carousel = carouselProp || carouselHook;\n const peekEffect = carousel?.params?.effect !== 'fade' && propPeekEffect;\n const theme = useTheme();\n const upMD = useMediaQuery(theme.breakpoints.up('md'));\n const { sx: prevSx, ...restPrev } = prevButtonProps || {};\n const { sx: nextSx, ...restNext } = nextButtonProps || {};\n const [peek, setPeek] = useCarouselPeekEffect(carousel);\n const PrevIcon = PrevIconComponent || (arrows ? ArrowLeftIcon : ChevronLeftIcon);\n const NextIcon = NextIconComponent || (arrows ? ArrowRightIcon : ChevronRightIcon);\n\n // shared style between buttons\n const sharedSx = useMemo(\n () => ({\n // absolute inside the carousel position\n position: 'absolute',\n zIndex: '100',\n top: '50%',\n // responsive\n width: { xs: '32px', md: '40px', xl: '44px' },\n height: { xs: '32px', md: '40px', xl: '44px' },\n // manual v-align, half the icon size\n mt: { xs: '-16px', md: '-20px', xl: '-22px' },\n '& .MuiSvgIcon-root': {\n fontSize: { xs: '17px', xl: '20px' },\n },\n // highlight border\n ...getInteractiveStyle(\n {\n color: 'text.primary',\n borderColor: onBackground ? 'transparent.transparent' : 'onSurface.os100',\n backgroundColor: onBackground ? 'transparent.transparent' : 'surface.primary',\n },\n {\n backgroundColor: 'surface.secondary',\n },\n ),\n // disabled state\n '&.Mui-disabled': {\n color: 'disabled.tertiary',\n borderColor: onBackground ? 'transparent.transparent' : 'disabled.secondary',\n backgroundColor: onBackground ? 'transparent.transparent' : 'disabled.secondary',\n },\n }),\n [],\n );\n\n // hide navigation when not needed\n if (autoHideNavigation && carousel?.isLocked) {\n return null;\n }\n return (\n <>\n <IconButton\n disabled={carousel && !carousel.params?.loop && carousel.isBeginning}\n onClick={() => {\n carousel?.slidePrev();\n peekEffect && peek && setPeek('reset');\n }}\n onMouseEnter={() => upMD && peekEffect && setPeek('prev')}\n onMouseLeave={() => peekEffect && peek && setPeek('reset')}\n sx={{\n ...sharedSx,\n insetInlineStart: '16px',\n ...prevSx,\n }}\n aria-label=\"Previous slide\"\n aria-controls=\"carousel\"\n color=\"surface\"\n size=\"medium\"\n {...restPrev}\n >\n {theme.direction === 'rtl' ? <NextIcon {...prevIconProps} /> : <PrevIcon {...prevIconProps} />}\n </IconButton>\n <IconButton\n disabled={carousel && !carousel.params?.loop && carousel.isEnd}\n onClick={() => {\n carousel?.slideNext();\n peekEffect && peek && setPeek('reset');\n }}\n onMouseEnter={() => upMD && peekEffect && setPeek('next')}\n onMouseLeave={() => peekEffect && peek && setPeek('reset')}\n sx={{\n ...sharedSx,\n insetInlineEnd: '16px',\n ...nextSx,\n }}\n aria-label=\"Next slide\"\n aria-controls=\"carousel\"\n color=\"surface\"\n {...restNext}\n >\n {theme.direction === 'rtl' ? <PrevIcon {...nextIconProps} /> : <NextIcon {...nextIconProps} />}\n </IconButton>\n </>\n );\n}\n"],"names":["carousel","carouselProp","peekEffect","propPeekEffect","prevButtonProps","prevIconProps","PrevIconComponent","nextButtonProps","nextIconProps","NextIconComponent","arrows","onBackground","autoHideNavigation","carouselHook","useCarousel","_a","params","effect","theme","useTheme","upMD","useMediaQuery","breakpoints","up","_d","sx","prevSx","restPrev","__rest","_e","nextSx","restNext","peek","setPeek","useCarouselPeekEffect","PrevIcon","ArrowLeftIcon","ChevronLeftIcon","NextIcon","ArrowRightIcon","ChevronRightIcon","sharedSx","useMemo","Object","assign","position","zIndex","top","width","xs","md","xl","height","mt","fontSize","getInteractiveStyle","color","borderColor","backgroundColor","isLocked","_jsxs","_Fragment","children","_jsx","IconButton","disabled","_b","loop","isBeginning","onClick","slidePrev","onMouseEnter","onMouseLeave","insetInlineStart","size","direction","_c","isEnd","slideNext","insetInlineEnd"],"mappings":"4ZAiEEA,SAAUC,EACVC,WAAYC,GAAiB,EAAKC,gBAClCA,EAAeC,cACfA,EAAaC,kBACbA,EAAiBC,gBACjBA,EAAeC,cACfA,EAAaC,kBACbA,EAAiBC,OACjBA,GAAS,EA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AACC,aAAUrB,OAAAC,OAAA,CACTqB,SAAUjE,KAA4B,QAAfkE,EAAAlE,EAASgB,cAAM,IAAAkD,OAAA,EAAAA,EAAEC,OAAQnE,EAASoE,YACzDC,QAAS,KACPrE,SAAAA,EAAUsE,YACVpE,GAAc8B,GAAQC,EAAQ,UAEhCsC,aAAc,IAAMnD,GAAQlB,GAAc+B,EAAQ,QAClDuC,aAAc,IAAMtE,GAAc8B,GAAQC,EAAQ,SAClDR,gDACKgB,GAAQ,CACXgC,iBAAkB,SACf/C,GAAM,aAEA,iCACG,WACd8B,MAAM,UACNkB,KAAK,UACD/C,EAAQ,CAAAmC,SAES,QAApB5C,EAAMyD,UAAsBZ,MAACzB,mBAAajC,IAAoB0D,EAAAA,IAAC5B,EAAQQ,OAAAC,OAAA,CAAA,EAAKvC,OAE/E0D,EAAAA,IAACC,EAAAA,WAAUrB,OAAAC,OAAA,CACTqB,SAAUjE,aAAa4E,EAAA5E,EAASgB,6BAAQmD,OAAQnE,EAAS6E,MACzDR,QAAS,KACPrE,SAAAA,EAAU8E,YACV5E,GAAc8B,GAAQC,EAAQ,UAEhCsC,aAAc,IAAMnD,GAAQlB,GAAc+B,EAAQ,QAClDuC,aAAc,IAAMtE,GAAc8B,GAAQC,EAAQ,SAClDR,GAAEkB,OAAAC,OAAAD,OAAAC,OAAAD,OAAAC,OAAA,GACGH,GAAQ,CACXsC,eAAgB,SACbjD,GAAM,aAEA,aAAY,gBACT,WACd0B,MAAM,WACFzB,EAAQ,CAAA+B,SAES,QAApB5C,EAAMyD,UAAsBZ,EAAAA,IAAC5B,EAAQQ,OAAAC,OAAA,CAAA,EAAKpC,IAAoBuD,EAAAA,IAACzB,mBAAa9B,SAIrF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var e=require("tslib"),s=require("react/jsx-runtime"),r=require("react"),o=require("@mui/material"),n=require("./hooks.js"),i=require("../../materialui/button/interactive.js"),t=require("../../materialui/slider/SliderContainer.js");const l=r.forwardRef((o,i)=>{var{carousel:t,position:l,variant:x,sx:v}=o,g=e.__rest(o,["carousel","position","variant","sx"]);const f=n.useCarousel(),h=t||f,b=r.useMemo(()=>{switch(x){case"scrollbar":return p;case"slider":return c;case"fraction":return d;case"lines":return u;default:return a}},[x]),m=r.useMemo(()=>"inside"===l?Object.assign({position:"absolute",zIndex:"90",bottom:"0",left:"0",right:"0"},v):v,[l,JSON.stringify(v)]);return s.jsx(b,Object.assign({carousel:h,sx:m,ref:i,position:l},g))}),a=r.forwardRef((r,n)=>{var{carousel:i,dotsWrapperProps:t,dotProps:l,position:a,sx:d}=r,u=e.__rest(r,["carousel","dotsWrapperProps","dotProps","position","sx"]);const c=null!=t?t:{},{sx:p}=c,x=e.__rest(c,["sx"]),v=null!=l?l:{},{sx:g}=v,f=e.__rest(v,["sx"]);return s.jsx(o.Box,Object.assign({sx:Object.assign({p:2,display:"flex",alignItems:"center",justifyContent:"center"},d),ref:n},u,{children:s.jsx(o.Box,Object.assign({sx:Object.assign(Object.assign({display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"1000px",py:.5,px:1,gap:.5,width:12*((null==i?void 0:i.slides.length)||0)+4*(((null==i?void 0:i.slides.length)||1)-1)+4+16+"px"},"inside"===a&&{backgroundColor:e=>"dark"===e.palette.mode?"surface.primary":"transparent.backdrop"}),p)},x,{children:[...new Array((null==i?void 0:i.slides.length)||0)].map((e,r)=>{var n,t;return s.jsx(o.Box,Object.assign({className:!(null===(n=null==i?void 0:i.params)||void 0===n?void 0:n.loop)&&(null==i?void 0:i.isEnd)&&r===((null==i?void 0:i.slides.length)||0)-1?"active":(null==i?void 0:i.isEnd)&&!(null===(t=i.params)||void 0===t?void 0:t.loop)||r!==(null==i?void 0:i.realIndex)?void 0:"active",sx:Object.assign({p:"0",width:"12px",height:"12px",transform:"scale(0.6667)",borderRadius:"100%",backgroundColor:"onSurface.os500",transition:"transform 0.3s ease-out, background-color 0.3s ease-out, margin 0.3s ease-out","&.active":{transform:"scale(1)",backgroundColor:"text.primary",margin:"0 2px"}},g)},f),r)})}))}))}),d=r.forwardRef((r,n)=>{var{carousel:t,buttonProps:l,position:a,sx:d}=r,u=e.__rest(r,["carousel","buttonProps","position","sx"]);const c=null!=l?l:{},{sx:p}=c,x=e.__rest(c,["sx"]);return s.jsx(o.Box,Object.assign({sx:Object.assign({display:"flex",alignItems:"center",justifyContent:"center",p:2},d),ref:n},u,{children:s.jsx(o.Button,Object.assign({variant:"text","aria-controls":"carousel",sx:Object.assign(Object.assign({px:2,py:.25,borderRadius:"4px",fontSize:"18px",lineHeight:"28px",letterSpacing:"0.02em"},i.getInteractiveStyle({backgroundColor:"transparent.backdrop"},{backgroundColor:"onSurface.os100"})),p),onClick:()=>{var e;return(null==t?void 0:t.isEnd)&&!(null===(e=t.params)||void 0===e?void 0:e.loop)?null==t?void 0:t.slideTo(0):null==t?void 0:t.slideNext()}},x,{children:s.jsxs(o.Box,{component:"span",children:[s.jsx(o.Box,{component:"span",sx:{fontWeight:"700",color:"onSurface.os900"},children:`${((null==t?void 0:t.realIndex)||0)+1}`}),s.jsx(o.Box,{component:"span",sx:{color:"onSurface.os700",fontWeight:"400",mx:.5},children:" / "}),s.jsx(o.Box,{component:"span",sx:{color:"onSurface.os700",fontWeight:"300"},children:`${(null==t?void 0:t.slides.length)||0}`})]})}))}))}),u=r.forwardRef((r,n)=>{var{carousel:t,sx:l,linesProps:a,lineProgress:d,lineProgressProps:u,position:c}=r,p=e.__rest(r,["carousel","sx","linesProps","lineProgress","lineProgressProps","position"]);const x=null!=a?a:{},{sx:v}=x,g=e.__rest(x,["sx"]),f=null!=u?u:{},{sx:h}=f,b=e.__rest(f,["sx"]);return s.jsx(o.Box,Object.assign({sx:Object.assign({display:"flex",alignItems:"center",justifyContent:{xs:"stretch",md:"center"},flexGrow:{xs:"1",md:"0"},gap:1,p:2},l),ref:n},p,{children:[...new Array((null==t?void 0:t.slides.length)||0)].map((e,r)=>{var n,l;const a=!(null===(n=null==t?void 0:t.params)||void 0===n?void 0:n.loop)&&(null==t?void 0:t.isEnd)&&r===((null==t?void 0:t.slides.length)||0)-1||(!(null==t?void 0:t.isEnd)||(null===(l=t.params)||void 0===l?void 0:l.loop))&&r===(null==t?void 0:t.realIndex),u=r<=((null==t?void 0:t.realIndex)||0);return s.jsxs(o.Button,Object.assign({color:"inherit",className:a?"active":void 0,sx:Object.assign(Object.assign({p:0,minHeight:"0",height:a||u?"8px":"4px",borderRadius:a||u?"4px":"2px",width:{xs:"auto",md:"56px"},flexGrow:{xs:"1",md:"0"},justifyContent:"flex-start"},i.getInteractiveStyle({backgroundColor:"surface.primary","& .progress-line":{backgroundColor:"brand.secondary"}},{backgroundColor:"surface.secondary","& .progress-line":{backgroundColor:"brandHover.secondary"}})),v),"aria-controls":"carousel",onClick:()=>{var e;return null==t?void 0:t[(null===(e=t.params)||void 0===e?void 0:e.loop)?"slideToLoop":"slideTo"](r)}},g,{children:[s.jsx(o.Box,{sx:{position:"absolute",top:"50%",left:"0",right:"0",height:"24px",transform:"translateY(-50%)",pointerEvents:"auto"}}),s.jsx(o.Box,{sx:{borderRadius:"4px",height:"100%",width:"100%",overflow:"hidden"},children:s.jsx(o.Box,Object.assign({className:"progress-line",role:a?"progress":void 0,"aria-valuenow":a?d:void 0,"aria-valuemin":0,"aria-valuemax":100,sx:Object.assign({opacity:void 0!==d||u?"1":"0",width:"100%",backgroundColor:"brand.secondary",height:"100%",transformOrigin:"left",transform:`scaleX(${void 0!==d&&a?d/100:u?1:0})`,transition:(void 0!==d?"transform 300ms ease-in-out, ":"")+"opacity 300ms ease-out, background-color 300ms ease-out"},h)},b))})]}),r)})}))}),c=r.forwardRef((n,i)=>{var t,l,{carousel:a,sliderProps:d,sx:u,progressProps:c,position:p}=n,x=e.__rest(n,["carousel","sliderProps","sx","progressProps","position"]);const v=null!=d?d:{},{sx:g}=v,f=e.__rest(v,["sx"]),[h,b]=r.useState(Math.round(100*((null==a?void 0:a.progress)||0))),m=r.useRef(!1),[,j]=r.useState({});return r.useEffect(()=>{m.current||b(Math.round(100*((null==a?void 0:a.progress)||0)))},[null==a?void 0:a.progress]),r.useEffect(()=>{if(a){const e=()=>{m.current||j({})};return a.on("sliderMove",e),()=>{a.off("sliderMove",e)}}},[a]),s.jsx(o.Box,Object.assign({sx:Object.assign({my:2},u),ref:i},x,{children:s.jsx(o.Slider,Object.assign({value:h,min:0,max:100,onChange:(e,s)=>{m.current=!0,null==a||a.setProgress(s/100,150),b(s)},onChangeCommitted:()=>{null==a||a.slideToClosest(300),m.current=!1},sx:Object.assign({display:"block",height:"4px",py:"14px",".MuiSlider-rail":{color:"surface.primary"},".MuiSlider-track":{color:"onSurface.os500",transitionDuration:`${null!==(l=null===(t=null==a?void 0:a.params)||void 0===t?void 0:t.speed)&&void 0!==l?l:300}ms`},".MuiSlider-thumb":{display:"none"}},g),"aria-controls":"carousel"},f))}))}),p=r.forwardRef((o,n)=>{var i,l,a,{carousel:d,sliderProps:u,position:p}=o,x=e.__rest(o,["carousel","sliderProps","position"]);const v=null!=u?u:{},{sx:g}=v,f=e.__rest(v,["sx"]),[h,b]=r.useState(!1),[,m]=r.useState({});r.useEffect(()=>{if(d){const e=()=>b(!0),s=()=>b(!1),r=()=>m({});return d.on("touchStart",e),d.on("touchEnd",s),d.on("resize",r),()=>{d.off("touchStart",e),d.off("touchEnd",s),d.off("resize",r)}}},[d]);const j=r.useMemo(()=>{var e,s;if((null===(e=null==d?void 0:d.wrapperEl)||void 0===e?void 0:e.scrollWidth)&&(null==d?void 0:d.width)){const e=Math.ceil((null==d?void 0:d.width)**2/(null===(s=null==d?void 0:d.wrapperEl)||void 0===s?void 0:s.scrollWidth));return Math.max(e,40)}return 40},[null===(i=null==d?void 0:d.wrapperEl)||void 0===i?void 0:i.scrollWidth,null==d?void 0:d.width]);return s.jsx(c,Object.assign({ref:n,carousel:d,component:t.SliderContainer,thumbSize:j,sliderProps:Object.assign({tabIndex:-1,valueLabelDisplay:"off",sx:Object.assign({".MuiSlider-rail, .MuiSlider-track":{color:"surface.primary"},".MuiSlider-thumb":Object.assign(Object.assign({display:"flex",width:`${j}px`,maxWidth:"none",height:"4px",border:"none",backgroundColor:"onSurface.os500","&:after":{width:`${j}px`}},!h&&{transition:`left ${null!==(a=null===(l=null==d?void 0:d.params)||void 0===l?void 0:l.speed)&&void 0!==a?a:300}ms ease-out`}),{"&.Mui-focusVisible":{boxShadow:"none","&:before":{content:"none"}}})},g)},f)},x))});exports.CarouselPagination=l,exports.DotsVariant=a,exports.FractionVariant=d,exports.LinesVariant=u,exports.ScrollbarVariant=p,exports.SliderVariant=c;
|
|
2
2
|
//# sourceMappingURL=Pagination.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.js","sources":["../../../../../src/components/carousel/Pagination.tsx"],"sourcesContent":["import React, { ElementType, forwardRef, useEffect, useMemo, useState, useRef } from 'react';\nimport { Box, BoxProps, Button, ButtonProps, Slider, SliderProps, CSSObject } from '@mui/material';\nimport { useCarousel } from './hooks';\nimport type { Swiper as CarouselInstance } from 'swiper';\nimport { getInteractiveStyle } from '@/src/materialui/button/interactive';\nimport { SliderContainer } from '@/src/materialui/slider/SliderContainer';\n\nexport interface CarouselPaginationVariantProps extends Omit<BoxProps<ElementType>, 'children' | 'position'> {\n /**\n * Carousel instance from useCarousel hook\n */\n carousel: CarouselInstance;\n}\nexport interface CarouselPaginationDotsProps extends CarouselPaginationVariantProps {\n variant?: 'dots';\n /**\n * Properties applied to wrapper of dots\n */\n dotsWrapperProps?: BoxProps<ElementType>;\n /**\n * Properties applied to each dot\n */\n dotProps?: BoxProps<ElementType>;\n}\nexport interface CarouselPaginationFractionProps extends CarouselPaginationVariantProps {\n variant?: 'fraction';\n /**\n * Properties applied to button used to render text\n */\n buttonProps?: ButtonProps;\n}\nexport interface CarouselPaginationLinesProps extends CarouselPaginationVariantProps {\n variant?: 'lines';\n /**\n * Properties applied to each line\n */\n linesProps?: ButtonProps;\n /**\n * Show progress in active line instead\n */\n lineProgress?: number;\n /**\n * Properties applied to active line progress\n */\n lineProgressProps?: BoxProps<ElementType>;\n}\nexport interface CarouselPaginationSliderProps extends CarouselPaginationVariantProps {\n variant?: 'slider';\n /**\n * Properties applied to Slider\n */\n sliderProps?: SliderProps;\n}\nexport interface CarouselPaginationScrollbarProps extends CarouselPaginationVariantProps {\n variant?: 'scrollbar';\n /**\n * Properties applied to Slider\n */\n sliderProps?: SliderProps;\n}\nexport interface CarouselPaginationBaseProps {\n /**\n * Optional Carousel instance from useCarouselInstance hook\n */\n carousel?: CarouselInstance;\n /**\n * Append style to wrapper box to change position of control\n * @default outside\n */\n position?: 'outside' | 'inside';\n}\nexport type CarouselPaginationProps = CarouselPaginationBaseProps &\n (\n | Omit<CarouselPaginationDotsProps, 'carousel'>\n | Omit<CarouselPaginationFractionProps, 'carousel'>\n | Omit<CarouselPaginationLinesProps, 'carousel'>\n | Omit<CarouselPaginationSliderProps, 'carousel'>\n | Omit<CarouselPaginationScrollbarProps, 'carousel'>\n );\n\n/**\n * Pagination controls\n */\nexport const CarouselPagination: React.FC<CarouselPaginationProps> = forwardRef(\n ({ carousel: carouselProp, position, variant, sx: rawSx, ...rest }, ref) => {\n const carouselHook = useCarousel();\n const carousel = carouselProp || carouselHook;\n // decide on component used\n const VariantComponent = useMemo(() => {\n switch (variant) {\n case 'scrollbar':\n return ScrollbarVariant;\n case 'slider':\n return SliderVariant;\n case 'fraction':\n return FractionVariant;\n case 'lines':\n return LinesVariant;\n case 'dots':\n return DotsVariant;\n default:\n return DotsVariant;\n }\n }, [variant]);\n // position extra styling applied to wrapper\n const sx = useMemo<CSSObject | BoxProps['sx']>(() => {\n if (position === 'inside') {\n return {\n position: 'absolute',\n zIndex: '90',\n bottom: '0',\n left: '0',\n right: '0',\n ...rawSx,\n };\n } else {\n return rawSx;\n }\n }, [position, JSON.stringify(rawSx)]);\n\n return <VariantComponent carousel={carousel} sx={sx} ref={ref} position={position} {...rest} />;\n },\n);\n\n/**\n * Dots variant (...)\n */\nexport const DotsVariant: React.FC<CarouselPaginationDotsProps> = forwardRef(\n ({ carousel, dotsWrapperProps, dotProps, position, sx, ...rest }, ref) => {\n const { sx: dotsWrapperSx, ...restDotsWrapper } = dotsWrapperProps ?? {};\n const { sx: dotSx, ...restDot } = dotProps ?? {};\n\n return (\n <Box\n sx={{\n p: 2,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n ...sx,\n }}\n ref={ref}\n {...rest}\n >\n <Box\n sx={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n borderRadius: '1000px',\n py: 0.5,\n px: 1,\n gap: 0.5,\n // ensure width does not change during transition\n // dots width space + gap space + extra active dot space + padding\n width: `${(carousel?.slides.length || 0) * 12 + ((carousel?.slides.length || 1) - 1) * 4 + 4 + 16}px`,\n // on image variant from Figma\n ...(position === 'inside' && {\n backgroundColor: (theme) => (theme.palette.mode === 'dark' ? 'surface.primary' : 'transparent.backdrop'),\n }),\n ...dotsWrapperSx,\n }}\n {...restDotsWrapper}\n >\n {[...new Array(carousel?.slides.length || 0)].map((_, idx) => (\n <Box\n key={idx}\n className={\n !carousel?.originalParams.loop && carousel?.isEnd && idx === (carousel?.slides.length || 0) - 1\n ? 'active'\n : (!carousel?.isEnd || carousel.originalParams.loop) && idx === carousel?.realIndex\n ? 'active'\n : undefined\n }\n sx={{\n p: '0',\n width: '12px',\n height: '12px',\n // scale to 8px\n transform: 'scale(0.6667)',\n borderRadius: '100%',\n backgroundColor: 'onSurface.os500',\n transition: 'transform 0.3s ease-out, background-color 0.3s ease-out, margin 0.3s ease-out',\n '&.active': {\n transform: 'scale(1)',\n backgroundColor: 'text.primary',\n margin: '0 2px',\n },\n ...dotSx,\n }}\n {...restDot}\n />\n ))}\n </Box>\n </Box>\n );\n },\n);\n\n/**\n * Fraction variant (text 1/3)\n */\nexport const FractionVariant: React.FC<CarouselPaginationFractionProps> = forwardRef(\n ({ carousel, buttonProps, position, sx, ...rest }, ref) => {\n const { sx: buttonSx, ...restButton } = buttonProps ?? {};\n\n return (\n <Box\n sx={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n // space is needed for focus overflow\n p: 2,\n ...sx,\n }}\n ref={ref}\n {...rest}\n >\n <Button\n variant=\"text\"\n aria-controls=\"carousel\"\n sx={{\n px: 2,\n py: 0.25,\n borderRadius: '4px',\n // custom typography according to Figma (Pagination/Compact)\n fontSize: '18px',\n lineHeight: '28px',\n letterSpacing: '0.02em',\n ...getInteractiveStyle(\n {\n backgroundColor: 'transparent.backdrop',\n },\n {\n backgroundColor: 'onSurface.os100',\n },\n ),\n ...buttonSx,\n }}\n onClick={() =>\n // at the end, slide to beginning\n carousel?.isEnd && !carousel.originalParams.loop ? carousel?.slideTo(0) : carousel?.slideNext()\n }\n {...restButton}\n >\n <Box component=\"span\">\n <Box component=\"span\" sx={{ fontWeight: '700', color: 'onSurface.os900' }}>\n {`${(carousel?.realIndex || 0) + 1}`}\n </Box>\n <Box component=\"span\" sx={{ color: 'onSurface.os700', fontWeight: '400', mx: 0.5 }}>\n {' / '}\n </Box>\n <Box component=\"span\" sx={{ color: 'onSurface.os700', fontWeight: '300' }}>\n {`${carousel?.slides.length || 0}`}\n </Box>\n </Box>\n </Button>\n </Box>\n );\n },\n);\n\n/**\n * Lines variant (- - -)\n */\nexport const LinesVariant: React.FC<CarouselPaginationLinesProps> = forwardRef(\n ({ carousel, sx, linesProps, lineProgress, lineProgressProps, position, ...rest }, ref) => {\n const { sx: lineSx, ...lineRest } = linesProps ?? {};\n const { sx: lineProgressSx, ...lineProgressRest } = lineProgressProps ?? {};\n\n return (\n <Box\n sx={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: { xs: 'stretch', md: 'center' },\n flexGrow: { xs: '1', md: '0' },\n gap: 1,\n // space is needed for focus overflow\n p: 2,\n ...sx,\n }}\n ref={ref}\n {...rest}\n >\n {[...new Array(carousel?.slides.length || 0)].map((_, idx) => {\n const active =\n (!carousel?.originalParams.loop && carousel?.isEnd && idx === (carousel?.slides.length || 0) - 1) ||\n ((!carousel?.isEnd || carousel.originalParams.loop) && idx === carousel?.realIndex);\n const seen = idx <= (carousel?.realIndex || 0);\n\n return (\n <Button\n key={idx}\n color=\"inherit\"\n className={active ? 'active' : undefined}\n sx={{\n p: 0,\n minHeight: '0',\n height: active || seen ? '8px' : '4px',\n borderRadius: active || seen ? '4px' : '2px',\n width: { xs: 'auto', md: '56px' },\n flexGrow: { xs: '1', md: '0' },\n justifyContent: 'flex-start',\n ...getInteractiveStyle(\n {\n backgroundColor: 'surface.primary',\n '& .progress-line': {\n backgroundColor: 'brand.secondary',\n },\n },\n {\n backgroundColor: 'surface.secondary',\n '& .progress-line': {\n backgroundColor: 'brandHover.secondary',\n },\n },\n ),\n ...lineSx,\n }}\n aria-controls=\"carousel\"\n onClick={() => carousel?.[carousel.originalParams.loop ? 'slideToLoop' : 'slideTo'](idx)}\n {...lineRest}\n >\n <Box\n sx={{\n // invisible hitbox expanding clickable area\n position: 'absolute',\n top: '50%',\n left: '0',\n right: '0',\n height: '24px', // Minimum a11y click area\n transform: 'translateY(-50%)',\n pointerEvents: 'auto',\n }}\n />\n <Box sx={{ borderRadius: '4px', height: '100%', width: '100%', overflow: 'hidden' }}>\n <Box\n className=\"progress-line\"\n role={active ? 'progress' : undefined} // Only the active one gets a role\n aria-valuenow={active ? lineProgress : undefined}\n aria-valuemin={0}\n aria-valuemax={100}\n sx={{\n opacity: lineProgress !== undefined || seen ? '1' : '0',\n width: '100%',\n backgroundColor: 'brand.secondary',\n height: '100%',\n transformOrigin: 'left',\n transform: `scaleX(${lineProgress !== undefined && active ? lineProgress / 100 : seen ? 1 : 0})`,\n transition: `${lineProgress !== undefined ? 'transform 300ms ease-in-out, ' : ''}opacity 300ms ease-out, background-color 300ms ease-out`,\n ...lineProgressSx,\n }}\n {...lineProgressRest}\n />\n </Box>\n </Button>\n );\n })}\n </Box>\n );\n },\n);\n\n/**\n * Slider variant (___)\n */\nexport const SliderVariant: React.FC<CarouselPaginationSliderProps> = forwardRef(\n ({ carousel, sliderProps, sx, progressProps: __, position, ...rest }, ref) => {\n const { sx: sliderSx, ...restSlider } = sliderProps ?? {};\n // slider current value that might not match carousel progress\n const [value, setValue] = useState<number>(Math.round((carousel?.progress || 0) * 100));\n // watch user manipulating slider\n const dragging = useRef<boolean>(false);\n const [, setRerender] = useState({});\n // monitor carousel progress to update slider value\n useEffect(() => {\n if (!dragging.current) {\n setValue(Math.round((carousel?.progress || 0) * 100));\n }\n }, [carousel?.progress]);\n // extra monitor of states\n useEffect(() => {\n if (carousel) {\n const handleMove = () => {\n if (!dragging.current) {\n setRerender({});\n }\n };\n\n // monitor of movement to immediately move thumb\n carousel.on('sliderMove', handleMove);\n\n return () => {\n carousel.off('sliderMove', handleMove);\n };\n }\n }, [carousel]);\n\n return (\n <Box sx={{ my: 2, ...sx }} ref={ref} {...rest}>\n <Slider\n value={value}\n min={0}\n max={100}\n onChange={(_, newValue: number) => {\n // prevent value updates from carousel progress\n dragging.current = true;\n // smoothly move carousel\n carousel?.setProgress(newValue / 100, 150);\n // update slider value\n setValue(newValue);\n }}\n onChangeCommitted={() => {\n // make sure to slide to correct position after user stop touching slider\n carousel?.slideToClosest(300);\n // enable changing value from carousel progress\n dragging.current = false;\n }}\n sx={{\n display: 'block',\n height: '4px',\n // restyle to less prominent variant\n '.MuiSlider-rail': {\n color: 'surface.primary',\n },\n '.MuiSlider-track': {\n color: 'onSurface.os500',\n // match transition speed of carousel\n transitionDuration: `${carousel?.originalParams.speed ?? 300}ms`,\n },\n // hide control thumb\n '.MuiSlider-thumb': {\n display: 'none',\n },\n ...sliderSx,\n }}\n aria-controls=\"carousel\"\n {...restSlider}\n />\n </Box>\n );\n },\n);\n\n/**\n * Scrollbar variant (_--)\n */\nexport const ScrollbarVariant: React.FC<CarouselPaginationSliderProps> = forwardRef(\n ({ carousel, sliderProps, position, ...rest }, ref) => {\n const { sx: sliderSx, ...restSlider } = sliderProps ?? {};\n // watch states\n const [carouselDragging, setCarouselDragging] = useState<boolean>(false);\n const [, setRerender] = useState({});\n // extra monitor of states\n useEffect(() => {\n if (carousel) {\n const handleDragStart = () => setCarouselDragging(true);\n const handleDragEnd = () => setCarouselDragging(false);\n const handleResize = () => setRerender({});\n\n // monitor of dragging to remove thumb transition for immediate feedback\n carousel.on('touchStart', handleDragStart);\n carousel.on('touchEnd', handleDragEnd);\n // monitor resize to change size of the thumb\n carousel.on('resize', handleResize);\n\n return () => {\n carousel.off('touchStart', handleDragStart);\n carousel.off('touchEnd', handleDragEnd);\n carousel.off('resize', handleResize);\n };\n }\n }, [carousel]);\n // calculate size of the thumb based on the visible content and full content\n const thumbSize = useMemo<number>(() => {\n if (carousel?.wrapperEl?.scrollWidth && carousel?.width) {\n const size = Math.ceil(carousel?.width ** 2 / carousel?.wrapperEl?.scrollWidth);\n return Math.max(size, 40);\n }\n return 40;\n }, [carousel?.wrapperEl?.scrollWidth, carousel?.width]);\n\n return (\n <SliderVariant\n ref={ref}\n carousel={carousel}\n component={SliderContainer}\n thumbSize={thumbSize}\n sliderProps={{\n // prevent selection via keyboard, Carousel can be already controlled with Keyboard and we are not showing focus ring\n tabIndex: -1,\n // remove valueLabel tooltip above thumb\n valueLabelDisplay: 'off',\n sx: {\n display: 'block',\n height: '4px',\n // restyle to match scrollbar\n '.MuiSlider-rail, .MuiSlider-track': {\n color: 'surface.primary',\n },\n '.MuiSlider-thumb': {\n display: 'flex',\n width: `${thumbSize}px`,\n height: '4px',\n border: 'none',\n backgroundColor: 'onSurface.os500',\n // match transition speed of carousel\n ...(!carouselDragging && {\n transition: `left ${carousel?.originalParams.speed ?? 300}ms ease-out`,\n }),\n // remove focus style\n '&.Mui-focusVisible': {\n boxShadow: 'none',\n '&:before': {\n content: 'none',\n },\n },\n },\n ...sliderSx,\n },\n ...restSlider,\n }}\n {...rest}\n />\n );\n },\n);\n"],"names":["CarouselPagination","forwardRef","_a","ref","carousel","carouselProp","position","variant","sx","rawSx","rest","__rest","carouselHook","useCarousel","VariantComponent","useMemo","ScrollbarVariant","SliderVariant","FractionVariant","LinesVariant","DotsVariant","Object","assign","zIndex","bottom","left","right","JSON","stringify","_jsx","dotsWrapperProps","dotProps","_b","dotsWrapperSx","restDotsWrapper","_c","dotSx","restDot","Box","p","display","alignItems","justifyContent","children","borderRadius","py","px","gap","width","slides","length","backgroundColor","theme","palette","mode","Array","map","_","idx","className","originalParams","loop","isEnd","realIndex","undefined","height","transform","transition","margin","buttonProps","buttonSx","restButton","Button","fontSize","lineHeight","letterSpacing","getInteractiveStyle","onClick","slideTo","slideNext","_jsxs","component","fontWeight","color","mx","linesProps","lineProgress","lineProgressProps","lineSx","lineRest","lineProgressSx","lineProgressRest","xs","md","flexGrow","active","seen","minHeight","top","pointerEvents","overflow","role","opacity","transformOrigin","sliderProps","progressProps","__","sliderSx","restSlider","value","setValue","useState","Math","round","progress","dragging","useRef","setRerender","useEffect","current","handleMove","on","off","my","Slider","min","max","onChange","newValue","setProgress","onChangeCommitted","slideToClosest","transitionDuration","speed","_d","carouselDragging","setCarouselDragging","handleDragStart","handleDragEnd","handleResize","thumbSize","wrapperEl","scrollWidth","size","ceil","SliderContainer","tabIndex","valueLabelDisplay","border","boxShadow","content"],"mappings":"qPAmFO,MAAMA,EAAwDC,EAAAA,WACnE,CAACC,EAAmEC,KAAnE,IAAEC,SAAUC,EAAYC,SAAEA,EAAQC,QAAEA,EAASC,GAAIC,GAAKP,EAAKQ,EAAIC,EAAAA,OAAAT,EAA/D,wCACC,MAAMU,EAAeC,EAAAA,cACfT,EAAWC,GAAgBO,EAE3BE,EAAmBC,EAAAA,QAAQ,KAC/B,OAAQR,GACN,IAAK,YACH,OAAOS,EACT,IAAK,SACH,OAAOC,EACT,IAAK,WACH,OAAOC,EACT,IAAK,QACH,OAAOC,EAGT,QACE,OAAOC,IAEV,CAACb,IAEEC,EAAKO,EAAAA,QAAoC,IAC5B,WAAbT,EACFe,OAAAC,OAAA,CACEhB,SAAU,WACViB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A,EAAAA,EAAE4I,eAAe1I,aAAQ,EAARA,EAAU4C,OAAO,CACvD,MAAM+F,EAAO/B,KAAKgC,MAAK5I,aAAQ,EAARA,EAAU4C,QAAS,GAAuB,QAAnBhB,EAAA5B,aAAQ,EAARA,EAAUyI,iBAAS,IAAA7G,OAAA,EAAAA,EAAE8G,cACnE,OAAO9B,KAAKc,IAAIiB,EAAM,GACxB,CACA,OAAO,IACN,CAAoB,QAAnB/G,EAAA5B,aAAQ,EAARA,EAAUyI,iBAAS,IAAA7G,OAAA,EAAAA,EAAE8G,YAAa1I,aAAQ,EAARA,EAAU4C,QAEhD,OACEnB,EAAAA,IAACZ,EAAaI,OAAAC,OAAA,CACZnB,IAAKA,EACLC,SAAUA,EACV6E,UAAWgE,EAAAA,gBACXL,UAAWA,EACXpC,YAAWnF,OAAAC,OAAA,CAET4H,UAAU,EAEVC,kBAAmB,MACnB3I,GAAEa,OAAAC,OAAA,CACAkB,QAAS,QACTyB,OAAQ,MAER,oCAAqC,CACnCkB,MAAO,mBAET,mBAAkB9D,OAAAC,OAAAD,OAAAC,OAAA,CAChBkB,QAAS,OACTQ,MAAO,GAAG4F,MACV3E,OAAQ,MACRmF,OAAQ,OACRjG,gBAAiB,oBAEZoF,GAAoB,CACvBpE,WAAY,QAAsC,QAA9BhC,EAAA/B,aAAQ,EAARA,EAAUwD,eAAeyE,aAAK,IAAAlG,EAAAA,EAAI,mBACtD,CAEF,qBAAsB,CACpBkH,UAAW,OACX,WAAY,CACVC,QAAS,YAIZ3C,IAEFC,IAEDlG"}
|
|
1
|
+
{"version":3,"file":"Pagination.js","sources":["../../../../../src/components/carousel/Pagination.tsx"],"sourcesContent":["import React, { ElementType, forwardRef, useEffect, useMemo, useState, useRef } from 'react';\nimport { Box, BoxProps, Button, ButtonProps, Slider, SliderProps, CSSObject } from '@mui/material';\nimport { useCarousel } from './hooks';\nimport type { Swiper as CarouselInstance } from 'swiper';\nimport { getInteractiveStyle } from '@/src/materialui/button/interactive';\nimport { SliderContainer } from '@/src/materialui/slider/SliderContainer';\n\nexport interface CarouselPaginationVariantProps extends Omit<BoxProps<ElementType>, 'children' | 'position'> {\n /**\n * Carousel instance from useCarousel hook\n */\n carousel: CarouselInstance;\n}\nexport interface CarouselPaginationDotsProps extends CarouselPaginationVariantProps {\n variant?: 'dots';\n /**\n * Properties applied to wrapper of dots\n */\n dotsWrapperProps?: BoxProps<ElementType>;\n /**\n * Properties applied to each dot\n */\n dotProps?: BoxProps<ElementType>;\n}\nexport interface CarouselPaginationFractionProps extends CarouselPaginationVariantProps {\n variant?: 'fraction';\n /**\n * Properties applied to button used to render text\n */\n buttonProps?: ButtonProps;\n}\nexport interface CarouselPaginationLinesProps extends CarouselPaginationVariantProps {\n variant?: 'lines';\n /**\n * Properties applied to each line\n */\n linesProps?: ButtonProps;\n /**\n * Show progress in active line instead\n */\n lineProgress?: number;\n /**\n * Properties applied to active line progress\n */\n lineProgressProps?: BoxProps<ElementType>;\n}\nexport interface CarouselPaginationSliderProps extends CarouselPaginationVariantProps {\n variant?: 'slider';\n /**\n * Properties applied to Slider\n */\n sliderProps?: SliderProps;\n}\nexport interface CarouselPaginationScrollbarProps extends CarouselPaginationVariantProps {\n variant?: 'scrollbar';\n /**\n * Properties applied to Slider\n */\n sliderProps?: SliderProps;\n}\nexport interface CarouselPaginationBaseProps {\n /**\n * Optional Carousel instance from useCarouselInstance hook\n */\n carousel?: CarouselInstance;\n /**\n * Append style to wrapper box to change position of control\n * @default outside\n */\n position?: 'outside' | 'inside';\n}\nexport type CarouselPaginationProps = CarouselPaginationBaseProps &\n (\n | Omit<CarouselPaginationDotsProps, 'carousel'>\n | Omit<CarouselPaginationFractionProps, 'carousel'>\n | Omit<CarouselPaginationLinesProps, 'carousel'>\n | Omit<CarouselPaginationSliderProps, 'carousel'>\n | Omit<CarouselPaginationScrollbarProps, 'carousel'>\n );\n\n/**\n * Pagination controls\n */\nexport const CarouselPagination: React.FC<CarouselPaginationProps> = forwardRef(\n ({ carousel: carouselProp, position, variant, sx: rawSx, ...rest }, ref) => {\n const carouselHook = useCarousel();\n const carousel = carouselProp || carouselHook;\n // decide on component used\n const VariantComponent = useMemo(() => {\n switch (variant) {\n case 'scrollbar':\n return ScrollbarVariant;\n case 'slider':\n return SliderVariant;\n case 'fraction':\n return FractionVariant;\n case 'lines':\n return LinesVariant;\n case 'dots':\n return DotsVariant;\n default:\n return DotsVariant;\n }\n }, [variant]);\n // position extra styling applied to wrapper\n const sx = useMemo<CSSObject | BoxProps['sx']>(() => {\n if (position === 'inside') {\n return {\n position: 'absolute',\n zIndex: '90',\n bottom: '0',\n left: '0',\n right: '0',\n ...rawSx,\n };\n } else {\n return rawSx;\n }\n }, [position, JSON.stringify(rawSx)]);\n\n return <VariantComponent carousel={carousel} sx={sx} ref={ref} position={position} {...rest} />;\n },\n);\n\n/**\n * Dots variant (...)\n */\nexport const DotsVariant: React.FC<CarouselPaginationDotsProps> = forwardRef(\n ({ carousel, dotsWrapperProps, dotProps, position, sx, ...rest }, ref) => {\n const { sx: dotsWrapperSx, ...restDotsWrapper } = dotsWrapperProps ?? {};\n const { sx: dotSx, ...restDot } = dotProps ?? {};\n\n return (\n <Box\n sx={{\n p: 2,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n ...sx,\n }}\n ref={ref}\n {...rest}\n >\n <Box\n sx={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n borderRadius: '1000px',\n py: 0.5,\n px: 1,\n gap: 0.5,\n // ensure width does not change during transition\n // dots width space + gap space + extra active dot space + padding\n width: `${(carousel?.slides.length || 0) * 12 + ((carousel?.slides.length || 1) - 1) * 4 + 4 + 16}px`,\n // on image variant from Figma\n ...(position === 'inside' && {\n backgroundColor: (theme) => (theme.palette.mode === 'dark' ? 'surface.primary' : 'transparent.backdrop'),\n }),\n ...dotsWrapperSx,\n }}\n {...restDotsWrapper}\n >\n {[...new Array(carousel?.slides.length || 0)].map((_, idx) => (\n <Box\n key={idx}\n className={\n !carousel?.params?.loop && carousel?.isEnd && idx === (carousel?.slides.length || 0) - 1\n ? 'active'\n : (!carousel?.isEnd || carousel.params?.loop) && idx === carousel?.realIndex\n ? 'active'\n : undefined\n }\n sx={{\n p: '0',\n width: '12px',\n height: '12px',\n // scale to 8px\n transform: 'scale(0.6667)',\n borderRadius: '100%',\n backgroundColor: 'onSurface.os500',\n transition: 'transform 0.3s ease-out, background-color 0.3s ease-out, margin 0.3s ease-out',\n '&.active': {\n transform: 'scale(1)',\n backgroundColor: 'text.primary',\n margin: '0 2px',\n },\n ...dotSx,\n }}\n {...restDot}\n />\n ))}\n </Box>\n </Box>\n );\n },\n);\n\n/**\n * Fraction variant (text 1/3)\n */\nexport const FractionVariant: React.FC<CarouselPaginationFractionProps> = forwardRef(\n ({ carousel, buttonProps, position, sx, ...rest }, ref) => {\n const { sx: buttonSx, ...restButton } = buttonProps ?? {};\n\n return (\n <Box\n sx={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n // space is needed for focus overflow\n p: 2,\n ...sx,\n }}\n ref={ref}\n {...rest}\n >\n <Button\n variant=\"text\"\n aria-controls=\"carousel\"\n sx={{\n px: 2,\n py: 0.25,\n borderRadius: '4px',\n // custom typography according to Figma (Pagination/Compact)\n fontSize: '18px',\n lineHeight: '28px',\n letterSpacing: '0.02em',\n ...getInteractiveStyle(\n {\n backgroundColor: 'transparent.backdrop',\n },\n {\n backgroundColor: 'onSurface.os100',\n },\n ),\n ...buttonSx,\n }}\n onClick={() =>\n // at the end, slide to beginning\n carousel?.isEnd && !carousel.params?.loop ? carousel?.slideTo(0) : carousel?.slideNext()\n }\n {...restButton}\n >\n <Box component=\"span\">\n <Box component=\"span\" sx={{ fontWeight: '700', color: 'onSurface.os900' }}>\n {`${(carousel?.realIndex || 0) + 1}`}\n </Box>\n <Box component=\"span\" sx={{ color: 'onSurface.os700', fontWeight: '400', mx: 0.5 }}>\n {' / '}\n </Box>\n <Box component=\"span\" sx={{ color: 'onSurface.os700', fontWeight: '300' }}>\n {`${carousel?.slides.length || 0}`}\n </Box>\n </Box>\n </Button>\n </Box>\n );\n },\n);\n\n/**\n * Lines variant (- - -)\n */\nexport const LinesVariant: React.FC<CarouselPaginationLinesProps> = forwardRef(\n ({ carousel, sx, linesProps, lineProgress, lineProgressProps, position, ...rest }, ref) => {\n const { sx: lineSx, ...lineRest } = linesProps ?? {};\n const { sx: lineProgressSx, ...lineProgressRest } = lineProgressProps ?? {};\n\n return (\n <Box\n sx={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: { xs: 'stretch', md: 'center' },\n flexGrow: { xs: '1', md: '0' },\n gap: 1,\n // space is needed for focus overflow\n p: 2,\n ...sx,\n }}\n ref={ref}\n {...rest}\n >\n {[...new Array(carousel?.slides.length || 0)].map((_, idx) => {\n const active =\n (!carousel?.params?.loop && carousel?.isEnd && idx === (carousel?.slides.length || 0) - 1) ||\n ((!carousel?.isEnd || carousel.params?.loop) && idx === carousel?.realIndex);\n const seen = idx <= (carousel?.realIndex || 0);\n\n return (\n <Button\n key={idx}\n color=\"inherit\"\n className={active ? 'active' : undefined}\n sx={{\n p: 0,\n minHeight: '0',\n height: active || seen ? '8px' : '4px',\n borderRadius: active || seen ? '4px' : '2px',\n width: { xs: 'auto', md: '56px' },\n flexGrow: { xs: '1', md: '0' },\n justifyContent: 'flex-start',\n ...getInteractiveStyle(\n {\n backgroundColor: 'surface.primary',\n '& .progress-line': {\n backgroundColor: 'brand.secondary',\n },\n },\n {\n backgroundColor: 'surface.secondary',\n '& .progress-line': {\n backgroundColor: 'brandHover.secondary',\n },\n },\n ),\n ...lineSx,\n }}\n aria-controls=\"carousel\"\n onClick={() => carousel?.[carousel.params?.loop ? 'slideToLoop' : 'slideTo'](idx)}\n {...lineRest}\n >\n <Box\n sx={{\n // invisible hitbox expanding clickable area\n position: 'absolute',\n top: '50%',\n left: '0',\n right: '0',\n height: '24px', // Minimum a11y click area\n transform: 'translateY(-50%)',\n pointerEvents: 'auto',\n }}\n />\n <Box sx={{ borderRadius: '4px', height: '100%', width: '100%', overflow: 'hidden' }}>\n <Box\n className=\"progress-line\"\n role={active ? 'progress' : undefined} // Only the active one gets a role\n aria-valuenow={active ? lineProgress : undefined}\n aria-valuemin={0}\n aria-valuemax={100}\n sx={{\n opacity: lineProgress !== undefined || seen ? '1' : '0',\n width: '100%',\n backgroundColor: 'brand.secondary',\n height: '100%',\n transformOrigin: 'left',\n transform: `scaleX(${lineProgress !== undefined && active ? lineProgress / 100 : seen ? 1 : 0})`,\n transition: `${lineProgress !== undefined ? 'transform 300ms ease-in-out, ' : ''}opacity 300ms ease-out, background-color 300ms ease-out`,\n ...lineProgressSx,\n }}\n {...lineProgressRest}\n />\n </Box>\n </Button>\n );\n })}\n </Box>\n );\n },\n);\n\n/**\n * Slider variant (___)\n */\nexport const SliderVariant: React.FC<CarouselPaginationSliderProps> = forwardRef(\n ({ carousel, sliderProps, sx, progressProps: __, position, ...rest }, ref) => {\n const { sx: sliderSx, ...restSlider } = sliderProps ?? {};\n // slider current value that might not match carousel progress\n const [value, setValue] = useState<number>(Math.round((carousel?.progress || 0) * 100));\n // watch user manipulating slider\n const dragging = useRef<boolean>(false);\n const [, setRerender] = useState({});\n // monitor carousel progress to update slider value\n useEffect(() => {\n if (!dragging.current) {\n setValue(Math.round((carousel?.progress || 0) * 100));\n }\n }, [carousel?.progress]);\n // extra monitor of states\n useEffect(() => {\n if (carousel) {\n const handleMove = () => {\n if (!dragging.current) {\n setRerender({});\n }\n };\n\n // monitor of movement to immediately move thumb\n carousel.on('sliderMove', handleMove);\n\n return () => {\n carousel.off('sliderMove', handleMove);\n };\n }\n }, [carousel]);\n\n return (\n <Box sx={{ my: 2, ...sx }} ref={ref} {...rest}>\n <Slider\n value={value}\n min={0}\n max={100}\n onChange={(_, newValue: number) => {\n // prevent value updates from carousel progress\n dragging.current = true;\n // smoothly move carousel\n carousel?.setProgress(newValue / 100, 150);\n // update slider value\n setValue(newValue);\n }}\n onChangeCommitted={() => {\n // make sure to slide to correct position after user stop touching slider\n carousel?.slideToClosest(300);\n // enable changing value from carousel progress\n dragging.current = false;\n }}\n sx={{\n display: 'block',\n // from 6px to 4px\n height: '4px',\n // keep 32px height\n py: '14px',\n // restyle to less prominent variant\n '.MuiSlider-rail': {\n color: 'surface.primary',\n },\n '.MuiSlider-track': {\n color: 'onSurface.os500',\n // match transition speed of carousel\n transitionDuration: `${carousel?.params?.speed ?? 300}ms`,\n },\n // hide control thumb\n '.MuiSlider-thumb': {\n display: 'none',\n },\n ...sliderSx,\n }}\n aria-controls=\"carousel\"\n {...restSlider}\n />\n </Box>\n );\n },\n);\n\n/**\n * Scrollbar variant (_--)\n */\nexport const ScrollbarVariant: React.FC<CarouselPaginationSliderProps> = forwardRef(\n ({ carousel, sliderProps, position, ...rest }, ref) => {\n const { sx: sliderSx, ...restSlider } = sliderProps ?? {};\n // watch states\n const [carouselDragging, setCarouselDragging] = useState<boolean>(false);\n const [, setRerender] = useState({});\n // extra monitor of states\n useEffect(() => {\n if (carousel) {\n const handleDragStart = () => setCarouselDragging(true);\n const handleDragEnd = () => setCarouselDragging(false);\n const handleResize = () => setRerender({});\n\n // monitor of dragging to remove thumb transition for immediate feedback\n carousel.on('touchStart', handleDragStart);\n carousel.on('touchEnd', handleDragEnd);\n // monitor resize to change size of the thumb\n carousel.on('resize', handleResize);\n\n return () => {\n carousel.off('touchStart', handleDragStart);\n carousel.off('touchEnd', handleDragEnd);\n carousel.off('resize', handleResize);\n };\n }\n }, [carousel]);\n // calculate size of the thumb based on the visible content and full content\n const thumbSize = useMemo<number>(() => {\n if (carousel?.wrapperEl?.scrollWidth && carousel?.width) {\n const size = Math.ceil(carousel?.width ** 2 / carousel?.wrapperEl?.scrollWidth);\n return Math.max(size, 40);\n }\n return 40;\n }, [carousel?.wrapperEl?.scrollWidth, carousel?.width]);\n\n return (\n <SliderVariant\n ref={ref}\n carousel={carousel}\n component={SliderContainer}\n thumbSize={thumbSize}\n sliderProps={{\n // prevent selection via keyboard, Carousel can be already controlled with Keyboard, and we are not showing focus ring\n tabIndex: -1,\n // remove valueLabel tooltip above thumb\n valueLabelDisplay: 'off',\n sx: {\n // restyle to match scrollbar\n '.MuiSlider-rail, .MuiSlider-track': {\n color: 'surface.primary',\n },\n '.MuiSlider-thumb': {\n display: 'flex',\n width: `${thumbSize}px`,\n maxWidth: 'none',\n height: '4px',\n border: 'none',\n backgroundColor: 'onSurface.os500',\n // hitbox target\n '&:after': {\n width: `${thumbSize}px`,\n },\n // match transition speed of carousel\n ...(!carouselDragging && {\n transition: `left ${carousel?.params?.speed ?? 300}ms ease-out`,\n }),\n // remove focus style\n '&.Mui-focusVisible': {\n boxShadow: 'none',\n '&:before': {\n content: 'none',\n },\n },\n },\n ...sliderSx,\n },\n ...restSlider,\n }}\n {...rest}\n />\n );\n },\n);\n"],"names":["CarouselPagination","forwardRef","_a","ref","carousel","carouselProp","position","variant","sx","rawSx","rest","__rest","carouselHook","useCarousel","VariantComponent","useMemo","ScrollbarVariant","SliderVariant","FractionVariant","LinesVariant","DotsVariant","Object","assign","zIndex","bottom","left","right","JSON","stringify","_jsx","dotsWrapperProps","dotProps","_b","dotsWrapperSx","restDotsWrapper","_c","dotSx","restDot","Box","p","display","alignItems","justifyContent","children","borderRadius","py","px","gap","width","slides","length","backgroundColor","theme","palette","mode","Array","map","_","idx","className","params","loop","isEnd","realIndex","undefined","height","transform","transition","margin","buttonProps","buttonSx","restButton","Button","fontSize","lineHeight","letterSpacing","getInteractiveStyle","onClick","slideTo","slideNext","_jsxs","component","fontWeight","color","mx","linesProps","lineProgress","lineProgressProps","lineSx","lineRest","lineProgressSx","lineProgressRest","xs","md","flexGrow","active","seen","minHeight","top","pointerEvents","overflow","role","opacity","transformOrigin","sliderProps","progressProps","__","_d","sliderSx","restSlider","value","setValue","useState","Math","round","progress","dragging","useRef","setRerender","useEffect","current","handleMove","on","off","my","Slider","min","max","onChange","newValue","setProgress","onChangeCommitted","slideToClosest","transitionDuration","speed","_e","carouselDragging","setCarouselDragging","handleDragStart","handleDragEnd","handleResize","thumbSize","wrapperEl","scrollWidth","size","ceil","SliderContainer","tabIndex","valueLabelDisplay","maxWidth","border","boxShadow","content"],"mappings":"qPAmFO,MAAMA,EAAwDC,EAAAA,WACnE,CAACC,EAAmEC,KAAnE,IAAEC,SAAUC,EAAYC,SAAEA,EAAQC,QAAEA,EAASC,GAAIC,GAAKP,EAAKQ,EAAIC,EAAAA,OAAAT,EAA/D,wCACC,MAAMU,EAAeC,EAAAA,cACfT,EAAWC,GAAgBO,EAE3BE,EAAmBC,EAAAA,QAAQ,KAC/B,OAAQR,GACN,IAAK,YACH,OAAOS,EACT,IAAK,SACH,OAAOC,EACT,IAAK,WACH,OAAOC,EACT,IAAK,QACH,OAAOC,EAGT,QACE,OAAOC,IAEV,CAACb,IAEEC,EAAKO,EAAAA,QAAoC,IAC5B,WAAbT,EACFe,OAAAC,OAAA,CACEhB,SAAU,WACViB,OAAQ,KACRC,OAAQ,IACRC,KAAM,IACNC,MAAO,KACJjB,GAGEA,EAER,CAACH,EAAUqB,KAAKC,UAAUnB,KAE7B,OAAOoB,EAAAA,IAACf,EAAgBO,OAAAC,OAAA,CAAClB,SAAUA,EAAUI,GAAIA,EAAIL,IAAKA,EAAKG,SAAUA,GAAcI,MAO9EU,EAAqDnB,EAAAA,WAChE,CAACC,EAAiEC,KAAjE,IAAAC,SAAEA,EAAQ0B,iBAAEA,EAAgBC,SAAEA,EAAQzB,SAAEA,EAAQE,GAAEA,GAAEN,EAAKQ,EAAIC,EAAAA,OAAAT,EAA7D,4DACC,MAAM8B,EAA4CF,QAAAA,EAAoB,IAA9DtB,GAAIyB,GAAaD,EAAKE,EAAevB,EAAAA,OAAAqB,EAAvC,CAAA,OACAG,EAA4BJ,QAAAA,EAAY,IAAtCvB,GAAI4B,GAAKD,EAAKE,EAAO1B,EAAAA,OAAAwB,EAAvB,CAAA,OAEN,OACEN,MAACS,EAAAA,IAAGjB,OAAAC,OAAA,CACFd,GAAEa,OAAAC,O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CACZnB,IAAKA,EACLC,SAAUA,EACV6E,UAAWiE,EAAAA,gBACXL,UAAWA,EACXrC,YAAWnF,OAAAC,OAAA,CAET6H,UAAU,EAEVC,kBAAmB,MACnB5I,GAAEa,OAAAC,OAAA,CAEA,oCAAqC,CACnC6D,MAAO,mBAET,mBAAkB9D,OAAAC,OAAAD,OAAAC,OAAA,CAChBkB,QAAS,OACTQ,MAAO,GAAG6F,MACVQ,SAAU,OACVpF,OAAQ,MACRqF,OAAQ,OACRnG,gBAAiB,kBAEjB,UAAW,CACTH,MAAO,GAAG6F,SAGPL,GAAoB,CACvBrE,WAAY,QAA+B,QAAvBwC,EAAgB,QAAhBxE,EAAA/B,aAAQ,EAARA,EAAUwD,cAAM,IAAAzB,OAAA,EAAAA,EAAEmG,aAAK,IAAA3B,EAAAA,EAAI,mBAC/C,CAEF,qBAAsB,CACpB4C,UAAW,OACX,WAAY,CACVC,QAAS,YAIZ5C,IAEFC,IAEDnG"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("tslib"),r=require("react/jsx-runtime"),i=require("react"),t=require("@mui/material"),s=require("../../node_modules/swiper/swiper-react.js");const a=i.forwardRef((i,a)=>{var{children:o,sx:
|
|
1
|
+
"use strict";var e=require("tslib"),r=require("react/jsx-runtime"),i=require("react"),t=require("@mui/material"),s=require("../../node_modules/swiper/swiper-react.js");const a=i.forwardRef((i,a)=>{var{children:o,sx:l}=i,n=e.__rest(i,["children","sx"]);const{params:d}=s.useSwiper();return r.jsx(t.Box,Object.assign({component:s.SwiperSlide,ref:a},n,{sx:Object.assign({display:"block",width:"auto"===(null==d?void 0:d.slidesPerView)?"auto":"100%",height:(null==d?void 0:d.autoHeight)?"auto":"100%",position:"relative",zIndex:"50",transform:"translate3d(0px, 0, 0)",flexShrink:"0",transitionProperty:"fade"===(null==d?void 0:d.effect)?"opacity":"transform","& img":{display:"block",maxWidth:"100%"}},l),children:o}))});a.displayName="SwiperSlide",exports.CarouselSlide=a;
|
|
2
2
|
//# sourceMappingURL=Slide.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slide.js","sources":["../../../../../src/components/carousel/Slide.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { Box, BoxProps } from '@mui/material';\nimport { SwiperSlide, SwiperSlideProps, useSwiper } from 'swiper/react';\n\nexport interface CarouselSlideProps\n extends Omit<SwiperSlideProps, 'children'>,\n Omit<BoxProps, keyof SwiperSlideProps | 'component'> {\n children?: BoxProps['children'];\n}\n\n/**\n * One slide in the carousel\n */\nexport const CarouselSlide: React.FC<CarouselSlideProps> = forwardRef(({ children, sx, ...rest }, ref) => {\n const {
|
|
1
|
+
{"version":3,"file":"Slide.js","sources":["../../../../../src/components/carousel/Slide.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { Box, BoxProps } from '@mui/material';\nimport { SwiperSlide, SwiperSlideProps, useSwiper } from 'swiper/react';\n\nexport interface CarouselSlideProps\n extends Omit<SwiperSlideProps, 'children'>,\n Omit<BoxProps, keyof SwiperSlideProps | 'component'> {\n children?: BoxProps['children'];\n}\n\n/**\n * One slide in the carousel\n */\nexport const CarouselSlide: React.FC<CarouselSlideProps> = forwardRef(({ children, sx, ...rest }, ref) => {\n const { params: swiperOptions } = useSwiper();\n\n return (\n <Box\n component={SwiperSlide}\n ref={ref}\n {...rest}\n sx={{\n display: 'block',\n width: swiperOptions?.slidesPerView === 'auto' ? 'auto' : '100%',\n height: swiperOptions?.autoHeight ? 'auto' : '100%',\n position: 'relative',\n zIndex: '50',\n transform: 'translate3d(0px, 0, 0)',\n flexShrink: '0',\n transitionProperty: swiperOptions?.effect === 'fade' ? 'opacity' : 'transform',\n '& img': {\n display: 'block',\n maxWidth: '100%',\n },\n ...sx,\n }}\n >\n {children}\n </Box>\n );\n});\nCarouselSlide.displayName = 'SwiperSlide';\n"],"names":["CarouselSlide","forwardRef","_a","ref","children","sx","rest","__rest","params","swiperOptions","useSwiper","_jsx","Box","Object","assign","component","SwiperSlide","display","width","slidesPerView","height","autoHeight","position","zIndex","transform","flexShrink","transitionProperty","effect","maxWidth","displayName"],"mappings":"wKAaO,MAAMA,EAA8CC,EAAAA,WAAW,CAACC,EAA2BC,SAA3BC,SAAEA,EAAQC,GAAEA,GAAEH,EAAKI,EAAIC,EAAAA,OAAAL,EAAvB,mBACrE,MAAQM,OAAQC,GAAkBC,cAElC,OACEC,EAAAA,IAACC,EAAAA,IAAGC,OAAAC,OAAA,CACFC,UAAWC,EAAAA,YACXb,IAAKA,GACDG,GACJD,GAAEQ,OAAAC,OAAA,CACAG,QAAS,QACTC,MAAwC,UAAjCT,eAAAA,EAAeU,eAA2B,OAAS,OAC1DC,QAAQX,aAAa,EAAbA,EAAeY,YAAa,OAAS,OAC7CC,SAAU,WACVC,OAAQ,KACRC,UAAW,yBACXC,WAAY,IACZC,mBAA8C,UAA1BjB,aAAa,EAAbA,EAAekB,QAAoB,UAAY,YACnE,QAAS,CACPV,QAAS,QACTW,SAAU,SAETvB,GAAED,SAGNA,OAIPJ,EAAc6B,YAAc"}
|
|
@@ -40,8 +40,6 @@ export interface PlayPauseButtonProps extends BoxProps<ElementType> {
|
|
|
40
40
|
*/
|
|
41
41
|
PlayIconComponent?: ComponentType<SvgIconProps>;
|
|
42
42
|
}
|
|
43
|
-
export interface VideoPlayPauseIndicatorProps extends PlayPauseButtonProps {
|
|
44
|
-
}
|
|
45
43
|
/**
|
|
46
44
|
* A component that displays a circular progress indicator with a play/pause button.
|
|
47
45
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlayPauseButton.js","sources":["../../../../../src/components/playPauseButton/PlayPauseButton.tsx"],"sourcesContent":["import React, { ComponentType, ElementType, forwardRef } from 'react';\nimport { Box, BoxProps, IconButton, IconButtonProps, SvgIconProps } from '@mui/material';\nimport { Spinner, SpinnerProps } from '@/src/components/progress/Spinner';\nimport { ControlsPlayIcon } from '@/src/components/icon/stroke/ControlsPlayIcon';\nimport { ControlsPauseIcon } from '@/src/components/icon/stroke/ControlsPauseIcon';\n\nexport interface PlayPauseButtonProps extends BoxProps<ElementType> {\n /**\n * Boolean to indicate if the media is currently playing\n */\n isPlaying: boolean;\n /**\n * Callback function to handle play/pause button click events.\n */\n onClick: BoxProps<ElementType>['onClick'];\n /**\n * The progress value for the CircularProgress component.\n * Should be a number between 0 and 100.\n */\n progress?: number;\n /**\n * Properties applied to Spinner progress\n */\n progressProps?: Omit<SpinnerProps, 'value'>;\n /**\n * Properties applied to IconButton\n */\n iconButtonProps?: Partial<IconButtonProps>;\n /**\n * Properties applied to Pause Icon component\n */\n pauseIconProps?: SvgIconProps;\n /**\n * Custom component to be used for PauseIcon\n */\n PauseIconComponent?: ComponentType<SvgIconProps>;\n /**\n * Properties applied to Play Icon component\n */\n playIconProps?: SvgIconProps;\n /**\n * Custom component to be used for PlayIcon\n */\n PlayIconComponent?: ComponentType<SvgIconProps>;\n}\
|
|
1
|
+
{"version":3,"file":"PlayPauseButton.js","sources":["../../../../../src/components/playPauseButton/PlayPauseButton.tsx"],"sourcesContent":["import React, { ComponentType, ElementType, forwardRef } from 'react';\nimport { Box, BoxProps, IconButton, IconButtonProps, SvgIconProps } from '@mui/material';\nimport { Spinner, SpinnerProps } from '@/src/components/progress/Spinner';\nimport { ControlsPlayIcon } from '@/src/components/icon/stroke/ControlsPlayIcon';\nimport { ControlsPauseIcon } from '@/src/components/icon/stroke/ControlsPauseIcon';\n\nexport interface PlayPauseButtonProps extends BoxProps<ElementType> {\n /**\n * Boolean to indicate if the media is currently playing\n */\n isPlaying: boolean;\n /**\n * Callback function to handle play/pause button click events.\n */\n onClick: BoxProps<ElementType>['onClick'];\n /**\n * The progress value for the CircularProgress component.\n * Should be a number between 0 and 100.\n */\n progress?: number;\n /**\n * Properties applied to Spinner progress\n */\n progressProps?: Omit<SpinnerProps, 'value'>;\n /**\n * Properties applied to IconButton\n */\n iconButtonProps?: Partial<IconButtonProps>;\n /**\n * Properties applied to Pause Icon component\n */\n pauseIconProps?: SvgIconProps;\n /**\n * Custom component to be used for PauseIcon\n */\n PauseIconComponent?: ComponentType<SvgIconProps>;\n /**\n * Properties applied to Play Icon component\n */\n playIconProps?: SvgIconProps;\n /**\n * Custom component to be used for PlayIcon\n */\n PlayIconComponent?: ComponentType<SvgIconProps>;\n}\n\n/**\n * A component that displays a circular progress indicator with a play/pause button.\n */\nexport const PlayPauseButton: React.FC<PlayPauseButtonProps> = forwardRef(\n (\n {\n progress = 0,\n isPlaying,\n onClick,\n progressProps,\n iconButtonProps,\n pauseIconProps,\n PauseIconComponent,\n playIconProps,\n PlayIconComponent,\n children,\n sx,\n ...rest\n },\n ref,\n ) => {\n const { sx: progressSx, ...restProgress } = progressProps || {};\n const { sx: iconButtonSx, ...restIconButton } = iconButtonProps || {};\n const PauseIcon = PauseIconComponent || ControlsPauseIcon;\n const PlayIcon = PlayIconComponent || ControlsPlayIcon;\n\n return (\n <Box\n data-testid=\"PlayPauseIndicator\"\n sx={{\n display: 'inline-flex',\n position: 'relative',\n zIndex: '150',\n width: '44px',\n height: '44px',\n ...sx,\n }}\n ref={ref}\n {...rest}\n >\n <Spinner\n value={progress}\n size={44}\n thickness={6}\n sx={{\n position: 'absolute',\n inset: '0',\n zIndex: '20',\n // start from 12'clock instead of 3'\n transform: 'rotate(-90deg)',\n // recolor\n '& .FlowSpinner-circle-primary': {\n stroke: (theme) => theme.palette.brand.secondary,\n },\n '& .FlowSpinner-circle-secondary': {\n stroke: (theme) => theme.palette.common.white,\n // main line is thicker than second one\n strokeWidth: '4px',\n },\n ...progressSx,\n }}\n {...restProgress}\n />\n <IconButton\n data-testid=\"IndicatorIconButton\"\n onClick={onClick}\n color=\"white\"\n size=\"medium\"\n sx={{ position: 'absolute', inset: '0', zIndex: '30', ...iconButtonSx }}\n aria-label={isPlaying ? 'Pause video' : 'Play video'}\n {...restIconButton}\n >\n {isPlaying ? (\n <PauseIcon data-testid=\"IndicatorPauseIcon\" {...pauseIconProps} />\n ) : (\n <PlayIcon data-testid=\"IndicatorPlayIcon\" {...playIconProps} />\n )}\n </IconButton>\n </Box>\n );\n },\n);\n"],"names":["PlayPauseButton","forwardRef","_a","ref","progress","isPlaying","onClick","progressProps","iconButtonProps","pauseIconProps","PauseIconComponent","playIconProps","PlayIconComponent","children","sx","rest","__rest","_b","progressSx","restProgress","_c","iconButtonSx","restIconButton","PauseIcon","ControlsPauseIcon","PlayIcon","ControlsPlayIcon","_jsxs","Box","Object","assign","display","position","zIndex","width","height","_jsx","Spinner","value","size","thickness","inset","transform","stroke","theme","palette","brand","secondary","common","white","strokeWidth","IconButton","color"],"mappings":"sPAiDO,MAAMA,EAAkDC,EAAAA,WAC7D,CACEC,EAcAC,KAdA,IAAAC,SACEA,EAAW,EAACC,UACZA,EAASC,QACTA,EAAOC,cACPA,EAAaC,gBACbA,EAAeC,eACfA,EAAcC,mBACdA,EAAkBC,cAClBA,EAAaC,kBACbA,EAAiBC,SACjBA,EAAQC,GACRA,GAAEZ,EACCa,EAAIC,EAAAA,OAAAd,EAZT,CAAA,WAAA,YAAA,UAAA,gBAAA,kBAAA,iBAAA,qBAAA,gBAAA,oBAAA,WAAA,OAgBA,MAAMe,EAAsCV,GAAiB,IAArDO,GAAII,KAAeC,EAAYH,EAAAA,OAAAC,EAAjC,CAAA,OACAG,EAA0CZ,GAAmB,IAA3DM,GAAIO,KAAiBC,EAAcN,EAAAA,OAAAI,EAArC,CAAA,OACAG,EAAYb,GAAsBc,EAAAA,kBAClCC,EAAWb,GAAqBc,EAAAA,iBAEtC,OACEC,OAACC,EAAAA,IAAGC,OAAAC,OAAA,CAAA,cACU,qBACZhB,GAAEe,OAAAC,OAAA,CACAC,QAAS,cACTC,SAAU,WACVC,OAAQ,MACRC,MAAO,OACPC,OAAQ,QACLrB,GAELX,IAAKA,GACDY,EAAI,CAAAF,SAAA,CAERuB,MAACC,EAAAA,QAAOR,OAAAC,OAAA,CACNQ,MAAOlC,EACPmC,KAAM,GACNC,UAAW,EACX1B,GAAEe,OAAAC,OAAA,CACAE,SAAU,WACVS,MAAO,IACPR,OAAQ,KAERS,UAAW,iBAEX,gCAAiC,CAC/BC,OAASC,GAAUA,EAAMC,QAAQC,MAAMC,WAEzC,kCAAmC,CACjCJ,OAASC,GAAUA,EAAMC,QAAQG,OAAOC,MAExCC,YAAa,QAEZhC,IAEDC,IAENiB,EAAAA,IAACe,EAAAA,WAAUtB,OAAAC,OAAA,CAAA,cACG,sBACZxB,QAASA,EACT8C,MAAM,QACNb,KAAK,SACLzB,GAAEe,OAAAC,OAAA,CAAIE,SAAU,WAAYS,MAAO,IAAKR,OAAQ,MAASZ,GAAY,aACzDhB,EAAY,cAAgB,cACpCiB,EAAc,CAAAT,SAEjBR,EACC+B,EAAAA,IAACb,EAASM,OAAAC,OAAA,CAAA,cAAa,sBAAyBrB,IAEhD2B,EAAAA,IAACX,EAAQI,OAAAC,OAAA,CAAA,cAAa,qBAAwBnB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var t=require("tslib"),r=require("react/jsx-runtime"),s=require("react"),e=require("@mui/material"),i=require("../icon/stroke/ArrowRightIcon.js"),n=require("../../materialui/button/interactive.js");const o=s.forwardRef((s,o)=>{var{IconComponent:a,iconProps:p,title:c,titleTypographyProps:x,subtitle:d,subtitleTypographyProps:l,dividerWrapperProps:u,dividerProps:b,contentWrapperProps:g,titleWrapperProps:m,buttonTitle:h,buttonProps:j,buttonIconProps:k,onClick:y,sx:f}=s,O=t.__rest(s,["IconComponent","iconProps","title","titleTypographyProps","subtitle","subtitleTypographyProps","dividerWrapperProps","dividerProps","contentWrapperProps","titleWrapperProps","buttonTitle","buttonProps","buttonIconProps","onClick","sx"]);const P=p||{},{sx:v}=P,I=t.__rest(P,["sx"]),_=u||{},{sx:B}=_,C=t.__rest(_,["sx"]),T=b||{},{sx:W}=T,
|
|
1
|
+
"use strict";var t=require("tslib"),r=require("react/jsx-runtime"),s=require("react"),e=require("@mui/material"),i=require("../icon/stroke/ArrowRightIcon.js"),n=require("../../materialui/button/interactive.js");const o=s.forwardRef((s,o)=>{var{IconComponent:a,iconProps:p,title:c,titleTypographyProps:x,subtitle:d,subtitleTypographyProps:l,dividerWrapperProps:u,dividerProps:b,contentWrapperProps:g,titleWrapperProps:m,buttonTitle:h,buttonProps:j,buttonIconProps:k,onClick:y,sx:f}=s,O=t.__rest(s,["IconComponent","iconProps","title","titleTypographyProps","subtitle","subtitleTypographyProps","dividerWrapperProps","dividerProps","contentWrapperProps","titleWrapperProps","buttonTitle","buttonProps","buttonIconProps","onClick","sx"]);const P=p||{},{sx:v}=P,I=t.__rest(P,["sx"]),_=u||{},{sx:B}=_,C=t.__rest(_,["sx"]),T=b||{},{sx:W}=T,w=t.__rest(T,["sx"]),L=g||{},{sx:Q}=L,S=t.__rest(L,["sx"]),q=m||{},{sx:M}=q,R=t.__rest(q,["sx"]);return r.jsxs(e.Stack,Object.assign({direction:"column",alignItems:"flex-start",sx:Object.assign(Object.assign({minWidth:"0",cursor:"pointer",color:"inherit",textDecoration:"unset",gap:{xs:"8px",md:"16px"}},n.getInteractiveStyle({hr:{backgroundColor:"text.primary",height:"1px"},".MuiButton-navigation":{backgroundColor:"transparent",color:t=>"dark"===t.palette.mode?"onSurface.os0":"onSurface.os900","& .MuiButton-startIcon":{transform:"translateX(0px)"},"& .MuiButton-endIcon":{transform:"translateX(0px)"}}},{hr:{backgroundColor:t=>"dark"===t.palette.mode?"brand.secondary":"brand.primary",height:"2px"},".MuiButton-navigation":{backgroundColor:"transparent",color:t=>"dark"===t.palette.mode?"onSurface.os300":"onSurface.os700",".MuiButton-startIcon":{transform:"translateX(-8px)"},".MuiButton-endIcon":{transform:"translateX(8px)"}}})),f),"data-testid":"QuickLink",ref:o},y&&{onClick:y,role:"button"},{tabIndex:-1},O,{children:[r.jsx(e.Box,Object.assign({sx:Object.assign({position:"relative",width:"100%",height:"2px","&&":{mb:{xs:0,md:a?0:2}}},B)},C,{children:r.jsx(e.Box,Object.assign({component:"hr",sx:Object.assign({border:"none",position:"absolute",inset:"0",m:0},W)},w))})),r.jsxs(e.Box,Object.assign({sx:Object.assign({width:"480px",maxWidth:"100%",pr:3,pt:{xs:"8px",md:"0px"}},Q)},S,{children:[r.jsxs(e.Stack,Object.assign({sx:Object.assign({flexDirection:{xs:"row",md:"column"},alignItems:{xs:"center",md:"flex-start"},gap:{xs:"4px",md:"18px"},mb:{xs:"4px",md:0}},M)},R,{children:[a&&r.jsx(a,Object.assign({sx:Object.assign({display:"block",fontSize:{xs:"20px",md:"35px"},mx:{xs:"2px",md:"0px"},my:{xs:"0px",md:"2px"}},v),"data-testid":"QuickLink.icon"},I)),c&&r.jsx(e.Typography,Object.assign({variant:"h4",display:"block","data-testid":"QuickLink.title",sx:{mb:{xs:0,md:.5}}},x,{children:c}))]})),d&&r.jsx(e.Typography,Object.assign({variant:"disclaimer1",display:"block","data-testid":"QuickLink.subtitle"},l,{children:d}))]})),h&&r.jsx(e.Button,Object.assign({variant:"navigation",color:"secondary",endIcon:r.jsx(i.ArrowRightIcon,{}),"data-testid":"QuickLink.button"},j,{children:h}))]}))}),a=s.forwardRef((s,i)=>{var{sx:n,children:o}=s,a=t.__rest(s,["sx","children"]);return r.jsx(e.Box,Object.assign({sx:Object.assign({display:"grid",gridTemplateColumns:{xs:"1fr",lg:"repeat(3, 1fr)"},gap:3},n),ref:i,"data-testid":"QuickLink.wrapper"},a,{children:o}))});exports.QuickLink=o,exports.QuickLinkWrapper=a;
|
|
2
2
|
//# sourceMappingURL=QuickLink.js.map
|