playbook_ui 14.9.0.pre.rc.18 → 14.10.0.pre.alpha.PBNTR775formmatingmaskdefaultvalue5137

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/Components/CollapsibleTrail.tsx +1 -6
  3. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +11 -3
  4. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +62 -18
  5. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +2 -2
  6. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_collapsible_trail_rails.html.erb +36 -0
  7. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_collapsible_trail_rails.md +1 -0
  8. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination.jsx +50 -0
  9. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination.md +1 -0
  10. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.jsx +57 -0
  11. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.md +5 -0
  12. data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_pagination_mock_data.json +5600 -0
  13. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +3 -0
  14. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +2 -0
  15. data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +4 -2
  16. data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +5 -3
  17. data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +8 -0
  18. data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +2 -0
  19. data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.html.erb +8 -0
  20. data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb +2 -0
  21. data/app/pb_kits/playbook/pb_avatar/_avatar.scss +0 -2
  22. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom.jsx +53 -49
  23. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom_rails.html.erb +29 -36
  24. data/app/pb_kits/playbook/pb_body/_body.scss +14 -13
  25. data/app/pb_kits/playbook/pb_body/_body_mixins.scss +22 -16
  26. data/app/pb_kits/playbook/pb_bread_crumbs/docs/_bread_crumbs_default.jsx +6 -0
  27. data/app/pb_kits/playbook/pb_caption/_caption_mixin.scss +2 -1
  28. data/app/pb_kits/playbook/pb_card/_card.tsx +7 -7
  29. data/app/pb_kits/playbook/pb_card/_card_mixin.scss +2 -2
  30. data/app/pb_kits/playbook/pb_card/docs/_card_header.html.erb +21 -1
  31. data/app/pb_kits/playbook/pb_card/docs/_card_header.jsx +50 -0
  32. data/app/pb_kits/playbook/pb_card/docs/_card_header.md +1 -1
  33. data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +9 -4
  34. data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleContent.tsx +2 -2
  35. data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.tsx +2 -2
  36. data/app/pb_kits/playbook/pb_drawer/_drawer.tsx +2 -2
  37. data/app/pb_kits/playbook/pb_file_upload/_file_upload.scss +5 -0
  38. data/app/pb_kits/playbook/pb_file_upload/_file_upload.tsx +7 -2
  39. data/app/pb_kits/playbook/pb_file_upload/file_upload.html.erb +8 -2
  40. data/app/pb_kits/playbook/pb_form_group/_error_state_mixin.scss +57 -0
  41. data/app/pb_kits/playbook/pb_form_group/_form_group.scss +11 -2
  42. data/app/pb_kits/playbook/pb_gauge/_gauge.scss +31 -1
  43. data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +3 -3
  44. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex.jsx +25 -5
  45. data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.tsx +17 -1
  46. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_emphasis.html.erb +17 -1
  47. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_emphasis.jsx +15 -0
  48. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_emphasis.md +2 -1
  49. data/app/pb_kits/playbook/pb_home_address_street/home_address_street.rb +15 -1
  50. data/app/pb_kits/playbook/pb_home_address_street/none_emphasis.html.erb +32 -0
  51. data/app/pb_kits/playbook/pb_home_address_street/none_emphasis.rb +29 -0
  52. data/app/pb_kits/playbook/pb_layout/_layout.tsx +30 -11
  53. data/app/pb_kits/playbook/pb_link/_link.scss +3 -3
  54. data/app/pb_kits/playbook/pb_nav/_bold_mixin.scss +11 -1
  55. data/app/pb_kits/playbook/pb_nav/_collapsible_nav.scss +16 -2
  56. data/app/pb_kits/playbook/pb_nav/_vertical_nav.scss +1 -1
  57. data/app/pb_kits/playbook/pb_pagination/_pagination.tsx +2 -2
  58. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +4 -4
  59. data/app/pb_kits/playbook/pb_selectable_card/selectable_card.html.erb +1 -1
  60. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_filter.jsx +166 -0
  61. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_height_width.jsx +2 -0
  62. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_user.jsx +89 -0
  63. data/app/pb_kits/playbook/pb_skeleton_loading/docs/example.yml +2 -1
  64. data/app/pb_kits/playbook/pb_skeleton_loading/docs/index.js +2 -0
  65. data/app/pb_kits/playbook/pb_stat_change/_stat_change.tsx +44 -36
  66. data/app/pb_kits/playbook/pb_stat_change/stat_change.html.erb +4 -4
  67. data/app/pb_kits/playbook/pb_table/_table.tsx +6 -6
  68. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns.html.erb +77 -0
  69. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns_rails.md +1 -0
  70. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.jsx +75 -0
  71. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.md +1 -0
  72. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click.jsx +108 -0
  73. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click.md +2 -0
  74. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content.jsx +94 -0
  75. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content.md +0 -0
  76. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows.jsx +83 -0
  77. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows.md +3 -0
  78. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table.jsx +120 -0
  79. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table.md +1 -0
  80. data/app/pb_kits/playbook/pb_table/docs/example.yml +7 -0
  81. data/app/pb_kits/playbook/pb_table/docs/index.js +5 -0
  82. data/app/pb_kits/playbook/pb_table/index.ts +102 -26
  83. data/app/pb_kits/playbook/pb_table/styles/_all.scss +2 -1
  84. data/app/pb_kits/playbook/pb_table/styles/_collapsible.scss +35 -0
  85. data/app/pb_kits/playbook/pb_table/styles/_scroll.scss +28 -3
  86. data/app/pb_kits/playbook/pb_table/styles/_sticky_columns.scss +0 -1
  87. data/app/pb_kits/playbook/pb_table/subcomponents/_table_row.tsx +106 -1
  88. data/app/pb_kits/playbook/pb_table/table.html.erb +8 -2
  89. data/app/pb_kits/playbook/pb_table/table.rb +21 -2
  90. data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +43 -4
  91. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask.jsx +88 -0
  92. data/app/pb_kits/playbook/pb_text_input/docs/example.yml +1 -0
  93. data/app/pb_kits/playbook/pb_text_input/docs/index.js +1 -0
  94. data/app/pb_kits/playbook/pb_text_input/inputMask.ts +87 -0
  95. data/app/pb_kits/playbook/pb_text_input/text_input.test.js +139 -2
  96. data/app/pb_kits/playbook/pb_title/_title.scss +6 -5
  97. data/app/pb_kits/playbook/pb_title/_title_mixin.scss +13 -0
  98. data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +115 -46
  99. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_highlight.jsx +9 -2
  100. data/app/pb_kits/playbook/pb_typeahead/typeahead.html.erb +3 -2
  101. data/app/pb_kits/playbook/tokens/_titles.scss +0 -8
  102. data/app/pb_kits/playbook/utilities/_hover.scss +11 -2
  103. data/app/pb_kits/playbook/utilities/globalProps.ts +2 -0
  104. data/app/pb_kits/playbook/utilities/test/globalProps/hover.test.js +15 -0
  105. data/dist/chunks/{_typeahead-B8fkIeXA.js → _typeahead-CoIYBETL.js} +3 -3
  106. data/dist/chunks/_weekday_stacked-Qj3GFYzA.js +45 -0
  107. data/dist/chunks/{lib-SyD3buPZ.js → lib-sMFo2JZy.js} +3 -3
  108. data/dist/chunks/{pb_form_validation-Dt8UJgrJ.js → pb_form_validation-CgvjWbOK.js} +1 -1
  109. data/dist/chunks/vendor.js +1 -1
  110. data/dist/menu.yml +1 -1
  111. data/dist/playbook-doc.js +1 -1
  112. data/dist/playbook-rails-react-bindings.js +1 -1
  113. data/dist/playbook-rails.js +1 -1
  114. data/dist/playbook.css +1 -1
  115. data/lib/playbook/hover.rb +7 -1
  116. data/lib/playbook/version.rb +2 -2
  117. metadata +33 -6
  118. data/dist/chunks/_weekday_stacked-CiL8BjKa.js +0 -45
