playbook_ui 14.4.0 → 14.5.0.pre.alpha.PBNTR568dropdowncleaning4041

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +2 -0
  3. data/app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx +23 -4
  4. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +1 -1
  5. data/app/pb_kits/playbook/pb_advanced_table/index.js +60 -0
  6. data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +1 -9
  7. data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.html.erb +1 -9
  8. data/app/pb_kits/playbook/pb_button/_button.tsx +6 -2
  9. data/app/pb_kits/playbook/pb_contact/_contact.tsx +17 -5
  10. data/app/pb_kits/playbook/pb_contact/contact.html.erb +14 -6
  11. data/app/pb_kits/playbook/pb_contact/contact.rb +4 -0
  12. data/app/pb_kits/playbook/pb_contact/contact.test.js +1 -1
  13. data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.ts +2 -6
  14. data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.ts +2 -7
  15. data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +4 -3
  16. data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +1 -1
  17. data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +4 -0
  18. data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +6 -3
  19. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_inline.html.erb +1 -1
  20. data/app/pb_kits/playbook/pb_date_picker/sass_partials/_header_styles.scss +6 -2
  21. data/app/pb_kits/playbook/pb_dialog/_dialog.scss +2 -0
  22. data/app/pb_kits/playbook/pb_dialog/dialog_header.html.erb +1 -1
  23. data/app/pb_kits/playbook/pb_drawer/_close_icon.tsx +25 -0
  24. data/app/pb_kits/playbook/pb_drawer/_drawer.scss +465 -0
  25. data/app/pb_kits/playbook/pb_drawer/_drawer.tsx +195 -0
  26. data/app/pb_kits/playbook/pb_drawer/_drawer_context.tsx +3 -0
  27. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.jsx +117 -0
  28. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.jsx +43 -0
  29. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_default.html.erb +1 -0
  30. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_default.jsx +63 -0
  31. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx +55 -0
  32. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_sizes.jsx +113 -0
  33. data/app/pb_kits/playbook/pb_drawer/docs/example.yml +12 -0
  34. data/app/pb_kits/playbook/pb_drawer/docs/index.js +5 -0
  35. data/app/pb_kits/playbook/pb_drawer/drawer.html.erb +12 -0
  36. data/app/pb_kits/playbook/pb_drawer/drawer.rb +8 -0
  37. data/app/pb_kits/playbook/pb_drawer/drawer.test.jsx +77 -0
  38. data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +20 -4
  39. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_clear_selection.jsx +45 -0
  40. data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +1 -0
  41. data/app/pb_kits/playbook/pb_dropdown/docs/index.js +1 -0
  42. data/app/pb_kits/playbook/pb_filter/docs/_filter_default.html.erb +10 -2
  43. data/app/pb_kits/playbook/pb_filter/docs/_filter_max_height.html.erb +5 -1
  44. data/app/pb_kits/playbook/pb_filter/docs/_filter_max_width.html.erb +5 -1
  45. data/app/pb_kits/playbook/pb_filter/docs/_filter_no_background.html.erb +5 -1
  46. data/app/pb_kits/playbook/pb_filter/docs/_filter_no_sort.html.erb +5 -1
  47. data/app/pb_kits/playbook/pb_filter/docs/_filter_only.html.erb +5 -1
  48. data/app/pb_kits/playbook/pb_filter/docs/_filter_placement.html.erb +5 -1
  49. data/app/pb_kits/playbook/pb_filter/docs/_filter_single.html.erb +5 -1
  50. data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +9 -1
  51. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.html.erb +19 -0
  52. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.jsx +27 -0
  53. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.md +1 -0
  54. data/app/pb_kits/playbook/pb_form_pill/docs/example.yml +2 -0
  55. data/app/pb_kits/playbook/pb_form_pill/docs/index.js +1 -0
  56. data/app/pb_kits/playbook/pb_map/_map_controls.tsx +7 -1
  57. data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +210 -232
  58. data/app/pb_kits/playbook/pb_multi_level_select/context/index.tsx +5 -0
  59. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_default.jsx +1 -1
  60. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children.jsx +105 -0
  61. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children.md +1 -0
  62. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children_with_radios.jsx +106 -0
  63. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children_with_radios.md +1 -0
  64. data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +3 -0
  65. data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +2 -0
  66. data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select_options.tsx +149 -0
  67. data/app/pb_kits/playbook/pb_pagination/docs/_pagination_page_change.jsx +12 -1
  68. data/app/pb_kits/playbook/pb_pagination/docs/_pagination_page_change_react.md +3 -1
  69. data/app/pb_kits/playbook/pb_passphrase/_passphrase.tsx +10 -2
  70. data/app/pb_kits/playbook/pb_popover/docs/_popover_list.html.erb +14 -13
  71. data/app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx +4 -4
  72. data/app/pb_kits/playbook/pb_radio/_radio.tsx +92 -33
  73. data/app/pb_kits/playbook/pb_radio/docs/_radio_custom_children.html.erb +2 -0
  74. data/app/pb_kits/playbook/pb_radio/docs/_radio_custom_children.jsx +62 -0
  75. data/app/pb_kits/playbook/pb_radio/docs/example.yml +1 -0
  76. data/app/pb_kits/playbook/pb_radio/docs/index.js +1 -0
  77. data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/ToolbarDropdown.tsx +12 -5
  78. data/app/pb_kits/playbook/pb_select/_select.tsx +5 -2
  79. data/app/pb_kits/playbook/pb_select/select.html.erb +1 -1
  80. data/app/pb_kits/playbook/pb_select/select.rb +4 -0
  81. data/app/pb_kits/playbook/pb_text_input/_text_input.scss +0 -1
  82. data/app/pb_kits/playbook/pb_tooltip/_tooltip.tsx +17 -13
  83. data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +0 -1
  84. data/app/pb_kits/playbook/pb_typeahead/_typeahead.test.jsx +14 -0
  85. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +7 -1
  86. data/app/pb_kits/playbook/pb_typeahead/components/Control.tsx +6 -5
  87. data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +3 -1
  88. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_margin_bottom.html.erb +88 -0
  89. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_margin_bottom.jsx +60 -0
  90. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +2 -0
  91. data/app/pb_kits/playbook/pb_typeahead/docs/index.js +1 -0
  92. data/app/pb_kits/playbook/pb_typeahead/typeahead.html.erb +2 -1
  93. data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +9 -2
  94. data/app/pb_kits/playbook/utilities/icons/allicons.tsx +136 -13
  95. data/app/pb_kits/playbook/utilities/icons/angle-down.svg +3 -0
  96. data/app/pb_kits/playbook/utilities/icons/envelope.svg +3 -0
  97. data/dist/chunks/_typeahead-CT2ByCBK.js +22 -0
  98. data/dist/chunks/_weekday_stacked-CwIBeloD.js +45 -0
  99. data/dist/chunks/lazysizes-B7xYodB-.js +1 -0
  100. data/dist/chunks/lib-CEpcaI8y.js +29 -0
  101. data/dist/chunks/{pb_form_validation-zV9OpdSt.js → pb_form_validation-D9zkwt2b.js} +1 -1
  102. data/dist/chunks/vendor.js +1 -1
  103. data/dist/menu.yml +3 -1
  104. data/dist/playbook-doc.js +1 -1
  105. data/dist/playbook-rails-react-bindings.js +1 -1
  106. data/dist/playbook-rails.js +1 -1
  107. data/dist/playbook.css +1 -1
  108. data/lib/playbook/pagination_renderer.rb +10 -2
  109. data/lib/playbook/pb_doc_helper.rb +5 -5
  110. data/lib/playbook/version.rb +2 -2
  111. metadata +40 -10
  112. data/dist/chunks/_typeahead-B2zRxReA.js +0 -22
  113. data/dist/chunks/_weekday_stacked-BIfZDNDm.js +0 -45
  114. data/dist/chunks/lazysizes-DHz07jlL.js +0 -1
  115. data/dist/chunks/lib-D2U4I1U6.js +0 -16
