diff --git a/client/configs/storybook/preview.ts b/client/configs/storybook/preview.ts index 75b8a24..d0b942f 100644 --- a/client/configs/storybook/preview.ts +++ b/client/configs/storybook/preview.ts @@ -1,4 +1,4 @@ -import { withThemeByClassName } from '@storybook/addon-themes'; +import { withThemeByDataAttribute } from '@storybook/addon-themes'; import type { Preview } from '@storybook/react-vite'; import { setupWorker } from 'msw/browser'; @@ -28,12 +28,11 @@ const preview: Preview = { decorators: [ StyleDecorator, RouterDecorator, - withThemeByClassName({ - themes: { - twitter: 'theme-twt', - facebook: 'theme-fb', - }, - defaultTheme: 'twitter', + withThemeByDataAttribute({ + themes: { light: 'light', dark: 'dark' }, + defaultTheme: 'dark', + attributeName: 'data-theme', + parentSelector: 'body', }), ], }; diff --git a/client/src/app/providers/router/ui/MainLayout/Layout.module.scss b/client/src/app/providers/router/ui/MainLayout/Layout.module.scss index 729cbb2..f96a0b9 100644 --- a/client/src/app/providers/router/ui/MainLayout/Layout.module.scss +++ b/client/src/app/providers/router/ui/MainLayout/Layout.module.scss @@ -1,8 +1,8 @@ .layout { display: grid; - grid-template-columns: 280px auto; - gap: 20px; - margin: 20px; height: var(--layout-height); + margin: 20px; + gap: 20px; + grid-template-columns: 280px auto; } diff --git a/client/src/app/providers/router/ui/WithoutAside/WithoutAside.module.scss b/client/src/app/providers/router/ui/WithoutAside/WithoutAside.module.scss index aa0936a..61319e8 100644 --- a/client/src/app/providers/router/ui/WithoutAside/WithoutAside.module.scss +++ b/client/src/app/providers/router/ui/WithoutAside/WithoutAside.module.scss @@ -1,6 +1,6 @@ .layout { - margin: 20px; - height: var(--layout-height); + + margin: 20px; } diff --git a/client/src/app/styles/index.scss b/client/src/app/styles/index.scss index 76aa8b4..b41983a 100644 --- a/client/src/app/styles/index.scss +++ b/client/src/app/styles/index.scss @@ -1,3 +1,4 @@ -@use "./scss/reset.scss"; -@use "./scss/vars.scss"; -@use "./scss/base.scss"; +@use "./scss/reset"; +@use "./scss/vars"; +@use "./scss/fonts"; +@use "./scss/base"; diff --git a/client/src/app/styles/scss/base.scss b/client/src/app/styles/scss/base.scss index 48bf466..17a6a65 100644 --- a/client/src/app/styles/scss/base.scss +++ b/client/src/app/styles/scss/base.scss @@ -5,9 +5,9 @@ } body { + overflow: hidden; width: 100%; height: 100vh; - color: var(--color-text); background: conic-gradient( from 330deg at 50% 50%, var(--grad-1) 0deg, @@ -16,10 +16,10 @@ body { var(--grad-4) 270deg, var(--grad-1) 360deg ); + background-blend-mode: screen; background-size: 100% 100%; - background-blend-mode: screen; - overflow: hidden; + color: var(--color-text); font: var(--font-m); } diff --git a/client/src/app/styles/scss/fonts.scss b/client/src/app/styles/scss/fonts.scss index 1d7d8e8..28aa7c3 100644 --- a/client/src/app/styles/scss/fonts.scss +++ b/client/src/app/styles/scss/fonts.scss @@ -1,21 +1,21 @@ @font-face { - font-family: "Manrope-Custom"; - src: url("/fonts/Manrope-Medium.ttf") format("truetype"); - font-weight: 500; + font-family: Manrope-Custom; font-style: normal; + font-weight: 500; + src: url("/fonts/Manrope-Medium.ttf") format("truetype"); } @font-face { - font-family: "Manrope-Custom"; - src: url("/fonts/Manrope-Regular.ttf") format("truetype"); - font-weight: 400; + font-family: Manrope-Custom; font-style: normal; + font-weight: 400; + src: url("/fonts/Manrope-Regular.ttf") format("truetype"); } @font-face { - font-family: "Manrope-Custom"; - src: url("/fonts/Manrope-SemiBold.ttf") format("truetype"); - font-weight: 600; + font-family: Manrope-Custom; font-style: normal; + font-weight: 600; + src: url("/fonts/Manrope-SemiBold.ttf") format("truetype"); } diff --git a/client/src/app/styles/scss/vars.scss b/client/src/app/styles/scss/vars.scss index 0bf3498..5108e56 100644 --- a/client/src/app/styles/scss/vars.scss +++ b/client/src/app/styles/scss/vars.scss @@ -1,17 +1,15 @@ -@use './fonts.scss'; +@use './fonts'; :root { + /* Шрифты */ --family-main: 'Manrope-Custom'; - --font-size-m: 16px; --font-line-m: 24px; --font-m: 16px / 24px var(--family-main); - --font-size-l: 24px; --font-line-l: 32px; --font-l: 24px / 32px var(--family-main); - --font-size-xl: 32px; --font-line-xl: 40px; --font-xl: 32px / 40px var(--family-main); @@ -25,7 +23,7 @@ --z-index-modal: 10; /* Цвета */ - --overlay: rgba(0, 0, 0, 0.5); + --overlay: rgba(0 0 0 / 0.5); --red-light: #ff0000; --red-dark: #c50a0a; --color-error: #ff0000; @@ -38,6 +36,6 @@ /* Модальное окно */ - --modal-background: #fff; + --modal-background: #ffffff; } diff --git a/client/src/app/styles/themes/index.scss b/client/src/app/styles/themes/index.scss index f95ef86..23db001 100644 --- a/client/src/app/styles/themes/index.scss +++ b/client/src/app/styles/themes/index.scss @@ -2,15 +2,12 @@ --color-primary-dark: #0f4c81; --color-primary: #2a73ff; --color-primary-light: #dde8ff; - --grad-1: #e8f1ff; --grad-2: #c9ddff; --grad-3: #8bb2ff; --grad-4: #3b6ec8; - --color-background: #eaf6ff; --color-section: #ffffff; - --color-title: #0a3d62; --color-text: #4a4a4a; --color-active-link: #dde8ff; @@ -20,15 +17,12 @@ --color-primary: #6366f1; --color-primary-light: #a5b4fc; --color-primary-dark: #4338ca; - --color-background: #0f172a; --color-section: #1e293b; - --grad-1: #1e293b; --grad-2: #334155; --grad-3: #475569; --grad-4: #64748b; - --color-title: #e2e8f0; --color-text: #cbd5e1; --color-active-link: #4338ca; diff --git a/client/src/features/auth/model/hooks/useLoginForm.ts b/client/src/features/auth/model/hooks/useLoginForm.ts index 5e54ffa..9c1b4b4 100644 --- a/client/src/features/auth/model/hooks/useLoginForm.ts +++ b/client/src/features/auth/model/hooks/useLoginForm.ts @@ -15,14 +15,14 @@ export const useLoginForm = () => { }, }); + const onSubmit = form.handleSubmit((values) => { + alert(JSON.stringify(values)); + }); + useEffect(() => { form.setFocus('login'); }, [form, form.setFocus]); - const onSubmit = (values: LoginFormValues) => { - alert(values?.login); - }; - return { form, onSubmit, diff --git a/client/src/features/auth/model/hooks/useRegisterForm.ts b/client/src/features/auth/model/hooks/useRegisterForm.ts index ca15ad4..c47f925 100644 --- a/client/src/features/auth/model/hooks/useRegisterForm.ts +++ b/client/src/features/auth/model/hooks/useRegisterForm.ts @@ -20,9 +20,9 @@ export const useRegisterForm = () => { form.setFocus('email'); }, [form, form.setFocus]); - const onSubmit = (values: RegisterFormValues) => { - alert(values?.email); - }; + const onSubmit = form.handleSubmit((values) => { + alert(JSON.stringify(values)); + }); return { form, diff --git a/client/src/features/auth/ui/LoginForm/LoginForm.module.scss b/client/src/features/auth/ui/LoginForm/LoginForm.module.scss deleted file mode 100644 index e69de29..0000000 diff --git a/client/src/features/auth/ui/LoginForm/LoginForm.tsx b/client/src/features/auth/ui/LoginForm/LoginForm.tsx index 4fbbed7..d76c685 100644 --- a/client/src/features/auth/ui/LoginForm/LoginForm.tsx +++ b/client/src/features/auth/ui/LoginForm/LoginForm.tsx @@ -13,7 +13,7 @@ export const LoginForm = memo(({ onSwap }: LoginFormProps) => { const { register, formState } = form; return ( -
+ Authorization diff --git a/client/src/features/auth/ui/RegisterForm/RegisterForm.module.scss b/client/src/features/auth/ui/RegisterForm/RegisterForm.module.scss deleted file mode 100644 index e69de29..0000000 diff --git a/client/src/features/auth/ui/RegisterForm/RegisterForm.tsx b/client/src/features/auth/ui/RegisterForm/RegisterForm.tsx index 64e3fef..5b645da 100644 --- a/client/src/features/auth/ui/RegisterForm/RegisterForm.tsx +++ b/client/src/features/auth/ui/RegisterForm/RegisterForm.tsx @@ -3,8 +3,6 @@ import { memo } from 'react'; import { useRegisterForm } from '@/features/auth/model/hooks/useRegisterForm.ts'; import { Button, Checkbox, Form, Input, Typography } from '@/shared/ui'; -import styles from './RegisterForm.module.scss'; - interface RegisterFormProps { onSwap: () => void; } @@ -17,7 +15,7 @@ export const RegisterForm = memo(({ onSwap }: RegisterFormProps) => { } = form; return ( - + Registration @@ -38,7 +36,7 @@ export const RegisterForm = memo(({ onSwap }: RegisterFormProps) => { error={errors.password?.message} /> - + I agree to the Terms and Conditions diff --git a/client/src/features/journey/ui/Journey.module.scss b/client/src/features/journey/ui/Journey.module.scss deleted file mode 100644 index e69de29..0000000 diff --git a/client/src/features/journey/ui/Journey.tsx b/client/src/features/journey/ui/Journey.tsx index 28c8257..7a241f1 100644 --- a/client/src/features/journey/ui/Journey.tsx +++ b/client/src/features/journey/ui/Journey.tsx @@ -1,9 +1,5 @@ import { memo } from 'react'; -interface JourneyProps {} - -export const Journey = memo((props: JourneyProps) => { - const {} = props; - +export const Journey = memo(() => { return
Journey
; }); diff --git a/client/src/pages/AuthPage/ui/AuthPage/AuthPage.module.scss b/client/src/pages/AuthPage/ui/AuthPage/AuthPage.module.scss index 152a731..00df22f 100644 --- a/client/src/pages/AuthPage/ui/AuthPage/AuthPage.module.scss +++ b/client/src/pages/AuthPage/ui/AuthPage/AuthPage.module.scss @@ -1,7 +1,7 @@ .auth { display: flex; + width: 100%; + min-height: 100vh; align-items: center; justify-content: center; - min-height: 100vh; - width: 100%; } \ No newline at end of file diff --git a/client/src/pages/ErrorPage/ui/ErrorPage/ErrorPage.module.scss b/client/src/pages/ErrorPage/ui/ErrorPage/ErrorPage.module.scss deleted file mode 100644 index c3089c5..0000000 --- a/client/src/pages/ErrorPage/ui/ErrorPage/ErrorPage.module.scss +++ /dev/null @@ -1,3 +0,0 @@ -.error{ - -} \ No newline at end of file diff --git a/client/src/pages/ErrorPage/ui/ErrorPage/ErrorPage.tsx b/client/src/pages/ErrorPage/ui/ErrorPage/ErrorPage.tsx index 0c02989..01b8d05 100644 --- a/client/src/pages/ErrorPage/ui/ErrorPage/ErrorPage.tsx +++ b/client/src/pages/ErrorPage/ui/ErrorPage/ErrorPage.tsx @@ -1,7 +1,5 @@ -import styles from './ErrorPage.module.scss'; - const ErrorPage = () => { - return
404
; + return
404
; }; export default ErrorPage; diff --git a/client/src/pages/LoaderPage/ui/LoaderPage/LoaderPage.module.scss b/client/src/pages/LoaderPage/ui/LoaderPage/LoaderPage.module.scss index f23834b..b8ba6ef 100644 --- a/client/src/pages/LoaderPage/ui/LoaderPage/LoaderPage.module.scss +++ b/client/src/pages/LoaderPage/ui/LoaderPage/LoaderPage.module.scss @@ -1,6 +1,6 @@ .page { - width: 100%; display: flex; + width: 100%; align-items: center; justify-content: center; } diff --git a/client/src/pages/MainPage/ui/DashboardPage/DashboardPage.module.scss b/client/src/pages/MainPage/ui/DashboardPage/DashboardPage.module.scss index 9c47cf5..dbeb713 100644 --- a/client/src/pages/MainPage/ui/DashboardPage/DashboardPage.module.scss +++ b/client/src/pages/MainPage/ui/DashboardPage/DashboardPage.module.scss @@ -1,12 +1,12 @@ .main { - font-size: 40px; - font-weight: 700; - - color: var(--color-title); width: 100%; height: 100%; padding: 20px; border-radius: 12px; background-color: var(--color-section); + + color: var(--color-title); + font-size: 40px; + font-weight: 700; } diff --git a/client/src/shared/config/storybook/decorators/StyleDecorator.tsx b/client/src/shared/config/storybook/decorators/StyleDecorator.tsx index ccb0a8d..ec90847 100644 --- a/client/src/shared/config/storybook/decorators/StyleDecorator.tsx +++ b/client/src/shared/config/storybook/decorators/StyleDecorator.tsx @@ -2,5 +2,6 @@ import type { Decorator } from '@storybook/react'; import '@/app/styles/index.scss'; import '../styles/index.scss'; +import '@/app/styles/themes/index.scss'; export const StyleDecorator: Decorator = (StoryComponent) => ; diff --git a/client/src/shared/config/storybook/styles/index.scss b/client/src/shared/config/storybook/styles/index.scss index 7fb861a..4fd9ae6 100644 --- a/client/src/shared/config/storybook/styles/index.scss +++ b/client/src/shared/config/storybook/styles/index.scss @@ -1,5 +1,5 @@ -*{ - width: #000; +* { + width: #000000; } .title { @@ -8,10 +8,10 @@ font-weight: 600; } -//------Typography--- +// ------Typography--- .typography_inner { - color: #ffffff; + color: #7f7f7f; font-family: Helvetica, sans-serif; } @@ -23,7 +23,7 @@ .typography_block { display: flex; - color: #ffffff; + color: #1c1c1c; gap: 20px; } @@ -34,6 +34,7 @@ } // ------Icons--- + .icons_wrapper { display: grid; gap: 20px; @@ -45,7 +46,6 @@ width: 100%; align-items: center; padding: 12px; - border: 1px solid #575970; border-radius: 4px; gap: 12px; } diff --git a/client/src/shared/ui/Button/Button.module.scss b/client/src/shared/ui/Button/Button.module.scss index e76e61e..6a30de2 100644 --- a/client/src/shared/ui/Button/Button.module.scss +++ b/client/src/shared/ui/Button/Button.module.scss @@ -2,10 +2,10 @@ display: flex; width: 100%; align-items: center; - color: var(--color-title); padding: 6px 12px; border-radius: 4px; + color: var(--color-title); cursor: pointer; font-size: 1rem; gap: 8px; @@ -19,9 +19,11 @@ .start { justify-content: flex-start; } + .center { justify-content: center; } + .end { justify-content: flex-end; } diff --git a/client/src/shared/ui/Button/Button.stories.tsx b/client/src/shared/ui/Button/Button.stories.tsx new file mode 100644 index 0000000..f68c657 --- /dev/null +++ b/client/src/shared/ui/Button/Button.stories.tsx @@ -0,0 +1,55 @@ +import type { Meta, StoryObj } from '@storybook/react'; + +import * as Icons from '../../assets/icons/index'; + +import { Button, type ButtonProps } from './Button'; + +const meta: Meta = { + title: 'UI/Button', + component: Button, +}; + +const buttonProps: ButtonProps = { + variant: 'primary', + children: 'button', + loading: false, +}; + +const buttonIcon = ; + +type Story = StoryObj; +const Template: Story = { render: (args) =>