diff --git a/packages/ui/src/components/badge.tsx b/packages/ui/src/components/badge.tsx index 56a17bc10..a4cc554ea 100644 --- a/packages/ui/src/components/badge.tsx +++ b/packages/ui/src/components/badge.tsx @@ -1,9 +1,8 @@ import * as React from 'react' +import { cn } from '@utils/cn' import { cva, type VariantProps } from 'class-variance-authority' -import { cn } from '../utils/cn' - enum BadgesHoverStates { ENABLED = 'enabled', DISABLED_DEFAULT = 'disabled-default', @@ -18,24 +17,24 @@ enum BadgesHoverStates { } const badgeVariants = cva( - 'inline-flex items-center rounded-md border transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2', + 'focus:ring-ring inline-flex items-center rounded-md border transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2', { variants: { variant: { - default: 'border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80', - secondary: 'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80', - destructive: 'border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80', + default: 'bg-primary text-primary-foreground hover:bg-primary/80 border-transparent shadow', + secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80 border-transparent', + destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/80 border-transparent shadow', outline: 'text-foreground' }, size: { default: 'px-2.5 py-0.5 text-xs font-semibold', lg: 'px-3 py-1 text-xs font-normal', - sm: 'h-5 px-1 text-12 leading-none', - xs: 'px-1.5 py-0 text-11 font-light', + sm: 'text-12 h-5 px-1 leading-none', + xs: 'text-11 px-1.5 py-0 font-light', // TODO: Consider switching size variants to numeric values // Numeric size variants (like '18') provide clearer context about actual dimensions // compared to abstract sizes (xs, sm, lg). - '18': 'h-[18px] px-2 text-12' + '18': 'text-12 h-[18px] px-2' }, borderRadius: { default: '', diff --git a/packages/ui/src/components/calendar.tsx b/packages/ui/src/components/calendar.tsx index a45255c44..0683b6952 100644 --- a/packages/ui/src/components/calendar.tsx +++ b/packages/ui/src/components/calendar.tsx @@ -2,8 +2,8 @@ import * as React from 'react' import { DayPicker, type DateRange } from 'react-day-picker' import { ChevronLeftIcon, ChevronRightIcon } from '@radix-ui/react-icons' +import { cn } from '@utils/cn' -import { cn } from '../utils/cn' import { buttonVariants } from './button' export type CalendarProps = React.ComponentProps diff --git a/packages/ui/src/components/dialog.tsx b/packages/ui/src/components/dialog.tsx index cf74a57c6..f309c51ba 100644 --- a/packages/ui/src/components/dialog.tsx +++ b/packages/ui/src/components/dialog.tsx @@ -2,8 +2,7 @@ import * as React from 'react' import * as DialogPrimitive from '@radix-ui/react-dialog' import { Cross2Icon } from '@radix-ui/react-icons' - -import { cn } from '../utils/cn' +import { cn } from '@utils/cn' const Dialog = DialogPrimitive.Root @@ -43,7 +42,7 @@ const DialogContent = React.forwardRef< {...props} > {children} - + Close diff --git a/packages/ui/src/components/dropdown-menu.tsx b/packages/ui/src/components/dropdown-menu.tsx index f51454c40..ef079416f 100644 --- a/packages/ui/src/components/dropdown-menu.tsx +++ b/packages/ui/src/components/dropdown-menu.tsx @@ -2,8 +2,8 @@ import * as React from 'react' import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu' import { ChevronRightIcon, DotFilledIcon } from '@radix-ui/react-icons' +import { cn } from '@utils/cn' -import { cn } from '../utils/cn' import { Icon } from './icon' const DropdownMenu = DropdownMenuPrimitive.Root @@ -126,9 +126,9 @@ const DropdownMenuCheckboxItem = React.forwardRef< checked={checked} {...props} > - - - + + + {children} diff --git a/packages/ui/src/components/filters/filters-bar/filters.tsx b/packages/ui/src/components/filters/filters-bar/filters.tsx index 274155c9b..a1063bc0e 100644 --- a/packages/ui/src/components/filters/filters-bar/filters.tsx +++ b/packages/ui/src/components/filters/filters-bar/filters.tsx @@ -1,6 +1,7 @@ import { useEffect, useState } from 'react' -import { cn } from '../../../utils/cn' +import { cn } from '@utils/cn' + import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '../../dropdown-menu' import { Icon } from '../../icon' import type { CheckboxFilterOption, FilterAction, FilterOption, FilterSearchQueries, FilterValue } from '../types' @@ -83,8 +84,8 @@ const Filters = ({ return ( - -
+ +
{filterOption.label} {!!filter.selectedValues.length && ': '} @@ -106,7 +107,7 @@ const Filters = ({ {filterOption.label} - + {filterOption.conditions?.find(c => c.value === filter.condition)?.label} @@ -126,17 +127,17 @@ const Filters = ({ handleRemoveFilter?.(filter.type)} > - @@ -152,7 +153,7 @@ const Filters = ({ {filterOption.type === 'checkbox' && getFilteredOptions(filterOption, filter, searchQueries).length === 0 && (
- No results + No results
)}
diff --git a/packages/ui/src/components/filters/filters-bar/sorts.tsx b/packages/ui/src/components/filters/filters-bar/sorts.tsx index 7c1092054..ebc53f38a 100644 --- a/packages/ui/src/components/filters/filters-bar/sorts.tsx +++ b/packages/ui/src/components/filters/filters-bar/sorts.tsx @@ -6,9 +6,9 @@ import { Input } from '@components/input' import { closestCenter, DndContext } from '@dnd-kit/core' import { SortableContext, useSortable, verticalListSortingStrategy } from '@dnd-kit/sortable' import { CSS } from '@dnd-kit/utilities' +import useDragAndDrop from '@hooks/use-drag-and-drop' import { cn } from '@utils/cn' -import useDragAndDrop from '../../../hooks/use-drag-and-drop' import type { FilterAction, FilterSearchQueries, SortDirection, SortOption, SortValue } from '../types' import { UseFiltersReturn } from '../use-filters' import { getSortTriggerLabel } from '../utils' @@ -47,7 +47,7 @@ const SortableItem = ({
@@ -55,7 +55,7 @@ const SortableItem = ({
- + {sortOptions.find(opt => opt.value === sort.type)?.label} @@ -72,7 +72,7 @@ const SortableItem = ({ - + {sortDirections.find(dir => dir.value === sort.direction)?.label} @@ -90,7 +90,7 @@ const SortableItem = ({
@@ -248,10 +248,10 @@ const Sorts = ({ )} - diff --git a/packages/ui/src/components/input-otp.tsx b/packages/ui/src/components/input-otp.tsx index 9c61e65b8..e82a54665 100644 --- a/packages/ui/src/components/input-otp.tsx +++ b/packages/ui/src/components/input-otp.tsx @@ -1,10 +1,9 @@ import { ComponentPropsWithoutRef, ElementRef, forwardRef, useContext } from 'react' import { DashIcon } from '@radix-ui/react-icons' +import { cn } from '@utils/cn' import { OTPInput, OTPInputContext } from 'input-otp' -import { cn } from '../utils/cn' - const InputOTP = forwardRef, ComponentPropsWithoutRef>( ({ className, containerClassName, ...props }, ref) => ( (({ index, cla {char} {hasFakeCaret && (
-
+
)}
diff --git a/packages/ui/src/components/input.tsx b/packages/ui/src/components/input.tsx index d806bdeda..7497df11c 100644 --- a/packages/ui/src/components/input.tsx +++ b/packages/ui/src/components/input.tsx @@ -1,8 +1,8 @@ import { forwardRef, InputHTMLAttributes, ReactNode } from 'react' +import { cn } from '@utils/cn' import { cva, type VariantProps } from 'class-variance-authority' -import { cn } from '../utils/cn' import { ControlGroup } from './control-group' import { ErrorMessageTheme, FormErrorMessage } from './form-error-message' import { Label } from './label' diff --git a/packages/ui/src/components/pagination.tsx b/packages/ui/src/components/pagination.tsx index 8858d0e07..b5f528d92 100644 --- a/packages/ui/src/components/pagination.tsx +++ b/packages/ui/src/components/pagination.tsx @@ -1,6 +1,7 @@ import * as React from 'react' -import { cn } from '../utils/cn' +import { cn } from '@utils/cn' + import { buttonVariants, type ButtonProps } from './button' import { Icon } from './icon' diff --git a/packages/ui/src/components/spacer.tsx b/packages/ui/src/components/spacer.tsx index 8554be6cd..088732bc9 100644 --- a/packages/ui/src/components/spacer.tsx +++ b/packages/ui/src/components/spacer.tsx @@ -1,9 +1,8 @@ import * as React from 'react' +import { cn } from '@utils/cn' import { cva, type VariantProps } from 'class-variance-authority' -import { cn } from '../utils/cn' - const spacerVariants = cva('mt-4 block', { variants: { size: { diff --git a/packages/ui/src/views/auth/otp-page.tsx b/packages/ui/src/views/auth/otp-page.tsx index 838f3053e..b80fa6479 100644 --- a/packages/ui/src/views/auth/otp-page.tsx +++ b/packages/ui/src/views/auth/otp-page.tsx @@ -28,6 +28,7 @@ interface OTPPageProps { isLoading?: boolean handleFormSubmit?: (data: OtpPageData) => void error?: string + email?: string } export interface OtpPageData { @@ -42,10 +43,15 @@ const otpPasswordSchema = z.object({ .regex(/^\d+$/, { message: 'Code must contain only numbers' }) }) -export function OTPPage({ handleResend, isLoading, handleFormSubmit, error }: OTPPageProps) { +// TODO: remove default email when we have a way to get it from the url or context +export function OTPPage({ + handleResend, + isLoading, + handleFormSubmit, + error, + email = 'stevenm@gmail.com' +}: OTPPageProps) { const [serverError, setServerError] = useState(null) - // TODO: get email from url or from context - const email = 'stevenm@gmail.com' const { handleSubmit, @@ -121,7 +127,6 @@ export function OTPPage({ handleResend, isLoading, handleFormSubmit, error }: OT {(errors.otp || serverError) && ( {serverError && ( <> - + {serverError} diff --git a/packages/ui/src/views/layouts/Floating1ColumnLayout.tsx b/packages/ui/src/views/layouts/Floating1ColumnLayout.tsx index ed8779d8f..3d1f574dc 100644 --- a/packages/ui/src/views/layouts/Floating1ColumnLayout.tsx +++ b/packages/ui/src/views/layouts/Floating1ColumnLayout.tsx @@ -1,4 +1,4 @@ -import { cn } from '../../utils/cn' +import { cn } from '@utils/cn' type HighlightTheme = 'blue' | 'green' | 'error'