playbook_ui 14.1.0.pre.alpha.PA1477timestampkit3601 → 14.1.0.pre.alpha.PBNTR417addcolorsupdatedefaultcolor3608

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 (42) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_form_pill/_form_pill.scss +245 -23
  3. data/app/pb_kits/playbook/pb_form_pill/_form_pill.test.jsx +5 -5
  4. data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +2 -2
  5. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_colors.html.erb +117 -0
  6. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_colors.jsx +227 -0
  7. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_colors.md +1 -0
  8. data/app/pb_kits/playbook/pb_form_pill/docs/example.yml +2 -0
  9. data/app/pb_kits/playbook/pb_form_pill/docs/index.js +1 -0
  10. data/app/pb_kits/playbook/pb_form_pill/form_pill.rb +2 -2
  11. data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +5 -1
  12. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_color.html.erb +72 -0
  13. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_color.jsx +91 -0
  14. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_color_rails.md +1 -0
  15. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_color_react.md +1 -0
  16. data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +2 -0
  17. data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +1 -0
  18. data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.rb +4 -0
  19. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_elapsed.html.erb +2 -2
  20. data/app/pb_kits/playbook/pb_timestamp/timestamp.rb +2 -46
  21. data/app/pb_kits/playbook/pb_typeahead/_typeahead.test.jsx +18 -2
  22. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +4 -0
  23. data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +26 -18
  24. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_color.html.erb +31 -0
  25. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_color.jsx +26 -0
  26. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_color_rails.md +1 -0
  27. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_color_react.md +1 -0
  28. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +2 -0
  29. data/app/pb_kits/playbook/pb_typeahead/docs/index.js +1 -0
  30. data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +4 -0
  31. data/app/pb_kits/playbook/tokens/_colors.scss +2 -0
  32. data/dist/chunks/{_typeahead-Cq7RLPBA.js → _typeahead-BbHBDL7C.js} +2 -2
  33. data/dist/chunks/{_weekday_stacked-Cykj5kLZ.js → _weekday_stacked-DEfI42pf.js} +1 -1
  34. data/dist/chunks/{lib-DErGXNy3.js → lib-u02fp5X7.js} +1 -1
  35. data/dist/chunks/{pb_form_validation-BC6kh7Hu.js → pb_form_validation-iGj5wwU2.js} +1 -1
  36. data/dist/chunks/vendor.js +1 -1
  37. data/dist/playbook-doc.js +1 -1
  38. data/dist/playbook-rails-react-bindings.js +1 -1
  39. data/dist/playbook-rails.js +1 -1
  40. data/dist/playbook.css +1 -1
  41. data/lib/playbook/version.rb +1 -1
  42. metadata +17 -6
@@ -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="Neutral"
19
+ {...props}
20
+ />
21
+ <FormPill
22
+ color="primary"
23
+ onClick={() => {
24
+ alert('Click!')
25
+ }}
26
+ tabIndex={0}
27
+ text="Primary"
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. Neutral 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,8 +12,8 @@ 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],
16
- default: "primary"
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
+ default: "neutral"
17
17
  prop :tabindex
18
18
  prop :icon
19
19
 
@@ -34,6 +34,7 @@ type MultiLevelSelectProps = {
34
34
  onSelect?: (prop: { [key: string]: any }) => void
35
35
  selectedIds?: string[]
36
36
  variant?: "multi" | "single"
37
+ 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",
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
+ color = "neutral"
54
56
  } = props
55
57
 
56
58
  const ariaProps = buildAriaProps(aria)
