Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
fc5e0f1
chore(ui-voip,storybook): simplify CardContainers stories by removing…
tassoevan Jun 9, 2026
815ebaa
chore(pdf-worker,storybook): fix Storybook configuration
tassoevan Jun 9, 2026
0bf3a53
chore(meteor,storybook): update swiper aliases to resolve deep file p…
tassoevan Jun 9, 2026
95124ec
chore(meteor,storybook): remove redundant story paths for cleaner con…
tassoevan Jun 9, 2026
88ed22e
chore(storybook,deps): Upgrade Storybook across the monorepo
tassoevan Jun 10, 2026
345da92
chore(web-ui-registration,storybook): remove unused logo and configur…
tassoevan Jun 10, 2026
9fede96
chore(ui-voip,storybook): refactor Storybook configuration and storie…
tassoevan Jun 10, 2026
1467f98
chore(ui-video-conf,storybook): streamline Storybook configuration an…
tassoevan Jun 10, 2026
6ef3561
test(ui-video-conf,storybook): remove lint issues from unit tests
tassoevan Jun 10, 2026
8e1a210
chore(ui-composer,storybook): simplify Storybook setup by integrating…
tassoevan Jun 10, 2026
27e6762
test(ui-composer,storybook): update dependencies and enhance test set…
tassoevan Jun 10, 2026
518c546
chore(ui-client,storybook): refactor stories to use StoryObj type and…
tassoevan Jun 10, 2026
5547036
test(ui-client,storybook): update test implementations to use baseEle…
tassoevan Jun 10, 2026
43b229a
chore(gazzodown,storybook): update Storybook configuration and depend…
tassoevan Jun 10, 2026
b8ba225
chore(fuselage-ui-kit,storybook): remove deprecated DocsContainer, he…
tassoevan Jun 10, 2026
b897b66
chore(livechat,mock-providers): update Storybook dependencies for imp…
tassoevan Jun 10, 2026
1892cb5
chore(livechat,storybook): update story definitions to use StoryObj t…
tassoevan Jun 10, 2026
b0883ef
chore(pdf-worker,storybook): add logo.svg and update main and preview…
tassoevan Jun 10, 2026
d1044db
chore(meteor,storybook): update Storybook stories to use StoryObj for…
tassoevan Jun 10, 2026
f15962c
chore(storybook): refactor rocketChatDecorator for improved structure…
tassoevan Jun 11, 2026
ab157c6
chore(storybook): reenable theme-aware background color in stories
tassoevan Jun 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 15 additions & 30 deletions apps/meteor/.storybook/decorators.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,18 @@ import TranslationContextMock from '../client/stories/contexts/TranslationContex

const MockedAppRoot = mockAppRoot().build();

export const rocketChatDecorator: Decorator = (fn, { parameters }) => {
const linkElement = document.getElementById('theme-styles') || document.createElement('link');
if (linkElement.id !== 'theme-styles') {
require('../app/theme/client/main.css');
require('../app/theme/client/rocketchat.font.css');
linkElement.setAttribute('id', 'theme-styles');
linkElement.setAttribute('rel', 'stylesheet');
linkElement.setAttribute('href', 'https://open.rocket.chat/theme.css');
document.head.appendChild(linkElement);
}

return (
<MockedAppRoot>
<ServerContextMock {...parameters.serverContext}>
<TranslationContextMock {...parameters.translationContext}>
<ModalContextMock {...parameters.modalContext}>
<RouterContextMock {...parameters.routerContext}>
<style>{`
body {
background-color: white;
}
`}</style>
<div className='color-primary-font-color'>{fn()}</div>
</RouterContextMock>
</ModalContextMock>
</TranslationContextMock>
</ServerContextMock>
</MockedAppRoot>
);
};
export const RocketChatDecorator: Decorator = (Story, { parameters }) => (
<MockedAppRoot>
<ServerContextMock {...parameters.serverContext}>
<TranslationContextMock {...parameters.translationContext}>
<ModalContextMock {...parameters.modalContext}>
<RouterContextMock {...parameters.routerContext}>
<div className='color-primary-font-color rcx-content--main'>
<Story />
</div>
</RouterContextMock>
</ModalContextMock>
</TranslationContextMock>
</ServerContextMock>
</MockedAppRoot>
);
47 changes: 0 additions & 47 deletions apps/meteor/.storybook/logo.svg

This file was deleted.

2 changes: 0 additions & 2 deletions apps/meteor/.storybook/logo.svg.d.ts

This file was deleted.

