playbook_ui_docs 14.24.0.pre.rc.6 → 14.25.0.pre.alpha.testingcss9700

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_vertical_border.html.erb +43 -0
  3. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_vertical_border.jsx +64 -0
  4. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control.jsx +60 -0
  5. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control.md +3 -0
  6. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control_per_row.jsx +57 -0
  7. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control_per_row.md +1 -0
  8. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +4 -0
  9. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +4 -1
  10. data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_input_options.html.erb +24 -0
  11. data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_input_options.md +3 -0
  12. data/app/pb_kits/playbook/pb_circle_icon_button/docs/example.yml +1 -0
  13. data/app/pb_kits/playbook/pb_date/docs/_date_with_show_current_year.html.erb +4 -0
  14. data/app/pb_kits/playbook/pb_date/docs/_date_with_show_current_year.jsx +17 -0
  15. data/app/pb_kits/playbook/pb_date/docs/_date_with_show_current_year.md +1 -0
  16. data/app/pb_kits/playbook/pb_date/docs/example.yml +2 -0
  17. data/app/pb_kits/playbook/pb_date/docs/index.js +1 -0
  18. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_no_icon.html.erb +22 -0
  19. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_no_icon.jsx +43 -0
  20. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_no_icon.md +1 -0
  21. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/example.yml +2 -0
  22. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/index.js +1 -0
  23. data/app/pb_kits/playbook/pb_pagination/docs/_pagination_external_control.jsx +112 -0
  24. data/app/pb_kits/playbook/pb_pagination/docs/_pagination_external_control_react.md +3 -0
  25. data/app/pb_kits/playbook/pb_pagination/docs/example.yml +1 -0
  26. data/app/pb_kits/playbook/pb_pagination/docs/index.js +1 -0
  27. data/dist/playbook-doc.js +67243 -3
  28. metadata +18 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bd832d17e4242874ee18b73cb11bbe573054e8ebaace3cad31904ce48cbc05a4
4
- data.tar.gz: 2c18cdd478d7c09d38076223c94365d5a9e1e9e01c029f1dc06966818afbebeb
3
+ metadata.gz: ecb2289b05e51254aa62c364e4a543d374a3790ca42c14bb9ed86d65bd1cff47
4
+ data.tar.gz: 147189476726310d62ad857844cbb54e63a99793989eadbf333703bc1311904e
5
5
  SHA512:
