Skip to content

Commit

Permalink
fix: linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
iatopilskii committed Dec 2, 2024
1 parent 4510de0 commit af982cd
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 21 deletions.
8 changes: 4 additions & 4 deletions packages/ui/src/components/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ const buttonVariants = cva(
variant: {
default:
'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',
destructive: 'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90',
outline:
'border-borders-2 hover:border-borders-6 text-foreground-2 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',
'border border-borders-2 bg-transparent text-foreground-2 hover:border-borders-6 hover:text-foreground-8',
secondary: 'bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80',
tertiary: 'bg-tertiary text-secondary-foreground shadow-sm hover:bg-tertiary/80',
ghost: 'hover:bg-background-12 hover:text-accent-foreground',
link: 'text-primary underline-offset-4 hover:underline',
link_accent: 'text-foreground-accent underline-offset-4 hover:underline',
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/src/components/checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ const Checkbox = React.forwardRef<React.ElementRef<typeof CheckboxPrimitive.Root
<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="peer size-4 shrink-0 rounded-sm border border-icons-1 shadow hover:border-icons-3 disabled:cursor-not-allowed disabled:border-icons-4 data-[state=checked]:border-icons-2 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground"
{...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="font-normal leading-tight tracking-tight text-foreground-1" htmlFor={props.id}>
{label}
</Label>
)}
Expand Down
2 changes: 0 additions & 2 deletions packages/ui/src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ export * from './no-data'
export * from './tabs'
export * from './command'
export * from './search-files'
export * from './input'
export * from './radio-group'
export * from './textarea'
export * from './checkbox'
export * from './toast'
export * from './styled-link'
Expand Down
8 changes: 4 additions & 4 deletions packages/ui/src/components/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ export interface BaseInputProps
size?: 'sm' | 'md'
}

const inputVariants = cva('text-foreground-1 bg-transparent px-2.5 py-1 disabled:cursor-not-allowed', {
const inputVariants = cva('bg-transparent px-2.5 py-1 text-foreground-1 disabled:cursor-not-allowed', {
variants: {
variant: {
default:
'placeholder:text-foreground-4 flex w-full rounded border text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:rounded focus-visible:outline-none',
'flex w-full rounded border text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-foreground-4 focus-visible:rounded focus-visible:outline-none',
extended: 'grow border-none focus-visible:outline-none'
},
size: {
Expand All @@ -26,7 +26,7 @@ const inputVariants = cva('text-foreground-1 bg-transparent px-2.5 py-1 disabled
},
theme: {
default:
'border-borders-2 focus-visible:border-borders-3 disabled:placeholder:text-foreground-9 disabled:border-borders-1',
'border-borders-2 focus-visible:border-borders-3 disabled:border-borders-1 disabled:placeholder:text-foreground-9',
danger: 'border-borders-danger'
}
},
Expand Down Expand Up @@ -71,7 +71,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
</FormErrorMessage>
)}
{caption && (
<Text className="text-foreground-4 mt-1 leading-snug" size={2}>
<Text className="mt-1 leading-snug text-foreground-4" size={2}>
{caption}
</Text>
)}
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/label.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ interface LabelProps extends VariantProps<typeof labelVariants>, React.PropsWith
const Label = ({ htmlFor, optional, theme, variant, children, className }: LabelProps) => {
return (
<LabelRoot htmlFor={htmlFor} variant={variant} theme={theme} className={className}>
{children} {optional && <span className="text-foreground-7 align-top">(optional)</span>}
{children} {optional && <span className="align-top text-foreground-7">(optional)</span>}
</LabelRoot>
)
}
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/radio-group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const RadioButton = React.forwardRef<
)}
{...props}
>
<RadioGroupPrimitive.Indicator className="bg-icons-2 size-2 rounded-full" />
<RadioGroupPrimitive.Indicator className="size-2 rounded-full bg-icons-2" />
</RadioGroupPrimitive.Item>
)
})
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const Select: React.FC<SelectProps> = ({
</FormErrorMessage>
)}
{caption && (
<Text className="text-foreground-4 mt-1 leading-snug" size={2}>
<Text className="mt-1 leading-snug text-foreground-4" size={2}>
{caption}
</Text>
)}
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/textarea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
</FormErrorMessage>
)}
{caption && (
<Text className="text-foreground-4 mt-1 leading-snug" size={2}>
<Text className="mt-1 leading-snug text-foreground-4" size={2}>
{caption}
</Text>
)}
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/src/components/toast/toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ const toastVariants = cva(
{
variants: {
variant: {
default: 'bg-background-3 border-borders-1 text-foreground [&_svg]:text-icons-1',
destructive: 'bg-foreground-danger text-foreground-1 [&_svg]:text-icons-2 border-borders-danger'
default: 'border-borders-1 bg-background-3 text-foreground [&_svg]:text-icons-1',
destructive: 'border-borders-danger bg-foreground-danger text-foreground-1 [&_svg]:text-icons-2'
}
},
defaultVariants: {
Expand Down
6 changes: 3 additions & 3 deletions packages/ui/src/views/repo/repo-create/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export function RepoCreatePage({
Create a new repository
</Text>
<Spacer size={2.5} />
<Text className="text-foreground-2 max-w-[476px]" size={2} as="p">
<Text className="max-w-[476px] text-foreground-2" size={2} as="p">
A repository contains all project files, including the revision history. Already have a project repository
elsewhere?{' '}
<StyledLink to="../import" relative="path">
Expand Down Expand Up @@ -219,7 +219,7 @@ export function RepoCreatePage({
{/* ACCESS */}
<Fieldset>
<ControlGroup>
<Text className="text-foreground-2 leading-none" size={2}>
<Text className="leading-none text-foreground-2" size={2}>
Who has access
</Text>
<RadioGroup className="mt-6" value={accessValue} onValueChange={handleAccessChange} id="access">
Expand Down Expand Up @@ -250,7 +250,7 @@ export function RepoCreatePage({
{/* README */}
<Fieldset>
<ControlGroup>
<Text className="text-foreground-2 leading-none" size={2}>
<Text className="leading-none text-foreground-2" size={2}>
Initialize this repository with
</Text>
<RadioGroupItem
Expand Down

0 comments on commit af982cd

Please sign in to comment.