@phsa.tec/design-system-react 0.1.6 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (213) hide show
  1. package/README.md +390 -209
  2. package/dist/index.d.mts +485 -0
  3. package/dist/index.d.ts +485 -0
  4. package/dist/index.js +4259 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/index.mjs +4186 -0
  7. package/dist/index.mjs.map +1 -0
  8. package/package.json +46 -6
  9. package/.eslintrc.json +0 -7
  10. package/.github/workflows/deploy-storybook.yml +0 -75
  11. package/.storybook/main.ts +0 -16
  12. package/.storybook/preview.ts +0 -15
  13. package/components.json +0 -21
  14. package/jest.config.ts +0 -25
  15. package/next.config.ts +0 -7
  16. package/postcss.config.mjs +0 -8
  17. package/public/file.svg +0 -1
  18. package/public/globe.svg +0 -1
  19. package/public/next.svg +0 -1
  20. package/public/vercel.svg +0 -1
  21. package/public/window.svg +0 -1
  22. package/src/app/columns.tsx +0 -178
  23. package/src/app/favicon.ico +0 -0
  24. package/src/app/fonts/GeistMonoVF.woff +0 -0
  25. package/src/app/fonts/GeistVF.woff +0 -0
  26. package/src/app/globals.css +0 -94
  27. package/src/app/layout.tsx +0 -35
  28. package/src/app/page.tsx +0 -7
  29. package/src/components/actions/AlertDialog/AlertDialog.tsx +0 -45
  30. package/src/components/actions/AlertDialog/alert-dialog.stories.tsx +0 -21
  31. package/src/components/actions/AlertDialog/index.ts +0 -1
  32. package/src/components/actions/Button/Button.stories.ts +0 -38
  33. package/src/components/actions/Button/Button.tsx +0 -23
  34. package/src/components/actions/Button/index.ts +0 -1
  35. package/src/components/actions/Collapsible/index.ts +0 -1
  36. package/src/components/actions/Dialog/Dialog.stories.tsx +0 -70
  37. package/src/components/actions/Dialog/Dialog.tsx +0 -87
  38. package/src/components/actions/Dialog/components/DialogWithActions/index.tsx +0 -40
  39. package/src/components/actions/Dialog/index.ts +0 -1
  40. package/src/components/actions/Steps/Steps.stories.tsx +0 -25
  41. package/src/components/actions/Steps/Steps.tsx +0 -51
  42. package/src/components/actions/Steps/index.ts +0 -1
  43. package/src/components/actions/index.ts +0 -5
  44. package/src/components/dataDisplay/Avatar/Avatar.stories.tsx +0 -22
  45. package/src/components/dataDisplay/Avatar/Avatar.tsx +0 -21
  46. package/src/components/dataDisplay/Avatar/index.ts +0 -2
  47. package/src/components/dataDisplay/Badge/Badge.stories.tsx +0 -36
  48. package/src/components/dataDisplay/Badge/index.ts +0 -1
  49. package/src/components/dataDisplay/Card/Card.stories.tsx +0 -24
  50. package/src/components/dataDisplay/Card/Card.tsx +0 -34
  51. package/src/components/dataDisplay/Card/index.ts +0 -1
  52. package/src/components/dataDisplay/DataPairList/DataPairList.tsx +0 -56
  53. package/src/components/dataDisplay/DataPairList/data-pair-list.stories.tsx +0 -87
  54. package/src/components/dataDisplay/DataPairList/index.ts +0 -2
  55. package/src/components/dataDisplay/DataPairList/types.ts +0 -10
  56. package/src/components/dataDisplay/DropDownMenu/index.ts +0 -1
  57. package/src/components/dataDisplay/ErrorMessage/ErrorMessage.tsx +0 -6
  58. package/src/components/dataDisplay/ErrorMessage/index.ts +0 -1
  59. package/src/components/dataDisplay/Icon/Icon.stories.tsx +0 -21
  60. package/src/components/dataDisplay/Icon/Icon.tsx +0 -47
  61. package/src/components/dataDisplay/Icon/index.ts +0 -1
  62. package/src/components/dataDisplay/Icon/types.ts +0 -6
  63. package/src/components/dataDisplay/Label/Label.stories.tsx +0 -21
  64. package/src/components/dataDisplay/Label/Label.tsx +0 -10
  65. package/src/components/dataDisplay/Label/index.ts +0 -1
  66. package/src/components/dataDisplay/Table/Table.tsx +0 -173
  67. package/src/components/dataDisplay/Table/columns.tsx +0 -223
  68. package/src/components/dataDisplay/Table/components/DynamicTable/data-table-column-header.tsx +0 -72
  69. package/src/components/dataDisplay/Table/components/DynamicTable/data-table-pagination.tsx +0 -91
  70. package/src/components/dataDisplay/Table/components/DynamicTable/data-table-toolbar.tsx +0 -17
  71. package/src/components/dataDisplay/Table/components/DynamicTable/data-table-view-options.tsx +0 -58
  72. package/src/components/dataDisplay/Table/components/DynamicTable/data-table.stories.tsx +0 -118
  73. package/src/components/dataDisplay/Table/components/DynamicTable/index.tsx +0 -136
  74. package/src/components/dataDisplay/Table/components/DynamicTable/types.ts +0 -43
  75. package/src/components/dataDisplay/Table/custom/CustomTable/data-table-column-header.tsx +0 -71
  76. package/src/components/dataDisplay/Table/custom/CustomTable/data-table-faceted-filter.tsx +0 -147
  77. package/src/components/dataDisplay/Table/custom/CustomTable/data-table-pagination.tsx +0 -97
  78. package/src/components/dataDisplay/Table/custom/CustomTable/data-table-row-actions.tsx +0 -78
  79. package/src/components/dataDisplay/Table/custom/CustomTable/data-table-toolbar.tsx +0 -60
  80. package/src/components/dataDisplay/Table/custom/CustomTable/data-table-view-options.tsx +0 -59
  81. package/src/components/dataDisplay/Table/custom/CustomTable/data-table.tsx +0 -145
  82. package/src/components/dataDisplay/Table/custom/CustomTable/data.ts +0 -71
  83. package/src/components/dataDisplay/Table/custom/CustomTable/index.tsx +0 -34
  84. package/src/components/dataDisplay/Table/custom/CustomTable/schema.ts +0 -11
  85. package/src/components/dataDisplay/Table/index.ts +0 -2
  86. package/src/components/dataDisplay/Table/table.stories.tsx +0 -147
  87. package/src/components/dataDisplay/Table/types.ts +0 -15
  88. package/src/components/dataDisplay/Tabs/Tabs.stories.tsx +0 -34
  89. package/src/components/dataDisplay/Tabs/Tabs.tsx +0 -53
  90. package/src/components/dataDisplay/Tabs/index.ts +0 -1
  91. package/src/components/dataDisplay/Text/Text.stories.tsx +0 -66
  92. package/src/components/dataDisplay/Text/Text.tsx +0 -56
  93. package/src/components/dataDisplay/Text/index.ts +0 -1
  94. package/src/components/dataDisplay/index.ts +0 -8
  95. package/src/components/dataInput/Input/components/Input/Input.stories.tsx +0 -99
  96. package/src/components/dataInput/Input/components/Input/InputBase.tsx +0 -50
  97. package/src/components/dataInput/Input/components/Input/__tests__/input.test.tsx +0 -38
  98. package/src/components/dataInput/Input/components/Input/index.tsx +0 -48
  99. package/src/components/dataInput/Input/components/Input/types.ts +0 -15
  100. package/src/components/dataInput/Input/components/InputBase/index.tsx +0 -31
  101. package/src/components/dataInput/Input/components/MaskInput/__tests__/mask-input.test.tsx +0 -77
  102. package/src/components/dataInput/Input/components/MaskInput/index.ts +0 -1
  103. package/src/components/dataInput/Input/components/MaskInput/mask-input.stories.tsx +0 -85
  104. package/src/components/dataInput/Input/components/MaskInput/mask-input.tsx +0 -73
  105. package/src/components/dataInput/Input/components/MultipleInput/MultipleInput.tsx +0 -105
  106. package/src/components/dataInput/Input/components/MultipleInput/MultipleInputBase.tsx +0 -100
  107. package/src/components/dataInput/Input/components/MultipleInput/MultipleMaskInput.tsx +0 -35
  108. package/src/components/dataInput/Input/components/MultipleInput/MultipleNumberInput.tsx +0 -35
  109. package/src/components/dataInput/Input/components/MultipleInput/__tests__/multiple-input.test.tsx +0 -152
  110. package/src/components/dataInput/Input/components/MultipleInput/index.ts +0 -2
  111. package/src/components/dataInput/Input/components/MultipleInput/multiple-input.stories.tsx +0 -96
  112. package/src/components/dataInput/Input/components/NumberInput/__tests__/number-input.test.tsx +0 -175
  113. package/src/components/dataInput/Input/components/NumberInput/index.ts +0 -1
  114. package/src/components/dataInput/Input/components/NumberInput/number-input.stories.tsx +0 -76
  115. package/src/components/dataInput/Input/components/NumberInput/number-input.tsx +0 -70
  116. package/src/components/dataInput/Input/index.ts +0 -4
  117. package/src/components/dataInput/Select/MultiSelect/MultiSelect.stories.tsx +0 -119
  118. package/src/components/dataInput/Select/MultiSelect/MultiSelectBase.tsx +0 -135
  119. package/src/components/dataInput/Select/MultiSelect/index.tsx +0 -75
  120. package/src/components/dataInput/Select/Select.stories.tsx +0 -61
  121. package/src/components/dataInput/Select/Select.tsx +0 -73
  122. package/src/components/dataInput/Select/SelectBase.tsx +0 -58
  123. package/src/components/dataInput/Select/index.ts +0 -2
  124. package/src/components/dataInput/Switch/Switch.stories.tsx +0 -75
  125. package/src/components/dataInput/Switch/Switch.tsx +0 -52
  126. package/src/components/dataInput/Switch/index.ts +0 -1
  127. package/src/components/dataInput/checkbox/Checkbox.tsx +0 -57
  128. package/src/components/dataInput/checkbox/Checkbox_old.tsx +0 -58
  129. package/src/components/dataInput/checkbox/Checkout.stories.tsx +0 -62
  130. package/src/components/dataInput/checkbox/index.ts +0 -1
  131. package/src/components/dataInput/form/Form.tsx +0 -47
  132. package/src/components/dataInput/form/index.ts +0 -3
  133. package/src/components/dataInput/index.ts +0 -5
  134. package/src/components/feedback/ErrorLabel/index.tsx +0 -24
  135. package/src/components/feedback/Spinner/index.ts +0 -1
  136. package/src/components/feedback/Toast/Toast.stories.tsx +0 -45
  137. package/src/components/feedback/Toast/index.ts +0 -2
  138. package/src/components/feedback/index.ts +0 -2
  139. package/src/components/index.ts +0 -6
  140. package/src/components/layout/Crud/components/Table/index.tsx +0 -183
  141. package/src/components/layout/Crud/components/Table/types.ts +0 -15
  142. package/src/components/layout/Crud/crud.stories.tsx +0 -317
  143. package/src/components/layout/Crud/hook/useCrudLayout/index.tsx +0 -94
  144. package/src/components/layout/Crud/hook/useRequest/index.tsx +0 -156
  145. package/src/components/layout/Crud/index.tsx +0 -295
  146. package/src/components/layout/Crud/store/CrudLayoutStore.ts +0 -75
  147. package/src/components/layout/Crud/types.ts +0 -14
  148. package/src/components/layout/Drawer/CustomDrawer/index.tsx +0 -33
  149. package/src/components/layout/Drawer/Drawer.stories.tsx +0 -80
  150. package/src/components/layout/Drawer/index.ts +0 -2
  151. package/src/components/layout/PageLayout/PageLayout.stories.tsx +0 -42
  152. package/src/components/layout/PageLayout/index.tsx +0 -28
  153. package/src/components/layout/Separator/index.ts +0 -1
  154. package/src/components/layout/Sheet/Sheet.stories.tsx +0 -28
  155. package/src/components/layout/Sheet/Sheet.tsx +0 -22
  156. package/src/components/layout/Sheet/index.ts +0 -1
  157. package/src/components/layout/Sidebar/Sidebar.stories.tsx +0 -116
  158. package/src/components/layout/Sidebar/Sidebar.tsx +0 -50
  159. package/src/components/layout/Sidebar/components/app-sidebar.tsx +0 -203
  160. package/src/components/layout/Sidebar/components/footer-sidebar.tsx +0 -17
  161. package/src/components/layout/Sidebar/components/header-sidebar.tsx +0 -90
  162. package/src/components/layout/Sidebar/components/menus.tsx +0 -55
  163. package/src/components/layout/Sidebar/components/nav-projects.tsx +0 -88
  164. package/src/components/layout/Sidebar/components/nav-user.tsx +0 -114
  165. package/src/components/layout/Sidebar/components/team-switcher.tsx +0 -85
  166. package/src/components/layout/Sidebar/index.ts +0 -2
  167. package/src/components/layout/Sidebar/provider/index.tsx +0 -51
  168. package/src/components/layout/Tabs/Tabs.tsx +0 -51
  169. package/src/components/layout/Tabs/index.ts +0 -1
  170. package/src/components/layout/Tabs/tabs.stories.tsx +0 -57
  171. package/src/components/layout/index.ts +0 -6
  172. package/src/components/navigation/Breadcrumbs/Breadcrumbs.tsx +0 -66
  173. package/src/components/navigation/Breadcrumbs/index.ts +0 -2
  174. package/src/components/navigation/index.ts +0 -1
  175. package/src/components/ui/alert-dialog.tsx +0 -141
  176. package/src/components/ui/alert.tsx +0 -59
  177. package/src/components/ui/avatar.tsx +0 -50
  178. package/src/components/ui/badge.tsx +0 -40
  179. package/src/components/ui/breadcrumb.tsx +0 -115
  180. package/src/components/ui/button.tsx +0 -57
  181. package/src/components/ui/card.tsx +0 -83
  182. package/src/components/ui/checkbox.tsx +0 -34
  183. package/src/components/ui/collapsible.tsx +0 -11
  184. package/src/components/ui/command.tsx +0 -153
  185. package/src/components/ui/dialog.tsx +0 -124
  186. package/src/components/ui/drawer.tsx +0 -117
  187. package/src/components/ui/dropdown-menu.tsx +0 -201
  188. package/src/components/ui/form.tsx +0 -179
  189. package/src/components/ui/input.tsx +0 -24
  190. package/src/components/ui/label.tsx +0 -30
  191. package/src/components/ui/popover.tsx +0 -33
  192. package/src/components/ui/select.tsx +0 -161
  193. package/src/components/ui/separator.tsx +0 -31
  194. package/src/components/ui/sheet.tsx +0 -140
  195. package/src/components/ui/sidebar.tsx +0 -763
  196. package/src/components/ui/skeleton.tsx +0 -15
  197. package/src/components/ui/sonner.tsx +0 -31
  198. package/src/components/ui/spinner.tsx +0 -54
  199. package/src/components/ui/switch.tsx +0 -33
  200. package/src/components/ui/table.tsx +0 -120
  201. package/src/components/ui/tabs.tsx +0 -55
  202. package/src/components/ui/toast.tsx +0 -130
  203. package/src/components/ui/toaster.tsx +0 -35
  204. package/src/components/ui/tooltip.tsx +0 -32
  205. package/src/hooks/use-conditional-controller.tsx +0 -35
  206. package/src/hooks/use-mask.tsx +0 -116
  207. package/src/hooks/use-mobile.tsx +0 -19
  208. package/src/hooks/use-toast.ts +0 -191
  209. package/src/index.ts +0 -1
  210. package/src/introduction.mdx +0 -132
  211. package/src/lib/utils.ts +0 -6
  212. package/tailwind.config.ts +0 -83
  213. package/tsconfig.json +0 -27
