@groupeactual/ui-kit 0.2.7 → 0.2.8

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
@@ -1,21 +1,26 @@
1
1
  /// <reference types="react" />
2
- import { TypographyProps } from '@mui/material';
3
- import { TypographyProps as TypographyProps$1 } from '@mui/material/Typography';
2
+ import { TypographyProps } from '@mui/material/Typography';
4
3
  import { ButtonProps } from '@mui/material/Button';
5
4
  import * as react from 'react';
6
5
  import { FocusEventHandler, ChangeEventHandler, ReactNode, PropsWithChildren } from 'react';
7
6
  import { TextFieldProps } from '@mui/material/TextField';
8
- import { SxProps, Theme } from '@mui/system';
7
+ import { SxProps, Theme as Theme$1 } from '@mui/system';
9
8
  import { IconProp } from '@fortawesome/fontawesome-svg-core';
10
9
 
11
- interface Props$6 extends TypographyProps {
12
- variant?: 'body1' | 'body2' | 'caption';
10
+ interface Props$7 {
11
+ variant?: 'big_number' | 'body1_regular' | 'body1_medium' | 'body1_bold' | 'body2_regular' | 'body2_medium' | 'body2_bold' | 'caption' | 'button_notif';
12
+ component?: string;
13
+ }
14
+ declare const ActText$1: (props: Props$7) => JSX.Element;
15
+
16
+ interface Props$6 {
17
+ variant?: 'link1' | 'link2';
13
18
  component?: string;
14
19
  }
15
20
  declare const ActText: (props: Props$6) => JSX.Element;
16
21
 
17
- interface Props$5 extends Omit<TypographyProps$1, 'paragraph'> {
18
- variant: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'subtitle1' | 'subtitle2';
22
+ interface Props$5 extends Omit<TypographyProps, 'paragraph'> {
23
+ variant?: 'h1' | 'h2' | 'h3' | 'h4';
19
24
  component?: string;
20
25
  }
21
26
  declare const ActHeading: (props: Props$5) => JSX.Element;
@@ -42,7 +47,7 @@ interface Props$3 {
42
47
  value: boolean;
43
48
  name: string;
44
49
  onChange: (field: string, value: any, shouldValidate?: boolean | undefined) => void;
45
- sx: SxProps<Theme>;
50
+ sx: SxProps<Theme$1>;
46
51
  }
47
52
  declare const Checkbox: ({ name, value, error, label, onChange, sx }: Props$3) => JSX.Element;
48
53
 
@@ -62,15 +67,16 @@ interface Props$1 {
62
67
  }
63
68
  declare const IconProvider: ({ variant, icon, color, size }: Props$1) => JSX.Element;
64
69
 
70
+ declare type Theme = 'Default' | 'Ep';
65
71
  interface DesignSystemContextValues {
66
72
  isDarkTheme: boolean;
67
- themeName: string;
73
+ themeName: Theme;
68
74
  toggleDarkTheme: () => void;
69
75
  }
70
76
  declare const DesignSystemContext: react.Context<DesignSystemContextValues>;
71
77
  interface Props {
72
- name?: DesignSystemContextValues['themeName'];
78
+ name?: Theme;
73
79
  }
74
80
  declare const DesignSystemProvider: ({ children, name }: PropsWithChildren<Props>) => JSX.Element;
75
81
 
76
- export { ActAccordion, ActButton, Checkbox as ActCheckbox, ActHeading, ActText, DesignSystemContext, DesignSystemContextValues, DesignSystemProvider, IconProvider, TextField };
82
+ export { ActAccordion as Accordion, ActButton as Button, Checkbox, DesignSystemContext, DesignSystemContextValues, DesignSystemProvider, ActHeading as Heading, IconProvider, ActText as Link, ActText$1 as 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.8",
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,8 +1,7 @@
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
 
@@ -0,0 +1,12 @@
1
+ import { Typography, TypographyProps } from '@mui/material';
2
+
3
+ interface Props {
4
+ variant?: 'link1' | 'link2';
5
+ component?: string;
6
+ }
7
+
8
+ const ActText = (props: Props) => (
9
+ <Typography {...(props as TypographyProps)} />
10
+ );
11
+
12
+ export default ActText;
@@ -0,0 +1 @@
1
+ export { default } from './Link';
@@ -1,10 +1,21 @@
1
1
  import { Typography, TypographyProps } from '@mui/material';
2
2
 
3
- interface Props extends TypographyProps {
4
- variant?: 'body1' | 'body2' | 'caption';
3
+ interface Props {
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';
5
14
  component?: string;
6
15
  }
7
16
 
8
- const ActText = (props: Props) => <Typography {...props} />;
17
+ const ActText = (props: Props) => (
18
+ <Typography {...(props as TypographyProps)} />
19
+ );
9
20
 
10
21
  export default ActText;
@@ -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';