The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Add inherited Button colors (#28413)
Raphaël Bosiae477866e295
diff --git a/packages/twenty-docs/snippets/ui/generated/components/feedback/callout.mdx b/packages/twenty-docs/snippets/ui/generated/components/feedback/callout.mdxindex 599c7134fb2..0dfa874aa0b 100644--- a/packages/twenty-docs/snippets/ui/generated/components/feedback/callout.mdx+++ b/packages/twenty-docs/snippets/ui/generated/components/feedback/callout.mdx@@ -74,8 +74,8 @@returns a class based on the component's state.</ParamField>-<ParamField body="Action.color" type=""accent" | "danger" | "neutral" | "success"">- Semantic color of the button.+<ParamField body="Action.color" type=""accent" | "danger" | "inherit" | "neutral" | "success"">+ Semantic color of the button. `inherit` uses the surrounding text color for the label, icons, loader, and outline border, with translucent black interaction surfaces. It supports outline, ghost, soft, and link. Resolving solid with inherit throws, including appearance inherited from ButtonGroup and wrapper defaults.</ParamField><ParamField body="Action.elevated" type="boolean">diff --git a/packages/twenty-docs/snippets/ui/generated/components/input/icon-button.mdx b/packages/twenty-docs/snippets/ui/generated/components/input/icon-button.mdxindex 9a9a15bcc8b..5fe9581de0c 100644--- a/packages/twenty-docs/snippets/ui/generated/components/input/icon-button.mdx+++ b/packages/twenty-docs/snippets/ui/generated/components/input/icon-button.mdx@@ -28,8 +28,8 @@returns a class based on the component's state.</ParamField>-<ParamField body="color" type=""accent" | "danger" | "neutral" | "success"" default="neutral">- Semantic color of the button.+<ParamField body="color" type=""accent" | "danger" | "inherit" | "neutral" | "success"" default="neutral">+ Semantic color of the button. `inherit` uses the surrounding text color for the label, icons, loader, and outline border, with translucent black interaction surfaces. It supports outline, ghost, soft, and link. Resolving solid with inherit throws, including appearance inherited from ButtonGroup and wrapper defaults.</ParamField><ParamField body="elevated" type="boolean">diff --git a/packages/twenty-docs/snippets/ui/generated/components/input/light-button.mdx b/packages/twenty-docs/snippets/ui/generated/components/input/light-button.mdxindex 0b54fb00fec..4a5c4438459 100644--- a/packages/twenty-docs/snippets/ui/generated/components/input/light-button.mdx+++ b/packages/twenty-docs/snippets/ui/generated/components/input/light-button.mdx@@ -16,8 +16,8 @@returns a class based on the component's state.</ParamField>-<ParamField body="color" type=""accent" | "danger" | "neutral" | "success"">- Semantic color of the button.+<ParamField body="color" type=""accent" | "danger" | "inherit" | "neutral" | "success"">+ Semantic color of the button. `inherit` uses the surrounding text color for the label, icons, loader, and outline border, with translucent black interaction surfaces. It supports outline, ghost, soft, and link. Resolving solid with inherit throws, including appearance inherited from ButtonGroup and wrapper defaults.</ParamField><ParamField body="elevated" type="boolean">diff --git a/packages/twenty-docs/snippets/ui/generated/components/input/light-icon-button.mdx b/packages/twenty-docs/snippets/ui/generated/components/input/light-icon-button.mdxindex 65a89399a84..07279fe099c 100644--- a/packages/twenty-docs/snippets/ui/generated/components/input/light-icon-button.mdx+++ b/packages/twenty-docs/snippets/ui/generated/components/input/light-icon-button.mdx@@ -28,8 +28,8 @@returns a class based on the component's state.</ParamField>-<ParamField body="color" type=""accent" | "danger" | "neutral" | "success"">- Semantic color of the button.+<ParamField body="color" type=""accent" | "danger" | "inherit" | "neutral" | "success"">+ Semantic color of the button. `inherit` uses the surrounding text color for the label, icons, loader, and outline border, with translucent black interaction surfaces. It supports outline, ghost, soft, and link. Resolving solid with inherit throws, including appearance inherited from ButtonGroup and wrapper defaults.</ParamField><ParamField body="elevated" type="boolean">diff --git a/packages/twenty-docs/snippets/ui/generated/components/input/main-button.mdx b/packages/twenty-docs/snippets/ui/generated/components/input/main-button.mdxindex ef58b0e4c96..82b1fd06919 100644--- a/packages/twenty-docs/snippets/ui/generated/components/input/main-button.mdx+++ b/packages/twenty-docs/snippets/ui/generated/components/input/main-button.mdx@@ -16,8 +16,8 @@returns a class based on the component's state.</ParamField>-<ParamField body="color" type=""accent" | "danger" | "neutral" | "success"">- Semantic color of the button.+<ParamField body="color" type=""accent" | "danger" | "inherit" | "neutral" | "success"">+ Semantic color of the button. `inherit` uses the surrounding text color for the label, icons, loader, and outline border, with translucent black interaction surfaces. It supports outline, ghost, soft, and link. Resolving solid with inherit throws, including appearance inherited from ButtonGroup and wrapper defaults.</ParamField><ParamField body="elevated" type="boolean" default="true">diff --git a/packages/twenty-docs/snippets/ui/generated/input/button-group.mdx b/packages/twenty-docs/snippets/ui/generated/input/button-group.mdxindex 86b853d33a4..0643f2c0bec 100644--- a/packages/twenty-docs/snippets/ui/generated/input/button-group.mdx+++ b/packages/twenty-docs/snippets/ui/generated/input/button-group.mdx@@ -15,8 +15,8 @@Join adjacent controls. Set to false for independently rounded buttons with a 2px gap.</ParamField>-<ParamField body="color" type=""accent" | "danger" | "neutral" | "success"">- Default semantic color for children without an explicit color.+<ParamField body="color" type=""accent" | "danger" | "inherit" | "neutral" | "success"">+ Default semantic color for children without an explicit color. Inherited color requires each child to resolve to a non-solid variant; explicit child overrides take precedence.</ParamField><ParamField body="framed" type="boolean" default="false">diff --git a/packages/twenty-docs/snippets/ui/generated/input/button.mdx b/packages/twenty-docs/snippets/ui/generated/input/button.mdxindex 931d6887a03..d22b0f08a1b 100644--- a/packages/twenty-docs/snippets/ui/generated/input/button.mdx+++ b/packages/twenty-docs/snippets/ui/generated/input/button.mdx@@ -16,8 +16,8 @@returns a class based on the component's state.</ParamField>-<ParamField body="color" type=""accent" | "danger" | "neutral" | "success"" default="neutral">- Semantic color of the button.+<ParamField body="color" type=""accent" | "danger" | "inherit" | "neutral" | "success"" default="neutral">+ Semantic color of the button. `inherit` uses the surrounding text color for the label, icons, loader, and outline border, with translucent black interaction surfaces. It supports outline, ghost, soft, and link. Resolving solid with inherit throws, including appearance inherited from ButtonGroup and wrapper defaults.</ParamField><ParamField body="elevated" type="boolean" default="false">diff --git a/packages/twenty-docs/ui/components/input/main-button.mdx b/packages/twenty-docs/ui/components/input/main-button.mdxindex 43b20daf8cf..77d65664f1a 100644--- a/packages/twenty-docs/ui/components/input/main-button.mdx+++ b/packages/twenty-docs/ui/components/input/main-button.mdx@@ -54,6 +54,9 @@ export const SaveProfile = () => (Width follows the content unless you set `fullWidth` or provide applicationlayout styling. Override `variant`, `color`, `size`, and `elevated` as needed;for example, use `variant="outline"` and `elevated={false}` for an outlined action.++With `color="inherit"`, choose a non-solid variant explicitly or inherit one from ButtonGroup. The standalone solid default with inherited color throws a runtime error.+Keep page layout in your application's styling.## Interactiondiff --git a/packages/twenty-docs/ui/primitives/input/button-group.mdx b/packages/twenty-docs/ui/primitives/input/button-group.mdxindex d23689808e2..7cb666cab57 100644--- a/packages/twenty-docs/ui/primitives/input/button-group.mdx+++ b/packages/twenty-docs/ui/primitives/input/button-group.mdx@@ -39,6 +39,8 @@ For a mutually exclusive choice, use [RadioGroup](/ui/primitives/input/radio-groEach appearance prop resolves independently: the child's explicit prop, then the group default, then the component default. This applies to both Button and IconButton, including an explicit `IconButton size="xs"`. Defaults reach children through fragments, wrappers, and tooltip anchors.+A group can supply `color="inherit"` on a colored surface. A child that resolves to inherited color must also resolve to a non-solid variant. Explicit child color and variant overrides take precedence, so a child may choose a non-solid variant or a semantic color when the group supplies solid and inherit together.+Keep attached buttons at the same size so their edges align. This example overrides variant and color while inheriting the group size.```tsxdiff --git a/packages/twenty-docs/ui/primitives/input/button.mdx b/packages/twenty-docs/ui/primitives/input/button.mdxindex e65d7552d2a..b870bcd14dc 100644--- a/packages/twenty-docs/ui/primitives/input/button.mdx+++ b/packages/twenty-docs/ui/primitives/input/button.mdx@@ -49,6 +49,25 @@ export const CreateRecord = () => (Choose `solid`, `outline`, `soft`, `ghost`, or `link` independently of the `neutral`, `accent`, `danger`, or `success` color. Sizes are `sm` and `md`; the defaults are `outline`, `neutral`, and `md`. `fullWidth` fills the available width. `startIcon` and `endIcon` accept elements and are decorative. `elevated` adds a shadow and backdrop blur. Neutral outline buttons also gain a bordered surface with matching text and interaction colors. Other variants and semantic colors keep their existing palette. It defaults to `false` and does not change size or position. `shortcut` displays keyboard hints on larger screens; bind the shortcuts in your application.+Use `color="inherit"` for controls on a colored surface. The label, icons, loader, and outline border follow the surrounding text color. Interaction fills use translucent black. Outline buttons rest on a transparent surface with a 25% currentColor border and use 10% and 20% black fills on hover and press. Ghost uses transparent, 10%, and 20% black fills; soft uses 10%, 20%, and 30%. Link stays unfilled.++`inherit` supports `outline`, `ghost`, `soft`, and `link`. A resolved `solid` and `inherit` combination throws a runtime error, including defaults supplied by ButtonGroup or a wrapper. `MainButton` defaults to solid, so supply a non-solid variant when inheriting color.++```tsx+import { Button } from 'twenty-ui/primitives/input';++export const SurfaceActions = () => (+ <>+ <Button color="inherit" variant="outline">+ Save+ </Button>+ <Button color="inherit" variant="ghost">+ Cancel+ </Button>+ </>+);+```+`link` uses compact text with no border or filled background. It follows its content height at either size, with a smaller font and narrower padding. Its neutral color uses stronger text on hover. The appearance does not determine semantics: use `onClick` for actions and `href` for navigation.`disabled` and `loading` prevent activation. Loading keeps the label accessible and communicates a busy state. By default, `loadingPosition="center"` hides the content while preserving its layout space and centers the spinner. Set `loadingPosition` to `start` or `end` to keep children and the opposite icon visible while replacing the corresponding icon with the spinner.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.tsxindex a89eaed11e8..c95a9a3a81f 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@@ -11,7 +11,8 @@ import { IconGripVertical, IconPencil, IconPlus, IconX } from 'twenty-ui/icon';import { Button, ButtonGroup } from 'twenty-ui/primitives/input';import { ListItem } from 'twenty-ui/primitives/navigation';import 'twenty-ui/style.css';-import { ThemeProvider } from 'twenty-ui/theme';+import { ThemeProvider, themeCssVariables } from 'twenty-ui/theme';+import { Text } from 'twenty-ui/primitives/typography';const ButtonControls = () => {const [activations, setActivations] = useState(0);@@ -42,6 +43,17 @@ const ButtonControls = () => {>Create record</Button>+ <Text+ data-testid="inherited-button-surface"+ style={{+ background: themeCssVariables.color.blue,+ color: themeCssVariables.font.color.onAccent,+ }}+ >+ <Button color="inherit" variant="outline" startIcon={<IconPlus />}>+ Inherited action+ </Button>+ </Text><Button disabled onClick={handleClick}>Disabled button</Button>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.tsindex 014f5af57ce..6ca6f29fb33 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@@ -34,6 +34,17 @@ export const buttonControlsTest: TwentyUiGalleryPlayFunction = async (await waitFor(() =>expect(canvas.getByLabelText('Activations')).toHaveTextContent('3'),);+ const inheritedButton = canvas.getByRole('button', {+ name: 'Inherited action',+ });+ const inheritedColor = getComputedStyle(+ canvas.getByTestId('inherited-button-surface'),+ ).color;++ await expect(getComputedStyle(inheritedButton).color).toBe(inheritedColor);+ await expect(inheritedButton.querySelector('svg')).toHaveStyle({+ color: inheritedColor,+ });const disabled = canvas.getByRole('button', { name: 'Disabled button' });await expect(disabled).toBeDisabled();await userEvent.click(disabled);diff --git a/packages/twenty-front/src/modules/layout-customization/components/LayoutCustomizationBar.tsx b/packages/twenty-front/src/modules/layout-customization/components/LayoutCustomizationBar.tsxindex 3155669644e..59109743bb3 100644--- a/packages/twenty-front/src/modules/layout-customization/components/LayoutCustomizationBar.tsx+++ b/packages/twenty-front/src/modules/layout-customization/components/LayoutCustomizationBar.tsx@@ -4,7 +4,7 @@ import { AnimatePresence, motion } from 'framer-motion';import { useAtomValue } from 'jotai';import { isDefined } from 'twenty-shared/utils';import { IconCheck, IconPaint } from 'twenty-ui/icon';-import { GRAY_SCALE_LIGHT, useTheme, themeCssVariables } from 'twenty-ui/theme';+import { useTheme, themeCssVariables } from 'twenty-ui/theme';import { LayoutCustomizationBarMenuDropdown } from '@/layout-customization/components/LayoutCustomizationBarMenuDropdown';import { LayoutCustomizationBarResetConfirmationModal } from '@/layout-customization/components/LayoutCustomizationBarResetConfirmationModal';@@ -28,24 +28,11 @@ const StyledContainer = styled.div`align-items: center;background: ${themeCssVariables.color.blue};box-sizing: border-box;- color: ${GRAY_SCALE_LIGHT.gray1};+ color: ${themeCssVariables.font.color.onAccent};display: flex;justify-content: space-between;padding: ${themeCssVariables.spacing[2]} ${themeCssVariables.spacing[3]};width: 100%;-- button,- button * {- color: ${GRAY_SCALE_LIGHT.gray1};- }-- button {- --tw-button-color: ${GRAY_SCALE_LIGHT.gray1} !important;- }-- button[type='submit']:not(:disabled):not(:focus) {- border-color: color(display-p3 1 1 1 / 0.5);- }`;const StyledLeftSection = styled.div`@@ -126,7 +113,7 @@ const LayoutCustomizationBarContent = () => {isSaveDisabled={!isDirty || isSaving}isCancelDisabled={isSaving}isLoading={isSaving}- inverted+ color="inherit"saveIcon={IconCheck}/></StyledRightSection>diff --git a/packages/twenty-front/src/modules/layout-customization/components/LayoutCustomizationBarMenuDropdown.tsx b/packages/twenty-front/src/modules/layout-customization/components/LayoutCustomizationBarMenuDropdown.tsxindex 40fff5c2c9c..e002b09c9a1 100644--- a/packages/twenty-front/src/modules/layout-customization/components/LayoutCustomizationBarMenuDropdown.tsx+++ b/packages/twenty-front/src/modules/layout-customization/components/LayoutCustomizationBarMenuDropdown.tsx@@ -1,5 +1,4 @@import { LAYOUT_CUSTOMIZATION_BAR_DROPDOWN_ID } from '@/layout-customization/constants/LayoutCustomizationBarDropdownId';-import { styled } from '@linaria/react';import { useLingui } from '@lingui/react/macro';import { IconDotsVertical, IconReload } from 'twenty-ui/icon';import { DropdownRoot } from '@/ui/layout/dropdown/components/DropdownRoot';@@ -7,24 +6,10 @@ import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContentimport { GenericDropdownContentWidth } from '@/ui/layout/dropdown/constants/GenericDropdownContentWidth';import { LightIconButton } from 'twenty-ui/components/input';import { Dropdown } from 'twenty-ui/components/navigation';-import { GRAY_SCALE_LIGHT, themeCssVariables } from 'twenty-ui/theme';import { RESET_RECORD_PAGE_LAYOUT_MODAL_ID } from '@/layout-customization/constants/ResetRecordPageLayoutModalId';import { useDialog } from '@/ui/layout/dialog/hooks/useDialog';-const StyledInvertedIconButtonWrapper = styled.span`- align-items: center;- display: flex;-- button {- color: ${GRAY_SCALE_LIGHT.gray1};- }-- button:hover {- background: ${themeCssVariables.background.transparent.light};- }-`;-export const LayoutCustomizationBarMenuDropdown = () => {const { t } = useLingui();const { openDialog } = useDialog();@@ -35,18 +20,17 @@ export const LayoutCustomizationBarMenuDropdown = () => {return (<DropdownRoot dropdownId={LAYOUT_CUSTOMIZATION_BAR_DROPDOWN_ID} type="menu">- <StyledInvertedIconButtonWrapper>- <Dropdown.Trigger- render={- <LightIconButton- emphasis="subtle"- aria-label={t`Layout customization menu`}- >- <IconDotsVertical />- </LightIconButton>- }- />- </StyledInvertedIconButtonWrapper>+ <Dropdown.Trigger+ render={+ <LightIconButton+ emphasis="subtle"+ color="inherit"+ aria-label={t`Layout customization menu`}+ >+ <IconDotsVertical />+ </LightIconButton>+ }+ /><DropdownContent width={GenericDropdownContentWidth.Large}><Dropdown.Section><Dropdown.ActionItemdiff --git a/packages/twenty-front/src/modules/settings/components/SaveAndCancelButtons/CancelButton.tsx b/packages/twenty-front/src/modules/settings/components/SaveAndCancelButtons/CancelButton.tsxindex 595489aded5..94fdc34e9dc 100644--- a/packages/twenty-front/src/modules/settings/components/SaveAndCancelButtons/CancelButton.tsx+++ b/packages/twenty-front/src/modules/settings/components/SaveAndCancelButtons/CancelButton.tsx@@ -1,25 +1,24 @@-import { BUTTON_INVERTED_CLASS_NAME } from '@/ui/input/styles/ButtonInvertedClassName';import { useLingui } from '@lingui/react/macro';import { LightButton } from 'twenty-ui/components/input';-import { Button } from 'twenty-ui/primitives/input';+import { Button, type ButtonColor } from 'twenty-ui/primitives/input';type CancelButtonProps = {onCancel?: () => void;disabled?: boolean;- inverted?: boolean;+ color?: ButtonColor;};export const CancelButton = ({onCancel,disabled = false,- inverted = false,+ color,}: CancelButtonProps) => {const { t } = useLingui();- if (inverted) {+ if (color === 'inherit') {return (<Button- className={BUTTON_INVERTED_CLASS_NAME}+ color={color}size="sm"onClick={onCancel}disabled={disabled}@@ -31,6 +30,7 @@ export const CancelButton = ({return (<LightButtonemphasis="subtle"+ color={color}onClick={onCancel}disabled={disabled}>{t`Cancel`}</LightButton>diff --git a/packages/twenty-front/src/modules/settings/components/SaveAndCancelButtons/SaveAndCancelButtons.tsx b/packages/twenty-front/src/modules/settings/components/SaveAndCancelButtons/SaveAndCancelButtons.tsxindex 63d731b3a4a..27db9dc48fc 100644--- a/packages/twenty-front/src/modules/settings/components/SaveAndCancelButtons/SaveAndCancelButtons.tsx+++ b/packages/twenty-front/src/modules/settings/components/SaveAndCancelButtons/SaveAndCancelButtons.tsx@@ -1,5 +1,6 @@import { styled } from '@linaria/react';import type { IconComponent } from 'twenty-ui/icon';+import { type ButtonColor } from 'twenty-ui/primitives/input';import { themeCssVariables } from 'twenty-ui/theme';import { CancelButton } from './CancelButton';@@ -17,7 +18,7 @@ type SaveAndCancelButtonsProps = {onCancel?: () => void;isSaveDisabled?: boolean;isCancelDisabled?: boolean;- inverted?: boolean;+ color?: ButtonColor;saveIcon?: IconComponent;};@@ -27,7 +28,7 @@ export const SaveAndCancelButtons = ({onCancel,isSaveDisabled,isCancelDisabled,- inverted = false,+ color,saveIcon,}: SaveAndCancelButtonsProps) => {return (@@ -35,13 +36,13 @@ export const SaveAndCancelButtons = ({<CancelButtononCancel={onCancel}disabled={isCancelDisabled}- inverted={inverted}+ color={color}/><SaveButtononSave={onSave}disabled={isSaveDisabled}isLoading={isLoading}- inverted={inverted}+ color={color}saveIcon={saveIcon}/></StyledContainer>diff --git a/packages/twenty-front/src/modules/settings/components/SaveAndCancelButtons/SaveButton.tsx b/packages/twenty-front/src/modules/settings/components/SaveAndCancelButtons/SaveButton.tsxindex f42cb02d435..88198b93c56 100644--- a/packages/twenty-front/src/modules/settings/components/SaveAndCancelButtons/SaveButton.tsx+++ b/packages/twenty-front/src/modules/settings/components/SaveAndCancelButtons/SaveButton.tsx@@ -1,13 +1,12 @@-import { BUTTON_INVERTED_CLASS_NAME } from '@/ui/input/styles/ButtonInvertedClassName';import { t } from '@lingui/core/macro';import { type IconComponent, IconDeviceFloppy } from 'twenty-ui/icon';-import { Button } from 'twenty-ui/primitives/input';+import { Button, type ButtonColor } from 'twenty-ui/primitives/input';type SaveButtonProps = {onSave?: () => void;disabled?: boolean;isLoading?: boolean;- inverted?: boolean;+ color?: ButtonColor;saveIcon?: IconComponent;};@@ -15,20 +14,19 @@ export const SaveButton = ({onSave,disabled,isLoading,- inverted = false,+ color = 'accent',saveIcon: SaveIcon = IconDeviceFloppy,}: SaveButtonProps) => {return (<Button- className={inverted ? BUTTON_INVERTED_CLASS_NAME : undefined}size="sm"disabled={disabled}onClick={onSave}type="submit"startIcon={<SaveIcon />}loading={isLoading}- variant={inverted ? 'outline' : 'solid'}- color={inverted ? 'neutral' : 'accent'}+ variant={color === 'inherit' ? 'outline' : 'solid'}+ color={color}>{t`Save`}</Button>);};diff --git a/packages/twenty-front/src/modules/settings/components/__stories__/SaveAndCancelButtons.stories.tsx b/packages/twenty-front/src/modules/settings/components/__stories__/SaveAndCancelButtons.stories.tsxnew file mode 100644index 00000000000..c9ee2a7ea15--- /dev/null+++ b/packages/twenty-front/src/modules/settings/components/__stories__/SaveAndCancelButtons.stories.tsx@@ -0,0 +1,60 @@+import { type Meta, type StoryObj } from '@storybook/react-vite';+import { expect, fn, userEvent, within } from 'storybook/test';+import { Text } from 'twenty-ui/primitives/typography';+import { themeCssVariables } from 'twenty-ui/theme';++import { SaveAndCancelButtons } from '@/settings/components/SaveAndCancelButtons/SaveAndCancelButtons';++const meta: Meta<typeof SaveAndCancelButtons> = {+ title: 'Modules/Settings/SaveAndCancelButtons',+ component: SaveAndCancelButtons,+ args: { onSave: fn(), onCancel: fn() },+};++export default meta;+type Story = StoryObj<typeof SaveAndCancelButtons>;++export const Default: Story = {};++export const InheritedColor: Story = {+ render: ({ onSave, onCancel }) => (+ <Text+ data-testid="accent-surface"+ style={{+ background: themeCssVariables.color.blue,+ color: themeCssVariables.font.color.onAccent,+ padding: themeCssVariables.spacing[4],+ }}+ >+ <SaveAndCancelButtons+ color="inherit"+ onSave={onSave}+ onCancel={onCancel}+ />+ </Text>+ ),+ play: async ({ canvasElement, args }) => {+ const canvas = within(canvasElement);+ const saveButton = canvas.getByRole('button', { name: 'Save' });+ const cancelButton = canvas.getByRole('button', { name: 'Cancel' });+ const inheritedColor = getComputedStyle(+ canvas.getByTestId('accent-surface'),+ ).color;++ await expect(saveButton).toHaveAttribute('data-variant', 'outline');+ await expect(cancelButton).toHaveAttribute('data-variant', 'ghost');++ for (const button of [saveButton, cancelButton]) {+ await expect(button).toHaveAttribute('data-color', 'inherit');+ await expect(getComputedStyle(button).color).toBe(inheritedColor);+ }++ await expect(saveButton.querySelector('svg')).toHaveStyle({+ color: inheritedColor,+ });+ await userEvent.click(saveButton);+ await userEvent.click(cancelButton);+ await expect(args.onSave).toHaveBeenCalledOnce();+ await expect(args.onCancel).toHaveBeenCalledOnce();+ },+};diff --git a/packages/twenty-front/src/modules/ui/input/styles/ButtonInvertedClassName.ts b/packages/twenty-front/src/modules/ui/input/styles/ButtonInvertedClassName.tsdeleted file mode 100644index ea41efa1b07..00000000000--- a/packages/twenty-front/src/modules/ui/input/styles/ButtonInvertedClassName.ts+++ /dev/null@@ -1,16 +0,0 @@-import { css } from '@linaria/core';-import { themeCssVariables } from 'twenty-ui/theme';--export const BUTTON_INVERTED_CLASS_NAME = css`- &[data-variant='outline'],- &[data-variant='ghost'] {- --tw-button-active: ${themeCssVariables.background.transparent.medium};- --tw-button-background: transparent;- --tw-button-color: ${themeCssVariables.font.color.inverted};- --tw-button-hover: ${themeCssVariables.background.transparent.light};- }-- &[data-variant='outline'] {- --tw-button-border: ${themeCssVariables.background.transparent.primary};- }-`;diff --git a/packages/twenty-ui/docs/buttonGroupPropDescriptions.ts b/packages/twenty-ui/docs/buttonGroupPropDescriptions.tsindex 0e921dcec72..491e4b26f6c 100644--- a/packages/twenty-ui/docs/buttonGroupPropDescriptions.ts+++ b/packages/twenty-ui/docs/buttonGroupPropDescriptions.ts@@ -7,6 +7,7 @@ export const BUTTON_GROUP_PROP_DESCRIPTIONS = {'Add a translucent frame with padding and concentric corners. Button sizes and appearance remain independent unless set on the group.',variant:'Default surface treatment for children without an explicit variant.',- color: 'Default semantic color for children without an explicit color.',+ color:+ 'Default semantic color for children without an explicit color. Inherited color requires each child to resolve to a non-solid variant; explicit child overrides take precedence.',size: 'Default button height for children without an explicit size.',} satisfies Partial<Record<keyof ButtonGroupProps, string>>;diff --git a/packages/twenty-ui/docs/buttonPropDescriptions.ts b/packages/twenty-ui/docs/buttonPropDescriptions.tsindex 6c8a82de436..dd13fe3899d 100644--- a/packages/twenty-ui/docs/buttonPropDescriptions.ts+++ b/packages/twenty-ui/docs/buttonPropDescriptions.ts@@ -3,7 +3,8 @@ import { type ButtonProps } from '../src/primitives/input/Button/types/ButtonProexport const BUTTON_PROP_DESCRIPTIONS = {variant:'Visual treatment of the button surface. `link` uses compact text styling without a filled surface or border; render composition determines native semantics.',- color: 'Semantic color of the button.',+ color:+ 'Semantic color of the button. `inherit` uses the surrounding text color for the label, icons, loader, and outline border, with translucent black interaction surfaces. It supports outline, ghost, soft, and link. Resolving solid with inherit throws, including appearance inherited from ButtonGroup and wrapper defaults.',size: 'Button height: `sm` (24px) or `md` (32px). The `link` variant uses its content height at either size.',fullWidth: 'Expands the button to fill its container width.',loading: 'Shows a loading indicator and disables activation.',diff --git a/packages/twenty-ui/generated/components.docs.json b/packages/twenty-ui/generated/components.docs.jsonindex 2624c3aa45e..5997eb5884c 100644--- a/packages/twenty-ui/generated/components.docs.json+++ b/packages/twenty-ui/generated/components.docs.json@@ -2588,10 +2588,10 @@},{"name": "color",- "type": "\"accent\" | \"danger\" | \"neutral\" | \"success\"",+ "type": "\"accent\" | \"danger\" | \"inherit\" | \"neutral\" | \"success\"","required": false,"defaultValue": null,- "description": "Semantic color of the button."+ "description": "Semantic color of the button. `inherit` uses the surrounding text color for the label, icons, loader, and outline border, with translucent black interaction surfaces. It supports outline, ghost, soft, and link. Resolving solid with inherit throws, including appearance inherited from ButtonGroup and wrapper defaults."},{"name": "elevated",@@ -2742,10 +2742,10 @@},{"name": "color",- "type": "\"accent\" | \"danger\" | \"neutral\" | \"success\"",+ "type": "\"accent\" | \"danger\" | \"inherit\" | \"neutral\" | \"success\"","required": false,"defaultValue": "neutral",- "description": "Semantic color of the button."+ "description": "Semantic color of the button. `inherit` uses the surrounding text color for the label, icons, loader, and outline border, with translucent black interaction surfaces. It supports outline, ghost, soft, and link. Resolving solid with inherit throws, including appearance inherited from ButtonGroup and wrapper defaults."},{"name": "elevated",@@ -2868,10 +2868,10 @@},{"name": "color",- "type": "\"accent\" | \"danger\" | \"neutral\" | \"success\"",+ "type": "\"accent\" | \"danger\" | \"inherit\" | \"neutral\" | \"success\"","required": false,"defaultValue": null,- "description": "Semantic color of the button."+ "description": "Semantic color of the button. `inherit` uses the surrounding text color for the label, icons, loader, and outline border, with translucent black interaction surfaces. It supports outline, ghost, soft, and link. Resolving solid with inherit throws, including appearance inherited from ButtonGroup and wrapper defaults."},{"name": "elevated",@@ -3001,10 +3001,10 @@},{"name": "color",- "type": "\"accent\" | \"danger\" | \"neutral\" | \"success\"",+ "type": "\"accent\" | \"danger\" | \"inherit\" | \"neutral\" | \"success\"","required": false,"defaultValue": null,- "description": "Semantic color of the button."+ "description": "Semantic color of the button. `inherit` uses the surrounding text color for the label, icons, loader, and outline border, with translucent black interaction surfaces. It supports outline, ghost, soft, and link. Resolving solid with inherit throws, including appearance inherited from ButtonGroup and wrapper defaults."},{"name": "elevated",@@ -3141,10 +3141,10 @@},{"name": "color",- "type": "\"accent\" | \"danger\" | \"neutral\" | \"success\"",+ "type": "\"accent\" | \"danger\" | \"inherit\" | \"neutral\" | \"success\"","required": false,"defaultValue": "neutral",- "description": "Semantic color of the button."+ "description": "Semantic color of the button. `inherit` uses the surrounding text color for the label, icons, loader, and outline border, with translucent black interaction surfaces. It supports outline, ghost, soft, and link. Resolving solid with inherit throws, including appearance inherited from ButtonGroup and wrapper defaults."},{"name": "elevated",@@ -3274,10 +3274,10 @@},{"name": "color",- "type": "\"accent\" | \"danger\" | \"neutral\" | \"success\"",+ "type": "\"accent\" | \"danger\" | \"inherit\" | \"neutral\" | \"success\"","required": false,"defaultValue": null,- "description": "Default semantic color for children without an explicit color."+ "description": "Default semantic color for children without an explicit color. Inherited color requires each child to resolve to a non-solid variant; explicit child overrides take precedence."},{"name": "framed",@@ -13910,10 +13910,10 @@},{"name": "color",- "type": "\"accent\" | \"danger\" | \"neutral\" | \"success\"",+ "type": "\"accent\" | \"danger\" | \"inherit\" | \"neutral\" | \"success\"","required": false,"defaultValue": null,- "description": "Semantic color of the button."+ "description": "Semantic color of the button. `inherit` uses the surrounding text color for the label, icons, loader, and outline border, with translucent black interaction surfaces. It supports outline, ghost, soft, and link. Resolving solid with inherit throws, including appearance inherited from ButtonGroup and wrapper defaults."},{"name": "elevated",diff --git a/packages/twenty-ui/src/components/input/MainButton/__stories__/MainButton.stories.tsx b/packages/twenty-ui/src/components/input/MainButton/__stories__/MainButton.stories.tsxindex cd73c19bc08..65930dfdb32 100644--- a/packages/twenty-ui/src/components/input/MainButton/__stories__/MainButton.stories.tsx+++ b/packages/twenty-ui/src/components/input/MainButton/__stories__/MainButton.stories.tsx@@ -2,8 +2,15 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';import { type FormEventHandler } from 'react';import { expect, fn, userEvent, within } from 'storybook/test';+import { LightButton } from '@ui/components/input/LightButton/LightButton';+import { LightIconButton } from '@ui/components/input/LightIconButton/LightIconButton';+import { IconPlus } from '@ui/icon';+import { Button } from '@ui/primitives/input/Button/Button';import { type ButtonProps } from '@ui/primitives/input/Button/types/ButtonProps';import { type ButtonVariant } from '@ui/primitives/input/Button/types/ButtonVariant';+import { ButtonGroup } from '@ui/primitives/input/ButtonGroup/ButtonGroup';+import { Text } from '@ui/primitives/typography';+import { themeCssVariables } from '@ui/theme';import {A11Y_DEFER_COLOR_CONTRAST,CatalogDecorator,@@ -133,3 +140,39 @@ export const CatalogDark: CatalogStory<Story, typeof MainButton> = {tags: ['!autodocs'],globals: { colorScheme: 'dark' },};++export const InheritedColorGroup: Story = {+ render: () => (+ <Text+ style={{+ background: themeCssVariables.color.blue,+ color: themeCssVariables.font.color.onAccent,+ padding: themeCssVariables.spacing[4],+ }}+ >+ <ButtonGroup+ variant="outline"+ color="inherit"+ aria-label="Surface actions"+ >+ <Button>Grouped action</Button>+ <MainButton>Main action</MainButton>+ <LightButton>Light action</LightButton>+ <LightIconButton aria-label="Add action">+ <IconPlus />+ </LightIconButton>+ </ButtonGroup>+ </Text>+ ),+ play: async ({ canvasElement }) => {+ const canvas = within(canvasElement);+ const group = canvas.getByRole('group', { name: 'Surface actions' });+ const inheritedColor = getComputedStyle(group).color;++ for (const button of within(group).getAllByRole('button')) {+ await expect(button).toHaveAttribute('data-variant', 'outline');+ await expect(button).toHaveAttribute('data-color', 'inherit');+ await expect(getComputedStyle(button).color).toBe(inheritedColor);+ }+ },+};diff --git a/packages/twenty-ui/src/components/input/MainButton/__tests__/MainButton.test.tsx b/packages/twenty-ui/src/components/input/MainButton/__tests__/MainButton.test.tsxindex a6f04eb12e9..bd7916e2c1f 100644--- a/packages/twenty-ui/src/components/input/MainButton/__tests__/MainButton.test.tsx+++ b/packages/twenty-ui/src/components/input/MainButton/__tests__/MainButton.test.tsx@@ -1,4 +1,5 @@import { render, screen } from '@testing-library/react';+import { renderToStaticMarkup } from 'react-dom/server';import { ButtonGroup } from '@ui/primitives/input/ButtonGroup/ButtonGroup';import { runComponentConformance } from '@test-utilities/conformance/runComponentConformance';@@ -46,3 +47,23 @@ describe('MainButton appearance', () => {expect(button).toHaveAttribute('data-variant', 'outline');});});++describe('MainButton inherited color contract', () => {+ it('rejects inherited color with its standalone solid default', () => {+ expect(() =>+ renderToStaticMarkup(<MainButton color="inherit">Save</MainButton>),+ ).toThrow(+ 'Button color="inherit" does not support variant="solid". Use outline, ghost, soft, or link.',+ );+ });++ it('accepts an explicit non-solid variant before solid group defaults', () => {+ expect(() =>+ renderToStaticMarkup(+ <ButtonGroup variant="solid" color="inherit">+ <MainButton variant="outline">Preview</MainButton>+ </ButtonGroup>,+ ),+ ).not.toThrow();+ });+});diff --git a/packages/twenty-ui/src/primitives/feedback/Banner/__tests__/BannerAction.test.tsx b/packages/twenty-ui/src/primitives/feedback/Banner/__tests__/BannerAction.test.tsxindex 0c55863f2ba..77c45e24d3e 100644--- a/packages/twenty-ui/src/primitives/feedback/Banner/__tests__/BannerAction.test.tsx+++ b/packages/twenty-ui/src/primitives/feedback/Banner/__tests__/BannerAction.test.tsx@@ -1,11 +1,9 @@import { runComponentConformance } from '@test-utilities/conformance/runComponentConformance';import { Banner } from '../Banner';-import styles from '../internal/BannerAction.module.scss';runComponentConformance({name: 'Banner.Action',element: <Banner.Action>Retry sync</Banner.Action>,refInstanceOf: HTMLButtonElement,- ownClassName: styles.action,});diff --git a/packages/twenty-ui/src/primitives/feedback/Banner/internal/BannerAction.module.scss b/packages/twenty-ui/src/primitives/feedback/Banner/internal/BannerAction.module.scssdeleted file mode 100644index fdad63b30ff..00000000000--- a/packages/twenty-ui/src/primitives/feedback/Banner/internal/BannerAction.module.scss+++ /dev/null@@ -1,8 +0,0 @@-.action[data-color][data-variant] {- --tw-button-active: color-mix(in srgb, currentColor 20%, transparent);- --tw-button-background: transparent;- --tw-button-border: color-mix(in srgb, currentColor 25%, transparent);- --tw-button-hover: color-mix(in srgb, currentColor 10%, transparent);-- color: inherit;-}diff --git a/packages/twenty-ui/src/primitives/feedback/Banner/internal/BannerAction.module.scss.d.ts b/packages/twenty-ui/src/primitives/feedback/Banner/internal/BannerAction.module.scss.d.tsdeleted file mode 100644index d6444d25cb7..00000000000--- a/packages/twenty-ui/src/primitives/feedback/Banner/internal/BannerAction.module.scss.d.ts+++ /dev/null@@ -1,4 +0,0 @@-declare const classNames: {- readonly action: 'action';-};-export default classNames;diff --git a/packages/twenty-ui/src/primitives/feedback/Banner/internal/BannerAction.tsx b/packages/twenty-ui/src/primitives/feedback/Banner/internal/BannerAction.tsxindex cb829c2468e..2164da35ece 100644--- a/packages/twenty-ui/src/primitives/feedback/Banner/internal/BannerAction.tsx+++ b/packages/twenty-ui/src/primitives/feedback/Banner/internal/BannerAction.tsx@@ -1,16 +1,13 @@import { Button } from '@ui/primitives/input/Button/Button';-import { mergeClassNames } from '@ui/utilities/internal/mergeClassNames';-import styles from './BannerAction.module.scss';import { type BannerActionProps } from '../types/BannerActionProps';-export const BannerAction = ({ className, ...props }: BannerActionProps) => {- return (- <Button- {...props}- size="sm"- variant="outline"- className={mergeClassNames(styles.action, className)}- />- );-};+export const BannerAction = (props: BannerActionProps) => (+ <Button+ // oxlint-disable-next-line react/jsx-props-no-spreading+ {...props}+ size="sm"+ variant="outline"+ color="inherit"+ />+);diff --git a/packages/twenty-ui/src/primitives/input/Button/Button.module.scss b/packages/twenty-ui/src/primitives/input/Button/Button.module.scssindex afd6b1010c6..7e13becb845 100644--- a/packages/twenty-ui/src/primitives/input/Button/Button.module.scss+++ b/packages/twenty-ui/src/primitives/input/Button/Button.module.scss@@ -178,6 +178,24 @@ $colors: (}}+.button[data-color='inherit'] {+ --tw-button-background: transparent;+ --tw-button-border: transparent;+ --tw-button-color: currentColor;+ --tw-button-hover: rgb(0 0 0 / 10%);+ --tw-button-active: rgb(0 0 0 / 20%);++ &[data-variant='outline'] {+ --tw-button-border: color-mix(in srgb, currentColor 25%, transparent);+ }++ &[data-variant='soft'] {+ --tw-button-background: rgb(0 0 0 / 10%);+ --tw-button-hover: rgb(0 0 0 / 20%);+ --tw-button-active: rgb(0 0 0 / 30%);+ }+}+.button[data-variant='link'] {--tw-button-background: transparent;--tw-button-border: transparent;diff --git a/packages/twenty-ui/src/primitives/input/Button/Button.tsx b/packages/twenty-ui/src/primitives/input/Button/Button.tsxindex 81da53a57ac..bf40ff131e7 100644--- a/packages/twenty-ui/src/primitives/input/Button/Button.tsx+++ b/packages/twenty-ui/src/primitives/input/Button/Button.tsx@@ -7,6 +7,7 @@ import { Shortcut } from '@ui/primitives/typography/Shortcut/Shortcut';import { ButtonGroupContext } from '@ui/primitives/input/ButtonGroup/internal/ButtonGroupContext';import { mergeClassNames } from '@ui/utilities/internal/mergeClassNames';import { isDefined } from '@ui/utilities/utils/isDefined';+import { doNotTranslate } from '@ui/utilities/internal/doNotTranslate';import styles from './Button.module.scss';import { type ButtonProps } from './types/ButtonProps';@@ -35,6 +36,15 @@ export const Button = ({const buttonGroup = useContext(ButtonGroupContext);const resolvedVariant = variant ?? buttonGroup?.variant ?? 'outline';const resolvedColor = color ?? buttonGroup?.color ?? 'neutral';++ if (resolvedVariant === 'solid' && resolvedColor === 'inherit') {+ throw new Error(+ doNotTranslate(+ 'Button color="inherit" does not support variant="solid". Use outline, ghost, soft, or link.',+ ),+ );+ }+const resolvedSize = size ?? buttonGroup?.size ?? 'md';const isAutomaticLink =isDefined(href) && !isDefined(render) && nativeButton !== true;diff --git a/packages/twenty-ui/src/primitives/input/Button/__stories__/Button.inherit.interactions.stories.tsx b/packages/twenty-ui/src/primitives/input/Button/__stories__/Button.inherit.interactions.stories.tsxnew file mode 100644index 00000000000..d22d5b8f332--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Button/__stories__/Button.inherit.interactions.stories.tsx@@ -0,0 +1,152 @@+import {+ type Decorator,+ type Meta,+ type StoryObj,+} from '@storybook/react-vite';+import { expect, fn, userEvent, within } from 'storybook/test';++import { IconPlus } from '@ui/icon';+import { Button } from '@ui/primitives/input/Button/Button';+import { Text } from '@ui/primitives/typography';+import { themeCssVariables } from '@ui/theme';+import { isDefined } from '@ui/utilities/utils/isDefined';++import { PopupTrigger as PopupTriggerStory } from './Button.stories';++const InheritedSurface: Decorator = (Story) => (+ <Text+ style={{+ background: themeCssVariables.color.blue,+ color: themeCssVariables.font.color.onAccent,+ display: 'flex',+ flexWrap: 'wrap',+ gap: themeCssVariables.spacing[2],+ padding: themeCssVariables.spacing[4],+ }}+ >+ <Story />+ </Text>+);++const meta: Meta<typeof Button> = {+ title: 'UI/Input/Button/Inherited Color',+ component: Button,+ decorators: [InheritedSurface],+};++export default meta;+type Story = StoryObj<typeof Button>;++export const Variants: Story = {+ args: { onClick: fn() },+ render: ({ onClick }) => (+ <>+ {(['outline', 'ghost', 'soft', 'link'] as const).map((variant) => (+ <Button+ key={variant}+ color="inherit"+ variant={variant}+ startIcon={<IconPlus />}+ onClick={onClick}+ >+ {variant}+ </Button>+ ))}+ </>+ ),+ play: async ({ canvasElement, args }) => {+ const canvas = within(canvasElement);++ for (const variant of ['outline', 'ghost', 'soft', 'link']) {+ const button = canvas.getByRole('button', { name: variant });+ const parent = button.parentElement;++ if (!isDefined(parent)) {+ throw new Error('Inherited buttons must have a colored surface');+ }++ const inheritedColor = getComputedStyle(parent).color;++ await expect(getComputedStyle(button).color).toBe(inheritedColor);+ await expect(button.querySelector('svg')).toHaveStyle({+ color: inheritedColor,+ });+ await userEvent.click(button);+ }++ await expect(args.onClick).toHaveBeenCalledTimes(4);+ },+};++export const DisabledAndLoading: Story = {+ args: { onClick: fn() },+ render: ({ onClick }) => (+ <>+ <Button color="inherit" variant="ghost" disabled onClick={onClick}>+ Disabled+ </Button>+ <Button color="inherit" variant="soft" loading onClick={onClick}>+ Loading+ </Button>+ </>+ ),+ play: async ({ canvasElement, args }) => {+ const canvas = within(canvasElement);+ const disabledButton = canvas.getByRole('button', { name: 'Disabled' });+ const loadingButton = canvas.getByRole('button', { name: 'Loading' });+ const loader = loadingButton.querySelector('div');++ await expect(disabledButton).toBeDisabled();+ await expect(loadingButton).toBeDisabled();+ await expect(loadingButton).toHaveAttribute('aria-busy', 'true');+ await expect(loader).toHaveStyle({+ borderColor: getComputedStyle(loadingButton).color,+ });+ await userEvent.click(disabledButton);+ await userEvent.click(loadingButton);+ await expect(args.onClick).not.toHaveBeenCalled();+ },+};++export const PressedPopupState: Story = {+ render: () => (+ <>+ <Button+ color="inherit"+ variant="soft"+ aria-pressed="true"+ data-popup-open+ >+ Pressed open+ </Button>+ <Button color="inherit" variant="soft" aria-pressed="true">+ Pressed closed+ </Button>+ <Button color="inherit" variant="outline" disabled data-popup-open>+ Disabled open+ </Button>+ </>+ ),+ play: async ({ canvasElement }) => {+ const canvas = within(canvasElement);+ const pressedOpen = canvas.getByRole('button', { name: 'Pressed open' });+ const pressedClosed = canvas.getByRole('button', {+ name: 'Pressed closed',+ });+ const disabledOpen = canvas.getByRole('button', { name: 'Disabled open' });++ await expect(getComputedStyle(pressedOpen).backgroundColor).toBe(+ getComputedStyle(pressedClosed).backgroundColor,+ );+ await expect(disabledOpen).toBeDisabled();+ await expect(getComputedStyle(disabledOpen).backgroundColor).toBe(+ 'rgba(0, 0, 0, 0)',+ );+ },+};++export const PopupTrigger: Story = {+ ...PopupTriggerStory,+ decorators: [InheritedSurface],+ args: { ...PopupTriggerStory.args, color: 'inherit' },+};diff --git a/packages/twenty-ui/src/primitives/input/Button/__stories__/Button.stories.tsx b/packages/twenty-ui/src/primitives/input/Button/__stories__/Button.stories.tsxindex 45c0a7d8985..0e7339ee434 100644--- a/packages/twenty-ui/src/primitives/input/Button/__stories__/Button.stories.tsx+++ b/packages/twenty-ui/src/primitives/input/Button/__stories__/Button.stories.tsx@@ -475,6 +475,7 @@ const BUTTON_CATALOG_GROUPS: {{ label: 'Accent', props: { color: 'accent', variant: 'solid' } },{ label: 'Danger', props: { color: 'danger', variant: 'solid' } },{ label: 'Success', props: { color: 'success', variant: 'solid' } },+ { label: 'Inherited', props: { color: 'inherit', variant: 'outline' } },],},{diff --git a/packages/twenty-ui/src/primitives/input/Button/__tests__/Button.inherit.test.tsx b/packages/twenty-ui/src/primitives/input/Button/__tests__/Button.inherit.test.tsxnew file mode 100644index 00000000000..7cb98e73ec0--- /dev/null+++ b/packages/twenty-ui/src/primitives/input/Button/__tests__/Button.inherit.test.tsx@@ -0,0 +1,62 @@+import { renderToStaticMarkup } from 'react-dom/server';+import { describe, expect, it } from 'vitest';++import { Button } from '@ui/primitives/input/Button/Button';+import { ButtonGroup } from '@ui/primitives/input/ButtonGroup/ButtonGroup';++describe('Button inherited color contract', () => {+ it.each([+ {+ appearance: 'explicit props',+ element: (+ <Button variant="solid" color="inherit">+ Save+ </Button>+ ),+ },+ {+ appearance: 'group defaults',+ element: (+ <ButtonGroup variant="solid" color="inherit">+ <Button>Save</Button>+ </ButtonGroup>+ ),+ },+ {+ appearance: 'explicit color and group variant',+ element: (+ <ButtonGroup variant="solid">+ <Button color="inherit">Save</Button>+ </ButtonGroup>+ ),+ },+ ])('rejects solid inherited color from $appearance', ({ element }) => {+ expect(() => renderToStaticMarkup(element)).toThrow(+ 'Button color="inherit" does not support variant="solid". Use outline, ghost, soft, or link.',+ );+ });++ it.each(['outline', 'ghost', 'soft', 'link'] as const)(+ 'allows inherited color with the %s variant',+ (variant) => {+ expect(() =>+ renderToStaticMarkup(+ <Button color="inherit" variant={variant}>+ Save+ </Button>,+ ),+ ).not.toThrow();+ },+ );++ it('validates each child after explicit group overrides', () => {+ expect(() =>+ renderToStaticMarkup(+ <ButtonGroup variant="solid" color="inherit">+ <Button variant="ghost">Cancel</Button>+ <Button color="accent">Save</Button>+ </ButtonGroup>,+ ),+ ).not.toThrow();+ });+});diff --git a/packages/twenty-ui/src/primitives/input/Button/types/ButtonColor.ts b/packages/twenty-ui/src/primitives/input/Button/types/ButtonColor.tsindex 81aa53a0bd5..c7abdfe4193 100644--- a/packages/twenty-ui/src/primitives/input/Button/types/ButtonColor.ts+++ b/packages/twenty-ui/src/primitives/input/Button/types/ButtonColor.ts@@ -1 +1,6 @@-export type ButtonColor = 'neutral' | 'accent' | 'danger' | 'success';+export type ButtonColor =+ | 'neutral'+ | 'accent'+ | 'danger'+ | 'success'+ | 'inherit';