fix: Правки внешнего вида кода линтером
This commit is contained in:
@@ -1,18 +1,26 @@
|
||||
.button {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: none;
|
||||
background: transparent;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
align-items: center;
|
||||
|
||||
padding: 0;
|
||||
outline: none;
|
||||
|
||||
font-family: var(--font-family-main);
|
||||
|
||||
border: none;
|
||||
|
||||
background: transparent;
|
||||
|
||||
outline: none;
|
||||
|
||||
cursor: pointer;
|
||||
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:disabled {
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
// Variants
|
||||
@@ -22,33 +30,39 @@
|
||||
}
|
||||
|
||||
&.regular {
|
||||
border-radius: 1em;
|
||||
padding: 0.5em 1em;
|
||||
|
||||
border-radius: 1em;
|
||||
}
|
||||
|
||||
// Sizes
|
||||
&.small {
|
||||
height: 40px;
|
||||
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
&.medium {
|
||||
height: 50px;
|
||||
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
&.large {
|
||||
height: 60px;
|
||||
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
// Color Schemes
|
||||
&.primary {
|
||||
$color-primary: var(--color-primary);
|
||||
background-color: transparent;
|
||||
color: $color-primary;
|
||||
|
||||
border: 1px solid $color-primary;
|
||||
|
||||
background-color: transparent;
|
||||
|
||||
&:hover:not(:disabled) {
|
||||
background-color: var(--color-white);
|
||||
}
|
||||
@@ -56,22 +70,26 @@
|
||||
|
||||
&.secondary {
|
||||
$color-blue: var(--color-blue);
|
||||
background-color: var(--color-white);
|
||||
color: $color-blue;
|
||||
box-shadow: 0px 0px 15px rgb($color-blue / 10%);
|
||||
|
||||
background-color: var(--color-white);
|
||||
|
||||
box-shadow: 0 0 15px rgb($color-blue / 10%);
|
||||
}
|
||||
|
||||
// Icon handling
|
||||
.icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
svg {
|
||||
width: 40%;
|
||||
height: 40%;
|
||||
|
||||
object-fit: contain;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import type { Meta, StoryObj } from '@storybook/react'
|
||||
import { Button } from './Button'
|
||||
import ChevronLeftIcon from '@/shared/assets/chevron--left.svg'
|
||||
|
||||
import { Button } from './Button'
|
||||
|
||||
import type { Meta, StoryObj } from '@storybook/react'
|
||||
|
||||
const meta = {
|
||||
title: 'Shared/Button',
|
||||
component: Button,
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
import { ButtonHTMLAttributes, memo, PropsWithChildren } from 'react'
|
||||
import classNames from 'classnames'
|
||||
import { ButtonHTMLAttributes, memo, PropsWithChildren } from 'react'
|
||||
|
||||
import styles from './Button.module.scss'
|
||||
|
||||
export type ButtonVariant = 'round' | 'regular'
|
||||
export type ButtonSize = 'small' | 'medium' | 'large'
|
||||
export type ButtonColorScheme = 'primary' | 'secondary'
|
||||
|
||||
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, PropsWithChildren {
|
||||
export interface ButtonProps
|
||||
extends ButtonHTMLAttributes<HTMLButtonElement>,
|
||||
PropsWithChildren {
|
||||
/**
|
||||
* Вариант внешнего вида кнопки
|
||||
* @default 'round'
|
||||
@@ -47,7 +50,7 @@ export const Button = memo((props: ButtonProps) => {
|
||||
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
type='button'
|
||||
className={classNames(styles.button, mods, className)}
|
||||
disabled={disabled}
|
||||
{...otherProps}
|
||||
|
||||
@@ -1,2 +1,7 @@
|
||||
export { Button } from './Button'
|
||||
export type { ButtonProps, ButtonVariant, ButtonSize, ButtonColorScheme } from './Button'
|
||||
export type {
|
||||
ButtonProps,
|
||||
ButtonVariant,
|
||||
ButtonSize,
|
||||
ButtonColorScheme,
|
||||
} from './Button'
|
||||
|
||||
Reference in New Issue
Block a user