@@ -30,7 +30,11 @@
30
30
  <%= form.collection_select :example_collection_select, example_collection, :value, :name, props: {max_width: "sm", label: true } %>
31
31
 
32
32
  <%= form.actions do |action| %>
33
- <%= action.submit props: { text: "Apply", data: { disable_with: "<i class='far fa-spinner fa-spin mr-3'></i>Searching...".html_safe },}%>
33
+ <%= action.submit props: {
34
+ text: "Apply",
35
+ data: {
36
+ disable_with: "pb_rails('icon', props: { icon: 'spinner', spin: true, fixed_width: true })Searching...".html_safe
37
+ },}%>
34
38
  <%= action.button props: { type: "reset", text: "Clear", variant: "secondary" } %>
35
39
  <% end %>
36
40
  <% end %>
@@ -69,7 +69,11 @@
69
69
  <%= form.collection_select :example_collection_select, example_collection, :value, :name, props: { label: true } %>
70
70
 
71
71
  <%= form.actions do |action| %>
72
- <%= action.submit props: { text: "Apply", data: { disable_with: "<i class='far fa-spinner fa-spin mr-3'></i>Searching...".html_safe },}%>
72
+ <%= action.submit props: {
73
+ text: "Apply",
74
+ data: {
75
+ disable_with: "pb_rails('icon', props: { icon: 'spinner', spin: true, fixed_width: true })Searching...".html_safe
76
+ },}%>
73
77
  <%= action.button props: { type: "reset", text: "Clear", variant: "secondary" } %>
