norma-library 0.4.9 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (246) hide show
  1. package/.babelrc.json +1 -1
  2. package/.husky/commit-msg +4 -0
  3. package/.prettierignore +11 -0
  4. package/.prettierrc.json +20 -0
  5. package/CHANGELOG.md +0 -0
  6. package/CONTRIBUTING.md +0 -0
  7. package/README.md +42 -0
  8. package/commitlint.config.js +1 -0
  9. package/dist/Button/index.d.ts +9 -0
  10. package/dist/Button/types.d.ts +18 -0
  11. package/dist/Card/Card.d.ts +3 -0
  12. package/dist/Card/CardHeader.d.ts +3 -0
  13. package/dist/Card/index.d.ts +4 -0
  14. package/dist/Card/styles.d.ts +546 -0
  15. package/dist/Card/types.d.ts +8 -0
  16. package/dist/esm/components/Accordion.d.ts +2 -2
  17. package/dist/esm/components/Accordion.js +8 -8
  18. package/dist/esm/components/Accordion.js.map +1 -1
  19. package/dist/esm/components/Avatar.d.ts +2 -2
  20. package/dist/esm/components/Avatar.js +7 -7
  21. package/dist/esm/components/Avatar.js.map +1 -1
  22. package/dist/esm/components/Badge.d.ts +2 -2
  23. package/dist/esm/components/Badge.js +5 -5
  24. package/dist/esm/components/Badge.js.map +1 -1
  25. package/dist/esm/components/Button.d.ts +2 -2
  26. package/dist/esm/components/Button.js +10 -10
  27. package/dist/esm/components/Button.js.map +1 -1
  28. package/dist/esm/components/Card.d.ts +3 -3
  29. package/dist/esm/components/Card.js +8 -8
  30. package/dist/esm/components/Card.js.map +1 -1
  31. package/dist/esm/components/ChatMessage.d.ts +2 -2
  32. package/dist/esm/components/ChatMessage.js +35 -35
  33. package/dist/esm/components/ChatMessage.js.map +1 -1
  34. package/dist/esm/components/CheckBox.d.ts +2 -2
  35. package/dist/esm/components/CheckBox.js +5 -5
  36. package/dist/esm/components/CheckBox.js.map +1 -1
  37. package/dist/esm/components/DataGrid/base/dropdown.d.ts +2 -2
  38. package/dist/esm/components/DataGrid/base/dropdown.js +32 -32
  39. package/dist/esm/components/DataGrid/base/dropdown.js.map +1 -1
  40. package/dist/esm/components/DataGrid/base/number-filter.d.ts +2 -2
  41. package/dist/esm/components/DataGrid/base/number-filter.js +21 -21
  42. package/dist/esm/components/DataGrid/base/sorting.d.ts +2 -2
  43. package/dist/esm/components/DataGrid/base/sorting.js +1 -1
  44. package/dist/esm/components/DataGrid/base/sorting.js.map +1 -1
  45. package/dist/esm/components/DataGrid/icons.d.ts +1 -1
  46. package/dist/esm/components/DataGrid/icons.js +1 -1
  47. package/dist/esm/components/DataGrid/icons.js.map +1 -1
  48. package/dist/esm/components/DataGrid/index.d.ts +2 -2
  49. package/dist/esm/components/DataGrid/index.js +35 -44
  50. package/dist/esm/components/DataGrid/index.js.map +1 -1
  51. package/dist/esm/components/DataGrid/shared.d.ts +1 -1
  52. package/dist/esm/components/DataGrid/shared.js +19 -32
  53. package/dist/esm/components/DataGrid/shared.js.map +1 -1
  54. package/dist/esm/components/DataGrid/styled.d.ts +2 -2
  55. package/dist/esm/components/DataGrid/styled.js +35 -35
  56. package/dist/esm/components/DataGrid/styled.js.map +1 -1
  57. package/dist/esm/components/DatePicker.d.ts +5 -5
  58. package/dist/esm/components/DatePicker.js +37 -37
  59. package/dist/esm/components/DatePicker.js.map +1 -1
  60. package/dist/esm/components/DropDown.d.ts +2 -2
  61. package/dist/esm/components/DropDown.js +6 -6
  62. package/dist/esm/components/DropDown.js.map +1 -1
  63. package/dist/esm/components/IconButton.d.ts +2 -2
  64. package/dist/esm/components/IconButton.js +7 -7
  65. package/dist/esm/components/IconButton.js.map +1 -1
  66. package/dist/esm/components/Icons.d.ts +2 -2
  67. package/dist/esm/components/Icons.js +10 -10
  68. package/dist/esm/components/Icons.js.map +1 -1
  69. package/dist/esm/components/Modal.d.ts +2 -2
  70. package/dist/esm/components/Modal.js +8 -8
  71. package/dist/esm/components/Modal.js.map +1 -1
  72. package/dist/esm/components/Paper.d.ts +2 -2
  73. package/dist/esm/components/Paper.js +5 -5
  74. package/dist/esm/components/Paper.js.map +1 -1
  75. package/dist/esm/components/ProgressBar.d.ts +2 -2
  76. package/dist/esm/components/ProgressBar.js +11 -11
  77. package/dist/esm/components/ProgressBar.js.map +1 -1
  78. package/dist/esm/components/RadioGroup.d.ts +2 -2
  79. package/dist/esm/components/RadioGroup.js +7 -7
  80. package/dist/esm/components/RadioGroup.js.map +1 -1
  81. package/dist/esm/components/RangerSlider.d.ts +2 -2
  82. package/dist/esm/components/RangerSlider.js +31 -31
  83. package/dist/esm/components/RangerSlider.js.map +1 -1
  84. package/dist/esm/components/Select.d.ts +2 -2
  85. package/dist/esm/components/Select.js +14 -14
  86. package/dist/esm/components/Select.js.map +1 -1
  87. package/dist/esm/components/Svgs.d.ts +1 -1
  88. package/dist/esm/components/Svgs.js +1 -1
  89. package/dist/esm/components/Svgs.js.map +1 -1
  90. package/dist/esm/components/Tabs.d.ts +2 -2
  91. package/dist/esm/components/Tabs.js +25 -26
  92. package/dist/esm/components/Tabs.js.map +1 -1
  93. package/dist/esm/components/Tag.d.ts +2 -2
  94. package/dist/esm/components/Tag.js +8 -8
  95. package/dist/esm/components/Tag.js.map +1 -1
  96. package/dist/esm/components/TextField.d.ts +2 -2
  97. package/dist/esm/components/TextField.js +8 -8
  98. package/dist/esm/components/TextField.js.map +1 -1
  99. package/dist/esm/components/TimeLine.d.ts +2 -2
  100. package/dist/esm/components/TimeLine.js +20 -20
  101. package/dist/esm/components/TimeLine.js.map +1 -1
  102. package/dist/esm/components/TimePicker.d.ts +8 -8
  103. package/dist/esm/components/TimePicker.js +43 -43
  104. package/dist/esm/components/TimePicker.js.map +1 -1
  105. package/dist/esm/components/index.d.ts +23 -23
  106. package/dist/esm/components/index.js +23 -23
  107. package/dist/esm/helpers/alignments.js +7 -7
  108. package/dist/esm/helpers/borders.js +11 -11
  109. package/dist/esm/helpers/colors.js +41 -41
  110. package/dist/esm/helpers/index.d.ts +5 -5
  111. package/dist/esm/helpers/index.js +5 -5
  112. package/dist/esm/helpers/sizes.d.ts +1 -1
  113. package/dist/esm/helpers/sizes.js +39 -39
  114. package/dist/esm/helpers/sizes.js.map +1 -1
  115. package/dist/esm/index.d.ts +17 -17
  116. package/dist/esm/index.js +17 -17
  117. package/dist/esm/interfaces/Accordion.d.ts +3 -3
  118. package/dist/esm/interfaces/Avatar.d.ts +6 -6
  119. package/dist/esm/interfaces/Badge.d.ts +7 -7
  120. package/dist/esm/interfaces/Button.d.ts +5 -5
  121. package/dist/esm/interfaces/Card.d.ts +3 -3
  122. package/dist/esm/interfaces/ChatMessage.d.ts +1 -1
  123. package/dist/esm/interfaces/CheckBox.d.ts +10 -10
  124. package/dist/esm/interfaces/DataGrid.d.ts +4 -4
  125. package/dist/esm/interfaces/DatePicker.d.ts +3 -3
  126. package/dist/esm/interfaces/DropDown.d.ts +4 -4
  127. package/dist/esm/interfaces/IconButton.d.ts +5 -5
  128. package/dist/esm/interfaces/Icons.d.ts +3 -3
  129. package/dist/esm/interfaces/Modal.d.ts +3 -3
  130. package/dist/esm/interfaces/Paper.d.ts +4 -4
  131. package/dist/esm/interfaces/ProgressBar.d.ts +5 -5
  132. package/dist/esm/interfaces/RadioGroup.d.ts +4 -4
  133. package/dist/esm/interfaces/RangerSlider.d.ts +8 -8
  134. package/dist/esm/interfaces/Select.d.ts +3 -3
  135. package/dist/esm/interfaces/Tabs.d.ts +3 -3
  136. package/dist/esm/interfaces/Tag.d.ts +5 -5
  137. package/dist/esm/interfaces/TextField.d.ts +12 -12
  138. package/dist/esm/interfaces/TimeLine.d.ts +3 -3
  139. package/dist/esm/interfaces/TimePicker.d.ts +3 -3
  140. package/dist/esm/interfaces/index.d.ts +23 -23
  141. package/dist/esm/interfaces/index.js +23 -23
  142. package/dist/esm/types/index.d.ts +41 -41
  143. package/dist/esm/types/index.js +2 -2
  144. package/dist/esm/types/index.js.map +1 -1
  145. package/dist/index.d.ts +2 -0
  146. package/dist/index.es.js +6992 -0
  147. package/dist/index.es.js.map +1 -0
  148. package/dist/index.umd.js +266 -0
  149. package/dist/index.umd.js.map +1 -0
  150. package/dist/vite.svg +1 -0
  151. package/docs/index.md +118 -0
  152. package/package.json +65 -8
  153. package/src/components/Accordion.tsx +47 -64
  154. package/src/components/Avatar.tsx +22 -29
  155. package/src/components/Badge.tsx +19 -22
  156. package/src/components/Button.tsx +12 -19
  157. package/src/components/Card.tsx +44 -47
  158. package/src/components/ChatMessage.tsx +87 -89
  159. package/src/components/CheckBox.tsx +8 -19
  160. package/src/components/DataGrid/allData.json +2918 -2918
  161. package/src/components/DataGrid/base/dropdown.tsx +212 -235
  162. package/src/components/DataGrid/base/number-filter.tsx +43 -43
  163. package/src/components/DataGrid/base/sorting.tsx +29 -35
  164. package/src/components/DataGrid/icons.tsx +53 -61
  165. package/src/components/DataGrid/index.tsx +254 -319
  166. package/src/components/DataGrid/shared.ts +154 -179
  167. package/src/components/DataGrid/styled.ts +96 -102
  168. package/src/components/DataGrid/styles/dropdown.module.css +86 -86
  169. package/src/components/DataGrid/styles/number-filter.module.css +16 -16
  170. package/src/components/DataGrid/styles/styles.module.css +107 -107
  171. package/src/components/DatePicker.tsx +73 -84
  172. package/src/components/DropDown.tsx +31 -38
  173. package/src/components/IconButton.tsx +12 -29
  174. package/src/components/Icons.tsx +82 -87
  175. package/src/components/Modal.tsx +114 -123
  176. package/src/components/Paper.tsx +19 -22
  177. package/src/components/ProgressBar.tsx +54 -63
  178. package/src/components/RadioGroup.tsx +47 -55
  179. package/src/components/RangerSlider.tsx +70 -81
  180. package/src/components/Select.tsx +82 -98
  181. package/src/components/Svgs.tsx +498 -522
  182. package/src/components/Tabs.tsx +111 -140
  183. package/src/components/Tag.tsx +37 -45
  184. package/src/components/TextField.tsx +11 -22
  185. package/src/components/TimeLine.tsx +93 -103
  186. package/src/components/TimePicker.tsx +84 -95
  187. package/src/components/index.ts +23 -23
  188. package/src/helpers/alignments.ts +7 -7
  189. package/src/helpers/borders.ts +11 -11
  190. package/src/helpers/colors.ts +42 -42
  191. package/src/helpers/index.ts +5 -5
  192. package/src/helpers/sizes.ts +39 -46
  193. package/src/index.ts +17 -17
  194. package/src/interfaces/Accordion.ts +12 -12
  195. package/src/interfaces/Avatar.tsx +15 -18
  196. package/src/interfaces/Badge.ts +19 -32
  197. package/src/interfaces/Button.ts +5 -10
  198. package/src/interfaces/Card.ts +11 -11
  199. package/src/interfaces/ChatMessage.ts +12 -12
  200. package/src/interfaces/CheckBox.ts +12 -18
  201. package/src/interfaces/DataGrid.ts +46 -51
  202. package/src/interfaces/DatePicker.ts +13 -13
  203. package/src/interfaces/DropDown.ts +14 -14
  204. package/src/interfaces/IconButton.ts +5 -10
  205. package/src/interfaces/Icons.ts +17 -17
  206. package/src/interfaces/Modal.ts +15 -15
  207. package/src/interfaces/Paper.ts +12 -12
  208. package/src/interfaces/ProgressBar.ts +18 -25
  209. package/src/interfaces/RadioGroup.ts +22 -28
  210. package/src/interfaces/RangerSlider.ts +21 -32
  211. package/src/interfaces/Select.ts +17 -17
  212. package/src/interfaces/Tabs.ts +19 -24
  213. package/src/interfaces/Tag.ts +17 -17
  214. package/src/interfaces/TextField.ts +14 -34
  215. package/src/interfaces/TimeLine.ts +11 -16
  216. package/src/interfaces/TimePicker.ts +13 -13
  217. package/src/interfaces/index.ts +23 -23
  218. package/src/sample-data.json +178 -178
  219. package/src/stories/Accordion.stories.tsx +65 -65
  220. package/src/stories/Avatar.stories.tsx +123 -139
  221. package/src/stories/Badge.stories.tsx +39 -47
  222. package/src/stories/Button.stories.tsx +18 -26
  223. package/src/stories/Card.stories.tsx +40 -55
  224. package/src/stories/ChatMessage.stories.tsx +84 -85
  225. package/src/stories/CheckBox.stories.tsx +17 -23
  226. package/src/stories/DataGrid.stories.tsx +28 -28
  227. package/src/stories/DatePicker.stories.tsx +50 -77
  228. package/src/stories/DropDown.stories.tsx +57 -57
  229. package/src/stories/IconButton.stories.tsx +78 -114
  230. package/src/stories/Modal.stories.tsx +190 -190
  231. package/src/stories/Paper.stories.tsx +53 -53
  232. package/src/stories/ProgressBar.stories.tsx +95 -139
  233. package/src/stories/RadioGroup.stories.tsx +21 -28
  234. package/src/stories/RangerSlider.stories.tsx +58 -68
  235. package/src/stories/Select.stories.tsx +100 -128
  236. package/src/stories/Tabs.stories.tsx +62 -62
  237. package/src/stories/Tag.stories.tsx +56 -74
  238. package/src/stories/TextField.stories.tsx +54 -189
  239. package/src/stories/TimeLine.stories.tsx +35 -43
  240. package/src/stories/TimePicker.stories.tsx +87 -113
  241. package/src/types/index.ts +90 -155
  242. package/tsconfig.json +1 -1
  243. package/buildcache/front-end +0 -1
  244. package/norma-library.tar +0 -0
  245. package/postcss.config.js +0 -6
  246. package/tailwind.config.js +0 -58
