@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.
- 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/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,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
|
-
}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
BadgeCheck,
|
|
5
|
-
Bell,
|
|
6
|
-
ChevronsUpDown,
|
|
7
|
-
CreditCard,
|
|
8
|
-
LogOut,
|
|
9
|
-
Sparkles,
|
|
10
|
-
} from "lucide-react";
|
|
11
|
-
import {
|
|
12
|
-
SidebarMenu,
|
|
13
|
-
SidebarMenuButton,
|
|
14
|
-
SidebarMenuItem,
|
|
15
|
-
useSidebar,
|
|
16
|
-
} from "../../../ui/sidebar";
|
|
17
|
-
import { Avatar, AvatarFallback, AvatarImage } from "../../../ui/avatar";
|
|
18
|
-
import {
|
|
19
|
-
DropdownMenu,
|
|
20
|
-
DropdownMenuContent,
|
|
21
|
-
DropdownMenuGroup,
|
|
22
|
-
DropdownMenuItem,
|
|
23
|
-
DropdownMenuLabel,
|
|
24
|
-
DropdownMenuSeparator,
|
|
25
|
-
DropdownMenuTrigger,
|
|
26
|
-
} from "../../../ui/dropdown-menu";
|
|
27
|
-
import { useCallback } from "react";
|
|
28
|
-
|
|
29
|
-
export function NavUser({
|
|
30
|
-
user,
|
|
31
|
-
logoutAction = () => {},
|
|
32
|
-
}: {
|
|
33
|
-
user: {
|
|
34
|
-
name: string;
|
|
35
|
-
email: string;
|
|
36
|
-
avatar: string;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
logoutAction?: () => void;
|
|
40
|
-
}) {
|
|
41
|
-
const { isMobile } = useSidebar();
|
|
42
|
-
|
|
43
|
-
const renderUserInformation = useCallback(() => {
|
|
44
|
-
return (
|
|
45
|
-
<>
|
|
46
|
-
<Avatar className="h-8 w-8 rounded-lg">
|
|
47
|
-
<AvatarImage src={user?.avatar} alt={user?.name} />
|
|
48
|
-
<AvatarFallback className="rounded-lg">CN</AvatarFallback>
|
|
49
|
-
</Avatar>
|
|
50
|
-
<div className="grid flex-1 text-left text-sm leading-tight">
|
|
51
|
-
<span className="truncate font-semibold">{user?.name}</span>
|
|
52
|
-
<span className="truncate text-xs">{user?.email}</span>
|
|
53
|
-
</div>
|
|
54
|
-
</>
|
|
55
|
-
);
|
|
56
|
-
}, [user]);
|
|
57
|
-
|
|
58
|
-
return (
|
|
59
|
-
<SidebarMenu>
|
|
60
|
-
<SidebarMenuItem>
|
|
61
|
-
<DropdownMenu>
|
|
62
|
-
<DropdownMenuTrigger asChild>
|
|
63
|
-
<SidebarMenuButton
|
|
64
|
-
size="lg"
|
|
65
|
-
className="data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground"
|
|
66
|
-
>
|
|
67
|
-
{renderUserInformation()}
|
|
68
|
-
<ChevronsUpDown className="ml-auto size-4" />
|
|
69
|
-
</SidebarMenuButton>
|
|
70
|
-
</DropdownMenuTrigger>
|
|
71
|
-
<DropdownMenuContent
|
|
72
|
-
className="w-[--radix-dropdown-menu-trigger-width] min-w-56 rounded-lg"
|
|
73
|
-
side={isMobile ? "bottom" : "right"}
|
|
74
|
-
align="end"
|
|
75
|
-
sideOffset={4}
|
|
76
|
-
>
|
|
77
|
-
<DropdownMenuLabel className="p-0 font-normal">
|
|
78
|
-
<div className="flex items-center gap-2 px-1 py-1.5 text-left text-sm">
|
|
79
|
-
{renderUserInformation()}
|
|
80
|
-
</div>
|
|
81
|
-
</DropdownMenuLabel>
|
|
82
|
-
<DropdownMenuSeparator />
|
|
83
|
-
<DropdownMenuGroup>
|
|
84
|
-
<DropdownMenuItem>
|
|
85
|
-
<Sparkles />
|
|
86
|
-
Upgrade to Pro
|
|
87
|
-
</DropdownMenuItem>
|
|
88
|
-
</DropdownMenuGroup>
|
|
89
|
-
<DropdownMenuSeparator />
|
|
90
|
-
<DropdownMenuGroup>
|
|
91
|
-
<DropdownMenuItem>
|
|
92
|
-
<BadgeCheck />
|
|
93
|
-
Account
|
|
94
|
-
</DropdownMenuItem>
|
|
95
|
-
<DropdownMenuItem>
|
|
96
|
-
<CreditCard />
|
|
97
|
-
Billing
|
|
98
|
-
</DropdownMenuItem>
|
|
99
|
-
<DropdownMenuItem>
|
|
100
|
-
<Bell />
|
|
101
|
-
Notifications
|
|
102
|
-
</DropdownMenuItem>
|
|
103
|
-
</DropdownMenuGroup>
|
|
104
|
-
<DropdownMenuSeparator />
|
|
105
|
-
<DropdownMenuItem onClick={logoutAction}>
|
|
106
|
-
<LogOut />
|
|
107
|
-
Log out
|
|
108
|
-
</DropdownMenuItem>
|
|
109
|
-
</DropdownMenuContent>
|
|
110
|
-
</DropdownMenu>
|
|
111
|
-
</SidebarMenuItem>
|
|
112
|
-
</SidebarMenu>
|
|
113
|
-
);
|
|
114
|
-
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import { ChevronsUpDown, Plus } from "lucide-react";
|
|
5
|
-
import {
|
|
6
|
-
SidebarMenu,
|
|
7
|
-
SidebarMenuButton,
|
|
8
|
-
SidebarMenuItem,
|
|
9
|
-
useSidebar,
|
|
10
|
-
} from "../../../ui/sidebar";
|
|
11
|
-
import {
|
|
12
|
-
DropdownMenu,
|
|
13
|
-
DropdownMenuContent,
|
|
14
|
-
DropdownMenuItem,
|
|
15
|
-
DropdownMenuLabel,
|
|
16
|
-
DropdownMenuSeparator,
|
|
17
|
-
DropdownMenuShortcut,
|
|
18
|
-
DropdownMenuTrigger,
|
|
19
|
-
} from "../../../ui/dropdown-menu";
|
|
20
|
-
|
|
21
|
-
export function TeamSwitcher({
|
|
22
|
-
teams,
|
|
23
|
-
}: {
|
|
24
|
-
teams: {
|
|
25
|
-
name: string;
|
|
26
|
-
logo: () => React.ReactNode;
|
|
27
|
-
plan: string;
|
|
28
|
-
};
|
|
29
|
-
}) {
|
|
30
|
-
const { isMobile } = useSidebar();
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<SidebarMenu>
|
|
34
|
-
<SidebarMenuItem>
|
|
35
|
-
<DropdownMenu>
|
|
36
|
-
<DropdownMenuTrigger asChild>
|
|
37
|
-
<SidebarMenuButton
|
|
38
|
-
size="lg"
|
|
39
|
-
className="data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground"
|
|
40
|
-
>
|
|
41
|
-
<div className="flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground">
|
|
42
|
-
{/* {teams?.logo && teams?.logo?.()} */}
|
|
43
|
-
</div>
|
|
44
|
-
<div className="grid flex-1 text-left text-sm leading-tight">
|
|
45
|
-
<span className="truncate font-semibold">{teams?.name}</span>
|
|
46
|
-
<span className="truncate text-xs">{teams?.plan}</span>
|
|
47
|
-
</div>
|
|
48
|
-
<ChevronsUpDown className="ml-auto" />
|
|
49
|
-
</SidebarMenuButton>
|
|
50
|
-
</DropdownMenuTrigger>
|
|
51
|
-
{/* <DropdownMenuContent
|
|
52
|
-
className="w-[--radix-dropdown-menu-trigger-width] min-w-56 rounded-lg"
|
|
53
|
-
align="start"
|
|
54
|
-
side={isMobile ? "bottom" : "right"}
|
|
55
|
-
sideOffset={4}
|
|
56
|
-
>
|
|
57
|
-
<DropdownMenuLabel className="text-xs text-muted-foreground">
|
|
58
|
-
Teams
|
|
59
|
-
</DropdownMenuLabel>
|
|
60
|
-
{teams.map((team, index) => (
|
|
61
|
-
<DropdownMenuItem
|
|
62
|
-
key={team.name}
|
|
63
|
-
onClick={() => setActiveTeam(team)}
|
|
64
|
-
className="gap-2 p-2"
|
|
65
|
-
>
|
|
66
|
-
<div className="flex size-6 items-center justify-center rounded-sm border">
|
|
67
|
-
<team.logo className="size-4 shrink-0" />
|
|
68
|
-
</div>
|
|
69
|
-
{team.name}
|
|
70
|
-
<DropdownMenuShortcut>⌘{index + 1}</DropdownMenuShortcut>
|
|
71
|
-
</DropdownMenuItem>
|
|
72
|
-
))}
|
|
73
|
-
<DropdownMenuSeparator />
|
|
74
|
-
<DropdownMenuItem className="gap-2 p-2">
|
|
75
|
-
<div className="flex size-6 items-center justify-center rounded-md border bg-background">
|
|
76
|
-
<Plus className="size-4" />
|
|
77
|
-
</div>
|
|
78
|
-
<div className="font-medium text-muted-foreground">Add team</div>
|
|
79
|
-
</DropdownMenuItem>
|
|
80
|
-
</DropdownMenuContent> */}
|
|
81
|
-
</DropdownMenu>
|
|
82
|
-
</SidebarMenuItem>
|
|
83
|
-
</SidebarMenu>
|
|
84
|
-
);
|
|
85
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { createContext, useContext, useState } from "react";
|
|
3
|
-
|
|
4
|
-
interface SidebarContextData {
|
|
5
|
-
currentPath: string;
|
|
6
|
-
isCollapsed: boolean;
|
|
7
|
-
toggleCollapse: () => void;
|
|
8
|
-
setCurrentPath: (path: string) => void;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
interface SidebarProviderProps {
|
|
12
|
-
children: React.ReactNode;
|
|
13
|
-
defaultPath?: string;
|
|
14
|
-
defaultCollapsed?: boolean;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const SidebarContext = createContext({} as SidebarContextData);
|
|
18
|
-
|
|
19
|
-
export function SidebarProvider({
|
|
20
|
-
children,
|
|
21
|
-
defaultPath = "/",
|
|
22
|
-
defaultCollapsed = false,
|
|
23
|
-
}: SidebarProviderProps) {
|
|
24
|
-
const [isCollapsed, setIsCollapsed] = useState(defaultCollapsed);
|
|
25
|
-
const [currentPath, setCurrentPath] = useState(defaultPath);
|
|
26
|
-
|
|
27
|
-
const toggleCollapse = () => setIsCollapsed((prev) => !prev);
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
<SidebarContext.Provider
|
|
31
|
-
value={{
|
|
32
|
-
currentPath,
|
|
33
|
-
isCollapsed,
|
|
34
|
-
toggleCollapse,
|
|
35
|
-
setCurrentPath,
|
|
36
|
-
}}
|
|
37
|
-
>
|
|
38
|
-
{children}
|
|
39
|
-
</SidebarContext.Provider>
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export function useSidebar() {
|
|
44
|
-
const context = useContext(SidebarContext);
|
|
45
|
-
|
|
46
|
-
if (!context) {
|
|
47
|
-
throw new Error("useSidebar must be used within a SidebarProvider");
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return context;
|
|
51
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import {
|
|
5
|
-
Tabs as TabsUI,
|
|
6
|
-
TabsContent,
|
|
7
|
-
TabsList,
|
|
8
|
-
TabsTrigger,
|
|
9
|
-
} from "../../../components/ui/tabs";
|
|
10
|
-
import { cn } from "../../../lib/utils";
|
|
11
|
-
|
|
12
|
-
interface TabsProps {
|
|
13
|
-
tabs: {
|
|
14
|
-
label: string;
|
|
15
|
-
content: React.ReactNode;
|
|
16
|
-
}[];
|
|
17
|
-
activeTabIndex?: number;
|
|
18
|
-
onTabChange?: (index: number) => void;
|
|
19
|
-
className?: string;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export const Tabs: React.FC<TabsProps> = ({
|
|
23
|
-
tabs,
|
|
24
|
-
activeTabIndex = 0,
|
|
25
|
-
onTabChange,
|
|
26
|
-
className,
|
|
27
|
-
}) => {
|
|
28
|
-
return (
|
|
29
|
-
<TabsUI
|
|
30
|
-
value={tabs[activeTabIndex].label}
|
|
31
|
-
onValueChange={(value) => {
|
|
32
|
-
const index = tabs.findIndex((tab) => tab.label === value);
|
|
33
|
-
if (onTabChange) onTabChange(index);
|
|
34
|
-
}}
|
|
35
|
-
className={cn("w-full", className)}
|
|
36
|
-
>
|
|
37
|
-
<TabsList>
|
|
38
|
-
{tabs.map((tab, index) => (
|
|
39
|
-
<TabsTrigger key={index} value={tab.label}>
|
|
40
|
-
{tab.label}
|
|
41
|
-
</TabsTrigger>
|
|
42
|
-
))}
|
|
43
|
-
</TabsList>
|
|
44
|
-
{tabs.map((tab, index) => (
|
|
45
|
-
<TabsContent key={index} value={tab.label}>
|
|
46
|
-
{tab.content}
|
|
47
|
-
</TabsContent>
|
|
48
|
-
))}
|
|
49
|
-
</TabsUI>
|
|
50
|
-
);
|
|
51
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Tabs";
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/nextjs";
|
|
2
|
-
import { Tabs } from ".";
|
|
3
|
-
|
|
4
|
-
const meta: Meta<typeof Tabs> = {
|
|
5
|
-
title: "Layout/Tabs",
|
|
6
|
-
component: Tabs,
|
|
7
|
-
parameters: {
|
|
8
|
-
layout: "centered",
|
|
9
|
-
},
|
|
10
|
-
tags: ["autodocs"],
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export default meta;
|
|
14
|
-
type Story = StoryObj<typeof meta>;
|
|
15
|
-
|
|
16
|
-
export const Default: Story = {
|
|
17
|
-
args: {
|
|
18
|
-
activeTabIndex: 1,
|
|
19
|
-
tabs: [
|
|
20
|
-
{
|
|
21
|
-
label: "Tab 1",
|
|
22
|
-
content: <div>Conteúdo da Tab 1</div>,
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
label: "Tab 2",
|
|
26
|
-
content: <div>Conteúdo da Tab 2</div>,
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
label: "Tab 3",
|
|
30
|
-
content: <div>Conteúdo da Tab 3</div>,
|
|
31
|
-
},
|
|
32
|
-
],
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export const Controlled: Story = {
|
|
37
|
-
args: {
|
|
38
|
-
tabs: [
|
|
39
|
-
{
|
|
40
|
-
label: "Tab 1",
|
|
41
|
-
content: <div>Conteúdo da Tab 1</div>,
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
label: "Tab 2",
|
|
45
|
-
content: <div>Conteúdo da Tab 2</div>,
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
label: "Tab 3",
|
|
49
|
-
content: <div>Conteúdo da Tab 3</div>,
|
|
50
|
-
},
|
|
51
|
-
],
|
|
52
|
-
activeTabIndex: 0,
|
|
53
|
-
onTabChange: (index) => {
|
|
54
|
-
console.log(`Aba selecionada: ${index}`);
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
};
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Breadcrumb,
|
|
3
|
-
BreadcrumbItem,
|
|
4
|
-
BreadcrumbLink,
|
|
5
|
-
BreadcrumbList,
|
|
6
|
-
BreadcrumbPage,
|
|
7
|
-
BreadcrumbSeparator,
|
|
8
|
-
} from "../../../components/ui/breadcrumb";
|
|
9
|
-
import { Icon } from "../../dataDisplay";
|
|
10
|
-
import { useMemo } from "react";
|
|
11
|
-
import { usePathname } from "next/navigation";
|
|
12
|
-
|
|
13
|
-
export type BreadcrumbsProps = {
|
|
14
|
-
data: {
|
|
15
|
-
href: string;
|
|
16
|
-
label: string;
|
|
17
|
-
}[];
|
|
18
|
-
isAutoGenerate?: boolean;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export function Breadcrumbs({
|
|
22
|
-
data,
|
|
23
|
-
isAutoGenerate = false,
|
|
24
|
-
}: BreadcrumbsProps) {
|
|
25
|
-
const pathname = usePathname();
|
|
26
|
-
const breadCrumData = useMemo(() => {
|
|
27
|
-
if (isAutoGenerate) {
|
|
28
|
-
const path = pathname.split("/").map((item) => ({
|
|
29
|
-
href: item,
|
|
30
|
-
label: item,
|
|
31
|
-
}));
|
|
32
|
-
return path.map((item) => {
|
|
33
|
-
return {
|
|
34
|
-
href: item.href,
|
|
35
|
-
label: item.label,
|
|
36
|
-
};
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
return data;
|
|
40
|
-
}, [data, isAutoGenerate, pathname]);
|
|
41
|
-
|
|
42
|
-
return (
|
|
43
|
-
<Breadcrumb>
|
|
44
|
-
<BreadcrumbList>
|
|
45
|
-
{breadCrumData?.map((item, index) => {
|
|
46
|
-
const isLast = index === data.length - 1;
|
|
47
|
-
if (isLast) {
|
|
48
|
-
return (
|
|
49
|
-
<BreadcrumbItem key={index}>
|
|
50
|
-
<BreadcrumbPage>{item.label}</BreadcrumbPage>
|
|
51
|
-
</BreadcrumbItem>
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
return (
|
|
55
|
-
<BreadcrumbItem key={index}>
|
|
56
|
-
<BreadcrumbLink href={item.href}>{item.label}</BreadcrumbLink>
|
|
57
|
-
<BreadcrumbSeparator>
|
|
58
|
-
<Icon name="BsSlashLg" />
|
|
59
|
-
</BreadcrumbSeparator>
|
|
60
|
-
</BreadcrumbItem>
|
|
61
|
-
);
|
|
62
|
-
})}
|
|
63
|
-
</BreadcrumbList>
|
|
64
|
-
</Breadcrumb>
|
|
65
|
-
);
|
|
66
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Breadcrumbs";
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
5
|
-
|
|
6
|
-
import { cn } from "../../lib/utils";
|
|
7
|
-
import { buttonVariants } from "../../components/ui/button";
|
|
8
|
-
|
|
9
|
-
const AlertDialog = AlertDialogPrimitive.Root;
|
|
10
|
-
|
|
11
|
-
const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
12
|
-
|
|
13
|
-
const AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
14
|
-
|
|
15
|
-
const AlertDialogOverlay = React.forwardRef<
|
|
16
|
-
React.ElementRef<typeof AlertDialogPrimitive.Overlay>,
|
|
17
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>
|
|
18
|
-
>(({ className, ...props }, ref) => (
|
|
19
|
-
<AlertDialogPrimitive.Overlay
|
|
20
|
-
className={cn(
|
|
21
|
-
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
22
|
-
className
|
|
23
|
-
)}
|
|
24
|
-
{...props}
|
|
25
|
-
ref={ref}
|
|
26
|
-
/>
|
|
27
|
-
));
|
|
28
|
-
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
29
|
-
|
|
30
|
-
const AlertDialogContent = React.forwardRef<
|
|
31
|
-
React.ElementRef<typeof AlertDialogPrimitive.Content>,
|
|
32
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>
|
|
33
|
-
>(({ className, ...props }, ref) => (
|
|
34
|
-
<AlertDialogPortal>
|
|
35
|
-
<AlertDialogOverlay />
|
|
36
|
-
<AlertDialogPrimitive.Content
|
|
37
|
-
ref={ref}
|
|
38
|
-
className={cn(
|
|
39
|
-
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
40
|
-
className
|
|
41
|
-
)}
|
|
42
|
-
{...props}
|
|
43
|
-
/>
|
|
44
|
-
</AlertDialogPortal>
|
|
45
|
-
));
|
|
46
|
-
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
|
|
47
|
-
|
|
48
|
-
const AlertDialogHeader = ({
|
|
49
|
-
className,
|
|
50
|
-
...props
|
|
51
|
-
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
52
|
-
<div
|
|
53
|
-
className={cn(
|
|
54
|
-
"flex flex-col space-y-2 text-center sm:text-left",
|
|
55
|
-
className
|
|
56
|
-
)}
|
|
57
|
-
{...props}
|
|
58
|
-
/>
|
|
59
|
-
);
|
|
60
|
-
AlertDialogHeader.displayName = "AlertDialogHeader";
|
|
61
|
-
|
|
62
|
-
const AlertDialogFooter = ({
|
|
63
|
-
className,
|
|
64
|
-
...props
|
|
65
|
-
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
66
|
-
<div
|
|
67
|
-
className={cn(
|
|
68
|
-
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
69
|
-
className
|
|
70
|
-
)}
|
|
71
|
-
{...props}
|
|
72
|
-
/>
|
|
73
|
-
);
|
|
74
|
-
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
75
|
-
|
|
76
|
-
const AlertDialogTitle = React.forwardRef<
|
|
77
|
-
React.ElementRef<typeof AlertDialogPrimitive.Title>,
|
|
78
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>
|
|
79
|
-
>(({ className, ...props }, ref) => (
|
|
80
|
-
<AlertDialogPrimitive.Title
|
|
81
|
-
ref={ref}
|
|
82
|
-
className={cn("text-lg font-semibold", className)}
|
|
83
|
-
{...props}
|
|
84
|
-
/>
|
|
85
|
-
));
|
|
86
|
-
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
87
|
-
|
|
88
|
-
const AlertDialogDescription = React.forwardRef<
|
|
89
|
-
React.ElementRef<typeof AlertDialogPrimitive.Description>,
|
|
90
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>
|
|
91
|
-
>(({ className, ...props }, ref) => (
|
|
92
|
-
<AlertDialogPrimitive.Description
|
|
93
|
-
ref={ref}
|
|
94
|
-
className={cn("text-sm text-muted-foreground", className)}
|
|
95
|
-
{...props}
|
|
96
|
-
/>
|
|
97
|
-
));
|
|
98
|
-
AlertDialogDescription.displayName =
|
|
99
|
-
AlertDialogPrimitive.Description.displayName;
|
|
100
|
-
|
|
101
|
-
const AlertDialogAction = React.forwardRef<
|
|
102
|
-
React.ElementRef<typeof AlertDialogPrimitive.Action>,
|
|
103
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>
|
|
104
|
-
>(({ className, ...props }, ref) => (
|
|
105
|
-
<AlertDialogPrimitive.Action
|
|
106
|
-
ref={ref}
|
|
107
|
-
className={cn(buttonVariants(), className)}
|
|
108
|
-
{...props}
|
|
109
|
-
/>
|
|
110
|
-
));
|
|
111
|
-
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
112
|
-
|
|
113
|
-
const AlertDialogCancel = React.forwardRef<
|
|
114
|
-
React.ElementRef<typeof AlertDialogPrimitive.Cancel>,
|
|
115
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>
|
|
116
|
-
>(({ className, ...props }, ref) => (
|
|
117
|
-
<AlertDialogPrimitive.Cancel
|
|
118
|
-
ref={ref}
|
|
119
|
-
className={cn(
|
|
120
|
-
buttonVariants({ variant: "outline" }),
|
|
121
|
-
"mt-2 sm:mt-0",
|
|
122
|
-
className
|
|
123
|
-
)}
|
|
124
|
-
{...props}
|
|
125
|
-
/>
|
|
126
|
-
));
|
|
127
|
-
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
128
|
-
|
|
129
|
-
export {
|
|
130
|
-
AlertDialog,
|
|
131
|
-
AlertDialogPortal,
|
|
132
|
-
AlertDialogOverlay,
|
|
133
|
-
AlertDialogTrigger,
|
|
134
|
-
AlertDialogContent,
|
|
135
|
-
AlertDialogHeader,
|
|
136
|
-
AlertDialogFooter,
|
|
137
|
-
AlertDialogTitle,
|
|
138
|
-
AlertDialogDescription,
|
|
139
|
-
AlertDialogAction,
|
|
140
|
-
AlertDialogCancel,
|
|
141
|
-
};
|