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 f96ec1768e..b2de426f03 100644 --- a/packages/twenty-front/src/modules/activities/calendar/components/CalendarDayCardContent.tsx +++ b/packages/twenty-front/src/modules/activities/calendar/components/CalendarDayCardContent.tsx @@ -13,12 +13,14 @@ type CalendarDayCardContentProps = { divider?: boolean; }; -const StyledCardContent = styled(CardContent)` - align-items: flex-start; - display: flex; - flex-direction: row; - gap: ${themeCssVariables.spacing[3]}; - padding: ${themeCssVariables.spacing[2]} ${themeCssVariables.spacing[3]}; +const StyledCardContentContainer = styled.div` + > * { + align-items: flex-start; + display: flex; + flex-direction: row; + gap: ${themeCssVariables.spacing[3]}; + padding: ${themeCssVariables.spacing[2]} ${themeCssVariables.spacing[3]}; + } `; const StyledDayContainer = styled.div` @@ -44,7 +46,7 @@ const StyledEvents = styled.div` gap: ${themeCssVariables.spacing[3]}; `; -const StyledEventRow = styled(CalendarEventRow)` +const StyledEventRowContainer = styled.div` flex: 1 0 auto; `; @@ -67,28 +69,29 @@ export const CalendarDayCardContent = ({ }; return ( - - - {weekDayLabel} - {monthDayLabel} - - - {calendarEvents.map((calendarEvent) => ( - - ))} - - + + + + {weekDayLabel} + {monthDayLabel} + + + {calendarEvents.map((calendarEvent) => ( + + + + ))} + + + ); }; diff --git a/packages/twenty-front/src/modules/activities/calendar/components/CalendarEventDetails.tsx b/packages/twenty-front/src/modules/activities/calendar/components/CalendarEventDetails.tsx index 9b40593036..e867707f2b 100644 --- a/packages/twenty-front/src/modules/activities/calendar/components/CalendarEventDetails.tsx +++ b/packages/twenty-front/src/modules/activities/calendar/components/CalendarEventDetails.tsx @@ -85,7 +85,7 @@ const StyledFields = styled.div` width: 100%; `; -const StyledPropertyBox = styled(PropertyBox)` +const StyledPropertyBoxContainer = styled.div` height: ${themeCssVariables.spacing[6]}; width: 100%; `; @@ -165,35 +165,37 @@ export const CalendarEventDetails = ({ }); return ( - - - + + - - - - + + + + + + ); }; diff --git a/packages/twenty-front/src/modules/activities/calendar/components/CalendarEventNotSharedContent.tsx b/packages/twenty-front/src/modules/activities/calendar/components/CalendarEventNotSharedContent.tsx index 8dc32bf6f6..0892e523fd 100644 --- a/packages/twenty-front/src/modules/activities/calendar/components/CalendarEventNotSharedContent.tsx +++ b/packages/twenty-front/src/modules/activities/calendar/components/CalendarEventNotSharedContent.tsx @@ -5,15 +5,18 @@ import { IconLock } from 'twenty-ui/display'; import { Card, CardContent } from 'twenty-ui/layout'; import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants'; -const StyledVisibilityCard = styled(Card)` +const StyledVisibilityCardContainer = styled.div` color: ${themeCssVariables.font.color.light}; flex: 1; - border-color: ${themeCssVariables.border.color.light}; transition: color ${themeCssVariables.animation.duration.normal} ease; width: 100%; + + > * { + border-color: ${themeCssVariables.border.color.light}; + } `; -const StyledVisibilityCardContent = styled(CardContent)` +const StyledVisibilityCardContentContainer = styled.div` align-items: center; background-color: ${themeCssVariables.background.transparent.lighter}; box-sizing: border-box; @@ -29,11 +32,15 @@ export const CalendarEventNotSharedContent = () => { const { theme } = useContext(ThemeContext); return ( - - - - Not shared - - + + + + + + Not shared + + + + ); }; diff --git a/packages/twenty-front/src/modules/activities/calendar/components/CalendarEventParticipantsResponseStatusField.tsx b/packages/twenty-front/src/modules/activities/calendar/components/CalendarEventParticipantsResponseStatusField.tsx index 424308772b..094c124771 100644 --- a/packages/twenty-front/src/modules/activities/calendar/components/CalendarEventParticipantsResponseStatusField.tsx +++ b/packages/twenty-front/src/modules/activities/calendar/components/CalendarEventParticipantsResponseStatusField.tsx @@ -21,7 +21,7 @@ const StyledInlineCellBaseContainer = styled.div` user-select: none; `; -const StyledPropertyBox = styled(PropertyBox)` +const StyledPropertyBoxContainer = styled.div` height: ${themeCssVariables.spacing[6]}; width: 100%; `; @@ -87,19 +87,21 @@ export const CalendarEventParticipantsResponseStatusField = ({ )); return ( - - - - {Icon} + + + + + {Icon} - - {responseStatus} - - - - {styledChips} - - - + + {responseStatus} + + + + {styledChips} + + + + ); }; diff --git a/packages/twenty-front/src/modules/activities/components/ActivityList.tsx b/packages/twenty-front/src/modules/activities/components/ActivityList.tsx index ae5ad19134..a26c2e5e05 100644 --- a/packages/twenty-front/src/modules/activities/components/ActivityList.tsx +++ b/packages/twenty-front/src/modules/activities/components/ActivityList.tsx @@ -2,16 +2,20 @@ import { styled } from '@linaria/react'; import { Card } from 'twenty-ui/layout'; import { themeCssVariables } from 'twenty-ui/theme-constants'; -const StyledList = styled(Card)` - & > :not(:last-child) { - border-bottom: 1px solid ${themeCssVariables.border.color.light}; +const StyledListContainer = styled.div` + > * { + & > :not(:last-child) { + border-bottom: 1px solid ${themeCssVariables.border.color.light}; + } + overflow: auto; + width: calc(100% - 2px); } - - width: calc(100% - 2px); - - overflow: auto; `; export const ActivityList = ({ children }: React.PropsWithChildren) => { - return {children}; + return ( + + {children} + + ); }; diff --git a/packages/twenty-front/src/modules/activities/components/ActivityRow.tsx b/packages/twenty-front/src/modules/activities/components/ActivityRow.tsx index cfdbb59451..20494b5234 100644 --- a/packages/twenty-front/src/modules/activities/components/ActivityRow.tsx +++ b/packages/twenty-front/src/modules/activities/components/ActivityRow.tsx @@ -3,14 +3,14 @@ import React from 'react'; import { CardContent } from 'twenty-ui/layout'; import { themeCssVariables } from 'twenty-ui/theme-constants'; -const StyledRowContent = styled(CardContent)` +const StyledRowContentContainer = styled.div` align-items: center; display: flex; gap: ${themeCssVariables.spacing[2]}; height: ${themeCssVariables.spacing[12]}; padding: ${themeCssVariables.spacing[0]} ${themeCssVariables.spacing[4]}; - &[data-clickable='false'] { + > *[data-clickable='false'] { cursor: default; } `; @@ -30,8 +30,10 @@ export const ActivityRow = ({ }; return ( - - {children} - + + + {children} + + ); }; diff --git a/packages/twenty-front/src/modules/activities/components/ParticipantChip.tsx b/packages/twenty-front/src/modules/activities/components/ParticipantChip.tsx index 2adf7fea50..dd4672d24d 100644 --- a/packages/twenty-front/src/modules/activities/components/ParticipantChip.tsx +++ b/packages/twenty-front/src/modules/activities/components/ParticipantChip.tsx @@ -7,7 +7,7 @@ import { RecordChip } from '@/object-record/components/RecordChip'; import { Avatar } from 'twenty-ui/display'; import { themeCssVariables } from 'twenty-ui/theme-constants'; -const StyledAvatar = styled(Avatar)` +const StyledAvatarContainer = styled.span` margin-right: ${themeCssVariables.spacing[1]}; `; @@ -67,12 +67,14 @@ export const ParticipantChip = ({ /> ) : ( - + + + {displayName} )} diff --git a/packages/twenty-front/src/modules/activities/emails/components/EmailsCard.tsx b/packages/twenty-front/src/modules/activities/emails/components/EmailsCard.tsx index d746889c84..e2ef6e2635 100644 --- a/packages/twenty-front/src/modules/activities/emails/components/EmailsCard.tsx +++ b/packages/twenty-front/src/modules/activities/emails/components/EmailsCard.tsx @@ -38,9 +38,11 @@ const StyledContainer = styled.div` overflow: auto; `; -const StyledH1Title = styled(H1Title)` - display: flex; - gap: ${themeCssVariables.spacing[2]}; +const StyledH1TitleWrapper = styled.div` + > h2 { + display: flex; + gap: ${themeCssVariables.spacing[2]}; + } `; const StyledEmailCount = styled.span` @@ -107,15 +109,17 @@ export const EmailsCard = () => { return ( - - Inbox{' '} - {totalNumberOfThreads} - > - } - fontColor={H1TitleFontColor.Primary} - /> + + + Inbox{' '} + {totalNumberOfThreads} + > + } + fontColor={H1TitleFontColor.Primary} + /> + {!firstQueryLoading && ( {timelineThreads?.map((thread: TimelineThread) => ( diff --git a/packages/twenty-front/src/modules/activities/files/components/DropZone.tsx b/packages/twenty-front/src/modules/activities/files/components/DropZone.tsx index 66065ac61f..eacfd31faf 100644 --- a/packages/twenty-front/src/modules/activities/files/components/DropZone.tsx +++ b/packages/twenty-front/src/modules/activities/files/components/DropZone.tsx @@ -34,8 +34,9 @@ const StyledUploadDragSubTitle = styled.div` line-height: ${themeCssVariables.text.lineHeight.md}; `; -const StyledUploadIcon = styled(IconUpload)` +const StyledUploadIconContainer = styled.div` color: ${themeCssVariables.font.color.tertiary}; + display: flex; margin-bottom: ${themeCssVariables.spacing[3]}; `; @@ -83,10 +84,12 @@ export const DropZone = ({ // eslint-disable-next-line react/jsx-props-no-spreading {...getInputProps()} /> - + + + {t`Upload files`} {t`Drag and Drop Here`} diff --git a/packages/twenty-front/src/modules/activities/timeline-activities/components/TimelineCard.tsx b/packages/twenty-front/src/modules/activities/timeline-activities/components/TimelineCard.tsx index eef9404347..3825f23613 100644 --- a/packages/twenty-front/src/modules/activities/timeline-activities/components/TimelineCard.tsx +++ b/packages/twenty-front/src/modules/activities/timeline-activities/components/TimelineCard.tsx @@ -38,11 +38,11 @@ const StyledMainContainer = styled.div` } `; -const StyledSidePanelAnimatedPlaceholderEmptyContainer = styled( - AnimatedPlaceholderEmptyContainer, -)` - height: auto; - padding-top: ${themeCssVariables.spacing[8]}; +const StyledSidePanelPlaceholderWrapper = styled.div` + > * { + height: auto; + padding-top: ${themeCssVariables.spacing[8]}; + } `; export const TimelineCard = () => { @@ -59,12 +59,8 @@ export const TimelineCard = () => { } if (isTimelineActivitiesEmpty) { - const EmptyContainer = isInSidePanel - ? StyledSidePanelAnimatedPlaceholderEmptyContainer - : AnimatedPlaceholderEmptyContainer; - - return ( - @@ -77,7 +73,15 @@ export const TimelineCard = () => { {t`There is no activity associated with this record.`} - + + ); + + return isInSidePanel ? ( + + {placeholderContent} + + ) : ( + placeholderContent ); } 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 715302b23c..e2d6c94260 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,5 +1,4 @@ import { styled } from '@linaria/react'; -import { Card } from 'twenty-ui/layout'; import { MOBILE_VIEWPORT, themeCssVariables } from 'twenty-ui/theme-constants'; type EventCardProps = { @@ -22,7 +21,7 @@ const StyledCardContainer = styled.div` } `; -const StyledCard = styled(Card)` +const StyledCardInnerContainer = styled.div` background: ${themeCssVariables.background.secondary}; border: 1px solid ${themeCssVariables.border.color.medium}; border-radius: ${themeCssVariables.border.radius.md}; @@ -40,7 +39,7 @@ export const EventCard = ({ children, isOpen }: EventCardProps) => { return ( isOpen && ( - {children} + {children} ) ); diff --git a/packages/twenty-front/src/modules/activities/timeline-activities/rows/components/EventRowDynamicComponent.tsx b/packages/twenty-front/src/modules/activities/timeline-activities/rows/components/EventRowDynamicComponent.tsx index 0e5b147802..c3ce1bbd47 100644 --- a/packages/twenty-front/src/modules/activities/timeline-activities/rows/components/EventRowDynamicComponent.tsx +++ b/packages/twenty-front/src/modules/activities/timeline-activities/rows/components/EventRowDynamicComponent.tsx @@ -26,8 +26,12 @@ export const StyledEventRowItemColumn = styled.div` gap: ${themeCssVariables.spacing[1]}; `; -export const StyledEventRowItemAction = styled(StyledEventRowItemColumn)` +export const StyledEventRowItemAction = styled.div` + align-items: center; color: ${themeCssVariables.font.color.secondary}; + display: flex; + flex-direction: row; + gap: ${themeCssVariables.spacing[1]}; `; export const EventRowDynamicComponent = ({ diff --git a/packages/twenty-front/src/modules/advanced-text-editor/components/BubbleMenuIconButton.tsx b/packages/twenty-front/src/modules/advanced-text-editor/components/BubbleMenuIconButton.tsx index 062bc3958a..acf2e9969e 100644 --- a/packages/twenty-front/src/modules/advanced-text-editor/components/BubbleMenuIconButton.tsx +++ b/packages/twenty-front/src/modules/advanced-text-editor/components/BubbleMenuIconButton.tsx @@ -13,7 +13,7 @@ type BubbleMenuIconButtonProps = { isActive?: boolean; }; -const StyledBubbleMenuIconButton = styled(FloatingIconButton)` +const StyledBubbleMenuIconButtonContainer = styled.div` border: none; border-radius: ${themeCssVariables.spacing[1.5]}; width: ${themeCssVariables.spacing[6]}; @@ -29,17 +29,18 @@ export const BubbleMenuIconButton = ({ isActive, }: BubbleMenuIconButtonProps) => { return ( - + + + ); }; diff --git a/packages/twenty-front/src/modules/ai/components/AIChatAssistantMessageRenderer.tsx b/packages/twenty-front/src/modules/ai/components/AIChatAssistantMessageRenderer.tsx index b538346cc2..ebd44920cb 100644 --- a/packages/twenty-front/src/modules/ai/components/AIChatAssistantMessageRenderer.tsx +++ b/packages/twenty-front/src/modules/ai/components/AIChatAssistantMessageRenderer.tsx @@ -27,8 +27,9 @@ const StyledLoadingIconContainer = styled.div` padding-inline: ${themeCssVariables.spacing[1]}; `; -const StyledLoadingIcon = styled(IconDotsVertical)` +const StyledLoadingIconWrapper = styled.span` color: ${themeCssVariables.font.color.light}; + display: flex; transform: rotate(90deg); `; @@ -37,7 +38,9 @@ const InitialLoadingIndicator = () => { return ( - + + + ); }; diff --git a/packages/twenty-front/src/modules/ai/components/AIChatTab.tsx b/packages/twenty-front/src/modules/ai/components/AIChatTab.tsx index d7b03a7328..7b149e614f 100644 --- a/packages/twenty-front/src/modules/ai/components/AIChatTab.tsx +++ b/packages/twenty-front/src/modules/ai/components/AIChatTab.tsx @@ -115,12 +115,14 @@ const StyledRightButtonsContainer = styled.div` gap: ${themeCssVariables.spacing[1]}; `; -const StyledReadOnlyModelButton = styled(LightButton)` - cursor: default; +const StyledReadOnlyModelButtonContainer = styled.div` + > * { + cursor: default; - &:hover, - &:active { - background: transparent; + &:hover, + &:active { + background: transparent; + } } `; @@ -163,10 +165,9 @@ export const AIChatTab = () => { - + + + diff --git a/packages/twenty-front/src/modules/ai/components/AIChatTabMessageList.tsx b/packages/twenty-front/src/modules/ai/components/AIChatTabMessageList.tsx index 62dcf15592..e43e3c9b6d 100644 --- a/packages/twenty-front/src/modules/ai/components/AIChatTabMessageList.tsx +++ b/packages/twenty-front/src/modules/ai/components/AIChatTabMessageList.tsx @@ -8,7 +8,7 @@ import { styled } from '@linaria/react'; import { isNonEmptyArray } from '@sniptt/guards'; import { themeCssVariables } from 'twenty-ui/theme-constants'; -const StyledScrollWrapper = styled(ScrollWrapper)` +const StyledScrollWrapperContainer = styled.div` display: flex; flex: 1; flex-direction: column; @@ -30,11 +30,13 @@ export const AIChatTabMessageList = () => { } return ( - - {agentChatMessageIdsComponent.map((messageId) => { - return ; - })} - - + + + {agentChatMessageIdsComponent.map((messageId) => { + return ; + })} + + + ); }; diff --git a/packages/twenty-front/src/modules/ai/components/ThinkingStepsDisplay.tsx b/packages/twenty-front/src/modules/ai/components/ThinkingStepsDisplay.tsx index d126fca33f..afe19c0b49 100644 --- a/packages/twenty-front/src/modules/ai/components/ThinkingStepsDisplay.tsx +++ b/packages/twenty-front/src/modules/ai/components/ThinkingStepsDisplay.tsx @@ -140,8 +140,9 @@ const StyledReasoningText = styled.p` white-space: pre-wrap; `; -const StyledOrbitLoaderIcon = styled(ThinkingOrbitLoaderIcon)` +const StyledOrbitLoaderIconContainer = styled.span` color: ${themeCssVariables.font.color.tertiary}; + display: flex; `; const StyledIconContainer = styled.div` @@ -214,7 +215,7 @@ const StyledToolDetailsContainer = styled.div` overflow: hidden; `; -const StyledToolTabList = styled(TabList)` +const StyledToolTabListContainer = styled.div` background-color: ${themeCssVariables.background.secondary}; padding-left: ${themeCssVariables.spacing[1]}; `; @@ -334,11 +335,13 @@ const ThinkingToolStepRow = ({ {part.errorText} ) : ( - + + + - {isActive ? : } + {isActive ? ( + + + + ) : ( + + )} {isActive ? t`Thinking` : t`Thought`} diff --git a/packages/twenty-front/src/modules/ai/components/suggested-prompts/AIChatSuggestedPrompts.tsx b/packages/twenty-front/src/modules/ai/components/suggested-prompts/AIChatSuggestedPrompts.tsx index 5fd76d216a..413c783f8b 100644 --- a/packages/twenty-front/src/modules/ai/components/suggested-prompts/AIChatSuggestedPrompts.tsx +++ b/packages/twenty-front/src/modules/ai/components/suggested-prompts/AIChatSuggestedPrompts.tsx @@ -29,7 +29,7 @@ const StyledTitle = styled.div` padding: 0 ${themeCssVariables.spacing[2]}; `; -const StyledSuggestedPromptButton = styled(LightButton)` +const StyledSuggestedPromptButtonContainer = styled.div` align-self: flex-start; `; @@ -62,13 +62,14 @@ export const AIChatSuggestedPrompts = ({ {t`What can I help you with?`} {DEFAULT_SUGGESTED_PROMPTS.map((prompt) => ( - handleClick(prompt)} - /> + + handleClick(prompt)} + /> + ))} ); diff --git a/packages/twenty-front/src/modules/billing/components/internal/MeteredPriceSelector.tsx b/packages/twenty-front/src/modules/billing/components/internal/MeteredPriceSelector.tsx index 9eafc02adf..bdb73476e2 100644 --- a/packages/twenty-front/src/modules/billing/components/internal/MeteredPriceSelector.tsx +++ b/packages/twenty-front/src/modules/billing/components/internal/MeteredPriceSelector.tsx @@ -31,11 +31,11 @@ const StyledRow = styled.div` gap: ${themeCssVariables.spacing[2]}; `; -const StyledSelect = styled(Select)` +const StyledSelectContainer = styled.div` flex: 1 1; `; -const StyledButton = styled(Button)` +const StyledButtonContainer = styled.div` flex: 0 0 auto; `; @@ -160,26 +160,30 @@ export const MeteredPriceSelector = ({ description={t`Number of new credits allocated every ${recurringInterval}`} /> - - {isChanged && ( - + + + {isChanged && ( + + + )} + + + ); }; @@ -112,12 +116,14 @@ export const MentionInlineContent = createReactInlineContentSpec( // New notes store objectNameSingular + label + imageUrl directly if (isNonEmptyString(objectNameSingular) && isNonEmptyString(label)) { return ( - + + + ); } diff --git a/packages/twenty-front/src/modules/command-menu/components/CommandMenuItemNumberInput.tsx b/packages/twenty-front/src/modules/command-menu/components/CommandMenuItemNumberInput.tsx index d8db678b97..d25515b473 100644 --- a/packages/twenty-front/src/modules/command-menu/components/CommandMenuItemNumberInput.tsx +++ b/packages/twenty-front/src/modules/command-menu/components/CommandMenuItemNumberInput.tsx @@ -25,8 +25,8 @@ type CommandMenuItemNumberInputProps = { placeholder?: string; }; -const StyledRightAlignedTextInput = styled(TextInput)` - input { +const StyledRightAlignedTextInputContainer = styled.div` + & input { text-align: right; } `; @@ -132,18 +132,20 @@ export const CommandMenuItemNumberInput = ({ Icon={Icon} onClick={focusInput} RightComponent={ - + + + } /> ); diff --git a/packages/twenty-front/src/modules/command-menu/components/CommandMenuItemTextInput.tsx b/packages/twenty-front/src/modules/command-menu/components/CommandMenuItemTextInput.tsx index afdaf4345c..cd2210d65a 100644 --- a/packages/twenty-front/src/modules/command-menu/components/CommandMenuItemTextInput.tsx +++ b/packages/twenty-front/src/modules/command-menu/components/CommandMenuItemTextInput.tsx @@ -19,8 +19,8 @@ type CommandMenuItemTextInputProps = { placeholder?: string; }; -const StyledRightAlignedTextInput = styled(TextInput)` - input { +const StyledRightAlignedTextInputContainer = styled.div` + & input { text-align: right; } `; @@ -96,16 +96,18 @@ export const CommandMenuItemTextInput = ({ Icon={Icon} onClick={focusInput} RightComponent={ - + + + } /> ); diff --git a/packages/twenty-front/src/modules/information-banner/components/InformationBanner.tsx b/packages/twenty-front/src/modules/information-banner/components/InformationBanner.tsx index 7f3bb8ce83..314c41989f 100644 --- a/packages/twenty-front/src/modules/information-banner/components/InformationBanner.tsx +++ b/packages/twenty-front/src/modules/information-banner/components/InformationBanner.tsx @@ -18,7 +18,7 @@ const StyledText = styled.div` white-space: nowrap; `; -const StyledCloseButton = styled(IconButton)` +const StyledCloseButtonContainer = styled.div` color: ${themeCssVariables.grayScale.gray1}; display: flex; `; @@ -79,13 +79,15 @@ export const InformationBanner = ({ )} {onClose && ( - + + + )} )} diff --git a/packages/twenty-front/src/modules/object-record/components/MainContainerLayoutWithSidePanel.tsx b/packages/twenty-front/src/modules/object-record/components/MainContainerLayoutWithSidePanel.tsx index 69e8516c13..fa9a2ce06c 100644 --- a/packages/twenty-front/src/modules/object-record/components/MainContainerLayoutWithSidePanel.tsx +++ b/packages/twenty-front/src/modules/object-record/components/MainContainerLayoutWithSidePanel.tsx @@ -19,12 +19,15 @@ const StyledMainContainerLayoutForDesktop = styled.div` padding-right: ${themeCssVariables.spacing[3]}; `; -const StyledPageBodyForDesktop = styled(PageBody)` +const StyledPageBodyForDesktopContainer = styled.div` flex: 1 1 0; min-width: 0; width: 0; - padding-bottom: 0; - padding-right: 0; + + > * { + padding-bottom: 0; + padding-right: 0; + } `; const StyledMainContainerLayoutForMobile = styled.div` @@ -34,11 +37,12 @@ const StyledMainContainerLayoutForMobile = styled.div` padding: 0; `; -const StyledPageBodyForMobile = styled(PageBody)` - padding-bottom: 0; - padding-left: ${themeCssVariables.spacing[1]}; - - padding-right: ${themeCssVariables.spacing['1.5']}; +const StyledPageBodyForMobileContainer = styled.div` + > * { + padding-bottom: 0; + padding-left: ${themeCssVariables.spacing[1]}; + padding-right: ${themeCssVariables.spacing['1.5']}; + } `; export const MainContainerLayoutWithSidePanel = ({ @@ -51,7 +55,9 @@ export const MainContainerLayoutWithSidePanel = ({ if (isMobile) { return ( - {children} + + {children} + ); @@ -59,7 +65,9 @@ export const MainContainerLayoutWithSidePanel = ({ return ( - {children} + + {children} + ); diff --git a/packages/twenty-front/src/modules/object-record/graphql/record-gql-fields/utils/__tests__/__snapshots__/generateDepthRecordGqlFieldsFromRecord.test.ts.snap b/packages/twenty-front/src/modules/object-record/graphql/record-gql-fields/utils/__tests__/__snapshots__/generateDepthRecordGqlFieldsFromRecord.test.ts.snap index ba1ddc21b4..8962cb3cae 100644 --- a/packages/twenty-front/src/modules/object-record/graphql/record-gql-fields/utils/__tests__/__snapshots__/generateDepthRecordGqlFieldsFromRecord.test.ts.snap +++ b/packages/twenty-front/src/modules/object-record/graphql/record-gql-fields/utils/__tests__/__snapshots__/generateDepthRecordGqlFieldsFromRecord.test.ts.snap @@ -1,4 +1,4 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing exports[`generateDepthRecordGqlFieldsFromRecord should generate depth one record gql fields from empty record 1`] = ` { diff --git a/packages/twenty-front/src/modules/object-record/record-board/record-board-card/components/RecordBoardCardMultiDragCounterChip.tsx b/packages/twenty-front/src/modules/object-record/record-board/record-board-card/components/RecordBoardCardMultiDragCounterChip.tsx index 453a6a56ff..faf8746574 100644 --- a/packages/twenty-front/src/modules/object-record/record-board/record-board-card/components/RecordBoardCardMultiDragCounterChip.tsx +++ b/packages/twenty-front/src/modules/object-record/record-board/record-board-card/components/RecordBoardCardMultiDragCounterChip.tsx @@ -3,7 +3,7 @@ import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/use import { styled } from '@linaria/react'; import { NotificationCounter } from 'twenty-ui/navigation'; -const StyledNotificationCounter = styled(NotificationCounter)` +const StyledNotificationCounterContainer = styled.div` position: absolute; top: -7px; right: -7px; @@ -23,5 +23,9 @@ export const RecordBoardCardMultiDragCounterChip = () => { return null; } - return ; + return ( + + + + ); }; diff --git a/packages/twenty-front/src/modules/object-record/record-board/record-board-column/components/RecordBoardColumnHeader.tsx b/packages/twenty-front/src/modules/object-record/record-board/record-board-column/components/RecordBoardColumnHeader.tsx index c7c6523371..944356f5e5 100644 --- a/packages/twenty-front/src/modules/object-record/record-board/record-board-column/components/RecordBoardColumnHeader.tsx +++ b/packages/twenty-front/src/modules/object-record/record-board/record-board-column/components/RecordBoardColumnHeader.tsx @@ -68,7 +68,7 @@ const StyledColumn = styled.div` position: relative; `; -const StyledTag = styled(Tag)` +const StyledTagContainer = styled.div` max-width: 100%; min-width: 0; overflow: hidden; @@ -139,24 +139,29 @@ export const RecordBoardColumnHeader = () => { y: 10, }} clickableComponent={ - + + + } dropdownComponents={} /> diff --git a/packages/twenty-front/src/modules/object-record/record-board/record-board-column/components/RecordBoardColumnHeaderAggregateDropdownButton.tsx b/packages/twenty-front/src/modules/object-record/record-board/record-board-column/components/RecordBoardColumnHeaderAggregateDropdownButton.tsx index 89ff4d75f7..826faf35e9 100644 --- a/packages/twenty-front/src/modules/object-record/record-board/record-board-column/components/RecordBoardColumnHeaderAggregateDropdownButton.tsx +++ b/packages/twenty-front/src/modules/object-record/record-board/record-board-column/components/RecordBoardColumnHeaderAggregateDropdownButton.tsx @@ -6,12 +6,14 @@ import { type Nullable } from 'twenty-shared/types'; import { Tag } from 'twenty-ui/components'; import { AppTooltip, TooltipDelay } from 'twenty-ui/display'; -const StyledTag = styled(Tag)` +const StyledTagContainer = styled.div` width: 100%; `; -const StyledHeader = styled(StyledHeaderDropdownButton)` - padding: 0; +const StyledHeaderContainer = styled.div` + > * { + padding: 0; + } `; export const RecordBoardColumnHeaderAggregateDropdownButton = ({ @@ -29,24 +31,28 @@ export const RecordBoardColumnHeaderAggregateDropdownButton = ({ ); return ( - - <> - - {!isDropdownOpen && ( - - )} - > - + + + <> + + + + {!isDropdownOpen && ( + + )} + > + + ); }; diff --git a/packages/twenty-front/src/modules/object-record/record-calendar/components/RecordCalendarAddNew.tsx b/packages/twenty-front/src/modules/object-record/record-calendar/components/RecordCalendarAddNew.tsx index 8a92a73ec8..6ef907099b 100644 --- a/packages/twenty-front/src/modules/object-record/record-calendar/components/RecordCalendarAddNew.tsx +++ b/packages/twenty-front/src/modules/object-record/record-calendar/components/RecordCalendarAddNew.tsx @@ -14,7 +14,7 @@ import { IconPlus } from 'twenty-ui/display'; import { Button } from 'twenty-ui/input'; import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants'; -const StyledButton = styled(Button)` +const StyledButtonContainer = styled.div` padding: ${themeCssVariables.spacing['0.5']}; min-width: unset; height: auto; @@ -69,17 +69,19 @@ export const RecordCalendarAddNew = ({ } return ( - { - await createNewIndexRecord({ - [calendarFieldMetadataItem.name]: cardDate - .toZonedDateTime(userTimezone) - .toInstant() - .toString(), - }); - }} - variant="tertiary" - Icon={() => } - /> + + { + await createNewIndexRecord({ + [calendarFieldMetadataItem.name]: cardDate + .toZonedDateTime(userTimezone) + .toInstant() + .toString(), + }); + }} + variant="tertiary" + Icon={() => } + /> + ); }; diff --git a/packages/twenty-front/src/modules/object-record/record-calendar/components/RecordCalendarTopBar.tsx b/packages/twenty-front/src/modules/object-record/record-calendar/components/RecordCalendarTopBar.tsx index ec5f2c8774..8366e060e2 100644 --- a/packages/twenty-front/src/modules/object-record/record-calendar/components/RecordCalendarTopBar.tsx +++ b/packages/twenty-front/src/modules/object-record/record-calendar/components/RecordCalendarTopBar.tsx @@ -30,7 +30,7 @@ const StyledContainer = styled.div` width: 100%; `; -const StyledNavigationButton = styled(Button)` +const StyledNavigationButtonContainer = styled.div` padding: ${themeCssVariables.spacing[1]}; `; @@ -120,24 +120,28 @@ export const RecordCalendarTopBar = () => { - + + + - + + + ); diff --git a/packages/twenty-front/src/modules/object-record/record-calendar/record-calendar-card/components/RecordCalendarCard.tsx b/packages/twenty-front/src/modules/object-record/record-calendar/record-calendar-card/components/RecordCalendarCard.tsx index 8e286c49a4..6a1eccd558 100644 --- a/packages/twenty-front/src/modules/object-record/record-calendar/record-calendar-card/components/RecordCalendarCard.tsx +++ b/packages/twenty-front/src/modules/object-record/record-calendar/record-calendar-card/components/RecordCalendarCard.tsx @@ -24,7 +24,7 @@ const StyledContainer = styled.div` display: flex; `; -const StyledRecordCard = styled(RecordCard)` +const StyledRecordCardContainer = styled.div` width: calc(100% - 2px); `; @@ -84,18 +84,20 @@ export const RecordCalendarCard = ({ recordId }: RecordCalendarCardProps) => { value={{ scopeInstanceId: RECORD_CALENDAR_CARD_INPUT_ID_PREFIX }} > - - - - - - + + + + + + + + diff --git a/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/components/RecordDetailSectionContainer.tsx b/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/components/RecordDetailSectionContainer.tsx index a487303954..089795978f 100644 --- a/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/components/RecordDetailSectionContainer.tsx +++ b/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/components/RecordDetailSectionContainer.tsx @@ -4,7 +4,7 @@ import { Link } from 'react-router-dom'; import { Section } from 'twenty-ui/layout'; import { themeCssVariables } from 'twenty-ui/theme-constants'; -const StyledRecordDetailSectionContainer = styled(Section)` +const StyledRecordDetailSectionWrapper = styled.div` border-top: 1px solid ${themeCssVariables.border.color.light}; padding-top: ${themeCssVariables.spacing[3]}; padding-bottom: ${themeCssVariables.spacing[3]}; @@ -36,13 +36,15 @@ const StyledTitleLabel = styled.div` font-weight: ${themeCssVariables.font.weight.medium}; `; -const StyledLink = styled(Link)` - color: ${themeCssVariables.font.color.light}; - text-decoration: none; - font-size: ${themeCssVariables.font.size.sm}; +const StyledLinkContainer = styled.span` + & > a { + color: ${themeCssVariables.font.color.light}; + font-size: ${themeCssVariables.font.size.sm}; + text-decoration: none; - :hover { - color: ${themeCssVariables.font.color.secondary}; + &:hover { + color: ${themeCssVariables.font.color.secondary}; + } } `; @@ -67,22 +69,28 @@ export const RecordDetailSectionContainer = ({ }: RecordDetailSectionContainerProps) => { const [isHovered, setIsHovered] = useState(false); return ( - - setIsHovered(true)} - onMouseLeave={() => setIsHovered(false)} - data-testid={dataTestId} - > - - {title} - {link && {link.label}} - - {hideRightAdornmentOnMouseLeave && !isHovered && areRecordsAvailable - ? null - : rightAdornment} - - {children} - + + + setIsHovered(true)} + onMouseLeave={() => setIsHovered(false)} + data-testid={dataTestId} + > + + {title} + {link && ( + + {link.label} + + )} + + {hideRightAdornmentOnMouseLeave && !isHovered && areRecordsAvailable + ? null + : rightAdornment} + + {children} + + ); }; diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormAdvancedTextFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormAdvancedTextFieldInput.tsx index ce2b4a38b2..3a071783be 100644 --- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormAdvancedTextFieldInput.tsx +++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormAdvancedTextFieldInput.tsx @@ -22,7 +22,7 @@ import { IconMaximize } from 'twenty-ui/display'; import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants'; import { useIsMobile } from 'twenty-ui/utilities'; -const StyledAdvancedTextFieldContainer = styled(FormFieldInputContainer)` +const StyledAdvancedTextFieldContainerWrapper = styled.div` flex-grow: 1; `; @@ -63,14 +63,16 @@ const StyledFullScreenEditorContainer = styled.div` overflow-y: auto; `; -const StyledFullScreenButtonContainer = styled(StyledDropdownButtonContainer)` - background-color: transparent; +const StyledFullScreenButtonContainerWrapper = styled.div` + > * { + background-color: transparent; + color: ${themeCssVariables.font.color.tertiary}; + padding: ${themeCssVariables.spacing[2]}; - color: ${themeCssVariables.font.color.tertiary}; - padding: ${themeCssVariables.spacing[2]}; - :hover { - cursor: pointer; - background-color: ${themeCssVariables.background.transparent.light}; + :hover { + cursor: pointer; + background-color: ${themeCssVariables.background.transparent.light}; + } } `; @@ -209,46 +211,50 @@ export const FormAdvancedTextFieldInput = ({ return ( <> - - {label ? {label} : null} + + + {label ? {label} : null} - - - {!isFullScreen && ( - - )} + + + {!isFullScreen && ( + + )} - {enableFullScreen && ( - - {!readonly && !isFullScreen && ( - - - - )} - - )} + {enableFullScreen && ( + + {!readonly && !isFullScreen && ( + + + + + + )} + + )} - {VariablePicker && !readonly ? ( - - ) : null} - - - {hint && {hint}} - {error && {error}} - + {VariablePicker && !readonly ? ( + + ) : null} + + + {hint && {hint}} + {error && {error}} + + {fullScreenOverlay} > diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormArrayFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormArrayFieldInput.tsx index 4dfc5aa604..b6b3c7dfc2 100644 --- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormArrayFieldInput.tsx +++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormArrayFieldInput.tsx @@ -52,7 +52,14 @@ const StyledDisplayModeReadonlyContainer = styled.div` width: 100%; `; -const StyledDisplayModeContainer = styled(StyledDisplayModeReadonlyContainer)` +const StyledDisplayModeContainer = styled.div` + align-items: center; + background: transparent; + border: none; + display: flex; + font-family: inherit; + padding-inline: ${themeCssVariables.spacing[2]}; + width: 100%; height: 30px; cursor: pointer; box-sizing: border-box; @@ -63,11 +70,11 @@ const StyledDisplayModeContainer = styled(StyledDisplayModeReadonlyContainer)` } `; -const StyledInput = styled(TextInput)` +const StyledInputContainer = styled.div` padding: ${themeCssVariables.spacing[1]} ${themeCssVariables.spacing[2]}; `; -const StyledPlaceholder = styled(FormFieldPlaceholder)` +const StyledPlaceholderContainer = styled.div` width: 100%; `; @@ -303,19 +310,23 @@ export const FormArrayFieldInput = ({ {draftValue.value.length > 0 ? ( ) : ( - + + + )} ) : draftValue.value.length === 0 ? ( - + + + ) : ( {label} : null} - - {draftValue.type === 'static' ? ( - <> - + + + {draftValue.type === 'static' ? ( + <> + - {draftValue.mode === 'edit' ? ( - - - - - - - - ) : null} - > - ) : ( - - )} - + {draftValue.mode === 'edit' ? ( + + + + + + + + ) : null} + > + ) : ( + + )} + + {VariablePicker && !readonly ? ( {label} : null} - - {draftValue.type === 'static' ? ( - <> - - - - {draftValue.mode === 'edit' ? ( - - - - - - - - ) : null} - > - ) : ( - - )} - + + + {draftValue.type === 'static' ? ( + <> + + + + {draftValue.mode === 'edit' ? ( + + + + + + + + ) : null} + > + ) : ( + + )} + + {VariablePicker && !readonly ? ( ) : ( - + + + )} ) : ( - {placeholderText} + + + {placeholderText} + + )} ` +const StyledFormSelectContainerWrapper = styled.div<{ readonly?: boolean }>` align-items: center; height: 32px; justify-content: space-between; @@ -166,19 +164,20 @@ export const FormSingleRecordPicker = ({ {label ? {label} : null} {disabled ? ( - - - + + + + + ) : ( - - - + + - - + + + + + } dropdownComponents={ (hasItem ? '30px' : 'auto')}; `; -const StyledCustomPhoneInput = styled(ReactPhoneNumberInput)` +const StyledCustomPhoneInputWrapper = styled.div` background-color: transparent; border: none; color: ${themeCssVariables.font.color.primary}; font-family: ${themeCssVariables.font.family}; font-size: inherit; font-weight: inherit; - outline: none; - padding: 0; - - &::placeholder, - &::-webkit-input-placeholder { - color: ${themeCssVariables.font.color.light}; - font-family: ${themeCssVariables.font.family}; - font-weight: ${themeCssVariables.font.weight.medium}; - } height: 100%; + width: calc(100% - ${themeCssVariables.spacing[8]}); .PhoneInputInput { background: none; @@ -83,7 +75,6 @@ const StyledCustomPhoneInput = styled(ReactPhoneNumberInput)` border-radius: ${themeCssVariables.border.radius.xs}; height: 12px; } - width: calc(100% - ${themeCssVariables.spacing[8]}); `; export const PhonesFieldInput = () => { @@ -219,16 +210,18 @@ export const PhonesFieldInput = () => { hasItem={!!phones.length} hasError={hasError} > - void} - international={true} - withCountryCallingCode={true} - countrySelectComponent={PhoneCountryPickerDropdownButton} - defaultCountry={defaultCountry} - /> + + void} + international={true} + withCountryCallingCode={true} + countrySelectComponent={PhoneCountryPickerDropdownButton} + defaultCountry={defaultCountry} + /> + ); }} diff --git a/packages/twenty-front/src/modules/object-record/record-index/components/RecordIndexPageKanbanAddMenuItem.tsx b/packages/twenty-front/src/modules/object-record/record-index/components/RecordIndexPageKanbanAddMenuItem.tsx index ed5470b40a..4297cdf0b3 100644 --- a/packages/twenty-front/src/modules/object-record/record-index/components/RecordIndexPageKanbanAddMenuItem.tsx +++ b/packages/twenty-front/src/modules/object-record/record-index/components/RecordIndexPageKanbanAddMenuItem.tsx @@ -6,7 +6,7 @@ import { isDefined } from 'twenty-shared/utils'; import { MenuItem } from 'twenty-ui/navigation'; import { Tag } from 'twenty-ui/components'; -const StyledMenuItem = styled(MenuItem)` +const StyledMenuItemContainer = styled.div` width: calc(100% - 2 * var(--horizontal-padding)); `; @@ -29,28 +29,30 @@ export const RecordIndexPageKanbanAddMenuItem = ({ } return ( - - } - onClick={() => onItemClick(recordGroupDefinition)} - /> + + + } + onClick={() => onItemClick(recordGroupDefinition)} + /> + ); }; diff --git a/packages/twenty-front/src/modules/object-record/record-merge/components/MergeRecordsContainer.tsx b/packages/twenty-front/src/modules/object-record/record-merge/components/MergeRecordsContainer.tsx index 018d94ee87..75ff275bba 100644 --- a/packages/twenty-front/src/modules/object-record/record-merge/components/MergeRecordsContainer.tsx +++ b/packages/twenty-front/src/modules/object-record/record-merge/components/MergeRecordsContainer.tsx @@ -27,7 +27,7 @@ const StyledShowPageRightContainer = styled.div` overflow: auto; `; -const StyledTabList = styled(TabList)` +const StyledTabListContainer = styled.div` background-color: ${themeCssVariables.background.secondary}; padding-left: ${themeCssVariables.spacing[2]}; `; @@ -65,11 +65,13 @@ export const MergeRecordsContainer = ({ - + + + {activeTabId === MergeRecordsTabId.MERGE_PREVIEW && ( diff --git a/packages/twenty-front/src/modules/object-record/record-merge/components/MergeSettingsTab.tsx b/packages/twenty-front/src/modules/object-record/record-merge/components/MergeSettingsTab.tsx index 323022cadb..ac9f271296 100644 --- a/packages/twenty-front/src/modules/object-record/record-merge/components/MergeSettingsTab.tsx +++ b/packages/twenty-front/src/modules/object-record/record-merge/components/MergeSettingsTab.tsx @@ -8,7 +8,7 @@ import { getPositionNumberIcon } from '@/object-record/record-merge/utils/getPos import { getPositionWordLabel } from '@/object-record/record-merge/utils/getPositionWordLabel'; import { themeCssVariables } from 'twenty-ui/theme-constants'; -const StyledSection = styled(Section)` +const StyledSectionContainer = styled.div` margin: ${themeCssVariables.spacing[4]}; width: auto; `; @@ -37,14 +37,16 @@ export const MergeSettingsTab = () => { } return ( - - - + + + + + ); }; diff --git a/packages/twenty-front/src/modules/object-record/record-table/empty-state/components/RecordTableEmptyStateDisplay.tsx b/packages/twenty-front/src/modules/object-record/record-table/empty-state/components/RecordTableEmptyStateDisplay.tsx index b09a18116f..f9d114b840 100644 --- a/packages/twenty-front/src/modules/object-record/record-table/empty-state/components/RecordTableEmptyStateDisplay.tsx +++ b/packages/twenty-front/src/modules/object-record/record-table/empty-state/components/RecordTableEmptyStateDisplay.tsx @@ -16,10 +16,10 @@ import { type AnimatedPlaceholderType, } from 'twenty-ui/layout'; -const StyledEmptyPlaceholderOuterContainer = styled( - AnimatedPlaceholderEmptyContainer, -)` - align-items: flex-start; +const StyledEmptyPlaceholderOuterContainer = styled.div` + > * { + align-items: flex-start; + } `; type RecordTableEmptyStateDisplayButtonComponentProps = { diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellCheckbox.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellCheckbox.tsx index 3735578c0e..6f311a5ea6 100644 --- a/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellCheckbox.tsx +++ b/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellCheckbox.tsx @@ -22,8 +22,7 @@ const StyledContainer = styled.div` padding-right: ${themeCssVariables.spacing[1]}; `; -// TODO: refactor -const StyledRecordTableTd = styled(RecordTableCellStyleWrapper)` +const StyledRecordTableTdContainer = styled.div` border-left: 1px solid transparent; `; @@ -43,14 +42,16 @@ export const RecordTableCellCheckbox = () => { ); return ( - - - - - + + + + + + + ); }; diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellCheckboxPlaceholder.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellCheckboxPlaceholder.tsx index 30ba1cdad7..6b7638a9eb 100644 --- a/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellCheckboxPlaceholder.tsx +++ b/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellCheckboxPlaceholder.tsx @@ -19,8 +19,7 @@ const StyledContainer = styled.div` padding-right: ${themeCssVariables.spacing[1]}; `; -// TODO: refactor -const StyledRecordTableTd = styled(RecordTableCellStyleWrapper)` +const StyledRecordTableTdContainer = styled.div` border-left: 1px solid transparent; `; @@ -28,14 +27,16 @@ export const RecordTableCellCheckboxPlaceholder = () => { const { hasUserSelectedAllRows } = useRecordTableBodyContextOrThrow(); return ( - - - - - + + + + + + + ); }; diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellFirstRowFirstColumn.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellFirstRowFirstColumn.tsx index 6299739c7c..bd23a8c041 100644 --- a/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellFirstRowFirstColumn.tsx +++ b/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellFirstRowFirstColumn.tsx @@ -1,5 +1,4 @@ import { TABLE_Z_INDEX } from '@/object-record/record-table/constants/TableZIndex'; -import { StyledCell } from '@/object-record/record-table/record-table-cell/components/RecordTableCellStyleWrapper'; import { isRecordTableScrolledVerticallyComponentState } from '@/object-record/record-table/states/isRecordTableScrolledVerticallyComponentState'; import { recordTableFocusPositionComponentState } from '@/object-record/record-table/states/recordTableFocusPositionComponentState'; import { recordTableHoverPositionComponentState } from '@/object-record/record-table/states/recordTableHoverPositionComponentState'; @@ -12,7 +11,30 @@ import { cx } from '@linaria/core'; import { useContext, type ReactNode } from 'react'; import { ThemeContext } from 'twenty-ui/theme-constants'; -const StyledRecordTableTd = styled(StyledCell)<{ zIndex: number }>` +const StyledRecordTableTd = styled.div<{ + backgroundColor: string; + borderColor: string; + isDragging?: boolean; + fontColor: string; + hasRightBorder?: boolean; + hasBottomBorder?: boolean; + zIndex: number; +}>` + border-bottom: 1px solid + ${({ borderColor, hasBottomBorder, isDragging }) => + hasBottomBorder && !isDragging ? borderColor : 'transparent'}; + + color: ${({ fontColor }) => fontColor}; + border-right: ${({ borderColor, hasRightBorder }) => + hasRightBorder ? `1px solid ${borderColor}` : 'none'}; + + padding: 0; + + text-align: left; + + background: ${({ backgroundColor, isDragging }) => + isDragging ? 'transparent' : backgroundColor}; + z-index: ${({ zIndex }) => zIndex}; `; diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-footer/components/RecordTableColumnAggregateFooterValue.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-footer/components/RecordTableColumnAggregateFooterValue.tsx index 90a42ae2cc..30e3f839fc 100644 --- a/packages/twenty-front/src/modules/object-record/record-table/record-table-footer/components/RecordTableColumnAggregateFooterValue.tsx +++ b/packages/twenty-front/src/modules/object-record/record-table/record-table-footer/components/RecordTableColumnAggregateFooterValue.tsx @@ -20,7 +20,7 @@ const StyledText = styled.span` z-index: 1; `; -const StyledScrollableContainer = styled.div` +const StyledValueContainer = styled.div` overflow-x: auto; white-space: nowrap; scrollbar-width: none; @@ -29,9 +29,7 @@ const StyledScrollableContainer = styled.div` &::-webkit-scrollbar { display: none; } -`; -const StyledValueContainer = styled(StyledScrollableContainer)` align-items: center; display: flex; gap: 4px; diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-footer/components/RecordTableColumnAggregateFooterValueCell.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-footer/components/RecordTableColumnAggregateFooterValueCell.tsx index 9a200af74c..0113f29e6a 100644 --- a/packages/twenty-front/src/modules/object-record/record-table/record-table-footer/components/RecordTableColumnAggregateFooterValueCell.tsx +++ b/packages/twenty-front/src/modules/object-record/record-table/record-table-footer/components/RecordTableColumnAggregateFooterValueCell.tsx @@ -38,7 +38,7 @@ const StyledCell = styled.div<{ isUnfolded: boolean; isFirstCell: boolean }>` : '0'}; `; -const StyledIcon = styled(IconChevronDown)` +const StyledIconContainer = styled.div` align-items: center; display: flex; height: 20px; @@ -94,7 +94,9 @@ export const RecordTableColumnAggregateFooterValueCell = ({ dropdownId={dropdownId} /> {!hasAggregateOperationForViewField && ( - + + + )} > ) : ( diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-header/components/RecordTableColumnHeadDropdownMenu.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-header/components/RecordTableColumnHeadDropdownMenu.tsx index 785a53f456..22730d3271 100644 --- a/packages/twenty-front/src/modules/object-record/record-table/record-table-header/components/RecordTableColumnHeadDropdownMenu.tsx +++ b/packages/twenty-front/src/modules/object-record/record-table/record-table-header/components/RecordTableColumnHeadDropdownMenu.tsx @@ -30,7 +30,7 @@ export type RecordTableColumnHeadDropdownMenuProps = { objectMetadataId: string; }; -const StyledDropdownMenuItemsContainer = styled(DropdownMenuItemsContainer)` +const StyledDropdownMenuItemsContainerWrapper = styled.div` z-index: ${themeCssVariables.lastLayerZIndex}; `; @@ -136,44 +136,46 @@ export const RecordTableColumnHeadDropdownMenu = ({ return ( - - {isFilterable && ( - - )} - {isSortable && ( - - )} - {showSeparator && } - {canMoveLeft && ( - - )} - {canMoveRight && ( - - )} - {canHide && ( - await handleColumnVisibility()} - text={t`Hide`} - /> - )} - + + + {isFilterable && ( + + )} + {isSortable && ( + + )} + {showSeparator && } + {canMoveLeft && ( + + )} + {canMoveRight && ( + + )} + {canHide && ( + await handleColumnVisibility()} + text={t`Hide`} + /> + )} + + ); }; diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-row/components/RecordTableActionRow.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-row/components/RecordTableActionRow.tsx index aa7068fd68..c37e338ed8 100644 --- a/packages/twenty-front/src/modules/object-record/record-table/record-table-row/components/RecordTableActionRow.tsx +++ b/packages/twenty-front/src/modules/object-record/record-table/record-table-row/components/RecordTableActionRow.tsx @@ -20,13 +20,6 @@ import { import { type IconComponent } from 'twenty-ui/display'; import { useIsMobile } from 'twenty-ui/utilities'; -const StyledDragDropPlaceholderCell = styled( - RecordTableDragAndDropPlaceholderCell, -)` - left: 0; - position: sticky; -`; - const StyledFieldPlaceholderCell = styled.div<{ widthOfFields: number }>` height: ${RECORD_TABLE_ROW_HEIGHT}px; min-width: ${({ widthOfFields }) => widthOfFields}px; @@ -137,7 +130,7 @@ export const RecordTableActionRow = ({ return ( - + { return null; } - return ; + return ( + + + + ); }; diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-section/components/RecordTableRecordGroupSection.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-section/components/RecordTableRecordGroupSection.tsx index 70356be4b9..da4b1f2054 100644 --- a/packages/twenty-front/src/modules/object-record/record-table/record-table-section/components/RecordTableRecordGroupSection.tsx +++ b/packages/twenty-front/src/modules/object-record/record-table/record-table-section/components/RecordTableRecordGroupSection.tsx @@ -64,7 +64,7 @@ const StyledChevronContainer = styled.div` z-index: ${TABLE_Z_INDEX.groupSection.stickyCell}; `; -const StyledAnimatedLightIconButton = styled(AnimatedLightIconButton)` +const StyledAnimatedLightIconButtonContainer = styled.div` display: block; margin: auto; @@ -88,7 +88,7 @@ const StyledRecordGroupSection = styled.div<{ width: number }>` z-index: ${TABLE_Z_INDEX.groupSection.stickyCell}; `; -const StyledTag = styled(Tag)` +const StyledTagContainer = styled.div` flex-shrink: 0; `; @@ -195,32 +195,36 @@ export const RecordTableRecordGroupSection = () => { - + + + - + + + * { + display: flex; + flex-direction: column; + gap: ${themeCssVariables.spacing[6]}; + padding: ${themeCssVariables.spacing[4]} ${themeCssVariables.spacing[3]}; + width: auto; + } `; export type UpdateMultipleRecordsFormProps = { @@ -50,35 +52,37 @@ export const UpdateMultipleRecordsForm = ({ })); return ( - - {fieldsWithDefinitions.map(({ fieldMetadataItem, fieldDefinition }) => { - const fieldName = fieldDefinition.metadata.fieldName; - const isRelation = isFieldRelation(fieldDefinition); - const fieldNameOrRelationIdName = - isRelation && fieldMetadataItem.type === FieldMetadataType.RELATION - ? (fieldMetadataItem.settings?.joinColumnName as string) - : fieldName; + + + {fieldsWithDefinitions.map(({ fieldMetadataItem, fieldDefinition }) => { + const fieldName = fieldDefinition.metadata.fieldName; + const isRelation = isFieldRelation(fieldDefinition); + const fieldNameOrRelationIdName = + isRelation && fieldMetadataItem.type === FieldMetadataType.RELATION + ? (fieldMetadataItem.settings?.joinColumnName as string) + : fieldName; - const value = values[fieldNameOrRelationIdName]; + const value = values[fieldNameOrRelationIdName]; - const handleValueChange = (newValue: any) => { - if (isUpdateRecordValueEmpty(newValue)) { - onChange(fieldNameOrRelationIdName, undefined); - } else { - onChange(fieldNameOrRelationIdName, newValue); - } - }; + const handleValueChange = (newValue: any) => { + if (isUpdateRecordValueEmpty(newValue)) { + onChange(fieldNameOrRelationIdName, undefined); + } else { + onChange(fieldNameOrRelationIdName, newValue); + } + }; - return ( - - ); - })} - + return ( + + ); + })} + + ); }; diff --git a/packages/twenty-front/src/modules/onboarding/components/OnboardingSyncEmailsSettingsCard.tsx b/packages/twenty-front/src/modules/onboarding/components/OnboardingSyncEmailsSettingsCard.tsx index 7c8f22b294..b124404da8 100644 --- a/packages/twenty-front/src/modules/onboarding/components/OnboardingSyncEmailsSettingsCard.tsx +++ b/packages/twenty-front/src/modules/onboarding/components/OnboardingSyncEmailsSettingsCard.tsx @@ -10,7 +10,7 @@ type OnboardingSyncEmailsSettingsCardProps = { value?: MessageChannelVisibility; }; -const StyledCardMedia = styled(SettingsAccountsVisibilityIcon)` +const StyledCardMediaContainer = styled.div` width: ${themeCssVariables.spacing[10]}; `; @@ -21,11 +21,13 @@ export const OnboardingSyncEmailsSettingsCard = ({ const optionsWithCardMedia = ONBOARDING_SYNC_EMAILS_OPTIONS.map((option) => ({ ...option, cardMedia: ( - + + + ), })); diff --git a/packages/twenty-front/src/modules/page-layout/components/PageLayoutRendererContent.tsx b/packages/twenty-front/src/modules/page-layout/components/PageLayoutRendererContent.tsx index 78f2b2bac3..8127032df0 100644 --- a/packages/twenty-front/src/modules/page-layout/components/PageLayoutRendererContent.tsx +++ b/packages/twenty-front/src/modules/page-layout/components/PageLayoutRendererContent.tsx @@ -42,11 +42,11 @@ const StyledTabsAndDashboardContainer = styled.div` overflow: hidden; `; -const StyledPageLayoutTabList = styled(PageLayoutTabList)` +const StyledPageLayoutTabListContainer = styled.div` padding-left: ${themeCssVariables.spacing[2]}; `; -const StyledScrollWrapper = styled(ScrollWrapper)` +const StyledScrollWrapperContainer = styled.div` flex: 1; `; @@ -130,27 +130,31 @@ export const PageLayoutRendererContent = () => { } /> {(sortedTabs.length > 1 || isPageLayoutInEditMode) && ( - + + + )} - - {isDefined(activeTabId) && ( - - )} - + + + {isDefined(activeTabId) && ( + + )} + + ); diff --git a/packages/twenty-front/src/modules/page-layout/widgets/components/WidgetActionFieldSeeAll.tsx b/packages/twenty-front/src/modules/page-layout/widgets/components/WidgetActionFieldSeeAll.tsx index 517dc9962a..84a2254055 100644 --- a/packages/twenty-front/src/modules/page-layout/widgets/components/WidgetActionFieldSeeAll.tsx +++ b/packages/twenty-front/src/modules/page-layout/widgets/components/WidgetActionFieldSeeAll.tsx @@ -26,9 +26,12 @@ import { LightIconButton } from 'twenty-ui/input'; import { RelationType } from '~/generated-metadata/graphql'; import { themeCssVariables } from 'twenty-ui/theme-constants'; -const StyledLink = styled(Link)` +const StyledLinkContainer = styled.div` display: flex; - text-decoration: none; + + > * { + text-decoration: none; + } `; const StyledSeeAllButtonWrapper = styled.div<{ isMobile: boolean }>` @@ -131,11 +134,13 @@ export const WidgetActionFieldSeeAll = () => { return ( <> - - - - - + + + + + + + { return ( - + + + {t`More (${remainingCount})`} ); diff --git a/packages/twenty-front/src/modules/page-layout/widgets/fields/components/FieldsWidget.tsx b/packages/twenty-front/src/modules/page-layout/widgets/fields/components/FieldsWidget.tsx index 1193244daa..8a09878d9c 100644 --- a/packages/twenty-front/src/modules/page-layout/widgets/fields/components/FieldsWidget.tsx +++ b/packages/twenty-front/src/modules/page-layout/widgets/fields/components/FieldsWidget.tsx @@ -40,9 +40,14 @@ const StyledPropertyBox = styled.div` padding-bottom: ${themeCssVariables.spacing[3]}; `; -const StyledInlineFieldsPropertyBox = styled(StyledPropertyBox)` - padding-bottom: 0; +const StyledInlineFieldsPropertyBox = styled.div` + align-self: stretch; + border-radius: ${themeCssVariables.border.radius.sm}; + display: flex; + flex-direction: column; + gap: ${themeCssVariables.spacing[2]}; padding-top: 0; + padding-bottom: 0; `; type FieldsWidgetProps = { diff --git a/packages/twenty-front/src/modules/page-layout/widgets/graph/graphWidgetAggregateChart/components/GraphWidgetAggregateChart.tsx b/packages/twenty-front/src/modules/page-layout/widgets/graph/graphWidgetAggregateChart/components/GraphWidgetAggregateChart.tsx index 23f471c53b..fa9a3ce94a 100644 --- a/packages/twenty-front/src/modules/page-layout/widgets/graph/graphWidgetAggregateChart/components/GraphWidgetAggregateChart.tsx +++ b/packages/twenty-front/src/modules/page-layout/widgets/graph/graphWidgetAggregateChart/components/GraphWidgetAggregateChart.tsx @@ -37,9 +37,11 @@ const StyledTrendIconContainer = styled.div` justify-content: center; `; -const StyledH1Title = styled(H1Title)` - font-size: ${themeCssVariables.font.size.xxl}; - margin: 0; +const StyledH1TitleWrapper = styled.div` + > h2 { + font-size: ${themeCssVariables.font.size.xxl}; + margin: 0; + } `; export const GraphWidgetAggregateChart = ({ @@ -58,10 +60,9 @@ export const GraphWidgetAggregateChart = ({ return ( - + + + {isDefined(trendPercentage) && ( diff --git a/packages/twenty-front/src/modules/page-layout/widgets/graph/graphWidgetGaugeChart/components/GraphWidgetGaugeChart.tsx b/packages/twenty-front/src/modules/page-layout/widgets/graph/graphWidgetGaugeChart/components/GraphWidgetGaugeChart.tsx index 53df5ac892..d13aea347a 100644 --- a/packages/twenty-front/src/modules/page-layout/widgets/graph/graphWidgetGaugeChart/components/GraphWidgetGaugeChart.tsx +++ b/packages/twenty-front/src/modules/page-layout/widgets/graph/graphWidgetGaugeChart/components/GraphWidgetGaugeChart.tsx @@ -51,7 +51,7 @@ const StyledChartContainer = styled.div<{ $isClickable?: boolean }>` : ''} `; -const StyledH1Title = styled(H1Title)` +const StyledH1TitleWrapper = styled.div` left: 50%; position: absolute; top: 50%; @@ -135,10 +135,12 @@ export const GraphWidgetGaugeChart = ({ layers={['bars', renderValueEndLine]} /> {showValue && ( - + + + )} void; }; -const StyledTable = styled(Table)` +const StyledTableContainer = styled.div` margin-top: ${themeCssVariables.spacing[4]}; `; -const StyledTableBody = styled(TableBody)` +const StyledTableBodyContainer = styled.div` border-bottom: 1px solid ${themeCssVariables.border.color.light}; `; @@ -28,25 +28,29 @@ export const SettingsAccountsBlocklistTable = ({ return ( <> {blocklist.length > 0 && ( - - - {t`Email/Domain`} - {t`Added to blocklist`} - - - - {blocklist.map((blocklistItem) => ( - - ))} - - + + + + {t`Email/Domain`} + {t`Added to blocklist`} + + + + + {blocklist.map((blocklistItem) => ( + + ))} + + + + )} > ); diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsCalendarVisibilitySettingsCard.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsCalendarVisibilitySettingsCard.tsx index 46f9195162..87558b6895 100644 --- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsCalendarVisibilitySettingsCard.tsx +++ b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsCalendarVisibilitySettingsCard.tsx @@ -11,8 +11,10 @@ type SettingsAccountsEventVisibilitySettingsCardProps = { value?: CalendarChannelVisibility; }; -const StyledCardMedia = styled(SettingsAccountsVisibilityIcon)` - height: ${themeCssVariables.spacing[6]}; +const StyledCardMediaContainer = styled.div` + > * { + height: ${themeCssVariables.spacing[6]}; + } `; const eventSettingsVisibilityOptions = [ @@ -20,13 +22,21 @@ const eventSettingsVisibilityOptions = [ title: msg`Everything`, description: msg`The whole event details will be shared with your team.`, value: CalendarChannelVisibility.SHARE_EVERYTHING, - cardMedia: , + cardMedia: ( + + + + ), }, { title: msg`Metadata`, description: msg`Only date & participants will be shared with your team.`, value: CalendarChannelVisibility.METADATA, - cardMedia: , + cardMedia: ( + + + + ), }, ]; diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsConnectedAccountsListCard.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsConnectedAccountsListCard.tsx index 4a1cd11b45..feea78b549 100644 --- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsConnectedAccountsListCard.tsx +++ b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsConnectedAccountsListCard.tsx @@ -19,11 +19,13 @@ const StyledTableRows = styled.div` padding-top: ${themeCssVariables.spacing[2]}; `; -const StyledAddAccountSection = styled(Section)` - border-top: 1px solid ${themeCssVariables.border.color.light}; - display: flex; - justify-content: flex-end; - padding-top: ${themeCssVariables.spacing[2]}; +const StyledAddAccountSectionContainer = styled.div` + > * { + border-top: 1px solid ${themeCssVariables.border.color.light}; + display: flex; + justify-content: flex-end; + padding-top: ${themeCssVariables.spacing[2]}; + } `; export const SettingsAccountsConnectedAccountsListCard = ({ @@ -51,15 +53,17 @@ export const SettingsAccountsConnectedAccountsListCard = ({ ))} - - navigateSettings(SettingsPath.NewAccount)} - /> - + + + navigateSettings(SettingsPath.NewAccount)} + /> + + ); }; diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsMessageAutoCreationIcon.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsMessageAutoCreationIcon.tsx index 8307e68e1f..11a37f567a 100644 --- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsMessageAutoCreationIcon.tsx +++ b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsMessageAutoCreationIcon.tsx @@ -1,6 +1,5 @@ import { styled } from '@linaria/react'; -import { SettingsAccountsCardMedia } from '@/settings/accounts/components/SettingsAccountsCardMedia'; import { themeCssVariables } from 'twenty-ui/theme-constants'; type SettingsAccountsMessageAutoCreationIconProps = { @@ -9,8 +8,18 @@ type SettingsAccountsMessageAutoCreationIconProps = { isReceivedActive?: boolean; }; -const StyledIconContainer = styled(SettingsAccountsCardMedia)` +const StyledIconContainer = styled.div` align-items: stretch; + border: 2px solid ${themeCssVariables.border.color.medium}; + border-radius: ${themeCssVariables.border.radius.sm}; + color: ${themeCssVariables.font.color.light}; + display: flex; + flex-direction: column; + gap: ${themeCssVariables.spacing['0.5']}; + height: ${themeCssVariables.spacing[8]}; + justify-content: center; + padding: ${themeCssVariables.spacing['0.5']}; + width: ${themeCssVariables.spacing[6]}; `; const StyledDirectionSkeleton = styled.div<{ isActive?: boolean }>` diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsMessageFolderIcon.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsMessageFolderIcon.tsx index b78110137c..a32792377a 100644 --- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsMessageFolderIcon.tsx +++ b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsMessageFolderIcon.tsx @@ -1,7 +1,6 @@ import { styled } from '@linaria/react'; import { MessageFolderImportPolicy } from '@/accounts/types/MessageChannel'; -import { SettingsAccountsCardMedia } from '@/settings/accounts/components/SettingsAccountsCardMedia'; import { themeCssVariables } from 'twenty-ui/theme-constants'; type SettingsAccountsMessageFolderIconProps = { @@ -9,9 +8,18 @@ type SettingsAccountsMessageFolderIconProps = { value?: MessageFolderImportPolicy; }; -const StyledCardMedia = styled(SettingsAccountsCardMedia)` +const StyledCardMedia = styled.div` align-items: stretch; + border: 2px solid ${themeCssVariables.border.color.medium}; + border-radius: ${themeCssVariables.border.radius.sm}; + color: ${themeCssVariables.font.color.light}; + display: flex; flex-direction: column; + gap: ${themeCssVariables.spacing['0.5']}; + height: ${themeCssVariables.spacing[8]}; + justify-content: center; + padding: ${themeCssVariables.spacing['0.5']}; + width: ${themeCssVariables.spacing[6]}; `; const StyledFolderRow = styled.div` 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 70b366cbe5..2fb9f59add 100644 --- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsRadioSettingsCard.tsx +++ b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsRadioSettingsCard.tsx @@ -14,11 +14,13 @@ type SettingsAccountsRadioSettingsCardProps = name: string; }; -const StyledCardContent = styled(CardContent)` - cursor: pointer; +const StyledCardContentContainer = styled.div` + > * { + cursor: pointer; - &:hover { - background: ${themeCssVariables.background.transparent.lighter}; + &:hover { + background: ${themeCssVariables.background.transparent.lighter}; + } } `; @@ -39,8 +41,10 @@ const StyledDescription = styled.div` font-size: ${themeCssVariables.font.size.sm}; `; -const StyledRadio = styled(Radio)` +const StyledRadioContainer = styled.span` margin-left: auto; + display: flex; + align-items: center; `; const StyledExpandedContent = styled.div` @@ -63,34 +67,37 @@ export const SettingsAccountsRadioSettingsCard = < }: SettingsAccountsRadioSettingsCardProps) => ( {options.map((option, index) => ( - onChange(option.value)} - > - - {option.cardMedia} - - - - - - - - - onChange(option.value)} - checked={value === option.value} - /> - - {option.cardContentExpanded && value === option.value && ( - - {option.cardContentExpanded} - - )} - + + onChange(option.value)} + > + + {option.cardMedia} + + + + + + + + + + onChange(option.value)} + checked={value === option.value} + /> + + + {option.cardContentExpanded && value === option.value && ( + + {option.cardContentExpanded} + + )} + + ))} ); diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsToggleSettingCard.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsToggleSettingCard.tsx index 661d98b595..306c3784fc 100644 --- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsToggleSettingCard.tsx +++ b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsToggleSettingCard.tsx @@ -14,14 +14,16 @@ type SettingsAccountsToggleSettingCardProps = { parameters: Parameter[]; }; -const StyledCardContent = styled(CardContent)` - align-items: center; - display: flex; - gap: ${themeCssVariables.spacing[4]}; - cursor: pointer; +const StyledCardContentContainer = styled.div` + > * { + align-items: center; + display: flex; + gap: ${themeCssVariables.spacing[4]}; + cursor: pointer; - &:hover { - background: ${themeCssVariables.background.transparent.lighter}; + &:hover { + background: ${themeCssVariables.background.transparent.lighter}; + } } `; @@ -36,8 +38,10 @@ const StyledDescription = styled.div` font-size: ${themeCssVariables.font.size.sm}; `; -const StyledToggle = styled(Toggle)` +const StyledToggleContainer = styled.span` margin-left: auto; + display: flex; + align-items: center; `; export const SettingsAccountsToggleSettingCard = ({ @@ -45,17 +49,20 @@ export const SettingsAccountsToggleSettingCard = ({ }: SettingsAccountsToggleSettingCardProps) => ( {parameters.map((parameter, index) => ( - parameter.onToggle(!parameter.value)} - > - - {parameter.title} - {parameter.description} - - - + + parameter.onToggle(!parameter.value)} + > + + {parameter.title} + {parameter.description} + + + + + + ))} ); diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsVisibilityIcon.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsVisibilityIcon.tsx index de9f7e676c..ca4c417caf 100644 --- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsVisibilityIcon.tsx +++ b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsVisibilityIcon.tsx @@ -1,6 +1,5 @@ import { styled } from '@linaria/react'; -import { SettingsAccountsCardMedia } from '@/settings/accounts/components/SettingsAccountsCardMedia'; import { themeCssVariables } from 'twenty-ui/theme-constants'; type VisibilityElementState = 'active' | 'inactive'; @@ -12,8 +11,18 @@ type SettingsAccountsVisibilityIconProps = { body?: VisibilityElementState; }; -const StyledCardMedia = styled(SettingsAccountsCardMedia)` +const StyledCardMedia = styled.div` align-items: stretch; + border: 2px solid ${themeCssVariables.border.color.medium}; + border-radius: ${themeCssVariables.border.radius.sm}; + color: ${themeCssVariables.font.color.light}; + display: flex; + flex-direction: column; + gap: ${themeCssVariables.spacing['0.5']}; + height: ${themeCssVariables.spacing[8]}; + justify-content: center; + padding: ${themeCssVariables.spacing['0.5']}; + width: ${themeCssVariables.spacing[6]}; `; const StyledSubjectSkeleton = styled.div<{ isActive?: boolean }>` @@ -25,13 +34,24 @@ const StyledSubjectSkeleton = styled.div<{ isActive?: boolean }>` height: 3px; `; -const StyledMetadataSkeleton = styled(StyledSubjectSkeleton)` +const StyledMetadataSkeleton = styled.div<{ isActive?: boolean }>` + background-color: ${({ isActive }) => + isActive + ? themeCssVariables.accent.accent4060 + : themeCssVariables.background.quaternary}; + border-radius: 1px; + height: 3px; margin-right: ${themeCssVariables.spacing[2]}; `; -const StyledBodySkeleton = styled(StyledSubjectSkeleton)` +const StyledBodySkeleton = styled.div<{ isActive?: boolean }>` + background-color: ${({ isActive }) => + isActive + ? themeCssVariables.accent.accent4060 + : themeCssVariables.background.quaternary}; border-radius: ${themeCssVariables.border.radius.xs}; flex: 1 0 auto; + height: 3px; `; export const SettingsAccountsVisibilityIcon = ({ diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsConnectedAccountsTableHeader.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsConnectedAccountsTableHeader.tsx index 4a74608151..57caed7e6f 100644 --- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsConnectedAccountsTableHeader.tsx +++ b/packages/twenty-front/src/modules/settings/accounts/components/SettingsConnectedAccountsTableHeader.tsx @@ -1,24 +1,24 @@ import { Table } from '@/ui/layout/table/components/Table'; import { TableHeader } from '@/ui/layout/table/components/TableHeader'; import { TableRow } from '@/ui/layout/table/components/TableRow'; -import { styled } from '@linaria/react'; import { Trans } from '@lingui/react/macro'; import { themeCssVariables } from 'twenty-ui/theme-constants'; -const StyledTableHeader = styled(TableHeader)` - padding-right: ${themeCssVariables.spacing[14]}; -`; - export const SettingsConnectedAccountsTableHeader = () => { return ( - + Account - - + + Status - + ); diff --git a/packages/twenty-front/src/modules/settings/accounts/components/message-folders/SettingsAccountsMessageFoldersCard.tsx b/packages/twenty-front/src/modules/settings/accounts/components/message-folders/SettingsAccountsMessageFoldersCard.tsx index 87872c5386..c49dc52e2c 100644 --- a/packages/twenty-front/src/modules/settings/accounts/components/message-folders/SettingsAccountsMessageFoldersCard.tsx +++ b/packages/twenty-front/src/modules/settings/accounts/components/message-folders/SettingsAccountsMessageFoldersCard.tsx @@ -37,18 +37,11 @@ const StyledFoldersContainer = styled.div` padding-top: ${themeCssVariables.spacing[2]}; `; -const StyledSearchInput = styled(SettingsTextInput)` +const StyledSearchInputContainer = styled.div` margin-bottom: ${themeCssVariables.spacing[2]}; width: 100%; `; -const StyledCheckboxCell = styled(TableCell)` - align-items: center; - display: flex; - padding-right: ${themeCssVariables.spacing[1]}; - justify-content: flex-end; -`; - const StyledSectionHeader = styled.div` align-items: center; background-color: ${themeCssVariables.background.transparent.lighter}; @@ -61,8 +54,10 @@ const StyledSectionHeader = styled.div` text-align: left; `; -const StyledLabel = styled(Label)` +const StyledLabelContainer = styled.span` + align-items: center; color: ${themeCssVariables.font.color.tertiary}; + display: flex; margin-bottom: ${themeCssVariables.spacing[2]}; margin-top: ${themeCssVariables.spacing[2]}; `; @@ -165,23 +160,30 @@ export const SettingsAccountsMessageFoldersCard = () => { return ( - - {t`Folders`} + + + + + {t`Folders`} + {t`Toggle all folders`} - + handleToggleAllFolders(messageFolders)} size={CheckboxSize.Small} /> - + diff --git a/packages/twenty-front/src/modules/settings/admin-panel/ai/components/SettingsAdminAI.tsx b/packages/twenty-front/src/modules/settings/admin-panel/ai/components/SettingsAdminAI.tsx index 2f88eeaa91..f17364b480 100644 --- a/packages/twenty-front/src/modules/settings/admin-panel/ai/components/SettingsAdminAI.tsx +++ b/packages/twenty-front/src/modules/settings/admin-panel/ai/components/SettingsAdminAI.tsx @@ -37,7 +37,7 @@ const StyledSearchAndFilterContainer = styled.div` width: 100%; `; -const StyledSearchInput = styled(SettingsTextInput)` +const StyledSearchInputContainer = styled.div` flex: 1; `; @@ -163,13 +163,15 @@ export const SettingsAdminAI = () => { /> - + + + { return ( - + + + ); }; diff --git a/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/SettingsAdminConfigVariablesRow.tsx b/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/SettingsAdminConfigVariablesRow.tsx index cbfc9be78b..bd6081ef75 100644 --- a/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/SettingsAdminConfigVariablesRow.tsx +++ b/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/SettingsAdminConfigVariablesRow.tsx @@ -12,16 +12,11 @@ type SettingsAdminConfigVariablesRowProps = { variable: ConfigVariable; }; -const StyledTruncatedCell = styled(TableCell)` - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - cursor: pointer; -`; - -const StyledTableRow = styled(TableRow)` - &:hover { - background-color: ${themeCssVariables.background.transparent.light}; +const StyledTableRowContainer = styled.div` + > * { + &:hover { + background-color: ${themeCssVariables.background.transparent.light}; + } } `; @@ -48,24 +43,38 @@ export const SettingsAdminConfigVariablesRow = ({ : variable.value; return ( - - - {variable.name} - - - {displayValue} - - - - - + + + + {variable.name} + + + {displayValue} + + + + + + ); }; diff --git a/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/SettingsAdminConfigVariablesTable.tsx b/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/SettingsAdminConfigVariablesTable.tsx index 8402c74cc3..bff3e09e00 100644 --- a/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/SettingsAdminConfigVariablesTable.tsx +++ b/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/SettingsAdminConfigVariablesTable.tsx @@ -8,7 +8,7 @@ import { styled } from '@linaria/react'; import { themeCssVariables } from 'twenty-ui/theme-constants'; import { type ConfigVariable } from '~/generated-metadata/graphql'; -const StyledTableBody = styled(TableBody)` +const StyledTableBodyContainer = styled.div` border-bottom: 1px solid ${themeCssVariables.border.color.light}; `; @@ -26,14 +26,16 @@ export const SettingsAdminConfigVariablesTable = ({ {t`Value`} - - {variables.map((variable) => ( - - ))} - + + + {variables.map((variable) => ( + + ))} + + ); }; diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminHealthAccountSyncCountersTable.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminHealthAccountSyncCountersTable.tsx index 0de3d9bda3..dba2921fdd 100644 --- a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminHealthAccountSyncCountersTable.tsx +++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminHealthAccountSyncCountersTable.tsx @@ -5,9 +5,11 @@ import { H2Title } from 'twenty-ui/display'; import { Section } from 'twenty-ui/layout'; import { themeCssVariables } from 'twenty-ui/theme-constants'; -const StyledSettingsAdminTableCard = styled(SettingsAdminTableCard)` - padding-left: ${themeCssVariables.spacing[2]}; - padding-right: ${themeCssVariables.spacing[2]}; +const StyledSettingsAdminTableCardContainer = styled.div` + > * { + padding-left: ${themeCssVariables.spacing[2]}; + padding-right: ${themeCssVariables.spacing[2]}; + } `; export const SettingsAdminHealthAccountSyncCountersTable = ({ @@ -47,13 +49,15 @@ export const SettingsAdminHealthAccountSyncCountersTable = ({ return ( - + + + ); }; diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkerMetricsGraph.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkerMetricsGraph.tsx index ca2653c151..596c979b70 100644 --- a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkerMetricsGraph.tsx +++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkerMetricsGraph.tsx @@ -29,9 +29,11 @@ const StyledNoDataMessage = styled.div` justify-content: center; `; -const StyledSettingsAdminTableCard = styled(SettingsAdminTableCard)` - padding-left: ${themeCssVariables.spacing[2]}; - padding-right: ${themeCssVariables.spacing[2]}; +const StyledSettingsAdminTableCardContainer = styled.div` + > * { + padding-left: ${themeCssVariables.spacing[2]}; + padding-right: ${themeCssVariables.spacing[2]}; + } `; type SettingsAdminWorkerMetricsGraphProps = { @@ -200,23 +202,25 @@ export const SettingsAdminWorkerMetricsGraph = ({ )} {metricsDetails && ( - key !== '__typename') - .map(([key, value]) => ({ - label: key.charAt(0).toUpperCase() + key.slice(1), - value: - typeof value === 'number' - ? value - : Array.isArray(value) - ? value.length - : String(value), - }))} - gridAutoColumns="1fr 1fr" - labelAlign="left" - valueAlign="right" - /> + + key !== '__typename') + .map(([key, value]) => ({ + label: key.charAt(0).toUpperCase() + key.slice(1), + value: + typeof value === 'number' + ? value + : Array.isArray(value) + ? value.length + : String(value), + }))} + gridAutoColumns="1fr 1fr" + labelAlign="left" + valueAlign="right" + /> + )} > ); diff --git a/packages/twenty-front/src/modules/settings/components/AdvancedSettingsContentWrapperWithDot.tsx b/packages/twenty-front/src/modules/settings/components/AdvancedSettingsContentWrapperWithDot.tsx index 6c3dc23007..b804c521eb 100644 --- a/packages/twenty-front/src/modules/settings/components/AdvancedSettingsContentWrapperWithDot.tsx +++ b/packages/twenty-front/src/modules/settings/components/AdvancedSettingsContentWrapperWithDot.tsx @@ -26,8 +26,10 @@ const StyledDotContainer = styled.div<{ dotPosition: DotPosition }>` dotPosition === 'top' ? 'stretch' : 'center'}; `; -const StyledIconPoint = styled(IconPoint)` +const StyledIconPointContainer = styled.span` margin-right: 0; + display: flex; + align-items: center; `; export const AdvancedSettingsContentWrapperWithDot = ({ @@ -41,11 +43,13 @@ export const AdvancedSettingsContentWrapperWithDot = ({ {!hideDot && ( - + + + )} {children} diff --git a/packages/twenty-front/src/modules/settings/components/SettingsCard.tsx b/packages/twenty-front/src/modules/settings/components/SettingsCard.tsx index 517fc2af42..f5176350f4 100644 --- a/packages/twenty-front/src/modules/settings/components/SettingsCard.tsx +++ b/packages/twenty-front/src/modules/settings/components/SettingsCard.tsx @@ -18,28 +18,34 @@ type SettingsCardProps = { Status?: ReactNode; }; -const StyledCard = styled(Card)<{ +const StyledCardWrapper = styled.div<{ disabled?: boolean; - onClick?: () => void; + clickable?: boolean; }>` color: ${({ disabled }) => disabled ? themeCssVariables.font.color.extraLight : themeCssVariables.font.color.tertiary}; - cursor: ${({ disabled, onClick }) => - disabled ? 'not-allowed' : onClick ? 'pointer' : 'default'}; + cursor: ${({ disabled, clickable }) => + disabled ? 'not-allowed' : clickable ? 'pointer' : 'default'}; width: 100%; + + > * { + color: inherit; + } `; -const StyledCardContent = styled(CardContent)` - display: flex; - flex-direction: column; - gap: ${themeCssVariables.spacing[2]}; - padding: ${themeCssVariables.spacing[2]} ${themeCssVariables.spacing[2]}; +const StyledCardContentContainer = styled.div` + > * { + display: flex; + flex-direction: column; + gap: ${themeCssVariables.spacing[2]}; + padding: ${themeCssVariables.spacing[2]} ${themeCssVariables.spacing[2]}; - &:hover { - background-color: ${themeCssVariables.background.quaternary}; - cursor: pointer; + &:hover { + background-color: ${themeCssVariables.background.quaternary}; + cursor: pointer; + } } `; @@ -61,8 +67,10 @@ const StyledTitle = styled.div<{ disabled?: boolean }>` justify-content: flex-start; `; -const StyledIconChevronRight = styled(IconChevronRight)` +const StyledIconChevronRightContainer = styled.span` + align-items: center; color: ${themeCssVariables.font.color.light}; + display: flex; `; const StyledDescription = styled.div` @@ -91,24 +99,31 @@ export const SettingsCard = ({ const { theme } = useContext(ThemeContext); return ( - - - - {Icon} - - {title} - {soon && } - - {Status && Status} - - - {description && {description}} - - + + + + + {Icon} + + {title} + {soon && } + + {Status && Status} + + + + + {description && ( + {description} + )} + + + + ); }; diff --git a/packages/twenty-front/src/modules/settings/components/SettingsConnectedAccountsTableRow.tsx b/packages/twenty-front/src/modules/settings/components/SettingsConnectedAccountsTableRow.tsx index 8a684a9452..ed8c90a31e 100644 --- a/packages/twenty-front/src/modules/settings/components/SettingsConnectedAccountsTableRow.tsx +++ b/packages/twenty-front/src/modules/settings/components/SettingsConnectedAccountsTableRow.tsx @@ -14,10 +14,12 @@ const StyledNameCell = styled.div` gap: ${themeCssVariables.spacing[1]}; `; -const StyledTableRow = styled(TableRow)` - &:hover { - background: ${themeCssVariables.background.transparent.light}; - cursor: pointer; +const StyledTableRowContainer = styled.div` + > * { + &:hover { + background-color: ${themeCssVariables.background.transparent.light}; + cursor: pointer; + } } `; @@ -32,19 +34,23 @@ export const SettingsConnectedAccountsTableRow = ({ const IconComponent = SettingsConnectedAccountIcon({ account }); return ( - - - - + + + + + {account.handle} + + + + - {account.handle} - - - - - - + + + ); }; diff --git a/packages/twenty-front/src/modules/settings/components/SettingsCounter.tsx b/packages/twenty-front/src/modules/settings/components/SettingsCounter.tsx index 23c4a62be7..bfa44671c3 100644 --- a/packages/twenty-front/src/modules/settings/components/SettingsCounter.tsx +++ b/packages/twenty-front/src/modules/settings/components/SettingsCounter.tsx @@ -25,9 +25,10 @@ const StyledCounterContainer = styled.div<{ showButtons: boolean }>` : themeCssVariables.spacing[16]}; `; -const StyledTextInput = styled(SettingsTextInput)` +const StyledTextInputContainer = styled.div` width: ${themeCssVariables.spacing[16]}; - input { + + > * input { width: ${themeCssVariables.spacing[16]}; height: ${themeCssVariables.spacing[6]}; text-align: center; @@ -84,14 +85,16 @@ export const SettingsCounter = ({ disabled={disabled} /> )} - + + + {showButtons && ( * { +const StyledTableRowContainer = styled.div` + > * > * { min-width: 0; max-width: 100%; overflow: hidden; } `; -const StyledTableCell = styled(TableCell)` +const StyledTableCellFontWrapper = styled.div` + display: contents; font-family: monospace; `; @@ -69,53 +70,69 @@ export const SettingsDnsRecordsTable = ({ return ( - - {t`Type`} - {t`Key`} - {t`Value`} - {hasPriorityRecords && ( - {t`Priority`} - )} - {hasTtlRecords && {t`TTL`}} - {hasStatusRecords && ( - {t`Status`} - )} - + + + {t`Type`} + {t`Key`} + {t`Value`} + {hasPriorityRecords && ( + {t`Priority`} + )} + {hasTtlRecords && {t`TTL`}} + {hasStatusRecords && ( + {t`Status`} + )} + + {records.map((record) => ( - - {record.type} - { - copyToClipboard(record.key || ''); - }} - > - - + + + {record.type} + + { + copyToClipboard(record.key || ''); + }} + > + + + - { - copyToClipboard(record.value); - }} - > - - + + { + copyToClipboard(record.value); + }} + > + + + - {hasPriorityRecords && ( - {record.priority} - )} - {hasTtlRecords && {record.ttl}} - {hasStatusRecords && ( - - {'status' in record ? ( - - ) : null} - - )} - + {hasPriorityRecords && ( + + {record.priority} + + )} + {hasTtlRecords && ( + + {record.ttl} + + )} + {hasStatusRecords && ( + + + {'status' in record ? ( + + ) : null} + + + )} + + ))} ); diff --git a/packages/twenty-front/src/modules/settings/components/SettingsListCard.tsx b/packages/twenty-front/src/modules/settings/components/SettingsListCard.tsx index 9162748607..ecd692c8bc 100644 --- a/packages/twenty-front/src/modules/settings/components/SettingsListCard.tsx +++ b/packages/twenty-front/src/modules/settings/components/SettingsListCard.tsx @@ -8,10 +8,12 @@ import { Card, CardFooter } from 'twenty-ui/layout'; import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants'; import { SettingsListItemCardContent } from './SettingsListItemCardContent'; -const StyledFooter = styled(CardFooter)` - align-items: center; - display: flex; - padding: ${themeCssVariables.spacing[1]}; +const StyledFooterContainer = styled.div` + > * { + align-items: center; + display: flex; + padding: ${themeCssVariables.spacing[1]}; + } `; const StyledButton = styled.button` @@ -91,12 +93,14 @@ export const SettingsListCard = < /> ))} {hasFooter && ( - - - - {footerButtonLabel} - - + + + + + {footerButtonLabel} + + + )} ); diff --git a/packages/twenty-front/src/modules/settings/components/SettingsListItemCardContent.tsx b/packages/twenty-front/src/modules/settings/components/SettingsListItemCardContent.tsx index 15bbf0d060..948d41f0e9 100644 --- a/packages/twenty-front/src/modules/settings/components/SettingsListItemCardContent.tsx +++ b/packages/twenty-front/src/modules/settings/components/SettingsListItemCardContent.tsx @@ -6,15 +6,17 @@ import { IconChevronRight, type IconComponent } from 'twenty-ui/display'; import { CardContent } from 'twenty-ui/layout'; import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants'; -const StyledRow = styled(CardContent)` - align-items: center; - display: flex; - font-size: ${themeCssVariables.font.size.sm}; - font-weight: ${themeCssVariables.font.weight.medium}; - gap: ${themeCssVariables.spacing[2]}; - padding: ${themeCssVariables.spacing[2]}; - padding-left: ${themeCssVariables.spacing[3]}; - min-height: ${themeCssVariables.spacing[6]}; +const StyledRowContainer = styled.div` + > * { + align-items: center; + display: flex; + font-size: ${themeCssVariables.font.size.sm}; + font-weight: ${themeCssVariables.font.weight.medium}; + gap: ${themeCssVariables.spacing[2]}; + padding: ${themeCssVariables.spacing[2]}; + padding-left: ${themeCssVariables.spacing[3]}; + min-height: ${themeCssVariables.spacing[6]}; + } `; const StyledRightContainer = styled.div` @@ -43,9 +45,11 @@ const StyledDescription = styled.span` padding-left: ${themeCssVariables.spacing[1]}; `; -const StyledLink = styled(Link)` - color: ${themeCssVariables.font.color.secondary}; - text-decoration: none; +const StyledLinkContainer = styled.div` + > a { + color: ${themeCssVariables.font.color.secondary}; + text-decoration: none; + } `; type SettingsListItemCardContentProps = { @@ -72,36 +76,44 @@ export const SettingsListItemCardContent = ({ const { theme } = useContext(ThemeContext); const content = ( - - {!!LeftIcon && ( - - )} - - {label} - {!!description && {description}} - - - {rightComponent} - {!!to && ( - + + {!!LeftIcon && ( + )} - - + + {label} + {!!description && ( + {description} + )} + + + {rightComponent} + {!!to && ( + + )} + + + ); if (isDefined(to)) { - return {content}; + return ( + + {content} + + ); } return content; diff --git a/packages/twenty-front/src/modules/settings/components/SettingsListSkeletonCard.tsx b/packages/twenty-front/src/modules/settings/components/SettingsListSkeletonCard.tsx index b93b816a9b..f1a4c5ca4c 100644 --- a/packages/twenty-front/src/modules/settings/components/SettingsListSkeletonCard.tsx +++ b/packages/twenty-front/src/modules/settings/components/SettingsListSkeletonCard.tsx @@ -2,9 +2,17 @@ import { styled } from '@linaria/react'; import { Card } from 'twenty-ui/layout'; import { themeCssVariables } from 'twenty-ui/theme-constants'; -const StyledCard = styled(Card)` - background-color: ${themeCssVariables.background.secondary}; +const StyledCardContainer = styled.div` height: 40px; + + > * { + background-color: ${themeCssVariables.background.secondary}; + height: 100%; + } `; -export { StyledCard as SettingsListSkeletonCard }; +export const SettingsListSkeletonCard = () => ( + + + +); diff --git a/packages/twenty-front/src/modules/settings/components/SettingsOptions/SettingsOptionCardContentToggle.tsx b/packages/twenty-front/src/modules/settings/components/SettingsOptions/SettingsOptionCardContentToggle.tsx index 6ccb3365cb..795be2e3a0 100644 --- a/packages/twenty-front/src/modules/settings/components/SettingsOptions/SettingsOptionCardContentToggle.tsx +++ b/packages/twenty-front/src/modules/settings/components/SettingsOptions/SettingsOptionCardContentToggle.tsx @@ -1,6 +1,5 @@ import { Separator } from '@/settings/components/Separator'; import { - StyledSettingsCardContent, StyledSettingsCardDescription, StyledSettingsCardIcon, StyledSettingsCardTextContainer, @@ -16,7 +15,12 @@ import { import { Toggle } from 'twenty-ui/input'; import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants'; -const StyledSettingsCardToggleContent = styled(StyledSettingsCardContent)` +const StyledSettingsCardToggleContent = styled.div<{ disabled?: boolean }>` + align-items: center; + display: flex; + gap: ${themeCssVariables.spacing[3]}; + background-color: ${themeCssVariables.background.secondary}; + padding: ${themeCssVariables.spacing[4]}; cursor: ${({ disabled }) => (disabled ? 'default' : 'pointer')}; position: relative; pointer-events: ${({ disabled }) => (disabled ? 'none' : 'auto')}; @@ -26,7 +30,9 @@ const StyledSettingsCardToggleContent = styled(StyledSettingsCardContent)` } `; -const StyledSettingsCardToggleButton = styled(Toggle)` +const StyledSettingsCardToggleButtonContainer = styled.span` + align-items: center; + display: flex; flex-shrink: 0; margin-left: auto; `; @@ -84,15 +90,17 @@ export const SettingsOptionCardContentToggle = ({ )} - + + + {divider && } > diff --git a/packages/twenty-front/src/modules/settings/components/SettingsRadioCard.tsx b/packages/twenty-front/src/modules/settings/components/SettingsRadioCard.tsx index 0db376386a..deccf22129 100644 --- a/packages/twenty-front/src/modules/settings/components/SettingsRadioCard.tsx +++ b/packages/twenty-front/src/modules/settings/components/SettingsRadioCard.tsx @@ -5,22 +5,26 @@ import { type IconComponent } from 'twenty-ui/display'; import { Radio } from 'twenty-ui/input'; import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants'; -const StyledRadioCardContent = styled(CardContent)` - display: flex; - align-items: center; - padding: ${themeCssVariables.spacing[2]}; - border: 1px solid ${themeCssVariables.border.color.medium}; - border-radius: ${themeCssVariables.border.radius.sm}; - flex-grow: 1; - gap: ${themeCssVariables.spacing[2]}; - cursor: pointer; +const StyledRadioCardContentContainer = styled.div` + > * { + display: flex; + align-items: center; + padding: ${themeCssVariables.spacing[2]}; + border: 1px solid ${themeCssVariables.border.color.medium}; + border-radius: ${themeCssVariables.border.radius.sm}; + flex-grow: 1; + gap: ${themeCssVariables.spacing[2]}; + cursor: pointer; - &:hover { - background: ${themeCssVariables.background.transparent.lighter}; + &:hover { + background: ${themeCssVariables.background.transparent.lighter}; + } } `; -const StyledRadio = styled(Radio)` +const StyledRadioContainer = styled.span` + align-items: center; + display: flex; margin-left: auto; padding: ${themeCssVariables.spacing[1]}; `; @@ -58,13 +62,17 @@ export const SettingsRadioCard = ({ const onClick = () => handleSelect(value); return ( - - {Icon && } - - {title && {title}} - {description && {description}} - - - + + + {Icon && } + + {title && {title}} + {description && {description}} + + + + + + ); }; diff --git a/packages/twenty-front/src/modules/settings/components/SettingsSummaryCard.tsx b/packages/twenty-front/src/modules/settings/components/SettingsSummaryCard.tsx index 779b7468e9..e1fce173fe 100644 --- a/packages/twenty-front/src/modules/settings/components/SettingsSummaryCard.tsx +++ b/packages/twenty-front/src/modules/settings/components/SettingsSummaryCard.tsx @@ -8,12 +8,14 @@ type SettingsSummaryCardProps = { rightComponent: ReactNode; }; -const StyledCardContent = styled(CardContent)` - align-items: center; - display: flex; - gap: ${themeCssVariables.spacing[2]}; - padding: ${themeCssVariables.spacing[2]}; - min-height: ${themeCssVariables.spacing[6]}; +const StyledCardContentContainer = styled.div` + > * { + align-items: center; + display: flex; + gap: ${themeCssVariables.spacing[2]}; + padding: ${themeCssVariables.spacing[2]}; + min-height: ${themeCssVariables.spacing[6]}; + } `; const StyledTitle = styled.div` @@ -29,9 +31,11 @@ export const SettingsSummaryCard = ({ rightComponent, }: SettingsSummaryCardProps) => ( - - {title} - {rightComponent} - + + + {title} + {rightComponent} + + ); diff --git a/packages/twenty-front/src/modules/settings/data-model/components/SettingsDataModelNewFieldBreadcrumbDropDown.tsx b/packages/twenty-front/src/modules/settings/data-model/components/SettingsDataModelNewFieldBreadcrumbDropDown.tsx index 3644ba1a5c..f0d3346ff1 100644 --- a/packages/twenty-front/src/modules/settings/data-model/components/SettingsDataModelNewFieldBreadcrumbDropDown.tsx +++ b/packages/twenty-front/src/modules/settings/data-model/components/SettingsDataModelNewFieldBreadcrumbDropDown.tsx @@ -28,8 +28,10 @@ const StyledButtonContainer = styled.div` width: 100%; `; -const StyledDownChevron = styled(IconChevronDown)` +const StyledDownChevronContainer = styled.span` + align-items: center; color: ${themeCssVariables.font.color.primary}; + display: flex; position: absolute; right: ${themeCssVariables.spacing['1.5']}; top: 50%; @@ -45,9 +47,11 @@ const StyledSpan = styled.span` margin-left: ${themeCssVariables.spacing[2]}; `; -const StyledButton = styled(Button)` - color: ${themeCssVariables.font.color.primary}; - padding-right: ${themeCssVariables.spacing[6]}; +const StyledButtonWrapper = styled.div` + > button { + color: ${themeCssVariables.font.color.primary}; + padding-right: ${themeCssVariables.spacing[6]}; + } `; export const SettingsDataModelNewFieldBreadcrumbDropDown = () => { @@ -87,11 +91,17 @@ export const SettingsDataModelNewFieldBreadcrumbDropDown = () => { dropdownId={dropdownId} clickableComponent={ - + + + {isConfigureStep ? ( - + + + ) : ( - + + + )} } diff --git a/packages/twenty-front/src/modules/settings/data-model/components/SettingsDataModelPreviewFormCard.tsx b/packages/twenty-front/src/modules/settings/data-model/components/SettingsDataModelPreviewFormCard.tsx index 1f288b3b79..3cec59acfe 100644 --- a/packages/twenty-front/src/modules/settings/data-model/components/SettingsDataModelPreviewFormCard.tsx +++ b/packages/twenty-front/src/modules/settings/data-model/components/SettingsDataModelPreviewFormCard.tsx @@ -13,12 +13,16 @@ type SettingsDataModelPreviewFormCardProps = { disabled?: boolean; }; -const StyledPreviewContainer = styled(CardContent)` - background-color: ${themeCssVariables.background.transparent.lighter}; +const StyledPreviewContainerWrapper = styled.div` + > * { + background-color: ${themeCssVariables.background.transparent.lighter}; + } `; -const StyledFormContainer = styled(CardContent)` - padding: 0; +const StyledFormContainerWrapper = styled.div` + > * { + padding: 0; + } `; export const SettingsDataModelPreviewFormCard = ({ @@ -27,12 +31,18 @@ export const SettingsDataModelPreviewFormCard = ({ form, }: SettingsDataModelPreviewFormCardProps) => ( - - - Preview - - {preview} - - {!!form && {form}} + + + + Preview + + {preview} + + + {!!form && ( + + {form} + + )} ); diff --git a/packages/twenty-front/src/modules/settings/data-model/fields/forms/components/SettingsObjectNewFieldSelector.tsx b/packages/twenty-front/src/modules/settings/data-model/fields/forms/components/SettingsObjectNewFieldSelector.tsx index 32ffe2796c..a6073125b8 100644 --- a/packages/twenty-front/src/modules/settings/data-model/fields/forms/components/SettingsObjectNewFieldSelector.tsx +++ b/packages/twenty-front/src/modules/settings/data-model/fields/forms/components/SettingsObjectNewFieldSelector.tsx @@ -56,7 +56,7 @@ const StyledCardContainer = styled.div` width: calc(50% - ${themeCssVariables.spacing[1]}); `; -const StyledSearchInput = styled(SettingsTextInput)` +const StyledSearchInputContainer = styled.div` width: 100%; `; @@ -108,13 +108,15 @@ export const SettingsObjectNewFieldSelector = ({ <> {' '} - + + + ( - onChange(value)} - disabled={false} - fullWidth - /> + + onChange(value)} + disabled={false} + fullWidth + /> + )} /> diff --git a/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectForm.tsx b/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectForm.tsx index c768535687..a7c1a77d4a 100644 --- a/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectForm.tsx +++ b/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectForm.tsx @@ -67,8 +67,10 @@ type SettingsDataModelFieldSelectFormProps = { disabled?: boolean; }; -const StyledContainer = styled(CardContent)` - padding-bottom: 14px; +const StyledContainerWrapper = styled.div` + > * { + padding-bottom: 14px; + } `; const StyledOptionsLabel = styled.div<{ @@ -119,18 +121,24 @@ const StyledIconContainer = styled.div` margin-top: ${themeCssVariables.spacing[1]}; `; -const StyledIconPoint = styled(IconPoint)` +const StyledIconPointContainer = styled.span` margin-right: ${themeCssVariables.spacing['0.5']}; + display: flex; + align-items: center; `; -const StyledFooter = styled(CardFooter)` - background-color: ${themeCssVariables.background.secondary}; - padding: ${themeCssVariables.spacing[1]}; +const StyledFooterContainer = styled.div` + > * { + background-color: ${themeCssVariables.background.secondary}; + padding: ${themeCssVariables.spacing[1]}; + } `; -const StyledButton = styled(LightButton)` - justify-content: center; - width: 100%; +const StyledButtonContainer = styled.div` + > button { + justify-content: center; + width: 100%; + } `; const StyledOptionsHeaderContainer = styled.div` @@ -316,199 +324,212 @@ export const SettingsDataModelFieldSelectForm = ({ defaultValue={initialOptions} render={({ field: { onChange, value: options } }) => ( <> - - - - {!isBulkInputMode && ( - - - - - - {t`API values`} - - - )} - - {t`Options`} - - - {!disabled && ( - - } - dropdownComponents={ - + + + + {!isBulkInputMode && ( + - - { - if (!isBulkInputMode) { - setBulkInputText( - convertOptionsToBulkText(options), - ); - } - setIsBulkInputMode( - (currentInputMode) => !currentInputMode, - ); - closeOptionsDropdown(OPTIONS_DROPDOWN_ID); - }} - /> - { - onChange([]); - closeOptionsDropdown(OPTIONS_DROPDOWN_ID); - }} - /> - - - } - /> - )} - - - {isBulkInputMode ? ( - - { - if (disabled) { - return; - } - - const nextOptions = convertBulkTextToOptions( - nextOptionAsText, - options, - ); - - onChange(nextOptions); - setBulkInputText(nextOptionAsText); - }} - minRows={5} - maxRows={15} - disabled={disabled} - /> - - {t`Enter one option per line. Each line will become a new option.`} - - - ) : ( - <> - - !disabled - ? handleDragEnd(options, result, onChange) - : undefined - } - draggableItems={ - <> - {options.map((option, index) => ( - { - if (disabled) { - return; - } - const nextOptions = toSpliced( - options, - index, - 1, - nextOption, - ); - onChange(nextOptions); - - // Update option value in defaultValue if value has changed - if ( - nextOption.value !== option.value && - isOptionDefaultValue(option.value) - ) { - handleRemoveOptionAsDefault(option.value); - handleSetOptionAsDefault(nextOption.value); - } - }} - onRemove={() => { - if (disabled) { - return; - } - const nextOptions = toSpliced( - options, - index, - 1, - ).map((option, nextOptionIndex) => ({ - ...option, - position: nextOptionIndex, - })); - onChange(nextOptions); - }} - isDefault={isOptionDefaultValue(option.value)} - fieldIsNullable={!!isNullable} - onSetAsDefault={() => { - if (disabled) { - return; - } - handleSetOptionAsDefault(option.value); - }} - onRemoveAsDefault={() => { - if (disabled) { - return; - } - handleRemoveOptionAsDefault(option.value); - }} - onInputEnter={() => { - if (disabled) { - return; - } - handleInputEnter(); - }} + + + + - } - /> - ))} - > - } - /> - > - )} - + + + {t`API values`} + + + )} + + {t`Options`} + + + {!disabled && ( + + } + dropdownComponents={ + + + { + if (!isBulkInputMode) { + setBulkInputText( + convertOptionsToBulkText(options), + ); + } + setIsBulkInputMode( + (currentInputMode) => !currentInputMode, + ); + closeOptionsDropdown(OPTIONS_DROPDOWN_ID); + }} + /> + { + onChange([]); + closeOptionsDropdown(OPTIONS_DROPDOWN_ID); + }} + /> + + + } + /> + )} + + + {isBulkInputMode ? ( + + { + if (disabled) { + return; + } + + const nextOptions = convertBulkTextToOptions( + nextOptionAsText, + options, + ); + + onChange(nextOptions); + setBulkInputText(nextOptionAsText); + }} + minRows={5} + maxRows={15} + disabled={disabled} + /> + + {t`Enter one option per line. Each line will become a new option.`} + + + ) : ( + <> + + !disabled + ? handleDragEnd(options, result, onChange) + : undefined + } + draggableItems={ + <> + {options.map((option, index) => ( + { + if (disabled) { + return; + } + const nextOptions = toSpliced( + options, + index, + 1, + nextOption, + ); + onChange(nextOptions); + + // Update option value in defaultValue if value has changed + if ( + nextOption.value !== option.value && + isOptionDefaultValue(option.value) + ) { + handleRemoveOptionAsDefault(option.value); + handleSetOptionAsDefault( + nextOption.value, + ); + } + }} + onRemove={() => { + if (disabled) { + return; + } + const nextOptions = toSpliced( + options, + index, + 1, + ).map((option, nextOptionIndex) => ({ + ...option, + position: nextOptionIndex, + })); + onChange(nextOptions); + }} + isDefault={isOptionDefaultValue(option.value)} + fieldIsNullable={!!isNullable} + onSetAsDefault={() => { + if (disabled) { + return; + } + handleSetOptionAsDefault(option.value); + }} + onRemoveAsDefault={() => { + if (disabled) { + return; + } + handleRemoveOptionAsDefault(option.value); + }} + onInputEnter={() => { + if (disabled) { + return; + } + handleInputEnter(); + }} + /> + } + /> + ))} + > + } + /> + > + )} + + {!disabled && !isBulkInputMode && ( - - - + + + + + + + )} > )} diff --git a/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectFormOptionRow.tsx b/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectFormOptionRow.tsx index ff737334fa..e63be1ea93 100644 --- a/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectFormOptionRow.tsx +++ b/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectFormOptionRow.tsx @@ -75,13 +75,14 @@ const StyledRow = styled.div` padding: ${themeCssVariables.spacing['1.5']} 0; `; -const StyledColorSample = styled(ColorSample)` +const StyledColorSampleContainer = styled.span` cursor: pointer; margin-top: ${themeCssVariables.spacing[1]}; margin-bottom: ${themeCssVariables.spacing[1]}; - margin-right: 14px; margin-left: 14px; + display: flex; + align-items: center; `; const StyledOptionInputContainer = styled.div` @@ -93,12 +94,16 @@ const StyledOptionInputContainer = styled.div` } `; -const StyledIconGripVertical = styled(IconGripVertical)` +const StyledIconGripVerticalContainer = styled.span` margin-right: 3px; + display: flex; + align-items: center; `; -const StyledLightIconButton = styled(LightIconButton)` +const StyledLightIconButtonContainer = styled.span` margin-left: ${themeCssVariables.spacing[2]}; + display: flex; + align-items: center; `; export const SettingsDataModelFieldSelectFormOptionRow = ({ @@ -129,14 +134,16 @@ export const SettingsDataModelFieldSelectFormOptionRow = ({ return ( - + + + } + clickableComponent={ + + + + } dropdownComponents={ @@ -203,11 +214,13 @@ export const SettingsDataModelFieldSelectFormOptionRow = ({ dropdownId={SELECT_ACTIONS_DROPDOWN_ID} dropdownPlacement="right-start" clickableComponent={ - + + + } dropdownComponents={ shouldForbidRemoveAsDefault ? null : ( diff --git a/packages/twenty-front/src/modules/settings/data-model/fields/preview/components/SettingsDataModelFieldPreviewWidget.tsx b/packages/twenty-front/src/modules/settings/data-model/fields/preview/components/SettingsDataModelFieldPreviewWidget.tsx index a62169982e..2f40d9d031 100644 --- a/packages/twenty-front/src/modules/settings/data-model/fields/preview/components/SettingsDataModelFieldPreviewWidget.tsx +++ b/packages/twenty-front/src/modules/settings/data-model/fields/preview/components/SettingsDataModelFieldPreviewWidget.tsx @@ -21,13 +21,17 @@ type SettingsDataModelFieldPreviewWidgetProps = { fullWidth?: boolean; }; -const StyledCard = styled(Card)` - border-radius: ${themeCssVariables.border.radius.md}; - color: ${themeCssVariables.font.color.primary}; +const StyledCardContainer = styled.div` + > * { + border-radius: ${themeCssVariables.border.radius.md}; + color: ${themeCssVariables.font.color.primary}; + } `; -const StyledCardContent = styled(CardContent)` - padding: ${themeCssVariables.spacing[2]}; +const StyledCardContentContainer = styled.div` + > * { + padding: ${themeCssVariables.spacing[2]}; + } `; export const SettingsDataModelFieldPreviewWidget = ({ @@ -43,27 +47,31 @@ export const SettingsDataModelFieldPreviewWidget = ({ }); return ( - - - - - - + + + + + + + + + + ); }; diff --git a/packages/twenty-front/src/modules/settings/data-model/fields/preview/components/SettingsDataModelRelationFieldPreviewSubWidget.tsx b/packages/twenty-front/src/modules/settings/data-model/fields/preview/components/SettingsDataModelRelationFieldPreviewSubWidget.tsx index 975d0bf012..080e397621 100644 --- a/packages/twenty-front/src/modules/settings/data-model/fields/preview/components/SettingsDataModelRelationFieldPreviewSubWidget.tsx +++ b/packages/twenty-front/src/modules/settings/data-model/fields/preview/components/SettingsDataModelRelationFieldPreviewSubWidget.tsx @@ -21,14 +21,19 @@ export type SettingsDataModelRelationFieldPreviewSubWidgetProps = { pluralizeLabel?: boolean; }; -const StyledCard = styled(Card)` - border-radius: ${themeCssVariables.border.radius.md}; - color: ${themeCssVariables.font.color.primary}; +const StyledCardContainer = styled.div` margin: auto; + + > * { + border-radius: ${themeCssVariables.border.radius.md}; + color: ${themeCssVariables.font.color.primary}; + } `; -const StyledCardContent = styled(CardContent)` - padding: ${themeCssVariables.spacing[2]}; +const StyledCardContentContainer = styled.div` + > * { + padding: ${themeCssVariables.spacing[2]}; + } `; export const SettingsDataModelRelationFieldPreviewSubWidget = ({ @@ -49,21 +54,25 @@ export const SettingsDataModelRelationFieldPreviewSubWidget = ({ .filter(isDefined); return ( - - - - - - + + + + + + + + + + ); }; diff --git a/packages/twenty-front/src/modules/settings/data-model/graph-overview/components/SettingsDataModelOverviewObject.tsx b/packages/twenty-front/src/modules/settings/data-model/graph-overview/components/SettingsDataModelOverviewObject.tsx index dbf2289287..1438885400 100644 --- a/packages/twenty-front/src/modules/settings/data-model/graph-overview/components/SettingsDataModelOverviewObject.tsx +++ b/packages/twenty-front/src/modules/settings/data-model/graph-overview/components/SettingsDataModelOverviewObject.tsx @@ -86,15 +86,17 @@ const StyledObjectInstanceCount = styled.div` color: ${themeCssVariables.font.color.tertiary}; `; -const StyledObjectLink = styled(Link)` - align-items: center; - display: flex; - gap: ${themeCssVariables.spacing[1]}; - text-decoration: none; - color: ${themeCssVariables.font.color.primary}; +const StyledObjectLinkContainer = styled.div` + > a { + align-items: center; + display: flex; + gap: ${themeCssVariables.spacing[1]}; + text-decoration: none; + color: ${themeCssVariables.font.color.primary}; - &:hover { - color: ${themeCssVariables.font.color.secondary}; + &:hover { + color: ${themeCssVariables.font.color.secondary}; + } } `; @@ -123,14 +125,16 @@ export const SettingsDataModelOverviewObject = ({ {}} onMouseLeave={() => {}}> - - {Icon && } - {objectMetadataItem.labelPlural} - + + + {Icon && } + {objectMetadataItem.labelPlural} + + · {totalCount} diff --git a/packages/twenty-front/src/modules/settings/data-model/new-object/components/SettingsAvailableStandardObjectItemTableRow.tsx b/packages/twenty-front/src/modules/settings/data-model/new-object/components/SettingsAvailableStandardObjectItemTableRow.tsx index 1a55235794..d0058cc2b5 100644 --- a/packages/twenty-front/src/modules/settings/data-model/new-object/components/SettingsAvailableStandardObjectItemTableRow.tsx +++ b/packages/twenty-front/src/modules/settings/data-model/new-object/components/SettingsAvailableStandardObjectItemTableRow.tsx @@ -1,34 +1,21 @@ -import { styled } from '@linaria/react'; - import { type ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem'; import { TableCell } from '@/ui/layout/table/components/TableCell'; import { TableRow } from '@/ui/layout/table/components/TableRow'; import { Checkbox } from 'twenty-ui/input'; import { useIcons } from 'twenty-ui/display'; +import { styled } from '@linaria/react'; import { useContext } from 'react'; import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants'; +export const AVAILABLE_STANDARD_OBJECTS_GRID_TEMPLATE_COLUMNS = + '28px 148px 256px 80px'; + type SettingsAvailableStandardObjectItemTableRowProps = { isSelected?: boolean; objectItem: ObjectMetadataItem; onClick?: () => void; }; -export const StyledAvailableStandardObjectTableRow = styled(TableRow)` - grid-template-columns: 28px 148px 256px 80px; -`; - -const StyledCheckboxTableCell = styled(TableCell)` - justify-content: center; - padding: 0; - padding-left: ${themeCssVariables.spacing[1]}; -`; - -const StyledNameTableCell = styled(TableCell)` - color: ${themeCssVariables.font.color.primary}; - gap: ${themeCssVariables.spacing[2]}; -`; - const StyledDescription = styled.div` overflow: hidden; text-overflow: ellipsis; @@ -45,22 +32,29 @@ export const SettingsAvailableStandardObjectItemTableRow = ({ const Icon = getIcon(objectItem.icon); return ( - - + - - + + {!!Icon && } {objectItem.labelPlural} - + {objectItem.description} {objectItem.fields.length} - + ); }; diff --git a/packages/twenty-front/src/modules/settings/data-model/new-object/components/SettingsAvailableStandardObjectsSection.tsx b/packages/twenty-front/src/modules/settings/data-model/new-object/components/SettingsAvailableStandardObjectsSection.tsx index d435c185c3..a412700b66 100644 --- a/packages/twenty-front/src/modules/settings/data-model/new-object/components/SettingsAvailableStandardObjectsSection.tsx +++ b/packages/twenty-front/src/modules/settings/data-model/new-object/components/SettingsAvailableStandardObjectsSection.tsx @@ -6,9 +6,10 @@ import { TableHeader } from '@/ui/layout/table/components/TableHeader'; import { t } from '@lingui/core/macro'; import { H2Title } from 'twenty-ui/display'; import { Section } from 'twenty-ui/layout'; +import { TableRow } from '@/ui/layout/table/components/TableRow'; import { + AVAILABLE_STANDARD_OBJECTS_GRID_TEMPLATE_COLUMNS, SettingsAvailableStandardObjectItemTableRow, - StyledAvailableStandardObjectTableRow, } from './SettingsAvailableStandardObjectItemTableRow'; type SettingsAvailableStandardObjectsSectionProps = { @@ -28,12 +29,14 @@ export const SettingsAvailableStandardObjectsSection = ({ description={t`Select one or several standard objects to activate below`} /> - + {t`Name`} {t`Description`} {t`Fields`} - + {objectItems.map((objectItem) => ( - + {!!Icon && ( {t`Deactivated`} )} - + @@ -232,14 +227,19 @@ export const SettingsObjectFieldItemTableRow = ({ }} /> - + {status === 'active' ? ( mode === 'view' ? ( - + + + ) : ( canToggleField && ( @@ -273,7 +273,7 @@ export const SettingsObjectFieldItemTableRow = ({ onClick={handleToggleField} /> )} - - + + ); }; diff --git a/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectItemTableRow.tsx b/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectItemTableRow.tsx index 5d14a976f8..e20a1e7146 100644 --- a/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectItemTableRow.tsx +++ b/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectItemTableRow.tsx @@ -5,10 +5,11 @@ import { useLingui } from '@lingui/react/macro'; import { type ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem'; import { isHiddenSystemField } from '@/object-metadata/utils/isHiddenSystemField'; import { SettingsItemTypeTag } from '@/settings/components/SettingsItemTypeTag'; +import { TableRow } from '@/ui/layout/table/components/TableRow'; import { + SETTINGS_OBJECT_TABLE_ROW_GRID_TEMPLATE_COLUMNS, StyledActionTableCell, StyledNameTableCell, - StyledObjectTableRow, } from '@/settings/data-model/object-details/components/SettingsObjectItemTableRowStyledComponents'; import { TableCell } from '@/ui/layout/table/components/TableCell'; import { useIcons } from 'twenty-ui/display'; @@ -63,7 +64,11 @@ export const SettingsObjectMetadataItemTableRow = ({ const Icon = getIcon(objectMetadataItem.icon); return ( - + {!!Icon && ( {totalObjectCount} {action} - + ); }; diff --git a/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectItemTableRowStyledComponents.ts b/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectItemTableRowStyledComponents.ts deleted file mode 100644 index a5491d4fe2..0000000000 --- a/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectItemTableRowStyledComponents.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { styled } from '@linaria/react'; - -import { TableCell } from '@/ui/layout/table/components/TableCell'; -import { TableRow } from '@/ui/layout/table/components/TableRow'; -import { themeCssVariables } from 'twenty-ui/theme-constants'; - -export const SETTINGS_OBJECT_TABLE_COLUMN_WIDTH = '98.7px'; - -export const StyledObjectTableRow = styled(TableRow)` - grid-template-columns: 180px ${SETTINGS_OBJECT_TABLE_COLUMN_WIDTH} ${SETTINGS_OBJECT_TABLE_COLUMN_WIDTH} ${SETTINGS_OBJECT_TABLE_COLUMN_WIDTH} 36px; -`; - -export const StyledNameTableCell = styled(TableCell)` - color: ${themeCssVariables.font.color.primary}; - gap: ${themeCssVariables.spacing[2]}; -`; - -export const StyledActionTableCell = styled(TableCell)` - justify-content: center; - padding-right: ${themeCssVariables.spacing[1]}; -`; diff --git a/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectItemTableRowStyledComponents.tsx b/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectItemTableRowStyledComponents.tsx new file mode 100644 index 0000000000..a46d6ba0f7 --- /dev/null +++ b/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectItemTableRowStyledComponents.tsx @@ -0,0 +1,29 @@ +import { TableCell } from '@/ui/layout/table/components/TableCell'; +import { themeCssVariables } from 'twenty-ui/theme-constants'; +import React from 'react'; + +export const SETTINGS_OBJECT_TABLE_COLUMN_WIDTH = '98.7px'; + +export const SETTINGS_OBJECT_TABLE_ROW_GRID_TEMPLATE_COLUMNS = `180px ${SETTINGS_OBJECT_TABLE_COLUMN_WIDTH} ${SETTINGS_OBJECT_TABLE_COLUMN_WIDTH} ${SETTINGS_OBJECT_TABLE_COLUMN_WIDTH} 36px`; + +export const StyledNameTableCell = ( + props: React.ComponentProps, +) => ( + +); + +export const StyledActionTableCell = ( + props: React.ComponentProps, +) => ( + +); diff --git a/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectRelationItemTableRow.tsx b/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectRelationItemTableRow.tsx index 67a214e630..c892b7af24 100644 --- a/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectRelationItemTableRow.tsx +++ b/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectRelationItemTableRow.tsx @@ -25,14 +25,8 @@ type SettingsObjectRelationItemTableRowProps = { objectMetadataItem: ObjectMetadataItem; }; -export const StyledObjectRelationTableRow = styled(TableRow)` - grid-template-columns: minmax(0, 1fr) 148px 148px 36px; -`; - -const StyledNameTableCell = styled(TableCell)` - color: ${themeCssVariables.font.color.primary}; - gap: ${themeCssVariables.spacing[2]}; -`; +export const OBJECT_RELATION_TABLE_ROW_GRID_TEMPLATE_COLUMNS = + 'minmax(0, 1fr) 148px 148px 36px'; const StyledNameContainer = styled.div` display: flex; @@ -63,13 +57,10 @@ const StyledInactiveLabel = styled.span` } `; -const StyledIconTableCell = styled(TableCell)` - justify-content: center; - padding-right: ${themeCssVariables.spacing[1]}; -`; - -const StyledIconChevronRight = styled(IconChevronRight)` +const StyledIconChevronRightContainer = styled.span` + align-items: center; color: ${themeCssVariables.font.color.tertiary}; + display: flex; `; const StyledRelationType = styled.div` @@ -79,18 +70,24 @@ const StyledRelationType = styled.div` gap: ${themeCssVariables.spacing[1]}; `; -const StyledLink = styled(Link)` - color: ${themeCssVariables.font.color.primary}; - text-decoration: underline; - text-decoration-color: ${themeCssVariables.border.color.strong}; - text-underline-offset: 2px; +const StyledLinkContainer = styled.div` overflow: hidden; text-overflow: ellipsis; white-space: nowrap; - &:hover { - color: ${themeCssVariables.color.blue}; - text-decoration-color: ${themeCssVariables.color.blue}; + > a { + color: ${themeCssVariables.font.color.primary}; + text-decoration: underline; + text-decoration-color: ${themeCssVariables.border.color.strong}; + text-underline-offset: 2px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + + &:hover { + color: ${themeCssVariables.color.blue}; + text-decoration-color: ${themeCssVariables.color.blue}; + } } `; @@ -157,9 +154,14 @@ export const SettingsObjectRelationItemTableRow = ({ : fieldMetadataItem.label; return ( - // eslint-disable-next-line twenty/no-navigate-prefer-link - - + + {!!Icon && ( {isRelatedObjectLinkable ? ( - event.stopPropagation()} - title={targetObjectLabel} - > - {targetObjectLabel} - + + event.stopPropagation()} + title={targetObjectLabel} + > + {targetObjectLabel} + + ) : ( {targetObjectLabel} @@ -189,7 +193,7 @@ export const SettingsObjectRelationItemTableRow = ({ {t`Deactivated`} )} - + - + {fieldMetadataItem.isActive ? ( - + + + ) : ( )} - - + + ); }; diff --git a/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectRelationsTable.tsx b/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectRelationsTable.tsx index 6604712348..df840f0b32 100644 --- a/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectRelationsTable.tsx +++ b/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectRelationsTable.tsx @@ -27,9 +27,10 @@ import { Button } from 'twenty-ui/input'; import { MenuItemToggle } from 'twenty-ui/navigation'; import { themeCssVariables } from 'twenty-ui/theme-constants'; import { normalizeSearchText } from '~/utils/normalizeSearchText'; +import { TableRow } from '@/ui/layout/table/components/TableRow'; import { + OBJECT_RELATION_TABLE_ROW_GRID_TEMPLATE_COLUMNS, SettingsObjectRelationItemTableRow, - StyledObjectRelationTableRow, } from './SettingsObjectRelationItemTableRow'; const StyledSearchAndFilterContainer = styled.div` @@ -39,7 +40,7 @@ const StyledSearchAndFilterContainer = styled.div` width: 100%; `; -const StyledSearchInput = styled(SettingsTextInput)` +const StyledSearchInputContainer = styled.div` flex: 1; `; @@ -118,13 +119,15 @@ export const SettingsObjectRelationsTable = ({ return ( <> - + + + - + {tableMetadata.fields.map((item) => ( ))} - + {filteredRelationFields.map((fieldMetadataItem) => ( * { + padding-left: 0 !important; + } `; const StyledDangerButtonsContainer = styled.div` @@ -90,16 +92,18 @@ export const ObjectSettings = ({ return ( - - - - - + + + + + + + - + {!isReadOnly && ( - + - + )} button { + border-color: ${themeCssVariables.color.blue}; + color: ${themeCssVariables.color.blue}; + &:hover { + background: ${themeCssVariables.accent.secondary}; + } + &:focus-visible { + box-shadow: 0 0 0 3px ${themeCssVariables.accent.tertiary}; + } } `; @@ -281,18 +283,20 @@ export const SettingsDataModelObjectAboutForm = ({ {t`An object with this name already exists`} - - navigateSettings(SettingsPath.ObjectDetail, { - objectNamePlural: - conflictingObjectMetadataItem.namePlural, - }) - } - /> + + + navigateSettings(SettingsPath.ObjectDetail, { + objectNamePlural: + conflictingObjectMetadataItem.namePlural, + }) + } + /> + )} {[ diff --git a/packages/twenty-front/src/modules/settings/data-model/objects/forms/components/SettingsDataModelObjectSettingsFormCard.tsx b/packages/twenty-front/src/modules/settings/data-model/objects/forms/components/SettingsDataModelObjectSettingsFormCard.tsx index de4dd920c3..e2c7eff5c6 100644 --- a/packages/twenty-front/src/modules/settings/data-model/objects/forms/components/SettingsDataModelObjectSettingsFormCard.tsx +++ b/packages/twenty-front/src/modules/settings/data-model/objects/forms/components/SettingsDataModelObjectSettingsFormCard.tsx @@ -15,18 +15,25 @@ type SettingsDataModelObjectSettingsFormCardProps = { objectMetadataItem: ObjectMetadataItem; }; -const StyledTopCardContent = styled(CardContent)` - background-color: ${themeCssVariables.background.transparent.lighter}; +const StyledTopCardContentContainer = styled.div` + > * { + background-color: ${themeCssVariables.background.transparent.lighter}; + } `; -const StyledObjectSummaryCard = styled(Card)` - border-radius: ${themeCssVariables.border.radius.md}; - color: ${themeCssVariables.font.color.primary}; +const StyledObjectSummaryCardContainer = styled.div` max-width: 480px; + + > * { + border-radius: ${themeCssVariables.border.radius.md}; + color: ${themeCssVariables.font.color.primary}; + } `; -const StyledObjectSummaryCardContent = styled(CardContent)` - padding: ${themeCssVariables.spacing[2]}; +const StyledObjectSummaryCardContentContainer = styled.div` + > * { + padding: ${themeCssVariables.spacing[2]}; + } `; export const SettingsDataModelObjectSettingsFormCard = ({ @@ -42,26 +49,32 @@ export const SettingsDataModelObjectSettingsFormCard = ({ return ( - - - Preview - - {labelIdentifierFieldMetadataItem ? ( - - ) : ( - - - - - - )} - + + + + Preview + + {labelIdentifierFieldMetadataItem ? ( + + ) : ( + + + + + + + + + + )} + + - + + {apiKey.name} - + - + {apiKey.role?.label || '-'} - + - {formattedExpiration} - + - + ); }; diff --git a/packages/twenty-front/src/modules/settings/developers/components/SettingsApiKeysTable.tsx b/packages/twenty-front/src/modules/settings/developers/components/SettingsApiKeysTable.tsx index e10b0a18af..8c1c81d76f 100644 --- a/packages/twenty-front/src/modules/settings/developers/components/SettingsApiKeysTable.tsx +++ b/packages/twenty-front/src/modules/settings/developers/components/SettingsApiKeysTable.tsx @@ -10,7 +10,7 @@ import { getSettingsPath } from 'twenty-shared/utils'; import { themeCssVariables } from 'twenty-ui/theme-constants'; import { useGetApiKeysQuery } from '~/generated-metadata/graphql'; -const StyledTableBody = styled(TableBody)` +const StyledTableBodyContainer = styled.div` border-bottom: 1px solid ${themeCssVariables.border.color.light}; `; @@ -36,17 +36,19 @@ export const SettingsApiKeysTable = () => { {!!apiKeys?.length && ( - - {apiKeys.map((apiKey) => ( - - ))} - + + + {apiKeys.map((apiKey) => ( + + ))} + + )} ); diff --git a/packages/twenty-front/src/modules/settings/developers/components/SettingsDevelopersWebhookTableRow.tsx b/packages/twenty-front/src/modules/settings/developers/components/SettingsDevelopersWebhookTableRow.tsx index a6da829f93..ad422f5320 100644 --- a/packages/twenty-front/src/modules/settings/developers/components/SettingsDevelopersWebhookTableRow.tsx +++ b/packages/twenty-front/src/modules/settings/developers/components/SettingsDevelopersWebhookTableRow.tsx @@ -11,23 +11,12 @@ import { useContext } from 'react'; import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants'; import { type Webhook } from '~/generated-metadata/graphql'; -export const StyledApisFieldTableRow = styled(TableRow)` - grid-template-columns: 1fr 28px; -`; +const WEBHOOK_TABLE_ROW_GRID_TEMPLATE_COLUMNS = '1fr 28px'; -const StyledIconTableCell = styled(TableCell)` - justify-content: center; - padding-right: ${themeCssVariables.spacing[1]}; - padding-left: 0; -`; - -const StyledUrlTableCell = styled(TableCell)` - color: ${themeCssVariables.font.color.primary}; - overflow: hidden; -`; - -const StyledIconChevronRight = styled(IconChevronRight)` +const StyledIconChevronRightContainer = styled.span` + align-items: center; color: ${themeCssVariables.font.color.tertiary}; + display: flex; `; export const SettingsDevelopersWebhookTableRow = ({ @@ -42,8 +31,11 @@ export const SettingsDevelopersWebhookTableRow = ({ }) => { const { theme } = useContext(ThemeContext); return ( - - + + - - - - - + + + + + + + ); }; diff --git a/packages/twenty-front/src/modules/settings/developers/components/SettingsWebhooksTable.tsx b/packages/twenty-front/src/modules/settings/developers/components/SettingsWebhooksTable.tsx index 6d283fc7d1..b4d01e7856 100644 --- a/packages/twenty-front/src/modules/settings/developers/components/SettingsWebhooksTable.tsx +++ b/packages/twenty-front/src/modules/settings/developers/components/SettingsWebhooksTable.tsx @@ -10,16 +10,12 @@ import { getSettingsPath } from 'twenty-shared/utils'; import { themeCssVariables } from 'twenty-ui/theme-constants'; import { useGetWebhooksQuery } from '~/generated-metadata/graphql'; -const StyledTableBody = styled(TableBody)` +const StyledTableBodyContainer = styled.div` border-bottom: 1px solid ${themeCssVariables.border.color.light}; max-height: 260px; overflow-y: auto; `; -const StyledTableRow = styled(TableRow)` - grid-template-columns: 444px 68px; -`; - export const SettingsWebhooksTable = () => { const { data: webhooksData } = useGetWebhooksQuery(); @@ -27,22 +23,24 @@ export const SettingsWebhooksTable = () => { return ( - + URL - + {!!webhooks?.length && ( - - {webhooks.map((webhookFieldItem) => ( - - ))} - + + + {webhooks.map((webhookFieldItem) => ( + + ))} + + )} ); diff --git a/packages/twenty-front/src/modules/settings/developers/components/WebhookEntitySelect.tsx b/packages/twenty-front/src/modules/settings/developers/components/WebhookEntitySelect.tsx index b2eabb08c2..8b09142d3e 100644 --- a/packages/twenty-front/src/modules/settings/developers/components/WebhookEntitySelect.tsx +++ b/packages/twenty-front/src/modules/settings/developers/components/WebhookEntitySelect.tsx @@ -60,13 +60,15 @@ const StyledControlLabel = styled.span` white-space: nowrap; `; -const StyledControlIconChevronDown = styled(IconChevronDown)<{ +const StyledControlIconChevronDownContainer = styled.span<{ disabled?: boolean; }>` + align-items: center; color: ${({ disabled }) => disabled ? themeCssVariables.font.color.extraLight : themeCssVariables.font.color.tertiary}; + display: flex; `; type WebhookEntitySelectProps = { @@ -166,10 +168,9 @@ export const WebhookEntitySelect = ({ clickableComponent={ {getSelectedLabel()} - + + + } dropdownComponents={ diff --git a/packages/twenty-front/src/modules/settings/domains/components/SettingPublicDomain.tsx b/packages/twenty-front/src/modules/settings/domains/components/SettingPublicDomain.tsx index 2a8123043c..831a76808d 100644 --- a/packages/twenty-front/src/modules/settings/domains/components/SettingPublicDomain.tsx +++ b/packages/twenty-front/src/modules/settings/domains/components/SettingPublicDomain.tsx @@ -25,13 +25,13 @@ import { SaveAndCancelButtons } from '@/settings/components/SaveAndCancelButtons import { getDomainValidationSchema } from '@/settings/domains/utils/get-domain-validation-schema'; import { themeCssVariables } from 'twenty-ui/theme-constants'; -const StyledButtonGroup = styled(ButtonGroup)` - & > :not(:first-of-type) > button { +const StyledButtonGroupContainer = styled.div` + > * > :not(:first-of-type) > button { border-left: none; } `; -const StyledButton = styled(Button)` +const StyledButtonContainer = styled.div` align-self: flex-start; `; @@ -171,23 +171,29 @@ export const SettingPublicDomain = () => { fullWidth /> {isDefined(selectedPublicDomain) && ( - - - checkPublicDomainRecords(selectedPublicDomain.domain) - } - type="button" - /> - - + + + + + checkPublicDomainRecords(selectedPublicDomain.domain) + } + type="button" + /> + + + + + + )} {isDefined(selectedPublicDomain) && publicDomainRecords?.domain && ( diff --git a/packages/twenty-front/src/modules/settings/domains/components/SettingsCustomDomain.tsx b/packages/twenty-front/src/modules/settings/domains/components/SettingsCustomDomain.tsx index fd8438021d..e6dcf5cddf 100644 --- a/packages/twenty-front/src/modules/settings/domains/components/SettingsCustomDomain.tsx +++ b/packages/twenty-front/src/modules/settings/domains/components/SettingsCustomDomain.tsx @@ -19,13 +19,13 @@ const StyledDomainFormWrapper = styled.div` gap: ${themeCssVariables.spacing[2]}; `; -const StyledButtonGroup = styled(ButtonGroup)` - & > :not(:first-of-type) > button { +const StyledButtonGroupContainer = styled.div` + > * > :not(:first-of-type) > button { border-left: none; } `; -const StyledButton = styled(Button)` +const StyledButtonContainer = styled.div` align-self: flex-start; `; @@ -80,21 +80,27 @@ export const SettingsCustomDomain = () => { )} /> {currentWorkspace?.customDomain && ( - - - - + + + + + + + + + + )} {currentWorkspace?.customDomain && ( diff --git a/packages/twenty-front/src/modules/settings/logic-functions/components/SettingsLogicFunctionsFieldItemTableRow.tsx b/packages/twenty-front/src/modules/settings/logic-functions/components/SettingsLogicFunctionsFieldItemTableRow.tsx index fbe210407c..eb195789aa 100644 --- a/packages/twenty-front/src/modules/settings/logic-functions/components/SettingsLogicFunctionsFieldItemTableRow.tsx +++ b/packages/twenty-front/src/modules/settings/logic-functions/components/SettingsLogicFunctionsFieldItemTableRow.tsx @@ -6,23 +6,10 @@ import { StyledTableRow } from '@/settings/logic-functions/components/SettingsLo import { useContext } from 'react'; import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants'; -const StyledNameTableCell = styled(TableCell)` - color: ${themeCssVariables.font.color.primary}; - gap: ${themeCssVariables.spacing[2]}; -`; - -const StyledRuntimeTableCell = styled(TableCell)` - color: ${themeCssVariables.font.color.secondary}; - gap: ${themeCssVariables.spacing[2]}; -`; - -const StyledIconTableCell = styled(TableCell)` - justify-content: center; - padding-right: ${themeCssVariables.spacing[1]}; -`; - -const StyledIconChevronRight = styled(IconChevronRight)` +const StyledIconChevronRightContainer = styled.span` + align-items: center; color: ${themeCssVariables.font.color.tertiary}; + display: flex; `; export const SettingsLogicFunctionsFieldItemTableRow = ({ @@ -35,15 +22,33 @@ export const SettingsLogicFunctionsFieldItemTableRow = ({ const { theme } = useContext(ThemeContext); return ( - {logicFunction.name} - - {logicFunction.runtime} - - - + + {logicFunction.name} + + + + {logicFunction.runtime} + + + + + + ); }; diff --git a/packages/twenty-front/src/modules/settings/logic-functions/components/SettingsLogicFunctionsTable.tsx b/packages/twenty-front/src/modules/settings/logic-functions/components/SettingsLogicFunctionsTable.tsx index 8136454693..3f3ab1a2b1 100644 --- a/packages/twenty-front/src/modules/settings/logic-functions/components/SettingsLogicFunctionsTable.tsx +++ b/packages/twenty-front/src/modules/settings/logic-functions/components/SettingsLogicFunctionsTable.tsx @@ -8,14 +8,21 @@ import { SettingsPath } from 'twenty-shared/types'; import { getSettingsPath } from 'twenty-shared/utils'; import { type LogicFunction } from '~/generated-metadata/graphql'; import { useLingui } from '@lingui/react/macro'; +import React from 'react'; import { useParams } from 'react-router-dom'; import { themeCssVariables } from 'twenty-ui/theme-constants'; -export const StyledTableRow = styled(TableRow)` - grid-template-columns: 164px 1fr 96px 32px; -`; +export const StyledTableRow = ( + props: React.ComponentProps, +) => ( + +); -const StyledTableBody = styled(TableBody)` +const StyledTableBodyContainer = styled.div` border-bottom: 1px solid ${themeCssVariables.border.color.light}; `; @@ -40,18 +47,20 @@ export const SettingsLogicFunctionsTable = ({ {t`Runtime`} - - {logicFunctions.map((logicFunction: LogicFunction) => ( - - ))} - + + + {logicFunctions.map((logicFunction: LogicFunction) => ( + + ))} + + ); }; diff --git a/packages/twenty-front/src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionCodeEditorTab.tsx b/packages/twenty-front/src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionCodeEditorTab.tsx index 9eaef9f5a0..9e1c7e12bf 100644 --- a/packages/twenty-front/src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionCodeEditorTab.tsx +++ b/packages/twenty-front/src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionCodeEditorTab.tsx @@ -12,8 +12,10 @@ import { H2Title, IconPlayerPlay } from 'twenty-ui/display'; import { Button, CoreEditorHeader } from 'twenty-ui/input'; import { Section } from 'twenty-ui/layout'; -const StyledTabList = styled(TabList)` - border-bottom: none; +const StyledTabListContainer = styled.div` + > * { + border-bottom: none; + } `; export const SettingsLogicFunctionCodeEditorTab = ({ @@ -44,12 +46,14 @@ export const SettingsLogicFunctionCodeEditorTab = ({ ); const HeaderTabList = ( - { - return { id: file.path, title: file.path.split('/').at(-1) || '' }; - })} - componentInstanceId={SETTINGS_LOGIC_FUNCTION_TAB_LIST_COMPONENT_ID} - /> + + { + return { id: file.path, title: file.path.split('/').at(-1) || '' }; + })} + componentInstanceId={SETTINGS_LOGIC_FUNCTION_TAB_LIST_COMPONENT_ID} + /> + ); return ( diff --git a/packages/twenty-front/src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTabEnvironmentVariableTableRow.tsx b/packages/twenty-front/src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTabEnvironmentVariableTableRow.tsx index f3a4f90327..5c419c5283 100644 --- a/packages/twenty-front/src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTabEnvironmentVariableTableRow.tsx +++ b/packages/twenty-front/src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTabEnvironmentVariableTableRow.tsx @@ -5,9 +5,8 @@ import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/Drop import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown'; import { TableCell } from '@/ui/layout/table/components/TableCell'; import { TableRow } from '@/ui/layout/table/components/TableRow'; -import { styled } from '@linaria/react'; import { t } from '@lingui/core/macro'; -import { useState } from 'react'; +import React, { useState } from 'react'; import { IconCheck, IconDotsVertical, @@ -20,13 +19,23 @@ import { LightIconButton } from 'twenty-ui/input'; import { MenuItem } from 'twenty-ui/navigation'; import type { ApplicationVariable } from '~/generated-metadata/graphql'; -const StyledEditModeTableRow = styled(TableRow)` - grid-template-columns: 180px auto 56px; -`; +const StyledEditModeTableRow = ( + props: React.ComponentProps, +) => ( + +); -const StyledTableRow = styled(TableRow)` - grid-template-columns: 180px 300px 32px; -`; +const StyledTableRow = (props: React.ComponentProps) => ( + +); export const SettingsLogicFunctionTabEnvironmentVariableTableRow = ({ envVariable, diff --git a/packages/twenty-front/src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTriggersTab.tsx b/packages/twenty-front/src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTriggersTab.tsx index ca1c2f5905..282cda223f 100644 --- a/packages/twenty-front/src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTriggersTab.tsx +++ b/packages/twenty-front/src/modules/settings/logic-functions/components/tabs/SettingsLogicFunctionTriggersTab.tsx @@ -14,18 +14,9 @@ import { Tag } from 'twenty-ui/components'; import { type LogicFunction } from '~/generated-metadata/graphql'; import { themeCssVariables } from 'twenty-ui/theme-constants'; -export const StyledRouteTriggerTableRow = styled(TableRow)` - grid-template-columns: 1fr 120px 120px; -`; +const ROUTE_TRIGGER_GRID_TEMPLATE_COLUMNS = '1fr 120px 120px'; -const StyledTableCell = styled(TableCell)` - color: ${themeCssVariables.font.color.tertiary}; - gap: ${themeCssVariables.spacing[2]}; - min-width: 0; - overflow: hidden; -`; - -const StyledRouteTriggerTableHeaderRow = styled(StyledRouteTriggerTableRow)` +const StyledRouteTriggerTableHeaderRowWrapper = styled.div` margin-bottom: ${themeCssVariables.spacing[2]}; `; @@ -119,26 +110,44 @@ export const SettingsLogicFunctionTriggersTab = ({ description={t`Triggers the function with Http request`} /> - - {t`Path`} - {t`Method`} - {t`Auth Required`} - - - + + + {t`Path`} + {t`Method`} + {t`Auth Required`} + + + + - - {routeTrigger.httpMethod} - + + + {routeTrigger.httpMethod} + + - - + + )} diff --git a/packages/twenty-front/src/modules/settings/playground/components/SettingsPlaygroundCoverImage.tsx b/packages/twenty-front/src/modules/settings/playground/components/SettingsPlaygroundCoverImage.tsx index f15c3153b0..45b7b6d2dc 100644 --- a/packages/twenty-front/src/modules/settings/playground/components/SettingsPlaygroundCoverImage.tsx +++ b/packages/twenty-front/src/modules/settings/playground/components/SettingsPlaygroundCoverImage.tsx @@ -3,9 +3,9 @@ import { type ReactNode, useContext } from 'react'; import DarkCoverImage from '@/settings/playground/assets/cover-dark.png'; import LightCoverImage from '@/settings/playground/assets/cover-light.png'; -import { Card } from 'twenty-ui/layout'; import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants'; -const StyledCard = styled(Card)` + +const StyledCoverContainer = styled.div` align-items: center; background-size: cover; border-radius: ${themeCssVariables.border.radius.md}; @@ -34,11 +34,11 @@ export const StyledSettingsApiPlaygroundCoverImage = ({ ? LightCoverImage.toString() : DarkCoverImage.toString(); return ( - {children} - + ); }; diff --git a/packages/twenty-front/src/modules/settings/profile/components/EmailField.tsx b/packages/twenty-front/src/modules/settings/profile/components/EmailField.tsx index c9aa6bcecb..b8343d09c6 100644 --- a/packages/twenty-front/src/modules/settings/profile/components/EmailField.tsx +++ b/packages/twenty-front/src/modules/settings/profile/components/EmailField.tsx @@ -31,7 +31,7 @@ const StyledActionWrapper = styled.div` } `; -const StyledActionButton = styled(Button)` +const StyledActionButtonContainer = styled.div` height: 100%; display: inline-flex; align-items: center; @@ -96,34 +96,40 @@ export const EmailField = () => { /> {isEditing ? ( - - + + + + + + ) : ( - + + + )} diff --git a/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesList.tsx b/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesList.tsx index bfe66f0227..87f8364a1c 100644 --- a/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesList.tsx +++ b/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesList.tsx @@ -27,12 +27,14 @@ import { themeCssVariables } from 'twenty-ui/theme-constants'; import { useNavigateSettings } from '~/hooks/useNavigateSettings'; import { sortByAscString } from '~/utils/array/sortByAscString'; -const StyledCreateRoleSection = styled(Section)` - border-top: 1px solid ${themeCssVariables.border.color.light}; - display: flex; - justify-content: flex-end; - padding-top: ${themeCssVariables.spacing[2]}; - padding-bottom: ${themeCssVariables.spacing[2]}; +const StyledCreateRoleSectionContainer = styled.div` + > * { + border-top: 1px solid ${themeCssVariables.border.color.light}; + display: flex; + justify-content: flex-end; + padding-top: ${themeCssVariables.spacing[2]}; + padding-bottom: ${themeCssVariables.spacing[2]}; + } `; const StyledTableRows = styled.div` @@ -40,10 +42,6 @@ const StyledTableRows = styled.div` padding-top: ${themeCssVariables.spacing[2]}; `; -const StyledNoRoles = styled(TableCell)` - color: ${themeCssVariables.font.color.tertiary}; -`; - const StyledSearchAndFilterContainer = styled.div` display: flex; gap: ${themeCssVariables.spacing[2]}; @@ -51,7 +49,7 @@ const StyledSearchAndFilterContainer = styled.div` width: 100%; `; -const StyledSearchInput = styled(SettingsTextInput)` +const StyledSearchInputContainer = styled.div` flex: 1; `; @@ -88,13 +86,15 @@ export const SettingsRolesList = () => { /> - + + + { {filteredRoles.length === 0 ? ( - {t`No roles found`} + + {t`No roles found`} + ) : ( filteredRoles.map((role) => ( @@ -143,15 +145,17 @@ export const SettingsRolesList = () => { )} - - navigateSettings(SettingsPath.RoleCreate)} - /> - + + + navigateSettings(SettingsPath.RoleCreate)} + /> + + ); }; diff --git a/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesTableRow.tsx b/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesTableRow.tsx index bdfa7448b1..2263cb3b96 100644 --- a/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesTableRow.tsx +++ b/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesTableRow.tsx @@ -48,10 +48,12 @@ const StyledIconLockContainer = styled.div` justify-content: flex-end; `; -const StyledTableRow = styled(TableRow)` - &:hover { - background: ${themeCssVariables.background.transparent.light}; - cursor: pointer; +const StyledTableRowContainer = styled.div` + > * { + &:hover { + background: ${themeCssVariables.background.transparent.light}; + cursor: pointer; + } } `; @@ -77,57 +79,61 @@ export const SettingsRolesTableRow = ({ role }: SettingsRolesTableRowProps) => { .filter(isDefined); return ( - - - - - {role.label} - {!role.isEditable && ( - - - - )} - - - - - {enrichedWorkspaceMembers.slice(0, 5).map((workspaceMember) => ( - - - + + + + + {role.label} + {!role.isEditable && ( + + - - - - ))} - - - - {role.workspaceMembers.length} - - - - - + + )} + + + + + {enrichedWorkspaceMembers.slice(0, 5).map((workspaceMember) => ( + + + + + + + ))} + + + + + {role.workspaceMembers.length} + + + + + + + ); }; diff --git a/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentTable.tsx b/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentTable.tsx index 9f99d69074..e797692b7a 100644 --- a/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentTable.tsx +++ b/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentTable.tsx @@ -27,16 +27,12 @@ const StyledTableRows = styled.div` padding-block: ${themeCssVariables.spacing[2]}; `; -const StyledEmptyState = styled(TableCell)` - color: ${themeCssVariables.font.color.tertiary}; -`; - const StyledSearchContainer = styled.div` padding-bottom: ${themeCssVariables.spacing[2]}; `; -const StyledSearchInput = styled(SettingsTextInput)` - input { +const StyledSearchInputContainer = styled.div` + > * input { background: ${themeCssVariables.background.transparent.lighter}; border: 1px solid ${themeCssVariables.border.color.medium}; } @@ -148,15 +144,17 @@ export const SettingsRoleAssignmentTable = ({ description={t`This role is assigned to these ${roleTargetDisplayName}.`} /> - + + + @@ -173,9 +171,9 @@ export const SettingsRoleAssignmentTable = ({ ))} {filteredRoleTargets.length === 0 && ( - + {tableConfig[roleTargetType].emptyStateText} - + )} diff --git a/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentTableRow.tsx b/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentTableRow.tsx index 92de3c47b6..15caefc5c6 100644 --- a/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentTableRow.tsx +++ b/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentTableRow.tsx @@ -38,10 +38,6 @@ const StyledNameContainer = styled.div` width: 100%; `; -const StyledTableCell = styled(TableCell)` - overflow: hidden; -`; - export type RoleTarget = | { type: 'member'; data: PartialWorkspaceMember } | { type: 'agent'; data: Agent } @@ -119,17 +115,17 @@ export const SettingsRoleAssignmentTableRow = ({ return ( - + {renderIcon()} - - + + - + ); }; diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelObjectPicker.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelObjectPicker.tsx index 6b7821f9e2..44f0fc1b8d 100644 --- a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelObjectPicker.tsx +++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelObjectPicker.tsx @@ -39,8 +39,8 @@ const StyledSearchContainer = styled.div` padding-bottom: ${themeCssVariables.spacing[2]}; `; -const StyledSearchInput = styled(SettingsTextInput)` - input { +const StyledSearchInputContainer = styled.div` + > * input { background: ${themeCssVariables.background.transparent.lighter}; border: 1px solid ${themeCssVariables.border.color.medium}; } @@ -104,15 +104,17 @@ export const SettingsRolePermissionsObjectLevelObjectPicker = ({ - + + + diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelSection.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelSection.tsx index 71391fbb13..436eaac690 100644 --- a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelSection.tsx +++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelSection.tsx @@ -18,12 +18,14 @@ import { Section } from 'twenty-ui/layout'; import { themeCssVariables } from 'twenty-ui/theme-constants'; import { useNavigateSettings } from '~/hooks/useNavigateSettings'; -const StyledCreateObjectOverrideSection = styled(Section)` - border-top: 1px solid ${themeCssVariables.border.color.light}; - display: flex; - justify-content: flex-end; - padding-top: ${themeCssVariables.spacing[2]}; - padding-bottom: ${themeCssVariables.spacing[2]}; +const StyledCreateObjectOverrideSectionContainer = styled.div` + > * { + border-top: 1px solid ${themeCssVariables.border.color.light}; + display: flex; + justify-content: flex-end; + padding-top: ${themeCssVariables.spacing[2]}; + padding-bottom: ${themeCssVariables.spacing[2]}; + } `; const StyledTableRows = styled.div` @@ -38,10 +40,6 @@ type SettingsRolePermissionsObjectLevelSectionProps = { objectMetadataItemsFromMarketplaceApp?: ObjectMetadataItem[]; }; -const StyledNoOverride = styled(TableCell)` - color: ${themeCssVariables.font.color.tertiary}; -`; - export const SettingsRolePermissionsObjectLevelSection = ({ roleId, fromAgentId, @@ -130,25 +128,27 @@ export const SettingsRolePermissionsObjectLevelSection = ({ ), ) ) : ( - + {t`No permissions have been set for individual objects.`} - + )} {isEditable && ( - - - + + + + + )} ); diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelTableRow.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelTableRow.tsx index d96f79fd04..784b733de5 100644 --- a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelTableRow.tsx +++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelTableRow.tsx @@ -13,22 +13,12 @@ import { OverflowingTextWithTooltip, useIcons } from 'twenty-ui/display'; import { useContext } from 'react'; import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants'; -const StyledNameTableCell = styled(TableCell)` - color: ${themeCssVariables.font.color.primary}; - gap: ${themeCssVariables.spacing[1]}; -`; - const StyledNameLabel = styled.div` white-space: nowrap; text-overflow: ellipsis; overflow: hidden; `; -const StyledOptionsTableCell = styled(TableCell)` - justify-content: flex-end; - padding-right: ${themeCssVariables.spacing[1]}; -`; - type SettingsRolePermissionsObjectLevelTableRowProps = { objectMetadataItem: ObjectMetadataItem; roleId: string; @@ -62,7 +52,10 @@ export const SettingsRolePermissionsObjectLevelTableRow = ({ to={isEditable ? navigationUrl : undefined} gridAutoColumns={OBJECT_LEVEL_PERMISSION_TABLE_GRID_AUTO_COLUMNS} > - + {!!Icon && ( - + - + - + ); }; diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/field-permissions/components/SettingsRolePermissionsObjectLevelObjectFieldPermissionTable.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/field-permissions/components/SettingsRolePermissionsObjectLevelObjectFieldPermissionTable.tsx index 13f4d00355..c296f81fa1 100644 --- a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/field-permissions/components/SettingsRolePermissionsObjectLevelObjectFieldPermissionTable.tsx +++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/field-permissions/components/SettingsRolePermissionsObjectLevelObjectFieldPermissionTable.tsx @@ -1,9 +1,10 @@ import { type ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem'; import { filterUserFacingFieldMetadataItems } from '@/object-metadata/utils/filterUserFacingFieldMetadataItems'; import { SettingsRolePermissionsObjectLevelObjectFieldPermissionTableAllHeaderRow } from '@/settings/roles/role-permissions/object-level-permissions/field-permissions/components/SettingsRolePermissionsObjectLevelObjectFieldPermissionTableAllHeaderRow'; +import { TableRow } from '@/ui/layout/table/components/TableRow'; import { + FIELD_PERMISSION_TABLE_ROW_GRID_TEMPLATE_COLUMNS, SettingsRolePermissionsObjectLevelObjectFieldPermissionTableRow, - StyledObjectFieldTableRow, } from '@/settings/roles/role-permissions/object-level-permissions/field-permissions/components/SettingsRolePermissionsObjectLevelObjectFieldPermissionTableRow'; import { useObjectPermissionDerivedStates } from '@/settings/roles/role-permissions/object-level-permissions/field-permissions/hooks/useObjectPermissionDerivedStates'; import { settingsDraftRoleFamilyState } from '@/settings/roles/states/settingsDraftRoleFamilyState'; @@ -28,7 +29,7 @@ import { turnOrderByIntoSort } from '~/utils/turnOrderByIntoSort'; export const SETTINGS_ROLE_PERMISSION_OBJECT_LEVEL_FIELD_PERMISSION_TABLE_ID = 'settings-role-permissions-object-level-object-field-permission'; -const StyledSearchInput = styled(SettingsTextInput)` +const StyledSearchInputContainer = styled.div` padding-bottom: ${themeCssVariables.spacing[2]}; width: 100%; `; @@ -99,15 +100,19 @@ export const SettingsRolePermissionsObjectLevelObjectFieldPermissionTable = ({ title={t`Fields Permissions`} description={t`Ability to interact with this object's fields.`} /> - + + + - + )} > - + - + + {!!Icon && ( {fieldMetadataItem.label} - + )} > - + ); }; diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/object-form/components/SettingsRolePermissionsObjectLevelObjectFormObjectLevelTableRow.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/object-form/components/SettingsRolePermissionsObjectLevelObjectFormObjectLevelTableRow.tsx index 20ce9fb650..823df6387c 100644 --- a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/object-form/components/SettingsRolePermissionsObjectLevelObjectFormObjectLevelTableRow.tsx +++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/object-form/components/SettingsRolePermissionsObjectLevelObjectFormObjectLevelTableRow.tsx @@ -15,20 +15,6 @@ import { isDefined } from 'twenty-shared/utils'; import { themeCssVariables } from 'twenty-ui/theme-constants'; import { type ObjectPermission, type Role } from '~/generated-metadata/graphql'; -const StyledTableRow = styled(TableRow)<{ isDisabled: boolean }>` - align-items: center; - display: flex; - cursor: ${({ isDisabled }) => (isDisabled ? 'default' : 'pointer')}; -`; - -const StyledPermissionCell = styled(TableCell)` - align-items: center; - display: flex; - flex: 1; - gap: ${themeCssVariables.spacing[1]}; - padding-left: ${themeCssVariables.spacing[2]}; -`; - const StyledPermissionContent = styled.div` align-items: center; display: flex; @@ -46,13 +32,6 @@ const StyledOverrideInfo = styled.div` gap: ${themeCssVariables.spacing[1]}; `; -const StyledCheckboxCell = styled(TableCell)` - align-items: center; - display: flex; - justify-content: flex-end; - padding-right: ${themeCssVariables.spacing[1]}; -`; - type OverridableCheckboxType = 'no_cta' | 'default' | 'override'; type SettingsRolePermissionsObjectLevelObjectFormObjectLevelTableRowProps = { @@ -146,8 +125,11 @@ export const SettingsRolePermissionsObjectLevelObjectFormObjectLevelTableRow = ); return ( - - + + ) : null} - - e.stopPropagation()}> + + e.stopPropagation()} + > - - + + ); }; diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelSection.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelSection.tsx index 8c52db4bfd..258dacaf88 100644 --- a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelSection.tsx +++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelSection.tsx @@ -2,7 +2,6 @@ import { styled } from '@linaria/react'; import { t } from '@lingui/core/macro'; -import { Pill } from 'twenty-ui/components'; import { H2Title, IconArrowUp, IconLock } from 'twenty-ui/display'; import { Card, Section } from 'twenty-ui/layout'; @@ -21,17 +20,20 @@ const StyledContent = styled.div` padding-top: ${themeCssVariables.spacing[4]}; `; -const StyledCard = styled(Card)` +const StyledCardContainer = styled.div` margin-top: ${themeCssVariables.spacing[4]}; overflow: hidden; `; -const StyledPill = styled(Pill)` - border-radius: 40px; - border: 1px solid ${themeCssVariables.border.color.light}; +const StyledPillContainer = styled.span` + align-items: center; background: ${themeCssVariables.background.secondary}; + border: 1px solid ${themeCssVariables.border.color.light}; + border-radius: 40px; color: ${themeCssVariables.font.color.tertiary}; + display: inline-flex; font-weight: ${themeCssVariables.font.weight.medium}; + gap: ${themeCssVariables.spacing[1]}; padding: ${themeCssVariables.spacing[1]} ${themeCssVariables.spacing[2]}; `; @@ -56,27 +58,34 @@ export const SettingsRolePermissionsObjectLevelRecordLevelSection = ({ } + adornment={ + + + {t`Organization`} + + } /> - - navigateSettings(SettingsPath.Billing)} - /> - ) - } - /> - + + + navigateSettings(SettingsPath.Billing)} + /> + ) + } + /> + + ); } diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/objects-permissions/components/SettingsRolePermissionsObjectsTableHeader.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/objects-permissions/components/SettingsRolePermissionsObjectsTableHeader.tsx index a60411af2f..1e871f2809 100644 --- a/packages/twenty-front/src/modules/settings/roles/role-permissions/objects-permissions/components/SettingsRolePermissionsObjectsTableHeader.tsx +++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/objects-permissions/components/SettingsRolePermissionsObjectsTableHeader.tsx @@ -4,22 +4,10 @@ import { TableHeader } from '@/ui/layout/table/components/TableHeader'; import { useAtomFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilyStateValue'; import { useSetAtomFamilyState } from '@/ui/utilities/state/jotai/hooks/useSetAtomFamilyState'; import { TableRow } from '@/ui/layout/table/components/TableRow'; -import { styled } from '@linaria/react'; import { t } from '@lingui/core/macro'; import { Checkbox } from 'twenty-ui/input'; import { themeCssVariables } from 'twenty-ui/theme-constants'; -const StyledNameHeader = styled(TableHeader)` - flex: 1; -`; - -const StyledActionsHeader = styled(TableHeader)` - align-items: center; - display: flex; - justify-content: flex-end; - padding-right: ${themeCssVariables.spacing[1]}; -`; - type SettingsRolePermissionsObjectsTableHeaderProps = { roleId: string; objectPermissionsConfig: SettingsRolePermissionsObjectPermission[]; @@ -50,8 +38,12 @@ export const SettingsRolePermissionsObjectsTableHeader = ({ return ( - {t`All Objects`} - + {t`All Objects`} + - + ); }; diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/objects-permissions/components/SettingsRolePermissionsObjectsTableRow.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/objects-permissions/components/SettingsRolePermissionsObjectsTableRow.tsx index 79e3f518df..56824c1674 100644 --- a/packages/twenty-front/src/modules/settings/roles/role-permissions/objects-permissions/components/SettingsRolePermissionsObjectsTableRow.tsx +++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/objects-permissions/components/SettingsRolePermissionsObjectsTableRow.tsx @@ -8,14 +8,6 @@ import { plural } from '@lingui/core/macro'; import { Checkbox, CheckboxAccent } from 'twenty-ui/input'; import { themeCssVariables } from 'twenty-ui/theme-constants'; -const StyledPermissionCell = styled(TableCell)` - align-items: center; - display: flex; - flex: 1; - gap: ${themeCssVariables.spacing[1]}; - padding-left: ${themeCssVariables.spacing[2]}; -`; - const StyledPermissionContent = styled.div` align-items: center; display: flex; @@ -32,18 +24,6 @@ const StyledOverrideInfo = styled.div` display: flex; gap: ${themeCssVariables.spacing[1]}; `; -const StyledCheckboxCell = styled(TableCell)` - align-items: center; - display: flex; - justify-content: flex-end; - padding-right: ${themeCssVariables.spacing[1]}; -`; - -const StyledTableRow = styled(TableRow)<{ isDisabled: boolean }>` - align-items: center; - display: flex; - cursor: ${({ isDisabled }) => (isDisabled ? 'default' : 'pointer')}; -`; type SettingsRolePermissionsObjectsTableRowProps = { permission: SettingsRolePermissionsObjectPermission; @@ -68,8 +48,11 @@ export const SettingsRolePermissionsObjectsTableRow = ({ }; return ( - - + + ) : null} - - e.stopPropagation()}> + + e.stopPropagation()} + > permission.setValue(!permission.value)} disabled={isDisabled} accent={isRevoked ? CheckboxAccent.Orange : CheckboxAccent.Blue} /> - - + + ); }; diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/permission-flags/components/SettingsRolePermissionsSettingsSection.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/permission-flags/components/SettingsRolePermissionsSettingsSection.tsx index dc5ea36e6a..d52acbbd23 100644 --- a/packages/twenty-front/src/modules/settings/roles/role-permissions/permission-flags/components/SettingsRolePermissionsSettingsSection.tsx +++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/permission-flags/components/SettingsRolePermissionsSettingsSection.tsx @@ -20,7 +20,7 @@ const StyledTableRows = styled.div` padding-top: ${themeCssVariables.spacing[2]}; `; -const StyledCard = styled(Card)` +const StyledCardContainer = styled.div` margin-bottom: ${themeCssVariables.spacing[4]}; `; @@ -58,21 +58,23 @@ export const SettingsRolePermissionsSettingsSection = ({ {shouldShowAllAccessToggle && ( - - { - setSettingsDraftRole({ - ...settingsDraftRole, - canUpdateAllSettings: !settingsDraftRole.canUpdateAllSettings, - }); - }} - /> - + + + { + setSettingsDraftRole({ + ...settingsDraftRole, + canUpdateAllSettings: !settingsDraftRole.canUpdateAllSettings, + }); + }} + /> + + )} {t`Name`} {t`Description`} - + - + ); }; diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/permission-flags/components/SettingsRolePermissionsSettingsTableRow.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/permission-flags/components/SettingsRolePermissionsSettingsTableRow.tsx index 3a929d4607..dd19092874 100644 --- a/packages/twenty-front/src/modules/settings/roles/role-permissions/permission-flags/components/SettingsRolePermissionsSettingsTableRow.tsx +++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/permission-flags/components/SettingsRolePermissionsSettingsTableRow.tsx @@ -10,32 +10,14 @@ import { useContext } from 'react'; import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants'; import { v4 } from 'uuid'; -const StyledTableRow = styled(TableRow)<{ isDisabled: boolean }>` - cursor: ${({ isDisabled }) => (isDisabled ? 'default' : 'pointer')}; -`; - const StyledName = styled.span` color: ${themeCssVariables.font.color.primary}; `; -const StyledDescription = styled(StyledName)` +const StyledDescription = styled.span` color: ${themeCssVariables.font.color.secondary}; `; -const StyledPermissionCell = styled(TableCell)` - align-items: center; - display: flex; - flex: 1; - gap: ${themeCssVariables.spacing[2]}; -`; - -const StyledCheckboxCell = styled(TableCell)` - align-items: center; - display: flex; - justify-content: flex-end; - padding-right: ${themeCssVariables.spacing[1]}; -`; - const StyledIconContainer = styled.div` display: flex; align-items: center; @@ -112,13 +94,13 @@ export const SettingsRolePermissionsSettingsTableRow = ({ }; return ( - - + {permission.name} - - + + {permission.description} - - e.stopPropagation()}> + + e.stopPropagation()} + > handleChange(event.target.checked)} /> - - + + ); }; diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/permission-flags/components/SettingsRolePermissionsToolSection.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/permission-flags/components/SettingsRolePermissionsToolSection.tsx index 68cd038794..bb95fbc2e3 100644 --- a/packages/twenty-front/src/modules/settings/roles/role-permissions/permission-flags/components/SettingsRolePermissionsToolSection.tsx +++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/permission-flags/components/SettingsRolePermissionsToolSection.tsx @@ -21,7 +21,7 @@ const StyledTableRows = styled.div` padding-top: ${themeCssVariables.spacing[2]}; `; -const StyledCard = styled(Card)` +const StyledCardContainer = styled.div` margin-bottom: ${themeCssVariables.spacing[4]}; `; @@ -59,21 +59,23 @@ export const SettingsRolePermissionsToolSection = ({ {shouldShowAllAccessToggle && ( - - { - setSettingsDraftRole({ - ...settingsDraftRole, - canAccessAllTools: !settingsDraftRole.canAccessAllTools, - }); - }} - /> - + + + { + setSettingsDraftRole({ + ...settingsDraftRole, + canAccessAllTools: !settingsDraftRole.canAccessAllTools, + }); + }} + /> + + )} ` +const StyledLinkContainer = styled.div<{ isDisabled: boolean }>` pointer-events: ${({ isDisabled }) => (isDisabled ? 'none' : 'auto')}; - text-decoration: none; + + > a { + text-decoration: none; + } `; export const SettingsSSOIdentitiesProvidersListCard = () => { @@ -48,16 +51,17 @@ export const SettingsSSOIdentitiesProvidersListCard = () => { }); return loading || !SSOIdentitiesProviders.length ? ( - - } - /> - + + } + /> + + ) : ( ); diff --git a/packages/twenty-front/src/modules/settings/security/components/approvedAccessDomains/SettingsApprovedAccessDomainsListCard.tsx b/packages/twenty-front/src/modules/settings/security/components/approvedAccessDomains/SettingsApprovedAccessDomainsListCard.tsx index cdfda80bdc..69ee154149 100644 --- a/packages/twenty-front/src/modules/settings/security/components/approvedAccessDomains/SettingsApprovedAccessDomainsListCard.tsx +++ b/packages/twenty-front/src/modules/settings/security/components/approvedAccessDomains/SettingsApprovedAccessDomainsListCard.tsx @@ -19,8 +19,10 @@ import { useGetApprovedAccessDomainsQuery } from '~/generated-metadata/graphql'; import { dateLocaleState } from '~/localization/states/dateLocaleState'; import { beautifyPastDateRelativeToNow } from '~/utils/date-utils'; -const StyledLink = styled(Link)` - text-decoration: none; +const StyledLinkContainer = styled.div` + > a { + text-decoration: none; + } `; export const SettingsApprovedAccessDomainsListCard = () => { @@ -54,12 +56,14 @@ export const SettingsApprovedAccessDomainsListCard = () => { }; return loading || !approvedAccessDomains.length ? ( - - } - /> - + + + } + /> + + ) : ( <> diff --git a/packages/twenty-front/src/modules/side-panel/components/SidePanelBackButton.tsx b/packages/twenty-front/src/modules/side-panel/components/SidePanelBackButton.tsx index 3e2d9ad1a1..66d2db7972 100644 --- a/packages/twenty-front/src/modules/side-panel/components/SidePanelBackButton.tsx +++ b/packages/twenty-front/src/modules/side-panel/components/SidePanelBackButton.tsx @@ -14,15 +14,12 @@ import { themeCssVariables } from 'twenty-ui/theme-constants'; const StyledNavigationIcon = styled.div` align-items: center; + color: ${themeCssVariables.font.color.secondary}; cursor: pointer; display: flex; justify-content: center; `; -const StyledIconChevronLeft = styled(IconChevronLeft)` - color: ${themeCssVariables.font.color.secondary}; -`; - export const SidePanelBackButton = () => { const { goBackFromSidePanel } = useSidePanelHistory(); @@ -53,7 +50,7 @@ export const SidePanelBackButton = () => { clickableComponent={ { } return ( <> - {heading} + + {heading} + {children} > ); diff --git a/packages/twenty-front/src/modules/side-panel/components/SidePanelTopBarRightCornerIcon.tsx b/packages/twenty-front/src/modules/side-panel/components/SidePanelTopBarRightCornerIcon.tsx index 5d2695039c..846289656b 100644 --- a/packages/twenty-front/src/modules/side-panel/components/SidePanelTopBarRightCornerIcon.tsx +++ b/packages/twenty-front/src/modules/side-panel/components/SidePanelTopBarRightCornerIcon.tsx @@ -13,7 +13,7 @@ import { FeatureFlagKey } from '~/generated-metadata/graphql'; import { useCreateNewAIChatThread } from '@/ai/hooks/useCreateNewAIChatThread'; import { themeCssVariables } from 'twenty-ui/theme-constants'; -const StyledIconButton = styled(IconButton)` +const StyledIconButtonContainer = styled.div` color: ${themeCssVariables.font.color.secondary}; `; @@ -35,22 +35,26 @@ export const SidePanelTopBarRightCornerIcon = () => { if (!isOnAskAIPage) { return ( - openAskAIPage({ resetNavigationStack: false })} - Icon={IconSparkles} - variant="tertiary" - size="small" - /> + + openAskAIPage({ resetNavigationStack: false })} + Icon={IconSparkles} + variant="tertiary" + size="small" + /> + ); } return ( - createChatThread()} - ariaLabel={t`New conversation`} - /> + + createChatThread()} + ariaLabel={t`New conversation`} + /> + ); }; diff --git a/packages/twenty-front/src/modules/side-panel/pages/workflow/step/view-run/components/SidePanelWorkflowRunViewStepContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/workflow/step/view-run/components/SidePanelWorkflowRunViewStepContent.tsx index 3bb407606a..59f3d2fd7a 100644 --- a/packages/twenty-front/src/modules/side-panel/pages/workflow/step/view-run/components/SidePanelWorkflowRunViewStepContent.tsx +++ b/packages/twenty-front/src/modules/side-panel/pages/workflow/step/view-run/components/SidePanelWorkflowRunViewStepContent.tsx @@ -35,7 +35,7 @@ const StyledContainer = styled.div` height: 100%; `; -const StyledTabList = styled(TabList)` +const StyledTabListContainer = styled.div` background-color: ${themeCssVariables.background.secondary}; padding-left: ${themeCssVariables.spacing[2]}; `; @@ -131,11 +131,13 @@ export const SidePanelWorkflowRunViewStepContent = () => { /> ) : ( <> - + + + {activeTabId === WorkflowRunTabId.OUTPUT ? ( div { + background-color: ${themeCssVariables.background.transparent.lighter}; + border: 1px solid ${themeCssVariables.border.color.medium}; + border-radius: ${themeCssVariables.border.radius.sm}; + } `; + +const StyledMenuItem = (props: React.ComponentProps) => ( + + {/* eslint-disable-next-line react/jsx-props-no-spreading */} + + +); export const MatchColumnToFieldSelect = ({ onChange, value, diff --git a/packages/twenty-front/src/modules/spreadsheet-import/components/SpreadsheetImportTable.tsx b/packages/twenty-front/src/modules/spreadsheet-import/components/SpreadsheetImportTable.tsx index 802aaca35f..c89d2c6afd 100644 --- a/packages/twenty-front/src/modules/spreadsheet-import/components/SpreadsheetImportTable.tsx +++ b/packages/twenty-front/src/modules/spreadsheet-import/components/SpreadsheetImportTable.tsx @@ -5,7 +5,7 @@ import DataGrid, { type DataGridProps } from 'react-data-grid'; import { useSpreadsheetImportInternal } from '@/spreadsheet-import/hooks/useSpreadsheetImportInternal'; import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants'; -const StyledDataGrid = styled(DataGrid)` +const StyledDataGridContainer = styled.div<{ headerRowHeight?: number }>` --rdg-background-color: ${themeCssVariables.background.primary}; --rdg-border-color: ${themeCssVariables.border.color.medium}; --rdg-color: ${themeCssVariables.font.color.primary}; @@ -25,9 +25,11 @@ const StyledDataGrid = styled(DataGrid)` --row-selected-hover-background-color: ${themeCssVariables.background .secondary}; - border: none; - block-size: 100%; - width: 100%; + > * { + border: none; + block-size: 100%; + width: 100%; + } .rdg-header-row .rdg-cell { box-shadow: none; @@ -99,7 +101,7 @@ const StyledDataGrid = styled(DataGrid)` display: flex; line-height: none; } -` as typeof DataGrid; +`; type SpreadsheetImportTableProps = Pick< DataGridProps, @@ -138,21 +140,23 @@ export const SpreadsheetImportTable = ({ if (!rows?.length || !columns?.length) return null; return ( - + + + ); }; diff --git a/packages/twenty-front/src/modules/spreadsheet-import/components/StepNavigationButton.tsx b/packages/twenty-front/src/modules/spreadsheet-import/components/StepNavigationButton.tsx index 332549dc60..24b77b6458 100644 --- a/packages/twenty-front/src/modules/spreadsheet-import/components/StepNavigationButton.tsx +++ b/packages/twenty-front/src/modules/spreadsheet-import/components/StepNavigationButton.tsx @@ -7,10 +7,12 @@ import { MainButton } from 'twenty-ui/input'; import { ModalFooter } from 'twenty-ui/layout'; import { isUndefinedOrNull } from '~/utils/isUndefinedOrNull'; -const StyledFooter = styled(ModalFooter)` - border-top: 1px solid ${themeCssVariables.border.color.medium}; - box-shadow: ${themeCssVariables.boxShadow.strong}; - justify-content: space-between; +const StyledFooterContainer = styled.div` + > div { + border-top: 1px solid ${themeCssVariables.border.color.medium}; + box-shadow: ${themeCssVariables.boxShadow.strong}; + justify-content: space-between; + } `; type StepNavigationButtonProps = { @@ -31,24 +33,26 @@ export const StepNavigationButton = ({ isContinueDisabled = false, }: StepNavigationButtonProps) => { return ( - - {!isUndefinedOrNull(onBack) && ( - - )} - {!isUndefinedOrNull(onContinue) && ( - - )} - + + + {!isUndefinedOrNull(onBack) && ( + + )} + {!isUndefinedOrNull(onContinue) && ( + + )} + + ); }; diff --git a/packages/twenty-front/src/modules/spreadsheet-import/steps/components/MatchColumnsStep/components/SubMatchingSelectDropdownButton.tsx b/packages/twenty-front/src/modules/spreadsheet-import/steps/components/MatchColumnsStep/components/SubMatchingSelectDropdownButton.tsx index 748ee5ce0f..bef6a83521 100644 --- a/packages/twenty-front/src/modules/spreadsheet-import/steps/components/MatchColumnsStep/components/SubMatchingSelectDropdownButton.tsx +++ b/packages/twenty-front/src/modules/spreadsheet-import/steps/components/MatchColumnsStep/components/SubMatchingSelectDropdownButton.tsx @@ -13,8 +13,9 @@ import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants'; import { Tag, type TagColor } from 'twenty-ui/components'; import { IconChevronDown } from 'twenty-ui/display'; import { type SelectOption } from 'twenty-ui/input'; -const StyledIconChevronDown = styled(IconChevronDown)` +const StyledIconChevronDownContainer = styled.div` color: ${themeCssVariables.font.color.tertiary}; + display: flex; `; export type SubMatchingSelectDropdownButtonProps = { @@ -40,7 +41,9 @@ export const SubMatchingSelectDropdownButton = ({ text={value?.label ?? placeholder} color={value?.color as TagColor} /> - + + + ); }; diff --git a/packages/twenty-front/src/modules/spreadsheet-import/steps/components/MatchColumnsStep/components/UnmatchColumnBanner.tsx b/packages/twenty-front/src/modules/spreadsheet-import/steps/components/MatchColumnsStep/components/UnmatchColumnBanner.tsx index 72b362899a..9a25e9407c 100644 --- a/packages/twenty-front/src/modules/spreadsheet-import/steps/components/MatchColumnsStep/components/UnmatchColumnBanner.tsx +++ b/packages/twenty-front/src/modules/spreadsheet-import/steps/components/MatchColumnsStep/components/UnmatchColumnBanner.tsx @@ -4,13 +4,15 @@ import { Banner, IconChevronDown, IconInfoCircle } from 'twenty-ui/display'; import { useContext } from 'react'; import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants'; -const StyledBanner = styled(Banner)<{ allMatched: boolean }>` - background: ${({ allMatched }) => - allMatched - ? themeCssVariables.accent.secondary - : themeCssVariables.background.transparent.light}; - border-radius: ${themeCssVariables.spacing[2]}; - padding: ${themeCssVariables.spacing[2]} 10px; +const StyledBannerContainer = styled.div<{ allMatched: boolean }>` + > div { + background: ${({ allMatched }) => + allMatched + ? themeCssVariables.accent.secondary + : themeCssVariables.background.transparent.light}; + border-radius: ${themeCssVariables.spacing[2]}; + padding: ${themeCssVariables.spacing[2]} 10px; + } `; const StyledText = styled.div<{ allMatched: boolean }>` @@ -65,24 +67,26 @@ export const UnmatchColumnBanner = ({ const { theme } = useContext(ThemeContext); return ( - - - {isDefined(buttonOnClick) ? ( - + + + + {isDefined(buttonOnClick) ? ( + + {message} + + + + + ) : ( {message} - - - - - ) : ( - {message} - )} - + )} + + ); }; diff --git a/packages/twenty-front/src/modules/spreadsheet-import/steps/components/SelectHeaderStep/SelectHeaderStep.tsx b/packages/twenty-front/src/modules/spreadsheet-import/steps/components/SelectHeaderStep/SelectHeaderStep.tsx index ef409c29dd..70212aa6d1 100644 --- a/packages/twenty-front/src/modules/spreadsheet-import/steps/components/SelectHeaderStep/SelectHeaderStep.tsx +++ b/packages/twenty-front/src/modules/spreadsheet-import/steps/components/SelectHeaderStep/SelectHeaderStep.tsx @@ -15,7 +15,7 @@ import { SpreadsheetImportStepType } from '@/spreadsheet-import/steps/types/Spre import { useLingui } from '@lingui/react/macro'; import { SelectHeaderTable } from './components/SelectHeaderTable'; -const StyledHeading = styled(Heading)` +const StyledHeadingContainer = styled.div` margin-bottom: ${themeCssVariables.spacing[8]}; `; @@ -105,7 +105,9 @@ export const SelectHeaderStep = ({ return ( <> - + + + - + - setValue(value)} value={value}> - {sheetNames.map((sheetName) => ( - ( + + { + if (checked) setValue(sheetName); + }} /> - ))} - + + ))} button { + height: 24px; + } `; const StyledErrorToggle = styled.div` @@ -323,13 +325,15 @@ export const ValidationStep = ({ Show only rows with errors - + + + diff --git a/packages/twenty-front/src/modules/ui/feedback/dialog-manager/components/Dialog.tsx b/packages/twenty-front/src/modules/ui/feedback/dialog-manager/components/Dialog.tsx index b990e5f51b..38193535e1 100644 --- a/packages/twenty-front/src/modules/ui/feedback/dialog-manager/components/Dialog.tsx +++ b/packages/twenty-front/src/modules/ui/feedback/dialog-manager/components/Dialog.tsx @@ -55,7 +55,8 @@ const StyledDialogMessage = styled.span` text-align: center; `; -const StyledDialogButton = styled(Button)` +const StyledDialogButtonContainer = styled.div` + display: flex; justify-content: center; margin-bottom: ${themeCssVariables.spacing[2]}; `; @@ -157,16 +158,18 @@ export const Dialog = ({ {message && {message}} {children} {buttons.map(({ accent, onClick, role, title: key, variant }) => ( - ) => { - onClose?.(); - onClick?.(event); - }} - fullWidth={true} - variant={variant ?? 'secondary'} - title={key} - {...{ accent, key, role }} - /> + + ) => { + onClose?.(); + onClick?.(event); + }} + fullWidth={true} + variant={variant ?? 'secondary'} + title={key} + {...{ accent, role }} + /> + ))} diff --git a/packages/twenty-front/src/modules/ui/feedback/snack-bar-manager/components/SnackBar.tsx b/packages/twenty-front/src/modules/ui/feedback/snack-bar-manager/components/SnackBar.tsx index f6035311d9..2b4c3f76a7 100644 --- a/packages/twenty-front/src/modules/ui/feedback/snack-bar-manager/components/SnackBar.tsx +++ b/packages/twenty-front/src/modules/ui/feedback/snack-bar-manager/components/SnackBar.tsx @@ -68,7 +68,7 @@ const StyledContainer = styled.div` } `; -const StyledProgressBar = styled(ProgressBar)` +const StyledProgressBarContainer = styled.div` bottom: 0; height: auto; left: 0; @@ -112,17 +112,19 @@ const StyledDescription = styled.div` width: 200px; `; -const StyledLink = styled(Link)` - display: block; - color: ${themeCssVariables.font.color.tertiary}; - font-size: ${themeCssVariables.font.size.sm}; - padding-left: ${themeCssVariables.spacing[6]}; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - max-width: 200px; - &:hover { - color: ${themeCssVariables.font.color.secondary}; +const StyledLinkContainer = styled.div` + > a { + display: block; + color: ${themeCssVariables.font.color.tertiary}; + font-size: ${themeCssVariables.font.size.sm}; + padding-left: ${themeCssVariables.spacing[6]}; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + max-width: 200px; + &:hover { + color: ${themeCssVariables.font.color.secondary}; + } } `; @@ -229,10 +231,12 @@ export const SnackBar = ({ role={role} data-globally-prevent-click-outside > - + + + {icon} {sanitizedMessage ?? ''} @@ -248,7 +252,9 @@ export const SnackBar = ({ {sanitizedDetailedMessage} )} {actionText && actionTo && ( - {actionText} + + {actionText} + )} {actionText && actionOnClick && !actionTo && ( diff --git a/packages/twenty-front/src/modules/ui/field/input/components/CurrencyInput.tsx b/packages/twenty-front/src/modules/ui/field/input/components/CurrencyInput.tsx index 000e09cdd7..8896027444 100644 --- a/packages/twenty-front/src/modules/ui/field/input/components/CurrencyInput.tsx +++ b/packages/twenty-front/src/modules/ui/field/input/components/CurrencyInput.tsx @@ -9,25 +9,27 @@ import { IMaskInput } from 'react-imask'; import { type IconComponent } from 'twenty-ui/display'; import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants'; -export const StyledIMaskInput = styled(IMaskInput)` - margin: 0; - background-color: transparent; - border: none; - color: ${themeCssVariables.font.color.primary}; - font-family: ${themeCssVariables.font.family}; - font-size: inherit; - font-weight: inherit; - outline: none; - padding: ${themeCssVariables.spacing[0]} ${themeCssVariables.spacing[1.5]}; - - &::placeholder, - &::-webkit-input-placeholder { - color: ${themeCssVariables.font.color.light}; +export const StyledIMaskInput = styled.div` + > input { + margin: 0; + background-color: transparent; + border: none; + color: ${themeCssVariables.font.color.primary}; font-family: ${themeCssVariables.font.family}; - font-weight: ${themeCssVariables.font.weight.medium}; - } + font-size: inherit; + font-weight: inherit; + outline: none; + padding: ${themeCssVariables.spacing[0]} ${themeCssVariables.spacing[1.5]}; - width: 100%; + &::placeholder, + &::-webkit-input-placeholder { + color: ${themeCssVariables.font.color.light}; + font-family: ${themeCssVariables.font.family}; + font-weight: ${themeCssVariables.font.weight.medium}; + } + + width: 100%; + } `; const StyledContainer = styled.div` @@ -124,19 +126,21 @@ export const CurrencyInput = ({ )} - handleChange(value)} - inputRef={wrapperRef} - autoComplete="off" - placeholder={placeholder} - autoFocus={autoFocus} - value={value} - unmask - /> + + handleChange(value)} + inputRef={wrapperRef} + autoComplete="off" + placeholder={placeholder} + autoFocus={autoFocus} + value={value} + unmask + /> + ); }; diff --git a/packages/twenty-front/src/modules/ui/field/input/components/TextAreaInput.tsx b/packages/twenty-front/src/modules/ui/field/input/components/TextAreaInput.tsx index 3e5b3aa54c..15357ab43c 100644 --- a/packages/twenty-front/src/modules/ui/field/input/components/TextAreaInput.tsx +++ b/packages/twenty-front/src/modules/ui/field/input/components/TextAreaInput.tsx @@ -25,31 +25,33 @@ export type TextAreaInputProps = { copyButton?: boolean; }; -const StyledTextArea = styled(TextareaAutosize)` - background-color: transparent; - border: none; - color: ${themeCssVariables.font.color.primary}; - font-family: ${themeCssVariables.font.family}; - font-size: inherit; - font-weight: inherit; - outline: none; - padding: ${themeCssVariables.spacing[0]} ${themeCssVariables.spacing[2]}; - - &::placeholder, - &::-webkit-input-placeholder { - color: ${themeCssVariables.font.color.light}; +const StyledTextAreaContainer = styled.div` + > textarea { + background-color: transparent; + border: none; + color: ${themeCssVariables.font.color.primary}; font-family: ${themeCssVariables.font.family}; - font-weight: ${themeCssVariables.font.weight.medium}; + font-size: inherit; + font-weight: inherit; + outline: none; + padding: ${themeCssVariables.spacing[0]} ${themeCssVariables.spacing[2]}; + + &::placeholder, + &::-webkit-input-placeholder { + color: ${themeCssVariables.font.color.light}; + font-family: ${themeCssVariables.font.family}; + font-weight: ${themeCssVariables.font.weight.medium}; + } + + align-items: center; + display: flex; + justify-content: center; + resize: none; + max-height: 400px; + width: calc(100% - ${themeCssVariables.spacing[7]}); + + line-height: 18px; } - - align-items: center; - display: flex; - justify-content: center; - resize: none; - max-height: 400px; - width: calc(100% - ${themeCssVariables.spacing[7]}); - - line-height: 18px; `; const StyledLightIconButtonContainer = styled.div` @@ -111,16 +113,18 @@ export const TextAreaInput = ({ return ( <> - + + + {copyButton && ( diff --git a/packages/twenty-front/src/modules/ui/input/components/TextArea.tsx b/packages/twenty-front/src/modules/ui/input/components/TextArea.tsx index c06432e59a..2e7853e719 100644 --- a/packages/twenty-front/src/modules/ui/input/components/TextArea.tsx +++ b/packages/twenty-front/src/modules/ui/input/components/TextArea.tsx @@ -40,34 +40,36 @@ const StyledLabel = styled.label` margin-bottom: ${themeCssVariables.spacing[1]}; `; -const StyledTextArea = styled(TextareaAutosize)` - background-color: ${themeCssVariables.background.transparent.lighter}; - border: 1px solid ${themeCssVariables.border.color.medium}; - border-radius: ${themeCssVariables.border.radius.sm}; - box-sizing: border-box; - color: ${themeCssVariables.font.color.primary}; - font-family: inherit; - font-size: ${themeCssVariables.font.size.md}; - font-weight: ${themeCssVariables.font.weight.regular}; - line-height: 16px; - overflow: auto; - padding: ${themeCssVariables.spacing[2]}; - resize: none; - width: 100%; - - &:focus { - outline: none; - box-shadow: 0px 0px 0px 3px ${themeCssVariables.color.transparent.blue2}; - border-color: ${themeCssVariables.color.blue}; - } - - &::placeholder { - color: ${themeCssVariables.font.color.light}; +const StyledTextAreaContainer = styled.div` + > textarea { + background-color: ${themeCssVariables.background.transparent.lighter}; + border: 1px solid ${themeCssVariables.border.color.medium}; + border-radius: ${themeCssVariables.border.radius.sm}; + box-sizing: border-box; + color: ${themeCssVariables.font.color.primary}; + font-family: inherit; + font-size: ${themeCssVariables.font.size.md}; font-weight: ${themeCssVariables.font.weight.regular}; - } + line-height: 16px; + overflow: auto; + padding: ${themeCssVariables.spacing[2]}; + resize: none; + width: 100%; - &:disabled { - color: ${themeCssVariables.font.color.tertiary}; + &:focus { + outline: none; + box-shadow: 0px 0px 0px 3px ${themeCssVariables.color.transparent.blue2}; + border-color: ${themeCssVariables.color.blue}; + } + + &::placeholder { + color: ${themeCssVariables.font.color.light}; + font-weight: ${themeCssVariables.font.weight.regular}; + } + + &:disabled { + color: ${themeCssVariables.font.color.tertiary}; + } } `; @@ -115,22 +117,24 @@ export const TextArea = ({ {label && {label}} - - onChange?.(turnIntoEmptyStringIfWhitespacesOnly(event.target.value)) - } - onFocus={handleFocus} - onBlur={handleBlur} - disabled={disabled} - className={className} - readOnly={readOnly} - style={isDefined(height) ? { height } : undefined} - /> + + + onChange?.(turnIntoEmptyStringIfWhitespacesOnly(event.target.value)) + } + onFocus={handleFocus} + onBlur={handleBlur} + disabled={disabled} + className={className} + readOnly={readOnly} + style={isDefined(height) ? { height } : undefined} + /> + ); }; diff --git a/packages/twenty-front/src/modules/ui/layout/dropdown/components/StyledDropdownMenuSubheader.tsx b/packages/twenty-front/src/modules/ui/layout/dropdown/components/StyledDropdownMenuSubheader.tsx index 2a43a262b5..16aaf68c12 100644 --- a/packages/twenty-front/src/modules/ui/layout/dropdown/components/StyledDropdownMenuSubheader.tsx +++ b/packages/twenty-front/src/modules/ui/layout/dropdown/components/StyledDropdownMenuSubheader.tsx @@ -1,9 +1,20 @@ import { styled } from '@linaria/react'; +import { type ReactNode } from 'react'; import { Label } from 'twenty-ui/display'; import { themeCssVariables } from 'twenty-ui/theme-constants'; -export const StyledDropdownMenuSubheader = styled(Label)` +const StyledDropdownMenuSubheaderContainer = styled.div` background-color: ${themeCssVariables.background.transparent.lighter}; padding: ${themeCssVariables.spacing[1]} ${themeCssVariables.spacing[2]}; width: 100%; `; + +export const StyledDropdownMenuSubheader = ({ + children, +}: { + children: ReactNode; +}) => ( + + {children} + +); diff --git a/packages/twenty-front/src/modules/ui/layout/fullscreen/components/FullScreenContainer.tsx b/packages/twenty-front/src/modules/ui/layout/fullscreen/components/FullScreenContainer.tsx index e21c5aedd8..4816a3803e 100644 --- a/packages/twenty-front/src/modules/ui/layout/fullscreen/components/FullScreenContainer.tsx +++ b/packages/twenty-front/src/modules/ui/layout/fullscreen/components/FullScreenContainer.tsx @@ -29,7 +29,7 @@ const StyledMainContainer = styled.div` ${themeCssVariables.spacing[3]}; `; -const StyledPageHeader = styled(PageHeader)` +const StyledPageHeaderContainer = styled.div` padding-left: ${themeCssVariables.spacing[3]}; `; @@ -42,11 +42,13 @@ export const FullScreenContainer = ({ return ( - } - hasClosePageButton={!isMobile} - onClosePage={exitFullScreen} - /> + + } + hasClosePageButton={!isMobile} + onClosePage={exitFullScreen} + /> + {children} ); diff --git a/packages/twenty-front/src/modules/ui/layout/fullscreen/components/FullScreenModal.tsx b/packages/twenty-front/src/modules/ui/layout/fullscreen/components/FullScreenModal.tsx index 2253ace892..dd28d4cb06 100644 --- a/packages/twenty-front/src/modules/ui/layout/fullscreen/components/FullScreenModal.tsx +++ b/packages/twenty-front/src/modules/ui/layout/fullscreen/components/FullScreenModal.tsx @@ -22,7 +22,7 @@ const StyledFullScreenOverlay = styled.div` z-index: ${RootStackingContextZIndices.RootModal}; `; -const StyledFullScreenHeader = styled(PageHeader)` +const StyledFullScreenHeaderContainer = styled.div` padding-left: ${themeCssVariables.spacing[3]}; `; @@ -59,11 +59,13 @@ export const FullScreenModal = forwardRef( data-globally-prevent-click-outside="true" tabIndex={-1} > - } - hasClosePageButton={hasClosePageButton} - onClosePage={onClose} - /> + + } + hasClosePageButton={hasClosePageButton} + onClosePage={onClose} + /> + {children} ); diff --git a/packages/twenty-front/src/modules/ui/layout/modal/components/ConfirmationModal.tsx b/packages/twenty-front/src/modules/ui/layout/modal/components/ConfirmationModal.tsx index d533b09ff2..2ea90f2228 100644 --- a/packages/twenty-front/src/modules/ui/layout/modal/components/ConfirmationModal.tsx +++ b/packages/twenty-front/src/modules/ui/layout/modal/components/ConfirmationModal.tsx @@ -33,30 +33,52 @@ export type ConfirmationModalProps = { overlay?: ModalOverlay; }; -export const StyledCenteredButton = styled(Button)` +const StyledCenteredButtonContainer = styled.div` box-sizing: border-box; margin-top: ${themeCssVariables.spacing[2]}; `; +export const StyledCenteredButton = ( + props: React.ComponentProps, +) => ( + + {/* eslint-disable-next-line react/jsx-props-no-spreading */} + + +); + const StyledCenteredTitle = styled.div` text-align: center; `; -const StyledSection = styled(Section)` +const StyledSectionContainer = styled.div` margin-bottom: ${themeCssVariables.spacing[6]}; `; -export const StyledConfirmationButton = styled(StyledCenteredButton)` - border-color: ${themeCssVariables.border.color.danger}; - box-shadow: none; - color: ${themeCssVariables.color.red}; - font-size: ${themeCssVariables.font.size.md}; - line-height: ${themeCssVariables.text.lineHeight.lg}; - :hover { - background-color: ${themeCssVariables.color.red3}; +const StyledConfirmationButtonContainer = styled.div` + box-sizing: border-box; + margin-top: ${themeCssVariables.spacing[2]}; + > button { + border-color: ${themeCssVariables.border.color.danger}; + box-shadow: none; + color: ${themeCssVariables.color.red}; + font-size: ${themeCssVariables.font.size.md}; + line-height: ${themeCssVariables.text.lineHeight.lg}; + &:hover { + background-color: ${themeCssVariables.color.red3}; + } } `; +export const StyledConfirmationButton = ( + props: React.ComponentProps, +) => ( + + {/* eslint-disable-next-line react/jsx-props-no-spreading */} + + +); + const defaultConfirmButtonText = msg`Confirm`; export const ConfirmationModal = ({ @@ -129,12 +151,14 @@ export const ConfirmationModal = ({ - - {subtitle} - + + + {subtitle} + + {confirmationValue && ( { return isMobile ? ( - - - {children} - - + + + + {children} + + + ) : ( diff --git a/packages/twenty-front/src/modules/ui/layout/tab-list/components/TabMoreButton.tsx b/packages/twenty-front/src/modules/ui/layout/tab-list/components/TabMoreButton.tsx index 723eefe841..e91e6e172f 100644 --- a/packages/twenty-front/src/modules/ui/layout/tab-list/components/TabMoreButton.tsx +++ b/packages/twenty-front/src/modules/ui/layout/tab-list/components/TabMoreButton.tsx @@ -4,8 +4,10 @@ import { IconChevronDown } from 'twenty-ui/display'; import { TabButton } from 'twenty-ui/input'; import { themeCssVariables } from 'twenty-ui/theme-constants'; -const StyledTabMoreButton = styled(TabButton)` - height: ${themeCssVariables.spacing[10]}; +const StyledTabMoreButtonContainer = styled.div` + > * { + height: ${themeCssVariables.spacing[10]}; + } `; export const TabMoreButton = ({ @@ -18,12 +20,14 @@ export const TabMoreButton = ({ className?: string; }) => { return ( - + + + ); }; diff --git a/packages/twenty-front/src/modules/ui/layout/table/components/TableSection.tsx b/packages/twenty-front/src/modules/ui/layout/table/components/TableSection.tsx index 6fb0fda0bf..7786483925 100644 --- a/packages/twenty-front/src/modules/ui/layout/table/components/TableSection.tsx +++ b/packages/twenty-front/src/modules/ui/layout/table/components/TableSection.tsx @@ -31,7 +31,7 @@ const StyledSection = styled.div<{ isExpanded: boolean }>` opacity calc(${themeCssVariables.animation.duration.normal} * 1s); `; -const StyledSectionContent = styled(TableBody)` +const StyledSectionContentContainer = styled.div` border-bottom: 1px solid ${themeCssVariables.border.color.light}; `; @@ -66,7 +66,9 @@ export const TableSection = ({ )} - {children} + + {children} + > ); diff --git a/packages/twenty-front/src/modules/ui/layout/table/components/TableSubRow.tsx b/packages/twenty-front/src/modules/ui/layout/table/components/TableSubRow.tsx index 481d4a8081..64004b2822 100644 --- a/packages/twenty-front/src/modules/ui/layout/table/components/TableSubRow.tsx +++ b/packages/twenty-front/src/modules/ui/layout/table/components/TableSubRow.tsx @@ -1,10 +1,19 @@ import { styled } from '@linaria/react'; +import { type ReactNode } from 'react'; import { themeCssVariables } from 'twenty-ui/theme-constants'; import { TableRow } from '@/ui/layout/table/components/TableRow'; -const StyledTableSubRow = styled(TableRow)` +const StyledTableSubRowContainer = styled.div` padding-left: ${themeCssVariables.spacing[4]}; `; -export const TableSubRow = StyledTableSubRow; +export const TableSubRow = ({ + children, + ...props +}: React.ComponentProps & { children?: ReactNode }) => ( + + {/* eslint-disable-next-line react/jsx-props-no-spreading */} + {children} + +); diff --git a/packages/twenty-front/src/modules/ui/navigation/bread-crumb/components/Breadcrumb.tsx b/packages/twenty-front/src/modules/ui/navigation/bread-crumb/components/Breadcrumb.tsx index 077ffa4e5e..c50455025d 100644 --- a/packages/twenty-front/src/modules/ui/navigation/bread-crumb/components/Breadcrumb.tsx +++ b/packages/twenty-front/src/modules/ui/navigation/bread-crumb/components/Breadcrumb.tsx @@ -22,12 +22,14 @@ const StyledWrapper = styled.nav` height: ${themeCssVariables.spacing[8]}; `; -const StyledLink = styled(Link)` - color: inherit; - text-decoration: none; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; +const StyledLinkContainer = styled.div` + > a { + color: inherit; + text-decoration: none; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } `; const StyledText = styled.span` @@ -56,9 +58,11 @@ export const Breadcrumb = ({ className, links }: BreadcrumbProps) => { return ( {link.href ? ( - - {link.children} - + + + {link.children} + + ) : ( {link.children} )} diff --git a/packages/twenty-front/src/modules/ui/navigation/bread-crumb/components/MobileBreadcrumb.tsx b/packages/twenty-front/src/modules/ui/navigation/bread-crumb/components/MobileBreadcrumb.tsx index b3586419ac..e05e37b98d 100644 --- a/packages/twenty-front/src/modules/ui/navigation/bread-crumb/components/MobileBreadcrumb.tsx +++ b/packages/twenty-front/src/modules/ui/navigation/bread-crumb/components/MobileBreadcrumb.tsx @@ -24,12 +24,14 @@ const StyledWrapper = styled.nav` height: ${themeCssVariables.spacing[8]}; `; -const StyledLink = styled(Link)` - color: inherit; - text-decoration: none; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; +const StyledLinkContainer = styled.div` + > a { + color: inherit; + text-decoration: none; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } `; const StyledText = styled.span` @@ -71,9 +73,11 @@ export const MobileBreadcrumb = ({ ) : previousLink?.href ? ( <> - - {t`Back to ${linkText}`} - + + + {t`Back to ${linkText}`} + + > ) : ( {previousLink?.children} diff --git a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/MultiWorkspacesDropdownStyles.tsx b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/MultiWorkspacesDropdownStyles.tsx index 4d33e550c8..ee7dc902d6 100644 --- a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/MultiWorkspacesDropdownStyles.tsx +++ b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/MultiWorkspacesDropdownStyles.tsx @@ -30,9 +30,7 @@ export const StyledLabel = styled.div` font-weight: ${themeCssVariables.font.weight.medium}; `; -export const StyledIconChevronDown = styled(IconChevronDown)<{ - disabled?: boolean; -}>` +const StyledIconChevronDownContainer = styled.div<{ disabled?: boolean }>` align-items: center; color: ${({ disabled }) => disabled @@ -40,3 +38,13 @@ export const StyledIconChevronDown = styled(IconChevronDown)<{ : themeCssVariables.font.color.tertiary}; display: flex; `; + +export const StyledIconChevronDown = ({ + disabled, + ...props +}: { disabled?: boolean } & React.ComponentProps) => ( + + {/* eslint-disable-next-line react/jsx-props-no-spreading */} + + +); diff --git a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/NavigationDrawerHeader.tsx b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/NavigationDrawerHeader.tsx index ca516e9156..3acb12927d 100644 --- a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/NavigationDrawerHeader.tsx +++ b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/NavigationDrawerHeader.tsx @@ -33,12 +33,12 @@ const StyledRightActions = styled.div<{ isExpanded: boolean }>` transition: gap calc(${themeCssVariables.animation.duration.normal} * 1s) ease; `; -const StyledNavigationDrawerCollapseButton = styled( - NavigationDrawerCollapseButton, -)` - height: ${themeCssVariables.spacing[6]}; - padding-right: ${themeCssVariables.spacing[1]}; - width: ${themeCssVariables.spacing[6]}; +const StyledNavigationDrawerCollapseButtonContainer = styled.div` + > * { + height: ${themeCssVariables.spacing[6]}; + padding-right: ${themeCssVariables.spacing[1]}; + width: ${themeCssVariables.spacing[6]}; + } `; const StyledWorkspaceDropdownContainer = styled.div` @@ -76,7 +76,9 @@ export const NavigationDrawerHeader = ({ aria-label={t`Search`} /> {isNavigationDrawerExpanded && showCollapseButton && ( - + + + )} )} diff --git a/packages/twenty-front/src/modules/ui/utilities/drag-select/components/__stories__/DragSelect.stories.tsx b/packages/twenty-front/src/modules/ui/utilities/drag-select/components/__stories__/DragSelect.stories.tsx index 71cbd6b92f..c0e2462be2 100644 --- a/packages/twenty-front/src/modules/ui/utilities/drag-select/components/__stories__/DragSelect.stories.tsx +++ b/packages/twenty-front/src/modules/ui/utilities/drag-select/components/__stories__/DragSelect.stories.tsx @@ -60,11 +60,12 @@ const StyledLargeGrid = styled.div` height: 600px; `; -const StyledScrollableWrapper = styled(ScrollWrapper)` +const StyledScrollableWrapperContainer = styled.div` border: 1px solid ${themeCssVariables.border.color.light}; border-radius: ${themeCssVariables.border.radius.md}; height: 300px; width: 600px; + overflow: hidden; `; type SelectableItemProps = { @@ -146,27 +147,32 @@ const ScrollableDragSelectDemo = () => { }; return ( - - - - {Array.from({ length: 36 }, (_, index) => ( - - Item {index + 1} - - ))} - + + + + + {Array.from({ length: 36 }, (_, index) => ( + + Item {index + 1} + + ))} + - - - + + + + ); }; diff --git a/packages/twenty-front/src/modules/views/components/ViewBarFilterDropdownAdvancedFilterButton.tsx b/packages/twenty-front/src/modules/views/components/ViewBarFilterDropdownAdvancedFilterButton.tsx index 7011e4263f..3fc1c12d1b 100644 --- a/packages/twenty-front/src/modules/views/components/ViewBarFilterDropdownAdvancedFilterButton.tsx +++ b/packages/twenty-front/src/modules/views/components/ViewBarFilterDropdownAdvancedFilterButton.tsx @@ -26,9 +26,11 @@ import { MenuItem } from 'twenty-ui/navigation'; import { themeCssVariables } from 'twenty-ui/theme-constants'; import { v4 } from 'uuid'; -const StyledPill = styled(Pill)` - background: ${themeCssVariables.color.blue3}; - color: ${themeCssVariables.color.blue}; +const StyledPillContainer = styled.span` + & > * { + background: ${themeCssVariables.color.blue3}; + color: ${themeCssVariables.color.blue}; + } `; export const ViewBarFilterDropdownAdvancedFilterButton = () => { @@ -134,7 +136,9 @@ export const ViewBarFilterDropdownAdvancedFilterButton = () => { focused={isSelectedItemId} /> {advancedFilterQuerySubFilterCount > 0 && ( - + + + )} ); diff --git a/packages/twenty-front/src/modules/views/view-picker/components/ViewPickerListContent.tsx b/packages/twenty-front/src/modules/views/view-picker/components/ViewPickerListContent.tsx index bb88f89df2..64d794d913 100644 --- a/packages/twenty-front/src/modules/views/view-picker/components/ViewPickerListContent.tsx +++ b/packages/twenty-front/src/modules/views/view-picker/components/ViewPickerListContent.tsx @@ -28,7 +28,7 @@ import { themeCssVariables } from 'twenty-ui/theme-constants'; import { ViewVisibility } from '~/generated-metadata/graphql'; import { moveArrayItem } from '~/utils/array/moveArrayItem'; -const StyledBoldDropdownMenuItemsContainer = styled(DropdownMenuItemsContainer)` +const StyledBoldDropdownMenuItemsContainerWrapper = styled.div` font-weight: ${themeCssVariables.font.weight.regular}; `; @@ -198,13 +198,15 @@ export const ViewPickerListContent = () => { > )} - - - + + + + + ); }; diff --git a/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-edges/components/WorkflowDiagramEdgeButtonGroup.tsx b/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-edges/components/WorkflowDiagramEdgeButtonGroup.tsx index 4e34b10b0d..8532f6dc01 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-edges/components/WorkflowDiagramEdgeButtonGroup.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-edges/components/WorkflowDiagramEdgeButtonGroup.tsx @@ -2,13 +2,14 @@ import { styled } from '@linaria/react'; import { IconButtonGroup, type IconButtonGroupProps } from 'twenty-ui/input'; import { themeCssVariables } from 'twenty-ui/theme-constants'; -const StyledIconButtonGroup = styled(IconButtonGroup)` +const StyledIconButtonGroupContainer = styled.div` pointer-events: all; `; -const StyledSelectedIconButtonGroup = styled(StyledIconButtonGroup)` +const StyledSelectedIconButtonGroupContainer = styled.div` background-color: ${themeCssVariables.color.blue2}; border-color: ${themeCssVariables.color.blue}; + pointer-events: all; `; type WorkflowDiagramEdgeButtonGroupProps = IconButtonGroupProps & { @@ -19,9 +20,13 @@ export const WorkflowDiagramEdgeButtonGroup = ({ selected = false, iconButtons, }: WorkflowDiagramEdgeButtonGroupProps) => { - const ButtonGroup = selected - ? StyledSelectedIconButtonGroup - : StyledIconButtonGroup; + const Container = selected + ? StyledSelectedIconButtonGroupContainer + : StyledIconButtonGroupContainer; - return ; + return ( + + + + ); }; diff --git a/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-nodes/components/WorkflowDiagramHandleSource.tsx b/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-nodes/components/WorkflowDiagramHandleSource.tsx index e9f0f58a19..6601c378de 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-nodes/components/WorkflowDiagramHandleSource.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-nodes/components/WorkflowDiagramHandleSource.tsx @@ -9,8 +9,8 @@ import { themeCssVariables } from 'twenty-ui/theme-constants'; const HANDLE_SCALE_ON_HOVER = 1.5; -const StyledHandle = styled(Handle)` - &.react-flow__handle { +const StyledHandleContainer = styled.div` + & .react-flow__handle { height: ${NODE_HANDLE_HEIGHT_PX}px; width: ${NODE_HANDLE_WIDTH_PX}px; opacity: var(--handle-opacity, 1); @@ -110,11 +110,8 @@ export const WorkflowDiagramHandleSource = ({ }, [position, selected, hovered, disableHoverEffect, runStatus, type]); return ( - + + + ); }; diff --git a/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-nodes/components/WorkflowDiagramHandleTarget.tsx b/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-nodes/components/WorkflowDiagramHandleTarget.tsx index d939f08dff..623aac170b 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-nodes/components/WorkflowDiagramHandleTarget.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-nodes/components/WorkflowDiagramHandleTarget.tsx @@ -7,8 +7,8 @@ type WorkflowDiagramHandleTargetProps = { isConnectable?: boolean; }; -const StyledHandle = styled(Handle)` - &.react-flow__handle { +const StyledHandleContainer = styled.div` + & .react-flow__handle { opacity: 0; z-index: 1; border-radius: ${themeCssVariables.border.radius.md}; @@ -28,12 +28,14 @@ export const WorkflowDiagramHandleTarget = ({ isConnectable = false, }: WorkflowDiagramHandleTargetProps) => { return ( - + + + ); }; diff --git a/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-nodes/components/WorkflowRunDiagramStepNode.tsx b/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-nodes/components/WorkflowRunDiagramStepNode.tsx index 11b2bdd322..2384ac53e7 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-nodes/components/WorkflowRunDiagramStepNode.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-nodes/components/WorkflowRunDiagramStepNode.tsx @@ -18,7 +18,6 @@ import { WorkflowDiagramStepNodeIcon } from '@/workflow/workflow-diagram/workflo import { WorkflowNodeContainer } from '@/workflow/workflow-diagram/workflow-nodes/components/WorkflowNodeContainer'; import { WorkflowNodeIconContainer } from '@/workflow/workflow-diagram/workflow-nodes/components/WorkflowNodeIconContainer'; import { WorkflowNodeLabel } from '@/workflow/workflow-diagram/workflow-nodes/components/WorkflowNodeLabel'; -import { WorkflowNodeLabelWithCounterPart } from '@/workflow/workflow-diagram/workflow-nodes/components/WorkflowNodeLabelWithCounterPart'; import { WorkflowNodeRightPart } from '@/workflow/workflow-diagram/workflow-nodes/components/WorkflowNodeRightPart'; import { WorkflowNodeTitle } from '@/workflow/workflow-diagram/workflow-nodes/components/WorkflowNodeTitle'; import { WORKFLOW_DIAGRAM_NODE_DEFAULT_SOURCE_HANDLE_ID } from '@/workflow/workflow-diagram/workflow-nodes/constants/WorkflowDiagramNodeDefaultSourceHandleId'; @@ -33,7 +32,13 @@ import { IconCheck, IconX, useIcons } from 'twenty-ui/display'; import { Loader } from 'twenty-ui/feedback'; import { themeCssVariables } from 'twenty-ui/theme-constants'; -const StyledNodeLabelWithCounterPart = styled(WorkflowNodeLabelWithCounterPart)` +const StyledNodeLabelWithCounterPart = styled.div` + align-items: center; + align-self: stretch; + display: flex; + height: 14px; + justify-content: space-between; + box-sizing: border-box; column-gap: ${themeCssVariables.spacing[2]}; `; diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterAddRootStepFilterButton.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterAddRootStepFilterButton.tsx index 84f56b9e1f..9d348ba306 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterAddRootStepFilterButton.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterAddRootStepFilterButton.tsx @@ -7,7 +7,7 @@ import { IconFilter } from 'twenty-ui/display'; import { Button } from 'twenty-ui/input'; import { themeCssVariables } from 'twenty-ui/theme-constants'; -const StyledButton = styled(Button)` +const StyledButtonContainer = styled.div` margin-top: ${themeCssVariables.spacing[2]}; `; @@ -17,15 +17,17 @@ export const WorkflowStepFilterAddRootStepFilterButton = () => { const { addRootStepFilter } = useAddRootStepFilter(); return ( - + + + ); }; diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionsStyles.ts b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionsStyles.tsx similarity index 76% rename from packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionsStyles.ts rename to packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionsStyles.tsx index 8653bb73cd..fd57e083b3 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionsStyles.ts +++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionsStyles.tsx @@ -1,4 +1,5 @@ import { styled } from '@linaria/react'; +import React from 'react'; import { IconChevronRight, Label } from 'twenty-ui/display'; import { themeCssVariables } from 'twenty-ui/theme-constants'; @@ -6,11 +7,17 @@ export const StyledText = styled.div` color: ${themeCssVariables.font.color.secondary}; `; -export const StyledLabel = styled(Label)` +const StyledLabelWrapper = styled.div` margin: ${themeCssVariables.spacing[3]} ${themeCssVariables.spacing[3]} ${themeCssVariables.spacing[0]}; `; +export const StyledLabel = ({ children }: { children: React.ReactNode }) => ( + + {children} + +); + export const StyledRow = styled.div<{ isDisabled?: boolean }>` align-items: center; display: flex; @@ -61,6 +68,18 @@ export const StyledIconContainer = styled.div` color: ${themeCssVariables.font.color.tertiary}; `; -export const StyledIconChevronRight = styled(IconChevronRight)` +const StyledIconChevronRightWrapper = styled.div` + align-items: center; color: ${themeCssVariables.font.color.tertiary}; + display: inline-flex; `; + +export const StyledIconChevronRight = ({ + size, + color, + stroke, +}: React.ComponentProps) => ( + + + +); diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionsTab.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionsTab.tsx index f700c525e9..7722d3b971 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionsTab.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionsTab.tsx @@ -26,11 +26,11 @@ import { WorkflowAiAgentPermissionsFlagList } from './WorkflowAiAgentPermissions import { WorkflowAiAgentPermissionsObjectsList } from './WorkflowAiAgentPermissionsObjectsList'; import { getFilteredPermissions } from './workflowAiAgentPermissions.utils'; import { themeCssVariables } from 'twenty-ui/theme-constants'; -const StyledSearchInput = styled(TextInput)` +const StyledSearchInputContainer = styled.div` width: 100%; height: 40px; border-block: 1px solid ${themeCssVariables.border.color.medium}; - input { + & input { height: 40px; line-height: 40px; border: none; @@ -198,16 +198,18 @@ export const WorkflowAiAgentPermissionsTab = ({ )} - setSearchQuery(value)} - placeholder={t`Type anything...`} - onKeyDown={(event) => { - if (isNonTextWritingKey(event.key)) { - event.stopPropagation(); - } - }} - /> + + setSearchQuery(value)} + placeholder={t`Type anything...`} + onKeyDown={(event) => { + if (isNonTextWritingKey(event.key)) { + event.stopPropagation(); + } + }} + /> + {shouldShowCrudList && ( ) : ( <> - + + + {currentTabId === WORKFLOW_AI_AGENT_TABS.PERMISSIONS ? ( - + + + {activeTabId === WorkflowLogicFunctionTabId.CODE && ( <> diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowEditActionFormBuilder.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowEditActionFormBuilder.tsx index c2f2d29740..a3856ac9e6 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowEditActionFormBuilder.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowEditActionFormBuilder.tsx @@ -139,8 +139,11 @@ const StyledCalloutContainer = styled.div` padding-top: ${themeCssVariables.spacing[2]}; `; -const StyledNotClosableCalloutContainer = styled(StyledCalloutContainer)` +const StyledNotClosableCalloutContainer = styled.div` padding-bottom: ${themeCssVariables.spacing[4]}; + padding-left: ${themeCssVariables.spacing[7]}; + padding-right: ${themeCssVariables.spacing[7]}; + padding-top: ${themeCssVariables.spacing[2]}; `; export const WorkflowEditActionFormBuilder = ({ diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/http-request-action/components/BodyInput.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/http-request-action/components/BodyInput.tsx index 437037fec5..d2dcf78a66 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/http-request-action/components/BodyInput.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/http-request-action/components/BodyInput.tsx @@ -32,7 +32,7 @@ const StyledContainer = styled.div` gap: ${themeCssVariables.spacing[2]}; `; -const StyledSelectDropdown = styled(Select)` +const StyledSelectDropdownContainer = styled.div` margin-bottom: ${themeCssVariables.spacing[2]}; `; const StyledNoBodyMessage = styled.div` @@ -163,23 +163,25 @@ export const BodyInput = ({ return ( {t`Body Input`} - handleModeChange(value as BodyType)} - disabled={readonly} - /> + + handleModeChange(value as BodyType)} + disabled={readonly} + /> + {isBodyTypeRawJson ? ( diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/http-request-action/components/WorkflowEditActionHttpRequest.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/http-request-action/components/WorkflowEditActionHttpRequest.tsx index 08e14d8343..b7876757ca 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/http-request-action/components/WorkflowEditActionHttpRequest.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/http-request-action/components/WorkflowEditActionHttpRequest.tsx @@ -39,7 +39,7 @@ type WorkflowEditActionHttpRequestProps = { }; }; -const StyledTabList = styled(TabList)` +const StyledTabListContainer = styled.div` background-color: ${themeCssVariables.background.secondary}; padding-left: ${themeCssVariables.spacing[2]}; `; @@ -61,7 +61,7 @@ const StyledConfigurationTabContent = styled.div` flex: 1; `; -const StyledFullHeightFormRawJsonFieldInput = styled(FormRawJsonFieldInput)` +const StyledFullHeightFormRawJsonFieldInputContainer = styled.div` flex: 1; display: flex; flex-direction: column; @@ -128,11 +128,13 @@ export const WorkflowEditActionHttpRequest = ({ return ( <> - + + + {activeTabId === WorkflowHttpRequestTabId.CONFIGURATION && ( @@ -178,14 +180,16 @@ export const WorkflowEditActionHttpRequest = ({ /> )} - + + + )} {activeTabId === WorkflowHttpRequestTabId.TEST && ( diff --git a/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdown.tsx b/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdown.tsx index 084f113649..2a49bd80f4 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdown.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdown.tsx @@ -1,5 +1,4 @@ import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown'; -import { StyledDropdownButtonContainer } from '@/ui/layout/dropdown/components/StyledDropdownButtonContainer'; import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown'; import { isDropdownOpenComponentState } from '@/ui/layout/dropdown/states/isDropdownOpenComponentState'; import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue'; @@ -15,17 +14,29 @@ import { useContext, useState } from 'react'; import { isDefined } from 'twenty-shared/utils'; import { IconVariablePlus } from 'twenty-ui/display'; import { themeCssVariables, ThemeContext } from 'twenty-ui/theme-constants'; -const StyledDropdownVariableButtonContainer = styled( - StyledDropdownButtonContainer, -)<{ transparentBackground?: boolean; disabled?: boolean }>` +const StyledDropdownVariableButtonContainer = styled.div<{ + isUnfolded?: boolean; + transparentBackground?: boolean; + disabled?: boolean; +}>` + align-items: center; background-color: ${({ transparentBackground }) => transparentBackground ? 'transparent' : themeCssVariables.background.transparent.lighter}; - + border-radius: ${themeCssVariables.border.radius.sm}; color: ${themeCssVariables.font.color.tertiary}; + cursor: pointer; + display: flex; padding: ${themeCssVariables.spacing[2]}; - :hover { + user-select: none; + &:hover { + background: ${({ isUnfolded, transparentBackground }) => + transparentBackground + ? 'transparent' + : isUnfolded + ? themeCssVariables.background.transparent.medium + : themeCssVariables.background.transparent.light}; cursor: ${({ disabled }) => (disabled ? 'not-allowed' : 'pointer')}; } `; diff --git a/packages/twenty-front/src/pages/auth/PasswordReset.tsx b/packages/twenty-front/src/pages/auth/PasswordReset.tsx index 773d584672..6ff87c9056 100644 --- a/packages/twenty-front/src/pages/auth/PasswordReset.tsx +++ b/packages/twenty-front/src/pages/auth/PasswordReset.tsx @@ -73,7 +73,7 @@ const StyledForm = styled.form` width: 100%; `; -const StyledFullWidthMotionDiv = styled(motion.div)` +const StyledFullWidthContainer = styled.div` width: 100%; `; @@ -81,7 +81,7 @@ const StyledInputContainer = styled.div` margin-bottom: ${themeCssVariables.spacing[3]}; `; -const StyledMainButton = styled(MainButton)` +const StyledMainButtonContainer = styled.div` margin-top: ${themeCssVariables.spacing[2]}; `; @@ -234,64 +234,70 @@ export const PasswordReset = () => { ) : ( - - - + + + + + + + + + ( + + + + )} /> - - - - ( - - - - )} - /> - + + - + + + )} diff --git a/packages/twenty-front/src/pages/onboarding/BookCallDecision.tsx b/packages/twenty-front/src/pages/onboarding/BookCallDecision.tsx index 9d7e17c2d8..fe4ee4095e 100644 --- a/packages/twenty-front/src/pages/onboarding/BookCallDecision.tsx +++ b/packages/twenty-front/src/pages/onboarding/BookCallDecision.tsx @@ -32,8 +32,10 @@ const StyledButtonContainer = styled.div` width: 100%; `; -const StyledLink = styled(Link)` - text-decoration: none; +const StyledLinkContainer = styled.div` + > a { + text-decoration: none; + } `; export const BookCallDecision = () => { @@ -61,9 +63,11 @@ export const BookCallDecision = () => { - - - + + + + + diff --git a/packages/twenty-front/src/pages/onboarding/CreateWorkspace.tsx b/packages/twenty-front/src/pages/onboarding/CreateWorkspace.tsx index df5c47465a..3ac470db81 100644 --- a/packages/twenty-front/src/pages/onboarding/CreateWorkspace.tsx +++ b/packages/twenty-front/src/pages/onboarding/CreateWorkspace.tsx @@ -19,7 +19,6 @@ import { useLoadCurrentUser } from '@/users/hooks/useLoadCurrentUser'; import { ApolloError } from '@apollo/client'; import { Trans, useLingui } from '@lingui/react/macro'; import { isNonEmptyString } from '@sniptt/guards'; -import { motion } from 'framer-motion'; import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue'; import { isDefined } from 'twenty-shared/utils'; import { H2Title } from 'twenty-ui/display'; @@ -57,7 +56,7 @@ enum PendingCreationLoaderStep { Step3 = 'step-3', } -const StyledPendingCreationLoader = styled(motion.div)` +const StyledPendingCreationLoader = styled.div` width: 100%; display: flex; justify-content: center; diff --git a/packages/twenty-front/src/pages/settings/SettingsTwoFactorAuthenticationMethod.tsx b/packages/twenty-front/src/pages/settings/SettingsTwoFactorAuthenticationMethod.tsx index 63f9ca060b..dc3add7c64 100644 --- a/packages/twenty-front/src/pages/settings/SettingsTwoFactorAuthenticationMethod.tsx +++ b/packages/twenty-front/src/pages/settings/SettingsTwoFactorAuthenticationMethod.tsx @@ -44,7 +44,7 @@ const StyledOTPContainer = styled.div` width: fit-content; `; -const StyledQRCode = styled(QRCode)` +const StyledQRCodeSizer = styled.div` height: 137px; width: 137px; `; @@ -152,7 +152,9 @@ export const SettingsTwoFactorAuthenticationMethod = () => { ) : ( <> - + + + Can't scan? Copy the{' '} diff --git a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminConfigVariableDetails.tsx b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminConfigVariableDetails.tsx index af037b5768..eb36bf028b 100644 --- a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminConfigVariableDetails.tsx +++ b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminConfigVariableDetails.tsx @@ -24,14 +24,16 @@ import { useGetDatabaseConfigVariableQuery, } from '~/generated-metadata/graphql'; -const StyledForm = styled(Form)` - display: flex; - flex-direction: column; - gap: ${themeCssVariables.spacing[4]}; - width: 100%; +const StyledFormContainer = styled.div` + > form { + display: flex; + flex-direction: column; + gap: ${themeCssVariables.spacing[4]}; + width: 100%; + } `; -const StyledH3Title = styled(H3Title)` +const StyledH3TitleContainer = styled.div` margin-top: ${themeCssVariables.spacing[2]}; `; @@ -143,54 +145,57 @@ export const SettingsAdminConfigVariableDetails = () => { ]} > - + + + - - - setValue('value', value)} - disabled={isEnvOnly || !isEditing} - /> - - {!isEditing ? ( - + + + setValue('value', value)} + disabled={isEnvOnly || !isEditing} /> - ) : ( - - - - - )} - - - + {!isEditing ? ( + + ) : ( + + + + + )} + + + + + diff --git a/packages/twenty-front/src/pages/settings/ai/SettingsAI.tsx b/packages/twenty-front/src/pages/settings/ai/SettingsAI.tsx index 216d9455bf..80aa6199e5 100644 --- a/packages/twenty-front/src/pages/settings/ai/SettingsAI.tsx +++ b/packages/twenty-front/src/pages/settings/ai/SettingsAI.tsx @@ -27,8 +27,10 @@ import { SettingsSkillsTable } from './components/SettingsSkillsTable'; import { SettingsToolsTable } from './components/SettingsToolsTable'; import { SETTINGS_AI_TABS } from './constants/SettingsAiTabs'; -const StyledLink = styled(Link)` - text-decoration: none; +const StyledLinkContainer = styled.div` + > a { + text-decoration: none; + } `; export const SettingsAI = () => { @@ -97,13 +99,15 @@ export const SettingsAI = () => { title={t`System Prompt`} description={t`View the AI system prompt and add custom instructions`} Button={ - - - + + + + + } /> diff --git a/packages/twenty-front/src/pages/settings/ai/SettingsAgentForm.tsx b/packages/twenty-front/src/pages/settings/ai/SettingsAgentForm.tsx index 61a4b124da..bc29871c5c 100644 --- a/packages/twenty-front/src/pages/settings/ai/SettingsAgentForm.tsx +++ b/packages/twenty-front/src/pages/settings/ai/SettingsAgentForm.tsx @@ -54,7 +54,7 @@ const StyledContentContainer = styled.div` width: 100%; `; -const StyledTabList = styled(TabList)` +const StyledTabListContainer = styled.div` margin-bottom: ${themeCssVariables.spacing[8]}; `; @@ -417,11 +417,13 @@ export const SettingsAgentForm = ({ mode }: { mode: 'create' | 'edit' }) => { ) : ( <> - + + + {isRoleTab && ( { {turn.evaluations && turn.evaluations.length > 0 ? ( - - - {t`Date`} - {t`Score`} - {t`Comment`} - - {[...turn.evaluations] - .sort( - (a: any, b: any) => - new Date(b.createdAt).getTime() - - new Date(a.createdAt).getTime(), - ) - .map((evaluation: any) => ( - - - {new Date(evaluation.createdAt).toLocaleDateString( - 'en-US', - { - month: 'short', - day: 'numeric', - hour: '2-digit', - minute: '2-digit', - }, - )} - - - - - - {evaluation.comment || t`No comment`} - - - ))} - + + + + + {t`Date`} + {t`Score`} + {t`Comment`} + + + {[...turn.evaluations] + .sort( + (a: any, b: any) => + new Date(b.createdAt).getTime() - + new Date(a.createdAt).getTime(), + ) + .map((evaluation: any) => ( + + + {new Date(evaluation.createdAt).toLocaleDateString( + 'en-US', + { + month: 'short', + day: 'numeric', + hour: '2-digit', + minute: '2-digit', + }, + )} + + + + + + {evaluation.comment || t`No comment`} + + + ))} + + ) : ( {t`No evaluations yet for this turn`} )} diff --git a/packages/twenty-front/src/pages/settings/ai/components/SettingsAIAgentTableRow.tsx b/packages/twenty-front/src/pages/settings/ai/components/SettingsAIAgentTableRow.tsx index 907f117e7e..35bbdce83d 100644 --- a/packages/twenty-front/src/pages/settings/ai/components/SettingsAIAgentTableRow.tsx +++ b/packages/twenty-front/src/pages/settings/ai/components/SettingsAIAgentTableRow.tsx @@ -14,21 +14,7 @@ export type SettingsAIAgentTableRowProps = { link?: string; }; -export const StyledAIAgentTableRow = styled(TableRow)` - grid-template-columns: 1fr 120px 36px; -`; - -const StyledNameTableCell = styled(TableCell)` - color: ${themeCssVariables.font.color.primary}; - gap: ${themeCssVariables.spacing[2]}; - min-width: 0; - overflow: hidden; -`; - -const StyledActionTableCell = styled(TableCell)` - justify-content: flex-end; - padding-right: ${themeCssVariables.spacing[2]}; -`; +export const AI_AGENT_TABLE_ROW_GRID_TEMPLATE_COLUMNS = '1fr 120px 36px'; const StyledIconContainer = styled.div` flex-shrink: 0; @@ -45,17 +31,31 @@ export const SettingsAIAgentTableRow = ({ const Icon = getIcon(agent.icon || 'IconRobot'); return ( - - + + - + - {action} - + + {action} + + ); }; diff --git a/packages/twenty-front/src/pages/settings/ai/components/SettingsAIAgentsTable.tsx b/packages/twenty-front/src/pages/settings/ai/components/SettingsAIAgentsTable.tsx index afb256535a..07e6deeeab 100644 --- a/packages/twenty-front/src/pages/settings/ai/components/SettingsAIAgentsTable.tsx +++ b/packages/twenty-front/src/pages/settings/ai/components/SettingsAIAgentsTable.tsx @@ -26,9 +26,10 @@ import { normalizeSearchText } from '~/utils/normalizeSearchText'; import Skeleton from 'react-loading-skeleton'; import { useFindManyAgentsQuery } from '~/generated-metadata/graphql'; +import { TableRow } from '@/ui/layout/table/components/TableRow'; import { + AI_AGENT_TABLE_ROW_GRID_TEMPLATE_COLUMNS, SettingsAIAgentTableRow, - StyledAIAgentTableRow, } from './SettingsAIAgentTableRow'; const StyledSearchAndFilterContainer = styled.div` @@ -38,15 +39,15 @@ const StyledSearchAndFilterContainer = styled.div` width: 100%; `; -const StyledSearchInput = styled(SettingsTextInput)` +const StyledSearchInputContainer = styled.div` flex: 1; `; -const StyledTable = styled(Table)` +const StyledTableContainer = styled.div` margin-top: ${themeCssVariables.spacing[3]}; `; -const StyledTableHeaderRow = styled(StyledAIAgentTableRow)` +const StyledTableHeaderRowContainer = styled.div` margin-bottom: ${themeCssVariables.spacing[2]}; `; @@ -78,13 +79,15 @@ export const SettingsAIAgentsTable = () => { return ( <> - + + + { /> - - - {SETTINGS_AI_AGENT_TABLE_METADATA.fields.map( - (settingsAIAgentTableMetadataField) => ( - - ), - )} - - - {loading && - Array.from({ length: 3 }).map((_, index) => ( - + + + + + {SETTINGS_AI_AGENT_TABLE_METADATA.fields.map( + (settingsAIAgentTableMetadataField) => ( + + ), + )} + + + + {loading && + Array.from({ length: 3 }).map((_, index) => ( + + ))} + {filteredAgents.map((agent) => ( + + } + link={getSettingsPath(SettingsPath.AIAgentDetail, { + agentId: agent.id, + })} + /> ))} - {filteredAgents.map((agent) => ( - - } - link={getSettingsPath(SettingsPath.AIAgentDetail, { - agentId: agent.id, - })} - /> - ))} - + + > ); }; diff --git a/packages/twenty-front/src/pages/settings/ai/components/SettingsAgentLogsTab.tsx b/packages/twenty-front/src/pages/settings/ai/components/SettingsAgentLogsTab.tsx index 78b76875fe..b0ce089115 100644 --- a/packages/twenty-front/src/pages/settings/ai/components/SettingsAgentLogsTab.tsx +++ b/packages/twenty-front/src/pages/settings/ai/components/SettingsAgentLogsTab.tsx @@ -25,39 +25,14 @@ import { useGetAgentTurnsQuery, } from '~/generated-metadata/graphql'; -const StyledTable = styled(Table)` +const StyledTableContainer = styled.div` margin-top: ${themeCssVariables.spacing[3]}; `; -const StyledTableHeaderRow = styled(TableRow)` - grid-template-columns: 140px 80px 1fr 40px; +const StyledTableHeaderRowContainer = styled.div` margin-bottom: ${themeCssVariables.spacing[2]}; `; -const StyledTableRow = styled(TableRow)` - grid-template-columns: 140px 80px 1fr 40px; -`; - -const StyledScoreCell = styled(TableCell)` - align-items: center; - gap: ${themeCssVariables.spacing[2]}; -`; - -const StyledDateCell = styled(TableCell)` - color: ${themeCssVariables.font.color.tertiary}; -`; - -const StyledInputCell = styled(TableCell)` - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -`; - -const StyledActionCell = styled(TableCell)` - justify-content: flex-end; - padding-right: ${themeCssVariables.spacing[2]}; -`; - type SettingsAgentLogsTabProps = { agentId: string; }; @@ -164,17 +139,21 @@ export const SettingsAgentLogsTab = ({ if (loading) { return ( - - - {t`Date`} - {t`Score`} - {t`Input`} - - - {Array.from({ length: 3 }).map((_, index) => ( - - ))} - + + + + + {t`Date`} + {t`Score`} + {t`Input`} + + + + {Array.from({ length: 3 }).map((_, index) => ( + + ))} + + ); } @@ -195,65 +174,78 @@ export const SettingsAgentLogsTab = ({ } return ( - - - {t`Date`} - {t`Score`} - {t`Input`} - - - {turns.map((turn: any) => { - const latestEvaluation = getLatestEvaluation(turn.evaluations); - const userInput = getUserMessageInput(turn.messages); + + + + + {t`Date`} + {t`Score`} + {t`Input`} + + + + {turns.map((turn: any) => { + const latestEvaluation = getLatestEvaluation(turn.evaluations); + const userInput = getUserMessageInput(turn.messages); - return ( - - - {new Date(turn.createdAt).toLocaleDateString('en-US', { - month: 'short', - day: 'numeric', - hour: '2-digit', - minute: '2-digit', - })} - - - {latestEvaluation ? ( - - ) : evaluatingTurnIds.has(turn.id) || - backgroundEvaluatingTurnIds.has(turn.id) ? ( - - ) : ( - handleEvaluateTurn(turn.id)} - disabled={evaluating} - title={t`Evaluate`} - /> - )} - - {userInput || t`No input`} - - {latestEvaluation && ( - - + + {new Date(turn.createdAt).toLocaleDateString('en-US', { + month: 'short', + day: 'numeric', + hour: '2-digit', + minute: '2-digit', + })} + + + {latestEvaluation ? ( + - - )} - - - ); - })} - + ) : evaluatingTurnIds.has(turn.id) || + backgroundEvaluatingTurnIds.has(turn.id) ? ( + + ) : ( + handleEvaluateTurn(turn.id)} + disabled={evaluating} + title={t`Evaluate`} + /> + )} + + + {userInput || t`No input`} + + + {latestEvaluation && ( + + + + )} + + + ); + })} + + ); }; diff --git a/packages/twenty-front/src/pages/settings/ai/components/SettingsSystemToolTableRow.tsx b/packages/twenty-front/src/pages/settings/ai/components/SettingsSystemToolTableRow.tsx index db23666a39..e95d7f6c9c 100644 --- a/packages/twenty-front/src/pages/settings/ai/components/SettingsSystemToolTableRow.tsx +++ b/packages/twenty-front/src/pages/settings/ai/components/SettingsSystemToolTableRow.tsx @@ -41,21 +41,25 @@ export type SettingsSystemToolTableRowProps = { tool: SystemTool; }; -export const StyledSystemToolTableRow = styled(TableRow)` - grid-template-columns: 1fr 100px 36px; - opacity: 0.7; +const StyledSystemToolTableRowContainer = styled.div` + > div, + > a { + opacity: 0.7; - &[data-clickable='true']:hover { - opacity: 0.85; + &[data-clickable='true']:hover { + opacity: 0.85; + } } `; -const StyledNameTableCell = styled(TableCell)` - color: ${themeCssVariables.font.color.primary}; - gap: ${themeCssVariables.spacing[2]}; - min-width: 0; - overflow: hidden; -`; +export const StyledSystemToolTableRow = ( + props: React.ComponentProps, +) => ( + + {/* eslint-disable-next-line react/jsx-props-no-spreading */} + + +); const StyledIconContainer = styled.div` align-items: center; @@ -63,11 +67,6 @@ const StyledIconContainer = styled.div` flex-shrink: 0; `; -const StyledActionTableCell = styled(TableCell)` - justify-content: flex-end; - padding-right: ${themeCssVariables.spacing[2]}; -`; - const StyledExpandableContent = styled.div` background-color: ${themeCssVariables.background.secondary}; border-top: 1px solid ${themeCssVariables.border.color.light}; @@ -134,22 +133,30 @@ export const SettingsSystemToolTableRow = ({ onClick={handleRowClick} isClickable > - + - + - + {isExpanded ? ( ) : ( )} - + diff --git a/packages/twenty-front/src/pages/settings/ai/components/SettingsToolTableRow.tsx b/packages/twenty-front/src/pages/settings/ai/components/SettingsToolTableRow.tsx index 9e03ae886d..9b82149e22 100644 --- a/packages/twenty-front/src/pages/settings/ai/components/SettingsToolTableRow.tsx +++ b/packages/twenty-front/src/pages/settings/ai/components/SettingsToolTableRow.tsx @@ -19,16 +19,7 @@ export type SettingsToolTableRowProps = { link?: string; }; -export const StyledToolTableRow = styled(TableRow)` - grid-template-columns: 1fr 100px 36px; -`; - -const StyledNameTableCell = styled(TableCell)` - color: ${themeCssVariables.font.color.primary}; - gap: ${themeCssVariables.spacing[2]}; - min-width: 0; - overflow: hidden; -`; +export const TOOL_TABLE_ROW_GRID_TEMPLATE_COLUMNS = '1fr 100px 36px'; const StyledIconContainer = styled.div` align-items: center; @@ -36,30 +27,38 @@ const StyledIconContainer = styled.div` flex-shrink: 0; `; -const StyledActionTableCell = styled(TableCell)` - justify-content: flex-end; - padding-right: ${themeCssVariables.spacing[2]}; -`; - export const SettingsToolTableRow = ({ tool, action, link, }: SettingsToolTableRowProps) => { return ( - - + + - + - {action} - + + {action} + + ); }; diff --git a/packages/twenty-front/src/pages/settings/ai/components/SettingsToolsTable.tsx b/packages/twenty-front/src/pages/settings/ai/components/SettingsToolsTable.tsx index 5214c5e6d1..6467a5e5fb 100644 --- a/packages/twenty-front/src/pages/settings/ai/components/SettingsToolsTable.tsx +++ b/packages/twenty-front/src/pages/settings/ai/components/SettingsToolsTable.tsx @@ -26,9 +26,10 @@ import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants'; import { normalizeSearchText } from '~/utils/normalizeSearchText'; import { SettingsSystemToolTableRow } from './SettingsSystemToolTableRow'; +import { TableRow } from '@/ui/layout/table/components/TableRow'; import { + TOOL_TABLE_ROW_GRID_TEMPLATE_COLUMNS, SettingsToolTableRow, - StyledToolTableRow, } from './SettingsToolTableRow'; const StyledSearchAndFilterContainer = styled.div` @@ -38,12 +39,12 @@ const StyledSearchAndFilterContainer = styled.div` padding-bottom: ${themeCssVariables.spacing[2]}; `; -const StyledSearchInput = styled(SettingsTextInput)` +const StyledSearchInputContainer = styled.div` flex: 1; width: 100%; `; -const StyledTableHeaderRow = styled(StyledToolTableRow)` +const StyledTableHeaderRowContainer = styled.div` margin-bottom: ${themeCssVariables.spacing[2]}; `; @@ -171,20 +172,26 @@ export const SettingsToolsTable = () => { description={t`Custom tools created in your workspace`} /> - + + + - - {t`Name`} - {t`Type`} - - + + + {t`Name`} + {t`Type`} + + + {showSkeleton ? Array.from({ length: 3 }).map((_, index) => ( @@ -222,20 +229,26 @@ export const SettingsToolsTable = () => { description={t`Standard tools available to AI agents`} /> - + + + - - {t`Name`} - {t`Type`} - - + + + {t`Name`} + {t`Type`} + + + {filteredSystemTools.map((systemTool) => ( ( ); -export const StyledAppModalButton = styled(Button)` +const StyledAppModalButtonContainer = styled.div` box-sizing: border-box; + display: flex; justify-content: center; margin-top: ${themeCssVariables.spacing[2]}; `; +export const StyledAppModalButton = ( + props: React.ComponentProps, +) => ( + + {/* eslint-disable-next-line react/jsx-props-no-spreading */} + + +); + export const StyledAppModalTitle = styled.div` text-align: center; `; -export const StyledAppModalSection = styled(Section)` +const StyledAppModalSectionContainer = styled.div` margin-bottom: ${themeCssVariables.spacing[6]}; `; + +export const StyledAppModalSection = ({ + children, + ...props +}: React.ComponentProps) => ( + + {/* eslint-disable-next-line react/jsx-props-no-spreading */} + {children} + +); diff --git a/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationDataTable.tsx b/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationDataTable.tsx index a46c7247e1..9d5ded2950 100644 --- a/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationDataTable.tsx +++ b/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationDataTable.tsx @@ -36,8 +36,10 @@ export type ApplicationDataTableRow = { const MAIN_ROW_GRID_COLUMNS = `180px 1fr ${SETTINGS_OBJECT_TABLE_COLUMN_WIDTH} 36px`; -const StyledEmptyHeader = styled(TableHeader)` - min-width: 0; +const StyledEmptyHeaderContainer = styled.div` + > div { + min-width: 0; + } `; const StyledSearchInputContainer = styled.div` @@ -129,7 +131,9 @@ export const SettingsApplicationDataTable = ({ {t`Name`} {t`App`} {t`Fields`} - + + + {shouldDisplayObjects && ( diff --git a/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationDataTableRow.tsx b/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationDataTableRow.tsx index 26b5929fa6..136172a285 100644 --- a/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationDataTableRow.tsx +++ b/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationDataTableRow.tsx @@ -11,9 +11,9 @@ import { TableRow } from '@/ui/layout/table/components/TableRow'; import { TableSubRow } from '@/ui/layout/table/components/TableSubRow'; import { styled } from '@linaria/react'; import { t } from '@lingui/core/macro'; +import { useContext } from 'react'; import { isDefined } from 'twenty-shared/utils'; import { IconChevronDown, IconChevronRight, useIcons } from 'twenty-ui/display'; -import { useContext } from 'react'; import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants'; import { type ApplicationDataTableRow } from '~/pages/settings/applications/components/SettingsApplicationDataTable'; @@ -25,10 +25,6 @@ const StyledFieldDivider = styled.div` border-top: 1px solid ${themeCssVariables.border.color.light}; `; -const StyledFieldNameTableCell = styled(StyledNameTableCell)` - color: ${themeCssVariables.font.color.secondary}; -`; - export const SettingsApplicationDataTableRow = ({ row, isExpanded, @@ -96,7 +92,10 @@ export const SettingsApplicationDataTableRow = ({ key={field.key} gridAutoColumns={FIELD_SUB_ROW_GRID_COLUMNS} > - + {isDefined(FieldIcon) && ( )} {field.label} - + {items.map((item) => ( - {item.name} + + {item.name} + {item.description ?? ''} ))} diff --git a/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationTableRow.tsx b/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationTableRow.tsx index 129de46833..fd297e8cbb 100644 --- a/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationTableRow.tsx +++ b/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationTableRow.tsx @@ -1,4 +1,3 @@ -import { styled } from '@linaria/react'; import { type ReactNode } from 'react'; import { t } from '@lingui/core/macro'; @@ -16,28 +15,8 @@ export type SettingsApplicationTableRowProps = { link?: string; }; -export const StyledApplicationTableRow = styled(TableRow)` - grid-template-columns: 164px minmax(0, 1fr) 36px; -`; - -const StyledNameTableCell = styled(TableCell)` - color: ${themeCssVariables.font.color.secondary}; - gap: ${themeCssVariables.spacing[2]}; - min-width: 0; - overflow: hidden; -`; - -const StyledActionTableCell = styled(TableCell)` - justify-content: flex-end; - padding-right: ${themeCssVariables.spacing[2]}; -`; - -const StyledDescriptionCell = styled(TableCell)` - display: flex; - align-items: center; - gap: ${themeCssVariables.spacing[2]}; - min-width: 0; -`; +export const APPLICATION_TABLE_ROW_GRID_TEMPLATE_COLUMNS = + '164px minmax(0, 1fr) 36px'; export const SettingsApplicationTableRow = ({ action, @@ -46,17 +25,31 @@ export const SettingsApplicationTableRow = ({ link, }: SettingsApplicationTableRowProps) => { return ( - - + + - - + + {hasUpdate === true && ( )} - - {action} - + + + {action} + + ); }; diff --git a/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationsTable.tsx b/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationsTable.tsx index 7669a2b3ef..a1356838ca 100644 --- a/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationsTable.tsx +++ b/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationsTable.tsx @@ -1,13 +1,14 @@ import { H2Title, IconChevronRight, IconSearch } from 'twenty-ui/display'; import { TableHeader } from '@/ui/layout/table/components/TableHeader'; +import { TableRow } from '@/ui/layout/table/components/TableRow'; import { getSettingsPath, isDefined } from 'twenty-shared/utils'; import { SettingsPath } from 'twenty-shared/types'; import { useLingui } from '@lingui/react/macro'; import { Table } from '@/ui/layout/table/components/Table'; import { styled } from '@linaria/react'; import { + APPLICATION_TABLE_ROW_GRID_TEMPLATE_COLUMNS, SettingsApplicationTableRow, - StyledApplicationTableRow, } from '~/pages/settings/applications/components/SettingsApplicationTableRow'; import { useContext, useMemo, useState } from 'react'; import { type ApplicationWithoutRelation } from '~/pages/settings/applications/types/applicationWithoutRelation'; @@ -17,15 +18,15 @@ import { SettingsTextInput } from '@/ui/input/components/SettingsTextInput'; import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants'; import { AppRegistrationSourceType } from '~/generated-metadata/graphql'; -const StyledTable = styled(Table)` +const StyledTableContainer = styled.div` margin-top: ${themeCssVariables.spacing[3]}; `; -const StyledTableHeaderRow = styled(StyledApplicationTableRow)` +const StyledTableHeaderRowContainer = styled.div` margin-bottom: ${themeCssVariables.spacing[2]}; `; -const StyledSearchInput = styled(SettingsTextInput)` +const StyledSearchInputContainer = styled.div` padding-bottom: ${themeCssVariables.spacing[2]}; width: 100%; `; @@ -56,52 +57,60 @@ export const SettingsApplicationsTable = ({ title={t`Installed applications`} description={t`List installed applications. Use filter to search for a specific application`} /> - - - - {t`Name`} - {t`Description`} - {''} - - - {filteredApplications.map((application) => { - const isNpmApp = - application.applicationRegistration?.sourceType === - AppRegistrationSourceType.NPM; + + + + + + + + {t`Name`} + {t`Description`} + {''} + + + + {filteredApplications.map((application) => { + const isNpmApp = + application.applicationRegistration?.sourceType === + AppRegistrationSourceType.NPM; - const latestVersion = - application.applicationRegistration?.latestAvailableVersion; + const latestVersion = + application.applicationRegistration?.latestAvailableVersion; - const hasUpdate = - isNpmApp && - isDefined(latestVersion) && - isDefined(application.version) && - isNewerSemver(latestVersion, application.version); + const hasUpdate = + isNpmApp && + isDefined(latestVersion) && + isDefined(application.version) && + isNewerSemver(latestVersion, application.version); - return ( - - } - link={getSettingsPath(SettingsPath.ApplicationDetail, { - applicationId: application.id, - })} - /> - ); - })} - + return ( + + } + link={getSettingsPath(SettingsPath.ApplicationDetail, { + applicationId: application.id, + })} + /> + ); + })} + + ); }; diff --git a/packages/twenty-front/src/pages/settings/applications/components/SettingsAvailableApplicationCard.tsx b/packages/twenty-front/src/pages/settings/applications/components/SettingsAvailableApplicationCard.tsx index 120882c517..767deda550 100644 --- a/packages/twenty-front/src/pages/settings/applications/components/SettingsAvailableApplicationCard.tsx +++ b/packages/twenty-front/src/pages/settings/applications/components/SettingsAvailableApplicationCard.tsx @@ -1,6 +1,5 @@ import { StyledSettingsCardContent, - StyledSettingsCardDescription, StyledSettingsCardThirdLine, StyledSettingsCardTitle, } from '@/settings/components/SettingsOptions/SettingsCardContentBase'; @@ -11,53 +10,69 @@ import { SettingsPath } from 'twenty-shared/types'; import { getSettingsPath } from 'twenty-shared/utils'; import { Avatar } from 'twenty-ui/display'; import { Card } from 'twenty-ui/layout'; +import { themeCssVariables } from 'twenty-ui/theme-constants'; import { type MarketplaceApp } from '~/generated-metadata/graphql'; type SettingsAvailableApplicationCardProps = { application: MarketplaceApp; }; -const StyledLink = styled(Link)` - display: flex; - height: 100%; - text-decoration: none; +const StyledLinkContainer = styled.div` + > a { + display: flex; + height: 100%; + text-decoration: none; + } `; -const StyledDescription = styled(StyledSettingsCardDescription)` - display: -webkit-box; - -webkit-line-clamp: 2; +const StyledDescription = styled.div` -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + color: ${themeCssVariables.font.color.secondary}; + display: -webkit-box; + + a { + pointer-events: auto; + position: relative; + z-index: 1; + } + + font-size: ${themeCssVariables.font.size.sm}; + line-height: 1.5; + overflow: hidden; `; export const SettingsAvailableApplicationCard = ({ application, }: SettingsAvailableApplicationCardProps) => { return ( - - - - - - - {application.name} - - {application.description} - - {t`by {author}`} {application.author} - - - - - + + + + + + + + {application.name} + + {application.description} + + {t`by {author}`} {application.author} + + + + + + ); }; diff --git a/packages/twenty-front/src/pages/settings/data-model/SettingsObjectFieldTable.tsx b/packages/twenty-front/src/pages/settings/data-model/SettingsObjectFieldTable.tsx index 0930f58391..46e888740f 100644 --- a/packages/twenty-front/src/pages/settings/data-model/SettingsObjectFieldTable.tsx +++ b/packages/twenty-front/src/pages/settings/data-model/SettingsObjectFieldTable.tsx @@ -1,8 +1,9 @@ import { type ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem'; import { isHiddenSystemField } from '@/object-metadata/utils/isHiddenSystemField'; +import { TableRow } from '@/ui/layout/table/components/TableRow'; import { + OBJECT_FIELD_TABLE_ROW_GRID_TEMPLATE_COLUMNS, SettingsObjectFieldItemTableRow, - StyledObjectFieldTableRow, } from '@/settings/data-model/object-details/components/SettingsObjectFieldItemTableRow'; import { settingsObjectFieldsFamilyState } from '@/settings/data-model/object-details/states/settingsObjectFieldsFamilyState'; import { SettingsTextInput } from '@/ui/input/components/SettingsTextInput'; @@ -43,7 +44,7 @@ const StyledSearchAndFilterContainer = styled.div` width: 100%; `; -const StyledSearchInput = styled(SettingsTextInput)` +const StyledSearchInputContainer = styled.div` flex: 1; `; @@ -163,13 +164,15 @@ export const SettingsObjectFieldTable = ({ return ( <> - + + + - + {tableMetadata.fields.map((item) => ( ))} - + {filteredItems.map((objectSettingsDetailItem) => { const status = objectSettingsDetailItem.fieldMetadataItem.isActive ? 'active' diff --git a/packages/twenty-front/src/pages/settings/data-model/SettingsObjectIndexTable.tsx b/packages/twenty-front/src/pages/settings/data-model/SettingsObjectIndexTable.tsx index e0b063119e..e636651864 100644 --- a/packages/twenty-front/src/pages/settings/data-model/SettingsObjectIndexTable.tsx +++ b/packages/twenty-front/src/pages/settings/data-model/SettingsObjectIndexTable.tsx @@ -20,11 +20,9 @@ import { themeCssVariables } from 'twenty-ui/theme-constants'; import { type SettingsObjectIndexesTableItem } from '~/pages/settings/data-model/types/SettingsObjectIndexesTableItem'; import { normalizeSearchText } from '~/utils/normalizeSearchText'; -export const StyledObjectIndexTableRow = styled(TableRow)` - grid-template-columns: 350px 70px 80px; -`; +const OBJECT_INDEX_TABLE_ROW_GRID_TEMPLATE_COLUMNS = '350px 70px 80px'; -const StyledSearchInput = styled(SettingsTextInput)` +const StyledSearchInputContainer = styled.div` padding-bottom: ${themeCssVariables.spacing[2]}; width: 100%; `; @@ -120,15 +118,19 @@ export const SettingsObjectIndexTable = ({ return ( <> - + + + - + {tableMetadata.fields.map((item) => ( ))} - + {isNonEmptyArray(filteredActiveItems) && filteredActiveItems.map((objectSettingsIndex) => ( - + {objectSettingsIndex.indexFields} {objectSettingsIndex.isUnique ? ( @@ -153,7 +158,7 @@ export const SettingsObjectIndexTable = ({ )} {objectSettingsIndex.indexType} - + ))} > diff --git a/packages/twenty-front/src/pages/settings/data-model/SettingsObjectTable.tsx b/packages/twenty-front/src/pages/settings/data-model/SettingsObjectTable.tsx index 42c3b4e555..4c32b65ce5 100644 --- a/packages/twenty-front/src/pages/settings/data-model/SettingsObjectTable.tsx +++ b/packages/twenty-front/src/pages/settings/data-model/SettingsObjectTable.tsx @@ -5,7 +5,8 @@ import { type ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataI import { isHiddenSystemField } from '@/object-metadata/utils/isHiddenSystemField'; import { useCombinedGetTotalCount } from '@/object-record/multiple-objects/hooks/useCombinedGetTotalCount'; import { SettingsObjectMetadataItemTableRow } from '@/settings/data-model/object-details/components/SettingsObjectItemTableRow'; -import { StyledObjectTableRow } from '@/settings/data-model/object-details/components/SettingsObjectItemTableRowStyledComponents'; +import { TableRow } from '@/ui/layout/table/components/TableRow'; +import { SETTINGS_OBJECT_TABLE_ROW_GRID_TEMPLATE_COLUMNS } from '@/settings/data-model/object-details/components/SettingsObjectItemTableRowStyledComponents'; import { SettingsObjectInactiveMenuDropDown } from '@/settings/data-model/objects/components/SettingsObjectInactiveMenuDropDown'; import { getItemTagInfo } from '@/settings/data-model/utils/getItemTagInfo'; import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown'; @@ -30,7 +31,7 @@ import { GET_SETTINGS_OBJECT_TABLE_METADATA } from '~/pages/settings/data-model/ import type { SettingsObjectTableItem } from '~/pages/settings/data-model/types/SettingsObjectTableItem'; import { normalizeSearchText } from '~/utils/normalizeSearchText'; -const StyledIconChevronRight = styled(IconChevronRight)` +const StyledIconChevronRightContainer = styled.div` color: ${themeCssVariables.font.color.tertiary}; `; @@ -170,7 +171,9 @@ export const SettingsObjectTable = ({ )} - + {GET_SETTINGS_OBJECT_TABLE_METADATA.fields.map( (settingsObjectsTableMetadataField) => ( - + {filteredObjectSettingsItems.map((objectSettingsItem) => { const isActive = objectSettingsItem.objectMetadataItem.isActive; @@ -195,10 +198,12 @@ export const SettingsObjectTable = ({ totalObjectCount={objectSettingsItem.totalObjectCount} action={ isActive ? ( - + + + ) : ( { > - - - - - - - - - {isEmailingDomainsEnabled && ( - + + - - + + + + + + + + + + {isEmailingDomainsEnabled && ( + + + + + + )} {isPublicDomainEnabled && ( - - - - + + + + + + )} diff --git a/packages/twenty-front/src/pages/settings/emailing-domains/SettingsEmailingDomains.tsx b/packages/twenty-front/src/pages/settings/emailing-domains/SettingsEmailingDomains.tsx index e708fa8681..36f3ffba30 100644 --- a/packages/twenty-front/src/pages/settings/emailing-domains/SettingsEmailingDomains.tsx +++ b/packages/twenty-front/src/pages/settings/emailing-domains/SettingsEmailingDomains.tsx @@ -17,8 +17,10 @@ import { getColorByEmailingDomainStatus } from '~/pages/settings/emailing-domain import { getTextByEmailingDomainStatus } from '~/pages/settings/emailing-domains/utils/getEmailingDomainStatusText'; import { beautifyPastDateRelativeToNow } from '~/utils/date-utils'; -const StyledLink = styled(Link)` - text-decoration: none; +const StyledLinkContainer = styled.div` + > a { + text-decoration: none; + } `; export const SettingsEmailingDomains = () => { @@ -38,9 +40,11 @@ export const SettingsEmailingDomains = () => { }; return isLoading || !emailingDomains.length ? ( - - } /> - + + + } /> + + ) : ( <> ` - border-bottom: ${({ hasMoreRows }) => - hasMoreRows ? 'none' : `1px solid ${themeCssVariables.border.color.light}`}; +const StyledTableContainer = styled.div<{ hasMoreRows?: boolean }>` + > div { + border-bottom: ${({ hasMoreRows }) => + hasMoreRows + ? 'none' + : `1px solid ${themeCssVariables.border.color.light}`}; + } `; const StyledIconWrapper = styled.div` @@ -83,16 +87,11 @@ const StyledTextContainerWithEllipsis = styled.div` white-space: nowrap; `; -const StyledInvitationTableCell = styled(TableCell)` - min-width: 0; - overflow: hidden; -`; - const StyledSearchContainer = styled.div` padding-bottom: ${themeCssVariables.spacing[2]}; `; -const StyledSearchInput = styled(SettingsTextInput)` +const StyledSearchInputContainer = styled.div` input { background: ${themeCssVariables.background.transparent.lighter}; border: 1px solid ${themeCssVariables.border.color.medium}; @@ -104,10 +103,6 @@ const StyledTableRows = styled.div` padding-top: ${themeCssVariables.spacing[2]}; `; -const StyledClickableTableRow = styled(TableRow)` - cursor: pointer; -`; - const StyledChevronWrapper = styled.div` align-items: center; color: ${themeCssVariables.font.color.secondary}; @@ -116,10 +111,6 @@ const StyledChevronWrapper = styled.div` width: 100%; `; -const StyledNoMembers = styled(TableCell)` - color: ${themeCssVariables.font.color.tertiary}; -`; - export const SettingsWorkspaceMembers = () => { const { theme } = useContext(ThemeContext); const { t } = useLingui(); @@ -294,92 +285,96 @@ export const SettingsWorkspaceMembers = () => { /> {isNonEmptyArray(workspaceInvitations) && ( - - - - Email - - - Role - - - - Expires in - - - - - - {workspaceInvitations?.map((workspaceInvitation) => ( - - - - + + + + Email + + + Role + + + + Expires in + + + + + + {workspaceInvitations?.map((workspaceInvitation) => ( + + + + + + + {workspaceInvitation.email} + + - - - {workspaceInvitation.email} - - - - - - {rolesById.get(workspaceInvitation.roleId ?? '') - ?.label ?? t`Default role`} - - - - - - - - { - handleResendWorkspaceInvitation( - workspaceInvitation.id, - ); - }} - variant="tertiary" - size="medium" - Icon={IconReload} + + + + {rolesById.get(workspaceInvitation.roleId ?? '') + ?.label ?? t`Default role`} + + + + - { - handleRemoveWorkspaceInvitation( - workspaceInvitation.id, - ); - }} - variant="tertiary" - size="medium" - Icon={IconTrash} - /> - - - - ))} - - + + + + { + handleResendWorkspaceInvitation( + workspaceInvitation.id, + ); + }} + variant="tertiary" + size="medium" + Icon={IconReload} + /> + { + handleRemoveWorkspaceInvitation( + workspaceInvitation.id, + ); + }} + variant="tertiary" + size="medium" + Icon={IconTrash} + /> + + + + ))} + + + )} @@ -388,107 +383,114 @@ export const SettingsWorkspaceMembers = () => { description={t`Manage the members of your workspace here`} /> - + + + - - - - Name - - - Email - - - - - {optimizedWorkspaceMembers.length > 0 ? ( - optimizedWorkspaceMembers.map((workspaceMember) => ( - { - if (currentWorkspaceMember?.id === workspaceMember.id) { - return; - } - navigateSettings(SettingsPath.WorkspaceMemberPage, { - workspaceMemberId: workspaceMember.id, - }); - }} - > - - - - - - {workspaceMember.name.firstName + - ' ' + - workspaceMember.name.lastName} - - - - - - {workspaceMember.userEmail} - - - - - {currentWorkspaceMember?.id !== - workspaceMember.id && ( - - )} - - - - )) - ) : ( - - {!searchFilter - ? t`No members` - : t`No members match your search`} - - )} - - {hasNextPage && ( + + - - - - - + + Name + + + Email + + - )} - + + {optimizedWorkspaceMembers.length > 0 ? ( + optimizedWorkspaceMembers.map((workspaceMember) => ( + { + if ( + currentWorkspaceMember?.id === workspaceMember.id + ) { + return; + } + navigateSettings(SettingsPath.WorkspaceMemberPage, { + workspaceMemberId: workspaceMember.id, + }); + }} + > + + + + + + {workspaceMember.name.firstName + + ' ' + + workspaceMember.name.lastName} + + + + + + {workspaceMember.userEmail} + + + + + {currentWorkspaceMember?.id !== + workspaceMember.id && ( + + )} + + + + )) + ) : ( + + {!searchFilter + ? t`No members` + : t`No members match your search`} + + )} + + {hasNextPage && ( + + + + + + + + )} + + diff --git a/packages/twenty-front/src/pages/settings/security/SettingsSecurity.tsx b/packages/twenty-front/src/pages/settings/security/SettingsSecurity.tsx index dc8b05e156..7c648be9a0 100644 --- a/packages/twenty-front/src/pages/settings/security/SettingsSecurity.tsx +++ b/packages/twenty-front/src/pages/settings/security/SettingsSecurity.tsx @@ -51,15 +51,17 @@ const StyledMainContent = styled.div` min-height: 200px; `; -const StyledSection = styled(Section)` +const StyledSectionContainer = styled.div` flex-shrink: 0; `; -const StyledLink = styled(Link)` - text-decoration: none; +const StyledLinkContainer = styled.div` + > a { + text-decoration: none; - &[data-disabled='true'] { - pointer-events: none; + &[data-disabled='true'] { + pointer-events: none; + } } `; @@ -177,21 +179,23 @@ export const SettingsSecurity = () => { - - - } - /> - - + + + + } + /> + + + @@ -257,17 +261,19 @@ export const SettingsSecurity = () => { : t`View and filter events, page views, object changes` } Button={ - - - + + + + + } /> {isEventLogsEnabled && ( diff --git a/packages/twenty-front/src/pages/settings/security/event-logs/components/EventLogResultsTable.tsx b/packages/twenty-front/src/pages/settings/security/event-logs/components/EventLogResultsTable.tsx index 7c04cfd309..5395f47828 100644 --- a/packages/twenty-front/src/pages/settings/security/event-logs/components/EventLogResultsTable.tsx +++ b/packages/twenty-front/src/pages/settings/security/event-logs/components/EventLogResultsTable.tsx @@ -79,25 +79,18 @@ const OBJECT_EVENT_COLUMNS: ColumnConfig[] = [ }, ]; -const StyledScrollWrapper = styled(ScrollWrapper)` +const StyledScrollWrapperContainer = styled.div` height: 100%; + overflow: hidden; `; -const StyledTable = styled(Table)` - border-collapse: collapse; - min-width: 100%; - table-layout: fixed; +const StyledTableContainer = styled.div` + > div { + min-width: 100%; + } `; -const StyledHeaderRow = styled(TableRow)` - display: grid; -`; - -const StyledDataRow = styled(TableRow)` - display: grid; -`; - -const StyledResizableHeader = styled(TableHeader)<{ isResizing?: boolean }>` +const StyledResizableHeaderContainer = styled.div<{ isResizing?: boolean }>` position: relative; user-select: ${({ isResizing }) => (isResizing ? 'none' : 'auto')}; `; @@ -117,18 +110,6 @@ const StyledResizeHandle = styled.div<{ isResizing: boolean }>` } `; -const StyledTableCell = styled(TableCell)` - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - - & > * { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - } -`; - const StyledEmptyState = styled.div` color: ${themeCssVariables.font.color.tertiary}; padding: ${themeCssVariables.spacing[8]}; @@ -255,28 +236,32 @@ export const EventLogResultsTable = ({ if (isInitialLoading) { return ( - - - - {baseColumns.map((column) => ( - {t(column.label)} - ))} - - - + - - {Array.from({ length: SKELETON_ROW_COUNT }).map((_, index) => ( - - ))} - - - + + + + {baseColumns.map((column) => ( + {t(column.label)} + ))} + + + + + + {Array.from({ length: SKELETON_ROW_COUNT }).map((_, index) => ( + + ))} + + + + ); } @@ -289,54 +274,88 @@ export const EventLogResultsTable = ({ } return ( - - - - {baseColumns.map((column) => ( - - {t(column.label)} - handleResizeStart(column.id, event)} - /> - - ))} - - {records.map((record, index) => ( - - {record.event} - - {beautifyPastDateRelativeToNow(record.timestamp)} - - {record.userId ?? '-'} - {showObjectEventColumns && ( - <> - {record.recordId ?? '-'} - - {record.objectMetadataId ?? '-'} - - > - )} - - - - - ))} - - - {loading && records.length > 0 && ( - - Loading more... - - )} - + + + + + + {baseColumns.map((column) => ( + + {t(column.label)} + + handleResizeStart(column.id, event) + } + /> + + ))} + + {records.map((record, index) => ( + + + {record.event} + + + {beautifyPastDateRelativeToNow(record.timestamp)} + + + {record.userId ?? '-'} + + {showObjectEventColumns && ( + <> + + {record.recordId ?? '-'} + + + {record.objectMetadataId ?? '-'} + + > + )} + + + + + ))} + + + + {loading && records.length > 0 && ( + + Loading more... + + )} + + ); }; diff --git a/packages/twenty-front/src/pages/settings/workspace/SettingsApiWebhooks.tsx b/packages/twenty-front/src/pages/settings/workspace/SettingsApiWebhooks.tsx index 460bb5d331..fcdcf1e83b 100644 --- a/packages/twenty-front/src/pages/settings/workspace/SettingsApiWebhooks.tsx +++ b/packages/twenty-front/src/pages/settings/workspace/SettingsApiWebhooks.tsx @@ -30,7 +30,7 @@ const StyledMainContent = styled.div` min-height: 200px; `; -const StyledSection = styled(Section)` +const StyledSectionContainer = styled.div` flex-shrink: 0; `; @@ -58,54 +58,60 @@ export const SettingsApiWebhooks = () => { > - - - - - - - + + + + + + + + + - - - - - - - - - + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + diff --git a/packages/twenty-shared/eslint.config.mjs b/packages/twenty-shared/eslint.config.mjs index 1d938f4b30..8446ecebc6 100644 --- a/packages/twenty-shared/eslint.config.mjs +++ b/packages/twenty-shared/eslint.config.mjs @@ -31,6 +31,8 @@ export default [ 'packages/twenty-shared/**/dist/**', 'packages/twenty-shared/vite.config.ts', 'packages/twenty-shared/scripts/**', + 'src/individual-entry.ts', + '**/individual-entry.ts', ], }, diff --git a/packages/twenty-shared/src/metadata/constants/reserved-metadata-name-keywords.constant.ts b/packages/twenty-shared/src/metadata/constants/reserved-metadata-name-keywords.constant.ts index 24ea5cff54..594a2ff242 100644 --- a/packages/twenty-shared/src/metadata/constants/reserved-metadata-name-keywords.constant.ts +++ b/packages/twenty-shared/src/metadata/constants/reserved-metadata-name-keywords.constant.ts @@ -1,4 +1,4 @@ -const CORE_OBJECT_NAMES = [ +export const RESERVED_METADATA_NAME_KEYWORDS = [ 'approvedAccessDomain', 'approvedAccessDomains', 'appToken', @@ -41,10 +41,6 @@ const CORE_OBJECT_NAMES = [ 'roles', 'userWorkspaceRole', 'userWorkspaceRoles', -]; - -export const RESERVED_METADATA_NAME_KEYWORDS = [ - ...CORE_OBJECT_NAMES, 'plan', 'plans', 'event', diff --git a/packages/twenty-ui/src/display/tooltip/AppTooltip.tsx b/packages/twenty-ui/src/display/tooltip/AppTooltip.tsx index 2d1944e4b3..fa31ced567 100644 --- a/packages/twenty-ui/src/display/tooltip/AppTooltip.tsx +++ b/packages/twenty-ui/src/display/tooltip/AppTooltip.tsx @@ -1,4 +1,4 @@ -import { styled } from '@linaria/react'; +import { css } from '@linaria/core'; import { type PlacesType, type PositionStrategy, Tooltip } from 'react-tooltip'; import { themeCssVariables } from '@ui/theme-constants'; @@ -16,24 +16,17 @@ export enum TooltipDelay { longDelay = '1000ms', } -const StyledAppTooltip = styled(Tooltip)<{ width?: string }>` +const appTooltipClass = css` backdrop-filter: ${themeCssVariables.blur.strong}; background-color: ${themeCssVariables.color.transparent.gray11}; border-radius: ${themeCssVariables.border.radius.sm}; - box-shadow: ${themeCssVariables.boxShadow.light}; color: ${themeCssVariables.grayScale.gray1}; - font-size: ${themeCssVariables.font.size.sm}; font-weight: ${themeCssVariables.font.weight.regular}; - - max-width: ${({ width }) => width || '40%'}; overflow: visible; - padding: ${themeCssVariables.spacing[2]}; - word-break: break-word; - z-index: ${themeCssVariables.lastLayerZIndex}; `; @@ -82,23 +75,22 @@ export const AppTooltip = ({ }; return ( - + + {children} + ); }; diff --git a/packages/twenty-ui/src/json-visualizer/components/JsonValueNode.tsx b/packages/twenty-ui/src/json-visualizer/components/JsonValueNode.tsx index 30925a4d37..4481f5c33b 100644 --- a/packages/twenty-ui/src/json-visualizer/components/JsonValueNode.tsx +++ b/packages/twenty-ui/src/json-visualizer/components/JsonValueNode.tsx @@ -1,13 +1,16 @@ import { styled } from '@linaria/react'; import { type IconComponent } from '@ui/display'; -import { JsonListItem } from '@ui/json-visualizer/components/internal/JsonListItem'; import { JsonNodeLabel } from '@ui/json-visualizer/components/internal/JsonNodeLabel'; import { JsonNodeValue } from '@ui/json-visualizer/components/internal/JsonNodeValue'; import { type JsonNodeHighlighting } from '@ui/json-visualizer/types/JsonNodeHighlighting'; import { themeCssVariables } from '@ui/theme-constants'; -const StyledListItem = styled(JsonListItem)` +const StyledListItem = styled.li` + align-items: center; column-gap: ${themeCssVariables.spacing[2]}; + display: flex; + list-style-type: none; + white-space: nowrap; `; type JsonValueNodeProps = { diff --git a/packages/twenty-ui/src/layout/modal/components/__stories__/Modal.stories.tsx b/packages/twenty-ui/src/layout/modal/components/__stories__/Modal.stories.tsx index 995d144f43..850ce280b4 100644 --- a/packages/twenty-ui/src/layout/modal/components/__stories__/Modal.stories.tsx +++ b/packages/twenty-ui/src/layout/modal/components/__stories__/Modal.stories.tsx @@ -16,7 +16,7 @@ const StyledCenteredTitle = styled.div` text-align: center; `; -const StyledSection = styled(Section)` +const StyledSectionContainer = styled.div` margin-bottom: ${themeCssVariables.spacing[6]}; `; @@ -103,13 +103,15 @@ export const Confirmation: Story = { - - This action cannot be undone. The record and all of its data will be - permanently removed. - + + + This action cannot be undone. The record and all of its data will be + permanently removed. + + ` - background: ${({ disabled, focused }) => { + --horizontal-padding: ${themeCssVariables.spacing[1]}; + --vertical-padding: ${themeCssVariables.spacing[2]}; + align-items: center; + border-radius: ${themeCssVariables.border.radius.sm}; + display: flex; + flex-direction: row; + font-size: ${themeCssVariables.font.size.sm}; + gap: ${themeCssVariables.spacing[2]}; + height: calc(32px - 2 * var(--vertical-padding)); + justify-content: space-between; + padding: var(--vertical-padding) var(--horizontal-padding); + position: relative; + user-select: none; + width: calc(100% - 2 * var(--horizontal-padding)); + transition: background 0.1s ease; + background: ${({ disabled, focused, isKeySelected }) => { if (disabled === true) { return 'inherit'; } - if (focused === true) { + if (focused === true || isKeySelected === true) { return themeCssVariables.background.transparent.light; } return ''; }}; - &:hover { background: ${({ disabled }) => disabled === true ? 'inherit' : themeCssVariables.background.transparent.light}; } - color: ${({ disabled }) => disabled === true ? themeCssVariables.font.color.tertiary : themeCssVariables.font.color.secondary}; - cursor: ${({ disabled }) => (disabled === true ? 'default' : 'pointer')}; `; diff --git a/packages/twenty-ui/src/navigation/menu/menu-item/internals/components/MenuItemLeftContent.tsx b/packages/twenty-ui/src/navigation/menu/menu-item/internals/components/MenuItemLeftContent.tsx index f500ab581f..83ae64afc8 100644 --- a/packages/twenty-ui/src/navigation/menu/menu-item/internals/components/MenuItemLeftContent.tsx +++ b/packages/twenty-ui/src/navigation/menu/menu-item/internals/components/MenuItemLeftContent.tsx @@ -28,7 +28,13 @@ const StyledMainText = styled.div` max-width: 100%; `; -const StyledMenuItemLabelRight = styled(StyledMenuItemLabel)` +const StyledMenuItemLabelRight = styled.div` + display: flex; + flex-direction: row; + font-size: ${themeCssVariables.font.size.md}; + font-weight: ${themeCssVariables.font.weight.regular}; + overflow: hidden; + white-space: nowrap; margin-left: auto; `; diff --git a/packages/twenty-ui/src/navigation/menu/menu-item/internals/components/StyledMenuItemBase.tsx b/packages/twenty-ui/src/navigation/menu/menu-item/internals/components/StyledMenuItemBase.tsx index 13c51c77e9..5fa412f045 100644 --- a/packages/twenty-ui/src/navigation/menu/menu-item/internals/components/StyledMenuItemBase.tsx +++ b/packages/twenty-ui/src/navigation/menu/menu-item/internals/components/StyledMenuItemBase.tsx @@ -93,8 +93,14 @@ export const StyledMenuItemLabel = styled.div` white-space: nowrap; `; -export const StyledMenuItemLabelLight = styled(StyledMenuItemLabel)` +export const StyledMenuItemLabelLight = styled.div` color: ${themeCssVariables.font.color.light}; + display: flex; + flex-direction: row; + font-size: ${themeCssVariables.font.size.md}; + font-weight: ${themeCssVariables.font.weight.regular}; + overflow: hidden; + white-space: nowrap; `; export const StyledNoIconFiller = styled.div` @@ -139,21 +145,55 @@ type HoverableMenuItemBaseProps = { cursor?: 'drag' | 'default'; } & MenuItemBaseProps; -export const StyledHoverableMenuItemBase = styled( - StyledMenuItemBase, -)` - & .hoverable-buttons { - opacity: ${({ isIconDisplayedOnHoverOnly }) => - isIconDisplayedOnHoverOnly === true ? '0' : '1'}; - right: ${({ isIconDisplayedOnHoverOnly }) => - isIconDisplayedOnHoverOnly === true - ? themeCssVariables.spacing[2] - : 'auto'}; - transition: opacity - calc(${themeCssVariables.animation.duration.instant} * 1s) ease; - } - +export const StyledHoverableMenuItemBase = styled.div` + --horizontal-padding: ${themeCssVariables.spacing[1]}; + --vertical-padding: ${themeCssVariables.spacing[2]}; + align-items: center; + border-radius: ${themeCssVariables.border.radius.sm}; + display: flex; + flex-direction: row; + font-size: ${themeCssVariables.font.size.sm}; + gap: ${themeCssVariables.spacing[2]}; + height: calc(32px - 2 * var(--vertical-padding)); + justify-content: space-between; + padding: var(--vertical-padding) var(--horizontal-padding); + background: ${({ isKeySelected, focused }) => + isKeySelected || focused + ? themeCssVariables.background.transparent.light + : 'transparent'}; + transition: ${({ isHoverBackgroundDisabled, disabled }) => + disabled || isHoverBackgroundDisabled ? 'none' : 'background 0.1s ease'}; + color: ${({ accent, disabled }) => { + if (disabled !== undefined && disabled !== false) { + return themeCssVariables.font.color.tertiary; + } + switch (accent) { + case 'danger': + return themeCssVariables.font.color.danger; + case 'placeholder': + return themeCssVariables.font.color.tertiary; + case 'default': + default: + return themeCssVariables.font.color.secondary; + } + }}; &:hover { + background: ${({ + accent, + disabled, + isHoverBackgroundDisabled, + isKeySelected, + focused, + }) => { + if (disabled === true) + return isKeySelected || focused + ? themeCssVariables.background.transparent.light + : 'transparent'; + if (accent === 'danger') + return themeCssVariables.background.transparent.danger; + if (isHoverBackgroundDisabled === true) return 'transparent'; + return themeCssVariables.background.transparent.light; + }}; & .hoverable-buttons { opacity: 1; } @@ -164,12 +204,23 @@ export const StyledHoverableMenuItemBase = styled( opacity: 1; } } - + position: relative; + user-select: none; + width: calc(100% - 2 * var(--horizontal-padding)); + & .hoverable-buttons { + opacity: ${({ isIconDisplayedOnHoverOnly }) => + isIconDisplayedOnHoverOnly === true ? '0' : '1'}; + right: ${({ isIconDisplayedOnHoverOnly }) => + isIconDisplayedOnHoverOnly === true + ? themeCssVariables.spacing[2] + : 'auto'}; + transition: opacity + calc(${themeCssVariables.animation.duration.instant} * 1s) ease; + } cursor: ${({ cursor, disabled }) => { if (disabled !== undefined && disabled !== false) { return 'default'; } - switch (cursor) { case 'drag': return 'grab'; @@ -202,8 +253,13 @@ export const StyledMenuItemContextualText = styled.div` overflow: hidden; `; -export const StyledRightMenuItemContextualText = styled( - StyledMenuItemContextualText, -)` +export const StyledRightMenuItemContextualText = styled.div` + color: ${themeCssVariables.font.color.light}; + font-family: inherit; + font-size: inherit; + font-weight: inherit; + padding-left: ${themeCssVariables.spacing[1]}; + flex-shrink: 1; + overflow: hidden; text-align: right; `;