playbook_ui_docs 14.4.0.pre.rc.15 → 14.5.0.pre.alpha.javascriptassets3926
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_date_picker/docs/_date_picker_inline.html.erb +1 -1
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.jsx +117 -0
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.jsx +43 -0
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_default.html.erb +1 -0
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_default.jsx +63 -0
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx +55 -0
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_sizes.jsx +113 -0
- data/app/pb_kits/playbook/pb_drawer/docs/example.yml +12 -0
- data/app/pb_kits/playbook/pb_drawer/docs/index.js +5 -0
- data/app/pb_kits/playbook/pb_filter/docs/_filter_default.html.erb +10 -2
- data/app/pb_kits/playbook/pb_filter/docs/_filter_max_height.html.erb +5 -1
- data/app/pb_kits/playbook/pb_filter/docs/_filter_max_width.html.erb +5 -1
- data/app/pb_kits/playbook/pb_filter/docs/_filter_no_background.html.erb +5 -1
- data/app/pb_kits/playbook/pb_filter/docs/_filter_no_sort.html.erb +5 -1
- data/app/pb_kits/playbook/pb_filter/docs/_filter_only.html.erb +5 -1
- data/app/pb_kits/playbook/pb_filter/docs/_filter_placement.html.erb +5 -1
- data/app/pb_kits/playbook/pb_filter/docs/_filter_single.html.erb +5 -1
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_bubble.html.erb +73 -0
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_bubble.jsx +86 -0
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_pagination/docs/_pagination_page_change.jsx +12 -1
- data/app/pb_kits/playbook/pb_pagination/docs/_pagination_page_change_react.md +3 -1
- data/app/pb_kits/playbook/pb_popover/docs/_popover_list.html.erb +14 -13
- data/app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx +4 -4
- data/app/pb_kits/playbook/pb_radio/docs/_radio_custom_children.html.erb +2 -0
- data/app/pb_kits/playbook/pb_radio/docs/_radio_custom_children.jsx +62 -0
- data/app/pb_kits/playbook/pb_radio/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_radio/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_margin_bottom.html.erb +88 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_margin_bottom.jsx +60 -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 +15 -2
@@ -0,0 +1,86 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
|
3
|
+
import MultipleUsersStacked from '../_multiple_users_stacked'
|
4
|
+
|
5
|
+
const MultipleUsersStackedBubble = (props) => {
|
6
|
+
return (
|
7
|
+
<div>
|
8
|
+
<MultipleUsersStacked
|
9
|
+
users={[
|
10
|
+
{
|
11
|
+
name: 'Patrick Welch',
|
12
|
+
imageUrl: 'https://randomuser.me/api/portraits/men/9.jpg',
|
13
|
+
},
|
14
|
+
]}
|
15
|
+
variant="bubble"
|
16
|
+
{...props}
|
17
|
+
/>
|
18
|
+
<br />
|
19
|
+
<br />
|
20
|
+
<MultipleUsersStacked
|
21
|
+
users={[
|
22
|
+
{
|
23
|
+
name: 'Patrick Welch',
|
24
|
+
imageUrl: 'https://randomuser.me/api/portraits/men/9.jpg',
|
25
|
+
},
|
26
|
+
{
|
27
|
+
name: 'Lucille Sanchez',
|
28
|
+
imageUrl: 'https://randomuser.me/api/portraits/women/6.jpg',
|
29
|
+
},
|
30
|
+
]}
|
31
|
+
variant="bubble"
|
32
|
+
{...props}
|
33
|
+
/>
|
34
|
+
<br />
|
35
|
+
<br />
|
36
|
+
<MultipleUsersStacked
|
37
|
+
users={[
|
38
|
+
{
|
39
|
+
name: 'Patrick Welch',
|
40
|
+
imageUrl: 'https://randomuser.me/api/portraits/men/9.jpg',
|
41
|
+
},
|
42
|
+
{
|
43
|
+
name: 'Lucille Sanchez',
|
44
|
+
imageUrl: 'https://randomuser.me/api/portraits/women/6.jpg',
|
45
|
+
},
|
46
|
+
{
|
47
|
+
name: 'Beverly Reyes',
|
48
|
+
imageUrl: 'https://randomuser.me/api/portraits/women/74.jpg',
|
49
|
+
},
|
50
|
+
]}
|
51
|
+
variant="bubble"
|
52
|
+
{...props}
|
53
|
+
/>
|
54
|
+
<br />
|
55
|
+
<br />
|
56
|
+
<MultipleUsersStacked
|
57
|
+
users={[
|
58
|
+
{
|
59
|
+
name: 'Patrick Welch',
|
60
|
+
imageUrl: 'https://randomuser.me/api/portraits/men/9.jpg',
|
61
|
+
},
|
62
|
+
{
|
63
|
+
name: 'Lucille Sanchez',
|
64
|
+
imageUrl: 'https://randomuser.me/api/portraits/women/6.jpg',
|
65
|
+
},
|
66
|
+
{
|
67
|
+
name: 'Beverly Reyes',
|
68
|
+
imageUrl: 'https://randomuser.me/api/portraits/women/74.jpg',
|
69
|
+
},
|
70
|
+
{
|
71
|
+
name: 'Keith Craig',
|
72
|
+
imageUrl: 'https://randomuser.me/api/portraits/men/40.jpg',
|
73
|
+
},
|
74
|
+
{
|
75
|
+
name: 'Alicia Cooper',
|
76
|
+
imageUrl: 'https://randomuser.me/api/portraits/women/46.jpg',
|
77
|
+
},
|
78
|
+
]}
|
79
|
+
variant="bubble"
|
80
|
+
{...props}
|
81
|
+
/>
|
82
|
+
</div>
|
83
|
+
)
|
84
|
+
}
|
85
|
+
|
86
|
+
export default MultipleUsersStackedBubble
|
@@ -2,10 +2,12 @@ examples:
|
|
2
2
|
|
3
3
|
rails:
|
4
4
|
- multiple_users_stacked_default: Default
|
5
|
+
- multiple_users_stacked_bubble: Bubble
|
5
6
|
|
6
7
|
|
7
8
|
react:
|
8
9
|
- multiple_users_stacked_default: Default
|
10
|
+
- multiple_users_stacked_bubble: Bubble
|
9
11
|
|
10
12
|
swift:
|
11
13
|
- multiple_users_stacked_default_swift: Default
|
@@ -22,6 +22,16 @@ const PaginationPageChange = (props) => {
|
|
22
22
|
|
23
23
|
return (
|
24
24
|
<div className="App">
|
25
|
+
<Pagination
|
26
|
+
current={activePage}
|
27
|
+
key={`pagination-top-${activePage}`}
|
28
|
+
marginBottom="xs"
|
29
|
+
onChange={onPageChange}
|
30
|
+
range={5}
|
31
|
+
total={totalPages}
|
32
|
+
{...props}
|
33
|
+
/>
|
34
|
+
|
25
35
|
<Table
|
26
36
|
marginBottom="xs"
|
27
37
|
responsive="none"
|
@@ -49,7 +59,8 @@ const PaginationPageChange = (props) => {
|
|
49
59
|
</Table>
|
50
60
|
|
51
61
|
<Pagination
|
52
|
-
current={
|
62
|
+
current={activePage}
|
63
|
+
key={`pagination-bottom-${activePage}`}
|
53
64
|
onChange={onPageChange}
|
54
65
|
range={5}
|
55
66
|
total={totalPages}
|
@@ -1 +1,3 @@
|
|
1
|
-
You can use the `onChange` prop to control the data of your table. This prop is callback function that will allow you control the state.
|
1
|
+
You can use the `onChange` prop to control the data of your table. This prop is callback function that will allow you control the state.
|
2
|
+
|
3
|
+
To ensure synchronization between multiple pagination components on a single page, use unique, dynamic keys for each pagination instance. Each Pagination component should have its own dynamic key that reflects the current active page: this example uses `pagination-top-${activePage}` and `pagination-bottom-${activePage}`.
|
@@ -1,8 +1,10 @@
|
|
1
1
|
<%= pb_rails("button", props: { variant: "secondary", id: 'list' }) do %>
|
2
2
|
<%= pb_rails("flex", props: {align: "center"}) do %>
|
3
|
-
Filter By
|
3
|
+
Filter By
|
4
4
|
<%= pb_rails("flex/flex_item", props: {margin_left: "xxs"}) do %>
|
5
|
-
|
5
|
+
<div id="arrow-icon" style="display: flex">
|
6
|
+
<%= pb_rails("icon", props: { icon: "chevron-down", fixed_width: true }) %>
|
7
|
+
</div>
|
6
8
|
<% end %>
|
7
9
|
<% end %>
|
8
10
|
<% end %>
|
@@ -18,18 +20,17 @@
|
|
18
20
|
|
19
21
|
|
20
22
|
<script type="text/javascript">
|
21
|
-
const
|
22
|
-
let buttonClicked = false
|
23
|
+
const popoverButton = document.querySelector("#list")
|
24
|
+
let buttonClicked = false
|
23
25
|
|
24
|
-
const arrowDiv = document.querySelector("#arrow-icon")
|
25
|
-
arrowDiv.innerHTML = '<i class="far fa-angle-down"></i>'
|
26
|
+
const arrowDiv = document.querySelector("#arrow-icon")
|
26
27
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
28
|
+
popoverButton.onclick = () => {
|
29
|
+
buttonClicked = !buttonClicked
|
30
|
+
if (buttonClicked) {
|
31
|
+
arrowDiv.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="auto" height="auto" viewBox="0 0 31 25" fill="none" class="pb_custom_icon svg-inline--fa pb_icon_kit svg_fw" id="" data="{}" aria="{}" tabindex=""><path d="M14.2031 5.70312C14.625 5.28125 15.3281 5.28125 15.75 5.70312L24.7969 14.7031C25.2188 15.1719 25.2188 15.875 24.7969 16.2969C24.3281 16.7656 23.625 16.7656 23.2031 16.2969L15 8.09375L6.79688 16.2969C6.32812 16.7656 5.625 16.7656 5.20312 16.2969C4.73438 15.875 4.73438 15.1719 5.20312 14.75L14.2031 5.70312Z" fill="currentColor"/></svg>'
|
32
|
+
} else {
|
33
|
+
arrowDiv.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="auto" height="auto" viewBox="0 0 31 25" fill="none" class="pb_custom_icon svg-inline--fa pb_icon_kit svg_fw" id="" data="{}" aria="{}" tabindex=""><path d="M14.2031 19.2969L5.20312 10.2969C4.73438 9.875 4.73438 9.17188 5.20312 8.70312C5.625 8.28125 6.32812 8.28125 6.79688 8.70312L15 16.9531L23.2031 8.75C23.625 8.28125 24.3281 8.28125 24.7969 8.75C25.2188 9.17188 25.2188 9.875 24.7969 10.2969L15.75 19.2969C15.3281 19.7656 14.625 19.7656 14.2031 19.2969Z" fill="currentColor"/></svg>'
|
34
|
+
}
|
33
35
|
}
|
34
|
-
}
|
35
36
|
</script>
|
@@ -26,10 +26,10 @@ const PopoverWithButton = (props) => {
|
|
26
26
|
className={showPopover ? "fa-flip-vertical" : ""}
|
27
27
|
display="inline_flex"
|
28
28
|
>
|
29
|
-
<Icon
|
30
|
-
fixedWidth
|
31
|
-
icon="angle-down"
|
32
|
-
margin-left="xxs"
|
29
|
+
<Icon
|
30
|
+
fixedWidth
|
31
|
+
icon="angle-down"
|
32
|
+
margin-left="xxs"
|
33
33
|
/>
|
34
34
|
</Flex>
|
35
35
|
</Flex>
|
@@ -10,6 +10,7 @@
|
|
10
10
|
<%= pb_rails("radio", props: {
|
11
11
|
custom_children: true,
|
12
12
|
label: "Select",
|
13
|
+
margin_bottom: "sm",
|
13
14
|
name: "Group1",
|
14
15
|
value: "Select",
|
15
16
|
}) do %>
|
@@ -22,6 +23,7 @@
|
|
22
23
|
<%= pb_rails("radio", props: {
|
23
24
|
custom_children: true,
|
24
25
|
label: "Typeahead",
|
26
|
+
margin_bottom: "sm",
|
25
27
|
name: "Group1",
|
26
28
|
value: "Typeahead",
|
27
29
|
}) do %>
|
@@ -0,0 +1,62 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import Radio from '../_radio'
|
3
|
+
import Select from '../../pb_select/_select'
|
4
|
+
import Typeahead from '../../pb_typeahead/_typeahead'
|
5
|
+
import Title from '../../pb_title/_title'
|
6
|
+
|
7
|
+
const RadioChildren = (props) => {
|
8
|
+
|
9
|
+
|
10
|
+
const options = [
|
11
|
+
{ label: 'Orange', value: 'Orange' },
|
12
|
+
{ label: 'Red', value: 'Red' },
|
13
|
+
{ label: 'Green', value: 'Green' },
|
14
|
+
{ label: 'Blue', value: 'Blue' },
|
15
|
+
]
|
16
|
+
|
17
|
+
return (
|
18
|
+
<div>
|
19
|
+
<Radio
|
20
|
+
customChildren
|
21
|
+
label="Select"
|
22
|
+
marginBottom="sm"
|
23
|
+
name="Group1"
|
24
|
+
tabIndex={0}
|
25
|
+
value="Select"
|
26
|
+
{...props}
|
27
|
+
>
|
28
|
+
<Select
|
29
|
+
marginBottom="none"
|
30
|
+
minWidth="xs"
|
31
|
+
options={options}
|
32
|
+
/>
|
33
|
+
</Radio>
|
34
|
+
<Radio
|
35
|
+
customChildren
|
36
|
+
label="Typeahead"
|
37
|
+
marginBottom="sm"
|
38
|
+
name="Group1"
|
39
|
+
tabIndex={0}
|
40
|
+
value="Typeahead"
|
41
|
+
{...props}
|
42
|
+
>
|
43
|
+
<Typeahead
|
44
|
+
marginBottom="none"
|
45
|
+
minWidth="xs"
|
46
|
+
options={options}
|
47
|
+
/>
|
48
|
+
</Radio>
|
49
|
+
<Radio
|
50
|
+
customChildren
|
51
|
+
defaultChecked={false}
|
52
|
+
label="Typography"
|
53
|
+
name="Group1"
|
54
|
+
value="Typography"
|
55
|
+
{...props}
|
56
|
+
>
|
57
|
+
<Title text="Custom Typography" />
|
58
|
+
</Radio>
|
59
|
+
</div>
|
60
|
+
)
|
61
|
+
}
|
62
|
+
export default RadioChildren
|
@@ -3,3 +3,4 @@ export { default as RadioCustom } from './_radio_custom.jsx'
|
|
3
3
|
export { default as RadioError } from './_radio_error.jsx'
|
4
4
|
export { default as RadioAlignment } from './_radio_alignment.jsx'
|
5
5
|
export { default as RadioDisabled } from './_radio_disabled.jsx'
|
6
|
+
export { default as RadioCustomChildren } from './_radio_custom_children.jsx'
|
@@ -0,0 +1,88 @@
|
|
1
|
+
<%
|
2
|
+
options = [
|
3
|
+
{ label: 'Orange', value: '#FFA500' },
|
4
|
+
{ label: 'Red', value: '#FF0000' },
|
5
|
+
{ label: 'Green', value: '#00FF00' },
|
6
|
+
{ label: 'Blue', value: '#0000FF' },
|
7
|
+
]
|
8
|
+
%>
|
9
|
+
|
10
|
+
<%= pb_rails("typeahead", props: {
|
11
|
+
id: "typeahead-default",
|
12
|
+
placeholder: "All Colors",
|
13
|
+
options: options,
|
14
|
+
label: "None",
|
15
|
+
name: :foo,
|
16
|
+
is_multi: false,
|
17
|
+
margin_bottom: "none",
|
18
|
+
})
|
19
|
+
%>
|
20
|
+
<%= pb_rails("typeahead", props: {
|
21
|
+
id: "typeahead-default",
|
22
|
+
placeholder: "All Colors",
|
23
|
+
options: options,
|
24
|
+
label: "XXS",
|
25
|
+
name: :foo,
|
26
|
+
is_multi: false,
|
27
|
+
margin_bottom: "xxs",
|
28
|
+
})
|
29
|
+
%>
|
30
|
+
<%= pb_rails("typeahead", props: {
|
31
|
+
id: "typeahead-default",
|
32
|
+
placeholder: "All Colors",
|
33
|
+
options: options,
|
34
|
+
label: "XS",
|
35
|
+
name: :foo,
|
36
|
+
is_multi: false,
|
37
|
+
margin_bottom: "xs",
|
38
|
+
})
|
39
|
+
%>
|
40
|
+
<%= pb_rails("typeahead", props: {
|
41
|
+
id: "typeahead-default",
|
42
|
+
placeholder: "All Colors",
|
43
|
+
options: options,
|
44
|
+
label: "Default - SM",
|
45
|
+
name: :foo,
|
46
|
+
is_multi: false,
|
47
|
+
})
|
48
|
+
%>
|
49
|
+
<%= pb_rails("typeahead", props: {
|
50
|
+
id: "typeahead-default",
|
51
|
+
placeholder: "All Colors",
|
52
|
+
options: options,
|
53
|
+
label: "MD",
|
54
|
+
name: :foo,
|
55
|
+
is_multi: false,
|
56
|
+
margin_bottom: "md",
|
57
|
+
})
|
58
|
+
%>
|
59
|
+
<%= pb_rails("typeahead", props: {
|
60
|
+
id: "typeahead-default",
|
61
|
+
placeholder: "All Colors",
|
62
|
+
options: options,
|
63
|
+
label: "LG",
|
64
|
+
name: :foo,
|
65
|
+
is_multi: false,
|
66
|
+
margin_bottom: "lg",
|
67
|
+
})
|
68
|
+
%>
|
69
|
+
<%= pb_rails("typeahead", props: {
|
70
|
+
id: "typeahead-default",
|
71
|
+
placeholder: "All Colors",
|
72
|
+
options: options,
|
73
|
+
label: "XL",
|
74
|
+
name: :foo,
|
75
|
+
is_multi: false,
|
76
|
+
margin_bottom: "xl",
|
77
|
+
})
|
78
|
+
%>
|
79
|
+
|
80
|
+
<%= javascript_tag defer: "defer" do %>
|
81
|
+
document.addEventListener("pb-typeahead-kit-typeahead-default-result-option-select", function(event) {
|
82
|
+
console.log('Single Option selected')
|
83
|
+
console.dir(event.detail)
|
84
|
+
})
|
85
|
+
document.addEventListener("pb-typeahead-kit-typeahead-default-result-clear", function() {
|
86
|
+
console.log('All options cleared')
|
87
|
+
})
|
88
|
+
<% end %>
|
@@ -0,0 +1,60 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
|
3
|
+
import Typeahead from '../_typeahead'
|
4
|
+
|
5
|
+
const options = [
|
6
|
+
{ label: 'Orange', value: '#FFA500' },
|
7
|
+
{ label: 'Red', value: '#FF0000' },
|
8
|
+
{ label: 'Green', value: '#00FF00' },
|
9
|
+
{ label: 'Blue', value: '#0000FF' },
|
10
|
+
]
|
11
|
+
|
12
|
+
const TypeaheadMarginBottom = (props) => {
|
13
|
+
return (
|
14
|
+
<>
|
15
|
+
<Typeahead
|
16
|
+
label="None"
|
17
|
+
marginBottom="none"
|
18
|
+
options={options}
|
19
|
+
{...props}
|
20
|
+
/>
|
21
|
+
<Typeahead
|
22
|
+
label="XXS"
|
23
|
+
marginBottom="xxs"
|
24
|
+
options={options}
|
25
|
+
{...props}
|
26
|
+
/>
|
27
|
+
<Typeahead
|
28
|
+
label="XS"
|
29
|
+
marginBottom="xs"
|
30
|
+
options={options}
|
31
|
+
{...props}
|
32
|
+
/>
|
33
|
+
<Typeahead
|
34
|
+
label="Default - SM"
|
35
|
+
options={options}
|
36
|
+
{...props}
|
37
|
+
/>
|
38
|
+
<Typeahead
|
39
|
+
label="MD"
|
40
|
+
marginBottom="md"
|
41
|
+
options={options}
|
42
|
+
{...props}
|
43
|
+
/>
|
44
|
+
<Typeahead
|
45
|
+
label="LG"
|
46
|
+
marginBottom="lg"
|
47
|
+
options={options}
|
48
|
+
{...props}
|
49
|
+
/>
|
50
|
+
<Typeahead
|
51
|
+
label="XL"
|
52
|
+
marginBottom="xl"
|
53
|
+
options={options}
|
54
|
+
{...props}
|
55
|
+
/>
|
56
|
+
</>
|
57
|
+
)
|
58
|
+
}
|
59
|
+
|
60
|
+
export default TypeaheadMarginBottom
|
@@ -9,6 +9,7 @@ examples:
|
|
9
9
|
- typeahead_inline: Inline
|
10
10
|
- typeahead_multi_kit: Multi Kit Options
|
11
11
|
- typeahead_error_state: Error State
|
12
|
+
- typeahead_margin_bottom: Margin Bottom
|
12
13
|
- typeahead_with_pills_color: With Pills (Custom Color)
|
13
14
|
|
14
15
|
react:
|
@@ -24,4 +25,5 @@ examples:
|
|
24
25
|
- typeahead_async_createable: Createable (+ Async Data)
|
25
26
|
- typeahead_error_state: Error State
|
26
27
|
- typeahead_custom_menu_list: Custom MenuList
|
28
|
+
- typeahead_margin_bottom: Margin Bottom
|
27
29
|
- typeahead_with_pills_color: With Pills (Custom Color)
|
@@ -10,4 +10,5 @@ export { default as TypeaheadCreateable } from './_typeahead_createable.jsx'
|
|
10
10
|
export { default as TypeaheadAsyncCreateable } from './_typeahead_async_createable.jsx'
|
11
11
|
export { default as TypeaheadErrorState } from './_typeahead_error_state.jsx'
|
12
12
|
export { default as TypeaheadCustomMenuList } from './_typeahead_custom_menu_list.jsx'
|
13
|
+
export { default as TypeaheadMarginBottom } from './_typeahead_margin_bottom.jsx'
|
13
14
|
export { default as TypeaheadWithPillsColor } from './_typeahead_with_pills_color.jsx'
|