@pautena/react-design-system 0.14.2 → 0.14.4

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.
Files changed (129) hide show
  1. package/action/cjs/index.js.map +1 -1
  2. package/action/index.js.map +1 -1
  3. package/board/cjs/index.js.map +1 -1
  4. package/board/index.js.map +1 -1
  5. package/bootstrap-dialog/bootstrap-dialog.d.ts +1 -1
  6. package/bootstrap-dialog/cjs/index.js.map +1 -1
  7. package/bootstrap-dialog/index.js.map +1 -1
  8. package/cjs/index.js +2 -2
  9. package/cjs/index.js.map +1 -1
  10. package/confirm-dialog/cjs/index.js.map +1 -1
  11. package/confirm-dialog/confirm-dialog.d.ts +1 -1
  12. package/confirm-dialog/index.js.map +1 -1
  13. package/content-placeholder/cjs/index.js.map +1 -1
  14. package/content-placeholder/index.js.map +1 -1
  15. package/date-range-picker/cjs/index.js.map +1 -1
  16. package/date-range-picker/index.js.map +1 -1
  17. package/drawer/cjs/index.js.map +1 -1
  18. package/drawer/drawer.types.d.ts +3 -3
  19. package/drawer/index.js.map +1 -1
  20. package/drawer-app-bar/cjs/index.js.map +1 -1
  21. package/drawer-app-bar/index.js.map +1 -1
  22. package/drawer-content/cjs/index.js.map +1 -1
  23. package/drawer-content/drawer-content.d.ts +1 -1
  24. package/drawer-content/index.js.map +1 -1
  25. package/drawer-item/cjs/index.js.map +1 -1
  26. package/drawer-item/drawer-item-link.d.ts +1 -1
  27. package/drawer-item/drawer-item.d.ts +1 -1
  28. package/drawer-item/drawer-menu-item.d.ts +1 -1
  29. package/drawer-item/index.js.map +1 -1
  30. package/drawer-layout/cjs/index.js.map +1 -1
  31. package/drawer-layout/drawer-layout.d.ts +2 -2
  32. package/drawer-layout/index.js.map +1 -1
  33. package/drawer-main/cjs/index.js.map +1 -1
  34. package/drawer-main/index.js.map +1 -1
  35. package/drawer-provider/cjs/index.js.map +1 -1
  36. package/drawer-provider/drawer-context.d.ts +1 -1
  37. package/drawer-provider/drawer.provider.d.ts +1 -1
  38. package/drawer-provider/index.js.map +1 -1
  39. package/drawer-section/cjs/index.js.map +1 -1
  40. package/drawer-section/drawer-section.d.ts +1 -1
  41. package/drawer-section/index.js.map +1 -1
  42. package/drawer-subheader/cjs/index.js.map +1 -1
  43. package/drawer-subheader/drawer-subheader.d.ts +1 -1
  44. package/drawer-subheader/index.js.map +1 -1
  45. package/enhanced-remote-table/cjs/index.js.map +1 -1
  46. package/enhanced-remote-table/enhanced-remote-table.d.ts +1 -1
  47. package/enhanced-remote-table/enhanced-remote-table.mock.d.ts +2 -2
  48. package/enhanced-remote-table/index.js.map +1 -1
  49. package/expandable-alert/cjs/index.js.map +1 -1
  50. package/expandable-alert/index.js.map +1 -1
  51. package/form-dialog/cjs/index.js.map +1 -1
  52. package/form-dialog/form-dialog.d.ts +1 -1
  53. package/form-dialog/index.js.map +1 -1
  54. package/group-value-card/cjs/index.js.map +1 -1
  55. package/group-value-card/group-value-card.d.ts +1 -1
  56. package/group-value-card/index.js.map +1 -1
  57. package/header/cjs/index.js.map +1 -1
  58. package/header/index.js.map +1 -1
  59. package/header-layout/cjs/index.js.map +1 -1
  60. package/header-layout/header-layout.d.ts +3 -3
  61. package/header-layout/index.js.map +1 -1
  62. package/index.js +4 -4
  63. package/index.js.map +1 -1
  64. package/link-card/cjs/index.js.map +1 -1
  65. package/link-card/index.js.map +1 -1
  66. package/list-panel/cjs/index.js +1 -1
  67. package/list-panel/cjs/index.js.map +1 -1
  68. package/list-panel/cjs/package.json +2 -1
  69. package/list-panel/index.js +1 -1
  70. package/list-panel/index.js.map +1 -1
  71. package/list-panel/list-panel.d.ts +1 -0
  72. package/list-panel/list-panel.mocks.d.ts +1 -0
  73. package/list-panel/package.json +2 -1
  74. package/model-form/cjs/index.js.map +1 -1
  75. package/model-form/index.js.map +1 -1
  76. package/model-form/model-form-field.d.ts +1 -1
  77. package/model-form/model-form.d.ts +1 -1
  78. package/model-router/cjs/index.js +1 -1
  79. package/model-router/cjs/index.js.map +1 -1
  80. package/model-router/index.js +1 -1
  81. package/model-router/index.js.map +1 -1
  82. package/model-router/model-router.d.ts +1 -1
  83. package/model-router/screens/add-screen.d.ts +2 -2
  84. package/model-router/screens/details-screen.d.ts +2 -2
  85. package/model-router/screens/list-screen.d.ts +2 -2
  86. package/model-router/screens/screens.types.d.ts +1 -1
  87. package/model-router/screens/update-screen.d.ts +2 -2
  88. package/model-router/stories/templates.d.ts +7 -7
  89. package/object-details/cjs/index.js +1 -1
  90. package/object-details/cjs/index.js.map +1 -1
  91. package/object-details/index.js +1 -1
  92. package/object-details/index.js.map +1 -1
  93. package/object-details/object-details.d.ts +1 -1
  94. package/package.json +1 -1
  95. package/query-container/cjs/index.js.map +1 -1
  96. package/query-container/index.js.map +1 -1
  97. package/select/cjs/index.js.map +1 -1
  98. package/select/index.js.map +1 -1
  99. package/skeleton-grid/cjs/index.js.map +1 -1
  100. package/skeleton-grid/index.js.map +1 -1
  101. package/tab-card/cjs/index.js.map +1 -1
  102. package/tab-card/index.js.map +1 -1
  103. package/tab-panel/cjs/index.js.map +1 -1
  104. package/tab-panel/index.js.map +1 -1
  105. package/table-list/cjs/index.js.map +1 -1
  106. package/table-list/index.js.map +1 -1
  107. package/table-list/table-list.d.ts +2 -2
  108. package/value-boolean/cjs/index.js.map +1 -1
  109. package/value-boolean/index.js.map +1 -1
  110. package/value-boolean/value-boolean.d.ts +1 -1
  111. package/value-datetime/cjs/index.js.map +1 -1
  112. package/value-datetime/index.js.map +1 -1
  113. package/value-datetime/value-datetime.d.ts +1 -1
  114. package/value-image/cjs/index.js.map +1 -1
  115. package/value-image/index.js.map +1 -1
  116. package/value-image/value-image.d.ts +1 -1
  117. package/value-item/cjs/index.js.map +1 -1
  118. package/value-item/index.js.map +1 -1
  119. package/value-label/cjs/index.js.map +1 -1
  120. package/value-label/index.js.map +1 -1
  121. package/value-label/value-label.d.ts +2 -2
  122. package/value-rating/cjs/index.js.map +1 -1
  123. package/value-rating/index.js.map +1 -1
  124. package/value-rating/value-rating.d.ts +1 -1
  125. package/value-text/cjs/index.js +1 -1
  126. package/value-text/cjs/index.js.map +1 -1
  127. package/value-text/index.js +1 -1
  128. package/value-text/index.js.map +1 -1
  129. package/value-text/value-text.d.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/drawer-subheader/drawer-subheader.tsx","../../../src/drawer-provider/drawer-context.ts","../../../src/drawer/drawer.tsx","../../../src/drawer/drawer.types.ts","../../../src/bullet/bullet.tsx","../../../src/label/label.tsx","../../../src/link/link.tsx","../../../src/drawer-item/drawer-item-link.tsx","../../../src/drawer-item/drawer-item.tsx","../../../src/drawer-item/drawer-menu-item.tsx","../../../src/drawer-section/drawer-section.tsx","../../../src/drawer-content/drawer-content.tsx"],"sourcesContent":["import ListSubheader, { ListSubheaderProps } from \"@mui/material/ListSubheader\";\nimport { styled } from \"@mui/material/styles\";\nimport { DrawerSize } from \"~/drawer\";\n\nexport interface DrawerSubheaderProps extends ListSubheaderProps {\n /**\n * Item size. default to medium\n */\n size?: DrawerSize;\n}\n\nexport const DrawerSubheader = styled(ListSubheader, {\n shouldForwardProp: (prop) => prop !== \"size\",\n})<DrawerSubheaderProps>(({ size, theme }) => ({\n lineHeight: size === \"small\" ? theme.typography.pxToRem(40) : undefined,\n}));\n","import { useContext, createContext } from \"react\";\nimport { DrawerState, DrawerVariant } from \"~/drawer\";\n\nexport interface DrawerContextProps {\n selectedItemId?: string;\n state: DrawerState;\n variant: DrawerVariant;\n drawerWidth: number;\n underAppBar: boolean;\n switchState(): void;\n close(): void;\n collapse(): void;\n open(): void;\n setState: (state: DrawerState) => void;\n}\n\nexport const DrawerContext = createContext<DrawerContextProps | undefined>(undefined);\nexport const UndefinedProvider = new Error(\"DrawerContext.Provider is required and was undefined\");\n\nexport const useDrawer = () => {\n const context = useContext(DrawerContext);\n\n if (context === undefined) {\n throw UndefinedProvider;\n }\n\n return context;\n};\n","import { SxProps, Theme, styled, useTheme } from \"@mui/material/styles\";\nimport MuiDrawer, { drawerClasses } from \"@mui/material/Drawer\";\nimport { paperClasses } from \"@mui/material/Paper\";\nimport Divider from \"@mui/material/Divider\";\nimport IconButton from \"@mui/material/IconButton\";\nimport ChevronLeftIcon from \"@mui/icons-material/ChevronLeft\";\nimport { DrawerComponent, DrawerProps, DrawerState, DrawerVariant } from \"./drawer.types\";\nimport { useDrawer } from \"~/drawer-provider/drawer-context\";\nimport { closedMixin, openedMixin } from \"~/drawer-provider/drawer-mixins\";\n\nexport const DrawerHeader = styled(\"div\")(({ theme }) => ({\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"flex-end\",\n padding: theme.spacing(0, 1),\n ...theme.mixins.toolbar,\n}));\n\nconst showCloseButton: Record<DrawerVariant, boolean> = {\n temporary: true,\n mini: true,\n persistent: true,\n clipped: false,\n};\n\nconst muiDrawerVariant: Record<DrawerVariant, \"permanent\" | \"persistent\" | \"temporary\"> = {\n temporary: \"temporary\",\n mini: \"permanent\",\n clipped: \"permanent\",\n persistent: \"persistent\",\n};\n\ntype SxGenerator = (state: DrawerState, theme: Theme) => SxProps<Theme>;\nconst NoopSxGenerator = () => ({});\nconst variantsSx: Readonly<Record<DrawerVariant, SxGenerator>> = {\n mini: (state: DrawerState, theme: Theme) => ({\n boxSizing: \"border-box\",\n [`& .${paperClasses.root}`]: {\n zIndex: theme.zIndex.drawer - 1,\n },\n }),\n temporary: NoopSxGenerator,\n clipped: NoopSxGenerator,\n persistent: NoopSxGenerator,\n};\n\nexport const Drawer: DrawerComponent = ({ children, ...rest }: DrawerProps) => {\n const theme = useTheme();\n const { state, switchState, underAppBar, close, drawerWidth, variant } = useDrawer();\n\n const sx: any = {\n width: drawerWidth,\n flexShrink: 0,\n whiteSpace: \"nowrap\",\n ...(state === \"open\" && {\n ...openedMixin(theme),\n [`& .${drawerClasses.paper}`]: openedMixin(theme),\n }),\n ...(state !== \"open\" && {\n ...closedMixin(theme),\n [`& .${drawerClasses.paper}`]: closedMixin(theme),\n }),\n ...variantsSx[variant](state, theme),\n };\n\n return (\n <MuiDrawer\n open={state === \"open\"}\n variant={muiDrawerVariant[variant]}\n role=\"menu\"\n aria-hidden={state === \"close\"}\n onClose={close}\n sx={sx}\n {...rest}\n >\n <DrawerHeader>\n {!underAppBar && showCloseButton[variant] && (\n <IconButton onClick={switchState}>\n <ChevronLeftIcon />\n </IconButton>\n )}\n </DrawerHeader>\n <Divider />\n {children}\n </MuiDrawer>\n );\n};\n","import { FunctionComponent, ReactElement } from \"react\";\nimport { BulletVariant } from \"~/bullet\";\nimport { LabelVariant } from \"~/label\";\nimport { DrawerProps as MuiDrawerProps } from \"@mui/material/Drawer\";\nimport { Theme } from \"@mui/material/styles\";\nimport { DrawerAppBarProps } from \"~/drawer-app-bar\";\n\nexport type DrawerVariant = \"temporary\" | \"mini\" | \"persistent\" | \"clipped\";\nexport type DrawerState = \"open\" | \"collapse\" | \"close\";\nexport type DrawerSize = \"small\" | \"medium\";\n\nexport interface DrawerItemAvatar {\n src: string;\n alt: string;\n}\n\nexport interface DrawerItemLabel {\n text: string;\n variant: LabelVariant;\n}\n\nexport interface DrawerItemBullet {\n variant: BulletVariant;\n}\n\nexport interface DrawerNavigationItemLink {\n id: string;\n text: string;\n href: string;\n icon?: ReactElement;\n avatar?: DrawerItemAvatar;\n label?: DrawerItemLabel;\n bullet?: DrawerItemBullet;\n}\n\nexport type DrawerNavigationItemCollapsable = Pick<\n DrawerNavigationItemLink,\n \"id\" | \"text\" | \"icon\"\n> & {\n items: DrawerNavigationItem[];\n};\n\nexport type DrawerNavigationItem = DrawerNavigationItemLink | DrawerNavigationItemCollapsable;\n\nexport interface DrawerNavigationSection {\n title?: string;\n items: DrawerNavigationItem[];\n}\n\nexport interface DrawerNavigation {\n items: DrawerNavigationSection[];\n}\n\nexport interface DrawerContentProps {\n /**\n * Object with the content that has to be rendered\n */\n nav: DrawerNavigation;\n /**\n * Item size. default to medium\n */\n size?: DrawerSize;\n}\n\nexport type DrawerContentComponent = FunctionComponent<DrawerContentProps>;\nexport type DrawerContentElement = ReactElement<DrawerContentProps, DrawerContentComponent>;\n\nexport interface DrawerProps extends MuiDrawerProps {\n children: DrawerContentElement;\n}\n\nexport type DrawerComponent = FunctionComponent<DrawerProps>;\nexport type DrawerElement = ReactElement<DrawerProps, DrawerComponent>;\n\nexport const getDrawerItemColors = (theme: Theme, selected: boolean | undefined) => ({\n color: selected ? theme.palette.primary.main : undefined,\n fontWeight: selected ? theme.typography.fontWeightBold : theme.typography.fontWeightMedium,\n});\n\nexport type DrawerAppBarComponent = FunctionComponent<DrawerAppBarProps>;\nexport type DrawerAppBarElement = ReactElement<DrawerAppBarProps, DrawerAppBarComponent>;\n","import Badge from \"@mui/material/Badge\";\nimport { SxProps, Theme } from \"@mui/material/styles\";\n\nexport type BulletVariant = \"primary\" | \"secondary\" | \"default\" | \"info\" | \"warning\" | \"error\";\n\nexport const bulletClasses = {\n root: \"RdsBullet-root\",\n};\n\nexport interface BulletProps {\n /**\n * Color palette used to draw the component\n */\n variant?: BulletVariant;\n /**\n * Custom styles\n */\n sx?: SxProps<Theme>;\n}\n\n/**\n * Dot to attract the user attention\n */\nexport const Bullet = ({ variant = \"primary\", sx }: BulletProps) => {\n return (\n <Badge\n color={variant}\n variant=\"dot\"\n className={bulletClasses.root}\n role=\"bullet\"\n aria-describedby={variant}\n sx={sx}\n />\n );\n};\n","import Box from \"@mui/material/Box\";\nimport { SxProps, Theme, useTheme } from \"@mui/material/styles\";\n\nexport type LabelVariant =\n | \"primary\"\n | \"secondary\"\n | \"default\"\n | \"info\"\n | \"warning\"\n | \"error\"\n | \"success\";\n\nexport const labelClasses = {\n root: \"RdsLabel-root\",\n};\n\nexport interface LabelProps {\n /**\n * Content of the component\n */\n text: string;\n /**\n * Color palette used to draw the component\n */\n variant?: LabelVariant;\n\n /**\n * Custom styles\n */\n sx?: SxProps<Theme>;\n\n /**\n * Show the text as uppercase\n */\n textTransform?: \"none\" | \"capitalize\" | \"uppercase\";\n}\n\n/**\n * Compact element to represent a text\n */\nexport const Label = ({\n text,\n variant = \"default\",\n textTransform = \"capitalize\",\n sx,\n}: LabelProps) => {\n const { palette, typography } = useTheme();\n\n const backgroundColor: Record<LabelVariant, string> = {\n default: palette.mode === \"light\" ? palette.grey[100] : palette.grey[900],\n primary: palette.primary.light,\n secondary: palette.secondary.light,\n info: palette.info.light,\n warning: palette.warning.light,\n error: palette.error.light,\n success: palette.success.light,\n };\n\n const textColor: Record<LabelVariant, string> = {\n default: palette.getContrastText(backgroundColor.default),\n primary: palette.primary.contrastText,\n secondary: palette.secondary.contrastText,\n info: palette.info.contrastText,\n warning: palette.warning.contrastText,\n error: palette.error.contrastText,\n success: palette.success.contrastText,\n };\n\n return (\n <Box\n height={24}\n minWidth={22}\n display=\"inline-flex\"\n justifyContent=\"center\"\n alignItems=\"center\"\n bgcolor={backgroundColor[variant]}\n color={textColor[variant]}\n fontSize={typography.caption.fontSize}\n fontWeight={typography.fontWeightBold}\n lineHeight={0}\n textTransform={textTransform}\n whiteSpace=\"nowrap\"\n borderRadius={2}\n role=\"label\"\n aria-label={`${text} ${variant} label`}\n py={0}\n px={1}\n sx={{ cursor: \"default\", ...sx }}\n >\n {text}\n </Box>\n );\n};\n","import { Link as RouterLink, LinkProps as RouterLinkProps } from \"react-router-dom\";\nimport { forwardRef } from \"react\";\nimport MuiLink, { LinkProps } from \"@mui/material/Link\";\n\n/* eslint-disable react/display-name, @typescript-eslint/no-explicit-any */\nexport const LinkBehaviour = forwardRef<\n any,\n Omit<RouterLinkProps, \"to\"> & { href: RouterLinkProps[\"to\"] }\n>((props, ref) => {\n const { href, ...other } = props;\n return <RouterLink ref={ref} to={href} {...other} />;\n});\n\nexport const Link = forwardRef<any, LinkProps>((props, _1) => {\n return <MuiLink {...(props as any)} component={LinkBehaviour} />;\n});\n","import { ReactElement } from \"react\";\nimport Avatar from \"@mui/material/Avatar\";\nimport ListItemAvatar from \"@mui/material/ListItemAvatar\";\nimport ListItemButton from \"@mui/material/ListItemButton\";\nimport ListItemIcon from \"@mui/material/ListItemIcon\";\nimport ListItemText from \"@mui/material/ListItemText\";\nimport { SxProps, Theme, styled, useTheme } from \"@mui/material/styles\";\nimport { Bullet } from \"~/bullet\";\nimport { Label } from \"~/label\";\nimport {\n DrawerItemAvatar,\n DrawerItemBullet,\n DrawerItemLabel,\n DrawerSize,\n getDrawerItemColors,\n} from \"~/drawer/drawer.types\";\nimport { Link } from \"~/link\";\nimport { useDrawer } from \"~/drawer-provider\";\n\nexport interface DrawerItemLinkProps {\n /**\n * Item size. default to medium\n */\n size?: DrawerSize;\n /**\n * Text displayed inside the item\n */\n text: string;\n /**\n * Url where the user is going to be redirected\n * if the item is clicked\n */\n href: string;\n /**\n * Icon displayed to the left\n */\n icon?: ReactElement;\n /**\n * Avatar displayed to the left\n */\n avatar?: DrawerItemAvatar;\n /**\n * Label with extra info displayed to the right\n */\n label?: DrawerItemLabel;\n /**\n * Bullet to attract the user attention displyed to the right\n */\n bullet?: DrawerItemBullet;\n /**\n * The item has to be marked as selected\n */\n selected?: boolean;\n /**\n * Deep level of this item inside the submenus\n */\n level: number;\n /**\n * Custom styles\n */\n sx?: SxProps<Theme>;\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nconst StyledLink = styled(Link)(({ theme }) => {\n return {\n color: theme.palette.text.primary,\n };\n});\n\nconst sxCollapsedIcon = {\n minWidth: 0,\n justifyContent: \"center\",\n marginRight: \"auto\",\n};\n\n/**\n * Clicable item inside a drawer\n */\nexport const DrawerItemLink = ({\n text,\n icon,\n avatar,\n label,\n bullet,\n href,\n selected,\n size = \"medium\",\n level,\n sx,\n}: DrawerItemLinkProps) => {\n const { state } = useDrawer();\n const theme = useTheme();\n const { color, fontWeight } = getDrawerItemColors(theme, selected);\n\n return (\n <ListItemButton\n LinkComponent={StyledLink}\n dense={size === \"small\"}\n aria-label={text}\n href={href}\n selected={selected}\n sx={{\n ...sx,\n pl: state === \"open\" ? theme.spacing(2 + 1.5 * level) : undefined,\n ...(state === \"collapse\" && {\n paddingHorizontal: theme.spacing(2.5),\n justifyContent: \"center\",\n }),\n }}\n >\n {icon && (\n <ListItemIcon sx={{ color, ...(state === \"collapse\" && level === 0 && sxCollapsedIcon) }}>\n {icon}\n </ListItemIcon>\n )}\n {avatar && (\n <ListItemAvatar\n sx={{\n ...(state === \"collapse\" && level === 0 && sxCollapsedIcon),\n }}\n >\n <Avatar\n alt={avatar.alt}\n src={avatar.src}\n sx={{\n ...(size === \"small\" && { width: 24, height: 24 }),\n ...(state === \"collapse\" && { width: 30, height: 30 }),\n }}\n />\n </ListItemAvatar>\n )}\n <ListItemText\n disableTypography\n primary={text}\n sx={{ color, fontWeight, opacity: state === \"collapse\" && level === 0 ? 0 : undefined }}\n />\n {label && state === \"open\" && (\n <Label text={label.text} variant={label.variant} sx={{ ml: 2 }} />\n )}\n {bullet && state === \"open\" && <Bullet variant={bullet.variant} sx={{ ml: 2 }} />}\n </ListItemButton>\n );\n};\n","import { DrawerMenuItem } from \"./drawer-menu-item\";\nimport { DrawerNavigationItem, DrawerSize } from \"~/drawer/drawer.types\";\nimport { DrawerItemLink } from \"./drawer-item-link\";\nimport { useDrawer } from \"~/drawer-provider\";\n\nexport interface DrawerItemProps {\n /**\n * Data to be rendered\n */\n item: DrawerNavigationItem;\n /**\n * Size of the item\n */\n size?: DrawerSize;\n /**\n * Deep level of this item inside the submenus\n */\n level?: number;\n}\n\nexport const DrawerItem = ({ item, size = \"medium\", level = 0 }: DrawerItemProps) => {\n const { selectedItemId } = useDrawer();\n if (\"items\" in item) {\n const { id, text, icon, items } = item;\n const childrenSelected = items.some((item) => item.id === selectedItemId);\n return (\n <DrawerMenuItem\n size={size}\n selected={id === selectedItemId || childrenSelected}\n text={text}\n icon={icon}\n items={items}\n level={level}\n />\n );\n } else {\n const { id, text, icon, avatar, label, bullet, href } = item;\n return (\n <DrawerItemLink\n selected={id === selectedItemId}\n size={size}\n text={text}\n icon={icon}\n avatar={avatar}\n label={label}\n bullet={bullet}\n href={href}\n level={level}\n />\n );\n }\n};\n","import ListItemButton from \"@mui/material/ListItemButton\";\nimport ListItemIcon from \"@mui/material/ListItemIcon\";\nimport ListItemText from \"@mui/material/ListItemText\";\nimport Collapse from \"@mui/material/Collapse\";\nimport List from \"@mui/material/List\";\nimport Popover from \"@mui/material/Popover\";\nimport { SxProps, useTheme, Theme } from \"@mui/material/styles\";\nimport { ReactElement, useState, useRef } from \"react\";\nimport { DrawerNavigationItem, DrawerSize, getDrawerItemColors } from \"~/drawer\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\nimport ChevronRightIcon from \"@mui/icons-material/ChevronRight\";\nimport { DrawerItem } from \"./drawer-item\";\nimport { useDrawer } from \"~/drawer-provider\";\n\nexport interface DrawerMenuItemProps {\n /**\n * Item size. default to medium\n */\n size?: DrawerSize;\n /**\n * Text displayed inside the item\n */\n text: string;\n /**\n * Icon displayed to the left\n */\n icon?: ReactElement;\n /**\n * The item has to be marked as selected\n */\n selected?: boolean;\n /**\n * Items that are going to be displayed inside\n * the collapsable\n */\n items: DrawerNavigationItem[];\n /**\n * Deep level of this item inside the submenus\n */\n level: number;\n /**\n * Custom styles\n */\n sx?: SxProps<Theme>;\n}\n\nexport const DrawerMenuItem = ({\n text,\n icon,\n selected,\n items,\n size = \"medium\",\n level,\n sx = {},\n}: DrawerMenuItemProps) => {\n const { state } = useDrawer();\n const anchorEl = useRef<HTMLDivElement | null>(null);\n const { palette, spacing } = useTheme();\n const [menuOpen, setMenuOpen] = useState(false);\n const { color, fontWeight } = getDrawerItemColors(useTheme(), selected);\n\n const submenu = (\n <List component=\"div\" disablePadding>\n {items.map((item) => (\n <DrawerItem key={item.id} level={level + 1} item={item} size={size} />\n ))}\n </List>\n );\n\n const collapsedButtonSx =\n state === \"collapse\" && level === 0\n ? {\n position: \"absolute\",\n right: 0,\n }\n : {};\n\n return (\n <>\n <ListItemButton\n ref={anchorEl}\n selected={selected}\n aria-label={text}\n onClick={() => setMenuOpen((o) => !o)}\n dense={size === \"small\"}\n sx={{\n ...sx,\n pl: state === \"open\" ? spacing(2 + 1.5 * level) : undefined,\n backgroundColor: menuOpen ? palette.action.hover : undefined,\n }}\n >\n {icon && <ListItemIcon sx={{ color }}>{icon}</ListItemIcon>}\n <ListItemText\n disableTypography\n primary={text}\n sx={{ color, fontWeight, opacity: state === \"collapse\" && level === 0 ? 0 : undefined }}\n />\n {menuOpen && state === \"open\" ? (\n <ExpandMoreIcon sx={[{ color, ml: 2 }, collapsedButtonSx]} />\n ) : (\n <ChevronRightIcon sx={[{ color, ml: 2 }, collapsedButtonSx]} />\n )}\n </ListItemButton>\n {state === \"open\" ? (\n <Collapse\n in={menuOpen}\n timeout=\"auto\"\n unmountOnExit\n aria-label={`${text} collapse submenu`}\n >\n {submenu}\n </Collapse>\n ) : (\n <Popover\n open={menuOpen}\n PaperProps={{\n elevation: 0,\n variant: \"outlined\",\n }}\n aria-label={`${text} popover submenu`}\n anchorEl={anchorEl.current}\n onClose={() => setMenuOpen(false)}\n anchorOrigin={{\n vertical: \"top\",\n horizontal: \"right\",\n }}\n >\n {submenu}\n </Popover>\n )}\n </>\n );\n};\n","import List from \"@mui/material/List\";\nimport { useTheme } from \"@mui/material/styles\";\nimport { DrawerNavigationItem, DrawerSize } from \"~/drawer\";\nimport { DrawerSubheader } from \"~/drawer-subheader\";\nimport { DrawerItem } from \"~/drawer-item\";\nimport { useDrawer } from \"~/drawer-provider\";\n\nexport interface DrawerSectionProps {\n /**\n * Section title\n */\n title?: string;\n /**\n * List of items of that section\n */\n items: DrawerNavigationItem[];\n /**\n * Item size. default to medium\n */\n size?: DrawerSize;\n}\n\n/**\n * Render a group of items inside the drawer\n * with an optional title\n */\nexport const DrawerSection = ({ title, items, size = \"medium\" }: DrawerSectionProps) => {\n const { state } = useDrawer();\n const { spacing } = useTheme();\n return (\n <>\n {title && state === \"open\" && (\n <DrawerSubheader size={size} role=\"heading\">\n {title}\n </DrawerSubheader>\n )}\n <List\n sx={{\n paddingTop: size === \"small\" ? spacing(0) : undefined,\n paddingY: state === \"collapse\" ? 0 : undefined,\n }}\n >\n {items.map((item) => (\n <DrawerItem key={item.id} item={item} size={size} />\n ))}\n </List>\n </>\n );\n};\n","import { DrawerSection } from \"~/drawer-section\";\nimport { DrawerContentComponent, DrawerContentProps } from \"~/drawer\";\n\n/**\n * Content to be shown inside a navigation\n */\nexport const DrawerContent: DrawerContentComponent = ({\n nav: { items },\n size = \"medium\",\n}: DrawerContentProps) => {\n return (\n <>\n {items.map(({ title, items }, i) => (\n <DrawerSection key={i} title={title} items={items} size={size} />\n ))}\n </>\n );\n};\n"],"names":["DrawerSubheader","styled","ListSubheader","shouldForwardProp","prop","size","theme","lineHeight","typography","pxToRem","undefined","DrawerContext","createContext","UndefinedProvider","Error","useDrawer","context","useContext","display","alignItems","justifyContent","padding","spacing","mixins","toolbar","getDrawerItemColors","selected","color","palette","primary","main","fontWeight","fontWeightBold","fontWeightMedium","bulletClasses","Bullet","variant","sx","_jsx","Badge","className","role","Label","text","textTransform","useTheme","backgroundColor","default","mode","grey","light","secondary","info","warning","error","success","textColor","getContrastText","contrastText","Box","height","minWidth","bgcolor","fontSize","caption","whiteSpace","borderRadius","py","px","cursor","children","LinkBehaviour","forwardRef","props","ref","href","other","jsx","RouterLink","to","Link","_1","MuiLink","component","StyledLink","sxCollapsedIcon","marginRight","DrawerItemLink","icon","avatar","label","bullet","level","state","_jsxs","ListItemButton","LinkComponent","dense","pl","paddingHorizontal","ListItemIcon","ListItemAvatar","Avatar","alt","src","width","ListItemText","disableTypography","opacity","ml","DrawerItem","item","selectedItemId","id","items","childrenSelected","some","DrawerMenuItem","anchorEl","useRef","menuOpen","setMenuOpen","useState","submenu","List","disablePadding","map","collapsedButtonSx","position","right","_Fragment","onClick","o","action","hover","ExpandMoreIcon","ChevronRightIcon","Collapse","in","timeout","unmountOnExit","Popover","open","PaperProps","elevation","current","onClose","anchorOrigin","vertical","horizontal","DrawerSection","title","j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AmBiB,EAAQ,QAAKZ,EAC5CgJ,SAAoB,aAAV7D,EAAuB,OAAInF,GACtC4D,SAEA4C,EAAMY,KAAKf,GACVzE,EAACuC,IAAAiC,GAAyBC,KAAMA,EAAM1G,KAAMA,GAA3B0G,EAAKE,UAI5B,wBCzCiD,EACnD0C,KAAOzC,SACP7G,OAAO,YAGLiC,MACG4F,EAAAA,SAAA,CAAA5D,SAAA4C,EAAMY,KAAI,EAAGyB,QAAOrC,SAAS0C,IAC5BtH,EAAAA,IAACgH,EAAa,CAASC,MAAOA,EAAOrC,MAAOA,EAAO7G,KAAMA,GAArCuJ"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/drawer-subheader/drawer-subheader.tsx","../../../src/drawer-provider/drawer-context.ts","../../../src/drawer/drawer.tsx","../../../src/drawer/drawer.types.ts","../../../src/bullet/bullet.tsx","../../../src/label/label.tsx","../../../src/link/link.tsx","../../../src/drawer-item/drawer-item-link.tsx","../../../src/drawer-item/drawer-item.tsx","../../../src/drawer-item/drawer-menu-item.tsx","../../../src/drawer-section/drawer-section.tsx","../../../src/drawer-content/drawer-content.tsx"],"sourcesContent":["import ListSubheader, { ListSubheaderProps } from \"@mui/material/ListSubheader\";\nimport { styled } from \"@mui/material/styles\";\nimport { DrawerSize } from \"../drawer\";\n\nexport interface DrawerSubheaderProps extends ListSubheaderProps {\n /**\n * Item size. default to medium\n */\n size?: DrawerSize;\n}\n\nexport const DrawerSubheader = styled(ListSubheader, {\n shouldForwardProp: (prop) => prop !== \"size\",\n})<DrawerSubheaderProps>(({ size, theme }) => ({\n lineHeight: size === \"small\" ? theme.typography.pxToRem(40) : undefined,\n}));\n","import { useContext, createContext } from \"react\";\nimport { DrawerState, DrawerVariant } from \"../drawer\";\n\nexport interface DrawerContextProps {\n selectedItemId?: string;\n state: DrawerState;\n variant: DrawerVariant;\n drawerWidth: number;\n underAppBar: boolean;\n switchState(): void;\n close(): void;\n collapse(): void;\n open(): void;\n setState: (state: DrawerState) => void;\n}\n\nexport const DrawerContext = createContext<DrawerContextProps | undefined>(undefined);\nexport const UndefinedProvider = new Error(\"DrawerContext.Provider is required and was undefined\");\n\nexport const useDrawer = () => {\n const context = useContext(DrawerContext);\n\n if (context === undefined) {\n throw UndefinedProvider;\n }\n\n return context;\n};\n","import { SxProps, Theme, styled, useTheme } from \"@mui/material/styles\";\nimport MuiDrawer, { drawerClasses } from \"@mui/material/Drawer\";\nimport { paperClasses } from \"@mui/material/Paper\";\nimport Divider from \"@mui/material/Divider\";\nimport IconButton from \"@mui/material/IconButton\";\nimport ChevronLeftIcon from \"@mui/icons-material/ChevronLeft\";\nimport { DrawerComponent, DrawerProps, DrawerState, DrawerVariant } from \"./drawer.types\";\nimport { useDrawer } from \"../drawer-provider/drawer-context\";\nimport { closedMixin, openedMixin } from \"../drawer-provider/drawer-mixins\";\n\nexport const DrawerHeader = styled(\"div\")(({ theme }) => ({\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"flex-end\",\n padding: theme.spacing(0, 1),\n ...theme.mixins.toolbar,\n}));\n\nconst showCloseButton: Record<DrawerVariant, boolean> = {\n temporary: true,\n mini: true,\n persistent: true,\n clipped: false,\n};\n\nconst muiDrawerVariant: Record<DrawerVariant, \"permanent\" | \"persistent\" | \"temporary\"> = {\n temporary: \"temporary\",\n mini: \"permanent\",\n clipped: \"permanent\",\n persistent: \"persistent\",\n};\n\ntype SxGenerator = (state: DrawerState, theme: Theme) => SxProps<Theme>;\nconst NoopSxGenerator = () => ({});\nconst variantsSx: Readonly<Record<DrawerVariant, SxGenerator>> = {\n mini: (state: DrawerState, theme: Theme) => ({\n boxSizing: \"border-box\",\n [`& .${paperClasses.root}`]: {\n zIndex: theme.zIndex.drawer - 1,\n },\n }),\n temporary: NoopSxGenerator,\n clipped: NoopSxGenerator,\n persistent: NoopSxGenerator,\n};\n\nexport const Drawer: DrawerComponent = ({ children, ...rest }: DrawerProps) => {\n const theme = useTheme();\n const { state, switchState, underAppBar, close, drawerWidth, variant } = useDrawer();\n\n const sx: any = {\n width: drawerWidth,\n flexShrink: 0,\n whiteSpace: \"nowrap\",\n ...(state === \"open\" && {\n ...openedMixin(theme),\n [`& .${drawerClasses.paper}`]: openedMixin(theme),\n }),\n ...(state !== \"open\" && {\n ...closedMixin(theme),\n [`& .${drawerClasses.paper}`]: closedMixin(theme),\n }),\n ...variantsSx[variant](state, theme),\n };\n\n return (\n <MuiDrawer\n open={state === \"open\"}\n variant={muiDrawerVariant[variant]}\n role=\"menu\"\n aria-hidden={state === \"close\"}\n onClose={close}\n sx={sx}\n {...rest}\n >\n <DrawerHeader>\n {!underAppBar && showCloseButton[variant] && (\n <IconButton onClick={switchState}>\n <ChevronLeftIcon />\n </IconButton>\n )}\n </DrawerHeader>\n <Divider />\n {children}\n </MuiDrawer>\n );\n};\n","import { FunctionComponent, ReactElement } from \"react\";\nimport { BulletVariant } from \"../bullet\";\nimport { LabelVariant } from \"../label\";\nimport { DrawerProps as MuiDrawerProps } from \"@mui/material/Drawer\";\nimport { Theme } from \"@mui/material/styles\";\nimport { DrawerAppBarProps } from \"../drawer-app-bar\";\n\nexport type DrawerVariant = \"temporary\" | \"mini\" | \"persistent\" | \"clipped\";\nexport type DrawerState = \"open\" | \"collapse\" | \"close\";\nexport type DrawerSize = \"small\" | \"medium\";\n\nexport interface DrawerItemAvatar {\n src: string;\n alt: string;\n}\n\nexport interface DrawerItemLabel {\n text: string;\n variant: LabelVariant;\n}\n\nexport interface DrawerItemBullet {\n variant: BulletVariant;\n}\n\nexport interface DrawerNavigationItemLink {\n id: string;\n text: string;\n href: string;\n icon?: ReactElement;\n avatar?: DrawerItemAvatar;\n label?: DrawerItemLabel;\n bullet?: DrawerItemBullet;\n}\n\nexport type DrawerNavigationItemCollapsable = Pick<\n DrawerNavigationItemLink,\n \"id\" | \"text\" | \"icon\"\n> & {\n items: DrawerNavigationItem[];\n};\n\nexport type DrawerNavigationItem = DrawerNavigationItemLink | DrawerNavigationItemCollapsable;\n\nexport interface DrawerNavigationSection {\n title?: string;\n items: DrawerNavigationItem[];\n}\n\nexport interface DrawerNavigation {\n items: DrawerNavigationSection[];\n}\n\nexport interface DrawerContentProps {\n /**\n * Object with the content that has to be rendered\n */\n nav: DrawerNavigation;\n /**\n * Item size. default to medium\n */\n size?: DrawerSize;\n}\n\nexport type DrawerContentComponent = FunctionComponent<DrawerContentProps>;\nexport type DrawerContentElement = ReactElement<DrawerContentProps, DrawerContentComponent>;\n\nexport interface DrawerProps extends MuiDrawerProps {\n children: DrawerContentElement;\n}\n\nexport type DrawerComponent = FunctionComponent<DrawerProps>;\nexport type DrawerElement = ReactElement<DrawerProps, DrawerComponent>;\n\nexport const getDrawerItemColors = (theme: Theme, selected: boolean | undefined) => ({\n color: selected ? theme.palette.primary.main : undefined,\n fontWeight: selected ? theme.typography.fontWeightBold : theme.typography.fontWeightMedium,\n});\n\nexport type DrawerAppBarComponent = FunctionComponent<DrawerAppBarProps>;\nexport type DrawerAppBarElement = ReactElement<DrawerAppBarProps, DrawerAppBarComponent>;\n","import Badge from \"@mui/material/Badge\";\nimport { SxProps, Theme } from \"@mui/material/styles\";\n\nexport type BulletVariant = \"primary\" | \"secondary\" | \"default\" | \"info\" | \"warning\" | \"error\";\n\nexport const bulletClasses = {\n root: \"RdsBullet-root\",\n};\n\nexport interface BulletProps {\n /**\n * Color palette used to draw the component\n */\n variant?: BulletVariant;\n /**\n * Custom styles\n */\n sx?: SxProps<Theme>;\n}\n\n/**\n * Dot to attract the user attention\n */\nexport const Bullet = ({ variant = \"primary\", sx }: BulletProps) => {\n return (\n <Badge\n color={variant}\n variant=\"dot\"\n className={bulletClasses.root}\n role=\"bullet\"\n aria-describedby={variant}\n sx={sx}\n />\n );\n};\n","import Box from \"@mui/material/Box\";\nimport { SxProps, Theme, useTheme } from \"@mui/material/styles\";\n\nexport type LabelVariant =\n | \"primary\"\n | \"secondary\"\n | \"default\"\n | \"info\"\n | \"warning\"\n | \"error\"\n | \"success\";\n\nexport const labelClasses = {\n root: \"RdsLabel-root\",\n};\n\nexport interface LabelProps {\n /**\n * Content of the component\n */\n text: string;\n /**\n * Color palette used to draw the component\n */\n variant?: LabelVariant;\n\n /**\n * Custom styles\n */\n sx?: SxProps<Theme>;\n\n /**\n * Show the text as uppercase\n */\n textTransform?: \"none\" | \"capitalize\" | \"uppercase\";\n}\n\n/**\n * Compact element to represent a text\n */\nexport const Label = ({\n text,\n variant = \"default\",\n textTransform = \"capitalize\",\n sx,\n}: LabelProps) => {\n const { palette, typography } = useTheme();\n\n const backgroundColor: Record<LabelVariant, string> = {\n default: palette.mode === \"light\" ? palette.grey[100] : palette.grey[900],\n primary: palette.primary.light,\n secondary: palette.secondary.light,\n info: palette.info.light,\n warning: palette.warning.light,\n error: palette.error.light,\n success: palette.success.light,\n };\n\n const textColor: Record<LabelVariant, string> = {\n default: palette.getContrastText(backgroundColor.default),\n primary: palette.primary.contrastText,\n secondary: palette.secondary.contrastText,\n info: palette.info.contrastText,\n warning: palette.warning.contrastText,\n error: palette.error.contrastText,\n success: palette.success.contrastText,\n };\n\n return (\n <Box\n height={24}\n minWidth={22}\n display=\"inline-flex\"\n justifyContent=\"center\"\n alignItems=\"center\"\n bgcolor={backgroundColor[variant]}\n color={textColor[variant]}\n fontSize={typography.caption.fontSize}\n fontWeight={typography.fontWeightBold}\n lineHeight={0}\n textTransform={textTransform}\n whiteSpace=\"nowrap\"\n borderRadius={2}\n role=\"label\"\n aria-label={`${text} ${variant} label`}\n py={0}\n px={1}\n sx={{ cursor: \"default\", ...sx }}\n >\n {text}\n </Box>\n );\n};\n","import { Link as RouterLink, LinkProps as RouterLinkProps } from \"react-router-dom\";\nimport { forwardRef } from \"react\";\nimport MuiLink, { LinkProps } from \"@mui/material/Link\";\n\n/* eslint-disable react/display-name, @typescript-eslint/no-explicit-any */\nexport const LinkBehaviour = forwardRef<\n any,\n Omit<RouterLinkProps, \"to\"> & { href: RouterLinkProps[\"to\"] }\n>((props, ref) => {\n const { href, ...other } = props;\n return <RouterLink ref={ref} to={href} {...other} />;\n});\n\nexport const Link = forwardRef<any, LinkProps>((props, _1) => {\n return <MuiLink {...(props as any)} component={LinkBehaviour} />;\n});\n","import { ReactElement } from \"react\";\nimport Avatar from \"@mui/material/Avatar\";\nimport ListItemAvatar from \"@mui/material/ListItemAvatar\";\nimport ListItemButton from \"@mui/material/ListItemButton\";\nimport ListItemIcon from \"@mui/material/ListItemIcon\";\nimport ListItemText from \"@mui/material/ListItemText\";\nimport { SxProps, Theme, styled, useTheme } from \"@mui/material/styles\";\nimport { Bullet } from \"../bullet\";\nimport { Label } from \"../label\";\nimport {\n DrawerItemAvatar,\n DrawerItemBullet,\n DrawerItemLabel,\n DrawerSize,\n getDrawerItemColors,\n} from \"../drawer/drawer.types\";\nimport { Link } from \"../link\";\nimport { useDrawer } from \"../drawer-provider\";\n\nexport interface DrawerItemLinkProps {\n /**\n * Item size. default to medium\n */\n size?: DrawerSize;\n /**\n * Text displayed inside the item\n */\n text: string;\n /**\n * Url where the user is going to be redirected\n * if the item is clicked\n */\n href: string;\n /**\n * Icon displayed to the left\n */\n icon?: ReactElement;\n /**\n * Avatar displayed to the left\n */\n avatar?: DrawerItemAvatar;\n /**\n * Label with extra info displayed to the right\n */\n label?: DrawerItemLabel;\n /**\n * Bullet to attract the user attention displyed to the right\n */\n bullet?: DrawerItemBullet;\n /**\n * The item has to be marked as selected\n */\n selected?: boolean;\n /**\n * Deep level of this item inside the submenus\n */\n level: number;\n /**\n * Custom styles\n */\n sx?: SxProps<Theme>;\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nconst StyledLink = styled(Link)(({ theme }) => {\n return {\n color: theme.palette.text.primary,\n };\n});\n\nconst sxCollapsedIcon = {\n minWidth: 0,\n justifyContent: \"center\",\n marginRight: \"auto\",\n};\n\n/**\n * Clicable item inside a drawer\n */\nexport const DrawerItemLink = ({\n text,\n icon,\n avatar,\n label,\n bullet,\n href,\n selected,\n size = \"medium\",\n level,\n sx,\n}: DrawerItemLinkProps) => {\n const { state } = useDrawer();\n const theme = useTheme();\n const { color, fontWeight } = getDrawerItemColors(theme, selected);\n\n return (\n <ListItemButton\n LinkComponent={StyledLink}\n dense={size === \"small\"}\n aria-label={text}\n href={href}\n selected={selected}\n sx={{\n ...sx,\n pl: state === \"open\" ? theme.spacing(2 + 1.5 * level) : undefined,\n ...(state === \"collapse\" && {\n paddingHorizontal: theme.spacing(2.5),\n justifyContent: \"center\",\n }),\n }}\n >\n {icon && (\n <ListItemIcon sx={{ color, ...(state === \"collapse\" && level === 0 && sxCollapsedIcon) }}>\n {icon}\n </ListItemIcon>\n )}\n {avatar && (\n <ListItemAvatar\n sx={{\n ...(state === \"collapse\" && level === 0 && sxCollapsedIcon),\n }}\n >\n <Avatar\n alt={avatar.alt}\n src={avatar.src}\n sx={{\n ...(size === \"small\" && { width: 24, height: 24 }),\n ...(state === \"collapse\" && { width: 30, height: 30 }),\n }}\n />\n </ListItemAvatar>\n )}\n <ListItemText\n disableTypography\n primary={text}\n sx={{ color, fontWeight, opacity: state === \"collapse\" && level === 0 ? 0 : undefined }}\n />\n {label && state === \"open\" && (\n <Label text={label.text} variant={label.variant} sx={{ ml: 2 }} />\n )}\n {bullet && state === \"open\" && <Bullet variant={bullet.variant} sx={{ ml: 2 }} />}\n </ListItemButton>\n );\n};\n","import { DrawerMenuItem } from \"./drawer-menu-item\";\nimport { DrawerNavigationItem, DrawerSize } from \"../drawer/drawer.types\";\nimport { DrawerItemLink } from \"./drawer-item-link\";\nimport { useDrawer } from \"../drawer-provider\";\n\nexport interface DrawerItemProps {\n /**\n * Data to be rendered\n */\n item: DrawerNavigationItem;\n /**\n * Size of the item\n */\n size?: DrawerSize;\n /**\n * Deep level of this item inside the submenus\n */\n level?: number;\n}\n\nexport const DrawerItem = ({ item, size = \"medium\", level = 0 }: DrawerItemProps) => {\n const { selectedItemId } = useDrawer();\n if (\"items\" in item) {\n const { id, text, icon, items } = item;\n const childrenSelected = items.some((item) => item.id === selectedItemId);\n return (\n <DrawerMenuItem\n size={size}\n selected={id === selectedItemId || childrenSelected}\n text={text}\n icon={icon}\n items={items}\n level={level}\n />\n );\n } else {\n const { id, text, icon, avatar, label, bullet, href } = item;\n return (\n <DrawerItemLink\n selected={id === selectedItemId}\n size={size}\n text={text}\n icon={icon}\n avatar={avatar}\n label={label}\n bullet={bullet}\n href={href}\n level={level}\n />\n );\n }\n};\n","import ListItemButton from \"@mui/material/ListItemButton\";\nimport ListItemIcon from \"@mui/material/ListItemIcon\";\nimport ListItemText from \"@mui/material/ListItemText\";\nimport Collapse from \"@mui/material/Collapse\";\nimport List from \"@mui/material/List\";\nimport Popover from \"@mui/material/Popover\";\nimport { SxProps, useTheme, Theme } from \"@mui/material/styles\";\nimport { ReactElement, useState, useRef } from \"react\";\nimport { DrawerNavigationItem, DrawerSize, getDrawerItemColors } from \"../drawer\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\nimport ChevronRightIcon from \"@mui/icons-material/ChevronRight\";\nimport { DrawerItem } from \"./drawer-item\";\nimport { useDrawer } from \"../drawer-provider\";\n\nexport interface DrawerMenuItemProps {\n /**\n * Item size. default to medium\n */\n size?: DrawerSize;\n /**\n * Text displayed inside the item\n */\n text: string;\n /**\n * Icon displayed to the left\n */\n icon?: ReactElement;\n /**\n * The item has to be marked as selected\n */\n selected?: boolean;\n /**\n * Items that are going to be displayed inside\n * the collapsable\n */\n items: DrawerNavigationItem[];\n /**\n * Deep level of this item inside the submenus\n */\n level: number;\n /**\n * Custom styles\n */\n sx?: SxProps<Theme>;\n}\n\nexport const DrawerMenuItem = ({\n text,\n icon,\n selected,\n items,\n size = \"medium\",\n level,\n sx = {},\n}: DrawerMenuItemProps) => {\n const { state } = useDrawer();\n const anchorEl = useRef<HTMLDivElement | null>(null);\n const { palette, spacing } = useTheme();\n const [menuOpen, setMenuOpen] = useState(false);\n const { color, fontWeight } = getDrawerItemColors(useTheme(), selected);\n\n const submenu = (\n <List component=\"div\" disablePadding>\n {items.map((item) => (\n <DrawerItem key={item.id} level={level + 1} item={item} size={size} />\n ))}\n </List>\n );\n\n const collapsedButtonSx =\n state === \"collapse\" && level === 0\n ? {\n position: \"absolute\",\n right: 0,\n }\n : {};\n\n return (\n <>\n <ListItemButton\n ref={anchorEl}\n selected={selected}\n aria-label={text}\n onClick={() => setMenuOpen((o) => !o)}\n dense={size === \"small\"}\n sx={{\n ...sx,\n pl: state === \"open\" ? spacing(2 + 1.5 * level) : undefined,\n backgroundColor: menuOpen ? palette.action.hover : undefined,\n }}\n >\n {icon && <ListItemIcon sx={{ color }}>{icon}</ListItemIcon>}\n <ListItemText\n disableTypography\n primary={text}\n sx={{ color, fontWeight, opacity: state === \"collapse\" && level === 0 ? 0 : undefined }}\n />\n {menuOpen && state === \"open\" ? (\n <ExpandMoreIcon sx={[{ color, ml: 2 }, collapsedButtonSx]} />\n ) : (\n <ChevronRightIcon sx={[{ color, ml: 2 }, collapsedButtonSx]} />\n )}\n </ListItemButton>\n {state === \"open\" ? (\n <Collapse\n in={menuOpen}\n timeout=\"auto\"\n unmountOnExit\n aria-label={`${text} collapse submenu`}\n >\n {submenu}\n </Collapse>\n ) : (\n <Popover\n open={menuOpen}\n PaperProps={{\n elevation: 0,\n variant: \"outlined\",\n }}\n aria-label={`${text} popover submenu`}\n anchorEl={anchorEl.current}\n onClose={() => setMenuOpen(false)}\n anchorOrigin={{\n vertical: \"top\",\n horizontal: \"right\",\n }}\n >\n {submenu}\n </Popover>\n )}\n </>\n );\n};\n","import List from \"@mui/material/List\";\nimport { useTheme } from \"@mui/material/styles\";\nimport { DrawerNavigationItem, DrawerSize } from \"../drawer\";\nimport { DrawerSubheader } from \"../drawer-subheader\";\nimport { DrawerItem } from \"../drawer-item\";\nimport { useDrawer } from \"../drawer-provider\";\n\nexport interface DrawerSectionProps {\n /**\n * Section title\n */\n title?: string;\n /**\n * List of items of that section\n */\n items: DrawerNavigationItem[];\n /**\n * Item size. default to medium\n */\n size?: DrawerSize;\n}\n\n/**\n * Render a group of items inside the drawer\n * with an optional title\n */\nexport const DrawerSection = ({ title, items, size = \"medium\" }: DrawerSectionProps) => {\n const { state } = useDrawer();\n const { spacing } = useTheme();\n return (\n <>\n {title && state === \"open\" && (\n <DrawerSubheader size={size} role=\"heading\">\n {title}\n </DrawerSubheader>\n )}\n <List\n sx={{\n paddingTop: size === \"small\" ? spacing(0) : undefined,\n paddingY: state === \"collapse\" ? 0 : undefined,\n }}\n >\n {items.map((item) => (\n <DrawerItem key={item.id} item={item} size={size} />\n ))}\n </List>\n </>\n );\n};\n","import { DrawerSection } from \"../drawer-section\";\nimport { DrawerContentComponent, DrawerContentProps } from \"../drawer\";\n\n/**\n * Content to be shown inside a navigation\n */\nexport const DrawerContent: DrawerContentComponent = ({\n nav: { items },\n size = \"medium\",\n}: DrawerContentProps) => {\n return (\n <>\n {items.map(({ title, items }, i) => (\n <DrawerSection key={i} title={title} items={items} size={size} />\n ))}\n </>\n );\n};\n"],"names":["DrawerSubheader","styled","ListSubheader","shouldForwardProp","prop","size","theme","lineHeight","typography","pxToRem","undefined","DrawerContext","createContext","UndefinedProvider","Error","useDrawer","context","useContext","display","alignItems","justifyContent","padding","spacing","mixins","toolbar","getDrawerItemColors","selected","color","palette","primary","main","fontWeight","fontWeightBold","fontWeightMedium","bulletClasses","Bullet","variant","sx","_jsx","Badge","className","role","Label","text","textTransform","useTheme","backgroundColor","default","mode","grey","light","secondary","info","warning","error","success","textColor","getContrastText","contrastText","Box","height","minWidth","bgcolor","fontSize","caption","whiteSpace","borderRadius","py","px","cursor","children","LinkBehaviour","forwardRef","props","ref","href","other","jsx","RouterLink","to","Link","_1","MuiLink","component","StyledLink","sxCollapsedIcon","marginRight","DrawerItemLink","icon","avatar","label","bullet","level","state","_jsxs","ListItemButton","LinkComponent","dense","pl","paddingHorizontal","ListItemIcon","ListItemAvatar","Avatar","alt","src","width","ListItemText","disableTypography","opacity","ml","DrawerItem","item","selectedItemId","id","items","childrenSelected","some","DrawerMenuItem","anchorEl","useRef","menuOpen","setMenuOpen","useState","submenu","List","disablePadding","map","collapsedButtonSx","position","right","_Fragment","onClick","o","action","hover","ExpandMoreIcon","ChevronRightIcon","Collapse","in","timeout","unmountOnExit","Popover","open","PaperProps","elevation","current","onClose","anchorOrigin","vertical","horizontal","DrawerSection","title","jsxs","paddingTop","paddingY","nav","i"],"mappings":"2iCAWO,MAAMA,EAAkBC,EAAMA,OAACC,UAAe,CACnDC,kBAAoBC,GAAkB,SAATA,GADAH,EAEN,EAAGI,OAAMC,YAAa,CAC7CC,WAAqB,UAATF,EAAmBC,EAAME,WAAWC,QAAQ,SAAMC,MCEnDC,EAAgBC,EAAAA,mBAA8CF,GAC9DG,EAAoB,IAAIC,MAAM,wDAE9BC,EAAY,KACvB,MAAMC,EAAUC,aAAWN,GAE3B,QAAgBD,IAAZM,EACF,MAAMH,EAGR,OAAOG,CAAO,EChBYf,EAAMA,OAAC,MAAPA,EAAc,EAAGK,YAAa,CACxDY,QAAS,OACTC,WAAY,SACZC,eAAgB,WAChBC,QAASf,EAAMgB,QAAQ,EAAG,MACvBhB,EAAMiB,OAAOC,YC2DX,MAAMC,EAAsB,CAACnB,EAAcoB,KAAmC,CACnFC,MAAOD,EAAWpB,EAAMsB,QAAQC,QAAQC,UAAOpB,EAC/CqB,WAAYL,EAAWpB,EAAME,WAAWwB,eAAiB1B,EAAME,WAAWyB,mBCvE/DC,EACL,iBAiBKC,EAAS,EAAGC,UAAU,UAAWC,QAE1CC,EAAAA,IAACC,EAAAA,QAAK,CACJZ,MAAOS,EACPA,QAAQ,MACRI,UAAWN,EACXO,KAAK,SAAQ,mBACKL,EAClBC,GAAIA,ICSGK,EAAQ,EACnBC,OACAP,UAAU,UACVQ,gBAAgB,aAChBP,SAEA,MAAMT,QAAEA,EAAOpB,WAAEA,GAAeqC,EAAQA,WAElCC,EAAgD,CACpDC,QAA0B,UAAjBnB,EAAQoB,KAAmBpB,EAAQqB,KAAK,KAAOrB,EAAQqB,KAAK,KACrEpB,QA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,WAAA,CAAA5D,SAAA,CACGiF,GAAmB,SAAV1D,GACRvD,EAAAuC,IAAC7E,EAAe,CAACK,KAAMA,EAAMoC,KAAK,UAAS6B,SACxCiF,IAGLjH,EAACuC,IAAA+C,UACC,CAAAvF,GAAI,CACFoH,WAAqB,UAATpJ,EAAmBiB,EAAQ,QAAKZ,EAC5CgJ,SAAoB,aAAV7D,EAAuB,OAAInF,GACtC4D,SAEA4C,EAAMY,KAAKf,GACVzE,EAACuC,IAAAiC,GAAyBC,KAAMA,EAAM1G,KAAMA,GAA3B0G,EAAKE,UAI5B,wBCzCiD,EACnD0C,KAAOzC,SACP7G,OAAO,YAGLiC,MACG4F,EAAAA,SAAA,CAAA5D,SAAA4C,EAAMY,KAAI,EAAGyB,QAAOrC,SAAS0C,IAC5BtH,EAAAA,IAACgH,EAAa,CAASC,MAAOA,EAAOrC,MAAOA,EAAO7G,KAAMA,GAArCuJ"}