6
- metadata.gz: '02799b0d6650e5d6a913ca2038ab31ef1519e4f69b9286757bf3c5dd8ea3fb1033bdbc67e4c0562ac7723aa882b986c069accdeab2c0eb63f87c4e5ec63e8484'
7
- data.tar.gz: 11246123eb948827f45d76b69b1d091a3ea1e2642635af178baced14d7a32d4befa437d2ebff7c78f69b894c5d34c43b6b88e8d74770a19d1546361863c7882f
6
+ metadata.gz: f92d4ca2af12ca9379faadd91a67852ebcdb6574dde37e8439db1a4f42a4113d99c94b2e7400323e5278dc210e595311dd8e492398bfcb83e5d75065dda2d84e
7
+ data.tar.gz: c73002345301e74ae4ff537ae0ad613ffb0603be5c777724dce1982e8ef4161547afb4a2f3110be2786344e70a315826d06c6c71d9198b0d879d774b806c6003
@@ -0,0 +1,43 @@
1
+ <% column_definitions = [
2
+ {
3
+ accessor: "year",
4
+ label: "Year",
5
+ cellAccessors: ["quarter", "month", "day"],
6
+ },
7
+ {
8
+ label: "Enrollment Data",
9
+ columns: [
10
+ {
11
+ accessor: "newEnrollments",
12
+ label: "New Enrollments",
13
+ },
14
+ {
15
+ accessor: "scheduledMeetings",
16
+ label: "Scheduled Meetings",
17
+ },
18
+ ],
19
+ },
20
+ {
21
+ label: "Performance Data",
22
+ columns: [
23
+ {
24
+ accessor: "attendanceRate",
25
+ label: "Attendance Rate",
26
+ },
27
+ {
28
+ accessor: "completedClasses",
29
+ label: "Completed Classes",
30
+ },
31
+ {
32
+ accessor: "classCompletionRate",
33
+ label: "Class Completion Rate",
34
+ },
35
+ {
36
+ accessor: "graduatedStudents",
37
+ label: "Graduated Students",
38
+ },
39
+ ],
40
+ },
41
+ ] %>
42
+
43
+ <%= pb_rails("advanced_table", props: { id: "table_multi_headers_vertical_borders", table_data: @table_data, column_definitions: column_definitions, table_props: { vertical_border: true } }) %>
@@ -0,0 +1,64 @@
1
+ import React from "react"
2
+ import AdvancedTable from '../../pb_advanced_table/_advanced_table'
3
+ import MOCK_DATA from "./advanced_table_mock_data.json"
4
+
5
+ const AdvancedTableColumnHeadersVerticalBorder = (props) => {
6
+ const columnDefinitions = [
7
+ {
8
+ accessor: "year",
9
+ label: "Year",
10
+ cellAccessors: ["quarter", "month", "day"],
11
+ },
12
+ {
13
+ label: "Enrollment Data",
14
+ columns: [
15
+ {
16
+ accessor: "newEnrollments",
17
+ label: "New Enrollments",
18
+ },
19
+ {
20
+ accessor: "scheduledMeetings",
21
+ label: "Scheduled Meetings",
22
+ },
23
+ ],
24
+ },
25
+ {
26
+ label: "Performance Data",
27
+ columns: [
28
+ {
29
+ accessor: "attendanceRate",
30
+ label: "Attendance Rate",
31
+ },
32
+ {
33
+ accessor: "completedClasses",
34
+ label: "Completed Classes",
35
+ },
36
+ {
37
+ accessor: "classCompletionRate",
38
+ label: "Class Completion Rate",
39
+ },
40
+ {
41
+ accessor: "graduatedStudents",
42
+ label: "Graduated Students",
43
+ },
44
+ ],
45
+ },
46
+ ];
47
+
48
+ const tableProps = {
49
+ verticalBorder: true
50
+ }
51
+
52
+ return (
53
+ <>
54
+ <AdvancedTable
55
+ columnDefinitions={columnDefinitions}
56
+ tableData={MOCK_DATA}
57
+ tableProps={tableProps}
58
+ {...props}
59
+ />
60
+ </>
61
+ )
62
+ }
63
+
64
+ export default AdvancedTableColumnHeadersVerticalBorder
@@ -0,0 +1,60 @@
1
+ import React from "react"
2
+ import AdvancedTable from '../_advanced_table'
3
+ import Background from '../../pb_background/_background'
4
+ import MOCK_DATA from "./advanced_table_mock_data_with_id.json"
5
+
6
+ const AdvancedTablePaddingControl = (props) => {
7
+ const columnDefinitions = [
8
+ {
9
+ accessor: "year",
10
+ label: "Year",
11
+ cellAccessors: ["quarter", "month", "day"],
12
+ },
13
+ {
14
+ accessor: "newEnrollments",
15
+ label: "New Enrollments",
16
+ columnStyling:{cellPadding: "none"},
17
+ customRenderer: (row, value) => (
18
+ <Background
19
+ backgroundColor={row.original.newEnrollments > 20 ? "success_secondary" : "warning_secondary"}
20
+ padding="xs"
21
+ >
22
+ {value}
23
+ </Background>
24
+ ),
25
+
26
+ },
27
+ {
28
+ accessor: "scheduledMeetings",
29
+ label: "Scheduled Meetings",
30
+ },
31
+ {
32
+ accessor: "attendanceRate",
33
+ label: "Attendance Rate",
34
+ },
35
+ {
36
+ accessor: "completedClasses",
37
+ label: "Completed Classes",
38
+ },
39
+ {
40
+ accessor: "classCompletionRate",
41
+ label: "Class Completion Rate",
42
+ },
43
+ {
44
+ accessor: "graduatedStudents",
45
+ label: "Graduated Students",
46
+ },
47
+ ]
48
+
49
+ return (
50
+ <div>
51
+ <AdvancedTable
52
+ columnDefinitions={columnDefinitions}
53
+ tableData={MOCK_DATA}
54
+ {...props}
55
+ />
56
+ </div>
57
+ )
58
+ }
59
+
60
+ export default AdvancedTablePaddingControl
@@ -0,0 +1,3 @@
1
+ `columnStyling` can also be used to control padding on all cells in a given column via the use of the `cellPadding` key/value pair. `cellPadding` lets you use 'xxs', 'xs', 'sm', 'md', 'lg', 'xl' and 'none'.
2
+
3
+ This control can be used in conjunction with the `customRenderer` item within each columnDefinition to achieve custom background colors for individual cells as seen here.
@@ -0,0 +1,57 @@
1
+ import React from "react"
2
+ import AdvancedTable from '../_advanced_table'
3
+ import MOCK_DATA from "./advanced_table_mock_data_with_id.json"
4
+
5
+ const AdvancedTablePaddingControlPerRow = (props) => {
6
+ const columnDefinitions = [
7
+ {
8
+ accessor: "year",
9
+ label: "Year",
10
+ cellAccessors: ["quarter", "month", "day"],
11
+ },
12
+ {
13
+ accessor: "newEnrollments",
14
+ label: "New Enrollments",
15
+ },
16
+ {
17
+ accessor: "scheduledMeetings",
18
+ label: "Scheduled Meetings",
19
+ },
20
+ {
21
+ accessor: "attendanceRate",
22
+ label: "Attendance Rate",
23
+ },
24
+ {
25
+ accessor: "completedClasses",
26
+ label: "Completed Classes",
27
+ },
28
+ {
29
+ accessor: "classCompletionRate",
30
+ label: "Class Completion Rate",
31
+ },
32
+ {
33
+ accessor: "graduatedStudents",
34
+ label: "Graduated Students",
35
+ },
36
+ ]
37
+
38
+ const rowStyling = [
39
+ {
40
+ rowId: "1",
41
+ cellPadding:"md"
42
+ },
43
+ ];
44
+
45
+ return (
46
+ <div>
47
+ <AdvancedTable
48
+ columnDefinitions={columnDefinitions}
49
+ rowStyling={rowStyling}
50
+ tableData={MOCK_DATA}
51
+ {...props}
52
+ />
53
+ </div>
54
+ )
55
+ }
56
+
57
+ export default AdvancedTablePaddingControlPerRow
@@ -0,0 +1 @@
1
+ `rowStyling` can also be used to control padding on all cells in a given row via the use of the `cellPadding` key/value pair as shown here. `cellPadding` lets you use 'xxs', 'xs', 'sm', 'md', 'lg', 'xl' and 'none'.
@@ -13,6 +13,7 @@ examples:
13
13
  - advanced_table_with_custom_header_rails: Custom Header Cell
