@groupeactual/ui-kit 0.2.0 → 0.2.2
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 +1 -1
- package/dist/cjs/{material-ui-components → components}/Accordion/Accordion.d.ts +0 -0
- package/dist/cjs/{material-ui-components → components}/Accordion/index.d.ts +0 -0
- package/dist/cjs/components/Button/Button.d.ts +5 -0
- package/{src/material-ui-components/Button/index.ts → dist/cjs/components/Button/index.d.ts} +0 -0
- package/dist/cjs/components/Form/Checkbox/Checkbox.d.ts +12 -0
- package/{src/material-ui-components/Form/Checkbox/index.ts → dist/cjs/components/Form/Checkbox/index.d.ts} +0 -0
- package/dist/cjs/components/Form/TextField/TextField.d.ts +15 -0
- package/dist/cjs/components/Form/TextField/index.d.ts +1 -0
- package/dist/cjs/components/Heading/Heading.d.ts +8 -0
- package/{src/material-ui-components/Heading/index.ts → dist/cjs/components/Heading/index.d.ts} +0 -0
- package/dist/cjs/{material-ui-components → components}/Icon/IconProvider.d.ts +0 -0
- package/dist/cjs/{material-ui-components → components}/Icon/index.d.ts +0 -0
- package/dist/cjs/components/Text/Text.d.ts +8 -0
- package/{src/material-ui-components/Text/index.ts → dist/cjs/components/Text/index.d.ts} +0 -0
- package/dist/cjs/components/index.d.ts +7 -0
- package/dist/cjs/from-scratch-components/Tag/Tag.d.ts +1 -1
- package/dist/cjs/from-scratch-components/Tag/index.d.ts +1 -1
- package/dist/cjs/from-scratch-components/index.d.ts +1 -1
- package/dist/cjs/index.d.ts +1 -3
- package/dist/cjs/index.js +279 -203
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/material-ui-components/Button/Button.d.ts +1 -1
- package/dist/cjs/material-ui-components/Heading/Heading.d.ts +1 -1
- package/dist/cjs/material-ui-components/index.d.ts +0 -2
- package/dist/esm/DesignSystemProvider.d.ts +1 -1
- package/dist/esm/{material-ui-components → components}/Accordion/Accordion.d.ts +0 -0
- package/dist/esm/{material-ui-components → components}/Accordion/index.d.ts +0 -0
- package/dist/esm/components/Button/Button.d.ts +5 -0
- package/dist/esm/components/Button/index.d.ts +1 -0
- package/dist/esm/components/Form/Checkbox/Checkbox.d.ts +12 -0
- package/dist/esm/components/Form/Checkbox/index.d.ts +1 -0
- package/dist/esm/components/Form/TextField/TextField.d.ts +15 -0
- package/dist/esm/components/Form/TextField/index.d.ts +1 -0
- package/dist/esm/components/Heading/Heading.d.ts +8 -0
- package/dist/esm/components/Heading/index.d.ts +1 -0
- package/dist/esm/{material-ui-components → components}/Icon/IconProvider.d.ts +0 -0
- package/dist/esm/{material-ui-components → components}/Icon/index.d.ts +0 -0
- package/dist/esm/components/Text/Text.d.ts +8 -0
- package/dist/esm/components/Text/index.d.ts +1 -0
- package/dist/esm/components/index.d.ts +7 -0
- package/dist/esm/from-scratch-components/Tag/Tag.d.ts +1 -1
- package/dist/esm/from-scratch-components/Tag/index.d.ts +1 -1
- package/dist/esm/from-scratch-components/index.d.ts +1 -1
- package/dist/esm/index.d.ts +1 -3
- package/dist/esm/index.js +279 -202
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/material-ui-components/Button/Button.d.ts +1 -1
- package/dist/esm/material-ui-components/Heading/Heading.d.ts +1 -1
- package/dist/esm/material-ui-components/index.d.ts +0 -2
- package/dist/index.d.ts +3 -9
- package/package.json +2 -2
- package/src/DesignSystemProvider.tsx +4 -7
- package/src/{material-ui-components → components}/Accordion/Accordion.tsx +0 -0
- package/src/{material-ui-components → components}/Accordion/index.ts +0 -0
- package/src/{material-ui-components → components}/Button/Button.tsx +0 -0
- package/src/components/Button/index.ts +1 -0
- package/src/{material-ui-components → components}/Form/Checkbox/Checkbox.tsx +0 -0
- package/src/components/Form/Checkbox/index.ts +1 -0
- package/src/{material-ui-components/Form/TextInput/TextInput.tsx → components/Form/TextField/TextField.tsx} +5 -5
- package/src/components/Form/TextField/index.ts +1 -0
- package/src/{material-ui-components → components}/Heading/Heading.tsx +0 -0
- package/src/components/Heading/index.ts +1 -0
- package/src/{material-ui-components → components}/Icon/IconProvider.tsx +0 -0
- package/src/{material-ui-components → components}/Icon/index.ts +0 -0
- package/src/{material-ui-components → components}/Text/Text.tsx +0 -0
- package/src/components/Text/index.ts +1 -0
- package/src/{material-ui-components → components}/index.ts +1 -1
- package/src/index.ts +1 -3
- package/src/from-scratch-components/Tag/Tag.scss +0 -23
- package/src/from-scratch-components/Tag/Tag.tsx +0 -24
- package/src/from-scratch-components/Tag/index.ts +0 -1
- package/src/from-scratch-components/index.ts +0 -1
- package/src/material-ui-components/Form/TextInput/index.ts +0 -1
- package/src/mui-base-components/index.ts +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ButtonProps } from '@mui/material
|
|
2
|
+
import { ButtonProps } from '@mui/material';
|
|
3
3
|
declare type ActButtonType = (props: ButtonProps) => JSX.Element | null;
|
|
4
4
|
declare const ActButton: ActButtonType;
|
|
5
5
|
export default ActButton;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { TypographyProps } from '@mui/material
|
|
2
|
+
import { TypographyProps } from '@mui/material';
|
|
3
3
|
interface Props extends Omit<TypographyProps, 'paragraph'> {
|
|
4
4
|
variant: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'subtitle1' | 'subtitle2';
|
|
5
5
|
component?: string;
|
|
@@ -3,5 +3,3 @@ export { default as ActHeading } from './Heading';
|
|
|
3
3
|
export { default as ActButton } from './Button';
|
|
4
4
|
export { default as ActTextInput } from './Form/TextInput';
|
|
5
5
|
export { default as ActCheckbox } from './Form/Checkbox';
|
|
6
|
-
export { default as ActAccordion } from './Accordion';
|
|
7
|
-
export { default as IconProvider } from './Icon/IconProvider';
|
package/dist/index.d.ts
CHANGED
|
@@ -8,12 +8,6 @@ import { TextFieldProps } from '@mui/material/TextField';
|
|
|
8
8
|
import { SxProps, Theme } from '@mui/system';
|
|
9
9
|
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
10
10
|
|
|
11
|
-
interface ActTagProps {
|
|
12
|
-
label?: string;
|
|
13
|
-
color?: 'red' | 'green' | 'blue';
|
|
14
|
-
}
|
|
15
|
-
declare const ActTag: (props: ActTagProps) => JSX.Element;
|
|
16
|
-
|
|
17
11
|
interface Props$6 extends TypographyProps {
|
|
18
12
|
variant?: 'body1' | 'body2' | 'caption';
|
|
19
13
|
component?: string;
|
|
@@ -40,7 +34,7 @@ interface Props$4 {
|
|
|
40
34
|
disabled?: boolean;
|
|
41
35
|
endAdornment?: ReactNode;
|
|
42
36
|
}
|
|
43
|
-
declare const
|
|
37
|
+
declare const TextField: ({ name, value, error, onBlur, onChange, label, disabled, endAdornment, placeholder, ...props }: Omit<TextFieldProps, 'error'> & Props$4) => JSX.Element;
|
|
44
38
|
|
|
45
39
|
interface Props$3 {
|
|
46
40
|
error?: string;
|
|
@@ -70,7 +64,7 @@ declare const IconProvider: ({ variant, icon, color, size }: Props$1) => JSX.Ele
|
|
|
70
64
|
|
|
71
65
|
interface DesignSystemContextValues {
|
|
72
66
|
isDarkTheme: boolean;
|
|
73
|
-
themeName:
|
|
67
|
+
themeName: string;
|
|
74
68
|
toggleDarkTheme: () => void;
|
|
75
69
|
}
|
|
76
70
|
declare const DesignSystemContext: react.Context<DesignSystemContextValues>;
|
|
@@ -79,4 +73,4 @@ interface Props {
|
|
|
79
73
|
}
|
|
80
74
|
declare const DesignSystemProvider: ({ children, name }: PropsWithChildren<Props>) => JSX.Element;
|
|
81
75
|
|
|
82
|
-
export { ActAccordion, ActButton, Checkbox as ActCheckbox, ActHeading,
|
|
76
|
+
export { ActAccordion, ActButton, Checkbox as ActCheckbox, ActHeading, ActText, DesignSystemContext, DesignSystemContextValues, DesignSystemProvider, IconProvider, TextField };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@groupeactual/ui-kit",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "A simple template for a custom React component library",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "rollup -c",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@emotion/react": "^11.10.0",
|
|
56
56
|
"@emotion/styled": "^11.10.0",
|
|
57
57
|
"@fortawesome/fontawesome-svg-core": "^6.2.0",
|
|
58
|
-
"@groupeactual/design-tokens": "^0.1.
|
|
58
|
+
"@groupeactual/design-tokens": "^0.1.8",
|
|
59
59
|
"@mui/base": "^5.0.0-alpha.92",
|
|
60
60
|
"@mui/material": "^5.10.0",
|
|
61
61
|
"@mui/system": "^5.9.3",
|
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
createContext,
|
|
6
6
|
useContext
|
|
7
7
|
} from 'react';
|
|
8
|
-
import {
|
|
8
|
+
import { useMaterialThemeTokens } from '@groupeactual/design-tokens';
|
|
9
9
|
import { ThemeProvider } from '@emotion/react';
|
|
10
10
|
import { createTheme } from '@mui/material';
|
|
11
11
|
|
|
12
12
|
export interface DesignSystemContextValues {
|
|
13
13
|
isDarkTheme: boolean;
|
|
14
|
-
themeName:
|
|
14
|
+
themeName: string;
|
|
15
15
|
toggleDarkTheme: () => void;
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -28,12 +28,9 @@ interface Props {
|
|
|
28
28
|
const MaterialThemeProvider = ({ children }: PropsWithChildren<unknown>) => {
|
|
29
29
|
const { themeName } =
|
|
30
30
|
useContext<DesignSystemContextValues>(DesignSystemContext);
|
|
31
|
-
const {
|
|
31
|
+
const { muiTokens } = useMaterialThemeTokens(themeName);
|
|
32
32
|
|
|
33
|
-
const theme = useMemo(
|
|
34
|
-
() => createTheme(materialUIThemeTokens),
|
|
35
|
-
[materialUIThemeTokens]
|
|
36
|
-
);
|
|
33
|
+
const theme = useMemo(() => createTheme(muiTokens), [muiTokens]);
|
|
37
34
|
|
|
38
35
|
return <ThemeProvider theme={theme}>{children}</ThemeProvider>;
|
|
39
36
|
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Button';
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Checkbox';
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
useState
|
|
7
7
|
} from 'react';
|
|
8
8
|
|
|
9
|
-
import
|
|
9
|
+
import MuiTextField, { TextFieldProps } from '@mui/material/TextField';
|
|
10
10
|
|
|
11
11
|
interface Props {
|
|
12
12
|
error?: string;
|
|
@@ -19,7 +19,7 @@ interface Props {
|
|
|
19
19
|
disabled?: boolean;
|
|
20
20
|
endAdornment?: ReactNode;
|
|
21
21
|
}
|
|
22
|
-
const
|
|
22
|
+
const TextField = ({
|
|
23
23
|
name,
|
|
24
24
|
value,
|
|
25
25
|
error,
|
|
@@ -39,8 +39,8 @@ const TextInput = ({
|
|
|
39
39
|
}, [value]);
|
|
40
40
|
|
|
41
41
|
return (
|
|
42
|
-
<
|
|
43
|
-
variant="
|
|
42
|
+
<MuiTextField
|
|
43
|
+
variant="outlined"
|
|
44
44
|
name={name}
|
|
45
45
|
label={label}
|
|
46
46
|
value={internalValue}
|
|
@@ -63,4 +63,4 @@ const TextInput = ({
|
|
|
63
63
|
);
|
|
64
64
|
};
|
|
65
65
|
|
|
66
|
-
export default
|
|
66
|
+
export default TextField;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './TextField';
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Heading";
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Text';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { default as ActText } from './Text';
|
|
2
2
|
export { default as ActHeading } from './Heading';
|
|
3
3
|
export { default as ActButton } from './Button';
|
|
4
|
-
export { default as
|
|
4
|
+
export { default as TextField } from './Form/TextField';
|
|
5
5
|
export { default as ActCheckbox } from './Form/Checkbox';
|
|
6
6
|
export { default as ActAccordion } from './Accordion';
|
|
7
7
|
export { default as IconProvider } from './Icon/IconProvider';
|
package/src/index.ts
CHANGED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
.tag {
|
|
2
|
-
padding: 4px 8px;
|
|
3
|
-
border-radius: 4px;
|
|
4
|
-
background: rgb(244, 244, 244);
|
|
5
|
-
color: black;
|
|
6
|
-
font-size: 14px;
|
|
7
|
-
font-family: sans-serif;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.tag.red {
|
|
11
|
-
background: tomato;
|
|
12
|
-
color: white;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.tag.blue {
|
|
16
|
-
background: blue;
|
|
17
|
-
color: white;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.tag.green {
|
|
21
|
-
background: green;
|
|
22
|
-
color: white;
|
|
23
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import clsx from 'clsx';
|
|
2
|
-
import './Tag.scss';
|
|
3
|
-
|
|
4
|
-
export interface ActTagProps {
|
|
5
|
-
label?: string;
|
|
6
|
-
color?: 'red' | 'green' | 'blue';
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const ActTag = (props: ActTagProps) => {
|
|
10
|
-
return (
|
|
11
|
-
<span
|
|
12
|
-
className={clsx({
|
|
13
|
-
tag: true,
|
|
14
|
-
red: props.color === 'red',
|
|
15
|
-
green: props.color === 'green',
|
|
16
|
-
blue: props.color === 'blue'
|
|
17
|
-
})}
|
|
18
|
-
>
|
|
19
|
-
{props.label}
|
|
20
|
-
</span>
|
|
21
|
-
);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export default ActTag;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './Tag';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as ActTag } from './Tag';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './TextInput';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default {};
|