@pautena/react-design-system 0.17.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/{drawer → drawerx/drawer}/drawer.d.ts +1 -1
  2. package/dist/{drawer → drawerx/drawer}/drawer.mock.d.ts +5 -7
  3. package/dist/drawerx/drawer/index.d.ts +1 -0
  4. package/dist/{drawer-content → drawerx/drawer-content}/drawer-content.d.ts +1 -1
  5. package/dist/{drawer-provider → drawerx/drawer-context}/drawer-context.d.ts +12 -2
  6. package/dist/drawerx/drawer-context/drawer.provider.d.ts +17 -0
  7. package/dist/{drawer-provider → drawerx/drawer-context}/index.d.ts +0 -1
  8. package/dist/{drawer-item → drawerx/drawer-item}/drawer-item-link.d.ts +2 -6
  9. package/dist/drawerx/drawer-item/drawer-item.d.ts +12 -0
  10. package/dist/{drawer-item → drawerx/drawer-item}/drawer-menu-item.d.ts +2 -6
  11. package/dist/drawerx/drawer-layout/drawer-layout.d.ts +20 -0
  12. package/dist/drawerx/drawer-subheader/drawer-subheader.d.ts +3 -0
  13. package/dist/{drawer → drawerx}/drawer.types.d.ts +13 -16
  14. package/dist/drawerx/index.d.ts +7 -0
  15. package/dist/index.cjs.js +106 -106
  16. package/dist/index.cjs.js.map +1 -1
  17. package/dist/index.d.ts +2 -8
  18. package/dist/index.es.js +10945 -10544
  19. package/dist/index.es.js.map +1 -1
  20. package/package.json +2 -2
  21. package/dist/drawer/index.d.ts +0 -2
  22. package/dist/drawer-item/drawer-item.d.ts +0 -16
  23. package/dist/drawer-layout/drawer-layout.d.ts +0 -8
  24. package/dist/drawer-provider/drawer.provider.d.ts +0 -11
  25. package/dist/drawer-section/drawer-section.d.ts +0 -20
  26. package/dist/drawer-section/index.d.ts +0 -1
  27. package/dist/drawer-subheader/drawer-subheader.d.ts +0 -9
  28. /package/dist/{drawer-app-bar → drawerx/drawer-app-bar}/drawer-app-bar.d.ts +0 -0
  29. /package/dist/{drawer-app-bar → drawerx/drawer-app-bar}/index.d.ts +0 -0
  30. /package/dist/{drawer-content → drawerx/drawer-content}/index.d.ts +0 -0
  31. /package/dist/{drawer-provider → drawerx/drawer-context}/drawer-mixins.d.ts +0 -0
  32. /package/dist/{drawer-item → drawerx/drawer-item}/index.d.ts +0 -0
  33. /package/dist/{drawer-layout → drawerx/drawer-layout}/index.d.ts +0 -0
  34. /package/dist/{drawer-main → drawerx/drawer-main}/drawer-main.d.ts +0 -0
  35. /package/dist/{drawer-main → drawerx/drawer-main}/index.d.ts +0 -0
  36. /package/dist/{drawer-subheader → drawerx/drawer-subheader}/index.d.ts +0 -0
@@ -1,4 +1,4 @@
1
1
  import { Theme } from '@mui/material/styles';
2
- import { DrawerComponent } from './drawer.types';
2
+ import { DrawerComponent } from '../drawer.types';
3
3
  export declare const DrawerHeader: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<Theme>, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
4
4
  export declare const Drawer: DrawerComponent;
@@ -1,13 +1,11 @@
1
- import { DrawerNavigation, DrawerNavigationItem, DrawerNavigationItemCollapsable, DrawerNavigationItemLink, DrawerNavigationSection } from './drawer.types';
2
- export declare const mockLinkDrawerNavigationItem: DrawerNavigationItemLink;
3
- export declare const mockLinkNoIconDrawerNavigationItem: DrawerNavigationItemLink;
1
+ import { DrawerNavigation, DrawerNavigationItem, DrawerNavigationCollapsable, DrawerNavigationLink } from '../drawer.types';
2
+ export declare const mockLinkDrawerNavigationItem: DrawerNavigationLink;
3
+ export declare const mockLinkNoIconDrawerNavigationItem: DrawerNavigationLink;
4
4
  export declare const mockLinkBulletDrawerNavigationItem: DrawerNavigationItem;
5
5
  export declare const mockLinkLabelDrawerNavigationItem: DrawerNavigationItem;
6
6
  export declare const mockLinkAvatarDrawerNavigationItem: DrawerNavigationItem;
7
7
  export declare const mockListDrawerNavigationItems: DrawerNavigationItem[];
8
- export declare const mockMenuDrawerNavigationItem: DrawerNavigationItemCollapsable;
8
+ export declare const mockMenuDrawerNavigationItem: DrawerNavigationCollapsable;
9
9
  export declare const mockMenuInsideMenuDrawerNavigationItem: DrawerNavigationItem;