@@ -0,0 +1,87 @@
1
+ type InputMask = {
2
+ format: (value: string) => string
3
+ formatDefaultValue: (value: string) => string
4
+ pattern: string
5
+ placeholder: string
6
+ }
7
+
8
+ type InputMaskDictionary = {
9
+ [key in 'currency' | 'zipCode' | 'postalCode' | 'ssn']: InputMask
10
+ }
11
+
12
+ const formatCurrencyDefaultValue = (value: string): string => {
13
+ // Remove non-numeric characters except for the decimal point
14
+ const numericValue = value.replace(/[^0-9.]/g, '')
15
+
16
+ if (!numericValue) return ''
17
+
18
+ // Parse the numeric value as a float to handle decimals
19
+ const dollars = parseFloat(numericValue)
20
+ if (isNaN(dollars) || dollars === 0) return ''
21
+
22
+ // Format as currency
23
+ return new Intl.NumberFormat('en-US', {
24
+ style: 'currency',
25
+ currency: 'USD',
26
+ maximumFractionDigits: 2,
27
+ }).format(dollars)
28
+ }
29
+
30
+ const formatCurrency = (value: string): string => {
31
+ const numericValue = value.replace(/[^0-9]/g, '').slice(0, 15)
32
+
33
+ if (!numericValue) return ''
34
+
35
+ const dollars = parseFloat((parseInt(numericValue) / 100).toFixed(2))
36
+ if (dollars === 0) return ''
37
+
38
+ return new Intl.NumberFormat('en-US', {
39
+ style: 'currency',
40
+ currency: 'USD',
41
+ maximumFractionDigits: 2,
42
+ }).format(dollars)
43
+ }
44
+
45
+ const formatBasicPostal = (value: string): string => {
46
+ return value.replace(/\D/g, '').slice(0, 5)
47
+ }
48
+
49
+ const formatExtendedPostal = (value: string): string => {
50
+ const cleaned = value.replace(/\D/g, '').slice(0, 9)
51
+ return cleaned.replace(/(\d{5})(?=\d)/, '$1-')
52
+ }
53
+
54
+ const formatSSN = (value: string): string => {
55
+ const cleaned = value.replace(/\D/g, '').slice(0, 9)
56
+ return cleaned
57
+ .replace(/(\d{5})(?=\d)/, '$1-')
58
+ .replace(/(\d{3})(?=\d)/, '$1-')
59
+ }
60
+
61
+ export const INPUTMASKS: InputMaskDictionary = {
62
+ currency: {
63
+ format: formatCurrency,
64
+ formatDefaultValue: formatCurrencyDefaultValue,
65
+ // eslint-disable-next-line no-useless-escape
66
+ pattern: '^\\$\\d{1,3}(?:,\\d{3})*(?:\\.\\d{2})?$',
67
+ placeholder: '$0.00',
68
+ },
69
+ zipCode: {
70
+ format: formatBasicPostal,
71
+ formatDefaultValue: formatBasicPostal,
72
+ pattern: '\\d{5}',
73
+ placeholder: '12345',
74
+ },
75
+ postalCode: {
76
+ format: formatExtendedPostal,
77
+ formatDefaultValue: formatExtendedPostal,
78
+ pattern: '\\d{5}-\\d{4}',
79
+ placeholder: '12345-6789',
80
+ },
81
+ ssn: {
82
+ format: formatSSN,
83
+ formatDefaultValue: formatSSN,
84
+ pattern: '\\d{3}-\\d{2}-\\d{4}',
85
+ placeholder: '123-45-6789',
86
+ },
87
+ }
@@ -1,5 +1,5 @@
1
- import React from 'react'
2
- import { render, screen } from '../utilities/test-utils'
1
+ import React, { useState } from 'react'
2
+ import { render, screen, fireEvent, within } from '../utilities/test-utils'
3
3
 
