@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.
Files changed (217) 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/dist/styles.css +2534 -0
  9. package/dist/styles.css.map +1 -0
  10. package/dist/styles.d.mts +2 -0
  11. package/dist/styles.d.ts +2 -0
  12. package/package.json +46 -6
  13. package/.eslintrc.json +0 -7
  14. package/.github/workflows/deploy-storybook.yml +0 -75
  15. package/.storybook/main.ts +0 -16
  16. package/.storybook/preview.ts +0 -15
  17. package/components.json +0 -21
  18. package/jest.config.ts +0 -25
  19. package/next.config.ts +0 -7
  20. package/postcss.config.mjs +0 -8
  21. package/public/file.svg +0 -1
  22. package/public/globe.svg +0 -1
  23. package/public/next.svg +0 -1
  24. package/public/vercel.svg +0 -1
  25. package/public/window.svg +0 -1
  26. package/src/app/columns.tsx +0 -178
  27. package/src/app/favicon.ico +0 -0
  28. package/src/app/fonts/GeistMonoVF.woff +0 -0
  29. package/src/app/fonts/GeistVF.woff +0 -0
  30. package/src/app/globals.css +0 -94
  31. package/src/app/layout.tsx +0 -35
  32. package/src/app/page.tsx +0 -7
  33. package/src/components/actions/AlertDialog/AlertDialog.tsx +0 -45
  34. package/src/components/actions/AlertDialog/alert-dialog.stories.tsx +0 -21
  35. package/src/components/actions/AlertDialog/index.ts +0 -1
  36. package/src/components/actions/Button/Button.stories.ts +0 -38
  37. package/src/components/actions/Button/Button.tsx +0 -23
  38. package/src/components/actions/Button/index.ts +0 -1
  39. package/src/components/actions/Collapsible/index.ts +0 -1
  40. package/src/components/actions/Dialog/Dialog.stories.tsx +0 -70
  41. package/src/components/actions/Dialog/Dialog.tsx +0 -87
  42. package/src/components/actions/Dialog/components/DialogWithActions/index.tsx +0 -40
  43. package/src/components/actions/Dialog/index.ts +0 -1
  44. package/src/components/actions/Steps/Steps.stories.tsx +0 -25
  45. package/src/components/actions/Steps/Steps.tsx +0 -51
  46. package/src/components/actions/Steps/index.ts +0 -1
  47. package/src/components/actions/index.ts +0 -5
  48. package/src/components/dataDisplay/Avatar/Avatar.stories.tsx +0 -22
  49. package/src/components/dataDisplay/Avatar/Avatar.tsx +0 -21
  50. package/src/components/dataDisplay/Avatar/index.ts +0 -2
  51. package/src/components/dataDisplay/Badge/Badge.stories.tsx +0 -36
  52. package/src/components/dataDisplay/Badge/index.ts +0 -1
  53. package/src/components/dataDisplay/Card/Card.stories.tsx +0 -24
  54. package/src/components/dataDisplay/Card/Card.tsx +0 -34
  55. package/src/components/dataDisplay/Card/index.ts +0 -1
  56. package/src/components/dataDisplay/DataPairList/DataPairList.tsx +0 -56
  57. package/src/components/dataDisplay/DataPairList/data-pair-list.stories.tsx +0 -87
  58. package/src/components/dataDisplay/DataPairList/index.ts +0 -2
  59. package/src/components/dataDisplay/DataPairList/types.ts +0 -10
  60. package/src/components/dataDisplay/DropDownMenu/index.ts +0 -1
  61. package/src/components/dataDisplay/ErrorMessage/ErrorMessage.tsx +0 -6
  62. package/src/components/dataDisplay/ErrorMessage/index.ts +0 -1
  63. package/src/components/dataDisplay/Icon/Icon.stories.tsx +0 -21
  64. package/src/components/dataDisplay/Icon/Icon.tsx +0 -47
  65. package/src/components/dataDisplay/Icon/index.ts +0 -1
  66. package/src/components/dataDisplay/Icon/types.ts +0 -6
  67. package/src/components/dataDisplay/Label/Label.stories.tsx +0 -21
  68. package/src/components/dataDisplay/Label/Label.tsx +0 -10
  69. package/src/components/dataDisplay/Label/index.ts +0 -1
  70. package/src/components/dataDisplay/Table/Table.tsx +0 -173
  71. package/src/components/dataDisplay/Table/columns.tsx +0 -223
  72. package/src/components/dataDisplay/Table/components/DynamicTable/data-table-column-header.tsx +0 -72
  73. package/src/components/dataDisplay/Table/components/DynamicTable/data-table-pagination.tsx +0 -91
  74. package/src/components/dataDisplay/Table/components/DynamicTable/data-table-toolbar.tsx +0 -17
  75. package/src/components/dataDisplay/Table/components/DynamicTable/data-table-view-options.tsx +0 -58
  76. package/src/components/dataDisplay/Table/components/DynamicTable/data-table.stories.tsx +0 -118
  77. package/src/components/dataDisplay/Table/components/DynamicTable/index.tsx +0 -136
  78. package/src/components/dataDisplay/Table/components/DynamicTable/types.ts +0 -43
  79. package/src/components/dataDisplay/Table/custom/CustomTable/data-table-column-header.tsx +0 -71
  80. package/src/components/dataDisplay/Table/custom/CustomTable/data-table-faceted-filter.tsx +0 -147
  81. package/src/components/dataDisplay/Table/custom/CustomTable/data-table-pagination.tsx +0 -97
  82. package/src/components/dataDisplay/Table/custom/CustomTable/data-table-row-actions.tsx +0 -78
  83. package/src/components/dataDisplay/Table/custom/CustomTable/data-table-toolbar.tsx +0 -60
  84. package/src/components/dataDisplay/Table/custom/CustomTable/data-table-view-options.tsx +0 -59
  85. package/src/components/dataDisplay/Table/custom/CustomTable/data-table.tsx +0 -145
  86. package/src/components/dataDisplay/Table/custom/CustomTable/data.ts +0 -71
  87. package/src/components/dataDisplay/Table/custom/CustomTable/index.tsx +0 -34
  88. package/src/components/dataDisplay/Table/custom/CustomTable/schema.ts +0 -11
  89. package/src/components/dataDisplay/Table/index.ts +0 -2
  90. package/src/components/dataDisplay/Table/table.stories.tsx +0 -147
  91. package/src/components/dataDisplay/Table/types.ts +0 -15
  92. package/src/components/dataDisplay/Tabs/Tabs.stories.tsx +0 -34
  93. package/src/components/dataDisplay/Tabs/Tabs.tsx +0 -53
  94. package/src/components/dataDisplay/Tabs/index.ts +0 -1
  95. package/src/components/dataDisplay/Text/Text.stories.tsx +0 -66
  96. package/src/components/dataDisplay/Text/Text.tsx +0 -56
  97. package/src/components/dataDisplay/Text/index.ts +0 -1
  98. package/src/components/dataDisplay/index.ts +0 -8
  99. package/src/components/dataInput/Input/components/Input/Input.stories.tsx +0 -99
  100. package/src/components/dataInput/Input/components/Input/InputBase.tsx +0 -50
  101. package/src/components/dataInput/Input/components/Input/__tests__/input.test.tsx +0 -38
  102. package/src/components/dataInput/Input/components/Input/index.tsx +0 -48
  103. package/src/components/dataInput/Input/components/Input/types.ts +0 -15
  104. package/src/components/dataInput/Input/components/InputBase/index.tsx +0 -31
  105. package/src/components/dataInput/Input/components/MaskInput/__tests__/mask-input.test.tsx +0 -77
  106. package/src/components/dataInput/Input/components/MaskInput/index.ts +0 -1
  107. package/src/components/dataInput/Input/components/MaskInput/mask-input.stories.tsx +0 -85
  108. package/src/components/dataInput/Input/components/MaskInput/mask-input.tsx +0 -73
  109. package/src/components/dataInput/Input/components/MultipleInput/MultipleInput.tsx +0 -105
  110. package/src/components/dataInput/Input/components/MultipleInput/MultipleInputBase.tsx +0 -100
  111. package/src/components/dataInput/Input/components/MultipleInput/MultipleMaskInput.tsx +0 -35
  112. package/src/components/dataInput/Input/components/MultipleInput/MultipleNumberInput.tsx +0 -35
  113. package/src/components/dataInput/Input/components/MultipleInput/__tests__/multiple-input.test.tsx +0 -152
  114. package/src/components/dataInput/Input/components/MultipleInput/index.ts +0 -2
  115. package/src/components/dataInput/Input/components/MultipleInput/multiple-input.stories.tsx +0 -96
  116. package/src/components/dataInput/Input/components/NumberInput/__tests__/number-input.test.tsx +0 -175
  117. package/src/components/dataInput/Input/components/NumberInput/index.ts +0 -1
  118. package/src/components/dataInput/Input/components/NumberInput/number-input.stories.tsx +0 -76
  119. package/src/components/dataInput/Input/components/NumberInput/number-input.tsx +0 -70
  120. package/src/components/dataInput/Input/index.ts +0 -4
  121. package/src/components/dataInput/Select/MultiSelect/MultiSelect.stories.tsx +0 -119
  122. package/src/components/dataInput/Select/MultiSelect/MultiSelectBase.tsx +0 -135
  123. package/src/components/dataInput/Select/MultiSelect/index.tsx +0 -75
  124. package/src/components/dataInput/Select/Select.stories.tsx +0 -61
  125. package/src/components/dataInput/Select/Select.tsx +0 -73
  126. package/src/components/dataInput/Select/SelectBase.tsx +0 -58
  127. package/src/components/dataInput/Select/index.ts +0 -2
  128. package/src/components/dataInput/Switch/Switch.stories.tsx +0 -75
  129. package/src/components/dataInput/Switch/Switch.tsx +0 -52
  130. package/src/components/dataInput/Switch/index.ts +0 -1
  131. package/src/components/dataInput/checkbox/Checkbox.tsx +0 -57
  132. package/src/components/dataInput/checkbox/Checkbox_old.tsx +0 -58
  133. package/src/components/dataInput/checkbox/Checkout.stories.tsx +0 -62
  134. package/src/components/dataInput/checkbox/index.ts +0 -1
  135. package/src/components/dataInput/form/Form.tsx +0 -47
  136. package/src/components/dataInput/form/index.ts +0 -3
  137. package/src/components/dataInput/index.ts +0 -5
  138. package/src/components/feedback/ErrorLabel/index.tsx +0 -24
  139. package/src/components/feedback/Spinner/index.ts +0 -1
  140. package/src/components/feedback/Toast/Toast.stories.tsx +0 -45
  141. package/src/components/feedback/Toast/index.ts +0 -2
  142. package/src/components/feedback/index.ts +0 -2
  143. package/src/components/index.ts +0 -6
  144. package/src/components/layout/Crud/components/Table/index.tsx +0 -183
  145. package/src/components/layout/Crud/components/Table/types.ts +0 -15
  146. package/src/components/layout/Crud/crud.stories.tsx +0 -317
  147. package/src/components/layout/Crud/hook/useCrudLayout/index.tsx +0 -94
  148. package/src/components/layout/Crud/hook/useRequest/index.tsx +0 -156
  149. package/src/components/layout/Crud/index.tsx +0 -295
  150. package/src/components/layout/Crud/store/CrudLayoutStore.ts +0 -75
  151. package/src/components/layout/Crud/types.ts +0 -14
  152. package/src/components/layout/Drawer/CustomDrawer/index.tsx +0 -33
  153. package/src/components/layout/Drawer/Drawer.stories.tsx +0 -80
  154. package/src/components/layout/Drawer/index.ts +0 -2
  155. package/src/components/layout/PageLayout/PageLayout.stories.tsx +0 -42
  156. package/src/components/layout/PageLayout/index.tsx +0 -28
  157. package/src/components/layout/Separator/index.ts +0 -1
  158. package/src/components/layout/Sheet/Sheet.stories.tsx +0 -28
  159. package/src/components/layout/Sheet/Sheet.tsx +0 -22
  160. package/src/components/layout/Sheet/index.ts +0 -1
  161. package/src/components/layout/Sidebar/Sidebar.stories.tsx +0 -116
  162. package/src/components/layout/Sidebar/Sidebar.tsx +0 -50
  163. package/src/components/layout/Sidebar/components/app-sidebar.tsx +0 -203
  164. package/src/components/layout/Sidebar/components/footer-sidebar.tsx +0 -17
  165. package/src/components/layout/Sidebar/components/header-sidebar.tsx +0 -90
  166. package/src/components/layout/Sidebar/components/menus.tsx +0 -55
  167. package/src/components/layout/Sidebar/components/nav-projects.tsx +0 -88
  168. package/src/components/layout/Sidebar/components/nav-user.tsx +0 -114
  169. package/src/components/layout/Sidebar/components/team-switcher.tsx +0 -85
  170. package/src/components/layout/Sidebar/index.ts +0 -2
  171. package/src/components/layout/Sidebar/provider/index.tsx +0 -51
  172. package/src/components/layout/Tabs/Tabs.tsx +0 -51
  173. package/src/components/layout/Tabs/index.ts +0 -1
  174. package/src/components/layout/Tabs/tabs.stories.tsx +0 -57
  175. package/src/components/layout/index.ts +0 -6
  176. package/src/components/navigation/Breadcrumbs/Breadcrumbs.tsx +0 -66
  177. package/src/components/navigation/Breadcrumbs/index.ts +0 -2
  178. package/src/components/navigation/index.ts +0 -1
  179. package/src/components/ui/alert-dialog.tsx +0 -141
  180. package/src/components/ui/alert.tsx +0 -59
  181. package/src/components/ui/avatar.tsx +0 -50
  182. package/src/components/ui/badge.tsx +0 -40
  183. package/src/components/ui/breadcrumb.tsx +0 -115
  184. package/src/components/ui/button.tsx +0 -57
  185. package/src/components/ui/card.tsx +0 -83
  186. package/src/components/ui/checkbox.tsx +0 -34
  187. package/src/components/ui/collapsible.tsx +0 -11
  188. package/src/components/ui/command.tsx +0 -153
  189. package/src/components/ui/dialog.tsx +0 -124
  190. package/src/components/ui/drawer.tsx +0 -117
  191. package/src/components/ui/dropdown-menu.tsx +0 -201
  192. package/src/components/ui/form.tsx +0 -179
  193. package/src/components/ui/input.tsx +0 -24
  194. package/src/components/ui/label.tsx +0 -30
  195. package/src/components/ui/popover.tsx +0 -33
  196. package/src/components/ui/select.tsx +0 -161
  197. package/src/components/ui/separator.tsx +0 -31
  198. package/src/components/ui/sheet.tsx +0 -140
  199. package/src/components/ui/sidebar.tsx +0 -763
  200. package/src/components/ui/skeleton.tsx +0 -15
  201. package/src/components/ui/sonner.tsx +0 -31
  202. package/src/components/ui/spinner.tsx +0 -54
  203. package/src/components/ui/switch.tsx +0 -33
  204. package/src/components/ui/table.tsx +0 -120
  205. package/src/components/ui/tabs.tsx +0 -55
  206. package/src/components/ui/toast.tsx +0 -130
  207. package/src/components/ui/toaster.tsx +0 -35
  208. package/src/components/ui/tooltip.tsx +0 -32
  209. package/src/hooks/use-conditional-controller.tsx +0 -35
  210. package/src/hooks/use-mask.tsx +0 -116
  211. package/src/hooks/use-mobile.tsx +0 -19
  212. package/src/hooks/use-toast.ts +0 -191
  213. package/src/index.ts +0 -1
  214. package/src/introduction.mdx +0 -132
  215. package/src/lib/utils.ts +0 -6
  216. package/tailwind.config.ts +0 -83
  217. 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
- }