Skip to content

The open alternative to Salesforce, designed for AI.

Move mobile navigation into its frontend owner (#26992)

Raphaël Bosi291870bfabb0
diff --git a/packages/twenty-docs/docs.json b/packages/twenty-docs/docs.json
index 704d372edfd..77f30aad966 100644
--- a/packages/twenty-docs/docs.json
+++ b/packages/twenty-docs/docs.json
@@ -638,7 +638,6 @@
"ui/components/json-tree",
"ui/components/menu-items",
"ui/components/menu-picker",
- "ui/components/navigation-bar",
"ui/components/notification-counter",
"ui/components/search-input",
"ui/components/tinted-icon-tile"
diff --git a/packages/twenty-docs/navigation/base-structure.json b/packages/twenty-docs/navigation/base-structure.json
index c7085965de8..d9704d72661 100644
--- a/packages/twenty-docs/navigation/base-structure.json
+++ b/packages/twenty-docs/navigation/base-structure.json
@@ -656,7 +656,6 @@
"ui/components/json-tree",
"ui/components/menu-items",
"ui/components/menu-picker",
- "ui/components/navigation-bar",
"ui/components/notification-counter",
"ui/components/search-input",
"ui/components/tinted-icon-tile"
diff --git a/packages/twenty-docs/snippets/ui/generated/components/navigation-bar.mdx b/packages/twenty-docs/snippets/ui/generated/components/navigation-bar.mdx
deleted file mode 100644
index 1dc1c7369d4..00000000000
--- a/packages/twenty-docs/snippets/ui/generated/components/navigation-bar.mdx
+++ /dev/null
@@ -1,24 +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="activeItemName" type="string" required>
- Name of the item to highlight. The application owns navigation.
-</ParamField>
-
-<ParamField body="isHidden" type="boolean" default="false">
- Hides the bar visually and from the accessibility tree.
-</ParamField>
-
-<ParamField body="items" type="{ name: string; label: string; Icon: IconComponent; onClick: () =&gt; void; }[]" required>
- Navigation items with a unique name, accessible label, Icon component, and onClick callback.
-</ParamField>
diff --git a/packages/twenty-docs/ui/components/navigation-bar.mdx b/packages/twenty-docs/ui/components/navigation-bar.mdx
deleted file mode 100644
index 56a47e8f96c..00000000000
--- a/packages/twenty-docs/ui/components/navigation-bar.mdx
+++ /dev/null
@@ -1,44 +0,0 @@
----
-title: NavigationBar
-description: An icon navigation bar with application-owned active state.
----
-
-import NavigationBarReference from '/snippets/ui/generated/components/navigation-bar.mdx';
-
-`NavigationBar` receives items with unique names, accessible labels, icon components, and callbacks. `activeItemName` controls which item is highlighted. The bar does not perform routing.
-
-```tsx
-import { useState } from 'react';
-import { NavigationBar } from 'twenty-ui/components';
-import { IconHome, IconSettings } from 'twenty-ui/icon';
-
-export const WorkspaceNavigation = () => {
- const [active, setActive] = useState('home');
-
- return (
- <NavigationBar
- activeItemName={active}
- items={[
- {
- name: 'home',
- label: 'Home',
- Icon: IconHome,
- onClick: () => setActive('home'),
- },
- {
- name: 'settings',
- label: 'Settings',
- Icon: IconSettings,
- onClick: () => setActive('settings'),
- },
- ]}
- />
- );
-};
-```
-
-Connect each callback to your router when the items change routes. `isHidden` hides the bar. For ordinary navigation links with tab styling, use [TabButton](/ui/components/tab-button).
-
-## Props
-
-<NavigationBarReference />
diff --git a/packages/twenty-docs/ui/components/overview.mdx b/packages/twenty-docs/ui/components/overview.mdx
index 7f315c50403..97cb64f9eaf 100644
--- a/packages/twenty-docs/ui/components/overview.mdx
+++ b/packages/twenty-docs/ui/components/overview.mdx
@@ -34,6 +34,5 @@ Import shared components from `twenty-ui/components`. The code editor has its ow
| [AnimatedIconCrossfade](/ui/components/animated-icon-crossfade) | State-driven icon transitions. |
| [Menu rows](/ui/components/menu-items) | MenuItem, MenuItemAvatar, MenuItemDraggable, and MenuItemSuggestion. |
| [MenuPicker](/ui/components/menu-picker) | Compact icon toggles with tooltips. |
-| [NavigationBar](/ui/components/navigation-bar) | Icon navigation with application-owned routing. |
Routing, record formatting, product placeholders, and application state belong to the host application. Shared components expose data, callback, and render props for those integrations.
diff --git a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-navigation-gallery.front-component.tsx b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-navigation-gallery.front-component.tsx
index dfcb5cd8e42..4e37206253c 100644
--- a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-navigation-gallery.front-component.tsx
+++ b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-navigation-gallery.front-component.tsx
@@ -6,7 +6,6 @@ import {
MenuItemDraggable,
MenuItemSuggestion,
MenuPicker,
- NavigationBar,
} from 'twenty-ui/components';
import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/typography';
import { IconHome, IconUser } from 'twenty-ui/icon';
@@ -172,17 +171,6 @@ const NAVIGATION_ENTRIES: GalleryEntry[] = [
name: 'MenuPicker',
node: <MenuPicker id="picker-1" icon={IconHome} label="Picker" />,
},
- {
- name: 'NavigationBar',
- node: (
- <NavigationBar
- activeItemName="home"
- items={[
- { name: 'home', label: 'Home', Icon: IconHome, onClick: () => {} },
- ]}
- />
- ),
- },
];
const NavigationGallery = () => (
diff --git a/packages/twenty-front/src/modules/navigation/components/MobileNavigationBar.tsx b/packages/twenty-front/src/modules/navigation/components/MobileNavigationBar.tsx
index bf48e1242e4..7e4298f281b 100644
--- a/packages/twenty-front/src/modules/navigation/components/MobileNavigationBar.tsx
+++ b/packages/twenty-front/src/modules/navigation/components/MobileNavigationBar.tsx
@@ -5,9 +5,11 @@ import { isMobileNavigationBarVisibleState } from '@/navigation/states/isMobileN
import { isSidePanelOpenedState } from '@/side-panel/states/isSidePanelOpenedState';
import { RootStackingContextZIndices } from '@/ui/layout/constants/RootStackingContextZIndices';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
+import { css } from '@linaria/core';
import { styled } from '@linaria/react';
import { useLocation } from 'react-router-dom';
-import { NavigationBar } from 'twenty-ui/components';
+import { IconButton } from 'twenty-ui/components';
+import { themeCssVariables } from 'twenty-ui/theme';
import { isAiChatPath } from '~/utils/isAiChatPath';
// The bar floats over the page, so the container has to let taps through to
@@ -27,15 +29,69 @@ const StyledFloatingContainer = styled.div`
right: 0;
z-index: ${RootStackingContextZIndices.MobileNavigationBar};
- > * {
- pointer-events: auto;
- }
-
@media print {
display: none;
}
`;
+const StyledNavigationBar = styled.nav`
+ align-items: center;
+ backdrop-filter: ${themeCssVariables.blur.strong};
+ background: ${themeCssVariables.background.transparent.primary};
+ border: 1px solid ${themeCssVariables.border.color.transparentStrong};
+ border-radius: ${themeCssVariables.border.radius.pill};
+ box-shadow: ${themeCssVariables.boxShadow.strong};
+ box-sizing: border-box;
+ corner-shape: round;
+ display: flex;
+ gap: ${themeCssVariables.spacing[1]};
+ justify-content: center;
+ padding: ${themeCssVariables.spacing[1]};
+ pointer-events: auto;
+ transition:
+ opacity calc(${themeCssVariables.animation.duration.normal} * 1s) ease,
+ transform calc(${themeCssVariables.animation.duration.normal} * 1s) ease,
+ visibility calc(${themeCssVariables.animation.duration.normal} * 1s);
+ width: max-content;
+
+ &[data-hidden] {
+ opacity: 0;
+ pointer-events: none;
+ transform: translateY(calc(100% + ${themeCssVariables.spacing[4]}));
+ visibility: hidden;
+ }
+
+ @media (prefers-reduced-motion: reduce) {
+ transition: none;
+ }
+`;
+
+const navigationButtonClassName = css`
+ && {
+ --tw-button-size: ${themeCssVariables.spacing[10]};
+ --tw-icon-button-icon-size: ${themeCssVariables.icon.size.lg};
+
+ border: none;
+ color: ${themeCssVariables.grayScale.gray10};
+ transition: background-color
+ calc(${themeCssVariables.animation.duration.fast} * 1s) ease;
+
+ &[aria-pressed='true'] {
+ background: ${themeCssVariables.background.transparent.medium};
+ }
+
+ @media (hover: hover) {
+ &:hover {
+ background: ${themeCssVariables.background.transparent.light};
+ }
+ }
+
+ @media (prefers-reduced-motion: reduce) {
+ transition: none;
+ }
+ }
+`;
+
export const MobileNavigationBar = () => {
const { pathname } = useLocation();
const isSidePanelOpened = useAtomStateValue(isSidePanelOpenedState);
@@ -55,11 +111,26 @@ export const MobileNavigationBar = () => {
<>
<MobileNavigationBarScrollEffect />
<StyledFloatingContainer>
- <NavigationBar
- activeItemName={activeItemName}
- isHidden={isHidden}
- items={items}
- />
+ <StyledNavigationBar
+ data-hidden={isHidden ? '' : undefined}
+ aria-hidden={isHidden}
+ inert={isHidden || undefined}
+ >
+ {items.map(({ Icon, name, label, onClick }) => (
+ <IconButton
+ key={name}
+ className={navigationButtonClassName}
+ variant="ghost"
+ shape="round"
+ aria-label={label}
+ aria-pressed={activeItemName === name}
+ onClick={onClick}
+ tabIndex={isHidden ? -1 : 0}
+ >
+ <Icon aria-hidden />
+ </IconButton>
+ ))}
+ </StyledNavigationBar>
</StyledFloatingContainer>
</>
);
diff --git a/packages/twenty-front/src/modules/navigation/components/__stories__/MobileNavigationBar.stories.tsx b/packages/twenty-front/src/modules/navigation/components/__stories__/MobileNavigationBar.stories.tsx
new file mode 100644
index 00000000000..9970817acb0
--- /dev/null
+++ b/packages/twenty-front/src/modules/navigation/components/__stories__/MobileNavigationBar.stories.tsx
@@ -0,0 +1,113 @@
+import { MobileNavigationBar } from '@/navigation/components/MobileNavigationBar';
+import { isSidePanelOpenedState } from '@/side-panel/states/isSidePanelOpenedState';
+import { useAtomState } from '@/ui/utilities/state/jotai/hooks/useAtomState';
+import { styled } from '@linaria/react';
+import { type Meta, type StoryObj } from '@storybook/react-vite';
+import { MemoryRouter } from 'react-router-dom';
+import { expect, userEvent, waitFor, within } from 'storybook/test';
+import { Button } from 'twenty-ui/primitives/input';
+import { ComponentDecorator } from 'twenty-ui/testing';
+import { ObjectMetadataItemsDecorator } from '~/testing/decorators/ObjectMetadataItemsDecorator';
+import { ToastDecorator } from '~/testing/decorators/ToastDecorator';
+
+const StyledFrame = styled.div`
+ height: 240px;
+ position: relative;
+ width: 320px;
+`;
+
+const VisibilityControl = () => {
+ const [isSidePanelOpened, setIsSidePanelOpened] = useAtomState(
+ isSidePanelOpenedState,
+ );
+
+ return (
+ <Button onClick={() => setIsSidePanelOpened(!isSidePanelOpened)}>
+ {isSidePanelOpened ? 'Close side panel' : 'Open side panel'}
+ </Button>
+ );
+};
+
+type StoryArgs = { routePath: string };
+
+const meta: Meta<StoryArgs> = {
+ title: 'UI/Navigation/NavigationBar/NavigationBar',
+ component: MobileNavigationBar,
+ decorators: [
+ ComponentDecorator,
+ ObjectMetadataItemsDecorator,
+ ToastDecorator,
+ (Story, { args }) => (
+ <MemoryRouter initialEntries={[args.routePath]}>
+ <StyledFrame>
+ <Story />
+ </StyledFrame>
+ </MemoryRouter>
+ ),
+ ],
+ args: { routePath: '/home' },
+ render: () => <MobileNavigationBar />,
+};
+
+export default meta;
+type Story = StoryObj<StoryArgs>;
+
+export const Default: Story = {
+ play: async ({ canvasElement }) => {
+ const canvas = within(canvasElement);
+
+ await expect(await canvas.findByRole('navigation')).toBeVisible();
+ await expect(canvas.getByRole('button', { name: 'Home' })).toHaveAttribute(
+ 'aria-pressed',
+ 'true',
+ );
+ await expect(
+ canvas.getByRole('button', { name: 'Search' }),
+ ).toHaveAttribute('aria-pressed', 'false');
+ },
+};
+
+export const Hidden: Story = {
+ args: { routePath: '/chat/20202020-0687-4c41-b707-ed1bfca972a7' },
+ play: async ({ canvasElement }) => {
+ const canvas = within(canvasElement);
+ const navigation = await canvas.findByRole('navigation', { hidden: true });
+
+ await expect(navigation).not.toBeVisible();
+ await expect(navigation).toHaveAttribute('aria-hidden', 'true');
+
+ const home = canvas.getByLabelText('Home');
+ home.focus();
+ await expect(home).not.toHaveFocus();
+ },
+};
+
+export const HideAndReveal: Story = {
+ render: () => (
+ <>
+ <VisibilityControl />
+ <MobileNavigationBar />
+ </>
+ ),
+ play: async ({ canvasElement }) => {
+ const canvas = within(canvasElement);
+ const home = await canvas.findByRole('button', { name: 'Home' });
+ await expect(home).toHaveAttribute('aria-pressed', 'true');
+ home.focus();
+ await expect(home).toHaveFocus();
+
+ await userEvent.click(
+ canvas.getByRole('button', { name: 'Open side panel' }),
+ );
+ home.focus();
+ await expect(home).not.toHaveFocus();
+ await expect(canvas.queryByRole('navigation')).not.toBeInTheDocument();
+
+ await userEvent.click(
+ canvas.getByRole('button', { name: 'Close side panel' }),
+ );
+ await waitFor(() => expect(canvas.getByRole('navigation')).toBeVisible());
+ home.focus();
+ await expect(home).toHaveFocus();
+ },
+};
diff --git a/packages/twenty-front/src/modules/navigation/components/__tests__/MobileNavigationBar.test.tsx b/packages/twenty-front/src/modules/navigation/components/__tests__/MobileNavigationBar.test.tsx
index 5e0352fe1d9..0b399b9b681 100644
--- a/packages/twenty-front/src/modules/navigation/components/__tests__/MobileNavigationBar.test.tsx
+++ b/packages/twenty-front/src/modules/navigation/components/__tests__/MobileNavigationBar.test.tsx
@@ -1,50 +1,121 @@
import { MobileNavigationBar } from '@/navigation/components/MobileNavigationBar';
import { useMobileNavigationBarItems } from '@/navigation/hooks/useMobileNavigationBarItems';
-import { render, screen } from '@testing-library/react';
+import { isSidePanelOpenedState } from '@/side-panel/states/isSidePanelOpenedState';
+import { act, fireEvent, render, screen } from '@testing-library/react';
+import userEvent from '@testing-library/user-event';
import { createStore, Provider } from 'jotai';
import { MemoryRouter } from 'react-router-dom';
-import { IconHome } from 'twenty-ui/icon';
+import { IconHome, IconSearch } from 'twenty-ui/icon';
+import { Button } from 'twenty-ui/primitives/input';
jest.mock('@/navigation/hooks/useMobileNavigationBarItems');
-jest.mock('@/navigation/components/MobileNavigationBarScrollEffect', () => ({
- MobileNavigationBarScrollEffect: () => null,
-}));
+const renderMobileNavigationBar = (pathname = '/home') => {
+ const store = createStore();
-const renderMobileNavigationBar = (pathname: string) =>
render(
- <Provider store={createStore()}>
+ <Provider store={store}>
<MemoryRouter initialEntries={[pathname]}>
+ <div role="region" aria-label="Page content" />
<MobileNavigationBar />
+ <Button>Page action</Button>
</MemoryRouter>
</Provider>,
);
+ return { store };
+};
+
+const onSearchClick = jest.fn();
+
describe('MobileNavigationBar', () => {
beforeEach(() => {
+ jest.clearAllMocks();
jest.mocked(useMobileNavigationBarItems).mockReturnValue({
activeItemName: 'home',
items: [
{ name: 'home', label: 'Home', Icon: IconHome, onClick: jest.fn() },
+ {
+ name: 'search',
+ label: 'Search',
+ Icon: IconSearch,
+ onClick: onSearchClick,
+ },
],
});
});
- it('shows the bar on the home page', () => {
- renderMobileNavigationBar('/home');
+ it('exposes labeled buttons and the active destination', () => {
+ renderMobileNavigationBar();
expect(screen.getByRole('navigation')).not.toHaveAttribute(
'aria-hidden',
'true',
);
+ expect(
+ screen.getByRole('button', { name: 'Home', pressed: true }),
+ ).toBeVisible();
+ expect(
+ screen.getByRole('button', { name: 'Search', pressed: false }),
+ ).toBeVisible();
+ });
+
+ it('activates an item by pointer, Enter, and Space', async () => {
+ const user = userEvent.setup();
+ renderMobileNavigationBar();
+
+ await user.click(screen.getByRole('button', { name: 'Search' }));
+ await user.keyboard('{Enter}');
+ await user.keyboard(' ');
+
+ expect(onSearchClick).toHaveBeenCalledTimes(3);
});
- it('hides the bar on the chat page', () => {
+ it('hides the bar and skips its buttons on chat pages', async () => {
+ const user = userEvent.setup();
renderMobileNavigationBar('/chat/20202020-0687-4c41-b707-ed1bfca972a7');
expect(screen.getByRole('navigation', { hidden: true })).toHaveAttribute(
'aria-hidden',
'true',
);
+ expect(
+ screen.queryByRole('button', { name: 'Home' }),
+ ).not.toBeInTheDocument();
+ await user.tab();
+ expect(screen.getByRole('button', { name: 'Page action' })).toHaveFocus();
+ });
+
+ it('removes and restores keyboard access when the side panel opens and closes', async () => {
+ const user = userEvent.setup();
+ const { store } = renderMobileNavigationBar();
+
+ act(() => store.set(isSidePanelOpenedState.atom, true));
+
+ expect(screen.getByRole('navigation', { hidden: true })).toHaveAttribute(
+ 'inert',
+ );
+ await user.tab();
+ expect(screen.getByRole('button', { name: 'Page action' })).toHaveFocus();
+
+ act(() => store.set(isSidePanelOpenedState.atom, false));
+
+ expect(screen.getByRole('navigation')).not.toHaveAttribute('inert');
+ await user.tab({ shift: true });
+ expect(screen.getByRole('button', { name: 'Search' })).toHaveFocus();
+ });
+
+ it('hides while scrolling down and reveals while scrolling back up', () => {
+ renderMobileNavigationBar();
+ const content = screen.getByRole('region', { name: 'Page content' });
+
+ fireEvent.scroll(content, { target: { scrollTop: 100 } });
+ fireEvent.scroll(content, { target: { scrollTop: 130 } });
+
+ expect(screen.queryByRole('navigation')).not.toBeInTheDocument();
+
+ fireEvent.scroll(content, { target: { scrollTop: 100 } });
+
+ expect(screen.getByRole('navigation')).not.toHaveAttribute('inert');
});
});
diff --git a/packages/twenty-front/src/modules/ui/navigation/navigation-bar/components/__stories__/NavigationBar.stories.tsx b/packages/twenty-front/src/modules/ui/navigation/navigation-bar/components/__stories__/NavigationBar.stories.tsx
deleted file mode 100644
index fabf93375dd..00000000000
--- a/packages/twenty-front/src/modules/ui/navigation/navigation-bar/components/__stories__/NavigationBar.stories.tsx
+++ /dev/null
@@ -1,47 +0,0 @@
-import { type Meta, type StoryObj } from '@storybook/react-vite';
-
-import { NavigationBar } from 'twenty-ui/components';
-import {
- IconCheckbox,
- IconList,
- IconSearch,
- IconSettings,
-} from 'twenty-ui/icon';
-import { ComponentDecorator } from 'twenty-ui/testing';
-import { ComponentWithRouterDecorator } from '~/testing/decorators/ComponentWithRouterDecorator';
-
-const meta: Meta<typeof NavigationBar> = {
- title: 'UI/Navigation/NavigationBar/NavigationBar',
- component: NavigationBar,
- args: {
- activeItemName: 'main',
- items: [
- { name: 'main', label: 'Main', Icon: IconList, onClick: () => undefined },
- {
- name: 'search',
- label: 'Search',
- Icon: IconSearch,
- onClick: () => undefined,
- },
- {
- name: 'tasks',
- label: 'Tasks',
- Icon: IconCheckbox,
- onClick: () => undefined,
- },
- {
- name: 'settings',
- label: 'Settings',
- Icon: IconSettings,
- onClick: () => undefined,
- },
- ],
- },
-};
-
-export default meta;
-type Story = StoryObj<typeof NavigationBar>;
-
-export const Default: Story = {
- decorators: [ComponentDecorator, ComponentWithRouterDecorator],
-};
diff --git a/packages/twenty-shared/src/constants/DocumentationPaths.ts b/packages/twenty-shared/src/constants/DocumentationPaths.ts
index 62b1af865b8..6a66d75eac3 100644
--- a/packages/twenty-shared/src/constants/DocumentationPaths.ts
+++ b/packages/twenty-shared/src/constants/DocumentationPaths.ts
@@ -144,7 +144,6 @@ export const DOCUMENTATION_PATHS = {
UI_COMPONENTS_JSON_TREE: '/ui/components/json-tree',
UI_COMPONENTS_MENU_ITEMS: '/ui/components/menu-items',
UI_COMPONENTS_MENU_PICKER: '/ui/components/menu-picker',
- UI_COMPONENTS_NAVIGATION_BAR: '/ui/components/navigation-bar',
UI_COMPONENTS_NOTIFICATION_COUNTER: '/ui/components/notification-counter',
UI_COMPONENTS_OVERVIEW: '/ui/components/overview',
UI_COMPONENTS_SEARCH_INPUT: '/ui/components/search-input',
diff --git a/packages/twenty-ui/docs/components.ts b/packages/twenty-ui/docs/components.ts
index 2a8199dbb36..af8bb34730e 100644
--- a/packages/twenty-ui/docs/components.ts
+++ b/packages/twenty-ui/docs/components.ts
@@ -15,7 +15,6 @@ import { MENU_ITEM_AVATAR_PROP_DESCRIPTIONS } from './menuItemAvatarPropDescript
import { MENU_ITEM_DRAGGABLE_PROP_DESCRIPTIONS } from './menuItemDraggablePropDescriptions';
import { MENU_ITEM_SUGGESTION_PROP_DESCRIPTIONS } from './menuItemSuggestionPropDescriptions';
import { MENU_PICKER_PROP_DESCRIPTIONS } from './menuPickerPropDescriptions';
-import { NAVIGATION_BAR_PROP_DESCRIPTIONS } from './navigationBarPropDescriptions';
import { THEME_PROVIDER_PROP_DESCRIPTIONS } from './themeProviderPropDescriptions';
import { ICON_PROP_DESCRIPTIONS } from './iconPropDescriptions';
import { ICONS_PROVIDER_PROP_DESCRIPTIONS } from './iconsProviderPropDescriptions';
@@ -618,13 +617,6 @@ export const DOCUMENTED_COMPONENTS = [
slug: 'components/menu-picker',
propDescriptions: MENU_PICKER_PROP_DESCRIPTIONS,
},
- {
- name: 'NavigationBar',
- source: 'components/navigation/NavigationBar/NavigationBar.tsx',
- entryPoint: 'twenty-ui/components',
- slug: 'components/navigation-bar',
- propDescriptions: NAVIGATION_BAR_PROP_DESCRIPTIONS,
- },
{
name: 'ThemeProvider',
source: 'theme/ThemeProvider.tsx',
diff --git a/packages/twenty-ui/docs/label-ownership.md b/packages/twenty-ui/docs/label-ownership.md
index e155b899bed..2e39a80ac47 100644
--- a/packages/twenty-ui/docs/label-ownership.md
+++ b/packages/twenty-ui/docs/label-ownership.md
@@ -17,7 +17,7 @@ This covers production exports under components, primitives, and icons, includin
| ResizeHandle and CodeEditor | ResizeHandle accepts native labels over `Resize`. CodeEditor exposes `resizeLabel` (default `Resize editor`) and Monaco `options`, including its editor accessible label. The loading indicator adds no text. Monaco owns its internal editor messages. |
| Input, Textarea, Select, Field, Slider, Radio, RadioGroup, Checkbox, Switch, SegmentedControl | Native attributes, compound label/description/error parts, options, and children belong to the caller. Browser validation messages remain browser-owned; Field.Error children or render content can replace them. |
| Dialog, AlertDialog, Popover, Tooltip, Tabs | Text belongs to title, description, close, trigger, tab, and popup parts. No built-in English action or status strings. |
-| Banner, InlineBanner, SettingsRow, Section, NavigationBar, CommandBlock | Content and labels belong to supplied props or children. |
+| Banner, InlineBanner, SettingsRow, Section, CommandBlock | Content and labels belong to supplied props or children. |
| Tag, Status, Pill, AvatarGroup, NotificationCounter, ColorSample, TintedIconTile, typography, layout and icon exports | Caller content, data values, native accessible attributes where supported, or decorative output. Loader and progress graphics add no built-in English loading message. |
Shortcut owns symbol and separator formatting for visual hints and strings. Flat key arrays represent simultaneous combinations; nested key arrays represent ordered sequences of combinations. Hosts supply `sequenceJoinLabel` (default `then`), optional `combinationSeparator`, and native accessible labels. The `shortcutJoinLabel` props on host controls forward the sequence label.
diff --git a/packages/twenty-ui/docs/module-ownership.json b/packages/twenty-ui/docs/module-ownership.json
index e361ad8b7dd..6d10f0b77d4 100644
--- a/packages/twenty-ui/docs/module-ownership.json
+++ b/packages/twenty-ui/docs/module-ownership.json
@@ -60,7 +60,6 @@
"MenuItemDraggable",
"MenuItemSuggestion",
"MenuPicker",
- "NavigationBar",
"NotificationCounter",
"SearchInput",
"Section",
diff --git a/packages/twenty-ui/docs/navigationBarPropDescriptions.ts b/packages/twenty-ui/docs/navigationBarPropDescriptions.ts
deleted file mode 100644
index e29dbb1c58b..00000000000
--- a/packages/twenty-ui/docs/navigationBarPropDescriptions.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { type ComponentProps } from 'react';
-
-import { type NavigationBar } from '../src/components/navigation/NavigationBar/NavigationBar';
-
-export const NAVIGATION_BAR_PROP_DESCRIPTIONS = {
- activeItemName:
- 'Name of the item to highlight. The application owns navigation.',
- isHidden: 'Hides the bar visually and from the accessibility tree.',
- items:
- 'Navigation items with a unique name, accessible label, Icon component, and onClick callback.',
-} satisfies Partial<Record<keyof ComponentProps<typeof NavigationBar>, string>>;
diff --git a/packages/twenty-ui/docs/public-exports.json b/packages/twenty-ui/docs/public-exports.json
index 6f265e60512..86e83b8e538 100644
--- a/packages/twenty-ui/docs/public-exports.json
+++ b/packages/twenty-ui/docs/public-exports.json
@@ -30,7 +30,6 @@
"MenuItemDraggable": "components/navigation/MenuItemDraggable/MenuItemDraggable",
"MenuItemSuggestion": "components/navigation/MenuItemSuggestion/MenuItemSuggestion",
"MenuPicker": "components/navigation/MenuPicker/MenuPicker",
- "NavigationBar": "components/navigation/NavigationBar/NavigationBar",
"NotificationCounter": "components/data-display/NotificationCounter/NotificationCounter",
"SearchInput": "components/input/SearchInput/SearchInput",
"Section": "components/layout/Section/Section",
diff --git a/packages/twenty-ui/generated/components.docs.json b/packages/twenty-ui/generated/components.docs.json
index a9965684e46..4d9d6af5082 100644
--- a/packages/twenty-ui/generated/components.docs.json
+++ b/packages/twenty-ui/generated/components.docs.json
@@ -9186,34 +9186,6 @@
}
]
},
- {
- "name": "NavigationBar",
- "entryPoint": "twenty-ui/components",
- "slug": "components/navigation-bar",
- "props": [
- {
- "name": "activeItemName",
- "type": "string",
- "required": true,
- "defaultValue": null,
- "description": "Name of the item to highlight. The application owns navigation."
- },
- {
- "name": "isHidden",
- "type": "boolean",
- "required": false,
- "defaultValue": "false",
- "description": "Hides the bar visually and from the accessibility tree."
- },
- {
- "name": "items",
- "type": "{ name: string; label: string; Icon: IconComponent; onClick: () => void; }[]",
- "required": true,
- "defaultValue": null,
- "description": "Navigation items with a unique name, accessible label, Icon component, and onClick callback."
- }
- ]
- },
{
"name": "ThemeProvider",
"entryPoint": "twenty-ui/theme",
diff --git a/packages/twenty-ui/src/components/index.ts b/packages/twenty-ui/src/components/index.ts
index 83875d40256..f9b4e8b78f9 100644
--- a/packages/twenty-ui/src/components/index.ts
+++ b/packages/twenty-ui/src/components/index.ts
@@ -84,6 +84,5 @@ export { MenuItemSuggestion } from './navigation/MenuItemSuggestion/MenuItemSugg
export type { MenuItemSuggestionProps } from './navigation/MenuItemSuggestion/types/MenuItemSuggestionProps';
export { MenuPicker } from './navigation/MenuPicker/MenuPicker';
export type { MenuPickerProps } from './navigation/MenuPicker/types/MenuPickerProps';
-export { NavigationBar } from './navigation/NavigationBar/NavigationBar';
export { TabButton } from './navigation/TabButton/TabButton';
export type { TabButtonProps } from './navigation/TabButton/types/TabButtonProps';
diff --git a/packages/twenty-ui/src/components/navigation/NavigationBar/NavigationBar.module.scss b/packages/twenty-ui/src/components/navigation/NavigationBar/NavigationBar.module.scss
deleted file mode 100644
index 21fdfeb3f4d..00000000000
--- a/packages/twenty-ui/src/components/navigation/NavigationBar/NavigationBar.module.scss
+++ /dev/null
@@ -1,30 +0,0 @@
-.container {
- align-items: center;
- backdrop-filter: var(--t-blur-strong);
- background: var(--t-background-transparent-primary);
- border: 1px solid var(--t-border-color-transparent-strong);
- border-radius: var(--t-border-radius-pill);
- box-shadow: var(--t-box-shadow-strong);
- box-sizing: border-box;
- corner-shape: round;
- display: flex;
- gap: var(--t-spacing-1);
- justify-content: center;
- padding: var(--t-spacing-1);
- transition:
- opacity duration(normal) ease,
- transform duration(normal) ease,
- visibility duration(normal);
- width: max-content;
-
- &[data-hidden] {
- opacity: 0;
- pointer-events: none;
- transform: translateY(calc(100% + var(--t-spacing-4)));
- visibility: hidden;
- }
-
- @media (prefers-reduced-motion: reduce) {
- transition: none;
- }
-}
diff --git a/packages/twenty-ui/src/components/navigation/NavigationBar/NavigationBar.module.scss.d.ts b/packages/twenty-ui/src/components/navigation/NavigationBar/NavigationBar.module.scss.d.ts
deleted file mode 100644
index 8df71b4dead..00000000000
--- a/packages/twenty-ui/src/components/navigation/NavigationBar/NavigationBar.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/navigation/NavigationBar/NavigationBar.tsx b/packages/twenty-ui/src/components/navigation/NavigationBar/NavigationBar.tsx
deleted file mode 100644
index e6c4be86b4b..00000000000
--- a/packages/twenty-ui/src/components/navigation/NavigationBar/NavigationBar.tsx
+++ /dev/null
@@ -1,40 +0,0 @@
-import { type IconComponent } from '@ui/icon/types/IconComponent';
-
-import { NavigationBarItem } from '@ui/components/navigation/NavigationBar/internal/NavigationBarItem/NavigationBarItem';
-
-import styles from './NavigationBar.module.scss';
-
-type NavigationBarProps = {
- activeItemName: string;
- isHidden?: boolean;
- items: {
- name: string;
- label: string;
- Icon: IconComponent;
- onClick: () => void;
- }[];
-};
-
-export const NavigationBar = ({
- activeItemName,
- isHidden = false,
- items,
-}: NavigationBarProps) => {
- return (
- <nav
- className={styles.container}
- data-hidden={isHidden ? '' : undefined}
- aria-hidden={isHidden}
- >
- {items.map(({ Icon, name, label, onClick }) => (
- <NavigationBarItem
- key={name}
- Icon={Icon}
- isActive={activeItemName === name}
- onClick={onClick}
- ariaLabel={label}
- />
- ))}
- </nav>
- );
-};
diff --git a/packages/twenty-ui/src/components/navigation/NavigationBar/__stories__/NavigationBar.stories.tsx b/packages/twenty-ui/src/components/navigation/NavigationBar/__stories__/NavigationBar.stories.tsx
deleted file mode 100644
index cfd300e931b..00000000000
--- a/packages/twenty-ui/src/components/navigation/NavigationBar/__stories__/NavigationBar.stories.tsx
+++ /dev/null
@@ -1,60 +0,0 @@
-import { type Meta, type StoryObj } from '@storybook/react-vite';
-import { IconHome, IconSearch, IconSettings } from '@ui/icon';
-import { ComponentDecorator } from '@ui/testing';
-import { expect, fn, userEvent, within } from 'storybook/test';
-
-import { NavigationBar } from '@ui/components/navigation/NavigationBar/NavigationBar';
-
-const meta: Meta<typeof NavigationBar> = {
- title: 'UI/Navigation/NavigationBar/NavigationBar',
- component: NavigationBar,
- decorators: [ComponentDecorator],
-};
-
-export default meta;
-type Story = StoryObj<typeof NavigationBar>;
-
-const getItems = (onSearchClick: () => void) => [
- { name: 'Home', label: 'Home', Icon: IconHome, onClick: () => {} },
- { name: 'Search', label: 'Search', Icon: IconSearch, onClick: onSearchClick },
- {
- name: 'Settings',
- label: 'Settings',
- Icon: IconSettings,
- onClick: () => {},
- },
-];
-
-export const Default: Story = {
- args: {
- activeItemName: 'Home',
- items: getItems(fn()),
- },
- play: async ({ canvasElement, args }) => {
- const canvas = within(canvasElement);
-
- const home = canvas.getByRole('button', { name: 'Home' });
- expect(home).toHaveAttribute('aria-pressed', 'true');
-
- const search = canvas.getByRole('button', { name: 'Search' });
- expect(search).toHaveAttribute('aria-pressed', 'false');
-
- await userEvent.click(search);
- expect(args.items[1]?.onClick).toHaveBeenCalled();
- },
-};
-
-export const Hidden: Story = {
- args: {
- activeItemName: 'Home',
- isHidden: true,
- items: getItems(fn()),
- },
- play: async ({ canvasElement }) => {
- const navigationBar = canvasElement.querySelector('nav');
-
- expect(navigationBar).toHaveAttribute('aria-hidden', 'true');
- expect(navigationBar).toHaveAttribute('data-hidden');
- expect(navigationBar).not.toBeVisible();
- },
-};
diff --git a/packages/twenty-ui/src/components/navigation/NavigationBar/internal/NavigationBarItem/NavigationBarItem.module.scss b/packages/twenty-ui/src/components/navigation/NavigationBar/internal/NavigationBarItem/NavigationBarItem.module.scss
deleted file mode 100644
index a431472394e..00000000000
--- a/packages/twenty-ui/src/components/navigation/NavigationBar/internal/NavigationBarItem/NavigationBarItem.module.scss
+++ /dev/null
@@ -1,30 +0,0 @@
-.iconButton {
- align-items: center;
- appearance: none;
- background: none;
- border: none;
- border-radius: var(--t-border-radius-pill);
- color: inherit;
- corner-shape: round;
- cursor: pointer;
- display: flex;
- flex-shrink: 0;
- font: inherit;
- height: var(--t-spacing-10);
- justify-content: center;
- padding: 0;
- transition: background-color duration(fast) ease;
- width: var(--t-spacing-10);
-
- &[data-active] {
- background-color: var(--t-background-transparent-medium);
- }
-
- @include hover-capable {
- &:hover {
- background-color: var(--t-background-transparent-light);
- }
- }
-
- @include focus-ring;
-}
diff --git a/packages/twenty-ui/src/components/navigation/NavigationBar/internal/NavigationBarItem/NavigationBarItem.module.scss.d.ts b/packages/twenty-ui/src/components/navigation/NavigationBar/internal/NavigationBarItem/NavigationBarItem.module.scss.d.ts
deleted file mode 100644
index a106f42ab86..00000000000
--- a/packages/twenty-ui/src/components/navigation/NavigationBar/internal/NavigationBarItem/NavigationBarItem.module.scss.d.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-declare const classNames: {
- readonly iconButton: 'iconButton';
-};
-export default classNames;
diff --git a/packages/twenty-ui/src/components/navigation/NavigationBar/internal/NavigationBarItem/NavigationBarItem.tsx b/packages/twenty-ui/src/components/navigation/NavigationBar/internal/NavigationBarItem/NavigationBarItem.tsx
deleted file mode 100644
index 74cc1329237..00000000000
--- a/packages/twenty-ui/src/components/navigation/NavigationBar/internal/NavigationBarItem/NavigationBarItem.tsx
+++ /dev/null
@@ -1,37 +0,0 @@
-import { type IconComponent } from '@ui/icon/types/IconComponent';
-import { themeCssVariables, useTheme } from '@ui/theme';
-
-import styles from './NavigationBarItem.module.scss';
-
-type NavigationBarItemProps = {
- Icon: IconComponent;
- isActive: boolean;
- onClick: () => void;
- ariaLabel: string;
-};
-
-export const NavigationBarItem = ({
- Icon,
- isActive,
- onClick,
- ariaLabel,
-}: NavigationBarItemProps) => {
- const theme = useTheme();
-
- return (
- <button
- type="button"
- className={styles.iconButton}
- data-active={isActive ? '' : undefined}
- aria-label={ariaLabel}
- aria-pressed={isActive}
- onClick={onClick}
- >
- <Icon
- color={themeCssVariables.grayScale.gray10}
- size={theme.icon.size.lg}
- aria-hidden
- />
- </button>
- );
-};