74
78
  <% end %>
75
79
  <% end %>
@@ -24,7 +24,11 @@
24
24
  <%= form.collection_select :example_collection_select, example_collection, :value, :name, props: { label: true } %>
25
25
 
26
26
  <%= form.actions do |action| %>
27
- <%= action.submit props: { text: "Apply", data: { disable_with: "<i class='far fa-spinner fa-spin mr-3'></i>Searching...".html_safe },}%>
27
+ <%= action.submit props: {
28
+ text: "Apply",
29
+ data: {
30
+ disable_with: "pb_rails('icon', props: { icon: 'spinner', spin: true, fixed_width: true })Searching...".html_safe
31
+ },}%>
28
32
  <%= action.button props: { type: "reset", text: "Clear", variant: "secondary" } %>
29
33
  <% end %>
30
34
  <% end %>
@@ -22,7 +22,11 @@
22
22
  <%= form.collection_select :example_collection_select, example_collection, :value, :name, props: { label: true } %>
23
23
 
24
24
  <%= form.actions do |action| %>
25
- <%= action.submit props: { text: "Apply", data: { disable_with: "<i class='far fa-spinner fa-spin mr-3'></i>Searching...".html_safe },}%>
25
+ <%= action.submit props: {
26
+ text: "Apply",
27
+ data: {
28
+ disable_with: "pb_rails('icon', props: { icon: 'spinner', spin: true, fixed_width: true })Searching...".html_safe
29
+ },}%>
26
30
  <%= action.button props: { type: "reset", text: "Clear", variant: "secondary" } %>
27
31
  <% end %>
28
32
  <% end %>
@@ -23,7 +23,11 @@
23
23
  <%= form.collection_select :example_collection_select, example_collection, :value, :name, props: { label: true } %>
24
24
 
25
25
  <%= form.actions do |action| %>
26
- <%= action.submit props: { text: "Apply", data: { disable_with: "<i class='far fa-spinner fa-spin mr-3'></i>Searching...".html_safe },}%>
26
+ <%= action.submit props: {
27
+ text: "Apply",
28
+ data: {
29
+ disable_with: "pb_rails('icon', props: { icon: 'spinner', spin: true, fixed_width: true })Searching...".html_safe
30
+ },}%>
27
31
  <%= action.button props: { type: "reset", text: "Clear", variant: "secondary" } %>
28
32
  <% end %>
29
33
  <% end %>
@@ -29,7 +29,11 @@
29
29
  <%= form.collection_select :example_collection_select, example_collection, :value, :name, props: { label: true } %>
30
30
 
31
31
  <%= form.actions do |action| %>
32
- <%= action.submit props: { text: "Apply", data: { disable_with: "<i class='far fa-spinner fa-spin mr-3'></i>Searching...".html_safe },}%>
32
+ <%= action.submit props: {
33
+ text: "Apply",
34
+ data: {
35
+ disable_with: "pb_rails('icon', props: { icon: 'spinner', spin: true, fixed_width: true })Searching...".html_safe
36
+ },}%>
33
37
  <%= action.button props: { type: "reset", text: "Clear", variant: "secondary" } %>
34
38
  <% end %>
35
39
  <% end %>
