@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.
- package/.eslintrc.json +14 -0
- package/.storybook/main.ts +20 -0
- package/.storybook/preview.ts +45 -0
- package/README.md +31 -0
- package/dist/index.js +2 -0
- package/package.json +83 -0
- package/postcss.config.js +6 -0
- package/rollup.config.js +104 -0
- package/scripts/build-utils.js +16 -0
- package/src/components/Avatar/Avatar.stories.tsx +26 -0
- package/src/components/Avatar/Avatar.tsx +36 -0
- package/src/components/Avatar/index.css +9 -0
- package/src/components/Avatar/index.ts +1 -0
- package/src/components/Button/Button.stories.tsx +99 -0
- package/src/components/Button/Button.tsx +71 -0
- package/src/components/Button/index.css +168 -0
- package/src/components/Button/index.ts +1 -0
- package/src/components/Card/Card.stories.tsx +126 -0
- package/src/components/Card/Card.tsx +111 -0
- package/src/components/Card/index.css +96 -0
- package/src/components/Card/index.ts +1 -0
- package/src/components/Chart/Chart.stories.tsx +61 -0
- package/src/components/Chart/Chart.tsx +192 -0
- package/src/components/Chart/index.css +15 -0
- package/src/components/Chart/index.ts +1 -0
- package/src/components/Checkbox/Checkbox.stories.tsx +46 -0
- package/src/components/Checkbox/Checkbox.tsx +46 -0
- package/src/components/Checkbox/index.css +29 -0
- package/src/components/Checkbox/index.ts +1 -0
- package/src/components/Col/Col.stories.tsx +33 -0
- package/src/components/Col/Col.tsx +45 -0
- package/src/components/Col/index.css +57 -0
- package/src/components/Col/index.ts +1 -0
- package/src/components/Collapse/Collapse.stories.tsx +86 -0
- package/src/components/Collapse/Collapse.tsx +34 -0
- package/src/components/Collapse/CollapseIcon.tsx +33 -0
- package/src/components/Collapse/index.css +14 -0
- package/src/components/Collapse/index.ts +2 -0
- package/src/components/Divider/Divider.stories.tsx +45 -0
- package/src/components/Divider/Divider.tsx +42 -0
- package/src/components/Divider/index.css +20 -0
- package/src/components/Divider/index.ts +1 -0
- package/src/components/Drawer/Drawer.stories.tsx +51 -0
- package/src/components/Drawer/Drawer.tsx +40 -0
- package/src/components/Drawer/index.css +15 -0
- package/src/components/Drawer/index.ts +1 -0
- package/src/components/DropdownMenu/DropdownMenu.stories.tsx +66 -0
- package/src/components/DropdownMenu/DropdownMenu.tsx +91 -0
- package/src/components/DropdownMenu/index.css +18 -0
- package/src/components/DropdownMenu/index.ts +1 -0
- package/src/components/Filter/Filter.stories.tsx +94 -0
- package/src/components/Filter/Filter.tsx +213 -0
- package/src/components/Filter/index.css +81 -0
- package/src/components/Filter/index.ts +1 -0
- package/src/components/Form/Form.tsx +11 -0
- package/src/components/Form/Item.tsx +33 -0
- package/src/components/Form/index.css +4 -0
- package/src/components/Form/index.ts +1 -0
- package/src/components/HoverCard/HoverCard.stories.tsx +48 -0
- package/src/components/HoverCard/HoverCard.tsx +54 -0
- package/src/components/HoverCard/index.css +15 -0
- package/src/components/HoverCard/index.ts +1 -0
- package/src/components/Icon/Icon.stories.tsx +23 -0
- package/src/components/Icon/Icon.tsx +36 -0
- package/src/components/Icon/index.css +3 -0
- package/src/components/Icon/index.ts +1 -0
- package/src/components/IconDisplay/IconDisplay.stories.tsx +27 -0
- package/src/components/IconDisplay/IconDisplay.tsx +29 -0
- package/src/components/IconDisplay/index.css +18 -0
- package/src/components/IconDisplay/index.ts +1 -0
- package/src/components/Information/Information.stories.tsx +25 -0
- package/src/components/Information/Information.tsx +50 -0
- package/src/components/Information/index.css +34 -0
- package/src/components/Information/index.ts +1 -0
- package/src/components/Input/Input.stories.tsx +38 -0
- package/src/components/Input/Input.tsx +91 -0
- package/src/components/Input/index.css +74 -0
- package/src/components/Input/index.ts +1 -0
- package/src/components/Label/Label.tsx +26 -0
- package/src/components/Label/index.ts +1 -0
- package/src/components/Layout/Content.tsx +29 -0
- package/src/components/Layout/Header.tsx +29 -0
- package/src/components/Layout/Layout.stories.tsx +54 -0
- package/src/components/Layout/Layout.tsx +32 -0
- package/src/components/Layout/Sider.tsx +29 -0
- package/src/components/Layout/index.css +37 -0
- package/src/components/Layout/index.ts +4 -0
- package/src/components/List/List.stories.tsx +58 -0
- package/src/components/List/List.tsx +98 -0
- package/src/components/List/index.css +54 -0
- package/src/components/List/index.ts +1 -0
- package/src/components/Loading/Loading.stories.tsx +23 -0
- package/src/components/Loading/Loading.tsx +51 -0
- package/src/components/Loading/index.css +36 -0
- package/src/components/Loading/index.ts +1 -0
- package/src/components/Logo/Logo.stories.tsx +34 -0
- package/src/components/Logo/Logo.tsx +39 -0
- package/src/components/Logo/index.css +9 -0
- package/src/components/Logo/index.ts +1 -0
- package/src/components/Menubar/Menubar.stories.tsx +55 -0
- package/src/components/Menubar/Menubar.tsx +118 -0
- package/src/components/Menubar/index.css +96 -0
- package/src/components/Menubar/index.ts +1 -0
- package/src/components/Row/Row.stories.tsx +33 -0
- package/src/components/Row/Row.tsx +48 -0
- package/src/components/Row/index.css +116 -0
- package/src/components/Row/index.ts +1 -0
- package/src/components/Switch/Switch.stories.tsx +39 -0
- package/src/components/Switch/Switch.tsx +36 -0
- package/src/components/Switch/index.css +37 -0
- package/src/components/Switch/index.ts +1 -0
- package/src/components/Table/Table.stories.tsx +85 -0
- package/src/components/Table/Table.tsx +123 -0
- package/src/components/Table/index.css +74 -0
- package/src/components/Table/index.ts +1 -0
- package/src/components/Tabs/Tabs.stories.tsx +49 -0
- package/src/components/Tabs/Tabs.tsx +76 -0
- package/src/components/Tabs/index.css +89 -0
- package/src/components/Tabs/index.ts +1 -0
- package/src/components/Tag/Tag.stories.tsx +41 -0
- package/src/components/Tag/Tag.tsx +39 -0
- package/src/components/Tag/index.css +31 -0
- package/src/components/Tag/index.ts +1 -0
- package/src/components/Text/Text.stories.tsx +41 -0
- package/src/components/Toast/Toast.stories.tsx +47 -0
- package/src/components/Toast/Toast.tsx +13 -0
- package/src/components/Toast/index.ts +1 -0
- package/src/components/Tooltip/Tooltip.stories.tsx +44 -0
- package/src/components/Tooltip/Tooltip.tsx +60 -0
- package/src/components/Tooltip/index.css +15 -0
- package/src/components/Tooltip/index.ts +1 -0
- package/src/index.css +176 -0
- package/src/index.ts +38 -0
- package/src/shadcn/checkbox.tsx +28 -0
- package/src/shadcn/dropdown-menu.tsx +200 -0
- package/src/shadcn/form.tsx +178 -0
- package/src/shadcn/hover-card.tsx +31 -0
- package/src/shadcn/label.tsx +26 -0
- package/src/shadcn/lib/utils.ts +6 -0
- package/src/shadcn/menubar.tsx +248 -0
- package/src/shadcn/switch.tsx +25 -0
- package/src/shadcn/table.tsx +117 -0
- package/src/shadcn/tabs.tsx +55 -0
- package/src/shadcn/tooltip.tsx +30 -0
- package/src/theme.ts +123 -0
- package/tailwind.config.js +9 -0
- package/tsconfig.json +32 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
.gyramais-input-controller {
|
|
2
|
+
@apply
|
|
3
|
+
relative
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.gyramais-input-controller .gyramais-input-placeholder {
|
|
7
|
+
@apply
|
|
8
|
+
pointer-events-none
|
|
9
|
+
absolute
|
|
10
|
+
top-1/2
|
|
11
|
+
-translate-y-1/2
|
|
12
|
+
left-[26px]
|
|
13
|
+
text-sm
|
|
14
|
+
text-[#a9a9a9]
|
|
15
|
+
duration-300
|
|
16
|
+
|
|
17
|
+
md:text-base;
|
|
18
|
+
}
|
|
19
|
+
.gyramais-input-controller .gyramais-input-placeholder.gyramais-input-with-value {
|
|
20
|
+
@apply
|
|
21
|
+
top-0
|
|
22
|
+
text-sm
|
|
23
|
+
font-medium;
|
|
24
|
+
}
|
|
25
|
+
.gyramais-input-controller .gyramais-input-placeholder.gyramais-input-with-value:not(.gyramais-input-placeholder-disabled) {
|
|
26
|
+
@apply
|
|
27
|
+
text-[var(--primary-button-color)];
|
|
28
|
+
}
|
|
29
|
+
.gyramais-input-controller .gyramais-input-placeholder.gyramais-input-with-value::before {
|
|
30
|
+
@apply
|
|
31
|
+
absolute
|
|
32
|
+
content-['']
|
|
33
|
+
top-1/2
|
|
34
|
+
left-0
|
|
35
|
+
w-full
|
|
36
|
+
h-[2px]
|
|
37
|
+
scale-x-[115%]
|
|
38
|
+
bg-[#eeeded]
|
|
39
|
+
-z-10;
|
|
40
|
+
}
|
|
41
|
+
.gyramais-input-controller .gyramais-input-placeholder.gyramais-input-with-value:not(.gyramais-input-placeholder-disabled)::before {
|
|
42
|
+
@apply
|
|
43
|
+
bg-white
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.gyramais-input {
|
|
47
|
+
@apply
|
|
48
|
+
w-full
|
|
49
|
+
min-h-[40px]
|
|
50
|
+
rounded-[16px]
|
|
51
|
+
border-[1px]
|
|
52
|
+
border-[var(--border-color)]
|
|
53
|
+
py-3
|
|
54
|
+
px-6
|
|
55
|
+
text-sm
|
|
56
|
+
font-normal
|
|
57
|
+
duration-300
|
|
58
|
+
|
|
59
|
+
md:min-h-[58px]
|
|
60
|
+
md:rounded-[20px]
|
|
61
|
+
md:text-base
|
|
62
|
+
md:py-4;
|
|
63
|
+
}
|
|
64
|
+
.gyramais-input:disabled {
|
|
65
|
+
@apply
|
|
66
|
+
cursor-not-allowed
|
|
67
|
+
opacity-50
|
|
68
|
+
}
|
|
69
|
+
.gyramais-input-controller:hover .gyramais-input:hover:not(:disabled),
|
|
70
|
+
.gyramais-input:focus:not(:disabled) {
|
|
71
|
+
@apply
|
|
72
|
+
shadow-[inset_0_0_0_1px_var(--primary-button-color)]
|
|
73
|
+
border-[var(--primary-button-color)]
|
|
74
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Input";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
5
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
6
|
+
|
|
7
|
+
import { cn } from '../../shadcn/lib/utils';
|
|
8
|
+
|
|
9
|
+
const labelVariants = cva(
|
|
10
|
+
'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70'
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
const Label = React.forwardRef<
|
|
14
|
+
React.ElementRef<typeof LabelPrimitive.Root>,
|
|
15
|
+
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
|
|
16
|
+
VariantProps<typeof labelVariants>
|
|
17
|
+
>(({ className, ...props }, ref) => (
|
|
18
|
+
<LabelPrimitive.Root
|
|
19
|
+
ref={ref}
|
|
20
|
+
className={cn(labelVariants(), className)}
|
|
21
|
+
{...props}
|
|
22
|
+
/>
|
|
23
|
+
));
|
|
24
|
+
Label.displayName = LabelPrimitive.Root.displayName;
|
|
25
|
+
|
|
26
|
+
export { Label };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Label";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import "./index.css";
|
|
4
|
+
|
|
5
|
+
type ContentProps = {
|
|
6
|
+
id?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const Content = ({
|
|
12
|
+
id,
|
|
13
|
+
className,
|
|
14
|
+
children,
|
|
15
|
+
}: ContentProps) => {
|
|
16
|
+
return (
|
|
17
|
+
<div
|
|
18
|
+
id={id}
|
|
19
|
+
className={classNames(
|
|
20
|
+
"gyramais-layout-content",
|
|
21
|
+
className,
|
|
22
|
+
)}
|
|
23
|
+
>
|
|
24
|
+
{children}
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export { Content };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import "./index.css";
|
|
4
|
+
|
|
5
|
+
type HeaderProps = {
|
|
6
|
+
id?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const Header = ({
|
|
12
|
+
id,
|
|
13
|
+
className,
|
|
14
|
+
children,
|
|
15
|
+
}: HeaderProps) => {
|
|
16
|
+
return (
|
|
17
|
+
<div
|
|
18
|
+
id={id}
|
|
19
|
+
className={classNames(
|
|
20
|
+
"gyramais-layout-header",
|
|
21
|
+
className,
|
|
22
|
+
)}
|
|
23
|
+
>
|
|
24
|
+
{children}
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export { Header };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
import { Layout } from "./Layout";
|
|
4
|
+
import { Header } from "./Header";
|
|
5
|
+
import { Sider } from "./Sider";
|
|
6
|
+
import { Content } from "./Content";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
const meta: Meta = {
|
|
10
|
+
title: "Library/Components/Layout",
|
|
11
|
+
parameters: {
|
|
12
|
+
layout: 'fullscreen',
|
|
13
|
+
},
|
|
14
|
+
render: ({ header, sider }) => (
|
|
15
|
+
<Layout>
|
|
16
|
+
{header && (
|
|
17
|
+
<Header className="bg-[var(--border-color)]">
|
|
18
|
+
1
|
|
19
|
+
</Header>
|
|
20
|
+
)}
|
|
21
|
+
|
|
22
|
+
<Layout withSider>
|
|
23
|
+
{sider && (
|
|
24
|
+
<Sider className="bg-[var(--secondary-button-color)] min-w-[200px] h-[400px]">
|
|
25
|
+
2
|
|
26
|
+
</Sider>
|
|
27
|
+
)}
|
|
28
|
+
|
|
29
|
+
<Content className="bg-[var(--primary-button-color)] !h-[240px]">
|
|
30
|
+
3
|
|
31
|
+
</Content>
|
|
32
|
+
</Layout>
|
|
33
|
+
</Layout>
|
|
34
|
+
),
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export default meta;
|
|
38
|
+
|
|
39
|
+
type Story = StoryObj;
|
|
40
|
+
|
|
41
|
+
export const Default: Story = {
|
|
42
|
+
argTypes: {
|
|
43
|
+
header: {
|
|
44
|
+
control: 'boolean',
|
|
45
|
+
},
|
|
46
|
+
sider: {
|
|
47
|
+
control: 'boolean',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
args: {
|
|
51
|
+
header: true,
|
|
52
|
+
sider: true,
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import "./index.css";
|
|
4
|
+
|
|
5
|
+
type LayoutProps = {
|
|
6
|
+
id?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
withSider?: boolean;
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const Layout = ({
|
|
13
|
+
id,
|
|
14
|
+
className,
|
|
15
|
+
withSider,
|
|
16
|
+
children,
|
|
17
|
+
}: LayoutProps) => {
|
|
18
|
+
return (
|
|
19
|
+
<div
|
|
20
|
+
id={id}
|
|
21
|
+
className={classNames(
|
|
22
|
+
"gyramais-layout",
|
|
23
|
+
withSider ? 'gyramais-layout-with-sider' : '',
|
|
24
|
+
className,
|
|
25
|
+
)}
|
|
26
|
+
>
|
|
27
|
+
{children}
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export { Layout };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import "./index.css";
|
|
4
|
+
|
|
5
|
+
type SiderProps = {
|
|
6
|
+
id?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const Sider = ({
|
|
12
|
+
id,
|
|
13
|
+
className,
|
|
14
|
+
children,
|
|
15
|
+
}: SiderProps) => {
|
|
16
|
+
return (
|
|
17
|
+
<div
|
|
18
|
+
id={id}
|
|
19
|
+
className={classNames(
|
|
20
|
+
"gyramais-layout-sider",
|
|
21
|
+
className,
|
|
22
|
+
)}
|
|
23
|
+
>
|
|
24
|
+
{children}
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export { Sider };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
.gyramais-layout {
|
|
2
|
+
@apply
|
|
3
|
+
flex
|
|
4
|
+
flex-col
|
|
5
|
+
h-full;
|
|
6
|
+
}
|
|
7
|
+
.gyramais-layout.gyramais-layout-with-sider {
|
|
8
|
+
@apply
|
|
9
|
+
flex-row;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.gyramais-layout-content {
|
|
13
|
+
@apply
|
|
14
|
+
w-full
|
|
15
|
+
h-fit
|
|
16
|
+
max-w-[1440px]
|
|
17
|
+
m-auto
|
|
18
|
+
p-4;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.gyramais-layout-header {
|
|
22
|
+
@apply
|
|
23
|
+
sticky
|
|
24
|
+
w-full
|
|
25
|
+
h-fit
|
|
26
|
+
top-0
|
|
27
|
+
p-4
|
|
28
|
+
z-[90];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.gyramais-layout-sider {
|
|
32
|
+
@apply
|
|
33
|
+
sticky
|
|
34
|
+
top-0
|
|
35
|
+
px-4
|
|
36
|
+
py-8;
|
|
37
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
import { List } from "./List";
|
|
4
|
+
|
|
5
|
+
import SettingsIcon from '@mui/icons-material/Settings';
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof List> = {
|
|
8
|
+
title: "Library/Components/List",
|
|
9
|
+
component: List,
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: 'padded',
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default meta;
|
|
16
|
+
|
|
17
|
+
type Story = StoryObj<typeof List>;
|
|
18
|
+
|
|
19
|
+
export const Default: Story = {
|
|
20
|
+
args: {
|
|
21
|
+
id: '',
|
|
22
|
+
className: '',
|
|
23
|
+
data: [{
|
|
24
|
+
date: new Date(),
|
|
25
|
+
icon: (<SettingsIcon />),
|
|
26
|
+
title: 'Alteração nas configurações',
|
|
27
|
+
subtitle: 'Ajuste na cor do tema',
|
|
28
|
+
}, {
|
|
29
|
+
date: new Date(),
|
|
30
|
+
icon: (<SettingsIcon />),
|
|
31
|
+
title: 'Alteração nas configurações',
|
|
32
|
+
}, {
|
|
33
|
+
date: new Date(),
|
|
34
|
+
icon: (<SettingsIcon />),
|
|
35
|
+
title: 'Alteração no permissionamento',
|
|
36
|
+
subtitle: 'Usuários podem remover clientes',
|
|
37
|
+
}],
|
|
38
|
+
},
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const WithoutIcon: Story = {
|
|
42
|
+
args: {
|
|
43
|
+
id: '',
|
|
44
|
+
className: '',
|
|
45
|
+
data: [{
|
|
46
|
+
date: new Date(),
|
|
47
|
+
title: 'Alteração nas configurações',
|
|
48
|
+
subtitle: 'Ajuste na cor do tema',
|
|
49
|
+
}, {
|
|
50
|
+
date: new Date(),
|
|
51
|
+
title: 'Alteração nas configurações',
|
|
52
|
+
}, {
|
|
53
|
+
date: new Date(),
|
|
54
|
+
title: 'Alteração no permissionamento',
|
|
55
|
+
subtitle: 'Usuários podem remover clientes',
|
|
56
|
+
}],
|
|
57
|
+
},
|
|
58
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import dayjs from 'dayjs';
|
|
3
|
+
import classNames from "classnames";
|
|
4
|
+
import { Row } from "../Row";
|
|
5
|
+
import { Col } from "../Col";
|
|
6
|
+
|
|
7
|
+
import "./index.css";
|
|
8
|
+
|
|
9
|
+
type ListProps = {
|
|
10
|
+
id?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
data?: Array<{
|
|
13
|
+
title: string;
|
|
14
|
+
subtitle?: string;
|
|
15
|
+
date: Date;
|
|
16
|
+
icon?: any;
|
|
17
|
+
}>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const formatDateToLong = (date: Date) => {
|
|
21
|
+
if (!date) {
|
|
22
|
+
return '';
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const translateDayOfWeek: {
|
|
26
|
+
[key: string]: string;
|
|
27
|
+
} = {
|
|
28
|
+
'Monday': 'Segunda-feira',
|
|
29
|
+
'Tuesday': 'Terça-feira',
|
|
30
|
+
'Wednesday': 'Quarta-feira',
|
|
31
|
+
'Thursday': 'Quinta-feira',
|
|
32
|
+
'Friday': 'Sexta-feira',
|
|
33
|
+
'Saturday': 'Sábado',
|
|
34
|
+
'Sunday': 'Domingo',
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const auxDate = new Date(date);
|
|
38
|
+
const referenceDate = new Date(
|
|
39
|
+
auxDate.getUTCFullYear(),
|
|
40
|
+
auxDate.getUTCMonth(),
|
|
41
|
+
auxDate.getUTCDate(),
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
const weekDayToLong = dayjs(referenceDate).format('dddd');
|
|
45
|
+
const weekDayToLongTranslated = translateDayOfWeek[weekDayToLong];
|
|
46
|
+
const dateToLongTranslated = referenceDate.toLocaleDateString('pt-BR', { day: 'numeric', month: 'long', year: 'numeric' });
|
|
47
|
+
|
|
48
|
+
return `${weekDayToLongTranslated}, ${dateToLongTranslated}`;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const List = ({
|
|
52
|
+
id,
|
|
53
|
+
className,
|
|
54
|
+
data = [],
|
|
55
|
+
}: ListProps) => {
|
|
56
|
+
return (
|
|
57
|
+
<Row
|
|
58
|
+
id={id}
|
|
59
|
+
className={classNames(
|
|
60
|
+
'gyramais-list',
|
|
61
|
+
className,
|
|
62
|
+
)}
|
|
63
|
+
columns={1}
|
|
64
|
+
>
|
|
65
|
+
{data.map((item, index) => (
|
|
66
|
+
<Col span={1} key={index} className="gyramais-list-item">
|
|
67
|
+
{item.icon && (
|
|
68
|
+
<div className="gyramais-list-item-icon">
|
|
69
|
+
{item.icon}
|
|
70
|
+
</div>
|
|
71
|
+
)}
|
|
72
|
+
|
|
73
|
+
<Row columns={2} align="center" gap={8}>
|
|
74
|
+
<Col span={{ mobile: 2, desktop: 1 }}>
|
|
75
|
+
<Row columns={1}>
|
|
76
|
+
<Col span={1} className="gyramais-list-item-title">
|
|
77
|
+
{item.title}
|
|
78
|
+
</Col>
|
|
79
|
+
|
|
80
|
+
{item.subtitle && (
|
|
81
|
+
<Col span={1} className="gyramais-list-item-description">
|
|
82
|
+
{item.subtitle}
|
|
83
|
+
</Col>
|
|
84
|
+
)}
|
|
85
|
+
</Row>
|
|
86
|
+
</Col>
|
|
87
|
+
|
|
88
|
+
<Col span={{ mobile: 2, desktop: 1 }} className="gyramais-list-item-date">
|
|
89
|
+
{formatDateToLong(item.date)}
|
|
90
|
+
</Col>
|
|
91
|
+
</Row>
|
|
92
|
+
</Col>
|
|
93
|
+
))}
|
|
94
|
+
</Row>
|
|
95
|
+
);
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export { List };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
.gyramais-list .gyramais-list-item {
|
|
2
|
+
@apply
|
|
3
|
+
flex
|
|
4
|
+
items-center
|
|
5
|
+
px-6
|
|
6
|
+
py-4;
|
|
7
|
+
}
|
|
8
|
+
.gyramais-list .gyramais-list-item:nth-child(even) {
|
|
9
|
+
@apply
|
|
10
|
+
bg-[#F6F8F7];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.gyramais-list .gyramais-list-item-icon {
|
|
14
|
+
@apply
|
|
15
|
+
min-h-[40px]
|
|
16
|
+
min-w-[40px]
|
|
17
|
+
h-10
|
|
18
|
+
w-10
|
|
19
|
+
flex
|
|
20
|
+
items-center
|
|
21
|
+
justify-center
|
|
22
|
+
mr-3
|
|
23
|
+
rounded-full
|
|
24
|
+
bg-[var(--dark-button-color)]
|
|
25
|
+
}
|
|
26
|
+
.gyramais-list .gyramais-list-item-icon svg {
|
|
27
|
+
@apply
|
|
28
|
+
text-[24px]
|
|
29
|
+
text-[var(--primary-button-color)];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.gyramais-list .gyramais-list-item-title {
|
|
33
|
+
@apply
|
|
34
|
+
font-semibold
|
|
35
|
+
text-base
|
|
36
|
+
leading-5;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.gyramais-list .gyramais-list-item-description {
|
|
40
|
+
@apply
|
|
41
|
+
text-xs
|
|
42
|
+
text-[#5C7263]
|
|
43
|
+
leading-4;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.gyramais-list .gyramais-list-item-date {
|
|
47
|
+
@apply
|
|
48
|
+
w-full
|
|
49
|
+
text-start
|
|
50
|
+
text-sm
|
|
51
|
+
text-[#3E4C42]
|
|
52
|
+
|
|
53
|
+
md:text-end;
|
|
54
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./List";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Loading } from "./Loading";
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Loading> = {
|
|
5
|
+
title: "Library/Components/Loading",
|
|
6
|
+
component: Loading,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'centered',
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default meta;
|
|
13
|
+
|
|
14
|
+
type Story = StoryObj<typeof Loading>;
|
|
15
|
+
|
|
16
|
+
export const Default: Story = {
|
|
17
|
+
args: {
|
|
18
|
+
id: '',
|
|
19
|
+
className: '',
|
|
20
|
+
size: 40,
|
|
21
|
+
color: 'var(--primary-button-color)',
|
|
22
|
+
},
|
|
23
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import "./index.css";
|
|
4
|
+
|
|
5
|
+
type LoadingProps = {
|
|
6
|
+
id?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
size?: number;
|
|
9
|
+
color?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const Loading = ({
|
|
13
|
+
id,
|
|
14
|
+
className,
|
|
15
|
+
size = 40,
|
|
16
|
+
color = 'var(--primary-button-color)',
|
|
17
|
+
}: LoadingProps) => {
|
|
18
|
+
return (
|
|
19
|
+
<div
|
|
20
|
+
id={id}
|
|
21
|
+
className={classNames(
|
|
22
|
+
"gyramais-loading",
|
|
23
|
+
className,
|
|
24
|
+
)}
|
|
25
|
+
style={{
|
|
26
|
+
width: size,
|
|
27
|
+
height: size,
|
|
28
|
+
}}
|
|
29
|
+
>
|
|
30
|
+
<div
|
|
31
|
+
style={{
|
|
32
|
+
width: size,
|
|
33
|
+
height: size,
|
|
34
|
+
borderWidth: Math.max((size / 10) - 1, 2),
|
|
35
|
+
borderColor: `${color} ${color} transparent transparent`,
|
|
36
|
+
}}
|
|
37
|
+
/>
|
|
38
|
+
|
|
39
|
+
<div
|
|
40
|
+
style={{
|
|
41
|
+
width: size,
|
|
42
|
+
height: size,
|
|
43
|
+
borderWidth: Math.max((size / 10) - 1, 2),
|
|
44
|
+
borderColor: `${color} ${color} transparent transparent`,
|
|
45
|
+
}}
|
|
46
|
+
/>
|
|
47
|
+
</div>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export { Loading };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
.gyramais-loading {
|
|
2
|
+
@apply
|
|
3
|
+
relative;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.gyramais-loading div {
|
|
7
|
+
@apply
|
|
8
|
+
box-border
|
|
9
|
+
block
|
|
10
|
+
absolute
|
|
11
|
+
border-solid
|
|
12
|
+
rounded-[50%]
|
|
13
|
+
animate-[lds-ring_1s_cubic-bezier(1,1,1,1)_infinite];
|
|
14
|
+
}
|
|
15
|
+
.gyramais-loading div:nth-child(1) {
|
|
16
|
+
@apply
|
|
17
|
+
animate-[lds-ring-1_1.2s_cubic-bezier(0.5,0,0.5,1)_infinite];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@keyframes lds-ring {
|
|
21
|
+
0% {
|
|
22
|
+
transform: rotate(0deg);
|
|
23
|
+
}
|
|
24
|
+
100% {
|
|
25
|
+
transform: rotate(360deg);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@keyframes lds-ring-1 {
|
|
30
|
+
0% {
|
|
31
|
+
transform: rotate(0deg) scale(.73);
|
|
32
|
+
}
|
|
33
|
+
100% {
|
|
34
|
+
transform: rotate(360deg) scale(.73);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Loading";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Logo } from "./Logo";
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Logo> = {
|
|
5
|
+
title: "Library/Components/Logo",
|
|
6
|
+
component: Logo,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'centered',
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default meta;
|
|
13
|
+
|
|
14
|
+
type Story = StoryObj<typeof Logo>;
|
|
15
|
+
|
|
16
|
+
export const Dark: Story = {
|
|
17
|
+
args: {
|
|
18
|
+
id: '',
|
|
19
|
+
className: '',
|
|
20
|
+
type: 'dark',
|
|
21
|
+
width: '400',
|
|
22
|
+
height: 'auto',
|
|
23
|
+
},
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const White: Story = {
|
|
27
|
+
args: {
|
|
28
|
+
id: '',
|
|
29
|
+
className: '',
|
|
30
|
+
type: 'white',
|
|
31
|
+
width: '400',
|
|
32
|
+
height: 'auto',
|
|
33
|
+
},
|
|
34
|
+
}
|