@gyramais/gyra-design 0.1.0

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 (147) hide show
  1. package/.eslintrc.json +14 -0
  2. package/.storybook/main.ts +20 -0
  3. package/.storybook/preview.ts +45 -0
  4. package/README.md +31 -0
  5. package/dist/index.js +2 -0
  6. package/package.json +83 -0
  7. package/postcss.config.js +6 -0
  8. package/rollup.config.js +104 -0
  9. package/scripts/build-utils.js +16 -0
  10. package/src/components/Avatar/Avatar.stories.tsx +26 -0
  11. package/src/components/Avatar/Avatar.tsx +36 -0
  12. package/src/components/Avatar/index.css +9 -0
  13. package/src/components/Avatar/index.ts +1 -0
  14. package/src/components/Button/Button.stories.tsx +99 -0
  15. package/src/components/Button/Button.tsx +71 -0
  16. package/src/components/Button/index.css +168 -0
  17. package/src/components/Button/index.ts +1 -0
  18. package/src/components/Card/Card.stories.tsx +126 -0
  19. package/src/components/Card/Card.tsx +111 -0
  20. package/src/components/Card/index.css +96 -0
  21. package/src/components/Card/index.ts +1 -0
  22. package/src/components/Chart/Chart.stories.tsx +61 -0
  23. package/src/components/Chart/Chart.tsx +192 -0
  24. package/src/components/Chart/index.css +15 -0
  25. package/src/components/Chart/index.ts +1 -0
  26. package/src/components/Checkbox/Checkbox.stories.tsx +46 -0
  27. package/src/components/Checkbox/Checkbox.tsx +46 -0
  28. package/src/components/Checkbox/index.css +29 -0
  29. package/src/components/Checkbox/index.ts +1 -0
  30. package/src/components/Col/Col.stories.tsx +33 -0
  31. package/src/components/Col/Col.tsx +45 -0
  32. package/src/components/Col/index.css +57 -0
  33. package/src/components/Col/index.ts +1 -0
  34. package/src/components/Collapse/Collapse.stories.tsx +86 -0
  35. package/src/components/Collapse/Collapse.tsx +34 -0
  36. package/src/components/Collapse/CollapseIcon.tsx +33 -0
  37. package/src/components/Collapse/index.css +14 -0
  38. package/src/components/Collapse/index.ts +2 -0
  39. package/src/components/Divider/Divider.stories.tsx +45 -0
  40. package/src/components/Divider/Divider.tsx +42 -0
  41. package/src/components/Divider/index.css +20 -0
  42. package/src/components/Divider/index.ts +1 -0
  43. package/src/components/Drawer/Drawer.stories.tsx +51 -0
  44. package/src/components/Drawer/Drawer.tsx +40 -0
  45. package/src/components/Drawer/index.css +15 -0
  46. package/src/components/Drawer/index.ts +1 -0
  47. package/src/components/DropdownMenu/DropdownMenu.stories.tsx +66 -0
  48. package/src/components/DropdownMenu/DropdownMenu.tsx +91 -0
  49. package/src/components/DropdownMenu/index.css +18 -0
  50. package/src/components/DropdownMenu/index.ts +1 -0
  51. package/src/components/Filter/Filter.stories.tsx +94 -0
  52. package/src/components/Filter/Filter.tsx +213 -0
  53. package/src/components/Filter/index.css +81 -0
  54. package/src/components/Filter/index.ts +1 -0
  55. package/src/components/Form/Form.tsx +11 -0
  56. package/src/components/Form/Item.tsx +33 -0
  57. package/src/components/Form/index.css +4 -0
  58. package/src/components/Form/index.ts +1 -0
  59. package/src/components/HoverCard/HoverCard.stories.tsx +48 -0
  60. package/src/components/HoverCard/HoverCard.tsx +54 -0
  61. package/src/components/HoverCard/index.css +15 -0
  62. package/src/components/HoverCard/index.ts +1 -0
  63. package/src/components/Icon/Icon.stories.tsx +23 -0
  64. package/src/components/Icon/Icon.tsx +36 -0
  65. package/src/components/Icon/index.css +3 -0
  66. package/src/components/Icon/index.ts +1 -0
  67. package/src/components/IconDisplay/IconDisplay.stories.tsx +27 -0
  68. package/src/components/IconDisplay/IconDisplay.tsx +29 -0
  69. package/src/components/IconDisplay/index.css +18 -0
  70. package/src/components/IconDisplay/index.ts +1 -0
  71. package/src/components/Information/Information.stories.tsx +25 -0
  72. package/src/components/Information/Information.tsx +50 -0
  73. package/src/components/Information/index.css +34 -0
  74. package/src/components/Information/index.ts +1 -0
  75. package/src/components/Input/Input.stories.tsx +38 -0
  76. package/src/components/Input/Input.tsx +91 -0
  77. package/src/components/Input/index.css +74 -0
  78. package/src/components/Input/index.ts +1 -0
  79. package/src/components/Label/Label.tsx +26 -0
  80. package/src/components/Label/index.ts +1 -0
  81. package/src/components/Layout/Content.tsx +29 -0
  82. package/src/components/Layout/Header.tsx +29 -0
  83. package/src/components/Layout/Layout.stories.tsx +54 -0
  84. package/src/components/Layout/Layout.tsx +32 -0
  85. package/src/components/Layout/Sider.tsx +29 -0
  86. package/src/components/Layout/index.css +37 -0
  87. package/src/components/Layout/index.ts +4 -0
  88. package/src/components/List/List.stories.tsx +58 -0
  89. package/src/components/List/List.tsx +98 -0
  90. package/src/components/List/index.css +54 -0
  91. package/src/components/List/index.ts +1 -0
  92. package/src/components/Loading/Loading.stories.tsx +23 -0
  93. package/src/components/Loading/Loading.tsx +51 -0
  94. package/src/components/Loading/index.css +36 -0
  95. package/src/components/Loading/index.ts +1 -0
  96. package/src/components/Logo/Logo.stories.tsx +34 -0
  97. package/src/components/Logo/Logo.tsx +39 -0
  98. package/src/components/Logo/index.css +9 -0
  99. package/src/components/Logo/index.ts +1 -0
  100. package/src/components/Menubar/Menubar.stories.tsx +55 -0
  101. package/src/components/Menubar/Menubar.tsx +118 -0
  102. package/src/components/Menubar/index.css +96 -0
  103. package/src/components/Menubar/index.ts +1 -0
  104. package/src/components/Row/Row.stories.tsx +33 -0
  105. package/src/components/Row/Row.tsx +48 -0
  106. package/src/components/Row/index.css +116 -0
  107. package/src/components/Row/index.ts +1 -0
  108. package/src/components/Switch/Switch.stories.tsx +39 -0
  109. package/src/components/Switch/Switch.tsx +36 -0
  110. package/src/components/Switch/index.css +37 -0
  111. package/src/components/Switch/index.ts +1 -0
  112. package/src/components/Table/Table.stories.tsx +85 -0
  113. package/src/components/Table/Table.tsx +123 -0
  114. package/src/components/Table/index.css +74 -0
  115. package/src/components/Table/index.ts +1 -0
  116. package/src/components/Tabs/Tabs.stories.tsx +49 -0
  117. package/src/components/Tabs/Tabs.tsx +76 -0
  118. package/src/components/Tabs/index.css +89 -0
  119. package/src/components/Tabs/index.ts +1 -0
  120. package/src/components/Tag/Tag.stories.tsx +41 -0
  121. package/src/components/Tag/Tag.tsx +39 -0
  122. package/src/components/Tag/index.css +31 -0
  123. package/src/components/Tag/index.ts +1 -0
  124. package/src/components/Text/Text.stories.tsx +41 -0
  125. package/src/components/Toast/Toast.stories.tsx +47 -0
  126. package/src/components/Toast/Toast.tsx +13 -0
  127. package/src/components/Toast/index.ts +1 -0
  128. package/src/components/Tooltip/Tooltip.stories.tsx +44 -0
  129. package/src/components/Tooltip/Tooltip.tsx +60 -0
  130. package/src/components/Tooltip/index.css +15 -0
  131. package/src/components/Tooltip/index.ts +1 -0
  132. package/src/index.css +176 -0
  133. package/src/index.ts +38 -0
  134. package/src/shadcn/checkbox.tsx +28 -0
  135. package/src/shadcn/dropdown-menu.tsx +200 -0
  136. package/src/shadcn/form.tsx +178 -0
  137. package/src/shadcn/hover-card.tsx +31 -0
  138. package/src/shadcn/label.tsx +26 -0
  139. package/src/shadcn/lib/utils.ts +6 -0
  140. package/src/shadcn/menubar.tsx +248 -0
  141. package/src/shadcn/switch.tsx +25 -0
  142. package/src/shadcn/table.tsx +117 -0
  143. package/src/shadcn/tabs.tsx +55 -0
  144. package/src/shadcn/tooltip.tsx +30 -0
  145. package/src/theme.ts +123 -0
  146. package/tailwind.config.js +9 -0
  147. package/tsconfig.json +32 -0
