Skip to content

The open alternative to Salesforce, designed for AI.

Normalize Separator API (#27383)

Raphaël Bosie613859d5043
diff --git a/packages/twenty-docs/docs.json b/packages/twenty-docs/docs.json
index a6d81da21d1..d9ed0201fa5 100644
--- a/packages/twenty-docs/docs.json
+++ b/packages/twenty-docs/docs.json
@@ -583,7 +583,7 @@
"group": "Layout",
"pages": [
"ui/primitives/layout/collapsible",
- "ui/primitives/layout/horizontal-separator",
+ "ui/primitives/layout/separator",
"ui/primitives/layout/resize-handle",
"ui/primitives/layout/direction-provider"
]
diff --git a/packages/twenty-docs/navigation/base-structure.json b/packages/twenty-docs/navigation/base-structure.json
index 1563974131d..3575816e474 100644
--- a/packages/twenty-docs/navigation/base-structure.json
+++ b/packages/twenty-docs/navigation/base-structure.json
@@ -597,7 +597,7 @@
"label": "Layout",
"pages": [
"ui/primitives/layout/collapsible",
- "ui/primitives/layout/horizontal-separator",
+ "ui/primitives/layout/separator",
"ui/primitives/layout/resize-handle",
"ui/primitives/layout/direction-provider"
]
diff --git a/packages/twenty-docs/snippets/ui/generated/layout/horizontal-separator.mdx b/packages/twenty-docs/snippets/ui/generated/layout/horizontal-separator.mdx
deleted file mode 100644
index 82129328eb1..00000000000
--- a/packages/twenty-docs/snippets/ui/generated/layout/horizontal-separator.mdx
+++ /dev/null
@@ -1,32 +0,0 @@
-{/*
- * _____ _
- *|_ _|_ _____ _ __ | |_ _ _
- * | | \ \ /\ / / _ \ '_ \| __| | | | 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="color" type="string">
- CSS color for the line and text. Defaults to the medium border color.
-</ParamField>
-
-<ParamField body="noMargin" type="boolean" default="false">
- Removes the vertical margins.
-</ParamField>
-
-<ParamField body="text" type="string" default="">
- Optional label displayed between two lines.
-</ParamField>
-
-<ParamField body="textPosition" type="&quot;center&quot; | &quot;end&quot;" default="center">
- Places the text between two lines, or at the end of a single line.
-</ParamField>
-
-<ParamField body="visible" type="boolean" default="true">
- Shows the dividing line. Setting it to false preserves margins and any text.
-</ParamField>
diff --git a/packages/twenty-docs/snippets/ui/generated/layout/separator.mdx b/packages/twenty-docs/snippets/ui/generated/layout/separator.mdx
new file mode 100644
index 00000000000..5a175e3b89b
--- /dev/null
+++ b/packages/twenty-docs/snippets/ui/generated/layout/separator.mdx
@@ -0,0 +1,28 @@
+{/*
+ * _____ _
+ *|_ _|_ _____ _ __ | |_ _ _
+ * | | \ \ /\ / / _ \ '_ \| __| | | | 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="className" type="string | ((state: SeparatorState) =&gt; string | undefined)">
+ CSS class or function of the separator orientation.
+</ParamField>
+
+<ParamField body="orientation" type="&quot;horizontal&quot; | &quot;vertical&quot;" default="horizontal">
+ Direction of the divider: horizontal or vertical.
+</ParamField>
+
+<ParamField body="render" type="ReactElement&lt;unknown, string | JSXElementConstructor&lt;any&gt;&gt; | ComponentRenderFn&lt;HTMLProps, SeparatorState&gt;">
+ Element or render function composed with the native separator props and ref.
+</ParamField>
+
+<ParamField body="style" type="CSSProperties | ((state: SeparatorState) =&gt; CSSProperties | undefined)">
+ Native style or function of the separator orientation. Use it for spacing and line color.
+</ParamField>
diff --git a/packages/twenty-docs/ui/primitives/layout/horizontal-separator.mdx b/packages/twenty-docs/ui/primitives/layout/horizontal-separator.mdx
deleted file mode 100644
index 5c32934553e..00000000000
--- a/packages/twenty-docs/ui/primitives/layout/horizontal-separator.mdx
+++ /dev/null
@@ -1,40 +0,0 @@
----
-title: HorizontalSeparator
-description: Separate adjacent content with a line and an optional label.
----
-
-import { StoryEmbed } from '/snippets/ui/StoryEmbed.mdx';
-
-import HorizontalSeparatorReference from '/snippets/ui/generated/layout/horizontal-separator.mdx';
-
-`HorizontalSeparator` is a visual divider with optional text. It has no interaction or state and does not render native `hr` semantics.
-
-<StoryEmbed
- storyId="ui-layout-horizontalseparator--default"
- title="HorizontalSeparator example"
-/>
-
-## Usage
-
-```tsx
-import { HorizontalSeparator } from 'twenty-ui/primitives/layout';
-import { Text } from 'twenty-ui/primitives/typography';
-
-export const ImportSources = () => (
- <>
- <Text>Import records from a CSV file.</Text>
- <HorizontalSeparator text="or" />
- <Text>Connect an external data source.</Text>
- </>
-);
-```
-
-## Spacing and visibility
-
-Omit `text` for one continuous line. `noMargin` removes the vertical margins. `visible={false}` hides the line while preserving the margins and any text. A custom `color` changes the line color; the default uses the medium border color.
-
-Use headings to communicate document structure. If a separator must have semantic meaning, place the unlabeled component in a wrapper with `role="separator"`. Native attributes, event handlers, and children are not forwarded.
-
-## Props
-
-<HorizontalSeparatorReference />
diff --git a/packages/twenty-docs/ui/primitives/layout/separator.mdx b/packages/twenty-docs/ui/primitives/layout/separator.mdx
new file mode 100644
index 00000000000..09f33db0a55
--- /dev/null
+++ b/packages/twenty-docs/ui/primitives/layout/separator.mdx
@@ -0,0 +1,70 @@
+---
+title: Separator
+description: Separate adjacent content with a horizontal or vertical divider.
+---
+
+import { StoryEmbed } from '/snippets/ui/StoryEmbed.mdx';
+
+import SeparatorReference from '/snippets/ui/generated/layout/separator.mdx';
+
+`Separator` renders a `div` with `role="separator"` and an accessible orientation. It uses the Base UI separator contract, including native props, refs, and `render` composition. Import `SeparatorProps` from the same entry point.
+
+<StoryEmbed
+ storyId="ui-layout-separator--documentation"
+ title="Horizontal separator"
+/>
+
+## Usage
+
+```tsx
+import { Separator } from 'twenty-ui/primitives/layout';
+import { Text } from 'twenty-ui/primitives/typography';
+
+export const ImportSources = () => (
+ <Text style={{ display: 'grid', gap: 'var(--t-spacing-3)' }}>
+ <Text>Import records from a CSV file.</Text>
+ <Separator />
+ <Text>Connect an external data source.</Text>
+ </Text>
+);
+```
+
+## Orientation and appearance
+
+`orientation` defaults to `horizontal`. Margins default to zero in both orientations. Horizontal separators fill the available width. Vertical separators stretch along their flex container. Give a standalone vertical separator a height. Control spacing through the parent layout, or use native `style` or `className` for explicit margins and line color. Base UI also accepts functions of the orientation for these props.
+
+<StoryEmbed
+ storyId="ui-layout-separator--vertical-documentation"
+ title="Vertical separator"
+/>
+
+## Labeled dividers
+
+Compose text and divider lines in a separate layout. Give the layout an accessible name and make the individual lines presentational.
+
+```tsx
+import { Separator } from 'twenty-ui/primitives/layout';
+import { Text } from 'twenty-ui/primitives/typography';
+
+export const LabeledDivider = () => (
+ <Text
+ role="separator"
+ aria-label="or"
+ style={{ display: 'flex', alignItems: 'center' }}
+ >
+ <Separator aria-hidden style={{ flex: 1, width: 'auto' }} />
+ <Text render={<span />} style={{ marginInline: 'var(--t-spacing-2)' }}>
+ or
+ </Text>
+ <Separator aria-hidden style={{ flex: 1, width: 'auto' }} />
+ </Text>
+);
+```
+
+## Migration
+
+Replace the former horizontal helper with `Separator`. Remove `noMargin`, since margins now default to zero. To keep the former default spacing, add `style={{ marginBlock: 'var(--t-spacing-3)' }}`. Replace `color` with `style={{ backgroundColor: color }}`. Move `text` and `textPosition` into a labeled composition. Replace separators used only for invisible spacing with layout spacing.
+
+## Props
+
+<SeparatorReference />
diff --git a/packages/twenty-docs/ui/primitives/overview.mdx b/packages/twenty-docs/ui/primitives/overview.mdx
index 817f9fb2c60..d550741e77f 100644
--- a/packages/twenty-docs/ui/primitives/overview.mdx
+++ b/packages/twenty-docs/ui/primitives/overview.mdx
@@ -92,7 +92,7 @@ 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), [ColorSample](/ui/primitives/data-display/color-sample), [Pill](/ui/primitives/data-display/pill), [Status](/ui/primitives/data-display/status), [Tag](/ui/primitives/data-display/tag) |
| Feedback | [Banner](/ui/primitives/feedback/banner), [Loader](/ui/primitives/feedback/loader), [ProgressBar](/ui/primitives/feedback/progress-bar), [ProgressRing](/ui/primitives/feedback/progress-ring) |
| Forms | [Button](/ui/primitives/input/button), [ButtonGroup](/ui/primitives/input/button-group), [Checkbox](/ui/primitives/input/checkbox), [Field](/ui/primitives/input/field), [Input](/ui/primitives/input/input), [InputGroup](/ui/primitives/input/input-group), [Radio](/ui/primitives/input/radio), [RadioGroup](/ui/primitives/input/radio-group), [SegmentedControl](/ui/primitives/input/segmented-control), [Select](/ui/primitives/input/select), [Slider](/ui/primitives/input/slider), [Switch](/ui/primitives/input/switch), [Textarea](/ui/primitives/input/textarea) |
-| Layout | [Collapsible](/ui/primitives/layout/collapsible), [HorizontalSeparator](/ui/primitives/layout/horizontal-separator), [ResizeHandle](/ui/primitives/layout/resize-handle), [DirectionProvider](/ui/primitives/layout/direction-provider) |
+| Layout | [Collapsible](/ui/primitives/layout/collapsible), [Separator](/ui/primitives/layout/separator), [ResizeHandle](/ui/primitives/layout/resize-handle), [DirectionProvider](/ui/primitives/layout/direction-provider) |
| Navigation | [ListItem](/ui/primitives/navigation/list-item), [Tabs](/ui/primitives/navigation/tabs) |
| 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), [OverflowingTextWithTooltip](/ui/primitives/typography/overflowing-text-with-tooltip), [Text](/ui/primitives/typography/text) |
diff --git a/packages/twenty-front-component-renderer/src/__stories__/TwentyUiGallery.stories.tsx b/packages/twenty-front-component-renderer/src/__stories__/TwentyUiGallery.stories.tsx
index d6bedfec52f..68e970bebbd 100644
--- a/packages/twenty-front-component-renderer/src/__stories__/TwentyUiGallery.stories.tsx
+++ b/packages/twenty-front-component-renderer/src/__stories__/TwentyUiGallery.stories.tsx
@@ -15,7 +15,7 @@ import { inputTest } from '@/__stories__/twenty-ui-gallery/utils/inputTest';
import { numberStepperTest } from '@/__stories__/twenty-ui-gallery/utils/numberStepperTest';
import { numberStepperSandboxFailureTest } from '@/__stories__/twenty-ui-gallery/utils/numberStepperSandboxFailureTest';
import { settingsRowTest } from '@/__stories__/twenty-ui-gallery/utils/settingsRowTest';
-import { resizeHandleTest } from '@/__stories__/twenty-ui-gallery/utils/resizeHandleTest';
+import { layoutTest } from '@/__stories__/twenty-ui-gallery/utils/layoutTest';
import { listItemTest } from '@/__stories__/twenty-ui-gallery/utils/listItemTest';
import { pickerListItemsTest } from '@/__stories__/twenty-ui-gallery/utils/pickerListItemsTest';
import { iconButtonElevatedTest } from '@/__stories__/twenty-ui-gallery/utils/iconButtonElevatedTest';
@@ -169,12 +169,12 @@ export const JsonVisualizerPreact: Story = createGalleryStory({
export const LayoutReact: Story = createGalleryStory({
frontComponentBundleName: 'twenty-ui-layout-gallery',
runtime: 'react',
- play: resizeHandleTest,
+ play: layoutTest,
});
export const LayoutPreact: Story = createGalleryStory({
frontComponentBundleName: 'twenty-ui-layout-gallery',
runtime: 'preact',
- play: resizeHandleTest,
+ play: layoutTest,
});
export const NavigationReact: Story = createGalleryStory({
diff --git a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/separator-example.tsx b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/separator-example.tsx
new file mode 100644
index 00000000000..6412192fe7c
--- /dev/null
+++ b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/separator-example.tsx
@@ -0,0 +1,44 @@
+import { createElement, useState } from 'react';
+import { Button } from 'twenty-ui/primitives/input';
+import { Separator } from 'twenty-ui/primitives/layout';
+import { Text } from 'twenty-ui/primitives/typography';
+
+export const SeparatorExample = () => {
+ const [orientation, setOrientation] = useState<'horizontal' | 'vertical'>(
+ 'horizontal',
+ );
+
+ return (
+ <>
+ <Separator aria-label="Horizontal sections" />
+ <Text style={{ display: 'flex', alignItems: 'stretch', height: 48 }}>
+ <Text>First column</Text>
+ <Separator aria-label="Vertical columns" orientation="vertical" />
+ <Text>Second column</Text>
+ </Text>
+ <Separator
+ aria-label="Composed divider"
+ orientation={orientation}
+ style={{ height: 24 }}
+ ref={(element) => {
+ element?.setAttribute('data-ref-target', 'separator');
+ }}
+ render={(props, state) =>
+ createElement('span', {
+ ...props,
+ 'data-render-orientation': state.orientation,
+ })
+ }
+ />
+ <Button
+ onClick={() =>
+ setOrientation((current) =>
+ current === 'horizontal' ? 'vertical' : 'horizontal',
+ )
+ }
+ >
+ Change divider orientation
+ </Button>
+ </>
+ );
+};
diff --git a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-layout-gallery.front-component.tsx b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-layout-gallery.front-component.tsx
index d7132531346..18aa4aa88f3 100644
--- a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-layout-gallery.front-component.tsx
+++ b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-layout-gallery.front-component.tsx
@@ -2,8 +2,9 @@ import { defineFrontComponent } from 'twenty-sdk/define';
import 'twenty-ui/style.css';
import { AnimatedIconCrossfade } from 'twenty-ui/components/layout';
import { IconHeart, IconStar } from 'twenty-ui/icon';
-import { Collapsible, HorizontalSeparator } from 'twenty-ui/primitives/layout';
+import { Collapsible } from 'twenty-ui/primitives/layout';
import { ThemeProvider } from 'twenty-ui/theme';
+import { SeparatorExample } from './separator-example';
import { ResizeHandleExample } from './resize-handle-example';
import {
@@ -28,8 +29,8 @@ const LAYOUT_ENTRIES: GalleryEntry[] = [
),
},
{
- name: 'HorizontalSeparator',
- node: <HorizontalSeparator text="or" />,
+ name: 'Separator',
+ node: <SeparatorExample />,
},
{
name: 'ResizeHandle',
diff --git a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/layoutTest.ts b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/layoutTest.ts
new file mode 100644
index 00000000000..ca013caa72a
--- /dev/null
+++ b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/layoutTest.ts
@@ -0,0 +1,29 @@
+import { expect, userEvent, waitFor, within } from 'storybook/test';
+
+import { type TwentyUiGalleryPlayFunction } from '@/__stories__/twenty-ui-gallery/types/TwentyUiGalleryPlayFunction';
+import { resizeHandleTest } from '@/__stories__/twenty-ui-gallery/utils/resizeHandleTest';
+
+export const layoutTest: TwentyUiGalleryPlayFunction = async (context) => {
+ await resizeHandleTest(context);
+ const canvas = within(context.canvasElement);
+ const horizontal = canvas.getByRole('separator', {
+ name: 'Horizontal sections',
+ });
+ const vertical = canvas.getByRole('separator', { name: 'Vertical columns' });
+ const composed = canvas.getByRole('separator', { name: 'Composed divider' });
+
+ expect(horizontal).toHaveAttribute('aria-orientation', 'horizontal');
+ expect(horizontal.getBoundingClientRect().height).toBe(1);
+ expect(vertical).toHaveAttribute('aria-orientation', 'vertical');
+ expect(vertical.getBoundingClientRect().width).toBe(1);
+ expect(vertical.getBoundingClientRect().height).toBe(48);
+ expect(composed.tagName).toBe('SPAN');
+ expect(composed).toHaveAttribute('data-ref-target', 'separator');
+ await userEvent.click(
+ canvas.getByRole('button', { name: 'Change divider orientation' }),
+ );
+ await waitFor(() => {
+ expect(composed).toHaveAttribute('aria-orientation', 'vertical');
+ expect(composed).toHaveAttribute('data-render-orientation', 'vertical');
+ });
+};
diff --git a/packages/twenty-front/src/modules/ai/components/AiChatMessage.tsx b/packages/twenty-front/src/modules/ai/components/AiChatMessage.tsx
index 01958a6744e..af191a81b32 100644
--- a/packages/twenty-front/src/modules/ai/components/AiChatMessage.tsx
+++ b/packages/twenty-front/src/modules/ai/components/AiChatMessage.tsx
@@ -23,7 +23,7 @@ import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomState
import { isExtendedFileUIPart } from 'twenty-shared/ai';
import { isDefined } from 'twenty-shared/utils';
import { themeCssVariables } from 'twenty-ui/theme';
-import { HorizontalSeparator } from 'twenty-ui/primitives/layout';
+import { LabeledDivider } from '@/ui/layout/line/components/LabeledDivider';
import { dateLocaleState } from '~/localization/states/dateLocaleState';
import { beautifyPastDateRelativeToNow } from '~/utils/date-utils';
@@ -231,12 +231,11 @@ export const AiChatMessage = ({
return (
<>
{firstUnreadMessageId === messageId && (
- <HorizontalSeparator
- text={t`New`}
+ <LabeledDivider
textPosition="end"
color={themeCssVariables.tag.text.red}
noMargin
- />
+ >{t`New`}</LabeledDivider>
)}
<StyledMessageBubble isUser={isUser}>
{isUser && isDefined(senderId) && (
diff --git a/packages/twenty-front/src/modules/ai/components/AiModelTierInformationButton.tsx b/packages/twenty-front/src/modules/ai/components/AiModelTierInformationButton.tsx
index 0c17b399d88..37f2c78d708 100644
--- a/packages/twenty-front/src/modules/ai/components/AiModelTierInformationButton.tsx
+++ b/packages/twenty-front/src/modules/ai/components/AiModelTierInformationButton.tsx
@@ -11,7 +11,7 @@ import {
IconGauge,
IconInfoCircle,
} from 'twenty-ui/icon';
-import { HorizontalSeparator } from 'twenty-ui/primitives/layout';
+import { Separator } from 'twenty-ui/primitives/layout';
import { MetricRow } from 'twenty-ui/components/data-display';
import { themeCssVariables, useThemeContainer } from 'twenty-ui/theme';
@@ -144,7 +144,7 @@ export const AiModelTierInformationButton = ({
{label}
</MetricRow>
))}
- <HorizontalSeparator noMargin />
+ <Separator />
<StyledHeading>{t`Vs Balanced mode`}</StyledHeading>
{comparisons.map(({ label, Icon, value }) => (
<MetricRow key={label} startIcon={Icon} value={value}>
diff --git a/packages/twenty-front/src/modules/ai/components/internal/AiChatContextUsageButton.tsx b/packages/twenty-front/src/modules/ai/components/internal/AiChatContextUsageButton.tsx
index 4416e00b4d1..b2e523db754 100644
--- a/packages/twenty-front/src/modules/ai/components/internal/AiChatContextUsageButton.tsx
+++ b/packages/twenty-front/src/modules/ai/components/internal/AiChatContextUsageButton.tsx
@@ -10,7 +10,7 @@ import { MetricRow } from 'twenty-ui/components/data-display';
import { ProgressRing } from 'twenty-ui/primitives/feedback';
import { Button } from 'twenty-ui/primitives/input';
import { IconWindow, IconGauge } from 'twenty-ui/icon';
-import { HorizontalSeparator } from 'twenty-ui/primitives/layout';
+import { Separator } from 'twenty-ui/primitives/layout';
import { themeCssVariables } from 'twenty-ui/theme';
import { AiChatContextUsageDetails } from '@/ai/components/internal/AiChatContextUsageDetails';
@@ -230,7 +230,7 @@ export const AiChatContextUsageButton = () => {
{showDetails && <AiChatContextUsageDetails />}
{isDefined(agentChatUsage) && (
<>
- <HorizontalSeparator noMargin />
+ <Separator />
<StyledFooter>
<Button
size="sm"
diff --git a/packages/twenty-front/src/modules/ai/components/internal/AiChatContextUsageDetails.tsx b/packages/twenty-front/src/modules/ai/components/internal/AiChatContextUsageDetails.tsx
index 591abfeb08b..05002f17b59 100644
--- a/packages/twenty-front/src/modules/ai/components/internal/AiChatContextUsageDetails.tsx
+++ b/packages/twenty-front/src/modules/ai/components/internal/AiChatContextUsageDetails.tsx
@@ -3,7 +3,7 @@ import { styled } from '@linaria/react';
import { useLingui } from '@lingui/react/macro';
import { isDefined } from 'twenty-shared/utils';
import { MetricRow } from 'twenty-ui/components/data-display';
-import { HorizontalSeparator } from 'twenty-ui/primitives/layout';
+import { Separator } from 'twenty-ui/primitives/layout';
import {
IconArrowUp,
IconArrowDown,
@@ -50,7 +50,7 @@ export const AiChatContextUsageDetails = () => {
<>
{isDefined(lastMessage) && (
<>
- <HorizontalSeparator noMargin />
+ <Separator />
<StyledSection>
<StyledSectionTitle>{t`Last message`}</StyledSectionTitle>
<MetricRow
@@ -83,7 +83,7 @@ export const AiChatContextUsageDetails = () => {
</StyledSection>
</>
)}
- <HorizontalSeparator noMargin />
+ <Separator />
<StyledSection>
<StyledSectionTitle>{t`Conversation`}</StyledSectionTitle>
<MetricRow
diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpGlobalScopeForm.tsx b/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpGlobalScopeForm.tsx
index 0d09cafefbd..e112e9676c9 100644
--- a/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpGlobalScopeForm.tsx
+++ b/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpGlobalScopeForm.tsx
@@ -29,7 +29,7 @@ import { getWorkspaceAvatarColorSeed } from '@/workspace/utils/getWorkspaceAvata
import { isNonEmptyString } from '@sniptt/guards';
import { IconChevronRight, IconPlus } from 'twenty-ui/icon';
import { Avatar } from 'twenty-ui/primitives/data-display';
-import { HorizontalSeparator } from 'twenty-ui/primitives/layout';
+import { Separator } from 'twenty-ui/primitives/layout';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
import {
type AvailableWorkspace,
@@ -250,8 +250,11 @@ export const SignInUpGlobalScopeForm = () => {
/>
)}
{(authProviders.google || authProviders.microsoft) && (
- <HorizontalSeparator
- color={themeCssVariables.background.transparent.light}
+ <Separator
+ style={{
+ backgroundColor: themeCssVariables.background.transparent.light,
+ marginBlock: themeCssVariables.spacing[3],
+ }}
/>
)}
{/* oxlint-disable-next-line react/jsx-props-no-spreading */}
diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpWorkspaceScopeForm.tsx b/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpWorkspaceScopeForm.tsx
index db3011a9ff8..7a03d685b15 100644
--- a/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpWorkspaceScopeForm.tsx
+++ b/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpWorkspaceScopeForm.tsx
@@ -12,8 +12,9 @@ import { workspaceAuthBypassProvidersState } from '@/workspace/states/workspaceA
import { workspaceAuthProvidersState } from '@/workspace/states/workspaceAuthProvidersState';
import { Trans } from '@lingui/react/macro';
import { FormProvider } from 'react-hook-form';
-import { HorizontalSeparator } from 'twenty-ui/primitives/layout';
+import { Separator } from 'twenty-ui/primitives/layout';
import { Button } from 'twenty-ui/primitives/input';
+import { themeCssVariables } from 'twenty-ui/theme';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
export const SignInUpWorkspaceScopeForm = () => {
@@ -56,7 +57,7 @@ export const SignInUpWorkspaceScopeForm = () => {
providers.microsoft ||
providers.sso.length > 0) &&
providers.password ? (
- <HorizontalSeparator />
+ <Separator style={{ marginBlock: themeCssVariables.spacing[3] }} />
) : null}
{providers.password && (
// oxlint-disable-next-line react/jsx-props-no-spreading
diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpSeparator.tsx b/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpSeparator.tsx
new file mode 100644
index 00000000000..0f85118deed
--- /dev/null
+++ b/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpSeparator.tsx
@@ -0,0 +1,10 @@
+import { styled } from '@linaria/react';
+import { themeCssVariables } from 'twenty-ui/theme';
+
+const StyledSignInUpSeparator = styled.div`
+ margin-block: ${themeCssVariables.spacing[3]};
+`;
+
+export const SignInUpSeparator = () => {
+ return <StyledSignInUpSeparator />;
+};
diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpSsoIdentityProviderSelection.tsx b/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpSsoIdentityProviderSelection.tsx
index d54ad80879c..7e4cde44148 100644
--- a/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpSsoIdentityProviderSelection.tsx
+++ b/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpSsoIdentityProviderSelection.tsx
@@ -8,8 +8,8 @@ import { workspaceAuthProvidersState } from '@/workspace/states/workspaceAuthPro
import React from 'react';
import { isDefined } from 'twenty-shared/utils';
import { MainButton } from 'twenty-ui/components/input';
-import { HorizontalSeparator } from 'twenty-ui/primitives/layout';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
+import { SignInUpSeparator } from './SignInUpSeparator';
export const SignInUpSsoIdentityProviderSelection = () => {
const workspaceAuthProviders = useAtomStateValue(workspaceAuthProvidersState);
@@ -34,7 +34,7 @@ export const SignInUpSsoIdentityProviderSelection = () => {
>
{identityProvider.name}
</MainButton>
- <HorizontalSeparator visible={false} />
+ <SignInUpSeparator />
</React.Fragment>
);
})}
diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpWithGoogle.tsx b/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpWithGoogle.tsx
index 594905f857f..42dae5351ac 100644
--- a/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpWithGoogle.tsx
+++ b/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpWithGoogle.tsx
@@ -12,12 +12,12 @@ import { useLingui } from '@lingui/react/macro';
import { memo } from 'react';
import { MainButton } from 'twenty-ui/components/input';
import { IconGoogle } from 'twenty-ui/icon';
-import { HorizontalSeparator } from 'twenty-ui/primitives/layout';
import { useAtomState } from '@/ui/utilities/state/jotai/hooks/useAtomState';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { LastUsedPill } from './LastUsedPill';
import { StyledSsoButtonContainer } from './SignInUpSsoButtonStyles';
import { useTheme } from 'twenty-ui/theme';
+import { SignInUpSeparator } from './SignInUpSeparator';
const GoogleIcon = memo(() => {
const theme = useTheme();
@@ -59,7 +59,7 @@ export const SignInUpWithGoogle = ({
<LastUsedPill />
)}
</StyledSsoButtonContainer>
- <HorizontalSeparator visible={false} />
+ <SignInUpSeparator />
</>
);
};
diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpWithMicrosoft.tsx b/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpWithMicrosoft.tsx
index cfc0297dd6a..f906747a035 100644
--- a/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpWithMicrosoft.tsx
+++ b/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpWithMicrosoft.tsx
@@ -10,12 +10,12 @@ import { type SocialSsoSignInUpActionType } from '@/auth/types/SocialSsoSignInUp
import { useLingui } from '@lingui/react/macro';
import { MainButton } from 'twenty-ui/components/input';
import { IconMicrosoft } from 'twenty-ui/icon';
-import { HorizontalSeparator } from 'twenty-ui/primitives/layout';
import { useAtomState } from '@/ui/utilities/state/jotai/hooks/useAtomState';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { LastUsedPill } from './LastUsedPill';
import { StyledSsoButtonContainer } from './SignInUpSsoButtonStyles';
import { useTheme } from 'twenty-ui/theme';
+import { SignInUpSeparator } from './SignInUpSeparator';
export const SignInUpWithMicrosoft = ({
action,
@@ -54,7 +54,7 @@ export const SignInUpWithMicrosoft = ({
<LastUsedPill />
)}
</StyledSsoButtonContainer>
- <HorizontalSeparator visible={false} />
+ <SignInUpSeparator />
</>
);
};
diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpWithSso.tsx b/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpWithSso.tsx
index 272e091bee5..7e9524aca10 100644
--- a/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpWithSso.tsx
+++ b/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpWithSso.tsx
@@ -14,10 +14,10 @@ import { useLingui } from '@lingui/react/macro';
import { isDefined } from 'twenty-shared/utils';
import { MainButton } from 'twenty-ui/components/input';
import { IconLock } from 'twenty-ui/icon';
-import { HorizontalSeparator } from 'twenty-ui/primitives/layout';
import { LastUsedPill } from './LastUsedPill';
import { StyledSsoButtonContainer } from './SignInUpSsoButtonStyles';
import { useTheme } from 'twenty-ui/theme';
+import { SignInUpSeparator } from './SignInUpSeparator';
export const SignInUpWithSso = () => {
const theme = useTheme();
@@ -57,7 +57,7 @@ export const SignInUpWithSso = () => {
>{t`Single sign-on (SSO)`}</MainButton>
{isLastUsed && hasMultipleAuthMethods && <LastUsedPill />}
</StyledSsoButtonContainer>
- <HorizontalSeparator visible={false} />
+ <SignInUpSeparator />
</>
);
};
diff --git a/packages/twenty-front/src/modules/onboarding/components/free-credits/OnboardingFreeCreditsPopoverContent.tsx b/packages/twenty-front/src/modules/onboarding/components/free-credits/OnboardingFreeCreditsPopoverContent.tsx
index c02da73c509..fde8f965b18 100644
--- a/packages/twenty-front/src/modules/onboarding/components/free-credits/OnboardingFreeCreditsPopoverContent.tsx
+++ b/packages/twenty-front/src/modules/onboarding/components/free-credits/OnboardingFreeCreditsPopoverContent.tsx
@@ -22,7 +22,7 @@ import {
IconWand,
} from 'twenty-ui/icon';
import { MetricRow } from 'twenty-ui/components/data-display';
-import { HorizontalSeparator } from 'twenty-ui/primitives/layout';
+import { Separator } from 'twenty-ui/primitives/layout';
import { themeCssVariables, useTheme } from 'twenty-ui/theme';
const StyledContent = styled.div`
@@ -112,7 +112,7 @@ export const OnboardingFreeCreditsPopoverContent = ({
</StyledSection>
{isNonEmptyArray(earnedCreditsByStep) && (
<>
- <HorizontalSeparator noMargin />
+ <Separator />
<StyledSection>
<StyledSectionTitle>{t`Breakdown`}</StyledSectionTitle>
{earnedCreditsByStep.map(({ step, credits, rewardCredits }) => (
@@ -131,7 +131,7 @@ export const OnboardingFreeCreditsPopoverContent = ({
</StyledSection>
</>
)}
- <HorizontalSeparator noMargin />
+ <Separator />
<StyledSection>
<StyledSectionTitle>
{earnedCredits > 0
@@ -163,7 +163,7 @@ export const OnboardingFreeCreditsPopoverContent = ({
{t`Shared inbox emails`}
</MetricRow>
</StyledSection>
- <HorizontalSeparator noMargin />
+ <Separator />
<StyledFooter>
<IconInfoCircle size={theme.icon.size.sm} />
{t`Stacks on top of your plan and never expires`}
diff --git a/packages/twenty-front/src/modules/settings/security/components/sso/SettingsSsoSamlForm.tsx b/packages/twenty-front/src/modules/settings/security/components/sso/SettingsSsoSamlForm.tsx
index 2e3486c040c..a7897541477 100644
--- a/packages/twenty-front/src/modules/settings/security/components/sso/SettingsSsoSamlForm.tsx
+++ b/packages/twenty-front/src/modules/settings/security/components/sso/SettingsSsoSamlForm.tsx
@@ -9,7 +9,7 @@ import { useToast } from 'twenty-ui/components/feedback';
import { Section } from 'twenty-ui/components/layout';
import { IconCheck, IconCopy, IconDownload, IconUpload } from 'twenty-ui/icon';
import { Button } from 'twenty-ui/primitives/input';
-import { HorizontalSeparator } from 'twenty-ui/primitives/layout';
+import { LabeledDivider } from '@/ui/layout/line/components/LabeledDivider';
import { useTheme, themeCssVariables } from 'twenty-ui/theme';
import { REACT_APP_SERVER_BASE_URL } from '~/config';
import { useCopyToClipboard } from '~/hooks/useCopyToClipboard';
@@ -156,7 +156,7 @@ export const SettingsSsoSamlForm = () => {
type="button"
>{t`Download file`}</Button>
</StyledContainer>
- <HorizontalSeparator text={t`Or`} />
+ <LabeledDivider>{t`Or`}</LabeledDivider>
<StyledContainer>
<StyledLinkContainer>
<SettingsTextInput
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 07c8fd9942d..5a0450d8e89 100644
--- a/packages/twenty-front/src/modules/settings/unsubscribers/components/SettingsUnsubscribePreview.tsx
+++ b/packages/twenty-front/src/modules/settings/unsubscribers/components/SettingsUnsubscribePreview.tsx
@@ -9,7 +9,7 @@ import {
Radio,
RadioGroup,
} from 'twenty-ui/primitives/input';
-import { HorizontalSeparator } from 'twenty-ui/primitives/layout';
+import { LabeledDivider } from '@/ui/layout/line/components/LabeledDivider';
import { Card } from 'twenty-ui/primitives/surfaces';
import { themeCssVariables } from 'twenty-ui/theme';
import { UnsubscribeTopicVisibility } from '~/generated-metadata/graphql';
@@ -142,7 +142,7 @@ export const SettingsUnsubscribePreview = () => {
<Button fullWidth variant="solid" color="accent">
{t`Update`}
</Button>
- <HorizontalSeparator text={t`Or`} noMargin />
+ <LabeledDivider noMargin>{t`Or`}</LabeledDivider>
<Button fullWidth variant="outline">
{t`Unsubscribe all`}
</Button>
diff --git a/packages/twenty-front/src/modules/ui/layout/line/components/LabeledDivider.tsx b/packages/twenty-front/src/modules/ui/layout/line/components/LabeledDivider.tsx
new file mode 100644
index 00000000000..1e62ae32357
--- /dev/null
+++ b/packages/twenty-front/src/modules/ui/layout/line/components/LabeledDivider.tsx
@@ -0,0 +1,51 @@
+import { styled } from '@linaria/react';
+import { Separator } from 'twenty-ui/primitives/layout';
+import { Text } from 'twenty-ui/primitives/typography';
+import { themeCssVariables } from 'twenty-ui/theme';
+
+const StyledContainer = styled.div<{ noMargin: boolean }>`
+ align-items: center;
+ display: flex;
+ margin-block: ${({ noMargin }) =>
+ noMargin ? '0' : themeCssVariables.spacing[3]};
+ width: 100%;
+`;
+
+const StyledLabel = styled(Text)`
+ color: ${themeCssVariables.font.color.light};
+ font-size: 11px;
+ font-weight: ${themeCssVariables.font.weight.semiBold};
+ margin-inline: ${themeCssVariables.spacing[2]};
+`;
+
+type LabeledDividerProps = {
+ children: string;
+ noMargin?: boolean;
+ color?: string;
+ textPosition?: 'center' | 'end';
+};
+
+export const LabeledDivider = ({
+ children,
+ noMargin = false,
+ color,
+ textPosition = 'center',
+}: LabeledDividerProps) => {
+ const separatorStyle = {
+ backgroundColor: color,
+ flexGrow: 1,
+ width: 'auto',
+ };
+
+ return (
+ <StyledContainer role="separator" aria-label={children} noMargin={noMargin}>
+ <Separator aria-hidden style={separatorStyle} />
+ <StyledLabel render={<span />} style={{ color }}>
+ {children}
+ </StyledLabel>
+ {textPosition === 'center' && (
+ <Separator aria-hidden style={separatorStyle} />
+ )}
+ </StyledContainer>
+ );
+};
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/classify-action/components/WorkflowEditActionClassify.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/classify-action/components/WorkflowEditActionClassify.tsx
index a84aaf12cac..86dd4f2f093 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/classify-action/components/WorkflowEditActionClassify.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/classify-action/components/WorkflowEditActionClassify.tsx
@@ -27,7 +27,7 @@ import {
IconTrash,
} from 'twenty-ui/icon';
import { Button, Field } from 'twenty-ui/primitives/input';
-import { HorizontalSeparator } from 'twenty-ui/primitives/layout';
+import { Separator } from 'twenty-ui/primitives/layout';
import { themeCssVariables } from 'twenty-ui/theme';
const StyledQuestion = styled.div`
@@ -152,7 +152,7 @@ export const WorkflowEditActionClassify = ({
{questions.map((question) => (
<StyledQuestion key={question.id}>
- <HorizontalSeparator noMargin />
+ <Separator />
<FormFieldInputContainer>
<StyledNameRow>
@@ -231,7 +231,7 @@ export const WorkflowEditActionClassify = ({
{!readonly && (
<>
- <HorizontalSeparator noMargin />
+ <Separator />
<Button
startIcon={<IconPlus />}
onClick={() =>
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionCreateRecord.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionCreateRecord.tsx
index a697640bff0..d7db8beb952 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionCreateRecord.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionCreateRecord.tsx
@@ -21,7 +21,7 @@ import { t } from '@lingui/core/macro';
import { useEffect, useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { canObjectBeManagedByAutomation } from 'twenty-shared/workflow';
-import { HorizontalSeparator } from 'twenty-ui/primitives/layout';
+import { Separator } from 'twenty-ui/primitives/layout';
import { type SelectOption } from 'twenty-ui/primitives/input';
import { type JsonValue } from 'type-fest';
import { useDebouncedCallback } from 'use-debounce';
@@ -217,7 +217,7 @@ export const WorkflowEditActionCreateRecord = ({
dropdownWidth={GenericDropdownContentWidth.ExtraLarge}
/>
- <HorizontalSeparator noMargin />
+ <Separator />
{inlineFieldDefinitions?.map((fieldDefinition) => {
const currentValue = isFieldRelationManyToOne(fieldDefinition)
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionDeleteRecord.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionDeleteRecord.tsx
index fd0160b7004..4d45f82dfbc 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionDeleteRecord.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionDeleteRecord.tsx
@@ -12,7 +12,7 @@ import { WorkflowStepFooter } from '@/workflow/workflow-steps/components/Workflo
import { WorkflowVariablePicker } from '@/workflow/workflow-variables/components/WorkflowVariablePicker';
import { isDefined } from 'twenty-shared/utils';
import { canObjectBeManagedByAutomation } from 'twenty-shared/workflow';
-import { HorizontalSeparator } from 'twenty-ui/primitives/layout';
+import { Separator } from 'twenty-ui/primitives/layout';
import { type SelectOption } from 'twenty-ui/primitives/input';
import { type JsonValue } from 'type-fest';
import { useDebouncedCallback } from 'use-debounce';
@@ -137,7 +137,7 @@ export const WorkflowEditActionDeleteRecord = ({
dropdownWidth={GenericDropdownContentWidth.ExtraLarge}
/>
- <HorizontalSeparator noMargin />
+ <Separator />
{isDefined(objectNameSingular) && (
<FormSingleRecordPicker
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionUpdateRecord.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionUpdateRecord.tsx
index 5c8616bfbaf..3688c45c46a 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionUpdateRecord.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionUpdateRecord.tsx
@@ -17,7 +17,7 @@ import { t } from '@lingui/core/macro';
import { useEffect, useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { canObjectBeManagedByAutomation } from 'twenty-shared/workflow';
-import { HorizontalSeparator } from 'twenty-ui/primitives/layout';
+import { Separator } from 'twenty-ui/primitives/layout';
import { type SelectOption } from 'twenty-ui/primitives/input';
import { type JsonValue } from 'type-fest';
import { useDebouncedCallback } from 'use-debounce';
@@ -179,7 +179,7 @@ export const WorkflowEditActionUpdateRecord = ({
dropdownWidth={GenericDropdownContentWidth.ExtraLarge}
/>
- <HorizontalSeparator noMargin />
+ <Separator />
{isDefined(objectNameSingular) && (
<FormSingleRecordPicker
@@ -209,7 +209,7 @@ export const WorkflowEditActionUpdateRecord = ({
/>
)}
- <HorizontalSeparator noMargin />
+ <Separator />
{formData.fieldsToUpdate.map((fieldName) => {
const fieldDefinition = inlineFieldDefinitions?.find((definition) => {
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionUpsertRecord.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionUpsertRecord.tsx
index f64c0f24fb7..bd1eb9c7321 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionUpsertRecord.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionUpsertRecord.tsx
@@ -23,7 +23,7 @@ import { t } from '@lingui/core/macro';
import { useEffect, useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { canObjectBeManagedByAutomation } from 'twenty-shared/workflow';
-import { HorizontalSeparator } from 'twenty-ui/primitives/layout';
+import { Separator } from 'twenty-ui/primitives/layout';
import { type SelectOption } from 'twenty-ui/primitives/input';
import { type JsonValue } from 'type-fest';
import { useDebouncedCallback } from 'use-debounce';
@@ -253,7 +253,7 @@ export const WorkflowEditActionUpsertRecord = ({
/>
)}
- <HorizontalSeparator noMargin />
+ <Separator />
{inlineFieldDefinitions?.map((fieldDefinition) => {
const isIdField = fieldDefinition.metadata.fieldName === 'id';
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/delay-actions/components/WorkflowEditActionDelay.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/delay-actions/components/WorkflowEditActionDelay.tsx
index ecf5e0526f6..787ea9317b9 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/delay-actions/components/WorkflowEditActionDelay.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/delay-actions/components/WorkflowEditActionDelay.tsx
@@ -9,7 +9,7 @@ import { WorkflowVariablePicker } from '@/workflow/workflow-variables/components
import { t } from '@lingui/core/macro';
import { useEffect, useState } from 'react';
import { IconCalendar, IconHourglassHigh } from 'twenty-ui/icon';
-import { HorizontalSeparator } from 'twenty-ui/primitives/layout';
+import { Separator } from 'twenty-ui/primitives/layout';
import { type SelectOption } from 'twenty-ui/primitives/input';
type WorkflowEditActionDelayProps = {
@@ -178,7 +178,7 @@ export const WorkflowEditActionDelay = ({
onChange={handleDelayTypeChange}
disabled={actionOptions.readonly}
/>
- <HorizontalSeparator noMargin />
+ <Separator />
{action.settings.input.delayType === 'SCHEDULED_DATE' && (
<FormDateTimeFieldInput
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/find-records-action/components/WorkflowEditActionFindRecords.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/find-records-action/components/WorkflowEditActionFindRecords.tsx
index cddf4221c3f..6d2c17d2f5d 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/find-records-action/components/WorkflowEditActionFindRecords.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/find-records-action/components/WorkflowEditActionFindRecords.tsx
@@ -3,7 +3,7 @@ import { isNumber } from '@sniptt/guards';
import { useEffect, useState } from 'react';
import { QUERY_MAX_RECORDS } from 'twenty-shared/constants';
import { isDefined } from 'twenty-shared/utils';
-import { HorizontalSeparator } from 'twenty-ui/primitives/layout';
+import { Separator } from 'twenty-ui/primitives/layout';
import { type JsonValue } from 'type-fest';
import { useDebouncedCallback } from 'use-debounce';
@@ -177,7 +177,7 @@ export const WorkflowEditActionFindRecords = ({
dropdownWidth={GenericDropdownContentWidth.ExtraLarge}
/>
- <HorizontalSeparator noMargin />
+ <Separator />
{isDefined(selectedObjectMetadataItem) && (
<div>
<InputLabel>{t`Filter`}</InputLabel>
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/if-else-action/components/WorkflowEditActionIfElseBody.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/if-else-action/components/WorkflowEditActionIfElseBody.tsx
index 67b056a17c0..30a8154b4c1 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/if-else-action/components/WorkflowEditActionIfElseBody.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/if-else-action/components/WorkflowEditActionIfElseBody.tsx
@@ -28,7 +28,7 @@ import { isDefined } from 'twenty-shared/utils';
import { type StepIfElseBranch } from 'twenty-shared/workflow';
import { IconPlus } from 'twenty-ui/icon';
import { Button } from 'twenty-ui/primitives/input';
-import { HorizontalSeparator } from 'twenty-ui/primitives/layout';
+import { Separator } from 'twenty-ui/primitives/layout';
import { themeCssVariables } from 'twenty-ui/theme';
const StyledContainer = styled.div`
@@ -257,10 +257,10 @@ export const WorkflowEditActionIfElseBody = ({
return (
<Fragment key={branch.id}>
- {branchIndex > 0 && !isElse && <HorizontalSeparator noMargin />}
+ {branchIndex > 0 && !isElse && <Separator />}
{isElse && !isReadonly && (
<>
- <HorizontalSeparator noMargin />
+ <Separator />
<Button
startIcon={<IconPlus />}
size="sm"
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/pick-record-action/components/WorkflowEditActionPickRecord.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/pick-record-action/components/WorkflowEditActionPickRecord.tsx
index 1879a713561..0a9758fa8ab 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/pick-record-action/components/WorkflowEditActionPickRecord.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/pick-record-action/components/WorkflowEditActionPickRecord.tsx
@@ -6,7 +6,7 @@ import { useLingui } from '@lingui/react/macro';
import { useEffect, useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { type SelectOption } from 'twenty-ui/primitives/input';
-import { HorizontalSeparator } from 'twenty-ui/primitives/layout';
+import { Separator } from 'twenty-ui/primitives/layout';
import { useDebouncedCallback } from 'use-debounce';
import { useFilteredObjectMetadataItems } from '@/object-metadata/hooks/useFilteredObjectMetadataItems';
@@ -288,7 +288,7 @@ export const WorkflowEditActionPickRecord = ({
</>
)}
- <HorizontalSeparator noMargin />
+ <Separator />
{isDefined(selectedObjectMetadataItem) && (
<FormMultiRecordPicker
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/wait-for-event-action/components/WorkflowEditActionWaitForEvent.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/wait-for-event-action/components/WorkflowEditActionWaitForEvent.tsx
index 27773d414d2..fffafca5c09 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/wait-for-event-action/components/WorkflowEditActionWaitForEvent.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/wait-for-event-action/components/WorkflowEditActionWaitForEvent.tsx
@@ -16,7 +16,7 @@ import { isNumber } from '@sniptt/guards';
import { useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { type SelectOption } from 'twenty-ui/primitives/input';
-import { HorizontalSeparator } from 'twenty-ui/primitives/layout';
+import { Separator } from 'twenty-ui/primitives/layout';
type WaitForEventInput = WorkflowWaitForEventAction['settings']['input'];
@@ -180,7 +180,7 @@ export const WorkflowEditActionWaitForEvent = ({
actionType="DATABASE_EVENT"
/>
)}
- <HorizontalSeparator noMargin />
+ <Separator />
<FormNumberFieldInput
label={t`Timeout days (Optional)`}
defaultValue={timeoutDraft.days}
diff --git a/packages/twenty-shared/src/constants/DocumentationPaths.ts b/packages/twenty-shared/src/constants/DocumentationPaths.ts
index 8550cd1cdcc..690e92505f1 100644
--- a/packages/twenty-shared/src/constants/DocumentationPaths.ts
+++ b/packages/twenty-shared/src/constants/DocumentationPaths.ts
@@ -200,9 +200,8 @@ export const DOCUMENTATION_PATHS = {
UI_PRIMITIVES_LAYOUT_COLLAPSIBLE: '/ui/primitives/layout/collapsible',
UI_PRIMITIVES_LAYOUT_DIRECTION_PROVIDER:
'/ui/primitives/layout/direction-provider',
- UI_PRIMITIVES_LAYOUT_HORIZONTAL_SEPARATOR:
- '/ui/primitives/layout/horizontal-separator',
UI_PRIMITIVES_LAYOUT_RESIZE_HANDLE: '/ui/primitives/layout/resize-handle',
+ UI_PRIMITIVES_LAYOUT_SEPARATOR: '/ui/primitives/layout/separator',
UI_PRIMITIVES_NAVIGATION_BREADCRUMB: '/ui/primitives/navigation/breadcrumb',
UI_PRIMITIVES_NAVIGATION_LIST_ITEM: '/ui/primitives/navigation/list-item',
UI_PRIMITIVES_NAVIGATION_TABS: '/ui/primitives/navigation/tabs',
diff --git a/packages/twenty-ui/docs/components.ts b/packages/twenty-ui/docs/components.ts
index 7c36a217ff7..07e751a41c2 100644
--- a/packages/twenty-ui/docs/components.ts
+++ b/packages/twenty-ui/docs/components.ts
@@ -47,7 +47,7 @@ import { DIALOG_POPUP_PROP_DESCRIPTIONS } from './dialogPopupPropDescriptions';
import { DIALOG_TITLE_PROP_DESCRIPTIONS } from './dialogTitlePropDescriptions';
import { DROPDOWN_PART_PROP_DESCRIPTIONS } from './dropdownPartPropDescriptions';
import { HEADING_PROP_DESCRIPTIONS } from './headingPropDescriptions';
-import { HORIZONTAL_SEPARATOR_PROP_DESCRIPTIONS } from './horizontalSeparatorPropDescriptions';
+import { SEPARATOR_PROP_DESCRIPTIONS } from './separatorPropDescriptions';
import { ICON_BUTTON_PROP_DESCRIPTIONS } from './iconButtonPropDescriptions';
import { LIGHT_BUTTON_PROP_DESCRIPTIONS } from './lightButtonPropDescriptions';
import { LIGHT_ICON_BUTTON_PROP_DESCRIPTIONS } from './lightIconButtonPropDescriptions';
@@ -172,11 +172,11 @@ export const DOCUMENTED_COMPONENTS = [
propDescriptions: COLLAPSIBLE_PROP_DESCRIPTIONS,
},
{
- name: 'HorizontalSeparator',
- source: 'primitives/layout/HorizontalSeparator/HorizontalSeparator.tsx',
+ name: 'Separator',
+ source: 'primitives/layout/Separator/Separator.tsx',
entryPoint: 'twenty-ui/primitives/layout',
- slug: 'layout/horizontal-separator',
- propDescriptions: HORIZONTAL_SEPARATOR_PROP_DESCRIPTIONS,
+ slug: 'layout/separator',
+ propDescriptions: SEPARATOR_PROP_DESCRIPTIONS,
},
{
name: 'ResizeHandle',
diff --git a/packages/twenty-ui/docs/horizontalSeparatorPropDescriptions.ts b/packages/twenty-ui/docs/horizontalSeparatorPropDescriptions.ts
deleted file mode 100644
index 55d63437669..00000000000
--- a/packages/twenty-ui/docs/horizontalSeparatorPropDescriptions.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { type ComponentProps } from 'react';
-
-import { type HorizontalSeparator } from '../src/primitives/layout/HorizontalSeparator/HorizontalSeparator';
-
-export const HORIZONTAL_SEPARATOR_PROP_DESCRIPTIONS = {
- visible:
- 'Shows the dividing line. Setting it to false preserves margins and any text.',
- text: 'Optional label displayed between two lines.',
- noMargin: 'Removes the vertical margins.',
- color:
- 'CSS color for the line and text. Defaults to the medium border color.',
- textPosition:
- 'Places the text between two lines, or at the end of a single line.',
-} satisfies Partial<
- Record<keyof ComponentProps<typeof HorizontalSeparator>, string>
->;
diff --git a/packages/twenty-ui/docs/module-ownership.json b/packages/twenty-ui/docs/module-ownership.json
index fa2c687ae17..5dd58f5518b 100644
--- a/packages/twenty-ui/docs/module-ownership.json
+++ b/packages/twenty-ui/docs/module-ownership.json
@@ -13,9 +13,9 @@
"Collapsible",
"ColorSample",
"Dialog",
+ "DirectionProvider",
"Field",
"Heading",
- "HorizontalSeparator",
"Input",
"InputGroup",
"ListItem",
@@ -32,6 +32,7 @@
"ResizeHandle",
"SegmentedControl",
"Select",
+ "Separator",
"Shortcut",
"Slider",
"Status",
@@ -39,7 +40,6 @@
"Tabs",
"Tag",
"Text",
- "DirectionProvider",
"Textarea",
"Tooltip",
"VisibilityHidden"
diff --git a/packages/twenty-ui/docs/public-exports.json b/packages/twenty-ui/docs/public-exports.json
index 101ac76e295..54e4a23f0d2 100644
--- a/packages/twenty-ui/docs/public-exports.json
+++ b/packages/twenty-ui/docs/public-exports.json
@@ -815,16 +815,17 @@
"reExports": [],
"values": {
"Collapsible": "primitives/layout/Collapsible/Collapsible",
- "HorizontalSeparator": "primitives/layout/HorizontalSeparator/HorizontalSeparator",
+ "DirectionProvider": "primitives/layout/DirectionProvider/DirectionProvider",
"ResizeHandle": "primitives/layout/ResizeHandle/ResizeHandle",
- "DirectionProvider": "primitives/layout/DirectionProvider/DirectionProvider"
+ "Separator": "primitives/layout/Separator/Separator"
},
"types": {
"AnimationDimension": "primitives/layout/Collapsible/types/AnimationDimension",
"AnimationDurationObject": "primitives/layout/Collapsible/types/AnimationDurationObject",
"AnimationDurations": "primitives/layout/Collapsible/types/AnimationDurations",
+ "DirectionProviderProps": "primitives/layout/DirectionProvider/types/DirectionProviderProps",
"ResizeHandleProps": "primitives/layout/ResizeHandle/types/ResizeHandleProps",
- "DirectionProviderProps": "primitives/layout/DirectionProvider/types/DirectionProviderProps"
+ "SeparatorProps": "primitives/layout/Separator/types/SeparatorProps"
}
},
"primitives/navigation": {
diff --git a/packages/twenty-ui/docs/separatorPropDescriptions.ts b/packages/twenty-ui/docs/separatorPropDescriptions.ts
new file mode 100644
index 00000000000..4cdc8d25cb0
--- /dev/null
+++ b/packages/twenty-ui/docs/separatorPropDescriptions.ts
@@ -0,0 +1,10 @@
+import { type SeparatorProps } from '../src/primitives/layout/Separator/types/SeparatorProps';
+
+export const SEPARATOR_PROP_DESCRIPTIONS = {
+ orientation: 'Direction of the divider: horizontal or vertical.',
+ render:
+ 'Element or render function composed with the native separator props and ref.',
+ className: 'CSS class or function of the separator orientation.',
+ style:
+ 'Native style or function of the separator orientation. Use it for spacing and line color.',
+} satisfies Partial<Record<keyof SeparatorProps, string>>;
diff --git a/packages/twenty-ui/generated/components.docs.json b/packages/twenty-ui/generated/components.docs.json
index 9f9bd8892ae..e84d782ae55 100644
--- a/packages/twenty-ui/generated/components.docs.json
+++ b/packages/twenty-ui/generated/components.docs.json
@@ -928,44 +928,37 @@
]
},
{
- "name": "HorizontalSeparator",
+ "name": "Separator",
"entryPoint": "twenty-ui/primitives/layout",
- "slug": "layout/horizontal-separator",
+ "slug": "layout/separator",
"props": [
{
- "name": "color",
- "type": "string",
+ "name": "className",
+ "type": "string | ((state: SeparatorState) => string | undefined)",
"required": false,
"defaultValue": null,
- "description": "CSS color for the line and text. Defaults to the medium border color."
- },
- {
- "name": "noMargin",
- "type": "boolean",
- "required": false,
- "defaultValue": "false",
- "description": "Removes the vertical margins."
+ "description": "CSS class or function of the separator orientation."
},
{
- "name": "text",
- "type": "string",
+ "name": "orientation",
+ "type": "\"horizontal\" | \"vertical\"",
"required": false,
- "defaultValue": "",
- "description": "Optional label displayed between two lines."
+ "defaultValue": "horizontal",
+ "description": "Direction of the divider: horizontal or vertical."
},
{
- "name": "textPosition",
- "type": "\"center\" | \"end\"",
+ "name": "render",
+ "type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SeparatorState>",
"required": false,
- "defaultValue": "center",
- "description": "Places the text between two lines, or at the end of a single line."
+ "defaultValue": null,
+ "description": "Element or render function composed with the native separator props and ref."
},
{
- "name": "visible",
- "type": "boolean",
+ "name": "style",
+ "type": "CSSProperties | ((state: SeparatorState) => CSSProperties | undefined)",
"required": false,
- "defaultValue": "true",
- "description": "Shows the dividing line. Setting it to false preserves margins and any text."
+ "defaultValue": null,
+ "description": "Native style or function of the separator orientation. Use it for spacing and line color."
}
]
},
diff --git a/packages/twenty-ui/src/components/feedback/Toast/Toast.tsx b/packages/twenty-ui/src/components/feedback/Toast/Toast.tsx
index 9d1e981d1fe..9b892831374 100644
--- a/packages/twenty-ui/src/components/feedback/Toast/Toast.tsx
+++ b/packages/twenty-ui/src/components/feedback/Toast/Toast.tsx
@@ -9,7 +9,7 @@ import {
IconX,
} from '@ui/icon';
import { Button } from '@ui/primitives/input/Button/Button';
-import { HorizontalSeparator } from '@ui/primitives/layout/HorizontalSeparator/HorizontalSeparator';
+import { Separator } from '@ui/primitives/layout/Separator/Separator';
import { useTheme } from '@ui/theme';
import { isDefined } from '@ui/utilities/utils/isDefined';
@@ -137,7 +137,7 @@ export const Toast = ({
)}
{isDefined(action) && (
<div className={styles.footer}>
- <HorizontalSeparator noMargin />
+ <Separator />
<div className={styles.footerAction}>{action}</div>
</div>
)}
diff --git a/packages/twenty-ui/src/primitives/layout/HorizontalSeparator/HorizontalSeparator.module.scss b/packages/twenty-ui/src/primitives/layout/HorizontalSeparator/HorizontalSeparator.module.scss
deleted file mode 100644
index fdd912d7b2b..00000000000
--- a/packages/twenty-ui/src/primitives/layout/HorizontalSeparator/HorizontalSeparator.module.scss
+++ /dev/null
@@ -1,54 +0,0 @@
-.separator {
- background-color: var(
- --horizontal-separator-color,
- var(--t-border-color-medium)
- );
- height: 0;
- flex-shrink: 0;
- margin-bottom: var(--t-spacing-3);
- margin-top: var(--t-spacing-3);
- width: 100%;
-
- &[data-visible] {
- height: 1px;
- }
-
- &[data-no-margin] {
- margin-bottom: 0;
- margin-top: 0;
- }
-}
-
-.separatorContainer {
- align-items: center;
- display: flex;
- margin-bottom: var(--t-spacing-3);
- margin-top: var(--t-spacing-3);
- width: 100%;
-
- &[data-no-margin] {
- margin-bottom: 0;
- margin-top: 0;
- }
-}
-
-.line {
- background-color: var(
- --horizontal-separator-color,
- var(--t-border-color-medium)
- );
- height: 0;
- flex-grow: 1;
-
- &[data-visible] {
- height: 1px;
- }
-}
-
-.text {
- margin: 0 var(--t-spacing-2);
-}
-
-.separatorContainer[data-colored] .text {
- color: var(--horizontal-separator-color);
-}
diff --git a/packages/twenty-ui/src/primitives/layout/HorizontalSeparator/HorizontalSeparator.module.scss.d.ts b/packages/twenty-ui/src/primitives/layout/HorizontalSeparator/HorizontalSeparator.module.scss.d.ts
deleted file mode 100644
index 6f718471ec4..00000000000
--- a/packages/twenty-ui/src/primitives/layout/HorizontalSeparator/HorizontalSeparator.module.scss.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-declare const classNames: {
- readonly separator: 'separator';
- readonly separatorContainer: 'separatorContainer';
- readonly line: 'line';
- readonly text: 'text';
-};
-export default classNames;
diff --git a/packages/twenty-ui/src/primitives/layout/HorizontalSeparator/HorizontalSeparator.tsx b/packages/twenty-ui/src/primitives/layout/HorizontalSeparator/HorizontalSeparator.tsx
deleted file mode 100644
index adcbfd510ee..00000000000
--- a/packages/twenty-ui/src/primitives/layout/HorizontalSeparator/HorizontalSeparator.tsx
+++ /dev/null
@@ -1,55 +0,0 @@
-import { type JSX } from 'react';
-
-import { Label } from '@ui/primitives/typography/internal/Label/Label';
-
-import styles from './HorizontalSeparator.module.scss';
-
-type HorizontalSeparatorProps = {
- visible?: boolean;
- text?: string;
- noMargin?: boolean;
- color?: string;
- textPosition?: 'center' | 'end';
-};
-
-export const HorizontalSeparator = ({
- visible = true,
- text = '',
- noMargin = false,
- color,
- textPosition = 'center',
-}: HorizontalSeparatorProps): JSX.Element => {
- const colorStyle = color
- ? ({ '--horizontal-separator-color': color } as React.CSSProperties)
- : undefined;
-
- return (
- <>
- {text ? (
- <div
- className={styles.separatorContainer}
- role="separator"
- aria-label={text}
- data-no-margin={noMargin || undefined}
- data-colored={color ? true : undefined}
- style={colorStyle}
- >
- <div className={styles.line} data-visible={visible || undefined} />
- <Label>
- <span className={styles.text}>{text}</span>
- </Label>
- {textPosition === 'center' && (
- <div className={styles.line} data-visible={visible || undefined} />
- )}
- </div>
- ) : (
- <div
- className={styles.separator}
- data-visible={visible || undefined}
- data-no-margin={noMargin || undefined}
- style={colorStyle}
- />
- )}
- </>
- );
-};
diff --git a/packages/twenty-ui/src/primitives/layout/HorizontalSeparator/__stories__/HorizontalSeparator.stories.tsx b/packages/twenty-ui/src/primitives/layout/HorizontalSeparator/__stories__/HorizontalSeparator.stories.tsx
deleted file mode 100644
index c121151cf97..00000000000
--- a/packages/twenty-ui/src/primitives/layout/HorizontalSeparator/__stories__/HorizontalSeparator.stories.tsx
+++ /dev/null
@@ -1,23 +0,0 @@
-import { type Meta, type StoryObj } from '@storybook/react-vite';
-import { ComponentDecorator } from '@ui/testing';
-
-import { HorizontalSeparator } from '@ui/primitives/layout/HorizontalSeparator/HorizontalSeparator';
-
-const meta: Meta<typeof HorizontalSeparator> = {
- title: 'UI/Layout/HorizontalSeparator',
- component: HorizontalSeparator,
- decorators: [ComponentDecorator],
-};
-
-export default meta;
-type Story = StoryObj<typeof HorizontalSeparator>;
-
-export const Default: Story = {};
-
-export const WithTextAtEnd: Story = {
- args: {
- text: 'New',
- textPosition: 'end',
- color: 'var(--t-tag-text-red)',
- },
-};
diff --git a/packages/twenty-ui/src/primitives/layout/Separator/Separator.module.scss b/packages/twenty-ui/src/primitives/layout/Separator/Separator.module.scss
new file mode 100644
index 00000000000..6d82cd5ff1f
--- /dev/null
+++ b/packages/twenty-ui/src/primitives/layout/Separator/Separator.module.scss
@@ -0,0 +1,15 @@
+.root {
+ background-color: var(--t-border-color-medium);
+ flex-shrink: 0;
+ margin: 0;
+
+ &[data-orientation='horizontal'] {
+ height: 1px;
+ width: 100%;
+ }
+
+ &[data-orientation='vertical'] {
+ align-self: stretch;
+ width: 1px;
+ }
+}
diff --git a/packages/twenty-ui/src/primitives/layout/Separator/Separator.module.scss.d.ts b/packages/twenty-ui/src/primitives/layout/Separator/Separator.module.scss.d.ts
new file mode 100644
index 00000000000..af4fd9a0f90
--- /dev/null
+++ b/packages/twenty-ui/src/primitives/layout/Separator/Separator.module.scss.d.ts
@@ -0,0 +1,4 @@
+declare const styles: {
+ readonly root: string;
+};
+export default styles;
diff --git a/packages/twenty-ui/src/primitives/layout/Separator/Separator.tsx b/packages/twenty-ui/src/primitives/layout/Separator/Separator.tsx
new file mode 100644
index 00000000000..6d6cc1c06b9
--- /dev/null
+++ b/packages/twenty-ui/src/primitives/layout/Separator/Separator.tsx
@@ -0,0 +1,13 @@
+import { Separator as SeparatorPrimitive } from '@base-ui/react/separator';
+
+import { mergeClassNames } from '@ui/utilities/internal/mergeClassNames';
+
+import styles from './Separator.module.scss';
+import { type SeparatorProps } from './types/SeparatorProps';
+
+export const Separator = ({ className, ...props }: SeparatorProps) => (
+ <SeparatorPrimitive
+ {...props}
+ className={mergeClassNames(styles.root, className)}
+ />
+);
diff --git a/packages/twenty-ui/src/primitives/layout/Separator/__stories__/Separator.stories.tsx b/packages/twenty-ui/src/primitives/layout/Separator/__stories__/Separator.stories.tsx
new file mode 100644
index 00000000000..ef9e8a00641
--- /dev/null
+++ b/packages/twenty-ui/src/primitives/layout/Separator/__stories__/Separator.stories.tsx
@@ -0,0 +1,83 @@
+import { type Meta, type StoryObj } from '@storybook/react-vite';
+import { expect, within } from 'storybook/test';
+
+import { Text } from '@ui/primitives/typography/Text/Text';
+import { ComponentDecorator } from '@ui/testing';
+
+import { Separator } from '../Separator';
+
+const meta: Meta<typeof Separator> = {
+ title: 'UI/Layout/Separator',
+ component: Separator,
+ decorators: [ComponentDecorator],
+};
+
+export default meta;
+type Story = StoryObj<typeof Separator>;
+
+export const Default: Story = {
+ args: { 'aria-label': 'Sections' },
+ play: async ({ canvasElement }) => {
+ const separator = within(canvasElement).getByRole('separator', {
+ name: 'Sections',
+ });
+ await expect(separator).toHaveAttribute('aria-orientation', 'horizontal');
+ await expect(getComputedStyle(separator).margin).toBe('0px');
+ },
+};
+
+export const Vertical: Story = {
+ args: {
+ orientation: 'vertical',
+ 'aria-label': 'Columns',
+ style: { height: 80 },
+ },
+ play: async ({ canvasElement }) => {
+ const separator = within(canvasElement).getByRole('separator', {
+ name: 'Columns',
+ });
+ expect(separator).toHaveAttribute('aria-orientation', 'vertical');
+ expect(separator.getBoundingClientRect().width).toBe(1);
+ expect(separator.getBoundingClientRect().height).toBe(80);
+ await expect(getComputedStyle(separator).margin).toBe('0px');
+ },
+};
+
+export const LabeledComposition: Story = {
+ play: async ({ canvasElement }) => {
+ const canvas = within(canvasElement);
+ expect(canvas.getAllByRole('separator')).toHaveLength(1);
+ expect(canvas.getByRole('separator', { name: 'New' })).toBeVisible();
+ },
+ render: () => (
+ <Text
+ role="separator"
+ aria-label="New"
+ style={{
+ display: 'flex',
+ alignItems: 'center',
+ width: '100%',
+ color: 'var(--t-tag-text-red)',
+ }}
+ >
+ <Separator
+ aria-hidden
+ style={{ flexGrow: 1, width: 'auto', backgroundColor: 'currentColor' }}
+ />
+ <Text
+ render={<span />}
+ style={{
+ marginInline: 'var(--t-spacing-2)',
+ fontSize: 11,
+ fontWeight: 'var(--t-font-weight-semi-bold)',
+ }}
+ >
+ New
+ </Text>
+ </Text>
+ ),
+};
+
+export const Documentation: Story = { args: Default.args };
+
+export const VerticalDocumentation: Story = { args: Vertical.args };
diff --git a/packages/twenty-ui/src/primitives/layout/Separator/__tests__/Separator.test.tsx b/packages/twenty-ui/src/primitives/layout/Separator/__tests__/Separator.test.tsx
new file mode 100644
index 00000000000..75ef73ba4cd
--- /dev/null
+++ b/packages/twenty-ui/src/primitives/layout/Separator/__tests__/Separator.test.tsx
@@ -0,0 +1,46 @@
+import { render, screen } from '@testing-library/react';
+import { describe, expect, it } from 'vitest';
+
+import { runComponentConformance } from '@test-utilities/conformance/runComponentConformance';
+
+import { Separator } from '../Separator';
+import styles from '../Separator.module.scss';
+
+runComponentConformance({
+ name: 'Separator',
+ element: <Separator />,
+ ownClassName: styles.root,
+ refInstanceOf: HTMLDivElement,
+});
+
+describe('Separator semantics', () => {
+ it('updates the accessible orientation and Base UI render state', () => {
+ const { rerender } = render(<Separator aria-label="Sections" />);
+
+ expect(screen.getByRole('separator', { name: 'Sections' })).toHaveAttribute(
+ 'aria-orientation',
+ 'horizontal',
+ );
+
+ rerender(
+ <Separator
+ aria-label="Sections"
+ orientation="vertical"
+ className={({ orientation }) => `divider-${orientation}`}
+ style={({ orientation }) => ({
+ height: orientation === 'vertical' ? 24 : 1,
+ })}
+ render={(props, { orientation }) => (
+ <span {...props} data-render-orientation={orientation} />
+ )}
+ />,
+ );
+
+ const separator = screen.getByRole('separator', { name: 'Sections' });
+ expect(separator).toHaveAttribute('aria-orientation', 'vertical');
+ expect(separator).toHaveAttribute('data-orientation', 'vertical');
+ expect(separator).toHaveAttribute('data-render-orientation', 'vertical');
+ expect(separator).toHaveClass(styles.root, 'divider-vertical');
+ expect(separator).toHaveStyle({ height: '24px' });
+ });
+});
diff --git a/packages/twenty-ui/src/primitives/layout/Separator/types/SeparatorProps.ts b/packages/twenty-ui/src/primitives/layout/Separator/types/SeparatorProps.ts
new file mode 100644
index 00000000000..3dc01a43b5b
--- /dev/null
+++ b/packages/twenty-ui/src/primitives/layout/Separator/types/SeparatorProps.ts
@@ -0,0 +1,4 @@
+import { type Separator } from '@base-ui/react/separator';
+import { type ComponentProps } from 'react';
+
+export type SeparatorProps = ComponentProps<typeof Separator>;
diff --git a/packages/twenty-ui/src/primitives/layout/index.ts b/packages/twenty-ui/src/primitives/layout/index.ts
index e97822c09dd..7a5748236cd 100644
--- a/packages/twenty-ui/src/primitives/layout/index.ts
+++ b/packages/twenty-ui/src/primitives/layout/index.ts
@@ -13,6 +13,7 @@ export type { AnimationDurationObject } from './Collapsible/types/AnimationDurat
export type { AnimationDurations } from './Collapsible/types/AnimationDurations';
export { DirectionProvider } from './DirectionProvider/DirectionProvider';
export type { DirectionProviderProps } from './DirectionProvider/types/DirectionProviderProps';
-export { HorizontalSeparator } from './HorizontalSeparator/HorizontalSeparator';
export { ResizeHandle } from './ResizeHandle/ResizeHandle';
export type { ResizeHandleProps } from './ResizeHandle/types/ResizeHandleProps';
+export { Separator } from './Separator/Separator';
+export type { SeparatorProps } from './Separator/types/SeparatorProps';