playbook_ui_docs 14.24.0 → 14.25.0.pre.alpha.PLAY2369textinputautocompleteprop9970

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 (35) 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/_fixed_confirmation_toast_props_swift.md +3 -2
  22. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/example.yml +2 -0
  23. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/index.js +1 -0
  24. data/app/pb_kits/playbook/pb_flex/docs/_flex_gap.html.erb +12 -1
  25. data/app/pb_kits/playbook/pb_flex/docs/_flex_gap.jsx +26 -1
  26. data/app/pb_kits/playbook/pb_flex/docs/_flex_gap_rails.md +11 -0
  27. data/app/pb_kits/playbook/pb_flex/docs/_flex_gap_react.md +11 -0
  28. data/app/pb_kits/playbook/pb_pagination/docs/_pagination_external_control.jsx +112 -0
  29. data/app/pb_kits/playbook/pb_pagination/docs/_pagination_external_control_react.md +3 -0
  30. data/app/pb_kits/playbook/pb_pagination/docs/example.yml +1 -0
  31. data/app/pb_kits/playbook/pb_pagination/docs/index.js +1 -0
  32. data/app/pb_kits/playbook/pb_user/docs/_user_props_table.md +14 -7
  33. data/dist/playbook-doc.js +1 -1
  34. metadata +20 -3
  35. data/app/pb_kits/playbook/pb_flex/docs/_flex_gap.md +0 -9
@@ -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'
@@ -1,11 +1,18 @@
1
1
  ### Props
2
2
  | Name | Type | Description | Default | Values |
3
3
  | --- | ----------- | --------- | --------- | --------- |
4
- | **name** | `String` | Sets the User's name | | |
4
+ | **name** | `String` | Sets the User's name | `""` | |
5
+ | **nameFont** | `Typography` | Font styling for the user's name | `.init(font: .title4, variant: .bold)` | |
6
+ | **image** | `Image?` | Sets image for the avatar | `nil` | |
7
+ | **orientation** | `Orientation` | Changes the orientation of the User | `.horizontal` | `.horizontal` `.vertical` |
8
+ | **size** | `Size` | Changes the size of the User | `.medium` | `.xxSmall` `.xSmall` `.small` `.medium` `.large` `.xLarge` |
9
+ | **territory** | `String?` | Adds the User's territory | `nil` | |
10
+ | **title** | `String?` | Adds a title | `nil` | |
11
+ | **subtitle** | `AnyView?` | Adds a subtitle view | `nil` | |
12
+ | **status** | `PBOnlineStatus.Status?` | An indicator for the current status of the user | `nil` | `.online` `.away` `.offline` |
5
13
  | **displayAvatar** | `Bool` | Displays the User's avatar | `true` | `true` `false` |
6
- | **image** | `Image` | Sets image for the avatar | | |
7
- | **orientation** | `Orientation` | Changes the orientation of the User | `.horizontal` | `.horizontal` `.verticle` |
8
- | **size** | `UserAvatarSize` | Changes the size of the User | `.medium` | `.small` `.medium` `.large` |
9
- | **territory** | `String` | Adds the User's territory | | |
10
- | **title** | `String` | Adds a title | | |
11
- | **status** | `PBAvatar.PresenceStatus?` | An idicator for the current status of the user | `.none` | `.online` `.away` `.offline` |
14
+ | **territoryTitleFont** | `PBFont` | Font for territory and title text | `.subcaption` | `.title1` `.body` `.caption` `.subcaption` `.badgeText` `.title4` |
15
+ | **isActive** | `Bool` | Sets whether the user is active | `true` | `true` `false` |
16
+ | **hasInactiveBadge** | `Bool` | Shows inactive badge when user is not active | `false` | `true` `false` |
17
+ | **spacing** | `CGFloat` | Controls spacing between elements | `Spacing.small` | `.none` `.xxSmall` `.xSmall` `.small` `.medium` `.large` `.xLarge` |
18
+