From 310d13fd178dd30d79de3fb5b0fdcedcccf0b154 Mon Sep 17 00:00:00 2001 From: Charles Bochet Date: Thu, 12 Feb 2026 16:43:34 +0100 Subject: [PATCH] Migrate twenty ui to jotai (#17900) ## Remove Recoil from twenty-ui Completely removes the `recoil` dependency from `twenty-ui` by converting all atoms, hooks, and providers to Jotai equivalents. ### twenty-ui - `createState` now returns a Jotai `PrimitiveAtom` instead of a Recoil atom - `iconsState`, `IconsProvider`, `useIcons` converted to Jotai (`useSetAtom`, `useAtomValue`) - `RecoilRootDecorator` now uses Jotai `Provider` (name kept for compat) - Deleted unused `invalidAvatarUrlsState` (Avatar already uses `invalidAvatarUrlsAtomV2`) - Removed `recoil` from `package.json` ### twenty-front - Created local Recoil `createState` at `@/ui/utilities/state/utils/createState` for ~112 state files still on Recoil - Updated all imports accordingly - Removed `iconsState` from Recoil snapshot preservation in `useAuth` (lives in Jotai store now) --- .../src/localization/states/dateLocaleState.ts | 2 +- .../forceRegisteredActionsMapComponentState.ts | 2 +- .../states/lastViewableEmailThreadIdState.ts | 2 +- .../activityTargetableEntityArrayState.ts | 2 +- .../states/canCreateActivityState.ts | 2 +- .../states/isActivityInCreateModeState.ts | 2 +- .../states/isCreatingActivityInDBState.ts | 2 +- .../states/isAppEffectRedirectEnabledState.ts | 2 +- .../app/states/verifyEmailRedirectPathState.ts | 2 +- .../auth/hooks/__tests__/useAuth.test.tsx | 4 ---- .../src/modules/auth/hooks/useAuth.ts | 3 --- .../auth/states/availableWorkspacesState.ts | 2 +- .../auth/states/billingCheckoutSessionState.ts | 2 +- .../modules/auth/states/currentUserState.ts | 2 +- .../auth/states/currentUserWorkspaceState.ts | 2 +- .../currentWorkspaceDeletedMembersState.ts | 2 +- .../auth/states/currentWorkspaceMemberState.ts | 2 +- .../states/currentWorkspaceMembersState.ts | 2 +- .../auth/states/currentWorkspaceState.ts | 2 +- .../auth/states/isCurrentUserLoadedState.ts | 2 +- .../src/modules/auth/states/loginTokenState.ts | 2 +- .../modules/auth/states/previousUrlState.ts | 2 +- .../src/modules/auth/states/qrCode.ts | 2 +- .../modules/auth/states/signInUpModeState.ts | 2 +- .../modules/auth/states/signInUpStepState.ts | 2 +- .../src/modules/auth/states/tokenPairState.ts | 2 +- .../auth/states/workspacePublicDataState.ts | 2 +- .../captcha/states/captchaTokenState.ts | 2 +- .../states/isCaptchaScriptLoadedState.ts | 2 +- .../states/isRequestingCaptchaTokenState.ts | 2 +- .../isLoadingTokensFromExtensionState.ts | 2 +- .../client-config/states/aiModelsState.ts | 2 +- .../states/allowRequestsToTwentyIcons.ts | 2 +- .../client-config/states/apiConfigState.ts | 2 +- .../client-config/states/appVersionState.ts | 2 +- .../client-config/states/authProvidersState.ts | 2 +- .../client-config/states/billingState.ts | 2 +- .../states/calendarBookingPageIdState.ts | 2 +- .../states/canManageFeatureFlagsState.ts | 2 +- .../client-config/states/captchaState.ts | 2 +- .../states/chromeExtensionIdState.ts | 2 +- .../states/clientConfigApiStatusState.ts | 2 +- .../states/isAnalyticsEnabledState.ts | 2 +- .../states/isAttachmentPreviewEnabledState.ts | 2 +- .../states/isClickHouseConfiguredState.ts | 2 +- .../isCloudflareIntegrationEnabledState.ts | 2 +- .../isConfigVariablesInDbEnabledState.ts | 2 +- .../isDeveloperDefaultSignInPrefilledState.ts | 2 +- .../states/isEmailVerificationRequiredState.ts | 2 +- .../states/isEmailingDomainsEnabledState.ts | 2 +- .../states/isGoogleCalendarEnabledState.ts | 2 +- .../states/isGoogleMessagingEnabledState.ts | 2 +- .../states/isImapSmtpCaldavEnabledState.ts | 2 +- .../states/isMicrosoftCalendarEnabledState.ts | 2 +- .../states/isMicrosoftMessagingEnabledState.ts | 2 +- .../states/isMultiWorkspaceEnabledState.ts | 2 +- .../client-config/states/sentryConfigState.ts | 2 +- .../client-config/states/supportChatState.ts | 2 +- ...mmandMenuNavigationMorphItemsByPageState.ts | 2 +- .../states/commandMenuNavigationStackState.ts | 2 +- .../states/commandMenuPageInfoState.ts | 2 +- .../states/commandMenuPageState.ts | 2 +- .../states/commandMenuSearchState.ts | 2 +- .../states/hasUserSelectedCommandState.ts | 2 +- .../states/isCommandMenuClosingState.ts | 2 +- .../states/domainConfigurationState.ts | 2 +- .../lastAuthenticatedWorkspaceDomainState.ts | 2 +- .../workspaceMemberFormatPreferencesState.ts | 2 +- .../currentMobileNavigationDrawerState.ts | 2 +- .../lastVisitedObjectMetadataItemIdState.ts | 2 +- ...astVisitedViewPerObjectMetadataItemState.ts | 2 +- .../states/lastFieldMetadataItemUpdateState.ts | 2 +- .../states/objectMetadataItemsState.ts | 2 +- .../states/shouldAppBeLoadingState.ts | 2 +- .../ui/states/lastShowPageRecordId.ts | 2 +- .../recordIndexCalendarFieldMetadataIdState.ts | 2 +- .../states/recordIndexCalendarLayoutState.ts | 2 +- .../states/recordIndexFieldDefinitionsState.ts | 2 +- .../states/recordIndexOpenRecordInState.ts | 2 +- .../states/recordIndexViewTypeState.ts | 2 +- .../states/mergeInProgressState.ts | 2 +- .../record-merge/states/mergeSettingsState.ts | 2 +- .../states/viewableRecordIdState.ts | 2 +- .../states/viewableRecordNameSingularState.ts | 2 +- .../states/tableWidthResizeIsActivedState.ts | 2 +- .../states/currentPageLayoutIdState.ts | 2 +- .../states/recordPageLayoutsState.ts | 2 +- .../states/prefetchFavoriteFoldersState.ts | 2 +- .../prefetch/states/prefetchFavoritesState.ts | 2 +- .../states/prefetchNavigationMenuItemsState.ts | 2 +- .../states/configVariableGroupFilterState.ts | 2 +- .../states/configVariableSourceFilterState.ts | 2 +- .../states/showHiddenGroupVariablesState.ts | 2 +- .../domains/states/customDomainRecordsState.ts | 2 +- .../domains/states/publicDomainRecordsState.ts | 2 +- .../states/selectedPublicDomainState.ts | 2 +- .../states/logicFunctionsState.ts | 2 +- .../playground/states/openAPIReference.ts | 2 +- .../states/ApprovedAccessDomainsState.ts | 2 +- .../states/SSOIdentitiesProvidersState.ts | 2 +- ...adsheetImportCreatedRecordsProgressState.ts | 2 +- .../states/spreadsheetImportDialogState.ts | 2 +- .../suggestedFieldsByColumnHeaderState.ts | 2 +- .../states/activeQueryListenersState.ts | 2 +- .../disposeFunctionByEventStreamMapState.ts | 2 +- .../states/isCreatingSseEventStreamState.ts | 2 +- .../states/isDestroyingEventStreamState.ts | 2 +- .../states/requiredQueryListenersState.ts | 2 +- .../states/shouldDestroyEventStreamState.ts | 2 +- .../sse-db-event/states/sseClientState.ts | 2 +- .../states/sseEventStreamIdState.ts | 2 +- .../states/sseEventStreamReadyState.ts | 2 +- .../field/display/states/filePreviewState.ts | 2 +- .../modules/ui/input/states/iconPickerState.ts | 2 +- .../states/activeDropdownFocusIdState.ts | 2 +- .../states/previousDropdownFocusIdState.ts | 2 +- .../states/navigationMemorizedUrlState.ts | 2 +- ...uldNavigateBackToMemorizedUrlOnSaveState.ts | 2 +- .../step-bar/states/stepBarInternalState.ts | 2 +- .../utilities/focus/states/focusStackState.ts | 2 +- .../states/internal/pendingHotkeysState.ts | 2 +- .../states/currentPageLocationState.ts | 2 +- .../ui/utilities/state/utils/createState.ts | 18 ++++++++++++++++++ .../src/modules/views/states/coreViewState.ts | 2 +- .../states/workspaceInvitationsStates.ts | 2 +- .../workspaceAuthBypassProvidersState.ts | 2 +- .../states/workspaceAuthProvidersState.ts | 2 +- .../states/workspaceBypassModeState.ts | 2 +- .../states/updatedObjectNamePluralState.ts | 2 +- packages/twenty-ui/package.json | 1 - .../states/isInvalidAvatarUrlState.ts | 6 ------ .../icon/hooks/__tests__/useIcons.test.ts | 6 +++--- .../src/display/icon/hooks/useIcons.ts | 4 ++-- .../display/icon/providers/IconsProvider.tsx | 4 ++-- .../src/display/icon/states/iconsState.ts | 11 +++++------ packages/twenty-ui/src/display/index.ts | 1 - .../testing/decorators/RecoilRootDecorator.tsx | 7 ++++--- .../src/utilities/state/utils/createState.ts | 15 +++++---------- yarn.lock | 1 - 139 files changed, 165 insertions(+), 168 deletions(-) create mode 100644 packages/twenty-front/src/modules/ui/utilities/state/utils/createState.ts delete mode 100644 packages/twenty-ui/src/display/avatar/components/states/isInvalidAvatarUrlState.ts diff --git a/packages/twenty-front/src/localization/states/dateLocaleState.ts b/packages/twenty-front/src/localization/states/dateLocaleState.ts index 9f3ff45292..0eaf9af87e 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 46ebfedc07..76ece40fb7 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 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 23b183773e..8990ecaf17 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 b53baf6536..f2c2112f03 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 5098324d5b..f10791e406 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({ 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 33fcfdf0ec..9a6849f31f 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({ 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 3d818d85c0..87ef641f46 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({ 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 b931e89aa8..1328590827 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({ 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 9cee32b0e0..2b368eb791 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({ 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 6a0bcacd7c..91b59b15e0 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 6517ae5823..ef240f7f9f 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 0d17f2a47d..121ad19952 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({ diff --git a/packages/twenty-front/src/modules/auth/states/billingCheckoutSessionState.ts b/packages/twenty-front/src/modules/auth/states/billingCheckoutSessionState.ts index 4d17a92e96..dae2a13e79 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({ 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 2f7dd33de1..e4fa9d0750 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 954640a416..a35aac2e08 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 5bb30e426e..fbb11f438f 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 bc29ac2a00..9c61bed5f2 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 627ee18f8a..00a773d4f5 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 8f0ba97998..de66fd0b3a 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 86c827b2af..30073f0bae 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({ 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 25ec477fb3..deae18afe7 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({ diff --git a/packages/twenty-front/src/modules/auth/states/previousUrlState.ts b/packages/twenty-front/src/modules/auth/states/previousUrlState.ts index b8a7ed2d83..f712dacc28 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({ 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 3e917880c6..c59c5ee197 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({ 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 d666330011..23802d18b4 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({ 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 c49e9b00ce..8d8535e0f1 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 ac9a4beda4..7d302a655f 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 18c182c0ac..9cbf8a42be 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({ diff --git a/packages/twenty-front/src/modules/captcha/states/captchaTokenState.ts b/packages/twenty-front/src/modules/captcha/states/captchaTokenState.ts index a2239f0234..f8857d1c35 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({ 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 d75b25f32d..d33524e934 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({ 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 d32e7c90b6..c22d921ed3 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({ 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 b9e22ca1e8..5eff733b9a 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({ 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 d3f51efef1..69e0b38b74 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({ 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 2dcf7ca507..efd8c33301 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({ 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 64108c2a89..14d29ec31d 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({ 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 5b226d7f9b..2d3d0f4a53 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({ 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 52b9620f61..23ab4b01b8 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({ 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 e691bcfed2..0dbe4f377a 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({ 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 dd03702248..e694271ef1 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({ 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 16b094dc21..bf9a7b0f9b 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({ 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 ef0b2d88d6..721aa53d14 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({ 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 2d042e7286..3f9c0b7abc 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({ 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 7f845e5824..08cee90932 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 23582676e3..333140cda3 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({ 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 71aa53e163..c75b4f37fb 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({ 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 84df93f4a3..374e4a33b1 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({ 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 1cf68c593a..a0d5826096 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({ 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 e5edda28ac..23c09bc0ec 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({ 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 33947777b5..8d92abd304 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({ 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 e9690377ad..3dd1c5e920 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({ 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 41597cea97..bec0fa5c93 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({ 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 8077771e2d..1cb56cf7f5 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({ 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 10c3920a38..1197516a0b 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({ 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 8d6d77ea15..263ac6a0f4 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({ 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 29df04052c..0f32f654ab 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({ 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 7efd9a154c..c9a1f10eb6 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({ 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 12c6a8261c..ce79841360 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({ 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 e9077724c0..05277574bb 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({ 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 cbadb9625d..506de2311c 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({ 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 0709e3c6f3..fec81d2501 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 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 bb65e3bbd0..baef93b465 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 0c847323ed..d8cbcd9332 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 de7d6333cf..e76205f308 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({ 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 0bed1b7f4b..df6a5d6a19 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({ 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 bba2dee05c..1888a972cd 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 64f2d08871..1bbe8fd4db 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 7011737898..d7895dc525 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 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 e70ead32a9..bc37b96423 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 bedc096c31..379f0e3959 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 8065c36a17..e74a1c90a1 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 167154ce04..5644f1909c 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({ 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 9a7057301f..95c564d2f8 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({ 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 e30f2beaad..a78693c1c8 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({ 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 d17904fda3..9ccb9ae3c6 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({ 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 89be51b1b4..c6732a56a5 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({ 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 aa5d603c24..3f8236ff97 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 fc76fa282f..7d22095b33 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({ 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 2d0e4b61ac..be7b993200 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[] 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 232a5b52ee..1b950156a1 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({ 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 265842922d..782b12cc7e 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({ 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 f7c952a11e..20c7a84719 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({ 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 118f4c5e45..9b59df95e9 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({ 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 ac57de41e8..9b8a8ab973 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({ 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 3d977e2f2d..9b40e65fe8 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({ 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 8829d4e74e..9eb6a25fc9 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 81285a15b3..5cbf25d4db 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({ 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 4f0b3d3baf..bf5e625d0d 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({ 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 e0b7aed4a6..d461a960a4 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({ 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 80dbb71c9a..3fac7df68d 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({ 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 24fd64f6df..155295c0c5 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 f84f9dab08..53b4083017 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({ 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 faae1ec13b..998823f6fe 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({ 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 5d176fbb9b..3b4bd33349 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({ 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 79d373febf..3cab5bb895 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 cb44d9fb31..70affb357e 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 1f9b17693c..cd25f2ad50 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({ 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 a0d81543e7..ef87ae13ae 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 bbbd9eca45..35a129f0ad 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({ 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 7fb3564379..8368fad94b 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[] 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 73badfb32a..61132c111e 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[] 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 d6e1fd2e43..22f8dccae3 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 2b9b04cc26..33d931ebea 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 0d7f7d9d79..8d9a73beee 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 3fd1a815ad..bb877105b2 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 5c0d5dfde5..0b748e0f21 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 6209ef4c8a..c7ed4b1427 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({ 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 939d059b0a..6ec3e082f7 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({ 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 d45e64b07e..df042b7857 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 265d24981d..4459c19497 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({ 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 2b40354bba..32e9c35e30 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({ 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 ef7138a4af..77c66ec72a 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({ 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 6bce93928f..2df7ad80a9 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({ 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 6242cc7936..6f0ac0e51a 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({ 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 15762cd368..af718574b9 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 0e264992e8..b3462de685 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({ 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 e5548122b1..7570f193bd 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({ 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 35fc8a579b..186c362773 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({ 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 40220c21f8..31b2cf267f 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( { 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 ff104b0206..c289844d9d 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 96b54132fb..f3e88c326f 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({ 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 885364fb47..b4cca97b3b 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({ 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 efc8df2d1d..960315fcfb 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({ 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 0000000000..7fe0628041 --- /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 = ({ + key, + defaultValue, + effects, +}: { + key: string; + defaultValue: ValueType; + effects?: ReadonlyArray>; +}) => { + const recoilState = atom({ + 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 980612e1b3..3ebbc0bc37 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({ 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 99428674fc..34eb436106 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[] diff --git a/packages/twenty-front/src/modules/workspace/states/workspaceAuthBypassProvidersState.ts b/packages/twenty-front/src/modules/workspace/states/workspaceAuthBypassProvidersState.ts index c0c5161d0b..b5d6e2c7bb 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({ diff --git a/packages/twenty-front/src/modules/workspace/states/workspaceAuthProvidersState.ts b/packages/twenty-front/src/modules/workspace/states/workspaceAuthProvidersState.ts index 15f1230523..db0553e7da 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({ 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 25a5989b16..48fad7b753 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({ 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 2e9e533027..0975a175f3 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({ key: 'updatedObjectNamePluralState', defaultValue: '', diff --git a/packages/twenty-ui/package.json b/packages/twenty-ui/package.json index a2b3c3ff1e..335379caed 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 13d410a6fa..0000000000 --- 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({ - 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 4a7da2d156..bd49b6047a 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 a958de22b3..ff89b9717d 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 037978c336..253bfbcf60 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 3782d30164..4a88b2cf07 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 { type IconComponent } from '@ui/display/icon/types/IconComponent'; -import { createState } from '@ui/utilities/state/utils/createState'; +import { atom } from 'jotai'; -export const iconsState = createState>({ - key: 'iconsState', - defaultValue: {}, -}); +import { type IconComponent } from '@ui/display/icon/types/IconComponent'; + +export const iconsState = atom>({}); +iconsState.debugLabel = 'iconsState'; diff --git a/packages/twenty-ui/src/display/index.ts b/packages/twenty-ui/src/display/index.ts index 2f0dc3d49c..03f4059210 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 26a65fb3b0..0b98b6b97c 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) => ( - + - + ); diff --git a/packages/twenty-ui/src/utilities/state/utils/createState.ts b/packages/twenty-ui/src/utilities/state/utils/createState.ts index 7fe0628041..220424f24c 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 = ({ key, defaultValue, - effects, }: { key: string; defaultValue: ValueType; - effects?: ReadonlyArray>; -}) => { - const recoilState = atom({ - key, - default: defaultValue, - effects, - }); - return recoilState; +}): PrimitiveAtom => { + const jotaiAtom = atom(defaultValue); + jotaiAtom.debugLabel = key; + return jotaiAtom; }; diff --git a/yarn.lock b/yarn.lock index eae48f05b0..9be29c742d 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"