From fee9523b35ec746ac63c789eca705a5444bccb2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=B4ng=20=C4=90=E1=BB=A9c=20Huy?= Date: Thu, 13 Aug 2026 23:18:38 +0700 Subject: [PATCH] add shadcn ui --- .vscode/settings.json | 4 + apps/admin/next.config.ts | 2 +- apps/admin/src/features/auth/login-form.tsx | 8 +- .../admin/src/features/cms/content-editor.tsx | 11 +- apps/admin/src/features/cms/content-table.tsx | 7 +- .../features/customers/customers-table.tsx | 7 +- .../features/discounts/discount-dialog.tsx | 14 +- .../features/discounts/discounts-table.tsx | 7 +- .../features/inventory/inventory-table.tsx | 7 +- .../src/features/media/media-library.tsx | 8 +- .../src/features/orders/order-detail.tsx | 8 +- .../src/features/orders/orders-table.tsx | 7 +- .../src/features/products/image-manager.tsx | 8 +- .../src/features/products/product-editor.tsx | 8 +- .../src/features/products/product-form.tsx | 10 +- .../src/features/products/products-table.tsx | 7 +- .../src/features/products/variant-grid.tsx | 8 +- .../src/features/reviews/reviews-queue.tsx | 17 +- .../features/taxonomy/taxonomy-manager.tsx | 13 +- apps/admin/tsconfig.json | 3 +- apps/api/tsconfig.json | 3 +- .../src/components/commerce/cart-view.tsx | 8 +- .../src/components/commerce/load-more.tsx | 8 +- .../src/components/commerce/review-form.tsx | 11 +- .../src/features/account/account-panels.tsx | 32 +--- .../src/features/account/auth-form.tsx | 14 +- apps/storefront/tsconfig.json | 3 +- packages/ui/package.json | 2 + packages/ui/src/components/ui/alert.tsx | 60 ++++++ packages/ui/src/components/ui/avatar.tsx | 96 ++++++++++ packages/ui/src/components/ui/breadcrumb.tsx | 102 ++++++++++ packages/ui/src/components/ui/card.tsx | 75 ++++++++ packages/ui/src/components/ui/checkbox.tsx | 29 +++ packages/ui/src/components/ui/data-table.tsx | 49 +++-- packages/ui/src/components/ui/field.tsx | 6 +- packages/ui/src/components/ui/form-error.tsx | 27 +++ packages/ui/src/components/ui/label.tsx | 21 +++ packages/ui/src/components/ui/pagination.tsx | 118 ++++++++++++ packages/ui/src/components/ui/popover.tsx | 74 ++++++++ packages/ui/src/components/ui/radio-group.tsx | 45 +++++ .../src/components/ui/segmented-control.tsx | 37 ++-- packages/ui/src/components/ui/select.tsx | 175 ++++++++++++++++++ packages/ui/src/components/ui/separator.tsx | 28 +++ packages/ui/src/components/ui/sonner.tsx | 40 ++++ packages/ui/src/components/ui/switch.tsx | 35 ++++ packages/ui/src/components/ui/table.tsx | 92 +++++++++ packages/ui/src/components/ui/textarea.tsx | 18 ++ packages/ui/src/components/ui/tooltip.tsx | 53 ++++++ packages/ui/src/index.ts | 83 +++++++++ pnpm-lock.yaml | 34 ++++ 50 files changed, 1331 insertions(+), 211 deletions(-) create mode 100644 .vscode/settings.json create mode 100644 packages/ui/src/components/ui/alert.tsx create mode 100644 packages/ui/src/components/ui/avatar.tsx create mode 100644 packages/ui/src/components/ui/breadcrumb.tsx create mode 100644 packages/ui/src/components/ui/card.tsx create mode 100644 packages/ui/src/components/ui/checkbox.tsx create mode 100644 packages/ui/src/components/ui/form-error.tsx create mode 100644 packages/ui/src/components/ui/label.tsx create mode 100644 packages/ui/src/components/ui/pagination.tsx create mode 100644 packages/ui/src/components/ui/popover.tsx create mode 100644 packages/ui/src/components/ui/radio-group.tsx create mode 100644 packages/ui/src/components/ui/select.tsx create mode 100644 packages/ui/src/components/ui/separator.tsx create mode 100644 packages/ui/src/components/ui/sonner.tsx create mode 100644 packages/ui/src/components/ui/switch.tsx create mode 100644 packages/ui/src/components/ui/table.tsx create mode 100644 packages/ui/src/components/ui/textarea.tsx create mode 100644 packages/ui/src/components/ui/tooltip.tsx diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..fae8e3d --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "typescript.tsdk": "node_modules/typescript/lib", + "typescript.enablePromptUseWorkspaceTsdk": true +} diff --git a/apps/admin/next.config.ts b/apps/admin/next.config.ts index ae67cd6..c1097d0 100644 --- a/apps/admin/next.config.ts +++ b/apps/admin/next.config.ts @@ -1,5 +1,5 @@ -import createNextIntlPlugin from 'next-intl/plugin'; import type { NextConfig } from 'next'; +import createNextIntlPlugin from 'next-intl/plugin'; /** Registers the cookie-based locale resolver in src/i18n/request.ts. */ const withNextIntl = createNextIntlPlugin('./src/i18n/request.ts'); diff --git a/apps/admin/src/features/auth/login-form.tsx b/apps/admin/src/features/auth/login-form.tsx index f0544d5..5393c4c 100644 --- a/apps/admin/src/features/auth/login-form.tsx +++ b/apps/admin/src/features/auth/login-form.tsx @@ -5,7 +5,7 @@ import { useTranslations } from 'next-intl'; import { useEffect, useState, type FormEvent } from 'react'; import { isApiClientError } from '@sport/api-client'; -import { Button, Input } from '@sport/ui'; +import { Button, FormError, Input } from '@sport/ui'; import { loginSchema } from '@sport/validation'; import { useSession } from './session-provider'; @@ -91,11 +91,7 @@ export function LoginForm() { /> - {error ? ( -

- {error} -

- ) : null} +