From b58f458d49974571e9343f3dce8fd42a27412739 Mon Sep 17 00:00:00 2001 From: dougfabris Date: Wed, 17 Jul 2024 10:07:29 -0300 Subject: [PATCH 1/4] feat: apply visual changes --- .../fuselage/src/components/Table/Table.stories.tsx | 12 ++++++++---- .../fuselage/src/components/Table/Table.styles.scss | 6 +++--- packages/fuselage/src/components/Table/Table.tsx | 8 +------- .../Table/{ => TableSelection}/TableSelection.tsx | 10 +++++----- .../{ => TableSelection}/TableSelectionButton.tsx | 6 +++--- .../TableSelection/TableSelectionButtonGroup.tsx | 8 ++++++++ .../src/components/Table/TableSelection/index.ts | 3 +++ packages/fuselage/src/components/Table/index.ts | 1 - 8 files changed, 31 insertions(+), 23 deletions(-) rename packages/fuselage/src/components/Table/{ => TableSelection}/TableSelection.tsx (78%) rename packages/fuselage/src/components/Table/{ => TableSelection}/TableSelectionButton.tsx (64%) create mode 100644 packages/fuselage/src/components/Table/TableSelection/TableSelectionButtonGroup.tsx create mode 100644 packages/fuselage/src/components/Table/TableSelection/index.ts diff --git a/packages/fuselage/src/components/Table/Table.stories.tsx b/packages/fuselage/src/components/Table/Table.stories.tsx index b38bea9fdd..acd5134ab6 100644 --- a/packages/fuselage/src/components/Table/Table.stories.tsx +++ b/packages/fuselage/src/components/Table/Table.stories.tsx @@ -17,6 +17,7 @@ import { TableRow, TableCell, TableBody, + TableSelectionButtonGroup, } from './index'; export default { @@ -73,11 +74,8 @@ export const Default: ComponentStory = () => ( ); -export const Selected: ComponentStory = () => ( +export const WithSelection: ComponentStory = () => ( <> - - Delete - @@ -154,6 +152,12 @@ export const Selected: ComponentStory = () => (
+ + + Delete + Cancel + + ); diff --git a/packages/fuselage/src/components/Table/Table.styles.scss b/packages/fuselage/src/components/Table/Table.styles.scss index cefdd7a364..38134b1b8f 100644 --- a/packages/fuselage/src/components/Table/Table.styles.scss +++ b/packages/fuselage/src/components/Table/Table.styles.scss @@ -16,12 +16,12 @@ } &__selection { - color: colors.status-font(on-info); + color: colors.font(titles-labels); border-radius: theme( 'table-selected-border-radius', - lengths.border-radius(small) + lengths.border-radius(medium) ); - background-color: colors.status-background(info); + background-color: colors.surface(neutral); } &__wrapper { diff --git a/packages/fuselage/src/components/Table/Table.tsx b/packages/fuselage/src/components/Table/Table.tsx index 11890d28f5..83564b91e8 100644 --- a/packages/fuselage/src/components/Table/Table.tsx +++ b/packages/fuselage/src/components/Table/Table.tsx @@ -1,14 +1,8 @@ -import type { ComponentProps, CSSProperties } from 'react'; +import type { ComponentProps } from 'react'; import React from 'react'; import Box from '../Box'; -export const style: CSSProperties = { - overflow: 'hidden', - textOverflow: 'ellipsis', - whiteSpace: 'nowrap', -}; - export type TableProps = ComponentProps & { striped?: boolean; sticky?: boolean; diff --git a/packages/fuselage/src/components/Table/TableSelection.tsx b/packages/fuselage/src/components/Table/TableSelection/TableSelection.tsx similarity index 78% rename from packages/fuselage/src/components/Table/TableSelection.tsx rename to packages/fuselage/src/components/Table/TableSelection/TableSelection.tsx index 365008bd4b..19ad95198c 100644 --- a/packages/fuselage/src/components/Table/TableSelection.tsx +++ b/packages/fuselage/src/components/Table/TableSelection/TableSelection.tsx @@ -1,9 +1,8 @@ import type { ComponentProps } from 'react'; import React from 'react'; -import Box from '../Box'; -import Margins from '../Margins'; -import { style } from './Table'; +import Box from '../../Box'; +import Margins from '../../Margins'; type TableSelectionProps = ComponentProps & { text?: string; @@ -19,10 +18,11 @@ export const TableSelection = ({ display='flex' alignItems='center' justifyContent='space-between' - {...props} pi={24} + elevation='2' + {...props} > - + {text} {children && ( diff --git a/packages/fuselage/src/components/Table/TableSelectionButton.tsx b/packages/fuselage/src/components/Table/TableSelection/TableSelectionButton.tsx similarity index 64% rename from packages/fuselage/src/components/Table/TableSelectionButton.tsx rename to packages/fuselage/src/components/Table/TableSelection/TableSelectionButton.tsx index 15183e8138..9661f41301 100644 --- a/packages/fuselage/src/components/Table/TableSelectionButton.tsx +++ b/packages/fuselage/src/components/Table/TableSelection/TableSelectionButton.tsx @@ -1,11 +1,11 @@ import type { ComponentProps } from 'react'; import React from 'react'; -import type Box from '../Box'; -import { Button } from '../Button'; +import type Box from '../../Box'; +import { Button } from '../../Button'; type TableSelectionButtonProps = ComponentProps; export const TableSelectionButton = (props: TableSelectionButtonProps) => ( - + + + + + + +`; From 85992c73bdd50577bdfe55877a8d794c1e02da1b Mon Sep 17 00:00:00 2001 From: dougfabris Date: Wed, 17 Jul 2024 10:09:30 -0300 Subject: [PATCH 3/4] chore: changeset --- .changeset/clever-candles-shop.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/clever-candles-shop.md diff --git a/.changeset/clever-candles-shop.md b/.changeset/clever-candles-shop.md new file mode 100644 index 0000000000..8dfba14c6e --- /dev/null +++ b/.changeset/clever-candles-shop.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/fuselage": minor +--- + +feat(fuselage): TableSelection visual improvements From 2d166035e2c8b5ea259e72b2723d92820248e093 Mon Sep 17 00:00:00 2001 From: dougfabris Date: Wed, 17 Jul 2024 10:35:13 -0300 Subject: [PATCH 4/4] fix: types --- .../components/Table/TableSelection/TableSelectionButton.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/fuselage/src/components/Table/TableSelection/TableSelectionButton.tsx b/packages/fuselage/src/components/Table/TableSelection/TableSelectionButton.tsx index 9661f41301..f449a53cd8 100644 --- a/packages/fuselage/src/components/Table/TableSelection/TableSelectionButton.tsx +++ b/packages/fuselage/src/components/Table/TableSelection/TableSelectionButton.tsx @@ -1,10 +1,9 @@ import type { ComponentProps } from 'react'; import React from 'react'; -import type Box from '../../Box'; import { Button } from '../../Button'; -type TableSelectionButtonProps = ComponentProps; +type TableSelectionButtonProps = ComponentProps; export const TableSelectionButton = (props: TableSelectionButtonProps) => (