14
14
  - advanced_table_column_headers: Multi-Header Columns
15
15
  - advanced_table_column_headers_multiple: Multi-Header Columns (Multiple Levels)
16
+ - advanced_table_column_headers_vertical_border: Multi-Header Columns with Vertical Borders
16
17
  - advanced_table_no_subrows: Table with No Subrows or Expansion
17
18
  - advanced_table_selectable_rows_rails: Selectable Rows
18
19
  - advanced_table_selectable_rows_no_subrows_rails: Selectable Rows (No Subrows)
@@ -53,6 +54,7 @@ examples:
53
54
  - advanced_table_column_headers: Multi-Header Columns
54
55
  - advanced_table_column_headers_multiple: Multi-Header Columns (Multiple Levels)
55
56
  - advanced_table_column_headers_custom_cell: Multi-Header Columns with Custom Cells
57
+ - advanced_table_column_headers_vertical_border: Multi-Header Columns with Vertical Borders
56
58
  - advanced_table_no_subrows: Table with No Subrows or Expansion
57
59
  - advanced_table_pinned_rows: Pinned Rows
58
60
  - advanced_table_selectable_rows: Selectable Rows
@@ -66,8 +68,10 @@ examples:
66
68
  - advanced_table_column_visibility_multi: Column Visibility Control with Multi-Header Columns
67
69
  - advanced_table_scrollbar_none: Advanced Table Scrollbar None
68
70
  - advanced_table_row_styling: Row Styling
71
+ - advanced_table_padding_control_per_row: Padding Control using Row Styling
69
72
  - advanced_table_column_styling: Column Styling
70
73
  - advanced_table_column_styling_column_headers: Column Styling with Multiple Headers
74
+ - advanced_table_padding_control: Padding Control using Column Styling
71
75
  - advanced_table_column_border_color: Column Group Border Color
72
76
  - advanced_table_fullscreen: Fullscreen
73
77
  - advanced_table_infinite_scroll: Infinite Scroll
@@ -21,6 +21,7 @@ export { default as AdvancedTableSelectableRowsHeader } from './_advanced_table_
21
21
  export { default as AdvancedTableSelectableRowsActions } from './_advanced_table_selectable_rows_actions.jsx'
22
22
  export { default as AdvancedTableTablePropsStickyHeader } from './_advanced_table_table_props_sticky_header.jsx'
