Skip to content

Commit

Permalink
feat: add ui for dialog drawer and input
Browse files Browse the repository at this point in the history
  • Loading branch information
s-hirano-ist committed Jun 8, 2024
1 parent a8077bb commit 3c863b3
Show file tree
Hide file tree
Showing 22 changed files with 958 additions and 6 deletions.
1 change: 1 addition & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GITHUB_LINK=
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,8 @@
"tailwindCSS.experimental.classRegex": [
["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
["cx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
],
"cSpell.words": [
"vaul"
]
}
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@
"dependencies": {
"@biomejs/biome": "1.8.0",
"@radix-ui/react-checkbox": "1.0.4",
"@radix-ui/react-dialog": "1.0.5",
"@radix-ui/react-dropdown-menu": "2.0.6",
"@radix-ui/react-icons": "1.3.0",
"@radix-ui/react-label": "2.0.2",
"@radix-ui/react-slot": "1.0.2",
"@radix-ui/react-tabs": "1.0.4",
"@tanstack/react-table": "8.17.3",
"class-variance-authority": "0.7.0",
"clsx": "2.1.1",
Expand All @@ -29,7 +32,9 @@
"react": "18.3.1",
"react-dom": "18.3.1",
"tailwind-merge": "2.3.0",
"tailwindcss-animate": "1.0.7"
"tailwindcss-animate": "1.0.7",
"vaul": "0.9.1",
"zod": "3.23.8"
},
"devDependencies": {
"@types/node": "20.14.1",
Expand Down
124 changes: 124 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file added public/.gitkeep
Empty file.
1 change: 0 additions & 1 deletion public/next.svg

This file was deleted.

1 change: 0 additions & 1 deletion public/vercel.svg

This file was deleted.

4 changes: 2 additions & 2 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { DataTableDemo } from "@/features/list/table";
import { MainTab } from "@/features/blog/components/main-tab";

export default function Home() {
return (
<main className="flex min-h-screen flex-col items-center justify-between p-24">
<DataTableDemo />
<MainTab />
</main>
);
}
18 changes: 18 additions & 0 deletions src/components/form/submit-button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"use client";
import { Button } from "@/components/ui/button";
import type { FC } from "react";
import { useFormStatus } from "react-dom";

type Props = {
label: string;
};

export const SubmitButton: FC<Props> = ({ label }) => {
const { pending } = useFormStatus();

return (
<Button type="submit" disabled={pending}>
{label}
</Button>
);
};
83 changes: 83 additions & 0 deletions src/components/ui/card.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import * as React from "react";

import { cn } from "@/lib/utils";

const Card = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
<div
ref={ref}
className={cn(
"rounded-xl border bg-card text-card-foreground shadow",
className,
)}
{...props}
/>
));
Card.displayName = "Card";

const CardHeader = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
<div
ref={ref}
className={cn("flex flex-col space-y-1.5 p-6", className)}
{...props}
/>
));
CardHeader.displayName = "CardHeader";

const CardTitle = React.forwardRef<
HTMLParagraphElement,
React.HTMLAttributes<HTMLHeadingElement>
>(({ className, ...props }, ref) => (
<h3
ref={ref}
className={cn("font-semibold leading-none tracking-tight", className)}
{...props}
/>
));
CardTitle.displayName = "CardTitle";

const CardDescription = React.forwardRef<
HTMLParagraphElement,
React.HTMLAttributes<HTMLParagraphElement>
>(({ className, ...props }, ref) => (
<p
ref={ref}
className={cn("text-sm text-muted-foreground", className)}
{...props}
/>
));
CardDescription.displayName = "CardDescription";

const CardContent = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
<div ref={ref} className={cn("p-6 pt-0", className)} {...props} />
));
CardContent.displayName = "CardContent";

const CardFooter = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
<div
ref={ref}
className={cn("flex items-center p-6 pt-0", className)}
{...props}
/>
));
CardFooter.displayName = "CardFooter";

export {
Card,
CardHeader,
CardFooter,
CardTitle,
CardDescription,
CardContent,
};
Loading

0 comments on commit 3c863b3

Please sign in to comment.