10
- export declare const mockListDrawerNavigationSection: DrawerNavigationSection;
11
- export declare const mockMenuDrawerNavigationSection: DrawerNavigationSection;
12
- export declare const mockAvatarsDrawerNavigationSection: DrawerNavigationSection;
10
+ export declare const mockListDrawerNavigationItems2: DrawerNavigationItem[];
13
11
  export declare const mockDrawerNavigation: DrawerNavigation;
@@ -0,0 +1 @@
1
+ export * from './drawer';
@@ -1,4 +1,4 @@
1
- import { DrawerContentComponent } from '../drawer';
1
+ import { DrawerContentComponent } from '../drawer.types';
2
2
  /**
3
3
  * Content to be shown inside a navigation
4
4
  */
@@ -1,10 +1,20 @@
1
- import { DrawerState, DrawerVariant } from '../drawer';
1
+ import { ElementType } from 'react';
2
+ import { DrawerSize, DrawerState, DrawerVariant } from '../drawer.types';
2
3
  export interface DrawerContextProps {
3
4
  selectedItemId?: string;
5
+ /**
6
+ * Item size. default to medium
7
+ */
8
+ size: DrawerSize;
4
9
  state: DrawerState;
5
10
  variant: DrawerVariant;
6
11
  drawerWidth: number;
7
- underAppBar: boolean;
12
+ clipped: boolean;
13
+ /**
14
+ * The component used to render a link when the `href` prop is provided.
15
+ * @default 'a'
16
+ */
17
+ LinkComponent?: ElementType;
8
18
  switchState(): void;
9
19
  close(): void;
10
20
  collapse(): void;
@@ -0,0 +1,17 @@
1
+ import { ElementType, PropsWithChildren } from 'react';
2
+ import { DrawerSize, DrawerState, DrawerVariant } from '../drawer.types';
3
+ export type DrawerProviderProps = PropsWithChildren<{
4
+ initialState?: DrawerState;
5
+ size?: DrawerSize;
6
+ clipped?: boolean;
7
+ drawerWidth?: number;
8
+ variant?: DrawerVariant;
9
+ selectedItemId?: string;
10
+ /**
11
+ * The component used to render a link when the `href` prop is provided.
12
+ * @default 'a'
13
+ */
14
+ LinkComponent?: ElementType;
15
+ onStateChange?: (newState: DrawerState) => void;
16
+ }>;
17
+ export declare const DrawerProvider: ({ children, initialState: initialStateProp, variant, size, drawerWidth: drawerWidthProp, clipped, selectedItemId, LinkComponent, onStateChange, }: DrawerProviderProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,2 @@
1
- export * from '../drawer/drawer';
2
1
  export * from './drawer.provider';
3
2
  export * from './drawer-context';
@@ -1,11 +1,7 @@
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 } from '../drawer.types';
4
4
  export interface DrawerItemLinkProps {
5
- /**
6
- * Item size. default to medium
7
- */
8
- size?: DrawerSize;
9
5
  /**
10
6
  * Text displayed inside the item
11
7
  */
@@ -47,4 +43,4 @@ export interface DrawerItemLinkProps {
47
43
  /**
48
44
  * Clicable item inside a drawer
49
45
  */
50
- export declare const DrawerItemLink: ({ text, icon, avatar, label, bullet, href, selected, size, level, sx, }: DrawerItemLinkProps) => import("react/jsx-runtime").JSX.Element;
46
+ export declare const DrawerItemLink: ({ text, icon, avatar, label, bullet, href, selected, level, sx, }: DrawerItemLinkProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { DrawerNavigationItem } from '../drawer.types';
2
+ export interface DrawerItemProps {
3
+ /**
4
+ * Data to be rendered
5
+ */
6
+ item: DrawerNavigationItem;
7
+ /**
8
+ * Deep level of this item inside the submenus
9
+ */
10
+ level?: number;
11
+ }
12
+ export declare const DrawerItem: ({ item, level }: DrawerItemProps) => false | import("react/jsx-runtime").JSX.Element;
@@ -1,11 +1,7 @@
1
1
  import { SxProps, Theme } from '@mui/material/styles';
2
2
  import { ReactElement } from 'react';
3
- import { DrawerNavigationItem, DrawerSize } from '../drawer';
3
+ import { DrawerNavigationItem } from '../drawer.types';
4
4
  export interface DrawerMenuItemProps {
5
- /**
6
- * Item size. default to medium
7
- */
8
- size?: DrawerSize;
9
5
  /**
10
6
  * Text displayed inside the item
11
7
  */
@@ -32,4 +28,4 @@ export interface DrawerMenuItemProps {
32
28
  */
33
29
  sx?: SxProps<Theme>;
34
30
  }
35
- export declare const DrawerMenuItem: ({ text, icon, selected, items, size, level, sx, }: DrawerMenuItemProps) => import("react/jsx-runtime").JSX.Element;
31
+ export declare const DrawerMenuItem: ({ text, icon, selected, items, level, sx, }: DrawerMenuItemProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { DrawerProviderProps } from '../drawer-context';
2
+ import { DrawerAppBarProps } from '../drawer-app-bar';
3
+ import { DrawerContentProps, DrawerNavigation, DrawerProps } from '../drawer.types';
4
+ export interface DrawerLayoutSlots {
5
+ drawerAppBar?: React.JSXElementConstructor<DrawerAppBarProps>;
6
+ drawer?: React.JSXElementConstructor<DrawerProps>;
7
+ drawerContent?: React.JSXElementConstructor<DrawerContentProps>;
8
+ }
9
+ export interface DrawerLayoutSlotProps {
10
+ drawerAppBar?: DrawerAppBarProps;
11
+ drawer?: DrawerProps;
12
+ drawerContent?: DrawerContentProps;
13
+ }
14
+ export interface DrawerLayoutProps extends DrawerProviderProps {
15
+ title: string;
16
+ navigation: DrawerNavigation;
17
+ slots?: DrawerLayoutSlots;
18
+ slotsProps?: DrawerLayoutSlotProps;
19
+ }
20
+ export declare const DrawerLayout: ({ children, navigation, title, slots, slotsProps, ...rest }: DrawerLayoutProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { ListSubheaderProps } from '@mui/material/ListSubheader';
2
+ export type DrawerSubheaderProps = ListSubheaderProps;
3
+ export declare const DrawerSubheader: ({ sx, ...rest }: DrawerSubheaderProps) => import("react/jsx-runtime").JSX.Element;
@@ -3,8 +3,8 @@ import { BulletVariant } from '../bullet';
3
3
  import { LabelVariant } from '../label';
4
4
  import { DrawerProps as MuiDrawerProps } from '@mui/material/Drawer';
5
5
  import { Theme } from '@mui/material/styles';
6
- import { DrawerAppBarProps } from '../drawer-app-bar';
7
- export type DrawerVariant = "temporary" | "mini" | "persistent" | "clipped";
6
+ import { DrawerAppBarProps } from './drawer-app-bar';
7
+ export type DrawerVariant = "temporary" | "mini" | "persistent";
8
8
  export type DrawerState = "open" | "collapse" | "close";
9
9
  export type DrawerSize = "small" | "medium";
10
10
  export interface DrawerItemAvatar {
@@ -18,7 +18,8 @@ export interface DrawerItemLabel {
18
18
  export interface DrawerItemBullet {
19
19
  variant: BulletVariant;
20
20
  }
21
- export interface DrawerNavigationItemLink {
21
+ export interface DrawerNavigationLink {
22
+ kind: "link";
22
23
  id: string;
23
24
  text: string;
24
25
  href: string;
@@ -27,26 +28,22 @@ export interface DrawerNavigationItemLink {
27
28
  label?: DrawerItemLabel;
28
29
  bullet?: DrawerItemBullet;
29
30
  }
30
- export type DrawerNavigationItemCollapsable = Pick<DrawerNavigationItemLink, "id" | "text" | "icon"> & {
31
+ export type DrawerNavigationCollapsable = Pick<DrawerNavigationLink, "id" | "text" | "icon"> & {
32
+ kind: "collapsable";
31
33
  items: DrawerNavigationItem[];
32
34
  };
33
- export type DrawerNavigationItem = DrawerNavigationItemLink | DrawerNavigationItemCollapsable;
34
- export interface DrawerNavigationSection {
35
- title?: string;
36
- items: DrawerNavigationItem[];
37
- }
38
- export interface DrawerNavigation {
39
- items: DrawerNavigationSection[];
35
+ export interface DrawerNavigationHeader {
36
+ kind: "header";
37
+ id: string;
38
+ text: string;
40
39
  }
40
+ export type DrawerNavigationItem = DrawerNavigationLink | DrawerNavigationCollapsable | DrawerNavigationHeader;
41
+ export type DrawerNavigation = DrawerNavigationItem[];
41
42
  export interface DrawerContentProps {
42
43
  /**
43
44
  * Object with the content that has to be rendered
44
45
  */
45
- nav: DrawerNavigation;
46
- /**
47
- * Item size. default to medium
48
- */
49
- size?: DrawerSize;
46
+ navigation: DrawerNavigation;
50
47
  }
51
48
  export type DrawerContentComponent = FunctionComponent<DrawerContentProps>;
52
49
  export type DrawerContentElement = ReactElement<DrawerContentProps, DrawerContentComponent>;
@@ -0,0 +1,7 @@
1
+ export * from './drawer-subheader';
2
+ export * from './drawer';
3
+ export * from './drawer-context';
4
+ export * from './drawer-content';
5
+ export * from './drawer-app-bar';
6
+ export * from './drawer-main';
7
+ export * from './drawer.types';