42 changes: 14 additions & 28 deletions apps/meteor/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,15 @@
import { dirname, join, resolve } from 'path';

import type { StorybookConfig } from '@storybook/react-webpack5';
import baseConfig from '@rocket.chat/storybook-config/main';
import webpack from 'webpack';

export default {
stories: ['../client/**/*.stories.{js,tsx}', '../app/**/*.stories.{js,tsx}', '../ee/app/**/*.stories.{js,tsx}'],

addons: [
getAbsolutePath('@storybook/addon-essentials'),
getAbsolutePath('@storybook/addon-interactions'),
getAbsolutePath('@storybook/addon-webpack5-compiler-swc'),
getAbsolutePath('@storybook/addon-styling-webpack'),
getAbsolutePath('@storybook/addon-a11y'),
],

typescript: {
reactDocgen: 'react-docgen',
},
export default baseConfig({
stories: ['../client/**/*.stories.{js,tsx}'],

webpackFinal: async (config) => {
// Those aliases are needed because dependencies in the monorepo use another
// dependencies that are not hoisted on this workspace
const swiperRoot = dirname(require.resolve('swiper/package.json'));
config.resolve = {
...config.resolve,
alias: {
Expand All @@ -29,8 +18,16 @@ export default {
// 'react/jsx-runtime': require.resolve('../../../node_modules/react/jsx-runtime'),
'@tanstack/react-query': require.resolve('../../../node_modules/@tanstack/react-query'),
'@rocket.chat/fuselage$': require.resolve('../../../node_modules/@rocket.chat/fuselage'),
// Meteor's bundler ignores the `exports` field, so source code reaches
// into swiper's internals via deep file paths. Webpack honors `exports`
// and rejects them, so map each subpath to the actual file.
'swiper/swiper-react.mjs$': join(swiperRoot, 'swiper-react.mjs'),
'swiper/swiper-react$': join(swiperRoot, 'swiper-react.d.ts'),
'swiper/modules/index.mjs$': join(swiperRoot, 'modules/index.mjs'),
'swiper/swiper.css$': join(swiperRoot, 'swiper.css'),
'swiper/modules/zoom.css$': join(swiperRoot, 'modules/zoom.css'),
},
// This is only needed because of Fontello
// This is only needed because of Rocket.Chat's icon font.
roots: [...(config.resolve?.roots ?? []), resolve(__dirname, '../../../apps/meteor/public')],
};

Expand All @@ -54,15 +51,4 @@ export default {

return config;
},

framework: {
name: getAbsolutePath('@storybook/react-webpack5'),
options: {},
},

docs: {},
} satisfies StorybookConfig;

function getAbsolutePath(value: any): string {
return dirname(require.resolve(join(value, 'package.json')));
}
});
29 changes: 12 additions & 17 deletions apps/meteor/.storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
import type { Decorator, Parameters } from '@storybook/react';
import { parameters, decorators } from '@rocket.chat/storybook-config/preview';
import type { Preview } from '@storybook/react';

import { rocketChatDecorator } from './decorators';
import { RocketChatDecorator } from './decorators';

export const decorators: Decorator[] = [rocketChatDecorator];
import '../app/theme/client/main.css';
import 'highlight.js/styles/github.css';

export const parameters: Parameters = {
backgrounds: {
grid: {
cellSize: 4,
cellAmount: 4,
opacity: 0.5,
},
},
options: {
storySort: {
method: 'alphabetical',
order: ['Components', '*', 'Enterprise'],
},
const preview: Preview = {
parameters: {
...parameters,
},
decorators: [...decorators, RocketChatDecorator],
tags: ['autodocs'],
};
export const tags = ['autodocs'];

export default preview;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { mockAppRoot } from '@rocket.chat/mock-providers';
import { action } from '@storybook/addon-actions';
import type { Meta } from '@storybook/react';
import { action } from 'storybook/actions';

import ABACUpsellModal from './ABACUpsellModal';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Meta, StoryFn } from '@storybook/react';
import type { StoryObj, Meta } from '@storybook/react';

import CreateDiscussion from './CreateDiscussion';

Expand All @@ -13,4 +13,4 @@ export default {
},
} satisfies Meta<typeof CreateDiscussion>;

export const Default: StoryFn<typeof CreateDiscussion> = (args) => <CreateDiscussion {...args} />;
export const Default: StoryObj<typeof CreateDiscussion> = {};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { action } from '@storybook/addon-actions';
import type { Meta, StoryObj } from '@storybook/react';
import { action } from 'storybook/actions';

import GenericUpsellModal from '.';

Expand Down
80 changes: 44 additions & 36 deletions apps/meteor/client/components/ListItem.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Tile, OptionTitle, Box } from '@rocket.chat/fuselage';
import type { Meta, StoryFn } from '@storybook/react';
import type { StoryObj, Meta, StoryFn } from '@storybook/react';

import ListItem from './Sidebar/ListItem';

Expand Down Expand Up @@ -27,6 +27,7 @@ export const ListWithIcon: StoryFn<typeof Tile> = () => {
</Tile>
);
};

