playbook_ui 10.18.1 → 10.19.0
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/_playbook.scss +1 -0
- data/app/pb_kits/playbook/pb_body/_body.jsx +1 -1
- data/app/pb_kits/playbook/pb_body/_body_mixins.scss +2 -1
- data/app/pb_kits/playbook/pb_body/body.rb +1 -1
- data/app/pb_kits/playbook/pb_body/body.test.js +29 -0
- data/app/pb_kits/playbook/pb_body/docs/_body_light.html.erb +5 -0
- data/app/pb_kits/playbook/pb_body/docs/_body_light.jsx +5 -0
- data/app/pb_kits/playbook/pb_body/docs/_body_light.md +6 -0
- data/app/pb_kits/playbook/pb_button/_button.jsx +3 -3
- data/app/pb_kits/playbook/pb_button/_button.scss +0 -17
- data/app/pb_kits/playbook/pb_button/button.rb +3 -6
- data/app/pb_kits/playbook/pb_button/button.test.js +0 -13
- data/app/pb_kits/playbook/pb_button/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_button/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_caption/_caption.jsx +6 -6
- data/app/pb_kits/playbook/pb_caption/_caption.scss +6 -17
- data/app/pb_kits/playbook/pb_caption/_caption_mixin.scss +13 -3
- data/app/pb_kits/playbook/pb_caption/caption.rb +3 -5
- data/app/pb_kits/playbook/pb_caption/caption.test.js +29 -0
- data/app/pb_kits/playbook/pb_caption/docs/_caption_colors.html.erb +3 -0
- data/app/pb_kits/playbook/pb_caption/docs/_caption_colors.jsx +25 -0
- data/app/pb_kits/playbook/pb_caption/docs/_caption_colors.md +6 -0
- data/app/pb_kits/playbook/pb_caption/docs/example.yml +2 -2
- data/app/pb_kits/playbook/pb_caption/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.jsx +3 -0
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.scss +1 -0
- data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +3 -0
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.js +10 -1
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_month_and_year.html.erb +5 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_month_and_year.jsx +18 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_month_and_year.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/sass_partials/_month_and_year_styles.scss +127 -0
- data/app/pb_kits/playbook/pb_image/_image.jsx +12 -14
- data/app/pb_kits/playbook/pb_image/docs/_custom_error_image.html.erb +1 -0
- data/app/pb_kits/playbook/pb_image/docs/_default_image.jsx +48 -35
- data/app/pb_kits/playbook/pb_image/docs/_rounded_image.jsx +46 -35
- data/app/pb_kits/playbook/pb_legend/_legend.jsx +1 -7
- data/app/pb_kits/playbook/pb_legend/_legend.scss +6 -2
- data/app/pb_kits/playbook/pb_legend/docs/_legend_colors.html.erb +4 -0
- data/app/pb_kits/playbook/pb_legend/docs/_legend_colors.jsx +29 -0
- data/app/pb_kits/playbook/pb_legend/docs/_legend_colors.md +2 -0
- data/app/pb_kits/playbook/pb_legend/docs/_legend_default.html.erb +2 -2
- data/app/pb_kits/playbook/pb_legend/docs/_legend_default.jsx +1 -1
- data/app/pb_kits/playbook/pb_legend/docs/example.yml +4 -4
- data/app/pb_kits/playbook/pb_legend/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_legend/legend.rb +1 -2
- data/app/pb_kits/playbook/pb_legend/legend.test.js +29 -0
- data/app/pb_kits/playbook/pb_nav/_bold_mixin.scss +22 -0
- data/app/pb_kits/playbook/pb_nav/_horizontal_nav.scss +17 -1
- data/app/pb_kits/playbook/pb_nav/_vertical_nav.scss +9 -2
- data/app/pb_kits/playbook/pb_nav/docs/_bold_horizontal_nav.html.erb +6 -0
- data/app/pb_kits/playbook/pb_nav/docs/_bold_horizontal_nav.jsx +39 -0
- data/app/pb_kits/playbook/pb_nav/docs/_bold_vertical_nav.html.erb +6 -0
- data/app/pb_kits/playbook/pb_nav/docs/_bold_vertical_nav.jsx +39 -0
- data/app/pb_kits/playbook/pb_nav/docs/_horizontal_nav.html.erb +1 -1
- data/app/pb_kits/playbook/pb_nav/docs/_subtle_nav.html.erb +1 -1
- data/app/pb_kits/playbook/pb_nav/docs/example.yml +4 -0
- data/app/pb_kits/playbook/pb_nav/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_nav/nav.rb +1 -1
- data/app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx +3 -0
- data/app/pb_kits/playbook/pb_popover/docs/_popover_z_index.jsx +1 -0
- data/app/pb_kits/playbook/pb_section_separator/_section_separator.scss +6 -2
- data/app/pb_kits/playbook/pb_section_separator/_section_separator_mixin.scss +0 -2
- data/app/pb_kits/playbook/pb_text_input/_text_input.scss +62 -13
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_error.html.erb +21 -2
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_error.jsx +12 -3
- data/app/pb_kits/playbook/pb_title/_title.jsx +6 -4
- data/app/pb_kits/playbook/pb_title/_title.scss +5 -5
- data/app/pb_kits/playbook/pb_title/_title_mixin.scss +17 -0
- data/app/pb_kits/playbook/pb_title/docs/_title_colors.html.erb +4 -0
- data/app/pb_kits/playbook/pb_title/docs/_title_colors.jsx +37 -0
- data/app/pb_kits/playbook/pb_title/docs/_title_colors.md +6 -0
- data/app/pb_kits/playbook/pb_title/docs/_title_light.md +3 -0
- data/app/pb_kits/playbook/pb_title/docs/example.yml +2 -2
- data/app/pb_kits/playbook/pb_title/docs/index.js +1 -1
- data/app/pb_kits/playbook/pb_title/title.html.erb +2 -3
- data/app/pb_kits/playbook/pb_title/title.rb +5 -4
- data/app/pb_kits/playbook/pb_title/title.test.js +29 -0
- data/app/pb_kits/playbook/utilities/_line_height.scss +11 -0
- data/app/pb_kits/playbook/utilities/globalProps.js +7 -1
- data/lib/playbook/classnames.rb +1 -0
- data/lib/playbook/kit_base.rb +2 -0
- data/lib/playbook/line_height.rb +29 -0
- data/lib/playbook/version.rb +1 -1
- metadata +28 -14
- data/app/pb_kits/playbook/pb_button/docs/_button_size.html.erb +0 -3
- data/app/pb_kits/playbook/pb_button/docs/_button_size.jsx +0 -26
- data/app/pb_kits/playbook/pb_button/docs/_button_size.md +0 -1
- data/app/pb_kits/playbook/pb_caption/docs/_caption_example.html.erb +0 -3
- data/app/pb_kits/playbook/pb_caption/docs/_caption_example.jsx +0 -27
- data/app/pb_kits/playbook/pb_caption/docs/_caption_example.md +0 -1
- data/app/pb_kits/playbook/pb_caption/docs/_caption_variants.html.erb +0 -1
- data/app/pb_kits/playbook/pb_caption/docs/_caption_variants.jsx +0 -17
- data/app/pb_kits/playbook/pb_caption/docs/_caption_variants.md +0 -3
- data/app/pb_kits/playbook/pb_title/docs/_title_variants.html.erb +0 -1
- data/app/pb_kits/playbook/pb_title/docs/_title_variants.jsx +0 -19
- data/app/pb_kits/playbook/pb_title/docs/_title_variants.md +0 -3
@@ -0,0 +1,127 @@
|
|
1
|
+
@import "../../tokens/colors";
|
2
|
+
|
3
|
+
|
4
|
+
.numInput {
|
5
|
+
border-left: none !important;
|
6
|
+
}
|
7
|
+
|
8
|
+
// Manual Import
|
9
|
+
.flatpickr-monthSelect-months {
|
10
|
+
margin: 10px 1px 3px 1px;
|
11
|
+
flex-wrap: wrap;
|
12
|
+
}
|
13
|
+
|
14
|
+
.flatpickr-monthSelect-month {
|
15
|
+
background: none;
|
16
|
+
border: 1px solid transparent;
|
17
|
+
border-radius: 4px;
|
18
|
+
-webkit-box-sizing: border-box;
|
19
|
+
box-sizing: border-box;
|
20
|
+
color: $text_lt_default;
|
21
|
+
cursor: pointer;
|
22
|
+
display: inline-block;
|
23
|
+
font-weight: 400;
|
24
|
+
margin: 0.5px;
|
25
|
+
justify-content: center;
|
26
|
+
padding: 10px;
|
27
|
+
position: relative;
|
28
|
+
-webkit-box-pack: center;
|
29
|
+
-webkit-justify-content: center;
|
30
|
+
-ms-flex-pack: center;
|
31
|
+
text-align: center;
|
32
|
+
width: 33%;
|
33
|
+
}
|
34
|
+
|
35
|
+
.flatpickr-monthSelect-month.flatpickr-disabled {
|
36
|
+
color: #eee;
|
37
|
+
}
|
38
|
+
|
39
|
+
.flatpickr-monthSelect-month.flatpickr-disabled:hover,
|
40
|
+
.flatpickr-monthSelect-month.flatpickr-disabled:focus {
|
41
|
+
cursor: not-allowed;
|
42
|
+
background: none !important;
|
43
|
+
}
|
44
|
+
|
45
|
+
.flatpickr-monthSelect-theme-dark {
|
46
|
+
background: #3f4458;
|
47
|
+
}
|
48
|
+
|
49
|
+
.flatpickr-monthSelect-theme-dark .flatpickr-current-month input.cur-year {
|
50
|
+
color: #fff;
|
51
|
+
}
|
52
|
+
|
53
|
+
.flatpickr-monthSelect-theme-dark .flatpickr-months .flatpickr-prev-month,
|
54
|
+
.flatpickr-monthSelect-theme-dark .flatpickr-months .flatpickr-next-month {
|
55
|
+
color: #fff;
|
56
|
+
fill: #fff;
|
57
|
+
}
|
58
|
+
|
59
|
+
.flatpickr-monthSelect-theme-dark .flatpickr-monthSelect-month {
|
60
|
+
color: rgba(255, 255, 255, 0.95);
|
61
|
+
}
|
62
|
+
|
63
|
+
.flatpickr-monthSelect-month.today {
|
64
|
+
border-color: #959ea9;
|
65
|
+
}
|
66
|
+
|
67
|
+
.flatpickr-monthSelect-month.inRange,
|
68
|
+
.flatpickr-monthSelect-month.inRange.today,
|
69
|
+
.flatpickr-monthSelect-month:hover,
|
70
|
+
.flatpickr-monthSelect-month:focus {
|
71
|
+
background: $active_light;
|
72
|
+
font-weight: $bold;
|
73
|
+
color: $text_lt_default;
|
74
|
+
cursor: pointer;
|
75
|
+
outline: 0;
|
76
|
+
}
|
77
|
+
|
78
|
+
.flatpickr-monthSelect-theme-dark .flatpickr-monthSelect-month.inRange,
|
79
|
+
.flatpickr-monthSelect-theme-dark .flatpickr-monthSelect-month:hover,
|
80
|
+
.flatpickr-monthSelect-theme-dark .flatpickr-monthSelect-month:focus {
|
81
|
+
background: #646c8c;
|
82
|
+
border-color: #646c8c;
|
83
|
+
}
|
84
|
+
|
85
|
+
.flatpickr-monthSelect-month.today:hover,
|
86
|
+
.flatpickr-monthSelect-month.today:focus {
|
87
|
+
background: #959ea9;
|
88
|
+
border-color: #959ea9;
|
89
|
+
color: #fff;
|
90
|
+
}
|
91
|
+
|
92
|
+
.flatpickr-monthSelect-month.selected,
|
93
|
+
.flatpickr-monthSelect-month.startRange,
|
94
|
+
.flatpickr-monthSelect-month.endRange {
|
95
|
+
background-color: $primary;
|
96
|
+
font-weight: $bold;
|
97
|
+
box-shadow: none;
|
98
|
+
color: #fff;
|
99
|
+
border-color: $primary;
|
100
|
+
}
|
101
|
+
|
102
|
+
.flatpickr-monthSelect-month.startRange {
|
103
|
+
border-radius: 50px 0 0 50px;
|
104
|
+
}
|
105
|
+
|
106
|
+
.flatpickr-monthSelect-month.endRange {
|
107
|
+
border-radius: 0 50px 50px 0;
|
108
|
+
}
|
109
|
+
|
110
|
+
.flatpickr-monthSelect-month.startRange.endRange {
|
111
|
+
border-radius: 50px;
|
112
|
+
}
|
113
|
+
|
114
|
+
.flatpickr-monthSelect-month.inRange {
|
115
|
+
border-radius: 0;
|
116
|
+
box-shadow: -5px 0 0 #e6e6e6, 5px 0 0 #e6e6e6;
|
117
|
+
}
|
118
|
+
|
119
|
+
.flatpickr-monthSelect-theme-dark .flatpickr-monthSelect-month.selected,
|
120
|
+
.flatpickr-monthSelect-theme-dark .flatpickr-monthSelect-month.startRange,
|
121
|
+
.flatpickr-monthSelect-theme-dark .flatpickr-monthSelect-month.endRange {
|
122
|
+
background: #80cbc4;
|
123
|
+
-webkit-box-shadow: none;
|
124
|
+
box-shadow: none;
|
125
|
+
color: #fff;
|
126
|
+
border-color: #80cbc4;
|
127
|
+
}
|
@@ -44,20 +44,18 @@ const Image = (props: ImageProps) => {
|
|
44
44
|
const dataProps = buildDataProps(data)
|
45
45
|
|
46
46
|
return (
|
47
|
-
<
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
/>
|
60
|
-
</div>
|
47
|
+
<img
|
48
|
+
{...ariaProps}
|
49
|
+
{...dataProps}
|
50
|
+
alt={alt}
|
51
|
+
className={classes}
|
52
|
+
data-src={url}
|
53
|
+
id={id}
|
54
|
+
onError={onError}
|
55
|
+
rounded={+rounded}
|
56
|
+
src={url}
|
57
|
+
transition={transition}
|
58
|
+
/>
|
61
59
|
)
|
62
60
|
}
|
63
61
|
|
@@ -5,41 +5,54 @@ import Image from '../_image'
|
|
5
5
|
const DefaultImage = (props) => {
|
6
6
|
return (
|
7
7
|
<>
|
8
|
-
<
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
8
|
+
<br />
|
9
|
+
<div>
|
10
|
+
<Image
|
11
|
+
alt="picture of a misty forest"
|
12
|
+
size="xs"
|
13
|
+
url="https://unsplash.it/500/400/?image=634"
|
14
|
+
{...props}
|
15
|
+
/>
|
16
|
+
</div>
|
17
|
+
<div>
|
18
|
+
<Image
|
19
|
+
alt="picture of a misty forest"
|
20
|
+
size="sm"
|
21
|
+
url="https://unsplash.it/500/400/?image=634"
|
22
|
+
{...props}
|
23
|
+
/>
|
24
|
+
</div>
|
25
|
+
<div>
|
26
|
+
<Image
|
27
|
+
alt="picture of a misty forest"
|
28
|
+
size="md"
|
29
|
+
url="https://unsplash.it/500/400/?image=634"
|
30
|
+
{...props}
|
31
|
+
/>
|
32
|
+
</div>
|
33
|
+
<div>
|
34
|
+
<Image
|
35
|
+
alt="picture of a misty forest"
|
36
|
+
size="lg"
|
37
|
+
url="https://unsplash.it/500/400/?image=634"
|
38
|
+
{...props}
|
39
|
+
/>
|
40
|
+
</div>
|
41
|
+
<div>
|
42
|
+
<Image
|
43
|
+
alt="picture of a misty forest"
|
44
|
+
size="xl"
|
45
|
+
url="https://unsplash.it/500/400/?image=634"
|
46
|
+
{...props}
|
47
|
+
/>
|
48
|
+
</div>
|
49
|
+
<div>
|
50
|
+
<Image
|
51
|
+
alt="picture of a misty forest"
|
52
|
+
url="https://unsplash.it/500/400/?image=634"
|
53
|
+
{...props}
|
54
|
+
/>
|
55
|
+
</div>
|
43
56
|
</>
|
44
57
|
)
|
45
58
|
}
|
@@ -5,41 +5,52 @@ import Image from '../_image'
|
|
5
5
|
const RoundedImage = (props) => {
|
6
6
|
return (
|
7
7
|
<>
|
8
|
-
<
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
<
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
8
|
+
<br />
|
9
|
+
<div>
|
10
|
+
<Image
|
11
|
+
alt=""
|
12
|
+
rounded
|
13
|
+
size="xs"
|
14
|
+
url="https://unsplash.it/500/400/?image=634"
|
15
|
+
{...props}
|
16
|
+
/>
|
17
|
+
</div>
|
18
|
+
<div>
|
19
|
+
<Image
|
20
|
+
alt=""
|
21
|
+
rounded
|
22
|
+
size="sm"
|
23
|
+
url="https://unsplash.it/500/400/?image=634"
|
24
|
+
{...props}
|
25
|
+
/>
|
26
|
+
</div>
|
27
|
+
<div>
|
28
|
+
<Image
|
29
|
+
alt=""
|
30
|
+
rounded
|
31
|
+
size="md"
|
32
|
+
url="https://unsplash.it/500/400/?image=634"
|
33
|
+
{...props}
|
34
|
+
/>
|
35
|
+
</div>
|
36
|
+
<div>
|
37
|
+
<Image
|
38
|
+
alt=""
|
39
|
+
rounded
|
40
|
+
size="lg"
|
41
|
+
url="https://unsplash.it/500/400/?image=634"
|
42
|
+
{...props}
|
43
|
+
/>
|
44
|
+
</div>
|
45
|
+
<div>
|
46
|
+
<Image
|
47
|
+
alt=""
|
48
|
+
rounded
|
49
|
+
size="xl"
|
50
|
+
url="https://unsplash.it/500/400/?image=634"
|
51
|
+
{...props}
|
52
|
+
/>
|
53
|
+
</div>
|
43
54
|
</>
|
44
55
|
)
|
45
56
|
}
|
@@ -12,13 +12,7 @@ import Title from '../pb_title/_title'
|
|
12
12
|
type LegendProps = {
|
13
13
|
aria?: object,
|
14
14
|
className?: string,
|
15
|
-
color?:
|
16
|
-
| "data_2"
|
17
|
-
| "data_3"
|
18
|
-
| "data_4"
|
19
|
-
| "data_5"
|
20
|
-
| "data_6"
|
21
|
-
| "data_7",
|
15
|
+
color?: string,
|
22
16
|
dark?: boolean,
|
23
17
|
data?: object,
|
24
18
|
id?: string,
|
@@ -20,5 +20,9 @@
|
|
20
20
|
}
|
21
21
|
|
22
22
|
[class^=pb_legend_kit] {
|
23
|
-
@include indicator-colors($data_colors)
|
24
|
-
|
23
|
+
@include indicator-colors($data_colors);
|
24
|
+
@include indicator-colors($status_colors);
|
25
|
+
@include indicator-colors($product_colors);
|
26
|
+
@include indicator-colors($category_colors)
|
27
|
+
|
28
|
+
}
|
@@ -0,0 +1,4 @@
|
|
1
|
+
<%= pb_rails("legend", props: { color: "data_8", text: "Windows" }) %>
|
2
|
+
<%= pb_rails("legend", props: { color: "warning", text: "Windows" }) %>
|
3
|
+
<%= pb_rails("legend", props: { color: "windows", text: "Windows" }) %>
|
4
|
+
<%= pb_rails("legend", props: { color: "category_7", text: "Windows" }) %>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import { Legend } from '../..'
|
3
|
+
|
4
|
+
const LegendColors = (props) => (
|
5
|
+
<div>
|
6
|
+
<Legend
|
7
|
+
color="data_8"
|
8
|
+
text="Windows"
|
9
|
+
{...props}
|
10
|
+
/>
|
11
|
+
<Legend
|
12
|
+
color="warning"
|
13
|
+
text="Windows"
|
14
|
+
{...props}
|
15
|
+
/>
|
16
|
+
<Legend
|
17
|
+
color="windows"
|
18
|
+
text="Windows"
|
19
|
+
{...props}
|
20
|
+
/>
|
21
|
+
<Legend
|
22
|
+
color="category_7"
|
23
|
+
text="Windows"
|
24
|
+
{...props}
|
25
|
+
/>
|
26
|
+
</div>
|
27
|
+
)
|
28
|
+
|
29
|
+
export default LegendColors
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<% labels = %W[Windows Doors Roofing Siding Solar Gutters Insulation Other] %>
|
2
2
|
|
3
|
-
<% (
|
4
|
-
<%= pb_rails("legend", props: { color: "data_#{n}", text: "#{labels[n]}" }) %>
|
3
|
+
<% (0..7).each do |n, i| %>
|
4
|
+
<%= pb_rails("legend", props: { color: "data_#{n + 1}", text: "#{labels[n]}" }) %>
|
5
5
|
<% end %>
|
@@ -2,7 +2,7 @@ import React from 'react'
|
|
2
2
|
|
3
3
|
import Legend from '../_legend'
|
4
4
|
|
5
|
-
const products = ['Windows', 'Doors', 'Roofing', 'Siding', 'Solar Gutters', 'Insulation', 'Other']
|
5
|
+
const products = ['Windows', 'Doors', 'Roofing', 'Siding', 'Solar', 'Gutters', 'Insulation', 'Other']
|
6
6
|
|
7
7
|
const LegendDefault = (props) => (
|
8
8
|
<div>
|
@@ -3,8 +3,7 @@
|
|
3
3
|
module Playbook
|
4
4
|
module PbLegend
|
5
5
|
class Legend < Playbook::KitBase
|
6
|
-
prop :color, type: Playbook::Props::
|
7
|
-
values: (1..7).map { |n| "data_#{n}" },
|
6
|
+
prop :color, type: Playbook::Props::String,
|
8
7
|
default: "data_1"
|
9
8
|
prop :prefix_text
|
10
9
|
prop :text, required: true
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import { render, screen } from '../utilities/test-utils'
|
3
|
+
|
4
|
+
import Legend from './_legend'
|
5
|
+
|
6
|
+
test('returns namespaced class name', () => {
|
7
|
+
render(
|
8
|
+
<Legend
|
9
|
+
data={{ testid: 'primary-test' }}
|
10
|
+
text="Test colors"
|
11
|
+
/>
|
12
|
+
)
|
13
|
+
|
14
|
+
const kit = screen.getByTestId('primary-test')
|
15
|
+
expect(kit).toHaveClass('pb_legend_kit_data_1')
|
16
|
+
})
|
17
|
+
|
18
|
+
test('color prop', () => {
|
19
|
+
render(
|
20
|
+
<Legend
|
21
|
+
color="category_17"
|
22
|
+
data={{ testid: 'primary-test' }}
|
23
|
+
text="Test colors"
|
24
|
+
/>
|
25
|
+
)
|
26
|
+
|
27
|
+
const kit = screen.getByTestId('primary-test')
|
28
|
+
expect(kit).toHaveClass('pb_legend_kit_category_17')
|
29
|
+
})
|
@@ -0,0 +1,22 @@
|
|
1
|
+
@mixin bold {
|
2
|
+
@include subtle;
|
3
|
+
|
4
|
+
[class*=pb_nav_list_kit_item] {
|
5
|
+
&[class*=_active] [class*=_link] {
|
6
|
+
background-color: $primary;
|
7
|
+
color: $white;
|
8
|
+
box-shadow: $shadow_deep;
|
9
|
+
@media (hover:hover) {
|
10
|
+
&:hover {
|
11
|
+
background-color: darken($primary, 4%);
|
12
|
+
[class*=_text],[class*=_icon] {
|
13
|
+
color: $white;
|
14
|
+
}
|
15
|
+
}
|
16
|
+
}
|
17
|
+
[class*=_text],[class*=_icon] {
|
18
|
+
font-weight: $bolder;
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|
22
|
+
}
|
@@ -3,6 +3,8 @@
|
|
3
3
|
@import "../tokens/animation-curves";
|
4
4
|
@import "../tokens/typography";
|
5
5
|
@import "./subtle_mixin";
|
6
|
+
@import "./bold_mixin";
|
7
|
+
@import "../tokens/shadows";
|
6
8
|
|
7
9
|
$selector: ".pb_nav_list";
|
8
10
|
|
@@ -92,7 +94,21 @@ $selector: ".pb_nav_list";
|
|
92
94
|
}
|
93
95
|
}
|
94
96
|
}
|
95
|
-
|
97
|
+
|
98
|
+
// Bold Variant
|
99
|
+
&[class*=_bold] {
|
100
|
+
@include bold;
|
101
|
+
// Horizontal Overrides
|
102
|
+
[class*=pb_nav_list_kit_item] {
|
103
|
+
margin: 0;
|
104
|
+
}
|
105
|
+
[class*=_active] {
|
106
|
+
[class*=_text] {
|
107
|
+
color: $white;
|
108
|
+
}
|
109
|
+
}
|
110
|
+
}
|
111
|
+
|
96
112
|
&[class*=dark]{
|
97
113
|
[class*=pb_nav_list_kit_item]{
|
98
114
|
[class*=_link]{
|
@@ -6,6 +6,8 @@
|
|
6
6
|
@import "../tokens/titles";
|
7
7
|
@import "../pb_body/body_mixins";
|
8
8
|
@import "./subtle_mixin";
|
9
|
+
@import "./bold_mixin";
|
10
|
+
@import "../tokens/shadows";
|
9
11
|
|
10
12
|
$selector: ".pb_nav_list";
|
11
13
|
|
@@ -87,12 +89,17 @@ $selector: ".pb_nav_list";
|
|
87
89
|
}
|
88
90
|
|
89
91
|
// Subtle Variant
|
90
|
-
&[class*=_subtle]
|
92
|
+
&[class*=_subtle] {
|
91
93
|
@include subtle;
|
92
94
|
}
|
93
95
|
|
96
|
+
// Bold Variant
|
97
|
+
&[class*=_bold] {
|
98
|
+
@include bold;
|
99
|
+
}
|
100
|
+
|
94
101
|
// Show Highlight
|
95
|
-
&[class*=_highlight]
|
102
|
+
&[class*=_highlight] {
|
96
103
|
[class*=_active] {
|
97
104
|
background-color: $active_light;
|
98
105
|
}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<%= pb_rails("nav", props: { orientation: "horizontal", variant: "bold" }) do %>
|
2
|
+
<%= pb_rails("nav/item", props: { text: "About", link: "#" }) %>
|
3
|
+
<%= pb_rails("nav/item", props: { text: "Case Studies", link: "#", active: true }) %>
|
4
|
+
<%= pb_rails("nav/item", props: { text: "Service ", link: "#" }) %>
|
5
|
+
<%= pb_rails("nav/item", props: { text: "Contacts", link: "#" }) %>
|
6
|
+
<% end %>
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
|
3
|
+
import Nav from '../_nav'
|
4
|
+
import NavItem from '../_item'
|
5
|
+
|
6
|
+
const BoldHorizontalNav = (props) => {
|
7
|
+
return (
|
8
|
+
<Nav
|
9
|
+
link="#"
|
10
|
+
orientation="horizontal"
|
11
|
+
variant="bold"
|
12
|
+
{...props}
|
13
|
+
>
|
14
|
+
<NavItem
|
15
|
+
link="#"
|
16
|
+
text="About"
|
17
|
+
{...props}
|
18
|
+
/>
|
19
|
+
<NavItem
|
20
|
+
active
|
21
|
+
link="#"
|
22
|
+
text="Case Studies"
|
23
|
+
{...props}
|
24
|
+
/>
|
25
|
+
<NavItem
|
26
|
+
link="#"
|
27
|
+
text="Service"
|
28
|
+
{...props}
|
29
|
+
/>
|
30
|
+
<NavItem
|
31
|
+
link="#"
|
32
|
+
text="Contacts"
|
33
|
+
{...props}
|
34
|
+
/>
|
35
|
+
</Nav>
|
36
|
+
)
|
37
|
+
}
|
38
|
+
|
39
|
+
export default BoldHorizontalNav
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<%= pb_rails("nav", props: { orientation: "vertical", variant: "bold" }) do %>
|
2
|
+
<%= pb_rails("nav/item", props: { text: "About", link: "#" }) %>
|
3
|
+
<%= pb_rails("nav/item", props: { text: "Case Studies", link: "#", active: true }) %>
|
4
|
+
<%= pb_rails("nav/item", props: { text: "Service ", link: "#" }) %>
|
5
|
+
<%= pb_rails("nav/item", props: { text: "Contacts", link: "#" }) %>
|
6
|
+
<% end %>
|