@gyramais/gyra-design 0.1.0 → 0.1.2
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/dist/components/Avatar/Avatar.d.ts +10 -0
- package/dist/components/Avatar/index.d.ts +1 -0
- package/dist/components/Avatar/index.js +7 -0
- package/dist/components/Avatar/index.js.map +1 -0
- package/dist/components/Button/Button.d.ts +18 -0
- package/dist/components/Button/index.d.ts +1 -0
- package/dist/components/Button/index.js +7 -0
- package/dist/components/Button/index.js.map +1 -0
- package/dist/components/Card/Card.d.ts +17 -0
- package/dist/components/Card/index.d.ts +1 -0
- package/dist/components/Card/index.js +37 -0
- package/dist/components/Card/index.js.map +1 -0
- package/dist/components/Chart/Chart.d.ts +26 -0
- package/dist/components/Chart/index.d.ts +1 -0
- package/dist/components/Chart/index.js +28 -0
- package/dist/components/Chart/index.js.map +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +12 -0
- package/dist/components/Checkbox/index.d.ts +1 -0
- package/dist/components/Checkbox/index.js +37 -0
- package/dist/components/Checkbox/index.js.map +1 -0
- package/dist/components/Col/Col.d.ts +17 -0
- package/dist/components/Col/index.d.ts +1 -0
- package/dist/components/Col/index.js +7 -0
- package/dist/components/Col/index.js.map +1 -0
- package/dist/components/Collapse/Collapse.d.ts +10 -0
- package/dist/components/Collapse/CollapseIcon.d.ts +10 -0
- package/dist/components/Collapse/index.d.ts +2 -0
- package/dist/components/Collapse/index.js +37 -0
- package/dist/components/Collapse/index.js.map +1 -0
- package/dist/components/Divider/Divider.d.ts +10 -0
- package/dist/components/Divider/index.d.ts +1 -0
- package/dist/components/Divider/index.js +7 -0
- package/dist/components/Divider/index.js.map +1 -0
- package/dist/components/Drawer/Drawer.d.ts +11 -0
- package/dist/components/Drawer/index.d.ts +1 -0
- package/dist/components/Drawer/index.js +7 -0
- package/dist/components/Drawer/index.js.map +1 -0
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +21 -0
- package/dist/components/DropdownMenu/index.d.ts +1 -0
- package/dist/components/DropdownMenu/index.js +7 -0
- package/dist/components/DropdownMenu/index.js.map +1 -0
- package/dist/components/Filter/Filter.d.ts +22 -0
- package/dist/components/Filter/index.d.ts +1 -0
- package/dist/components/Filter/index.js +37 -0
- package/dist/components/Filter/index.js.map +1 -0
- package/dist/components/Form/Form.d.ts +3 -0
- package/dist/components/Form/Item.d.ts +11 -0
- package/dist/components/Form/index.d.ts +1 -0
- package/dist/components/Form/index.js +2 -0
- package/dist/components/Form/index.js.map +1 -0
- package/dist/components/HoverCard/HoverCard.d.ts +14 -0
- package/dist/components/HoverCard/index.d.ts +1 -0
- package/dist/components/HoverCard/index.js +7 -0
- package/dist/components/HoverCard/index.js.map +1 -0
- package/dist/components/Icon/Icon.d.ts +10 -0
- package/dist/components/Icon/index.d.ts +1 -0
- package/dist/components/Icon/index.js +7 -0
- package/dist/components/Icon/index.js.map +1 -0
- package/dist/components/IconDisplay/IconDisplay.d.ts +9 -0
- package/dist/components/IconDisplay/index.d.ts +1 -0
- package/dist/components/IconDisplay/index.js +7 -0
- package/dist/components/IconDisplay/index.js.map +1 -0
- package/dist/components/Information/Information.d.ts +10 -0
- package/dist/components/Information/index.d.ts +1 -0
- package/dist/components/Information/index.js +7 -0
- package/dist/components/Information/index.js.map +1 -0
- package/dist/components/Input/Input.d.ts +17 -0
- package/dist/components/Input/index.d.ts +1 -0
- package/dist/components/Input/index.js +7 -0
- package/dist/components/Input/index.js.map +1 -0
- package/dist/components/Label/Label.d.ts +5 -0
- package/dist/components/Label/index.d.ts +1 -0
- package/dist/components/Label/index.js +2 -0
- package/dist/components/Label/index.js.map +1 -0
- package/dist/components/Layout/Content.d.ts +9 -0
- package/dist/components/Layout/Header.d.ts +9 -0
- package/dist/components/Layout/Layout.d.ts +10 -0
- package/dist/components/Layout/Sider.d.ts +9 -0
- package/{src/components/Layout/index.ts → dist/components/Layout/index.d.ts} +1 -1
- package/dist/components/Layout/index.js +7 -0
- package/dist/components/Layout/index.js.map +1 -0
- package/dist/components/List/List.d.ts +14 -0
- package/dist/components/List/index.d.ts +1 -0
- package/dist/components/List/index.js +8 -0
- package/dist/components/List/index.js.map +1 -0
- package/dist/components/Loading/Loading.d.ts +10 -0
- package/dist/components/Loading/index.d.ts +1 -0
- package/dist/components/Loading/index.js +7 -0
- package/dist/components/Loading/index.js.map +1 -0
- package/dist/components/Logo/Logo.d.ts +11 -0
- package/dist/components/Logo/index.d.ts +1 -0
- package/dist/components/Logo/index.js +7 -0
- package/dist/components/Logo/index.js.map +1 -0
- package/dist/components/Menubar/Menubar.d.ts +24 -0
- package/dist/components/Menubar/index.d.ts +1 -0
- package/dist/components/Menubar/index.js +7 -0
- package/dist/components/Menubar/index.js.map +1 -0
- package/dist/components/Row/Row.d.ts +18 -0
- package/dist/components/Row/index.d.ts +1 -0
- package/dist/components/Row/index.js +7 -0
- package/dist/components/Row/index.js.map +1 -0
- package/dist/components/Switch/Switch.d.ts +11 -0
- package/dist/components/Switch/index.d.ts +1 -0
- package/dist/components/Switch/index.js +7 -0
- package/dist/components/Switch/index.js.map +1 -0
- package/dist/components/Table/Table.d.ts +20 -0
- package/dist/components/Table/index.d.ts +1 -0
- package/dist/components/Table/index.js +37 -0
- package/dist/components/Table/index.js.map +1 -0
- package/dist/components/Tabs/Tabs.d.ts +15 -0
- package/dist/components/Tabs/index.d.ts +1 -0
- package/dist/components/Tabs/index.js +7 -0
- package/dist/components/Tabs/index.js.map +1 -0
- package/dist/components/Tag/Tag.d.ts +10 -0
- package/dist/components/Tag/index.d.ts +1 -0
- package/dist/components/Tag/index.js +7 -0
- package/dist/components/Tag/index.js.map +1 -0
- package/dist/components/Toast/Toast.d.ts +4 -0
- package/dist/components/Toast/index.d.ts +1 -0
- package/dist/components/Toast/index.js +2 -0
- package/dist/components/Toast/index.js.map +1 -0
- package/dist/components/Tooltip/Tooltip.d.ts +14 -0
- package/dist/components/Tooltip/index.d.ts +1 -0
- package/dist/components/Tooltip/index.js +7 -0
- package/dist/components/Tooltip/index.js.map +1 -0
- package/dist/index.css +3778 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js.map +1 -0
- package/dist/shadcn/checkbox.d.ts +4 -0
- package/dist/shadcn/dropdown-menu.d.ts +27 -0
- package/dist/shadcn/form.d.ts +22 -0
- package/dist/shadcn/hover-card.d.ts +6 -0
- package/dist/shadcn/label.d.ts +5 -0
- package/dist/shadcn/lib/utils.d.ts +2 -0
- package/dist/shadcn/menubar.d.ts +31 -0
- package/dist/shadcn/switch.d.ts +4 -0
- package/dist/shadcn/table.d.ts +10 -0
- package/dist/shadcn/tabs.d.ts +7 -0
- package/dist/shadcn/tooltip.d.ts +7 -0
- package/dist/theme.d.ts +18 -0
- package/package.json +85 -82
- package/{README.md → readme.md} +31 -31
- package/.eslintrc.json +0 -14
- package/.storybook/main.ts +0 -20
- package/.storybook/preview.ts +0 -45
- package/postcss.config.js +0 -6
- package/rollup.config.js +0 -104
- package/scripts/build-utils.js +0 -16
- package/src/components/Avatar/Avatar.stories.tsx +0 -26
- package/src/components/Avatar/Avatar.tsx +0 -36
- package/src/components/Avatar/index.css +0 -9
- package/src/components/Avatar/index.ts +0 -1
- package/src/components/Button/Button.stories.tsx +0 -99
- package/src/components/Button/Button.tsx +0 -71
- package/src/components/Button/index.css +0 -168
- package/src/components/Button/index.ts +0 -1
- package/src/components/Card/Card.stories.tsx +0 -126
- package/src/components/Card/Card.tsx +0 -111
- package/src/components/Card/index.css +0 -96
- package/src/components/Card/index.ts +0 -1
- package/src/components/Chart/Chart.stories.tsx +0 -61
- package/src/components/Chart/Chart.tsx +0 -192
- package/src/components/Chart/index.css +0 -15
- package/src/components/Chart/index.ts +0 -1
- package/src/components/Checkbox/Checkbox.stories.tsx +0 -46
- package/src/components/Checkbox/Checkbox.tsx +0 -46
- package/src/components/Checkbox/index.css +0 -29
- package/src/components/Checkbox/index.ts +0 -1
- package/src/components/Col/Col.stories.tsx +0 -33
- package/src/components/Col/Col.tsx +0 -45
- package/src/components/Col/index.css +0 -57
- package/src/components/Col/index.ts +0 -1
- package/src/components/Collapse/Collapse.stories.tsx +0 -86
- package/src/components/Collapse/Collapse.tsx +0 -34
- package/src/components/Collapse/CollapseIcon.tsx +0 -33
- package/src/components/Collapse/index.css +0 -14
- package/src/components/Collapse/index.ts +0 -2
- package/src/components/Divider/Divider.stories.tsx +0 -45
- package/src/components/Divider/Divider.tsx +0 -42
- package/src/components/Divider/index.css +0 -20
- package/src/components/Divider/index.ts +0 -1
- package/src/components/Drawer/Drawer.stories.tsx +0 -51
- package/src/components/Drawer/Drawer.tsx +0 -40
- package/src/components/Drawer/index.css +0 -15
- package/src/components/Drawer/index.ts +0 -1
- package/src/components/DropdownMenu/DropdownMenu.stories.tsx +0 -66
- package/src/components/DropdownMenu/DropdownMenu.tsx +0 -91
- package/src/components/DropdownMenu/index.css +0 -18
- package/src/components/DropdownMenu/index.ts +0 -1
- package/src/components/Filter/Filter.stories.tsx +0 -94
- package/src/components/Filter/Filter.tsx +0 -213
- package/src/components/Filter/index.css +0 -81
- package/src/components/Filter/index.ts +0 -1
- package/src/components/Form/Form.tsx +0 -11
- package/src/components/Form/Item.tsx +0 -33
- package/src/components/Form/index.css +0 -4
- package/src/components/Form/index.ts +0 -1
- package/src/components/HoverCard/HoverCard.stories.tsx +0 -48
- package/src/components/HoverCard/HoverCard.tsx +0 -54
- package/src/components/HoverCard/index.css +0 -15
- package/src/components/HoverCard/index.ts +0 -1
- package/src/components/Icon/Icon.stories.tsx +0 -23
- package/src/components/Icon/Icon.tsx +0 -36
- package/src/components/Icon/index.css +0 -3
- package/src/components/Icon/index.ts +0 -1
- package/src/components/IconDisplay/IconDisplay.stories.tsx +0 -27
- package/src/components/IconDisplay/IconDisplay.tsx +0 -29
- package/src/components/IconDisplay/index.css +0 -18
- package/src/components/IconDisplay/index.ts +0 -1
- package/src/components/Information/Information.stories.tsx +0 -25
- package/src/components/Information/Information.tsx +0 -50
- package/src/components/Information/index.css +0 -34
- package/src/components/Information/index.ts +0 -1
- package/src/components/Input/Input.stories.tsx +0 -38
- package/src/components/Input/Input.tsx +0 -91
- package/src/components/Input/index.css +0 -74
- package/src/components/Input/index.ts +0 -1
- package/src/components/Label/Label.tsx +0 -26
- package/src/components/Label/index.ts +0 -1
- package/src/components/Layout/Content.tsx +0 -29
- package/src/components/Layout/Header.tsx +0 -29
- package/src/components/Layout/Layout.stories.tsx +0 -54
- package/src/components/Layout/Layout.tsx +0 -32
- package/src/components/Layout/Sider.tsx +0 -29
- package/src/components/Layout/index.css +0 -37
- package/src/components/List/List.stories.tsx +0 -58
- package/src/components/List/List.tsx +0 -98
- package/src/components/List/index.css +0 -54
- package/src/components/List/index.ts +0 -1
- package/src/components/Loading/Loading.stories.tsx +0 -23
- package/src/components/Loading/Loading.tsx +0 -51
- package/src/components/Loading/index.css +0 -36
- package/src/components/Loading/index.ts +0 -1
- package/src/components/Logo/Logo.stories.tsx +0 -34
- package/src/components/Logo/Logo.tsx +0 -39
- package/src/components/Logo/index.css +0 -9
- package/src/components/Logo/index.ts +0 -1
- package/src/components/Menubar/Menubar.stories.tsx +0 -55
- package/src/components/Menubar/Menubar.tsx +0 -118
- package/src/components/Menubar/index.css +0 -96
- package/src/components/Menubar/index.ts +0 -1
- package/src/components/Row/Row.stories.tsx +0 -33
- package/src/components/Row/Row.tsx +0 -48
- package/src/components/Row/index.css +0 -116
- package/src/components/Row/index.ts +0 -1
- package/src/components/Switch/Switch.stories.tsx +0 -39
- package/src/components/Switch/Switch.tsx +0 -36
- package/src/components/Switch/index.css +0 -37
- package/src/components/Switch/index.ts +0 -1
- package/src/components/Table/Table.stories.tsx +0 -85
- package/src/components/Table/Table.tsx +0 -123
- package/src/components/Table/index.css +0 -74
- package/src/components/Table/index.ts +0 -1
- package/src/components/Tabs/Tabs.stories.tsx +0 -49
- package/src/components/Tabs/Tabs.tsx +0 -76
- package/src/components/Tabs/index.css +0 -89
- package/src/components/Tabs/index.ts +0 -1
- package/src/components/Tag/Tag.stories.tsx +0 -41
- package/src/components/Tag/Tag.tsx +0 -39
- package/src/components/Tag/index.css +0 -31
- package/src/components/Tag/index.ts +0 -1
- package/src/components/Text/Text.stories.tsx +0 -41
- package/src/components/Toast/Toast.stories.tsx +0 -47
- package/src/components/Toast/Toast.tsx +0 -13
- package/src/components/Toast/index.ts +0 -1
- package/src/components/Tooltip/Tooltip.stories.tsx +0 -44
- package/src/components/Tooltip/Tooltip.tsx +0 -60
- package/src/components/Tooltip/index.css +0 -15
- package/src/components/Tooltip/index.ts +0 -1
- package/src/index.css +0 -176
- package/src/index.ts +0 -38
- package/src/shadcn/checkbox.tsx +0 -28
- package/src/shadcn/dropdown-menu.tsx +0 -200
- package/src/shadcn/form.tsx +0 -178
- package/src/shadcn/hover-card.tsx +0 -31
- package/src/shadcn/label.tsx +0 -26
- package/src/shadcn/lib/utils.ts +0 -6
- package/src/shadcn/menubar.tsx +0 -248
- package/src/shadcn/switch.tsx +0 -25
- package/src/shadcn/table.tsx +0 -117
- package/src/shadcn/tabs.tsx +0 -55
- package/src/shadcn/tooltip.tsx +0 -30
- package/src/theme.ts +0 -123
- package/tailwind.config.js +0 -9
- package/tsconfig.json +0 -32
|
@@ -1,98 +0,0 @@
|
|
|
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 };
|
|
@@ -1,54 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./List";
|
|
@@ -1,23 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
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 };
|
|
@@ -1,36 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Loading";
|
|
@@ -1,34 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import classNames from "classnames";
|
|
3
|
-
import "./index.css";
|
|
4
|
-
|
|
5
|
-
type LogoProps = {
|
|
6
|
-
id?: string;
|
|
7
|
-
className?: string;
|
|
8
|
-
type?: "dark" | "white" | "background-contrasted";
|
|
9
|
-
width?: number | string;
|
|
10
|
-
height?: number | string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const Logo = ({
|
|
14
|
-
id,
|
|
15
|
-
className,
|
|
16
|
-
type = 'dark',
|
|
17
|
-
width,
|
|
18
|
-
height,
|
|
19
|
-
}: LogoProps) => {
|
|
20
|
-
return (
|
|
21
|
-
<img
|
|
22
|
-
id={id}
|
|
23
|
-
className={classNames(
|
|
24
|
-
'gyramais-logo',
|
|
25
|
-
`gyramais-logo-${type}`,
|
|
26
|
-
className,
|
|
27
|
-
)}
|
|
28
|
-
style={{
|
|
29
|
-
width,
|
|
30
|
-
height,
|
|
31
|
-
}}
|
|
32
|
-
width={width}
|
|
33
|
-
height={height}
|
|
34
|
-
alt="Logo"
|
|
35
|
-
/>
|
|
36
|
-
);
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export { Logo };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Logo";
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { Menubar } from "./Menubar";
|
|
3
|
-
|
|
4
|
-
const meta: Meta<typeof Menubar> = {
|
|
5
|
-
title: "Library/Components/Menubar",
|
|
6
|
-
component: Menubar,
|
|
7
|
-
parameters: {
|
|
8
|
-
layout: 'padded',
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export default meta;
|
|
13
|
-
|
|
14
|
-
type Story = StoryObj<typeof Menubar>;
|
|
15
|
-
|
|
16
|
-
export const Default: Story = {
|
|
17
|
-
args: {
|
|
18
|
-
id: '',
|
|
19
|
-
className: '',
|
|
20
|
-
borderless: false,
|
|
21
|
-
orientation: 'horizontal',
|
|
22
|
-
onClick: (key: string) => {},
|
|
23
|
-
activeKey: '',
|
|
24
|
-
items: [{
|
|
25
|
-
key: 'home',
|
|
26
|
-
title: 'Página inicial',
|
|
27
|
-
items: [{
|
|
28
|
-
key: 'loans',
|
|
29
|
-
title: 'Empréstimos',
|
|
30
|
-
}, {
|
|
31
|
-
key: 'prepayments',
|
|
32
|
-
title: 'Antecipações',
|
|
33
|
-
disabled: true,
|
|
34
|
-
}]
|
|
35
|
-
}, {
|
|
36
|
-
key: 'plain',
|
|
37
|
-
title: 'Plano',
|
|
38
|
-
disabled: true,
|
|
39
|
-
}, {
|
|
40
|
-
separator: true,
|
|
41
|
-
}, {
|
|
42
|
-
key: 'profile',
|
|
43
|
-
title: 'Perfil',
|
|
44
|
-
items: [{
|
|
45
|
-
key: 'user',
|
|
46
|
-
title: 'Usuário',
|
|
47
|
-
}, {
|
|
48
|
-
separator: true,
|
|
49
|
-
}, {
|
|
50
|
-
key: 'business',
|
|
51
|
-
title: 'Empresa',
|
|
52
|
-
}]
|
|
53
|
-
}],
|
|
54
|
-
},
|
|
55
|
-
}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useState } from "react";
|
|
2
|
-
import classNames from "classnames";
|
|
3
|
-
import "./index.css";
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
Menubar as PrimitiveMenubar,
|
|
7
|
-
MenubarContent,
|
|
8
|
-
MenubarItem,
|
|
9
|
-
MenubarMenu,
|
|
10
|
-
MenubarSeparator,
|
|
11
|
-
MenubarTrigger,
|
|
12
|
-
} from "../../shadcn/menubar"
|
|
13
|
-
|
|
14
|
-
type MenubarProps = {
|
|
15
|
-
id?: string;
|
|
16
|
-
className?: string;
|
|
17
|
-
borderless?: boolean;
|
|
18
|
-
orientation?: 'horizontal' | 'vertical';
|
|
19
|
-
activeKey?: string;
|
|
20
|
-
items?: Array<{
|
|
21
|
-
key?: string;
|
|
22
|
-
title?: string | React.ReactNode;
|
|
23
|
-
disabled?: boolean;
|
|
24
|
-
separator?: boolean;
|
|
25
|
-
items?: Array<{
|
|
26
|
-
key?: string;
|
|
27
|
-
title?: string | React.ReactNode;
|
|
28
|
-
disabled?: boolean;
|
|
29
|
-
separator?: boolean;
|
|
30
|
-
}>;
|
|
31
|
-
}>;
|
|
32
|
-
onClick?: (key: string) => void;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const Menubar = ({
|
|
36
|
-
id,
|
|
37
|
-
className,
|
|
38
|
-
borderless = false,
|
|
39
|
-
orientation = 'horizontal',
|
|
40
|
-
activeKey = '',
|
|
41
|
-
items = [],
|
|
42
|
-
onClick,
|
|
43
|
-
}: MenubarProps) => {
|
|
44
|
-
const [internalActiveKey, setInternalActiveKey] = useState(activeKey);
|
|
45
|
-
|
|
46
|
-
useEffect(() => {
|
|
47
|
-
setInternalActiveKey(activeKey);
|
|
48
|
-
}, [activeKey]);
|
|
49
|
-
return (
|
|
50
|
-
<PrimitiveMenubar
|
|
51
|
-
id={id}
|
|
52
|
-
className={classNames(
|
|
53
|
-
"gyramais-menubar",
|
|
54
|
-
`gyramais-menubar-${orientation}`,
|
|
55
|
-
borderless ? 'gyramais-menubar-borderless' : '',
|
|
56
|
-
className,
|
|
57
|
-
)}
|
|
58
|
-
>
|
|
59
|
-
{items.map((item, index) => item.separator ? (
|
|
60
|
-
<MenubarSeparator
|
|
61
|
-
key={`separator-${index}`}
|
|
62
|
-
aria-orientation={orientation === 'horizontal' ? "vertical" : "horizontal"} className="gyramais-menubar-separator"
|
|
63
|
-
/>
|
|
64
|
-
) : (
|
|
65
|
-
<MenubarMenu key={`menu-${index}`}>
|
|
66
|
-
<MenubarTrigger
|
|
67
|
-
className={classNames(
|
|
68
|
-
'gyramais-menubar-option',
|
|
69
|
-
item.key === internalActiveKey ? 'gyramais-menubar-option-selected' : '',
|
|
70
|
-
)}
|
|
71
|
-
onClick={() => {
|
|
72
|
-
if (item.key) {
|
|
73
|
-
if (!activeKey && item.key) {
|
|
74
|
-
setInternalActiveKey(item.key);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
onClick?.(item.key);
|
|
78
|
-
}
|
|
79
|
-
}}
|
|
80
|
-
disabled={item.disabled}
|
|
81
|
-
>
|
|
82
|
-
{item.title}
|
|
83
|
-
</MenubarTrigger>
|
|
84
|
-
|
|
85
|
-
{!item.disabled
|
|
86
|
-
&& Array.isArray(item.items)
|
|
87
|
-
&& item.items.length > 0
|
|
88
|
-
&& (
|
|
89
|
-
<MenubarContent className="gyramais-menubar-content" side={orientation === 'horizontal' ? 'bottom' : 'right'}>
|
|
90
|
-
{item.items.map((subitem, index) => subitem.separator ? (
|
|
91
|
-
<MenubarSeparator
|
|
92
|
-
key={`sub-separator-${index}`}
|
|
93
|
-
aria-orientation="horizontal"
|
|
94
|
-
className="gyramais-menubar-separator submenu-separator"
|
|
95
|
-
/>
|
|
96
|
-
) : (
|
|
97
|
-
<MenubarItem
|
|
98
|
-
key={`sub-menu-${index}`}
|
|
99
|
-
className="gyramais-menubar-sub-option"
|
|
100
|
-
onClick={() => {
|
|
101
|
-
if (subitem.key) {
|
|
102
|
-
onClick?.(subitem.key);
|
|
103
|
-
}
|
|
104
|
-
}}
|
|
105
|
-
disabled={subitem.disabled}
|
|
106
|
-
>
|
|
107
|
-
{subitem.title}
|
|
108
|
-
</MenubarItem>
|
|
109
|
-
))}
|
|
110
|
-
</MenubarContent>
|
|
111
|
-
)}
|
|
112
|
-
</MenubarMenu>
|
|
113
|
-
))}
|
|
114
|
-
</PrimitiveMenubar>
|
|
115
|
-
);
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
export { Menubar };
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
.gyramais-menubar {
|
|
2
|
-
@apply
|
|
3
|
-
w-fit
|
|
4
|
-
bg-white;
|
|
5
|
-
}
|
|
6
|
-
.gyramais-menubar.gyramais-menubar-vertical {
|
|
7
|
-
@apply
|
|
8
|
-
flex-col
|
|
9
|
-
h-fit;
|
|
10
|
-
}
|
|
11
|
-
.gyramais-menubar.gyramais-menubar-borderless {
|
|
12
|
-
@apply
|
|
13
|
-
border-none;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.gyramais-menubar-option {
|
|
17
|
-
@apply
|
|
18
|
-
rounded-[4px]
|
|
19
|
-
duration-300
|
|
20
|
-
text-[#4F5762];
|
|
21
|
-
}
|
|
22
|
-
.gyramais-menubar-vertical .gyramais-menubar-option {
|
|
23
|
-
@apply
|
|
24
|
-
flex
|
|
25
|
-
w-full
|
|
26
|
-
items-center
|
|
27
|
-
justify-center
|
|
28
|
-
!mr-0
|
|
29
|
-
!ml-0
|
|
30
|
-
}
|
|
31
|
-
.gyramais-menubar-vertical .gyramais-menubar-option + .gyramais-menubar-option {
|
|
32
|
-
@apply
|
|
33
|
-
mt-2;
|
|
34
|
-
}
|
|
35
|
-
.gyramais-menubar-option-selected {
|
|
36
|
-
@apply
|
|
37
|
-
!bg-[var(--dark-button-color)]
|
|
38
|
-
!text-[var(--primary-button-color)]
|
|
39
|
-
}
|
|
40
|
-
.gyramais-menubar-option:disabled {
|
|
41
|
-
@apply
|
|
42
|
-
opacity-50
|
|
43
|
-
!bg-transparent
|
|
44
|
-
!text-black
|
|
45
|
-
}
|
|
46
|
-
.gyramais-menubar-option:not(:disabled) {
|
|
47
|
-
@apply
|
|
48
|
-
cursor-pointer
|
|
49
|
-
hover:!bg-[var(--dark-button-color)]
|
|
50
|
-
hover:!text-[var(--primary-button-color)]
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.gyramais-menubar-sub-option {
|
|
54
|
-
@apply
|
|
55
|
-
rounded-none
|
|
56
|
-
duration-300;
|
|
57
|
-
}
|
|
58
|
-
.gyramais-menubar-sub-option:disabled {
|
|
59
|
-
@apply
|
|
60
|
-
opacity-50
|
|
61
|
-
}
|
|
62
|
-
.gyramais-menubar-sub-option:not(:disabled) {
|
|
63
|
-
@apply
|
|
64
|
-
cursor-pointer
|
|
65
|
-
hover:!bg-[var(--primary-button-color)]
|
|
66
|
-
hover:!text-[var(--primary-button-text-color)]
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.gyramais-menubar-content {
|
|
70
|
-
@apply
|
|
71
|
-
!bg-white;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.gyramais-menubar-separator[aria-orientation="vertical"] {
|
|
75
|
-
@apply
|
|
76
|
-
h-full
|
|
77
|
-
w-[1px]
|
|
78
|
-
bg-[var(--border-color)];
|
|
79
|
-
}
|
|
80
|
-
.gyramais-menubar-separator[aria-orientation="horizontal"] {
|
|
81
|
-
@apply
|
|
82
|
-
bg-[var(--border-color)];
|
|
83
|
-
}
|
|
84
|
-
.gyramais-menubar-vertical .gyramais-menubar-separator[aria-orientation="horizontal"] {
|
|
85
|
-
@apply
|
|
86
|
-
!mr-0
|
|
87
|
-
!ml-0
|
|
88
|
-
mb-2
|
|
89
|
-
mt-2
|
|
90
|
-
}
|
|
91
|
-
.gyramais-menubar-separator[aria-orientation="horizontal"]:not(.submenu-separator) {
|
|
92
|
-
@apply
|
|
93
|
-
h-[1px]
|
|
94
|
-
w-full
|
|
95
|
-
bg-[var(--border-color)];
|
|
96
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Menubar";
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
-
import { Col } from "../Col";
|
|
4
|
-
import { Row } from "./Row";
|
|
5
|
-
|
|
6
|
-
const meta: Meta<typeof Row> = {
|
|
7
|
-
title: "Library/Components/Row",
|
|
8
|
-
component: Row,
|
|
9
|
-
parameters: {
|
|
10
|
-
layout: 'padded',
|
|
11
|
-
},
|
|
12
|
-
render: ({ columns, gap, align }) => (
|
|
13
|
-
<Row columns={columns} gap={gap} align={align}>
|
|
14
|
-
{Array.from({ length: columns || 3 }).map((_, index) => (
|
|
15
|
-
<Col span={1} className={`${index % 2 === 0 ? 'h-32' : 'h-14'} rounded-md bg-[var(--background-color)]`} />
|
|
16
|
-
))}
|
|
17
|
-
</Row>
|
|
18
|
-
),
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export default meta;
|
|
22
|
-
|
|
23
|
-
type Story = StoryObj<typeof Row>;
|
|
24
|
-
|
|
25
|
-
export const Default: Story = {
|
|
26
|
-
args: {
|
|
27
|
-
id: '',
|
|
28
|
-
className: '',
|
|
29
|
-
columns: 4,
|
|
30
|
-
gap: 16,
|
|
31
|
-
align: 'start',
|
|
32
|
-
},
|
|
33
|
-
}
|