Skip to content

The open alternative to Salesforce, designed for AI.

Migrate twenty ui to jotai (#17900)

Charles Bochet310d13fd178d
diff --git a/packages/twenty-front/src/localization/states/dateLocaleState.ts b/packages/twenty-front/src/localization/states/dateLocaleState.ts
index 9f3ff452921..0eaf9af87ea 100644
--- a/packages/twenty-front/src/localization/states/dateLocaleState.ts
+++ b/packages/twenty-front/src/localization/states/dateLocaleState.ts
@@ -1,7 +1,7 @@
import { type Locale } from 'date-fns';
import { enUS } from 'date-fns/locale';
import { type APP_LOCALES } from 'twenty-shared/translations';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
type DateLocaleState = {
locale?: keyof typeof APP_LOCALES;
diff --git a/packages/twenty-front/src/modules/action-menu/actions/states/forceRegisteredActionsMapComponentState.ts b/packages/twenty-front/src/modules/action-menu/actions/states/forceRegisteredActionsMapComponentState.ts
index 46ebfedc075..76ece40fb7c 100644
--- a/packages/twenty-front/src/modules/action-menu/actions/states/forceRegisteredActionsMapComponentState.ts
+++ b/packages/twenty-front/src/modules/action-menu/actions/states/forceRegisteredActionsMapComponentState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const forceRegisteredActionsByKeyState = createState<
Record<string, boolean | undefined>
diff --git a/packages/twenty-front/src/modules/activities/emails/states/lastViewableEmailThreadIdState.ts b/packages/twenty-front/src/modules/activities/emails/states/lastViewableEmailThreadIdState.ts
index 23b183773e5..8990ecaf170 100644
--- a/packages/twenty-front/src/modules/activities/emails/states/lastViewableEmailThreadIdState.ts
+++ b/packages/twenty-front/src/modules/activities/emails/states/lastViewableEmailThreadIdState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const emailThreadIdWhenEmailThreadWasClosedState = createState<
string | null
>({
diff --git a/packages/twenty-front/src/modules/activities/states/activityTargetableEntityArrayState.ts b/packages/twenty-front/src/modules/activities/states/activityTargetableEntityArrayState.ts
index b53baf65369..f2c2112f034 100644
--- a/packages/twenty-front/src/modules/activities/states/activityTargetableEntityArrayState.ts
+++ b/packages/twenty-front/src/modules/activities/states/activityTargetableEntityArrayState.ts
@@ -1,5 +1,5 @@
import { type ActivityTargetableObject } from '@/activities/types/ActivityTargetableEntity';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const activityTargetableEntityArrayState = createState<
ActivityTargetableObject[]
diff --git a/packages/twenty-front/src/modules/activities/states/canCreateActivityState.ts b/packages/twenty-front/src/modules/activities/states/canCreateActivityState.ts
index 5098324d5bf..f10791e406c 100644
--- a/packages/twenty-front/src/modules/activities/states/canCreateActivityState.ts
+++ b/packages/twenty-front/src/modules/activities/states/canCreateActivityState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const canCreateActivityState = createState<boolean>({
key: 'canCreateActivityState',
defaultValue: false,
diff --git a/packages/twenty-front/src/modules/activities/states/isActivityInCreateModeState.ts b/packages/twenty-front/src/modules/activities/states/isActivityInCreateModeState.ts
index 33fcfdf0ecf..9a6849f31f7 100644
--- a/packages/twenty-front/src/modules/activities/states/isActivityInCreateModeState.ts
+++ b/packages/twenty-front/src/modules/activities/states/isActivityInCreateModeState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const isActivityInCreateModeState = createState<boolean>({
key: 'isActivityInCreateModeState',
defaultValue: false,
diff --git a/packages/twenty-front/src/modules/activities/states/isCreatingActivityInDBState.ts b/packages/twenty-front/src/modules/activities/states/isCreatingActivityInDBState.ts
index 3d818d85c0d..87ef641f460 100644
--- a/packages/twenty-front/src/modules/activities/states/isCreatingActivityInDBState.ts
+++ b/packages/twenty-front/src/modules/activities/states/isCreatingActivityInDBState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const isUpsertingActivityInDBState = createState<boolean>({
key: 'isUpsertingActivityInDBState',
defaultValue: false,
diff --git a/packages/twenty-front/src/modules/app/states/isAppEffectRedirectEnabledState.ts b/packages/twenty-front/src/modules/app/states/isAppEffectRedirectEnabledState.ts
index b931e89aa8c..13285908276 100644
--- a/packages/twenty-front/src/modules/app/states/isAppEffectRedirectEnabledState.ts
+++ b/packages/twenty-front/src/modules/app/states/isAppEffectRedirectEnabledState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const isAppEffectRedirectEnabledState = createState<boolean>({
key: 'isAppEffectRedirectEnabledState',
defaultValue: true,
diff --git a/packages/twenty-front/src/modules/app/states/verifyEmailRedirectPathState.ts b/packages/twenty-front/src/modules/app/states/verifyEmailRedirectPathState.ts
index 9cee32b0e04..2b368eb7915 100644
--- a/packages/twenty-front/src/modules/app/states/verifyEmailRedirectPathState.ts
+++ b/packages/twenty-front/src/modules/app/states/verifyEmailRedirectPathState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const verifyEmailRedirectPathState = createState<string | undefined>({
key: 'verifyEmailRedirectPathState',
diff --git a/packages/twenty-front/src/modules/auth/hooks/__tests__/useAuth.test.tsx b/packages/twenty-front/src/modules/auth/hooks/__tests__/useAuth.test.tsx
index 6a0bcacd7cc..91b59b15e02 100644
--- a/packages/twenty-front/src/modules/auth/hooks/__tests__/useAuth.test.tsx
+++ b/packages/twenty-front/src/modules/auth/hooks/__tests__/useAuth.test.tsx
@@ -20,7 +20,6 @@ import {
import { isMultiWorkspaceEnabledState } from '@/client-config/states/isMultiWorkspaceEnabledState';
import { SnackBarComponentInstanceContext } from '@/ui/feedback/snack-bar-manager/contexts/SnackBarComponentInstanceContext';
import { renderHook } from '@testing-library/react';
-import { iconsState } from 'twenty-ui/display';
import { SupportDriver } from '~/generated-metadata/graphql';
const redirectSpy = jest.fn();
@@ -159,7 +158,6 @@ describe('useAuth', () => {
const { result } = renderHook(
() => {
const client = useApolloClient();
- const icons = useRecoilValue(iconsState);
const workspaceAuthProviders = useRecoilValue(
workspaceAuthProvidersState,
);
@@ -175,7 +173,6 @@ describe('useAuth', () => {
...useAuth(),
client,
state: {
- icons,
workspaceAuthProviders,
billing,
isDeveloperDefaultSignInPrefilled,
@@ -200,7 +197,6 @@ describe('useAuth', () => {
const { state } = result.current;
- expect(state.icons).toEqual({});
expect(state.workspaceAuthProviders).toEqual(null);
expect(state.billing).toBeNull();
expect(state.isDeveloperDefaultSignInPrefilled).toBe(false);
diff --git a/packages/twenty-front/src/modules/auth/hooks/useAuth.ts b/packages/twenty-front/src/modules/auth/hooks/useAuth.ts
index 6517ae5823e..ef240f7f9f7 100644
--- a/packages/twenty-front/src/modules/auth/hooks/useAuth.ts
+++ b/packages/twenty-front/src/modules/auth/hooks/useAuth.ts
@@ -67,7 +67,6 @@ import { i18n } from '@lingui/core';
import { useNavigate, useSearchParams } from 'react-router-dom';
import { SOURCE_LOCALE } from 'twenty-shared/translations';
import { isDefined } from 'twenty-shared/utils';
-import { iconsState } from 'twenty-ui/display';
import { cookieStorage } from '~/utils/cookie-storage';
import { getWorkspaceUrl } from '~/utils/getWorkspaceUrl';
@@ -132,7 +131,6 @@ export const useAuth = () => {
const emptySnapshot = snapshot_UNSTABLE();
- const iconsValue = snapshot.getLoadable(iconsState).getValue();
const authProvidersValue = snapshot
.getLoadable(workspaceAuthProvidersState)
.getValue();
@@ -164,7 +162,6 @@ export const useAuth = () => {
.getValue();
const initialSnapshot = emptySnapshot.map(({ set }) => {
- set(iconsState, iconsValue);
set(workspaceAuthProvidersState, authProvidersValue);
set(billingState, billing);
set(
diff --git a/packages/twenty-front/src/modules/auth/states/availableWorkspacesState.ts b/packages/twenty-front/src/modules/auth/states/availableWorkspacesState.ts
index 0d17f2a47d9..121ad19952c 100644
--- a/packages/twenty-front/src/modules/auth/states/availableWorkspacesState.ts
+++ b/packages/twenty-front/src/modules/auth/states/availableWorkspacesState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
import { type AvailableWorkspaces } from '~/generated-metadata/graphql';
export const availableWorkspacesState = createState<AvailableWorkspaces>({
diff --git a/packages/twenty-front/src/modules/auth/states/billingCheckoutSessionState.ts b/packages/twenty-front/src/modules/auth/states/billingCheckoutSessionState.ts
index 4d17a92e966..dae2a13e79b 100644
--- a/packages/twenty-front/src/modules/auth/states/billingCheckoutSessionState.ts
+++ b/packages/twenty-front/src/modules/auth/states/billingCheckoutSessionState.ts
@@ -1,6 +1,6 @@
import { type BillingCheckoutSession } from '@/auth/types/billingCheckoutSession.type';
import { BILLING_CHECKOUT_SESSION_DEFAULT_VALUE } from '@/billing/constants/BillingCheckoutSessionDefaultValue';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const billingCheckoutSessionState = createState<BillingCheckoutSession>({
key: 'billingCheckoutSessionState',
diff --git a/packages/twenty-front/src/modules/auth/states/currentUserState.ts b/packages/twenty-front/src/modules/auth/states/currentUserState.ts
index 2f7dd33de16..e4fa9d07509 100644
--- a/packages/twenty-front/src/modules/auth/states/currentUserState.ts
+++ b/packages/twenty-front/src/modules/auth/states/currentUserState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
import { type User } from '~/generated-metadata/graphql';
export type CurrentUser = Pick<
diff --git a/packages/twenty-front/src/modules/auth/states/currentUserWorkspaceState.ts b/packages/twenty-front/src/modules/auth/states/currentUserWorkspaceState.ts
index 954640a4166..a35aac2e084 100644
--- a/packages/twenty-front/src/modules/auth/states/currentUserWorkspaceState.ts
+++ b/packages/twenty-front/src/modules/auth/states/currentUserWorkspaceState.ts
@@ -1,5 +1,5 @@
import { type ObjectPermissions } from 'twenty-shared/types';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
import { type UserWorkspace } from '~/generated-metadata/graphql';
export type CurrentUserWorkspace = Pick<
diff --git a/packages/twenty-front/src/modules/auth/states/currentWorkspaceDeletedMembersState.ts b/packages/twenty-front/src/modules/auth/states/currentWorkspaceDeletedMembersState.ts
index 5bb30e426ea..fbb11f438f7 100644
--- a/packages/twenty-front/src/modules/auth/states/currentWorkspaceDeletedMembersState.ts
+++ b/packages/twenty-front/src/modules/auth/states/currentWorkspaceDeletedMembersState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
import { type DeletedWorkspaceMember } from '~/generated-metadata/graphql';
export const currentWorkspaceDeletedMembersState = createState<
diff --git a/packages/twenty-front/src/modules/auth/states/currentWorkspaceMemberState.ts b/packages/twenty-front/src/modules/auth/states/currentWorkspaceMemberState.ts
index bc29ac2a00e..9c61bed5f28 100644
--- a/packages/twenty-front/src/modules/auth/states/currentWorkspaceMemberState.ts
+++ b/packages/twenty-front/src/modules/auth/states/currentWorkspaceMemberState.ts
@@ -1,5 +1,5 @@
import { type WorkspaceMember } from '@/workspace-member/types/WorkspaceMember';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export type CurrentWorkspaceMember = Omit<
WorkspaceMember,
diff --git a/packages/twenty-front/src/modules/auth/states/currentWorkspaceMembersState.ts b/packages/twenty-front/src/modules/auth/states/currentWorkspaceMembersState.ts
index 627ee18f8a7..00a773d4f56 100644
--- a/packages/twenty-front/src/modules/auth/states/currentWorkspaceMembersState.ts
+++ b/packages/twenty-front/src/modules/auth/states/currentWorkspaceMembersState.ts
@@ -1,5 +1,5 @@
import { type PartialWorkspaceMember } from '@/settings/roles/types/RoleWithPartialMembers';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const currentWorkspaceMembersState = createState<
PartialWorkspaceMember[]
diff --git a/packages/twenty-front/src/modules/auth/states/currentWorkspaceState.ts b/packages/twenty-front/src/modules/auth/states/currentWorkspaceState.ts
index 8f0ba979983..de66fd0b3a0 100644
--- a/packages/twenty-front/src/modules/auth/states/currentWorkspaceState.ts
+++ b/packages/twenty-front/src/modules/auth/states/currentWorkspaceState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
import {
type Application,
type Role,
diff --git a/packages/twenty-front/src/modules/auth/states/isCurrentUserLoadedState.ts b/packages/twenty-front/src/modules/auth/states/isCurrentUserLoadedState.ts
index 86c827b2afa..30073f0bae9 100644
--- a/packages/twenty-front/src/modules/auth/states/isCurrentUserLoadedState.ts
+++ b/packages/twenty-front/src/modules/auth/states/isCurrentUserLoadedState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const isCurrentUserLoadedState = createState<boolean>({
key: 'isCurrentUserLoadedState',
defaultValue: false,
diff --git a/packages/twenty-front/src/modules/auth/states/loginTokenState.ts b/packages/twenty-front/src/modules/auth/states/loginTokenState.ts
index 25ec477fb3b..deae18afe79 100644
--- a/packages/twenty-front/src/modules/auth/states/loginTokenState.ts
+++ b/packages/twenty-front/src/modules/auth/states/loginTokenState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
import { type AuthToken } from '~/generated-metadata/graphql';
export const loginTokenState = createState<AuthToken['token'] | null>({
diff --git a/packages/twenty-front/src/modules/auth/states/previousUrlState.ts b/packages/twenty-front/src/modules/auth/states/previousUrlState.ts
index b8a7ed2d834..f712dacc28a 100644
--- a/packages/twenty-front/src/modules/auth/states/previousUrlState.ts
+++ b/packages/twenty-front/src/modules/auth/states/previousUrlState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const previousUrlState = createState<string>({
key: 'previousUrlState',
defaultValue: '',
diff --git a/packages/twenty-front/src/modules/auth/states/qrCode.ts b/packages/twenty-front/src/modules/auth/states/qrCode.ts
index 3e917880c6e..c59c5ee1973 100644
--- a/packages/twenty-front/src/modules/auth/states/qrCode.ts
+++ b/packages/twenty-front/src/modules/auth/states/qrCode.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const qrCodeState = createState<string | null>({
key: 'qrCodeState',
diff --git a/packages/twenty-front/src/modules/auth/states/signInUpModeState.ts b/packages/twenty-front/src/modules/auth/states/signInUpModeState.ts
index d666330011d..23802d18b41 100644
--- a/packages/twenty-front/src/modules/auth/states/signInUpModeState.ts
+++ b/packages/twenty-front/src/modules/auth/states/signInUpModeState.ts
@@ -1,5 +1,5 @@
import { SignInUpMode } from '@/auth/types/signInUpMode';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const signInUpModeState = createState<SignInUpMode>({
key: 'signInUpModeState',
diff --git a/packages/twenty-front/src/modules/auth/states/signInUpStepState.ts b/packages/twenty-front/src/modules/auth/states/signInUpStepState.ts
index c49e9b00ce0..8d8535e0f11 100644
--- a/packages/twenty-front/src/modules/auth/states/signInUpStepState.ts
+++ b/packages/twenty-front/src/modules/auth/states/signInUpStepState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export enum SignInUpStep {
Init = 'init',
Email = 'email',
diff --git a/packages/twenty-front/src/modules/auth/states/tokenPairState.ts b/packages/twenty-front/src/modules/auth/states/tokenPairState.ts
index ac9a4beda48..7d302a655fe 100644
--- a/packages/twenty-front/src/modules/auth/states/tokenPairState.ts
+++ b/packages/twenty-front/src/modules/auth/states/tokenPairState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
import { type AuthTokenPair } from '~/generated-metadata/graphql';
import { cookieStorageEffect } from '~/utils/recoil/cookieStorageEffect';
diff --git a/packages/twenty-front/src/modules/auth/states/workspacePublicDataState.ts b/packages/twenty-front/src/modules/auth/states/workspacePublicDataState.ts
index 18c182c0acd..9cbf8a42bed 100644
--- a/packages/twenty-front/src/modules/auth/states/workspacePublicDataState.ts
+++ b/packages/twenty-front/src/modules/auth/states/workspacePublicDataState.ts
@@ -1,5 +1,5 @@
import { type PublicWorkspaceDataOutput } from '~/generated-metadata/graphql';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const workspacePublicDataState =
createState<PublicWorkspaceDataOutput | null>({
diff --git a/packages/twenty-front/src/modules/captcha/states/captchaTokenState.ts b/packages/twenty-front/src/modules/captcha/states/captchaTokenState.ts
index a2239f0234c..f8857d1c35c 100644
--- a/packages/twenty-front/src/modules/captcha/states/captchaTokenState.ts
+++ b/packages/twenty-front/src/modules/captcha/states/captchaTokenState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const captchaTokenState = createState<string | undefined>({
key: 'captchaTokenState',
defaultValue: undefined,
diff --git a/packages/twenty-front/src/modules/captcha/states/isCaptchaScriptLoadedState.ts b/packages/twenty-front/src/modules/captcha/states/isCaptchaScriptLoadedState.ts
index d75b25f32d7..d33524e9346 100644
--- a/packages/twenty-front/src/modules/captcha/states/isCaptchaScriptLoadedState.ts
+++ b/packages/twenty-front/src/modules/captcha/states/isCaptchaScriptLoadedState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const isCaptchaScriptLoadedState = createState<boolean>({
key: 'isCaptchaScriptLoadedState',
defaultValue: false,
diff --git a/packages/twenty-front/src/modules/captcha/states/isRequestingCaptchaTokenState.ts b/packages/twenty-front/src/modules/captcha/states/isRequestingCaptchaTokenState.ts
index d32e7c90b69..c22d921ed37 100644
--- a/packages/twenty-front/src/modules/captcha/states/isRequestingCaptchaTokenState.ts
+++ b/packages/twenty-front/src/modules/captcha/states/isRequestingCaptchaTokenState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const isRequestingCaptchaTokenState = createState<boolean>({
key: 'isRequestingCaptchaTokenState',
defaultValue: false,
diff --git a/packages/twenty-front/src/modules/chrome-extension-sidecar/states/isLoadingTokensFromExtensionState.ts b/packages/twenty-front/src/modules/chrome-extension-sidecar/states/isLoadingTokensFromExtensionState.ts
index b9e22ca1e82..5eff733b9ac 100644
--- a/packages/twenty-front/src/modules/chrome-extension-sidecar/states/isLoadingTokensFromExtensionState.ts
+++ b/packages/twenty-front/src/modules/chrome-extension-sidecar/states/isLoadingTokensFromExtensionState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const isLoadingTokensFromExtensionState = createState<boolean | null>({
key: 'isLoadingTokensFromExtensionState',
defaultValue: null,
diff --git a/packages/twenty-front/src/modules/client-config/states/aiModelsState.ts b/packages/twenty-front/src/modules/client-config/states/aiModelsState.ts
index d3f51efef1d..69e0b38b749 100644
--- a/packages/twenty-front/src/modules/client-config/states/aiModelsState.ts
+++ b/packages/twenty-front/src/modules/client-config/states/aiModelsState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
import { type ClientAiModelConfig } from '~/generated-metadata/graphql';
export const aiModelsState = createState<ClientAiModelConfig[]>({
diff --git a/packages/twenty-front/src/modules/client-config/states/allowRequestsToTwentyIcons.ts b/packages/twenty-front/src/modules/client-config/states/allowRequestsToTwentyIcons.ts
index 2dcf7ca507b..efd8c333011 100644
--- a/packages/twenty-front/src/modules/client-config/states/allowRequestsToTwentyIcons.ts
+++ b/packages/twenty-front/src/modules/client-config/states/allowRequestsToTwentyIcons.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const allowRequestsToTwentyIconsState = createState<boolean>({
key: 'allowRequestsToTwentyIcons',
diff --git a/packages/twenty-front/src/modules/client-config/states/apiConfigState.ts b/packages/twenty-front/src/modules/client-config/states/apiConfigState.ts
index 64108c2a899..14d29ec31d5 100644
--- a/packages/twenty-front/src/modules/client-config/states/apiConfigState.ts
+++ b/packages/twenty-front/src/modules/client-config/states/apiConfigState.ts
@@ -1,5 +1,5 @@
import { type ApiConfig } from '~/generated-metadata/graphql';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const apiConfigState = createState<ApiConfig | null>({
key: 'apiConfigState',
diff --git a/packages/twenty-front/src/modules/client-config/states/appVersionState.ts b/packages/twenty-front/src/modules/client-config/states/appVersionState.ts
index 5b226d7f9b4..2d3d0f4a53b 100644
--- a/packages/twenty-front/src/modules/client-config/states/appVersionState.ts
+++ b/packages/twenty-front/src/modules/client-config/states/appVersionState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const appVersionState = createState<string | undefined>({
key: 'appVersion',
diff --git a/packages/twenty-front/src/modules/client-config/states/authProvidersState.ts b/packages/twenty-front/src/modules/client-config/states/authProvidersState.ts
index 52b9620f61f..23ab4b01b84 100644
--- a/packages/twenty-front/src/modules/client-config/states/authProvidersState.ts
+++ b/packages/twenty-front/src/modules/client-config/states/authProvidersState.ts
@@ -1,5 +1,5 @@
import { type AuthProviders } from '~/generated-metadata/graphql';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const authProvidersState = createState<AuthProviders>({
key: 'authProvidersState',
diff --git a/packages/twenty-front/src/modules/client-config/states/billingState.ts b/packages/twenty-front/src/modules/client-config/states/billingState.ts
index e691bcfed28..0dbe4f377aa 100644
--- a/packages/twenty-front/src/modules/client-config/states/billingState.ts
+++ b/packages/twenty-front/src/modules/client-config/states/billingState.ts
@@ -1,5 +1,5 @@
import { type Billing } from '~/generated-metadata/graphql';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const billingState = createState<Billing | null>({
key: 'billingState',
diff --git a/packages/twenty-front/src/modules/client-config/states/calendarBookingPageIdState.ts b/packages/twenty-front/src/modules/client-config/states/calendarBookingPageIdState.ts
index dd037022480..e694271ef17 100644
--- a/packages/twenty-front/src/modules/client-config/states/calendarBookingPageIdState.ts
+++ b/packages/twenty-front/src/modules/client-config/states/calendarBookingPageIdState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const calendarBookingPageIdState = createState<string | null>({
key: 'calendarBookingPageIdState',
diff --git a/packages/twenty-front/src/modules/client-config/states/canManageFeatureFlagsState.ts b/packages/twenty-front/src/modules/client-config/states/canManageFeatureFlagsState.ts
index 16b094dc213..bf9a7b0f9b3 100644
--- a/packages/twenty-front/src/modules/client-config/states/canManageFeatureFlagsState.ts
+++ b/packages/twenty-front/src/modules/client-config/states/canManageFeatureFlagsState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const canManageFeatureFlagsState = createState<boolean>({
key: 'canManageFeatureFlagsState',
defaultValue: false,
diff --git a/packages/twenty-front/src/modules/client-config/states/captchaState.ts b/packages/twenty-front/src/modules/client-config/states/captchaState.ts
index ef0b2d88d67..721aa53d14f 100644
--- a/packages/twenty-front/src/modules/client-config/states/captchaState.ts
+++ b/packages/twenty-front/src/modules/client-config/states/captchaState.ts
@@ -1,5 +1,5 @@
import { type Captcha } from '~/generated-metadata/graphql';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const captchaState = createState<Captcha | null>({
key: 'captchaState',
diff --git a/packages/twenty-front/src/modules/client-config/states/chromeExtensionIdState.ts b/packages/twenty-front/src/modules/client-config/states/chromeExtensionIdState.ts
index 2d042e72864..3f9c0b7abcc 100644
--- a/packages/twenty-front/src/modules/client-config/states/chromeExtensionIdState.ts
+++ b/packages/twenty-front/src/modules/client-config/states/chromeExtensionIdState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const chromeExtensionIdState = createState<string | null | undefined>({
key: 'chromeExtensionIdState',
defaultValue: null,
diff --git a/packages/twenty-front/src/modules/client-config/states/clientConfigApiStatusState.ts b/packages/twenty-front/src/modules/client-config/states/clientConfigApiStatusState.ts
index 7f845e58245..08cee90932e 100644
--- a/packages/twenty-front/src/modules/client-config/states/clientConfigApiStatusState.ts
+++ b/packages/twenty-front/src/modules/client-config/states/clientConfigApiStatusState.ts
@@ -1,5 +1,5 @@
import { type ClientConfig } from '@/client-config/types/ClientConfig';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
type ClientConfigApiStatus = {
isLoadedOnce: boolean;
diff --git a/packages/twenty-front/src/modules/client-config/states/isAnalyticsEnabledState.ts b/packages/twenty-front/src/modules/client-config/states/isAnalyticsEnabledState.ts
index 23582676e33..333140cda30 100644
--- a/packages/twenty-front/src/modules/client-config/states/isAnalyticsEnabledState.ts
+++ b/packages/twenty-front/src/modules/client-config/states/isAnalyticsEnabledState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const isAnalyticsEnabledState = createState<boolean>({
key: 'isAnalyticsEnabled',
defaultValue: false,
diff --git a/packages/twenty-front/src/modules/client-config/states/isAttachmentPreviewEnabledState.ts b/packages/twenty-front/src/modules/client-config/states/isAttachmentPreviewEnabledState.ts
index 71aa53e1634..c75b4f37fb5 100644
--- a/packages/twenty-front/src/modules/client-config/states/isAttachmentPreviewEnabledState.ts
+++ b/packages/twenty-front/src/modules/client-config/states/isAttachmentPreviewEnabledState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const isAttachmentPreviewEnabledState = createState<boolean>({
key: 'isAttachmentPreviewEnabled',
defaultValue: false,
diff --git a/packages/twenty-front/src/modules/client-config/states/isClickHouseConfiguredState.ts b/packages/twenty-front/src/modules/client-config/states/isClickHouseConfiguredState.ts
index 84df93f4a3a..374e4a33b11 100644
--- a/packages/twenty-front/src/modules/client-config/states/isClickHouseConfiguredState.ts
+++ b/packages/twenty-front/src/modules/client-config/states/isClickHouseConfiguredState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const isClickHouseConfiguredState = createState<boolean>({
key: 'isClickHouseConfigured',
diff --git a/packages/twenty-front/src/modules/client-config/states/isCloudflareIntegrationEnabledState.ts b/packages/twenty-front/src/modules/client-config/states/isCloudflareIntegrationEnabledState.ts
index 1cf68c593ae..a0d5826096d 100644
--- a/packages/twenty-front/src/modules/client-config/states/isCloudflareIntegrationEnabledState.ts
+++ b/packages/twenty-front/src/modules/client-config/states/isCloudflareIntegrationEnabledState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const isCloudflareIntegrationEnabledState = createState<boolean>({
key: 'isCloudflareIntegrationEnabled',
diff --git a/packages/twenty-front/src/modules/client-config/states/isConfigVariablesInDbEnabledState.ts b/packages/twenty-front/src/modules/client-config/states/isConfigVariablesInDbEnabledState.ts
index e5edda28ac5..23c09bc0ec4 100644
--- a/packages/twenty-front/src/modules/client-config/states/isConfigVariablesInDbEnabledState.ts
+++ b/packages/twenty-front/src/modules/client-config/states/isConfigVariablesInDbEnabledState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const isConfigVariablesInDbEnabledState = createState<boolean>({
key: 'isConfigVariablesInDbEnabled',
defaultValue: false,
diff --git a/packages/twenty-front/src/modules/client-config/states/isDeveloperDefaultSignInPrefilledState.ts b/packages/twenty-front/src/modules/client-config/states/isDeveloperDefaultSignInPrefilledState.ts
index 33947777b5e..8d92abd3041 100644
--- a/packages/twenty-front/src/modules/client-config/states/isDeveloperDefaultSignInPrefilledState.ts
+++ b/packages/twenty-front/src/modules/client-config/states/isDeveloperDefaultSignInPrefilledState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const isDeveloperDefaultSignInPrefilledState = createState<boolean>({
key: 'isDeveloperDefaultSignInPrefilledState',
defaultValue: false,
diff --git a/packages/twenty-front/src/modules/client-config/states/isEmailVerificationRequiredState.ts b/packages/twenty-front/src/modules/client-config/states/isEmailVerificationRequiredState.ts
index e9690377ad0..3dd1c5e9203 100644
--- a/packages/twenty-front/src/modules/client-config/states/isEmailVerificationRequiredState.ts
+++ b/packages/twenty-front/src/modules/client-config/states/isEmailVerificationRequiredState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const isEmailVerificationRequiredState = createState<boolean>({
key: 'isEmailVerificationRequired',
defaultValue: false,
diff --git a/packages/twenty-front/src/modules/client-config/states/isEmailingDomainsEnabledState.ts b/packages/twenty-front/src/modules/client-config/states/isEmailingDomainsEnabledState.ts
index 41597cea975..bec0fa5c933 100644
--- a/packages/twenty-front/src/modules/client-config/states/isEmailingDomainsEnabledState.ts
+++ b/packages/twenty-front/src/modules/client-config/states/isEmailingDomainsEnabledState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const isEmailingDomainsEnabledState = createState<boolean>({
key: 'isEmailingDomainsEnabled',
diff --git a/packages/twenty-front/src/modules/client-config/states/isGoogleCalendarEnabledState.ts b/packages/twenty-front/src/modules/client-config/states/isGoogleCalendarEnabledState.ts
index 8077771e2d7..1cb56cf7f56 100644
--- a/packages/twenty-front/src/modules/client-config/states/isGoogleCalendarEnabledState.ts
+++ b/packages/twenty-front/src/modules/client-config/states/isGoogleCalendarEnabledState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const isGoogleCalendarEnabledState = createState<boolean>({
key: 'isGoogleCalendarEnabled',
defaultValue: false,
diff --git a/packages/twenty-front/src/modules/client-config/states/isGoogleMessagingEnabledState.ts b/packages/twenty-front/src/modules/client-config/states/isGoogleMessagingEnabledState.ts
index 10c3920a386..1197516a0bc 100644
--- a/packages/twenty-front/src/modules/client-config/states/isGoogleMessagingEnabledState.ts
+++ b/packages/twenty-front/src/modules/client-config/states/isGoogleMessagingEnabledState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const isGoogleMessagingEnabledState = createState<boolean>({
key: 'isGoogleMessagingEnabled',
defaultValue: false,
diff --git a/packages/twenty-front/src/modules/client-config/states/isImapSmtpCaldavEnabledState.ts b/packages/twenty-front/src/modules/client-config/states/isImapSmtpCaldavEnabledState.ts
index 8d6d77ea15d..263ac6a0f44 100644
--- a/packages/twenty-front/src/modules/client-config/states/isImapSmtpCaldavEnabledState.ts
+++ b/packages/twenty-front/src/modules/client-config/states/isImapSmtpCaldavEnabledState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const isImapSmtpCaldavEnabledState = createState<boolean>({
key: 'isImapSmtpCaldavEnabled',
diff --git a/packages/twenty-front/src/modules/client-config/states/isMicrosoftCalendarEnabledState.ts b/packages/twenty-front/src/modules/client-config/states/isMicrosoftCalendarEnabledState.ts
index 29df04052ca..0f32f654abd 100644
--- a/packages/twenty-front/src/modules/client-config/states/isMicrosoftCalendarEnabledState.ts
+++ b/packages/twenty-front/src/modules/client-config/states/isMicrosoftCalendarEnabledState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const isMicrosoftCalendarEnabledState = createState<boolean>({
key: 'isMicrosoftCalendarEnabled',
defaultValue: false,
diff --git a/packages/twenty-front/src/modules/client-config/states/isMicrosoftMessagingEnabledState.ts b/packages/twenty-front/src/modules/client-config/states/isMicrosoftMessagingEnabledState.ts
index 7efd9a154cf..c9a1f10eb6b 100644
--- a/packages/twenty-front/src/modules/client-config/states/isMicrosoftMessagingEnabledState.ts
+++ b/packages/twenty-front/src/modules/client-config/states/isMicrosoftMessagingEnabledState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const isMicrosoftMessagingEnabledState = createState<boolean>({
key: 'isMicrosoftMessagingEnabled',
defaultValue: false,
diff --git a/packages/twenty-front/src/modules/client-config/states/isMultiWorkspaceEnabledState.ts b/packages/twenty-front/src/modules/client-config/states/isMultiWorkspaceEnabledState.ts
index 12c6a8261c2..ce79841360b 100644
--- a/packages/twenty-front/src/modules/client-config/states/isMultiWorkspaceEnabledState.ts
+++ b/packages/twenty-front/src/modules/client-config/states/isMultiWorkspaceEnabledState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const isMultiWorkspaceEnabledState = createState<boolean>({
key: 'isMultiWorkspaceEnabled',
defaultValue: false,
diff --git a/packages/twenty-front/src/modules/client-config/states/sentryConfigState.ts b/packages/twenty-front/src/modules/client-config/states/sentryConfigState.ts
index e9077724c07..05277574bb4 100644
--- a/packages/twenty-front/src/modules/client-config/states/sentryConfigState.ts
+++ b/packages/twenty-front/src/modules/client-config/states/sentryConfigState.ts
@@ -1,5 +1,5 @@
import { type Sentry } from '~/generated-metadata/graphql';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const sentryConfigState = createState<Sentry | null>({
key: 'sentryConfigState',
diff --git a/packages/twenty-front/src/modules/client-config/states/supportChatState.ts b/packages/twenty-front/src/modules/client-config/states/supportChatState.ts
index cbadb9625db..506de2311c7 100644
--- a/packages/twenty-front/src/modules/client-config/states/supportChatState.ts
+++ b/packages/twenty-front/src/modules/client-config/states/supportChatState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
import { type Support, SupportDriver } from '~/generated-metadata/graphql';
export const supportChatState = createState<Support>({
diff --git a/packages/twenty-front/src/modules/command-menu/states/commandMenuNavigationMorphItemsByPageState.ts b/packages/twenty-front/src/modules/command-menu/states/commandMenuNavigationMorphItemsByPageState.ts
index 0709e3c6f36..fec81d2501d 100644
--- a/packages/twenty-front/src/modules/command-menu/states/commandMenuNavigationMorphItemsByPageState.ts
+++ b/packages/twenty-front/src/modules/command-menu/states/commandMenuNavigationMorphItemsByPageState.ts
@@ -1,5 +1,5 @@
import { type MorphItem } from '@/object-record/multiple-objects/types/MorphItem';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const commandMenuNavigationMorphItemsByPageState = createState<
Map<string, MorphItem[]>
diff --git a/packages/twenty-front/src/modules/command-menu/states/commandMenuNavigationStackState.ts b/packages/twenty-front/src/modules/command-menu/states/commandMenuNavigationStackState.ts
index bb65e3bbd0a..baef93b4653 100644
--- a/packages/twenty-front/src/modules/command-menu/states/commandMenuNavigationStackState.ts
+++ b/packages/twenty-front/src/modules/command-menu/states/commandMenuNavigationStackState.ts
@@ -1,6 +1,6 @@
import { type CommandMenuPages } from '@/command-menu/types/CommandMenuPages';
import { type IconComponent } from 'twenty-ui/display';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export type CommandMenuNavigationStackItem = {
page: CommandMenuPages;
diff --git a/packages/twenty-front/src/modules/command-menu/states/commandMenuPageInfoState.ts b/packages/twenty-front/src/modules/command-menu/states/commandMenuPageInfoState.ts
index 0c847323ed1..d8cbcd9332b 100644
--- a/packages/twenty-front/src/modules/command-menu/states/commandMenuPageInfoState.ts
+++ b/packages/twenty-front/src/modules/command-menu/states/commandMenuPageInfoState.ts
@@ -1,5 +1,5 @@
import { type IconComponent } from 'twenty-ui/display';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const commandMenuPageInfoState = createState<{
title?: string;
diff --git a/packages/twenty-front/src/modules/command-menu/states/commandMenuPageState.ts b/packages/twenty-front/src/modules/command-menu/states/commandMenuPageState.ts
index de7d6333cfd..e76205f3080 100644
--- a/packages/twenty-front/src/modules/command-menu/states/commandMenuPageState.ts
+++ b/packages/twenty-front/src/modules/command-menu/states/commandMenuPageState.ts
@@ -1,5 +1,5 @@
import { CommandMenuPages } from '@/command-menu/types/CommandMenuPages';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const commandMenuPageState = createState<CommandMenuPages>({
key: 'command-menu/commandMenuPageState',
diff --git a/packages/twenty-front/src/modules/command-menu/states/commandMenuSearchState.ts b/packages/twenty-front/src/modules/command-menu/states/commandMenuSearchState.ts
index 0bed1b7f4b7..df6a5d6a194 100644
--- a/packages/twenty-front/src/modules/command-menu/states/commandMenuSearchState.ts
+++ b/packages/twenty-front/src/modules/command-menu/states/commandMenuSearchState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const commandMenuSearchState = createState<string>({
key: 'command-menu/commandMenuSearchState',
defaultValue: '',
diff --git a/packages/twenty-front/src/modules/command-menu/states/hasUserSelectedCommandState.ts b/packages/twenty-front/src/modules/command-menu/states/hasUserSelectedCommandState.ts
index bba2dee05c2..1888a972cda 100644
--- a/packages/twenty-front/src/modules/command-menu/states/hasUserSelectedCommandState.ts
+++ b/packages/twenty-front/src/modules/command-menu/states/hasUserSelectedCommandState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const hasUserSelectedCommandState = createState({
key: 'hasUserSelectedCommandState',
defaultValue: false,
diff --git a/packages/twenty-front/src/modules/command-menu/states/isCommandMenuClosingState.ts b/packages/twenty-front/src/modules/command-menu/states/isCommandMenuClosingState.ts
index 64f2d08871b..1bbe8fd4dbd 100644
--- a/packages/twenty-front/src/modules/command-menu/states/isCommandMenuClosingState.ts
+++ b/packages/twenty-front/src/modules/command-menu/states/isCommandMenuClosingState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const isCommandMenuClosingState = createState({
key: 'command-menu/isCommandMenuClosingState',
defaultValue: false,
diff --git a/packages/twenty-front/src/modules/domain-manager/states/domainConfigurationState.ts b/packages/twenty-front/src/modules/domain-manager/states/domainConfigurationState.ts
index 7011737898d..d7895dc5251 100644
--- a/packages/twenty-front/src/modules/domain-manager/states/domainConfigurationState.ts
+++ b/packages/twenty-front/src/modules/domain-manager/states/domainConfigurationState.ts
@@ -1,5 +1,5 @@
import { type ClientConfig } from '@/client-config/types/ClientConfig';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const domainConfigurationState = createState<
Pick<ClientConfig, 'frontDomain' | 'defaultSubdomain'>
diff --git a/packages/twenty-front/src/modules/domain-manager/states/lastAuthenticatedWorkspaceDomainState.ts b/packages/twenty-front/src/modules/domain-manager/states/lastAuthenticatedWorkspaceDomainState.ts
index e70ead32a97..bc37b964233 100644
--- a/packages/twenty-front/src/modules/domain-manager/states/lastAuthenticatedWorkspaceDomainState.ts
+++ b/packages/twenty-front/src/modules/domain-manager/states/lastAuthenticatedWorkspaceDomainState.ts
@@ -1,5 +1,5 @@
import { cookieStorageEffect } from '~/utils/recoil/cookieStorageEffect';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const lastAuthenticatedWorkspaceDomainState = createState<
| {
diff --git a/packages/twenty-front/src/modules/localization/states/workspaceMemberFormatPreferencesState.ts b/packages/twenty-front/src/modules/localization/states/workspaceMemberFormatPreferencesState.ts
index bedc096c31a..379f0e3959d 100644
--- a/packages/twenty-front/src/modules/localization/states/workspaceMemberFormatPreferencesState.ts
+++ b/packages/twenty-front/src/modules/localization/states/workspaceMemberFormatPreferencesState.ts
@@ -7,7 +7,7 @@ import { detectNumberFormat } from '@/localization/utils/detection/detectNumberF
import { detectTimeFormat } from '@/localization/utils/detection/detectTimeFormat';
import { detectTimeZone } from '@/localization/utils/detection/detectTimeZone';
import { CalendarStartDay } from 'twenty-shared/constants';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export type WorkspaceMemberFormatPreferences = {
timeZone: string;
diff --git a/packages/twenty-front/src/modules/navigation/states/currentMobileNavigationDrawerState.ts b/packages/twenty-front/src/modules/navigation/states/currentMobileNavigationDrawerState.ts
index 8065c36a172..e74a1c90a1b 100644
--- a/packages/twenty-front/src/modules/navigation/states/currentMobileNavigationDrawerState.ts
+++ b/packages/twenty-front/src/modules/navigation/states/currentMobileNavigationDrawerState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const currentMobileNavigationDrawerState = createState<
'main' | 'settings'
>({
diff --git a/packages/twenty-front/src/modules/navigation/states/lastVisitedObjectMetadataItemIdState.ts b/packages/twenty-front/src/modules/navigation/states/lastVisitedObjectMetadataItemIdState.ts
index 167154ce043..5644f1909c5 100644
--- a/packages/twenty-front/src/modules/navigation/states/lastVisitedObjectMetadataItemIdState.ts
+++ b/packages/twenty-front/src/modules/navigation/states/lastVisitedObjectMetadataItemIdState.ts
@@ -1,5 +1,5 @@
import { localStorageEffect } from '~/utils/recoil/localStorageEffect';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const lastVisitedObjectMetadataItemIdState = createState<string | null>({
key: 'lastVisitedObjectMetadataItemIdState',
diff --git a/packages/twenty-front/src/modules/navigation/states/lastVisitedViewPerObjectMetadataItemState.ts b/packages/twenty-front/src/modules/navigation/states/lastVisitedViewPerObjectMetadataItemState.ts
index 9a7057301f2..95c564d2f8a 100644
--- a/packages/twenty-front/src/modules/navigation/states/lastVisitedViewPerObjectMetadataItemState.ts
+++ b/packages/twenty-front/src/modules/navigation/states/lastVisitedViewPerObjectMetadataItemState.ts
@@ -1,5 +1,5 @@
import { localStorageEffect } from '~/utils/recoil/localStorageEffect';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const lastVisitedViewPerObjectMetadataItemState = createState<Record<
string,
diff --git a/packages/twenty-front/src/modules/object-metadata/states/lastFieldMetadataItemUpdateState.ts b/packages/twenty-front/src/modules/object-metadata/states/lastFieldMetadataItemUpdateState.ts
index 062fc49f188..d738f337848 100644
--- a/packages/twenty-front/src/modules/object-metadata/states/lastFieldMetadataItemUpdateState.ts
+++ b/packages/twenty-front/src/modules/object-metadata/states/lastFieldMetadataItemUpdateState.ts
@@ -1,5 +1,5 @@
import type { FieldMetadataItemUpdate } from '@/object-metadata/types/FieldMetadataItemUpdate';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const lastFieldMetadataItemUpdateState =
createState<FieldMetadataItemUpdate | null>({
diff --git a/packages/twenty-front/src/modules/object-metadata/states/objectMetadataItemsState.ts b/packages/twenty-front/src/modules/object-metadata/states/objectMetadataItemsState.ts
index e30f2beaade..a78693c1c82 100644
--- a/packages/twenty-front/src/modules/object-metadata/states/objectMetadataItemsState.ts
+++ b/packages/twenty-front/src/modules/object-metadata/states/objectMetadataItemsState.ts
@@ -1,5 +1,5 @@
import { type ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const objectMetadataItemsState = createState<ObjectMetadataItem[]>({
key: 'objectMetadataItemsState',
diff --git a/packages/twenty-front/src/modules/object-metadata/states/shouldAppBeLoadingState.ts b/packages/twenty-front/src/modules/object-metadata/states/shouldAppBeLoadingState.ts
index d17904fda32..9ccb9ae3c64 100644
--- a/packages/twenty-front/src/modules/object-metadata/states/shouldAppBeLoadingState.ts
+++ b/packages/twenty-front/src/modules/object-metadata/states/shouldAppBeLoadingState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const shouldAppBeLoadingState = createState<boolean>({
key: 'shouldAppBeLoadingState',
defaultValue: false,
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/states/lastShowPageRecordId.ts b/packages/twenty-front/src/modules/object-record/record-field/ui/states/lastShowPageRecordId.ts
index 89be51b1b40..c6732a56a53 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/states/lastShowPageRecordId.ts
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/states/lastShowPageRecordId.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const lastShowPageRecordIdState = createState<string | null>({
key: 'lastShowPageRecordIdState',
diff --git a/packages/twenty-front/src/modules/object-record/record-index/states/recordIndexCalendarFieldMetadataIdState.ts b/packages/twenty-front/src/modules/object-record/record-index/states/recordIndexCalendarFieldMetadataIdState.ts
index aa5d603c242..3f8236ff970 100644
--- a/packages/twenty-front/src/modules/object-record/record-index/states/recordIndexCalendarFieldMetadataIdState.ts
+++ b/packages/twenty-front/src/modules/object-record/record-index/states/recordIndexCalendarFieldMetadataIdState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const recordIndexCalendarFieldMetadataIdState = createState<
string | null
diff --git a/packages/twenty-front/src/modules/object-record/record-index/states/recordIndexCalendarLayoutState.ts b/packages/twenty-front/src/modules/object-record/record-index/states/recordIndexCalendarLayoutState.ts
index fc76fa282f2..7d22095b332 100644
--- a/packages/twenty-front/src/modules/object-record/record-index/states/recordIndexCalendarLayoutState.ts
+++ b/packages/twenty-front/src/modules/object-record/record-index/states/recordIndexCalendarLayoutState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
import { ViewCalendarLayout } from '~/generated-metadata/graphql';
export const recordIndexCalendarLayoutState = createState<ViewCalendarLayout>({
diff --git a/packages/twenty-front/src/modules/object-record/record-index/states/recordIndexFieldDefinitionsState.ts b/packages/twenty-front/src/modules/object-record/record-index/states/recordIndexFieldDefinitionsState.ts
index 2d0e4b61ac1..be7b9932004 100644
--- a/packages/twenty-front/src/modules/object-record/record-index/states/recordIndexFieldDefinitionsState.ts
+++ b/packages/twenty-front/src/modules/object-record/record-index/states/recordIndexFieldDefinitionsState.ts
@@ -1,6 +1,6 @@
import { type FieldMetadata } from '@/object-record/record-field/ui/types/FieldMetadata';
import { type ColumnDefinition } from '@/object-record/record-table/types/ColumnDefinition';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const recordIndexFieldDefinitionsState = createState<
ColumnDefinition<FieldMetadata>[]
diff --git a/packages/twenty-front/src/modules/object-record/record-index/states/recordIndexOpenRecordInState.ts b/packages/twenty-front/src/modules/object-record/record-index/states/recordIndexOpenRecordInState.ts
index 232a5b52ee7..1b950156a17 100644
--- a/packages/twenty-front/src/modules/object-record/record-index/states/recordIndexOpenRecordInState.ts
+++ b/packages/twenty-front/src/modules/object-record/record-index/states/recordIndexOpenRecordInState.ts
@@ -1,5 +1,5 @@
import { ViewOpenRecordInType } from '@/views/types/ViewOpenRecordInType';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const recordIndexOpenRecordInState = createState<ViewOpenRecordInType>({
key: 'recordIndexOpenRecordInState',
diff --git a/packages/twenty-front/src/modules/object-record/record-index/states/recordIndexViewTypeState.ts b/packages/twenty-front/src/modules/object-record/record-index/states/recordIndexViewTypeState.ts
index 265842922d4..782b12cc7e1 100644
--- a/packages/twenty-front/src/modules/object-record/record-index/states/recordIndexViewTypeState.ts
+++ b/packages/twenty-front/src/modules/object-record/record-index/states/recordIndexViewTypeState.ts
@@ -1,5 +1,5 @@
import { type ViewType } from '@/views/types/ViewType';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const recordIndexViewTypeState = createState<ViewType | undefined>({
key: 'recordIndexViewTypeState',
diff --git a/packages/twenty-front/src/modules/object-record/record-merge/states/mergeInProgressState.ts b/packages/twenty-front/src/modules/object-record/record-merge/states/mergeInProgressState.ts
index f7c952a11e0..20c7a84719f 100644
--- a/packages/twenty-front/src/modules/object-record/record-merge/states/mergeInProgressState.ts
+++ b/packages/twenty-front/src/modules/object-record/record-merge/states/mergeInProgressState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const isMergeInProgressState = createState<boolean>({
key: 'isMergeInProgress',
diff --git a/packages/twenty-front/src/modules/object-record/record-merge/states/mergeSettingsState.ts b/packages/twenty-front/src/modules/object-record/record-merge/states/mergeSettingsState.ts
index 118f4c5e454..9b59df95e9c 100644
--- a/packages/twenty-front/src/modules/object-record/record-merge/states/mergeSettingsState.ts
+++ b/packages/twenty-front/src/modules/object-record/record-merge/states/mergeSettingsState.ts
@@ -1,5 +1,5 @@
import { type MergeManySettings } from '@/object-record/hooks/useMergeManyRecords';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const mergeSettingsState = createState<MergeManySettings>({
key: 'mergeSettingsState',
diff --git a/packages/twenty-front/src/modules/object-record/record-right-drawer/states/viewableRecordIdState.ts b/packages/twenty-front/src/modules/object-record/record-right-drawer/states/viewableRecordIdState.ts
index ac57de41e8b..9b8a8ab973e 100644
--- a/packages/twenty-front/src/modules/object-record/record-right-drawer/states/viewableRecordIdState.ts
+++ b/packages/twenty-front/src/modules/object-record/record-right-drawer/states/viewableRecordIdState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const viewableRecordIdState = createState<string | null>({
key: 'activities/viewable-record-id',
diff --git a/packages/twenty-front/src/modules/object-record/record-right-drawer/states/viewableRecordNameSingularState.ts b/packages/twenty-front/src/modules/object-record/record-right-drawer/states/viewableRecordNameSingularState.ts
index 3d977e2f2d2..9b40e65fe81 100644
--- a/packages/twenty-front/src/modules/object-record/record-right-drawer/states/viewableRecordNameSingularState.ts
+++ b/packages/twenty-front/src/modules/object-record/record-right-drawer/states/viewableRecordNameSingularState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
// TODO: deprecate this state once we remove IS_COMMAND_MENU_V2_ENABLED flag
export const viewableRecordNameSingularState = createState<string | null>({
key: 'activities/viewable-record-name-singular',
diff --git a/packages/twenty-front/src/modules/object-record/record-table/states/tableWidthResizeIsActivedState.ts b/packages/twenty-front/src/modules/object-record/record-table/states/tableWidthResizeIsActivedState.ts
index 8829d4e74ec..9eb6a25fc96 100644
--- a/packages/twenty-front/src/modules/object-record/record-table/states/tableWidthResizeIsActivedState.ts
+++ b/packages/twenty-front/src/modules/object-record/record-table/states/tableWidthResizeIsActivedState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const tableWidthResizeIsActiveState = createState({
key: 'tableWidthResizeIsActiveState',
diff --git a/packages/twenty-front/src/modules/page-layout/states/currentPageLayoutIdState.ts b/packages/twenty-front/src/modules/page-layout/states/currentPageLayoutIdState.ts
index 81285a15b3d..5cbf25d4db9 100644
--- a/packages/twenty-front/src/modules/page-layout/states/currentPageLayoutIdState.ts
+++ b/packages/twenty-front/src/modules/page-layout/states/currentPageLayoutIdState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const currentPageLayoutIdState = createState<string | null>({
key: 'currentPageLayoutIdState',
diff --git a/packages/twenty-front/src/modules/page-layout/states/recordPageLayoutsState.ts b/packages/twenty-front/src/modules/page-layout/states/recordPageLayoutsState.ts
index 4f0b3d3baf2..bf5e625d0de 100644
--- a/packages/twenty-front/src/modules/page-layout/states/recordPageLayoutsState.ts
+++ b/packages/twenty-front/src/modules/page-layout/states/recordPageLayoutsState.ts
@@ -1,5 +1,5 @@
import { type PageLayout } from '@/page-layout/types/PageLayout';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const recordPageLayoutsState = createState<PageLayout[]>({
key: 'recordPageLayoutsState',
diff --git a/packages/twenty-front/src/modules/prefetch/states/prefetchFavoriteFoldersState.ts b/packages/twenty-front/src/modules/prefetch/states/prefetchFavoriteFoldersState.ts
index e0b7aed4a65..d461a960a42 100644
--- a/packages/twenty-front/src/modules/prefetch/states/prefetchFavoriteFoldersState.ts
+++ b/packages/twenty-front/src/modules/prefetch/states/prefetchFavoriteFoldersState.ts
@@ -1,5 +1,5 @@
import { type FavoriteFolder } from '@/favorites/types/FavoriteFolder';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const prefetchFavoriteFoldersState = createState<FavoriteFolder[]>({
key: 'prefetchFavoriteFoldersState',
diff --git a/packages/twenty-front/src/modules/prefetch/states/prefetchFavoritesState.ts b/packages/twenty-front/src/modules/prefetch/states/prefetchFavoritesState.ts
index 80dbb71c9a0..3fac7df68df 100644
--- a/packages/twenty-front/src/modules/prefetch/states/prefetchFavoritesState.ts
+++ b/packages/twenty-front/src/modules/prefetch/states/prefetchFavoritesState.ts
@@ -1,5 +1,5 @@
import { type Favorite } from '@/favorites/types/Favorite';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const prefetchFavoritesState = createState<Favorite[]>({
key: 'prefetchFavoritesState',
diff --git a/packages/twenty-front/src/modules/prefetch/states/prefetchNavigationMenuItemsState.ts b/packages/twenty-front/src/modules/prefetch/states/prefetchNavigationMenuItemsState.ts
index 24fd64f6df2..155295c0c55 100644
--- a/packages/twenty-front/src/modules/prefetch/states/prefetchNavigationMenuItemsState.ts
+++ b/packages/twenty-front/src/modules/prefetch/states/prefetchNavigationMenuItemsState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
import { type NavigationMenuItem } from '~/generated-metadata/graphql';
export const prefetchNavigationMenuItemsState = createState<
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/config-variables/states/configVariableGroupFilterState.ts b/packages/twenty-front/src/modules/settings/admin-panel/config-variables/states/configVariableGroupFilterState.ts
index f84f9dab08c..53b4083017d 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/config-variables/states/configVariableGroupFilterState.ts
+++ b/packages/twenty-front/src/modules/settings/admin-panel/config-variables/states/configVariableGroupFilterState.ts
@@ -1,5 +1,5 @@
import { type ConfigVariableGroupFilter } from '@/settings/admin-panel/config-variables/types/ConfigVariableGroupFilter';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const configVariableGroupFilterState =
createState<ConfigVariableGroupFilter>({
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/config-variables/states/configVariableSourceFilterState.ts b/packages/twenty-front/src/modules/settings/admin-panel/config-variables/states/configVariableSourceFilterState.ts
index faae1ec13b7..998823f6fee 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/config-variables/states/configVariableSourceFilterState.ts
+++ b/packages/twenty-front/src/modules/settings/admin-panel/config-variables/states/configVariableSourceFilterState.ts
@@ -1,5 +1,5 @@
import { type ConfigVariableSourceFilter } from '@/settings/admin-panel/config-variables/types/ConfigVariableSourceFilter';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const configVariableSourceFilterState =
createState<ConfigVariableSourceFilter>({
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/config-variables/states/showHiddenGroupVariablesState.ts b/packages/twenty-front/src/modules/settings/admin-panel/config-variables/states/showHiddenGroupVariablesState.ts
index 5d176fbb9b2..3b4bd333498 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/config-variables/states/showHiddenGroupVariablesState.ts
+++ b/packages/twenty-front/src/modules/settings/admin-panel/config-variables/states/showHiddenGroupVariablesState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const showHiddenGroupVariablesState = createState<boolean>({
key: 'showHiddenGroupVariablesState',
diff --git a/packages/twenty-front/src/modules/settings/domains/states/customDomainRecordsState.ts b/packages/twenty-front/src/modules/settings/domains/states/customDomainRecordsState.ts
index 79d373febfa..3cab5bb895c 100644
--- a/packages/twenty-front/src/modules/settings/domains/states/customDomainRecordsState.ts
+++ b/packages/twenty-front/src/modules/settings/domains/states/customDomainRecordsState.ts
@@ -1,5 +1,5 @@
import { type DomainValidRecords } from '~/generated-metadata/graphql';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const customDomainRecordsState = createState<{
customDomainRecords: DomainValidRecords | null;
diff --git a/packages/twenty-front/src/modules/settings/domains/states/publicDomainRecordsState.ts b/packages/twenty-front/src/modules/settings/domains/states/publicDomainRecordsState.ts
index cb44d9fb312..70affb357e0 100644
--- a/packages/twenty-front/src/modules/settings/domains/states/publicDomainRecordsState.ts
+++ b/packages/twenty-front/src/modules/settings/domains/states/publicDomainRecordsState.ts
@@ -1,5 +1,5 @@
import { type DomainValidRecords } from '~/generated-metadata/graphql';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const publicDomainRecordsState = createState<{
publicDomainRecords: DomainValidRecords | null;
diff --git a/packages/twenty-front/src/modules/settings/domains/states/selectedPublicDomainState.ts b/packages/twenty-front/src/modules/settings/domains/states/selectedPublicDomainState.ts
index 1f9b17693c5..cd25f2ad50b 100644
--- a/packages/twenty-front/src/modules/settings/domains/states/selectedPublicDomainState.ts
+++ b/packages/twenty-front/src/modules/settings/domains/states/selectedPublicDomainState.ts
@@ -1,5 +1,5 @@
import { type PublicDomain } from '~/generated-metadata/graphql';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const selectedPublicDomainState = createState<PublicDomain | undefined>({
key: 'selectedPublicDomainState',
diff --git a/packages/twenty-front/src/modules/settings/logic-functions/states/logicFunctionsState.ts b/packages/twenty-front/src/modules/settings/logic-functions/states/logicFunctionsState.ts
index a0d81543e76..ef87ae13ae0 100644
--- a/packages/twenty-front/src/modules/settings/logic-functions/states/logicFunctionsState.ts
+++ b/packages/twenty-front/src/modules/settings/logic-functions/states/logicFunctionsState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
import { type FindManyLogicFunctionsQuery } from '~/generated-metadata/graphql';
export type LogicFunction =
diff --git a/packages/twenty-front/src/modules/settings/playground/states/openAPIReference.ts b/packages/twenty-front/src/modules/settings/playground/states/openAPIReference.ts
index bbbd9eca455..35a129f0ade 100644
--- a/packages/twenty-front/src/modules/settings/playground/states/openAPIReference.ts
+++ b/packages/twenty-front/src/modules/settings/playground/states/openAPIReference.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const openAPIReferenceState = createState<any>({
key: 'OpenAPIReference',
defaultValue: null,
diff --git a/packages/twenty-front/src/modules/settings/security/states/ApprovedAccessDomainsState.ts b/packages/twenty-front/src/modules/settings/security/states/ApprovedAccessDomainsState.ts
index 7fb3564379f..8368fad94b1 100644
--- a/packages/twenty-front/src/modules/settings/security/states/ApprovedAccessDomainsState.ts
+++ b/packages/twenty-front/src/modules/settings/security/states/ApprovedAccessDomainsState.ts
@@ -1,5 +1,5 @@
import { type ApprovedAccessDomain } from '~/generated-metadata/graphql';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const approvedAccessDomainsState = createState<
Omit<ApprovedAccessDomain, '__typename'>[]
diff --git a/packages/twenty-front/src/modules/settings/security/states/SSOIdentitiesProvidersState.ts b/packages/twenty-front/src/modules/settings/security/states/SSOIdentitiesProvidersState.ts
index 73badfb32aa..61132c111e0 100644
--- a/packages/twenty-front/src/modules/settings/security/states/SSOIdentitiesProvidersState.ts
+++ b/packages/twenty-front/src/modules/settings/security/states/SSOIdentitiesProvidersState.ts
@@ -1,7 +1,7 @@
/* @license Enterprise */
import { type SSOIdentityProvider } from '@/settings/security/types/SSOIdentityProvider';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const SSOIdentitiesProvidersState = createState<
Omit<SSOIdentityProvider, '__typename'>[]
diff --git a/packages/twenty-front/src/modules/spreadsheet-import/states/spreadsheetImportCreatedRecordsProgressState.ts b/packages/twenty-front/src/modules/spreadsheet-import/states/spreadsheetImportCreatedRecordsProgressState.ts
index d6e1fd2e438..22f8dccae32 100644
--- a/packages/twenty-front/src/modules/spreadsheet-import/states/spreadsheetImportCreatedRecordsProgressState.ts
+++ b/packages/twenty-front/src/modules/spreadsheet-import/states/spreadsheetImportCreatedRecordsProgressState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const spreadsheetImportCreatedRecordsProgressState = createState({
key: 'spreadsheetImportCreatedRecordsProgressState',
diff --git a/packages/twenty-front/src/modules/spreadsheet-import/states/spreadsheetImportDialogState.ts b/packages/twenty-front/src/modules/spreadsheet-import/states/spreadsheetImportDialogState.ts
index 2b9b04cc26d..33d931ebeae 100644
--- a/packages/twenty-front/src/modules/spreadsheet-import/states/spreadsheetImportDialogState.ts
+++ b/packages/twenty-front/src/modules/spreadsheet-import/states/spreadsheetImportDialogState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
import { type SpreadsheetImportDialogOptions } from '@/spreadsheet-import/types';
export type SpreadsheetImportDialogState = {
diff --git a/packages/twenty-front/src/modules/spreadsheet-import/steps/components/MatchColumnsStep/components/states/suggestedFieldsByColumnHeaderState.ts b/packages/twenty-front/src/modules/spreadsheet-import/steps/components/MatchColumnsStep/components/states/suggestedFieldsByColumnHeaderState.ts
index 0d7f7d9d791..8d9a73beeed 100644
--- a/packages/twenty-front/src/modules/spreadsheet-import/steps/components/MatchColumnsStep/components/states/suggestedFieldsByColumnHeaderState.ts
+++ b/packages/twenty-front/src/modules/spreadsheet-import/steps/components/MatchColumnsStep/components/states/suggestedFieldsByColumnHeaderState.ts
@@ -1,5 +1,5 @@
import { type SpreadsheetImportField } from '@/spreadsheet-import/types';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const suggestedFieldsByColumnHeaderState = createState({
key: 'suggestedFieldsByColumnHeaderState',
diff --git a/packages/twenty-front/src/modules/sse-db-event/states/activeQueryListenersState.ts b/packages/twenty-front/src/modules/sse-db-event/states/activeQueryListenersState.ts
index 3fd1a815ade..bb877105b26 100644
--- a/packages/twenty-front/src/modules/sse-db-event/states/activeQueryListenersState.ts
+++ b/packages/twenty-front/src/modules/sse-db-event/states/activeQueryListenersState.ts
@@ -1,5 +1,5 @@
import { type RecordGqlOperationSignature } from 'twenty-shared/types';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const activeQueryListenersState = createState<
{ queryId: string; operationSignature: RecordGqlOperationSignature }[]
diff --git a/packages/twenty-front/src/modules/sse-db-event/states/disposeFunctionByEventStreamMapState.ts b/packages/twenty-front/src/modules/sse-db-event/states/disposeFunctionByEventStreamMapState.ts
index 5c0d5dfde5a..0b748e0f21f 100644
--- a/packages/twenty-front/src/modules/sse-db-event/states/disposeFunctionByEventStreamMapState.ts
+++ b/packages/twenty-front/src/modules/sse-db-event/states/disposeFunctionByEventStreamMapState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const disposeFunctionForEventStreamState = createState<{
dispose: () => void;
diff --git a/packages/twenty-front/src/modules/sse-db-event/states/isCreatingSseEventStreamState.ts b/packages/twenty-front/src/modules/sse-db-event/states/isCreatingSseEventStreamState.ts
index 6209ef4c8a8..c7ed4b14276 100644
--- a/packages/twenty-front/src/modules/sse-db-event/states/isCreatingSseEventStreamState.ts
+++ b/packages/twenty-front/src/modules/sse-db-event/states/isCreatingSseEventStreamState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const isCreatingSseEventStreamState = createState<boolean>({
key: 'isCreatingSseEventStreamState',
diff --git a/packages/twenty-front/src/modules/sse-db-event/states/isDestroyingEventStreamState.ts b/packages/twenty-front/src/modules/sse-db-event/states/isDestroyingEventStreamState.ts
index 939d059b0ae..6ec3e082f77 100644
--- a/packages/twenty-front/src/modules/sse-db-event/states/isDestroyingEventStreamState.ts
+++ b/packages/twenty-front/src/modules/sse-db-event/states/isDestroyingEventStreamState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const isDestroyingEventStreamState = createState<boolean>({
key: 'isDestroyingEventStreamState',
diff --git a/packages/twenty-front/src/modules/sse-db-event/states/requiredQueryListenersState.ts b/packages/twenty-front/src/modules/sse-db-event/states/requiredQueryListenersState.ts
index d45e64b07e2..df042b78575 100644
--- a/packages/twenty-front/src/modules/sse-db-event/states/requiredQueryListenersState.ts
+++ b/packages/twenty-front/src/modules/sse-db-event/states/requiredQueryListenersState.ts
@@ -1,5 +1,5 @@
import { type RecordGqlOperationSignature } from 'twenty-shared/types';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const requiredQueryListenersState = createState<
{ queryId: string; operationSignature: RecordGqlOperationSignature }[]
diff --git a/packages/twenty-front/src/modules/sse-db-event/states/shouldDestroyEventStreamState.ts b/packages/twenty-front/src/modules/sse-db-event/states/shouldDestroyEventStreamState.ts
index 265d24981d7..4459c194971 100644
--- a/packages/twenty-front/src/modules/sse-db-event/states/shouldDestroyEventStreamState.ts
+++ b/packages/twenty-front/src/modules/sse-db-event/states/shouldDestroyEventStreamState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const shouldDestroyEventStreamState = createState<boolean>({
key: 'shouldDestroyEventStreamState',
diff --git a/packages/twenty-front/src/modules/sse-db-event/states/sseClientState.ts b/packages/twenty-front/src/modules/sse-db-event/states/sseClientState.ts
index 2b40354bba4..32e9c35e307 100644
--- a/packages/twenty-front/src/modules/sse-db-event/states/sseClientState.ts
+++ b/packages/twenty-front/src/modules/sse-db-event/states/sseClientState.ts
@@ -1,5 +1,5 @@
import { type Client } from 'graphql-sse';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const sseClientState = createState<Client | null>({
key: 'sseClientState',
diff --git a/packages/twenty-front/src/modules/sse-db-event/states/sseEventStreamIdState.ts b/packages/twenty-front/src/modules/sse-db-event/states/sseEventStreamIdState.ts
index ef7138a4af1..77c66ec72a5 100644
--- a/packages/twenty-front/src/modules/sse-db-event/states/sseEventStreamIdState.ts
+++ b/packages/twenty-front/src/modules/sse-db-event/states/sseEventStreamIdState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const sseEventStreamIdState = createState<string | null>({
key: 'sseEventStreamIdState',
diff --git a/packages/twenty-front/src/modules/sse-db-event/states/sseEventStreamReadyState.ts b/packages/twenty-front/src/modules/sse-db-event/states/sseEventStreamReadyState.ts
index 6bce93928f5..2df7ad80a96 100644
--- a/packages/twenty-front/src/modules/sse-db-event/states/sseEventStreamReadyState.ts
+++ b/packages/twenty-front/src/modules/sse-db-event/states/sseEventStreamReadyState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const sseEventStreamReadyState = createState<boolean>({
key: 'sseEventStreamReadyState',
diff --git a/packages/twenty-front/src/modules/ui/field/display/states/filePreviewState.ts b/packages/twenty-front/src/modules/ui/field/display/states/filePreviewState.ts
index 6242cc79363..6f0ac0e51a2 100644
--- a/packages/twenty-front/src/modules/ui/field/display/states/filePreviewState.ts
+++ b/packages/twenty-front/src/modules/ui/field/display/states/filePreviewState.ts
@@ -1,5 +1,5 @@
import { type FieldFilesValue } from '@/object-record/record-field/ui/types/FieldMetadata';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const filePreviewState = createState<FieldFilesValue | null>({
key: 'filePreviewState',
diff --git a/packages/twenty-front/src/modules/ui/input/states/iconPickerState.ts b/packages/twenty-front/src/modules/ui/input/states/iconPickerState.ts
index 15762cd3685..af718574b95 100644
--- a/packages/twenty-front/src/modules/ui/input/states/iconPickerState.ts
+++ b/packages/twenty-front/src/modules/ui/input/states/iconPickerState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
import { IconApps, type IconComponent } from 'twenty-ui/display';
type IconPickerState = {
diff --git a/packages/twenty-front/src/modules/ui/layout/dropdown/states/activeDropdownFocusIdState.ts b/packages/twenty-front/src/modules/ui/layout/dropdown/states/activeDropdownFocusIdState.ts
index 0e264992e8a..b3462de6852 100644
--- a/packages/twenty-front/src/modules/ui/layout/dropdown/states/activeDropdownFocusIdState.ts
+++ b/packages/twenty-front/src/modules/ui/layout/dropdown/states/activeDropdownFocusIdState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const activeDropdownFocusIdState = createState<string | null>({
key: 'activeDropdownFocusIdState',
diff --git a/packages/twenty-front/src/modules/ui/layout/dropdown/states/previousDropdownFocusIdState.ts b/packages/twenty-front/src/modules/ui/layout/dropdown/states/previousDropdownFocusIdState.ts
index e5548122b1a..7570f193bdf 100644
--- a/packages/twenty-front/src/modules/ui/layout/dropdown/states/previousDropdownFocusIdState.ts
+++ b/packages/twenty-front/src/modules/ui/layout/dropdown/states/previousDropdownFocusIdState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const previousDropdownFocusIdState = createState<string | null>({
key: 'previousDropdownFocusIdState',
diff --git a/packages/twenty-front/src/modules/ui/navigation/states/navigationMemorizedUrlState.ts b/packages/twenty-front/src/modules/ui/navigation/states/navigationMemorizedUrlState.ts
index 35fc8a579b3..186c3627733 100644
--- a/packages/twenty-front/src/modules/ui/navigation/states/navigationMemorizedUrlState.ts
+++ b/packages/twenty-front/src/modules/ui/navigation/states/navigationMemorizedUrlState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const navigationMemorizedUrlState = createState<string>({
key: 'navigationMemorizedUrlState',
defaultValue: '/',
diff --git a/packages/twenty-front/src/modules/ui/navigation/states/shouldNavigateBackToMemorizedUrlOnSaveState.ts b/packages/twenty-front/src/modules/ui/navigation/states/shouldNavigateBackToMemorizedUrlOnSaveState.ts
index 40220c21f8b..31b2cf267ff 100644
--- a/packages/twenty-front/src/modules/ui/navigation/states/shouldNavigateBackToMemorizedUrlOnSaveState.ts
+++ b/packages/twenty-front/src/modules/ui/navigation/states/shouldNavigateBackToMemorizedUrlOnSaveState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const shouldNavigateBackToMemorizedUrlOnSaveState = createState<boolean>(
{
diff --git a/packages/twenty-front/src/modules/ui/navigation/step-bar/states/stepBarInternalState.ts b/packages/twenty-front/src/modules/ui/navigation/step-bar/states/stepBarInternalState.ts
index ff104b0206a..c289844d9d1 100644
--- a/packages/twenty-front/src/modules/ui/navigation/step-bar/states/stepBarInternalState.ts
+++ b/packages/twenty-front/src/modules/ui/navigation/step-bar/states/stepBarInternalState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export type StepsState = {
activeStep: number;
};
diff --git a/packages/twenty-front/src/modules/ui/utilities/focus/states/focusStackState.ts b/packages/twenty-front/src/modules/ui/utilities/focus/states/focusStackState.ts
index 96b54132fbc..f3e88c326f6 100644
--- a/packages/twenty-front/src/modules/ui/utilities/focus/states/focusStackState.ts
+++ b/packages/twenty-front/src/modules/ui/utilities/focus/states/focusStackState.ts
@@ -1,5 +1,5 @@
import { type FocusStackItem } from '@/ui/utilities/focus/types/FocusStackItem';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const focusStackState = createState<FocusStackItem[]>({
key: 'focusStackState',
diff --git a/packages/twenty-front/src/modules/ui/utilities/hotkey/states/internal/pendingHotkeysState.ts b/packages/twenty-front/src/modules/ui/utilities/hotkey/states/internal/pendingHotkeysState.ts
index 885364fb473..b4cca97b3bb 100644
--- a/packages/twenty-front/src/modules/ui/utilities/hotkey/states/internal/pendingHotkeysState.ts
+++ b/packages/twenty-front/src/modules/ui/utilities/hotkey/states/internal/pendingHotkeysState.ts
@@ -1,5 +1,5 @@
import { type Keys } from 'react-hotkeys-hook/dist/types';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const pendingHotkeyState = createState<Keys | null>({
key: 'pendingHotkeyState',
diff --git a/packages/twenty-front/src/modules/ui/utilities/loading-state/states/currentPageLocationState.ts b/packages/twenty-front/src/modules/ui/utilities/loading-state/states/currentPageLocationState.ts
index efc8df2d1d2..960315fcfbc 100644
--- a/packages/twenty-front/src/modules/ui/utilities/loading-state/states/currentPageLocationState.ts
+++ b/packages/twenty-front/src/modules/ui/utilities/loading-state/states/currentPageLocationState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const currentPageLocationState = createState<string>({
key: 'currentPageLocationState',
defaultValue: '',
diff --git a/packages/twenty-front/src/modules/ui/utilities/state/utils/createState.ts b/packages/twenty-front/src/modules/ui/utilities/state/utils/createState.ts
new file mode 100644
index 00000000000..7fe0628041c
--- /dev/null
+++ b/packages/twenty-front/src/modules/ui/utilities/state/utils/createState.ts
@@ -0,0 +1,18 @@
+import { atom, type AtomEffect } from 'recoil';
+
+export const createState = <ValueType>({
+ key,
+ defaultValue,
+ effects,
+}: {
+ key: string;
+ defaultValue: ValueType;
+ effects?: ReadonlyArray<AtomEffect<ValueType>>;
+}) => {
+ const recoilState = atom<ValueType>({
+ key,
+ default: defaultValue,
+ effects,
+ });
+ return recoilState;
+};
diff --git a/packages/twenty-front/src/modules/views/states/coreViewState.ts b/packages/twenty-front/src/modules/views/states/coreViewState.ts
index 980612e1b39..3ebbc0bc372 100644
--- a/packages/twenty-front/src/modules/views/states/coreViewState.ts
+++ b/packages/twenty-front/src/modules/views/states/coreViewState.ts
@@ -1,5 +1,5 @@
import { type CoreViewWithRelations } from '@/views/types/CoreViewWithRelations';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const coreViewsState = createState<CoreViewWithRelations[]>({
key: 'coreViewsState',
diff --git a/packages/twenty-front/src/modules/workspace-invitation/states/workspaceInvitationsStates.ts b/packages/twenty-front/src/modules/workspace-invitation/states/workspaceInvitationsStates.ts
index 99428674fc1..34eb4361065 100644
--- a/packages/twenty-front/src/modules/workspace-invitation/states/workspaceInvitationsStates.ts
+++ b/packages/twenty-front/src/modules/workspace-invitation/states/workspaceInvitationsStates.ts
@@ -1,5 +1,5 @@
import { type WorkspaceInvitation } from '@/workspace-member/types/WorkspaceMember';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const workspaceInvitationsState = createState<
Omit<WorkspaceInvitation, '__typename'>[]
diff --git a/packages/twenty-front/src/modules/workspace/states/workspaceAuthBypassProvidersState.ts b/packages/twenty-front/src/modules/workspace/states/workspaceAuthBypassProvidersState.ts
index c0c5161d0b1..b5d6e2c7bbe 100644
--- a/packages/twenty-front/src/modules/workspace/states/workspaceAuthBypassProvidersState.ts
+++ b/packages/twenty-front/src/modules/workspace/states/workspaceAuthBypassProvidersState.ts
@@ -1,5 +1,5 @@
import { type AuthBypassProviders } from '~/generated-metadata/graphql';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const workspaceAuthBypassProvidersState =
createState<AuthBypassProviders | null>({
diff --git a/packages/twenty-front/src/modules/workspace/states/workspaceAuthProvidersState.ts b/packages/twenty-front/src/modules/workspace/states/workspaceAuthProvidersState.ts
index 15f1230523a..db0553e7dac 100644
--- a/packages/twenty-front/src/modules/workspace/states/workspaceAuthProvidersState.ts
+++ b/packages/twenty-front/src/modules/workspace/states/workspaceAuthProvidersState.ts
@@ -1,5 +1,5 @@
import { type AuthProviders } from '~/generated-metadata/graphql';
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const workspaceAuthProvidersState = createState<AuthProviders | null>({
key: 'workspaceAuthProvidersState',
diff --git a/packages/twenty-front/src/modules/workspace/states/workspaceBypassModeState.ts b/packages/twenty-front/src/modules/workspace/states/workspaceBypassModeState.ts
index 25a5989b162..48fad7b7536 100644
--- a/packages/twenty-front/src/modules/workspace/states/workspaceBypassModeState.ts
+++ b/packages/twenty-front/src/modules/workspace/states/workspaceBypassModeState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const workspaceBypassModeState = createState<boolean>({
key: 'workspaceBypassModeState',
diff --git a/packages/twenty-front/src/pages/settings/data-model/states/updatedObjectNamePluralState.ts b/packages/twenty-front/src/pages/settings/data-model/states/updatedObjectNamePluralState.ts
index 2e9e5330271..0975a175f3e 100644
--- a/packages/twenty-front/src/pages/settings/data-model/states/updatedObjectNamePluralState.ts
+++ b/packages/twenty-front/src/pages/settings/data-model/states/updatedObjectNamePluralState.ts
@@ -1,4 +1,4 @@
-import { createState } from 'twenty-ui/utilities';
+import { createState } from '@/ui/utilities/state/utils/createState';
export const updatedObjectNamePluralState = createState<string>({
key: 'updatedObjectNamePluralState',
defaultValue: '',
diff --git a/packages/twenty-ui/package.json b/packages/twenty-ui/package.json
index a2b3c3ff1e9..335379caed0 100644
--- a/packages/twenty-ui/package.json
+++ b/packages/twenty-ui/package.json
@@ -39,7 +39,6 @@
"react-responsive": "^9.0.2",
"react-router-dom": "^6.4.4",
"react-tooltip": "^5.13.1",
- "recoil": "^0.7.7",
"twenty-shared": "workspace:*",
"zod": "^4.1.11"
},
diff --git a/packages/twenty-ui/src/display/avatar/components/states/isInvalidAvatarUrlState.ts b/packages/twenty-ui/src/display/avatar/components/states/isInvalidAvatarUrlState.ts
deleted file mode 100644
index 13d410a6fa4..00000000000
--- a/packages/twenty-ui/src/display/avatar/components/states/isInvalidAvatarUrlState.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-import { atom } from 'recoil';
-
-export const invalidAvatarUrlsState = atom<string[]>({
- key: 'invalidAvatarUrlsState',
- default: [],
-});
diff --git a/packages/twenty-ui/src/display/icon/hooks/__tests__/useIcons.test.ts b/packages/twenty-ui/src/display/icon/hooks/__tests__/useIcons.test.ts
index 4a7da2d156e..bd49b6047aa 100644
--- a/packages/twenty-ui/src/display/icon/hooks/__tests__/useIcons.test.ts
+++ b/packages/twenty-ui/src/display/icon/hooks/__tests__/useIcons.test.ts
@@ -1,5 +1,5 @@
import { renderHook } from '@testing-library/react';
-import * as recoil from 'recoil';
+import * as jotai from 'jotai';
import {
Icon123,
@@ -15,10 +15,10 @@ describe('useIcons', () => {
IconBuildingSkyscraper,
};
jest
- .spyOn(recoil, 'useRecoilValue')
+ .spyOn(jotai, 'useAtomValue')
.mockImplementationOnce(() => mockedStateIcons);
const { result } = renderHook(() => useIcons(), {
- wrapper: recoil.RecoilRoot,
+ wrapper: jotai.Provider,
});
it('returns default icon when no icon key is provided', () => {
diff --git a/packages/twenty-ui/src/display/icon/hooks/useIcons.ts b/packages/twenty-ui/src/display/icon/hooks/useIcons.ts
index a958de22b33..ff89b9717d7 100644
--- a/packages/twenty-ui/src/display/icon/hooks/useIcons.ts
+++ b/packages/twenty-ui/src/display/icon/hooks/useIcons.ts
@@ -1,10 +1,10 @@
-import { useRecoilValue } from 'recoil';
+import { useAtomValue } from 'jotai';
import { Icon123 } from '@ui/display/icon/components/TablerIcons';
import { iconsState } from '@ui/display/icon/states/iconsState';
export const useIcons = () => {
- const icons = useRecoilValue(iconsState);
+ const icons = useAtomValue(iconsState);
const defaultIcon = Icon123;
const getIcons = () => {
diff --git a/packages/twenty-ui/src/display/icon/providers/IconsProvider.tsx b/packages/twenty-ui/src/display/icon/providers/IconsProvider.tsx
index 037978c3363..253bfbcf60a 100644
--- a/packages/twenty-ui/src/display/icon/providers/IconsProvider.tsx
+++ b/packages/twenty-ui/src/display/icon/providers/IconsProvider.tsx
@@ -1,5 +1,5 @@
+import { useSetAtom } from 'jotai';
import { useEffect } from 'react';
-import { useSetRecoilState } from 'recoil';
import { iconsState } from '@ui/display/icon/states/iconsState';
@@ -8,7 +8,7 @@ export type IconsProviderProps = {
};
export const IconsProvider = ({ children }: IconsProviderProps) => {
- const setIcons = useSetRecoilState(iconsState);
+ const setIcons = useSetAtom(iconsState);
useEffect(() => {
import('./internal/AllIcons').then(({ ALL_ICONS }) => {
diff --git a/packages/twenty-ui/src/display/icon/states/iconsState.ts b/packages/twenty-ui/src/display/icon/states/iconsState.ts
index 3782d301648..4a88b2cf07e 100644
--- a/packages/twenty-ui/src/display/icon/states/iconsState.ts
+++ b/packages/twenty-ui/src/display/icon/states/iconsState.ts
@@ -1,7 +1,6 @@
+import { atom } from 'jotai';
+
import { type IconComponent } from '@ui/display/icon/types/IconComponent';
-import { createState } from '@ui/utilities/state/utils/createState';
-export const iconsState = createState<Record<string, IconComponent>>({
- key: 'iconsState',
- defaultValue: {},
-});
+export const iconsState = atom<Record<string, IconComponent>>({});
+iconsState.debugLabel = 'iconsState';
diff --git a/packages/twenty-ui/src/display/index.ts b/packages/twenty-ui/src/display/index.ts
index 2f0dc3d49c1..03f4059210e 100644
--- a/packages/twenty-ui/src/display/index.ts
+++ b/packages/twenty-ui/src/display/index.ts
@@ -12,7 +12,6 @@ export { Avatar } from './avatar/components/Avatar';
export type { AvatarGroupProps } from './avatar/components/AvatarGroup';
export { AvatarGroup } from './avatar/components/AvatarGroup';
export { invalidAvatarUrlsAtomV2 } from './avatar/components/states/invalidAvatarUrlsAtomV2';
-export { invalidAvatarUrlsState } from './avatar/components/states/isInvalidAvatarUrlState';
export { AVATAR_PROPERTIES_BY_SIZE } from './avatar/constants/AvatarPropertiesBySize';
export type { AvatarSize } from './avatar/types/AvatarSize';
export type { AvatarType } from './avatar/types/AvatarType';
diff --git a/packages/twenty-ui/src/testing/decorators/RecoilRootDecorator.tsx b/packages/twenty-ui/src/testing/decorators/RecoilRootDecorator.tsx
index 26a65fb3b07..0b98b6b97c2 100644
--- a/packages/twenty-ui/src/testing/decorators/RecoilRootDecorator.tsx
+++ b/packages/twenty-ui/src/testing/decorators/RecoilRootDecorator.tsx
@@ -1,9 +1,10 @@
import { type Decorator } from '@storybook/react-vite';
-import { RecoilRoot } from 'recoil';
+import { Provider as JotaiProvider } from 'jotai';
+// Kept as RecoilRootDecorator name for backward compatibility during migration
export const RecoilRootDecorator: Decorator = (Story, _context) => (
- <RecoilRoot>
+ <JotaiProvider>
<Story />
- </RecoilRoot>
+ </JotaiProvider>
);
diff --git a/packages/twenty-ui/src/utilities/state/utils/createState.ts b/packages/twenty-ui/src/utilities/state/utils/createState.ts
index 7fe0628041c..220424f24ce 100644
--- a/packages/twenty-ui/src/utilities/state/utils/createState.ts
+++ b/packages/twenty-ui/src/utilities/state/utils/createState.ts
@@ -1,18 +1,13 @@
-import { atom, type AtomEffect } from 'recoil';
+import { atom, type PrimitiveAtom } from 'jotai';
export const createState = <ValueType>({
key,
defaultValue,
- effects,
}: {
key: string;
defaultValue: ValueType;
- effects?: ReadonlyArray<AtomEffect<ValueType>>;
-}) => {
- const recoilState = atom<ValueType>({
- key,
- default: defaultValue,
- effects,
- });
- return recoilState;
+}): PrimitiveAtom<ValueType> => {
+ const jotaiAtom = atom<ValueType>(defaultValue);
+ jotaiAtom.debugLabel = key;
+ return jotaiAtom;
};
diff --git a/yarn.lock b/yarn.lock
index eae48f05b0c..9be29c742df 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -57285,7 +57285,6 @@ __metadata:
react-responsive: "npm:^9.0.2"
react-router-dom: "npm:^6.4.4"
react-tooltip: "npm:^5.13.1"
- recoil: "npm:^0.7.7"
tsx: "npm:^4.19.3"
twenty-shared: "workspace:*"
vite-plugin-checker: "npm:^0.10.2"