playbook_ui 14.7.0.pre.alpha.PBNTR667railstypeaheadformintegration4454 → 14.7.0.pre.alpha.dependabotnpmandyarnfloatinguireact026284532
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_card/docs/_card_light.md +1 -1
- data/app/pb_kits/playbook/pb_date/_date.scss +3 -0
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +1 -1
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_default_date.html.erb +42 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_default_date.jsx +44 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_default_date.md +1 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_date_picker/plugins/quickPick.tsx +17 -1
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_default_rails.html.erb +26 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_default_rails.md +7 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards_rails.html.erb +38 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards_rails.md +0 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list_rails.html.erb +19 -0
- data/app/pb_kits/playbook/pb_draggable/docs/example.yml +6 -0
- data/app/pb_kits/playbook/pb_draggable/draggable.html.erb +3 -0
- data/app/pb_kits/playbook/pb_draggable/draggable.rb +18 -0
- data/app/pb_kits/playbook/pb_draggable/draggable_container.html.erb +3 -0
- data/app/pb_kits/playbook/pb_draggable/draggable_container.rb +15 -0
- data/app/pb_kits/playbook/pb_draggable/draggable_item.html.erb +7 -0
- data/app/pb_kits/playbook/pb_draggable/draggable_item.rb +18 -0
- data/app/pb_kits/playbook/pb_draggable/index.js +125 -0
- data/app/pb_kits/playbook/pb_drawer/_drawer.scss +88 -175
- data/app/pb_kits/playbook/pb_drawer/_drawer.tsx +79 -47
- data/app/pb_kits/playbook/pb_drawer/drawer.test.jsx +20 -16
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +2 -2
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with_loading.html.erb +1 -1
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +12 -63
- data/app/pb_kits/playbook/pb_timeline/_timeline.scss +43 -1
- data/app/pb_kits/playbook/pb_timeline/_timeline.tsx +6 -2
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_gap.html.erb +94 -0
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_gap.jsx +180 -0
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_gap.md +1 -0
- data/app/pb_kits/playbook/pb_timeline/docs/example.yml +5 -3
- data/app/pb_kits/playbook/pb_timeline/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_timeline/timeline.rb +11 -1
- data/app/pb_kits/playbook/pb_timeline/timeline.test.js +4 -4
- data/app/pb_kits/playbook/pb_typeahead/index.ts +2 -36
- data/app/pb_kits/playbook/pb_typeahead/typeahead.html.erb +2 -5
- data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +0 -4
- data/app/pb_kits/playbook/utilities/_hover.scss +40 -27
- data/app/pb_kits/playbook/utilities/globalProps.ts +5 -3
- data/app/pb_kits/playbook/utilities/test/globalProps/hover.test.js +79 -0
- data/dist/chunks/_typeahead-CEqbLlRy.js +22 -0
- data/dist/chunks/_weekday_stacked-BiF9GqI1.js +45 -0
- data/dist/chunks/{lib-DpxYMiKe.js → lib-BC6ESsxG.js} +1 -1
- data/dist/chunks/{pb_form_validation-LqRlnmi6.js → pb_form_validation-B_Z9rEbg.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +1 -1
- data/dist/playbook-doc.js +1 -1
- 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/forms/builder/typeahead_field.rb +0 -13
- data/lib/playbook/hover.rb +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +25 -6
- data/dist/chunks/_typeahead-B-juiSkw.js +0 -22
- data/dist/chunks/_weekday_stacked-DPqQHJ1l.js +0 -45
@@ -40,10 +40,6 @@ module Playbook
|
|
40
40
|
prop :pill_color, type: Playbook::Props::Enum,
|
41
41
|
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],
|
42
42
|
default: "primary"
|
43
|
-
prop :required, type: Playbook::Props::Boolean,
|
44
|
-
default: false
|
45
|
-
prop :validation, type: Playbook::Props::HashProp,
|
46
|
-
default: {}
|
47
43
|
|
48
44
|
def classname
|
49
45
|
default_margin_bottom = margin_bottom.present? ? "" : " mb_sm"
|
@@ -21,34 +21,47 @@
|
|
21
21
|
}
|
22
22
|
|
23
23
|
@mixin hover-color-classes($colors-list) {
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
transition: color $transition-speed ease;
|
24
|
+
@each $name, $color in $colors-list {
|
25
|
+
.hover_background-#{"" + $name}:hover {
|
26
|
+
background-color: $color !important;
|
27
|
+
transition: background-color $transition-speed ease;
|
28
|
+
}
|
29
|
+
.hover_color-#{"" + $name}:hover {
|
30
|
+
color: $color !important;
|
31
|
+
transition: color $transition-speed ease;
|
32
|
+
}
|
34
33
|
}
|
35
34
|
}
|
35
|
+
|
36
|
+
@include hover-scale-classes($scales);
|
37
|
+
@include hover-shadow-classes($box_shadows);
|
38
|
+
@include hover-color-classes($product_colors);
|
39
|
+
@include hover-color-classes($status_colors);
|
40
|
+
@include hover-color-classes($data_colors);
|
41
|
+
@include hover-color-classes($shadow_colors);
|
42
|
+
@include hover-color-classes($colors);
|
43
|
+
@include hover-color-classes($interface_colors);
|
44
|
+
@include hover-color-classes($main_colors);
|
45
|
+
@include hover-color-classes($background_colors);
|
46
|
+
@include hover-color-classes($card_colors);
|
47
|
+
@include hover-color-classes($active_colors);
|
48
|
+
@include hover-color-classes($action_colors);
|
49
|
+
@include hover-color-classes($hover_colors);
|
50
|
+
@include hover-color-classes($border_colors);
|
51
|
+
@include hover-color-classes($text_colors);
|
52
|
+
@include hover-color-classes($category_colors);
|
53
|
+
|
54
|
+
.hover_visibility {
|
55
|
+
opacity: 0;
|
56
|
+
transition: opacity $transition-speed ease;
|
57
|
+
|
58
|
+
&:hover {
|
59
|
+
opacity: 1;
|
60
|
+
}
|
36
61
|
}
|
37
62
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
@include hover-color-classes($shadow_colors);
|
44
|
-
@include hover-color-classes($colors);
|
45
|
-
@include hover-color-classes($interface_colors);
|
46
|
-
@include hover-color-classes($main_colors);
|
47
|
-
@include hover-color-classes($background_colors);
|
48
|
-
@include hover-color-classes($card_colors);
|
49
|
-
@include hover-color-classes($active_colors);
|
50
|
-
@include hover-color-classes($action_colors);
|
51
|
-
@include hover-color-classes($hover_colors);
|
52
|
-
@include hover-color-classes($border_colors);
|
53
|
-
@include hover-color-classes($text_colors);
|
54
|
-
@include hover-color-classes($category_colors);
|
63
|
+
.group_hover:hover {
|
64
|
+
.group_hover.hover_visibility {
|
65
|
+
opacity: 1;
|
66
|
+
}
|
67
|
+
}
|
@@ -63,7 +63,8 @@ type FlexWrap = {
|
|
63
63
|
type Hover = Shadow & {
|
64
64
|
background?: string,
|
65
65
|
color?: string,
|
66
|
-
scale?: "sm" | "md" | "lg"
|
66
|
+
scale?: "sm" | "md" | "lg",
|
67
|
+
visibility?: boolean,
|
67
68
|
}
|
68
69
|
|
69
70
|
type GroupHover = {
|
@@ -230,9 +231,10 @@ const PROP_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => string} =
|
|
230
231
|
let css = '';
|
231
232
|
if (!hover) return css;
|
232
233
|
css += hover.shadow ? `hover_shadow_${hover.shadow} ` : '';
|
233
|
-
css += hover.background ? `
|
234
|
+
css += hover.background ? `hover_background-${hover.background } ` : '';
|
234
235
|
css += hover.scale ? `hover_scale_${hover.scale} ` : '';
|
235
|
-
css += hover.color ? `
|
236
|
+
css += hover.color ? `hover_color-${hover.color } ` : '';
|
237
|
+
css += hover.visibility ? `hover_visibility` : '';
|
236
238
|
return css;
|
237
239
|
},
|
238
240
|
|
@@ -0,0 +1,79 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { render, screen } from '../../test-utils';
|
3
|
+
import Body from '../../../pb_body/_body';
|
4
|
+
|
5
|
+
const testSubject = 'body';
|
6
|
+
|
7
|
+
test('Hover Props: returns proper class name', () => {
|
8
|
+
const testIdColor = `${testSubject}-hover-color-red`;
|
9
|
+
render(
|
10
|
+
<Body
|
11
|
+
data={{ testid: testIdColor }}
|
12
|
+
hover={{ color: 'red' }}
|
13
|
+
text="Hi"
|
14
|
+
/>
|
15
|
+
);
|
16
|
+
|
17
|
+
let kit = screen.getByTestId(testIdColor);
|
18
|
+
let expectedClassName = `hover_color-red`;
|
19
|
+
expect(kit).toHaveClass(expectedClassName);
|
20
|
+
|
21
|
+
const testIdBackground = `${testSubject}-hover-background-blue`;
|
22
|
+
render(
|
23
|
+
<Body
|
24
|
+
data={{ testid: testIdBackground }}
|
25
|
+
hover={{ background: 'blue' }}
|
26
|
+
text="Hi"
|
27
|
+
/>
|
28
|
+
);
|
29
|
+
|
30
|
+
kit = screen.getByTestId(testIdBackground);
|
31
|
+
expectedClassName = `hover_background-blue`;
|
32
|
+
expect(kit).toHaveClass(expectedClassName);
|
33
|
+
|
34
|
+
const testIdShadow = `${testSubject}-hover-shadow-deep`;
|
35
|
+
render(
|
36
|
+
<Body
|
37
|
+
data={{ testid: testIdShadow }}
|
38
|
+
hover={{ shadow: 'deep' }}
|
39
|
+
text="Hi"
|
40
|
+
/>
|
41
|
+
);
|
42
|
+
|
43
|
+
kit = screen.getByTestId(testIdShadow);
|
44
|
+
expectedClassName = `hover_shadow_deep`;
|
45
|
+
expect(kit).toHaveClass(expectedClassName);
|
46
|
+
|
47
|
+
const testIdScale = `${testSubject}-hover-scale`;
|
48
|
+
render(
|
49
|
+
<Body
|
50
|
+
data={{ testid: testIdScale }}
|
51
|
+
hover={{ scale: 'xl' }}
|
52
|
+
text="Test"
|
53
|
+
/>
|
54
|
+
);
|
55
|
+
|
56
|
+
kit = screen.getByTestId(testIdScale);
|
57
|
+
expectedClassName = `hover_scale_xl`;
|
58
|
+
expect(kit).toHaveClass(expectedClassName);
|
59
|
+
|
60
|
+
const testIdMultiple = `${testSubject}-hover-multiple`;
|
61
|
+
render(
|
62
|
+
<Body
|
63
|
+
data={{ testid: testIdMultiple }}
|
64
|
+
hover={{
|
65
|
+
color: 'green',
|
66
|
+
background: 'error',
|
67
|
+
shadow: 'deeper',
|
68
|
+
scale: 'xl',
|
69
|
+
}}
|
70
|
+
text="Hi"
|
71
|
+
/>
|
72
|
+
);
|
73
|
+
|
74
|
+
kit = screen.getByTestId(testIdMultiple);
|
75
|
+
expect(kit).toHaveClass('hover_color-green');
|
76
|
+
expect(kit).toHaveClass('hover_background-error');
|
77
|
+
expect(kit).toHaveClass('hover_shadow_deeper');
|
78
|
+
expect(kit).toHaveClass('hover_scale_xl');
|
79
|
+
});
|