refactor: migrate from @rkheftan/harmony-ui to @harmony/kit
This commit is contained in:
4268
package-lock.json
generated
4268
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -18,10 +18,10 @@
|
||||
"@mui/stylis-plugin-rtl": "^7.2.0",
|
||||
"@mui/x-data-grid-premium": "^8.10.0",
|
||||
"@mui/x-date-pickers": "^8.10.0",
|
||||
"@rkheftan/harmony-ui": "^0.2.89",
|
||||
"@harmony/kit": "^0.10.3",
|
||||
"axios": "^1.11.0",
|
||||
"date-fns": "^4.1.0",
|
||||
"date-fns-jalali": "^4.0.0-0",
|
||||
"date-fns-jalali": "^3.2.0-0",
|
||||
"dayjs": "^1.11.13",
|
||||
"i18next": "^25.3.0",
|
||||
"i18next-browser-languagedetector": "^8.2.0",
|
||||
|
||||
@@ -14,7 +14,7 @@ import ReactCountryFlag from 'react-country-flag';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { countries, type Country } from '../data/countries';
|
||||
import type { CountryCode } from '@/types/commonTypes';
|
||||
import { Icon } from '@rkheftan/harmony-ui';
|
||||
import { Icon } from '@harmony/kit';
|
||||
import { LTRTypography } from '@/components/common/LTRTypography';
|
||||
import { Virtuoso } from 'react-virtuoso';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { ToggleButtonGroup, ToggleButton, Box } from '@mui/material';
|
||||
import { Sun1, Moon } from 'iconsax-react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Icon } from '@rkheftan/harmony-ui';
|
||||
import { Icon } from '@harmony/kit';
|
||||
import { type MouseEvent } from 'react';
|
||||
|
||||
enum ThemeMode {
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
MenuItem,
|
||||
Typography,
|
||||
} from '@mui/material';
|
||||
import { Icon } from '@rkheftan/harmony-ui';
|
||||
import { Icon } from '@harmony/kit';
|
||||
import { Logout, More } from 'iconsax-react';
|
||||
import { LTRTypography } from '../common/LTRTypography';
|
||||
import { useState } from 'react';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { SideNav } from '@rkheftan/harmony-ui';
|
||||
import { SideNav } from '@harmony/kit';
|
||||
import { buildNavItems } from './buildNavItems';
|
||||
import { appRoutes } from '@/routes/config';
|
||||
import { Outlet, useLocation } from 'react-router-dom';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Menu, Stack, Typography, Box, Button } from '@mui/material';
|
||||
import { blue } from '@mui/material/colors';
|
||||
import { Icon } from '@rkheftan/harmony-ui';
|
||||
import { Icon } from '@harmony/kit';
|
||||
import { ArrowLeft, ArrowRight } from 'iconsax-react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { productsData } from '@/data/products';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Box, IconButton, Toolbar as MuiToolbar } from '@mui/material';
|
||||
import { Icon } from '@rkheftan/harmony-ui';
|
||||
import { Icon } from '@harmony/kit';
|
||||
import { HambergerMenu, Menu } from 'iconsax-react';
|
||||
import { useState, type Dispatch, type SetStateAction } from 'react';
|
||||
import type { UserInfo } from '@/contexts/AuthContext';
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { type RouteConfig } from '@/routes/config';
|
||||
import { Icon, type NavItemConfig } from '@rkheftan/harmony-ui';
|
||||
import { Icon, type NavItemConfig } from '@harmony/kit';
|
||||
import type { Icon as Iconsax } from 'iconsax-react';
|
||||
|
||||
const getIcon = (icon?: Iconsax) => (isSelected: boolean) =>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useToast, type ToastOptions } from '@rkheftan/harmony-ui';
|
||||
import { useToast, type ToastOptions } from '@harmony/kit';
|
||||
import { useEffect } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Navigate } from 'react-router-dom';
|
||||
|
||||
@@ -8,7 +8,7 @@ import { sendSmsCodeCompleteUserInforamation } from '../../api/authorizationAPI'
|
||||
import type { CountryCode } from '@/types/commonTypes';
|
||||
import { useApi } from '@/hooks/useApi';
|
||||
import { replacePersianWithRealNumbers } from '@/utils/replacePersianWithRealNumbers';
|
||||
import { useToast } from '@rkheftan/harmony-ui';
|
||||
import { useToast } from '@harmony/kit';
|
||||
|
||||
export interface CompleteSignUpProps {
|
||||
email: string;
|
||||
|
||||
@@ -19,7 +19,7 @@ import {
|
||||
sendSmsOtp,
|
||||
} from '../../api/authorizationAPI';
|
||||
import type { LoginResult, PasswordLoginRequest } from '../../types/userTypes';
|
||||
import { Icon, useToast } from '@rkheftan/harmony-ui';
|
||||
import { Icon, useToast } from '@harmony/kit';
|
||||
import { useApi } from '@/hooks/useApi';
|
||||
import {
|
||||
generateTokenWithPassword,
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
} from '../../api/identityAPI';
|
||||
import { loginOrSignUpWithGoogle } from '../../api/authorizationAPI';
|
||||
import { useApi } from '@/hooks/useApi';
|
||||
import { Icon, useToast } from '@rkheftan/harmony-ui';
|
||||
import { Icon, useToast } from '@harmony/kit';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Box, Button } from '@mui/material';
|
||||
import { Google } from 'iconsax-react';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Box, Typography, MenuItem, Select, Stack } from '@mui/material';
|
||||
import { Icon } from '@rkheftan/harmony-ui';
|
||||
import { Icon } from '@harmony/kit';
|
||||
import { Global } from 'iconsax-react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import type { LoginResult, UserStatus } from '../../types/userTypes';
|
||||
import { getUserStatusByPhoneNumberOrEmail } from '../../api/authorizationAPI';
|
||||
import type { CountryCode } from '@/types/commonTypes';
|
||||
import { isPhoneNumber } from '@/utils/regexes/isValidPhoneNumber';
|
||||
import { useToast } from '@rkheftan/harmony-ui';
|
||||
import { useToast } from '@harmony/kit';
|
||||
import { useApi } from '@/hooks/useApi';
|
||||
import type { GenerateTokenResponse } from '../../api/identityAPI';
|
||||
import { GoogleAuthenticationV2 } from './GoogleAuthenticationV2';
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
sendSmsOtp,
|
||||
} from '../../api/authorizationAPI';
|
||||
import type { CountryCode } from '@/types/commonTypes';
|
||||
import { Icon, useToast } from '@rkheftan/harmony-ui';
|
||||
import { Icon, useToast } from '@harmony/kit';
|
||||
import { useApi } from '@/hooks/useApi';
|
||||
import {
|
||||
generateTokenWithOtp,
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
sendSmsCodeCompleteUserInforamation,
|
||||
} from '../../api/authorizationAPI';
|
||||
import type { CountryCode } from '@/types/commonTypes';
|
||||
import { Icon, useToast } from '@rkheftan/harmony-ui';
|
||||
import { Icon, useToast } from '@harmony/kit';
|
||||
import { useApi } from '@/hooks/useApi';
|
||||
import { LTRTypography } from '@/components/common/LTRTypography';
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import type { ResetPasswordRequest } from '../../types/userTypes';
|
||||
import type { AuthType } from '../../types/authTypes';
|
||||
import type { CountryCode } from '@/types/commonTypes';
|
||||
import { resetPassword } from '../../api/authorizationAPI';
|
||||
import { Icon, useToast } from '@rkheftan/harmony-ui';
|
||||
import { Icon, useToast } from '@harmony/kit';
|
||||
import { useApi } from '@/hooks/useApi';
|
||||
import { LTRTypography } from '@/components/common/LTRTypography';
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import type { CountryCode } from '@/types/commonTypes';
|
||||
import { sendForgetPassCode } from '../../api/authorizationAPI';
|
||||
import type { SendForgetPassCodeRequest } from '../../types/userTypes';
|
||||
import { isPhoneNumber } from '@/utils/regexes/isValidPhoneNumber';
|
||||
import { useToast } from '@rkheftan/harmony-ui';
|
||||
import { useToast } from '@harmony/kit';
|
||||
import { useApi } from '@/hooks/useApi';
|
||||
import { replacePersianWithRealNumbers } from '@/utils/replacePersianWithRealNumbers';
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
confirmForgetPassCode,
|
||||
sendForgetPassCode,
|
||||
} from '../../api/authorizationAPI';
|
||||
import { Icon, useToast } from '@rkheftan/harmony-ui';
|
||||
import { Icon, useToast } from '@harmony/kit';
|
||||
import { useApi } from '@/hooks/useApi';
|
||||
import { LTRTypography } from '@/components/common/LTRTypography';
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import { format as formatJalali } from 'date-fns-jalali';
|
||||
import { format } from 'date-fns';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { type DateOfBirthProps } from '../../types/settingForm';
|
||||
import { Icon } from '@rkheftan/harmony-ui';
|
||||
import { Icon } from '@harmony/kit';
|
||||
import { Calendar } from 'iconsax-react';
|
||||
|
||||
export default function DateOfBirth({ value, onChange }: DateOfBirthProps) {
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
} from '@mui/material';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { TickCircle, Edit2 } from 'iconsax-react';
|
||||
import { Icon } from '@rkheftan/harmony-ui';
|
||||
import { Icon } from '@harmony/kit';
|
||||
import { type EmailSectionProps } from '../../types/settingForm';
|
||||
import { isNumeric } from '@/utils/regexes/isNumeric';
|
||||
import { sanitizeLocalNumber } from '@/utils/regexes/sanitizeNumber';
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { TickCircle, Eye, EyeSlash, CloseCircle } from 'iconsax-react';
|
||||
import { PasswordValidationItem } from './PasswordValidation';
|
||||
import { Icon } from '@rkheftan/harmony-ui';
|
||||
import { Icon } from '@harmony/kit';
|
||||
import { type PasswordSectionProps } from '../../types/settingForm';
|
||||
|
||||
export function PasswordSection({
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Box, Typography } from '@mui/material';
|
||||
import { TickCircle } from 'iconsax-react';
|
||||
import { Icon } from '@rkheftan/harmony-ui';
|
||||
import { Icon } from '@harmony/kit';
|
||||
import { type ValidationItemProps } from '../../types/settingForm';
|
||||
|
||||
export function PasswordValidationItem({
|
||||
|
||||
@@ -14,7 +14,7 @@ import { useTranslation } from 'react-i18next';
|
||||
import { Woman, Man } from 'iconsax-react';
|
||||
import DateOfBirth from './DateOfBirth';
|
||||
import { countries } from '@/data/countries';
|
||||
import { Icon } from '@rkheftan/harmony-ui';
|
||||
import { Icon } from '@harmony/kit';
|
||||
import { type PersonalInfoFieldsProps } from '../../types/settingForm';
|
||||
import { Gender } from '../../types/settingForm';
|
||||
import ReactCountryFlag from 'react-country-flag';
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { type SubmitProps } from '../../types/settingForm';
|
||||
import { CloseCircle } from 'iconsax-react';
|
||||
import { Icon } from '@rkheftan/harmony-ui';
|
||||
import { Icon } from '@harmony/kit';
|
||||
|
||||
export function SubmitSection({ loading }: SubmitProps) {
|
||||
const { t, i18n } = useTranslation('completionForm');
|
||||
|
||||
@@ -6,7 +6,7 @@ import { PersonalInfoFields } from '../components/UserCompletionForm/PersonalInf
|
||||
import { PasswordSection } from '../components/UserCompletionForm/PasswordSection';
|
||||
import { EmailSection } from '../components/UserCompletionForm/EmailSection';
|
||||
import { SubmitSection } from '../components/UserCompletionForm/SubmitSection';
|
||||
import { useToast } from '@rkheftan/harmony-ui';
|
||||
import { useToast } from '@harmony/kit';
|
||||
import { Gender } from '../types/settingForm';
|
||||
import { useApi } from '@/hooks/useApi';
|
||||
import {
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
InputAdornment,
|
||||
} from '@mui/material';
|
||||
import { CloseCircle, Eye, EyeSlash } from 'iconsax-react';
|
||||
import { Icon } from '@rkheftan/harmony-ui';
|
||||
import { Icon } from '@harmony/kit';
|
||||
import { type PasswordDialogProps } from '../../types/settingsType';
|
||||
import { PasswordValidationItem } from './PasswordValidation';
|
||||
import { useState } from 'react';
|
||||
|
||||
@@ -17,7 +17,7 @@ import { containsNumber } from '@/utils/regexes/containsNumber';
|
||||
import { least8Chars } from '@/utils/regexes/least8Chars';
|
||||
import { hasUpperAndLowerLetter } from '@/utils/regexes/hasUpperAndLowerLetter';
|
||||
import { containsSymbol } from '@/utils/regexes/containsSymbol';
|
||||
import { useToast } from '@rkheftan/harmony-ui';
|
||||
import { useToast } from '@harmony/kit';
|
||||
import { useProfile } from '../../hooks/useProfile';
|
||||
|
||||
export function PasswordSecurity() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Box, Typography } from '@mui/material';
|
||||
import { TickCircle } from 'iconsax-react';
|
||||
import { Icon } from '@rkheftan/harmony-ui';
|
||||
import { Icon } from '@harmony/kit';
|
||||
import { type ValidationItemProps } from '../../types/settingsType';
|
||||
|
||||
export function PasswordValidationItem({
|
||||
|
||||
@@ -11,7 +11,7 @@ import { CardContainer } from '@/components/CardContainer';
|
||||
import { PageWrapper } from '../PageWrapper';
|
||||
import type { LoginLog } from '../../types/settingsApiType';
|
||||
import { formatDate } from '@/utils/formatSessionDate';
|
||||
import { useToast } from '@rkheftan/harmony-ui';
|
||||
import { useToast } from '@harmony/kit';
|
||||
import { useProfile } from '../../hooks/useProfile';
|
||||
|
||||
export function RecentLogins() {
|
||||
|
||||
@@ -9,7 +9,7 @@ import { PageWrapper } from '../PageWrapper';
|
||||
import { useApi } from '@/hooks/useApi';
|
||||
import { Gender, type InfoRowData } from '../../types/settingsType';
|
||||
import { saveProfile } from '../../api/settingsApi';
|
||||
import { useToast } from '@rkheftan/harmony-ui';
|
||||
import { useToast } from '@harmony/kit';
|
||||
import { useProfile } from '../../hooks/useProfile';
|
||||
|
||||
export function PersonalInformation() {
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
changePhoneNumber,
|
||||
} from '../../api/settingsApi';
|
||||
import { type Phone } from '../../types/settingsType';
|
||||
import { useToast } from '@rkheftan/harmony-ui';
|
||||
import { useToast } from '@harmony/kit';
|
||||
import { useProfile } from '../../hooks/useProfile';
|
||||
import type { CountryCode } from '@/types/commonTypes';
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
changeEmail,
|
||||
} from '../../api/settingsApi';
|
||||
import { type EmailAccount } from '../../types/settingsType';
|
||||
import { useToast } from '@rkheftan/harmony-ui';
|
||||
import { useToast } from '@harmony/kit';
|
||||
import { useProfile } from '../../hooks/useProfile';
|
||||
|
||||
export function SocialMedia() {
|
||||
|
||||
@@ -2,7 +2,7 @@ import React, { useState } from 'react';
|
||||
import { Box, Avatar, Typography, Button, IconButton } from '@mui/material';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Camera, Trash } from 'iconsax-react';
|
||||
import { Icon } from '@rkheftan/harmony-ui';
|
||||
import { Icon } from '@harmony/kit';
|
||||
import { type ProfileImageProps } from '@/features/profile/types/settingsType';
|
||||
|
||||
const MAX_FILE_SIZE_MB = 10;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Box, Typography } from '@mui/material';
|
||||
import { Icon } from '@rkheftan/harmony-ui';
|
||||
import { Icon } from '@harmony/kit';
|
||||
import { Mobile } from 'iconsax-react';
|
||||
import { type PhoneDisplayProps } from '@/features/profile/types/settingsType';
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
} from '@mui/material';
|
||||
import { Edit2, TickCircle } from 'iconsax-react';
|
||||
import { CountDownTimer } from '@/components/CountDownTimer';
|
||||
import { Icon } from '@rkheftan/harmony-ui';
|
||||
import { Icon } from '@harmony/kit';
|
||||
import { type PhoneEditFormProps } from '@/features/profile/types/settingsType';
|
||||
import { useRef, type ChangeEvent } from 'react';
|
||||
import { Trans, useTranslation } from 'react-i18next';
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
} from '@mui/material';
|
||||
import { Edit2, TickCircle } from 'iconsax-react';
|
||||
import { CountDownTimer } from '@/components/CountDownTimer';
|
||||
import { Icon } from '@rkheftan/harmony-ui';
|
||||
import { Icon } from '@harmony/kit';
|
||||
import { useRef } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Box, Typography } from '@mui/material';
|
||||
import { Google, Sms } from 'iconsax-react';
|
||||
import { Icon } from '@rkheftan/harmony-ui';
|
||||
import { Icon } from '@harmony/kit';
|
||||
import { type SocialMediaListProps } from '@/features/profile/types/settingsType';
|
||||
|
||||
export default function SocialMediaList({ emailList }: SocialMediaListProps) {
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
ListItemText,
|
||||
} from '@mui/material';
|
||||
import { Message, Google, ArrowDown2 } from 'iconsax-react';
|
||||
import { Icon } from '@rkheftan/harmony-ui';
|
||||
import { Icon } from '@harmony/kit';
|
||||
|
||||
export type SocialChoice = 'email' | 'google';
|
||||
|
||||
|
||||
@@ -10,13 +10,13 @@ import { useTranslation } from 'react-i18next';
|
||||
import { DeviceMessage, Logout, Mobile } from 'iconsax-react';
|
||||
import { CardContainer } from '@/components/CardContainer';
|
||||
import { PageWrapper } from '../components/PageWrapper';
|
||||
import { Icon } from '@rkheftan/harmony-ui';
|
||||
import { Icon } from '@harmony/kit';
|
||||
import { deleteSessions } from '../api/settingsApi';
|
||||
import { type ApiSession } from '../types/settingsApiType';
|
||||
import { useApi } from '@/hooks/useApi';
|
||||
import { formatDate } from '@/utils/formatSessionDate';
|
||||
import { type Device } from '../types/settingsType';
|
||||
import { useToast } from '@rkheftan/harmony-ui';
|
||||
import { useToast } from '@harmony/kit';
|
||||
import { useProfile } from '../hooks/useProfile';
|
||||
|
||||
export function ActiveDevicesPage() {
|
||||
|
||||
@@ -12,7 +12,7 @@ import { CardContainer } from '@/components/CardContainer';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { ThemeToggleButton } from '@/components/ThemToggle';
|
||||
import { PageWrapper } from '../components/PageWrapper';
|
||||
import { Icon, useToast } from '@rkheftan/harmony-ui';
|
||||
import { Icon, useToast } from '@harmony/kit';
|
||||
import { Sun1, Moon, Calendar1 } from 'iconsax-react';
|
||||
import { useApi } from '@/hooks/useApi';
|
||||
import { saveSettings } from '../api/settingsApi';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// FIXME: all the responses should extend this interface
|
||||
// import type { ApiResponse } from '@/types/apiResponse';
|
||||
import { useToast } from '@rkheftan/harmony-ui';
|
||||
import { useToast } from '@harmony/kit';
|
||||
import type { AxiosError } from 'axios';
|
||||
import { useState, useEffect, useCallback } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
@@ -3,7 +3,7 @@ import { I18nextProvider } from 'react-i18next';
|
||||
import i18n from '@/config/i18n';
|
||||
import { CustomThemeProvider } from './CustomThemeProvider';
|
||||
import { RtlProvider } from './RtlProvider';
|
||||
import { ToastProvider } from '@rkheftan/harmony-ui';
|
||||
import { ToastProvider } from '@harmony/kit';
|
||||
import { AuthProvider } from './AuthProvider';
|
||||
|
||||
export const AppProviders: React.FC<{ children: React.ReactNode }> = ({
|
||||
|
||||
Reference in New Issue
Block a user