@cfpb/cfpb-design-system 3.1.7 → 3.1.8

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cfpb/cfpb-design-system",
3
- "version": "3.1.7",
3
+ "version": "3.1.8",
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": "415453147d44ab32977359f985c50a66799818c1",
22
+ "gitHead": "ce63bfcdecf687e9b96ab2420db225649b65db4b",
23
23
  "type": "module"
24
24
  }
@@ -265,6 +265,7 @@ function Multiselect(element) {
265
265
 
266
266
  const selectionsItemLabelDom = create('button', selectionsItemDom, {
267
267
  type: 'button',
268
+ class: 'a-tag-filter',
268
269
  innerHTML:
269
270
  '<label for=' + optionId + '>' + option.text + closeIcon + '</label>',
270
271
  });
@@ -464,7 +465,7 @@ function Multiselect(element) {
464
465
 
465
466
  // Create all our markup but wait to manipulate the DOM just once
466
467
  _selectionsDom = create('ul', null, {
467
- className: BASE_CLASS + '__choices',
468
+ className: 'm-tag-group',
468
469
  });
469
470
 
470
471
  _headerDom = create('header', _containerDom, {
@@ -148,80 +148,4 @@ select.o-multiselect {
148
148
  width: 100%;
149
149
  }
150
150
  }
151
-
152
- &__choices {
153
- padding-left: 0;
154
-
155
- // The following is required to make side-by-side LI
156
- // have a space between them.
157
- margin-right: math.div(-10px, $base-font-size-px) + em;
158
- margin-bottom: 0;
159
-
160
- li {
161
- display: inline-block;
162
-
163
- // The following is required to make side-by-side LI
164
- // have a space between them.
165
- margin-right: math.div(10px, $base-font-size-px) + em;
166
- }
167
-
168
- li:last-child {
169
- margin-bottom: math.div(10px, $base-font-size-px) + em;
170
- }
171
-
172
- button {
173
- border: none;
174
- background: none;
175
- padding: 0;
176
- text-align: left;
177
-
178
- &:focus {
179
- border-radius: math.div(3px, $size-v) + em;
180
- outline: 1px dotted var(--teal);
181
- outline-offset: 1px;
182
-
183
- label {
184
- background-color: var(--teal-20);
185
- }
186
- }
187
-
188
- &:hover label {
189
- background-color: var(--teal-40);
190
- }
191
-
192
- &:active label {
193
- background-color: var(--teal-60);
194
- }
195
- }
196
-
197
- label {
198
- display: inline-block;
199
- padding: 4px 10px;
200
- padding-right: 25px;
201
-
202
- background-color: var(--teal-20);
203
- border-radius: math.div(3px, $size-v) + em;
204
- border: 1px solid var(--teal);
205
- color: var(--black);
206
- cursor: pointer;
207
- font-size: math.div(16px, $base-font-size-px) + em;
208
- position: relative;
209
-
210
- &:hover {
211
- background-color: var(--teal-40);
212
-
213
- &::after {
214
- color: var(--white);
215
- }
216
- }
217
-
218
- .cf-icon-svg {
219
- position: absolute;
220
- top: 4px;
221
- right: 5px;
222
- margin-left: 10px;
223
- fill: var(--black);
224
- }
225
- }
226
- }
227
151
  }
@@ -37,7 +37,9 @@ describe('Multiselect', () => {
37
37
  const option = document.querySelector('option');
38
38
  option.defaultSelected = true;
39
39
  multiselect.init();
40
- const choices = document.querySelectorAll('.o-multiselect__choices li');
40
+ const choices = document.querySelectorAll(
41
+ '.o-multiselect .m-tag-group li',
42
+ );
41
43
 
42
44
  expect(choices.length).toBe(1);
43
45
  expect(choices[0].innerHTML).toContain('Debt collection');
@@ -52,7 +54,9 @@ describe('Multiselect', () => {
52
54
  expect(multiselect.getModel().isAtMaxSelections()).toBe(true);
53
55
 
54
56
  // renderTags
55
- const choices = document.querySelectorAll('.o-multiselect__choices li');
57
+ const choices = document.querySelectorAll(
58
+ '.o-multiselect .m-tag-group li',
59
+ );
56
60
  expect(choices.length).toBe(0);
57
61
  });
58
62
  });
@@ -36,6 +36,12 @@
36
36
  .cf-icon-svg {
37
37
  pointer-events: none;
38
38
  }
39
+
40
+ // If the contents are wrapped in a label, negate the label's display.
41
+ > label {
42
+ display: contents;
43
+ pointer-events: none;
44
+ }
39
45
  }
40
46
 
41
47
  a.a-tag-filter {
@@ -54,6 +60,7 @@ a.a-tag-filter {
54
60
  display: flex;
55
61
  gap: math.div(5px, $btn-font-size) + rem;
56
62
  }
63
+
57
64
  @include u-jump-link(
58
65
  $jump-link-class: 'a-tag-topic',
59
66
  $jump-link-text-class: 'a-tag-topic__text',
@@ -140,6 +147,7 @@ a.a-tag-filter {
140
147
  html[lang='ar'] {
141
148
  .m-tag-group {
142
149
  direction: rtl;
150
+
143
151
  // This is needed for right-to-left (RTL) lists.
144
152
  padding-right: 0;
145
153
  }
@@ -82,7 +82,6 @@
82
82
  outline: none;
83
83
 
84
84
  &::after {
85
- position: absolute;
86
85
  content: '';
87
86
  display: block;
88
87
  position: absolute;