Skip to content

The open alternative to Salesforce, designed for AI.

Unify Twenty UI icon buttons (#26071)

Raphaël Bosi2d2672fa8369
diff --git a/packages/twenty-companion/src/renderer/components/MeetingRow.tsx b/packages/twenty-companion/src/renderer/components/MeetingRow.tsx
index 9fb8978a400..bdf6a6533b4 100644
--- a/packages/twenty-companion/src/renderer/components/MeetingRow.tsx
+++ b/packages/twenty-companion/src/renderer/components/MeetingRow.tsx
@@ -1,7 +1,7 @@
import { i18n } from '@lingui/core';
import { Menu } from '@base-ui/react/menu';
import { CalendarEventIndicator } from './CalendarEventIndicator';
-import { IconButton } from '@ui/primitives/input/IconButton/IconButton';
+import { IconButton } from '@ui/components/IconButton/IconButton';
import { Button } from '@ui/primitives/input/Button/Button';
import { MenuItem } from '@ui/primitives/navigation/MenuItem/MenuItem';
import styles from './MeetingRow.module.scss';
@@ -68,11 +68,12 @@ export const MeetingRow = ({
<Menu.Trigger
render={
<IconButton
- variant="tertiary"
- Icon={IconDotsVertical}
- size="medium"
- ariaLabel={i18n._('Meeting options')}
- />
+ variant="ghost"
+ size="md"
+ aria-label={i18n._('Meeting options')}
+ >
+ <IconDotsVertical />
+ </IconButton>
}
/>
<Menu.Portal>
diff --git a/packages/twenty-companion/src/renderer/components/Notice.tsx b/packages/twenty-companion/src/renderer/components/Notice.tsx
index ad249d13e64..6b3bf10a864 100644
--- a/packages/twenty-companion/src/renderer/components/Notice.tsx
+++ b/packages/twenty-companion/src/renderer/components/Notice.tsx
@@ -1,7 +1,7 @@
import { noticeMessage } from '../utils/noticeMessage';
import { Banner } from '@ui/primitives/feedback/Banner/Banner';
import { Notification } from './Notification';
-import { IconButton } from '@ui/primitives/input/IconButton/IconButton';
+import { IconButton } from '@ui/components/IconButton/IconButton';
import { i18n } from '@lingui/core';
import { Button } from '@ui/primitives/input/Button/Button';
import { IconX } from 'twenty-ui/icon';
@@ -36,12 +36,13 @@ export const Notice = ({ state, command }: ActionProps) =>
)}
<IconButton
className="notice-close"
- variant="tertiary"
- ariaLabel={i18n._('Dismiss message')}
+ variant="ghost"
+ aria-label={i18n._('Dismiss message')}
onClick={() => void command({ type: 'dismiss-error' })}
- size="medium"
- Icon={IconX}
- />
+ size="md"
+ >
+ <IconX />
+ </IconButton>
</Banner>
</div>
) : null;
diff --git a/packages/twenty-companion/src/renderer/components/Notification.tsx b/packages/twenty-companion/src/renderer/components/Notification.tsx
index 3b701afd356..728f8202d7d 100644
--- a/packages/twenty-companion/src/renderer/components/Notification.tsx
+++ b/packages/twenty-companion/src/renderer/components/Notification.tsx
@@ -1,6 +1,6 @@
import { useState } from 'react';
import { IconInfoCircle, IconX } from '@ui/icon';
-import { IconButton } from '@ui/primitives/input/IconButton/IconButton';
+import { IconButton } from '@ui/components/IconButton/IconButton';
import { ProgressBar } from '@ui/primitives/feedback/ProgressBar/ProgressBar';
import { useTheme } from '@ui/theme-constants';
import styles from './Notification.module.scss';
@@ -45,12 +45,13 @@ export const Notification = ({
/>
<span className={styles.message}>{message}</span>
<IconButton
- Icon={IconX}
- ariaLabel={closeLabel}
+ aria-label={closeLabel}
onClick={onClose}
- variant="tertiary"
- size="medium"
- />
+ variant="ghost"
+ size="md"
+ >
+ <IconX />
+ </IconButton>
</div>
</div>
);
diff --git a/packages/twenty-companion/src/renderer/components/ShortcutSetting.tsx b/packages/twenty-companion/src/renderer/components/ShortcutSetting.tsx
index 9285891e63f..0b7c0245198 100644
--- a/packages/twenty-companion/src/renderer/components/ShortcutSetting.tsx
+++ b/packages/twenty-companion/src/renderer/components/ShortcutSetting.tsx
@@ -4,7 +4,7 @@ import { formatShortcut } from '../utils/formatShortcut';
import { i18n } from '@lingui/core';
import { SettingsCardContent } from './SettingsCardContent';
import { THEME_COMMON } from '@ui/theme/constants/ThemeCommon';
-import { IconButton } from '@ui/primitives/input/IconButton/IconButton';
+import { IconButton } from '@ui/components/IconButton/IconButton';
import { useState } from 'react';
import { IconCommand, IconRestore } from 'twenty-ui/icon';
import { Button } from '@ui/primitives/input/Button/Button';
@@ -32,8 +32,8 @@ export const ShortcutSetting = ({ state, isPending, command }: ActionProps) => {
<div className="button-group shortcut-actions">
{state.settings.openShortcut !== DEFAULT_SETTINGS.openShortcut && (
<IconButton
- variant="tertiary"
- ariaLabel={i18n._('Reset shortcut')}
+ variant="ghost"
+ aria-label={i18n._('Reset shortcut')}
disabled={isPending('settings')}
onClick={() =>
void command({
@@ -41,9 +41,10 @@ export const ShortcutSetting = ({ state, isPending, command }: ActionProps) => {
settings: { openShortcut: DEFAULT_SETTINGS.openShortcut },
})
}
- size="medium"
- Icon={IconRestore}
- />
+ size="md"
+ >
+ <IconRestore />
+ </IconButton>
)}
<div
onBlur={() => setCapturing(false)}
diff --git a/packages/twenty-companion/src/renderer/components/__tests__/sharedControls.test.tsx b/packages/twenty-companion/src/renderer/components/__tests__/sharedControls.test.tsx
index 710c9610b5d..404763b99fe 100644
--- a/packages/twenty-companion/src/renderer/components/__tests__/sharedControls.test.tsx
+++ b/packages/twenty-companion/src/renderer/components/__tests__/sharedControls.test.tsx
@@ -2,25 +2,18 @@
import { cleanup, render, screen } from '@testing-library/react';
import { afterEach, expect, it } from 'vitest';
import { IconSettings } from 'twenty-ui/icon';
-import { IconButton } from '@ui/primitives/input/IconButton/IconButton';
+import { IconButton } from '@ui/components/IconButton/IconButton';
import { Button } from '@ui/primitives/input/Button/Button';
afterEach(cleanup);
it('keeps a native accessible name on composed icon buttons', () => {
- render(<IconButton Icon={IconSettings} aria-label="Open settings" />);
- expect(screen.getByRole('button', { name: 'Open settings' })).toBeDefined();
-});
-
-it('keeps the legacy accessible name when both name props are supplied', () => {
render(
- <IconButton
- Icon={IconSettings}
- ariaLabel="Settings"
- aria-label="Native label"
- />,
+ <IconButton aria-label="Open settings">
+ <IconSettings />
+ </IconButton>,
);
- expect(screen.getByRole('button', { name: 'Settings' })).toBeDefined();
+ expect(screen.getByRole('button', { name: 'Open settings' })).toBeDefined();
});
it('places the disclosure state on the actual button', () => {
diff --git a/packages/twenty-docs/docs.json b/packages/twenty-docs/docs.json
index de1d3dfa2f1..a30909a8f39 100644
--- a/packages/twenty-docs/docs.json
+++ b/packages/twenty-docs/docs.json
@@ -574,7 +574,8 @@
"pages": [
"ui/components/overview",
"ui/components/input/main-button",
- "ui/components/input/light-button"
+ "ui/components/input/light-button",
+ "ui/components/input/icon-button"
]
}
]
diff --git a/packages/twenty-docs/navigation/base-structure.json b/packages/twenty-docs/navigation/base-structure.json
index 5973d09f890..f5a1d4d020a 100644
--- a/packages/twenty-docs/navigation/base-structure.json
+++ b/packages/twenty-docs/navigation/base-structure.json
@@ -586,7 +586,8 @@
"pages": [
"ui/components/overview",
"ui/components/input/main-button",
- "ui/components/input/light-button"
+ "ui/components/input/light-button",
+ "ui/components/input/icon-button"
]
}
]
diff --git a/packages/twenty-docs/snippets/ui/generated/input/button.mdx b/packages/twenty-docs/snippets/ui/generated/input/button.mdx
index df45febe745..36dd3b3529c 100644
--- a/packages/twenty-docs/snippets/ui/generated/input/button.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/input/button.mdx
@@ -44,17 +44,8 @@
Shows a loading indicator and disables activation while preserving the button width.
</ParamField>
-<ParamField body="nativeButton" type="boolean" default="true">
- Whether the component renders a native `<button>` element when replacing it
- via the `render` prop.
- Set to `false` if the rendered element is not a button (for example, `<div>`).
-</ParamField>
-
<ParamField body="render" type="ReactElement&lt;unknown, string | JSXElementConstructor&lt;any&gt;&gt; | ComponentRenderFn&lt;HTMLProps, ButtonState&gt;">
- Allows you to replace the component's HTML element
- with a different tag, or compose it with another component.
-
- Accepts a `ReactElement` or a function that returns the element to render.
+ Caller-supplied root element or renderer. Preserve a native button, or an anchor when `href` is set. Router integration belongs to the caller.
</ParamField>
<ParamField body="size" type="&quot;sm&quot; | &quot;md&quot;" default="md">
diff --git a/packages/twenty-docs/snippets/ui/generated/input/icon-button.mdx b/packages/twenty-docs/snippets/ui/generated/input/icon-button.mdx
new file mode 100644
index 00000000000..5d806538d02
--- /dev/null
+++ b/packages/twenty-docs/snippets/ui/generated/input/icon-button.mdx
@@ -0,0 +1,70 @@
+{/*
+ * _____ _
+ *|_ _|_ _____ _ __ | |_ _ _
+ * | | \ \ /\ / / _ \ '_ \| __| | | | Auto-generated file
+ * | | \ V V / __/ | | | |_| |_| | DO NOT EDIT - changes will be overwritten
+ * |_| \_/\_/ \___|_| |_|\__|\__, | Generated by: npx nx generate:ui twenty-docs
+ * |___/
+ *
+ * This file is generated from the documentation data in packages/twenty-ui/generated.
+ * To update it, edit the component prop types or design tokens in twenty-ui and run:
+ * npx nx generate:ui twenty-docs
+ */}
+
+<ParamField body="aria-label" type="string" required>
+ Required accessible name describing the action.
+</ParamField>
+
+<ParamField body="className" type="string | ((state: ButtonState) =&gt; string | undefined)">
+ CSS class applied to the element, or a function that
+ returns a class based on the component's state.
+</ParamField>
+
+<ParamField body="color" type="&quot;neutral&quot; | &quot;accent&quot; | &quot;danger&quot; | &quot;success&quot;">
+ Semantic color of the button.
+</ParamField>
+
+<ParamField body="elevated" type="boolean">
+ Adds a shadow to the button.
+</ParamField>
+
+<ParamField body="focusableWhenDisabled" type="boolean" default="false">
+ Whether the button should be focusable when disabled.
+</ParamField>
+
+<ParamField body="loading" type="boolean">
+ Shows a loading indicator and disables activation while preserving the button width.
+</ParamField>
+
+<ParamField body="render" type="ReactElement&lt;unknown, string | JSXElementConstructor&lt;any&gt;&gt; | ComponentRenderFn&lt;HTMLProps, ButtonState&gt;">
+ Caller-supplied root element or renderer. Preserve a native button, or an anchor when `href` is set. Router integration belongs to the caller.
+</ParamField>
+
+<ParamField body="size" type="&quot;sm&quot; | &quot;md&quot;">
+ Square button size: `sm` (24px) or `md` (32px).
+</ParamField>
+
+<ParamField body="style" type="CSSProperties | ((state: ButtonState) =&gt; CSSProperties | undefined)">
+ Style applied to the element, or a function that
+ returns a style object based on the component's state.
+</ParamField>
+
+<ParamField body="tooltip" type="string">
+ Text displayed when hovering or focusing the button.
+</ParamField>
+
+<ParamField body="tooltipDelay" type="&quot;0ms&quot; | &quot;300ms&quot; | &quot;500ms&quot; | &quot;1000ms&quot;" default="TooltipDelay.longDelay">
+ Delay before showing the tooltip.
+</ParamField>
+
+<ParamField body="tooltipOffset" type="number" default="5">
+ Distance in pixels between the button and the tooltip.
+</ParamField>
+
+<ParamField body="tooltipPlace" type="&quot;top&quot; | &quot;left&quot; | &quot;right&quot; | &quot;bottom&quot;" default="TooltipPosition.Bottom">
+ Preferred placement of the tooltip relative to the button.
+</ParamField>
+
+<ParamField body="variant" type="&quot;solid&quot; | &quot;outline&quot; | &quot;ghost&quot; | &quot;soft&quot;">
+ Visual treatment of the button surface.
+</ParamField>
diff --git a/packages/twenty-docs/snippets/ui/generated/input/light-button.mdx b/packages/twenty-docs/snippets/ui/generated/input/light-button.mdx
index e705f8cbceb..1193ae4b6d9 100644
--- a/packages/twenty-docs/snippets/ui/generated/input/light-button.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/input/light-button.mdx
@@ -48,17 +48,8 @@
Shows a loading indicator and disables activation while preserving the button width.
</ParamField>
-<ParamField body="nativeButton" type="boolean" default="true">
- Whether the component renders a native `<button>` element when replacing it
- via the `render` prop.
- Set to `false` if the rendered element is not a button (for example, `<div>`).
-</ParamField>
-
<ParamField body="render" type="ReactElement&lt;unknown, string | JSXElementConstructor&lt;any&gt;&gt; | ComponentRenderFn&lt;HTMLProps, ButtonState&gt;">
- Allows you to replace the component's HTML element
- with a different tag, or compose it with another component.
-
- Accepts a `ReactElement` or a function that returns the element to render.
+ Caller-supplied root element or renderer. Preserve a native button, or an anchor when `href` is set. Router integration belongs to the caller.
</ParamField>
<ParamField body="size" type="&quot;sm&quot; | &quot;md&quot;" default="sm">
diff --git a/packages/twenty-docs/snippets/ui/generated/input/main-button.mdx b/packages/twenty-docs/snippets/ui/generated/input/main-button.mdx
index 257ae0c694f..7ddfeec6af5 100644
--- a/packages/twenty-docs/snippets/ui/generated/input/main-button.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/input/main-button.mdx
@@ -44,17 +44,8 @@
Shows a loading indicator and disables activation while preserving the button width.
</ParamField>
-<ParamField body="nativeButton" type="boolean" default="true">
- Whether the component renders a native `<button>` element when replacing it
- via the `render` prop.
- Set to `false` if the rendered element is not a button (for example, `<div>`).
-</ParamField>
-
<ParamField body="render" type="ReactElement&lt;unknown, string | JSXElementConstructor&lt;any&gt;&gt; | ComponentRenderFn&lt;HTMLProps, ButtonState&gt;">
- Allows you to replace the component's HTML element
- with a different tag, or compose it with another component.
-
- Accepts a `ReactElement` or a function that returns the element to render.
+ Caller-supplied root element or renderer. Preserve a native button, or an anchor when `href` is set. Router integration belongs to the caller.
</ParamField>
<ParamField body="size" type="&quot;sm&quot; | &quot;md&quot;">
diff --git a/packages/twenty-docs/ui/components/input/icon-button.mdx b/packages/twenty-docs/ui/components/input/icon-button.mdx
new file mode 100644
index 00000000000..887e3329fe2
--- /dev/null
+++ b/packages/twenty-docs/ui/components/input/icon-button.mdx
@@ -0,0 +1,94 @@
+---
+title: IconButton
+description: Trigger actions with accessible square icon buttons.
+---
+
+import { StoryEmbed } from '/snippets/ui/StoryEmbed.mdx';
+
+import IconButtonReference from '/snippets/ui/generated/input/icon-button.mdx';
+
+`IconButton` composes [Button](/ui/primitives/input/button) with a square surface. Pass the icon as children and provide an `aria-label` describing the action. Icon content is decorative and hidden from assistive technology.
+
+## Usage
+
+```tsx
+import { IconButton } from 'twenty-ui/components';
+import { IconPlus } from 'twenty-ui/icon';
+
+export const CreateRecordButton = () => (
+ <IconButton
+ aria-label="Create record"
+ variant="solid"
+ color="accent"
+ size="sm"
+ >
+ <IconPlus />
+ </IconButton>
+);
+```
+
+Sizes are `sm` (24px) and `md` (32px). The defaults are `md`, `outline`, and `neutral`. Variants and colors match Button.
+
+<StoryEmbed
+ title="Icon button example"
+ storyId="ui-components-iconbutton--catalog"
+ height={620}
+/>
+
+## Tooltip
+
+Add `tooltip` to show text on hover and keyboard focus. Keep `aria-label` as the accessible name of the action. Disabled and loading buttons retain hover tooltips.
+
+```tsx
+import { IconButton } from 'twenty-ui/components';
+import { IconSearch } from 'twenty-ui/icon';
+
+export const SearchRecordsButton = () => (
+ <IconButton aria-label="Search" tooltip="Search records" variant="ghost">
+ <IconSearch />
+ </IconButton>
+);
+```
+
+<StoryEmbed
+ title="Icon button with tooltip"
+ storyId="ui-components-iconbutton--tooltip"
+ height={180}
+/>
+
+The tooltip defaults to the bottom, with a 1000ms delay and a 5px offset. Use `tooltipPlace`, `tooltipDelay`, and `tooltipOffset` to adjust it. Omitting `tooltip` renders the button directly.
+
+## State ownership
+
+Your application supplies `loading` and `disabled`. Both prevent activation. Loading preserves the square dimensions and accessible label. The button does not track a selected value or set loading automatically after a click. Native keyboard focus follows the browser; use `aria-pressed` when your application owns a toggle state.
+
+## Grouped actions
+
+```tsx
+import { ButtonGroup } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
+import { IconPlus, IconSearch } from 'twenty-ui/icon';
+
+export const RecordActions = () => (
+ <ButtonGroup aria-label="Record actions" size="sm" variant="outline">
+ <IconButton aria-label="Search records">
+ <IconSearch />
+ </IconButton>
+ <IconButton aria-label="Create record">
+ <IconPlus />
+ </IconButton>
+ </ButtonGroup>
+);
+```
+
+[ButtonGroup](/ui/primitives/input/button-group) supplies size, variant, color, and adjoining corners. Individual buttons do not need a position prop.
+
+## Links and forms
+
+Use `href` to render an anchor. The caller can provide a custom `render` element, including its own router link. Supply `href` to select link semantics; the renderer must preserve an anchor. Without `href`, preserve a native button. Neither `nativeButton` nor `role` is part of the public button interface. Disabled links cannot activate. Routing stays in the application.
+
+Native attributes, event handlers, refs, and render composition pass through to Button. The default is `type="button"`; set `type="submit"` explicitly for form submission.
+
+## Props
+
+<IconButtonReference />
diff --git a/packages/twenty-docs/ui/components/input/light-button.mdx b/packages/twenty-docs/ui/components/input/light-button.mdx
index 1b1f1a5d26a..fd12b062b43 100644
--- a/packages/twenty-docs/ui/components/input/light-button.mdx
+++ b/packages/twenty-docs/ui/components/input/light-button.mdx
@@ -47,8 +47,9 @@ and color; subtle emphasis does not replace the group's semantic color.
`LightButton` accepts Button's native attributes, refs, event handlers, icon
slots, loading and disabled states, and render composition. Its native default
is `type="button"`. Set `type="submit"` for submission or use `href` for a link.
-Router links use `render`, `nativeButton={false}`, and `role="link"` at the
-application routing seam. Consumer classes and state functions pass through.
+Supply `render` to choose a custom root, including an application-owned router
+link. The root must preserve a native button, or an anchor when `href` is set.
+Button derives the interaction behavior from `href`.
## Props
diff --git a/packages/twenty-docs/ui/components/input/main-button.mdx b/packages/twenty-docs/ui/components/input/main-button.mdx
index 8eec7a32346..759c8514786 100644
--- a/packages/twenty-docs/ui/components/input/main-button.mdx
+++ b/packages/twenty-docs/ui/components/input/main-button.mdx
@@ -44,8 +44,10 @@ Keep page layout in your application's styling.
`loading`, `disabled`, and `soon` props. Buttons default to `type="button"`;
set `type="submit"` explicitly for form submission.
-Use `href` for a link or compose a router link through `render`,
-`nativeButton={false}`, and `role="link"`. Routing belongs to the application.
+Use `href` for a link. Supply `render` to choose a custom root, including an
+application-owned router link. The root must preserve a native button, or an
+anchor when `href` is set. Button derives the interaction behavior from `href`.
+
[ButtonGroup](/ui/primitives/input/button-group) can set a shared size, surface,
and color. Consumer classes, including state functions, pass through to the root.
diff --git a/packages/twenty-docs/ui/components/overview.mdx b/packages/twenty-docs/ui/components/overview.mdx
index f6c2c75e7c8..a489dc5ba15 100644
--- a/packages/twenty-docs/ui/components/overview.mdx
+++ b/packages/twenty-docs/ui/components/overview.mdx
@@ -10,7 +10,8 @@ Import shared components from `twenty-ui/components`. See [Getting started](/ui/
## Browse components
-| Component | Purpose |
-| ------------------------------------------------ | --------------------------------------------------------------------- |
-| [MainButton](/ui/components/input/main-button) | Prominent actions with a solid surface, elevation, and semibold text. |
-| [LightButton](/ui/components/input/light-button) | Lightweight actions with standard or subtle emphasis. |
+| Component | Purpose |
+| ---------------------------------------------------------------------- | --------------------------------------------------------------------- |
+| [MainButton](/ui/components/input/main-button) | Prominent actions with a solid surface, elevation, and semibold text. |
+| [LightButton](/ui/components/input/light-button) | Lightweight actions with standard or subtle emphasis. |
+| [IconButton](/ui/components/input/icon-button) | Square icon actions built on Button. |
diff --git a/packages/twenty-docs/ui/primitives/input/button.mdx b/packages/twenty-docs/ui/primitives/input/button.mdx
index 0208e81e023..02889677ba6 100644
--- a/packages/twenty-docs/ui/primitives/input/button.mdx
+++ b/packages/twenty-docs/ui/primitives/input/button.mdx
@@ -82,7 +82,7 @@ export const DocumentationLink = () => (
);
```
-`href` renders an anchor with link semantics. For a router link, use `render={<Link to="/settings" />}`, `nativeButton={false}`, and `role="link"`. Disabled links cannot activate.
+`href` renders an anchor with link semantics. The caller can supply its own `render` element or router link. Set `href` and preserve an anchor for navigation; without `href`, preserve a native button. Button derives its semantics without public `nativeButton` or `role` flags. Disabled links cannot activate.
Buttons default to `type="button"`. Set `type="submit"` or `type="reset"` explicitly for forms. Native props, event handlers, refs, and Base UI's `render` prop pass through to the root.
diff --git a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-input-gallery.front-component.tsx b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-input-gallery.front-component.tsx
index 928bb84fedf..bee3583b0d6 100644
--- a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-input-gallery.front-component.tsx
+++ b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-input-gallery.front-component.tsx
@@ -1,5 +1,5 @@
import { defineFrontComponent } from 'twenty-sdk/define';
-import { LightButton, MainButton } from 'twenty-ui/components';
+import { IconButton, LightButton, MainButton } from 'twenty-ui/components';
import { IconPlus, IconSearch, IconStar, IconTrash } from 'twenty-ui/icon';
import {
AnimatedButton,
@@ -14,7 +14,6 @@ import {
FloatingButtonGroup,
FloatingIconButton,
FloatingIconButtonGroup,
- IconButton,
IconButtonGroup,
IconListViewGrip,
InsideButton,
@@ -137,7 +136,11 @@ const INPUT_ENTRIES: GalleryEntry[] = [
},
{
name: 'IconButton',
- node: <IconButton Icon={IconPlus} ariaLabel="Add" onClick={() => {}} />,
+ node: (
+ <IconButton aria-label="Add" onClick={() => {}}>
+ <IconPlus />
+ </IconButton>
+ ),
},
{
name: 'IconButtonGroup',
diff --git a/packages/twenty-front/src/modules/activities/files/components/AttachmentList.tsx b/packages/twenty-front/src/modules/activities/files/components/AttachmentList.tsx
index 4164454a2f0..a29bdbfae67 100644
--- a/packages/twenty-front/src/modules/activities/files/components/AttachmentList.tsx
+++ b/packages/twenty-front/src/modules/activities/files/components/AttachmentList.tsx
@@ -24,7 +24,7 @@ import { useModal } from '@/ui/layout/modal/hooks/useModal';
import { ScrollWrapper } from '@/ui/utilities/scroll/components/ScrollWrapper';
import { isDefined } from 'twenty-shared/utils';
import { IconDownload, IconX } from 'twenty-ui/icon';
-import { IconButton } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
import { themeCssVariables } from 'twenty-ui/theme-constants';
import { PermissionFlagType } from '~/generated-metadata/graphql';
import { AttachmentRow } from './AttachmentRow';
@@ -191,16 +191,20 @@ export const AttachmentList = ({
<StyledButtonContainer>
{hasDownloadPermission && (
<IconButton
- Icon={IconDownload}
+ aria-label={t`Download attachment`}
onClick={handleDownload}
- size="small"
- />
+ size="sm"
+ >
+ <IconDownload />
+ </IconButton>
)}
<IconButton
- Icon={IconX}
+ aria-label={t`Close preview`}
onClick={handleClosePreview}
- size="small"
- />
+ size="sm"
+ >
+ <IconX />
+ </IconButton>
</StyledButtonContainer>
</StyledHeader>
</ModalHeader>
diff --git a/packages/twenty-front/src/modules/activities/timeline-activities/rows/components/EventCardToggleButton.tsx b/packages/twenty-front/src/modules/activities/timeline-activities/rows/components/EventCardToggleButton.tsx
index 3b2a91eb1a7..f1e12c6de7d 100644
--- a/packages/twenty-front/src/modules/activities/timeline-activities/rows/components/EventCardToggleButton.tsx
+++ b/packages/twenty-front/src/modules/activities/timeline-activities/rows/components/EventCardToggleButton.tsx
@@ -1,7 +1,7 @@
import { TIMELINE_ICON_SLOT_SIZE } from '@/activities/timeline-activities/constants/TimelineIconSlotSize';
import { styled } from '@linaria/react';
import { useLingui } from '@lingui/react/macro';
-import { IconButton } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
import { IconChevronDown, IconChevronUp } from 'twenty-ui/icon';
import { themeCssVariables } from 'twenty-ui/theme-constants';
@@ -27,12 +27,13 @@ export const EventCardToggleButton = ({
return (
<StyledButtonContainer>
<IconButton
- Icon={isOpen ? IconChevronUp : IconChevronDown}
onClick={() => setIsOpen(!isOpen)}
- ariaLabel={isOpen ? t`Collapse details` : t`Expand details`}
- size="small"
- variant="secondary"
- />
+ aria-label={isOpen ? t`Collapse details` : t`Expand details`}
+ size="sm"
+ variant="outline"
+ >
+ {isOpen ? <IconChevronUp /> : <IconChevronDown />}
+ </IconButton>
</StyledButtonContainer>
);
};
diff --git a/packages/twenty-front/src/modules/ai/components/AiChatCloseButton.tsx b/packages/twenty-front/src/modules/ai/components/AiChatCloseButton.tsx
index 6611e66892b..7582fdffd26 100644
--- a/packages/twenty-front/src/modules/ai/components/AiChatCloseButton.tsx
+++ b/packages/twenty-front/src/modules/ai/components/AiChatCloseButton.tsx
@@ -1,17 +1,18 @@
import { useLingui } from '@lingui/react/macro';
import { IconX } from 'twenty-ui/icon';
-import { IconButton } from 'twenty-ui/primitives/input';
+import { type ButtonVariant } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
import { useReturnFromExpandedAiChat } from '@/ai/hooks/useReturnFromExpandedAiChat';
import { isWelcomeAnimationVisibleState } from '@/onboarding/states/isWelcomeAnimationVisibleState';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
type AiChatCloseButtonProps = {
- variant?: 'primary' | 'secondary';
+ variant?: ButtonVariant;
};
export const AiChatCloseButton = ({
- variant = 'secondary',
+ variant = 'outline',
}: AiChatCloseButtonProps) => {
const { t } = useLingui();
const returnFromExpandedAiChat = useReturnFromExpandedAiChat({
@@ -23,12 +24,13 @@ export const AiChatCloseButton = ({
return (
<IconButton
- Icon={IconX}
- size="small"
+ size="sm"
variant={variant}
disabled={isWelcomeAnimationVisible}
onClick={returnFromExpandedAiChat}
- ariaLabel={t`Close`}
- />
+ aria-label={t`Close`}
+ >
+ <IconX />
+ </IconButton>
);
};
diff --git a/packages/twenty-front/src/modules/ai/components/AiChatPageHeader.tsx b/packages/twenty-front/src/modules/ai/components/AiChatPageHeader.tsx
index 7989ae0c9d1..b74241d6ce0 100644
--- a/packages/twenty-front/src/modules/ai/components/AiChatPageHeader.tsx
+++ b/packages/twenty-front/src/modules/ai/components/AiChatPageHeader.tsx
@@ -68,7 +68,7 @@ export const AiChatPageHeader = () => {
) : (
<StyledHeaderTitle>{isNewChat ? t`New chat` : null}</StyledHeaderTitle>
)}
- {isMobile && <AiChatCloseButton variant="primary" />}
+ {isMobile && <AiChatCloseButton />}
<AiChatThreadDeleteConfirmationModal
surface={AI_CHAT_THREAD_ACTIONS_SURFACE.PAGE_HEADER}
/>
diff --git a/packages/twenty-front/src/modules/ai/components/AiChatPageThreadHeader.tsx b/packages/twenty-front/src/modules/ai/components/AiChatPageThreadHeader.tsx
index a2c455c7188..542976dd173 100644
--- a/packages/twenty-front/src/modules/ai/components/AiChatPageThreadHeader.tsx
+++ b/packages/twenty-front/src/modules/ai/components/AiChatPageThreadHeader.tsx
@@ -3,7 +3,8 @@ import { useLingui } from '@lingui/react/macro';
import { Key } from 'ts-key-enum';
import { isDefined } from 'twenty-shared/utils';
import { IconDotsVertical, IconPlus } from 'twenty-ui/icon';
-import { Button, IconButton } from 'twenty-ui/primitives/input';
+import { Button } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { themeCssVariables } from 'twenty-ui/theme-constants';
@@ -117,11 +118,12 @@ export const AiChatPageThreadHeader = ({
onRenameRequested={startRename}
clickableComponent={
<IconButton
- Icon={IconDotsVertical}
- size="small"
- variant="secondary"
- ariaLabel={t`Chat actions`}
- />
+ size="sm"
+ variant="outline"
+ aria-label={t`Chat actions`}
+ >
+ <IconDotsVertical />
+ </IconButton>
}
/>
</StyledActions>
diff --git a/packages/twenty-front/src/modules/ai/components/internal/AgentChatFileUploadButton.tsx b/packages/twenty-front/src/modules/ai/components/internal/AgentChatFileUploadButton.tsx
index 98b1975ff4f..67598b41e25 100644
--- a/packages/twenty-front/src/modules/ai/components/internal/AgentChatFileUploadButton.tsx
+++ b/packages/twenty-front/src/modules/ai/components/internal/AgentChatFileUploadButton.tsx
@@ -5,7 +5,7 @@ import { styled } from '@linaria/react';
import { t } from '@lingui/core/macro';
import React, { useRef } from 'react';
import { IconPaperclip } from 'twenty-ui/icon';
-import { IconButton } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
import { themeCssVariables } from 'twenty-ui/theme-constants';
const StyledFileUploadContainer = styled.div`
@@ -47,14 +47,15 @@ export const AgentChatFileUploadButton = () => {
/>
<IconButton
- variant="tertiary"
- size="small"
+ variant="ghost"
+ size="sm"
onClick={() => {
fileInputRef.current?.click();
}}
- Icon={IconPaperclip}
- ariaLabel={t`Attach files`}
- />
+ aria-label={t`Attach files`}
+ >
+ <IconPaperclip />
+ </IconButton>
</StyledFileUploadContainer>
);
};
diff --git a/packages/twenty-front/src/modules/ai/dictation/components/AiChatDictationButton.tsx b/packages/twenty-front/src/modules/ai/dictation/components/AiChatDictationButton.tsx
index d0075d56c1c..699e34ce921 100644
--- a/packages/twenty-front/src/modules/ai/dictation/components/AiChatDictationButton.tsx
+++ b/packages/twenty-front/src/modules/ai/dictation/components/AiChatDictationButton.tsx
@@ -1,6 +1,6 @@
import { t } from '@lingui/core/macro';
import { IconMicrophone } from 'twenty-ui/icon';
-import { IconButton } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
import { useDictation } from '@/ai/dictation/hooks/useDictation';
@@ -15,12 +15,13 @@ export const AiChatDictationButton = () => {
return (
<IconButton
- variant="tertiary"
- size="small"
- accent={isRecording ? 'danger' : 'default'}
+ variant="ghost"
+ size="sm"
+ color={isRecording ? 'danger' : 'neutral'}
onClick={toggleDictation}
- Icon={IconMicrophone}
- ariaLabel={ariaLabel}
- />
+ aria-label={ariaLabel}
+ >
+ <IconMicrophone />
+ </IconButton>
);
};
diff --git a/packages/twenty-front/src/modules/command-menu/components/CommandMenuButton.tsx b/packages/twenty-front/src/modules/command-menu/components/CommandMenuButton.tsx
index 6431f24f450..da810eac722 100644
--- a/packages/twenty-front/src/modules/command-menu/components/CommandMenuButton.tsx
+++ b/packages/twenty-front/src/modules/command-menu/components/CommandMenuButton.tsx
@@ -1,6 +1,7 @@
import { NavigationButton } from '@/ui/input/components/NavigationButton';
import { type MouseEvent, useId } from 'react';
+import { Link } from 'react-router-dom';
import { type Nullable } from 'twenty-shared/types';
import { isDefined, isNonEmptyArray } from 'twenty-shared/utils';
import { type IconComponent } from 'twenty-ui/icon';
@@ -9,7 +10,7 @@ import {
TooltipDelay,
TooltipPosition,
} from 'twenty-ui/primitives/surfaces';
-import { IconButton } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
export type CommandMenuButtonProps = {
command: {
@@ -69,15 +70,17 @@ export const CommandMenuButton = ({
) : (
<IconButton
id={tooltipId}
- Icon={command.Icon}
- size="small"
- variant="primary"
- accent={buttonAccent}
- to={to}
+ size="sm"
+ variant={buttonAccent === 'blue' ? 'solid' : 'outline'}
+ color={buttonAccent === 'blue' ? 'accent' : 'neutral'}
+ render={isDefined(to) ? <Link to={to} /> : undefined}
+ href={to}
onClick={onClick}
disabled={disabled}
- ariaLabel={command.label}
- />
+ aria-label={command.label}
+ >
+ <command.Icon />
+ </IconButton>
)}
{(hasHotKeys || !isDefined(resolvedShortLabel)) && (
<AppTooltip
diff --git a/packages/twenty-front/src/modules/information-banner/components/InformationBanner.tsx b/packages/twenty-front/src/modules/information-banner/components/InformationBanner.tsx
index 6f1297e6136..95010fa6118 100644
--- a/packages/twenty-front/src/modules/information-banner/components/InformationBanner.tsx
+++ b/packages/twenty-front/src/modules/information-banner/components/InformationBanner.tsx
@@ -4,6 +4,7 @@ import { InformationBannerComponentInstanceContext } from '@/information-banner/
import { informationBannerIsOpenComponentState } from '@/information-banner/states/informationBannerIsOpenComponentState';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { styled } from '@linaria/react';
+import { css } from '@linaria/core';
import { t } from '@lingui/core/macro';
import {
Banner,
@@ -11,7 +12,8 @@ import {
type BannerVariant,
} from 'twenty-ui/primitives/feedback';
import { type IconComponent, IconX } from 'twenty-ui/icon';
-import { Button, IconButton } from 'twenty-ui/primitives/input';
+import { Button } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { themeCssVariables } from 'twenty-ui/theme-constants';
@@ -19,7 +21,7 @@ const StyledText = styled.div`
min-width: 0;
`;
-const StyledInvertedIconButton = styled(IconButton)`
+const INVERTED_ICON_BUTTON_CLASS_NAME = css`
color: ${themeCssVariables.font.color.inverted} !important;
`;
@@ -94,22 +96,25 @@ export const InformationBanner = ({
</StyledContent>
{onClose &&
(isPrimary ? (
- <StyledInvertedIconButton
- Icon={IconX}
- size="small"
- variant="tertiary"
+ <IconButton
+ className={INVERTED_ICON_BUTTON_CLASS_NAME}
+ size="sm"
+ variant="ghost"
onClick={onClose}
- ariaLabel={t`Close banner`}
- />
+ aria-label={t`Close banner`}
+ >
+ <IconX />
+ </IconButton>
) : (
<IconButton
- Icon={IconX}
- size="small"
- variant="tertiary"
- accent={buttonAccent}
+ size="sm"
+ variant="ghost"
+ color={buttonAccent === 'blue' ? 'accent' : 'danger'}
onClick={onClose}
- ariaLabel={t`Close banner`}
- />
+ aria-label={t`Close banner`}
+ >
+ <IconX />
+ </IconButton>
))}
</Banner>
)}
diff --git a/packages/twenty-front/src/modules/keyboard-shortcut-menu/components/KeyboardShortcutMenuDialog.tsx b/packages/twenty-front/src/modules/keyboard-shortcut-menu/components/KeyboardShortcutMenuDialog.tsx
index bbabbb72d52..55a2c99fc4f 100644
--- a/packages/twenty-front/src/modules/keyboard-shortcut-menu/components/KeyboardShortcutMenuDialog.tsx
+++ b/packages/twenty-front/src/modules/keyboard-shortcut-menu/components/KeyboardShortcutMenuDialog.tsx
@@ -4,7 +4,7 @@ import {
StyledHeading,
} from './KeyboardShortcutMenuStyles';
import { t } from '@lingui/core/macro';
-import { IconButton } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
import { IconX } from 'twenty-ui/icon';
import { useIsMobile } from 'twenty-ui/utilities';
@@ -23,7 +23,13 @@ export const KeyboardMenuDialog = ({
<StyledDialog isMobile={isMobile}>
<StyledHeading>
{t`Keyboard shortcuts`}
- <IconButton variant="tertiary" Icon={IconX} onClick={onClose} />
+ <IconButton
+ aria-label={t`Close keyboard shortcuts`}
+ variant="ghost"
+ onClick={onClose}
+ >
+ <IconX />
+ </IconButton>
</StyledHeading>
<StyledContainer>{children}</StyledContainer>
</StyledDialog>
diff --git a/packages/twenty-front/src/modules/object-core/workflows/components/CoreWorkflowsFilterBar.tsx b/packages/twenty-front/src/modules/object-core/workflows/components/CoreWorkflowsFilterBar.tsx
index 33128c445e8..cb4aa9af366 100644
--- a/packages/twenty-front/src/modules/object-core/workflows/components/CoreWorkflowsFilterBar.tsx
+++ b/packages/twenty-front/src/modules/object-core/workflows/components/CoreWorkflowsFilterBar.tsx
@@ -1,7 +1,7 @@
import { styled } from '@linaria/react';
import { useLingui } from '@lingui/react/macro';
import { IconFilter } from 'twenty-ui/icon';
-import { IconButton } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
import { themeCssVariables } from 'twenty-ui/theme-constants';
import { findCoreWorkflowFilterField } from '@/object-core/workflows/utils/findCoreWorkflowFilterField';
@@ -60,12 +60,13 @@ export const CoreWorkflowsFilterBar = () => {
/>
))}
<IconButton
- Icon={IconFilter}
- variant="secondary"
- size="small"
- ariaLabel={t`Filter`}
+ variant="outline"
+ size="sm"
+ aria-label={t`Filter`}
onClick={openCoreWorkflowFiltersSidePanel}
- />
+ >
+ <IconFilter />
+ </IconButton>
</StyledContainer>
);
};
diff --git a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRecordFilterGroupOptionsDropdown.tsx b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRecordFilterGroupOptionsDropdown.tsx
index 6b7611f30d9..c377c85e6f2 100644
--- a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRecordFilterGroupOptionsDropdown.tsx
+++ b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRecordFilterGroupOptionsDropdown.tsx
@@ -9,7 +9,7 @@ import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/Drop
import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';
import { t } from '@lingui/core/macro';
import { IconDotsVertical, IconTrash } from 'twenty-ui/icon';
-import { IconButton } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
import { MenuItem } from 'twenty-ui/primitives/navigation';
type AdvancedFilterRecordFilterGroupOptionsDropdownProps = {
@@ -48,11 +48,9 @@ export const AdvancedFilterRecordFilterGroupOptionsDropdown = ({
<Dropdown
dropdownId={dropdownId}
clickableComponent={
- <IconButton
- aria-label={t`Filter group rule options`}
- variant="tertiary"
- Icon={IconDotsVertical}
- />
+ <IconButton aria-label={t`Filter group rule options`} variant="ghost">
+ <IconDotsVertical />
+ </IconButton>
}
dropdownComponents={
<DropdownContent>
diff --git a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRecordFilterOptionsDropdown.tsx b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRecordFilterOptionsDropdown.tsx
index 979fc76de6c..b90240fafb1 100644
--- a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRecordFilterOptionsDropdown.tsx
+++ b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRecordFilterOptionsDropdown.tsx
@@ -14,7 +14,7 @@ import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/use
import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { IconDotsVertical, IconTrash } from 'twenty-ui/icon';
-import { IconButton } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
import { MenuItem } from 'twenty-ui/primitives/navigation';
type AdvancedFilterRecordFilterOptionsDropdownProps = {
@@ -68,11 +68,9 @@ export const AdvancedFilterRecordFilterOptionsDropdown = ({
<Dropdown
dropdownId={dropdownId}
clickableComponent={
- <IconButton
- aria-label={t`Record filter rule options`}
- variant="tertiary"
- Icon={IconDotsVertical}
- />
+ <IconButton aria-label={t`Record filter rule options`} variant="ghost">
+ <IconDotsVertical />
+ </IconButton>
}
dropdownComponents={
<DropdownContent>
diff --git a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownMenuViewName.tsx b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownMenuViewName.tsx
index 8b4fbd07b2e..70feb3824e2 100644
--- a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownMenuViewName.tsx
+++ b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownMenuViewName.tsx
@@ -131,7 +131,7 @@ export const ObjectOptionsDropdownMenuViewName = ({
<DropdownMenuItemsContainer>
<StyledDropdownMenuIconAndNameContainer>
<IconPicker
- size="small"
+ size="sm"
onChange={handleIconChange}
selectedIconKey={viewPickerSelectedIcon}
/>
diff --git a/packages/twenty-front/src/modules/page-layout/components/PageLayoutRecordIdentifierBar.tsx b/packages/twenty-front/src/modules/page-layout/components/PageLayoutRecordIdentifierBar.tsx
index 822a08c3a34..63adcea293d 100644
--- a/packages/twenty-front/src/modules/page-layout/components/PageLayoutRecordIdentifierBar.tsx
+++ b/packages/twenty-front/src/modules/page-layout/components/PageLayoutRecordIdentifierBar.tsx
@@ -10,7 +10,7 @@ import { useLingui } from '@lingui/react/macro';
import { type ReactNode } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { IconPinned } from 'twenty-ui/icon';
-import { IconButtonWithTooltip } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
import { TooltipDelay } from 'twenty-ui/primitives/surfaces';
import { themeCssVariables } from 'twenty-ui/theme-constants';
@@ -112,15 +112,16 @@ export const PageLayoutRecordIdentifierBar = ({
{isPinnedTabEditable && isDefined(pinnedTab) && (
<StyledPinnedTab>
- <IconButtonWithTooltip
- Icon={IconPinned}
- ariaLabel={t`Edit pinned tab: ${pinnedTab.title}`}
+ <IconButton
+ aria-label={t`Edit pinned tab: ${pinnedTab.title}`}
onClick={() => openTabSettings(pinnedTab.id)}
- tooltipContent={t`Pinned tab, always shown on the left`}
+ tooltip={t`Pinned tab, always shown on the left`}
tooltipDelay={TooltipDelay.shortDelay}
- size="small"
- variant="tertiary"
- />
+ size="sm"
+ variant="ghost"
+ >
+ <IconPinned />
+ </IconButton>
</StyledPinnedTab>
)}
</StyledIdentifierCell>
diff --git a/packages/twenty-front/src/modules/page-layout/components/__tests__/PageLayoutRecordIdentifierBar.test.tsx b/packages/twenty-front/src/modules/page-layout/components/__tests__/PageLayoutRecordIdentifierBar.test.tsx
index 725dab3c102..7451af39b9f 100644
--- a/packages/twenty-front/src/modules/page-layout/components/__tests__/PageLayoutRecordIdentifierBar.test.tsx
+++ b/packages/twenty-front/src/modules/page-layout/components/__tests__/PageLayoutRecordIdentifierBar.test.tsx
@@ -28,12 +28,12 @@ jest.mock('@/page-layout/hooks/useOpenPageLayoutTabSettings', () => ({
}),
}));
-jest.mock('twenty-ui/primitives/input', () => ({
- IconButtonWithTooltip: ({
- ariaLabel,
+jest.mock('twenty-ui/components', () => ({
+ IconButton: ({
+ 'aria-label': ariaLabel,
onClick,
}: {
- ariaLabel: string;
+ 'aria-label': string;
onClick: () => void;
}) => (
<button aria-label={ariaLabel} onClick={onClick}>
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/CallRecordingAudioPlayer.tsx b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/CallRecordingAudioPlayer.tsx
index db6eb4d4bec..e548d8b0975 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/CallRecordingAudioPlayer.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/call-recording-transcript/components/CallRecordingAudioPlayer.tsx
@@ -9,7 +9,8 @@ import {
IconPlayerPause,
IconPlayerPlay,
} from 'twenty-ui/icon';
-import { Button, IconButton, Slider } from 'twenty-ui/primitives/input';
+import { Button, Slider } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
import { themeCssVariables } from 'twenty-ui/theme-constants';
const StyledAudioBar = styled.div`
@@ -140,6 +141,8 @@ export const CallRecordingAudioPlayer = ({
}
};
+ const PlaybackIcon = isPlaying ? IconPlayerPause : IconPlayerPlay;
+
return (
<StyledAudioBar>
<audio
@@ -183,19 +186,16 @@ export const CallRecordingAudioPlayer = ({
) : (
<>
<IconButton
- ariaLabel={isPlaying ? t`Pause` : t`Play`}
- Icon={
- isStalled
- ? undefined
- : isPlaying
- ? IconPlayerPause
- : IconPlayerPlay
- }
- size="small"
- variant="tertiary"
+ aria-label={isPlaying ? t`Pause` : t`Play`}
+ size="sm"
+ variant="ghost"
onClick={handleTogglePlayback}
>
- {isStalled && <CircularProgressBar barWidth={2} size={24} />}
+ {isStalled ? (
+ <CircularProgressBar barWidth={2} size={24} />
+ ) : (
+ <PlaybackIcon />
+ )}
</IconButton>
<StyledTrack>
{isDurationKnown ? (
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/field/components/FieldWidgetRelationEditAction.tsx b/packages/twenty-front/src/modules/page-layout/widgets/field/components/FieldWidgetRelationEditAction.tsx
index d56196690a0..e37fc442bb3 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/field/components/FieldWidgetRelationEditAction.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/field/components/FieldWidgetRelationEditAction.tsx
@@ -22,7 +22,7 @@ import { styled } from '@linaria/react';
import { t } from '@lingui/core/macro';
import { CustomError, isDefined } from 'twenty-shared/utils';
import { IconPencil, IconPlus } from 'twenty-ui/icon';
-import { IconButton } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
import { RelationType } from '~/generated-metadata/graphql';
type FieldWidgetRelationEditActionProps = {
@@ -88,17 +88,14 @@ export const FieldWidgetRelationEditAction = ({
fieldDefinition.metadata.relationType === RelationType.MANY_TO_ONE ||
hasAtLeastOneRelationRecord;
- const triggerIcon = isEditAction ? IconPencil : IconPlus;
+ const TriggerIcon = isEditAction ? IconPencil : IconPlus;
const triggerLabel = isEditAction ? t`Edit relation` : t`Add relation`;
const dropdownTriggerClickableComponent = (
<StyledEditButtonWrapper>
- <IconButton
- Icon={triggerIcon}
- variant="tertiary"
- size="small"
- ariaLabel={triggerLabel}
- />
+ <IconButton variant="ghost" size="sm" aria-label={triggerLabel}>
+ <TriggerIcon />
+ </IconButton>
</StyledEditButtonWrapper>
);
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/widget-card/components/WidgetCardHeader.tsx b/packages/twenty-front/src/modules/page-layout/widgets/widget-card/components/WidgetCardHeader.tsx
index 505cee45788..78fae6fdac5 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/widget-card/components/WidgetCardHeader.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/widget-card/components/WidgetCardHeader.tsx
@@ -7,7 +7,7 @@ import { styled } from '@linaria/react';
import { t } from '@lingui/core/macro';
import { type ReactNode, useContext } from 'react';
import { IconTrash } from 'twenty-ui/icon';
-import { IconButton } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { type WidgetCardVariant } from '@/page-layout/widgets/types/WidgetCardVariant';
@@ -129,11 +129,13 @@ export const WidgetCardHeader = ({
}}
>
<IconButton
+ aria-label={t`Remove widget`}
onClick={onRemove}
- Icon={IconTrash}
- variant="tertiary"
- size="small"
- />
+ variant="ghost"
+ size="sm"
+ >
+ <IconTrash />
+ </IconButton>
</StyledIconButtonContainer>
)}
</AnimatePresence>
diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsBlocklistTableRow.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsBlocklistTableRow.tsx
index 2af524df92b..51273863c41 100644
--- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsBlocklistTableRow.tsx
+++ b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsBlocklistTableRow.tsx
@@ -1,9 +1,10 @@
+import { t } from '@lingui/core/macro';
import { themeCssVariables } from 'twenty-ui/theme-constants';
import { type BlocklistItem } from '@/accounts/types/BlocklistItem';
import { TableCell } from '@/ui/layout/table/components/TableCell';
import { TableRow } from '@/ui/layout/table/components/TableRow';
import { formatToHumanReadableDate } from '~/utils/date-utils';
-import { IconButton } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
import { IconX } from 'twenty-ui/icon';
import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
@@ -32,13 +33,15 @@ export const SettingsAccountsBlocklistTableRow = ({
</TableCell>
<TableCell align="right">
<IconButton
+ aria-label={t`Remove from blocklist`}
onClick={() => {
onRemove(blocklistItem.id);
}}
- variant="tertiary"
- size="small"
- Icon={IconX}
- />
+ variant="ghost"
+ size="sm"
+ >
+ <IconX />
+ </IconButton>
</TableCell>
</TableRow>
);
diff --git a/packages/twenty-front/src/modules/settings/ai/components/SettingsAiModelsTable.tsx b/packages/twenty-front/src/modules/settings/ai/components/SettingsAiModelsTable.tsx
index e1c33aef92a..d4c68a38d76 100644
--- a/packages/twenty-front/src/modules/settings/ai/components/SettingsAiModelsTable.tsx
+++ b/packages/twenty-front/src/modules/settings/ai/components/SettingsAiModelsTable.tsx
@@ -1,3 +1,4 @@
+import { t } from '@lingui/core/macro';
import { useContext, useState } from 'react';
import { css } from '@linaria/core';
@@ -6,7 +7,8 @@ import { Trans } from '@lingui/react/macro';
import { isDefined } from 'twenty-shared/utils';
import { IconTrash } from 'twenty-ui/icon';
import { AppTooltip, TooltipDelay } from 'twenty-ui/primitives/surfaces';
-import { Checkbox, IconButton } from 'twenty-ui/primitives/input';
+import { Checkbox } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants';
import { SettingsAiModelHoverCard } from '@/settings/ai/components/SettingsAiModelHoverCard';
@@ -193,15 +195,17 @@ export const SettingsAiModelsTable = <TModel extends AiModelSummary>({
{hasRemove && (
<TableCell align="right">
<IconButton
- Icon={IconTrash}
- accent="danger"
- variant="tertiary"
- size="small"
+ aria-label={t`Remove model`}
+ color="danger"
+ variant="ghost"
+ size="sm"
onClick={(event) => {
event.stopPropagation();
onRemove(model);
}}
- />
+ >
+ <IconTrash />
+ </IconButton>
</TableCell>
)}
</TableRow>
diff --git a/packages/twenty-front/src/modules/settings/components/SettingsCounter.tsx b/packages/twenty-front/src/modules/settings/components/SettingsCounter.tsx
index b31f4066624..308489e3b9c 100644
--- a/packages/twenty-front/src/modules/settings/components/SettingsCounter.tsx
+++ b/packages/twenty-front/src/modules/settings/components/SettingsCounter.tsx
@@ -1,7 +1,8 @@
+import { t } from '@lingui/core/macro';
import { SettingsTextInput } from '@/ui/input/components/SettingsTextInput';
import { styled } from '@linaria/react';
import { IconMinus, IconPlus } from 'twenty-ui/icon';
-import { IconButton } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
import { themeCssVariables } from 'twenty-ui/theme-constants';
import { castAsNumberOrNull } from '~/utils/cast-as-number-or-null';
@@ -78,12 +79,14 @@ export const SettingsCounter = ({
<StyledCounterContainer showButtons={showButtons}>
{showButtons && (
<IconButton
- size="small"
- Icon={IconMinus}
- variant="secondary"
+ aria-label={t`Decrease value`}
+ size="sm"
+ variant="outline"
onClick={handleDecrementCounter}
disabled={disabled}
- />
+ >
+ <IconMinus />
+ </IconButton>
)}
<StyledTextInputContainer>
<SettingsTextInput
@@ -97,12 +100,14 @@ export const SettingsCounter = ({
</StyledTextInputContainer>
{showButtons && (
<IconButton
- size="small"
- Icon={IconPlus}
- variant="secondary"
+ aria-label={t`Increase value`}
+ size="sm"
+ variant="outline"
onClick={handleIncrementCounter}
disabled={disabled}
- />
+ >
+ <IconPlus />
+ </IconButton>
)}
</StyledCounterContainer>
);
diff --git a/packages/twenty-front/src/modules/settings/components/SettingsCustomizeVideoModal.tsx b/packages/twenty-front/src/modules/settings/components/SettingsCustomizeVideoModal.tsx
index 2e489b3d33e..92af4f95b7f 100644
--- a/packages/twenty-front/src/modules/settings/components/SettingsCustomizeVideoModal.tsx
+++ b/packages/twenty-front/src/modules/settings/components/SettingsCustomizeVideoModal.tsx
@@ -1,10 +1,11 @@
+import { t } from '@lingui/core/macro';
import { ModalStatefulWrapper } from '@/ui/layout/modal/components/ModalStatefulWrapper';
import { useModal } from '@/ui/layout/modal/hooks/useModal';
import { TabList } from '@/ui/layout/tab-list/components/TabList';
import { styled } from '@linaria/react';
import { useState } from 'react';
import { type IconComponent, IconX } from 'twenty-ui/icon';
-import { IconButton } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
import { themeCssVariables, useTheme } from 'twenty-ui/theme-constants';
export type SettingsCustomizeVideoModalTab = {
@@ -130,7 +131,9 @@ export const SettingsCustomizeVideoModal = ({
<StyledTitleText>{activeTab.title}</StyledTitleText>
</StyledTitle>
)}
- <IconButton Icon={IconX} onClick={handleClose} size="small" />
+ <IconButton aria-label={t`Close video`} onClick={handleClose} size="sm">
+ <IconX />
+ </IconButton>
</StyledHeader>
<StyledVideoContainer>
<StyledVideoIframe
diff --git a/packages/twenty-front/src/modules/settings/components/SettingsDatabaseEventsForm.tsx b/packages/twenty-front/src/modules/settings/components/SettingsDatabaseEventsForm.tsx
index fcb0a648662..0f280b34ea0 100644
--- a/packages/twenty-front/src/modules/settings/components/SettingsDatabaseEventsForm.tsx
+++ b/packages/twenty-front/src/modules/settings/components/SettingsDatabaseEventsForm.tsx
@@ -5,7 +5,8 @@ import { styled } from '@linaria/react';
import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { IconBox, IconNorthStar, IconPlus, IconTrash } from 'twenty-ui/icon';
-import { IconButton, type SelectOption } from 'twenty-ui/primitives/input';
+import { type SelectOption } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
import { themeCssVariables } from 'twenty-ui/theme-constants';
const OBJECT_DROPDOWN_WIDTH = 240;
@@ -92,12 +93,13 @@ export const SettingsDatabaseEventsForm = ({
/>
{isDefined(operation.object) && !disabled ? (
<IconButton
- Icon={IconTrash}
- variant="tertiary"
- size="medium"
- ariaLabel={t`Remove filter`}
+ variant="ghost"
+ size="md"
+ aria-label={t`Remove filter`}
onClick={() => removeOperation?.(index)}
- />
+ >
+ <IconTrash />
+ </IconButton>
) : (
<StyledPlaceholder />
)}
diff --git a/packages/twenty-front/src/modules/settings/data-model/fields/forms/components/SettingsDataModelFieldIconLabelForm.tsx b/packages/twenty-front/src/modules/settings/data-model/fields/forms/components/SettingsDataModelFieldIconLabelForm.tsx
index 9fc27c19e1e..d43e1768bb7 100644
--- a/packages/twenty-front/src/modules/settings/data-model/fields/forms/components/SettingsDataModelFieldIconLabelForm.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/fields/forms/components/SettingsDataModelFieldIconLabelForm.tsx
@@ -149,7 +149,7 @@ export const SettingsDataModelFieldIconLabelForm = ({
<IconPicker
selectedIconKey={value ?? 'IconUsers'}
onChange={({ iconKey }) => onChange(iconKey)}
- variant="primary"
+ variant="outline"
disabled={readonly}
/>
)}
diff --git a/packages/twenty-front/src/modules/settings/data-model/fields/forms/morph-relation/components/SettingsDataModelFieldRelationForm.tsx b/packages/twenty-front/src/modules/settings/data-model/fields/forms/morph-relation/components/SettingsDataModelFieldRelationForm.tsx
index 26f75ba4775..b2fc07c888f 100644
--- a/packages/twenty-front/src/modules/settings/data-model/fields/forms/morph-relation/components/SettingsDataModelFieldRelationForm.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/fields/forms/morph-relation/components/SettingsDataModelFieldRelationForm.tsx
@@ -175,7 +175,7 @@ export const SettingsDataModelFieldRelationForm = ({
dropdownId="field-destination-icon-picker"
selectedIconKey={value ?? undefined}
onChange={({ iconKey }) => onChange(iconKey)}
- variant="primary"
+ variant="outline"
/>
)}
/>
diff --git a/packages/twenty-front/src/modules/settings/data-model/indexes/forms/components/SettingsObjectIndexFieldsForm.tsx b/packages/twenty-front/src/modules/settings/data-model/indexes/forms/components/SettingsObjectIndexFieldsForm.tsx
index 1cf1ac71647..c3f4e6f895a 100644
--- a/packages/twenty-front/src/modules/settings/data-model/indexes/forms/components/SettingsObjectIndexFieldsForm.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/indexes/forms/components/SettingsObjectIndexFieldsForm.tsx
@@ -8,7 +8,8 @@ import { useLingui } from '@lingui/react/macro';
import { useMemo } from 'react';
import { Controller, useFormContext } from 'react-hook-form';
import { IconTrash, useIcons } from 'twenty-ui/icon';
-import { IconButton, type SelectOption } from 'twenty-ui/primitives/input';
+import { type SelectOption } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
import { themeCssVariables } from 'twenty-ui/theme-constants';
import { type SettingsObjectNewIndexFormValues } from '~/pages/settings/data-model/new-index/SettingsObjectNewIndexFormValues';
@@ -118,12 +119,13 @@ export const SettingsObjectIndexFieldsForm = ({
<StyledPlaceholder />
) : (
<IconButton
- Icon={IconTrash}
- variant="tertiary"
- size="medium"
+ variant="ghost"
+ size="md"
onClick={() => handleRemove(rowIndex)}
- ariaLabel={t`Remove field`}
- />
+ aria-label={t`Remove field`}
+ >
+ <IconTrash />
+ </IconButton>
)}
</StyledFieldRow>
);
diff --git a/packages/twenty-front/src/modules/settings/event-logs/components/SettingsLogs.tsx b/packages/twenty-front/src/modules/settings/event-logs/components/SettingsLogs.tsx
index cebcea4d388..ba56b9e989e 100644
--- a/packages/twenty-front/src/modules/settings/event-logs/components/SettingsLogs.tsx
+++ b/packages/twenty-front/src/modules/settings/event-logs/components/SettingsLogs.tsx
@@ -23,7 +23,8 @@ import {
IconPlayerPause,
IconPlayerPlay,
} from 'twenty-ui/icon';
-import { Button, IconButton } from 'twenty-ui/primitives/input';
+import { Button } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
import { Card } from 'twenty-ui/primitives/surfaces';
import { themeCssVariables } from 'twenty-ui/theme-constants';
@@ -246,12 +247,13 @@ export const SettingsLogs = () => {
</StyledSelectorGrow>
{canQuery && (
<IconButton
- Icon={isPaused ? IconPlayerPlay : IconPlayerPause}
- variant="secondary"
- size="medium"
- ariaLabel={isPaused ? t`Resume` : t`Pause`}
+ variant="outline"
+ size="md"
+ aria-label={isPaused ? t`Resume` : t`Pause`}
onClick={() => setIsPaused((previous) => !previous)}
- />
+ >
+ {isPaused ? <IconPlayerPlay /> : <IconPlayerPause />}
+ </IconButton>
)}
</StyledSelectorRow>
<EventLogFilters
diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelTableRowOptionsDropdown.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelTableRowOptionsDropdown.tsx
index 1350052c4a3..a22a6b3f784 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelTableRowOptionsDropdown.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelTableRowOptionsDropdown.tsx
@@ -5,7 +5,7 @@ import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/Drop
import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';
import { t } from '@lingui/core/macro';
import { IconDotsVertical, IconPencil, IconTrash } from 'twenty-ui/icon';
-import { IconButton } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
import { MenuItem, UndecoratedLink } from 'twenty-ui/primitives/navigation';
type SettingsRolePermissionsObjectLevelTableRowOptionsDropdownProps = {
@@ -38,10 +38,11 @@ export const SettingsRolePermissionsObjectLevelTableRowOptionsDropdown = ({
clickableComponent={
<IconButton
aria-label={t`Object permission options`}
- variant="tertiary"
- size="small"
- Icon={IconDotsVertical}
- />
+ variant="ghost"
+ size="sm"
+ >
+ <IconDotsVertical />
+ </IconButton>
}
dropdownComponents={
<DropdownContent>
diff --git a/packages/twenty-front/src/modules/side-panel/components/SidePanelBackButton.tsx b/packages/twenty-front/src/modules/side-panel/components/SidePanelBackButton.tsx
index 3ccec8869d4..c49ab0eaca7 100644
--- a/packages/twenty-front/src/modules/side-panel/components/SidePanelBackButton.tsx
+++ b/packages/twenty-front/src/modules/side-panel/components/SidePanelBackButton.tsx
@@ -9,7 +9,7 @@ import { useOpenDropdown } from '@/ui/layout/dropdown/hooks/useOpenDropdown';
import { styled } from '@linaria/react';
import { t } from '@lingui/core/macro';
import { IconChevronLeft } from 'twenty-ui/icon';
-import { IconButton } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
import { MenuItem } from 'twenty-ui/primitives/navigation';
import { themeCssVariables } from 'twenty-ui/theme-constants';
@@ -51,12 +51,13 @@ export const SidePanelBackButton = () => {
clickableComponent={
<StyledNavigationIcon onContextMenu={handleBackButtonContextMenu}>
<IconButton
- Icon={IconChevronLeft}
- size="small"
- variant="tertiary"
+ size="sm"
+ variant="ghost"
onClick={goBackFromSidePanel}
- ariaLabel={t`Back`}
- />
+ aria-label={t`Back`}
+ >
+ <IconChevronLeft />
+ </IconButton>
</StyledNavigationIcon>
}
dropdownComponents={
diff --git a/packages/twenty-front/src/modules/side-panel/components/SidePanelCloseButton.tsx b/packages/twenty-front/src/modules/side-panel/components/SidePanelCloseButton.tsx
index de52d2a2572..508673ffd95 100644
--- a/packages/twenty-front/src/modules/side-panel/components/SidePanelCloseButton.tsx
+++ b/packages/twenty-front/src/modules/side-panel/components/SidePanelCloseButton.tsx
@@ -1,7 +1,7 @@
import { useSidePanelMenu } from '@/side-panel/hooks/useSidePanelMenu';
import { useLingui } from '@lingui/react/macro';
import { IconX } from 'twenty-ui/icon';
-import { IconButtonWithTooltip } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
export const SidePanelCloseButton = () => {
const { t } = useLingui();
@@ -10,13 +10,14 @@ export const SidePanelCloseButton = () => {
const closeSidePanelLabel = t`Close side panel`;
return (
- <IconButtonWithTooltip
- tooltipContent={closeSidePanelLabel}
- Icon={IconX}
- size="small"
- variant="primary"
+ <IconButton
+ tooltip={closeSidePanelLabel}
+ size="sm"
+ variant="outline"
onClick={closeSidePanelMenu}
- ariaLabel={closeSidePanelLabel}
- />
+ aria-label={closeSidePanelLabel}
+ >
+ <IconX />
+ </IconButton>
);
};
diff --git a/packages/twenty-front/src/modules/side-panel/components/SidePanelExpandButton.tsx b/packages/twenty-front/src/modules/side-panel/components/SidePanelExpandButton.tsx
index e6e5919ad0c..16cd0972152 100644
--- a/packages/twenty-front/src/modules/side-panel/components/SidePanelExpandButton.tsx
+++ b/packages/twenty-front/src/modules/side-panel/components/SidePanelExpandButton.tsx
@@ -1,7 +1,7 @@
import { isNonEmptyString } from '@sniptt/guards';
import { isDefined } from 'twenty-shared/utils';
import { IconMaximize } from 'twenty-ui/icon';
-import { IconButtonWithTooltip } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
import {
getOsControlSymbol,
getOsShortcutSeparator,
@@ -47,15 +47,16 @@ const SidePanelExpandButtonContent = () => {
{expandTarget.hasExpandShortcut && !isDisabled && (
<SidePanelExpandShortcutEffect expand={expandTarget.expand} />
)}
- <IconButtonWithTooltip
- tooltipContent={tooltipContent}
+ <IconButton
+ tooltip={tooltipContent}
disabled={isDisabled}
- Icon={IconMaximize}
- size="small"
- variant="tertiary"
+ size="sm"
+ variant="ghost"
onClick={expandTarget.expand}
- ariaLabel={expandTarget.label}
- />
+ aria-label={expandTarget.label}
+ >
+ <IconMaximize />
+ </IconButton>
</>
);
};
diff --git a/packages/twenty-front/src/modules/side-panel/components/SidePanelObjectFilterDropdown.tsx b/packages/twenty-front/src/modules/side-panel/components/SidePanelObjectFilterDropdown.tsx
index 544c076ee98..c897e9ae7cf 100644
--- a/packages/twenty-front/src/modules/side-panel/components/SidePanelObjectFilterDropdown.tsx
+++ b/packages/twenty-front/src/modules/side-panel/components/SidePanelObjectFilterDropdown.tsx
@@ -1,7 +1,7 @@
import { useLingui } from '@lingui/react/macro';
import { isDefined } from 'twenty-shared/utils';
import { IconFilter } from 'twenty-ui/icon';
-import { IconButton } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
import { SidePanelObjectFilterDropdownContent } from '@/side-panel/components/SidePanelObjectFilterDropdownContent';
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
@@ -26,12 +26,13 @@ export const SidePanelObjectFilterDropdown = ({
dropdownPlacement="bottom-end"
clickableComponent={
<IconButton
- Icon={IconFilter}
- variant="tertiary"
- accent={isFilterActive ? 'blue' : 'default'}
- size="small"
- ariaLabel={t`Filter by object type`}
- />
+ variant="ghost"
+ color={isFilterActive ? 'accent' : 'neutral'}
+ size="sm"
+ aria-label={t`Filter by object type`}
+ >
+ <IconFilter />
+ </IconButton>
}
dropdownComponents={
<SidePanelObjectFilterDropdownContent
diff --git a/packages/twenty-front/src/modules/side-panel/components/SidePanelToggleButton.tsx b/packages/twenty-front/src/modules/side-panel/components/SidePanelToggleButton.tsx
index 274ddd54062..fa5b52c8a5e 100644
--- a/packages/twenty-front/src/modules/side-panel/components/SidePanelToggleButton.tsx
+++ b/packages/twenty-front/src/modules/side-panel/components/SidePanelToggleButton.tsx
@@ -11,7 +11,7 @@ import { styled } from '@linaria/react';
import { t } from '@lingui/core/macro';
import { SidePanelPages } from 'twenty-shared/types';
import { IconDotsVertical } from 'twenty-ui/icon';
-import { IconButton } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
import {
AppTooltip,
TooltipDelay,
@@ -82,14 +82,15 @@ export const SidePanelToggleButton = () => {
data-click-outside-id={PAGE_HEADER_SIDE_PANEL_BUTTON_CLICK_OUTSIDE_ID}
>
<IconButton
- Icon={IconDotsVertical}
- dataTestId="page-header-side-panel-button"
- size="small"
- variant="primary"
- accent="default"
- ariaLabel={ariaLabel}
+ data-testid="page-header-side-panel-button"
+ size="sm"
+ variant="outline"
+ color="neutral"
+ aria-label={ariaLabel}
onClick={openSidePanelMenu}
- />
+ >
+ <IconDotsVertical />
+ </IconButton>
</div>
<StyledTooltipWrapper>
diff --git a/packages/twenty-front/src/modules/side-panel/components/SidePanelTopBarRightCornerIcon.tsx b/packages/twenty-front/src/modules/side-panel/components/SidePanelTopBarRightCornerIcon.tsx
index 28716462a61..dd5d01f4102 100644
--- a/packages/twenty-front/src/modules/side-panel/components/SidePanelTopBarRightCornerIcon.tsx
+++ b/packages/twenty-front/src/modules/side-panel/components/SidePanelTopBarRightCornerIcon.tsx
@@ -8,7 +8,7 @@ import { styled } from '@linaria/react';
import { t } from '@lingui/core/macro';
import { SidePanelPages } from 'twenty-shared/types';
import { IconEdit } from 'twenty-ui/icon';
-import { IconButton } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
import { useIsMobile } from 'twenty-ui/utilities';
import { themeCssVariables } from 'twenty-ui/theme-constants';
@@ -43,12 +43,13 @@ export const SidePanelTopBarRightCornerIcon = () => {
return (
<StyledIconButtonContainer>
<IconButton
- Icon={IconEdit}
- size="small"
- variant="tertiary"
+ size="sm"
+ variant="ghost"
onClick={() => switchToNewChat()}
- ariaLabel={t`New conversation`}
- />
+ aria-label={t`New conversation`}
+ >
+ <IconEdit />
+ </IconButton>
</StyledIconButtonContainer>
);
};
diff --git a/packages/twenty-front/src/modules/side-panel/pages/common/components/SidePanelSubPageNavigationHeader.tsx b/packages/twenty-front/src/modules/side-panel/pages/common/components/SidePanelSubPageNavigationHeader.tsx
index 7682eeaf5ba..fcbb04c4b68 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/common/components/SidePanelSubPageNavigationHeader.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/common/components/SidePanelSubPageNavigationHeader.tsx
@@ -1,6 +1,6 @@
import { styled } from '@linaria/react';
import { IconChevronLeft } from 'twenty-ui/icon';
-import { IconButton } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
import { themeCssVariables } from 'twenty-ui/theme-constants';
const StyledContainer = styled.div`
@@ -31,11 +31,12 @@ export const SidePanelSubPageNavigationHeader = ({
<StyledContainer>
<IconButton
onClick={onBackClick}
- Icon={IconChevronLeft}
- variant="tertiary"
- size="small"
- ariaLabel="Go back"
- />
+ variant="ghost"
+ size="sm"
+ aria-label="Go back"
+ >
+ <IconChevronLeft />
+ </IconButton>
<StyledText>{title}</StyledText>
</StyledContainer>
);
diff --git a/packages/twenty-front/src/modules/side-panel/pages/compose-calendar-event/components/SidePanelComposeCalendarEventPage.tsx b/packages/twenty-front/src/modules/side-panel/pages/compose-calendar-event/components/SidePanelComposeCalendarEventPage.tsx
index d694e7c63b9..d083bb9b228 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/compose-calendar-event/components/SidePanelComposeCalendarEventPage.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/compose-calendar-event/components/SidePanelComposeCalendarEventPage.tsx
@@ -14,7 +14,8 @@ import { ConnectedAccountProvider, SettingsPath } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { useToast } from 'twenty-ui/primitives/feedback';
import { IconCalendarEvent, IconTrash } from 'twenty-ui/icon';
-import { Button, IconButton } from 'twenty-ui/primitives/input';
+import { Button } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
import { getOsControlSymbol } from 'twenty-ui/utilities';
import { useNavigateSettings } from '~/hooks/useNavigateSettings';
@@ -95,12 +96,13 @@ export const SidePanelComposeCalendarEventPage = () => {
actions={[
<IconButton
key="discard"
- size="small"
- variant="primary"
- Icon={IconTrash}
- ariaLabel={t`Discard`}
+ size="sm"
+ variant="outline"
+ aria-label={t`Discard`}
onClick={goBackFromSidePanel}
- />,
+ >
+ <IconTrash />
+ </IconButton>,
<Button
key="create"
size="sm"
diff --git a/packages/twenty-front/src/modules/side-panel/pages/compose-email/components/SidePanelComposeEmailPage.tsx b/packages/twenty-front/src/modules/side-panel/pages/compose-email/components/SidePanelComposeEmailPage.tsx
index 9f99a613462..f13cd418511 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/compose-email/components/SidePanelComposeEmailPage.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/compose-email/components/SidePanelComposeEmailPage.tsx
@@ -15,7 +15,8 @@ import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/use
import { styled } from '@linaria/react';
import { t } from '@lingui/core/macro';
import { IconPaperclip, IconSend, IconTrash } from 'twenty-ui/icon';
-import { Button, IconButton } from 'twenty-ui/primitives/input';
+import { Button } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
import { getOsControlSymbol } from 'twenty-ui/utilities';
import { useAttachEmailFiles } from '@/activities/emails/hooks/useAttachEmailFiles';
@@ -95,20 +96,22 @@ export const SidePanelComposeEmailPage = () => {
actions={[
<IconButton
key="discard"
- size="small"
- variant="primary"
- Icon={IconTrash}
- ariaLabel={t`Discard`}
+ size="sm"
+ variant="outline"
+ aria-label={t`Discard`}
onClick={goBackFromSidePanel}
- />,
+ >
+ <IconTrash />
+ </IconButton>,
<IconButton
key="attach"
- size="small"
- variant="primary"
- Icon={IconPaperclip}
- ariaLabel={t`Attach files`}
+ size="sm"
+ variant="outline"
+ aria-label={t`Attach files`}
onClick={openAttachmentPicker}
- />,
+ >
+ <IconPaperclip />
+ </IconButton>,
<Button
key="send"
size="sm"
diff --git a/packages/twenty-front/src/modules/spreadsheet-import/components/SpreadSheetImportModalCloseButton.tsx b/packages/twenty-front/src/modules/spreadsheet-import/components/SpreadSheetImportModalCloseButton.tsx
index 1b6f898226a..93434360240 100644
--- a/packages/twenty-front/src/modules/spreadsheet-import/components/SpreadSheetImportModalCloseButton.tsx
+++ b/packages/twenty-front/src/modules/spreadsheet-import/components/SpreadSheetImportModalCloseButton.tsx
@@ -1,7 +1,8 @@
+import { t } from '@lingui/core/macro';
import { styled } from '@linaria/react';
import { IconX } from 'twenty-ui/icon';
-import { IconButton } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
const StyledCloseButtonContainer = styled.div`
align-items: center;
@@ -23,7 +24,9 @@ export const SpreadSheetImportModalCloseButton = ({
}: SpreadSheetImportModalCloseButtonProps) => {
return (
<StyledCloseButtonContainer>
- <IconButton Icon={IconX} onClick={onClose} />
+ <IconButton aria-label={t`Close import`} onClick={onClose}>
+ <IconX />
+ </IconButton>
</StyledCloseButtonContainer>
);
};
diff --git a/packages/twenty-front/src/modules/ui/field/display/components/GlobalFilePreviewModal.tsx b/packages/twenty-front/src/modules/ui/field/display/components/GlobalFilePreviewModal.tsx
index 49770a5fc2e..240e441079c 100644
--- a/packages/twenty-front/src/modules/ui/field/display/components/GlobalFilePreviewModal.tsx
+++ b/packages/twenty-front/src/modules/ui/field/display/components/GlobalFilePreviewModal.tsx
@@ -10,7 +10,7 @@ import { type JSX, lazy, Suspense, useEffect } from 'react';
import { createPortal } from 'react-dom';
import { isDefined } from 'twenty-shared/utils';
import { IconDownload, IconX } from 'twenty-ui/icon';
-import { IconButton } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
import { themeCssVariables } from 'twenty-ui/theme-constants';
const DocumentViewer = lazy(() =>
@@ -112,11 +112,19 @@ export const GlobalFilePreviewModal = (): JSX.Element | null => {
<StyledModalTitle>{filePreview.label}</StyledModalTitle>
<StyledButtonContainer>
<IconButton
- Icon={IconDownload}
+ aria-label={t`Download file`}
onClick={handleDownload}
- size="small"
- />
- <IconButton Icon={IconX} onClick={handleClose} size="small" />
+ size="sm"
+ >
+ <IconDownload />
+ </IconButton>
+ <IconButton
+ aria-label={t`Close preview`}
+ onClick={handleClose}
+ size="sm"
+ >
+ <IconX />
+ </IconButton>
</StyledButtonContainer>
</StyledHeader>
</StyledModalHeader>
diff --git a/packages/twenty-front/src/modules/ui/input/components/IconPicker.tsx b/packages/twenty-front/src/modules/ui/input/components/IconPicker.tsx
index 10ec2b777c0..8cab81716b0 100644
--- a/packages/twenty-front/src/modules/ui/input/components/IconPicker.tsx
+++ b/packages/twenty-front/src/modules/ui/input/components/IconPicker.tsx
@@ -10,11 +10,11 @@ import {
} from 'twenty-ui/primitives/data-display';
import { IconApps, type IconComponent, useIcons } from 'twenty-ui/icon';
import {
- IconButton,
- type IconButtonSize,
- type IconButtonVariant,
+ type ButtonSize,
+ type ButtonVariant,
LightIconButton,
} from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
import { type ThemeColor } from 'twenty-ui/theme';
import { themeCssVariables } from 'twenty-ui/theme-constants';
@@ -49,9 +49,9 @@ export type IconPickerProps = {
onClickOutside?: () => void;
onClose?: () => void;
onOpen?: () => void;
- variant?: IconButtonVariant;
+ variant?: ButtonVariant;
className?: string;
- size?: IconButtonSize;
+ size?: ButtonSize;
clickableComponent?: ReactNode;
dropdownWidth?: number;
dropdownOffset?: DropdownOffset;
@@ -279,9 +279,9 @@ export const IconPicker = ({
onClickOutside,
onClose,
onOpen,
- variant = 'secondary',
+ variant = 'outline',
className,
- size = 'medium',
+ size = 'md',
clickableComponent,
dropdownWidth,
dropdownOffset,
@@ -399,7 +399,7 @@ export const IconPicker = ({
const selectedColor = iconColorPicker?.selectedColor ?? iconColor;
- const displayIcon: IconComponent = !isDefined(selectedColor)
+ const DisplayIcon: IconComponent = !isDefined(selectedColor)
? BaseIcon
: (iconProps) => (
<BaseIcon
@@ -439,12 +439,13 @@ export const IconPicker = ({
clickableComponent={
clickableComponent ?? (
<IconButton
- ariaLabel={t`Click to select icon ${iconAriaLabel}`}
+ aria-label={t`Click to select icon ${iconAriaLabel}`}
disabled={disabled}
- Icon={displayIcon}
variant={variant}
size={size}
- />
+ >
+ <DisplayIcon />
+ </IconButton>
)
}
dropdownComponents={
diff --git a/packages/twenty-front/src/modules/ui/input/components/NavigationButton.tsx b/packages/twenty-front/src/modules/ui/input/components/NavigationButton.tsx
index 12f3b5f1199..449507f1428 100644
--- a/packages/twenty-front/src/modules/ui/input/components/NavigationButton.tsx
+++ b/packages/twenty-front/src/modules/ui/input/components/NavigationButton.tsx
@@ -1,32 +1,37 @@
import { type ComponentType } from 'react';
-import { Link, type LinkProps } from 'react-router-dom';
+import { Link, type LinkProps, useHref } from 'react-router-dom';
import { isDefined } from 'twenty-shared/utils';
import { Button, type ButtonProps } from 'twenty-ui/primitives/input';
-type NavigationButtonProps = Omit<
- ButtonProps,
- 'href' | 'render' | 'nativeButton'
-> & {
+type NavigationButtonProps = Omit<ButtonProps, 'href' | 'render'> & {
buttonComponent?: ComponentType<ButtonProps>;
to?: LinkProps['to'];
};
+const NavigationLinkButton = ({
+ buttonComponent: ButtonComponent = Button,
+ to,
+ ...props
+}: NavigationButtonProps & { to: LinkProps['to'] }) => {
+ const href = useHref(to);
+
+ return <ButtonComponent {...props} href={href} render={<Link to={to} />} />;
+};
+
export const NavigationButton = ({
buttonComponent: ButtonComponent = Button,
- role,
to,
- type,
...props
}: NavigationButtonProps) => {
- const isLink = isDefined(to);
+ if (isDefined(to)) {
+ return (
+ <NavigationLinkButton
+ {...props}
+ buttonComponent={ButtonComponent}
+ to={to}
+ />
+ );
+ }
- return (
- <ButtonComponent
- {...props}
- type={isLink ? undefined : (type ?? 'button')}
- render={isLink ? <Link to={to} /> : undefined}
- role={isLink ? 'link' : role}
- nativeButton={!isLink}
- />
- );
+ return <ButtonComponent {...props} />;
};
diff --git a/packages/twenty-front/src/modules/ui/layout/dropdown/components/OptionsDropdownMenu.tsx b/packages/twenty-front/src/modules/ui/layout/dropdown/components/OptionsDropdownMenu.tsx
index 1d67f1a6b43..ce9e1c76304 100644
--- a/packages/twenty-front/src/modules/ui/layout/dropdown/components/OptionsDropdownMenu.tsx
+++ b/packages/twenty-front/src/modules/ui/layout/dropdown/components/OptionsDropdownMenu.tsx
@@ -12,7 +12,7 @@ import { useHotkeysOnFocusedElement } from '@/ui/utilities/hotkey/hooks/useHotke
import { useLingui } from '@lingui/react/macro';
import { type ReactNode, useId } from 'react';
import { IconDotsVertical } from 'twenty-ui/icon';
-import { IconButton } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
type OptionsDropdownMenuProps = {
dropdownId?: string;
@@ -93,12 +93,9 @@ export const OptionsDropdownMenu = ({
data-select-disable
clickableComponent={
clickableComponent ?? (
- <IconButton
- Icon={IconDotsVertical}
- ariaLabel={t`Options`}
- size="small"
- variant="primary"
- />
+ <IconButton aria-label={t`Options`} size="sm" variant="outline">
+ <IconDotsVertical />
+ </IconButton>
)
}
dropdownPlacement={dropdownPlacement}
diff --git a/packages/twenty-front/src/modules/views/components/UpdateViewButtonGroup.tsx b/packages/twenty-front/src/modules/views/components/UpdateViewButtonGroup.tsx
index 263edf8e3d0..6757ba0d431 100644
--- a/packages/twenty-front/src/modules/views/components/UpdateViewButtonGroup.tsx
+++ b/packages/twenty-front/src/modules/views/components/UpdateViewButtonGroup.tsx
@@ -23,7 +23,8 @@ import { useViewPickerMode } from '@/views/view-picker/hooks/useViewPickerMode';
import { viewPickerReferenceViewIdComponentState } from '@/views/view-picker/states/viewPickerReferenceViewIdComponentState';
import { t } from '@lingui/core/macro';
import { IconChevronDown, IconPlus } from 'twenty-ui/icon';
-import { Button, ButtonGroup, IconButton } from 'twenty-ui/primitives/input';
+import { Button, ButtonGroup } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
import { MenuItem } from 'twenty-ui/primitives/navigation';
import { themeCssVariables } from 'twenty-ui/theme-constants';
@@ -118,12 +119,9 @@ export const UpdateViewButtonGroup = () => {
<Dropdown
dropdownId={updateViewButtonDropdownId}
clickableComponent={
- <IconButton
- size="small"
- accent="blue"
- Icon={IconChevronDown}
- position="right"
- />
+ <IconButton aria-label={t`View update options`}>
+ <IconChevronDown />
+ </IconButton>
}
dropdownComponents={
<DropdownContent>
diff --git a/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramCreateStepElement.tsx b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramCreateStepElement.tsx
index 0bef2d0ecfa..9d41d07d062 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramCreateStepElement.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramCreateStepElement.tsx
@@ -6,7 +6,7 @@ import { styled } from '@linaria/react';
import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { IconPlus } from 'twenty-ui/icon';
-import { IconButton } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
const StyledContainer = styled.div`
align-items: center;
@@ -56,12 +56,9 @@ export const WorkflowDiagramCreateStepElement = ({
{isDefined(Label) && <StyledLabelContainer>{Label}</StyledLabelContainer>}
- <IconButton
- Icon={IconPlus}
- size="small"
- ariaLabel={t`Add a step`}
- onClick={addNode}
- />
+ <IconButton size="sm" aria-label={t`Add a step`} onClick={addNode}>
+ <IconPlus />
+ </IconButton>
</StyledContainer>
);
};
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterGroupOptionsDropdown.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterGroupOptionsDropdown.tsx
index 74e909b904d..257b7dcc955 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterGroupOptionsDropdown.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterGroupOptionsDropdown.tsx
@@ -7,7 +7,7 @@ import { WorkflowStepFilterContext } from '@/workflow/workflow-steps/filters/sta
import { useContext } from 'react';
import { t } from '@lingui/core/macro';
import { IconDotsVertical, IconTrash } from 'twenty-ui/icon';
-import { IconButton } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
import { MenuItem } from 'twenty-ui/primitives/navigation';
type WorkflowStepFilterGroupOptionsDropdownProps = {
@@ -27,10 +27,11 @@ export const WorkflowStepFilterGroupOptionsDropdown = ({
clickableComponent={
<IconButton
aria-label={t`Step filter group options`}
- variant="tertiary"
- Icon={IconDotsVertical}
+ variant="ghost"
disabled={readonly}
- />
+ >
+ <IconDotsVertical />
+ </IconButton>
}
dropdownComponents={
<DropdownContent>
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterOptionsDropdown.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterOptionsDropdown.tsx
index 679aad5cbaf..d3836c4d3a6 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterOptionsDropdown.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterOptionsDropdown.tsx
@@ -7,7 +7,7 @@ import { WorkflowStepFilterContext } from '@/workflow/workflow-steps/filters/sta
import { useContext } from 'react';
import { t } from '@lingui/core/macro';
import { IconDotsVertical, IconTrash } from 'twenty-ui/icon';
-import { IconButton } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
import { MenuItem } from 'twenty-ui/primitives/navigation';
type WorkflowStepFilterOptionsDropdownProps = {
@@ -27,10 +27,11 @@ export const WorkflowStepFilterOptionsDropdown = ({
clickableComponent={
<IconButton
aria-label={t`Step filter options`}
- variant="tertiary"
- Icon={IconDotsVertical}
+ variant="ghost"
disabled={readonly}
- />
+ >
+ <IconDotsVertical />
+ </IconButton>
}
dropdownComponents={
<DropdownContent>
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/iterator-action/components/WorkflowIteratorSubStepSwitcher.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/iterator-action/components/WorkflowIteratorSubStepSwitcher.tsx
index c17ac775837..a7dd1941859 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/iterator-action/components/WorkflowIteratorSubStepSwitcher.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/iterator-action/components/WorkflowIteratorSubStepSwitcher.tsx
@@ -7,10 +7,10 @@ import { getStepDefinitionOrThrow } from '@/workflow/utils/getStepDefinitionOrTh
import { getIsDescendantOfIterator } from '@/workflow/workflow-steps/utils/getIsDescendantOfIterator';
import { getWorkflowRunAllStepInfoHistory } from '@/workflow/workflow-steps/utils/getWorkflowRunAllStepInfoHistory';
import { styled } from '@linaria/react';
-import { plural } from '@lingui/core/macro';
+import { plural, t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { IconChevronLeft, IconChevronRight } from 'twenty-ui/icon';
-import { IconButton } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
import { themeCssVariables } from 'twenty-ui/theme-constants';
const StyledContainer = styled.div`
@@ -102,11 +102,13 @@ export const WorkflowIteratorSubStepSwitcher = ({
return (
<StyledContainer>
<IconButton
- Icon={IconChevronLeft}
- size="small"
+ aria-label={t`Previous iteration`}
+ size="sm"
disabled={!canGoToPreviousIndex}
onClick={handleDecrementIndex}
- />
+ >
+ <IconChevronLeft />
+ </IconButton>
<StyledCounter>
{workflowRunIteratorSubStepIterationIndex + 1}/
@@ -117,11 +119,13 @@ export const WorkflowIteratorSubStepSwitcher = ({
</StyledCounter>
<IconButton
- Icon={IconChevronRight}
- size="small"
+ aria-label={t`Next iteration`}
+ size="sm"
disabled={!canGoToNextIndex}
onClick={handleIncrementIndex}
- />
+ >
+ <IconChevronRight />
+ </IconButton>
</StyledContainer>
);
};
diff --git a/packages/twenty-front/src/pages/onboarding/InstallAppsContent.tsx b/packages/twenty-front/src/pages/onboarding/InstallAppsContent.tsx
index 205dfeefa85..d35611f9b47 100644
--- a/packages/twenty-front/src/pages/onboarding/InstallAppsContent.tsx
+++ b/packages/twenty-front/src/pages/onboarding/InstallAppsContent.tsx
@@ -11,10 +11,9 @@ import { type OnboardingInstallableApp } from '@/onboarding/types/OnboardingInst
import { styled } from '@linaria/react';
import { useLingui } from '@lingui/react/macro';
import { isDefined, isNonEmptyArray } from 'twenty-shared/utils';
-import { MainButton } from 'twenty-ui/components';
+import { IconButton, MainButton } from 'twenty-ui/components';
import { Avatar } from 'twenty-ui/primitives/data-display';
import { IconCheck, IconPlus } from 'twenty-ui/icon';
-import { IconButton } from 'twenty-ui/primitives/input';
import { AnimatedIconCrossfade } from 'twenty-ui/primitives/layout';
import { themeCssVariables, useTheme } from 'twenty-ui/theme-constants';
import { getAbsoluteImageUrl } from '~/utils/image/getAbsoluteImageUrl';
@@ -174,10 +173,10 @@ export const InstallAppsContent = ({
</StyledAppDescription>
</StyledAppText>
<IconButton
- size="small"
- variant="secondary"
- accent={isSelected ? 'blue' : 'default'}
- ariaLabel={
+ size="sm"
+ variant="outline"
+ color={isSelected ? 'accent' : 'neutral'}
+ aria-label={
isSelected
? t`Deselect ${labelText}`
: t`Select ${labelText}`
diff --git a/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationRegistrationRedirectURIsTable.tsx b/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationRegistrationRedirectURIsTable.tsx
index cc27c048d20..36fdcccd44f 100644
--- a/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationRegistrationRedirectURIsTable.tsx
+++ b/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationRegistrationRedirectURIsTable.tsx
@@ -8,7 +8,7 @@ import { themeCssVariables } from 'twenty-ui/theme-constants';
import { TableCell } from '@/ui/layout/table/components/TableCell';
import { IconX } from 'twenty-ui/icon';
import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
-import { IconButton } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
type SettingsApplicationRegistrationRedirectURIsTableProps = {
redirectUris: string[];
@@ -53,15 +53,17 @@ export const SettingsApplicationRegistrationRedirectURIsTable = ({
<TableCell align="right">
<IconButton
+ aria-label={t`Remove redirect URI`}
onClick={() => {
updateRedirectUris(
redirectUris.filter((uri) => uri !== redirectUri),
);
}}
- variant="tertiary"
- size="small"
- Icon={IconX}
- />
+ variant="ghost"
+ size="sm"
+ >
+ <IconX />
+ </IconButton>
</TableCell>
</TableRow>
))}
diff --git a/packages/twenty-front/src/pages/settings/members/tabs/SettingsWorkspaceMembersInviteTab.tsx b/packages/twenty-front/src/pages/settings/members/tabs/SettingsWorkspaceMembersInviteTab.tsx
index f77bbb68a46..0b376cfa37c 100644
--- a/packages/twenty-front/src/pages/settings/members/tabs/SettingsWorkspaceMembersInviteTab.tsx
+++ b/packages/twenty-front/src/pages/settings/members/tabs/SettingsWorkspaceMembersInviteTab.tsx
@@ -21,7 +21,7 @@ import { useContext, useMemo } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { IconMail, IconReload, IconTrash } from 'twenty-ui/icon';
import { Status } from 'twenty-ui/primitives/data-display';
-import { IconButton } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
import { Section } from 'twenty-ui/primitives/layout';
import { AppTooltip, TooltipDelay } from 'twenty-ui/primitives/surfaces';
import { H2Title } from 'twenty-ui/primitives/typography';
@@ -207,25 +207,29 @@ export const SettingsWorkspaceMembersInviteTab = () => {
<TableCell align="right">
<StyledButtonContainer>
<IconButton
+ aria-label={t`Resend invitation`}
onClick={() => {
handleResendWorkspaceInvitation(
workspaceInvitation.id,
);
}}
- variant="tertiary"
- size="medium"
- Icon={IconReload}
- />
+ variant="ghost"
+ size="md"
+ >
+ <IconReload />
+ </IconButton>
<IconButton
+ aria-label={t`Remove invitation`}
onClick={() => {
handleRemoveWorkspaceInvitation(
workspaceInvitation.id,
);
}}
- variant="tertiary"
- size="medium"
- Icon={IconTrash}
- />
+ variant="ghost"
+ size="md"
+ >
+ <IconTrash />
+ </IconButton>
</StyledButtonContainer>
</TableCell>
</TableRow>
diff --git a/packages/twenty-shared/src/constants/DocumentationPaths.ts b/packages/twenty-shared/src/constants/DocumentationPaths.ts
index 3bd0610cc65..13ca95def52 100644
--- a/packages/twenty-shared/src/constants/DocumentationPaths.ts
+++ b/packages/twenty-shared/src/constants/DocumentationPaths.ts
@@ -128,6 +128,7 @@ export const DOCUMENTATION_PATHS = {
GETTING_STARTED_KEY_FEATURES: '/getting-started/key-features',
GETTING_STARTED_QUICKSTART: '/getting-started/quickstart',
UI_ACCESSIBILITY: '/ui/accessibility',
+ UI_COMPONENTS_INPUT_ICON_BUTTON: '/ui/components/input/icon-button',
UI_COMPONENTS_INPUT_LIGHT_BUTTON: '/ui/components/input/light-button',
UI_COMPONENTS_INPUT_MAIN_BUTTON: '/ui/components/input/main-button',
UI_COMPONENTS_OVERVIEW: '/ui/components/overview',
diff --git a/packages/twenty-ui/.size-limit.json b/packages/twenty-ui/.size-limit.json
index c676ef1b83e..d2c6a356a73 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": "65 kB"
+ "limit": "95 kB"
},
{
"name": "primitives",
diff --git a/packages/twenty-ui/docs/buttonPropDescriptions.ts b/packages/twenty-ui/docs/buttonPropDescriptions.ts
index a969b0f29dd..7faf62f77c8 100644
--- a/packages/twenty-ui/docs/buttonPropDescriptions.ts
+++ b/packages/twenty-ui/docs/buttonPropDescriptions.ts
@@ -13,4 +13,7 @@ export const BUTTON_PROP_DESCRIPTIONS = {
hotkeys: 'Keyboard shortcut hints displayed on non-mobile screens.',
soon: 'Displays a coming-soon label and disables activation.',
soonLabel: 'Text for the coming-soon label.',
+ href: 'Destination URL. Enables native link semantics instead of button semantics.',
+ render:
+ 'Caller-supplied root element or renderer. Preserve a native button, or an anchor when `href` is set. Router integration belongs to the caller.',
} satisfies Partial<Record<keyof ButtonProps, string>>;
diff --git a/packages/twenty-ui/docs/components.ts b/packages/twenty-ui/docs/components.ts
index ce3014ea351..bccb70ec5c6 100644
--- a/packages/twenty-ui/docs/components.ts
+++ b/packages/twenty-ui/docs/components.ts
@@ -1,12 +1,20 @@
import { AVATAR_PROP_DESCRIPTIONS } from './avatarPropDescriptions';
import { BUTTON_GROUP_PROP_DESCRIPTIONS } from './buttonGroupPropDescriptions';
import { BUTTON_PROP_DESCRIPTIONS } from './buttonPropDescriptions';
+import { ICON_BUTTON_PROP_DESCRIPTIONS } from './iconButtonPropDescriptions';
import { CHIP_PROP_DESCRIPTIONS } from './chipPropDescriptions';
import { LIGHT_BUTTON_PROP_DESCRIPTIONS } from './lightButtonPropDescriptions';
import { STATUS_PROP_DESCRIPTIONS } from './statusPropDescriptions';
import { TAG_PROP_DESCRIPTIONS } from './tagPropDescriptions';
export const DOCUMENTED_COMPONENTS = [
+ {
+ name: 'IconButton',
+ source: 'components/IconButton/IconButton.tsx',
+ entryPoint: 'twenty-ui/components',
+ slug: 'input/icon-button',
+ propDescriptions: ICON_BUTTON_PROP_DESCRIPTIONS,
+ },
{
name: 'MainButton',
source: 'components/MainButton/MainButton.tsx',
diff --git a/packages/twenty-ui/docs/iconButtonPropDescriptions.ts b/packages/twenty-ui/docs/iconButtonPropDescriptions.ts
new file mode 100644
index 00000000000..35cac26c481
--- /dev/null
+++ b/packages/twenty-ui/docs/iconButtonPropDescriptions.ts
@@ -0,0 +1,13 @@
+import { type IconButtonProps } from '../src/components/IconButton/types/IconButtonProps';
+import { BUTTON_PROP_DESCRIPTIONS } from './buttonPropDescriptions';
+
+export const ICON_BUTTON_PROP_DESCRIPTIONS = {
+ ...BUTTON_PROP_DESCRIPTIONS,
+ size: 'Square button size: `sm` (24px) or `md` (32px).',
+ children: 'Icon content. Decorative and hidden from assistive technology.',
+ tooltip: 'Text displayed when hovering or focusing the button.',
+ tooltipPlace: 'Preferred placement of the tooltip relative to the button.',
+ tooltipDelay: 'Delay before showing the tooltip.',
+ tooltipOffset: 'Distance in pixels between the button and the tooltip.',
+ 'aria-label': 'Required accessible name describing the action.',
+} satisfies Partial<Record<keyof IconButtonProps, string>>;
diff --git a/packages/twenty-ui/generated/components.docs.json b/packages/twenty-ui/generated/components.docs.json
index 6fc3ced6b87..0349b06add5 100644
--- a/packages/twenty-ui/generated/components.docs.json
+++ b/packages/twenty-ui/generated/components.docs.json
@@ -1,4 +1,109 @@
[
+ {
+ "name": "IconButton",
+ "entryPoint": "twenty-ui/components",
+ "slug": "input/icon-button",
+ "props": [
+ {
+ "name": "aria-label",
+ "type": "string",
+ "required": true,
+ "defaultValue": null,
+ "description": "Required accessible name describing the action."
+ },
+ {
+ "name": "className",
+ "type": "string | ((state: ButtonState) => string | undefined)",
+ "required": false,
+ "defaultValue": null,
+ "description": "CSS class applied to the element, or a function that\nreturns a class based on the component's state."
+ },
+ {
+ "name": "color",
+ "type": "\"neutral\" | \"accent\" | \"danger\" | \"success\"",
+ "required": false,
+ "defaultValue": null,
+ "description": "Semantic color of the button."
+ },
+ {
+ "name": "elevated",
+ "type": "boolean",
+ "required": false,
+ "defaultValue": null,
+ "description": "Adds a shadow to the button."
+ },
+ {
+ "name": "focusableWhenDisabled",
+ "type": "boolean",
+ "required": false,
+ "defaultValue": "false",
+ "description": "Whether the button should be focusable when disabled."
+ },
+ {
+ "name": "loading",
+ "type": "boolean",
+ "required": false,
+ "defaultValue": null,
+ "description": "Shows a loading indicator and disables activation while preserving the button width."
+ },
+ {
+ "name": "render",
+ "type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ButtonState>",
+ "required": false,
+ "defaultValue": null,
+ "description": "Caller-supplied root element or renderer. Preserve a native button, or an anchor when `href` is set. Router integration belongs to the caller."
+ },
+ {
+ "name": "size",
+ "type": "\"sm\" | \"md\"",
+ "required": false,
+ "defaultValue": null,
+ "description": "Square button size: `sm` (24px) or `md` (32px)."
+ },
+ {
+ "name": "style",
+ "type": "CSSProperties | ((state: ButtonState) => CSSProperties | undefined)",
+ "required": false,
+ "defaultValue": null,
+ "description": "Style applied to the element, or a function that\nreturns a style object based on the component's state."
+ },
+ {
+ "name": "tooltip",
+ "type": "string",
+ "required": false,
+ "defaultValue": null,
+ "description": "Text displayed when hovering or focusing the button."
+ },
+ {
+ "name": "tooltipDelay",
+ "type": "\"0ms\" | \"300ms\" | \"500ms\" | \"1000ms\"",
+ "required": false,
+ "defaultValue": "TooltipDelay.longDelay",
+ "description": "Delay before showing the tooltip."
+ },
+ {
+ "name": "tooltipOffset",
+ "type": "number",
+ "required": false,
+ "defaultValue": "5",
+ "description": "Distance in pixels between the button and the tooltip."
+ },
+ {
+ "name": "tooltipPlace",
+ "type": "\"top\" | \"left\" | \"right\" | \"bottom\"",
+ "required": false,
+ "defaultValue": "TooltipPosition.Bottom",
+ "description": "Preferred placement of the tooltip relative to the button."
+ },
+ {
+ "name": "variant",
+ "type": "\"solid\" | \"outline\" | \"ghost\" | \"soft\"",
+ "required": false,
+ "defaultValue": null,
+ "description": "Visual treatment of the button surface."
+ }
+ ]
+ },
{
"name": "MainButton",
"entryPoint": "twenty-ui/components",
@@ -60,19 +165,12 @@
"defaultValue": null,
"description": "Shows a loading indicator and disables activation while preserving the button width."
},
- {
- "name": "nativeButton",
- "type": "boolean",
- "required": false,
- "defaultValue": "true",
- "description": "Whether the component renders a native `<button>` element when replacing it\nvia the `render` prop.\nSet to `false` if the rendered element is not a button (for example, `<div>`)."
- },
{
"name": "render",
"type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ButtonState>",
"required": false,
"defaultValue": null,
- "description": "Allows you to replace the component's HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."
+ "description": "Caller-supplied root element or renderer. Preserve a native button, or an anchor when `href` is set. Router integration belongs to the caller."
},
{
"name": "size",
@@ -186,19 +284,12 @@
"defaultValue": null,
"description": "Shows a loading indicator and disables activation while preserving the button width."
},
- {
- "name": "nativeButton",
- "type": "boolean",
- "required": false,
- "defaultValue": "true",
- "description": "Whether the component renders a native `<button>` element when replacing it\nvia the `render` prop.\nSet to `false` if the rendered element is not a button (for example, `<div>`)."
- },
{
"name": "render",
"type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ButtonState>",
"required": false,
"defaultValue": null,
- "description": "Allows you to replace the component's HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."
+ "description": "Caller-supplied root element or renderer. Preserve a native button, or an anchor when `href` is set. Router integration belongs to the caller."
},
{
"name": "size",
@@ -305,19 +396,12 @@
"defaultValue": "false",
"description": "Shows a loading indicator and disables activation while preserving the button width."
},
- {
- "name": "nativeButton",
- "type": "boolean",
- "required": false,
- "defaultValue": "true",
- "description": "Whether the component renders a native `<button>` element when replacing it\nvia the `render` prop.\nSet to `false` if the rendered element is not a button (for example, `<div>`)."
- },
{
"name": "render",
"type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ButtonState>",
"required": false,
"defaultValue": null,
- "description": "Allows you to replace the component's HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."
+ "description": "Caller-supplied root element or renderer. Preserve a native button, or an anchor when `href` is set. Router integration belongs to the caller."
},
{
"name": "size",
diff --git a/packages/twenty-ui/src/components/IconButton/IconButton.module.scss b/packages/twenty-ui/src/components/IconButton/IconButton.module.scss
new file mode 100644
index 00000000000..8e28fe20133
--- /dev/null
+++ b/packages/twenty-ui/src/components/IconButton/IconButton.module.scss
@@ -0,0 +1,18 @@
+.button {
+ @include square-button;
+}
+
+.tooltipAnchor {
+ display: inline-flex;
+}
+
+.icon {
+ align-items: center;
+ display: flex;
+ justify-content: center;
+
+ & > 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/input/IconButton/IconButton.module.scss.d.ts b/packages/twenty-ui/src/components/IconButton/IconButton.module.scss.d.ts
similarity index 56%
rename from packages/twenty-ui/src/primitives/input/IconButton/IconButton.module.scss.d.ts
rename to packages/twenty-ui/src/components/IconButton/IconButton.module.scss.d.ts
index de85059fc80..1649614f9a9 100644
--- a/packages/twenty-ui/src/primitives/input/IconButton/IconButton.module.scss.d.ts
+++ b/packages/twenty-ui/src/components/IconButton/IconButton.module.scss.d.ts
@@ -1,6 +1,6 @@
declare const classNames: {
readonly button: 'button';
- readonly small: 'small';
- readonly medium: 'medium';
+ readonly tooltipAnchor: 'tooltipAnchor';
+ readonly icon: 'icon';
};
export default classNames;
diff --git a/packages/twenty-ui/src/components/IconButton/IconButton.tsx b/packages/twenty-ui/src/components/IconButton/IconButton.tsx
new file mode 100644
index 00000000000..d628d43ba14
--- /dev/null
+++ b/packages/twenty-ui/src/components/IconButton/IconButton.tsx
@@ -0,0 +1,63 @@
+import { isNonEmptyString } from '@sniptt/guards';
+import { useId } from 'react';
+
+import { Button } from '@ui/primitives/input/Button/Button';
+import {
+ AppTooltip,
+ TooltipDelay,
+ TooltipPosition,
+} from '@ui/primitives/surfaces/AppTooltip/AppTooltip';
+import { mergeClassNames } from '@ui/utilities/internal/mergeClassNames';
+
+import styles from './IconButton.module.scss';
+import { type IconButtonProps } from './types/IconButtonProps';
+
+export const IconButton = ({
+ children,
+ className,
+ tooltip,
+ tooltipPlace = TooltipPosition.Bottom,
+ tooltipDelay = TooltipDelay.longDelay,
+ tooltipOffset = 5,
+ disabled,
+ loading,
+ ...props
+}: IconButtonProps) => {
+ const tooltipId = useId();
+ const hasTooltip = isNonEmptyString(tooltip);
+ const isDisabled = disabled || loading;
+ const button = (
+ <Button
+ {...props}
+ disabled={disabled}
+ loading={loading}
+ data-tooltip-trigger={hasTooltip || undefined}
+ startIcon={<span className={styles.icon}>{children}</span>}
+ className={mergeClassNames(styles.button, className)}
+ />
+ );
+
+ if (!hasTooltip) {
+ return button;
+ }
+
+ return (
+ <>
+ <span className={styles.tooltipAnchor} data-tooltip-id={tooltipId}>
+ {button}
+ </span>
+ <AppTooltip
+ anchorSelect={
+ isDisabled
+ ? `[data-tooltip-id='${tooltipId}']`
+ : `[data-tooltip-id='${tooltipId}'] > [data-tooltip-trigger]`
+ }
+ title={tooltip}
+ delay={tooltipDelay}
+ place={tooltipPlace}
+ offset={tooltipOffset}
+ noArrow
+ />
+ </>
+ );
+};
diff --git a/packages/twenty-ui/src/components/IconButton/__stories__/IconButton.stories.tsx b/packages/twenty-ui/src/components/IconButton/__stories__/IconButton.stories.tsx
new file mode 100644
index 00000000000..f35ae54b97b
--- /dev/null
+++ b/packages/twenty-ui/src/components/IconButton/__stories__/IconButton.stories.tsx
@@ -0,0 +1,225 @@
+import { type Meta, type StoryObj } from '@storybook/react-vite';
+import { expect, fn, userEvent, within } from 'storybook/test';
+
+import { IconPlus, IconSearch } from '@ui/icon';
+import { TooltipDelay } from '@ui/primitives/surfaces/AppTooltip/AppTooltip';
+import { ButtonGroup } from '@ui/primitives/input/ButtonGroup/ButtonGroup';
+import { type ButtonColor } from '@ui/primitives/input/Button/types/ButtonColor';
+import { type ButtonVariant } from '@ui/primitives/input/Button/types/ButtonVariant';
+import {
+ A11Y_DEFER_COLOR_CONTRAST,
+ CatalogDecorator,
+ type CatalogStory,
+ ComponentDecorator,
+} from '@ui/testing';
+
+import { IconButton } from '../IconButton';
+import { type IconButtonProps } from '../types/IconButtonProps';
+
+const meta: Meta<typeof IconButton> = {
+ title: 'UI/Components/IconButton',
+ component: IconButton,
+ args: { children: <IconSearch />, 'aria-label': 'Search' },
+};
+
+export default meta;
+type Story = StoryObj<typeof IconButton>;
+
+export const Default: Story = { decorators: [ComponentDecorator] };
+
+export const Keyboard: Story = {
+ ...Default,
+ args: { onClick: fn() },
+ play: async ({ canvasElement, args }) => {
+ const button = within(canvasElement).getByRole('button', {
+ name: 'Search',
+ });
+
+ button.focus();
+ await userEvent.keyboard('{Enter} ');
+ await expect(args.onClick).toHaveBeenCalledTimes(2);
+ },
+};
+
+export const Disabled: Story = {
+ ...Default,
+ args: { disabled: true, onClick: fn() },
+ play: async ({ canvasElement, args }) => {
+ const button = within(canvasElement).getByRole('button', {
+ name: 'Search',
+ });
+
+ await expect(button).toBeDisabled();
+ await userEvent.click(button);
+ await expect(args.onClick).not.toHaveBeenCalled();
+ },
+};
+
+export const Loading: Story = {
+ ...Disabled,
+ args: { loading: true, onClick: fn() },
+ play: async ({ canvasElement, args }) => {
+ const button = within(canvasElement).getByRole('button', {
+ name: 'Search',
+ });
+
+ await expect(button).toHaveAttribute('aria-busy', 'true');
+ await expect(button).toBeDisabled();
+ await expect(button.getBoundingClientRect().width).toBe(
+ button.getBoundingClientRect().height,
+ );
+ await userEvent.click(button);
+ await expect(args.onClick).not.toHaveBeenCalled();
+ },
+};
+
+export const Link: Story = {
+ ...Default,
+ args: { href: '#search', onClick: fn((event) => event.preventDefault()) },
+ play: async ({ canvasElement, args }) => {
+ const link = within(canvasElement).getByRole('link', { name: 'Search' });
+
+ await expect(link).toHaveAttribute('href', '#search');
+ link.focus();
+ await userEvent.keyboard('{Enter}');
+ await expect(args.onClick).toHaveBeenCalledOnce();
+ },
+};
+
+export const Tooltip: Story = {
+ ...Default,
+ args: { tooltip: 'Search records', tooltipDelay: TooltipDelay.noDelay },
+ play: async ({ canvasElement }) => {
+ const button = within(canvasElement).getByRole('button', {
+ name: 'Search',
+ });
+
+ button.focus();
+ await expect(button).toHaveFocus();
+ await expect(
+ await within(canvasElement.ownerDocument.body).findByRole('tooltip'),
+ ).toHaveTextContent('Search records');
+ },
+};
+
+export const TooltipDisabled: Story = {
+ ...Tooltip,
+ args: { ...Tooltip.args, disabled: true, onClick: fn() },
+ play: async ({ canvasElement, args }) => {
+ const button = within(canvasElement).getByRole('button', {
+ name: 'Search',
+ });
+
+ await expect(button).toBeDisabled();
+ await userEvent.hover(button);
+ await expect(
+ await within(canvasElement.ownerDocument.body).findByRole('tooltip'),
+ ).toHaveTextContent('Search records');
+ await userEvent.click(button);
+ await expect(args.onClick).not.toHaveBeenCalled();
+ },
+};
+
+export const TooltipLoading: Story = {
+ ...TooltipDisabled,
+ args: { ...Tooltip.args, loading: true, onClick: fn() },
+};
+
+export const TooltipLink: Story = {
+ ...Tooltip,
+ args: {
+ ...Tooltip.args,
+ href: '#search',
+ render: (props) => (
+ <a {...props} data-custom-render>
+ {props.children}
+ </a>
+ ),
+ },
+ play: async ({ canvasElement }) => {
+ const link = within(canvasElement).getByRole('link', { name: 'Search' });
+
+ await expect(link).toHaveAttribute('href', '#search');
+ await expect(link).toHaveAttribute('data-custom-render');
+ await expect(link).not.toHaveAttribute('type');
+ link.focus();
+ await expect(
+ await within(canvasElement.ownerDocument.body).findByRole('tooltip'),
+ ).toHaveTextContent('Search records');
+ },
+};
+
+export const Grouped: Story = {
+ ...Default,
+ render: () => (
+ <ButtonGroup
+ aria-label="Record actions"
+ size="sm"
+ variant="solid"
+ color="accent"
+ >
+ <IconButton aria-label="Search">
+ <IconSearch />
+ </IconButton>
+ <IconButton aria-label="Create" tooltip="Create record">
+ <IconPlus />
+ </IconButton>
+ </ButtonGroup>
+ ),
+ play: async ({ canvasElement }) => {
+ const buttons = within(canvasElement).getAllByRole('button');
+
+ for (const button of buttons) {
+ await expect(button).toHaveAttribute('data-variant', 'solid');
+ await expect(button.getBoundingClientRect().width).toBe(24);
+ await expect(button.getBoundingClientRect().height).toBe(24);
+ }
+ },
+};
+
+const CATALOG_STATES: Record<string, Partial<IconButtonProps>> = {
+ default: {},
+ small: { size: 'sm' },
+ hover: { className: 'hover' },
+ pressed: { className: 'pressed' },
+ focused: { className: 'focused' },
+ disabled: { disabled: true },
+ loading: { loading: true },
+};
+
+export const Catalog: CatalogStory<Story, typeof IconButton> = {
+ decorators: [CatalogDecorator],
+ parameters: {
+ a11y: A11Y_DEFER_COLOR_CONTRAST,
+ pseudo: {
+ hover: ['.hover'],
+ active: ['.pressed'],
+ focusVisible: ['.focused'],
+ },
+ catalog: {
+ dimensions: [
+ {
+ name: 'state',
+ values: Object.keys(CATALOG_STATES),
+ props: (state: string) => CATALOG_STATES[state],
+ },
+ {
+ name: 'color',
+ values: ['neutral', 'accent', 'danger', 'success'],
+ props: (color: ButtonColor) => ({ color }),
+ },
+ {
+ name: 'variant',
+ values: ['solid', 'outline', 'soft', 'ghost'],
+ props: (variant: ButtonVariant) => ({ variant }),
+ },
+ ],
+ },
+ },
+};
+
+export const CatalogDark: CatalogStory<Story, typeof IconButton> = {
+ ...Catalog,
+ tags: ['!autodocs'],
+ globals: { colorScheme: 'dark' },
+};
diff --git a/packages/twenty-ui/src/components/IconButton/__tests__/IconButton.test.tsx b/packages/twenty-ui/src/components/IconButton/__tests__/IconButton.test.tsx
new file mode 100644
index 00000000000..d9eae9c38c7
--- /dev/null
+++ b/packages/twenty-ui/src/components/IconButton/__tests__/IconButton.test.tsx
@@ -0,0 +1,16 @@
+import { runComponentConformance } from '@test-utilities/conformance/runComponentConformance';
+import { IconSearch } from '@ui/icon';
+
+import { IconButton } from '../IconButton';
+import styles from '../IconButton.module.scss';
+
+runComponentConformance({
+ name: 'IconButton',
+ element: (
+ <IconButton aria-label="Search">
+ <IconSearch />
+ </IconButton>
+ ),
+ refInstanceOf: HTMLButtonElement,
+ ownClassName: styles.button,
+});
diff --git a/packages/twenty-ui/src/components/IconButton/types/IconButtonProps.ts b/packages/twenty-ui/src/components/IconButton/types/IconButtonProps.ts
new file mode 100644
index 00000000000..41a5a7ecb3f
--- /dev/null
+++ b/packages/twenty-ui/src/components/IconButton/types/IconButtonProps.ts
@@ -0,0 +1,26 @@
+import { type ReactNode } from 'react';
+
+import { type ButtonProps } from '@ui/primitives/input/Button/types/ButtonProps';
+import {
+ type TooltipDelay,
+ type TooltipPosition,
+} from '@ui/primitives/surfaces/AppTooltip/AppTooltip';
+
+export type IconButtonProps = Omit<
+ ButtonProps,
+ | 'aria-label'
+ | 'children'
+ | 'startIcon'
+ | 'endIcon'
+ | 'hotkeys'
+ | 'fullWidth'
+ | 'soon'
+ | 'soonLabel'
+> & {
+ children: ReactNode;
+ 'aria-label': string;
+ tooltip?: string;
+ tooltipPlace?: TooltipPosition;
+ tooltipDelay?: TooltipDelay;
+ tooltipOffset?: number;
+};
diff --git a/packages/twenty-ui/src/components/index.ts b/packages/twenty-ui/src/components/index.ts
index da0d8a078e0..de147dca0fc 100644
--- a/packages/twenty-ui/src/components/index.ts
+++ b/packages/twenty-ui/src/components/index.ts
@@ -7,6 +7,8 @@
* |___/
*/
+export { IconButton } from './IconButton/IconButton';
+export type { IconButtonProps } from './IconButton/types/IconButtonProps';
export { LightButton } from './LightButton/LightButton';
export type { LightButtonProps } from './LightButton/types/LightButtonProps';
export { MainButton } from './MainButton/MainButton';
diff --git a/packages/twenty-ui/src/primitives/feedback/Banner/__stories__/Banner.stories.tsx b/packages/twenty-ui/src/primitives/feedback/Banner/__stories__/Banner.stories.tsx
index 4848a068af0..672662dfbaf 100644
--- a/packages/twenty-ui/src/primitives/feedback/Banner/__stories__/Banner.stories.tsx
+++ b/packages/twenty-ui/src/primitives/feedback/Banner/__stories__/Banner.stories.tsx
@@ -8,7 +8,7 @@ import {
ComponentDecorator,
} from '@ui/testing';
import { Button } from '@ui/primitives/input/Button/Button';
-import { IconButton } from '@ui/primitives/input/IconButton/IconButton';
+import { IconButton } from '@ui/components/IconButton/IconButton';
import {
Banner,
type BannerColor,
@@ -17,8 +17,8 @@ import {
import styles from './Banner.stories.module.scss';
-const getButtonAccent = (color?: BannerColor) =>
- color === 'danger' ? 'danger' : 'blue';
+const getButtonColor = (color?: BannerColor) =>
+ color === 'danger' ? 'danger' : 'accent';
const BannerCloseButton = ({
color,
@@ -30,19 +30,21 @@ const BannerCloseButton = ({
variant === 'primary' ? (
<IconButton
className={styles.invertedIconButton}
- Icon={IconX}
- size="small"
- variant="tertiary"
- ariaLabel="Close"
- />
+ size="sm"
+ variant="ghost"
+ aria-label="Close"
+ >
+ <IconX />
+ </IconButton>
) : (
<IconButton
- Icon={IconX}
- size="small"
- variant="tertiary"
- accent={getButtonAccent(color)}
- ariaLabel="Close"
- />
+ size="sm"
+ variant="ghost"
+ color={getButtonColor(color)}
+ aria-label="Close"
+ >
+ <IconX />
+ </IconButton>
);
const meta: Meta<typeof Banner> = {
diff --git a/packages/twenty-ui/src/primitives/feedback/Info/Info.tsx b/packages/twenty-ui/src/primitives/feedback/Info/Info.tsx
index a677515b4db..5b4ef88e2ec 100644
--- a/packages/twenty-ui/src/primitives/feedback/Info/Info.tsx
+++ b/packages/twenty-ui/src/primitives/feedback/Info/Info.tsx
@@ -40,9 +40,8 @@ export const Info = ({
{buttonTitle && to && (
<span className={styles.linkContainer}>
<Button
+ href={to}
render={<Link to={to} />}
- nativeButton={false}
- role="link"
size="sm"
variant="outline"
color={accent === 'blue' ? 'accent' : 'danger'}
diff --git a/packages/twenty-ui/src/primitives/input/Button/Button.module.scss b/packages/twenty-ui/src/primitives/input/Button/Button.module.scss
index 630215679d7..0f975c6b396 100644
--- a/packages/twenty-ui/src/primitives/input/Button/Button.module.scss
+++ b/packages/twenty-ui/src/primitives/input/Button/Button.module.scss
@@ -14,6 +14,22 @@
block-size: var(--t-spacing-8);
border: 1px solid var(--tw-button-border);
border-radius: var(--t-border-radius-md);
+ border-end-end-radius: var(
+ --tw-button-border-end-end-radius,
+ var(--t-border-radius-md)
+ );
+ border-end-start-radius: var(
+ --tw-button-border-end-start-radius,
+ var(--t-border-radius-md)
+ );
+ border-start-end-radius: var(
+ --tw-button-border-start-end-radius,
+ var(--t-border-radius-md)
+ );
+ border-start-start-radius: var(
+ --tw-button-border-start-start-radius,
+ var(--t-border-radius-md)
+ );
box-sizing: border-box;
color: var(--tw-button-color);
cursor: pointer;
diff --git a/packages/twenty-ui/src/primitives/input/Button/Button.tsx b/packages/twenty-ui/src/primitives/input/Button/Button.tsx
index a7a0270a141..83f73110fdf 100644
--- a/packages/twenty-ui/src/primitives/input/Button/Button.tsx
+++ b/packages/twenty-ui/src/primitives/input/Button/Button.tsx
@@ -28,7 +28,6 @@ export const Button = ({
disabled = false,
href,
render,
- nativeButton,
className,
children,
...props
@@ -38,14 +37,13 @@ export const Button = ({
const resolvedColor = buttonGroup?.color ?? color;
const resolvedSize = buttonGroup?.size ?? size;
const isMobile = useIsMobile();
- const isNativeButton = nativeButton ?? !isDefined(href);
- const nonNativeRole = isDefined(href) ? 'link' : 'button';
- const resolvedRole =
- props.role ?? (isNativeButton ? undefined : nonNativeRole);
+ const isLink = isDefined(href);
+ const linkProps = isLink ? { href } : undefined;
return (
<ButtonPrimitive
{...props}
+ {...linkProps}
className={mergeClassNames(styles.button, className)}
data-variant={resolvedVariant}
data-color={resolvedColor}
@@ -55,11 +53,9 @@ export const Button = ({
data-elevated={elevated || undefined}
aria-busy={loading || props['aria-busy']}
disabled={disabled || soon || loading}
- role={resolvedRole}
- nativeButton={isNativeButton}
- render={
- render ?? (isDefined(href) ? <a href={href}>{children}</a> : undefined)
- }
+ role={isLink ? 'link' : undefined}
+ nativeButton={!isLink}
+ render={render ?? (isLink ? <a href={href}>{children}</a> : undefined)}
>
<span className={clsx(styles.content, loading && styles.hidden)}>
{isDefined(startIcon) && (
diff --git a/packages/twenty-ui/src/primitives/input/Button/__stories__/Button.stories.tsx b/packages/twenty-ui/src/primitives/input/Button/__stories__/Button.stories.tsx
index 12a94042185..5dc6cb3703e 100644
--- a/packages/twenty-ui/src/primitives/input/Button/__stories__/Button.stories.tsx
+++ b/packages/twenty-ui/src/primitives/input/Button/__stories__/Button.stories.tsx
@@ -1,6 +1,5 @@
import { type Meta, type StoryObj } from '@storybook/react-vite';
import { useState } from 'react';
-import { MemoryRouter, Link, useLocation } from 'react-router-dom';
import { expect, fn, userEvent, within } from 'storybook/test';
import { IconArrowRight, IconPlus } from '@ui/icon';
@@ -138,37 +137,10 @@ export const DisabledLink: Story = {
await expect(args.onClick).not.toHaveBeenCalled();
},
};
-const RouterExample = () => {
- const location = useLocation();
- return (
- <>
- <Button render={<Link to="/settings" />} nativeButton={false} role="link">
- Open settings
- </Button>
- <p>Current path: {location.pathname}</p>
- </>
- );
-};
-export const RouterLink: Story = {
- ...Default,
- render: () => (
- <MemoryRouter>
- <RouterExample />
- </MemoryRouter>
- ),
- play: async ({ canvasElement }) => {
- const canvas = within(canvasElement);
- const link = canvas.getByRole('link');
- link.focus();
- await userEvent.keyboard('{Enter}');
- await expect(canvas.getByText('Current path: /settings')).toBeVisible();
- },
-};
export const CustomRender: Story = {
...Keyboard,
args: {
- render: <span />,
- nativeButton: false,
+ render: <button data-custom-render />,
onClick: fn(),
onFocus: fn(),
onBlur: fn(),
diff --git a/packages/twenty-ui/src/primitives/input/Button/types/ButtonProps.ts b/packages/twenty-ui/src/primitives/input/Button/types/ButtonProps.ts
index 7cac83b50fb..739f8362781 100644
--- a/packages/twenty-ui/src/primitives/input/Button/types/ButtonProps.ts
+++ b/packages/twenty-ui/src/primitives/input/Button/types/ButtonProps.ts
@@ -5,7 +5,10 @@ import { type ButtonColor } from './ButtonColor';
import { type ButtonSize } from './ButtonSize';
import { type ButtonVariant } from './ButtonVariant';
-export type ButtonProps = Omit<ButtonPrimitive.Props, 'color'> &
+export type ButtonProps = Omit<
+ ButtonPrimitive.Props,
+ 'color' | 'nativeButton' | 'role'
+> &
Pick<ComponentPropsWithRef<'a'>, 'href' | 'target' | 'rel' | 'download'> & {
variant?: ButtonVariant;
color?: ButtonColor;
diff --git a/packages/twenty-ui/src/primitives/input/ButtonGroup/ButtonGroup.module.scss b/packages/twenty-ui/src/primitives/input/ButtonGroup/ButtonGroup.module.scss
index 1225d53072f..024c21654b8 100644
--- a/packages/twenty-ui/src/primitives/input/ButtonGroup/ButtonGroup.module.scss
+++ b/packages/twenty-ui/src/primitives/input/ButtonGroup/ButtonGroup.module.scss
@@ -1,18 +1,29 @@
.container {
+ --tw-button-border-end-end-radius: var(--t-border-radius-md);
+ --tw-button-border-end-start-radius: var(--t-border-radius-md);
+ --tw-button-border-start-end-radius: var(--t-border-radius-md);
+ --tw-button-border-start-start-radius: var(--t-border-radius-md);
+
border-radius: var(--t-border-radius-md);
display: inline-flex;
max-inline-size: 100%;
& > :not(:first-child) {
+ --tw-button-border-start-start-radius: 0;
+ --tw-button-border-end-start-radius: 0;
+
border-start-start-radius: 0;
border-end-start-radius: 0;
margin-inline-start: -1px;
}
& > :not(:last-child) {
+ --tw-button-border-start-end-radius: 0;
+ --tw-button-border-end-end-radius: 0;
+
border-start-end-radius: 0;
border-end-end-radius: 0;
}
- & > :focus-visible {
+ & > :focus-within {
z-index: 1;
}
}
diff --git a/packages/twenty-ui/src/primitives/input/ButtonGroup/__stories__/ButtonGroup.stories.tsx b/packages/twenty-ui/src/primitives/input/ButtonGroup/__stories__/ButtonGroup.stories.tsx
index 08373b8d9c3..07682ee0e03 100644
--- a/packages/twenty-ui/src/primitives/input/ButtonGroup/__stories__/ButtonGroup.stories.tsx
+++ b/packages/twenty-ui/src/primitives/input/ButtonGroup/__stories__/ButtonGroup.stories.tsx
@@ -82,6 +82,31 @@ export const InheritedAppearance: Story = {
await expect(wrapper).not.toHaveAttribute('variant');
await expect(wrapper).not.toHaveAttribute('color');
await expect(wrapper).not.toHaveAttribute('size');
+
+ const directButton = canvas.getByRole('button', { name: 'Direct action' });
+ const fragmentButton = canvas.getByRole('button', {
+ name: 'Fragment action',
+ });
+ const wrappedButton = canvas.getByRole('button', {
+ name: 'Wrapped action',
+ });
+ const directButtonStyle = getComputedStyle(directButton);
+ const fragmentButtonStyle = getComputedStyle(fragmentButton);
+ const wrappedButtonStyle = getComputedStyle(wrappedButton);
+
+ await expect(directButtonStyle.borderStartStartRadius).not.toBe('0px');
+ await expect(directButtonStyle.borderStartEndRadius).toBe('0px');
+ await expect(fragmentButtonStyle.borderStartStartRadius).toBe('0px');
+ await expect(fragmentButtonStyle.borderStartEndRadius).toBe('0px');
+ await expect(wrappedButtonStyle.borderStartStartRadius).toBe('0px');
+ await expect(wrappedButtonStyle.borderEndStartRadius).toBe('0px');
+ await expect(wrappedButtonStyle.borderStartEndRadius).toBe(
+ directButtonStyle.borderStartStartRadius,
+ );
+
+ wrappedButton.focus();
+
+ await expect(getComputedStyle(wrapper).zIndex).toBe('1');
},
};
diff --git a/packages/twenty-ui/src/primitives/input/IconButton/IconButton.module.scss b/packages/twenty-ui/src/primitives/input/IconButton/IconButton.module.scss
deleted file mode 100644
index 1399ebdb71a..00000000000
--- a/packages/twenty-ui/src/primitives/input/IconButton/IconButton.module.scss
+++ /dev/null
@@ -1,310 +0,0 @@
-@use 'sass:map';
-
-// The variant × accent × disabled × focus matrix below is ported
-// token-for-token from computeIconButtonDynamicStyles in the deprecated
-// IconButton.tsx. Matrix rules only assign CSS custom properties; the actual
-// declarations live on the flat .button class so twenty-front
-// styled(IconButton) overrides keep beating them at (0,1,0) specificity,
-// exactly like the legacy single Linaria class did.
-// Cascade order inside each branch: base, then [data-focus], then
-// [data-disabled] — later rules win, which replicates the legacy switch
-// precedence (disabled > focus > base).
-
-.button {
- align-items: center;
- background: var(--icon-button-bg, transparent);
- border-color: var(--icon-button-border-color, transparent);
- border-radius: var(--icon-button-radius, var(--t-border-radius-md));
- border-style: solid;
- border-width: var(--icon-button-border-width, 1px);
- box-shadow: var(--icon-button-box-shadow, none);
- box-sizing: border-box;
- color: var(--icon-button-color, var(--t-font-color-secondary));
- cursor: pointer;
- display: flex;
- flex-direction: row;
- font-family: var(--t-font-family);
- font-weight: 500;
- gap: var(--t-spacing-1);
- justify-content: center;
- opacity: var(--icon-button-opacity, 1);
- padding: 0;
- transition: background 0.1s ease;
- white-space: nowrap;
-
- &:hover {
- background: var(--icon-button-hover-bg, transparent);
- }
-
- &:active {
- background: var(--icon-button-active-bg, transparent);
- }
-
- &:focus {
- outline: none;
- }
-
- @include focus-ring;
-
- &[data-disabled] {
- cursor: not-allowed;
- }
-}
-
-.small {
- height: 24px;
- min-width: 24px;
-}
-
-.medium {
- height: 32px;
- min-width: 32px;
-}
-
-// position only reshapes the border radius; standalone keeps the .button
-// fallback radius. Grouped IconButtons abut flush (no framing container), so
-// their outer corners share the standalone md radius.
-.button[data-position='left'] {
- --icon-button-radius: var(--t-border-radius-md) 0px 0px
- var(--t-border-radius-md);
-}
-
-.button[data-position='middle'] {
- --icon-button-radius: 0px;
-}
-
-.button[data-position='right'] {
- --icon-button-radius: 0px var(--t-border-radius-md) var(--t-border-radius-md)
- 0px;
-}
-
-// Default border widths: tertiary is borderless and middle collapses the
-// horizontal borders for primary/secondary; the .button fallback covers the
-// remaining 1px cases.
-.button[data-variant='tertiary'] {
- --icon-button-border-width: 0;
-}
-
-.button[data-position='middle']:is(
- [data-variant='primary'],
- [data-variant='secondary']
- ) {
- --icon-button-border-width: 1px 0px;
-}
-
-// focusOverride from the legacy source: an enabled focused button always
-// shows a full 1px border, even for tertiary (borderless) and middle
-// (collapsed) buttons.
-.button[data-focus]:not([data-disabled]) {
- --icon-button-border-width: 1px 1px;
-}
-
-// variant=primary, keyed by accent. Null entries mean the disabled state
-// keeps the base/focus value, mirroring the legacy switch.
-$primary-accents: (
- 'default': (
- bg: var(--t-background-transparent-lighter),
- border: var(--t-background-transparent-light),
- border-focus: var(--t-color-blue),
- border-disabled: null,
- shadow-focus: var(--t-accent-tertiary),
- color: var(--t-font-color-secondary),
- color-disabled: var(--t-font-color-extra-light),
- opacity-disabled: null,
- hover: var(--t-background-tertiary),
- active: var(--t-background-quaternary),
- hover-disabled: var(--t-background-transparent-lighter),
- active-disabled: var(--t-background-transparent-lighter),
- ),
- 'blue': (
- bg: var(--t-color-blue),
- border: var(--t-background-transparent-light),
- border-focus: var(--t-color-blue),
- border-disabled: transparent,
- shadow-focus: var(--t-accent-tertiary),
- color: var(--t-gray-scale-gray1),
- color-disabled: null,
- opacity-disabled: 0.24,
- hover: var(--t-color-blue10),
- active: var(--t-color-blue12),
- hover-disabled: var(--t-color-blue),
- active-disabled: var(--t-color-blue),
- ),
- 'danger': (
- bg: var(--t-color-red),
- border: var(--t-background-transparent-light),
- border-focus: var(--t-color-red),
- border-disabled: transparent,
- shadow-focus: var(--t-color-red3),
- color: var(--t-gray-scale-gray1),
- color-disabled: null,
- opacity-disabled: 0.24,
- hover: var(--t-color-red10),
- active: var(--t-color-red10),
- hover-disabled: var(--t-color-red),
- active-disabled: var(--t-color-red),
- ),
-);
-
-@each $accent, $tokens in $primary-accents {
- .button[data-variant='primary'][data-accent='#{$accent}'] {
- --icon-button-bg: #{map.get($tokens, bg)};
- --icon-button-border-color: #{map.get($tokens, border)};
- --icon-button-color: #{map.get($tokens, color)};
- --icon-button-hover-bg: #{map.get($tokens, hover)};
- --icon-button-active-bg: #{map.get($tokens, active)};
- }
-
- // borderColor follows the raw focus flag in the legacy source, so
- // disabled+focus keeps it unless the accent defines border-disabled.
- .button[data-variant='primary'][data-accent='#{$accent}'][data-focus] {
- --icon-button-border-color: #{map.get($tokens, border-focus)};
- --icon-button-box-shadow: 0 0 0 3px #{map.get($tokens, shadow-focus)};
- }
-
- .button[data-variant='primary'][data-accent='#{$accent}'][data-disabled] {
- --icon-button-box-shadow: none;
- --icon-button-hover-bg: #{map.get($tokens, hover-disabled)};
- --icon-button-active-bg: #{map.get($tokens, active-disabled)};
-
- @if map.get($tokens, border-disabled) {
- --icon-button-border-color: #{map.get($tokens, border-disabled)};
- }
-
- @if map.get($tokens, color-disabled) {
- --icon-button-color: #{map.get($tokens, color-disabled)};
- }
-
- @if map.get($tokens, opacity-disabled) {
- --icon-button-opacity: #{map.get($tokens, opacity-disabled)};
- }
- }
-}
-
-// variant=secondary|tertiary. The two variants share backgrounds and disabled
-// treatment; they differ in their resting border (secondary is outlined,
-// tertiary borderless) and in how that border reacts to focus, so the border
-// logic is spelled out per accent instead of mapped.
-
-// accent=default
-.button:is(
- [data-variant='secondary'],
- [data-variant='tertiary']
- )[data-accent='default'] {
- --icon-button-hover-bg: var(--t-background-transparent-light);
- --icon-button-active-bg: var(--t-background-transparent-light);
-}
-
-.button[data-variant='secondary'][data-accent='default'] {
- --icon-button-border-color: var(--t-background-transparent-medium);
- --icon-button-color: var(--t-font-color-secondary);
-}
-
-.button[data-variant='tertiary'][data-accent='default'] {
- --icon-button-color: var(--t-font-color-secondary);
-}
-
-// background follows the raw focus flag (it stays on for disabled+focus).
-.button:is(
- [data-variant='secondary'],
- [data-variant='tertiary']
- )[data-accent='default'][data-focus] {
- --icon-button-bg: var(--t-background-transparent-primary);
- --icon-button-border-color: var(--t-color-blue);
- --icon-button-box-shadow: 0 0 0 3px var(--t-accent-tertiary);
-}
-
-.button:is(
- [data-variant='secondary'],
- [data-variant='tertiary']
- )[data-accent='default'][data-disabled] {
- --icon-button-box-shadow: none;
- --icon-button-color: var(--t-font-color-extra-light);
- --icon-button-hover-bg: transparent;
- --icon-button-active-bg: transparent;
-}
-
-// The secondary border only turns blue on enabled focus; tertiary keeps the
-// blue border even for disabled+focus (raw focus in the legacy source).
-.button[data-variant='secondary'][data-accent='default'][data-disabled] {
- --icon-button-border-color: var(--t-background-transparent-medium);
-}
-
-// accent=blue
-.button:is(
- [data-variant='secondary'],
- [data-variant='tertiary']
- )[data-accent='blue'] {
- --icon-button-color: var(--t-color-blue);
- --icon-button-hover-bg: var(--t-accent-tertiary);
- --icon-button-active-bg: var(--t-accent-secondary);
-}
-
-.button[data-variant='secondary'][data-accent='blue'] {
- --icon-button-border-color: var(--t-color-blue);
-}
-
-.button:is(
- [data-variant='secondary'],
- [data-variant='tertiary']
- )[data-accent='blue'][data-focus] {
- --icon-button-bg: var(--t-background-transparent-primary);
- --icon-button-box-shadow: 0 0 0 3px var(--t-accent-tertiary);
-}
-
-// Only the tertiary border reacts to focus for the blue accent; the
-// secondary border is keyed on disabled alone.
-.button[data-variant='tertiary'][data-accent='blue'][data-focus] {
- --icon-button-border-color: var(--t-color-blue);
-}
-
-.button:is(
- [data-variant='secondary'],
- [data-variant='tertiary']
- )[data-accent='blue'][data-disabled] {
- --icon-button-box-shadow: none;
- --icon-button-color: var(--t-accent-accent4060);
- --icon-button-hover-bg: transparent;
- --icon-button-active-bg: transparent;
-}
-
-.button[data-variant='secondary'][data-accent='blue'][data-disabled] {
- --icon-button-border-color: var(--t-color-blue5);
-}
-
-// accent=danger
-.button:is(
- [data-variant='secondary'],
- [data-variant='tertiary']
- )[data-accent='danger'] {
- --icon-button-color: var(--t-font-color-danger);
- --icon-button-hover-bg: var(--t-background-danger);
- --icon-button-active-bg: var(--t-background-danger);
-}
-
-.button[data-variant='secondary'][data-accent='danger'] {
- --icon-button-border-color: var(--t-border-color-danger);
-}
-
-// danger keeps a transparent background even on focus; only the shadow and
-// the tertiary border react.
-.button:is(
- [data-variant='secondary'],
- [data-variant='tertiary']
- )[data-accent='danger'][data-focus] {
- --icon-button-box-shadow: 0 0 0 3px var(--t-color-red3);
-}
-
-.button[data-variant='tertiary'][data-accent='danger'][data-focus] {
- --icon-button-border-color: var(--t-color-red);
-}
-
-.button:is(
- [data-variant='secondary'],
- [data-variant='tertiary']
- )[data-accent='danger'][data-disabled] {
- --icon-button-box-shadow: none;
- --icon-button-color: var(--t-color-red5);
- --icon-button-hover-bg: transparent;
- --icon-button-active-bg: transparent;
-}
diff --git a/packages/twenty-ui/src/primitives/input/IconButton/IconButton.tsx b/packages/twenty-ui/src/primitives/input/IconButton/IconButton.tsx
deleted file mode 100644
index 31230ff7d16..00000000000
--- a/packages/twenty-ui/src/primitives/input/IconButton/IconButton.tsx
+++ /dev/null
@@ -1,61 +0,0 @@
-import { type IconButtonProps } from './types/IconButtonProps';
-
-import { clsx } from 'clsx';
-import React from 'react';
-
-import { useTheme } from '@ui/theme-constants';
-
-import styles from './IconButton.module.scss';
-
-export const IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(
- (
- {
- className,
- Icon,
- variant = 'primary',
- size = 'medium',
- accent = 'default',
- position = 'standalone',
- disabled = false,
- focus = false,
- dataTestId,
- ariaLabel,
- 'aria-label': nativeAriaLabel,
- onClick,
- to,
- children,
- ...buttonProps
- },
- ref,
- ) => {
- const theme = useTheme();
- const resolvedAriaLabel = ariaLabel ?? nativeAriaLabel;
-
- return (
- <button
- {...buttonProps}
- ref={ref}
- data-testid={dataTestId}
- className={clsx(styles.button, styles[size], className)}
- data-variant={variant}
- data-accent={accent}
- data-position={position}
- data-disabled={disabled || undefined}
- data-focus={focus || undefined}
- disabled={disabled}
- onClick={onClick}
- aria-label={resolvedAriaLabel}
- // The legacy Linaria button never navigated: `to` was simply forwarded
- // to the DOM as an inert attribute. Keep forwarding it for DOM parity.
- {...{ to }}
- >
- {Icon ? (
- <Icon size={theme.icon.size.md} aria-hidden={!!resolvedAriaLabel} />
- ) : null}
- {children}
- </button>
- );
- },
-);
-
-IconButton.displayName = 'IconButton';
diff --git a/packages/twenty-ui/src/primitives/input/IconButton/__stories__/IconButton.stories.tsx b/packages/twenty-ui/src/primitives/input/IconButton/__stories__/IconButton.stories.tsx
deleted file mode 100644
index d54a677111d..00000000000
--- a/packages/twenty-ui/src/primitives/input/IconButton/__stories__/IconButton.stories.tsx
+++ /dev/null
@@ -1,199 +0,0 @@
-import { type Meta, type StoryObj } from '@storybook/react-vite';
-import { IconSearch } from '@ui/icon';
-import { expect, within } from 'storybook/test';
-import {
- A11Y_DEFER_COLOR_CONTRAST,
- CatalogDecorator,
- type CatalogStory,
- ComponentDecorator,
-} from '@ui/testing';
-import { IconButton } from '@ui/primitives/input/IconButton/IconButton';
-import type { IconButtonAccent } from '@ui/primitives/input/IconButton/types/IconButtonAccent';
-import type { IconButtonPosition } from '@ui/primitives/input/IconButton/types/IconButtonPosition';
-import type { IconButtonSize } from '@ui/primitives/input/IconButton/types/IconButtonSize';
-import type { IconButtonVariant } from '@ui/primitives/input/IconButton/types/IconButtonVariant';
-
-const meta: Meta<typeof IconButton> = {
- title: 'UI/Input/Button/IconButton',
- component: IconButton,
-};
-
-export default meta;
-type Story = StoryObj<typeof IconButton>;
-
-export const Default: Story = {
- args: {
- size: 'small',
- variant: 'primary',
- accent: 'danger',
- disabled: false,
- focus: false,
- position: 'standalone',
- Icon: IconSearch,
- ariaLabel: 'Search',
- },
- decorators: [ComponentDecorator],
-};
-
-export const TertiaryDefaultUsesSecondaryTextColor: Story = {
- args: {
- ...Default.args,
- variant: 'tertiary',
- accent: 'default',
- },
- play: async ({ canvasElement }) => {
- const button = within(canvasElement).getByRole('button');
- const computedStyle = getComputedStyle(button);
-
- await expect(
- computedStyle.getPropertyValue('--icon-button-color').trim(),
- ).toBe(computedStyle.getPropertyValue('--t-font-color-secondary').trim());
- },
-};
-
-export const Catalog: CatalogStory<Story, typeof IconButton> = {
- args: { Icon: IconSearch, ariaLabel: 'Search' },
- argTypes: {
- size: { control: false },
- variant: { control: false },
- focus: { control: false },
- accent: { control: false },
- disabled: { control: false },
- Icon: { control: false },
- position: { control: false },
- },
- parameters: {
- a11y: A11Y_DEFER_COLOR_CONTRAST,
- pseudo: { hover: ['.hover'], active: ['.pressed'] },
- catalog: {
- dimensions: [
- {
- name: 'sizes',
- values: ['small', 'medium'] satisfies IconButtonSize[],
- props: (size: IconButtonSize) => ({ size }),
- },
- {
- name: 'states',
- values: [
- 'default',
- 'hover',
- 'pressed',
- 'disabled',
- 'focus',
- 'disabled+focus',
- ],
- props: (state: string) => {
- switch (state) {
- case 'default':
- return {};
- case 'hover':
- case 'pressed':
- return { className: state };
- case 'focus':
- return { focus: true };
- case 'disabled':
- return { disabled: true };
- case 'active':
- return { active: true };
- case 'disabled+focus':
- return { focus: true, disabled: true };
- default:
- return {};
- }
- },
- },
- {
- name: 'accents',
- values: ['default', 'blue', 'danger'] satisfies IconButtonAccent[],
- props: (accent: IconButtonAccent) => ({ accent }),
- },
- {
- name: 'variants',
- values: [
- 'primary',
- 'secondary',
- 'tertiary',
- ] satisfies IconButtonVariant[],
- props: (variant: IconButtonVariant) => ({ variant }),
- },
- ],
- },
- },
- decorators: [CatalogDecorator],
-};
-
-export const PositionCatalog: CatalogStory<Story, typeof IconButton> = {
- args: { Icon: IconSearch, ariaLabel: 'Search' },
- argTypes: {
- size: { control: false },
- variant: { control: false },
- focus: { control: false },
- accent: { control: false },
- disabled: { control: false },
- position: { control: false },
- Icon: { control: false },
- },
- parameters: {
- a11y: A11Y_DEFER_COLOR_CONTRAST,
- pseudo: { hover: ['.hover'], active: ['.pressed'] },
- catalog: {
- dimensions: [
- {
- name: 'positions',
- values: [
- 'standalone',
- 'left',
- 'middle',
- 'right',
- ] satisfies IconButtonPosition[],
- props: (position: IconButtonPosition) => ({ position }),
- },
- {
- name: 'states',
- values: [
- 'default',
- 'hover',
- 'pressed',
- 'disabled',
- 'focus',
- 'disabled+focus',
- ],
- props: (state: string) => {
- switch (state) {
- case 'default':
- return {};
- case 'hover':
- case 'pressed':
- return { className: state };
- case 'focus':
- return { focus: true };
- case 'disabled':
- return { disabled: true };
- case 'active':
- return { active: true };
- case 'disabled+focus':
- return { focus: true, disabled: true };
- default:
- return {};
- }
- },
- },
- {
- name: 'sizes',
- values: ['small', 'medium'] satisfies IconButtonSize[],
- props: (size: IconButtonSize) => ({ size }),
- },
- {
- name: 'variants',
- values: [
- 'primary',
- 'secondary',
- 'tertiary',
- ] satisfies IconButtonVariant[],
- props: (variant: IconButtonVariant) => ({ variant }),
- },
- ],
- },
- },
- decorators: [CatalogDecorator],
-};
diff --git a/packages/twenty-ui/src/primitives/input/IconButton/types/IconButtonAccent.ts b/packages/twenty-ui/src/primitives/input/IconButton/types/IconButtonAccent.ts
deleted file mode 100644
index 3f889977dc4..00000000000
--- a/packages/twenty-ui/src/primitives/input/IconButton/types/IconButtonAccent.ts
+++ /dev/null
@@ -1 +0,0 @@
-export type IconButtonAccent = 'default' | 'blue' | 'danger';
diff --git a/packages/twenty-ui/src/primitives/input/IconButton/types/IconButtonPosition.ts b/packages/twenty-ui/src/primitives/input/IconButton/types/IconButtonPosition.ts
deleted file mode 100644
index 71c6639765a..00000000000
--- a/packages/twenty-ui/src/primitives/input/IconButton/types/IconButtonPosition.ts
+++ /dev/null
@@ -1 +0,0 @@
-export type IconButtonPosition = 'standalone' | 'left' | 'middle' | 'right';
diff --git a/packages/twenty-ui/src/primitives/input/IconButton/types/IconButtonProps.ts b/packages/twenty-ui/src/primitives/input/IconButton/types/IconButtonProps.ts
deleted file mode 100644
index d8082dd302e..00000000000
--- a/packages/twenty-ui/src/primitives/input/IconButton/types/IconButtonProps.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import React from 'react';
-import { type IconComponent } from '@ui/icon';
-import { type IconButtonSize } from './IconButtonSize';
-import { type IconButtonPosition } from './IconButtonPosition';
-import { type IconButtonVariant } from './IconButtonVariant';
-import { type IconButtonAccent } from './IconButtonAccent';
-
-export type IconButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
- className?: string;
- Icon?: IconComponent;
- variant?: IconButtonVariant;
- size?: IconButtonSize;
- position?: IconButtonPosition;
- accent?: IconButtonAccent;
- disabled?: boolean;
- focus?: boolean;
- dataTestId?: string;
- ariaLabel?: string;
- onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
- to?: string;
- children?: React.ReactNode;
-};
diff --git a/packages/twenty-ui/src/primitives/input/IconButton/types/IconButtonSize.ts b/packages/twenty-ui/src/primitives/input/IconButton/types/IconButtonSize.ts
deleted file mode 100644
index 9b2609b4e8c..00000000000
--- a/packages/twenty-ui/src/primitives/input/IconButton/types/IconButtonSize.ts
+++ /dev/null
@@ -1 +0,0 @@
-export type IconButtonSize = 'medium' | 'small';
diff --git a/packages/twenty-ui/src/primitives/input/IconButton/types/IconButtonVariant.ts b/packages/twenty-ui/src/primitives/input/IconButton/types/IconButtonVariant.ts
deleted file mode 100644
index 9037b7534cc..00000000000
--- a/packages/twenty-ui/src/primitives/input/IconButton/types/IconButtonVariant.ts
+++ /dev/null
@@ -1 +0,0 @@
-export type IconButtonVariant = 'primary' | 'secondary' | 'tertiary';
diff --git a/packages/twenty-ui/src/primitives/input/IconButtonWithTooltip/IconButtonWithTooltip.tsx b/packages/twenty-ui/src/primitives/input/IconButtonWithTooltip/IconButtonWithTooltip.tsx
deleted file mode 100644
index eb8f7dde003..00000000000
--- a/packages/twenty-ui/src/primitives/input/IconButtonWithTooltip/IconButtonWithTooltip.tsx
+++ /dev/null
@@ -1,60 +0,0 @@
-import { IconButton } from '@ui/primitives/input/IconButton/IconButton';
-import type { IconButtonProps } from '@ui/primitives/input/IconButton/types/IconButtonProps';
-import {
- AppTooltip,
- TooltipDelay,
- TooltipPosition,
-} from '@ui/primitives/surfaces';
-import { useId } from 'react';
-
-export type IconButtonWithTooltipProps = Pick<
- IconButtonProps,
- 'Icon' | 'ariaLabel' | 'onClick' | 'size' | 'variant' | 'disabled'
-> & {
- tooltipContent: string;
- tooltipPlace?: TooltipPosition;
- tooltipDelay?: TooltipDelay;
- tooltipOffset?: number;
-};
-
-export const IconButtonWithTooltip = ({
- tooltipContent,
- tooltipPlace = TooltipPosition.Bottom,
- tooltipDelay = TooltipDelay.longDelay,
- tooltipOffset = 5,
- Icon,
- ariaLabel,
- onClick,
- size,
- variant,
- disabled,
-}: IconButtonWithTooltipProps) => {
- const tooltipId = useId();
-
- return (
- <>
- <div data-tooltip-id={tooltipId}>
- <IconButton
- Icon={Icon}
- ariaLabel={ariaLabel}
- onClick={onClick}
- size={size}
- variant={variant}
- disabled={disabled}
- />
- </div>
- <AppTooltip
- anchorSelect={
- disabled
- ? `[data-tooltip-id='${tooltipId}']`
- : `[data-tooltip-id='${tooltipId}'] > button`
- }
- title={tooltipContent}
- delay={tooltipDelay}
- place={tooltipPlace}
- offset={tooltipOffset}
- noArrow
- />
- </>
- );
-};
diff --git a/packages/twenty-ui/src/primitives/input/IconButtonWithTooltip/__stories__/IconButtonWithTooltip.stories.tsx b/packages/twenty-ui/src/primitives/input/IconButtonWithTooltip/__stories__/IconButtonWithTooltip.stories.tsx
deleted file mode 100644
index 6112f04ace1..00000000000
--- a/packages/twenty-ui/src/primitives/input/IconButtonWithTooltip/__stories__/IconButtonWithTooltip.stories.tsx
+++ /dev/null
@@ -1,40 +0,0 @@
-import { type Meta, type StoryObj } from '@storybook/react-vite';
-import { IconSearch } from '@ui/icon';
-import { IconButtonWithTooltip } from '@ui/primitives/input/IconButtonWithTooltip/IconButtonWithTooltip';
-import { TooltipDelay } from '@ui/primitives/surfaces';
-import { ComponentDecorator } from '@ui/testing';
-import { expect, userEvent, within } from 'storybook/test';
-
-const meta: Meta<typeof IconButtonWithTooltip> = {
- title: 'UI/Input/Button/IconButtonWithTooltip',
- component: IconButtonWithTooltip,
- decorators: [ComponentDecorator],
-};
-
-export default meta;
-type Story = StoryObj<typeof IconButtonWithTooltip>;
-
-export const Default: Story = {
- args: {
- Icon: IconSearch,
- ariaLabel: 'Search',
- variant: 'tertiary',
- size: 'small',
- tooltipContent: 'Search',
- tooltipDelay: TooltipDelay.noDelay,
- },
- play: async ({ canvasElement }) => {
- const canvas = within(canvasElement);
- const button = canvas.getByRole('button', { name: 'Search' });
-
- await userEvent.tab();
-
- await expect(button).toHaveFocus();
-
- const canvasBody = within(canvasElement.ownerDocument.body);
-
- await expect(await canvasBody.findByRole('tooltip')).toHaveTextContent(
- 'Search',
- );
- },
-};
diff --git a/packages/twenty-ui/src/primitives/input/SearchInput/SearchInput.module.scss b/packages/twenty-ui/src/primitives/input/SearchInput/SearchInput.module.scss
index 2456f9289f6..6a91b88f2a2 100644
--- a/packages/twenty-ui/src/primitives/input/SearchInput/SearchInput.module.scss
+++ b/packages/twenty-ui/src/primitives/input/SearchInput/SearchInput.module.scss
@@ -5,6 +5,14 @@
width: 100%;
}
+.filterButton {
+ @include square-button;
+}
+
+.filterIcon {
+ display: flex;
+}
+
.inputContainer {
align-items: center;
background-color: var(--t-background-transparent-lighter);
diff --git a/packages/twenty-ui/src/primitives/input/SearchInput/SearchInput.module.scss.d.ts b/packages/twenty-ui/src/primitives/input/SearchInput/SearchInput.module.scss.d.ts
index cdc1f41b073..2504bcbe57a 100644
--- a/packages/twenty-ui/src/primitives/input/SearchInput/SearchInput.module.scss.d.ts
+++ b/packages/twenty-ui/src/primitives/input/SearchInput/SearchInput.module.scss.d.ts
@@ -1,5 +1,7 @@
declare const classNames: {
readonly wrapper: 'wrapper';
+ readonly filterButton: 'filterButton';
+ readonly filterIcon: 'filterIcon';
readonly inputContainer: 'inputContainer';
readonly iconContainer: 'iconContainer';
readonly input: 'input';
diff --git a/packages/twenty-ui/src/primitives/input/SearchInput/SearchInput.tsx b/packages/twenty-ui/src/primitives/input/SearchInput/SearchInput.tsx
index e5ed11ca086..36ae8262910 100644
--- a/packages/twenty-ui/src/primitives/input/SearchInput/SearchInput.tsx
+++ b/packages/twenty-ui/src/primitives/input/SearchInput/SearchInput.tsx
@@ -3,7 +3,7 @@ import { clsx } from 'clsx';
import { type ReactNode, useId, useState } from 'react';
import { IconFilter, IconSearch } from '@ui/icon';
-import { IconButton } from '@ui/primitives/input/IconButton/IconButton';
+import { Button } from '@ui/primitives/input/Button/Button';
import { useTheme } from '@ui/theme-constants';
import styles from './SearchInput.module.scss';
@@ -41,10 +41,15 @@ export const SearchInput = ({
const inputId = id ?? generatedId;
const filterButton = (
- <IconButton
- Icon={IconFilter}
- variant="secondary"
- ariaLabel={filterButtonAriaLabel}
+ <Button
+ variant="outline"
+ aria-label={filterButtonAriaLabel}
+ startIcon={
+ <span className={styles.filterIcon}>
+ <IconFilter size={theme.icon.size.md} />
+ </span>
+ }
+ className={styles.filterButton}
/>
);
diff --git a/packages/twenty-ui/src/primitives/input/index.ts b/packages/twenty-ui/src/primitives/input/index.ts
index 9f56a09f0d5..ab27ce85ba5 100644
--- a/packages/twenty-ui/src/primitives/input/index.ts
+++ b/packages/twenty-ui/src/primitives/input/index.ts
@@ -56,16 +56,8 @@ export type {
export { FloatingIconButton } from './FloatingIconButton/FloatingIconButton';
export type { FloatingIconButtonGroupProps } from './FloatingIconButtonGroup/FloatingIconButtonGroup';
export { FloatingIconButtonGroup } from './FloatingIconButtonGroup/FloatingIconButtonGroup';
-export { IconButton } from './IconButton/IconButton';
-export type { IconButtonAccent } from './IconButton/types/IconButtonAccent';
-export type { IconButtonPosition } from './IconButton/types/IconButtonPosition';
-export type { IconButtonProps } from './IconButton/types/IconButtonProps';
-export type { IconButtonSize } from './IconButton/types/IconButtonSize';
-export type { IconButtonVariant } from './IconButton/types/IconButtonVariant';
export type { IconButtonGroupProps } from './IconButtonGroup/IconButtonGroup';
export { IconButtonGroup } from './IconButtonGroup/IconButtonGroup';
-export type { IconButtonWithTooltipProps } from './IconButtonWithTooltip/IconButtonWithTooltip';
-export { IconButtonWithTooltip } from './IconButtonWithTooltip/IconButtonWithTooltip';
export { IconListViewGrip } from './IconListViewGrip/IconListViewGrip';
export { Input } from './Input/Input';
export type { InputProps } from './Input/types/InputProps';
diff --git a/packages/twenty-ui/src/primitives/surfaces/Modal/__stories__/Modal.stories.tsx b/packages/twenty-ui/src/primitives/surfaces/Modal/__stories__/Modal.stories.tsx
index 28533c035d7..896e9a320cf 100644
--- a/packages/twenty-ui/src/primitives/surfaces/Modal/__stories__/Modal.stories.tsx
+++ b/packages/twenty-ui/src/primitives/surfaces/Modal/__stories__/Modal.stories.tsx
@@ -2,7 +2,8 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
import { useState } from 'react';
import { IconX } from '@ui/icon';
import { H1Title, H1TitleFontColor, H2Title } from '@ui/primitives/typography';
-import { Button, IconButton } from '@ui/primitives/input';
+import { Button } from '@ui/primitives/input';
+import { IconButton } from '@ui/components';
import {
Section,
SectionAlignment,
@@ -235,11 +236,13 @@ const InteractiveModal = () => {
<ModalHeader>
<H2Title title="Create record" />
<IconButton
- Icon={IconX}
- variant="tertiary"
- size="small"
+ aria-label="Close"
+ variant="ghost"
+ size="sm"
onClick={() => setIsOpen(false)}
- />
+ >
+ <IconX />
+ </IconButton>
</ModalHeader>
<ModalContent>
<Section>
diff --git a/packages/twenty-ui/src/primitives/surfaces/Popover/__stories__/Popover.stories.tsx b/packages/twenty-ui/src/primitives/surfaces/Popover/__stories__/Popover.stories.tsx
index 7e991d8491d..00444bb5ee0 100644
--- a/packages/twenty-ui/src/primitives/surfaces/Popover/__stories__/Popover.stories.tsx
+++ b/packages/twenty-ui/src/primitives/surfaces/Popover/__stories__/Popover.stories.tsx
@@ -4,7 +4,7 @@ import { expect, fn, userEvent, waitFor, within } from 'storybook/test';
import { IconX } from '@ui/icon';
import { Button } from '@ui/primitives/input/Button/Button';
-import { IconButton } from '@ui/primitives/input/IconButton/IconButton';
+import { IconButton } from '@ui/components/IconButton/IconButton';
import {
A11Y_DEFER_COLOR_CONTRAST,
CatalogDecorator,
@@ -53,7 +53,11 @@ const PopoverStory = ({
</Button>
<Popover.Close
style={{ alignSelf: 'flex-start' }}
- render={<IconButton Icon={IconX} ariaLabel="Close" size="small" />}
+ render={
+ <IconButton aria-label="Close" size="sm">
+ <IconX />
+ </IconButton>
+ }
/>
</Popover.Popup>
</Popover.Root>
diff --git a/packages/twenty-ui/src/styles/abstracts/_mixins.scss b/packages/twenty-ui/src/styles/abstracts/_mixins.scss
index e2f985a610b..79f89321712 100644
--- a/packages/twenty-ui/src/styles/abstracts/_mixins.scss
+++ b/packages/twenty-ui/src/styles/abstracts/_mixins.scss
@@ -5,6 +5,16 @@
}
}
+@mixin square-button {
+ --tw-button-padding-inline: 0;
+
+ inline-size: var(--t-spacing-8);
+
+ &[data-size='sm'] {
+ inline-size: var(--t-spacing-6);
+ }
+}
+
// A tap leaves :hover applied until the next tap lands elsewhere, so anything
// that paints on hover has to be limited to pointers that can actually hover.
// Mirrors useIsTouchDevice.