playbook_ui 14.3.2 → 14.4.0.pre.alpha.PBNTR550typeaheadformpilltruncate3895

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx +23 -4
  3. data/app/pb_kits/playbook/pb_contact/_contact.tsx +17 -5
  4. data/app/pb_kits/playbook/pb_contact/contact.html.erb +14 -6
  5. data/app/pb_kits/playbook/pb_contact/contact.rb +4 -0
  6. data/app/pb_kits/playbook/pb_contact/contact.test.js +1 -1
  7. data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +4 -3
  8. data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +1 -1
  9. data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +4 -0
  10. data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +6 -3
  11. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_inline.html.erb +1 -1
  12. data/app/pb_kits/playbook/pb_date_picker/sass_partials/_flatpickr_styles.scss +2 -3
  13. data/app/pb_kits/playbook/pb_date_picker/sass_partials/_header_styles.scss +6 -2
  14. data/app/pb_kits/playbook/pb_dialog/_dialog.scss +2 -0
  15. data/app/pb_kits/playbook/pb_dialog/dialog_header.html.erb +1 -1
  16. data/app/pb_kits/playbook/pb_form_pill/_form_pill.scss +245 -23
  17. data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +10 -2
  18. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_colors.html.erb +117 -0
  19. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_colors.jsx +227 -0
  20. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_colors.md +1 -0
  21. data/app/pb_kits/playbook/pb_form_pill/docs/example.yml +2 -0
  22. data/app/pb_kits/playbook/pb_form_pill/docs/index.js +1 -0
  23. data/app/pb_kits/playbook/pb_form_pill/form_pill.rb +1 -1
  24. data/app/pb_kits/playbook/pb_icon/icon.rb +1 -1
  25. data/app/pb_kits/playbook/pb_map/_map_controls.tsx +7 -1
  26. data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +20 -5
  27. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_color.html.erb +72 -0
  28. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_color.jsx +91 -0
  29. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_color_rails.md +1 -0
  30. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_color_react.md +1 -0
  31. data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +2 -0
  32. data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +1 -0
  33. data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.rb +4 -0
  34. data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.scss +97 -21
  35. data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.test.js +166 -0
  36. data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.tsx +45 -6
  37. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_bubble.html.erb +73 -0
  38. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_bubble.jsx +86 -0
  39. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/example.yml +2 -0
  40. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/index.js +1 -0
  41. data/app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.html.erb +6 -2
  42. data/app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb +21 -1
  43. data/app/pb_kits/playbook/pb_pagination/docs/_pagination_page_change.jsx +12 -1
  44. data/app/pb_kits/playbook/pb_pagination/docs/_pagination_page_change_react.md +3 -1
  45. data/app/pb_kits/playbook/pb_passphrase/_passphrase.tsx +10 -2
  46. data/app/pb_kits/playbook/pb_radio/_radio.tsx +92 -33
  47. data/app/pb_kits/playbook/pb_radio/docs/_radio_custom_children.html.erb +48 -0
  48. data/app/pb_kits/playbook/pb_radio/docs/_radio_custom_children.jsx +59 -0
  49. data/app/pb_kits/playbook/pb_radio/docs/_radio_custom_children.md +1 -0
  50. data/app/pb_kits/playbook/pb_radio/docs/example.yml +2 -0
  51. data/app/pb_kits/playbook/pb_radio/docs/index.js +1 -0
  52. data/app/pb_kits/playbook/pb_radio/index.js +17 -0
  53. data/app/pb_kits/playbook/pb_radio/radio.html.erb +35 -13
  54. data/app/pb_kits/playbook/pb_radio/radio.rb +3 -1
  55. data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/ToolbarDropdown.tsx +12 -5
  56. data/app/pb_kits/playbook/pb_select/_select.tsx +5 -2
  57. data/app/pb_kits/playbook/pb_select/select.html.erb +1 -1
  58. data/app/pb_kits/playbook/pb_select/select.rb +4 -0
  59. data/app/pb_kits/playbook/pb_text_input/_text_input.scss +0 -1
  60. data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +0 -1
  61. data/app/pb_kits/playbook/pb_typeahead/_typeahead.test.jsx +30 -0
  62. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +11 -1
  63. data/app/pb_kits/playbook/pb_typeahead/components/Control.tsx +6 -5
  64. data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +28 -18
  65. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_margin_bottom.html.erb +88 -0
  66. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_margin_bottom.jsx +60 -0
  67. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_color.html.erb +31 -0
  68. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_color.jsx +26 -0
  69. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_color_rails.md +1 -0
  70. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_color_react.md +1 -0
  71. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +4 -0
  72. data/app/pb_kits/playbook/pb_typeahead/docs/index.js +2 -0
  73. data/app/pb_kits/playbook/pb_typeahead/typeahead.html.erb +2 -1
  74. data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +10 -1
  75. data/app/pb_kits/playbook/tokens/_colors.scss +2 -0
  76. data/app/pb_kits/playbook/utilities/icons/allicons.tsx +123 -0
  77. data/app/pb_kits/playbook/utilities/icons/angle-down.svg +3 -0
  78. data/app/pb_kits/playbook/utilities/icons/envelope.svg +3 -0
  79. data/dist/chunks/_typeahead-Ctc4yCCN.js +22 -0
  80. data/dist/chunks/_weekday_stacked-B4Xs5p_U.js +45 -0
  81. data/dist/chunks/lib-CEpcaI8y.js +29 -0
  82. data/dist/chunks/{pb_form_validation-u2wnZ3oe.js → pb_form_validation-D9zkwt2b.js} +1 -1
  83. data/dist/chunks/vendor.js +1 -1
  84. data/dist/playbook-doc.js +1 -1
  85. data/dist/playbook-rails-react-bindings.js +1 -1
  86. data/dist/playbook-rails.js +1 -1
  87. data/dist/playbook.css +1 -1
  88. data/lib/playbook/version.rb +2 -2
  89. metadata +30 -9
  90. data/dist/chunks/_typeahead-DbAz2Okr.js +0 -22
  91. data/dist/chunks/_weekday_stacked-CZ5S17_d.js +0 -45
  92. data/dist/chunks/lib-D9uVVKnh.js +0 -16
