@@ -10,6 +10,14 @@ export default {
1010
1111const PaginationExample = ( args ) => < Pagination { ...args } /> ;
1212
13+ const ContainerQueriesExample = ( args ) => (
14+ < >
15+ < Pagination { ...args } style = { { maxWidth : "100%" } } />
16+ < Pagination { ...args } style = { { maxWidth : "32rem" } } />
17+ < Pagination { ...args } style = { { maxWidth : "26rem" } } />
18+ </ >
19+ ) ;
20+
1321export const Default : StoryFn < typeof Pagination > = PaginationExample . bind ( { } ) ;
1422Default . args = {
1523 pageSizes : [ 10 , 20 , 50 , 100 ] ,
@@ -29,33 +37,26 @@ ExtendedPagesizeSelection.args = {
2937 ] ,
3038} ;
3139
32- const VisibilityRegressionExample : StoryFn < typeof Pagination > = ( args ) => (
33- < div style = { { display : "grid" , gap : "1rem" } } >
34- < p style = { { margin : 0 , maxWidth : "56rem" } } >
35- Both examples below enable < code > hidePageSizeConfiguration</ code > and < code > hideNavigationArrows</ code > .
36- The expected behavior is that the page-size selector and navigation arrows stay hidden regardless of width.
37- If the container-query override is active, the wider example will show them again.
38- </ p >
39- < div style = { { display : "grid" , gap : "1rem" , gridTemplateColumns : "repeat(auto-fit, minmax(22rem, 1fr))" } } >
40- < div style = { { border : "1px solid #c6c6c6" , padding : "1rem" } } >
41- < div style = { { fontWeight : 600 , marginBottom : "0.5rem" } } > Narrow container (~24rem)</ div >
42- < div style = { { width : "24rem" } } >
43- < Pagination { ...args } />
44- </ div >
45- </ div >
46- < div style = { { border : "1px solid #c6c6c6" , padding : "1rem" } } >
47- < div style = { { fontWeight : 600 , marginBottom : "0.5rem" } } > Wide container (~36rem)</ div >
48- < div style = { { width : "36rem" } } >
49- < Pagination { ...args } />
50- </ div >
51- </ div >
52- </ div >
53- </ div >
54- ) ;
55-
56- export const ContainerQueryOverridesHideFlags = VisibilityRegressionExample . bind ( { } ) ;
57- ContainerQueryOverridesHideFlags . args = {
40+ /**
41+ * This story demonstrates a minimal pagination and is a check that elements are always hidden.
42+ */
43+ export const MinimalPagination : StoryFn < typeof Pagination > = PaginationExample . bind ( { } ) ;
44+ MinimalPagination . args = {
5845 ...Default . args ,
5946 hidePageSizeConfiguration : true ,
60- hideNavigationArrows : true ,
47+ hidePageSelect : true ,
48+ hideInfoText : true ,
49+ hideNavigationArrows : false ,
50+ hideBorders : false ,
51+ } ;
52+
53+ /**
54+ * Demonstrates the breakpoints of the container queries.
55+ * If the container gets too small, some elements are removed automatically.
56+ * First, page selector disappears, then the page size selector.
57+ * Info text and navigation arrow are never hidden automatically.
58+ */
59+ export const ContainerQueries : StoryFn < typeof Pagination > = ContainerQueriesExample . bind ( { } ) ;
60+ ContainerQueries . args = {
61+ ...Default . args ,
6162} ;
0 commit comments