From 1dfeba39ebdef51b64cdcb429008331bcf0f3ec0 Mon Sep 17 00:00:00 2001 From: "gitstart-app[bot]" <57568882+gitstart-app[bot]@users.noreply.github.com> Date: Thu, 24 Oct 2024 16:36:06 +0200 Subject: [PATCH] Migrate to twenty-ui - layout/card (#8003) This PR was created by [GitStart](https://gitstart.com/) to address the requirements from this ticket: [TWNTY-7532](https://clients.gitstart.com/twenty/5449/tickets/TWNTY-7532). --- ### Description Migrate: - Card - CardContent - CardFooter - CardHeader ### Demo Card in Storybook ![](https://assets-service.gitstart.com/4814/d6759b99-7d5f-4177-acdf-1c57786330a3.png) ###### Fixes twentyhq/private-issues#86 --------- Co-authored-by: gitstart-twenty Co-authored-by: Charles Bochet --- .../calendar/components/CalendarDayCardContent.tsx | 2 +- .../calendar/components/CalendarEventRow.tsx | 4 ++-- .../calendar/components/CalendarMonthCard.tsx | 2 +- .../modules/activities/components/ActivityList.tsx | 2 +- .../src/modules/activities/components/ActivityRow.tsx | 2 +- .../timeline-activities/rows/components/EventCard.tsx | 2 +- .../SettingsAccountsCalendarChannelDetails.tsx | 3 +-- .../components/SettingsAccountsListEmptyStateCard.tsx | 5 +---- .../SettingsAccountsMessageChannelDetails.tsx | 3 +-- .../components/SettingsAccountsRadioSettingsCard.tsx | 3 +-- .../src/modules/settings/components/SettingsCard.tsx | 4 +--- .../modules/settings/components/SettingsListCard.tsx | 6 ++---- .../components/SettingsListItemCardContent.tsx | 6 ++---- .../settings/components/SettingsListSkeletonCard.tsx | 2 +- .../settings/components/SettingsOptionCardContent.tsx | 3 +-- .../modules/settings/components/SettingsRadioCard.tsx | 3 +-- .../settings/components/SettingsSummaryCard.tsx | 5 ++--- .../components/SettingsDataModelPreviewFormCard.tsx | 3 +-- .../components/SettingsDataModelFieldBooleanForm.tsx | 5 ++--- .../components/SettingsDataModelFieldCurrencyForm.tsx | 2 +- .../components/SettingsDataModelFieldDateForm.tsx | 3 +-- .../components/SettingsDataModelFieldNumberForm.tsx | 2 +- .../components/SettingsDataModelFieldSelectForm.tsx | 11 ++++++++--- .../components/SettingsDataModelFieldPreviewCard.tsx | 6 +++--- .../objects/components/SettingsObjectCoverImage.tsx | 4 +--- .../SettingsDataModelObjectSettingsFormCard.tsx | 3 +-- .../components/SettingsIntegrationPreview.tsx | 3 +-- ...ttingsSSOIdentitiesProvidersListEmptyStateCard.tsx | 5 +---- .../components/SettingsSecurityOptionsList.tsx | 3 +-- .../src}/layout/card/components/Card.tsx | 0 .../src}/layout/card/components/CardContent.tsx | 0 .../src}/layout/card/components/CardFooter.tsx | 0 .../src}/layout/card/components/CardHeader.tsx | 0 .../card/components/__stories__/Card.stories.tsx | 2 +- packages/twenty-ui/src/layout/index.ts | 4 ++++ 35 files changed, 48 insertions(+), 65 deletions(-) rename packages/{twenty-front/src/modules/ui => twenty-ui/src}/layout/card/components/Card.tsx (100%) rename packages/{twenty-front/src/modules/ui => twenty-ui/src}/layout/card/components/CardContent.tsx (100%) rename packages/{twenty-front/src/modules/ui => twenty-ui/src}/layout/card/components/CardFooter.tsx (100%) rename packages/{twenty-front/src/modules/ui => twenty-ui/src}/layout/card/components/CardHeader.tsx (100%) rename packages/{twenty-front/src/modules/ui => twenty-ui/src}/layout/card/components/__stories__/Card.stories.tsx (94%) diff --git a/packages/twenty-front/src/modules/activities/calendar/components/CalendarDayCardContent.tsx b/packages/twenty-front/src/modules/activities/calendar/components/CalendarDayCardContent.tsx index ca656f3b5..1ccf03716 100644 --- a/packages/twenty-front/src/modules/activities/calendar/components/CalendarDayCardContent.tsx +++ b/packages/twenty-front/src/modules/activities/calendar/components/CalendarDayCardContent.tsx @@ -4,7 +4,7 @@ import { differenceInSeconds, endOfDay, format } from 'date-fns'; import { CalendarEventRow } from '@/activities/calendar/components/CalendarEventRow'; import { getCalendarEventStartDate } from '@/activities/calendar/utils/getCalendarEventStartDate'; -import { CardContent } from '@/ui/layout/card/components/CardContent'; +import { CardContent } from 'twenty-ui'; import { TimelineCalendarEvent } from '~/generated/graphql'; type CalendarDayCardContentProps = { diff --git a/packages/twenty-front/src/modules/activities/calendar/components/CalendarEventRow.tsx b/packages/twenty-front/src/modules/activities/calendar/components/CalendarEventRow.tsx index cb9548f8b..5874898e0 100644 --- a/packages/twenty-front/src/modules/activities/calendar/components/CalendarEventRow.tsx +++ b/packages/twenty-front/src/modules/activities/calendar/components/CalendarEventRow.tsx @@ -9,6 +9,8 @@ import { IconArrowRight, IconLock, isDefined, + Card, + CardContent, } from 'twenty-ui'; import { CalendarCurrentEventCursor } from '@/activities/calendar/components/CalendarCurrentEventCursor'; @@ -18,8 +20,6 @@ import { getCalendarEventEndDate } from '@/activities/calendar/utils/getCalendar import { getCalendarEventStartDate } from '@/activities/calendar/utils/getCalendarEventStartDate'; import { hasCalendarEventEnded } from '@/activities/calendar/utils/hasCalendarEventEnded'; import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState'; -import { Card } from '@/ui/layout/card/components/Card'; -import { CardContent } from '@/ui/layout/card/components/CardContent'; import { CalendarChannelVisibility, TimelineCalendarEvent, diff --git a/packages/twenty-front/src/modules/activities/calendar/components/CalendarMonthCard.tsx b/packages/twenty-front/src/modules/activities/calendar/components/CalendarMonthCard.tsx index f42f2e35f..97ca1d029 100644 --- a/packages/twenty-front/src/modules/activities/calendar/components/CalendarMonthCard.tsx +++ b/packages/twenty-front/src/modules/activities/calendar/components/CalendarMonthCard.tsx @@ -2,7 +2,7 @@ import { useContext } from 'react'; import { CalendarDayCardContent } from '@/activities/calendar/components/CalendarDayCardContent'; import { CalendarContext } from '@/activities/calendar/contexts/CalendarContext'; -import { Card } from '@/ui/layout/card/components/Card'; +import { Card } from 'twenty-ui'; type CalendarMonthCardProps = { dayTimes: number[]; diff --git a/packages/twenty-front/src/modules/activities/components/ActivityList.tsx b/packages/twenty-front/src/modules/activities/components/ActivityList.tsx index b8b8b2f61..0bb0e367e 100644 --- a/packages/twenty-front/src/modules/activities/components/ActivityList.tsx +++ b/packages/twenty-front/src/modules/activities/components/ActivityList.tsx @@ -1,5 +1,5 @@ -import { Card } from '@/ui/layout/card/components/Card'; import styled from '@emotion/styled'; +import { Card } from 'twenty-ui'; const StyledList = styled(Card)` & > :not(:last-child) { diff --git a/packages/twenty-front/src/modules/activities/components/ActivityRow.tsx b/packages/twenty-front/src/modules/activities/components/ActivityRow.tsx index 00fdbb1a6..075758fc8 100644 --- a/packages/twenty-front/src/modules/activities/components/ActivityRow.tsx +++ b/packages/twenty-front/src/modules/activities/components/ActivityRow.tsx @@ -1,5 +1,5 @@ -import { CardContent } from '@/ui/layout/card/components/CardContent'; import styled from '@emotion/styled'; +import { CardContent } from 'twenty-ui'; import React from 'react'; const StyledRowContent = styled(CardContent)<{ diff --git a/packages/twenty-front/src/modules/activities/timeline-activities/rows/components/EventCard.tsx b/packages/twenty-front/src/modules/activities/timeline-activities/rows/components/EventCard.tsx index 67e4f78cd..52b8fa0de 100644 --- a/packages/twenty-front/src/modules/activities/timeline-activities/rows/components/EventCard.tsx +++ b/packages/twenty-front/src/modules/activities/timeline-activities/rows/components/EventCard.tsx @@ -1,6 +1,6 @@ import styled from '@emotion/styled'; -import { Card } from '@/ui/layout/card/components/Card'; +import { Card } from 'twenty-ui'; type EventCardProps = { children: React.ReactNode; diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsCalendarChannelDetails.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsCalendarChannelDetails.tsx index 3152e98ba..5d0fab05d 100644 --- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsCalendarChannelDetails.tsx +++ b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsCalendarChannelDetails.tsx @@ -3,10 +3,9 @@ import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSi import { useUpdateOneRecord } from '@/object-record/hooks/useUpdateOneRecord'; import { SettingsAccountsEventVisibilitySettingsCard } from '@/settings/accounts/components/SettingsAccountsCalendarVisibilitySettingsCard'; import { SettingsOptionCardContent } from '@/settings/components/SettingsOptionCardContent'; -import { Card } from '@/ui/layout/card/components/Card'; import styled from '@emotion/styled'; import { Section } from '@react-email/components'; -import { H2Title, Toggle } from 'twenty-ui'; +import { H2Title, Toggle, Card } from 'twenty-ui'; import { CalendarChannelVisibility } from '~/generated-metadata/graphql'; const StyledDetailsContainer = styled.div` diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsListEmptyStateCard.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsListEmptyStateCard.tsx index 981bbcb6d..8500264c4 100644 --- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsListEmptyStateCard.tsx +++ b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsListEmptyStateCard.tsx @@ -1,10 +1,7 @@ import styled from '@emotion/styled'; -import { Button, IconGoogle } from 'twenty-ui'; +import { Button, Card, CardContent, CardHeader, IconGoogle } from 'twenty-ui'; import { useTriggerGoogleApisOAuth } from '@/settings/accounts/hooks/useTriggerGoogleApisOAuth'; -import { Card } from '@/ui/layout/card/components/Card'; -import { CardContent } from '@/ui/layout/card/components/CardContent'; -import { CardHeader } from '@/ui/layout/card/components/CardHeader'; const StyledHeader = styled(CardHeader)` align-items: center; diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsMessageChannelDetails.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsMessageChannelDetails.tsx index cfe203a15..3d4c81d0e 100644 --- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsMessageChannelDetails.tsx +++ b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsMessageChannelDetails.tsx @@ -1,5 +1,5 @@ import styled from '@emotion/styled'; -import { H2Title, Toggle } from 'twenty-ui'; +import { H2Title, Toggle, Card } from 'twenty-ui'; import { MessageChannel, @@ -10,7 +10,6 @@ import { useUpdateOneRecord } from '@/object-record/hooks/useUpdateOneRecord'; import { SettingsAccountsMessageAutoCreationCard } from '@/settings/accounts/components/SettingsAccountsMessageAutoCreationCard'; import { SettingsAccountsMessageVisibilityCard } from '@/settings/accounts/components/SettingsAccountsMessageVisibilityCard'; import { SettingsOptionCardContent } from '@/settings/components/SettingsOptionCardContent'; -import { Card } from '@/ui/layout/card/components/Card'; import { Section } from '@/ui/layout/section/components/Section'; import { MessageChannelVisibility } from '~/generated-metadata/graphql'; diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsRadioSettingsCard.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsRadioSettingsCard.tsx index aaf856456..81c8a6629 100644 --- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsRadioSettingsCard.tsx +++ b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsRadioSettingsCard.tsx @@ -2,8 +2,7 @@ import styled from '@emotion/styled'; import { ReactNode } from 'react'; import { Radio } from '@/ui/input/components/Radio'; -import { Card } from '@/ui/layout/card/components/Card'; -import { CardContent } from '@/ui/layout/card/components/CardContent'; +import { Card, CardContent } from 'twenty-ui'; type SettingsAccountsRadioSettingsCardProps