norma-library 0.4.2 → 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.
Files changed (220) hide show
  1. package/.babelrc.json +18 -0
  2. package/buildcache/front-end +1 -0
  3. package/dist/esm/components/Accordion.d.ts +3 -0
  4. package/dist/esm/components/Accordion.js +24 -0
  5. package/dist/esm/components/Accordion.js.map +1 -0
  6. package/dist/esm/components/Button.d.ts +3 -0
  7. package/dist/esm/components/Button.js +22 -0
  8. package/dist/esm/components/Button.js.map +1 -0
  9. package/dist/esm/components/Card.d.ts +7 -0
  10. package/dist/esm/components/Card.js +31 -0
  11. package/dist/esm/components/Card.js.map +1 -0
  12. package/dist/esm/components/CheckBox.d.ts +3 -0
  13. package/dist/esm/components/CheckBox.js +13 -0
  14. package/dist/esm/components/CheckBox.js.map +1 -0
  15. package/dist/esm/components/DropDown.d.ts +3 -0
  16. package/dist/esm/components/DropDown.js +17 -0
  17. package/dist/esm/components/DropDown.js.map +1 -0
  18. package/dist/esm/components/IconButton.d.ts +3 -0
  19. package/dist/esm/components/IconButton.js +31 -0
  20. package/dist/esm/components/IconButton.js.map +1 -0
  21. package/dist/esm/components/Icons.d.ts +7 -0
  22. package/dist/esm/components/Icons.js +49 -0
  23. package/dist/esm/components/Icons.js.map +1 -0
  24. package/dist/esm/components/Modal.d.ts +4 -0
  25. package/dist/esm/components/Modal.js +32 -0
  26. package/dist/esm/components/Modal.js.map +1 -0
  27. package/dist/esm/components/Paper.d.ts +3 -0
  28. package/dist/esm/components/Paper.js +14 -0
  29. package/dist/esm/components/Paper.js.map +1 -0
  30. package/dist/esm/components/ProgressBar.d.ts +6 -0
  31. package/dist/esm/components/ProgressBar.js +31 -0
  32. package/dist/esm/components/ProgressBar.js.map +1 -0
  33. package/dist/esm/components/RadioGroup.d.ts +3 -0
  34. package/dist/esm/components/RadioGroup.js +18 -0
  35. package/dist/esm/components/RadioGroup.js.map +1 -0
  36. package/dist/esm/components/RangerSlider.d.ts +3 -0
  37. package/dist/esm/components/RangerSlider.js +64 -0
  38. package/dist/esm/components/RangerSlider.js.map +1 -0
  39. package/dist/esm/components/Select.d.ts +3 -0
  40. package/dist/esm/components/Select.js +45 -0
  41. package/dist/esm/components/Select.js.map +1 -0
  42. package/dist/esm/components/Svgs.d.ts +29 -0
  43. package/dist/esm/components/Svgs.js +102 -0
  44. package/dist/esm/components/Svgs.js.map +1 -0
  45. package/dist/esm/components/Tabs.d.ts +3 -0
  46. package/dist/esm/components/Tabs.js +78 -0
  47. package/dist/esm/components/Tabs.js.map +1 -0
  48. package/dist/esm/components/Tag.d.ts +3 -0
  49. package/dist/esm/components/Tag.js +27 -0
  50. package/dist/esm/components/Tag.js.map +1 -0
  51. package/dist/esm/components/TextField.d.ts +3 -0
  52. package/dist/esm/components/TextField.js +18 -0
  53. package/dist/esm/components/TextField.js.map +1 -0
  54. package/dist/esm/components/button/index.d.ts +3 -0
  55. package/dist/esm/components/button/index.js +22 -0
  56. package/dist/esm/components/button/index.js.map +1 -0
  57. package/dist/esm/components/checkbox/index.d.ts +3 -0
  58. package/dist/esm/components/checkbox/index.js +13 -0
  59. package/dist/esm/components/checkbox/index.js.map +1 -0
  60. package/dist/esm/components/icons/index.d.ts +7 -0
  61. package/dist/esm/components/icons/index.js +49 -0
  62. package/dist/esm/components/icons/index.js.map +1 -0
  63. package/dist/esm/components/icons/svgs.d.ts +29 -0
  64. package/dist/esm/components/icons/svgs.js +102 -0
  65. package/dist/esm/components/icons/svgs.js.map +1 -0
  66. package/dist/esm/components/index.d.ts +16 -0
  67. package/dist/esm/components/index.js +17 -0
  68. package/dist/esm/components/index.js.map +1 -0
  69. package/dist/esm/components/textfield/index.d.ts +3 -0
  70. package/dist/esm/components/textfield/index.js +18 -0
  71. package/dist/esm/components/textfield/index.js.map +1 -0
  72. package/dist/esm/helpers/alignments.d.ts +2 -0
  73. package/dist/esm/helpers/alignments.js +14 -0
  74. package/dist/esm/helpers/alignments.js.map +1 -0
  75. package/dist/esm/helpers/borders.d.ts +2 -0
  76. package/dist/esm/helpers/borders.js +18 -0
  77. package/dist/esm/helpers/borders.js.map +1 -0
  78. package/dist/esm/helpers/colors.d.ts +172 -0
  79. package/dist/esm/helpers/colors.js +156 -0
  80. package/dist/esm/helpers/colors.js.map +1 -0
  81. package/dist/esm/helpers/index.d.ts +5 -0
  82. package/dist/esm/helpers/index.js +6 -0
  83. package/dist/esm/helpers/index.js.map +1 -0
  84. package/dist/esm/helpers/radios.d.ts +2 -0
  85. package/dist/esm/helpers/radios.js +24 -0
  86. package/dist/esm/helpers/radios.js.map +1 -0
  87. package/dist/esm/helpers/sizes.d.ts +11 -0
  88. package/dist/esm/helpers/sizes.js +67 -0
  89. package/dist/esm/helpers/sizes.js.map +1 -0
  90. package/dist/esm/index.d.ts +17 -0
  91. package/dist/esm/index.js +18 -0
  92. package/dist/esm/index.js.map +1 -0
  93. package/dist/esm/interfaces/Accordion.d.ts +12 -0
  94. package/dist/esm/interfaces/Accordion.js +2 -0
  95. package/dist/esm/interfaces/Accordion.js.map +1 -0
  96. package/dist/esm/interfaces/Button.d.ts +14 -0
  97. package/dist/esm/interfaces/Button.js +2 -0
  98. package/dist/esm/interfaces/Button.js.map +1 -0
  99. package/dist/esm/interfaces/Card.d.ts +11 -0
  100. package/dist/esm/interfaces/Card.js +2 -0
  101. package/dist/esm/interfaces/Card.js.map +1 -0
  102. package/dist/esm/interfaces/CheckBox.d.ts +19 -0
  103. package/dist/esm/interfaces/CheckBox.js +2 -0
  104. package/dist/esm/interfaces/CheckBox.js.map +1 -0
  105. package/dist/esm/interfaces/DropDown.d.ts +11 -0
  106. package/dist/esm/interfaces/DropDown.js +2 -0
  107. package/dist/esm/interfaces/DropDown.js.map +1 -0
  108. package/dist/esm/interfaces/Icon.d.ts +15 -0
  109. package/dist/esm/interfaces/Icon.js +2 -0
  110. package/dist/esm/interfaces/Icon.js.map +1 -0
  111. package/dist/esm/interfaces/IconButton.d.ts +14 -0
  112. package/dist/esm/interfaces/IconButton.js +2 -0
  113. package/dist/esm/interfaces/IconButton.js.map +1 -0
  114. package/dist/esm/interfaces/Icons.d.ts +15 -0
  115. package/dist/esm/interfaces/Icons.js +2 -0
  116. package/dist/esm/interfaces/Icons.js.map +1 -0
  117. package/dist/esm/interfaces/Modal.d.ts +15 -0
  118. package/dist/esm/interfaces/Modal.js +2 -0
  119. package/dist/esm/interfaces/Modal.js.map +1 -0
  120. package/dist/esm/interfaces/Paper.d.ts +12 -0
  121. package/dist/esm/interfaces/Paper.js +2 -0
  122. package/dist/esm/interfaces/Paper.js.map +1 -0
  123. package/dist/esm/interfaces/ProgressBar.d.ts +17 -0
  124. package/dist/esm/interfaces/ProgressBar.js +2 -0
  125. package/dist/esm/interfaces/ProgressBar.js.map +1 -0
  126. package/dist/esm/interfaces/RadioGroup.d.ts +15 -0
  127. package/dist/esm/interfaces/RadioGroup.js +2 -0
  128. package/dist/esm/interfaces/RadioGroup.js.map +1 -0
  129. package/dist/esm/interfaces/RangerSlider.d.ts +18 -0
  130. package/dist/esm/interfaces/RangerSlider.js +2 -0
  131. package/dist/esm/interfaces/RangerSlider.js.map +1 -0
  132. package/dist/esm/interfaces/Select.d.ts +17 -0
  133. package/dist/esm/interfaces/Select.js +2 -0
  134. package/dist/esm/interfaces/Select.js.map +1 -0
  135. package/dist/esm/interfaces/Tabs.d.ts +18 -0
  136. package/dist/esm/interfaces/Tabs.js +2 -0
  137. package/dist/esm/interfaces/Tabs.js.map +1 -0
  138. package/dist/esm/interfaces/Tag.d.ts +18 -0
  139. package/dist/esm/interfaces/Tag.js +2 -0
  140. package/dist/esm/interfaces/Tag.js.map +1 -0
  141. package/dist/esm/interfaces/TextField.d.ts +40 -0
  142. package/dist/esm/interfaces/TextField.js +2 -0
  143. package/dist/esm/interfaces/TextField.js.map +1 -0
  144. package/dist/esm/interfaces/index.d.ts +17 -0
  145. package/dist/esm/interfaces/index.js +18 -0
  146. package/dist/esm/interfaces/index.js.map +1 -0
  147. package/dist/esm/types/index.d.ts +78 -0
  148. package/dist/esm/types/index.js +10 -0
  149. package/dist/esm/types/index.js.map +1 -0
  150. package/dist/index.css +8363 -0
  151. package/norma-library.tar +0 -0
  152. package/package.json +75 -90
  153. package/postcss.config.js +6 -0
  154. package/src/components/Accordion.tsx +64 -0
  155. package/src/components/Button.tsx +38 -0
  156. package/src/components/Card.tsx +47 -0
  157. package/src/components/CheckBox.tsx +35 -0
  158. package/src/components/DropDown.tsx +38 -0
  159. package/src/components/IconButton.tsx +58 -0
  160. package/src/components/Icons.tsx +87 -0
  161. package/src/components/Modal.tsx +123 -0
  162. package/src/components/Paper.tsx +22 -0
  163. package/src/components/ProgressBar.tsx +62 -0
  164. package/src/components/RadioGroup.tsx +55 -0
  165. package/src/components/RangerSlider.tsx +81 -0
  166. package/src/components/Select.tsx +98 -0
  167. package/src/components/Svgs.tsx +522 -0
  168. package/src/components/Tabs.tsx +140 -0
  169. package/src/components/Tag.tsx +45 -0
  170. package/src/components/TextField.tsx +35 -0
  171. package/src/components/index.ts +16 -0
  172. package/src/helpers/alignments.ts +14 -0
  173. package/src/helpers/borders.ts +18 -0
  174. package/src/helpers/colors.ts +173 -0
  175. package/src/helpers/index.ts +5 -0
  176. package/src/helpers/radios.ts +24 -0
  177. package/src/helpers/sizes.ts +79 -0
  178. package/src/index.css +2 -0
  179. package/src/index.ts +36 -0
  180. package/src/interfaces/Accordion.ts +12 -0
  181. package/src/interfaces/Button.ts +27 -0
  182. package/src/interfaces/Card.ts +11 -0
  183. package/src/interfaces/CheckBox.ts +33 -0
  184. package/src/interfaces/DropDown.ts +14 -0
  185. package/src/interfaces/IconButton.ts +27 -0
  186. package/src/interfaces/Icons.ts +17 -0
  187. package/src/interfaces/Modal.ts +15 -0
  188. package/src/interfaces/Paper.ts +12 -0
  189. package/src/interfaces/ProgressBar.ts +25 -0
  190. package/src/interfaces/RadioGroup.ts +28 -0
  191. package/src/interfaces/RangerSlider.ts +32 -0
  192. package/src/interfaces/Select.ts +17 -0
  193. package/src/interfaces/Tabs.ts +24 -0
  194. package/src/interfaces/Tag.ts +17 -0
  195. package/src/interfaces/TextField.ts +63 -0
  196. package/src/interfaces/index.ts +17 -0
  197. package/src/stories/Accordion.stories.tsx +65 -0
  198. package/src/stories/Button.stories.tsx +99 -0
  199. package/src/stories/Card.stories.tsx +55 -0
  200. package/src/stories/CheckBox.stories.tsx +94 -0
  201. package/src/stories/Colors.stories.mdx +127 -0
  202. package/src/stories/DropDown.stories.tsx +57 -0
  203. package/src/stories/IconButton.stories.tsx +114 -0
  204. package/src/stories/Icons.stories.mdx +27 -0
  205. package/src/stories/Modal.stories.tsx +190 -0
  206. package/src/stories/Paper.stories.tsx +53 -0
  207. package/src/stories/ProgressBar.stories.tsx +139 -0
  208. package/src/stories/RadioGroup.stories.tsx +94 -0
  209. package/src/stories/RangerSlider.stories.tsx +68 -0
  210. package/src/stories/Select.stories.tsx +128 -0
  211. package/src/stories/Tabs.stories.tsx +62 -0
  212. package/src/stories/Tag.stories.tsx +76 -0
  213. package/src/stories/TextField.stories.tsx +445 -0
  214. package/src/styles/custom.css +5 -0
  215. package/src/styles/globals.css +21 -0
  216. package/src/types/index.ts +220 -0
  217. package/tailwind.config.js +58 -0
  218. package/tsconfig.json +32 -0
  219. package/README.md +0 -160
  220. package/dist/index.js +0 -8
