diff --git a/apps/landing/src/app/(frontend)/_components/call-to-action.tsx b/apps/landing/src/app/(frontend)/_components/call-to-action.tsx index 6067086..3b8e2a6 100644 --- a/apps/landing/src/app/(frontend)/_components/call-to-action.tsx +++ b/apps/landing/src/app/(frontend)/_components/call-to-action.tsx @@ -1,6 +1,6 @@ 'use client'; -import { Button } from '@imphnen-frontend-service/shadcn-ui/atoms'; +import { Button } from '@components'; import { motion, useInView } from 'framer-motion'; import { useRef } from 'react'; diff --git a/apps/landing/src/app/(frontend)/_components/community.tsx b/apps/landing/src/app/(frontend)/_components/community.tsx index aab92cc..8a6c47e 100644 --- a/apps/landing/src/app/(frontend)/_components/community.tsx +++ b/apps/landing/src/app/(frontend)/_components/community.tsx @@ -1,7 +1,7 @@ 'use client'; +import { Button } from '@components'; import { Icon } from '@iconify/react'; -import { Button } from '@imphnen-frontend-service/shadcn-ui/atoms'; import { motion, useInView } from 'framer-motion'; import { useRef } from 'react'; diff --git a/apps/landing/src/app/(frontend)/_components/footer.tsx b/apps/landing/src/app/(frontend)/_components/footer.tsx index 1711850..6f5b4ba 100644 --- a/apps/landing/src/app/(frontend)/_components/footer.tsx +++ b/apps/landing/src/app/(frontend)/_components/footer.tsx @@ -188,8 +188,10 @@ export default function Footer() { placeholder="Email Anda" className="flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50" /> - diff --git a/apps/landing/src/app/(frontend)/_components/header.tsx b/apps/landing/src/app/(frontend)/_components/header.tsx index b27daa0..f569fe0 100644 --- a/apps/landing/src/app/(frontend)/_components/header.tsx +++ b/apps/landing/src/app/(frontend)/_components/header.tsx @@ -1,11 +1,7 @@ 'use client'; -import { - Button, - MenuIcon, - XIcon, -} from '@imphnen-frontend-service/shadcn-ui/atoms'; -import { cn } from '@imphnen-frontend-service/utils'; +import { Button, MenuIcon, XIcon } from '@components'; +import { cn } from '@utils'; import Image from 'next/image'; import Link from 'next/link'; import { useEffect, useState } from 'react'; diff --git a/apps/landing/src/app/(frontend)/_components/hero.tsx b/apps/landing/src/app/(frontend)/_components/hero.tsx index c9957fe..a306096 100644 --- a/apps/landing/src/app/(frontend)/_components/hero.tsx +++ b/apps/landing/src/app/(frontend)/_components/hero.tsx @@ -1,11 +1,6 @@ 'use client'; -import { - Button, - CodeIcon, - SparklesIcon, - UsersIcon, -} from '@imphnen-frontend-service/shadcn-ui/atoms'; +import { Button, CodeIcon, SparklesIcon, UsersIcon } from '@components'; import { motion } from 'framer-motion'; import Image from 'next/image'; import { Fragment, useEffect, useState } from 'react'; diff --git a/apps/landing/src/app/(frontend)/_components/learning-resources.tsx b/apps/landing/src/app/(frontend)/_components/learning-resources.tsx index a437924..b5caca9 100644 --- a/apps/landing/src/app/(frontend)/_components/learning-resources.tsx +++ b/apps/landing/src/app/(frontend)/_components/learning-resources.tsx @@ -1,7 +1,7 @@ 'use client'; +import { Button } from '@components'; import { Icon } from '@iconify/react'; -import { Button } from '@imphnen-frontend-service/shadcn-ui/atoms'; import { motion, useInView } from 'framer-motion'; import { useRef } from 'react'; diff --git a/apps/landing/src/app/(frontend)/_components/simple-theme-toggle.tsx b/apps/landing/src/app/(frontend)/_components/simple-theme-toggle.tsx index a9fc723..a4c65ce 100644 --- a/apps/landing/src/app/(frontend)/_components/simple-theme-toggle.tsx +++ b/apps/landing/src/app/(frontend)/_components/simple-theme-toggle.tsx @@ -1,10 +1,6 @@ 'use client'; -import { - Button, - MoonIcon, - SunIcon, -} from '@imphnen-frontend-service/shadcn-ui/atoms'; +import { Button, MoonIcon, SunIcon } from '@components'; import { useTheme } from 'next-themes'; import { useEffect, useState } from 'react'; diff --git a/apps/landing/src/app/(frontend)/_components/testimonials.tsx b/apps/landing/src/app/(frontend)/_components/testimonials.tsx index 3e747a8..5f1ecd6 100644 --- a/apps/landing/src/app/(frontend)/_components/testimonials.tsx +++ b/apps/landing/src/app/(frontend)/_components/testimonials.tsx @@ -1,6 +1,6 @@ 'use client'; -import { QuoteIcon } from '@imphnen-frontend-service/shadcn-ui/atoms'; +import { QuoteIcon } from '@components'; import { motion, useInView } from 'framer-motion'; import Image from 'next/image'; import { useRef } from 'react'; diff --git a/apps/landing/tsconfig.json b/apps/landing/tsconfig.json index 2a48629..22bc666 100644 --- a/apps/landing/tsconfig.json +++ b/apps/landing/tsconfig.json @@ -11,11 +11,7 @@ "moduleResolution": "bundler", "resolveJsonModule": true, "isolatedModules": true, - "lib": [ - "dom", - "dom.iterable", - "esnext" - ], + "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, @@ -24,7 +20,14 @@ { "name": "next" } - ] + ], + "baseUrl": ".", + "paths": { + "@components": ["../../libs/shadcn-ui/src/atoms/index.ts"], + "@utils": ["../../libs/shadcn-ui/src/lib/index.ts"], + "@schemas": ["../../libs/service/src/schemas/index.ts"], + "@/*": ["src/*"] + } }, "include": [ "**/*.js", @@ -36,10 +39,5 @@ "next-env.d.ts", ".next/types/**/*.ts" ], - "exclude": [ - "node_modules", - "jest.config.ts", - "**/*.spec.ts", - "**/*.test.ts" - ] + "exclude": ["node_modules", "jest.config.ts", "**/*.spec.ts", "**/*.test.ts"] } diff --git a/libs/shadcn-ui/src/atoms/button.tsx b/libs/shadcn-ui/src/atoms/button.tsx index 0ebab5c..d8c89fc 100644 --- a/libs/shadcn-ui/src/atoms/button.tsx +++ b/libs/shadcn-ui/src/atoms/button.tsx @@ -1,9 +1,9 @@ 'use client'; -import { cn } from '@imphnen-frontend-service/utils'; import { Slot } from '@radix-ui/react-slot'; import { cva, type VariantProps } from 'class-variance-authority'; import * as React from 'react'; +import { cn } from '../lib/cn'; const buttonVariants = cva( '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', diff --git a/libs/shadcn-ui/src/lib/cn.ts b/libs/shadcn-ui/src/lib/cn.ts new file mode 100644 index 0000000..ffe21d2 --- /dev/null +++ b/libs/shadcn-ui/src/lib/cn.ts @@ -0,0 +1,6 @@ +import { ClassValue, clsx } from 'clsx'; +import { twMerge } from 'tailwind-merge'; + +export const cn = (...inputs: ClassValue[]) => { + return twMerge(clsx(inputs)); +}; diff --git a/libs/shadcn-ui/src/lib/index.ts b/libs/shadcn-ui/src/lib/index.ts new file mode 100644 index 0000000..9ae36a5 --- /dev/null +++ b/libs/shadcn-ui/src/lib/index.ts @@ -0,0 +1 @@ +export * from './cn'; diff --git a/tsconfig.base.json b/tsconfig.base.json index f26b5f3..8fe0377 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -16,7 +16,6 @@ "baseUrl": ".", "paths": { "@imphnen-frontend-service/service": ["libs/service/src/index.ts"], - "@imphnen-frontend-service/shadcn-ui/atoms": ["libs/shadcn-ui/src/atoms/index.ts"], "@imphnen-frontend-service/ui/atoms": ["libs/ui/src/atoms/index.ts"], "@imphnen-frontend-service/ui/molecules": [ "libs/ui/src/molecules/index.ts"