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,190 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
import { Button, Modal } from "../components";
|
|
5
|
+
import { Box, Typography } from "@mui/material";
|
|
6
|
+
|
|
7
|
+
const meta = {
|
|
8
|
+
title: "Layout/Modal",
|
|
9
|
+
component: Modal,
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: "centered",
|
|
12
|
+
},
|
|
13
|
+
tags: ["autodocs"],
|
|
14
|
+
argTypes: {},
|
|
15
|
+
} satisfies Meta<typeof Modal>;
|
|
16
|
+
|
|
17
|
+
export default meta;
|
|
18
|
+
|
|
19
|
+
type Story = StoryObj<typeof meta>;
|
|
20
|
+
|
|
21
|
+
export const ModalBasic = () => {
|
|
22
|
+
const [open, setOpen] = React.useState(false);
|
|
23
|
+
const handleOpen = () => setOpen(true);
|
|
24
|
+
const handleClose = () => setOpen(false);
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<>
|
|
28
|
+
<Button onClick={handleOpen} color="primary" variant="outlined">
|
|
29
|
+
Open modal
|
|
30
|
+
</Button>
|
|
31
|
+
|
|
32
|
+
{open && (
|
|
33
|
+
<Modal
|
|
34
|
+
open={open}
|
|
35
|
+
onClose={handleClose}
|
|
36
|
+
aria-labelledby="modal-modal-title"
|
|
37
|
+
aria-describedby="modal-modal-description"
|
|
38
|
+
>
|
|
39
|
+
<>
|
|
40
|
+
<Typography id="modal-modal-title" variant="h6" component="h2">
|
|
41
|
+
Text in a modal
|
|
42
|
+
</Typography>
|
|
43
|
+
<Typography id="modal-modal-description" sx={{ mt: 2 }}>
|
|
44
|
+
Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
|
|
45
|
+
</Typography>
|
|
46
|
+
</>
|
|
47
|
+
</Modal>
|
|
48
|
+
)}
|
|
49
|
+
</>
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
ModalBasic.storyName = "Modal Basic";
|
|
54
|
+
|
|
55
|
+
export const ModalTitle = () => {
|
|
56
|
+
const [open, setOpen] = React.useState(false);
|
|
57
|
+
const handleOpen = () => setOpen(true);
|
|
58
|
+
const handleClose = () => setOpen(false);
|
|
59
|
+
return (
|
|
60
|
+
<>
|
|
61
|
+
<Button onClick={handleOpen} color="primary" variant="outlined">
|
|
62
|
+
Open modal
|
|
63
|
+
</Button>
|
|
64
|
+
|
|
65
|
+
{open && (
|
|
66
|
+
<Modal
|
|
67
|
+
open={open}
|
|
68
|
+
onClose={handleClose}
|
|
69
|
+
aria-labelledby="modal-modal-title"
|
|
70
|
+
aria-describedby="modal-modal-description"
|
|
71
|
+
title="Title Modal"
|
|
72
|
+
>
|
|
73
|
+
<>
|
|
74
|
+
<Typography id="modal-modal-title" variant="h6" component="h2">
|
|
75
|
+
Text in a modal
|
|
76
|
+
</Typography>
|
|
77
|
+
<Typography id="modal-modal-description" sx={{ mt: 2 }}>
|
|
78
|
+
Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
|
|
79
|
+
</Typography>
|
|
80
|
+
</>
|
|
81
|
+
</Modal>
|
|
82
|
+
)}
|
|
83
|
+
</>
|
|
84
|
+
);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
ModalTitle.storyName = "Modal Title";
|
|
88
|
+
|
|
89
|
+
export const ModalAction = () => {
|
|
90
|
+
const [open, setOpen] = React.useState(false);
|
|
91
|
+
const handleOpen = () => setOpen(true);
|
|
92
|
+
const handleClose = () => setOpen(false);
|
|
93
|
+
|
|
94
|
+
const defaultAction = [
|
|
95
|
+
{
|
|
96
|
+
label: "Cancelar",
|
|
97
|
+
action: handleClose,
|
|
98
|
+
color: "error",
|
|
99
|
+
size: "medium",
|
|
100
|
+
variant: "outlined",
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
label: "Confirmar",
|
|
104
|
+
action: handleClose,
|
|
105
|
+
color: "primary",
|
|
106
|
+
size: "medium",
|
|
107
|
+
variant: "contained",
|
|
108
|
+
},
|
|
109
|
+
];
|
|
110
|
+
return (
|
|
111
|
+
<>
|
|
112
|
+
<Button onClick={handleOpen} color="primary" variant="outlined">
|
|
113
|
+
Open modal
|
|
114
|
+
</Button>
|
|
115
|
+
|
|
116
|
+
{open && (
|
|
117
|
+
<Modal
|
|
118
|
+
open={open}
|
|
119
|
+
onClose={handleClose}
|
|
120
|
+
aria-labelledby="modal-modal-title"
|
|
121
|
+
aria-describedby="modal-modal-description"
|
|
122
|
+
action={defaultAction}
|
|
123
|
+
>
|
|
124
|
+
<>
|
|
125
|
+
<Typography id="modal-modal-title" variant="h6" component="h2">
|
|
126
|
+
Text in a modal
|
|
127
|
+
</Typography>
|
|
128
|
+
<Typography id="modal-modal-description" sx={{ mt: 2 }}>
|
|
129
|
+
Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
|
|
130
|
+
</Typography>
|
|
131
|
+
</>
|
|
132
|
+
</Modal>
|
|
133
|
+
)}
|
|
134
|
+
</>
|
|
135
|
+
);
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
ModalAction.storyName = "Modal Action";
|
|
139
|
+
|
|
140
|
+
export const ModalProps = () => {
|
|
141
|
+
const [open, setOpen] = React.useState(false);
|
|
142
|
+
const handleOpen = () => setOpen(true);
|
|
143
|
+
const handleClose = () => setOpen(false);
|
|
144
|
+
|
|
145
|
+
const defaultAction = [
|
|
146
|
+
{
|
|
147
|
+
label: "Cancelar",
|
|
148
|
+
action: handleClose,
|
|
149
|
+
color: "error",
|
|
150
|
+
size: "medium",
|
|
151
|
+
variant: "outlined",
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
label: "Confirmar",
|
|
155
|
+
action: handleClose,
|
|
156
|
+
color: "primary",
|
|
157
|
+
size: "medium",
|
|
158
|
+
variant: "contained",
|
|
159
|
+
},
|
|
160
|
+
];
|
|
161
|
+
return (
|
|
162
|
+
<>
|
|
163
|
+
<Button onClick={handleOpen} color="primary" variant="outlined">
|
|
164
|
+
Open modal
|
|
165
|
+
</Button>
|
|
166
|
+
|
|
167
|
+
{open && (
|
|
168
|
+
<Modal
|
|
169
|
+
open={open}
|
|
170
|
+
onClose={handleClose}
|
|
171
|
+
aria-labelledby="modal-modal-title"
|
|
172
|
+
aria-describedby="modal-modal-description"
|
|
173
|
+
action={defaultAction}
|
|
174
|
+
title="Select a company"
|
|
175
|
+
>
|
|
176
|
+
<>
|
|
177
|
+
<Typography id="modal-modal-title" variant="h6" component="h2">
|
|
178
|
+
Text in a modal
|
|
179
|
+
</Typography>
|
|
180
|
+
<Typography id="modal-modal-description" sx={{ mt: 2 }}>
|
|
181
|
+
Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
|
|
182
|
+
</Typography>
|
|
183
|
+
</>
|
|
184
|
+
</Modal>
|
|
185
|
+
)}
|
|
186
|
+
</>
|
|
187
|
+
);
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
ModalProps.storyName = "Modal Title and Action";
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Paper } from "../components";
|
|
3
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
|
|
5
|
+
import Grid from "@mui/material/Grid";
|
|
6
|
+
import Box from "@mui/material/Box";
|
|
7
|
+
import { ThemeProvider, styled } from "@mui/material/styles";
|
|
8
|
+
import { themes } from "../helpers";
|
|
9
|
+
|
|
10
|
+
const Item = styled(Paper)(({ theme }) => ({
|
|
11
|
+
...theme.typography.body2,
|
|
12
|
+
textAlign: "center",
|
|
13
|
+
height: 60,
|
|
14
|
+
lineHeight: "60px",
|
|
15
|
+
}));
|
|
16
|
+
|
|
17
|
+
const meta = {
|
|
18
|
+
title: "Layout/Paper",
|
|
19
|
+
component: Paper,
|
|
20
|
+
parameters: {
|
|
21
|
+
// layout: "centered",
|
|
22
|
+
},
|
|
23
|
+
tags: ["autodocs"],
|
|
24
|
+
argTypes: {},
|
|
25
|
+
} satisfies Meta<typeof Paper>;
|
|
26
|
+
|
|
27
|
+
export default meta;
|
|
28
|
+
|
|
29
|
+
type Story = StoryObj<typeof meta>;
|
|
30
|
+
|
|
31
|
+
const defaultArgs = {};
|
|
32
|
+
|
|
33
|
+
export const PaperElevations = () => (
|
|
34
|
+
<Grid container spacing={2}>
|
|
35
|
+
<Grid item xs={12}>
|
|
36
|
+
<Box
|
|
37
|
+
sx={{
|
|
38
|
+
p: 2,
|
|
39
|
+
bgcolor: "background.default",
|
|
40
|
+
display: "grid",
|
|
41
|
+
gridTemplateColumns: { md: "1fr 1fr" },
|
|
42
|
+
gap: 2,
|
|
43
|
+
}}
|
|
44
|
+
>
|
|
45
|
+
{[0, 1, 2, 3, 4, 6, 8, 12, 16, 24].map((elevation) => (
|
|
46
|
+
<Item key={elevation} elevation={elevation}>
|
|
47
|
+
{`elevation=${elevation}`}
|
|
48
|
+
</Item>
|
|
49
|
+
))}
|
|
50
|
+
</Box>
|
|
51
|
+
</Grid>
|
|
52
|
+
</Grid>
|
|
53
|
+
);
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
import { ProgressBar } from "../components";
|
|
5
|
+
import { ColorVariant, SizeVariant, TextFieldSizeVariant } from "../types";
|
|
6
|
+
|
|
7
|
+
const colors: ColorVariant[] = [
|
|
8
|
+
"inherit",
|
|
9
|
+
"primary",
|
|
10
|
+
"secondary",
|
|
11
|
+
"success",
|
|
12
|
+
"error",
|
|
13
|
+
"info",
|
|
14
|
+
"warning",
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
const sizes: TextFieldSizeVariant[] = ["small", "medium"];
|
|
18
|
+
|
|
19
|
+
const meta = {
|
|
20
|
+
title: "Display/ProgressBar",
|
|
21
|
+
component: ProgressBar,
|
|
22
|
+
parameters: {
|
|
23
|
+
layout: "centered",
|
|
24
|
+
},
|
|
25
|
+
tags: ["autodocs"],
|
|
26
|
+
argTypes: {},
|
|
27
|
+
} satisfies Meta<typeof ProgressBar>;
|
|
28
|
+
|
|
29
|
+
export default meta;
|
|
30
|
+
|
|
31
|
+
type Story = StoryObj<typeof meta>;
|
|
32
|
+
|
|
33
|
+
const defaultArgs = {
|
|
34
|
+
disabled: false,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const Playground: Story = {
|
|
38
|
+
args: {
|
|
39
|
+
label: "Progress",
|
|
40
|
+
total: 100,
|
|
41
|
+
color: "primary",
|
|
42
|
+
value: 10,
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const ProgressBarBasic = () => (
|
|
47
|
+
<div style={{ display: "flex", gap: "1rem", width: "320px" }}>
|
|
48
|
+
<div style={{ position: "relative", width: "100%" }}>
|
|
49
|
+
<ProgressBar value={40} total={100} color="primary" />
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
ProgressBarBasic.storyName = "ProgressBar Basic";
|
|
55
|
+
|
|
56
|
+
export const ProgressBarTitle: Story = () => (
|
|
57
|
+
<div style={{ display: "flex", gap: "1rem", width: "320px" }}>
|
|
58
|
+
<div style={{ position: "relative", width: "100%" }}>
|
|
59
|
+
<ProgressBar value={10} label="Progress" total={100} />
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
ProgressBarTitle.storyName = "ProgressBar With Title";
|
|
65
|
+
|
|
66
|
+
export const ProgressBarColors: Story = () => (
|
|
67
|
+
<>
|
|
68
|
+
<div
|
|
69
|
+
style={{ display: "flex", gap: "1rem", width: "480px", marginBottom: 30 }}
|
|
70
|
+
>
|
|
71
|
+
<>
|
|
72
|
+
<div style={{ position: "relative", flex: 1, width: "230px" }}>
|
|
73
|
+
<ProgressBar
|
|
74
|
+
value={18}
|
|
75
|
+
total={100}
|
|
76
|
+
color="inherit"
|
|
77
|
+
label="Progress Inherit"
|
|
78
|
+
/>
|
|
79
|
+
</div>
|
|
80
|
+
<div style={{ position: "relative", flex: 1, width: "230px" }}>
|
|
81
|
+
<ProgressBar
|
|
82
|
+
value={77}
|
|
83
|
+
total={100}
|
|
84
|
+
color="secondary"
|
|
85
|
+
label="Progress secondary"
|
|
86
|
+
/>
|
|
87
|
+
</div>
|
|
88
|
+
</>
|
|
89
|
+
</div>
|
|
90
|
+
<div
|
|
91
|
+
style={{ display: "flex", gap: "1rem", width: "480px", marginBottom: 30 }}
|
|
92
|
+
>
|
|
93
|
+
<>
|
|
94
|
+
<div style={{ position: "relative", flex: 1, width: "230px" }}>
|
|
95
|
+
<ProgressBar
|
|
96
|
+
value={22}
|
|
97
|
+
total={100}
|
|
98
|
+
color="error"
|
|
99
|
+
label="Progress error"
|
|
100
|
+
/>
|
|
101
|
+
</div>
|
|
102
|
+
<div style={{ position: "relative", flex: 1, width: "230px" }}>
|
|
103
|
+
<ProgressBar
|
|
104
|
+
value={24}
|
|
105
|
+
total={100}
|
|
106
|
+
color="info"
|
|
107
|
+
label="Progress info"
|
|
108
|
+
/>
|
|
109
|
+
</div>
|
|
110
|
+
</>
|
|
111
|
+
</div>
|
|
112
|
+
<div
|
|
113
|
+
style={{ display: "flex", gap: "1rem", width: "480px", marginBottom: 30 }}
|
|
114
|
+
>
|
|
115
|
+
<>
|
|
116
|
+
<div style={{ display: "flex", gap: "1rem", marginBottom: 15 }}>
|
|
117
|
+
<div style={{ position: "relative", flex: 1, width: "230px" }}>
|
|
118
|
+
<ProgressBar
|
|
119
|
+
value={45}
|
|
120
|
+
total={100}
|
|
121
|
+
color="success"
|
|
122
|
+
label="Progress success"
|
|
123
|
+
/>
|
|
124
|
+
</div>
|
|
125
|
+
<div style={{ position: "relative", flex: 1, width: "230px" }}>
|
|
126
|
+
<ProgressBar
|
|
127
|
+
value={86}
|
|
128
|
+
total={100}
|
|
129
|
+
color="warning"
|
|
130
|
+
label="Progress warning"
|
|
131
|
+
/>
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
</>
|
|
135
|
+
</div>
|
|
136
|
+
</>
|
|
137
|
+
);
|
|
138
|
+
|
|
139
|
+
ProgressBarColors.storyName = "ProgressBar Colors";
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { RadioGroup } from "../components/RadioGroup";
|
|
3
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
import { SizeVariant } from "../types";
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: "Form/RadioGroup",
|
|
8
|
+
component: RadioGroup,
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: "centered",
|
|
11
|
+
},
|
|
12
|
+
tags: ["autodocs"],
|
|
13
|
+
argTypes: {},
|
|
14
|
+
} satisfies Meta<typeof RadioGroup>;
|
|
15
|
+
|
|
16
|
+
export default meta;
|
|
17
|
+
|
|
18
|
+
type Story = StoryObj<typeof meta>;
|
|
19
|
+
|
|
20
|
+
const defaultArgs = {
|
|
21
|
+
disabled: false,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const sizeOptions = [
|
|
25
|
+
{ label: "Small", value: "S", size: "small" },
|
|
26
|
+
{ label: "Medium", value: "M", size: "medium" },
|
|
27
|
+
{ label: "Large", value: "L", size: "large" },
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
const genderOptions = [
|
|
31
|
+
{ label: "Male", value: "M" },
|
|
32
|
+
{ label: "Female", value: "F" },
|
|
33
|
+
{ label: "Other", value: "O" },
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
export const Playground: Story = {
|
|
37
|
+
args: {
|
|
38
|
+
color: "primary",
|
|
39
|
+
options: genderOptions,
|
|
40
|
+
name: "gender",
|
|
41
|
+
label: "Gender",
|
|
42
|
+
checked: "F",
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const RadioboxVertical = () => {
|
|
47
|
+
return (
|
|
48
|
+
<>
|
|
49
|
+
<RadioGroup
|
|
50
|
+
name="gender"
|
|
51
|
+
options={genderOptions}
|
|
52
|
+
label="Gender"
|
|
53
|
+
color="primary"
|
|
54
|
+
checked="M"
|
|
55
|
+
id="gender"
|
|
56
|
+
/>
|
|
57
|
+
</>
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
RadioboxVertical.storyName = "RadioGroup Vertical";
|
|
61
|
+
|
|
62
|
+
export const RadioHorizontal = () => {
|
|
63
|
+
return (
|
|
64
|
+
<>
|
|
65
|
+
<RadioGroup
|
|
66
|
+
name="gender"
|
|
67
|
+
options={genderOptions}
|
|
68
|
+
label="Gender"
|
|
69
|
+
color="primary"
|
|
70
|
+
checked="M"
|
|
71
|
+
id="gender"
|
|
72
|
+
direction="horizontal"
|
|
73
|
+
/>
|
|
74
|
+
</>
|
|
75
|
+
);
|
|
76
|
+
};
|
|
77
|
+
RadioHorizontal.storyName = "RadioGroup Horizontal";
|
|
78
|
+
|
|
79
|
+
export const RadioSizes = () => {
|
|
80
|
+
return (
|
|
81
|
+
<>
|
|
82
|
+
<RadioGroup
|
|
83
|
+
name="size"
|
|
84
|
+
options={sizeOptions}
|
|
85
|
+
label="Sizes"
|
|
86
|
+
color="primary"
|
|
87
|
+
checked="M"
|
|
88
|
+
id="size"
|
|
89
|
+
direction="horizontal"
|
|
90
|
+
/>
|
|
91
|
+
</>
|
|
92
|
+
);
|
|
93
|
+
};
|
|
94
|
+
RadioSizes.storyName = "RadioGroup Sizes";
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
import { RangerSlider } from "../components";
|
|
5
|
+
import { ColorVariant, SizeVariant, TextFieldSizeVariant } from "../types";
|
|
6
|
+
|
|
7
|
+
const colors: ColorVariant[] = [
|
|
8
|
+
"inherit",
|
|
9
|
+
"primary",
|
|
10
|
+
"secondary",
|
|
11
|
+
"success",
|
|
12
|
+
"error",
|
|
13
|
+
"info",
|
|
14
|
+
"warning",
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
const sizes: TextFieldSizeVariant[] = ["small", "medium"];
|
|
18
|
+
|
|
19
|
+
const meta = {
|
|
20
|
+
title: "Display/RangerSlider",
|
|
21
|
+
component: RangerSlider,
|
|
22
|
+
parameters: {
|
|
23
|
+
layout: "centered",
|
|
24
|
+
},
|
|
25
|
+
tags: ["autodocs"],
|
|
26
|
+
argTypes: {},
|
|
27
|
+
} satisfies Meta<typeof RangerSlider>;
|
|
28
|
+
|
|
29
|
+
export default meta;
|
|
30
|
+
|
|
31
|
+
type Story = StoryObj<typeof meta>;
|
|
32
|
+
|
|
33
|
+
export const Playground: Story = {
|
|
34
|
+
args: {
|
|
35
|
+
max: 90,
|
|
36
|
+
min: 10,
|
|
37
|
+
value: [20, 80],
|
|
38
|
+
color: "primary",
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
function valuetext(value: number) {
|
|
43
|
+
return `${value}°C`;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const RangerSliderBasic = () => {
|
|
47
|
+
const [value, setValue] = React.useState<number[]>([20, 37]);
|
|
48
|
+
|
|
49
|
+
const handleChange = (event: Event, newValue: number | number[]) => {
|
|
50
|
+
setValue(newValue as number[]);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<div
|
|
55
|
+
style={{ display: "flex", gap: "1rem", width: "480px", marginBottom: 30 }}
|
|
56
|
+
>
|
|
57
|
+
<RangerSlider
|
|
58
|
+
getAriaLabel={() => "Temperature range"}
|
|
59
|
+
value={value}
|
|
60
|
+
onChange={handleChange}
|
|
61
|
+
valueLabelDisplay="on"
|
|
62
|
+
getAriaValueText={valuetext}
|
|
63
|
+
/>
|
|
64
|
+
</div>
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
RangerSliderBasic.storyName = "RangerSlider Basic";
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
import { Select } from "../components";
|
|
5
|
+
import { DataSelect, TextFieldSizeVariant } from "../types";
|
|
6
|
+
import { SelectChangeEvent } from "@mui/material";
|
|
7
|
+
|
|
8
|
+
const sizes: TextFieldSizeVariant[] = ["small", "medium"];
|
|
9
|
+
|
|
10
|
+
const data: DataSelect[] = [
|
|
11
|
+
{ label: "Oliver Hansen", value: "oliver-hansen" },
|
|
12
|
+
{ label: "Van Henry", value: "van-henry" },
|
|
13
|
+
{ label: "April Tucker", value: "april-tucker" },
|
|
14
|
+
{ label: "Ralph Hubbard", value: "ralph-hubbard" },
|
|
15
|
+
{ label: "Omar Alexander", value: "omar-alexander" },
|
|
16
|
+
{ label: "Carlos Abbott", value: "carlos-abbott" },
|
|
17
|
+
{ label: "Miriam Wagner", value: "miriam-wagner" },
|
|
18
|
+
{ label: "Bradley Wilkerson", value: "bradley-wilkerson" },
|
|
19
|
+
{ label: "Virginia Andrews", value: "virginia-andrews" },
|
|
20
|
+
{ label: "Kelly Snyder", value: "kelly-snyder" },
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
const meta = {
|
|
24
|
+
title: "Form/Select",
|
|
25
|
+
component: Select,
|
|
26
|
+
parameters: {
|
|
27
|
+
layout: "centered",
|
|
28
|
+
},
|
|
29
|
+
tags: ["autodocs"],
|
|
30
|
+
argTypes: {},
|
|
31
|
+
} satisfies Meta<typeof Select>;
|
|
32
|
+
|
|
33
|
+
export default meta;
|
|
34
|
+
|
|
35
|
+
type Story = StoryObj<typeof meta>;
|
|
36
|
+
|
|
37
|
+
export const SelectBasic = () => {
|
|
38
|
+
const [value, setValue] = React.useState("");
|
|
39
|
+
|
|
40
|
+
const handleChange = (event: SelectChangeEvent) => {
|
|
41
|
+
setValue(event.target.value as string);
|
|
42
|
+
};
|
|
43
|
+
return (
|
|
44
|
+
<div style={{ width: "480px", marginBottom: 30 }}>
|
|
45
|
+
<Select
|
|
46
|
+
id="select-demo"
|
|
47
|
+
value={value}
|
|
48
|
+
onChange={handleChange}
|
|
49
|
+
label="Members"
|
|
50
|
+
variant="standard"
|
|
51
|
+
data={data}
|
|
52
|
+
/>
|
|
53
|
+
</div>
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
SelectBasic.storyName = "Select Basic";
|
|
58
|
+
|
|
59
|
+
export const SelectVariants = () => {
|
|
60
|
+
const [value, setValue] = React.useState("");
|
|
61
|
+
|
|
62
|
+
const handleChange = (event: SelectChangeEvent) => {
|
|
63
|
+
setValue(event.target.value as string);
|
|
64
|
+
};
|
|
65
|
+
return (
|
|
66
|
+
<>
|
|
67
|
+
<div style={{ width: "480px", marginBottom: 30 }}>
|
|
68
|
+
<Select
|
|
69
|
+
id="select-demo"
|
|
70
|
+
value={value}
|
|
71
|
+
onChange={handleChange}
|
|
72
|
+
label="Members"
|
|
73
|
+
variant="standard"
|
|
74
|
+
data={data}
|
|
75
|
+
/>
|
|
76
|
+
</div>
|
|
77
|
+
<div style={{ width: "480px", marginBottom: 30 }}>
|
|
78
|
+
<Select
|
|
79
|
+
id="select-demo"
|
|
80
|
+
value={value}
|
|
81
|
+
onChange={handleChange}
|
|
82
|
+
label="Members"
|
|
83
|
+
variant="filled"
|
|
84
|
+
data={data}
|
|
85
|
+
/>
|
|
86
|
+
</div>
|
|
87
|
+
<div style={{ width: "480px", marginBottom: 30 }}>
|
|
88
|
+
<Select
|
|
89
|
+
id="select-demo"
|
|
90
|
+
value={value}
|
|
91
|
+
onChange={handleChange}
|
|
92
|
+
label="Members"
|
|
93
|
+
variant="outlined"
|
|
94
|
+
data={data}
|
|
95
|
+
/>
|
|
96
|
+
</div>
|
|
97
|
+
</>
|
|
98
|
+
);
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
SelectVariants.storyName = "Select Variantes";
|
|
102
|
+
|
|
103
|
+
export const SelectMultiple = () => {
|
|
104
|
+
const [value, setValue] = React.useState<string[]>([]);
|
|
105
|
+
|
|
106
|
+
const handleChange = (event: SelectChangeEvent<typeof value>) => {
|
|
107
|
+
const {
|
|
108
|
+
target: { value },
|
|
109
|
+
} = event;
|
|
110
|
+
setValue(typeof value === "string" ? value.split(",") : value);
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
return (
|
|
114
|
+
<div style={{ width: "480px", marginBottom: 30 }}>
|
|
115
|
+
<Select
|
|
116
|
+
id="select-demo"
|
|
117
|
+
value={value}
|
|
118
|
+
onChange={handleChange}
|
|
119
|
+
label="Members"
|
|
120
|
+
multiple={true}
|
|
121
|
+
data={data}
|
|
122
|
+
variant="standard"
|
|
123
|
+
/>
|
|
124
|
+
</div>
|
|
125
|
+
);
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
SelectMultiple.storyName = "Select Multiples";
|