@groupeactual/ui-kit 0.2.7 → 0.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -5,20 +5,26 @@ import { ButtonProps } from '@mui/material/Button';
5
5
  import * as react from 'react';
6
6
  import { FocusEventHandler, ChangeEventHandler, ReactNode, PropsWithChildren } from 'react';
7
7
  import { TextFieldProps } from '@mui/material/TextField';
8
- import { SxProps, Theme } from '@mui/system';
8
+ import { SxProps, Theme as Theme$1 } from '@mui/system';
9
9
  import { IconProp } from '@fortawesome/fontawesome-svg-core';
10
10
 
11
- interface Props$6 extends TypographyProps {
12
- variant?: 'body1' | 'body2' | 'caption';
11
+ interface Props$7 extends Omit<TypographyProps, 'variant'> {
12
+ variant?: 'big_number' | 'body1_regular' | 'body1_medium' | 'body1_bold' | 'body2_regular' | 'body2_medium' | 'body2_bold' | 'caption' | 'button_notif';
13
+ component?: any;
14
+ }
15
+ declare const Text: (props: Props$7) => JSX.Element;
16
+
17
+ interface Props$6 extends Omit<TypographyProps, 'variant'> {
18
+ variant?: 'link1' | 'link2';
13
19
  component?: string;
14
20
  }
15
- declare const ActText: (props: Props$6) => JSX.Element;
21
+ declare const Link: (props: Props$6) => JSX.Element;
16
22
 
17
23
  interface Props$5 extends Omit<TypographyProps$1, 'paragraph'> {
18
- variant: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'subtitle1' | 'subtitle2';
24
+ variant?: 'h1' | 'h2' | 'h3' | 'h4';
19
25
  component?: string;
20
26
  }
21
- declare const ActHeading: (props: Props$5) => JSX.Element;
27
+ declare const Heading: (props: Props$5) => JSX.Element;
22
28
 
23
29
  declare type ActButtonType = (props: ButtonProps) => JSX.Element | null;
24
30
  declare const ActButton: ActButtonType;
@@ -42,7 +48,7 @@ interface Props$3 {
42
48
  value: boolean;
43
49
  name: string;
44
50
  onChange: (field: string, value: any, shouldValidate?: boolean | undefined) => void;
45
- sx: SxProps<Theme>;
51
+ sx: SxProps<Theme$1>;
46
52
  }
47
53
  declare const Checkbox: ({ name, value, error, label, onChange, sx }: Props$3) => JSX.Element;
48
54
 
@@ -62,15 +68,16 @@ interface Props$1 {
62
68
  }
63
69
  declare const IconProvider: ({ variant, icon, color, size }: Props$1) => JSX.Element;
64
70
 
71
+ declare type Theme = 'Default' | 'Ep';
65
72
  interface DesignSystemContextValues {
66
73
  isDarkTheme: boolean;
67
- themeName: string;
74
+ themeName: Theme;
68
75
  toggleDarkTheme: () => void;
69
76
  }
70
77
  declare const DesignSystemContext: react.Context<DesignSystemContextValues>;
71
78
  interface Props {
72
- name?: DesignSystemContextValues['themeName'];
79
+ name?: Theme;
73
80
  }
74
81
  declare const DesignSystemProvider: ({ children, name }: PropsWithChildren<Props>) => JSX.Element;
75
82
 
76
- export { ActAccordion, ActButton, Checkbox as ActCheckbox, ActHeading, ActText, DesignSystemContext, DesignSystemContextValues, DesignSystemProvider, IconProvider, TextField };
83
+ export { ActAccordion as Accordion, ActButton as Button, Checkbox, DesignSystemContext, DesignSystemContextValues, DesignSystemProvider, Heading, IconProvider, Link, Text, TextField };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@groupeactual/ui-kit",
3
- "version": "0.2.7",
3
+ "version": "0.2.9",
4
4
  "description": "A simple template for a custom React component library",
5
5
  "scripts": {
6
6
  "build": "rollup -c",
@@ -9,20 +9,25 @@ import { useMaterialThemeTokens } from '@groupeactual/design-tokens';
9
9
  import { ThemeProvider } from '@emotion/react';
10
10
  import { createTheme } from '@mui/material';
11
11
 
12
+ // Deux themes pour le moment :
13
+ // Default = Theme backoffice Material
14
+ // Ep = Espace personnel
15
+ type Theme = 'Default' | 'Ep';
16
+
12
17
  export interface DesignSystemContextValues {
13
18
  isDarkTheme: boolean;
14
- themeName: string;
19
+ themeName: Theme;
15
20
  toggleDarkTheme: () => void;
16
21
  }
17
22
 
18
23
  export const DesignSystemContext = createContext<DesignSystemContextValues>({
19
24
  isDarkTheme: false,
20
- themeName: 'default',
25
+ themeName: 'Default',
21
26
  toggleDarkTheme: () => {}
22
27
  });
23
28
 
24
29
  interface Props {
25
- name?: DesignSystemContextValues['themeName'];
30
+ name?: Theme;
26
31
  }
27
32
 
28
33
  const MaterialThemeProvider = ({ children }: PropsWithChildren<unknown>) => {
@@ -36,7 +41,7 @@ const MaterialThemeProvider = ({ children }: PropsWithChildren<unknown>) => {
36
41
 
37
42
  const DesignSystemProvider = ({
38
43
  children,
39
- name: themeName = 'default'
44
+ name: themeName = 'Default'
40
45
  }: PropsWithChildren<Props>) => {
41
46
  const [isDarkTheme, setIsDarkTheme] = useState(false);
42
47
 
@@ -1,11 +1,10 @@
1
1
  import Typography, { TypographyProps } from '@mui/material/Typography';
2
2
 
3
-
4
3
  interface Props extends Omit<TypographyProps, 'paragraph'> {
5
- variant: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'subtitle1' | 'subtitle2';
4
+ variant?: 'h1' | 'h2' | 'h3' | 'h4';
6
5
  component?: string;
7
6
  }
8
7
 
9
- const ActHeading = (props: Props) => <Typography {...props} />;
8
+ const Heading = (props: Props) => <Typography {...props} />;
10
9
 
11
- export default ActHeading;
10
+ export default Heading;
@@ -0,0 +1,10 @@
1
+ import { Typography, TypographyProps } from '@mui/material';
2
+
3
+ interface Props extends Omit<TypographyProps, 'variant'> {
4
+ variant?: 'link1' | 'link2';
5
+ component?: string;
6
+ }
7
+
8
+ const Link = (props: Props) => <Typography {...(props as TypographyProps)} />;
9
+
10
+ export default Link;
@@ -0,0 +1 @@
1
+ export { default } from './Link';
@@ -1,10 +1,20 @@
1
1
  import { Typography, TypographyProps } from '@mui/material';
2
2
 
3
- interface Props extends TypographyProps {
4
- variant?: 'body1' | 'body2' | 'caption';
5
- component?: string;
3
+ interface Props extends Omit<TypographyProps, 'variant'> {
4
+ variant?:
5
+ | 'big_number'
6
+ | 'body1_regular'
7
+ | 'body1_medium'
8
+ | 'body1_bold'
9
+ | 'body2_regular'
10
+ | 'body2_medium'
11
+ | 'body2_bold'
12
+ | 'caption'
13
+ | 'button_notif';
14
+ component?: any;
6
15
  }
7
16
 
8
- const ActText = (props: Props) => <Typography {...props} />;
17
+ // @ts-ignore
18
+ const Text = (props: Props) => <Typography {...(props as TypographyProps)} />;
9
19
 
10
- export default ActText;
20
+ export default Text;
@@ -1,7 +1,8 @@
1
- export { default as ActText } from './Text';
2
- export { default as ActHeading } from './Heading';
3
- export { default as ActButton } from './Button';
1
+ export { default as Text } from './Text';
2
+ export { default as Link } from './Link';
3
+ export { default as Heading } from './Heading';
4
+ export { default as Button } from './Button';
4
5
  export { default as TextField } from './Form/TextField';
5
- export { default as ActCheckbox } from './Form/Checkbox';
6
- export { default as ActAccordion } from './Accordion';
6
+ export { default as Checkbox } from './Form/Checkbox';
7
+ export { default as Accordion } from './Accordion';
7
8
  export { default as IconProvider } from './Icon/IconProvider';