diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a02ae73..3ec1978 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -107,7 +107,7 @@ importers: version: 10.1.8(eslint@9.39.2(jiti@2.6.1)) eslint-plugin-import: specifier: ^2.32.0 - version: 2.32.0(@typescript-eslint/parser@8.51.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.2(jiti@2.6.1)) + version: 2.32.0(eslint@9.39.2(jiti@2.6.1)) eslint-plugin-prettier: specifier: ^5.5.4 version: 5.5.4(eslint-config-prettier@10.1.8(eslint@9.39.2(jiti@2.6.1)))(eslint@9.39.2(jiti@2.6.1))(prettier@3.7.4) @@ -3859,17 +3859,16 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-module-utils@2.12.1(@typescript-eslint/parser@8.51.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3))(eslint-import-resolver-node@0.3.10)(eslint@9.39.2(jiti@2.6.1)): + eslint-module-utils@2.12.1(eslint-import-resolver-node@0.3.10)(eslint@9.39.2(jiti@2.6.1)): dependencies: debug: 3.2.7 optionalDependencies: - '@typescript-eslint/parser': 8.51.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3) eslint: 9.39.2(jiti@2.6.1) eslint-import-resolver-node: 0.3.10 transitivePeerDependencies: - supports-color - eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.51.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.2(jiti@2.6.1)): + eslint-plugin-import@2.32.0(eslint@9.39.2(jiti@2.6.1)): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.9 @@ -3880,7 +3879,7 @@ snapshots: doctrine: 2.1.0 eslint: 9.39.2(jiti@2.6.1) eslint-import-resolver-node: 0.3.10 - eslint-module-utils: 2.12.1(@typescript-eslint/parser@8.51.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3))(eslint-import-resolver-node@0.3.10)(eslint@9.39.2(jiti@2.6.1)) + eslint-module-utils: 2.12.1(eslint-import-resolver-node@0.3.10)(eslint@9.39.2(jiti@2.6.1)) hasown: 2.0.2 is-core-module: 2.16.1 is-glob: 4.0.3 @@ -3891,8 +3890,6 @@ snapshots: semver: 6.3.1 string.prototype.trimend: 1.0.9 tsconfig-paths: 3.15.0 - optionalDependencies: - '@typescript-eslint/parser': 8.51.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3) transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack diff --git a/src/components/common/Button.tsx b/src/components/common/Button.tsx new file mode 100644 index 0000000..4fff77a --- /dev/null +++ b/src/components/common/Button.tsx @@ -0,0 +1,48 @@ +import { cva, type VariantProps } from "class-variance-authority"; +import React, { forwardRef } from "react"; + +import { cn } from "@/lib/utils"; + +const buttonVariants = cva( + "cursor-pointer relative inline-flex items-center justify-center overflow-hidden rounded-full uppercase tracking-widest transition-all", + { + variants: { + variant: { + glass: + "border border-white-1/20 bg-white-1/5 backdrop-blur-sm hover:bg-gold-1 hover:border-gold-1 text-white-1 hover:text-black-1", + solid: + "bg-black-1 text-gold-1 hover:scale-105 after:absolute after:inset-0 after:-z-10 after:bg-white-1 after:opacity-0 after:transition-opacity hover:after:opacity-10", + }, + size: { + sm: "px-8 py-3 text-sm font-medium", + lg: "px-12 py-6 text-lg font-bold", + }, + }, + defaultVariants: { + variant: "glass", + size: "sm", + }, + }, +); + +interface ButtonProps + extends React.ButtonHTMLAttributes, VariantProps { + children: React.ReactNode; +} + +export const BaseButton = forwardRef( + ({ variant, size, className, children, type = "button", ...props }, ref) => { + return ( + + ); + }, +); + +BaseButton.displayName = "BaseButton"; diff --git a/src/components/common/Card.tsx b/src/components/common/Card.tsx new file mode 100644 index 0000000..5bce7e6 --- /dev/null +++ b/src/components/common/Card.tsx @@ -0,0 +1,81 @@ +import React, { forwardRef } from "react"; + +import { cn } from "@/lib/utils"; + +export interface RestaurantCardProps extends React.ButtonHTMLAttributes { + image: string; + name: string; + rating: string | number; + category: string; + location: string; +} + +export const RestaurantCard = forwardRef( + ({ image, name, rating, category, location, className, ...props }, ref) => { + return ( + + ); + }, +); + +RestaurantCard.displayName = "RestaurantCard"; diff --git a/src/components/common/Input.tsx b/src/components/common/Input.tsx new file mode 100644 index 0000000..b0535cb --- /dev/null +++ b/src/components/common/Input.tsx @@ -0,0 +1,42 @@ +import React, { forwardRef } from "react"; + +import { cn } from "@/lib/utils"; + +export interface BaseInputProps extends React.InputHTMLAttributes { + label?: string; + wrapperClassName?: string; + labelClassName?: string; +} + +export const BaseInput = forwardRef( + ({ label, className, wrapperClassName, labelClassName, ...props }, ref) => { + const inputId = props.id; + return ( +
+ {label && ( + + )} + +
+ ); + }, +); + +BaseInput.displayName = "BaseInput"; diff --git a/src/components/common/SearchInput.tsx b/src/components/common/SearchInput.tsx new file mode 100644 index 0000000..03755c6 --- /dev/null +++ b/src/components/common/SearchInput.tsx @@ -0,0 +1,47 @@ +import React, { forwardRef } from "react"; + +import { cn } from "@/lib/utils"; + +export interface SearchInputProps extends React.InputHTMLAttributes { + wrapperClassName?: string; + iconClassName?: string; +} + +export const SearchInput = forwardRef( + ({ className, wrapperClassName, iconClassName, ...props }, ref) => { + return ( +
+ + +
+ ); + }, +); + +SearchInput.displayName = "SearchInput"; diff --git a/src/main.tsx b/src/main.tsx index b03cc65..47eb1dd 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1,4 +1,5 @@ import "./index.css"; +import "./styles/theme.css"; import { QueryClientProvider } from "@tanstack/react-query"; import { StrictMode } from "react"; diff --git a/src/styles/theme.css b/src/styles/theme.css index 15a1ec6..c85d00a 100644 --- a/src/styles/theme.css +++ b/src/styles/theme.css @@ -1,5 +1,7 @@ /*컬러 정리*/ +@import "tailwindcss"; + :root { --black-1: #121212; --black-2: #1a1a1a;