playbook_ui 14.11.1 → 14.12.0.pre.alpha.PBNTR456fixedconftoastrailsautoclose5728

Sign up to get free protection for your applications and to get access to all the features.
Files changed (195) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +3 -0
  3. data/app/pb_kits/playbook/pb_advanced_table/Components/CustomCell.tsx +18 -2
  4. data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +27 -5
  5. data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableBody.tsx +17 -2
  6. data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableHeader.tsx +23 -1
  7. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +29 -0
  8. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +61 -4
  9. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +3 -3
  10. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +5 -1
  11. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +1 -1
  12. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_loading.html.erb +33 -0
  13. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_loading_rails.md +1 -0
  14. data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_loading.md → _advanced_table_loading_react.md} +2 -2
  15. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_no_subrows.jsx +50 -0
  16. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination.jsx +1 -0
  17. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.jsx +1 -0
  18. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_responsive.html.erb +38 -0
  19. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows.jsx +60 -0
  20. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows.md +5 -0
  21. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions.jsx +78 -0
  22. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions.md +1 -0
  23. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header.jsx +53 -0
  24. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header.md +1 -0
  25. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows.jsx +52 -0
  26. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows.md +1 -0
  27. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_control.md +2 -2
  28. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.html.erb +33 -0
  29. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_rails.md +1 -0
  30. data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_mock_data_no_subrows.json +42 -0
  31. data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_mock_data_with_id.json +299 -0
  32. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +8 -0
  33. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +6 -1
  34. data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +17 -3
  35. data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +15 -11
  36. data/app/pb_kits/playbook/pb_advanced_table/table_header.rb +14 -3
  37. data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +2 -2
  38. data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +9 -1
  39. data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.html.erb +1 -1
  40. data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb +9 -0
  41. data/app/pb_kits/playbook/pb_avatar/_avatar.scss +5 -0
  42. data/app/pb_kits/playbook/pb_button/button.html.erb +2 -3
  43. data/app/pb_kits/playbook/pb_card/card.html.erb +21 -2
  44. data/app/pb_kits/playbook/pb_card/card.rb +7 -0
  45. data/app/pb_kits/playbook/pb_checkbox/checkbox.html.erb +1 -6
  46. data/app/pb_kits/playbook/pb_collapsible/collapsible.html.erb +3 -1
  47. data/app/pb_kits/playbook/pb_collapsible/collapsible.rb +3 -0
  48. data/app/pb_kits/playbook/pb_copy_button/_copy_button.scss +3 -0
  49. data/app/pb_kits/playbook/pb_copy_button/_copy_button.tsx +92 -0
  50. data/app/pb_kits/playbook/pb_copy_button/copy_button.test.jsx +64 -0
  51. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_default.jsx +21 -0
  52. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.jsx +45 -0
  53. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.md +1 -0
  54. data/app/pb_kits/playbook/pb_copy_button/docs/example.yml +8 -0
  55. data/app/pb_kits/playbook/pb_copy_button/docs/index.js +2 -0
  56. data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +24 -16
  57. data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +2 -0
  58. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default_date.md +1 -1
  59. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_turbo_frames.html.erb +13 -0
  60. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_turbo_frames_rails.md +3 -0
  61. data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +1 -0
  62. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards_rails.html.erb +1 -3
  63. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards_rails.md +7 -0
  64. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list_rails.html.erb +3 -9
  65. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list_rails.md +5 -0
  66. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_selectable_list_rails.html.erb +38 -0
  67. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_selectable_list_rails.md +3 -0
  68. data/app/pb_kits/playbook/pb_draggable/docs/example.yml +1 -0
  69. data/app/pb_kits/playbook/pb_drawer/_drawer.scss +145 -183
  70. data/app/pb_kits/playbook/pb_drawer/_drawer.tsx +158 -268
  71. data/app/pb_kits/playbook/pb_drawer/context.ts +11 -0
  72. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_behavior.jsx +38 -0
  73. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.jsx +3 -45
  74. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.jsx +0 -1
  75. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_default.jsx +9 -16
  76. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.jsx +44 -19
  77. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.md +21 -3
  78. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx +16 -21
  79. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_sizes.jsx +2 -19
  80. data/app/pb_kits/playbook/pb_drawer/docs/example.yml +2 -1
  81. data/app/pb_kits/playbook/pb_drawer/docs/index.js +1 -0
  82. data/app/pb_kits/playbook/pb_drawer/drawer.test.jsx +5 -5
  83. data/app/pb_kits/playbook/pb_drawer/hooks/useBreakpoint.tsx +60 -0
  84. data/app/pb_kits/playbook/pb_drawer/hooks/useDrawerAnimation.tsx +21 -0
  85. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subtle_variant.md +1 -1
  86. data/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb +7 -12
  87. data/app/pb_kits/playbook/pb_dropdown/dropdown_container.html.erb +9 -14
  88. data/app/pb_kits/playbook/pb_dropdown/dropdown_option.html.erb +6 -11
  89. data/app/pb_kits/playbook/pb_dropdown/dropdown_trigger.html.erb +8 -14
  90. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close.html.erb +74 -0
  91. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close_rails.md +3 -0
  92. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/example.yml +1 -0
  93. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/index.js +24 -13
  94. data/app/pb_kits/playbook/pb_icon_button/_icon_button.scss +78 -0
  95. data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_default.html.erb +3 -0
  96. data/app/pb_kits/playbook/pb_icon_button/docs/example.yml +7 -0
  97. data/app/pb_kits/playbook/pb_icon_button/icon_button.html.erb +16 -0
  98. data/app/pb_kits/playbook/pb_icon_button/icon_button.rb +22 -0
  99. data/app/pb_kits/playbook/pb_list/item.html.erb +30 -8
  100. data/app/pb_kits/playbook/pb_list/item.rb +7 -0
  101. data/app/pb_kits/playbook/pb_list/list.html.erb +31 -11
  102. data/app/pb_kits/playbook/pb_list/list.rb +4 -0
  103. data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.tsx +6 -1
  104. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.scss +4 -0
  105. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.tsx +1 -0
  106. data/app/pb_kits/playbook/pb_multiple_users/multiple_users.html.erb +1 -1
  107. data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +30 -12
  108. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_format.html.erb +15 -0
  109. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_format.jsx +24 -0
  110. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_format.md +1 -0
  111. data/app/pb_kits/playbook/pb_phone_number_input/docs/example.yml +3 -1
  112. data/app/pb_kits/playbook/pb_phone_number_input/docs/index.js +1 -0
  113. data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.rb +3 -0
  114. data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.test.js +20 -1
  115. data/app/pb_kits/playbook/pb_radio/_radio.scss +12 -8
  116. data/app/pb_kits/playbook/pb_radio/docs/_radio_custom_children.jsx +8 -3
  117. data/app/pb_kits/playbook/pb_select/_select.scss +3 -5
  118. data/app/pb_kits/playbook/pb_select/_select.tsx +5 -1
  119. data/app/pb_kits/playbook/pb_select/select.html.erb +2 -2
  120. data/app/pb_kits/playbook/pb_selectable_icon/_selectable_icon.tsx +9 -1
  121. data/app/pb_kits/playbook/pb_selectable_icon/docs/_selectable_icon_default.jsx +4 -1
  122. data/app/pb_kits/playbook/pb_selectable_icon/docs/_selectable_icon_single_select.jsx +4 -1
  123. data/app/pb_kits/playbook/pb_selectable_list/selectable_list.html.erb +17 -3
  124. data/app/pb_kits/playbook/pb_selectable_list/selectable_list.rb +3 -0
  125. data/app/pb_kits/playbook/pb_selectable_list/selectable_list_item.html.erb +11 -4
  126. data/app/pb_kits/playbook/pb_selectable_list/selectable_list_item.rb +3 -0
  127. data/app/pb_kits/playbook/pb_table/_table.tsx +2 -3
  128. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns.html.erb +74 -0
  129. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns_rails.md +3 -0
  130. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns_rails.md +2 -2
  131. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns.html.erb +74 -0
  132. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns_rails.md +3 -0
  133. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.html.erb +47 -0
  134. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_rails.md +2 -0
  135. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content.jsx +12 -8
  136. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content_rails.html.erb +52 -0
  137. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content_rails.md +0 -0
  138. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows_rails.html.erb +52 -0
  139. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows_rails.md +3 -0
  140. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table_rails.html.erb +80 -0
  141. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table_rails.md +1 -0
  142. data/app/pb_kits/playbook/pb_table/docs/example.yml +6 -0
  143. data/app/pb_kits/playbook/pb_table/index.ts +187 -88
  144. data/app/pb_kits/playbook/pb_table/styles/_collapsible.scss +12 -0
  145. data/app/pb_kits/playbook/pb_table/styles/_scroll.scss +6 -5
  146. data/app/pb_kits/playbook/pb_table/table.html.erb +1 -1
  147. data/app/pb_kits/playbook/pb_table/table.rb +17 -2
  148. data/app/pb_kits/playbook/pb_table/table_row.html.erb +20 -1
  149. data/app/pb_kits/playbook/pb_table/table_row.rb +5 -0
  150. data/app/pb_kits/playbook/pb_table/utilities/addDataTitle.ts +22 -0
  151. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask.html.erb +46 -0
  152. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask_rails.md +3 -0
  153. data/app/pb_kits/playbook/pb_text_input/docs/example.yml +2 -1
  154. data/app/pb_kits/playbook/pb_text_input/index.js +103 -0
  155. data/app/pb_kits/playbook/pb_text_input/text_input.html.erb +4 -0
  156. data/app/pb_kits/playbook/pb_text_input/text_input.rb +33 -3
  157. data/app/pb_kits/playbook/pb_timeline/_timeline.scss +30 -30
  158. data/app/pb_kits/playbook/pb_tooltip/_tooltip.tsx +3 -1
  159. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +3 -2
  160. data/app/pb_kits/playbook/pb_typeahead/components/ClearIndicator.tsx +12 -4
  161. data/app/pb_kits/playbook/pb_typeahead/components/Control.tsx +5 -1
  162. data/app/pb_kits/playbook/pb_typeahead/components/IndicatorsContainer.tsx +8 -3
  163. data/app/pb_kits/playbook/pb_typeahead/components/MenuList.tsx +6 -1
  164. data/app/pb_kits/playbook/pb_typeahead/components/Option.tsx +21 -6
  165. data/app/pb_kits/playbook/pb_typeahead/components/Placeholder.tsx +13 -6
  166. data/app/pb_kits/playbook/pb_typeahead/components/ValueContainer.tsx +7 -3
  167. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_custom_menu_list.jsx +2 -0
  168. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.html.erb +19 -0
  169. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.jsx +27 -0
  170. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.md +1 -0
  171. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async.jsx +4 -2
  172. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async_custom_options.jsx +5 -5
  173. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +2 -0
  174. data/app/pb_kits/playbook/pb_typeahead/docs/index.js +1 -0
  175. data/dist/chunks/_typeahead-BIhRQo8Q.js +36 -0
  176. data/dist/chunks/_weekday_stacked-VKMYuo6-.js +45 -0
  177. data/dist/chunks/lazysizes-B7xYodB-.js +1 -0
  178. data/dist/chunks/{lib-B7sgJtGS.js → lib-kMuhBuU7.js} +2 -2
  179. data/dist/chunks/{pb_form_validation-C5Cc0-1v.js → pb_form_validation-DBJ0wZuS.js} +1 -1
  180. data/dist/chunks/vendor.js +1 -1
  181. data/dist/menu.yml +12 -0
  182. data/dist/playbook-doc.js +1 -1
  183. data/dist/playbook-rails-react-bindings.js +1 -1
  184. data/dist/playbook-rails.js +1 -1
  185. data/dist/playbook.css +1 -1
  186. data/lib/playbook/pb_forms_global_props_helper.rb +136 -0
  187. data/lib/playbook/pb_forms_helper.rb +13 -4
  188. data/lib/playbook/version.rb +2 -2
  189. metadata +88 -11
  190. data/dist/chunks/_typeahead-C2iCBqxQ.js +0 -36
  191. data/dist/chunks/_weekday_stacked-E-5KcEkc.js +0 -45
  192. data/dist/chunks/lazysizes-DHz07jlL.js +0 -1
  193. /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_table_props.md → _advanced_table_table_props_react.md} +0 -0
  194. /data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/{_fixed_confirmation_toast_auto_close.md → _fixed_confirmation_toast_auto_close_react.md} +0 -0
  195. /data/app/pb_kits/playbook/pb_table/docs/{_table_with_collapsible.md → _table_with_collapsible_react.md} +0 -0