23
23
  export { default as AdvancedTableColumnHeadersCustomCell } from './_advanced_table_column_headers_custom_cell.jsx'
24
+ export { default as AdvancedTableColumnHeadersVerticalBorder } from './_advanced_table_column_headers_vertical_border.jsx'
24
25
  export { default as AdvancedTableInlineEditing } from './_advanced_table_inline_editing.jsx'
25
26
  export { default as AdvancedTableFullscreen } from './_advanced_table_fullscreen.jsx'
26
27
  export { default as AdvancedTableStickyColumns } from './_advanced_table_sticky_columns.jsx'
@@ -42,4 +43,6 @@ export {default as AdvancedTableWithCustomHeader} from './_advanced_table_with_c
42
43
  export { default as AdvancedTableCustomSort } from './_advanced_table_custom_sort.jsx'
43
44
  export { default as AdvancedTableWithCustomHeaderMultiHeader } from './_advanced_table_with_custom_header_multi_header.jsx'
44
45
  export { default as AdvancedTableSortPerColumn } from './_advanced_table_sort_per_column.jsx'
45
- export { default as AdvancedTableSortPerColumnForMultiColumn } from './_advanced_table_sort_per_column_for_multi_column.jsx'
46
+ export { default as AdvancedTableSortPerColumnForMultiColumn } from './_advanced_table_sort_per_column_for_multi_column.jsx'
47
+ export { default as AdvancedTablePaddingControl } from './_advanced_table_padding_control.jsx'
48
+ export { default as AdvancedTablePaddingControlPerRow } from './_advanced_table_padding_control_per_row.jsx'
@@ -0,0 +1,24 @@
1
+ <%= pb_rails("circle_icon_button", props: {
2
+ icon: "plus",
3
+ input_options: {
4
+ data: { "test-id": "add-button", remote: true },
5
+ }
6
+ }) %>
7
+ <br/>
8
+ <%= pb_rails("circle_icon_button", props: {
9
+ icon: "pen",
10
+ variant: "secondary",
11
+ input_options: {
12
+ data: { "test-id": "edit-button" },
13
+ classname: "custom-secondary-button-class"
14
+ }
15
+ }) %>
16
+ <br/>
17
+ <%= pb_rails("circle_icon_button", props: {
18
+ icon: "user",
19
+ variant: "link",
20
+ input_options: {
21
+ data: { "test-id": "user-button" },
22
+ id: "user-button-id"
23
+ }
24
+ }) %>
@@ -0,0 +1,3 @@
1
+ Use the `input_options` prop to pass additional attributes directly to the internal Playbook Button component. While the wrapper div has access to the standard `data` prop from KitBase, `input_options` allows you to attach attributes specifically to the internal button element.
2
+
3
+ This is particularly useful when you need data attributes or other HTML attributes to apply to the button itself.
@@ -5,6 +5,7 @@ examples:
5
5
  - circle_icon_button_link: Link
6
6
  - circle_icon_button_loading: Loading
7
7
  - circle_icon_button_size: Size
8
+ - circle_icon_button_input_options: Input Options
8
9
 
9
10
  react:
10
11
  - circle_icon_button_default: Default
@@ -0,0 +1,4 @@
1
+ <%= pb_rails("date", props: {
2
+ date: Date.today,
3
+ show_current_year: true
4
+ }) %>
@@ -0,0 +1,17 @@
1
+ import React from 'react'
2
+
3
+ import FormattedDate from '../../pb_date/_date'
4
+
5
+ const DateWithShowCurrentYear = (props) => {
6
+ return (
7
+ <>
8
+ <FormattedDate
9
+ showCurrentYear
10
+ value={new Date()}
11
+ {...props}
12
+ />
13
+ </>
14
+ )
15
+ }
16
+
17
+ export default DateWithShowCurrentYear
@@ -0,0 +1 @@
1
+ By default, the Date kit does NOT display the year if it is the current year. If you want to display the current year you can do so by setting `showCurrentYear`/`show_current_year` to true as shown here.
@@ -5,12 +5,14 @@ examples:
5
5
  - date_variants: Variants
6
6
  - date_alignment: Alignment
7
7
  - date_timezone: Timezones
8
+ - date_with_show_current_year: Show Current Year
8
9
  - date_unstyled: Unstyled
9
10
 
10
11
  react:
11
12
  - date_default: Default
12
13
  - date_variants: Variants
