playbook_ui_docs 14.12.0.pre.alpha.testingwithfas5689 → 14.12.0.pre.rc.0
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.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination.jsx +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.jsx +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_control.md +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -7
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +1 -6
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default_date.md +1 -1
- data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards_rails.html.erb +3 -1
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards_rails.md +0 -7
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list_rails.html.erb +9 -3
- data/app/pb_kits/playbook/pb_draggable/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.jsx +45 -3
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.jsx +1 -0
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_default.jsx +16 -9
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.jsx +19 -44
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.md +3 -21
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx +21 -16
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_sizes.jsx +19 -2
- data/app/pb_kits/playbook/pb_drawer/docs/example.yml +1 -2
- data/app/pb_kits/playbook/pb_drawer/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subtle_variant.md +1 -1
- data/app/pb_kits/playbook/pb_phone_number_input/docs/example.yml +1 -3
- data/app/pb_kits/playbook/pb_phone_number_input/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_radio/docs/_radio_custom_children.jsx +3 -8
- data/app/pb_kits/playbook/pb_selectable_icon/docs/_selectable_icon_default.jsx +1 -4
- data/app/pb_kits/playbook/pb_selectable_icon/docs/_selectable_icon_single_select.jsx +1 -4
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns_rails.md +2 -2
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content.jsx +8 -12
- data/app/pb_kits/playbook/pb_table/docs/example.yml +0 -6
- data/app/pb_kits/playbook/pb_text_input/docs/example.yml +1 -2
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_custom_menu_list.jsx +0 -2
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async.jsx +2 -4
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async_custom_options.jsx +5 -5
- data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_typeahead/docs/index.js +0 -1
- data/dist/playbook-doc.js +1 -1
- metadata +7 -49
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_no_subrows.jsx +0 -50
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_responsive.html.erb +0 -38
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows.jsx +0 -60
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows.md +0 -5
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions.jsx +0 -78
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions.md +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header.jsx +0 -53
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header.md +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows.jsx +0 -52
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows.md +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.html.erb +0 -33
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_rails.md +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_mock_data_no_subrows.json +0 -42
- data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_mock_data_with_id.json +0 -299
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_turbo_frames.html.erb +0 -13
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_turbo_frames_rails.md +0 -3
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list_rails.md +0 -5
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_selectable_list_rails.html.erb +0 -38
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_selectable_list_rails.md +0 -3
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_behavior.jsx +0 -38
- data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_default.html.erb +0 -3
- data/app/pb_kits/playbook/pb_icon_button/docs/example.yml +0 -7
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_format.html.erb +0 -15
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_format.jsx +0 -24
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_format.md +0 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns.html.erb +0 -74
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns_rails.md +0 -3
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns.html.erb +0 -74
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns_rails.md +0 -3
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.html.erb +0 -47
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_rails.md +0 -2
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content_rails.html.erb +0 -52
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content_rails.md +0 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows_rails.html.erb +0 -52
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows_rails.md +0 -3
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table_rails.html.erb +0 -80
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table_rails.md +0 -1
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask.html.erb +0 -46
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask_rails.md +0 -3
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.html.erb +0 -19
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.jsx +0 -27
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.md +0 -1
- /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_table_props_react.md → _advanced_table_table_props.md} +0 -0
- /data/app/pb_kits/playbook/pb_table/docs/{_table_with_collapsible_react.md → _table_with_collapsible.md} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71e9003b205fa267a12af77bac18b9050b3a471625c9321c3e0489671d7c553f
|
4
|
+
data.tar.gz: cdc85654bd905ff59cc69f72108263b3fd0d46de927da058c1649b15d63e3d78
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce8a94240ae1e52eeb13856c03f8440153ada24ad0085b57c6acc2de3337c267c43f4e2a3c09dbb77a07bf1cf97dded856f680a8fe97d2da77b8dd53ba72503b
|
7
|
+
data.tar.gz: 218397ebd4b192b51c0bd87d49c4f91ef74a6a1e4e9e585deb364208b805c745af27120857b065baaca74332a7142b651df02252156b3a723f77213de029668f
|
@@ -1,3 +1,3 @@
|
|
1
|
-
`sortControl` is an optional prop that can be used to gain greater control over the sort state of the Advanced Table. Tanstack handles sort itself, however it does provide for a way to handle the state manually if needed. Usecases for this include needing to store the sort state so it persists on page reload, set an initial sort state, etc.
|
1
|
+
`sortControl` is an optional prop that can be used to gain greater control over the sort state of the Advanced Table. Tanstack handles sort itself, however it does provide for a way to handle the state manually if needed. Usecases for this include needing to store the sort state so it persists on page reload, set an initial sort state, etc.
|
2
2
|
|
3
|
-
The sort state must be an object with a single key/value pair, with the key being "desc" and the value being a boolean. The default for sort
|
3
|
+
The sort state must be an object with a single key/value pair, with the key being "desc" and the value being a boolean. The default for sort directino is `desc: true`.
|
@@ -3,9 +3,7 @@ examples:
|
|
3
3
|
- advanced_table_beta: Default (Required Props)
|
4
4
|
- advanced_table_beta_subrow_headers: SubRow Headers
|
5
5
|
- advanced_table_collapsible_trail_rails: Collapsible Trail
|
6
|
-
- advanced_table_table_props: Table Props
|
7
6
|
- advanced_table_beta_sort: Enable Sorting
|
8
|
-
- advanced_table_responsive: Responsive Tables
|
9
7
|
- advanced_table_custom_cell_rails: Custom Components for Cells
|
10
8
|
- advanced_table_column_headers: Multi-Header Columns
|
11
9
|
- advanced_table_column_headers_multiple: Multi-Header Columns (Multiple Levels)
|
@@ -28,8 +26,3 @@ examples:
|
|
28
26
|
- advanced_table_pagination_with_props: Pagination Props
|
29
27
|
- advanced_table_column_headers: Multi-Header Columns
|
30
28
|
- advanced_table_column_headers_multiple: Multi-Header Columns (Multiple Levels)
|
31
|
-
# - advanced_table_no_subrows: Table with No Subrows
|
32
|
-
- advanced_table_selectable_rows: Selectable Rows
|
33
|
-
- advanced_table_selectable_rows_no_subrows: Selectable Rows (No Subrows)
|
34
|
-
- advanced_table_selectable_rows_actions: Selectable Rows (With Actions)
|
35
|
-
- advanced_table_selectable_rows_header: Selectable Rows (No Actions Bar)
|
@@ -13,9 +13,4 @@ export { default as AdvancedTableCustomCell } from './_advanced_table_custom_cel
|
|
13
13
|
export { default as AdvancedTablePagination } from './_advanced_table_pagination.jsx'
|
14
14
|
export { default as AdvancedTablePaginationWithProps } from './_advanced_table_pagination_with_props.jsx'
|
15
15
|
export { default as AdvancedTableColumnHeaders } from './_advanced_table_column_headers.jsx'
|
16
|
-
export { default as AdvancedTableColumnHeadersMultiple } from './_advanced_table_column_headers_multiple.jsx'
|
17
|
-
export { default as AdvancedTableSelectableRows } from './_advanced_table_selectable_rows.jsx'
|
18
|
-
export { default as AdvancedTableSelectableRowsNoSubrows } from './_advanced_table_selectable_rows_no_subrows.jsx'
|
19
|
-
export { default as AdvancedTableNoSubrows } from './_advanced_table_no_subrows.jsx'
|
20
|
-
export { default as AdvancedTableSelectableRowsHeader } from './_advanced_table_selectable_rows_header.jsx'
|
21
|
-
export { default as AdvancedTableSelectableRowsActions } from './_advanced_table_selectable_rows_actions.jsx'
|
16
|
+
export { default as AdvancedTableColumnHeadersMultiple } from './_advanced_table_column_headers_multiple.jsx'
|
@@ -2,4 +2,4 @@ The `defaultDate`/`default_date` prop has a null or empty string value by defaul
|
|
2
2
|
|
3
3
|
If you use a Date object without UTC time standardization the Date Picker kit may misinterpret that date as yesterdays date (consequence of timezone differentials and the Javascript Date Object constructor). See [this GitHub issue for more information](https://github.com/powerhome/playbook/issues/1167) and the anti-pattern examples below.
|
4
4
|
|
5
|
-
|
5
|
+
|
@@ -7,7 +7,8 @@
|
|
7
7
|
<%= pb_rails("draggable", props: {initial_items: initial_items}) do %>
|
8
8
|
<%= pb_rails("draggable/draggable_container") do %>
|
9
9
|
<% initial_items.each do |item| %>
|
10
|
-
|
10
|
+
<%= pb_rails("draggable/draggable_item", props:{drag_id: item[:id]}) do %>
|
11
|
+
<%= pb_rails("card", props: {highlight: {position: "side", color:"primary"}, margin_bottom: "xs", padding: "xs"}) do %>
|
11
12
|
<%= pb_rails("flex", props:{align_items: "stretch", flex_direction:"column"}) do %>
|
12
13
|
<%= pb_rails("flex", props:{gap: "xs"}) do %>
|
13
14
|
<%= pb_rails("title", props: { text: item[:name], tag: "h4", size: 4 }) %>
|
@@ -31,6 +32,7 @@
|
|
31
32
|
<% end %>
|
32
33
|
<% end %>
|
33
34
|
<% end %>
|
35
|
+
<% end %>
|
34
36
|
<% end %>
|
35
37
|
<% end %>
|
36
38
|
<% end %>
|
@@ -1,7 +0,0 @@
|
|
1
|
-
For a simplified version of the Draggable API for the Card kit, you can do the following:
|
2
|
-
|
3
|
-
Use the `draggable` kit and manage state as shown.
|
4
|
-
|
5
|
-
`draggable/draggable_container` kit creates the container within which the cards can be dragged and dropped.
|
6
|
-
|
7
|
-
The Card kit is optimized to work with the draggable kit. To enable drag, use the `draggable_item` and `drag_id` props on the Card kit as shown. An additional optional boolean prop (set to true by default) of `drag_handle` is also available to show the drag handle icon.
|
@@ -6,8 +6,14 @@
|
|
6
6
|
|
7
7
|
] %>
|
8
8
|
|
9
|
-
<%= pb_rails("
|
10
|
-
|
11
|
-
<%= pb_rails("list
|
9
|
+
<%= pb_rails("draggable", props: {initial_items: initial_items}) do %>
|
10
|
+
<%= pb_rails("draggable/draggable_container") do %>
|
11
|
+
<%= pb_rails("list", props: {ordered: false}) do %>
|
12
|
+
<% initial_items.each do |item| %>
|
13
|
+
<%= pb_rails("draggable/draggable_item", props:{drag_id: item[:id]}) do %>
|
14
|
+
<%= pb_rails("list/item") do %><%= item[:name] %><% end %>
|
15
|
+
<% end %>
|
16
|
+
<% end %>
|
17
|
+
<% end %>
|
12
18
|
<% end %>
|
13
19
|
<% end %>
|
@@ -6,15 +6,19 @@ const DrawerBorders = () => {
|
|
6
6
|
const [openedBRightDrawer, setOpenedBRightDrawer] = useState(false);
|
7
7
|
const [openedBLeftDrawer, setOpenedBLeftDrawer] = useState(false);
|
8
8
|
const [openedBFullDrawer, setOpenedBFullDrawer] = useState(false);
|
9
|
+
const [openedBDefaultDrawer, setOpenedBDefaultDrawer] = useState(false);
|
10
|
+
const [openedBRoundedDrawer, setOpenedBRoundedDrawer] = useState(false);
|
9
11
|
|
10
12
|
// Toggle functions for each drawer
|
11
13
|
const toggleBRightDrawer = () => setOpenedBRightDrawer(!openedBRightDrawer);
|
12
14
|
const toggleBLeftDrawer = () => setOpenedBLeftDrawer(!openedBLeftDrawer);
|
13
15
|
const toggleBFullDrawer = () => setOpenedBFullDrawer(!openedBFullDrawer);
|
16
|
+
const toggleBDefaultDrawer = () => setOpenedBDefaultDrawer(!openedBDefaultDrawer);
|
17
|
+
const toggleBRoundedDrawer = () => setOpenedBRoundedDrawer(!openedBRoundedDrawer);
|
14
18
|
|
15
19
|
return (
|
16
20
|
<>
|
17
|
-
<Flex
|
21
|
+
<Flex padding="md"
|
18
22
|
wrap
|
19
23
|
>
|
20
24
|
<Button marginRight="md"
|
@@ -32,12 +36,23 @@ const DrawerBorders = () => {
|
|
32
36
|
>
|
33
37
|
Drawer with border full
|
34
38
|
</Button>
|
39
|
+
<Button marginRight="md"
|
40
|
+
onClick={toggleBDefaultDrawer}
|
41
|
+
>
|
42
|
+
Default Drawer
|
43
|
+
</Button>
|
44
|
+
<Button marginRight="md"
|
45
|
+
onClick={toggleBRoundedDrawer}
|
46
|
+
>
|
47
|
+
Rounded Drawer
|
48
|
+
</Button>
|
35
49
|
</Flex>
|
36
50
|
|
37
51
|
{/* Drawers for each size */}
|
38
52
|
<Drawer
|
39
53
|
behavior="float"
|
40
54
|
border="right"
|
55
|
+
fullHeight
|
41
56
|
onClose={toggleBRightDrawer}
|
42
57
|
opened={openedBRightDrawer}
|
43
58
|
overlay={false}
|
@@ -49,10 +64,11 @@ const DrawerBorders = () => {
|
|
49
64
|
<Drawer
|
50
65
|
behavior="float"
|
51
66
|
border="left"
|
67
|
+
fullHeight
|
52
68
|
onClose={toggleBLeftDrawer}
|
53
69
|
opened={openedBLeftDrawer}
|
54
70
|
overlay={false}
|
55
|
-
placement="
|
71
|
+
placement="right"
|
56
72
|
size="lg"
|
57
73
|
>
|
58
74
|
This is a Drawer with border left
|
@@ -60,14 +76,40 @@ const DrawerBorders = () => {
|
|
60
76
|
<Drawer
|
61
77
|
behavior="float"
|
62
78
|
border="full"
|
79
|
+
fullHeight
|
63
80
|
onClose={toggleBFullDrawer}
|
64
81
|
opened={openedBFullDrawer}
|
65
82
|
overlay={false}
|
66
|
-
placement="
|
83
|
+
placement="right"
|
67
84
|
size="lg"
|
68
85
|
>
|
69
86
|
This is a Drawer with border full
|
70
87
|
</Drawer>
|
88
|
+
<Drawer
|
89
|
+
behavior="float"
|
90
|
+
fullHeight
|
91
|
+
onClose={toggleBDefaultDrawer}
|
92
|
+
opened={openedBDefaultDrawer}
|
93
|
+
overlay={false}
|
94
|
+
placement="right"
|
95
|
+
size="lg"
|
96
|
+
>
|
97
|
+
This is a Default Drawer
|
98
|
+
</Drawer>
|
99
|
+
<Drawer
|
100
|
+
behavior="float"
|
101
|
+
borderRadius="rounded"
|
102
|
+
fullHeight
|
103
|
+
onClose={toggleBRoundedDrawer}
|
104
|
+
opened={openedBRoundedDrawer}
|
105
|
+
overlay={false}
|
106
|
+
placement="right"
|
107
|
+
size="lg"
|
108
|
+
>
|
109
|
+
<div style={{ paddingTop: '100px', paddingLeft: '12px' }}>
|
110
|
+
This is a Rounded Drawer
|
111
|
+
</div>
|
112
|
+
</Drawer>
|
71
113
|
</>
|
72
114
|
);
|
73
115
|
};
|
@@ -9,8 +9,8 @@ const useDrawer = (visible = false) => {
|
|
9
9
|
};
|
10
10
|
|
11
11
|
const DrawerDefault = () => {
|
12
|
-
const [
|
13
|
-
const [
|
12
|
+
const [headerSeparatorDrawerOpened, toggleHeaderSeparatorDrawer] = useDrawer();
|
13
|
+
const [bothSeparatorsDrawerOpened, toggleBothSeparatorsDrawer] = useDrawer();
|
14
14
|
|
15
15
|
return (
|
16
16
|
<>
|
@@ -18,13 +18,13 @@ const DrawerDefault = () => {
|
|
18
18
|
<Button
|
19
19
|
id="sm"
|
20
20
|
marginRight="md"
|
21
|
-
onClick={
|
21
|
+
onClick={toggleHeaderSeparatorDrawer}
|
22
22
|
>
|
23
23
|
{"Left Drawer"}
|
24
24
|
</Button>
|
25
25
|
<Button
|
26
26
|
marginRight="xl"
|
27
|
-
onClick={
|
27
|
+
onClick={toggleBothSeparatorsDrawer}
|
28
28
|
>
|
29
29
|
{"Right Drawer"}
|
30
30
|
</Button>
|
@@ -32,8 +32,12 @@ const DrawerDefault = () => {
|
|
32
32
|
<Flex>
|
33
33
|
{/* Left Drawer */}
|
34
34
|
<Drawer
|
35
|
-
|
36
|
-
|
35
|
+
behavior={"push"}
|
36
|
+
fullHeight
|
37
|
+
onClose={toggleHeaderSeparatorDrawer}
|
38
|
+
opened={headerSeparatorDrawerOpened}
|
39
|
+
overlay
|
40
|
+
placement={"left"}
|
37
41
|
size={"lg"}
|
38
42
|
>
|
39
43
|
Test me (Left Drawer)
|
@@ -41,8 +45,11 @@ const DrawerDefault = () => {
|
|
41
45
|
|
42
46
|
{/* Right Drawer */}
|
43
47
|
<Drawer
|
44
|
-
|
45
|
-
|
48
|
+
behavior={"push"}
|
49
|
+
fullHeight
|
50
|
+
onClose={toggleBothSeparatorsDrawer}
|
51
|
+
opened={bothSeparatorsDrawerOpened}
|
52
|
+
overlay
|
46
53
|
placement={"right"}
|
47
54
|
size={"lg"}
|
48
55
|
>
|
@@ -53,4 +60,4 @@ const DrawerDefault = () => {
|
|
53
60
|
);
|
54
61
|
};
|
55
62
|
|
56
|
-
export default DrawerDefault;
|
63
|
+
export default DrawerDefault;
|
@@ -1,56 +1,31 @@
|
|
1
|
-
import React
|
2
|
-
import { Button, Drawer, Icon,
|
1
|
+
import React from "react";
|
2
|
+
import { Button, Drawer, Icon, Title } from "playbook-ui";
|
3
3
|
|
4
4
|
const DrawerMenu = () => {
|
5
|
-
const [isSmallScreen, setIsSmallScreen] = useState(false)
|
6
|
-
|
7
|
-
useEffect(() => {
|
8
|
-
const mediaQuery = window.matchMedia("(max-width: 600px)")
|
9
|
-
setIsSmallScreen(mediaQuery.matches)
|
10
|
-
const handler = (e) => setIsSmallScreen(e.matches)
|
11
|
-
mediaQuery.addEventListener('change', handler)
|
12
|
-
return () => mediaQuery.removeEventListener('change', handler)
|
13
|
-
}, [])
|
14
5
|
|
15
6
|
return (
|
16
|
-
|
17
|
-
<Button id=
|
18
|
-
padding=
|
7
|
+
<>
|
8
|
+
<Button id="menuButton"
|
9
|
+
padding="sm"
|
19
10
|
>
|
20
|
-
<Icon icon=
|
21
|
-
size=
|
11
|
+
<Icon icon="bars"
|
12
|
+
size="3x"
|
22
13
|
/>
|
23
14
|
</Button>
|
24
15
|
<Drawer
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
16
|
+
behavior="push"
|
17
|
+
closeBreakpoint="md"
|
18
|
+
menuButtonID="menuButton"
|
19
|
+
overlay={false}
|
20
|
+
placement="left"
|
21
|
+
size="lg"
|
29
22
|
withinElement
|
30
23
|
>
|
31
|
-
<
|
32
|
-
|
33
|
-
link='#'
|
34
|
-
orientation={isSmallScreen ? 'vertical' : 'horizontal'}
|
35
|
-
padding={isSmallScreen ? 'none' : 'sm'}
|
36
|
-
>
|
37
|
-
<NavItem link='#'
|
38
|
-
text='About'
|
39
|
-
/>
|
40
|
-
<NavItem active
|
41
|
-
link='#'
|
42
|
-
text='Case Studies'
|
43
|
-
/>
|
44
|
-
<NavItem link='#'
|
45
|
-
text='Service'
|
46
|
-
/>
|
47
|
-
<NavItem link='#'
|
48
|
-
text='Contacts'
|
49
|
-
/>
|
50
|
-
</Nav>
|
24
|
+
<Title paddingBottom="md">A really neat menu</Title>
|
25
|
+
<Button text="This Button does nothing" />
|
51
26
|
</Drawer>
|
52
|
-
|
53
|
-
)
|
54
|
-
}
|
27
|
+
</>
|
28
|
+
);
|
29
|
+
};
|
55
30
|
|
56
|
-
export default DrawerMenu
|
31
|
+
export default DrawerMenu;
|
@@ -1,24 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
### Within Element
|
4
|
-
The `withinElement` prop allows you to render the drawer within its parent container:
|
5
|
-
- The drawer will be positioned relative to its parent element
|
6
|
-
- Useful for creating nested navigation structures
|
7
|
-
- This must be used in conjunction with the `triggerId` prop
|
8
|
-
|
9
|
-
This provides a clean way to create responsive navigation patterns that adapt to different screen sizes while maintaining a consistent user experience.
|
10
|
-
|
11
|
-
### Trigger Id
|
12
|
-
The `triggerId` prop allows you to connect an element to control the drawer:
|
13
|
-
- The specified element will toggle the drawer open/closed
|
14
|
-
- The element is automatically hidden when the drawer is opened via breakpoint
|
15
|
-
- The element reappears when the drawer is closed via breakpoint
|
16
|
-
|
17
|
-
### Breakpoint
|
18
|
-
Use the `breakpoint` prop to control when the drawer automatically opens or closes based on screen size. For example, setting `breakpoint="md"` will:
|
19
|
-
- Close the drawer on screens smaller than the medium breakpoint (992px)
|
20
|
-
- Automatically open the drawer on screens larger than or equal to the medium breakpoint
|
21
|
-
|
1
|
+
Our drawer kit can fulfill your responsive menu needs! Using the `closeBreakpoint` prop you can have the menu close on smaller screens like phones/tablets.
|
22
2
|
|
3
|
+
Set a menu button with the `menuButtonID` props. When the Drawer is open, the menu button will be hidden. But when your Brakpoint closes the drawer, you can toggle the Drawer open/close with your menu butotn.
|
23
4
|
|
5
|
+
Also use the `withinElement` props to have the Drawer open within a specific element, instead of the default behavior of it taking up the entire screen size.
|
24
6
|
|
@@ -1,25 +1,24 @@
|
|
1
|
-
import React, { useState } from "react"
|
2
|
-
import { Button, Drawer, Flex } from "playbook-ui"
|
1
|
+
import React, { useState } from "react";
|
2
|
+
import { Button, Drawer, Flex } from "playbook-ui";
|
3
3
|
|
4
4
|
const DrawerSizes = () => {
|
5
5
|
// Individual state variables for each drawer size
|
6
|
-
const [openedNoOverlayDrawer, setOpenedNoOverlayDrawer] = useState(false)
|
7
|
-
const [openedOverlayDrawer, setOpenedOverlayDrawer] = useState(false)
|
6
|
+
const [openedNoOverlayDrawer, setOpenedNoOverlayDrawer] = useState(false);
|
7
|
+
const [openedOverlayDrawer, setOpenedOverlayDrawer] = useState(false);
|
8
8
|
|
9
9
|
// Toggle functions for each drawer
|
10
|
-
const toggleNoOverlayDrawer = () =>
|
11
|
-
|
12
|
-
const toggleOverlayDrawer = () => setOpenedOverlayDrawer(!openedOverlayDrawer)
|
10
|
+
const toggleNoOverlayDrawer = () => setOpenedNoOverlayDrawer(!openedNoOverlayDrawer);
|
11
|
+
const toggleOverlayDrawer = () => setOpenedOverlayDrawer(!openedOverlayDrawer);
|
13
12
|
|
14
13
|
return (
|
15
14
|
<>
|
16
15
|
<Flex wrap>
|
17
|
-
<Button marginRight=
|
16
|
+
<Button marginRight="md"
|
18
17
|
onClick={toggleNoOverlayDrawer}
|
19
18
|
>
|
20
19
|
No Overlay Drawer
|
21
20
|
</Button>
|
22
|
-
<Button marginRight=
|
21
|
+
<Button marginRight="md"
|
23
22
|
onClick={toggleOverlayDrawer}
|
24
23
|
>
|
25
24
|
Overlay Drawer
|
@@ -28,23 +27,29 @@ const DrawerSizes = () => {
|
|
28
27
|
|
29
28
|
{/* Drawers for each size */}
|
30
29
|
<Drawer
|
30
|
+
behavior="push"
|
31
|
+
fullHeight
|
31
32
|
onClose={toggleNoOverlayDrawer}
|
32
33
|
opened={openedNoOverlayDrawer}
|
33
34
|
overlay={false}
|
34
|
-
|
35
|
+
placement="right"
|
36
|
+
size="lg"
|
35
37
|
>
|
36
38
|
This is a Drawer with no overlay
|
37
39
|
</Drawer>
|
38
40
|
<Drawer
|
41
|
+
behavior="push"
|
42
|
+
fullHeight
|
39
43
|
onClose={toggleOverlayDrawer}
|
40
44
|
opened={openedOverlayDrawer}
|
41
|
-
|
42
|
-
|
45
|
+
overlay
|
46
|
+
placement="right"
|
47
|
+
size="lg"
|
43
48
|
>
|
44
|
-
This is a Drawer with an overlay
|
49
|
+
This is a Drawer with an overlay
|
45
50
|
</Drawer>
|
46
51
|
</>
|
47
|
-
)
|
48
|
-
}
|
52
|
+
);
|
53
|
+
};
|
49
54
|
|
50
|
-
export default DrawerSizes
|
55
|
+
export default DrawerSizes;
|
@@ -19,8 +19,7 @@ const DrawerSizes = () => {
|
|
19
19
|
return (
|
20
20
|
<>
|
21
21
|
<Flex wrap>
|
22
|
-
<Button
|
23
|
-
marginRight="md"
|
22
|
+
<Button marginRight="md"
|
24
23
|
onClick={toggleXsDrawer}
|
25
24
|
>
|
26
25
|
XS Drawer
|
@@ -49,8 +48,11 @@ const DrawerSizes = () => {
|
|
49
48
|
|
50
49
|
{/* Drawers for each size */}
|
51
50
|
<Drawer
|
51
|
+
behavior="push"
|
52
|
+
fullHeight
|
52
53
|
onClose={toggleXsDrawer}
|
53
54
|
opened={openedXsDrawer}
|
55
|
+
overlay
|
54
56
|
placement="right"
|
55
57
|
size="xs"
|
56
58
|
>
|
@@ -58,32 +60,47 @@ const DrawerSizes = () => {
|
|
58
60
|
</Drawer>
|
59
61
|
|
60
62
|
<Drawer
|
63
|
+
behavior="push"
|
64
|
+
fullHeight
|
61
65
|
onClose={toggleSmDrawer}
|
62
66
|
opened={openedSmDrawer}
|
67
|
+
overlay
|
68
|
+
placement="right"
|
63
69
|
size="sm"
|
64
70
|
>
|
65
71
|
This is an SM Drawer
|
66
72
|
</Drawer>
|
67
73
|
|
68
74
|
<Drawer
|
75
|
+
behavior="push"
|
76
|
+
fullHeight
|
69
77
|
onClose={toggleMdDrawer}
|
70
78
|
opened={openedMdDrawer}
|
79
|
+
overlay
|
71
80
|
placement="right"
|
81
|
+
size="md"
|
72
82
|
>
|
73
83
|
This is an MD Drawer
|
74
84
|
</Drawer>
|
75
85
|
|
76
86
|
<Drawer
|
87
|
+
behavior="push"
|
88
|
+
fullHeight
|
77
89
|
onClose={toggleLgDrawer}
|
78
90
|
opened={openedLgDrawer}
|
91
|
+
overlay
|
92
|
+
placement="right"
|
79
93
|
size="lg"
|
80
94
|
>
|
81
95
|
This is an LG Drawer
|
82
96
|
</Drawer>
|
83
97
|
|
84
98
|
<Drawer
|
99
|
+
behavior="push"
|
100
|
+
fullHeight
|
85
101
|
onClose={toggleXlDrawer}
|
86
102
|
opened={openedXlDrawer}
|
103
|
+
overlay
|
87
104
|
placement="right"
|
88
105
|
size="xl"
|
89
106
|
>
|
@@ -4,4 +4,3 @@ export { default as DrawerOverlay } from './_drawer_overlay.jsx'
|
|
4
4
|
export { default as DrawerBorders } from './_drawer_borders.jsx'
|
5
5
|
export { default as DrawerBreakpoints } from './_drawer_breakpoints.jsx'
|
6
6
|
export { default as DrawerMenu } from './_drawer_menu.jsx'
|
7
|
-
export { default as DrawerBehavior } from './_drawer_behavior.jsx'
|
@@ -1 +1 @@
|
|
1
|
-
For the `subtle` variant, it is recommended that you set the `Separators` prop to `false` to remove the separator lines between the options for a cleaner look.
|
1
|
+
For the `subtle` variant, it is recommended that you set the `Separators` prop to `false` to remove the separator lines between the options for a more cleaner look.
|
@@ -8,12 +8,10 @@ examples:
|
|
8
8
|
- phone_number_input_validation: Form Validation
|
9
9
|
- phone_number_input_clear_field: Clearing the Input Field
|
10
10
|
- phone_number_input_access_input_element: Accessing the Input Element
|
11
|
-
- phone_number_input_format: Format as You Type
|
12
11
|
|
13
12
|
rails:
|
14
13
|
- phone_number_input_default: Default
|
15
14
|
- phone_number_input_preferred_countries: Preferred Countries
|
16
15
|
- phone_number_input_initial_country: Initial Country
|
17
16
|
- phone_number_input_only_countries: Limited Countries
|
18
|
-
- phone_number_input_validation: Form Validation
|
19
|
-
- phone_number_input_format: Format as You Type
|
17
|
+
- phone_number_input_validation: Form Validation
|
@@ -5,4 +5,3 @@ export { default as PhoneNumberInputOnlyCountries } from './_phone_number_input_
|
|
5
5
|
export { default as PhoneNumberInputValidation } from './_phone_number_input_validation'
|
6
6
|
export { default as PhoneNumberInputClearField } from './_phone_number_input_clear_field'
|
7
7
|
export { default as PhoneNumberInputAccessInputElement } from './_phone_number_input_access_input_element'
|
8
|
-
export { default as PhoneNumberInputFormat } from './_phone_number_input_format'
|
@@ -29,7 +29,6 @@ const RadioChildren = (props) => {
|
|
29
29
|
marginBottom="none"
|
30
30
|
minWidth="xs"
|
31
31
|
options={options}
|
32
|
-
{...props}
|
33
32
|
/>
|
34
33
|
</Radio>
|
35
34
|
<Radio
|
@@ -41,11 +40,10 @@ const RadioChildren = (props) => {
|
|
41
40
|
value="Typeahead"
|
42
41
|
{...props}
|
43
42
|
>
|
44
|
-
<Typeahead
|
43
|
+
<Typeahead
|
45
44
|
marginBottom="none"
|
46
45
|
minWidth="xs"
|
47
46
|
options={options}
|
48
|
-
{...props}
|
49
47
|
/>
|
50
48
|
</Radio>
|
51
49
|
<Radio
|
@@ -56,12 +54,9 @@ const RadioChildren = (props) => {
|
|
56
54
|
value="Typography"
|
57
55
|
{...props}
|
58
56
|
>
|
59
|
-
<Title
|
60
|
-
text="Custom Typography"
|
61
|
-
{...props}
|
62
|
-
/>
|
57
|
+
<Title text="Custom Typography" />
|
63
58
|
</Radio>
|
64
59
|
</div>
|
65
60
|
)
|
66
61
|
}
|
67
|
-
export default RadioChildren
|
62
|
+
export default RadioChildren
|