Skip to content

Commit

Permalink
fix: fixes and refactoring after review
Browse files Browse the repository at this point in the history
fix: linter fixes

fix: fix imports and small refactoring
  • Loading branch information
iatopilskii committed Dec 2, 2024
1 parent 4510de0 commit f9a59b9
Show file tree
Hide file tree
Showing 21 changed files with 289 additions and 586 deletions.
111 changes: 0 additions & 111 deletions packages/canary/src/components/toast.tsx

This file was deleted.

24 changes: 0 additions & 24 deletions packages/canary/src/components/toaster.tsx

This file was deleted.

158 changes: 0 additions & 158 deletions packages/canary/src/components/use-toast.ts

This file was deleted.

3 changes: 0 additions & 3 deletions packages/canary/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,9 @@ export * from './components/switch'
export * from './components/table'
export * from './components/tabs'
export * from './components/text'
export * from './components/toast'
// export * from './components/toaster' Duplicate with sooner! Use sooner's Toaster instead
export * from './components/toggle-group'
export * from './components/toggle'
export * from './components/tooltip'
export * from './components/use-toast'
export * from './lib/utils'
export * from './lib/CanaryOutletFactory'
export * from './components/treeview'
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/src/components/button-group.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as React from 'react'
import { ReactNode } from 'react'

import { cn } from '@utils/cn'

interface ButtonGroupProps {
children: React.ReactNode
children: ReactNode
direction?: 'horizontal' | 'vertical'
className?: string
spacing?: string
Expand Down
14 changes: 6 additions & 8 deletions packages/ui/src/components/button.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react'
import { ButtonHTMLAttributes, forwardRef, ReactNode } from 'react'

import { Slot } from '@radix-ui/react-slot'
import { CanaryOutletFactory, CanaryOutletName } from '@utils/CanaryOutletFactory'
Expand All @@ -14,7 +14,7 @@ const buttonVariants = cva(
'bg-background-5 text-foreground-6 hover:bg-background-10 disabled:bg-background-6 disabled:text-foreground-9',
destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/90 shadow-sm',
outline:
'border-borders-2 hover:border-borders-6 text-foreground-2 hover:text-foreground-8 border bg-transparent',
'border-borders-2 text-foreground-2 hover:border-borders-6 hover:text-foreground-8 border bg-transparent',
secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80 shadow-sm',
tertiary: 'bg-tertiary text-secondary-foreground hover:bg-tertiary/80 shadow-sm',
ghost: 'hover:bg-background-12 hover:text-accent-foreground',
Expand Down Expand Up @@ -65,17 +65,15 @@ const buttonVariants = cva(
}
)

export interface ButtonProps
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
VariantProps<typeof buttonVariants> {
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
asChild?: boolean
loading?: boolean
spinner?: React.ReactNode
dropdown?: React.ReactNode
spinner?: ReactNode
dropdown?: ReactNode
gradientType?: string
}

const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
const Button = forwardRef<HTMLButtonElement, ButtonProps>(
(
{
className,
Expand Down
10 changes: 5 additions & 5 deletions packages/ui/src/components/checkbox.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
import * as React from 'react'
import { ComponentPropsWithoutRef, ElementRef, forwardRef } from 'react'

import * as CheckboxPrimitive from '@radix-ui/react-checkbox'
import { cn } from '@utils/cn'

import { Icon } from './icon'
import { Label } from './label'

interface CheckboxProps extends React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> {
interface CheckboxProps extends ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> {
label?: string
}

const Checkbox = React.forwardRef<React.ElementRef<typeof CheckboxPrimitive.Root>, CheckboxProps>(
const Checkbox = forwardRef<ElementRef<typeof CheckboxPrimitive.Root>, CheckboxProps>(
({ className, label, ...props }, ref) => (
<div className={cn('flex gap-x-2.5', className)}>
<CheckboxPrimitive.Root
ref={ref}
className="border-icons-1 data-[state=checked]:bg-primary data-[state=checked]:border-icons-2 data-[state=checked]:text-primary-foreground hover:border-icons-3 disabled:border-icons-4 peer size-4 shrink-0 rounded-sm border shadow disabled:cursor-not-allowed"
className="border-icons-1 hover:border-icons-3 disabled:border-icons-4 data-[state=checked]:border-icons-2 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground peer size-4 shrink-0 rounded-sm border shadow disabled:cursor-not-allowed"
{...props}
>
<CheckboxPrimitive.Indicator className={cn('flex items-center justify-center text-current')}>
<Icon className="h-1.5 w-2" name="checkbox" width={8} height={6} />
</CheckboxPrimitive.Indicator>
</CheckboxPrimitive.Root>
{label && (
<Label className="text-foreground-1 font-normal leading-tight tracking-tight" htmlFor={props.id}>
<Label className="leading-tight" theme="foreground-1" htmlFor={props.id}>
{label}
</Label>
)}
Expand Down
Loading

0 comments on commit f9a59b9

Please sign in to comment.