@@ -4,19 +4,26 @@ import { components } from 'react-select'
4
4
  import Flex from '../../pb_flex/_flex'
5
5
  import Icon from '../../pb_icon/_icon'
6
6
 
7
- const Placeholder = (props: any) => (
7
+ type PlaceholderProps = {
8
+ children: React.ReactNode,
9
+ selectProps: {
10
+ plusIcon?: boolean,
11
+ },
12
+ }
13
+
14
+ const Placeholder = (props: PlaceholderProps): React.ReactElement => (
8
15
  <>
9
16
  <Flex
10
- align="center"
11
- className="placeholder"
17
+ align="center"
18
+ className="placeholder"
12
19
  >
13
20
  <components.IndicatorsContainer
14
- {...props}
21
+ {...props}
15
22
  />
16
23
  {props.selectProps.plusIcon &&
17
24
  <Icon
18
- className="typeahead-plus-icon"
19
- icon="plus"
25
+ className="typeahead-plus-icon"
26
+ icon="plus"
20
27
  />
21
28
  }
22
29
  </Flex>
@@ -1,10 +1,14 @@
1
1
  import React from 'react'
2
2
  import { components } from 'react-select'
3
3
 
4
- const ValueContainer = (props: any) => (
4
+ type ValueContainerProps = {
5
+ children: React.ReactNode,
6
+ }
7
+
8
+ const ValueContainer = (props: ValueContainerProps): React.ReactElement => (
5
9
  <components.ValueContainer
6
- className="text_input_value_container"
7
- {...props}
10
+ className="text_input_value_container"
11
+ {...props}
8
12
  />
9
13
  )
10
14
 
@@ -1,3 +1,5 @@
1
+ /* eslint-disable react/no-multi-comp */
2
+
1
3
  import React, { useState } from 'react'
2
4
 
3
5
  import {
@@ -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.
@@ -45,8 +45,7 @@ const promiseOptions = (inputValue) =>
45
45
 
46
46
  const TypeaheadWithPillsAsync = (props) => {
47
47
  const [users, setUsers] = useState([])
48
- const handleOnChange = (value) => setUsers(formatUsers(value))
49
- const formatValue = (users) => formatUsers(users)
48
+
50
49
  const formatUsers = (users) => {
51
50
  const results = () => (users.map((user) => {
52
51
  if (Object.keys(user)[0] === 'name' || Object.keys(user)[1] === 'id'){
@@ -58,6 +57,9 @@ const TypeaheadWithPillsAsync = (props) => {
58
57
  return results()
59
58
  }
60
59
 
60
+ const handleOnChange = (value) => setUsers(formatUsers(value))
61
+ const formatValue = (users) => formatUsers(users)
62
+
61
63
  return (
62
64
  <>
63
65
  {users && users.length > 0 && (
@@ -83,13 +83,13 @@ const TypeaheadWithPillsAsyncCustomOptions = (props) => {
83
83
  onChange={handleOnChange}
84
84
  onMultiValueClick={handleOnMultiValueClick}
85
85
  placeholder="type the name of a Github user"
86
- valueComponent={(props) => (
86
+ valueComponent={({imageUrl, label, territory, type}) => (
87
87
  <User
88
88
  avatar
89
- avatarUrl={props.imageUrl}
90
- name={props.label}
91
- territory={props.territory}
92
- title={props.type}
89
+ avatarUrl={imageUrl}
90
+ name={label}
91
+ territory={territory}
92
+ title={type}
93
93
  />
94
94
  )}
95
95
  {...props}
@@ -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'