Skip to content

The open alternative to Salesforce, designed for AI.

Migrate light icon buttons and groups (#26144)

Raphaël Bosic234ef1284f4
diff --git a/packages/twenty-docs/docs.json b/packages/twenty-docs/docs.json
index d5988edaab2..afe9b6385ff 100644
--- a/packages/twenty-docs/docs.json
+++ b/packages/twenty-docs/docs.json
@@ -578,6 +578,7 @@
"ui/components/input/main-button",
"ui/components/input/light-button",
"ui/components/input/icon-button",
+ "ui/components/input/light-icon-button",
"ui/components/section",
"ui/components/tab-button",
"ui/components/code-editor"
diff --git a/packages/twenty-docs/navigation/base-structure.json b/packages/twenty-docs/navigation/base-structure.json
index 52b710f0894..59d8b7f0f86 100644
--- a/packages/twenty-docs/navigation/base-structure.json
+++ b/packages/twenty-docs/navigation/base-structure.json
@@ -592,6 +592,7 @@
"ui/components/input/main-button",
"ui/components/input/light-button",
"ui/components/input/icon-button",
+ "ui/components/input/light-icon-button",
"ui/components/section",
"ui/components/tab-button",
"ui/components/code-editor"
diff --git a/packages/twenty-docs/scripts/ui/__tests__/documentation-prop-types.spec.ts b/packages/twenty-docs/scripts/ui/__tests__/documentation-prop-types.spec.ts
index 42b23b343f0..1df80c7e162 100644
--- a/packages/twenty-docs/scripts/ui/__tests__/documentation-prop-types.spec.ts
+++ b/packages/twenty-docs/scripts/ui/__tests__/documentation-prop-types.spec.ts
@@ -35,7 +35,7 @@ describe('documentation prop types', () => {
},
required: false,
},
- '"sm" | "md"',
+ '"md" | "sm"',
],
[
{
@@ -47,6 +47,38 @@ describe('documentation prop types', () => {
},
'"sm" | undefined',
],
+ [
+ {
+ type: {
+ name: 'enum',
+ value: ['1', '5', '2', '3', '4', '6', 'undefined'].map((value) => ({
+ value,
+ })),
+ },
+ required: false,
+ },
+ '1 | 2 | 3 | 4 | 5 | 6',
+ ],
+ [
+ {
+ type: {
+ name: 'enum',
+ value: ['10', '2', '-1', '1.5'].map((value) => ({ value })),
+ },
+ required: true,
+ },
+ '-1 | 1.5 | 2 | 10',
+ ],
+ [
+ {
+ type: {
+ name: 'enum',
+ value: ['2', '"auto"', '1'].map((value) => ({ value })),
+ },
+ required: true,
+ },
+ '"auto" | 1 | 2',
+ ],
])('normalizes %j to %j', (input, expected) => {
expect(normalizeDocumentationPropType(input)).toBe(expected);
});
diff --git a/packages/twenty-docs/snippets/ui/generated/components/code-editor.mdx b/packages/twenty-docs/snippets/ui/generated/components/code-editor.mdx
index 85de266dd0d..cdf0d2c4c1c 100644
--- a/packages/twenty-docs/snippets/ui/generated/components/code-editor.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/components/code-editor.mdx
@@ -15,7 +15,7 @@
Grows the editor to fit its content instead of using `height`. Ignored when `resizable` is set.
</ParamField>
-<ParamField body="contentPadding" type="&quot;default&quot; | &quot;comfortable&quot;" default="default">
+<ParamField body="contentPadding" type="&quot;comfortable&quot; | &quot;default&quot;" default="default">
`default` pads the top and bottom of the content. `comfortable` also widens the gap between line numbers and code.
</ParamField>
@@ -63,6 +63,6 @@
Content of the editor. Pair it with `onChange` to control the editor.
</ParamField>
-<ParamField body="variant" type="&quot;default&quot; | &quot;with-header&quot; | &quot;borderless&quot;" default="default">
+<ParamField body="variant" type="&quot;borderless&quot; | &quot;default&quot; | &quot;with-header&quot;" default="default">
Border treatment: `default` draws a rounded border, `with-header` attaches the editor below a `CodeEditorHeader`, and `borderless` removes the border.
</ParamField>
diff --git a/packages/twenty-docs/snippets/ui/generated/components/section.mdx b/packages/twenty-docs/snippets/ui/generated/components/section.mdx
index 0259ce38816..3aaaf014fe3 100644
--- a/packages/twenty-docs/snippets/ui/generated/components/section.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/components/section.mdx
@@ -50,7 +50,7 @@
Maximum visible lines for a string description. Defaults to `5`. Overflowing descriptions can be read in a tooltip on hover or focus.
</ParamField>
-<ParamField body="Header.level" type="5 | 1 | 2 | 3 | 4 | 6" default="2">
+<ParamField body="Header.level" type="1 | 2 | 3 | 4 | 5 | 6" default="2">
Semantic heading level, from `h1` through `h6`. Does not change the visual size. Defaults to `2`.
</ParamField>
@@ -61,7 +61,7 @@
Accepts a `ReactElement` or a function that returns the element to render.
</ParamField>
-<ParamField body="Header.size" type="&quot;sm&quot; | &quot;md&quot; | &quot;lg&quot; | &quot;xs&quot;" default="md">
+<ParamField body="Header.size" type="&quot;lg&quot; | &quot;md&quot; | &quot;sm&quot; | &quot;xs&quot;" default="md">
Visual font size, independent of the heading level. Defaults to `md`.
</ParamField>
diff --git a/packages/twenty-docs/snippets/ui/generated/components/tab-button.mdx b/packages/twenty-docs/snippets/ui/generated/components/tab-button.mdx
index 9ab1e0104b7..bd0f3dcdfbf 100644
--- a/packages/twenty-docs/snippets/ui/generated/components/tab-button.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/components/tab-button.mdx
@@ -36,7 +36,7 @@
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">
+<ParamField body="size" type="&quot;md&quot; | &quot;sm&quot;" default="sm">
Padding of the tab content: sm or md.
</ParamField>
diff --git a/packages/twenty-docs/snippets/ui/generated/data-display/avatar.mdx b/packages/twenty-docs/snippets/ui/generated/data-display/avatar.mdx
index d8d6bbc694b..20826d86cd8 100644
--- a/packages/twenty-docs/snippets/ui/generated/data-display/avatar.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/data-display/avatar.mdx
@@ -59,11 +59,11 @@
Accepts a `ReactElement` or a function that returns the element to render.
</ParamField>
-<ParamField body="shape" type="&quot;circle&quot; | &quot;square&quot; | &quot;rounded-square&quot;" default="square">
+<ParamField body="shape" type="&quot;circle&quot; | &quot;rounded-square&quot; | &quot;square&quot;" default="square">
Shape of the avatar and its fallback.
</ParamField>
-<ParamField body="size" type="&quot;sm&quot; | &quot;md&quot; | &quot;lg&quot; | &quot;xl&quot; | &quot;xs&quot;" default="md">
+<ParamField body="size" type="&quot;lg&quot; | &quot;md&quot; | &quot;sm&quot; | &quot;xl&quot; | &quot;xs&quot;" default="md">
Avatar size: `xs` (12px), `sm` (14px), `md` (16px), `lg` (24px), or `xl` (40px).
</ParamField>
diff --git a/packages/twenty-docs/snippets/ui/generated/data-display/chip.mdx b/packages/twenty-docs/snippets/ui/generated/data-display/chip.mdx
index 9688b5051ff..3801302622f 100644
--- a/packages/twenty-docs/snippets/ui/generated/data-display/chip.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/data-display/chip.mdx
@@ -62,11 +62,11 @@
Accepts a `ReactElement` or a function that returns the element to render.
</ParamField>
-<ParamField body="shape" type="&quot;square&quot; | &quot;round&quot;" default="square">
+<ParamField body="shape" type="&quot;round&quot; | &quot;square&quot;" default="square">
Square or round corners.
</ParamField>
-<ParamField body="size" type="&quot;sm&quot; | &quot;md&quot;" default="sm">
+<ParamField body="size" type="&quot;md&quot; | &quot;sm&quot;" default="sm">
Visual size of the chip.
</ParamField>
@@ -78,14 +78,14 @@
Tooltip content for a string label. Defaults to the label text.
</ParamField>
-<ParamField body="tooltipPlace" type="&quot;top&quot; | &quot;right&quot; | &quot;bottom&quot; | &quot;left&quot;">
+<ParamField body="tooltipPlace" type="&quot;bottom&quot; | &quot;left&quot; | &quot;right&quot; | &quot;top&quot;">
Position of the string-label tooltip.
</ParamField>
-<ParamField body="variant" type="&quot;solid&quot; | &quot;ghost&quot; | &quot;soft&quot;" default="ghost">
+<ParamField body="variant" type="&quot;ghost&quot; | &quot;soft&quot; | &quot;solid&quot;" default="ghost">
Background treatment of the chip.
</ParamField>
-<ParamField body="weight" type="&quot;regular&quot; | &quot;medium&quot;" default="regular">
+<ParamField body="weight" type="&quot;medium&quot; | &quot;regular&quot;" default="regular">
Font weight of the label.
</ParamField>
diff --git a/packages/twenty-docs/snippets/ui/generated/data-display/status.mdx b/packages/twenty-docs/snippets/ui/generated/data-display/status.mdx
index 2d7f9002e54..659cfe45a78 100644
--- a/packages/twenty-docs/snippets/ui/generated/data-display/status.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/data-display/status.mdx
@@ -11,7 +11,7 @@
* npx nx generate:ui twenty-docs
*/}
-<ParamField body="color" type="&quot;ruby&quot; | &quot;red&quot; | &quot;crimson&quot; | &quot;tomato&quot; | &quot;orange&quot; | &quot;amber&quot; | &quot;yellow&quot; | &quot;lime&quot; | &quot;grass&quot; | &quot;green&quot; | &quot;jade&quot; | &quot;mint&quot; | &quot;turquoise&quot; | &quot;cyan&quot; | &quot;sky&quot; | &quot;blue&quot; | &quot;iris&quot; | &quot;violet&quot; | &quot;purple&quot; | &quot;plum&quot; | &quot;pink&quot; | &quot;bronze&quot; | &quot;gold&quot; | &quot;brown&quot; | &quot;gray&quot;" required>
+<ParamField body="color" type="&quot;amber&quot; | &quot;blue&quot; | &quot;bronze&quot; | &quot;brown&quot; | &quot;crimson&quot; | &quot;cyan&quot; | &quot;gold&quot; | &quot;grass&quot; | &quot;gray&quot; | &quot;green&quot; | &quot;iris&quot; | &quot;jade&quot; | &quot;lime&quot; | &quot;mint&quot; | &quot;orange&quot; | &quot;pink&quot; | &quot;plum&quot; | &quot;purple&quot; | &quot;red&quot; | &quot;ruby&quot; | &quot;sky&quot; | &quot;tomato&quot; | &quot;turquoise&quot; | &quot;violet&quot; | &quot;yellow&quot;" required>
Theme color used for the status background, text, and loader.
</ParamField>
@@ -35,6 +35,6 @@
Replaces the default element. Required when `nativeButton` is `false`.
</ParamField>
-<ParamField body="weight" type="&quot;regular&quot; | &quot;medium&quot;" default="regular">
+<ParamField body="weight" type="&quot;medium&quot; | &quot;regular&quot;" default="regular">
Font weight of the label.
</ParamField>
diff --git a/packages/twenty-docs/snippets/ui/generated/data-display/tag.mdx b/packages/twenty-docs/snippets/ui/generated/data-display/tag.mdx
index b9c8cf9c535..1ff7d0fd45b 100644
--- a/packages/twenty-docs/snippets/ui/generated/data-display/tag.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/data-display/tag.mdx
@@ -11,11 +11,11 @@
* npx nx generate:ui twenty-docs
*/}
-<ParamField body="borderStyle" type="&quot;solid&quot; | &quot;dashed&quot;" default="solid">
+<ParamField body="borderStyle" type="&quot;dashed&quot; | &quot;solid&quot;" default="solid">
Border style used by the outline variant.
</ParamField>
-<ParamField body="color" type="&quot;ruby&quot; | &quot;red&quot; | &quot;crimson&quot; | &quot;tomato&quot; | &quot;orange&quot; | &quot;amber&quot; | &quot;yellow&quot; | &quot;lime&quot; | &quot;grass&quot; | &quot;green&quot; | &quot;jade&quot; | &quot;mint&quot; | &quot;turquoise&quot; | &quot;cyan&quot; | &quot;sky&quot; | &quot;blue&quot; | &quot;iris&quot; | &quot;violet&quot; | &quot;purple&quot; | &quot;plum&quot; | &quot;pink&quot; | &quot;bronze&quot; | &quot;gold&quot; | &quot;brown&quot; | &quot;gray&quot; | &quot;transparent&quot;" required>
+<ParamField body="color" type="&quot;amber&quot; | &quot;blue&quot; | &quot;bronze&quot; | &quot;brown&quot; | &quot;crimson&quot; | &quot;cyan&quot; | &quot;gold&quot; | &quot;grass&quot; | &quot;gray&quot; | &quot;green&quot; | &quot;iris&quot; | &quot;jade&quot; | &quot;lime&quot; | &quot;mint&quot; | &quot;orange&quot; | &quot;pink&quot; | &quot;plum&quot; | &quot;purple&quot; | &quot;red&quot; | &quot;ruby&quot; | &quot;sky&quot; | &quot;tomato&quot; | &quot;transparent&quot; | &quot;turquoise&quot; | &quot;violet&quot; | &quot;yellow&quot;" required>
Theme color for the tag, or `transparent` for an unfilled label.
</ParamField>
@@ -46,10 +46,10 @@
Decorative icon before the label. Hidden from assistive technology.
</ParamField>
-<ParamField body="variant" type="&quot;solid&quot; | &quot;outline&quot; | &quot;ghost&quot; | &quot;soft&quot;" default="soft">
+<ParamField body="variant" type="&quot;ghost&quot; | &quot;outline&quot; | &quot;soft&quot; | &quot;solid&quot;" default="soft">
Visual treatment of the tag background and border.
</ParamField>
-<ParamField body="weight" type="&quot;regular&quot; | &quot;medium&quot;" default="regular">
+<ParamField body="weight" type="&quot;medium&quot; | &quot;regular&quot;" default="regular">
Font weight of the label.
</ParamField>
diff --git a/packages/twenty-docs/snippets/ui/generated/feedback/toast.mdx b/packages/twenty-docs/snippets/ui/generated/feedback/toast.mdx
index 73b64d2ed0e..386d7c1b6b2 100644
--- a/packages/twenty-docs/snippets/ui/generated/feedback/toast.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/feedback/toast.mdx
@@ -61,6 +61,6 @@
Accepts a React element or a function that returns the element to render.
</ParamField>
-<ParamField body="variant" type="&quot;success&quot; | &quot;warning&quot; | &quot;default&quot; | &quot;error&quot; | &quot;info&quot;" default="default">
+<ParamField body="variant" type="&quot;default&quot; | &quot;error&quot; | &quot;info&quot; | &quot;success&quot; | &quot;warning&quot;" default="default">
Visual variant that selects the icon and colors.
</ParamField>
diff --git a/packages/twenty-docs/snippets/ui/generated/input/button-group.mdx b/packages/twenty-docs/snippets/ui/generated/input/button-group.mdx
index e877faee74c..fd8e99380fb 100644
--- a/packages/twenty-docs/snippets/ui/generated/input/button-group.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/input/button-group.mdx
@@ -11,10 +11,18 @@
* npx nx generate:ui twenty-docs
*/}
-<ParamField body="color" type="&quot;neutral&quot; | &quot;accent&quot; | &quot;danger&quot; | &quot;success&quot;">
+<ParamField body="attached" type="boolean" default="true">
+ Join adjacent controls. Set to false for independently rounded buttons with a 2px gap.
+</ParamField>
+
+<ParamField body="color" type="&quot;accent&quot; | &quot;danger&quot; | &quot;neutral&quot; | &quot;success&quot;">
Shared semantic color that overrides the color of buttons in the group.
</ParamField>
+<ParamField body="framed" type="boolean" default="false">
+ Add a translucent frame with padding and concentric corners. Button sizes and appearance remain independent unless set on the group.
+</ParamField>
+
<ParamField body="render" type="ReactElement&lt;unknown, string | JSXElementConstructor&lt;any&gt;&gt; | ComponentRenderFn&lt;HTMLProps, {}&gt;">
Allows you to replace the component's HTML element
with a different tag, or compose it with another component.
@@ -22,10 +30,10 @@
Accepts a `ReactElement` or a function that returns the element to render.
</ParamField>
-<ParamField body="size" type="&quot;sm&quot; | &quot;md&quot;">
+<ParamField body="size" type="&quot;md&quot; | &quot;sm&quot;">
Shared button height that overrides the size of buttons in the group.
</ParamField>
-<ParamField body="variant" type="&quot;solid&quot; | &quot;outline&quot; | &quot;ghost&quot; | &quot;soft&quot;">
+<ParamField body="variant" type="&quot;ghost&quot; | &quot;outline&quot; | &quot;soft&quot; | &quot;solid&quot;">
Shared surface treatment that overrides the variant of buttons in the group.
</ParamField>
diff --git a/packages/twenty-docs/snippets/ui/generated/input/button.mdx b/packages/twenty-docs/snippets/ui/generated/input/button.mdx
index 36dd3b3529c..892fc0e2387 100644
--- a/packages/twenty-docs/snippets/ui/generated/input/button.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/input/button.mdx
@@ -16,7 +16,7 @@
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;" default="neutral">
+<ParamField body="color" type="&quot;accent&quot; | &quot;danger&quot; | &quot;neutral&quot; | &quot;success&quot;" default="neutral">
Semantic color of the button.
</ParamField>
@@ -48,7 +48,7 @@
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">
+<ParamField body="size" type="&quot;md&quot; | &quot;sm&quot;" default="md">
Button height: `sm` (24px) or `md` (32px).
</ParamField>
@@ -69,6 +69,6 @@
returns a style object based on the component's state.
</ParamField>
-<ParamField body="variant" type="&quot;solid&quot; | &quot;outline&quot; | &quot;ghost&quot; | &quot;soft&quot;" default="outline">
+<ParamField body="variant" type="&quot;ghost&quot; | &quot;outline&quot; | &quot;soft&quot; | &quot;solid&quot;" default="outline">
Visual treatment of the button surface.
</ParamField>
diff --git a/packages/twenty-docs/snippets/ui/generated/input/checkbox.mdx b/packages/twenty-docs/snippets/ui/generated/input/checkbox.mdx
index 2afe3b9a62a..24db919e789 100644
--- a/packages/twenty-docs/snippets/ui/generated/input/checkbox.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/input/checkbox.mdx
@@ -93,11 +93,11 @@
Whether the user must tick the checkbox before submitting a form.
</ParamField>
-<ParamField body="shape" type="&quot;square&quot; | &quot;round&quot;" default="square">
+<ParamField body="shape" type="&quot;round&quot; | &quot;square&quot;" default="square">
Corner shape of the box.
</ParamField>
-<ParamField body="size" type="&quot;sm&quot; | &quot;md&quot;" default="sm">
+<ParamField body="size" type="&quot;md&quot; | &quot;sm&quot;" default="sm">
Visual size of the checkbox.
</ParamField>
@@ -116,6 +116,6 @@
When submitting a form, a checked box submits `value`; with no `value`, it submits the native "on".
</ParamField>
-<ParamField body="variant" type="&quot;solid&quot; | &quot;outline&quot; | &quot;soft&quot;" default="solid">
+<ParamField body="variant" type="&quot;outline&quot; | &quot;soft&quot; | &quot;solid&quot;" default="solid">
Visual style of the box: filled, outlined, or tinted.
</ParamField>
diff --git a/packages/twenty-docs/snippets/ui/generated/input/icon-button.mdx b/packages/twenty-docs/snippets/ui/generated/input/icon-button.mdx
index 06ac49368dc..14638f9ca6a 100644
--- a/packages/twenty-docs/snippets/ui/generated/input/icon-button.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/input/icon-button.mdx
@@ -24,7 +24,7 @@
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;">
+<ParamField body="color" type="&quot;accent&quot; | &quot;danger&quot; | &quot;neutral&quot; | &quot;success&quot;">
Semantic color of the button.
</ParamField>
@@ -44,8 +44,12 @@
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 body="shape" type="&quot;round&quot; | &quot;square&quot;" default="square">
+ Square or round icon control.
+</ParamField>
+
+<ParamField body="size" type="&quot;md&quot; | &quot;sm&quot; | &quot;xs&quot;" default="md">
+ Button size: `xs` (20px), `sm` (24px), or `md` (32px).
</ParamField>
<ParamField body="style" type="CSSProperties | ((state: ButtonState) =&gt; CSSProperties | undefined)">
@@ -65,10 +69,10 @@
Distance in pixels between the button and the tooltip.
</ParamField>
-<ParamField body="tooltipPlace" type="&quot;top&quot; | &quot;right&quot; | &quot;bottom&quot; | &quot;left&quot;" default="bottom">
+<ParamField body="tooltipPlace" type="&quot;bottom&quot; | &quot;left&quot; | &quot;right&quot; | &quot;top&quot;" default="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;">
+<ParamField body="variant" type="&quot;ghost&quot; | &quot;outline&quot; | &quot;soft&quot; | &quot;solid&quot;">
Visual treatment of the button surface.
</ParamField>
diff --git a/packages/twenty-docs/snippets/ui/generated/input/input-group.mdx b/packages/twenty-docs/snippets/ui/generated/input/input-group.mdx
index 3f3ecd62680..72d4955926a 100644
--- a/packages/twenty-docs/snippets/ui/generated/input/input-group.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/input/input-group.mdx
@@ -22,7 +22,7 @@
Accepts a `ReactElement` or a function that returns the element to render.
</ParamField>
-<ParamField body="size" type="&quot;sm&quot; | &quot;md&quot;" default="md">
+<ParamField body="size" type="&quot;md&quot; | &quot;sm&quot;" default="md">
Visual size of the group and its input.
</ParamField>
diff --git a/packages/twenty-docs/snippets/ui/generated/input/input.mdx b/packages/twenty-docs/snippets/ui/generated/input/input.mdx
index 2808c3bf742..8a268f94aeb 100644
--- a/packages/twenty-docs/snippets/ui/generated/input/input.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/input/input.mdx
@@ -31,7 +31,7 @@
Accepts a `ReactElement` or a function that returns the element to render.
</ParamField>
-<ParamField body="size" type="&quot;sm&quot; | &quot;md&quot;">
+<ParamField body="size" type="&quot;md&quot; | &quot;sm&quot;">
Visual size of the input. Inside an `InputGroup`, the group's size applies.
</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 1193ae4b6d9..26cd5eff4ef 100644
--- a/packages/twenty-docs/snippets/ui/generated/input/light-button.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/input/light-button.mdx
@@ -16,7 +16,7 @@
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;">
+<ParamField body="color" type="&quot;accent&quot; | &quot;danger&quot; | &quot;neutral&quot; | &quot;success&quot;">
Semantic color of the button.
</ParamField>
@@ -52,7 +52,7 @@
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">
+<ParamField body="size" type="&quot;md&quot; | &quot;sm&quot;" default="sm">
Button height: `sm` (24px) or `md` (32px).
</ParamField>
@@ -73,6 +73,6 @@
returns a style object based on the component's state.
</ParamField>
-<ParamField body="variant" type="&quot;solid&quot; | &quot;outline&quot; | &quot;ghost&quot; | &quot;soft&quot;" default="ghost">
+<ParamField body="variant" type="&quot;ghost&quot; | &quot;outline&quot; | &quot;soft&quot; | &quot;solid&quot;" default="ghost">
Visual treatment of the button surface.
</ParamField>
diff --git a/packages/twenty-docs/snippets/ui/generated/input/light-icon-button.mdx b/packages/twenty-docs/snippets/ui/generated/input/light-icon-button.mdx
new file mode 100644
index 00000000000..257afd6e83b
--- /dev/null
+++ b/packages/twenty-docs/snippets/ui/generated/input/light-icon-button.mdx
@@ -0,0 +1,82 @@
+{/*
+ * _____ _
+ *|_ _|_ _____ _ __ | |_ _ _
+ * | | \ \ /\ / / _ \ '_ \| __| | | | 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="children" type="ReactNode" required>
+ Icon content. Decorative and hidden from assistive technology.
+</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;accent&quot; | &quot;danger&quot; | &quot;neutral&quot; | &quot;success&quot;">
+ Semantic color of the button.
+</ParamField>
+
+<ParamField body="elevated" type="boolean">
+ Adds a shadow to the button.
+</ParamField>
+
+<ParamField body="emphasis" type="&quot;standard&quot; | &quot;subtle&quot;" default="standard">
+ Standard secondary text or subtle tertiary text. Semantic colors and solid surfaces keep their own colors.
+</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="shape" type="&quot;round&quot; | &quot;square&quot;">
+ Square or round icon control.
+</ParamField>
+
+<ParamField body="size" type="&quot;md&quot; | &quot;sm&quot; | &quot;xs&quot;" default="sm">
+ Button size: `xs` (20px), `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="number">
+ Delay before showing the tooltip.
+</ParamField>
+
+<ParamField body="tooltipOffset" type="number">
+ Distance in pixels between the button and the tooltip.
+</ParamField>
+
+<ParamField body="tooltipPlace" type="&quot;bottom&quot; | &quot;left&quot; | &quot;right&quot; | &quot;top&quot;">
+ Preferred placement of the tooltip relative to the button.
+</ParamField>
+
+<ParamField body="variant" type="&quot;ghost&quot; | &quot;outline&quot; | &quot;soft&quot; | &quot;solid&quot;" default="ghost">
+ Visual treatment of the button surface.
+</ParamField>
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 7ddfeec6af5..72f26701071 100644
--- a/packages/twenty-docs/snippets/ui/generated/input/main-button.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/input/main-button.mdx
@@ -16,7 +16,7 @@
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;">
+<ParamField body="color" type="&quot;accent&quot; | &quot;danger&quot; | &quot;neutral&quot; | &quot;success&quot;">
Semantic color of the button.
</ParamField>
@@ -48,7 +48,7 @@
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;">
+<ParamField body="size" type="&quot;md&quot; | &quot;sm&quot;">
Button height: `sm` (24px) or `md` (32px).
</ParamField>
@@ -69,6 +69,6 @@
returns a style object based on the component's state.
</ParamField>
-<ParamField body="variant" type="&quot;solid&quot; | &quot;outline&quot; | &quot;ghost&quot; | &quot;soft&quot;" default="solid">
+<ParamField body="variant" type="&quot;ghost&quot; | &quot;outline&quot; | &quot;soft&quot; | &quot;solid&quot;" default="solid">
Visual treatment of the button surface.
</ParamField>
diff --git a/packages/twenty-docs/snippets/ui/generated/input/radio.mdx b/packages/twenty-docs/snippets/ui/generated/input/radio.mdx
index 1a23e1a46f5..970c72a11b3 100644
--- a/packages/twenty-docs/snippets/ui/generated/input/radio.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/input/radio.mdx
@@ -45,7 +45,7 @@
Whether the user must choose a value before submitting a form.
</ParamField>
-<ParamField body="size" type="&quot;sm&quot; | &quot;md&quot;" default="sm">
+<ParamField body="size" type="&quot;md&quot; | &quot;sm&quot;" default="sm">
Visual size of the radio.
</ParamField>
diff --git a/packages/twenty-docs/snippets/ui/generated/input/select.mdx b/packages/twenty-docs/snippets/ui/generated/input/select.mdx
index afcc980d927..dc00494bab2 100644
--- a/packages/twenty-docs/snippets/ui/generated/input/select.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/input/select.mdx
@@ -145,7 +145,7 @@
Accepts a `ReactElement` or a function that returns the element to render.
</ParamField>
-<ParamField body="Trigger.size" type="&quot;sm&quot; | &quot;md&quot;" default="md">
+<ParamField body="Trigger.size" type="&quot;md&quot; | &quot;sm&quot;" default="md">
Visual size of the trigger.
</ParamField>
@@ -186,7 +186,7 @@
### Select.Popup
-<ParamField body="Popup.align" type="&quot;center&quot; | &quot;start&quot; | &quot;end&quot;" default="start">
+<ParamField body="Popup.align" type="&quot;center&quot; | &quot;end&quot; | &quot;start&quot;" default="start">
How to align the popup relative to the specified side.
</ParamField>
@@ -238,7 +238,7 @@
Accepts a `ReactElement` or a function that returns the element to render.
</ParamField>
-<ParamField body="Popup.side" type="&quot;top&quot; | &quot;right&quot; | &quot;bottom&quot; | &quot;left&quot; | &quot;inline-end&quot; | &quot;inline-start&quot;" default="bottom">
+<ParamField body="Popup.side" type="&quot;bottom&quot; | &quot;inline-end&quot; | &quot;inline-start&quot; | &quot;left&quot; | &quot;right&quot; | &quot;top&quot;" default="bottom">
Which side of the anchor element to align the popup against.
May automatically change to avoid collisions.
</ParamField>
@@ -271,7 +271,7 @@
Supporting text, placed according to `descriptionPlacement`.
</ParamField>
-<ParamField body="Item.descriptionPlacement" type="&quot;inline&quot; | &quot;end&quot;" default="inline">
+<ParamField body="Item.descriptionPlacement" type="&quot;end&quot; | &quot;inline&quot;" default="inline">
Where the description renders: inline after the content or at the end of
the row.
</ParamField>
diff --git a/packages/twenty-docs/snippets/ui/generated/input/slider.mdx b/packages/twenty-docs/snippets/ui/generated/input/slider.mdx
index d773a2948ae..13329511ad3 100644
--- a/packages/twenty-docs/snippets/ui/generated/input/slider.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/input/slider.mdx
@@ -119,7 +119,7 @@
returns a style object based on the component's state.
</ParamField>
-<ParamField body="Root.thumbAlignment" type="&quot;center&quot; | &quot;edge&quot; | &quot;edge-client-only&quot;" default="edge">
+<ParamField body="Root.thumbAlignment" type="&quot;center&quot; | &quot;edge-client-only&quot; | &quot;edge&quot;" default="edge">
How the thumb(s) are aligned relative to `Slider.Control` when the value is at `min` or `max`:
- `center`: The center of the thumb is aligned with the control edge
- `edge`: The thumb is inset within the control such that its edge is aligned with the control edge
diff --git a/packages/twenty-docs/snippets/ui/generated/input/switch.mdx b/packages/twenty-docs/snippets/ui/generated/input/switch.mdx
index fe595242d93..89f75fcf12d 100644
--- a/packages/twenty-docs/snippets/ui/generated/input/switch.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/input/switch.mdx
@@ -76,7 +76,7 @@
Whether the user must activate the switch before submitting a form.
</ParamField>
-<ParamField body="size" type="&quot;sm&quot; | &quot;md&quot;" default="md">
+<ParamField body="size" type="&quot;md&quot; | &quot;sm&quot;" default="md">
Visual size of the switch.
</ParamField>
diff --git a/packages/twenty-docs/snippets/ui/generated/input/textarea.mdx b/packages/twenty-docs/snippets/ui/generated/input/textarea.mdx
index 35e2e84b548..6946de2c9ff 100644
--- a/packages/twenty-docs/snippets/ui/generated/input/textarea.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/input/textarea.mdx
@@ -36,6 +36,6 @@
Accepts a `ReactElement` or a function that returns the element to render.
</ParamField>
-<ParamField body="size" type="&quot;sm&quot; | &quot;md&quot;" default="md">
+<ParamField body="size" type="&quot;md&quot; | &quot;sm&quot;" default="md">
Visual size of the textarea.
</ParamField>
diff --git a/packages/twenty-docs/snippets/ui/generated/navigation/list-item.mdx b/packages/twenty-docs/snippets/ui/generated/navigation/list-item.mdx
index 83b6ca16a86..2216f6e6f0a 100644
--- a/packages/twenty-docs/snippets/ui/generated/navigation/list-item.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/navigation/list-item.mdx
@@ -15,7 +15,7 @@
Trailing content, such as buttons, rendered after the content.
</ParamField>
-<ParamField body="color" type="&quot;neutral&quot; | &quot;danger&quot;" default="neutral">
+<ParamField body="color" type="&quot;danger&quot; | &quot;neutral&quot;" default="neutral">
Color of the text and icons. `danger` marks a destructive action.
</ParamField>
@@ -23,7 +23,7 @@
Supporting text, placed according to `descriptionPlacement`.
</ParamField>
-<ParamField body="descriptionPlacement" type="&quot;inline&quot; | &quot;end&quot;" default="inline">
+<ParamField body="descriptionPlacement" type="&quot;end&quot; | &quot;inline&quot;" default="inline">
Where the description renders: inline after the content or at the end of
the row.
</ParamField>
@@ -49,7 +49,7 @@
shortcut is up to the application.
</ParamField>
-<ParamField body="indicator" type="&quot;none&quot; | &quot;checkbox&quot; | &quot;check&quot;" default="none">
+<ParamField body="indicator" type="&quot;check&quot; | &quot;checkbox&quot; | &quot;none&quot;" default="none">
Selection indicator: a check icon after the content or a checkbox before
it.
</ParamField>
diff --git a/packages/twenty-docs/snippets/ui/generated/navigation/tabs.mdx b/packages/twenty-docs/snippets/ui/generated/navigation/tabs.mdx
index f5e273bf234..861f58fb1ca 100644
--- a/packages/twenty-docs/snippets/ui/generated/navigation/tabs.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/navigation/tabs.mdx
@@ -134,7 +134,7 @@
Accepts a `ReactElement` or a function that returns the element to render.
</ParamField>
-<ParamField body="Tab.size" type="&quot;sm&quot; | &quot;md&quot;" default="sm">
+<ParamField body="Tab.size" type="&quot;md&quot; | &quot;sm&quot;" default="sm">
Visual size of the tab.
</ParamField>
diff --git a/packages/twenty-docs/snippets/ui/generated/surfaces/alert-dialog.mdx b/packages/twenty-docs/snippets/ui/generated/surfaces/alert-dialog.mdx
index 5f6f33a1575..48ebdb68ef8 100644
--- a/packages/twenty-docs/snippets/ui/generated/surfaces/alert-dialog.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/surfaces/alert-dialog.mdx
@@ -144,7 +144,7 @@
Accepts a `ReactElement` or a function that returns the element to render.
</ParamField>
-<ParamField body="Popup.size" type="&quot;sm&quot; | &quot;md&quot; | &quot;lg&quot; | &quot;xl&quot; | &quot;fullscreen&quot;" default="md">
+<ParamField body="Popup.size" type="&quot;fullscreen&quot; | &quot;lg&quot; | &quot;md&quot; | &quot;sm&quot; | &quot;xl&quot;" default="md">
Width of the dialog, or `fullscreen` to fill the viewport.
</ParamField>
diff --git a/packages/twenty-docs/snippets/ui/generated/surfaces/dialog.mdx b/packages/twenty-docs/snippets/ui/generated/surfaces/dialog.mdx
index 6f69a6aaf7c..79eeb77cdb1 100644
--- a/packages/twenty-docs/snippets/ui/generated/surfaces/dialog.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/surfaces/dialog.mdx
@@ -162,7 +162,7 @@
Accepts a `ReactElement` or a function that returns the element to render.
</ParamField>
-<ParamField body="Popup.size" type="&quot;sm&quot; | &quot;md&quot; | &quot;lg&quot; | &quot;xl&quot; | &quot;fullscreen&quot;" default="md">
+<ParamField body="Popup.size" type="&quot;fullscreen&quot; | &quot;lg&quot; | &quot;md&quot; | &quot;sm&quot; | &quot;xl&quot;" default="md">
</ParamField>
@@ -186,7 +186,7 @@
Theme font color. Defaults to `primary`.
</ParamField>
-<ParamField body="Title.level" type="5 | 1 | 2 | 3 | 4 | 6" default="2">
+<ParamField body="Title.level" type="1 | 2 | 3 | 4 | 5 | 6" default="2">
Semantic heading level, from `h1` through `h6`. Does not change the visual size. Defaults to `2`.
</ParamField>
@@ -197,7 +197,7 @@
Accepts a `ReactElement` or a function that returns the element to render.
</ParamField>
-<ParamField body="Title.size" type="&quot;sm&quot; | &quot;md&quot; | &quot;lg&quot; | &quot;xs&quot;" default="lg">
+<ParamField body="Title.size" type="&quot;lg&quot; | &quot;md&quot; | &quot;sm&quot; | &quot;xs&quot;" default="lg">
Visual font size, independent of the heading level. Defaults to `lg`.
</ParamField>
diff --git a/packages/twenty-docs/snippets/ui/generated/surfaces/menu.mdx b/packages/twenty-docs/snippets/ui/generated/surfaces/menu.mdx
index 8db53a962dc..647aebbd7ef 100644
--- a/packages/twenty-docs/snippets/ui/generated/surfaces/menu.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/surfaces/menu.mdx
@@ -149,7 +149,7 @@
### Menu.Popup
-<ParamField body="Popup.align" type="&quot;center&quot; | &quot;start&quot; | &quot;end&quot;">
+<ParamField body="Popup.align" type="&quot;center&quot; | &quot;end&quot; | &quot;start&quot;">
Alignment of the popup along the anchor. Defaults to `start`.
</ParamField>
@@ -193,7 +193,7 @@
Accepts a `ReactElement` or a function that returns the element to render.
</ParamField>
-<ParamField body="Popup.side" type="&quot;top&quot; | &quot;right&quot; | &quot;bottom&quot; | &quot;left&quot; | &quot;inline-end&quot; | &quot;inline-start&quot;">
+<ParamField body="Popup.side" type="&quot;bottom&quot; | &quot;inline-end&quot; | &quot;inline-start&quot; | &quot;left&quot; | &quot;right&quot; | &quot;top&quot;">
Side of the anchor the popup is placed on. Defaults to `bottom` for a menu
and `inline-end` for a submenu.
</ParamField>
@@ -219,7 +219,7 @@
Whether to close the menu when the item is clicked.
</ParamField>
-<ParamField body="Item.color" type="&quot;neutral&quot; | &quot;danger&quot;">
+<ParamField body="Item.color" type="&quot;danger&quot; | &quot;neutral&quot;">
Color of the text and icons. `danger` marks a destructive action.
</ParamField>
@@ -227,7 +227,7 @@
Supporting text, placed according to `descriptionPlacement`.
</ParamField>
-<ParamField body="Item.descriptionPlacement" type="&quot;inline&quot; | &quot;end&quot;">
+<ParamField body="Item.descriptionPlacement" type="&quot;end&quot; | &quot;inline&quot;">
Where the description renders: inline after the content or at the end of
the row.
</ParamField>
@@ -292,7 +292,7 @@
Whether to close the menu when the item is clicked.
</ParamField>
-<ParamField body="CheckboxItem.color" type="&quot;neutral&quot; | &quot;danger&quot;">
+<ParamField body="CheckboxItem.color" type="&quot;danger&quot; | &quot;neutral&quot;">
Color of the text and icons. `danger` marks a destructive action.
</ParamField>
@@ -306,7 +306,7 @@
Supporting text, placed according to `descriptionPlacement`.
</ParamField>
-<ParamField body="CheckboxItem.descriptionPlacement" type="&quot;inline&quot; | &quot;end&quot;">
+<ParamField body="CheckboxItem.descriptionPlacement" type="&quot;end&quot; | &quot;inline&quot;">
Where the description renders: inline after the content or at the end of
the row.
</ParamField>
@@ -412,7 +412,7 @@
Whether to close the menu when the item is clicked.
</ParamField>
-<ParamField body="RadioItem.color" type="&quot;neutral&quot; | &quot;danger&quot;">
+<ParamField body="RadioItem.color" type="&quot;danger&quot; | &quot;neutral&quot;">
Color of the text and icons. `danger` marks a destructive action.
</ParamField>
@@ -420,7 +420,7 @@
Supporting text, placed according to `descriptionPlacement`.
</ParamField>
-<ParamField body="RadioItem.descriptionPlacement" type="&quot;inline&quot; | &quot;end&quot;">
+<ParamField body="RadioItem.descriptionPlacement" type="&quot;end&quot; | &quot;inline&quot;">
Where the description renders: inline after the content or at the end of
the row.
</ParamField>
@@ -607,7 +607,7 @@
Requires the `openOnHover` prop.
</ParamField>
-<ParamField body="SubmenuTrigger.color" type="&quot;neutral&quot; | &quot;danger&quot;">
+<ParamField body="SubmenuTrigger.color" type="&quot;danger&quot; | &quot;neutral&quot;">
Color of the text and icons. `danger` marks a destructive action.
</ParamField>
@@ -621,7 +621,7 @@
Supporting text, placed according to `descriptionPlacement`.
</ParamField>
-<ParamField body="SubmenuTrigger.descriptionPlacement" type="&quot;inline&quot; | &quot;end&quot;">
+<ParamField body="SubmenuTrigger.descriptionPlacement" type="&quot;end&quot; | &quot;inline&quot;">
Where the description renders: inline after the content or at the end of
the row.
</ParamField>
diff --git a/packages/twenty-docs/snippets/ui/generated/surfaces/popover.mdx b/packages/twenty-docs/snippets/ui/generated/surfaces/popover.mdx
index 844ac0dfadd..8a45878aad8 100644
--- a/packages/twenty-docs/snippets/ui/generated/surfaces/popover.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/surfaces/popover.mdx
@@ -132,7 +132,7 @@
### Popover.Popup
-<ParamField body="Popup.align" type="&quot;center&quot; | &quot;start&quot; | &quot;end&quot;" default="center">
+<ParamField body="Popup.align" type="&quot;center&quot; | &quot;end&quot; | &quot;start&quot;" default="center">
Alignment of the popup along the anchor.
</ParamField>
@@ -191,7 +191,7 @@
Accepts a `ReactElement` or a function that returns the element to render.
</ParamField>
-<ParamField body="Popup.side" type="&quot;top&quot; | &quot;right&quot; | &quot;bottom&quot; | &quot;left&quot; | &quot;inline-end&quot; | &quot;inline-start&quot;" default="bottom">
+<ParamField body="Popup.side" type="&quot;bottom&quot; | &quot;inline-end&quot; | &quot;inline-start&quot; | &quot;left&quot; | &quot;right&quot; | &quot;top&quot;" default="bottom">
Side of the anchor the popup is placed on.
</ParamField>
diff --git a/packages/twenty-docs/snippets/ui/generated/surfaces/tooltip.mdx b/packages/twenty-docs/snippets/ui/generated/surfaces/tooltip.mdx
index 3275df210cd..00b827266db 100644
--- a/packages/twenty-docs/snippets/ui/generated/surfaces/tooltip.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/surfaces/tooltip.mdx
@@ -17,7 +17,7 @@
- `close`: Closes the tooltip imperatively when called.
</ParamField>
-<ParamField body="align" type="&quot;center&quot; | &quot;start&quot; | &quot;end&quot;">
+<ParamField body="align" type="&quot;center&quot; | &quot;end&quot; | &quot;start&quot;">
Alignment relative to the trigger. Defaults to center.
</ParamField>
@@ -149,7 +149,7 @@
Accepts a `ReactElement` or a function that returns the element to render.
</ParamField>
-<ParamField body="side" type="&quot;top&quot; | &quot;right&quot; | &quot;bottom&quot; | &quot;left&quot;">
+<ParamField body="side" type="&quot;bottom&quot; | &quot;left&quot; | &quot;right&quot; | &quot;top&quot;">
Preferred side of the trigger. Defaults to top and may change to avoid collisions.
</ParamField>
@@ -166,7 +166,7 @@
Inline styles for the popup.
</ParamField>
-<ParamField body="trackCursorAxis" type="&quot;none&quot; | &quot;both&quot; | &quot;x&quot; | &quot;y&quot;" default="none">
+<ParamField body="trackCursorAxis" type="&quot;both&quot; | &quot;none&quot; | &quot;x&quot; | &quot;y&quot;" default="none">
Determines which axis the tooltip should track the cursor on.
</ParamField>
@@ -226,7 +226,7 @@
Whether the tooltip is currently open.
</ParamField>
-<ParamField body="Root.trackCursorAxis" type="&quot;none&quot; | &quot;both&quot; | &quot;x&quot; | &quot;y&quot;" default="none">
+<ParamField body="Root.trackCursorAxis" type="&quot;both&quot; | &quot;none&quot; | &quot;x&quot; | &quot;y&quot;" default="none">
Determines which axis the tooltip should track the cursor on.
</ParamField>
@@ -283,7 +283,7 @@
### Tooltip.Popup
-<ParamField body="Popup.align" type="&quot;center&quot; | &quot;start&quot; | &quot;end&quot;" default="center">
+<ParamField body="Popup.align" type="&quot;center&quot; | &quot;end&quot; | &quot;start&quot;" default="center">
Alignment relative to the trigger. Defaults to center.
</ParamField>
@@ -366,7 +366,7 @@
Accepts a `ReactElement` or a function that returns the element to render.
</ParamField>
-<ParamField body="Popup.side" type="&quot;top&quot; | &quot;right&quot; | &quot;bottom&quot; | &quot;left&quot;" default="top">
+<ParamField body="Popup.side" type="&quot;bottom&quot; | &quot;left&quot; | &quot;right&quot; | &quot;top&quot;" default="top">
Preferred side of the trigger. Defaults to top and may change to avoid collisions.
</ParamField>
diff --git a/packages/twenty-docs/snippets/ui/generated/typography/heading.mdx b/packages/twenty-docs/snippets/ui/generated/typography/heading.mdx
index 59423eca3e7..b66c45396ac 100644
--- a/packages/twenty-docs/snippets/ui/generated/typography/heading.mdx
+++ b/packages/twenty-docs/snippets/ui/generated/typography/heading.mdx
@@ -15,7 +15,7 @@
Theme font color. Defaults to `primary`.
</ParamField>
-<ParamField body="level" type="5 | 1 | 2 | 3 | 4 | 6" default="2">
+<ParamField body="level" type="1 | 2 | 3 | 4 | 5 | 6" default="2">
Semantic heading level, from `h1` through `h6`. Does not change the visual size. Defaults to `2`.
</ParamField>
@@ -26,6 +26,6 @@
Accepts a `ReactElement` or a function that returns the element to render.
</ParamField>
-<ParamField body="size" type="&quot;sm&quot; | &quot;md&quot; | &quot;lg&quot; | &quot;xs&quot;" default="md">
+<ParamField body="size" type="&quot;lg&quot; | &quot;md&quot; | &quot;sm&quot; | &quot;xs&quot;" default="md">
Visual font size, independent of the heading level. Defaults to `md`.
</ParamField>
diff --git a/packages/twenty-docs/ui/components/input/icon-button.mdx b/packages/twenty-docs/ui/components/input/icon-button.mdx
index 887e3329fe2..b55b04f615f 100644
--- a/packages/twenty-docs/ui/components/input/icon-button.mdx
+++ b/packages/twenty-docs/ui/components/input/icon-button.mdx
@@ -27,7 +27,7 @@ export const CreateRecordButton = () => (
);
```
-Sizes are `sm` (24px) and `md` (32px). The defaults are `md`, `outline`, and `neutral`. Variants and colors match Button.
+Sizes are `xs` (20px), `sm` (24px), and `md` (32px). The defaults are `md`, `outline`, and `neutral`. Variants and colors match Button. Use `shape="round"` for a circular button; the default shape is `square`.
<StoryEmbed
title="Icon button example"
@@ -52,7 +52,7 @@ export const SearchRecordsButton = () => (
<StoryEmbed
title="Icon button with tooltip"
- storyId="ui-components-iconbutton--tooltip"
+ storyId="ui-components-iconbutton--tooltip-documentation"
height={180}
/>
@@ -92,3 +92,7 @@ Native attributes, event handlers, refs, and render composition pass through to
## Props
<IconButtonReference />
+
+## Compact and round controls
+
+Use `size="xs"` for a 20px control and `shape="round"` for circular corners. Existing `RoundedIconButton` controls become `IconButton` with `shape="round"`, `variant="solid"`, and `color="accent"`. Map their old `small` size to `xs` and `medium` size to `sm`. Supply icon children and an accessible name.
diff --git a/packages/twenty-docs/ui/components/input/light-icon-button.mdx b/packages/twenty-docs/ui/components/input/light-icon-button.mdx
new file mode 100644
index 00000000000..00aea57915c
--- /dev/null
+++ b/packages/twenty-docs/ui/components/input/light-icon-button.mdx
@@ -0,0 +1,75 @@
+---
+title: LightIconButton
+description: Present lightweight icon actions with standard or subtle emphasis.
+---
+
+import { StoryEmbed } from '/snippets/ui/StoryEmbed.mdx';
+import LightIconButtonReference from '/snippets/ui/generated/input/light-icon-button.mdx';
+
+`LightIconButton` composes [IconButton](/ui/components/input/icon-button) with a ghost surface and a small size. Supply an accessible name and decorative icon content.
+
+<StoryEmbed
+ storyId="ui-input-button-lighticonbutton--documentation"
+ title="Light icon button"
+ height={240}
+/>
+
+## Usage
+
+```tsx
+import { LightIconButton } from 'twenty-ui/components';
+import { IconPlus } from 'twenty-ui/icon';
+
+export const AddAction = () => (
+ <LightIconButton aria-label="Add record" emphasis="subtle">
+ <IconPlus />
+ </LightIconButton>
+);
+```
+
+Standard emphasis uses secondary neutral text; subtle emphasis uses tertiary text. Explicit semantic colors and group colors take precedence. Small controls are 24px with a 14px icon; medium controls are 32px with a 16px icon. Compact controls use `size="xs"` and are 20px.
+
+## State and interaction
+
+Button owns keyboard activation, disabled and loading behavior, refs, native attributes, and render composition. The native default is `type="button"`. Use `aria-pressed` for toggles and `aria-expanded` for disclosures. The application owns these states and can set `color="accent"` to highlight a selected action. Keyboard focus uses the shared focus ring.
+
+Tooltip text is optional and does not replace `aria-label`. Set `href` for a link and supply `render` when the application owns routing.
+
+## Updating existing controls
+
+Import `LightIconButton` from `twenty-ui/components`. Replace `Icon={IconPlus}` with `<IconPlus />` children, `small`/`medium` with `sm`/`md`, `accent="tertiary"` with `emphasis="subtle"`, and `testId` with `data-testid`. Replace synthetic `active` and `focus` flags with semantic state and actual keyboard focus.
+
+Replace `LightIconButtonGroup` with [ButtonGroup](/ui/primitives/input/button-group) using `attached={false}` and explicit children. Set `disabled` on unavailable actions, including actions without a click handler. Wrappers and tooltip triggers can remain around each child.
+
+## Menu item icon buttons
+
+`MenuItem`, `MenuItemDraggable`, and `MenuItemAvatar` accept JSX through `iconButtons`. Pass one `LightIconButton` directly, or use `ButtonGroup` for multiple buttons. The menu controls their placement and hover visibility; each button owns its accessible name, click handler, and disabled state. Wrap dropdown triggers directly around the button.
+
+```tsx
+import { LightIconButton } from 'twenty-ui/components';
+import { IconEyeOff, IconTrash } from 'twenty-ui/icon';
+import { ButtonGroup } from 'twenty-ui/primitives/input';
+import { MenuItem } from 'twenty-ui/primitives/navigation';
+
+export const RecordMenuItem = () => (
+ <MenuItem
+ text="Record"
+ iconButtons={
+ <ButtonGroup attached={false}>
+ <LightIconButton aria-label="Hide record">
+ <IconEyeOff />
+ </LightIconButton>
+ <LightIconButton aria-label="Delete record" disabled>
+ <IconTrash />
+ </LightIconButton>
+ </ButtonGroup>
+ }
+ />
+);
+```
+
+Replace descriptor arrays with these elements and remove `MenuItemIconButton` types. A button without an `onClick` handler can remain enabled when a surrounding dropdown owns its interaction. Set `disabled` explicitly for unavailable buttons.
+
+## Props
+
+<LightIconButtonReference />
diff --git a/packages/twenty-docs/ui/components/overview.mdx b/packages/twenty-docs/ui/components/overview.mdx
index 70af4c42486..31f690f37ba 100644
--- a/packages/twenty-docs/ui/components/overview.mdx
+++ b/packages/twenty-docs/ui/components/overview.mdx
@@ -10,11 +10,12 @@ Import shared components from `twenty-ui/components`. The code editor has its ow
## 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. |
-| [IconButton](/ui/components/input/icon-button) | Square icon actions built on Button. |
-| [Section](/ui/components/section) | Related content with a heading, description, and optional action. |
-| [TabButton](/ui/components/tab-button) | Route links and adjacent actions with the same appearance as tabs. |
-| [CodeEditor](/ui/components/code-editor) | Code editing with Monaco, an optional header, and the Twenty theme. |
+| 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 or round icon actions built on Button. |
+| [LightIconButton](/ui/components/input/light-icon-button) | Lightweight icon actions with standard or subtle emphasis. |
+| [Section](/ui/components/section) | Related content with a heading, description, and optional action. |
+| [TabButton](/ui/components/tab-button) | Route links and adjacent actions with the same appearance as tabs. |
+| [CodeEditor](/ui/components/code-editor) | Code editing with Monaco, an optional header, and the Twenty theme. |
diff --git a/packages/twenty-docs/ui/primitives/input/button-group.mdx b/packages/twenty-docs/ui/primitives/input/button-group.mdx
index d325edff901..8e6745dea71 100644
--- a/packages/twenty-docs/ui/primitives/input/button-group.mdx
+++ b/packages/twenty-docs/ui/primitives/input/button-group.mdx
@@ -1,8 +1,9 @@
---
title: ButtonGroup
-description: Group related buttons with joined borders and shared appearance.
+description: Group related buttons with shared appearance and an optional frame.
---
+import { StoryEmbed } from '/snippets/ui/StoryEmbed.mdx';
import ButtonGroupReference from '/snippets/ui/generated/input/button-group.mdx';
Give a group an accessible name and place related buttons inside it. The group joins adjacent borders and can apply a shared size, variant, and color. Buttons retain their own tab stops.
@@ -29,3 +30,38 @@ export const RecordActions = () => (
## Props
<ButtonGroupReference />
+
+## Detached controls
+
+Set `attached={false}` to keep each control's rounded corners and a 2px gap. Shared size, surface, and color still apply through wrappers and tooltip anchors.
+
+## Framed controls
+
+Set `framed` to add a translucent background, border, 2px padding, and concentric corners. The frame works with attached or detached controls and preserves each button's size and appearance unless you set them on the group. Use `size="xs"` on [LightIconButton](/ui/components/input/light-icon-button) for compact 20px actions.
+
+<StoryEmbed
+ storyId="ui-input-button-buttongroup--framed-documentation"
+ title="Framed button group"
+ height={180}
+/>
+
+```tsx
+import { LightIconButton } from 'twenty-ui/components';
+import { IconPlus, IconTrash } from 'twenty-ui/icon';
+import { ButtonGroup } from 'twenty-ui/primitives/input';
+
+export const CompactRecordActions = () => (
+ <ButtonGroup framed attached={false} aria-label="Record actions">
+ <LightIconButton size="xs" aria-label="Add" emphasis="subtle">
+ <IconPlus />
+ </LightIconButton>
+ <LightIconButton size="xs" aria-label="Delete" emphasis="subtle" disabled>
+ <IconTrash />
+ </LightIconButton>
+ </ButtonGroup>
+);
+```
+
+## Updating existing groups
+
+Replace `IconButtonGroup` and its `iconButtons` array with `ButtonGroup framed attached={false}` and explicit children. Replace `InsideButton` with `LightIconButton size="xs"`. Each button owns its accessible name, action handler, disabled state, and optional tooltip.
diff --git a/packages/twenty-docs/ui/primitives/surfaces/tooltip.mdx b/packages/twenty-docs/ui/primitives/surfaces/tooltip.mdx
index 683768354bc..49a5d2597db 100644
--- a/packages/twenty-docs/ui/primitives/surfaces/tooltip.mdx
+++ b/packages/twenty-docs/ui/primitives/surfaces/tooltip.mdx
@@ -9,7 +9,10 @@ import TooltipReference from '/snippets/ui/generated/surfaces/tooltip.mdx';
Use `Tooltip` for a short explanation of a control or truncated text. Keep essential information visible, give controls an accessible name, and use [Popover](/ui/primitives/surfaces/popover) when the content contains links, buttons, or other controls.
-<StoryEmbed storyId="ui-surfaces-tooltip--default" title="Tooltip example" />
+<StoryEmbed
+ storyId="ui-surfaces-tooltip--documentation"
+ title="Tooltip example"
+/>
## Single trigger
diff --git a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-button-controls.front-component.tsx b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-button-controls.front-component.tsx
index c4433af2d42..041d78e4dbc 100644
--- a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-button-controls.front-component.tsx
+++ b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-button-controls.front-component.tsx
@@ -1,7 +1,13 @@
import { useState } from 'react';
import { defineFrontComponent } from 'twenty-sdk/define';
-import { LightButton, MainButton } from 'twenty-ui/components';
+import {
+ IconButton,
+ LightIconButton,
+ LightButton,
+ MainButton,
+} from 'twenty-ui/components';
import { Button, ButtonGroup } from 'twenty-ui/primitives/input';
+import { MenuItem, MenuItemDraggable } from 'twenty-ui/primitives/navigation';
import { IconPlus } from 'twenty-ui/icon';
import { ThemeProvider } from 'twenty-ui/theme-constants';
import 'twenty-ui/style.css';
@@ -36,6 +42,62 @@ const ButtonControls = () => {
<Button onClick={handleClick}>First action</Button>
<Button onClick={handleClick}>Second action</Button>
</ButtonGroup>
+ <ButtonGroup framed attached={false} aria-label="Icon actions">
+ <LightIconButton size="xs" aria-label="Add item" onClick={handleClick}>
+ <IconPlus />
+ </LightIconButton>
+ <span>
+ <LightIconButton
+ size="xs"
+ aria-label="Unavailable item"
+ disabled
+ onClick={handleClick}
+ >
+ <IconPlus />
+ </LightIconButton>
+ </span>
+ </ButtonGroup>
+ <IconButton
+ aria-label="Send"
+ shape="round"
+ size="xs"
+ variant="solid"
+ color="accent"
+ >
+ <IconPlus />
+ </IconButton>
+ <MenuItem
+ text="Record"
+ isIconDisplayedOnHoverOnly={false}
+ iconButtons={
+ <ButtonGroup attached={false}>
+ <LightIconButton aria-label="Add to record" onClick={handleClick}>
+ <IconPlus />
+ </LightIconButton>
+ <span>
+ <LightIconButton
+ aria-label="Unavailable record button"
+ disabled
+ onClick={handleClick}
+ >
+ <IconPlus />
+ </LightIconButton>
+ </span>
+ </ButtonGroup>
+ }
+ />
+ <MenuItemDraggable
+ text="Draggable record"
+ isIconDisplayedOnHoverOnly={false}
+ iconButtons={
+ <LightIconButton
+ aria-label="Add to draggable record"
+ onClick={handleClick}
+ >
+ <IconPlus />
+ </LightIconButton>
+ }
+ />
<output aria-label="Activations">{activations}</output>
</ThemeProvider>
);
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 e11e074643e..c5c5dbe9e13 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
@@ -2,6 +2,7 @@ import { defineFrontComponent } from 'twenty-sdk/define';
import {
IconButton,
LightButton,
+ LightIconButton,
MainButton,
TabButton,
} from 'twenty-ui/components';
@@ -19,12 +20,7 @@ import {
FloatingButtonGroup,
FloatingIconButton,
FloatingIconButtonGroup,
- IconButtonGroup,
IconListViewGrip,
- InsideButton,
- LightIconButton,
- LightIconButtonGroup,
- RoundedIconButton,
SearchInput,
SegmentedControl,
CardPicker,
@@ -145,35 +141,29 @@ const INPUT_ENTRIES: GalleryEntry[] = [
),
},
{
- name: 'IconButtonGroup',
+ name: 'ButtonGroup (framed)',
node: (
- <IconButtonGroup
- iconButtons={[{ Icon: IconTrash, ariaLabel: 'Delete' }]}
- />
+ <ButtonGroup framed attached={false} aria-label="Record actions">
+ <LightIconButton size="xs" aria-label="Delete" emphasis="subtle">
+ <IconTrash />
+ </LightIconButton>
+ </ButtonGroup>
),
},
{
name: 'IconListViewGrip',
node: <IconListViewGrip />,
},
- {
- name: 'InsideButton',
- node: <InsideButton Icon={IconPlus} ariaLabel="Add" />,
- },
{
name: 'LightButton',
node: <LightButton>{'Light'}</LightButton>,
},
{
name: 'LightIconButton',
- node: <LightIconButton Icon={IconStar} aria-label="Star" />,
- },
- {
- name: 'LightIconButtonGroup',
node: (
- <LightIconButtonGroup
- iconButtons={[{ Icon: IconStar, ariaLabel: 'Star', onClick: () => {} }]}
- />
+ <LightIconButton aria-label="Star">
+ <IconStar />
+ </LightIconButton>
),
},
{
@@ -197,10 +187,6 @@ const INPUT_ENTRIES: GalleryEntry[] = [
</RadioGroup>
),
},
- {
- name: 'RoundedIconButton',
- node: <RoundedIconButton Icon={IconPlus} aria-label="Add" />,
- },
{
name: 'SearchInput',
node: <SearchInput value="" onChange={() => {}} placeholder="Search" />,
diff --git a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/buttonControlsTest.ts b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/buttonControlsTest.ts
index 8bea36ae4e0..c7c9ada7bef 100644
--- a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/buttonControlsTest.ts
+++ b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/buttonControlsTest.ts
@@ -39,4 +39,38 @@ export const buttonControlsTest: TwentyUiGalleryPlayFunction = async (
await waitFor(() =>
expect(canvas.getByLabelText('Activations')).toHaveTextContent('4'),
);
+ const addItem = canvas.getByRole('button', { name: 'Add item' });
+ await userEvent.click(addItem);
+ await waitFor(() =>
+ expect(canvas.getByLabelText('Activations')).toHaveTextContent('5'),
+ );
+ const unavailableItem = canvas.getByRole('button', {
+ name: 'Unavailable item',
+ });
+ await expect(unavailableItem).toBeDisabled();
+ await userEvent.click(unavailableItem);
+ await waitFor(() =>
+ expect(canvas.getByLabelText('Activations')).toHaveTextContent('5'),
+ );
+ await expect(addItem.getBoundingClientRect().width).toBe(20);
+ await expect(
+ unavailableItem.getBoundingClientRect().left -
+ addItem.getBoundingClientRect().right,
+ ).toBe(2);
+ const send = canvas.getByRole('button', { name: 'Send' });
+ await expect(send.getBoundingClientRect().width).toBe(20);
+ await expect(getComputedStyle(send).borderTopLeftRadius).toBe('50%');
+
+ await userEvent.click(canvas.getByRole('button', { name: 'Add to record' }));
+ await userEvent.click(
+ canvas.getByRole('button', { name: 'Add to draggable record' }),
+ );
+ const unavailableRecordButton = canvas.getByRole('button', {
+ name: 'Unavailable record button',
+ });
+ await expect(unavailableRecordButton).toBeDisabled();
+ await userEvent.click(unavailableRecordButton);
+ await waitFor(() =>
+ expect(canvas.getByLabelText('Activations')).toHaveTextContent('7'),
+ );
};
diff --git a/packages/twenty-front/src/modules/activities/files/components/AttachmentDropdown.tsx b/packages/twenty-front/src/modules/activities/files/components/AttachmentDropdown.tsx
index ed905f8976f..72848743ef5 100644
--- a/packages/twenty-front/src/modules/activities/files/components/AttachmentDropdown.tsx
+++ b/packages/twenty-front/src/modules/activities/files/components/AttachmentDropdown.tsx
@@ -10,7 +10,7 @@ import {
IconPencil,
IconTrash,
} from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { MenuItem } from 'twenty-ui/primitives/navigation';
type AttachmentDropdownProps = {
@@ -52,11 +52,9 @@ export const AttachmentDropdown = ({
<Dropdown
dropdownId={dropdownId}
clickableComponent={
- <LightIconButton
- Icon={IconDotsVertical}
- accent="tertiary"
- aria-label={t`More options`}
- />
+ <LightIconButton emphasis="subtle" aria-label={t`More options`}>
+ <IconDotsVertical />
+ </LightIconButton>
}
dropdownComponents={
<DropdownContent widthInPixels={GenericDropdownContentWidth.Narrow}>
diff --git a/packages/twenty-front/src/modules/advanced-text-editor/components/AdvancedTextEditorInsertRail.tsx b/packages/twenty-front/src/modules/advanced-text-editor/components/AdvancedTextEditorInsertRail.tsx
index a2e2cd26843..aed6e766b3e 100644
--- a/packages/twenty-front/src/modules/advanced-text-editor/components/AdvancedTextEditorInsertRail.tsx
+++ b/packages/twenty-front/src/modules/advanced-text-editor/components/AdvancedTextEditorInsertRail.tsx
@@ -15,7 +15,8 @@ import {
IconTypography,
IconVariable,
} from 'twenty-ui/icon';
-import { Button, LightIconButton } from 'twenty-ui/primitives/input';
+import { Button } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { MenuItem } from 'twenty-ui/primitives/navigation';
import { themeCssVariables } from 'twenty-ui/theme-constants';
@@ -221,16 +222,17 @@ export const AdvancedTextEditorInsertRail = ({
/>
<StyledRail>
<LightIconButton
- Icon={IconTypography}
- size="medium"
- accent={openMenu === 'text' ? 'secondary' : 'tertiary'}
+ size="md"
+ emphasis={openMenu === 'text' ? 'standard' : 'subtle'}
title={t`Text`}
onClick={() => setOpenMenu(openMenu === 'text' ? null : 'text')}
- />
+ aria-label={t`Text`}
+ >
+ <IconTypography />
+ </LightIconButton>
<LightIconButton
- Icon={IconPhoto}
- size="medium"
- accent={openMenu === 'image' ? 'secondary' : 'tertiary'}
+ size="md"
+ emphasis={openMenu === 'image' ? 'standard' : 'subtle'}
title={isUploadingImage ? t`Uploading...` : t`Image`}
disabled={isUploadingImage}
onClick={() => {
@@ -241,24 +243,31 @@ export const AdvancedTextEditorInsertRail = ({
setOpenMenu(openMenu === 'image' ? null : 'image');
}}
- />
+ aria-label={isUploadingImage ? t`Uploading...` : t`Image`}
+ >
+ <IconPhoto />
+ </LightIconButton>
<LightIconButton
- Icon={IconLayoutGrid}
- size="medium"
- accent={openMenu === 'blocks' ? 'secondary' : 'tertiary'}
+ size="md"
+ emphasis={openMenu === 'blocks' ? 'standard' : 'subtle'}
title={t`Blocks`}
onClick={() => setOpenMenu(openMenu === 'blocks' ? null : 'blocks')}
- />
+ aria-label={t`Blocks`}
+ >
+ <IconLayoutGrid />
+ </LightIconButton>
{hasVariables && (
<LightIconButton
- Icon={IconVariable}
- size="medium"
- accent={openMenu === 'variables' ? 'secondary' : 'tertiary'}
+ size="md"
+ emphasis={openMenu === 'variables' ? 'standard' : 'subtle'}
title={t`Variables`}
onClick={() =>
setOpenMenu(openMenu === 'variables' ? null : 'variables')
}
- />
+ aria-label={t`Variables`}
+ >
+ <IconVariable />
+ </LightIconButton>
)}
</StyledRail>
{openMenu === 'variables' && (
diff --git a/packages/twenty-front/src/modules/advanced-text-editor/components/BubbleMenuIconButton.tsx b/packages/twenty-front/src/modules/advanced-text-editor/components/BubbleMenuIconButton.tsx
index 73bab80c77e..9ef9614a7a1 100644
--- a/packages/twenty-front/src/modules/advanced-text-editor/components/BubbleMenuIconButton.tsx
+++ b/packages/twenty-front/src/modules/advanced-text-editor/components/BubbleMenuIconButton.tsx
@@ -1,8 +1,10 @@
import React from 'react';
+import { isDefined } from 'twenty-shared/utils';
import type { IconComponent } from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
type BubbleMenuIconButtonProps = {
+ label: string;
className?: string;
Icon?: IconComponent;
disabled?: boolean;
@@ -11,6 +13,7 @@ type BubbleMenuIconButtonProps = {
};
export const BubbleMenuIconButton = ({
+ label,
className,
Icon,
disabled = false,
@@ -20,11 +23,14 @@ export const BubbleMenuIconButton = ({
return (
<LightIconButton
className={className}
- Icon={Icon}
disabled={disabled}
+ aria-pressed={isActive}
onClick={onClick}
- accent={isActive === true ? 'secondary' : 'tertiary'}
- size="small"
- />
+ emphasis={isActive === true ? 'standard' : 'subtle'}
+ size="sm"
+ aria-label={label}
+ >
+ {isDefined(Icon) && <Icon />}
+ </LightIconButton>
);
};
diff --git a/packages/twenty-front/src/modules/advanced-text-editor/components/EditLinkPopover.tsx b/packages/twenty-front/src/modules/advanced-text-editor/components/EditLinkPopover.tsx
index 65cc3e7b10e..1a516d31899 100644
--- a/packages/twenty-front/src/modules/advanced-text-editor/components/EditLinkPopover.tsx
+++ b/packages/twenty-front/src/modules/advanced-text-editor/components/EditLinkPopover.tsx
@@ -71,6 +71,7 @@ export const EditLinkPopover = ({
isDropdownInModal={true}
clickableComponent={
<BubbleMenuIconButton
+ label={isActive ? t`Edit link` : t`Add link`}
isActive={isActive}
Icon={isActive ? IconPencil : IconLink}
/>
diff --git a/packages/twenty-front/src/modules/advanced-text-editor/components/FormAdvancedTextFieldInput.tsx b/packages/twenty-front/src/modules/advanced-text-editor/components/FormAdvancedTextFieldInput.tsx
index 604843a9a1b..dd60da47103 100644
--- a/packages/twenty-front/src/modules/advanced-text-editor/components/FormAdvancedTextFieldInput.tsx
+++ b/packages/twenty-front/src/modules/advanced-text-editor/components/FormAdvancedTextFieldInput.tsx
@@ -17,7 +17,8 @@ import { type Editor } from '@tiptap/core';
import { type ComponentType, useEffect, useId, useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { IconMaximize } from 'twenty-ui/icon';
-import { Field, LightIconButton } from 'twenty-ui/primitives/input';
+import { Field } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { themeCssVariables } from 'twenty-ui/theme-constants';
import { useIsMobile } from 'twenty-ui/utilities';
@@ -250,11 +251,13 @@ export const FormAdvancedTextFieldInput = ({
>
{!readonly && !isFullScreen && (
<LightIconButton
- Icon={IconMaximize}
- size="small"
+ size="sm"
onClick={handleEnterFullScreen}
- accent="tertiary"
- />
+ emphasis="subtle"
+ aria-label={t`Expand to full screen`}
+ >
+ <IconMaximize />
+ </LightIconButton>
)}
</StyledEditorActionButtonContainer>
)}
diff --git a/packages/twenty-front/src/modules/advanced-text-editor/components/ImageBubbleMenu.tsx b/packages/twenty-front/src/modules/advanced-text-editor/components/ImageBubbleMenu.tsx
index 745a9000d16..87243b2e8ae 100644
--- a/packages/twenty-front/src/modules/advanced-text-editor/components/ImageBubbleMenu.tsx
+++ b/packages/twenty-front/src/modules/advanced-text-editor/components/ImageBubbleMenu.tsx
@@ -1,3 +1,4 @@
+import { t } from '@lingui/core/macro';
import { BubbleMenuIconButton } from '@/advanced-text-editor/components/BubbleMenuIconButton';
import { StyledBubbleMenuContainer } from '@/advanced-text-editor/components/StyledBubbleMenuContainer';
import { useLiveEditorState } from '@/advanced-text-editor/hooks/useLiveEditorState';
@@ -29,6 +30,7 @@ export const ImageBubbleMenu = ({ editor }: ImageBubbleMenuProps) => {
{
align: 'left',
Icon: IconAlignLeft,
+ label: t`Align image left`,
onClick: () =>
editor
.chain()
@@ -40,6 +42,7 @@ export const ImageBubbleMenu = ({ editor }: ImageBubbleMenuProps) => {
{
align: 'center',
Icon: IconAlignCenter,
+ label: t`Align image center`,
onClick: () =>
editor
.chain()
@@ -51,6 +54,7 @@ export const ImageBubbleMenu = ({ editor }: ImageBubbleMenuProps) => {
{
align: 'right',
Icon: IconAlignRight,
+ label: t`Align image right`,
onClick: () =>
editor
.chain()
@@ -73,9 +77,10 @@ export const ImageBubbleMenu = ({ editor }: ImageBubbleMenuProps) => {
updateDelay={0}
>
<StyledBubbleMenuContainer>
- {alignmentActions.map(({ align, Icon, onClick, isActive }) => (
+ {alignmentActions.map(({ label, align, Icon, onClick, isActive }) => (
<BubbleMenuIconButton
key={`image-align-${align}`}
+ label={label}
Icon={Icon}
onClick={onClick}
isActive={isActive}
@@ -83,6 +88,7 @@ export const ImageBubbleMenu = ({ editor }: ImageBubbleMenuProps) => {
))}
<BubbleMenuIconButton
key="image-delete"
+ label={t`Delete image`}
Icon={IconTrash}
onClick={handleDelete}
isActive={false}
diff --git a/packages/twenty-front/src/modules/advanced-text-editor/components/LinkBubbleMenu.tsx b/packages/twenty-front/src/modules/advanced-text-editor/components/LinkBubbleMenu.tsx
index 6f7e36bd775..52ea12738eb 100644
--- a/packages/twenty-front/src/modules/advanced-text-editor/components/LinkBubbleMenu.tsx
+++ b/packages/twenty-front/src/modules/advanced-text-editor/components/LinkBubbleMenu.tsx
@@ -1,3 +1,4 @@
+import { t } from '@lingui/core/macro';
import { BubbleMenuIconButton } from '@/advanced-text-editor/components/BubbleMenuIconButton';
import { EditLinkPopover } from '@/advanced-text-editor/components/EditLinkPopover';
import { StyledBubbleMenuContainer } from '@/advanced-text-editor/components/StyledBubbleMenuContainer';
@@ -25,6 +26,7 @@ export const LinkBubbleMenu = ({ editor }: LinkBubbleMenuProps) => {
const menuActions = [
{
Icon: IconExternalLink,
+ label: t`Open link`,
onClick: () => {
const safeHref = getSafeUrl(state.linkHref);
@@ -35,6 +37,7 @@ export const LinkBubbleMenu = ({ editor }: LinkBubbleMenuProps) => {
},
{
Icon: IconLinkOff,
+ label: t`Remove link`,
onClick: () =>
editor.chain().focus().extendMarkRange('link').unsetLink().run(),
},
@@ -49,10 +52,11 @@ export const LinkBubbleMenu = ({ editor }: LinkBubbleMenuProps) => {
>
<StyledBubbleMenuContainer>
<EditLinkPopover defaultValue={state.linkHref} editor={editor} />
- {menuActions.map(({ Icon, onClick }) => {
+ {menuActions.map(({ label, Icon, onClick }) => {
return (
<BubbleMenuIconButton
key={Icon.name || Icon.displayName || 'unknown'}
+ label={label}
Icon={Icon}
onClick={onClick}
/>
diff --git a/packages/twenty-front/src/modules/advanced-text-editor/components/TextBubbleMenu.tsx b/packages/twenty-front/src/modules/advanced-text-editor/components/TextBubbleMenu.tsx
index 0c927668e88..a82478c8b7d 100644
--- a/packages/twenty-front/src/modules/advanced-text-editor/components/TextBubbleMenu.tsx
+++ b/packages/twenty-front/src/modules/advanced-text-editor/components/TextBubbleMenu.tsx
@@ -1,3 +1,4 @@
+import { t } from '@lingui/core/macro';
import { StyledBubbleMenuContainer } from '@/advanced-text-editor/components/StyledBubbleMenuContainer';
import { BubbleMenuIconButton } from '@/advanced-text-editor/components/BubbleMenuIconButton';
import { EditLinkPopover } from '@/advanced-text-editor/components/EditLinkPopover';
@@ -26,36 +27,42 @@ export const TextBubbleMenu = ({ editor }: TextBubbleMenuProps) => {
const menuActions = [
{
Icon: IconBold,
+ label: t`Bold`,
extensionName: 'bold',
onClick: () => editor.chain().focus().toggleBold().run(),
isActive: state.isBold,
},
{
Icon: IconItalic,
+ label: t`Italic`,
extensionName: 'italic',
onClick: () => editor.chain().focus().toggleItalic().run(),
isActive: state.isItalic,
},
{
Icon: IconUnderline,
+ label: t`Underline`,
extensionName: 'underline',
onClick: () => editor.chain().focus().toggleUnderline().run(),
isActive: state.isUnderline,
},
{
Icon: IconStrikethrough,
+ label: t`Strikethrough`,
extensionName: 'strike',
onClick: () => editor.chain().focus().toggleStrike().run(),
isActive: state.isStrike,
},
{
Icon: IconList,
+ label: t`Bullet list`,
extensionName: 'bulletList',
onClick: () => editor.chain().focus().wrapInList('bulletList').run(),
isActive: state.isBulletList,
},
{
Icon: IconListNumbers,
+ label: t`Numbered list`,
extensionName: 'orderedList',
onClick: () => editor.chain().focus().wrapInList('orderedList').run(),
isActive: state.isOrderedList,
@@ -86,10 +93,11 @@ export const TextBubbleMenu = ({ editor }: TextBubbleMenuProps) => {
{hasEditorExtension(editor, 'heading') && (
<TurnIntoBlockDropdown editor={editor} />
)}
- {menuActions.map(({ Icon, onClick, isActive }) => {
+ {menuActions.map(({ label, Icon, onClick, isActive }) => {
return (
<BubbleMenuIconButton
key={Icon.name || Icon.displayName || 'unknown'}
+ label={label}
Icon={Icon}
onClick={onClick}
isActive={isActive}
diff --git a/packages/twenty-front/src/modules/ai/components/AiChatQuestionCard.tsx b/packages/twenty-front/src/modules/ai/components/AiChatQuestionCard.tsx
index 1b2ba2953c0..8f577ada6d1 100644
--- a/packages/twenty-front/src/modules/ai/components/AiChatQuestionCard.tsx
+++ b/packages/twenty-front/src/modules/ai/components/AiChatQuestionCard.tsx
@@ -20,7 +20,8 @@ import {
IconSquareNumber8,
IconSquareNumber9,
} from 'twenty-ui/icon';
-import { LightIconButton, RoundedIconButton } from 'twenty-ui/primitives/input';
+import { IconButton, LightIconButton } from 'twenty-ui/components';
+
import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants';
import { AgentChatFileUploadButton } from '@/ai/components/internal/AgentChatFileUploadButton';
@@ -385,26 +386,30 @@ export const AiChatQuestionCard = ({
{hasMultipleQuestions && (
<StyledPager>
<LightIconButton
- Icon={IconChevronLeft}
- size="small"
+ size="sm"
disabled={currentIndex === 0}
onClick={() =>
setCurrentIndex((index) => Math.max(0, index - 1))
}
- />
+ aria-label={t`Previous`}
+ >
+ <IconChevronLeft />
+ </LightIconButton>
<StyledPagerLabel>
{currentIndex + 1}/{questions.length}
</StyledPagerLabel>
<LightIconButton
- Icon={IconChevronRightPipe}
- size="small"
+ size="sm"
disabled={isLastQuestion}
onClick={() =>
setCurrentIndex((index) =>
Math.min(questions.length - 1, index + 1),
)
}
- />
+ aria-label={t`Next question`}
+ >
+ <IconChevronRightPipe />
+ </LightIconButton>
</StyledPager>
)}
</StyledQuestionHeaderRow>
@@ -465,10 +470,12 @@ export const AiChatQuestionCard = ({
onClick={(event) => event.stopPropagation()}
>
<LightIconButton
- Icon={IconInfoCircle}
- size="small"
- accent="tertiary"
- />
+ size="sm"
+ emphasis="subtle"
+ aria-label={t`Information`}
+ >
+ <IconInfoCircle />
+ </LightIconButton>
</span>
</Tooltip>
)}
@@ -502,12 +509,17 @@ export const AiChatQuestionCard = ({
dropdownId="ai-chat-question-model-tier-dropdown"
disabled={hasNoEnabledModels}
/>
- <RoundedIconButton
- Icon={IconArrowUp}
- size="medium"
+ <IconButton
+ variant="solid"
+ color="accent"
+ shape="round"
+ aria-label={t`Send message`}
+ size="sm"
onClick={handleSend}
disabled={!allQuestionsAnswered || isSubmitting}
- />
+ >
+ <IconArrowUp />
+ </IconButton>
</StyledRightActions>
</StyledActionsRow>
</StyledComposerSection>
diff --git a/packages/twenty-front/src/modules/ai/components/AiChatQueuedMessages.tsx b/packages/twenty-front/src/modules/ai/components/AiChatQueuedMessages.tsx
index a9e82308ba2..a0204d5b389 100644
--- a/packages/twenty-front/src/modules/ai/components/AiChatQueuedMessages.tsx
+++ b/packages/twenty-front/src/modules/ai/components/AiChatQueuedMessages.tsx
@@ -1,3 +1,4 @@
+import { t } from '@lingui/core/macro';
import { StyledAiChatContentContainer } from '@/ai/components/StyledAiChatContentContainer';
import { styled } from '@linaria/react';
@@ -8,7 +9,7 @@ import { useAtomComponentFamilyStateValue } from '@/ui/utilities/state/jotai/hoo
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { isDefined } from 'twenty-shared/utils';
import { IconX } from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { themeCssVariables } from 'twenty-ui/theme-constants';
const StyledQueueContainer = styled(StyledAiChatContentContainer)`
@@ -67,10 +68,12 @@ export const AiChatQueuedMessages = () => {
<StyledQueuedItem key={message.id}>
<StyledQueuedText>{displayText}</StyledQueuedText>
<LightIconButton
- Icon={IconX}
onClick={() => deleteQueuedMessage(message.id)}
- size="small"
- />
+ size="sm"
+ aria-label={t`Remove queued message`}
+ >
+ <IconX />
+ </LightIconButton>
</StyledQueuedItem>
);
})}
diff --git a/packages/twenty-front/src/modules/ai/components/AiChatThreadFilterDropdown.tsx b/packages/twenty-front/src/modules/ai/components/AiChatThreadFilterDropdown.tsx
index 505ffc222e8..86260f0c7a6 100644
--- a/packages/twenty-front/src/modules/ai/components/AiChatThreadFilterDropdown.tsx
+++ b/packages/twenty-front/src/modules/ai/components/AiChatThreadFilterDropdown.tsx
@@ -1,7 +1,7 @@
import { useLingui } from '@lingui/react/macro';
import { useState } from 'react';
import { IconFilter } from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { AiChatThreadFilterDropdownContent } from '@/ai/components/AiChatThreadFilterDropdownContent';
import { AI_CHAT_THREAD_FILTER_DROPDOWN_PAGE } from '@/ai/constants/AiChatThreadFilterDropdownPage';
@@ -33,10 +33,11 @@ export const AiChatThreadFilterDropdown = ({
clickableComponent={
<LightIconButton
aria-label={t`Filter chats`}
- Icon={IconFilter}
- accent="tertiary"
- size="small"
- />
+ emphasis="subtle"
+ size="sm"
+ >
+ <IconFilter />
+ </LightIconButton>
}
dropdownComponents={
<AiChatThreadFilterDropdownContent
diff --git a/packages/twenty-front/src/modules/ai/components/AiChatThreadItemMenu.tsx b/packages/twenty-front/src/modules/ai/components/AiChatThreadItemMenu.tsx
index 53eed033f03..58618bc90d4 100644
--- a/packages/twenty-front/src/modules/ai/components/AiChatThreadItemMenu.tsx
+++ b/packages/twenty-front/src/modules/ai/components/AiChatThreadItemMenu.tsx
@@ -7,7 +7,7 @@ import {
IconPencil,
IconTrash,
} from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { MenuItem } from 'twenty-ui/primitives/navigation';
import { type AiChatThreadActionsSurface } from '@/ai/types/AiChatThreadActionsSurface';
@@ -79,11 +79,9 @@ export const AiChatThreadItemMenu = ({
dropdownPlacement="bottom-end"
clickableComponent={
clickableComponent ?? (
- <LightIconButton
- aria-label={t`Chat actions`}
- Icon={IconDotsVertical}
- accent="tertiary"
- />
+ <LightIconButton aria-label={t`Chat actions`} emphasis="subtle">
+ <IconDotsVertical />
+ </LightIconButton>
)
}
dropdownComponents={
diff --git a/packages/twenty-front/src/modules/ai/components/CodeExecutionDisplay.tsx b/packages/twenty-front/src/modules/ai/components/CodeExecutionDisplay.tsx
index 727b5dd8d56..954807e8825 100644
--- a/packages/twenty-front/src/modules/ai/components/CodeExecutionDisplay.tsx
+++ b/packages/twenty-front/src/modules/ai/components/CodeExecutionDisplay.tsx
@@ -11,8 +11,8 @@ import {
IconDownload,
IconFile,
} from 'twenty-ui/icon';
+import { LightIconButton } from 'twenty-ui/components';
import { CodeEditor } from 'twenty-ui/components/code-editor';
-import { LightIconButton } from 'twenty-ui/primitives/input';
import { AnimatedExpandableContainer } from 'twenty-ui/primitives/layout';
import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants';
import { useCopyToClipboard } from '~/hooks/useCopyToClipboard';
@@ -230,15 +230,17 @@ export const CodeExecutionDisplay = ({
</StyledSectionHeaderLeft>
<StyledHeaderRight>
<LightIconButton
- Icon={IconCopy}
onClick={(e) => {
e.stopPropagation();
copyToClipboard(code);
}}
title={t`Copy code`}
- size="small"
- accent="tertiary"
- />
+ size="sm"
+ emphasis="subtle"
+ aria-label={t`Copy code`}
+ >
+ <IconCopy />
+ </LightIconButton>
{isCodeExpanded ? (
<IconChevronUp size={theme.icon.size.sm} />
) : (
diff --git a/packages/twenty-front/src/modules/ai/components/MarkdownCodeBlock.tsx b/packages/twenty-front/src/modules/ai/components/MarkdownCodeBlock.tsx
index 3b45a93ab78..a17a52b7307 100644
--- a/packages/twenty-front/src/modules/ai/components/MarkdownCodeBlock.tsx
+++ b/packages/twenty-front/src/modules/ai/components/MarkdownCodeBlock.tsx
@@ -3,7 +3,7 @@ import { useLingui } from '@lingui/react/macro';
import { isNumber, isString } from '@sniptt/guards';
import { Children, isValidElement } from 'react';
import { IconCopy } from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { themeCssVariables } from 'twenty-ui/theme-constants';
import { useCopyToClipboard } from '~/hooks/useCopyToClipboard';
@@ -67,12 +67,14 @@ export const MarkdownCodeBlock = ({
<StyledContainer className="markdown-code-outer-container">
<StyledCopyButtonContainer>
<LightIconButton
- Icon={IconCopy}
onClick={() => copyToClipboard(codeText, t`Code copied to clipboard`)}
title={t`Copy code`}
- size="small"
- accent="tertiary"
- />
+ size="sm"
+ emphasis="subtle"
+ aria-label={t`Copy code`}
+ >
+ <IconCopy />
+ </LightIconButton>
</StyledCopyButtonContainer>
<pre className="markdown-block-code">{children}</pre>
</StyledContainer>
diff --git a/packages/twenty-front/src/modules/ai/components/TerminalOutput.tsx b/packages/twenty-front/src/modules/ai/components/TerminalOutput.tsx
index 3ca1d3128c9..8cb682f73d5 100644
--- a/packages/twenty-front/src/modules/ai/components/TerminalOutput.tsx
+++ b/packages/twenty-front/src/modules/ai/components/TerminalOutput.tsx
@@ -3,7 +3,7 @@ import { styled } from '@linaria/react';
import { useLingui } from '@lingui/react/macro';
import { useState } from 'react';
import { IconCopy, IconTerminal } from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { themeCssVariables } from 'twenty-ui/theme-constants';
import { useCopyToClipboard } from '~/hooks/useCopyToClipboard';
@@ -156,12 +156,14 @@ export const TerminalOutput = ({
</StyledTab>
)}
<LightIconButton
- Icon={IconCopy}
onClick={() => copyToClipboard(currentOutput)}
title={t`Copy output`}
- size="small"
- accent="tertiary"
- />
+ size="sm"
+ emphasis="subtle"
+ aria-label={t`Copy output`}
+ >
+ <IconCopy />
+ </LightIconButton>
</StyledTabContainer>
</StyledHeader>
<StyledOutputArea isError={activeTab === 'stderr'}>
diff --git a/packages/twenty-front/src/modules/ai/components/internal/SendMessageButton.tsx b/packages/twenty-front/src/modules/ai/components/internal/SendMessageButton.tsx
index 3e48b8d0d30..1764775125e 100644
--- a/packages/twenty-front/src/modules/ai/components/internal/SendMessageButton.tsx
+++ b/packages/twenty-front/src/modules/ai/components/internal/SendMessageButton.tsx
@@ -1,3 +1,4 @@
+import { t } from '@lingui/core/macro';
import { AGENT_CHAT_STOP_EVENT_NAME } from '@/ai/constants/AgentChatStopEventName';
import { agentChatInputIsEmptySelector } from '@/ai/states/selectors/agentChatInputIsEmptySelector';
import { agentChatIsAwaitingFirstChunkComponentFamilyState } from '@/ai/states/agentChatIsAwaitingFirstChunkComponentFamilyState';
@@ -8,7 +9,7 @@ import { dispatchBrowserEvent } from '@/browser-event/utils/dispatchBrowserEvent
import { useAtomComponentFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentFamilyStateValue';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { IconArrowUp, IconPlayerStop } from 'twenty-ui/icon';
-import { RoundedIconButton } from 'twenty-ui/primitives/input';
+import { IconButton } from 'twenty-ui/components';
type SendMessageButtonProps = {
onSend: () => void;
@@ -41,20 +42,30 @@ export const SendMessageButton = ({
if (agentChatIsStreaming || agentChatIsAwaitingFirstChunk) {
return (
- <RoundedIconButton
- Icon={IconPlayerStop}
- size="medium"
+ <IconButton
+ variant="solid"
+ color="accent"
+ shape="round"
+ aria-label={t`Stop response`}
+ size="sm"
onClick={handleStopClick}
- />
+ >
+ <IconPlayerStop />
+ </IconButton>
);
}
return (
- <RoundedIconButton
- Icon={IconArrowUp}
- size="medium"
+ <IconButton
+ variant="solid"
+ color="accent"
+ shape="round"
+ aria-label={t`Send message`}
+ size="sm"
onClick={onSend}
disabled={isDisabled || agentChatInputIsEmpty || agentChatIsLoading}
- />
+ >
+ <IconArrowUp />
+ </IconButton>
);
};
diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpWorkspaceCreationForm.tsx b/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpWorkspaceCreationForm.tsx
index 99b5e4b414f..3508aba7547 100644
--- a/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpWorkspaceCreationForm.tsx
+++ b/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpWorkspaceCreationForm.tsx
@@ -15,10 +15,11 @@ import { isNonEmptyString } from '@sniptt/guards';
import { useEffect, useRef, useState } from 'react';
import { Key } from 'ts-key-enum';
import { isDefined } from 'twenty-shared/utils';
-import { MainButton } from 'twenty-ui/components';
+import { MainButton, LightIconButton } from 'twenty-ui/components';
import { Avatar } from 'twenty-ui/primitives/data-display';
import { IconTrash, IconUpload } from 'twenty-ui/icon';
-import { Button, LightIconButton } from 'twenty-ui/primitives/input';
+import { Button } from 'twenty-ui/primitives/input';
+
import { themeCssVariables } from 'twenty-ui/theme-constants';
const StyledContentContainer = styled.div`
@@ -277,13 +278,14 @@ export const SignInUpWorkspaceCreationForm = () => {
variant="outline"
>{t`Upload logo`}</Button>
<LightIconButton
- Icon={IconTrash}
- accent="tertiary"
- size="medium"
+ emphasis="subtle"
+ size="md"
onClick={handleLogoRemove}
disabled={!isDefined(logoPreviewUrl)}
aria-label={t`Remove logo`}
- />
+ >
+ <IconTrash />
+ </LightIconButton>
</StyledLogoButtons>
</StyledLogoRow>
</OnboardingStepAnimatedItem>
diff --git a/packages/twenty-front/src/modules/command-menu-item/edit/components/SidePanelCommandMenuItemEditPage.tsx b/packages/twenty-front/src/modules/command-menu-item/edit/components/SidePanelCommandMenuItemEditPage.tsx
index ef5d9ae69c8..72bae0d0a69 100644
--- a/packages/twenty-front/src/modules/command-menu-item/edit/components/SidePanelCommandMenuItemEditPage.tsx
+++ b/packages/twenty-front/src/modules/command-menu-item/edit/components/SidePanelCommandMenuItemEditPage.tsx
@@ -28,6 +28,8 @@ import {
useIcons,
} from 'twenty-ui/icon';
import { MenuItem, MenuItemDraggable } from 'twenty-ui/primitives/navigation';
+import { LightIconButton } from 'twenty-ui/components';
+import { ButtonGroup } from 'twenty-ui/primitives/input';
import { themeCssVariables } from 'twenty-ui/theme-constants';
import { type CommandMenuItemFieldsFragment } from '~/generated-metadata/graphql';
import { normalizeSearchText } from '~/utils/normalizeSearchText';
@@ -133,17 +135,6 @@ export const SidePanelCommandMenuItemEditPage = () => {
});
};
- const makeOptionsDropdownWrapper =
- (item: Pick<CommandMenuItemFieldsFragment, 'id' | 'shortLabel'>) =>
- ({ iconButton }: { iconButton: React.ReactElement }) => (
- <CommandMenuItemOptionsDropdown
- itemId={item.id}
- shortLabel={item.shortLabel}
- serverShortLabel={serverItemsById.get(item.id)?.shortLabel ?? null}
- iconButton={iconButton}
- />
- );
-
const handlePinnedDragEnd = (result: DraggableListDropResult) => {
const { source, destination, draggableId } = result;
@@ -236,20 +227,35 @@ export const SidePanelCommandMenuItemEditPage = () => {
text={getDisplayLabel(item)}
gripMode="onHover"
isIconDisplayedOnHoverOnly={false}
- iconButtons={[
- {
- Icon: IconDotsVertical,
- Wrapper: makeOptionsDropdownWrapper(item),
- onClick: () => {},
- },
- {
- Icon: IconPinnedOff,
- onClick: (event) => {
- event.stopPropagation();
- handleTogglePin(item.id, true);
- },
- },
- ]}
+ iconButtons={
+ <ButtonGroup
+ attached={false}
+ aria-label={t`Menu item actions`}
+ >
+ <CommandMenuItemOptionsDropdown
+ itemId={item.id}
+ shortLabel={item.shortLabel}
+ serverShortLabel={
+ serverItemsById.get(item.id)?.shortLabel ??
+ null
+ }
+ iconButton={
+ <LightIconButton aria-label={t`More options`}>
+ <IconDotsVertical />
+ </LightIconButton>
+ }
+ />
+ <LightIconButton
+ aria-label={t`Unpin`}
+ onClick={(event) => {
+ event.stopPropagation();
+ handleTogglePin(item.id, true);
+ }}
+ >
+ <IconPinnedOff />
+ </LightIconButton>
+ </ButtonGroup>
+ }
/>
</SelectableListItem>
}
@@ -276,15 +282,17 @@ export const SidePanelCommandMenuItemEditPage = () => {
LeftIcon={ItemIcon}
text={getDisplayLabel(item)}
isIconDisplayedOnHoverOnly={false}
- iconButtons={[
- {
- Icon: IconPin,
- onClick: (event) => {
+ iconButtons={
+ <LightIconButton
+ aria-label={t`Pin`}
+ onClick={(event) => {
event.stopPropagation();
handleTogglePin(item.id, false);
- },
- },
- ]}
+ }}
+ >
+ <IconPin />
+ </LightIconButton>
+ }
/>
</SelectableListItem>
);
diff --git a/packages/twenty-front/src/modules/layout-customization/components/LayoutCustomizationBarMenuDropdown.tsx b/packages/twenty-front/src/modules/layout-customization/components/LayoutCustomizationBarMenuDropdown.tsx
index 81ff6d70cc5..b0b6bfdfbcf 100644
--- a/packages/twenty-front/src/modules/layout-customization/components/LayoutCustomizationBarMenuDropdown.tsx
+++ b/packages/twenty-front/src/modules/layout-customization/components/LayoutCustomizationBarMenuDropdown.tsx
@@ -1,7 +1,7 @@
import { styled } from '@linaria/react';
import { useLingui } from '@lingui/react/macro';
import { IconDotsVertical, IconReload } from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { MenuItem } from 'twenty-ui/primitives/navigation';
import { GRAY_SCALE_LIGHT } from 'twenty-ui/theme';
import { themeCssVariables } from 'twenty-ui/theme-constants';
@@ -45,10 +45,11 @@ export const LayoutCustomizationBarMenuDropdown = () => {
clickableComponent={
<StyledInvertedIconButtonWrapper>
<LightIconButton
- Icon={IconDotsVertical}
- accent="tertiary"
+ emphasis="subtle"
aria-label={t`Layout customization menu`}
- />
+ >
+ <IconDotsVertical />
+ </LightIconButton>
</StyledInvertedIconButtonWrapper>
}
dropdownComponents={
diff --git a/packages/twenty-front/src/modules/navigation-menu-item/display/folder/components/NavigationMenuItemFolderChevronButton.tsx b/packages/twenty-front/src/modules/navigation-menu-item/display/folder/components/NavigationMenuItemFolderChevronButton.tsx
index 320ba59b460..1e8398b0161 100644
--- a/packages/twenty-front/src/modules/navigation-menu-item/display/folder/components/NavigationMenuItemFolderChevronButton.tsx
+++ b/packages/twenty-front/src/modules/navigation-menu-item/display/folder/components/NavigationMenuItemFolderChevronButton.tsx
@@ -2,7 +2,7 @@ import { styled } from '@linaria/react';
import { useLingui } from '@lingui/react/macro';
import type React from 'react';
import { IconChevronRight } from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { themeCssVariables } from 'twenty-ui/theme-constants';
// Rotating a wrapper around the button keeps the icon component identity
@@ -38,12 +38,14 @@ export const NavigationMenuItemFolderChevronButton = ({
return (
<StyledButtonContainer isOpen={isOpen}>
<LightIconButton
- Icon={IconChevronRight}
- size="small"
- accent="tertiary"
+ size="sm"
+ emphasis="subtle"
aria-label={isOpen ? t`Collapse folder` : t`Expand folder`}
onClick={onClick}
- />
+ aria-expanded={isOpen}
+ >
+ <IconChevronRight />
+ </LightIconButton>
</StyledButtonContainer>
);
};
diff --git a/packages/twenty-front/src/modules/navigation-menu-item/display/folder/components/NavigationMenuItemFolderContent.tsx b/packages/twenty-front/src/modules/navigation-menu-item/display/folder/components/NavigationMenuItemFolderContent.tsx
index e853d8adb52..08871ff47d3 100644
--- a/packages/twenty-front/src/modules/navigation-menu-item/display/folder/components/NavigationMenuItemFolderContent.tsx
+++ b/packages/twenty-front/src/modules/navigation-menu-item/display/folder/components/NavigationMenuItemFolderContent.tsx
@@ -1,6 +1,7 @@
+import { t } from '@lingui/core/macro';
import { NavigationMenuItemType } from 'twenty-shared/types';
import { IconHeartOff } from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import {
FeatureFlagKey,
type NavigationMenuItem,
@@ -88,13 +89,15 @@ export const NavigationMenuItemFolderContent = ({
)}
rightOptions={
<LightIconButton
- Icon={IconHeartOff}
onClick={(e) => {
e.stopPropagation();
deleteManyNavigationMenuItems([navigationMenuItem.id]);
}}
- accent="tertiary"
- />
+ emphasis="subtle"
+ aria-label={t`Remove from favorites`}
+ >
+ <IconHeartOff />
+ </LightIconButton>
}
triggerEvent="CLICK"
to={computedLink}
diff --git a/packages/twenty-front/src/modules/navigation-menu-item/display/folder/components/NavigationMenuItemFolderDnd.tsx b/packages/twenty-front/src/modules/navigation-menu-item/display/folder/components/NavigationMenuItemFolderDnd.tsx
index 6f8ab9fe116..d85cc85171c 100644
--- a/packages/twenty-front/src/modules/navigation-menu-item/display/folder/components/NavigationMenuItemFolderDnd.tsx
+++ b/packages/twenty-front/src/modules/navigation-menu-item/display/folder/components/NavigationMenuItemFolderDnd.tsx
@@ -11,7 +11,7 @@ import React, { Fragment, useContext } from 'react';
import { createPortal } from 'react-dom';
import { isDefined } from 'twenty-shared/utils';
import { IconHeartOff, IconPlus, useIcons } from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { themeCssVariables } from 'twenty-ui/theme-constants';
import { useIsMobile } from 'twenty-ui/utilities';
import { type NavigationMenuItem } from '~/generated-metadata/graphql';
@@ -371,15 +371,17 @@ export const NavigationMenuItemFolderDnd = ({
rightOptions={
isEditInPlace ? (
<LightIconButton
- Icon={IconHeartOff}
onClick={(event) => {
event.stopPropagation();
deleteManyNavigationMenuItems([
navigationMenuItem.id,
]);
}}
- accent="tertiary"
- />
+ emphasis="subtle"
+ aria-label={t`Remove from favorites`}
+ >
+ <IconHeartOff />
+ </LightIconButton>
) : undefined
}
onNavigationMenuItemClick={
diff --git a/packages/twenty-front/src/modules/navigation-menu-item/display/folder/components/NavigationMenuItemFolderNavigationDrawerItemDropdown.tsx b/packages/twenty-front/src/modules/navigation-menu-item/display/folder/components/NavigationMenuItemFolderNavigationDrawerItemDropdown.tsx
index ee9f96ee0f3..bc3974c4351 100644
--- a/packages/twenty-front/src/modules/navigation-menu-item/display/folder/components/NavigationMenuItemFolderNavigationDrawerItemDropdown.tsx
+++ b/packages/twenty-front/src/modules/navigation-menu-item/display/folder/components/NavigationMenuItemFolderNavigationDrawerItemDropdown.tsx
@@ -5,7 +5,7 @@ import {
IconPlus,
IconTrash,
} from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { MenuItem } from 'twenty-ui/primitives/navigation';
import { NavigationMenuItemMenu } from '@/navigation-menu-item/edit/components/NavigationMenuItemMenu';
@@ -34,7 +34,9 @@ export const NavigationMenuItemFolderNavigationDrawerItemDropdown = ({
section="favorite"
dropdownId={dropdownId}
clickableComponent={
- <LightIconButton Icon={IconDotsVertical} accent="tertiary" />
+ <LightIconButton emphasis="subtle" aria-label={t`More options`}>
+ <IconDotsVertical />
+ </LightIconButton>
}
dropdownPlacement="bottom-start"
renderMenu={({ onClose, onAdd }) => (
diff --git a/packages/twenty-front/src/modules/navigation-menu-item/display/sections/favorites/components/FavoritesSection.tsx b/packages/twenty-front/src/modules/navigation-menu-item/display/sections/favorites/components/FavoritesSection.tsx
index 8e89750e9eb..b9cd4d994e1 100644
--- a/packages/twenty-front/src/modules/navigation-menu-item/display/sections/favorites/components/FavoritesSection.tsx
+++ b/packages/twenty-front/src/modules/navigation-menu-item/display/sections/favorites/components/FavoritesSection.tsx
@@ -3,7 +3,7 @@ import { styled } from '@linaria/react';
import { useLingui } from '@lingui/react/macro';
import { useCallback, useContext, useMemo } from 'react';
import { IconHeartOff, IconPlus } from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { themeCssVariables } from 'twenty-ui/theme-constants';
import { type NavigationMenuItem } from '~/generated-metadata/graphql';
@@ -85,15 +85,17 @@ export const FavoritesSection = () => {
const makeRightOptions = useCallback(
(item: NavigationMenuItem) => (
<LightIconButton
- Icon={IconHeartOff}
onClick={(event) => {
event.stopPropagation();
deleteManyNavigationMenuItems([item.id]);
}}
- accent="tertiary"
- />
+ emphasis="subtle"
+ aria-label={t`Remove from favorites`}
+ >
+ <IconHeartOff />
+ </LightIconButton>
),
- [deleteManyNavigationMenuItems],
+ [deleteManyNavigationMenuItems, t],
);
if (topLevelItems.length === 0) {
@@ -111,7 +113,9 @@ export const FavoritesSection = () => {
section="favorite"
onOpen={openNavigationSection}
>
- <LightIconButton Icon={IconPlus} accent="tertiary" />
+ <LightIconButton emphasis="subtle" aria-label={t`Add`}>
+ <IconPlus />
+ </LightIconButton>
</NavigationMenuItemAddDropdown>
}
>
diff --git a/packages/twenty-front/src/modules/navigation-menu-item/display/sections/workspace/components/WorkspaceSection.tsx b/packages/twenty-front/src/modules/navigation-menu-item/display/sections/workspace/components/WorkspaceSection.tsx
index 6faf5f76c54..54bee31265b 100644
--- a/packages/twenty-front/src/modules/navigation-menu-item/display/sections/workspace/components/WorkspaceSection.tsx
+++ b/packages/twenty-front/src/modules/navigation-menu-item/display/sections/workspace/components/WorkspaceSection.tsx
@@ -5,7 +5,7 @@ import { isNonEmptyString } from '@sniptt/guards';
import { useNavigate } from 'react-router-dom';
import { NavigationMenuItemType } from 'twenty-shared/types';
import { IconPlus, IconTool } from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { themeCssVariables } from 'twenty-ui/theme-constants';
import { useIsMobile } from 'twenty-ui/utilities';
@@ -116,20 +116,24 @@ export const WorkspaceSection = () => {
onOpen={openNavigationSection}
>
<LightIconButton
- Icon={IconPlus}
- accent="tertiary"
- size="small"
- />
+ emphasis="subtle"
+ size="sm"
+ aria-label={t`Add`}
+ >
+ <IconPlus />
+ </LightIconButton>
</NavigationMenuItemAddDropdown>
) : (
hasLayoutsPermission && (
<div onMouseEnter={preloadNavigationMenuItemDndKit}>
<LightIconButton
- Icon={IconTool}
- accent="tertiary"
- size="small"
+ emphasis="subtle"
+ size="sm"
onClick={handleEditClick}
- />
+ aria-label={t`Edit navigation`}
+ >
+ <IconTool />
+ </LightIconButton>
</div>
)
)}
diff --git a/packages/twenty-front/src/modules/navigation-menu-item/edit/components/NavigationMenuItemRowActions.tsx b/packages/twenty-front/src/modules/navigation-menu-item/edit/components/NavigationMenuItemRowActions.tsx
index 6ae4ccf517f..6aaeeac7fc5 100644
--- a/packages/twenty-front/src/modules/navigation-menu-item/edit/components/NavigationMenuItemRowActions.tsx
+++ b/packages/twenty-front/src/modules/navigation-menu-item/edit/components/NavigationMenuItemRowActions.tsx
@@ -2,7 +2,7 @@ import { styled } from '@linaria/react';
import { useLingui } from '@lingui/react/macro';
import { type ReactNode } from 'react';
import { IconDotsVertical } from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { themeCssVariables } from 'twenty-ui/theme-constants';
const StyledActions = styled.div`
@@ -33,15 +33,16 @@ export const NavigationMenuItemRowActions = ({
>
{rightOptions}
<LightIconButton
- Icon={IconDotsVertical}
- size="small"
- accent="tertiary"
+ size="sm"
+ emphasis="subtle"
aria-label={t`Menu item actions`}
onClick={(event) => {
event.stopPropagation();
onOpenActions();
}}
- />
+ >
+ <IconDotsVertical />
+ </LightIconButton>
</StyledActions>
);
};
diff --git a/packages/twenty-front/src/modules/navigation-menu-item/edit/components/__stories__/NavigationMenuItemEditable.stories.tsx b/packages/twenty-front/src/modules/navigation-menu-item/edit/components/__stories__/NavigationMenuItemEditable.stories.tsx
index 2763b776a4c..7f468d887e1 100644
--- a/packages/twenty-front/src/modules/navigation-menu-item/edit/components/__stories__/NavigationMenuItemEditable.stories.tsx
+++ b/packages/twenty-front/src/modules/navigation-menu-item/edit/components/__stories__/NavigationMenuItemEditable.stories.tsx
@@ -4,7 +4,7 @@ import { Fragment } from 'react';
import { NavigationSections } from '@/navigation-menu-item/common/constants/NavigationSections.constants';
import { NavigationItemDropTarget } from '@/navigation-menu-item/display/dnd/components/NavigationItemDropTarget';
import { type Meta, type StoryObj } from '@storybook/react-vite';
-import { expect, userEvent, within } from 'storybook/test';
+import { expect, userEvent, waitFor, within } from 'storybook/test';
import { NavigationMenuItemType } from 'twenty-shared/types';
import { IconLink } from 'twenty-ui/icon';
import { type NavigationMenuItem } from '~/generated-metadata/graphql';
@@ -235,7 +235,9 @@ export const TooltipsStayOutOfActionMenus: Story = {
await canvas.findAllByRole('button', { name: 'Menu item actions' })
)[name === 'Docs' ? 0 : 1];
await user.hover(actions);
- await expect(body.queryByRole('tooltip')).not.toBeInTheDocument();
+ await waitFor(() =>
+ expect(body.queryByRole('tooltip')).not.toBeInTheDocument(),
+ );
await user.click(actions);
await expect(await body.findByText('Remove from sidebar')).toBeVisible();
await expect(body.queryByRole('tooltip')).not.toBeInTheDocument();
diff --git a/packages/twenty-front/src/modules/object-record/record-board/record-board-card/components/RecordBoardCardHeader.tsx b/packages/twenty-front/src/modules/object-record/record-board/record-board-card/components/RecordBoardCardHeader.tsx
index 3dad2c0b496..11dbde5dc94 100644
--- a/packages/twenty-front/src/modules/object-record/record-board/record-board-card/components/RecordBoardCardHeader.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-board/record-board-card/components/RecordBoardCardHeader.tsx
@@ -1,3 +1,4 @@
+import { t } from '@lingui/core/macro';
import { RecordBoardContext } from '@/object-record/record-board/contexts/RecordBoardContext';
import { useRecordBoardSelection } from '@/object-record/record-board/hooks/useRecordBoardSelection';
import { RecordBoardCardContext } from '@/object-record/record-board/record-board-card/contexts/RecordBoardCardContext';
@@ -22,7 +23,8 @@ import { useContext } from 'react';
import { themeCssVariables } from 'twenty-ui/theme-constants';
import { isDefined } from 'twenty-shared/utils';
import { IconEye, IconEyeOff } from 'twenty-ui/icon';
-import { Checkbox, LightIconButton } from 'twenty-ui/primitives/input';
+import { Checkbox } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { useIsMobile, useIsTouchDevice } from 'twenty-ui/utilities';
const StyledCompactIconContainer = styled.div`
@@ -104,12 +106,17 @@ export const RecordBoardCardHeader = () => {
<StyledCompactIconContainer className="compact-icon-container">
<StopPropagationContainer>
<LightIconButton
- Icon={recordBoardCardIsExpanded ? IconEyeOff : IconEye}
- accent="tertiary"
+ emphasis="subtle"
onClick={() => {
setRecordBoardCardIsExpanded(!recordBoardCardIsExpanded);
}}
- />
+ aria-label={
+ recordBoardCardIsExpanded ? t`Collapse card` : t`Expand card`
+ }
+ aria-expanded={recordBoardCardIsExpanded}
+ >
+ {recordBoardCardIsExpanded ? <IconEyeOff /> : <IconEye />}
+ </LightIconButton>
</StopPropagationContainer>
</StyledCompactIconContainer>
)}
diff --git a/packages/twenty-front/src/modules/object-record/record-board/record-board-column/components/RecordBoardColumnHeader.tsx b/packages/twenty-front/src/modules/object-record/record-board/record-board-column/components/RecordBoardColumnHeader.tsx
index 289b0de5ed0..8402781d968 100644
--- a/packages/twenty-front/src/modules/object-record/record-board/record-board-column/components/RecordBoardColumnHeader.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-board/record-board-column/components/RecordBoardColumnHeader.tsx
@@ -32,7 +32,7 @@ import { useAtomComponentSelectorValue } from '@/ui/utilities/state/jotai/hooks/
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { isDefined } from 'twenty-shared/utils';
import { IconDotsVertical, IconPlus } from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
const StyledHeader = styled.div<{ isReadOnly: boolean }>`
align-items: center;
@@ -270,22 +270,24 @@ export const RecordBoardColumnHeader = () => {
data-dropdown-open={isDropdownOpen ? 'true' : undefined}
>
<LightIconButton
- accent="tertiary"
+ emphasis="subtle"
aria-label={t`More options`}
- Icon={IconDotsVertical}
onClick={() => {
toggleDropdown({
dropdownComponentInstanceIdFromProps: dropdownId,
});
}}
- />
+ >
+ <IconDotsVertical />
+ </LightIconButton>
{canCreateRecords && !hasAnySoftDeleteFilterOnView && (
<LightIconButton
- accent="tertiary"
+ emphasis="subtle"
aria-label={t`Add new`}
- Icon={IconPlus}
onClick={handleCreateNewRecordClick}
- />
+ >
+ <IconPlus />
+ </LightIconButton>
)}
</StyledHeaderActions>
)}
diff --git a/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/duplicate/components/RecordDetailDuplicatesSection.tsx b/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/duplicate/components/RecordDetailDuplicatesSection.tsx
index ecd067a8d52..8775eff2d52 100644
--- a/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/duplicate/components/RecordDetailDuplicatesSection.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/duplicate/components/RecordDetailDuplicatesSection.tsx
@@ -11,7 +11,7 @@ import { t } from '@lingui/core/macro';
import { isNonEmptyArray } from '@sniptt/guards';
import { isDefined } from 'twenty-shared/utils';
import { IconArrowMerge } from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
export const RecordDetailDuplicatesSection = ({
objectRecordId,
@@ -51,10 +51,12 @@ export const RecordDetailDuplicatesSection = ({
rightAdornment={
<LightIconButton
className="displayOnHover"
- Icon={IconArrowMerge}
- accent="tertiary"
+ emphasis="subtle"
onClick={openMergeRecordsPageInSidePanel}
- />
+ aria-label={t`Merge duplicates`}
+ >
+ <IconArrowMerge />
+ </LightIconButton>
}
>
<RecordDetailRecordsListContainer>
diff --git a/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/relation/components/RecordDetailMorphRelationSectionDropdownManyToOne.tsx b/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/relation/components/RecordDetailMorphRelationSectionDropdownManyToOne.tsx
index c20c71d57f7..d6d0ef6896c 100644
--- a/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/relation/components/RecordDetailMorphRelationSectionDropdownManyToOne.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/relation/components/RecordDetailMorphRelationSectionDropdownManyToOne.tsx
@@ -1,3 +1,4 @@
+import { t } from '@lingui/core/macro';
import { type ReactNode, useCallback, useContext } from 'react';
import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
@@ -21,7 +22,7 @@ import { useSetAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useSe
import { FieldMetadataType } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { IconForbid, IconPencil } from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
type RecordDetailMorphRelationSectionDropdownManyToOneProps = {
dropdownTriggerClickableComponent?: ReactNode;
@@ -127,9 +128,11 @@ export const RecordDetailMorphRelationSectionDropdownManyToOne = ({
dropdownTriggerClickableComponent ?? (
<LightIconButton
className="displayOnHover"
- Icon={IconPencil}
- accent="tertiary"
- />
+ emphasis="subtle"
+ aria-label={t`Edit relation`}
+ >
+ <IconPencil />
+ </LightIconButton>
)
}
dropdownComponents={
diff --git a/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/relation/components/RecordDetailMorphRelationSectionDropdownOneToMany.tsx b/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/relation/components/RecordDetailMorphRelationSectionDropdownOneToMany.tsx
index c72fda992ba..e0ab51d29f4 100644
--- a/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/relation/components/RecordDetailMorphRelationSectionDropdownOneToMany.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/relation/components/RecordDetailMorphRelationSectionDropdownOneToMany.tsx
@@ -1,3 +1,4 @@
+import { t } from '@lingui/core/macro';
import { type ReactNode, useCallback, useContext } from 'react';
import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
@@ -23,7 +24,7 @@ import { useSetAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useSe
import { FieldMetadataType } from 'twenty-shared/types';
import { CustomError, isDefined } from 'twenty-shared/utils';
import { IconPlus } from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
type RecordDetailMorphRelationSectionDropdownOneToManyProps = {
dropdownTriggerClickableComponent?: ReactNode;
@@ -162,9 +163,11 @@ export const RecordDetailMorphRelationSectionDropdownOneToMany = ({
dropdownTriggerClickableComponent ?? (
<LightIconButton
className="displayOnHover"
- Icon={IconPlus}
- accent="tertiary"
- />
+ emphasis="subtle"
+ aria-label={t`Add relation`}
+ >
+ <IconPlus />
+ </LightIconButton>
)
}
dropdownComponents={
diff --git a/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/relation/components/RecordDetailRelationRecordsListItem.tsx b/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/relation/components/RecordDetailRelationRecordsListItem.tsx
index bf85c4c1a96..c9bdb0416d0 100644
--- a/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/relation/components/RecordDetailRelationRecordsListItem.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/relation/components/RecordDetailRelationRecordsListItem.tsx
@@ -42,7 +42,7 @@ import {
IconUnlink,
type IconComponent,
} from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { MenuItem } from 'twenty-ui/primitives/navigation';
import { AnimatedEaseInOut } from 'twenty-ui/primitives/layout';
import { FieldMetadataType, RelationType } from '~/generated-metadata/graphql';
@@ -224,9 +224,11 @@ export const RecordDetailRelationRecordsListItem = ({
<StyledClickableZone onClick={handleClick} data-testid="expand-button">
<LightIconButton
className="displayOnHover"
- Icon={AnimatedIconChevronDown}
- accent="tertiary"
- />
+ emphasis="subtle"
+ aria-label={t`Expand relation`}
+ >
+ <AnimatedIconChevronDown />
+ </LightIconButton>
</StyledClickableZone>
{!parentIsRecordFieldReadOnly && (
<Dropdown
@@ -235,9 +237,11 @@ export const RecordDetailRelationRecordsListItem = ({
clickableComponent={
<LightIconButton
className="displayOnHover"
- Icon={IconDotsVertical}
- accent="tertiary"
- />
+ emphasis="subtle"
+ aria-label={t`More options`}
+ >
+ <IconDotsVertical />
+ </LightIconButton>
}
dropdownComponents={
<DropdownContent>
diff --git a/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/relation/components/RecordDetailRelationSectionDropdownToMany.tsx b/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/relation/components/RecordDetailRelationSectionDropdownToMany.tsx
index 832624f7cb7..c24bb0be0bf 100644
--- a/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/relation/components/RecordDetailRelationSectionDropdownToMany.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/relation/components/RecordDetailRelationSectionDropdownToMany.tsx
@@ -1,3 +1,4 @@
+import { t } from '@lingui/core/macro';
import { type ReactNode, useCallback, useContext } from 'react';
import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
@@ -30,7 +31,7 @@ import { useAtomFamilySelectorValue } from '@/ui/utilities/state/jotai/hooks/use
import { useSetAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useSetAtomComponentState';
import { CustomError, isDefined } from 'twenty-shared/utils';
import { IconPlus } from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
type RecordDetailRelationSectionDropdownToManyProps = {
dropdownTriggerClickableComponent?: ReactNode;
@@ -245,9 +246,11 @@ export const RecordDetailRelationSectionDropdownToMany = ({
dropdownTriggerClickableComponent ?? (
<LightIconButton
className="displayOnHover"
- Icon={IconPlus}
- accent="tertiary"
- />
+ emphasis="subtle"
+ aria-label={t`Add relation`}
+ >
+ <IconPlus />
+ </LightIconButton>
)
}
dropdownComponents={
diff --git a/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/relation/components/RecordDetailRelationSectionDropdownToOne.tsx b/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/relation/components/RecordDetailRelationSectionDropdownToOne.tsx
index 98f41a29d69..02211fc380e 100644
--- a/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/relation/components/RecordDetailRelationSectionDropdownToOne.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/relation/components/RecordDetailRelationSectionDropdownToOne.tsx
@@ -1,3 +1,4 @@
+import { t } from '@lingui/core/macro';
import { type ReactNode, useCallback, useContext } from 'react';
import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
@@ -27,7 +28,7 @@ import { assertFieldMetadata } from '@/object-record/record-field/ui/types/guard
import { isFieldRelation } from '@/object-record/record-field/ui/types/guards/isFieldRelation';
import { CustomError, isDefined } from 'twenty-shared/utils';
import { IconForbid, IconPencil } from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
type RecordDetailRelationSectionDropdownToOneProps = {
dropdownTriggerClickableComponent?: ReactNode;
@@ -168,9 +169,11 @@ export const RecordDetailRelationSectionDropdownToOne = ({
dropdownTriggerClickableComponent ?? (
<LightIconButton
className="displayOnHover"
- Icon={IconPencil}
- accent="tertiary"
- />
+ emphasis="subtle"
+ aria-label={t`Edit relation`}
+ >
+ <IconPencil />
+ </LightIconButton>
)
}
dropdownComponents={
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/components/LightCopyIconButton.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/components/LightCopyIconButton.tsx
index ee8d211ee01..bfbed807bbc 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/components/LightCopyIconButton.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/components/LightCopyIconButton.tsx
@@ -1,7 +1,7 @@
import { styled } from '@linaria/react';
import { useLingui } from '@lingui/react/macro';
import { IconCopy } from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { themeCssVariables } from 'twenty-ui/theme-constants';
import { useCopyToClipboard } from '~/hooks/useCopyToClipboard';
@@ -20,12 +20,13 @@ export const LightCopyIconButton = ({ copyText }: LightCopyIconButtonProps) => {
return (
<StyledButtonContainer>
<LightIconButton
- Icon={IconCopy}
onClick={() => {
copyToClipboard(copyText, t`Text copied to clipboard`);
}}
aria-label={t`Copy to Clipboard`}
- />
+ >
+ <IconCopy />
+ </LightIconButton>
</StyledButtonContainer>
);
};
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/MultiItemFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/MultiItemFieldInput.tsx
index 6dcf7207904..8d94fa28901 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/MultiItemFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/MultiItemFieldInput.tsx
@@ -1,3 +1,4 @@
+import { t } from '@lingui/core/macro';
import React, { useCallback, useMemo, useRef, useState } from 'react';
import { Key } from 'ts-key-enum';
import { useDebounce } from 'use-debounce';
@@ -23,7 +24,7 @@ import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomState
import { isNonEmptyString } from '@sniptt/guards';
import { CustomError, isDefined } from 'twenty-shared/utils';
import { IconCheck, IconPlus } from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { MenuItem } from 'twenty-ui/primitives/navigation';
import { FieldMetadataType } from '~/generated-metadata/graphql';
import { moveArrayItem } from '~/utils/array/moveArrayItem';
@@ -368,9 +369,11 @@ export const MultiItemFieldInput = <T,>({
rightComponent={
items.length ? (
<LightIconButton
- Icon={isAddingNewItem ? IconPlus : IconCheck}
onClick={handleEnter}
- />
+ aria-label={isAddingNewItem ? t`Add item` : t`Save item`}
+ >
+ {isAddingNewItem ? <IconPlus /> : <IconCheck />}
+ </LightIconButton>
) : null
}
/>
diff --git a/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupMenuItemDraggable.tsx b/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupMenuItemDraggable.tsx
index 4f4b5760f53..35404522c01 100644
--- a/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupMenuItemDraggable.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupMenuItemDraggable.tsx
@@ -10,6 +10,7 @@ import { useAtomFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAto
import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { IconEye, IconEyeOff } from 'twenty-ui/icon';
+import { LightIconButton } from 'twenty-ui/components';
import { MenuItemDraggable } from 'twenty-ui/primitives/navigation';
type RecordGroupMenuItemDraggableProps = {
@@ -43,32 +44,9 @@ export const RecordGroupMenuItemDraggable = ({
const isNoValue =
recordGroupDefinition.type === RecordGroupDefinitionType.NoValue;
- const getIconButtons = (recordGroupDefinition: RecordGroupDefinition) => {
- const groupValue = recordGroupDefinition.value;
-
- if (!recordGroupDefinition.isVisible && isVisibleLimitReached) {
- return undefined;
- }
-
- const iconButtons = [
- {
- Icon: recordGroupDefinition.isVisible ? IconEyeOff : IconEye,
- ariaLabel: recordGroupDefinition.isVisible
- ? t`Hide group ${groupValue ?? ''}`
- : t`Show group ${groupValue ?? ''}`,
- dataTestId: recordGroupDefinition.isVisible
- ? `hide-group-${recordGroupDefinition.value?.toLowerCase().replace(' ', '-') ?? ''}`
- : `show-group-${recordGroupDefinition.value?.toLowerCase().replace(' ', '-') ?? ''}`,
- onClick: () =>
- onVisibilityChange({
- ...recordGroupDefinition,
- isVisible: !recordGroupDefinition.isVisible,
- }),
- },
- ].filter(isDefined);
-
- return iconButtons.length ? iconButtons : undefined;
- };
+ const groupValue = recordGroupDefinition.value;
+ const canToggleVisibility =
+ recordGroupDefinition.isVisible || !isVisibleLimitReached;
return (
<MenuItemDraggable
@@ -80,7 +58,30 @@ export const RecordGroupMenuItemDraggable = ({
/>
}
accent={isNoValue || showDragGrip ? 'placeholder' : 'default'}
- iconButtons={getIconButtons(recordGroupDefinition)}
+ iconButtons={
+ canToggleVisibility && (
+ <LightIconButton
+ aria-label={
+ recordGroupDefinition.isVisible
+ ? t`Hide group ${groupValue ?? ''}`
+ : t`Show group ${groupValue ?? ''}`
+ }
+ data-testid={
+ recordGroupDefinition.isVisible
+ ? `hide-group-${groupValue?.toLowerCase().replace(' ', '-') ?? ''}`
+ : `show-group-${groupValue?.toLowerCase().replace(' ', '-') ?? ''}`
+ }
+ onClick={() =>
+ onVisibilityChange({
+ ...recordGroupDefinition,
+ isVisible: !recordGroupDefinition.isVisible,
+ })
+ }
+ >
+ {recordGroupDefinition.isVisible ? <IconEyeOff /> : <IconEye />}
+ </LightIconButton>
+ )
+ }
gripMode={isNoValue || showDragGrip ? 'always' : 'never'}
isDragDisabled={!isDraggable}
/>
diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellButtons.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellButtons.tsx
index f88a77d64cd..1036a9aa147 100644
--- a/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellButtons.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellButtons.tsx
@@ -1,6 +1,9 @@
import { styled } from '@linaria/react';
+import { useLingui } from '@lingui/react/macro';
import { type IconComponent } from 'twenty-ui/icon';
-import { LightIconButtonGroup } from 'twenty-ui/primitives/input';
+import { ButtonGroup } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
+import { isDefined } from 'twenty-shared/utils';
import { MOBILE_VIEWPORT, themeCssVariables } from 'twenty-ui/theme-constants';
import { AnimatedContainer } from 'twenty-ui/primitives/layout';
@@ -10,7 +13,7 @@ const StyledButtonContainer = styled.div`
the box and clamp to a full squircle, and a scaled full squircle is not a
uniform offset — the child corners would pull away from the frame. sm
stays well below the clamp point so radius - inset holds in both modes. */
- --light-icon-button-radius: calc(${themeCssVariables.border.radius.sm} - 1px);
+ --tw-button-radius: calc(${themeCssVariables.border.radius.sm} - 1px);
border: 1px solid ${themeCssVariables.border.color.strong};
@media (max-width: ${MOBILE_VIEWPORT}px) {
@@ -24,7 +27,7 @@ const StyledButtonContainer = styled.div`
type RecordTableCellButtonsProps = {
onClick?: () => void;
Icon: IconComponent;
- ariaLabel?: string;
+ ariaLabel: string;
}[];
export const RecordTableCellButtons = ({
@@ -32,10 +35,23 @@ export const RecordTableCellButtons = ({
}: {
buttons: RecordTableCellButtonsProps;
}) => {
+ const { t } = useLingui();
+
return (
<AnimatedContainer>
<StyledButtonContainer>
- <LightIconButtonGroup size="small" iconButtons={buttons} />
+ <ButtonGroup aria-label={t`Cell controls`} attached={false}>
+ {buttons.map(({ Icon, onClick, ariaLabel }, index) => (
+ <LightIconButton
+ key={index}
+ aria-label={ariaLabel}
+ onClick={onClick}
+ disabled={!isDefined(onClick)}
+ >
+ <Icon />
+ </LightIconButton>
+ ))}
+ </ButtonGroup>
</StyledButtonContainer>
</AnimatedContainer>
);
diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellEditButton.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellEditButton.tsx
index 0c8559ee847..8bfa59a9de4 100644
--- a/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellEditButton.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellEditButton.tsx
@@ -1,3 +1,4 @@
+import { t } from '@lingui/core/macro';
import { useGetButtonIcon } from '@/object-record/record-field/ui/hooks/useGetButtonIcon';
import { useIsFieldInputOnly } from '@/object-record/record-field/ui/hooks/useIsFieldInputOnly';
@@ -39,6 +40,7 @@ export const RecordTableCellEditButton = () => {
{
onClick: handleMainButtonClick,
Icon: mainButtonIcon,
+ ariaLabel: isFirstColumn ? t`Open record` : t`Edit field`,
},
]}
/>
diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/__stories__/RecordTableCellButtons.stories.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/__stories__/RecordTableCellButtons.stories.tsx
new file mode 100644
index 00000000000..728b1bdb663
--- /dev/null
+++ b/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/__stories__/RecordTableCellButtons.stories.tsx
@@ -0,0 +1,42 @@
+import { RecordTableCellButtons } from '@/object-record/record-table/record-table-cell/components/RecordTableCellButtons';
+import { type Meta, type StoryObj } from '@storybook/react-vite';
+import { expect, fn, userEvent, within } from 'storybook/test';
+import { isDefined } from 'twenty-shared/utils';
+import { IconPencil, IconPlus } from 'twenty-ui/icon';
+
+const meta: Meta<typeof RecordTableCellButtons> = {
+ title: 'Modules/RecordTable/RecordTableCellButtons',
+ component: RecordTableCellButtons,
+ args: {
+ buttons: [
+ { Icon: IconPencil, ariaLabel: 'Edit field', onClick: fn() },
+ { Icon: IconPlus, ariaLabel: 'Unavailable action' },
+ ],
+ },
+};
+export default meta;
+type Story = StoryObj<typeof RecordTableCellButtons>;
+
+export const Default: Story = {
+ play: async ({ canvasElement, args }) => {
+ const canvas = within(canvasElement);
+ const edit = canvas.getByRole('button', { name: 'Edit field' });
+ const unavailable = canvas.getByRole('button', {
+ name: 'Unavailable action',
+ });
+ const group = canvas.getByRole('group', { name: 'Cell controls' });
+ const frame = group.parentElement;
+ if (!isDefined(frame)) {
+ throw new Error('Missing table action frame');
+ }
+ await expect(getComputedStyle(edit).width).toBe('24px');
+ await expect(getComputedStyle(group).gap).toBe('2px');
+ await expect(parseFloat(getComputedStyle(edit).borderTopLeftRadius)).toBe(
+ parseFloat(getComputedStyle(frame).borderTopLeftRadius) - 1,
+ );
+ await expect(unavailable).toBeDisabled();
+ edit.focus();
+ await userEvent.keyboard('{Enter}');
+ await expect(args.buttons[0].onClick).toHaveBeenCalledOnce();
+ },
+};
diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-header/components/RecordTableHeaderLabelIdentifierCellPlusButton.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-header/components/RecordTableHeaderLabelIdentifierCellPlusButton.tsx
index b3d721f9d80..5a80d48a9be 100644
--- a/packages/twenty-front/src/modules/object-record/record-table/record-table-header/components/RecordTableHeaderLabelIdentifierCellPlusButton.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-table/record-table-header/components/RecordTableHeaderLabelIdentifierCellPlusButton.tsx
@@ -1,3 +1,4 @@
+import { t } from '@lingui/core/macro';
import { isLayoutCustomizationModeEnabledState } from '@/layout-customization/states/isLayoutCustomizationModeEnabledState';
import { hasAnySoftDeleteFilterOnViewComponentSelector } from '@/object-record/record-filter/states/hasAnySoftDeleteFilterOnView';
import { useRecordTableContextOrThrow } from '@/object-record/record-table/contexts/RecordTableContext';
@@ -8,7 +9,7 @@ import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomState
import { styled } from '@linaria/react';
import { IconPlus } from 'twenty-ui/icon';
import { themeCssVariables } from 'twenty-ui/theme-constants';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { useIsMobile } from 'twenty-ui/utilities';
const StyledHeaderIcon = styled.div`
@@ -49,11 +50,13 @@ export const RecordTableHeaderLabelIdentifierCellPlusButton = () => {
}) && (
<StyledHeaderIcon>
<LightIconButton
- Icon={IconPlus}
- size="small"
- accent="tertiary"
+ size="sm"
+ emphasis="subtle"
onClick={handlePlusButtonClick}
- />
+ aria-label={t`Add field`}
+ >
+ <IconPlus />
+ </LightIconButton>
</StyledHeaderIcon>
)
);
diff --git a/packages/twenty-front/src/modules/onboarding/components/OnboardingHeader.tsx b/packages/twenty-front/src/modules/onboarding/components/OnboardingHeader.tsx
index 2eb6b6c977f..9632410f07f 100644
--- a/packages/twenty-front/src/modules/onboarding/components/OnboardingHeader.tsx
+++ b/packages/twenty-front/src/modules/onboarding/components/OnboardingHeader.tsx
@@ -3,7 +3,7 @@ import { styled } from '@linaria/react';
import { useLingui } from '@lingui/react/macro';
import { isDefined } from 'twenty-shared/utils';
import { IconChevronLeft, IconCoins, IconInfoCircle } from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import {
MOBILE_VIEWPORT,
themeCssVariables,
@@ -131,13 +131,14 @@ export const OnboardingHeader = ({
<StyledLeftSide>
{isDefined(onBack) && (
<LightIconButton
- Icon={IconChevronLeft}
- accent="tertiary"
- size="small"
+ emphasis="subtle"
+ size="sm"
onClick={onBack}
disabled={isBackDisabled}
aria-label={t`Go back`}
- />
+ >
+ <IconChevronLeft />
+ </LightIconButton>
)}
</StyledLeftSide>
<StyledCenter>
diff --git a/packages/twenty-front/src/modules/page-layout/components/PageLayoutTabMenuItemSelectAvatar.tsx b/packages/twenty-front/src/modules/page-layout/components/PageLayoutTabMenuItemSelectAvatar.tsx
index 55a3438ff22..65dcbc396e4 100644
--- a/packages/twenty-front/src/modules/page-layout/components/PageLayoutTabMenuItemSelectAvatar.tsx
+++ b/packages/twenty-front/src/modules/page-layout/components/PageLayoutTabMenuItemSelectAvatar.tsx
@@ -1,10 +1,11 @@
+import { t } from '@lingui/core/macro';
import { styled } from '@linaria/react';
import { type MouseEvent, useContext, useState } from 'react';
import { TabAvatar } from '@/ui/layout/tab-list/components/TabAvatar';
import { type SingleTabProps } from '@/ui/layout/tab-list/types/SingleTabProps';
import { IconPencil } from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import {
StyledHoverableMenuItemBase,
StyledMenuItemIconCheck,
@@ -77,14 +78,16 @@ export const PageLayoutTabMenuItemSelectAvatar = ({
{isHovered && showEditButton && (
<div className="hoverable-buttons">
<LightIconButton
- Icon={IconPencil}
- size="small"
- accent="tertiary"
+ size="sm"
+ emphasis="subtle"
onClick={(event) => {
event.stopPropagation();
onEditClick?.(tab.id);
}}
- />
+ aria-label={t`Edit tab icon`}
+ >
+ <IconPencil />
+ </LightIconButton>
</div>
)}
</StyledRightContent>
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/field/components/FieldWidgetEditAction.tsx b/packages/twenty-front/src/modules/page-layout/widgets/field/components/FieldWidgetEditAction.tsx
index b66f245ac24..d244ba59570 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/field/components/FieldWidgetEditAction.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/field/components/FieldWidgetEditAction.tsx
@@ -1,3 +1,4 @@
+import { t } from '@lingui/core/macro';
import { useContext } from 'react';
import { FieldContext } from '@/object-record/record-field/ui/contexts/FieldContext';
@@ -5,7 +6,7 @@ import { useInlineCell } from '@/object-record/record-inline-cell/hooks/useInlin
import { useOpenFieldWidgetFieldInputEditMode } from '@/page-layout/widgets/field/hooks/useOpenFieldWidgetFieldInputEditMode';
import { WidgetCardHeaderHoverReveal } from '@/page-layout/widgets/widget-card/components/WidgetCardHeaderHoverReveal';
import { IconPencil } from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
export const FieldWidgetEditAction = () => {
const { recordId, fieldDefinition } = useContext(FieldContext);
@@ -23,10 +24,12 @@ export const FieldWidgetEditAction = () => {
return (
<WidgetCardHeaderHoverReveal>
<LightIconButton
- Icon={IconPencil}
- accent="secondary"
+ emphasis="standard"
onClick={handleClick}
- />
+ aria-label={t`Edit field`}
+ >
+ <IconPencil />
+ </LightIconButton>
</WidgetCardHeaderHoverReveal>
);
};
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/fields/components/FieldsConfigurationFieldEditor.tsx b/packages/twenty-front/src/modules/page-layout/widgets/fields/components/FieldsConfigurationFieldEditor.tsx
index f8931b7fb76..b7df5df1b28 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/fields/components/FieldsConfigurationFieldEditor.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/fields/components/FieldsConfigurationFieldEditor.tsx
@@ -1,3 +1,5 @@
+import { t } from '@lingui/core/macro';
+import { LightIconButton } from 'twenty-ui/components';
import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
import { type FieldsConfigurationFieldItem } from '@/page-layout/types/FieldsConfiguration';
import { IconEye, IconEyeOff, useIcons } from 'twenty-ui/icon';
@@ -25,15 +27,17 @@ export const FieldsConfigurationFieldEditor = ({
gripMode="onHover"
withIconContainer
isIconDisplayedOnHoverOnly={false}
- iconButtons={[
- {
- Icon: isVisible ? IconEye : IconEyeOff,
- onClick: (e) => {
- e.stopPropagation();
+ iconButtons={
+ <LightIconButton
+ aria-label={isVisible ? t`Hide field` : t`Show field`}
+ onClick={(event) => {
+ event.stopPropagation();
onToggleVisibility();
- },
- },
- ]}
+ }}
+ >
+ {isVisible ? <IconEye /> : <IconEyeOff />}
+ </LightIconButton>
+ }
/>
);
};
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/fields/components/FieldsConfigurationGroupDropdown.tsx b/packages/twenty-front/src/modules/page-layout/widgets/fields/components/FieldsConfigurationGroupDropdown.tsx
index ff141d0df44..af20ddc3677 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/fields/components/FieldsConfigurationGroupDropdown.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/fields/components/FieldsConfigurationGroupDropdown.tsx
@@ -5,7 +5,7 @@ import {
IconPencil,
IconTrash,
} from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { MenuItem } from 'twenty-ui/primitives/navigation';
import { getFieldsConfigurationGroupEditDropdownId } from '@/page-layout/widgets/fields/utils/getFieldsConfigurationGroupEditDropdownId';
@@ -53,11 +53,9 @@ export const FieldsConfigurationGroupDropdown = ({
<Dropdown
dropdownId={dropdownId}
clickableComponent={
- <LightIconButton
- Icon={IconDotsVertical}
- accent="tertiary"
- aria-label={t`More options`}
- />
+ <LightIconButton emphasis="subtle" aria-label={t`More options`}>
+ <IconDotsVertical />
+ </LightIconButton>
}
dropdownPlacement="bottom-start"
dropdownComponents={
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/graph/components/GraphWidgetLegend.tsx b/packages/twenty-front/src/modules/page-layout/widgets/graph/components/GraphWidgetLegend.tsx
index c505a8ebaac..a3a1bf5d48d 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/graph/components/GraphWidgetLegend.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/graph/components/GraphWidgetLegend.tsx
@@ -1,3 +1,4 @@
+import { t } from '@lingui/core/macro';
import { useIsPageLayoutInEditMode } from '@/page-layout/hooks/useIsPageLayoutInEditMode';
import { GraphWidgetLegendDot } from '@/page-layout/widgets/graph/components/GraphWidgetLegendDot';
import { LEGEND_HIGHLIGHT_DIMMED_OPACITY } from '@/page-layout/widgets/graph/constants/LegendHighlightDimmedOpacity.constant';
@@ -15,7 +16,7 @@ import { AnimatePresence, motion } from 'framer-motion';
import { useContext, useRef, useState } from 'react';
import { IconChevronLeft, IconChevronRight } from 'twenty-ui/icon';
import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants';
export type GraphWidgetLegendItem = {
@@ -266,17 +267,21 @@ export const GraphWidgetLegend = ({
<LightIconButton
onClick={handlePreviousPage}
disabled={safeCurrentPage === 0}
- Icon={IconChevronLeft}
- accent="tertiary"
- />
+ emphasis="subtle"
+ aria-label={t`Previous`}
+ >
+ <IconChevronLeft />
+ </LightIconButton>
<StyledPaginationIndicator>
{safeCurrentPage + 1}/{totalPages}
</StyledPaginationIndicator>
<LightIconButton
onClick={handleNextPage}
disabled={safeCurrentPage === totalPages - 1}
- Icon={IconChevronRight}
- />
+ aria-label={t`Next`}
+ >
+ <IconChevronRight />
+ </LightIconButton>
</StyledPaginationContainer>
)}
<StyledAnimationClipContainer>
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/widget-card/components/WidgetCardHeaderActionButton.tsx b/packages/twenty-front/src/modules/page-layout/widgets/widget-card/components/WidgetCardHeaderActionButton.tsx
index 1de54c5e517..e51b18ba3f4 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/widget-card/components/WidgetCardHeaderActionButton.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/widget-card/components/WidgetCardHeaderActionButton.tsx
@@ -1,5 +1,5 @@
import { type IconComponent } from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
type WidgetCardHeaderActionButtonProps = {
Icon: IconComponent;
@@ -17,12 +17,13 @@ export const WidgetCardHeaderActionButton = ({
disabled,
}: WidgetCardHeaderActionButtonProps) => (
<LightIconButton
- Icon={Icon}
aria-label={label}
title={label}
- accent="tertiary"
- size="small"
+ emphasis="subtle"
+ size="sm"
onClick={onClick}
disabled={disabled}
- />
+ >
+ <Icon />
+ </LightIconButton>
);
diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsRowDropdownMenu.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsRowDropdownMenu.tsx
index dfe9e85d21e..917f13005d3 100644
--- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsRowDropdownMenu.tsx
+++ b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsRowDropdownMenu.tsx
@@ -24,7 +24,7 @@ import {
IconRefresh,
IconTrash,
} from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { MenuItem } from 'twenty-ui/primitives/navigation';
import { useNavigateSettings } from '~/hooks/useNavigateSettings';
import { DELETE_CONNECTED_ACCOUNT } from '../graphql/mutations/deleteConnectedAccount';
@@ -75,11 +75,9 @@ export const SettingsAccountsRowDropdownMenu = ({
dropdownId={dropdownId}
dropdownPlacement="right-start"
clickableComponent={
- <LightIconButton
- Icon={IconDotsVertical}
- accent="tertiary"
- aria-label={t`More options`}
- />
+ <LightIconButton emphasis="subtle" aria-label={t`More options`}>
+ <IconDotsVertical />
+ </LightIconButton>
}
dropdownComponents={
<DropdownContent>
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminServerAdminAccess.tsx b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminServerAdminAccess.tsx
index a64e97c127d..ef48d18a949 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminServerAdminAccess.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminServerAdminAccess.tsx
@@ -17,7 +17,7 @@ import { useState } from 'react';
import { IconDotsVertical } from 'twenty-ui/icon';
import { Status } from 'twenty-ui/primitives/data-display';
import { useToast } from 'twenty-ui/primitives/feedback';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { MenuItem } from 'twenty-ui/primitives/navigation';
import { themeCssVariables } from 'twenty-ui/theme-constants';
import {
@@ -166,7 +166,9 @@ export const SettingsAdminServerAdminAccess = ({
dropdownId={dropdownId}
dropdownPlacement="right-start"
clickableComponent={
- <LightIconButton Icon={IconDotsVertical} accent="tertiary" />
+ <LightIconButton emphasis="subtle" aria-label={t`More options`}>
+ <IconDotsVertical />
+ </LightIconButton>
}
dropdownComponents={
<DropdownContent>
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceCreditGrantRowDropdownMenu.tsx b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceCreditGrantRowDropdownMenu.tsx
index 77fc625796e..f57a7a520d2 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceCreditGrantRowDropdownMenu.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceCreditGrantRowDropdownMenu.tsx
@@ -1,6 +1,6 @@
import { t } from '@lingui/core/macro';
import { IconDotsVertical, IconTrash } from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { MenuItem } from 'twenty-ui/primitives/navigation';
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
@@ -26,7 +26,9 @@ export const SettingsAdminWorkspaceCreditGrantRowDropdownMenu = ({
dropdownId={dropdownId}
dropdownPlacement="right-start"
clickableComponent={
- <LightIconButton Icon={IconDotsVertical} accent="tertiary" />
+ <LightIconButton emphasis="subtle" aria-label={t`More options`}>
+ <IconDotsVertical />
+ </LightIconButton>
}
dropdownComponents={
<DropdownContent>
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminQueueJobRowDropdownMenu.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminQueueJobRowDropdownMenu.tsx
index fcb7a6981d2..ea72a4aab52 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminQueueJobRowDropdownMenu.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminQueueJobRowDropdownMenu.tsx
@@ -4,7 +4,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, IconRefresh, IconTrash } from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { MenuItem } from 'twenty-ui/primitives/navigation';
import { JobState } from '~/generated-admin/graphql';
@@ -39,11 +39,9 @@ export const SettingsAdminQueueJobRowDropdownMenu = ({
dropdownId={dropdownId}
dropdownPlacement="right-start"
clickableComponent={
- <LightIconButton
- aria-label={t`Job Actions`}
- Icon={IconDotsVertical}
- accent="tertiary"
- />
+ <LightIconButton aria-label={t`Job Actions`} emphasis="subtle">
+ <IconDotsVertical />
+ </LightIconButton>
}
dropdownComponents={
<DropdownContent>
diff --git a/packages/twenty-front/src/modules/settings/components/layout/SettingsWizardStepBar.tsx b/packages/twenty-front/src/modules/settings/components/layout/SettingsWizardStepBar.tsx
index 2cb741d0303..34c5e54598a 100644
--- a/packages/twenty-front/src/modules/settings/components/layout/SettingsWizardStepBar.tsx
+++ b/packages/twenty-front/src/modules/settings/components/layout/SettingsWizardStepBar.tsx
@@ -1,7 +1,8 @@
+import { t } from '@lingui/core/macro';
import { styled } from '@linaria/react';
import { type ReactNode } from 'react';
import { IconChevronLeft } from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { themeCssVariables } from 'twenty-ui/theme-constants';
type SettingsWizardStepBarProps = {
@@ -50,11 +51,13 @@ export const SettingsWizardStepBar = ({
<StyledLeft>
{onBack && (
<LightIconButton
- Icon={IconChevronLeft}
- size="small"
- accent="tertiary"
+ size="sm"
+ emphasis="subtle"
onClick={onBack}
- />
+ aria-label={t`Previous`}
+ >
+ <IconChevronLeft />
+ </LightIconButton>
)}
</StyledLeft>
<StyledLabel>{label}</StyledLabel>
diff --git a/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectForm.tsx b/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectForm.tsx
index 7cab874177c..c7a0445fb6a 100644
--- a/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectForm.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectForm.tsx
@@ -33,7 +33,7 @@ import { t } from '@lingui/core/macro';
import { useContext, useEffect, useState } from 'react';
import { useSearchParams } from 'react-router-dom';
import { isDefined } from 'twenty-shared/utils';
-import { LightButton } from 'twenty-ui/components';
+import { LightButton, LightIconButton } from 'twenty-ui/components';
import {
IconDotsVertical,
IconPencil,
@@ -41,7 +41,7 @@ import {
IconPoint,
IconTrash,
} from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+
import { CardContent, CardFooter } from 'twenty-ui/primitives/surfaces';
import { MenuItem } from 'twenty-ui/primitives/navigation';
import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants';
@@ -369,9 +369,11 @@ export const SettingsDataModelFieldSelectForm = ({
dropdownId={OPTIONS_DROPDOWN_ID}
clickableComponent={
<LightIconButton
- Icon={IconDotsVertical}
- accent="tertiary"
- />
+ emphasis="subtle"
+ aria-label={t`More options`}
+ >
+ <IconDotsVertical />
+ </LightIconButton>
}
dropdownComponents={
<DropdownContent
diff --git a/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectFormOptionRow.tsx b/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectFormOptionRow.tsx
index c8fafd59f02..68fe0ada87c 100644
--- a/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectFormOptionRow.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectFormOptionRow.tsx
@@ -17,7 +17,7 @@ import {
IconTrash,
IconX,
} from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import {
type ColorLabels,
MenuItem,
@@ -216,10 +216,12 @@ export const SettingsDataModelFieldSelectFormOptionRow = ({
clickableComponent={
<StyledLightIconButtonContainer>
<LightIconButton
- accent="tertiary"
- Icon={IconDotsVertical}
+ emphasis="subtle"
disabled={shouldForbidRemoveAsDefault}
- />
+ aria-label={t`More options`}
+ >
+ <IconDotsVertical />
+ </LightIconButton>
</StyledLightIconButtonContainer>
}
dropdownComponents={
diff --git a/packages/twenty-front/src/modules/settings/data-model/graph-overview/components/SettingsDataModelOverview.tsx b/packages/twenty-front/src/modules/settings/data-model/graph-overview/components/SettingsDataModelOverview.tsx
index 2e8a44a2af3..f1ae8139cbd 100644
--- a/packages/twenty-front/src/modules/settings/data-model/graph-overview/components/SettingsDataModelOverview.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/graph-overview/components/SettingsDataModelOverview.tsx
@@ -32,7 +32,8 @@ import {
IconPlus,
IconX,
} from 'twenty-ui/icon';
-import { IconButtonGroup } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
+import { ButtonGroup } from 'twenty-ui/primitives/input';
import { themeCssVariables } from 'twenty-ui/theme-constants';
const nodeTypes: NodeTypes = {
@@ -211,27 +212,46 @@ export const SettingsDataModelOverview = () => {
proOptions={{ hideAttribution: true }}
>
<Background />
- <IconButtonGroup
+ <ButtonGroup
+ framed
+ attached={false}
className="react-flow__panel react-flow__controls bottom left horizontal"
- iconButtons={[
- {
- Icon: IconPlus,
- onClick: () => zoomIn(),
- },
- {
- Icon: IconMinus,
- onClick: () => zoomOut(),
- },
- {
- Icon: IconMaximize,
- onClick: () => fitView(),
- },
- {
- Icon: isInteractive ? IconLockOpen : IconLock,
- onClick: () => setInteractive(!isInteractive),
- },
- ]}
- ></IconButtonGroup>
+ aria-label={t`Diagram controls`}
+ >
+ <LightIconButton
+ size="xs"
+ emphasis="subtle"
+ aria-label={t`Zoom in`}
+ onClick={() => zoomIn()}
+ >
+ <IconPlus />
+ </LightIconButton>
+ <LightIconButton
+ size="xs"
+ emphasis="subtle"
+ aria-label={t`Zoom out`}
+ onClick={() => zoomOut()}
+ >
+ <IconMinus />
+ </LightIconButton>
+ <LightIconButton
+ size="xs"
+ emphasis="subtle"
+ aria-label={t`Fit view`}
+ onClick={() => fitView()}
+ >
+ <IconMaximize />
+ </LightIconButton>
+ <LightIconButton
+ size="xs"
+ emphasis="subtle"
+ aria-label={t`Lock diagram`}
+ aria-pressed={!isInteractive}
+ onClick={() => setInteractive(!isInteractive)}
+ >
+ {isInteractive ? <IconLockOpen /> : <IconLock />}
+ </LightIconButton>
+ </ButtonGroup>
</ReactFlow>
</StyledContainer>
);
diff --git a/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectFieldDisabledActionDropdown.tsx b/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectFieldDisabledActionDropdown.tsx
index 74d3344607a..14e052e81ac 100644
--- a/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectFieldDisabledActionDropdown.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectFieldDisabledActionDropdown.tsx
@@ -11,7 +11,7 @@ import {
IconPencil,
IconTrash,
} from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { MenuItem } from 'twenty-ui/primitives/navigation';
import { type FieldMetadataType } from '~/generated-metadata/graphql';
@@ -62,9 +62,10 @@ export const SettingsObjectFieldInactiveActionDropdown = ({
clickableComponent={
<LightIconButton
aria-label={t`Inactive Field Options`}
- Icon={IconDotsVertical}
- accent="tertiary"
- />
+ emphasis="subtle"
+ >
+ <IconDotsVertical />
+ </LightIconButton>
}
dropdownComponents={
<DropdownContent widthInPixels={GenericDropdownContentWidth.Narrow}>
diff --git a/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectFieldItemTableRow.tsx b/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectFieldItemTableRow.tsx
index fb6fc6a388b..83a25102021 100644
--- a/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectFieldItemTableRow.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectFieldItemTableRow.tsx
@@ -27,7 +27,7 @@ import {
IconPlus,
useIcons,
} from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { UndecoratedLink } from 'twenty-ui/primitives/navigation';
import { Tooltip } from 'twenty-ui/primitives/surfaces';
import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants';
@@ -255,10 +255,12 @@ export const SettingsObjectFieldItemTableRow = ({
) : (
canToggleField && (
<LightIconButton
- Icon={IconMinus}
- accent="tertiary"
+ emphasis="subtle"
onClick={handleToggleField}
- />
+ aria-label={t`Deactivate field`}
+ >
+ <IconMinus />
+ </LightIconButton>
)
)
) : mode === 'view' ? (
@@ -279,10 +281,12 @@ export const SettingsObjectFieldItemTableRow = ({
/>
) : (
<LightIconButton
- Icon={IconPlus}
- accent="tertiary"
+ emphasis="subtle"
onClick={handleToggleField}
- />
+ aria-label={t`Add`}
+ >
+ <IconPlus />
+ </LightIconButton>
)}
</TableCell>
</TableRow>
diff --git a/packages/twenty-front/src/modules/settings/data-model/object-details/components/tabs/SettingsObjectSearchSection.tsx b/packages/twenty-front/src/modules/settings/data-model/object-details/components/tabs/SettingsObjectSearchSection.tsx
index 7c7dc363235..0225ad60bee 100644
--- a/packages/twenty-front/src/modules/settings/data-model/object-details/components/tabs/SettingsObjectSearchSection.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/object-details/components/tabs/SettingsObjectSearchSection.tsx
@@ -31,7 +31,8 @@ import {
IconTrash,
useIcons,
} from 'twenty-ui/icon';
-import { Button, LightIconButton } from 'twenty-ui/primitives/input';
+import { Button } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { MenuItem } from 'twenty-ui/primitives/navigation';
import { Card } from 'twenty-ui/primitives/surfaces';
import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants';
@@ -238,12 +239,14 @@ export const SettingsObjectSearchSection = ({
<TableCell align="right">
{isEditable && !entry.isLabelIdentifier && (
<LightIconButton
- Icon={IconTrash}
- accent="tertiary"
+ emphasis="subtle"
onClick={() =>
handleSetFieldSearchable(entry.id, false)
}
- />
+ aria-label={t`Remove searchable field`}
+ >
+ <IconTrash />
+ </LightIconButton>
)}
</TableCell>
</TableRow>
diff --git a/packages/twenty-front/src/modules/settings/data-model/objects/components/SettingsObjectInactiveMenuDropDown.tsx b/packages/twenty-front/src/modules/settings/data-model/objects/components/SettingsObjectInactiveMenuDropDown.tsx
index 5fa11a86619..bbd4e7e0c1f 100644
--- a/packages/twenty-front/src/modules/settings/data-model/objects/components/SettingsObjectInactiveMenuDropDown.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/objects/components/SettingsObjectInactiveMenuDropDown.tsx
@@ -11,7 +11,7 @@ import {
IconPencil,
IconTrash,
} from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { MenuItem } from 'twenty-ui/primitives/navigation';
type SettingsObjectInactiveMenuDropDownProps = {
@@ -58,9 +58,10 @@ export const SettingsObjectInactiveMenuDropDown = ({
clickableComponent={
<LightIconButton
aria-label={t`Inactive Object Options`}
- Icon={IconDotsVertical}
- accent="tertiary"
- />
+ emphasis="subtle"
+ >
+ <IconDotsVertical />
+ </LightIconButton>
}
dropdownComponents={
<DropdownContent widthInPixels={GenericDropdownContentWidth.Narrow}>
diff --git a/packages/twenty-front/src/modules/settings/domains/components/SettingPublicDomainRowDropdownMenu.tsx b/packages/twenty-front/src/modules/settings/domains/components/SettingPublicDomainRowDropdownMenu.tsx
index 7a92f093c1e..44f6d708675 100644
--- a/packages/twenty-front/src/modules/settings/domains/components/SettingPublicDomainRowDropdownMenu.tsx
+++ b/packages/twenty-front/src/modules/settings/domains/components/SettingPublicDomainRowDropdownMenu.tsx
@@ -7,7 +7,7 @@ import { useMutation, useQuery } from '@apollo/client/react';
import { useLingui } from '@lingui/react/macro';
import { IconDotsVertical, IconTrash } from 'twenty-ui/icon';
import { useToast } from 'twenty-ui/primitives/feedback';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { MenuItem } from 'twenty-ui/primitives/navigation';
import {
type PublicDomain,
@@ -52,11 +52,9 @@ export const SettingPublicDomainRowDropdownMenu = ({
dropdownId={dropdownId}
dropdownPlacement="right-start"
clickableComponent={
- <LightIconButton
- Icon={IconDotsVertical}
- accent="tertiary"
- aria-label={t`More options`}
- />
+ <LightIconButton emphasis="subtle" aria-label={t`More options`}>
+ <IconDotsVertical />
+ </LightIconButton>
}
dropdownComponents={
<DropdownContent>
diff --git a/packages/twenty-front/src/modules/settings/profile/devices/components/SettingsDeviceSessionRowDropdownMenu.tsx b/packages/twenty-front/src/modules/settings/profile/devices/components/SettingsDeviceSessionRowDropdownMenu.tsx
index 0db13daa21f..7a94927f743 100644
--- a/packages/twenty-front/src/modules/settings/profile/devices/components/SettingsDeviceSessionRowDropdownMenu.tsx
+++ b/packages/twenty-front/src/modules/settings/profile/devices/components/SettingsDeviceSessionRowDropdownMenu.tsx
@@ -7,7 +7,7 @@ import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/Drop
import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';
import { useToast } from 'twenty-ui/primitives/feedback';
import { IconDotsVertical, IconLogout } from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { MenuItem } from 'twenty-ui/primitives/navigation';
import {
CurrentUserSessionsDocument,
@@ -49,7 +49,9 @@ export const SettingsDeviceSessionRowDropdownMenu = ({
dropdownId={dropdownId}
dropdownPlacement="bottom-end"
clickableComponent={
- <LightIconButton Icon={IconDotsVertical} accent="tertiary" />
+ <LightIconButton emphasis="subtle" aria-label={t`More options`}>
+ <IconDotsVertical />
+ </LightIconButton>
}
dropdownComponents={
<DropdownContent>
diff --git a/packages/twenty-front/src/modules/settings/security/components/approvedAccessDomains/SettingsSecurityApprovedAccessDomainRowDropdownMenu.tsx b/packages/twenty-front/src/modules/settings/security/components/approvedAccessDomains/SettingsSecurityApprovedAccessDomainRowDropdownMenu.tsx
index 3649419691e..cf8d3c5e698 100644
--- a/packages/twenty-front/src/modules/settings/security/components/approvedAccessDomains/SettingsSecurityApprovedAccessDomainRowDropdownMenu.tsx
+++ b/packages/twenty-front/src/modules/settings/security/components/approvedAccessDomains/SettingsSecurityApprovedAccessDomainRowDropdownMenu.tsx
@@ -9,7 +9,7 @@ import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { IconDotsVertical, IconTrash } from 'twenty-ui/icon';
import { useToast } from 'twenty-ui/primitives/feedback';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { MenuItem } from 'twenty-ui/primitives/navigation';
import {
type ApprovedAccessDomain,
@@ -64,7 +64,9 @@ export const SettingsSecurityApprovedAccessDomainRowDropdownMenu = ({
dropdownId={dropdownId}
dropdownPlacement="right-start"
clickableComponent={
- <LightIconButton Icon={IconDotsVertical} accent="tertiary" />
+ <LightIconButton emphasis="subtle" aria-label={t`More options`}>
+ <IconDotsVertical />
+ </LightIconButton>
}
dropdownComponents={
<DropdownContent>
diff --git a/packages/twenty-front/src/modules/settings/security/components/sso/SettingsSecuritySsoRowDropdownMenu.tsx b/packages/twenty-front/src/modules/settings/security/components/sso/SettingsSecuritySsoRowDropdownMenu.tsx
index 76cb8a48043..8977a0fc0c9 100644
--- a/packages/twenty-front/src/modules/settings/security/components/sso/SettingsSecuritySsoRowDropdownMenu.tsx
+++ b/packages/twenty-front/src/modules/settings/security/components/sso/SettingsSecuritySsoRowDropdownMenu.tsx
@@ -9,7 +9,7 @@ import { useLingui } from '@lingui/react/macro';
import { isDefined } from 'twenty-shared/utils';
import { useToast } from 'twenty-ui/primitives/feedback';
import { IconArchive, IconDotsVertical, IconTrash } from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { MenuItem } from 'twenty-ui/primitives/navigation';
import { SsoIdentityProviderStatus } from '~/generated-metadata/graphql';
@@ -70,11 +70,9 @@ export const SettingsSecuritySsoRowDropdownMenu = ({
dropdownId={dropdownId}
dropdownPlacement="right-start"
clickableComponent={
- <LightIconButton
- Icon={IconDotsVertical}
- accent="tertiary"
- aria-label={t`More options`}
- />
+ <LightIconButton emphasis="subtle" aria-label={t`More options`}>
+ <IconDotsVertical />
+ </LightIconButton>
}
dropdownComponents={
<DropdownContent>
diff --git a/packages/twenty-front/src/modules/settings/translations/components/SidePanelSettingsMetadataTranslationsPage.tsx b/packages/twenty-front/src/modules/settings/translations/components/SidePanelSettingsMetadataTranslationsPage.tsx
index 75cbd8de1b7..0340960e10a 100644
--- a/packages/twenty-front/src/modules/settings/translations/components/SidePanelSettingsMetadataTranslationsPage.tsx
+++ b/packages/twenty-front/src/modules/settings/translations/components/SidePanelSettingsMetadataTranslationsPage.tsx
@@ -15,9 +15,9 @@ import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomState
import { styled } from '@linaria/react';
import { useLingui } from '@lingui/react/macro';
import { isDefined } from 'twenty-shared/utils';
-import { Section } from 'twenty-ui/components';
+import { Section, LightIconButton } from 'twenty-ui/components';
import { IconRestore } from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+
import { themeCssVariables } from 'twenty-ui/theme-constants';
import { MetadataTranslationProvenance } from '~/generated-metadata/graphql';
@@ -139,11 +139,13 @@ export const SidePanelSettingsMetadataTranslationsPage = () => {
<TableCell>
{isEdited && (
<LightIconButton
- Icon={IconRestore}
title={t`Reset to default`}
- accent="tertiary"
+ emphasis="subtle"
onClick={() => saveTranslationRow(row, null)}
- />
+ aria-label={t`Reset to default`}
+ >
+ <IconRestore />
+ </LightIconButton>
)}
</TableCell>
</TableRow>
diff --git a/packages/twenty-front/src/modules/side-panel/pages/email-block-settings/components/EmailBoxSidesInput.tsx b/packages/twenty-front/src/modules/side-panel/pages/email-block-settings/components/EmailBoxSidesInput.tsx
index e9277be564f..ea03ac78b9f 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/email-block-settings/components/EmailBoxSidesInput.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/email-block-settings/components/EmailBoxSidesInput.tsx
@@ -2,7 +2,7 @@ import { styled } from '@linaria/react';
import { useLingui } from '@lingui/react/macro';
import { useState } from 'react';
import { IconFrame, IconSquare } from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { themeCssVariables } from 'twenty-ui/theme-constants';
import { StyledEmailFieldLabel } from '@/side-panel/pages/email-block-settings/components/StyledEmailFieldLabel';
@@ -127,24 +127,28 @@ export const EmailBoxSidesInput = ({
)}
<StyledUnitChip>px</StyledUnitChip>
<LightIconButton
- Icon={IconSquare}
- size="small"
- accent={isPerSide ? 'tertiary' : 'secondary'}
+ size="sm"
+ emphasis={isPerSide ? 'subtle' : 'standard'}
title={t`Same value on every side`}
aria-pressed={!isPerSide}
onClick={() => {
setIsPerSide(false);
commitAllSides(toDisplayAmount(sides.top));
}}
- />
+ aria-label={t`Same value on every side`}
+ >
+ <IconSquare />
+ </LightIconButton>
<LightIconButton
- Icon={IconFrame}
- size="small"
- accent={isPerSide ? 'secondary' : 'tertiary'}
+ size="sm"
+ emphasis={isPerSide ? 'standard' : 'subtle'}
title={t`Edit each side`}
aria-pressed={isPerSide}
onClick={() => setIsPerSide(true)}
- />
+ aria-label={t`Edit each side`}
+ >
+ <IconFrame />
+ </LightIconButton>
</StyledRow>
</div>
);
diff --git a/packages/twenty-front/src/modules/side-panel/pages/email-block-settings/components/SidePanelEmailBlockSettingsPage.tsx b/packages/twenty-front/src/modules/side-panel/pages/email-block-settings/components/SidePanelEmailBlockSettingsPage.tsx
index a033c70b087..5ba37dc2cbd 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/email-block-settings/components/SidePanelEmailBlockSettingsPage.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/email-block-settings/components/SidePanelEmailBlockSettingsPage.tsx
@@ -7,7 +7,7 @@ import {
TIPTAP_NODE_TYPES,
} from 'twenty-shared/utils';
import { IconTrash } from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { themeCssVariables } from 'twenty-ui/theme-constants';
import { activeEmailEditorState } from '@/activities/emails/states/activeEmailEditorState';
@@ -182,12 +182,14 @@ const EmailBlockSettingsContent = ({ editor }: { editor: Editor }) => {
<StyledBlockHeader>
<StyledBlockTitle>{i18n._(blockDefinition.label)}</StyledBlockTitle>
<LightIconButton
- Icon={IconTrash}
- size="small"
- accent="tertiary"
+ size="sm"
+ emphasis="subtle"
title={t`Remove block`}
onClick={handleRemoveBlock}
- />
+ aria-label={t`Remove block`}
+ >
+ <IconTrash />
+ </LightIconButton>
</StyledBlockHeader>
{fields.map((field) => {
const key = `${target.nodeType}-${target.pos}-${field.property}`;
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableFieldsDropdownHiddenFieldsContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableFieldsDropdownHiddenFieldsContent.tsx
index 37f6816b3b7..d5598538453 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableFieldsDropdownHiddenFieldsContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableFieldsDropdownHiddenFieldsContent.tsx
@@ -1,3 +1,4 @@
+import { LightIconButton } from 'twenty-ui/components';
import { useActiveFieldMetadataItems } from '@/object-metadata/hooks/useActiveFieldMetadataItems';
import { useObjectMetadataItemById } from '@/object-metadata/hooks/useObjectMetadataItemById';
import { useUpdateRecordField } from '@/object-record/record-field/hooks/useUpdateRecordField';
@@ -104,12 +105,14 @@ export const RecordTableFieldsDropdownHiddenFieldsContent = ({
<MenuItem
key={fieldMetadataItem.id}
LeftIcon={getIcon(fieldMetadataItem.icon)}
- iconButtons={[
- {
- Icon: IconEye,
- onClick: () => handleShowField(fieldMetadataItem.id),
- },
- ]}
+ iconButtons={
+ <LightIconButton
+ aria-label={t`Show field`}
+ onClick={() => handleShowField(fieldMetadataItem.id)}
+ >
+ <IconEye />
+ </LightIconButton>
+ }
text={fieldMetadataItem.label}
/>
))}
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableFieldsDropdownVisibleFieldsContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableFieldsDropdownVisibleFieldsContent.tsx
index e98dc348553..423dcca25f5 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableFieldsDropdownVisibleFieldsContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableFieldsDropdownVisibleFieldsContent.tsx
@@ -1,3 +1,4 @@
+import { LightIconButton } from 'twenty-ui/components';
import { useGetFieldMetadataItemByIdOrThrow } from '@/object-metadata/hooks/useGetFieldMetadataItemById';
import { useObjectMetadataItemById } from '@/object-metadata/hooks/useObjectMetadataItemById';
import { getLabelIdentifierFieldMetadataItem } from '@/object-metadata/utils/getLabelIdentifierFieldMetadataItem';
@@ -133,15 +134,16 @@ export const RecordTableFieldsDropdownVisibleFieldsContent = ({
itemComponent={
<MenuItemDraggable
LeftIcon={getIcon(fieldMetadataItem.icon)}
- iconButtons={[
- {
- Icon: IconEyeOff,
- onClick: () =>
- handleHideField(
- recordField.fieldMetadataItemId,
- ),
- },
- ]}
+ iconButtons={
+ <LightIconButton
+ aria-label={t`Hide field`}
+ onClick={() =>
+ handleHideField(recordField.fieldMetadataItemId)
+ }
+ >
+ <IconEyeOff />
+ </LightIconButton>
+ }
text={fieldMetadataItem.label}
gripMode="always"
/>
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableSettingsFieldVisibility.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableSettingsFieldVisibility.tsx
index 410fcf21502..11d0efb82ef 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableSettingsFieldVisibility.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableSettingsFieldVisibility.tsx
@@ -1,3 +1,5 @@
+import { t } from '@lingui/core/macro';
+import { LightIconButton } from 'twenty-ui/components';
import { useRecordTableWidgetViewFieldItems } from '@/page-layout/widgets/record-table/hooks/useRecordTableWidgetViewFieldItems';
import { useReorderRecordTableWidgetFields } from '@/page-layout/widgets/record-table/hooks/useReorderRecordTableWidgetFields';
import { useToggleRecordTableWidgetFieldVisibility } from '@/page-layout/widgets/record-table/hooks/useToggleRecordTableWidgetFieldVisibility';
@@ -95,17 +97,19 @@ export const RecordTableSettingsFieldVisibility = ({
itemComponent={
<MenuItemDraggable
LeftIcon={getIcon(fieldItem.fieldMetadataItem.icon)}
- iconButtons={[
- {
- Icon: IconEyeOff,
- onClick: () => {
+ iconButtons={
+ <LightIconButton
+ aria-label={t`Hide field`}
+ onClick={() => {
toggleRecordTableWidgetFieldVisibility(
fieldItem.viewField.id,
false,
);
- },
- },
- ]}
+ }}
+ >
+ <IconEyeOff />
+ </LightIconButton>
+ }
text={fieldItem.fieldMetadataItem.label}
gripMode="always"
/>
@@ -123,17 +127,19 @@ export const RecordTableSettingsFieldVisibility = ({
<MenuItemDraggable
key={fieldItem.viewField.id}
LeftIcon={getIcon(fieldItem.fieldMetadataItem.icon)}
- iconButtons={[
- {
- Icon: IconEye,
- onClick: () => {
+ iconButtons={
+ <LightIconButton
+ aria-label={t`Show field`}
+ onClick={() => {
toggleRecordTableWidgetFieldVisibility(
fieldItem.viewField.id,
true,
);
- },
- },
- ]}
+ }}
+ >
+ <IconEye />
+ </LightIconButton>
+ }
text={fieldItem.fieldMetadataItem.label}
accent="placeholder"
isDragDisabled
diff --git a/packages/twenty-front/src/modules/sign-in-background-mock/components/BackgroundMockPage.tsx b/packages/twenty-front/src/modules/sign-in-background-mock/components/BackgroundMockPage.tsx
index 5af639c6e6f..1938097576a 100644
--- a/packages/twenty-front/src/modules/sign-in-background-mock/components/BackgroundMockPage.tsx
+++ b/packages/twenty-front/src/modules/sign-in-background-mock/components/BackgroundMockPage.tsx
@@ -7,7 +7,8 @@ import {
IconLayoutSidebarRight,
IconPlus,
} from 'twenty-ui/icon';
-import { Button, LightIconButton } from 'twenty-ui/primitives/input';
+import { Button } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { BackgroundMockTable } from '@/sign-in-background-mock/components/BackgroundMockTable';
import { BackgroundMockViewBar } from '@/sign-in-background-mock/components/BackgroundMockViewBar';
@@ -39,10 +40,12 @@ export const BackgroundMockPage = () => {
color="accent"
>{t`New Company`}</Button>
<LightIconButton
- Icon={IconDotsVertical}
- accent="tertiary"
- size="small"
- />
+ emphasis="subtle"
+ size="sm"
+ aria-label={t`More options`}
+ >
+ <IconDotsVertical />
+ </LightIconButton>
<Button
startIcon={<IconLayoutSidebarRight />}
aria-label={t`Open side panel`}
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 8cab81716b0..c12e949dc81 100644
--- a/packages/twenty-front/src/modules/ui/input/components/IconPicker.tsx
+++ b/packages/twenty-front/src/modules/ui/input/components/IconPicker.tsx
@@ -12,9 +12,8 @@ import { IconApps, type IconComponent, useIcons } from 'twenty-ui/icon';
import {
type ButtonSize,
type ButtonVariant,
- LightIconButton,
} from 'twenty-ui/primitives/input';
-import { IconButton } from 'twenty-ui/components';
+import { IconButton, LightIconButton } from 'twenty-ui/components';
import { type ThemeColor } from 'twenty-ui/theme';
import { themeCssVariables } from 'twenty-ui/theme-constants';
@@ -117,16 +116,12 @@ const IconPickerSearchRow = ({
}}
dropdownPlacement="right-start"
clickableComponent={
- <LightIconButton
- accent="secondary"
- Icon={() => (
- <ColorSample
- colorName={iconColorPicker.selectedColor}
- variant="circle"
- />
- )}
- size="small"
- />
+ <LightIconButton aria-label={t`Choose icon color`}>
+ <ColorSample
+ colorName={iconColorPicker.selectedColor}
+ variant="circle"
+ />
+ </LightIconButton>
}
dropdownComponents={
<DropdownContent
@@ -164,8 +159,9 @@ const focusedIconButtonStyle = css`
background: ${themeCssVariables.background.transparent.light};
`;
-type StyledLightIconButtonProps = React.ComponentProps<
- typeof LightIconButton
+type StyledLightIconButtonProps = Pick<
+ React.ComponentProps<typeof LightIconButton>,
+ 'aria-label' | 'children' | 'size' | 'title' | 'onClick' | 'className'
> & {
isSelected?: boolean;
isFocused?: boolean;
@@ -176,29 +172,21 @@ const StyledLightIconButton = ({
isFocused,
className,
'aria-label': ariaLabel,
+ children,
size,
title,
- Icon,
onClick,
- testId,
- active,
- accent,
- disabled,
- focus,
}: StyledLightIconButtonProps) => (
<LightIconButton
aria-label={ariaLabel}
size={size}
title={title}
- Icon={Icon}
onClick={onClick}
- testId={testId}
- active={active}
- accent={accent}
- disabled={disabled}
- focus={focus}
+ aria-pressed={isSelected}
className={`${className ?? ''} ${isSelected ? selectedIconButtonStyle : isFocused ? focusedIconButtonStyle : ''}`}
- />
+ >
+ {children}
+ </LightIconButton>
);
const StyledLoadingMore = styled.div`
@@ -249,23 +237,20 @@ const IconPickerIcon = ({
<StyledLightIconButton
key={iconKey}
aria-label={convertIconKeyToLabel(iconKey)}
- size="medium"
+ size="md"
title={iconKey}
isSelected={iconKey === selectedIconKey || !!selectedItemId}
isFocused={iconKey === focusedIconKey}
- Icon={(iconProps) => (
- <Icon
- // oxlint-disable-next-line react/jsx-props-no-spreading
- {...iconProps}
- color={
- isDefined(color)
- ? getIconTileColorShades(color).iconColor
- : iconProps.color
- }
- />
- )}
onClick={onSelect}
- />
+ >
+ <Icon
+ color={
+ isDefined(color)
+ ? getIconTileColorShades(color).iconColor
+ : undefined
+ }
+ />
+ </StyledLightIconButton>
</SelectableListItem>
</StyledMatrixItem>
);
diff --git a/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DatePickerHeader.tsx b/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DatePickerHeader.tsx
index 59d188cfa87..337fc29f271 100644
--- a/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DatePickerHeader.tsx
+++ b/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DatePickerHeader.tsx
@@ -1,3 +1,4 @@
+import { t } from '@lingui/core/macro';
import { styled } from '@linaria/react';
import { Select } from '@/ui/input/components/Select';
@@ -6,7 +7,7 @@ import { DatePickerInput } from '@/ui/input/components/internal/date/components/
import { getMonthSelectOptions } from '@/ui/input/components/internal/date/utils/getMonthSelectOptions';
import { ClickOutsideListenerContext } from '@/ui/utilities/pointer-event/contexts/ClickOutsideListenerContext';
import { IconChevronLeft, IconChevronRight } from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { Temporal } from 'temporal-polyfill';
@@ -93,17 +94,21 @@ export const DatePickerHeader = ({
/>
</ClickOutsideListenerContext.Provider>
<LightIconButton
- Icon={IconChevronLeft}
onClick={onSubtractMonth}
- size="medium"
+ size="md"
disabled={prevMonthButtonDisabled}
- />
+ aria-label={t`Previous`}
+ >
+ <IconChevronLeft />
+ </LightIconButton>
<LightIconButton
- Icon={IconChevronRight}
onClick={onAddMonth}
- size="medium"
+ size="md"
disabled={nextMonthButtonDisabled}
- />
+ aria-label={t`Next`}
+ >
+ <IconChevronRight />
+ </LightIconButton>
</StyledCustomDatePickerHeader>
</>
);
diff --git a/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DateTimePickerHeader.tsx b/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DateTimePickerHeader.tsx
index 2fd8cc26b8a..0b21eade249 100644
--- a/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DateTimePickerHeader.tsx
+++ b/packages/twenty-front/src/modules/ui/input/components/internal/date/components/DateTimePickerHeader.tsx
@@ -24,7 +24,7 @@ import {
IconChevronRight,
IconClock,
} from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { themeCssVariables } from 'twenty-ui/theme-constants';
import {
@@ -224,11 +224,9 @@ export const DateTimePickerHeader = ({
<Dropdown
dropdownId={DATE_TIME_PICKER_MONTH_YEAR_PANEL_DROPDOWN_ID}
clickableComponent={
- <LightIconButton
- Icon={IconCalendar}
- size="medium"
- aria-label={t`Select month and year`}
- />
+ <LightIconButton size="md" aria-label={t`Select month and year`}>
+ <IconCalendar />
+ </LightIconButton>
}
dropdownPlacement="bottom-start"
dropdownOffset={{ y: 8 }}
@@ -274,17 +272,21 @@ export const DateTimePickerHeader = ({
/>
<StyledNavigationButtons>
<LightIconButton
- Icon={IconChevronLeft}
onClick={onSubtractMonth}
- size="medium"
+ size="md"
disabled={prevMonthButtonDisabled}
- />
+ aria-label={t`Previous`}
+ >
+ <IconChevronLeft />
+ </LightIconButton>
<LightIconButton
- Icon={IconChevronRight}
onClick={onAddMonth}
- size="medium"
+ size="md"
disabled={nextMonthButtonDisabled}
- />
+ aria-label={t`Next`}
+ >
+ <IconChevronRight />
+ </LightIconButton>
</StyledNavigationButtons>
</StyledRightControls>
</StyledTimeRow>
diff --git a/packages/twenty-front/src/modules/ui/input/components/internal/date/components/RelativeDatePickerCalendarNavigation.tsx b/packages/twenty-front/src/modules/ui/input/components/internal/date/components/RelativeDatePickerCalendarNavigation.tsx
index 9e5c672dbcc..c2d1ea5092b 100644
--- a/packages/twenty-front/src/modules/ui/input/components/internal/date/components/RelativeDatePickerCalendarNavigation.tsx
+++ b/packages/twenty-front/src/modules/ui/input/components/internal/date/components/RelativeDatePickerCalendarNavigation.tsx
@@ -1,9 +1,10 @@
+import { t } from '@lingui/core/macro';
import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { styled } from '@linaria/react';
import { SOURCE_LOCALE } from 'twenty-shared/translations';
import { IconChevronLeft, IconChevronRight } from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { themeCssVariables } from 'twenty-ui/theme-constants';
const StyledContainer = styled.div`
@@ -46,18 +47,22 @@ export const RelativeDatePickerCalendarNavigation = ({
return (
<StyledContainer>
<LightIconButton
- Icon={IconChevronLeft}
onClick={onPreviousMonth}
- size="medium"
+ size="md"
disabled={prevMonthButtonDisabled}
- />
+ aria-label={t`Previous`}
+ >
+ <IconChevronLeft />
+ </LightIconButton>
<StyledMonthYearLabel>{monthYearLabel}</StyledMonthYearLabel>
<LightIconButton
- Icon={IconChevronRight}
onClick={onNextMonth}
- size="medium"
+ size="md"
disabled={nextMonthButtonDisabled}
- />
+ aria-label={t`Next`}
+ >
+ <IconChevronRight />
+ </LightIconButton>
</StyledContainer>
);
};
diff --git a/packages/twenty-front/src/modules/ui/layout/dropdown/components/DropdownMenuHeader/internal/DropdownMenuHeaderLeftComponent.tsx b/packages/twenty-front/src/modules/ui/layout/dropdown/components/DropdownMenuHeader/internal/DropdownMenuHeaderLeftComponent.tsx
index 325747a4bf1..0a67d390647 100644
--- a/packages/twenty-front/src/modules/ui/layout/dropdown/components/DropdownMenuHeader/internal/DropdownMenuHeaderLeftComponent.tsx
+++ b/packages/twenty-front/src/modules/ui/layout/dropdown/components/DropdownMenuHeader/internal/DropdownMenuHeaderLeftComponent.tsx
@@ -1,3 +1,4 @@
+import { t } from '@lingui/core/macro';
import { type MouseEvent, type ReactElement, useContext } from 'react';
import { styled } from '@linaria/react';
import {
@@ -5,7 +6,7 @@ import {
type AvatarProps,
} from 'twenty-ui/primitives/data-display';
import { type IconComponent } from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants';
const StyledNonClickableStartIcon = styled.div`
@@ -46,11 +47,13 @@ export const DropdownMenuHeaderLeftComponent = ({
{'Icon' in props &&
(onClick ? (
<LightIconButton
- Icon={props.Icon}
- accent="tertiary"
- size="small"
+ emphasis="subtle"
+ size="sm"
onClick={onClick}
- />
+ aria-label={t`Go back`}
+ >
+ <props.Icon />
+ </LightIconButton>
) : (
<StyledNonClickableStartIcon>
<props.Icon
diff --git a/packages/twenty-front/src/modules/ui/layout/page/components/PageHeader.tsx b/packages/twenty-front/src/modules/ui/layout/page/components/PageHeader.tsx
index 4440c5d40d5..258df35575a 100644
--- a/packages/twenty-front/src/modules/ui/layout/page/components/PageHeader.tsx
+++ b/packages/twenty-front/src/modules/ui/layout/page/components/PageHeader.tsx
@@ -1,3 +1,4 @@
+import { t } from '@lingui/core/macro';
import { styled } from '@linaria/react';
import { type ReactNode, useContext } from 'react';
@@ -12,7 +13,7 @@ import { AnimatePresence } from 'framer-motion';
import { isDefined } from 'twenty-shared/utils';
import { type IconComponent, IconX } from 'twenty-ui/icon';
import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import {
MOBILE_VIEWPORT,
ThemeContext,
@@ -115,11 +116,13 @@ export const PageHeader = ({
)}
{hasClosePageButton && (
<LightIconButton
- Icon={IconX}
- size="small"
- accent="tertiary"
+ size="sm"
+ emphasis="subtle"
onClick={() => onClosePage?.()}
- />
+ aria-label={t`Close page`}
+ >
+ <IconX />
+ </LightIconButton>
)}
<StyledTopBarIconStyledTitleContainer>
diff --git a/packages/twenty-front/src/modules/ui/navigation/menu-item/components/MenuItemWithOptionDropdown.tsx b/packages/twenty-front/src/modules/ui/navigation/menu-item/components/MenuItemWithOptionDropdown.tsx
index c1304760243..98a79f84894 100644
--- a/packages/twenty-front/src/modules/ui/navigation/menu-item/components/MenuItemWithOptionDropdown.tsx
+++ b/packages/twenty-front/src/modules/ui/navigation/menu-item/components/MenuItemWithOptionDropdown.tsx
@@ -1,21 +1,14 @@
+import { t } from '@lingui/core/macro';
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
import { type Placement } from '@floating-ui/react';
-import {
- type FunctionComponent,
- type MouseEvent,
- type ReactElement,
- type ReactNode,
- useContext,
-} from 'react';
+import { type MouseEvent, type ReactNode, useContext } from 'react';
import {
IconChevronRight,
type IconComponent,
IconDotsVertical,
} from 'twenty-ui/icon';
-import {
- LightIconButton,
- type LightIconButtonProps,
-} from 'twenty-ui/primitives/input';
+import { isDefined } from 'twenty-shared/utils';
+import { LightIconButton } from 'twenty-ui/components';
import {
type MenuItemAccent,
MenuItemLeftContent,
@@ -24,13 +17,6 @@ import {
} from 'twenty-ui/primitives/navigation';
import { ThemeContext } from 'twenty-ui/theme-constants';
-export type MenuItemIconButton = {
- Wrapper?: FunctionComponent<{ iconButton: ReactElement }>;
- Icon: IconComponent;
- accent?: LightIconButtonProps['accent'];
- onClick?: (event: MouseEvent<any>) => void;
-};
-
export type MenuItemWithOptionDropdownProps = {
accent?: MenuItemAccent;
className?: string;
@@ -95,10 +81,12 @@ export const MenuItemWithOptionDropdown = ({
<Dropdown
clickableComponent={
<LightIconButton
- Icon={RightIcon ?? IconDotsVertical}
- size="small"
- accent="tertiary"
- />
+ size="sm"
+ emphasis="subtle"
+ aria-label={t`More options`}
+ >
+ {isDefined(RightIcon) ? <RightIcon /> : <IconDotsVertical />}
+ </LightIconButton>
}
dropdownPlacement={dropdownPlacement}
dropdownComponents={dropdownContent}
diff --git a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/MultiWorkspaceDropdownDefaultComponents.tsx b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/MultiWorkspaceDropdownDefaultComponents.tsx
index b8de0307102..400c631a57f 100644
--- a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/MultiWorkspaceDropdownDefaultComponents.tsx
+++ b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/MultiWorkspaceDropdownDefaultComponents.tsx
@@ -37,7 +37,7 @@ import {
IconSwitchHorizontal,
IconUserPlus,
} from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import {
MenuItem,
MenuItemSelectAvatar,
@@ -121,10 +121,12 @@ export const MultiWorkspaceDropdownDefaultComponents = () => {
<Dropdown
clickableComponent={
<LightIconButton
- Icon={IconDotsVertical}
- size="small"
- accent="tertiary"
- />
+ size="sm"
+ emphasis="subtle"
+ aria-label={t`More options`}
+ >
+ <IconDotsVertical />
+ </LightIconButton>
}
dropdownId="multi-workspace-dropdown-context-menu"
dropdownComponents={
diff --git a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/NavigationDrawerCollapseButton.tsx b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/NavigationDrawerCollapseButton.tsx
index 87454504d0d..ae8a3669f61 100644
--- a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/NavigationDrawerCollapseButton.tsx
+++ b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/NavigationDrawerCollapseButton.tsx
@@ -4,7 +4,7 @@ import { useToggleNavigationDrawer } from '@/navigation/hooks/useToggleNavigatio
import { TooltipDelay } from '@/ui/layout/tooltip/constants/TooltipDelay';
import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';
import { styled } from '@linaria/react';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { Tooltip } from 'twenty-ui/primitives/surfaces';
import { themeCssVariables } from 'twenty-ui/theme-constants';
@@ -48,12 +48,13 @@ export const NavigationDrawerCollapseButton = ({
>
<StyledCollapseButton className={className}>
<LightIconButton
- Icon={Icon}
- accent="secondary"
- size="small"
+ emphasis="standard"
+ size="sm"
onClick={toggleNavigationDrawer}
aria-label={label}
- />
+ >
+ <Icon />
+ </LightIconButton>
</StyledCollapseButton>
</Tooltip>
);
diff --git a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/NavigationDrawerHeader.tsx b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/NavigationDrawerHeader.tsx
index f98384d5799..8c70ec9f0a2 100644
--- a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/NavigationDrawerHeader.tsx
+++ b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/NavigationDrawerHeader.tsx
@@ -3,7 +3,7 @@ import { APP_HEADER_HEIGHT } from '@/ui/layout/constants/AppHeaderHeight';
import { styled } from '@linaria/react';
import { t } from '@lingui/core/macro';
import { IconSearch } from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { MOBILE_VIEWPORT, themeCssVariables } from 'twenty-ui/theme-constants';
import { useOpenRecordsSearchPageInSidePanel } from '@/side-panel/hooks/useOpenRecordsSearchPageInSidePanel';
@@ -88,12 +88,13 @@ export const NavigationDrawerHeader = () => {
const searchButton = !isMobile && (
<StyledSearchButtonContainer isExpanded={isExpanded}>
<LightIconButton
- Icon={IconSearch}
- accent="secondary"
- size="small"
+ emphasis="standard"
+ size="sm"
onClick={openRecordsSearchPage}
aria-label={t`Search`}
- />
+ >
+ <IconSearch />
+ </LightIconButton>
</StyledSearchButtonContainer>
);
diff --git a/packages/twenty-front/src/modules/views/components/ViewFieldsHiddenDropdownSection.tsx b/packages/twenty-front/src/modules/views/components/ViewFieldsHiddenDropdownSection.tsx
index 294907896f5..5b3d6ac615b 100644
--- a/packages/twenty-front/src/modules/views/components/ViewFieldsHiddenDropdownSection.tsx
+++ b/packages/twenty-front/src/modules/views/components/ViewFieldsHiddenDropdownSection.tsx
@@ -1,3 +1,5 @@
+import { t } from '@lingui/core/macro';
+import { LightIconButton } from 'twenty-ui/components';
import { useActiveFieldMetadataItems } from '@/object-metadata/hooks/useActiveFieldMetadataItems';
import { useObjectOptionsForBoard } from '@/object-record/object-options-dropdown/hooks/useObjectOptionsForBoard';
import { ObjectOptionsDropdownContext } from '@/object-record/object-options-dropdown/states/contexts/ObjectOptionsDropdownContext';
@@ -59,16 +61,19 @@ export const ViewFieldsHiddenDropdownSection = () => {
<MenuItem
key={fieldMetadataItem.id}
LeftIcon={getIcon(fieldMetadataItem.icon)}
- iconButtons={[
- {
- Icon: IconEye,
- onClick: () =>
+ iconButtons={
+ <LightIconButton
+ aria-label={t`Show field`}
+ onClick={() =>
handleChangeFieldVisibility({
fieldMetadataId: fieldMetadataItem.id,
isVisible: true,
- }),
- },
- ]}
+ })
+ }
+ >
+ <IconEye />
+ </LightIconButton>
+ }
text={fieldMetadataItem.label}
/>
);
diff --git a/packages/twenty-front/src/modules/views/components/ViewFieldsSearchDropdownSection.tsx b/packages/twenty-front/src/modules/views/components/ViewFieldsSearchDropdownSection.tsx
index b1fce37457c..0e7558900c3 100644
--- a/packages/twenty-front/src/modules/views/components/ViewFieldsSearchDropdownSection.tsx
+++ b/packages/twenty-front/src/modules/views/components/ViewFieldsSearchDropdownSection.tsx
@@ -1,3 +1,4 @@
+import { LightIconButton } from 'twenty-ui/components';
import { useActiveFieldMetadataItems } from '@/object-metadata/hooks/useActiveFieldMetadataItems';
import { getLabelIdentifierFieldMetadataItem } from '@/object-metadata/utils/getLabelIdentifierFieldMetadataItem';
import { useObjectOptionsForBoard } from '@/object-record/object-options-dropdown/hooks/useObjectOptionsForBoard';
@@ -76,18 +77,19 @@ export const ViewFieldsSearchDropdownSection = ({
key={fieldMetadataItem.id}
LeftIcon={getIcon(fieldMetadataItem.icon)}
iconButtons={
- isLabelIdentifier
- ? undefined
- : [
- {
- Icon: isVisible ? IconEyeOff : IconEye,
- onClick: () =>
- handleChangeFieldVisibility({
- fieldMetadataId: fieldMetadataItem.id,
- isVisible: !isVisible,
- }),
- },
- ]
+ isLabelIdentifier ? undefined : (
+ <LightIconButton
+ aria-label={isVisible ? t`Hide field` : t`Show field`}
+ onClick={() =>
+ handleChangeFieldVisibility({
+ fieldMetadataId: fieldMetadataItem.id,
+ isVisible: !isVisible,
+ })
+ }
+ >
+ {isVisible ? <IconEyeOff /> : <IconEye />}
+ </LightIconButton>
+ )
}
text={fieldMetadataItem.label}
/>
diff --git a/packages/twenty-front/src/modules/views/components/ViewFieldsVisibleDropdownSection.tsx b/packages/twenty-front/src/modules/views/components/ViewFieldsVisibleDropdownSection.tsx
index de6c17725ec..007ad656ad5 100644
--- a/packages/twenty-front/src/modules/views/components/ViewFieldsVisibleDropdownSection.tsx
+++ b/packages/twenty-front/src/modules/views/components/ViewFieldsVisibleDropdownSection.tsx
@@ -1,3 +1,5 @@
+import { t } from '@lingui/core/macro';
+import { LightIconButton } from 'twenty-ui/components';
import { type DraggableListDropResult } from '@/ui/layout/draggable-list/types/DraggableListDropResult';
import { useGetFieldMetadataItemByIdOrThrow } from '@/object-metadata/hooks/useGetFieldMetadataItemById';
@@ -111,18 +113,20 @@ export const ViewFieldsVisibleDropdownSection = () => {
<MenuItemDraggable
key={recordField.fieldMetadataItemId}
LeftIcon={getIcon(fieldMetadataItem.icon)}
- iconButtons={[
- {
- Icon: IconEyeOff,
- onClick: () => {
+ iconButtons={
+ <LightIconButton
+ aria-label={t`Hide field`}
+ onClick={() => {
handleChangeFieldVisibility({
fieldMetadataId:
recordField.fieldMetadataItemId,
isVisible: false,
});
- },
- },
- ]}
+ }}
+ >
+ <IconEyeOff />
+ </LightIconButton>
+ }
text={fieldMetadataItem.label}
gripMode="always"
/>
diff --git a/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-edges/components/WorkflowDiagramDefaultEdgeEditable.tsx b/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-edges/components/WorkflowDiagramDefaultEdgeEditable.tsx
index 00a2a077d7a..2eb0759d097 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-edges/components/WorkflowDiagramDefaultEdgeEditable.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-edges/components/WorkflowDiagramDefaultEdgeEditable.tsx
@@ -1,3 +1,4 @@
+import { LightIconButton } from 'twenty-ui/components';
import { useStartNodeCreation } from '@/workflow/workflow-diagram/hooks/useStartNodeCreation';
import { WorkflowDiagramBaseEdge } from '@/workflow/workflow-diagram/workflow-edges/components/WorkflowDiagramBaseEdge';
import { WorkflowDiagramEdgeButtonGroup } from '@/workflow/workflow-diagram/workflow-edges/components/WorkflowDiagramEdgeButtonGroup';
@@ -135,25 +136,26 @@ export const WorkflowDiagramDefaultEdgeEditable = ({
})
}
>
- <WorkflowDiagramEdgeButtonGroup
- iconButtons={[
- {
- Icon: IconPlus,
- ariaLabel: t`Insert action`,
- onClick: handleNodeButtonClick,
- },
- ...(deletable === false
- ? []
- : [
- {
- Icon: IconTrash,
- ariaLabel: t`Delete connection`,
- onClick: handleDeleteBranch,
- },
- ]),
- ]}
- selected={nodeCreationStarted}
- />
+ <WorkflowDiagramEdgeButtonGroup selected={nodeCreationStarted}>
+ <LightIconButton
+ size="xs"
+ emphasis="subtle"
+ aria-label={t`Insert action`}
+ onClick={handleNodeButtonClick}
+ >
+ <IconPlus />
+ </LightIconButton>
+ {deletable !== false && (
+ <LightIconButton
+ size="xs"
+ emphasis="subtle"
+ aria-label={t`Delete connection`}
+ onClick={handleDeleteBranch}
+ >
+ <IconTrash />
+ </LightIconButton>
+ )}
+ </WorkflowDiagramEdgeButtonGroup>
</WorkflowDiagramEdgeV2VisibilityContainer>
</WorkflowDiagramEdgeV2Container>
</EdgeLabelRenderer>
diff --git a/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-edges/components/WorkflowDiagramEdgeButtonGroup.tsx b/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-edges/components/WorkflowDiagramEdgeButtonGroup.tsx
index 3b1a4d76085..1e74979ef4d 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-edges/components/WorkflowDiagramEdgeButtonGroup.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-edges/components/WorkflowDiagramEdgeButtonGroup.tsx
@@ -1,35 +1,43 @@
import { styled } from '@linaria/react';
-import {
- IconButtonGroup,
- type IconButtonGroupProps,
-} from 'twenty-ui/primitives/input';
+import { useLingui } from '@lingui/react/macro';
+import { ButtonGroup } from 'twenty-ui/primitives/input';
+import { type ReactNode } from 'react';
import { themeCssVariables } from 'twenty-ui/theme-constants';
-const StyledIconButtonGroupContainer = styled.div`
+const StyledButtonGroupContainer = styled.div`
pointer-events: all;
`;
-const StyledSelectedIconButtonGroupContainer = styled.div`
+const StyledSelectedButtonGroupContainer = styled.div`
background-color: ${themeCssVariables.color.blue2};
border-color: ${themeCssVariables.color.blue};
pointer-events: all;
`;
-type WorkflowDiagramEdgeButtonGroupProps = IconButtonGroupProps & {
+type WorkflowDiagramEdgeButtonGroupProps = {
+ children: ReactNode;
selected?: boolean;
};
export const WorkflowDiagramEdgeButtonGroup = ({
selected = false,
- iconButtons,
+ children,
}: WorkflowDiagramEdgeButtonGroupProps) => {
+ const { t } = useLingui();
const Container = selected
- ? StyledSelectedIconButtonGroupContainer
- : StyledIconButtonGroupContainer;
+ ? StyledSelectedButtonGroupContainer
+ : StyledButtonGroupContainer;
return (
<Container>
- <IconButtonGroup className="nodrag nopan" iconButtons={iconButtons} />
+ <ButtonGroup
+ aria-label={t`Workflow connection controls`}
+ framed
+ attached={false}
+ className="nodrag nopan"
+ >
+ {children}
+ </ButtonGroup>
</Container>
);
};
diff --git a/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-edges/components/__tests__/WorkflowDiagramDefaultEdgeEditable.test.tsx b/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-edges/components/__tests__/WorkflowDiagramDefaultEdgeEditable.test.tsx
index 68baf587345..669fce1b8ba 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-edges/components/__tests__/WorkflowDiagramDefaultEdgeEditable.test.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/workflow-edges/components/__tests__/WorkflowDiagramDefaultEdgeEditable.test.tsx
@@ -26,18 +26,10 @@ jest.mock(
'@/workflow/workflow-diagram/workflow-edges/components/WorkflowDiagramEdgeButtonGroup',
() => ({
WorkflowDiagramEdgeButtonGroup: ({
- iconButtons,
+ children,
}: {
- iconButtons: Array<{ onClick: () => void; ariaLabel: string }>;
- }) => (
- <>
- {iconButtons.map((iconButton) => (
- <button key={iconButton.ariaLabel} onClick={iconButton.onClick}>
- {iconButton.ariaLabel}
- </button>
- ))}
- </>
- ),
+ children: React.ReactNode;
+ }) => children,
}),
);
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionsFlagRow.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionsFlagRow.tsx
index 8ccaff4edef..241fdfce65b 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionsFlagRow.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionsFlagRow.tsx
@@ -1,3 +1,5 @@
+import { t } from '@lingui/core/macro';
+import { LightIconButton } from 'twenty-ui/components';
import { type SettingsRolePermissionsSettingPermission } from '@/settings/roles/role-permissions/permission-flags/types/SettingsRolePermissionsSettingPermission';
import { IconTrash } from 'twenty-ui/icon';
import { MenuItem } from 'twenty-ui/primitives/navigation';
@@ -23,18 +25,6 @@ export const WorkflowAiAgentPermissionsFlagRow = ({
const isDisabled = isEnabled && !showDeleteButton;
const showTrashButton = isEnabled && showDeleteButton;
- const iconButtons = showTrashButton
- ? [
- {
- Icon: IconTrash,
- onClick: (event: React.MouseEvent) => {
- event.stopPropagation();
- onDelete?.();
- },
- },
- ]
- : undefined;
-
return (
<MenuItem
LeftIcon={permission.Icon}
@@ -42,7 +32,19 @@ export const WorkflowAiAgentPermissionsFlagRow = ({
text={permission.name}
onClick={isClickable ? onAdd : undefined}
disabled={isDisabled}
- iconButtons={iconButtons}
+ iconButtons={
+ showTrashButton && (
+ <LightIconButton
+ aria-label={t`Remove permission`}
+ onClick={(event) => {
+ event.stopPropagation();
+ onDelete?.();
+ }}
+ >
+ <IconTrash />
+ </LightIconButton>
+ )
+ }
/>
);
};
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionsPermissionRow.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionsPermissionRow.tsx
index f37652e1a2d..6dcd3ca9c0d 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionsPermissionRow.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowAiAgentPermissionsPermissionRow.tsx
@@ -1,3 +1,5 @@
+import { t } from '@lingui/core/macro';
+import { LightIconButton } from 'twenty-ui/components';
import { PermissionIcon } from '@/settings/roles/role-permissions/objects-permissions/components/PermissionIcon';
import { type SettingsRoleObjectPermissionKey } from '@/settings/roles/role-permissions/objects-permissions/constants/SettingsRoleObjectPermissionIconConfig';
import { IconTrash } from 'twenty-ui/icon';
@@ -29,18 +31,6 @@ export const WorkflowAiAgentPermissionsPermissionRow = ({
const isDisabled = isEnabled && !showDeleteButton;
const showTrashButton = isEnabled && showDeleteButton;
- const iconButtons = showTrashButton
- ? [
- {
- Icon: IconTrash,
- onClick: (event: React.MouseEvent) => {
- event.stopPropagation();
- onDelete?.();
- },
- },
- ]
- : undefined;
-
return (
<MenuItem
LeftComponent={
@@ -52,7 +42,19 @@ export const WorkflowAiAgentPermissionsPermissionRow = ({
text={permission.label}
onClick={isClickable ? onAdd : undefined}
disabled={isDisabled}
- iconButtons={iconButtons}
+ iconButtons={
+ showTrashButton && (
+ <LightIconButton
+ aria-label={t`Remove permission`}
+ onClick={(event) => {
+ event.stopPropagation();
+ onDelete?.();
+ }}
+ >
+ <IconTrash />
+ </LightIconButton>
+ )
+ }
/>
);
};
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowOutputSchemaBuilder.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowOutputSchemaBuilder.tsx
index a522ad20e68..44a1c95943a 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowOutputSchemaBuilder.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowOutputSchemaBuilder.tsx
@@ -6,8 +6,8 @@ import { createDefaultOutputSchemaField } from '@/ai/utils/createDefaultOutputSc
import {
InputLabel,
AnimatedLightIconButton,
- LightIconButton,
} from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { styled } from '@linaria/react';
import { t } from '@lingui/core/macro';
import { useContext, useState } from 'react';
@@ -201,13 +201,15 @@ export const WorkflowOutputSchemaBuilder = ({
/>
{showRemoveFieldButton && (
<LightIconButton
- testId="remove-output-field-button"
- Icon={IconX}
- size="small"
+ data-testid="remove-output-field-button"
+ size="sm"
onClick={() => {
removeField(field.id);
}}
- />
+ aria-label={t`Remove output field`}
+ >
+ <IconX />
+ </LightIconButton>
)}
</StyledSettingsHeader>
<AnimatedExpandableContainer
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/code-action/components/WorkflowCodeEditor.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/code-action/components/WorkflowCodeEditor.tsx
index ea62c55b159..af06b2b26f7 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/code-action/components/WorkflowCodeEditor.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/code-action/components/WorkflowCodeEditor.tsx
@@ -4,8 +4,8 @@ import { useLingui } from '@lingui/react/macro';
import { type Monaco } from '@monaco-editor/react';
import { type editor } from 'monaco-editor';
import { IconMaximize } from 'twenty-ui/icon';
+import { LightIconButton } from 'twenty-ui/components';
import { CodeEditor } from 'twenty-ui/components/code-editor';
-import { LightIconButton } from 'twenty-ui/primitives/input';
import { themeCssVariables } from 'twenty-ui/theme-constants';
const CODE_EDITOR_MIN_HEIGHT = 343;
@@ -52,12 +52,14 @@ export const WorkflowCodeEditor = ({
{!readonly && !fullScreenMode && onEnterFullScreen && (
<StyledFullScreenButtonContainer>
<LightIconButton
- Icon={IconMaximize}
onClick={onEnterFullScreen}
title={t`Expand to Full Screen`}
- size="small"
- accent="tertiary"
- />
+ size="sm"
+ emphasis="subtle"
+ aria-label={t`Expand to Full Screen`}
+ >
+ <IconMaximize />
+ </LightIconButton>
</StyledFullScreenButtonContainer>
)}
<CodeEditor
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowEditActionFormBuilder.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowEditActionFormBuilder.tsx
index 4cd141ee7d6..fac9af2026d 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowEditActionFormBuilder.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowEditActionFormBuilder.tsx
@@ -2,7 +2,8 @@ import { FormFieldInputContainer } from '@/ui/input/components/FormFieldInputCon
import { FormFieldInputInnerContainer } from '@/object-record/record-field/ui/form-types/components/FormFieldInputInnerContainer';
import { FormFieldInputRowContainer } from '@/object-record/record-field/ui/form-types/components/FormFieldInputRowContainer';
import { FormFieldPlaceholder } from '@/object-record/record-field/ui/form-types/components/FormFieldPlaceholder';
-import { InputLabel, LightIconButton } from 'twenty-ui/primitives/input';
+import { InputLabel } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { DraggableItem } from '@/ui/layout/draggable-list/components/DraggableItem';
import { DraggableList } from '@/ui/layout/draggable-list/components/DraggableList';
import { DragDropItemSortableHandle } from '@/ui/utilities/drag-and-drop/components/DragDropItemSortableHandle';
@@ -299,10 +300,9 @@ export const WorkflowEditActionFormBuilder = ({
{showButtons && (
<StyledGripButtonContainer>
<DragDropItemSortableHandle>
- <LightIconButton
- Icon={IconGripVertical}
- aria-label={t`Reorder field`}
- />
+ <LightIconButton aria-label={t`Reorder field`}>
+ <IconGripVertical />
+ </LightIconButton>
</DragDropItemSortableHandle>
</StyledGripButtonContainer>
)}
@@ -348,7 +348,6 @@ export const WorkflowEditActionFormBuilder = ({
{showButtons && (
<StyledTrashButtonContainer>
<LightIconButton
- Icon={IconTrash}
aria-label={t`Delete field`}
onClick={() => {
const updatedFormData = formData.filter(
@@ -366,7 +365,9 @@ export const WorkflowEditActionFormBuilder = ({
},
});
}}
- />
+ >
+ <IconTrash />
+ </LightIconButton>
</StyledTrashButtonContainer>
)}
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowEditActionFormFieldSettings.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowEditActionFormFieldSettings.tsx
index 2a971361ea1..60e37b94d84 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowEditActionFormFieldSettings.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowEditActionFormFieldSettings.tsx
@@ -1,6 +1,7 @@
import { FormFieldInputContainer } from '@/ui/input/components/FormFieldInputContainer';
import { FormSelectFieldInput } from '@/object-record/record-field/ui/form-types/components/FormSelectFieldInput';
-import { InputLabel, LightIconButton } from 'twenty-ui/primitives/input';
+import { InputLabel } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { WorkflowFormFieldSettingsByType } from '@/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowFormFieldSettingsByType';
import { FORM_SELECT_FIELD_TYPE_OPTIONS } from '@/workflow/workflow-steps/workflow-actions/form-action/constants/FormSelectFieldTypeOptions';
import { type WorkflowFormActionField } from '@/workflow/workflow-steps/workflow-actions/form-action/types/WorkflowFormActionField';
@@ -75,12 +76,14 @@ export const WorkflowEditActionFormFieldSettings = ({
</StyledTitleContainer>
<StyledCloseButtonContainer>
<LightIconButton
- testId="close-button"
- Icon={IconX}
- size="small"
- accent="secondary"
+ data-testid="close-button"
+ size="sm"
+ emphasis="standard"
onClick={onClose}
- />
+ aria-label={t`Close`}
+ >
+ <IconX />
+ </LightIconButton>
</StyledCloseButtonContainer>
</StyledSettingsHeader>
<StyledSettingsContent>
diff --git a/packages/twenty-front/src/pages/settings/ai/components/SettingsAgentEvalsTab.tsx b/packages/twenty-front/src/pages/settings/ai/components/SettingsAgentEvalsTab.tsx
index f55a2e58c73..18d4e7e05cd 100644
--- a/packages/twenty-front/src/pages/settings/ai/components/SettingsAgentEvalsTab.tsx
+++ b/packages/twenty-front/src/pages/settings/ai/components/SettingsAgentEvalsTab.tsx
@@ -15,7 +15,7 @@ import { styled } from '@linaria/react';
import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { useNavigate } from 'react-router-dom';
-import { Section } from 'twenty-ui/components';
+import { Section, LightIconButton } from 'twenty-ui/components';
import { useToast } from 'twenty-ui/primitives/feedback';
import {
IconDotsVertical,
@@ -24,7 +24,8 @@ import {
IconPlus,
IconTrash,
} from 'twenty-ui/icon';
-import { Button, LightIconButton } from 'twenty-ui/primitives/input';
+import { Button } from 'twenty-ui/primitives/input';
+
import { MenuItem } from 'twenty-ui/primitives/navigation';
import { themeCssVariables } from 'twenty-ui/theme-constants';
import { v4 as uuidv4 } from 'uuid';
@@ -166,10 +167,12 @@ export const SettingsAgentEvalsTab = ({
dropdownPlacement="right-start"
clickableComponent={
<LightIconButton
- Icon={IconDotsVertical}
- accent="tertiary"
+ emphasis="subtle"
disabled={disabled}
- />
+ aria-label={t`More options`}
+ >
+ <IconDotsVertical />
+ </LightIconButton>
}
dropdownComponents={
<DropdownContent>
diff --git a/packages/twenty-front/src/pages/settings/ai/components/SettingsAgentLogsTab.tsx b/packages/twenty-front/src/pages/settings/ai/components/SettingsAgentLogsTab.tsx
index 4a279b1b8e7..2ec2dca2eb9 100644
--- a/packages/twenty-front/src/pages/settings/ai/components/SettingsAgentLogsTab.tsx
+++ b/packages/twenty-front/src/pages/settings/ai/components/SettingsAgentLogsTab.tsx
@@ -19,7 +19,8 @@ import {
AnimatedPlaceholderEmptyTitle,
useToast,
} from 'twenty-ui/primitives/feedback';
-import { Button, LightIconButton } from 'twenty-ui/primitives/input';
+import { Button } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { UndecoratedLink } from 'twenty-ui/primitives/navigation';
import { themeCssVariables } from 'twenty-ui/theme-constants';
import {
@@ -242,10 +243,12 @@ export const SettingsAgentLogsTab = ({
.replace(':turnId', turn.id)}
>
<LightIconButton
- Icon={IconChevronRight}
title={t`View all evaluations`}
- accent="tertiary"
- />
+ emphasis="subtle"
+ aria-label={t`View all evaluations`}
+ >
+ <IconChevronRight />
+ </LightIconButton>
</UndecoratedLink>
)}
</TableCell>
diff --git a/packages/twenty-front/src/pages/settings/ai/components/SettingsSkillInactiveMenuDropDown.tsx b/packages/twenty-front/src/pages/settings/ai/components/SettingsSkillInactiveMenuDropDown.tsx
index f4bb6e93219..77a904fbaf1 100644
--- a/packages/twenty-front/src/pages/settings/ai/components/SettingsSkillInactiveMenuDropDown.tsx
+++ b/packages/twenty-front/src/pages/settings/ai/components/SettingsSkillInactiveMenuDropDown.tsx
@@ -5,7 +5,7 @@ import { GenericDropdownContentWidth } from '@/ui/layout/dropdown/constants/Gene
import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';
import { t } from '@lingui/core/macro';
import { IconArchiveOff, IconDotsVertical, IconTrash } from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { MenuItem } from 'twenty-ui/primitives/navigation';
type SettingsSkillInactiveMenuDropDownProps = {
@@ -41,9 +41,10 @@ export const SettingsSkillInactiveMenuDropDown = ({
clickableComponent={
<LightIconButton
aria-label={t`Inactive Skill Options`}
- Icon={IconDotsVertical}
- accent="tertiary"
- />
+ emphasis="subtle"
+ >
+ <IconDotsVertical />
+ </LightIconButton>
}
dropdownComponents={
<DropdownContent widthInPixels={GenericDropdownContentWidth.Narrow}>
diff --git a/packages/twenty-front/src/pages/settings/data-model/SettingsObjectIndexTable.tsx b/packages/twenty-front/src/pages/settings/data-model/SettingsObjectIndexTable.tsx
index 4f41c23299e..df3bf68561e 100644
--- a/packages/twenty-front/src/pages/settings/data-model/SettingsObjectIndexTable.tsx
+++ b/packages/twenty-front/src/pages/settings/data-model/SettingsObjectIndexTable.tsx
@@ -10,7 +10,7 @@ import { styled } from '@linaria/react';
import { msg } from '@lingui/core/macro';
import { useLingui } from '@lingui/react/macro';
import { IconSquareKey, IconTrash } from 'twenty-ui/icon';
-import { LightIconButton } from 'twenty-ui/primitives/input';
+import { LightIconButton } from 'twenty-ui/components';
import { themeCssVariables } from 'twenty-ui/theme-constants';
import { type SettingsObjectIndexesTableItem } from '~/pages/settings/data-model/types/SettingsObjectIndexesTableItem';
@@ -115,10 +115,12 @@ export const SettingsObjectIndexTable = ({
<StyledActionCell>
{item.isCustom && !isReadOnly && (
<LightIconButton
- Icon={IconTrash}
- accent="tertiary"
+ emphasis="subtle"
onClick={() => onDeleteIndex(item)}
- />
+ aria-label={t`Delete index`}
+ >
+ <IconTrash />
+ </LightIconButton>
)}
</StyledActionCell>
</TableRow>
diff --git a/packages/twenty-shared/src/constants/DocumentationPaths.ts b/packages/twenty-shared/src/constants/DocumentationPaths.ts
index c0eb2632aec..e836ca8cfc2 100644
--- a/packages/twenty-shared/src/constants/DocumentationPaths.ts
+++ b/packages/twenty-shared/src/constants/DocumentationPaths.ts
@@ -131,6 +131,8 @@ export const DOCUMENTATION_PATHS = {
UI_COMPONENTS_CODE_EDITOR: '/ui/components/code-editor',
UI_COMPONENTS_INPUT_ICON_BUTTON: '/ui/components/input/icon-button',
UI_COMPONENTS_INPUT_LIGHT_BUTTON: '/ui/components/input/light-button',
+ UI_COMPONENTS_INPUT_LIGHT_ICON_BUTTON:
+ '/ui/components/input/light-icon-button',
UI_COMPONENTS_INPUT_MAIN_BUTTON: '/ui/components/input/main-button',
UI_COMPONENTS_OVERVIEW: '/ui/components/overview',
UI_COMPONENTS_SECTION: '/ui/components/section',
diff --git a/packages/twenty-ui/.storybook/vitest.setup.ts b/packages/twenty-ui/.storybook/vitest.setup.ts
index 91a5f5bed19..d9a976787bb 100644
--- a/packages/twenty-ui/.storybook/vitest.setup.ts
+++ b/packages/twenty-ui/.storybook/vitest.setup.ts
@@ -1,8 +1,13 @@
import * as a11yAddonAnnotations from '@storybook/addon-a11y/preview';
import { setProjectAnnotations } from '@storybook/react-vite';
+import * as pseudoStatesAddonAnnotations from 'storybook-addon-pseudo-states/preview';
import * as projectAnnotations from './preview';
// Apply Storybook's preview configuration to Vitest runs.
// The a11y addon annotations register the axe afterEach hook so that
// parameters.a11y.test = 'error' (set in preview.tsx) actually gates tests.
-setProjectAnnotations([a11yAddonAnnotations, projectAnnotations]);
+setProjectAnnotations([
+ a11yAddonAnnotations,
+ pseudoStatesAddonAnnotations,
+ projectAnnotations,
+]);
diff --git a/packages/twenty-ui/docs/buttonGroupPropDescriptions.ts b/packages/twenty-ui/docs/buttonGroupPropDescriptions.ts
index a083d4982b2..d0d2a4747f0 100644
--- a/packages/twenty-ui/docs/buttonGroupPropDescriptions.ts
+++ b/packages/twenty-ui/docs/buttonGroupPropDescriptions.ts
@@ -1,6 +1,10 @@
import { type ButtonGroupProps } from '../src/primitives/input/ButtonGroup/types/ButtonGroupProps';
export const BUTTON_GROUP_PROP_DESCRIPTIONS = {
+ attached:
+ 'Join adjacent controls. Set to false for independently rounded buttons with a 2px gap.',
+ framed:
+ 'Add a translucent frame with padding and concentric corners. Button sizes and appearance remain independent unless set on the group.',
variant:
'Shared surface treatment that overrides the variant of buttons in the group.',
color:
diff --git a/packages/twenty-ui/docs/components.ts b/packages/twenty-ui/docs/components.ts
index 148271ed65f..4ef94598545 100644
--- a/packages/twenty-ui/docs/components.ts
+++ b/packages/twenty-ui/docs/components.ts
@@ -1,3 +1,4 @@
+import { LIGHT_ICON_BUTTON_PROP_DESCRIPTIONS } from './lightIconButtonPropDescriptions';
import { DIALOG_PROP_DESCRIPTIONS } from './dialogPropDescriptions';
import { AVATAR_PROP_DESCRIPTIONS } from './avatarPropDescriptions';
import { BUTTON_GROUP_PROP_DESCRIPTIONS } from './buttonGroupPropDescriptions';
@@ -17,6 +18,13 @@ import { TOOLTIP_PART_PROP_DESCRIPTIONS } from './tooltipPartPropDescriptions';
import { TOOLTIP_PROP_DESCRIPTIONS } from './tooltipPropDescriptions';
export const DOCUMENTED_COMPONENTS = [
+ {
+ name: 'LightIconButton',
+ source: 'components/LightIconButton/LightIconButton.tsx',
+ entryPoint: 'twenty-ui/components',
+ slug: 'input/light-icon-button',
+ propDescriptions: LIGHT_ICON_BUTTON_PROP_DESCRIPTIONS,
+ },
{
name: 'IconButton',
source: 'components/IconButton/IconButton.tsx',
diff --git a/packages/twenty-ui/docs/iconButtonPropDescriptions.ts b/packages/twenty-ui/docs/iconButtonPropDescriptions.ts
index 35cac26c481..57fde53dae7 100644
--- a/packages/twenty-ui/docs/iconButtonPropDescriptions.ts
+++ b/packages/twenty-ui/docs/iconButtonPropDescriptions.ts
@@ -3,7 +3,8 @@ import { BUTTON_PROP_DESCRIPTIONS } from './buttonPropDescriptions';
export const ICON_BUTTON_PROP_DESCRIPTIONS = {
...BUTTON_PROP_DESCRIPTIONS,
- size: 'Square button size: `sm` (24px) or `md` (32px).',
+ size: 'Button size: `xs` (20px), `sm` (24px), or `md` (32px).',
+ shape: 'Square or round icon control.',
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.',
diff --git a/packages/twenty-ui/docs/lightIconButtonPropDescriptions.ts b/packages/twenty-ui/docs/lightIconButtonPropDescriptions.ts
new file mode 100644
index 00000000000..91ddc3df4da
--- /dev/null
+++ b/packages/twenty-ui/docs/lightIconButtonPropDescriptions.ts
@@ -0,0 +1,8 @@
+import { type LightIconButtonProps } from '../src/components/LightIconButton/types/LightIconButtonProps';
+import { ICON_BUTTON_PROP_DESCRIPTIONS } from './iconButtonPropDescriptions';
+
+export const LIGHT_ICON_BUTTON_PROP_DESCRIPTIONS = {
+ ...ICON_BUTTON_PROP_DESCRIPTIONS,
+ emphasis:
+ 'Standard secondary text or subtle tertiary text. Semantic colors and solid surfaces keep their own colors.',
+} satisfies Partial<Record<keyof LightIconButtonProps, string>>;
diff --git a/packages/twenty-ui/docs/normalizeDocumentationPropType.ts b/packages/twenty-ui/docs/normalizeDocumentationPropType.ts
index ca0cee8774d..f45d5ec45cc 100644
--- a/packages/twenty-ui/docs/normalizeDocumentationPropType.ts
+++ b/packages/twenty-ui/docs/normalizeDocumentationPropType.ts
@@ -8,10 +8,19 @@ export const normalizeDocumentationPropType = ({
required: boolean;
}): string => {
if (type.name === 'enum' && type.value !== undefined) {
- return type.value
+ const values = type.value
.map((option) => option.value)
- .filter((value) => required || value !== 'undefined')
- .join(' | ');
+ .filter((value) => required || value !== 'undefined');
+ const hasOnlyNumericValues = values.every((value) =>
+ Number.isFinite(Number(value)),
+ );
+ const orderedValues = values.sort((left, right) =>
+ hasOnlyNumericValues
+ ? Number(left) - Number(right)
+ : left.localeCompare(right, 'en'),
+ );
+
+ return orderedValues.join(' | ');
}
if (!required && type.name.endsWith(OPTIONAL_UNDEFINED_SUFFIX)) {
diff --git a/packages/twenty-ui/generated/components.docs.json b/packages/twenty-ui/generated/components.docs.json
index 7af96514a2f..3548c234e7d 100644
--- a/packages/twenty-ui/generated/components.docs.json
+++ b/packages/twenty-ui/generated/components.docs.json
@@ -1,4 +1,130 @@
[
+ {
+ "name": "LightIconButton",
+ "entryPoint": "twenty-ui/components",
+ "slug": "input/light-icon-button",
+ "props": [
+ {
+ "name": "aria-label",
+ "type": "string",
+ "required": true,
+ "defaultValue": null,
+ "description": "Required accessible name describing the action."
+ },
+ {
+ "name": "children",
+ "type": "ReactNode",
+ "required": true,
+ "defaultValue": null,
+ "description": "Icon content. Decorative and hidden from assistive technology."
+ },
+ {
+ "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": "\"accent\" | \"danger\" | \"neutral\" | \"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": "emphasis",
+ "type": "\"standard\" | \"subtle\"",
+ "required": false,
+ "defaultValue": "standard",
+ "description": "Standard secondary text or subtle tertiary text. Semantic colors and solid surfaces keep their own colors."
+ },
+ {
+ "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": "shape",
+ "type": "\"round\" | \"square\"",
+ "required": false,
+ "defaultValue": null,
+ "description": "Square or round icon control."
+ },
+ {
+ "name": "size",
+ "type": "\"md\" | \"sm\" | \"xs\"",
+ "required": false,
+ "defaultValue": "sm",
+ "description": "Button size: `xs` (20px), `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": "number",
+ "required": false,
+ "defaultValue": null,
+ "description": "Delay before showing the tooltip."
+ },
+ {
+ "name": "tooltipOffset",
+ "type": "number",
+ "required": false,
+ "defaultValue": null,
+ "description": "Distance in pixels between the button and the tooltip."
+ },
+ {
+ "name": "tooltipPlace",
+ "type": "\"bottom\" | \"left\" | \"right\" | \"top\"",
+ "required": false,
+ "defaultValue": null,
+ "description": "Preferred placement of the tooltip relative to the button."
+ },
+ {
+ "name": "variant",
+ "type": "\"ghost\" | \"outline\" | \"soft\" | \"solid\"",
+ "required": false,
+ "defaultValue": "ghost",
+ "description": "Visual treatment of the button surface."
+ }
+ ]
+ },
{
"name": "IconButton",
"entryPoint": "twenty-ui/components",
@@ -27,7 +153,7 @@
},
{
"name": "color",
- "type": "\"neutral\" | \"accent\" | \"danger\" | \"success\"",
+ "type": "\"accent\" | \"danger\" | \"neutral\" | \"success\"",
"required": false,
"defaultValue": null,
"description": "Semantic color of the button."
@@ -60,12 +186,19 @@
"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": "shape",
+ "type": "\"round\" | \"square\"",
+ "required": false,
+ "defaultValue": "square",
+ "description": "Square or round icon control."
+ },
{
"name": "size",
- "type": "\"sm\" | \"md\"",
+ "type": "\"md\" | \"sm\" | \"xs\"",
"required": false,
- "defaultValue": null,
- "description": "Square button size: `sm` (24px) or `md` (32px)."
+ "defaultValue": "md",
+ "description": "Button size: `xs` (20px), `sm` (24px), or `md` (32px)."
},
{
"name": "style",
@@ -97,14 +230,14 @@
},
{
"name": "tooltipPlace",
- "type": "\"top\" | \"right\" | \"bottom\" | \"left\"",
+ "type": "\"bottom\" | \"left\" | \"right\" | \"top\"",
"required": false,
"defaultValue": "bottom",
"description": "Preferred placement of the tooltip relative to the button."
},
{
"name": "variant",
- "type": "\"solid\" | \"outline\" | \"ghost\" | \"soft\"",
+ "type": "\"ghost\" | \"outline\" | \"soft\" | \"solid\"",
"required": false,
"defaultValue": null,
"description": "Visual treatment of the button surface."
@@ -125,7 +258,7 @@
},
{
"name": "color",
- "type": "\"neutral\" | \"accent\" | \"danger\" | \"success\"",
+ "type": "\"accent\" | \"danger\" | \"neutral\" | \"success\"",
"required": false,
"defaultValue": null,
"description": "Semantic color of the button."
@@ -181,7 +314,7 @@
},
{
"name": "size",
- "type": "\"sm\" | \"md\"",
+ "type": "\"md\" | \"sm\"",
"required": false,
"defaultValue": null,
"description": "Button height: `sm` (24px) or `md` (32px)."
@@ -216,7 +349,7 @@
},
{
"name": "variant",
- "type": "\"solid\" | \"outline\" | \"ghost\" | \"soft\"",
+ "type": "\"ghost\" | \"outline\" | \"soft\" | \"solid\"",
"required": false,
"defaultValue": "solid",
"description": "Visual treatment of the button surface."
@@ -237,7 +370,7 @@
},
{
"name": "color",
- "type": "\"neutral\" | \"accent\" | \"danger\" | \"success\"",
+ "type": "\"accent\" | \"danger\" | \"neutral\" | \"success\"",
"required": false,
"defaultValue": null,
"description": "Semantic color of the button."
@@ -300,7 +433,7 @@
},
{
"name": "size",
- "type": "\"sm\" | \"md\"",
+ "type": "\"md\" | \"sm\"",
"required": false,
"defaultValue": "sm",
"description": "Button height: `sm` (24px) or `md` (32px)."
@@ -335,7 +468,7 @@
},
{
"name": "variant",
- "type": "\"solid\" | \"outline\" | \"ghost\" | \"soft\"",
+ "type": "\"ghost\" | \"outline\" | \"soft\" | \"solid\"",
"required": false,
"defaultValue": "ghost",
"description": "Visual treatment of the button surface."
@@ -356,7 +489,7 @@
},
{
"name": "color",
- "type": "\"neutral\" | \"accent\" | \"danger\" | \"success\"",
+ "type": "\"accent\" | \"danger\" | \"neutral\" | \"success\"",
"required": false,
"defaultValue": "neutral",
"description": "Semantic color of the button."
@@ -412,7 +545,7 @@
},
{
"name": "size",
- "type": "\"sm\" | \"md\"",
+ "type": "\"md\" | \"sm\"",
"required": false,
"defaultValue": "md",
"description": "Button height: `sm` (24px) or `md` (32px)."
@@ -447,7 +580,7 @@
},
{
"name": "variant",
- "type": "\"solid\" | \"outline\" | \"ghost\" | \"soft\"",
+ "type": "\"ghost\" | \"outline\" | \"soft\" | \"solid\"",
"required": false,
"defaultValue": "outline",
"description": "Visual treatment of the button surface."
@@ -459,13 +592,27 @@
"entryPoint": "twenty-ui/primitives/input",
"slug": "input/button-group",
"props": [
+ {
+ "name": "attached",
+ "type": "boolean",
+ "required": false,
+ "defaultValue": "true",
+ "description": "Join adjacent controls. Set to false for independently rounded buttons with a 2px gap."
+ },
{
"name": "color",
- "type": "\"neutral\" | \"accent\" | \"danger\" | \"success\"",
+ "type": "\"accent\" | \"danger\" | \"neutral\" | \"success\"",
"required": false,
"defaultValue": null,
"description": "Shared semantic color that overrides the color of buttons in the group."
},
+ {
+ "name": "framed",
+ "type": "boolean",
+ "required": false,
+ "defaultValue": "false",
+ "description": "Add a translucent frame with padding and concentric corners. Button sizes and appearance remain independent unless set on the group."
+ },
{
"name": "render",
"type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, {}>",
@@ -475,14 +622,14 @@
},
{
"name": "size",
- "type": "\"sm\" | \"md\"",
+ "type": "\"md\" | \"sm\"",
"required": false,
"defaultValue": null,
"description": "Shared button height that overrides the size of buttons in the group."
},
{
"name": "variant",
- "type": "\"solid\" | \"outline\" | \"ghost\" | \"soft\"",
+ "type": "\"ghost\" | \"outline\" | \"soft\" | \"solid\"",
"required": false,
"defaultValue": null,
"description": "Shared surface treatment that overrides the variant of buttons in the group."
@@ -765,7 +912,7 @@
},
{
"name": "size",
- "type": "\"sm\" | \"md\"",
+ "type": "\"md\" | \"sm\"",
"required": false,
"defaultValue": null,
"description": "Visual size of the input. Inside an `InputGroup`, the group's size applies."
@@ -807,7 +954,7 @@
},
{
"name": "size",
- "type": "\"sm\" | \"md\"",
+ "type": "\"md\" | \"sm\"",
"required": false,
"defaultValue": "md",
"description": "Visual size of the group and its input."
@@ -863,7 +1010,7 @@
},
{
"name": "size",
- "type": "\"sm\" | \"md\"",
+ "type": "\"md\" | \"sm\"",
"required": false,
"defaultValue": "md",
"description": "Visual size of the textarea."
@@ -996,14 +1143,14 @@
},
{
"name": "shape",
- "type": "\"square\" | \"round\"",
+ "type": "\"round\" | \"square\"",
"required": false,
"defaultValue": "square",
"description": "Corner shape of the box."
},
{
"name": "size",
- "type": "\"sm\" | \"md\"",
+ "type": "\"md\" | \"sm\"",
"required": false,
"defaultValue": "sm",
"description": "Visual size of the checkbox."
@@ -1031,7 +1178,7 @@
},
{
"name": "variant",
- "type": "\"solid\" | \"outline\" | \"soft\"",
+ "type": "\"outline\" | \"soft\" | \"solid\"",
"required": false,
"defaultValue": "solid",
"description": "Visual style of the box: filled, outlined, or tinted."
@@ -1094,7 +1241,7 @@
},
{
"name": "size",
- "type": "\"sm\" | \"md\"",
+ "type": "\"md\" | \"sm\"",
"required": false,
"defaultValue": "sm",
"description": "Visual size of the radio."
@@ -1411,7 +1558,7 @@
},
{
"name": "size",
- "type": "\"sm\" | \"md\"",
+ "type": "\"md\" | \"sm\"",
"required": false,
"defaultValue": "md",
"description": "Visual size of the trigger."
@@ -1470,7 +1617,7 @@
"props": [
{
"name": "align",
- "type": "\"center\" | \"start\" | \"end\"",
+ "type": "\"center\" | \"end\" | \"start\"",
"required": false,
"defaultValue": "start",
"description": "How to align the popup relative to the specified side."
@@ -1526,7 +1673,7 @@
},
{
"name": "side",
- "type": "\"top\" | \"right\" | \"bottom\" | \"left\" | \"inline-end\" | \"inline-start\"",
+ "type": "\"bottom\" | \"inline-end\" | \"inline-start\" | \"left\" | \"right\" | \"top\"",
"required": false,
"defaultValue": "bottom",
"description": "Which side of the anchor element to align the popup against.\nMay automatically change to avoid collisions."
@@ -1566,7 +1713,7 @@
},
{
"name": "descriptionPlacement",
- "type": "\"inline\" | \"end\"",
+ "type": "\"end\" | \"inline\"",
"required": false,
"defaultValue": "inline",
"description": "Where the description renders: inline after the content or at the end of\nthe row."
@@ -1853,7 +2000,7 @@
},
{
"name": "thumbAlignment",
- "type": "\"center\" | \"edge\" | \"edge-client-only\"",
+ "type": "\"center\" | \"edge-client-only\" | \"edge\"",
"required": false,
"defaultValue": "edge",
"description": "How the thumb(s) are aligned relative to `Slider.Control` when the value is at `min` or `max`:\n- `center`: The center of the thumb is aligned with the control edge\n- `edge`: The thumb is inset within the control such that its edge is aligned with the control edge\n- `edge-client-only`: Same as `edge` but renders after React hydration on the client, reducing bundle size in return"
@@ -2200,7 +2347,7 @@
},
{
"name": "size",
- "type": "\"sm\" | \"md\"",
+ "type": "\"md\" | \"sm\"",
"required": false,
"defaultValue": "md",
"description": "Visual size of the switch."
@@ -2242,7 +2389,7 @@
},
{
"name": "color",
- "type": "\"neutral\" | \"danger\"",
+ "type": "\"danger\" | \"neutral\"",
"required": false,
"defaultValue": "neutral",
"description": "Color of the text and icons. `danger` marks a destructive action."
@@ -2256,7 +2403,7 @@
},
{
"name": "descriptionPlacement",
- "type": "\"inline\" | \"end\"",
+ "type": "\"end\" | \"inline\"",
"required": false,
"defaultValue": "inline",
"description": "Where the description renders: inline after the content or at the end of\nthe row."
@@ -2298,7 +2445,7 @@
},
{
"name": "indicator",
- "type": "\"none\" | \"checkbox\" | \"check\"",
+ "type": "\"check\" | \"checkbox\" | \"none\"",
"required": false,
"defaultValue": "none",
"description": "Selection indicator: a check icon after the content or a checkbox before\nit."
@@ -2480,7 +2627,7 @@
},
{
"name": "size",
- "type": "\"sm\" | \"md\"",
+ "type": "\"md\" | \"sm\"",
"required": false,
"defaultValue": "sm",
"description": "Visual size of the tab."
@@ -2746,7 +2893,7 @@
},
{
"name": "size",
- "type": "\"sm\" | \"md\" | \"lg\" | \"xl\" | \"fullscreen\"",
+ "type": "\"fullscreen\" | \"lg\" | \"md\" | \"sm\" | \"xl\"",
"required": false,
"defaultValue": "md",
"description": ""
@@ -2786,7 +2933,7 @@
},
{
"name": "level",
- "type": "5 | 1 | 2 | 3 | 4 | 6",
+ "type": "1 | 2 | 3 | 4 | 5 | 6",
"required": false,
"defaultValue": "2",
"description": "Semantic heading level, from `h1` through `h6`. Does not change the visual size. Defaults to `2`."
@@ -2800,7 +2947,7 @@
},
{
"name": "size",
- "type": "\"sm\" | \"md\" | \"lg\" | \"xs\"",
+ "type": "\"lg\" | \"md\" | \"sm\" | \"xs\"",
"required": false,
"defaultValue": "lg",
"description": "Visual font size, independent of the heading level. Defaults to `lg`."
@@ -3086,7 +3233,7 @@
},
{
"name": "size",
- "type": "\"sm\" | \"md\" | \"lg\" | \"xl\" | \"fullscreen\"",
+ "type": "\"fullscreen\" | \"lg\" | \"md\" | \"sm\" | \"xl\"",
"required": false,
"defaultValue": "md",
"description": "Width of the dialog, or `fullscreen` to fill the viewport."
@@ -3419,7 +3566,7 @@
"props": [
{
"name": "align",
- "type": "\"center\" | \"start\" | \"end\"",
+ "type": "\"center\" | \"end\" | \"start\"",
"required": false,
"defaultValue": null,
"description": "Alignment of the popup along the anchor. Defaults to `start`."
@@ -3475,7 +3622,7 @@
},
{
"name": "side",
- "type": "\"top\" | \"right\" | \"bottom\" | \"left\" | \"inline-end\" | \"inline-start\"",
+ "type": "\"bottom\" | \"inline-end\" | \"inline-start\" | \"left\" | \"right\" | \"top\"",
"required": false,
"defaultValue": null,
"description": "Side of the anchor the popup is placed on. Defaults to `bottom` for a menu\nand `inline-end` for a submenu."
@@ -3515,7 +3662,7 @@
},
{
"name": "color",
- "type": "\"neutral\" | \"danger\"",
+ "type": "\"danger\" | \"neutral\"",
"required": false,
"defaultValue": null,
"description": "Color of the text and icons. `danger` marks a destructive action."
@@ -3529,7 +3676,7 @@
},
{
"name": "descriptionPlacement",
- "type": "\"inline\" | \"end\"",
+ "type": "\"end\" | \"inline\"",
"required": false,
"defaultValue": null,
"description": "Where the description renders: inline after the content or at the end of\nthe row."
@@ -3625,7 +3772,7 @@
},
{
"name": "color",
- "type": "\"neutral\" | \"danger\"",
+ "type": "\"danger\" | \"neutral\"",
"required": false,
"defaultValue": null,
"description": "Color of the text and icons. `danger` marks a destructive action."
@@ -3646,7 +3793,7 @@
},
{
"name": "descriptionPlacement",
- "type": "\"inline\" | \"end\"",
+ "type": "\"end\" | \"inline\"",
"required": false,
"defaultValue": null,
"description": "Where the description renders: inline after the content or at the end of\nthe row."
@@ -3803,7 +3950,7 @@
},
{
"name": "color",
- "type": "\"neutral\" | \"danger\"",
+ "type": "\"danger\" | \"neutral\"",
"required": false,
"defaultValue": null,
"description": "Color of the text and icons. `danger` marks a destructive action."
@@ -3817,7 +3964,7 @@
},
{
"name": "descriptionPlacement",
- "type": "\"inline\" | \"end\"",
+ "type": "\"end\" | \"inline\"",
"required": false,
"defaultValue": null,
"description": "Where the description renders: inline after the content or at the end of\nthe row."
@@ -4087,7 +4234,7 @@
},
{
"name": "color",
- "type": "\"neutral\" | \"danger\"",
+ "type": "\"danger\" | \"neutral\"",
"required": false,
"defaultValue": null,
"description": "Color of the text and icons. `danger` marks a destructive action."
@@ -4108,7 +4255,7 @@
},
{
"name": "descriptionPlacement",
- "type": "\"inline\" | \"end\"",
+ "type": "\"end\" | \"inline\"",
"required": false,
"defaultValue": null,
"description": "Where the description renders: inline after the content or at the end of\nthe row."
@@ -4348,7 +4495,7 @@
"props": [
{
"name": "align",
- "type": "\"center\" | \"start\" | \"end\"",
+ "type": "\"center\" | \"end\" | \"start\"",
"required": false,
"defaultValue": "center",
"description": "Alignment of the popup along the anchor."
@@ -4418,7 +4565,7 @@
},
{
"name": "side",
- "type": "\"top\" | \"right\" | \"bottom\" | \"left\" | \"inline-end\" | \"inline-start\"",
+ "type": "\"bottom\" | \"inline-end\" | \"inline-start\" | \"left\" | \"right\" | \"top\"",
"required": false,
"defaultValue": "bottom",
"description": "Side of the anchor the popup is placed on."
@@ -4540,7 +4687,7 @@
},
{
"name": "align",
- "type": "\"center\" | \"start\" | \"end\"",
+ "type": "\"center\" | \"end\" | \"start\"",
"required": false,
"defaultValue": null,
"description": "Alignment relative to the trigger. Defaults to center."
@@ -4722,7 +4869,7 @@
},
{
"name": "side",
- "type": "\"top\" | \"right\" | \"bottom\" | \"left\"",
+ "type": "\"bottom\" | \"left\" | \"right\" | \"top\"",
"required": false,
"defaultValue": null,
"description": "Preferred side of the trigger. Defaults to top and may change to avoid collisions."
@@ -4750,7 +4897,7 @@
},
{
"name": "trackCursorAxis",
- "type": "\"none\" | \"both\" | \"x\" | \"y\"",
+ "type": "\"both\" | \"none\" | \"x\" | \"y\"",
"required": false,
"defaultValue": "none",
"description": "Determines which axis the tooltip should track the cursor on."
@@ -4839,7 +4986,7 @@
},
{
"name": "trackCursorAxis",
- "type": "\"none\" | \"both\" | \"x\" | \"y\"",
+ "type": "\"both\" | \"none\" | \"x\" | \"y\"",
"required": false,
"defaultValue": "none",
"description": "Determines which axis the tooltip should track the cursor on."
@@ -4926,7 +5073,7 @@
"props": [
{
"name": "align",
- "type": "\"center\" | \"start\" | \"end\"",
+ "type": "\"center\" | \"end\" | \"start\"",
"required": false,
"defaultValue": "center",
"description": "Alignment relative to the trigger. Defaults to center."
@@ -5024,7 +5171,7 @@
},
{
"name": "side",
- "type": "\"top\" | \"right\" | \"bottom\" | \"left\"",
+ "type": "\"bottom\" | \"left\" | \"right\" | \"top\"",
"required": false,
"defaultValue": "top",
"description": "Preferred side of the trigger. Defaults to top and may change to avoid collisions."
@@ -5190,7 +5337,7 @@
},
{
"name": "variant",
- "type": "\"success\" | \"warning\" | \"default\" | \"error\" | \"info\"",
+ "type": "\"default\" | \"error\" | \"info\" | \"success\" | \"warning\"",
"required": false,
"defaultValue": "default",
"description": "Visual variant that selects the icon and colors."
@@ -5309,14 +5456,14 @@
},
{
"name": "shape",
- "type": "\"circle\" | \"square\" | \"rounded-square\"",
+ "type": "\"circle\" | \"rounded-square\" | \"square\"",
"required": false,
"defaultValue": "square",
"description": "Shape of the avatar and its fallback."
},
{
"name": "size",
- "type": "\"sm\" | \"md\" | \"lg\" | \"xl\" | \"xs\"",
+ "type": "\"lg\" | \"md\" | \"sm\" | \"xl\" | \"xs\"",
"required": false,
"defaultValue": "md",
"description": "Avatar size: `xs` (12px), `sm` (14px), `md` (16px), `lg` (24px), or `xl` (40px)."
@@ -5435,14 +5582,14 @@
},
{
"name": "shape",
- "type": "\"square\" | \"round\"",
+ "type": "\"round\" | \"square\"",
"required": false,
"defaultValue": "square",
"description": "Square or round corners."
},
{
"name": "size",
- "type": "\"sm\" | \"md\"",
+ "type": "\"md\" | \"sm\"",
"required": false,
"defaultValue": "sm",
"description": "Visual size of the chip."
@@ -5463,21 +5610,21 @@
},
{
"name": "tooltipPlace",
- "type": "\"top\" | \"right\" | \"bottom\" | \"left\"",
+ "type": "\"bottom\" | \"left\" | \"right\" | \"top\"",
"required": false,
"defaultValue": null,
"description": "Position of the string-label tooltip."
},
{
"name": "variant",
- "type": "\"solid\" | \"ghost\" | \"soft\"",
+ "type": "\"ghost\" | \"soft\" | \"solid\"",
"required": false,
"defaultValue": "ghost",
"description": "Background treatment of the chip."
},
{
"name": "weight",
- "type": "\"regular\" | \"medium\"",
+ "type": "\"medium\" | \"regular\"",
"required": false,
"defaultValue": "regular",
"description": "Font weight of the label."
@@ -5491,14 +5638,14 @@
"props": [
{
"name": "borderStyle",
- "type": "\"solid\" | \"dashed\"",
+ "type": "\"dashed\" | \"solid\"",
"required": false,
"defaultValue": "solid",
"description": "Border style used by the outline variant."
},
{
"name": "color",
- "type": "\"ruby\" | \"red\" | \"crimson\" | \"tomato\" | \"orange\" | \"amber\" | \"yellow\" | \"lime\" | \"grass\" | \"green\" | \"jade\" | \"mint\" | \"turquoise\" | \"cyan\" | \"sky\" | \"blue\" | \"iris\" | \"violet\" | \"purple\" | \"plum\" | \"pink\" | \"bronze\" | \"gold\" | \"brown\" | \"gray\" | \"transparent\"",
+ "type": "\"amber\" | \"blue\" | \"bronze\" | \"brown\" | \"crimson\" | \"cyan\" | \"gold\" | \"grass\" | \"gray\" | \"green\" | \"iris\" | \"jade\" | \"lime\" | \"mint\" | \"orange\" | \"pink\" | \"plum\" | \"purple\" | \"red\" | \"ruby\" | \"sky\" | \"tomato\" | \"transparent\" | \"turquoise\" | \"violet\" | \"yellow\"",
"required": true,
"defaultValue": null,
"description": "Theme color for the tag, or `transparent` for an unfilled label."
@@ -5547,14 +5694,14 @@
},
{
"name": "variant",
- "type": "\"solid\" | \"outline\" | \"ghost\" | \"soft\"",
+ "type": "\"ghost\" | \"outline\" | \"soft\" | \"solid\"",
"required": false,
"defaultValue": "soft",
"description": "Visual treatment of the tag background and border."
},
{
"name": "weight",
- "type": "\"regular\" | \"medium\"",
+ "type": "\"medium\" | \"regular\"",
"required": false,
"defaultValue": "regular",
"description": "Font weight of the label."
@@ -5568,7 +5715,7 @@
"props": [
{
"name": "color",
- "type": "\"ruby\" | \"red\" | \"crimson\" | \"tomato\" | \"orange\" | \"amber\" | \"yellow\" | \"lime\" | \"grass\" | \"green\" | \"jade\" | \"mint\" | \"turquoise\" | \"cyan\" | \"sky\" | \"blue\" | \"iris\" | \"violet\" | \"purple\" | \"plum\" | \"pink\" | \"bronze\" | \"gold\" | \"brown\" | \"gray\"",
+ "type": "\"amber\" | \"blue\" | \"bronze\" | \"brown\" | \"crimson\" | \"cyan\" | \"gold\" | \"grass\" | \"gray\" | \"green\" | \"iris\" | \"jade\" | \"lime\" | \"mint\" | \"orange\" | \"pink\" | \"plum\" | \"purple\" | \"red\" | \"ruby\" | \"sky\" | \"tomato\" | \"turquoise\" | \"violet\" | \"yellow\"",
"required": true,
"defaultValue": null,
"description": "Theme color used for the status background, text, and loader."
@@ -5610,7 +5757,7 @@
},
{
"name": "weight",
- "type": "\"regular\" | \"medium\"",
+ "type": "\"medium\" | \"regular\"",
"required": false,
"defaultValue": "regular",
"description": "Font weight of the label."
@@ -5631,7 +5778,7 @@
},
{
"name": "level",
- "type": "5 | 1 | 2 | 3 | 4 | 6",
+ "type": "1 | 2 | 3 | 4 | 5 | 6",
"required": false,
"defaultValue": "2",
"description": "Semantic heading level, from `h1` through `h6`. Does not change the visual size. Defaults to `2`."
@@ -5645,7 +5792,7 @@
},
{
"name": "size",
- "type": "\"sm\" | \"md\" | \"lg\" | \"xs\"",
+ "type": "\"lg\" | \"md\" | \"sm\" | \"xs\"",
"required": false,
"defaultValue": "md",
"description": "Visual font size, independent of the heading level. Defaults to `md`."
@@ -5724,7 +5871,7 @@
},
{
"name": "level",
- "type": "5 | 1 | 2 | 3 | 4 | 6",
+ "type": "1 | 2 | 3 | 4 | 5 | 6",
"required": false,
"defaultValue": "2",
"description": "Semantic heading level, from `h1` through `h6`. Does not change the visual size. Defaults to `2`."
@@ -5738,7 +5885,7 @@
},
{
"name": "size",
- "type": "\"sm\" | \"md\" | \"lg\" | \"xs\"",
+ "type": "\"lg\" | \"md\" | \"sm\" | \"xs\"",
"required": false,
"defaultValue": "md",
"description": "Visual font size, independent of the heading level. Defaults to `md`."
@@ -5768,7 +5915,7 @@
},
{
"name": "contentPadding",
- "type": "\"default\" | \"comfortable\"",
+ "type": "\"comfortable\" | \"default\"",
"required": false,
"defaultValue": "default",
"description": "`default` pads the top and bottom of the content. `comfortable` also widens the gap between line numbers and code."
@@ -5852,7 +5999,7 @@
},
{
"name": "variant",
- "type": "\"default\" | \"with-header\" | \"borderless\"",
+ "type": "\"borderless\" | \"default\" | \"with-header\"",
"required": false,
"defaultValue": "default",
"description": "Border treatment: `default` draws a rounded border, `with-header` attaches the editor below a `CodeEditorHeader`, and `borderless` removes the border."
@@ -5936,7 +6083,7 @@
},
{
"name": "size",
- "type": "\"sm\" | \"md\"",
+ "type": "\"md\" | \"sm\"",
"required": false,
"defaultValue": "sm",
"description": "Padding of the tab content: sm or md."
diff --git a/packages/twenty-ui/src/components/IconButton/IconButton.module.scss b/packages/twenty-ui/src/components/IconButton/IconButton.module.scss
index 8e28fe20133..129db768045 100644
--- a/packages/twenty-ui/src/components/IconButton/IconButton.module.scss
+++ b/packages/twenty-ui/src/components/IconButton/IconButton.module.scss
@@ -1,5 +1,28 @@
.button {
@include square-button;
+
+ --tw-button-size: var(--t-spacing-8);
+
+ &[data-icon-size='sm'] {
+ --tw-button-size: var(--t-spacing-6);
+ }
+
+ &[data-icon-size='xs'] {
+ --tw-button-size: var(--t-spacing-5);
+ }
+
+ &[data-shape='round'] {
+ border-radius: 50%;
+ corner-shape: round;
+ }
+
+ &[data-shape='round'][data-variant='solid'][data-color='accent'][data-disabled] {
+ --tw-button-background: var(--t-background-quaternary);
+ --tw-button-color: var(--t-font-color-tertiary);
+
+ cursor: default;
+ opacity: 1;
+ }
}
.tooltipAnchor {
@@ -12,7 +35,11 @@
justify-content: center;
& > svg {
- block-size: calc(var(--t-icon-size-md) * 1px);
- inline-size: calc(var(--t-icon-size-md) * 1px);
+ block-size: calc(
+ var(--tw-icon-button-icon-size, var(--t-icon-size-md)) * 1px
+ );
+ inline-size: calc(
+ var(--tw-icon-button-icon-size, var(--t-icon-size-md)) * 1px
+ );
}
}
diff --git a/packages/twenty-ui/src/components/IconButton/IconButton.tsx b/packages/twenty-ui/src/components/IconButton/IconButton.tsx
index d6f8461f675..16f644ccb4f 100644
--- a/packages/twenty-ui/src/components/IconButton/IconButton.tsx
+++ b/packages/twenty-ui/src/components/IconButton/IconButton.tsx
@@ -1,3 +1,6 @@
+import { useContext } from 'react';
+
+import { ButtonGroupContext } from '@ui/primitives/input/ButtonGroup/internal/ButtonGroupContext';
import { isNonEmptyString } from '@sniptt/guards';
import { Button } from '@ui/primitives/input/Button/Button';
@@ -9,6 +12,8 @@ import { type IconButtonProps } from './types/IconButtonProps';
export const IconButton = ({
children,
+ size = 'md',
+ shape = 'square',
className,
tooltip,
tooltipPlace = 'bottom',
@@ -18,11 +23,16 @@ export const IconButton = ({
loading,
...props
}: IconButtonProps) => {
+ const buttonGroup = useContext(ButtonGroupContext);
+ const resolvedSize = buttonGroup?.size ?? size;
const hasTooltip = isNonEmptyString(tooltip);
const isDisabled = disabled || loading;
const button = (
<Button
{...props}
+ size={size === 'xs' ? 'sm' : size}
+ data-icon-size={resolvedSize}
+ data-shape={shape}
disabled={disabled}
loading={loading}
startIcon={<span className={styles.icon}>{children}</span>}
diff --git a/packages/twenty-ui/src/components/IconButton/__stories__/IconButton.stories.tsx b/packages/twenty-ui/src/components/IconButton/__stories__/IconButton.stories.tsx
index cdd2c8ba2dd..f5b4e3dc664 100644
--- a/packages/twenty-ui/src/components/IconButton/__stories__/IconButton.stories.tsx
+++ b/packages/twenty-ui/src/components/IconButton/__stories__/IconButton.stories.tsx
@@ -101,6 +101,11 @@ export const Tooltip: Story = {
},
};
+export const TooltipDocumentation: Story = {
+ ...Tooltip,
+ play: undefined,
+};
+
export const TooltipDisabled: Story = {
...Tooltip,
args: { ...Tooltip.args, disabled: true, onClick: fn() },
@@ -222,3 +227,55 @@ export const CatalogDark: CatalogStory<Story, typeof IconButton> = {
tags: ['!autodocs'],
globals: { colorScheme: 'dark' },
};
+
+export const Round: Story = {
+ ...Default,
+ render: () => (
+ <>
+ <IconButton
+ aria-label="Compact round"
+ size="xs"
+ shape="round"
+ variant="solid"
+ color="accent"
+ >
+ <IconPlus />
+ </IconButton>
+ <IconButton
+ aria-label="Small round"
+ size="sm"
+ shape="round"
+ variant="solid"
+ color="accent"
+ >
+ <IconPlus />
+ </IconButton>
+ <IconButton
+ aria-label="Disabled round"
+ size="sm"
+ shape="round"
+ variant="solid"
+ color="accent"
+ disabled
+ >
+ <IconPlus />
+ </IconButton>
+ </>
+ ),
+ play: async ({ canvasElement }) => {
+ const canvas = within(canvasElement);
+ for (const [name, size] of [
+ ['Compact round', 20],
+ ['Small round', 24],
+ ['Disabled round', 24],
+ ] as const) {
+ const button = canvas.getByRole('button', { name });
+ await expect(button.getBoundingClientRect().width).toBe(size);
+ await expect(button.getBoundingClientRect().height).toBe(size);
+ await expect(getComputedStyle(button).borderTopLeftRadius).toBe('50%');
+ }
+ const disabled = canvas.getByRole('button', { name: 'Disabled round' });
+ await expect(disabled).toBeDisabled();
+ await expect(getComputedStyle(disabled).opacity).toBe('1');
+ },
+};
diff --git a/packages/twenty-ui/src/components/IconButton/types/IconButtonProps.ts b/packages/twenty-ui/src/components/IconButton/types/IconButtonProps.ts
index ce15f4c8f8d..88d24d3bb81 100644
--- a/packages/twenty-ui/src/components/IconButton/types/IconButtonProps.ts
+++ b/packages/twenty-ui/src/components/IconButton/types/IconButtonProps.ts
@@ -1,10 +1,13 @@
import { type ReactNode } from 'react';
+import { type IconButtonSize } from './IconButtonSize';
+
import { type ButtonProps } from '@ui/primitives/input/Button/types/ButtonProps';
import { type TooltipSide } from '@ui/primitives/surfaces/Tooltip/types/TooltipSide';
export type IconButtonProps = Omit<
ButtonProps,
+ | 'size'
| 'aria-label'
| 'children'
| 'startIcon'
@@ -14,6 +17,8 @@ export type IconButtonProps = Omit<
| 'soon'
| 'soonLabel'
> & {
+ size?: IconButtonSize;
+ shape?: 'square' | 'round';
children: ReactNode;
'aria-label': string;
tooltip?: string;
diff --git a/packages/twenty-ui/src/components/IconButton/types/IconButtonSize.ts b/packages/twenty-ui/src/components/IconButton/types/IconButtonSize.ts
new file mode 100644
index 00000000000..56ce70f127b
--- /dev/null
+++ b/packages/twenty-ui/src/components/IconButton/types/IconButtonSize.ts
@@ -0,0 +1,3 @@
+import { type ButtonSize } from '@ui/primitives/input/Button/types/ButtonSize';
+
+export type IconButtonSize = ButtonSize | 'xs';
diff --git a/packages/twenty-ui/src/components/LightIconButton/LightIconButton.module.scss b/packages/twenty-ui/src/components/LightIconButton/LightIconButton.module.scss
new file mode 100644
index 00000000000..053c5aa5ca9
--- /dev/null
+++ b/packages/twenty-ui/src/components/LightIconButton/LightIconButton.module.scss
@@ -0,0 +1,17 @@
+.button {
+ --tw-icon-button-icon-size: var(--t-icon-size-sm);
+
+ &[data-size='md'] {
+ --tw-icon-button-icon-size: var(--t-icon-size-md);
+ }
+
+ &[data-emphasis='subtle'][data-color='neutral']:not([data-variant='solid']) {
+ --tw-button-color: var(--t-font-color-tertiary);
+ }
+
+ &[data-disabled][data-color='neutral'][data-variant='ghost'] {
+ --tw-button-color: var(--t-font-color-extra-light);
+
+ opacity: 1;
+ }
+}
diff --git a/packages/twenty-ui/src/components/LightIconButton/LightIconButton.module.scss.d.ts b/packages/twenty-ui/src/components/LightIconButton/LightIconButton.module.scss.d.ts
new file mode 100644
index 00000000000..37b2ec6b50f
--- /dev/null
+++ b/packages/twenty-ui/src/components/LightIconButton/LightIconButton.module.scss.d.ts
@@ -0,0 +1,4 @@
+declare const styles: {
+ readonly button: string;
+};
+export default styles;
diff --git a/packages/twenty-ui/src/components/LightIconButton/LightIconButton.tsx b/packages/twenty-ui/src/components/LightIconButton/LightIconButton.tsx
new file mode 100644
index 00000000000..84c6a1c1fa1
--- /dev/null
+++ b/packages/twenty-ui/src/components/LightIconButton/LightIconButton.tsx
@@ -0,0 +1,21 @@
+import { IconButton } from '@ui/components/IconButton/IconButton';
+import { mergeClassNames } from '@ui/utilities/internal/mergeClassNames';
+
+import styles from './LightIconButton.module.scss';
+import { type LightIconButtonProps } from './types/LightIconButtonProps';
+
+export const LightIconButton = ({
+ className,
+ emphasis = 'standard',
+ size = 'sm',
+ variant = 'ghost',
+ ...props
+}: LightIconButtonProps) => (
+ <IconButton
+ {...props}
+ size={size}
+ variant={variant}
+ data-emphasis={emphasis}
+ className={mergeClassNames(styles.button, className)}
+ />
+);
diff --git a/packages/twenty-ui/src/components/LightIconButton/__stories__/LightIconButton.stories.tsx b/packages/twenty-ui/src/components/LightIconButton/__stories__/LightIconButton.stories.tsx
new file mode 100644
index 00000000000..d98f652e79a
--- /dev/null
+++ b/packages/twenty-ui/src/components/LightIconButton/__stories__/LightIconButton.stories.tsx
@@ -0,0 +1,167 @@
+import { type Meta, type StoryObj } from '@storybook/react-vite';
+import { expect, fn, userEvent, within } from 'storybook/test';
+import { IconSearch } from '@ui/icon';
+import { IconButton } from '@ui/components/IconButton/IconButton';
+import { ButtonGroup } from '@ui/primitives/input/ButtonGroup/ButtonGroup';
+import {
+ A11Y_DEFER_COLOR_CONTRAST,
+ CatalogDecorator,
+ type CatalogStory,
+ ComponentDecorator,
+} from '@ui/testing';
+import { LightIconButton } from '../LightIconButton';
+import { type LightIconButtonProps } from '../types/LightIconButtonProps';
+
+const meta: Meta<typeof LightIconButton> = {
+ title: 'UI/Input/Button/LightIconButton',
+ component: LightIconButton,
+ args: { children: <IconSearch />, 'aria-label': 'Search' },
+};
+export default meta;
+type Story = StoryObj<typeof LightIconButton>;
+
+export const Default: Story = {
+ decorators: [ComponentDecorator],
+ args: { onClick: fn() },
+ play: async ({ canvasElement, args }) => {
+ const button = within(canvasElement).getByRole('button', {
+ name: 'Search',
+ });
+
+ await userEvent.click(button);
+ await expect(args.onClick).toHaveBeenCalledOnce();
+ },
+};
+
+export const Documentation: Story = {
+ ...Default,
+ play: undefined,
+};
+
+export const Appearance: Story = {
+ ...Default,
+ render: () => (
+ <>
+ <LightIconButton aria-label="Standard">
+ <IconSearch />
+ </LightIconButton>
+ <LightIconButton aria-label="Subtle" emphasis="subtle">
+ <IconSearch />
+ </LightIconButton>
+ <LightIconButton aria-label="Medium" size="md">
+ <IconSearch />
+ </LightIconButton>
+ <LightIconButton aria-label="Compact" size="xs">
+ <IconSearch />
+ </LightIconButton>
+ <LightIconButton aria-label="Disabled" disabled>
+ <IconSearch />
+ </LightIconButton>
+ <ButtonGroup color="danger" size="md" variant="solid">
+ <LightIconButton aria-label="Group action" emphasis="subtle">
+ <IconSearch />
+ </LightIconButton>
+ <IconButton aria-label="Reference">
+ <IconSearch />
+ </IconButton>
+ </ButtonGroup>
+ </>
+ ),
+ play: async ({ canvasElement }) => {
+ const canvas = within(canvasElement);
+ for (const [name, size, iconSize] of [
+ ['Standard', 24, 14],
+ ['Subtle', 24, 14],
+ ['Medium', 32, 16],
+ ['Compact', 20, 14],
+ ] as const) {
+ const button = canvas.getByRole('button', { name });
+ await expect(button.getBoundingClientRect().width).toBe(size);
+ await expect(button.getBoundingClientRect().height).toBe(size);
+ await expect(
+ button.querySelector('svg')?.getBoundingClientRect().width,
+ ).toBe(iconSize);
+ }
+ const standard = canvas.getByRole('button', { name: 'Standard' });
+ const subtle = canvas.getByRole('button', { name: 'Subtle' });
+ await expect(getComputedStyle(standard).color).not.toBe(
+ getComputedStyle(subtle).color,
+ );
+ const grouped = canvas.getByRole('button', { name: 'Group action' });
+ const reference = canvas.getByRole('button', { name: 'Reference' });
+ await expect(getComputedStyle(grouped).color).toBe(
+ getComputedStyle(reference).color,
+ );
+ await expect(grouped.getBoundingClientRect().width).toBe(32);
+ await expect(
+ canvas.getByRole('button', { name: 'Disabled' }),
+ ).toBeDisabled();
+ },
+};
+
+export const AppearanceDark: Story = {
+ ...Appearance,
+ globals: { colorScheme: 'dark' },
+};
+
+const CATALOG_STATES: Record<string, Partial<LightIconButtonProps>> = {
+ default: {},
+ hover: { className: 'hover' },
+ pressed: { className: 'pressed' },
+ focused: { className: 'focused' },
+ disabled: { disabled: true },
+ selected: { color: 'accent', 'aria-pressed': true },
+ loading: { loading: true },
+};
+
+export const Catalog: CatalogStory<Story, typeof LightIconButton> = {
+ 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: 'emphasis',
+ values: ['standard', 'subtle'],
+ props: (emphasis: LightIconButtonProps['emphasis']) => ({ emphasis }),
+ },
+ {
+ name: 'size',
+ values: ['sm', 'md'],
+ props: (size: LightIconButtonProps['size']) => ({ size }),
+ },
+ ],
+ },
+ },
+ play: async ({ canvasElement }) => {
+ const canvas = within(canvasElement);
+ const buttons = canvas.getAllByRole('button', { name: 'Search' });
+
+ for (const button of buttons) {
+ await expect(button).toBeVisible();
+ }
+
+ await expect(canvas.getAllByRole('button', { pressed: true })).toHaveLength(
+ 4,
+ );
+ await expect(canvas.getAllByRole('button', { busy: true })).toHaveLength(4);
+ await expect(
+ buttons.filter((button) => button.hasAttribute('disabled')),
+ ).toHaveLength(8);
+ },
+};
+export const CatalogDark: CatalogStory<Story, typeof LightIconButton> = {
+ ...Catalog,
+ globals: { colorScheme: 'dark' },
+ tags: ['!autodocs'],
+};
diff --git a/packages/twenty-ui/src/components/LightIconButton/__tests__/LightIconButton.test.tsx b/packages/twenty-ui/src/components/LightIconButton/__tests__/LightIconButton.test.tsx
new file mode 100644
index 00000000000..2cf9e0f09f2
--- /dev/null
+++ b/packages/twenty-ui/src/components/LightIconButton/__tests__/LightIconButton.test.tsx
@@ -0,0 +1,16 @@
+import { runComponentConformance } from '@test-utilities/conformance/runComponentConformance';
+import { IconSearch } from '@ui/icon';
+
+import { LightIconButton } from '../LightIconButton';
+import styles from '../LightIconButton.module.scss';
+
+runComponentConformance({
+ name: 'LightIconButton',
+ element: (
+ <LightIconButton aria-label="Search">
+ <IconSearch />
+ </LightIconButton>
+ ),
+ refInstanceOf: HTMLButtonElement,
+ ownClassName: styles.button,
+});
diff --git a/packages/twenty-ui/src/components/LightIconButton/types/LightIconButtonProps.ts b/packages/twenty-ui/src/components/LightIconButton/types/LightIconButtonProps.ts
new file mode 100644
index 00000000000..649afffbd8e
--- /dev/null
+++ b/packages/twenty-ui/src/components/LightIconButton/types/LightIconButtonProps.ts
@@ -0,0 +1,5 @@
+import { type IconButtonProps } from '@ui/components/IconButton/types/IconButtonProps';
+
+export type LightIconButtonProps = IconButtonProps & {
+ emphasis?: 'standard' | 'subtle';
+};
diff --git a/packages/twenty-ui/src/components/Section/__stories__/Section.stories.tsx b/packages/twenty-ui/src/components/Section/__stories__/Section.stories.tsx
index 67c3e994323..7c9f67acbca 100644
--- a/packages/twenty-ui/src/components/Section/__stories__/Section.stories.tsx
+++ b/packages/twenty-ui/src/components/Section/__stories__/Section.stories.tsx
@@ -35,6 +35,7 @@ export const WithDescription: Story = {
export const Documentation: Story = {
...WithDescription,
+ play: undefined,
render: (args) => (
<Section.Root>
<Section.Header {...args} />
diff --git a/packages/twenty-ui/src/components/code-editor/CodeEditor/__stories__/CodeEditor.stories.tsx b/packages/twenty-ui/src/components/code-editor/CodeEditor/__stories__/CodeEditor.stories.tsx
index 96d32c89af2..758b590a2dc 100644
--- a/packages/twenty-ui/src/components/code-editor/CodeEditor/__stories__/CodeEditor.stories.tsx
+++ b/packages/twenty-ui/src/components/code-editor/CodeEditor/__stories__/CodeEditor.stories.tsx
@@ -48,6 +48,7 @@ export const Default: Story = {
export const Documentation: Story = {
...Default,
+ play: undefined,
args: { variant: 'with-header' },
render: (args) => (
<div style={{ width: '100%' }}>
@@ -66,6 +67,7 @@ export const Documentation: Story = {
export const Dark: Story = {
...Documentation,
+ play: Default.play,
tags: ['!autodocs'],
globals: { colorScheme: 'dark' },
};
diff --git a/packages/twenty-ui/src/components/code-editor/CodeEditorHeader/__stories__/CodeEditorHeader.stories.tsx b/packages/twenty-ui/src/components/code-editor/CodeEditorHeader/__stories__/CodeEditorHeader.stories.tsx
index 790a685e85c..7ad083c2afd 100644
--- a/packages/twenty-ui/src/components/code-editor/CodeEditorHeader/__stories__/CodeEditorHeader.stories.tsx
+++ b/packages/twenty-ui/src/components/code-editor/CodeEditorHeader/__stories__/CodeEditorHeader.stories.tsx
@@ -3,7 +3,7 @@ import { expect, within } from 'storybook/test';
import { IconCopy } from '@ui/icon/components/TablerIcons';
import { Button } from '@ui/primitives/input/Button/Button';
-import { LightIconButton } from '@ui/primitives/input/LightIconButton/LightIconButton';
+import { LightIconButton } from '@ui/components/LightIconButton/LightIconButton';
import { A11Y_DEFER_COLOR_CONTRAST, ComponentDecorator } from '@ui/testing';
import { CodeEditorHeader } from '../CodeEditorHeader';
@@ -40,7 +40,9 @@ export const WithActions: Story = {
...Default,
args: {
leftNodes: [
- <LightIconButton key="copy" Icon={IconCopy} aria-label="Copy code" />,
+ <LightIconButton key="copy" aria-label="Copy code">
+ <IconCopy />
+ </LightIconButton>,
],
rightNodes: [
<Button key="run" size="sm" variant="solid" color="accent">
diff --git a/packages/twenty-ui/src/components/index.ts b/packages/twenty-ui/src/components/index.ts
index d45252f6c5a..e307ed115c8 100644
--- a/packages/twenty-ui/src/components/index.ts
+++ b/packages/twenty-ui/src/components/index.ts
@@ -9,8 +9,11 @@
export { IconButton } from './IconButton/IconButton';
export type { IconButtonProps } from './IconButton/types/IconButtonProps';
+export type { IconButtonSize } from './IconButton/types/IconButtonSize';
export { LightButton } from './LightButton/LightButton';
export type { LightButtonProps } from './LightButton/types/LightButtonProps';
+export { LightIconButton } from './LightIconButton/LightIconButton';
+export type { LightIconButtonProps } from './LightIconButton/types/LightIconButtonProps';
export { MainButton } from './MainButton/MainButton';
export { Section } from './Section/Section';
export type { SectionHeaderProps } from './Section/types/SectionHeaderProps';
diff --git a/packages/twenty-ui/src/primitives/feedback/Callout/Callout.module.scss b/packages/twenty-ui/src/primitives/feedback/Callout/Callout.module.scss
index db337e72c7b..c27d536b8a3 100644
--- a/packages/twenty-ui/src/primitives/feedback/Callout/Callout.module.scss
+++ b/packages/twenty-ui/src/primitives/feedback/Callout/Callout.module.scss
@@ -113,3 +113,7 @@
display: flex;
justify-content: flex-end;
}
+
+.closeButton {
+ @include square-button;
+}
diff --git a/packages/twenty-ui/src/primitives/feedback/Callout/Callout.module.scss.d.ts b/packages/twenty-ui/src/primitives/feedback/Callout/Callout.module.scss.d.ts
index c55e1c0f9de..42c7d07542b 100644
--- a/packages/twenty-ui/src/primitives/feedback/Callout/Callout.module.scss.d.ts
+++ b/packages/twenty-ui/src/primitives/feedback/Callout/Callout.module.scss.d.ts
@@ -1,4 +1,5 @@
declare const classNames: {
+ readonly closeButton: 'closeButton';
readonly container: 'container';
readonly containerInfo: 'containerInfo';
readonly containerWarning: 'containerWarning';
diff --git a/packages/twenty-ui/src/primitives/feedback/Callout/Callout.tsx b/packages/twenty-ui/src/primitives/feedback/Callout/Callout.tsx
index c5034cb299d..a8f76065f2b 100644
--- a/packages/twenty-ui/src/primitives/feedback/Callout/Callout.tsx
+++ b/packages/twenty-ui/src/primitives/feedback/Callout/Callout.tsx
@@ -4,7 +4,7 @@ import { isDefined } from '@ui/utilities/utils/isDefined';
import { IconHelp, IconX } from '@ui/icon/components/TablerIcons';
import { type IconComponent } from '@ui/icon/types/IconComponent';
-import { LightIconButton, Button } from '@ui/primitives/input';
+import { Button } from '@ui/primitives/input';
import styles from './Callout.module.scss';
@@ -86,9 +86,11 @@ export const Callout = ({
</div>
<div className={styles.title}>{title}</div>
{isClosable && (
- <LightIconButton
- Icon={IconX}
- size="small"
+ <Button
+ startIcon={<IconX />}
+ className={styles.closeButton}
+ variant="ghost"
+ size="sm"
aria-label="Close"
onClick={handleClose}
/>
diff --git a/packages/twenty-ui/src/primitives/feedback/Toast/Toast.module.scss b/packages/twenty-ui/src/primitives/feedback/Toast/Toast.module.scss
index 41c149ca3d7..9e5edc37bd8 100644
--- a/packages/twenty-ui/src/primitives/feedback/Toast/Toast.module.scss
+++ b/packages/twenty-ui/src/primitives/feedback/Toast/Toast.module.scss
@@ -71,3 +71,7 @@
justify-content: flex-end;
padding-block-start: var(--t-spacing-1);
}
+
+.closeButton {
+ @include square-button;
+}
diff --git a/packages/twenty-ui/src/primitives/feedback/Toast/Toast.module.scss.d.ts b/packages/twenty-ui/src/primitives/feedback/Toast/Toast.module.scss.d.ts
index c601510b108..e12de258a22 100644
--- a/packages/twenty-ui/src/primitives/feedback/Toast/Toast.module.scss.d.ts
+++ b/packages/twenty-ui/src/primitives/feedback/Toast/Toast.module.scss.d.ts
@@ -1,4 +1,5 @@
declare const classNames: {
+ readonly closeButton: 'closeButton';
readonly root: 'root';
readonly progress: 'progress';
readonly header: 'header';
diff --git a/packages/twenty-ui/src/primitives/feedback/Toast/Toast.tsx b/packages/twenty-ui/src/primitives/feedback/Toast/Toast.tsx
index 040ead1fff5..fd5e47f7075 100644
--- a/packages/twenty-ui/src/primitives/feedback/Toast/Toast.tsx
+++ b/packages/twenty-ui/src/primitives/feedback/Toast/Toast.tsx
@@ -10,7 +10,6 @@ import {
IconX,
} from '@ui/icon';
import { Button } from '@ui/primitives/input/Button/Button';
-import { LightIconButton } from '@ui/primitives/input/LightIconButton/LightIconButton';
import { HorizontalSeparator } from '@ui/primitives/layout/HorizontalSeparator/HorizontalSeparator';
import { useTheme } from '@ui/theme-constants';
import { isDefined } from '@ui/utilities/utils/isDefined';
@@ -103,10 +102,13 @@ export const Toast = ({
</Button>
)}
{isDefined(onClose) && (
- <LightIconButton
+ <Button
title={closeLabel}
aria-label={closeLabel}
- Icon={IconX}
+ startIcon={<IconX />}
+ className={styles.closeButton}
+ variant="ghost"
+ size="sm"
onClick={onClose}
/>
)}
diff --git a/packages/twenty-ui/src/primitives/input/AnimatedLightIconButton/AnimatedLightIconButton.tsx b/packages/twenty-ui/src/primitives/input/AnimatedLightIconButton/AnimatedLightIconButton.tsx
index ac025138a6f..63631ad2791 100644
--- a/packages/twenty-ui/src/primitives/input/AnimatedLightIconButton/AnimatedLightIconButton.tsx
+++ b/packages/twenty-ui/src/primitives/input/AnimatedLightIconButton/AnimatedLightIconButton.tsx
@@ -2,10 +2,6 @@ import { clsx } from 'clsx';
import { type ComponentProps, type MouseEvent } from 'react';
import { type IconComponent } from '@ui/icon';
-import {
- type LightIconButtonAccent,
- type LightIconButtonSize,
-} from '@ui/primitives/input/LightIconButton/LightIconButton';
import { useTheme } from '@ui/theme-constants';
import styles from './AnimatedLightIconButton.module.scss';
@@ -15,8 +11,8 @@ export type AnimatedLightIconButtonProps = {
testId?: string;
Icon?: IconComponent;
title?: string;
- size?: LightIconButtonSize;
- accent?: LightIconButtonAccent;
+ size?: 'small' | 'medium';
+ accent?: 'secondary' | 'tertiary';
active?: boolean;
disabled?: boolean;
focus?: boolean;
diff --git a/packages/twenty-ui/src/primitives/input/AnimatedLightIconButton/__stories__/AnimatedLightIconButton.stories.tsx b/packages/twenty-ui/src/primitives/input/AnimatedLightIconButton/__stories__/AnimatedLightIconButton.stories.tsx
index 57136092a37..b23fc667380 100644
--- a/packages/twenty-ui/src/primitives/input/AnimatedLightIconButton/__stories__/AnimatedLightIconButton.stories.tsx
+++ b/packages/twenty-ui/src/primitives/input/AnimatedLightIconButton/__stories__/AnimatedLightIconButton.stories.tsx
@@ -1,16 +1,15 @@
import { type Meta, type StoryObj } from '@storybook/react-vite';
import { IconSearch } from '@ui/icon';
-import {
- type LightIconButtonAccent,
- type LightIconButtonSize,
-} from '@ui/primitives/input/LightIconButton/LightIconButton';
import {
A11Y_DEFER_COLOR_CONTRAST,
CatalogDecorator,
type CatalogStory,
ComponentDecorator,
} from '@ui/testing';
-import { AnimatedLightIconButton } from '@ui/primitives/input/AnimatedLightIconButton/AnimatedLightIconButton';
+import {
+ AnimatedLightIconButton,
+ type AnimatedLightIconButtonProps,
+} from '@ui/primitives/input/AnimatedLightIconButton/AnimatedLightIconButton';
const meta: Meta<typeof AnimatedLightIconButton> = {
title: 'UI/Input/Button/AnimatedLightIconButton',
@@ -87,13 +86,21 @@ export const Catalog: CatalogStory<Story, typeof AnimatedLightIconButton> = {
},
{
name: 'accents',
- values: ['secondary', 'tertiary'] satisfies LightIconButtonAccent[],
- props: (accent: LightIconButtonAccent) => ({ accent }),
+ values: [
+ 'secondary',
+ 'tertiary',
+ ] satisfies AnimatedLightIconButtonProps['accent'][],
+ props: (accent: AnimatedLightIconButtonProps['accent']) => ({
+ accent,
+ }),
},
{
name: 'sizes',
- values: ['small', 'medium'] satisfies LightIconButtonSize[],
- props: (size: LightIconButtonSize) => ({ size }),
+ values: [
+ 'small',
+ 'medium',
+ ] satisfies AnimatedLightIconButtonProps['size'][],
+ props: (size: AnimatedLightIconButtonProps['size']) => ({ size }),
},
],
},
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 0f975c6b396..31e09006322 100644
--- a/packages/twenty-ui/src/primitives/input/Button/Button.module.scss
+++ b/packages/twenty-ui/src/primitives/input/Button/Button.module.scss
@@ -11,24 +11,24 @@
align-items: center;
background: var(--tw-button-background);
- block-size: var(--t-spacing-8);
+ block-size: var(--tw-button-size, var(--t-spacing-8));
border: 1px solid var(--tw-button-border);
- border-radius: var(--t-border-radius-md);
+ border-radius: var(--tw-button-radius, var(--t-border-radius-md));
border-end-end-radius: var(
--tw-button-border-end-end-radius,
- var(--t-border-radius-md)
+ var(--tw-button-radius, var(--t-border-radius-md))
);
border-end-start-radius: var(
--tw-button-border-end-start-radius,
- var(--t-border-radius-md)
+ var(--tw-button-radius, var(--t-border-radius-md))
);
border-start-end-radius: var(
--tw-button-border-start-end-radius,
- var(--t-border-radius-md)
+ var(--tw-button-radius, var(--t-border-radius-md))
);
border-start-start-radius: var(
--tw-button-border-start-start-radius,
- var(--t-border-radius-md)
+ var(--tw-button-radius, var(--t-border-radius-md))
);
box-sizing: border-box;
color: var(--tw-button-color);
@@ -49,7 +49,7 @@
white-space: nowrap;
&[data-size='sm'] {
- block-size: var(--t-spacing-6);
+ block-size: var(--tw-button-size, var(--t-spacing-6));
}
&[data-full-width] {
inline-size: 100%;
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 024c21654b8..4483e47237b 100644
--- a/packages/twenty-ui/src/primitives/input/ButtonGroup/ButtonGroup.module.scss
+++ b/packages/twenty-ui/src/primitives/input/ButtonGroup/ButtonGroup.module.scss
@@ -1,14 +1,45 @@
.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);
+ --tw-button-border-end-end-radius: var(
+ --tw-button-radius,
+ var(--t-border-radius-md)
+ );
+ --tw-button-border-end-start-radius: var(
+ --tw-button-radius,
+ var(--t-border-radius-md)
+ );
+ --tw-button-border-start-end-radius: var(
+ --tw-button-radius,
+ var(--t-border-radius-md)
+ );
+ --tw-button-border-start-start-radius: var(
+ --tw-button-radius,
+ var(--t-border-radius-md)
+ );
border-radius: var(--t-border-radius-md);
display: inline-flex;
max-inline-size: 100%;
- & > :not(:first-child) {
+ &[data-framed] {
+ --tw-button-radius: calc(
+ var(--t-border-radius-sm) - var(--t-spacing-0_5) - 1px
+ );
+
+ align-items: flex-start;
+ backdrop-filter: blur(20px);
+ background-color: var(--t-background-transparent-lighter);
+ border: 1px solid var(--t-border-color-strong);
+ border-radius: var(--t-border-radius-sm);
+ padding: var(--t-spacing-0_5);
+
+ @include hover-capable {
+ &:hover {
+ box-shadow: var(--t-box-shadow-light);
+ }
+ }
+ }
+
+ &[data-attached] > :not(:first-child) {
--tw-button-border-start-start-radius: 0;
--tw-button-border-end-start-radius: 0;
@@ -16,14 +47,18 @@
border-end-start-radius: 0;
margin-inline-start: -1px;
}
- & > :not(:last-child) {
+ &[data-attached] > :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-within {
+ &:not([data-attached]) {
+ gap: var(--t-spacing-0_5);
+ }
+
+ & > :where(*):focus-within {
z-index: 1;
}
}
diff --git a/packages/twenty-ui/src/primitives/input/ButtonGroup/ButtonGroup.tsx b/packages/twenty-ui/src/primitives/input/ButtonGroup/ButtonGroup.tsx
index b2861639038..18b444eefc0 100644
--- a/packages/twenty-ui/src/primitives/input/ButtonGroup/ButtonGroup.tsx
+++ b/packages/twenty-ui/src/primitives/input/ButtonGroup/ButtonGroup.tsx
@@ -6,6 +6,8 @@ import { ButtonGroupContext } from './internal/ButtonGroupContext';
import { type ButtonGroupProps } from './types/ButtonGroupProps';
export const ButtonGroup = ({
+ attached = true,
+ framed = false,
className,
children,
variant,
@@ -20,6 +22,8 @@ export const ButtonGroup = ({
ref,
props: {
role: 'group',
+ 'data-attached': attached || undefined,
+ 'data-framed': framed || undefined,
...props,
className: clsx(styles.container, className),
children,
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 07682ee0e03..5b0892ab8c0 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
@@ -1,6 +1,13 @@
import { type Meta, type StoryObj } from '@storybook/react-vite';
-import { expect, userEvent, within } from 'storybook/test';
-import { IconCheckbox, IconNotes, IconTimelineEvent } from '@ui/icon';
+import { expect, fn, userEvent, within } from 'storybook/test';
+import {
+ IconCheckbox,
+ IconNotes,
+ IconPlus,
+ IconTimelineEvent,
+ IconTrash,
+} from '@ui/icon';
+import { LightIconButton } from '@ui/components/LightIconButton/LightIconButton';
import { ComponentDecorator } from '@ui/testing';
import { Button } from '@ui/primitives/input/Button/Button';
import { ButtonGroup } from '@ui/primitives/input/ButtonGroup/ButtonGroup';
@@ -137,3 +144,147 @@ export const UnspecifiedAppearance: Story = {
await expect(defaultButton).toHaveAttribute('data-size', 'md');
},
};
+
+export const Framed: Story = {
+ decorators: [ComponentDecorator],
+ render: () => (
+ <ButtonGroup
+ framed
+ attached={false}
+ aria-label="Record actions"
+ className="nodrag nopan"
+ >
+ <LightIconButton size="xs" aria-label="Add" emphasis="subtle">
+ <IconPlus />
+ </LightIconButton>
+ <LightIconButton
+ size="xs"
+ aria-label="Delete"
+ emphasis="subtle"
+ disabled
+ tooltip="Unavailable"
+ >
+ <IconTrash />
+ </LightIconButton>
+ </ButtonGroup>
+ ),
+ play: async ({ canvasElement }) => {
+ const canvas = within(canvasElement);
+ const group = canvas.getByRole('group', { name: 'Record actions' });
+ const buttons = within(group).getAllByRole('button');
+ await expect(group).toHaveClass('nodrag', 'nopan');
+ await expect(group.getBoundingClientRect().height).toBe(26);
+ await expect(group.getBoundingClientRect().width).toBe(48);
+ for (const button of buttons) {
+ await expect(button.getBoundingClientRect().width).toBe(20);
+ await expect(button.getBoundingClientRect().height).toBe(20);
+ await expect(getComputedStyle(button).borderTopLeftRadius).toBe(
+ getComputedStyle(button).borderTopRightRadius,
+ );
+ await expect(
+ parseFloat(getComputedStyle(button).borderTopLeftRadius),
+ ).toBeGreaterThan(0);
+ }
+ await expect(
+ buttons[1].getBoundingClientRect().left -
+ buttons[0].getBoundingClientRect().right,
+ ).toBe(2);
+ },
+};
+export const FramedDocumentation: Story = {
+ ...Framed,
+ play: undefined,
+};
+
+export const FramedDark: Story = {
+ ...Framed,
+ globals: { colorScheme: 'dark' },
+};
+export const FramedSingle: Story = {
+ decorators: [ComponentDecorator],
+ render: () => (
+ <ButtonGroup framed attached={false} aria-label="Single action">
+ <LightIconButton size="xs" aria-label="Add">
+ <IconPlus />
+ </LightIconButton>
+ </ButtonGroup>
+ ),
+ play: async ({ canvasElement }) => {
+ await expect(
+ within(canvasElement).getByRole('group').getBoundingClientRect().width,
+ ).toBe(26);
+ },
+};
+export const FramedDisabledAction: Story = {
+ decorators: [ComponentDecorator],
+ args: { onClick: fn() },
+ render: (args) => (
+ <ButtonGroup framed attached={false} {...args}>
+ <LightIconButton size="xs" aria-label="Delete" disabled>
+ <IconTrash />
+ </LightIconButton>
+ </ButtonGroup>
+ ),
+ play: async ({ canvasElement, args }) => {
+ await userEvent.click(within(canvasElement).getByRole('button'));
+ await expect(args.onClick).not.toHaveBeenCalled();
+ },
+};
+
+export const FramedMixedButtons: Story = {
+ decorators: [ComponentDecorator],
+ render: () => (
+ <ButtonGroup framed attached={false} aria-label="Mixed actions">
+ <Button size="sm" variant="solid" color="accent">
+ Save
+ </Button>
+ <LightIconButton size="xs" aria-label="Add">
+ <IconPlus />
+ </LightIconButton>
+ <LightIconButton size="md" aria-label="Delete">
+ <IconTrash />
+ </LightIconButton>
+ </ButtonGroup>
+ ),
+ play: async ({ canvasElement }) => {
+ const canvas = within(canvasElement);
+ const save = canvas.getByRole('button', { name: 'Save' });
+ const add = canvas.getByRole('button', { name: 'Add' });
+ const remove = canvas.getByRole('button', { name: 'Delete' });
+
+ await expect(save.getBoundingClientRect().height).toBe(24);
+ await expect(save).toHaveAttribute('data-variant', 'solid');
+ await expect(save).toHaveAttribute('data-color', 'accent');
+ await expect(add.getBoundingClientRect().width).toBe(20);
+ await expect(remove.getBoundingClientRect().width).toBe(32);
+ await expect(add).toHaveAttribute('data-variant', 'ghost');
+ await expect(canvas.getByRole('group').getBoundingClientRect().height).toBe(
+ 38,
+ );
+ },
+};
+
+export const FramedAttached: Story = {
+ ...Default,
+ args: { ...Default.args, framed: true },
+ play: async ({ canvasElement }) => {
+ const canvas = within(canvasElement);
+ const buttons = canvas.getAllByRole('button');
+ const firstButtonStyle = getComputedStyle(buttons[0]);
+ const lastButtonStyle = getComputedStyle(buttons[2]);
+ const groupStyle = getComputedStyle(canvas.getByRole('group'));
+
+ await expect(firstButtonStyle.borderStartEndRadius).toBe('0px');
+ await expect(lastButtonStyle.borderStartStartRadius).toBe('0px');
+ await expect(firstButtonStyle.borderStartStartRadius).toBe(
+ lastButtonStyle.borderStartEndRadius,
+ );
+ await expect(
+ parseFloat(groupStyle.borderStartStartRadius) -
+ parseFloat(firstButtonStyle.borderStartStartRadius),
+ ).toBe(
+ parseFloat(groupStyle.paddingInlineStart) +
+ parseFloat(groupStyle.borderInlineStartWidth),
+ );
+ },
+};
diff --git a/packages/twenty-ui/src/primitives/input/ButtonGroup/types/ButtonGroupProps.ts b/packages/twenty-ui/src/primitives/input/ButtonGroup/types/ButtonGroupProps.ts
index b1d39c7c303..9a877e39b37 100644
--- a/packages/twenty-ui/src/primitives/input/ButtonGroup/types/ButtonGroupProps.ts
+++ b/packages/twenty-ui/src/primitives/input/ButtonGroup/types/ButtonGroupProps.ts
@@ -2,4 +2,7 @@ import { type useRender } from '@base-ui/react/use-render';
import { type ButtonProps } from '@ui/primitives/input/Button/types/ButtonProps';
export type ButtonGroupProps = useRender.ComponentProps<'div'> &
- Pick<ButtonProps, 'variant' | 'size' | 'color'>;
+ Pick<ButtonProps, 'variant' | 'size' | 'color'> & {
+ attached?: boolean;
+ framed?: boolean;
+ };
diff --git a/packages/twenty-ui/src/primitives/input/ColorPickerButton/ColorPickerButton.module.scss b/packages/twenty-ui/src/primitives/input/ColorPickerButton/ColorPickerButton.module.scss
index 96b6e0849cf..da2547f83f4 100644
--- a/packages/twenty-ui/src/primitives/input/ColorPickerButton/ColorPickerButton.module.scss
+++ b/packages/twenty-ui/src/primitives/input/ColorPickerButton/ColorPickerButton.module.scss
@@ -1,15 +1,13 @@
-// The :hover rule is kept separate on purpose: at (0,1,2) it out-specifies
-// the inner LightIconButton's own hover background at (0,1,1) regardless of
-// stylesheet order, exactly like the legacy Linaria wrapper did.
-
-.wrapper button {
- background-color: var(--color-picker-button-bg, transparent);
+.wrapper[data-selected] {
+ --tw-color-picker-button-background: var(--t-background-transparent-medium);
}
-.wrapper button:hover {
- background-color: var(--color-picker-button-bg, transparent);
+.wrapper .button[data-variant='ghost'] {
+ --tw-button-background: var(--tw-color-picker-button-background, transparent);
+ --tw-button-hover: var(--tw-color-picker-button-background, transparent);
+ --tw-button-active: var(--tw-color-picker-button-background, transparent);
}
-.wrapper[data-selected] {
- --color-picker-button-bg: var(--t-background-transparent-medium);
+.button {
+ @include square-button;
}
diff --git a/packages/twenty-ui/src/primitives/input/ColorPickerButton/ColorPickerButton.module.scss.d.ts b/packages/twenty-ui/src/primitives/input/ColorPickerButton/ColorPickerButton.module.scss.d.ts
index 6f9e27f1e2e..89244f29579 100644
--- a/packages/twenty-ui/src/primitives/input/ColorPickerButton/ColorPickerButton.module.scss.d.ts
+++ b/packages/twenty-ui/src/primitives/input/ColorPickerButton/ColorPickerButton.module.scss.d.ts
@@ -1,4 +1,5 @@
declare const classNames: {
+ readonly button: 'button';
readonly wrapper: 'wrapper';
};
export default classNames;
diff --git a/packages/twenty-ui/src/primitives/input/ColorPickerButton/ColorPickerButton.tsx b/packages/twenty-ui/src/primitives/input/ColorPickerButton/ColorPickerButton.tsx
index 03257710bfb..d88be500a93 100644
--- a/packages/twenty-ui/src/primitives/input/ColorPickerButton/ColorPickerButton.tsx
+++ b/packages/twenty-ui/src/primitives/input/ColorPickerButton/ColorPickerButton.tsx
@@ -2,15 +2,13 @@ import {
ColorSample,
type ColorSampleProps,
} from '@ui/primitives/data-display';
-import {
- LightIconButton,
- type LightIconButtonProps,
-} from '@ui/primitives/input/LightIconButton/LightIconButton';
+import { Button } from '@ui/primitives/input/Button/Button';
+import { type ButtonProps } from '@ui/primitives/input/Button/types/ButtonProps';
import styles from './ColorPickerButton.module.scss';
type ColorPickerButtonProps = Pick<ColorSampleProps, 'colorName'> &
- Pick<LightIconButtonProps, 'onClick'> & {
+ Pick<ButtonProps, 'onClick'> & {
isSelected?: boolean;
};
@@ -21,9 +19,11 @@ export const ColorPickerButton = ({
}: ColorPickerButtonProps) => {
return (
<div className={styles.wrapper} data-selected={isSelected || undefined}>
- <LightIconButton
- size="medium"
- Icon={() => <ColorSample colorName={colorName} />}
+ <Button
+ size="md"
+ variant="ghost"
+ className={styles.button}
+ startIcon={<ColorSample colorName={colorName} />}
aria-label={`Select ${colorName} color`}
onClick={onClick}
/>
diff --git a/packages/twenty-ui/src/primitives/input/ColorPickerButton/__stories__/ColorPickerButton.stories.tsx b/packages/twenty-ui/src/primitives/input/ColorPickerButton/__stories__/ColorPickerButton.stories.tsx
index 7e5f6c41a13..4bc94602548 100644
--- a/packages/twenty-ui/src/primitives/input/ColorPickerButton/__stories__/ColorPickerButton.stories.tsx
+++ b/packages/twenty-ui/src/primitives/input/ColorPickerButton/__stories__/ColorPickerButton.stories.tsx
@@ -1,3 +1,4 @@
+import { expect, userEvent, waitFor, within } from 'storybook/test';
import { type Meta, type StoryObj } from '@storybook/react-vite';
import { ComponentDecorator } from '@ui/testing';
import { ColorPickerButton } from '@ui/primitives/input/ColorPickerButton/ColorPickerButton';
@@ -16,4 +17,17 @@ export const Default: Story = {};
export const Selected: Story = {
args: { isSelected: true },
+ play: async ({ canvasElement }) => {
+ const button = within(canvasElement).getByRole('button', {
+ name: 'Select green color',
+ });
+ const background = getComputedStyle(button).backgroundColor;
+ await expect(button.getBoundingClientRect().width).toBe(32);
+ await expect(background).not.toBe('rgba(0, 0, 0, 0)');
+ await userEvent.hover(button);
+ await waitFor(() => {
+ expect(button.getAnimations()).toHaveLength(0);
+ expect(getComputedStyle(button).backgroundColor).toBe(background);
+ });
+ },
};
diff --git a/packages/twenty-ui/src/primitives/input/IconButtonGroup/IconButtonGroup.module.scss b/packages/twenty-ui/src/primitives/input/IconButtonGroup/IconButtonGroup.module.scss
deleted file mode 100644
index c0297c07cd9..00000000000
--- a/packages/twenty-ui/src/primitives/input/IconButtonGroup/IconButtonGroup.module.scss
+++ /dev/null
@@ -1,21 +0,0 @@
-.container {
- align-items: flex-start;
- backdrop-filter: blur(20px);
- background-color: var(--t-background-transparent-lighter);
- border: 1px solid var(--t-border-color-strong);
- // sm, not md: the container is ~26px tall, where md would exceed 50% of the
- // box and clamp to a full squircle, breaking concentricity with the inner
- // buttons (see FloatingIconButtonGroup for the full rationale).
- border-radius: var(--t-border-radius-sm);
- display: inline-flex;
- gap: 2px;
- padding: 2px;
-
- &:hover {
- box-shadow: var(--t-box-shadow-light);
- }
-
- &[data-disabled] {
- background-color: inherit;
- }
-}
diff --git a/packages/twenty-ui/src/primitives/input/IconButtonGroup/IconButtonGroup.module.scss.d.ts b/packages/twenty-ui/src/primitives/input/IconButtonGroup/IconButtonGroup.module.scss.d.ts
deleted file mode 100644
index 8df71b4dead..00000000000
--- a/packages/twenty-ui/src/primitives/input/IconButtonGroup/IconButtonGroup.module.scss.d.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-declare const classNames: {
- readonly container: 'container';
-};
-export default classNames;
diff --git a/packages/twenty-ui/src/primitives/input/IconButtonGroup/IconButtonGroup.tsx b/packages/twenty-ui/src/primitives/input/IconButtonGroup/IconButtonGroup.tsx
deleted file mode 100644
index 3c99b787a44..00000000000
--- a/packages/twenty-ui/src/primitives/input/IconButtonGroup/IconButtonGroup.tsx
+++ /dev/null
@@ -1,43 +0,0 @@
-import { clsx } from 'clsx';
-import { type MouseEvent } from 'react';
-
-import { type IconComponent } from '@ui/icon';
-import { InsideButton } from '@ui/primitives/input/InsideButton/InsideButton';
-
-import styles from './IconButtonGroup.module.scss';
-
-export type IconButtonGroupProps = {
- disabled?: boolean;
- iconButtons: {
- Icon: IconComponent;
- ariaLabel?: string;
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- onClick?: (event: MouseEvent<any>) => void;
- }[];
- className?: string;
-};
-
-export const IconButtonGroup = ({
- iconButtons,
- disabled,
- className,
-}: IconButtonGroupProps) => {
- return (
- <div
- className={clsx(styles.container, className)}
- data-disabled={disabled || undefined}
- >
- {iconButtons.map(({ Icon, onClick, ariaLabel }, index) => {
- return (
- <InsideButton
- key={index}
- Icon={Icon}
- ariaLabel={ariaLabel}
- onClick={onClick}
- disabled={disabled}
- />
- );
- })}
- </div>
- );
-};
diff --git a/packages/twenty-ui/src/primitives/input/IconButtonGroup/__stories__/IconButtonGroup.stories.tsx b/packages/twenty-ui/src/primitives/input/IconButtonGroup/__stories__/IconButtonGroup.stories.tsx
deleted file mode 100644
index 229bd3394fe..00000000000
--- a/packages/twenty-ui/src/primitives/input/IconButtonGroup/__stories__/IconButtonGroup.stories.tsx
+++ /dev/null
@@ -1,52 +0,0 @@
-import { type Meta, type StoryObj } from '@storybook/react-vite';
-import { IconCheckbox, IconNotes, IconTimelineEvent } from '@ui/icon';
-import {
- CatalogDecorator,
- type CatalogStory,
- ComponentDecorator,
-} from '@ui/testing';
-
-import { IconButtonGroup } from '@ui/primitives/input/IconButtonGroup/IconButtonGroup';
-
-const meta: Meta<typeof IconButtonGroup> = {
- title: 'UI/Input/Button/IconButtonGroup',
- component: IconButtonGroup,
- args: {
- iconButtons: [
- { Icon: IconNotes, ariaLabel: 'Notes' },
- { Icon: IconCheckbox, ariaLabel: 'Tasks' },
- { Icon: IconTimelineEvent, ariaLabel: 'Timeline' },
- ],
- },
- argTypes: {
- iconButtons: { control: false },
- },
-};
-
-export default meta;
-type Story = StoryObj<typeof IconButtonGroup>;
-
-export const Default: Story = {
- args: {
- disabled: false,
- },
- decorators: [ComponentDecorator],
-};
-
-export const Catalog: CatalogStory<Story, typeof IconButtonGroup> = {
- argTypes: {
- disabled: { control: false },
- },
- parameters: {
- catalog: {
- dimensions: [
- {
- name: 'disabled',
- values: [true, false],
- props: (disabled: boolean) => ({ disabled }),
- },
- ],
- },
- },
- decorators: [CatalogDecorator],
-};
diff --git a/packages/twenty-ui/src/primitives/input/InsideButton/InsideButton.module.scss b/packages/twenty-ui/src/primitives/input/InsideButton/InsideButton.module.scss
deleted file mode 100644
index a33464e4dbe..00000000000
--- a/packages/twenty-ui/src/primitives/input/InsideButton/InsideButton.module.scss
+++ /dev/null
@@ -1,26 +0,0 @@
-.button {
- align-items: center;
- border: none;
- background-color: transparent;
- // Concentric with the IconButtonGroup sm container: its radius minus the
- // 2px padding and 1px border.
- border-radius: calc(var(--t-border-radius-sm) - 3px);
- color: var(--t-font-color-tertiary);
- cursor: pointer;
- display: flex;
- flex-direction: row;
- height: 20px;
- justify-content: center;
- padding: 0;
- white-space: nowrap;
- min-width: 20px;
- transition: background-color 0.1s ease;
-
- &:hover {
- background-color: var(--t-background-transparent-light);
- }
-
- &[data-disabled] {
- cursor: not-allowed;
- }
-}
diff --git a/packages/twenty-ui/src/primitives/input/InsideButton/InsideButton.module.scss.d.ts b/packages/twenty-ui/src/primitives/input/InsideButton/InsideButton.module.scss.d.ts
deleted file mode 100644
index d6e2364fc57..00000000000
--- a/packages/twenty-ui/src/primitives/input/InsideButton/InsideButton.module.scss.d.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-declare const classNames: {
- readonly button: 'button';
-};
-export default classNames;
diff --git a/packages/twenty-ui/src/primitives/input/InsideButton/InsideButton.tsx b/packages/twenty-ui/src/primitives/input/InsideButton/InsideButton.tsx
deleted file mode 100644
index b91f0cf20b3..00000000000
--- a/packages/twenty-ui/src/primitives/input/InsideButton/InsideButton.tsx
+++ /dev/null
@@ -1,37 +0,0 @@
-import { clsx } from 'clsx';
-import React from 'react';
-
-import { type IconComponent } from '@ui/icon';
-import { useTheme } from '@ui/theme-constants';
-
-import styles from './InsideButton.module.scss';
-
-export type InsideButtonProps = {
- className?: string;
- Icon?: IconComponent;
- ariaLabel?: string;
- onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
- disabled?: boolean;
-};
-
-export const InsideButton = ({
- className,
- Icon,
- ariaLabel,
- onClick,
- disabled = false,
-}: InsideButtonProps) => {
- const theme = useTheme();
-
- return (
- <button
- className={clsx(styles.button, className)}
- aria-label={ariaLabel}
- onClick={onClick}
- disabled={disabled}
- data-disabled={disabled || undefined}
- >
- {Icon && <Icon size={theme.icon.size.sm} aria-hidden={!!ariaLabel} />}
- </button>
- );
-};
diff --git a/packages/twenty-ui/src/primitives/input/LightIconButton/LightIconButton.module.scss b/packages/twenty-ui/src/primitives/input/LightIconButton/LightIconButton.module.scss
deleted file mode 100644
index f784993e238..00000000000
--- a/packages/twenty-ui/src/primitives/input/LightIconButton/LightIconButton.module.scss
+++ /dev/null
@@ -1,90 +0,0 @@
-// State rules below only assign CSS custom properties; the actual
-// declarations live on the flat .button class so twenty-front
-// styled(LightIconButton) overrides keep beating them at (0,1,0) specificity,
-// exactly like the legacy single Linaria class did.
-// Cascade order replicates the legacy Linaria color switch precedence:
-// (active || focus) > disabled > accent base — later rules win.
-
-.button {
- align-items: center;
- background: transparent;
- border: var(--light-icon-button-border, none);
- // Containers that frame the button (e.g. RecordTableCellButtons) publish
- // this variable to keep the hover shape concentric with their own radius.
- border-radius: var(--light-icon-button-radius, var(--t-border-radius-md));
- box-shadow: var(--light-icon-button-box-shadow, none);
- color: var(--light-icon-button-color);
- cursor: pointer;
- display: flex;
- flex-direction: row;
- font-family: var(--t-font-family);
- font-weight: var(--t-font-weight-regular);
- gap: var(--t-spacing-1);
- justify-content: center;
- padding: var(--t-spacing-1);
- transition: background 0.1s ease;
- white-space: nowrap;
-
- &:hover {
- background: var(
- --light-icon-button-hover-bg,
- var(--t-background-transparent-light)
- );
- }
-
- &:focus {
- outline: none;
- }
-
- @include focus-ring;
-
- &:active {
- background: var(
- --light-icon-button-active-bg,
- var(--t-background-transparent-medium)
- );
- }
-
- &[data-disabled] {
- cursor: not-allowed;
- }
-}
-
-.small {
- height: var(--t-spacing-6);
- min-width: var(--t-spacing-6);
- width: var(--t-spacing-6);
-}
-
-.medium {
- height: var(--t-spacing-8);
- min-width: var(--t-spacing-8);
- width: var(--t-spacing-8);
-}
-
-.button[data-accent='secondary'] {
- --light-icon-button-color: var(--t-font-color-secondary);
-}
-
-.button[data-accent='tertiary'] {
- --light-icon-button-color: var(--t-font-color-tertiary);
-}
-
-.button[data-disabled] {
- --light-icon-button-color: var(--t-font-color-extra-light);
- --light-icon-button-hover-bg: transparent;
- --light-icon-button-active-bg: transparent;
-}
-
-// active || focus turn the icon blue even when disabled, matching the legacy
-// switch where the (active || focus) branch came first.
-.button[data-active],
-.button[data-focus] {
- --light-icon-button-color: var(--t-color-blue);
-}
-
-// focus is gated by !disabled in the component, like the legacy call-site.
-.button[data-focus] {
- --light-icon-button-border: 1px solid var(--t-color-blue);
- --light-icon-button-box-shadow: 0 0 0 3px var(--t-color-blue3);
-}
diff --git a/packages/twenty-ui/src/primitives/input/LightIconButton/LightIconButton.module.scss.d.ts b/packages/twenty-ui/src/primitives/input/LightIconButton/LightIconButton.module.scss.d.ts
deleted file mode 100644
index de85059fc80..00000000000
--- a/packages/twenty-ui/src/primitives/input/LightIconButton/LightIconButton.module.scss.d.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-declare const classNames: {
- readonly button: 'button';
- readonly small: 'small';
- readonly medium: 'medium';
-};
-export default classNames;
diff --git a/packages/twenty-ui/src/primitives/input/LightIconButton/LightIconButton.tsx b/packages/twenty-ui/src/primitives/input/LightIconButton/LightIconButton.tsx
deleted file mode 100644
index 9d5586c3150..00000000000
--- a/packages/twenty-ui/src/primitives/input/LightIconButton/LightIconButton.tsx
+++ /dev/null
@@ -1,61 +0,0 @@
-import { clsx } from 'clsx';
-import { type ComponentProps, type MouseEvent } from 'react';
-
-import { type IconComponent } from '@ui/icon';
-import { useTheme } from '@ui/theme-constants';
-
-import styles from './LightIconButton.module.scss';
-
-export type LightIconButtonAccent = 'secondary' | 'tertiary';
-export type LightIconButtonSize = 'small' | 'medium';
-
-export type LightIconButtonProps = {
- className?: string;
- testId?: string;
- Icon?: IconComponent;
- title?: string;
- size?: LightIconButtonSize;
- accent?: LightIconButtonAccent;
- active?: boolean;
- disabled?: boolean;
- focus?: boolean;
- onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
-} & Pick<ComponentProps<'button'>, 'aria-label' | 'title'>;
-
-export const LightIconButton = ({
- 'aria-label': ariaLabel,
- className,
- testId,
- Icon,
- active = false,
- size = 'small',
- accent = 'secondary',
- disabled = false,
- focus = false,
- onClick,
- title,
-}: LightIconButtonProps) => {
- const theme = useTheme();
-
- return (
- <button
- data-testid={testId}
- aria-label={ariaLabel}
- onClick={onClick}
- disabled={disabled}
- className={clsx(styles.button, styles[size], className)}
- data-accent={accent}
- data-active={active || undefined}
- data-disabled={disabled || undefined}
- data-focus={(focus && !disabled) || undefined}
- title={title}
- >
- {Icon && (
- <Icon
- size={size === 'medium' ? theme.icon.size.md : theme.icon.size.sm}
- aria-hidden={!!ariaLabel}
- />
- )}
- </button>
- );
-};
diff --git a/packages/twenty-ui/src/primitives/input/LightIconButton/__stories__/LightIconButton.stories.tsx b/packages/twenty-ui/src/primitives/input/LightIconButton/__stories__/LightIconButton.stories.tsx
deleted file mode 100644
index 514530c30ae..00000000000
--- a/packages/twenty-ui/src/primitives/input/LightIconButton/__stories__/LightIconButton.stories.tsx
+++ /dev/null
@@ -1,99 +0,0 @@
-import { type Meta, type StoryObj } from '@storybook/react-vite';
-import { IconSearch } from '@ui/icon';
-import {
- A11Y_DEFER_COLOR_CONTRAST,
- CatalogDecorator,
- type CatalogStory,
- ComponentDecorator,
-} from '@ui/testing';
-import {
- LightIconButton,
- type LightIconButtonAccent,
- type LightIconButtonSize,
-} from '@ui/primitives/input/LightIconButton/LightIconButton';
-
-const meta: Meta<typeof LightIconButton> = {
- title: 'UI/Input/Button/LightIconButton',
- component: LightIconButton,
-};
-
-export default meta;
-type Story = StoryObj<typeof LightIconButton>;
-
-export const Default: Story = {
- args: {
- title: 'Filter',
- accent: 'secondary',
- disabled: false,
- active: false,
- focus: false,
- Icon: IconSearch,
- },
- argTypes: {
- Icon: { control: false },
- },
- decorators: [ComponentDecorator],
-};
-
-export const Catalog: CatalogStory<Story, typeof LightIconButton> = {
- args: { title: 'Filter', Icon: IconSearch },
- argTypes: {
- accent: { control: false },
- disabled: { control: false },
- active: { control: false },
- focus: { control: false },
- },
- parameters: {
- a11y: A11Y_DEFER_COLOR_CONTRAST,
- pseudo: { hover: ['.hover'], active: ['.pressed'] },
- catalog: {
- dimensions: [
- {
- name: 'states',
- values: [
- 'default',
- 'hover',
- 'pressed',
- 'disabled',
- 'active',
- 'focus',
- 'disabled+focus',
- 'disabled+active',
- ],
- 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 { disabled: true, focus: true };
- case 'disabled+active':
- return { disabled: true, active: true };
- default:
- return {};
- }
- },
- },
- {
- name: 'accents',
- values: ['secondary', 'tertiary'] satisfies LightIconButtonAccent[],
- props: (accent: LightIconButtonAccent) => ({ accent }),
- },
- {
- name: 'sizes',
- values: ['small', 'medium'] satisfies LightIconButtonSize[],
- props: (size: LightIconButtonSize) => ({ size }),
- },
- ],
- },
- },
- decorators: [CatalogDecorator],
-};
diff --git a/packages/twenty-ui/src/primitives/input/LightIconButtonGroup/LightIconButtonGroup.module.scss b/packages/twenty-ui/src/primitives/input/LightIconButtonGroup/LightIconButtonGroup.module.scss
deleted file mode 100644
index c4961b98a9d..00000000000
--- a/packages/twenty-ui/src/primitives/input/LightIconButtonGroup/LightIconButtonGroup.module.scss
+++ /dev/null
@@ -1,4 +0,0 @@
-.container {
- display: inline-flex;
- gap: 2px;
-}
diff --git a/packages/twenty-ui/src/primitives/input/LightIconButtonGroup/LightIconButtonGroup.module.scss.d.ts b/packages/twenty-ui/src/primitives/input/LightIconButtonGroup/LightIconButtonGroup.module.scss.d.ts
deleted file mode 100644
index 8df71b4dead..00000000000
--- a/packages/twenty-ui/src/primitives/input/LightIconButtonGroup/LightIconButtonGroup.module.scss.d.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-declare const classNames: {
- readonly container: 'container';
-};
-export default classNames;
diff --git a/packages/twenty-ui/src/primitives/input/LightIconButtonGroup/LightIconButtonGroup.tsx b/packages/twenty-ui/src/primitives/input/LightIconButtonGroup/LightIconButtonGroup.tsx
deleted file mode 100644
index 6bd0172b0ce..00000000000
--- a/packages/twenty-ui/src/primitives/input/LightIconButtonGroup/LightIconButtonGroup.tsx
+++ /dev/null
@@ -1,65 +0,0 @@
-import {
- type FunctionComponent,
- type MouseEvent,
- type ReactElement,
-} from 'react';
-
-import { type IconComponent } from '@ui/icon';
-
-import { clsx } from 'clsx';
-import {
- LightIconButton,
- type LightIconButtonProps,
-} from '@ui/primitives/input/LightIconButton/LightIconButton';
-
-import styles from './LightIconButtonGroup.module.scss';
-
-export type LightIconButtonGroupProps = Pick<
- LightIconButtonProps,
- 'className' | 'size'
-> & {
- iconButtons: {
- Wrapper?: FunctionComponent<{ iconButton: ReactElement }>;
- Icon: IconComponent;
- accent?: LightIconButtonProps['accent'];
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- onClick?: (event: MouseEvent<any>) => void;
- disabled?: boolean;
- ariaLabel?: string;
- dataTestId?: string;
- }[];
-};
-
-export const LightIconButtonGroup = ({
- iconButtons,
- size,
- className,
-}: LightIconButtonGroupProps) => (
- <div className={clsx(styles.container, className)}>
- {iconButtons.map(
- ({ Wrapper, Icon, accent, onClick, ariaLabel, dataTestId }, index) => {
- const iconButton = (
- <LightIconButton
- key={`light-icon-button-${index}`}
- Icon={Icon}
- accent={accent}
- disabled={!onClick}
- onClick={onClick}
- size={size}
- aria-label={ariaLabel}
- testId={dataTestId}
- />
- );
-
- return Wrapper ? (
- <Wrapper
- key={`light-icon-button-wrapper-${index}`}
- iconButton={iconButton}
- />
- ) : (
- iconButton
- );
- },
- )}
- </div>
-);
diff --git a/packages/twenty-ui/src/primitives/input/RoundedIconButton/RoundedIconButton.module.scss b/packages/twenty-ui/src/primitives/input/RoundedIconButton/RoundedIconButton.module.scss
deleted file mode 100644
index 1b1b897f1ee..00000000000
--- a/packages/twenty-ui/src/primitives/input/RoundedIconButton/RoundedIconButton.module.scss
+++ /dev/null
@@ -1,38 +0,0 @@
-.button {
- align-items: center;
- background: var(--t-color-blue);
- border: none;
- border-radius: 50%;
- corner-shape: round;
- color: var(--t-font-color-inverted);
- cursor: pointer;
- display: flex;
- justify-content: center;
- outline: none;
- padding: 0;
- transition:
- color 0.1s ease-in-out,
- background 0.1s ease-in-out;
-
- &:hover:not(:disabled) {
- background: var(--t-color-blue10);
- }
-
- &:disabled {
- background: var(--t-background-quaternary);
- color: var(--t-font-color-tertiary);
- cursor: default;
- }
-
- @include focus-ring;
-}
-
-.small {
- height: 20px;
- width: 20px;
-}
-
-.medium {
- height: 24px;
- width: 24px;
-}
diff --git a/packages/twenty-ui/src/primitives/input/RoundedIconButton/RoundedIconButton.module.scss.d.ts b/packages/twenty-ui/src/primitives/input/RoundedIconButton/RoundedIconButton.module.scss.d.ts
deleted file mode 100644
index de85059fc80..00000000000
--- a/packages/twenty-ui/src/primitives/input/RoundedIconButton/RoundedIconButton.module.scss.d.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-declare const classNames: {
- readonly button: 'button';
- readonly small: 'small';
- readonly medium: 'medium';
-};
-export default classNames;
diff --git a/packages/twenty-ui/src/primitives/input/RoundedIconButton/RoundedIconButton.tsx b/packages/twenty-ui/src/primitives/input/RoundedIconButton/RoundedIconButton.tsx
deleted file mode 100644
index ac9cd1d1181..00000000000
--- a/packages/twenty-ui/src/primitives/input/RoundedIconButton/RoundedIconButton.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-import { clsx } from 'clsx';
-import React from 'react';
-
-import { type IconComponent } from '@ui/icon';
-import { useTheme } from '@ui/theme-constants';
-
-import styles from './RoundedIconButton.module.scss';
-
-export type RoundedIconButtonSize = 'small' | 'medium';
-
-type RoundedIconButtonProps = {
- Icon: IconComponent;
- size?: RoundedIconButtonSize;
-} & React.ButtonHTMLAttributes<HTMLButtonElement>;
-
-export const RoundedIconButton = ({
- Icon,
- onClick,
- disabled,
- className,
- size = 'small',
- 'aria-label': ariaLabel,
-}: RoundedIconButtonProps) => {
- const theme = useTheme();
-
- return (
- <button
- className={clsx(styles.button, styles[size], className)}
- disabled={disabled}
- aria-label={ariaLabel}
- onClick={onClick}
- >
- <Icon size={theme.icon.size.md} aria-hidden={!!ariaLabel} />
- </button>
- );
-};
diff --git a/packages/twenty-ui/src/primitives/input/RoundedIconButton/__stories__/RoundedIconButton.stories.tsx b/packages/twenty-ui/src/primitives/input/RoundedIconButton/__stories__/RoundedIconButton.stories.tsx
deleted file mode 100644
index 53c60221638..00000000000
--- a/packages/twenty-ui/src/primitives/input/RoundedIconButton/__stories__/RoundedIconButton.stories.tsx
+++ /dev/null
@@ -1,30 +0,0 @@
-import { type Meta, type StoryObj } from '@storybook/react-vite';
-import { IconArrowRight } from '@ui/icon';
-import { ComponentDecorator } from '@ui/testing';
-import { expect, fn, userEvent, within } from 'storybook/test';
-import { RoundedIconButton } from '@ui/primitives/input/RoundedIconButton/RoundedIconButton';
-
-const clickJestFn = fn();
-
-const meta: Meta<typeof RoundedIconButton> = {
- title: 'UI/Input/Button/RoundedIconButton',
- component: RoundedIconButton,
-};
-
-export default meta;
-type Story = StoryObj<typeof RoundedIconButton>;
-
-export const Default: Story = {
- decorators: [ComponentDecorator],
- argTypes: { Icon: { control: false } },
- args: { onClick: clickJestFn, Icon: IconArrowRight, 'aria-label': 'Next' },
- play: async ({ canvasElement }) => {
- const canvas = within(canvasElement);
-
- expect(clickJestFn).toHaveBeenCalledTimes(0);
- const button = canvas.getByRole('button');
- await userEvent.click(button);
-
- expect(clickJestFn).toHaveBeenCalledTimes(1);
- },
-};
diff --git a/packages/twenty-ui/src/primitives/input/index.ts b/packages/twenty-ui/src/primitives/input/index.ts
index 0aa72c4298f..f6e93f84e24 100644
--- a/packages/twenty-ui/src/primitives/input/index.ts
+++ b/packages/twenty-ui/src/primitives/input/index.ts
@@ -51,8 +51,6 @@ export type {
export { FloatingIconButton } from './FloatingIconButton/FloatingIconButton';
export type { FloatingIconButtonGroupProps } from './FloatingIconButtonGroup/FloatingIconButtonGroup';
export { FloatingIconButtonGroup } from './FloatingIconButtonGroup/FloatingIconButtonGroup';
-export type { IconButtonGroupProps } from './IconButtonGroup/IconButtonGroup';
-export { IconButtonGroup } from './IconButtonGroup/IconButtonGroup';
export { IconListViewGrip } from './IconListViewGrip/IconListViewGrip';
export { Input } from './Input/Input';
export type { InputProps } from './Input/types/InputProps';
@@ -60,22 +58,10 @@ export { InputGroup } from './InputGroup/InputGroup';
export type { InputGroupProps } from './InputGroup/types/InputGroupProps';
export { InputHint } from './InputHint/InputHint';
export { InputLabel } from './InputLabel/InputLabel';
-export type { InsideButtonProps } from './InsideButton/InsideButton';
-export { InsideButton } from './InsideButton/InsideButton';
-export type {
- LightIconButtonAccent,
- LightIconButtonSize,
- LightIconButtonProps,
-} from './LightIconButton/LightIconButton';
-export { LightIconButton } from './LightIconButton/LightIconButton';
-export type { LightIconButtonGroupProps } from './LightIconButtonGroup/LightIconButtonGroup';
-export { LightIconButtonGroup } from './LightIconButtonGroup/LightIconButtonGroup';
export { Radio } from './Radio/Radio';
export type { RadioProps } from './Radio/types/RadioProps';
export { RadioGroup } from './RadioGroup/RadioGroup';
export type { RadioGroupProps } from './RadioGroup/types/RadioGroupProps';
-export type { RoundedIconButtonSize } from './RoundedIconButton/RoundedIconButton';
-export { RoundedIconButton } from './RoundedIconButton/RoundedIconButton';
export type { SearchInputProps } from './SearchInput/SearchInput';
export { SearchInput } from './SearchInput/SearchInput';
export type {
diff --git a/packages/twenty-ui/src/primitives/navigation/ListItem/__stories__/ListItem.stories.tsx b/packages/twenty-ui/src/primitives/navigation/ListItem/__stories__/ListItem.stories.tsx
index 59ad6402386..a701fd66dbe 100644
--- a/packages/twenty-ui/src/primitives/navigation/ListItem/__stories__/ListItem.stories.tsx
+++ b/packages/twenty-ui/src/primitives/navigation/ListItem/__stories__/ListItem.stories.tsx
@@ -9,7 +9,7 @@ import {
} from '@ui/testing';
import { IconBell, IconEdit, IconSettings, IconTrash } from '@ui/icon';
-import { LightIconButton } from '@ui/primitives/input/LightIconButton/LightIconButton';
+import { LightIconButton } from '@ui/components/LightIconButton/LightIconButton';
import { ListItem } from '@ui/primitives/navigation/ListItem/ListItem';
import { type ListItemColor } from '@ui/primitives/navigation/ListItem/types/ListItemColor';
import { type ListItemIndicator } from '@ui/primitives/navigation/ListItem/types/ListItemIndicator';
@@ -29,16 +29,12 @@ const START_ICON = <IconBell />;
const ACTIONS = (
<>
- <LightIconButton
- Icon={IconEdit}
- aria-label="Edit"
- onClick={action('Edit')}
- />
- <LightIconButton
- Icon={IconTrash}
- aria-label="Delete"
- onClick={action('Delete')}
- />
+ <LightIconButton aria-label="Edit" onClick={action('Edit')}>
+ <IconEdit />
+ </LightIconButton>
+ <LightIconButton aria-label="Delete" onClick={action('Delete')}>
+ <IconTrash />
+ </LightIconButton>
</>
);
diff --git a/packages/twenty-ui/src/primitives/navigation/MenuItem/MenuItem.tsx b/packages/twenty-ui/src/primitives/navigation/MenuItem/MenuItem.tsx
index 8b8b7d07804..a9f6086cd2c 100644
--- a/packages/twenty-ui/src/primitives/navigation/MenuItem/MenuItem.tsx
+++ b/packages/twenty-ui/src/primitives/navigation/MenuItem/MenuItem.tsx
@@ -1,12 +1,5 @@
import { IconChevronRight, type IconComponent } from '@ui/icon';
-import { type LightIconButtonProps } from '@ui/primitives/input/LightIconButton/LightIconButton';
-import { LightIconButtonGroup } from '@ui/primitives/input/LightIconButtonGroup/LightIconButtonGroup';
-import {
- type FunctionComponent,
- type MouseEvent,
- type ReactElement,
- type ReactNode,
-} from 'react';
+import { type MouseEvent, type ReactNode } from 'react';
import { MenuItemHotKeys } from '@ui/primitives/navigation/MenuItemHotKeys/MenuItemHotKeys';
import { type ThemeColor } from '@ui/theme';
@@ -33,22 +26,12 @@ export {
StyledMenuItemLeftContent,
};
-export type MenuItemIconButton = {
- Wrapper?: FunctionComponent<{ iconButton: ReactElement }>;
- Icon: IconComponent;
- accent?: LightIconButtonProps['accent'];
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- onClick?: (event: MouseEvent<any>) => void;
- ariaLabel?: string;
- dataTestId?: string;
-};
-
export type MenuItemProps = {
accent?: MenuItemAccent;
className?: string;
withIconContainer?: boolean;
withIconContainerBackground?: boolean;
- iconButtons?: MenuItemIconButton[];
+ iconButtons?: ReactNode;
isIconDisplayedOnHoverOnly?: boolean;
isTooltipOpen?: boolean;
LeftIcon?: IconComponent | null;
@@ -98,8 +81,6 @@ export const MenuItem = ({
isSubMenuOpened = false,
}: MenuItemProps) => {
const theme = useTheme();
- const showIconButtons = Array.isArray(iconButtons) && iconButtons.length > 0;
-
const handleMenuItemClick = (event: MouseEvent<HTMLDivElement>) => {
if (!onClick) return;
event.preventDefault();
@@ -134,11 +115,9 @@ export const MenuItem = ({
<StyledMenuItemRightContent>
{iconButtons && (
- <div className="hoverable-buttons">
- {showIconButtons && (
- <LightIconButtonGroup iconButtons={iconButtons} size="small" />
- )}
- </div>
+ <StyledMenuItemRightContent className="hoverable-buttons">
+ {iconButtons}
+ </StyledMenuItemRightContent>
)}
{hotKeys && <MenuItemHotKeys hotKeys={hotKeys} />}
{RightIcon && (
diff --git a/packages/twenty-ui/src/primitives/navigation/MenuItem/__stories__/MenuItem.stories.tsx b/packages/twenty-ui/src/primitives/navigation/MenuItem/__stories__/MenuItem.stories.tsx
index 2f891ecd65a..6b534c0f18f 100644
--- a/packages/twenty-ui/src/primitives/navigation/MenuItem/__stories__/MenuItem.stories.tsx
+++ b/packages/twenty-ui/src/primitives/navigation/MenuItem/__stories__/MenuItem.stories.tsx
@@ -1,3 +1,5 @@
+import { ButtonGroup } from '@ui/primitives/input/ButtonGroup/ButtonGroup';
+import { LightIconButton } from '@ui/components/LightIconButton/LightIconButton';
import { type Meta, type StoryObj } from '@storybook/react-vite';
import { action } from 'storybook/actions';
@@ -26,10 +28,16 @@ export const Default: Story = {
text: 'Menu item text',
LeftIcon: IconBell,
accent: 'default',
- iconButtons: [
- { Icon: IconBell, onClick: action('Clicked'), ariaLabel: 'Notify' },
- { Icon: IconBell, onClick: action('Clicked'), ariaLabel: 'Notify' },
- ],
+ iconButtons: (
+ <ButtonGroup attached={false}>
+ <LightIconButton aria-label={'Notify'} onClick={action('Clicked')}>
+ <IconBell />
+ </LightIconButton>
+ <LightIconButton aria-label={'Notify'} onClick={action('Clicked')}>
+ <IconBell />
+ </LightIconButton>
+ </ButtonGroup>
+ ),
},
decorators: [ComponentDecorator],
};
@@ -90,23 +98,27 @@ export const Catalog: CatalogStory<Story, typeof MenuItem> = {
switch (choice) {
case 'no icon button': {
return {
- iconButtons: [],
+ iconButtons: null,
};
}
case 'two icon buttons': {
return {
- iconButtons: [
- {
- Icon: IconBell,
- onClick: action('Clicked on first icon button'),
- ariaLabel: 'Notify',
- },
- {
- Icon: IconBell,
- onClick: action('Clicked on second icon button'),
- ariaLabel: 'Notify',
- },
- ],
+ iconButtons: (
+ <ButtonGroup attached={false}>
+ <LightIconButton
+ aria-label={'Notify'}
+ onClick={action('Clicked on first icon button')}
+ >
+ <IconBell />
+ </LightIconButton>
+ <LightIconButton
+ aria-label={'Notify'}
+ onClick={action('Clicked on second icon button')}
+ >
+ <IconBell />
+ </LightIconButton>
+ </ButtonGroup>
+ ),
};
}
default:
@@ -242,18 +254,19 @@ export const ContextualTextCatalog: CatalogStory<Story, typeof MenuItem> = {
switch (choice) {
case 'no icon button': {
return {
- iconButtons: [],
+ iconButtons: null,
};
}
case 'one icon button': {
return {
- iconButtons: [
- {
- Icon: IconBell,
- onClick: action('Clicked on icon button'),
- ariaLabel: 'Notify',
- },
- ],
+ iconButtons: (
+ <LightIconButton
+ aria-label={'Notify'}
+ onClick={action('Clicked on icon button')}
+ >
+ <IconBell />
+ </LightIconButton>
+ ),
};
}
default:
diff --git a/packages/twenty-ui/src/primitives/navigation/MenuItem/__tests__/MenuItemIconButtons.test.tsx b/packages/twenty-ui/src/primitives/navigation/MenuItem/__tests__/MenuItemIconButtons.test.tsx
new file mode 100644
index 00000000000..fadc4633e39
--- /dev/null
+++ b/packages/twenty-ui/src/primitives/navigation/MenuItem/__tests__/MenuItemIconButtons.test.tsx
@@ -0,0 +1,72 @@
+import { render, screen } from '@testing-library/react';
+import userEvent from '@testing-library/user-event';
+import { describe, expect, it, vi } from 'vitest';
+
+import { LightIconButton } from '@ui/components/LightIconButton/LightIconButton';
+import { IconSearch, IconTrash } from '@ui/icon';
+import { ButtonGroup } from '@ui/primitives/input/ButtonGroup/ButtonGroup';
+import { MenuItem } from '../MenuItem';
+import { MenuItemDraggable } from '@ui/primitives/navigation/MenuItemDraggable/MenuItemDraggable';
+import { MenuItemAvatar } from '@ui/primitives/navigation/MenuItemAvatar/MenuItemAvatar';
+
+describe.each([
+ { name: 'MenuItem', Component: MenuItem },
+ { name: 'MenuItemDraggable', Component: MenuItemDraggable },
+ { name: 'MenuItemAvatar', Component: MenuItemAvatar },
+])('$name icon buttons', ({ Component }) => {
+ it('preserves disabled buttons and wrapper-controlled triggers', async () => {
+ const user = userEvent.setup();
+ const onDelete = vi.fn();
+ const onSearch = vi.fn();
+ render(
+ <Component
+ text="Record"
+ iconButtons={
+ <ButtonGroup attached={false} onClick={onSearch}>
+ <LightIconButton aria-label="Delete" disabled onClick={onDelete}>
+ <IconTrash />
+ </LightIconButton>
+ <LightIconButton aria-label="Search">
+ <IconSearch />
+ </LightIconButton>
+ </ButtonGroup>
+ }
+ />,
+ );
+
+ const disabled = screen.getByRole('button', { name: 'Delete' });
+ expect(disabled).toBeDisabled();
+ await user.click(disabled);
+ expect(onDelete).not.toHaveBeenCalled();
+
+ const search = screen.getByRole('button', { name: 'Search' });
+ expect(search).toBeEnabled();
+ await user.click(search);
+ expect(onSearch).toHaveBeenCalledOnce();
+ });
+
+ it('preserves click propagation control and avoids form submission', async () => {
+ const user = userEvent.setup();
+ const onParentClick = vi.fn();
+ const onSubmit = vi.fn((event) => event.preventDefault());
+ const onClick = vi.fn((event) => event.stopPropagation());
+ render(
+ <form onSubmit={onSubmit}>
+ <Component
+ text="Record"
+ onClick={onParentClick}
+ iconButtons={
+ <LightIconButton aria-label="Search" onClick={onClick}>
+ <IconSearch />
+ </LightIconButton>
+ }
+ />
+ </form>,
+ );
+
+ await user.click(screen.getByRole('button', { name: 'Search' }));
+ expect(onClick).toHaveBeenCalledOnce();
+ expect(onParentClick).not.toHaveBeenCalled();
+ expect(onSubmit).not.toHaveBeenCalled();
+ });
+});
diff --git a/packages/twenty-ui/src/primitives/navigation/MenuItemAvatar/MenuItemAvatar.tsx b/packages/twenty-ui/src/primitives/navigation/MenuItemAvatar/MenuItemAvatar.tsx
index 84e5b4589c0..48ef5b6fac8 100644
--- a/packages/twenty-ui/src/primitives/navigation/MenuItemAvatar/MenuItemAvatar.tsx
+++ b/packages/twenty-ui/src/primitives/navigation/MenuItemAvatar/MenuItemAvatar.tsx
@@ -1,9 +1,6 @@
import { Avatar } from '@ui/primitives/data-display/Avatar/Avatar';
import { type AvatarProps } from '@ui/primitives/data-display/Avatar/types/AvatarProps';
-import {
- type MenuItemIconButton,
- MenuItem,
-} from '@ui/primitives/navigation/MenuItem/MenuItem';
+import { MenuItem } from '@ui/primitives/navigation/MenuItem/MenuItem';
import { type MouseEvent, type ReactNode } from 'react';
import { isDefined } from '@ui/utilities/utils/isDefined';
import { type MenuItemAccent } from '@ui/primitives/navigation/MenuItem/types/MenuItemAccent';
@@ -11,7 +8,7 @@ import { type MenuItemAccent } from '@ui/primitives/navigation/MenuItem/types/Me
export type MenuItemAvatarProps = {
accent?: MenuItemAccent;
className?: string;
- iconButtons?: MenuItemIconButton[];
+ iconButtons?: ReactNode;
isIconDisplayedOnHoverOnly?: boolean;
isTooltipOpen?: boolean;
avatar?: Pick<
diff --git a/packages/twenty-ui/src/primitives/navigation/MenuItemDraggable/MenuItemDraggable.tsx b/packages/twenty-ui/src/primitives/navigation/MenuItemDraggable/MenuItemDraggable.tsx
index ce61e855bf2..029d0b74657 100644
--- a/packages/twenty-ui/src/primitives/navigation/MenuItemDraggable/MenuItemDraggable.tsx
+++ b/packages/twenty-ui/src/primitives/navigation/MenuItemDraggable/MenuItemDraggable.tsx
@@ -1,18 +1,19 @@
import { MenuItemLeftContent } from '@ui/primitives/navigation/MenuItem/parts/MenuItemLeftContent';
-import { StyledHoverableMenuItemBase } from '@ui/primitives/navigation/MenuItem/parts/StyledMenuItemBase';
+import {
+ StyledHoverableMenuItemBase,
+ StyledMenuItemRightContent,
+} from '@ui/primitives/navigation/MenuItem/parts/StyledMenuItemBase';
import { type MenuItemAccent } from '@ui/primitives/navigation/MenuItem/types/MenuItemAccent';
import { type IconComponent } from '@ui/icon';
-import { LightIconButtonGroup } from '@ui/primitives/input';
import { type ReactNode } from 'react';
import { type MenuItemDraggableGripMode } from '@ui/primitives/navigation/MenuItem/types/MenuItemDraggableGripMode';
-import { type MenuItemIconButton } from '@ui/primitives/navigation/MenuItem/MenuItem';
export type MenuItemDraggableProps = {
LeftIcon?: IconComponent | undefined;
withIconContainer?: boolean;
accent?: MenuItemAccent;
- iconButtons?: MenuItemIconButton[];
+ iconButtons?: ReactNode;
isTooltipOpen?: boolean;
onClick?: () => void;
text: ReactNode;
@@ -37,8 +38,6 @@ export const MenuItemDraggable = ({
isIconDisplayedOnHoverOnly = true,
gripMode = 'never',
}: MenuItemDraggableProps) => {
- const showIconButtons = Array.isArray(iconButtons) && iconButtons.length > 0;
-
const cursorType =
gripMode !== 'never' ? (isDragDisabled ? 'default' : 'drag') : 'default';
@@ -58,11 +57,10 @@ export const MenuItemDraggable = ({
disabled={isDragDisabled}
gripMode={gripMode}
/>
- {showIconButtons && (
- <LightIconButtonGroup
- className="hoverable-buttons"
- iconButtons={iconButtons}
- />
+ {iconButtons && (
+ <StyledMenuItemRightContent className="hoverable-buttons">
+ {iconButtons}
+ </StyledMenuItemRightContent>
)}
</StyledHoverableMenuItemBase>
);
diff --git a/packages/twenty-ui/src/primitives/navigation/MenuItemDraggable/__stories__/MenuItemDraggable.stories.tsx b/packages/twenty-ui/src/primitives/navigation/MenuItemDraggable/__stories__/MenuItemDraggable.stories.tsx
index 32893d2b9dc..73ac8ed4219 100644
--- a/packages/twenty-ui/src/primitives/navigation/MenuItemDraggable/__stories__/MenuItemDraggable.stories.tsx
+++ b/packages/twenty-ui/src/primitives/navigation/MenuItemDraggable/__stories__/MenuItemDraggable.stories.tsx
@@ -1,3 +1,4 @@
+import { LightIconButton } from '@ui/components/LightIconButton/LightIconButton';
import { type Meta, type StoryObj } from '@storybook/react-vite';
import { action } from 'storybook/actions';
@@ -26,9 +27,11 @@ export const Default: Story = {
args: {
LeftIcon: IconBell,
accent: 'default',
- iconButtons: [
- { Icon: IconMinus, onClick: action('Clicked'), ariaLabel: 'Remove' },
- ],
+ iconButtons: (
+ <LightIconButton aria-label={'Remove'} onClick={action('Clicked')}>
+ <IconMinus />
+ </LightIconButton>
+ ),
onClick: action('Clicked'),
text: 'Menu item draggable',
isDragDisabled: false,
@@ -91,18 +94,19 @@ export const Catalog: Story = {
switch (choice) {
case 'no icon button': {
return {
- iconButtons: [],
+ iconButtons: null,
};
}
case 'minus icon buttons': {
return {
- iconButtons: [
- {
- Icon: IconMinus,
- onClick: action('Clicked on minus icon button'),
- ariaLabel: 'Remove',
- },
- ],
+ iconButtons: (
+ <LightIconButton
+ aria-label={'Remove'}
+ onClick={action('Clicked on minus icon button')}
+ >
+ <IconMinus />
+ </LightIconButton>
+ ),
};
}
}
diff --git a/packages/twenty-ui/src/primitives/navigation/index.ts b/packages/twenty-ui/src/primitives/navigation/index.ts
index 8edd1621a0d..e4402425f9c 100644
--- a/packages/twenty-ui/src/primitives/navigation/index.ts
+++ b/packages/twenty-ui/src/primitives/navigation/index.ts
@@ -21,7 +21,7 @@ export type { ListItemProps } from './ListItem/types/ListItemProps';
export type { ListItemState } from './ListItem/types/ListItemState';
export type { ColorLabels } from './MenuItem/constants/DefaultColorLabels';
export { DEFAULT_COLOR_LABELS } from './MenuItem/constants/DefaultColorLabels';
-export type { MenuItemIconButton, MenuItemProps } from './MenuItem/MenuItem';
+export type { MenuItemProps } from './MenuItem/MenuItem';
export {
MenuItemLeftContent,
StyledHoverableMenuItemBase,
diff --git a/packages/twenty-ui/src/primitives/surfaces/Dialog/__stories__/Dialog.stories.tsx b/packages/twenty-ui/src/primitives/surfaces/Dialog/__stories__/Dialog.stories.tsx
index 51ccc841770..62985ed4310 100644
--- a/packages/twenty-ui/src/primitives/surfaces/Dialog/__stories__/Dialog.stories.tsx
+++ b/packages/twenty-ui/src/primitives/surfaces/Dialog/__stories__/Dialog.stories.tsx
@@ -49,6 +49,11 @@ export const Default: Story = {
export const Documentation: Story = {
...Default,
args: { defaultOpen: false },
+ play: undefined,
+};
+
+export const DocumentationInteractions: Story = {
+ ...Documentation,
play: async ({ canvasElement }) => {
const trigger = within(canvasElement).getByRole('button', {
name: 'Edit account',
diff --git a/packages/twenty-ui/src/primitives/surfaces/Tooltip/__stories__/Tooltip.stories.tsx b/packages/twenty-ui/src/primitives/surfaces/Tooltip/__stories__/Tooltip.stories.tsx
index 841c7ea5331..b95fac5063b 100644
--- a/packages/twenty-ui/src/primitives/surfaces/Tooltip/__stories__/Tooltip.stories.tsx
+++ b/packages/twenty-ui/src/primitives/surfaces/Tooltip/__stories__/Tooltip.stories.tsx
@@ -34,6 +34,12 @@ const meta: Meta<typeof Tooltip> = {
</span>
</Tooltip>
),
+};
+
+export default meta;
+type Story = StoryObj<typeof Tooltip>;
+
+export const Default: Story = {
play: async ({ canvasElement }) => {
await userEvent.hover(within(canvasElement).getByRole('button'));
@@ -41,16 +47,15 @@ const meta: Meta<typeof Tooltip> = {
},
};
-export default meta;
-type Story = StoryObj<typeof Tooltip>;
-
-export const Default: Story = {};
+export const Documentation: Story = {};
export const WithArrow: Story = {
+ ...Default,
args: { arrow: true },
};
export const WithDescription: Story = {
+ ...Default,
args: {
content: (
<Tooltip.Content description="The amount of this opportunity">
@@ -61,6 +66,7 @@ export const WithDescription: Story = {
};
export const WithIcon: Story = {
+ ...Default,
args: {
content: (
<Tooltip.Content
@@ -104,10 +110,12 @@ const ControlledExample = () => {
};
export const Controlled: Story = {
+ ...Default,
render: () => <ControlledExample />,
};
export const DisabledButton: Story = {
+ ...Default,
render: (args) => (
<Tooltip {...args}>
<span>
@@ -137,6 +145,7 @@ export const Hoverable: Story = {
};
export const WithMaxWidth: Story = {
+ ...Default,
args: {
maxWidth: '200px',
content: (
@@ -148,6 +157,7 @@ export const WithMaxWidth: Story = {
};
export const CustomContent: Story = {
+ ...Default,
args: { content: <strong>Amount in workspace currency</strong> },
};
diff --git a/packages/twenty-ui/src/styles/abstracts/_mixins.scss b/packages/twenty-ui/src/styles/abstracts/_mixins.scss
index 79f89321712..ce02040c230 100644
--- a/packages/twenty-ui/src/styles/abstracts/_mixins.scss
+++ b/packages/twenty-ui/src/styles/abstracts/_mixins.scss
@@ -8,10 +8,10 @@
@mixin square-button {
--tw-button-padding-inline: 0;
- inline-size: var(--t-spacing-8);
+ inline-size: var(--tw-button-size, var(--t-spacing-8));
&[data-size='sm'] {
- inline-size: var(--t-spacing-6);
+ inline-size: var(--tw-button-size, var(--t-spacing-6));
}
}