The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Add a shared details row (#28570)
Raphaël Bosi2b5451c5e4f0
diff --git a/packages/twenty-docs/docs.json b/packages/twenty-docs/docs.jsonindex 71417806a38..f536030b802 100644--- a/packages/twenty-docs/docs.json+++ b/packages/twenty-docs/docs.json@@ -629,6 +629,7 @@"pages": ["ui/components/data-display/avatar-group","ui/components/data-display/command-block",+ "ui/components/data-display/details-row","ui/components/data-display/json-tree","ui/components/data-display/metric-row","ui/components/data-display/stack-icon",diff --git a/packages/twenty-docs/navigation/base-structure.json b/packages/twenty-docs/navigation/base-structure.jsonindex c4a719465a2..d9c7177d117 100644--- a/packages/twenty-docs/navigation/base-structure.json+++ b/packages/twenty-docs/navigation/base-structure.json@@ -648,6 +648,7 @@"pages": ["ui/components/data-display/avatar-group","ui/components/data-display/command-block",+ "ui/components/data-display/details-row","ui/components/data-display/json-tree","ui/components/data-display/metric-row","ui/components/data-display/stack-icon",diff --git a/packages/twenty-docs/snippets/ui/generated/components/data-display/details-row.mdx b/packages/twenty-docs/snippets/ui/generated/components/data-display/details-row.mdxnew file mode 100644index 00000000000..a3206acbf1d--- /dev/null+++ b/packages/twenty-docs/snippets/ui/generated/components/data-display/details-row.mdx@@ -0,0 +1,48 @@+{/*+ * _____ _+ *|_ _|_ _____ _ __ | |_ _ _+ * | | \ \ /\ / / _ \ '_ \| __| | | | 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+ */}++<ParamField body="action" type="ReactNode">+ Optional action content beside the value. The caller supplies controls, accessible names, and handlers.+</ParamField>++<ParamField body="children" type="ReactNode" required>+ Value content rendered in the description definition. Text and multiple items wrap within the available space.+</ParamField>++<ParamField body="className" type="string">+ CSS class applied to the row root.+</ParamField>++<ParamField body="label" type="ReactNode" required>+ Visible label rendered as the description term.+</ParamField>++<ParamField body="labelWidth" type="Width<string | number>" default="7rem">+ Preferred label column width. Numbers use pixels. The column is capped at 40% of the row width; use the same width for aligned sibling rows.+</ParamField>++<ParamField body="ref" type="Ref<HTMLDivElement>">+ Ref forwarded to the row root div.+</ParamField>++<ParamField body="render" type="ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, {}>">+ Customizes the row root. Preserve a div directly inside a dl and forward its props and ref to retain valid description-list grouping.+</ParamField>++<ParamField body="startIcon" type="ReactNode">+ Decorative node before the label. The caller controls icon dimensions.+</ParamField>++<ParamField body="style" type="CSSProperties">+ Inline styles applied to the row root.+</ParamField>diff --git a/packages/twenty-docs/ui/components/data-display/details-row.mdx b/packages/twenty-docs/ui/components/data-display/details-row.mdxnew file mode 100644index 00000000000..ec6934aa70b--- /dev/null+++ b/packages/twenty-docs/ui/components/data-display/details-row.mdx@@ -0,0 +1,103 @@+---+title: DetailsRow+description: Align detail labels with wrapping values and optional actions.+---++import { StoryEmbed } from '/snippets/ui/StoryEmbed.mdx';+import DetailsRowReference from '/snippets/ui/generated/components/data-display/details-row.mdx';++`DetailsRow` pairs a label with a value in a description list. Add a decorative icon, multiple value items, or an action supplied by your application.++<StoryEmbed+ storyId="ui-data-display-detailsrow--display"+ title="Details row example"+ height={220}+/>++## Usage++```tsx+import { DetailsRow } from 'twenty-ui/components/data-display';+import { IconNotes, IconTag, IconUser } from 'twenty-ui/icon';+import { Chip, Tag } from 'twenty-ui/primitives/data-display';+import { Card } from 'twenty-ui/primitives/surfaces';++export const CollectionDetails = () => (+ <Card.Root>+ <Card.Content>+ <dl style={{ display: 'grid', gap: 8, margin: 0 }}>+ <DetailsRow label="Owner" startIcon={<IconUser size={16} />}>+ <Chip>Jordan Lee</Chip>+ </DetailsRow>+ <DetailsRow label="Categories" startIcon={<IconTag size={16} />}>+ <Tag color="blue">Research</Tag>+ <Tag color="purple">Design</Tag>+ </DetailsRow>+ <DetailsRow label="Description" startIcon={<IconNotes size={16} />}>+ A shared collection of customer research and design decisions.+ </DetailsRow>+ </dl>+ </Card.Content>+ </Card.Root>+);+```++Place each row directly inside a `dl`. Pass the label through `label` and its value through `children`. The application owns labels, localization, formatted values, and placeholders for missing values.++## Alignment and wrapping++Labels and values wrap rather than truncate. Multiple value items, such as chips or tags, wrap onto additional lines. Rows align their content at the top as that content grows.++The label column defaults to `7rem` and is capped at 40% of the row's width to leave space for the value in narrow containers. Set the same `labelWidth` on sibling rows to adjust their alignment. Numbers use pixels; CSS lengths such as `'8rem'` are also supported.++```tsx+import { DetailsRow } from 'twenty-ui/components/data-display';++export const PublicationDetails = () => (+ <dl style={{ display: 'grid', gap: 8, margin: 0, maxWidth: 360 }}>+ <DetailsRow label="Primary contributor" labelWidth={128}>+ Jordan Lee+ </DetailsRow>+ <DetailsRow label="Review notes" labelWidth={128}>+ Include findings from the customer interviews before publication.+ </DetailsRow>+ </dl>+);+```++## Actions++Use `action` for a control beside the value. The row does not add editing, click, or keyboard behavior. Supply a control with an accessible name and connect its handler to the application behavior.++```tsx+import { DetailsRow } from 'twenty-ui/components/data-display';+import { LightIconButton } from 'twenty-ui/components/input';+import { IconCopy } from 'twenty-ui/icon';++export const ContactDetails = ({ onCopy }: { onCopy: () => void }) => (+ <dl style={{ margin: 0 }}>+ <DetailsRow+ label="Email"+ action={+ <LightIconButton aria-label="Copy email address" onClick={onCopy}>+ <IconCopy size={16} />+ </LightIconButton>+ }+ >+ </DetailsRow>+ </dl>+);+```++## Composition and accessibility++Each row renders a `div` grouping with a `dt` label and a `dd` containing the value and optional action. The caller supplies the enclosing `dl`. Provide meaningful text in the label. The optional `startIcon` is hidden from assistive technology, and the caller controls its dimensions.++Native attributes, `className`, `style`, and `ref` target the outer `div`. When using `render` with a custom wrapper, preserve that `div` directly inside the `dl` and forward all supplied props and the ref. Keep actions inside their slot so the term and definition remain the row's direct children.++Use [MetricRow](/ui/components/data-display/metric-row) for a metric with optional progress. `DetailsRow` provides only the label, value, and action layout.++## Props++<DetailsRowReference />diff --git a/packages/twenty-docs/ui/components/overview.mdx b/packages/twenty-docs/ui/components/overview.mdxindex 0fbd2c7ac09..c9165f864f9 100644--- a/packages/twenty-docs/ui/components/overview.mdx+++ b/packages/twenty-docs/ui/components/overview.mdx@@ -42,6 +42,7 @@ Import from `twenty-ui/components/data-display`.| Component | Purpose || -------------------------------------------------------------- | --------------------------------------------------------------- |+| [DetailsRow](/ui/components/data-display/details-row) | Aligned labels, wrapping values, and optional actions. || [MetricRow](/ui/components/data-display/metric-row) | Labels and formatted values with optional determinate progress. || [AvatarGroup](/ui/components/data-display/avatar-group) | Overlapping avatars and overflow counts. || [CommandBlock](/ui/components/data-display/command-block) | Command text with an optional copy action. |diff --git a/packages/twenty-shared/src/constants/DocumentationPaths.ts b/packages/twenty-shared/src/constants/DocumentationPaths.tsindex 15f6f34c508..c648b51faff 100644--- a/packages/twenty-shared/src/constants/DocumentationPaths.ts+++ b/packages/twenty-shared/src/constants/DocumentationPaths.ts@@ -138,6 +138,8 @@ export const DOCUMENTATION_PATHS = {'/ui/components/data-display/avatar-group',UI_COMPONENTS_DATA_DISPLAY_COMMAND_BLOCK:'/ui/components/data-display/command-block',+ UI_COMPONENTS_DATA_DISPLAY_DETAILS_ROW:+ '/ui/components/data-display/details-row',UI_COMPONENTS_DATA_DISPLAY_JSON_TREE: '/ui/components/data-display/json-tree',UI_COMPONENTS_DATA_DISPLAY_METRIC_ROW:'/ui/components/data-display/metric-row',diff --git a/packages/twenty-ui/docs/components.ts b/packages/twenty-ui/docs/components.tsindex c93fd442914..4aee198cfa4 100644--- a/packages/twenty-ui/docs/components.ts+++ b/packages/twenty-ui/docs/components.ts@@ -10,6 +10,7 @@ import { CURRENCY_PICKER_PART_PROP_DESCRIPTIONS } from './currencyPickerPartPropimport { CURRENCY_PICKER_PROP_DESCRIPTIONS } from './currencyPickerPropDescriptions';import { OVERFLOWING_LIST_PROP_DESCRIPTIONS } from './overflowingListPropDescriptions';import { METRIC_ROW_PROP_DESCRIPTIONS } from './metricRowPropDescriptions';+import { DETAILS_ROW_PROP_DESCRIPTIONS } from './detailsRowPropDescriptions';import { PROGRESS_PART_PROP_DESCRIPTIONS } from './progressPartPropDescriptions';import { PROGRESS_RING_PROP_DESCRIPTIONS } from './progressRingPropDescriptions';import { AVATAR_GROUP_PROP_DESCRIPTIONS } from './avatarGroupPropDescriptions';@@ -134,6 +135,14 @@ export const DOCUMENTED_COMPONENTS = [slug: 'feedback/progress-ring',propDescriptions: PROGRESS_RING_PROP_DESCRIPTIONS,},+ {+ name: 'DetailsRow',+ source: 'components/data-display/DetailsRow/DetailsRow.tsx',+ entryPoint: 'twenty-ui/components/data-display',+ slug: 'components/data-display/details-row',+ propDescriptions: DETAILS_ROW_PROP_DESCRIPTIONS,+ propDefaults: { labelWidth: '7rem' },+ },{name: 'MetricRow',source: 'components/data-display/MetricRow/MetricRow.tsx',diff --git a/packages/twenty-ui/docs/detailsRowPropDescriptions.ts b/packages/twenty-ui/docs/detailsRowPropDescriptions.tsnew file mode 100644index 00000000000..9c0460403cd--- /dev/null+++ b/packages/twenty-ui/docs/detailsRowPropDescriptions.ts@@ -0,0 +1,20 @@+import { type ComponentProps } from 'react';++import { type DetailsRow } from '../src/components/data-display/DetailsRow/DetailsRow';++export const DETAILS_ROW_PROP_DESCRIPTIONS = {+ label: 'Visible label rendered as the description term.',+ children:+ 'Value content rendered in the description definition. Text and multiple items wrap within the available space.',+ startIcon:+ 'Decorative node before the label. The caller controls icon dimensions.',+ action:+ 'Optional action content beside the value. The caller supplies controls, accessible names, and handlers.',+ labelWidth:+ 'Preferred label column width. Numbers use pixels. The column is capped at 40% of the row width; use the same width for aligned sibling rows.',+ className: 'CSS class applied to the row root.',+ style: 'Inline styles applied to the row root.',+ ref: 'Ref forwarded to the row root div.',+ render:+ 'Customizes the row root. Preserve a div directly inside a dl and forward its props and ref to retain valid description-list grouping.',+} satisfies Partial<Record<keyof ComponentProps<typeof DetailsRow>, string>>;diff --git a/packages/twenty-ui/docs/module-ownership.json b/packages/twenty-ui/docs/module-ownership.jsonindex 22e4ba1098d..5c9dc553818 100644--- a/packages/twenty-ui/docs/module-ownership.json+++ b/packages/twenty-ui/docs/module-ownership.json@@ -54,6 +54,7 @@"CommandBlock","CountrySelect","CurrencyPicker",+ "DetailsRow","Dropdown","IconButton","ImageInput",diff --git a/packages/twenty-ui/docs/public-exports.json b/packages/twenty-ui/docs/public-exports.jsonindex 7317ac5da4e..3fbc18d3b61 100644--- a/packages/twenty-ui/docs/public-exports.json+++ b/packages/twenty-ui/docs/public-exports.json@@ -37,6 +37,7 @@"values": {"AvatarGroup": "components/data-display/AvatarGroup/AvatarGroup","CommandBlock": "components/data-display/CommandBlock/CommandBlock",+ "DetailsRow": "components/data-display/DetailsRow/DetailsRow","getIconTileColorShades": "components/data-display/TintedIconTile/utils/getIconTileColorShades","JsonTree": "components/data-display/JsonTree/JsonTree","MetricRow": "components/data-display/MetricRow/MetricRow",@@ -46,6 +47,7 @@"types": {"AvatarGroupProps": "components/data-display/AvatarGroup/types/AvatarGroupProps","CommandBlockProps": "components/data-display/CommandBlock/types/CommandBlockProps",+ "DetailsRowProps": "components/data-display/DetailsRow/types/DetailsRowProps","GetJsonNodeHighlighting": "components/data-display/JsonTree/types/GetJsonNodeHighlighting","IconTileColorShades": "components/data-display/TintedIconTile/utils/getIconTileColorShades","JsonNodeHighlighting": "components/data-display/JsonTree/types/JsonNodeHighlighting",diff --git a/packages/twenty-ui/generated/components.docs.json b/packages/twenty-ui/generated/components.docs.jsonindex 847d5183024..a2d4d323daa 100644--- a/packages/twenty-ui/generated/components.docs.json+++ b/packages/twenty-ui/generated/components.docs.json@@ -964,6 +964,76 @@}]},+ {+ "name": "DetailsRow",+ "entryPoint": "twenty-ui/components/data-display",+ "slug": "components/data-display/details-row",+ "props": [+ {+ "name": "action",+ "type": "ReactNode",+ "required": false,+ "defaultValue": null,+ "description": "Optional action content beside the value. The caller supplies controls, accessible names, and handlers."+ },+ {+ "name": "children",+ "type": "ReactNode",+ "required": true,+ "defaultValue": null,+ "description": "Value content rendered in the description definition. Text and multiple items wrap within the available space."+ },+ {+ "name": "className",+ "type": "string",+ "required": false,+ "defaultValue": null,+ "description": "CSS class applied to the row root."+ },+ {+ "name": "label",+ "type": "ReactNode",+ "required": true,+ "defaultValue": null,+ "description": "Visible label rendered as the description term."+ },+ {+ "name": "labelWidth",+ "type": "Width<string | number>",+ "required": false,+ "defaultValue": "7rem",+ "description": "Preferred label column width. Numbers use pixels. The column is capped at 40% of the row width; use the same width for aligned sibling rows."+ },+ {+ "name": "ref",+ "type": "Ref<HTMLDivElement>",+ "required": false,+ "defaultValue": null,+ "description": "Ref forwarded to the row root div."+ },+ {+ "name": "render",+ "type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, {}>",+ "required": false,+ "defaultValue": null,+ "description": "Customizes the row root. Preserve a div directly inside a dl and forward its props and ref to retain valid description-list grouping."+ },+ {+ "name": "startIcon",+ "type": "ReactNode",+ "required": false,+ "defaultValue": null,+ "description": "Decorative node before the label. The caller controls icon dimensions."+ },+ {+ "name": "style",+ "type": "CSSProperties",+ "required": false,+ "defaultValue": null,+ "description": "Inline styles applied to the row root."+ }+ ]+ },{"name": "MetricRow","entryPoint": "twenty-ui/components/data-display",diff --git a/packages/twenty-ui/src/components/data-display/DetailsRow/DetailsRow.module.scss b/packages/twenty-ui/src/components/data-display/DetailsRow/DetailsRow.module.scssnew file mode 100644index 00000000000..e42570802b8--- /dev/null+++ b/packages/twenty-ui/src/components/data-display/DetailsRow/DetailsRow.module.scss@@ -0,0 +1,60 @@+.row {+ align-items: start;+ color: var(--t-font-color-primary);+ display: flex;+ font-size: var(--t-font-size-sm);+ gap: var(--t-spacing-1);+ line-height: var(--t-spacing-6);+ min-inline-size: 0;+}++.label {+ align-items: start;+ color: var(--t-font-color-tertiary);+ display: flex;+ flex-shrink: 0;+ inline-size: var(--details-row-label-width);+ max-inline-size: 40%;+ gap: var(--t-spacing-1);+ min-inline-size: 0;+}++.labelText {+ min-inline-size: 0;+ overflow-wrap: anywhere;+}++.icon {+ align-items: center;+ display: flex;+ flex-shrink: 0;+ min-block-size: var(--t-spacing-6);+}++.description {+ align-items: start;+ display: flex;+ flex: 1;+ gap: var(--t-spacing-1);+ margin: 0;+ min-inline-size: 0;+}++.value {+ align-items: center;+ display: flex;+ flex: 1;+ flex-wrap: wrap;+ gap: var(--t-spacing-1);+ min-block-size: var(--t-spacing-6);+ min-inline-size: 0;+ overflow-wrap: anywhere;+}++.action {+ align-items: center;+ display: flex;+ flex-shrink: 0;+ gap: var(--t-spacing-1);+ min-block-size: var(--t-spacing-6);+}diff --git a/packages/twenty-ui/src/components/data-display/DetailsRow/DetailsRow.tsx b/packages/twenty-ui/src/components/data-display/DetailsRow/DetailsRow.tsxnew file mode 100644index 00000000000..80704641b5b--- /dev/null+++ b/packages/twenty-ui/src/components/data-display/DetailsRow/DetailsRow.tsx@@ -0,0 +1,59 @@+import { useRender } from '@base-ui/react/use-render';+import { isNumber } from '@sniptt/guards';+import { clsx } from 'clsx';+import { type CSSProperties } from 'react';++import { isRenderableSlot } from '@ui/utilities/internal/isRenderableSlot';++import styles from './DetailsRow.module.scss';+import { type DetailsRowProps } from './types/DetailsRowProps';++export const DetailsRow = ({+ label,+ children,+ startIcon,+ action,+ labelWidth = '7rem',+ render,+ ref,+ className,+ style,+ ...props+}: DetailsRowProps) => {+ const rowStyle: CSSProperties & {+ '--details-row-label-width': string;+ } = {+ '--details-row-label-width': isNumber(labelWidth)+ ? `${labelWidth}px`+ : labelWidth,+ ...style,+ };++ return useRender({+ render,+ ref,+ props: {+ ...props,+ className: clsx(styles.row, className),+ style: rowStyle,+ children: (+ <>+ <dt className={styles.label}>+ {isRenderableSlot(startIcon) && (+ <span className={styles.icon} aria-hidden="true">+ {startIcon}+ </span>+ )}+ <span className={styles.labelText}>{label}</span>+ </dt>+ <dd className={styles.description}>+ <div className={styles.value}>{children}</div>+ {isRenderableSlot(action) && (+ <div className={styles.action}>{action}</div>+ )}+ </dd>+ </>+ ),+ },+ });+};diff --git a/packages/twenty-ui/src/components/data-display/DetailsRow/__stories__/DetailsRow.stories.tsx b/packages/twenty-ui/src/components/data-display/DetailsRow/__stories__/DetailsRow.stories.tsxnew file mode 100644index 00000000000..06d4dc4ac8c--- /dev/null+++ b/packages/twenty-ui/src/components/data-display/DetailsRow/__stories__/DetailsRow.stories.tsx@@ -0,0 +1,162 @@+import { type Meta, type StoryObj } from '@storybook/react-vite';+import { expect, fn, userEvent, within } from 'storybook/test';++import { LightIconButton } from '@ui/components/input/LightIconButton/LightIconButton';+import { IconNotes, IconPencil, IconTag, IconUser } from '@ui/icon';+import { Chip } from '@ui/primitives/data-display/Chip/Chip';+import { Tag } from '@ui/primitives/data-display/Tag/Tag';+import { Card } from '@ui/primitives/surfaces/Card/Card';+import { A11Y_DEFER_COLOR_CONTRAST, ComponentDecorator } from '@ui/testing';++import { DetailsRow } from '../DetailsRow';++const handleChangeOwner = fn();++const meta: Meta<typeof DetailsRow> = {+ id: 'ui-data-display-detailsrow',+ title: 'UI/Components/Data display/DetailsRow',+ component: DetailsRow,+ decorators: [ComponentDecorator],+ parameters: {+ container: { width: 400 },+ a11y: A11Y_DEFER_COLOR_CONTRAST,+ },+ args: {+ label: 'Owner',+ children: <Chip>Jordan Lee</Chip>,+ startIcon: <IconUser size={16} />,+ },+ argTypes: {+ children: { control: false },+ startIcon: { control: false },+ action: { control: false },+ },+};++export default meta;++type Story = StoryObj<typeof DetailsRow>;++export const Display: Story = {+ render: (args) => (+ <Card.Root>+ <Card.Content>+ <dl dir={args.dir} style={{ display: 'grid', gap: 8, margin: 0 }}>+ <DetailsRow+ // oxlint-disable-next-line react/jsx-props-no-spreading+ {...args}+ />+ <DetailsRow label="Categories" startIcon={<IconTag size={16} />}>+ <Tag color="blue">Research</Tag>+ <Tag color="purple">Design</Tag>+ </DetailsRow>+ <DetailsRow label="Description" startIcon={<IconNotes size={16} />}>+ A shared collection of customer research and design decisions.+ </DetailsRow>+ </dl>+ </Card.Content>+ </Card.Root>+ ),+};++export const LongContent: Story = {+ parameters: { container: { width: 260 } },+ render: () => (+ <dl style={{ display: 'grid', gap: 8, margin: 0 }}>+ <DetailsRow+ label="Primary project coordinator"+ labelWidth={160}+ startIcon={<IconUser size={16} />}+ >+ Jordan Lee, customer research and product operations+ </DetailsRow>+ <DetailsRow+ label="Reference"+ labelWidth={160}+ startIcon={<IconNotes size={16} />}+ >+ customer-research-archive-2026-accessibility-observations+ </DetailsRow>+ <DetailsRow+ label="Categories"+ labelWidth={160}+ startIcon={<IconTag size={16} />}+ >+ <Tag color="blue">Research</Tag>+ <Tag color="purple">Design</Tag>+ <Tag color="green">Planning</Tag>+ </DetailsRow>+ </dl>+ ),+};++export const NarrowLayout: Story = {+ ...LongContent,+ tags: ['!autodocs'],+ play: async ({ canvasElement }) => {+ const canvas = within(canvasElement);+ const label = canvas.getByText('Primary project coordinator');+ const value = canvas.getByText(+ 'Jordan Lee, customer research and product operations',+ );++ await expect(label).toBeVisible();+ await expect(value).toBeVisible();+ await expect(value.getBoundingClientRect().height).toBeGreaterThan(24);++ const list = canvasElement.querySelector('dl');++ await expect(list).not.toBeNull();+ await expect(list!.scrollWidth).toBeLessThanOrEqual(list!.clientWidth);+ },+};++export const WithAction: Story = {+ args: {+ action: (+ <LightIconButton aria-label="Change owner">+ <IconPencil />+ </LightIconButton>+ ),+ },+ render: (args) => (+ <dl style={{ margin: 0 }}>+ <DetailsRow+ // oxlint-disable-next-line react/jsx-props-no-spreading+ {...args}+ />+ </dl>+ ),+};++export const ActionKeyboard: Story = {+ ...WithAction,+ tags: ['!autodocs'],+ args: {+ action: (+ <LightIconButton aria-label="Change owner" onClick={handleChangeOwner}>+ <IconPencil />+ </LightIconButton>+ ),+ },+ play: async ({ canvasElement }) => {+ const canvas = within(canvasElement);+ const action = canvas.getByRole('button', { name: 'Change owner' });++ await userEvent.tab();+ await expect(action).toHaveFocus();+ await userEvent.keyboard('{Enter}');+ await expect(handleChangeOwner).toHaveBeenCalledOnce();+ },+};++export const RightToLeft: Story = {+ ...Display,+ args: { dir: 'rtl' },+};++export const Dark: Story = {+ ...Display,+ globals: { colorScheme: 'dark' },+ tags: ['!autodocs'],+};diff --git a/packages/twenty-ui/src/components/data-display/DetailsRow/__tests__/DetailsRow.test.tsx b/packages/twenty-ui/src/components/data-display/DetailsRow/__tests__/DetailsRow.test.tsxnew file mode 100644index 00000000000..676bcd7db21--- /dev/null+++ b/packages/twenty-ui/src/components/data-display/DetailsRow/__tests__/DetailsRow.test.tsx@@ -0,0 +1,43 @@+import { runComponentConformance } from '@test-utilities/conformance/runComponentConformance';+import { render, screen, within } from '@testing-library/react';+import { expect, it } from 'vitest';++import { Button } from '@ui/primitives/input/Button/Button';++import { DetailsRow } from '../DetailsRow';++runComponentConformance({+ name: 'DetailsRow',+ element: <DetailsRow label="Owner">Jordan Lee</DetailsRow>,+ refInstanceOf: HTMLDivElement,+ wrapper: ({ children }) => <dl>{children}</dl>,+ renderPropTagName: 'div',+});++it('groups a term, its value and its action inside a description list', () => {+ render(+ <dl>+ <DetailsRow+ label={<strong>Owner</strong>}+ startIcon={<svg role="img" aria-label="Internal artwork" />}+ action={<Button aria-label="Change owner">Change</Button>}+ >+ Jordan Lee+ </DetailsRow>+ <DetailsRow label="Completed reviews">{0}</DetailsRow>+ </dl>,+ );++ const [ownerTerm, reviewsTerm] = screen.getAllByRole('term');+ const [ownerDescription, reviewsDescription] =+ screen.getAllByRole('definition');++ expect(ownerTerm).toHaveTextContent('Owner');+ expect(ownerDescription).toHaveTextContent('Jordan Lee');+ expect(+ within(ownerDescription!).getByRole('button', { name: 'Change owner' }),+ ).toBeInTheDocument();+ expect(reviewsTerm).toHaveTextContent('Completed reviews');+ expect(reviewsDescription).toHaveTextContent('0');+ expect(screen.queryByRole('img')).not.toBeInTheDocument();+});diff --git a/packages/twenty-ui/src/components/data-display/DetailsRow/types/DetailsRowProps.ts b/packages/twenty-ui/src/components/data-display/DetailsRow/types/DetailsRowProps.tsnew file mode 100644index 00000000000..efbfb0ea258--- /dev/null+++ b/packages/twenty-ui/src/components/data-display/DetailsRow/types/DetailsRowProps.ts@@ -0,0 +1,13 @@+import { type useRender } from '@base-ui/react/use-render';+import { type CSSProperties, type ReactNode } from 'react';++export type DetailsRowProps = Omit<+ useRender.ComponentProps<'div'>,+ 'children'+> & {+ label: ReactNode;+ children: ReactNode;+ startIcon?: ReactNode;+ action?: ReactNode;+ labelWidth?: CSSProperties['width'];+};diff --git a/packages/twenty-ui/src/components/data-display/index.ts b/packages/twenty-ui/src/components/data-display/index.tsindex 0df2792c1f7..543d63a6583 100644--- a/packages/twenty-ui/src/components/data-display/index.ts+++ b/packages/twenty-ui/src/components/data-display/index.ts@@ -11,6 +11,8 @@ export { AvatarGroup } from './AvatarGroup/AvatarGroup';export type { AvatarGroupProps } from './AvatarGroup/types/AvatarGroupProps';export { CommandBlock } from './CommandBlock/CommandBlock';export type { CommandBlockProps } from './CommandBlock/types/CommandBlockProps';+export { DetailsRow } from './DetailsRow/DetailsRow';+export type { DetailsRowProps } from './DetailsRow/types/DetailsRowProps';export { JsonTree } from './JsonTree/JsonTree';export type { GetJsonNodeHighlighting } from './JsonTree/types/GetJsonNodeHighlighting';export type { JsonNodeHighlighting } from './JsonTree/types/JsonNodeHighlighting';