Skip to content

Commit

Permalink
Merge branch 'main' into fix#1361
Browse files Browse the repository at this point in the history
  • Loading branch information
devanshkansagra authored Sep 7, 2024
2 parents dfd30e1 + d89bf92 commit 8391ecb
Show file tree
Hide file tree
Showing 62 changed files with 2,109 additions and 8 deletions.
5 changes: 0 additions & 5 deletions .changeset/sweet-sheep-film.md

This file was deleted.

8 changes: 8 additions & 0 deletions packages/fuselage/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Change Log

## 0.59.0

### Minor Changes

- [#1358](https://github.com/RocketChat/fuselage/pull/1358) [`60345fa9`](https://github.com/RocketChat/fuselage/commit/60345fa971da63da19b3ebad3a638b5bb27cc3cc) Thanks [@juliajforesti](https://github.com/juliajforesti)! - feat(fuselage): `Sidebar` and `Sidepanel` components

- [#1442](https://github.com/RocketChat/fuselage/pull/1442) [`1087ee86`](https://github.com/RocketChat/fuselage/commit/1087ee861138836699059e54aacdfeac60ef0eb6) Thanks [@rique223](https://github.com/rique223)! - feat(fuselage): update `InputBox` and `Field` typography

## 0.57.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/fuselage/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rocket.chat/fuselage",
"version": "0.58.2",
"version": "0.59.0",
"description": "Rocket.Chat's React Components Library",
"author": {
"name": "Rocket.Chat",
Expand Down
19 changes: 19 additions & 0 deletions packages/fuselage/src/components/SidebarV2/Sidebar.spec.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { composeStories } from '@storybook/react';
import { axe } from 'jest-axe';

import { render } from '../../testing';
import * as stories from './Sidebar.stories';

const { Default } = composeStories(stories);

describe('[Sidebar Default story]', () => {
it('renders without crashing', () => {
render(<Default />);
});
it('should have no a11y violations', async () => {
const { container } = render(<Default />);

const results = await axe(container);
expect(results).toHaveNoViolations();
});
});
184 changes: 184 additions & 0 deletions packages/fuselage/src/components/SidebarV2/Sidebar.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
import { action } from '@storybook/addon-actions';
import type { Meta, StoryFn } from '@storybook/react';

import {
SidebarV2 as Sidebar,
SidebarV2Accordion as SidebarAccordion,
SidebarV2AccordionItem as SidebarAccordionItem,
SidebarV2Banner as SidebarBanner,
SidebarV2CollapseGroup as SidebarCollapseGroup,
SidebarV2FooterContent as SidebarFooterContent,
SidebarV2ItemAction as SidebarItemAction,
SidebarV2Link as SidebarLink,
SidebarV2ItemBadge as SidebarItemBadge,
SidebarV2Media as SidebarMedia,
SidebarV2MediaTitle as SidebarMediaTitle,
SidebarV2MediaController as SidebarMediaController,
SidebarV2ListItem as SidebarListItem,
SidebarV2Section as SidebarSection,
SidebarV2Footer as SidebarFooter,
} from '.';
import { IconButton, TextInput, Icon, Box } from '../..';
import { Condensed } from './SidebarItem/SidebarItem.stories';
import { GenericNoAvatarItem, MenuTemplate } from './helpers';

export default {
title: 'Navigation/SidebarV2',
component: Sidebar,
} as Meta<typeof Sidebar>;

export const Default: StoryFn<typeof Sidebar> = (props) => (
<Box h='90vh' w='x280'>
<Sidebar {...props}>
<SidebarBanner
title='You’ve reached the limit active contacts this month'
linkText='Learn more'
linkProps={{ href: '#' }}
onClick={action('click')}
addon={<Icon name='warning' color='danger' size='x24' />}
/>
<SidebarSection>
<TextInput
addon={<Icon name='magnifier' size='x20' />}
small
placeholder='Search'
/>
<IconButton icon='sort' title='Sort' medium />
</SidebarSection>
<SidebarAccordion>
<SidebarAccordionItem
title='Omnichannel'
badge={
<SidebarItemBadge
title='25 unred messages'
children={25}
variant='primary'
/>
}
defaultExpanded
>
<SidebarLink
icon='arrow-down-box'
href='#'
selected
badge={
<SidebarItemBadge
title='12 unread messages'
children={12}
variant='primary'
/>
}
menu={<MenuTemplate />}
>
All
</SidebarLink>
<SidebarLink
icon='user'
href='#'
badge={
<SidebarItemBadge title='10 unread messages' children={10} />
}
menu={<MenuTemplate />}
>
Assigned to me
</SidebarLink>
<SidebarLink
icon='queue'
href='#'
badge={
<SidebarItemBadge
title='3 unread messages'
children={3}
variant='danger'
/>
}
menu={<MenuTemplate />}
>
Unassigned
</SidebarLink>
<SidebarLink icon='pause' href='#' menu={<MenuTemplate />}>
On hold
</SidebarLink>
</SidebarAccordionItem>
<SidebarAccordionItem
title='Team chat'
defaultExpanded={true}
badge={
<SidebarItemBadge
title='99+ unread messages'
children='99+'
variant='danger'
/>
}
>
<SidebarCollapseGroup
title='Favorites'
defaultExpanded
badge={
<SidebarItemBadge
title='99+ unread messages'
children='99+'
variant='danger'
/>
}
>
{Array.from({ length: 4 }).map((_, i) => (
<GenericNoAvatarItem key={i} i={i} />
))}
</SidebarCollapseGroup>
<SidebarCollapseGroup
title='Teams'
defaultExpanded
badge={
<SidebarItemBadge
title='99+ unread messages'
children='99+'
variant='danger'
/>
}
>
<Condensed />
<SidebarListItem>
<SidebarItemAction onClick={action('add team')}>
Add team
</SidebarItemAction>
</SidebarListItem>
</SidebarCollapseGroup>
<SidebarCollapseGroup
title='Discussions'
defaultExpanded
badge={
<SidebarItemBadge
title='99+ unread messages'
children='99+'
variant='danger'
/>
}
>
<Condensed />
<SidebarListItem>
<SidebarItemAction onClick={action('add team')}>
Add discussion
</SidebarItemAction>
</SidebarListItem>
</SidebarCollapseGroup>
</SidebarAccordionItem>
</SidebarAccordion>
<SidebarMedia>
<SidebarMediaTitle>3 calls in queue</SidebarMediaTitle>
<SidebarMediaController label='Call'>
<IconButton icon='user-arrow-right' small aria-label='user-forward' />
<IconButton icon='mic' small aria-label='mic' />
<IconButton icon='pause-unfilled' small aria-label='pause' />
</SidebarMediaController>
{/* <GenericCallItem is='div' /> */}
</SidebarMedia>
<SidebarFooter>
<SidebarFooterContent>Powered by Rocket.Chat</SidebarFooterContent>
<SidebarFooterContent color='titles-labels'>
Free edition
</SidebarFooterContent>
</SidebarFooter>
</Sidebar>
</Box>
);
Loading

0 comments on commit 8391ecb

Please sign in to comment.