norma-library 0.4.3 → 0.4.5
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/.babelrc.json +18 -0
- package/buildcache/front-end +1 -0
- package/dist/esm/components/Accordion.d.ts +3 -0
- package/dist/esm/components/Accordion.js +24 -0
- package/dist/esm/components/Accordion.js.map +1 -0
- package/dist/esm/components/Button.d.ts +3 -0
- package/dist/esm/components/Button.js +22 -0
- package/dist/esm/components/Button.js.map +1 -0
- package/dist/esm/components/Card.d.ts +7 -0
- package/dist/esm/components/Card.js +31 -0
- package/dist/esm/components/Card.js.map +1 -0
- package/dist/esm/components/CheckBox.d.ts +3 -0
- package/dist/esm/components/CheckBox.js +13 -0
- package/dist/esm/components/CheckBox.js.map +1 -0
- package/dist/esm/components/DropDown.d.ts +3 -0
- package/dist/esm/components/DropDown.js +17 -0
- package/dist/esm/components/DropDown.js.map +1 -0
- package/dist/esm/components/IconButton.d.ts +3 -0
- package/dist/esm/components/IconButton.js +31 -0
- package/dist/esm/components/IconButton.js.map +1 -0
- package/dist/esm/components/Icons.d.ts +7 -0
- package/dist/esm/components/Icons.js +49 -0
- package/dist/esm/components/Icons.js.map +1 -0
- package/dist/esm/components/Modal.d.ts +4 -0
- package/dist/esm/components/Modal.js +32 -0
- package/dist/esm/components/Modal.js.map +1 -0
- package/dist/esm/components/Paper.d.ts +3 -0
- package/dist/esm/components/Paper.js +14 -0
- package/dist/esm/components/Paper.js.map +1 -0
- package/dist/esm/components/ProgressBar.d.ts +6 -0
- package/dist/esm/components/ProgressBar.js +31 -0
- package/dist/esm/components/ProgressBar.js.map +1 -0
- package/dist/esm/components/RadioGroup.d.ts +3 -0
- package/dist/esm/components/RadioGroup.js +18 -0
- package/dist/esm/components/RadioGroup.js.map +1 -0
- package/dist/esm/components/RangerSlider.d.ts +3 -0
- package/dist/esm/components/RangerSlider.js +64 -0
- package/dist/esm/components/RangerSlider.js.map +1 -0
- package/dist/esm/components/Select.d.ts +3 -0
- package/dist/esm/components/Select.js +45 -0
- package/dist/esm/components/Select.js.map +1 -0
- package/dist/{components/icon/norma.d.ts → esm/components/Svgs.d.ts} +29 -30
- package/dist/esm/components/Svgs.js +102 -0
- package/dist/esm/components/Svgs.js.map +1 -0
- package/dist/esm/components/Tabs.d.ts +3 -0
- package/dist/esm/components/Tabs.js +78 -0
- package/dist/esm/components/Tabs.js.map +1 -0
- package/dist/esm/components/Tag.d.ts +3 -0
- package/dist/esm/components/Tag.js +27 -0
- package/dist/esm/components/Tag.js.map +1 -0
- package/dist/esm/components/TextField.d.ts +3 -0
- package/dist/esm/components/TextField.js +18 -0
- package/dist/esm/components/TextField.js.map +1 -0
- package/dist/esm/components/button/index.d.ts +3 -0
- package/dist/esm/components/button/index.js +22 -0
- package/dist/esm/components/button/index.js.map +1 -0
- package/dist/esm/components/checkbox/index.d.ts +3 -0
- package/dist/esm/components/checkbox/index.js +13 -0
- package/dist/esm/components/checkbox/index.js.map +1 -0
- package/dist/esm/components/icons/index.d.ts +7 -0
- package/dist/esm/components/icons/index.js +49 -0
- package/dist/esm/components/icons/index.js.map +1 -0
- package/dist/esm/components/icons/svgs.d.ts +29 -0
- package/dist/esm/components/icons/svgs.js +102 -0
- package/dist/esm/components/icons/svgs.js.map +1 -0
- package/dist/esm/components/index.d.ts +16 -0
- package/dist/esm/components/index.js +17 -0
- package/dist/esm/components/index.js.map +1 -0
- package/dist/esm/components/textfield/index.d.ts +3 -0
- package/dist/esm/components/textfield/index.js +18 -0
- package/dist/esm/components/textfield/index.js.map +1 -0
- package/dist/esm/helpers/alignments.d.ts +2 -0
- package/dist/esm/helpers/alignments.js +14 -0
- package/dist/esm/helpers/alignments.js.map +1 -0
- package/dist/esm/helpers/borders.d.ts +2 -0
- package/dist/esm/helpers/borders.js +18 -0
- package/dist/esm/helpers/borders.js.map +1 -0
- package/dist/{helpers → esm/helpers}/colors.d.ts +172 -174
- package/dist/esm/helpers/colors.js +156 -0
- package/dist/esm/helpers/colors.js.map +1 -0
- package/dist/esm/helpers/index.d.ts +5 -0
- package/dist/esm/helpers/index.js +6 -0
- package/dist/esm/helpers/index.js.map +1 -0
- package/dist/esm/helpers/radios.d.ts +2 -0
- package/dist/esm/helpers/radios.js +24 -0
- package/dist/esm/helpers/radios.js.map +1 -0
- package/dist/esm/helpers/sizes.d.ts +11 -0
- package/dist/esm/helpers/sizes.js +67 -0
- package/dist/esm/helpers/sizes.js.map +1 -0
- package/dist/esm/index.d.ts +17 -0
- package/dist/esm/index.js +18 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/interfaces/Accordion.d.ts +12 -0
- package/dist/esm/interfaces/Accordion.js +2 -0
- package/dist/esm/interfaces/Accordion.js.map +1 -0
- package/dist/esm/interfaces/Button.d.ts +14 -0
- package/dist/esm/interfaces/Button.js +2 -0
- package/dist/esm/interfaces/Button.js.map +1 -0
- package/dist/esm/interfaces/Card.d.ts +11 -0
- package/dist/esm/interfaces/Card.js +2 -0
- package/dist/esm/interfaces/Card.js.map +1 -0
- package/dist/esm/interfaces/CheckBox.d.ts +19 -0
- package/dist/esm/interfaces/CheckBox.js +2 -0
- package/dist/esm/interfaces/CheckBox.js.map +1 -0
- package/dist/esm/interfaces/DropDown.d.ts +11 -0
- package/dist/esm/interfaces/DropDown.js +2 -0
- package/dist/esm/interfaces/DropDown.js.map +1 -0
- package/dist/esm/interfaces/Icon.d.ts +15 -0
- package/dist/esm/interfaces/Icon.js +2 -0
- package/dist/esm/interfaces/Icon.js.map +1 -0
- package/dist/esm/interfaces/IconButton.d.ts +14 -0
- package/dist/esm/interfaces/IconButton.js +2 -0
- package/dist/esm/interfaces/IconButton.js.map +1 -0
- package/dist/esm/interfaces/Icons.d.ts +15 -0
- package/dist/esm/interfaces/Icons.js +2 -0
- package/dist/esm/interfaces/Icons.js.map +1 -0
- package/dist/esm/interfaces/Modal.d.ts +15 -0
- package/dist/esm/interfaces/Modal.js +2 -0
- package/dist/esm/interfaces/Modal.js.map +1 -0
- package/dist/esm/interfaces/Paper.d.ts +12 -0
- package/dist/esm/interfaces/Paper.js +2 -0
- package/dist/esm/interfaces/Paper.js.map +1 -0
- package/dist/esm/interfaces/ProgressBar.d.ts +17 -0
- package/dist/esm/interfaces/ProgressBar.js +2 -0
- package/dist/esm/interfaces/ProgressBar.js.map +1 -0
- package/dist/esm/interfaces/RadioGroup.d.ts +15 -0
- package/dist/esm/interfaces/RadioGroup.js +2 -0
- package/dist/esm/interfaces/RadioGroup.js.map +1 -0
- package/dist/esm/interfaces/RangerSlider.d.ts +18 -0
- package/dist/esm/interfaces/RangerSlider.js +2 -0
- package/dist/esm/interfaces/RangerSlider.js.map +1 -0
- package/dist/esm/interfaces/Select.d.ts +17 -0
- package/dist/esm/interfaces/Select.js +2 -0
- package/dist/esm/interfaces/Select.js.map +1 -0
- package/dist/esm/interfaces/Tabs.d.ts +18 -0
- package/dist/esm/interfaces/Tabs.js +2 -0
- package/dist/esm/interfaces/Tabs.js.map +1 -0
- package/dist/esm/interfaces/Tag.d.ts +18 -0
- package/dist/esm/interfaces/Tag.js +2 -0
- package/dist/esm/interfaces/Tag.js.map +1 -0
- package/dist/esm/interfaces/TextField.d.ts +40 -0
- package/dist/esm/interfaces/TextField.js +2 -0
- package/dist/esm/interfaces/TextField.js.map +1 -0
- package/dist/esm/interfaces/index.d.ts +17 -0
- package/dist/esm/interfaces/index.js +18 -0
- package/dist/esm/interfaces/index.js.map +1 -0
- package/dist/esm/types/index.d.ts +78 -0
- package/dist/esm/types/index.js +10 -0
- package/dist/esm/types/index.js.map +1 -0
- package/dist/index.css +8363 -0
- package/norma-library.tar +0 -0
- package/package.json +75 -90
- package/postcss.config.js +6 -0
- package/src/components/Accordion.tsx +64 -0
- package/src/components/Button.tsx +38 -0
- package/src/components/Card.tsx +47 -0
- package/src/components/CheckBox.tsx +35 -0
- package/src/components/DropDown.tsx +38 -0
- package/src/components/IconButton.tsx +58 -0
- package/src/components/Icons.tsx +87 -0
- package/src/components/Modal.tsx +123 -0
- package/src/components/Paper.tsx +22 -0
- package/src/components/ProgressBar.tsx +62 -0
- package/src/components/RadioGroup.tsx +55 -0
- package/src/components/RangerSlider.tsx +81 -0
- package/src/components/Select.tsx +98 -0
- package/src/components/{icon/norma.tsx → Svgs.tsx} +54 -55
- package/src/components/Tabs.tsx +140 -0
- package/src/components/Tag.tsx +45 -0
- package/src/components/TextField.tsx +35 -0
- package/src/components/index.ts +16 -8
- package/src/helpers/alignments.ts +14 -0
- package/src/helpers/borders.ts +18 -0
- package/src/helpers/colors.ts +173 -209
- package/src/helpers/index.ts +5 -3
- package/src/helpers/radios.ts +24 -0
- package/src/helpers/sizes.ts +79 -26
- package/src/index.css +2 -0
- package/src/index.ts +36 -0
- package/src/interfaces/Accordion.ts +12 -0
- package/src/interfaces/Button.ts +27 -0
- package/src/interfaces/Card.ts +11 -0
- package/src/interfaces/CheckBox.ts +33 -0
- package/src/interfaces/DropDown.ts +14 -0
- package/src/interfaces/IconButton.ts +27 -0
- package/src/interfaces/Icons.ts +17 -0
- package/src/interfaces/Modal.ts +15 -0
- package/src/interfaces/Paper.ts +12 -0
- package/src/interfaces/ProgressBar.ts +25 -0
- package/src/interfaces/RadioGroup.ts +28 -0
- package/src/interfaces/RangerSlider.ts +32 -0
- package/src/interfaces/Select.ts +17 -0
- package/src/interfaces/Tabs.ts +24 -0
- package/src/interfaces/Tag.ts +17 -0
- package/src/interfaces/TextField.ts +63 -0
- package/src/interfaces/index.ts +17 -0
- package/src/stories/Accordion.stories.tsx +65 -0
- package/src/stories/Button.stories.tsx +99 -0
- package/src/stories/Card.stories.tsx +55 -0
- package/src/stories/CheckBox.stories.tsx +94 -0
- package/src/stories/Colors.stories.mdx +127 -0
- package/src/stories/DropDown.stories.tsx +57 -0
- package/src/stories/IconButton.stories.tsx +114 -0
- package/src/stories/Icons.stories.mdx +27 -0
- package/src/stories/Modal.stories.tsx +190 -0
- package/src/stories/Paper.stories.tsx +53 -0
- package/src/stories/ProgressBar.stories.tsx +139 -0
- package/src/stories/RadioGroup.stories.tsx +94 -0
- package/src/stories/RangerSlider.stories.tsx +68 -0
- package/src/stories/Select.stories.tsx +128 -0
- package/src/stories/Tabs.stories.tsx +62 -0
- package/src/stories/Tag.stories.tsx +76 -0
- package/src/{components/textfield/textfield.stories.tsx → stories/TextField.stories.tsx} +445 -376
- package/src/styles/custom.css +5 -0
- package/src/styles/globals.css +21 -0
- package/src/types/index.ts +220 -0
- package/tailwind.config.js +58 -0
- package/tsconfig.json +32 -0
- package/README.md +0 -160
- package/dist/components/button/button.d.ts +0 -3
- package/dist/components/button/index.d.ts +0 -1
- package/dist/components/button/types.d.ts +0 -18
- package/dist/components/card/card-header.d.ts +0 -3
- package/dist/components/card/card.d.ts +0 -3
- package/dist/components/card/index.d.ts +0 -1
- package/dist/components/card/styles.d.ts +0 -811
- package/dist/components/card/types.d.ts +0 -12
- package/dist/components/checkbox/checkbox.d.ts +0 -3
- package/dist/components/checkbox/index.d.ts +0 -1
- package/dist/components/checkbox/types.d.ts +0 -23
- package/dist/components/icon/default.d.ts +0 -210
- package/dist/components/icon/defaultIcon.d.ts +0 -5
- package/dist/components/icon/icons-ia.d.ts +0 -71
- package/dist/components/icon/index.d.ts +0 -234
- package/dist/components/icon/normaIcon.d.ts +0 -13
- package/dist/components/icon/styles.d.ts +0 -481
- package/dist/components/icon/svg.d.ts +0 -6
- package/dist/components/icon/types.d.ts +0 -12
- package/dist/components/index.d.ts +0 -8
- package/dist/components/modal/index.d.ts +0 -1
- package/dist/components/modal/modal.d.ts +0 -3
- package/dist/components/modal/modalFooter.d.ts +0 -3
- package/dist/components/modal/modalHeader.d.ts +0 -3
- package/dist/components/modal/styles.d.ts +0 -540
- package/dist/components/modal/types.d.ts +0 -27
- package/dist/components/progress-bar/index.d.ts +0 -1
- package/dist/components/progress-bar/progress-bar.d.ts +0 -7
- package/dist/components/progress-bar/styles.d.ts +0 -272
- package/dist/components/progress-bar/types.d.ts +0 -22
- package/dist/components/radio/index.d.ts +0 -1
- package/dist/components/radio/radio.d.ts +0 -3
- package/dist/components/radio/types.d.ts +0 -16
- package/dist/components/tag/index.d.ts +0 -1
- package/dist/components/tag/tag.d.ts +0 -3
- package/dist/components/tag/types.d.ts +0 -25
- package/dist/components/textfield/index.d.ts +0 -1
- package/dist/components/textfield/textfield.d.ts +0 -3
- package/dist/components/textfield/types.d.ts +0 -42
- package/dist/helpers/clients.d.ts +0 -5
- package/dist/helpers/index.d.ts +0 -3
- package/dist/helpers/sizes.d.ts +0 -6
- package/dist/helpers/variants.d.ts +0 -2
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -8
- package/dist/norma-library.cjs.development.js +0 -1286
- package/dist/norma-library.cjs.development.js.map +0 -1
- package/dist/norma-library.cjs.production.min.js +0 -2
- package/dist/norma-library.cjs.production.min.js.map +0 -1
- package/dist/norma-library.esm.js +0 -1274
- package/dist/norma-library.esm.js.map +0 -1
- package/src/components/button/button.stories.tsx +0 -44
- package/src/components/button/button.tsx +0 -18
- package/src/components/button/index.ts +0 -1
- package/src/components/button/types.ts +0 -48
- package/src/components/card/card-header.tsx +0 -8
- package/src/components/card/card.stories.tsx +0 -28
- package/src/components/card/card.tsx +0 -13
- package/src/components/card/index.ts +0 -1
- package/src/components/card/styles.tsx +0 -29
- package/src/components/card/types.ts +0 -14
- package/src/components/checkbox/checkbox.stories.tsx +0 -66
- package/src/components/checkbox/checkbox.tsx +0 -13
- package/src/components/checkbox/index.ts +0 -1
- package/src/components/checkbox/types.ts +0 -30
- package/src/components/icon/default.tsx +0 -1459
- package/src/components/icon/defaultIcon.tsx +0 -82
- package/src/components/icon/icon.stories.tsx +0 -44
- package/src/components/icon/icons-ia.tsx +0 -107
- package/src/components/icon/index.ts +0 -11
- package/src/components/icon/normaIcon.tsx +0 -94
- package/src/components/icon/styles.ts +0 -11
- package/src/components/icon/svg.tsx +0 -24
- package/src/components/icon/types.ts +0 -14
- package/src/components/modal/index.ts +0 -1
- package/src/components/modal/modal.stories.tsx +0 -55
- package/src/components/modal/modal.tsx +0 -42
- package/src/components/modal/modalFooter.tsx +0 -32
- package/src/components/modal/modalHeader.tsx +0 -46
- package/src/components/modal/styles.tsx +0 -13
- package/src/components/modal/types.ts +0 -47
- package/src/components/progress-bar/index.ts +0 -1
- package/src/components/progress-bar/progress-bar.stories.tsx +0 -68
- package/src/components/progress-bar/progress-bar.tsx +0 -38
- package/src/components/progress-bar/styles.tsx +0 -27
- package/src/components/progress-bar/types.ts +0 -35
- package/src/components/radio/index.ts +0 -1
- package/src/components/radio/radio.stories.tsx +0 -150
- package/src/components/radio/radio.tsx +0 -13
- package/src/components/radio/types.ts +0 -27
- package/src/components/tag/index.ts +0 -1
- package/src/components/tag/tag.stories.tsx +0 -80
- package/src/components/tag/tag.tsx +0 -13
- package/src/components/tag/types.ts +0 -47
- package/src/components/textfield/index.ts +0 -1
- package/src/components/textfield/textfield.tsx +0 -23
- package/src/components/textfield/types.ts +0 -93
- package/src/helpers/clients.ts +0 -6
- package/src/helpers/variants.ts +0 -3
- package/src/index.tsx +0 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React, { useMemo } from "react";
|
|
2
|
+
import { Paper as MuiPaper, ThemeProvider, useMediaQuery } from "@mui/material";
|
|
3
|
+
import { PaperBaseProps } from "../interfaces";
|
|
4
|
+
import { themes } from "../helpers";
|
|
5
|
+
import { styled } from "@mui/material/styles";
|
|
6
|
+
|
|
7
|
+
const PaperStyled = styled(MuiPaper)({});
|
|
8
|
+
|
|
9
|
+
export const Paper = ({ children, ...props }: PaperBaseProps & {}) => {
|
|
10
|
+
const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
|
|
11
|
+
|
|
12
|
+
const theme = useMemo(
|
|
13
|
+
() => (prefersDarkMode ? themes.light : themes.dark),
|
|
14
|
+
[prefersDarkMode]
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<ThemeProvider theme={theme}>
|
|
19
|
+
<PaperStyled {...props}>{children}</PaperStyled>
|
|
20
|
+
</ThemeProvider>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React, { useMemo } from "react";
|
|
2
|
+
import {
|
|
3
|
+
LinearProgress as MuiProgressBar,
|
|
4
|
+
linearProgressClasses,
|
|
5
|
+
ThemeProvider,
|
|
6
|
+
useMediaQuery,
|
|
7
|
+
Typography,
|
|
8
|
+
} from "@mui/material";
|
|
9
|
+
import { ProgressBarBaseProps } from "../interfaces";
|
|
10
|
+
import { themes } from "../helpers";
|
|
11
|
+
import { styled } from "@mui/material/styles";
|
|
12
|
+
|
|
13
|
+
const ProgressBarStyled = styled(MuiProgressBar)({
|
|
14
|
+
width: "100%",
|
|
15
|
+
height: "10px",
|
|
16
|
+
borderRadius: "10px",
|
|
17
|
+
position: "relative",
|
|
18
|
+
backgroundColor: `&.${linearProgressClasses.determinate} {
|
|
19
|
+
background-color: #e0e0e0,
|
|
20
|
+
}`,
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export const ProgressBarLabelStyled = styled(Typography)`
|
|
24
|
+
display: flex;
|
|
25
|
+
justify-content: space-between;
|
|
26
|
+
align-items: center;
|
|
27
|
+
margin-bottom: 8px;
|
|
28
|
+
position: relative;
|
|
29
|
+
text-align: left;
|
|
30
|
+
font: normal normal normal 16px/20px Source Sans Pro;
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
export const ProgressBar = ({
|
|
34
|
+
value = 0,
|
|
35
|
+
label,
|
|
36
|
+
variant = "determinate",
|
|
37
|
+
total,
|
|
38
|
+
...props
|
|
39
|
+
}: ProgressBarBaseProps) => {
|
|
40
|
+
const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
|
|
41
|
+
const percentage = value && total ? (value / total) * 100 : 0;
|
|
42
|
+
const theme = useMemo(
|
|
43
|
+
() => (prefersDarkMode ? themes.light : themes.dark),
|
|
44
|
+
[prefersDarkMode]
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<ThemeProvider theme={theme}>
|
|
49
|
+
<div style={{ minWidth: "100px" }}>
|
|
50
|
+
{label && (
|
|
51
|
+
<ProgressBarLabelStyled>
|
|
52
|
+
{label}
|
|
53
|
+
<span style={{ right: 0 }}>
|
|
54
|
+
{total} ({percentage.toFixed(2)}%)
|
|
55
|
+
</span>
|
|
56
|
+
</ProgressBarLabelStyled>
|
|
57
|
+
)}
|
|
58
|
+
<ProgressBarStyled value={value} variant={variant} {...props} />
|
|
59
|
+
</div>
|
|
60
|
+
</ThemeProvider>
|
|
61
|
+
);
|
|
62
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React, { useMemo } from "react";
|
|
2
|
+
import {
|
|
3
|
+
FormControl,
|
|
4
|
+
FormControlLabel,
|
|
5
|
+
FormLabel,
|
|
6
|
+
Radio as MuiRadio,
|
|
7
|
+
RadioGroup as MuiRadioGroup,
|
|
8
|
+
ThemeProvider,
|
|
9
|
+
useMediaQuery,
|
|
10
|
+
} from "@mui/material";
|
|
11
|
+
|
|
12
|
+
import { themes } from "../helpers";
|
|
13
|
+
import { styled } from "@mui/material/styles";
|
|
14
|
+
import { RadioBaseProps } from "../interfaces/RadioGroup";
|
|
15
|
+
import { TextFieldSizeVariant } from "../types";
|
|
16
|
+
|
|
17
|
+
const RadioStyled = styled(MuiRadio)({});
|
|
18
|
+
const sizes: TextFieldSizeVariant[] = ["small", "medium"];
|
|
19
|
+
|
|
20
|
+
export const RadioGroup = ({ ...props }: RadioBaseProps) => {
|
|
21
|
+
const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
|
|
22
|
+
const theme = useMemo(
|
|
23
|
+
() => (prefersDarkMode ? themes.light : themes.dark),
|
|
24
|
+
[prefersDarkMode]
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<ThemeProvider theme={theme}>
|
|
29
|
+
<FormControl>
|
|
30
|
+
<FormLabel id={props.id}>{props.label}</FormLabel>
|
|
31
|
+
<MuiRadioGroup
|
|
32
|
+
aria-labelledby={props.id}
|
|
33
|
+
defaultValue={props.checked}
|
|
34
|
+
name="radio-buttons-group"
|
|
35
|
+
row={props.direction === "horizontal" ? true : false}
|
|
36
|
+
>
|
|
37
|
+
{props.options &&
|
|
38
|
+
props.options.map((item, key) => (
|
|
39
|
+
<FormControlLabel
|
|
40
|
+
value={item.value}
|
|
41
|
+
control={
|
|
42
|
+
<RadioStyled
|
|
43
|
+
color={props.color}
|
|
44
|
+
size={item.size ? item.size : sizes[1]}
|
|
45
|
+
/>
|
|
46
|
+
}
|
|
47
|
+
label={item.label}
|
|
48
|
+
key={key}
|
|
49
|
+
/>
|
|
50
|
+
))}
|
|
51
|
+
</MuiRadioGroup>
|
|
52
|
+
</FormControl>
|
|
53
|
+
</ThemeProvider>
|
|
54
|
+
);
|
|
55
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import React, { useMemo } from "react";
|
|
2
|
+
import {
|
|
3
|
+
Slider as MuiSlider,
|
|
4
|
+
ThemeProvider,
|
|
5
|
+
useMediaQuery,
|
|
6
|
+
} from "@mui/material";
|
|
7
|
+
import { palette, themes } from "../helpers";
|
|
8
|
+
import { styled } from "@mui/material/styles";
|
|
9
|
+
import { ColorVariant } from "@/types";
|
|
10
|
+
import { RangerSliderBaseProps } from "@/interfaces/RangerSlider";
|
|
11
|
+
|
|
12
|
+
const colorMap: Record<ColorVariant, string> = {
|
|
13
|
+
inherit: palette.inherit,
|
|
14
|
+
primary: palette.primary,
|
|
15
|
+
secondary: palette.secondary,
|
|
16
|
+
error: palette.error,
|
|
17
|
+
warning: palette.warning,
|
|
18
|
+
info: palette.info,
|
|
19
|
+
success: palette.success,
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const RangerSliderStyled = styled(MuiSlider)(() => ({
|
|
23
|
+
height: 8,
|
|
24
|
+
"& .MuiSlider-track": {
|
|
25
|
+
border: "none",
|
|
26
|
+
},
|
|
27
|
+
"& .MuiSlider-thumb": {
|
|
28
|
+
height: 18,
|
|
29
|
+
width: 18,
|
|
30
|
+
backgroundColor: "#FFF",
|
|
31
|
+
border: `2px solid ${colorMap["primary"]}`,
|
|
32
|
+
"&:focus, &:hover, &.Mui-active, &.Mui-focusVisible": {
|
|
33
|
+
boxShadow: "inherit",
|
|
34
|
+
},
|
|
35
|
+
"&:before": {
|
|
36
|
+
width: "8px",
|
|
37
|
+
height: "8px",
|
|
38
|
+
position: "absolute",
|
|
39
|
+
display: "block",
|
|
40
|
+
background: colorMap["primary"],
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
"& .MuiSlider-valueLabel": {
|
|
44
|
+
fontSize: 12,
|
|
45
|
+
fontWeight: "normal",
|
|
46
|
+
top: 40,
|
|
47
|
+
position: "absolute",
|
|
48
|
+
backgroundColor: "unset",
|
|
49
|
+
color: colorMap["primary"],
|
|
50
|
+
"&:before": {
|
|
51
|
+
display: "none",
|
|
52
|
+
},
|
|
53
|
+
"& *": {
|
|
54
|
+
background: "transparent",
|
|
55
|
+
color: "#000",
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
"& .MuiSlider-rail": {
|
|
59
|
+
color: "#F0F2F8 ",
|
|
60
|
+
opacity: 1,
|
|
61
|
+
height: 10,
|
|
62
|
+
},
|
|
63
|
+
}));
|
|
64
|
+
|
|
65
|
+
export const RangerSlider = ({
|
|
66
|
+
defaultValue = 50,
|
|
67
|
+
color = "primary",
|
|
68
|
+
...props
|
|
69
|
+
}: RangerSliderBaseProps) => {
|
|
70
|
+
const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
|
|
71
|
+
const theme = useMemo(
|
|
72
|
+
() => (prefersDarkMode ? themes.light : themes.dark),
|
|
73
|
+
[prefersDarkMode]
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
return (
|
|
77
|
+
<ThemeProvider theme={theme}>
|
|
78
|
+
<RangerSliderStyled aria-label="Default" color={color} {...props} />
|
|
79
|
+
</ThemeProvider>
|
|
80
|
+
);
|
|
81
|
+
};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import React, { useMemo } from "react";
|
|
2
|
+
import {
|
|
3
|
+
FormControl,
|
|
4
|
+
InputLabel,
|
|
5
|
+
ListItemText,
|
|
6
|
+
MenuItem,
|
|
7
|
+
Select as MuiSelect,
|
|
8
|
+
OutlinedInput,
|
|
9
|
+
ThemeProvider,
|
|
10
|
+
useMediaQuery,
|
|
11
|
+
} from "@mui/material";
|
|
12
|
+
import { SelectBaseProps } from "../interfaces";
|
|
13
|
+
import { themes } from "../helpers";
|
|
14
|
+
import { styled } from "@mui/material/styles";
|
|
15
|
+
import { CheckBox } from "./CheckBox";
|
|
16
|
+
|
|
17
|
+
const ITEM_HEIGHT = 48;
|
|
18
|
+
const ITEM_PADDING_TOP = 8;
|
|
19
|
+
const MenuProps = {
|
|
20
|
+
PaperProps: {
|
|
21
|
+
style: {
|
|
22
|
+
maxHeight: ITEM_HEIGHT * 4.5 + ITEM_PADDING_TOP,
|
|
23
|
+
width: 250,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const SelectStyled = styled(MuiSelect)(({ multiple, variant }) => ({
|
|
29
|
+
"& .MuiOutlinedInput-notchedOutline": {
|
|
30
|
+
border: multiple === true ? "none" : "1px solid #666666 ",
|
|
31
|
+
borderRadius: multiple === true ? 0 : 4,
|
|
32
|
+
borderBottom: "1px solid #666666",
|
|
33
|
+
},
|
|
34
|
+
"& .MuiFormLabel-root": {
|
|
35
|
+
backgroundColor: variant === "standard" ? "#fff" : "inherit",
|
|
36
|
+
padding: variant === "standard" ? "0 5px" : 0,
|
|
37
|
+
},
|
|
38
|
+
}));
|
|
39
|
+
|
|
40
|
+
export const Select = ({
|
|
41
|
+
label,
|
|
42
|
+
onChange,
|
|
43
|
+
data = [],
|
|
44
|
+
value = "",
|
|
45
|
+
multiple = false,
|
|
46
|
+
...props
|
|
47
|
+
}: SelectBaseProps) => {
|
|
48
|
+
const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
|
|
49
|
+
const theme = useMemo(
|
|
50
|
+
() => (prefersDarkMode ? themes.light : themes.dark),
|
|
51
|
+
[prefersDarkMode]
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<ThemeProvider theme={theme}>
|
|
56
|
+
<FormControl fullWidth>
|
|
57
|
+
<InputLabel id={props.id}>{label}</InputLabel>
|
|
58
|
+
|
|
59
|
+
{multiple ? (
|
|
60
|
+
<SelectStyled
|
|
61
|
+
labelId={props.id}
|
|
62
|
+
id="demo-simple-select"
|
|
63
|
+
value={value}
|
|
64
|
+
MenuProps={MenuProps}
|
|
65
|
+
input={<OutlinedInput label="Tag" />}
|
|
66
|
+
renderValue={(selected: any) => selected.join(", ")}
|
|
67
|
+
onChange={onChange}
|
|
68
|
+
multiple
|
|
69
|
+
{...props}
|
|
70
|
+
>
|
|
71
|
+
{data &&
|
|
72
|
+
data.map((item, key) => (
|
|
73
|
+
<MenuItem value={item.value} key={key}>
|
|
74
|
+
<CheckBox checked={value.includes(String(item.value))} />
|
|
75
|
+
<ListItemText primary={String(item.label)} />
|
|
76
|
+
</MenuItem>
|
|
77
|
+
))}
|
|
78
|
+
</SelectStyled>
|
|
79
|
+
) : (
|
|
80
|
+
<SelectStyled
|
|
81
|
+
labelId={props.id}
|
|
82
|
+
id="demo-simple-select"
|
|
83
|
+
value={value}
|
|
84
|
+
onChange={onChange}
|
|
85
|
+
{...props}
|
|
86
|
+
>
|
|
87
|
+
{data &&
|
|
88
|
+
data.map((item, key) => (
|
|
89
|
+
<MenuItem value={item.value} key={key}>
|
|
90
|
+
<ListItemText primary={String(item.label)} />
|
|
91
|
+
</MenuItem>
|
|
92
|
+
))}
|
|
93
|
+
</SelectStyled>
|
|
94
|
+
)}
|
|
95
|
+
</FormControl>
|
|
96
|
+
</ThemeProvider>
|
|
97
|
+
);
|
|
98
|
+
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import React from
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
2
3
|
// Icon paths
|
|
3
|
-
export const
|
|
4
|
+
export const iconsSVG = {
|
|
4
5
|
menuBar: (
|
|
5
6
|
<>
|
|
6
7
|
<path
|
|
7
8
|
id="menu-bar"
|
|
8
9
|
d="M57.286,7c0,2.209-1.4,4-3.127,4H4.127C2.4,11,1,9.209,1,7S2.4,3,4.127,3H54.159C55.886,3,57.286,4.791,57.286,7Zm0,24c0,2.209-1.4,4-3.127,4H4.127C2.4,35,1,33.209,1,31s1.4-4,3.127-4H54.159C55.886,27,57.286,28.791,57.286,31ZM54.159,59c1.727,0,3.127-1.791,3.127-4s-1.4-4-3.127-4H4.127C2.4,51,1,52.791,1,55s1.4,4,3.127,4Z"
|
|
9
10
|
transform="translate(-1 -3)"
|
|
10
|
-
|
|
11
|
+
fill-rule="evenodd"
|
|
11
12
|
/>
|
|
12
13
|
</>
|
|
13
14
|
),
|
|
@@ -53,9 +54,9 @@ export const normaIcons = {
|
|
|
53
54
|
transform="translate(1.75 1.75)"
|
|
54
55
|
fill="none"
|
|
55
56
|
stroke="#000"
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
stroke-linecap="round"
|
|
58
|
+
stroke-linejoin="round"
|
|
59
|
+
stroke-width="5"
|
|
59
60
|
/>
|
|
60
61
|
<path
|
|
61
62
|
id="FaceNeutral_1"
|
|
@@ -64,9 +65,9 @@ export const normaIcons = {
|
|
|
64
65
|
transform="translate(12.427 12.427)"
|
|
65
66
|
fill="none"
|
|
66
67
|
stroke="#000"
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
stroke-linecap="round"
|
|
69
|
+
stroke-linejoin="round"
|
|
70
|
+
stroke-width="5"
|
|
70
71
|
/>
|
|
71
72
|
</g>
|
|
72
73
|
</>
|
|
@@ -108,7 +109,7 @@ export const normaIcons = {
|
|
|
108
109
|
data-name="PieChart 1"
|
|
109
110
|
d="M20.68,1.549a7.725,7.725,0,0,0-7.428,1.81,9.575,9.575,0,0,0-3,7.035V27.831a5.977,5.977,0,0,0,5.977,5.977H33.664a9.575,9.575,0,0,0,7.035-3,7.725,7.725,0,0,0,1.81-7.428A31.52,31.52,0,0,0,20.68,1.549Zm-6.523,8.846A5.671,5.671,0,0,1,15.9,6.236a3.821,3.821,0,0,1,3.734-.924A27.613,27.613,0,0,1,38.746,24.429a3.82,3.82,0,0,1-.924,3.734A5.671,5.671,0,0,1,33.664,29.9H16.227a2.07,2.07,0,0,1-2.07-2.07Z"
|
|
110
111
|
transform="translate(14.442)"
|
|
111
|
-
|
|
112
|
+
fill-rule="evenodd"
|
|
112
113
|
/>
|
|
113
114
|
<path
|
|
114
115
|
id="PieChart_2"
|
|
@@ -129,8 +130,8 @@ export const normaIcons = {
|
|
|
129
130
|
d="M49,7H2"
|
|
130
131
|
fill="none"
|
|
131
132
|
stroke="#000"
|
|
132
|
-
|
|
133
|
-
|
|
133
|
+
stroke-linecap="round"
|
|
134
|
+
stroke-width="7"
|
|
134
135
|
/>
|
|
135
136
|
<path
|
|
136
137
|
id="Sort_2"
|
|
@@ -139,8 +140,8 @@ export const normaIcons = {
|
|
|
139
140
|
transform="translate(4.05 12.588)"
|
|
140
141
|
fill="none"
|
|
141
142
|
stroke="#000"
|
|
142
|
-
|
|
143
|
-
|
|
143
|
+
stroke-linecap="round"
|
|
144
|
+
stroke-width="7"
|
|
144
145
|
/>
|
|
145
146
|
<path
|
|
146
147
|
id="Sort_3"
|
|
@@ -149,8 +150,8 @@ export const normaIcons = {
|
|
|
149
150
|
transform="translate(8.1 25.176)"
|
|
150
151
|
fill="none"
|
|
151
152
|
stroke="#000"
|
|
152
|
-
|
|
153
|
-
|
|
153
|
+
stroke-linecap="round"
|
|
154
|
+
stroke-width="7"
|
|
154
155
|
/>
|
|
155
156
|
</g>
|
|
156
157
|
</>
|
|
@@ -231,9 +232,9 @@ export const normaIcons = {
|
|
|
231
232
|
d="M27.959,6H8.546A5.546,5.546,0,0,0,3,11.546V50.371a5.546,5.546,0,0,0,5.546,5.546H47.371a5.546,5.546,0,0,0,5.546-5.546V30.959"
|
|
232
233
|
transform="translate(-3 -0.117)"
|
|
233
234
|
fill="none"
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
235
|
+
stroke-linecap="round"
|
|
236
|
+
stroke-linejoin="round"
|
|
237
|
+
stroke-width="5"
|
|
237
238
|
/>
|
|
238
239
|
<path
|
|
239
240
|
id="Edit_1947"
|
|
@@ -241,9 +242,9 @@ export const normaIcons = {
|
|
|
241
242
|
d="M41.118,4.541a5.883,5.883,0,0,1,8.32,8.32L23.093,39.206,12,41.979l2.773-11.093Z"
|
|
242
243
|
transform="translate(4.639 -2.818)"
|
|
243
244
|
fill="none"
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
245
|
+
stroke-linecap="round"
|
|
246
|
+
stroke-linejoin="round"
|
|
247
|
+
stroke-width="5"
|
|
247
248
|
/>
|
|
248
249
|
</g>
|
|
249
250
|
</g>
|
|
@@ -328,9 +329,9 @@ export const normaIcons = {
|
|
|
328
329
|
d="M6.157,6H48.067a4.657,4.657,0,0,1,4.657,4.657V38.6a4.657,4.657,0,0,1-4.657,4.657H6.157A4.657,4.657,0,0,1,1.5,38.6V10.657A4.657,4.657,0,0,1,6.157,6Z"
|
|
329
330
|
transform="translate(1 -3.5)"
|
|
330
331
|
fill="none"
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
332
|
+
stroke-linecap="round"
|
|
333
|
+
stroke-linejoin="round"
|
|
334
|
+
stroke-width="5"
|
|
334
335
|
/>
|
|
335
336
|
<path
|
|
336
337
|
id="Card_1938"
|
|
@@ -338,9 +339,9 @@ export const normaIcons = {
|
|
|
338
339
|
d="M1.5,15H52.724"
|
|
339
340
|
transform="translate(1 1.47)"
|
|
340
341
|
fill="none"
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
342
|
+
stroke-linecap="round"
|
|
343
|
+
stroke-linejoin="round"
|
|
344
|
+
stroke-width="5"
|
|
344
345
|
/>
|
|
345
346
|
</>
|
|
346
347
|
),
|
|
@@ -354,9 +355,9 @@ export const normaIcons = {
|
|
|
354
355
|
d="M8.148,10.5H49.332a4.943,4.943,0,0,1,5.148,4.707V38.744a4.943,4.943,0,0,1-5.148,4.707H8.148A4.943,4.943,0,0,1,3,38.744V15.207A4.943,4.943,0,0,1,8.148,10.5Z"
|
|
355
356
|
transform="translate(-3 -1.085)"
|
|
356
357
|
fill="none"
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
358
|
+
stroke-linecap="round"
|
|
359
|
+
stroke-linejoin="round"
|
|
360
|
+
stroke-width="5"
|
|
360
361
|
/>
|
|
361
362
|
<path
|
|
362
363
|
id="Briefcase_1940"
|
|
@@ -364,9 +365,9 @@ export const normaIcons = {
|
|
|
364
365
|
d="M31.122,46.867V9.207A4.744,4.744,0,0,0,26.341,4.5H16.78A4.744,4.744,0,0,0,12,9.207V46.867"
|
|
365
366
|
transform="translate(4.179 -4.5)"
|
|
366
367
|
fill="none"
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
368
|
+
stroke-linecap="round"
|
|
369
|
+
stroke-linejoin="round"
|
|
370
|
+
stroke-width="5"
|
|
370
371
|
/>
|
|
371
372
|
</g>
|
|
372
373
|
</g>
|
|
@@ -383,9 +384,9 @@ export const normaIcons = {
|
|
|
383
384
|
d="M53.347,25.863v2.316A25.174,25.174,0,1,1,38.419,5.171"
|
|
384
385
|
transform="translate(-3 -2.991)"
|
|
385
386
|
fill="none"
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
387
|
+
stroke-linecap="round"
|
|
388
|
+
stroke-linejoin="round"
|
|
389
|
+
stroke-width="5"
|
|
389
390
|
/>
|
|
390
391
|
<path
|
|
391
392
|
id="CheckCircle_1936"
|
|
@@ -393,9 +394,9 @@ export const normaIcons = {
|
|
|
393
394
|
d="M49.688,6,21.851,33.865,13.5,25.514"
|
|
394
395
|
transform="translate(0.66 -0.415)"
|
|
395
396
|
fill="none"
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
397
|
+
stroke-linecap="round"
|
|
398
|
+
stroke-linejoin="round"
|
|
399
|
+
stroke-width="5"
|
|
399
400
|
/>
|
|
400
401
|
</g>
|
|
401
402
|
</g>
|
|
@@ -425,9 +426,9 @@ export const normaIcons = {
|
|
|
425
426
|
d="M13.222,49.667H31.889M22.556,34.111V59m0-24.889A15.556,15.556,0,1,0,7,18.556,15.556,15.556,0,0,0,22.556,34.111Z"
|
|
426
427
|
transform="translate(-7 -3)"
|
|
427
428
|
fill="none"
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
429
|
+
stroke-linecap="round"
|
|
430
|
+
stroke-linejoin="round"
|
|
431
|
+
stroke-width="5"
|
|
431
432
|
/>
|
|
432
433
|
</g>
|
|
433
434
|
</g>
|
|
@@ -446,9 +447,9 @@ export const normaIcons = {
|
|
|
446
447
|
d="M22.556,27.889A15.556,15.556,0,1,0,38.111,43.444,15.556,15.556,0,0,0,22.556,27.889Zm0,0V3m0,0L35,15.444M22.556,3,10.111,15.444"
|
|
447
448
|
transform="translate(-7 -3)"
|
|
448
449
|
fill="none"
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
450
|
+
stroke-linecap="round"
|
|
451
|
+
stroke-linejoin="round"
|
|
452
|
+
stroke-width="5"
|
|
452
453
|
/>
|
|
453
454
|
</g>
|
|
454
455
|
</g>
|
|
@@ -470,9 +471,9 @@ export const normaIcons = {
|
|
|
470
471
|
d="M4.5,38.111V24.666C4.5,13.529,16.886,4.5,32.165,4.5S59.83,13.529,59.83,24.666V38.111"
|
|
471
472
|
transform="translate(-4.5 -4.5)"
|
|
472
473
|
fill="none"
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
474
|
+
stroke-linecap="round"
|
|
475
|
+
stroke-linejoin="round"
|
|
476
|
+
stroke-width="5"
|
|
476
477
|
/>
|
|
477
478
|
<path
|
|
478
479
|
id="HeadPhone_1880_1931"
|
|
@@ -480,9 +481,9 @@ export const normaIcons = {
|
|
|
480
481
|
d="M59.83,36.513a6.177,6.177,0,0,1-6.148,6.205H50.608a6.177,6.177,0,0,1-6.148-6.205V27.205A6.177,6.177,0,0,1,50.608,21H59.83Zm-55.33,0a6.177,6.177,0,0,0,6.148,6.205h3.074a6.177,6.177,0,0,0,6.148-6.205V27.205A6.177,6.177,0,0,0,13.722,21H4.5Z"
|
|
481
482
|
transform="translate(-4.5 12.611)"
|
|
482
483
|
fill="none"
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
484
|
+
stroke-linecap="round"
|
|
485
|
+
stroke-linejoin="round"
|
|
486
|
+
stroke-width="5"
|
|
486
487
|
/>
|
|
487
488
|
</g>
|
|
488
489
|
</g>
|
|
@@ -514,10 +515,8 @@ export const normaIcons = {
|
|
|
514
515
|
id="olos-cloud"
|
|
515
516
|
d="M35.977,44.991q.308.009.618.009a20.5,20.5,0,0,0,0-41,20.305,20.305,0,0,0-15.914,7.688h-3.1a16.657,16.657,0,0,0,0,33.313H35.42Q35.7,45,35.977,44.991Zm4.977-5.831c5.989-1.97,10.93-7.789,10.93-14.66a15.289,15.289,0,1,0-30.578,0h-5.1a20.543,20.543,0,0,1,1.482-7.687h-.109a11.531,11.531,0,0,0,0,23.063H35.42A27.108,27.108,0,0,0,40.954,39.16Z"
|
|
516
517
|
transform="translate(-1.019 -4)"
|
|
517
|
-
|
|
518
|
+
fill-rule="evenodd"
|
|
518
519
|
/>
|
|
519
520
|
</>
|
|
520
521
|
),
|
|
521
522
|
} as const;
|
|
522
|
-
|
|
523
|
-
export type IconKey = keyof typeof normaIcons;
|