Skip to content

The open alternative to Salesforce, designed for AI.

Consolidate card choices in Radio (#26966)

Raphaël Bosia288c5df1d6a
diff --git a/packages/twenty-docs/docs.json b/packages/twenty-docs/docs.json
index da9d11dc97b..4344737fb23 100644
--- a/packages/twenty-docs/docs.json
+++ b/packages/twenty-docs/docs.json
@@ -631,7 +631,6 @@
"ui/components/animated-icon-crossfade",
"ui/components/avatar-group",
"ui/components/callout",
- "ui/components/card-picker",
"ui/components/color-scheme-picker",
"ui/components/command-block",
"ui/components/info",
@@ -7444,6 +7443,10 @@
{
"source": "/ui/primitives/surfaces/card-footer",
"destination": "/ui/primitives/surfaces/card"
+ },
+ {
+ "source": "/ui/components/card-picker",
+ "destination": "/ui/primitives/input/radio#card-options"
}
]
}
diff --git a/packages/twenty-docs/navigation/base-structure.json b/packages/twenty-docs/navigation/base-structure.json
index 69922b88686..2b785d2a5c5 100644
--- a/packages/twenty-docs/navigation/base-structure.json
+++ b/packages/twenty-docs/navigation/base-structure.json
@@ -649,7 +649,6 @@
"ui/components/animated-icon-crossfade",
"ui/components/avatar-group",
"ui/components/callout",
- "ui/components/card-picker",
"ui/components/color-scheme-picker",
"ui/components/command-block",
"ui/components/info",
diff --git a/packages/twenty-docs/snippets/ui/generated/components/card-picker.mdx b/packages/twenty-docs/snippets/ui/generated/components/card-picker.mdx
deleted file mode 100644
index 8c59acf4439..00000000000
--- a/packages/twenty-docs/snippets/ui/generated/components/card-picker.mdx
+++ /dev/null
@@ -1,63 +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="children" type="ReactNode">
- Card content inside the radio control.
-</ParamField>
-
-<ParamField body="className" type="string | ((state: RadioRootState) =&gt; string | undefined)">
- CSS class applied to the element, or a function that
- returns a class based on the component's state.
-</ParamField>
-
-<ParamField body="disabled" type="boolean">
- Whether the component should ignore user interaction.
-</ParamField>
-
-<ParamField body="inputRef" type="Ref&lt;HTMLInputElement&gt;">
- A ref to access the hidden input element.
-</ParamField>
-
-<ParamField body="nativeButton" type="boolean" default="false">
- Whether the component renders a native `<button>` element when replacing it
- via the `render` prop.
- Set to `true` if the rendered element is a native button.
-</ParamField>
-
-<ParamField body="readOnly" type="boolean">
- Whether the user should be unable to select the radio button.
-</ParamField>
-
-<ParamField body="render" type="ReactElement&lt;unknown, string | JSXElementConstructor&lt;any&gt;&gt; | ComponentRenderFn&lt;HTMLProps, RadioRootState&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="required" type="boolean">
- Whether the user must choose a value before submitting a form.
-</ParamField>
-
-<ParamField body="size" type="&quot;md&quot; | &quot;sm&quot;">
- Visual size of the radio.
-</ParamField>
-
-<ParamField body="style" type="CSSProperties | ((state: RadioRootState) =&gt; CSSProperties | undefined)">
- Style applied to the element, or a function that
- returns a style object based on the component's state.
-</ParamField>
-
-<ParamField body="value" type="TValue" required>
- The unique identifying value of the radio in a group.
-</ParamField>
diff --git a/packages/twenty-docs/snippets/ui/generated/input/radio.mdx b/packages/twenty-docs/snippets/ui/generated/input/radio.mdx
index 970c72a11b3..964320e99c4 100644
--- a/packages/twenty-docs/snippets/ui/generated/input/radio.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/input/radio.mdx
@@ -11,6 +11,10 @@
* npx nx generate:ui twenty-docs
*/}
+<ParamField body="children" type="ReactNode">
+ Option content. Card options wrap it in a padded full-width content area.
+</ParamField>
+
<ParamField body="className" type="string | ((state: RadioRootState) =&gt; string | undefined)">
CSS class applied to the element, or a function that
returns a class based on the component's state.
@@ -57,3 +61,7 @@
<ParamField body="value" type="TValue" required>
The unique identifying value of the radio in a group.
</ParamField>
+
+<ParamField body="variant" type="&quot;card&quot; | &quot;default&quot;" default="default">
+ Presentation of the option: a standard radio or a full-width card. Defaults to default.
+</ParamField>
diff --git a/packages/twenty-docs/ui/components/card-picker.mdx b/packages/twenty-docs/ui/components/card-picker.mdx
deleted file mode 100644
index 53e0ce307f8..00000000000
--- a/packages/twenty-docs/ui/components/card-picker.mdx
+++ /dev/null
@@ -1,26 +0,0 @@
----
-title: CardPicker
-description: A radio option presented as a card.
----
-
-import CardPickerReference from '/snippets/ui/generated/components/card-picker.mdx';
-
-Place `CardPicker` inside [RadioGroup](/ui/primitives/input/radio-group). The group owns selection; each card supplies a value and its visible content. It uses Radio's keyboard, form, and disabled behavior.
-
-```tsx
-import { CardPicker } from 'twenty-ui/components';
-import { RadioGroup } from 'twenty-ui/primitives/input';
-
-export const ViewChoice = () => (
- <RadioGroup aria-label="Default view" defaultValue="table">
- <CardPicker value="table">Table view</CardPicker>
- <CardPicker value="board">Board view</CardPicker>
- </RadioGroup>
-);
-```
-
-Use `value` and `onValueChange` on the group for controlled selection, or `defaultValue` for an initial choice. The default card renders a div with radio semantics. Avoid nesting interactive controls in its content.
-
-## Props
-
-<CardPickerReference />
diff --git a/packages/twenty-docs/ui/components/overview.mdx b/packages/twenty-docs/ui/components/overview.mdx
index d1c10f8944a..63fb50b937f 100644
--- a/packages/twenty-docs/ui/components/overview.mdx
+++ b/packages/twenty-docs/ui/components/overview.mdx
@@ -31,7 +31,6 @@ Import shared components from `twenty-ui/components`. The code editor has its ow
| [Info](/ui/components/info) | Information messages with a button or link. |
| [InlineBanner](/ui/components/inline-banner) | Compact banners with optional actions. |
| [ToastProvider and Toaster](/ui/components/toast#application-notifications) | Notification stores, queue limits, and rendering. |
-| [CardPicker](/ui/components/card-picker) | Radio options presented as cards. |
| [ColorSchemePicker](/ui/components/color-scheme-picker) | Light, dark, and system preference selection. |
| [SearchInput](/ui/components/search-input) | Search text and optional filter controls. |
| [AnimatedIconCrossfade](/ui/components/animated-icon-crossfade) | State-driven icon transitions. |
diff --git a/packages/twenty-docs/ui/primitives/input/radio.mdx b/packages/twenty-docs/ui/primitives/input/radio.mdx
index 6eb20cfd92e..28b3460e237 100644
--- a/packages/twenty-docs/ui/primitives/input/radio.mdx
+++ b/packages/twenty-docs/ui/primitives/input/radio.mdx
@@ -44,6 +44,35 @@ export const ContactMethod = () => (
The `size` prop accepts `sm` or `md` and defaults to `sm`. Use the same size for options in a group.
+## Card options
+
+Use `variant="card"` for full-width options with an inset radio indicator. Card options render a div with radio semantics and accept the same size, disabled, and native props as standard radios. Keep interactive controls outside the card content.
+
+<StoryEmbed
+ storyId="ui-input-radio--cards-documentation"
+ title="Radio card options"
+ height={280}
+/>
+
+```tsx
+import { Radio, RadioGroup } from 'twenty-ui/primitives/input';
+
+export const ViewChoice = () => (
+ <RadioGroup
+ aria-label="Default view"
+ defaultValue="table"
+ style={{ width: 280 }}
+ >
+ <Radio variant="card" value="table">
+ Table view
+ </Radio>
+ <Radio variant="card" value="board">
+ Board view
+ </Radio>
+ </RadioGroup>
+);
+```
+
## Keyboard and selection
Tab enters or leaves the group. Arrow keys move between enabled options and select the focused option. Space selects the focused radio. Selection and change handlers belong on `RadioGroup`; see its [uncontrolled example](/ui/primitives/input/radio-group#uncontrolled-state) and [controlled example](/ui/primitives/input/radio-group#controlled-state).
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 47d340fa1a7..386fc7a83a3 100644
--- a/packages/twenty-front-component-renderer/src/__stories__/TwentyUiGallery.stories.tsx
+++ b/packages/twenty-front-component-renderer/src/__stories__/TwentyUiGallery.stories.tsx
@@ -45,8 +45,8 @@ import {
tooltipEscapeDismissalTest,
tooltipEscapeIgnoredTest,
} from '@/__stories__/twenty-ui-gallery/utils/tooltipTests';
-import { cardPickerDroppedClickTest } from '@/__stories__/twenty-ui-gallery/utils/cardPickerDroppedClickTest';
-import { cardPickerTest } from '@/__stories__/twenty-ui-gallery/utils/cardPickerTest';
+import { radioCardDroppedClickTest } from '@/__stories__/twenty-ui-gallery/utils/radioCardDroppedClickTest';
+import { radioCardTest } from '@/__stories__/twenty-ui-gallery/utils/radioCardTest';
import { checkboxTest } from '@/__stories__/twenty-ui-gallery/utils/checkboxTest';
import { createFieldControlsTest } from '@/__stories__/twenty-ui-gallery/utils/createFieldControlsTest';
import { radioGroupTest } from '@/__stories__/twenty-ui-gallery/utils/radioGroupTest';
@@ -416,15 +416,15 @@ export const RadioGroupPreact: Story = createGalleryStory({
play: radioGroupTest,
});
-export const CardPickerReact: Story = createGalleryStory({
+export const RadioCardReact: Story = createGalleryStory({
frontComponentBundleName: 'twenty-ui-radio-group',
runtime: 'react',
- play: cardPickerDroppedClickTest,
+ play: radioCardDroppedClickTest,
});
-export const CardPickerPreact: Story = createGalleryStory({
+export const RadioCardPreact: Story = createGalleryStory({
frontComponentBundleName: 'twenty-ui-radio-group',
runtime: 'preact',
- play: cardPickerTest,
+ play: radioCardTest,
});
export const StatusControlsReact: Story = createGalleryStory({
diff --git a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/README.md b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/README.md
index 0be89f4b80c..e08dc720fa8 100644
--- a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/README.md
+++ b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/README.md
@@ -55,7 +55,7 @@ No stories are skipped or marked as expected-to-fail by the runner.
| Popover, Dialog, AlertDialog | Opening fails while reading pointer contact data from the missing `nativeEvent`. |
| Menu | Opening fails on the missing `nativeEvent.pointerType` and pointer contact data. |
| Select | Opening fails on missing native event data and focus support. Preact can report only the last of these failures when the host coalesces sandbox errors. |
-| Switch, Checkbox, Radio, CardPicker, SegmentedControl | Activation attempts to construct an unavailable `PointerEvent`. `CardPickerReact` never gets that far: React drops the click handler Base UI adds through `React.cloneElement`, so only the group's focus handling fails on the missing `nativeEvent` for `composedPath`. |
+| Switch, Checkbox, Radio (standard and card), SegmentedControl | Activation attempts to construct an unavailable `PointerEvent`. `RadioCardReact` never gets that far: React drops the click handler Base UI adds through `React.cloneElement`, so only the group's focus handling fails on the missing `nativeEvent` for `composedPath`. |
| Slider | Thumbs stay hidden because the sandbox has no `ResizeObserver` to re-measure after the first geometry batch. |
| Tooltip | `TooltipReact` opens on hover but remains open after Escape because React drops the handlers Base UI adds through `React.cloneElement`. |
| Responsive hooks | The sandbox `window.matchMedia` answers for the widget's own box, so `useIsMobile` follows the widget width rather than the browser viewport: a widget 768px wide or narrower gets the mobile layout, and Button drops its hotkey hint, on any screen. `useIsTouchDevice` follows the primary input of the host device, so it is `false` under the desktop Chromium that runs these stories. The fixture asserts both at a 1024px and a 400px widget width. |
diff --git a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-input-gallery.front-component.tsx b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-input-gallery.front-component.tsx
index 74b7b5f2038..ad9b048eb9f 100644
--- a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-input-gallery.front-component.tsx
+++ b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-input-gallery.front-component.tsx
@@ -1,6 +1,5 @@
import { defineFrontComponent } from 'twenty-sdk/define';
import {
- CardPicker,
ColorSchemePicker,
IconButton,
LightButton,
@@ -41,10 +40,12 @@ const INPUT_ENTRIES: GalleryEntry[] = [
),
},
{
- name: 'CardPicker',
+ name: 'Radio (card)',
node: (
<RadioGroup defaultValue="card" aria-label="Card selection">
- <CardPicker value="card">Card</CardPicker>
+ <Radio variant="card" value="card">
+ Card
+ </Radio>
</RadioGroup>
),
},
diff --git a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-radio-group.front-component.tsx b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-radio-group.front-component.tsx
index 2d5442c273c..f0533fc5faf 100644
--- a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-radio-group.front-component.tsx
+++ b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-radio-group.front-component.tsx
@@ -1,6 +1,5 @@
import { useState } from 'react';
import { defineFrontComponent } from 'twenty-sdk/define';
-import { CardPicker } from 'twenty-ui/components';
import { Radio, RadioGroup } from 'twenty-ui/primitives/input';
import { TwentyUiGalleryCard } from '@/__stories__/shared/front-components/twenty-ui-gallery-card';
@@ -28,8 +27,12 @@ const RadioGroupExample = () => {
defaultValue="basic"
onValueChange={setPlan}
>
- <CardPicker value="basic">Basic plan</CardPicker>
- <CardPicker value="pro">Pro plan</CardPicker>
+ <Radio variant="card" value="basic">
+ Basic plan
+ </Radio>
+ <Radio variant="card" value="pro">
+ Pro plan
+ </Radio>
</RadioGroup>
<p>Plan: {plan}</p>
</TwentyUiGalleryCard>
@@ -39,6 +42,7 @@ const RadioGroupExample = () => {
export default defineFrontComponent({
universalIdentifier: '4d23e9af-7cb3-4e4a-bbca-8e960f840014',
name: 'twenty-ui-radio-group',
- description: 'RadioGroup selection with Radio and CardPicker in the sandbox',
+ description:
+ 'RadioGroup selection with standard and card Radio options in the sandbox',
component: RadioGroupExample,
});
diff --git a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/cardPickerDroppedClickTest.ts b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/radioCardDroppedClickTest.ts
similarity index 83%
rename from packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/cardPickerDroppedClickTest.ts
rename to packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/radioCardDroppedClickTest.ts
index eeadfa4a77f..459b3be1afb 100644
--- a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/cardPickerDroppedClickTest.ts
+++ b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/radioCardDroppedClickTest.ts
@@ -1,7 +1,7 @@
import { SANDBOX_ERROR_PATTERNS } from '@/__stories__/twenty-ui-gallery/constants/SANDBOX_ERROR_PATTERNS';
import { createRadioGroupTest } from '@/__stories__/twenty-ui-gallery/utils/createRadioGroupTest';
-export const cardPickerDroppedClickTest = createRadioGroupTest({
+export const radioCardDroppedClickTest = createRadioGroupTest({
optionName: 'Pro plan',
activationErrors: {
requiredErrors: [SANDBOX_ERROR_PATTERNS.COMPOSED_PATH],
diff --git a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/cardPickerTest.ts b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/radioCardTest.ts
similarity index 84%
rename from packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/cardPickerTest.ts
rename to packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/radioCardTest.ts
index 70745bc4dd0..8cb81ffd49b 100644
--- a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/cardPickerTest.ts
+++ b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/radioCardTest.ts
@@ -1,7 +1,7 @@
import { RADIO_ACTIVATION_ERRORS } from '@/__stories__/twenty-ui-gallery/constants/RadioActivationErrors';
import { createRadioGroupTest } from '@/__stories__/twenty-ui-gallery/utils/createRadioGroupTest';
-export const cardPickerTest = createRadioGroupTest({
+export const radioCardTest = createRadioGroupTest({
optionName: 'Pro plan',
activationErrors: RADIO_ACTIVATION_ERRORS,
});
diff --git a/packages/twenty-front/src/modules/settings/enterprise/components/EnterprisePlanModal.tsx b/packages/twenty-front/src/modules/settings/enterprise/components/EnterprisePlanModal.tsx
index 78442e202ca..6d03e73967c 100644
--- a/packages/twenty-front/src/modules/settings/enterprise/components/EnterprisePlanModal.tsx
+++ b/packages/twenty-front/src/modules/settings/enterprise/components/EnterprisePlanModal.tsx
@@ -8,9 +8,9 @@ import { useApolloClient } from '@apollo/client/react';
import { styled } from '@linaria/react';
import { useLingui } from '@lingui/react/macro';
import { useState } from 'react';
-import { CardPicker, MainButton, useToast } from 'twenty-ui/components';
+import { MainButton, useToast } from 'twenty-ui/components';
import { Loader } from 'twenty-ui/primitives/feedback';
-import { RadioGroup } from 'twenty-ui/primitives/input';
+import { Radio, RadioGroup } from 'twenty-ui/primitives/input';
import { Dialog } from 'twenty-ui/primitives/surfaces';
import { themeCssVariables } from 'twenty-ui/theme';
@@ -184,18 +184,18 @@ export const EnterprisePlanModal = () => {
value={selectedInterval}
onValueChange={setSelectedInterval}
>
- <CardPicker value="monthly">
+ <Radio variant="card" value="monthly">
<StyledIntervalCardContent>
<StyledIntervalTitle>{t`Monthly`}</StyledIntervalTitle>
<StyledIntervalSubtitle>{`$${MONTHLY_PRICE} / ${t`seat / month`}`}</StyledIntervalSubtitle>
</StyledIntervalCardContent>
- </CardPicker>
- <CardPicker value="yearly">
+ </Radio>
+ <Radio variant="card" value="yearly">
<StyledIntervalCardContent>
<StyledIntervalTitle>{t`Yearly`}</StyledIntervalTitle>
<StyledIntervalSubtitle>{`$${YEARLY_PRICE} / ${t`seat / month`}`}</StyledIntervalSubtitle>
</StyledIntervalCardContent>
- </CardPicker>
+ </Radio>
</RadioGroup>
<StyledCheckoutButton
diff --git a/packages/twenty-shared/src/constants/DocumentationPaths.ts b/packages/twenty-shared/src/constants/DocumentationPaths.ts
index e49457beade..0aa4f14f1a6 100644
--- a/packages/twenty-shared/src/constants/DocumentationPaths.ts
+++ b/packages/twenty-shared/src/constants/DocumentationPaths.ts
@@ -132,7 +132,6 @@ export const DOCUMENTATION_PATHS = {
'/ui/components/animated-icon-crossfade',
UI_COMPONENTS_AVATAR_GROUP: '/ui/components/avatar-group',
UI_COMPONENTS_CALLOUT: '/ui/components/callout',
- UI_COMPONENTS_CARD_PICKER: '/ui/components/card-picker',
UI_COMPONENTS_CODE_EDITOR: '/ui/components/code-editor',
UI_COMPONENTS_COLOR_SCHEME_PICKER: '/ui/components/color-scheme-picker',
UI_COMPONENTS_COMMAND_BLOCK: '/ui/components/command-block',
diff --git a/packages/twenty-ui/CHANGELOG.md b/packages/twenty-ui/CHANGELOG.md
index 866b85588ee..4a123bcd390 100644
--- a/packages/twenty-ui/CHANGELOG.md
+++ b/packages/twenty-ui/CHANGELOG.md
@@ -4,6 +4,8 @@
### Breaking Changes
+- Removed `CardPicker` and `CardPickerProps`. Use `Radio variant="card"` inside `RadioGroup` from `twenty-ui/primitives/input`. Card layout, selection, keyboard navigation, and form behavior are preserved.
+
- `ProgressBar` no longer accepts `countdownDurationInMs`, `isCountdownPaused`, or `onCountdownComplete`. Notification countdowns belong to `Toast`. Its duration, hover pause, manual progress, and close behavior are preserved, and keyboard focus now also pauses the countdown. The desktop companion uses the shared Toast.
- Removed `ClickToActionLink`. Use `Button variant="link"` from `twenty-ui/primitives/input`: pass `onClick` for actions or `href` for navigation. The link appearance preserves compact text styling while actions gain native button keyboard behavior and prop forwarding.
- Removed `soon` and `soonLabel` from `Button`, `MainButton`, and `LightButton`. Compose a disabled button with `Pill` from `twenty-ui/primitives/data-display` and supply the upcoming-feature label from the application.
diff --git a/packages/twenty-ui/docs/cardPickerPropDescriptions.ts b/packages/twenty-ui/docs/cardPickerPropDescriptions.ts
deleted file mode 100644
index 445b94105fb..00000000000
--- a/packages/twenty-ui/docs/cardPickerPropDescriptions.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import { type ComponentProps } from 'react';
-
-import { type CardPicker } from '../src/components/input/CardPicker/CardPicker';
-
-export const CARD_PICKER_PROP_DESCRIPTIONS = {
- children: 'Card content inside the radio control.',
-} satisfies Partial<Record<keyof ComponentProps<typeof CardPicker>, string>>;
diff --git a/packages/twenty-ui/docs/components.ts b/packages/twenty-ui/docs/components.ts
index dae50bab1e3..8e03d7963bd 100644
--- a/packages/twenty-ui/docs/components.ts
+++ b/packages/twenty-ui/docs/components.ts
@@ -8,7 +8,7 @@ import { INFO_PROP_DESCRIPTIONS } from './infoPropDescriptions';
import { INLINE_BANNER_PROP_DESCRIPTIONS } from './inlineBannerPropDescriptions';
import { TOAST_PROVIDER_PROP_DESCRIPTIONS } from './toastProviderPropDescriptions';
import { TOASTER_PROP_DESCRIPTIONS } from './toasterPropDescriptions';
-import { CARD_PICKER_PROP_DESCRIPTIONS } from './cardPickerPropDescriptions';
+import { RADIO_PROP_DESCRIPTIONS } from './radioPropDescriptions';
import { COLOR_SCHEME_PICKER_PROP_DESCRIPTIONS } from './colorSchemePickerPropDescriptions';
import { SEARCH_INPUT_PROP_DESCRIPTIONS } from './searchInputPropDescriptions';
import { ANIMATED_ICON_CROSSFADE_PROP_DESCRIPTIONS } from './animatedIconCrossfadePropDescriptions';
@@ -231,6 +231,7 @@ export const DOCUMENTED_COMPONENTS = [
source: 'primitives/input/Radio/Radio.tsx',
entryPoint: 'twenty-ui/primitives/input',
slug: 'input/radio',
+ propDescriptions: RADIO_PROP_DESCRIPTIONS,
},
{
name: 'RadioGroup',
@@ -548,13 +549,6 @@ export const DOCUMENTED_COMPONENTS = [
slug: 'components/toaster',
propDescriptions: TOASTER_PROP_DESCRIPTIONS,
},
- {
- name: 'CardPicker',
- source: 'components/input/CardPicker/CardPicker.tsx',
- entryPoint: 'twenty-ui/components',
- slug: 'components/card-picker',
- propDescriptions: CARD_PICKER_PROP_DESCRIPTIONS,
- },
{
name: 'ColorSchemePicker',
source: 'components/input/ColorSchemePicker/ColorSchemePicker.tsx',
diff --git a/packages/twenty-ui/docs/label-ownership.md b/packages/twenty-ui/docs/label-ownership.md
index b56f7ef8536..c0289090204 100644
--- a/packages/twenty-ui/docs/label-ownership.md
+++ b/packages/twenty-ui/docs/label-ownership.md
@@ -18,5 +18,5 @@ This covers production exports under components, primitives, and icons, includin
| ResizeHandle and CodeEditor | ResizeHandle accepts native labels over `Resize`. CodeEditor exposes `resizeLabel` (default `Resize editor`) and Monaco `options`, including its editor accessible label. The loading indicator adds no text. Monaco owns its internal editor messages. |
| Input, Textarea, Select, Field, Slider, Radio, RadioGroup, Checkbox, Switch, SegmentedControl | Native attributes, compound label/description/error parts, options, and children belong to the caller. Browser validation messages remain browser-owned; Field.Error children or render content can replace them. |
| Dialog, AlertDialog, Popover, Tooltip, Tabs | Text belongs to title, description, close, trigger, tab, and popup parts. No built-in English action or status strings. |
-| Banner, InlineBanner, Info, CardPicker, SettingsRow, Section, NavigationBar, RoundedLink, CommandBlock | Content and labels belong to supplied props or children. |
+| Banner, InlineBanner, Info, SettingsRow, Section, NavigationBar, RoundedLink, CommandBlock | Content and labels belong to supplied props or children. |
| Tag, Status, Pill, AvatarGroup, NotificationCounter, ColorSample, TintedIconTile, typography, layout and icon exports | Caller content, data values, native accessible attributes where supported, or decorative output. Loader and progress graphics add no built-in English loading message. |
diff --git a/packages/twenty-ui/docs/module-ownership.json b/packages/twenty-ui/docs/module-ownership.json
index f466caea7f6..be8718c9afa 100644
--- a/packages/twenty-ui/docs/module-ownership.json
+++ b/packages/twenty-ui/docs/module-ownership.json
@@ -43,7 +43,6 @@
"AnimatedIconCrossfade",
"AvatarGroup",
"Callout",
- "CardPicker",
"CodeEditor",
"CodeEditorHeader",
"ColorSchemePicker",
diff --git a/packages/twenty-ui/docs/radioPropDescriptions.ts b/packages/twenty-ui/docs/radioPropDescriptions.ts
new file mode 100644
index 00000000000..f31e5b49182
--- /dev/null
+++ b/packages/twenty-ui/docs/radioPropDescriptions.ts
@@ -0,0 +1,10 @@
+import { type ComponentProps } from 'react';
+
+import { type Radio } from '../src/primitives/input/Radio/Radio';
+
+export const RADIO_PROP_DESCRIPTIONS = {
+ children:
+ 'Option content. Card options wrap it in a padded full-width content area.',
+ variant:
+ 'Presentation of the option: a standard radio or a full-width card. Defaults to default.',
+} satisfies Partial<Record<keyof ComponentProps<typeof Radio>, string>>;
diff --git a/packages/twenty-ui/generated/components.docs.json b/packages/twenty-ui/generated/components.docs.json
index ef3907b4665..793dcebb78d 100644
--- a/packages/twenty-ui/generated/components.docs.json
+++ b/packages/twenty-ui/generated/components.docs.json
@@ -1778,6 +1778,13 @@
"entryPoint": "twenty-ui/primitives/input",
"slug": "input/radio",
"props": [
+ {
+ "name": "children",
+ "type": "ReactNode",
+ "required": false,
+ "defaultValue": null,
+ "description": "Option content. Card options wrap it in a padded full-width content area."
+ },
{
"name": "className",
"type": "string | ((state: RadioRootState) => string | undefined)",
@@ -1847,6 +1854,13 @@
"required": true,
"defaultValue": null,
"description": "The unique identifying value of the radio in a group."
+ },
+ {
+ "name": "variant",
+ "type": "\"card\" | \"default\"",
+ "required": false,
+ "defaultValue": "default",
+ "description": "Presentation of the option: a standard radio or a full-width card. Defaults to default."
}
]
},
@@ -8423,90 +8437,6 @@
}
]
},
- {
- "name": "CardPicker",
- "entryPoint": "twenty-ui/components",
- "slug": "components/card-picker",
- "props": [
- {
- "name": "children",
- "type": "ReactNode",
- "required": false,
- "defaultValue": null,
- "description": "Card content inside the radio control."
- },
- {
- "name": "className",
- "type": "string | ((state: RadioRootState) => string | undefined)",
- "required": false,
- "defaultValue": null,
- "description": "CSS class applied to the element, or a function that\nreturns a class based on the component's state."
- },
- {
- "name": "disabled",
- "type": "boolean",
- "required": false,
- "defaultValue": null,
- "description": "Whether the component should ignore user interaction."
- },
- {
- "name": "inputRef",
- "type": "Ref<HTMLInputElement>",
- "required": false,
- "defaultValue": null,
- "description": "A ref to access the hidden input element."
- },
- {
- "name": "nativeButton",
- "type": "boolean",
- "required": false,
- "defaultValue": "false",
- "description": "Whether the component renders a native `<button>` element when replacing it\nvia the `render` prop.\nSet to `true` if the rendered element is a native button."
- },
- {
- "name": "readOnly",
- "type": "boolean",
- "required": false,
- "defaultValue": null,
- "description": "Whether the user should be unable to select the radio button."
- },
- {
- "name": "render",
- "type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, RadioRootState>",
- "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": "required",
- "type": "boolean",
- "required": false,
- "defaultValue": null,
- "description": "Whether the user must choose a value before submitting a form."
- },
- {
- "name": "size",
- "type": "\"md\" | \"sm\"",
- "required": false,
- "defaultValue": null,
- "description": "Visual size of the radio."
- },
- {
- "name": "style",
- "type": "CSSProperties | ((state: RadioRootState) => CSSProperties | undefined)",
- "required": false,
- "defaultValue": null,
- "description": "Style applied to the element, or a function that\nreturns a style object based on the component's state."
- },
- {
- "name": "value",
- "type": "TValue",
- "required": true,
- "defaultValue": null,
- "description": "The unique identifying value of the radio in a group."
- }
- ]
- },
{
"name": "ColorSchemePicker",
"entryPoint": "twenty-ui/components",
diff --git a/packages/twenty-ui/src/components/__stories__/reading-direction/DirectionalLayoutExample.tsx b/packages/twenty-ui/src/components/__stories__/reading-direction/DirectionalLayoutExample.tsx
index ff77f7f3279..1fff7290b69 100644
--- a/packages/twenty-ui/src/components/__stories__/reading-direction/DirectionalLayoutExample.tsx
+++ b/packages/twenty-ui/src/components/__stories__/reading-direction/DirectionalLayoutExample.tsx
@@ -3,7 +3,6 @@ import { useState } from 'react';
import {
AvatarGroup,
Callout,
- CardPicker,
ColorSchemePicker,
JsonTree,
} from '@ui/components';
@@ -11,6 +10,7 @@ import { Avatar, Pill } from '@ui/primitives/data-display';
import {
Button,
ButtonGroup,
+ Radio,
RadioGroup,
SegmentedControl,
} from '@ui/primitives/input';
@@ -56,7 +56,9 @@ export const DirectionalLayoutExample = ({
systemLabel="System"
/>
<RadioGroup aria-label="Plan" defaultValue="team">
- <CardPicker value="team">Team plan</CardPicker>
+ <Radio variant="card" value="team">
+ Team plan
+ </Radio>
</RadioGroup>
<ButtonGroup aria-label="Record actions">
<Button>First action</Button>
diff --git a/packages/twenty-ui/src/components/index.ts b/packages/twenty-ui/src/components/index.ts
index fed211a645d..d6c5ae48d7b 100644
--- a/packages/twenty-ui/src/components/index.ts
+++ b/packages/twenty-ui/src/components/index.ts
@@ -38,8 +38,6 @@ export type { ToastProviderProps } from './feedback/Toast/types/ToastProviderPro
export type { ToastVariant } from './feedback/Toast/types/ToastVariant';
export { Toaster } from './feedback/Toaster/Toaster';
export type { ToasterProps } from './feedback/Toaster/types/ToasterProps';
-export { CardPicker } from './input/CardPicker/CardPicker';
-export type { CardPickerProps } from './input/CardPicker/types/CardPickerProps';
export { ColorSchemePicker } from './input/ColorSchemePicker/ColorSchemePicker';
export type { ColorSchemePickerProps } from './input/ColorSchemePicker/types/ColorSchemePickerProps';
export { IconButton } from './input/IconButton/IconButton';
diff --git a/packages/twenty-ui/src/components/input/CardPicker/CardPicker.module.scss b/packages/twenty-ui/src/components/input/CardPicker/CardPicker.module.scss
deleted file mode 100644
index b59fec34c61..00000000000
--- a/packages/twenty-ui/src/components/input/CardPicker/CardPicker.module.scss
+++ /dev/null
@@ -1,27 +0,0 @@
-.container {
- background-color: var(--t-background-secondary);
- border: 1px solid var(--t-border-color-medium);
- border-radius: var(--t-border-radius-md);
- cursor: pointer;
- display: flex;
- padding: 0;
- position: relative;
- text-align: start;
- width: 100%;
-}
-
-.container:hover {
- background: var(--t-background-tertiary);
-}
-
-.container > :first-child {
- inset-block-start: var(--t-spacing-2);
- inset-inline-end: var(--t-spacing-2);
- position: absolute;
-}
-
-.cardInner {
- display: flex;
- padding: var(--t-spacing-4) var(--t-spacing-3);
- width: 100%;
-}
diff --git a/packages/twenty-ui/src/components/input/CardPicker/CardPicker.module.scss.d.ts b/packages/twenty-ui/src/components/input/CardPicker/CardPicker.module.scss.d.ts
deleted file mode 100644
index 1523e9a77d6..00000000000
--- a/packages/twenty-ui/src/components/input/CardPicker/CardPicker.module.scss.d.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-declare const classNames: {
- readonly container: 'container';
- readonly cardInner: 'cardInner';
-};
-export default classNames;
diff --git a/packages/twenty-ui/src/components/input/CardPicker/CardPicker.tsx b/packages/twenty-ui/src/components/input/CardPicker/CardPicker.tsx
deleted file mode 100644
index 5f65642bea0..00000000000
--- a/packages/twenty-ui/src/components/input/CardPicker/CardPicker.tsx
+++ /dev/null
@@ -1,19 +0,0 @@
-import { Radio } from '@ui/primitives/input/Radio/Radio';
-import { mergeClassNames } from '@ui/utilities/internal/mergeClassNames';
-
-import styles from './CardPicker.module.scss';
-import { type CardPickerProps } from './types/CardPickerProps';
-
-export const CardPicker = <TValue,>({
- children,
- className,
- ...props
-}: CardPickerProps<TValue>) => (
- <Radio
- render={<div />}
- {...props}
- className={mergeClassNames(styles.container, className)}
- >
- <div className={styles.cardInner}>{children}</div>
- </Radio>
-);
diff --git a/packages/twenty-ui/src/components/input/CardPicker/__tests__/CardPicker.test.tsx b/packages/twenty-ui/src/components/input/CardPicker/__tests__/CardPicker.test.tsx
deleted file mode 100644
index 3e90b1ec8a3..00000000000
--- a/packages/twenty-ui/src/components/input/CardPicker/__tests__/CardPicker.test.tsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import { type ReactNode } from 'react';
-
-import { runComponentConformance } from '@test-utilities/conformance/runComponentConformance';
-import { RadioGroup } from '@ui/primitives/input/RadioGroup/RadioGroup';
-
-import { CardPicker } from '../CardPicker';
-import styles from '../CardPicker.module.scss';
-
-const RadioGroupWrapper = ({ children }: { children: ReactNode }) => (
- <RadioGroup>{children}</RadioGroup>
-);
-
-runComponentConformance({
- name: 'CardPicker',
- element: <CardPicker value="option">Option</CardPicker>,
- wrapper: RadioGroupWrapper,
- refInstanceOf: HTMLDivElement,
- ownClassName: styles.container,
- renderPropTagName: 'div',
-});
diff --git a/packages/twenty-ui/src/components/input/CardPicker/types/CardPickerProps.ts b/packages/twenty-ui/src/components/input/CardPicker/types/CardPickerProps.ts
deleted file mode 100644
index b90b47cefe3..00000000000
--- a/packages/twenty-ui/src/components/input/CardPicker/types/CardPickerProps.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { type RadioProps } from '@ui/primitives/input/Radio/types/RadioProps';
-
-export type CardPickerProps<TValue = string> = RadioProps<TValue>;
diff --git a/packages/twenty-ui/src/primitives/input/Radio/Radio.module.scss b/packages/twenty-ui/src/primitives/input/Radio/Radio.module.scss
index 996a166fa8e..071a2cffbee 100644
--- a/packages/twenty-ui/src/primitives/input/Radio/Radio.module.scss
+++ b/packages/twenty-ui/src/primitives/input/Radio/Radio.module.scss
@@ -87,3 +87,30 @@
transition: none;
}
}
+
+.card {
+ background-color: var(--t-background-secondary);
+ border: 1px solid var(--t-border-color-medium);
+ border-radius: var(--t-border-radius-md);
+ display: flex;
+ padding: 0;
+ position: relative;
+ text-align: start;
+ width: 100%;
+}
+
+.card:hover {
+ background: var(--t-background-tertiary);
+}
+
+.card > .control {
+ inset-block-start: var(--t-spacing-2);
+ inset-inline-end: var(--t-spacing-2);
+ position: absolute;
+}
+
+.cardContent {
+ display: flex;
+ padding: var(--t-spacing-4) var(--t-spacing-3);
+ width: 100%;
+}
diff --git a/packages/twenty-ui/src/primitives/input/Radio/Radio.module.scss.d.ts b/packages/twenty-ui/src/primitives/input/Radio/Radio.module.scss.d.ts
index c2855ce5d47..38b57e0b375 100644
--- a/packages/twenty-ui/src/primitives/input/Radio/Radio.module.scss.d.ts
+++ b/packages/twenty-ui/src/primitives/input/Radio/Radio.module.scss.d.ts
@@ -4,5 +4,7 @@ declare const classNames: {
readonly sm: 'sm';
readonly md: 'md';
readonly indicator: 'indicator';
+ readonly card: 'card';
+ readonly cardContent: 'cardContent';
};
export default classNames;
diff --git a/packages/twenty-ui/src/primitives/input/Radio/Radio.tsx b/packages/twenty-ui/src/primitives/input/Radio/Radio.tsx
index 0a2a907512d..cf6aa3e0376 100644
--- a/packages/twenty-ui/src/primitives/input/Radio/Radio.tsx
+++ b/packages/twenty-ui/src/primitives/input/Radio/Radio.tsx
@@ -10,15 +10,24 @@ export const Radio = <TValue,>({
children,
className,
size = 'sm',
+ variant = 'default',
...props
}: RadioProps<TValue>) => (
<RadioPrimitive.Root
+ render={variant === 'card' ? <div /> : undefined}
{...props}
- className={mergeClassNames(clsx(styles.root, styles[size]), className)}
+ className={mergeClassNames(
+ clsx(styles.root, styles[size], variant === 'card' && styles.card),
+ className,
+ )}
>
<span className={styles.control} aria-hidden>
<RadioPrimitive.Indicator className={styles.indicator} />
</span>
- {children}
+ {variant === 'card' ? (
+ <div className={styles.cardContent}>{children}</div>
+ ) : (
+ children
+ )}
</RadioPrimitive.Root>
);
diff --git a/packages/twenty-ui/src/components/input/CardPicker/__stories__/CardPicker.stories.tsx b/packages/twenty-ui/src/primitives/input/Radio/__stories__/Radio.cards.interactions.stories.tsx
similarity index 91%
rename from packages/twenty-ui/src/components/input/CardPicker/__stories__/CardPicker.stories.tsx
rename to packages/twenty-ui/src/primitives/input/Radio/__stories__/Radio.cards.interactions.stories.tsx
index 433b4efca24..de0b1b79d37 100644
--- a/packages/twenty-ui/src/components/input/CardPicker/__stories__/CardPicker.stories.tsx
+++ b/packages/twenty-ui/src/primitives/input/Radio/__stories__/Radio.cards.interactions.stories.tsx
@@ -7,7 +7,7 @@ import { RadioGroup } from '@ui/primitives/input/RadioGroup/RadioGroup';
import { type RadioGroupProps } from '@ui/primitives/input/RadioGroup/types/RadioGroupProps';
import { ComponentDecorator } from '@ui/testing';
-import { CardPicker } from '../CardPicker';
+import { Radio } from '../Radio';
const CardsExample = ({ onValueChange }: RadioGroupProps) => {
const [value, setValue] = useState('monthly');
@@ -21,8 +21,12 @@ const CardsExample = ({ onValueChange }: RadioGroupProps) => {
onValueChange?.(nextValue, details);
}}
>
- <CardPicker value="monthly">Monthly</CardPicker>
- <CardPicker value="yearly">Yearly</CardPicker>
+ <Radio variant="card" value="monthly">
+ Monthly
+ </Radio>
+ <Radio variant="card" value="yearly">
+ Yearly
+ </Radio>
{value === 'yearly' && <Input aria-label="Purchase order" />}
</RadioGroup>
);
diff --git a/packages/twenty-ui/src/primitives/input/Radio/__stories__/Radio.interactions.stories.tsx b/packages/twenty-ui/src/primitives/input/Radio/__stories__/Radio.interactions.stories.tsx
index 90f39a3481d..fbd48cd8dbb 100644
--- a/packages/twenty-ui/src/primitives/input/Radio/__stories__/Radio.interactions.stories.tsx
+++ b/packages/twenty-ui/src/primitives/input/Radio/__stories__/Radio.interactions.stories.tsx
@@ -10,17 +10,25 @@ import { type RadioGroupProps } from '@ui/primitives/input/RadioGroup/types/Radi
import { A11Y_DEFER_COLOR_CONTRAST, ComponentDecorator } from '@ui/testing';
import { Radio } from '../Radio';
+import { type RadioProps } from '../types/RadioProps';
-const RadioExample = (props: RadioGroupProps) => (
+const RadioExample = ({
+ variant,
+ ...props
+}: RadioGroupProps & Pick<RadioProps, 'variant'>) => (
<RadioGroup aria-label="Fruit" {...props}>
- <Radio value="apple">Apple</Radio>
+ <Radio variant={variant} value="apple">
+ Apple
+ </Radio>
<div>
- <Radio value="banana" disabled>
+ <Radio variant={variant} value="banana" disabled>
Banana
</Radio>
</div>
<div>
- <Radio value="cherry">Cherry</Radio>
+ <Radio variant={variant} value="cherry">
+ Cherry
+ </Radio>
</div>
</RadioGroup>
);
@@ -178,7 +186,7 @@ export const Controlled: Story = {
},
};
-const FormExample = () => {
+const FormExample = ({ variant }: Pick<RadioProps, 'variant'>) => {
const [value, setValue] = useState('apple');
const [submitted, setSubmitted] = useState('');
@@ -196,10 +204,14 @@ const FormExample = () => {
<Field.Label>Fruit</Field.Label>
<RadioGroup value={value} onValueChange={setValue} required>
<FieldPrimitive.Item>
- <Radio value="apple">Apple</Radio>
+ <Radio variant={variant} value="apple">
+ Apple
+ </Radio>
</FieldPrimitive.Item>
<FieldPrimitive.Item>
- <Radio value="cherry">Cherry</Radio>
+ <Radio variant={variant} value="cherry">
+ Cherry
+ </Radio>
</FieldPrimitive.Item>
</RadioGroup>
<Field.Description>Choose one fruit</Field.Description>
@@ -321,3 +333,28 @@ export const RightToLeft: Story = {
);
},
};
+
+export const CardsKeyboard: Story = {
+ ...Keyboard,
+ args: { ...Keyboard.args, variant: 'card' },
+};
+
+export const CardsDisabledGroup: Story = {
+ ...DisabledGroup,
+ args: { ...DisabledGroup.args, variant: 'card' },
+};
+
+export const CardsReadOnlyGroup: Story = {
+ ...ReadOnlyGroup,
+ args: { ...ReadOnlyGroup.args, variant: 'card' },
+};
+
+export const CardsForm: Story = {
+ ...Form,
+ render: () => <FormExample variant="card" />,
+};
+
+export const CardsRightToLeft: Story = {
+ ...RightToLeft,
+ args: { ...RightToLeft.args, variant: 'card' },
+};
diff --git a/packages/twenty-ui/src/primitives/input/Radio/__stories__/Radio.stories.tsx b/packages/twenty-ui/src/primitives/input/Radio/__stories__/Radio.stories.tsx
index a7cc8092666..b84d7074a7b 100644
--- a/packages/twenty-ui/src/primitives/input/Radio/__stories__/Radio.stories.tsx
+++ b/packages/twenty-ui/src/primitives/input/Radio/__stories__/Radio.stories.tsx
@@ -87,3 +87,32 @@ export const CatalogDark: typeof Catalog = {
tags: ['!autodocs'],
globals: { colorScheme: 'dark' },
};
+
+export const CardsDocumentation: Story = {
+ decorators: [ComponentDecorator],
+ render: () => (
+ <RadioGroup
+ aria-label="Default view"
+ defaultValue="table"
+ style={{ width: 280 }}
+ >
+ <Radio variant="card" value="table">
+ Table view
+ </Radio>
+ <Radio variant="card" value="board">
+ Board view
+ </Radio>
+ </RadioGroup>
+ ),
+};
+
+export const CardsCatalog: typeof Catalog = {
+ ...Catalog,
+ args: { variant: 'card' },
+};
+
+export const CardsCatalogDark: typeof Catalog = {
+ ...CardsCatalog,
+ tags: ['!autodocs'],
+ globals: { colorScheme: 'dark' },
+};
diff --git a/packages/twenty-ui/src/primitives/input/Radio/__tests__/Radio.test.tsx b/packages/twenty-ui/src/primitives/input/Radio/__tests__/Radio.test.tsx
index 53fdbea9056..daa92628d65 100644
--- a/packages/twenty-ui/src/primitives/input/Radio/__tests__/Radio.test.tsx
+++ b/packages/twenty-ui/src/primitives/input/Radio/__tests__/Radio.test.tsx
@@ -25,3 +25,16 @@ runComponentConformance({
refInstanceOf: HTMLDivElement,
ownClassName: groupStyles.root,
});
+
+runComponentConformance({
+ name: 'Radio card',
+ element: (
+ <Radio variant="card" value="option">
+ Option
+ </Radio>
+ ),
+ wrapper: RadioGroupWrapper,
+ refInstanceOf: HTMLDivElement,
+ ownClassName: styles.card,
+ renderPropTagName: 'div',
+});
diff --git a/packages/twenty-ui/src/primitives/input/Radio/types/RadioProps.ts b/packages/twenty-ui/src/primitives/input/Radio/types/RadioProps.ts
index 6c5db0b559e..399834b7db7 100644
--- a/packages/twenty-ui/src/primitives/input/Radio/types/RadioProps.ts
+++ b/packages/twenty-ui/src/primitives/input/Radio/types/RadioProps.ts
@@ -3,4 +3,5 @@ import { type Radio as RadioPrimitive } from '@base-ui/react/radio';
export type RadioProps<TValue = string> = RadioPrimitive.Root.Props<TValue> & {
/** Visual size of the radio. */
size?: 'sm' | 'md';
+ variant?: 'default' | 'card';
};