playbook_ui_docs 14.3.2.pre.alpha.revert3614PBNTR455ganttchartPOC3783 → 14.4.0.pre.alpha.PBNTR534filtermaxwidth3903

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 (37) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_inline.html.erb +1 -1
  3. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_colors.html.erb +117 -0
  4. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_colors.jsx +227 -0
  5. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_colors.md +1 -0
  6. data/app/pb_kits/playbook/pb_form_pill/docs/example.yml +2 -0
  7. data/app/pb_kits/playbook/pb_form_pill/docs/index.js +1 -0
  8. data/app/pb_kits/playbook/pb_gantt_chart/docs/_gantt_chart_default.jsx +53 -0
  9. data/app/pb_kits/playbook/pb_gantt_chart/docs/example.yml +7 -0
  10. data/app/pb_kits/playbook/pb_gantt_chart/docs/index.js +1 -0
  11. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_color.html.erb +72 -0
  12. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_color.jsx +91 -0
  13. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_color_rails.md +1 -0
  14. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_color_react.md +1 -0
  15. data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +2 -0
  16. data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +1 -0
  17. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_bubble.html.erb +73 -0
  18. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_bubble.jsx +86 -0
  19. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/example.yml +2 -0
  20. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/index.js +1 -0
  21. data/app/pb_kits/playbook/pb_pagination/docs/_pagination_page_change.jsx +12 -1
  22. data/app/pb_kits/playbook/pb_pagination/docs/_pagination_page_change_react.md +3 -1
  23. data/app/pb_kits/playbook/pb_radio/docs/_radio_custom_children.html.erb +48 -0
  24. data/app/pb_kits/playbook/pb_radio/docs/_radio_custom_children.jsx +59 -0
  25. data/app/pb_kits/playbook/pb_radio/docs/_radio_custom_children.md +1 -0
  26. data/app/pb_kits/playbook/pb_radio/docs/example.yml +2 -0
  27. data/app/pb_kits/playbook/pb_radio/docs/index.js +1 -0
  28. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_margin_bottom.html.erb +88 -0
  29. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_margin_bottom.jsx +60 -0
  30. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_color.html.erb +31 -0
  31. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_color.jsx +26 -0
  32. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_color_rails.md +1 -0
  33. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_color_react.md +1 -0
  34. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +4 -0
  35. data/app/pb_kits/playbook/pb_typeahead/docs/index.js +2 -0
  36. data/dist/playbook-doc.js +1 -1
  37. metadata +23 -2
@@ -0,0 +1,73 @@
1
+ <%= pb_rails("multiple_users_stacked", props: {
2
+ variant: "bubble",
3
+ users: [
4
+ {
5
+ name: "Patrick Welch",
6
+ image_url: "https://randomuser.me/api/portraits/men/9.jpg",
7
+ }
8
+ ]
9
+ }) %>
10
+
11
+ <br/><br/>
12
+
13
+ <%= pb_rails("multiple_users_stacked", props: {
14
+ variant: "bubble",
15
+ users: [
16
+ {
17
+ name: "Patrick Welch",
18
+ image_url: "https://randomuser.me/api/portraits/men/9.jpg",
19
+ },
20
+ {
21
+ name: "Lucille Sanchez",
22
+ image_url: "https://randomuser.me/api/portraits/women/6.jpg",
23
+ }
24
+ ]
25
+ }) %>
26
+
27
+ <br/><br/>
28
+
29
+ <%= pb_rails("multiple_users_stacked", props: {
30
+ variant: "bubble",
31
+ users: [
32
+ {
33
+ name: "Patrick Welch",
34
+ image_url: "https://randomuser.me/api/portraits/men/9.jpg",
35
+ },
36
+ {
37
+ name: "Lucille Sanchez",
38
+ image_url: "https://randomuser.me/api/portraits/women/6.jpg",
39
+ },
40
+ {
41
+ name: "Beverly Reyes",
42
+ image_url: "https://randomuser.me/api/portraits/women/74.jpg",
43
+ },
44
+ ]
45
+ }) %>
46
+
47
+ <br/><br/>
48
+
49
+ <%= pb_rails("multiple_users_stacked", props: {
50
+ variant: "bubble",
51
+ users: [
52
+ {
53
+ name: "Patrick Welch",
54
+ image_url: "https://randomuser.me/api/portraits/men/9.jpg",
55
+ },
56
+ {
57
+ name: "Lucille Sanchez",
58
+ image_url: "https://randomuser.me/api/portraits/women/6.jpg",
59
+ },
60
+ {
61
+ name: "Beverly Reyes",
62
+ image_url: "https://randomuser.me/api/portraits/women/74.jpg",
63
+ },
64
+ {
65
+ name: "Keith Craig",
66
+ image_url: "https://randomuser.me/api/portraits/men/40.jpg",
67
+ },
68
+ {
69
+ name: "Alicia Cooper",
70
+ image_url: "https://randomuser.me/api/portraits/women/46.jpg",
71
+ }
72
+ ]
73
+ }) %>
@@ -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
@@ -1 +1,2 @@
1
1
  export { default as MultipleUsersStackedDefault } from './_multiple_users_stacked_default.jsx'
