Skip to content

The open alternative to Salesforce, designed for AI.

Move appearance choices into profile settings (#26987)

Raphaël Bosi0706ea775fb4
diff --git a/packages/twenty-docs/docs.json b/packages/twenty-docs/docs.json
index ad0266c9d16..e0954281e84 100644
--- a/packages/twenty-docs/docs.json
+++ b/packages/twenty-docs/docs.json
@@ -631,7 +631,6 @@
"ui/components/animated-icon-crossfade",
"ui/components/avatar-group",
"ui/components/callout",
- "ui/components/color-scheme-picker",
"ui/components/command-block",
"ui/components/inline-banner",
"ui/components/json-tree",
diff --git a/packages/twenty-docs/navigation/base-structure.json b/packages/twenty-docs/navigation/base-structure.json
index 49651479075..649c087b6ab 100644
--- a/packages/twenty-docs/navigation/base-structure.json
+++ b/packages/twenty-docs/navigation/base-structure.json
@@ -649,7 +649,6 @@
"ui/components/animated-icon-crossfade",
"ui/components/avatar-group",
"ui/components/callout",
- "ui/components/color-scheme-picker",
"ui/components/command-block",
"ui/components/inline-banner",
"ui/components/json-tree",
diff --git a/packages/twenty-docs/snippets/ui/generated/components/color-scheme-picker.mdx b/packages/twenty-docs/snippets/ui/generated/components/color-scheme-picker.mdx
deleted file mode 100644
index 3dad807446b..00000000000
--- a/packages/twenty-docs/snippets/ui/generated/components/color-scheme-picker.mdx
+++ /dev/null
@@ -1,36 +0,0 @@
-{/*
- * _____ _
- *|_ _|_ _____ _ __ | |_ _ _
- * | | \ \ /\ / / _ \ '_ \| __| | | | Auto-generated file
- * | | \ V V / __/ | | | |_| |_| | DO NOT EDIT - changes will be overwritten
- * |_| \_/\_/ \___|_| |_|\__|\__, | Generated by: npx nx generate:ui twenty-docs
- * |___/
- *
- * This file is generated from the documentation data in packages/twenty-ui/generated.
- * To update it, edit the component prop types or design tokens in twenty-ui and run:
- * npx nx generate:ui twenty-docs
- */}
-
-<ParamField body="className" type="string">
- Class applied to the outer container.
-</ParamField>
-
-<ParamField body="darkLabel" type="string" required>
- Visible label and accessible name of the dark choice.
-</ParamField>
-
-<ParamField body="lightLabel" type="string" required>
- Visible label and accessible name of the light choice.
-</ParamField>
-
-<ParamField body="onChange" type="(value: ColorScheme) =&gt; void" required>
- Called with the newly selected color scheme.
-</ParamField>
-
-<ParamField body="systemLabel" type="string" required>
- Visible label and accessible name of the system choice.
-</ParamField>
-
-<ParamField body="value" type="&quot;Dark&quot; | &quot;Light&quot; | &quot;System&quot;" required>
- Selected scheme: Light, Dark, or System. The application resolves system to a concrete theme.
-</ParamField>
diff --git a/packages/twenty-docs/ui/components/color-scheme-picker.mdx b/packages/twenty-docs/ui/components/color-scheme-picker.mdx
deleted file mode 100644
index 4fb7688b45f..00000000000
--- a/packages/twenty-docs/ui/components/color-scheme-picker.mdx
+++ /dev/null
@@ -1,43 +0,0 @@
----
-title: ColorSchemePicker
-description: Choose light, dark, or the system color scheme.
----
-
-import { StoryEmbed } from '/snippets/ui/StoryEmbed.mdx';
-import ColorSchemePickerReference from '/snippets/ui/generated/components/color-scheme-picker.mdx';
-
-`ColorSchemePicker` is controlled through `value` and `onChange`. Supply the three labels from your application. Selecting a scheme does not persist it or change a theme provider automatically.
-
-<StoryEmbed
- storyId="ui-input-colorschemepicker--default"
- title="Color scheme choices"
- height={260}
-/>
-
-```tsx
-import { useState } from 'react';
-import { ColorSchemePicker } from 'twenty-ui/components';
-import { type ColorScheme } from 'twenty-ui/primitives/input';
-
-export const AppearanceChoice = () => {
- const [scheme, setScheme] = useState<ColorScheme>('System');
-
- return (
- <ColorSchemePicker
- value={scheme}
- onChange={setScheme}
- lightLabel="Light"
- darkLabel="Dark"
- systemLabel="Use system setting"
- />
- );
-};
-```
-
-`ColorScheme` values are capitalized, while [ThemeProvider](/ui/theming) expects `light` or `dark`. Map `Light` and `Dark` to their lowercase names and resolve `System` from the system preference before passing the result to the provider. The three previews are separate button controls with Enter and Space activation. The selected checkmark is visual.
-
-Each label is both visible text and the accessible name of its choice. Supply localized `lightLabel`, `darkLabel`, and `systemLabel` values. Selection callbacks still receive `Light`, `Dark`, or `System`.
-
-## Props
-
-<ColorSchemePickerReference />
diff --git a/packages/twenty-docs/ui/components/overview.mdx b/packages/twenty-docs/ui/components/overview.mdx
index 6ce03642d1e..7dc789c3eeb 100644
--- a/packages/twenty-docs/ui/components/overview.mdx
+++ b/packages/twenty-docs/ui/components/overview.mdx
@@ -30,7 +30,6 @@ Import shared components from `twenty-ui/components`. The code editor has its ow
| [Callout](/ui/components/callout) | Semantic messages with actions and dismissal. |
| [InlineBanner](/ui/components/inline-banner) | Compact banners with optional actions. |
| [ToastProvider and Toaster](/ui/components/toast#application-notifications) | Notification stores, queue limits, and rendering. |
-| [ColorSchemePicker](/ui/components/color-scheme-picker) | Light, dark, and system preference selection. |
| [SearchInput](/ui/components/search-input) | Search text and optional filter controls. |
| [AnimatedIconCrossfade](/ui/components/animated-icon-crossfade) | State-driven icon transitions. |
| [Menu rows](/ui/components/menu-items) | MenuItem, MenuItemAvatar, MenuItemDraggable, and MenuItemSuggestion. |
diff --git a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/README.md b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/README.md
index 15121b0ea8e..3ee19d64b0d 100644
--- a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/README.md
+++ b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/README.md
@@ -27,7 +27,7 @@ requiring them to occur.
| `twenty-ui-switch` | Switch (interaction coverage in addition to the original input gallery) |
| `twenty-ui-tooltip` | Tooltip (convenience and compound APIs) |
| `twenty-ui-responsive-hooks` | useIsMobile, useIsTouchDevice, Button hotkeys |
-| `twenty-ui-reading-directions` | Callout, ColorSchemePicker, ButtonGroup, Button, AvatarGroup, ListItem, JsonTree in LTR and RTL side by side (`TwentyUiReadingDirections.stories.tsx`) |
+| `twenty-ui-reading-directions` | Callout, ButtonGroup, Button, AvatarGroup, ListItem, JsonTree in LTR and RTL side by side (`TwentyUiReadingDirections.stories.tsx`) |
The focused fixtures import public twenty-ui entry points and use
`TwentyUiGalleryCard` for the light theme, mount marker, and `twenty-ui/style.css`.
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 178990aa6ff..d482ca31882 100644
--- a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-input-gallery.front-component.tsx
+++ b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-input-gallery.front-component.tsx
@@ -1,6 +1,5 @@
import { defineFrontComponent } from 'twenty-sdk/define';
import {
- ColorSchemePicker,
IconButton,
LightButton,
LightIconButton,
@@ -63,18 +62,6 @@ const INPUT_ENTRIES: GalleryEntry[] = [
name: 'CodeEditorHeader',
node: <CodeEditorHeader title="Editor" />,
},
- {
- name: 'ColorSchemePicker',
- node: (
- <ColorSchemePicker
- value="Light"
- onChange={() => {}}
- lightLabel="Light"
- darkLabel="Dark"
- systemLabel="System"
- />
- ),
- },
{
name: 'IconButton (elevated)',
node: (
diff --git a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-label-overrides.front-component.tsx b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-label-overrides.front-component.tsx
index 84eb84a2da4..7aea92289e1 100644
--- a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-label-overrides.front-component.tsx
+++ b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-label-overrides.front-component.tsx
@@ -1,15 +1,10 @@
-import { useState } from 'react';
import { defineFrontComponent } from 'twenty-sdk/define';
-import { Callout, ColorSchemePicker, MenuItem } from 'twenty-ui/components';
-import { type ColorScheme } from 'twenty-ui/primitives/input';
+import { Callout, MenuItem } from 'twenty-ui/components';
import { ListItem } from 'twenty-ui/primitives/navigation';
-import { Text } from 'twenty-ui/primitives/typography';
import { TwentyUiGalleryCard } from '@/__stories__/shared/front-components/twenty-ui-gallery-card';
const LabelOverrides = () => {
- const [colorScheme, setColorScheme] = useState<ColorScheme>('Light');
-
return (
<TwentyUiGalleryCard title="Label overrides">
<Callout variant="info" title="Default notice" isClosable />
@@ -19,14 +14,6 @@ const LabelOverrides = () => {
isClosable
closeLabel="Dismiss notice"
/>
- <ColorSchemePicker
- value={colorScheme}
- onChange={setColorScheme}
- lightLabel="Day appearance"
- darkLabel="Night appearance"
- systemLabel="Device appearance"
- />
- <Text role="status">Appearance: {colorScheme}</Text>
<ListItem hotkeys={['G', 'D']}>Default shortcut</ListItem>
<ListItem hotkeys={['G', 'S']} hotkeysJoinLabel="followed by">
Supplied shortcut
diff --git a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-reading-directions.front-component.tsx b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-reading-directions.front-component.tsx
index b6dae2e03d5..da75d16892c 100644
--- a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-reading-directions.front-component.tsx
+++ b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-reading-directions.front-component.tsx
@@ -1,11 +1,4 @@
-import { useState } from 'react';
-
-import {
- AvatarGroup,
- Callout,
- ColorSchemePicker,
- JsonTree,
-} from 'twenty-ui/components';
+import { AvatarGroup, Callout, JsonTree } from 'twenty-ui/components';
import { Avatar, Pill } from 'twenty-ui/primitives/data-display';
import { Button, ButtonGroup } from 'twenty-ui/primitives/input';
import { ListItem } from 'twenty-ui/primitives/navigation';
@@ -20,10 +13,6 @@ const DirectionalLayoutExample = ({
}: {
direction: 'ltr' | 'rtl';
}) => {
- const [colorScheme, setColorScheme] = useState<'Light' | 'Dark' | 'System'>(
- 'System',
- );
-
return (
<TextDirectionProvider direction={direction}>
<div
@@ -44,13 +33,6 @@ const DirectionalLayoutExample = ({
title="Account details"
description="Review the information before continuing."
/>
- <ColorSchemePicker
- value={colorScheme}
- onChange={setColorScheme}
- lightLabel="Light"
- darkLabel="Dark"
- systemLabel="System"
- />
<ButtonGroup aria-label="Record actions">
<Button>First action</Button>
<Button>Last action</Button>
diff --git a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/labelOverridesTest.ts b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/labelOverridesTest.ts
index 80416feddc5..f23463b2f0d 100644
--- a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/labelOverridesTest.ts
+++ b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/labelOverridesTest.ts
@@ -11,24 +11,10 @@ export const labelOverridesTest: TwentyUiGalleryPlayFunction = async ({
await expectFrontComponentMounted(canvas);
expect(canvas.getByRole('button', { name: 'Close' })).toBeVisible();
- for (const label of [
- 'Day appearance',
- 'Night appearance',
- 'Device appearance',
- ]) {
- expect(canvas.getByText(label)).toBeVisible();
- expect(canvas.getByRole('button', { name: label })).toBeVisible();
- }
for (const label of ['then', 'followed by', 'next']) {
expect(canvas.getByText(label)).toBeVisible();
}
- await userEvent.click(
- canvas.getByRole('button', { name: 'Night appearance' }),
- );
- await waitFor(() =>
- expect(canvas.getByRole('status')).toHaveTextContent('Appearance: Dark'),
- );
await userEvent.click(canvas.getByRole('button', { name: 'Dismiss notice' }));
await waitFor(() =>
expect(canvas.queryByText('Supplied notice')).not.toBeInTheDocument(),
diff --git a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/readingDirectionsTest.ts b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/readingDirectionsTest.ts
index 5846dbafaef..bf4f466e538 100644
--- a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/readingDirectionsTest.ts
+++ b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/readingDirectionsTest.ts
@@ -42,17 +42,6 @@ export const readingDirectionsTest: TwentyUiGalleryPlayFunction = async ({
expect(Math.abs(descriptionBox.left - titleBox.left)).toBeLessThan(1);
expect(Math.abs(descriptionBox.right - titleBox.right)).toBeLessThan(1);
});
- await userEvent.click(content.getByRole('button', { name: 'Dark' }));
- for (const variant of ['Light', 'Dark', 'System']) {
- const badge = content.getByRole('button', {
- name: variant,
- }).nextElementSibling!;
- await waitFor(() =>
- expect(getComputedStyle(badge).visibility).toBe(
- variant === 'Dark' ? 'visible' : 'hidden',
- ),
- );
- }
const row = content
.getByText('A very long account name that must truncate')
.closest('[data-indicator]')!;
diff --git a/packages/twenty-front/src/modules/ui/theme/components/BaseThemeProvider.tsx b/packages/twenty-front/src/modules/ui/theme/components/BaseThemeProvider.tsx
index ac0d5eb1d96..a7b2825e13f 100644
--- a/packages/twenty-front/src/modules/ui/theme/components/BaseThemeProvider.tsx
+++ b/packages/twenty-front/src/modules/ui/theme/components/BaseThemeProvider.tsx
@@ -6,7 +6,7 @@ import { persistedColorSchemeState } from '@/ui/theme/states/persistedColorSchem
import { persistedUiScaleStepState } from '@/ui/theme/states/persistedUiScaleStepState';
import { useAtomState } from '@/ui/utilities/state/jotai/hooks/useAtomState';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
-import { type ColorScheme } from 'twenty-ui/primitives/input';
+import { type ColorScheme } from '@/workspace-member/types/WorkspaceMember';
import { ThemeProvider } from 'twenty-ui/theme';
type BaseThemeProviderProps = {
diff --git a/packages/twenty-front/src/modules/users/hooks/useLoadCurrentUser.ts b/packages/twenty-front/src/modules/users/hooks/useLoadCurrentUser.ts
index 6494a99958d..8271487f8db 100644
--- a/packages/twenty-front/src/modules/users/hooks/useLoadCurrentUser.ts
+++ b/packages/twenty-front/src/modules/users/hooks/useLoadCurrentUser.ts
@@ -16,12 +16,14 @@ import { SOURCE_LOCALE, type APP_LOCALES } from 'twenty-shared/translations';
import { type ObjectPermissions } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { toOpenRecordInPreference } from '@/workspace-member/utils/toOpenRecordInPreference';
-import { type ColorScheme } from 'twenty-ui/primitives/input';
+import {
+ type ColorScheme,
+ type UiScale,
+} from '@/workspace-member/types/WorkspaceMember';
import { useApolloClient } from '@apollo/client/react';
import { GetCurrentUserDocument } from '~/generated-metadata/graphql';
import { getWorkspaceUrl } from '~/utils/getWorkspaceUrl';
import { dynamicActivate } from '~/utils/i18n/dynamicActivate';
-import { type UiScale } from '@/workspace-member/types/WorkspaceMember';
export const useLoadCurrentUser = () => {
const setCurrentUser = useSetAtomState(currentUserState);
diff --git a/packages/twenty-front/src/pages/settings/profile/appearance/components/SettingsAppearance.tsx b/packages/twenty-front/src/pages/settings/profile/appearance/components/SettingsAppearance.tsx
new file mode 100644
index 00000000000..b1bf96983f2
--- /dev/null
+++ b/packages/twenty-front/src/pages/settings/profile/appearance/components/SettingsAppearance.tsx
@@ -0,0 +1,88 @@
+import { styled } from '@linaria/react';
+import { useLingui } from '@lingui/react/macro';
+
+import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';
+import { useColorScheme } from '@/ui/theme/hooks/useColorScheme';
+import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
+import { type ColorScheme } from '@/workspace-member/types/WorkspaceMember';
+import { isDefined } from 'twenty-shared/utils';
+import { Section } from 'twenty-ui/components';
+import { Radio, RadioGroup } from 'twenty-ui/primitives/input';
+import { MOBILE_VIEWPORT, themeCssVariables } from 'twenty-ui/theme';
+import { SettingsAppearancePreview } from '~/pages/settings/profile/appearance/components/SettingsAppearancePreview';
+
+const StyledChoices = styled.div`
+ box-sizing: border-box;
+ overflow-x: auto;
+ padding: ${themeCssVariables.spacing[1]};
+ width: 100%;
+
+ && {
+ flex-direction: row;
+ gap: ${themeCssVariables.spacing[4]};
+ }
+`;
+
+const StyledChoice = styled.div`
+ flex: 1 1 0;
+ min-width: 0;
+
+ @media (max-width: ${MOBILE_VIEWPORT}px) {
+ flex: 0 0 160px;
+ }
+`;
+
+const StyledChoiceContent = styled.div`
+ display: flex;
+ flex-direction: column;
+ gap: ${themeCssVariables.spacing[2]};
+ width: 100%;
+`;
+
+const StyledLabel = styled.span`
+ color: ${themeCssVariables.font.color.secondary};
+ font-size: ${themeCssVariables.font.size.xs};
+ font-weight: ${themeCssVariables.font.weight.medium};
+ padding-inline-end: ${themeCssVariables.spacing[6]};
+`;
+
+export const SettingsAppearance = () => {
+ const { t } = useLingui();
+ const { colorScheme, setColorScheme } = useColorScheme();
+ const currentWorkspaceMember = useAtomStateValue(currentWorkspaceMemberState);
+ const choices: { value: ColorScheme; label: string }[] = [
+ { value: 'Light', label: t`Light` },
+ { value: 'Dark', label: t`Dark` },
+ { value: 'System', label: t`System settings` },
+ ];
+
+ return (
+ <Section.Root>
+ <Section.Header title={t`Appearance`} />
+ <RadioGroup
+ render={<StyledChoices />}
+ aria-label={t`Appearance`}
+ value={colorScheme}
+ disabled={!isDefined(currentWorkspaceMember)}
+ onValueChange={(value: ColorScheme) => {
+ void setColorScheme(value);
+ }}
+ >
+ {choices.map(({ value, label }) => (
+ <Radio
+ render={<StyledChoice />}
+ key={value}
+ variant="card"
+ value={value}
+ aria-label={label}
+ >
+ <StyledChoiceContent>
+ <StyledLabel>{label}</StyledLabel>
+ <SettingsAppearancePreview colorScheme={value} />
+ </StyledChoiceContent>
+ </Radio>
+ ))}
+ </RadioGroup>
+ </Section.Root>
+ );
+};
diff --git a/packages/twenty-front/src/pages/settings/profile/appearance/components/SettingsAppearancePreview.tsx b/packages/twenty-front/src/pages/settings/profile/appearance/components/SettingsAppearancePreview.tsx
new file mode 100644
index 00000000000..4469ae81a69
--- /dev/null
+++ b/packages/twenty-front/src/pages/settings/profile/appearance/components/SettingsAppearancePreview.tsx
@@ -0,0 +1,90 @@
+import { styled } from '@linaria/react';
+import { type CSSProperties } from 'react';
+
+import { type ColorScheme } from '@/workspace-member/types/WorkspaceMember';
+import {
+ GRAY_SCALE_DARK,
+ GRAY_SCALE_LIGHT,
+ themeCssVariables,
+} from 'twenty-ui/theme';
+
+const StyledPreview = styled.div`
+ border-radius: ${themeCssVariables.border.radius.md};
+ display: flex;
+ height: 80px;
+ overflow: hidden;
+ width: 100%;
+`;
+
+const StyledSegment = styled.div`
+ align-items: flex-end;
+ background: var(--appearance-preview-background);
+ border: 1px solid var(--appearance-preview-border);
+ box-sizing: border-box;
+ display: flex;
+ flex: 1;
+ min-width: 0;
+ padding-inline-start: ${themeCssVariables.spacing[6]};
+ padding-top: ${themeCssVariables.spacing[6]};
+`;
+
+const StyledContent = styled.div`
+ background: var(--appearance-preview-content-background);
+ border-inline-start: 1px solid var(--appearance-preview-border);
+ border-start-start-radius: ${themeCssVariables.border.radius.md};
+ border-top: 1px solid var(--appearance-preview-border);
+ box-sizing: border-box;
+ color: var(--appearance-preview-content-color);
+ flex: 1;
+ font-size: 20px;
+ height: 56px;
+ padding-inline-start: ${themeCssVariables.spacing[2]};
+ padding-top: ${themeCssVariables.spacing[2]};
+ transition:
+ height 0.1s ease-in-out,
+ font-size 0.1s ease-in-out;
+
+ [role='radio']:not([data-disabled]):hover & {
+ font-size: 22px;
+ height: 61px;
+ }
+
+ @media (prefers-reduced-motion: reduce) {
+ transition: none;
+ }
+`;
+
+type SettingsAppearancePreviewProps = {
+ colorScheme: ColorScheme;
+};
+
+export const SettingsAppearancePreview = ({
+ colorScheme,
+}: SettingsAppearancePreviewProps) => {
+ const segments = colorScheme === 'System' ? ['Light', 'Dark'] : [colorScheme];
+
+ return (
+ <StyledPreview aria-hidden>
+ {segments.map((segment) => {
+ const grayScale =
+ segment === 'Dark' ? GRAY_SCALE_DARK : GRAY_SCALE_LIGHT;
+
+ return (
+ <StyledSegment
+ key={segment}
+ style={
+ {
+ '--appearance-preview-background': grayScale.gray4,
+ '--appearance-preview-border': grayScale.gray5,
+ '--appearance-preview-content-background': grayScale.gray1,
+ '--appearance-preview-content-color': grayScale.gray12,
+ } as CSSProperties
+ }
+ >
+ <StyledContent>Aa</StyledContent>
+ </StyledSegment>
+ );
+ })}
+ </StyledPreview>
+ );
+};
diff --git a/packages/twenty-front/src/pages/settings/profile/appearance/components/SettingsExperience.tsx b/packages/twenty-front/src/pages/settings/profile/appearance/components/SettingsExperience.tsx
index 9887969dd92..37610231743 100644
--- a/packages/twenty-front/src/pages/settings/profile/appearance/components/SettingsExperience.tsx
+++ b/packages/twenty-front/src/pages/settings/profile/appearance/components/SettingsExperience.tsx
@@ -5,12 +5,12 @@ import { SettingsPageLayout } from '@/settings/components/layout/SettingsPageLay
import { FormatPreferencesSettings } from '@/settings/experience/components/FormatPreferencesSettings';
import { OpenRecordInPreferencePicker } from '@/settings/experience/components/OpenRecordInPreferencePicker';
import { UiScalePicker } from '@/settings/experience/components/UiScalePicker';
-import { useColorScheme } from '@/ui/theme/hooks/useColorScheme';
import { Trans, useLingui } from '@lingui/react/macro';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath } from 'twenty-shared/utils';
-import { ColorSchemePicker, Section } from 'twenty-ui/components';
+import { Section } from 'twenty-ui/components';
import { themeCssVariables } from 'twenty-ui/theme';
+import { SettingsAppearance } from '~/pages/settings/profile/appearance/components/SettingsAppearance';
import { LocalePicker } from '~/pages/settings/profile/appearance/components/LocalePicker';
const StyledInterfaceControls = styled.div`
@@ -20,7 +20,6 @@ const StyledInterfaceControls = styled.div`
`;
export const SettingsExperience = () => {
- const { colorScheme, setColorScheme } = useColorScheme();
const { t } = useLingui();
return (
@@ -35,16 +34,7 @@ export const SettingsExperience = () => {
]}
>
<SettingsPageContainer>
- <Section.Root>
- <Section.Header title={t`Appearance`} />
- <ColorSchemePicker
- value={colorScheme}
- onChange={setColorScheme}
- lightLabel={t`Light`}
- darkLabel={t`Dark`}
- systemLabel={t`System settings`}
- />
- </Section.Root>
+ <SettingsAppearance />
<Section.Root>
<Section.Header
diff --git a/packages/twenty-front/src/pages/settings/profile/appearance/components/__stories__/SettingsAppearance.interactions.stories.tsx b/packages/twenty-front/src/pages/settings/profile/appearance/components/__stories__/SettingsAppearance.interactions.stories.tsx
new file mode 100644
index 00000000000..07d34fdaec7
--- /dev/null
+++ b/packages/twenty-front/src/pages/settings/profile/appearance/components/__stories__/SettingsAppearance.interactions.stories.tsx
@@ -0,0 +1,181 @@
+import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';
+import { persistedColorSchemeState } from '@/ui/theme/states/persistedColorSchemeState';
+import { jotaiStore } from '@/ui/utilities/state/jotai/jotaiStore';
+import { type Meta, type StoryObj } from '@storybook/react-vite';
+import { graphql, HttpResponse } from 'msw';
+import { expect, fn, userEvent, waitFor, within } from 'storybook/test';
+import { Button } from 'twenty-ui/primitives/input';
+import { SettingsAppearance } from '~/pages/settings/profile/appearance/components/SettingsAppearance';
+import appearanceMeta from './SettingsAppearance.stories';
+
+const savePreference = fn();
+
+const meta: Meta<typeof SettingsAppearance> = {
+ ...appearanceMeta,
+ beforeEach: async (context) => {
+ await appearanceMeta.beforeEach?.(context);
+ savePreference.mockClear();
+ },
+ title: 'Pages/Settings/Appearance/Interactions',
+ parameters: {
+ ...appearanceMeta.parameters,
+ msw: {
+ handlers: [
+ graphql.mutation('UpdateWorkspaceMemberSettings', ({ variables }) => {
+ savePreference(variables.input);
+ return HttpResponse.json({
+ data: { updateWorkspaceMemberSettings: true },
+ });
+ }),
+ ],
+ },
+ },
+};
+
+export default meta;
+type Story = StoryObj<typeof SettingsAppearance>;
+
+export const SelectionAndKeyboard: Story = {
+ render: () => (
+ <>
+ <SettingsAppearance />
+ <Button>Next setting</Button>
+ </>
+ ),
+ play: async ({ canvasElement }) => {
+ const canvas = within(canvasElement);
+ const group = within(
+ canvas.getByRole('radiogroup', { name: 'Appearance' }),
+ );
+ const light = group.getByRole('radio', { name: 'Light' });
+ const dark = group.getByRole('radio', { name: 'Dark' });
+ const system = group.getByRole('radio', { name: 'System settings' });
+
+ expect(group.getAllByRole('radio')).toHaveLength(3);
+ expect(light).toBeChecked();
+ await userEvent.click(dark);
+ await waitFor(() => expect(dark).toBeChecked());
+ expect(light).not.toBeChecked();
+ expect(jotaiStore.get(persistedColorSchemeState.atom)).toBe('Dark');
+ await waitFor(() =>
+ expect(savePreference).toHaveBeenLastCalledWith({
+ workspaceMemberId: 'appearance-member',
+ update: { colorScheme: 'Dark' },
+ }),
+ );
+
+ await userEvent.keyboard('{ArrowRight}');
+ await waitFor(() => expect(system).toBeChecked());
+ expect(system).toHaveFocus();
+ expect(dark).not.toBeChecked();
+ await waitFor(() =>
+ expect(savePreference).toHaveBeenLastCalledWith({
+ workspaceMemberId: 'appearance-member',
+ update: { colorScheme: 'System' },
+ }),
+ );
+
+ await userEvent.tab();
+ expect(canvas.getByRole('button', { name: 'Next setting' })).toHaveFocus();
+ await userEvent.tab({ shift: true });
+ expect(system).toHaveFocus();
+ await userEvent.keyboard('{ArrowRight}');
+ await waitFor(() => expect(light).toBeChecked());
+ expect(system).not.toBeChecked();
+ },
+};
+
+export const UnavailableMember: Story = {
+ parameters: { disabled: true },
+ play: async ({ canvasElement }) => {
+ const canvas = within(canvasElement);
+ for (const radio of canvas.getAllByRole('radio')) {
+ expect(radio).toHaveAttribute('aria-disabled', 'true');
+ await userEvent.click(radio);
+ }
+ expect(savePreference).not.toHaveBeenCalled();
+ expect(jotaiStore.get(persistedColorSchemeState.atom)).toBe('Light');
+ },
+};
+
+export const FailedSave: Story = {
+ parameters: {
+ msw: {
+ handlers: [
+ graphql.mutation('UpdateWorkspaceMemberSettings', ({ variables }) => {
+ savePreference(variables.input);
+ return HttpResponse.json({
+ errors: [
+ {
+ message: 'Unable to save appearance',
+ extensions: {
+ userFriendlyMessage: 'Unable to save appearance',
+ },
+ },
+ ],
+ });
+ }),
+ ],
+ },
+ },
+ play: async ({ canvasElement }) => {
+ const canvas = within(canvasElement);
+ await userEvent.click(canvas.getByRole('radio', { name: 'Dark' }));
+ await waitFor(() =>
+ expect(savePreference).toHaveBeenLastCalledWith({
+ workspaceMemberId: 'appearance-member',
+ update: { colorScheme: 'Dark' },
+ }),
+ );
+ await waitFor(() =>
+ expect(canvas.getByRole('radio', { name: 'Light' })).toBeChecked(),
+ );
+ expect(jotaiStore.get(currentWorkspaceMemberState.atom)?.colorScheme).toBe(
+ 'Light',
+ );
+ expect(jotaiStore.get(persistedColorSchemeState.atom)).toBe('Light');
+ },
+};
+
+export const RightToLeftKeyboard: Story = {
+ parameters: { direction: 'rtl' },
+ play: async ({ canvasElement }) => {
+ const canvas = within(canvasElement);
+ await userEvent.click(canvas.getByRole('radio', { name: 'Light' }));
+ await userEvent.keyboard('{ArrowLeft}');
+ await waitFor(() =>
+ expect(canvas.getByRole('radio', { name: 'Dark' })).toBeChecked(),
+ );
+ },
+};
+
+export const HorizontalLayout: Story = {
+ play: async ({ canvasElement }) => {
+ const canvas = within(canvasElement);
+ const lateRadioGroupStyles =
+ canvasElement.ownerDocument.createElement('style');
+
+ lateRadioGroupStyles.textContent =
+ '[role="radiogroup"] { flex-direction: column; }';
+ canvasElement.ownerDocument.head.append(lateRadioGroupStyles);
+
+ try {
+ const lightBounds = canvas
+ .getByRole('radio', { name: 'Light' })
+ .getBoundingClientRect();
+ const darkBounds = canvas
+ .getByRole('radio', { name: 'Dark' })
+ .getBoundingClientRect();
+ const systemBounds = canvas
+ .getByRole('radio', { name: 'System settings' })
+ .getBoundingClientRect();
+
+ expect(darkBounds.top).toBe(lightBounds.top);
+ expect(systemBounds.top).toBe(lightBounds.top);
+ expect(darkBounds.left).toBeGreaterThan(lightBounds.right);
+ expect(systemBounds.left).toBeGreaterThan(darkBounds.right);
+ } finally {
+ lateRadioGroupStyles.remove();
+ }
+ },
+};
diff --git a/packages/twenty-front/src/pages/settings/profile/appearance/components/__stories__/SettingsAppearance.stories.tsx b/packages/twenty-front/src/pages/settings/profile/appearance/components/__stories__/SettingsAppearance.stories.tsx
new file mode 100644
index 00000000000..42c555f5c4e
--- /dev/null
+++ b/packages/twenty-front/src/pages/settings/profile/appearance/components/__stories__/SettingsAppearance.stories.tsx
@@ -0,0 +1,100 @@
+import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';
+import { persistedColorSchemeState } from '@/ui/theme/states/persistedColorSchemeState';
+import { jotaiStore } from '@/ui/utilities/state/jotai/jotaiStore';
+import { type ColorScheme } from '@/workspace-member/types/WorkspaceMember';
+import { type Meta, type StoryObj } from '@storybook/react-vite';
+import { graphql, HttpResponse } from 'msw';
+import { expect, within } from 'storybook/test';
+import { ToastProvider } from 'twenty-ui/components';
+import { TextDirectionProvider } from 'twenty-ui/primitives/layout';
+import { ThemeProvider, themeCssVariables } from 'twenty-ui/theme';
+import { SettingsAppearance } from '~/pages/settings/profile/appearance/components/SettingsAppearance';
+
+const meta = {
+ title: 'Pages/Settings/Appearance',
+ component: SettingsAppearance,
+ parameters: {
+ layout: 'centered',
+ msw: {
+ handlers: [
+ graphql.mutation('UpdateWorkspaceMemberSettings', () =>
+ HttpResponse.json({ data: { updateWorkspaceMemberSettings: true } }),
+ ),
+ ],
+ },
+ },
+ beforeEach: ({ parameters }) => {
+ const colorScheme: ColorScheme = parameters.colorScheme ?? 'Light';
+
+ jotaiStore.set(
+ currentWorkspaceMemberState.atom,
+ parameters.disabled
+ ? null
+ : {
+ id: 'appearance-member',
+ name: { firstName: 'Alex', lastName: 'Example' },
+ userEmail: '[email protected]',
+ locale: 'en',
+ colorScheme,
+ },
+ );
+ jotaiStore.set(persistedColorSchemeState.atom, colorScheme);
+ },
+ play: async ({ canvasElement, parameters }) => {
+ const group = within(
+ within(canvasElement).getByRole('radiogroup', { name: 'Appearance' }),
+ );
+ const isDisabled = parameters.disabled === true;
+ const selectedColorScheme = isDisabled
+ ? 'System'
+ : (parameters.colorScheme ?? 'Light');
+ const selectedLabel =
+ selectedColorScheme === 'System'
+ ? 'System settings'
+ : selectedColorScheme;
+
+ expect(group.getAllByRole('radio', { checked: true })).toHaveLength(1);
+ expect(group.getByRole('radio', { checked: true })).toHaveAccessibleName(
+ selectedLabel,
+ );
+
+ if (!isDisabled) {
+ return;
+ }
+
+ for (const radio of group.getAllByRole('radio')) {
+ expect(radio).toHaveAttribute('aria-disabled', 'true');
+ }
+ },
+ decorators: [
+ (Story, { parameters }) => (
+ <ThemeProvider
+ colorScheme={parameters.colorScheme === 'Dark' ? 'dark' : 'light'}
+ applyToRoot={false}
+ >
+ <TextDirectionProvider direction={parameters.direction ?? 'ltr'}>
+ <ToastProvider>
+ <div
+ style={{
+ width: 520,
+ maxWidth: '100vw',
+ background: themeCssVariables.background.primary,
+ }}
+ >
+ <Story />
+ </div>
+ </ToastProvider>
+ </TextDirectionProvider>
+ </ThemeProvider>
+ ),
+ ],
+} satisfies Meta<typeof SettingsAppearance>;
+
+export default meta;
+type Story = StoryObj<typeof SettingsAppearance>;
+
+export const Default: Story = {};
+export const Dark: Story = { parameters: { colorScheme: 'Dark' } };
+export const System: Story = { parameters: { colorScheme: 'System' } };
+export const Disabled: Story = { parameters: { disabled: true } };
+export const RightToLeft: Story = { parameters: { direction: 'rtl' } };
diff --git a/packages/twenty-shared/src/constants/DocumentationPaths.ts b/packages/twenty-shared/src/constants/DocumentationPaths.ts
index deb0dab8666..3e0210f48d5 100644
--- a/packages/twenty-shared/src/constants/DocumentationPaths.ts
+++ b/packages/twenty-shared/src/constants/DocumentationPaths.ts
@@ -133,7 +133,6 @@ export const DOCUMENTATION_PATHS = {
UI_COMPONENTS_AVATAR_GROUP: '/ui/components/avatar-group',
UI_COMPONENTS_CALLOUT: '/ui/components/callout',
UI_COMPONENTS_CODE_EDITOR: '/ui/components/code-editor',
- UI_COMPONENTS_COLOR_SCHEME_PICKER: '/ui/components/color-scheme-picker',
UI_COMPONENTS_COMMAND_BLOCK: '/ui/components/command-block',
UI_COMPONENTS_DROPDOWN: '/ui/components/dropdown',
UI_COMPONENTS_INLINE_BANNER: '/ui/components/inline-banner',
diff --git a/packages/twenty-ui/CHANGELOG.md b/packages/twenty-ui/CHANGELOG.md
index 573e5aa86eb..f5ff202d6b3 100644
--- a/packages/twenty-ui/CHANGELOG.md
+++ b/packages/twenty-ui/CHANGELOG.md
@@ -4,6 +4,8 @@
### Breaking Changes
+- Removed `ColorSchemePicker`, `ColorSchemePickerProps`, and the app-specific `ColorScheme` type. Profile appearance settings now own the theme previews and preference choices, using `Radio` and `RadioGroup` for selection.
+
- Removed `CardPicker` and `CardPickerProps`. Use `Radio variant="card"` inside `RadioGroup` from `twenty-ui/primitives/input`. Card layout, selection, keyboard navigation, and form behavior are preserved.
- Removed `Info`, `InfoProps`, and `InfoAccent`. Use `InlineBanner` from `twenty-ui/components` with `variant="compact"`, `message`, and `color` to preserve wrapping and presentation. Its `button` supports native links through `href`, custom links through `render`, and button actions through `onClick`. The separately versioned Granola app must migrate its four Info-consuming files together with its `twenty-ui@^1.0.0-alpha.1` dependency upgrade.
@@ -35,7 +37,7 @@ Keep `twenty-ui`, `twenty-sdk`, and `twenty-client-sdk` versions aligned when up
### Added
-- `Callout.closeLabel` customizes the dismiss button name. `ListItem`, `Menu` items, and `Dropdown` items accept `hotkeysJoinLabel` (default `then`); the legacy `MenuItem` uses `hotKeysJoinLabel`. `ColorSchemePicker` uses its supplied visible labels as accessible names.
+- `Callout.closeLabel` customizes the dismiss button name. `ListItem`, `Menu` items, and `Dropdown` items accept `hotkeysJoinLabel` (default `then`); the legacy `MenuItem` uses `hotKeysJoinLabel`.
- `twenty-ui/utilities` exports `useMediaQuery`, `MOBILE_MEDIA_QUERY`, and `TOUCH_DEVICE_MEDIA_QUERY`. `twenty-ui/testing` exports `overrideMediaQueryMatches`.
diff --git a/packages/twenty-ui/docs/colorSchemePickerPropDescriptions.ts b/packages/twenty-ui/docs/colorSchemePickerPropDescriptions.ts
deleted file mode 100644
index 2df68246ac6..00000000000
--- a/packages/twenty-ui/docs/colorSchemePickerPropDescriptions.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { type ComponentProps } from 'react';
-
-import { type ColorSchemePicker } from '../src/components/input/ColorSchemePicker/ColorSchemePicker';
-
-export const COLOR_SCHEME_PICKER_PROP_DESCRIPTIONS = {
- value:
- 'Selected scheme: Light, Dark, or System. The application resolves system to a concrete theme.',
- className: 'Class applied to the outer container.',
- onChange: 'Called with the newly selected color scheme.',
- lightLabel: 'Visible label and accessible name of the light choice.',
- darkLabel: 'Visible label and accessible name of the dark choice.',
- systemLabel: 'Visible label and accessible name of the system choice.',
-} satisfies Partial<
- Record<keyof ComponentProps<typeof ColorSchemePicker>, string>
->;
diff --git a/packages/twenty-ui/docs/components.ts b/packages/twenty-ui/docs/components.ts
index 8994ee2754e..c53a0685741 100644
--- a/packages/twenty-ui/docs/components.ts
+++ b/packages/twenty-ui/docs/components.ts
@@ -8,7 +8,6 @@ import { INLINE_BANNER_PROP_DESCRIPTIONS } from './inlineBannerPropDescriptions'
import { TOAST_PROVIDER_PROP_DESCRIPTIONS } from './toastProviderPropDescriptions';
import { TOASTER_PROP_DESCRIPTIONS } from './toasterPropDescriptions';
import { RADIO_PROP_DESCRIPTIONS } from './radioPropDescriptions';
-import { COLOR_SCHEME_PICKER_PROP_DESCRIPTIONS } from './colorSchemePickerPropDescriptions';
import { SEARCH_INPUT_PROP_DESCRIPTIONS } from './searchInputPropDescriptions';
import { ANIMATED_ICON_CROSSFADE_PROP_DESCRIPTIONS } from './animatedIconCrossfadePropDescriptions';
import { MENU_ITEM_PROP_DESCRIPTIONS } from './menuItemPropDescriptions';
@@ -541,13 +540,6 @@ export const DOCUMENTED_COMPONENTS = [
slug: 'components/toaster',
propDescriptions: TOASTER_PROP_DESCRIPTIONS,
},
- {
- name: 'ColorSchemePicker',
- source: 'components/input/ColorSchemePicker/ColorSchemePicker.tsx',
- entryPoint: 'twenty-ui/components',
- slug: 'components/color-scheme-picker',
- propDescriptions: COLOR_SCHEME_PICKER_PROP_DESCRIPTIONS,
- },
{
name: 'SearchInput',
source: 'components/input/SearchInput/SearchInput.tsx',
diff --git a/packages/twenty-ui/docs/label-ownership.md b/packages/twenty-ui/docs/label-ownership.md
index 3e0116bf802..69f640a8c53 100644
--- a/packages/twenty-ui/docs/label-ownership.md
+++ b/packages/twenty-ui/docs/label-ownership.md
@@ -5,7 +5,6 @@ This covers production exports under components, primitives, and icons, includin
| Surface | Text ownership |
| ------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Callout | `title`, `description`, `action.label`, and `closeLabel` (default `Close`). |
-| ColorSchemePicker | Required `lightLabel`, `darkLabel`, and `systemLabel` supply visible and accessible names. `Aa` is the decorative appearance sample. Scheme values remain `Light`, `Dark`, and `System`. |
| ListItem and Menu item parts | Children, description, action slots, native accessible attributes, and `hotkeysJoinLabel` (default `then`). |
| Dropdown | Children name actions, options, titles, sections, empty states, and loading states. `Back` children default to `Back`. Search accepts native placeholder and accessible attributes. Close requires a caller-supplied accessible label and accepts native `aria-labelledby`. Item parts pass `hotkeysJoinLabel` to ListItem. |
| Legacy menu compositions | MenuItem exposes `text`, contextual slots, and `hotKeysJoinLabel` (default `then`). Avatar, draggable, suggestion, and picker presets receive their text from callers; they add no English fallback. Keep this additive option until their separate migration removes the exports. |
diff --git a/packages/twenty-ui/docs/module-ownership.json b/packages/twenty-ui/docs/module-ownership.json
index a5957c4e862..db7c8dbee1b 100644
--- a/packages/twenty-ui/docs/module-ownership.json
+++ b/packages/twenty-ui/docs/module-ownership.json
@@ -45,7 +45,6 @@
"Callout",
"CodeEditor",
"CodeEditorHeader",
- "ColorSchemePicker",
"CommandBlock",
"Dropdown",
"IconButton",
diff --git a/packages/twenty-ui/docs/public-exports.json b/packages/twenty-ui/docs/public-exports.json
index b816d60f739..8255861cf01 100644
--- a/packages/twenty-ui/docs/public-exports.json
+++ b/packages/twenty-ui/docs/public-exports.json
@@ -15,7 +15,6 @@
"AnimatedIconCrossfade": "components/layout/AnimatedIconCrossfade/AnimatedIconCrossfade",
"AvatarGroup": "components/data-display/AvatarGroup/AvatarGroup",
"Callout": "components/feedback/Callout/Callout",
- "ColorSchemePicker": "components/input/ColorSchemePicker/ColorSchemePicker",
"CommandBlock": "components/data-display/CommandBlock/CommandBlock",
"DEFAULT_COLOR_LABELS": "components/navigation/MenuItem/constants/DefaultColorLabels",
"Dropdown": "components/navigation/Dropdown/Dropdown",
@@ -50,7 +49,6 @@
"CalloutProps": "components/feedback/Callout/types/CalloutProps",
"CalloutVariant": "components/feedback/Callout/types/CalloutVariant",
"ColorLabels": "components/navigation/MenuItem/types/ColorLabels",
- "ColorSchemePickerProps": "components/input/ColorSchemePicker/types/ColorSchemePickerProps",
"DropdownActionItemProps": "components/navigation/Dropdown/types/DropdownActionItemProps",
"DropdownCloseProps": "components/navigation/Dropdown/types/DropdownCloseProps",
"DropdownContentProps": "components/navigation/Dropdown/types/DropdownContentProps",
@@ -710,7 +708,6 @@
"CheckboxShape": "primitives/input/Checkbox/types/CheckboxShape",
"CheckboxSize": "primitives/input/Checkbox/types/CheckboxSize",
"CheckboxVariant": "primitives/input/Checkbox/types/CheckboxVariant",
- "ColorScheme": "primitives/input/types/ColorScheme",
"InputGroupProps": "primitives/input/InputGroup/types/InputGroupProps",
"InputProps": "primitives/input/Input/types/InputProps",
"InputSize": "primitives/input/types/InputSize",
diff --git a/packages/twenty-ui/generated/components.docs.json b/packages/twenty-ui/generated/components.docs.json
index 5eb56cb052c..ab827065582 100644
--- a/packages/twenty-ui/generated/components.docs.json
+++ b/packages/twenty-ui/generated/components.docs.json
@@ -8395,55 +8395,6 @@
}
]
},
- {
- "name": "ColorSchemePicker",
- "entryPoint": "twenty-ui/components",
- "slug": "components/color-scheme-picker",
- "props": [
- {
- "name": "className",
- "type": "string",
- "required": false,
- "defaultValue": null,
- "description": "Class applied to the outer container."
- },
- {
- "name": "darkLabel",
- "type": "string",
- "required": true,
- "defaultValue": null,
- "description": "Visible label and accessible name of the dark choice."
- },
- {
- "name": "lightLabel",
- "type": "string",
- "required": true,
- "defaultValue": null,
- "description": "Visible label and accessible name of the light choice."
- },
- {
- "name": "onChange",
- "type": "(value: ColorScheme) => void",
- "required": true,
- "defaultValue": null,
- "description": "Called with the newly selected color scheme."
- },
- {
- "name": "systemLabel",
- "type": "string",
- "required": true,
- "defaultValue": null,
- "description": "Visible label and accessible name of the system choice."
- },
- {
- "name": "value",
- "type": "\"Dark\" | \"Light\" | \"System\"",
- "required": true,
- "defaultValue": null,
- "description": "Selected scheme: Light, Dark, or System. The application resolves system to a concrete theme."
- }
- ]
- },
{
"name": "SearchInput",
"entryPoint": "twenty-ui/components",
diff --git a/packages/twenty-ui/src/components/__stories__/reading-direction/DirectionalLayoutExample.tsx b/packages/twenty-ui/src/components/__stories__/reading-direction/DirectionalLayoutExample.tsx
index 1fff7290b69..cfdeea067aa 100644
--- a/packages/twenty-ui/src/components/__stories__/reading-direction/DirectionalLayoutExample.tsx
+++ b/packages/twenty-ui/src/components/__stories__/reading-direction/DirectionalLayoutExample.tsx
@@ -1,11 +1,4 @@
-import { useState } from 'react';
-
-import {
- AvatarGroup,
- Callout,
- ColorSchemePicker,
- JsonTree,
-} from '@ui/components';
+import { AvatarGroup, Callout, JsonTree } from '@ui/components';
import { Avatar, Pill } from '@ui/primitives/data-display';
import {
Button,
@@ -24,10 +17,6 @@ export const DirectionalLayoutExample = ({
}: {
direction: 'ltr' | 'rtl';
}) => {
- const [colorScheme, setColorScheme] = useState<'Light' | 'Dark' | 'System'>(
- 'System',
- );
-
return (
<TextDirectionProvider direction={direction}>
<div
@@ -48,17 +37,17 @@ export const DirectionalLayoutExample = ({
title="Account details"
description="Review the information before continuing."
/>
- <ColorSchemePicker
- value={colorScheme}
- onChange={setColorScheme}
- lightLabel="Light"
- darkLabel="Dark"
- systemLabel="System"
- />
- <RadioGroup aria-label="Plan" defaultValue="team">
+ <RadioGroup
+ aria-label="Plan"
+ defaultValue="team"
+ style={{ flexDirection: 'row' }}
+ >
<Radio variant="card" value="team">
Team plan
</Radio>
+ <Radio variant="card" value="personal">
+ Personal plan
+ </Radio>
</RadioGroup>
<ButtonGroup aria-label="Record actions">
<Button>First action</Button>
diff --git a/packages/twenty-ui/src/components/__stories__/reading-direction/TextDirectionProvider.layout.stories.tsx b/packages/twenty-ui/src/components/__stories__/reading-direction/TextDirectionProvider.layout.stories.tsx
index f7ac08fa5b0..b8dd4cf6384 100644
--- a/packages/twenty-ui/src/components/__stories__/reading-direction/TextDirectionProvider.layout.stories.tsx
+++ b/packages/twenty-ui/src/components/__stories__/reading-direction/TextDirectionProvider.layout.stories.tsx
@@ -55,17 +55,13 @@ export const LeftToRight: Story = {
upcoming.getBoundingClientRect().left +
upcoming.getBoundingClientRect().width / 2,
).toBe(isRightToLeft);
- const light = canvas.getByRole('button', { name: 'Light' });
- const dark = canvas.getByRole('button', { name: 'Dark' });
+ const team = canvas.getByRole('radio', { name: 'Team plan' });
+ const personal = canvas.getByRole('radio', { name: 'Personal plan' });
expect(
- light.getBoundingClientRect().left > dark.getBoundingClientRect().left,
+ team.getBoundingClientRect().left > personal.getBoundingClientRect().left,
).toBe(isRightToLeft);
- expect(
- Math.abs(
- light.getBoundingClientRect().left - dark.getBoundingClientRect().left,
- ),
- ).toBeGreaterThan(light.getBoundingClientRect().width);
- await userEvent.click(dark);
+ await userEvent.click(personal);
+ await expect(personal).toBeChecked();
for (const overlap of ['left', 'right']) {
const group = canvas.getByTestId(`avatars-${overlap}`).firstElementChild!;
const groupBox = group.getBoundingClientRect();
diff --git a/packages/twenty-ui/src/components/index.ts b/packages/twenty-ui/src/components/index.ts
index b486849b370..43edc9afde7 100644
--- a/packages/twenty-ui/src/components/index.ts
+++ b/packages/twenty-ui/src/components/index.ts
@@ -37,8 +37,6 @@ export type { ToastProviderProps } from './feedback/Toast/types/ToastProviderPro
export type { ToastVariant } from './feedback/Toast/types/ToastVariant';
export { Toaster } from './feedback/Toaster/Toaster';
export type { ToasterProps } from './feedback/Toaster/types/ToasterProps';
-export { ColorSchemePicker } from './input/ColorSchemePicker/ColorSchemePicker';
-export type { ColorSchemePickerProps } from './input/ColorSchemePicker/types/ColorSchemePickerProps';
export { IconButton } from './input/IconButton/IconButton';
export type { IconButtonProps } from './input/IconButton/types/IconButtonProps';
export type { IconButtonSize } from './input/IconButton/types/IconButtonSize';
diff --git a/packages/twenty-ui/src/components/input/ColorSchemePicker/ColorSchemePicker.module.scss b/packages/twenty-ui/src/components/input/ColorSchemePicker/ColorSchemePicker.module.scss
deleted file mode 100644
index 1a6b3c18a5b..00000000000
--- a/packages/twenty-ui/src/components/input/ColorSchemePicker/ColorSchemePicker.module.scss
+++ /dev/null
@@ -1,35 +0,0 @@
-.container {
- display: flex;
- flex-direction: row;
- width: 100%;
-
- > * + * {
- margin-inline-start: var(--t-spacing-4);
- }
-
- @include respond-to(mobile) {
- overflow: scroll;
-
- .cardContainer {
- flex: 0 0 160px;
- }
- }
-}
-
-.cardContainer {
- display: flex;
- flex: 1 1 0;
- flex-direction: column;
- min-width: 0;
-}
-
-.card {
- width: 100%;
-}
-
-.label {
- margin-top: var(--t-spacing-2);
- color: var(--t-font-color-secondary);
- font-size: var(--t-font-size-xs);
- font-weight: var(--t-font-weight-medium);
-}
diff --git a/packages/twenty-ui/src/components/input/ColorSchemePicker/ColorSchemePicker.module.scss.d.ts b/packages/twenty-ui/src/components/input/ColorSchemePicker/ColorSchemePicker.module.scss.d.ts
deleted file mode 100644
index 793abb61483..00000000000
--- a/packages/twenty-ui/src/components/input/ColorSchemePicker/ColorSchemePicker.module.scss.d.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-declare const classNames: {
- readonly container: 'container';
- readonly cardContainer: 'cardContainer';
- readonly card: 'card';
- readonly label: 'label';
-};
-export default classNames;
diff --git a/packages/twenty-ui/src/components/input/ColorSchemePicker/ColorSchemePicker.tsx b/packages/twenty-ui/src/components/input/ColorSchemePicker/ColorSchemePicker.tsx
deleted file mode 100644
index cdb04d583f9..00000000000
--- a/packages/twenty-ui/src/components/input/ColorSchemePicker/ColorSchemePicker.tsx
+++ /dev/null
@@ -1,49 +0,0 @@
-import { clsx } from 'clsx';
-import { type ColorSchemePickerProps } from './types/ColorSchemePickerProps';
-
-import { ColorSchemeCard } from '@ui/components/input/ColorSchemePicker/internal/ColorSchemeCard/ColorSchemeCard';
-import styles from './ColorSchemePicker.module.scss';
-
-export const ColorSchemePicker = ({
- value,
- onChange,
- className,
- lightLabel,
- darkLabel,
- systemLabel,
-}: ColorSchemePickerProps) => {
- return (
- <div className={clsx(styles.container, className)}>
- <div className={styles.cardContainer}>
- <ColorSchemeCard
- className={styles.card}
- onClick={() => onChange('Light')}
- variant="Light"
- aria-label={lightLabel}
- selected={value === 'Light'}
- />
- <span className={styles.label}>{lightLabel}</span>
- </div>
- <div className={styles.cardContainer}>
- <ColorSchemeCard
- className={styles.card}
- onClick={() => onChange('Dark')}
- variant="Dark"
- aria-label={darkLabel}
- selected={value === 'Dark'}
- />
- <span className={styles.label}>{darkLabel}</span>
- </div>
- <div className={styles.cardContainer}>
- <ColorSchemeCard
- className={styles.card}
- onClick={() => onChange('System')}
- variant="System"
- aria-label={systemLabel}
- selected={value === 'System'}
- />
- <span className={styles.label}>{systemLabel}</span>
- </div>
- </div>
- );
-};
diff --git a/packages/twenty-ui/src/components/input/ColorSchemePicker/__stories__/ColorSchemePicker.stories.tsx b/packages/twenty-ui/src/components/input/ColorSchemePicker/__stories__/ColorSchemePicker.stories.tsx
deleted file mode 100644
index 254d5fd8c37..00000000000
--- a/packages/twenty-ui/src/components/input/ColorSchemePicker/__stories__/ColorSchemePicker.stories.tsx
+++ /dev/null
@@ -1,46 +0,0 @@
-import { type Meta, type StoryObj } from '@storybook/react-vite';
-import { expect, fn, userEvent, within } from 'storybook/test';
-
-import { ComponentDecorator } from '@ui/testing';
-
-import { ColorSchemePicker } from '../ColorSchemePicker';
-
-const meta: Meta<typeof ColorSchemePicker> = {
- title: 'UI/Input/ColorSchemePicker',
- component: ColorSchemePicker,
- decorators: [ComponentDecorator],
- args: {
- value: 'Light',
- lightLabel: 'Light',
- darkLabel: 'Dark',
- systemLabel: 'System',
- onChange: fn(),
- },
-};
-
-export default meta;
-type Story = StoryObj<typeof ColorSchemePicker>;
-
-export const Default: Story = {};
-
-export const SuppliedLabels: Story = {
- args: {
- lightLabel: 'Day appearance',
- darkLabel: 'Night appearance',
- systemLabel: 'Device appearance',
- },
- play: async ({ canvasElement, args }) => {
- const canvas = within(canvasElement);
-
- for (const label of [args.lightLabel, args.darkLabel, args.systemLabel]) {
- expect(canvas.getByText(label)).toBeVisible();
- expect(canvas.getByRole('button', { name: label })).toBeVisible();
- }
-
- await userEvent.click(canvas.getByRole('button', { name: args.darkLabel }));
- expect(args.onChange).toHaveBeenLastCalledWith('Dark');
- canvas.getByRole('button', { name: args.systemLabel }).focus();
- await userEvent.keyboard('{Enter}');
- expect(args.onChange).toHaveBeenLastCalledWith('System');
- },
-};
diff --git a/packages/twenty-ui/src/components/input/ColorSchemePicker/internal/Checkmark/Checkmark.module.scss b/packages/twenty-ui/src/components/input/ColorSchemePicker/internal/Checkmark/Checkmark.module.scss
deleted file mode 100644
index 311054e5e9c..00000000000
--- a/packages/twenty-ui/src/components/input/ColorSchemePicker/internal/Checkmark/Checkmark.module.scss
+++ /dev/null
@@ -1,10 +0,0 @@
-.root {
- display: flex;
- align-items: center;
- justify-content: center;
- width: var(--t-spacing-5);
- height: var(--t-spacing-5);
- border-radius: var(--t-border-radius-rounded);
- corner-shape: round;
- background-color: var(--t-color-blue);
-}
diff --git a/packages/twenty-ui/src/components/input/ColorSchemePicker/internal/Checkmark/Checkmark.module.scss.d.ts b/packages/twenty-ui/src/components/input/ColorSchemePicker/internal/Checkmark/Checkmark.module.scss.d.ts
deleted file mode 100644
index 4d6743c3dcd..00000000000
--- a/packages/twenty-ui/src/components/input/ColorSchemePicker/internal/Checkmark/Checkmark.module.scss.d.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-declare const classNames: {
- readonly root: 'root';
-};
-export default classNames;
diff --git a/packages/twenty-ui/src/components/input/ColorSchemePicker/internal/Checkmark/Checkmark.tsx b/packages/twenty-ui/src/components/input/ColorSchemePicker/internal/Checkmark/Checkmark.tsx
deleted file mode 100644
index f3911088485..00000000000
--- a/packages/twenty-ui/src/components/input/ColorSchemePicker/internal/Checkmark/Checkmark.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-import React from 'react';
-
-import { clsx } from 'clsx';
-
-import { IconCheck } from '@ui/icon/components/TablerIcons';
-import { useTheme } from '@ui/theme';
-
-import styles from './Checkmark.module.scss';
-
-export type CheckmarkProps = React.ComponentPropsWithoutRef<'div'> & {
- className?: string;
-};
-
-export const Checkmark = ({ className }: CheckmarkProps) => {
- const theme = useTheme();
-
- return (
- <div className={clsx(styles.root, className)}>
- <IconCheck color={theme.grayScale.gray1} size={14} />
- </div>
- );
-};
diff --git a/packages/twenty-ui/src/components/input/ColorSchemePicker/internal/Checkmark/__stories__/Checkmark.stories.tsx b/packages/twenty-ui/src/components/input/ColorSchemePicker/internal/Checkmark/__stories__/Checkmark.stories.tsx
deleted file mode 100644
index ec9eb639ca4..00000000000
--- a/packages/twenty-ui/src/components/input/ColorSchemePicker/internal/Checkmark/__stories__/Checkmark.stories.tsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import { type Meta, type StoryObj } from '@storybook/react-vite';
-
-import { ComponentDecorator } from '@ui/testing/decorators/ComponentDecorator';
-
-import { Checkmark } from '@ui/components/input/ColorSchemePicker/internal/Checkmark/Checkmark';
-
-const meta: Meta<typeof Checkmark> = {
- title: 'UI/Data Display/Checkmark',
- component: Checkmark,
- decorators: [ComponentDecorator],
-};
-
-export default meta;
-type Story = StoryObj<typeof Checkmark>;
-
-export const Default: Story = { args: {} };
-
-export const WithCustomStyles: Story = {
- args: { style: { backgroundColor: 'red', height: 40, width: 40 } },
-};
diff --git a/packages/twenty-ui/src/components/input/ColorSchemePicker/internal/ColorSchemeCard/ColorSchemeCard.module.scss b/packages/twenty-ui/src/components/input/ColorSchemePicker/internal/ColorSchemeCard/ColorSchemeCard.module.scss
deleted file mode 100644
index 949e6cd3412..00000000000
--- a/packages/twenty-ui/src/components/input/ColorSchemePicker/internal/ColorSchemeCard/ColorSchemeCard.module.scss
+++ /dev/null
@@ -1,77 +0,0 @@
-.container {
- position: relative;
- width: 160px;
-}
-
-.colorSchemeBackground {
- display: flex;
- align-items: flex-end;
- justify-content: flex-end;
- box-sizing: border-box;
- width: 100%;
- height: 80px;
- padding-top: var(--t-spacing-6);
- padding-inline-start: var(--t-spacing-6);
- border: 1px solid var(--color-scheme-card-border-color);
- border-radius: var(--t-border-radius-md);
- background: var(--color-scheme-card-background);
- overflow: hidden;
- cursor: pointer;
-}
-
-.colorSchemeContent {
- display: flex;
- flex: 1;
- box-sizing: border-box;
- height: 56px;
- padding-top: var(--t-spacing-2);
- padding-inline-start: var(--t-spacing-2);
- border-top: 1px solid var(--color-scheme-card-border-color);
- border-inline-start: 1px solid var(--color-scheme-card-border-color);
- border-start-start-radius: var(--t-border-radius-md);
- background: var(--color-scheme-card-content-background);
- color: var(--color-scheme-card-content-color);
- font-size: 20px;
- // Replaces the framer-motion hover animation from the deprecated component.
- transition:
- height 0.1s ease-in-out,
- font-size 0.1s ease-in-out;
-}
-
-.colorSchemeBackground:hover .colorSchemeContent,
-.mixedColorSchemeSegment:hover .colorSchemeContent {
- height: 61px;
- font-size: 22px;
-}
-
-.mixedColorSchemeSegment {
- position: relative;
- display: flex;
- width: 100%;
- height: 80px;
- border-radius: var(--t-border-radius-md);
- overflow: hidden;
- cursor: pointer;
-}
-
-.checkmarkContainer {
- position: absolute;
- inset-inline-end: 0px;
- bottom: 0px;
- padding: var(--t-spacing-2);
- opacity: 0;
- visibility: hidden;
- // Replaces the framer-motion AnimatePresence fade; the delayed visibility
- // change keeps the checkmark rendered while it fades out.
- transition:
- opacity 0.3s ease-in-out,
- visibility 0s linear 0.3s;
-
- &[data-selected] {
- opacity: 1;
- visibility: visible;
- transition:
- opacity 0.3s ease-in-out,
- visibility 0s;
- }
-}
diff --git a/packages/twenty-ui/src/components/input/ColorSchemePicker/internal/ColorSchemeCard/ColorSchemeCard.module.scss.d.ts b/packages/twenty-ui/src/components/input/ColorSchemePicker/internal/ColorSchemeCard/ColorSchemeCard.module.scss.d.ts
deleted file mode 100644
index 6016a7f7096..00000000000
--- a/packages/twenty-ui/src/components/input/ColorSchemePicker/internal/ColorSchemeCard/ColorSchemeCard.module.scss.d.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-declare const classNames: {
- readonly container: 'container';
- readonly colorSchemeBackground: 'colorSchemeBackground';
- readonly colorSchemeContent: 'colorSchemeContent';
- readonly mixedColorSchemeSegment: 'mixedColorSchemeSegment';
- readonly checkmarkContainer: 'checkmarkContainer';
-};
-export default classNames;
diff --git a/packages/twenty-ui/src/components/input/ColorSchemePicker/internal/ColorSchemeCard/ColorSchemeCard.tsx b/packages/twenty-ui/src/components/input/ColorSchemePicker/internal/ColorSchemeCard/ColorSchemeCard.tsx
deleted file mode 100644
index 063521f4fc4..00000000000
--- a/packages/twenty-ui/src/components/input/ColorSchemePicker/internal/ColorSchemeCard/ColorSchemeCard.tsx
+++ /dev/null
@@ -1,137 +0,0 @@
-import React from 'react';
-
-import { clsx } from 'clsx';
-
-import { Checkmark } from '@ui/components/input/ColorSchemePicker/internal/Checkmark/Checkmark';
-import { handleClickableElementKeyDown } from '@ui/primitives/accessibility/utils/handleClickableElementKeyDown';
-import { type ColorScheme } from '@ui/primitives/input/types/ColorScheme';
-import { GRAY_SCALE_DARK } from '@ui/theme/constants/GrayScaleDark';
-import { GRAY_SCALE_LIGHT } from '@ui/theme/constants/GrayScaleLight';
-import { isDefined } from '@ui/utilities/utils/isDefined';
-
-import styles from './ColorSchemeCard.module.scss';
-
-type ColorSchemeSegmentProps = {
- variant: ColorScheme;
- className?: string;
-} & React.ComponentPropsWithoutRef<'div'>;
-
-const ColorSchemeSegment = ({
- variant,
- style,
- className,
- onClick,
- onMouseEnter,
- onMouseLeave,
- 'aria-label': ariaLabel,
-}: ColorSchemeSegmentProps) => {
- const grayScale = variant === 'Dark' ? GRAY_SCALE_DARK : GRAY_SCALE_LIGHT;
-
- const segmentClassName = clsx(styles.colorSchemeBackground, className);
- const segmentStyle = {
- '--color-scheme-card-background': grayScale.gray4,
- '--color-scheme-card-border-color': grayScale.gray5,
- '--color-scheme-card-content-background': grayScale.gray1,
- '--color-scheme-card-content-color': grayScale.gray12,
- ...style,
- } as React.CSSProperties;
- const segmentContent = <div className={styles.colorSchemeContent}>Aa</div>;
-
- if (isDefined(onClick)) {
- return (
- <div
- className={segmentClassName}
- style={segmentStyle}
- role="button"
- tabIndex={0}
- aria-label={ariaLabel ?? variant}
- onClick={onClick}
- onKeyDown={handleClickableElementKeyDown}
- onMouseEnter={onMouseEnter}
- onMouseLeave={onMouseLeave}
- >
- {segmentContent}
- </div>
- );
- }
-
- return (
- <div
- className={segmentClassName}
- style={segmentStyle}
- onMouseEnter={onMouseEnter}
- onMouseLeave={onMouseLeave}
- >
- {segmentContent}
- </div>
- );
-};
-
-type ColorSchemeCardProps = {
- variant: ColorScheme;
- selected?: boolean;
-} & React.ComponentPropsWithoutRef<'div'>;
-
-export const ColorSchemeCard = ({
- variant,
- selected,
- onClick,
- className,
- 'aria-label': ariaLabel,
-}: ColorSchemeCardProps) => {
- const mixedSegments = (
- <>
- <ColorSchemeSegment
- style={{ borderStartEndRadius: 0, borderEndEndRadius: 0 }}
- variant="Light"
- />
- <ColorSchemeSegment
- style={{ borderStartStartRadius: 0, borderEndStartRadius: 0 }}
- variant="Dark"
- />
- </>
- );
-
- if (variant === 'System') {
- return (
- <div className={clsx(styles.container, className)}>
- {isDefined(onClick) ? (
- <div
- className={styles.mixedColorSchemeSegment}
- role="button"
- tabIndex={0}
- aria-label={ariaLabel ?? variant}
- onClick={onClick}
- onKeyDown={handleClickableElementKeyDown}
- >
- {mixedSegments}
- </div>
- ) : (
- <div className={styles.mixedColorSchemeSegment}>{mixedSegments}</div>
- )}
- <div
- className={styles.checkmarkContainer}
- data-selected={selected || undefined}
- >
- <Checkmark />
- </div>
- </div>
- );
- }
-
- return (
- <div className={clsx(styles.container, className)}>
- <ColorSchemeSegment
- variant={variant}
- onClick={onClick}
- aria-label={ariaLabel}
- />
- <div
- className={styles.checkmarkContainer}
- data-selected={selected || undefined}
- >
- <Checkmark />
- </div>
- </div>
- );
-};
diff --git a/packages/twenty-ui/src/components/input/ColorSchemePicker/internal/ColorSchemeCard/__stories__/ColorSchemeCard.stories.module.scss b/packages/twenty-ui/src/components/input/ColorSchemePicker/internal/ColorSchemeCard/__stories__/ColorSchemeCard.stories.module.scss
deleted file mode 100644
index 5c0b5aaa72e..00000000000
--- a/packages/twenty-ui/src/components/input/ColorSchemePicker/internal/ColorSchemeCard/__stories__/ColorSchemeCard.stories.module.scss
+++ /dev/null
@@ -1,8 +0,0 @@
-.container {
- display: flex;
- flex-direction: row;
-
- > * + * {
- margin-left: var(--t-spacing-4);
- }
-}
diff --git a/packages/twenty-ui/src/components/input/ColorSchemePicker/internal/ColorSchemeCard/__stories__/ColorSchemeCard.stories.module.scss.d.ts b/packages/twenty-ui/src/components/input/ColorSchemePicker/internal/ColorSchemeCard/__stories__/ColorSchemeCard.stories.module.scss.d.ts
deleted file mode 100644
index 8df71b4dead..00000000000
--- a/packages/twenty-ui/src/components/input/ColorSchemePicker/internal/ColorSchemeCard/__stories__/ColorSchemeCard.stories.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/components/input/ColorSchemePicker/internal/ColorSchemeCard/__stories__/ColorSchemeCard.stories.tsx b/packages/twenty-ui/src/components/input/ColorSchemePicker/internal/ColorSchemeCard/__stories__/ColorSchemeCard.stories.tsx
deleted file mode 100644
index db6fdb833fd..00000000000
--- a/packages/twenty-ui/src/components/input/ColorSchemePicker/internal/ColorSchemeCard/__stories__/ColorSchemeCard.stories.tsx
+++ /dev/null
@@ -1,43 +0,0 @@
-import { type Meta, type StoryObj } from '@storybook/react-vite';
-import { ComponentDecorator } from '@ui/testing';
-
-import { ColorSchemeCard } from '@ui/components/input/ColorSchemePicker/internal/ColorSchemeCard/ColorSchemeCard';
-
-import styles from './ColorSchemeCard.stories.module.scss';
-
-const meta: Meta<typeof ColorSchemeCard> = {
- title: 'UI/Input/ColorScheme/ColorSchemeCard',
- component: ColorSchemeCard,
- decorators: [
- (Story) => {
- return (
- <div className={styles.container}>
- <Story />
- </div>
- );
- },
- ComponentDecorator,
- ],
- argTypes: {
- variant: { control: false },
- },
- args: { selected: false },
-};
-
-export default meta;
-type Story = StoryObj<typeof ColorSchemeCard>;
-
-export const Default: Story = {
- render: (args) => (
- <>
- <ColorSchemeCard variant="Light" selected={args.selected} />
- <ColorSchemeCard variant="Dark" selected={args.selected} />
- <ColorSchemeCard variant="System" selected={args.selected} />
- </>
- ),
-};
-
-export const Selected: Story = {
- ...Default,
- args: { selected: true },
-};
diff --git a/packages/twenty-ui/src/components/input/ColorSchemePicker/types/ColorSchemePickerProps.ts b/packages/twenty-ui/src/components/input/ColorSchemePicker/types/ColorSchemePickerProps.ts
deleted file mode 100644
index cfc9cdad43e..00000000000
--- a/packages/twenty-ui/src/components/input/ColorSchemePicker/types/ColorSchemePickerProps.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import { type ColorScheme } from '@ui/primitives/input/types/ColorScheme';
-
-export type ColorSchemePickerProps = {
- value: ColorScheme;
- className?: string;
- onChange: (value: ColorScheme) => void;
- lightLabel: string;
- darkLabel: string;
- systemLabel: string;
-};
diff --git a/packages/twenty-ui/src/primitives/input/index.ts b/packages/twenty-ui/src/primitives/input/index.ts
index 4f76e45bdbd..e5bcf4d0f22 100644
--- a/packages/twenty-ui/src/primitives/input/index.ts
+++ b/packages/twenty-ui/src/primitives/input/index.ts
@@ -54,6 +54,5 @@ export type { SwitchProps } from './Switch/types/SwitchProps';
export type { SwitchSize } from './Switch/types/SwitchSize';
export { Textarea } from './Textarea/Textarea';
export type { TextareaProps } from './Textarea/types/TextareaProps';
-export type { ColorScheme } from './types/ColorScheme';
export type { InputSize } from './types/InputSize';
export type { SelectOption } from './types/SelectOption';
diff --git a/packages/twenty-ui/src/primitives/input/types/ColorScheme.ts b/packages/twenty-ui/src/primitives/input/types/ColorScheme.ts
deleted file mode 100644
index 0a5f3723d78..00000000000
--- a/packages/twenty-ui/src/primitives/input/types/ColorScheme.ts
+++ /dev/null
@@ -1 +0,0 @@
-export type ColorScheme = 'Dark' | 'Light' | 'System';