4
4
  import TextInput from './_text_input'
5
5
 
@@ -89,3 +89,140 @@ test('returns additional class name', () => {
89
89
  const kit = screen.getByTestId(testId)
90
90
  expect(kit).toHaveClass(`${kitClass} mb_lg`)
91
91
  })
92
+
93
+
94
+ const TextInputCurrencyMask = (props) => {
95
+ const [currency, setValue] = useState('')
96
+ const handleOnChange = ({ target }) => {
97
+ setValue(target.value)
98
+ }
99
+
100
+ return (
101
+ <TextInput
102
+ mask="currency"
103
+ onChange={handleOnChange}
104
+ value={currency}
105
+ {...props}
106
+ />
107
+ )
108
+ }
109
+
110
+ test('returns masked currency value', () => {
111
+ render(
112
+ <TextInputCurrencyMask
113
+ data={{ testid: testId }}
114
+ />
115
+ )
116
+
117
+ const kit = screen.getByTestId(testId)
118
+
119
+ const input = within(kit).getByRole('textbox');
120
+
121
+ fireEvent.change(input, { target: { value: '123456' } });
122
+
123
+ expect(input.value).toBe('$1,234.56')
124
+
125
+ fireEvent.change(input, { target: { value: '1' } });
126
+
127
+ expect(input.value).toBe('$0.01')
128
+
129
+ fireEvent.change(input, { target: { value: '' } });
130
+
131
+ expect(input.value).toBe('')
132
+ })
133
+
134
+ const TextInputZipCodeMask = (props) => {
135
+ const [zipCode, setValue] = useState('')
136
+ const handleOnChange = ({ target }) => {
137
+ setValue(target.value)
138
+ }
139
+
140
+ return (
141
+ <TextInput
142
+ mask="zipCode"
143
+ onChange={handleOnChange}
144
+ value={zipCode}
145
+ {...props}
146
+ />
147
+ )
148
+ }
149
+
150
+ test('returns masked zip code value', () => {
151
+ render(
152
+ <TextInputZipCodeMask
153
+ data={{ testid: testId }}
154
+ />
155
+ )
156
+
157
+ const kit = screen.getByTestId(testId)
158
+
159
+ const input = within(kit).getByRole('textbox');
160
+
161
+ fireEvent.change(input, { target: { value: '123456' } });
162
+
163
+ expect(input.value).toBe('12345')
164
+ })
165
+
166
+ const TextInputPostalCodeMask = (props) => {
167
+ const [postalCode, setValue] = useState('')
168
+ const handleOnChange = ({ target }) => {
169
+ setValue(target.value)
170
+ }
171
+
172
+ return (
173
+ <TextInput
174
+ mask="postalCode"
175
+ onChange={handleOnChange}
176
+ value={postalCode}
177
+ {...props}
178
+ />
179
+ )
180
+ }
181
+
182
+ test('returns masked postal code value', () => {
183
+ render(
184
+ <TextInputPostalCodeMask
185
+ data={{ testid: testId }}
186
+ />
187
+ )
188
+
189
+ const kit = screen.getByTestId(testId)
190
+
191
+ const input = within(kit).getByRole('textbox');
192
+
193
+ fireEvent.change(input, { target: { value: '123456789' } });
194
+
195
+ expect(input.value).toBe('12345-6789')
196
+ })
197
+
198
+ const TextInputSSNMask = (props) => {
199
+ const [ssn, setValue] = useState('')
200
+ const handleOnChange = ({ target }) => {
201
+ setValue(target.value)
202
+ }
203
+
204
+ return (
205
+ <TextInput
206
+ mask="ssn"
207
+ onChange={handleOnChange}
208
+ value={ssn}
209
+ {...props}
210
+ />
211
+ )
212
+ }
213
+
214
+ test('returns masked ssn value', () => {
215
+ render(
216
+ <TextInputSSNMask
217
+ data={{ testid: testId }}
218
+ />
219
+ )
220
+
221
+ const kit = screen.getByTestId(testId)
222
+
223
+ const input = within(kit).getByRole('textbox');
224
+
225
+ fireEvent.change(input, { target: { value: '123456789' } });
226
+
227
+ expect(input.value).toBe('123-45-6789')
228
+ })
@@ -49,10 +49,11 @@
49
49
  }
