Skip to content

The open alternative to Salesforce, designed for AI.

Migrate picker rows to ListItem (#26211)

Raphaël Bosi1068ff55f930
diff --git a/packages/twenty-docs/ui/primitives/navigation/list-item.mdx b/packages/twenty-docs/ui/primitives/navigation/list-item.mdx
index 91404c46f71..bd8a7e71d1b 100644
--- a/packages/twenty-docs/ui/primitives/navigation/list-item.mdx
+++ b/packages/twenty-docs/ui/primitives/navigation/list-item.mdx
@@ -88,6 +88,97 @@ export const ShowArchivedToggle = () => {
`selected`, `focused`, and `disabled` control row styling. The `check` and `checkbox` indicators are visual; use a real [Checkbox](/ui/primitives/input/checkbox) for a form control. When using a disabled button or link through `render`, also supply the element's appropriate disabled behavior and semantics.
+## Picker rows
+
+Selection belongs to the parent. `ListItem` has no uncontrolled selection state: pass `selected` and update it from `onClick`. Use `indicator="check"` for a single choice and `indicator="checkbox"` for multiple choices. Both indicators are decorative and share the row's click handler.
+
+In an existing listbox, pass `role="option"` and `aria-selected`, and keep focus and arrow-key handling in the listbox. For a complete selection widget, use [Select](/ui/primitives/input/select). Standalone selection buttons can use `aria-pressed`, as in these examples.
+
+### Single selection
+
+Place an [Avatar](/ui/primitives/data-display/avatar) in `startIcon` to identify a record. Use `description` for supporting text, and `descriptionPlacement="end"` for a trailing value.
+
+<StoryEmbed
+ storyId="ui-navigation-listitem-picker--single-selection"
+ title="Single selection rows"
+ height={260}
+/>
+
+```tsx
+import { useState } from 'react';
+import { Avatar } from 'twenty-ui/primitives/data-display';
+import { ListItem } from 'twenty-ui/primitives/navigation';
+
+export const AssigneeButtons = () => {
+ const [assignee, setAssignee] = useState<string | null>(null);
+
+ return (
+ <div role="group" aria-label="Assignee">
+ {['Alex Morgan', 'Sam Taylor'].map((name) => (
+ <ListItem
+ key={name}
+ render={<button type="button" />}
+ aria-pressed={assignee === name}
+ selected={assignee === name}
+ indicator="check"
+ startIcon={<Avatar name={name} size="md" />}
+ onClick={() => setAssignee(name)}
+ >
+ {name}
+ </ListItem>
+ ))}
+ </div>
+ );
+};
+```
+
+### Multiple selection
+
+Compose [Tag](/ui/primitives/data-display/tag) as the row content for tagged values, or put `ColorSample` in `startIcon` for a color choice. A row can also contain plain text or an avatar.
+
+<StoryEmbed
+ storyId="ui-navigation-listitem-picker--multiple-selection"
+ title="Multiple selection rows"
+ height={260}
+/>
+
+```tsx
+import { useState } from 'react';
+import { Tag } from 'twenty-ui/primitives/data-display';
+import { ListItem } from 'twenty-ui/primitives/navigation';
+
+export const TeammateButtons = () => {
+ const [teammates, setTeammates] = useState<string[]>([]);
+
+ const toggleTeammate = (name: string) => {
+ setTeammates((current) =>
+ current.includes(name)
+ ? current.filter((teammate) => teammate !== name)
+ : [...current, name],
+ );
+ };
+
+ return (
+ <div role="group" aria-label="Teammates">
+ {['Alex Morgan', 'Sam Taylor'].map((name) => (
+ <ListItem
+ key={name}
+ render={<button type="button" />}
+ aria-pressed={teammates.includes(name)}
+ selected={teammates.includes(name)}
+ indicator="checkbox"
+ onClick={() => toggleTeammate(name)}
+ >
+ <Tag color="blue">{name}</Tag>
+ </ListItem>
+ ))}
+ </div>
+ );
+};
+```
+
+The checkbox indicator is not a form control and does not submit a value. Use [Checkbox](/ui/primitives/input/checkbox) when you need form participation. Supply `disabled` to both the row and its rendered native button to prevent activation and remove it from the tab order.
+
## Slots
Use `startIcon` and `endIcon` for icons, `description` for supporting text, `actions` for trailing content, and `hasSubmenu` for a submenu indicator. `descriptionPlacement` accepts `inline` or `end`. `color="danger"` styles a destructive action. Avoid nesting interactive controls inside a row rendered as a button.
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 e99c556a067..9d7b72411d9 100644
--- a/packages/twenty-front-component-renderer/src/__stories__/TwentyUiGallery.stories.tsx
+++ b/packages/twenty-front-component-renderer/src/__stories__/TwentyUiGallery.stories.tsx
@@ -1,5 +1,6 @@
import { settingsRowTest } from '@/__stories__/twenty-ui-gallery/utils/settingsRowTest';
import { listItemTest } from '@/__stories__/twenty-ui-gallery/utils/listItemTest';
+import { pickerListItemsTest } from '@/__stories__/twenty-ui-gallery/utils/pickerListItemsTest';
import { buttonControlsTest } from '@/__stories__/twenty-ui-gallery/utils/buttonControlsTest';
import { dialogTest } from '@/__stories__/twenty-ui-gallery/utils/dialogTest';
import { type Meta } from '@storybook/react-vite';
@@ -233,6 +234,18 @@ export const ListItemPreact: Story = createGalleryStory({
play: listItemTest,
});
+export const PickerListItemsReact: Story = createGalleryStory({
+ frontComponentBundleName: 'twenty-ui-picker-list-items',
+ runtime: 'react',
+ play: pickerListItemsTest,
+});
+
+export const PickerListItemsPreact: Story = createGalleryStory({
+ frontComponentBundleName: 'twenty-ui-picker-list-items',
+ runtime: 'preact',
+ play: pickerListItemsTest,
+});
+
export const SettingsRowReact: Story = createGalleryStory({
frontComponentBundleName: 'twenty-ui-settings-row',
runtime: 'react',
diff --git a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-navigation-gallery.front-component.tsx b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-navigation-gallery.front-component.tsx
index 4d984cf9a69..93f9c078f64 100644
--- a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-navigation-gallery.front-component.tsx
+++ b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-navigation-gallery.front-component.tsx
@@ -1,3 +1,5 @@
+import { Tag, ColorSample } from 'twenty-ui/primitives/data-display';
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { defineFrontComponent } from 'twenty-sdk/define';
import { IconHome, IconUser } from 'twenty-ui/icon';
import {
@@ -10,13 +12,6 @@ import {
MenuItemDraggable,
MenuItemHotKeys,
MenuItemLeftContent,
- MenuItemMultiSelect,
- MenuItemMultiSelectAvatar,
- MenuItemMultiSelectTag,
- MenuItemSelect,
- MenuItemSelectAvatar,
- MenuItemSelectColor,
- MenuItemSelectTag,
MenuItemSuggestion,
MenuPicker,
NavigationBar,
@@ -28,9 +23,9 @@ import {
StyledMenuItemIconCheck,
StyledMenuItemLabel,
StyledMenuItemLeftContent,
- StyledMenuItemSelect,
UndecoratedLink,
ListItem,
+ DEFAULT_COLOR_LABELS,
} from 'twenty-ui/primitives/navigation';
import { ThemeProvider } from 'twenty-ui/theme-constants';
@@ -101,35 +96,46 @@ const NAVIGATION_ENTRIES: GalleryEntry[] = [
node: <MenuItemHotKeys hotKeys={['⌘', 'K']} />,
},
{
- name: 'MenuItemMultiSelect',
+ name: 'ListItem multiple selection',
node: (
- <MenuItemMultiSelect
- text="Multi select"
- selected={false}
+ <ListItem
className=""
- onSelectChange={() => {}}
- />
+ role="option"
+ aria-selected={false}
+ selected={false}
+ indicator="checkbox"
+ onClick={() => {}}
+ >
+ <OverflowingTextWithTooltip text={'Multi select'} />
+ </ListItem>
),
},
{
- name: 'MenuItemMultiSelectAvatar',
+ name: 'ListItem multiple avatar selection',
node: (
- <MenuItemMultiSelectAvatar
- text="Multi avatar"
+ <ListItem
+ role="option"
+ aria-selected={true}
selected={true}
- onSelectChange={() => {}}
- />
+ indicator="checkbox"
+ onClick={() => {}}
+ >
+ <OverflowingTextWithTooltip text={'Multi avatar'} />
+ </ListItem>
),
},
{
- name: 'MenuItemMultiSelectTag',
+ name: 'ListItem multiple tag selection',
node: (
- <MenuItemMultiSelectTag
- text="Tag"
- color="blue"
- selected={false}
+ <ListItem
onClick={() => {}}
- />
+ role="option"
+ aria-selected={false}
+ selected={false}
+ indicator="checkbox"
+ >
+ <Tag color={'blue'}>{'Tag'}</Tag>
+ </ListItem>
),
},
{
@@ -146,38 +152,62 @@ const NAVIGATION_ENTRIES: GalleryEntry[] = [
),
},
{
- name: 'StyledMenuItemSelect',
- node: <StyledMenuItemSelect>Select base</StyledMenuItemSelect>,
- },
- {
- name: 'MenuItemSelect',
- node: <MenuItemSelect text="Select" selected={true} onClick={() => {}} />,
+ name: 'ListItem selection',
+ node: (
+ <ListItem
+ onClick={() => {}}
+ role="option"
+ aria-selected={true}
+ selected={true}
+ indicator="check"
+ >
+ <OverflowingTextWithTooltip text={'Select'} />
+ </ListItem>
+ ),
},
{
- name: 'MenuItemSelectAvatar',
+ name: 'ListItem avatar selection',
node: (
- <MenuItemSelectAvatar
- text="Select avatar"
- selected={true}
+ <ListItem
onClick={() => {}}
- />
+ role="option"
+ aria-selected={true}
+ selected={true}
+ indicator="check"
+ >
+ <OverflowingTextWithTooltip text={'Select avatar'} />
+ </ListItem>
),
},
{
- name: 'MenuItemSelectColor',
+ name: 'ListItem color selection',
node: (
- <MenuItemSelectColor color="blue" selected={true} onClick={() => {}} />
+ <ListItem
+ onClick={() => {}}
+ role="option"
+ aria-selected={true}
+ selected={true}
+ indicator="check"
+ startIcon={<ColorSample colorName={'blue'} />}
+ >
+ <OverflowingTextWithTooltip text={DEFAULT_COLOR_LABELS['blue']} />
+ </ListItem>
),
},
{
- name: 'MenuItemSelectTag',
+ name: 'ListItem tag selection',
node: (
- <MenuItemSelectTag
- color="blue"
- text="Select tag"
- selected={true}
+ <ListItem
onClick={() => {}}
- />
+ role="option"
+ aria-selected={true}
+ selected={true}
+ indicator="check"
+ >
+ <Tag color={'blue'} borderStyle="dashed" variant={'soft'}>
+ {'Select tag'}
+ </Tag>
+ </ListItem>
),
},
{
diff --git a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-picker-list-items.front-component.tsx b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-picker-list-items.front-component.tsx
new file mode 100644
index 00000000000..222459312c9
--- /dev/null
+++ b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-picker-list-items.front-component.tsx
@@ -0,0 +1,72 @@
+import { createElement, useState } from 'react';
+import { defineFrontComponent } from 'twenty-sdk/define';
+import { Avatar, ColorSample, Tag } from 'twenty-ui/primitives/data-display';
+import { ListItem } from 'twenty-ui/primitives/navigation';
+
+import { TwentyUiGalleryCard } from '@/__stories__/shared/front-components/twenty-ui-gallery-card';
+
+const PickerListItemsExample = () => {
+ const [assignee, setAssignee] = useState('');
+ const [qualified, setQualified] = useState(false);
+ const [changes, setChanges] = useState(0);
+
+ return (
+ <TwentyUiGalleryCard title="Picker rows">
+ <div role="listbox" aria-label="Assignee">
+ {['Alex Morgan', 'Sam Taylor'].map((name) => (
+ <ListItem
+ key={name}
+ role="option"
+ aria-label={name}
+ aria-selected={assignee === name ? 'true' : 'false'}
+ selected={assignee === name}
+ indicator="check"
+ startIcon={<Avatar name={name} size="md" />}
+ description="Person"
+ render={(props) =>
+ createElement('button', { ...props, type: 'button' })
+ }
+ onClick={() => setAssignee(name)}
+ >
+ {name}
+ </ListItem>
+ ))}
+ </div>
+ <div role="listbox" aria-label="Tags" aria-multiselectable>
+ <ListItem
+ role="option"
+ aria-selected={qualified ? 'true' : 'false'}
+ selected={qualified}
+ indicator="checkbox"
+ render={(props) =>
+ createElement('button', { ...props, type: 'button' })
+ }
+ onClick={() => {
+ setQualified(!qualified);
+ setChanges((count) => count + 1);
+ }}
+ >
+ <Tag color="blue">Qualified</Tag>
+ </ListItem>
+ <ListItem
+ role="option"
+ aria-selected="false"
+ disabled
+ indicator="checkbox"
+ startIcon={<ColorSample colorName="red" />}
+ onClick={() => setChanges((count) => count + 1)}
+ >
+ Unavailable color
+ </ListItem>
+ </div>
+ <p role="status">Changes: {changes}</p>
+ </TwentyUiGalleryCard>
+ );
+};
+
+export default defineFrontComponent({
+ universalIdentifier: 'a7cde262-38e6-43dc-848a-2b421745515c',
+ name: 'twenty-ui-picker-list-items',
+ description: 'Single and multiple selection rows in the sandbox',
+ component: PickerListItemsExample,
+});
diff --git a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/pickerListItemsTest.ts b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/pickerListItemsTest.ts
new file mode 100644
index 00000000000..efb799a6230
--- /dev/null
+++ b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/pickerListItemsTest.ts
@@ -0,0 +1,45 @@
+import { expect, userEvent, waitFor, within } from 'storybook/test';
+
+import { errorHandler } from '@/__stories__/shared/test-utils/createFrontComponentStoryMeta';
+import { expectFrontComponentMounted } from '@/__stories__/shared/test-utils/matchers/expectFrontComponentMounted';
+import { type TwentyUiGalleryPlayFunction } from '@/__stories__/twenty-ui-gallery/types/TwentyUiGalleryPlayFunction';
+
+export const pickerListItemsTest: TwentyUiGalleryPlayFunction = async ({
+ canvasElement,
+}) => {
+ const canvas = within(canvasElement);
+ await expectFrontComponentMounted(canvas);
+
+ const alex = canvas.getByRole('option', { name: 'Alex Morgan' });
+ const sam = canvas.getByRole('option', { name: 'Sam Taylor' });
+
+ await userEvent.click(alex);
+ await waitFor(() => expect(alex).toHaveAttribute('aria-selected', 'true'));
+ sam.focus();
+ await userEvent.keyboard('{Enter}');
+ await waitFor(() => expect(sam).toHaveAttribute('aria-selected', 'true'));
+ expect(alex).toHaveAttribute('aria-selected', 'false');
+
+ const qualified = canvas.getByRole('option', { name: 'Qualified' });
+ const indicator = qualified.querySelector('span[aria-hidden="true"]');
+
+ expect(indicator).not.toBeNull();
+ await userEvent.click(indicator as HTMLElement);
+ await waitFor(() =>
+ expect(qualified).toHaveAttribute('aria-selected', 'true'),
+ );
+ expect(canvas.getByRole('status')).toHaveTextContent('Changes: 1');
+ qualified.focus();
+ await userEvent.keyboard(' ');
+ await waitFor(() =>
+ expect(qualified).toHaveAttribute('aria-selected', 'false'),
+ );
+ expect(canvas.getByRole('status')).toHaveTextContent('Changes: 2');
+
+ await userEvent.click(
+ canvas.getByRole('option', { name: 'Unavailable color' }),
+ );
+ expect(canvas.getByRole('status')).toHaveTextContent('Changes: 2');
+ expect(canvas.queryByRole('checkbox')).toBeNull();
+ expect(errorHandler).not.toHaveBeenCalled();
+};
diff --git a/packages/twenty-front/src/modules/activities/emails/recipients/components/EmailRecipientSuggestionMenuItem.tsx b/packages/twenty-front/src/modules/activities/emails/recipients/components/EmailRecipientSuggestionMenuItem.tsx
index 5225c0a435f..8e512c98cc7 100644
--- a/packages/twenty-front/src/modules/activities/emails/recipients/components/EmailRecipientSuggestionMenuItem.tsx
+++ b/packages/twenty-front/src/modules/activities/emails/recipients/components/EmailRecipientSuggestionMenuItem.tsx
@@ -1,5 +1,6 @@
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { Avatar } from 'twenty-ui/primitives/data-display';
-import { MenuItemSelectAvatar } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { type EmailRecipientSuggestion } from '@/activities/emails/recipients/types/EmailRecipientSuggestion';
import { SelectableListItem } from '@/ui/layout/selectable-list/components/SelectableListItem';
@@ -26,13 +27,15 @@ export const EmailRecipientSuggestionMenuItem = ({
return (
<SelectableListItem itemId={suggestion.suggestionId}>
- <MenuItemSelectAvatar
+ <ListItem
onClick={() => onPick(suggestion)}
- text={suggestion.label}
- contextualText={suggestion.secondaryText}
- selected={false}
focused={isSelectedItemId}
- avatar={
+ role="option"
+ aria-selected={false}
+ selected={false}
+ indicator="check"
+ description={suggestion.secondaryText}
+ startIcon={
<Avatar
src={getAbsoluteImageUrl(suggestion.avatarUrl)}
name={suggestion.label}
@@ -41,7 +44,9 @@ export const EmailRecipientSuggestionMenuItem = ({
shape="circle"
/>
}
- />
+ >
+ <OverflowingTextWithTooltip text={suggestion.label} />
+ </ListItem>
</SelectableListItem>
);
};
diff --git a/packages/twenty-front/src/modules/ai/components/AiChatThreadFilterDropdownGroupByMenu.tsx b/packages/twenty-front/src/modules/ai/components/AiChatThreadFilterDropdownGroupByMenu.tsx
index 6be90a7dcf3..69373a92595 100644
--- a/packages/twenty-front/src/modules/ai/components/AiChatThreadFilterDropdownGroupByMenu.tsx
+++ b/packages/twenty-front/src/modules/ai/components/AiChatThreadFilterDropdownGroupByMenu.tsx
@@ -1,6 +1,7 @@
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useLingui } from '@lingui/react/macro';
import { IconChevronLeft } from 'twenty-ui/icon';
-import { MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { AGENT_CHAT_THREAD_GROUP_BY } from '@/ai/constants/AgentChatThreadGroupBy';
import { AGENT_CHAT_THREAD_GROUP_BY_LABELS } from '@/ai/constants/AgentChatThreadGroupByLabels';
@@ -44,15 +45,21 @@ export const AiChatThreadFilterDropdownGroupByMenu = ({
</DropdownMenuHeader>
<DropdownMenuItemsContainer>
{AGENT_CHAT_THREAD_GROUP_BY_OPTIONS.map((option) => (
- <MenuItemSelect
+ <ListItem
key={option}
- text={t(AGENT_CHAT_THREAD_GROUP_BY_LABELS[option])}
- selected={agentChatThreadGroupBy === option}
onClick={() => {
setAgentChatThreadGroupBy(option);
closeDropdown();
}}
- />
+ role="option"
+ aria-selected={agentChatThreadGroupBy === option}
+ selected={agentChatThreadGroupBy === option}
+ indicator="check"
+ >
+ <OverflowingTextWithTooltip
+ text={t(AGENT_CHAT_THREAD_GROUP_BY_LABELS[option])}
+ />
+ </ListItem>
))}
</DropdownMenuItemsContainer>
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/ai/components/AiChatThreadFilterDropdownLastActivityMenu.tsx b/packages/twenty-front/src/modules/ai/components/AiChatThreadFilterDropdownLastActivityMenu.tsx
index 207e4d2ac31..9e92e4fc59f 100644
--- a/packages/twenty-front/src/modules/ai/components/AiChatThreadFilterDropdownLastActivityMenu.tsx
+++ b/packages/twenty-front/src/modules/ai/components/AiChatThreadFilterDropdownLastActivityMenu.tsx
@@ -1,6 +1,7 @@
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useLingui } from '@lingui/react/macro';
import { IconChevronLeft } from 'twenty-ui/icon';
-import { MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { AGENT_CHAT_THREAD_LAST_ACTIVITY_FILTER } from '@/ai/constants/AgentChatThreadLastActivityFilter';
import { AGENT_CHAT_THREAD_LAST_ACTIVITY_FILTER_LABELS } from '@/ai/constants/AgentChatThreadLastActivityFilterLabels';
@@ -48,15 +49,21 @@ export const AiChatThreadFilterDropdownLastActivityMenu = ({
</DropdownMenuHeader>
<DropdownMenuItemsContainer>
{AGENT_CHAT_THREAD_LAST_ACTIVITY_FILTER_OPTIONS.map((option) => (
- <MenuItemSelect
+ <ListItem
key={option}
- text={t(AGENT_CHAT_THREAD_LAST_ACTIVITY_FILTER_LABELS[option])}
- selected={agentChatThreadLastActivityFilter === option}
onClick={() => {
setAgentChatThreadLastActivityFilter(option);
closeDropdown();
}}
- />
+ role="option"
+ aria-selected={agentChatThreadLastActivityFilter === option}
+ selected={agentChatThreadLastActivityFilter === option}
+ indicator="check"
+ >
+ <OverflowingTextWithTooltip
+ text={t(AGENT_CHAT_THREAD_LAST_ACTIVITY_FILTER_LABELS[option])}
+ />
+ </ListItem>
))}
</DropdownMenuItemsContainer>
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/ai/components/AiChatThreadFilterDropdownStatusMenu.tsx b/packages/twenty-front/src/modules/ai/components/AiChatThreadFilterDropdownStatusMenu.tsx
index 6903c9b03eb..ea965793c3b 100644
--- a/packages/twenty-front/src/modules/ai/components/AiChatThreadFilterDropdownStatusMenu.tsx
+++ b/packages/twenty-front/src/modules/ai/components/AiChatThreadFilterDropdownStatusMenu.tsx
@@ -1,6 +1,7 @@
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useLingui } from '@lingui/react/macro';
import { IconChevronLeft } from 'twenty-ui/icon';
-import { MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { AGENT_CHAT_THREAD_FILTER_STATUS } from '@/ai/constants/AgentChatThreadFilterStatus';
import { AGENT_CHAT_THREAD_FILTER_STATUS_LABELS } from '@/ai/constants/AgentChatThreadFilterStatusLabels';
@@ -44,15 +45,21 @@ export const AiChatThreadFilterDropdownStatusMenu = ({
</DropdownMenuHeader>
<DropdownMenuItemsContainer>
{AGENT_CHAT_THREAD_FILTER_STATUS_OPTIONS.map((option) => (
- <MenuItemSelect
+ <ListItem
key={option}
- text={t(AGENT_CHAT_THREAD_FILTER_STATUS_LABELS[option])}
- selected={agentChatThreadFilterStatus === option}
onClick={() => {
setAgentChatThreadFilterStatus(option);
closeDropdown();
}}
- />
+ role="option"
+ aria-selected={agentChatThreadFilterStatus === option}
+ selected={agentChatThreadFilterStatus === option}
+ indicator="check"
+ >
+ <OverflowingTextWithTooltip
+ text={t(AGENT_CHAT_THREAD_FILTER_STATUS_LABELS[option])}
+ />
+ </ListItem>
))}
</DropdownMenuItemsContainer>
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/command-menu-item/edit/components/CommandMenuItemEditRecordSelectionDropdown.tsx b/packages/twenty-front/src/modules/command-menu-item/edit/components/CommandMenuItemEditRecordSelectionDropdown.tsx
index ecf860e5983..66be665c8e4 100644
--- a/packages/twenty-front/src/modules/command-menu-item/edit/components/CommandMenuItemEditRecordSelectionDropdown.tsx
+++ b/packages/twenty-front/src/modules/command-menu-item/edit/components/CommandMenuItemEditRecordSelectionDropdown.tsx
@@ -1,3 +1,5 @@
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { COMMAND_MENU_DROPDOWN_CLICK_OUTSIDE_ID } from '@/command-menu-item/constants/CommandMenuDropdownClickOutsideId';
import { useSelectFirstRecordForEditMode } from '@/command-menu-item/edit/hooks/useSelectFirstRecordForEditMode';
import { MAIN_CONTEXT_STORE_INSTANCE_ID } from '@/context-store/constants/MainContextStoreInstanceId';
@@ -13,7 +15,7 @@ import { styled } from '@linaria/react';
import { useLingui } from '@lingui/react/macro';
import { useContext } from 'react';
import { IconChevronDown, IconSquareCheck, IconSquareX } from 'twenty-ui/icon';
-import { MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants';
const DROPDOWN_ID = 'command-menu-edit-record-selection-dropdown';
@@ -111,18 +113,26 @@ export const CommandMenuItemEditRecordSelectionDropdown = ({
data-click-outside-id={COMMAND_MENU_DROPDOWN_CLICK_OUTSIDE_ID}
>
<DropdownMenuItemsContainer>
- <MenuItemSelect
- LeftIcon={IconSquareX}
- text={t`No record selected`}
- selected={isNoneSelected}
+ <ListItem
onClick={() => handleSelectMode('none')}
- />
- <MenuItemSelect
- LeftIcon={IconSquareCheck}
- text={t`Records selected`}
- selected={!isNoneSelected}
+ role="option"
+ aria-selected={isNoneSelected}
+ selected={isNoneSelected}
+ indicator="check"
+ startIcon={<SelectOptionIcon Icon={IconSquareX} />}
+ >
+ <OverflowingTextWithTooltip text={t`No record selected`} />
+ </ListItem>
+ <ListItem
onClick={() => handleSelectMode('selection')}
- />
+ role="option"
+ aria-selected={!isNoneSelected}
+ selected={!isNoneSelected}
+ indicator="check"
+ startIcon={<SelectOptionIcon Icon={IconSquareCheck} />}
+ >
+ <OverflowingTextWithTooltip text={t`Records selected`} />
+ </ListItem>
</DropdownMenuItemsContainer>
</StyledDropdownMenuContainer>
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/geo-map/components/PlaceAutocompleteSelect.tsx b/packages/twenty-front/src/modules/geo-map/components/PlaceAutocompleteSelect.tsx
index dcb99bdd45b..0e66cddceeb 100644
--- a/packages/twenty-front/src/modules/geo-map/components/PlaceAutocompleteSelect.tsx
+++ b/packages/twenty-front/src/modules/geo-map/components/PlaceAutocompleteSelect.tsx
@@ -1,3 +1,4 @@
+import { Tag } from 'twenty-ui/primitives/data-display';
import { type PlaceAutocompleteResult } from '@/geo-map/types/placeApi';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
@@ -7,7 +8,7 @@ import { styled } from '@linaria/react';
import { useMemo, useRef } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { type SelectOption } from 'twenty-ui/primitives/input';
-import { MenuItemSelectTag } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
const StyledContainer = styled.div<{ fullWidth?: boolean }>`
margin-bottom: 0px !important;
width: ${({ fullWidth }) => (fullWidth ? '100%' : 'auto')};
@@ -54,12 +55,22 @@ export const PlaceAutocompleteSelect = ({
itemId={option.value}
onEnter={() => onChange(option.value)}
>
- <MenuItemSelectTag
+ <ListItem
key={option.value}
- text={option.label}
- color="transparent"
onClick={() => onChange(option.value)}
- />
+ role="option"
+ aria-selected={false}
+ selected={false}
+ indicator="check"
+ >
+ <Tag
+ color={'transparent'}
+ borderStyle="dashed"
+ variant={'soft'}
+ >
+ {option.label}
+ </Tag>
+ </ListItem>
</SelectableListItem>
);
})}
diff --git a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownCountrySelect.tsx b/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownCountrySelect.tsx
index 17e9906ca82..ab132116fd6 100644
--- a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownCountrySelect.tsx
+++ b/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownCountrySelect.tsx
@@ -1,3 +1,4 @@
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useApplyObjectFilterDropdownFilterValue } from '@/object-record/object-filter-dropdown/hooks/useApplyObjectFilterDropdownFilterValue';
import { fieldMetadataItemUsedInDropdownComponentSelector } from '@/object-record/object-filter-dropdown/states/fieldMetadataItemUsedInDropdownComponentSelector';
import { objectFilterDropdownCurrentRecordFilterComponentState } from '@/object-record/object-filter-dropdown/states/objectFilterDropdownCurrentRecordFilterComponentState';
@@ -16,10 +17,7 @@ import { useLingui } from '@lingui/react/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { type ChangeEvent, useState } from 'react';
import { isDefined, parseJson } from 'twenty-shared/utils';
-import {
- MenuItem,
- MenuItemMultiSelectAvatar,
-} from 'twenty-ui/primitives/navigation';
+import { MenuItem, ListItem } from 'twenty-ui/primitives/navigation';
import { z } from 'zod';
export const EMPTY_FILTER_VALUE = '[]';
@@ -116,31 +114,41 @@ export const ObjectFilterDropdownCountrySelect = () => {
}}
/>
<DropdownMenuSeparator />
- <DropdownMenuItemsContainer hasMaxHeight>
+ <DropdownMenuItemsContainer isMultiSelect hasMaxHeight>
{filteredSelectedItems?.map((item) => {
return (
- <MenuItemMultiSelectAvatar
+ <ListItem
+ render={<button type="button" />}
key={item.id}
+ role="option"
+ aria-selected={true}
selected={true}
- onSelectChange={(newCheckedValue) => {
- handleMultipleItemSelectChange(item, newCheckedValue);
+ indicator="checkbox"
+ onClick={() => {
+ handleMultipleItemSelectChange(item, false);
}}
- text={item.name}
- avatar={getCountryFlagMenuItemAvatar(item.name, countries)}
- />
+ startIcon={getCountryFlagMenuItemAvatar(item.name, countries)}
+ >
+ <OverflowingTextWithTooltip text={item.name} />
+ </ListItem>
);
})}
{filteredSelectableItems?.map((item) => {
return (
- <MenuItemMultiSelectAvatar
+ <ListItem
+ render={<button type="button" />}
key={item.id}
+ role="option"
+ aria-selected={false}
selected={false}
- onSelectChange={(newCheckedValue) => {
- handleMultipleItemSelectChange(item, newCheckedValue);
+ indicator="checkbox"
+ onClick={() => {
+ handleMultipleItemSelectChange(item, true);
}}
- text={item.name}
- avatar={getCountryFlagMenuItemAvatar(item.name, countries)}
- />
+ startIcon={getCountryFlagMenuItemAvatar(item.name, countries)}
+ >
+ <OverflowingTextWithTooltip text={item.name} />
+ </ListItem>
);
})}
{showNoResult && <MenuItem text={t`No results`} />}
diff --git a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownCurrencySelect.tsx b/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownCurrencySelect.tsx
index 171e373de35..6e91f8c8f3f 100644
--- a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownCurrencySelect.tsx
+++ b/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownCurrencySelect.tsx
@@ -1,3 +1,4 @@
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useApplyObjectFilterDropdownFilterValue } from '@/object-record/object-filter-dropdown/hooks/useApplyObjectFilterDropdownFilterValue';
import { fieldMetadataItemUsedInDropdownComponentSelector } from '@/object-record/object-filter-dropdown/states/fieldMetadataItemUsedInDropdownComponentSelector';
import { objectFilterDropdownCurrentRecordFilterComponentState } from '@/object-record/object-filter-dropdown/states/objectFilterDropdownCurrentRecordFilterComponentState';
@@ -15,10 +16,7 @@ import { useLingui } from '@lingui/react/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { type ChangeEvent, useState } from 'react';
import { isDefined, parseJson } from 'twenty-shared/utils';
-import {
- MenuItem,
- MenuItemMultiSelectAvatar,
-} from 'twenty-ui/primitives/navigation';
+import { MenuItem, ListItem } from 'twenty-ui/primitives/navigation';
import { z } from 'zod';
export const EMPTY_FILTER_VALUE = '[]';
@@ -115,31 +113,41 @@ export const ObjectFilterDropdownCurrencySelect = () => {
}}
/>
<DropdownMenuSeparator />
- <DropdownMenuItemsContainer hasMaxHeight>
+ <DropdownMenuItemsContainer isMultiSelect hasMaxHeight>
{filteredSelectedItems?.map((item) => {
return (
- <MenuItemMultiSelectAvatar
+ <ListItem
+ render={<button type="button" />}
key={item.id}
+ role="option"
+ aria-selected={true}
selected={true}
- onSelectChange={(newCheckedValue) => {
- handleMultipleItemSelectChange(item, newCheckedValue);
+ indicator="checkbox"
+ onClick={() => {
+ handleMultipleItemSelectChange(item, false);
}}
- text={item.name}
- avatar={item.AvatarIcon && <item.AvatarIcon size="16" />}
- />
+ startIcon={item.AvatarIcon && <item.AvatarIcon size="16" />}
+ >
+ <OverflowingTextWithTooltip text={item.name} />
+ </ListItem>
);
})}
{filteredSelectableItems?.map((item) => {
return (
- <MenuItemMultiSelectAvatar
+ <ListItem
+ render={<button type="button" />}
key={item.id}
+ role="option"
+ aria-selected={false}
selected={false}
- onSelectChange={(newCheckedValue) => {
- handleMultipleItemSelectChange(item, newCheckedValue);
+ indicator="checkbox"
+ onClick={() => {
+ handleMultipleItemSelectChange(item, true);
}}
- text={item.name}
- avatar={item.AvatarIcon && <item.AvatarIcon size="16" />}
- />
+ startIcon={item.AvatarIcon && <item.AvatarIcon size="16" />}
+ >
+ <OverflowingTextWithTooltip text={item.name} />
+ </ListItem>
);
})}
{showNoResult && <MenuItem text={t`No results`} />}
diff --git a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownOptionSelect.tsx b/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownOptionSelect.tsx
index bd11a2b4eb4..d7edf977dc7 100644
--- a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownOptionSelect.tsx
+++ b/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownOptionSelect.tsx
@@ -1,3 +1,5 @@
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
+import { Tag } from 'twenty-ui/primitives/data-display';
import { useEffect, useMemo, useState } from 'react';
import { Key } from 'ts-key-enum';
@@ -25,7 +27,7 @@ import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { MAX_OPTIONS_TO_DISPLAY } from 'twenty-shared/constants';
import { isDefined, parseJson } from 'twenty-shared/utils';
-import { MenuItem, MenuItemMultiSelect } from 'twenty-ui/primitives/navigation';
+import { MenuItem, ListItem } from 'twenty-ui/primitives/navigation';
import { z } from 'zod';
export const EMPTY_FILTER_VALUE = '';
@@ -172,22 +174,30 @@ export const ObjectFilterDropdownOptionSelect = ({
selectableItemIdArray={objectRecordsIds}
focusId={focusId}
>
- <DropdownMenuItemsContainer hasMaxHeight>
+ <DropdownMenuItemsContainer isMultiSelect hasMaxHeight>
{showNoResult ? (
<MenuItem text={t`No results`} />
) : (
optionsInDropdown?.map((option) => (
- <MenuItemMultiSelect
+ <ListItem
+ render={<button type="button" />}
key={option.id}
+ className=""
+ focused={option.id === selectedItemId}
+ role="option"
+ aria-selected={option.isSelected}
selected={option.isSelected}
- isKeySelected={option.id === selectedItemId}
- onSelectChange={(selected) =>
- handleMultipleOptionSelectChange(option, selected)
+ indicator="checkbox"
+ onClick={() =>
+ handleMultipleOptionSelectChange(option, !option.isSelected)
}
- text={option.label}
- color={option.color}
- className=""
- />
+ >
+ {isDefined(option.color) ? (
+ <Tag color={option.color}>{option.label}</Tag>
+ ) : (
+ <OverflowingTextWithTooltip text={option.label} />
+ )}
+ </ListItem>
))
)}
</DropdownMenuItemsContainer>
diff --git a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownRecordPinnedItems.tsx b/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownRecordPinnedItems.tsx
index 0294227d88d..776a64bb211 100644
--- a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownRecordPinnedItems.tsx
+++ b/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownRecordPinnedItems.tsx
@@ -1,16 +1,10 @@
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { type SelectableItem } from '@/object-record/select/types/SelectableItem';
-import { styled } from '@linaria/react';
+import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
import { Avatar } from 'twenty-ui/primitives/data-display';
-import { MenuItemMultiSelectAvatar } from 'twenty-ui/primitives/navigation';
-import { themeCssVariables } from 'twenty-ui/theme-constants';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { getAbsoluteImageUrl } from '~/utils/image/getAbsoluteImageUrl';
-const StyledPinnedItemsContainer = styled.div`
- display: flex;
- flex-direction: column;
- padding: ${themeCssVariables.spacing[1]};
-`;
-
export const ObjectFilterDropdownRecordPinnedItems = (props: {
selectableItems: SelectableItem[];
onChange: (
@@ -19,17 +13,20 @@ export const ObjectFilterDropdownRecordPinnedItems = (props: {
) => void;
}) => {
return (
- <StyledPinnedItemsContainer>
+ <DropdownMenuItemsContainer isMultiSelect scrollable={false}>
{props.selectableItems.map((selectableItem) => {
return (
- <MenuItemMultiSelectAvatar
+ <ListItem
+ render={<button type="button" />}
key={selectableItem.id}
+ role="option"
+ aria-selected={selectableItem.isSelected}
selected={selectableItem.isSelected}
- onSelectChange={(newCheckedValue) => {
- props.onChange(selectableItem, newCheckedValue);
+ indicator="checkbox"
+ onClick={() => {
+ props.onChange(selectableItem, !selectableItem.isSelected);
}}
- text={selectableItem.name}
- avatar={
+ startIcon={
selectableItem.avatarUrl ? (
<Avatar
src={getAbsoluteImageUrl(selectableItem.avatarUrl)}
@@ -44,9 +41,11 @@ export const ObjectFilterDropdownRecordPinnedItems = (props: {
)
)
}
- />
+ >
+ <OverflowingTextWithTooltip text={selectableItem.name} />
+ </ListItem>
);
})}
- </StyledPinnedItemsContainer>
+ </DropdownMenuItemsContainer>
);
};
diff --git a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/__stories__/ObjectFilterDropdownRecordPinnedItems.stories.tsx b/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/__stories__/ObjectFilterDropdownRecordPinnedItems.stories.tsx
new file mode 100644
index 00000000000..623bdc1dbfb
--- /dev/null
+++ b/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/__stories__/ObjectFilterDropdownRecordPinnedItems.stories.tsx
@@ -0,0 +1,58 @@
+import { type Meta, type StoryObj } from '@storybook/react-vite';
+import { expect, fn, userEvent, within } from 'storybook/test';
+import { ComponentDecorator } from 'twenty-ui/testing';
+
+import { ObjectFilterDropdownRecordPinnedItems } from '@/object-record/object-filter-dropdown/components/ObjectFilterDropdownRecordPinnedItems';
+
+const meta: Meta<typeof ObjectFilterDropdownRecordPinnedItems> = {
+ title: 'Modules/ObjectRecord/ObjectFilterDropdownRecordPinnedItems',
+ component: ObjectFilterDropdownRecordPinnedItems,
+ decorators: [ComponentDecorator],
+ args: {
+ selectableItems: [
+ { id: 'current-user', name: 'Current user', isSelected: false },
+ ],
+ onChange: fn(),
+ },
+};
+
+export default meta;
+type Story = StoryObj<typeof ObjectFilterDropdownRecordPinnedItems>;
+
+export const KeyboardSelection: Story = {
+ play: async ({ canvasElement, args }) => {
+ const canvas = within(canvasElement);
+ const row = canvas.getByRole('option', { name: 'Current user' });
+
+ await expect(canvas.getByRole('listbox')).toHaveAttribute(
+ 'aria-multiselectable',
+ 'true',
+ );
+ row.focus();
+ await userEvent.keyboard('{Enter}');
+ await userEvent.keyboard(' ');
+ await expect(args.onChange).toHaveBeenCalledTimes(2);
+ await expect(args.onChange).toHaveBeenLastCalledWith(
+ args.selectableItems[0],
+ true,
+ );
+ await expect(row).toHaveFocus();
+ },
+};
+
+export const IndicatorSelection: Story = {
+ play: async ({ canvasElement, args }) => {
+ const canvas = within(canvasElement);
+ const row = canvas.getByRole('option', { name: 'Current user' });
+ const indicator = row.querySelector('span[aria-hidden="true"]');
+
+ await expect(indicator).not.toBeNull();
+ await userEvent.click(indicator as HTMLElement);
+ await expect(args.onChange).toHaveBeenCalledTimes(1);
+ await expect(args.onChange).toHaveBeenCalledWith(
+ args.selectableItems[0],
+ true,
+ );
+ await expect(canvas.queryByRole('checkbox')).toBeNull();
+ },
+};
diff --git a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownCalendarFieldsContent.tsx b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownCalendarFieldsContent.tsx
index c7a1531aa8e..dd8668146b9 100644
--- a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownCalendarFieldsContent.tsx
+++ b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownCalendarFieldsContent.tsx
@@ -1,3 +1,5 @@
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
import { useObjectOptionsDropdown } from '@/object-record/object-options-dropdown/hooks/useObjectOptionsDropdown';
import { recordIndexCalendarFieldMetadataIdComponentState } from '@/object-record/record-index/states/recordIndexCalendarFieldMetadataIdComponentState';
@@ -13,7 +15,7 @@ import { useGetAvailableFieldsForCalendar } from '@/views/view-picker/hooks/useG
import { useLingui } from '@lingui/react/macro';
import { useState } from 'react';
import { IconChevronLeft, IconSettings, useIcons } from 'twenty-ui/icon';
-import { MenuItem, MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { MenuItem, ListItem } from 'twenty-ui/primitives/navigation';
export const ObjectOptionsDropdownCalendarFieldsContent = () => {
const { t } = useLingui();
@@ -80,13 +82,19 @@ export const ObjectOptionsDropdownCalendarFieldsContent = () => {
<DropdownMenuSeparator />
<DropdownMenuItemsContainer>
{filteredCalendarFields.map((fieldMetadataItem) => (
- <MenuItemSelect
+ <ListItem
key={fieldMetadataItem.id}
- selected={fieldMetadataItem.id === calendarFieldMetadata?.id}
onClick={() => handleCalendarFieldChange(fieldMetadataItem)}
- LeftIcon={getIcon(fieldMetadataItem.icon)}
- text={fieldMetadataItem.label}
- />
+ role="option"
+ aria-selected={fieldMetadataItem.id === calendarFieldMetadata?.id}
+ selected={fieldMetadataItem.id === calendarFieldMetadata?.id}
+ indicator="check"
+ startIcon={
+ <SelectOptionIcon Icon={getIcon(fieldMetadataItem.icon)} />
+ }
+ >
+ <OverflowingTextWithTooltip text={fieldMetadataItem.label} />
+ </ListItem>
))}
</DropdownMenuItemsContainer>
<DropdownMenuSeparator />
diff --git a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownCalendarViewContent.tsx b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownCalendarViewContent.tsx
index 2bb5ef516de..af38ea3d811 100644
--- a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownCalendarViewContent.tsx
+++ b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownCalendarViewContent.tsx
@@ -1,3 +1,5 @@
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useSetAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useSetAtomComponentState';
import { useObjectOptionsDropdown } from '@/object-record/object-options-dropdown/hooks/useObjectOptionsDropdown';
import { recordIndexCalendarLayoutComponentState } from '@/object-record/record-index/states/recordIndexCalendarLayoutComponentState';
@@ -19,7 +21,7 @@ import {
IconChevronLeft,
IconTimelineEvent,
} from 'twenty-ui/icon';
-import { MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { ViewCalendarLayout } from '~/generated-metadata/graphql';
const RECORD_CALENDAR_TIMELINE_VIEW_ID = 'record-calendar-timeline-view';
@@ -83,48 +85,70 @@ export const ObjectOptionsDropdownCalendarViewContent = () => {
itemId={ViewCalendarLayout.DAY}
onEnter={() => handleCalendarViewChange(ViewCalendarLayout.DAY)}
>
- <MenuItemSelect
- LeftIcon={IconCalendarEvent}
- text={t`Day`}
- selected={recordIndexCalendarLayout === ViewCalendarLayout.DAY}
+ <ListItem
onClick={() => handleCalendarViewChange(ViewCalendarLayout.DAY)}
focused={selectedItemId === ViewCalendarLayout.DAY}
- />
+ role="option"
+ aria-selected={
+ recordIndexCalendarLayout === ViewCalendarLayout.DAY
+ }
+ selected={recordIndexCalendarLayout === ViewCalendarLayout.DAY}
+ indicator="check"
+ startIcon={<SelectOptionIcon Icon={IconCalendarEvent} />}
+ >
+ <OverflowingTextWithTooltip text={t`Day`} />
+ </ListItem>
</SelectableListItem>
<SelectableListItem
itemId={ViewCalendarLayout.WEEK}
onEnter={() => handleCalendarViewChange(ViewCalendarLayout.WEEK)}
>
- <MenuItemSelect
- LeftIcon={IconCalendarWeek}
- text={t`Week`}
- selected={recordIndexCalendarLayout === ViewCalendarLayout.WEEK}
+ <ListItem
onClick={() => handleCalendarViewChange(ViewCalendarLayout.WEEK)}
focused={selectedItemId === ViewCalendarLayout.WEEK}
- />
+ role="option"
+ aria-selected={
+ recordIndexCalendarLayout === ViewCalendarLayout.WEEK
+ }
+ selected={recordIndexCalendarLayout === ViewCalendarLayout.WEEK}
+ indicator="check"
+ startIcon={<SelectOptionIcon Icon={IconCalendarWeek} />}
+ >
+ <OverflowingTextWithTooltip text={t`Week`} />
+ </ListItem>
</SelectableListItem>
<SelectableListItem
itemId={ViewCalendarLayout.MONTH}
onEnter={() => handleCalendarViewChange(ViewCalendarLayout.MONTH)}
>
- <MenuItemSelect
- LeftIcon={IconCalendarMonth}
- text={t`Month`}
- selected={recordIndexCalendarLayout === ViewCalendarLayout.MONTH}
+ <ListItem
onClick={() => handleCalendarViewChange(ViewCalendarLayout.MONTH)}
focused={selectedItemId === ViewCalendarLayout.MONTH}
- />
+ role="option"
+ aria-selected={
+ recordIndexCalendarLayout === ViewCalendarLayout.MONTH
+ }
+ selected={recordIndexCalendarLayout === ViewCalendarLayout.MONTH}
+ indicator="check"
+ startIcon={<SelectOptionIcon Icon={IconCalendarMonth} />}
+ >
+ <OverflowingTextWithTooltip text={t`Month`} />
+ </ListItem>
</SelectableListItem>
<SelectableListItem itemId={RECORD_CALENDAR_TIMELINE_VIEW_ID}>
- <MenuItemSelect
- LeftIcon={IconTimelineEvent}
- text={t`Timeline`}
- selected={false}
+ <ListItem
focused={selectedItemId === RECORD_CALENDAR_TIMELINE_VIEW_ID}
- contextualText={<Pill label={t`Soon`} />}
- contextualTextPosition="right"
disabled
- />
+ role="option"
+ aria-selected={false}
+ selected={false}
+ indicator="check"
+ description={<Pill label={t`Soon`} />}
+ descriptionPlacement={'end'}
+ startIcon={<SelectOptionIcon Icon={IconTimelineEvent} />}
+ >
+ <OverflowingTextWithTooltip text={t`Timeline`} />
+ </ListItem>
</SelectableListItem>
</SelectableList>
</DropdownMenuItemsContainer>
diff --git a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownLayoutContent.tsx b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownLayoutContent.tsx
index e333b41e779..b24018d7696 100644
--- a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownLayoutContent.tsx
+++ b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownLayoutContent.tsx
@@ -1,3 +1,4 @@
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { useObjectOptionsDropdown } from '@/object-record/object-options-dropdown/hooks/useObjectOptionsDropdown';
import { useSetViewTypeFromLayoutOptionsMenu } from '@/object-record/object-options-dropdown/hooks/useSetViewTypeFromLayoutOptionsMenu';
import { recordIndexCalendarLayoutComponentState } from '@/object-record/record-index/states/recordIndexCalendarLayoutComponentState';
@@ -35,7 +36,7 @@ import {
IconTable,
} from 'twenty-ui/icon';
import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
-import { MenuItem, MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { MenuItem, ListItem } from 'twenty-ui/primitives/navigation';
import { ViewCalendarLayout } from '~/generated-metadata/graphql';
export const ObjectOptionsDropdownLayoutContent = () => {
@@ -156,17 +157,23 @@ export const ObjectOptionsDropdownLayoutContent = () => {
setAndPersistViewType(ViewType.TABLE);
}}
>
- <MenuItemSelect
- LeftIcon={IconTable}
- text={t(getViewTypeLabel(ViewType.TABLE))}
- selected={currentView?.type === ViewType.TABLE}
+ <ListItem
focused={selectedItemId === ViewType.TABLE}
onClick={async () => {
if (currentView?.type !== ViewType.TABLE) {
await setAndPersistViewType(ViewType.TABLE);
}
}}
- />
+ role="option"
+ aria-selected={currentView?.type === ViewType.TABLE}
+ selected={currentView?.type === ViewType.TABLE}
+ indicator="check"
+ startIcon={<SelectOptionIcon Icon={IconTable} />}
+ >
+ <OverflowingTextWithTooltip
+ text={t(getViewTypeLabel(ViewType.TABLE))}
+ />
+ </ListItem>
</SelectableListItem>
<SelectableListItem
itemId={ViewType.LIST}
@@ -174,17 +181,25 @@ export const ObjectOptionsDropdownLayoutContent = () => {
setAndPersistViewType(ViewType.LIST);
}}
>
- <MenuItemSelect
- LeftIcon={viewTypeIconMapping(ViewType.LIST)}
- text={t(getViewTypeLabel(ViewType.LIST))}
- selected={currentView?.type === ViewType.LIST}
+ <ListItem
focused={selectedItemId === ViewType.LIST}
onClick={async () => {
if (currentView?.type !== ViewType.LIST) {
await setAndPersistViewType(ViewType.LIST);
}
}}
- />
+ role="option"
+ aria-selected={currentView?.type === ViewType.LIST}
+ selected={currentView?.type === ViewType.LIST}
+ indicator="check"
+ startIcon={
+ <SelectOptionIcon Icon={viewTypeIconMapping(ViewType.LIST)} />
+ }
+ >
+ <OverflowingTextWithTooltip
+ text={t(getViewTypeLabel(ViewType.LIST))}
+ />
+ </ListItem>
</SelectableListItem>
<SelectableListItem
itemId={ViewType.CALENDAR}
@@ -192,13 +207,23 @@ export const ObjectOptionsDropdownLayoutContent = () => {
setAndPersistViewType(ViewType.CALENDAR);
}}
>
- <MenuItemSelect
- LeftIcon={viewTypeIconMapping(ViewType.CALENDAR)}
- text={t(getViewTypeLabel(ViewType.CALENDAR))}
- selected={currentView?.type === ViewType.CALENDAR}
+ <ListItem
focused={selectedItemId === ViewType.CALENDAR}
onClick={handleSelectCalendarViewType}
- />
+ role="option"
+ aria-selected={currentView?.type === ViewType.CALENDAR}
+ selected={currentView?.type === ViewType.CALENDAR}
+ indicator="check"
+ startIcon={
+ <SelectOptionIcon
+ Icon={viewTypeIconMapping(ViewType.CALENDAR)}
+ />
+ }
+ >
+ <OverflowingTextWithTooltip
+ text={t(getViewTypeLabel(ViewType.CALENDAR))}
+ />
+ </ListItem>
</SelectableListItem>
<SelectableListItem
itemId={ViewType.KANBAN}
@@ -206,12 +231,15 @@ export const ObjectOptionsDropdownLayoutContent = () => {
setAndPersistViewType(ViewType.KANBAN);
}}
>
- <MenuItemSelect
- LeftIcon={viewTypeIconMapping(ViewType.KANBAN)}
- text={t(getViewTypeLabel(ViewType.KANBAN))}
+ <ListItem
disabled={isDefaultView}
focused={selectedItemId === ViewType.KANBAN}
- contextualText={
+ onClick={handleSelectKanbanViewType}
+ role="option"
+ aria-selected={currentView?.type === ViewType.KANBAN}
+ selected={currentView?.type === ViewType.KANBAN}
+ indicator="check"
+ description={
isDefaultView ? (
<>
{nbsp}·{nbsp}
@@ -223,10 +251,17 @@ export const ObjectOptionsDropdownLayoutContent = () => {
t`Create Select...`
) : undefined
}
- contextualTextPosition="right"
- selected={currentView?.type === ViewType.KANBAN}
- onClick={handleSelectKanbanViewType}
- />
+ descriptionPlacement={'end'}
+ startIcon={
+ <SelectOptionIcon
+ Icon={viewTypeIconMapping(ViewType.KANBAN)}
+ />
+ }
+ >
+ <OverflowingTextWithTooltip
+ text={t(getViewTypeLabel(ViewType.KANBAN))}
+ />
+ </ListItem>
</SelectableListItem>
</DropdownMenuItemsContainer>
<DropdownMenuSeparator />
diff --git a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupFieldsContent.tsx b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupFieldsContent.tsx
index 2787c7fbb3e..ff19e475138 100644
--- a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupFieldsContent.tsx
+++ b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupFieldsContent.tsx
@@ -1,3 +1,5 @@
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useEffect } from 'react';
import { useObjectNamePluralFromSingular } from '@/object-metadata/hooks/useObjectNamePluralFromSingular';
@@ -26,8 +28,8 @@ import { getSettingsPath, isDefined } from 'twenty-shared/utils';
import { IconChevronLeft, IconSettings, useIcons } from 'twenty-ui/icon';
import {
MenuItem,
- MenuItemSelect,
UndecoratedLink,
+ ListItem,
} from 'twenty-ui/primitives/navigation';
import { FieldMetadataType } from '~/generated-metadata/graphql';
@@ -128,22 +130,34 @@ export const ObjectOptionsDropdownRecordGroupFieldsContent = () => {
<DropdownMenuSeparator />
<DropdownMenuItemsContainer>
{isRecordGroupingOptionalForViewType(viewType) && (
- <MenuItemSelect
- text={t`None`}
- selected={!isDefined(recordIndexGroupFieldMetadataItem)}
+ <ListItem
onClick={handleResetRecordGroupField}
- />
+ role="option"
+ aria-selected={!isDefined(recordIndexGroupFieldMetadataItem)}
+ selected={!isDefined(recordIndexGroupFieldMetadataItem)}
+ indicator="check"
+ >
+ <OverflowingTextWithTooltip text={t`None`} />
+ </ListItem>
)}
{filteredRecordGroupFieldMetadataItems.map((fieldMetadataItem) => (
- <MenuItemSelect
+ <ListItem
key={fieldMetadataItem.id}
+ onClick={() => handleRecordGroupFieldChange(fieldMetadataItem)}
+ role="option"
+ aria-selected={
+ fieldMetadataItem.id === recordIndexGroupFieldMetadataItem?.id
+ }
selected={
fieldMetadataItem.id === recordIndexGroupFieldMetadataItem?.id
}
- onClick={() => handleRecordGroupFieldChange(fieldMetadataItem)}
- LeftIcon={getIcon(fieldMetadataItem.icon)}
- text={fieldMetadataItem.label}
- />
+ indicator="check"
+ startIcon={
+ <SelectOptionIcon Icon={getIcon(fieldMetadataItem.icon)} />
+ }
+ >
+ <OverflowingTextWithTooltip text={fieldMetadataItem.label} />
+ </ListItem>
))}
</DropdownMenuItemsContainer>
<DropdownMenuSeparator />
diff --git a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupSortContent.tsx b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupSortContent.tsx
index 0466f20a99d..e3b38c19b84 100644
--- a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupSortContent.tsx
+++ b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupSortContent.tsx
@@ -1,3 +1,5 @@
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useEffect } from 'react';
import { isManyToOneRelationField } from '@/object-metadata/utils/isManyToOneRelationField';
@@ -24,7 +26,7 @@ import {
IconSortAZ,
IconSortZA,
} from 'twenty-ui/icon';
-import { MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
export const ObjectOptionsDropdownRecordGroupSortContent = () => {
const { currentContentId, onContentChange, dropdownId } =
@@ -93,15 +95,21 @@ export const ObjectOptionsDropdownRecordGroupSortContent = () => {
itemId={RecordGroupSort.Manual}
onEnter={() => handleRecordGroupSortChange(RecordGroupSort.Manual)}
>
- <MenuItemSelect
+ <ListItem
onClick={() =>
handleRecordGroupSortChange(RecordGroupSort.Manual)
}
- LeftIcon={IconHandMove}
- text={RecordGroupSort.Manual}
- selected={recordIndexRecordGroupSort === RecordGroupSort.Manual}
focused={selectedItemId === RecordGroupSort.Manual}
- />
+ role="option"
+ aria-selected={
+ recordIndexRecordGroupSort === RecordGroupSort.Manual
+ }
+ selected={recordIndexRecordGroupSort === RecordGroupSort.Manual}
+ indicator="check"
+ startIcon={<SelectOptionIcon Icon={IconHandMove} />}
+ >
+ <OverflowingTextWithTooltip text={RecordGroupSort.Manual} />
+ </ListItem>
</SelectableListItem>
{!isRelationGroupBy && (
<>
@@ -111,17 +119,25 @@ export const ObjectOptionsDropdownRecordGroupSortContent = () => {
handleRecordGroupSortChange(RecordGroupSort.Alphabetical)
}
>
- <MenuItemSelect
+ <ListItem
onClick={() =>
handleRecordGroupSortChange(RecordGroupSort.Alphabetical)
}
- LeftIcon={IconSortAZ}
- text={RecordGroupSort.Alphabetical}
+ focused={selectedItemId === RecordGroupSort.Alphabetical}
+ role="option"
+ aria-selected={
+ recordIndexRecordGroupSort === RecordGroupSort.Alphabetical
+ }
selected={
recordIndexRecordGroupSort === RecordGroupSort.Alphabetical
}
- focused={selectedItemId === RecordGroupSort.Alphabetical}
- />
+ indicator="check"
+ startIcon={<SelectOptionIcon Icon={IconSortAZ} />}
+ >
+ <OverflowingTextWithTooltip
+ text={RecordGroupSort.Alphabetical}
+ />
+ </ListItem>
</SelectableListItem>
<SelectableListItem
itemId={RecordGroupSort.ReverseAlphabetical}
@@ -131,22 +147,31 @@ export const ObjectOptionsDropdownRecordGroupSortContent = () => {
)
}
>
- <MenuItemSelect
+ <ListItem
onClick={() =>
handleRecordGroupSortChange(
RecordGroupSort.ReverseAlphabetical,
)
}
- LeftIcon={IconSortZA}
- text={RecordGroupSort.ReverseAlphabetical}
- selected={
+ focused={
+ selectedItemId === RecordGroupSort.ReverseAlphabetical
+ }
+ role="option"
+ aria-selected={
recordIndexRecordGroupSort ===
RecordGroupSort.ReverseAlphabetical
}
- focused={
- selectedItemId === RecordGroupSort.ReverseAlphabetical
+ selected={
+ recordIndexRecordGroupSort ===
+ RecordGroupSort.ReverseAlphabetical
}
- />
+ indicator="check"
+ startIcon={<SelectOptionIcon Icon={IconSortZA} />}
+ >
+ <OverflowingTextWithTooltip
+ text={RecordGroupSort.ReverseAlphabetical}
+ />
+ </ListItem>
</SelectableListItem>
</>
)}
diff --git a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownVisibilityContent.tsx b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownVisibilityContent.tsx
index 48b3cc2f98d..aab57ee71c8 100644
--- a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownVisibilityContent.tsx
+++ b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownVisibilityContent.tsx
@@ -1,3 +1,4 @@
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { useObjectOptionsDropdown } from '@/object-record/object-options-dropdown/hooks/useObjectOptionsDropdown';
import { useHasPermissionFlag } from '@/settings/roles/hooks/useHasPermissionFlag';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
@@ -22,8 +23,11 @@ import {
IconCircleDashed,
IconCopy,
} from 'twenty-ui/icon';
-import { Tooltip } from 'twenty-ui/primitives/surfaces';
-import { MenuItem, MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import {
+ Tooltip,
+ OverflowingTextWithTooltip,
+} from 'twenty-ui/primitives/surfaces';
+import { MenuItem, ListItem } from 'twenty-ui/primitives/navigation';
import {
ViewVisibility,
PermissionFlagType,
@@ -101,17 +105,21 @@ export const ObjectOptionsDropdownVisibilityContent = () => {
disabled={!!hasViewsPermission}
>
<div id="workspace-visibility-option">
- <MenuItemSelect
- LeftIcon={IconCircle}
- text={t`Workspace`}
- contextualText={t`Everyone`}
- selected={currentVisibility === ViewVisibility.WORKSPACE}
+ <ListItem
focused={selectedItemId === ViewVisibility.WORKSPACE}
onClick={() =>
handleVisibilityChange(ViewVisibility.WORKSPACE)
}
disabled={!hasViewsPermission || !canPersistChanges}
- />
+ role="option"
+ aria-selected={currentVisibility === ViewVisibility.WORKSPACE}
+ selected={currentVisibility === ViewVisibility.WORKSPACE}
+ indicator="check"
+ description={t`Everyone`}
+ startIcon={<SelectOptionIcon Icon={IconCircle} />}
+ >
+ <OverflowingTextWithTooltip text={t`Workspace`} />
+ </ListItem>
</div>
</Tooltip>
</SelectableListItem>
@@ -122,15 +130,19 @@ export const ObjectOptionsDropdownVisibilityContent = () => {
handleVisibilityChange(ViewVisibility.UNLISTED)
}
>
- <MenuItemSelect
- LeftIcon={IconCircleDashed}
- text={t`Unlisted`}
- contextualText={t`Visible to you`}
- selected={currentVisibility === ViewVisibility.UNLISTED}
+ <ListItem
focused={selectedItemId === ViewVisibility.UNLISTED}
onClick={() => handleVisibilityChange(ViewVisibility.UNLISTED)}
disabled={!canPersistChanges}
- />
+ role="option"
+ aria-selected={currentVisibility === ViewVisibility.UNLISTED}
+ selected={currentVisibility === ViewVisibility.UNLISTED}
+ indicator="check"
+ description={t`Visible to you`}
+ startIcon={<SelectOptionIcon Icon={IconCircleDashed} />}
+ >
+ <OverflowingTextWithTooltip text={t`Unlisted`} />
+ </ListItem>
</SelectableListItem>
{currentVisibility === ViewVisibility.WORKSPACE && (
<>
diff --git a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/__tests__/ObjectOptionsDropdownCalendarViewContent.test.tsx b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/__tests__/ObjectOptionsDropdownCalendarViewContent.test.tsx
index 7441a6f2e65..8ef758da14a 100644
--- a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/__tests__/ObjectOptionsDropdownCalendarViewContent.test.tsx
+++ b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/__tests__/ObjectOptionsDropdownCalendarViewContent.test.tsx
@@ -94,22 +94,22 @@ jest.mock('twenty-ui/primitives/data-display', () => ({
}));
jest.mock('twenty-ui/primitives/navigation', () => ({
MenuItem: ({ text }: { text: string }) => <span>{text}</span>,
- MenuItemSelect: ({
- contextualText,
+ ListItem: ({
+ description,
disabled,
onClick,
selected,
- text,
+ children,
}: {
- contextualText?: React.ReactNode;
+ description?: React.ReactNode;
disabled?: boolean;
onClick?: () => void;
selected: boolean;
- text: string;
+ children: React.ReactNode;
}) => (
<button data-selected={selected} disabled={disabled} onClick={onClick}>
- <span>{text}</span>
- {contextualText}
+ <span>{children}</span>
+ {description}
</button>
),
}));
diff --git a/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPickerMenuItemContent.tsx b/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPickerMenuItemContent.tsx
index cfa19acee4c..1f876107fb8 100644
--- a/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPickerMenuItemContent.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPickerMenuItemContent.tsx
@@ -1,3 +1,4 @@
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { t } from '@lingui/core/macro';
import { type EnrichedObjectMetadataItem } from '@/object-metadata/types/EnrichedObjectMetadataItem';
@@ -14,7 +15,7 @@ import { useAtomComponentFamilyStateValue } from '@/ui/utilities/state/jotai/hoo
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { capitalize } from 'twenty-shared/utils';
import { Avatar } from 'twenty-ui/primitives/data-display';
-import { MenuItemMultiSelectAvatar } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { multipleRecordPickerSearchableObjectMetadataItemsComponentState } from '@/object-record/record-picker/multiple-record-picker/states/multipleRecordPickerSearchableObjectMetadataItemsComponentState';
import { type SearchRecord } from '~/generated/graphql';
@@ -78,11 +79,19 @@ export const MultipleRecordPickerMenuItemContent = ({
key={searchRecord.recordId}
onEnter={() => handleSelectChange(!isRecordSelectedWithObjectItem)}
>
- <MenuItemMultiSelectAvatar
- onSelectChange={(isSelected) => handleSelectChange(isSelected)}
- isKeySelected={isSelectedItemId}
+ <ListItem
+ focused={isSelectedItemId}
+ role="option"
+ aria-selected={isRecordSelectedWithObjectItem}
selected={isRecordSelectedWithObjectItem}
- avatar={
+ indicator="checkbox"
+ description={
+ showObjectName
+ ? capitalize(objectMetadataItem.labelSingular)
+ : undefined
+ }
+ onClick={() => handleSelectChange(!isRecordSelectedWithObjectItem)}
+ startIcon={
<Avatar
src={getAbsoluteImageUrl(searchRecord.imageUrl)}
colorSeed={searchRecord.recordId}
@@ -91,13 +100,9 @@ export const MultipleRecordPickerMenuItemContent = ({
shape={getAvatarShape(objectMetadataItem)}
/>
}
- text={displayText}
- contextualText={
- showObjectName
- ? capitalize(objectMetadataItem.labelSingular)
- : undefined
- }
- />
+ >
+ <OverflowingTextWithTooltip text={displayText} />
+ </ListItem>
</SelectableListItem>
);
};
diff --git a/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPickerMenuItems.tsx b/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPickerMenuItems.tsx
index 97a0eb8328c..f8584405365 100644
--- a/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPickerMenuItems.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPickerMenuItems.tsx
@@ -82,7 +82,7 @@ export const MultipleRecordPickerMenuItems = ({
const searchHasNoResults = pickableRecordIds.length === 0;
return (
- <DropdownMenuItemsContainer hasMaxHeight>
+ <DropdownMenuItemsContainer isMultiSelect hasMaxHeight>
{multipleRecordPickerShouldShowInitialLoading ? (
<RecordPickerInitialLoadingEmptyContainer />
) : multipleRecordPickerShouldShowSkeleton ? (
diff --git a/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/components/SingleRecordPickerMenuItem.tsx b/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/components/SingleRecordPickerMenuItem.tsx
index 28d7a10eae3..dade53874d2 100644
--- a/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/components/SingleRecordPickerMenuItem.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/components/SingleRecordPickerMenuItem.tsx
@@ -1,3 +1,4 @@
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useMemo } from 'react';
import { type EnrichedObjectMetadataItem } from '@/object-metadata/types/EnrichedObjectMetadataItem';
@@ -15,7 +16,7 @@ import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/use
import { useAtomFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilyStateValue';
import { capitalize, isDefined } from 'twenty-shared/utils';
import { Avatar } from 'twenty-ui/primitives/data-display';
-import { MenuItemSelectAvatar } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { getAbsoluteImageUrl } from '~/utils/image/getAbsoluteImageUrl';
type SingleRecordPickerMenuItemProps = {
@@ -81,13 +82,20 @@ export const SingleRecordPickerMenuItem = ({
onMorphItemSelected(morphItem);
}}
>
- <MenuItemSelectAvatar
- testId="menu-item"
+ <ListItem
onClick={() => onMorphItemSelected(morphItem)}
- text={searchRecordStore.label}
- selected={isRecordSelected}
focused={isSelectedItemId}
- avatar={
+ role="option"
+ aria-selected={isRecordSelected}
+ selected={isRecordSelected}
+ indicator="check"
+ data-testid={'menu-item'}
+ description={
+ showObjectName
+ ? capitalize(searchRecordStore.objectLabelSingular)
+ : undefined
+ }
+ startIcon={
<Avatar
src={getAbsoluteImageUrl(searchRecordStore.imageUrl)}
colorSeed={morphItem.recordId}
@@ -96,12 +104,9 @@ export const SingleRecordPickerMenuItem = ({
shape={getAvatarShape(objectMetadataItem)}
/>
}
- contextualText={
- showObjectName
- ? capitalize(searchRecordStore.objectLabelSingular)
- : undefined
- }
- />
+ >
+ <OverflowingTextWithTooltip text={searchRecordStore.label} />
+ </ListItem>
</SelectableListItem>
);
};
diff --git a/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/components/SingleRecordPickerMenuItems.tsx b/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/components/SingleRecordPickerMenuItems.tsx
index e0f6afaa41d..03a86311687 100644
--- a/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/components/SingleRecordPickerMenuItems.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/components/SingleRecordPickerMenuItems.tsx
@@ -1,3 +1,5 @@
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { isDefined } from 'twenty-shared/utils';
import { isUndefined } from '@sniptt/guards';
import { Key } from 'ts-key-enum';
@@ -23,7 +25,7 @@ import { useAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useAtomC
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { useAtomComponentFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentFamilyStateValue';
import { type IconComponent } from 'twenty-ui/icon';
-import { MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
export type SingleRecordPickerMenuItemsProps = {
EmptyIcon?: IconComponent;
@@ -109,16 +111,20 @@ export const SingleRecordPickerMenuItems = ({
onMorphItemSelected();
}}
>
- <MenuItemSelect
+ <ListItem
onClick={() => {
setSingleRecordPickerSelectedId(undefined);
onMorphItemSelected();
}}
- LeftIcon={EmptyIcon}
- text={emptyLabel}
- selected={isUndefined(singleRecordPickerSelectedId)}
focused={isSelectedItemId}
- />
+ role="option"
+ aria-selected={isUndefined(singleRecordPickerSelectedId)}
+ selected={isUndefined(singleRecordPickerSelectedId)}
+ indicator="check"
+ startIcon={<SelectOptionIcon Icon={EmptyIcon} />}
+ >
+ <OverflowingTextWithTooltip text={emptyLabel} />
+ </ListItem>
</SelectableListItem>
)}
{singleRecordPickerShouldShowInitialLoading ? (
diff --git a/packages/twenty-front/src/modules/object-record/record-table-widget/components/RecordTableWidgetRelationPickerMenuItem.tsx b/packages/twenty-front/src/modules/object-record/record-table-widget/components/RecordTableWidgetRelationPickerMenuItem.tsx
index f43abb00e90..a7ce113a554 100644
--- a/packages/twenty-front/src/modules/object-record/record-table-widget/components/RecordTableWidgetRelationPickerMenuItem.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-table-widget/components/RecordTableWidgetRelationPickerMenuItem.tsx
@@ -1,3 +1,4 @@
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { type SelectableItem } from '@/object-record/select/types/SelectableItem';
import { DropdownComponentInstanceContext } from '@/ui/layout/dropdown/contexts/DropdownComponentInstanceContext';
import { SelectableListItem } from '@/ui/layout/selectable-list/components/SelectableListItem';
@@ -5,7 +6,7 @@ import { isSelectedItemIdComponentFamilyState } from '@/ui/layout/selectable-lis
import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';
import { useAtomComponentFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentFamilyStateValue';
import { Avatar } from 'twenty-ui/primitives/data-display';
-import { MenuItemSelectAvatar } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { getAbsoluteImageUrl } from '~/utils/image/getAbsoluteImageUrl';
type RecordTableWidgetRelationPickerMenuItemProps = {
@@ -32,12 +33,14 @@ export const RecordTableWidgetRelationPickerMenuItem = ({
itemId={relationRecord.id}
onEnter={() => onSelect(relationRecord.id)}
>
- <MenuItemSelectAvatar
+ <ListItem
onClick={() => onSelect(relationRecord.id)}
- text={relationRecord.name}
- selected={false}
focused={isSelectedItemId}
- avatar={
+ role="option"
+ aria-selected={false}
+ selected={false}
+ indicator="check"
+ startIcon={
<Avatar
src={getAbsoluteImageUrl(relationRecord.avatarUrl)}
colorSeed={relationRecord.id}
@@ -46,7 +49,9 @@ export const RecordTableWidgetRelationPickerMenuItem = ({
shape={relationRecord.avatarShape ?? 'circle'}
/>
}
- />
+ >
+ <OverflowingTextWithTooltip text={relationRecord.name} />
+ </ListItem>
</SelectableListItem>
);
};
diff --git a/packages/twenty-front/src/modules/object-record/select/components/MultipleSelectDropdown.tsx b/packages/twenty-front/src/modules/object-record/select/components/MultipleSelectDropdown.tsx
index 4cd15f04603..588a0fe56a6 100644
--- a/packages/twenty-front/src/modules/object-record/select/components/MultipleSelectDropdown.tsx
+++ b/packages/twenty-front/src/modules/object-record/select/components/MultipleSelectDropdown.tsx
@@ -1,3 +1,4 @@
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { Key } from 'ts-key-enum';
import { type SelectableItem } from '@/object-record/select/types/SelectableItem';
@@ -13,10 +14,7 @@ import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/use
import { getAbsoluteImageUrl } from '~/utils/image/getAbsoluteImageUrl';
import { t } from '@lingui/core/macro';
import { Avatar } from 'twenty-ui/primitives/data-display';
-import {
- MenuItem,
- MenuItemMultiSelectAvatar,
-} from 'twenty-ui/primitives/navigation';
+import { MenuItem, ListItem } from 'twenty-ui/primitives/navigation';
export const MultipleSelectDropdown = ({
selectableListId,
@@ -90,7 +88,7 @@ export const MultipleSelectDropdown = ({
selectableItemIdArray={selectableItemIds}
focusId={focusId}
>
- <DropdownMenuItemsContainer hasMaxHeight>
+ <DropdownMenuItemsContainer isMultiSelect hasMaxHeight>
{itemsInDropdown?.map((item) => {
return (
<SelectableListItem
@@ -100,16 +98,18 @@ export const MultipleSelectDropdown = ({
handleItemSelectChange(item, !item.isSelected);
}}
>
- <MenuItemMultiSelectAvatar
+ <ListItem
key={item.id}
+ focused={item.id === selectedItemId}
+ role="option"
+ aria-selected={item.isSelected}
selected={item.isSelected}
- isKeySelected={item.id === selectedItemId}
- onSelectChange={(newCheckedValue) => {
+ indicator="checkbox"
+ onClick={() => {
resetSelectedItem();
- handleItemSelectChange(item, newCheckedValue);
+ handleItemSelectChange(item, !item.isSelected);
}}
- text={item.name}
- avatar={
+ startIcon={
<Avatar
src={getAbsoluteImageUrl(item.avatarUrl)}
colorSeed={item.id}
@@ -118,7 +118,9 @@ export const MultipleSelectDropdown = ({
shape={item.avatarShape}
/>
}
- />
+ >
+ <OverflowingTextWithTooltip text={item.name} />
+ </ListItem>
</SelectableListItem>
);
})}
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/timeline/components/WidgetActionTimelineFilter.tsx b/packages/twenty-front/src/modules/page-layout/widgets/timeline/components/WidgetActionTimelineFilter.tsx
index 918e4dd8e53..08fc4208399 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/timeline/components/WidgetActionTimelineFilter.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/timeline/components/WidgetActionTimelineFilter.tsx
@@ -1,3 +1,5 @@
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useTimelineActivityTypeFilter } from '@/activities/timeline-activities/hooks/useTimelineActivityTypeFilter';
import { timelineActivityTypeUniversalIdentifiersFilterFamilyState } from '@/activities/timeline-activities/states/timelineActivityTypeUniversalIdentifiersFilterFamilyState';
import { WidgetCardHeaderActionButton } from '@/page-layout/widgets/widget-card/components/WidgetCardHeaderActionButton';
@@ -13,7 +15,7 @@ import { useLingui } from '@lingui/react/macro';
import { useState } from 'react';
import { isDefined, isNonEmptyArray } from 'twenty-shared/utils';
import { IconFilter, IconFilterOff, useIcons } from 'twenty-ui/icon';
-import { MenuItem, MenuItemMultiSelect } from 'twenty-ui/primitives/navigation';
+import { MenuItem, ListItem } from 'twenty-ui/primitives/navigation';
import { normalizeSearchText } from '~/utils/normalizeSearchText';
export const WidgetActionTimelineFilter = () => {
@@ -83,27 +85,42 @@ export const WidgetActionTimelineFilter = () => {
onChange={(event) => setSearchInputValue(event.target.value)}
/>
<DropdownMenuSeparator />
- <DropdownMenuItemsContainer hasMaxHeight>
+ <DropdownMenuItemsContainer isMultiSelect hasMaxHeight>
{isNonEmptyArray(filteredTimelineActivityTypes) ? (
filteredTimelineActivityTypes.map((timelineActivityType) => (
- <MenuItemMultiSelect
+ <ListItem
+ render={<button type="button" />}
key={timelineActivityType.universalIdentifier}
- LeftIcon={
- isDefined(timelineActivityType.icon)
- ? getIcon(timelineActivityType.icon)
- : undefined
- }
- text={timelineActivityType.label}
+ role="option"
+ aria-selected={effectiveTimelineActivityTypeUniversalIdentifiersFilter.includes(
+ timelineActivityType.universalIdentifier,
+ )}
selected={effectiveTimelineActivityTypeUniversalIdentifiersFilter.includes(
timelineActivityType.universalIdentifier,
)}
- onSelectChange={(selected) =>
+ indicator="checkbox"
+ onClick={() =>
handleSelectChange(
timelineActivityType.universalIdentifier,
- selected,
+ !effectiveTimelineActivityTypeUniversalIdentifiersFilter.includes(
+ timelineActivityType.universalIdentifier,
+ ),
)
}
- />
+ startIcon={
+ <SelectOptionIcon
+ Icon={
+ isDefined(timelineActivityType.icon)
+ ? getIcon(timelineActivityType.icon)
+ : undefined
+ }
+ />
+ }
+ >
+ <OverflowingTextWithTooltip
+ text={timelineActivityType.label}
+ />
+ </ListItem>
))
) : (
<MenuItem disabled text={t`No results`} accent="placeholder" />
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/ConfigVariableDatabaseInput.tsx b/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/ConfigVariableDatabaseInput.tsx
index ed6f49dbae6..810ac89148e 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/ConfigVariableDatabaseInput.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/ConfigVariableDatabaseInput.tsx
@@ -1,3 +1,4 @@
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { Select } from '@/ui/input/components/Select';
import { SelectControl } from '@/ui/input/components/SelectControl';
import { TextArea } from '@/ui/input/components/TextArea';
@@ -10,7 +11,7 @@ import { t } from '@lingui/core/macro';
import { type ConfigVariableValue } from 'twenty-shared/types';
import { CustomError } from 'twenty-shared/utils';
import { CodeEditor } from 'twenty-ui/components/code-editor';
-import { MenuItemMultiSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { themeCssVariables } from 'twenty-ui/theme-constants';
import { ConfigVariableType } from '~/generated-admin/graphql';
import { type ConfigVariableOptions } from '@/settings/admin-panel/config-variables/types/ConfigVariableOptions';
@@ -136,17 +137,20 @@ export const ConfigVariableDatabaseInput = ({
}
dropdownComponents={
<DropdownContent>
- <DropdownMenuItemsContainer>
+ <DropdownMenuItemsContainer isMultiSelect>
{selectOptions.map((option) => (
- <MenuItemMultiSelect
+ <ListItem
+ render={<button type="button" />}
key={option.value}
- text={option.label}
- selected={isValueSelected(option.value)}
className="config-variable-array-menu-item-multi-select"
- onSelectChange={() =>
- handleMultiSelectChange(option.value)
- }
- />
+ role="option"
+ aria-selected={isValueSelected(option.value)}
+ selected={isValueSelected(option.value)}
+ indicator="checkbox"
+ onClick={() => handleMultiSelectChange(option.value)}
+ >
+ <OverflowingTextWithTooltip text={option.label} />
+ </ListItem>
))}
</DropdownMenuItemsContainer>
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/ConfigVariableOptionsDropdownContent.tsx b/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/ConfigVariableOptionsDropdownContent.tsx
index 3ec23abefcb..3b1b63959d1 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/ConfigVariableOptionsDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/ConfigVariableOptionsDropdownContent.tsx
@@ -1,3 +1,4 @@
+import { Tag } from 'twenty-ui/primitives/data-display';
import { isConfigVariablesInDbEnabledState } from '@/client-config/states/isConfigVariablesInDbEnabledState';
import { CONFIG_VARIABLE_SOURCE_OPTIONS } from '@/settings/admin-panel/config-variables/constants/ConfigVariableSourceOptions';
import { type ConfigVariableFilterCategory } from '@/settings/admin-panel/config-variables/types/ConfigVariableFilterCategory';
@@ -11,7 +12,7 @@ import { DropdownMenuSeparator } from '@/ui/layout/dropdown/components/DropdownM
import { t } from '@lingui/core/macro';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { IconChevronLeft, IconEye, IconEyeOff } from 'twenty-ui/icon';
-import { MenuItem, MenuItemSelectTag } from 'twenty-ui/primitives/navigation';
+import { MenuItem, ListItem } from 'twenty-ui/primitives/navigation';
import { useContext } from 'react';
import { ThemeContext } from 'twenty-ui/theme-constants';
type ConfigVariableOptionsDropdownContentProps = {
@@ -50,16 +51,32 @@ export const ConfigVariableOptionsDropdownContent = ({
return (
<DropdownContent>
<DropdownMenuItemsContainer>
- <MenuItemSelectTag
- text={t`Source`}
- color="transparent"
+ <ListItem
onClick={() => onSelectCategory('source')}
- />
- <MenuItemSelectTag
- text={t`Group`}
- color="transparent"
+ role="option"
+ aria-selected={false}
+ selected={false}
+ indicator="check"
+ >
+ <Tag
+ color={'transparent'}
+ borderStyle="dashed"
+ variant={'soft'}
+ >{t`Source`}</Tag>
+ </ListItem>
+ <ListItem
onClick={() => onSelectCategory('group')}
- />
+ role="option"
+ aria-selected={false}
+ selected={false}
+ indicator="check"
+ >
+ <Tag
+ color={'transparent'}
+ borderStyle="dashed"
+ variant={'soft'}
+ >{t`Group`}</Tag>
+ </ListItem>
</DropdownMenuItemsContainer>
<DropdownMenuSeparator />
<DropdownMenuItemsContainer scrollable={false}>
@@ -106,32 +123,46 @@ export const ConfigVariableOptionsDropdownContent = ({
{selectedCategory === 'source' && (
<>
{availableSourceOptions.map((option) => (
- <MenuItemSelectTag
+ <ListItem
key={option.value}
- text={option.label}
- color={option.color}
- selected={option.value === sourceFilter}
onClick={() => {
onSourceFilterChange(option.value);
onSelectCategory(null);
}}
- />
+ role="option"
+ aria-selected={option.value === sourceFilter}
+ selected={option.value === sourceFilter}
+ indicator="check"
+ >
+ <Tag color={option.color} borderStyle="dashed" variant={'soft'}>
+ {option.label}
+ </Tag>
+ </ListItem>
))}
</>
)}
{selectedCategory === 'group' && (
<>
{groupOptions.map((option) => (
- <MenuItemSelectTag
+ <ListItem
key={option.value}
- text={option.label}
- color="transparent"
- selected={option.value === groupFilter}
onClick={() => {
onGroupFilterChange(option.value);
onSelectCategory(null);
}}
- />
+ role="option"
+ aria-selected={option.value === groupFilter}
+ selected={option.value === groupFilter}
+ indicator="check"
+ >
+ <Tag
+ color={'transparent'}
+ borderStyle="dashed"
+ variant={'soft'}
+ >
+ {option.label}
+ </Tag>
+ </ListItem>
))}
</>
)}
diff --git a/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingLimitSpenderSelect.tsx b/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingLimitSpenderSelect.tsx
index ca8f97ae14a..0f5d395e689 100644
--- a/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingLimitSpenderSelect.tsx
+++ b/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingLimitSpenderSelect.tsx
@@ -1,12 +1,11 @@
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useLingui } from '@lingui/react/macro';
import { useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { Avatar } from 'twenty-ui/primitives/data-display';
import { IconChevronLeft } from 'twenty-ui/icon';
-import {
- MenuItemSelect,
- MenuItemSelectAvatar,
-} from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
import { SettingsBillingLimitNestedSelect } from '@/settings/billing/components/internal/SettingsBillingLimitNestedSelect';
@@ -150,11 +149,14 @@ export const SettingsBillingLimitSpenderSelect = ({
if (AVATAR_SPENDER_TYPES.includes(kind)) {
return (
- <MenuItemSelectAvatar
+ <ListItem
key={option.id}
- text={option.label}
+ onClick={() => handleSelect(kind, option.id)}
+ role="option"
+ aria-selected={selected}
selected={selected}
- avatar={
+ indicator="check"
+ startIcon={
<Avatar
name={option.label}
src={option.avatarUrl}
@@ -162,31 +164,52 @@ export const SettingsBillingLimitSpenderSelect = ({
size="md"
/>
}
- onClick={() => handleSelect(kind, option.id)}
- />
+ >
+ <OverflowingTextWithTooltip text={option.label} />
+ </ListItem>
);
}
return (
- <MenuItemSelect
+ <ListItem
key={option.id}
- LeftIcon={USAGE_LIMIT_SPENDER_TYPE_ICONS[kind]}
- text={option.label}
- selected={selected}
onClick={() => handleSelect(kind, option.id)}
- />
+ role="option"
+ aria-selected={selected}
+ selected={selected}
+ indicator="check"
+ startIcon={
+ <SelectOptionIcon Icon={USAGE_LIMIT_SPENDER_TYPE_ICONS[kind]} />
+ }
+ >
+ <OverflowingTextWithTooltip text={option.label} />
+ </ListItem>
);
};
const renderOptionList = (kind: UsageLimitSpenderType) => (
<>
- <MenuItemSelect
- text={t(USAGE_LIMIT_SPENDER_TYPE_POOL_LABELS[kind])}
- selected={spenderType === kind && spenderId === ''}
+ <ListItem
onClick={() => handleSelect(kind, '')}
- />
+ role="option"
+ aria-selected={spenderType === kind && spenderId === ''}
+ selected={spenderType === kind && spenderId === ''}
+ indicator="check"
+ >
+ <OverflowingTextWithTooltip
+ text={t(USAGE_LIMIT_SPENDER_TYPE_POOL_LABELS[kind])}
+ />
+ </ListItem>
{loading ? (
- <MenuItemSelect text={t`Loading…`} selected={false} disabled />
+ <ListItem
+ disabled
+ role="option"
+ aria-selected={false}
+ selected={false}
+ indicator="check"
+ >
+ <OverflowingTextWithTooltip text={t`Loading…`} />
+ </ListItem>
) : (
listedSpenderOptions.map((option) => renderOption(kind, option))
)}
@@ -224,11 +247,14 @@ export const SettingsBillingLimitSpenderSelect = ({
<DropdownContent>
{isDefined(workspaceGroup) && (
<DropdownMenuItemsContainer>
- <MenuItemSelectAvatar
- text={workspaceName}
- contextualText={t`Workspace`}
+ <ListItem
+ onClick={() => handleSelect('workspace', '')}
+ role="option"
+ aria-selected={spenderType === 'workspace'}
selected={spenderType === 'workspace'}
- avatar={
+ indicator="check"
+ description={t`Workspace`}
+ startIcon={
<Avatar
name={workspaceName}
src={workspaceAvatarUrl}
@@ -236,8 +262,9 @@ export const SettingsBillingLimitSpenderSelect = ({
size="md"
/>
}
- onClick={() => handleSelect('workspace', '')}
- />
+ >
+ <OverflowingTextWithTooltip text={workspaceName} />
+ </ListItem>
</DropdownMenuItemsContainer>
)}
{isDefined(workspaceGroup) && otherGroups.length > 0 && (
@@ -247,24 +274,32 @@ export const SettingsBillingLimitSpenderSelect = ({
<DropdownMenuItemsContainer>
{otherGroups.map((group) =>
isIntraWorkspaceLimitEntitled ? (
- <MenuItemSelect
+ <ListItem
key={group.id}
- LeftIcon={group.Icon}
- text={t(group.label)}
- selected={false}
- hasSubMenu
onClick={() => setBrowsedSpenderType(group.spenderType)}
- />
+ role="option"
+ aria-selected={false}
+ selected={false}
+ indicator="check"
+ hasSubmenu={true}
+ startIcon={<SelectOptionIcon Icon={group.Icon} />}
+ >
+ <OverflowingTextWithTooltip text={t(group.label)} />
+ </ListItem>
) : (
- <MenuItemSelect
+ <ListItem
key={group.id}
- LeftIcon={group.Icon}
- text={t(group.label)}
- selected={false}
disabled
- contextualText={t`Organization plan`}
- contextualTextPosition="right"
- />
+ role="option"
+ aria-selected={false}
+ selected={false}
+ indicator="check"
+ description={t`Organization plan`}
+ descriptionPlacement={'end'}
+ startIcon={<SelectOptionIcon Icon={group.Icon} />}
+ >
+ <OverflowingTextWithTooltip text={t(group.label)} />
+ </ListItem>
),
)}
</DropdownMenuItemsContainer>
diff --git a/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingLimitUsageSelect.tsx b/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingLimitUsageSelect.tsx
index 8f1b26f82e1..82ad2ceada5 100644
--- a/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingLimitUsageSelect.tsx
+++ b/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingLimitUsageSelect.tsx
@@ -1,8 +1,10 @@
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useLingui } from '@lingui/react/macro';
import { useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { IconChevronLeft } from 'twenty-ui/icon';
-import { MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { SettingsBillingLimitNestedSelect } from '@/settings/billing/components/internal/SettingsBillingLimitNestedSelect';
import { USAGE_LIMIT_OPERATION_TYPE_ICONS } from '@/settings/billing/constants/UsageLimitOperationTypeIcons';
@@ -97,16 +99,29 @@ export const SettingsBillingLimitUsageSelect = ({
<DropdownMenuItemsContainer>
{getUsageLimitOperationTypes(browsedDefinition).map(
(candidate) => (
- <MenuItemSelect
+ <ListItem
key={candidate}
- LeftIcon={USAGE_LIMIT_OPERATION_TYPE_ICONS[candidate]}
- text={t(USAGE_OPERATION_TYPE_LABELS[candidate])}
+ onClick={() => handleSelect(candidate)}
+ role="option"
+ aria-selected={
+ resourceType === browsedResourceType &&
+ operationType === candidate
+ }
selected={
resourceType === browsedResourceType &&
operationType === candidate
}
- onClick={() => handleSelect(candidate)}
- />
+ indicator="check"
+ startIcon={
+ <SelectOptionIcon
+ Icon={USAGE_LIMIT_OPERATION_TYPE_ICONS[candidate]}
+ />
+ }
+ >
+ <OverflowingTextWithTooltip
+ text={t(USAGE_OPERATION_TYPE_LABELS[candidate])}
+ />
+ </ListItem>
),
)}
</DropdownMenuItemsContainer>
@@ -115,20 +130,30 @@ export const SettingsBillingLimitUsageSelect = ({
<DropdownContent>
<DropdownMenuItemsContainer>
{definitions.definitions.map((definition) => (
- <MenuItemSelect
+ <ListItem
key={definition.resourceType}
- LeftIcon={
- USAGE_LIMIT_RESOURCE_TYPE_ICONS[definition.resourceType]
- }
- text={t(
- USAGE_LIMIT_RESOURCE_TYPE_LABELS[definition.resourceType],
- )}
- selected={false}
- hasSubMenu
onClick={() =>
setBrowsedResourceType(definition.resourceType)
}
- />
+ role="option"
+ aria-selected={false}
+ selected={false}
+ indicator="check"
+ hasSubmenu={true}
+ startIcon={
+ <SelectOptionIcon
+ Icon={
+ USAGE_LIMIT_RESOURCE_TYPE_ICONS[definition.resourceType]
+ }
+ />
+ }
+ >
+ <OverflowingTextWithTooltip
+ text={t(
+ USAGE_LIMIT_RESOURCE_TYPE_LABELS[definition.resourceType],
+ )}
+ />
+ </ListItem>
))}
</DropdownMenuItemsContainer>
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingLimitsFilterDropdown.tsx b/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingLimitsFilterDropdown.tsx
index eac2e81185b..15811e30f2b 100644
--- a/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingLimitsFilterDropdown.tsx
+++ b/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingLimitsFilterDropdown.tsx
@@ -1,3 +1,5 @@
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useLingui } from '@lingui/react/macro';
import { type ReactNode, useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
@@ -8,7 +10,7 @@ import {
IconTrash,
IconUsers,
} from 'twenty-ui/icon';
-import { MenuItem, MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { MenuItem, ListItem } from 'twenty-ui/primitives/navigation';
import { USAGE_LIMIT_RESOURCE_TYPE_ICONS } from '@/settings/billing/constants/UsageLimitResourceTypeIcons';
import { USAGE_LIMIT_RESOURCE_TYPE_LABELS } from '@/settings/billing/constants/UsageLimitResourceTypeLabels';
@@ -82,20 +84,34 @@ export const SettingsBillingLimitsFilterDropdown = ({
<DropdownContent>
{renderBackHeader(t`Usage`)}
<DropdownMenuItemsContainer>
- <MenuItemSelect
- LeftIcon={IconList}
- text={t`All`}
- selected={!isDefined(selectedResourceType)}
+ <ListItem
onClick={() => onSelectResourceType(null)}
- />
+ role="option"
+ aria-selected={!isDefined(selectedResourceType)}
+ selected={!isDefined(selectedResourceType)}
+ indicator="check"
+ startIcon={<SelectOptionIcon Icon={IconList} />}
+ >
+ <OverflowingTextWithTooltip text={t`All`} />
+ </ListItem>
{resourceTypes.map((resourceType) => (
- <MenuItemSelect
+ <ListItem
key={resourceType}
- LeftIcon={USAGE_LIMIT_RESOURCE_TYPE_ICONS[resourceType]}
- text={t(USAGE_LIMIT_RESOURCE_TYPE_LABELS[resourceType])}
- selected={selectedResourceType === resourceType}
onClick={() => onSelectResourceType(resourceType)}
- />
+ role="option"
+ aria-selected={selectedResourceType === resourceType}
+ selected={selectedResourceType === resourceType}
+ indicator="check"
+ startIcon={
+ <SelectOptionIcon
+ Icon={USAGE_LIMIT_RESOURCE_TYPE_ICONS[resourceType]}
+ />
+ }
+ >
+ <OverflowingTextWithTooltip
+ text={t(USAGE_LIMIT_RESOURCE_TYPE_LABELS[resourceType])}
+ />
+ </ListItem>
))}
</DropdownMenuItemsContainer>
</DropdownContent>
@@ -105,24 +121,38 @@ export const SettingsBillingLimitsFilterDropdown = ({
<DropdownContent>
{renderBackHeader(t`Spender`)}
<DropdownMenuItemsContainer>
- <MenuItemSelect
- LeftIcon={IconList}
- text={t`All`}
- selected={!isDefined(selectedSpenderType)}
+ <ListItem
onClick={() => onSelectSpenderType(null)}
- />
+ role="option"
+ aria-selected={!isDefined(selectedSpenderType)}
+ selected={!isDefined(selectedSpenderType)}
+ indicator="check"
+ startIcon={<SelectOptionIcon Icon={IconList} />}
+ >
+ <OverflowingTextWithTooltip text={t`All`} />
+ </ListItem>
{spenderTypes.map((spenderType) => (
- <MenuItemSelect
+ <ListItem
key={spenderType}
- LeftIcon={
- isKeyOfRecord(USAGE_LIMIT_SPENDER_TYPE_ICONS, spenderType)
- ? USAGE_LIMIT_SPENDER_TYPE_ICONS[spenderType]
- : undefined
- }
- text={getSpenderTypeLabel(spenderType)}
- selected={selectedSpenderType === spenderType}
onClick={() => onSelectSpenderType(spenderType)}
- />
+ role="option"
+ aria-selected={selectedSpenderType === spenderType}
+ selected={selectedSpenderType === spenderType}
+ indicator="check"
+ startIcon={
+ <SelectOptionIcon
+ Icon={
+ isKeyOfRecord(USAGE_LIMIT_SPENDER_TYPE_ICONS, spenderType)
+ ? USAGE_LIMIT_SPENDER_TYPE_ICONS[spenderType]
+ : undefined
+ }
+ />
+ }
+ >
+ <OverflowingTextWithTooltip
+ text={getSpenderTypeLabel(spenderType)}
+ />
+ </ListItem>
))}
</DropdownMenuItemsContainer>
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/settings/components/SettingsMorphRelationMultiSelect.tsx b/packages/twenty-front/src/modules/settings/components/SettingsMorphRelationMultiSelect.tsx
index a2104626be9..fe93bde7667 100644
--- a/packages/twenty-front/src/modules/settings/components/SettingsMorphRelationMultiSelect.tsx
+++ b/packages/twenty-front/src/modules/settings/components/SettingsMorphRelationMultiSelect.tsx
@@ -1,3 +1,5 @@
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { styled } from '@linaria/react';
import { plural, t } from '@lingui/core/macro';
import { Fragment, useMemo, useRef, useState, type MouseEvent } from 'react';
@@ -25,7 +27,7 @@ import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/use
import { isNonEmptyString } from '@sniptt/guards';
import { isDefined } from 'twenty-shared/utils';
import { IconBox, type IconComponent } from 'twenty-ui/icon';
-import { MenuItem, MenuItemMultiSelect } from 'twenty-ui/primitives/navigation';
+import { MenuItem, ListItem } from 'twenty-ui/primitives/navigation';
import { themeCssVariables } from 'twenty-ui/theme-constants';
export type SelectSizeVariant = 'small' | 'default';
@@ -244,7 +246,7 @@ export const SettingsMorphRelationMultiSelect = ({
<DropdownMenuSeparator />
)}
{!!filteredOptions.length && (
- <DropdownMenuItemsContainer hasMaxHeight>
+ <DropdownMenuItemsContainer isMultiSelect hasMaxHeight>
<SelectableList
selectableListInstanceId={dropdownId}
focusId={dropdownId}
@@ -274,20 +276,22 @@ export const SettingsMorphRelationMultiSelect = ({
closeDropdown(dropdownId);
}}
>
- <MenuItemMultiSelect
+ <ListItem
className=""
- LeftIcon={option.Icon ?? undefined}
- iconThemeColor={option.iconThemeColor}
- text={option.label}
+ focused={selectedItemId === option.objectMetadataId}
+ role="option"
+ aria-selected={selectedObjectMetadataIds.some(
+ (selectedObjectMetadataId) =>
+ selectedObjectMetadataId ===
+ option.objectMetadataId,
+ )}
selected={selectedObjectMetadataIds.some(
(selectedObjectMetadataId) =>
selectedObjectMetadataId ===
option.objectMetadataId,
)}
- isKeySelected={
- selectedItemId === option.objectMetadataId
- }
- onSelectChange={() => {
+ indicator="checkbox"
+ onClick={() => {
const newSelectedObjectMetadataIds =
addOrRemoveFromArray(
localSelectedObjectMetadataIds,
@@ -299,7 +303,15 @@ export const SettingsMorphRelationMultiSelect = ({
onChange?.(newSelectedObjectMetadataIds);
onBlur?.();
}}
- />
+ startIcon={
+ <SelectOptionIcon
+ Icon={option.Icon ?? undefined}
+ color={option.iconThemeColor}
+ />
+ }
+ >
+ <OverflowingTextWithTooltip text={option.label} />
+ </ListItem>
</SelectableListItem>
</Fragment>
))}
diff --git a/packages/twenty-front/src/modules/settings/data-model/fields/forms/address/components/MultiSelectAddressFields.tsx b/packages/twenty-front/src/modules/settings/data-model/fields/forms/address/components/MultiSelectAddressFields.tsx
index 2f34e92f42e..8e79053eabc 100644
--- a/packages/twenty-front/src/modules/settings/data-model/fields/forms/address/components/MultiSelectAddressFields.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/fields/forms/address/components/MultiSelectAddressFields.tsx
@@ -1,3 +1,4 @@
+import { Tag } from 'twenty-ui/primitives/data-display';
import { type SelectValue } from '@/ui/input/components/internal/select/types';
import { type SelectSizeVariant } from '@/ui/input/components/Select';
import { SelectControl } from '@/ui/input/components/SelectControl';
@@ -13,10 +14,7 @@ import { t } from '@lingui/core/macro';
import { type MouseEvent, useMemo, useState } from 'react';
import { type IconComponent } from 'twenty-ui/icon';
import { type SelectOption } from 'twenty-ui/primitives/input';
-import {
- MenuItem,
- MenuItemMultiSelectTag,
-} from 'twenty-ui/primitives/navigation';
+import { MenuItem, ListItem } from 'twenty-ui/primitives/navigation';
type CallToActionButton = {
text: string;
@@ -96,7 +94,7 @@ export const MultiSelectAddressFields = <Value extends SelectValue>({
autoFocus
/>
<DropdownMenuSeparator />
- <DropdownMenuItemsContainer hasMaxHeight>
+ <DropdownMenuItemsContainer isMultiSelect hasMaxHeight>
{filteredOptions?.map((option) => {
return (
<SelectableListItem
@@ -106,15 +104,18 @@ export const MultiSelectAddressFields = <Value extends SelectValue>({
onChange?.(onOptionSelected(option.value, values));
}}
>
- <MenuItemMultiSelectTag
+ <ListItem
key={`${option.value}`}
- selected={values?.includes(option?.value) || false}
- text={option.label}
- color="transparent"
onClick={() =>
onChange?.(onOptionSelected(option.value, values))
}
- />
+ role="option"
+ aria-selected={values?.includes(option?.value) || false}
+ selected={values?.includes(option?.value) || false}
+ indicator="checkbox"
+ >
+ <Tag color={'transparent'}>{option.label}</Tag>
+ </ListItem>
</SelectableListItem>
);
})}
diff --git a/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectFormOptionRow.tsx b/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectFormOptionRow.tsx
index 68fe0ada87c..c991e6bc8a7 100644
--- a/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectFormOptionRow.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectFormOptionRow.tsx
@@ -1,3 +1,4 @@
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { type FieldMetadataItemOption } from '@/object-metadata/types/FieldMetadataItem';
import { AdvancedSettingsWrapper } from '@/settings/components/AdvancedSettingsWrapper';
import { OPTION_VALUE_MAXIMUM_LENGTH } from '@/settings/data-model/constants/OptionValueMaximumLength';
@@ -21,7 +22,7 @@ import { LightIconButton } from 'twenty-ui/components';
import {
type ColorLabels,
MenuItem,
- MenuItemSelectColor,
+ ListItem,
} from 'twenty-ui/primitives/navigation';
import { computeOptionValueFromLabel } from '~/pages/settings/data-model/utils/computeOptionValueFromLabel';
import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants';
@@ -172,16 +173,20 @@ export const SettingsDataModelFieldSelectFormOptionRow = ({
<DropdownContent>
<DropdownMenuItemsContainer>
{MAIN_COLOR_NAMES.map((colorName) => (
- <MenuItemSelectColor
+ <ListItem
key={colorName}
onClick={() => {
onChange({ ...option, color: colorName });
closeColorDropdown(SELECT_COLOR_DROPDOWN_ID);
}}
- color={colorName}
+ role="option"
+ aria-selected={colorName === option.color}
selected={colorName === option.color}
- colorLabels={colorLabels}
- />
+ indicator="check"
+ startIcon={<ColorSample colorName={colorName} />}
+ >
+ <OverflowingTextWithTooltip text={colorLabels[colorName]} />
+ </ListItem>
))}
</DropdownMenuItemsContainer>
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/settings/developers/components/WebhookEntitySelect.tsx b/packages/twenty-front/src/modules/settings/developers/components/WebhookEntitySelect.tsx
index 914a3f2529d..a6e3745b487 100644
--- a/packages/twenty-front/src/modules/settings/developers/components/WebhookEntitySelect.tsx
+++ b/packages/twenty-front/src/modules/settings/developers/components/WebhookEntitySelect.tsx
@@ -1,3 +1,5 @@
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
import { useObjectMetadataSelectHelpers } from '@/object-metadata/hooks/useObjectMetadataSelectHelpers';
import { SelectControl } from '@/ui/input/components/SelectControl';
@@ -25,7 +27,7 @@ import {
IconWebhook,
} from 'twenty-ui/icon';
import { type SelectOption } from 'twenty-ui/primitives/input';
-import { MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
const WEBHOOK_ENTITY_DROPDOWN_ID = 'webhook-entity-select';
@@ -145,14 +147,22 @@ export const WebhookEntitySelect = ({
itemId={option.value}
onEnter={() => handleSelect(option.value)}
>
- <MenuItemSelect
- LeftIcon={option.Icon}
- leftIconColor={option.iconThemeColor}
- text={option.label}
- selected={value === option.value}
+ <ListItem
focused={selectedItemId === option.value}
onClick={() => handleSelect(option.value)}
- />
+ role="option"
+ aria-selected={value === option.value}
+ selected={value === option.value}
+ indicator="check"
+ startIcon={
+ <SelectOptionIcon
+ Icon={option.Icon}
+ color={option.iconThemeColor}
+ />
+ }
+ >
+ <OverflowingTextWithTooltip text={option.label} />
+ </ListItem>
</SelectableListItem>
))}
</>
@@ -167,13 +177,17 @@ export const WebhookEntitySelect = ({
itemId={option.value}
onEnter={() => handleSelect(option.value)}
>
- <MenuItemSelect
- LeftIcon={option.Icon}
- text={option.label}
- selected={value === option.value}
+ <ListItem
focused={selectedItemId === option.value}
onClick={() => handleSelect(option.value)}
- />
+ role="option"
+ aria-selected={value === option.value}
+ selected={value === option.value}
+ indicator="check"
+ startIcon={<SelectOptionIcon Icon={option.Icon} />}
+ >
+ <OverflowingTextWithTooltip text={option.label} />
+ </ListItem>
</SelectableListItem>
))}
</>
diff --git a/packages/twenty-front/src/modules/settings/security/components/SettingsSecurityEditableProfileFields.tsx b/packages/twenty-front/src/modules/settings/security/components/SettingsSecurityEditableProfileFields.tsx
index ae5b12cdab9..08c545d347a 100644
--- a/packages/twenty-front/src/modules/settings/security/components/SettingsSecurityEditableProfileFields.tsx
+++ b/packages/twenty-front/src/modules/settings/security/components/SettingsSecurityEditableProfileFields.tsx
@@ -1,3 +1,5 @@
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
import { getToastOptionsFromError } from '@/error-handler/utils/getToastOptionsFromError';
import { EDITABLE_PROFILE_FIELDS_DROPDOWN_ID } from '@/settings/security/constants/EditableProfileFields.constants';
@@ -19,7 +21,7 @@ import {
type IconComponent,
} from 'twenty-ui/icon';
import { type SelectOption } from 'twenty-ui/primitives/input';
-import { MenuItemMultiSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { themeCssVariables } from 'twenty-ui/theme-constants';
import { UpdateWorkspaceDocument } from '~/generated-metadata/graphql';
@@ -127,16 +129,21 @@ export const SettingsSecurityEditableProfileFields = () => {
}
dropdownComponents={
<DropdownContent>
- <DropdownMenuItemsContainer>
+ <DropdownMenuItemsContainer isMultiSelect>
{profileFieldOptions.map((option) => (
- <MenuItemMultiSelect
+ <ListItem
+ render={<button type="button" />}
key={option.value}
- text={option.label}
- LeftIcon={option.Icon}
- selected={selectedFields.includes(option.value)}
className="settings-security-editable-profile-fields-menu-item"
- onSelectChange={() => toggleField(option.value)}
- />
+ role="option"
+ aria-selected={selectedFields.includes(option.value)}
+ selected={selectedFields.includes(option.value)}
+ indicator="checkbox"
+ onClick={() => toggleField(option.value)}
+ startIcon={<SelectOptionIcon Icon={option.Icon} />}
+ >
+ <OverflowingTextWithTooltip text={option.label} />
+ </ListItem>
))}
</DropdownMenuItemsContainer>
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/settings/unsubscribers/components/filter-dropdown/SettingsUnsubscribersFilterOptionsContent.tsx b/packages/twenty-front/src/modules/settings/unsubscribers/components/filter-dropdown/SettingsUnsubscribersFilterOptionsContent.tsx
index b4617136ff0..08bc26ac72a 100644
--- a/packages/twenty-front/src/modules/settings/unsubscribers/components/filter-dropdown/SettingsUnsubscribersFilterOptionsContent.tsx
+++ b/packages/twenty-front/src/modules/settings/unsubscribers/components/filter-dropdown/SettingsUnsubscribersFilterOptionsContent.tsx
@@ -1,5 +1,6 @@
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { IconChevronLeft } from 'twenty-ui/icon';
-import { MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { type SettingsUnsubscribersFilterOption } from '@/settings/unsubscribers/components/filter-dropdown/types/SettingsUnsubscribersFilterOption';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
@@ -44,12 +45,16 @@ export const SettingsUnsubscribersFilterOptionsContent = ({
</DropdownMenuHeader>
<DropdownMenuItemsContainer>
{options.map((option) => (
- <MenuItemSelect
+ <ListItem
key={option.value}
- text={option.label}
- selected={selectedValue === option.value}
onClick={() => handleSelect(option.value)}
- />
+ role="option"
+ aria-selected={selectedValue === option.value}
+ selected={selectedValue === option.value}
+ indicator="check"
+ >
+ <OverflowingTextWithTooltip text={option.label} />
+ </ListItem>
))}
</DropdownMenuItemsContainer>
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/side-panel/components/SidePanelObjectFilterDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/components/SidePanelObjectFilterDropdownContent.tsx
index bcb3a4f79a8..09a83820ee9 100644
--- a/packages/twenty-front/src/modules/side-panel/components/SidePanelObjectFilterDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/components/SidePanelObjectFilterDropdownContent.tsx
@@ -1,10 +1,12 @@
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useLingui } from '@lingui/react/macro';
import { useState } from 'react';
import { OBJECTS_WITH_CHANNEL_VISIBILITY_CONSTRAINTS } from 'twenty-shared/constants';
import { SettingsRow } from 'twenty-ui/components';
import { TintedIconTile } from 'twenty-ui/primitives/data-display';
import { IconCube } from 'twenty-ui/icon';
-import { MenuItemSelectAvatar } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
+
import { ObjectMetadataIcon } from '@/object-metadata/components/ObjectMetadataIcon';
import { useReadableObjectMetadataItems } from '@/object-metadata/hooks/useReadableObjectMetadataItems';
import { OBJECT_FILTER_DROPDOWN_ID } from '@/side-panel/components/SidePanelObjectFilterDropdown';
@@ -91,13 +93,17 @@ export const SidePanelObjectFilterDropdownContent = ({
itemId={ALL_OBJECTS_ITEM_ID}
onEnter={() => handleSelect(null)}
>
- <MenuItemSelectAvatar
- avatar={<TintedIconTile Icon={IconCube} />}
- text={t`All objects`}
- selected={selectedObjectNameSingular === null}
+ <ListItem
onClick={() => handleSelect(null)}
focused={selectedItemId === ALL_OBJECTS_ITEM_ID}
- />
+ role="option"
+ aria-selected={selectedObjectNameSingular === null}
+ selected={selectedObjectNameSingular === null}
+ indicator="check"
+ startIcon={<TintedIconTile Icon={IconCube} />}
+ >
+ <OverflowingTextWithTooltip text={t`All objects`} />
+ </ListItem>
</SelectableListItem>
{displayedObjects.map((objectMetadataItem) => {
return (
@@ -106,20 +112,29 @@ export const SidePanelObjectFilterDropdownContent = ({
itemId={objectMetadataItem.nameSingular}
onEnter={() => handleSelect(objectMetadataItem.nameSingular)}
>
- <MenuItemSelectAvatar
- avatar={
- <ObjectMetadataIcon
- objectMetadataItem={objectMetadataItem}
- />
+ <ListItem
+ onClick={() => handleSelect(objectMetadataItem.nameSingular)}
+ focused={selectedItemId === objectMetadataItem.nameSingular}
+ role="option"
+ aria-selected={
+ selectedObjectNameSingular ===
+ objectMetadataItem.nameSingular
}
- text={objectMetadataItem.labelPlural}
selected={
selectedObjectNameSingular ===
objectMetadataItem.nameSingular
}
- onClick={() => handleSelect(objectMetadataItem.nameSingular)}
- focused={selectedItemId === objectMetadataItem.nameSingular}
- />
+ indicator="check"
+ startIcon={
+ <ObjectMetadataIcon
+ objectMetadataItem={objectMetadataItem}
+ />
+ }
+ >
+ <OverflowingTextWithTooltip
+ text={objectMetadataItem.labelPlural}
+ />
+ </ListItem>
</SelectableListItem>
);
})}
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartAggregateOperationSelectableListItem.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartAggregateOperationSelectableListItem.tsx
index b41b0003c4c..3764c3c1003 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartAggregateOperationSelectableListItem.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartAggregateOperationSelectableListItem.tsx
@@ -1,3 +1,4 @@
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { usePageLayoutIdFromContextStore } from '@/side-panel/pages/page-layout/hooks/usePageLayoutIdFromContextStore';
import { useUpdateCurrentWidgetConfig } from '@/side-panel/pages/page-layout/hooks/useUpdateCurrentWidgetConfig';
import { useWidgetInEditMode } from '@/side-panel/pages/page-layout/hooks/useWidgetInEditMode';
@@ -13,7 +14,7 @@ import { selectedItemIdComponentState } from '@/ui/layout/selectable-list/states
import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { isDefined } from 'twenty-shared/utils';
-import { MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
const isExtendedAggregateOperation = (
operation: AggregateChartOperation,
@@ -81,12 +82,16 @@ export const ChartAggregateOperationSelectableListItem = ({
return (
<SelectableListItem itemId={operation} onEnter={handleClick}>
- <MenuItemSelect
- text={label}
- selected={isSelected}
+ <ListItem
focused={isFocused}
onClick={handleClick}
- />
+ role="option"
+ aria-selected={isSelected}
+ selected={isSelected}
+ indicator="check"
+ >
+ <OverflowingTextWithTooltip text={label} />
+ </ListItem>
</SelectableListItem>
);
};
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartAxisNameSelectionDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartAxisNameSelectionDropdownContent.tsx
index cd7a5033ae9..cfd258d8c36 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartAxisNameSelectionDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartAxisNameSelectionDropdownContent.tsx
@@ -1,3 +1,4 @@
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { usePageLayoutIdFromContextStore } from '@/side-panel/pages/page-layout/hooks/usePageLayoutIdFromContextStore';
import { useUpdateCurrentWidgetConfig } from '@/side-panel/pages/page-layout/hooks/useUpdateCurrentWidgetConfig';
import { useWidgetInEditMode } from '@/side-panel/pages/page-layout/hooks/useWidgetInEditMode';
@@ -11,7 +12,7 @@ import { SelectableListItem } from '@/ui/layout/selectable-list/components/Selec
import { selectedItemIdComponentState } from '@/ui/layout/selectable-list/states/selectedItemIdComponentState';
import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
-import { MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { AxisNameDisplay } from '~/generated-metadata/graphql';
export const ChartAxisNameSelectionDropdownContent = () => {
@@ -76,14 +77,20 @@ export const ChartAxisNameSelectionDropdownContent = () => {
handleSelectAxisNameOption(option);
}}
>
- <MenuItemSelect
- text={getChartAxisNameDisplayOptions(option)}
- selected={currentAxisNameDisplay?.toUpperCase() === option}
+ <ListItem
focused={selectedItemId === option}
onClick={() => {
handleSelectAxisNameOption(option);
}}
- />
+ role="option"
+ aria-selected={currentAxisNameDisplay?.toUpperCase() === option}
+ selected={currentAxisNameDisplay?.toUpperCase() === option}
+ indicator="check"
+ >
+ <OverflowingTextWithTooltip
+ text={getChartAxisNameDisplayOptions(option)}
+ />
+ </ListItem>
</SelectableListItem>
))}
</SelectableList>
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartColorGradientOption.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartColorGradientOption.tsx
index 8b928801082..21757d7d586 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartColorGradientOption.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartColorGradientOption.tsx
@@ -1,3 +1,4 @@
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { CHART_SETTINGS_PALETTE_COLOR_GROUP_COUNT } from '@/side-panel/pages/page-layout/constants/ChartSettingsPaletteColorGroupCount';
import { createGraphColorRegistry } from '@/page-layout/widgets/graph/utils/createGraphColorRegistry';
import { generateGroupColor } from '@/page-layout/widgets/graph/utils/generateGroupColor';
@@ -5,7 +6,7 @@ import { SelectableListItem } from '@/ui/layout/selectable-list/components/Selec
import { styled } from '@linaria/react';
import { useContext } from 'react';
import { ColorSample } from 'twenty-ui/primitives/data-display';
-import { MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants';
import { type ThemeColor } from 'twenty-ui/theme';
type ChartColorGradientOptionProps = {
@@ -64,18 +65,22 @@ export const ChartColorGradientOption = ({
onSelectColor(colorOption.colorName);
}}
>
- <MenuItemSelect
- text={colorOption.name}
- selected={false}
+ <ListItem
focused={
selectedItemId === colorOption.id || currentColor === colorOption.id
}
- contextualText={colorSamples}
- contextualTextPosition="right"
onClick={() => {
onSelectColor(colorOption.colorName);
}}
- />
+ role="option"
+ aria-selected={false}
+ selected={false}
+ indicator="check"
+ description={colorSamples}
+ descriptionPlacement={'end'}
+ >
+ <OverflowingTextWithTooltip text={colorOption.name} />
+ </ListItem>
</SelectableListItem>
);
};
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartColorPaletteOption.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartColorPaletteOption.tsx
index 2083f3c38fe..d7d8fcab9c4 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartColorPaletteOption.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartColorPaletteOption.tsx
@@ -1,3 +1,4 @@
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { CHART_SETTINGS_PALETTE_COLOR_GROUP_COUNT } from '@/side-panel/pages/page-layout/constants/ChartSettingsPaletteColorGroupCount';
import { createGraphColorRegistry } from '@/page-layout/widgets/graph/utils/createGraphColorRegistry';
import { getColorSchemeByIndex } from '@/page-layout/widgets/graph/utils/getColorSchemeByIndex';
@@ -6,7 +7,7 @@ import { styled } from '@linaria/react';
import { t } from '@lingui/core/macro';
import { useContext } from 'react';
import { ColorSample } from 'twenty-ui/primitives/data-display';
-import { MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { getMainColorNameFromPaletteColorName } from 'twenty-ui/utilities';
import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants';
import { type ThemeColor } from 'twenty-ui/theme';
@@ -64,16 +65,20 @@ export const ChartColorPaletteOption = ({
onSelectColor('auto');
}}
>
- <MenuItemSelect
- text={t`Default palette`}
- selected={false}
+ <ListItem
focused={selectedItemId === 'auto' || currentColor === 'auto'}
- contextualText={colorSamples}
- contextualTextPosition="right"
onClick={() => {
onSelectColor('auto');
}}
- />
+ role="option"
+ aria-selected={false}
+ selected={false}
+ indicator="check"
+ description={colorSamples}
+ descriptionPlacement={'end'}
+ >
+ <OverflowingTextWithTooltip text={t`Default palette`} />
+ </ListItem>
</SelectableListItem>
);
};
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartDataSourceDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartDataSourceDropdownContent.tsx
index fd3f5058b9d..cc2e57913d8 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartDataSourceDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartDataSourceDropdownContent.tsx
@@ -1,3 +1,5 @@
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { ObjectMetadataIcon } from '@/object-metadata/components/ObjectMetadataIcon';
import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
import { filterReadableActiveObjectMetadataItems } from '@/object-metadata/utils/filterReadableActiveObjectMetadataItems';
@@ -22,7 +24,7 @@ import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/use
import { t } from '@lingui/core/macro';
import { useMemo, useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
-import { MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { filterBySearchQuery } from '~/utils/filterBySearchQuery';
export const ChartDataSourceDropdownContent = () => {
@@ -129,17 +131,31 @@ export const ChartDataSourceDropdownContent = () => {
handleSelectSource(objectMetadataItem.id);
}}
>
- <MenuItemSelect
- text={objectMetadataItem.labelPlural}
- selected={currentObjectMetadataItemId === objectMetadataItem.id}
+ <ListItem
focused={selectedItemId === objectMetadataItem.id}
- LeftIcon={() => (
- <ObjectMetadataIcon objectMetadataItem={objectMetadataItem} />
- )}
onClick={() => {
handleSelectSource(objectMetadataItem.id);
}}
- />
+ role="option"
+ aria-selected={
+ currentObjectMetadataItemId === objectMetadataItem.id
+ }
+ selected={currentObjectMetadataItemId === objectMetadataItem.id}
+ indicator="check"
+ startIcon={
+ <SelectOptionIcon
+ Icon={() => (
+ <ObjectMetadataIcon
+ objectMetadataItem={objectMetadataItem}
+ />
+ )}
+ />
+ }
+ >
+ <OverflowingTextWithTooltip
+ text={objectMetadataItem.labelPlural}
+ />
+ </ListItem>
</SelectableListItem>
))}
</SelectableList>
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartDateGranularitySelectionDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartDateGranularitySelectionDropdownContent.tsx
index 14fdfc2dcbb..4c244ed7d05 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartDateGranularitySelectionDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartDateGranularitySelectionDropdownContent.tsx
@@ -1,3 +1,4 @@
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { usePageLayoutIdFromContextStore } from '@/side-panel/pages/page-layout/hooks/usePageLayoutIdFromContextStore';
import { useUpdateCurrentWidgetConfig } from '@/side-panel/pages/page-layout/hooks/useUpdateCurrentWidgetConfig';
import { useWidgetInEditMode } from '@/side-panel/pages/page-layout/hooks/useWidgetInEditMode';
@@ -15,7 +16,7 @@ import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/com
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { ObjectRecordGroupByDateGranularity } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
-import { MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import {
type FieldsConfiguration,
type WidgetConfiguration,
@@ -160,14 +161,20 @@ export const ChartDateGranularitySelectionDropdownContent = ({
handleSelectDateGranularityOption(option);
}}
>
- <MenuItemSelect
- text={getDateGranularityLabel(option)}
- selected={currentDateGranularity === option}
+ <ListItem
focused={selectedItemId === option}
onClick={() => {
handleSelectDateGranularityOption(option);
}}
- />
+ role="option"
+ aria-selected={currentDateGranularity === option}
+ selected={currentDateGranularity === option}
+ indicator="check"
+ >
+ <OverflowingTextWithTooltip
+ text={getDateGranularityLabel(option)}
+ />
+ </ListItem>
</SelectableListItem>
))}
</SelectableList>
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartFieldSelectionForAggregateOperationDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartFieldSelectionForAggregateOperationDropdownContent.tsx
index b47845b86fa..defbf6ef3d2 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartFieldSelectionForAggregateOperationDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartFieldSelectionForAggregateOperationDropdownContent.tsx
@@ -1,3 +1,5 @@
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { ChartAggregateOperationSelectionDropdownContent } from '@/side-panel/pages/page-layout/components/dropdown-content/ChartAggregateOperationSelectionDropdownContent';
import { usePageLayoutIdFromContextStore } from '@/side-panel/pages/page-layout/hooks/usePageLayoutIdFromContextStore';
import { useWidgetInEditMode } from '@/side-panel/pages/page-layout/hooks/useWidgetInEditMode';
@@ -17,7 +19,7 @@ import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/use
import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { useIcons } from 'twenty-ui/icon';
-import { MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { filterBySearchQuery } from '~/utils/filterBySearchQuery';
export const ChartFieldSelectionForAggregateOperationDropdownContent = () => {
@@ -110,17 +112,23 @@ export const ChartFieldSelectionForAggregateOperationDropdownContent = () => {
setSelectedFieldMetadataId(fieldMetadataItem.id);
}}
>
- <MenuItemSelect
- text={fieldMetadataItem.label}
- selected={selectedFieldMetadataId === fieldMetadataItem.id}
+ <ListItem
focused={selectedItemId === fieldMetadataItem.id}
- LeftIcon={getIcon(fieldMetadataItem.icon)}
- hasSubMenu={true}
onClick={() => {
setIsSubMenuOpen(true);
setSelectedFieldMetadataId(fieldMetadataItem.id);
}}
- />
+ role="option"
+ aria-selected={selectedFieldMetadataId === fieldMetadataItem.id}
+ selected={selectedFieldMetadataId === fieldMetadataItem.id}
+ indicator="check"
+ hasSubmenu={true}
+ startIcon={
+ <SelectOptionIcon Icon={getIcon(fieldMetadataItem.icon)} />
+ }
+ >
+ <OverflowingTextWithTooltip text={fieldMetadataItem.label} />
+ </ListItem>
</SelectableListItem>
))}
</SelectableList>
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionCompositeFieldView.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionCompositeFieldView.tsx
index 0d105d2cff4..92b66e8e614 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionCompositeFieldView.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionCompositeFieldView.tsx
@@ -1,3 +1,5 @@
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
import { getCompositeSubFieldLabel } from '@/object-record/object-filter-dropdown/utils/getCompositeSubFieldLabel';
import { ICON_NAME_BY_SUB_FIELD } from '@/object-record/record-filter/constants/IconNameBySubField';
@@ -13,7 +15,7 @@ import { selectedItemIdComponentState } from '@/ui/layout/selectable-list/states
import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { IconChevronLeft, useIcons } from 'twenty-ui/icon';
-import { MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
type ChartGroupByFieldSelectionCompositeFieldViewProps = {
compositeField: FieldMetadataItem;
@@ -71,20 +73,31 @@ export const ChartGroupByFieldSelectionCompositeFieldView = ({
onSelectSubField(subFieldName);
}}
>
- <MenuItemSelect
- text={getCompositeSubFieldLabel(
- compositeFieldType,
- subFieldName,
- )}
- selected={currentSubFieldName === subFieldName}
+ <ListItem
focused={selectedItemId === subFieldName}
onClick={() => {
onSelectSubField(subFieldName);
}}
- LeftIcon={getIcon(
- ICON_NAME_BY_SUB_FIELD[subFieldName] ?? compositeField.icon,
- )}
- />
+ role="option"
+ aria-selected={currentSubFieldName === subFieldName}
+ selected={currentSubFieldName === subFieldName}
+ indicator="check"
+ startIcon={
+ <SelectOptionIcon
+ Icon={getIcon(
+ ICON_NAME_BY_SUB_FIELD[subFieldName] ??
+ compositeField.icon,
+ )}
+ />
+ }
+ >
+ <OverflowingTextWithTooltip
+ text={getCompositeSubFieldLabel(
+ compositeFieldType,
+ subFieldName,
+ )}
+ />
+ </ListItem>
</SelectableListItem>
))}
</SelectableList>
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionDropdownContentBase.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionDropdownContentBase.tsx
index ecb5f61ac77..563cf6fa48f 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionDropdownContentBase.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionDropdownContentBase.tsx
@@ -1,3 +1,5 @@
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
import { isHiddenSystemField } from '@/object-metadata/utils/isHiddenSystemField';
@@ -29,7 +31,7 @@ import {
isFieldMetadataSupportedInGroupBy,
} from 'twenty-shared/utils';
import { useIcons } from 'twenty-ui/icon';
-import { MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { RelationType } from '~/generated-metadata/graphql';
import { filterBySearchQuery } from '~/utils/filterBySearchQuery';
@@ -341,12 +343,16 @@ export const ChartGroupByFieldSelectionDropdownContentBase = <
>
{isSecondaryAxisGroupBy && (
<SelectableListItem itemId="none" onEnter={handleSelectNone}>
- <MenuItemSelect
- text={t`None`}
- selected={!isDefined(currentGroupByFieldMetadataId)}
+ <ListItem
focused={selectedItemId === 'none'}
onClick={handleSelectNone}
- />
+ role="option"
+ aria-selected={!isDefined(currentGroupByFieldMetadataId)}
+ selected={!isDefined(currentGroupByFieldMetadataId)}
+ indicator="check"
+ >
+ <OverflowingTextWithTooltip text={t`None`} />
+ </ListItem>
</SelectableListItem>
)}
@@ -358,25 +364,36 @@ export const ChartGroupByFieldSelectionDropdownContentBase = <
handleSelectField(fieldMetadataItem);
}}
>
- <MenuItemSelect
- text={fieldMetadataItem.label}
+ <ListItem
+ focused={selectedItemId === fieldMetadataItem.id}
+ onClick={() => {
+ handleSelectField(fieldMetadataItem);
+ }}
+ role="option"
+ aria-selected={
+ !isCompositeFieldType(fieldMetadataItem.type) &&
+ !isFieldRelation(fieldMetadataItem) &&
+ !isFieldMorphRelation(fieldMetadataItem) &&
+ currentGroupByFieldMetadataId === fieldMetadataItem.id
+ }
selected={
!isCompositeFieldType(fieldMetadataItem.type) &&
!isFieldRelation(fieldMetadataItem) &&
!isFieldMorphRelation(fieldMetadataItem) &&
currentGroupByFieldMetadataId === fieldMetadataItem.id
}
- focused={selectedItemId === fieldMetadataItem.id}
- LeftIcon={getIcon(fieldMetadataItem.icon)}
- hasSubMenu={
+ indicator="check"
+ hasSubmenu={
isCompositeFieldType(fieldMetadataItem.type) ||
isFieldRelation(fieldMetadataItem) ||
isFieldMorphRelation(fieldMetadataItem)
}
- onClick={() => {
- handleSelectField(fieldMetadataItem);
- }}
- />
+ startIcon={
+ <SelectOptionIcon Icon={getIcon(fieldMetadataItem.icon)} />
+ }
+ >
+ <OverflowingTextWithTooltip text={fieldMetadataItem.label} />
+ </ListItem>
</SelectableListItem>
))}
</SelectableList>
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionTargetObjectFieldsView.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionTargetObjectFieldsView.tsx
index 2e4d4d90aa1..4539caccbad 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionTargetObjectFieldsView.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionTargetObjectFieldsView.tsx
@@ -1,3 +1,5 @@
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
import { isCompositeFieldType } from '@/object-record/object-filter-dropdown/utils/isCompositeFieldType';
@@ -18,7 +20,7 @@ import { t } from '@lingui/core/macro';
import { useMemo, useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { IconChevronLeft, useIcons } from 'twenty-ui/icon';
-import { MenuItem, MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { MenuItem, ListItem } from 'twenty-ui/primitives/navigation';
import { filterBySearchQuery } from '~/utils/filterBySearchQuery';
import { normalizeSearchText } from '~/utils/normalizeSearchText';
@@ -156,15 +158,25 @@ export const ChartGroupByFieldSelectionTargetObjectFieldsView = ({
itemId={RECORD_ITEM_ID}
onEnter={onSelectRecord}
>
- <MenuItemSelect
- text={recordOptionLabel}
+ <ListItem
+ focused={selectedItemId === RECORD_ITEM_ID}
+ onClick={onSelectRecord}
+ role="option"
+ aria-selected={
+ isCurrentGroupByField && !isDefined(currentSubFieldName)
+ }
selected={
isCurrentGroupByField && !isDefined(currentSubFieldName)
}
- focused={selectedItemId === RECORD_ITEM_ID}
- LeftIcon={getIcon(targetObjectMetadataItem?.icon)}
- onClick={onSelectRecord}
- />
+ indicator="check"
+ startIcon={
+ <SelectOptionIcon
+ Icon={getIcon(targetObjectMetadataItem?.icon)}
+ />
+ }
+ >
+ <OverflowingTextWithTooltip text={recordOptionLabel} />
+ </ListItem>
</SelectableListItem>
)}
{availableFields.length === 0 && !isRecordOptionVisible ? (
@@ -178,19 +190,28 @@ export const ChartGroupByFieldSelectionTargetObjectFieldsView = ({
handleSelectField(fieldMetadataItem);
}}
>
- <MenuItemSelect
- text={fieldMetadataItem.label}
- selected={
- !isCompositeFieldType(fieldMetadataItem.type) &&
- currentNestedFieldName === fieldMetadataItem.name
- }
+ <ListItem
focused={selectedItemId === fieldMetadataItem.id}
- LeftIcon={getIcon(fieldMetadataItem.icon)}
- hasSubMenu={isCompositeFieldType(fieldMetadataItem.type)}
onClick={() => {
handleSelectField(fieldMetadataItem);
}}
- />
+ role="option"
+ aria-selected={
+ !isCompositeFieldType(fieldMetadataItem.type) &&
+ currentNestedFieldName === fieldMetadataItem.name
+ }
+ selected={
+ !isCompositeFieldType(fieldMetadataItem.type) &&
+ currentNestedFieldName === fieldMetadataItem.name
+ }
+ indicator="check"
+ hasSubmenu={isCompositeFieldType(fieldMetadataItem.type)}
+ startIcon={
+ <SelectOptionIcon Icon={getIcon(fieldMetadataItem.icon)} />
+ }
+ >
+ <OverflowingTextWithTooltip text={fieldMetadataItem.label} />
+ </ListItem>
</SelectableListItem>
))
)}
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartNumberFormatSelectionDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartNumberFormatSelectionDropdownContent.tsx
index 83e2b544413..1b9e847d648 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartNumberFormatSelectionDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartNumberFormatSelectionDropdownContent.tsx
@@ -1,3 +1,4 @@
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { CHART_NUMBER_FORMAT_DEFAULT } from '@/page-layout/widgets/graph/constants/ChartNumberFormatDefault';
import { usePageLayoutIdFromContextStore } from '@/side-panel/pages/page-layout/hooks/usePageLayoutIdFromContextStore';
import { useUpdateCurrentWidgetConfig } from '@/side-panel/pages/page-layout/hooks/useUpdateCurrentWidgetConfig';
@@ -12,7 +13,7 @@ import { SelectableListItem } from '@/ui/layout/selectable-list/components/Selec
import { selectedItemIdComponentState } from '@/ui/layout/selectable-list/states/selectedItemIdComponentState';
import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
-import { MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { ChartNumberFormat } from '~/generated-metadata/graphql';
export const ChartNumberFormatSelectionDropdownContent = () => {
@@ -82,14 +83,20 @@ export const ChartNumberFormatSelectionDropdownContent = () => {
handleSelectNumberFormatOption(option);
}}
>
- <MenuItemSelect
- text={getChartNumberFormatLabel(option)}
- selected={currentNumberFormat === option}
+ <ListItem
focused={selectedItemId === option}
onClick={() => {
handleSelectNumberFormatOption(option);
}}
- />
+ role="option"
+ aria-selected={currentNumberFormat === option}
+ selected={currentNumberFormat === option}
+ indicator="check"
+ >
+ <OverflowingTextWithTooltip
+ text={getChartNumberFormatLabel(option)}
+ />
+ </ListItem>
</SelectableListItem>
))}
</SelectableList>
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartRatioAggregateOperationSelectableListItem.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartRatioAggregateOperationSelectableListItem.tsx
index 5724fa452ed..d9cb9442916 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartRatioAggregateOperationSelectableListItem.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartRatioAggregateOperationSelectableListItem.tsx
@@ -1,3 +1,4 @@
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { usePageLayoutIdFromContextStore } from '@/side-panel/pages/page-layout/hooks/usePageLayoutIdFromContextStore';
import { useWidgetInEditMode } from '@/side-panel/pages/page-layout/hooks/useWidgetInEditMode';
import { isWidgetConfigurationOfType } from '@/side-panel/pages/page-layout/utils/isWidgetConfigurationOfType';
@@ -8,7 +9,7 @@ import { selectedItemIdComponentState } from '@/ui/layout/selectable-list/states
import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { isDefined } from 'twenty-shared/utils';
-import { MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
export const ChartRatioAggregateOperationSelectableListItem = ({
label,
@@ -42,13 +43,17 @@ export const ChartRatioAggregateOperationSelectableListItem = ({
itemId={DASHBOARD_AGGREGATE_OPERATION_RATIO}
onEnter={onSelect}
>
- <MenuItemSelect
- text={label}
- selected={isCurrentlyRatio}
+ <ListItem
focused={isFocused}
- hasSubMenu={true}
onClick={onSelect}
- />
+ role="option"
+ aria-selected={isCurrentlyRatio}
+ selected={isCurrentlyRatio}
+ indicator="check"
+ hasSubmenu={true}
+ >
+ <OverflowingTextWithTooltip text={label} />
+ </ListItem>
</SelectableListItem>
);
};
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartRatioOptionBooleanSelectableListItem.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartRatioOptionBooleanSelectableListItem.tsx
index 48244fe74d9..d53da49ac3d 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartRatioOptionBooleanSelectableListItem.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartRatioOptionBooleanSelectableListItem.tsx
@@ -1,3 +1,5 @@
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { usePageLayoutIdFromContextStore } from '@/side-panel/pages/page-layout/hooks/usePageLayoutIdFromContextStore';
import { useUpdateCurrentWidgetConfig } from '@/side-panel/pages/page-layout/hooks/useUpdateCurrentWidgetConfig';
import { useWidgetInEditMode } from '@/side-panel/pages/page-layout/hooks/useWidgetInEditMode';
@@ -9,7 +11,7 @@ import { selectedItemIdComponentState } from '@/ui/layout/selectable-list/states
import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { IconCheck, IconX } from 'twenty-ui/icon';
-import { MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { AggregateOperations } from '~/generated-metadata/graphql';
export const ChartRatioOptionBooleanSelectableListItem = ({
@@ -62,13 +64,19 @@ export const ChartRatioOptionBooleanSelectableListItem = ({
return (
<SelectableListItem itemId={optionValue} onEnter={handleClick}>
- <MenuItemSelect
- text={label}
- LeftIcon={optionValue === 'true' ? IconCheck : IconX}
- selected={isSelected}
+ <ListItem
focused={isFocused}
onClick={handleClick}
- />
+ role="option"
+ aria-selected={isSelected}
+ selected={isSelected}
+ indicator="check"
+ startIcon={
+ <SelectOptionIcon Icon={optionValue === 'true' ? IconCheck : IconX} />
+ }
+ >
+ <OverflowingTextWithTooltip text={label} />
+ </ListItem>
</SelectableListItem>
);
};
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartRatioOptionSelectSelectableListItem.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartRatioOptionSelectSelectableListItem.tsx
index 80e7e63dabc..f9a533b6802 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartRatioOptionSelectSelectableListItem.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartRatioOptionSelectSelectableListItem.tsx
@@ -1,3 +1,4 @@
+import { Tag } from 'twenty-ui/primitives/data-display';
import { usePageLayoutIdFromContextStore } from '@/side-panel/pages/page-layout/hooks/usePageLayoutIdFromContextStore';
import { useUpdateCurrentWidgetConfig } from '@/side-panel/pages/page-layout/hooks/useUpdateCurrentWidgetConfig';
import { useWidgetInEditMode } from '@/side-panel/pages/page-layout/hooks/useWidgetInEditMode';
@@ -8,7 +9,7 @@ import { SelectableListItem } from '@/ui/layout/selectable-list/components/Selec
import { selectedItemIdComponentState } from '@/ui/layout/selectable-list/states/selectedItemIdComponentState';
import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
-import { MenuItemSelectTag } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { type ThemeColor } from 'twenty-ui/theme';
import { AggregateOperations } from '~/generated-metadata/graphql';
@@ -64,13 +65,22 @@ export const ChartRatioOptionSelectSelectableListItem = ({
return (
<SelectableListItem itemId={optionValue} onEnter={handleClick}>
- <MenuItemSelectTag
- text={label}
- color={color ?? 'transparent'}
- selected={isSelected}
+ <ListItem
focused={isFocused}
onClick={handleClick}
- />
+ role="option"
+ aria-selected={isSelected}
+ selected={isSelected}
+ indicator="check"
+ >
+ <Tag
+ color={color ?? 'transparent'}
+ borderStyle="dashed"
+ variant={'soft'}
+ >
+ {label}
+ </Tag>
+ </ListItem>
</SelectableListItem>
);
};
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartSortByGroupByFieldDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartSortByGroupByFieldDropdownContent.tsx
index 655aa9f780c..853db9ab53d 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartSortByGroupByFieldDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartSortByGroupByFieldDropdownContent.tsx
@@ -1,3 +1,5 @@
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useState } from 'react';
import { ChartManualSortSubMenuContent } from '@/side-panel/pages/page-layout/components/dropdown-content/ChartManualSortSubMenuContent';
@@ -20,7 +22,7 @@ import { selectedItemIdComponentState } from '@/ui/layout/selectable-list/states
import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { isDefined } from 'twenty-shared/utils';
-import { MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import {
GraphOrderBy,
type GraphOrderBy as GraphOrderByType,
@@ -135,28 +137,40 @@ export const ChartSortByGroupByFieldDropdownContent = () => {
handleSelectSortOption(sortOption.value);
}}
>
- <MenuItemSelect
- text={getGroupBySortOptionLabel({
- graphOrderBy: sortOption.value,
- groupByFieldMetadataId:
- configuration.secondaryAxisGroupByFieldMetadataId ?? '',
- })}
- selected={
- configuration.secondaryAxisOrderBy === sortOption.value
- }
+ <ListItem
focused={selectedItemId === sortOption.value}
- LeftIcon={
- sortOption.icon ??
- getSortIconForFieldType({
- fieldType: secondaryAxisField?.type,
- orderBy: sortOption.value,
- })
- }
- hasSubMenu={isManualOption}
onClick={() => {
handleSelectSortOption(sortOption.value);
}}
- />
+ role="option"
+ aria-selected={
+ configuration.secondaryAxisOrderBy === sortOption.value
+ }
+ selected={
+ configuration.secondaryAxisOrderBy === sortOption.value
+ }
+ indicator="check"
+ hasSubmenu={isManualOption}
+ startIcon={
+ <SelectOptionIcon
+ Icon={
+ sortOption.icon ??
+ getSortIconForFieldType({
+ fieldType: secondaryAxisField?.type,
+ orderBy: sortOption.value,
+ })
+ }
+ />
+ }
+ >
+ <OverflowingTextWithTooltip
+ text={getGroupBySortOptionLabel({
+ graphOrderBy: sortOption.value,
+ groupByFieldMetadataId:
+ configuration.secondaryAxisGroupByFieldMetadataId ?? '',
+ })}
+ />
+ </ListItem>
</SelectableListItem>
);
})}
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartSortBySelectionDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartSortBySelectionDropdownContent.tsx
index 4dbcf881176..e99d98730de 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartSortBySelectionDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartSortBySelectionDropdownContent.tsx
@@ -1,3 +1,5 @@
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useState } from 'react';
import { ChartManualSortSubMenuContent } from '@/side-panel/pages/page-layout/components/dropdown-content/ChartManualSortSubMenuContent';
@@ -21,7 +23,7 @@ import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/com
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { type CompositeFieldSubFieldName } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
-import { MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import {
type BarChartConfiguration,
GraphOrderBy,
@@ -182,32 +184,42 @@ export const ChartSortBySelectionDropdownContent = () => {
handleSelect(sortOption.value);
}}
>
- <MenuItemSelect
- text={getXSortOptionLabel({
- graphOrderBy: sortOption.value,
- groupByFieldMetadataIdX: groupByFieldMetadataId ?? '',
- groupBySubFieldNameX: groupBySubFieldName as
- | CompositeFieldSubFieldName
- | undefined,
- aggregateFieldMetadataId:
- configuration.aggregateFieldMetadataId ?? undefined,
- aggregateOperation:
- configuration.aggregateOperation ?? undefined,
- })}
- selected={currentOrderBy === sortOption.value}
+ <ListItem
focused={selectedItemId === sortOption.value}
- LeftIcon={
- sortOption.icon ??
- getSortIconForFieldType({
- fieldType: primaryAxisField?.type,
- orderBy: sortOption.value,
- })
- }
- hasSubMenu={isManualOption}
onClick={() => {
handleSelect(sortOption.value);
}}
- />
+ role="option"
+ aria-selected={currentOrderBy === sortOption.value}
+ selected={currentOrderBy === sortOption.value}
+ indicator="check"
+ hasSubmenu={isManualOption}
+ startIcon={
+ <SelectOptionIcon
+ Icon={
+ sortOption.icon ??
+ getSortIconForFieldType({
+ fieldType: primaryAxisField?.type,
+ orderBy: sortOption.value,
+ })
+ }
+ />
+ }
+ >
+ <OverflowingTextWithTooltip
+ text={getXSortOptionLabel({
+ graphOrderBy: sortOption.value,
+ groupByFieldMetadataIdX: groupByFieldMetadataId ?? '',
+ groupBySubFieldNameX: groupBySubFieldName as
+ | CompositeFieldSubFieldName
+ | undefined,
+ aggregateFieldMetadataId:
+ configuration.aggregateFieldMetadataId ?? undefined,
+ aggregateOperation:
+ configuration.aggregateOperation ?? undefined,
+ })}
+ />
+ </ListItem>
</SelectableListItem>
);
})}
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/FieldWidgetFieldDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/FieldWidgetFieldDropdownContent.tsx
index 6592cf967c3..abb32c61aea 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/FieldWidgetFieldDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/FieldWidgetFieldDropdownContent.tsx
@@ -1,3 +1,5 @@
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useFieldMetadataItemById } from '@/object-metadata/hooks/useFieldMetadataItemById';
import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
@@ -34,7 +36,7 @@ import { t } from '@lingui/core/macro';
import { useMemo, useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { useIcons } from 'twenty-ui/icon';
-import { MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { FieldDisplayMode } from '~/generated-metadata/graphql';
import { filterBySearchQuery } from '~/utils/filterBySearchQuery';
@@ -327,24 +329,32 @@ export const FieldWidgetFieldDropdownContent = () => {
itemId={fieldMetadataItem.id}
onEnter={handleClick}
>
- <MenuItemSelect
- text={fieldMetadataItem.label}
- // Rows opening a submenu never show the checkmark: the
- // selected chain is only visible inside the submenu, like
- // the chart group by field selection.
- selected={
+ <ListItem
+ focused={selectedItemId === fieldMetadataItem.id}
+ onClick={handleClick}
+ role="option"
+ aria-selected={
!hasNestedFieldCandidates &&
currentFieldMetadataId === fieldMetadataItem.id
}
- focused={selectedItemId === fieldMetadataItem.id}
- LeftIcon={getIcon(
+ selected={
+ !hasNestedFieldCandidates &&
currentFieldMetadataId === fieldMetadataItem.id
- ? currentFieldMetadataItem?.icon
- : fieldMetadataItem.icon,
- )}
- hasSubMenu={hasNestedFieldCandidates}
- onClick={handleClick}
- />
+ }
+ indicator="check"
+ hasSubmenu={hasNestedFieldCandidates}
+ startIcon={
+ <SelectOptionIcon
+ Icon={getIcon(
+ currentFieldMetadataId === fieldMetadataItem.id
+ ? currentFieldMetadataItem?.icon
+ : fieldMetadataItem.icon,
+ )}
+ />
+ }
+ >
+ <OverflowingTextWithTooltip text={fieldMetadataItem.label} />
+ </ListItem>
</SelectableListItem>
);
})}
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/FieldWidgetLayoutDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/FieldWidgetLayoutDropdownContent.tsx
index 24869c65273..47606e65554 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/FieldWidgetLayoutDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/FieldWidgetLayoutDropdownContent.tsx
@@ -1,3 +1,5 @@
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useFieldMetadataItemById } from '@/object-metadata/hooks/useFieldMetadataItemById';
import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
import { type FieldConfiguration } from '@/page-layout/types/FieldConfiguration';
@@ -39,7 +41,7 @@ import {
IconListDetails,
IconTable,
} from 'twenty-ui/icon';
-import { MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { FieldDisplayMode } from '~/generated-metadata/graphql';
const DISPLAY_MODE_ICONS: Record<FieldDisplayMode, IconComponent> = {
@@ -268,15 +270,23 @@ export const FieldWidgetLayoutDropdownContent = () => {
handleSelectDisplayMode(displayMode);
}}
>
- <MenuItemSelect
- text={displayModeLabels[displayMode]}
- selected={currentDisplayMode === displayMode}
+ <ListItem
focused={selectedItemId === displayMode}
- LeftIcon={DISPLAY_MODE_ICONS[displayMode]}
onClick={() => {
handleSelectDisplayMode(displayMode);
}}
- />
+ role="option"
+ aria-selected={currentDisplayMode === displayMode}
+ selected={currentDisplayMode === displayMode}
+ indicator="check"
+ startIcon={
+ <SelectOptionIcon Icon={DISPLAY_MODE_ICONS[displayMode]} />
+ }
+ >
+ <OverflowingTextWithTooltip
+ text={displayModeLabels[displayMode]}
+ />
+ </ListItem>
</SelectableListItem>
))}
{hasEmbeddedViewLayouts && (
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/FieldWidgetNestedFieldDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/FieldWidgetNestedFieldDropdownContent.tsx
index 62cf085e671..1521037e6f9 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/FieldWidgetNestedFieldDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/FieldWidgetNestedFieldDropdownContent.tsx
@@ -1,3 +1,5 @@
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
import {
StyledPageLayoutDropdownContentContainer,
@@ -13,7 +15,7 @@ import { selectedItemIdComponentState } from '@/ui/layout/selectable-list/states
import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { IconChevronLeft, useIcons } from 'twenty-ui/icon';
-import { MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
type FieldWidgetNestedFieldDropdownContentProps = {
drillInFieldMetadataItem: FieldMetadataItem;
@@ -55,13 +57,17 @@ export const FieldWidgetNestedFieldDropdownContent = ({
itemId={fieldMetadataItem.id}
onEnter={onSelect}
>
- <MenuItemSelect
- text={fieldMetadataItem.label}
- selected={checkedItemId === fieldMetadataItem.id}
+ <ListItem
focused={selectedItemId === fieldMetadataItem.id}
- LeftIcon={getIcon(fieldMetadataItem.icon)}
onClick={onSelect}
- />
+ role="option"
+ aria-selected={checkedItemId === fieldMetadataItem.id}
+ selected={checkedItemId === fieldMetadataItem.id}
+ indicator="check"
+ startIcon={<SelectOptionIcon Icon={getIcon(fieldMetadataItem.icon)} />}
+ >
+ <OverflowingTextWithTooltip text={fieldMetadataItem.label} />
+ </ListItem>
</SelectableListItem>
);
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/WidgetVisibilityOptionsList.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/WidgetVisibilityOptionsList.tsx
index 7f7508ffa23..18bd4fb63a5 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/WidgetVisibilityOptionsList.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/WidgetVisibilityOptionsList.tsx
@@ -1,3 +1,4 @@
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { VISIBILITY_OPTIONS } from '@/side-panel/pages/page-layout/constants/VisibilityOptions';
import { useVisibilityLabels } from '@/side-panel/pages/page-layout/hooks/useVisibilityLabels';
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
@@ -7,7 +8,7 @@ import { SelectableListItem } from '@/ui/layout/selectable-list/components/Selec
import { selectedItemIdComponentState } from '@/ui/layout/selectable-list/states/selectedItemIdComponentState';
import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
-import { MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
type WidgetVisibilityOptionsListProps = {
currentOptionId: string;
@@ -44,14 +45,18 @@ export const WidgetVisibilityOptionsList = ({
onSelectVisibility(option.id);
}}
>
- <MenuItemSelect
- text={visibilityLabels[option.id]}
- selected={currentOptionId === option.id}
+ <ListItem
focused={selectedItemId === option.id}
onClick={() => {
onSelectVisibility(option.id);
}}
- />
+ role="option"
+ aria-selected={currentOptionId === option.id}
+ selected={currentOptionId === option.id}
+ indicator="check"
+ >
+ <OverflowingTextWithTooltip text={visibilityLabels[option.id]} />
+ </ListItem>
</SelectableListItem>
))}
</SelectableList>
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableCalendarFieldDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableCalendarFieldDropdownContent.tsx
index f735edbed44..570b33e00e7 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableCalendarFieldDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableCalendarFieldDropdownContent.tsx
@@ -1,3 +1,5 @@
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
import { useRecordTableWidgetLayoutCallbacks } from '@/page-layout/widgets/record-table/hooks/useRecordTableWidgetLayoutCallbacks';
import { isFieldMetadataItemAvailableAsCalendarField } from '@/object-record/record-calendar/utils/isFieldMetadataItemAvailableAsCalendarField';
@@ -10,7 +12,7 @@ import { selectedItemIdComponentState } from '@/ui/layout/selectable-list/states
import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { useIcons } from 'twenty-ui/icon';
-import { MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
type RecordTableCalendarFieldDropdownContentProps = {
pageLayoutId: string;
@@ -71,16 +73,24 @@ export const RecordTableCalendarFieldDropdownContent = ({
closeDropdown();
}}
>
- <MenuItemSelect
- text={fieldMetadataItem.label}
- LeftIcon={getIcon(fieldMetadataItem.icon)}
- selected={currentCalendarFieldMetadataId === fieldMetadataItem.id}
+ <ListItem
focused={selectedItemId === fieldMetadataItem.id}
onClick={() => {
handleCalendarFieldChange(fieldMetadataItem);
closeDropdown();
}}
- />
+ role="option"
+ aria-selected={
+ currentCalendarFieldMetadataId === fieldMetadataItem.id
+ }
+ selected={currentCalendarFieldMetadataId === fieldMetadataItem.id}
+ indicator="check"
+ startIcon={
+ <SelectOptionIcon Icon={getIcon(fieldMetadataItem.icon)} />
+ }
+ >
+ <OverflowingTextWithTooltip text={fieldMetadataItem.label} />
+ </ListItem>
</SelectableListItem>
))}
</SelectableList>
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableCalendarLayoutDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableCalendarLayoutDropdownContent.tsx
index b524afc8348..bf396029771 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableCalendarLayoutDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableCalendarLayoutDropdownContent.tsx
@@ -1,3 +1,5 @@
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useRecordTableWidgetLayoutCallbacks } from '@/page-layout/widgets/record-table/hooks/useRecordTableWidgetLayoutCallbacks';
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
import { DropdownComponentInstanceContext } from '@/ui/layout/dropdown/contexts/DropdownComponentInstanceContext';
@@ -13,7 +15,7 @@ import {
IconCalendarMonth,
IconCalendarWeek,
} from 'twenty-ui/icon';
-import { MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { ViewCalendarLayout } from '~/generated-metadata/graphql';
type RecordTableCalendarLayoutDropdownContentProps = {
@@ -71,13 +73,17 @@ export const RecordTableCalendarLayoutDropdownContent = ({
itemId={value}
onEnter={() => handleSelect(value)}
>
- <MenuItemSelect
- text={label}
- LeftIcon={Icon}
- selected={currentCalendarLayout === value}
+ <ListItem
focused={selectedItemId === value}
onClick={() => handleSelect(value)}
- />
+ role="option"
+ aria-selected={currentCalendarLayout === value}
+ selected={currentCalendarLayout === value}
+ indicator="check"
+ startIcon={<SelectOptionIcon Icon={Icon} />}
+ >
+ <OverflowingTextWithTooltip text={label} />
+ </ListItem>
</SelectableListItem>
))}
</SelectableList>
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableDataSourceDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableDataSourceDropdownContent.tsx
index 7d445b042c2..05f9fe0e644 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableDataSourceDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableDataSourceDropdownContent.tsx
@@ -1,3 +1,5 @@
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { ObjectMetadataIcon } from '@/object-metadata/components/ObjectMetadataIcon';
import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
import { filterReadableActiveObjectMetadataItems } from '@/object-metadata/utils/filterReadableActiveObjectMetadataItems';
@@ -21,7 +23,7 @@ import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/use
import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
-import { MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { filterBySearchQuery } from '~/utils/filterBySearchQuery';
export const RecordTableDataSourceDropdownContent = () => {
@@ -138,17 +140,31 @@ export const RecordTableDataSourceDropdownContent = () => {
handleSelectSource(objectMetadataItem.id);
}}
>
- <MenuItemSelect
- text={objectMetadataItem.labelPlural}
- selected={currentObjectMetadataItemId === objectMetadataItem.id}
+ <ListItem
focused={selectedItemId === objectMetadataItem.id}
- LeftIcon={() => (
- <ObjectMetadataIcon objectMetadataItem={objectMetadataItem} />
- )}
onClick={() => {
handleSelectSource(objectMetadataItem.id);
}}
- />
+ role="option"
+ aria-selected={
+ currentObjectMetadataItemId === objectMetadataItem.id
+ }
+ selected={currentObjectMetadataItemId === objectMetadataItem.id}
+ indicator="check"
+ startIcon={
+ <SelectOptionIcon
+ Icon={() => (
+ <ObjectMetadataIcon
+ objectMetadataItem={objectMetadataItem}
+ />
+ )}
+ />
+ }
+ >
+ <OverflowingTextWithTooltip
+ text={objectMetadataItem.labelPlural}
+ />
+ </ListItem>
</SelectableListItem>
))}
</SelectableList>
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableGroupByDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableGroupByDropdownContent.tsx
index 9d336415651..910227e4fb0 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableGroupByDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableGroupByDropdownContent.tsx
@@ -1,3 +1,5 @@
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
import { useRecordTableWidgetLayoutCallbacks } from '@/page-layout/widgets/record-table/hooks/useRecordTableWidgetLayoutCallbacks';
import { isFieldMetadataItemAvailableAsWidgetGroupByField } from '@/page-layout/widgets/record-table/utils/isFieldMetadataItemAvailableAsWidgetGroupByField';
@@ -15,7 +17,7 @@ import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { useIcons } from 'twenty-ui/icon';
-import { MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { filterBySearchQuery } from '~/utils/filterBySearchQuery';
const NO_GROUP_BY_ITEM_ID = 'no-group-by';
@@ -97,15 +99,19 @@ export const RecordTableGroupByDropdownContent = ({
closeDropdown();
}}
>
- <MenuItemSelect
- text={t`None`}
- selected={!isDefined(currentMainGroupByFieldMetadataId)}
+ <ListItem
focused={selectedItemId === NO_GROUP_BY_ITEM_ID}
onClick={() => {
handleGroupByFieldChange(null);
closeDropdown();
}}
- />
+ role="option"
+ aria-selected={!isDefined(currentMainGroupByFieldMetadataId)}
+ selected={!isDefined(currentMainGroupByFieldMetadataId)}
+ indicator="check"
+ >
+ <OverflowingTextWithTooltip text={t`None`} />
+ </ListItem>
</SelectableListItem>
)}
{filteredFields.map((fieldMetadataItem) => (
@@ -117,18 +123,26 @@ export const RecordTableGroupByDropdownContent = ({
closeDropdown();
}}
>
- <MenuItemSelect
- text={fieldMetadataItem.label}
- LeftIcon={getIcon(fieldMetadataItem.icon)}
- selected={
- currentMainGroupByFieldMetadataId === fieldMetadataItem.id
- }
+ <ListItem
focused={selectedItemId === fieldMetadataItem.id}
onClick={() => {
handleGroupByFieldChange(fieldMetadataItem);
closeDropdown();
}}
- />
+ role="option"
+ aria-selected={
+ currentMainGroupByFieldMetadataId === fieldMetadataItem.id
+ }
+ selected={
+ currentMainGroupByFieldMetadataId === fieldMetadataItem.id
+ }
+ indicator="check"
+ startIcon={
+ <SelectOptionIcon Icon={getIcon(fieldMetadataItem.icon)} />
+ }
+ >
+ <OverflowingTextWithTooltip text={fieldMetadataItem.label} />
+ </ListItem>
</SelectableListItem>
))}
</SelectableList>
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableWidgetLayoutMenuItems.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableWidgetLayoutMenuItems.tsx
index 73d362be640..363bce1d66d 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableWidgetLayoutMenuItems.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableWidgetLayoutMenuItems.tsx
@@ -1,9 +1,11 @@
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { type RecordTableWidgetLayoutViewType } from '@/page-layout/widgets/record-table/types/RecordTableWidgetLayoutViewType';
import { type RecordTableWidgetLayoutPickerOption } from '@/page-layout/widgets/record-table/utils/getRecordTableWidgetLayoutPickerOptions';
import { SelectableListItem } from '@/ui/layout/selectable-list/components/SelectableListItem';
import { useLingui } from '@lingui/react/macro';
import { isDefined } from 'twenty-shared/utils';
-import { MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
type RecordTableWidgetLayoutMenuItemsProps = {
layoutOptions: RecordTableWidgetLayoutPickerOption[];
@@ -31,18 +33,22 @@ export const RecordTableWidgetLayoutMenuItems = ({
itemId={viewType}
onEnter={() => onSelect(viewType)}
>
- <MenuItemSelect
- text={t(label)}
- LeftIcon={Icon}
+ <ListItem
disabled={isDisabled}
- contextualText={
- isDefined(unavailableReason) ? t(unavailableReason) : undefined
- }
- contextualTextPosition="right"
- selected={selectedViewType === viewType}
focused={focusedItemId === viewType}
onClick={() => onSelect(viewType)}
- />
+ role="option"
+ aria-selected={selectedViewType === viewType}
+ selected={selectedViewType === viewType}
+ indicator="check"
+ description={
+ isDefined(unavailableReason) ? t(unavailableReason) : undefined
+ }
+ descriptionPlacement={'end'}
+ startIcon={<SelectOptionIcon Icon={Icon} />}
+ >
+ <OverflowingTextWithTooltip text={t(label)} />
+ </ListItem>
</SelectableListItem>
),
)}
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/__tests__/RecordTableLayoutDropdownContent.test.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/__tests__/RecordTableLayoutDropdownContent.test.tsx
index 158962a7175..7ff1347c1d2 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/__tests__/RecordTableLayoutDropdownContent.test.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/__tests__/RecordTableLayoutDropdownContent.test.tsx
@@ -68,22 +68,22 @@ jest.mock(
}),
);
jest.mock('twenty-ui/primitives/navigation', () => ({
- MenuItemSelect: ({
- contextualText,
+ ListItem: ({
+ description,
disabled,
onClick,
selected,
- text,
+ children,
}: {
- contextualText?: React.ReactNode;
+ description?: React.ReactNode;
disabled?: boolean;
onClick?: () => void;
selected: boolean;
- text: string;
+ children: React.ReactNode;
}) => (
<button data-selected={selected} disabled={disabled} onClick={onClick}>
- <span>{text}</span>
- {contextualText}
+ <span>{children}</span>
+ {description}
</button>
),
}));
diff --git a/packages/twenty-front/src/modules/spreadsheet-import/components/MatchColumnSelectFieldSelectDropdownContent.tsx b/packages/twenty-front/src/modules/spreadsheet-import/components/MatchColumnSelectFieldSelectDropdownContent.tsx
index 90239a11882..cc03ef1cdda 100644
--- a/packages/twenty-front/src/modules/spreadsheet-import/components/MatchColumnSelectFieldSelectDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/spreadsheet-import/components/MatchColumnSelectFieldSelectDropdownContent.tsx
@@ -1,3 +1,5 @@
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useMemo, useState } from 'react';
import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
@@ -19,7 +21,7 @@ import { useLingui } from '@lingui/react/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { IconForbid, IconX, useIcons } from 'twenty-ui/icon';
import { type SelectOption } from 'twenty-ui/primitives/input';
-import { MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { type ReadonlyDeep } from 'type-fest';
import { normalizeSearchText } from '~/utils/normalizeSearchText';
@@ -106,12 +108,18 @@ export const MatchColumnSelectFieldSelectDropdownContent = ({
{!isNonEmptyString(searchFilter) && (
<>
<DropdownMenuItemsContainer scrollable={false}>
- <MenuItemSelect
- selected={selectedValue?.value === DO_NOT_IMPORT_OPTION_KEY}
+ <ListItem
onClick={onDoNotImportSelect}
- LeftIcon={IconForbid}
- text={t`Do not import`}
- />
+ role="option"
+ aria-selected={
+ selectedValue?.value === DO_NOT_IMPORT_OPTION_KEY
+ }
+ selected={selectedValue?.value === DO_NOT_IMPORT_OPTION_KEY}
+ indicator="check"
+ startIcon={<SelectOptionIcon Icon={IconForbid} />}
+ >
+ <OverflowingTextWithTooltip text={t`Do not import`} />
+ </ListItem>
</DropdownMenuItemsContainer>
{suggestedOptions.length > 0 && (
<>
@@ -119,14 +127,18 @@ export const MatchColumnSelectFieldSelectDropdownContent = ({
<DropdownMenuSectionLabel label={t`Suggested`} />
<DropdownMenuItemsContainer scrollable={false}>
{suggestedOptions.map((option) => (
- <MenuItemSelect
+ <ListItem
key={option.value}
- selected={selectedValue?.value === option.value}
onClick={() => handleSuggestedOptionClick(option)}
- LeftIcon={option.Icon}
- text={option.label}
- contextualText={option.fieldMetadataTypeLabel}
- />
+ role="option"
+ aria-selected={selectedValue?.value === option.value}
+ selected={selectedValue?.value === option.value}
+ indicator="check"
+ description={option.fieldMetadataTypeLabel}
+ startIcon={<SelectOptionIcon Icon={option.Icon} />}
+ >
+ <OverflowingTextWithTooltip text={option.label} />
+ </ListItem>
))}
</DropdownMenuItemsContainer>
</>
@@ -137,15 +149,19 @@ export const MatchColumnSelectFieldSelectDropdownContent = ({
)}
<DropdownMenuItemsContainer scrollable={false}>
{filteredAvailableFieldMetadataItems.map((field) => (
- <MenuItemSelect
+ <ListItem
key={field.id}
- selected={selectedValue?.value === field.name}
onClick={() => handleFieldClick(field)}
- LeftIcon={getIcon(field.icon)}
- text={field.label}
- contextualText={getFieldMetadataTypeLabel(field.type)}
- hasSubMenu={hasNestedFields(field)}
- />
+ role="option"
+ aria-selected={selectedValue?.value === field.name}
+ selected={selectedValue?.value === field.name}
+ indicator="check"
+ hasSubmenu={hasNestedFields(field)}
+ description={getFieldMetadataTypeLabel(field.type)}
+ startIcon={<SelectOptionIcon Icon={getIcon(field.icon)} />}
+ >
+ <OverflowingTextWithTooltip text={field.label} />
+ </ListItem>
))}
</DropdownMenuItemsContainer>
</ScrollWrapper>
diff --git a/packages/twenty-front/src/modules/spreadsheet-import/steps/components/MatchColumnsStep/components/SubMatchingSelectInput.tsx b/packages/twenty-front/src/modules/spreadsheet-import/steps/components/MatchColumnsStep/components/SubMatchingSelectInput.tsx
index a609ea6108e..425c0d14a66 100644
--- a/packages/twenty-front/src/modules/spreadsheet-import/steps/components/MatchColumnsStep/components/SubMatchingSelectInput.tsx
+++ b/packages/twenty-front/src/modules/spreadsheet-import/steps/components/MatchColumnsStep/components/SubMatchingSelectInput.tsx
@@ -1,11 +1,12 @@
+import { isDefined } from 'twenty-shared/utils';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
import { DropdownMenuSearchInput } from '@/ui/layout/dropdown/components/DropdownMenuSearchInput';
import { DropdownMenuSeparator } from '@/ui/layout/dropdown/components/DropdownMenuSeparator';
-import { useMemo, useRef, useState } from 'react';
-import { type TagColor } from 'twenty-ui/primitives/data-display';
+import { useMemo, useRef, useState, createElement } from 'react';
+import { type TagColor, Tag } from 'twenty-ui/primitives/data-display';
import { type SelectOption } from 'twenty-ui/primitives/input';
-import { MenuItemSelectTag } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { normalizeSearchText } from '~/utils/normalizeSearchText';
interface SubMatchingSelectInputProps {
@@ -57,14 +58,25 @@ export const SubMatchingSelectInput = ({
<DropdownMenuSeparator />
<DropdownMenuItemsContainer hasMaxHeight>
{optionsInDropDown.map((option) => (
- <MenuItemSelectTag
+ <ListItem
key={option.value}
- selected={selectedOption?.value === option.value}
- text={option.label}
- color={(option.color as TagColor) ?? 'transparent'}
onClick={() => handleOptionChange(option)}
- LeftIcon={option.Icon}
- />
+ role="option"
+ aria-selected={selectedOption?.value === option.value}
+ selected={selectedOption?.value === option.value}
+ indicator="check"
+ >
+ <Tag
+ color={(option.color as TagColor) ?? 'transparent'}
+ borderStyle="dashed"
+ variant={'soft'}
+ startIcon={
+ isDefined(option.Icon) ? createElement(option.Icon) : undefined
+ }
+ >
+ {option.label}
+ </Tag>
+ </ListItem>
))}
</DropdownMenuItemsContainer>
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/ui/field/input/components/MultiSelectInput.tsx b/packages/twenty-front/src/modules/ui/field/input/components/MultiSelectInput.tsx
index f7070ae274f..bff43b48038 100644
--- a/packages/twenty-front/src/modules/ui/field/input/components/MultiSelectInput.tsx
+++ b/packages/twenty-front/src/modules/ui/field/input/components/MultiSelectInput.tsx
@@ -1,5 +1,6 @@
+import { Tag } from 'twenty-ui/primitives/data-display';
import { isNonEmptyString } from '@sniptt/guards';
-import { useRef, useState } from 'react';
+import { useRef, useState, createElement } from 'react';
import { Key } from 'ts-key-enum';
import { type FieldMultiSelectValue } from '@/object-record/record-field/ui/types/FieldMetadata';
@@ -19,10 +20,7 @@ import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/use
import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { type SelectOption } from 'twenty-ui/primitives/input';
-import {
- MenuItem,
- MenuItemMultiSelectTag,
-} from 'twenty-ui/primitives/navigation';
+import { MenuItem, ListItem } from 'twenty-ui/primitives/navigation';
import { normalizeSearchText } from '~/utils/normalizeSearchText';
import { turnIntoEmptyStringIfWhitespacesOnly } from '~/utils/string/turnIntoEmptyStringIfWhitespacesOnly';
@@ -136,7 +134,7 @@ export const MultiSelectInput = ({
autoFocus
/>
<DropdownMenuSeparator />
- <DropdownMenuItemsContainer hasMaxHeight>
+ <DropdownMenuItemsContainer isMultiSelect hasMaxHeight>
{filteredOptionsInDropDown.length === 0 ? (
<MenuItem text={t`No option found`} />
) : (
@@ -149,17 +147,28 @@ export const MultiSelectInput = ({
onOptionSelected(formatNewSelectedOptions(option.value));
}}
>
- <MenuItemMultiSelectTag
+ <ListItem
key={option.value}
- selected={values?.includes(option.value) || false}
- text={option.label}
- color={option.color ?? 'transparent'}
- Icon={option.Icon ?? undefined}
onClick={() =>
onOptionSelected(formatNewSelectedOptions(option.value))
}
- isKeySelected={selectedItemId === option.value}
- />
+ focused={selectedItemId === option.value}
+ role="option"
+ aria-selected={values?.includes(option.value) || false}
+ selected={values?.includes(option.value) || false}
+ indicator="checkbox"
+ >
+ <Tag
+ color={option.color ?? 'transparent'}
+ startIcon={
+ isDefined(option.Icon)
+ ? createElement(option.Icon)
+ : undefined
+ }
+ >
+ {option.label}
+ </Tag>
+ </ListItem>
</SelectableListItem>
);
})
diff --git a/packages/twenty-front/src/modules/ui/field/input/components/__stories__/MultiSelectInput.stories.tsx b/packages/twenty-front/src/modules/ui/field/input/components/__stories__/MultiSelectInput.stories.tsx
index 258ccfb292d..9f548ff7f02 100644
--- a/packages/twenty-front/src/modules/ui/field/input/components/__stories__/MultiSelectInput.stories.tsx
+++ b/packages/twenty-front/src/modules/ui/field/input/components/__stories__/MultiSelectInput.stories.tsx
@@ -170,9 +170,9 @@ export const WithPreselectedValues: Story = {
});
await waitFor(() => {
- const checkboxes = canvas.getAllByRole('checkbox', { checked: true });
+ const selectedOptions = canvas.getAllByRole('option', { selected: true });
- expect(checkboxes).toHaveLength(2);
+ expect(selectedOptions).toHaveLength(2);
});
for (const option of sampleOptions) {
@@ -194,9 +194,9 @@ export const SingleSelection: Story = {
});
await waitFor(() => {
- const checkboxes = canvas.getAllByRole('checkbox', { checked: true });
+ const selectedOptions = canvas.getAllByRole('option', { selected: true });
- expect(checkboxes).toHaveLength(1);
+ expect(selectedOptions).toHaveLength(1);
});
for (const option of sampleOptions) {
@@ -206,9 +206,11 @@ export const SingleSelection: Story = {
await userEvent.click(canvas.getByText('Professional Network'));
await waitFor(() => {
- const checkboxes = canvas.queryAllByRole('checkbox', { checked: true });
+ const selectedOptions = canvas.queryAllByRole('option', {
+ selected: true,
+ });
- expect(checkboxes).toHaveLength(0);
+ expect(selectedOptions).toHaveLength(0);
});
await userEvent.unhover(canvas.getByText('Professional Network'));
@@ -292,7 +294,7 @@ export const SearchFiltering: Story = {
});
expect(canvas.queryByText('Social Media')).not.toBeInTheDocument();
- expect(canvas.getAllByRole('checkbox')).toHaveLength(2);
+ expect(canvas.getAllByRole('option')).toHaveLength(2);
},
};
diff --git a/packages/twenty-front/src/modules/ui/input/components/Select.tsx b/packages/twenty-front/src/modules/ui/input/components/Select.tsx
index dcd8499e7db..dd2311e091b 100644
--- a/packages/twenty-front/src/modules/ui/input/components/Select.tsx
+++ b/packages/twenty-front/src/modules/ui/input/components/Select.tsx
@@ -1,3 +1,6 @@
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
+import { Tag } from 'twenty-ui/primitives/data-display';
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { styled } from '@linaria/react';
import { type MouseEvent, useMemo, useRef, useState } from 'react';
@@ -22,11 +25,7 @@ import { isNonEmptyArray, isNonEmptyString } from '@sniptt/guards';
import { isDefined } from 'twenty-shared/utils';
import { type IconComponent } from 'twenty-ui/icon';
import { type SelectOption } from 'twenty-ui/primitives/input';
-import {
- MenuItem,
- MenuItemSelect,
- MenuItemSelectTag,
-} from 'twenty-ui/primitives/navigation';
+import { MenuItem, ListItem } from 'twenty-ui/primitives/navigation';
import { themeCssVariables } from 'twenty-ui/theme-constants';
import { normalizeSearchText } from '~/utils/normalizeSearchText';
@@ -252,22 +251,34 @@ export const Select = <Value extends SelectValue>({
)}
{isDefined(pinnedOption) && (
<DropdownMenuItemsContainer scrollable={false}>
- <MenuItemSelect
- LeftIcon={pinnedOption.Icon}
- LeftComponent={pinnedOption.LeftComponent}
- leftIconColor={pinnedOption.iconThemeColor}
- text={pinnedOption.label}
- contextualText={pinnedOption.contextualText}
- selected={
- controlSelectedOption.value === pinnedOption.value
- }
- needIconCheck={needIconCheck}
+ <ListItem
onClick={() => {
onChange?.(pinnedOption.value);
onBlur?.();
closeDropdown(dropdownId);
}}
- />
+ role="option"
+ aria-selected={
+ controlSelectedOption.value === pinnedOption.value
+ }
+ selected={
+ needIconCheck &&
+ controlSelectedOption.value === pinnedOption.value
+ }
+ indicator={needIconCheck ? 'check' : 'none'}
+ description={pinnedOption.contextualText}
+ startIcon={
+ <>
+ <SelectOptionIcon
+ Icon={pinnedOption.Icon}
+ color={pinnedOption.iconThemeColor}
+ />
+ {pinnedOption.LeftComponent}
+ </>
+ }
+ >
+ <OverflowingTextWithTooltip text={pinnedOption.label} />
+ </ListItem>
</DropdownMenuItemsContainer>
)}
{isDefined(pinnedOption) && isNonEmptyArray(filteredOptions) && (
@@ -294,29 +305,52 @@ export const Select = <Value extends SelectValue>({
onEnter={handleSelectOption}
>
{renderAsTag && isDefined(option.color) ? (
- <MenuItemSelectTag
- text={option.label}
- color={option.color}
+ <ListItem
+ focused={selectedItemId === option.label}
+ onClick={handleSelectOption}
+ role="option"
+ aria-selected={
+ controlSelectedOption.value === option.value
+ }
selected={
controlSelectedOption.value === option.value
}
+ indicator="check"
+ >
+ <Tag
+ color={option.color}
+ borderStyle="dashed"
+ variant={'soft'}
+ >
+ {option.label}
+ </Tag>
+ </ListItem>
+ ) : (
+ <ListItem
focused={selectedItemId === option.label}
onClick={handleSelectOption}
- />
- ) : (
- <MenuItemSelect
- LeftIcon={option.Icon}
- LeftComponent={option.LeftComponent}
- leftIconColor={option.iconThemeColor}
- text={option.label}
- contextualText={option.contextualText}
+ role="option"
+ aria-selected={
+ controlSelectedOption.value === option.value
+ }
selected={
+ needIconCheck &&
controlSelectedOption.value === option.value
}
- focused={selectedItemId === option.label}
- needIconCheck={needIconCheck}
- onClick={handleSelectOption}
- />
+ indicator={needIconCheck ? 'check' : 'none'}
+ description={option.contextualText}
+ startIcon={
+ <>
+ <SelectOptionIcon
+ Icon={option.Icon}
+ color={option.iconThemeColor}
+ />
+ {option.LeftComponent}
+ </>
+ }
+ >
+ <OverflowingTextWithTooltip text={option.label} />
+ </ListItem>
)}
</SelectableListItem>
);
diff --git a/packages/twenty-front/src/modules/ui/input/components/SelectInput.tsx b/packages/twenty-front/src/modules/ui/input/components/SelectInput.tsx
index 307f423fc32..ddb789062c8 100644
--- a/packages/twenty-front/src/modules/ui/input/components/SelectInput.tsx
+++ b/packages/twenty-front/src/modules/ui/input/components/SelectInput.tsx
@@ -9,12 +9,12 @@ import { selectedItemIdComponentState } from '@/ui/layout/selectable-list/states
import { useListenClickOutside } from '@/ui/utilities/pointer-event/hooks/useListenClickOutside';
import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
-import { useEffect, useMemo, useRef, useState } from 'react';
+import { useEffect, useMemo, useRef, useState, createElement } from 'react';
import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
-import { type TagColor } from 'twenty-ui/primitives/data-display';
+import { type TagColor, Tag } from 'twenty-ui/primitives/data-display';
import { type SelectOption } from 'twenty-ui/primitives/input';
-import { MenuItemSelectTag } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { normalizeSearchText } from '~/utils/normalizeSearchText';
interface SelectInputProps {
@@ -115,14 +115,21 @@ export const SelectInput = ({
itemId={t`No ${clearLabel}`}
onEnter={handleClearOption}
>
- <MenuItemSelectTag
+ <ListItem
key={t`No ${clearLabel}`}
- text={t`No ${clearLabel}`}
- color="transparent"
- variant="outline"
onClick={handleClearOption}
- isKeySelected={selectedItemId === t`No ${clearLabel}`}
- />
+ focused={selectedItemId === t`No ${clearLabel}`}
+ role="option"
+ aria-selected={false}
+ selected={false}
+ indicator="check"
+ >
+ <Tag
+ color={'transparent'}
+ borderStyle="dashed"
+ variant={'outline'}
+ >{t`No ${clearLabel}`}</Tag>
+ </ListItem>
</SelectableListItem>
)}
{optionsInDropDown.map((option) => {
@@ -132,15 +139,28 @@ export const SelectInput = ({
itemId={option.value}
onEnter={() => handleOptionChange(option)}
>
- <MenuItemSelectTag
+ <ListItem
key={option.value}
- selected={selectedOption?.value === option.value}
- text={option.label}
- color={(option.color as TagColor) ?? 'transparent'}
onClick={() => handleOptionChange(option)}
- LeftIcon={option.Icon}
- isKeySelected={selectedItemId === option.value}
- />
+ focused={selectedItemId === option.value}
+ role="option"
+ aria-selected={selectedOption?.value === option.value}
+ selected={selectedOption?.value === option.value}
+ indicator="check"
+ >
+ <Tag
+ color={(option.color as TagColor) ?? 'transparent'}
+ borderStyle="dashed"
+ variant={'soft'}
+ startIcon={
+ isDefined(option.Icon)
+ ? createElement(option.Icon)
+ : undefined
+ }
+ >
+ {option.label}
+ </Tag>
+ </ListItem>
</SelectableListItem>
);
})}
diff --git a/packages/twenty-front/src/modules/ui/input/components/SelectOptionIcon.tsx b/packages/twenty-front/src/modules/ui/input/components/SelectOptionIcon.tsx
new file mode 100644
index 00000000000..9117bc6e59d
--- /dev/null
+++ b/packages/twenty-front/src/modules/ui/input/components/SelectOptionIcon.tsx
@@ -0,0 +1,31 @@
+import { isDefined } from 'twenty-shared/utils';
+import { type IconComponent } from 'twenty-ui/icon';
+import { TintedIconTile } from 'twenty-ui/primitives/data-display';
+import { type ThemeColor } from 'twenty-ui/theme';
+import { useTheme } from 'twenty-ui/theme-constants';
+
+type SelectOptionIconProps = {
+ Icon?: IconComponent | null;
+ color?: ThemeColor | null;
+};
+
+export const SelectOptionIcon = ({ Icon, color }: SelectOptionIconProps) => {
+ const theme = useTheme();
+
+ if (!isDefined(Icon)) {
+ return null;
+ }
+
+ if (isDefined(color)) {
+ return (
+ <TintedIconTile
+ Icon={Icon}
+ color={color}
+ size={theme.icon.size.md}
+ stroke={theme.icon.stroke.sm}
+ />
+ );
+ }
+
+ return <Icon size={theme.icon.size.md} stroke={theme.icon.stroke.sm} />;
+};
diff --git a/packages/twenty-front/src/modules/ui/input/components/ThemeColorPickerMenu.tsx b/packages/twenty-front/src/modules/ui/input/components/ThemeColorPickerMenu.tsx
index 0d11b9f2189..5325dff6c09 100644
--- a/packages/twenty-front/src/modules/ui/input/components/ThemeColorPickerMenu.tsx
+++ b/packages/twenty-front/src/modules/ui/input/components/ThemeColorPickerMenu.tsx
@@ -1,3 +1,5 @@
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
+import { ColorSample } from 'twenty-ui/primitives/data-display';
import { SelectableList } from '@/ui/layout/selectable-list/components/SelectableList';
import { SelectableListItem } from '@/ui/layout/selectable-list/components/SelectableListItem';
import { selectedItemIdComponentState } from '@/ui/layout/selectable-list/states/selectedItemIdComponentState';
@@ -12,7 +14,7 @@ import { isNonEmptyString } from '@sniptt/guards';
import { useState } from 'react';
import {
DEFAULT_COLOR_LABELS,
- MenuItemSelectColor,
+ ListItem,
} from 'twenty-ui/primitives/navigation';
import { type ThemeColor, MAIN_COLOR_NAMES } from 'twenty-ui/theme';
@@ -65,13 +67,19 @@ export const ThemeColorPickerMenu = ({
itemId={colorName}
onEnter={() => onSelectColor(colorName)}
>
- <MenuItemSelectColor
+ <ListItem
focused={selectedItemId === colorName}
onClick={() => onSelectColor(colorName)}
- color={colorName}
+ role="option"
+ aria-selected={colorName === selectedColor}
selected={colorName === selectedColor}
- colorLabels={DEFAULT_COLOR_LABELS}
- />
+ indicator="check"
+ startIcon={<ColorSample colorName={colorName} />}
+ >
+ <OverflowingTextWithTooltip
+ text={DEFAULT_COLOR_LABELS[colorName]}
+ />
+ </ListItem>
</SelectableListItem>
))}
</DropdownMenuItemsContainer>
diff --git a/packages/twenty-front/src/modules/ui/input/components/internal/currency/components/CurrencyPickerDropdownSelect.tsx b/packages/twenty-front/src/modules/ui/input/components/internal/currency/components/CurrencyPickerDropdownSelect.tsx
index a0c5a87a7f7..d3eb2e3bd4e 100644
--- a/packages/twenty-front/src/modules/ui/input/components/internal/currency/components/CurrencyPickerDropdownSelect.tsx
+++ b/packages/twenty-front/src/modules/ui/input/components/internal/currency/components/CurrencyPickerDropdownSelect.tsx
@@ -1,3 +1,4 @@
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { t } from '@lingui/core/macro';
import { useMemo, useState } from 'react';
@@ -8,10 +9,7 @@ import { DropdownMenuSeparator } from '@/ui/layout/dropdown/components/DropdownM
import { CURRENCIES } from '@/settings/data-model/constants/Currencies';
import { type Currency } from '@/ui/input/components/internal/types/Currency';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
-import {
- MenuItem,
- MenuItemSelectAvatar,
-} from 'twenty-ui/primitives/navigation';
+import { MenuItem, ListItem } from 'twenty-ui/primitives/navigation';
export const CurrencyPickerDropdownSelect = ({
selectedCurrency,
@@ -49,21 +47,31 @@ export const CurrencyPickerDropdownSelect = ({
) : (
<>
{selectedCurrency && (
- <MenuItemSelectAvatar
+ <ListItem
key={selectedCurrency.value}
- selected={true}
onClick={() => onChange(selectedCurrency)}
- text={selectedCurrency.label}
- />
+ role="option"
+ aria-selected={true}
+ selected={true}
+ indicator="check"
+ >
+ <OverflowingTextWithTooltip text={selectedCurrency.label} />
+ </ListItem>
)}
{filteredCurrencies.map((item) =>
selectedCurrency?.value === item.value ? null : (
- <MenuItemSelectAvatar
+ <ListItem
key={item.value}
- selected={selectedCurrency?.value === item.value}
onClick={() => onChange(item)}
- text={`${item.label} (${item.value})`}
- />
+ role="option"
+ aria-selected={selectedCurrency?.value === item.value}
+ selected={selectedCurrency?.value === item.value}
+ indicator="check"
+ >
+ <OverflowingTextWithTooltip
+ text={`${item.label} (${item.value})`}
+ />
+ </ListItem>
),
)}
</>
diff --git a/packages/twenty-front/src/modules/ui/input/components/internal/phone/components/PhoneCountryPickerDropdownSelect.tsx b/packages/twenty-front/src/modules/ui/input/components/internal/phone/components/PhoneCountryPickerDropdownSelect.tsx
index 745614a346a..18f18cfbc7e 100644
--- a/packages/twenty-front/src/modules/ui/input/components/internal/phone/components/PhoneCountryPickerDropdownSelect.tsx
+++ b/packages/twenty-front/src/modules/ui/input/components/internal/phone/components/PhoneCountryPickerDropdownSelect.tsx
@@ -1,3 +1,4 @@
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { t } from '@lingui/core/macro';
import { styled } from '@linaria/react';
import { useMemo, useState } from 'react';
@@ -9,10 +10,7 @@ import { DropdownMenuSeparator } from '@/ui/layout/dropdown/components/DropdownM
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import 'react-phone-number-input/style.css';
-import {
- MenuItem,
- MenuItemSelectAvatar,
-} from 'twenty-ui/primitives/navigation';
+import { MenuItem, ListItem } from 'twenty-ui/primitives/navigation';
import { themeCssVariables } from 'twenty-ui/theme-constants';
const StyledIconContainer = styled.div`
@@ -65,32 +63,44 @@ export const PhoneCountryPickerDropdownSelect = ({
) : (
<>
{selectedCountry && (
- <MenuItemSelectAvatar
+ <ListItem
key={selectedCountry.countryCode}
- selected={true}
onClick={() => onChange(selectedCountry.countryCode)}
- text={`${selectedCountry.countryName} (+${selectedCountry.callingCode})`}
- avatar={
+ role="option"
+ aria-selected={true}
+ selected={true}
+ indicator="check"
+ startIcon={
<StyledIconContainer>
<selectedCountry.Flag />
</StyledIconContainer>
}
- />
+ >
+ <OverflowingTextWithTooltip
+ text={`${selectedCountry.countryName} (+${selectedCountry.callingCode})`}
+ />
+ </ListItem>
)}
{filteredCountries.map(
({ countryCode, countryName, callingCode, Flag }) =>
selectedCountry?.countryCode === countryCode ? null : (
- <MenuItemSelectAvatar
+ <ListItem
key={countryCode}
- selected={selectedCountry?.countryCode === countryCode}
onClick={() => onChange(countryCode)}
- text={`${countryName} (+${callingCode})`}
- avatar={
+ role="option"
+ aria-selected={selectedCountry?.countryCode === countryCode}
+ selected={selectedCountry?.countryCode === countryCode}
+ indicator="check"
+ startIcon={
<StyledIconContainer>
<Flag />
</StyledIconContainer>
}
- />
+ >
+ <OverflowingTextWithTooltip
+ text={`${countryName} (+${callingCode})`}
+ />
+ </ListItem>
),
)}
</>
diff --git a/packages/twenty-front/src/modules/ui/layout/dropdown/components/DropdownMenuInnerSelect.tsx b/packages/twenty-front/src/modules/ui/layout/dropdown/components/DropdownMenuInnerSelect.tsx
index db8570d33e2..cd69600ff43 100644
--- a/packages/twenty-front/src/modules/ui/layout/dropdown/components/DropdownMenuInnerSelect.tsx
+++ b/packages/twenty-front/src/modules/ui/layout/dropdown/components/DropdownMenuInnerSelect.tsx
@@ -1,3 +1,4 @@
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
@@ -7,7 +8,7 @@ import { styled } from '@linaria/react';
import { useContext } from 'react';
import { IconChevronDown } from 'twenty-ui/icon';
import { type SelectOption } from 'twenty-ui/primitives/input';
-import { MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants';
const StyledDropdownMenuInnerSelectDropdownButton = styled.div`
@@ -59,16 +60,20 @@ export const DropdownMenuInnerSelect = ({
<DropdownContent widthInPixels={widthInPixels}>
<DropdownMenuItemsContainer>
{options.map((selectOption) => (
- <MenuItemSelect
+ <ListItem
key={`dropdown-menu-inner-select-item-${selectOption.value}`}
onClick={() => {
onChange(selectOption);
closeDropdown(dropdownId);
}}
- text={selectOption.label}
disabled={selectOption.disabled}
+ role="option"
+ aria-selected={selectOption.value === selectedOption.value}
selected={selectOption.value === selectedOption.value}
- />
+ indicator="check"
+ >
+ <OverflowingTextWithTooltip text={selectOption.label} />
+ </ListItem>
))}
</DropdownMenuItemsContainer>
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/ui/layout/dropdown/components/DropdownMenuItemsContainer.tsx b/packages/twenty-front/src/modules/ui/layout/dropdown/components/DropdownMenuItemsContainer.tsx
index 5780dc4d947..ec70d79113a 100644
--- a/packages/twenty-front/src/modules/ui/layout/dropdown/components/DropdownMenuItemsContainer.tsx
+++ b/packages/twenty-front/src/modules/ui/layout/dropdown/components/DropdownMenuItemsContainer.tsx
@@ -76,11 +76,13 @@ export const DropdownMenuItemsContainer = ({
children,
hasMaxHeight,
scrollable = true,
+ isMultiSelect = false,
className,
}: {
children: React.ReactNode;
hasMaxHeight?: boolean;
scrollable?: boolean;
+ isMultiSelect?: boolean;
className?: string;
}) => {
return scrollable === true ? (
@@ -90,12 +92,19 @@ export const DropdownMenuItemsContainer = ({
hasMaxHeight ? DROPDOWN_MENU_ITEMS_CONTAINER_MAX_HEIGHT : undefined
}
>
- <StyledExternalContainer role="listbox">
+ <StyledExternalContainer
+ role="listbox"
+ aria-multiselectable={isMultiSelect || undefined}
+ >
<StyledInternalContainer>{children}</StyledInternalContainer>
</StyledExternalContainer>
</StyledScrollableContainer>
) : (
- <StyledExternalContainer role="listbox" className={className}>
+ <StyledExternalContainer
+ role="listbox"
+ aria-multiselectable={isMultiSelect || undefined}
+ className={className}
+ >
<StyledInternalContainer>{children}</StyledInternalContainer>
</StyledExternalContainer>
);
diff --git a/packages/twenty-front/src/modules/ui/layout/tab-list/components/TabListDropdown.tsx b/packages/twenty-front/src/modules/ui/layout/tab-list/components/TabListDropdown.tsx
index fe9f2fb34c8..c560460a686 100644
--- a/packages/twenty-front/src/modules/ui/layout/tab-list/components/TabListDropdown.tsx
+++ b/packages/twenty-front/src/modules/ui/layout/tab-list/components/TabListDropdown.tsx
@@ -1,10 +1,11 @@
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
import { TabAvatar } from '@/ui/layout/tab-list/components/TabAvatar';
import { TabMoreButton } from '@/ui/layout/tab-list/components/TabMoreButton';
import { type SingleTabProps } from '@/ui/layout/tab-list/types/SingleTabProps';
-import { MenuItemSelectAvatar } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
type TabListDropdownProps = {
dropdownId: string;
@@ -47,11 +48,8 @@ export const TabListDropdown = ({
const isDisabled = tab.disabled ?? loading;
return (
- <MenuItemSelectAvatar
+ <ListItem
key={tab.id}
- text={tab.title}
- avatar={<TabAvatar tab={tab} />}
- selected={tab.id === activeTabId}
onClick={
isDisabled
? undefined
@@ -61,7 +59,14 @@ export const TabListDropdown = ({
}
}
disabled={isDisabled}
- />
+ role="option"
+ aria-selected={tab.id === activeTabId}
+ selected={tab.id === activeTabId}
+ indicator="check"
+ startIcon={<TabAvatar tab={tab} />}
+ >
+ <OverflowingTextWithTooltip text={tab.title} />
+ </ListItem>
);
})}
</DropdownMenuItemsContainer>
diff --git a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/MultiWorkspaceDropdownDefaultComponents.tsx b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/MultiWorkspaceDropdownDefaultComponents.tsx
index 400c631a57f..afa82d76e38 100644
--- a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/MultiWorkspaceDropdownDefaultComponents.tsx
+++ b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/MultiWorkspaceDropdownDefaultComponents.tsx
@@ -1,3 +1,4 @@
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { DEFAULT_WORKSPACE_LOGO } from '@/ui/navigation/navigation-drawer/constants/DefaultWorkspaceLogo';
import { useAuth } from '@/auth/hooks/useAuth';
@@ -40,8 +41,8 @@ import {
import { LightIconButton } from 'twenty-ui/components';
import {
MenuItem,
- MenuItemSelectAvatar,
UndecoratedLink,
+ ListItem,
} from 'twenty-ui/primitives/navigation';
import { useIsMobile } from 'twenty-ui/utilities';
import { type AvailableWorkspace } from '~/generated-metadata/graphql';
@@ -172,9 +173,12 @@ export const MultiWorkspaceDropdownDefaultComponents = () => {
handleChange(availableWorkspace);
}}
>
- <MenuItemSelectAvatar
- text={availableWorkspace.displayName ?? t`(No name)`}
- avatar={
+ <ListItem
+ role="option"
+ aria-selected={false}
+ selected={false}
+ indicator="check"
+ startIcon={
<Avatar
name={availableWorkspace.displayName || ''}
src={getAbsoluteImageUrl(
@@ -182,8 +186,11 @@ export const MultiWorkspaceDropdownDefaultComponents = () => {
)}
/>
}
- selected={false}
- />
+ >
+ <OverflowingTextWithTooltip
+ text={availableWorkspace.displayName ?? t`(No name)`}
+ />
+ </ListItem>
</UndecoratedLink>
))}
{availableWorkspacesCount > 4 && (
diff --git a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/components/AvailableWorkspaceItem.tsx b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/components/AvailableWorkspaceItem.tsx
index 536fb7844ec..df87ed55fbb 100644
--- a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/components/AvailableWorkspaceItem.tsx
+++ b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/components/AvailableWorkspaceItem.tsx
@@ -1,8 +1,6 @@
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { Avatar } from 'twenty-ui/primitives/data-display';
-import {
- MenuItemSelectAvatar,
- UndecoratedLink,
-} from 'twenty-ui/primitives/navigation';
+import { UndecoratedLink, ListItem } from 'twenty-ui/primitives/navigation';
import { DEFAULT_WORKSPACE_LOGO } from '@/ui/navigation/navigation-drawer/constants/DefaultWorkspaceLogo';
import { type AvailableWorkspace } from '~/generated-metadata/graphql';
import { useRedirectToWorkspaceDomain } from '@/domain-manager/hooks/useRedirectToWorkspaceDomain';
@@ -48,9 +46,12 @@ export const AvailableWorkspaceItem = ({
handleChange();
}}
>
- <MenuItemSelectAvatar
- text={availableWorkspace.displayName ?? t`(No name)`}
- avatar={
+ <ListItem
+ role="option"
+ aria-selected={isSelected}
+ selected={isSelected}
+ indicator="check"
+ startIcon={
<Avatar
name={availableWorkspace.displayName || ''}
src={getAbsoluteImageUrl(
@@ -58,8 +59,11 @@ export const AvailableWorkspaceItem = ({
)}
/>
}
- selected={isSelected}
- />
+ >
+ <OverflowingTextWithTooltip
+ text={availableWorkspace.displayName ?? t`(No name)`}
+ />
+ </ListItem>
</UndecoratedLink>
);
};
diff --git a/packages/twenty-front/src/modules/views/editable-chip/components/EditableSortChip.tsx b/packages/twenty-front/src/modules/views/editable-chip/components/EditableSortChip.tsx
index 02bd3e29d3a..b1e9b289b0d 100644
--- a/packages/twenty-front/src/modules/views/editable-chip/components/EditableSortChip.tsx
+++ b/packages/twenty-front/src/modules/views/editable-chip/components/EditableSortChip.tsx
@@ -1,3 +1,5 @@
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useFieldMetadataItemByIdOrThrow } from '@/object-metadata/hooks/useFieldMetadataItemByIdOrThrow';
import { useSortSubFieldChoicesForField } from '@/object-metadata/hooks/useSortSubFieldChoicesForField';
import { useRemoveRecordSort } from '@/object-record/record-sort/hooks/useRemoveRecordSort';
@@ -12,7 +14,7 @@ import { SortOrFilterChip } from '@/views/components/SortOrFilterChip';
import { useLingui } from '@lingui/react/macro';
import { isDefined } from 'twenty-shared/utils';
import { IconArrowDown, IconArrowUp } from 'twenty-ui/icon';
-import { MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { ViewSortDirection } from '~/generated-metadata/graphql';
type EditableSortChipProps = {
@@ -98,28 +100,40 @@ export const EditableSortChip = ({ recordSort }: EditableSortChipProps) => {
dropdownComponents={
<DropdownContent>
<DropdownMenuItemsContainer>
- <MenuItemSelect
- LeftIcon={IconArrowUp}
- text={t`Ascending`}
- selected={recordSort.direction === ViewSortDirection.ASC}
+ <ListItem
onClick={() => handleDirectionSelect(ViewSortDirection.ASC)}
- />
- <MenuItemSelect
- LeftIcon={IconArrowDown}
- text={t`Descending`}
- selected={recordSort.direction === ViewSortDirection.DESC}
+ role="option"
+ aria-selected={recordSort.direction === ViewSortDirection.ASC}
+ selected={recordSort.direction === ViewSortDirection.ASC}
+ indicator="check"
+ startIcon={<SelectOptionIcon Icon={IconArrowUp} />}
+ >
+ <OverflowingTextWithTooltip text={t`Ascending`} />
+ </ListItem>
+ <ListItem
onClick={() => handleDirectionSelect(ViewSortDirection.DESC)}
- />
+ role="option"
+ aria-selected={recordSort.direction === ViewSortDirection.DESC}
+ selected={recordSort.direction === ViewSortDirection.DESC}
+ indicator="check"
+ startIcon={<SelectOptionIcon Icon={IconArrowDown} />}
+ >
+ <OverflowingTextWithTooltip text={t`Descending`} />
+ </ListItem>
</DropdownMenuItemsContainer>
<DropdownMenuSeparator />
<DropdownMenuItemsContainer>
{subFieldChoices.options.map((option) => (
- <MenuItemSelect
+ <ListItem
key={option.value}
- text={option.label}
- selected={option.value === subFieldChoices.selectedValue}
onClick={() => handleSubFieldSelect(option.value)}
- />
+ role="option"
+ aria-selected={option.value === subFieldChoices.selectedValue}
+ selected={option.value === subFieldChoices.selectedValue}
+ indicator="check"
+ >
+ <OverflowingTextWithTooltip text={option.label} />
+ </ListItem>
))}
</DropdownMenuItemsContainer>
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowDropdownStepOutputItems.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowDropdownStepOutputItems.tsx
index 574707ad3dc..af575537ae7 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowDropdownStepOutputItems.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowDropdownStepOutputItems.tsx
@@ -1,3 +1,4 @@
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { DropdownMenuHeader } from '@/ui/layout/dropdown/components/DropdownMenuHeader/DropdownMenuHeader';
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
import { DropdownMenuSearchInput } from '@/ui/layout/dropdown/components/DropdownMenuSearchInput';
@@ -23,7 +24,7 @@ import { type StepFilter } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { IconChevronLeft, useIcons } from 'twenty-ui/icon';
import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
-import { MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
type WorkflowDropdownStepOutputItemsProps = {
stepFilter: StepFilter;
@@ -156,20 +157,30 @@ export const WorkflowDropdownStepOutputItems = ({
) : (
<>
{shouldDisplaySubStepObject && (
- <MenuItemSelect
- selected={false}
+ <ListItem
focused={false}
onClick={handleSelectObject}
- text={subStepObjectDisplay?.label ?? ''}
- hasSubMenu={false}
- LeftIcon={
- isDefined(subStepObjectDisplay?.icon)
- ? getIcon(subStepObjectDisplay.icon)
- : undefined
+ role="option"
+ aria-selected={false}
+ selected={false}
+ indicator="check"
+ hasSubmenu={false}
+ description={t`Pick a ${subStepObjectDisplay?.label} record`}
+ startIcon={
+ <SelectOptionIcon
+ Icon={
+ isDefined(subStepObjectDisplay?.icon)
+ ? getIcon(subStepObjectDisplay.icon)
+ : undefined
+ }
+ color={subStepObjectDisplay?.iconColor}
+ />
}
- leftIconColor={subStepObjectDisplay?.iconColor}
- contextualText={t`Pick a ${subStepObjectDisplay?.label} record`}
- />
+ >
+ <OverflowingTextWithTooltip
+ text={subStepObjectDisplay?.label ?? ''}
+ />
+ </ListItem>
)}
{options.length > 0 && shouldDisplaySubStepObject && (
<DropdownMenuSeparator />
@@ -180,26 +191,34 @@ export const WorkflowDropdownStepOutputItems = ({
}
return (
- <MenuItemSelect
+ <ListItem
key={key}
- selected={false}
focused={false}
onClick={() => handleSelectField(key)}
- text={subStep.label || key}
- hasSubMenu={!subStep.isLeaf}
- LeftIcon={
- subStep.icon
- ? getIcon(subStep.icon)
- : getIcon(
- getStepItemIcon({
- itemType: subStep.type,
- }),
- )
- }
- contextualText={
+ role="option"
+ aria-selected={false}
+ selected={false}
+ indicator="check"
+ hasSubmenu={!subStep.isLeaf}
+ description={
subStep.isLeaf ? subStep.value?.toString() : undefined
}
- />
+ startIcon={
+ <SelectOptionIcon
+ Icon={
+ subStep.icon
+ ? getIcon(subStep.icon)
+ : getIcon(
+ getStepItemIcon({
+ itemType: subStep.type,
+ }),
+ )
+ }
+ />
+ }
+ >
+ <OverflowingTextWithTooltip text={subStep.label || key} />
+ </ListItem>
);
})}
</>
diff --git a/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariableSearchResultItems.tsx b/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariableSearchResultItems.tsx
index 5dce3bd58e5..f61900e2bee 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariableSearchResultItems.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariableSearchResultItems.tsx
@@ -1,6 +1,8 @@
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { type WorkflowVariableSearchResult } from '@/workflow/workflow-variables/types/WorkflowVariableSearchResult';
import { useIcons } from 'twenty-ui/icon';
-import { MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
type WorkflowVariableSearchResultItemsProps = {
searchResults: WorkflowVariableSearchResult[];
@@ -14,21 +16,29 @@ export const WorkflowVariableSearchResultItems = ({
const { getIcon } = useIcons();
return searchResults.map((result) => (
- <MenuItemSelect
+ <ListItem
key={JSON.stringify([
result.stepId,
result.path,
result.isLeaf,
result.isFullRecord,
])}
- selected={false}
focused={false}
onClick={() => onSelect(result)}
- text={result.label}
- contextualText={result.breadcrumb}
- LeftIcon={getIcon(result.icon)}
- leftIconColor={result.iconColor}
- hasSubMenu={!result.isLeaf}
- />
+ role="option"
+ aria-selected={false}
+ selected={false}
+ indicator="check"
+ hasSubmenu={!result.isLeaf}
+ description={result.breadcrumb}
+ startIcon={
+ <SelectOptionIcon
+ Icon={getIcon(result.icon)}
+ color={result.iconColor}
+ />
+ }
+ >
+ <OverflowingTextWithTooltip text={result.label} />
+ </ListItem>
));
};
diff --git a/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdownStepItems.tsx b/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdownStepItems.tsx
index c8fe4b85811..6aa12beec29 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdownStepItems.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdownStepItems.tsx
@@ -1,3 +1,4 @@
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { DropdownMenuHeader } from '@/ui/layout/dropdown/components/DropdownMenuHeader/DropdownMenuHeader';
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
import { DropdownMenuSearchInput } from '@/ui/layout/dropdown/components/DropdownMenuSearchInput';
@@ -23,7 +24,7 @@ import {
import { useLingui } from '@lingui/react/macro';
import { isDefined } from 'twenty-shared/utils';
import { IconChevronLeft, useIcons } from 'twenty-ui/icon';
-import { MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
type WorkflowVariablesDropdownStepItemsProps = {
@@ -156,28 +157,44 @@ export const WorkflowVariablesDropdownStepItems = ({
) : (
<>
{specialItems.map((specialItem) => (
- <MenuItemSelect
+ <ListItem
key={specialItem.id}
- selected={false}
focused={false}
onClick={() => handleSelectSpecialItem(specialItem)}
- text={specialItem.label}
- hasSubMenu={false}
- LeftIcon={getIcon(specialItem.iconName)}
- contextualText={specialItem.contextualText}
- />
+ role="option"
+ aria-selected={false}
+ selected={false}
+ indicator="check"
+ hasSubmenu={false}
+ description={specialItem.contextualText}
+ startIcon={
+ <SelectOptionIcon Icon={getIcon(specialItem.iconName)} />
+ }
+ >
+ <OverflowingTextWithTooltip text={specialItem.label} />
+ </ListItem>
))}
{shouldDisplaySubStepObject && (
- <MenuItemSelect
- selected={false}
+ <ListItem
focused={false}
onClick={handleSelectObject}
- text={displayedSubStepObjectDisplay?.label ?? ''}
- hasSubMenu={false}
- LeftIcon={getIcon(displayedSubStepObjectDisplay?.icon)}
- leftIconColor={displayedSubStepObjectDisplay?.iconColor}
- contextualText={t`Pick a ${displayedSubStepObjectDisplay?.label} record`}
- />
+ role="option"
+ aria-selected={false}
+ selected={false}
+ indicator="check"
+ hasSubmenu={false}
+ description={t`Pick a ${displayedSubStepObjectDisplay?.label} record`}
+ startIcon={
+ <SelectOptionIcon
+ Icon={getIcon(displayedSubStepObjectDisplay?.icon)}
+ color={displayedSubStepObjectDisplay?.iconColor}
+ />
+ }
+ >
+ <OverflowingTextWithTooltip
+ text={displayedSubStepObjectDisplay?.label ?? ''}
+ />
+ </ListItem>
)}
{options.length > 0 &&
(shouldDisplaySubStepObject || specialItems.length > 0) && (
@@ -189,26 +206,34 @@ export const WorkflowVariablesDropdownStepItems = ({
}
return (
- <MenuItemSelect
+ <ListItem
key={key}
- selected={false}
focused={false}
onClick={() => handleSelectField(key)}
- text={subStep.label || key}
- hasSubMenu={!subStep.isLeaf}
- LeftIcon={
- subStep.icon
- ? getIcon(subStep.icon)
- : getIcon(
- getStepItemIcon({
- itemType: subStep.type,
- }),
- )
- }
- contextualText={
+ role="option"
+ aria-selected={false}
+ selected={false}
+ indicator="check"
+ hasSubmenu={!subStep.isLeaf}
+ description={
subStep.isLeaf ? subStep.value?.toString() : undefined
}
- />
+ startIcon={
+ <SelectOptionIcon
+ Icon={
+ subStep.icon
+ ? getIcon(subStep.icon)
+ : getIcon(
+ getStepItemIcon({
+ itemType: subStep.type,
+ }),
+ )
+ }
+ />
+ }
+ >
+ <OverflowingTextWithTooltip text={subStep.label || key} />
+ </ListItem>
);
})}
</>
diff --git a/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdownSteps.tsx b/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdownSteps.tsx
index f4c88ac68c6..ea43adc6e27 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdownSteps.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdownSteps.tsx
@@ -1,3 +1,4 @@
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { DropdownMenuHeader } from '@/ui/layout/dropdown/components/DropdownMenuHeader/DropdownMenuHeader';
import { DropdownMenuHeaderLeftComponent } from '@/ui/layout/dropdown/components/DropdownMenuHeader/internal/DropdownMenuHeaderLeftComponent';
@@ -20,7 +21,7 @@ import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { IconX, useIcons } from 'twenty-ui/icon';
import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
-import { MenuItem, MenuItemSelect } from 'twenty-ui/primitives/navigation';
+import { MenuItem, ListItem } from 'twenty-ui/primitives/navigation';
type WorkflowVariablesDropdownStepsProps = {
dropdownId: string;
@@ -97,15 +98,23 @@ export const WorkflowVariablesDropdownSteps = ({
<DropdownMenuSeparator />
)}
{availableSteps.map((item) => (
- <MenuItemSelect
+ <ListItem
key={`step-${item.id}`}
- selected={false}
focused={false}
onClick={() => onSelect({ stepId: item.id })}
- text={item.name}
- LeftIcon={item.icon ? getIcon(item.icon) : undefined}
- hasSubMenu
- />
+ role="option"
+ aria-selected={false}
+ selected={false}
+ indicator="check"
+ hasSubmenu={true}
+ startIcon={
+ <SelectOptionIcon
+ Icon={item.icon ? getIcon(item.icon) : undefined}
+ />
+ }
+ >
+ <OverflowingTextWithTooltip text={item.name} />
+ </ListItem>
))}
{matchingVariables.length === 0 && availableSteps.length === 0 && (
<MenuItem
diff --git a/packages/twenty-ui/.size-limit.json b/packages/twenty-ui/.size-limit.json
index 7f9216244eb..d57ea39d658 100644
--- a/packages/twenty-ui/.size-limit.json
+++ b/packages/twenty-ui/.size-limit.json
@@ -13,7 +13,7 @@
{
"name": "components",
"path": "dist/components.mjs",
- "limit": "95 kB"
+ "limit": "96 kB"
},
{
"name": "components/code-editor",
diff --git a/packages/twenty-ui/src/primitives/navigation/ListItem/ListItem.module.scss b/packages/twenty-ui/src/primitives/navigation/ListItem/ListItem.module.scss
index daf02751c9d..fda1d36465a 100644
--- a/packages/twenty-ui/src/primitives/navigation/ListItem/ListItem.module.scss
+++ b/packages/twenty-ui/src/primitives/navigation/ListItem/ListItem.module.scss
@@ -58,6 +58,10 @@
display: inline-flex;
flex: none;
+ &:empty {
+ display: none;
+ }
+
> svg {
block-size: calc(var(--t-icon-size-md) * 1px);
inline-size: calc(var(--t-icon-size-md) * 1px);
diff --git a/packages/twenty-ui/src/primitives/navigation/ListItem/__stories__/ListItemAvatarMultiSelect.stories.tsx b/packages/twenty-ui/src/primitives/navigation/ListItem/__stories__/ListItemAvatarMultiSelect.stories.tsx
new file mode 100644
index 00000000000..b9e72df619c
--- /dev/null
+++ b/packages/twenty-ui/src/primitives/navigation/ListItem/__stories__/ListItemAvatarMultiSelect.stories.tsx
@@ -0,0 +1,92 @@
+import { type Meta, type StoryObj } from '@storybook/react-vite';
+import { expect, fn, userEvent, within } from 'storybook/test';
+import { Avatar } from '@ui/primitives/data-display';
+import {
+ A11Y_DEFER_COLOR_CONTRAST,
+ CatalogDecorator,
+ ComponentDecorator,
+ type CatalogStory,
+} from '@ui/testing';
+import { ListItem } from '../ListItem';
+
+const meta: Meta<typeof ListItem> = {
+ title: 'UI/Navigation/Menu/MenuItem/MenuItemMultiSelectAvatar',
+ component: ListItem,
+ args: {
+ role: 'option',
+ 'aria-selected': false,
+ indicator: 'checkbox',
+ startIcon: <Avatar name="Alex Morgan" size="md" />,
+ children: 'Alex Morgan',
+ description: 'Person',
+ },
+};
+
+export default meta;
+type Story = StoryObj<typeof ListItem>;
+
+export const Default: Story = {
+ decorators: [
+ ComponentDecorator,
+ (Story) => (
+ <div role="listbox" aria-label="Options">
+ <Story />
+ </div>
+ ),
+ ],
+ parameters: { a11y: A11Y_DEFER_COLOR_CONTRAST, container: { width: 240 } },
+};
+
+export const ClickingCheckboxSelectsOnce: Story = {
+ ...Default,
+ args: { onClick: fn() },
+ play: async ({ canvasElement, args }) => {
+ const row = within(canvasElement).getByRole('option');
+ const indicator = row.querySelector('span[aria-hidden="true"]');
+
+ await expect(indicator).not.toBeNull();
+ await userEvent.click(indicator as HTMLElement);
+ await expect(args.onClick).toHaveBeenCalledTimes(1);
+ },
+};
+
+export const Catalog: CatalogStory<Story, typeof ListItem> = {
+ decorators: [
+ CatalogDecorator,
+ (Story) => (
+ <div role="listbox" aria-label="Options">
+ <Story />
+ </div>
+ ),
+ ],
+ parameters: {
+ a11y: A11Y_DEFER_COLOR_CONTRAST,
+ catalog: {
+ dimensions: [
+ {
+ name: 'selected',
+ values: [false, true],
+ props: (selected: boolean) => ({
+ selected,
+ 'aria-selected': selected,
+ }),
+ },
+ {
+ name: 'state',
+ values: ['default', 'focused', 'disabled'],
+ props: (state: string) => ({
+ focused: state === 'focused',
+ disabled: state === 'disabled',
+ }),
+ },
+ ],
+ options: { elementContainer: { style: { width: 180 } } },
+ },
+ },
+};
+
+export const CatalogDark: CatalogStory<Story, typeof ListItem> = {
+ ...Catalog,
+ tags: ['!autodocs'],
+ globals: { colorScheme: 'dark' },
+};
diff --git a/packages/twenty-ui/src/primitives/navigation/ListItem/__stories__/ListItemAvatarSelect.stories.tsx b/packages/twenty-ui/src/primitives/navigation/ListItem/__stories__/ListItemAvatarSelect.stories.tsx
new file mode 100644
index 00000000000..3022113f2d5
--- /dev/null
+++ b/packages/twenty-ui/src/primitives/navigation/ListItem/__stories__/ListItemAvatarSelect.stories.tsx
@@ -0,0 +1,78 @@
+import { type Meta, type StoryObj } from '@storybook/react-vite';
+import { Avatar } from '@ui/primitives/data-display';
+import {
+ A11Y_DEFER_COLOR_CONTRAST,
+ CatalogDecorator,
+ ComponentDecorator,
+ type CatalogStory,
+} from '@ui/testing';
+import { ListItem } from '../ListItem';
+
+const meta: Meta<typeof ListItem> = {
+ title: 'UI/Navigation/Menu/MenuItem/MenuItemSelectAvatar',
+ component: ListItem,
+ args: {
+ role: 'option',
+ 'aria-selected': false,
+ indicator: 'check',
+ startIcon: <Avatar name="Alex Morgan" size="md" />,
+ children: 'Alex Morgan',
+ description: 'Person',
+ },
+};
+
+export default meta;
+type Story = StoryObj<typeof ListItem>;
+
+export const Default: Story = {
+ decorators: [
+ ComponentDecorator,
+ (Story) => (
+ <div role="listbox" aria-label="Options">
+ <Story />
+ </div>
+ ),
+ ],
+ parameters: { a11y: A11Y_DEFER_COLOR_CONTRAST, container: { width: 240 } },
+};
+
+export const Catalog: CatalogStory<Story, typeof ListItem> = {
+ decorators: [
+ CatalogDecorator,
+ (Story) => (
+ <div role="listbox" aria-label="Options">
+ <Story />
+ </div>
+ ),
+ ],
+ parameters: {
+ a11y: A11Y_DEFER_COLOR_CONTRAST,
+ catalog: {
+ dimensions: [
+ {
+ name: 'selected',
+ values: [false, true],
+ props: (selected: boolean) => ({
+ selected,
+ 'aria-selected': selected,
+ }),
+ },
+ {
+ name: 'state',
+ values: ['default', 'focused', 'disabled'],
+ props: (state: string) => ({
+ focused: state === 'focused',
+ disabled: state === 'disabled',
+ }),
+ },
+ ],
+ options: { elementContainer: { style: { width: 180 } } },
+ },
+ },
+};
+
+export const CatalogDark: CatalogStory<Story, typeof ListItem> = {
+ ...Catalog,
+ tags: ['!autodocs'],
+ globals: { colorScheme: 'dark' },
+};
diff --git a/packages/twenty-ui/src/primitives/navigation/ListItem/__stories__/ListItemColorSelect.stories.tsx b/packages/twenty-ui/src/primitives/navigation/ListItem/__stories__/ListItemColorSelect.stories.tsx
new file mode 100644
index 00000000000..50b1268e902
--- /dev/null
+++ b/packages/twenty-ui/src/primitives/navigation/ListItem/__stories__/ListItemColorSelect.stories.tsx
@@ -0,0 +1,77 @@
+import { type Meta, type StoryObj } from '@storybook/react-vite';
+import { ColorSample } from '@ui/primitives/data-display';
+import {
+ A11Y_DEFER_COLOR_CONTRAST,
+ CatalogDecorator,
+ ComponentDecorator,
+ type CatalogStory,
+} from '@ui/testing';
+import { ListItem } from '../ListItem';
+
+const meta: Meta<typeof ListItem> = {
+ title: 'UI/Navigation/Menu/MenuItem/MenuItemSelectColor',
+ component: ListItem,
+ args: {
+ role: 'option',
+ 'aria-selected': false,
+ indicator: 'check',
+ startIcon: <ColorSample colorName="blue" />,
+ children: 'Blue',
+ },
+};
+
+export default meta;
+type Story = StoryObj<typeof ListItem>;
+
+export const Default: Story = {
+ decorators: [
+ ComponentDecorator,
+ (Story) => (
+ <div role="listbox" aria-label="Options">
+ <Story />
+ </div>
+ ),
+ ],
+ parameters: { container: { width: 240 } },
+};
+
+export const Catalog: CatalogStory<Story, typeof ListItem> = {
+ decorators: [
+ CatalogDecorator,
+ (Story) => (
+ <div role="listbox" aria-label="Options">
+ <Story />
+ </div>
+ ),
+ ],
+ parameters: {
+ a11y: A11Y_DEFER_COLOR_CONTRAST,
+ catalog: {
+ dimensions: [
+ {
+ name: 'selected',
+ values: [false, true],
+ props: (selected: boolean) => ({
+ selected,
+ 'aria-selected': selected,
+ }),
+ },
+ {
+ name: 'state',
+ values: ['default', 'focused', 'disabled'],
+ props: (state: string) => ({
+ focused: state === 'focused',
+ disabled: state === 'disabled',
+ }),
+ },
+ ],
+ options: { elementContainer: { style: { width: 180 } } },
+ },
+ },
+};
+
+export const CatalogDark: CatalogStory<Story, typeof ListItem> = {
+ ...Catalog,
+ tags: ['!autodocs'],
+ globals: { colorScheme: 'dark' },
+};
diff --git a/packages/twenty-ui/src/primitives/navigation/ListItem/__stories__/ListItemMultiSelect.stories.tsx b/packages/twenty-ui/src/primitives/navigation/ListItem/__stories__/ListItemMultiSelect.stories.tsx
new file mode 100644
index 00000000000..d8a95aa685a
--- /dev/null
+++ b/packages/twenty-ui/src/primitives/navigation/ListItem/__stories__/ListItemMultiSelect.stories.tsx
@@ -0,0 +1,77 @@
+import { type Meta, type StoryObj } from '@storybook/react-vite';
+import { IconBell } from '@ui/icon';
+import {
+ A11Y_DEFER_COLOR_CONTRAST,
+ CatalogDecorator,
+ ComponentDecorator,
+ type CatalogStory,
+} from '@ui/testing';
+import { ListItem } from '../ListItem';
+
+const meta: Meta<typeof ListItem> = {
+ title: 'UI/Navigation/Menu/MenuItem/MenuItemMultiSelect',
+ component: ListItem,
+ args: {
+ role: 'option',
+ 'aria-selected': false,
+ indicator: 'checkbox',
+ startIcon: <IconBell />,
+ children: 'First option',
+ },
+};
+
+export default meta;
+type Story = StoryObj<typeof ListItem>;
+
+export const Default: Story = {
+ decorators: [
+ ComponentDecorator,
+ (Story) => (
+ <div role="listbox" aria-label="Options">
+ <Story />
+ </div>
+ ),
+ ],
+ parameters: { container: { width: 240 } },
+};
+
+export const Catalog: CatalogStory<Story, typeof ListItem> = {
+ decorators: [
+ CatalogDecorator,
+ (Story) => (
+ <div role="listbox" aria-label="Options">
+ <Story />
+ </div>
+ ),
+ ],
+ parameters: {
+ a11y: A11Y_DEFER_COLOR_CONTRAST,
+ catalog: {
+ dimensions: [
+ {
+ name: 'selected',
+ values: [false, true],
+ props: (selected: boolean) => ({
+ selected,
+ 'aria-selected': selected,
+ }),
+ },
+ {
+ name: 'state',
+ values: ['default', 'focused', 'disabled'],
+ props: (state: string) => ({
+ focused: state === 'focused',
+ disabled: state === 'disabled',
+ }),
+ },
+ ],
+ options: { elementContainer: { style: { width: 180 } } },
+ },
+ },
+};
+
+export const CatalogDark: CatalogStory<Story, typeof ListItem> = {
+ ...Catalog,
+ tags: ['!autodocs'],
+ globals: { colorScheme: 'dark' },
+};
diff --git a/packages/twenty-ui/src/primitives/navigation/ListItem/__stories__/ListItemPicker.stories.tsx b/packages/twenty-ui/src/primitives/navigation/ListItem/__stories__/ListItemPicker.stories.tsx
new file mode 100644
index 00000000000..f022e6135fa
--- /dev/null
+++ b/packages/twenty-ui/src/primitives/navigation/ListItem/__stories__/ListItemPicker.stories.tsx
@@ -0,0 +1,26 @@
+import { type Meta, type StoryObj } from '@storybook/react-vite';
+
+import { ComponentDecorator } from '@ui/testing';
+
+import { ListItemPickerExample } from './ListItemPickerExample';
+
+const meta: Meta<typeof ListItemPickerExample> = {
+ title: 'UI/Navigation/ListItem/Picker',
+ component: ListItemPickerExample,
+ decorators: [ComponentDecorator],
+ parameters: { container: { width: 280 } },
+};
+
+export default meta;
+type Story = StoryObj<typeof ListItemPickerExample>;
+
+export const SingleSelection: Story = {};
+
+export const MultipleSelection: Story = {
+ args: { multiple: true },
+};
+
+export const MultipleSelectionDark: Story = {
+ ...MultipleSelection,
+ globals: { colorScheme: 'dark' },
+};
diff --git a/packages/twenty-ui/src/primitives/navigation/ListItem/__stories__/ListItemPickerExample.tsx b/packages/twenty-ui/src/primitives/navigation/ListItem/__stories__/ListItemPickerExample.tsx
new file mode 100644
index 00000000000..600b9a9db23
--- /dev/null
+++ b/packages/twenty-ui/src/primitives/navigation/ListItem/__stories__/ListItemPickerExample.tsx
@@ -0,0 +1,53 @@
+import { useState } from 'react';
+
+import { Avatar, Tag } from '@ui/primitives/data-display';
+import { ListItem } from '@ui/primitives/navigation/ListItem/ListItem';
+
+type ListItemPickerExampleProps = {
+ multiple?: boolean;
+ onSelectionChange?: (selection: string[]) => void;
+};
+
+const PEOPLE = ['Alex Morgan', 'Sam Taylor', 'Unavailable teammate'];
+
+export const ListItemPickerExample = ({
+ multiple = false,
+ onSelectionChange,
+}: ListItemPickerExampleProps) => {
+ const [selection, setSelection] = useState<string[]>([]);
+
+ const handleSelect = (name: string) => {
+ const nextSelection = multiple
+ ? selection.includes(name)
+ ? selection.filter((selectedName) => selectedName !== name)
+ : [...selection, name]
+ : [name];
+
+ setSelection(nextSelection);
+ onSelectionChange?.(nextSelection);
+ };
+
+ return (
+ <div role="group" aria-label="Teammates">
+ {PEOPLE.map((name) => {
+ const selected = selection.includes(name);
+ const disabled = name === 'Unavailable teammate';
+
+ return (
+ <ListItem
+ key={name}
+ render={<button type="button" disabled={disabled} />}
+ aria-pressed={selected}
+ selected={selected}
+ disabled={disabled}
+ indicator={multiple ? 'checkbox' : 'check'}
+ startIcon={multiple ? undefined : <Avatar name={name} size="md" />}
+ onClick={() => handleSelect(name)}
+ >
+ {multiple ? <Tag color="blue">{name}</Tag> : name}
+ </ListItem>
+ );
+ })}
+ </div>
+ );
+};
diff --git a/packages/twenty-ui/src/primitives/navigation/ListItem/__stories__/ListItemPickerInteractions.stories.tsx b/packages/twenty-ui/src/primitives/navigation/ListItem/__stories__/ListItemPickerInteractions.stories.tsx
new file mode 100644
index 00000000000..cb7c02e64fc
--- /dev/null
+++ b/packages/twenty-ui/src/primitives/navigation/ListItem/__stories__/ListItemPickerInteractions.stories.tsx
@@ -0,0 +1,79 @@
+import { type Meta, type StoryObj } from '@storybook/react-vite';
+import { expect, fn, userEvent, within } from 'storybook/test';
+
+import { ComponentDecorator } from '@ui/testing';
+
+import { ListItemPickerExample } from './ListItemPickerExample';
+
+const meta: Meta<typeof ListItemPickerExample> = {
+ title: 'UI/Navigation/ListItem/Picker interactions',
+ component: ListItemPickerExample,
+ decorators: [ComponentDecorator],
+ parameters: { container: { width: 280 } },
+ args: { onSelectionChange: fn() },
+};
+
+export default meta;
+type Story = StoryObj<typeof ListItemPickerExample>;
+
+export const SingleSelection: Story = {
+ play: async ({ canvasElement, args }) => {
+ const canvas = within(canvasElement);
+ const alex = canvas.getByRole('button', { name: 'Alex Morgan' });
+ const sam = canvas.getByRole('button', { name: 'Sam Taylor' });
+
+ await userEvent.click(alex);
+ await expect(alex).toHaveAttribute('aria-pressed', 'true');
+ sam.focus();
+ await userEvent.keyboard('{Enter}');
+ await expect(sam).toHaveAttribute('aria-pressed', 'true');
+ await expect(alex).toHaveAttribute('aria-pressed', 'false');
+ await expect(args.onSelectionChange).toHaveBeenCalledTimes(2);
+ await expect(args.onSelectionChange).toHaveBeenLastCalledWith([
+ 'Sam Taylor',
+ ]);
+ },
+};
+
+export const MultipleSelection: Story = {
+ args: { multiple: true },
+ play: async ({ canvasElement, args }) => {
+ const canvas = within(canvasElement);
+ const alex = canvas.getByRole('button', { name: 'Alex Morgan' });
+ const sam = canvas.getByRole('button', { name: 'Sam Taylor' });
+ const indicator = alex.querySelector('span[aria-hidden="true"]');
+
+ await expect(indicator).not.toBeNull();
+ await userEvent.click(indicator as HTMLElement);
+ await expect(alex).toHaveAttribute('aria-pressed', 'true');
+ await expect(args.onSelectionChange).toHaveBeenCalledTimes(1);
+ await userEvent.click(sam);
+ alex.focus();
+ await userEvent.keyboard(' ');
+ await expect(alex).toHaveAttribute('aria-pressed', 'false');
+ await expect(sam).toHaveAttribute('aria-pressed', 'true');
+ await expect(args.onSelectionChange).toHaveBeenCalledTimes(3);
+ await expect(args.onSelectionChange).toHaveBeenLastCalledWith([
+ 'Sam Taylor',
+ ]);
+ await expect(canvas.queryByRole('checkbox')).toBeNull();
+ },
+};
+
+export const DisabledSelection: Story = {
+ args: { multiple: true },
+ play: async ({ canvasElement, args }) => {
+ const canvas = within(canvasElement);
+ const disabled = canvas.getByRole('button', {
+ name: 'Unavailable teammate',
+ });
+
+ await userEvent.click(disabled);
+ await expect(disabled).toBeDisabled();
+ await expect(disabled).toHaveAttribute('aria-pressed', 'false');
+ await expect(args.onSelectionChange).not.toHaveBeenCalled();
+ canvas.getByRole('button', { name: 'Sam Taylor' }).focus();
+ await userEvent.tab();
+ await expect(disabled).not.toHaveFocus();
+ },
+};
diff --git a/packages/twenty-ui/src/primitives/navigation/ListItem/__stories__/ListItemSingleSelect.stories.tsx b/packages/twenty-ui/src/primitives/navigation/ListItem/__stories__/ListItemSingleSelect.stories.tsx
new file mode 100644
index 00000000000..c35f2bfc4bb
--- /dev/null
+++ b/packages/twenty-ui/src/primitives/navigation/ListItem/__stories__/ListItemSingleSelect.stories.tsx
@@ -0,0 +1,77 @@
+import { type Meta, type StoryObj } from '@storybook/react-vite';
+import { IconBell } from '@ui/icon';
+import {
+ A11Y_DEFER_COLOR_CONTRAST,
+ CatalogDecorator,
+ ComponentDecorator,
+ type CatalogStory,
+} from '@ui/testing';
+import { ListItem } from '../ListItem';
+
+const meta: Meta<typeof ListItem> = {
+ title: 'UI/Navigation/Menu/MenuItem/MenuItemSelect',
+ component: ListItem,
+ args: {
+ role: 'option',
+ 'aria-selected': false,
+ indicator: 'check',
+ startIcon: <IconBell />,
+ children: 'First option',
+ },
+};
+
+export default meta;
+type Story = StoryObj<typeof ListItem>;
+
+export const Default: Story = {
+ decorators: [
+ ComponentDecorator,
+ (Story) => (
+ <div role="listbox" aria-label="Options">
+ <Story />
+ </div>
+ ),
+ ],
+ parameters: { container: { width: 240 } },
+};
+
+export const Catalog: CatalogStory<Story, typeof ListItem> = {
+ decorators: [
+ CatalogDecorator,
+ (Story) => (
+ <div role="listbox" aria-label="Options">
+ <Story />
+ </div>
+ ),
+ ],
+ parameters: {
+ a11y: A11Y_DEFER_COLOR_CONTRAST,
+ catalog: {
+ dimensions: [
+ {
+ name: 'selected',
+ values: [false, true],
+ props: (selected: boolean) => ({
+ selected,
+ 'aria-selected': selected,
+ }),
+ },
+ {
+ name: 'state',
+ values: ['default', 'focused', 'disabled'],
+ props: (state: string) => ({
+ focused: state === 'focused',
+ disabled: state === 'disabled',
+ }),
+ },
+ ],
+ options: { elementContainer: { style: { width: 180 } } },
+ },
+ },
+};
+
+export const CatalogDark: CatalogStory<Story, typeof ListItem> = {
+ ...Catalog,
+ tags: ['!autodocs'],
+ globals: { colorScheme: 'dark' },
+};
diff --git a/packages/twenty-ui/src/primitives/navigation/ListItem/__stories__/ListItemTagMultiSelect.stories.tsx b/packages/twenty-ui/src/primitives/navigation/ListItem/__stories__/ListItemTagMultiSelect.stories.tsx
new file mode 100644
index 00000000000..eb09107fdc6
--- /dev/null
+++ b/packages/twenty-ui/src/primitives/navigation/ListItem/__stories__/ListItemTagMultiSelect.stories.tsx
@@ -0,0 +1,76 @@
+import { type Meta, type StoryObj } from '@storybook/react-vite';
+import { Tag } from '@ui/primitives/data-display';
+import {
+ A11Y_DEFER_COLOR_CONTRAST,
+ CatalogDecorator,
+ ComponentDecorator,
+ type CatalogStory,
+} from '@ui/testing';
+import { ListItem } from '../ListItem';
+
+const meta: Meta<typeof ListItem> = {
+ title: 'UI/Navigation/Menu/MenuItem/MenuItemMultiSelectTag',
+ component: ListItem,
+ args: {
+ role: 'option',
+ 'aria-selected': false,
+ indicator: 'checkbox',
+ children: <Tag color="blue">Qualified</Tag>,
+ },
+};
+
+export default meta;
+type Story = StoryObj<typeof ListItem>;
+
+export const Default: Story = {
+ decorators: [
+ ComponentDecorator,
+ (Story) => (
+ <div role="listbox" aria-label="Options">
+ <Story />
+ </div>
+ ),
+ ],
+ parameters: { container: { width: 240 } },
+};
+
+export const Catalog: CatalogStory<Story, typeof ListItem> = {
+ decorators: [
+ CatalogDecorator,
+ (Story) => (
+ <div role="listbox" aria-label="Options">
+ <Story />
+ </div>
+ ),
+ ],
+ parameters: {
+ a11y: A11Y_DEFER_COLOR_CONTRAST,
+ catalog: {
+ dimensions: [
+ {
+ name: 'selected',
+ values: [false, true],
+ props: (selected: boolean) => ({
+ selected,
+ 'aria-selected': selected,
+ }),
+ },
+ {
+ name: 'state',
+ values: ['default', 'focused', 'disabled'],
+ props: (state: string) => ({
+ focused: state === 'focused',
+ disabled: state === 'disabled',
+ }),
+ },
+ ],
+ options: { elementContainer: { style: { width: 180 } } },
+ },
+ },
+};
+
+export const CatalogDark: CatalogStory<Story, typeof ListItem> = {
+ ...Catalog,
+ tags: ['!autodocs'],
+ globals: { colorScheme: 'dark' },
+};
diff --git a/packages/twenty-ui/src/primitives/navigation/ListItem/__stories__/ListItemTagSelect.stories.tsx b/packages/twenty-ui/src/primitives/navigation/ListItem/__stories__/ListItemTagSelect.stories.tsx
new file mode 100644
index 00000000000..ab3df40fdef
--- /dev/null
+++ b/packages/twenty-ui/src/primitives/navigation/ListItem/__stories__/ListItemTagSelect.stories.tsx
@@ -0,0 +1,81 @@
+import { type Meta, type StoryObj } from '@storybook/react-vite';
+import { Tag } from '@ui/primitives/data-display';
+import {
+ A11Y_DEFER_COLOR_CONTRAST,
+ CatalogDecorator,
+ ComponentDecorator,
+ type CatalogStory,
+} from '@ui/testing';
+import { ListItem } from '../ListItem';
+
+const meta: Meta<typeof ListItem> = {
+ title: 'UI/Navigation/Menu/MenuItem/MenuItemSelectTag',
+ component: ListItem,
+ args: {
+ role: 'option',
+ 'aria-selected': false,
+ indicator: 'check',
+ children: <Tag color="blue">Qualified</Tag>,
+ },
+};
+
+export default meta;
+type Story = StoryObj<typeof ListItem>;
+
+export const Default: Story = {
+ decorators: [
+ ComponentDecorator,
+ (Story) => (
+ <div role="listbox" aria-label="Options">
+ <Story />
+ </div>
+ ),
+ ],
+ parameters: { container: { width: 240 } },
+};
+
+export const Selected: Story = {
+ ...Default,
+ args: { selected: true, 'aria-selected': true },
+};
+
+export const Catalog: CatalogStory<Story, typeof ListItem> = {
+ decorators: [
+ CatalogDecorator,
+ (Story) => (
+ <div role="listbox" aria-label="Options">
+ <Story />
+ </div>
+ ),
+ ],
+ parameters: {
+ a11y: A11Y_DEFER_COLOR_CONTRAST,
+ catalog: {
+ dimensions: [
+ {
+ name: 'selected',
+ values: [false, true],
+ props: (selected: boolean) => ({
+ selected,
+ 'aria-selected': selected,
+ }),
+ },
+ {
+ name: 'state',
+ values: ['default', 'focused', 'disabled'],
+ props: (state: string) => ({
+ focused: state === 'focused',
+ disabled: state === 'disabled',
+ }),
+ },
+ ],
+ options: { elementContainer: { style: { width: 180 } } },
+ },
+ },
+};
+
+export const CatalogDark: CatalogStory<Story, typeof ListItem> = {
+ ...Catalog,
+ tags: ['!autodocs'],
+ globals: { colorScheme: 'dark' },
+};
diff --git a/packages/twenty-ui/src/primitives/navigation/MenuItem/parts/MenuItemMultiSelectCheckbox.module.scss b/packages/twenty-ui/src/primitives/navigation/MenuItem/parts/MenuItemMultiSelectCheckbox.module.scss
deleted file mode 100644
index 7775d22c6ba..00000000000
--- a/packages/twenty-ui/src/primitives/navigation/MenuItem/parts/MenuItemMultiSelectCheckbox.module.scss
+++ /dev/null
@@ -1,4 +0,0 @@
-.container {
- align-items: center;
- display: flex;
-}
diff --git a/packages/twenty-ui/src/primitives/navigation/MenuItem/parts/MenuItemMultiSelectCheckbox.module.scss.d.ts b/packages/twenty-ui/src/primitives/navigation/MenuItem/parts/MenuItemMultiSelectCheckbox.module.scss.d.ts
deleted file mode 100644
index 8df71b4dead..00000000000
--- a/packages/twenty-ui/src/primitives/navigation/MenuItem/parts/MenuItemMultiSelectCheckbox.module.scss.d.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-declare const classNames: {
- readonly container: 'container';
-};
-export default classNames;
diff --git a/packages/twenty-ui/src/primitives/navigation/MenuItem/parts/MenuItemMultiSelectCheckbox.tsx b/packages/twenty-ui/src/primitives/navigation/MenuItem/parts/MenuItemMultiSelectCheckbox.tsx
deleted file mode 100644
index 86432c55009..00000000000
--- a/packages/twenty-ui/src/primitives/navigation/MenuItem/parts/MenuItemMultiSelectCheckbox.tsx
+++ /dev/null
@@ -1,30 +0,0 @@
-import { Checkbox } from '@ui/primitives/input/Checkbox/Checkbox';
-
-import styles from './MenuItemMultiSelectCheckbox.module.scss';
-
-type MenuItemMultiSelectCheckboxProps = {
- selected: boolean;
- onSelectChange?: (selected: boolean) => void;
- ariaLabel?: string;
-};
-
-export const MenuItemMultiSelectCheckbox = ({
- selected,
- onSelectChange,
- ariaLabel,
-}: MenuItemMultiSelectCheckboxProps) => {
- // The surrounding row also toggles selection on click.
- return (
- // oxlint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events
- <div
- className={styles.container}
- onClick={(event) => event.stopPropagation()}
- >
- <Checkbox
- checked={selected}
- onCheckedChange={(checked) => onSelectChange?.(checked)}
- aria-label={ariaLabel}
- />
- </div>
- );
-};
diff --git a/packages/twenty-ui/src/primitives/navigation/MenuItemMultiSelect/MenuItemMultiSelect.module.scss b/packages/twenty-ui/src/primitives/navigation/MenuItemMultiSelect/MenuItemMultiSelect.module.scss
deleted file mode 100644
index b097b1aa43d..00000000000
--- a/packages/twenty-ui/src/primitives/navigation/MenuItemMultiSelect/MenuItemMultiSelect.module.scss
+++ /dev/null
@@ -1,8 +0,0 @@
-.leftContentWithCheckboxContainer {
- align-items: center;
- display: flex;
- flex-direction: row;
- gap: var(--t-spacing-2);
- min-width: 0;
- overflow: hidden;
-}
diff --git a/packages/twenty-ui/src/primitives/navigation/MenuItemMultiSelect/MenuItemMultiSelect.module.scss.d.ts b/packages/twenty-ui/src/primitives/navigation/MenuItemMultiSelect/MenuItemMultiSelect.module.scss.d.ts
deleted file mode 100644
index 4e8d6662d7e..00000000000
--- a/packages/twenty-ui/src/primitives/navigation/MenuItemMultiSelect/MenuItemMultiSelect.module.scss.d.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-declare const classNames: {
- readonly leftContentWithCheckboxContainer: 'leftContentWithCheckboxContainer';
-};
-export default classNames;
diff --git a/packages/twenty-ui/src/primitives/navigation/MenuItemMultiSelect/MenuItemMultiSelect.tsx b/packages/twenty-ui/src/primitives/navigation/MenuItemMultiSelect/MenuItemMultiSelect.tsx
deleted file mode 100644
index 50cff70da5a..00000000000
--- a/packages/twenty-ui/src/primitives/navigation/MenuItemMultiSelect/MenuItemMultiSelect.tsx
+++ /dev/null
@@ -1,68 +0,0 @@
-import { Tag } from '@ui/primitives/data-display/Tag/Tag';
-import { type IconComponent } from '@ui/icon';
-import { MenuItemLeftContent } from '@ui/primitives/navigation/MenuItem/parts/MenuItemLeftContent';
-import { MenuItemMultiSelectCheckbox } from '@ui/primitives/navigation/MenuItem/parts/MenuItemMultiSelectCheckbox';
-import { type ThemeColor } from '@ui/theme';
-import { StyledMenuItemBase } from '@ui/primitives/navigation/MenuItem/parts/StyledMenuItemBase';
-import { isDefined } from '@ui/utilities/utils/isDefined';
-
-import styles from './MenuItemMultiSelect.module.scss';
-
-type MenuItemMultiSelectProps = {
- color?: ThemeColor;
- LeftIcon?: IconComponent;
- iconThemeColor?: ThemeColor | null;
- selected: boolean;
- isKeySelected?: boolean;
- withIconContainer?: boolean;
- text: string;
- className?: string;
- onSelectChange?: (selected: boolean) => void;
-};
-
-export const MenuItemMultiSelect = ({
- color,
- LeftIcon,
- iconThemeColor,
- withIconContainer = false,
- text,
- selected,
- isKeySelected,
- className,
- onSelectChange,
-}: MenuItemMultiSelectProps) => {
- const handleOnClick = () => {
- onSelectChange?.(!selected);
- };
-
- return (
- <StyledMenuItemBase
- isKeySelected={isKeySelected}
- className={className}
- onClick={handleOnClick}
- >
- <div className={styles.leftContentWithCheckboxContainer}>
- <MenuItemMultiSelectCheckbox
- selected={selected}
- onSelectChange={onSelectChange}
- ariaLabel={text}
- />
- {color ? (
- <Tag
- color={color}
- startIcon={isDefined(LeftIcon) ? <LeftIcon /> : undefined}
- >
- {text}
- </Tag>
- ) : (
- <MenuItemLeftContent
- LeftIcon={LeftIcon}
- iconThemeColor={iconThemeColor}
- text={text}
- withIconContainer={withIconContainer}
- />
- )}
- </div>
- </StyledMenuItemBase>
- );
-};
diff --git a/packages/twenty-ui/src/primitives/navigation/MenuItemMultiSelect/__stories__/MenuItemMultiSelect.stories.tsx b/packages/twenty-ui/src/primitives/navigation/MenuItemMultiSelect/__stories__/MenuItemMultiSelect.stories.tsx
deleted file mode 100644
index 1731386ca8a..00000000000
--- a/packages/twenty-ui/src/primitives/navigation/MenuItemMultiSelect/__stories__/MenuItemMultiSelect.stories.tsx
+++ /dev/null
@@ -1,89 +0,0 @@
-import { type Meta, type StoryObj } from '@storybook/react-vite';
-
-import { IconBell } from '@ui/icon';
-import {
- A11Y_DEFER_COLOR_CONTRAST,
- CatalogDecorator,
- type CatalogDimension,
- type CatalogOptions,
- type CatalogStory,
- ComponentDecorator,
-} from '@ui/testing';
-import { MenuItemMultiSelect } from '@ui/primitives/navigation/MenuItemMultiSelect/MenuItemMultiSelect';
-
-const meta: Meta<typeof MenuItemMultiSelect> = {
- title: 'UI/Navigation/Menu/MenuItem/MenuItemMultiSelect',
- component: MenuItemMultiSelect,
-};
-
-export default meta;
-
-type Story = StoryObj<typeof MenuItemMultiSelect>;
-
-export const Default: Story = {
- parameters: { a11y: A11Y_DEFER_COLOR_CONTRAST },
- args: {
- text: 'First option',
- },
- decorators: [ComponentDecorator],
-};
-
-export const Catalog: CatalogStory<Story, typeof MenuItemMultiSelect> = {
- args: { LeftIcon: IconBell, text: 'Menu item' },
- argTypes: {
- className: { control: false },
- },
- parameters: {
- a11y: A11Y_DEFER_COLOR_CONTRAST,
- pseudo: { hover: ['.hover'], active: ['.pressed'], focus: ['.focus'] },
- catalog: {
- dimensions: [
- {
- name: 'withIcon',
- values: [true, false],
- props: (withIcon: boolean) => ({
- LeftIcon: withIcon ? IconBell : undefined,
- }),
- labels: (withIcon: boolean) =>
- withIcon ? 'With left icon' : 'Without left icon',
- },
- {
- name: 'withIconContainer',
- values: [true, false],
- props: (withIconContainer: boolean) => ({ withIconContainer }),
- labels: (withIconContainer: boolean) =>
- withIconContainer
- ? 'With icon container'
- : 'Without icon container',
- },
- {
- name: 'selected',
- values: [true, false],
- props: (selected: boolean) => ({ selected }),
- labels: (selected: boolean) =>
- selected ? 'Selected' : 'Not selected',
- },
- {
- name: 'states',
- values: ['default', 'hover'],
- props: (state: string) => {
- switch (state) {
- case 'default':
- return {};
- case 'hover':
- return { className: state };
- default:
- return {};
- }
- },
- },
- ] as CatalogDimension[],
- options: {
- elementContainer: {
- width: 200,
- },
- } as CatalogOptions,
- },
- },
- decorators: [CatalogDecorator],
-};
diff --git a/packages/twenty-ui/src/primitives/navigation/MenuItemMultiSelectAvatar/MenuItemMultiSelectAvatar.module.scss b/packages/twenty-ui/src/primitives/navigation/MenuItemMultiSelectAvatar/MenuItemMultiSelectAvatar.module.scss
deleted file mode 100644
index db185a49426..00000000000
--- a/packages/twenty-ui/src/primitives/navigation/MenuItemMultiSelectAvatar/MenuItemMultiSelectAvatar.module.scss
+++ /dev/null
@@ -1,17 +0,0 @@
-.leftContentWithCheckboxContainer {
- align-items: center;
- display: flex;
- flex-direction: row;
- gap: var(--t-spacing-2);
- width: 100%;
-}
-
-.textContainer {
- display: flex;
- align-items: center;
- flex: 1 0 0;
- gap: var(--t-spacing-1);
- max-width: 100%;
- text-overflow: ellipsis;
- overflow: hidden;
-}
diff --git a/packages/twenty-ui/src/primitives/navigation/MenuItemMultiSelectAvatar/MenuItemMultiSelectAvatar.module.scss.d.ts b/packages/twenty-ui/src/primitives/navigation/MenuItemMultiSelectAvatar/MenuItemMultiSelectAvatar.module.scss.d.ts
deleted file mode 100644
index 99da9756525..00000000000
--- a/packages/twenty-ui/src/primitives/navigation/MenuItemMultiSelectAvatar/MenuItemMultiSelectAvatar.module.scss.d.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-declare const classNames: {
- readonly leftContentWithCheckboxContainer: 'leftContentWithCheckboxContainer';
- readonly textContainer: 'textContainer';
-};
-export default classNames;
diff --git a/packages/twenty-ui/src/primitives/navigation/MenuItemMultiSelectAvatar/MenuItemMultiSelectAvatar.tsx b/packages/twenty-ui/src/primitives/navigation/MenuItemMultiSelectAvatar/MenuItemMultiSelectAvatar.tsx
deleted file mode 100644
index bd8f494ea8b..00000000000
--- a/packages/twenty-ui/src/primitives/navigation/MenuItemMultiSelectAvatar/MenuItemMultiSelectAvatar.tsx
+++ /dev/null
@@ -1,68 +0,0 @@
-import { type ReactNode } from 'react';
-
-import { OverflowingTextWithTooltip } from '@ui/primitives/surfaces';
-import { MenuItemMultiSelectCheckbox } from '@ui/primitives/navigation/MenuItem/parts/MenuItemMultiSelectCheckbox';
-import {
- StyledMenuItemBase,
- StyledMenuItemLabel,
- StyledMenuItemLabelLight,
- StyledMenuItemLeftContent,
-} from '@ui/primitives/navigation/MenuItem/parts/StyledMenuItemBase';
-
-import styles from './MenuItemMultiSelectAvatar.module.scss';
-
-type MenuItemMultiSelectAvatarProps = {
- avatar?: ReactNode;
- selected: boolean;
- isKeySelected?: boolean;
- text?: string;
- contextualText?: string;
- className?: string;
- onSelectChange?: (selected: boolean) => void;
-};
-
-export const MenuItemMultiSelectAvatar = ({
- avatar,
- text,
- selected,
- contextualText,
- className,
- isKeySelected,
- onSelectChange,
-}: MenuItemMultiSelectAvatarProps) => {
- const handleOnClick = () => {
- onSelectChange?.(!selected);
- };
-
- return (
- <StyledMenuItemBase
- className={className}
- onClick={handleOnClick}
- isKeySelected={isKeySelected}
- >
- <div className={styles.leftContentWithCheckboxContainer}>
- <MenuItemMultiSelectCheckbox
- selected={selected}
- onSelectChange={onSelectChange}
- ariaLabel={text ?? contextualText ?? 'Select item'}
- />
- <StyledMenuItemLeftContent>
- {avatar}
- <div className={styles.textContainer}>
- <StyledMenuItemLabel>
- <OverflowingTextWithTooltip text={text} />
- </StyledMenuItemLabel>
- {contextualText && (
- <>
- <StyledMenuItemLabelLight>·</StyledMenuItemLabelLight>
- <StyledMenuItemLabelLight>
- <OverflowingTextWithTooltip text={contextualText} />
- </StyledMenuItemLabelLight>
- </>
- )}
- </div>
- </StyledMenuItemLeftContent>
- </div>
- </StyledMenuItemBase>
- );
-};
diff --git a/packages/twenty-ui/src/primitives/navigation/MenuItemMultiSelectAvatar/__stories__/MenuItemMultiSelectAvatar.stories.tsx b/packages/twenty-ui/src/primitives/navigation/MenuItemMultiSelectAvatar/__stories__/MenuItemMultiSelectAvatar.stories.tsx
deleted file mode 100644
index 66594c42d12..00000000000
--- a/packages/twenty-ui/src/primitives/navigation/MenuItemMultiSelectAvatar/__stories__/MenuItemMultiSelectAvatar.stories.tsx
+++ /dev/null
@@ -1,106 +0,0 @@
-import { type Meta, type StoryObj } from '@storybook/react-vite';
-import { expect, fn, userEvent, within } from 'storybook/test';
-
-import { Avatar } from '@ui/primitives/data-display/Avatar/Avatar';
-import {
- A11Y_DEFER_COLOR_CONTRAST,
- AVATAR_URL_MOCK,
- CatalogDecorator,
- type CatalogDimension,
- type CatalogOptions,
- type CatalogStory,
- ComponentDecorator,
-} from '@ui/testing';
-import { MenuItemMultiSelectAvatar } from '@ui/primitives/navigation/MenuItemMultiSelectAvatar/MenuItemMultiSelectAvatar';
-
-const meta: Meta<typeof MenuItemMultiSelectAvatar> = {
- title: 'UI/Navigation/Menu/MenuItem/MenuItemMultiSelectAvatar',
- component: MenuItemMultiSelectAvatar,
-};
-
-export default meta;
-
-type Story = StoryObj<typeof MenuItemMultiSelectAvatar>;
-
-export const Default: Story = {
- parameters: { a11y: A11Y_DEFER_COLOR_CONTRAST },
- args: {
- text: 'First option',
- contextualText: 'Contextual text',
- avatar: <Avatar src={AVATAR_URL_MOCK} name="L" />,
- },
- decorators: [ComponentDecorator],
-};
-
-export const ClickingCheckboxSelectsOnce: Story = {
- parameters: { a11y: A11Y_DEFER_COLOR_CONTRAST },
- args: {
- text: 'First option',
- selected: false,
- onSelectChange: fn(),
- },
- decorators: [ComponentDecorator],
- play: async ({ args, canvasElement }) => {
- const canvas = within(canvasElement);
-
- await userEvent.click(canvas.getByRole('checkbox'));
-
- await expect(args.onSelectChange).toHaveBeenCalledTimes(1);
- await expect(args.onSelectChange).toHaveBeenCalledWith(true);
- },
-};
-
-export const Catalog: CatalogStory<Story, typeof MenuItemMultiSelectAvatar> = {
- args: { text: 'Menu item' },
- argTypes: {
- className: { control: false },
- },
- parameters: {
- a11y: A11Y_DEFER_COLOR_CONTRAST,
- pseudo: { hover: ['.hover'], active: ['.pressed'], focus: ['.focus'] },
- catalog: {
- dimensions: [
- {
- name: 'withAvatar',
- values: [true, false],
- props: (withAvatar: boolean) => ({
- avatar: withAvatar ? (
- <Avatar src={AVATAR_URL_MOCK} name="L" />
- ) : (
- <Avatar src="" name="L" />
- ),
- }),
- labels: (withAvatar: boolean) =>
- withAvatar ? 'With avatar' : 'Without avatar',
- },
- {
- name: 'selected',
- values: [true, false],
- props: (selected: boolean) => ({ selected }),
- labels: (selected: boolean) =>
- selected ? 'Selected' : 'Not selected',
- },
- {
- name: 'states',
- values: ['default', 'hover'],
- props: (state: string) => {
- switch (state) {
- case 'default':
- return {};
- case 'hover':
- return { className: state };
- default:
- return {};
- }
- },
- },
- ] as CatalogDimension[],
- options: {
- elementContainer: {
- width: 200,
- },
- } as CatalogOptions,
- },
- },
- decorators: [CatalogDecorator],
-};
diff --git a/packages/twenty-ui/src/primitives/navigation/MenuItemMultiSelectTag/MenuItemMultiSelectTag.tsx b/packages/twenty-ui/src/primitives/navigation/MenuItemMultiSelectTag/MenuItemMultiSelectTag.tsx
deleted file mode 100644
index 35c90fea7e8..00000000000
--- a/packages/twenty-ui/src/primitives/navigation/MenuItemMultiSelectTag/MenuItemMultiSelectTag.tsx
+++ /dev/null
@@ -1,48 +0,0 @@
-import { Tag } from '@ui/primitives/data-display/Tag/Tag';
-import { type IconComponent } from '@ui/icon';
-import { type ThemeColor } from '@ui/theme';
-import { MenuItemMultiSelectCheckbox } from '@ui/primitives/navigation/MenuItem/parts/MenuItemMultiSelectCheckbox';
-import {
- StyledMenuItemBase,
- StyledMenuItemLeftContent,
-} from '@ui/primitives/navigation/MenuItem/parts/StyledMenuItemBase';
-import { isDefined } from '@ui/utilities/utils/isDefined';
-
-type MenuItemMultiSelectTagProps = {
- selected: boolean;
- className?: string;
- isKeySelected?: boolean;
- onClick?: () => void;
- color: ThemeColor | 'transparent';
- text: string;
- Icon?: IconComponent;
-};
-
-export const MenuItemMultiSelectTag = ({
- color,
- selected,
- className,
- onClick,
- isKeySelected,
- text,
- Icon,
-}: MenuItemMultiSelectTagProps) => {
- return (
- <StyledMenuItemBase
- isKeySelected={isKeySelected}
- onClick={onClick}
- className={className}
- >
- <StyledMenuItemLeftContent>
- <MenuItemMultiSelectCheckbox
- selected={selected}
- onSelectChange={() => onClick?.()}
- ariaLabel={text}
- />
- <Tag color={color} startIcon={isDefined(Icon) ? <Icon /> : undefined}>
- {text}
- </Tag>
- </StyledMenuItemLeftContent>
- </StyledMenuItemBase>
- );
-};
diff --git a/packages/twenty-ui/src/primitives/navigation/MenuItemSelect/MenuItemSelect.module.scss b/packages/twenty-ui/src/primitives/navigation/MenuItemSelect/MenuItemSelect.module.scss
deleted file mode 100644
index d51cb647302..00000000000
--- a/packages/twenty-ui/src/primitives/navigation/MenuItemSelect/MenuItemSelect.module.scss
+++ /dev/null
@@ -1,44 +0,0 @@
-.menuItemSelect {
- --horizontal-padding: var(--t-spacing-1);
- --vertical-padding: var(--t-spacing-2);
-
- // Height and width below are sized against the content box.
- box-sizing: content-box;
- align-items: center;
- // Concentric with the md dropdown container: parent radius minus its inset.
- border-radius: calc(var(--t-border-radius-md) - var(--t-spacing-1));
- display: flex;
- flex-direction: row;
- font-size: var(--t-font-size-sm);
- gap: var(--t-spacing-2);
- height: calc(32px - 2 * var(--vertical-padding));
- justify-content: space-between;
- padding: var(--vertical-padding) var(--horizontal-padding);
- position: relative;
- user-select: none;
- width: calc(100% - 2 * var(--horizontal-padding));
- transition: background 0.1s ease;
- color: var(--t-font-color-secondary);
- cursor: pointer;
-}
-
-.menuItemSelect[data-focused],
-.menuItemSelect[data-key-selected] {
- background: var(--t-background-transparent-light);
-}
-
-.menuItemSelect:hover {
- background: var(--t-background-transparent-light);
-}
-
-// Disabled wins over focused/key-selected/hover, mirroring the deprecated
-// Linaria ternary order.
-.menuItemSelect[data-disabled] {
- background: inherit;
- color: var(--t-font-color-tertiary);
- cursor: default;
-}
-
-.menuItemSelect[data-disabled]:hover {
- background: inherit;
-}
diff --git a/packages/twenty-ui/src/primitives/navigation/MenuItemSelect/MenuItemSelect.module.scss.d.ts b/packages/twenty-ui/src/primitives/navigation/MenuItemSelect/MenuItemSelect.module.scss.d.ts
deleted file mode 100644
index eaf7bc97891..00000000000
--- a/packages/twenty-ui/src/primitives/navigation/MenuItemSelect/MenuItemSelect.module.scss.d.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-declare const classNames: {
- readonly menuItemSelect: 'menuItemSelect';
-};
-export default classNames;
diff --git a/packages/twenty-ui/src/primitives/navigation/MenuItemSelect/MenuItemSelect.tsx b/packages/twenty-ui/src/primitives/navigation/MenuItemSelect/MenuItemSelect.tsx
deleted file mode 100644
index 24f8585cc90..00000000000
--- a/packages/twenty-ui/src/primitives/navigation/MenuItemSelect/MenuItemSelect.tsx
+++ /dev/null
@@ -1,126 +0,0 @@
-import { isString } from '@sniptt/guards';
-import { IconCheck, IconChevronRight, type IconComponent } from '@ui/icon';
-import { OverflowingTextWithTooltip } from '@ui/primitives/surfaces';
-import { type ThemeColor } from '@ui/theme';
-import { useTheme } from '@ui/theme-constants';
-import { clsx } from 'clsx';
-import {
- type ComponentPropsWithoutRef,
- forwardRef,
- type ReactNode,
-} from 'react';
-import { MenuItemLeftContent } from '@ui/primitives/navigation/MenuItem/parts/MenuItemLeftContent';
-import {
- StyledMenuItemLabel,
- StyledMenuItemRightContent,
- StyledRightMenuItemContextualText,
-} from '@ui/primitives/navigation/MenuItem/parts/StyledMenuItemBase';
-
-import styles from './MenuItemSelect.module.scss';
-
-// The deprecated Linaria styled component forwarded refs and arbitrary
-// native props, so the port preserves that contract.
-type StyledMenuItemSelectProps = {
- disabled?: boolean;
- focused?: boolean;
- isKeySelected?: boolean;
-} & ComponentPropsWithoutRef<'div'>;
-
-export const StyledMenuItemSelect = forwardRef<
- HTMLDivElement,
- StyledMenuItemSelectProps
->(({ disabled, focused, isKeySelected, className, children, ...rest }, ref) => (
- <div
- ref={ref}
- className={clsx(styles.menuItemSelect, className)}
- data-disabled={disabled || undefined}
- data-focused={focused || undefined}
- data-key-selected={isKeySelected || undefined}
- {...rest}
- >
- {children}
- </div>
-));
-
-StyledMenuItemSelect.displayName = 'StyledMenuItemSelect';
-
-type MenuItemSelectProps = {
- LeftComponent?: ReactNode;
- LeftIcon?: IconComponent | null | undefined;
- leftIconColor?: ThemeColor | null;
- withIconContainer?: boolean;
- selected: boolean;
- needIconCheck?: boolean;
- text: string;
- className?: string;
- onClick?: () => void;
- disabled?: boolean;
- focused?: boolean;
- hasSubMenu?: boolean;
- contextualText?: ReactNode;
- contextualTextPosition?: 'left' | 'right';
-};
-
-export const MenuItemSelect = ({
- LeftComponent,
- LeftIcon,
- leftIconColor,
- withIconContainer = false,
- text,
- selected,
- needIconCheck = true,
- className,
- onClick,
- disabled,
- focused,
- hasSubMenu = false,
- contextualText,
- contextualTextPosition = 'left',
-}: MenuItemSelectProps) => {
- const theme = useTheme();
-
- return (
- <StyledMenuItemSelect
- onClick={onClick}
- className={className}
- disabled={disabled}
- focused={focused}
- role="option"
- aria-selected={selected}
- aria-disabled={disabled}
- >
- <MenuItemLeftContent
- LeftComponent={LeftComponent}
- LeftIcon={LeftIcon}
- iconThemeColor={leftIconColor}
- text={text}
- contextualText={
- contextualTextPosition === 'left' ? contextualText : null
- }
- withIconContainer={withIconContainer}
- />
- <StyledMenuItemRightContent>
- {contextualTextPosition === 'right' && (
- <StyledMenuItemLabel>
- {isString(contextualText) ? (
- <StyledRightMenuItemContextualText>
- <OverflowingTextWithTooltip text={contextualText} />
- </StyledRightMenuItemContextualText>
- ) : (
- contextualText
- )}
- </StyledMenuItemLabel>
- )}
-
- {selected && needIconCheck && <IconCheck size={theme.icon.size.md} />}
-
- {hasSubMenu && (
- <IconChevronRight
- size={theme.icon.size.sm}
- color={theme.font.color.tertiary}
- />
- )}
- </StyledMenuItemRightContent>
- </StyledMenuItemSelect>
- );
-};
diff --git a/packages/twenty-ui/src/primitives/navigation/MenuItemSelect/__stories__/MenuItemSelect.stories.tsx b/packages/twenty-ui/src/primitives/navigation/MenuItemSelect/__stories__/MenuItemSelect.stories.tsx
deleted file mode 100644
index e191da6929f..00000000000
--- a/packages/twenty-ui/src/primitives/navigation/MenuItemSelect/__stories__/MenuItemSelect.stories.tsx
+++ /dev/null
@@ -1,104 +0,0 @@
-import { type Meta, type StoryObj } from '@storybook/react-vite';
-
-import {
- A11Y_DEFER_COLOR_CONTRAST,
- CatalogDecorator,
- type CatalogDimension,
- type CatalogOptions,
- type CatalogStory,
- ComponentDecorator,
-} from '@ui/testing';
-import { MenuItemSelect } from '@ui/primitives/navigation/MenuItemSelect/MenuItemSelect';
-
-import { IconBell } from '@ui/icon';
-const meta: Meta<typeof MenuItemSelect> = {
- title: 'UI/Navigation/Menu/MenuItem/MenuItemSelect',
- component: MenuItemSelect,
-};
-
-export default meta;
-
-type Story = StoryObj<typeof MenuItemSelect>;
-
-export const Default: Story = {
- parameters: { a11y: A11Y_DEFER_COLOR_CONTRAST },
- args: {
- text: 'First option',
- LeftIcon: IconBell,
- },
- argTypes: {
- className: { control: false },
- },
- decorators: [
- (Story) => (
- <div role="listbox" aria-label="Options">
- <Story />
- </div>
- ),
- ComponentDecorator,
- ],
-};
-
-export const Catalog: CatalogStory<Story, typeof MenuItemSelect> = {
- args: { LeftIcon: IconBell, text: 'Menu item' },
- argTypes: {
- className: { control: false },
- },
- parameters: {
- a11y: A11Y_DEFER_COLOR_CONTRAST,
- pseudo: { hover: ['.hover'], active: ['.pressed'], focus: ['.focus'] },
- catalog: {
- dimensions: [
- {
- name: 'withIcon',
- values: [true, false],
- props: (withIcon: boolean) => ({
- LeftIcon: withIcon ? IconBell : undefined,
- }),
- labels: (withIcon: boolean) =>
- withIcon ? 'With left icon' : 'Without left icon',
- },
- {
- name: 'withIconContainer',
- values: [true, false],
- props: (withIconContainer: boolean) => ({ withIconContainer }),
- labels: (withIconContainer: boolean) =>
- withIconContainer
- ? 'With icon container'
- : 'Without icon container',
- },
- {
- name: 'states',
- values: ['default', 'hover', 'focused', 'hover+focused'],
- props: (state: string) => {
- switch (state) {
- case 'default':
- return {};
- case 'hover':
- return { className: 'hover' };
- case 'focused':
- return { focused: true };
- case 'hover+focused':
- return { className: 'hover', focused: true };
- default:
- return {};
- }
- },
- },
- ] as CatalogDimension[],
- options: {
- elementContainer: {
- width: 200,
- },
- } as CatalogOptions,
- },
- },
- decorators: [
- (Story) => (
- <div role="listbox" aria-label="Options">
- <Story />
- </div>
- ),
- CatalogDecorator,
- ],
-};
diff --git a/packages/twenty-ui/src/primitives/navigation/MenuItemSelect/__tests__/MenuItemSelect.test.tsx b/packages/twenty-ui/src/primitives/navigation/MenuItemSelect/__tests__/MenuItemSelect.test.tsx
deleted file mode 100644
index d726ee050fb..00000000000
--- a/packages/twenty-ui/src/primitives/navigation/MenuItemSelect/__tests__/MenuItemSelect.test.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-import { render, screen } from '@testing-library/react';
-import userEvent from '@testing-library/user-event';
-import { describe, expect, it, vi } from 'vitest';
-
-import { MenuItemSelect } from '@ui/primitives/navigation/MenuItemSelect/MenuItemSelect';
-
-describe('MenuItemSelect', () => {
- it('renders custom leading content and keeps the option selectable', async () => {
- const onClick = vi.fn();
- const user = userEvent.setup();
-
- render(
- <MenuItemSelect
- text="Fast"
- selected={false}
- LeftComponent={<span role="img" aria-label="Speed indicator" />}
- onClick={onClick}
- />,
- );
-
- expect(screen.getByRole('img', { name: 'Speed indicator' })).toBeVisible();
- const option = screen.getByRole('option', { name: 'Speed indicator Fast' });
- expect(option).toHaveAttribute('aria-selected', 'false');
- await user.click(option);
- expect(onClick).toHaveBeenCalledOnce();
- });
-
- it('preserves text-only selected options', () => {
- render(<MenuItemSelect text="Balanced" selected />);
-
- expect(screen.getByRole('option', { name: 'Balanced' })).toHaveAttribute(
- 'aria-selected',
- 'true',
- );
- });
-});
diff --git a/packages/twenty-ui/src/primitives/navigation/MenuItemSelectAvatar/MenuItemSelectAvatar.module.scss b/packages/twenty-ui/src/primitives/navigation/MenuItemSelectAvatar/MenuItemSelectAvatar.module.scss
deleted file mode 100644
index 3364391087d..00000000000
--- a/packages/twenty-ui/src/primitives/navigation/MenuItemSelectAvatar/MenuItemSelectAvatar.module.scss
+++ /dev/null
@@ -1,9 +0,0 @@
-.textContainer {
- display: flex;
- align-items: center;
- flex: 1 0 0;
- gap: var(--t-spacing-1);
- max-width: 100%;
- text-overflow: ellipsis;
- overflow: hidden;
-}
diff --git a/packages/twenty-ui/src/primitives/navigation/MenuItemSelectAvatar/MenuItemSelectAvatar.module.scss.d.ts b/packages/twenty-ui/src/primitives/navigation/MenuItemSelectAvatar/MenuItemSelectAvatar.module.scss.d.ts
deleted file mode 100644
index 6ae17db92a3..00000000000
--- a/packages/twenty-ui/src/primitives/navigation/MenuItemSelectAvatar/MenuItemSelectAvatar.module.scss.d.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-declare const classNames: {
- readonly textContainer: 'textContainer';
-};
-export default classNames;
diff --git a/packages/twenty-ui/src/primitives/navigation/MenuItemSelectAvatar/MenuItemSelectAvatar.tsx b/packages/twenty-ui/src/primitives/navigation/MenuItemSelectAvatar/MenuItemSelectAvatar.tsx
deleted file mode 100644
index 476dbc16010..00000000000
--- a/packages/twenty-ui/src/primitives/navigation/MenuItemSelectAvatar/MenuItemSelectAvatar.tsx
+++ /dev/null
@@ -1,71 +0,0 @@
-import { type ReactNode } from 'react';
-
-import {
- StyledMenuItemIconCheck,
- StyledMenuItemLabel,
- StyledMenuItemLabelLight,
- StyledMenuItemLeftContent,
-} from '@ui/primitives/navigation/MenuItem/parts/StyledMenuItemBase';
-
-import { OverflowingTextWithTooltip } from '@ui/primitives/surfaces';
-import { useTheme } from '@ui/theme-constants';
-import { StyledMenuItemSelect } from '@ui/primitives/navigation/MenuItemSelect/MenuItemSelect';
-
-import styles from './MenuItemSelectAvatar.module.scss';
-
-type MenuItemSelectAvatarProps = {
- avatar?: ReactNode;
- selected: boolean;
- text: string;
- contextualText?: string;
- className?: string;
- onClick?: (event?: React.MouseEvent) => void;
- disabled?: boolean;
- focused?: boolean;
- testId?: string;
-};
-
-export const MenuItemSelectAvatar = ({
- avatar,
- text,
- contextualText,
- selected,
- className,
- onClick,
- disabled,
- focused,
- testId,
-}: MenuItemSelectAvatarProps) => {
- const theme = useTheme();
-
- return (
- <StyledMenuItemSelect
- onClick={onClick}
- className={className}
- disabled={disabled}
- focused={focused}
- data-testid={testId}
- role="option"
- aria-selected={selected}
- aria-disabled={disabled}
- >
- <StyledMenuItemLeftContent>
- {avatar}
- <div className={styles.textContainer}>
- <StyledMenuItemLabel>
- <OverflowingTextWithTooltip text={text} />
- </StyledMenuItemLabel>
- {contextualText && (
- <>
- <StyledMenuItemLabelLight>·</StyledMenuItemLabelLight>
- <StyledMenuItemLabelLight>
- <OverflowingTextWithTooltip text={contextualText} />
- </StyledMenuItemLabelLight>
- </>
- )}
- </div>
- </StyledMenuItemLeftContent>
- {selected && <StyledMenuItemIconCheck size={theme.icon.size.md} />}
- </StyledMenuItemSelect>
- );
-};
diff --git a/packages/twenty-ui/src/primitives/navigation/MenuItemSelectAvatar/__stories__/MenuItemSelectAvatar.stories.tsx b/packages/twenty-ui/src/primitives/navigation/MenuItemSelectAvatar/__stories__/MenuItemSelectAvatar.stories.tsx
deleted file mode 100644
index 738031c8c1e..00000000000
--- a/packages/twenty-ui/src/primitives/navigation/MenuItemSelectAvatar/__stories__/MenuItemSelectAvatar.stories.tsx
+++ /dev/null
@@ -1,109 +0,0 @@
-import { type Meta, type StoryObj } from '@storybook/react-vite';
-
-import { Avatar } from '@ui/primitives/data-display/Avatar/Avatar';
-import {
- A11Y_DEFER_COLOR_CONTRAST,
- AVATAR_URL_MOCK,
- CatalogDecorator,
- type CatalogDimension,
- type CatalogOptions,
- type CatalogStory,
- ComponentDecorator,
-} from '@ui/testing';
-import { MenuItemSelectAvatar } from '@ui/primitives/navigation/MenuItemSelectAvatar/MenuItemSelectAvatar';
-
-const meta: Meta<typeof MenuItemSelectAvatar> = {
- title: 'UI/Navigation/Menu/MenuItem/MenuItemSelectAvatar',
- component: MenuItemSelectAvatar,
-};
-
-export default meta;
-
-type Story = StoryObj<typeof MenuItemSelectAvatar>;
-export const Default: Story = {
- parameters: { a11y: A11Y_DEFER_COLOR_CONTRAST },
- args: {
- text: 'First option',
- contextualText: 'Contextual text',
- avatar: <Avatar src={AVATAR_URL_MOCK} name="L" />,
- },
- argTypes: {
- className: { control: false },
- },
- decorators: [
- (Story) => (
- <div role="listbox" aria-label="Options">
- <Story />
- </div>
- ),
- ComponentDecorator,
- ],
-};
-
-export const Catalog: CatalogStory<Story, typeof MenuItemSelectAvatar> = {
- args: { text: 'Menu item' },
- argTypes: {
- className: { control: false },
- },
- parameters: {
- a11y: A11Y_DEFER_COLOR_CONTRAST,
- pseudo: { hover: ['.hover'], active: ['.pressed'], focus: ['.focus'] },
- catalog: {
- dimensions: [
- {
- name: 'withAvatar',
- values: [true, false],
- props: (withAvatar: boolean) => ({
- avatar: withAvatar ? (
- <Avatar src={AVATAR_URL_MOCK} name="L" />
- ) : (
- <Avatar src="" name="L" />
- ),
- }),
- labels: (withAvatar: boolean) =>
- withAvatar ? 'With avatar' : 'Without avatar',
- },
- {
- name: 'states',
- values: [
- 'default',
- 'hover',
- 'disabled',
- 'selected',
- 'hover+selected',
- ],
- props: (state: string) => {
- switch (state) {
- case 'default':
- return {};
- case 'hover':
- return { className: 'hover' };
- case 'disabled':
- return { disabled: true };
- case 'selected':
- return { selected: true };
-
- case 'hover+selected':
- return { className: 'hover', selected: true };
- default:
- return {};
- }
- },
- },
- ] as CatalogDimension[],
- options: {
- elementContainer: {
- width: 200,
- },
- } as CatalogOptions,
- },
- },
- decorators: [
- (Story) => (
- <div role="listbox" aria-label="Options">
- <Story />
- </div>
- ),
- CatalogDecorator,
- ],
-};
diff --git a/packages/twenty-ui/src/primitives/navigation/MenuItemSelectColor/MenuItemSelectColor.tsx b/packages/twenty-ui/src/primitives/navigation/MenuItemSelectColor/MenuItemSelectColor.tsx
deleted file mode 100644
index 6d136e1c50d..00000000000
--- a/packages/twenty-ui/src/primitives/navigation/MenuItemSelectColor/MenuItemSelectColor.tsx
+++ /dev/null
@@ -1,56 +0,0 @@
-import {
- StyledMenuItemIconCheck,
- StyledMenuItemLabel,
- StyledMenuItemLeftContent,
-} from '@ui/primitives/navigation/MenuItem/parts/StyledMenuItemBase';
-
-import {
- ColorSample,
- type ColorSampleVariant,
-} from '@ui/primitives/data-display';
-import { type ThemeColor } from '@ui/theme';
-import { useTheme } from '@ui/theme-constants';
-import {
- DEFAULT_COLOR_LABELS,
- type ColorLabels,
-} from '@ui/primitives/navigation/MenuItem/constants/DefaultColorLabels';
-import { StyledMenuItemSelect } from '@ui/primitives/navigation/MenuItemSelect/MenuItemSelect';
-
-type MenuItemSelectColorProps = {
- selected: boolean;
- className?: string;
- onClick?: () => void;
- disabled?: boolean;
- focused?: boolean;
- color: ThemeColor;
- variant?: ColorSampleVariant;
- colorLabels?: ColorLabels;
-};
-
-export const MenuItemSelectColor = ({
- color,
- selected,
- className,
- onClick,
- disabled,
- focused,
- variant = 'default',
- colorLabels = DEFAULT_COLOR_LABELS,
-}: MenuItemSelectColorProps) => {
- const theme = useTheme();
-
- return (
- <StyledMenuItemSelect
- onClick={onClick}
- className={className}
- disabled={disabled}
- focused={focused}
- >
- <StyledMenuItemLeftContent>
- <ColorSample colorName={color} variant={variant} />
- <StyledMenuItemLabel>{colorLabels[color]}</StyledMenuItemLabel>
- </StyledMenuItemLeftContent>
- {selected && <StyledMenuItemIconCheck size={theme.icon.size.md} />}
- </StyledMenuItemSelect>
- );
-};
diff --git a/packages/twenty-ui/src/primitives/navigation/MenuItemSelectColor/__stories__/MenuItemSelectColor.stories.tsx b/packages/twenty-ui/src/primitives/navigation/MenuItemSelectColor/__stories__/MenuItemSelectColor.stories.tsx
deleted file mode 100644
index 6a7c87e2cce..00000000000
--- a/packages/twenty-ui/src/primitives/navigation/MenuItemSelectColor/__stories__/MenuItemSelectColor.stories.tsx
+++ /dev/null
@@ -1,85 +0,0 @@
-import { type Meta, type StoryObj } from '@storybook/react-vite';
-
-import { type ColorSampleVariant } from '@ui/primitives/data-display';
-import {
- A11Y_DEFER_COLOR_CONTRAST,
- CatalogDecorator,
- type CatalogDimension,
- type CatalogOptions,
- type CatalogStory,
- ComponentDecorator,
-} from '@ui/testing';
-import { type ThemeColor, MAIN_COLOR_NAMES } from '@ui/theme';
-import { MenuItemSelectColor } from '@ui/primitives/navigation/MenuItemSelectColor/MenuItemSelectColor';
-
-const meta: Meta<typeof MenuItemSelectColor> = {
- title: 'UI/Navigation/Menu/MenuItem/MenuItemSelectColor',
- component: MenuItemSelectColor,
-};
-
-export default meta;
-
-type Story = StoryObj<typeof MenuItemSelectColor>;
-
-export const Default: Story = {
- args: { color: 'green' },
- argTypes: { className: { control: false } },
- decorators: [ComponentDecorator],
-};
-
-export const Catalog: CatalogStory<Story, typeof MenuItemSelectColor> = {
- argTypes: { className: { control: false } },
- parameters: {
- a11y: A11Y_DEFER_COLOR_CONTRAST,
- pseudo: { hover: ['.hover'], active: ['.pressed'], focus: ['.focus'] },
- catalog: {
- dimensions: [
- {
- name: 'color',
- values: MAIN_COLOR_NAMES,
- props: (color: ThemeColor) => ({ color }),
- labels: (color: ThemeColor) => color,
- },
- {
- name: 'states',
- values: [
- 'default',
- 'hover',
- 'disabled',
- 'selected',
- 'hover+selected',
- ],
- props: (state: string) => {
- switch (state) {
- case 'default':
- return {};
- case 'hover':
- return { className: 'hover' };
- case 'disabled':
- return { disabled: true };
- case 'selected':
- return { selected: true };
-
- case 'hover+selected':
- return { className: 'hover', selected: true };
- default:
- return {};
- }
- },
- },
- {
- name: 'variant',
- values: ['circle', 'default', 'pipeline'],
- props: (variant: ColorSampleVariant) => ({ variant }),
- labels: (variant: ColorSampleVariant) => variant,
- },
- ] as CatalogDimension[],
- options: {
- elementContainer: {
- width: 200,
- },
- } as CatalogOptions,
- },
- },
- decorators: [CatalogDecorator],
-};
diff --git a/packages/twenty-ui/src/primitives/navigation/MenuItemSelectTag/MenuItemSelectTag.tsx b/packages/twenty-ui/src/primitives/navigation/MenuItemSelectTag/MenuItemSelectTag.tsx
deleted file mode 100644
index aa3c5c63536..00000000000
--- a/packages/twenty-ui/src/primitives/navigation/MenuItemSelectTag/MenuItemSelectTag.tsx
+++ /dev/null
@@ -1,60 +0,0 @@
-import {
- StyledMenuItemIconCheck,
- StyledMenuItemLeftContent,
-} from '@ui/primitives/navigation/MenuItem/parts/StyledMenuItemBase';
-
-import { Tag } from '@ui/primitives/data-display/Tag/Tag';
-import { type IconComponent } from '@ui/icon';
-import { type ThemeColor } from '@ui/theme';
-import { useTheme } from '@ui/theme-constants';
-import { StyledMenuItemSelect } from '@ui/primitives/navigation/MenuItemSelect/MenuItemSelect';
-import { isDefined } from '@ui/utilities/utils/isDefined';
-
-type MenuItemSelectTagProps = {
- selected?: boolean;
- focused?: boolean;
- isKeySelected?: boolean;
- className?: string;
- onClick?: () => void;
- color: ThemeColor | 'transparent';
- text: string;
- variant?: 'soft' | 'outline';
- LeftIcon?: IconComponent | null;
-};
-
-export const MenuItemSelectTag = ({
- color,
- selected,
- focused,
- isKeySelected,
- className,
- onClick,
- text,
- variant = 'soft',
- LeftIcon,
-}: MenuItemSelectTagProps) => {
- const theme = useTheme();
-
- return (
- <StyledMenuItemSelect
- role="option"
- aria-selected={selected ?? false}
- onClick={onClick}
- className={className}
- focused={focused}
- isKeySelected={isKeySelected}
- >
- <StyledMenuItemLeftContent>
- <Tag
- borderStyle="dashed"
- variant={variant}
- color={color}
- startIcon={isDefined(LeftIcon) ? <LeftIcon /> : undefined}
- >
- {text}
- </Tag>
- </StyledMenuItemLeftContent>
- {selected && <StyledMenuItemIconCheck size={theme.icon.size.md} />}
- </StyledMenuItemSelect>
- );
-};
diff --git a/packages/twenty-ui/src/primitives/navigation/MenuItemSelectTag/__stories__/MenuItemSelectTag.stories.tsx b/packages/twenty-ui/src/primitives/navigation/MenuItemSelectTag/__stories__/MenuItemSelectTag.stories.tsx
deleted file mode 100644
index ff795028684..00000000000
--- a/packages/twenty-ui/src/primitives/navigation/MenuItemSelectTag/__stories__/MenuItemSelectTag.stories.tsx
+++ /dev/null
@@ -1,136 +0,0 @@
-import { expect, within } from 'storybook/test';
-import { type Meta, type StoryObj } from '@storybook/react-vite';
-
-import {
- A11Y_DEFER_COLOR_CONTRAST,
- CatalogDecorator,
- type CatalogDimension,
- type CatalogOptions,
- type CatalogStory,
- ComponentDecorator,
-} from '@ui/testing';
-import { type ThemeColor } from '@ui/theme';
-import { MenuItemSelectTag } from '@ui/primitives/navigation/MenuItemSelectTag/MenuItemSelectTag';
-
-const meta: Meta<typeof MenuItemSelectTag> = {
- title: 'UI/Navigation/Menu/MenuItem/MenuItemSelectTag',
- component: MenuItemSelectTag,
-};
-
-export default meta;
-
-type Story = StoryObj<typeof MenuItemSelectTag>;
-
-export const Default: Story = {
- args: {
- selected: false,
- onClick: undefined,
- text: 'Item A',
- },
- argTypes: {
- selected: {
- control: 'boolean',
- defaultValue: false,
- },
- onClick: {
- control: false,
- },
- },
- decorators: [
- (Story) => (
- <div role="listbox" aria-label="Options">
- <Story />
- </div>
- ),
- ComponentDecorator,
- ],
-};
-
-export const Catalog: CatalogStory<Story, typeof MenuItemSelectTag> = {
- args: {
- text: 'Item A',
- },
- parameters: {
- a11y: A11Y_DEFER_COLOR_CONTRAST,
- pseudo: {
- hover: ['.hover'],
- active: ['.pressed'],
- focus: ['.focus'],
- },
- catalog: {
- dimensions: [
- {
- name: 'color',
- values: [
- 'green',
- 'turquoise',
- 'sky',
- 'blue',
- 'purple',
- 'pink',
- 'red',
- 'orange',
- 'yellow',
- 'gray',
- ],
- props: (color: ThemeColor) => ({ color }),
- },
- {
- name: 'states',
- values: ['default', 'hover', 'selected', 'hover+selected'],
- props: (state: string) => {
- switch (state) {
- case 'default':
- return {};
- case 'hover':
- return { className: 'hover' };
- case 'selected':
- return { selected: true };
- case 'hover+selected':
- return { className: 'hover', selected: true };
- default:
- return {};
- }
- },
- labels: (state: string) => `State: ${state}`,
- },
- ] as CatalogDimension[],
- options: {
- elementContainer: { width: 200 },
- } as CatalogOptions,
- },
- },
- decorators: [
- (Story) => (
- <div role="listbox" aria-label="Options">
- <Story />
- </div>
- ),
- CatalogDecorator,
- ],
-};
-
-export const Selected: Story = {
- args: {
- color: 'green',
- selected: true,
- text: 'Selected option',
- },
- decorators: [
- (Story) => (
- <div role="listbox" aria-label="Options">
- <Story />
- </div>
- ),
- ComponentDecorator,
- ],
- parameters: { a11y: A11Y_DEFER_COLOR_CONTRAST },
- play: async ({ canvasElement }) => {
- await expect(
- within(canvasElement).getByRole('option', {
- name: 'Selected option',
- selected: true,
- }),
- ).toBeVisible();
- },
-};
diff --git a/packages/twenty-ui/src/primitives/navigation/index.ts b/packages/twenty-ui/src/primitives/navigation/index.ts
index 8e7b74ffd01..ee593264846 100644
--- a/packages/twenty-ui/src/primitives/navigation/index.ts
+++ b/packages/twenty-ui/src/primitives/navigation/index.ts
@@ -38,16 +38,6 @@ export type { MenuItemDraggableProps } from './MenuItemDraggable/MenuItemDraggab
export { MenuItemDraggable } from './MenuItemDraggable/MenuItemDraggable';
export type { MenuItemHotKeysProps } from './MenuItemHotKeys/MenuItemHotKeys';
export { MenuItemHotKeys } from './MenuItemHotKeys/MenuItemHotKeys';
-export { MenuItemMultiSelect } from './MenuItemMultiSelect/MenuItemMultiSelect';
-export { MenuItemMultiSelectAvatar } from './MenuItemMultiSelectAvatar/MenuItemMultiSelectAvatar';
-export { MenuItemMultiSelectTag } from './MenuItemMultiSelectTag/MenuItemMultiSelectTag';
-export {
- StyledMenuItemSelect,
- MenuItemSelect,
-} from './MenuItemSelect/MenuItemSelect';
-export { MenuItemSelectAvatar } from './MenuItemSelectAvatar/MenuItemSelectAvatar';
-export { MenuItemSelectColor } from './MenuItemSelectColor/MenuItemSelectColor';
-export { MenuItemSelectTag } from './MenuItemSelectTag/MenuItemSelectTag';
export type { MenuItemSuggestionProps } from './MenuItemSuggestion/MenuItemSuggestion';
export { MenuItemSuggestion } from './MenuItemSuggestion/MenuItemSuggestion';
export { MenuPicker } from './MenuPicker/MenuPicker';