playbook_ui_docs 14.12.0.pre.rc.11 → 14.12.0.pre.rc.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_no_subrows.jsx +50 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination.jsx +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.jsx +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows.jsx +60 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows.md +5 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions.jsx +78 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header.jsx +53 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows.jsx +52 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows.md +1 -0
- 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/advanced_table_mock_data_no_subrows.json +42 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_mock_data_with_id.json +299 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +5 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +6 -1
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_turbo_frames.html.erb +13 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_turbo_frames_rails.md +3 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_behavior.jsx +38 -0
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.jsx +3 -45
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.jsx +0 -1
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_default.jsx +9 -16
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.jsx +44 -19
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.md +21 -3
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx +16 -21
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_sizes.jsx +2 -19
- data/app/pb_kits/playbook/pb_drawer/docs/example.yml +2 -1
- data/app/pb_kits/playbook/pb_drawer/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subtle_variant.md +1 -1
- data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_default.html.erb +3 -0
- data/app/pb_kits/playbook/pb_icon_button/docs/example.yml +7 -0
- data/app/pb_kits/playbook/pb_radio/docs/_radio_custom_children.jsx +8 -3
- data/app/pb_kits/playbook/pb_selectable_icon/docs/_selectable_icon_default.jsx +4 -1
- data/app/pb_kits/playbook/pb_selectable_icon/docs/_selectable_icon_single_select.jsx +4 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.html.erb +47 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_rails.md +2 -0
- data/app/pb_kits/playbook/pb_table/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask.html.erb +46 -0
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask_rails.md +3 -0
- data/app/pb_kits/playbook/pb_text_input/docs/example.yml +2 -1
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.html.erb +19 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.jsx +27 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.md +1 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/index.js +1 -0
- data/dist/playbook-doc.js +1 -1
- metadata +26 -3
- /data/app/pb_kits/playbook/pb_table/docs/{_table_with_collapsible.md → _table_with_collapsible_react.md} +0 -0
@@ -1,24 +1,25 @@
|
|
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
|
-
|
10
|
+
const toggleNoOverlayDrawer = () =>
|
11
|
+
setOpenedNoOverlayDrawer(!openedNoOverlayDrawer)
|
12
|
+
const toggleOverlayDrawer = () => setOpenedOverlayDrawer(!openedOverlayDrawer)
|
12
13
|
|
13
14
|
return (
|
14
15
|
<>
|
15
16
|
<Flex wrap>
|
16
|
-
<Button marginRight=
|
17
|
+
<Button marginRight='md'
|
17
18
|
onClick={toggleNoOverlayDrawer}
|
18
19
|
>
|
19
20
|
No Overlay Drawer
|
20
21
|
</Button>
|
21
|
-
<Button marginRight=
|
22
|
+
<Button marginRight='md'
|
22
23
|
onClick={toggleOverlayDrawer}
|
23
24
|
>
|
24
25
|
Overlay Drawer
|
@@ -27,29 +28,23 @@ const DrawerSizes = () => {
|
|
27
28
|
|
28
29
|
{/* Drawers for each size */}
|
29
30
|
<Drawer
|
30
|
-
behavior="push"
|
31
|
-
fullHeight
|
32
31
|
onClose={toggleNoOverlayDrawer}
|
33
32
|
opened={openedNoOverlayDrawer}
|
34
33
|
overlay={false}
|
35
|
-
|
36
|
-
size="lg"
|
34
|
+
size='lg'
|
37
35
|
>
|
38
36
|
This is a Drawer with no overlay
|
39
37
|
</Drawer>
|
40
38
|
<Drawer
|
41
|
-
behavior="push"
|
42
|
-
fullHeight
|
43
39
|
onClose={toggleOverlayDrawer}
|
44
40
|
opened={openedOverlayDrawer}
|
45
|
-
|
46
|
-
|
47
|
-
size="lg"
|
41
|
+
placement='right'
|
42
|
+
size='lg'
|
48
43
|
>
|
49
|
-
This is a Drawer with an overlay
|
44
|
+
This is a Drawer with an overlay
|
50
45
|
</Drawer>
|
51
46
|
</>
|
52
|
-
)
|
53
|
-
}
|
47
|
+
)
|
48
|
+
}
|
54
49
|
|
55
|
-
export default DrawerSizes
|
50
|
+
export default DrawerSizes
|
@@ -19,7 +19,8 @@ const DrawerSizes = () => {
|
|
19
19
|
return (
|
20
20
|
<>
|
21
21
|
<Flex wrap>
|
22
|
-
<Button
|
22
|
+
<Button
|
23
|
+
marginRight="md"
|
23
24
|
onClick={toggleXsDrawer}
|
24
25
|
>
|
25
26
|
XS Drawer
|
@@ -48,11 +49,8 @@ const DrawerSizes = () => {
|
|
48
49
|
|
49
50
|
{/* Drawers for each size */}
|
50
51
|
<Drawer
|
51
|
-
behavior="push"
|
52
|
-
fullHeight
|
53
52
|
onClose={toggleXsDrawer}
|
54
53
|
opened={openedXsDrawer}
|
55
|
-
overlay
|
56
54
|
placement="right"
|
57
55
|
size="xs"
|
58
56
|
>
|
@@ -60,47 +58,32 @@ const DrawerSizes = () => {
|
|
60
58
|
</Drawer>
|
61
59
|
|
62
60
|
<Drawer
|
63
|
-
behavior="push"
|
64
|
-
fullHeight
|
65
61
|
onClose={toggleSmDrawer}
|
66
62
|
opened={openedSmDrawer}
|
67
|
-
overlay
|
68
|
-
placement="right"
|
69
63
|
size="sm"
|
70
64
|
>
|
71
65
|
This is an SM Drawer
|
72
66
|
</Drawer>
|
73
67
|
|
74
68
|
<Drawer
|
75
|
-
behavior="push"
|
76
|
-
fullHeight
|
77
69
|
onClose={toggleMdDrawer}
|
78
70
|
opened={openedMdDrawer}
|
79
|
-
overlay
|
80
71
|
placement="right"
|
81
|
-
size="md"
|
82
72
|
>
|
83
73
|
This is an MD Drawer
|
84
74
|
</Drawer>
|
85
75
|
|
86
76
|
<Drawer
|
87
|
-
behavior="push"
|
88
|
-
fullHeight
|
89
77
|
onClose={toggleLgDrawer}
|
90
78
|
opened={openedLgDrawer}
|
91
|
-
overlay
|
92
|
-
placement="right"
|
93
79
|
size="lg"
|
94
80
|
>
|
95
81
|
This is an LG Drawer
|
96
82
|
</Drawer>
|
97
83
|
|
98
84
|
<Drawer
|
99
|
-
behavior="push"
|
100
|
-
fullHeight
|
101
85
|
onClose={toggleXlDrawer}
|
102
86
|
opened={openedXlDrawer}
|
103
|
-
overlay
|
104
87
|
placement="right"
|
105
88
|
size="xl"
|
106
89
|
>
|
@@ -4,3 +4,4 @@ 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
|
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.
|
@@ -29,6 +29,7 @@ const RadioChildren = (props) => {
|
|
29
29
|
marginBottom="none"
|
30
30
|
minWidth="xs"
|
31
31
|
options={options}
|
32
|
+
{...props}
|
32
33
|
/>
|
33
34
|
</Radio>
|
34
35
|
<Radio
|
@@ -40,10 +41,11 @@ const RadioChildren = (props) => {
|
|
40
41
|
value="Typeahead"
|
41
42
|
{...props}
|
42
43
|
>
|
43
|
-
<Typeahead
|
44
|
+
<Typeahead
|
44
45
|
marginBottom="none"
|
45
46
|
minWidth="xs"
|
46
47
|
options={options}
|
48
|
+
{...props}
|
47
49
|
/>
|
48
50
|
</Radio>
|
49
51
|
<Radio
|
@@ -54,9 +56,12 @@ const RadioChildren = (props) => {
|
|
54
56
|
value="Typography"
|
55
57
|
{...props}
|
56
58
|
>
|
57
|
-
<Title
|
59
|
+
<Title
|
60
|
+
text="Custom Typography"
|
61
|
+
{...props}
|
62
|
+
/>
|
58
63
|
</Radio>
|
59
64
|
</div>
|
60
65
|
)
|
61
66
|
}
|
62
|
-
export default RadioChildren
|
67
|
+
export default RadioChildren
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React, { useState } from 'react'
|
2
2
|
import SelectableIcon from '../_selectable_icon'
|
3
3
|
|
4
|
-
const SelectableIconDefault = () => {
|
4
|
+
const SelectableIconDefault = (props) => {
|
5
5
|
const [ checkSelected, toggleSelected ] = useState(true)
|
6
6
|
const [ checkUnselected, toggleUnselected ] = useState(false)
|
7
7
|
const [ checkDisabled, toggleDisabled ] = useState(false)
|
@@ -15,6 +15,7 @@ const SelectableIconDefault = () => {
|
|
15
15
|
inputId={10}
|
16
16
|
onChange={() => toggleSelected(!checkSelected)}
|
17
17
|
text="US Dollar"
|
18
|
+
{...props}
|
18
19
|
/>
|
19
20
|
|
20
21
|
<SelectableIcon
|
@@ -23,6 +24,7 @@ const SelectableIconDefault = () => {
|
|
23
24
|
inputId={11}
|
24
25
|
onChange={() => toggleUnselected(!checkUnselected)}
|
25
26
|
text="Euro"
|
27
|
+
{...props}
|
26
28
|
/>
|
27
29
|
|
28
30
|
<SelectableIcon
|
@@ -32,6 +34,7 @@ const SelectableIconDefault = () => {
|
|
32
34
|
inputId={12}
|
33
35
|
onChange={() => toggleDisabled(!checkDisabled)}
|
34
36
|
text="Yen"
|
37
|
+
{...props}
|
35
38
|
/>
|
36
39
|
</div>
|
37
40
|
)
|
@@ -2,7 +2,7 @@ import React, { useState } from 'react'
|
|
2
2
|
|
3
3
|
import SelectableIcon from '../_selectable_icon'
|
4
4
|
|
5
|
-
const SelectableIconSingleSelect = () => {
|
5
|
+
const SelectableIconSingleSelect = (props) => {
|
6
6
|
const [ selectedFormat, toggleFormat ] = useState(null)
|
7
7
|
|
8
8
|
return (
|
@@ -17,6 +17,7 @@ const SelectableIconSingleSelect = () => {
|
|
17
17
|
onChange={() => toggleFormat('Cassette')}
|
18
18
|
text="Cassette"
|
19
19
|
value="Cassette"
|
20
|
+
{...props}
|
20
21
|
/>
|
21
22
|
|
22
23
|
<SelectableIcon
|
@@ -28,6 +29,7 @@ const SelectableIconSingleSelect = () => {
|
|
28
29
|
onChange={() => toggleFormat('CD')}
|
29
30
|
text="CD"
|
30
31
|
value="CD"
|
32
|
+
{...props}
|
31
33
|
/>
|
32
34
|
|
33
35
|
<SelectableIcon
|
@@ -39,6 +41,7 @@ const SelectableIconSingleSelect = () => {
|
|
39
41
|
onChange={() => toggleFormat('Vinyl')}
|
40
42
|
text="Vinyl"
|
41
43
|
value="Vinyl"
|
44
|
+
{...props}
|
42
45
|
/>
|
43
46
|
</div>
|
44
47
|
)
|
@@ -0,0 +1,47 @@
|
|
1
|
+
<% content = capture do %>
|
2
|
+
<%= pb_rails("card", props: { border_none: true, border_radius: "none", padding: "md" }) do %>
|
3
|
+
<%= pb_rails("body", props: { text: "Nested content inside a Table Row" }) %>
|
4
|
+
<% end %>
|
5
|
+
<% end %>
|
6
|
+
|
7
|
+
<%= pb_rails("table", props: { size: "sm" }) do %>
|
8
|
+
<%= pb_rails("table/table_head") do %>
|
9
|
+
<%= pb_rails("table/table_row") do %>
|
10
|
+
<%= pb_rails("table/table_header", props: { text: "Column 1"}) %>
|
11
|
+
<%= pb_rails("table/table_header", props: { text: "Column 2"}) %>
|
12
|
+
<%= pb_rails("table/table_header", props: { text: "Column 3"}) %>
|
13
|
+
<%= pb_rails("table/table_header", props: { text: "Column 4"}) %>
|
14
|
+
<%= pb_rails("table/table_header", props: { text: "Column 5"}) %>
|
15
|
+
<%= pb_rails("table/table_header", props: { text: ""}) %>
|
16
|
+
<% end %>
|
17
|
+
<% end %>
|
18
|
+
<%= pb_rails("table/table_body") do %>
|
19
|
+
<%= pb_rails("table/table_row", props: { collapsible: true, collapsible_content: content, collapsible_side_highlight: true, id: "1" }) do %>
|
20
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 1"}) %>
|
21
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 2"}) %>
|
22
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 3"}) %>
|
23
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 4"}) %>
|
24
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 5"}) %>
|
25
|
+
<%= pb_rails("table/table_cell", props: { text_align: "right"}) do %>
|
26
|
+
<%= pb_rails("icon", props: { icon: "chevron-down", fixed_width: true, color: "primary" }) %>
|
27
|
+
<% end %>
|
28
|
+
<% end %>
|
29
|
+
<%= pb_rails("table/table_row") do %>
|
30
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 1"}) %>
|
31
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 2"}) %>
|
32
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 3"}) %>
|
33
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 4"}) %>
|
34
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 5"}) %>
|
35
|
+
<%= pb_rails("table/table_cell", props: { text: ""}) %>
|
36
|
+
<% end %>
|
37
|
+
<%= pb_rails("table/table_row") do %>
|
38
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 1"}) %>
|
39
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 2"}) %>
|
40
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 3"}) %>
|
41
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 4"}) %>
|
42
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 5"}) %>
|
43
|
+
<%= pb_rails("table/table_cell", props: { text: ""}) %>
|
44
|
+
<% end %>
|
45
|
+
<% end %>
|
46
|
+
<% end %>
|
47
|
+
|
@@ -0,0 +1,2 @@
|
|
1
|
+
The `collapsible` prop can be used on any Table Row to add a collapsible area. Use the additional `collapsible_content` prop to add any content to the collapsible Row.
|
2
|
+
Please be aware that you will need to pass in an `id` to any table rows you want to be collapsible. Make sure every `id` is unique if you are using multipe collapsibles.
|
@@ -30,6 +30,7 @@ examples:
|
|
30
30
|
- table_with_subcomponents_rails: Table with Sub Components (Table Elements)
|
31
31
|
- table_with_subcomponents_as_divs: Table with Sub Components (Divs)
|
32
32
|
- table_outer_padding: Outer Padding
|
33
|
+
- table_with_collapsible: Table with Collapsible
|
33
34
|
|
34
35
|
react:
|
35
36
|
- table_sm: Small
|
@@ -0,0 +1,46 @@
|
|
1
|
+
<%= pb_rails("text_input", props: {
|
2
|
+
label: "Currency",
|
3
|
+
mask: "currency",
|
4
|
+
margin_bottom: "md",
|
5
|
+
name: "currency_name",
|
6
|
+
placeholder:"$0.00"
|
7
|
+
}) %>
|
8
|
+
|
9
|
+
<%= pb_rails("text_input", props: {
|
10
|
+
label: "ZIP Code",
|
11
|
+
mask: "zip_code",
|
12
|
+
margin_bottom: "md",
|
13
|
+
placeholder: "12345"
|
14
|
+
}) %>
|
15
|
+
|
16
|
+
<%= pb_rails("text_input", props: {
|
17
|
+
label: "Postal Code",
|
18
|
+
mask: "postal_code",
|
19
|
+
placeholder: "12345-6789",
|
20
|
+
margin_bottom: "md",
|
21
|
+
}) %>
|
22
|
+
|
23
|
+
<%= pb_rails("text_input", props: {
|
24
|
+
label: "SSN",
|
25
|
+
mask: "ssn",
|
26
|
+
margin_bottom: "md",
|
27
|
+
placeholder: "123-45-6789"
|
28
|
+
}) %>
|
29
|
+
|
30
|
+
<%= pb_rails("title" , props: {
|
31
|
+
text: "Hidden Input Under The Hood",
|
32
|
+
padding_bottom: "sm"
|
33
|
+
})%>
|
34
|
+
|
35
|
+
<%= pb_rails("text_input", props: {
|
36
|
+
label: "Currency",
|
37
|
+
mask: "currency",
|
38
|
+
margin_bottom: "md",
|
39
|
+
name: "currency_name",
|
40
|
+
id: "example-currency",
|
41
|
+
placeholder: "$0.00",
|
42
|
+
}) %>
|
43
|
+
|
44
|
+
<style>
|
45
|
+
#example-currency-sanitized {display: flex !important;}
|
46
|
+
</style>
|
@@ -8,6 +8,7 @@ examples:
|
|
8
8
|
- text_input_inline: Inline
|
9
9
|
- text_input_no_label: No Label
|
10
10
|
- text_input_options: Input Options
|
11
|
+
- text_input_mask: Mask
|
11
12
|
react:
|
12
13
|
- text_input_default: Default
|
13
14
|
- text_input_error: With Error
|
@@ -23,4 +24,4 @@ examples:
|
|
23
24
|
- text_input_error_swift: With Error
|
24
25
|
- text_input_disabled_swift: Disabled
|
25
26
|
- text_input_add_on_swift: Add On
|
26
|
-
- text_input_props_swift: ""
|
27
|
+
- text_input_props_swift: ""
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<%
|
2
|
+
names = [
|
3
|
+
{ label: 'Alexander Nathaniel Montgomery', value: 'Alexander Nathaniel Montgomery' },
|
4
|
+
{ label: 'Isabella Anastasia Wellington', value: 'Isabella Anastasia Wellington' },
|
5
|
+
{ label: 'Christopher Maximilian Harrington', value: 'Christopher Maximilian Harrington' },
|
6
|
+
{ label: 'Elizabeth Seraphina Kensington', value: 'Elizabeth Seraphina Kensington' },
|
7
|
+
{ label: 'Theodore Jonathan Abernathy', value: 'Theodore Jonathan Abernathy' },
|
8
|
+
]
|
9
|
+
%>
|
10
|
+
|
11
|
+
<%= pb_rails("typeahead", props: {
|
12
|
+
html_options: { style: { maxWidth: "240px" }},
|
13
|
+
id: "typeahead-form-pill",
|
14
|
+
is_multi: true,
|
15
|
+
options: names,
|
16
|
+
label: "Truncation Within Typeahead",
|
17
|
+
pills: true,
|
18
|
+
truncate: 1,
|
19
|
+
}) %>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import { Typeahead } from 'playbook-ui'
|
3
|
+
|
4
|
+
const names = [
|
5
|
+
{ label: 'Alexander Nathaniel Montgomery', value: 'Alexander Nathaniel Montgomery' },
|
6
|
+
{ label: 'Isabella Anastasia Wellington', value: 'Isabella Anastasia Wellington' },
|
7
|
+
{ label: 'Christopher Maximilian Harrington', value: 'Christopher Maximilian Harrington' },
|
8
|
+
{ label: 'Elizabeth Seraphina Kensington', value: 'Elizabeth Seraphina Kensington' },
|
9
|
+
{ label: 'Theodore Jonathan Abernathy', value: 'Theodore Jonathan Abernathy' },
|
10
|
+
]
|
11
|
+
|
12
|
+
const TypeaheadTruncatedText = (props) => {
|
13
|
+
return (
|
14
|
+
<>
|
15
|
+
<Typeahead
|
16
|
+
htmlOptions={{ style: { maxWidth: "240px" }}}
|
17
|
+
isMulti
|
18
|
+
label="Truncation Within Typeahead"
|
19
|
+
options={names}
|
20
|
+
truncate={1}
|
21
|
+
{...props}
|
22
|
+
/>
|
23
|
+
</>
|
24
|
+
)
|
25
|
+
}
|
26
|
+
|
27
|
+
export default TypeaheadTruncatedText
|
@@ -0,0 +1 @@
|
|
1
|
+
For Form Pills with longer text, the `truncate` global prop can be used to truncate the label within each Form Pill. Hover over the truncated Form Pill and a Tooltip containing the text or tag section of the Form Pill will appear. See [here](https://playbook.powerapp.cloud/visual_guidelines/truncate) for more information on the truncate global prop.
|
@@ -11,6 +11,7 @@ examples:
|
|
11
11
|
- typeahead_error_state: Error State
|
12
12
|
- typeahead_margin_bottom: Margin Bottom
|
13
13
|
- typeahead_with_pills_color: With Pills (Custom Color)
|
14
|
+
- typeahead_truncated_text: Truncated Text
|
14
15
|
|
15
16
|
react:
|
16
17
|
- typeahead_default: Default
|
@@ -27,3 +28,4 @@ examples:
|
|
27
28
|
- typeahead_custom_menu_list: Custom MenuList
|
28
29
|
- typeahead_margin_bottom: Margin Bottom
|
29
30
|
- typeahead_with_pills_color: With Pills (Custom Color)
|
31
|
+
- typeahead_truncated_text: Truncated Text
|
@@ -12,3 +12,4 @@ export { default as TypeaheadErrorState } from './_typeahead_error_state.jsx'
|
|
12
12
|
export { default as TypeaheadCustomMenuList } from './_typeahead_custom_menu_list.jsx'
|
13
13
|
export { default as TypeaheadMarginBottom } from './_typeahead_margin_bottom.jsx'
|
14
14
|
export { default as TypeaheadWithPillsColor } from './_typeahead_with_pills_color.jsx'
|
15
|
+
export { default as TypeaheadTruncatedText } from './_typeahead_truncated_text.jsx'
|