@@ -17,7 +17,7 @@ type FormPillProps = {
17
17
  avatarUrl?: string,
18
18
  size?: string,
19
19
  textTransform?: 'none' | 'lowercase',
20
- color?: "primary" | "neutral",
20
+ color?: "primary" | "neutral" | "success" | "warning" | "error" | "info" | "data_1" | "data_2" | "data_3" | "data_4" | "data_5" | "data_6" | "data_7" | "data_8" | "windows" | "siding" | "roofing" | "doors" | "gutters" | "solar" | "insulation" | "accessories",
21
21
  data?: {[key: string]: string},
22
22
  tabIndex?: number,
23
23
  icon?: string,
@@ -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,117 @@
1
+ <%= pb_rails("title", props: { text: "Status Colors", tag: "h4", size: 4, margin_bottom: "sm" }) %>
2
+
3
+ <%= pb_rails("form_pill", props: {
4
+ text: "Primary",
5
+ tabindex: 0,
6
+ }) %>
7
+ <%= pb_rails("form_pill", props: {
8
+ color: "neutral",
9
+ text: "Neutral",
10
+ tabindex: 0,
11
+ }) %>
12
+ <%= pb_rails("form_pill", props: {
13
+ color: "success",
14
+ text: "Success",
15
+ tabindex: 0,
16
+ }) %>
17
+ <%= pb_rails("form_pill", props: {
18
+ color: "warning",
19
+ text: "Warning",
20
+ tabindex: 0,
21
+ }) %>
22
+ <%= pb_rails("form_pill", props: {
23
+ color: "error",
24
+ text: "Error",
25
+ tabindex: 0,
26
+ }) %>
27
+ <%= pb_rails("form_pill", props: {
28
+ color: "info",
29
+ text: "Info",
30
+ tabindex: 0,
31
+ }) %>
32
+
33
+ <%= pb_rails("title", props: { text: "Data Colors", tag: "h4", size: 4, margin_bottom: "sm", margin_top: "md" }) %>
34
+
35
+ <%= pb_rails("form_pill", props: {
36
+ color: "data_1",
37
+ text: "Data 1",
38
+ tabindex: 0,
39
+ }) %>
40
+ <%= pb_rails("form_pill", props: {
41
+ color: "data_2",
42
+ text: "Data 2",
43
+ tabindex: 0,
44
+ }) %>
45
+ <%= pb_rails("form_pill", props: {
46
+ color: "data_3",
47
+ text: "Data 3",
48
+ tabindex: 0,
49
+ }) %>
50
+ <%= pb_rails("form_pill", props: {
51
+ color: "data_4",
52
+ text: "Data 4",
53
+ tabindex: 0,
54
+ }) %>
55
+ <%= pb_rails("form_pill", props: {
56
+ color: "data_5",
57
+ text: "Data 5",
58
+ tabindex: 0,
59
+ }) %>
60
+ <%= pb_rails("form_pill", props: {
61
+ color: "data_6",
62
+ text: "Data 6",
63
+ tabindex: 0,
64
+ }) %>
65
+ <%= pb_rails("form_pill", props: {
66
+ color: "data_7",
67
+ text: "Data 7",
68
+ tabindex: 0,
69
+ }) %>
70
+ <%= pb_rails("form_pill", props: {
71
+ color: "data_8",
72
+ text: "Data 8",
73
+ tabindex: 0,
74
+ }) %>
75
+
76
+ <%= pb_rails("title", props: { text: "Product Colors", tag: "h4", size: 4, margin_bottom: "sm", margin_top: "md" }) %>
77
+
78
+ <%= pb_rails("form_pill", props: {
79
+ color: "windows",
80
+ text: "Windows",
81
+ tabindex: 0,
82
+ }) %>
83
+ <%= pb_rails("form_pill", props: {
84
+ color: "siding",
85
+ text: "Siding",
86
+ tabindex: 0,
87
+ }) %>
88
+ <%= pb_rails("form_pill", props: {
89
+ color: "roofing",
90
+ text: "Roofing",
91
+ tabindex: 0,
92
+ }) %>
93
+ <%= pb_rails("form_pill", props: {
94
+ color: "doors",
95
+ text: "Doors",
96
+ tabindex: 0,
97
+ }) %>
98
+ <%= pb_rails("form_pill", props: {
99
+ color: "gutters",
100
+ text: "Gutters",
101
+ tabindex: 0,
102
+ }) %>
103
+ <%= pb_rails("form_pill", props: {
104
+ color: "solar",
105
+ text: "Solar",
106
+ tabindex: 0,
107
+ }) %>
108
+ <%= pb_rails("form_pill", props: {
109
+ color: "insulation",
110
+ text: "Insulation",
111
+ tabindex: 0,
112
+ }) %>
113
+ <%= pb_rails("form_pill", props: {
114
+ color: "accessories",
115
+ text: "Accessories",
116
+ tabindex: 0,
117
+ }) %>
@@ -0,0 +1,227 @@
1
+ import React from 'react'
2
+ import { FormPill, Title } from 'playbook-ui'
3
+
4
+ const FormPillColors = (props) => {
5
+ return (
6
+ <div>
7
+ <Title
8
+ marginBottom="sm"
9
+ size={4}
10
+ text="Status Colors"
11
+ {...props}
12
+ />
13
+ <FormPill
14
+ onClick={() => {
15
+ alert('Click!')
16
+ }}
17
+ tabIndex={0}
18
+ text="Primary"
19
+ {...props}
20
+ />
21
+ <FormPill
22
+ color="neutral"
23
+ onClick={() => {
24
+ alert('Click!')
25
+ }}
26
+ tabIndex={0}
27
+ text="Neutral"
28
+ {...props}
29
+ />
30
+ <FormPill
31
+ color="success"
32
+ onClick={() => {
33
+ alert('Click!')
34
+ }}
35
+ tabIndex={0}
36
+ text="Success"
37
+ {...props}
38
+ />
39
+ <FormPill
40
+ color="warning"
41
+ onClick={() => {
42
+ alert('Click!')
43
+ }}
44
+ tabIndex={0}
45
+ text="Warning"
46
+ {...props}
47
+ />
48
+ <FormPill
49
+ color="error"
50
+ onClick={() => {
51
+ alert('Click!')
52
+ }}
53
+ tabIndex={0}
54
+ text="Error"
55
+ {...props}
56
+ />
57
+ <FormPill
58
+ color="info"
59
+ onClick={() => {
60
+ alert('Click!')
61
+ }}
62
+ tabIndex={0}
63
+ text="Info"
64
+ {...props}
65
+ />
66
+ <Title
67
+ marginBottom="sm"
68
+ marginTop="md"
69
+ size={4}
70
+ text="Data Colors"
71
+ {...props}
72
+ />
73
+ <FormPill
74
+ color="data_1"
75
+ onClick={() => {
76
+ alert('Click!')
77
+ }}
78
+ tabIndex={0}
79
+ text="Data 1"
80
+ {...props}
81
+ />
82
+ <FormPill
83
+ color="data_2"
84
+ onClick={() => {
85
+ alert('Click!')
86
+ }}
87
+ tabIndex={0}
88
+ text="Data 2"
89
+ {...props}
90
+ />
91
+ <FormPill
92
+ color="data_3"
93
+ onClick={() => {
94
+ alert('Click!')
95
+ }}
96
+ tabIndex={0}
97
+ text="Data 3"
98
+ {...props}
99
+ />
100
+ <FormPill
101
+ color="data_4"
102
+ onClick={() => {
103
+ alert('Click!')
104
+ }}
105
+ tabIndex={0}
106
+ text="Data 4"
107
+ {...props}
108
+ />
109
+ <FormPill
110
+ color="data_5"
111
+ onClick={() => {
112
+ alert('Click!')
113
+ }}
114
+ tabIndex={0}
115
+ text="Data 5"
116
+ {...props}
117
+ />
118
+ <FormPill
119
+ color="data_6"
120
+ onClick={() => {
121
+ alert('Click!')
122
+ }}
123
+ tabIndex={0}
124
+ text="Data 6"
125
+ {...props}
126
+ />
127
+ <FormPill
128
+ color="data_7"
129
+ onClick={() => {
130
+ alert('Click!')
131
+ }}
132
+ tabIndex={0}
133
+ text="Data 7"
134
+ {...props}
135
+ />
136
+ <FormPill
137
+ color="data_8"
138
+ onClick={() => {
139
+ alert('Click!')
140
+ }}
141
+ tabIndex={0}
142
+ text="Data 8"
143
+ {...props}
144
+ />
145
+ <Title
146
+ marginBottom="sm"
147
+ marginTop="md"
148
+ size={4}
149
+ text="Product Colors"
150
+ {...props}
151
+ />
152
+ <FormPill
153
+ color="windows"
154
+ onClick={() => {
155
+ alert('Click!')
156
+ }}
157
+ tabIndex={0}
158
+ text="Windows"
159
+ {...props}
160
+ />
161
+ <FormPill
162
+ color="siding"
163
+ onClick={() => {
164
+ alert('Click!')
165
+ }}
166
+ tabIndex={0}
167
+ text="Siding"
168
+ {...props}
169
+ />
170
+ <FormPill
171
+ color="roofing"
172
+ onClick={() => {
173
+ alert('Click!')
174
+ }}
175
+ tabIndex={0}
176
+ text="Roofing"
177
+ {...props}
178
+ />
179
+ <FormPill
180
+ color="doors"
181
+ onClick={() => {
182
+ alert('Click!')
183
+ }}
184
+ tabIndex={0}
185
+ text="Doors"
186
+ {...props}
187
+ />
188
+ <FormPill
189
+ color="gutters"
190
+ onClick={() => {
191
+ alert('Click!')
192
+ }}
193
+ tabIndex={0}
194
+ text="Gutters"
195
+ {...props}
196
+ />
197
+ <FormPill
198
+ color="solar"
199
+ onClick={() => {
200
+ alert('Click!')
201
+ }}
202
+ tabIndex={0}
203
+ text="Solar"
204
+ {...props}
205
+ />
206
+ <FormPill
207
+ color="insulation"
208
+ onClick={() => {
209
+ alert('Click!')
210
+ }}
211
+ tabIndex={0}
212
+ text="Insulation"
213
+ {...props}
214
+ />
215
+ <FormPill
216
+ color="accessories"
217
+ onClick={() => {
218
+ alert('Click!')
219
+ }}
220
+ tabIndex={0}
221
+ text="Accessories"
222
+ {...props}
223
+ />
224
+ </div>
225
+ )
226
+ }
227
+ export default FormPillColors
@@ -0,0 +1 @@
1
+ The Status, Data, and Product colors highlighted above can be passed to the `color` prop. Primary is the default color. Form pills with a text tag, an avatar, or an icon with text tag can all receive the `color` prop.
@@ -6,6 +6,7 @@ examples:
6
6
  - form_pill_tag: Form Pill Tag
7
7
  - form_pill_example: Example
8
8
  - form_pill_icon: Form Pill Icon
9
+ - form_pill_colors: Form Pill Colors
9
10
 
10
11
  react:
11
12
  - form_pill_user: Form Pill User
@@ -13,3 +14,4 @@ examples:
13
14
  - form_pill_tag: Form Pill Tag
14
15
  - form_pill_example: Example
15
16
  - form_pill_icon: Form Pill Icon
17
+ - form_pill_colors: Form Pill Colors
@@ -3,3 +3,4 @@ export { default as FormPillSize } from './_form_pill_size.jsx'
3
3
  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
+ export { default as FormPillColors } from './_form_pill_colors.jsx'
@@ -12,7 +12,7 @@ module Playbook
12
12
  values: %w[none lowercase],
13
13
  default: "none"
14
14
  prop :color, type: Playbook::Props::Enum,
15
- values: %w[primary neutral],
15
+ values: %w[primary neutral success warning error info data_1 data_2 data_3 data_4 data_5 data_6 data_7 data_8 windows siding roofing doors gutters solar insulation accessories],
16
16
  default: "primary"
17
17
  prop :tabindex
18
18
  prop :icon
@@ -9,7 +9,7 @@ module Playbook
9
9
  prop :border, type: Playbook::Props::Boolean,
10
10
  default: false
11
11
  prop :fixed_width, type: Playbook::Props::Boolean,
12
- default: false
12
+ default: true
13
13
  prop :flip, type: Playbook::Props::Enum,
14
14
  values: ["horizontal", "vertical", "both", nil],
15
15
  default: nil
@@ -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
  </>
@@ -34,6 +34,7 @@ type MultiLevelSelectProps = {
34
34
  onSelect?: (prop: { [key: string]: any }) => void
35
35
  selectedIds?: string[]
36
36
  variant?: "multi" | "single"
37
+ pillColor?: "primary" | "neutral" | "success" | "warning" | "error" | "info" | "data_1" | "data_2" | "data_3" | "data_4" | "data_5" | "data_6" | "data_7" | "data_8" | "windows" | "siding" | "roofing" | "doors" | "gutters" | "solar" | "insulation" | "accessories",
37
38
  } & GlobalProps
38
39
 
39
40
  const MultiLevelSelect = (props: MultiLevelSelectProps) => {
@@ -50,7 +51,8 @@ const MultiLevelSelect = (props: MultiLevelSelectProps) => {
50
51
  treeData,
51
52
  onSelect = () => null,
52
53
  selectedIds,
53
- variant = "multi"
54
+ variant = "multi",
55
+ pillColor = "primary"
54
56
  } = props
55
57
 
56
58
  const ariaProps = buildAriaProps(aria)
@@ -86,6 +88,9 @@ const MultiLevelSelect = (props: MultiLevelSelectProps) => {
86
88
  item: []
87
89
  })
88
90
 
91
+ const arrowDownElementId = `arrow_down_${id}`
92
+ const arrowUpElementId = `arrow_up_${id}`
93
+
89
94
  const modifyRecursive = (tree: { [key: string]: any }[], check: boolean) => {
90
95
  if (!Array.isArray(tree)) {
91
96
  return
@@ -171,7 +176,12 @@ const MultiLevelSelect = (props: MultiLevelSelectProps) => {
171
176
  useEffect(() => {
172
177
  // Function to handle clicks outside the dropdown
173
178
  const handleClickOutside = (event: any) => {
174
- if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
179
+ if (
180
+ dropdownRef.current &&
181
+ !dropdownRef.current.contains(event.target) &&
182
+ event.target.id !== arrowDownElementId &&
183
+ event.target.id !== arrowUpElementId
184
+ ) {
175
185
  setIsDropdownClosed(true)
176
186
  }
177
187
  }
@@ -258,7 +268,6 @@ const MultiLevelSelect = (props: MultiLevelSelectProps) => {
258
268
 
259
269
  // Handle click on input wrapper(entire div with pills, typeahead, etc) so it doesn't close when input or form pill is clicked
260
270
  const handleInputWrapperClick = (e: any) => {
261
- e.stopPropagation()
262
271
  if (
263
272
  e.target.id === "multiselect_input" ||
264
273
  e.target.classList.contains("pb_form_pill_tag")
@@ -467,6 +476,7 @@ const MultiLevelSelect = (props: MultiLevelSelectProps) => {
467
476
  inputDisplay === "pills"
468
477
  ? returnedArray.map((item, index) => (
469
478
  <FormPill
479
+ color={pillColor}
470
480
  key={index}
471
481
  onClick={(event: any) => handlePillClose(event, item)}
472
482
  text={item.label}
@@ -479,6 +489,7 @@ const MultiLevelSelect = (props: MultiLevelSelectProps) => {
479
489
  inputDisplay === "pills"
480
490
  ? defaultReturn.map((item, index) => (
481
491
  <FormPill
492
+ color={pillColor}
482
493
  key={index}
483
494
  onClick={(event: any) => handlePillClose(event, item)}
484
495
  text={item.label}
@@ -514,16 +525,20 @@ const MultiLevelSelect = (props: MultiLevelSelectProps) => {
514
525
  </div>
515
526
 
516
527
  {isDropdownClosed ? (
517
- <div key="chevron-down">
528
+ <div id={arrowDownElementId}
529
+ key="chevron-down">
518
530
  <Icon
519
531
  icon="chevron-down"
532
+ id={arrowDownElementId}
520
533
  size="xs"
521
534
  />
522
535
  </div>
523
536
  ) : (
524
- <div key="chevron-up">
537
+ <div id={arrowUpElementId}
538
+ key="chevron-up">
525
539
  <Icon
526
540
  icon="chevron-up"
541
+ id={arrowUpElementId}
527
542
  size="xs"
528
543
  />
529
544
  </div>
@@ -0,0 +1,72 @@
1
+ <% treeData = [{
2
+ label: "Power Home Remodeling",
3
+ value: "Power Home Remodeling",
4
+ id: "100",
5
+ expanded: true,
6
+ children: [
7
+ {
8
+ label: "People",
9
+ value: "People",
10
+ id: "101",
11
+ expanded: true,
12
+ children: [
13
+ {
14
+ label: "Talent Acquisition",
15
+ value: "Talent Acquisition",
16
+ id: "102",
17
+ },
18
+ {
19
+ label: "Business Affairs",
20
+ value: "Business Affairs",
21
+ id: "103",
22
+ children: [
23
+ {
24
+ label: "Initiatives",
25
+ value: "Initiatives",
26
+ id: "104",
27
+ },
28
+ {
29
+ label: "Learning & Development",
30
+ value: "Learning & Development",
31
+ id: "105",
32
+ },
33
+ ],
34
+ },
35
+ {
36
+ label: "People Experience",
37
+ value: "People Experience",
38
+ id: "106",
39
+ },
40
+ ],
41
+ },
42
+ {
43
+ label: "Contact Center",
44
+ value: "Contact Center",
45
+ id: "107",
46
+ children: [
47
+ {
48
+ label: "Appointment Management",
49
+ value: "Appointment Management",
50
+ id: "108",
51
+ },
52
+ {
53
+ label: "Customer Service",
54
+ value: "Customer Service",
55
+ id: "109",
56
+ },
57
+ {
58
+ label: "Energy",
59
+ value: "Energy",
60
+ id: "110",
61
+ },
62
+ ],
63
+ },
64
+ ],
65
+ }] %>
66
+
67
+ <%= pb_rails("multi_level_select", props: {
68
+ id: "multi-level-select-default-rails",
69
+ name: "my_array",
70
+ tree_data: treeData,
71
+ pill_color: "neutral"
72
+ }) %>