ui-arreya-components 0.0.16 → 0.1.4

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 (109) hide show
  1. package/dist/index.d.mts +342 -0
  2. package/dist/index.d.ts +342 -0
  3. package/dist/index.js +1682 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/index.mjs +1495 -0
  6. package/dist/index.mjs.map +1 -0
  7. package/package.json +63 -106
  8. package/.github/workflows/npm-publish.yml +0 -35
  9. package/.storybook/main.ts +0 -18
  10. package/.storybook/preview.ts +0 -16
  11. package/.storybook/vitest.setup.ts +0 -9
  12. package/README.md +0 -62
  13. package/components.json +0 -21
  14. package/dist/styles.css +0 -3
  15. package/dist/ui.cjs.js +0 -242
  16. package/dist/ui.es.js +0 -25142
  17. package/dist/ui.umd.js +0 -242
  18. package/eslint.config.js +0 -28
  19. package/postcss.config.js +0 -6
  20. package/scripts/build-index-ts.sh +0 -16
  21. package/scripts/template.sh +0 -57
  22. package/src/components/feature/graph-card.stories.tsx +0 -138
  23. package/src/components/feature/graph-card.tsx +0 -113
  24. package/src/components/feature/header.stories.tsx +0 -129
  25. package/src/components/feature/header.tsx +0 -78
  26. package/src/components/feature/login-form.stories.tsx +0 -35
  27. package/src/components/feature/login-form.tsx +0 -97
  28. package/src/components/feature/search-bar.stories.tsx +0 -35
  29. package/src/components/feature/search-bar.tsx +0 -141
  30. package/src/components/feature/wizard.stories.tsx +0 -199
  31. package/src/components/feature/wizard.tsx +0 -278
  32. package/src/components/ui/accordion.stories.tsx.disabled +0 -36
  33. package/src/components/ui/accordion.tsx +0 -55
  34. package/src/components/ui/alert-dialog.stories.tsx +0 -46
  35. package/src/components/ui/alert-dialog.tsx +0 -139
  36. package/src/components/ui/alert.stories.tsx +0 -45
  37. package/src/components/ui/alert.tsx +0 -59
  38. package/src/components/ui/aspect-ratio.stories.tsx +0 -24
  39. package/src/components/ui/aspect-ratio.tsx +0 -5
  40. package/src/components/ui/avatar.stories.tsx +0 -29
  41. package/src/components/ui/avatar.tsx +0 -48
  42. package/src/components/ui/badge.stories.tsx +0 -43
  43. package/src/components/ui/badge.tsx +0 -36
  44. package/src/components/ui/breadcrumb.stories.tsx +0 -146
  45. package/src/components/ui/breadcrumb.tsx +0 -115
  46. package/src/components/ui/button.stories.tsx +0 -87
  47. package/src/components/ui/button.tsx +0 -57
  48. package/src/components/ui/card.stories.tsx +0 -99
  49. package/src/components/ui/card.tsx +0 -76
  50. package/src/components/ui/carousel.stories.tsx +0 -47
  51. package/src/components/ui/carousel.tsx +0 -260
  52. package/src/components/ui/chart.stories.tsx.disabled +0 -44
  53. package/src/components/ui/chart.tsx +0 -363
  54. package/src/components/ui/checkbox.stories.tsx +0 -56
  55. package/src/components/ui/checkbox.tsx +0 -28
  56. package/src/components/ui/collapsible.stories.tsx +0 -58
  57. package/src/components/ui/collapsible.tsx +0 -9
  58. package/src/components/ui/context-menu.stories.tsx +0 -34
  59. package/src/components/ui/context-menu.tsx +0 -198
  60. package/src/components/ui/dialog.stories.tsx +0 -40
  61. package/src/components/ui/dialog.tsx +0 -120
  62. package/src/components/ui/drawer.stories.tsx +0 -48
  63. package/src/components/ui/drawer.tsx +0 -116
  64. package/src/components/ui/dropdown-menu.stories.tsx +0 -92
  65. package/src/components/ui/dropdown-menu.tsx +0 -199
  66. package/src/components/ui/form.tsx +0 -176
  67. package/src/components/ui/hover-card.stories.tsx +0 -31
  68. package/src/components/ui/hover-card.tsx +0 -27
  69. package/src/components/ui/input-otp.tsx +0 -69
  70. package/src/components/ui/input.stories.tsx +0 -63
  71. package/src/components/ui/input.tsx +0 -22
  72. package/src/components/ui/label.tsx +0 -24
  73. package/src/components/ui/menubar.tsx +0 -254
  74. package/src/components/ui/navigation-menu.tsx +0 -128
  75. package/src/components/ui/pagination.tsx +0 -117
  76. package/src/components/ui/popover.tsx +0 -31
  77. package/src/components/ui/progress.tsx +0 -26
  78. package/src/components/ui/radio-group.tsx +0 -42
  79. package/src/components/ui/resizable.tsx +0 -43
  80. package/src/components/ui/scroll-area.tsx +0 -46
  81. package/src/components/ui/select.tsx +0 -157
  82. package/src/components/ui/separator.tsx +0 -29
  83. package/src/components/ui/sheet.tsx +0 -138
  84. package/src/components/ui/sidebar.tsx +0 -771
  85. package/src/components/ui/skeleton.tsx +0 -15
  86. package/src/components/ui/slider.tsx +0 -26
  87. package/src/components/ui/sonner.tsx +0 -29
  88. package/src/components/ui/switch.tsx +0 -27
  89. package/src/components/ui/table.tsx +0 -120
  90. package/src/components/ui/tabs.tsx +0 -53
  91. package/src/components/ui/textarea.tsx +0 -22
  92. package/src/components/ui/toast.tsx +0 -127
  93. package/src/components/ui/toaster.tsx +0 -33
  94. package/src/components/ui/toggle-group.tsx +0 -59
  95. package/src/components/ui/toggle.tsx +0 -43
  96. package/src/components/ui/tooltip.tsx +0 -30
  97. package/src/hooks/use-mobile.tsx +0 -19
  98. package/src/hooks/use-toast.ts +0 -194
  99. package/src/index.css +0 -3633
  100. package/src/index.ts +0 -51
  101. package/src/lib/types.ts +0 -5
  102. package/src/lib/utils.ts +0 -6
  103. package/src/styles/tailwind.css +0 -100
  104. package/tailwind.config.js +0 -94
  105. package/tsconfig.app.json +0 -30
  106. package/tsconfig.json +0 -13
  107. package/tsconfig.node.json +0 -24
  108. package/vite.config.ts +0 -33
  109. package/vitest.workspace.ts +0 -32