13
14
  - date_alignment: Alignment
15
+ - date_with_show_current_year: Show Current Year
14
16
  - date_unstyled: Unstyled
15
17
 
16
18
  swift:
@@ -2,3 +2,4 @@ export { default as DateDefault } from './_date_default.jsx'
2
2
  export { default as DateVariants } from './_date_variants.jsx'
3
3
  export { default as DateAlignment } from './_date_alignment.jsx'
4
4
  export { default as DateUnstyled } from './_date_unstyled.jsx'
5
+ export { default as DateWithShowCurrentYear } from './_date_with_show_current_year.jsx'
@@ -0,0 +1,22 @@
1
+ <%= pb_rails("fixed_confirmation_toast", props: {
2
+ text: "Error Message",
3
+ status: "error",
4
+ icon: "none",
5
+ closeable: true
6
+ })%>
7
+
8
+ <br><br>
9
+
10
+ <%= pb_rails("fixed_confirmation_toast", props: {
11
+ text: "Items Successfully Moved",
12
+ status: "success",
13
+ icon: "none"
14
+ })%>
15
+
16
+ <br><br>
17
+
18
+ <%= pb_rails("fixed_confirmation_toast", props: {
19
+ text: "Scan to Assign Selected Items",
20
+ status: "neutral",
21
+ icon: "none"
22
+ })%>
@@ -0,0 +1,43 @@
1
+ import React from 'react'
2
+
3
+ import FixedConfirmationToast from '../_fixed_confirmation_toast'
4
+
5
+ const FixedConfirmationToastNoIcon = (props) => {
6
+ return (
7
+ <div>
8
+ <div>
9
+ <FixedConfirmationToast
10
+ closeable
11
+ icon="none"
12
+ status="error"
13
+ text="Error Message"
14
+ {...props}
15
+ />
16
+ </div>
17
+
18
+ <br />
19
+
20
+ <div>
21
+ <FixedConfirmationToast
22
+ icon="none"
23
+ status="success"
24
+ text="Items Successfully Moved"
25
+ {...props}
26
+ />
27
+ </div>
28
+
29
+ <br />
30
+
31
+ <div>
32
+ <FixedConfirmationToast
33
+ icon="none"
34
+ status="neutral"
35
+ text="Scan to Assign Selected Items"
36
+ {...props}
37
+ />
38
+ </div>
39
+ </div>
40
+ )
41
+ }
42
+
43
+ export default FixedConfirmationToastNoIcon
@@ -0,0 +1 @@
1
+ Setting `icon` prop to "none" will render the fixed confirmation toast without the left side icon.
@@ -8,6 +8,7 @@ examples:
8
8
  - fixed_confirmation_toast_auto_close: Click to Show Auto Close
9
9
  - fixed_confirmation_toast_children: Children
10
10
  - fixed_confirmation_toast_custom_icon: Custom Icon
11
+ - fixed_confirmation_toast_no_icon: No Icon
11
12
 
12
13
  react:
13
14
  - fixed_confirmation_toast_default: Default
@@ -17,6 +18,7 @@ examples:
17
18
  - fixed_confirmation_toast_auto_close: Click to Show Auto Close
18
19
  - fixed_confirmation_toast_children: Children
19
20
  - fixed_confirmation_toast_custom_icon: Custom Icon
21
+ - fixed_confirmation_toast_no_icon: No Icon
20
22
 
21
23
  swift:
22
24
  - fixed_confirmation_toast_default_swift: Default
@@ -5,3 +5,4 @@ export { default as FixedConfirmationToastPositions } from './_fixed_confirmatio
5
5
  export { default as FixedConfirmationToastAutoClose } from './_fixed_confirmation_toast_auto_close.jsx'
6
6
  export { default as FixedConfirmationToastChildren } from './_fixed_confirmation_toast_children.jsx'
7
7
  export { default as FixedConfirmationToastCustomIcon } from './_fixed_confirmation_toast_custom_icon.jsx'
