From c24a619747129e507b121487e44a8bb4ea6ef863 Mon Sep 17 00:00:00 2001 From: Cedric van Putten Date: Fri, 1 Nov 2024 12:38:29 +0100 Subject: [PATCH] refactor(ui): use `tailwind-merge` to merge classnames for tailwind --- .../expo-atlas-ui/components/BundleTag.tsx | 2 +- .../components/ModuleReference.tsx | 6 +++--- .../expo-atlas-ui/components/PlatformName.tsx | 3 ++- .../components/PropertySummary.tsx | 5 +++-- packages/expo-atlas-ui/package.json | 1 + packages/expo-atlas-ui/ui/Breadcrumb.tsx | 15 ++++++------- packages/expo-atlas-ui/ui/Button.tsx | 13 ++++++------ packages/expo-atlas-ui/ui/Checkbox.tsx | 7 ++++--- packages/expo-atlas-ui/ui/Code.tsx | 6 +++--- packages/expo-atlas-ui/ui/Input.tsx | 5 +++-- packages/expo-atlas-ui/ui/Label.tsx | 3 ++- packages/expo-atlas-ui/ui/Layout.tsx | 13 ++++++------ packages/expo-atlas-ui/ui/Menu.tsx | 21 ++++++++++--------- packages/expo-atlas-ui/ui/Panel.tsx | 5 +++-- packages/expo-atlas-ui/ui/Select.tsx | 19 +++++++++-------- packages/expo-atlas-ui/ui/Sheet.tsx | 13 ++++++------ packages/expo-atlas-ui/ui/Skeleton.tsx | 4 ++-- packages/expo-atlas-ui/ui/Spinner.tsx | 5 +++-- packages/expo-atlas-ui/ui/Tag.tsx | 3 ++- packages/expo-atlas-ui/ui/Toast.tsx | 11 +++++----- packages/expo-atlas-ui/ui/Tooltip.tsx | 5 +++-- packages/expo-atlas-ui/utils/classname.ts | 9 ++++++++ 22 files changed, 100 insertions(+), 74 deletions(-) create mode 100644 packages/expo-atlas-ui/utils/classname.ts 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) => ( -
  1. +
  2. ) ); 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) => ( -
  3. ); @@ -85,7 +86,7 @@ export const BreadcrumbEllipsis = ({ className, ...props }: ComponentProps<'span