From 4a1b748faac706ea02e29b9f5d875b6776b5001e Mon Sep 17 00:00:00 2001 From: kostasdano Date: Mon, 15 Jul 2024 20:10:09 +0300 Subject: [PATCH] feat: sorting order --- .../Table/Table/Basics-BasicExample.snap | 9 ++-- .../Table/Table/Columns-ColumnChooser.snap | 9 ++-- .../Table/Table/Columns-ColumnWidth.snap | 18 ++++--- .../Table/Table/Columns-Sorting.snap | 29 +++++++---- .../Table/Table/Header-StickyHeader.snap | 9 ++-- .../Table/Table/Pagination-Pagination.snap | 9 ++-- .../Rows and Cells-CellContentAlignment.snap | 9 ++-- .../Table/Rows and Cells-RowDetails.snap | 18 ++++--- .../Table/Rows and Cells-RowSelection.snap | 18 ++++--- .../Table/Table/Rows and Cells-RowSizes.snap | 9 ++-- .../Table/Table/Showcase-Playground.snap | 9 ++-- src/components/Table/Table.tsx | 12 ++++- .../Table/components/TH/TH.style.ts | 14 +++--- src/components/Table/components/TH/TH.tsx | 23 ++++----- .../SortingButton/SortingButton.style.ts | 17 +++++++ .../SortingButton/SortingButton.tsx | 48 +++++++++++++++++++ .../TH/components/SortingButton/index.ts | 1 + src/components/Table/constants.tsx | 27 +++++++++++ .../Table/docs/Columns/Columns.stories.tsx | 16 +++++-- 19 files changed, 229 insertions(+), 75 deletions(-) create mode 100644 src/components/Table/components/TH/components/SortingButton/SortingButton.style.ts create mode 100644 src/components/Table/components/TH/components/SortingButton/SortingButton.tsx create mode 100644 src/components/Table/components/TH/components/SortingButton/index.ts diff --git a/src/__storyshots__/Updated Components/Table/Table/Basics-BasicExample.snap b/src/__storyshots__/Updated Components/Table/Table/Basics-BasicExample.snap index 3cdc5b656..7074c2147 100644 --- a/src/__storyshots__/Updated Components/Table/Table/Basics-BasicExample.snap +++ b/src/__storyshots__/Updated Components/Table/Table/Basics-BasicExample.snap @@ -41,12 +41,15 @@ letter-spacing: 0.015625rem; } -.emotion-4 [data-header-role='options'] button { +.emotion-4 [data-header-role='options'], +.emotion-4 [data-header-role='sorting-button'] { opacity: 0; } -.emotion-4:hover [data-header-role='options'] button, -.emotion-4:focus-visible [data-header-role='options'] button { +.emotion-4:hover [data-header-role='options'], +.emotion-4:focus-visible [data-header-role='options'], +.emotion-4:hover [data-header-role='sorting-button'], +.emotion-4:focus-visible [data-header-role='sorting-button'] { opacity: 1; } diff --git a/src/__storyshots__/Updated Components/Table/Table/Columns-ColumnChooser.snap b/src/__storyshots__/Updated Components/Table/Table/Columns-ColumnChooser.snap index 8d90a13e6..04e2bfade 100644 --- a/src/__storyshots__/Updated Components/Table/Table/Columns-ColumnChooser.snap +++ b/src/__storyshots__/Updated Components/Table/Table/Columns-ColumnChooser.snap @@ -145,12 +145,15 @@ letter-spacing: 0.015625rem; } -.emotion-10 [data-header-role='options'] button { +.emotion-10 [data-header-role='options'], +.emotion-10 [data-header-role='sorting-button'] { opacity: 0; } -.emotion-10:hover [data-header-role='options'] button, -.emotion-10:focus-visible [data-header-role='options'] button { +.emotion-10:hover [data-header-role='options'], +.emotion-10:focus-visible [data-header-role='options'], +.emotion-10:hover [data-header-role='sorting-button'], +.emotion-10:focus-visible [data-header-role='sorting-button'] { opacity: 1; } diff --git a/src/__storyshots__/Updated Components/Table/Table/Columns-ColumnWidth.snap b/src/__storyshots__/Updated Components/Table/Table/Columns-ColumnWidth.snap index f4b28e739..2eb326050 100644 --- a/src/__storyshots__/Updated Components/Table/Table/Columns-ColumnWidth.snap +++ b/src/__storyshots__/Updated Components/Table/Table/Columns-ColumnWidth.snap @@ -41,12 +41,15 @@ letter-spacing: 0.015625rem; } -.emotion-4 [data-header-role='options'] button { +.emotion-4 [data-header-role='options'], +.emotion-4 [data-header-role='sorting-button'] { opacity: 0; } -.emotion-4:hover [data-header-role='options'] button, -.emotion-4:focus-visible [data-header-role='options'] button { +.emotion-4:hover [data-header-role='options'], +.emotion-4:focus-visible [data-header-role='options'], +.emotion-4:hover [data-header-role='sorting-button'], +.emotion-4:focus-visible [data-header-role='sorting-button'] { opacity: 1; } @@ -93,12 +96,15 @@ letter-spacing: 0.015625rem; } -.emotion-10 [data-header-role='options'] button { +.emotion-10 [data-header-role='options'], +.emotion-10 [data-header-role='sorting-button'] { opacity: 0; } -.emotion-10:hover [data-header-role='options'] button, -.emotion-10:focus-visible [data-header-role='options'] button { +.emotion-10:hover [data-header-role='options'], +.emotion-10:focus-visible [data-header-role='options'], +.emotion-10:hover [data-header-role='sorting-button'], +.emotion-10:focus-visible [data-header-role='sorting-button'] { opacity: 1; } diff --git a/src/__storyshots__/Updated Components/Table/Table/Columns-Sorting.snap b/src/__storyshots__/Updated Components/Table/Table/Columns-Sorting.snap index db955397e..40e6d0e2d 100644 --- a/src/__storyshots__/Updated Components/Table/Table/Columns-Sorting.snap +++ b/src/__storyshots__/Updated Components/Table/Table/Columns-Sorting.snap @@ -41,7 +41,8 @@ letter-spacing: 0.015625rem; } -.emotion-4 [data-header-role='options'] button { +.emotion-4 [data-header-role='options'], +.emotion-4 [data-header-role='sorting-button'] { opacity: 0; } @@ -55,8 +56,10 @@ letter-spacing: 0.015625rem; } -.emotion-4:hover [data-header-role='options'] button, -.emotion-4:focus-visible [data-header-role='options'] button { +.emotion-4:hover [data-header-role='options'], +.emotion-4:focus-visible [data-header-role='options'], +.emotion-4:hover [data-header-role='sorting-button'], +.emotion-4:focus-visible [data-header-role='sorting-button'] { opacity: 1; } @@ -187,12 +190,15 @@ letter-spacing: 0.015625rem; } -.emotion-16 [data-header-role='options'] button { +.emotion-16 [data-header-role='options'], +.emotion-16 [data-header-role='sorting-button'] { opacity: 0; } -.emotion-16:hover [data-header-role='options'] button, -.emotion-16:focus-visible [data-header-role='options'] button { +.emotion-16:hover [data-header-role='options'], +.emotion-16:focus-visible [data-header-role='options'], +.emotion-16:hover [data-header-role='sorting-button'], +.emotion-16:focus-visible [data-header-role='sorting-button'] { opacity: 1; } @@ -216,7 +222,8 @@ letter-spacing: 0.015625rem; } -.emotion-19 [data-header-role='options'] button { +.emotion-19 [data-header-role='options'], +.emotion-19 [data-header-role='sorting-button'] { opacity: 1; } @@ -230,8 +237,10 @@ letter-spacing: 0.015625rem; } -.emotion-19:hover [data-header-role='options'] button, -.emotion-19:focus-visible [data-header-role='options'] button { +.emotion-19:hover [data-header-role='options'], +.emotion-19:focus-visible [data-header-role='options'], +.emotion-19:hover [data-header-role='sorting-button'], +.emotion-19:focus-visible [data-header-role='sorting-button'] { opacity: 1; } @@ -358,6 +367,7 @@ >