8
+ export { default as FixedConfirmationToastNoIcon } from './_fixed_confirmation_toast_no_icon.jsx'
@@ -0,0 +1,112 @@
1
+ import React, { useState } from "react";
2
+ import Flex from '../../pb_flex/_flex'
3
+ import Pagination from '../../pb_pagination/_pagination'
4
+ import Select from '../../pb_select/_select'
5
+ import Table from '../../pb_table/_table'
6
+
7
+ import { data } from "./data";
8
+
9
+ const PaginationExternalControl = (props) => {
10
+ const [totalItems, setTotalItems] = useState(20);
11
+ const [itemsPerPage, setItemsPerPage] = useState(5);
12
+ const [currentPage, setCurrentPage] = useState(1);
13
+
14
+ const totalPages = Math.ceil(totalItems / itemsPerPage);
15
+
16
+ const handlePageChange = (page) => {
17
+ setCurrentPage(page);
18
+ };
19
+
20
+ const limitedData = data.slice(0, totalItems);
21
+ const startIndex = (currentPage - 1) * itemsPerPage;
22
+ const paginatedItems = limitedData.slice(startIndex, startIndex + itemsPerPage);
23
+
24
+ const handleTotalItemsChange = (event) => {
25
+ const value = Number(event.target.value);
26
+ setTotalItems(value);
27
+ setCurrentPage(1);
28
+ };
29
+
30
+ const handleItemsPerPageChange = (event) => {
31
+ const value = Number(event.target.value);
32
+ setItemsPerPage(value);
33
+ setCurrentPage(1);
34
+ };
35
+
36
+ return (
37
+ <>
38
+ <Flex gap="sm">
39
+ <Select
40
+ label="Total Items"
41
+ onChange={handleTotalItemsChange}
42
+ options={[
43
+ { value: "5", text: "5" },
44
+ { value: "10", text: "10" },
45
+ { value: "20", text: "20" }
46
+ ]}
47
+ size="sm"
48
+ value={String(totalItems)}
49
+ {...props}
50
+ />
51
+
52
+ <Select
53
+ label="Items per Page"
54
+ onChange={handleItemsPerPageChange}
55
+ options={[
56
+ { value: "3", text: "3" },
57
+ { value: "5", text: "5" },
58
+ { value: "10", text: "10" }
59
+ ]}
60
+ size="sm"
61
+ value={String(itemsPerPage)}
62
+ {...props}
63
+ />
64
+ </Flex>
65
+
66
+ <Pagination
67
+ current={currentPage}
68
+ key={`pagination-top-${currentPage}`}
69
+ marginBottom="xs"
70
+ onChange={handlePageChange}
71
+ range={5}
72
+ total={totalPages}
73
+ {...props}
74
+ />
75
+ <Table
76
+ marginBottom="xs"
77
+ responsive="none"
78
+ size="sm"
79
+ {...props}
80
+ >
81
+ <Table.Head>
82
+ <Table.Row>
83
+ <Table.Header>{"Column 1"}</Table.Header>
84
+ <Table.Header>{"Column 2"}</Table.Header>
85
+ <Table.Header>{"Column 3"}</Table.Header>
86
+ <Table.Header>{"Column 4"}</Table.Header>
87
+ <Table.Header>{"Column 5"}</Table.Header>
88
+ </Table.Row>
89
+ </Table.Head>
90
+ <Table.Body>
91
+ {paginatedItems.map((row, index) => (
92
+ <Table.Row key={index}>
93
+ {row.map((cell, cellIndex) => (
94
+ <Table.Cell key={cellIndex}>{cell}</Table.Cell>
95
+ ))}
96
+ </Table.Row>
97
+ ))}
98
+ </Table.Body>
99
+ </Table>
100
+ <Pagination
101
+ current={currentPage}
102
+ key={`pagination-bottom-${currentPage}`}
103
+ onChange={handlePageChange}
104
+ range={5}
105
+ total={totalPages}
106
+ {...props}
107
+ />
108
+ </>
109
+ )
110
+ }
111
+
112
+ export default PaginationExternalControl
@@ -0,0 +1,3 @@
1
+ The Pagination component supports external control of the current page. This allows for programmatically reseting or changing the current page when filters or other criteria change, without needing to unmount and remount the component.
2
+
3
+ In this example, changing the "Total Items" or "Items per Page" dropdowns will automatically reset the pagination to page 1, demonstrating how external control works. The pagination component will update its internal state to reflect the new `current` prop value.
@@ -6,3 +6,4 @@ examples:
6
6
  react:
7
7
  - pagination_default: Default
8
8
  - pagination_page_change: Page Change
9
+ - pagination_external_control: External Control
@@ -1,2 +1,3 @@
1
1
  export { default as PaginationDefault } from './_pagination_default.jsx'
2
2
  export { default as PaginationPageChange } from './_pagination_page_change.jsx'
3
+ export { default as PaginationExternalControl } from './_pagination_external_control.jsx'