@buildcanada/charts 0.2.0 → 0.3.0
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.
- package/package.json +3 -1
- package/src/components/Button/Button.scss +174 -53
- package/src/components/Checkbox.scss +32 -20
- package/src/components/LabeledSwitch/LabeledSwitch.scss +43 -30
- package/src/components/RadioButton.scss +29 -9
- package/src/components/closeButton/CloseButton.scss +24 -11
- package/src/components/styles/colors.scss +209 -79
- package/src/components/styles/typography.scss +12 -6
- package/src/grapher/color/ColorConstants.ts +29 -15
- package/src/grapher/controls/ActionButtons.scss +50 -31
- package/src/grapher/controls/ActionButtons.tsx +13 -192
- package/src/grapher/controls/ContentSwitchers.scss +23 -14
- package/src/grapher/controls/Controls.scss +52 -38
- package/src/grapher/controls/Dropdown.scss +81 -50
- package/src/grapher/controls/SearchField.scss +39 -23
- package/src/grapher/controls/SettingsMenu.scss +3 -2
- package/src/grapher/controls/ShareMenu.scss +3 -2
- package/src/grapher/core/grapher.scss +9 -9
- package/src/grapher/entitySelector/EntitySelector.scss +1 -1
- package/src/grapher/footer/Footer.tsx +22 -92
- package/src/grapher/modal/Modal.scss +2 -1
- package/src/grapher/noDataModal/NoDataModal.tsx +3 -9
- package/src/grapher/tabs/Tabs.scss +63 -36
- package/src/grapher/timeline/TimelineComponent.scss +75 -21
- package/src/grapher/tooltip/Tooltip.scss +4 -4
- package/src/styles/charts.scss +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buildcanada/charts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "A configurable data visualization library for creating interactive charts.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -54,6 +54,8 @@
|
|
|
54
54
|
"react-dom": "^19.0.0"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
+
"@buildcanada/colours": "workspace:*",
|
|
58
|
+
"@buildcanada/components": "workspace:*",
|
|
57
59
|
"@fortawesome/fontawesome-svg-core": "^6.7.2",
|
|
58
60
|
"@fortawesome/free-brands-svg-icons": "^6.7.2",
|
|
59
61
|
"@fortawesome/free-solid-svg-icons": "^6.7.2",
|
|
@@ -1,90 +1,188 @@
|
|
|
1
|
+
/*******************************************************************************
|
|
2
|
+
* Charts Button Component
|
|
3
|
+
*
|
|
4
|
+
* Uses Build Canada design system styling with square corners and brand colors.
|
|
5
|
+
******************************************************************************/
|
|
6
|
+
|
|
1
7
|
.charts-btn {
|
|
2
8
|
@include body-3-medium;
|
|
3
|
-
|
|
4
|
-
|
|
9
|
+
display: inline-flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
gap: 8px;
|
|
13
|
+
padding: 10px 24px;
|
|
14
|
+
border: 2px solid transparent;
|
|
5
15
|
border-radius: 0;
|
|
6
16
|
text-align: center;
|
|
7
|
-
display: block;
|
|
8
17
|
cursor: pointer;
|
|
18
|
+
transition: all 150ms ease;
|
|
19
|
+
white-space: nowrap;
|
|
20
|
+
text-transform: uppercase;
|
|
21
|
+
letter-spacing: 0.05em;
|
|
22
|
+
font-weight: 500;
|
|
23
|
+
|
|
24
|
+
&:focus-visible {
|
|
25
|
+
outline: 2px solid $auburn;
|
|
26
|
+
outline-offset: 2px;
|
|
27
|
+
}
|
|
9
28
|
|
|
10
29
|
&.charts-btn--icon-only {
|
|
11
|
-
padding:
|
|
30
|
+
padding: 8px;
|
|
31
|
+
min-width: 40px;
|
|
32
|
+
min-height: 40px;
|
|
12
33
|
}
|
|
13
34
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
&.charts-btn--solid-blue,
|
|
18
|
-
&.charts-btn--solid-dark-blue,
|
|
19
|
-
&.charts-btn--solid-light-blue,
|
|
20
|
-
&.charts-btn--solid-vermillion {
|
|
21
|
-
color: $blue-50;
|
|
22
|
-
background-color: $blue-10;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
&.charts-btn--outline-vermillion,
|
|
26
|
-
&.charts-btn--outline-white {
|
|
27
|
-
color: $blue-40;
|
|
28
|
-
border-color: $blue-40;
|
|
29
|
-
}
|
|
35
|
+
svg {
|
|
36
|
+
font-size: 0.875em;
|
|
37
|
+
transition: transform 150ms ease;
|
|
30
38
|
}
|
|
31
39
|
|
|
32
|
-
|
|
33
|
-
|
|
40
|
+
// Animated arrow on hover
|
|
41
|
+
&:hover:not(:disabled) svg.icon-right {
|
|
42
|
+
transform: translateX(4px);
|
|
34
43
|
}
|
|
35
44
|
}
|
|
36
45
|
|
|
46
|
+
/*******************************************************************************
|
|
47
|
+
* Icon Position Modifiers
|
|
48
|
+
******************************************************************************/
|
|
49
|
+
|
|
37
50
|
.charts-btn--icon-right {
|
|
38
|
-
margin-left:
|
|
51
|
+
margin-left: 8px;
|
|
39
52
|
}
|
|
40
53
|
|
|
41
54
|
.charts-btn--icon-left {
|
|
42
|
-
margin-right:
|
|
55
|
+
margin-right: 8px;
|
|
43
56
|
}
|
|
44
57
|
|
|
58
|
+
/*******************************************************************************
|
|
59
|
+
* Solid Variants
|
|
60
|
+
******************************************************************************/
|
|
61
|
+
|
|
62
|
+
.charts-btn--solid-auburn,
|
|
45
63
|
.charts-btn--solid-vermillion {
|
|
46
|
-
background-color: $
|
|
47
|
-
color:
|
|
64
|
+
background-color: $auburn;
|
|
65
|
+
border-color: $auburn;
|
|
66
|
+
color: $white;
|
|
67
|
+
|
|
68
|
+
&:hover:not(:disabled) {
|
|
69
|
+
background-color: $auburn-600;
|
|
70
|
+
border-color: $auburn-600;
|
|
71
|
+
}
|
|
48
72
|
|
|
49
|
-
&:
|
|
50
|
-
background-color: $
|
|
73
|
+
&:active:not(:disabled) {
|
|
74
|
+
background-color: $auburn-700;
|
|
75
|
+
border-color: $auburn-700;
|
|
51
76
|
}
|
|
52
77
|
}
|
|
53
78
|
|
|
54
|
-
.charts-btn--
|
|
55
|
-
|
|
56
|
-
color: $
|
|
79
|
+
.charts-btn--solid-charcoal {
|
|
80
|
+
background-color: $charcoal;
|
|
81
|
+
border-color: $charcoal;
|
|
82
|
+
color: $white;
|
|
57
83
|
|
|
58
|
-
&:hover {
|
|
59
|
-
|
|
60
|
-
color: $
|
|
84
|
+
&:hover:not(:disabled) {
|
|
85
|
+
background-color: $gray-70;
|
|
86
|
+
border-color: $gray-70;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&:active:not(:disabled) {
|
|
90
|
+
background-color: $gray-60;
|
|
91
|
+
border-color: $gray-60;
|
|
61
92
|
}
|
|
62
93
|
}
|
|
63
94
|
|
|
95
|
+
.charts-btn--solid-cerulean,
|
|
64
96
|
.charts-btn--solid-blue {
|
|
65
|
-
background-color: $
|
|
66
|
-
color:
|
|
97
|
+
background-color: $cerulean-500;
|
|
98
|
+
border-color: $cerulean-500;
|
|
99
|
+
color: $white;
|
|
67
100
|
|
|
68
|
-
&:hover {
|
|
69
|
-
background-color: $
|
|
101
|
+
&:hover:not(:disabled) {
|
|
102
|
+
background-color: $cerulean-600;
|
|
103
|
+
border-color: $cerulean-600;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&:active:not(:disabled) {
|
|
107
|
+
background-color: $cerulean-700;
|
|
108
|
+
border-color: $cerulean-700;
|
|
70
109
|
}
|
|
71
110
|
}
|
|
72
111
|
|
|
73
112
|
.charts-btn--solid-dark-blue {
|
|
74
|
-
background-color: $
|
|
75
|
-
color:
|
|
113
|
+
background-color: $cerulean-900;
|
|
114
|
+
border-color: $cerulean-900;
|
|
115
|
+
color: $white;
|
|
76
116
|
|
|
77
|
-
&:hover {
|
|
78
|
-
background-color:
|
|
117
|
+
&:hover:not(:disabled) {
|
|
118
|
+
background-color: $cerulean-950;
|
|
119
|
+
border-color: $cerulean-950;
|
|
79
120
|
}
|
|
80
121
|
}
|
|
81
122
|
|
|
82
123
|
.charts-btn--solid-light-blue {
|
|
83
|
-
background-color: $
|
|
84
|
-
color: $
|
|
124
|
+
background-color: $cerulean-100;
|
|
125
|
+
border-color: $cerulean-100;
|
|
126
|
+
color: $cerulean-900;
|
|
127
|
+
|
|
128
|
+
&:hover:not(:disabled) {
|
|
129
|
+
background-color: $cerulean-200;
|
|
130
|
+
border-color: $cerulean-200;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.charts-btn--solid-linen {
|
|
135
|
+
background-color: $linen;
|
|
136
|
+
border-color: $linen;
|
|
137
|
+
color: $charcoal;
|
|
138
|
+
|
|
139
|
+
&:hover:not(:disabled) {
|
|
140
|
+
background-color: $gray-20;
|
|
141
|
+
border-color: $gray-20;
|
|
142
|
+
}
|
|
85
143
|
|
|
86
|
-
&:
|
|
87
|
-
background-color: $
|
|
144
|
+
&:active:not(:disabled) {
|
|
145
|
+
background-color: $gray-30;
|
|
146
|
+
border-color: $gray-30;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/*******************************************************************************
|
|
151
|
+
* Outline Variants
|
|
152
|
+
******************************************************************************/
|
|
153
|
+
|
|
154
|
+
.charts-btn--outline-auburn,
|
|
155
|
+
.charts-btn--outline-vermillion {
|
|
156
|
+
background-color: transparent;
|
|
157
|
+
border-color: $auburn;
|
|
158
|
+
color: $auburn;
|
|
159
|
+
|
|
160
|
+
&:hover:not(:disabled) {
|
|
161
|
+
background-color: $auburn;
|
|
162
|
+
color: $white;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
&:active:not(:disabled) {
|
|
166
|
+
background-color: $auburn-600;
|
|
167
|
+
border-color: $auburn-600;
|
|
168
|
+
color: $white;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.charts-btn--outline-charcoal {
|
|
173
|
+
background-color: transparent;
|
|
174
|
+
border-color: $charcoal;
|
|
175
|
+
color: $charcoal;
|
|
176
|
+
|
|
177
|
+
&:hover:not(:disabled) {
|
|
178
|
+
background-color: $charcoal;
|
|
179
|
+
color: $white;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
&:active:not(:disabled) {
|
|
183
|
+
background-color: $gray-70;
|
|
184
|
+
border-color: $gray-70;
|
|
185
|
+
color: $white;
|
|
88
186
|
}
|
|
89
187
|
}
|
|
90
188
|
|
|
@@ -93,18 +191,41 @@
|
|
|
93
191
|
border-color: $white;
|
|
94
192
|
color: $white;
|
|
95
193
|
|
|
96
|
-
&:hover {
|
|
194
|
+
&:hover:not(:disabled) {
|
|
97
195
|
background-color: $white;
|
|
98
|
-
color: $
|
|
196
|
+
color: $charcoal;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
&:active:not(:disabled) {
|
|
200
|
+
background-color: $gray-10;
|
|
201
|
+
border-color: $gray-10;
|
|
202
|
+
color: $charcoal;
|
|
99
203
|
}
|
|
100
204
|
}
|
|
101
205
|
|
|
206
|
+
.charts-btn--outline-cerulean,
|
|
102
207
|
.charts-btn--outline-light-blue {
|
|
103
|
-
|
|
104
|
-
color: $
|
|
208
|
+
background-color: transparent;
|
|
209
|
+
border-color: $cerulean-500;
|
|
210
|
+
color: $cerulean-700;
|
|
105
211
|
|
|
106
|
-
&:hover {
|
|
107
|
-
background-color: $
|
|
108
|
-
color: $
|
|
212
|
+
&:hover:not(:disabled) {
|
|
213
|
+
background-color: $cerulean-500;
|
|
214
|
+
color: $white;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
&:active:not(:disabled) {
|
|
218
|
+
background-color: $cerulean-600;
|
|
219
|
+
border-color: $cerulean-600;
|
|
220
|
+
color: $white;
|
|
109
221
|
}
|
|
110
222
|
}
|
|
223
|
+
|
|
224
|
+
/*******************************************************************************
|
|
225
|
+
* Disabled State
|
|
226
|
+
******************************************************************************/
|
|
227
|
+
|
|
228
|
+
.charts-btn:disabled {
|
|
229
|
+
opacity: 0.5;
|
|
230
|
+
cursor: not-allowed;
|
|
231
|
+
}
|
|
@@ -1,14 +1,23 @@
|
|
|
1
|
+
/*******************************************************************************
|
|
2
|
+
* Checkbox
|
|
3
|
+
*
|
|
4
|
+
* Custom checkbox styling.
|
|
5
|
+
* Uses Build Canada design system colors.
|
|
6
|
+
******************************************************************************/
|
|
7
|
+
|
|
1
8
|
.checkbox {
|
|
2
|
-
$checkbox-size:
|
|
9
|
+
$checkbox-size: 18px;
|
|
3
10
|
|
|
4
11
|
$light-stroke: $gray-30;
|
|
5
|
-
$hover-stroke: $
|
|
6
|
-
$active-fill: $
|
|
12
|
+
$hover-stroke: $auburn-500;
|
|
13
|
+
$active-fill: $auburn-500;
|
|
7
14
|
|
|
8
15
|
position: relative;
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: flex-start;
|
|
9
18
|
|
|
10
19
|
label {
|
|
11
|
-
margin: 0;
|
|
20
|
+
margin: 0;
|
|
12
21
|
}
|
|
13
22
|
|
|
14
23
|
input {
|
|
@@ -27,28 +36,29 @@
|
|
|
27
36
|
width: $checkbox-size;
|
|
28
37
|
height: $checkbox-size;
|
|
29
38
|
|
|
30
|
-
background: white;
|
|
39
|
+
background: $white;
|
|
31
40
|
pointer-events: none;
|
|
32
|
-
border-radius:
|
|
33
|
-
border:
|
|
34
|
-
color:
|
|
41
|
+
border-radius: 0;
|
|
42
|
+
border: 2px solid $light-stroke;
|
|
43
|
+
color: $white;
|
|
35
44
|
|
|
36
45
|
display: flex;
|
|
37
46
|
align-items: center;
|
|
38
47
|
justify-content: center;
|
|
48
|
+
transition: all 150ms ease;
|
|
39
49
|
|
|
40
50
|
svg {
|
|
41
51
|
font-size: 10px;
|
|
42
|
-
padding-left: 0.75px;
|
|
43
52
|
}
|
|
44
53
|
}
|
|
45
54
|
|
|
46
55
|
input:focus-visible + .custom {
|
|
47
|
-
outline: 2px solid $
|
|
56
|
+
outline: 2px solid $auburn;
|
|
57
|
+
outline-offset: 2px;
|
|
48
58
|
}
|
|
49
59
|
|
|
50
60
|
input:active + .custom {
|
|
51
|
-
background: $
|
|
61
|
+
background: $auburn-100;
|
|
52
62
|
}
|
|
53
63
|
|
|
54
64
|
input:checked + .custom {
|
|
@@ -57,36 +67,38 @@
|
|
|
57
67
|
}
|
|
58
68
|
|
|
59
69
|
input:checked:active + .custom {
|
|
60
|
-
background:
|
|
70
|
+
background: $auburn-600;
|
|
71
|
+
border-color: $auburn-600;
|
|
61
72
|
}
|
|
62
73
|
|
|
63
74
|
input:disabled {
|
|
64
75
|
+ .custom {
|
|
65
|
-
background: $
|
|
66
|
-
border-color: $
|
|
67
|
-
color: $
|
|
76
|
+
background: $gray-10;
|
|
77
|
+
border-color: $gray-20;
|
|
78
|
+
color: $gray-50;
|
|
68
79
|
}
|
|
69
80
|
|
|
70
81
|
&:active + .custom {
|
|
71
|
-
background: $
|
|
82
|
+
background: $gray-10;
|
|
72
83
|
}
|
|
73
84
|
|
|
74
85
|
~ .label {
|
|
75
|
-
color: $
|
|
86
|
+
color: $gray-50;
|
|
76
87
|
cursor: not-allowed;
|
|
77
88
|
}
|
|
78
89
|
}
|
|
79
90
|
|
|
80
91
|
.label {
|
|
81
92
|
@include grapher_label-2-regular;
|
|
82
|
-
padding-left: $checkbox-size +
|
|
93
|
+
padding-left: $checkbox-size + 10px;
|
|
83
94
|
cursor: pointer;
|
|
84
95
|
user-select: none;
|
|
85
|
-
color: $
|
|
96
|
+
color: $charcoal;
|
|
97
|
+
line-height: $checkbox-size;
|
|
86
98
|
}
|
|
87
99
|
|
|
88
100
|
&:hover {
|
|
89
|
-
input:not(:checked) + .custom {
|
|
101
|
+
input:not(:checked):not(:disabled) + .custom {
|
|
90
102
|
border-color: $hover-stroke;
|
|
91
103
|
}
|
|
92
104
|
}
|
|
@@ -1,20 +1,26 @@
|
|
|
1
|
+
/*******************************************************************************
|
|
2
|
+
* Labeled Switch
|
|
3
|
+
*
|
|
4
|
+
* Toggle switch with label.
|
|
5
|
+
* Uses Build Canada design system colors.
|
|
6
|
+
******************************************************************************/
|
|
7
|
+
|
|
1
8
|
@use "sass:color";
|
|
2
9
|
|
|
3
10
|
$light-fill: $gray-30;
|
|
4
|
-
$active-fill: $
|
|
5
|
-
|
|
6
|
-
$active-switch: $blue-50;
|
|
7
|
-
|
|
11
|
+
$active-fill: $cerulean-100;
|
|
12
|
+
$active-switch: $cerulean-500;
|
|
8
13
|
$medium: 400;
|
|
9
14
|
$lato: $sans-serif-font-stack;
|
|
10
15
|
|
|
11
|
-
//
|
|
16
|
+
// On/off switch with label written to the right
|
|
12
17
|
.labeled-switch {
|
|
13
|
-
//
|
|
18
|
+
// Keep in sync with TableFilterToggle.tsx
|
|
14
19
|
// where the width of a labeled switch is calculated
|
|
15
20
|
|
|
16
21
|
display: flex;
|
|
17
|
-
|
|
22
|
+
align-items: center;
|
|
23
|
+
color: $gray-60;
|
|
18
24
|
font: $medium 13px/16px $lato;
|
|
19
25
|
letter-spacing: 0.01em;
|
|
20
26
|
|
|
@@ -24,23 +30,20 @@ $lato: $sans-serif-font-stack;
|
|
|
24
30
|
user-select: none;
|
|
25
31
|
|
|
26
32
|
label {
|
|
27
|
-
color: $
|
|
28
|
-
padding-left:
|
|
33
|
+
color: $charcoal;
|
|
34
|
+
padding-left: 40px;
|
|
29
35
|
white-space: nowrap;
|
|
30
|
-
|
|
31
|
-
&:hover {
|
|
32
|
-
cursor: pointer;
|
|
33
|
-
}
|
|
36
|
+
cursor: pointer;
|
|
34
37
|
|
|
35
38
|
svg {
|
|
36
|
-
color: $gray-
|
|
39
|
+
color: $gray-50;
|
|
37
40
|
height: 13px;
|
|
38
41
|
padding: 0 0.333em;
|
|
39
42
|
}
|
|
40
43
|
}
|
|
41
44
|
|
|
42
45
|
.labeled-switch-subtitle {
|
|
43
|
-
//
|
|
46
|
+
// Only show subtitle in settings menu, otherwise use icon + tooltip
|
|
44
47
|
display: none;
|
|
45
48
|
}
|
|
46
49
|
|
|
@@ -48,61 +51,71 @@ $lato: $sans-serif-font-stack;
|
|
|
48
51
|
position: absolute;
|
|
49
52
|
opacity: 0;
|
|
50
53
|
left: 0;
|
|
54
|
+
cursor: pointer;
|
|
51
55
|
}
|
|
52
56
|
|
|
53
57
|
.outer {
|
|
54
58
|
position: absolute;
|
|
55
59
|
left: 0;
|
|
56
|
-
top:
|
|
60
|
+
top: 50%;
|
|
61
|
+
transform: translateY(-50%);
|
|
57
62
|
content: " ";
|
|
58
|
-
width:
|
|
59
|
-
height:
|
|
63
|
+
width: 32px;
|
|
64
|
+
height: 18px;
|
|
60
65
|
background: $light-fill;
|
|
61
|
-
border-radius:
|
|
66
|
+
border-radius: 9px;
|
|
62
67
|
pointer-events: none;
|
|
68
|
+
transition: background 200ms ease;
|
|
69
|
+
|
|
63
70
|
.inner {
|
|
64
71
|
position: relative;
|
|
65
72
|
content: " ";
|
|
66
|
-
width:
|
|
67
|
-
height:
|
|
68
|
-
background: $gray-
|
|
69
|
-
border-radius:
|
|
73
|
+
width: 12px;
|
|
74
|
+
height: 12px;
|
|
75
|
+
background: $gray-60;
|
|
76
|
+
border-radius: 50%;
|
|
70
77
|
top: 3px;
|
|
71
78
|
left: 3px;
|
|
72
79
|
pointer-events: none;
|
|
73
|
-
transition: transform
|
|
80
|
+
transition: transform 200ms ease, background 200ms ease;
|
|
74
81
|
}
|
|
75
82
|
}
|
|
76
83
|
|
|
77
84
|
&:hover {
|
|
78
85
|
.outer .inner {
|
|
79
|
-
background: $
|
|
86
|
+
background: $charcoal;
|
|
80
87
|
}
|
|
81
88
|
}
|
|
82
89
|
|
|
83
90
|
input:focus-visible + .outer {
|
|
84
|
-
outline: 2px solid $
|
|
91
|
+
outline: 2px solid $auburn;
|
|
92
|
+
outline-offset: 2px;
|
|
85
93
|
}
|
|
86
94
|
|
|
87
95
|
input:checked + .outer {
|
|
88
96
|
background: $active-fill;
|
|
97
|
+
|
|
89
98
|
.inner {
|
|
90
99
|
background: $active-switch;
|
|
91
|
-
transform: translate(
|
|
100
|
+
transform: translate(14px, 0);
|
|
92
101
|
}
|
|
93
102
|
}
|
|
103
|
+
|
|
94
104
|
&:hover input:checked + .outer .inner {
|
|
95
|
-
background:
|
|
105
|
+
background: $cerulean-600;
|
|
96
106
|
}
|
|
97
107
|
|
|
98
108
|
&.labeled-switch--is-disabled {
|
|
99
109
|
opacity: 0.5;
|
|
110
|
+
cursor: not-allowed;
|
|
111
|
+
|
|
100
112
|
label {
|
|
101
|
-
cursor:
|
|
113
|
+
cursor: not-allowed;
|
|
102
114
|
}
|
|
115
|
+
|
|
103
116
|
&:hover {
|
|
104
117
|
.inner {
|
|
105
|
-
background: $gray-
|
|
118
|
+
background: $gray-60;
|
|
106
119
|
}
|
|
107
120
|
}
|
|
108
121
|
}
|
|
@@ -1,16 +1,25 @@
|
|
|
1
|
+
/*******************************************************************************
|
|
2
|
+
* Radio Button
|
|
3
|
+
*
|
|
4
|
+
* Custom radio button styling.
|
|
5
|
+
* Uses Build Canada design system colors.
|
|
6
|
+
******************************************************************************/
|
|
7
|
+
|
|
1
8
|
@use "sass:math";
|
|
2
9
|
|
|
3
10
|
.radio {
|
|
4
|
-
$radio-size:
|
|
11
|
+
$radio-size: 18px;
|
|
5
12
|
|
|
6
13
|
$light-stroke: $gray-30;
|
|
7
|
-
$hover-stroke: $
|
|
8
|
-
$active-fill: $
|
|
14
|
+
$hover-stroke: $cerulean-500;
|
|
15
|
+
$active-fill: $cerulean-500;
|
|
9
16
|
|
|
10
17
|
position: relative;
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: flex-start;
|
|
11
20
|
|
|
12
21
|
label {
|
|
13
|
-
margin: 0;
|
|
22
|
+
margin: 0;
|
|
14
23
|
cursor: pointer;
|
|
15
24
|
}
|
|
16
25
|
|
|
@@ -28,37 +37,48 @@
|
|
|
28
37
|
width: $radio-size;
|
|
29
38
|
height: $radio-size;
|
|
30
39
|
|
|
31
|
-
background: white;
|
|
40
|
+
background: $white;
|
|
32
41
|
pointer-events: none;
|
|
33
42
|
border-radius: 50%;
|
|
34
|
-
border:
|
|
43
|
+
border: 2px solid $light-stroke;
|
|
35
44
|
|
|
36
45
|
display: flex;
|
|
37
46
|
align-items: center;
|
|
38
47
|
justify-content: center;
|
|
48
|
+
transition: all 150ms ease;
|
|
39
49
|
|
|
40
50
|
.inner {
|
|
41
51
|
width: math.div($radio-size, 2);
|
|
42
52
|
height: math.div($radio-size, 2);
|
|
43
53
|
background-color: $active-fill;
|
|
44
54
|
border-radius: 50%;
|
|
55
|
+
opacity: 0;
|
|
56
|
+
transform: scale(0);
|
|
57
|
+
transition: all 150ms ease;
|
|
45
58
|
}
|
|
46
59
|
}
|
|
47
60
|
|
|
48
61
|
input:focus-visible + .outer {
|
|
49
|
-
outline: 2px solid $
|
|
62
|
+
outline: 2px solid $auburn;
|
|
63
|
+
outline-offset: 2px;
|
|
50
64
|
}
|
|
51
65
|
|
|
52
66
|
input:checked + .outer {
|
|
53
67
|
border-color: $hover-stroke;
|
|
68
|
+
|
|
69
|
+
.inner {
|
|
70
|
+
opacity: 1;
|
|
71
|
+
transform: scale(1);
|
|
72
|
+
}
|
|
54
73
|
}
|
|
55
74
|
|
|
56
75
|
.label {
|
|
57
76
|
@include grapher_label-2-regular;
|
|
58
|
-
padding-left: $radio-size +
|
|
77
|
+
padding-left: $radio-size + 10px;
|
|
59
78
|
cursor: pointer;
|
|
60
79
|
user-select: none;
|
|
61
|
-
color: $
|
|
80
|
+
color: $charcoal;
|
|
81
|
+
line-height: $radio-size;
|
|
62
82
|
}
|
|
63
83
|
|
|
64
84
|
&:hover {
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
+
/*******************************************************************************
|
|
2
|
+
* Close Button
|
|
3
|
+
*
|
|
4
|
+
* Circular close/dismiss button.
|
|
5
|
+
* Uses Build Canada design system colors.
|
|
6
|
+
******************************************************************************/
|
|
7
|
+
|
|
1
8
|
.close-button {
|
|
2
|
-
//
|
|
9
|
+
// Keep in sync with CLOSE_BUTTON_SIZE in CloseButton.tsx
|
|
3
10
|
$size: 32px;
|
|
4
11
|
|
|
5
12
|
$light-stroke: $gray-20;
|
|
6
|
-
|
|
7
|
-
$active-fill: #dbe5f0;
|
|
13
|
+
$active-fill: $cerulean-100;
|
|
8
14
|
$hover-fill: $gray-10;
|
|
9
15
|
|
|
10
16
|
display: flex;
|
|
@@ -14,23 +20,30 @@
|
|
|
14
20
|
position: relative;
|
|
15
21
|
height: $size;
|
|
16
22
|
width: $size;
|
|
17
|
-
padding:
|
|
23
|
+
padding: 0;
|
|
18
24
|
|
|
19
|
-
color: $
|
|
20
|
-
background: white;
|
|
25
|
+
color: $gray-60;
|
|
26
|
+
background: $white;
|
|
21
27
|
border: 1px solid $light-stroke;
|
|
22
|
-
border-radius:
|
|
28
|
+
border-radius: 0;
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
transition: all 150ms ease;
|
|
23
31
|
|
|
24
32
|
&:hover {
|
|
25
33
|
background: $hover-fill;
|
|
26
|
-
border-color: $
|
|
27
|
-
|
|
28
|
-
color: $dark-text;
|
|
34
|
+
border-color: $gray-30;
|
|
35
|
+
color: $charcoal;
|
|
29
36
|
}
|
|
30
37
|
|
|
31
38
|
&:active {
|
|
32
39
|
background: $active-fill;
|
|
33
|
-
border:
|
|
40
|
+
border-color: $cerulean-500;
|
|
41
|
+
color: $cerulean-900;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&:focus-visible {
|
|
45
|
+
outline: 2px solid $auburn;
|
|
46
|
+
outline-offset: 2px;
|
|
34
47
|
}
|
|
35
48
|
|
|
36
49
|
svg {
|