50
50
 
51
51
  &.dark {
52
- @include pb_title_dark;
53
- }
54
-
55
- &.dark[class*=_link] {
56
- @include pb_title_dark_link;
52
+ @include title_dark;
53
+ @each $name, $color in $pb_dark_title_colors {
54
+ &[class*="_#{$name}"] {
55
+ color: $color;
56
+ }
57
+ }
57
58
  }
58
59
  }
@@ -9,6 +9,15 @@ $pb_title_colors: (
9
9
  link: $primary
10
10
  );
11
11
 
12
+ $pb_dark_title_colors: (
13
+ default: $text_dk_default,
14
+ light: $text_dk_light,
15
+ lighter: $text_dk_lighter,
16
+ success: $success,
17
+ error: $error_dark,
18
+ link: $active_dark
19
+ );
20
+
12
21
  @mixin title_colors {
13
22
  @each $name, $color in $pb_title_colors {
14
23
  &[class*=_#{$name}] {
@@ -16,3 +25,7 @@ $pb_title_colors: (
16
25
  }
17
26
  }
18
27
  }
28
+
29
+ @mixin title_dark {
30
+ color: $text_dk_default;
31
+ }
@@ -90,50 +90,7 @@
90
90
  }
91
91
  }
92
92
  }
93
- &[class*=dark] {
94
- .pb_typeahead_wrapper .pb_typeahead_loading_indicator {
95
- color: $text_dk_light;
96
- }
97
- [class^=pb_text_input_kit].dark .text_input_wrapper .text_input {
98
- display: inherit !important;
99
- }
100
- .typeahead-kit-select__menu {
101
- background-color: $bg_dark;
102
- color: $white;
103
- z-index: $z_1;
104
- }
105
- .typeahead-kit-select__option:hover {
106
- background-color: $active_dark;
107
- }
108
- .typeahead-kit-select__indicator:hover {
109
- color: $white;
110
- }
111
- .typeahead-kit-select__input {
112
- color: white;
113
- input:focus {
114
- box-shadow: none;
115
- }
116
- }
117
- .typeahead-kit-select__single-value {
118
- color: white;
119
- }
120
- .typeahead-kit-select__option--is-focused {
121
- background-color: $active_dark;
122
- }
123
- [class^=pb_list_kit] {
124
- background-color: $bg_dark;
125
- }
126
- .pb_item_kit {
127
- button {
128
- color: white !important;
129
- }
130
- @media (hover:hover) {
131
- &:hover {
132
- background-color: rgba($white,.1);
133
- }
134
- }
135
- }
136
- }
93
+
137
94
  &.react-select, &.react-select .dark {
138
95
  .text_input {
139
96
  display: inherit;
@@ -182,7 +139,7 @@
182
139
  }
183
140
  }