@@ -1,28 +0,0 @@
1
- import { Text } from "../../../components/dataDisplay";
2
- import { PropsWithChildren } from "react";
3
-
4
- export type PageLayoutProps = PropsWithChildren & {
5
- title: string;
6
- subtitle?: string;
7
- header?: React.ReactNode;
8
- };
9
-
10
- export const PageLayout = ({
11
- subtitle,
12
- title,
13
- children,
14
- header,
15
- }: PageLayoutProps) => {
16
- return (
17
- <div className="m-5 p-4 bg-white">
18
- <div className="flex justify-between">
19
- <div>
20
- {title && <Text variant="title">{title}</Text>}
21
- {subtitle && <Text variant="muted">{subtitle}</Text>}
22
- </div>
23
- {header}
24
- </div>
25
- <div className="mt-5">{children}</div>
26
- </div>
27
- );
28
- };
@@ -1 +0,0 @@
1
- export * from "../../ui/separator";
@@ -1,28 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/nextjs";
2
-
3
- import { Sheet } from "./index";
4
-
5
- const meta = {
6
- title: "Layout/Sheet",
7
- component: Sheet,
8
- parameters: {
9
- layout: "centered",
10
- },
11
- args: {
12
- open: false,
13
- children: "Sheet content",
14
- },
15
- argTypes: {
16
- open: {
17
- control: {
18
- type: "boolean",
19
- },
20
- },
21
- },
22
- tags: ["autodocs"],
23
- } satisfies Meta<typeof Sheet>;
24
-
25
- export default meta;
26
- type Story = StoryObj<typeof meta>;
27
-
28
- export const Default: Story = {};
@@ -1,22 +0,0 @@
1
- import {
2
- Sheet as SheetComponent,
3
- SheetContent,
4
- } from "../../../components/ui/sheet";
5
- import { PropsWithChildren } from "react";
6
-
7
- export type SheetProps = typeof SheetComponent &
8
- PropsWithChildren & {
9
- side?: "left" | "right" | "top" | "bottom";
10
- className?: string;
11
- onOpenChange?: (open: boolean) => void;
12
- open?: boolean;
13
- };
14
- export function Sheet({ side, className, children, ...props }: SheetProps) {
15
- return (
16
- <SheetComponent {...props}>
17
- <SheetContent side={side} className={className}>
18
- {children}
19
- </SheetContent>
20
- </SheetComponent>
21
- );
22
- }
@@ -1 +0,0 @@
1
- export * from "./Sheet";
@@ -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
- }