@@ -0,0 +1,168 @@
1
+ .gyramais-button {
2
+ @apply
3
+ flex
4
+ items-center
5
+ justify-center
6
+ text-lg
7
+ font-semibold
8
+ rounded-2xl
9
+ border-[1px]
10
+ border-solid
11
+ duration-300;
12
+ }
13
+ .gyramais-button:not(:disabled):not(.gyramais-button-loading) {
14
+ @apply
15
+ hover:brightness-110;
16
+ }
17
+
18
+ .gyramais-button.gyramais-button-primary {
19
+ @apply
20
+ bg-[var(--primary-button-color)]
21
+ border-[var(--primary-button-color)]
22
+ text-[var(--primary-button-text-color)];
23
+ }
24
+ .gyramais-button.gyramais-button-primary .gyramais-button-loading-feedback div {
25
+ @apply
26
+ !border-[var(--primary-button-text-color)_var(--primary-button-text-color)_transparent_transparent];
27
+ }
28
+
29
+ .gyramais-button.gyramais-button-secondary {
30
+ @apply
31
+ bg-[var(--secondary-button-color)]
32
+ border-[var(--secondary-button-color)]
33
+ text-[var(--secondary-button-text-color)];
34
+ }
35
+ .gyramais-button.gyramais-button-secondary .gyramais-button-loading-feedback div {
36
+ @apply
37
+ !border-[var(--secondary-button-text-color)_var(--secondary-button-text-color)_transparent_transparent];
38
+ }
39
+
40
+ .gyramais-button.gyramais-button-white {
41
+ @apply
42
+ bg-white
43
+ border-[var(--border-color)]
44
+ text-black;
45
+ }
46
+ .gyramais-button.gyramais-button-white svg {
47
+ @apply
48
+ text-[var(--primary-button-color)];
49
+ }
50
+ .gyramais-button.gyramais-button-white .gyramais-button-loading-feedback div {
51
+ @apply
52
+ !border-[var(--primary-button-color)_var(--primary-button-color)_transparent_transparent];
53
+ }
54
+
55
+ .gyramais-button.gyramais-button-dark {
56
+ @apply
57
+ bg-[var(--dark-button-color)]
58
+ border-[var(--dark-button-color)]
59
+ text-[var(--dark-button-text-color)];
60
+ }
61
+ .gyramais-button.gyramais-button-dark .gyramais-button-loading-feedback div {
62
+ @apply
63
+ !border-[var(--dark-button-text-color)_var(--dark-button-text-color)_transparent_transparent];
64
+ }
65
+
66
+ .gyramais-button.gyramais-button-icon .gyramais-button-icon-container {
67
+ @apply
68
+ mr-0
69
+ }
70
+
71
+ .gyramais-button.gyramais-button-link {
72
+ @apply
73
+ bg-transparent
74
+ border-none
75
+ !text-[var(--link-button-color)]
76
+ !p-0;
77
+ }
78
+
79
+ .gyramais-button.gyramais-button-block {
80
+ @apply
81
+ w-full;
82
+ }
83
+
84
+ .gyramais-button.gyramais-button-small {
85
+ @apply
86
+ text-xs
87
+ rounded-[6px]
88
+ px-2 py-2;
89
+ }
90
+ .gyramais-button.gyramais-button-icon.gyramais-button-small {
91
+ @apply
92
+ !p-1
93
+ rounded-[8px];
94
+ }
95
+ .gyramais-button.gyramais-button-small .gyramais-button-icon-container svg {
96
+ @apply
97
+ text-base;
98
+ }
99
+ .gyramais-button.gyramais-button-icon.gyramais-button-small .gyramais-button-icon-container svg {
100
+ @apply
101
+ text-[22px]
102
+ }
103
+
104
+ .gyramais-button.gyramais-button-medium {
105
+ @apply
106
+ text-base
107
+ rounded-[12px]
108
+ px-5 py-3;
109
+ }
110
+ .gyramais-button.gyramais-button-icon.gyramais-button-medium {
111
+ @apply
112
+ !p-3
113
+ rounded-[10px];
114
+ }
115
+
116
+ .gyramais-button.gyramais-button-large {
117
+ @apply
118
+ text-lg
119
+ px-12 py-4;
120
+ }
121
+ .gyramais-button.gyramais-button-icon.gyramais-button-large {
122
+ @apply
123
+ !p-4
124
+ rounded-[12px];
125
+ }
126
+
127
+ .gyramais-button.gyramais-button-loading {
128
+ @apply
129
+ opacity-80
130
+ cursor-progress
131
+ }
132
+
133
+ .gyramais-button:disabled {
134
+ @apply
135
+ bg-[#E0E0E0]
136
+ border-[#E0E0E0]
137
+ text-black
138
+ opacity-60
139
+ cursor-not-allowed;
140
+ }
141
+ .gyramais-button.gyramais-button-white:disabled svg {
142
+ @apply
143
+ text-black;
144
+ }
145
+ .gyramais-button.gyramais-button-link:disabled {
146
+ @apply
147
+ bg-transparent;
148
+ }
149
+
150
+ .gyramais-button .gyramais-button-icon-container {
151
+ @apply
152
+ flex
153
+ items-center
154
+ mr-2
155
+ }
156
+ .gyramais-button .gyramais-button-icon-container svg {
157
+ @apply
158
+ text-2xl
159
+ }
160
+
161
+ @keyframes rotate {
162
+ 0% {
163
+ transform: rotateZ(0);
164
+ }
165
+ 100% {
166
+ transform: rotateZ(360deg);
167
+ }
168
+ }
@@ -0,0 +1 @@
1
+ export * from "./Button";
@@ -0,0 +1,126 @@
1
+ import React from "react";
2
+ import type { Meta, StoryObj } from "@storybook/react";
3
+ import { Card } from "./Card";
4
+ import { Logo } from '../Logo';
5
+
6
+ const meta: Meta<typeof Card> = {
7
+ title: "Library/Components/Card",
8
+ component: Card,
9
+ parameters: {
10
+ layout: 'centered',
11
+ }
12
+ };
13
+
14
+ export default meta;
15
+
16
+ type Story = StoryObj<typeof Card>;
17
+
18
+ export const Default: Story = {
19
+ args: {
20
+ id: '',
21
+ className: '',
22
+ title: '',
23
+ type: 'shadow',
24
+ disabled: false,
25
+ loading: false,
26
+ onClick: () => {},
27
+ children: (
28
+ <div className="min-w-[400px] min-h-[200px]">
29
+ Conteúdo do cartão
30
+ </div>
31
+ ),
32
+ },
33
+ }
34
+
35
+ export const Title: Story = {
36
+ args: {
37
+ id: '',
38
+ className: '',
39
+ title: 'Título do cartão',
40
+ collapsible: false,
41
+ type: 'shadow',
42
+ disabled: false,
43
+ loading: false,
44
+ onClick: () => {},
45
+ children: (
46
+ <div className="min-w-[400px] min-h-[200px]">
47
+ Conteúdo do cartão
48
+ </div>
49
+ ),
50
+ },
51
+ }
52
+
53
+ export const HeaderContent: Story = {
54
+ args: {
55
+ id: '',
56
+ className: '',
57
+ title: 'Título do cartão',
58
+ collapsible: false,
59
+ type: 'shadow',
60
+ disabled: false,
61
+ loading: false,
62
+ onClick: () => {},
63
+ headerContent: (
64
+ <Logo height={20} />
65
+ ),
66
+ children: (
67
+ <div className="min-w-[400px] min-h-[200px]">
68
+ Conteúdo do cartão com conteúdo no header
69
+ </div>
70
+ ),
71
+ },
72
+ }
73
+
74
+ export const Collapsible: Story = {
75
+ args: {
76
+ id: '',
77
+ className: '',
78
+ title: 'Título do cartão',
79
+ collapsible: true,
80
+ type: 'shadow',
81
+ disabled: false,
82
+ loading: false,
83
+ onClick: () => {},
84
+ children: (
85
+ <div className="min-w-[400px] min-h-[200px]">
86
+ Conteúdo do cartão colapsável
87
+ </div>
88
+ ),
89
+ },
90
+ }
91
+
92
+ export const Loading: Story = {
93
+ args: {
94
+ id: '',
95
+ className: '',
96
+ title: 'Título do cartão bloqueado',
97
+ collapsible: false,
98
+ type: 'shadow',
99
+ disabled: false,
100
+ loading: true,
101
+ onClick: () => {},
102
+ children: (
103
+ <div className="min-w-[400px] text-[var(--primary-button-color)]">
104
+ Conteúdo do cartão bloqueado
105
+ </div>
106
+ ),
107
+ },
108
+ }
109
+
110
+ export const Disabled: Story = {
111
+ args: {
112
+ id: '',
113
+ className: '',
114
+ title: 'Título do cartão bloqueado',
115
+ collapsible: false,
116
+ type: 'shadow',
117
+ disabled: true,
118
+ loading: false,
119
+ onClick: () => {},
120
+ children: (
121
+ <div className="min-w-[400px] min-h-[200px] text-[var(--primary-button-color)]">
122
+ Conteúdo do cartão bloqueado
123
+ </div>
124
+ ),
125
+ },
126
+ }
@@ -0,0 +1,111 @@
1
+ import React, { useState, useMemo } from "react";
2
+ import classNames from "classnames";
3
+ import "./index.css";
4
+ import { Loading } from "../Loading";
5
+ import { Collapse, CollapseIcon } from "../Collapse";
6
+
7
+ import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
8
+ import { Row } from "../Row";
9
+ import { Col } from "../Col";
10
+
11
+ type CardProps = {
12
+ id?: string;
13
+ className?: string;
14
+ type?: 'shadow' | 'shadow-inset' | 'border';
15
+ title?: string;
16
+ disabled?: boolean;
17
+ loading?: boolean;
18
+ collapsible?: boolean;
19
+ defaultCollapsed?: boolean;
20
+ onClick?: () => void;
21
+ headerContent?: React.ReactNode;
22
+ children?: React.ReactNode;
23
+ }
24
+
25
+ const Card = ({
26
+ id,
27
+ type = 'shadow',
28
+ className,
29
+ title,
30
+ disabled,
31
+ loading,
32
+ collapsible,
33
+ defaultCollapsed,
34
+ onClick,
35
+ headerContent,
36
+ children,
37
+ }: CardProps) => {
38
+ const [collapsed, setCollapsed] = useState(collapsible && defaultCollapsed);
39
+
40
+ const hasTitleContent = useMemo(() => !!(title || collapsible || headerContent), [title, collapsible, headerContent])
41
+
42
+ const handleCollapse = () => {
43
+ if (disabled) {
44
+ return;
45
+ }
46
+ if (!collapsible) {
47
+ return;
48
+ }
49
+
50
+ setCollapsed(!collapsed);
51
+ }
52
+
53
+ return (
54
+ <div
55
+ id={id}
56
+ className={classNames(
57
+ "gyramais-card",
58
+ type ? `gyramais-card-${type}` : '',
59
+ loading ? 'gyramais-card-loading' : '',
60
+ disabled ? 'gyramais-card-disabled' : '',
61
+ className,
62
+ )}
63
+ onClick={!disabled ? onClick : () => {}}
64
+ >
65
+ {(title || collapsible || headerContent) && (
66
+ <div className="gyramais-card-header">
67
+ <Row columns={2} align="center">
68
+ {(title || collapsible) && (
69
+ <Col
70
+ span={!headerContent ? 2 : 1}
71
+ className={`gyramais-card-header-left ${collapsible ? 'with-collapse' : ''}`}
72
+ onClick={handleCollapse}
73
+ >
74
+ {title && (
75
+ <h5 className="gyramais-card-header-title">
76
+ {title}
77
+ </h5>
78
+ )}
79
+
80
+ {collapsible && (
81
+ <CollapseIcon collapsed={collapsed} />
82
+ )}
83
+ </Col>
84
+ )}
85
+
86
+ {headerContent && (
87
+ <Col span={(!title && !collapsible) ? 2 : 1} className="gyramais-card-header-right">
88
+ {headerContent}
89
+ </Col>
90
+ )}
91
+ </Row>
92
+
93
+ </div>
94
+ )}
95
+
96
+ <Collapse collapsed={collapsed}>
97
+ <div className={`gyramais-card-content ${children ? 'with-content' : ''} ${hasTitleContent ? 'with-title' : ''}`}>
98
+ {loading && (
99
+ <div className="gyramais-card-loading">
100
+ <Loading size={40} />
101
+ </div>
102
+ )}
103
+
104
+ {children}
105
+ </div>
106
+ </Collapse>
107
+ </div>
108
+ );
109
+ };
110
+
111
+ export { Card };
@@ -0,0 +1,96 @@
1
+ .gyramais-card {
2
+ @apply
3
+ relative
4
+ p-4
5
+ bg-white
6
+ rounded-[20px]
7
+ duration-300
8
+ md:p-6;
9
+ }
10
+ .gyramais-card.gyramais-card-shadow {
11
+ @apply
12
+ shadow-[0px_14px_64px_-4px_#18274b1f,_0px_8px_22px_-6px_#18274b1f];
13
+ }
14
+ .gyramais-card.gyramais-card-shadow-inset {
15
+ @apply
16
+ shadow-[inset_0px_0px_10px_6px_#18274b1f];
17
+ }
18
+ .gyramais-card.gyramais-card-border {
19
+ @apply
20
+ border-[1px]
21
+ border-[var(--border-color)]
22
+ border-solid;
23
+ }
24
+
25
+ .gyramais-card.gyramais-card-disabled {
26
+ @apply
27
+ cursor-not-allowed
28
+ grayscale-[100]
29
+ opacity-50
30
+ }
31
+
32
+ .gyramais-card .gyramais-card-header-left {
33
+ @apply
34
+ flex
35
+ items-center;
36
+ }
37
+ .gyramais-card:not(.gyramais-card-disabled) .gyramais-card-header-left.with-collapse {
38
+ @apply
39
+ cursor-pointer;
40
+ }
41
+
42
+ .gyramais-card .gyramais-card-header-title {
43
+ @apply
44
+ text-black
45
+ font-semibold
46
+ mr-2;
47
+ }
48
+
49
+ .gyramais-card .gyramais-card-header-collapse {
50
+ @apply
51
+ w-fit
52
+ h-fit;
53
+ }
54
+
55
+ .gyramais-card .gyramais-card-header-collapse-icon {
56
+ @apply
57
+ text-[var(--primary-button-color)]
58
+ transition-all
59
+ duration-300;
60
+ }
61
+ .gyramais-card .gyramais-card-header-collapse-icon.collapsed {
62
+ @apply
63
+ -rotate-90
64
+ }
65
+
66
+ .gyramais-card .gyramais-card-content {
67
+ @apply
68
+ relative
69
+ w-full
70
+ h-full;
71
+ }
72
+ .gyramais-card .gyramais-card-content.with-title.with-content {
73
+ @apply
74
+ pt-4;
75
+ }
76
+ .gyramais-card.gyramais-card-loading > .ReactCollapse--collapse > .ReactCollapse--content > .gyramais-card-content {
77
+ @apply
78
+ min-h-[4rem];
79
+ }
80
+
81
+ .gyramais-card .gyramais-card-loading {
82
+ @apply
83
+ absolute
84
+ z-10
85
+ w-full
86
+ h-full
87
+ scale-x-[102%]
88
+ pt-4
89
+ top-0
90
+ left-0
91
+ flex
92
+ items-center
93
+ justify-center
94
+ bg-[#ffffff80]
95
+ backdrop-blur-sm;
96
+ }
@@ -0,0 +1 @@
1
+ export * from "./Card";
@@ -0,0 +1,61 @@
1
+ import React from 'react';
2
+ import type { Meta, StoryObj } from "@storybook/react";
3
+ import { Chart } from "./Chart";
4
+
5
+ const meta: Meta<typeof Chart> = {
6
+ title: "Library/Components/Chart",
7
+ component: Chart,
8
+ parameters: {
9
+ layout: 'padded',
10
+ },
11
+ render: (props) => (
12
+ <div className="w-full h-[300px] flex items-center">
13
+ <Chart {...props}/>
14
+ </div>
15
+ ),
16
+ };
17
+
18
+ export default meta;
19
+
20
+ type Story = StoryObj<typeof Chart>;
21
+
22
+ export const Default: Story = {
23
+ args: {
24
+ id: '',
25
+ className: '',
26
+ layout: 'horizontal',
27
+ barSize: 26,
28
+ barGap: 16,
29
+ indexes: [{
30
+ name: 'CNPJ',
31
+ key: 'cnpj',
32
+ color: '#2F5DCB',
33
+ }, {
34
+ name: 'CPF',
35
+ key: 'cpf',
36
+ color: '#7B99E0',
37
+ }],
38
+ data: [{
39
+ cpf: 621,
40
+ cnpj: 843,
41
+ }],
42
+ },
43
+ }
44
+
45
+ export const Pie: Story = {
46
+ args: {
47
+ id: '',
48
+ className: '',
49
+ type: 'pie',
50
+ data: [{
51
+ name: 'RJ',
52
+ value: 23,
53
+ }, {
54
+ name: 'SP',
55
+ value: 54,
56
+ }, {
57
+ name: 'AM',
58
+ value: 11,
59
+ }],
60
+ },
61
+ }