@@ -1,4 +1,4 @@
1
- import { DrawerContentComponent } from "~/drawer";
1
+ import { DrawerContentComponent } from "../drawer";
2
2
  /**
3
3
  * Content to be shown inside a navigation
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/drawer-subheader/drawer-subheader.tsx","../../src/drawer-provider/drawer-context.ts","../../src/drawer/drawer.tsx","../../src/drawer/drawer.types.ts","../../src/bullet/bullet.tsx","../../src/label/label.tsx","../../src/link/link.tsx","../../src/drawer-item/drawer-item-link.tsx","../../src/drawer-item/drawer-item.tsx","../../src/drawer-item/drawer-menu-item.tsx","../../src/drawer-section/drawer-section.tsx","../../src/drawer-content/drawer-content.tsx"],"sourcesContent":["import ListSubheader, { ListSubheaderProps } from \"@mui/material/ListSubheader\";\nimport { styled } from \"@mui/material/styles\";\nimport { DrawerSize } from \"~/drawer\";\n\nexport interface DrawerSubheaderProps extends ListSubheaderProps {\n /**\n * Item size. default to medium\n */\n size?: DrawerSize;\n}\n\nexport const DrawerSubheader = styled(ListSubheader, {\n shouldForwardProp: (prop) => prop !== \"size\",\n})<DrawerSubheaderProps>(({ size, theme }) => ({\n lineHeight: size === \"small\" ? theme.typography.pxToRem(40) : undefined,\n}));\n","import { useContext, createContext } from \"react\";\nimport { DrawerState, DrawerVariant } from \"~/drawer\";\n\nexport interface DrawerContextProps {\n selectedItemId?: string;\n state: DrawerState;\n variant: DrawerVariant;\n drawerWidth: number;\n underAppBar: boolean;\n switchState(): void;\n close(): void;\n collapse(): void;\n open(): void;\n setState: (state: DrawerState) => void;\n}\n\nexport const DrawerContext = createContext<DrawerContextProps | undefined>(undefined);\nexport const UndefinedProvider = new Error(\"DrawerContext.Provider is required and was undefined\");\n\nexport const useDrawer = () => {\n const context = useContext(DrawerContext);\n\n if (context === undefined) {\n throw UndefinedProvider;\n }\n\n return context;\n};\n","import { SxProps, Theme, styled, useTheme } from \"@mui/material/styles\";\nimport MuiDrawer, { drawerClasses } from \"@mui/material/Drawer\";\nimport { paperClasses } from \"@mui/material/Paper\";\nimport Divider from \"@mui/material/Divider\";\nimport IconButton from \"@mui/material/IconButton\";\nimport ChevronLeftIcon from \"@mui/icons-material/ChevronLeft\";\nimport { DrawerComponent, DrawerProps, DrawerState, DrawerVariant } from \"./drawer.types\";\nimport { useDrawer } from \"~/drawer-provider/drawer-context\";\nimport { closedMixin, openedMixin } from \"~/drawer-provider/drawer-mixins\";\n\nexport const DrawerHeader = styled(\"div\")(({ theme }) => ({\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"flex-end\",\n padding: theme.spacing(0, 1),\n ...theme.mixins.toolbar,\n}));\n\nconst showCloseButton: Record<DrawerVariant, boolean> = {\n temporary: true,\n mini: true,\n persistent: true,\n clipped: false,\n};\n\nconst muiDrawerVariant: Record<DrawerVariant, \"permanent\" | \"persistent\" | \"temporary\"> = {\n temporary: \"temporary\",\n mini: \"permanent\",\n clipped: \"permanent\",\n persistent: \"persistent\",\n};\n\ntype SxGenerator = (state: DrawerState, theme: Theme) => SxProps<Theme>;\nconst NoopSxGenerator = () => ({});\nconst variantsSx: Readonly<Record<DrawerVariant, SxGenerator>> = {\n mini: (state: DrawerState, theme: Theme) => ({\n boxSizing: \"border-box\",\n [`& .${paperClasses.root}`]: {\n zIndex: theme.zIndex.drawer - 1,\n },\n }),\n temporary: NoopSxGenerator,\n clipped: NoopSxGenerator,\n persistent: NoopSxGenerator,\n};\n\nexport const Drawer: DrawerComponent = ({ children, ...rest }: DrawerProps) => {\n const theme = useTheme();\n const { state, switchState, underAppBar, close, drawerWidth, variant } = useDrawer();\n\n const sx: any = {\n width: drawerWidth,\n flexShrink: 0,\n whiteSpace: \"nowrap\",\n ...(state === \"open\" && {\n ...openedMixin(theme),\n [`& .${drawerClasses.paper}`]: openedMixin(theme),\n }),\n ...(state !== \"open\" && {\n ...closedMixin(theme),\n [`& .${drawerClasses.paper}`]: closedMixin(theme),\n }),\n ...variantsSx[variant](state, theme),\n };\n\n return (\n <MuiDrawer\n open={state === \"open\"}\n variant={muiDrawerVariant[variant]}\n role=\"menu\"\n aria-hidden={state === \"close\"}\n onClose={close}\n sx={sx}\n {...rest}\n >\n <DrawerHeader>\n {!underAppBar && showCloseButton[variant] && (\n <IconButton onClick={switchState}>\n <ChevronLeftIcon />\n </IconButton>\n )}\n </DrawerHeader>\n <Divider />\n {children}\n </MuiDrawer>\n );\n};\n","import { FunctionComponent, ReactElement } from \"react\";\nimport { BulletVariant } from \"~/bullet\";\nimport { LabelVariant } from \"~/label\";\nimport { DrawerProps as MuiDrawerProps } from \"@mui/material/Drawer\";\nimport { Theme } from \"@mui/material/styles\";\nimport { DrawerAppBarProps } from \"~/drawer-app-bar\";\n\nexport type DrawerVariant = \"temporary\" | \"mini\" | \"persistent\" | \"clipped\";\nexport type DrawerState = \"open\" | \"collapse\" | \"close\";\nexport type DrawerSize = \"small\" | \"medium\";\n\nexport interface DrawerItemAvatar {\n src: string;\n alt: string;\n}\n\nexport interface DrawerItemLabel {\n text: string;\n variant: LabelVariant;\n}\n\nexport interface DrawerItemBullet {\n variant: BulletVariant;\n}\n\nexport interface DrawerNavigationItemLink {\n id: string;\n text: string;\n href: string;\n icon?: ReactElement;\n avatar?: DrawerItemAvatar;\n label?: DrawerItemLabel;\n bullet?: DrawerItemBullet;\n}\n\nexport type DrawerNavigationItemCollapsable = Pick<\n DrawerNavigationItemLink,\n \"id\" | \"text\" | \"icon\"\n> & {\n items: DrawerNavigationItem[];\n};\n\nexport type DrawerNavigationItem = DrawerNavigationItemLink | DrawerNavigationItemCollapsable;\n\nexport interface DrawerNavigationSection {\n title?: string;\n items: DrawerNavigationItem[];\n}\n\nexport interface DrawerNavigation {\n items: DrawerNavigationSection[];\n}\n\nexport interface DrawerContentProps {\n /**\n * Object with the content that has to be rendered\n */\n nav: DrawerNavigation;\n /**\n * Item size. default to medium\n */\n size?: DrawerSize;\n}\n\nexport type DrawerContentComponent = FunctionComponent<DrawerContentProps>;\nexport type DrawerContentElement = ReactElement<DrawerContentProps, DrawerContentComponent>;\n\nexport interface DrawerProps extends MuiDrawerProps {\n children: DrawerContentElement;\n}\n\nexport type DrawerComponent = FunctionComponent<DrawerProps>;\nexport type DrawerElement = ReactElement<DrawerProps, DrawerComponent>;\n\nexport const getDrawerItemColors = (theme: Theme, selected: boolean | undefined) => ({\n color: selected ? theme.palette.primary.main : undefined,\n fontWeight: selected ? theme.typography.fontWeightBold : theme.typography.fontWeightMedium,\n});\n\nexport type DrawerAppBarComponent = FunctionComponent<DrawerAppBarProps>;\nexport type DrawerAppBarElement = ReactElement<DrawerAppBarProps, DrawerAppBarComponent>;\n","import Badge from \"@mui/material/Badge\";\nimport { SxProps, Theme } from \"@mui/material/styles\";\n\nexport type BulletVariant = \"primary\" | \"secondary\" | \"default\" | \"info\" | \"warning\" | \"error\";\n\nexport const bulletClasses = {\n root: \"RdsBullet-root\",\n};\n\nexport interface BulletProps {\n /**\n * Color palette used to draw the component\n */\n variant?: BulletVariant;\n /**\n * Custom styles\n */\n sx?: SxProps<Theme>;\n}\n\n/**\n * Dot to attract the user attention\n */\nexport const Bullet = ({ variant = \"primary\", sx }: BulletProps) => {\n return (\n <Badge\n color={variant}\n variant=\"dot\"\n className={bulletClasses.root}\n role=\"bullet\"\n aria-describedby={variant}\n sx={sx}\n />\n );\n};\n","import Box from \"@mui/material/Box\";\nimport { SxProps, Theme, useTheme } from \"@mui/material/styles\";\n\nexport type LabelVariant =\n | \"primary\"\n | \"secondary\"\n | \"default\"\n | \"info\"\n | \"warning\"\n | \"error\"\n | \"success\";\n\nexport const labelClasses = {\n root: \"RdsLabel-root\",\n};\n\nexport interface LabelProps {\n /**\n * Content of the component\n */\n text: string;\n /**\n * Color palette used to draw the component\n */\n variant?: LabelVariant;\n\n /**\n * Custom styles\n */\n sx?: SxProps<Theme>;\n\n /**\n * Show the text as uppercase\n */\n textTransform?: \"none\" | \"capitalize\" | \"uppercase\";\n}\n\n/**\n * Compact element to represent a text\n */\nexport const Label = ({\n text,\n variant = \"default\",\n textTransform = \"capitalize\",\n sx,\n}: LabelProps) => {\n const { palette, typography } = useTheme();\n\n const backgroundColor: Record<LabelVariant, string> = {\n default: palette.mode === \"light\" ? palette.grey[100] : palette.grey[900],\n primary: palette.primary.light,\n secondary: palette.secondary.light,\n info: palette.info.light,\n warning: palette.warning.light,\n error: palette.error.light,\n success: palette.success.light,\n };\n\n const textColor: Record<LabelVariant, string> = {\n default: palette.getContrastText(backgroundColor.default),\n primary: palette.primary.contrastText,\n secondary: palette.secondary.contrastText,\n info: palette.info.contrastText,\n warning: palette.warning.contrastText,\n error: palette.error.contrastText,\n success: palette.success.contrastText,\n };\n\n return (\n <Box\n height={24}\n minWidth={22}\n display=\"inline-flex\"\n justifyContent=\"center\"\n alignItems=\"center\"\n bgcolor={backgroundColor[variant]}\n color={textColor[variant]}\n fontSize={typography.caption.fontSize}\n fontWeight={typography.fontWeightBold}\n lineHeight={0}\n textTransform={textTransform}\n whiteSpace=\"nowrap\"\n borderRadius={2}\n role=\"label\"\n aria-label={`${text} ${variant} label`}\n py={0}\n px={1}\n sx={{ cursor: \"default\", ...sx }}\n >\n {text}\n </Box>\n );\n};\n","import { Link as RouterLink, LinkProps as RouterLinkProps } from \"react-router-dom\";\nimport { forwardRef } from \"react\";\nimport MuiLink, { LinkProps } from \"@mui/material/Link\";\n\n/* eslint-disable react/display-name, @typescript-eslint/no-explicit-any */\nexport const LinkBehaviour = forwardRef<\n any,\n Omit<RouterLinkProps, \"to\"> & { href: RouterLinkProps[\"to\"] }\n>((props, ref) => {\n const { href, ...other } = props;\n return <RouterLink ref={ref} to={href} {...other} />;\n});\n\nexport const Link = forwardRef<any, LinkProps>((props, _1) => {\n return <MuiLink {...(props as any)} component={LinkBehaviour} />;\n});\n","import { ReactElement } from \"react\";\nimport Avatar from \"@mui/material/Avatar\";\nimport ListItemAvatar from \"@mui/material/ListItemAvatar\";\nimport ListItemButton from \"@mui/material/ListItemButton\";\nimport ListItemIcon from \"@mui/material/ListItemIcon\";\nimport ListItemText from \"@mui/material/ListItemText\";\nimport { SxProps, Theme, styled, useTheme } from \"@mui/material/styles\";\nimport { Bullet } from \"~/bullet\";\nimport { Label } from \"~/label\";\nimport {\n DrawerItemAvatar,\n DrawerItemBullet,\n DrawerItemLabel,\n DrawerSize,\n getDrawerItemColors,\n} from \"~/drawer/drawer.types\";\nimport { Link } from \"~/link\";\nimport { useDrawer } from \"~/drawer-provider\";\n\nexport interface DrawerItemLinkProps {\n /**\n * Item size. default to medium\n */\n size?: DrawerSize;\n /**\n * Text displayed inside the item\n */\n text: string;\n /**\n * Url where the user is going to be redirected\n * if the item is clicked\n */\n href: string;\n /**\n * Icon displayed to the left\n */\n icon?: ReactElement;\n /**\n * Avatar displayed to the left\n */\n avatar?: DrawerItemAvatar;\n /**\n * Label with extra info displayed to the right\n */\n label?: DrawerItemLabel;\n /**\n * Bullet to attract the user attention displyed to the right\n */\n bullet?: DrawerItemBullet;\n /**\n * The item has to be marked as selected\n */\n selected?: boolean;\n /**\n * Deep level of this item inside the submenus\n */\n level: number;\n /**\n * Custom styles\n */\n sx?: SxProps<Theme>;\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nconst StyledLink = styled(Link)(({ theme }) => {\n return {\n color: theme.palette.text.primary,\n };\n});\n\nconst sxCollapsedIcon = {\n minWidth: 0,\n justifyContent: \"center\",\n marginRight: \"auto\",\n};\n\n/**\n * Clicable item inside a drawer\n */\nexport const DrawerItemLink = ({\n text,\n icon,\n avatar,\n label,\n bullet,\n href,\n selected,\n size = \"medium\",\n level,\n sx,\n}: DrawerItemLinkProps) => {\n const { state } = useDrawer();\n const theme = useTheme();\n const { color, fontWeight } = getDrawerItemColors(theme, selected);\n\n return (\n <ListItemButton\n LinkComponent={StyledLink}\n dense={size === \"small\"}\n aria-label={text}\n href={href}\n selected={selected}\n sx={{\n ...sx,\n pl: state === \"open\" ? theme.spacing(2 + 1.5 * level) : undefined,\n ...(state === \"collapse\" && {\n paddingHorizontal: theme.spacing(2.5),\n justifyContent: \"center\",\n }),\n }}\n >\n {icon && (\n <ListItemIcon sx={{ color, ...(state === \"collapse\" && level === 0 && sxCollapsedIcon) }}>\n {icon}\n </ListItemIcon>\n )}\n {avatar && (\n <ListItemAvatar\n sx={{\n ...(state === \"collapse\" && level === 0 && sxCollapsedIcon),\n }}\n >\n <Avatar\n alt={avatar.alt}\n src={avatar.src}\n sx={{\n ...(size === \"small\" && { width: 24, height: 24 }),\n ...(state === \"collapse\" && { width: 30, height: 30 }),\n }}\n />\n </ListItemAvatar>\n )}\n <ListItemText\n disableTypography\n primary={text}\n sx={{ color, fontWeight, opacity: state === \"collapse\" && level === 0 ? 0 : undefined }}\n />\n {label && state === \"open\" && (\n <Label text={label.text} variant={label.variant} sx={{ ml: 2 }} />\n )}\n {bullet && state === \"open\" && <Bullet variant={bullet.variant} sx={{ ml: 2 }} />}\n </ListItemButton>\n );\n};\n","import { DrawerMenuItem } from \"./drawer-menu-item\";\nimport { DrawerNavigationItem, DrawerSize } from \"~/drawer/drawer.types\";\nimport { DrawerItemLink } from \"./drawer-item-link\";\nimport { useDrawer } from \"~/drawer-provider\";\n\nexport interface DrawerItemProps {\n /**\n * Data to be rendered\n */\n item: DrawerNavigationItem;\n /**\n * Size of the item\n */\n size?: DrawerSize;\n /**\n * Deep level of this item inside the submenus\n */\n level?: number;\n}\n\nexport const DrawerItem = ({ item, size = \"medium\", level = 0 }: DrawerItemProps) => {\n const { selectedItemId } = useDrawer();\n if (\"items\" in item) {\n const { id, text, icon, items } = item;\n const childrenSelected = items.some((item) => item.id === selectedItemId);\n return (\n <DrawerMenuItem\n size={size}\n selected={id === selectedItemId || childrenSelected}\n text={text}\n icon={icon}\n items={items}\n level={level}\n />\n );\n } else {\n const { id, text, icon, avatar, label, bullet, href } = item;\n return (\n <DrawerItemLink\n selected={id === selectedItemId}\n size={size}\n text={text}\n icon={icon}\n avatar={avatar}\n label={label}\n bullet={bullet}\n href={href}\n level={level}\n />\n );\n }\n};\n","import ListItemButton from \"@mui/material/ListItemButton\";\nimport ListItemIcon from \"@mui/material/ListItemIcon\";\nimport ListItemText from \"@mui/material/ListItemText\";\nimport Collapse from \"@mui/material/Collapse\";\nimport List from \"@mui/material/List\";\nimport Popover from \"@mui/material/Popover\";\nimport { SxProps, useTheme, Theme } from \"@mui/material/styles\";\nimport { ReactElement, useState, useRef } from \"react\";\nimport { DrawerNavigationItem, DrawerSize, getDrawerItemColors } from \"~/drawer\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\nimport ChevronRightIcon from \"@mui/icons-material/ChevronRight\";\nimport { DrawerItem } from \"./drawer-item\";\nimport { useDrawer } from \"~/drawer-provider\";\n\nexport interface DrawerMenuItemProps {\n /**\n * Item size. default to medium\n */\n size?: DrawerSize;\n /**\n * Text displayed inside the item\n */\n text: string;\n /**\n * Icon displayed to the left\n */\n icon?: ReactElement;\n /**\n * The item has to be marked as selected\n */\n selected?: boolean;\n /**\n * Items that are going to be displayed inside\n * the collapsable\n */\n items: DrawerNavigationItem[];\n /**\n * Deep level of this item inside the submenus\n */\n level: number;\n /**\n * Custom styles\n */\n sx?: SxProps<Theme>;\n}\n\nexport const DrawerMenuItem = ({\n text,\n icon,\n selected,\n items,\n size = \"medium\",\n level,\n sx = {},\n}: DrawerMenuItemProps) => {\n const { state } = useDrawer();\n const anchorEl = useRef<HTMLDivElement | null>(null);\n const { palette, spacing } = useTheme();\n const [menuOpen, setMenuOpen] = useState(false);\n const { color, fontWeight } = getDrawerItemColors(useTheme(), selected);\n\n const submenu = (\n <List component=\"div\" disablePadding>\n {items.map((item) => (\n <DrawerItem key={item.id} level={level + 1} item={item} size={size} />\n ))}\n </List>\n );\n\n const collapsedButtonSx =\n state === \"collapse\" && level === 0\n ? {\n position: \"absolute\",\n right: 0,\n }\n : {};\n\n return (\n <>\n <ListItemButton\n ref={anchorEl}\n selected={selected}\n aria-label={text}\n onClick={() => setMenuOpen((o) => !o)}\n dense={size === \"small\"}\n sx={{\n ...sx,\n pl: state === \"open\" ? spacing(2 + 1.5 * level) : undefined,\n backgroundColor: menuOpen ? palette.action.hover : undefined,\n }}\n >\n {icon && <ListItemIcon sx={{ color }}>{icon}</ListItemIcon>}\n <ListItemText\n disableTypography\n primary={text}\n sx={{ color, fontWeight, opacity: state === \"collapse\" && level === 0 ? 0 : undefined }}\n />\n {menuOpen && state === \"open\" ? (\n <ExpandMoreIcon sx={[{ color, ml: 2 }, collapsedButtonSx]} />\n ) : (\n <ChevronRightIcon sx={[{ color, ml: 2 }, collapsedButtonSx]} />\n )}\n </ListItemButton>\n {state === \"open\" ? (\n <Collapse\n in={menuOpen}\n timeout=\"auto\"\n unmountOnExit\n aria-label={`${text} collapse submenu`}\n >\n {submenu}\n </Collapse>\n ) : (\n <Popover\n open={menuOpen}\n PaperProps={{\n elevation: 0,\n variant: \"outlined\",\n }}\n aria-label={`${text} popover submenu`}\n anchorEl={anchorEl.current}\n onClose={() => setMenuOpen(false)}\n anchorOrigin={{\n vertical: \"top\",\n horizontal: \"right\",\n }}\n >\n {submenu}\n </Popover>\n )}\n </>\n );\n};\n","import List from \"@mui/material/List\";\nimport { useTheme } from \"@mui/material/styles\";\nimport { DrawerNavigationItem, DrawerSize } from \"~/drawer\";\nimport { DrawerSubheader } from \"~/drawer-subheader\";\nimport { DrawerItem } from \"~/drawer-item\";\nimport { useDrawer } from \"~/drawer-provider\";\n\nexport interface DrawerSectionProps {\n /**\n * Section title\n */\n title?: string;\n /**\n * List of items of that section\n */\n items: DrawerNavigationItem[];\n /**\n * Item size. default to medium\n */\n size?: DrawerSize;\n}\n\n/**\n * Render a group of items inside the drawer\n * with an optional title\n */\nexport const DrawerSection = ({ title, items, size = \"medium\" }: DrawerSectionProps) => {\n const { state } = useDrawer();\n const { spacing } = useTheme();\n return (\n <>\n {title && state === \"open\" && (\n <DrawerSubheader size={size} role=\"heading\">\n {title}\n </DrawerSubheader>\n )}\n <List\n sx={{\n paddingTop: size === \"small\" ? spacing(0) : undefined,\n paddingY: state === \"collapse\" ? 0 : undefined,\n }}\n >\n {items.map((item) => (\n <DrawerItem key={item.id} item={item} size={size} />\n ))}\n </List>\n </>\n );\n};\n","import { DrawerSection } from \"~/drawer-section\";\nimport { DrawerContentComponent, DrawerContentProps } from \"~/drawer\";\n\n/**\n * Content to be shown inside a navigation\n */\nexport const DrawerContent: DrawerContentComponent = ({\n nav: { items },\n size = \"medium\",\n}: DrawerContentProps) => {\n return (\n <>\n {items.map(({ title, items }, i) => (\n <DrawerSection key={i} title={title} items={items} size={size} />\n ))}\n </>\n );\n};\n"],"names":["DrawerSubheader","styled","ListSubheader","shouldForwardProp","prop","size","theme","lineHeight","typography","pxToRem","undefined","DrawerContext","createContext","UndefinedProvider","Error","useDrawer","context","useContext","display","alignItems","justifyContent","padding","spacing","mixins","toolbar","getDrawerItemColors","selected","color","palette","primary","main","fontWeight","fontWeightBold","fontWeightMedium","bulletClasses","Bullet","variant","sx","_jsx","Badge","className","role","Label","text","textTransform","useTheme","backgroundColor","default","mode","grey","light","secondary","info","warning","error","success","textColor","getContrastText","contrastText","Box","height","minWidth","bgcolor","fontSize","caption","whiteSpace","borderRadius","py","px","cursor","children","LinkBehaviour","forwardRef","props","ref","href","other","RouterLink","to","StyledLink","_1","MuiLink","component","sxCollapsedIcon","marginRight","DrawerItemLink","icon","avatar","label","bullet","level","state","_jsxs","ListItemButton","LinkComponent","dense","pl","paddingHorizontal","ListItemIcon","ListItemAvatar","Avatar","alt","src","width","ListItemText","disableTypography","opacity","ml","DrawerItem","item","selectedItemId","id","items","childrenSelected","some","DrawerMenuItem","anchorEl","useRef","menuOpen","setMenuOpen","useState","submenu","List","disablePadding","map","collapsedButtonSx","position","right","_Fragment","onClick","o","action","hover","ExpandMoreIcon","ChevronRightIcon","Collapse","in","timeout","unmountOnExit","Popover","open","PaperProps","elevation","current","onClose","anchorOrigin","vertical","horizontal","DrawerSection","title","paddingTop","paddingY","DrawerContent","nav","i"],"mappings":"g9BAWO,MAAMA,EAAkBC,EAAOC,EAAe,CACnDC,kBAAoBC,GAAkB,SAATA,GADAH,EAEN,EAAGI,OAAMC,YAAa,CAC7CC,WAAqB,UAATF,EAAmBC,EAAME,WAAWC,QAAQ,SAAMC,MCEnDC,EAAgBC,OAA8CF,GAC9DG,EAAoB,IAAIC,MAAM,wDAE9BC,EAAY,KACvB,MAAMC,EAAUC,EAAWN,GAE3B,QAAgBD,IAAZM,EACF,MAAMH,EAGR,OAAOG,CAAO,EChBYf,EAAO,MAAPA,EAAc,EAAGK,YAAa,CACxDY,QAAS,OACTC,WAAY,SACZC,eAAgB,WAChBC,QAASf,EAAMgB,QAAQ,EAAG,MACvBhB,EAAMiB,OAAOC,YC2DX,MAAMC,EAAsB,CAACnB,EAAcoB,KAAmC,CACnFC,MAAOD,EAAWpB,EAAMsB,QAAQC,QAAQC,UAAOpB,EAC/CqB,WAAYL,EAAWpB,EAAME,WAAWwB,eAAiB1B,EAAME,WAAWyB,mBCvE/DC,EACL,iBAiBKC,EAAS,EAAGC,UAAU,UAAWC,QAE1CC,EAACC,EAAK,CACJZ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C+E,IAGL/G,EAACoF,EACC,CAAArF,GAAI,CACFiH,WAAqB,UAATjJ,EAAmBiB,EAAQ,QAAKZ,EAC5C6I,SAAoB,aAAV5D,EAAuB,OAAIjF,GACtC4D,SAEA0C,EAAMY,KAAKf,GACVvE,EAACsE,GAAyBC,KAAMA,EAAMxG,KAAMA,GAA3BwG,EAAKE,UAI5B,ECzCSyC,EAAwC,EACnDC,KAAOzC,SACP3G,OAAO,YAGLiC,EACG0F,EAAA,CAAA1D,SAAA0C,EAAMY,KAAI,EAAGyB,QAAOrC,SAAS0C,IAC5BpH,EAAC8G,EAAa,CAASC,MAAOA,EAAOrC,MAAOA,EAAO3G,KAAMA,GAArCqJ"}
1
+ {"version":3,"file":"index.js","sources":["../../src/drawer-subheader/drawer-subheader.tsx","../../src/drawer-provider/drawer-context.ts","../../src/drawer/drawer.tsx","../../src/drawer/drawer.types.ts","../../src/bullet/bullet.tsx","../../src/label/label.tsx","../../src/link/link.tsx","../../src/drawer-item/drawer-item-link.tsx","../../src/drawer-item/drawer-item.tsx","../../src/drawer-item/drawer-menu-item.tsx","../../src/drawer-section/drawer-section.tsx","../../src/drawer-content/drawer-content.tsx"],"sourcesContent":["import ListSubheader, { ListSubheaderProps } from \"@mui/material/ListSubheader\";\nimport { styled } from \"@mui/material/styles\";\nimport { DrawerSize } from \"../drawer\";\n\nexport interface DrawerSubheaderProps extends ListSubheaderProps {\n /**\n * Item size. default to medium\n */\n size?: DrawerSize;\n}\n\nexport const DrawerSubheader = styled(ListSubheader, {\n shouldForwardProp: (prop) => prop !== \"size\",\n})<DrawerSubheaderProps>(({ size, theme }) => ({\n lineHeight: size === \"small\" ? theme.typography.pxToRem(40) : undefined,\n}));\n","import { useContext, createContext } from \"react\";\nimport { DrawerState, DrawerVariant } from \"../drawer\";\n\nexport interface DrawerContextProps {\n selectedItemId?: string;\n state: DrawerState;\n variant: DrawerVariant;\n drawerWidth: number;\n underAppBar: boolean;\n switchState(): void;\n close(): void;\n collapse(): void;\n open(): void;\n setState: (state: DrawerState) => void;\n}\n\nexport const DrawerContext = createContext<DrawerContextProps | undefined>(undefined);\nexport const UndefinedProvider = new Error(\"DrawerContext.Provider is required and was undefined\");\n\nexport const useDrawer = () => {\n const context = useContext(DrawerContext);\n\n if (context === undefined) {\n throw UndefinedProvider;\n }\n\n return context;\n};\n","import { SxProps, Theme, styled, useTheme } from \"@mui/material/styles\";\nimport MuiDrawer, { drawerClasses } from \"@mui/material/Drawer\";\nimport { paperClasses } from \"@mui/material/Paper\";\nimport Divider from \"@mui/material/Divider\";\nimport IconButton from \"@mui/material/IconButton\";\nimport ChevronLeftIcon from \"@mui/icons-material/ChevronLeft\";\nimport { DrawerComponent, DrawerProps, DrawerState, DrawerVariant } from \"./drawer.types\";\nimport { useDrawer } from \"../drawer-provider/drawer-context\";\nimport { closedMixin, openedMixin } from \"../drawer-provider/drawer-mixins\";\n\nexport const DrawerHeader = styled(\"div\")(({ theme }) => ({\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"flex-end\",\n padding: theme.spacing(0, 1),\n ...theme.mixins.toolbar,\n}));\n\nconst showCloseButton: Record<DrawerVariant, boolean> = {\n temporary: true,\n mini: true,\n persistent: true,\n clipped: false,\n};\n\nconst muiDrawerVariant: Record<DrawerVariant, \"permanent\" | \"persistent\" | \"temporary\"> = {\n temporary: \"temporary\",\n mini: \"permanent\",\n clipped: \"permanent\",\n persistent: \"persistent\",\n};\n\ntype SxGenerator = (state: DrawerState, theme: Theme) => SxProps<Theme>;\nconst NoopSxGenerator = () => ({});\nconst variantsSx: Readonly<Record<DrawerVariant, SxGenerator>> = {\n mini: (state: DrawerState, theme: Theme) => ({\n boxSizing: \"border-box\",\n [`& .${paperClasses.root}`]: {\n zIndex: theme.zIndex.drawer - 1,\n },\n }),\n temporary: NoopSxGenerator,\n clipped: NoopSxGenerator,\n persistent: NoopSxGenerator,\n};\n\nexport const Drawer: DrawerComponent = ({ children, ...rest }: DrawerProps) => {\n const theme = useTheme();\n const { state, switchState, underAppBar, close, drawerWidth, variant } = useDrawer();\n\n const sx: any = {\n width: drawerWidth,\n flexShrink: 0,\n whiteSpace: \"nowrap\",\n ...(state === \"open\" && {\n ...openedMixin(theme),\n [`& .${drawerClasses.paper}`]: openedMixin(theme),\n }),\n ...(state !== \"open\" && {\n ...closedMixin(theme),\n [`& .${drawerClasses.paper}`]: closedMixin(theme),\n }),\n ...variantsSx[variant](state, theme),\n };\n\n return (\n <MuiDrawer\n open={state === \"open\"}\n variant={muiDrawerVariant[variant]}\n role=\"menu\"\n aria-hidden={state === \"close\"}\n onClose={close}\n sx={sx}\n {...rest}\n >\n <DrawerHeader>\n {!underAppBar && showCloseButton[variant] && (\n <IconButton onClick={switchState}>\n <ChevronLeftIcon />\n </IconButton>\n )}\n </DrawerHeader>\n <Divider />\n {children}\n </MuiDrawer>\n );\n};\n","import { FunctionComponent, ReactElement } from \"react\";\nimport { BulletVariant } from \"../bullet\";\nimport { LabelVariant } from \"../label\";\nimport { DrawerProps as MuiDrawerProps } from \"@mui/material/Drawer\";\nimport { Theme } from \"@mui/material/styles\";\nimport { DrawerAppBarProps } from \"../drawer-app-bar\";\n\nexport type DrawerVariant = \"temporary\" | \"mini\" | \"persistent\" | \"clipped\";\nexport type DrawerState = \"open\" | \"collapse\" | \"close\";\nexport type DrawerSize = \"small\" | \"medium\";\n\nexport interface DrawerItemAvatar {\n src: string;\n alt: string;\n}\n\nexport interface DrawerItemLabel {\n text: string;\n variant: LabelVariant;\n}\n\nexport interface DrawerItemBullet {\n variant: BulletVariant;\n}\n\nexport interface DrawerNavigationItemLink {\n id: string;\n text: string;\n href: string;\n icon?: ReactElement;\n avatar?: DrawerItemAvatar;\n label?: DrawerItemLabel;\n bullet?: DrawerItemBullet;\n}\n\nexport type DrawerNavigationItemCollapsable = Pick<\n DrawerNavigationItemLink,\n \"id\" | \"text\" | \"icon\"\n> & {\n items: DrawerNavigationItem[];\n};\n\nexport type DrawerNavigationItem = DrawerNavigationItemLink | DrawerNavigationItemCollapsable;\n\nexport interface DrawerNavigationSection {\n title?: string;\n items: DrawerNavigationItem[];\n}\n\nexport interface DrawerNavigation {\n items: DrawerNavigationSection[];\n}\n\nexport interface DrawerContentProps {\n /**\n * Object with the content that has to be rendered\n */\n nav: DrawerNavigation;\n /**\n * Item size. default to medium\n */\n size?: DrawerSize;\n}\n\nexport type DrawerContentComponent = FunctionComponent<DrawerContentProps>;\nexport type DrawerContentElement = ReactElement<DrawerContentProps, DrawerContentComponent>;\n\nexport interface DrawerProps extends MuiDrawerProps {\n children: DrawerContentElement;\n}\n\nexport type DrawerComponent = FunctionComponent<DrawerProps>;\nexport type DrawerElement = ReactElement<DrawerProps, DrawerComponent>;\n\nexport const getDrawerItemColors = (theme: Theme, selected: boolean | undefined) => ({\n color: selected ? theme.palette.primary.main : undefined,\n fontWeight: selected ? theme.typography.fontWeightBold : theme.typography.fontWeightMedium,\n});\n\nexport type DrawerAppBarComponent = FunctionComponent<DrawerAppBarProps>;\nexport type DrawerAppBarElement = ReactElement<DrawerAppBarProps, DrawerAppBarComponent>;\n","import Badge from \"@mui/material/Badge\";\nimport { SxProps, Theme } from \"@mui/material/styles\";\n\nexport type BulletVariant = \"primary\" | \"secondary\" | \"default\" | \"info\" | \"warning\" | \"error\";\n\nexport const bulletClasses = {\n root: \"RdsBullet-root\",\n};\n\nexport interface BulletProps {\n /**\n * Color palette used to draw the component\n */\n variant?: BulletVariant;\n /**\n * Custom styles\n */\n sx?: SxProps<Theme>;\n}\n\n/**\n * Dot to attract the user attention\n */\nexport const Bullet = ({ variant = \"primary\", sx }: BulletProps) => {\n return (\n <Badge\n color={variant}\n variant=\"dot\"\n className={bulletClasses.root}\n role=\"bullet\"\n aria-describedby={variant}\n sx={sx}\n />\n );\n};\n","import Box from \"@mui/material/Box\";\nimport { SxProps, Theme, useTheme } from \"@mui/material/styles\";\n\nexport type LabelVariant =\n | \"primary\"\n | \"secondary\"\n | \"default\"\n | \"info\"\n | \"warning\"\n | \"error\"\n | \"success\";\n\nexport const labelClasses = {\n root: \"RdsLabel-root\",\n};\n\nexport interface LabelProps {\n /**\n * Content of the component\n */\n text: string;\n /**\n * Color palette used to draw the component\n */\n variant?: LabelVariant;\n\n /**\n * Custom styles\n */\n sx?: SxProps<Theme>;\n\n /**\n * Show the text as uppercase\n */\n textTransform?: \"none\" | \"capitalize\" | \"uppercase\";\n}\n\n/**\n * Compact element to represent a text\n */\nexport const Label = ({\n text,\n variant = \"default\",\n textTransform = \"capitalize\",\n sx,\n}: LabelProps) => {\n const { palette, typography } = useTheme();\n\n const backgroundColor: Record<LabelVariant, string> = {\n default: palette.mode === \"light\" ? palette.grey[100] : palette.grey[900],\n primary: palette.primary.light,\n secondary: palette.secondary.light,\n info: palette.info.light,\n warning: palette.warning.light,\n error: palette.error.light,\n success: palette.success.light,\n };\n\n const textColor: Record<LabelVariant, string> = {\n default: palette.getContrastText(backgroundColor.default),\n primary: palette.primary.contrastText,\n secondary: palette.secondary.contrastText,\n info: palette.info.contrastText,\n warning: palette.warning.contrastText,\n error: palette.error.contrastText,\n success: palette.success.contrastText,\n };\n\n return (\n <Box\n height={24}\n minWidth={22}\n display=\"inline-flex\"\n justifyContent=\"center\"\n alignItems=\"center\"\n bgcolor={backgroundColor[variant]}\n color={textColor[variant]}\n fontSize={typography.caption.fontSize}\n fontWeight={typography.fontWeightBold}\n lineHeight={0}\n textTransform={textTransform}\n whiteSpace=\"nowrap\"\n borderRadius={2}\n role=\"label\"\n aria-label={`${text} ${variant} label`}\n py={0}\n px={1}\n sx={{ cursor: \"default\", ...sx }}\n >\n {text}\n </Box>\n );\n};\n","import { Link as RouterLink, LinkProps as RouterLinkProps } from \"react-router-dom\";\nimport { forwardRef } from \"react\";\nimport MuiLink, { LinkProps } from \"@mui/material/Link\";\n\n/* eslint-disable react/display-name, @typescript-eslint/no-explicit-any */\nexport const LinkBehaviour = forwardRef<\n any,\n Omit<RouterLinkProps, \"to\"> & { href: RouterLinkProps[\"to\"] }\n>((props, ref) => {\n const { href, ...other } = props;\n return <RouterLink ref={ref} to={href} {...other} />;\n});\n\nexport const Link = forwardRef<any, LinkProps>((props, _1) => {\n return <MuiLink {...(props as any)} component={LinkBehaviour} />;\n});\n","import { ReactElement } from \"react\";\nimport Avatar from \"@mui/material/Avatar\";\nimport ListItemAvatar from \"@mui/material/ListItemAvatar\";\nimport ListItemButton from \"@mui/material/ListItemButton\";\nimport ListItemIcon from \"@mui/material/ListItemIcon\";\nimport ListItemText from \"@mui/material/ListItemText\";\nimport { SxProps, Theme, styled, useTheme } from \"@mui/material/styles\";\nimport { Bullet } from \"../bullet\";\nimport { Label } from \"../label\";\nimport {\n DrawerItemAvatar,\n DrawerItemBullet,\n DrawerItemLabel,\n DrawerSize,\n getDrawerItemColors,\n} from \"../drawer/drawer.types\";\nimport { Link } from \"../link\";\nimport { useDrawer } from \"../drawer-provider\";\n\nexport interface DrawerItemLinkProps {\n /**\n * Item size. default to medium\n */\n size?: DrawerSize;\n /**\n * Text displayed inside the item\n */\n text: string;\n /**\n * Url where the user is going to be redirected\n * if the item is clicked\n */\n href: string;\n /**\n * Icon displayed to the left\n */\n icon?: ReactElement;\n /**\n * Avatar displayed to the left\n */\n avatar?: DrawerItemAvatar;\n /**\n * Label with extra info displayed to the right\n */\n label?: DrawerItemLabel;\n /**\n * Bullet to attract the user attention displyed to the right\n */\n bullet?: DrawerItemBullet;\n /**\n * The item has to be marked as selected\n */\n selected?: boolean;\n /**\n * Deep level of this item inside the submenus\n */\n level: number;\n /**\n * Custom styles\n */\n sx?: SxProps<Theme>;\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nconst StyledLink = styled(Link)(({ theme }) => {\n return {\n color: theme.palette.text.primary,\n };\n});\n\nconst sxCollapsedIcon = {\n minWidth: 0,\n justifyContent: \"center\",\n marginRight: \"auto\",\n};\n\n/**\n * Clicable item inside a drawer\n */\nexport const DrawerItemLink = ({\n text,\n icon,\n avatar,\n label,\n bullet,\n href,\n selected,\n size = \"medium\",\n level,\n sx,\n}: DrawerItemLinkProps) => {\n const { state } = useDrawer();\n const theme = useTheme();\n const { color, fontWeight } = getDrawerItemColors(theme, selected);\n\n return (\n <ListItemButton\n LinkComponent={StyledLink}\n dense={size === \"small\"}\n aria-label={text}\n href={href}\n selected={selected}\n sx={{\n ...sx,\n pl: state === \"open\" ? theme.spacing(2 + 1.5 * level) : undefined,\n ...(state === \"collapse\" && {\n paddingHorizontal: theme.spacing(2.5),\n justifyContent: \"center\",\n }),\n }}\n >\n {icon && (\n <ListItemIcon sx={{ color, ...(state === \"collapse\" && level === 0 && sxCollapsedIcon) }}>\n {icon}\n </ListItemIcon>\n )}\n {avatar && (\n <ListItemAvatar\n sx={{\n ...(state === \"collapse\" && level === 0 && sxCollapsedIcon),\n }}\n >\n <Avatar\n alt={avatar.alt}\n src={avatar.src}\n sx={{\n ...(size === \"small\" && { width: 24, height: 24 }),\n ...(state === \"collapse\" && { width: 30, height: 30 }),\n }}\n />\n </ListItemAvatar>\n )}\n <ListItemText\n disableTypography\n primary={text}\n sx={{ color, fontWeight, opacity: state === \"collapse\" && level === 0 ? 0 : undefined }}\n />\n {label && state === \"open\" && (\n <Label text={label.text} variant={label.variant} sx={{ ml: 2 }} />\n )}\n {bullet && state === \"open\" && <Bullet variant={bullet.variant} sx={{ ml: 2 }} />}\n </ListItemButton>\n );\n};\n","import { DrawerMenuItem } from \"./drawer-menu-item\";\nimport { DrawerNavigationItem, DrawerSize } from \"../drawer/drawer.types\";\nimport { DrawerItemLink } from \"./drawer-item-link\";\nimport { useDrawer } from \"../drawer-provider\";\n\nexport interface DrawerItemProps {\n /**\n * Data to be rendered\n */\n item: DrawerNavigationItem;\n /**\n * Size of the item\n */\n size?: DrawerSize;\n /**\n * Deep level of this item inside the submenus\n */\n level?: number;\n}\n\nexport const DrawerItem = ({ item, size = \"medium\", level = 0 }: DrawerItemProps) => {\n const { selectedItemId } = useDrawer();\n if (\"items\" in item) {\n const { id, text, icon, items } = item;\n const childrenSelected = items.some((item) => item.id === selectedItemId);\n return (\n <DrawerMenuItem\n size={size}\n selected={id === selectedItemId || childrenSelected}\n text={text}\n icon={icon}\n items={items}\n level={level}\n />\n );\n } else {\n const { id, text, icon, avatar, label, bullet, href } = item;\n return (\n <DrawerItemLink\n selected={id === selectedItemId}\n size={size}\n text={text}\n icon={icon}\n avatar={avatar}\n label={label}\n bullet={bullet}\n href={href}\n level={level}\n />\n );\n }\n};\n","import ListItemButton from \"@mui/material/ListItemButton\";\nimport ListItemIcon from \"@mui/material/ListItemIcon\";\nimport ListItemText from \"@mui/material/ListItemText\";\nimport Collapse from \"@mui/material/Collapse\";\nimport List from \"@mui/material/List\";\nimport Popover from \"@mui/material/Popover\";\nimport { SxProps, useTheme, Theme } from \"@mui/material/styles\";\nimport { ReactElement, useState, useRef } from \"react\";\nimport { DrawerNavigationItem, DrawerSize, getDrawerItemColors } from \"../drawer\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\nimport ChevronRightIcon from \"@mui/icons-material/ChevronRight\";\nimport { DrawerItem } from \"./drawer-item\";\nimport { useDrawer } from \"../drawer-provider\";\n\nexport interface DrawerMenuItemProps {\n /**\n * Item size. default to medium\n */\n size?: DrawerSize;\n /**\n * Text displayed inside the item\n */\n text: string;\n /**\n * Icon displayed to the left\n */\n icon?: ReactElement;\n /**\n * The item has to be marked as selected\n */\n selected?: boolean;\n /**\n * Items that are going to be displayed inside\n * the collapsable\n */\n items: DrawerNavigationItem[];\n /**\n * Deep level of this item inside the submenus\n */\n level: number;\n /**\n * Custom styles\n */\n sx?: SxProps<Theme>;\n}\n\nexport const DrawerMenuItem = ({\n text,\n icon,\n selected,\n items,\n size = \"medium\",\n level,\n sx = {},\n}: DrawerMenuItemProps) => {\n const { state } = useDrawer();\n const anchorEl = useRef<HTMLDivElement | null>(null);\n const { palette, spacing } = useTheme();\n const [menuOpen, setMenuOpen] = useState(false);\n const { color, fontWeight } = getDrawerItemColors(useTheme(), selected);\n\n const submenu = (\n <List component=\"div\" disablePadding>\n {items.map((item) => (\n <DrawerItem key={item.id} level={level + 1} item={item} size={size} />\n ))}\n </List>\n );\n\n const collapsedButtonSx =\n state === \"collapse\" && level === 0\n ? {\n position: \"absolute\",\n right: 0,\n }\n : {};\n\n return (\n <>\n <ListItemButton\n ref={anchorEl}\n selected={selected}\n aria-label={text}\n onClick={() => setMenuOpen((o) => !o)}\n dense={size === \"small\"}\n sx={{\n ...sx,\n pl: state === \"open\" ? spacing(2 + 1.5 * level) : undefined,\n backgroundColor: menuOpen ? palette.action.hover : undefined,\n }}\n >\n {icon && <ListItemIcon sx={{ color }}>{icon}</ListItemIcon>}\n <ListItemText\n disableTypography\n primary={text}\n sx={{ color, fontWeight, opacity: state === \"collapse\" && level === 0 ? 0 : undefined }}\n />\n {menuOpen && state === \"open\" ? (\n <ExpandMoreIcon sx={[{ color, ml: 2 }, collapsedButtonSx]} />\n ) : (\n <ChevronRightIcon sx={[{ color, ml: 2 }, collapsedButtonSx]} />\n )}\n </ListItemButton>\n {state === \"open\" ? (\n <Collapse\n in={menuOpen}\n timeout=\"auto\"\n unmountOnExit\n aria-label={`${text} collapse submenu`}\n >\n {submenu}\n </Collapse>\n ) : (\n <Popover\n open={menuOpen}\n PaperProps={{\n elevation: 0,\n variant: \"outlined\",\n }}\n aria-label={`${text} popover submenu`}\n anchorEl={anchorEl.current}\n onClose={() => setMenuOpen(false)}\n anchorOrigin={{\n vertical: \"top\",\n horizontal: \"right\",\n }}\n >\n {submenu}\n </Popover>\n )}\n </>\n );\n};\n","import List from \"@mui/material/List\";\nimport { useTheme } from \"@mui/material/styles\";\nimport { DrawerNavigationItem, DrawerSize } from \"../drawer\";\nimport { DrawerSubheader } from \"../drawer-subheader\";\nimport { DrawerItem } from \"../drawer-item\";\nimport { useDrawer } from \"../drawer-provider\";\n\nexport interface DrawerSectionProps {\n /**\n * Section title\n */\n title?: string;\n /**\n * List of items of that section\n */\n items: DrawerNavigationItem[];\n /**\n * Item size. default to medium\n */\n size?: DrawerSize;\n}\n\n/**\n * Render a group of items inside the drawer\n * with an optional title\n */\nexport const DrawerSection = ({ title, items, size = \"medium\" }: DrawerSectionProps) => {\n const { state } = useDrawer();\n const { spacing } = useTheme();\n return (\n <>\n {title && state === \"open\" && (\n <DrawerSubheader size={size} role=\"heading\">\n {title}\n </DrawerSubheader>\n )}\n <List\n sx={{\n paddingTop: size === \"small\" ? spacing(0) : undefined,\n paddingY: state === \"collapse\" ? 0 : undefined,\n }}\n >\n {items.map((item) => (\n <DrawerItem key={item.id} item={item} size={size} />\n ))}\n </List>\n </>\n );\n};\n","import { DrawerSection } from \"../drawer-section\";\nimport { DrawerContentComponent, DrawerContentProps } from \"../drawer\";\n\n/**\n * Content to be shown inside a navigation\n */\nexport const DrawerContent: DrawerContentComponent = ({\n nav: { items },\n size = \"medium\",\n}: DrawerContentProps) => {\n return (\n <>\n {items.map(({ title, items }, i) => (\n <DrawerSection key={i} title={title} items={items} size={size} />\n ))}\n </>\n );\n};\n"],"names":["DrawerSubheader","styled","ListSubheader","shouldForwardProp","prop","size","theme","lineHeight","typography","pxToRem","undefined","DrawerContext","createContext","UndefinedProvider","Error","useDrawer","context","useContext","display","alignItems","justifyContent","padding","spacing","mixins","toolbar","getDrawerItemColors","selected","color","palette","primary","main","fontWeight","fontWeightBold","fontWeightMedium","bulletClasses","Bullet","variant","sx","_jsx","Badge","className","role","Label","text","textTransform","useTheme","backgroundColor","default","mode","grey","light","secondary","info","warning","error","success","textColor","getContrastText","contrastText","Box","height","minWidth","bgcolor","fontSize","caption","whiteSpace","borderRadius","py","px","cursor","children","LinkBehaviour","forwardRef","props","ref","href","other","RouterLink","to","StyledLink","_1","MuiLink","component","sxCollapsedIcon","marginRight","DrawerItemLink","icon","avatar","label","bullet","level","state","_jsxs","ListItemButton","LinkComponent","dense","pl","paddingHorizontal","ListItemIcon","ListItemAvatar","Avatar","alt","src","width","ListItemText","disableTypography","opacity","ml","DrawerItem","item","selectedItemId","id","items","childrenSelected","some","DrawerMenuItem","anchorEl","useRef","menuOpen","setMenuOpen","useState","submenu","List","disablePadding","map","collapsedButtonSx","position","right","_Fragment","onClick","o","action","hover","ExpandMoreIcon","ChevronRightIcon","Collapse","in","timeout","unmountOnExit","Popover","open","PaperProps","elevation","current","onClose","anchorOrigin","vertical","horizontal","DrawerSection","title","paddingTop","paddingY","DrawerContent","nav","i"],"mappings":"g9BAWO,MAAMA,EAAkBC,EAAOC,EAAe,CACnDC,kBAAoBC,GAAkB,SAATA,GADAH,EAEN,EAAGI,OAAMC,YAAa,CAC7CC,WAAqB,UAATF,EAAmBC,EAAME,WAAWC,QAAQ,SAAMC,MCEnDC,EAAgBC,OAA8CF,GAC9DG,EAAoB,IAAIC,MAAM,wDAE9BC,EAAY,KACvB,MAAMC,EAAUC,EAAWN,GAE3B,QAAgBD,IAAZM,EACF,MAAMH,EAGR,OAAOG,CAAO,EChBYf,EAAO,MAAPA,EAAc,EAAGK,YAAa,CACxDY,QAAS,OACTC,WAAY,SACZC,eAAgB,WAChBC,QAASf,EAAMgB,QAAQ,EAAG,MACvBhB,EAAMiB,OAAOC,YC2DX,MAAMC,EAAsB,CAACnB,EAAcoB,KAAmC,CACnFC,MAAOD,EAAWpB,EAAMsB,QAAQC,QAAQC,UAAOpB,EAC/CqB,WAAYL,EAAWpB,EAAME,WAAWwB,eAAiB1B,EAAME,WAAWyB,mBCvE/DC,EACL,iBAiBKC,EAAS,EAAGC,UAAU,UAAWC,QAE1CC,EAACC,EAAK,CACJZ,MAAOS,EACPA,QAAQ,MACRI,UAAWN,EACXO,KAAK,SAAQ,mBACKL,EAClBC,GAAIA,ICSGK,EAAQ,EACnBC,OACAP,UAAU,UACVQ,gBAAgB,aAChBP,SAEA,MAAMT,QAAEA,EAAOpB,WAAEA,GAAeqC,IAE1BC,EAAgD,CACpDC,QAA0B,UAAjBnB,EAAQoB,KAAmBpB,EAAQqB,KAAK,KAAOrB,EAAQqB,KAAK,KACrEpB,QAASD,EAAQC,QAA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AAA1D,SAAA0C,EAAMY,KAAI,EAAGyB,QAAOrC,SAAS0C,IAC5BpH,EAAC8G,EAAa,CAASC,MAAOA,EAAOrC,MAAOA,EAAO3G,KAAMA,GAArCqJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/drawer-provider/drawer-context.ts","../../../src/drawer/drawer.tsx","../../../src/drawer/drawer.types.ts","../../../src/bullet/bullet.tsx","../../../src/label/label.tsx","../../../src/link/link.tsx","../../../src/drawer-item/drawer-item-link.tsx","../../../src/drawer-item/drawer-item.tsx","../../../src/drawer-item/drawer-menu-item.tsx"],"sourcesContent":["import { useContext, createContext } from \"react\";\nimport { DrawerState, DrawerVariant } from \"~/drawer\";\n\nexport interface DrawerContextProps {\n selectedItemId?: string;\n state: DrawerState;\n variant: DrawerVariant;\n drawerWidth: number;\n underAppBar: boolean;\n switchState(): void;\n close(): void;\n collapse(): void;\n open(): void;\n setState: (state: DrawerState) => void;\n}\n\nexport const DrawerContext = createContext<DrawerContextProps | undefined>(undefined);\nexport const UndefinedProvider = new Error(\"DrawerContext.Provider is required and was undefined\");\n\nexport const useDrawer = () => {\n const context = useContext(DrawerContext);\n\n if (context === undefined) {\n throw UndefinedProvider;\n }\n\n return context;\n};\n","import { SxProps, Theme, styled, useTheme } from \"@mui/material/styles\";\nimport MuiDrawer, { drawerClasses } from \"@mui/material/Drawer\";\nimport { paperClasses } from \"@mui/material/Paper\";\nimport Divider from \"@mui/material/Divider\";\nimport IconButton from \"@mui/material/IconButton\";\nimport ChevronLeftIcon from \"@mui/icons-material/ChevronLeft\";\nimport { DrawerComponent, DrawerProps, DrawerState, DrawerVariant } from \"./drawer.types\";\nimport { useDrawer } from \"~/drawer-provider/drawer-context\";\nimport { closedMixin, openedMixin } from \"~/drawer-provider/drawer-mixins\";\n\nexport const DrawerHeader = styled(\"div\")(({ theme }) => ({\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"flex-end\",\n padding: theme.spacing(0, 1),\n ...theme.mixins.toolbar,\n}));\n\nconst showCloseButton: Record<DrawerVariant, boolean> = {\n temporary: true,\n mini: true,\n persistent: true,\n clipped: false,\n};\n\nconst muiDrawerVariant: Record<DrawerVariant, \"permanent\" | \"persistent\" | \"temporary\"> = {\n temporary: \"temporary\",\n mini: \"permanent\",\n clipped: \"permanent\",\n persistent: \"persistent\",\n};\n\ntype SxGenerator = (state: DrawerState, theme: Theme) => SxProps<Theme>;\nconst NoopSxGenerator = () => ({});\nconst variantsSx: Readonly<Record<DrawerVariant, SxGenerator>> = {\n mini: (state: DrawerState, theme: Theme) => ({\n boxSizing: \"border-box\",\n [`& .${paperClasses.root}`]: {\n zIndex: theme.zIndex.drawer - 1,\n },\n }),\n temporary: NoopSxGenerator,\n clipped: NoopSxGenerator,\n persistent: NoopSxGenerator,\n};\n\nexport const Drawer: DrawerComponent = ({ children, ...rest }: DrawerProps) => {\n const theme = useTheme();\n const { state, switchState, underAppBar, close, drawerWidth, variant } = useDrawer();\n\n const sx: any = {\n width: drawerWidth,\n flexShrink: 0,\n whiteSpace: \"nowrap\",\n ...(state === \"open\" && {\n ...openedMixin(theme),\n [`& .${drawerClasses.paper}`]: openedMixin(theme),\n }),\n ...(state !== \"open\" && {\n ...closedMixin(theme),\n [`& .${drawerClasses.paper}`]: closedMixin(theme),\n }),\n ...variantsSx[variant](state, theme),\n };\n\n return (\n <MuiDrawer\n open={state === \"open\"}\n variant={muiDrawerVariant[variant]}\n role=\"menu\"\n aria-hidden={state === \"close\"}\n onClose={close}\n sx={sx}\n {...rest}\n >\n <DrawerHeader>\n {!underAppBar && showCloseButton[variant] && (\n <IconButton onClick={switchState}>\n <ChevronLeftIcon />\n </IconButton>\n )}\n </DrawerHeader>\n <Divider />\n {children}\n </MuiDrawer>\n );\n};\n","import { FunctionComponent, ReactElement } from \"react\";\nimport { BulletVariant } from \"~/bullet\";\nimport { LabelVariant } from \"~/label\";\nimport { DrawerProps as MuiDrawerProps } from \"@mui/material/Drawer\";\nimport { Theme } from \"@mui/material/styles\";\nimport { DrawerAppBarProps } from \"~/drawer-app-bar\";\n\nexport type DrawerVariant = \"temporary\" | \"mini\" | \"persistent\" | \"clipped\";\nexport type DrawerState = \"open\" | \"collapse\" | \"close\";\nexport type DrawerSize = \"small\" | \"medium\";\n\nexport interface DrawerItemAvatar {\n src: string;\n alt: string;\n}\n\nexport interface DrawerItemLabel {\n text: string;\n variant: LabelVariant;\n}\n\nexport interface DrawerItemBullet {\n variant: BulletVariant;\n}\n\nexport interface DrawerNavigationItemLink {\n id: string;\n text: string;\n href: string;\n icon?: ReactElement;\n avatar?: DrawerItemAvatar;\n label?: DrawerItemLabel;\n bullet?: DrawerItemBullet;\n}\n\nexport type DrawerNavigationItemCollapsable = Pick<\n DrawerNavigationItemLink,\n \"id\" | \"text\" | \"icon\"\n> & {\n items: DrawerNavigationItem[];\n};\n\nexport type DrawerNavigationItem = DrawerNavigationItemLink | DrawerNavigationItemCollapsable;\n\nexport interface DrawerNavigationSection {\n title?: string;\n items: DrawerNavigationItem[];\n}\n\nexport interface DrawerNavigation {\n items: DrawerNavigationSection[];\n}\n\nexport interface DrawerContentProps {\n /**\n * Object with the content that has to be rendered\n */\n nav: DrawerNavigation;\n /**\n * Item size. default to medium\n */\n size?: DrawerSize;\n}\n\nexport type DrawerContentComponent = FunctionComponent<DrawerContentProps>;\nexport type DrawerContentElement = ReactElement<DrawerContentProps, DrawerContentComponent>;\n\nexport interface DrawerProps extends MuiDrawerProps {\n children: DrawerContentElement;\n}\n\nexport type DrawerComponent = FunctionComponent<DrawerProps>;\nexport type DrawerElement = ReactElement<DrawerProps, DrawerComponent>;\n\nexport const getDrawerItemColors = (theme: Theme, selected: boolean | undefined) => ({\n color: selected ? theme.palette.primary.main : undefined,\n fontWeight: selected ? theme.typography.fontWeightBold : theme.typography.fontWeightMedium,\n});\n\nexport type DrawerAppBarComponent = FunctionComponent<DrawerAppBarProps>;\nexport type DrawerAppBarElement = ReactElement<DrawerAppBarProps, DrawerAppBarComponent>;\n","import Badge from \"@mui/material/Badge\";\nimport { SxProps, Theme } from \"@mui/material/styles\";\n\nexport type BulletVariant = \"primary\" | \"secondary\" | \"default\" | \"info\" | \"warning\" | \"error\";\n\nexport const bulletClasses = {\n root: \"RdsBullet-root\",\n};\n\nexport interface BulletProps {\n /**\n * Color palette used to draw the component\n */\n variant?: BulletVariant;\n /**\n * Custom styles\n */\n sx?: SxProps<Theme>;\n}\n\n/**\n * Dot to attract the user attention\n */\nexport const Bullet = ({ variant = \"primary\", sx }: BulletProps) => {\n return (\n <Badge\n color={variant}\n variant=\"dot\"\n className={bulletClasses.root}\n role=\"bullet\"\n aria-describedby={variant}\n sx={sx}\n />\n );\n};\n","import Box from \"@mui/material/Box\";\nimport { SxProps, Theme, useTheme } from \"@mui/material/styles\";\n\nexport type LabelVariant =\n | \"primary\"\n | \"secondary\"\n | \"default\"\n | \"info\"\n | \"warning\"\n | \"error\"\n | \"success\";\n\nexport const labelClasses = {\n root: \"RdsLabel-root\",\n};\n\nexport interface LabelProps {\n /**\n * Content of the component\n */\n text: string;\n /**\n * Color palette used to draw the component\n */\n variant?: LabelVariant;\n\n /**\n * Custom styles\n */\n sx?: SxProps<Theme>;\n\n /**\n * Show the text as uppercase\n */\n textTransform?: \"none\" | \"capitalize\" | \"uppercase\";\n}\n\n/**\n * Compact element to represent a text\n */\nexport const Label = ({\n text,\n variant = \"default\",\n textTransform = \"capitalize\",\n sx,\n}: LabelProps) => {\n const { palette, typography } = useTheme();\n\n const backgroundColor: Record<LabelVariant, string> = {\n default: palette.mode === \"light\" ? palette.grey[100] : palette.grey[900],\n primary: palette.primary.light,\n secondary: palette.secondary.light,\n info: palette.info.light,\n warning: palette.warning.light,\n error: palette.error.light,\n success: palette.success.light,\n };\n\n const textColor: Record<LabelVariant, string> = {\n default: palette.getContrastText(backgroundColor.default),\n primary: palette.primary.contrastText,\n secondary: palette.secondary.contrastText,\n info: palette.info.contrastText,\n warning: palette.warning.contrastText,\n error: palette.error.contrastText,\n success: palette.success.contrastText,\n };\n\n return (\n <Box\n height={24}\n minWidth={22}\n display=\"inline-flex\"\n justifyContent=\"center\"\n alignItems=\"center\"\n bgcolor={backgroundColor[variant]}\n color={textColor[variant]}\n fontSize={typography.caption.fontSize}\n fontWeight={typography.fontWeightBold}\n lineHeight={0}\n textTransform={textTransform}\n whiteSpace=\"nowrap\"\n borderRadius={2}\n role=\"label\"\n aria-label={`${text} ${variant} label`}\n py={0}\n px={1}\n sx={{ cursor: \"default\", ...sx }}\n >\n {text}\n </Box>\n );\n};\n","import { Link as RouterLink, LinkProps as RouterLinkProps } from \"react-router-dom\";\nimport { forwardRef } from \"react\";\nimport MuiLink, { LinkProps } from \"@mui/material/Link\";\n\n/* eslint-disable react/display-name, @typescript-eslint/no-explicit-any */\nexport const LinkBehaviour = forwardRef<\n any,\n Omit<RouterLinkProps, \"to\"> & { href: RouterLinkProps[\"to\"] }\n>((props, ref) => {\n const { href, ...other } = props;\n return <RouterLink ref={ref} to={href} {...other} />;\n});\n\nexport const Link = forwardRef<any, LinkProps>((props, _1) => {\n return <MuiLink {...(props as any)} component={LinkBehaviour} />;\n});\n","import { ReactElement } from \"react\";\nimport Avatar from \"@mui/material/Avatar\";\nimport ListItemAvatar from \"@mui/material/ListItemAvatar\";\nimport ListItemButton from \"@mui/material/ListItemButton\";\nimport ListItemIcon from \"@mui/material/ListItemIcon\";\nimport ListItemText from \"@mui/material/ListItemText\";\nimport { SxProps, Theme, styled, useTheme } from \"@mui/material/styles\";\nimport { Bullet } from \"~/bullet\";\nimport { Label } from \"~/label\";\nimport {\n DrawerItemAvatar,\n DrawerItemBullet,\n DrawerItemLabel,\n DrawerSize,\n getDrawerItemColors,\n} from \"~/drawer/drawer.types\";\nimport { Link } from \"~/link\";\nimport { useDrawer } from \"~/drawer-provider\";\n\nexport interface DrawerItemLinkProps {\n /**\n * Item size. default to medium\n */\n size?: DrawerSize;\n /**\n * Text displayed inside the item\n */\n text: string;\n /**\n * Url where the user is going to be redirected\n * if the item is clicked\n */\n href: string;\n /**\n * Icon displayed to the left\n */\n icon?: ReactElement;\n /**\n * Avatar displayed to the left\n */\n avatar?: DrawerItemAvatar;\n /**\n * Label with extra info displayed to the right\n */\n label?: DrawerItemLabel;\n /**\n * Bullet to attract the user attention displyed to the right\n */\n bullet?: DrawerItemBullet;\n /**\n * The item has to be marked as selected\n */\n selected?: boolean;\n /**\n * Deep level of this item inside the submenus\n */\n level: number;\n /**\n * Custom styles\n */\n sx?: SxProps<Theme>;\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nconst StyledLink = styled(Link)(({ theme }) => {\n return {\n color: theme.palette.text.primary,\n };\n});\n\nconst sxCollapsedIcon = {\n minWidth: 0,\n justifyContent: \"center\",\n marginRight: \"auto\",\n};\n\n/**\n * Clicable item inside a drawer\n */\nexport const DrawerItemLink = ({\n text,\n icon,\n avatar,\n label,\n bullet,\n href,\n selected,\n size = \"medium\",\n level,\n sx,\n}: DrawerItemLinkProps) => {\n const { state } = useDrawer();\n const theme = useTheme();\n const { color, fontWeight } = getDrawerItemColors(theme, selected);\n\n return (\n <ListItemButton\n LinkComponent={StyledLink}\n dense={size === \"small\"}\n aria-label={text}\n href={href}\n selected={selected}\n sx={{\n ...sx,\n pl: state === \"open\" ? theme.spacing(2 + 1.5 * level) : undefined,\n ...(state === \"collapse\" && {\n paddingHorizontal: theme.spacing(2.5),\n justifyContent: \"center\",\n }),\n }}\n >\n {icon && (\n <ListItemIcon sx={{ color, ...(state === \"collapse\" && level === 0 && sxCollapsedIcon) }}>\n {icon}\n </ListItemIcon>\n )}\n {avatar && (\n <ListItemAvatar\n sx={{\n ...(state === \"collapse\" && level === 0 && sxCollapsedIcon),\n }}\n >\n <Avatar\n alt={avatar.alt}\n src={avatar.src}\n sx={{\n ...(size === \"small\" && { width: 24, height: 24 }),\n ...(state === \"collapse\" && { width: 30, height: 30 }),\n }}\n />\n </ListItemAvatar>\n )}\n <ListItemText\n disableTypography\n primary={text}\n sx={{ color, fontWeight, opacity: state === \"collapse\" && level === 0 ? 0 : undefined }}\n />\n {label && state === \"open\" && (\n <Label text={label.text} variant={label.variant} sx={{ ml: 2 }} />\n )}\n {bullet && state === \"open\" && <Bullet variant={bullet.variant} sx={{ ml: 2 }} />}\n </ListItemButton>\n );\n};\n","import { DrawerMenuItem } from \"./drawer-menu-item\";\nimport { DrawerNavigationItem, DrawerSize } from \"~/drawer/drawer.types\";\nimport { DrawerItemLink } from \"./drawer-item-link\";\nimport { useDrawer } from \"~/drawer-provider\";\n\nexport interface DrawerItemProps {\n /**\n * Data to be rendered\n */\n item: DrawerNavigationItem;\n /**\n * Size of the item\n */\n size?: DrawerSize;\n /**\n * Deep level of this item inside the submenus\n */\n level?: number;\n}\n\nexport const DrawerItem = ({ item, size = \"medium\", level = 0 }: DrawerItemProps) => {\n const { selectedItemId } = useDrawer();\n if (\"items\" in item) {\n const { id, text, icon, items } = item;\n const childrenSelected = items.some((item) => item.id === selectedItemId);\n return (\n <DrawerMenuItem\n size={size}\n selected={id === selectedItemId || childrenSelected}\n text={text}\n icon={icon}\n items={items}\n level={level}\n />\n );\n } else {\n const { id, text, icon, avatar, label, bullet, href } = item;\n return (\n <DrawerItemLink\n selected={id === selectedItemId}\n size={size}\n text={text}\n icon={icon}\n avatar={avatar}\n label={label}\n bullet={bullet}\n href={href}\n level={level}\n />\n );\n }\n};\n","import ListItemButton from \"@mui/material/ListItemButton\";\nimport ListItemIcon from \"@mui/material/ListItemIcon\";\nimport ListItemText from \"@mui/material/ListItemText\";\nimport Collapse from \"@mui/material/Collapse\";\nimport List from \"@mui/material/List\";\nimport Popover from \"@mui/material/Popover\";\nimport { SxProps, useTheme, Theme } from \"@mui/material/styles\";\nimport { ReactElement, useState, useRef } from \"react\";\nimport { DrawerNavigationItem, DrawerSize, getDrawerItemColors } from \"~/drawer\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\nimport ChevronRightIcon from \"@mui/icons-material/ChevronRight\";\nimport { DrawerItem } from \"./drawer-item\";\nimport { useDrawer } from \"~/drawer-provider\";\n\nexport interface DrawerMenuItemProps {\n /**\n * Item size. default to medium\n */\n size?: DrawerSize;\n /**\n * Text displayed inside the item\n */\n text: string;\n /**\n * Icon displayed to the left\n */\n icon?: ReactElement;\n /**\n * The item has to be marked as selected\n */\n selected?: boolean;\n /**\n * Items that are going to be displayed inside\n * the collapsable\n */\n items: DrawerNavigationItem[];\n /**\n * Deep level of this item inside the submenus\n */\n level: number;\n /**\n * Custom styles\n */\n sx?: SxProps<Theme>;\n}\n\nexport const DrawerMenuItem = ({\n text,\n icon,\n selected,\n items,\n size = \"medium\",\n level,\n sx = {},\n}: DrawerMenuItemProps) => {\n const { state } = useDrawer();\n const anchorEl = useRef<HTMLDivElement | null>(null);\n const { palette, spacing } = useTheme();\n const [menuOpen, setMenuOpen] = useState(false);\n const { color, fontWeight } = getDrawerItemColors(useTheme(), selected);\n\n const submenu = (\n <List component=\"div\" disablePadding>\n {items.map((item) => (\n <DrawerItem key={item.id} level={level + 1} item={item} size={size} />\n ))}\n </List>\n );\n\n const collapsedButtonSx =\n state === \"collapse\" && level === 0\n ? {\n position: \"absolute\",\n right: 0,\n }\n : {};\n\n return (\n <>\n <ListItemButton\n ref={anchorEl}\n selected={selected}\n aria-label={text}\n onClick={() => setMenuOpen((o) => !o)}\n dense={size === \"small\"}\n sx={{\n ...sx,\n pl: state === \"open\" ? spacing(2 + 1.5 * level) : undefined,\n backgroundColor: menuOpen ? palette.action.hover : undefined,\n }}\n >\n {icon && <ListItemIcon sx={{ color }}>{icon}</ListItemIcon>}\n <ListItemText\n disableTypography\n primary={text}\n sx={{ color, fontWeight, opacity: state === \"collapse\" && level === 0 ? 0 : undefined }}\n />\n {menuOpen && state === \"open\" ? (\n <ExpandMoreIcon sx={[{ color, ml: 2 }, collapsedButtonSx]} />\n ) : (\n <ChevronRightIcon sx={[{ color, ml: 2 }, collapsedButtonSx]} />\n )}\n </ListItemButton>\n {state === \"open\" ? (\n <Collapse\n in={menuOpen}\n timeout=\"auto\"\n unmountOnExit\n aria-label={`${text} collapse submenu`}\n >\n {submenu}\n </Collapse>\n ) : (\n <Popover\n open={menuOpen}\n PaperProps={{\n elevation: 0,\n variant: \"outlined\",\n }}\n aria-label={`${text} popover submenu`}\n anchorEl={anchorEl.current}\n onClose={() => setMenuOpen(false)}\n anchorOrigin={{\n vertical: \"top\",\n horizontal: \"right\",\n }}\n >\n {submenu}\n </Popover>\n )}\n </>\n );\n};\n"],"names":["DrawerContext","createContext","undefined","UndefinedProvider","Error","useDrawer","context","useContext","styled","theme","display","alignItems","justifyContent","padding","spacing","mixins","toolbar","getDrawerItemColors","selected","color","palette","primary","main","fontWeight","typography","fontWeightBold","fontWeightMedium","bulletClasses","Bullet","variant","sx","_jsx","Badge","className","role","Label","text","textTransform","useTheme","backgroundColor","default","mode","grey","light","secondary","info","warning","error","success","textColor","getContrastText","contrastText","Box","height","minWidth","bgcolor","fontSize","caption","lineHeight","whiteSpace","borderRadius","py","px","cursor","children","LinkBehaviour","forwardRef","props","ref","href","other","jsx","RouterLink","to","Link","_1","MuiLink","component","StyledLink","sxCollapsedIcon","marginRight","DrawerItemLink","icon","avatar","label","bullet","size","level","state","_jsxs","ListItemButton","LinkComponent","dense","pl","paddingHorizontal","ListItemIcon","ListItemAvatar","Avatar","alt","src","width","ListItemText","disableTypography","opacity","ml","DrawerItem","item","selectedItemId","id","items","childrenSelected","some","DrawerMenuItem","anchorEl","useRef","menuOpen","setMenuOpen","useState","submenu","List","disablePadding","map","collapsedButtonSx","position","right","_Fragment","onClick","o","action","hover","ExpandMoreIcon","ChevronRightIcon","Collapse","in","timeout","unmountOnExit","Popover","open","PaperProps","elevation","current","onClose","anchorOrigin","vertical","horizontal"],"mappings":"2/BAgBO,MAAMA,EAAgBC,EAAAA,mBAA8CC,GAC9DC,EAAoB,IAAIC,MAAM,wDAE9BC,EAAY,KACvB,MAAMC,EAAUC,aAAWP,GAE3B,QAAgBE,IAAZI,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AAc,OAAIrF,KAE7EiH,GAAsB,SAAV3B,EACXzD,EAACwC,IAAA2D,EAAc,QAAC,CAAApG,GAAI,CAAC,CAAEX,QAAOqF,GAAI,GAAKkB,KAEvC3F,EAACwC,IAAA4D,EAAgB,QAAC,CAAArG,GAAI,CAAC,CAAEX,QAAOqF,GAAI,GAAKkB,QAGlC,SAAVlC,EACCzD,MAACqG,EAAAA,QACC,CAAAC,GAAIlB,EACJmB,QAAQ,OACRC,eAAa,EAAA,aACD,GAAGnG,qBAEd4B,SAAAsD,IAGHvF,EAAAA,IAACyG,EAAAA,QAAO,CACNC,KAAMtB,EACNuB,WAAY,CACVC,UAAW,EACX9G,QAAS,YAEC,aAAA,GAAGO,oBACf6E,SAAUA,EAAS2B,QACnBC,QAAS,IAAMzB,GAAY,GAC3B0B,aAAc,CACZC,SAAU,MACVC,WAAY,SACbhF,SAEAsD,MAIP"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/drawer-provider/drawer-context.ts","../../../src/drawer/drawer.tsx","../../../src/drawer/drawer.types.ts","../../../src/bullet/bullet.tsx","../../../src/label/label.tsx","../../../src/link/link.tsx","../../../src/drawer-item/drawer-item-link.tsx","../../../src/drawer-item/drawer-item.tsx","../../../src/drawer-item/drawer-menu-item.tsx"],"sourcesContent":["import { useContext, createContext } from \"react\";\nimport { DrawerState, DrawerVariant } from \"../drawer\";\n\nexport interface DrawerContextProps {\n selectedItemId?: string;\n state: DrawerState;\n variant: DrawerVariant;\n drawerWidth: number;\n underAppBar: boolean;\n switchState(): void;\n close(): void;\n collapse(): void;\n open(): void;\n setState: (state: DrawerState) => void;\n}\n\nexport const DrawerContext = createContext<DrawerContextProps | undefined>(undefined);\nexport const UndefinedProvider = new Error(\"DrawerContext.Provider is required and was undefined\");\n\nexport const useDrawer = () => {\n const context = useContext(DrawerContext);\n\n if (context === undefined) {\n throw UndefinedProvider;\n }\n\n return context;\n};\n","import { SxProps, Theme, styled, useTheme } from \"@mui/material/styles\";\nimport MuiDrawer, { drawerClasses } from \"@mui/material/Drawer\";\nimport { paperClasses } from \"@mui/material/Paper\";\nimport Divider from \"@mui/material/Divider\";\nimport IconButton from \"@mui/material/IconButton\";\nimport ChevronLeftIcon from \"@mui/icons-material/ChevronLeft\";\nimport { DrawerComponent, DrawerProps, DrawerState, DrawerVariant } from \"./drawer.types\";\nimport { useDrawer } from \"../drawer-provider/drawer-context\";\nimport { closedMixin, openedMixin } from \"../drawer-provider/drawer-mixins\";\n\nexport const DrawerHeader = styled(\"div\")(({ theme }) => ({\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"flex-end\",\n padding: theme.spacing(0, 1),\n ...theme.mixins.toolbar,\n}));\n\nconst showCloseButton: Record<DrawerVariant, boolean> = {\n temporary: true,\n mini: true,\n persistent: true,\n clipped: false,\n};\n\nconst muiDrawerVariant: Record<DrawerVariant, \"permanent\" | \"persistent\" | \"temporary\"> = {\n temporary: \"temporary\",\n mini: \"permanent\",\n clipped: \"permanent\",\n persistent: \"persistent\",\n};\n\ntype SxGenerator = (state: DrawerState, theme: Theme) => SxProps<Theme>;\nconst NoopSxGenerator = () => ({});\nconst variantsSx: Readonly<Record<DrawerVariant, SxGenerator>> = {\n mini: (state: DrawerState, theme: Theme) => ({\n boxSizing: \"border-box\",\n [`& .${paperClasses.root}`]: {\n zIndex: theme.zIndex.drawer - 1,\n },\n }),\n temporary: NoopSxGenerator,\n clipped: NoopSxGenerator,\n persistent: NoopSxGenerator,\n};\n\nexport const Drawer: DrawerComponent = ({ children, ...rest }: DrawerProps) => {\n const theme = useTheme();\n const { state, switchState, underAppBar, close, drawerWidth, variant } = useDrawer();\n\n const sx: any = {\n width: drawerWidth,\n flexShrink: 0,\n whiteSpace: \"nowrap\",\n ...(state === \"open\" && {\n ...openedMixin(theme),\n [`& .${drawerClasses.paper}`]: openedMixin(theme),\n }),\n ...(state !== \"open\" && {\n ...closedMixin(theme),\n [`& .${drawerClasses.paper}`]: closedMixin(theme),\n }),\n ...variantsSx[variant](state, theme),\n };\n\n return (\n <MuiDrawer\n open={state === \"open\"}\n variant={muiDrawerVariant[variant]}\n role=\"menu\"\n aria-hidden={state === \"close\"}\n onClose={close}\n sx={sx}\n {...rest}\n >\n <DrawerHeader>\n {!underAppBar && showCloseButton[variant] && (\n <IconButton onClick={switchState}>\n <ChevronLeftIcon />\n </IconButton>\n )}\n </DrawerHeader>\n <Divider />\n {children}\n </MuiDrawer>\n );\n};\n","import { FunctionComponent, ReactElement } from \"react\";\nimport { BulletVariant } from \"../bullet\";\nimport { LabelVariant } from \"../label\";\nimport { DrawerProps as MuiDrawerProps } from \"@mui/material/Drawer\";\nimport { Theme } from \"@mui/material/styles\";\nimport { DrawerAppBarProps } from \"../drawer-app-bar\";\n\nexport type DrawerVariant = \"temporary\" | \"mini\" | \"persistent\" | \"clipped\";\nexport type DrawerState = \"open\" | \"collapse\" | \"close\";\nexport type DrawerSize = \"small\" | \"medium\";\n\nexport interface DrawerItemAvatar {\n src: string;\n alt: string;\n}\n\nexport interface DrawerItemLabel {\n text: string;\n variant: LabelVariant;\n}\n\nexport interface DrawerItemBullet {\n variant: BulletVariant;\n}\n\nexport interface DrawerNavigationItemLink {\n id: string;\n text: string;\n href: string;\n icon?: ReactElement;\n avatar?: DrawerItemAvatar;\n label?: DrawerItemLabel;\n bullet?: DrawerItemBullet;\n}\n\nexport type DrawerNavigationItemCollapsable = Pick<\n DrawerNavigationItemLink,\n \"id\" | \"text\" | \"icon\"\n> & {\n items: DrawerNavigationItem[];\n};\n\nexport type DrawerNavigationItem = DrawerNavigationItemLink | DrawerNavigationItemCollapsable;\n\nexport interface DrawerNavigationSection {\n title?: string;\n items: DrawerNavigationItem[];\n}\n\nexport interface DrawerNavigation {\n items: DrawerNavigationSection[];\n}\n\nexport interface DrawerContentProps {\n /**\n * Object with the content that has to be rendered\n */\n nav: DrawerNavigation;\n /**\n * Item size. default to medium\n */\n size?: DrawerSize;\n}\n\nexport type DrawerContentComponent = FunctionComponent<DrawerContentProps>;\nexport type DrawerContentElement = ReactElement<DrawerContentProps, DrawerContentComponent>;\n\nexport interface DrawerProps extends MuiDrawerProps {\n children: DrawerContentElement;\n}\n\nexport type DrawerComponent = FunctionComponent<DrawerProps>;\nexport type DrawerElement = ReactElement<DrawerProps, DrawerComponent>;\n\nexport const getDrawerItemColors = (theme: Theme, selected: boolean | undefined) => ({\n color: selected ? theme.palette.primary.main : undefined,\n fontWeight: selected ? theme.typography.fontWeightBold : theme.typography.fontWeightMedium,\n});\n\nexport type DrawerAppBarComponent = FunctionComponent<DrawerAppBarProps>;\nexport type DrawerAppBarElement = ReactElement<DrawerAppBarProps, DrawerAppBarComponent>;\n","import Badge from \"@mui/material/Badge\";\nimport { SxProps, Theme } from \"@mui/material/styles\";\n\nexport type BulletVariant = \"primary\" | \"secondary\" | \"default\" | \"info\" | \"warning\" | \"error\";\n\nexport const bulletClasses = {\n root: \"RdsBullet-root\",\n};\n\nexport interface BulletProps {\n /**\n * Color palette used to draw the component\n */\n variant?: BulletVariant;\n /**\n * Custom styles\n */\n sx?: SxProps<Theme>;\n}\n\n/**\n * Dot to attract the user attention\n */\nexport const Bullet = ({ variant = \"primary\", sx }: BulletProps) => {\n return (\n <Badge\n color={variant}\n variant=\"dot\"\n className={bulletClasses.root}\n role=\"bullet\"\n aria-describedby={variant}\n sx={sx}\n />\n );\n};\n","import Box from \"@mui/material/Box\";\nimport { SxProps, Theme, useTheme } from \"@mui/material/styles\";\n\nexport type LabelVariant =\n | \"primary\"\n | \"secondary\"\n | \"default\"\n | \"info\"\n | \"warning\"\n | \"error\"\n | \"success\";\n\nexport const labelClasses = {\n root: \"RdsLabel-root\",\n};\n\nexport interface LabelProps {\n /**\n * Content of the component\n */\n text: string;\n /**\n * Color palette used to draw the component\n */\n variant?: LabelVariant;\n\n /**\n * Custom styles\n */\n sx?: SxProps<Theme>;\n\n /**\n * Show the text as uppercase\n */\n textTransform?: \"none\" | \"capitalize\" | \"uppercase\";\n}\n\n/**\n * Compact element to represent a text\n */\nexport const Label = ({\n text,\n variant = \"default\",\n textTransform = \"capitalize\",\n sx,\n}: LabelProps) => {\n const { palette, typography } = useTheme();\n\n const backgroundColor: Record<LabelVariant, string> = {\n default: palette.mode === \"light\" ? palette.grey[100] : palette.grey[900],\n primary: palette.primary.light,\n secondary: palette.secondary.light,\n info: palette.info.light,\n warning: palette.warning.light,\n error: palette.error.light,\n success: palette.success.light,\n };\n\n const textColor: Record<LabelVariant, string> = {\n default: palette.getContrastText(backgroundColor.default),\n primary: palette.primary.contrastText,\n secondary: palette.secondary.contrastText,\n info: palette.info.contrastText,\n warning: palette.warning.contrastText,\n error: palette.error.contrastText,\n success: palette.success.contrastText,\n };\n\n return (\n <Box\n height={24}\n minWidth={22}\n display=\"inline-flex\"\n justifyContent=\"center\"\n alignItems=\"center\"\n bgcolor={backgroundColor[variant]}\n color={textColor[variant]}\n fontSize={typography.caption.fontSize}\n fontWeight={typography.fontWeightBold}\n lineHeight={0}\n textTransform={textTransform}\n whiteSpace=\"nowrap\"\n borderRadius={2}\n role=\"label\"\n aria-label={`${text} ${variant} label`}\n py={0}\n px={1}\n sx={{ cursor: \"default\", ...sx }}\n >\n {text}\n </Box>\n );\n};\n","import { Link as RouterLink, LinkProps as RouterLinkProps } from \"react-router-dom\";\nimport { forwardRef } from \"react\";\nimport MuiLink, { LinkProps } from \"@mui/material/Link\";\n\n/* eslint-disable react/display-name, @typescript-eslint/no-explicit-any */\nexport const LinkBehaviour = forwardRef<\n any,\n Omit<RouterLinkProps, \"to\"> & { href: RouterLinkProps[\"to\"] }\n>((props, ref) => {\n const { href, ...other } = props;\n return <RouterLink ref={ref} to={href} {...other} />;\n});\n\nexport const Link = forwardRef<any, LinkProps>((props, _1) => {\n return <MuiLink {...(props as any)} component={LinkBehaviour} />;\n});\n","import { ReactElement } from \"react\";\nimport Avatar from \"@mui/material/Avatar\";\nimport ListItemAvatar from \"@mui/material/ListItemAvatar\";\nimport ListItemButton from \"@mui/material/ListItemButton\";\nimport ListItemIcon from \"@mui/material/ListItemIcon\";\nimport ListItemText from \"@mui/material/ListItemText\";\nimport { SxProps, Theme, styled, useTheme } from \"@mui/material/styles\";\nimport { Bullet } from \"../bullet\";\nimport { Label } from \"../label\";\nimport {\n DrawerItemAvatar,\n DrawerItemBullet,\n DrawerItemLabel,\n DrawerSize,\n getDrawerItemColors,\n} from \"../drawer/drawer.types\";\nimport { Link } from \"../link\";\nimport { useDrawer } from \"../drawer-provider\";\n\nexport interface DrawerItemLinkProps {\n /**\n * Item size. default to medium\n */\n size?: DrawerSize;\n /**\n * Text displayed inside the item\n */\n text: string;\n /**\n * Url where the user is going to be redirected\n * if the item is clicked\n */\n href: string;\n /**\n * Icon displayed to the left\n */\n icon?: ReactElement;\n /**\n * Avatar displayed to the left\n */\n avatar?: DrawerItemAvatar;\n /**\n * Label with extra info displayed to the right\n */\n label?: DrawerItemLabel;\n /**\n * Bullet to attract the user attention displyed to the right\n */\n bullet?: DrawerItemBullet;\n /**\n * The item has to be marked as selected\n */\n selected?: boolean;\n /**\n * Deep level of this item inside the submenus\n */\n level: number;\n /**\n * Custom styles\n */\n sx?: SxProps<Theme>;\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nconst StyledLink = styled(Link)(({ theme }) => {\n return {\n color: theme.palette.text.primary,\n };\n});\n\nconst sxCollapsedIcon = {\n minWidth: 0,\n justifyContent: \"center\",\n marginRight: \"auto\",\n};\n\n/**\n * Clicable item inside a drawer\n */\nexport const DrawerItemLink = ({\n text,\n icon,\n avatar,\n label,\n bullet,\n href,\n selected,\n size = \"medium\",\n level,\n sx,\n}: DrawerItemLinkProps) => {\n const { state } = useDrawer();\n const theme = useTheme();\n const { color, fontWeight } = getDrawerItemColors(theme, selected);\n\n return (\n <ListItemButton\n LinkComponent={StyledLink}\n dense={size === \"small\"}\n aria-label={text}\n href={href}\n selected={selected}\n sx={{\n ...sx,\n pl: state === \"open\" ? theme.spacing(2 + 1.5 * level) : undefined,\n ...(state === \"collapse\" && {\n paddingHorizontal: theme.spacing(2.5),\n justifyContent: \"center\",\n }),\n }}\n >\n {icon && (\n <ListItemIcon sx={{ color, ...(state === \"collapse\" && level === 0 && sxCollapsedIcon) }}>\n {icon}\n </ListItemIcon>\n )}\n {avatar && (\n <ListItemAvatar\n sx={{\n ...(state === \"collapse\" && level === 0 && sxCollapsedIcon),\n }}\n >\n <Avatar\n alt={avatar.alt}\n src={avatar.src}\n sx={{\n ...(size === \"small\" && { width: 24, height: 24 }),\n ...(state === \"collapse\" && { width: 30, height: 30 }),\n }}\n />\n </ListItemAvatar>\n )}\n <ListItemText\n disableTypography\n primary={text}\n sx={{ color, fontWeight, opacity: state === \"collapse\" && level === 0 ? 0 : undefined }}\n />\n {label && state === \"open\" && (\n <Label text={label.text} variant={label.variant} sx={{ ml: 2 }} />\n )}\n {bullet && state === \"open\" && <Bullet variant={bullet.variant} sx={{ ml: 2 }} />}\n </ListItemButton>\n );\n};\n","import { DrawerMenuItem } from \"./drawer-menu-item\";\nimport { DrawerNavigationItem, DrawerSize } from \"../drawer/drawer.types\";\nimport { DrawerItemLink } from \"./drawer-item-link\";\nimport { useDrawer } from \"../drawer-provider\";\n\nexport interface DrawerItemProps {\n /**\n * Data to be rendered\n */\n item: DrawerNavigationItem;\n /**\n * Size of the item\n */\n size?: DrawerSize;\n /**\n * Deep level of this item inside the submenus\n */\n level?: number;\n}\n\nexport const DrawerItem = ({ item, size = \"medium\", level = 0 }: DrawerItemProps) => {\n const { selectedItemId } = useDrawer();\n if (\"items\" in item) {\n const { id, text, icon, items } = item;\n const childrenSelected = items.some((item) => item.id === selectedItemId);\n return (\n <DrawerMenuItem\n size={size}\n selected={id === selectedItemId || childrenSelected}\n text={text}\n icon={icon}\n items={items}\n level={level}\n />\n );\n } else {\n const { id, text, icon, avatar, label, bullet, href } = item;\n return (\n <DrawerItemLink\n selected={id === selectedItemId}\n size={size}\n text={text}\n icon={icon}\n avatar={avatar}\n label={label}\n bullet={bullet}\n href={href}\n level={level}\n />\n );\n }\n};\n","import ListItemButton from \"@mui/material/ListItemButton\";\nimport ListItemIcon from \"@mui/material/ListItemIcon\";\nimport ListItemText from \"@mui/material/ListItemText\";\nimport Collapse from \"@mui/material/Collapse\";\nimport List from \"@mui/material/List\";\nimport Popover from \"@mui/material/Popover\";\nimport { SxProps, useTheme, Theme } from \"@mui/material/styles\";\nimport { ReactElement, useState, useRef } from \"react\";\nimport { DrawerNavigationItem, DrawerSize, getDrawerItemColors } from \"../drawer\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\nimport ChevronRightIcon from \"@mui/icons-material/ChevronRight\";\nimport { DrawerItem } from \"./drawer-item\";\nimport { useDrawer } from \"../drawer-provider\";\n\nexport interface DrawerMenuItemProps {\n /**\n * Item size. default to medium\n */\n size?: DrawerSize;\n /**\n * Text displayed inside the item\n */\n text: string;\n /**\n * Icon displayed to the left\n */\n icon?: ReactElement;\n /**\n * The item has to be marked as selected\n */\n selected?: boolean;\n /**\n * Items that are going to be displayed inside\n * the collapsable\n */\n items: DrawerNavigationItem[];\n /**\n * Deep level of this item inside the submenus\n */\n level: number;\n /**\n * Custom styles\n */\n sx?: SxProps<Theme>;\n}\n\nexport const DrawerMenuItem = ({\n text,\n icon,\n selected,\n items,\n size = \"medium\",\n level,\n sx = {},\n}: DrawerMenuItemProps) => {\n const { state } = useDrawer();\n const anchorEl = useRef<HTMLDivElement | null>(null);\n const { palette, spacing } = useTheme();\n const [menuOpen, setMenuOpen] = useState(false);\n const { color, fontWeight } = getDrawerItemColors(useTheme(), selected);\n\n const submenu = (\n <List component=\"div\" disablePadding>\n {items.map((item) => (\n <DrawerItem key={item.id} level={level + 1} item={item} size={size} />\n ))}\n </List>\n );\n\n const collapsedButtonSx =\n state === \"collapse\" && level === 0\n ? {\n position: \"absolute\",\n right: 0,\n }\n : {};\n\n return (\n <>\n <ListItemButton\n ref={anchorEl}\n selected={selected}\n aria-label={text}\n onClick={() => setMenuOpen((o) => !o)}\n dense={size === \"small\"}\n sx={{\n ...sx,\n pl: state === \"open\" ? spacing(2 + 1.5 * level) : undefined,\n backgroundColor: menuOpen ? palette.action.hover : undefined,\n }}\n >\n {icon && <ListItemIcon sx={{ color }}>{icon}</ListItemIcon>}\n <ListItemText\n disableTypography\n primary={text}\n sx={{ color, fontWeight, opacity: state === \"collapse\" && level === 0 ? 0 : undefined }}\n />\n {menuOpen && state === \"open\" ? (\n <ExpandMoreIcon sx={[{ color, ml: 2 }, collapsedButtonSx]} />\n ) : (\n <ChevronRightIcon sx={[{ color, ml: 2 }, collapsedButtonSx]} />\n )}\n </ListItemButton>\n {state === \"open\" ? (\n <Collapse\n in={menuOpen}\n timeout=\"auto\"\n unmountOnExit\n aria-label={`${text} collapse submenu`}\n >\n {submenu}\n </Collapse>\n ) : (\n <Popover\n open={menuOpen}\n PaperProps={{\n elevation: 0,\n variant: \"outlined\",\n }}\n aria-label={`${text} popover submenu`}\n anchorEl={anchorEl.current}\n onClose={() => setMenuOpen(false)}\n anchorOrigin={{\n vertical: \"top\",\n horizontal: \"right\",\n }}\n >\n {submenu}\n </Popover>\n )}\n </>\n );\n};\n"],"names":["DrawerContext","createContext","undefined","UndefinedProvider","Error","useDrawer","context","useContext","styled","theme","display","alignItems","justifyContent","padding","spacing","mixins","toolbar","getDrawerItemColors","selected","color","palette","primary","main","fontWeight","typography","fontWeightBold","fontWeightMedium","bulletClasses","Bullet","variant","sx","_jsx","Badge","className","role","Label","text","textTransform","useTheme","backgroundColor","default","mode","grey","light","secondary","info","warning","error","success","textColor","getContrastText","contrastText","Box","height","minWidth","bgcolor","fontSize","caption","lineHeight","whiteSpace","borderRadius","py","px","cursor","children","LinkBehaviour","forwardRef","props","ref","href","other","jsx","RouterLink","to","Link","_1","MuiLink","component","StyledLink","sxCollapsedIcon","marginRight","DrawerItemLink","icon","avatar","label","bullet","size","level","state","_jsxs","ListItemButton","LinkComponent","dense","pl","paddingHorizontal","ListItemIcon","ListItemAvatar","Avatar","alt","src","width","ListItemText","disableTypography","opacity","ml","DrawerItem","item","selectedItemId","id","items","childrenSelected","some","DrawerMenuItem","anchorEl","useRef","menuOpen","setMenuOpen","useState","submenu","List","disablePadding","map","collapsedButtonSx","position","right","_Fragment","onClick","o","action","hover","ExpandMoreIcon","ChevronRightIcon","Collapse","in","timeout","unmountOnExit","Popover","open","PaperProps","elevation","current","onClose","anchorOrigin","vertical","horizontal"],"mappings":"2/BAgBO,MAAMA,EAAgBC,EAAAA,mBAA8CC,GAC9DC,EAAoB,IAAIC,MAAM,wDAE9BC,EAAY,KACvB,MAAMC,EAAUC,aAAWP,GAE3B,QAAgBE,IAAZI,EACF,MAAMH,EAGR,OAAOG,CAAO,EChBYE,EAAMA,OAAC,MAAPA,EAAc,EAAGC,YAAa,CACxDC,QAAS,OACTC,WAAY,SACZC,eAAgB,WAChBC,QAASJ,EAAMK,QAAQ,EAAG,MACvBL,EAAMM,OAAOC,YC2DX,MAAMC,EAAsB,CAACR,EAAcS,KAAmC,CACnFC,MAAOD,EAAWT,EAAMW,QAAQC,QAAQC,UAAOpB,EAC/CqB,WAAYL,EAAWT,EAAMe,WAAWC,eAAiBhB,EAAMe,WAAWE,mBCvE/DC,EACL,iBAiBKC,EAAS,EAAGC,UAAU,UAAWC,QAE1CC,EAAAA,IAACC,EAAAA,QAAK,CACJb,MAAOU,EACPA,QAAQ,MACRI,UAAWN,EACXO,KAAK,SAAQ,mBACKL,EAClBC,GAAIA,ICSGK,EAAQ,EACnBC,OACAP,UAAU,UACVQ,gBAAgB,aAChBP,SAEA,MAAMV,QAAEA,EAAOI,WAAEA,GAAec,EAAQA,WAElCC,EAAgD,CACpDC,QAA0B,UAAjBpB,EAAQqB,KAAmBrB,EAAQsB,KAAK,KAAOtB,EAAQsB,KAAK,KACrErB,QAASD,EAAQC,QAAQsB,MACzBC,UAAWxB,EAAQwB,UAAUD,MAC7BE,KAAMzB,EAAQyB,KAAKF,MACnBG,QAAS1B,EAAQ0B,QAAQH,MACzBI,MAAO3B,EAAQ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S,IAAMV,GAAaW,IAAOA,IACnCnC,MAAgB,UAATN,EACPxD,GAAI,IACCA,EACH+D,GAAc,SAAVL,EAAmB1E,EAAQ,EAAI,IAAMyE,QAASrF,EAClDqC,gBAAiB4E,EAAW/F,EAAQ4G,OAAOC,WAAQ/H,GACpD8D,SAAA,CAEAkB,GAAQnD,EAACwC,IAAAwB,EAAY,SAACjE,GAAI,CAAEX,SAAO6C,SAAGkB,IACvCnD,EAACwC,IAAA8B,UACC,CAAAC,mBACA,EAAAjF,QAASe,EACTN,GAAI,CAAEX,QAAOI,aAAYgF,QAAmB,aAAVf,GAAkC,IAAVD,EAAc,OAAIrF,KAE7EiH,GAAsB,SAAV3B,EACXzD,EAACwC,IAAA2D,EAAc,QAAC,CAAApG,GAAI,CAAC,CAAEX,QAAOqF,GAAI,GAAKkB,KAEvC3F,EAACwC,IAAA4D,EAAgB,QAAC,CAAArG,GAAI,CAAC,CAAEX,QAAOqF,GAAI,GAAKkB,QAGlC,SAAVlC,EACCzD,MAACqG,EAAAA,QACC,CAAAC,GAAIlB,EACJmB,QAAQ,OACRC,eAAa,EAAA,aACD,GAAGnG,qBAEd4B,SAAAsD,IAGHvF,EAAAA,IAACyG,EAAAA,QAAO,CACNC,KAAMtB,EACNuB,WAAY,CACVC,UAAW,EACX9G,QAAS,YAEC,aAAA,GAAGO,oBACf6E,SAAUA,EAAS2B,QACnBC,QAAS,IAAMzB,GAAY,GAC3B0B,aAAc,CACZC,SAAU,MACVC,WAAY,SACbhF,SAEAsD,MAIP"}
@@ -1,6 +1,6 @@
1
1
  import { ReactElement } from "react";
2
2
  import { SxProps, Theme } from "@mui/material/styles";
3
- import { DrawerItemAvatar, DrawerItemBullet, DrawerItemLabel, DrawerSize } from "~/drawer/drawer.types";
3
+ import { DrawerItemAvatar, DrawerItemBullet, DrawerItemLabel, DrawerSize } from "../drawer/drawer.types";
4
4
  export interface DrawerItemLinkProps {
5
5
  /**
6
6
  * Item size. default to medium
@@ -1,4 +1,4 @@
1
- import { DrawerNavigationItem, DrawerSize } from "~/drawer/drawer.types";
1
+ import { DrawerNavigationItem, DrawerSize } from "../drawer/drawer.types";
2
2
  export interface DrawerItemProps {
3
3
  /**
4
4
  * Data to be rendered
@@ -1,6 +1,6 @@
1
1
  import { SxProps, Theme } from "@mui/material/styles";
2
2
  import { ReactElement } from "react";
3
- import { DrawerNavigationItem, DrawerSize } from "~/drawer";
3
+ import { DrawerNavigationItem, DrawerSize } from "../drawer";
4
4
  export interface DrawerMenuItemProps {
5
5
  /**
6
6
  * Item size. default to medium