From df36dd84318be86194545c0e4a0c25c4a3ae88be Mon Sep 17 00:00:00 2001 From: kyledurand Date: Thu, 16 Nov 2023 17:43:34 -0500 Subject: [PATCH 1/3] chore: update stories --- .../IndexTable/IndexTable.stories.tsx | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/polaris-react/src/components/IndexTable/IndexTable.stories.tsx b/polaris-react/src/components/IndexTable/IndexTable.stories.tsx index fe4832a8288..98757bb2f4d 100644 --- a/polaris-react/src/components/IndexTable/IndexTable.stories.tsx +++ b/polaris-react/src/components/IndexTable/IndexTable.stories.tsx @@ -6,6 +6,7 @@ import type { IndexTableRowProps, } from '@shopify/polaris'; import { + useBreakpoints, InlineStack, LegacyCard, EmptySearchResult, @@ -107,6 +108,7 @@ export function Default() { return ( Date: Tue, 21 Nov 2023 10:28:45 -0500 Subject: [PATCH 2/3] chore: update IndexTable documentation for when to hide bulk actions --- .changeset/calm-colts-melt.md | 6 ++++++ .../content/components/tables/index-table.mdx | 2 ++ .../pages/examples/index-table-default.tsx | 2 ++ ...able-with-bulk-actions-and-selection-across-pages.tsx | 2 ++ .../pages/examples/index-table-with-bulk-actions.tsx | 2 ++ .../pages/examples/index-table-with-disabled-rows.tsx | 2 ++ .../pages/examples/index-table-with-empty-state.tsx | 2 ++ .../pages/examples/index-table-with-filtering.tsx | 2 ++ .../pages/examples/index-table-with-loading-state.tsx | 2 ++ .../index-table-with-multiple-promoted-bulk-actions.tsx | 2 ++ .../pages/examples/index-table-with-nested-rows.tsx | 2 ++ .../pages/examples/index-table-with-pagination.tsx | 2 ++ .../examples/index-table-with-row-navigation-link.tsx | 2 ++ .../examples/index-table-with-sticky-last-column.tsx | 2 ++ .../pages/examples/index-table-with-subheaders.tsx | 2 ++ .../index-table-with-views-search-filter-sorting.tsx | 2 ++ .../pages/examples/index-table-without-checkboxes.tsx | 9 ++++++++- 17 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 .changeset/calm-colts-melt.md diff --git a/.changeset/calm-colts-melt.md b/.changeset/calm-colts-melt.md new file mode 100644 index 00000000000..607baddc8ec --- /dev/null +++ b/.changeset/calm-colts-melt.md @@ -0,0 +1,6 @@ +--- +'@shopify/polaris': patch +'polaris.shopify.com': patch +--- + +Updated IndexTable documentation for when to hide bulk actions diff --git a/polaris.shopify.com/content/components/tables/index-table.mdx b/polaris.shopify.com/content/components/tables/index-table.mdx index 80cd743e220..71c9778bcbb 100644 --- a/polaris.shopify.com/content/components/tables/index-table.mdx +++ b/polaris.shopify.com/content/components/tables/index-table.mdx @@ -156,6 +156,8 @@ Index tables should: Index tables can optionally: - Provide bulk actions for tasks that are often applied to many list items at once. For example, merchants may want to add the same tag to a large number of products. +- Hide bulk actions on small screens using the `condensed` prop. We only recommend hiding bulk actions on screens smaller than 490px using our `breakpoints-sm` value: `condensed={useBreakpoints().smDown}`. + - Hiding bulk actions means a merchant can’t select multiple items at once, so it should only be used when the bulk actions are not essential to the merchant’s workflow. --- diff --git a/polaris.shopify.com/pages/examples/index-table-default.tsx b/polaris.shopify.com/pages/examples/index-table-default.tsx index 398237e896d..287062f751f 100644 --- a/polaris.shopify.com/pages/examples/index-table-default.tsx +++ b/polaris.shopify.com/pages/examples/index-table-default.tsx @@ -4,6 +4,7 @@ import { useIndexResourceState, Text, Badge, + useBreakpoints, } from '@shopify/polaris'; import React from 'react'; import {withPolarisExample} from '../../src/components/PolarisExampleWrapper'; @@ -74,6 +75,7 @@ function SimpleIndexTableExample() { return ( Date: Tue, 21 Nov 2023 16:30:37 -0500 Subject: [PATCH 3/3] remove funky padding from example --- .../IndexTable/IndexTable.stories.tsx | 66 +++++++++---------- 1 file changed, 30 insertions(+), 36 deletions(-) diff --git a/polaris-react/src/components/IndexTable/IndexTable.stories.tsx b/polaris-react/src/components/IndexTable/IndexTable.stories.tsx index 98757bb2f4d..831c21e2ad1 100644 --- a/polaris-react/src/components/IndexTable/IndexTable.stories.tsx +++ b/polaris-react/src/components/IndexTable/IndexTable.stories.tsx @@ -1211,42 +1211,36 @@ export function WithBulkActionsAndSelectionAcrossPages() { ); return ( -
- - - {rowMarkup} - - -
+ + + {rowMarkup} + + ); }