playbook_ui 15.5.0.pre.alpha.play260612706 → 15.5.0.pre.alpha.testingdialog12768

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 (38) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_background/_background.tsx +6 -6
  3. data/app/pb_kits/playbook/pb_background/background.test.js +1 -5
  4. data/app/pb_kits/playbook/pb_background/docs/_background_light.html.erb +1 -1
  5. data/app/pb_kits/playbook/pb_background/docs/_background_light.jsx +1 -0
  6. data/app/pb_kits/playbook/pb_background/docs/example.yml +2 -2
  7. data/app/pb_kits/playbook/pb_dialog/index.js +10 -15
  8. data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.tsx +34 -22
  9. data/app/pb_kits/playbook/pb_home_address_street/city_emphasis.html.erb +16 -12
  10. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_default.html.erb +1 -1
  11. data/app/pb_kits/playbook/pb_home_address_street/none_emphasis.html.erb +16 -12
  12. data/app/pb_kits/playbook/pb_home_address_street/street_emphasis.html.erb +16 -12
  13. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.scss +10 -0
  14. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.tsx +66 -15
  15. data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_with_tooltip.jsx +42 -0
  16. data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_with_tooltip.md +1 -0
  17. data/app/pb_kits/playbook/pb_multiple_users/docs/example.yml +1 -0
  18. data/app/pb_kits/playbook/pb_multiple_users/docs/index.js +1 -0
  19. data/app/pb_kits/playbook/pb_multiple_users/multiple_users.test.js +25 -0
  20. data/app/pb_kits/playbook/pb_typeahead/_typeahead.test.jsx +15 -0
  21. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +3 -0
  22. data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +6 -1
  23. data/app/pb_kits/playbook/pb_typeahead/components/ValueContainer.tsx +34 -7
  24. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_input_display.html.erb +30 -0
  25. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_input_display.jsx +37 -0
  26. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_input_display.md +3 -0
  27. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +2 -0
  28. data/app/pb_kits/playbook/pb_typeahead/docs/index.js +2 -1
  29. data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +6 -1
  30. data/dist/chunks/_typeahead-978gNTWh.js +6 -0
  31. data/dist/chunks/vendor.js +2 -2
  32. data/dist/playbook-rails-react-bindings.js +1 -1
  33. data/dist/playbook-rails.js +1 -1
  34. data/dist/playbook.css +1 -1
  35. data/lib/playbook/version.rb +1 -1
  36. metadata +8 -4
  37. data/app/pb_kits/playbook/pb_background/docs/_background_light.md +0 -1
  38. data/dist/chunks/_typeahead-eXsdpMc6.js +0 -6
@@ -0,0 +1,30 @@
1
+ <%
2
+ options = [
3
+ { label: 'Orange', value: '#FFA500' },
4
+ { label: 'Red', value: '#FF0000' },
5
+ { label: 'Green', value: '#00FF00' },
6
+ { label: 'Blue', value: '#0000FF' },
7
+ { label: 'Yellow', value: '#FFFF00' },
8
+ { label: 'Purple', value: '#800080' },
9
+ { label: 'Cyan', value: '#00FFFF' },
10
+ { label: 'Magenta', value: '#FF00FF' }
11
+ ]
12
+ %>
13
+
14
+ <%= pb_rails("typeahead", props: {
15
+ id: "typeahead-input-display-none",
16
+ label: "With Input Display None",
17
+ options: options,
18
+ name: :foo,
19
+ input_display: "none",
20
+ })
21
+ %>
22
+ <br/>
23
+ <%= pb_rails("typeahead", props: {
24
+ id: "typeahead-input-display-pills",
25
+ label: "With Input Display Pills (Default)",
26
+ options: options,
27
+ name: :foo,
28
+ pills: true,
29
+ })
30
+ %>
@@ -0,0 +1,37 @@
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
+ { label: 'Yellow', value: '#FFFF00' },
11
+ { label: 'Purple', value: '#800080' },
12
+ { label: 'Cyan', value: '#00FFFF' },
13
+ { label: 'Magenta', value: '#FF00FF' }
14
+ ]
15
+
16
+ const TypeaheadInputDisplay = (props) => {
17
+ return (
18
+ <>
19
+ <Typeahead
20
+ inputDisplay="none"
21
+ isMulti
22
+ label="With Input Display None"
23
+ options={options}
24
+ {...props}
25
+ />
26
+ <br/>
27
+ <Typeahead
28
+ isMulti
29
+ label="With Input Display Pills (Default)"
30
+ options={options}
31
+ {...props}
32
+ />
33
+ </>
34
+ )
35
+ }
36
+
37
+ export default TypeaheadInputDisplay
@@ -0,0 +1,3 @@
1
+ Use the `inputDisplay`/`input_display` prop to optionally display only the count in the display as opposed to multiple pills. This prop is set to 'pills' by default.
2
+
3
+ **NOTE**: `inputDisplay`/`input_display` should only be used with typeaheads that allow multi selection.
@@ -5,6 +5,7 @@ examples:
5
5
  - typeahead_default_options: With Default Options
6
6
  - typeahead_with_context: With Context
7
7
  - typeahead_with_pills: With Pills
8
+ - typeahead_input_display: Input Display
8
9
  - typeahead_without_pills: Without Pills (Single Select)
9
10
  - typeahead_with_pills_async: With Pills (Async Data)
10
11
  - typeahead_with_pills_async_users: With Pills (Async Data w/ Users)
@@ -26,6 +27,7 @@ examples:
26
27
  - typeahead_react_hook: React Hook
27
28
  - typeahead_with_highlight: With Highlight
28
29
  - typeahead_with_pills: With Pills
30
+ - typeahead_input_display: Input Display
29
31
  - typeahead_with_pills_async: With Pills (Async Data)
30
32
  - typeahead_with_pills_async_users: With Pills (Async Data w/ Users)
31
33
  - typeahead_with_pills_async_custom_options: With Pills (Async Data w/ Custom Options)
@@ -17,4 +17,5 @@ export { default as TypeaheadReactHook } from './_typeahead_react_hook.jsx'
17
17
  export { default as TypeaheadDisabled } from './_typeahead_disabled.jsx'
18
18
  export { default as TypeaheadPreserveInput } from './_typeahead_preserve_input.jsx'
19
19
  export { default as TypeaheadDefaultValue } from './_typeahead_default_value.jsx'
20
- export { default as TypeaheadCustomOptions } from './_typeahead_custom_options.jsx'
20
+ export { default as TypeaheadCustomOptions } from './_typeahead_custom_options.jsx'
21
+ export { default as TypeaheadInputDisplay } from './_typeahead_input_display.jsx'
@@ -25,6 +25,10 @@ module Playbook
25
25
  prop :is_multi, type: Playbook::Props::Boolean,
26
26
  default: true
27
27
 
28
+ prop :input_display, type: Playbook::Props::Enum,
29
+ values: %w[none pills],
30
+ default: "pills"
31
+
28
32
  prop :pills, type: Playbook::Props::Boolean,
29
33
  default: false
30
34
 
@@ -78,7 +82,7 @@ module Playbook
78
82
  end
79
83
 
80
84
  def is_react?
81
- pills || !is_multi || wrapped
85
+ pills || !is_multi || wrapped || input_display == "none"
82
86
  end
83
87
 
84
88
  def typeahead_react_options
@@ -91,6 +95,7 @@ module Playbook
91
95
  id: id,
92
96
  inline: inline,
93
97
  isMulti: is_multi,
98
+ inputDisplay: input_display,
94
99
  label: label,
95
100
  marginBottom: margin_bottom,
96
101
  multiKit: multi_kit,