norma-library 0.4.3 → 0.4.6
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/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/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/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/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,99 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Button } from "../components/Button";
|
|
3
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
import { ButtonVariant, SizeVariant, ColorVariant } from "../types";
|
|
5
|
+
|
|
6
|
+
const sizes: SizeVariant[] = ["small", "medium", "large"];
|
|
7
|
+
const variants: ButtonVariant[] = ["text", "outlined", "contained"];
|
|
8
|
+
const colors: ColorVariant[] = [
|
|
9
|
+
"inherit",
|
|
10
|
+
"primary",
|
|
11
|
+
"secondary",
|
|
12
|
+
"success",
|
|
13
|
+
"error",
|
|
14
|
+
"info",
|
|
15
|
+
"warning",
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
const meta = {
|
|
19
|
+
title: "Layout/Button",
|
|
20
|
+
component: Button,
|
|
21
|
+
parameters: {
|
|
22
|
+
layout: "centered",
|
|
23
|
+
},
|
|
24
|
+
tags: ["autodocs"],
|
|
25
|
+
argTypes: {},
|
|
26
|
+
} satisfies Meta<typeof Button>;
|
|
27
|
+
|
|
28
|
+
export default meta;
|
|
29
|
+
|
|
30
|
+
type Story = StoryObj<typeof meta>;
|
|
31
|
+
|
|
32
|
+
const defaultArgs = {
|
|
33
|
+
disabled: false,
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const Playground: Story = {
|
|
37
|
+
args: {
|
|
38
|
+
label: "My Button",
|
|
39
|
+
size: "medium",
|
|
40
|
+
color: "primary",
|
|
41
|
+
variant: "contained",
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const ButtonSizes = () => (
|
|
46
|
+
<>
|
|
47
|
+
{sizes.map((size, key) => (
|
|
48
|
+
<Button
|
|
49
|
+
key={key}
|
|
50
|
+
label={`Size ${size}`}
|
|
51
|
+
size={size}
|
|
52
|
+
variant="contained"
|
|
53
|
+
style={{ marginRight: "5px" }}
|
|
54
|
+
{...defaultArgs}
|
|
55
|
+
/>
|
|
56
|
+
))}
|
|
57
|
+
</>
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
export const ButtonVariants = () => (
|
|
61
|
+
<>
|
|
62
|
+
{variants.map((variant, key) => (
|
|
63
|
+
<Button
|
|
64
|
+
key={key}
|
|
65
|
+
variant={variant}
|
|
66
|
+
label={`Variant ${variant}`}
|
|
67
|
+
style={{ marginRight: "5px" }}
|
|
68
|
+
{...defaultArgs}
|
|
69
|
+
/>
|
|
70
|
+
))}
|
|
71
|
+
</>
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
export const ButtonColorsDefault = () => (
|
|
75
|
+
<>
|
|
76
|
+
{colors.map((color, key) => (
|
|
77
|
+
<Button
|
|
78
|
+
key={key}
|
|
79
|
+
variant="outlined"
|
|
80
|
+
label={`Color ${color}`}
|
|
81
|
+
color={color}
|
|
82
|
+
style={{ margin: "2px" }}
|
|
83
|
+
{...defaultArgs}
|
|
84
|
+
/>
|
|
85
|
+
))}
|
|
86
|
+
<div>
|
|
87
|
+
{colors.map((color, key) => (
|
|
88
|
+
<Button
|
|
89
|
+
key={key}
|
|
90
|
+
label={`Color ${color}`}
|
|
91
|
+
color={color}
|
|
92
|
+
variant="contained"
|
|
93
|
+
style={{ margin: "2px" }}
|
|
94
|
+
{...defaultArgs}
|
|
95
|
+
/>
|
|
96
|
+
))}
|
|
97
|
+
</div>
|
|
98
|
+
</>
|
|
99
|
+
);
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Card } from "../components/Card";
|
|
3
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
import { ColorVariant } from "../types";
|
|
5
|
+
|
|
6
|
+
const colors: ColorVariant[] = [
|
|
7
|
+
"inherit",
|
|
8
|
+
"primary",
|
|
9
|
+
"secondary",
|
|
10
|
+
"success",
|
|
11
|
+
"error",
|
|
12
|
+
"info",
|
|
13
|
+
"warning",
|
|
14
|
+
];
|
|
15
|
+
|
|
16
|
+
const meta = {
|
|
17
|
+
title: "Layout/Card",
|
|
18
|
+
component: Card,
|
|
19
|
+
parameters: {
|
|
20
|
+
layout: "centered",
|
|
21
|
+
},
|
|
22
|
+
tags: ["autodocs"],
|
|
23
|
+
argTypes: {},
|
|
24
|
+
} satisfies Meta<typeof Card>;
|
|
25
|
+
|
|
26
|
+
export default meta;
|
|
27
|
+
|
|
28
|
+
type Story = StoryObj<typeof meta>;
|
|
29
|
+
|
|
30
|
+
const defaultArgs = {};
|
|
31
|
+
|
|
32
|
+
export const BasicCard = () => (
|
|
33
|
+
<Card sx={{ minWidth: 275 }}>Content children card</Card>
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
export const BasicBordered = () => (
|
|
37
|
+
<Card sx={{ minWidth: 275 }} border={true} color="primary">
|
|
38
|
+
Card with border
|
|
39
|
+
</Card>
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
export const BasicBorderedColors = () => (
|
|
43
|
+
<>
|
|
44
|
+
{colors.map((color, key) => (
|
|
45
|
+
<Card
|
|
46
|
+
sx={{ minWidth: 275, marginBottom: 2 }}
|
|
47
|
+
border={true}
|
|
48
|
+
color={color}
|
|
49
|
+
key={key}
|
|
50
|
+
>
|
|
51
|
+
Card with border {color}
|
|
52
|
+
</Card>
|
|
53
|
+
))}
|
|
54
|
+
</>
|
|
55
|
+
);
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CheckBox } from "../components/CheckBox";
|
|
3
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
import { FormControlLabel } from "@mui/material";
|
|
5
|
+
import { pink } from "@mui/material/colors";
|
|
6
|
+
|
|
7
|
+
const meta = {
|
|
8
|
+
title: "Form/CheckBox",
|
|
9
|
+
component: CheckBox,
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: "centered",
|
|
12
|
+
},
|
|
13
|
+
tags: ["autodocs"],
|
|
14
|
+
argTypes: {},
|
|
15
|
+
} satisfies Meta<typeof CheckBox>;
|
|
16
|
+
|
|
17
|
+
export default meta;
|
|
18
|
+
|
|
19
|
+
type Story = StoryObj<typeof meta>;
|
|
20
|
+
|
|
21
|
+
const defaultArgs = {
|
|
22
|
+
disabled: false,
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const Playground: Story = {
|
|
26
|
+
args: {
|
|
27
|
+
color: "primary",
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const label = { inputProps: { "aria-label": "Checkbox demo" } };
|
|
32
|
+
|
|
33
|
+
export const CheckboxVariant = () => {
|
|
34
|
+
return (
|
|
35
|
+
<>
|
|
36
|
+
<CheckBox {...label} />
|
|
37
|
+
<CheckBox {...label} defaultChecked />
|
|
38
|
+
<CheckBox {...label} disabled />
|
|
39
|
+
<CheckBox {...label} disabled checked />
|
|
40
|
+
</>
|
|
41
|
+
);
|
|
42
|
+
};
|
|
43
|
+
CheckboxVariant.storyName = "CheckBox Variants";
|
|
44
|
+
|
|
45
|
+
export const CheckboxProps = () => {
|
|
46
|
+
return (
|
|
47
|
+
<>
|
|
48
|
+
<FormControlLabel control={<CheckBox />} label="Label Default" />
|
|
49
|
+
<FormControlLabel control={<CheckBox defaultChecked />} label="Label" />
|
|
50
|
+
<FormControlLabel required control={<CheckBox />} label="Required" />
|
|
51
|
+
<FormControlLabel disabled control={<CheckBox />} label="Disabled" />
|
|
52
|
+
</>
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
CheckboxProps.storyName = "Variants and Label";
|
|
56
|
+
|
|
57
|
+
export const CheckboxColors = () => {
|
|
58
|
+
return (
|
|
59
|
+
<>
|
|
60
|
+
<CheckBox {...label} defaultChecked />
|
|
61
|
+
<CheckBox {...label} defaultChecked color="secondary" />
|
|
62
|
+
<CheckBox {...label} defaultChecked color="success" />
|
|
63
|
+
<CheckBox {...label} defaultChecked color="default" />
|
|
64
|
+
<CheckBox
|
|
65
|
+
{...label}
|
|
66
|
+
defaultChecked
|
|
67
|
+
sx={{
|
|
68
|
+
color: pink[800],
|
|
69
|
+
"&.Mui-checked": {
|
|
70
|
+
color: pink[600],
|
|
71
|
+
},
|
|
72
|
+
}}
|
|
73
|
+
/>
|
|
74
|
+
</>
|
|
75
|
+
);
|
|
76
|
+
};
|
|
77
|
+
CheckboxColors.storyName = "CheckBox Colors";
|
|
78
|
+
|
|
79
|
+
export const CheckboxSizes = () => {
|
|
80
|
+
return (
|
|
81
|
+
<>
|
|
82
|
+
<FormControlLabel
|
|
83
|
+
control={<CheckBox size="small" />}
|
|
84
|
+
label="CheckBox Small"
|
|
85
|
+
/>
|
|
86
|
+
<FormControlLabel control={<CheckBox />} label="CheckBox Default" />
|
|
87
|
+
<FormControlLabel
|
|
88
|
+
control={<CheckBox size="medium" />}
|
|
89
|
+
label="CheckBox Medium"
|
|
90
|
+
/>
|
|
91
|
+
</>
|
|
92
|
+
);
|
|
93
|
+
};
|
|
94
|
+
CheckboxSizes.storyName = "CheckBox Sizes";
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { Meta, ColorPalette, ColorItem } from "@storybook/blocks";
|
|
2
|
+
|
|
3
|
+
import { palette } from "../helpers";
|
|
4
|
+
|
|
5
|
+
<Meta title="Theme/Colors" />
|
|
6
|
+
|
|
7
|
+
<ColorPalette>
|
|
8
|
+
<ColorItem
|
|
9
|
+
title="Primary"
|
|
10
|
+
subtitle="Color primary default to project"
|
|
11
|
+
colors={{ Primary: palette.primary }}
|
|
12
|
+
/>
|
|
13
|
+
<ColorItem
|
|
14
|
+
title="Primary variant colors"
|
|
15
|
+
subtitle="Variants colors primary"
|
|
16
|
+
colors={{
|
|
17
|
+
PrimaryLight: palette.primaryLight,
|
|
18
|
+
PrimaryMedium: palette.primaryMedium,
|
|
19
|
+
PrimaryDark: palette.primaryDark,
|
|
20
|
+
}}
|
|
21
|
+
/>
|
|
22
|
+
|
|
23
|
+
<ColorItem
|
|
24
|
+
title="Secondary"
|
|
25
|
+
subtitle="Color secondary"
|
|
26
|
+
colors={{ Secondary: palette.secondary }}
|
|
27
|
+
/>
|
|
28
|
+
<ColorItem
|
|
29
|
+
title="Secondary variant colors"
|
|
30
|
+
subtitle="Variants colors secondary"
|
|
31
|
+
colors={{
|
|
32
|
+
SecondaryLight: palette.secondaryLight,
|
|
33
|
+
SecondaryMedium: palette.secondaryMedium,
|
|
34
|
+
SecondaryDark: palette.secondaryDark,
|
|
35
|
+
}}
|
|
36
|
+
/>
|
|
37
|
+
|
|
38
|
+
<ColorItem
|
|
39
|
+
title="Inherit"
|
|
40
|
+
subtitle="Color inherit"
|
|
41
|
+
colors={{ Inherit: palette.inherit }}
|
|
42
|
+
/>
|
|
43
|
+
<ColorItem
|
|
44
|
+
title="Inherit variant colors"
|
|
45
|
+
subtitle="Variants colors inherit"
|
|
46
|
+
colors={{
|
|
47
|
+
InheritLight: palette.inheritLight,
|
|
48
|
+
InheritMedium: palette.inheritMedium,
|
|
49
|
+
InheritDark: palette.inheritDark,
|
|
50
|
+
}}
|
|
51
|
+
/>
|
|
52
|
+
|
|
53
|
+
<ColorItem
|
|
54
|
+
title="White"
|
|
55
|
+
subtitle="Color white"
|
|
56
|
+
colors={{ White: palette.white }}
|
|
57
|
+
/>
|
|
58
|
+
<ColorItem
|
|
59
|
+
title="White variant colors"
|
|
60
|
+
subtitle="Variants colors white"
|
|
61
|
+
colors={{
|
|
62
|
+
WhiteLight: palette.whiteLight,
|
|
63
|
+
WhiteMedium: palette.whiteMedium,
|
|
64
|
+
WhiteDark: palette.whiteDark,
|
|
65
|
+
}}
|
|
66
|
+
/>
|
|
67
|
+
|
|
68
|
+
<ColorItem
|
|
69
|
+
title="Success"
|
|
70
|
+
subtitle="Color success"
|
|
71
|
+
colors={{ Success: palette.success }}
|
|
72
|
+
/>
|
|
73
|
+
<ColorItem
|
|
74
|
+
title="Success variant colors"
|
|
75
|
+
subtitle="Variants colors success"
|
|
76
|
+
colors={{
|
|
77
|
+
SuccessLight: palette.successLight,
|
|
78
|
+
SuccessMedium: palette.successMedium,
|
|
79
|
+
SuccessDark: palette.successDark,
|
|
80
|
+
}}
|
|
81
|
+
/>
|
|
82
|
+
|
|
83
|
+
<ColorItem
|
|
84
|
+
title="Error"
|
|
85
|
+
subtitle="Color error"
|
|
86
|
+
colors={{ Error: palette.error }}
|
|
87
|
+
/>
|
|
88
|
+
<ColorItem
|
|
89
|
+
title="Error variant colors"
|
|
90
|
+
subtitle="Variants colors error"
|
|
91
|
+
colors={{
|
|
92
|
+
ErrorLight: palette.errorLight,
|
|
93
|
+
ErrorMedium: palette.errorMedium,
|
|
94
|
+
ErrorDark: palette.errorDark,
|
|
95
|
+
}}
|
|
96
|
+
/>
|
|
97
|
+
|
|
98
|
+
<ColorItem
|
|
99
|
+
title="Warning"
|
|
100
|
+
subtitle="Color warning"
|
|
101
|
+
colors={{ Warning: palette.warning }}
|
|
102
|
+
/>
|
|
103
|
+
<ColorItem
|
|
104
|
+
title="Warning variant colors"
|
|
105
|
+
subtitle="Variants colors warning"
|
|
106
|
+
colors={{
|
|
107
|
+
WarningLight: palette.warningLight,
|
|
108
|
+
WarningMedium: palette.warningMedium,
|
|
109
|
+
WarningDark: palette.warningDark,
|
|
110
|
+
}}
|
|
111
|
+
/>
|
|
112
|
+
|
|
113
|
+
<ColorItem
|
|
114
|
+
title="Helper"
|
|
115
|
+
subtitle="Color helper"
|
|
116
|
+
colors={{ Helper: palette.helper }}
|
|
117
|
+
/>
|
|
118
|
+
<ColorItem
|
|
119
|
+
title="Helper variant colors"
|
|
120
|
+
subtitle="Variants colors helper"
|
|
121
|
+
colors={{
|
|
122
|
+
HelperLight: palette.helperLight,
|
|
123
|
+
HelperMedium: palette.helperMedium,
|
|
124
|
+
HelperDark: palette.helperDark,
|
|
125
|
+
}}
|
|
126
|
+
/>
|
|
127
|
+
</ColorPalette>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
import { Button, DropDown } from "../components";
|
|
5
|
+
import { MenuItem } from "@mui/material";
|
|
6
|
+
|
|
7
|
+
const meta = {
|
|
8
|
+
title: "Layout/DropDown",
|
|
9
|
+
component: DropDown,
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: "centered",
|
|
12
|
+
},
|
|
13
|
+
tags: ["autodocs"],
|
|
14
|
+
argTypes: {},
|
|
15
|
+
} satisfies Meta<typeof DropDown>;
|
|
16
|
+
|
|
17
|
+
export default meta;
|
|
18
|
+
|
|
19
|
+
type Story = StoryObj<typeof meta>;
|
|
20
|
+
|
|
21
|
+
export const DropDownlBasic = () => {
|
|
22
|
+
const [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(null);
|
|
23
|
+
const open = Boolean(anchorEl);
|
|
24
|
+
|
|
25
|
+
const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
|
|
26
|
+
setAnchorEl(event.currentTarget);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const handleClose = () => {
|
|
30
|
+
setAnchorEl(null);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<>
|
|
35
|
+
<Button
|
|
36
|
+
id="basic-button"
|
|
37
|
+
aria-controls={open ? "basic-menu" : undefined}
|
|
38
|
+
aria-haspopup="true"
|
|
39
|
+
aria-expanded={open ? "true" : undefined}
|
|
40
|
+
onClick={handleClick}
|
|
41
|
+
color="primary"
|
|
42
|
+
variant="outlined"
|
|
43
|
+
>
|
|
44
|
+
Open DropDown
|
|
45
|
+
</Button>
|
|
46
|
+
{open && (
|
|
47
|
+
<DropDown onClose={handleClose} open anchorEl={anchorEl}>
|
|
48
|
+
<MenuItem onClick={handleClose}>Profile</MenuItem>
|
|
49
|
+
<MenuItem onClick={handleClose}>My account</MenuItem>
|
|
50
|
+
<MenuItem onClick={handleClose}>Logout</MenuItem>
|
|
51
|
+
</DropDown>
|
|
52
|
+
)}
|
|
53
|
+
</>
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
DropDownlBasic.storyName = "DropDown Basic";
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IconButton, Icons } from "../components";
|
|
3
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
import { ButtonVariant, SizeVariant, ColorVariant } from "../types";
|
|
5
|
+
|
|
6
|
+
const sizes: SizeVariant[] = ["small", "medium", "large"];
|
|
7
|
+
const variants: ButtonVariant[] = ["text", "outlined", "contained"];
|
|
8
|
+
const colors: ColorVariant[] = [
|
|
9
|
+
"inherit",
|
|
10
|
+
"primary",
|
|
11
|
+
"secondary",
|
|
12
|
+
"success",
|
|
13
|
+
"error",
|
|
14
|
+
"info",
|
|
15
|
+
"warning",
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
const meta = {
|
|
19
|
+
title: "Layout/IconButton",
|
|
20
|
+
component: IconButton,
|
|
21
|
+
parameters: {
|
|
22
|
+
layout: "centered",
|
|
23
|
+
},
|
|
24
|
+
tags: ["autodocs"],
|
|
25
|
+
argTypes: {},
|
|
26
|
+
} satisfies Meta<typeof IconButton>;
|
|
27
|
+
|
|
28
|
+
export default meta;
|
|
29
|
+
|
|
30
|
+
type Story = StoryObj<typeof meta>;
|
|
31
|
+
|
|
32
|
+
const defaultArgs = {
|
|
33
|
+
color: "primary",
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const Playground: Story = {
|
|
37
|
+
args: {
|
|
38
|
+
children: <Icons icon="checkCircle" color="primary" />,
|
|
39
|
+
size: "medium",
|
|
40
|
+
color: "primary",
|
|
41
|
+
variant: "text",
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const IconButtonSizes = () => (
|
|
46
|
+
<>
|
|
47
|
+
{sizes.map((size, key) => (
|
|
48
|
+
<IconButton
|
|
49
|
+
key={key}
|
|
50
|
+
size={size}
|
|
51
|
+
variant="text"
|
|
52
|
+
color="primary"
|
|
53
|
+
sx={{ marginRight: "5px" }}
|
|
54
|
+
>
|
|
55
|
+
<Icons icon="checkCircle" color="primary" scale={size} />
|
|
56
|
+
</IconButton>
|
|
57
|
+
))}
|
|
58
|
+
</>
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
IconButtonSizes.storyName = "IconButton Sizes";
|
|
62
|
+
|
|
63
|
+
export const IconButtonVariants = () => (
|
|
64
|
+
<>
|
|
65
|
+
{variants.map((variant, key) => (
|
|
66
|
+
<IconButton
|
|
67
|
+
key={key}
|
|
68
|
+
size="medium"
|
|
69
|
+
variant={variant}
|
|
70
|
+
color="primary"
|
|
71
|
+
sx={{ marginRight: "5px" }}
|
|
72
|
+
>
|
|
73
|
+
<Icons
|
|
74
|
+
icon="faceHappy"
|
|
75
|
+
color={variant === "contained" ? "white" : "primary"}
|
|
76
|
+
scale="medium"
|
|
77
|
+
/>
|
|
78
|
+
</IconButton>
|
|
79
|
+
))}
|
|
80
|
+
</>
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
IconButtonVariants.storyName = "IconButton Variants";
|
|
84
|
+
|
|
85
|
+
export const IconButtonColors = () => (
|
|
86
|
+
<>
|
|
87
|
+
{colors.map((color, key) => (
|
|
88
|
+
<IconButton
|
|
89
|
+
key={key}
|
|
90
|
+
size="medium"
|
|
91
|
+
variant="outlined"
|
|
92
|
+
color={color}
|
|
93
|
+
sx={{ margin: "5px" }}
|
|
94
|
+
>
|
|
95
|
+
<Icons icon="starOutlined" color={color} scale="medium" />
|
|
96
|
+
</IconButton>
|
|
97
|
+
))}
|
|
98
|
+
<div>
|
|
99
|
+
{colors.map((color, key) => (
|
|
100
|
+
<IconButton
|
|
101
|
+
key={key}
|
|
102
|
+
size="medium"
|
|
103
|
+
variant="contained"
|
|
104
|
+
color={color}
|
|
105
|
+
sx={{ margin: "5px" }}
|
|
106
|
+
>
|
|
107
|
+
<Icons icon="user" color="white" scale="medium" />
|
|
108
|
+
</IconButton>
|
|
109
|
+
))}
|
|
110
|
+
</div>
|
|
111
|
+
</>
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
IconButtonColors.storyName = "IconButton Colors";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Meta, ColorPalette, ColorItem } from "@storybook/blocks";
|
|
2
|
+
import { Box, Card, Grid, Typography, Paper } from "@mui/material";
|
|
3
|
+
import { palette } from "../helpers";
|
|
4
|
+
import { iconsSVG } from "../components/Svgs";
|
|
5
|
+
import { Icons } from "../components/Icons";
|
|
6
|
+
|
|
7
|
+
<Meta title="Display/Icons" />
|
|
8
|
+
|
|
9
|
+
<Grid container spacing={2}>
|
|
10
|
+
<Grid item xs={12}>
|
|
11
|
+
<Typography variant="h5">Norma DS Icons</Typography>
|
|
12
|
+
</Grid>
|
|
13
|
+
{Object.keys(iconsSVG).map((key) => (
|
|
14
|
+
<Grid item xs={3} key={key}>
|
|
15
|
+
<Paper sx={{ padding: 2 }}>
|
|
16
|
+
<Typography variant={"body1"}> {key} </Typography>
|
|
17
|
+
<Icons icon={key} scale="xsmall" />
|
|
18
|
+
<Icons icon={key} scale="small" color="secondary" />
|
|
19
|
+
<Icons icon={key} scale="medium" color="error" />
|
|
20
|
+
<Icons icon={key} scale="large" color="warning" />
|
|
21
|
+
<Icons icon={key} scale="xlarge" color="success" />
|
|
22
|
+
<Icons icon={key} scale="2xlarge" color="black" />
|
|
23
|
+
<Icons icon={key} scale="3xlarge" color="primary" />
|
|
24
|
+
</Paper>
|
|
25
|
+
</Grid>
|
|
26
|
+
))}
|
|
27
|
+
</Grid>
|