playbook_ui 15.1.0 → 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.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableState.ts +7 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_managed_disabled.html.erb +31 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_managed_disabled.md +7 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_managed_disabled_helper.html.erb +21 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_managed_disabled_helper.md +7 -0
- data/app/pb_kits/playbook/pb_button/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_button/index.js +99 -0
- data/app/pb_kits/playbook/pb_collapsible/__snapshots__/collapsible.test.js.snap +2 -2
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.scss +4 -0
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_stacked_alert.html.erb +16 -16
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_stacked_alert.jsx +2 -1
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_status.html.erb +31 -31
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_status.jsx +4 -3
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +105 -29
- data/app/pb_kits/playbook/pb_dropdown/index.js +1 -1
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +11 -0
- data/app/pb_kits/playbook/pb_icon/_icon.tsx +1 -2
- data/app/pb_kits/playbook/pb_icon/icon.rb +1 -2
- data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.tsx +2 -2
- data/app/pb_kits/playbook/pb_icon_stat_value/_icon_stat_value.scss +15 -21
- data/app/pb_kits/playbook/pb_icon_stat_value/_icon_stat_value.tsx +6 -5
- data/app/pb_kits/playbook/pb_icon_stat_value/icon_stat_value.html.erb +2 -0
- data/app/pb_kits/playbook/pb_icon_stat_value/icon_stat_value.rb +11 -3
- data/app/pb_kits/playbook/pb_icon_stat_value/icon_stat_value.test.js +9 -8
- data/app/pb_kits/playbook/pb_list/item.html.erb +1 -1
- data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.scss +36 -9
- data/app/pb_kits/playbook/pb_popover/docs/_popover_list.html.erb +2 -2
- data/app/pb_kits/playbook/pb_selectable_list/selectable_list_item.html.erb +1 -1
- data/app/pb_kits/playbook/pb_text_input/_text_input.scss +3 -0
- data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +14 -6
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_default.html.erb +8 -4
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_default.jsx +5 -0
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_default.md +1 -0
- data/app/pb_kits/playbook/pb_text_input/text_input.html.erb +3 -1
- data/app/pb_kits/playbook/pb_text_input/text_input.rb +6 -0
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +10 -10
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +39 -1
- data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +2 -0
- data/app/pb_kits/playbook/utilities/_hover.scss +2 -2
- data/app/pb_kits/playbook/utilities/globalProps.ts +2 -2
- data/dist/chunks/{_line_graph-CW8Ygzyq.js → _line_graph-B-R1nzPu.js} +1 -1
- data/dist/chunks/_typeahead-DqRbRocY.js +6 -0
- data/dist/chunks/{_weekday_stacked-3-FtXg76.js → _weekday_stacked-C3YxWFMB.js} +3 -3
- data/dist/chunks/{lib-izYrkvOQ.js → lib-QZuu1ltS.js} +2 -2
- data/dist/chunks/{pb_form_validation-Cah5Z5J3.js → pb_form_validation-CleM960_.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +1 -1
- data/dist/playbook-doc.js +2 -2
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/hover.rb +5 -1
- data/lib/playbook/version.rb +2 -2
- metadata +13 -7
- data/dist/chunks/_typeahead-DUIMqJiu.js +0 -6
|
@@ -10,9 +10,15 @@
|
|
|
10
10
|
@import "./scss_partials/dropdown_animation";
|
|
11
11
|
@import "dropdown_mixin";
|
|
12
12
|
|
|
13
|
-
|
|
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
|
-
|
|
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
|
-
|
|
57
|
+
&.dropdown_trigger_wrapper_select_only {
|
|
52
58
|
box-shadow: inset 0 -11px 20px rgba($primary, 0.05);
|
|
53
59
|
}
|
|
54
60
|
|
|
55
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
159
|
+
.pb_body_kit_negative {
|
|
145
160
|
margin-top: $space_xs / 2;
|
|
146
161
|
}
|
|
147
162
|
|
|
148
|
-
|
|
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
|
-
|
|
173
|
+
&.pb_dropdown_default_separators_hidden,
|
|
174
|
+
&.pb_dropdown_subtle_separators_hidden {
|
|
156
175
|
.dropdown_wrapper {
|
|
157
176
|
.pb_dropdown_container {
|
|
158
177
|
|
|
159
|
-
|
|
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
|
-
|
|
190
|
+
&.pb_dropdown_subtle,
|
|
191
|
+
&.pb_dropdown_subtle_separators_hidden {
|
|
167
192
|
.dropdown_wrapper {
|
|
168
193
|
.pb_dropdown_container {
|
|
169
194
|
|
|
170
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
247
|
+
&.pb_dropdown_subtle_separators_hidden {
|
|
203
248
|
.dropdown_wrapper {
|
|
204
249
|
.pb_dropdown_container {
|
|
205
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
354
|
+
&.pb_dropdown_option_list,
|
|
355
|
+
&.pb_dropdown_option_list_focused {
|
|
281
356
|
border-color: rgba($white, 0.15);
|
|
282
357
|
}
|
|
283
|
-
|
|
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="
|
|
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 } %>
|
|
@@ -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["
|
|
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
|
-
|
|
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
|
-
|
|
12
|
+
&.pb_icon_stat_value_kit_vertical {
|
|
11
13
|
flex-direction: column;
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
&.text_align_center {
|
|
14
16
|
align-items: center;
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
25
|
+
&.text_align_right {
|
|
24
26
|
align-items: flex-end;
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
-
|
|
36
|
+
&.pb_icon_stat_value_kit_horizontal {
|
|
39
37
|
align-items: center;
|
|
40
38
|
|
|
41
|
-
|
|
39
|
+
&.text_align_center {
|
|
42
40
|
justify-content: center;
|
|
43
41
|
}
|
|
44
42
|
|
|
45
|
-
|
|
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
|
-
|
|
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 = '
|
|
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
|
|
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
|
/>
|
|
@@ -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
|
|
13
|
-
default: "
|
|
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
|
|
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("
|
|
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
|
-
|
|
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
|
-
|
|
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("
|
|
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="
|
|
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 %>
|
|
@@ -89,7 +89,18 @@ $positions: (
|
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
|
|
92
|
+
.pb_multiple_users_stacked_kit,
|
|
93
|
+
.pb_multiple_users_stacked_kit_single,
|
|
94
|
+
.pb_multiple_users_stacked_kit_bubble,
|
|
95
|
+
.pb_multiple_users_stacked_kit_single_bubble,
|
|
96
|
+
.pb_multiple_users_stacked_kit_bubble_size_sm,
|
|
97
|
+
.pb_multiple_users_stacked_kit_bubble_size_md,
|
|
98
|
+
.pb_multiple_users_stacked_kit_bubble_size_lg,
|
|
99
|
+
.pb_multiple_users_stacked_kit_bubble_size_xl,
|
|
100
|
+
.pb_multiple_users_stacked_kit_single_bubble_size_sm,
|
|
101
|
+
.pb_multiple_users_stacked_kit_single_bubble_size_md,
|
|
102
|
+
.pb_multiple_users_stacked_kit_single_bubble_size_lg,
|
|
103
|
+
.pb_multiple_users_stacked_kit_single_bubble_size_xl {
|
|
93
104
|
$container_size: map-get($avatar-sizes, "xs");
|
|
94
105
|
$bubble_container_size: map-get($avatar-sizes, "sm");
|
|
95
106
|
$overlap: -15px;
|
|
@@ -103,7 +114,8 @@ $positions: (
|
|
|
103
114
|
position: relative;
|
|
104
115
|
flex-shrink: 0;
|
|
105
116
|
flex-grow: 0;
|
|
106
|
-
|
|
117
|
+
.pb_avatar_kit_size_xs.pb_multiple_users_stacked_item,
|
|
118
|
+
.pb_avatar_kit_size_md.pb_multiple_users_stacked_item {
|
|
107
119
|
@include avatar-size($stacked_size);
|
|
108
120
|
&.dark {
|
|
109
121
|
.avatar_wrapper {
|
|
@@ -117,10 +129,17 @@ $positions: (
|
|
|
117
129
|
}
|
|
118
130
|
}
|
|
119
131
|
}
|
|
120
|
-
|
|
132
|
+
&.pb_multiple_users_stacked_kit_single .pb_multiple_users_stacked_item,
|
|
133
|
+
&.pb_multiple_users_stacked_kit_single_bubble .pb_multiple_users_stacked_item,
|
|
134
|
+
&.pb_multiple_users_stacked_kit_single_bubble_size_sm .pb_multiple_users_stacked_item,
|
|
135
|
+
&.pb_multiple_users_stacked_kit_single_bubble_size_md .pb_multiple_users_stacked_item,
|
|
136
|
+
&.pb_multiple_users_stacked_kit_single_bubble_size_lg .pb_multiple_users_stacked_item,
|
|
137
|
+
&.pb_multiple_users_stacked_kit_single_bubble_size_xl .pb_multiple_users_stacked_item {
|
|
121
138
|
@include avatar-size(28px);
|
|
122
139
|
}
|
|
123
|
-
|
|
140
|
+
.pb_avatar_kit_size_xs.second_item,
|
|
141
|
+
.pb_avatar_kit_size_md.second_item,
|
|
142
|
+
.pb_badge_kit_primary_rounded.second_item {
|
|
124
143
|
@include position((bottom: 0, right: 0));
|
|
125
144
|
z-index: 2;
|
|
126
145
|
background: tint($primary, 90%);
|
|
@@ -143,7 +162,8 @@ $positions: (
|
|
|
143
162
|
|
|
144
163
|
// Iterate over each size to adjust the bubble container only when class contains "_bubble_"
|
|
145
164
|
@each $size_name, $size_value in $avatar-sizes {
|
|
146
|
-
|
|
165
|
+
&.pb_multiple_users_stacked_kit_bubble_size_#{$size_name},
|
|
166
|
+
&.pb_multiple_users_stacked_kit_single_bubble_size_#{$size_name} {
|
|
147
167
|
// Set bubble container size based on the class
|
|
148
168
|
$bubble_container_size: $size_value;
|
|
149
169
|
$container_size: $size_value;
|
|
@@ -161,7 +181,8 @@ $positions: (
|
|
|
161
181
|
background-color: $card_dark;
|
|
162
182
|
}
|
|
163
183
|
|
|
164
|
-
|
|
184
|
+
.pb_avatar_kit_size_xs.pb_multiple_users_stacked_item,
|
|
185
|
+
.pb_avatar_kit_size_md.pb_multiple_users_stacked_item {
|
|
165
186
|
@include avatar-size($bubble_container_size * 0.45); // Adjust the size of stacked avatars
|
|
166
187
|
|
|
167
188
|
&.dark {
|
|
@@ -175,7 +196,8 @@ $positions: (
|
|
|
175
196
|
}
|
|
176
197
|
}
|
|
177
198
|
|
|
178
|
-
|
|
199
|
+
.pb_avatar_kit_size_xs,
|
|
200
|
+
.pb_avatar_kit_size_md {
|
|
179
201
|
// First Item
|
|
180
202
|
&.first_item {
|
|
181
203
|
@include position(map-get(map-get($positions, 'first-item-double'), $size_name));
|
|
@@ -235,8 +257,13 @@ $positions: (
|
|
|
235
257
|
}
|
|
236
258
|
}
|
|
237
259
|
|
|
238
|
-
|
|
239
|
-
|
|
260
|
+
&.pb_multiple_users_stacked_kit_single_bubble,
|
|
261
|
+
&.pb_multiple_users_stacked_kit_single_bubble_size_sm,
|
|
262
|
+
&.pb_multiple_users_stacked_kit_single_bubble_size_md,
|
|
263
|
+
&.pb_multiple_users_stacked_kit_single_bubble_size_lg,
|
|
264
|
+
&.pb_multiple_users_stacked_kit_single_bubble_size_xl {
|
|
265
|
+
.pb_avatar_kit_size_xs.first_item,
|
|
266
|
+
.pb_avatar_kit_size_md.first_item {
|
|
240
267
|
@include position((top: 0, left: 0));
|
|
241
268
|
@include avatar-size($bubble_container_size);
|
|
242
269
|
}
|