Skip to content

The open alternative to Salesforce, designed for AI.

Group Card parts under one component (#26654)

Raphaël Bosif7ab7fbb8a40
diff --git a/packages/twenty-companion/src/renderer/components/Home.tsx b/packages/twenty-companion/src/renderer/components/Home.tsx
index bfa8684897d..ef90ec4d993 100644
--- a/packages/twenty-companion/src/renderer/components/Home.tsx
+++ b/packages/twenty-companion/src/renderer/components/Home.tsx
@@ -37,7 +37,7 @@ const UpcomingMeetings = ({ state, isPending, command }: ActionProps) => {
<Section.Header title={calendarTitle} />
{meetings.length ? (
<>
- <Card
+ <Card.Root
className="agenda-list"
backgroundColor="var(--t-background-secondary)"
>
@@ -78,7 +78,7 @@ const UpcomingMeetings = ({ state, isPending, command }: ActionProps) => {
</div>
</div>
))}
- </Card>
+ </Card.Root>
{meetings.length > 3 && (
<div>
<Button
@@ -95,7 +95,7 @@ const UpcomingMeetings = ({ state, isPending, command }: ActionProps) => {
)}
</>
) : (
- <Card backgroundColor="var(--t-background-secondary)">
+ <Card.Root backgroundColor="var(--t-background-secondary)">
<SettingsCardContent
icon={
<IconCalendarEvent
@@ -127,7 +127,7 @@ const UpcomingMeetings = ({ state, isPending, command }: ActionProps) => {
</Button>
)}
</SettingsCardContent>
- </Card>
+ </Card.Root>
)}
</section>
);
diff --git a/packages/twenty-companion/src/renderer/components/Permissions.tsx b/packages/twenty-companion/src/renderer/components/Permissions.tsx
index 8a3e9521af3..2a83b47c9ca 100644
--- a/packages/twenty-companion/src/renderer/components/Permissions.tsx
+++ b/packages/twenty-companion/src/renderer/components/Permissions.tsx
@@ -15,7 +15,7 @@ import { SetupHeading } from './SetupHeading';
import { Status } from '@ui/primitives/data-display/Status/Status';
const PermissionChecklist = ({ state, isPending, command }: ActionProps) => (
- <Card
+ <Card.Root
className="permission-list"
backgroundColor="var(--t-background-secondary)"
>
@@ -76,7 +76,7 @@ const PermissionChecklist = ({ state, isPending, command }: ActionProps) => (
</div>
);
})}
- </Card>
+ </Card.Root>
);
export const Permissions = ({
diff --git a/packages/twenty-companion/src/renderer/components/RecordingControls.tsx b/packages/twenty-companion/src/renderer/components/RecordingControls.tsx
index a3033509767..cc37fae204f 100644
--- a/packages/twenty-companion/src/renderer/components/RecordingControls.tsx
+++ b/packages/twenty-companion/src/renderer/components/RecordingControls.tsx
@@ -29,7 +29,7 @@ export const RecordingControls = ({
stopping: i18n._('Finishing recording…'),
}[active.status];
return (
- <Card
+ <Card.Root
className="live-card"
aria-label={i18n._('Current recording')}
backgroundColor="var(--t-background-secondary)"
@@ -78,6 +78,6 @@ export const RecordingControls = ({
{i18n._('Finish recording')}
</Button>
</div>
- </Card>
+ </Card.Root>
);
};
diff --git a/packages/twenty-companion/src/renderer/components/RecordingList.tsx b/packages/twenty-companion/src/renderer/components/RecordingList.tsx
index 7408d76d569..17db9efa8b7 100644
--- a/packages/twenty-companion/src/renderer/components/RecordingList.tsx
+++ b/packages/twenty-companion/src/renderer/components/RecordingList.tsx
@@ -11,7 +11,7 @@ import { formatDate } from '../utils/formatDate';
export const RecordingList = ({ state, isPending, command }: ActionProps) => {
const recordings = state.recordings.slice(0, 5);
return recordings.length ? (
- <Card
+ <Card.Root
className="recording-list"
backgroundColor="var(--t-background-secondary)"
>
@@ -52,7 +52,7 @@ export const RecordingList = ({ state, isPending, command }: ActionProps) => {
</div>
</button>
))}
- </Card>
+ </Card.Root>
) : (
<Empty
icon={
diff --git a/packages/twenty-companion/src/renderer/components/Settings.tsx b/packages/twenty-companion/src/renderer/components/Settings.tsx
index 3e702b50533..38c0dba5188 100644
--- a/packages/twenty-companion/src/renderer/components/Settings.tsx
+++ b/packages/twenty-companion/src/renderer/components/Settings.tsx
@@ -63,7 +63,7 @@ const SettingsToggle = ({
export const Settings = ({ state, isPending, command }: ActionProps) => (
<section className="settings-page">
<Section.Header title={i18n._('General')} />
- <Card
+ <Card.Root
className="settings-group"
backgroundColor="var(--t-background-secondary)"
>
@@ -127,9 +127,9 @@ export const Settings = ({ state, isPending, command }: ActionProps) => (
'Show time until your next meeting beside the tray icon.',
)}
/>
- </Card>
+ </Card.Root>
<Section.Header title={i18n._('Meetings')} className="section" />
- <Card
+ <Card.Root
className="settings-group"
backgroundColor="var(--t-background-secondary)"
>
@@ -238,9 +238,9 @@ export const Settings = ({ state, isPending, command }: ActionProps) => (
/>
</SettingsCardContent>
</button>
- </Card>
+ </Card.Root>
<Section.Header title={i18n._('Workspace')} className="section" />
- <Card
+ <Card.Root
className="settings-group"
backgroundColor="var(--t-background-secondary)"
>
@@ -279,6 +279,6 @@ export const Settings = ({ state, isPending, command }: ActionProps) => (
{i18n._('Disconnect')}
</Button>
</SettingsCardContent>
- </Card>
+ </Card.Root>
</section>
);
diff --git a/packages/twenty-docs/docs.json b/packages/twenty-docs/docs.json
index 78ded33cd8c..f0c3da818af 100644
--- a/packages/twenty-docs/docs.json
+++ b/packages/twenty-docs/docs.json
@@ -552,6 +552,7 @@
"group": "Surfaces",
"pages": [
"ui/primitives/surfaces/alert-dialog",
+ "ui/primitives/surfaces/card",
"ui/primitives/surfaces/dialog",
"ui/primitives/surfaces/menu",
"ui/primitives/surfaces/popover",
@@ -7365,6 +7366,18 @@
{
"source": "/ui/primitives/feedback/toast",
"destination": "/ui/components/toast"
+ },
+ {
+ "source": "/ui/primitives/surfaces/card-header",
+ "destination": "/ui/primitives/surfaces/card"
+ },
+ {
+ "source": "/ui/primitives/surfaces/card-content",
+ "destination": "/ui/primitives/surfaces/card"
+ },
+ {
+ "source": "/ui/primitives/surfaces/card-footer",
+ "destination": "/ui/primitives/surfaces/card"
}
]
}
diff --git a/packages/twenty-docs/navigation/base-structure.json b/packages/twenty-docs/navigation/base-structure.json
index 1eeb6f64cf4..ce80647509b 100644
--- a/packages/twenty-docs/navigation/base-structure.json
+++ b/packages/twenty-docs/navigation/base-structure.json
@@ -565,6 +565,7 @@
"label": "Surfaces",
"pages": [
"ui/primitives/surfaces/alert-dialog",
+ "ui/primitives/surfaces/card",
"ui/primitives/surfaces/dialog",
"ui/primitives/surfaces/menu",
"ui/primitives/surfaces/popover",
diff --git a/packages/twenty-docs/snippets/ui/generated/components/tab-button.mdx b/packages/twenty-docs/snippets/ui/generated/components/tab-button.mdx
index bd0f3dcdfbf..67085afb77b 100644
--- a/packages/twenty-docs/snippets/ui/generated/components/tab-button.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/components/tab-button.mdx
@@ -32,6 +32,10 @@
Whether the button should be focusable when disabled.
</ParamField>
+<ParamField body="href" type="string">
+ Destination URL. Enables native link semantics instead of button semantics.
+</ParamField>
+
<ParamField body="render" type="ReactElement&lt;unknown, string | JSXElementConstructor&lt;any&gt;&gt; | ComponentRenderFn&lt;HTMLProps, ButtonState&gt;">
Caller-supplied root element or renderer. Preserve a native button, or an anchor when `href` is set. Router integration belongs to the caller.
</ParamField>
diff --git a/packages/twenty-docs/snippets/ui/generated/input/button.mdx b/packages/twenty-docs/snippets/ui/generated/input/button.mdx
index 1b857042949..b85eb5637c6 100644
--- a/packages/twenty-docs/snippets/ui/generated/input/button.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/input/button.mdx
@@ -40,6 +40,10 @@
Keyboard shortcut hints displayed on non-mobile screens.
</ParamField>
+<ParamField body="href" type="string">
+ Destination URL. Enables native link semantics instead of button semantics.
+</ParamField>
+
<ParamField body="loading" type="boolean" default="false">
Shows a loading indicator and disables activation while preserving the button width.
</ParamField>
diff --git a/packages/twenty-docs/snippets/ui/generated/input/icon-button.mdx b/packages/twenty-docs/snippets/ui/generated/input/icon-button.mdx
index 72b59c9539b..a2c4d10187e 100644
--- a/packages/twenty-docs/snippets/ui/generated/input/icon-button.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/input/icon-button.mdx
@@ -36,6 +36,10 @@
Whether the button should be focusable when disabled.
</ParamField>
+<ParamField body="href" type="string">
+ Destination URL. Enables native link semantics instead of button semantics.
+</ParamField>
+
<ParamField body="loading" type="boolean">
Shows a loading indicator and disables activation while preserving the button width.
</ParamField>
diff --git a/packages/twenty-docs/snippets/ui/generated/input/light-button.mdx b/packages/twenty-docs/snippets/ui/generated/input/light-button.mdx
index b5a37f1a63a..1b779a2e5fe 100644
--- a/packages/twenty-docs/snippets/ui/generated/input/light-button.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/input/light-button.mdx
@@ -44,6 +44,10 @@
Keyboard shortcut hints displayed on non-mobile screens.
</ParamField>
+<ParamField body="href" type="string">
+ Destination URL. Enables native link semantics instead of button semantics.
+</ParamField>
+
<ParamField body="loading" type="boolean">
Shows a loading indicator and disables activation while preserving the button width.
</ParamField>
diff --git a/packages/twenty-docs/snippets/ui/generated/input/light-icon-button.mdx b/packages/twenty-docs/snippets/ui/generated/input/light-icon-button.mdx
index 974b1c90909..5c12b573a89 100644
--- a/packages/twenty-docs/snippets/ui/generated/input/light-icon-button.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/input/light-icon-button.mdx
@@ -40,6 +40,10 @@
Whether the button should be focusable when disabled.
</ParamField>
+<ParamField body="href" type="string">
+ Destination URL. Enables native link semantics instead of button semantics.
+</ParamField>
+
<ParamField body="loading" type="boolean">
Shows a loading indicator and disables activation while preserving the button width.
</ParamField>
diff --git a/packages/twenty-docs/snippets/ui/generated/input/main-button.mdx b/packages/twenty-docs/snippets/ui/generated/input/main-button.mdx
index 415c091b600..bb72ed59b66 100644
--- a/packages/twenty-docs/snippets/ui/generated/input/main-button.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/input/main-button.mdx
@@ -40,6 +40,10 @@
Keyboard shortcut hints displayed on non-mobile screens.
</ParamField>
+<ParamField body="href" type="string">
+ Destination URL. Enables native link semantics instead of button semantics.
+</ParamField>
+
<ParamField body="loading" type="boolean">
Shows a loading indicator and disables activation while preserving the button width.
</ParamField>
diff --git a/packages/twenty-docs/snippets/ui/generated/surfaces/card.mdx b/packages/twenty-docs/snippets/ui/generated/surfaces/card.mdx
new file mode 100644
index 00000000000..4121a516906
--- /dev/null
+++ b/packages/twenty-docs/snippets/ui/generated/surfaces/card.mdx
@@ -0,0 +1,72 @@
+{/*
+ * _____ _
+ *|_ _|_ _____ _ __ | |_ _ _
+ * | | \ \ /\ / / _ \ '_ \| __| | | | Auto-generated file
+ * | | \ V V / __/ | | | |_| |_| | DO NOT EDIT - changes will be overwritten
+ * |_| \_/\_/ \___|_| |_|\__|\__, | Generated by: npx nx generate:ui twenty-docs
+ * |___/
+ *
+ * This file is generated from the documentation data in packages/twenty-ui/generated.
+ * To update it, edit the component prop types or design tokens in twenty-ui and run:
+ * npx nx generate:ui twenty-docs
+ */}
+
+### Card.Root
+
+<ParamField body="Root.backgroundColor" type="string">
+ CSS background color of the outer card. Child sections have their own backgrounds.
+</ParamField>
+
+<ParamField body="Root.children" type="ReactNode">
+ Card sections or other content.
+</ParamField>
+
+<ParamField body="Root.fullWidth" type="boolean">
+ Sets the card width to 100% of its container.
+</ParamField>
+
+<ParamField body="Root.rounded" type="boolean">
+ Compatibility styling flag. Cards already use the same rounded corners when omitted.
+</ParamField>
+
+### Card.Header
+
+<ParamField body="Header.children" type="ReactNode">
+ Header content. Supply a Heading when the title should be a semantic heading.
+</ParamField>
+
+<ParamField body="Header.className" type="string">
+ CSS class applied to the header.
+</ParamField>
+
+### Card.Content
+
+<ParamField body="Content.children" type="ReactNode">
+ Content displayed in the padded body.
+</ParamField>
+
+<ParamField body="Content.className" type="string">
+ CSS class applied to the body.
+</ParamField>
+
+<ParamField body="Content.divider" type="boolean">
+ Adds a bottom border.
+</ParamField>
+
+<ParamField body="Content.hasHoverHighlight" type="boolean">
+ Changes the background on hover. Does not add an action.
+</ParamField>
+
+<ParamField body="Content.isClickable" type="boolean">
+ Shows a pointer cursor. Does not add button semantics or keyboard interaction.
+</ParamField>
+
+### Card.Footer
+
+<ParamField body="Footer.children" type="ReactNode">
+ Footer content, such as actions or supporting text.
+</ParamField>
+
+<ParamField body="Footer.divider" type="boolean" default="true">
+ Shows the top border unless explicitly set to false.
+</ParamField>
diff --git a/packages/twenty-docs/snippets/ui/generated/surfaces/tooltip.mdx b/packages/twenty-docs/snippets/ui/generated/surfaces/tooltip.mdx
index 00b827266db..646c9a5b2c9 100644
--- a/packages/twenty-docs/snippets/ui/generated/surfaces/tooltip.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/surfaces/tooltip.mdx
@@ -142,6 +142,10 @@
CSS positioning method for the popup.
</ParamField>
+<ParamField body="ref" type="Ref&lt;HTMLDivElement&gt;">
+ Ref forwarded to the popup element.
+</ParamField>
+
<ParamField body="render" type="ReactElement&lt;unknown, string | JSXElementConstructor&lt;any&gt;&gt; | ComponentRenderFn&lt;HTMLProps, TooltipPopupState&gt;">
Allows you to replace the component's HTML element
with a different tag, or compose it with another component.
@@ -299,6 +303,10 @@
Displays an arrow pointing to the trigger. Defaults to false.
</ParamField>
+<ParamField body="Popup.children" type="ReactNode">
+ Content displayed inside the popup.
+</ParamField>
+
<ParamField body="Popup.className" type="string | ((state: TooltipPopupState) =&gt; string | undefined)">
Additional CSS class for the popup.
</ParamField>
@@ -343,6 +351,10 @@
Portal destination. Defaults to the current theme container.
</ParamField>
+<ParamField body="Popup.content" type="string">
+ Supplementary content displayed in the tooltip.
+</ParamField>
+
<ParamField body="Popup.disableAnchorTracking" type="boolean" default="false">
Whether to disable the popup from tracking any layout shift of its positioning anchor.
</ParamField>
@@ -359,6 +371,10 @@
CSS positioning method for the popup.
</ParamField>
+<ParamField body="Popup.ref" type="Ref&lt;HTMLDivElement&gt;">
+ Ref forwarded to the popup element.
+</ParamField>
+
<ParamField body="Popup.render" type="ReactElement&lt;unknown, string | JSXElementConstructor&lt;any&gt;&gt; | ComponentRenderFn&lt;HTMLProps, TooltipPopupState&gt;">
Allows you to replace the component's HTML element
with a different tag, or compose it with another component.
@@ -385,6 +401,10 @@
### Tooltip.Content
+<ParamField body="Content.children" type="ReactNode">
+ Primary text displayed in the tooltip.
+</ParamField>
+
<ParamField body="Content.description" type="ReactNode">
Secondary explanation beneath the primary text.
</ParamField>
diff --git a/packages/twenty-docs/ui/primitives/overview.mdx b/packages/twenty-docs/ui/primitives/overview.mdx
index 95d95add1c4..46d8171e4ed 100644
--- a/packages/twenty-docs/ui/primitives/overview.mdx
+++ b/packages/twenty-docs/ui/primitives/overview.mdx
@@ -91,5 +91,5 @@ Each page includes usage examples, interaction guidance, and a generated API ref
| Data display | [Avatar](/ui/primitives/data-display/avatar), [Chip](/ui/primitives/data-display/chip), [Tag](/ui/primitives/data-display/tag), [Status](/ui/primitives/data-display/status) |
| Forms | [Button](/ui/primitives/input/button), [ButtonGroup](/ui/primitives/input/button-group), [Field](/ui/primitives/input/field), [Input](/ui/primitives/input/input), [InputGroup](/ui/primitives/input/input-group), [Textarea](/ui/primitives/input/textarea), [Checkbox](/ui/primitives/input/checkbox), [Radio](/ui/primitives/input/radio), [RadioGroup](/ui/primitives/input/radio-group), [Select](/ui/primitives/input/select), [Slider](/ui/primitives/input/slider), [Switch](/ui/primitives/input/switch) |
| Navigation | [ListItem](/ui/primitives/navigation/list-item), [Tabs](/ui/primitives/navigation/tabs) |
-| Surfaces | [AlertDialog](/ui/primitives/surfaces/alert-dialog), [Dialog](/ui/primitives/surfaces/dialog), [Menu](/ui/primitives/surfaces/menu), [Popover](/ui/primitives/surfaces/popover), [Tooltip](/ui/primitives/surfaces/tooltip) |
+| Surfaces | [AlertDialog](/ui/primitives/surfaces/alert-dialog), [Card](/ui/primitives/surfaces/card), [Dialog](/ui/primitives/surfaces/dialog), [Menu](/ui/primitives/surfaces/menu), [Popover](/ui/primitives/surfaces/popover), [Tooltip](/ui/primitives/surfaces/tooltip) |
| Typography | [Heading](/ui/primitives/typography/heading), [Text](/ui/primitives/typography/text) |
diff --git a/packages/twenty-docs/ui/primitives/surfaces/card.mdx b/packages/twenty-docs/ui/primitives/surfaces/card.mdx
new file mode 100644
index 00000000000..c1636f71673
--- /dev/null
+++ b/packages/twenty-docs/ui/primitives/surfaces/card.mdx
@@ -0,0 +1,126 @@
+---
+title: Card
+description: Group related information inside a bordered surface.
+---
+
+import { StoryEmbed } from '/snippets/ui/StoryEmbed.mdx';
+
+import CardReference from '/snippets/ui/generated/surfaces/card.mdx';
+
+`Card` groups four presentational parts under one named export. Compose `Card.Root`, `Card.Header`, `Card.Content`, and `Card.Footer` to separate a title, body, and supporting actions. The parts do not manage selection, focus, or application state. The application owns the behavior of any controls placed inside them.
+
+## Anatomy
+
+```text
+Card.Root (outer surface)
+├── Card.Header (optional)
+├── Card.Content (optional, repeatable)
+└── Card.Footer (optional)
+```
+
+Import `Card` from `twenty-ui/primitives/surfaces`. `Card.Root` supplies the outer border and clipping, but creates no sections internally. No part requires another part or a particular section order. The sections also work independently, without `Card.Root` or context.
+
+Each part renders a `div` and accepts native div attributes, `className`, and `style`. No part adds heading, button, or HTML `footer` semantics automatically.
+
+<StoryEmbed storyId="ui-surfaces-card--default" title="Card example" />
+
+## Usage
+
+```tsx
+import { useId } from 'react';
+import { Button } from 'twenty-ui/primitives/input';
+import { Card } from 'twenty-ui/primitives/surfaces';
+import { Heading, Text } from 'twenty-ui/primitives/typography';
+
+type ImportSummaryProps = { onReview: () => void };
+
+export const ImportSummary = ({ onReview }: ImportSummaryProps) => {
+ const titleId = useId();
+
+ return (
+ <Card.Root fullWidth role="region" aria-labelledby={titleId}>
+ <Card.Header>
+ <Heading id={titleId} level={2}>
+ Import summary
+ </Heading>
+ </Card.Header>
+ <Card.Content>
+ <Text>24 records are ready to import.</Text>
+ </Card.Content>
+ <Card.Footer>
+ <Button onClick={onReview}>Review records</Button>
+ </Card.Footer>
+ </Card.Root>
+ );
+};
+```
+
+Use [Heading](/ui/primitives/typography/heading) at the level required by the surrounding page. Put actions in [Button](/ui/primitives/input/button) or a native link so keyboard and assistive-technology users can activate them.
+
+## Appearance and dividers
+
+`Card.Root` has a transparent background by default. `fullWidth` fills its container, and `backgroundColor` changes the outer background. Child sections have their own backgrounds. `rounded` currently uses the same corner radius as the default card.
+
+`Card.Header` has a primary background, padding, and a bottom border. `Card.Content` has a secondary background and padding; its optional `divider` adds a bottom border. `Card.Footer` has a primary background, padding, and a top border unless `divider={false}`. Avoid adding two borders at the same section boundary.
+
+```tsx
+import { Card } from 'twenty-ui/primitives/surfaces';
+import { Text } from 'twenty-ui/primitives/typography';
+
+export const ImportSections = () => (
+ <Card.Root>
+ <Card.Content divider>
+ <Text>24 records are ready to import.</Text>
+ </Card.Content>
+ <Card.Content divider>
+ <Text>3 records need review.</Text>
+ </Card.Content>
+ <Card.Footer divider={false}>
+ <Text>Last checked just now.</Text>
+ </Card.Footer>
+ </Card.Root>
+);
+```
+
+`Card.Content` supports `isClickable` for a pointer cursor and `hasHoverHighlight` for a hover background. These flags only change appearance. They do not add button semantics, keyboard activation, or a click handler.
+
+## Independent parts and custom wrappers
+
+A section can be used without the outer surface. Wrappers can derive their props from the corresponding part and spread them to preserve native attributes, event handlers, classes, and styles. Card parts retain their existing props without `ref` support; a wrapper that needs a DOM ref can attach it to a host element it owns.
+
+```tsx
+import { type ComponentProps } from 'react';
+import { Card } from 'twenty-ui/primitives/surfaces';
+import { Text } from 'twenty-ui/primitives/typography';
+
+type SummaryContentProps = ComponentProps<typeof Card.Content>;
+
+const SummaryContent = ({ children, ...props }: SummaryContentProps) => (
+ <Card.Content {...props}>{children}</Card.Content>
+);
+
+export const StandaloneSummary = () => (
+ <SummaryContent aria-label="Import summary" style={{ maxWidth: 360 }}>
+ <Text>24 records are ready to import.</Text>
+ </SummaryContent>
+);
+```
+
+## Migration
+
+Replace the four separate imports with `import { Card } from 'twenty-ui/primitives/surfaces'`. The root package and `twenty-ui/primitives` also export the same `Card` object.
+
+| Previous API | Compound API |
+| ----------------------------- | ---------------------------------- |
+| `Card` as a component | `Card.Root` |
+| `CardHeader` | `Card.Header` |
+| `CardContent` | `Card.Content` |
+| `CardFooter` | `Card.Footer` |
+| `ComponentProps<typeof Card>` | `ComponentProps<typeof Card.Root>` |
+| `styled(Card)` | `styled(Card.Root)` |
+
+Apply the same member names to JSX tags, styled wrappers, and prop types. Standalone part exports are removed without compatibility aliases. Existing props, styling defaults, and independent section use remain unchanged.
+
+## Props
+
+<CardReference />
diff --git a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/resize-handle-example.tsx b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/resize-handle-example.tsx
index 16a33024fad..d66d8494c50 100644
--- a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/resize-handle-example.tsx
+++ b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/resize-handle-example.tsx
@@ -9,9 +9,9 @@ export const ResizeHandleExample = () => {
return (
<div>
- <Card id={regionId} style={{ height, overflow: 'hidden' }}>
+ <Card.Root id={regionId} style={{ height, overflow: 'hidden' }}>
<Text>{height} pixels</Text>
- </Card>
+ </Card.Root>
<ResizeHandle
aria-label="Resize example"
aria-controls={regionId}
diff --git a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-surfaces-gallery.front-component.tsx b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-surfaces-gallery.front-component.tsx
index 31e4419b44f..231ac4006c1 100644
--- a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-surfaces-gallery.front-component.tsx
+++ b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-surfaces-gallery.front-component.tsx
@@ -1,13 +1,7 @@
import { defineFrontComponent } from 'twenty-sdk/define';
import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/typography';
import { Button } from 'twenty-ui/primitives/input';
-import {
- Card,
- CardContent,
- CardFooter,
- CardHeader,
- Tooltip,
-} from 'twenty-ui/primitives/surfaces';
+import { Card, Tooltip } from 'twenty-ui/primitives/surfaces';
import { ThemeProvider } from 'twenty-ui/theme';
import {
@@ -27,20 +21,20 @@ const SURFACES_ENTRIES: GalleryEntry[] = [
),
},
{
- name: 'Card',
- node: <Card>Card body</Card>,
+ name: 'Card.Root',
+ node: <Card.Root>Card body</Card.Root>,
},
{
- name: 'CardContent',
- node: <CardContent>Card content</CardContent>,
+ name: 'Card.Content',
+ node: <Card.Content>Card content</Card.Content>,
},
{
- name: 'CardFooter',
- node: <CardFooter>Card footer</CardFooter>,
+ name: 'Card.Footer',
+ node: <Card.Footer>Card footer</Card.Footer>,
},
{
- name: 'CardHeader',
- node: <CardHeader>Card header</CardHeader>,
+ name: 'Card.Header',
+ node: <Card.Header>Card header</Card.Header>,
},
{
name: 'OverflowingTextWithTooltip',
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 7dbd3a21551..a2d294d74b5 100644
--- a/packages/twenty-front/src/modules/activities/calendar/components/CalendarDayCardContent.tsx
+++ b/packages/twenty-front/src/modules/activities/calendar/components/CalendarDayCardContent.tsx
@@ -3,7 +3,7 @@ import { differenceInSeconds, endOfDay, format } from 'date-fns';
import { CalendarEventRow } from '@/activities/calendar/components/CalendarEventRow';
import { getCalendarEventStartDate } from '@/activities/calendar/utils/getCalendarEventStartDate';
-import { CardContent } from 'twenty-ui/primitives/surfaces';
+import { Card } from 'twenty-ui/primitives/surfaces';
import { themeCssVariables } from 'twenty-ui/theme';
import { type TimelineCalendarEvent } from '~/generated/graphql';
@@ -22,7 +22,7 @@ const StyledCardContentContainer = styled.div`
}
`;
-const StyledDayCardContent = styled(CardContent)`
+const StyledDayCardContent = styled(Card.Content)`
@keyframes calendarDayEnded {
to {
background-color: ${themeCssVariables.background.primary};
diff --git a/packages/twenty-front/src/modules/activities/calendar/components/CalendarMonthCard.tsx b/packages/twenty-front/src/modules/activities/calendar/components/CalendarMonthCard.tsx
index 5d4cabd3e9a..1104f6863bc 100644
--- a/packages/twenty-front/src/modules/activities/calendar/components/CalendarMonthCard.tsx
+++ b/packages/twenty-front/src/modules/activities/calendar/components/CalendarMonthCard.tsx
@@ -12,7 +12,7 @@ export const CalendarMonthCard = ({ dayTimes }: CalendarMonthCardProps) => {
const { calendarEventsByDayTime } = useContext(CalendarContext);
return (
- <Card fullWidth>
+ <Card.Root fullWidth>
{dayTimes.map((dayTime, index) => {
const dayCalendarEvents = calendarEventsByDayTime[dayTime] || [];
@@ -24,6 +24,6 @@ export const CalendarMonthCard = ({ dayTimes }: CalendarMonthCardProps) => {
/>
);
})}
- </Card>
+ </Card.Root>
);
};
diff --git a/packages/twenty-front/src/modules/activities/components/ActivityList.tsx b/packages/twenty-front/src/modules/activities/components/ActivityList.tsx
index 1f2c52a459f..6c76cfa698b 100644
--- a/packages/twenty-front/src/modules/activities/components/ActivityList.tsx
+++ b/packages/twenty-front/src/modules/activities/components/ActivityList.tsx
@@ -35,7 +35,7 @@ export const ActivityList = ({
}: ActivityListProps) => {
return (
<StyledListContainer data-scrollable={isScrollable || undefined}>
- <Card>{children}</Card>
+ <Card.Root>{children}</Card.Root>
</StyledListContainer>
);
};
diff --git a/packages/twenty-front/src/modules/activities/components/ActivityRow.tsx b/packages/twenty-front/src/modules/activities/components/ActivityRow.tsx
index 539631a9893..062c212063c 100644
--- a/packages/twenty-front/src/modules/activities/components/ActivityRow.tsx
+++ b/packages/twenty-front/src/modules/activities/components/ActivityRow.tsx
@@ -1,6 +1,6 @@
import { styled } from '@linaria/react';
import React from 'react';
-import { CardContent } from 'twenty-ui/primitives/surfaces';
+import { Card } from 'twenty-ui/primitives/surfaces';
import { themeCssVariables } from 'twenty-ui/theme';
const StyledRowContentContainer = styled.div`
@@ -38,13 +38,13 @@ export const ActivityRow = ({
return (
<StyledRowContentContainer>
- <CardContent
+ <Card.Content
onClick={handleClick}
isClickable={disabled !== true}
hasHoverHighlight={disabled !== true}
>
{children}
- </CardContent>
+ </Card.Content>
</StyledRowContentContainer>
);
};
diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsCalendarChannelDetails.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsCalendarChannelDetails.tsx
index 66c45076e47..45ebc1397b9 100644
--- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsCalendarChannelDetails.tsx
+++ b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsCalendarChannelDetails.tsx
@@ -60,7 +60,7 @@ export const SettingsAccountsCalendarChannelDetails = ({
title={t`Contact auto-creation`}
description={t`Automatically create contacts for people you've participated in an event with.`}
/>
- <Card rounded>
+ <Card.Root rounded>
<SettingsOptionCardContentSwitch
Icon={IconUserPlus}
title={t`Auto-creation`}
@@ -72,7 +72,7 @@ export const SettingsAccountsCalendarChannelDetails = ({
);
}}
/>
- </Card>
+ </Card.Root>
</Section.Root>
</StyledDetailsContainer>
);
diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsMessageChannelDetails.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsMessageChannelDetails.tsx
index cc71b501ce1..090475f64a6 100644
--- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsMessageChannelDetails.tsx
+++ b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsMessageChannelDetails.tsx
@@ -129,7 +129,7 @@ export const SettingsAccountsMessageChannelDetails = ({
title={t`Options`}
description={t`Configure what emails should get synced`}
/>
- <Card rounded>
+ <Card.Root rounded>
<SettingsOptionCardContentSwitch
Icon={IconUsers}
title={t`Exclude group emails`}
@@ -153,7 +153,7 @@ export const SettingsAccountsMessageChannelDetails = ({
);
}}
/>
- </Card>
+ </Card.Root>
</Section.Root>
</StyledDetailsContainer>
);
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 76183f21e97..d2b3d0aabc9 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
@@ -205,7 +205,7 @@ export const SettingsAdminAI = () => {
description={t`The model behind each mode for every workspace. Workspaces can pin their own.`}
/>
- <Card rounded>
+ <Card.Root rounded>
<StyledSettingsSelectGroup controlWidth={260}>
{AI_MODEL_TIERS.map((tier, index) => (
<SettingsOptionCardContentSelect
@@ -232,7 +232,7 @@ export const SettingsAdminAI = () => {
</SettingsOptionCardContentSelect>
))}
</StyledSettingsSelectGroup>
- </Card>
+ </Card.Root>
</Section.Root>
)}
@@ -293,7 +293,7 @@ export const SettingsAdminAI = () => {
))}
</Table>
) : (
- <Card rounded>
+ <Card.Root rounded>
<TableRow gridTemplateColumns="1fr">
<TableCell
color={themeCssVariables.font.color.tertiary}
@@ -302,7 +302,7 @@ export const SettingsAdminAI = () => {
{t`No AI usage data recorded yet.`}
</TableCell>
</TableRow>
- </Card>
+ </Card.Root>
)
) : (
<SettingsEnterpriseFeatureGateCard
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminChatThreadMessageList.tsx b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminChatThreadMessageList.tsx
index 18d194fdbde..fc2b78b2528 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminChatThreadMessageList.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminChatThreadMessageList.tsx
@@ -34,7 +34,7 @@ export const SettingsAdminChatThreadMessageList = ({
if (!isNonEmptyArray(visibleMessages)) {
return (
- <Card rounded>
+ <Card.Root rounded>
<TableRow gridTemplateColumns="1fr">
<TableCell
color={themeCssVariables.font.color.tertiary}
@@ -43,7 +43,7 @@ export const SettingsAdminChatThreadMessageList = ({
{t`No messages found.`}
</TableCell>
</TableRow>
- </Card>
+ </Card.Root>
);
}
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkspacesByHealthAccordion.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkspacesByHealthAccordion.tsx
index 6877adefdce..cec204d2571 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkspacesByHealthAccordion.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkspacesByHealthAccordion.tsx
@@ -82,7 +82,7 @@ export const SettingsAdminWorkspacesByHealthAccordion = ({
const hasWorkspaces = workspaces.length > 0;
return (
- <Card rounded={true}>
+ <Card.Root rounded={true}>
{hasWorkspaces ? (
<StyledAccordionHeaderButton
onClick={() => setIsExpanded((currentValue) => !currentValue)}
@@ -125,6 +125,6 @@ export const SettingsAdminWorkspacesByHealthAccordion = ({
</StyledAccordionContent>
</AnimatedExpandableContainer>
)}
- </Card>
+ </Card.Root>
);
};
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/maintenance-mode/components/SettingsAdminMaintenanceMode.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/maintenance-mode/components/SettingsAdminMaintenanceMode.tsx
index 5d4f0b3ab65..6cb16f12b64 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/health-status/maintenance-mode/components/SettingsAdminMaintenanceMode.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/maintenance-mode/components/SettingsAdminMaintenanceMode.tsx
@@ -20,7 +20,7 @@ import { isDefined } from 'twenty-shared/utils';
import { Section, useToast } from 'twenty-ui/components';
import { IconLink, IconTool } from 'twenty-ui/icon';
import { Status } from 'twenty-ui/primitives/data-display';
-import { Card, CardContent } from 'twenty-ui/primitives/surfaces';
+import { Card } from 'twenty-ui/primitives/surfaces';
import { themeCssVariables } from 'twenty-ui/theme';
const StyledFormContainer = styled.div`
@@ -194,7 +194,7 @@ export const SettingsAdminMaintenanceMode = () => {
title={t`Maintenance`}
description={t`Schedule a maintenance window and notify all users`}
/>
- <Card rounded>
+ <Card.Root rounded>
<SettingsOptionCardContentSwitch
Icon={IconTool}
title={t`Maintenance mode`}
@@ -203,7 +203,7 @@ export const SettingsAdminMaintenanceMode = () => {
onChange={handleToggle}
/>
{isEnabled && (
- <CardContent>
+ <Card.Content>
<StyledFormContainer>
<SettingsDatePickerInput
label={t`Start date`}
@@ -243,9 +243,9 @@ export const SettingsAdminMaintenanceMode = () => {
</StyledStatusRow>
)}
</StyledFormContainer>
- </CardContent>
+ </Card.Content>
)}
- </Card>
+ </Card.Root>
</Section.Root>
);
};
diff --git a/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationOverviewCard.tsx b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationOverviewCard.tsx
index de33fc9e1c1..4b38d2e8809 100644
--- a/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationOverviewCard.tsx
+++ b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationOverviewCard.tsx
@@ -9,7 +9,7 @@ import { MOBILE_VIEWPORT, themeCssVariables } from 'twenty-ui/theme';
const COVER_WIDTH_PX = 272;
const CARD_MIN_HEIGHT_PX = 150;
-const StyledCard = styled(Card)`
+const StyledCard = styled(Card.Root)`
display: flex;
min-height: ${CARD_MIN_HEIGHT_PX}px;
`;
diff --git a/packages/twenty-front/src/modules/settings/components/SettingsCard.tsx b/packages/twenty-front/src/modules/settings/components/SettingsCard.tsx
index 93d0b0d09f3..427d88ace2f 100644
--- a/packages/twenty-front/src/modules/settings/components/SettingsCard.tsx
+++ b/packages/twenty-front/src/modules/settings/components/SettingsCard.tsx
@@ -5,7 +5,7 @@ import { type ReactNode } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { IconChevronRight } from 'twenty-ui/icon';
import { Pill } from 'twenty-ui/primitives/data-display';
-import { Card, CardContent } from 'twenty-ui/primitives/surfaces';
+import { Card } from 'twenty-ui/primitives/surfaces';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
type SettingsCardProps = {
@@ -115,9 +115,13 @@ export const SettingsCard = ({
clickable={!!onClick}
className={className}
>
- <Card onClick={disabled ? undefined : onClick} rounded={true} fullWidth>
+ <Card.Root
+ onClick={disabled ? undefined : onClick}
+ rounded={true}
+ fullWidth
+ >
<StyledCardContentContainer>
- <CardContent>
+ <Card.Content>
<StyledHeader>
<StyledIconContainer disabled={disabled} iconColor={iconColor}>
{Icon}
@@ -134,9 +138,9 @@ export const SettingsCard = ({
{description && (
<StyledDescription>{description}</StyledDescription>
)}
- </CardContent>
+ </Card.Content>
</StyledCardContentContainer>
- </Card>
+ </Card.Root>
</StyledCardWrapper>
);
};
diff --git a/packages/twenty-front/src/modules/settings/components/SettingsDiscoveryHeroCard.tsx b/packages/twenty-front/src/modules/settings/components/SettingsDiscoveryHeroCard.tsx
index c21adf2efaa..008bd8406a8 100644
--- a/packages/twenty-front/src/modules/settings/components/SettingsDiscoveryHeroCard.tsx
+++ b/packages/twenty-front/src/modules/settings/components/SettingsDiscoveryHeroCard.tsx
@@ -72,7 +72,7 @@ export const SettingsDiscoveryHeroCard = ({
return (
<>
- <Card rounded>
+ <Card.Root rounded>
<StyledCoverContainer coverHeight={coverHeight}>
<StyledImage src={src} alt="" aria-hidden />
{shouldDisplayVideo && (
@@ -87,7 +87,7 @@ export const SettingsDiscoveryHeroCard = ({
{footer !== undefined && footer !== null && (
<StyledFooter>{footer}</StyledFooter>
)}
- </Card>
+ </Card.Root>
{shouldDisplayVideo && (
<SettingsCustomizeVideoModal
modalInstanceId={modalInstanceId}
diff --git a/packages/twenty-front/src/modules/settings/components/SettingsEnterpriseFeatureGateCard.tsx b/packages/twenty-front/src/modules/settings/components/SettingsEnterpriseFeatureGateCard.tsx
index c77e623967b..930b443324f 100644
--- a/packages/twenty-front/src/modules/settings/components/SettingsEnterpriseFeatureGateCard.tsx
+++ b/packages/twenty-front/src/modules/settings/components/SettingsEnterpriseFeatureGateCard.tsx
@@ -29,7 +29,7 @@ export const SettingsEnterpriseFeatureGateCard = ({
: SettingsPath.AdminPanelOrganization;
return (
- <Card rounded>
+ <Card.Root rounded>
<SettingsOptionCardContentButton
Icon={IconLock}
title={title}
@@ -48,6 +48,6 @@ export const SettingsEnterpriseFeatureGateCard = ({
) : undefined
}
/>
- </Card>
+ </Card.Root>
);
};
diff --git a/packages/twenty-front/src/modules/settings/components/SettingsListCard.tsx b/packages/twenty-front/src/modules/settings/components/SettingsListCard.tsx
index 1446fd5ffa0..74ab2f90e64 100644
--- a/packages/twenty-front/src/modules/settings/components/SettingsListCard.tsx
+++ b/packages/twenty-front/src/modules/settings/components/SettingsListCard.tsx
@@ -4,7 +4,7 @@ import { type ComponentType } from 'react';
import { SettingsListSkeletonCard } from '@/settings/components/SettingsListSkeletonCard';
import { type IconComponent, IconPlus } from 'twenty-ui/icon';
-import { Card, CardFooter } from 'twenty-ui/primitives/surfaces';
+import { Card } from 'twenty-ui/primitives/surfaces';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
import { SettingsListItemCardContent } from './SettingsListItemCardContent';
@@ -78,7 +78,7 @@ export const SettingsListCard = <
if (isLoading === true) return <SettingsListSkeletonCard />;
return (
- <Card rounded={rounded}>
+ <Card.Root rounded={rounded}>
{items.map((item, index) => (
<SettingsListItemCardContent
key={item.id}
@@ -94,14 +94,14 @@ export const SettingsListCard = <
))}
{hasFooter && (
<StyledFooterContainer>
- <CardFooter divider={!!items.length}>
+ <Card.Footer divider={!!items.length}>
<StyledButton onClick={onFooterButtonClick}>
<IconPlus size={theme.icon.size.md} />
{footerButtonLabel}
</StyledButton>
- </CardFooter>
+ </Card.Footer>
</StyledFooterContainer>
)}
- </Card>
+ </Card.Root>
);
};
diff --git a/packages/twenty-front/src/modules/settings/components/SettingsListItemCardContent.tsx b/packages/twenty-front/src/modules/settings/components/SettingsListItemCardContent.tsx
index d0d8ac6a9d1..56b6bc397fa 100644
--- a/packages/twenty-front/src/modules/settings/components/SettingsListItemCardContent.tsx
+++ b/packages/twenty-front/src/modules/settings/components/SettingsListItemCardContent.tsx
@@ -3,7 +3,7 @@ import { type ReactNode } from 'react';
import { Link } from 'react-router-dom';
import { isDefined } from 'twenty-shared/utils';
import { IconChevronRight, type IconComponent } from 'twenty-ui/icon';
-import { CardContent } from 'twenty-ui/primitives/surfaces';
+import { Card } from 'twenty-ui/primitives/surfaces';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
const StyledRowContainer = styled.div`
@@ -95,7 +95,7 @@ export const SettingsListItemCardContent = ({
const content = (
<StyledRowContainer>
- <CardContent
+ <Card.Content
onClick={onClick}
divider={divider}
isClickable={isInteractive}
@@ -122,7 +122,7 @@ export const SettingsListItemCardContent = ({
/>
)}
</StyledRightContainer>
- </CardContent>
+ </Card.Content>
</StyledRowContainer>
);
diff --git a/packages/twenty-front/src/modules/settings/components/SettingsListSkeletonCard.tsx b/packages/twenty-front/src/modules/settings/components/SettingsListSkeletonCard.tsx
index 0f504d9e83d..916a72ff092 100644
--- a/packages/twenty-front/src/modules/settings/components/SettingsListSkeletonCard.tsx
+++ b/packages/twenty-front/src/modules/settings/components/SettingsListSkeletonCard.tsx
@@ -13,6 +13,6 @@ const StyledCardContainer = styled.div`
export const SettingsListSkeletonCard = () => (
<StyledCardContainer>
- <Card />
+ <Card.Root />
</StyledCardContainer>
);
diff --git a/packages/twenty-front/src/modules/settings/components/SettingsRadioCard.tsx b/packages/twenty-front/src/modules/settings/components/SettingsRadioCard.tsx
index 2a574dfcd7f..59ad37cde7b 100644
--- a/packages/twenty-front/src/modules/settings/components/SettingsRadioCard.tsx
+++ b/packages/twenty-front/src/modules/settings/components/SettingsRadioCard.tsx
@@ -1,7 +1,7 @@
import { styled } from '@linaria/react';
import { isNonEmptyString } from '@sniptt/guards';
import { useId } from 'react';
-import { CardContent } from 'twenty-ui/primitives/surfaces';
+import { Card } from 'twenty-ui/primitives/surfaces';
import { type IconComponent } from 'twenty-ui/icon';
import { Radio } from 'twenty-ui/primitives/input';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
@@ -61,7 +61,7 @@ export const SettingsRadioCard = ({
return (
<StyledRadioCardContentContainer>
- <CardContent>
+ <Card.Content>
{Icon && <Icon size={theme.icon.size.xl} color={theme.color.gray10} />}
<span>
{title && <StyledTitle id={titleId}>{title}</StyledTitle>}
@@ -78,7 +78,7 @@ export const SettingsRadioCard = ({
aria-describedby={hasDescription ? descriptionId : undefined}
/>
</StyledRadioContainer>
- </CardContent>
+ </Card.Content>
</StyledRadioCardContentContainer>
);
};
diff --git a/packages/twenty-front/src/modules/settings/components/SettingsRadioSettingsCard.tsx b/packages/twenty-front/src/modules/settings/components/SettingsRadioSettingsCard.tsx
index 6e81faa1c5e..f6256a0b21a 100644
--- a/packages/twenty-front/src/modules/settings/components/SettingsRadioSettingsCard.tsx
+++ b/packages/twenty-front/src/modules/settings/components/SettingsRadioSettingsCard.tsx
@@ -4,7 +4,7 @@ import { useLingui } from '@lingui/react/macro';
import { type ReactNode, useId } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { Radio, RadioGroup } from 'twenty-ui/primitives/input';
-import { Card, CardContent } from 'twenty-ui/primitives/surfaces';
+import { Card } from 'twenty-ui/primitives/surfaces';
import { themeCssVariables } from 'twenty-ui/theme';
type SettingsRadioSettingsCardProps<Option extends { value: string }> = {
@@ -87,13 +87,13 @@ export const SettingsRadioSettingsCard = <
}
}}
>
- <Card fullWidth rounded>
+ <Card.Root fullWidth rounded>
{options.map((option, index) => {
const isSelected = value === option.value;
return (
<StyledCardContentContainer key={option.value}>
- <CardContent divider={index < options.length - 1}>
+ <Card.Content divider={index < options.length - 1}>
<StyledOptionHeader>
{option.cardMedia}
<StyledTextContainer>
@@ -117,11 +117,11 @@ export const SettingsRadioSettingsCard = <
{option.cardContentExpanded}
</StyledExpandedContent>
)}
- </CardContent>
+ </Card.Content>
</StyledCardContentContainer>
);
})}
- </Card>
+ </Card.Root>
</RadioGroup>
);
};
diff --git a/packages/twenty-front/src/modules/settings/components/SettingsTableCard.tsx b/packages/twenty-front/src/modules/settings/components/SettingsTableCard.tsx
index a39df6e55df..fa576aef4cd 100644
--- a/packages/twenty-front/src/modules/settings/components/SettingsTableCard.tsx
+++ b/packages/twenty-front/src/modules/settings/components/SettingsTableCard.tsx
@@ -33,7 +33,7 @@ export const SettingsTableCard = ({
}: SettingsTableCardProps) => {
const theme = useTheme();
return (
- <Card
+ <Card.Root
rounded={rounded}
className={className}
backgroundColor={themeCssVariables.background.secondary}
@@ -61,6 +61,6 @@ export const SettingsTableCard = ({
</TableRow>
))}
</Table>
- </Card>
+ </Card.Root>
);
};
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 98c9c182c2e..619e7b6ef9b 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
@@ -3,7 +3,7 @@ import { type ReactNode } from 'react';
import { StyledFormCardTitle } from '@/settings/data-model/fields/components/StyledFormCardTitle';
import { Trans } from '@lingui/react/macro';
-import { Card, CardContent } from 'twenty-ui/primitives/surfaces';
+import { Card } from 'twenty-ui/primitives/surfaces';
import { isDefined } from 'twenty-shared/utils';
import { themeCssVariables } from 'twenty-ui/theme';
@@ -31,19 +31,19 @@ export const SettingsDataModelPreviewFormCard = ({
preview,
form,
}: SettingsDataModelPreviewFormCardProps) => (
- <Card className={className} fullWidth rounded>
+ <Card.Root className={className} fullWidth rounded>
<StyledPreviewContainerWrapper>
- <CardContent divider={isDefined(form)}>
+ <Card.Content divider={isDefined(form)}>
<StyledFormCardTitle>
<Trans>Preview</Trans>
</StyledFormCardTitle>
{preview}
- </CardContent>
+ </Card.Content>
</StyledPreviewContainerWrapper>
{isDefined(form) && (
<StyledFormContainerWrapper>
- <CardContent>{form}</CardContent>
+ <Card.Content>{form}</Card.Content>
</StyledFormContainerWrapper>
)}
- </Card>
+ </Card.Root>
);
diff --git a/packages/twenty-front/src/modules/settings/data-model/fields/forms/components/SettingsDataModelFieldIconLabelForm.tsx b/packages/twenty-front/src/modules/settings/data-model/fields/forms/components/SettingsDataModelFieldIconLabelForm.tsx
index 3dcade83002..00fed193f41 100644
--- a/packages/twenty-front/src/modules/settings/data-model/fields/forms/components/SettingsDataModelFieldIconLabelForm.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/fields/forms/components/SettingsDataModelFieldIconLabelForm.tsx
@@ -17,7 +17,7 @@ import { useLingui } from '@lingui/react/macro';
import { FieldMetadataType } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { IconInfoCircle, IconRefresh } from 'twenty-ui/icon';
-import { Tooltip, Card } from 'twenty-ui/primitives/surfaces';
+import { Card, Tooltip } from 'twenty-ui/primitives/surfaces';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
import { computeMetadataNameFromLabel } from '~/pages/settings/data-model/utils/computeMetadataNameFromLabel';
@@ -237,7 +237,7 @@ export const SettingsDataModelFieldIconLabelForm = ({
hideDot={false}
dotPosition="centered"
>
- <Card rounded>
+ <Card.Root rounded>
<SettingsOptionCardContentSwitch
Icon={IconRefresh}
title={t`Synchronize Field Label and API Name`}
@@ -261,7 +261,7 @@ export const SettingsDataModelFieldIconLabelForm = ({
}
}}
/>
- </Card>
+ </Card.Root>
</AdvancedSettingsContentWrapperWithDot>
)}
/>
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 03b08311bfc..0bf50e8ae8d 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
@@ -43,7 +43,7 @@ import {
IconTrash,
} from 'twenty-ui/icon';
-import { CardContent, CardFooter } from 'twenty-ui/primitives/surfaces';
+import { Card } from 'twenty-ui/primitives/surfaces';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
import { SettingsDataModelFieldSelectFormOptionRow } from './SettingsDataModelFieldSelectFormOptionRow';
@@ -335,7 +335,7 @@ export const SettingsDataModelFieldSelectForm = ({
render={({ field: { onChange, value: options } }) => (
<>
<StyledContainerWrapper>
- <CardContent>
+ <Card.Content>
<StyledOptionsHeaderContainer>
<StyledLabelContainer>
{!isBulkInputMode && (
@@ -523,18 +523,18 @@ export const SettingsDataModelFieldSelectForm = ({
/>
</>
)}
- </CardContent>
+ </Card.Content>
</StyledContainerWrapper>
{!disabled && !isBulkInputMode && (
<StyledFooterContainer>
- <CardFooter>
+ <Card.Footer>
<StyledButtonContainer>
<LightButton
startIcon={<IconPlus />}
onClick={handleAddOption}
>{t`Add option`}</LightButton>
</StyledButtonContainer>
- </CardFooter>
+ </Card.Footer>
</StyledFooterContainer>
)}
</>
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 d7ed3be5154..8c104b52f23 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
@@ -4,7 +4,7 @@ import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadata
import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
import { SettingsDataModelFieldPreview } from '@/settings/data-model/fields/preview/components/SettingsDataModelFieldPreview';
import { SettingsDataModelObjectPreview } from '@/settings/data-model/objects/components/SettingsDataModelObjectSummary';
-import { Card, CardContent } from 'twenty-ui/primitives/surfaces';
+import { Card } from 'twenty-ui/primitives/surfaces';
import { themeCssVariables } from 'twenty-ui/theme';
import { computeMetadataNameFromLabel } from '~/pages/settings/data-model/utils/computeMetadataNameFromLabel';
@@ -48,9 +48,9 @@ export const SettingsDataModelFieldPreviewWidget = ({
return (
<StyledCardContainer className={className}>
- <Card fullWidth>
+ <Card.Root fullWidth>
<StyledCardContentContainer>
- <CardContent>
+ <Card.Content>
<SettingsDataModelObjectPreview
objectMetadataItems={[objectMetadataItem]}
pluralizeLabel={pluralizeLabel}
@@ -69,9 +69,9 @@ export const SettingsDataModelFieldPreviewWidget = ({
shrink={shrink}
withFieldLabel={withFieldLabel}
/>
- </CardContent>
+ </Card.Content>
</StyledCardContentContainer>
- </Card>
+ </Card.Root>
</StyledCardContainer>
);
};
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 a7235c19532..2c82c861a87 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
@@ -5,7 +5,7 @@ import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataIte
import { SettingsDataModelRelationFieldPreview } from '@/settings/data-model/fields/preview/components/SettingsDataModelRelationFieldPreview';
import { SettingsDataModelObjectPreview } from '@/settings/data-model/objects/components/SettingsDataModelObjectSummary';
import { isDefined } from 'twenty-shared/utils';
-import { Card, CardContent } from 'twenty-ui/primitives/surfaces';
+import { Card } from 'twenty-ui/primitives/surfaces';
import { themeCssVariables } from 'twenty-ui/theme';
export type SettingsDataModelRelationFieldPreviewSubWidgetProps = {
@@ -57,9 +57,9 @@ export const SettingsDataModelRelationFieldPreviewSubWidget = ({
return (
<StyledCardContainer className={className}>
- <Card fullWidth>
+ <Card.Root fullWidth>
<StyledCardContentContainer>
- <CardContent>
+ <Card.Content>
<SettingsDataModelObjectPreview
objectMetadataItems={targetObjectMetadataItems}
pluralizeLabel={pluralizeLabel}
@@ -72,9 +72,9 @@ export const SettingsDataModelRelationFieldPreviewSubWidget = ({
shrink={shrink}
withFieldLabel={withFieldLabel}
/>
- </CardContent>
+ </Card.Content>
</StyledCardContentContainer>
- </Card>
+ </Card.Root>
</StyledCardContainer>
);
};
diff --git a/packages/twenty-front/src/modules/settings/data-model/object-details/components/tabs/SettingsObjectSearchSection.tsx b/packages/twenty-front/src/modules/settings/data-model/object-details/components/tabs/SettingsObjectSearchSection.tsx
index 8b3e6f67540..1fa224f2eec 100644
--- a/packages/twenty-front/src/modules/settings/data-model/object-details/components/tabs/SettingsObjectSearchSection.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/object-details/components/tabs/SettingsObjectSearchSection.tsx
@@ -185,7 +185,7 @@ export const SettingsObjectSearchSection = ({
return (
<StyledSearchSectionContent>
{!isReadOnly && (
- <Card rounded>
+ <Card.Root rounded>
<SettingsOptionCardContentSwitch
Icon={IconEye}
title={t`Global search`}
@@ -194,7 +194,7 @@ export const SettingsObjectSearchSection = ({
advancedMode
onChange={handleToggleSearchable}
/>
- </Card>
+ </Card.Root>
)}
{searchFields.length > 0 && (
<>
diff --git a/packages/twenty-front/src/modules/settings/data-model/objects/forms/components/SettingsDataModelObjectAboutForm.tsx b/packages/twenty-front/src/modules/settings/data-model/objects/forms/components/SettingsDataModelObjectAboutForm.tsx
index ca33d490a69..608c745bf8e 100644
--- a/packages/twenty-front/src/modules/settings/data-model/objects/forms/components/SettingsDataModelObjectAboutForm.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/objects/forms/components/SettingsDataModelObjectAboutForm.tsx
@@ -368,7 +368,7 @@ export const SettingsDataModelObjectAboutForm = ({
control={control}
defaultValue={objectMetadataItem?.isLabelSyncedWithName}
render={({ field: { onChange, value } }) => (
- <Card rounded>
+ <Card.Root rounded>
<SettingsOptionCardContentSwitch
Icon={IconRefresh}
title={t`Synchronize Objects Labels and API Names`}
@@ -392,7 +392,7 @@ export const SettingsDataModelObjectAboutForm = ({
onNewDirtyField?.();
}}
/>
- </Card>
+ </Card.Root>
)}
/>
</AdvancedSettingsWrapper>
@@ -404,7 +404,7 @@ export const SettingsDataModelObjectAboutForm = ({
control={control}
defaultValue={false}
render={({ field: { onChange, value } }) => (
- <Card rounded>
+ <Card.Root rounded>
<SettingsOptionCardContentSwitch
Icon={IconLink}
title={t`Skip creating a Name field `}
@@ -417,7 +417,7 @@ export const SettingsDataModelObjectAboutForm = ({
onNewDirtyField?.();
}}
/>
- </Card>
+ </Card.Root>
)}
/>
</AdvancedSettingsWrapper>
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 0c43d28836f..5d0fac8081f 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
@@ -8,7 +8,7 @@ import { SettingsDataModelFieldPreviewWidget } from '@/settings/data-model/field
import { SettingsDataModelObjectPreview } from '@/settings/data-model/objects/components/SettingsDataModelObjectSummary';
import { SettingsDataModelObjectIdentifiersForm } from '@/settings/data-model/objects/forms/components/SettingsDataModelObjectIdentifiersForm';
import { Trans } from '@lingui/react/macro';
-import { Card, CardContent } from 'twenty-ui/primitives/surfaces';
+import { Card } from 'twenty-ui/primitives/surfaces';
import { themeCssVariables } from 'twenty-ui/theme';
type SettingsDataModelObjectSettingsFormCardProps = {
@@ -48,9 +48,9 @@ export const SettingsDataModelObjectSettingsFormCard = ({
}, [objectMetadataItem]);
return (
- <Card fullWidth>
+ <Card.Root fullWidth>
<StyledTopCardContentContainer>
- <CardContent divider>
+ <Card.Content divider>
<SettingsDataModelCardTitle>
<Trans>Preview</Trans>
</SettingsDataModelCardTitle>
@@ -62,24 +62,24 @@ export const SettingsDataModelObjectSettingsFormCard = ({
/>
) : (
<StyledObjectSummaryCardContainer>
- <Card>
+ <Card.Root>
<StyledObjectSummaryCardContentContainer>
- <CardContent>
+ <Card.Content>
<SettingsDataModelObjectPreview
objectMetadataItems={[objectMetadataItem]}
/>
- </CardContent>
+ </Card.Content>
</StyledObjectSummaryCardContentContainer>
- </Card>
+ </Card.Root>
</StyledObjectSummaryCardContainer>
)}
- </CardContent>
+ </Card.Content>
</StyledTopCardContentContainer>
- <CardContent>
+ <Card.Content>
<SettingsDataModelObjectIdentifiersForm
objectMetadataItem={objectMetadataItem}
/>
- </CardContent>
- </Card>
+ </Card.Content>
+ </Card.Root>
);
};
diff --git a/packages/twenty-front/src/modules/settings/event-logs/components/SettingsLogs.tsx b/packages/twenty-front/src/modules/settings/event-logs/components/SettingsLogs.tsx
index 75702862b73..89ee7313f07 100644
--- a/packages/twenty-front/src/modules/settings/event-logs/components/SettingsLogs.tsx
+++ b/packages/twenty-front/src/modules/settings/event-logs/components/SettingsLogs.tsx
@@ -165,7 +165,7 @@ export const SettingsLogs = () => {
};
const renderUpgradeCard = () => (
- <Card rounded backgroundColor={themeCssVariables.background.secondary}>
+ <Card.Root rounded backgroundColor={themeCssVariables.background.secondary}>
<SettingsOptionCardContentButton
Icon={IconLock}
title={t`Upgrade to access audit logs`}
@@ -186,7 +186,7 @@ export const SettingsLogs = () => {
>{t`Upgrade`}</Button>
}
/>
- </Card>
+ </Card.Root>
);
const renderResults = () => {
@@ -232,7 +232,7 @@ export const SettingsLogs = () => {
return (
<StyledRoot>
- <Card
+ <Card.Root
rounded
fullWidth
backgroundColor={themeCssVariables.background.secondary}
@@ -262,7 +262,7 @@ export const SettingsLogs = () => {
onChange={handleFiltersChange}
/>
</StyledCardContent>
- </Card>
+ </Card.Root>
{renderResults()}
</StyledRoot>
diff --git a/packages/twenty-front/src/modules/settings/lab/components/SettingsLabContent.tsx b/packages/twenty-front/src/modules/settings/lab/components/SettingsLabContent.tsx
index fcad3f56c83..2ab1e781b8e 100644
--- a/packages/twenty-front/src/modules/settings/lab/components/SettingsLabContent.tsx
+++ b/packages/twenty-front/src/modules/settings/lab/components/SettingsLabContent.tsx
@@ -52,7 +52,7 @@ export const SettingsLabContent = () => {
currentWorkspace?.id && (
<StyledCardGrid>
{labPublicFeatureFlagsWithImage.map((flag) => (
- <Card
+ <Card.Root
key={flag.key}
rounded
backgroundColor={themeCssVariables.background.secondary}
@@ -72,11 +72,11 @@ export const SettingsLabContent = () => {
onChange={(value) => handleToggle(flag.key, value)}
switchCentered={false}
/>
- </Card>
+ </Card.Root>
))}
{labPublicFeatureFlagsWithoutImage.length > 0 && (
- <Card
+ <Card.Root
rounded
backgroundColor={themeCssVariables.background.secondary}
>
@@ -92,7 +92,7 @@ export const SettingsLabContent = () => {
divider={index < labPublicFeatureFlagsWithoutImage.length - 1}
/>
))}
- </Card>
+ </Card.Root>
)}
</StyledCardGrid>
)
diff --git a/packages/twenty-front/src/modules/settings/logic-functions/components/SettingsLogicFunctionNewForm.tsx b/packages/twenty-front/src/modules/settings/logic-functions/components/SettingsLogicFunctionNewForm.tsx
index 880affe0ad5..d3569d80ba3 100644
--- a/packages/twenty-front/src/modules/settings/logic-functions/components/SettingsLogicFunctionNewForm.tsx
+++ b/packages/twenty-front/src/modules/settings/logic-functions/components/SettingsLogicFunctionNewForm.tsx
@@ -54,7 +54,7 @@ export const SettingsLogicFunctionNewForm = ({
onChange={onChange('description')}
readOnly={readonly}
/>
- <Card rounded>
+ <Card.Root rounded>
<SettingsOptionCardContentCounter
Icon={IconClockHour8}
title={t`Timeout`}
@@ -65,7 +65,7 @@ export const SettingsLogicFunctionNewForm = ({
maxValue={900}
disabled={readonly}
/>
- </Card>
+ </Card.Root>
</StyledInputsContainer>
</Section.Root>
);
diff --git a/packages/twenty-front/src/modules/settings/mcp-and-apis/components/SettingsMcpSetupCard.tsx b/packages/twenty-front/src/modules/settings/mcp-and-apis/components/SettingsMcpSetupCard.tsx
index 826c4127cd8..81687fa6f8d 100644
--- a/packages/twenty-front/src/modules/settings/mcp-and-apis/components/SettingsMcpSetupCard.tsx
+++ b/packages/twenty-front/src/modules/settings/mcp-and-apis/components/SettingsMcpSetupCard.tsx
@@ -5,10 +5,10 @@ import { type McpSetupCard } from '@/settings/mcp-and-apis/types/McpSetup';
import { TooltipDelay } from '@/ui/layout/tooltip/constants/TooltipDelay';
import { IconExternalLink } from 'twenty-ui/icon';
import { Pill } from 'twenty-ui/primitives/data-display';
-import { Card, CardContent, Tooltip } from 'twenty-ui/primitives/surfaces';
+import { Card, Tooltip } from 'twenty-ui/primitives/surfaces';
import { themeCssVariables, useTheme } from 'twenty-ui/theme';
-const StyledCardContent = styled(CardContent)`
+const StyledCardContent = styled(Card.Content)`
align-items: center;
display: flex;
gap: ${themeCssVariables.spacing[4]};
@@ -145,7 +145,7 @@ type SettingsMcpSetupCardProps = {
};
export const SettingsMcpSetupCard = ({ card }: SettingsMcpSetupCardProps) => (
- <Card rounded>
+ <Card.Root rounded>
<StyledCardContent>
<StyledLogo aria-hidden>{card.logo}</StyledLogo>
<StyledBody>
@@ -159,5 +159,5 @@ export const SettingsMcpSetupCard = ({ card }: SettingsMcpSetupCardProps) => (
<StyledDescription>{card.description}</StyledDescription>
</StyledBody>
</StyledCardContent>
- </Card>
+ </Card.Root>
);
diff --git a/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesDefaultRole.tsx b/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesDefaultRole.tsx
index 3b8b4b93807..fa4e1586c76 100644
--- a/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesDefaultRole.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/components/SettingsRolesDefaultRole.tsx
@@ -75,7 +75,7 @@ export const SettingsRoleDefaultRole = ({
title={t`Default Role`}
description={t`Assigned to users who join via invite link, approved domain, or SSO, and used as fallback when an assigned role is deleted`}
/>
- <Card rounded>
+ <Card.Root rounded>
<SettingsOptionCardContentSelect
Icon={IconUserPin}
title={t`Default Role`}
@@ -92,7 +92,7 @@ export const SettingsRoleDefaultRole = ({
}
/>
</SettingsOptionCardContentSelect>
- </Card>
+ </Card.Root>
</Section.Root>
);
};
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 fbfcd8df6b2..babed213312 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
@@ -50,7 +50,7 @@ export const SettingsRolePermissionsObjectLevelRecordLevelSection = ({
adornment={<OrganizationAdornment />}
/>
<StyledCardContainer>
- <Card rounded>
+ <Card.Root rounded>
<SettingsOptionCardContentButton
Icon={IconLock}
title={t`Upgrade to access`}
@@ -71,7 +71,7 @@ export const SettingsRolePermissionsObjectLevelRecordLevelSection = ({
>{t`Upgrade`}</Button>
}
/>
- </Card>
+ </Card.Root>
</StyledCardContainer>
</Section.Root>
);
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 c8b0b062d80..f1eb585e126 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
@@ -69,7 +69,7 @@ export const SettingsRolePermissionsSettingsSection = ({
<Section.Header title={t`Layout`} description={t`Layout permissions`} />
{shouldShowAllAccessToggle && (
<StyledCardContainer>
- <Card rounded>
+ <Card.Root rounded>
<SettingsOptionCardContentSwitch
Icon={IconSettings}
title={t`Layout All Access`}
@@ -83,7 +83,7 @@ export const SettingsRolePermissionsSettingsSection = ({
});
}}
/>
- </Card>
+ </Card.Root>
</StyledCardContainer>
)}
<AnimatedExpandableContainer
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 abe3dde8153..58475343b31 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
@@ -68,7 +68,7 @@ export const SettingsRolePermissionsToolSection = ({
<Section.Header title={t`Logic`} description={t`Logic permissions`} />
{shouldShowAllAccessToggle && (
<StyledCardContainer>
- <Card rounded>
+ <Card.Root rounded>
<SettingsOptionCardContentSwitch
Icon={IconTool}
title={t`Logic All Access`}
@@ -82,7 +82,7 @@ export const SettingsRolePermissionsToolSection = ({
});
}}
/>
- </Card>
+ </Card.Root>
</StyledCardContainer>
)}
<AnimatedExpandableContainer
diff --git a/packages/twenty-front/src/modules/settings/security/components/SettingsSecurityAuthBypassOptionsList.tsx b/packages/twenty-front/src/modules/settings/security/components/SettingsSecurityAuthBypassOptionsList.tsx
index 7d202618d1a..4d4d7c0321f 100644
--- a/packages/twenty-front/src/modules/settings/security/components/SettingsSecurityAuthBypassOptionsList.tsx
+++ b/packages/twenty-front/src/modules/settings/security/components/SettingsSecurityAuthBypassOptionsList.tsx
@@ -82,7 +82,7 @@ export const SettingsSecurityAuthBypassOptionsList = () => {
return (
<StyledSettingsSecurityOptionsList>
- <Card rounded>
+ <Card.Root rounded>
{authProviders.google === true && (
<SettingsOptionCardContentSwitch
Icon={IconGoogle}
@@ -115,7 +115,7 @@ export const SettingsSecurityAuthBypassOptionsList = () => {
onChange={() => toggleAuthBypassMethod('password')}
/>
)}
- </Card>
+ </Card.Root>
</StyledSettingsSecurityOptionsList>
);
};
diff --git a/packages/twenty-front/src/modules/settings/security/components/SettingsSecurityAuthProvidersOptionsList.tsx b/packages/twenty-front/src/modules/settings/security/components/SettingsSecurityAuthProvidersOptionsList.tsx
index 427ad9b7872..bb46c2a777d 100644
--- a/packages/twenty-front/src/modules/settings/security/components/SettingsSecurityAuthProvidersOptionsList.tsx
+++ b/packages/twenty-front/src/modules/settings/security/components/SettingsSecurityAuthProvidersOptionsList.tsx
@@ -197,7 +197,7 @@ export const SettingsSecurityAuthProvidersOptionsList = () => {
<StyledSettingsSecurityOptionsList>
{currentWorkspace && (
<>
- <Card rounded>
+ <Card.Root rounded>
{authProviders.google === true && (
<SettingsOptionCardContentSwitch
Icon={IconGoogle}
@@ -234,8 +234,8 @@ export const SettingsSecurityAuthProvidersOptionsList = () => {
onChange={() => toggleAuthMethod('password')}
/>
)}
- </Card>
- <Card rounded>
+ </Card.Root>
+ <Card.Root rounded>
<SettingsOptionCardContentSwitch
Icon={IconLink}
title={t`Invite by Link`}
@@ -268,7 +268,7 @@ export const SettingsSecurityAuthProvidersOptionsList = () => {
</SettingsOptionCardContentSelect>
)}
<TwoFactorAuthenticationSwitch />
- </Card>
+ </Card.Root>
</>
)}
</StyledSettingsSecurityOptionsList>
diff --git a/packages/twenty-front/src/modules/settings/security/components/SettingsSecuritySettings.tsx b/packages/twenty-front/src/modules/settings/security/components/SettingsSecuritySettings.tsx
index 7a23be296ed..de55b11614d 100644
--- a/packages/twenty-front/src/modules/settings/security/components/SettingsSecuritySettings.tsx
+++ b/packages/twenty-front/src/modules/settings/security/components/SettingsSecuritySettings.tsx
@@ -204,7 +204,7 @@ export const SettingsSecuritySettings = () => {
adornment={<OrganizationAdornment />}
/>
{hasEnterpriseAccess ? (
- <Card rounded>
+ <Card.Root rounded>
{isEventLogsEnabled ? (
<SettingsOptionCardContentCounter
Icon={IconClockHour8}
@@ -223,7 +223,7 @@ export const SettingsSecuritySettings = () => {
description={t`ClickHouse is required for audit logs. Contact your administrator.`}
/>
)}
- </Card>
+ </Card.Root>
) : (
<SettingsEnterpriseFeatureGateCard
title={t`Organization feature`}
@@ -237,7 +237,7 @@ export const SettingsSecuritySettings = () => {
title={t`Other`}
description={t`Other security settings`}
/>
- <Card rounded>
+ <Card.Root rounded>
<SettingsOptionCardContentCounter
Icon={IconTrash}
title={t`Erasure of soft-deleted records`}
@@ -247,7 +247,7 @@ export const SettingsSecuritySettings = () => {
minValue={0}
showButtons={false}
/>
- </Card>
+ </Card.Root>
</Section.Root>
</StyledMainContent>
</>
diff --git a/packages/twenty-front/src/modules/settings/unsubscribers/components/SettingsUnsubscribePreview.tsx b/packages/twenty-front/src/modules/settings/unsubscribers/components/SettingsUnsubscribePreview.tsx
index e0cf1aa04eb..ef8d98fa41e 100644
--- a/packages/twenty-front/src/modules/settings/unsubscribers/components/SettingsUnsubscribePreview.tsx
+++ b/packages/twenty-front/src/modules/settings/unsubscribers/components/SettingsUnsubscribePreview.tsx
@@ -19,7 +19,7 @@ const StyledViewport = styled.div`
padding: ${themeCssVariables.spacing[10]} ${themeCssVariables.spacing[6]};
`;
-const StyledCard = styled(Card)`
+const StyledCard = styled(Card.Root)`
--card-background-color: ${themeCssVariables.background.primary};
display: flex;
diff --git a/packages/twenty-front/src/modules/settings/workspace/components/ImpersonationSwitch.tsx b/packages/twenty-front/src/modules/settings/workspace/components/ImpersonationSwitch.tsx
index a3caba381ba..7b5d6853aec 100644
--- a/packages/twenty-front/src/modules/settings/workspace/components/ImpersonationSwitch.tsx
+++ b/packages/twenty-front/src/modules/settings/workspace/components/ImpersonationSwitch.tsx
@@ -42,7 +42,7 @@ export const ImpersonationSwitch = () => {
};
return (
- <Card rounded>
+ <Card.Root rounded>
<SettingsOptionCardContentSwitch
Icon={IconLifebuoy}
title={t`Allow Support Team Access`}
@@ -51,6 +51,6 @@ export const ImpersonationSwitch = () => {
onChange={handleChange}
advancedMode
/>
- </Card>
+ </Card.Root>
);
};
diff --git a/packages/twenty-front/src/modules/settings/workspace/components/SettingsWorkspaceEmailSyncSection.tsx b/packages/twenty-front/src/modules/settings/workspace/components/SettingsWorkspaceEmailSyncSection.tsx
index 77c8a7535b2..8be78f6b74c 100644
--- a/packages/twenty-front/src/modules/settings/workspace/components/SettingsWorkspaceEmailSyncSection.tsx
+++ b/packages/twenty-front/src/modules/settings/workspace/components/SettingsWorkspaceEmailSyncSection.tsx
@@ -50,7 +50,7 @@ export const SettingsWorkspaceEmailSyncSection = () => {
title={t`Sync`}
description={t`Control what the workspace imports from connected mailboxes and calendars`}
/>
- <Card rounded>
+ <Card.Root rounded>
<SettingsOptionCardContentSwitch
Icon={IconMail}
title={t`Sync Internal Emails`}
@@ -59,7 +59,7 @@ export const SettingsWorkspaceEmailSyncSection = () => {
onChange={handleSyncInternalEmailsChange}
advancedMode
/>
- </Card>
+ </Card.Root>
</Section.Root>
);
};
diff --git a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminApplicationRegistrationGeneralSwitches.tsx b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminApplicationRegistrationGeneralSwitches.tsx
index ca390f47662..77ec3028f5a 100644
--- a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminApplicationRegistrationGeneralSwitches.tsx
+++ b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminApplicationRegistrationGeneralSwitches.tsx
@@ -33,7 +33,7 @@ export const SettingsAdminApplicationRegistrationGeneralSwitches = ({
<Section.Root>
<Section.Header title={t`Installation`} />
<StyledSwitchContainer>
- <Card rounded fullWidth>
+ <Card.Root rounded fullWidth>
<SettingsOptionCardContentSwitch
Icon={IconArrowBarToDown}
title={t`Allow installation`}
@@ -50,8 +50,8 @@ export const SettingsAdminApplicationRegistrationGeneralSwitches = ({
})
}
/>
- </Card>
- <Card rounded fullWidth>
+ </Card.Root>
+ <Card.Root rounded fullWidth>
<SettingsOptionCardContentSwitch
Icon={IconShield}
title={t`Vetted`}
@@ -68,8 +68,8 @@ export const SettingsAdminApplicationRegistrationGeneralSwitches = ({
})
}
/>
- </Card>
- <Card rounded fullWidth>
+ </Card.Root>
+ <Card.Root rounded fullWidth>
<SettingsOptionCardContentSwitch
Icon={IconPinned}
title={t`Pre-install on new workspaces`}
@@ -86,7 +86,7 @@ export const SettingsAdminApplicationRegistrationGeneralSwitches = ({
})
}
/>
- </Card>
+ </Card.Root>
</StyledSwitchContainer>
</Section.Root>
);
diff --git a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminWorkspaceDetail.tsx b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminWorkspaceDetail.tsx
index 4329a9ab821..86db8fd7ef9 100644
--- a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminWorkspaceDetail.tsx
+++ b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminWorkspaceDetail.tsx
@@ -455,7 +455,7 @@ export const SettingsAdminWorkspaceDetail = () => {
{isLoadingThreads ? (
<SettingsSectionSkeletonLoader />
) : threads.length === 0 ? (
- <Card rounded>
+ <Card.Root rounded>
<TableRow gridTemplateColumns="1fr">
<TableCell
color={themeCssVariables.font.color.tertiary}
@@ -464,7 +464,7 @@ export const SettingsAdminWorkspaceDetail = () => {
{t`No chat threads found.`}
</TableCell>
</TableRow>
- </Card>
+ </Card.Root>
) : (
<Table>
<TableRow gridTemplateColumns="1fr 120px 120px">
diff --git a/packages/twenty-front/src/pages/settings/ai/components/SettingsAiModelsTab.tsx b/packages/twenty-front/src/pages/settings/ai/components/SettingsAiModelsTab.tsx
index 8150e51fe11..11dd43c3e3a 100644
--- a/packages/twenty-front/src/pages/settings/ai/components/SettingsAiModelsTab.tsx
+++ b/packages/twenty-front/src/pages/settings/ai/components/SettingsAiModelsTab.tsx
@@ -53,7 +53,10 @@ export const SettingsAiModelsTab = () => {
title={t`Models`}
description={t`Choose the default modes for people and agents`}
/>
- <Card rounded backgroundColor={themeCssVariables.background.secondary}>
+ <Card.Root
+ rounded
+ backgroundColor={themeCssVariables.background.secondary}
+ >
<StyledSettingsSelectGroup controlWidth={160}>
<SettingsOptionCardContentSelect
Icon={IconMessage}
@@ -120,7 +123,7 @@ export const SettingsAiModelsTab = () => {
))}
</StyledSettingsSelectGroup>
)}
- </Card>
+ </Card.Root>
</Section.Root>
<SettingsAiModelTiersPreview />
diff --git a/packages/twenty-front/src/pages/settings/ai/components/SettingsSkillFormContent.tsx b/packages/twenty-front/src/pages/settings/ai/components/SettingsSkillFormContent.tsx
index 0487e5c3fde..eee42b02db0 100644
--- a/packages/twenty-front/src/pages/settings/ai/components/SettingsSkillFormContent.tsx
+++ b/packages/twenty-front/src/pages/settings/ai/components/SettingsSkillFormContent.tsx
@@ -5,7 +5,7 @@ import { SettingsPath } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { Section } from 'twenty-ui/components';
import { IconInfoCircle, IconRefresh, useIcons } from 'twenty-ui/icon';
-import { Tooltip, Card } from 'twenty-ui/primitives/surfaces';
+import { Card, Tooltip } from 'twenty-ui/primitives/surfaces';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
import { FormAdvancedTextFieldInput } from '@/advanced-text-editor/components/FormAdvancedTextFieldInput';
@@ -249,7 +249,7 @@ export const SettingsSkillFormContent = ({
)
}
/>
- <Card rounded>
+ <Card.Root rounded>
<SettingsOptionCardContentSwitch
Icon={IconRefresh}
title={t`Synchronize Label and API Name`}
@@ -261,7 +261,7 @@ export const SettingsSkillFormContent = ({
handleFieldChange('isLabelSyncedWithName', value)
}
/>
- </Card>
+ </Card.Root>
</StyledAdvancedSettingsContainer>
</StyledAdvancedSettingsOuterContainer>
</AdvancedSettingsWrapper>
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 6c23609eb74..f120c858198 100644
--- a/packages/twenty-front/src/pages/settings/applications/components/SettingsAvailableApplicationCard.tsx
+++ b/packages/twenty-front/src/pages/settings/applications/components/SettingsAvailableApplicationCard.tsx
@@ -58,7 +58,7 @@ export const SettingsAvailableApplicationCard = ({
availableApplicationId: application.id,
})}
>
- <Card rounded fullWidth>
+ <Card.Root rounded fullWidth>
<StyledSettingsCardContent alignItems="flex-start" fullHeight>
<Avatar
src={getAbsoluteImageUrl(application.logoUrl || null)}
@@ -77,7 +77,7 @@ export const SettingsAvailableApplicationCard = ({
</StyledSettingsCardThirdLine>
</div>
</StyledSettingsCardContent>
- </Card>
+ </Card.Root>
</Link>
</StyledLinkContainer>
);
diff --git a/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationAutoUpdateSection.tsx b/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationAutoUpdateSection.tsx
index 4e77f0bd5ea..9664874050f 100644
--- a/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationAutoUpdateSection.tsx
+++ b/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationAutoUpdateSection.tsx
@@ -37,7 +37,7 @@ export const SettingsApplicationAutoUpdateSection = ({
return (
<Section.Root>
<Section.Header title={t`Auto update`} />
- <Card rounded fullWidth>
+ <Card.Root rounded fullWidth>
<SettingsOptionCardContentSwitch
Icon={IconRefresh}
title={t`Auto-upgrade`}
@@ -45,7 +45,7 @@ export const SettingsApplicationAutoUpdateSection = ({
checked={autoUpgrade}
onChange={handleAutoUpgradeChange}
/>
- </Card>
+ </Card.Root>
</Section.Root>
);
};
diff --git a/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationTimelineActivityTypeSettingsTab.tsx b/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationTimelineActivityTypeSettingsTab.tsx
index b9413033125..e8c74c63c2c 100644
--- a/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationTimelineActivityTypeSettingsTab.tsx
+++ b/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationTimelineActivityTypeSettingsTab.tsx
@@ -116,7 +116,7 @@ export const SettingsApplicationTimelineActivityTypeSettingsTab = ({
title={t`Activity visibility`}
description={t`Choose whether this activity type appears in record timelines`}
/>
- <Card rounded fullWidth>
+ <Card.Root rounded fullWidth>
<SettingsOptionCardContentSwitch
Icon={IconTimelineEvent}
title={t`Active`}
@@ -125,7 +125,7 @@ export const SettingsApplicationTimelineActivityTypeSettingsTab = ({
disabled={disabled}
onChange={onIsActiveChange}
/>
- </Card>
+ </Card.Root>
</Section.Root>
{canReset && (
<Section.Root>
diff --git a/packages/twenty-front/src/pages/settings/communications/SettingsWorkspaceNewUnsubscribeTopic.tsx b/packages/twenty-front/src/pages/settings/communications/SettingsWorkspaceNewUnsubscribeTopic.tsx
index 77700de2f51..1d3d7695796 100644
--- a/packages/twenty-front/src/pages/settings/communications/SettingsWorkspaceNewUnsubscribeTopic.tsx
+++ b/packages/twenty-front/src/pages/settings/communications/SettingsWorkspaceNewUnsubscribeTopic.tsx
@@ -151,7 +151,7 @@ export const SettingsWorkspaceNewUnsubscribeTopic = () => {
title={t`Visibility`}
description={t`Control whether recipients can find and manage this topic.`}
/>
- <Card rounded>
+ <Card.Root rounded>
<SettingsOptionCardContentSwitch
Icon={IconEye}
title={t`Listed on the unsubscribe page`}
@@ -159,7 +159,7 @@ export const SettingsWorkspaceNewUnsubscribeTopic = () => {
checked={isPublic}
onChange={setIsPublic}
/>
- </Card>
+ </Card.Root>
</Section.Root>
</SettingsPageContainer>
</SettingsPageLayout>
diff --git a/packages/twenty-front/src/pages/settings/communications/SettingsWorkspaceUnsubscribeTopicDetail.tsx b/packages/twenty-front/src/pages/settings/communications/SettingsWorkspaceUnsubscribeTopicDetail.tsx
index 72c1f0a56dc..de2c113b7b5 100644
--- a/packages/twenty-front/src/pages/settings/communications/SettingsWorkspaceUnsubscribeTopicDetail.tsx
+++ b/packages/twenty-front/src/pages/settings/communications/SettingsWorkspaceUnsubscribeTopicDetail.tsx
@@ -188,7 +188,7 @@ export const SettingsWorkspaceUnsubscribeTopicDetail = () => {
title={t`Visibility`}
description={t`Control whether recipients can find and manage this topic.`}
/>
- <Card rounded>
+ <Card.Root rounded>
<SettingsOptionCardContentSwitch
Icon={IconEye}
title={t`Listed on the unsubscribe page`}
@@ -196,7 +196,7 @@ export const SettingsWorkspaceUnsubscribeTopicDetail = () => {
checked={isPublic}
onChange={handleVisibilityChange}
/>
- </Card>
+ </Card.Root>
</Section.Root>
</SettingsPageContainer>
<ConfirmationDialog
diff --git a/packages/twenty-shared/src/constants/DocumentationPaths.ts b/packages/twenty-shared/src/constants/DocumentationPaths.ts
index 711d3d614dc..9ab3c7c55ac 100644
--- a/packages/twenty-shared/src/constants/DocumentationPaths.ts
+++ b/packages/twenty-shared/src/constants/DocumentationPaths.ts
@@ -162,6 +162,7 @@ export const DOCUMENTATION_PATHS = {
UI_PRIMITIVES_NAVIGATION_TABS: '/ui/primitives/navigation/tabs',
UI_PRIMITIVES_OVERVIEW: '/ui/primitives/overview',
UI_PRIMITIVES_SURFACES_ALERT_DIALOG: '/ui/primitives/surfaces/alert-dialog',
+ UI_PRIMITIVES_SURFACES_CARD: '/ui/primitives/surfaces/card',
UI_PRIMITIVES_SURFACES_DIALOG: '/ui/primitives/surfaces/dialog',
UI_PRIMITIVES_SURFACES_MENU: '/ui/primitives/surfaces/menu',
UI_PRIMITIVES_SURFACES_POPOVER: '/ui/primitives/surfaces/popover',
diff --git a/packages/twenty-ui/CHANGELOG.md b/packages/twenty-ui/CHANGELOG.md
index dcf50fb43ff..0b53ba516c5 100644
--- a/packages/twenty-ui/CHANGELOG.md
+++ b/packages/twenty-ui/CHANGELOG.md
@@ -4,6 +4,8 @@
### Breaking Changes
+- `Card` is now a compound component. Import `Card` from `twenty-ui/primitives/surfaces`, replace `<Card>` with `<Card.Root>`, and replace the removed `CardHeader`, `CardContent`, and `CardFooter` exports with `Card.Header`, `Card.Content`, and `Card.Footer`. Use `Card.Root` in styled wrappers and prop types. Rendering, styling, props, and independent use of the parts are unchanged. See the [Card migration guide](https://docs.twenty.com/ui/primitives/surfaces/card#migration).
+- The in-repo Slack app still uses the separately versioned `twenty-ui@^1.0.0-alpha.1` package. Migrate its `twenty-ui/surfaces` import and `<Card>` usage together with its UI dependency upgrade; that published version does not expose `Card.Root`.
- Removed the unused `useScreenSize` export. `useIsMobile` and `useIsTouchDevice` remain available from `twenty-ui/utilities` and now subscribe to native `matchMedia` changes. Both return `false` during server rendering, initial hydration, and when `matchMedia` is unavailable. `react-responsive` context overrides no longer affect these hooks; use `overrideMediaQueryMatches` from `twenty-ui/testing` to force a result in stories.
- All theme exports now live in `twenty-ui/theme`. The `twenty-ui/theme-constants` entry, `ThemeContext`, `ThemeScopeContext`, and `ThemeContextType` are removed. Read values with `useTheme`, `useThemeColorScheme`, and `useThemeContainer`; configure them with `ThemeProvider`. The top-level theme stylesheet URLs and token values are unchanged.
- Worker apps retain provider-less CSS-variable values. Apps that supplied a context value can pass `THEME_LIGHT` or `THEME_DARK` directly through `ThemeProvider`'s `theme` prop. The in-repo call-recorder, companion, fireflies, Granola, Slack, and Teams apps import `twenty-ui/theme-constants` and must move those imports to `twenty-ui/theme` when they upgrade; call-recorder and Granola must also replace their `ThemeContext` providers with the `theme` prop. Their current pinned UI versions expose neither, so each app needs a coordinated source and dependency upgrade.
diff --git a/packages/twenty-ui/docs/cardContentPropDescriptions.ts b/packages/twenty-ui/docs/cardContentPropDescriptions.ts
new file mode 100644
index 00000000000..271ec473916
--- /dev/null
+++ b/packages/twenty-ui/docs/cardContentPropDescriptions.ts
@@ -0,0 +1,12 @@
+import { type ComponentProps } from 'react';
+
+import { type Card } from '../src/primitives/surfaces/Card/Card';
+
+export const CARD_CONTENT_PROP_DESCRIPTIONS = {
+ children: 'Content displayed in the padded body.',
+ className: 'CSS class applied to the body.',
+ divider: 'Adds a bottom border.',
+ isClickable:
+ 'Shows a pointer cursor. Does not add button semantics or keyboard interaction.',
+ hasHoverHighlight: 'Changes the background on hover. Does not add an action.',
+} satisfies Partial<Record<keyof ComponentProps<typeof Card.Content>, string>>;
diff --git a/packages/twenty-ui/docs/cardFooterPropDescriptions.ts b/packages/twenty-ui/docs/cardFooterPropDescriptions.ts
new file mode 100644
index 00000000000..6966844c833
--- /dev/null
+++ b/packages/twenty-ui/docs/cardFooterPropDescriptions.ts
@@ -0,0 +1,8 @@
+import { type ComponentProps } from 'react';
+
+import { type Card } from '../src/primitives/surfaces/Card/Card';
+
+export const CARD_FOOTER_PROP_DESCRIPTIONS = {
+ children: 'Footer content, such as actions or supporting text.',
+ divider: 'Shows the top border unless explicitly set to false.',
+} satisfies Partial<Record<keyof ComponentProps<typeof Card.Footer>, string>>;
diff --git a/packages/twenty-ui/docs/cardHeaderPropDescriptions.ts b/packages/twenty-ui/docs/cardHeaderPropDescriptions.ts
new file mode 100644
index 00000000000..4edbab060b8
--- /dev/null
+++ b/packages/twenty-ui/docs/cardHeaderPropDescriptions.ts
@@ -0,0 +1,9 @@
+import { type ComponentProps } from 'react';
+
+import { type Card } from '../src/primitives/surfaces/Card/Card';
+
+export const CARD_HEADER_PROP_DESCRIPTIONS = {
+ children:
+ 'Header content. Supply a Heading when the title should be a semantic heading.',
+ className: 'CSS class applied to the header.',
+} satisfies Partial<Record<keyof ComponentProps<typeof Card.Header>, string>>;
diff --git a/packages/twenty-ui/docs/cardPropDescriptions.ts b/packages/twenty-ui/docs/cardPropDescriptions.ts
new file mode 100644
index 00000000000..e0a6d94afaa
--- /dev/null
+++ b/packages/twenty-ui/docs/cardPropDescriptions.ts
@@ -0,0 +1,12 @@
+import { type ComponentProps } from 'react';
+
+import { type Card } from '../src/primitives/surfaces/Card/Card';
+
+export const CARD_PROP_DESCRIPTIONS = {
+ children: 'Card sections or other content.',
+ fullWidth: 'Sets the card width to 100% of its container.',
+ rounded:
+ 'Compatibility styling flag. Cards already use the same rounded corners when omitted.',
+ backgroundColor:
+ 'CSS background color of the outer card. Child sections have their own backgrounds.',
+} satisfies Partial<Record<keyof ComponentProps<typeof Card.Root>, string>>;
diff --git a/packages/twenty-ui/docs/components.ts b/packages/twenty-ui/docs/components.ts
index ffb159d13a4..06c803d30b8 100644
--- a/packages/twenty-ui/docs/components.ts
+++ b/packages/twenty-ui/docs/components.ts
@@ -1,6 +1,10 @@
import { AVATAR_PROP_DESCRIPTIONS } from './avatarPropDescriptions';
import { BUTTON_GROUP_PROP_DESCRIPTIONS } from './buttonGroupPropDescriptions';
import { BUTTON_PROP_DESCRIPTIONS } from './buttonPropDescriptions';
+import { CARD_CONTENT_PROP_DESCRIPTIONS } from './cardContentPropDescriptions';
+import { CARD_FOOTER_PROP_DESCRIPTIONS } from './cardFooterPropDescriptions';
+import { CARD_HEADER_PROP_DESCRIPTIONS } from './cardHeaderPropDescriptions';
+import { CARD_PROP_DESCRIPTIONS } from './cardPropDescriptions';
import { CHIP_PROP_DESCRIPTIONS } from './chipPropDescriptions';
import { CODE_EDITOR_HEADER_PROP_DESCRIPTIONS } from './codeEditorHeaderPropDescriptions';
import { CODE_EDITOR_PROP_DESCRIPTIONS } from './codeEditorPropDescriptions';
@@ -143,6 +147,19 @@ export const DOCUMENTED_COMPONENTS = [
},
},
},
+ {
+ name: 'Card',
+ source: 'primitives/surfaces/Card/Card.tsx',
+ entryPoint: 'twenty-ui/primitives/surfaces',
+ slug: 'surfaces/card',
+ partPropDescriptions: {
+ Root: CARD_PROP_DESCRIPTIONS,
+ Header: CARD_HEADER_PROP_DESCRIPTIONS,
+ Content: CARD_CONTENT_PROP_DESCRIPTIONS,
+ Footer: CARD_FOOTER_PROP_DESCRIPTIONS,
+ },
+ partPropDefaults: { Footer: { divider: 'true' } },
+ },
{
name: 'Dialog',
source: 'primitives/surfaces/Dialog/Dialog.tsx',
diff --git a/packages/twenty-ui/docs/module-ownership.json b/packages/twenty-ui/docs/module-ownership.json
index f926de597ed..3cba6013bca 100644
--- a/packages/twenty-ui/docs/module-ownership.json
+++ b/packages/twenty-ui/docs/module-ownership.json
@@ -7,9 +7,6 @@
"Button",
"ButtonGroup",
"Card",
- "CardContent",
- "CardFooter",
- "CardHeader",
"Checkbox",
"Chip",
"CircularProgressBar",
diff --git a/packages/twenty-ui/generated/components.docs.json b/packages/twenty-ui/generated/components.docs.json
index fffabb10b1a..df618e68cb3 100644
--- a/packages/twenty-ui/generated/components.docs.json
+++ b/packages/twenty-ui/generated/components.docs.json
@@ -53,6 +53,13 @@
"defaultValue": "false",
"description": "Whether the button should be focusable when disabled."
},
+ {
+ "name": "href",
+ "type": "string",
+ "required": false,
+ "defaultValue": null,
+ "description": "Destination URL. Enables native link semantics instead of button semantics."
+ },
{
"name": "loading",
"type": "boolean",
@@ -172,6 +179,13 @@
"defaultValue": "false",
"description": "Whether the button should be focusable when disabled."
},
+ {
+ "name": "href",
+ "type": "string",
+ "required": false,
+ "defaultValue": null,
+ "description": "Destination URL. Enables native link semantics instead of button semantics."
+ },
{
"name": "loading",
"type": "boolean",
@@ -298,6 +312,13 @@
"defaultValue": null,
"description": "Keyboard shortcut hints displayed on non-mobile screens."
},
+ {
+ "name": "href",
+ "type": "string",
+ "required": false,
+ "defaultValue": null,
+ "description": "Destination URL. Enables native link semantics instead of button semantics."
+ },
{
"name": "loading",
"type": "boolean",
@@ -417,6 +438,13 @@
"defaultValue": null,
"description": "Keyboard shortcut hints displayed on non-mobile screens."
},
+ {
+ "name": "href",
+ "type": "string",
+ "required": false,
+ "defaultValue": null,
+ "description": "Destination URL. Enables native link semantics instead of button semantics."
+ },
{
"name": "loading",
"type": "boolean",
@@ -529,6 +557,13 @@
"defaultValue": null,
"description": "Keyboard shortcut hints displayed on non-mobile screens."
},
+ {
+ "name": "href",
+ "type": "string",
+ "required": false,
+ "defaultValue": null,
+ "description": "Destination URL. Enables native link semantics instead of button semantics."
+ },
{
"name": "loading",
"type": "boolean",
@@ -2704,6 +2739,125 @@
}
]
},
+ {
+ "name": "Card",
+ "entryPoint": "twenty-ui/primitives/surfaces",
+ "slug": "surfaces/card",
+ "props": [],
+ "parts": [
+ {
+ "name": "Root",
+ "props": [
+ {
+ "name": "backgroundColor",
+ "type": "string",
+ "required": false,
+ "defaultValue": null,
+ "description": "CSS background color of the outer card. Child sections have their own backgrounds."
+ },
+ {
+ "name": "children",
+ "type": "ReactNode",
+ "required": false,
+ "defaultValue": null,
+ "description": "Card sections or other content."
+ },
+ {
+ "name": "fullWidth",
+ "type": "boolean",
+ "required": false,
+ "defaultValue": null,
+ "description": "Sets the card width to 100% of its container."
+ },
+ {
+ "name": "rounded",
+ "type": "boolean",
+ "required": false,
+ "defaultValue": null,
+ "description": "Compatibility styling flag. Cards already use the same rounded corners when omitted."
+ }
+ ]
+ },
+ {
+ "name": "Header",
+ "props": [
+ {
+ "name": "children",
+ "type": "ReactNode",
+ "required": false,
+ "defaultValue": null,
+ "description": "Header content. Supply a Heading when the title should be a semantic heading."
+ },
+ {
+ "name": "className",
+ "type": "string",
+ "required": false,
+ "defaultValue": null,
+ "description": "CSS class applied to the header."
+ }
+ ]
+ },
+ {
+ "name": "Content",
+ "props": [
+ {
+ "name": "children",
+ "type": "ReactNode",
+ "required": false,
+ "defaultValue": null,
+ "description": "Content displayed in the padded body."
+ },
+ {
+ "name": "className",
+ "type": "string",
+ "required": false,
+ "defaultValue": null,
+ "description": "CSS class applied to the body."
+ },
+ {
+ "name": "divider",
+ "type": "boolean",
+ "required": false,
+ "defaultValue": null,
+ "description": "Adds a bottom border."
+ },
+ {
+ "name": "hasHoverHighlight",
+ "type": "boolean",
+ "required": false,
+ "defaultValue": null,
+ "description": "Changes the background on hover. Does not add an action."
+ },
+ {
+ "name": "isClickable",
+ "type": "boolean",
+ "required": false,
+ "defaultValue": null,
+ "description": "Shows a pointer cursor. Does not add button semantics or keyboard interaction."
+ }
+ ]
+ },
+ {
+ "name": "Footer",
+ "props": [
+ {
+ "name": "children",
+ "type": "ReactNode",
+ "required": false,
+ "defaultValue": null,
+ "description": "Footer content, such as actions or supporting text."
+ },
+ {
+ "name": "divider",
+ "type": "boolean",
+ "required": false,
+ "defaultValue": "true",
+ "description": "Shows the top border unless explicitly set to false."
+ }
+ ]
+ }
+ ]
+ },
{
"name": "Dialog",
"entryPoint": "twenty-ui/primitives/surfaces",
@@ -4867,6 +5021,13 @@
"defaultValue": "absolute",
"description": "CSS positioning method for the popup."
},
+ {
+ "name": "ref",
+ "type": "Ref<HTMLDivElement>",
+ "required": false,
+ "defaultValue": null,
+ "description": "Ref forwarded to the popup element."
+ },
{
"name": "render",
"type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, TooltipPopupState>",
@@ -5106,6 +5267,13 @@
"defaultValue": "false",
"description": "Displays an arrow pointing to the trigger. Defaults to false."
},
+ {
+ "name": "children",
+ "type": "ReactNode",
+ "required": false,
+ "defaultValue": null,
+ "description": "Content displayed inside the popup."
+ },
{
"name": "className",
"type": "string | ((state: TooltipPopupState) => string | undefined)",
@@ -5141,6 +5309,13 @@
"defaultValue": null,
"description": "Portal destination. Defaults to the current theme container."
},
+ {
+ "name": "content",
+ "type": "string",
+ "required": false,
+ "defaultValue": null,
+ "description": "Supplementary content displayed in the tooltip."
+ },
{
"name": "disableAnchorTracking",
"type": "boolean",
@@ -5169,6 +5344,13 @@
"defaultValue": "absolute",
"description": "CSS positioning method for the popup."
},
+ {
+ "name": "ref",
+ "type": "Ref<HTMLDivElement>",
+ "required": false,
+ "defaultValue": null,
+ "description": "Ref forwarded to the popup element."
+ },
{
"name": "render",
"type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, TooltipPopupState>",
@@ -5209,6 +5391,13 @@
{
"name": "Content",
"props": [
+ {
+ "name": "children",
+ "type": "ReactNode",
+ "required": false,
+ "defaultValue": null,
+ "description": "Primary text displayed in the tooltip."
+ },
{
"name": "description",
"type": "ReactNode",
@@ -7041,6 +7230,13 @@
"defaultValue": "false",
"description": "Whether the button should be focusable when disabled."
},
+ {
+ "name": "href",
+ "type": "string",
+ "required": false,
+ "defaultValue": null,
+ "description": "Destination URL. Enables native link semantics instead of button semantics."
+ },
{
"name": "render",
"type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ButtonState>",
diff --git a/packages/twenty-ui/scripts/generateDocsData.ts b/packages/twenty-ui/scripts/generateDocsData.ts
index e2126c22e03..2dc6daf99f5 100644
--- a/packages/twenty-ui/scripts/generateDocsData.ts
+++ b/packages/twenty-ui/scripts/generateDocsData.ts
@@ -75,13 +75,7 @@ const isDeclaredInTwentyUi = (prop: PropItem): boolean =>
const parserOptions: ParserOptions = {
shouldExtractLiteralValuesFromEnum: true,
shouldIncludePropTagMap: true,
- propFilter: (prop) => !isReactNativeAttribute(prop) && !isHiddenProp(prop),
};
-const parser = new DocumentationParser(program, parserOptions);
-const documentedChildrenParser = new DocumentationParser(program, {
- ...parserOptions,
- skipChildrenPropWithoutDoc: false,
-});
const extractProps = ({
symbol,
@@ -100,8 +94,13 @@ const extractProps = ({
throw new Error(`Could not find the declaration for ${name}`);
}
- const componentParser =
- 'children' in propDescriptions ? documentedChildrenParser : parser;
+ const componentParser = new DocumentationParser(program, {
+ ...parserOptions,
+ skipChildrenPropWithoutDoc: !('children' in propDescriptions),
+ propFilter: (prop) =>
+ (!isReactNativeAttribute(prop) || prop.name in propDescriptions) &&
+ !isHiddenProp(prop),
+ });
const parsed: ComponentDoc | null = componentParser.getComponentInfo(
symbol,
declaration.getSourceFile(),
diff --git a/packages/twenty-ui/src/primitives/layout/ResizeHandle/__stories__/ResizableDemo.tsx b/packages/twenty-ui/src/primitives/layout/ResizeHandle/__stories__/ResizableDemo.tsx
index 6bfccffdbdf..2d957d8529a 100644
--- a/packages/twenty-ui/src/primitives/layout/ResizeHandle/__stories__/ResizableDemo.tsx
+++ b/packages/twenty-ui/src/primitives/layout/ResizeHandle/__stories__/ResizableDemo.tsx
@@ -16,7 +16,7 @@ export const ResizableDemo = ({ axis = 'y' }: { axis?: 'x' | 'y' }) => {
flexDirection: axis === 'y' ? 'column' : 'row',
}}
>
- <Card
+ <Card.Root
id={regionId}
style={{
height: axis === 'y' ? size : 150,
@@ -26,7 +26,7 @@ export const ResizableDemo = ({ axis = 'y' }: { axis?: 'x' | 'y' }) => {
}}
>
<Text>{size} pixels</Text>
- </Card>
+ </Card.Root>
<ResizeHandle
aria-label={axis === 'y' ? 'Resize height' : 'Resize width'}
aria-controls={regionId}
diff --git a/packages/twenty-ui/src/primitives/surfaces/Card/Card.tsx b/packages/twenty-ui/src/primitives/surfaces/Card/Card.tsx
index 5a865426d27..c9b5a225fc4 100644
--- a/packages/twenty-ui/src/primitives/surfaces/Card/Card.tsx
+++ b/packages/twenty-ui/src/primitives/surfaces/Card/Card.tsx
@@ -1,40 +1,11 @@
-import { clsx } from 'clsx';
-import { type ComponentPropsWithoutRef, type CSSProperties } from 'react';
-import { isDefined } from '@ui/utilities/utils/isDefined';
+import { CardContent } from './internal/CardContent';
+import { CardFooter } from './internal/CardFooter';
+import { CardHeader } from './internal/CardHeader';
+import { CardRoot } from './internal/CardRoot';
-import styles from './Card.module.scss';
-
-type CardProps = ComponentPropsWithoutRef<'div'> & {
- fullWidth?: boolean;
- rounded?: boolean;
- backgroundColor?: string;
-};
-
-export const Card = ({
- children,
- className,
- fullWidth,
- rounded,
- backgroundColor,
- style,
- ...rest
-}: CardProps) => {
- return (
- <div
- className={clsx(styles.card, className)}
- data-full-width={fullWidth || undefined}
- data-rounded={rounded || undefined}
- style={
- isDefined(backgroundColor)
- ? ({
- ...style,
- '--card-background-color': backgroundColor,
- } as CSSProperties)
- : style
- }
- {...rest}
- >
- {children}
- </div>
- );
+export const Card = {
+ Root: CardRoot,
+ Header: CardHeader,
+ Content: CardContent,
+ Footer: CardFooter,
};
diff --git a/packages/twenty-ui/src/primitives/surfaces/CardContent/CardContent.module.scss b/packages/twenty-ui/src/primitives/surfaces/Card/CardContent.module.scss
similarity index 100%
rename from packages/twenty-ui/src/primitives/surfaces/CardContent/CardContent.module.scss
rename to packages/twenty-ui/src/primitives/surfaces/Card/CardContent.module.scss
diff --git a/packages/twenty-ui/src/primitives/surfaces/CardContent/CardContent.module.scss.d.ts b/packages/twenty-ui/src/primitives/surfaces/Card/CardContent.module.scss.d.ts
similarity index 100%
rename from packages/twenty-ui/src/primitives/surfaces/CardContent/CardContent.module.scss.d.ts
rename to packages/twenty-ui/src/primitives/surfaces/Card/CardContent.module.scss.d.ts
diff --git a/packages/twenty-ui/src/primitives/surfaces/CardFooter/CardFooter.module.scss b/packages/twenty-ui/src/primitives/surfaces/Card/CardFooter.module.scss
similarity index 100%
rename from packages/twenty-ui/src/primitives/surfaces/CardFooter/CardFooter.module.scss
rename to packages/twenty-ui/src/primitives/surfaces/Card/CardFooter.module.scss
diff --git a/packages/twenty-ui/src/primitives/surfaces/CardFooter/CardFooter.module.scss.d.ts b/packages/twenty-ui/src/primitives/surfaces/Card/CardFooter.module.scss.d.ts
similarity index 100%
rename from packages/twenty-ui/src/primitives/surfaces/CardFooter/CardFooter.module.scss.d.ts
rename to packages/twenty-ui/src/primitives/surfaces/Card/CardFooter.module.scss.d.ts
diff --git a/packages/twenty-ui/src/primitives/surfaces/CardHeader/CardHeader.module.scss b/packages/twenty-ui/src/primitives/surfaces/Card/CardHeader.module.scss
similarity index 100%
rename from packages/twenty-ui/src/primitives/surfaces/CardHeader/CardHeader.module.scss
rename to packages/twenty-ui/src/primitives/surfaces/Card/CardHeader.module.scss
diff --git a/packages/twenty-ui/src/primitives/surfaces/CardHeader/CardHeader.module.scss.d.ts b/packages/twenty-ui/src/primitives/surfaces/Card/CardHeader.module.scss.d.ts
similarity index 100%
rename from packages/twenty-ui/src/primitives/surfaces/CardHeader/CardHeader.module.scss.d.ts
rename to packages/twenty-ui/src/primitives/surfaces/Card/CardHeader.module.scss.d.ts
diff --git a/packages/twenty-ui/src/primitives/surfaces/Card/__stories__/Card.stories.tsx b/packages/twenty-ui/src/primitives/surfaces/Card/__stories__/Card.stories.tsx
index a3de3a75989..7b47e27b6d5 100644
--- a/packages/twenty-ui/src/primitives/surfaces/Card/__stories__/Card.stories.tsx
+++ b/packages/twenty-ui/src/primitives/surfaces/Card/__stories__/Card.stories.tsx
@@ -2,29 +2,26 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
import { ComponentDecorator } from '@ui/testing';
import { Card } from '@ui/primitives/surfaces/Card/Card';
-import { CardContent } from '@ui/primitives/surfaces/CardContent/CardContent';
-import { CardFooter } from '@ui/primitives/surfaces/CardFooter/CardFooter';
-import { CardHeader } from '@ui/primitives/surfaces/CardHeader/CardHeader';
-const meta: Meta<typeof Card> = {
+const meta: Meta<typeof Card.Root> = {
title: 'UI/Surfaces/Card',
- component: Card,
+ component: Card.Root,
decorators: [ComponentDecorator],
render: (args) => (
- <Card {...args}>
- <CardHeader>Lorem ipsum</CardHeader>
- <CardContent>
+ <Card.Root {...args}>
+ <Card.Header>Lorem ipsum</Card.Header>
+ <Card.Content>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec id massa
vel odio ullamcorper molestie eu nec ipsum. Sed semper convallis
consectetur.
- </CardContent>
- <CardFooter>Lorem ipsum</CardFooter>
- </Card>
+ </Card.Content>
+ <Card.Footer>Lorem ipsum</Card.Footer>
+ </Card.Root>
),
argTypes: {},
};
export default meta;
-type Story = StoryObj<typeof Card>;
+type Story = StoryObj<typeof Card.Root>;
export const Default: Story = {};
diff --git a/packages/twenty-ui/src/primitives/surfaces/Card/__tests__/Card.test.tsx b/packages/twenty-ui/src/primitives/surfaces/Card/__tests__/Card.test.tsx
new file mode 100644
index 00000000000..37a94d6929f
--- /dev/null
+++ b/packages/twenty-ui/src/primitives/surfaces/Card/__tests__/Card.test.tsx
@@ -0,0 +1,116 @@
+import { render, screen } from '@testing-library/react';
+import { describe, expect, it } from 'vitest';
+
+import { runComponentConformance } from '@test-utilities/conformance/runComponentConformance';
+
+import { Card } from '../Card';
+
+import rootStyles from '../Card.module.scss';
+import contentStyles from '../CardContent.module.scss';
+import footerStyles from '../CardFooter.module.scss';
+import headerStyles from '../CardHeader.module.scss';
+
+for (const { name, Component, ownClassName } of [
+ { name: 'Root', Component: Card.Root, ownClassName: rootStyles.card },
+ {
+ name: 'Header',
+ Component: Card.Header,
+ ownClassName: headerStyles.cardHeader,
+ },
+ {
+ name: 'Content',
+ Component: Card.Content,
+ ownClassName: contentStyles.cardContent,
+ },
+ {
+ name: 'Footer',
+ Component: Card.Footer,
+ ownClassName: footerStyles.cardFooter,
+ },
+]) {
+ runComponentConformance({
+ name: `Card.${name}`,
+ element: <Component>Import summary</Component>,
+ ownClassName,
+ refInstanceOf: HTMLDivElement,
+ skip: ['ref', 'renderProp'],
+ });
+}
+
+describe('Card rendering', () => {
+ it('preserves the root appearance flags and merges a custom background with native styles', () => {
+ render(
+ <Card.Root
+ fullWidth
+ rounded
+ backgroundColor="rebeccapurple"
+ style={{ marginTop: 7 }}
+ >
+ Import summary
+ </Card.Root>,
+ );
+
+ const root = screen.getByText('Import summary');
+
+ expect(root).toHaveAttribute('data-full-width', 'true');
+ expect(root).toHaveAttribute('data-rounded', 'true');
+ expect(root).toHaveStyle({ marginTop: '7px' });
+ expect(root.style.getPropertyValue('--card-background-color')).toBe(
+ 'rebeccapurple',
+ );
+ });
+
+ it('keeps repeated sections in the supplied order and preserves divider defaults', () => {
+ render(
+ <Card.Root aria-label="Import summary" role="region">
+ <Card.Header>Summary</Card.Header>
+ <Card.Content divider isClickable hasHoverHighlight>
+ Ready records
+ </Card.Content>
+ <Card.Content>Records to review</Card.Content>
+ <Card.Footer>Last checked</Card.Footer>
+ <Card.Footer divider={false}>Import actions</Card.Footer>
+ </Card.Root>,
+ );
+
+ const root = screen.getByRole('region', { name: 'Import summary' });
+
+ expect([...root.children].map((child) => child.textContent)).toEqual([
+ 'Summary',
+ 'Ready records',
+ 'Records to review',
+ 'Last checked',
+ 'Import actions',
+ ]);
+ expect(root).not.toHaveAttribute('data-full-width');
+ expect(root).not.toHaveAttribute('data-rounded');
+ expect(screen.getByText('Ready records')).toHaveAttribute(
+ 'data-divider',
+ 'true',
+ );
+ expect(screen.getByText('Ready records')).toHaveAttribute(
+ 'data-clickable',
+ 'true',
+ );
+ expect(screen.getByText('Ready records')).toHaveAttribute(
+ 'data-hover-highlight',
+ 'true',
+ );
+ expect(screen.getByText('Records to review')).not.toHaveAttribute(
+ 'data-divider',
+ );
+ expect(screen.getByText('Records to review')).not.toHaveAttribute(
+ 'data-clickable',
+ );
+ expect(screen.getByText('Records to review')).not.toHaveAttribute(
+ 'data-hover-highlight',
+ );
+ expect(screen.getByText('Last checked')).not.toHaveAttribute(
+ 'data-no-divider',
+ );
+ expect(screen.getByText('Import actions')).toHaveAttribute(
+ 'data-no-divider',
+ 'true',
+ );
+ });
+});
diff --git a/packages/twenty-ui/src/primitives/surfaces/CardContent/CardContent.tsx b/packages/twenty-ui/src/primitives/surfaces/Card/internal/CardContent.tsx
similarity index 93%
rename from packages/twenty-ui/src/primitives/surfaces/CardContent/CardContent.tsx
rename to packages/twenty-ui/src/primitives/surfaces/Card/internal/CardContent.tsx
index 87f310f0928..52b1cf154c7 100644
--- a/packages/twenty-ui/src/primitives/surfaces/CardContent/CardContent.tsx
+++ b/packages/twenty-ui/src/primitives/surfaces/Card/internal/CardContent.tsx
@@ -1,7 +1,7 @@
import { clsx } from 'clsx';
import { type ComponentPropsWithoutRef, type ReactNode } from 'react';
-import styles from './CardContent.module.scss';
+import styles from '../CardContent.module.scss';
type CardContentProps = {
children?: ReactNode;
diff --git a/packages/twenty-ui/src/primitives/surfaces/CardFooter/CardFooter.tsx b/packages/twenty-ui/src/primitives/surfaces/Card/internal/CardFooter.tsx
similarity index 90%
rename from packages/twenty-ui/src/primitives/surfaces/CardFooter/CardFooter.tsx
rename to packages/twenty-ui/src/primitives/surfaces/Card/internal/CardFooter.tsx
index f1fc7ac53e7..e92e7562cc9 100644
--- a/packages/twenty-ui/src/primitives/surfaces/CardFooter/CardFooter.tsx
+++ b/packages/twenty-ui/src/primitives/surfaces/Card/internal/CardFooter.tsx
@@ -1,7 +1,7 @@
import { clsx } from 'clsx';
import { type ComponentPropsWithoutRef } from 'react';
-import styles from './CardFooter.module.scss';
+import styles from '../CardFooter.module.scss';
type CardFooterProps = ComponentPropsWithoutRef<'div'> & {
divider?: boolean;
diff --git a/packages/twenty-ui/src/primitives/surfaces/CardHeader/CardHeader.tsx b/packages/twenty-ui/src/primitives/surfaces/Card/internal/CardHeader.tsx
similarity index 87%
rename from packages/twenty-ui/src/primitives/surfaces/CardHeader/CardHeader.tsx
rename to packages/twenty-ui/src/primitives/surfaces/Card/internal/CardHeader.tsx
index 8045dd4781a..0f1959023af 100644
--- a/packages/twenty-ui/src/primitives/surfaces/CardHeader/CardHeader.tsx
+++ b/packages/twenty-ui/src/primitives/surfaces/Card/internal/CardHeader.tsx
@@ -1,7 +1,7 @@
import { clsx } from 'clsx';
import { type ComponentPropsWithoutRef } from 'react';
-import styles from './CardHeader.module.scss';
+import styles from '../CardHeader.module.scss';
type CardHeaderProps = ComponentPropsWithoutRef<'div'>;
diff --git a/packages/twenty-ui/src/primitives/surfaces/Card/internal/CardRoot.tsx b/packages/twenty-ui/src/primitives/surfaces/Card/internal/CardRoot.tsx
new file mode 100644
index 00000000000..c3b60f9c026
--- /dev/null
+++ b/packages/twenty-ui/src/primitives/surfaces/Card/internal/CardRoot.tsx
@@ -0,0 +1,40 @@
+import { clsx } from 'clsx';
+import { type ComponentPropsWithoutRef, type CSSProperties } from 'react';
+import { isDefined } from '@ui/utilities/utils/isDefined';
+
+import styles from '../Card.module.scss';
+
+type CardRootProps = ComponentPropsWithoutRef<'div'> & {
+ fullWidth?: boolean;
+ rounded?: boolean;
+ backgroundColor?: string;
+};
+
+export const CardRoot = ({
+ children,
+ className,
+ fullWidth,
+ rounded,
+ backgroundColor,
+ style,
+ ...rest
+}: CardRootProps) => {
+ return (
+ <div
+ className={clsx(styles.card, className)}
+ data-full-width={fullWidth || undefined}
+ data-rounded={rounded || undefined}
+ style={
+ isDefined(backgroundColor)
+ ? ({
+ ...style,
+ '--card-background-color': backgroundColor,
+ } as CSSProperties)
+ : style
+ }
+ {...rest}
+ >
+ {children}
+ </div>
+ );
+};
diff --git a/packages/twenty-ui/src/primitives/surfaces/index.ts b/packages/twenty-ui/src/primitives/surfaces/index.ts
index 143bb945994..b1dffc4446d 100644
--- a/packages/twenty-ui/src/primitives/surfaces/index.ts
+++ b/packages/twenty-ui/src/primitives/surfaces/index.ts
@@ -19,9 +19,6 @@ export type { AlertDialogSize } from './AlertDialog/types/AlertDialogSize';
export type { AlertDialogTitleProps } from './AlertDialog/types/AlertDialogTitleProps';
export type { AlertDialogTriggerProps } from './AlertDialog/types/AlertDialogTriggerProps';
export { Card } from './Card/Card';
-export { CardContent } from './CardContent/CardContent';
-export { CardFooter } from './CardFooter/CardFooter';
-export { CardHeader } from './CardHeader/CardHeader';
export { Dialog } from './Dialog/Dialog';
export type { DialogBodyProps } from './Dialog/types/DialogBodyProps';
export type { DialogCloseProps } from './Dialog/types/DialogCloseProps';