From b7426abf88427a92b17dce9920ecbb51d8b30021 Mon Sep 17 00:00:00 2001 From: juliajforesti Date: Thu, 5 Sep 2024 21:15:18 +0100 Subject: [PATCH] chore: rename `Sidebar` exports --- .../components/SidebarV2/Sidebar.stories.tsx | 32 +-- .../SidebarV2/SidebarFooter/index.ts | 4 +- .../SidebarItem/SidebarItem.stories.tsx | 4 +- .../components/SidebarV2/SidebarItem/index.ts | 26 +-- .../SidebarMedia/SidebarMedia.stories.tsx | 10 +- .../SidebarV2/SidebarMedia/index.ts | 6 +- .../src/components/SidebarV2/helpers.tsx | 196 +++++++++--------- .../src/components/SidebarV2/index.tsx | 24 +-- 8 files changed, 153 insertions(+), 149 deletions(-) diff --git a/packages/fuselage/src/components/SidebarV2/Sidebar.stories.tsx b/packages/fuselage/src/components/SidebarV2/Sidebar.stories.tsx index 8c5ce9d391..dbbf2fae31 100644 --- a/packages/fuselage/src/components/SidebarV2/Sidebar.stories.tsx +++ b/packages/fuselage/src/components/SidebarV2/Sidebar.stories.tsx @@ -2,28 +2,28 @@ import { action } from '@storybook/addon-actions'; import type { Meta, StoryFn } from '@storybook/react'; import { - Sidebar, - SidebarAccordion, - SidebarAccordionItem, - SidebarBanner, - SidebarCollapseGroup, - SidebarFooterContent, - SidebarItemAction, - SidebarLink, - SidebarItemBadge, - SidebarMedia, - SidebarMediaTitle, - SidebarMediaController, - SidebarListItem, - SidebarSection, - SidebarFooter, + 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/Sidebar', + title: 'Navigation/SidebarV2', component: Sidebar, } as Meta; diff --git a/packages/fuselage/src/components/SidebarV2/SidebarFooter/index.ts b/packages/fuselage/src/components/SidebarV2/SidebarFooter/index.ts index 1002172e9a..82e4cd2340 100644 --- a/packages/fuselage/src/components/SidebarV2/SidebarFooter/index.ts +++ b/packages/fuselage/src/components/SidebarV2/SidebarFooter/index.ts @@ -1,2 +1,2 @@ -export * as SidebarV2Footer from './SidebarFooter'; -export * as SidebarV2FooterContent from './SidebarFooterContent'; +export { SidebarFooter as SidebarV2Footer } from './SidebarFooter'; +export { SidebarFooterContent as SidebarV2FooterContent } from './SidebarFooterContent'; diff --git a/packages/fuselage/src/components/SidebarV2/SidebarItem/SidebarItem.stories.tsx b/packages/fuselage/src/components/SidebarV2/SidebarItem/SidebarItem.stories.tsx index 67a073a41b..94daab81dc 100644 --- a/packages/fuselage/src/components/SidebarV2/SidebarItem/SidebarItem.stories.tsx +++ b/packages/fuselage/src/components/SidebarV2/SidebarItem/SidebarItem.stories.tsx @@ -1,6 +1,6 @@ import type { Meta, StoryFn } from '@storybook/react'; -import { SidebarListItem } from '../..'; +import { SidebarV2ListItem as SidebarListItem } from '../..'; import { GenericCondensedItem, GenericExtendedItem, @@ -9,7 +9,7 @@ import { } from '../helpers'; export default { - title: 'Navigation/Sidebar/Item', + title: 'Navigation/SidebarV2/Item', component: SidebarListItem, decorators, } satisfies Meta; diff --git a/packages/fuselage/src/components/SidebarV2/SidebarItem/index.ts b/packages/fuselage/src/components/SidebarV2/SidebarItem/index.ts index 271b7933db..632f198f25 100644 --- a/packages/fuselage/src/components/SidebarV2/SidebarItem/index.ts +++ b/packages/fuselage/src/components/SidebarV2/SidebarItem/index.ts @@ -1,13 +1,13 @@ -export * as SidebarV2Item from './SidebarItem'; -export * as SidebarV2ItemAction from './SidebarItemAction'; -export * as SidebarV2ItemAvatarWrapper from './SidebarItemAvatarWrapper'; -export * as SidebarV2ItemBadge from './SidebarItemBadge'; -export * as SidebarV2ItemIcon from './SidebarItemIcon'; -export * as SidebarV2ItemMenu from './SidebarItemMenu'; -export * as SidebarV2ItemTitle from './SidebarItemTitle'; -export * as SidebarV2ItemRow from './SidebarItemRow'; -export * as SidebarV2ItemCol from './SidebarItemCol'; -export * as SidebarV2ItemTimestamp from './SidebarItemTimestamp'; -export * as SidebarV2ListItem from './SidebarListItem'; -export * as SidebarV2ItemContent from './SidebarItemContent'; -export * as SidebarV2ItemStatusBullet from './SidebarItemStatusBullet'; +export { SidebarItem as SidebarV2Item } from './SidebarItem'; +export { SidebarItemAction as SidebarV2ItemAction } from './SidebarItemAction'; +export { SidebarItemAvatarWrapper as SidebarV2ItemAvatarWrapper } from './SidebarItemAvatarWrapper'; +export { SidebarItemBadge as SidebarV2ItemBadge } from './SidebarItemBadge'; +export { SidebarItemIcon as SidebarV2ItemIcon } from './SidebarItemIcon'; +export { SidebarItemMenu as SidebarV2ItemMenu } from './SidebarItemMenu'; +export { SidebarItemTitle as SidebarV2ItemTitle } from './SidebarItemTitle'; +export { SidebarItemRow as SidebarV2ItemRow } from './SidebarItemRow'; +export { SidebarItemCol as SidebarV2ItemCol } from './SidebarItemCol'; +export { SidebarItemTimestamp as SidebarV2ItemTimestamp } from './SidebarItemTimestamp'; +export { SidebarListItem as SidebarV2ListItem } from './SidebarListItem'; +export { SidebarItemContent as SidebarV2ItemContent } from './SidebarItemContent'; +export { SidebarItemStatusBullet as SidebarV2ItemStatusBullet } from './SidebarItemStatusBullet'; diff --git a/packages/fuselage/src/components/SidebarV2/SidebarMedia/SidebarMedia.stories.tsx b/packages/fuselage/src/components/SidebarV2/SidebarMedia/SidebarMedia.stories.tsx index 830c8ec26d..1984e42af7 100644 --- a/packages/fuselage/src/components/SidebarV2/SidebarMedia/SidebarMedia.stories.tsx +++ b/packages/fuselage/src/components/SidebarV2/SidebarMedia/SidebarMedia.stories.tsx @@ -1,17 +1,17 @@ import type { StoryFn, Meta } from '@storybook/react'; import { - Sidebar, - SidebarMedia, - SidebarMediaTitle, - SidebarMediaController, + SidebarV2 as Sidebar, + SidebarV2Media as SidebarMedia, + SidebarV2MediaTitle as SidebarMediaTitle, + SidebarV2MediaController as SidebarMediaController, Box, IconButton, } from '../..'; import { GenericCallItem } from '../helpers'; export default { - title: 'Navigation/Sidebar/Media', + title: 'Navigation/SidebarV2/Media', component: Sidebar, } satisfies Meta; diff --git a/packages/fuselage/src/components/SidebarV2/SidebarMedia/index.ts b/packages/fuselage/src/components/SidebarV2/SidebarMedia/index.ts index 507828298a..3f5ae5e073 100644 --- a/packages/fuselage/src/components/SidebarV2/SidebarMedia/index.ts +++ b/packages/fuselage/src/components/SidebarV2/SidebarMedia/index.ts @@ -1,3 +1,3 @@ -export * as SidebarV2Media from './SidebarMedia'; -export * as SidebarV2MediaController from './SidebarMediaController'; -export * as SidebarV2MediaTitle from './SidebarMediaTitle'; +export { SidebarMedia as SidebarV2Media } from './SidebarMedia'; +export { SidebarMediaController as SidebarV2MediaController } from './SidebarMediaController'; +export { SidebarMediaTitle as SidebarV2MediaTitle } from './SidebarMediaTitle'; diff --git a/packages/fuselage/src/components/SidebarV2/helpers.tsx b/packages/fuselage/src/components/SidebarV2/helpers.tsx index 3f2e45218d..da1643a36a 100644 --- a/packages/fuselage/src/components/SidebarV2/helpers.tsx +++ b/packages/fuselage/src/components/SidebarV2/helpers.tsx @@ -2,26 +2,26 @@ import type { Decorator } from '@storybook/react'; import type { ComponentProps, ReactElement } from 'react'; import { - Sidebar, - SidebarAccordion, - SidebarAccordionItem, - SidebarActions, - SidebarButtonGroup, - SidebarCollapseGroup, - SidebarFooter, - SidebarFooterContent, - SidebarItem, - SidebarItemAvatarWrapper, - SidebarItemBadge, - SidebarItemCol, - SidebarItemContent, - SidebarItemIcon, - SidebarItemMenu, - SidebarItemRow, - SidebarItemStatusBullet, - SidebarItemTimestamp, - SidebarItemTitle, - SidebarListItem, + SidebarV2, + SidebarV2Accordion, + SidebarV2AccordionItem, + SidebarV2Actions, + SidebarV2ButtonGroup, + SidebarV2CollapseGroup, + SidebarV2Footer, + SidebarV2FooterContent, + SidebarV2Item, + SidebarV2ItemAvatarWrapper, + SidebarV2ItemBadge, + SidebarV2ItemCol, + SidebarV2ItemContent, + SidebarV2ItemIcon, + SidebarV2ItemMenu, + SidebarV2ItemRow, + SidebarV2ItemStatusBullet, + SidebarV2ItemTimestamp, + SidebarV2ItemTitle, + SidebarV2ListItem, } from '.'; import { Avatar, Box, IconButton, MenuV2 as Menu, MenuItem } from '../..'; @@ -54,21 +54,23 @@ export const MenuTemplate = () => ( ); export const GenericCondensedItem = ({ i = 0 }: { i: number }) => ( - - - + + + - - - {names[i % 10]} + + + + {names[i % 10]} + {i % 2 !== 0 && ( - )} {i === 0 && ( - + ( danger icon='phone-off' /> - + )} - } /> - - + } /> + + ); export const GenericNoAvatarItem = ({ i = 0 }: { i: number }) => ( - - - - {names[i % 10]} - + + + {names[i % 10]} + - } /> - - + } /> + + ); export const GenericMediumItem = ({ i = 0 }: { i: number }) => ( - - - + + + - - - {names[i % 10]} - + + {names[i % 10]} + - } /> - - + } /> + + ); export const GenericExtendedItem = ({ i = 0 }: { i: number }) => ( - - - + + + - + - - - - {names[i % 10]} - 12:00 - + + + + {names[i % 10]} + 12:00 + - - No messages yet - + No messages yet + - } /> - - - - + } /> + + + + ); export const GenericCallItem = ({ i = 0, ...props -}: { i?: number } & ComponentProps) => ( - - +}: { i?: number } & ComponentProps) => ( + + - + - - {names[i % 10]} - Calling - + + {names[i % 10]} + Calling + - - + + - - - + + + ); export const decorators: Decorator[] = [ (fn): ReactElement => ( - - - + + } + badge={} > - } + badge={} > {fn()} - - - - - Powered by Rocket.Chat - + + + + + + Powered by Rocket.Chat + + Free edition - - - + + + ), ]; diff --git a/packages/fuselage/src/components/SidebarV2/index.tsx b/packages/fuselage/src/components/SidebarV2/index.tsx index 9b84dc0218..38fd316df7 100644 --- a/packages/fuselage/src/components/SidebarV2/index.tsx +++ b/packages/fuselage/src/components/SidebarV2/index.tsx @@ -1,15 +1,15 @@ -export * as SidebarV2 from './Sidebar'; -export * as SidebarV2Accordion from './SidebarAccordion'; -export * as SidebarV2AccordionItem from './SidebarAccordionItem'; -export * as SidebarV2Action from './SidebarAction'; -export * as SidebarV2Actions from './SidebarActions'; -export * as SidebarV2Link from './SidebarLink'; +export { Sidebar as SidebarV2 } from './Sidebar'; +export { SidebarAccordion as SidebarV2Accordion } from './SidebarAccordion'; +export { SidebarAccordionItem as SidebarV2AccordionItem } from './SidebarAccordionItem'; +export { SidebarAction as SidebarV2Action } from './SidebarAction'; +export { SidebarActions as SidebarV2Actions } from './SidebarActions'; +export { SidebarLink as SidebarV2Link } from './SidebarLink'; export * from './SidebarItem'; -export * as SidebarV2CollapseGroup from './SidebarCollapseGroup'; -export * as SidebarV2Banner from './SidebarBanner'; +export { SidebarCollapseGroup as SidebarV2CollapseGroup } from './SidebarCollapseGroup'; +export { SidebarBanner as SidebarV2Banner } from './SidebarBanner'; export * from './SidebarFooter'; export * from './SidebarMedia'; -export * as SidebarV2ButtonGroup from './SidebarButtonGroup'; -export * as SidebarV2Section from './SidebarSection'; -export * as SidebarV2Divider from './SidebarDivider'; -export * as SidebarV2GroupTitle from './SidebarGroupTitle'; +export { SidebarButtonGroup as SidebarV2ButtonGroup } from './SidebarButtonGroup'; +export { SidebarSection as SidebarV2Section } from './SidebarSection'; +export { SidebarDivider as SidebarV2Divider } from './SidebarDivider'; +export { SidebarGroupTitle as SidebarV2GroupTitle } from './SidebarGroupTitle';