Updated UI package to work with the new Shadcn CLI (#59)

Updated UI package to work with the new Shadcn CLI
This commit is contained in:
Giancarlo Buomprisco
2024-09-03 18:17:51 +08:00
committed by GitHub
parent b3b061fc2e
commit fafcafc221
67 changed files with 100 additions and 73 deletions

View File

@@ -3,13 +3,13 @@
import Link from 'next/link';
import { usePathname } from 'next/navigation';
import { cn, isRouteActive } from '../lib/utils';
import { Button } from '../shadcn/button';
import {
NavigationMenu,
NavigationMenuItem,
NavigationMenuList,
} from '../shadcn/navigation-menu';
import { cn, isRouteActive } from '../utils';
import { Trans } from './trans';
export function BorderedNavigationMenu(props: React.PropsWithChildren) {

View File

@@ -3,7 +3,7 @@ import * as React from 'react';
import { Slot, Slottable } from '@radix-ui/react-slot';
import { ChevronRight } from 'lucide-react';
import { cn } from '../utils';
import { cn } from '../lib/utils';
export const CardButton = React.forwardRef<
HTMLButtonElement,

View File

@@ -1,4 +1,4 @@
import { cn } from '../utils/cn';
import { cn } from '../lib/utils';
export function Divider(props: { className?: string }) {
return <div className={cn('h-[1px] w-full bg-border', props.className)} />;

View File

@@ -1,7 +1,7 @@
import React from 'react';
import { cn } from '../lib/utils';
import { Button } from '../shadcn/button';
import { cn } from '../utils';
const EmptyStateHeading = React.forwardRef<
HTMLHeadingElement,

View File

@@ -7,9 +7,9 @@ import Image from 'next/image';
import { UploadCloud, X } from 'lucide-react';
import { cn } from '../lib/utils';
import { Button } from '../shadcn/button';
import { Label } from '../shadcn/label';
import { cn } from '../utils';
import { If } from './if';
type Props = Omit<React.InputHTMLAttributes<unknown>, 'value'> & {

View File

@@ -1,6 +1,6 @@
import type { PropsWithChildren } from 'react';
import { cn } from '../utils';
import { cn } from '../lib/utils';
import { Spinner } from './spinner';
export function LoadingOverlay({

View File

@@ -1,7 +1,7 @@
import { forwardRef } from 'react';
import { cn } from '../../lib/utils';
import { Button } from '../../shadcn/button';
import { cn } from '../../utils';
export const CtaButton = forwardRef<
HTMLButtonElement,

View File

@@ -1,12 +1,12 @@
import React, { forwardRef } from 'react';
import { cn } from '../../lib/utils';
import {
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from '../../shadcn/card';
import { cn } from '../../utils';
interface FeatureCardProps extends React.HTMLAttributes<HTMLDivElement> {
label: string;

View File

@@ -1,6 +1,6 @@
import React, { forwardRef } from 'react';
import { cn } from '../../utils';
import { cn } from '../../lib/utils';
export const FeatureGrid = forwardRef<
HTMLDivElement,

View File

@@ -1,6 +1,6 @@
import React, { forwardRef } from 'react';
import { cn } from '../../utils';
import { cn } from '../../lib/utils';
interface FeatureShowcaseProps extends React.HTMLAttributes<HTMLDivElement> {
heading: React.ReactNode;

View File

@@ -1,6 +1,6 @@
import { forwardRef } from 'react';
import { cn } from '../../utils';
import { cn } from '../../lib/utils';
interface FooterSection {
heading: React.ReactNode;

View File

@@ -2,7 +2,7 @@ import { forwardRef } from 'react';
import { Slot, Slottable } from '@radix-ui/react-slot';
import { cn } from '../../utils';
import { cn } from '../../lib/utils';
export const GradientSecondaryText = forwardRef<
HTMLSpanElement,

View File

@@ -1,6 +1,6 @@
import React, { forwardRef } from 'react';
import { cn } from '../../utils';
import { cn } from '../../lib/utils';
export const GradientText = forwardRef<
HTMLSpanElement,

View File

@@ -1,6 +1,6 @@
import { forwardRef } from 'react';
import { cn } from '../../utils';
import { cn } from '../../lib/utils';
interface HeaderProps extends React.HTMLAttributes<HTMLDivElement> {
logo?: React.ReactNode;

View File

@@ -2,7 +2,7 @@ import { forwardRef } from 'react';
import { Slot, Slottable } from '@radix-ui/react-slot';
import { cn } from '../../utils';
import { cn } from '../../lib/utils';
export const HeroTitle = forwardRef<
HTMLHeadingElement,

View File

@@ -1,7 +1,7 @@
import React from 'react';
import { cn } from '../../lib/utils';
import { Heading } from '../../shadcn/heading';
import { cn } from '../../utils';
import { HeroTitle } from './hero-title';
interface HeroProps {

View File

@@ -2,9 +2,9 @@
import { useCallback, useState } from 'react';
import { cn } from '../../lib/utils';
import { Alert, AlertDescription, AlertTitle } from '../../shadcn/alert';
import { Heading } from '../../shadcn/heading';
import { cn } from '../../utils';
import { Spinner } from '../spinner';
import { NewsletterSignup } from './newsletter-signup';

View File

@@ -4,6 +4,7 @@ import { zodResolver } from '@hookform/resolvers/zod';
import { useForm } from 'react-hook-form';
import { z } from 'zod';
import { cn } from '../../lib/utils';
import { Button } from '../../shadcn/button';
import {
Form,
@@ -13,7 +14,6 @@ import {
FormMessage,
} from '../../shadcn/form';
import { Input } from '../../shadcn/input';
import { cn } from '../../utils';
const NewsletterFormSchema = z.object({
email: z.string().email('Please enter a valid email address'),

View File

@@ -2,7 +2,7 @@ import { forwardRef } from 'react';
import { Slot, Slottable } from '@radix-ui/react-slot';
import { cn } from '../../utils';
import { cn } from '../../lib/utils';
import { GradientSecondaryText } from './gradient-secondary-text';
export const Pill = forwardRef<

View File

@@ -1,7 +1,7 @@
import { forwardRef } from 'react';
import { cn } from '../../lib/utils';
import { Heading } from '../../shadcn/heading';
import { cn } from '../../utils';
interface SecondaryHeroProps extends React.HTMLAttributes<HTMLDivElement> {
pill?: React.ReactNode;

View File

@@ -5,6 +5,7 @@ import { useMemo } from 'react';
import { Computer, Moon, Sun } from 'lucide-react';
import { useTheme } from 'next-themes';
import { cn } from '../lib/utils';
import { Button } from '../shadcn/button';
import {
DropdownMenu,
@@ -16,7 +17,6 @@ import {
DropdownMenuSubTrigger,
DropdownMenuTrigger,
} from '../shadcn/dropdown-menu';
import { cn } from '../utils';
import { Trans } from './trans';
const MODES = ['light', 'dark', 'system'];

View File

@@ -16,7 +16,7 @@ import { useMutation } from '@tanstack/react-query';
import { Path, UseFormReturn } from 'react-hook-form';
import { z } from 'zod';
import { cn } from '../utils';
import { cn } from '../lib/utils';
interface MultiStepFormProps<T extends z.ZodType> {
schema: T;

View File

@@ -1,6 +1,6 @@
import * as React from 'react';
import { cn } from '../utils';
import { cn } from '../lib/utils';
export type PageLayoutStyle = 'sidebar' | 'header' | 'custom';

View File

@@ -1,5 +1,5 @@
import { cn } from '../lib/utils';
import { Avatar, AvatarFallback, AvatarImage } from '../shadcn/avatar';
import { cn } from '../utils';
type SessionProps = {
displayName: string | null;

View File

@@ -9,6 +9,7 @@ import { cva } from 'class-variance-authority';
import { ChevronDown } from 'lucide-react';
import { z } from 'zod';
import { cn, isRouteActive } from '../lib/utils';
import { Button } from '../shadcn/button';
import {
Tooltip,
@@ -16,7 +17,6 @@ import {
TooltipProvider,
TooltipTrigger,
} from '../shadcn/tooltip';
import { cn, isRouteActive } from '../utils';
import { SidebarContext } from './context/sidebar.context';
import { If } from './if';
import type { NavigationConfigSchema } from './navigation-config.schema';

View File

@@ -1,4 +1,4 @@
import { cn } from '../utils';
import { cn } from '../lib/utils';
export function Spinner(
props: React.PropsWithChildren<{

View File

@@ -4,7 +4,7 @@ import { Fragment, useCallback } from 'react';
import { cva } from 'class-variance-authority';
import { cn } from '../utils';
import { cn } from '../lib/utils';
import { If } from './if';
import { Trans } from './trans';