Skip to content

The open alternative to Salesforce, designed for AI.

Add a shared labeled separator (#28610)

Raphaël Bosi7e0a308e8285
diff --git a/packages/twenty-docs/snippets/ui/generated/components/layout/labeled-separator.mdx b/packages/twenty-docs/snippets/ui/generated/components/layout/labeled-separator.mdx
new file mode 100644
index 00000000000..dbfeadf0462
--- /dev/null
+++ b/packages/twenty-docs/snippets/ui/generated/components/layout/labeled-separator.mdx
@@ -0,0 +1,35 @@
+{/*
+ * _____ _
+ *|_ _|_ _____ _ __ | |_ _ _
+ * | | \ \ /\ / / _ \ '_ \| __| | | | 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="children" type="string" required>
+ Text naming the separator. Supplied and localized by the caller.
+</ParamField>
+
+<ParamField body="hasStartMarker" type="boolean" default="false">
+ Show a decorative cap at the beginning of the rule.
+</ParamField>
+
+<ParamField body="labelPosition" type="&quot;center&quot; | &quot;end&quot;" default="center">
+ Place the label between two lines or at the end of one line.
+</ParamField>
+
+<ParamField body="render" type="ReactElement&lt;unknown, string | JSXElementConstructor&lt;any&gt;&gt; | ComponentRenderFn&lt;HTMLProps, {}&gt;">
+ Allows you to replace the component's HTML element
+ with a different tag, or compose it with another component.
+
+ Accepts a `ReactElement` or a function that returns the element to render.
+</ParamField>
+
+<ParamField body="tone" type="&quot;danger&quot; | &quot;neutral&quot;" default="neutral">
+ Neutral divider or red marker with a thicker rule.
+</ParamField>
diff --git a/packages/twenty-docs/ui/components/layout/labeled-separator.mdx b/packages/twenty-docs/ui/components/layout/labeled-separator.mdx
new file mode 100644
index 00000000000..5d0aa412ae0
--- /dev/null
+++ b/packages/twenty-docs/ui/components/layout/labeled-separator.mdx
@@ -0,0 +1,89 @@
+---
+title: LabeledSeparator
+description: Separate content with a centered or end-aligned text label.
+---
+
+import { StoryEmbed } from '/snippets/ui/StoryEmbed.mdx';
+import LabeledSeparatorReference from '/snippets/ui/generated/components/layout/labeled-separator.mdx';
+
+`LabeledSeparator` composes [Separator](/ui/primitives/layout/separator) and [Text](/ui/primitives/typography/text) into a named horizontal divider. Your application supplies the label and surrounding spacing.
+
+<StoryEmbed
+ storyId="ui-layout-labeledseparator--display"
+ title="Labeled separator between import options"
+ height={180}
+/>
+
+## Usage
+
+```tsx
+import { LabeledSeparator } from 'twenty-ui/components/layout';
+import { Button } from 'twenty-ui/primitives/input';
+import { Text } from 'twenty-ui/primitives/typography';
+
+export const ImportOptions = () => (
+ <Text
+ style={{
+ display: 'grid',
+ gap: 'var(--t-spacing-3)',
+ width: 320,
+ maxWidth: '100%',
+ }}
+ >
+ <Button fullWidth>Import a CSV file</Button>
+ <LabeledSeparator>Or</LabeledSeparator>
+ <Button fullWidth variant="outline">
+ Connect a data source
+ </Button>
+ </Text>
+);
+```
+
+## Label placement and tone
+
+`labelPosition` defaults to `center`, with a line on each side of the label. Use `end` to place the label after the leading line. The label accepts a string supplied and localized by your application.
+
+`tone` defaults to `neutral`. Use `danger` for a red marker with a medium-weight label and a thicker rule. Set `hasStartMarker` to add a small decorative cap at the beginning of the rule.
+
+The optional cap follows the [shared calendar and chat line design](https://www.figma.com/design/xt8O9mFeLl46C5InWwoMrN/Twenty?node-id=118289-146574).
+
+<StoryEmbed
+ storyId="ui-layout-labeledseparator--unread-marker"
+ title="Unread marker with an end-aligned label"
+ height={100}
+/>
+
+```tsx
+import { LabeledSeparator } from 'twenty-ui/components/layout';
+
+export const UnreadMarker = () => (
+ <LabeledSeparator
+ labelPosition="end"
+ tone="danger"
+ hasStartMarker
+ style={{ width: 488, maxWidth: '100%' }}
+ >
+ New
+ </LabeledSeparator>
+);
+```
+
+## Spacing and application state
+
+The component fills its container and adds no outer margin. Use parent layout spacing or native `style` and `className` for margins and alignment. Keep offsets for adjacent avatars or calendar positions in your application.
+
+The component presents the supplied label. Your application decides where an unread boundary or calendar marker belongs and when it is visible.
+
+## Accessibility and composition
+
+The root exposes one horizontal separator named from its label. The rule segments and optional start marker are decorative, so assistive technology does not announce extra separators. Native accessible attributes can provide a different name or description when needed.
+
+Native attributes, styles, class names, and `ref` target the outer `div`. Use `render` to compose another noninteractive element while forwarding the supplied props and ref. `LabeledSeparatorProps` is exported from `twenty-ui/components/layout`.
+
+## Migration
+
+Replace the frontend `LabeledDivider` with `LabeledSeparator`. Rename `textPosition` to `labelPosition`, and use `tone="danger"` for the unread marker's red appearance. Remove `noMargin`, since outer margins default to zero. Preserve the former default spacing with `style={{ marginBlock: 'var(--t-spacing-3)' }}` where needed.
+
+## Props
+
+<LabeledSeparatorReference />
diff --git a/packages/twenty-docs/ui/primitives/layout/separator.mdx b/packages/twenty-docs/ui/primitives/layout/separator.mdx
index c7cbc4bb595..01aa769b41e 100644
--- a/packages/twenty-docs/ui/primitives/layout/separator.mdx
+++ b/packages/twenty-docs/ui/primitives/layout/separator.mdx
@@ -42,30 +42,17 @@ export const ImportSources = () => (
## Labeled dividers
-Compose text and divider lines in a separate layout. Give the layout an accessible name and make the individual lines presentational.
+Use [LabeledSeparator](/ui/components/layout/labeled-separator) for a text label between divider lines or at the end of a rule. It provides the layout and a single accessible separator name.
```tsx
-import { Separator } from 'twenty-ui/primitives/layout';
-import { Text } from 'twenty-ui/primitives/typography';
+import { LabeledSeparator } from 'twenty-ui/components/layout';
-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>
-);
+export const SignInDivider = () => <LabeledSeparator>Or</LabeledSeparator>;
```
## 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.
+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 }}`. Use `LabeledSeparator` for labeled dividers, pass the label as children, and rename `textPosition` to `labelPosition`. Replace separators used only for invisible spacing with layout spacing.
## Props
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 cf9d961ee55..2daf9808135 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
@@ -7,10 +7,9 @@ import { type ChangeEvent, useRef } from 'react';
import { useFormContext } from 'react-hook-form';
import { isDefined } from 'twenty-shared/utils';
import { useToast } from 'twenty-ui/components/feedback';
-import { Section } from 'twenty-ui/components/layout';
+import { LabeledSeparator, Section } from 'twenty-ui/components/layout';
import { IconCheck, IconCopy, IconDownload, IconUpload } from 'twenty-ui/icon';
import { Button } from 'twenty-ui/primitives/input';
-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';
@@ -49,6 +48,10 @@ const StyledButtonCopy = styled.div`
margin-bottom: ${themeCssVariables.spacing[1]};
`;
+const StyledDividerContainer = styled.div`
+ margin-block: ${themeCssVariables.spacing[3]};
+`;
+
export const SettingsSsoSamlForm = () => {
const theme = useTheme();
const { enqueueToast } = useToast();
@@ -158,7 +161,9 @@ export const SettingsSsoSamlForm = () => {
type="button"
>{t`Download file`}</Button>
</StyledContainer>
- <LabeledDivider>{t`Or`}</LabeledDivider>
+ <StyledDividerContainer>
+ <LabeledSeparator>{t`Or`}</LabeledSeparator>
+ </StyledDividerContainer>
<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 9faed111566..787c128ec88 100644
--- a/packages/twenty-front/src/modules/settings/unsubscribers/components/SettingsUnsubscribePreview.tsx
+++ b/packages/twenty-front/src/modules/settings/unsubscribers/components/SettingsUnsubscribePreview.tsx
@@ -7,10 +7,9 @@ import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
import { SettingsUnsubscribePreviewSender } from '@/settings/unsubscribers/components/SettingsUnsubscribePreviewSender';
import { SettingsUnsubscribePreviewTracking } from '@/settings/unsubscribers/components/SettingsUnsubscribePreviewTracking';
import { getUnsubscribePageHeaderDescription } from '@/settings/unsubscribers/utils/getUnsubscribePageHeaderDescription';
-import { LabeledDivider } from '@/ui/layout/line/components/LabeledDivider';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { MainButton } from 'twenty-ui/components/input';
-import { Section } from 'twenty-ui/components/layout';
+import { LabeledSeparator, Section } from 'twenty-ui/components/layout';
import { Checkbox } from 'twenty-ui/primitives/input';
import { Card } from 'twenty-ui/primitives/surfaces';
import { themeCssVariables } from 'twenty-ui/theme';
@@ -133,7 +132,7 @@ export const SettingsUnsubscribePreview = () => {
{hasPreferences ? (
<StyledActions>
<MainButton fullWidth>{t`Update`}</MainButton>
- <LabeledDivider noMargin>{t`Or`}</LabeledDivider>
+ <LabeledSeparator>{t`Or`}</LabeledSeparator>
<MainButton fullWidth variant="outline" elevated={false}>
{t`Unsubscribe all`}
</MainButton>
diff --git a/packages/twenty-ui/docs/components.ts b/packages/twenty-ui/docs/components.ts
index e0865613eb3..0273a12f841 100644
--- a/packages/twenty-ui/docs/components.ts
+++ b/packages/twenty-ui/docs/components.ts
@@ -883,6 +883,25 @@ export const DOCUMENTED_COMPONENTS = [
slug: 'components/layout/overflowing-list',
propDescriptions: OVERFLOWING_LIST_PROP_DESCRIPTIONS,
},
+ {
+ name: 'LabeledSeparator',
+ source: 'components/layout/LabeledSeparator/LabeledSeparator.tsx',
+ entryPoint: 'twenty-ui/components/layout',
+ slug: 'components/layout/labeled-separator',
+ propDescriptions: {
+ children:
+ 'Text naming the separator. Supplied and localized by the caller.',
+ labelPosition:
+ 'Place the label between two lines or at the end of one line.',
+ tone: 'Neutral divider or red marker with a thicker rule.',
+ hasStartMarker: 'Show a decorative cap at the beginning of the rule.',
+ },
+ propDefaults: {
+ labelPosition: 'center',
+ tone: 'neutral',
+ hasStartMarker: 'false',
+ },
+ },
{
name: 'Section',
source: 'components/layout/Section/Section.tsx',
diff --git a/packages/twenty-ui/docs/module-ownership.json b/packages/twenty-ui/docs/module-ownership.json
index d7b4830a381..0fa7b418844 100644
--- a/packages/twenty-ui/docs/module-ownership.json
+++ b/packages/twenty-ui/docs/module-ownership.json
@@ -63,6 +63,7 @@
"ImageInput",
"InlineBanner",
"JsonTree",
+ "LabeledSeparator",
"LightButton",
"LightIconButton",
"ListItemButton",
diff --git a/packages/twenty-ui/docs/public-exports.json b/packages/twenty-ui/docs/public-exports.json
index 300d96bc589..849d31b1c2c 100644
--- a/packages/twenty-ui/docs/public-exports.json
+++ b/packages/twenty-ui/docs/public-exports.json
@@ -144,11 +144,13 @@
"reExports": [],
"values": {
"AnimatedIconCrossfade": "components/layout/AnimatedIconCrossfade/AnimatedIconCrossfade",
+ "LabeledSeparator": "components/layout/LabeledSeparator/LabeledSeparator",
"OverflowingList": "components/layout/OverflowingList/OverflowingList",
"Section": "components/layout/Section/Section"
},
"types": {
"AnimatedIconCrossfadeProps": "components/layout/AnimatedIconCrossfade/types/AnimatedIconCrossfadeProps",
+ "LabeledSeparatorProps": "components/layout/LabeledSeparator/types/LabeledSeparatorProps",
"OverflowingListProps": "components/layout/OverflowingList/types/OverflowingListProps",
"SectionHeaderProps": "components/layout/Section/types/SectionHeaderProps",
"SectionRootProps": "components/layout/Section/types/SectionRootProps"
diff --git a/packages/twenty-ui/generated/components.docs.json b/packages/twenty-ui/generated/components.docs.json
index 25b998cfa7b..4b82e9828be 100644
--- a/packages/twenty-ui/generated/components.docs.json
+++ b/packages/twenty-ui/generated/components.docs.json
@@ -13372,6 +13372,48 @@
}
]
},
+ {
+ "name": "LabeledSeparator",
+ "entryPoint": "twenty-ui/components/layout",
+ "slug": "components/layout/labeled-separator",
+ "props": [
+ {
+ "name": "children",
+ "type": "string",
+ "required": true,
+ "defaultValue": null,
+ "description": "Text naming the separator. Supplied and localized by the caller."
+ },
+ {
+ "name": "hasStartMarker",
+ "type": "boolean",
+ "required": false,
+ "defaultValue": "false",
+ "description": "Show a decorative cap at the beginning of the rule."
+ },
+ {
+ "name": "labelPosition",
+ "type": "\"center\" | \"end\"",
+ "required": false,
+ "defaultValue": "center",
+ "description": "Place the label between two lines or at the end of one line."
+ },
+ {
+ "name": "render",
+ "type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, {}>",
+ "required": false,
+ "defaultValue": null,
+ "description": "Allows you to replace the component's HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."
+ },
+ {
+ "name": "tone",
+ "type": "\"danger\" | \"neutral\"",
+ "required": false,
+ "defaultValue": "neutral",
+ "description": "Neutral divider or red marker with a thicker rule."
+ }
+ ]
+ },
{
"name": "Section",
"entryPoint": "twenty-ui/components/layout",
diff --git a/packages/twenty-ui/src/components/layout/LabeledSeparator/LabeledSeparator.module.scss b/packages/twenty-ui/src/components/layout/LabeledSeparator/LabeledSeparator.module.scss
new file mode 100644
index 00000000000..abbc16910c1
--- /dev/null
+++ b/packages/twenty-ui/src/components/layout/LabeledSeparator/LabeledSeparator.module.scss
@@ -0,0 +1,53 @@
+.root {
+ align-items: center;
+ color: var(--t-font-color-secondary);
+ display: flex;
+ gap: var(--t-spacing-2);
+ inline-size: 100%;
+ margin: 0;
+ min-inline-size: 0;
+
+ &[data-tone='danger'] {
+ color: var(--t-tag-text-red);
+ }
+}
+
+.rule {
+ align-items: center;
+ color: var(--t-border-color-medium);
+ display: flex;
+ flex: 1;
+ min-inline-size: 0;
+}
+
+.line {
+ flex: 1;
+ min-inline-size: 0;
+ width: auto;
+}
+
+.marker {
+ background-color: currentColor;
+ block-size: var(--t-spacing-1);
+ border-radius: 1px;
+ flex-shrink: 0;
+ inline-size: var(--t-spacing-1);
+}
+
+.label {
+ color: inherit;
+ line-height: 1.4;
+ min-inline-size: 0;
+ overflow-wrap: anywhere;
+}
+
+.root[data-tone='danger'] {
+ .rule {
+ color: var(--t-font-color-danger);
+ }
+
+ .line {
+ background-color: var(--t-font-color-danger);
+ height: 1.5px;
+ }
+}
diff --git a/packages/twenty-ui/src/components/layout/LabeledSeparator/LabeledSeparator.module.scss.d.ts b/packages/twenty-ui/src/components/layout/LabeledSeparator/LabeledSeparator.module.scss.d.ts
new file mode 100644
index 00000000000..11bb74e5311
--- /dev/null
+++ b/packages/twenty-ui/src/components/layout/LabeledSeparator/LabeledSeparator.module.scss.d.ts
@@ -0,0 +1,8 @@
+declare const classNames: {
+ readonly root: 'root';
+ readonly rule: 'rule';
+ readonly line: 'line';
+ readonly marker: 'marker';
+ readonly label: 'label';
+};
+export default classNames;
diff --git a/packages/twenty-ui/src/components/layout/LabeledSeparator/LabeledSeparator.tsx b/packages/twenty-ui/src/components/layout/LabeledSeparator/LabeledSeparator.tsx
new file mode 100644
index 00000000000..9eec6c14d38
--- /dev/null
+++ b/packages/twenty-ui/src/components/layout/LabeledSeparator/LabeledSeparator.tsx
@@ -0,0 +1,50 @@
+import { useRender } from '@base-ui/react/use-render';
+import { clsx } from 'clsx';
+
+import { Separator } from '@ui/primitives/layout/Separator/Separator';
+import { Text } from '@ui/primitives/typography/Text/Text';
+
+import styles from './LabeledSeparator.module.scss';
+import { type LabeledSeparatorProps } from './types/LabeledSeparatorProps';
+
+export const LabeledSeparator = ({
+ children,
+ labelPosition = 'center',
+ tone = 'neutral',
+ hasStartMarker = false,
+ className,
+ render,
+ ref,
+ ...props
+}: LabeledSeparatorProps) =>
+ useRender({
+ render,
+ ref,
+ props: {
+ role: 'separator',
+ 'aria-orientation': 'horizontal',
+ 'aria-label': children,
+ ...props,
+ 'data-tone': tone,
+ className: clsx(styles.root, className),
+ children: (
+ <>
+ <span className={styles.rule} aria-hidden="true">
+ {hasStartMarker && <span className={styles.marker} />}
+ <Separator className={styles.line} aria-hidden />
+ </span>
+ <Text
+ render={<span />}
+ size={tone === 'danger' ? 'sm' : 'xs'}
+ weight={tone === 'danger' ? 'medium' : 'semibold'}
+ className={styles.label}
+ >
+ {children}
+ </Text>
+ {labelPosition === 'center' && (
+ <Separator className={styles.line} aria-hidden />
+ )}
+ </>
+ ),
+ },
+ });
diff --git a/packages/twenty-ui/src/components/layout/LabeledSeparator/__stories__/LabeledSeparator.stories.tsx b/packages/twenty-ui/src/components/layout/LabeledSeparator/__stories__/LabeledSeparator.stories.tsx
new file mode 100644
index 00000000000..a63560c2004
--- /dev/null
+++ b/packages/twenty-ui/src/components/layout/LabeledSeparator/__stories__/LabeledSeparator.stories.tsx
@@ -0,0 +1,94 @@
+import { type Meta, type StoryObj } from '@storybook/react-vite';
+import { expect, within } from 'storybook/test';
+
+import { Button } from '@ui/primitives/input/Button/Button';
+import { Text } from '@ui/primitives/typography/Text/Text';
+import { ComponentDecorator } from '@ui/testing';
+
+import { LabeledSeparator } from '../LabeledSeparator';
+
+const meta: Meta<typeof LabeledSeparator> = {
+ title: 'UI/Layout/LabeledSeparator',
+ component: LabeledSeparator,
+ decorators: [ComponentDecorator],
+ args: { children: 'Or' },
+};
+
+export default meta;
+type Story = StoryObj<typeof LabeledSeparator>;
+
+export const Display: Story = {
+ render: (args) => (
+ <Text
+ style={{
+ display: 'grid',
+ gap: 'var(--t-spacing-3)',
+ width: 320,
+ maxWidth: '100%',
+ }}
+ >
+ <Button fullWidth>Import a CSV file</Button>
+ <LabeledSeparator {...args} />
+ <Button fullWidth variant="outline">
+ Connect a data source
+ </Button>
+ </Text>
+ ),
+};
+
+export const UnreadMarker: Story = {
+ args: {
+ children: 'New',
+ labelPosition: 'end',
+ tone: 'danger',
+ hasStartMarker: true,
+ style: { width: 488, maxWidth: '100%' },
+ },
+};
+
+export const DarkTheme: Story = {
+ globals: { colorScheme: 'dark' },
+};
+
+export const UnreadMarkerDarkTheme: Story = {
+ args: UnreadMarker.args,
+ globals: { colorScheme: 'dark' },
+};
+
+export const Semantics: Story = {
+ play: async ({ canvasElement }) => {
+ const canvas = within(canvasElement);
+ const separator = canvas.getByRole('separator', { name: 'Or' });
+
+ await expect(canvas.getAllByRole('separator')).toHaveLength(1);
+ await expect(separator).toHaveAttribute('aria-orientation', 'horizontal');
+ await expect(getComputedStyle(separator).margin).toBe('0px');
+ },
+};
+
+export const MarkedSeparator: Story = {
+ args: UnreadMarker.args,
+ play: async ({ canvasElement }) => {
+ const canvas = within(canvasElement);
+ const separator = canvas.getByRole('separator', { name: 'New' });
+
+ await expect(canvas.getAllByRole('separator')).toHaveLength(1);
+ await expect(separator).toBeVisible();
+ },
+};
+
+export const LongLabel: Story = {
+ args: {
+ children: 'Updates received since you last opened this conversation',
+ style: { width: 180 },
+ },
+ play: async ({ canvasElement }) => {
+ const separator = within(canvasElement).getByRole('separator', {
+ name: 'Updates received since you last opened this conversation',
+ });
+
+ await expect(separator.scrollWidth).toBeLessThanOrEqual(
+ separator.clientWidth,
+ );
+ },
+};
diff --git a/packages/twenty-ui/src/components/layout/LabeledSeparator/__tests__/LabeledSeparator.test.tsx b/packages/twenty-ui/src/components/layout/LabeledSeparator/__tests__/LabeledSeparator.test.tsx
new file mode 100644
index 00000000000..1a767455361
--- /dev/null
+++ b/packages/twenty-ui/src/components/layout/LabeledSeparator/__tests__/LabeledSeparator.test.tsx
@@ -0,0 +1,9 @@
+import { runComponentConformance } from '@test-utilities/conformance/runComponentConformance';
+
+import { LabeledSeparator } from '../LabeledSeparator';
+
+runComponentConformance({
+ name: 'LabeledSeparator',
+ element: <LabeledSeparator>Or</LabeledSeparator>,
+ refInstanceOf: HTMLDivElement,
+});
diff --git a/packages/twenty-ui/src/components/layout/LabeledSeparator/types/LabeledSeparatorProps.ts b/packages/twenty-ui/src/components/layout/LabeledSeparator/types/LabeledSeparatorProps.ts
new file mode 100644
index 00000000000..d244b088621
--- /dev/null
+++ b/packages/twenty-ui/src/components/layout/LabeledSeparator/types/LabeledSeparatorProps.ts
@@ -0,0 +1,11 @@
+import { type useRender } from '@base-ui/react/use-render';
+
+export type LabeledSeparatorProps = Omit<
+ useRender.ComponentProps<'div'>,
+ 'children'
+> & {
+ children: string;
+ labelPosition?: 'center' | 'end';
+ tone?: 'neutral' | 'danger';
+ hasStartMarker?: boolean;
+};
diff --git a/packages/twenty-ui/src/components/layout/index.ts b/packages/twenty-ui/src/components/layout/index.ts
index 624e27e0ce5..3c96dbeb8fa 100644
--- a/packages/twenty-ui/src/components/layout/index.ts
+++ b/packages/twenty-ui/src/components/layout/index.ts
@@ -9,6 +9,8 @@
export { AnimatedIconCrossfade } from './AnimatedIconCrossfade/AnimatedIconCrossfade';
export type { AnimatedIconCrossfadeProps } from './AnimatedIconCrossfade/types/AnimatedIconCrossfadeProps';
+export { LabeledSeparator } from './LabeledSeparator/LabeledSeparator';
+export type { LabeledSeparatorProps } from './LabeledSeparator/types/LabeledSeparatorProps';
export { OverflowingList } from './OverflowingList/OverflowingList';
export type { OverflowingListProps } from './OverflowingList/types/OverflowingListProps';
export { Section } from './Section/Section';
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
index 8abfcdc6468..733c4860700 100644
--- a/packages/twenty-ui/src/primitives/layout/Separator/__stories__/Separator.stories.tsx
+++ b/packages/twenty-ui/src/primitives/layout/Separator/__stories__/Separator.stories.tsx
@@ -53,39 +53,4 @@ export const Vertical: Story = {
},
};
-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 VerticalDocumentation: Story = { args: Vertical.args };