playbook_ui 15.1.0.pre.rc.7 → 15.2.0.pre.alpha.PLAY1978bugiconauto11317

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 (56) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableState.ts +7 -0
  3. data/app/pb_kits/playbook/pb_button/docs/_button_managed_disabled.html.erb +31 -0
  4. data/app/pb_kits/playbook/pb_button/docs/_button_managed_disabled.md +7 -0
  5. data/app/pb_kits/playbook/pb_button/docs/_button_managed_disabled_helper.html.erb +21 -0
  6. data/app/pb_kits/playbook/pb_button/docs/_button_managed_disabled_helper.md +7 -0
  7. data/app/pb_kits/playbook/pb_button/docs/example.yml +2 -0
  8. data/app/pb_kits/playbook/pb_button/index.js +99 -0
  9. data/app/pb_kits/playbook/pb_collapsible/__snapshots__/collapsible.test.js.snap +2 -2
  10. data/app/pb_kits/playbook/pb_date_picker/_date_picker.scss +4 -0
  11. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_stacked_alert.html.erb +16 -16
  12. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_stacked_alert.jsx +2 -1
  13. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_status.html.erb +31 -31
  14. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_status.jsx +4 -3
  15. data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +105 -29
  16. data/app/pb_kits/playbook/pb_dropdown/index.js +1 -1
  17. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +11 -0
  18. data/app/pb_kits/playbook/pb_icon/_icon.tsx +1 -2
  19. data/app/pb_kits/playbook/pb_icon/icon.rb +1 -2
  20. data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.tsx +2 -2
  21. data/app/pb_kits/playbook/pb_icon_stat_value/_icon_stat_value.scss +15 -21
  22. data/app/pb_kits/playbook/pb_icon_stat_value/_icon_stat_value.tsx +6 -5
  23. data/app/pb_kits/playbook/pb_icon_stat_value/icon_stat_value.html.erb +2 -0
  24. data/app/pb_kits/playbook/pb_icon_stat_value/icon_stat_value.rb +11 -3
  25. data/app/pb_kits/playbook/pb_icon_stat_value/icon_stat_value.test.js +9 -8
  26. data/app/pb_kits/playbook/pb_list/item.html.erb +1 -1
  27. data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.tsx +1 -1
  28. data/app/pb_kits/playbook/pb_loading_inline/loading_inline.rb +1 -1
  29. data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.scss +36 -9
  30. data/app/pb_kits/playbook/pb_popover/docs/_popover_list.html.erb +2 -2
  31. data/app/pb_kits/playbook/pb_selectable_list/selectable_list_item.html.erb +1 -1
  32. data/app/pb_kits/playbook/pb_text_input/_text_input.scss +3 -0
  33. data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +14 -6
  34. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_default.html.erb +8 -4
  35. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_default.jsx +5 -0
  36. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_default.md +1 -0
  37. data/app/pb_kits/playbook/pb_text_input/text_input.html.erb +3 -1
  38. data/app/pb_kits/playbook/pb_text_input/text_input.rb +6 -0
  39. data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +10 -10
  40. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +39 -1
  41. data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +2 -0
  42. data/app/pb_kits/playbook/utilities/_hover.scss +2 -2
  43. data/app/pb_kits/playbook/utilities/globalProps.ts +2 -2
  44. data/dist/chunks/{_line_graph-C9stNsP3.js → _line_graph-B-R1nzPu.js} +1 -1
  45. data/dist/chunks/_typeahead-DqRbRocY.js +6 -0
  46. data/dist/chunks/{_weekday_stacked-BMwekyel.js → _weekday_stacked-C3YxWFMB.js} +3 -3
  47. data/dist/chunks/vendor.js +1 -1
  48. data/dist/menu.yml +1 -1
  49. data/dist/playbook-doc.js +2 -2
  50. data/dist/playbook-rails-react-bindings.js +1 -1
  51. data/dist/playbook-rails.js +1 -1
  52. data/dist/playbook.css +1 -1
  53. data/lib/playbook/hover.rb +5 -1
  54. data/lib/playbook/version.rb +2 -2
  55. metadata +11 -5
  56. data/dist/chunks/_typeahead-D3MtsWXG.js +0 -6