184
141
  }
185
-
142
+
186
143
  .typeahead-kit-select__menu {
187
144
  z-index: $z_1;
188
145
  .typeahead-kit-select__menu-list {
@@ -215,5 +172,117 @@
215
172
  }
216
173
  }
217
174
  }
218
- }
219
175
 
176
+ &[class*=dark] {
177
+ .pb_typeahead_wrapper .pb_typeahead_loading_indicator {
178
+ color: $text_dk_light;
179
+ }
180
+ .pb_text_input_kit_label {
181
+ color: $text_dk_light;
182
+ }
183
+ [class^=pb_text_input_kit].dark .text_input_wrapper .text_input {
184
+ display: inherit !important;
185
+ }
186
+ .typeahead-kit-select__menu {
187
+ background-color: $bg_dark;
188
+ color: $white;
189
+ z-index: $z_1;
190
+ .typeahead-kit-select__menu-list {
191
+ padding: 0;
192
+ }
193
+ .typeahead-kit-select__single-value {
194
+ color: white;
195
+ }
196
+
197
+ .typeahead-kit-select__option {
198
+ &.typeahead-kit-select__option--is-focused {
199
+ background-color: $hover_dark;
200
+ }
201
+ &.typeahead-kit-select__option--is-selected {
202
+ background-color: $active_dark;
203
+ }
204
+ }
205
+ }
206
+ .text_input_wrapper{
207
+ color: text_dk_default;
208
+ }
209
+ .typeahead-kit-select__option:hover {
210
+ background-color: $active_dark;
211
+ }
212
+ .typeahead-kit-select__indicator {
213
+ color: $text_dk_default;
214
+ }
215
+ .typeahead-kit-select__indicator:hover {
216
+ color: $text_dk_lighter;
217
+ }
218
+ .typeahead-kit-select__input {
219
+ color: white;
220
+ input:focus {
221
+ box-shadow: none;
222
+ }
223
+ }
224
+ .typeahead-kit-select__option--is-focused {
225
+ background-color: $active_dark;
226
+ }
227
+ [class^=pb_list_kit] {
228
+ background-color: $bg_dark;
229
+ }
230
+ .pb_item_kit {
231
+ button {
232
+ color: white !important;
233
+ }
234
+ @media (hover:hover) {
235
+ &:hover {
236
+ background-color: $hover_dark;
237
+ }
238
+ }
239
+ }
240
+
241
+ .text_input {
242
+ .typeahead-kit-select__input-container{
243
+ color: $text_dk_default
244
+ }
245
+ .typeahead-kit-select {
246
+ &__single-value{
247
+ color: $text_dk_default;
248
+ }
249
+ }
250
+ &.typeahead-kit-select {
251
+ &__single-value{
252
+ color: $text_dk_default;
253
+ }
254
+ &__control {
255
+ &--is-focused {
256
+ @include pb_textarea_focus;
257
+ @include transition_default;
258
+ border-color: $active_dark;
259
+ background-color: rgba($focus_input_dark,$opacity_5);
260
+ box-shadow: none;
261
+ .typeahead-plus-icon {
262
+ display: none;
263
+ }
264
+ }
265
+ }
266
+ }
267
+ }
268
+
269
+ &.inline {
270
+ &:not(:hover) {
271
+ .text_input {
272
+ background-color: transparent;
273
+ border-color: transparent;
274
+ }
275
+ .typeahead-kit-select__indicator {
276
+ color: transparent;
277
+ }
278
+ }
279
+
280
+ &:hover {
281
+ .text_input {
282
+ background-color: $hover_dark;
283
+ }
284
+ }
285
+ }
286
+
287
+ }
288
+ }
@@ -55,11 +55,18 @@ const TypeaheadWithHighlight = (props) => {
55
55
  marginRight="sm"
56
56
  name={name}
57
57
  size="sm"
58
+ {...props}
58
59
  />
59
60
  </FlexItem>
60
61
  <FlexItem>
61
- <Title size={4}><span dangerouslySetInnerHTML={{ __html: highlighted(name) }} /></Title>
62
- <Body color="light">
62
+ <Title
63
+ size={4}
64
+ {...props}
65
+ >
66
+ <span dangerouslySetInnerHTML={{ __html: highlighted(name) }} /></Title>
67
+ <Body color="light"
68
+ {...props}
69
+ >
63
70
  <span dangerouslySetInnerHTML={{ __html: highlighted(title) }} />{" • "}
64
71
  {territory}
65
72
  </Body>
@@ -25,8 +25,9 @@
25
25
  validation: object.validation,
26
26
  label: object.label,
27
27
  id: object.input_options[:id],
28
+ dark: object.dark,
28
29
  }) %>
