@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/cjs/DesignSystemProvider.d.ts +3 -2
- package/dist/cjs/components/Heading/Heading.d.ts +3 -3
- package/dist/cjs/components/Link/Link.d.ts +8 -0
- package/dist/cjs/components/Link/index.d.ts +1 -0
- package/dist/cjs/components/Text/Text.d.ts +5 -5
- package/dist/cjs/components/index.d.ts +6 -5
- package/dist/cjs/index.js +439 -174
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/DesignSystemProvider.d.ts +3 -2
- package/dist/esm/components/Heading/Heading.d.ts +3 -3
- package/dist/esm/components/Link/Link.d.ts +8 -0
- package/dist/esm/components/Link/index.d.ts +1 -0
- package/dist/esm/components/Text/Text.d.ts +5 -5
- package/dist/esm/components/index.d.ts +6 -5
- package/dist/esm/index.js +434 -170
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +17 -10
- package/package.json +1 -1
- package/src/DesignSystemProvider.tsx +9 -4
- package/src/components/Heading/Heading.tsx +3 -4
- package/src/components/Link/Link.tsx +10 -0
- package/src/components/Link/index.ts +1 -0
- package/src/components/Text/Text.tsx +15 -5
- package/src/components/index.ts +6 -5
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$
|
|
12
|
-
variant?: '
|
|
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
|
|
21
|
+
declare const Link: (props: Props$6) => JSX.Element;
|
|
16
22
|
|
|
17
23
|
interface Props$5 extends Omit<TypographyProps$1, 'paragraph'> {
|
|
18
|
-
variant
|
|
24
|
+
variant?: 'h1' | 'h2' | 'h3' | 'h4';
|
|
19
25
|
component?: string;
|
|
20
26
|
}
|
|
21
|
-
declare const
|
|
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:
|
|
74
|
+
themeName: Theme;
|
|
68
75
|
toggleDarkTheme: () => void;
|
|
69
76
|
}
|
|
70
77
|
declare const DesignSystemContext: react.Context<DesignSystemContextValues>;
|
|
71
78
|
interface Props {
|
|
72
|
-
name?:
|
|
79
|
+
name?: Theme;
|
|
73
80
|
}
|
|
74
81
|
declare const DesignSystemProvider: ({ children, name }: PropsWithChildren<Props>) => JSX.Element;
|
|
75
82
|
|
|
76
|
-
export { ActAccordion, ActButton
|
|
83
|
+
export { ActAccordion as Accordion, ActButton as Button, Checkbox, DesignSystemContext, DesignSystemContextValues, DesignSystemProvider, Heading, IconProvider, Link, Text, TextField };
|
package/package.json
CHANGED
|
@@ -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:
|
|
19
|
+
themeName: Theme;
|
|
15
20
|
toggleDarkTheme: () => void;
|
|
16
21
|
}
|
|
17
22
|
|
|
18
23
|
export const DesignSystemContext = createContext<DesignSystemContextValues>({
|
|
19
24
|
isDarkTheme: false,
|
|
20
|
-
themeName: '
|
|
25
|
+
themeName: 'Default',
|
|
21
26
|
toggleDarkTheme: () => {}
|
|
22
27
|
});
|
|
23
28
|
|
|
24
29
|
interface Props {
|
|
25
|
-
name?:
|
|
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 = '
|
|
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
|
|
4
|
+
variant?: 'h1' | 'h2' | 'h3' | 'h4';
|
|
6
5
|
component?: string;
|
|
7
6
|
}
|
|
8
7
|
|
|
9
|
-
const
|
|
8
|
+
const Heading = (props: Props) => <Typography {...props} />;
|
|
10
9
|
|
|
11
|
-
export default
|
|
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?:
|
|
5
|
-
|
|
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
|
-
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
const Text = (props: Props) => <Typography {...(props as TypographyProps)} />;
|
|
9
19
|
|
|
10
|
-
export default
|
|
20
|
+
export default Text;
|
package/src/components/index.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export { default as
|
|
2
|
-
export { default as
|
|
3
|
-
export { default as
|
|
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
|
|
6
|
-
export { default as
|
|
6
|
+
export { default as Checkbox } from './Form/Checkbox';
|
|
7
|
+
export { default as Accordion } from './Accordion';
|
|
7
8
|
export { default as IconProvider } from './Icon/IconProvider';
|