diff --git a/packages/expo-atlas-ui/components/BundleTag.tsx b/packages/expo-atlas-ui/components/BundleTag.tsx
index 8ca1626..3774864 100644
--- a/packages/expo-atlas-ui/components/BundleTag.tsx
+++ b/packages/expo-atlas-ui/components/BundleTag.tsx
@@ -1,4 +1,3 @@
-import { cva, type VariantProps } from 'class-variance-authority';
import type { AtlasBundle } from 'expo-atlas';
import { type ComponentProps } from 'react';
@@ -7,6 +6,7 @@ import { EnvironmentName } from '~/components/EnvironmentName';
import { PlatformName } from '~/components/PlatformName';
import { Tag } from '~/ui/Tag';
import { Tooltip, TooltipContent, TooltipTrigger } from '~/ui/Tooltip';
+import { cva, type VariantProps } from '~/utils/classname';
const bundleTagVariants = cva('', {
variants: {
diff --git a/packages/expo-atlas-ui/components/ModuleReference.tsx b/packages/expo-atlas-ui/components/ModuleReference.tsx
index 1f6d7e5..999cc99 100644
--- a/packages/expo-atlas-ui/components/ModuleReference.tsx
+++ b/packages/expo-atlas-ui/components/ModuleReference.tsx
@@ -1,4 +1,3 @@
-import { cva, cx } from 'class-variance-authority';
import type { AtlasModule, PartialAtlasBundle } from 'expo-atlas';
// @ts-expect-error
import ChevronDownIcon from 'lucide-react/dist/esm/icons/chevron-down';
@@ -7,6 +6,7 @@ import { type ComponentProps, useState, useRef, useLayoutEffect } from 'react';
import { ModuleReferenceList } from './ModuleReferenceList';
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '~/ui/Collapsible';
+import { cva, cn } from '~/utils/classname';
type ModuleReferenceProps = {
bundle: PartialAtlasBundle;
@@ -16,7 +16,7 @@ type ModuleReferenceProps = {
export function ModuleReference(props: ModuleReferenceProps) {
return (
-
+
{props.title}
& {
@@ -25,7 +26,7 @@ export const BreadcrumbList = forwardRef (
>(
({ className, ...props }, ref) => (
-
+
)
);
BreadcrumbItem.displayName = 'BreadcrumbItem';
@@ -53,7 +54,7 @@ export const BreadcrumbLink = forwardRef<
return (
);
@@ -67,7 +68,7 @@ export const BreadcrumbPage = forwardRef
)
@@ -75,7 +76,7 @@ export const BreadcrumbPage = forwardRef) => (
- - svg]:size-4', className)} {...props}>
+
- svg]:size-4', className)} {...props}>
{children ?? }
);
@@ -85,7 +86,7 @@ export const BreadcrumbEllipsis = ({ className, ...props }: ComponentProps<'span
diff --git a/packages/expo-atlas-ui/ui/Button.tsx b/packages/expo-atlas-ui/ui/Button.tsx
index 0307edb..db83070 100644
--- a/packages/expo-atlas-ui/ui/Button.tsx
+++ b/packages/expo-atlas-ui/ui/Button.tsx
@@ -1,44 +1,45 @@
// see: https://ui.shadcn.com/docs/components/button
import { Slot } from '@radix-ui/react-slot';
-import { cva, cx, type VariantProps } from 'class-variance-authority';
import { type ButtonHTMLAttributes, forwardRef } from 'react';
+import { cva, cn, type VariantProps } from '~/utils/classname';
+
const buttonVariants = cva(
'inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors outline-none disabled:pointer-events-none disabled:opacity-50',
{
variants: {
variant: {
// see: https://github.com/expo/styleguide/blob/251c92ac4558794903b83575fb97b4f03d00b1f8/packages/styleguide/src/components/Button/Button.tsx#L44
- primary: cx(
+ primary: cn(
'border-button-primary bg-button-primary text-button-primary shadow-xs',
'hocus:bg-button-primary-hover active:scale-98',
disabled(
'bg-button-primary-disabled border-button-primary-disabled text-button-primary-disabled'
)
),
- secondary: cx(
+ secondary: cn(
'border-button-secondary bg-button-secondary text-button-secondary shadow-xs',
'hocus:bg-button-secondary-hover active:scale-98',
disabled(
'bg-button-secondary-disabled border-button-secondary-disabled text-button-secondary-disabled'
)
),
- tertiary: cx(
+ tertiary: cn(
'border-button-tertiary bg-button-tertiary text-button-tertiary shadow-none',
'hocus:bg-button-tertiary-hover active:scale-98',
disabled(
'bg-button-tertiary-disabled border-button-tertiary-disabled text-button-tertiary-disabled'
)
),
- quaternary: cx(
+ quaternary: cn(
'border-button-quaternary bg-button-quaternary text-button-quaternary shadow-none',
'hocus:bg-button-quaternary-hover active:scale-98',
disabled(
'bg-button-quaternary-disabled border-button-quaternary-disabled text-button-quaternary-disabled'
)
),
- destructive: cx(
+ destructive: cn(
'border-button-primary-destructive bg-button-primary-destructive text-button-primary-destructive shadow-xs',
'hocus:bg-button-primary-destructive-hover active:scale-98',
disabled(
diff --git a/packages/expo-atlas-ui/ui/Checkbox.tsx b/packages/expo-atlas-ui/ui/Checkbox.tsx
index 2a2398d..209a11a 100644
--- a/packages/expo-atlas-ui/ui/Checkbox.tsx
+++ b/packages/expo-atlas-ui/ui/Checkbox.tsx
@@ -1,24 +1,25 @@
// see: https://ui.shadcn.com/docs/components/checkbox
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
-import { cx } from 'class-variance-authority';
// @ts-expect-error
import CheckIcon from 'lucide-react/dist/esm/icons/check';
import { type ComponentPropsWithoutRef, type ElementRef, forwardRef } from 'react';
+import { cn } from '~/utils/classname';
+
export const Checkbox = forwardRef<
ElementRef,
ComponentPropsWithoutRef
>(({ className, ...props }, ref) => (
-
+
diff --git a/packages/expo-atlas-ui/ui/Code.tsx b/packages/expo-atlas-ui/ui/Code.tsx
index bff5bac..0811608 100644
--- a/packages/expo-atlas-ui/ui/Code.tsx
+++ b/packages/expo-atlas-ui/ui/Code.tsx
@@ -1,7 +1,7 @@
-import { cx } from 'class-variance-authority';
import { type ComponentProps, type PropsWithChildren } from 'react';
-import { Button } from './Button';
+import { Button } from '~/ui/Button';
+import { cn } from '~/utils/classname';
export function CodeHeader(props: PropsWithChildren) {
return (
@@ -19,7 +19,7 @@ export function CodeAction({ className, ...props }: ComponentProps
);
diff --git a/packages/expo-atlas-ui/ui/Input.tsx b/packages/expo-atlas-ui/ui/Input.tsx
index 0ec973b..ae36dca 100644
--- a/packages/expo-atlas-ui/ui/Input.tsx
+++ b/packages/expo-atlas-ui/ui/Input.tsx
@@ -1,8 +1,9 @@
-import { cx } from 'class-variance-authority';
import { HTMLProps } from 'react';
+import { cn } from '~/utils/classname';
+
export function Input(props: HTMLProps) {
- const classes = cx(
+ const classes = cn(
'text-[16px] leading-[1.625] tracking-[-0.011rem]',
'relative w-full rounded-md border border-default bg-default p-3 text-default shadow-xs outline-0 transition-colors',
'focus:border-palette-blue9',
diff --git a/packages/expo-atlas-ui/ui/Label.tsx b/packages/expo-atlas-ui/ui/Label.tsx
index 1f8caf0..5428a2e 100644
--- a/packages/expo-atlas-ui/ui/Label.tsx
+++ b/packages/expo-atlas-ui/ui/Label.tsx
@@ -1,9 +1,10 @@
// see: https://ui.shadcn.com/docs/components/label
import * as LabelPrimitive from '@radix-ui/react-label';
-import { cva, type VariantProps } from 'class-variance-authority';
import { forwardRef, type ComponentPropsWithoutRef, type ElementRef } from 'react';
+import { cva, type VariantProps } from '~/utils/classname';
+
const labelVariants = cva(
'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70'
);
diff --git a/packages/expo-atlas-ui/ui/Layout.tsx b/packages/expo-atlas-ui/ui/Layout.tsx
index 4a3b8b9..62cf1b5 100644
--- a/packages/expo-atlas-ui/ui/Layout.tsx
+++ b/packages/expo-atlas-ui/ui/Layout.tsx
@@ -1,7 +1,8 @@
-import { cva, cx, type VariantProps } from 'class-variance-authority';
import { Link } from 'expo-router';
import { type HTMLAttributes, type PropsWithChildren } from 'react';
+import { cva, cn, type VariantProps } from '~/utils/classname';
+
const layoutVariants = cva('', {
variants: {
variant: {
@@ -29,7 +30,7 @@ export function Layout({
export function LayoutHeader(props: PropsWithChildren<{ className?: string }>) {
return (
-
+
{props.children}
);
@@ -37,7 +38,7 @@ export function LayoutHeader(props: PropsWithChildren<{ className?: string }>) {
export function LayoutTitle(props: PropsWithChildren<{ className?: string }>) {
return (
-
+
{props.children}
);
@@ -49,7 +50,7 @@ export function LayoutNavigation({
}: PropsWithChildren & { className?: string }) {
return (
) {
viewBox="0 0 71 20"
fill="none"
role="img"
- className={cx('icon-md text-default', className)}
+ className={cn('icon-md text-default', className)}
{...props}
>
) {
viewBox="0 0 20 20"
fill="none"
role="img"
- className={cx('icon-md text-default', className)}
+ className={cn('icon-md text-default', className)}
{...props}
>
(({ className, inset, children, ...props }, ref) => (
(({ className, ...props }, ref) => (
(({ className, inset, ...props }, ref) => (
(({ className, children, checked, ...props }, ref) => (
(({ className, children, ...props }, ref) => (
(({ className, inset, ...props }, ref) => (
));
@@ -166,7 +167,7 @@ export const ContextMenuSeparator = forwardRef<
>(({ className, ...props }, ref) => (
));
@@ -175,7 +176,7 @@ ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;
export const ContextMenuShortcut = ({ className, ...props }: HTMLAttributes) => {
return (
);
diff --git a/packages/expo-atlas-ui/ui/Panel.tsx b/packages/expo-atlas-ui/ui/Panel.tsx
index 9ae5b93..bcc1639 100644
--- a/packages/expo-atlas-ui/ui/Panel.tsx
+++ b/packages/expo-atlas-ui/ui/Panel.tsx
@@ -1,6 +1,7 @@
-import { cx } from 'class-variance-authority';
import { type PropsWithChildren } from 'react';
+import { cn } from '~/utils/classname';
+
export function PanelGroup(props: PropsWithChildren) {
return (
@@ -12,7 +13,7 @@ export function PanelGroup(props: PropsWithChildren) {
export function Panel(props: PropsWithChildren) {
return (
(({ className, children, ...props }, ref) => (
(({ className, ...props }, ref) => (
@@ -59,7 +60,7 @@ export const SelectScrollDownButton = forwardRef<
>(({ className, ...props }, ref) => (
@@ -74,7 +75,7 @@ export const SelectContent = forwardRef<
(({ className, ...props }, ref) => (
(({ className, children, ...props }, ref) => (
(({ className, ...props }, ref) => (
));
diff --git a/packages/expo-atlas-ui/ui/Sheet.tsx b/packages/expo-atlas-ui/ui/Sheet.tsx
index ce941c4..0c29f89 100644
--- a/packages/expo-atlas-ui/ui/Sheet.tsx
+++ b/packages/expo-atlas-ui/ui/Sheet.tsx
@@ -1,11 +1,12 @@
// see: https://ui.shadcn.com/docs/components/sheet
import * as DialogPrimitive from '@radix-ui/react-dialog';
-import { cva, cx, type VariantProps } from 'class-variance-authority';
// @ts-expect-error
import CloseIcon from 'lucide-react/dist/esm/icons/x';
import { forwardRef, type ComponentPropsWithoutRef } from 'react';
+import { cva, cn, type VariantProps } from '~/utils/classname';
+
export const Sheet = DialogPrimitive.Root;
export const SheetTrigger = DialogPrimitive.Trigger;
@@ -21,7 +22,7 @@ export const SheetOverlay = () => null;
// React.ComponentPropsWithoutRef
// >(({ className, ...props }, ref) => (
// ) => (
-
+
);
SheetHeader.displayName = 'SheetHeader';
export const SheetFooter = ({ className, ...props }: React.HTMLAttributes) => (
);
@@ -92,7 +93,7 @@ export const SheetTitle = forwardRef<
>(({ className, ...props }, ref) => (
));
@@ -104,7 +105,7 @@ export const SheetDescription = forwardRef<
>(({ className, ...props }, ref) => (
));
diff --git a/packages/expo-atlas-ui/ui/Skeleton.tsx b/packages/expo-atlas-ui/ui/Skeleton.tsx
index b5f6ed9..88a5717 100644
--- a/packages/expo-atlas-ui/ui/Skeleton.tsx
+++ b/packages/expo-atlas-ui/ui/Skeleton.tsx
@@ -1,7 +1,7 @@
// see: https://ui.shadcn.com/docs/components/skeleton
-import { cx } from 'class-variance-authority';
+import { cn } from '~/utils/classname';
export function Skeleton({ className, ...props }: React.HTMLAttributes) {
- return ;
+ return ;
}
diff --git a/packages/expo-atlas-ui/ui/Spinner.tsx b/packages/expo-atlas-ui/ui/Spinner.tsx
index 4a56b74..5f31825 100644
--- a/packages/expo-atlas-ui/ui/Spinner.tsx
+++ b/packages/expo-atlas-ui/ui/Spinner.tsx
@@ -1,8 +1,9 @@
-import { cx } from 'class-variance-authority';
// @ts-expect-error
import LoaderIcon from 'lucide-react/dist/esm/icons/loader-2';
import { type ComponentProps } from 'react';
+import { cn } from '~/utils/classname';
+
export function Spinner({ className, ...props }: ComponentProps) {
- return ;
+ return ;
}
diff --git a/packages/expo-atlas-ui/ui/Tag.tsx b/packages/expo-atlas-ui/ui/Tag.tsx
index 5f866ed..c21eb19 100644
--- a/packages/expo-atlas-ui/ui/Tag.tsx
+++ b/packages/expo-atlas-ui/ui/Tag.tsx
@@ -1,6 +1,7 @@
-import { cva, type VariantProps } from 'class-variance-authority';
import { type ComponentProps, forwardRef } from 'react';
+import { cva, type VariantProps } from '~/utils/classname';
+
const tagVariants = cva(
'inline-flex items-center justify-center whitespace-nowrap rounded-full font-semibold',
{
diff --git a/packages/expo-atlas-ui/ui/Toast.tsx b/packages/expo-atlas-ui/ui/Toast.tsx
index 668998b..cb056fd 100644
--- a/packages/expo-atlas-ui/ui/Toast.tsx
+++ b/packages/expo-atlas-ui/ui/Toast.tsx
@@ -1,7 +1,6 @@
// see: https://ui.shadcn.com/docs/components/toast
import * as ToastPrimitives from '@radix-ui/react-toast';
-import { cva, cx, type VariantProps } from 'class-variance-authority';
// @ts-expect-error
import CloseIcon from 'lucide-react/dist/esm/icons/x';
import {
@@ -13,13 +12,15 @@ import {
useEffect,
} from 'react';
+import { cva, cn, type VariantProps } from '~/utils/classname';
+
export const ToastViewport = forwardRef<
ElementRef,
ComponentPropsWithoutRef
>(({ className, ...props }, ref) => (
(({ className, ...props }, ref) => (
,
ComponentPropsWithoutRef
>(({ className, ...props }, ref) => (
-
+
));
ToastTitle.displayName = ToastPrimitives.Title.displayName;
@@ -90,7 +91,7 @@ export const ToastDescription = forwardRef<
>(({ className, ...props }, ref) => (
));
diff --git a/packages/expo-atlas-ui/ui/Tooltip.tsx b/packages/expo-atlas-ui/ui/Tooltip.tsx
index 6d19877..26cb620 100644
--- a/packages/expo-atlas-ui/ui/Tooltip.tsx
+++ b/packages/expo-atlas-ui/ui/Tooltip.tsx
@@ -1,9 +1,10 @@
// see: https://ui.shadcn.com/docs/components/tooltip
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
-import { cx } from 'class-variance-authority';
import { type ComponentPropsWithoutRef, type ElementRef, forwardRef } from 'react';
+import { cn } from '~/utils/classname';
+
export const TooltipProvider = TooltipPrimitive.Provider;
export const Tooltip = TooltipPrimitive.Root;
@@ -17,7 +18,7 @@ export const TooltipContent = forwardRef<