Skip to content

Commit f9a59b9

Browse files
committed
fix: fixes and refactoring after review
fix: linter fixes fix: fix imports and small refactoring
1 parent 4510de0 commit f9a59b9

File tree

21 files changed

+289
-586
lines changed

21 files changed

+289
-586
lines changed

packages/canary/src/components/toast.tsx

Lines changed: 0 additions & 111 deletions
This file was deleted.

packages/canary/src/components/toaster.tsx

Lines changed: 0 additions & 24 deletions
This file was deleted.

packages/canary/src/components/use-toast.ts

Lines changed: 0 additions & 158 deletions
This file was deleted.

packages/canary/src/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,9 @@ export * from './components/switch'
4040
export * from './components/table'
4141
export * from './components/tabs'
4242
export * from './components/text'
43-
export * from './components/toast'
44-
// export * from './components/toaster' Duplicate with sooner! Use sooner's Toaster instead
4543
export * from './components/toggle-group'
4644
export * from './components/toggle'
4745
export * from './components/tooltip'
48-
export * from './components/use-toast'
4946
export * from './lib/utils'
5047
export * from './lib/CanaryOutletFactory'
5148
export * from './components/treeview'

packages/ui/src/components/button-group.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import * as React from 'react'
1+
import { ReactNode } from 'react'
22

33
import { cn } from '@utils/cn'
44

55
interface ButtonGroupProps {
6-
children: React.ReactNode
6+
children: ReactNode
77
direction?: 'horizontal' | 'vertical'
88
className?: string
99
spacing?: string

packages/ui/src/components/button.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as React from 'react'
1+
import { ButtonHTMLAttributes, forwardRef, ReactNode } from 'react'
22

33
import { Slot } from '@radix-ui/react-slot'
44
import { CanaryOutletFactory, CanaryOutletName } from '@utils/CanaryOutletFactory'
@@ -14,7 +14,7 @@ const buttonVariants = cva(
1414
'bg-background-5 text-foreground-6 hover:bg-background-10 disabled:bg-background-6 disabled:text-foreground-9',
1515
destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/90 shadow-sm',
1616
outline:
17-
'border-borders-2 hover:border-borders-6 text-foreground-2 hover:text-foreground-8 border bg-transparent',
17+
'border-borders-2 text-foreground-2 hover:border-borders-6 hover:text-foreground-8 border bg-transparent',
1818
secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80 shadow-sm',
1919
tertiary: 'bg-tertiary text-secondary-foreground hover:bg-tertiary/80 shadow-sm',
2020
ghost: 'hover:bg-background-12 hover:text-accent-foreground',
@@ -65,17 +65,15 @@ const buttonVariants = cva(
6565
}
6666
)
6767

68-
export interface ButtonProps
69-
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
70-
VariantProps<typeof buttonVariants> {
68+
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
7169
asChild?: boolean
7270
loading?: boolean
73-
spinner?: React.ReactNode
74-
dropdown?: React.ReactNode
71+
spinner?: ReactNode
72+
dropdown?: ReactNode
7573
gradientType?: string
7674
}
7775

78-
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
76+
const Button = forwardRef<HTMLButtonElement, ButtonProps>(
7977
(
8078
{
8179
className,

packages/ui/src/components/checkbox.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
import * as React from 'react'
1+
import { ComponentPropsWithoutRef, ElementRef, forwardRef } from 'react'
22

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

66
import { Icon } from './icon'
77
import { Label } from './label'
88

9-
interface CheckboxProps extends React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> {
9+
interface CheckboxProps extends ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> {
1010
label?: string
1111
}
1212

13-
const Checkbox = React.forwardRef<React.ElementRef<typeof CheckboxPrimitive.Root>, CheckboxProps>(
13+
const Checkbox = forwardRef<ElementRef<typeof CheckboxPrimitive.Root>, CheckboxProps>(
1414
({ className, label, ...props }, ref) => (
1515
<div className={cn('flex gap-x-2.5', className)}>
1616
<CheckboxPrimitive.Root
1717
ref={ref}
18-
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"
18+
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"
1919
{...props}
2020
>
2121
<CheckboxPrimitive.Indicator className={cn('flex items-center justify-center text-current')}>
2222
<Icon className="h-1.5 w-2" name="checkbox" width={8} height={6} />
2323
</CheckboxPrimitive.Indicator>
2424
</CheckboxPrimitive.Root>
2525
{label && (
26-
<Label className="text-foreground-1 font-normal leading-tight tracking-tight" htmlFor={props.id}>
26+
<Label className="leading-tight" theme="foreground-1" htmlFor={props.id}>
2727
{label}
2828
</Label>
2929
)}

0 commit comments

Comments
 (0)