From 9baa68258e0c744c7d17a8510de2991462842e7e Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 18 Oct 2025 01:46:46 +0300 Subject: [PATCH] 123 --- hey-api-config.ts | 6 + LICENCE | 21 + README.md | 38 + components/BaseTable/BaseTable.tsx | 8 + components/BaseTable/helpers.ts | 5 + .../ColorSchemeToggle/ColorSchemeToggle.tsx | 13 + components/Forms/AuthenticationForm.tsx | 45 + components/Forms/LogidexButton.tsx | 29 + components/Layout/Header/Header.tsx | 41 + components/Layout/Navbar/Navbar.module.css | 63 + components/Layout/Navbar/Navbar.tsx | 58 + components/Layout/Navbar/types.ts | 11 + components/Modals/BaseFormModal/BaseFormModal | 2 + .../Fields/BooleanField/BooleanField.tsx | 8 + .../Fields/NumberField/NumberField.tsx | 9 + .../Fields/StringField/StringField.tsx | 9 + components/ObjectForm/ObjectForm.tsx | 74 + .../Tables/Actions/BaseTableActions.tsx | 23 + components/Welcome/Welcome.module.css | 10 + components/Welcome/Welcome.story.tsx | 7 + components/Welcome/Welcome.test.tsx | 12 + components/Welcome/Welcome.tsx | 23 + eslint.config.mjs | 23 + jest.config.cjs | 16 + jest.setup.cjs | 27 + lib/client/@tanstack/react-query.gen.ts | 1342 ++ lib/client/client.gen.ts | 35 + lib/client/client/client.gen.ts | 163 + lib/client/client/index.ts | 24 + lib/client/client/types.gen.ts | 216 + lib/client/client/utils.gen.ts | 212 + lib/client/core/auth.gen.ts | 42 + lib/client/core/bodySerializer.gen.ts | 92 + lib/client/core/params.gen.ts | 153 + lib/client/core/pathSerializer.gen.ts | 181 + lib/client/core/queryKeySerializer.gen.ts | 136 + lib/client/core/serverSentEvents.gen.ts | 264 + lib/client/core/types.gen.ts | 118 + lib/client/core/utils.gen.ts | 143 + lib/client/index.ts | 4 + lib/client/sdk.gen.ts | 1316 ++ lib/client/types.gen.ts | 4203 ++++ lib/client/zod.gen.ts | 2465 +++ next-env.d.ts | 6 + next.config.mjs | 12 + openapi-ts.config.ts | 31 + package.json | 90 + pages/_app.tsx | 86 + pages/_document.tsx | 16 + pages/deal-requests/index.tsx | 4 + pages/index.tsx | 22 + pages/layout.css | 2 + pages/legal-entities/index.tsx | 4 + pages/login/index.tsx | 11 + .../BaseMarketplaceColumnRender.tsx | 11 + .../MarketplacesTable/MarketplacesTable.tsx | 41 + .../components/MarketplacesTable/actions | 0 .../components/MarketplacesTable/columns.tsx | 57 + pages/marketplaces/index.tsx | 22 + .../MarketplaceFormModal.tsx | 8 + pages/products/index.tsx | 4 + postcss.config.cjs | 14 + providers/MantineModalsProvider.tsx | 23 + providers/ReactQueryProvider.tsx | 34 + public/favicon.svg | 1 + public/logidex_dark.svg | 4 + public/logidex_light.svg | 4 + renovate.json | 13 + test-utils/index.ts | 5 + test-utils/render.tsx | 13 + theme.ts | 5 + tsconfig.json | 44 + types/CrudTable/CrudTable.tsx | 5 + yarn.lock | 16843 ++++++++++++++++ 74 files changed, 29125 insertions(+) create mode 100644 hey-api-config.ts create mode 100644 LICENCE create mode 100644 README.md create mode 100644 components/BaseTable/BaseTable.tsx create mode 100644 components/BaseTable/helpers.ts create mode 100644 components/ColorSchemeToggle/ColorSchemeToggle.tsx create mode 100644 components/Forms/AuthenticationForm.tsx create mode 100644 components/Forms/LogidexButton.tsx create mode 100644 components/Layout/Header/Header.tsx create mode 100644 components/Layout/Navbar/Navbar.module.css create mode 100644 components/Layout/Navbar/Navbar.tsx create mode 100644 components/Layout/Navbar/types.ts create mode 100644 components/Modals/BaseFormModal/BaseFormModal create mode 100644 components/ObjectForm/Fields/BooleanField/BooleanField.tsx create mode 100644 components/ObjectForm/Fields/NumberField/NumberField.tsx create mode 100644 components/ObjectForm/Fields/StringField/StringField.tsx create mode 100644 components/ObjectForm/ObjectForm.tsx create mode 100644 components/Tables/Actions/BaseTableActions.tsx create mode 100644 components/Welcome/Welcome.module.css create mode 100644 components/Welcome/Welcome.story.tsx create mode 100644 components/Welcome/Welcome.test.tsx create mode 100644 components/Welcome/Welcome.tsx create mode 100644 eslint.config.mjs create mode 100644 jest.config.cjs create mode 100644 jest.setup.cjs create mode 100644 lib/client/@tanstack/react-query.gen.ts create mode 100644 lib/client/client.gen.ts create mode 100644 lib/client/client/client.gen.ts create mode 100644 lib/client/client/index.ts create mode 100644 lib/client/client/types.gen.ts create mode 100644 lib/client/client/utils.gen.ts create mode 100644 lib/client/core/auth.gen.ts create mode 100644 lib/client/core/bodySerializer.gen.ts create mode 100644 lib/client/core/params.gen.ts create mode 100644 lib/client/core/pathSerializer.gen.ts create mode 100644 lib/client/core/queryKeySerializer.gen.ts create mode 100644 lib/client/core/serverSentEvents.gen.ts create mode 100644 lib/client/core/types.gen.ts create mode 100644 lib/client/core/utils.gen.ts create mode 100644 lib/client/index.ts create mode 100644 lib/client/sdk.gen.ts create mode 100644 lib/client/types.gen.ts create mode 100644 lib/client/zod.gen.ts create mode 100644 next-env.d.ts create mode 100644 next.config.mjs create mode 100644 openapi-ts.config.ts create mode 100644 package.json create mode 100644 pages/_app.tsx create mode 100644 pages/_document.tsx create mode 100644 pages/deal-requests/index.tsx create mode 100644 pages/index.tsx create mode 100644 pages/layout.css create mode 100644 pages/legal-entities/index.tsx create mode 100644 pages/login/index.tsx create mode 100644 pages/marketplaces/components/BaseMarketplaceColumnRender/BaseMarketplaceColumnRender.tsx create mode 100644 pages/marketplaces/components/MarketplacesTable/MarketplacesTable.tsx create mode 100644 pages/marketplaces/components/MarketplacesTable/actions create mode 100644 pages/marketplaces/components/MarketplacesTable/columns.tsx create mode 100644 pages/marketplaces/index.tsx create mode 100644 pages/marketplaces/modals/MarketplaceFormModal/MarketplaceFormModal.tsx create mode 100644 pages/products/index.tsx create mode 100644 postcss.config.cjs create mode 100644 providers/MantineModalsProvider.tsx create mode 100644 providers/ReactQueryProvider.tsx create mode 100644 public/favicon.svg create mode 100644 public/logidex_dark.svg create mode 100644 public/logidex_light.svg create mode 100644 renovate.json create mode 100644 test-utils/index.ts create mode 100644 test-utils/render.tsx create mode 100644 theme.ts create mode 100644 tsconfig.json create mode 100644 types/CrudTable/CrudTable.tsx create mode 100644 yarn.lock diff --git a/ hey-api-config.ts b/ hey-api-config.ts new file mode 100644 index 0000000..2bdeea8 --- /dev/null +++ b/ hey-api-config.ts @@ -0,0 +1,6 @@ +import { CreateClientConfig } from '@/lib/client/client.gen'; + +export const createClientConfig: CreateClientConfig = (config) => ({ + ...config, + baseURL: process.env.NEXT_PUBLIC_API_URL, +}); diff --git a/LICENCE b/LICENCE new file mode 100644 index 0000000..1a88111 --- /dev/null +++ b/LICENCE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Vitaly Rtischev + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..d931cb9 --- /dev/null +++ b/README.md @@ -0,0 +1,38 @@ +# Mantine Next.js template + +This is a template for [Next.js](https://nextjs.org/) pages router + [Mantine](https://mantine.dev/). +If you want to use app router instead, see [next-app-template](https://github.com/mantinedev/next-app-template). + +## Features + +This template comes with the following features: + +- [PostCSS](https://postcss.org/) with [mantine-postcss-preset](https://mantine.dev/styles/postcss-preset) +- [TypeScript](https://www.typescriptlang.org/) +- [Storybook](https://storybook.js.org/) +- [Jest](https://jestjs.io/) setup with [React Testing Library](https://testing-library.com/docs/react-testing-library/intro) +- ESLint setup with [eslint-config-mantine](https://github.com/mantinedev/eslint-config-mantine) + +## npm scripts + +### Build and dev scripts + +- `dev` – start dev server +- `build` – bundle application for production +- `export` – exports static website to `out` folder +- `analyze` – analyzes application bundle with [@next/bundle-analyzer](https://www.npmjs.com/package/@next/bundle-analyzer) + +### Testing scripts + +- `typecheck` – checks TypeScript types +- `lint` – runs ESLint +- `prettier:check` – checks files with Prettier +- `jest` – runs jest tests +- `jest:watch` – starts jest watch +- `test` – runs `jest`, `prettier:check`, `lint` and `typecheck` scripts + +### Other scripts + +- `storybook` – starts storybook dev server +- `storybook:build` – build production storybook bundle to `storybook-static` +- `prettier:write` – formats all files with Prettier diff --git a/components/BaseTable/BaseTable.tsx b/components/BaseTable/BaseTable.tsx new file mode 100644 index 0000000..8081c21 --- /dev/null +++ b/components/BaseTable/BaseTable.tsx @@ -0,0 +1,8 @@ +import { DataTable, type DataTableProps } from 'mantine-datatable'; + +// важна стрелочная форма для корректного дженерика в JSX +const BaseTable = (props: DataTableProps) => { + return ; +}; + +export default BaseTable; diff --git a/components/BaseTable/helpers.ts b/components/BaseTable/helpers.ts new file mode 100644 index 0000000..6c86f98 --- /dev/null +++ b/components/BaseTable/helpers.ts @@ -0,0 +1,5 @@ +// helpers.ts (или рядом) +import type { DataTableProps } from 'mantine-datatable'; + +// Берём ИМЕННО ту ветку union, где есть `columns` +export type ColumnsMode = Extract, { columns: unknown }>; diff --git a/components/ColorSchemeToggle/ColorSchemeToggle.tsx b/components/ColorSchemeToggle/ColorSchemeToggle.tsx new file mode 100644 index 0000000..18e2bb7 --- /dev/null +++ b/components/ColorSchemeToggle/ColorSchemeToggle.tsx @@ -0,0 +1,13 @@ +import { Button, Group, useMantineColorScheme } from '@mantine/core'; + +export function ColorSchemeToggle() { + const { setColorScheme } = useMantineColorScheme(); + + return ( + + + + + + ); +} diff --git a/components/Forms/AuthenticationForm.tsx b/components/Forms/AuthenticationForm.tsx new file mode 100644 index 0000000..09c346d --- /dev/null +++ b/components/Forms/AuthenticationForm.tsx @@ -0,0 +1,45 @@ +import { + Anchor, + Button, + Checkbox, + Divider, + Group, + Paper, + PaperProps, + PasswordInput, + Stack, + Text, + TextInput, +} from '@mantine/core'; +import { useForm } from '@mantine/form'; +import { upperFirst, useToggle } from '@mantine/hooks'; +import { LogidexButton } from '@/components/Forms/LogidexButton'; + +export function AuthenticationForm(props: PaperProps) { + const [type, toggle] = useToggle(['login', 'register']); + const form = useForm({ + initialValues: { + email: '', + name: '', + password: '', + terms: true, + }, + + validate: { + email: (val) => (/^\S+@\S+$/.test(val) ? null : 'Invalid email'), + password: (val) => (val.length <= 6 ? 'Password should include at least 6 characters' : null), + }, + }); + + return ( + + + Добро пожаловать в Logidex + + + + Войти с помощью LogidexID + + + ); +} diff --git a/components/Forms/LogidexButton.tsx b/components/Forms/LogidexButton.tsx new file mode 100644 index 0000000..0973be9 --- /dev/null +++ b/components/Forms/LogidexButton.tsx @@ -0,0 +1,29 @@ +import { Button, ButtonProps } from '@mantine/core'; + +function LogidexIcon(props: React.ComponentPropsWithoutRef<'svg'>) { + return ( + + + + + + ); +} +export function LogidexButton(props: ButtonProps & React.ComponentPropsWithoutRef<'button'>) { + return