@@ -47,9 +47,13 @@ const FormPill = (props: FormPillProps): React.ReactElement => {
47
47
 
48
48
  const iconClass = icon ? "_icon" : ""
49
49
  const closeIconSize = size === "small" ? "xs" : "sm"
50
+
51
+ const filteredProps: FormPillProps = {...props}
52
+ delete filteredProps.truncate
53
+
50
54
  const css = classnames(
51
55
  `pb_form_pill_kit_${color}${iconClass}`,
52
- globalProps(props),
56
+ globalProps(filteredProps),
53
57
  className,
54
58
  size === 'small' ? 'small' : null,
55
59
  textTransform,
@@ -77,6 +81,7 @@ const FormPill = (props: FormPillProps): React.ReactElement => {
77
81
  className="pb_form_pill_text"
78
82
  size={4}
79
83
  text={name}
84
+ truncate={props.truncate}
80
85
  />
81
86
  </>
82
87
  )}
@@ -92,6 +97,7 @@ const FormPill = (props: FormPillProps): React.ReactElement => {
92
97
  className="pb_form_pill_text"
93
98
  size={4}
94
99
  text={name}
100
+ truncate={props.truncate}
95
101
  />
96
102
  <Icon
97
103
  className="pb_form_pill_icon"
@@ -111,6 +117,7 @@ const FormPill = (props: FormPillProps): React.ReactElement => {
111
117
  className="pb_form_pill_tag"
112
118
  size={4}
113
119
  text={text}
120
+ truncate={props.truncate}
114
121
  />
115
122
  </>
116
123
  )}
@@ -119,6 +126,7 @@ const FormPill = (props: FormPillProps): React.ReactElement => {
119
126
  className="pb_form_pill_tag"
120
127
  size={4}
121
128
  text={text}
129
+ truncate={props.truncate}
122
130
  />
123
131
  )}
124
132
  <div
@@ -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: "Names",
17
+ pills: true,
18
+ truncate: 1,
19
+ }) %>
@@ -0,0 +1,27 @@
1
+ import React from 'react'
2
+ import Typeahead from '../../pb_typeahead/_typeahead'
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 FormPillTruncatedText = (props) => {
13
+ return (
14
+ <>
15
+ <Typeahead
16
+ htmlOptions={{ style: { maxWidth: "240px" }}}
17
+ isMulti
18
+ label="Names"
19
+ options={names}
20
+ truncate={1}
21
+ {...props}
22
+ />
23
+ </>
24
+ )
25
+ }
26
+
27
+ export default FormPillTruncatedText
@@ -0,0 +1 @@
1
+ For pills with longer text, the `truncate` global prop can be used to truncate the label within each Form Pill. See [here](https://playbook.powerapp.cloud/visual_guidelines/truncate) for more information on the truncate global prop.
@@ -3,6 +3,7 @@ examples:
3
3
  rails:
4
4
  - form_pill_user: Form Pill User
5
5
  - form_pill_size: Form Pill Size
6
+ - form_pill_truncated_text: Truncated Text
6
7
  - form_pill_tag: Form Pill Tag
7
8
  - form_pill_example: Example
8
9
  - form_pill_icon: Form Pill Icon
@@ -11,6 +12,7 @@ examples:
11
12
  react:
12
13
  - form_pill_user: Form Pill User
13
14
  - form_pill_size: Form Pill Size
15
+ - form_pill_truncated_text: Truncated Text
14
16
  - form_pill_tag: Form Pill Tag
15
17
  - form_pill_example: Example
16
18
  - form_pill_icon: Form Pill Icon
@@ -4,3 +4,4 @@ export { default as FormPillTag } from './_form_pill_tag.jsx'
4
4
  export { default as FormPillExample } from './_form_pill_example.jsx'
5
5
  export { default as FormPillIcon } from './_form_pill_icon.jsx'
6
6
  export { default as FormPillColors } from './_form_pill_colors.jsx'
7
+ export { default as FormPillTruncatedText } from './_form_pill_truncated_text.jsx'
@@ -2,6 +2,7 @@ import React from "react";
2
2
  import Button from "../pb_button/_button";
3
3
  import Icon from "../pb_icon/_icon";
4
4
  import Flex from "../pb_flex/_flex";
5
+ import { getAllIcons } from "../utilities/icons/allicons"
5
6
 
6
7
  type MapControlTypes = {
7
8
  zoomBtns?: boolean,
@@ -12,6 +13,8 @@ type MapControlTypes = {
12
13
  children?: React.ReactNode | React.ReactNode[]
13
14
  }
14
15
 
16
+ const eyeIcon = getAllIcons()["eye"]
17
+
15
18
  const MapControls = ({
16
19
  zoomBtns,
17
20
  zoomInClick,
@@ -42,7 +45,10 @@ const MapControls = ({
42
45
  <Button className="map-flyto-button"
43
46
  onClick={flyToClick}
44
47
  >
45
- <Icon icon="eye" />
48
+ <Icon
49
+ className="svg-inline--fa"
50
+ customIcon={eyeIcon.icon as unknown as { [key: string]: SVGElement }}
51
+ />
46
52
  </Button>
47
53
  ) : null}
48
54
  </>