From 048ab873adbd04b2b844b893060c0938c631e7c5 Mon Sep 17 00:00:00 2001 From: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Date: Wed, 5 Nov 2025 15:11:42 +1100 Subject: [PATCH 01/16] DataViewsPicker: Try a paddingX prop to override horizontal padding --- .../components/dataviews-footer/style.scss | 20 ++-- .../src/components/dataviews-picker/index.tsx | 17 +++- .../src/components/dataviews/index.tsx | 17 +++- .../src/components/dataviews/style.scss | 93 ++++++++++++------- .../src/stories/dataviews-picker.story.tsx | 35 +++---- 5 files changed, 123 insertions(+), 59 deletions(-) diff --git a/packages/dataviews/src/components/dataviews-footer/style.scss b/packages/dataviews/src/components/dataviews-footer/style.scss index 9f22c42c2d6163..0be05d5419edb3 100644 --- a/packages/dataviews/src/components/dataviews-footer/style.scss +++ b/packages/dataviews/src/components/dataviews-footer/style.scss @@ -6,8 +6,8 @@ position: sticky; bottom: 0; left: 0; - background-color: inherit; - padding: $grid-unit-15 $grid-unit-60; + background-color: $white; + padding: $grid-unit-15 0; border-top: $border-width solid $gray-100; flex-shrink: 0; @@ -18,12 +18,6 @@ z-index: z-index(".dataviews-footer"); } -@container (max-width: 430px) { - .dataviews-footer { - padding: $grid-unit-15 $grid-unit-30; - } -} - @container (max-width: 560px) { .dataviews-footer { flex-direction: column !important; @@ -42,3 +36,13 @@ } } } + +/** + * Apply custom padding-x from the wrapper to the footer. + */ +.dataviews-wrapper, +.dataviews-picker-wrapper { + .dataviews-footer { + padding: $grid-unit-15 var(--dataviews-padding-x, $grid-unit-60); + } +} diff --git a/packages/dataviews/src/components/dataviews-picker/index.tsx b/packages/dataviews/src/components/dataviews-picker/index.tsx index a97bb40825978f..70d2161a82a357 100644 --- a/packages/dataviews/src/components/dataviews-picker/index.tsx +++ b/packages/dataviews/src/components/dataviews-picker/index.tsx @@ -63,6 +63,7 @@ type DataViewsPickerProps< Item > = { }; itemListLabel?: string; empty?: ReactNode; + paddingX?: string | number; } & ( Item extends ItemWithId ? { getItemId?: ( item: Item ) => string } : { getItemId: ( item: Item ) => string } ); @@ -128,6 +129,7 @@ function DataViewsPicker< Item >( { config = { perPageSizes: [ 10, 20, 50, 100 ] }, itemListLabel, empty, + paddingX, }: DataViewsPickerProps< Item > ) { const { infiniteScrollHandler } = paginationInfo; const containerRef = useRef< HTMLDivElement | null >( null ); @@ -242,7 +244,20 @@ function DataViewsPicker< Item >( { hasInfiniteScrollHandler: !! infiniteScrollHandler, } } > -