diff --git a/apps/dashboard/src/components/primitives/input.tsx b/apps/dashboard/src/components/primitives/input.tsx index ec02bddc581..598ec92d302 100644 --- a/apps/dashboard/src/components/primitives/input.tsx +++ b/apps/dashboard/src/components/primitives/input.tsx @@ -5,11 +5,12 @@ import { cva, VariantProps } from 'class-variance-authority'; import { inputVariants } from '@/components/primitives/variants'; const inputFieldVariants = cva( - 'text-foreground-950 flex w-full flex-nowrap items-center gap-1.5 rounded-md border bg-transparent shadow-sm transition-colors focus-within:outline-none focus-visible:outline-none hover:bg-neutral-50 has-[input:disabled]:cursor-not-allowed has-[input:disabled]:opacity-50 has-[input[value=""]]:text-foreground-400 has-[input:disabled]:bg-neutral-alpha-100 has-[input:disabled]:text-foreground-300', + 'text-foreground-950 flex w-full flex-nowrap items-center gap-1.5 rounded-md border bg-transparent transition-colors focus-within:outline-none focus-visible:outline-none hover:bg-neutral-50 has-[input:disabled]:cursor-not-allowed has-[input:disabled]:opacity-50 has-[input[value=""]]:text-foreground-400 has-[input:disabled]:bg-neutral-alpha-100 has-[input:disabled]:text-foreground-300', { variants: { size: { default: 'h-8 px-2 [&>input]:py-1.5', + md: 'h-10 px-3 [&>input]:py-2.5', }, state: { default: diff --git a/apps/dashboard/src/components/primitives/tabs.tsx b/apps/dashboard/src/components/primitives/tabs.tsx index f194a5d7a61..78570186c44 100644 --- a/apps/dashboard/src/components/primitives/tabs.tsx +++ b/apps/dashboard/src/components/primitives/tabs.tsx @@ -2,43 +2,76 @@ import * as React from 'react'; import * as TabsPrimitive from '@radix-ui/react-tabs'; import { cn } from '@/utils/ui'; +import { cva, VariantProps } from 'class-variance-authority'; -const TabsList = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)); +const tabsListVariants = cva('inline-flex items-center', { + variants: { + variant: { + default: 'h-9 justify-center rounded-[10px] bg-neutral-alpha-100 p-1 text-muted-foreground', + regular: 'border-neutral-alpha-200 w-full justify-start gap-6 border-b border-t px-3.5', + }, + }, + defaultVariants: { + variant: 'default', + }, +}); + +type TabsListProps = React.ComponentPropsWithoutRef & VariantProps; + +const TabsList = React.forwardRef, TabsListProps>( + ({ className, variant, ...props }, ref) => ( + + ) +); TabsList.displayName = TabsPrimitive.List.displayName; -const TabsTrigger = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)); +const tabsTriggerVariants = cva( + 'inline-flex items-center justify-center whitespace-nowrap rounded-md font-medium ring-offset-background transition-all text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none data-[state=active]:text-foreground disabled:opacity-50', + { + variants: { + variant: { + default: + 'px-3 py-1 data-[state=active]:bg-background data-[state=active]:shadow data-[state=inactive]:text-foreground-400', + regular: + "text-foreground-600 data-[state=active]:after:border-primary data-[state=active]:text-foreground-950 relative py-3.5 duration-300 ease-out after:absolute after:bottom-0 after:left-0 after:h-[2px] after:w-full after:border-b-2 after:border-b-transparent after:content-['']", + }, + }, + defaultVariants: { + variant: 'default', + }, + } +); + +type TabsTriggerProps = React.ComponentPropsWithoutRef & + VariantProps; + +const TabsTrigger = React.forwardRef, TabsTriggerProps>( + ({ className, variant, ...props }, ref) => ( + + ) +); TabsTrigger.displayName = TabsPrimitive.Trigger.displayName; -const TabsContent = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)); +const tabsContentVariants = cva('focus-visible:outline-none', { + variants: { + variant: { + default: 'ring-offset-background focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2', + regular: 'mt-2', + }, + }, + defaultVariants: { + variant: 'default', + }, +}); + +type TabsContentProps = React.ComponentPropsWithoutRef & + VariantProps; + +const TabsContent = React.forwardRef, TabsContentProps>( + ({ className, variant, ...props }, ref) => ( + + ) +); TabsContent.displayName = TabsPrimitive.Content.displayName; const Tabs = React.forwardRef< diff --git a/apps/dashboard/src/components/primitives/textarea.tsx b/apps/dashboard/src/components/primitives/textarea.tsx index 072953042d4..c871447948b 100644 --- a/apps/dashboard/src/components/primitives/textarea.tsx +++ b/apps/dashboard/src/components/primitives/textarea.tsx @@ -9,6 +9,7 @@ const textareaVariants = cva( variants: { size: { default: 'h-8 px-2 py-1.5', + md: 'h-10 px-3 py-2.5', }, state: { default: diff --git a/apps/dashboard/src/components/primitives/url-input.tsx b/apps/dashboard/src/components/primitives/url-input.tsx index 18c646f812d..ec5976936d3 100644 --- a/apps/dashboard/src/components/primitives/url-input.tsx +++ b/apps/dashboard/src/components/primitives/url-input.tsx @@ -1,6 +1,6 @@ 'use client'; -import { Input, InputField, InputProps } from '@/components/primitives/input'; +import { Input, InputField, InputFieldProps, InputProps } from '@/components/primitives/input'; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/primitives/select'; import { RedirectTargetEnum } from '@novu/shared'; import { forwardRef } from 'react'; @@ -10,19 +10,19 @@ type URLValue = { url: string; }; -type URLInputProps = Omit & { +type URLInputProps = Omit & { options: string[]; value: URLValue; onChange: (value: URLValue) => void; -}; +} & Pick; export const URLInput = forwardRef((props, ref) => { - const { options, value, onChange, ...rest } = props; + const { options, value, onChange, size, ...rest } = props; return (
- + ((props, ref) {...rest} /> + +
+