@@ -1,85 +1,84 @@
1
- import React from "react";
2
-
3
- import type { Meta } from "@storybook/react";
4
- import { ChatMessage, Icons, Avatar } from "../components";
5
-
6
- const meta = {
7
- title: "Display/ChatMessage",
8
- component: ChatMessage,
9
- parameters: {
10
- layout: "centered",
11
- },
12
- tags: ["autodocs"],
13
- argTypes: {},
14
- } satisfies Meta<typeof ChatMessage>;
15
-
16
- export default meta;
17
-
18
- const chat = [
19
- {
20
- send: "me",
21
- name: "Alice",
22
- message:
23
- "Olá, tudo bem? Meu nome é Alice e falo em nome do banco Bradesco. Eu gostaria de falar com Bob",
24
- time: "09:50",
25
- emotion: (
26
- <Avatar
27
- sx={{
28
- backgroundColor: "#FFF",
29
- border: "1px solid rgb(255, 195, 0)",
30
- m: "5px",
31
- }}
32
- >
33
- <Icons icon="faceNeutral" scale="large" color="warning" />
34
- </Avatar>
35
- ),
36
- emotionReplay: (
37
- <Avatar
38
- sx={{
39
- backgroundColor: "#FFF",
40
- border: "1px solid rgb(219, 102, 25)",
41
- m: "5px",
42
- }}
43
- >
44
- <Icons icon="faceHappy" scale="large" color="primary" />
45
- </Avatar>
46
- ),
47
- },
48
- {
49
- send: "replay",
50
- name: "Bob",
51
- message: "Oi, estou bem, obrigado! E você?",
52
- time: "10:05",
53
- },
54
- {
55
- send: "me",
56
- name: "Alice",
57
- message: "Estou ótima, obrigada por perguntar!",
58
- time: "10:10",
59
- },
60
- {
61
- send: "replay",
62
- name: "Bob",
63
- message: "Que bom ouvir isso!",
64
- time: "10:15",
65
- emotion: (
66
- <Avatar
67
- sx={{
68
- backgroundColor: "#FFF",
69
- border: "1px solid rgb(219, 102, 25)",
70
- m: "5px",
71
- }}
72
- >
73
- <Icons icon="faceHappy" scale="large" color="primary" />
74
- </Avatar>
75
- ),
76
- },
77
- ];
78
-
79
- export const ChatMessageBasic = () => {
80
- return (
81
- <>
82
- <ChatMessage data={chat} />
83
- </>
84
- );
85
- };
1
+ import React from 'react';
2
+
3
+ import type { Meta } from '@storybook/react';
4
+ import { ChatMessage, Icons, Avatar } from '../components';
5
+
6
+ const meta = {
7
+ title: 'Display/ChatMessage',
8
+ component: ChatMessage,
9
+ parameters: {
10
+ layout: 'centered',
11
+ },
12
+ tags: ['autodocs'],
13
+ argTypes: {},
14
+ } satisfies Meta<typeof ChatMessage>;
15
+
16
+ export default meta;
17
+
18
+ const chat = [
19
+ {
20
+ send: 'me',
21
+ name: 'Alice',
22
+ message: 'Olá, tudo bem? Meu nome é Alice e falo em nome do banco Bradesco. Eu gostaria de falar com Bob',
23
+ time: '09:50',
24
+ emotion: (
25
+ <Avatar
26
+ sx={{
27
+ backgroundColor: '#FFF',
28
+ border: '1px solid rgb(255, 195, 0)',
29
+ m: '5px',
30
+ }}
31
+ >
32
+ <Icons icon="faceNeutral" scale="large" color="warning" />
33
+ </Avatar>
34
+ ),
35
+ emotionReplay: (
36
+ <Avatar
37
+ sx={{
38
+ backgroundColor: '#FFF',
39
+ border: '1px solid rgb(219, 102, 25)',
40
+ m: '5px',
41
+ }}
42
+ >
43
+ <Icons icon="faceHappy" scale="large" color="primary" />
44
+ </Avatar>
45
+ ),
46
+ },
47
+ {
48
+ send: 'replay',
49
+ name: 'Bob',
50
+ message: 'Oi, estou bem, obrigado! E você?',
51
+ time: '10:05',
52
+ },
53
+ {
54
+ send: 'me',
55
+ name: 'Alice',
56
+ message: 'Estou ótima, obrigada por perguntar!',
57
+ time: '10:10',
58
+ },
59
+ {
60
+ send: 'replay',
61
+ name: 'Bob',
62
+ message: 'Que bom ouvir isso!',
63
+ time: '10:15',
64
+ emotion: (
65
+ <Avatar
66
+ sx={{
67
+ backgroundColor: '#FFF',
68
+ border: '1px solid rgb(219, 102, 25)',
69
+ m: '5px',
70
+ }}
71
+ >
72
+ <Icons icon="faceHappy" scale="large" color="primary" />
73
+ </Avatar>
74
+ ),
75
+ },
76
+ ];
77
+
78
+ export const ChatMessageBasic = () => {
79
+ return (
80
+ <>
81
+ <ChatMessage data={chat} />
82
+ </>
83
+ );
84
+ };
@@ -1,16 +1,16 @@
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";
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
6
 
