@cfpb/cfpb-design-system 3.1.0 → 3.1.2

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 (49) hide show
  1. package/dist/base/index.css.map +2 -2
  2. package/dist/base/index.js +1 -1
  3. package/dist/base/index.js.map +1 -1
  4. package/dist/components/cfpb-buttons/index.css.map +2 -2
  5. package/dist/components/cfpb-buttons/index.js +1 -1
  6. package/dist/components/cfpb-buttons/index.js.map +1 -1
  7. package/dist/components/cfpb-expandables/index.css +1 -1
  8. package/dist/components/cfpb-expandables/index.css.map +2 -2
  9. package/dist/components/cfpb-expandables/index.js +1 -1
  10. package/dist/components/cfpb-expandables/index.js.map +1 -1
  11. package/dist/components/cfpb-forms/index.css +1 -1
  12. package/dist/components/cfpb-forms/index.css.map +2 -2
  13. package/dist/components/cfpb-forms/index.js +1 -1
  14. package/dist/components/cfpb-forms/index.js.map +1 -1
  15. package/dist/components/cfpb-icons/index.css.map +2 -2
  16. package/dist/components/cfpb-icons/index.js +1 -1
  17. package/dist/components/cfpb-icons/index.js.map +1 -1
  18. package/dist/components/cfpb-layout/index.css.map +2 -2
  19. package/dist/components/cfpb-layout/index.js +1 -1
  20. package/dist/components/cfpb-layout/index.js.map +1 -1
  21. package/dist/components/cfpb-notifications/index.css.map +2 -2
  22. package/dist/components/cfpb-notifications/index.js.map +1 -1
  23. package/dist/components/cfpb-pagination/index.css.map +2 -2
  24. package/dist/components/cfpb-pagination/index.js +1 -1
  25. package/dist/components/cfpb-pagination/index.js.map +1 -1
  26. package/dist/components/cfpb-tables/index.css.map +2 -2
  27. package/dist/components/cfpb-tables/index.js +1 -1
  28. package/dist/components/cfpb-tables/index.js.map +1 -1
  29. package/dist/components/cfpb-typography/index.css +1 -1
  30. package/dist/components/cfpb-typography/index.css.map +2 -2
  31. package/dist/components/cfpb-typography/index.js +1 -1
  32. package/dist/components/cfpb-typography/index.js.map +1 -1
  33. package/dist/index.css +1 -1
  34. package/dist/index.css.map +2 -2
  35. package/dist/index.js +1 -1
  36. package/dist/index.js.map +1 -1
  37. package/dist/utilities/index.css +1 -1
  38. package/dist/utilities/index.css.map +2 -2
  39. package/dist/utilities/index.js +1 -1
  40. package/dist/utilities/index.js.map +1 -1
  41. package/package.json +2 -2
  42. package/src/abstracts/heading-mixins.scss +32 -74
  43. package/src/components/cfpb-expandables/expandable-group.js +1 -1
  44. package/src/components/cfpb-expandables/expandable.spec.js +1 -1
  45. package/src/components/cfpb-forms/tag.scss +10 -3
  46. package/src/components/cfpb-typography/link.scss +1 -0
  47. package/src/components/cfpb-typography/mixins.scss +21 -1
  48. package/src/components/cfpb-typography/slug-header.scss +1 -3
  49. package/src/index.scss +10 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cfpb/cfpb-design-system",
3
- "version": "3.1.0",
3
+ "version": "3.1.2",
4
4
  "description": "CFPB's UI framework",
5
5
  "main": "src/index.js",
6
6
  "author": {
@@ -19,6 +19,6 @@
19
19
  "bugs": {
20
20
  "url": "https://github.com/cfpb/design-system/issues"
21
21
  },
22
- "gitHead": "95e07185441126cf0376f28f49180a77168ee413",
22
+ "gitHead": "def4f440c6e4df31e9c9001a3630e14011c2c840",
23
23
  "type": "module"
24
24
  }
@@ -8,78 +8,54 @@
8
8
  Base styles
9
9
  ========================================================================== */
10
10
 
