From c8bf1d484ed8c058bd1a0579fcb30d0976b6cdae Mon Sep 17 00:00:00 2001 From: speakeloudest Date: Sun, 10 Aug 2025 05:43:15 -0700 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E4=BB=A5=E6=9D=A5?= =?UTF-8?q?=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/user/.env | 2 +- .../components/Announcement/Popup.tsx | 2 +- .../(content)/(user)/dashboard/content.tsx | 14 +-- .../(content)/(user)/document/close-icon.tsx | 2 +- .../(user)/document/document-button.tsx | 12 +-- .../(main)/(content)/(user)/document/page.tsx | 2 +- .../(user)/document/tutorial-button.tsx | 12 +-- .../app/(main)/(content)/(user)/layout.tsx | 4 +- .../order/components/OrderDetailDialog.tsx | 2 +- .../(main)/(content)/(user)/order/page.tsx | 6 +- .../(main)/(content)/(user)/payment/page.tsx | 12 +-- .../(user)/profile/change-password.tsx | 14 ++- .../(user)/profile/notify-settings.tsx | 14 ++- .../(user)/profile/third-party-accounts.tsx | 18 ++-- .../(main)/(content)/(user)/sidebar-right.tsx | 85 ------------------- .../(content)/(user)/subscribe/page.tsx | 4 +- .../(main)/(content)/(user)/ticket/page.tsx | 24 +++--- .../(main)/(content)/(user)/wallet/page.tsx | 6 +- .../(main)/(content)/privacy-policy/page.tsx | 2 +- .../(main)/(content)/purchasing/content.tsx | 12 +-- .../(content)/purchasing/order/page.tsx | 12 +-- apps/user/app/(main)/(content)/tos/page.tsx | 2 +- apps/user/app/auth/LoginDialogContext.tsx | 2 +- apps/user/app/auth/auth-page.tsx | 4 +- apps/user/app/auth/email/login-form.tsx | 14 ++- apps/user/app/auth/email/register-form.tsx | 16 ++-- apps/user/app/auth/email/reset-form.tsx | 14 ++- apps/user/app/auth/phone/login-form.tsx | 16 ++-- apps/user/app/auth/phone/register-form.tsx | 18 ++-- apps/user/app/auth/phone/reset-form.tsx | 16 ++-- apps/user/app/auth/send-code.tsx | 2 +- apps/user/app/layout.tsx | 6 +- apps/user/components.json | 4 +- apps/user/components/Header/Header.tsx | 4 +- .../affiliate/components/AffiliateDialog.tsx | 4 +- apps/user/components/affiliate/index.tsx | 8 +- apps/user/components/announcement/index.tsx | 2 +- apps/user/components/auth/oauth-methods.tsx | 4 +- apps/user/components/display.tsx | 2 +- apps/user/components/empty.tsx | 2 +- apps/user/components/footer.tsx | 4 +- apps/user/components/language-switch.tsx | 6 +- apps/user/components/main/HomeContent.tsx | 2 +- .../components/main/OfferDialog/index.tsx | 8 +- apps/user/components/main/global-map.tsx | 2 +- apps/user/components/main/hero.tsx | 6 +- .../main/product-showcase/content.tsx | 10 +-- apps/user/components/main/stats.tsx | 6 +- apps/user/components/payment/stripe.tsx | 6 +- apps/user/components/subscribe/billing.tsx | 2 +- .../components/subscribe/coupon-input.tsx | 2 +- .../subscribe/duration-selector.tsx | 6 +- .../components/subscribe/payment-methods.tsx | 6 +- apps/user/components/subscribe/purchase.tsx | 6 +- apps/user/components/subscribe/recharge.tsx | 8 +- apps/user/components/subscribe/renewal.tsx | 8 +- .../components/subscribe/reset-traffic.tsx | 4 +- .../user/components/subscribe/unsubscribe.tsx | 4 +- apps/user/components/theme-switch.tsx | 8 +- apps/user/components/user-nav.tsx | 13 ++- apps/user/config/use-global.tsx | 2 +- .../{eslint.config.mjs => eslint.config.js} | 0 apps/user/next.config.ts | 2 +- apps/user/package.json | 1 - apps/user/postcss.config.mjs | 2 +- apps/user/tailwind.config.ts | 2 +- apps/user/tsconfig.json | 1 - apps/user/utils/common.ts | 2 +- apps/user/utils/request.ts | 2 +- packages/airo-ui/src/components/sidebar.tsx | 4 +- 70 files changed, 251 insertions(+), 285 deletions(-) delete mode 100644 apps/user/app/(main)/(content)/(user)/sidebar-right.tsx rename apps/user/{eslint.config.mjs => eslint.config.js} (100%) diff --git a/apps/user/.env b/apps/user/.env index 06a80df..73941d3 100644 --- a/apps/user/.env +++ b/apps/user/.env @@ -3,7 +3,7 @@ NEXT_PUBLIC_DEFAULT_LANGUAGE=en-US # Site URL and API URL NEXT_PUBLIC_SITE_URL=https://user.ppanel.dev -NEXT_PUBLIC_API_URL=https://api.ppanel.dev +NEXT_PUBLIC_API_URL=https://api.kxsw.us NEXT_PUBLIC_CDN_URL=https://cdn.jsdelivr.net # Home Page Settings diff --git a/apps/user/app/(main)/(content)/(user)/dashboard/components/Announcement/Popup.tsx b/apps/user/app/(main)/(content)/(user)/dashboard/components/Announcement/Popup.tsx index 042cc0c..84fc007 100644 --- a/apps/user/app/(main)/(content)/(user)/dashboard/components/Announcement/Popup.tsx +++ b/apps/user/app/(main)/(content)/(user)/dashboard/components/Announcement/Popup.tsx @@ -6,7 +6,7 @@ import { DialogHeader, DialogTitle, } from '@workspace/airo-ui/components/dialog'; -import { Markdown } from '@workspace/ui/custom-components/markdown'; +import { Markdown } from '@workspace/airo-ui/custom-components/markdown'; import { useImperativeHandle, useState } from 'react'; export interface PopupData { diff --git a/apps/user/app/(main)/(content)/(user)/dashboard/content.tsx b/apps/user/app/(main)/(content)/(user)/dashboard/content.tsx index c3da925..0b207c0 100644 --- a/apps/user/app/(main)/(content)/(user)/dashboard/content.tsx +++ b/apps/user/app/(main)/(content)/(user)/dashboard/content.tsx @@ -7,15 +7,15 @@ import ResetTraffic from '@/components/subscribe/reset-traffic'; import useGlobalStore from '@/config/use-global'; import { queryUserSubscribe, resetUserSubscribeToken } from '@/services/user/user'; import { useQuery } from '@tanstack/react-query'; -import { Button } from '@workspace/ui/components/button'; -import { Card } from '@workspace/ui/components/card'; +import { Button } from '@workspace/airo-ui/components/button'; +import { Card } from '@workspace/airo-ui/components/card'; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, -} from '@workspace/ui/components/select'; +} from '@workspace/airo-ui/components/select'; import { useTranslations } from 'next-intl'; import Link from 'next/link'; import { useEffect, useRef, useState } from 'react'; @@ -32,7 +32,6 @@ import { import { Empty } from '@/components/empty'; import SvgIcon from '@/components/SvgIcon'; import { queryAnnouncement } from '@/services/user/announcement'; -import { Popover, PopoverContent, PopoverTrigger } from '@workspace/airo-ui/components/popover'; import { AlertDialog, AlertDialogAction, @@ -43,9 +42,10 @@ import { AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, -} from '@workspace/ui/components/alert-dialog'; -import { Tabs, TabsList, TabsTrigger } from '@workspace/ui/components/tabs'; -import { differenceInDays, formatDate } from '@workspace/ui/utils'; +} from '@workspace/airo-ui/components/alert-dialog'; +import { Popover, PopoverContent, PopoverTrigger } from '@workspace/airo-ui/components/popover'; +import { Tabs, TabsList, TabsTrigger } from '@workspace/airo-ui/components/tabs'; +import { differenceInDays, formatDate } from '@workspace/airo-ui/utils'; import { QRCodeCanvas } from 'qrcode.react'; import { CopyToClipboard } from 'react-copy-to-clipboard'; diff --git a/apps/user/app/(main)/(content)/(user)/document/close-icon.tsx b/apps/user/app/(main)/(content)/(user)/document/close-icon.tsx index d577ce4..ae6bb72 100644 --- a/apps/user/app/(main)/(content)/(user)/document/close-icon.tsx +++ b/apps/user/app/(main)/(content)/(user)/document/close-icon.tsx @@ -1,4 +1,4 @@ -import { cn } from '@workspace/ui/lib/utils'; +import { cn } from '@workspace/airo-ui/lib/utils'; import { motion } from 'framer-motion'; export const CloseIcon = ({ className }: { className?: string }) => { diff --git a/apps/user/app/(main)/(content)/(user)/document/document-button.tsx b/apps/user/app/(main)/(content)/(user)/document/document-button.tsx index 26d80fa..d6c2a5c 100644 --- a/apps/user/app/(main)/(content)/(user)/document/document-button.tsx +++ b/apps/user/app/(main)/(content)/(user)/document/document-button.tsx @@ -2,12 +2,12 @@ import { queryDocumentDetail } from '@/services/user/document'; import { useQuery } from '@tanstack/react-query'; -import { Avatar, AvatarFallback } from '@workspace/ui/components/avatar'; -import { buttonVariants } from '@workspace/ui/components/button'; -import { Markdown } from '@workspace/ui/custom-components/markdown'; -import { useOutsideClick } from '@workspace/ui/hooks/use-outside-click'; -import { cn } from '@workspace/ui/lib/utils'; -import { formatDate } from '@workspace/ui/utils'; +import { Avatar, AvatarFallback } from '@workspace/airo-ui/components/avatar'; +import { buttonVariants } from '@workspace/airo-ui/components/button'; +import { Markdown } from '@workspace/airo-ui/custom-components/markdown'; +import { useOutsideClick } from '@workspace/airo-ui/hooks/use-outside-click'; +import { cn } from '@workspace/airo-ui/lib/utils'; +import { formatDate } from '@workspace/airo-ui/utils'; import { AnimatePresence, motion } from 'framer-motion'; import { useTranslations } from 'next-intl'; import { RefObject, useEffect, useId, useRef, useState } from 'react'; diff --git a/apps/user/app/(main)/(content)/(user)/document/page.tsx b/apps/user/app/(main)/(content)/(user)/document/page.tsx index a357df3..979ee37 100644 --- a/apps/user/app/(main)/(content)/(user)/document/page.tsx +++ b/apps/user/app/(main)/(content)/(user)/document/page.tsx @@ -3,7 +3,7 @@ import { queryDocumentList } from '@/services/user/document'; import { getTutorialList } from '@/utils/tutorial'; import { useQuery } from '@tanstack/react-query'; -import { Tabs, TabsContent, TabsList, TabsTrigger } from '@workspace/ui/components/tabs'; +import { Tabs, TabsContent, TabsList, TabsTrigger } from '@workspace/airo-ui/components/tabs'; import { useLocale, useTranslations } from 'next-intl'; import { TutorialButton } from './tutorial-button'; diff --git a/apps/user/app/(main)/(content)/(user)/document/tutorial-button.tsx b/apps/user/app/(main)/(content)/(user)/document/tutorial-button.tsx index 4e54998..7d99800 100644 --- a/apps/user/app/(main)/(content)/(user)/document/tutorial-button.tsx +++ b/apps/user/app/(main)/(content)/(user)/document/tutorial-button.tsx @@ -2,12 +2,12 @@ import { getTutorial } from '@/utils/tutorial'; import { useQuery } from '@tanstack/react-query'; -import { Avatar, AvatarFallback, AvatarImage } from '@workspace/ui/components/avatar'; -import { buttonVariants } from '@workspace/ui/components/button'; -import { Markdown } from '@workspace/ui/custom-components/markdown'; -import { useOutsideClick } from '@workspace/ui/hooks/use-outside-click'; -import { cn } from '@workspace/ui/lib/utils'; -import { formatDate } from '@workspace/ui/utils'; +import { Avatar, AvatarFallback, AvatarImage } from '@workspace/airo-ui/components/avatar'; +import { buttonVariants } from '@workspace/airo-ui/components/button'; +import { Markdown } from '@workspace/airo-ui/custom-components/markdown'; +import { useOutsideClick } from '@workspace/airo-ui/hooks/use-outside-click'; +import { cn } from '@workspace/airo-ui/lib/utils'; +import { formatDate } from '@workspace/airo-ui/utils'; import { AnimatePresence, motion } from 'framer-motion'; import { useTranslations } from 'next-intl'; import { RefObject, useEffect, useId, useRef, useState } from 'react'; diff --git a/apps/user/app/(main)/(content)/(user)/layout.tsx b/apps/user/app/(main)/(content)/(user)/layout.tsx index 903b85f..4755f96 100644 --- a/apps/user/app/(main)/(content)/(user)/layout.tsx +++ b/apps/user/app/(main)/(content)/(user)/layout.tsx @@ -1,5 +1,5 @@ import Announcement from '@/components/announcement'; -import LanguageSwitch from '@/components/language-switch'; +// import LanguageSwitch from '@/components/language-switch'; import { SidebarInset, SidebarProvider } from '@workspace/airo-ui/components/sidebar'; import { cookies } from 'next/headers'; import { Header } from './Header'; @@ -13,7 +13,7 @@ export default async function DashboardLayout({ children }: { children: React.Re - + {/**/}
{children} diff --git a/apps/user/app/(main)/(content)/(user)/order/components/OrderDetailDialog.tsx b/apps/user/app/(main)/(content)/(user)/order/components/OrderDetailDialog.tsx index 6639b76..b772209 100644 --- a/apps/user/app/(main)/(content)/(user)/order/components/OrderDetailDialog.tsx +++ b/apps/user/app/(main)/(content)/(user)/order/components/OrderDetailDialog.tsx @@ -1,7 +1,7 @@ 'use client'; import { useQuery } from '@tanstack/react-query'; import { Dialog, DialogContent } from '@workspace/airo-ui/components/dialog'; -import { Separator } from '@workspace/ui/components/separator'; +import { Separator } from '@workspace/airo-ui/components/separator'; import { useTranslations } from 'next-intl'; import { useRouter } from 'next/navigation'; import { forwardRef, useImperativeHandle, useState } from 'react'; diff --git a/apps/user/app/(main)/(content)/(user)/order/page.tsx b/apps/user/app/(main)/(content)/(user)/order/page.tsx index 4bd5fdd..1a7d709 100644 --- a/apps/user/app/(main)/(content)/(user)/order/page.tsx +++ b/apps/user/app/(main)/(content)/(user)/order/page.tsx @@ -4,9 +4,9 @@ import { Display } from '@/components/display'; import { Empty } from '@/components/empty'; import { ProList, ProListActions } from '@/components/pro-list'; import { closeOrder, queryOrderList } from '@/services/user/order'; -import { Button } from '@workspace/ui/components/button'; -import { Card, CardContent } from '@workspace/ui/components/card'; -import { formatDate } from '@workspace/ui/utils'; +import { Button } from '@workspace/airo-ui/components/button'; +import { Card, CardContent } from '@workspace/airo-ui/components/card'; +import { formatDate } from '@workspace/airo-ui/utils'; import { useTranslations } from 'next-intl'; import { useRef } from 'react'; import OrderDetailDialog from './components/OrderDetailDialog'; diff --git a/apps/user/app/(main)/(content)/(user)/payment/page.tsx b/apps/user/app/(main)/(content)/(user)/payment/page.tsx index efa3a7e..33d8ef6 100644 --- a/apps/user/app/(main)/(content)/(user)/payment/page.tsx +++ b/apps/user/app/(main)/(content)/(user)/payment/page.tsx @@ -8,18 +8,18 @@ import useGlobalStore from '@/config/use-global'; import { queryOrderDetail } from '@/services/user/order'; import { purchaseCheckout } from '@/services/user/portal'; import { useQuery } from '@tanstack/react-query'; -import { Badge } from '@workspace/ui/components/badge'; -import { Button } from '@workspace/ui/components/button'; +import { Badge } from '@workspace/airo-ui/components/badge'; +import { Button } from '@workspace/airo-ui/components/button'; import { Card, CardContent, CardDescription, CardHeader, CardTitle, -} from '@workspace/ui/components/card'; -import { Separator } from '@workspace/ui/components/separator'; -import { Icon } from '@workspace/ui/custom-components/icon'; -import { formatDate } from '@workspace/ui/utils'; +} from '@workspace/airo-ui/components/card'; +import { Separator } from '@workspace/airo-ui/components/separator'; +import { Icon } from '@workspace/airo-ui/custom-components/icon'; +import { formatDate } from '@workspace/airo-ui/utils'; import { useCountDown } from 'ahooks'; import { addMinutes, format } from 'date-fns'; import { useTranslations } from 'next-intl'; diff --git a/apps/user/app/(main)/(content)/(user)/profile/change-password.tsx b/apps/user/app/(main)/(content)/(user)/profile/change-password.tsx index 683854f..24d1b25 100644 --- a/apps/user/app/(main)/(content)/(user)/profile/change-password.tsx +++ b/apps/user/app/(main)/(content)/(user)/profile/change-password.tsx @@ -2,10 +2,16 @@ import { updateUserPassword } from '@/services/user/user'; import { zodResolver } from '@hookform/resolvers/zod'; -import { Button } from '@workspace/ui/components/button'; -import { Card } from '@workspace/ui/components/card'; -import { Form, FormControl, FormField, FormItem, FormMessage } from '@workspace/ui/components/form'; -import { Input } from '@workspace/ui/components/input'; +import { Button } from '@workspace/airo-ui/components/button'; +import { Card } from '@workspace/airo-ui/components/card'; +import { + Form, + FormControl, + FormField, + FormItem, + FormMessage, +} from '@workspace/airo-ui/components/form'; +import { Input } from '@workspace/airo-ui/components/input'; import { useTranslations } from 'next-intl'; import { useForm } from 'react-hook-form'; import { toast } from 'sonner'; diff --git a/apps/user/app/(main)/(content)/(user)/profile/notify-settings.tsx b/apps/user/app/(main)/(content)/(user)/profile/notify-settings.tsx index 9fc4a17..b03aaee 100644 --- a/apps/user/app/(main)/(content)/(user)/profile/notify-settings.tsx +++ b/apps/user/app/(main)/(content)/(user)/profile/notify-settings.tsx @@ -3,10 +3,16 @@ import useGlobalStore from '@/config/use-global'; import { updateUserNotify } from '@/services/user/user'; import { zodResolver } from '@hookform/resolvers/zod'; -import { Button } from '@workspace/ui/components/button'; -import { Card } from '@workspace/ui/components/card'; -import { Form, FormControl, FormField, FormItem, FormLabel } from '@workspace/ui/components/form'; -import { Switch } from '@workspace/ui/components/switch'; +import { Button } from '@workspace/airo-ui/components/button'; +import { Card } from '@workspace/airo-ui/components/card'; +import { + Form, + FormControl, + FormField, + FormItem, + FormLabel, +} from '@workspace/airo-ui/components/form'; +import { Switch } from '@workspace/airo-ui/components/switch'; import { useTranslations } from 'next-intl'; import { useForm } from 'react-hook-form'; import { toast } from 'sonner'; diff --git a/apps/user/app/(main)/(content)/(user)/profile/third-party-accounts.tsx b/apps/user/app/(main)/(content)/(user)/profile/third-party-accounts.tsx index e1e644d..429ecd0 100644 --- a/apps/user/app/(main)/(content)/(user)/profile/third-party-accounts.tsx +++ b/apps/user/app/(main)/(content)/(user)/profile/third-party-accounts.tsx @@ -4,18 +4,24 @@ import SendCode from '@/app/auth/send-code'; import useGlobalStore from '@/config/use-global'; import { bindOAuth, unbindOAuth, updateBindEmail, updateBindMobile } from '@/services/user/user'; import { zodResolver } from '@hookform/resolvers/zod'; -import { Button } from '@workspace/ui/components/button'; -import { Card } from '@workspace/ui/components/card'; +import { Button } from '@workspace/airo-ui/components/button'; +import { Card } from '@workspace/airo-ui/components/card'; import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger, -} from '@workspace/ui/components/dialog'; -import { Form, FormControl, FormField, FormItem, FormMessage } from '@workspace/ui/components/form'; -import { Input } from '@workspace/ui/components/input'; -import { AreaCodeSelect } from '@workspace/ui/custom-components/area-code-select'; +} from '@workspace/airo-ui/components/dialog'; +import { + Form, + FormControl, + FormField, + FormItem, + FormMessage, +} from '@workspace/airo-ui/components/form'; +import { Input } from '@workspace/airo-ui/components/input'; +import { AreaCodeSelect } from '@workspace/airo-ui/custom-components/area-code-select'; import { useTranslations } from 'next-intl'; import { useState } from 'react'; import { useForm } from 'react-hook-form'; diff --git a/apps/user/app/(main)/(content)/(user)/sidebar-right.tsx b/apps/user/app/(main)/(content)/(user)/sidebar-right.tsx deleted file mode 100644 index d2c643b..0000000 --- a/apps/user/app/(main)/(content)/(user)/sidebar-right.tsx +++ /dev/null @@ -1,85 +0,0 @@ -'use client'; - -import { Display } from '@/components/display'; -import Recharge from '@/components/subscribe/recharge'; -import useGlobalStore from '@/config/use-global'; -import { Button } from '@workspace/ui/components/button'; -import { Card, CardContent, CardHeader, CardTitle } from '@workspace/ui/components/card'; -import { Sidebar, SidebarContent } from '@workspace/ui/components/sidebar'; -import { - Tooltip, - TooltipContent, - TooltipProvider, - TooltipTrigger, -} from '@workspace/ui/components/tooltip'; -import { Icon } from '@workspace/ui/custom-components/icon'; -import { isBrowser } from '@workspace/ui/utils'; -import { useTranslations } from 'next-intl'; -import CopyToClipboard from 'react-copy-to-clipboard'; -import { toast } from 'sonner'; - -export function SidebarRight({ ...props }: React.ComponentProps) { - const { user } = useGlobalStore(); - const t = useTranslations('layout'); - - return ( - - - - - {t('accountBalance')} - - - - - - - - - {t('giftAmount')} - - - - - - - - {t('commission')} - - - - - - {user?.refer_code && ( - - - {t('inviteCode')} - - - - - { - if (result) { - toast.success(t('copySuccess')); - } - }} - > - - - - - {t('copyInviteLink')} - - - - {user?.refer_code} - - )} - - - ); -} diff --git a/apps/user/app/(main)/(content)/(user)/subscribe/page.tsx b/apps/user/app/(main)/(content)/(user)/subscribe/page.tsx index 585d580..ccb227d 100644 --- a/apps/user/app/(main)/(content)/(user)/subscribe/page.tsx +++ b/apps/user/app/(main)/(content)/(user)/subscribe/page.tsx @@ -2,7 +2,7 @@ import { querySubscribeList } from '@/services/user/subscribe'; import { useQuery } from '@tanstack/react-query'; -import { Tabs, TabsList, TabsTrigger } from '@workspace/ui/components/tabs'; +import { Tabs, TabsList, TabsTrigger } from '@workspace/airo-ui/components/tabs'; import { useTranslations } from 'next-intl'; import { useMemo, useRef, useState } from 'react'; @@ -10,7 +10,7 @@ import { LoginDialogProvider } from '@/app/auth/LoginDialogContext'; import { TabContent } from '@/components/main/OfferDialog/TabContent'; import { ProcessedPlanData } from '@/components/main/OfferDialog/types'; import Purchase from '@/components/subscribe/purchase'; -import { unitConversion } from '@workspace/ui/utils'; +import { unitConversion } from '@workspace/airo-ui/utils'; export default function Page() { const t = useTranslations('subscribe'); diff --git a/apps/user/app/(main)/(content)/(user)/ticket/page.tsx b/apps/user/app/(main)/(content)/(user)/ticket/page.tsx index 80fbf42..8c92ad4 100644 --- a/apps/user/app/(main)/(content)/(user)/ticket/page.tsx +++ b/apps/user/app/(main)/(content)/(user)/ticket/page.tsx @@ -10,7 +10,7 @@ import { updateUserTicketStatus, } from '@/services/user/ticket'; import { useQuery } from '@tanstack/react-query'; -import { Button } from '@workspace/ui/components/button'; +import { Button } from '@workspace/airo-ui/components/button'; import { Card, CardContent, @@ -18,7 +18,7 @@ import { CardFooter, CardHeader, CardTitle, -} from '@workspace/ui/components/card'; +} from '@workspace/airo-ui/components/card'; import { Dialog, DialogContent, @@ -27,7 +27,7 @@ import { DialogHeader, DialogTitle, DialogTrigger, -} from '@workspace/ui/components/dialog'; +} from '@workspace/airo-ui/components/dialog'; import { Drawer, DrawerContent, @@ -35,15 +35,15 @@ import { DrawerFooter, DrawerHeader, DrawerTitle, -} from '@workspace/ui/components/drawer'; -import { Input } from '@workspace/ui/components/input'; -import { Label } from '@workspace/ui/components/label'; -import { ScrollArea } from '@workspace/ui/components/scroll-area'; -import { Textarea } from '@workspace/ui/components/textarea'; -import { ConfirmButton } from '@workspace/ui/custom-components/confirm-button'; -import { Icon } from '@workspace/ui/custom-components/icon'; -import { cn } from '@workspace/ui/lib/utils'; -import { formatDate } from '@workspace/ui/utils'; +} from '@workspace/airo-ui/components/drawer'; +import { Input } from '@workspace/airo-ui/components/input'; +import { Label } from '@workspace/airo-ui/components/label'; +import { ScrollArea } from '@workspace/airo-ui/components/scroll-area'; +import { Textarea } from '@workspace/airo-ui/components/textarea'; +import { ConfirmButton } from '@workspace/airo-ui/custom-components/confirm-button'; +import { Icon } from '@workspace/airo-ui/custom-components/icon'; +import { cn } from '@workspace/airo-ui/lib/utils'; +import { formatDate } from '@workspace/airo-ui/utils'; import { useTranslations } from 'next-intl'; import NextImage from 'next/legacy/image'; import { useEffect, useRef, useState } from 'react'; diff --git a/apps/user/app/(main)/(content)/(user)/wallet/page.tsx b/apps/user/app/(main)/(content)/(user)/wallet/page.tsx index f201474..54eec4e 100644 --- a/apps/user/app/(main)/(content)/(user)/wallet/page.tsx +++ b/apps/user/app/(main)/(content)/(user)/wallet/page.tsx @@ -4,15 +4,15 @@ import { Display } from '@/components/display'; import { ProList, ProListActions } from '@/components/pro-list'; import useGlobalStore from '@/config/use-global'; import { queryUserBalanceLog } from '@/services/user/user'; -import { Card, CardContent } from '@workspace/ui/components/card'; +import { Card, CardContent } from '@workspace/airo-ui/components/card'; import { useTranslations } from 'next-intl'; import { useRef } from 'react'; import { Empty } from '@/components/empty'; import Recharge from '@/components/subscribe/recharge'; import SvgIcon from '@/components/SvgIcon'; -import { Button } from '@workspace/ui/components/button'; -import { formatDate } from '@workspace/ui/utils'; +import { Button } from '@workspace/airo-ui/components/button'; +import { formatDate } from '@workspace/airo-ui/utils'; import Link from 'next/link'; import { CopyToClipboard } from 'react-copy-to-clipboard'; import { toast } from 'sonner'; diff --git a/apps/user/app/(main)/(content)/privacy-policy/page.tsx b/apps/user/app/(main)/(content)/privacy-policy/page.tsx index c65fe91..451ee41 100644 --- a/apps/user/app/(main)/(content)/privacy-policy/page.tsx +++ b/apps/user/app/(main)/(content)/privacy-policy/page.tsx @@ -1,5 +1,5 @@ import { getPrivacyPolicy } from '@/services/common/common'; -import { Markdown } from '@workspace/ui/custom-components/markdown'; +import { Markdown } from '@workspace/airo-ui/custom-components/markdown'; export default async function Page() { const { data } = await getPrivacyPolicy(); diff --git a/apps/user/app/(main)/(content)/purchasing/content.tsx b/apps/user/app/(main)/(content)/purchasing/content.tsx index c7fefe5..18d30dc 100644 --- a/apps/user/app/(main)/(content)/purchasing/content.tsx +++ b/apps/user/app/(main)/(content)/purchasing/content.tsx @@ -8,12 +8,12 @@ import PaymentMethods from '@/components/subscribe/payment-methods'; import useGlobalStore from '@/config/use-global'; import { prePurchaseOrder, purchase } from '@/services/user/portal'; import { useQuery } from '@tanstack/react-query'; -import { Button } from '@workspace/ui/components/button'; -import { Card, CardContent, CardHeader } from '@workspace/ui/components/card'; -import { Separator } from '@workspace/ui/components/separator'; -import { EnhancedInput } from '@workspace/ui/custom-components/enhanced-input'; -import { Icon } from '@workspace/ui/custom-components/icon'; -import { cn } from '@workspace/ui/lib/utils'; +import { Button } from '@workspace/airo-ui/components/button'; +import { Card, CardContent, CardHeader } from '@workspace/airo-ui/components/card'; +import { Separator } from '@workspace/airo-ui/components/separator'; +import { EnhancedInput } from '@workspace/airo-ui/custom-components/enhanced-input'; +import { Icon } from '@workspace/airo-ui/custom-components/icon'; +import { cn } from '@workspace/airo-ui/lib/utils'; import { LoaderCircle } from 'lucide-react'; import { useTranslations } from 'next-intl'; import { useRouter } from 'next/navigation'; diff --git a/apps/user/app/(main)/(content)/purchasing/order/page.tsx b/apps/user/app/(main)/(content)/purchasing/order/page.tsx index d4e1d9e..c99d0ed 100644 --- a/apps/user/app/(main)/(content)/purchasing/order/page.tsx +++ b/apps/user/app/(main)/(content)/purchasing/order/page.tsx @@ -8,18 +8,18 @@ import useGlobalStore from '@/config/use-global'; import { purchaseCheckout, queryPurchaseOrder } from '@/services/user/portal'; import { setAuthorization } from '@/utils/common'; import { useQuery } from '@tanstack/react-query'; -import { Badge } from '@workspace/ui/components/badge'; -import { Button } from '@workspace/ui/components/button'; +import { Badge } from '@workspace/airo-ui/components/badge'; +import { Button } from '@workspace/airo-ui/components/button'; import { Card, CardContent, CardDescription, CardHeader, CardTitle, -} from '@workspace/ui/components/card'; -import { Separator } from '@workspace/ui/components/separator'; -import { Icon } from '@workspace/ui/custom-components/icon'; -import { formatDate } from '@workspace/ui/utils'; +} from '@workspace/airo-ui/components/card'; +import { Separator } from '@workspace/airo-ui/components/separator'; +import { Icon } from '@workspace/airo-ui/custom-components/icon'; +import { formatDate } from '@workspace/airo-ui/utils'; import { useCountDown } from 'ahooks'; import { addMinutes, format } from 'date-fns'; import { useTranslations } from 'next-intl'; diff --git a/apps/user/app/(main)/(content)/tos/page.tsx b/apps/user/app/(main)/(content)/tos/page.tsx index c95cfd8..c59801f 100644 --- a/apps/user/app/(main)/(content)/tos/page.tsx +++ b/apps/user/app/(main)/(content)/tos/page.tsx @@ -1,5 +1,5 @@ import { getTos } from '@/services/common/common'; -import { Markdown } from '@workspace/ui/custom-components/markdown'; +import { Markdown } from '@workspace/airo-ui/custom-components/markdown'; export default async function Page() { const { data } = await getTos(); diff --git a/apps/user/app/auth/LoginDialogContext.tsx b/apps/user/app/auth/LoginDialogContext.tsx index d5610b2..17d9f9c 100644 --- a/apps/user/app/auth/LoginDialogContext.tsx +++ b/apps/user/app/auth/LoginDialogContext.tsx @@ -1,7 +1,7 @@ 'use client'; import EmailAuthForm from '@/app/auth/email/auth-form'; import CloseSvg from '@/components/CustomIcon/icons/close.svg'; -import { Dialog, DialogContent, DialogTitle } from '@workspace/ui/components/dialog'; +import { Dialog, DialogContent, DialogTitle } from '@workspace/airo-ui/components/dialog'; import Image from 'next/image'; import { createContext, diff --git a/apps/user/app/auth/auth-page.tsx b/apps/user/app/auth/auth-page.tsx index 5864082..8c04b97 100644 --- a/apps/user/app/auth/auth-page.tsx +++ b/apps/user/app/auth/auth-page.tsx @@ -5,8 +5,8 @@ import LanguageSwitch from '@/components/language-switch'; import ThemeSwitch from '@/components/theme-switch'; import useGlobalStore from '@/config/use-global'; import { DotLottieReact } from '@lottiefiles/dotlottie-react'; -import { Tabs, TabsContent, TabsList, TabsTrigger } from '@workspace/ui/components/tabs'; -import LoginLottie from '@workspace/ui/lotties/login.json'; +import { Tabs, TabsContent, TabsList, TabsTrigger } from '@workspace/airo-ui/components/tabs'; +import LoginLottie from '@workspace/airo-ui/lotties/login.json'; import { useTranslations } from 'next-intl'; import Image from 'next/legacy/image'; import Link from 'next/link'; diff --git a/apps/user/app/auth/email/login-form.tsx b/apps/user/app/auth/email/login-form.tsx index 6de6495..187e034 100644 --- a/apps/user/app/auth/email/login-form.tsx +++ b/apps/user/app/auth/email/login-form.tsx @@ -1,9 +1,15 @@ import useGlobalStore from '@/config/use-global'; import { zodResolver } from '@hookform/resolvers/zod'; -import { Button } from '@workspace/ui/components/button'; -import { Form, FormControl, FormField, FormItem, FormMessage } from '@workspace/ui/components/form'; -import { Input } from '@workspace/ui/components/input'; -import { Icon } from '@workspace/ui/custom-components/icon'; +import { Button } from '@workspace/airo-ui/components/button'; +import { + Form, + FormControl, + FormField, + FormItem, + FormMessage, +} from '@workspace/airo-ui/components/form'; +import { Input } from '@workspace/airo-ui/components/input'; +import { Icon } from '@workspace/airo-ui/custom-components/icon'; import { useTranslations } from 'next-intl'; import { Dispatch, SetStateAction, useRef } from 'react'; import { useForm } from 'react-hook-form'; diff --git a/apps/user/app/auth/email/register-form.tsx b/apps/user/app/auth/email/register-form.tsx index f747e99..5058c5a 100644 --- a/apps/user/app/auth/email/register-form.tsx +++ b/apps/user/app/auth/email/register-form.tsx @@ -1,10 +1,16 @@ import useGlobalStore from '@/config/use-global'; import { zodResolver } from '@hookform/resolvers/zod'; -import { Button } from '@workspace/ui/components/button'; -import { Form, FormControl, FormField, FormItem, FormMessage } from '@workspace/ui/components/form'; -import { Input } from '@workspace/ui/components/input'; -import { Icon } from '@workspace/ui/custom-components/icon'; -import { Markdown } from '@workspace/ui/custom-components/markdown'; +import { Button } from '@workspace/airo-ui/components/button'; +import { + Form, + FormControl, + FormField, + FormItem, + FormMessage, +} from '@workspace/airo-ui/components/form'; +import { Input } from '@workspace/airo-ui/components/input'; +import { Icon } from '@workspace/airo-ui/custom-components/icon'; +import { Markdown } from '@workspace/airo-ui/custom-components/markdown'; import { useTranslations } from 'next-intl'; import { Dispatch, SetStateAction, useRef } from 'react'; import { useForm } from 'react-hook-form'; diff --git a/apps/user/app/auth/email/reset-form.tsx b/apps/user/app/auth/email/reset-form.tsx index 687e5e9..f97e703 100644 --- a/apps/user/app/auth/email/reset-form.tsx +++ b/apps/user/app/auth/email/reset-form.tsx @@ -1,9 +1,15 @@ import useGlobalStore from '@/config/use-global'; import { zodResolver } from '@hookform/resolvers/zod'; -import { Button } from '@workspace/ui/components/button'; -import { Form, FormControl, FormField, FormItem, FormMessage } from '@workspace/ui/components/form'; -import { Input } from '@workspace/ui/components/input'; -import { Icon } from '@workspace/ui/custom-components/icon'; +import { Button } from '@workspace/airo-ui/components/button'; +import { + Form, + FormControl, + FormField, + FormItem, + FormMessage, +} from '@workspace/airo-ui/components/form'; +import { Input } from '@workspace/airo-ui/components/input'; +import { Icon } from '@workspace/airo-ui/custom-components/icon'; import { useTranslations } from 'next-intl'; import { Dispatch, SetStateAction, useRef } from 'react'; import { useForm } from 'react-hook-form'; diff --git a/apps/user/app/auth/phone/login-form.tsx b/apps/user/app/auth/phone/login-form.tsx index f040c1f..7e6162e 100644 --- a/apps/user/app/auth/phone/login-form.tsx +++ b/apps/user/app/auth/phone/login-form.tsx @@ -1,10 +1,16 @@ import useGlobalStore from '@/config/use-global'; import { zodResolver } from '@hookform/resolvers/zod'; -import { Button } from '@workspace/ui/components/button'; -import { Form, FormControl, FormField, FormItem, FormMessage } from '@workspace/ui/components/form'; -import { Input } from '@workspace/ui/components/input'; -import { AreaCodeSelect } from '@workspace/ui/custom-components/area-code-select'; -import { Icon } from '@workspace/ui/custom-components/icon'; +import { Button } from '@workspace/airo-ui/components/button'; +import { + Form, + FormControl, + FormField, + FormItem, + FormMessage, +} from '@workspace/airo-ui/components/form'; +import { Input } from '@workspace/airo-ui/components/input'; +import { AreaCodeSelect } from '@workspace/airo-ui/custom-components/area-code-select'; +import { Icon } from '@workspace/airo-ui/custom-components/icon'; import { useTranslations } from 'next-intl'; import { Dispatch, SetStateAction, useRef, useState } from 'react'; diff --git a/apps/user/app/auth/phone/register-form.tsx b/apps/user/app/auth/phone/register-form.tsx index b2d1f75..3f2e73a 100644 --- a/apps/user/app/auth/phone/register-form.tsx +++ b/apps/user/app/auth/phone/register-form.tsx @@ -1,11 +1,17 @@ import useGlobalStore from '@/config/use-global'; import { zodResolver } from '@hookform/resolvers/zod'; -import { Button } from '@workspace/ui/components/button'; -import { Form, FormControl, FormField, FormItem, FormMessage } from '@workspace/ui/components/form'; -import { Input } from '@workspace/ui/components/input'; -import { AreaCodeSelect } from '@workspace/ui/custom-components/area-code-select'; -import { Icon } from '@workspace/ui/custom-components/icon'; -import { Markdown } from '@workspace/ui/custom-components/markdown'; +import { Button } from '@workspace/airo-ui/components/button'; +import { + Form, + FormControl, + FormField, + FormItem, + FormMessage, +} from '@workspace/airo-ui/components/form'; +import { Input } from '@workspace/airo-ui/components/input'; +import { AreaCodeSelect } from '@workspace/airo-ui/custom-components/area-code-select'; +import { Icon } from '@workspace/airo-ui/custom-components/icon'; +import { Markdown } from '@workspace/airo-ui/custom-components/markdown'; import { useTranslations } from 'next-intl'; import { Dispatch, SetStateAction, useRef } from 'react'; import { useForm } from 'react-hook-form'; diff --git a/apps/user/app/auth/phone/reset-form.tsx b/apps/user/app/auth/phone/reset-form.tsx index aa95f16..ae5bfb9 100644 --- a/apps/user/app/auth/phone/reset-form.tsx +++ b/apps/user/app/auth/phone/reset-form.tsx @@ -1,10 +1,16 @@ import useGlobalStore from '@/config/use-global'; import { zodResolver } from '@hookform/resolvers/zod'; -import { Button } from '@workspace/ui/components/button'; -import { Form, FormControl, FormField, FormItem, FormMessage } from '@workspace/ui/components/form'; -import { Input } from '@workspace/ui/components/input'; -import { AreaCodeSelect } from '@workspace/ui/custom-components/area-code-select'; -import { Icon } from '@workspace/ui/custom-components/icon'; +import { Button } from '@workspace/airo-ui/components/button'; +import { + Form, + FormControl, + FormField, + FormItem, + FormMessage, +} from '@workspace/airo-ui/components/form'; +import { Input } from '@workspace/airo-ui/components/input'; +import { AreaCodeSelect } from '@workspace/airo-ui/custom-components/area-code-select'; +import { Icon } from '@workspace/airo-ui/custom-components/icon'; import { useTranslations } from 'next-intl'; import { Dispatch, SetStateAction, useRef, useState } from 'react'; import { useForm } from 'react-hook-form'; diff --git a/apps/user/app/auth/send-code.tsx b/apps/user/app/auth/send-code.tsx index fcdf987..faa4cfe 100644 --- a/apps/user/app/auth/send-code.tsx +++ b/apps/user/app/auth/send-code.tsx @@ -2,7 +2,7 @@ import useGlobalStore from '@/config/use-global'; import { sendEmailCode, sendSmsCode } from '@/services/common/common'; -import { Button } from '@workspace/ui/components/button'; +import { Button } from '@workspace/airo-ui/components/button'; import { useCountDown } from 'ahooks'; import { useTranslations } from 'next-intl'; import { useEffect, useState } from 'react'; diff --git a/apps/user/app/layout.tsx b/apps/user/app/layout.tsx index ed0effb..5d69984 100644 --- a/apps/user/app/layout.tsx +++ b/apps/user/app/layout.tsx @@ -1,9 +1,9 @@ import Providers from '@/components/providers'; import { getGlobalConfig } from '@/services/common/common'; import { queryUserInfo } from '@/services/user/user'; -import { Toaster } from '@workspace/ui/components/sonner'; -import '@workspace/ui/globals.css'; -import { getLangDir } from '@workspace/ui/hooks/use-lang-dir'; +import { Toaster } from '@workspace/airo-ui/components/sonner'; +import '@workspace/airo-ui/globals.css'; +import { getLangDir } from '@workspace/airo-ui/hooks/use-lang-dir'; import { NextIntlClientProvider } from 'next-intl'; import { getLocale, getMessages } from 'next-intl/server'; import { PublicEnvScript } from 'next-runtime-env'; diff --git a/apps/user/components.json b/apps/user/components.json index 15702d6..a67ab62 100644 --- a/apps/user/components.json +++ b/apps/user/components.json @@ -4,8 +4,8 @@ "components": "@/components", "hooks": "@/hooks", "lib": "@/lib", - "utils": "@workspace/ui/lib/utils", - "ui": "@workspace/ui/components" + "utils": "@workspace/airo-ui/lib/utils", + "ui": "@workspace/airo-ui/components" }, "iconLibrary": "lucide", "rsc": true, diff --git a/apps/user/components/Header/Header.tsx b/apps/user/components/Header/Header.tsx index 9f15834..72961b3 100644 --- a/apps/user/components/Header/Header.tsx +++ b/apps/user/components/Header/Header.tsx @@ -1,8 +1,8 @@ 'use client'; import useGlobalStore from '@/config/use-global'; -import { buttonVariants } from '@workspace/ui/components/button'; -import { cn } from '@workspace/ui/lib/utils'; +import { buttonVariants } from '@workspace/airo-ui/components/button'; +import { cn } from '@workspace/airo-ui/lib/utils'; import { useTranslations } from 'next-intl'; import Image from 'next/legacy/image'; import Link from 'next/link'; diff --git a/apps/user/components/affiliate/components/AffiliateDialog.tsx b/apps/user/components/affiliate/components/AffiliateDialog.tsx index 159c919..746832e 100644 --- a/apps/user/components/affiliate/components/AffiliateDialog.tsx +++ b/apps/user/components/affiliate/components/AffiliateDialog.tsx @@ -8,8 +8,8 @@ import { DialogHeader, DialogTitle, } from '@workspace/airo-ui/components/dialog'; -import { ProList } from '@workspace/ui/custom-components/pro-list/pro-list'; -import { formatDate } from '@workspace/ui/utils'; +import { ProList } from '@workspace/airo-ui/custom-components/pro-list/pro-list'; +import { formatDate } from '@workspace/airo-ui/utils'; import { useTranslations } from 'next-intl'; import { useImperativeHandle, useState } from 'react'; diff --git a/apps/user/components/affiliate/index.tsx b/apps/user/components/affiliate/index.tsx index af52e42..7fb60b0 100644 --- a/apps/user/components/affiliate/index.tsx +++ b/apps/user/components/affiliate/index.tsx @@ -10,10 +10,10 @@ import SvgIcon from '@/components/SvgIcon'; import useGlobalStore from '@/config/use-global'; import { queryUserAffiliate, queryUserAffiliateList } from '@/services/user/user'; import { useQuery } from '@tanstack/react-query'; -import { Button } from '@workspace/ui/components/button'; -import { Card, CardContent } from '@workspace/ui/components/card'; -import { Input } from '@workspace/ui/components/input'; -import { formatDate } from '@workspace/ui/utils'; +import { Button } from '@workspace/airo-ui/components/button'; +import { Card, CardContent } from '@workspace/airo-ui/components/card'; +import { Input } from '@workspace/airo-ui/components/input'; +import { formatDate } from '@workspace/airo-ui/utils'; import { useTranslations } from 'next-intl'; import { useRef, useState } from 'react'; import { CopyToClipboard } from 'react-copy-to-clipboard'; diff --git a/apps/user/components/announcement/index.tsx b/apps/user/components/announcement/index.tsx index 720b56d..b6ae406 100644 --- a/apps/user/components/announcement/index.tsx +++ b/apps/user/components/announcement/index.tsx @@ -5,7 +5,7 @@ import { DialogHeader, DialogTitle, } from '@workspace/airo-ui/components/dialog'; -import { Markdown } from '@workspace/ui/custom-components/markdown'; +import { Markdown } from '@workspace/airo-ui/custom-components/markdown'; import { getTranslations } from 'next-intl/server'; export default async function Announcement({ diff --git a/apps/user/components/auth/oauth-methods.tsx b/apps/user/components/auth/oauth-methods.tsx index c805e65..436fb3c 100644 --- a/apps/user/components/auth/oauth-methods.tsx +++ b/apps/user/components/auth/oauth-methods.tsx @@ -2,8 +2,8 @@ import useGlobalStore from '@/config/use-global'; import { oAuthLogin } from '@/services/common/oauth'; -import { Button } from '@workspace/ui/components/button'; -import { Icon } from '@workspace/ui/custom-components/icon'; +import { Button } from '@workspace/airo-ui/components/button'; +import { Icon } from '@workspace/airo-ui/custom-components/icon'; const icons = { apple: 'uil:apple', diff --git a/apps/user/components/display.tsx b/apps/user/components/display.tsx index e744596..2e419be 100644 --- a/apps/user/components/display.tsx +++ b/apps/user/components/display.tsx @@ -1,7 +1,7 @@ 'use client'; import useGlobalStore from '@/config/use-global'; -import { formatBytes, unitConversion } from '@workspace/ui/utils'; +import { formatBytes, unitConversion } from '@workspace/airo-ui/utils'; import { useTranslations } from 'next-intl'; type DisplayType = 'currency' | 'traffic' | 'number' | 'trafficSpeed'; diff --git a/apps/user/components/empty.tsx b/apps/user/components/empty.tsx index 6cf250f..08f3a19 100644 --- a/apps/user/components/empty.tsx +++ b/apps/user/components/empty.tsx @@ -1,6 +1,6 @@ 'use client'; -import { default as _Empty } from '@workspace/ui/custom-components/empty'; +import { default as _Empty } from '@workspace/airo-ui/custom-components/empty'; import { useTranslations } from 'next-intl'; import { useEffect, useState } from 'react'; diff --git a/apps/user/components/footer.tsx b/apps/user/components/footer.tsx index 09be8a0..b67a034 100644 --- a/apps/user/components/footer.tsx +++ b/apps/user/components/footer.tsx @@ -10,8 +10,8 @@ import { NEXT_PUBLIC_TWITTER_LINK, } from '@/config/constants'; import useGlobalStore from '@/config/use-global'; -import { Separator } from '@workspace/ui/components/separator'; -import { Icon } from '@workspace/ui/custom-components/icon'; +import { Separator } from '@workspace/airo-ui/components/separator'; +import { Icon } from '@workspace/airo-ui/custom-components/icon'; import { useTranslations } from 'next-intl'; import Link from 'next/link'; import { Fragment } from 'react'; diff --git a/apps/user/components/language-switch.tsx b/apps/user/components/language-switch.tsx index 493636d..6549cc4 100644 --- a/apps/user/components/language-switch.tsx +++ b/apps/user/components/language-switch.tsx @@ -8,9 +8,9 @@ import { SelectItem, SelectTrigger, SelectValue, -} from '@workspace/ui/components/select'; -import { Icon } from '@workspace/ui/custom-components/icon'; -import { getCountry } from '@workspace/ui/utils'; +} from '@workspace/airo-ui/components/select'; +import { Icon } from '@workspace/airo-ui/custom-components/icon'; +import { getCountry } from '@workspace/airo-ui/utils'; import { useLocale } from 'next-intl'; import { useRouter } from 'next/navigation'; diff --git a/apps/user/components/main/HomeContent.tsx b/apps/user/components/main/HomeContent.tsx index 721666e..dbbd38a 100644 --- a/apps/user/components/main/HomeContent.tsx +++ b/apps/user/components/main/HomeContent.tsx @@ -1,6 +1,6 @@ 'use client'; -import { Button } from '@workspace/ui/components/button'; +import { Button } from '@workspace/airo-ui/components/button'; import { useRef } from 'react'; import OfferDialog, { OfferDialogRef } from './OfferDialog/index'; diff --git a/apps/user/components/main/OfferDialog/index.tsx b/apps/user/components/main/OfferDialog/index.tsx index 325ccb5..180174c 100644 --- a/apps/user/components/main/OfferDialog/index.tsx +++ b/apps/user/components/main/OfferDialog/index.tsx @@ -1,10 +1,10 @@ import CloseSvg from '@/components/CustomIcon/icons/close.svg'; import { getSubscription } from '@/services/user/portal'; import { useQuery } from '@tanstack/react-query'; -import { Dialog, DialogContent, DialogTitle } from '@workspace/ui/components/dialog'; -import { ScrollArea } from '@workspace/ui/components/scroll-area'; -import { Tabs, TabsList, TabsTrigger } from '@workspace/ui/components/tabs'; -import { unitConversion } from '@workspace/ui/utils'; +import { Dialog, DialogContent, DialogTitle } from '@workspace/airo-ui/components/dialog'; +import { ScrollArea } from '@workspace/airo-ui/components/scroll-area'; +import { Tabs, TabsList, TabsTrigger } from '@workspace/airo-ui/components/tabs'; +import { unitConversion } from '@workspace/airo-ui/utils'; import Image from 'next/image'; import { forwardRef, diff --git a/apps/user/components/main/global-map.tsx b/apps/user/components/main/global-map.tsx index 05c8a3a..1308b56 100644 --- a/apps/user/components/main/global-map.tsx +++ b/apps/user/components/main/global-map.tsx @@ -1,7 +1,7 @@ 'use client'; import { DotLottieReact } from '@lottiefiles/dotlottie-react'; -import GlobalMapLottie from '@workspace/ui/lotties/global-map.json'; +import GlobalMapLottie from '@workspace/airo-ui/lotties/global-map.json'; import { motion } from 'framer-motion'; import { useTranslations } from 'next-intl'; diff --git a/apps/user/components/main/hero.tsx b/apps/user/components/main/hero.tsx index 7ab7bf4..628081b 100644 --- a/apps/user/components/main/hero.tsx +++ b/apps/user/components/main/hero.tsx @@ -2,9 +2,9 @@ import useGlobalStore from '@/config/use-global'; import { DotLottieReact } from '@lottiefiles/dotlottie-react'; -import { HoverBorderGradient } from '@workspace/ui/components/hover-border-gradient'; -import { TextGenerateEffect } from '@workspace/ui/components/text-generate-effect'; -import NetworkSecurityLottie from '@workspace/ui/lotties/network-security.json'; +import { HoverBorderGradient } from '@workspace/airo-ui/components/hover-border-gradient'; +import { TextGenerateEffect } from '@workspace/airo-ui/components/text-generate-effect'; +import NetworkSecurityLottie from '@workspace/airo-ui/lotties/network-security.json'; import { motion } from 'framer-motion'; import { useTranslations } from 'next-intl'; import Link from 'next/link'; diff --git a/apps/user/components/main/product-showcase/content.tsx b/apps/user/components/main/product-showcase/content.tsx index 0258059..6a5dc9f 100644 --- a/apps/user/components/main/product-showcase/content.tsx +++ b/apps/user/components/main/product-showcase/content.tsx @@ -3,11 +3,11 @@ import { Display } from '@/components/display'; import { SubscribeDetail } from '@/components/subscribe/detail'; import useGlobalStore from '@/config/use-global'; -import { Button } from '@workspace/ui/components/button'; -import { Card, CardContent, CardFooter, CardHeader } from '@workspace/ui/components/card'; -import { Separator } from '@workspace/ui/components/separator'; -import { Icon } from '@workspace/ui/custom-components/icon'; -import { cn } from '@workspace/ui/lib/utils'; +import { Button } from '@workspace/airo-ui/components/button'; +import { Card, CardContent, CardFooter, CardHeader } from '@workspace/airo-ui/components/card'; +import { Separator } from '@workspace/airo-ui/components/separator'; +import { Icon } from '@workspace/airo-ui/custom-components/icon'; +import { cn } from '@workspace/airo-ui/lib/utils'; import { motion } from 'framer-motion'; import { useTranslations } from 'next-intl'; import Link from 'next/link'; diff --git a/apps/user/components/main/stats.tsx b/apps/user/components/main/stats.tsx index e71f899..20cb9d6 100644 --- a/apps/user/components/main/stats.tsx +++ b/apps/user/components/main/stats.tsx @@ -6,9 +6,9 @@ import { NEXT_PUBLIC_HOME_USER_COUNT, } from '@/config/constants'; import { DotLottieReact } from '@lottiefiles/dotlottie-react'; -import LocationsLittie from '@workspace/ui/lotties/locations.json'; -import ServersLottie from '@workspace/ui/lotties/servers.json'; -import UsersLottie from '@workspace/ui/lotties/users.json'; +import LocationsLittie from '@workspace/airo-ui/lotties/locations.json'; +import ServersLottie from '@workspace/airo-ui/lotties/servers.json'; +import UsersLottie from '@workspace/airo-ui/lotties/users.json'; import { motion } from 'framer-motion'; import { useTranslations } from 'next-intl'; import { useEffect, useState } from 'react'; diff --git a/apps/user/components/payment/stripe.tsx b/apps/user/components/payment/stripe.tsx index 99028be..7ef016a 100644 --- a/apps/user/components/payment/stripe.tsx +++ b/apps/user/components/payment/stripe.tsx @@ -12,9 +12,9 @@ import { StripeCardNumberElementOptions, StripeElementStyle, } from '@stripe/stripe-js'; -import { Button } from '@workspace/ui/components/button'; -import { Input } from '@workspace/ui/components/input'; -import { Label } from '@workspace/ui/components/label'; +import { Button } from '@workspace/airo-ui/components/button'; +import { Input } from '@workspace/airo-ui/components/input'; +import { Label } from '@workspace/airo-ui/components/label'; import { CheckCircle } from 'lucide-react'; import { useTranslations } from 'next-intl'; import { useTheme } from 'next-themes'; diff --git a/apps/user/components/subscribe/billing.tsx b/apps/user/components/subscribe/billing.tsx index b35564a..788438a 100644 --- a/apps/user/components/subscribe/billing.tsx +++ b/apps/user/components/subscribe/billing.tsx @@ -1,7 +1,7 @@ 'use client'; import { Display } from '@/components/display'; -import { Separator } from '@workspace/ui/components/separator'; +import { Separator } from '@workspace/airo-ui/components/separator'; import { useTranslations } from 'next-intl'; interface SubscribeBillingProps { diff --git a/apps/user/components/subscribe/coupon-input.tsx b/apps/user/components/subscribe/coupon-input.tsx index fe8fa62..3d925cf 100644 --- a/apps/user/components/subscribe/coupon-input.tsx +++ b/apps/user/components/subscribe/coupon-input.tsx @@ -1,6 +1,6 @@ 'use client'; -import { Input } from '@workspace/ui/components/input'; +import { Input } from '@workspace/airo-ui/components/input'; import { useTranslations } from 'next-intl'; import React from 'react'; diff --git a/apps/user/components/subscribe/duration-selector.tsx b/apps/user/components/subscribe/duration-selector.tsx index 666d9c6..33b8333 100644 --- a/apps/user/components/subscribe/duration-selector.tsx +++ b/apps/user/components/subscribe/duration-selector.tsx @@ -1,8 +1,8 @@ 'use client'; -import { Badge } from '@workspace/ui/components/badge'; -import { Label } from '@workspace/ui/components/label'; -import { RadioGroup, RadioGroupItem } from '@workspace/ui/components/radio-group'; +import { Badge } from '@workspace/airo-ui/components/badge'; +import { Label } from '@workspace/airo-ui/components/label'; +import { RadioGroup, RadioGroupItem } from '@workspace/airo-ui/components/radio-group'; import { useTranslations } from 'next-intl'; import React, { useCallback } from 'react'; diff --git a/apps/user/components/subscribe/payment-methods.tsx b/apps/user/components/subscribe/payment-methods.tsx index 840a846..d486ed7 100644 --- a/apps/user/components/subscribe/payment-methods.tsx +++ b/apps/user/components/subscribe/payment-methods.tsx @@ -2,9 +2,9 @@ import { getAvailablePaymentMethods } from '@/services/user/portal'; import { useQuery } from '@tanstack/react-query'; -import { Label } from '@workspace/ui/components/label'; -import { RadioGroup, RadioGroupItem } from '@workspace/ui/components/radio-group'; -import { cn } from '@workspace/ui/lib/utils'; +import { Label } from '@workspace/airo-ui/components/label'; +import { RadioGroup, RadioGroupItem } from '@workspace/airo-ui/components/radio-group'; +import { cn } from '@workspace/airo-ui/lib/utils'; import { useTranslations } from 'next-intl'; import Image from 'next/image'; import React, { memo } from 'react'; diff --git a/apps/user/components/subscribe/purchase.tsx b/apps/user/components/subscribe/purchase.tsx index 3e37c2d..616d017 100644 --- a/apps/user/components/subscribe/purchase.tsx +++ b/apps/user/components/subscribe/purchase.tsx @@ -3,15 +3,15 @@ import useGlobalStore from '@/config/use-global'; import { preCreateOrder, purchase } from '@/services/user/order'; import { useQuery } from '@tanstack/react-query'; +import { Button } from '@workspace/airo-ui/components/button'; import { Dialog, DialogContent, DialogHeader, DialogTitle, } from '@workspace/airo-ui/components/dialog'; -import { Button } from '@workspace/ui/components/button'; -import { Separator } from '@workspace/ui/components/separator'; -import { Tabs, TabsList, TabsTrigger } from '@workspace/ui/components/tabs'; +import { Separator } from '@workspace/airo-ui/components/separator'; +import { Tabs, TabsList, TabsTrigger } from '@workspace/airo-ui/components/tabs'; import { LoaderCircle } from 'lucide-react'; import { useTranslations } from 'next-intl'; import { useRouter } from 'next/navigation'; diff --git a/apps/user/components/subscribe/recharge.tsx b/apps/user/components/subscribe/recharge.tsx index 890623d..c5c12af 100644 --- a/apps/user/components/subscribe/recharge.tsx +++ b/apps/user/components/subscribe/recharge.tsx @@ -2,7 +2,7 @@ import useGlobalStore from '@/config/use-global'; import { recharge } from '@/services/user/order'; -import { Button, ButtonProps } from '@workspace/ui/components/button'; +import { Button, ButtonProps } from '@workspace/airo-ui/components/button'; import { Dialog, DialogContent, @@ -10,9 +10,9 @@ import { DialogHeader, DialogTitle, DialogTrigger, -} from '@workspace/ui/components/dialog'; -import { EnhancedInput } from '@workspace/ui/custom-components/enhanced-input'; -import { unitConversion } from '@workspace/ui/utils'; +} from '@workspace/airo-ui/components/dialog'; +import { EnhancedInput } from '@workspace/airo-ui/custom-components/enhanced-input'; +import { unitConversion } from '@workspace/airo-ui/utils'; import { LoaderCircle } from 'lucide-react'; import { useTranslations } from 'next-intl'; import { useRouter } from 'next/navigation'; diff --git a/apps/user/components/subscribe/renewal.tsx b/apps/user/components/subscribe/renewal.tsx index af45768..72b9318 100644 --- a/apps/user/components/subscribe/renewal.tsx +++ b/apps/user/components/subscribe/renewal.tsx @@ -6,16 +6,16 @@ import PaymentMethods from '@/components/subscribe/payment-methods'; import useGlobalStore from '@/config/use-global'; import { preCreateOrder, renewal } from '@/services/user/order'; import { useQuery } from '@tanstack/react-query'; -import { Button } from '@workspace/ui/components/button'; -import { Card, CardContent } from '@workspace/ui/components/card'; +import { Button } from '@workspace/airo-ui/components/button'; +import { Card, CardContent } from '@workspace/airo-ui/components/card'; import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger, -} from '@workspace/ui/components/dialog'; -import { Separator } from '@workspace/ui/components/separator'; +} from '@workspace/airo-ui/components/dialog'; +import { Separator } from '@workspace/airo-ui/components/separator'; import { LoaderCircle } from 'lucide-react'; import { useTranslations } from 'next-intl'; import { useRouter } from 'next/navigation'; diff --git a/apps/user/components/subscribe/reset-traffic.tsx b/apps/user/components/subscribe/reset-traffic.tsx index 2ccc375..b6cab06 100644 --- a/apps/user/components/subscribe/reset-traffic.tsx +++ b/apps/user/components/subscribe/reset-traffic.tsx @@ -3,7 +3,7 @@ import { Display } from '@/components/display'; import useGlobalStore from '@/config/use-global'; import { resetTraffic } from '@/services/user/order'; -import { Button } from '@workspace/ui/components/button'; +import { Button } from '@workspace/airo-ui/components/button'; import { Dialog, DialogContent, @@ -11,7 +11,7 @@ import { DialogHeader, DialogTitle, DialogTrigger, -} from '@workspace/ui/components/dialog'; +} from '@workspace/airo-ui/components/dialog'; import { LoaderCircle } from 'lucide-react'; import { useTranslations } from 'next-intl'; import { useRouter } from 'next/navigation'; diff --git a/apps/user/components/subscribe/unsubscribe.tsx b/apps/user/components/subscribe/unsubscribe.tsx index 4c11a17..e52cbdc 100644 --- a/apps/user/components/subscribe/unsubscribe.tsx +++ b/apps/user/components/subscribe/unsubscribe.tsx @@ -3,7 +3,7 @@ import useGlobalStore from '@/config/use-global'; import { preUnsubscribe, unsubscribe } from '@/services/user/user'; import { useQuery } from '@tanstack/react-query'; -import { Button } from '@workspace/ui/components/button'; +import { Button } from '@workspace/airo-ui/components/button'; import { Dialog, DialogContent, @@ -12,7 +12,7 @@ import { DialogHeader, DialogTitle, DialogTrigger, -} from '@workspace/ui/components/dialog'; +} from '@workspace/airo-ui/components/dialog'; import { useTranslations } from 'next-intl'; import { useRouter } from 'next/navigation'; import { useState } from 'react'; diff --git a/apps/user/components/theme-switch.tsx b/apps/user/components/theme-switch.tsx index b91be18..382ad6c 100644 --- a/apps/user/components/theme-switch.tsx +++ b/apps/user/components/theme-switch.tsx @@ -1,15 +1,15 @@ 'use client'; import { DotLottieReact } from '@lottiefiles/dotlottie-react'; -import { Button } from '@workspace/ui/components/button'; +import { Button } from '@workspace/airo-ui/components/button'; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, -} from '@workspace/ui/components/dropdown-menu'; -import MoonLottie from '@workspace/ui/lotties/moon.json'; -import SunLottie from '@workspace/ui/lotties/sun.json'; +} from '@workspace/airo-ui/components/dropdown-menu'; +import MoonLottie from '@workspace/airo-ui/lotties/moon.json'; +import SunLottie from '@workspace/airo-ui/lotties/sun.json'; import { useTheme } from 'next-themes'; export default function ThemeSwitch() { diff --git a/apps/user/components/user-nav.tsx b/apps/user/components/user-nav.tsx index 0ecc6e8..0c7b273 100644 --- a/apps/user/components/user-nav.tsx +++ b/apps/user/components/user-nav.tsx @@ -3,16 +3,15 @@ import SvgIcon from '@/components/SvgIcon.tsx'; import useGlobalStore from '@/config/use-global'; import { Logout } from '@/utils/common'; -import { useSidebar } from '@workspace/airo-ui/components/sidebar'; -import { useIsMobile } from '@workspace/airo-ui/hooks/use-mobile'; -import { Avatar, AvatarFallback, AvatarImage } from '@workspace/ui/components/avatar'; +import { Avatar, AvatarFallback, AvatarImage } from '@workspace/airo-ui/components/avatar'; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, -} from '@workspace/ui/components/dropdown-menu'; -import { Icon } from '@workspace/ui/custom-components/icon'; +} from '@workspace/airo-ui/components/dropdown-menu'; +import { Icon } from '@workspace/airo-ui/custom-components/icon'; +import { useIsMobile } from '@workspace/airo-ui/hooks/use-mobile'; import { useTranslations } from 'next-intl'; import { usePathname, useRouter } from 'next/navigation'; @@ -21,7 +20,7 @@ export function UserNav({ from = '' }: { from?: string }) { const { user, setUser } = useGlobalStore(); const router = useRouter(); const pathname = usePathname(); - const { toggleSidebar } = useSidebar(); + // const { toggleSidebar } = useSidebar(); const isMobile = useIsMobile(); if (user) { return ( @@ -98,7 +97,7 @@ export function UserNav({ from = '' }: { from?: string }) { data-active={pathname === item.url} onClick={() => { if (pathname === item.url) return; - toggleSidebar(); + /* toggleSidebar();*/ router.push(`${item.url}`); }} className='flex cursor-pointer items-center gap-3 rounded-full bg-white px-5 py-2 text-base font-medium focus:bg-[#0F2C53] focus:text-white data-[active=true]:bg-[#0F2C53] data-[active=true]:text-white md:text-xl' diff --git a/apps/user/config/use-global.tsx b/apps/user/config/use-global.tsx index 4033ab7..8f425db 100644 --- a/apps/user/config/use-global.tsx +++ b/apps/user/config/use-global.tsx @@ -1,6 +1,6 @@ import { NEXT_PUBLIC_API_URL, NEXT_PUBLIC_SITE_URL } from '@/config/constants'; import { queryUserInfo } from '@/services/user/user'; -import { extractDomain } from '@workspace/ui/utils'; +import { extractDomain } from '@workspace/airo-ui/utils'; import { create } from 'zustand'; export interface GlobalStore { diff --git a/apps/user/eslint.config.mjs b/apps/user/eslint.config.js similarity index 100% rename from apps/user/eslint.config.mjs rename to apps/user/eslint.config.js diff --git a/apps/user/next.config.ts b/apps/user/next.config.ts index f706d08..f7eb808 100644 --- a/apps/user/next.config.ts +++ b/apps/user/next.config.ts @@ -4,7 +4,7 @@ import createNextIntlPlugin from 'next-intl/plugin'; const withNextIntl = createNextIntlPlugin('./locales/request.ts'); const nextConfig: NextConfig = { - transpilePackages: ['@workspace/ui', '@workspace/airo-ui'], + transpilePackages: ['@workspace/airo-ui'], output: 'standalone', typescript: { ignoreBuildErrors: true, // 禁用 TypeScript 构建时的类型检查 diff --git a/apps/user/package.json b/apps/user/package.json index 4f63573..1642520 100644 --- a/apps/user/package.json +++ b/apps/user/package.json @@ -18,7 +18,6 @@ "@tanstack/react-query": "^5.63.0", "@tanstack/react-query-next-experimental": "^5.63.0", "@workspace/airo-ui": "workspace:*", - "@workspace/ui": "workspace:*", "ahooks": "^3.8.4", "axios": "^1.7.9", "framer-motion": "^11.16.1", diff --git a/apps/user/postcss.config.mjs b/apps/user/postcss.config.mjs index 00b6e2f..c1ac4a8 100644 --- a/apps/user/postcss.config.mjs +++ b/apps/user/postcss.config.mjs @@ -1 +1 @@ -export { default } from '@workspace/ui/postcss.config'; +export { default } from '@workspace/airo-ui/postcss.config'; diff --git a/apps/user/tailwind.config.ts b/apps/user/tailwind.config.ts index f1cc3a1..89aa5e4 100644 --- a/apps/user/tailwind.config.ts +++ b/apps/user/tailwind.config.ts @@ -1,4 +1,4 @@ -import baseConfig from '@workspace/ui/tailwind.config'; +import baseConfig from '@workspace/airo-ui/tailwind.config'; const config = { ...baseConfig, diff --git a/apps/user/tsconfig.json b/apps/user/tsconfig.json index f4f4e1d..4c8dece 100644 --- a/apps/user/tsconfig.json +++ b/apps/user/tsconfig.json @@ -3,7 +3,6 @@ "baseUrl": ".", "paths": { "@/*": ["./*"], - "@workspace/ui/*": ["../../packages/ui/src/*"], "@workspace/airo-ui/*": ["../../packages/airo-ui/src/*"] }, "plugins": [ diff --git a/apps/user/utils/common.ts b/apps/user/utils/common.ts index 12cb748..5f46fb2 100644 --- a/apps/user/utils/common.ts +++ b/apps/user/utils/common.ts @@ -1,5 +1,5 @@ import { locales, NEXT_PUBLIC_DEFAULT_LANGUAGE } from '@/config/constants'; -import { isBrowser } from '@workspace/ui/utils'; +import { isBrowser } from '@workspace/airo-ui/utils'; import { UAParser } from 'ua-parser-js'; import Cookies from 'universal-cookie'; diff --git a/apps/user/utils/request.ts b/apps/user/utils/request.ts index 32db125..da2486e 100644 --- a/apps/user/utils/request.ts +++ b/apps/user/utils/request.ts @@ -1,6 +1,6 @@ import { NEXT_PUBLIC_API_URL, NEXT_PUBLIC_SITE_URL } from '@/config/constants'; import { getTranslations } from '@/locales/utils'; -import { isBrowser } from '@workspace/ui/utils'; +import { isBrowser } from '@workspace/airo-ui/utils'; import axios, { InternalAxiosRequestConfig } from 'axios'; import { toast } from 'sonner'; import { getAuthorization, Logout } from './common'; diff --git a/packages/airo-ui/src/components/sidebar.tsx b/packages/airo-ui/src/components/sidebar.tsx index eb9fdcb..092d18a 100644 --- a/packages/airo-ui/src/components/sidebar.tsx +++ b/packages/airo-ui/src/components/sidebar.tsx @@ -16,7 +16,7 @@ import { TooltipProvider, TooltipTrigger, } from '@workspace/airo-ui/components/tooltip'; -import { useIsMobile } from '@workspace/airo-ui/hooks/use-mobile'; +import { useIsMobile } from '@workspace/airo-ui/hooks/use-mobile.tsx'; import { cn } from '@workspace/airo-ui/lib/utils'; const SIDEBAR_COOKIE_NAME = 'sidebar:state'; @@ -53,7 +53,7 @@ function useSidebar() { const context = React.useContext(SidebarContext); // Optionally warn in development when using the safe fallback if (process.env.NODE_ENV !== 'production' && context === SAFE_SIDEBAR_CONTEXT) { - // console.warn('useSidebar is used outside of a SidebarProvider. Falling back to no-op context.'); + console.warn('useSidebar is used outside of a SidebarProvider. Falling back to no-op context.'); } return context; }