refactor: migrate from @rkheftan/harmony-ui to @harmony/kit

This commit is contained in:
2026-06-11 19:39:15 +03:30
parent 1d4f9adfc0
commit 74c8db6d01
44 changed files with 2343 additions and 2015 deletions

4268
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -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",

View File

@@ -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';

View File

@@ -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 {

View File

@@ -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';

View File

@@ -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';

View File

@@ -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';

View File

@@ -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';

View File

@@ -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) =>

View File

@@ -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';

View File

@@ -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;

View File

@@ -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,

View File

@@ -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';

View File

@@ -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';

View File

@@ -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';

View File

@@ -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,

View File

@@ -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';

View File

@@ -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';

View File

@@ -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';

View File

@@ -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';

View File

@@ -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) {

View File

@@ -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';

View File

@@ -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({

View File

@@ -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({

View File

@@ -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';

View File

@@ -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');

View File

@@ -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 {

View File

@@ -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';

View File

@@ -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() {

View File

@@ -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({

View File

@@ -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() {

View File

@@ -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() {

View File

@@ -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';

View File

@@ -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() {

View File

@@ -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;

View File

@@ -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';

View File

@@ -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';

View File

@@ -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';

View File

@@ -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) {

View File

@@ -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';

View File

@@ -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() {

View File

@@ -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';

View File

@@ -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';

View File

@@ -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 }> = ({