@phsa.tec/design-system-react 0.1.6 → 0.1.9
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/README.md +390 -209
- package/dist/index.d.mts +485 -0
- package/dist/index.d.ts +485 -0
- package/dist/index.js +4259 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +4186 -0
- package/dist/index.mjs.map +1 -0
- package/dist/styles.css +2534 -0
- package/dist/styles.css.map +1 -0
- package/dist/styles.d.mts +2 -0
- package/dist/styles.d.ts +2 -0
- package/package.json +46 -6
- package/.eslintrc.json +0 -7
- package/.github/workflows/deploy-storybook.yml +0 -75
- package/.storybook/main.ts +0 -16
- package/.storybook/preview.ts +0 -15
- package/components.json +0 -21
- package/jest.config.ts +0 -25
- package/next.config.ts +0 -7
- package/postcss.config.mjs +0 -8
- package/public/file.svg +0 -1
- package/public/globe.svg +0 -1
- package/public/next.svg +0 -1
- package/public/vercel.svg +0 -1
- package/public/window.svg +0 -1
- package/src/app/columns.tsx +0 -178
- package/src/app/favicon.ico +0 -0
- package/src/app/fonts/GeistMonoVF.woff +0 -0
- package/src/app/fonts/GeistVF.woff +0 -0
- package/src/app/globals.css +0 -94
- package/src/app/layout.tsx +0 -35
- package/src/app/page.tsx +0 -7
- package/src/components/actions/AlertDialog/AlertDialog.tsx +0 -45
- package/src/components/actions/AlertDialog/alert-dialog.stories.tsx +0 -21
- package/src/components/actions/AlertDialog/index.ts +0 -1
- package/src/components/actions/Button/Button.stories.ts +0 -38
- package/src/components/actions/Button/Button.tsx +0 -23
- package/src/components/actions/Button/index.ts +0 -1
- package/src/components/actions/Collapsible/index.ts +0 -1
- package/src/components/actions/Dialog/Dialog.stories.tsx +0 -70
- package/src/components/actions/Dialog/Dialog.tsx +0 -87
- package/src/components/actions/Dialog/components/DialogWithActions/index.tsx +0 -40
- package/src/components/actions/Dialog/index.ts +0 -1
- package/src/components/actions/Steps/Steps.stories.tsx +0 -25
- package/src/components/actions/Steps/Steps.tsx +0 -51
- package/src/components/actions/Steps/index.ts +0 -1
- package/src/components/actions/index.ts +0 -5
- package/src/components/dataDisplay/Avatar/Avatar.stories.tsx +0 -22
- package/src/components/dataDisplay/Avatar/Avatar.tsx +0 -21
- package/src/components/dataDisplay/Avatar/index.ts +0 -2
- package/src/components/dataDisplay/Badge/Badge.stories.tsx +0 -36
- package/src/components/dataDisplay/Badge/index.ts +0 -1
- package/src/components/dataDisplay/Card/Card.stories.tsx +0 -24
- package/src/components/dataDisplay/Card/Card.tsx +0 -34
- package/src/components/dataDisplay/Card/index.ts +0 -1
- package/src/components/dataDisplay/DataPairList/DataPairList.tsx +0 -56
- package/src/components/dataDisplay/DataPairList/data-pair-list.stories.tsx +0 -87
- package/src/components/dataDisplay/DataPairList/index.ts +0 -2
- package/src/components/dataDisplay/DataPairList/types.ts +0 -10
- package/src/components/dataDisplay/DropDownMenu/index.ts +0 -1
- package/src/components/dataDisplay/ErrorMessage/ErrorMessage.tsx +0 -6
- package/src/components/dataDisplay/ErrorMessage/index.ts +0 -1
- package/src/components/dataDisplay/Icon/Icon.stories.tsx +0 -21
- package/src/components/dataDisplay/Icon/Icon.tsx +0 -47
- package/src/components/dataDisplay/Icon/index.ts +0 -1
- package/src/components/dataDisplay/Icon/types.ts +0 -6
- package/src/components/dataDisplay/Label/Label.stories.tsx +0 -21
- package/src/components/dataDisplay/Label/Label.tsx +0 -10
- package/src/components/dataDisplay/Label/index.ts +0 -1
- package/src/components/dataDisplay/Table/Table.tsx +0 -173
- package/src/components/dataDisplay/Table/columns.tsx +0 -223
- package/src/components/dataDisplay/Table/components/DynamicTable/data-table-column-header.tsx +0 -72
- package/src/components/dataDisplay/Table/components/DynamicTable/data-table-pagination.tsx +0 -91
- package/src/components/dataDisplay/Table/components/DynamicTable/data-table-toolbar.tsx +0 -17
- package/src/components/dataDisplay/Table/components/DynamicTable/data-table-view-options.tsx +0 -58
- package/src/components/dataDisplay/Table/components/DynamicTable/data-table.stories.tsx +0 -118
- package/src/components/dataDisplay/Table/components/DynamicTable/index.tsx +0 -136
- package/src/components/dataDisplay/Table/components/DynamicTable/types.ts +0 -43
- package/src/components/dataDisplay/Table/custom/CustomTable/data-table-column-header.tsx +0 -71
- package/src/components/dataDisplay/Table/custom/CustomTable/data-table-faceted-filter.tsx +0 -147
- package/src/components/dataDisplay/Table/custom/CustomTable/data-table-pagination.tsx +0 -97
- package/src/components/dataDisplay/Table/custom/CustomTable/data-table-row-actions.tsx +0 -78
- package/src/components/dataDisplay/Table/custom/CustomTable/data-table-toolbar.tsx +0 -60
- package/src/components/dataDisplay/Table/custom/CustomTable/data-table-view-options.tsx +0 -59
- package/src/components/dataDisplay/Table/custom/CustomTable/data-table.tsx +0 -145
- package/src/components/dataDisplay/Table/custom/CustomTable/data.ts +0 -71
- package/src/components/dataDisplay/Table/custom/CustomTable/index.tsx +0 -34
- package/src/components/dataDisplay/Table/custom/CustomTable/schema.ts +0 -11
- package/src/components/dataDisplay/Table/index.ts +0 -2
- package/src/components/dataDisplay/Table/table.stories.tsx +0 -147
- package/src/components/dataDisplay/Table/types.ts +0 -15
- package/src/components/dataDisplay/Tabs/Tabs.stories.tsx +0 -34
- package/src/components/dataDisplay/Tabs/Tabs.tsx +0 -53
- package/src/components/dataDisplay/Tabs/index.ts +0 -1
- package/src/components/dataDisplay/Text/Text.stories.tsx +0 -66
- package/src/components/dataDisplay/Text/Text.tsx +0 -56
- package/src/components/dataDisplay/Text/index.ts +0 -1
- package/src/components/dataDisplay/index.ts +0 -8
- package/src/components/dataInput/Input/components/Input/Input.stories.tsx +0 -99
- package/src/components/dataInput/Input/components/Input/InputBase.tsx +0 -50
- package/src/components/dataInput/Input/components/Input/__tests__/input.test.tsx +0 -38
- package/src/components/dataInput/Input/components/Input/index.tsx +0 -48
- package/src/components/dataInput/Input/components/Input/types.ts +0 -15
- package/src/components/dataInput/Input/components/InputBase/index.tsx +0 -31
- package/src/components/dataInput/Input/components/MaskInput/__tests__/mask-input.test.tsx +0 -77
- package/src/components/dataInput/Input/components/MaskInput/index.ts +0 -1
- package/src/components/dataInput/Input/components/MaskInput/mask-input.stories.tsx +0 -85
- package/src/components/dataInput/Input/components/MaskInput/mask-input.tsx +0 -73
- package/src/components/dataInput/Input/components/MultipleInput/MultipleInput.tsx +0 -105
- package/src/components/dataInput/Input/components/MultipleInput/MultipleInputBase.tsx +0 -100
- package/src/components/dataInput/Input/components/MultipleInput/MultipleMaskInput.tsx +0 -35
- package/src/components/dataInput/Input/components/MultipleInput/MultipleNumberInput.tsx +0 -35
- package/src/components/dataInput/Input/components/MultipleInput/__tests__/multiple-input.test.tsx +0 -152
- package/src/components/dataInput/Input/components/MultipleInput/index.ts +0 -2
- package/src/components/dataInput/Input/components/MultipleInput/multiple-input.stories.tsx +0 -96
- package/src/components/dataInput/Input/components/NumberInput/__tests__/number-input.test.tsx +0 -175
- package/src/components/dataInput/Input/components/NumberInput/index.ts +0 -1
- package/src/components/dataInput/Input/components/NumberInput/number-input.stories.tsx +0 -76
- package/src/components/dataInput/Input/components/NumberInput/number-input.tsx +0 -70
- package/src/components/dataInput/Input/index.ts +0 -4
- package/src/components/dataInput/Select/MultiSelect/MultiSelect.stories.tsx +0 -119
- package/src/components/dataInput/Select/MultiSelect/MultiSelectBase.tsx +0 -135
- package/src/components/dataInput/Select/MultiSelect/index.tsx +0 -75
- package/src/components/dataInput/Select/Select.stories.tsx +0 -61
- package/src/components/dataInput/Select/Select.tsx +0 -73
- package/src/components/dataInput/Select/SelectBase.tsx +0 -58
- package/src/components/dataInput/Select/index.ts +0 -2
- package/src/components/dataInput/Switch/Switch.stories.tsx +0 -75
- package/src/components/dataInput/Switch/Switch.tsx +0 -52
- package/src/components/dataInput/Switch/index.ts +0 -1
- package/src/components/dataInput/checkbox/Checkbox.tsx +0 -57
- package/src/components/dataInput/checkbox/Checkbox_old.tsx +0 -58
- package/src/components/dataInput/checkbox/Checkout.stories.tsx +0 -62
- package/src/components/dataInput/checkbox/index.ts +0 -1
- package/src/components/dataInput/form/Form.tsx +0 -47
- package/src/components/dataInput/form/index.ts +0 -3
- package/src/components/dataInput/index.ts +0 -5
- package/src/components/feedback/ErrorLabel/index.tsx +0 -24
- package/src/components/feedback/Spinner/index.ts +0 -1
- package/src/components/feedback/Toast/Toast.stories.tsx +0 -45
- package/src/components/feedback/Toast/index.ts +0 -2
- package/src/components/feedback/index.ts +0 -2
- package/src/components/index.ts +0 -6
- package/src/components/layout/Crud/components/Table/index.tsx +0 -183
- package/src/components/layout/Crud/components/Table/types.ts +0 -15
- package/src/components/layout/Crud/crud.stories.tsx +0 -317
- package/src/components/layout/Crud/hook/useCrudLayout/index.tsx +0 -94
- package/src/components/layout/Crud/hook/useRequest/index.tsx +0 -156
- package/src/components/layout/Crud/index.tsx +0 -295
- package/src/components/layout/Crud/store/CrudLayoutStore.ts +0 -75
- package/src/components/layout/Crud/types.ts +0 -14
- package/src/components/layout/Drawer/CustomDrawer/index.tsx +0 -33
- package/src/components/layout/Drawer/Drawer.stories.tsx +0 -80
- package/src/components/layout/Drawer/index.ts +0 -2
- package/src/components/layout/PageLayout/PageLayout.stories.tsx +0 -42
- package/src/components/layout/PageLayout/index.tsx +0 -28
- package/src/components/layout/Separator/index.ts +0 -1
- package/src/components/layout/Sheet/Sheet.stories.tsx +0 -28
- package/src/components/layout/Sheet/Sheet.tsx +0 -22
- package/src/components/layout/Sheet/index.ts +0 -1
- package/src/components/layout/Sidebar/Sidebar.stories.tsx +0 -116
- package/src/components/layout/Sidebar/Sidebar.tsx +0 -50
- package/src/components/layout/Sidebar/components/app-sidebar.tsx +0 -203
- package/src/components/layout/Sidebar/components/footer-sidebar.tsx +0 -17
- package/src/components/layout/Sidebar/components/header-sidebar.tsx +0 -90
- package/src/components/layout/Sidebar/components/menus.tsx +0 -55
- package/src/components/layout/Sidebar/components/nav-projects.tsx +0 -88
- package/src/components/layout/Sidebar/components/nav-user.tsx +0 -114
- package/src/components/layout/Sidebar/components/team-switcher.tsx +0 -85
- package/src/components/layout/Sidebar/index.ts +0 -2
- package/src/components/layout/Sidebar/provider/index.tsx +0 -51
- package/src/components/layout/Tabs/Tabs.tsx +0 -51
- package/src/components/layout/Tabs/index.ts +0 -1
- package/src/components/layout/Tabs/tabs.stories.tsx +0 -57
- package/src/components/layout/index.ts +0 -6
- package/src/components/navigation/Breadcrumbs/Breadcrumbs.tsx +0 -66
- package/src/components/navigation/Breadcrumbs/index.ts +0 -2
- package/src/components/navigation/index.ts +0 -1
- package/src/components/ui/alert-dialog.tsx +0 -141
- package/src/components/ui/alert.tsx +0 -59
- package/src/components/ui/avatar.tsx +0 -50
- package/src/components/ui/badge.tsx +0 -40
- package/src/components/ui/breadcrumb.tsx +0 -115
- package/src/components/ui/button.tsx +0 -57
- package/src/components/ui/card.tsx +0 -83
- package/src/components/ui/checkbox.tsx +0 -34
- package/src/components/ui/collapsible.tsx +0 -11
- package/src/components/ui/command.tsx +0 -153
- package/src/components/ui/dialog.tsx +0 -124
- package/src/components/ui/drawer.tsx +0 -117
- package/src/components/ui/dropdown-menu.tsx +0 -201
- package/src/components/ui/form.tsx +0 -179
- package/src/components/ui/input.tsx +0 -24
- package/src/components/ui/label.tsx +0 -30
- package/src/components/ui/popover.tsx +0 -33
- package/src/components/ui/select.tsx +0 -161
- package/src/components/ui/separator.tsx +0 -31
- package/src/components/ui/sheet.tsx +0 -140
- package/src/components/ui/sidebar.tsx +0 -763
- package/src/components/ui/skeleton.tsx +0 -15
- package/src/components/ui/sonner.tsx +0 -31
- package/src/components/ui/spinner.tsx +0 -54
- package/src/components/ui/switch.tsx +0 -33
- package/src/components/ui/table.tsx +0 -120
- package/src/components/ui/tabs.tsx +0 -55
- package/src/components/ui/toast.tsx +0 -130
- package/src/components/ui/toaster.tsx +0 -35
- package/src/components/ui/tooltip.tsx +0 -32
- package/src/hooks/use-conditional-controller.tsx +0 -35
- package/src/hooks/use-mask.tsx +0 -116
- package/src/hooks/use-mobile.tsx +0 -19
- package/src/hooks/use-toast.ts +0 -191
- package/src/index.ts +0 -1
- package/src/introduction.mdx +0 -132
- package/src/lib/utils.ts +0 -6
- package/tailwind.config.ts +0 -83
- package/tsconfig.json +0 -27
package/src/app/columns.tsx
DELETED
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { ColumnDef } from "@tanstack/react-table";
|
|
4
|
-
import { z } from "zod";
|
|
5
|
-
import {
|
|
6
|
-
ArrowDownIcon,
|
|
7
|
-
ArrowRightIcon,
|
|
8
|
-
ArrowUpIcon,
|
|
9
|
-
CheckCircledIcon,
|
|
10
|
-
CircleIcon,
|
|
11
|
-
CrossCircledIcon,
|
|
12
|
-
QuestionMarkCircledIcon,
|
|
13
|
-
StopwatchIcon,
|
|
14
|
-
} from "@radix-ui/react-icons";
|
|
15
|
-
import {
|
|
16
|
-
Badge,
|
|
17
|
-
DataTableColumnHeader,
|
|
18
|
-
DataTableRowActions,
|
|
19
|
-
} from "@/components";
|
|
20
|
-
|
|
21
|
-
export const labels = [
|
|
22
|
-
{
|
|
23
|
-
value: "bug",
|
|
24
|
-
label: "Bug",
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
value: "feature",
|
|
28
|
-
label: "Feature",
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
value: "documentation",
|
|
32
|
-
label: "Documentation",
|
|
33
|
-
},
|
|
34
|
-
];
|
|
35
|
-
|
|
36
|
-
export const statuses = [
|
|
37
|
-
{
|
|
38
|
-
value: "backlog",
|
|
39
|
-
label: "Backlog",
|
|
40
|
-
icon: QuestionMarkCircledIcon,
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
value: "todo",
|
|
44
|
-
label: "Todo",
|
|
45
|
-
icon: CircleIcon,
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
value: "in progress",
|
|
49
|
-
label: "In Progress",
|
|
50
|
-
icon: StopwatchIcon,
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
value: "done",
|
|
54
|
-
label: "Done",
|
|
55
|
-
icon: CheckCircledIcon,
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
value: "canceled",
|
|
59
|
-
label: "Canceled",
|
|
60
|
-
icon: CrossCircledIcon,
|
|
61
|
-
},
|
|
62
|
-
];
|
|
63
|
-
|
|
64
|
-
export const priorities = [
|
|
65
|
-
{
|
|
66
|
-
label: "Low",
|
|
67
|
-
value: "low",
|
|
68
|
-
icon: ArrowDownIcon,
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
label: "Medium",
|
|
72
|
-
value: "medium",
|
|
73
|
-
icon: ArrowRightIcon,
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
label: "High",
|
|
77
|
-
value: "high",
|
|
78
|
-
icon: ArrowUpIcon,
|
|
79
|
-
},
|
|
80
|
-
];
|
|
81
|
-
|
|
82
|
-
export const taskSchema = z.object({
|
|
83
|
-
id: z.string(),
|
|
84
|
-
title: z.string(),
|
|
85
|
-
status: z.string(),
|
|
86
|
-
label: z.string(),
|
|
87
|
-
priority: z.string(),
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
export type Task = z.infer<typeof taskSchema>;
|
|
91
|
-
|
|
92
|
-
export const columns: ColumnDef<Task>[] = [
|
|
93
|
-
{
|
|
94
|
-
accessorKey: "id",
|
|
95
|
-
header: ({ column }) => (
|
|
96
|
-
<DataTableColumnHeader column={column} title="Task" />
|
|
97
|
-
),
|
|
98
|
-
cell: ({ row }) => <div className="w-[80px]">{row.getValue("id")}</div>,
|
|
99
|
-
enableSorting: false,
|
|
100
|
-
enableHiding: false,
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
accessorKey: "title",
|
|
104
|
-
header: ({ column }) => (
|
|
105
|
-
<DataTableColumnHeader column={column} title="Title" />
|
|
106
|
-
),
|
|
107
|
-
cell: ({ row }) => {
|
|
108
|
-
const label = labels.find((label) => label.value === row.original.label);
|
|
109
|
-
|
|
110
|
-
return (
|
|
111
|
-
<div className="flex space-x-2">
|
|
112
|
-
{label && <Badge variant="outline">{label.label}</Badge>}
|
|
113
|
-
<span className="max-w-[500px] truncate font-medium">
|
|
114
|
-
{row.getValue("title")}
|
|
115
|
-
</span>
|
|
116
|
-
</div>
|
|
117
|
-
);
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
accessorKey: "status",
|
|
122
|
-
header: ({ column }) => (
|
|
123
|
-
<DataTableColumnHeader column={column} title="Status" />
|
|
124
|
-
),
|
|
125
|
-
cell: ({ row }) => {
|
|
126
|
-
const status = statuses.find(
|
|
127
|
-
(status) => status.value === row.getValue("status")
|
|
128
|
-
);
|
|
129
|
-
|
|
130
|
-
if (!status) {
|
|
131
|
-
return null;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
return (
|
|
135
|
-
<div className="flex w-[100px] items-center">
|
|
136
|
-
{status.icon && (
|
|
137
|
-
<status.icon className="mr-2 h-4 w-4 text-muted-foreground" />
|
|
138
|
-
)}
|
|
139
|
-
<span>{status.label}</span>
|
|
140
|
-
</div>
|
|
141
|
-
);
|
|
142
|
-
},
|
|
143
|
-
filterFn: (row, id, value) => {
|
|
144
|
-
return value.includes(row.getValue(id));
|
|
145
|
-
},
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
accessorKey: "priority",
|
|
149
|
-
header: ({ column }) => (
|
|
150
|
-
<DataTableColumnHeader column={column} title="Priority" />
|
|
151
|
-
),
|
|
152
|
-
cell: ({ row }) => {
|
|
153
|
-
const priority = priorities.find(
|
|
154
|
-
(priority) => priority.value === row.getValue("priority")
|
|
155
|
-
);
|
|
156
|
-
|
|
157
|
-
if (!priority) {
|
|
158
|
-
return null;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
return (
|
|
162
|
-
<div className="flex items-center">
|
|
163
|
-
{priority.icon && (
|
|
164
|
-
<priority.icon className="mr-2 h-4 w-4 text-muted-foreground" />
|
|
165
|
-
)}
|
|
166
|
-
<span>{priority.label}</span>
|
|
167
|
-
</div>
|
|
168
|
-
);
|
|
169
|
-
},
|
|
170
|
-
filterFn: (row, id, value) => {
|
|
171
|
-
return value.includes(row.getValue(id));
|
|
172
|
-
},
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
id: "actions",
|
|
176
|
-
cell: ({ row }) => <DataTableRowActions row={row} />,
|
|
177
|
-
},
|
|
178
|
-
];
|
package/src/app/favicon.ico
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/src/app/globals.css
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400;500;700;900&display=swap");
|
|
2
|
-
|
|
3
|
-
@tailwind base;
|
|
4
|
-
@tailwind components;
|
|
5
|
-
@tailwind utilities;
|
|
6
|
-
|
|
7
|
-
body {
|
|
8
|
-
font-family: "Roboto", Arial, Helvetica, sans-serif; /* Adicionando a fonte Roboto */
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
@layer base {
|
|
12
|
-
:root {
|
|
13
|
-
--background: 0 0% 100%;
|
|
14
|
-
--foreground: 150 6% 25%;
|
|
15
|
-
--card: 0 0% 100%;
|
|
16
|
-
--card-foreground: 150 6% 25%;
|
|
17
|
-
--popover: 0 0% 100%;
|
|
18
|
-
--popover-foreground: 150 6% 25%;
|
|
19
|
-
--primary: 145 63% 42%;
|
|
20
|
-
--primary-foreground: 0 0% 98%;
|
|
21
|
-
--secondary: 150 10% 96%;
|
|
22
|
-
--secondary-foreground: 150 6% 25%;
|
|
23
|
-
--muted: 150 10% 96%;
|
|
24
|
-
--muted-foreground: 150 6% 45%;
|
|
25
|
-
--accent: 150 10% 96%;
|
|
26
|
-
--accent-foreground: 150 6% 25%;
|
|
27
|
-
--success: 145 63% 42%;
|
|
28
|
-
--success-foreground: 0 0% 98%;
|
|
29
|
-
--warning: 48 89% 50%;
|
|
30
|
-
--destructive: 0 84.2% 60.2%;
|
|
31
|
-
--destructive-foreground: 0 0% 98%;
|
|
32
|
-
--border: 150 12% 88%;
|
|
33
|
-
--input: 150 12% 88%;
|
|
34
|
-
--ring: 145 63% 42%;
|
|
35
|
-
--chart-1: 12 76% 61%;
|
|
36
|
-
--chart-2: 173 58% 39%;
|
|
37
|
-
--chart-3: 197 37% 24%;
|
|
38
|
-
--chart-4: 43 74% 66%;
|
|
39
|
-
--chart-5: 27 87% 67%;
|
|
40
|
-
--radius: 0.5rem;
|
|
41
|
-
--sidebar-background: 150 15% 98%;
|
|
42
|
-
--sidebar-foreground: 150 6% 30%;
|
|
43
|
-
--sidebar-primary: 145 63% 42%;
|
|
44
|
-
--sidebar-primary-foreground: 0 0% 98%;
|
|
45
|
-
--sidebar-accent: 150 15% 95%;
|
|
46
|
-
--sidebar-accent-foreground: 150 6% 25%;
|
|
47
|
-
--sidebar-border: 150 15% 90%;
|
|
48
|
-
--sidebar-ring: 145 63% 42%;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.dark {
|
|
52
|
-
--background: 150 15% 4%;
|
|
53
|
-
--foreground: 150 10% 95%;
|
|
54
|
-
--card: 150 15% 4%;
|
|
55
|
-
--card-foreground: 150 10% 95%;
|
|
56
|
-
--popover: 150 15% 4%;
|
|
57
|
-
--popover-foreground: 150 10% 95%;
|
|
58
|
-
--primary: 145 63% 48%;
|
|
59
|
-
--primary-foreground: 150 15% 8%;
|
|
60
|
-
--secondary: 150 12% 12%;
|
|
61
|
-
--secondary-foreground: 150 10% 95%;
|
|
62
|
-
--muted: 150 12% 12%;
|
|
63
|
-
--muted-foreground: 150 8% 60%;
|
|
64
|
-
--accent: 150 12% 12%;
|
|
65
|
-
--accent-foreground: 150 10% 95%;
|
|
66
|
-
--destructive: 0 62.8% 30.6%;
|
|
67
|
-
--destructive-foreground: 0 0% 98%;
|
|
68
|
-
--border: 150 12% 18%;
|
|
69
|
-
--input: 150 12% 18%;
|
|
70
|
-
--ring: 145 63% 48%;
|
|
71
|
-
--chart-1: 220 70% 50%;
|
|
72
|
-
--chart-2: 160 60% 45%;
|
|
73
|
-
--chart-3: 30 80% 55%;
|
|
74
|
-
--chart-4: 280 65% 60%;
|
|
75
|
-
--chart-5: 340 75% 55%;
|
|
76
|
-
--sidebar-background: 150 15% 8%;
|
|
77
|
-
--sidebar-foreground: 150 10% 90%;
|
|
78
|
-
--sidebar-primary: 145 63% 48%;
|
|
79
|
-
--sidebar-primary-foreground: 150 15% 8%;
|
|
80
|
-
--sidebar-accent: 150 12% 15%;
|
|
81
|
-
--sidebar-accent-foreground: 150 10% 90%;
|
|
82
|
-
--sidebar-border: 150 12% 15%;
|
|
83
|
-
--sidebar-ring: 145 63% 48%;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
@layer base {
|
|
88
|
-
* {
|
|
89
|
-
@apply border-border;
|
|
90
|
-
}
|
|
91
|
-
body {
|
|
92
|
-
@apply bg-background text-foreground;
|
|
93
|
-
}
|
|
94
|
-
}
|
package/src/app/layout.tsx
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { Metadata } from "next";
|
|
2
|
-
import localFont from "next/font/local";
|
|
3
|
-
import "./globals.css";
|
|
4
|
-
|
|
5
|
-
const geistSans = localFont({
|
|
6
|
-
src: "./fonts/GeistVF.woff",
|
|
7
|
-
variable: "--font-geist-sans",
|
|
8
|
-
weight: "100 900",
|
|
9
|
-
});
|
|
10
|
-
const geistMono = localFont({
|
|
11
|
-
src: "./fonts/GeistMonoVF.woff",
|
|
12
|
-
variable: "--font-geist-mono",
|
|
13
|
-
weight: "100 900",
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
export const metadata: Metadata = {
|
|
17
|
-
title: "Create Next App",
|
|
18
|
-
description: "Generated by create next app",
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export default function RootLayout({
|
|
22
|
-
children,
|
|
23
|
-
}: Readonly<{
|
|
24
|
-
children: React.ReactNode;
|
|
25
|
-
}>) {
|
|
26
|
-
return (
|
|
27
|
-
<html lang="en">
|
|
28
|
-
<body
|
|
29
|
-
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
|
|
30
|
-
>
|
|
31
|
-
{children}
|
|
32
|
-
</body>
|
|
33
|
-
</html>
|
|
34
|
-
);
|
|
35
|
-
}
|
package/src/app/page.tsx
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AlertDialog as AlertDialogUI,
|
|
3
|
-
AlertDialogAction,
|
|
4
|
-
AlertDialogCancel,
|
|
5
|
-
AlertDialogContent,
|
|
6
|
-
AlertDialogDescription,
|
|
7
|
-
AlertDialogFooter,
|
|
8
|
-
AlertDialogHeader,
|
|
9
|
-
AlertDialogTitle,
|
|
10
|
-
AlertDialogTrigger,
|
|
11
|
-
} from "../../ui/alert-dialog";
|
|
12
|
-
|
|
13
|
-
export type AlertDialogProps = {
|
|
14
|
-
title: string;
|
|
15
|
-
description?: string;
|
|
16
|
-
children: React.ReactNode;
|
|
17
|
-
onConfirm?: () => void;
|
|
18
|
-
onCancel?: () => void;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export const AlertDialog = ({
|
|
22
|
-
title,
|
|
23
|
-
description,
|
|
24
|
-
children,
|
|
25
|
-
onConfirm,
|
|
26
|
-
onCancel,
|
|
27
|
-
}: AlertDialogProps) => {
|
|
28
|
-
return (
|
|
29
|
-
<AlertDialogUI>
|
|
30
|
-
<AlertDialogTrigger asChild>{children}</AlertDialogTrigger>
|
|
31
|
-
<AlertDialogContent>
|
|
32
|
-
<AlertDialogHeader>
|
|
33
|
-
<AlertDialogTitle>{title}</AlertDialogTitle>
|
|
34
|
-
{description && (
|
|
35
|
-
<AlertDialogDescription>{description}</AlertDialogDescription>
|
|
36
|
-
)}
|
|
37
|
-
</AlertDialogHeader>
|
|
38
|
-
<AlertDialogFooter>
|
|
39
|
-
<AlertDialogCancel onClick={onCancel}>Cancel</AlertDialogCancel>
|
|
40
|
-
<AlertDialogAction onClick={onConfirm}>Continue</AlertDialogAction>
|
|
41
|
-
</AlertDialogFooter>
|
|
42
|
-
</AlertDialogContent>
|
|
43
|
-
</AlertDialogUI>
|
|
44
|
-
);
|
|
45
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/nextjs";
|
|
2
|
-
import { AlertDialog } from "./AlertDialog";
|
|
3
|
-
import { Button } from "../../ui/button";
|
|
4
|
-
|
|
5
|
-
const meta: Meta<typeof AlertDialog> = {
|
|
6
|
-
title: "Action/AlertDialog",
|
|
7
|
-
component: AlertDialog,
|
|
8
|
-
tags: ["autodocs"],
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export default meta;
|
|
12
|
-
type Story = StoryObj<typeof AlertDialog>;
|
|
13
|
-
|
|
14
|
-
export const Default: Story = {
|
|
15
|
-
args: {
|
|
16
|
-
title: "Are you absolutely sure?",
|
|
17
|
-
description:
|
|
18
|
-
"This action cannot be undone. This will permanently delete your account and remove your data from our servers.",
|
|
19
|
-
children: <Button variant="destructive">Delete Account</Button>,
|
|
20
|
-
},
|
|
21
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./AlertDialog";
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/nextjs";
|
|
2
|
-
import { fn } from "storybook/test";
|
|
3
|
-
|
|
4
|
-
import { Button } from "./index";
|
|
5
|
-
|
|
6
|
-
const meta = {
|
|
7
|
-
title: "Action/Button",
|
|
8
|
-
component: Button,
|
|
9
|
-
parameters: {
|
|
10
|
-
layout: "centered",
|
|
11
|
-
},
|
|
12
|
-
argTypes: {
|
|
13
|
-
variant: {
|
|
14
|
-
options: [
|
|
15
|
-
"primary",
|
|
16
|
-
"secondary",
|
|
17
|
-
"destructive",
|
|
18
|
-
"outline",
|
|
19
|
-
"ghost",
|
|
20
|
-
"link",
|
|
21
|
-
],
|
|
22
|
-
control: {
|
|
23
|
-
type: "select",
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
tags: ["autodocs"],
|
|
28
|
-
args: { onClick: fn() },
|
|
29
|
-
} satisfies Meta<typeof Button>;
|
|
30
|
-
|
|
31
|
-
export default meta;
|
|
32
|
-
type Story = StoryObj<typeof meta>;
|
|
33
|
-
|
|
34
|
-
export const Default: Story = {
|
|
35
|
-
args: {
|
|
36
|
-
children: "Button",
|
|
37
|
-
},
|
|
38
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { forwardRef } from "react";
|
|
2
|
-
import { Spinner } from "../../../components/feedback";
|
|
3
|
-
import {
|
|
4
|
-
Button as UIButton,
|
|
5
|
-
ButtonProps as UIButtonProps,
|
|
6
|
-
} from "../../ui/button";
|
|
7
|
-
|
|
8
|
-
export type ButtonProps = UIButtonProps & {
|
|
9
|
-
loading?: boolean;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
|
13
|
-
({ children, disabled, loading, ...rest }, ref) => {
|
|
14
|
-
return (
|
|
15
|
-
<UIButton {...rest} disabled={disabled || loading} ref={ref}>
|
|
16
|
-
{loading && <Spinner className="fill-white" />}
|
|
17
|
-
{children}
|
|
18
|
-
</UIButton>
|
|
19
|
-
);
|
|
20
|
-
}
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
Button.displayName = "Button";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Button";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "../../ui/collapsible";
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { useState } from "react";
|
|
2
|
-
import { DialogWithActions as DialogWithActionsComponent } from "./components/DialogWithActions";
|
|
3
|
-
import { Dialog } from "./Dialog";
|
|
4
|
-
import type { Meta, StoryObj } from "@storybook/nextjs";
|
|
5
|
-
import { Label } from "@/components/dataDisplay/Label";
|
|
6
|
-
import { Input } from "@/components/dataInput";
|
|
7
|
-
|
|
8
|
-
const meta = {
|
|
9
|
-
title: "Action/Dialog",
|
|
10
|
-
component: Dialog,
|
|
11
|
-
parameters: {
|
|
12
|
-
layout: "centered",
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
tags: ["autodocs"],
|
|
16
|
-
} satisfies Meta<typeof Dialog>;
|
|
17
|
-
|
|
18
|
-
export default meta;
|
|
19
|
-
type Story = StoryObj<typeof meta>;
|
|
20
|
-
|
|
21
|
-
export const Default: Story = {
|
|
22
|
-
args: {
|
|
23
|
-
title: "Dialog Title",
|
|
24
|
-
description: "Dialog Description",
|
|
25
|
-
footer: () => <button>Footer Button</button>,
|
|
26
|
-
},
|
|
27
|
-
render: (props) => {
|
|
28
|
-
const [open, setOpen] = useState<boolean>(false);
|
|
29
|
-
return (
|
|
30
|
-
<div>
|
|
31
|
-
<button onClick={() => setOpen(true)}>Open Dialog</button>
|
|
32
|
-
<Dialog {...props} open={open} onOpenChange={setOpen}>
|
|
33
|
-
This action cannot be undone. This will permanently delete your
|
|
34
|
-
account and remove your data from our servers.
|
|
35
|
-
</Dialog>
|
|
36
|
-
</div>
|
|
37
|
-
);
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export const DialogWithActions: Story = {
|
|
42
|
-
render: (args) => {
|
|
43
|
-
return (
|
|
44
|
-
<DialogWithActionsComponent {...args}>
|
|
45
|
-
<div className="grid gap-4 py-4">
|
|
46
|
-
<div className="grid grid-cols-4 items-center gap-4">
|
|
47
|
-
<Label htmlFor="name" className="text-right">
|
|
48
|
-
Name
|
|
49
|
-
</Label>
|
|
50
|
-
<Input
|
|
51
|
-
id="name"
|
|
52
|
-
defaultValue="Pedro Duarte"
|
|
53
|
-
className="col-span-3"
|
|
54
|
-
/>
|
|
55
|
-
</div>
|
|
56
|
-
<div className="grid grid-cols-4 items-center gap-4">
|
|
57
|
-
<Label htmlFor="username" className="text-right">
|
|
58
|
-
Username
|
|
59
|
-
</Label>
|
|
60
|
-
<Input
|
|
61
|
-
id="username"
|
|
62
|
-
defaultValue="@peduarte"
|
|
63
|
-
className="col-span-3"
|
|
64
|
-
/>
|
|
65
|
-
</div>
|
|
66
|
-
</div>
|
|
67
|
-
</DialogWithActionsComponent>
|
|
68
|
-
);
|
|
69
|
-
},
|
|
70
|
-
};
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
Dialog as DialogComponent,
|
|
4
|
-
DialogContent,
|
|
5
|
-
DialogDescription,
|
|
6
|
-
DialogFooter,
|
|
7
|
-
DialogHeader,
|
|
8
|
-
DialogTitle,
|
|
9
|
-
DialogProps as DialogComponentProps,
|
|
10
|
-
DialogClose,
|
|
11
|
-
} from "../../../components/ui/dialog";
|
|
12
|
-
import { PropsWithChildren, useRef } from "react";
|
|
13
|
-
import { Button } from "../Button";
|
|
14
|
-
|
|
15
|
-
export type DialogProps = DialogComponentProps &
|
|
16
|
-
PropsWithChildren & {
|
|
17
|
-
className?: string;
|
|
18
|
-
title?: string;
|
|
19
|
-
description?: string;
|
|
20
|
-
footer?: () => React.ReactNode;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export function Dialog({
|
|
24
|
-
title,
|
|
25
|
-
description,
|
|
26
|
-
className,
|
|
27
|
-
children,
|
|
28
|
-
footer = () => null,
|
|
29
|
-
...props
|
|
30
|
-
}: DialogProps) {
|
|
31
|
-
return (
|
|
32
|
-
<DialogComponent {...props}>
|
|
33
|
-
<DialogContent className={className}>
|
|
34
|
-
<DialogHeader>
|
|
35
|
-
{title && <DialogTitle>{title}</DialogTitle>}
|
|
36
|
-
{description && <DialogDescription>{description}</DialogDescription>}
|
|
37
|
-
</DialogHeader>
|
|
38
|
-
{children}
|
|
39
|
-
{footer && <DialogFooter>{footer()}</DialogFooter>}
|
|
40
|
-
</DialogContent>
|
|
41
|
-
</DialogComponent>
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export type DialogWithFormProps = DialogProps & {
|
|
46
|
-
onSubmit: () => void;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export const DialogWithForm = ({
|
|
50
|
-
title,
|
|
51
|
-
description,
|
|
52
|
-
className,
|
|
53
|
-
children,
|
|
54
|
-
footer = () => null,
|
|
55
|
-
onSubmit = () => {},
|
|
56
|
-
...props
|
|
57
|
-
}: DialogWithFormProps) => {
|
|
58
|
-
const dialogRef = useRef<HTMLDivElement>(null);
|
|
59
|
-
|
|
60
|
-
return (
|
|
61
|
-
<DialogComponent {...props}>
|
|
62
|
-
<DialogContent className={className} ref={dialogRef}>
|
|
63
|
-
<form onSubmit={onSubmit} className="flex flex-col gap-4">
|
|
64
|
-
<DialogHeader>
|
|
65
|
-
{title && <DialogTitle>{title}</DialogTitle>}
|
|
66
|
-
{description && (
|
|
67
|
-
<DialogDescription>{description}</DialogDescription>
|
|
68
|
-
)}
|
|
69
|
-
</DialogHeader>
|
|
70
|
-
{children}
|
|
71
|
-
{footer && (
|
|
72
|
-
<DialogFooter>
|
|
73
|
-
<div className="flex justify-between w-full">
|
|
74
|
-
<DialogClose asChild>
|
|
75
|
-
<Button type="button" variant="secondary">
|
|
76
|
-
Fechar
|
|
77
|
-
</Button>
|
|
78
|
-
</DialogClose>
|
|
79
|
-
{footer()}
|
|
80
|
-
</div>
|
|
81
|
-
</DialogFooter>
|
|
82
|
-
)}
|
|
83
|
-
</form>
|
|
84
|
-
</DialogContent>
|
|
85
|
-
</DialogComponent>
|
|
86
|
-
);
|
|
87
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Button } from "../../../../../components/ui/button";
|
|
3
|
-
import {
|
|
4
|
-
Dialog,
|
|
5
|
-
DialogContent,
|
|
6
|
-
DialogDescription,
|
|
7
|
-
DialogFooter,
|
|
8
|
-
DialogHeader,
|
|
9
|
-
DialogTitle,
|
|
10
|
-
DialogTrigger,
|
|
11
|
-
} from "../../../../../components/ui/dialog";
|
|
12
|
-
|
|
13
|
-
type DialogWithActionsProps = React.PropsWithChildren & {
|
|
14
|
-
title?: string;
|
|
15
|
-
description?: string;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export function DialogWithActions({
|
|
19
|
-
children,
|
|
20
|
-
title = "Edit profile",
|
|
21
|
-
description = "Make changes to your profile here. Click save when you're done.",
|
|
22
|
-
}: DialogWithActionsProps) {
|
|
23
|
-
return (
|
|
24
|
-
<Dialog>
|
|
25
|
-
<DialogTrigger asChild>
|
|
26
|
-
<Button variant="outline">Edit Profile</Button>
|
|
27
|
-
</DialogTrigger>
|
|
28
|
-
<DialogContent className="sm:max-w-[425px]">
|
|
29
|
-
<DialogHeader>
|
|
30
|
-
<DialogTitle>{title}</DialogTitle>
|
|
31
|
-
<DialogDescription>{description}</DialogDescription>
|
|
32
|
-
</DialogHeader>
|
|
33
|
-
{children}
|
|
34
|
-
<DialogFooter>
|
|
35
|
-
<Button type="submit">Save changes</Button>
|
|
36
|
-
</DialogFooter>
|
|
37
|
-
</DialogContent>
|
|
38
|
-
</Dialog>
|
|
39
|
-
);
|
|
40
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Dialog";
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/nextjs";
|
|
2
|
-
import { fn } from "storybook/test";
|
|
3
|
-
|
|
4
|
-
import { Steps } from "./Steps";
|
|
5
|
-
|
|
6
|
-
const meta = {
|
|
7
|
-
title: "Action/Steps",
|
|
8
|
-
component: Steps,
|
|
9
|
-
parameters: {
|
|
10
|
-
layout: "centered",
|
|
11
|
-
},
|
|
12
|
-
argTypes: {},
|
|
13
|
-
tags: ["autodocs"],
|
|
14
|
-
args: { onClick: fn() },
|
|
15
|
-
} satisfies Meta<typeof Steps>;
|
|
16
|
-
|
|
17
|
-
export default meta;
|
|
18
|
-
type Story = StoryObj<typeof meta>;
|
|
19
|
-
|
|
20
|
-
export const Default: Story = {
|
|
21
|
-
args: {
|
|
22
|
-
data: [{ id: 1 }, { id: 2 }, { id: 3 }, { id: 4 }, { id: 5 }, { id: 6 }],
|
|
23
|
-
value: 3,
|
|
24
|
-
},
|
|
25
|
-
};
|