export const NoIcon: StoryFn<typeof Tile> = () => {
return (
<Tile elevation='2' p='0' display='flex' flexDirection='column' overflow='auto' w='x240'>
Expand All @@ -41,44 +42,51 @@ export const NoIcon: StoryFn<typeof Tile> = () => {
);
};

export const MixedWithGap: StoryFn<typeof Tile> = () => {
return (
<Tile elevation='2' p='0' display='flex' flexDirection='column' overflow='auto' w='x240'>
<Box flexShrink={1} pb={12}>
<OptionTitle>Title</OptionTitle>
<ListItem text='Item 1' icon='hashtag' />
<ListItem text='Item 2' icon='team' />
<ListItem text='Item 3' gap />
<ListItem text='Item 4' icon='airplane' />
</Box>
</Tile>
);
};
MixedWithGap.parameters = {
docs: {
description: {
story:
" When using `ListItem`, you can also use the `gap` prop to add spacing to the left. If the list is mixed with items **with and without** icons, it's recommended to add the gap.",
export const MixedWithGap: StoryObj<typeof Tile> = {
render: () => {
return (
<Tile elevation='2' p='0' display='flex' flexDirection='column' overflow='auto' w='x240'>
<Box flexShrink={1} pb={12}>
<OptionTitle>Title</OptionTitle>
<ListItem text='Item 1' icon='hashtag' />
<ListItem text='Item 2' icon='team' />
<ListItem text='Item 3' gap />
<ListItem text='Item 4' icon='airplane' />
</Box>
</Tile>
);
},

parameters: {
docs: {
description: {
story:
" When using `ListItem`, you can also use the `gap` prop to add spacing to the left. If the list is mixed with items **with and without** icons, it's recommended to add the gap.",
},
},
},
};
export const MixedWithoutGap: StoryFn<typeof Tile> = () => {
return (
<Tile elevation='2' p='0' display='flex' flexDirection='column' overflow='auto' w='x240'>
<Box flexShrink={1} pb={12}>
<OptionTitle>Title</OptionTitle>
<ListItem text='Item 1' icon='hashtag' />
<ListItem text='Item 2' icon='team' />
<ListItem text='Item 3' />
<ListItem text='Item 4' icon='airplane' />
</Box>
</Tile>
);
};
MixedWithoutGap.parameters = {
docs: {
description: {
story: 'Not recommended. Prefer adding the `gap` prop to the items without icons.',

export const MixedWithoutGap: StoryObj<typeof Tile> = {
render: () => {
return (
<Tile elevation='2' p='0' display='flex' flexDirection='column' overflow='auto' w='x240'>
<Box flexShrink={1} pb={12}>
<OptionTitle>Title</OptionTitle>
<ListItem text='Item 1' icon='hashtag' />
<ListItem text='Item 2' icon='team' />
<ListItem text='Item 3' />
<ListItem text='Item 4' icon='airplane' />
</Box>
</Tile>
);
},

parameters: {
docs: {
description: {
story: 'Not recommended. Prefer adding the `gap` prop to the items without icons.',
},
},
},
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { action } from '@storybook/addon-actions';
import type { Meta, StoryFn } from '@storybook/react';
import { action } from 'storybook/actions';

import SidebarTogglerButton from './SidebarTogglerButton';

Expand All @@ -13,11 +13,10 @@ export default {
} satisfies Meta<typeof SidebarTogglerButton>;

export const Example: StoryFn<typeof SidebarTogglerButton> = () => <SidebarTogglerButton onClick={action('onClick')} />;
export const Default = {};

const Template: StoryFn<typeof SidebarTogglerButton> = (args) => <SidebarTogglerButton {...args} />;

export const Default = Template.bind({});
export const WithBadge = Template.bind({});
WithBadge.args = {
badge: 99,
export const WithBadge = {
args: {
badge: 99,
},
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { action } from '@storybook/addon-actions';
import type { Meta } from '@storybook/react';
import { action } from 'storybook/actions';

import UserAvatarChip from './UserAvatarChip';

Expand Down
Loading
Loading