@@ -467,6 +469,7 @@ const MultiLevelSelect = (props: MultiLevelSelectProps) => {
467
469
  inputDisplay === "pills"
468
470
  ? returnedArray.map((item, index) => (
469
471
  <FormPill
472
+ color={color}
470
473
  key={index}
471
474
  onClick={(event: any) => handlePillClose(event, item)}
472
475
  text={item.label}
@@ -479,6 +482,7 @@ const MultiLevelSelect = (props: MultiLevelSelectProps) => {
479
482
  inputDisplay === "pills"
480
483
  ? defaultReturn.map((item, index) => (
481
484
  <FormPill
485
+ color={color}
482
486
  key={index}
483
487
  onClick={(event: any) => handlePillClose(event, item)}
484
488
  text={item.label}
@@ -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
+ color: "primary"
72
+ }) %>
@@ -0,0 +1,91 @@
1
+ import React from "react";
2
+ import MultiLevelSelect from "../_multi_level_select";
3
+
4
+ const treeData = [
5
+ {
6
+ label: "Power Home Remodeling",
7
+ value: "Power Home Remodeling",
8
+ id: "powerhome1",
9
+ expanded: true,
10
+ children: [
11
+ {
12
+ label: "People",
13
+ value: "People",
14
+ id: "people1",
15
+ expanded: true,
16
+ children: [
17
+ {
18
+ label: "Talent Acquisition",
19
+ value: "Talent Acquisition",
20
+ id: "talent1",
21
+ },
22
+ {
23
+ label: "Business Affairs",
24
+ value: "Business Affairs",
25
+ id: "business1",
26
+ children: [
27
+ {
28
+ label: "Initiatives",
29
+ value: "Initiatives",
30
+ id: "initiative1",
31
+ },
32
+ {
33
+ label: "Learning & Development",
34
+ value: "Learning & Development",
35
+ id: "development1",
36
+ },
37
+ ],
38
+ },
39
+ {
40
+ label: "People Experience",
41
+ value: "People Experience",
42
+ id: "experience1",
43
+ },
44
+ ],
45
+ },
46
+ {
47
+ label: "Contact Center",
48
+ value: "Contact Center",
49
+ id: "contact1",
50
+ children: [
51
+ {
52
+ label: "Appointment Management",
53
+ value: "Appointment Management",
54
+ id: "appointment1",
55
+ },
56
+ {
57
+ label: "Customer Service",
58
+ value: "Customer Service",
59
+ id: "customer1",
60
+ },
61
+ {
62
+ label: "Energy",
63
+ value: "Energy",
64
+ id: "energy1",
65
+ },
66
+ ],
67
+ },
68
+ ],
69
+ },
70
+ ];
71
+
72
+ const MultiLevelSelectColor = (props) => {
73
+ return (
74
+ <div>
75
+ <MultiLevelSelect
76
+ color="primary"
77
+ id='multiselect-color'
78
+ onSelect={(selectedNodes) =>
79
+ console.log(
80
+ "Selected Items",
81
+ selectedNodes
82
+ )
83
+ }
84
+ treeData={treeData}
85
+ {...props}
86
+ />
87
+ </div>
88
+ )
89
+ };
90
+
91
+ export default MultiLevelSelectColor;
@@ -0,0 +1 @@
1
+ Change the form pill color by passing the optional `color` prop. Product, Data, and Status colors are available options. Check them out <a href="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 `color` prop. Product, Data, and Status colors are available options. Check them out <a href="playbook.powerapp.cloud/kits/form_pill/react#form-pill-colors" target="_blank">here</a> in the Form Pill colors example.
@@ -6,6 +6,7 @@ examples:
6
6
  - multi_level_select_return_all_selected: Return All Selected
7
7
  - multi_level_select_selected_ids: Selected Ids
8
8
  - multi_level_select_with_form: With Form
9
+ - multi_level_select_color: Color
9
10
 
10
11
  react:
11
12
  - multi_level_select_default: Default
@@ -13,3 +14,4 @@ examples:
13
14
  - multi_level_select_single_children_only: Single Select w/ Hidden Radios
14
15
  - multi_level_select_return_all_selected: Return All Selected
15
16
  - multi_level_select_selected_ids_react: Selected Ids
17
+ - multi_level_select_color: Color
@@ -3,3 +3,4 @@ export { default as MultiLevelSelectSingle } from './_multi_level_select_single.
3
3
  export { default as MultiLevelSelectSingleChildrenOnly } from './_multi_level_select_single_children_only.jsx'
4
4
  export { default as MultiLevelSelectReturnAllSelected } from './_multi_level_select_return_all_selected.jsx'
5
5
  export { default as MultiLevelSelectSelectedIdsReact } from "./_multi_level_select_selected_ids_react.jsx"
6
+ export { default as MultiLevelSelectColor } from './_multi_level_select_color.jsx'
@@ -19,6 +19,9 @@ module Playbook
19
19
  prop :variant, type: Playbook::Props::Enum,
20
20
  values: %w[multi single],
21
21
  default: "multi"
22
+ prop :color, type: Playbook::Props::Enum,
23
+ 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],
24
+ default: "neutral"
22
25
 
23
26
  def classname
24
27
  generate_classname("pb_multi_level_select")
@@ -34,6 +37,7 @@ module Playbook
34
37
  selectedIds: selected_ids,
35
38
  input_name: input_name,
36
39
  variant: variant,
40
+ color: color,
37
41
  }
38
42
  end
39
43
  end
@@ -8,7 +8,7 @@
8
8
  <br>
9
9
 
10
10
  <%= pb_rails("timestamp", props: {
11
- timestamp: DateTime.now - 3.months,
11
+ timestamp: DateTime.now,
12
12
  variant: "elapsed",
13
13
  show_user: false
14
14
  }) %>
@@ -16,7 +16,7 @@
16
16
  <br>
17
17
 
18
18
  <%= pb_rails("timestamp", props: {
19
- timestamp: DateTime.now - 320.days,
19
+ timestamp: DateTime.now,
20
20
  variant: "elapsed",
21
21
  show_user: false,
22
22
  hide_updated: true
@@ -27,18 +27,6 @@ module Playbook
27
27
  values: %w[default elapsed updated],
28
28
  default: "default"
29
29
 
30
- # Variables to use with pb_time_ago method
31
- SECS_FORTY_FIVE = 45
32
- SECS_PER_MIN = 60
33
- SECS_PER_HOUR = 60 * SECS_PER_MIN # 3,600 seconds
34
- SECS_PER_DAY = 24 * SECS_PER_HOUR # 86,400 seconds
35
- SECS_PER_WEEK = 7 * SECS_PER_DAY # 604,800 seconds
36
- SECS_PER_26 = 26 * SECS_PER_DAY # 26 days = 2,246,400 seconds
37
- SECS_PER_MONTH = 4 * SECS_PER_WEEK # 2,419,200 seconds
38
- SECS_PER_YEAR = 12 * SECS_PER_MONTH # 29,030,400 seconds
39
- SECS_PER_320 = 320 * SECS_PER_DAY # 320 days = 27,648,000 seconds
40
- SECS_PER_CENT = 100 * SECS_PER_YEAR # 3,153,600,000 seconds
41
-
42
30
  def classname
43
31
  generate_classname("pb_timestamp_kit", variant_class, align)
44
32
  end
@@ -85,42 +73,10 @@ module Playbook
85
73
 
86
74
  def format_elapsed_string
87
75
  user_string = show_user ? " by #{text}" : ""
88
- datetime_string = " #{pb_time_ago(pb_date_time.convert_to_timestamp)} ago"
89
- datetime_string[1] = hide_updated ? datetime_string[1].upcase : datetime_string[1]
76
+ datetime_string = " #{time_ago_in_words(pb_date_time.convert_to_timestamp)} ago"
90
77
  updated_string = hide_updated ? "" : "Last updated"
91
- "#{updated_string}#{user_string}#{datetime_string}"
92
- end
93
78
 
94
- def pb_time_ago(value)
95
- time_ago = DateTime.now.to_i - value.to_i
96
- case time_ago
97
- when (0...SECS_FORTY_FIVE)
98
- "a few seconds"
99
- when (SECS_FORTY_FIVE...SECS_PER_MIN)
100
- "a minute"
101
- when (SECS_PER_MIN...SECS_PER_HOUR)
102
- time = time_ago / SECS_PER_MIN
103
- time == 1 ? "a minute" : "#{time_ago / SECS_PER_MIN} minutes"
104
- when (SECS_PER_HOUR...SECS_PER_DAY)
105
- time = time_ago / SECS_PER_HOUR
106
- time == 1 ? "an hour" : "#{time_ago / SECS_PER_HOUR} hours"
107
- when (SECS_PER_DAY...SECS_PER_WEEK)
108
- time = time_ago / SECS_PER_DAY
109
- time == 1 ? "a day" : "#{time_ago / SECS_PER_DAY} days"
110
- when (SECS_PER_WEEK...SECS_PER_26)
111
- time = time_ago / SECS_PER_WEEK
112
- time == 1 ? "a week" : "#{time_ago / SECS_PER_WEEK} weeks"
113
- when (SECS_PER_26...SECS_PER_MONTH)
114
- "a month"
115
- when (SECS_PER_MONTH...SECS_PER_320)
116
- time = time_ago / SECS_PER_MONTH
117
- time == 1 ? "a month" : "#{time_ago / SECS_PER_MONTH} months"
118
- when (SECS_PER_320...SECS_PER_YEAR)
119
- "a year"
120
- when (SECS_PER_YEAR...SECS_PER_CENT)
121
- time = time_ago / SECS_PER_YEAR
122
- time == 1 ? "a year" : "#{time_ago / SECS_PER_YEAR} years"
123
- end
79
+ "#{updated_string}#{user_string}#{datetime_string}"
124
80
  end
125
81
 
126
82
  def datetime_or_text
@@ -63,7 +63,7 @@ test('typeahead with pills', () => {
63
63
  )
64
64
 
65
65
  const kit = screen.getByTestId('pills-test')
66
- const pill = kit.querySelector(".pb_form_pill_kit_primary")
66
+ const pill = kit.querySelector(".pb_form_pill_kit_neutral")
67
67
  expect(pill).toBeInTheDocument()
68
68
  })
69
69
 
@@ -89,7 +89,7 @@ test('typeahead multi select with badges and small pills', () => {
89
89
  )
90
90
 
91
91
  const kit = screen.getByTestId('small-pill-test')
92
- const badge = kit.querySelector(".pb_form_pill_kit_primary.mr_xs.small")
92
+ const badge = kit.querySelector(".pb_form_pill_kit_neutral.mr_xs.small")
93
93
  expect(badge).toBeInTheDocument()
94
94
  })
95
95
 
@@ -107,4 +107,20 @@ test('should pass className prop', () => {
107
107
 
108
108
  const kit = screen.getByTestId('typeahead-test')
109
109
  expect(kit).toHaveClass(className)
110
+ })
111
+
112
+ test('typeahead with colored pills', () => {
113
+ render(
114
+ <Typeahead
115
+ color="primary"
116
+ data={{ testid: 'pills-color-test' }}
117
+ defaultValue={[options[0]]}
118
+ isMulti
119
+ options={options}
120
+ />
121
+ )
122
+
123
+ const kit = screen.getByTestId('pills-color-test')
124
+ const pill = kit.querySelector(".pb_form_pill_kit_primary")
125
+ expect(pill).toBeInTheDocument()
110
126
  })
@@ -45,12 +45,14 @@ type TypeaheadProps = {
45
45
  getOptionLabel?: string | (() => any),
46
46
  getOptionValue?: string | (() => any),
47
47
  name?: string,
48
+ 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",
48
49
  } & GlobalProps
49
50
 
50
51
  export type SelectValueType = {
51
52
  label: string,
52
53
  value: string,
53
54
  imageUrl?: string,
55
+ pillColor?: string,
54
56
  }
55
57
 
56
58
  type TagOnChangeValues = {
@@ -76,6 +78,7 @@ const Typeahead = ({
76
78
  htmlOptions = {},
77
79
  id,
78
80
  loadOptions = noop,
81
+ color,
79
82
  ...props
80
83
  }: TypeaheadProps) => {
81
84
  const selectProps = {
@@ -105,6 +108,7 @@ const Typeahead = ({
105
108
  onCreateOption: null as null,
106
109
  plusIcon: false,
107
110
  onMultiValueClick: (_option: SelectValueType): any => undefined,
111
+ pillColor: color,
108
112
  ...props,
109
113
  }
110
114