11
- /* stylelint-disable selector-class-pattern */
12
- @mixin heading-1($fs: $size-i) {
13
- /* stylelint-enable */
14
- $font-size: $fs;
15
-
16
- margin-bottom: math.div(15px, $font-size) + em;
17
- font-size: math.div($font-size, $base-font-size-px) + em;
11
+ @mixin heading-1() {
12
+ margin-bottom: math.div(15px, $size-i) + em;
13
+ font-size: math.div($size-i, $base-font-size-px) + em;
18
14
  font-weight: 600;
19
15
  letter-spacing: inherit;
20
16
  line-height: 1.25;
21
17
  text-transform: inherit;
22
18
  }
23
19
 
24
- /* stylelint-disable selector-class-pattern */
25
- @mixin heading-2($fs: $size-ii) {
26
- /* stylelint-enable */
27
- $font-size: $fs;
28
-
29
- margin-bottom: math.div(15px, $font-size) + em;
30
- font-size: math.div($font-size, $base-font-size-px) + em;
20
+ @mixin heading-2() {
21
+ margin-bottom: math.div(15px, $size-ii) + em;
22
+ font-size: math.div($size-ii, $base-font-size-px) + em;
31
23
  font-weight: 600;
32
24
  letter-spacing: inherit;
33
25
  line-height: 1.25;
34
26
  text-transform: inherit;
35
27
  }
36
28
 
37
- /* stylelint-disable selector-class-pattern */
38
- @mixin heading-3($fs: $size-iii) {
39
- /* stylelint-enable */
40
- $font-size: $fs;
41
-
42
- margin-bottom: math.div(15px, $font-size) + em;
43
- font-size: math.div($font-size, $base-font-size-px) + em;
29
+ @mixin heading-3() {
30
+ margin-bottom: math.div(15px, $size-iii) + em;
31
+ font-size: math.div($size-iii, $base-font-size-px) + em;
44
32
  font-weight: normal;
45
33
  letter-spacing: inherit;
46
34
  line-height: 1.25;
47
35
  text-transform: inherit;
48
36
  }
49
37
 
50
- /* stylelint-disable selector-class-pattern */
51
- @mixin heading-4($fs: $size-iv) {
52
- /* stylelint-enable */
53
- $font-size: $fs;
54
-
55
- margin-bottom: math.div(15px, $font-size) + em;
56
- font-size: math.div($font-size, $base-font-size-px) + em;
38
+ @mixin heading-4() {
39
+ margin-bottom: math.div(15px, $size-iv) + em;
40
+ font-size: math.div($size-iv, $base-font-size-px) + em;
57
41
  font-weight: 500;
58
42
  letter-spacing: inherit;
59
43
  line-height: 1.25;
60
44
  text-transform: inherit;
61
45
  }
62
46
 
63
- /* stylelint-disable selector-class-pattern */
64
- @mixin heading-5($fs: $size-v) {
65
- /* stylelint-enable */
66
- $font-size: $fs;
67
-
68
- margin-bottom: math.div(15px, $font-size) + em;
69
- font-size: math.div($font-size, $base-font-size-px) + em;
47
+ @mixin heading-5() {
48
+ margin-bottom: math.div(15px, $size-v) + em;
49
+ font-size: math.div($size-v, $base-font-size-px) + em;
70
50
  font-weight: 600;
71
51
  letter-spacing: 1px;
72
52
  line-height: 1.25;
73
53
  text-transform: uppercase;
74
54
  }
75
55
 
76
- /* stylelint-disable selector-class-pattern */
77
- @mixin heading-6($fs: $size-vi) {
78
- /* stylelint-enable */
79
- $font-size: $fs;
80
-
81
- margin-bottom: math.div(15px, $font-size) + em;
82
- font-size: math.div($font-size, $base-font-size-px) + em;
56
+ @mixin heading-6() {
57
+ margin-bottom: math.div(15px, $size-vi) + em;
58
+ font-size: math.div($size-vi, $base-font-size-px) + em;
83
59
  font-weight: 600;
84
60
  letter-spacing: 1px;
85
61
  line-height: 1.25;
@@ -89,8 +65,6 @@
89
65
  @mixin h1() {
90
66
  @include heading-1;
91
67
 
92
- $font-size: $size-i;
93
-
94
68
  p + &,
95
69
  ul + &,
96
70
  ol + &,
@@ -99,15 +73,13 @@
99
73
  img + &,
100
74
  table + &,
101
75
  blockquote + & {
102
- margin-top: math.div(60px, $font-size) + em;
76
+ margin-top: math.div(60px, $size-i) + em;
103
77
  }
104
78
 
105
79
  // Mobile only.
106
80
  @include respond-to-max($bp-xs-max) {
107
81
  @include heading-2;
108
82
 
109
- $font-size: $size-ii;
110
-
111
83
  p + &,
112
84
  ul + &,
113
85
  ol + &,
@@ -116,7 +88,7 @@
116
88
  img + &,
117
89
  table + &,
118
90
  blockquote + & {
119
- margin-top: math.div(45px, $font-size) + em;
91
+ margin-top: math.div(45px, $size-ii) + em;
120
92
  }
121
93
  h2 + &,
122
94
  .h2 + &,
@@ -128,7 +100,7 @@
128
100
  .h5 + &,
129
101
  h6 + &,
130
102
  .h6 + & {
131
- margin-top: math.div(30px, $font-size) + em;
103
+ margin-top: math.div(30px, $size-ii) + em;
132
104
  }
133
105
  }
134
106
  }
@@ -136,8 +108,6 @@
136
108
  @mixin h2() {
137
109
  @include heading-2;
138
110
 
139
- $font-size: $size-ii;
140
-
141
111
  p + &,
142
112
  ul + &,
143
113
  ol + &,
@@ -146,7 +116,7 @@
146
116
  img + &,
147
117
  table + &,
148
118
  blockquote + & {
149
- margin-top: math.div(45px, $font-size) + em;
119
+ margin-top: math.div(45px, $size-ii) + em;
150
120
  }
151
121
 
152
122
  h1 + &,
@@ -159,15 +129,13 @@
159
129
  .h5 + &,
160
130
  h6 + &,
161
131
  .h6 + & {
162
- margin-top: math.div(30px, $font-size) + em;
132
+ margin-top: math.div(30px, $size-ii) + em;
163
133
  }
164
134
 
165
135
  // Mobile only.
166
136
  @include respond-to-max($bp-xs-max) {
167
137
  @include heading-3;
168
138
 
169
- $font-size: $size-iii;
170
-
171
139
  p + &,
172
140
  ul + &,
173
141
  ol + &,
@@ -176,7 +144,7 @@
176
144
  img + &,
177
145
  table + &,
178
146
  blockquote + & {
179
- margin-top: math.div(30px, $font-size) + em;
147
+ margin-top: math.div(30px, $size-iii) + em;
180
148
  }
181
149
  }
182
150
  }
@@ -184,8 +152,6 @@
184
152
  @mixin h3() {
185
153
  @include heading-3;
186
154
 
187
- $font-size: $size-iii;
188
-
189
155
  p + &,
190
156
  ul + &,
191
157
  ol + &,
@@ -204,7 +170,7 @@
204
170
  .h5 + &,
205
171
  h6 + &,
206
172
  .h6 + & {
207
- margin-top: math.div(30px, $font-size) + em;
173
+ margin-top: math.div(30px, $size-iii) + em;
208
174
  }
209
175
 
210
176
  // Mobile only.
@@ -216,8 +182,6 @@
216
182
  @mixin h4() {
217
183
  @include heading-4;
218
184
 
219
- $font-size: $size-iv;
220
-
221
185
  p + &,
222
186
  ul + &,
223
187
  ol + &,
@@ -236,7 +200,7 @@
236
200
  .h5 + &,
237
201
  h6 + &,
238
202
  .h6 + & {
239
- margin-top: math.div(30px, $font-size) + em;
203
+ margin-top: math.div(30px, $size-iv) + em;
240
204
  }
241
205
 
242
206
  // Mobile only.
@@ -251,8 +215,6 @@
251
215
  @mixin h5() {
252
216
  @include heading-5;
253
217
 
254
- $font-size: $size-v;
255
-
256
218
  p + &,
257
219
  ul + &,
258
220
  ol + &,
@@ -271,15 +233,13 @@
271
233
  .h4 + &,
272
234
  h6 + &,
273
235
  .h6 + & {
274
- margin-top: math.div(30px, $font-size) + em;
236
+ margin-top: math.div(30px, $size-v) + em;
275
237
  }
276
238
  }
277
239
 
278
240
  @mixin h6() {
279
241
  @include heading-6;
280
242
 
281
- $font-size: $size-vi;
282
-
283
243
  p + &,
284
244
  ul + &,
285
245
  ol + &,
@@ -298,7 +258,7 @@
298
258
  .h4 + &,
299
259
  h5 + &,
300
260
  .h5 + & {
301
- margin-top: math.div(30px, $font-size) + em;
261
+ margin-top: math.div(30px, $size-vi) + em;
302
262
  }
303
263
  }
304
264
 
@@ -310,17 +270,15 @@
310
270
 
311
271
  // Mobile only.
312
272
  @include respond-to-max($bp-xs-max) {
313
- // Use the same regular weight but reduce the sizes to h4 size
273
+ // Use the same regular weight but reduce the sizes to h4 size.
314
274
  font-size: math.div(18px, $base-font-size-px) + em;
315
275
  }
316
276
  }
317
277
 
278
+ // For when you want a heading that's bigger than a normal H1.
318
279
  @mixin u-superheading() {
319
- // For when you want a heading that's bigger than a normal H1
320
- $font-size: $size-xl;
321
-
322
- margin-bottom: math.div(20px, $font-size) + em;
323
- font-size: math.div($font-size, $base-font-size-px) + em;
280
+ margin-bottom: math.div(20px, $size-xl) + em;
281
+ font-size: math.div($size-xl, $base-font-size-px) + em;
324
282
  font-weight: normal;
325
283
  line-height: 1.25;
326
284
  }
@@ -20,7 +20,7 @@ const BASE_CLASS = 'o-expandable-group';
20
20
  function ExpandableGroup(element) {
21
21
  // Internal vars.
22
22
  const _dom = checkDom(element, BASE_CLASS);
23
- const _isAccordion = _dom.classList.contains(`${BASE_CLASS}__accordion`);
23
+ const _isAccordion = _dom.classList.contains(`${BASE_CLASS}--accordion`);
24
24
  let _expandables;
25
25
  let _lastExpanded;
26
26
 
@@ -169,7 +169,7 @@ describe('accordion Expandables', () => {
169
169
  beforeEach(() => {
170
170
  document.body.innerHTML = HTML_SNIPPET;
171
171
  expandableGroup = document.querySelector('.o-expandable-group');
172
- expandableGroup.classList.add('o-expandable-group__accordion');
172
+ expandableGroup.classList.add('o-expandable-group--accordion');
173
173
  expandableDom1 = document.querySelector('#test-subject-one');
174
174
  expandableDom2 = document.querySelector('#test-subject-two');
175
175
  contentDom1 = expandableDom1.querySelector('.o-expandable__content');
@@ -66,6 +66,7 @@ a.a-tag-filter {
66
66
  line-height: 1rem;
67
67
  }
68
68
 
69
+ // Tablet and above.
69
70
  @include respond-to-min($bp-sm-min) {
70
71
  .a-tag-topic__text {
71
72
  // Colors for :link, :visited, :hover, :focus, :active
@@ -84,9 +85,7 @@ a.a-tag-filter {
84
85
  .a-tag-topic:focus,
85
86
  .a-tag-topic:active {
86
87
  border-bottom: none;
87
-
88
- // Normally we offset the focus 2px, but we need 3px here for the underline.
89
- outline-offset: 3px;
88
+ outline-offset: 1px;
90
89
 
91
90
  .a-tag-topic__text {
92
91
  // Move the underline down 1px.
@@ -98,6 +97,14 @@ a.a-tag-filter {
98
97
  .a-tag-topic:hover .a-tag-topic__text {
99
98
  border-bottom: 1px solid var(--gold-80);
100
99
  }
100
+
101
+ .a-tag-topic:focus {
102
+ outline-color: var(--gray);
103
+
104
+ .a-tag-topic__text {
105
+ border-bottom-style: solid !important;
106
+ }
107
+ }
101
108
  }
102
109
 
103
110
  // Tag group sets the spacing between tags.
@@ -17,4 +17,5 @@
17
17
  .a-link--jump {
18
18
  @include u-jump-link;
19
19
  }
20
+
20
21
  @include u-jump-link-group;
@@ -28,6 +28,7 @@
28
28
 
29
29
  // Mobile only.
30
30
  @include respond-to-max($bp-xs-max) {
31
+ position: relative;
31
32
  display: flex;
32
33
  align-items: center;
33
34
  gap: math.div(5px, $base-font-size-px) + rem;
@@ -41,6 +42,24 @@
41
42
  // 100% width is needed when block or jump link are applied to a <button>.
42
43
  width: 100%;
43
44
 
45
+ // We create a faux focus rectangle in the ::after pseudoelement to better
46
+ // control the positioning of the focus rectangle, which would overwise
47
+ // overlap the top border of the jumplink when it appears in a group.
48
+ &:focus {
49
+ outline: none;
50
+
51
+ &::after {
52
+ position: absolute;
53
+ content: '';
54
+ display: block;
55
+ position: absolute;
56
+ width: 100%;
57
+ height: 100%;
58
+ outline: 1px dotted var(--gray);
59
+ outline-offset: 2px;
60
+ }
61
+ }
62
+
44
63
  // Only right-hand align arrow icons.
45
64
  .cf-icon-svg--right {
46
65
  margin-left: auto;
@@ -66,7 +85,8 @@
66
85
  border-top: none;
67
86
  }
68
87
 
69
- .#{$jump-link-class}:hover::before {
88
+ .#{$jump-link-class}:hover::before,
89
+ .#{$jump-link-class}:focus::before {
70
90
  position: absolute;
71
91
  top: -1px;
72
92
  content: '';
@@ -9,10 +9,8 @@
9
9
  &__heading {
10
10
  @include heading-5;
11
11
 
12
- $font-size: $size-v;
13
-
14
12
  display: inline-block;
15
- padding-top: math.div(4px, $font-size) + em;
13
+ padding-top: math.div(4px, $size-v) + em;
16
14
  border-top: 5px solid $slug-header-border-thick;
17
15
  margin-top: -3px;
18
16
  }
package/src/index.scss CHANGED
@@ -1,17 +1,20 @@
1
1
  @forward 'abstracts';
2
2
  @forward 'base';
3
+
3
4
  // Buttons.
4
5
  @forward 'components/cfpb-buttons/vars';
5
6
  @forward 'components/cfpb-buttons/button';
6
7
  @forward 'components/cfpb-buttons/button-group';
7
8
  @forward 'components/cfpb-buttons/button-link';
8
9
  @forward 'components/cfpb-buttons/button-with-icon';
10
+
9
11
  // Expandables.
10
12
  @forward 'components/cfpb-expandables/vars';
11
13
  @forward 'components/cfpb-expandables/expandable';
12
14
  @forward 'components/cfpb-expandables/expandable-group';
13
15
  @forward 'components/cfpb-expandables/summary';
14
16
  @forward 'components/cfpb-expandables/summary-minimal';
17
+
15
18
  // Forms.
16
19
  @forward 'components/cfpb-forms/form';
17
20
  @forward 'components/cfpb-forms/form-alert';
@@ -22,8 +25,10 @@
22
25
  @forward 'components/cfpb-forms/search-input';
23
26
  @forward 'components/cfpb-forms/select';
24
27
  @forward 'components/cfpb-forms/text-input';
28
+
25
29
  // Icons.
26
30
  @forward 'components/cfpb-icons/icon';
31
+
27
32
  // Layout.
28
33
  @forward 'components/cfpb-layout/card-group';
29
34
  @forward 'components/cfpb-layout/card';
@@ -33,16 +38,20 @@
33
38
  @forward 'components/cfpb-layout/layout';
34
39
  @forward 'components/cfpb-layout/text-introduction';
35
40
  @forward 'components/cfpb-layout/well';
41
+
36
42
  // Notifications.
37
43
  @forward 'components/cfpb-notifications/vars';
38
44
  @forward 'components/cfpb-notifications/banner';
39
45
  @forward 'components/cfpb-notifications/notification';
46
+
40
47
  // Pagination.
41
48
  @forward 'components/cfpb-pagination/vars';
42
49
  @forward 'components/cfpb-pagination/pagination';
50
+
43
51
  // Tables.
44
52
  @forward 'components/cfpb-tables/vars';
45
53
  @forward 'components/cfpb-tables/table';
54
+
46
55
  // Typography.
47
56
  @forward 'components/cfpb-typography/vars';
48
57
  @forward 'components/cfpb-typography/date';
@@ -52,5 +61,6 @@
52
61
  @forward 'components/cfpb-typography/pull-quote';
53
62
  @forward 'components/cfpb-typography/slug-header';
54
63
  @forward 'components/cfpb-typography/tagline';
64
+
55
65
  // Utilities.
56
66
  @forward 'utilities';