@groupeactual/ui-kit 0.1.9 → 0.2.1
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/components/Accordion/Accordion.d.ts +9 -0
- package/dist/cjs/components/Accordion/index.d.ts +1 -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/components/Icon/IconProvider.d.ts +10 -0
- package/dist/cjs/components/Icon/index.d.ts +1 -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/index.d.ts +1 -3
- package/dist/cjs/index.js +1174 -110
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/DesignSystemProvider.d.ts +1 -1
- package/dist/esm/components/Accordion/Accordion.d.ts +9 -0
- package/dist/esm/components/Accordion/index.d.ts +1 -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/components/Icon/IconProvider.d.ts +10 -0
- package/dist/esm/components/Icon/index.d.ts +1 -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/index.d.ts +1 -3
- package/dist/esm/index.js +1172 -109
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +30 -17
- package/package.json +5 -1
- package/src/DesignSystemProvider.tsx +1 -1
- package/src/components/Accordion/Accordion.tsx +40 -0
- package/src/components/Accordion/index.ts +1 -0
- package/src/{material-ui-components → components}/Button/Button.tsx +2 -1
- package/src/components/Button/index.ts +1 -0
- package/src/{material-ui-components → components}/Form/Checkbox/Checkbox.tsx +28 -15
- package/src/components/Form/Checkbox/index.ts +1 -0
- package/src/{material-ui-components/Form/TextInput/TextInput.tsx → components/Form/TextField/TextField.tsx} +7 -7
- package/src/components/Form/TextField/index.ts +1 -0
- package/src/{material-ui-components → components}/Heading/Heading.tsx +2 -1
- package/src/components/Heading/index.ts +1 -0
- package/src/components/Icon/IconProvider.tsx +123 -0
- package/src/components/Icon/index.ts +1 -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 +3 -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 -19
- 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
package/dist/index.d.ts
CHANGED
|
@@ -1,32 +1,29 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { TypographyProps
|
|
2
|
+
import { TypographyProps } from '@mui/material';
|
|
3
|
+
import { TypographyProps as TypographyProps$1 } from '@mui/material/Typography';
|
|
4
|
+
import { ButtonProps } from '@mui/material/Button';
|
|
3
5
|
import * as react from 'react';
|
|
4
6
|
import { FocusEventHandler, ChangeEventHandler, ReactNode, PropsWithChildren } from 'react';
|
|
5
7
|
import { TextFieldProps } from '@mui/material/TextField';
|
|
6
8
|
import { SxProps, Theme } from '@mui/system';
|
|
9
|
+
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
7
10
|
|
|
8
|
-
interface
|
|
9
|
-
label?: string;
|
|
10
|
-
color?: 'red' | 'green' | 'blue';
|
|
11
|
-
}
|
|
12
|
-
declare const ActTag: (props: ActTagProps) => JSX.Element;
|
|
13
|
-
|
|
14
|
-
interface Props$4 extends TypographyProps {
|
|
11
|
+
interface Props$6 extends TypographyProps {
|
|
15
12
|
variant?: 'body1' | 'body2' | 'caption';
|
|
16
13
|
component?: string;
|
|
17
14
|
}
|
|
18
|
-
declare const ActText: (props: Props$
|
|
15
|
+
declare const ActText: (props: Props$6) => JSX.Element;
|
|
19
16
|
|
|
20
|
-
interface Props$
|
|
17
|
+
interface Props$5 extends Omit<TypographyProps$1, 'paragraph'> {
|
|
21
18
|
variant: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'subtitle1' | 'subtitle2';
|
|
22
19
|
component?: string;
|
|
23
20
|
}
|
|
24
|
-
declare const ActHeading: (props: Props$
|
|
21
|
+
declare const ActHeading: (props: Props$5) => JSX.Element;
|
|
25
22
|
|
|
26
23
|
declare type ActButtonType = (props: ButtonProps) => JSX.Element | null;
|
|
27
24
|
declare const ActButton: ActButtonType;
|
|
28
25
|
|
|
29
|
-
interface Props$
|
|
26
|
+
interface Props$4 {
|
|
30
27
|
error?: string;
|
|
31
28
|
onBlur: FocusEventHandler<unknown>;
|
|
32
29
|
onChange: ChangeEventHandler<unknown>;
|
|
@@ -37,9 +34,9 @@ interface Props$2 {
|
|
|
37
34
|
disabled?: boolean;
|
|
38
35
|
endAdornment?: ReactNode;
|
|
39
36
|
}
|
|
40
|
-
declare const
|
|
37
|
+
declare const TextField: ({ name, value, error, onBlur, onChange, label, disabled, endAdornment, placeholder, ...props }: Omit<TextFieldProps, 'error'> & Props$4) => JSX.Element;
|
|
41
38
|
|
|
42
|
-
interface Props$
|
|
39
|
+
interface Props$3 {
|
|
43
40
|
error?: string;
|
|
44
41
|
label: string;
|
|
45
42
|
value: boolean;
|
|
@@ -47,12 +44,28 @@ interface Props$1 {
|
|
|
47
44
|
onChange: (field: string, value: any, shouldValidate?: boolean | undefined) => void;
|
|
48
45
|
sx: SxProps<Theme>;
|
|
49
46
|
}
|
|
50
|
-
declare const Checkbox: ({ name, value, error, label, onChange, sx }: Props$
|
|
47
|
+
declare const Checkbox: ({ name, value, error, label, onChange, sx }: Props$3) => JSX.Element;
|
|
48
|
+
|
|
49
|
+
interface Props$2 {
|
|
50
|
+
icon: ReactNode;
|
|
51
|
+
title: ReactNode;
|
|
52
|
+
content: ReactNode;
|
|
53
|
+
summaryHeight?: number;
|
|
54
|
+
}
|
|
55
|
+
declare const ActAccordion: ({ icon, title, content, summaryHeight }: Props$2) => JSX.Element;
|
|
56
|
+
|
|
57
|
+
interface Props$1 {
|
|
58
|
+
variant?: 'roundedIcon' | 'smallRoundedIcon';
|
|
59
|
+
icon: IconProp;
|
|
60
|
+
color?: string;
|
|
61
|
+
size?: 'xxs' | 'xs' | 'sm' | 'm' | 'lg' | 'xl' | 'xxl';
|
|
62
|
+
}
|
|
63
|
+
declare const IconProvider: ({ variant, icon, color, size }: Props$1) => JSX.Element;
|
|
51
64
|
|
|
52
65
|
interface DesignSystemContextValues {
|
|
53
66
|
isDarkTheme: boolean;
|
|
54
67
|
themeName: 'default' | 'lucie';
|
|
55
|
-
toggleDarkTheme()
|
|
68
|
+
toggleDarkTheme: () => void;
|
|
56
69
|
}
|
|
57
70
|
declare const DesignSystemContext: react.Context<DesignSystemContextValues>;
|
|
58
71
|
interface Props {
|
|
@@ -60,4 +73,4 @@ interface Props {
|
|
|
60
73
|
}
|
|
61
74
|
declare const DesignSystemProvider: ({ children, name }: PropsWithChildren<Props>) => JSX.Element;
|
|
62
75
|
|
|
63
|
-
export { 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.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "A simple template for a custom React component library",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "rollup -c",
|
|
@@ -54,14 +54,18 @@
|
|
|
54
54
|
"@emotion/is-prop-valid": "^1.2.0",
|
|
55
55
|
"@emotion/react": "^11.10.0",
|
|
56
56
|
"@emotion/styled": "^11.10.0",
|
|
57
|
+
"@fortawesome/fontawesome-svg-core": "^6.2.0",
|
|
57
58
|
"@groupeactual/design-tokens": "^0.1.1",
|
|
58
59
|
"@mui/base": "^5.0.0-alpha.92",
|
|
59
60
|
"@mui/material": "^5.10.0",
|
|
60
61
|
"@mui/system": "^5.9.3",
|
|
62
|
+
"@types/lodash": "^4.14.186",
|
|
61
63
|
"@types/styled-components": "^5.1.25",
|
|
62
64
|
"formik": "^2.2.9",
|
|
63
65
|
"framer-motion": "^6.5.1",
|
|
66
|
+
"lodash": "^4.17.21",
|
|
64
67
|
"postcss": "^8.4.14",
|
|
68
|
+
"prop-types": "^15.8.1",
|
|
65
69
|
"styled-components": "^5.3.5",
|
|
66
70
|
"tslib": "^2.4.0",
|
|
67
71
|
"webpack": "^5.74.0"
|
|
@@ -12,7 +12,7 @@ import { createTheme } from '@mui/material';
|
|
|
12
12
|
export interface DesignSystemContextValues {
|
|
13
13
|
isDarkTheme: boolean;
|
|
14
14
|
themeName: 'default' | 'lucie';
|
|
15
|
-
toggleDarkTheme()
|
|
15
|
+
toggleDarkTheme: () => void;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export const DesignSystemContext = createContext<DesignSystemContextValues>({
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import Accordion from '@mui/material/Accordion';
|
|
3
|
+
import AccordionSummary from '@mui/material/AccordionSummary';
|
|
4
|
+
import AccordionDetails from '@mui/material/AccordionDetails';
|
|
5
|
+
import { useThemeTokens } from '@groupeactual/design-tokens';
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
icon: ReactNode;
|
|
9
|
+
title: ReactNode;
|
|
10
|
+
content: ReactNode;
|
|
11
|
+
summaryHeight?: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const ActAccordion = ({ icon, title, content, summaryHeight }: Props) => {
|
|
15
|
+
const { tokens } = useThemeTokens('lucie');
|
|
16
|
+
return (
|
|
17
|
+
<Accordion
|
|
18
|
+
sx={{ border: `1px solid ${tokens.colors.defaultBorder as string}` }}
|
|
19
|
+
>
|
|
20
|
+
<AccordionSummary
|
|
21
|
+
expandIcon={icon}
|
|
22
|
+
sx={{
|
|
23
|
+
height: summaryHeight || 60
|
|
24
|
+
}}
|
|
25
|
+
>
|
|
26
|
+
{title}
|
|
27
|
+
</AccordionSummary>
|
|
28
|
+
<AccordionDetails
|
|
29
|
+
sx={{
|
|
30
|
+
bgcolor: tokens.colors.greyLightBorder,
|
|
31
|
+
borderTop: '1px solid #CBCBCB'
|
|
32
|
+
}}
|
|
33
|
+
>
|
|
34
|
+
{content}
|
|
35
|
+
</AccordionDetails>
|
|
36
|
+
</Accordion>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export default ActAccordion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Accordion';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Button, { ButtonProps } from '@mui/material/Button';
|
|
2
2
|
import { styled } from '@mui/material/styles';
|
|
3
3
|
|
|
4
4
|
type ActButtonType = (props: ButtonProps) => JSX.Element | null;
|
|
5
5
|
|
|
6
6
|
const ActButton: ActButtonType = styled(Button)<ButtonProps>(({ theme }) => ({
|
|
7
7
|
color: theme.palette.blueClickable,
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
8
9
|
border: `1px solid ${theme.palette.greyLightBorder}`,
|
|
9
10
|
borderRadius: 4,
|
|
10
11
|
fontWeight: theme.typography.fontWeightBold,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Button';
|
|
@@ -1,22 +1,33 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import {
|
|
3
|
+
import CheckboxMUI from '@mui/material/Checkbox';
|
|
4
|
+
import FormControl from '@mui/material/FormControl';
|
|
5
|
+
import FormControlLabel from '@mui/material/FormControlLabel';
|
|
6
|
+
import Typography from '@mui/material/Typography';
|
|
7
|
+
|
|
8
|
+
import Box from '@mui/system/Box';
|
|
9
|
+
import { SxProps, Theme } from '@mui/system';
|
|
10
10
|
|
|
11
11
|
interface Props {
|
|
12
12
|
error?: string;
|
|
13
13
|
label: string;
|
|
14
14
|
value: boolean;
|
|
15
15
|
name: string;
|
|
16
|
-
onChange: (
|
|
16
|
+
onChange: (
|
|
17
|
+
field: string,
|
|
18
|
+
value: any,
|
|
19
|
+
shouldValidate?: boolean | undefined
|
|
20
|
+
) => void;
|
|
17
21
|
sx: SxProps<Theme>;
|
|
18
22
|
}
|
|
19
|
-
const Checkbox = ({
|
|
23
|
+
const Checkbox = ({
|
|
24
|
+
name,
|
|
25
|
+
value,
|
|
26
|
+
error,
|
|
27
|
+
label,
|
|
28
|
+
onChange,
|
|
29
|
+
sx
|
|
30
|
+
}: Props): JSX.Element => {
|
|
20
31
|
const [internalValue, setInternalValue] = useState(value);
|
|
21
32
|
|
|
22
33
|
useEffect(() => {
|
|
@@ -46,12 +57,14 @@ const Checkbox = ({ name, value, error, label, onChange, sx }: Props): JSX.Eleme
|
|
|
46
57
|
label={<Typography sx={sx}>{label}</Typography>}
|
|
47
58
|
/>
|
|
48
59
|
{error && (
|
|
49
|
-
<Typography
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
60
|
+
<Typography
|
|
61
|
+
sx={{
|
|
62
|
+
marginTop: -1,
|
|
63
|
+
color: '#B80025',
|
|
64
|
+
fontWeight: 400,
|
|
65
|
+
fontSize: '10px'
|
|
66
|
+
}}
|
|
67
|
+
>
|
|
55
68
|
{error}
|
|
56
69
|
</Typography>
|
|
57
70
|
)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Checkbox';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
2
|
ChangeEventHandler,
|
|
3
3
|
FocusEventHandler,
|
|
4
4
|
ReactNode,
|
|
@@ -6,7 +6,7 @@ import React, {
|
|
|
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}
|
|
@@ -48,7 +48,7 @@ const TextInput = ({
|
|
|
48
48
|
InputProps={{
|
|
49
49
|
endAdornment
|
|
50
50
|
}}
|
|
51
|
-
onChange={(e) => {
|
|
51
|
+
onChange={(e) => {
|
|
52
52
|
setInternalValue(e.currentTarget.value);
|
|
53
53
|
onChange(e);
|
|
54
54
|
}}
|
|
@@ -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';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Typography, { TypographyProps } from '@mui/material/Typography';
|
|
2
|
+
|
|
2
3
|
|
|
3
4
|
interface Props extends Omit<TypographyProps, 'paragraph'> {
|
|
4
5
|
variant: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'subtitle1' | 'subtitle2';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Heading";
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import SvgIcon from '@mui/material/SvgIcon';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
4
|
+
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
5
|
+
import Box from '@mui/material/Box';
|
|
6
|
+
interface Props {
|
|
7
|
+
variant?: 'roundedIcon' | 'smallRoundedIcon';
|
|
8
|
+
icon: IconProp;
|
|
9
|
+
color?: string;
|
|
10
|
+
size?: 'xxs' | 'xs' | 'sm' | 'm' | 'lg' | 'xl' | 'xxl';
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface FontAwesomeSvgIconProps {
|
|
14
|
+
icon: any;
|
|
15
|
+
fontSize: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// eslint-disable-next-line react/display-name
|
|
19
|
+
const FontAwesomeSvgIcon = forwardRef<SVGSVGElement, FontAwesomeSvgIconProps>(
|
|
20
|
+
({ icon, fontSize }, ref) => {
|
|
21
|
+
const {
|
|
22
|
+
icon: [width, height, , , svgPathData]
|
|
23
|
+
} = icon;
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<SvgIcon
|
|
27
|
+
ref={ref}
|
|
28
|
+
viewBox={`0 0 ${width as string} ${height as string}`}
|
|
29
|
+
sx={{
|
|
30
|
+
fontSize
|
|
31
|
+
}}
|
|
32
|
+
>
|
|
33
|
+
{typeof svgPathData === 'string' ? (
|
|
34
|
+
<path d={svgPathData} />
|
|
35
|
+
) : (
|
|
36
|
+
/**
|
|
37
|
+
* A multi-path Font Awesome icon seems to imply a duotune icon. The 0th path seems to
|
|
38
|
+
* be the faded element (referred to as the "secondary" path in the Font Awesome docs)
|
|
39
|
+
* of a duotone icon. 40% is the default opacity.
|
|
40
|
+
*
|
|
41
|
+
* @see https://fontawesome.com/how-to-use/on-the-web/styling/duotone-icons#changing-opacity
|
|
42
|
+
*/
|
|
43
|
+
svgPathData.map((d: string, i: number) => (
|
|
44
|
+
<path style={{ opacity: i === 0 ? 0.4 : 1 }} d={d} key={i} />
|
|
45
|
+
))
|
|
46
|
+
)}
|
|
47
|
+
</SvgIcon>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
const IconProvider = ({ variant, icon, color, size }: Props) => {
|
|
53
|
+
const getFontSize = (): string => {
|
|
54
|
+
if (variant === 'roundedIcon') {
|
|
55
|
+
return '1.5rem';
|
|
56
|
+
}
|
|
57
|
+
if (variant === 'smallRoundedIcon') {
|
|
58
|
+
return '0.9rem';
|
|
59
|
+
}
|
|
60
|
+
switch (size) {
|
|
61
|
+
case 'xxs':
|
|
62
|
+
return '.8rem';
|
|
63
|
+
case 'xs':
|
|
64
|
+
return '1rem';
|
|
65
|
+
case 'm':
|
|
66
|
+
return '1.5rem';
|
|
67
|
+
case 'lg':
|
|
68
|
+
return '1.8rem';
|
|
69
|
+
case 'xl':
|
|
70
|
+
return '2.2rem';
|
|
71
|
+
case 'xxl':
|
|
72
|
+
return '4rem';
|
|
73
|
+
default:
|
|
74
|
+
return '1.2rem';
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const getStyles = (): SxProps<Theme> => {
|
|
79
|
+
switch (variant) {
|
|
80
|
+
case 'roundedIcon':
|
|
81
|
+
return {
|
|
82
|
+
color: 'actual.main',
|
|
83
|
+
backgroundColor: 'actual.light',
|
|
84
|
+
borderRadius: '100px',
|
|
85
|
+
overflow: 'visible',
|
|
86
|
+
height: 50,
|
|
87
|
+
width: 50,
|
|
88
|
+
display: 'flex',
|
|
89
|
+
fontSize: '1.5rem',
|
|
90
|
+
justifyContent: 'center',
|
|
91
|
+
alignItems: 'center'
|
|
92
|
+
};
|
|
93
|
+
case 'smallRoundedIcon':
|
|
94
|
+
return {
|
|
95
|
+
color: 'actual.main',
|
|
96
|
+
backgroundColor: 'actual.light',
|
|
97
|
+
borderRadius: '100px',
|
|
98
|
+
overflow: 'visible',
|
|
99
|
+
height: 30,
|
|
100
|
+
width: 30,
|
|
101
|
+
display: 'flex',
|
|
102
|
+
justifyContent: 'center',
|
|
103
|
+
alignItems: 'center'
|
|
104
|
+
};
|
|
105
|
+
default:
|
|
106
|
+
return {
|
|
107
|
+
color: color ?? 'primary.main',
|
|
108
|
+
width: getFontSize(),
|
|
109
|
+
height: getFontSize(),
|
|
110
|
+
display: 'inline-flex',
|
|
111
|
+
alignItems: 'center',
|
|
112
|
+
justifyContent: 'center'
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
return (
|
|
117
|
+
<Box component="span" sx={getStyles()}>
|
|
118
|
+
<FontAwesomeSvgIcon icon={icon} fontSize={getFontSize()} />
|
|
119
|
+
</Box>
|
|
120
|
+
);
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export default IconProvider;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './IconProvider';
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Text';
|
|
@@ -1,5 +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
|
+
export { default as ActAccordion } from './Accordion';
|
|
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,19 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import clsx from "clsx";
|
|
3
|
-
import "./Tag.scss";
|
|
4
|
-
|
|
5
|
-
export interface ActTagProps {
|
|
6
|
-
label?: string;
|
|
7
|
-
color?: 'red' | 'green' | 'blue'
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const ActTag = (props: ActTagProps) => {
|
|
11
|
-
return <span className={clsx({
|
|
12
|
-
tag: true,
|
|
13
|
-
red: props.color === 'red',
|
|
14
|
-
green: props.color === 'green',
|
|
15
|
-
blue: props.color === 'blue'
|
|
16
|
-
})}>{props.label}</span>;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
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 {};
|