@@ -10,9 +10,15 @@
10
10
  @import "./scss_partials/dropdown_animation";
11
11
  @import "dropdown_mixin";
12
12
 
13
- [class*="pb_dropdown"] {
13
+ .pb_dropdown_default,
14
+ .pb_dropdown_subtle,
15
+ .pb_dropdown_default_separators_hidden,
16
+ .pb_dropdown_subtle_separators_hidden {
14
17
  .dropdown_wrapper {
15
- [class*="dropdown_trigger_wrapper"] {
18
+ .dropdown_trigger_wrapper,
19
+ .dropdown_trigger_wrapper_focus,
20
+ .dropdown_trigger_wrapper_focus_select_only,
21
+ .dropdown_trigger_wrapper_select_only {
16
22
  @include pb_body;
17
23
  border: 1px solid $border_light;
18
24
  background-color: $white;
@@ -48,11 +54,11 @@
48
54
  transition: box-shadow 0.15s ease-in-out;
49
55
  }
50
56
 
51
- &[class*="_select_only"] {
57
+ &.dropdown_trigger_wrapper_select_only {
52
58
  box-shadow: inset 0 -11px 20px rgba($primary, 0.05);
53
59
  }
54
60
 
55
- &[class*="_focus"] {
61
+ &.dropdown_trigger_wrapper_focus {
56
62
  box-shadow: 0px 0px 0 1px $primary !important;
57
63
  transition: box-shadow 0.1s ease-in-out;
58
64
  }
@@ -69,7 +75,12 @@
69
75
  z-index: $z_1;
70
76
  width: 100%;
71
77
 
72
- [class*="pb_dropdown_option"] {
78
+ .pb_dropdown_option,
79
+ .pb_dropdown_option_list,
80
+ .pb_dropdown_option_selected,
81
+ .pb_dropdown_option_focused,
82
+ .pb_dropdown_option_list_focused,
83
+ .pb_dropdown_option_selected_focused {
73
84
  padding-left: $space_sm;
74
85
  padding-right: $space_sm;
75
86
  padding-top: $space_xs;
@@ -79,11 +90,14 @@
79
90
  background-color: $bg_light;
80
91
  }
81
92
 
82
- &[class*="_focused"] {
93
+ &.pb_dropdown_option_focused,
94
+ &.pb_dropdown_option_list_focused,
95
+ &.pb_dropdown_option_selected_focused {
83
96
  background-color: $bg_light;
84
97
  }
85
98
 
86
- &[class*="_list"] {
99
+ &.pb_dropdown_option_list,
100
+ &.pb_dropdown_option_list_focused {
87
101
  border-bottom: 1px solid $border_light;
88
102
 
89
103
  &:hover, &:focus {
@@ -92,7 +106,8 @@
92
106
  }
93
107
  }
94
108
  }
95
- &[class*="selected"] {
109
+ &.pb_dropdown_option_selected,
110
+ &.pb_dropdown_option_selected_focused {
96
111
  background-color: $primary;
97
112
  color: $white;
98
113
  [class^="pb_body"],
@@ -141,41 +156,66 @@
141
156
  }
142
157
 
143
158
  &.error {
144
- [class*=pb_body_kit] {
159
+ .pb_body_kit_negative {
145
160
  margin-top: $space_xs / 2;
146
161
  }
147
162
 
148
- [class*="dropdown_trigger_wrapper"] {
163
+ .dropdown_trigger_wrapper,
164
+ .dropdown_trigger_wrapper_focus,
165
+ .dropdown_trigger_wrapper_focus_select_only,
166
+ .dropdown_trigger_wrapper_select_only {
149
167
  border-color: $error;
150
168
  box-shadow: none !important;
151
169
  }
152
170
  }
153
171
  }
154
172
 
155
- &[class*="separators_hidden"] {
173
+ &.pb_dropdown_default_separators_hidden,
174
+ &.pb_dropdown_subtle_separators_hidden {
156
175
  .dropdown_wrapper {
157
176
  .pb_dropdown_container {
158
177
 
159
- [class*="pb_dropdown_option"] {
178
+ .pb_dropdown_option,
179
+ .pb_dropdown_option_list,
180
+ .pb_dropdown_option_selected,
181
+ .pb_dropdown_option_focused,
182
+ .pb_dropdown_option_list_focused,
183
+ .pb_dropdown_option_selected_focused {
160
184
  border: none;
161
185
  }
162
186
  }
163
187
  }
164
188
  }
165
189
 
166
- &[class*="subtle"] {
190
+ &.pb_dropdown_subtle,
191
+ &.pb_dropdown_subtle_separators_hidden {
167
192
  .dropdown_wrapper {
168
193
  .pb_dropdown_container {
169
194
 
170
- [class*="pb_dropdown_option"]:first-child {
195
+ .pb_dropdown_option:first-child,
196
+ .pb_dropdown_option_list:first-child,
197
+ .pb_dropdown_option_selected:first-child,
198
+ .pb_dropdown_option_focused:first-child,
199
+ .pb_dropdown_option_list_focused:first-child,
200
+ .pb_dropdown_option_selected_focused:first-child {
171
201
  margin-top: $space_xs;
172
202
  }
173
203
 
174
- [class*="pb_dropdown_option"]:last-child {
204
+ .pb_dropdown_option:last-child,
205
+ .pb_dropdown_option_list:last-child,
206
+ .pb_dropdown_option_selected:last-child,
207
+ .pb_dropdown_option_focused:last-child,
208
+ .pb_dropdown_option_list_focused:last-child,
209
+ .pb_dropdown_option_selected_focused:last-child {
175
210
  margin-bottom: $space_xs;
176
211
  }
177
212
 
178
- [class*="pb_dropdown_option"] {
213
+ .pb_dropdown_option,
214
+ .pb_dropdown_option_list,
215
+ .pb_dropdown_option_selected,
216
+ .pb_dropdown_option_focused,
217
+ .pb_dropdown_option_list_focused,
218
+ .pb_dropdown_option_selected_focused {
179
219
  margin: $space_xs;
180
220
  padding: $space_xs;
181
221
  border-radius: $border_radius_md;
@@ -193,24 +233,44 @@
193
233
  }
194
234
  }
195
235
 
196
- [class*="pb_dropdown_option"]:last-child::after {
236
+ .pb_dropdown_option:last-child::after,
237
+ .pb_dropdown_option_list:last-child::after,
238
+ .pb_dropdown_option_selected:last-child::after,
239
+ .pb_dropdown_option_focused:last-child::after,
240
+ .pb_dropdown_option_list_focused:last-child::after,
241
+ .pb_dropdown_option_selected_focused:last-child::after {
197
242
  display: none;
198
243
  }
199
244
  }
200
245
  }
201
246
 
202
- &[class*="separators_hidden"] {
247
+ &.pb_dropdown_subtle_separators_hidden {
203
248
  .dropdown_wrapper {
204
249
  .pb_dropdown_container {
205
- [class*="pb_dropdown_option"]:first-child {
250
+ .pb_dropdown_option:first-child,
251
+ .pb_dropdown_option_list:first-child,
252
+ .pb_dropdown_option_selected:first-child,
253
+ .pb_dropdown_option_focused:first-child,
254
+ .pb_dropdown_option_list_focused:first-child,
255
+ .pb_dropdown_option_selected_focused:first-child {
206
256
  margin-top: $space_xs;
207
257
  }
208
258
 
209
- [class*="pb_dropdown_option"]:last-child {
259
+ .pb_dropdown_option:last-child,
260
+ .pb_dropdown_option_list:last-child,
261
+ .pb_dropdown_option_selected:last-child,
262
+ .pb_dropdown_option_focused:last-child,
263
+ .pb_dropdown_option_list_focused:last-child,
264
+ .pb_dropdown_option_selected_focused:last-child {
210
265
  margin-bottom: $space_xs;
211
266
  }
212
267
 
213
- [class*="pb_dropdown_option"] {
268
+ .pb_dropdown_option,
269
+ .pb_dropdown_option_list,
270
+ .pb_dropdown_option_selected,
271
+ .pb_dropdown_option_focused,
272
+ .pb_dropdown_option_list_focused,
273
+ .pb_dropdown_option_selected_focused {
214
274
  padding: $space_xxs $space_xs;
215
275
  margin: $space_xxs $space_xs;
216
276
 
@@ -218,7 +278,8 @@
218
278
  height: 0px;
219
279
  }
220
280
 
221
- &[class*="selected"] {
281
+ &.pb_dropdown_option_selected,
282
+ &.pb_dropdown_option_selected_focused {
222
283
  border-bottom: none;
223
284
  }
224
285
  }
@@ -229,7 +290,10 @@
229
290
 
230
291
  &.dark {
231
292
  .dropdown_wrapper {
232
- [class*="dropdown_trigger_wrapper"] {
293
+ .dropdown_trigger_wrapper,
294
+ .dropdown_trigger_wrapper_focus,
295
+ .dropdown_trigger_wrapper_focus_select_only,
296
+ .dropdown_trigger_wrapper_select_only {
233
297
  @include pb_body_light_dark;
234
298
  background-color: rgba($white, 0.1) !important;
235
299
  background: none;
@@ -244,7 +308,7 @@
244
308
  [class^="pb_body"] {
245
309
  color: $white;
246
310
  }
247
- &[class*="_select_only"] {
311
+ &.dropdown_trigger_wrapper_select_only {
248
312
  box-shadow: inset 0 -11px 20px rgba($white, 0.05);
249
313
  }
250
314
  .dropdown_input {
@@ -254,7 +318,10 @@
254
318
  }
255
319
 
256
320
  &.error {
257
- [class*="dropdown_trigger_wrapper"] {
321
+ .dropdown_trigger_wrapper,
322
+ .dropdown_trigger_wrapper_focus,
323
+ .dropdown_trigger_wrapper_focus_select_only,
324
+ .dropdown_trigger_wrapper_select_only {
258
325
  border-color: $error_dark;
259
326
  }
260
327
  }
@@ -268,19 +335,28 @@
268
335
  color: $white !important;
269
336
  }
270
337
 
271
- [class*="pb_dropdown_option"] {
338
+ .pb_dropdown_option,
339
+ .pb_dropdown_option_list,
340
+ .pb_dropdown_option_selected,
341
+ .pb_dropdown_option_focused,
342
+ .pb_dropdown_option_list_focused,
343
+ .pb_dropdown_option_selected_focused {
272
344
  &:hover {
273
345
  background-color: $hover_dark;
274
346
  }
275
347
 
276
- &[class*="_focused"] {
348
+ &.pb_dropdown_option_focused,
349
+ &.pb_dropdown_option_list_focused,
350
+ &.pb_dropdown_option_selected_focused {
277
351
  background-color: $hover_dark;
278
352
  }
279
353
 
280
- &[class*="_list"] {
354
+ &.pb_dropdown_option_list,
355
+ &.pb_dropdown_option_list_focused {
281
356
  border-color: rgba($white, 0.15);
282
357
  }
283
- &[class*="selected"] {
358
+ &.pb_dropdown_option_selected,
359
+ &.pb_dropdown_option_selected_focused {
284
360
  background-color: $primary;
285
361
  border-bottom: rgba($white, 0.15);
286
362
  }
@@ -522,7 +522,7 @@ export default class PbDropdown extends PbEnhancedElement {
522
522
  closeIcon.className = "pb_form_pill_close";
523
523
  closeIcon.innerHTML = `<svg class="pb_custom_icon svg-inline--fa svg_${
524
524
  this.formPillProps.size === "small" ? "xs" : "sm"
525
- } svg_fw" xmlns="http://www.w3.org/2000/svg" width="auto" height="auto" viewBox="0 0 31 25"><path fill="currentColor" d="M23.0762 6.77734L17.4512 12.4023L23.0293 17.9805C23.498 18.4023 23.498 19.1055 23.0293 19.5273C22.6074 19.9961 21.9043 19.9961 21.4824 19.5273L15.8574 13.9492L10.2793 19.5273C9.85742 19.9961 9.1543 19.9961 8.73242 19.5273C8.26367 19.1055 8.26367 18.4023 8.73242 17.9336L14.3105 12.3555L8.73242 6.77734C8.26367 6.35547 8.26367 5.65234 8.73242 5.18359C9.1543 4.76172 9.85742 4.76172 10.3262 5.18359L15.9043 10.8086L21.4824 5.23047C21.9043 4.76172 22.6074 4.76172 23.0762 5.23047C23.498 5.65234 23.498 6.35547 23.0762 6.77734Z"/></svg>`;
525
+ } svg_fw" xmlns="http://www.w3.org/2000/svg" width="1em" viewBox="0 0 31 25"><path fill="currentColor" d="M23.0762 6.77734L17.4512 12.4023L23.0293 17.9805C23.498 18.4023 23.498 19.1055 23.0293 19.5273C22.6074 19.9961 21.9043 19.9961 21.4824 19.5273L15.8574 13.9492L10.2793 19.5273C9.85742 19.9961 9.1543 19.9961 8.73242 19.5273C8.26367 19.1055 8.26367 18.4023 8.73242 17.9336L14.3105 12.3555L8.73242 6.77734C8.26367 6.35547 8.26367 5.65234 8.73242 5.18359C9.1543 4.76172 9.85742 4.76172 10.3262 5.18359L15.9043 10.8086L21.4824 5.23047C21.9043 4.76172 22.6074 4.76172 23.0762 5.23047C23.498 5.65234 23.498 6.35547 23.0762 6.77734Z"/></svg>`;
526
526
  pill.appendChild(closeIcon);
527
527
 
528
528
  closeIcon.addEventListener("click", (e) => {
@@ -21,6 +21,15 @@
21
21
  ]
22
22
  %>
23
23
 
24
+ <%
25
+ example_typeahead_options = [
26
+ { label: 'Orange', value: '#FFA500' },
27
+ { label: 'Red', value: '#FF0000' },
28
+ { label: 'Green', value: '#00FF00' },
29
+ { label: 'Blue', value: '#0000FF' },
30
+ ]
31
+ %>
32
+
24
33
  <% treeData = [{
25
34
  label: "Power Home Remodeling",
26
35
  value: "Power Home Remodeling",
@@ -89,6 +98,8 @@
89
98
 
90
99
  <%= pb_form_with(scope: :example, method: :get, url: "", validate: true) do |form| %>
91
100
  <%= form.typeahead :example_typeahead_validation, props: { data: { typeahead_example2: true, user: {} }, label: true, placeholder: "Search for a user", required: true, validation: { message: "Please select a user." } } %>
101
+ <%= form.typeahead :example_typeahead_validation_react, props: { options: example_typeahead_options, pills: true, label: "Example Typeahead (React Rendered)", placeholder: "Search for a user", required: true, validation: { message: "Please select a color." } } %>
102
+ <%= form.typeahead :example_typeahead_validation_react_2, props: { options: example_typeahead_options, pills: true, label: "Example Typeahead 2 (React Rendered)", placeholder: "Search for a user", required: true } %>
92
103
  <%= form.text_field :example_text_field_validation, props: { label: true, required: true } %>
93
104
  <%= form.phone_number_field :example_phone_number_field_validation, props: { label: "Example phone field", hidden_inputs: true } %>
94
105
  <%= form.email_field :example_email_field_validation, props: { label: true, required: true } %>
@@ -235,8 +235,7 @@ const Icon = (props: IconProps) => {
235
235
  ...htmlProps,
236
236
  className: classes,
237
237
  id,
238
- width: 'auto',
239
- height: 'auto',
238
+ width: '1em',
240
239
  ...(props.tabIndex !== undefined && { tabIndex }),
241
240
  })
242
241
  }
@@ -110,8 +110,7 @@ module Playbook
110
110
  svg["class"] = %w[pb_custom_icon svg-inline--fa].concat([object.custom_icon_classname]).join(" ")
111
111
  svg["id"] = object.id
112
112
  svg["data"] = object.data
113
- svg["height"] = "auto"
114
- svg["width"] = "auto"
113
+ svg["width"] = "1em"
115
114
  svg["tabindex"] = object.tabindex
116
115
  fill_color = object.color || "currentColor"
117
116
  doc.at_css("path")["fill"] = fill_color
@@ -3,7 +3,7 @@ import React from 'react'
3
3
  import classnames from 'classnames'
4
4
 
5
5
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
6
- import { globalProps } from '../utilities/globalProps'
6
+ import { globalProps, GlobalProps } from '../utilities/globalProps'
7
7
 
8
8
  import Icon from '../pb_icon/_icon'
9
9
 
@@ -26,7 +26,7 @@ type IconCircleProps = {
26
26
  | "orange"
27
27
  | "green"
28
28
  | "lighter",
29
- }
29
+ } & GlobalProps
30
30
 
31
31
  const IconCircle = (props: IconCircleProps) => {
32
32
  const {
@@ -3,51 +3,45 @@
3
3
  @import "../tokens/spacing";
4
4
  @import "../pb_icon_circle/icon_circle";
5
5
 
6
- [class^=pb_icon_stat_value_kit]{
6
+ .pb_icon_stat_value_kit_horizontal,
7
+ .pb_icon_stat_value_kit_vertical
8
+ {
7
9
  display: flex;
8
10
  align-items: baseline;
9
11
 
10
- &[class*=_vertical] {
12
+ &.pb_icon_stat_value_kit_vertical {
11
13
  flex-direction: column;
12
14
 
13
- &[class*=_center] {
15
+ &.text_align_center {
14
16
  align-items: center;
15
17
 
16
- [class^=pb_title],
17
- [class^=pb_body],
18
- [class^=pb_caption] {
18
+ .pb_title_kit,
19
+ .pb_body_kit,
20
+ .pb_caption_kit_md {
19
21
  text-align: center;
20
22
  }
21
23
  }
22
24
 
23
- &[class*=_right] {
25
+ &.text_align_right {
24
26
  align-items: flex-end;
25
27
 
26
- [class^=pb_title],
27
- [class^=pb_body],
28
- [class^=pb_caption] {
28
+ .pb_title_kit,
29
+ .pb_body_kit,
30
+ .pb_caption_kit_md {
29
31
  text-align: right;
30
32
  }
31
33
  }
32
-
33
- [class^=pb_icon_circle] {
34
- margin-bottom: $space-xs;
35
- }
36
34
  }
37
35
 
38
- &[class*=_horizontal] {
36
+ &.pb_icon_stat_value_kit_horizontal {
39
37
  align-items: center;
40
38
 
41
- &[class*=_center] {
39
+ &.text_align_center {
42
40
  justify-content: center;
43
41
  }
44
42
 
45
- &[class*=_right] {
43
+ &.text_align_right {
46
44
  justify-content: flex-end;
47
45
  }
48
-
49
- [class^=pb_icon_circle] {
50
- margin-right: $space-sm;
51
- }
52
46
  }
53
47
  }
@@ -2,7 +2,7 @@ import React from 'react'
2
2
  import classnames from 'classnames'
3
3
 
4
4
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
5
- import { globalProps } from '../utilities/globalProps'
5
+ import { globalProps, GlobalProps } from '../utilities/globalProps'
6
6
 
7
7
  import Body from '../pb_body/_body'
8
8
  import Caption from '../pb_caption/_caption'
@@ -33,8 +33,7 @@ type IconStatValueProps = {
33
33
  | "yellow"
34
34
  | "orange"
35
35
  | "green"
36
- | "lighter",
37
- }
36
+ } & GlobalProps
38
37
 
39
38
  const IconStatValue = (props: IconStatValueProps): React.ReactElement => {
40
39
  const {
@@ -50,13 +49,13 @@ const IconStatValue = (props: IconStatValueProps): React.ReactElement => {
50
49
  text = '',
51
50
  unit = '',
52
51
  value = 0,
53
- variant = 'lighter',
52
+ variant = 'default',
54
53
  } = props
55
54
  const ariaProps = buildAriaProps(aria)
56
55
  const dataProps = buildDataProps(data)
57
56
  const htmlProps = buildHtmlProps(htmlOptions)
58
57
  const classes = classnames(
59
- buildCss('pb_icon_stat_value_kit', orientation, size, variant), globalProps(props),
58
+ buildCss('pb_icon_stat_value_kit', orientation), globalProps(props),
60
59
  className
61
60
  )
62
61
  const titleSize = function(size: "sm" | "md" | "lg") {
@@ -101,6 +100,8 @@ const IconStatValue = (props: IconStatValueProps): React.ReactElement => {
101
100
  <IconCircle
102
101
  dark={dark}
103
102
  icon={icon}
103
+ marginBottom={orientation == 'vertical' ? 'xs' : undefined}
104
+ marginRight={orientation == 'horizontal' ? 'sm' : undefined}
104
105
  size={size}
105
106
  variant={variant}
106
107
  />
@@ -3,6 +3,8 @@
3
3
  <%= pb_rails("icon_circle", props: {
4
4
  dark: object.dark,
5
5
  icon: object.icon,
6
+ margin_right: object.icon_margin_right,
7
+ margin_bottom: object.icon_margin_bottom,
6
8
  size: object.size,
7
9
  variant: object.variant }) %>
8
10
 
@@ -9,8 +9,8 @@ module Playbook
9
9
  values: %w[sm md lg],
10
10
  default: "sm"
11
11
  prop :variant, type: Playbook::Props::Enum,
12
- values: %w[default royal blue purple teal red yellow green orange lighter],
13
- default: "lighter"
12
+ values: %w[default royal blue purple teal red yellow green orange],
13
+ default: "default"
14
14
 
15
15
  prop :orientation, type: Playbook::Props::Enum,
16
16
  values: %w[vertical horizontal],
@@ -25,7 +25,7 @@ module Playbook
25
25
  prop :value
26
26
 
27
27
  def classname
28
- generate_classname("pb_icon_stat_value_kit", orientation, size, variant)
28
+ generate_classname("pb_icon_stat_value_kit", orientation)
29
29
  end
30
30
 
31
31
  def value_string
@@ -41,6 +41,14 @@ module Playbook
41
41
  3
42
42
  end
43
43
  end
44
+
45
+ def icon_margin_right
46
+ orientation === "horizontal" && "sm"
47
+ end
48
+
49
+ def icon_margin_bottom
50
+ orientation === "vertical" && "xs"
51
+ end
44
52
  end
45
53
  end
46
54
  end
@@ -18,7 +18,7 @@ describe("IconStatValue Kit", () => {
18
18
  )
19
19
 
20
20
  const kit = screen.getByTestId(testId)
21
- expect(kit).toHaveClass("pb_icon_stat_value_kit_horizontal_sm_lighter")
21
+ expect(kit).toHaveClass("pb_icon_stat_value_kit_horizontal")
22
22
  })
23
23
 
24
24
  test("renders icon", () => {
@@ -99,9 +99,10 @@ describe("IconStatValue Kit", () => {
99
99
  value={64.18}
100
100
  />
101
101
  )
102
-
102
+ const size = sizeProp === "sm" ? "3" : sizeProp === "md" ? "2" : "1"
103
103
  const kit = screen.getByTestId(testId)
104
- expect(kit).toHaveClass(`pb_icon_stat_value_kit_horizontal_${sizeProp}_lighter`)
104
+ const title = kit.querySelector(".pb_title_kit")
105
+ expect(title).toHaveClass(`pb_title_${size}`)
105
106
 
106
107
  cleanup()
107
108
  })
@@ -115,8 +116,7 @@ describe("IconStatValue Kit", () => {
115
116
  "teal",
116
117
  "red",
117
118
  "yellow",
118
- "green",
119
- "lighter"].forEach(
119
+ "green"].forEach(
120
120
  (colorProp) => {
121
121
  render(
122
122
  <IconStatValue
@@ -128,9 +128,10 @@ describe("IconStatValue Kit", () => {
128
128
  variant={colorProp}
129
129
  />
130
130
  )
131
-
131
+
132
132
  const kit = screen.getByTestId(testId)
133
- expect(kit).toHaveClass(`pb_icon_stat_value_kit_horizontal_sm_${colorProp}`)
133
+ const iconCircle = kit.querySelector(`.pb_icon_circle_kit_size_sm_${colorProp}`)
134
+ expect(iconCircle).toBeInTheDocument()
134
135
 
135
136
  cleanup()
136
137
  })
@@ -149,7 +150,7 @@ describe("IconStatValue Kit", () => {
149
150
  )
150
151
 
151
152
  const kit = screen.getByTestId(testId)
152
- expect(kit).toHaveClass("pb_icon_stat_value_kit_vertical_sm_lighter")
153
+ expect(kit).toHaveClass("pb_icon_stat_value_kit_vertical")
153
154
  })
154
155
 
155
156
  })
@@ -11,7 +11,7 @@
11
11
  <% if object.drag_handle %>
12
12
  <span style="vertical-align: middle;">
13
13
  <%= pb_rails("body") do %>
14
- <svg width="auto" height="auto" viewBox="0 0 31 25" fill="none" xmlns="http://www.w3.org/2000/svg" color="currentColor" class="pb_custom_icon svg-inline--fa vertical_align_middle svg_fw"><path d="M12.904 6.355a1.48 1.48 0 01-1.5-1.5c0-.796.656-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5 0 .844-.703 1.5-1.5 1.5zm0 7.5a1.48 1.48 0 01-1.5-1.5c0-.796.656-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5 0 .844-.703 1.5-1.5 1.5zm1.5 6c0 .844-.703 1.5-1.5 1.5a1.48 1.48 0 01-1.5-1.5c0-.796.656-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5zm4.5-13.5a1.48 1.48 0 01-1.5-1.5c0-.796.657-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5 0 .844-.703 1.5-1.5 1.5zm1.5 6c0 .844-.703 1.5-1.5 1.5a1.48 1.48 0 01-1.5-1.5c0-.796.657-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5zm-1.5 9a1.48 1.48 0 01-1.5-1.5c0-.796.657-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5 0 .844-.703 1.5-1.5 1.5z" fill="#242B42"></path></svg>
14
+ <svg width="14em" viewBox="0 0 31 25" fill="none" xmlns="http://www.w3.org/2000/svg" color="currentColor" class="pb_custom_icon svg-inline--fa vertical_align_middle svg_fw"><path d="M12.904 6.355a1.48 1.48 0 01-1.5-1.5c0-.796.656-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5 0 .844-.703 1.5-1.5 1.5zm0 7.5a1.48 1.48 0 01-1.5-1.5c0-.796.656-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5 0 .844-.703 1.5-1.5 1.5zm1.5 6c0 .844-.703 1.5-1.5 1.5a1.48 1.48 0 01-1.5-1.5c0-.796.656-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5zm4.5-13.5a1.48 1.48 0 01-1.5-1.5c0-.796.657-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5 0 .844-.703 1.5-1.5 1.5zm1.5 6c0 .844-.703 1.5-1.5 1.5a1.48 1.48 0 01-1.5-1.5c0-.796.657-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5zm-1.5 9a1.48 1.48 0 01-1.5-1.5c0-.796.657-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5 0 .844-.703 1.5-1.5 1.5z" fill="#242B42"></path></svg>
15
15
  <% end %>
16
16
  </span>
17
17
  <% end %>
@@ -56,7 +56,7 @@ const LoadingInline = (props: LoadingInlineProps) => {
56
56
  <Icon
57
57
  aria={{ label: 'loading icon' }}
58
58
  fixedWidth
59
- icon={variant === 'dotted' ? 'spinner' : variant === 'solid' ? 'spinner-solid' : undefined}
59
+ icon={variant === 'dotted' ? 'spinner' : variant === 'solid' ? 'circle-notch' : undefined}
60
60
  pulse
61
61
  />
62
62
  {text}
@@ -20,7 +20,7 @@ module Playbook
20
20
  if variant == "dotted"
21
21
  "spinner"
22
22
  elsif variant == "solid"
23
- "spinner-solid"
23
+ "circle-notch"
24
24
  end
25
25
  end
26
26
  end