7
7
  const meta = {
8
- title: "Form/CheckBox",
8
+ title: 'Form/CheckBox',
9
9
  component: CheckBox,
10
10
  parameters: {
11
- layout: "centered",
11
+ layout: 'centered',
12
12
  },
13
- tags: ["autodocs"],
13
+ tags: ['autodocs'],
14
14
  argTypes: {},
15
15
  } satisfies Meta<typeof CheckBox>;
16
16
 
@@ -24,11 +24,11 @@ const defaultArgs = {
24
24
 
25
25
  export const Playground: Story = {
26
26
  args: {
27
- color: "primary",
27
+ color: 'primary',
28
28
  },
29
29
  };
30
30
 
31
- const label = { inputProps: { "aria-label": "Checkbox demo" } };
31
+ const label = { inputProps: { 'aria-label': 'Checkbox demo' } };
32
32
 
33
33
  export const CheckboxVariant = () => {
34
34
  return (
@@ -40,7 +40,7 @@ export const CheckboxVariant = () => {
40
40
  </>
41
41
  );
42
42
  };
43
- CheckboxVariant.storyName = "CheckBox Variants";
43
+ CheckboxVariant.storyName = 'CheckBox Variants';
44
44
 
45
45
  export const CheckboxProps = () => {
46
46
  return (
@@ -52,7 +52,7 @@ export const CheckboxProps = () => {
52
52
  </>
53
53
  );
54
54
  };
55
- CheckboxProps.storyName = "Variants and Label";
55
+ CheckboxProps.storyName = 'Variants and Label';
56
56
 
57
57
  export const CheckboxColors = () => {
58
58
  return (
@@ -66,7 +66,7 @@ export const CheckboxColors = () => {
66
66
  defaultChecked
67
67
  sx={{
68
68
  color: pink[800],
69
- "&.Mui-checked": {
69
+ '&.Mui-checked': {
70
70
  color: pink[600],
71
71
  },
72
72
  }}
@@ -74,21 +74,15 @@ export const CheckboxColors = () => {
74
74
  </>
75
75
  );
76
76
  };
77
- CheckboxColors.storyName = "CheckBox Colors";
77
+ CheckboxColors.storyName = 'CheckBox Colors';
78
78
 
79
79
  export const CheckboxSizes = () => {
80
80
  return (
81
81
  <>
82
- <FormControlLabel
83
- control={<CheckBox size="small" />}
84
- label="CheckBox Small"
85
- />
82
+ <FormControlLabel control={<CheckBox size="small" />} label="CheckBox Small" />
86
83
  <FormControlLabel control={<CheckBox />} label="CheckBox Default" />
87
- <FormControlLabel
88
- control={<CheckBox size="medium" />}
89
- label="CheckBox Medium"
90
- />
84
+ <FormControlLabel control={<CheckBox size="medium" />} label="CheckBox Medium" />
91
85
  </>
92
86
  );
93
87
  };
94
- CheckboxSizes.storyName = "CheckBox Sizes";
88
+ CheckboxSizes.storyName = 'CheckBox Sizes';
@@ -1,28 +1,28 @@
1
- import React from "react";
2
-
3
- import type { Meta } from "@storybook/react";
4
- import { DataGrid } from "../components";
5
- import dataSource from "../components/DataGrid/allData.json";
6
- import data from "../sample-data.json";
7
-
8
- const meta = {
9
- title: "Display/DataGrid",
10
- component: DataGrid,
11
- parameters: {
12
- layout: "centered",
13
- },
14
- tags: ["autodocs"],
15
- argTypes: {},
16
- } satisfies Meta<typeof DataGrid>;
17
-
18
- export default meta;
19
-
20
- export const DataGridBasic = () => {
21
- return (
22
- <>
23
- <DataGrid data={data} />
24
- </>
25
- );
26
- };
27
-
28
- DataGridBasic.storyName = "DataGrid Basic";
1
+ import React from 'react';
2
+
3
+ import type { Meta } from '@storybook/react';
4
+ import { DataGrid } from '../components';
5
+ import dataSource from '../components/DataGrid/allData.json';
6
+ import data from '../sample-data.json';
7
+
8
+ const meta = {
9
+ title: 'Display/DataGrid',
10
+ component: DataGrid,
11
+ parameters: {
12
+ layout: 'centered',
13
+ },
14
+ tags: ['autodocs'],
15
+ argTypes: {},
16
+ } satisfies Meta<typeof DataGrid>;
17
+
18
+ export default meta;
19
+
20
+ export const DataGridBasic = () => {
21
+ return (
22
+ <>
23
+ <DataGrid data={data} />
24
+ </>
25
+ );
26
+ };
27
+
28
+ DataGridBasic.storyName = 'DataGrid Basic';
@@ -1,77 +1,50 @@
1
- import React from "react";
2
- import { DatePicker } from "../components";
3
- import type { Meta } from "@storybook/react";
4
-
5
- const meta = {
6
- title: "Form/DatePicker",
7
- component: DatePicker,
8
- parameters: {
9
- layout: "centered",
10
- },
11
- tags: ["autodocs"],
12
- argTypes: {},
13
- } satisfies Meta<typeof DatePicker>;
14
-
15
- export default meta;
16
-
17
- export const BasicDatePicker = () => (
18
- <DatePicker sx={{ minWidth: 275 }} label="DatePicker" />
19
- );
20
- BasicDatePicker.storyName = "DatePicker Basic";
21
-
22
- export const DatePickerVariants = () => (
23
- <>
24
- <div style={{ width: "480px", marginBottom: 30 }}>
25
- <DatePicker
26
- sx={{ minWidth: 275 }}
27
- label="DatePicker Responsive"
28
- variant="responsive"
29
- />
30
- </div>
31
- <div style={{ width: "480px", marginBottom: 30 }}>
32
- <DatePicker
33
- sx={{ minWidth: 275 }}
34
- label="DatePicker Mobile"
35
- variant="mobile"
36
- />
37
- </div>
38
- <div style={{ width: "480px", marginBottom: 30 }}>
39
- <DatePicker
40
- sx={{ minWidth: 275 }}
41
- label="DatePicker Desktop"
42
- variant="desktop"
43
- />
44
- </div>
45
- </>
46
- );
47
-
48
- DatePickerVariants.storyName = "DatePicker Variants";
49
-
50
- export const DatePickerLanguage = () => (
51
- <>
52
- <div style={{ width: "480px", marginBottom: 30 }}>
53
- <DatePicker
54
- sx={{ minWidth: 275 }}
55
- label="DatePicker Brazil"
56
- language="pt-br"
57
- />
58
- </div>
59
- <div style={{ width: "480px", marginBottom: 30 }}>
60
- <DatePicker
61
- sx={{ minWidth: 275 }}
62
- label="DatePicker English"
63
- language="en"
64
- format="YYYY-MM-DD"
65
- />
66
- </div>
67
- <div style={{ width: "480px", marginBottom: 30 }}>
68
- <DatePicker
69
- sx={{ minWidth: 275 }}
70
- label="DatePicker Spain"
71
- language="es"
72
- />
73
- </div>
74
- </>
75
- );
76
-
77
- DatePickerLanguage.storyName = "DatePicker Languages";
1
+ import React from 'react';
2
+ import { DatePicker } from '../components';
3
+ import type { Meta } from '@storybook/react';
4
+
5
+ const meta = {
6
+ title: 'Form/DatePicker',
7
+ component: DatePicker,
8
+ parameters: {
9
+ layout: 'centered',
10
+ },
11
+ tags: ['autodocs'],
12
+ argTypes: {},
13
+ } satisfies Meta<typeof DatePicker>;
14
+
15
+ export default meta;
16
+
17
+ export const BasicDatePicker = () => <DatePicker sx={{ minWidth: 275 }} label="DatePicker" />;
18
+ BasicDatePicker.storyName = 'DatePicker Basic';
19
+
20
+ export const DatePickerVariants = () => (
21
+ <>
22
+ <div style={{ width: '480px', marginBottom: 30 }}>
23
+ <DatePicker sx={{ minWidth: 275 }} label="DatePicker Responsive" variant="responsive" />
24
+ </div>
25
+ <div style={{ width: '480px', marginBottom: 30 }}>
26
+ <DatePicker sx={{ minWidth: 275 }} label="DatePicker Mobile" variant="mobile" />
27
+ </div>
28
+ <div style={{ width: '480px', marginBottom: 30 }}>
29
+ <DatePicker sx={{ minWidth: 275 }} label="DatePicker Desktop" variant="desktop" />
30
+ </div>
31
+ </>
32
+ );
33
+
34
+ DatePickerVariants.storyName = 'DatePicker Variants';
35
+
36
+ export const DatePickerLanguage = () => (
37
+ <>
38
+ <div style={{ width: '480px', marginBottom: 30 }}>
39
+ <DatePicker sx={{ minWidth: 275 }} label="DatePicker Brazil" language="pt-br" />
40
+ </div>
41
+ <div style={{ width: '480px', marginBottom: 30 }}>
42
+ <DatePicker sx={{ minWidth: 275 }} label="DatePicker English" language="en" format="YYYY-MM-DD" />
43
+ </div>
44
+ <div style={{ width: '480px', marginBottom: 30 }}>
45
+ <DatePicker sx={{ minWidth: 275 }} label="DatePicker Spain" language="es" />
46
+ </div>
47
+ </>
48
+ );
49
+
50
+ DatePickerLanguage.storyName = 'DatePicker Languages';
@@ -1,57 +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";
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';