@@ -0,0 +1,28 @@
1
+ import { ReactNode } from "react";
2
+ import {
3
+ CheckBoxColorVariant,
4
+ DirectionVariant,
5
+ MuiRadioBaseProps,
6
+ OptionsRadios,
7
+ TextFieldSizeVariant,
8
+ } from "../types";
9
+ import {
10
+ CheckboxPropsColorOverrides,
11
+ RadioPropsSizeOverrides,
12
+ } from "@mui/material";
13
+ import { OverridableStringUnion } from "@mui/types";
14
+
15
+ export interface RadioBaseProps extends MuiRadioBaseProps {
16
+ id?: string;
17
+ name?: string;
18
+ options?: OptionsRadios[];
19
+ required?: boolean;
20
+ direction?: DirectionVariant;
21
+ label?: ReactNode;
22
+ size?: OverridableStringUnion<TextFieldSizeVariant, RadioPropsSizeOverrides>;
23
+ color?: OverridableStringUnion<
24
+ CheckBoxColorVariant,
25
+ CheckboxPropsColorOverrides
26
+ >;
27
+ checked?: string;
28
+ }
@@ -0,0 +1,32 @@
1
+ import { Theme } from "@emotion/react";
2
+
3
+ import {
4
+ SliderPropsColorOverrides,
5
+ SliderPropsSizeOverrides,
6
+ SxProps,
7
+ } from "@mui/material";
8
+ import { OverridableStringUnion } from "@mui/types";
9
+
10
+ import { MuiRangerSliderBaseProps } from "../types";
11
+
12
+ export interface RangerSliderBaseProps extends MuiRangerSliderBaseProps {
13
+ sx?: SxProps<Theme>;
14
+ max?: number;
15
+ min?: number;
16
+ name?: string;
17
+ mode?: Boolean;
18
+ onChange?: (
19
+ event: Event,
20
+ value: number | number[],
21
+ activeThumb: number
22
+ ) => void;
23
+ orientation?: "horizontal" | "vertical";
24
+ size?: OverridableStringUnion<"small" | "medium", SliderPropsSizeOverrides>;
25
+ step?: number | null;
26
+ defaultValue?: number | number[];
27
+ valueLabelDisplay?: "on" | "auto" | "off";
28
+ color?: OverridableStringUnion<
29
+ "primary" | "secondary",
30
+ SliderPropsColorOverrides
31
+ >;
32
+ }
@@ -0,0 +1,17 @@
1
+ import { SxProps } from "@mui/material";
2
+ import { Theme } from "@emotion/react";
3
+ import { DataSelect, MuiSelectBaseProps, TextFieldVariant } from "../types";
4
+
5
+ export interface SelectBaseProps extends MuiSelectBaseProps {
6
+ sx?: SxProps<Theme>;
7
+ id?: string;
8
+ label?: React.ReactNode;
9
+ input?: React.ReactElement<any, any>;
10
+ variant?: TextFieldVariant;
11
+ value?: string;
12
+ open?: boolean;
13
+ onOpen?: (event: React.SyntheticEvent) => void;
14
+ onClose?: (event: React.SyntheticEvent) => void;
15
+ multiple?: boolean;
16
+ data?: DataSelect[];
17
+ }
@@ -0,0 +1,24 @@
1
+ import { SxProps } from "@mui/material";
2
+ import { Theme } from "@emotion/react";
3
+ import {
4
+ ColorVariant,
5
+ DataTabs,
6
+ MuiTabsBaseProps,
7
+ TabsVariant,
8
+ } from "../types";
9
+
10
+ export interface TabsBaseProps extends MuiTabsBaseProps {
11
+ sx?: SxProps<Theme>;
12
+ children?: React.ReactNode;
13
+ onChange?: (event: React.SyntheticEvent, value: any) => void;
14
+ color?: ColorVariant;
15
+ variant?: TabsVariant;
16
+ value?: any;
17
+ data?: DataTabs[];
18
+ }
19
+
20
+ export interface TabPanelProps {
21
+ children?: React.ReactNode;
22
+ index: number;
23
+ value: number;
24
+ }
@@ -0,0 +1,17 @@
1
+ import { SxProps } from "@mui/material";
2
+ import { Theme } from "@emotion/react";
3
+ import { ColorVariant, MuiTagBaseProps } from "../types";
4
+ import { OverridableStringUnion } from "@mui/types";
5
+
6
+ export interface ChipPropsColorOverrides {}
7
+ export interface ChipPropsSizeOverrides {}
8
+
9
+ export interface TagBaseProps extends MuiTagBaseProps {
10
+ label?: React.ReactNode | String;
11
+ sx?: SxProps<Theme>;
12
+ avatar?: React.ReactElement;
13
+ outlined?: Boolean;
14
+ size?: OverridableStringUnion<"small" | "medium", ChipPropsSizeOverrides>;
15
+ color?: OverridableStringUnion<ColorVariant, ChipPropsColorOverrides>;
16
+ onClose?: React.ReactEventHandler<{}>;
17
+ }
@@ -0,0 +1,63 @@
1
+ import React, { ReactNode } from "react";
2
+
3
+ import {
4
+ TextFieldPropsColorOverrides,
5
+ TextFieldPropsSizeOverrides,
6
+ } from "@mui/material/TextField";
7
+ import {
8
+ FormHelperTextProps,
9
+ InputBaseProps,
10
+ InputLabelProps,
11
+ OutlinedInputProps,
12
+ SelectProps,
13
+ } from "@mui/material";
14
+ import { InputProps as StandardInputProps } from "@mui/material/Input";
15
+ import { OverridableStringUnion } from "@mui/types";
16
+ import { TextField } from "@mui/material";
17
+ import {
18
+ TextFieldColorVariant,
19
+ MuiTextFieldBaseProps,
20
+ TextFieldSizeVariant,
21
+ TextFieldVariant,
22
+ } from "../types";
23
+
24
+ export interface TextFieldBaseProps extends MuiTextFieldBaseProps {
25
+ id?: string;
26
+ name?: string;
27
+ defaultValue?: string;
28
+ disabled?: boolean;
29
+ required?: boolean;
30
+ type?: React.InputHTMLAttributes<unknown>["type"];
31
+ hasError?: boolean;
32
+ label?: ReactNode;
33
+ children?: ReactNode;
34
+ error?: boolean;
35
+ variant?: TextFieldVariant;
36
+ helperText?: React.ReactNode;
37
+ InputLabelProps?: Partial<InputLabelProps>;
38
+ InputProps?: Partial<OutlinedInputProps>;
39
+ autoComplete?: string;
40
+ placeholder?: string;
41
+ multiline?: boolean;
42
+ rows?: string | number;
43
+ maxRows?: string | number;
44
+ minRows?: string | number;
45
+ select?: boolean;
46
+ SelectProps?: Partial<SelectProps>;
47
+ onChange?: OutlinedInputProps["onChange"];
48
+ onClick?: InputBaseProps["onClick"];
49
+ onBlur?: InputBaseProps["onBlur"];
50
+ onFocus?: StandardInputProps["onFocus"];
51
+ size?: OverridableStringUnion<
52
+ TextFieldSizeVariant,
53
+ TextFieldPropsSizeOverrides
54
+ >;
55
+ FormHelperTextProps?: Partial<FormHelperTextProps>;
56
+ color?: OverridableStringUnion<
57
+ TextFieldColorVariant,
58
+ TextFieldPropsColorOverrides
59
+ >;
60
+ value?: unknown;
61
+ }
62
+
63
+ export type TextFieldType = keyof typeof TextField;
@@ -0,0 +1,17 @@
1
+ export * from "./Accordion";
2
+ export * from "./Button";
3
+ export * from "./Card";
4
+ export * from "./CheckBox";
5
+ export * from "./DropDown";
6
+ export * from "./IconButton";
7
+ export * from "./Icons";
8
+ export * from "./Modal";
9
+ export * from "./Paper";
10
+ export * from "./ProgressBar";
11
+ export * from "./RadioGroup";
12
+ export * from "./RadioGroup";
13
+ export * from "./RangerSlider";
14
+ export * from "./Select";
15
+ export * from "./Tabs";
16
+ export * from "./Tag";
17
+ export * from "./TextField";
@@ -0,0 +1,65 @@
1
+ import React from "react";
2
+
3
+ import type { Meta, StoryObj } from "@storybook/react";
4
+ import { Accordion } from "../components";
5
+ import { DataAccordion } from "../types";
6
+ import { Typography } from "@mui/material";
7
+
8
+ const data: DataAccordion[] = [
9
+ {
10
+ label: "Accordion 1",
11
+ id: "panel-1",
12
+ children: (
13
+ <Typography>
14
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse
15
+ malesuada lacus ex, sit amet blandit leo lobortis eget.
16
+ </Typography>
17
+ ),
18
+ },
19
+ {
20
+ label: "Accordion 2",
21
+ id: "panel-2",
22
+ children: (
23
+ <Typography>
24
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse
25
+ malesuada lacus ex, sit amet blandit leo lobortis eget.
26
+ </Typography>
27
+ ),
28
+ },
29
+ ];
30
+
31
+ const meta = {
32
+ title: "Display/Accordion",
33
+ component: Accordion,
34
+ parameters: {
35
+ layout: "centered",
36
+ },
37
+ tags: ["autodocs"],
38
+ argTypes: {
39
+ data: data,
40
+ },
41
+ } satisfies Meta<typeof Accordion>;
42
+
43
+ export default meta;
44
+
45
+ type Story = StoryObj<typeof meta>;
46
+
47
+ export const AccordionBasic = () => {
48
+ return (
49
+ <div style={{ width: "480px", marginBottom: 30 }}>
50
+ <Accordion data={data} />
51
+ </div>
52
+ );
53
+ };
54
+
55
+ AccordionBasic.storyName = "Accordion Basic";
56
+
57
+ export const AccordionExpanded = () => {
58
+ return (
59
+ <div style={{ width: "480px", marginBottom: 30 }}>
60
+ <Accordion data={data} defaultExpanded="panel-1" />
61
+ </div>
62
+ );
63
+ };
64
+
65
+ AccordionExpanded.storyName = "Accordion Expanded";
@@ -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>