29
- <%= pb_rails("list", props: { ordered: false, borderless: false, xpadding: true, role: "status", aria: { live: "polite" }, data: { pb_typeahead_kit_results: true } }) do %>
30
+ <%= pb_rails("list", props: { ordered: false, borderless: true, xpadding: true, role: "status", aria: { live: "polite" }, data: { pb_typeahead_kit_results: true } }) do %>
30
31
  <% end %>
31
32
  </div>
32
33
 
@@ -36,4 +37,4 @@
36
37
  <% end %>
37
38
  </template>
38
39
  <% end %>
39
- <% end %>
40
+ <% end %>
@@ -33,14 +33,6 @@
33
33
  @include pb_title($heading_4, $bolder, $letterSpacing: $lspace_normal);
34
34
  }
35
35
 
36
- @mixin pb_title_dark {
37
- color: $text_dk_default;
38
- }
39
-
40
- @mixin pb_title_dark_link {
41
- color: $active_dark;
42
- }
43
-
44
36
  @mixin pb_title_bold {
45
37
  font-weight: $bolder;
46
38
  }
@@ -20,6 +20,13 @@
20
20
  }
21
21
  }
22
22
 
23
+ @mixin hover-underline {
24
+ .hover_underline:hover {
25
+ text-decoration: underline;
26
+ transition: text-decoration $transition-speed ease;
27
+ }
28
+ }
29
+
23
30
  @mixin hover-color-classes($colors-list) {
24
31
  @each $name, $color in $colors-list {
25
32
  .hover_background-#{"" + $name}:hover {
@@ -32,7 +39,9 @@
32
39
  }
33
40
  }
