@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
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/nextjs";
|
|
2
|
-
import { Sidebar } from "./Sidebar";
|
|
3
|
-
import {
|
|
4
|
-
Users,
|
|
5
|
-
FileText,
|
|
6
|
-
LayoutDashboard,
|
|
7
|
-
UserRound,
|
|
8
|
-
Archive,
|
|
9
|
-
Share,
|
|
10
|
-
BarChart,
|
|
11
|
-
Shield,
|
|
12
|
-
} from "lucide-react";
|
|
13
|
-
|
|
14
|
-
const meta = {
|
|
15
|
-
title: "Layout/Sidebar",
|
|
16
|
-
component: Sidebar,
|
|
17
|
-
parameters: {
|
|
18
|
-
layout: "fullscreen",
|
|
19
|
-
},
|
|
20
|
-
tags: ["autodocs"],
|
|
21
|
-
decorators: [
|
|
22
|
-
(Story) => (
|
|
23
|
-
<div className="h-screen">
|
|
24
|
-
<Story />
|
|
25
|
-
</div>
|
|
26
|
-
),
|
|
27
|
-
],
|
|
28
|
-
} satisfies Meta<typeof Sidebar>;
|
|
29
|
-
|
|
30
|
-
export default meta;
|
|
31
|
-
type Story = StoryObj<typeof meta>;
|
|
32
|
-
|
|
33
|
-
const defaultNavbar = [
|
|
34
|
-
{
|
|
35
|
-
title: "Dashboard",
|
|
36
|
-
items: [
|
|
37
|
-
{ title: "Overview", url: "/dashboard", icon: () => <LayoutDashboard /> },
|
|
38
|
-
{
|
|
39
|
-
title: "Analytics",
|
|
40
|
-
url: "/dashboard/analytics",
|
|
41
|
-
icon: () => <BarChart />,
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
title: "Reports",
|
|
45
|
-
url: "/dashboard/reports",
|
|
46
|
-
isActive: true,
|
|
47
|
-
icon: () => <Archive />,
|
|
48
|
-
},
|
|
49
|
-
],
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
title: "Users",
|
|
53
|
-
url: "/users",
|
|
54
|
-
|
|
55
|
-
items: [
|
|
56
|
-
{ title: "All Users", url: "/users", icon: () => <Users /> },
|
|
57
|
-
{
|
|
58
|
-
title: "Permissions",
|
|
59
|
-
url: "/users/permissions",
|
|
60
|
-
icon: () => <Shield />,
|
|
61
|
-
},
|
|
62
|
-
{ title: "Roles", url: "/users/roles", icon: () => <UserRound /> },
|
|
63
|
-
],
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
title: "Documents",
|
|
67
|
-
url: "/documents",
|
|
68
|
-
items: [
|
|
69
|
-
{ title: "All Documents", url: "/documents", icon: () => <FileText /> },
|
|
70
|
-
{ title: "Shared", url: "/documents/shared", icon: () => <Share /> },
|
|
71
|
-
{ title: "Archive", url: "/documents/archive", icon: () => <Archive /> },
|
|
72
|
-
],
|
|
73
|
-
},
|
|
74
|
-
];
|
|
75
|
-
|
|
76
|
-
export const Default: Story = {
|
|
77
|
-
args: {
|
|
78
|
-
navbar: defaultNavbar,
|
|
79
|
-
footer: () => <div>Footer</div>,
|
|
80
|
-
children: (
|
|
81
|
-
<div className="space-y-4">
|
|
82
|
-
<h1 className="text-2xl font-bold">Dashboard Overview</h1>
|
|
83
|
-
<p className="text-muted-foreground">Welcome to your dashboard.</p>
|
|
84
|
-
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-3">
|
|
85
|
-
{Array.from({ length: 6 }).map((_, i) => (
|
|
86
|
-
<div key={i} className="rounded-lg bg-white p-6 shadow-sm">
|
|
87
|
-
<h3 className="font-semibold">Card {i + 1}</h3>
|
|
88
|
-
<p className="text-sm text-muted-foreground">
|
|
89
|
-
Card description here
|
|
90
|
-
</p>
|
|
91
|
-
</div>
|
|
92
|
-
))}
|
|
93
|
-
</div>
|
|
94
|
-
</div>
|
|
95
|
-
),
|
|
96
|
-
},
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
export const WithoutFooter: Story = {
|
|
100
|
-
args: {
|
|
101
|
-
navbar: defaultNavbar,
|
|
102
|
-
showFooter: false,
|
|
103
|
-
children: (
|
|
104
|
-
<div className="space-y-4">
|
|
105
|
-
<h1 className="text-2xl font-bold">Settings</h1>
|
|
106
|
-
<p className="text-muted-foreground">Manage your account settings.</p>
|
|
107
|
-
<div className="rounded-lg bg-white p-6 shadow-sm">
|
|
108
|
-
<h3 className="font-semibold">Settings Content</h3>
|
|
109
|
-
<p className="text-sm text-muted-foreground">
|
|
110
|
-
Settings form would go here
|
|
111
|
-
</p>
|
|
112
|
-
</div>
|
|
113
|
-
</div>
|
|
114
|
-
),
|
|
115
|
-
},
|
|
116
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
SidebarInset,
|
|
4
|
-
SidebarProvider as UISidebarProvider,
|
|
5
|
-
} from "../../ui/sidebar";
|
|
6
|
-
import { AppSidebar, AppSidebarProps } from "./components/app-sidebar";
|
|
7
|
-
import { HeaderSidebar } from "./components/header-sidebar";
|
|
8
|
-
import { FooterSidebar } from "./components/footer-sidebar";
|
|
9
|
-
import { cn } from "../../../lib/utils";
|
|
10
|
-
import { SidebarProvider } from "./provider";
|
|
11
|
-
|
|
12
|
-
interface SidebarProps extends AppSidebarProps {
|
|
13
|
-
children: React.ReactNode;
|
|
14
|
-
contentClassName?: string;
|
|
15
|
-
showFooter?: boolean;
|
|
16
|
-
defaultPath?: string;
|
|
17
|
-
defaultCollapsed?: boolean;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export const Sidebar = ({
|
|
21
|
-
children,
|
|
22
|
-
contentClassName,
|
|
23
|
-
showFooter = true,
|
|
24
|
-
defaultPath,
|
|
25
|
-
defaultCollapsed,
|
|
26
|
-
...rest
|
|
27
|
-
}: SidebarProps) => {
|
|
28
|
-
return (
|
|
29
|
-
<SidebarProvider
|
|
30
|
-
defaultPath={defaultPath}
|
|
31
|
-
defaultCollapsed={defaultCollapsed}
|
|
32
|
-
>
|
|
33
|
-
<UISidebarProvider>
|
|
34
|
-
<AppSidebar {...rest} />
|
|
35
|
-
<SidebarInset className="overflow-auto bg-slate-50">
|
|
36
|
-
<HeaderSidebar />
|
|
37
|
-
<main
|
|
38
|
-
className={cn(
|
|
39
|
-
"flex flex-1 flex-col gap-4 p-4 pt-0",
|
|
40
|
-
contentClassName
|
|
41
|
-
)}
|
|
42
|
-
>
|
|
43
|
-
{children}
|
|
44
|
-
</main>
|
|
45
|
-
{showFooter && <FooterSidebar />}
|
|
46
|
-
</SidebarInset>
|
|
47
|
-
</UISidebarProvider>
|
|
48
|
-
</SidebarProvider>
|
|
49
|
-
);
|
|
50
|
-
};
|
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import {
|
|
5
|
-
AudioWaveform,
|
|
6
|
-
BookOpen,
|
|
7
|
-
Bot,
|
|
8
|
-
Command,
|
|
9
|
-
Frame,
|
|
10
|
-
GalleryVerticalEnd,
|
|
11
|
-
Map,
|
|
12
|
-
PieChart,
|
|
13
|
-
Settings2,
|
|
14
|
-
SquareTerminal,
|
|
15
|
-
} from "lucide-react";
|
|
16
|
-
import {
|
|
17
|
-
Sidebar,
|
|
18
|
-
SidebarContent,
|
|
19
|
-
SidebarFooter,
|
|
20
|
-
SidebarHeader,
|
|
21
|
-
SidebarRail,
|
|
22
|
-
} from "../../../ui/sidebar";
|
|
23
|
-
import { TeamSwitcher } from "./team-switcher";
|
|
24
|
-
import { Menus } from "./menus";
|
|
25
|
-
import { NavProjects } from "./nav-projects";
|
|
26
|
-
import { NavUser } from "./nav-user";
|
|
27
|
-
|
|
28
|
-
// This is sample data.
|
|
29
|
-
const data = {
|
|
30
|
-
user: {
|
|
31
|
-
name: "shadcn",
|
|
32
|
-
email: "m@example.com",
|
|
33
|
-
avatar: "/avatars/shadcn.jpg",
|
|
34
|
-
},
|
|
35
|
-
teams: [
|
|
36
|
-
{
|
|
37
|
-
name: "Acme Inc",
|
|
38
|
-
logo: GalleryVerticalEnd,
|
|
39
|
-
plan: "Enterprise",
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
name: "Acme Corp.",
|
|
43
|
-
logo: AudioWaveform,
|
|
44
|
-
plan: "Startup",
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
name: "Evil Corp.",
|
|
48
|
-
logo: Command,
|
|
49
|
-
plan: "Free",
|
|
50
|
-
},
|
|
51
|
-
],
|
|
52
|
-
navMain: [
|
|
53
|
-
{
|
|
54
|
-
title: "Playground",
|
|
55
|
-
url: "#",
|
|
56
|
-
icon: SquareTerminal,
|
|
57
|
-
isActive: true,
|
|
58
|
-
items: [
|
|
59
|
-
{
|
|
60
|
-
title: "History",
|
|
61
|
-
url: "#",
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
title: "Starred",
|
|
65
|
-
url: "#",
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
title: "Settings",
|
|
69
|
-
url: "#",
|
|
70
|
-
},
|
|
71
|
-
],
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
title: "Models",
|
|
75
|
-
url: "#",
|
|
76
|
-
icon: Bot,
|
|
77
|
-
items: [
|
|
78
|
-
{
|
|
79
|
-
title: "Genesis",
|
|
80
|
-
url: "#",
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
title: "Explorer",
|
|
84
|
-
url: "#",
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
title: "Quantum",
|
|
88
|
-
url: "#",
|
|
89
|
-
},
|
|
90
|
-
],
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
title: "Documentation",
|
|
94
|
-
url: "#",
|
|
95
|
-
icon: BookOpen,
|
|
96
|
-
items: [
|
|
97
|
-
{
|
|
98
|
-
title: "Introduction",
|
|
99
|
-
url: "#",
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
title: "Get Started",
|
|
103
|
-
url: "#",
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
title: "Tutorials",
|
|
107
|
-
url: "#",
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
title: "Changelog",
|
|
111
|
-
url: "#",
|
|
112
|
-
},
|
|
113
|
-
],
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
title: "Settings",
|
|
117
|
-
url: "#",
|
|
118
|
-
icon: Settings2,
|
|
119
|
-
items: [
|
|
120
|
-
{
|
|
121
|
-
title: "General",
|
|
122
|
-
url: "#",
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
title: "Team",
|
|
126
|
-
url: "#",
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
title: "Billing",
|
|
130
|
-
url: "#",
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
title: "Limits",
|
|
134
|
-
url: "#",
|
|
135
|
-
},
|
|
136
|
-
],
|
|
137
|
-
},
|
|
138
|
-
],
|
|
139
|
-
projects: [
|
|
140
|
-
{
|
|
141
|
-
name: "Design Engineering",
|
|
142
|
-
url: "#",
|
|
143
|
-
icon: Frame,
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
name: "Sales & Marketing",
|
|
147
|
-
url: "#",
|
|
148
|
-
icon: PieChart,
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
name: "Travel",
|
|
152
|
-
url: "#",
|
|
153
|
-
icon: Map,
|
|
154
|
-
},
|
|
155
|
-
],
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
export type AppSidebarProps = {
|
|
159
|
-
footer?: () => React.ReactNode;
|
|
160
|
-
user?: {
|
|
161
|
-
email?: string;
|
|
162
|
-
name?: string;
|
|
163
|
-
};
|
|
164
|
-
enterprise?: {
|
|
165
|
-
name: string;
|
|
166
|
-
logo: () => React.ReactNode;
|
|
167
|
-
plan: string;
|
|
168
|
-
};
|
|
169
|
-
navbar: {
|
|
170
|
-
title: string;
|
|
171
|
-
items: {
|
|
172
|
-
title: string;
|
|
173
|
-
url: string;
|
|
174
|
-
isActive?: boolean | undefined;
|
|
175
|
-
icon?: () => React.ReactNode;
|
|
176
|
-
}[];
|
|
177
|
-
}[];
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
export function AppSidebar({
|
|
181
|
-
navbar = [],
|
|
182
|
-
user = {},
|
|
183
|
-
enterprise = {
|
|
184
|
-
name: "Acme Inc",
|
|
185
|
-
logo: GalleryVerticalEnd,
|
|
186
|
-
plan: "Enterprise",
|
|
187
|
-
},
|
|
188
|
-
footer,
|
|
189
|
-
...props
|
|
190
|
-
}: AppSidebarProps) {
|
|
191
|
-
return (
|
|
192
|
-
<Sidebar collapsible="icon" {...props}>
|
|
193
|
-
<SidebarHeader>
|
|
194
|
-
<TeamSwitcher teams={enterprise} />
|
|
195
|
-
</SidebarHeader>
|
|
196
|
-
<SidebarContent>
|
|
197
|
-
<Menus items={navbar} />
|
|
198
|
-
</SidebarContent>
|
|
199
|
-
{footer && <SidebarFooter>{footer()}</SidebarFooter>}
|
|
200
|
-
<SidebarRail />
|
|
201
|
-
</Sidebar>
|
|
202
|
-
);
|
|
203
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Separator } from "../../Separator";
|
|
2
|
-
|
|
3
|
-
export const FooterSidebar = () => {
|
|
4
|
-
return (
|
|
5
|
-
<footer className="h-[65px]">
|
|
6
|
-
<Separator />
|
|
7
|
-
<div className="flex items-center justify-between h-16 bg-background px-5">
|
|
8
|
-
<span className="text-sm text-muted-foreground">
|
|
9
|
-
© {new Date().getFullYear()} Your Company
|
|
10
|
-
</span>
|
|
11
|
-
<span className="text-sm text-muted-foreground">
|
|
12
|
-
Feito na terra do sol 🌞
|
|
13
|
-
</span>
|
|
14
|
-
</div>
|
|
15
|
-
</footer>
|
|
16
|
-
);
|
|
17
|
-
};
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { SidebarTrigger } from "../../../ui/sidebar";
|
|
3
|
-
import {
|
|
4
|
-
Breadcrumb,
|
|
5
|
-
BreadcrumbList,
|
|
6
|
-
BreadcrumbItem,
|
|
7
|
-
BreadcrumbPage,
|
|
8
|
-
BreadcrumbLink,
|
|
9
|
-
BreadcrumbSeparator,
|
|
10
|
-
} from "../../../ui/breadcrumb";
|
|
11
|
-
import { Separator } from "../../Separator";
|
|
12
|
-
import { useSidebar } from "../provider";
|
|
13
|
-
|
|
14
|
-
interface BreadcrumbItemProps {
|
|
15
|
-
isLast?: boolean;
|
|
16
|
-
path: string;
|
|
17
|
-
label: string;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const routeMap: Record<string, string> = {
|
|
21
|
-
dashboard: "Dashboard",
|
|
22
|
-
users: "Usuários",
|
|
23
|
-
documents: "Documentos",
|
|
24
|
-
settings: "Configurações",
|
|
25
|
-
create: "Criar",
|
|
26
|
-
edit: "Editar",
|
|
27
|
-
profile: "Perfil",
|
|
28
|
-
analytics: "Análises",
|
|
29
|
-
reports: "Relatórios",
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const BreadcrumbElement = ({ isLast, path, label }: BreadcrumbItemProps) => {
|
|
33
|
-
if (isLast) {
|
|
34
|
-
return (
|
|
35
|
-
<BreadcrumbItem>
|
|
36
|
-
<BreadcrumbPage className="capitalize">{label}</BreadcrumbPage>
|
|
37
|
-
</BreadcrumbItem>
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return (
|
|
42
|
-
<BreadcrumbItem>
|
|
43
|
-
<BreadcrumbLink href={path} className="capitalize">
|
|
44
|
-
{label}
|
|
45
|
-
</BreadcrumbLink>
|
|
46
|
-
<BreadcrumbSeparator />
|
|
47
|
-
</BreadcrumbItem>
|
|
48
|
-
);
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export const HeaderSidebar = () => {
|
|
52
|
-
const { currentPath } = useSidebar();
|
|
53
|
-
|
|
54
|
-
const breadcrumbItems = currentPath
|
|
55
|
-
.split("/")
|
|
56
|
-
.filter(Boolean)
|
|
57
|
-
.map((segment, index, array) => {
|
|
58
|
-
const path = `/${array.slice(0, index + 1).join("/")}`;
|
|
59
|
-
const isLast = index === array.length - 1;
|
|
60
|
-
const label = routeMap[segment] || segment;
|
|
61
|
-
|
|
62
|
-
return {
|
|
63
|
-
path,
|
|
64
|
-
label,
|
|
65
|
-
isLast,
|
|
66
|
-
};
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
return (
|
|
70
|
-
<header className="flex h-16 shrink-0 items-center border-b border-border bg-background px-4 transition-[width,height] ease-linear group-has-[[data-collapsible=icon]]/sidebar-wrapper:h-12">
|
|
71
|
-
<div className="flex items-center gap-4">
|
|
72
|
-
<SidebarTrigger className="-ml-2 h-9 w-9" />
|
|
73
|
-
<Separator orientation="vertical" className="h-6" />
|
|
74
|
-
<Breadcrumb>
|
|
75
|
-
<BreadcrumbList>
|
|
76
|
-
<BreadcrumbItem>
|
|
77
|
-
<BreadcrumbLink href="/" className="capitalize">
|
|
78
|
-
Home
|
|
79
|
-
</BreadcrumbLink>
|
|
80
|
-
<BreadcrumbSeparator />
|
|
81
|
-
</BreadcrumbItem>
|
|
82
|
-
{breadcrumbItems.map((item) => (
|
|
83
|
-
<BreadcrumbElement key={item.path} {...item} />
|
|
84
|
-
))}
|
|
85
|
-
</BreadcrumbList>
|
|
86
|
-
</Breadcrumb>
|
|
87
|
-
</div>
|
|
88
|
-
</header>
|
|
89
|
-
);
|
|
90
|
-
};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { cn } from "../../../../lib/utils";
|
|
4
|
-
import {
|
|
5
|
-
SidebarGroup,
|
|
6
|
-
SidebarGroupLabel,
|
|
7
|
-
SidebarMenu,
|
|
8
|
-
SidebarMenuButton,
|
|
9
|
-
SidebarMenuItem,
|
|
10
|
-
} from "../../../ui/sidebar";
|
|
11
|
-
import React from "react";
|
|
12
|
-
|
|
13
|
-
export function Menus({
|
|
14
|
-
items,
|
|
15
|
-
}: {
|
|
16
|
-
items: {
|
|
17
|
-
title: string;
|
|
18
|
-
url: string;
|
|
19
|
-
items?: {
|
|
20
|
-
title: string;
|
|
21
|
-
url: string;
|
|
22
|
-
icon?: () => React.ReactNode;
|
|
23
|
-
isActive?: boolean | undefined;
|
|
24
|
-
}[];
|
|
25
|
-
}[];
|
|
26
|
-
}) {
|
|
27
|
-
return (
|
|
28
|
-
<>
|
|
29
|
-
{items.map((item, index) => {
|
|
30
|
-
return (
|
|
31
|
-
<SidebarGroup key={index}>
|
|
32
|
-
<SidebarGroupLabel>{item.title}</SidebarGroupLabel>
|
|
33
|
-
<SidebarMenu>
|
|
34
|
-
{item.items?.map((subItem) => (
|
|
35
|
-
<SidebarMenuItem key={subItem.title}>
|
|
36
|
-
<SidebarMenuButton
|
|
37
|
-
asChild
|
|
38
|
-
className={cn(
|
|
39
|
-
subItem?.isActive && "bg-sidebar-accent font-semibold"
|
|
40
|
-
)}
|
|
41
|
-
>
|
|
42
|
-
<a href={subItem.url}>
|
|
43
|
-
{subItem?.icon && subItem.icon()}
|
|
44
|
-
<span>{subItem.title}</span>
|
|
45
|
-
</a>
|
|
46
|
-
</SidebarMenuButton>
|
|
47
|
-
</SidebarMenuItem>
|
|
48
|
-
))}
|
|
49
|
-
</SidebarMenu>
|
|
50
|
-
</SidebarGroup>
|
|
51
|
-
);
|
|
52
|
-
})}
|
|
53
|
-
</>
|
|
54
|
-
);
|
|
55
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
Folder,
|
|
5
|
-
Forward,
|
|
6
|
-
MoreHorizontal,
|
|
7
|
-
Trash2,
|
|
8
|
-
type LucideIcon,
|
|
9
|
-
} from "lucide-react";
|
|
10
|
-
import {
|
|
11
|
-
SidebarGroup,
|
|
12
|
-
SidebarGroupLabel,
|
|
13
|
-
SidebarMenu,
|
|
14
|
-
SidebarMenuAction,
|
|
15
|
-
SidebarMenuButton,
|
|
16
|
-
SidebarMenuItem,
|
|
17
|
-
useSidebar,
|
|
18
|
-
} from "../../../ui/sidebar";
|
|
19
|
-
import {
|
|
20
|
-
DropdownMenu,
|
|
21
|
-
DropdownMenuItem,
|
|
22
|
-
DropdownMenuSeparator,
|
|
23
|
-
DropdownMenuContent,
|
|
24
|
-
DropdownMenuTrigger,
|
|
25
|
-
} from "../../../ui/dropdown-menu";
|
|
26
|
-
|
|
27
|
-
export function NavProjects({
|
|
28
|
-
projects,
|
|
29
|
-
}: {
|
|
30
|
-
projects: {
|
|
31
|
-
name: string;
|
|
32
|
-
url: string;
|
|
33
|
-
icon: LucideIcon;
|
|
34
|
-
}[];
|
|
35
|
-
}) {
|
|
36
|
-
const { isMobile } = useSidebar();
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<SidebarGroup className="group-data-[collapsible=icon]:hidden">
|
|
40
|
-
<SidebarGroupLabel>Projects</SidebarGroupLabel>
|
|
41
|
-
<SidebarMenu>
|
|
42
|
-
{projects.map((item) => (
|
|
43
|
-
<SidebarMenuItem key={item.name}>
|
|
44
|
-
<SidebarMenuButton asChild>
|
|
45
|
-
<a href={item.url}>
|
|
46
|
-
<item.icon />
|
|
47
|
-
<span>{item.name}</span>
|
|
48
|
-
</a>
|
|
49
|
-
</SidebarMenuButton>
|
|
50
|
-
<DropdownMenu>
|
|
51
|
-
<DropdownMenuTrigger asChild>
|
|
52
|
-
<SidebarMenuAction showOnHover>
|
|
53
|
-
<MoreHorizontal />
|
|
54
|
-
<span className="sr-only">More</span>
|
|
55
|
-
</SidebarMenuAction>
|
|
56
|
-
</DropdownMenuTrigger>
|
|
57
|
-
<DropdownMenuContent
|
|
58
|
-
className="w-48 rounded-lg"
|
|
59
|
-
side={isMobile ? "bottom" : "right"}
|
|
60
|
-
align={isMobile ? "end" : "start"}
|
|
61
|
-
>
|
|
62
|
-
<DropdownMenuItem>
|
|
63
|
-
<Folder className="text-muted-foreground" />
|
|
64
|
-
<span>View Project</span>
|
|
65
|
-
</DropdownMenuItem>
|
|
66
|
-
<DropdownMenuItem>
|
|
67
|
-
<Forward className="text-muted-foreground" />
|
|
68
|
-
<span>Share Project</span>
|
|
69
|
-
</DropdownMenuItem>
|
|
70
|
-
<DropdownMenuSeparator />
|
|
71
|
-
<DropdownMenuItem>
|
|
72
|
-
<Trash2 className="text-muted-foreground" />
|
|
73
|
-
<span>Delete Project</span>
|
|
74
|
-
</DropdownMenuItem>
|
|
75
|
-
</DropdownMenuContent>
|
|
76
|
-
</DropdownMenu>
|
|
77
|
-
</SidebarMenuItem>
|
|
78
|
-
))}
|
|
79
|
-
<SidebarMenuItem>
|
|
80
|
-
<SidebarMenuButton className="text-sidebar-foreground/70">
|
|
81
|
-
<MoreHorizontal className="text-sidebar-foreground/70" />
|
|
82
|
-
<span>More</span>
|
|
83
|
-
</SidebarMenuButton>
|
|
84
|
-
</SidebarMenuItem>
|
|
85
|
-
</SidebarMenu>
|
|
86
|
-
</SidebarGroup>
|
|
87
|
-
);
|
|
88
|
-
}
|