@@ -1,29 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
-
3
- import {
4
- Avatar,
5
- AvatarImage,
6
- AvatarFallback
7
- } from './avatar';
8
-
9
- const meta = {
10
- title: 'Components/Avatar',
11
- component: Avatar,
12
- parameters: {
13
- layout: "centered"
14
- },
15
- tags: ["autodocs"]
16
- } satisfies Meta<typeof Avatar>;
17
-
18
- export default meta;
19
-
20
- type Story = StoryObj<typeof meta>;
21
-
22
- export const Default: Story = {
23
- render: () => (
24
- <Avatar>
25
- <AvatarImage src="https://github.com/shadcn.png" />
26
- <AvatarFallback>CN</AvatarFallback>
27
- </Avatar>
28
- )
29
- };
@@ -1,48 +0,0 @@
1
- import * as React from "react"
2
- import * as AvatarPrimitive from "@radix-ui/react-avatar"
3
-
4
- import { cn } from "@/lib/utils"
5
-
6
- const Avatar = React.forwardRef<
7
- React.ElementRef<typeof AvatarPrimitive.Root>,
8
- React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>
9
- >(({ className, ...props }, ref) => (
10
- <AvatarPrimitive.Root
11
- ref={ref}
12
- className={cn(
13
- "relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
14
- className
15
- )}
16
- {...props}
17
- />
18
- ))
19
- Avatar.displayName = AvatarPrimitive.Root.displayName
20
-
21
- const AvatarImage = React.forwardRef<
22
- React.ElementRef<typeof AvatarPrimitive.Image>,
23
- React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>
24
- >(({ className, ...props }, ref) => (
25
- <AvatarPrimitive.Image
26
- ref={ref}
27
- className={cn("aspect-square h-full w-full", className)}
28
- {...props}
29
- />
30
- ))
31
- AvatarImage.displayName = AvatarPrimitive.Image.displayName
32
-
33
- const AvatarFallback = React.forwardRef<
34
- React.ElementRef<typeof AvatarPrimitive.Fallback>,
35
- React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>
36
- >(({ className, ...props }, ref) => (
37
- <AvatarPrimitive.Fallback
38
- ref={ref}
39
- className={cn(
40
- "flex h-full w-full items-center justify-center rounded-full bg-muted",
41
- className
42
- )}
43
- {...props}
44
- />
45
- ))
46
- AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName
47
-
48
- export { Avatar, AvatarImage, AvatarFallback }
@@ -1,43 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
-
3
- import {
4
- Badge
5
- } from './badge';
6
-
7
- const meta = {
8
- title: 'Components/Badge',
9
- component: Badge,
10
- parameters: {
11
- layout: "centered"
12
- },
13
- tags: ["autodocs"]
14
- } satisfies Meta<typeof Badge>;
15
-
16
- export default meta;
17
-
18
- type Story = StoryObj<typeof meta>;
19
-
20
- export const Default: Story = {
21
- render: () => (
22
- <Badge>Badge</Badge>
23
- )
24
- };
25
-
26
- export const Secondary: Story = {
27
- render: () => (
28
- <Badge variant="secondary">Badge</Badge>
29
- )
30
- };
31
-
32
- export const Outline: Story = {
33
- render: () => (
34
- <Badge variant="outline">Badge</Badge>
35
- )
36
- };
37
-
38
- export const Destructive: Story = {
39
- render: () => (
40
- <Badge variant="destructive">Badge</Badge>
41
- )
42
- };
43
-
@@ -1,36 +0,0 @@
1
- import * as React from "react"
2
- import { cva, type VariantProps } from "class-variance-authority"
3
-
4
- import { cn } from "@/lib/utils"
5
-
6
- const badgeVariants = cva(
7
- "inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
8
- {
9
- variants: {
10
- variant: {
11
- default:
12
- "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
13
- secondary:
14
- "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
15
- destructive:
16
- "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
17
- outline: "text-foreground",
18
- },
19
- },
20
- defaultVariants: {
21
- variant: "default",
22
- },
23
- }
24
- )
25
-
26
- export interface BadgeProps
27
- extends React.HTMLAttributes<HTMLDivElement>,
28
- VariantProps<typeof badgeVariants> {}
29
-
30
- function Badge({ className, variant, ...props }: BadgeProps) {
31
- return (
32
- <div className={cn(badgeVariants({ variant }), className)} {...props} />
33
- )
34
- }
35
-
36
- export { Badge, badgeVariants }
@@ -1,146 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
-
3
- import { ChevronDown, Slash } from 'lucide-react'
4
-
5
- import {
6
- Breadcrumb,
7
- BreadcrumbEllipsis,
8
- BreadcrumbItem,
9
- BreadcrumbLink,
10
- BreadcrumbList,
11
- BreadcrumbPage,
12
- BreadcrumbSeparator,
13
- } from './breadcrumb';
14
- import {
15
- DropdownMenu,
16
- DropdownMenuContent,
17
- DropdownMenuItem,
18
- DropdownMenuTrigger,
19
- } from './dropdown-menu'
20
-
21
- const meta = {
22
- title: 'Components/Breadcrumb',
23
- component: Breadcrumb,
24
- parameters: {
25
- layout: "centered"
26
- },
27
- tags: ["autodocs"]
28
- } satisfies Meta<typeof Breadcrumb>;
29
-
30
- export default meta;
31
-
32
- type Story = StoryObj<typeof meta>;
33
-
34
- export const Default: Story = {
35
- render: () => (
36
- <Breadcrumb>
37
- <BreadcrumbList>
38
- <BreadcrumbItem>
39
- <BreadcrumbLink href="/">Home</BreadcrumbLink>
40
- </BreadcrumbItem>
41
- <BreadcrumbSeparator />
42
- <BreadcrumbItem>
43
- <DropdownMenu>
44
- <DropdownMenuTrigger className="flex items-center gap-1">
45
- <BreadcrumbEllipsis className="h-4 w-4" />
46
- <span className="sr-only">Toggle menu</span>
47
- </DropdownMenuTrigger>
48
- <DropdownMenuContent align="start">
49
- <DropdownMenuItem>Documentation</DropdownMenuItem>
50
- <DropdownMenuItem>Themes</DropdownMenuItem>
51
- <DropdownMenuItem>GitHub</DropdownMenuItem>
52
- </DropdownMenuContent>
53
- </DropdownMenu>
54
- </BreadcrumbItem>
55
- <BreadcrumbSeparator />
56
- <BreadcrumbItem>
57
- <BreadcrumbLink href="/docs/components">Components</BreadcrumbLink>
58
- </BreadcrumbItem>
59
- <BreadcrumbSeparator />
60
- <BreadcrumbItem>
61
- <BreadcrumbPage>Breadcrumb</BreadcrumbPage>
62
- </BreadcrumbItem>
63
- </BreadcrumbList>
64
- </Breadcrumb>
65
- )
66
- };
67
-
68
- export const CustomSeperator: Story = {
69
- render: () => (
70
- <Breadcrumb>
71
- <BreadcrumbList>
72
- <BreadcrumbItem>
73
- <BreadcrumbLink href="/">Home</BreadcrumbLink>
74
- </BreadcrumbItem>
75
- <BreadcrumbSeparator>
76
- <Slash />
77
- </BreadcrumbSeparator>
78
- <BreadcrumbItem>
79
- <BreadcrumbLink href="/components">Components</BreadcrumbLink>
80
- </BreadcrumbItem>
81
- </BreadcrumbList>
82
- </Breadcrumb>
83
- )
84
- }
85
-
86
- export const Dropdown: Story = {
87
- render: () => (
88
- <Breadcrumb>
89
- <BreadcrumbList>
90
- <BreadcrumbItem>
91
- <BreadcrumbLink href="/">Home</BreadcrumbLink>
92
- </BreadcrumbItem>
93
- <BreadcrumbSeparator>
94
- <Slash />
95
- </BreadcrumbSeparator>
96
- <BreadcrumbItem>
97
- <DropdownMenu>
98
- <DropdownMenuTrigger className="flex items-center gap-1">
99
- Components
100
- <ChevronDown />
101
- </DropdownMenuTrigger>
102
- <DropdownMenuContent align="start">
103
- <DropdownMenuItem>Documentation</DropdownMenuItem>
104
- <DropdownMenuItem>Themes</DropdownMenuItem>
105
- <DropdownMenuItem>GitHub</DropdownMenuItem>
106
- </DropdownMenuContent>
107
- </DropdownMenu>
108
- </BreadcrumbItem>
109
- <BreadcrumbSeparator>
110
- <Slash />
111
- </BreadcrumbSeparator>
112
- <BreadcrumbItem>
113
- <BreadcrumbPage>Breadcrumb</BreadcrumbPage>
114
- </BreadcrumbItem>
115
- </BreadcrumbList>
116
- </Breadcrumb>
117
- )
118
- }
119
-
120
- export const Collapsed: Story = {
121
- render: () => (
122
- <Breadcrumb>
123
- <BreadcrumbList>
124
- <BreadcrumbItem>
125
- <BreadcrumbLink asChild>
126
- <p>Home</p>
127
- </BreadcrumbLink>
128
- </BreadcrumbItem>
129
- <BreadcrumbSeparator />
130
- <BreadcrumbItem>
131
- <BreadcrumbEllipsis />
132
- </BreadcrumbItem>
133
- <BreadcrumbSeparator />
134
- <BreadcrumbItem>
135
- <BreadcrumbLink asChild>
136
- <p>Components</p>
137
- </BreadcrumbLink>
138
- </BreadcrumbItem>
139
- <BreadcrumbSeparator />
140
- <BreadcrumbItem>
141
- <BreadcrumbPage>Breadcrumb</BreadcrumbPage>
142
- </BreadcrumbItem>
143
- </BreadcrumbList>
144
- </Breadcrumb>
145
- )
146
- }
@@ -1,115 +0,0 @@
1
- import * as React from "react"
2
- import { Slot } from "@radix-ui/react-slot"
3
- import { ChevronRight, MoreHorizontal } from "lucide-react"
4
-
5
- import { cn } from "@/lib/utils"
6
-
7
- const Breadcrumb = React.forwardRef<
8
- HTMLElement,
9
- React.ComponentPropsWithoutRef<"nav"> & {
10
- separator?: React.ReactNode
11
- }
12
- >(({ ...props }, ref) => <nav ref={ref} aria-label="breadcrumb" {...props} />)
13
- Breadcrumb.displayName = "Breadcrumb"
14
-
15
- const BreadcrumbList = React.forwardRef<
16
- HTMLOListElement,
17
- React.ComponentPropsWithoutRef<"ol">
18
- >(({ className, ...props }, ref) => (
19
- <ol
20
- ref={ref}
21
- className={cn(
22
- "flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",
23
- className
24
- )}
25
- {...props}
26
- />
27
- ))
28
- BreadcrumbList.displayName = "BreadcrumbList"
29
-
30
- const BreadcrumbItem = React.forwardRef<
31
- HTMLLIElement,
32
- React.ComponentPropsWithoutRef<"li">
33
- >(({ className, ...props }, ref) => (
34
- <li
35
- ref={ref}
36
- className={cn("inline-flex items-center gap-1.5", className)}
37
- {...props}
38
- />
39
- ))
40
- BreadcrumbItem.displayName = "BreadcrumbItem"
41
-
42
- const BreadcrumbLink = React.forwardRef<
43
- HTMLAnchorElement,
44
- React.ComponentPropsWithoutRef<"a"> & {
45
- asChild?: boolean
46
- }
47
- >(({ asChild, className, ...props }, ref) => {
48
- const Comp = asChild ? Slot : "a"
49
-
50
- return (
51
- <Comp
52
- ref={ref}
53
- className={cn("transition-colors hover:text-foreground", className)}
54
- {...props}
55
- />
56
- )
57
- })
58
- BreadcrumbLink.displayName = "BreadcrumbLink"
59
-
60
- const BreadcrumbPage = React.forwardRef<
61
- HTMLSpanElement,
62
- React.ComponentPropsWithoutRef<"span">
63
- >(({ className, ...props }, ref) => (
64
- <span
65
- ref={ref}
66
- role="link"
67
- aria-disabled="true"
68
- aria-current="page"
69
- className={cn("font-normal text-foreground", className)}
70
- {...props}
71
- />
72
- ))
73
- BreadcrumbPage.displayName = "BreadcrumbPage"
74
-
75
- const BreadcrumbSeparator = ({
76
- children,
77
- className,
78
- ...props
79
- }: React.ComponentProps<"li">) => (
80
- <li
81
- role="presentation"
82
- aria-hidden="true"
83
- className={cn("[&>svg]:w-3.5 [&>svg]:h-3.5", className)}
84
- {...props}
85
- >
86
- {children ?? <ChevronRight />}
87
- </li>
88
- )
89
- BreadcrumbSeparator.displayName = "BreadcrumbSeparator"
90
-
91
- const BreadcrumbEllipsis = ({
92
- className,
93
- ...props
94
- }: React.ComponentProps<"span">) => (
95
- <span
96
- role="presentation"
97
- aria-hidden="true"
98
- className={cn("flex h-9 w-9 items-center justify-center", className)}
99
- {...props}
100
- >
101
- <MoreHorizontal className="h-4 w-4" />
102
- <span className="sr-only">More</span>
103
- </span>
104
- )
105
- BreadcrumbEllipsis.displayName = "BreadcrumbElipssis"
106
-
107
- export {
108
- Breadcrumb,
109
- BreadcrumbList,
110
- BreadcrumbItem,
111
- BreadcrumbLink,
112
- BreadcrumbPage,
113
- BreadcrumbSeparator,
114
- BreadcrumbEllipsis,
115
- }
@@ -1,87 +0,0 @@
1
- import { Meta, StoryObj } from "@storybook/react"
2
-
3
- import { ChevronRight, Loader2, MailOpen } from 'lucide-react'
4
- import {
5
- Button,
6
- } from "./button"
7
-
8
- const meta = {
9
- title: "Components/Button",
10
- component: Button,
11
- parameters: {
12
- layout: "centered",
13
- },
14
- tags: ["autodocs"],
15
- } satisfies Meta<typeof Button>
16
-
17
- export default meta
18
- type Story = StoryObj<typeof meta>
19
-
20
- export const Default: Story = {
21
- render: () => (
22
- <Button>Button</Button>
23
- )
24
- }
25
-
26
- export const Secondary: Story = {
27
- render: () => (
28
- <Button variant="secondary">Secondary</Button>
29
- )
30
- }
31
-
32
- export const Destructive: Story = {
33
- render: () => (
34
- <Button variant="destructive">Secondary</Button>
35
- )
36
- }
37
-
38
- export const Outline: Story = {
39
- render: () => (
40
- <Button variant="outline">Secondary</Button>
41
- )
42
- }
43
-
44
- export const Ghost: Story = {
45
- render: () => (
46
- <Button variant="ghost">Secondary</Button>
47
- )
48
- }
49
-
50
- export const Link: Story = {
51
- render: () => (
52
- <Button variant="link">Secondary</Button>
53
- )
54
- }
55
-
56
- export const Icon: Story = {
57
- render: () => (
58
- <Button variant="outline" size="icon">
59
- <ChevronRight />
60
- </Button>
61
- )
62
- }
63
-
64
- export const WithIcon: Story = {
65
- render: () => (
66
- <Button>
67
- <MailOpen /> Login with Email
68
- </Button>
69
- )
70
- }
71
-
72
- export const Loading: Story = {
73
- render: () => (
74
- <Button disabled>
75
- <Loader2 className="animate-spin" />
76
- Please wait
77
- </Button>
78
- )
79
- }
80
-
81
- export const ButtonAsChild: Story = {
82
- render: () => (
83
- <Button asChild>
84
- <p>This is a button</p>
85
- </Button>
86
- )
87
- }
@@ -1,57 +0,0 @@
1
- import * as React from "react"
2
- import { Slot } from "@radix-ui/react-slot"
3
- import { cva, type VariantProps } from "class-variance-authority"
4
-
5
- import { cn } from "@/lib/utils"
6
-
7
- const buttonVariants = cva(
8
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
9
- {
10
- variants: {
11
- variant: {
12
- default:
13
- "bg-primary text-primary-foreground shadow hover:bg-primary/90",
14
- destructive:
15
- "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
16
- outline:
17
- "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
18
- secondary:
19
- "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
20
- ghost: "hover:bg-accent hover:text-accent-foreground",
21
- link: "text-primary underline-offset-4 hover:underline",
22
- },
23
- size: {
24
- default: "h-9 px-4 py-2",
25
- sm: "h-8 rounded-md px-3 text-xs",
26
- lg: "h-10 rounded-md px-8",
27
- icon: "h-9 w-9",
28
- },
29
- },
30
- defaultVariants: {
31
- variant: "default",
32
- size: "default",
33
- },
34
- }
35
- )
36
-
37
- export interface ButtonProps
38
- extends React.ButtonHTMLAttributes<HTMLButtonElement>,
39
- VariantProps<typeof buttonVariants> {
40
- asChild?: boolean
41
- }
42
-
43
- const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
44
- ({ className, variant, size, asChild = false, ...props }, ref) => {
45
- const Comp = asChild ? Slot : "button"
46
- return (
47
- <Comp
48
- className={cn(buttonVariants({ variant, size, className }))}
49
- ref={ref}
50
- {...props}
51
- />
52
- )
53
- }
54
- )
55
- Button.displayName = "Button"
56
-
57
- export { Button, buttonVariants }
@@ -1,99 +0,0 @@
1
- import { Meta, StoryObj } from "@storybook/react"
2
-
3
- import {
4
- Card,
5
- CardHeader,
6
- CardFooter,
7
- CardTitle,
8
- CardDescription,
9
- CardContent
10
- } from "./card"
11
- import { Button } from './button'
12
- import { Switch } from './switch'
13
-
14
- import { BellRing, Check } from 'lucide-react'
15
-
16
-
17
- const meta = {
18
- title: "Components/Card",
19
- component: Card,
20
- parameters: {
21
- layout: "centered",
22
- },
23
- tags: ["autodocs"],
24
- } satisfies Meta<typeof Card>
25
-
26
- export default meta
27
- type Story = StoryObj<typeof meta>
28
-
29
- export const Default: Story = {
30
- render: () => (
31
- <Card>
32
- <CardHeader>
33
- <CardTitle>Card Title</CardTitle>
34
- <CardDescription>Card Description</CardDescription>
35
- </CardHeader>
36
- <CardContent>
37
- <p>Card Content</p>
38
- </CardContent>
39
- <CardFooter>
40
- <p>Card Footer</p>
41
- </CardFooter>
42
- </Card>
43
- )
44
- }
45
-
46
- export type notificationProps = {
47
- title: string,
48
- description: string
49
- }
50
-
51
- export const NotificationsCard = {
52
- args: {
53
- notifications: [
54
- {
55
- title: "Your call has been confirmed.",
56
- description: "1 hour ago",
57
- },
58
- {
59
- title: "You have a new message!",
60
- description: "1 hour ago",
61
- },
62
- {
63
- title: "Your subscription is expiring soon!",
64
- description: "2 hours ago",
65
- },
66
- ],
67
- className: '',
68
- props: ''
69
- },
70
- render: () => (
71
- <Card className="w-[380px]">
72
- <CardHeader>
73
- <CardTitle>Notifications</CardTitle>
74
- <CardDescription>You have 3 unread messages.</CardDescription>
75
- </CardHeader>
76
- <CardContent className="grid gap-4">
77
- <div className=" flex items-center space-x-4 rounded-md border p-4">
78
- <BellRing />
79
- <div className="flex-1 space-y-1">
80
- <p className="text-sm font-medium leading-none">
81
- Push Notifications
82
- </p>
83
- <p className="text-sm text-muted-foreground">
84
- Send notifications to device.
85
- </p>
86
- </div>
87
- <Switch />
88
- </div>
89
- <div>
90
- </div>
91
- </CardContent>
92
- <CardFooter>
93
- <Button className="w-full">
94
- <Check /> Mark all as read
95
- </Button>
96
- </CardFooter>
97
- </Card>
98
- )
99
- }