2
+ export { default as MultipleUsersStackedBubble } from './_multiple_users_stacked_bubble.jsx'
@@ -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={1}
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}`.
@@ -0,0 +1,48 @@
1
+ <%
2
+ options = [
3
+ { label: "Orange", value: "Orange" },
4
+ { label: "Red", value: "Red" },
5
+ { label: "Green", value: "Green" },
6
+ { label: "Blue", value: "Blue" },
7
+ ]
8
+ %>
9
+
10
+ <%= pb_rails("radio", props: {
11
+ custom_children: true,
12
+ label: "Select",
13
+ name: "Group1",
14
+ value: "Select",
15
+ }) do %>
16
+ <%= pb_rails("select", props: {
17
+ min_width: "xs",
18
+ options: options,
19
+ }) %>
20
+ <% end %>
21
+
22
+ <%= pb_rails("radio", props: {
23
+ custom_children: true,
24
+ label: "Typeahead",
25
+ name: "Group1",
26
+ value: "Typeahead",
27
+ }) do %>
28
+ <%= pb_rails("typeahead", props: {
29
+ id: "typeahead-radio",
30
+ is_multi: false,
31
+ min_width: "xs",
32
+ options: options,
33
+ placeholder: "Select...",
34
+ })
35
+ %>
36
+ <% end %>
37
+
38
+ <%= pb_rails("radio", props: {
39
+ custom_children: true,
40
+ label: "Typography",
41
+ name: "Group1",
42
+ value: "Typography",
43
+ }) do %>
44
+ <%= pb_rails("title", props: {
45
+ text: "Custom Typography",
46
+ })
47
+ %>
48
+ <% end %>
@@ -0,0 +1,59 @@
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
+ name="Group1"
23
+ tabIndex={0}
24
+ value="Select"
25
+ {...props}
26
+ >
27
+ <Select
28
+ minWidth="xs"
29
+ options={options}
30
+ />
31
+ </Radio>
32
+ <Radio
33
+ customChildren
34
+ label="Typeahead"
35
+ name="Group1"
36
+ tabIndex={0}
37
+ value="Typeahead"
38
+ {...props}
39
+ >
40
+ <Typeahead
41
+ minWidth="xs"
42
+ options={options}
43
+ />
44
+ </Radio>
45
+ <br />
46
+ <Radio
47
+ customChildren
48
+ defaultChecked={false}
49
+ label="Typography"
50
+ name="Group1"
51
+ value="Typography"
52
+ {...props}
53
+ >
54
+ <Title text="Custom Typography" />
55
+ </Radio>
56
+ </div>
57
+ )
58
+ }
59
+ export default RadioChildren
@@ -0,0 +1 @@
1
+ Use the `custom_children` prop to enable the use of kits instead of text labels.
@@ -7,6 +7,7 @@ examples:
7
7
  - radio_options: With Options
8
8
  - radio_alignment: Alignment
9
9
  - radio_disabled: Disabled
10
+ - radio_custom_children: Custom Children
10
11
 
11
12
  react:
12
13
  - radio_default: Default
@@ -14,6 +15,7 @@ examples:
14
15
  - radio_error: With Error
15
16
  - radio_alignment: Alignment
16
17
  - radio_disabled: Disabled
18
+ - radio_custom_children: Custom Children
17
19
 
18
20
  swift:
19
21
  - radio_default_swift: Default
@@ -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
@@ -0,0 +1,31 @@
1
+ <%
2
+ options = [
3
+ { label: 'Windows', value: '#FFA500' },
4
+ { label: 'Siding', value: '#FF0000' },
5
+ { label: 'Doors', value: '#00FF00' },
6
+ { label: 'Roofs', value: '#0000FF' },
7
+ ]
8
+ %>
9
+
10
+ <%= pb_rails("typeahead", props: { id: "typeahead-pills-example1", pill_color: "neutral", default_options: [options.first], options: options, label: "Colors", name: :foo, pills: true }) %>
11
+
12
+ <%= pb_rails("button", props: {id: "clear-pills", text: "Clear All Options", variant: "secondary"}) %>
13
+
14
+ <!-- This section is an example of the available JavaScript event hooks -->
15
+ <%= javascript_tag defer: "defer" do %>
16
+ document.addEventListener("pb-typeahead-kit-typeahead-pills-example1-result-option-select", function(event) {
17
+ console.log('Option selected')
18
+ console.dir(event.detail)
19
+ })
20
+ document.addEventListener("pb-typeahead-kit-typeahead-pills-example1-result-option-remove", function(event) {
21
+ console.log('Option removed')
22
+ console.dir(event.detail)
23
+ })
24
+ document.addEventListener("pb-typeahead-kit-typeahead-pills-example1-result-clear", function() {
25
+ console.log('All options cleared')
26
+ })
27
+
28
+ document.querySelector('#clear-pills').addEventListener('click', function() {
29
+ document.dispatchEvent(new CustomEvent('pb-typeahead-kit-typeahead-pills-example1:clear'))
30
+ })
31
+ <% end %>
@@ -0,0 +1,26 @@
1
+ import React from 'react'
2
+ import { Typeahead } from 'playbook-ui'
3
+
4
+ const options = [
5
+ { label: 'Windows', value: '#FFA500' },
6
+ { label: 'Siding', value: '#FF0000' },
7
+ { label: 'Doors', value: '#00FF00' },
8
+ { label: 'Roofs', value: '#0000FF' },
9
+ ]
10
+
11
+ const TypeaheadWithPills = (props) => {
12
+ return (
13
+ <>
14
+ <Typeahead
15
+ isMulti
16
+ label="Colors"
17
+ options={options}
18
+ pillColor="neutral"
19
+ placeholder=""
20
+ {...props}
21
+ />
22
+ </>
23
+ )
24
+ }
25
+
26
+ export default TypeaheadWithPills
@@ -0,0 +1 @@
1
+ Change the form pill color by passing the optional `pill_color` prop. Product, Data, and Status colors are available options. Check them out <a href="https://playbook.powerapp.cloud/kits/form_pill#form-pill-colors" target="_blank">here</a> in the Form Pill colors example.
@@ -0,0 +1 @@
1
+ Change the form pill color by passing the optional `pillColor` prop. Product, Data, and Status colors are available options. Check them out <a href="https://playbook.powerapp.cloud/kits/form_pill/react#form-pill-colors" target="_blank">here</a> in the Form Pill colors example.
@@ -9,6 +9,8 @@ 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
13
+ - typeahead_with_pills_color: With Pills (Custom Color)
12
14
 
13
15
  react:
14
16
  - typeahead_default: Default
@@ -23,3 +25,5 @@ examples:
23
25
  - typeahead_async_createable: Createable (+ Async Data)
24
26
  - typeahead_error_state: Error State
25
27
  - typeahead_custom_menu_list: Custom MenuList
28
+ - typeahead_margin_bottom: Margin Bottom
29
+ - typeahead_with_pills_color: With Pills (Custom Color)
@@ -10,3 +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'
14
+ export { default as TypeaheadWithPillsColor } from './_typeahead_with_pills_color.jsx'