34
41
  }
35
-
42
+
43
+
44
+ @include hover-underline;
36
45
  @include hover-scale-classes($scales);
37
46
  @include hover-shadow-classes($box_shadows);
38
47
  @include hover-color-classes($product_colors);
@@ -64,4 +73,4 @@
64
73
  .group_hover.hover_visibility {
65
74
  opacity: 1;
66
75
  }
67
- }
76
+ }
@@ -64,6 +64,7 @@ type Hover = Shadow & {
64
64
  background?: string,
65
65
  color?: string,
66
66
  scale?: "sm" | "md" | "lg",
67
+ underline?: boolean,
67
68
  visibility?: boolean,
68
69
  }
69
70
 
@@ -236,6 +237,7 @@ const PROP_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => string} =
236
237
  if (!hover) return css;
237
238
  css += hover.shadow ? `hover_shadow_${hover.shadow} ` : '';
238
239
  css += hover.background ? `hover_background-${hover.background } ` : '';
240
+ css += hover.underline ? `hover_underline ` : '';
239
241
  css += hover.scale ? `hover_scale_${hover.scale} ` : '';
240
242
  css += hover.color ? `hover_color-${hover.color } ` : '';
241
243
  css += hover.visibility ? `hover_visibility` : '';
@@ -57,6 +57,19 @@ test('Hover Props: returns proper class name', () => {
57
57
  expectedClassName = `hover_scale_xl`;
58
58
  expect(kit).toHaveClass(expectedClassName);
59
59
 
60
+ const testIdUnderline = `${testSubject}-hover-underline`;
61
+ render(
62
+ <Body
63
+ data={{ testid: testIdUnderline }}
64
+ hover={{ underline: true }}
65
+ text="Hi"
66
+ />
67
+ );
68
+
69
+ kit = screen.getByTestId(testIdUnderline);
70
+ expectedClassName = `hover_underline`;
71
+ expect(kit).toHaveClass(expectedClassName);
72
+
60
73
  const testIdMultiple = `${testSubject}-hover-multiple`;
61
74
  render(
62
75
  <Body
@@ -66,6 +79,7 @@ test('Hover Props: returns proper class name', () => {
66
79
  background: 'error',
67
80
  shadow: 'deeper',
68
81
  scale: 'xl',
82
+ underline: true,
69
83
  }}
70
84
  text="Hi"
71
85
  />
@@ -76,4 +90,5 @@ test('Hover Props: returns proper class name', () => {
76
90
  expect(kit).toHaveClass('hover_background-error');
77
91
  expect(kit).toHaveClass('hover_shadow_deeper');
78
92
  expect(kit).toHaveClass('hover_scale_xl');
93
+ expect(kit).toHaveClass('hover_underline');
79
94
  });