@cfpb/cfpb-design-system 5.2.0 → 5.3.1

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 (67) hide show
  1. package/CHANGELOG.md +83 -1
  2. package/dist/index.css +1 -1
  3. package/dist/index.js +1771 -1715
  4. package/package.json +1 -1
  5. package/src/elements/abstracts/custom-props.css +2 -1
  6. package/src/elements/abstracts/vars.css +1 -6
  7. package/src/elements/base/base.scss +3 -0
  8. package/src/elements/base/font.scss +1 -1
  9. package/src/elements/cfpb-button/cfpb-button.scss +1 -1
  10. package/src/elements/cfpb-button/index.js +3 -4
  11. package/src/elements/cfpb-checkbox-icon/index.js +3 -3
  12. package/src/elements/cfpb-expandable/index.js +10 -12
  13. package/src/elements/cfpb-expandable/{cfpb-expandable.component.scss → styles.component.scss} +1 -1
  14. package/src/elements/cfpb-file-upload/index.js +3 -6
  15. package/src/elements/cfpb-file-upload/styles.component.css +7 -0
  16. package/src/elements/cfpb-flag-usa/index.js +3 -3
  17. package/src/elements/cfpb-flag-usa/{cfpb-flag-usa.component.scss → styles.component.css} +2 -2
  18. package/src/elements/cfpb-form-alert/index.js +24 -15
  19. package/src/elements/cfpb-form-alert/styles.component.scss +14 -0
  20. package/src/elements/cfpb-form-choice/index.js +3 -4
  21. package/src/elements/cfpb-form-choice/{cfpb-form-choice.component.scss → styles.component.scss} +5 -6
  22. package/src/elements/cfpb-form-search/index.js +8 -8
  23. package/src/elements/cfpb-form-search/skeleton.css +8 -0
  24. package/src/elements/cfpb-form-search/{cfpb-form-search.component.scss → styles.component.scss} +3 -3
  25. package/src/elements/cfpb-form-search-input/index.js +7 -14
  26. package/src/elements/cfpb-form-search-input/{cfpb-form-search-input.component.scss → styles.component.scss} +6 -8
  27. package/src/elements/cfpb-icon/index.js +45 -0
  28. package/src/elements/cfpb-icon/styles.component.css +48 -0
  29. package/src/elements/cfpb-icon-text/index.js +3 -3
  30. package/src/elements/cfpb-icon-text/{cfpb-icon-text.component.scss → styles.component.scss} +2 -3
  31. package/src/elements/cfpb-label/index.js +3 -3
  32. package/src/elements/cfpb-label/{cfpb-label.component.scss → styles.component.scss} +5 -5
  33. package/src/elements/{cfpb-list → cfpb-listbox}/index.js +13 -10
  34. package/src/elements/{cfpb-list → cfpb-listbox}/index.spec.js +9 -9
  35. package/src/elements/{cfpb-list/cfpb-list.component.scss → cfpb-listbox/styles.component.scss} +1 -5
  36. package/src/elements/{cfpb-list-item → cfpb-listbox-item}/index.js +5 -7
  37. package/src/elements/{cfpb-list-item/cfpb-list-item.component.scss → cfpb-listbox-item/styles.component.scss} +2 -2
  38. package/src/elements/cfpb-pagination/index.js +10 -10
  39. package/src/elements/cfpb-pagination/{cfpb-pagination.component.scss → styles.component.scss} +6 -6
  40. package/src/elements/cfpb-select/index.js +11 -15
  41. package/src/elements/cfpb-select/multiple-select-event-proxy.js +2 -2
  42. package/src/elements/cfpb-select/single-select-event-proxy.js +1 -1
  43. package/src/elements/cfpb-select/{cfpb-select.component.scss → styles.component.scss} +5 -6
  44. package/src/elements/cfpb-tag-filter/index.js +3 -4
  45. package/src/elements/cfpb-tag-filter/{cfpb-tag-filter.component.scss → styles.component.scss} +6 -8
  46. package/src/elements/cfpb-tag-group/index.js +3 -3
  47. package/src/elements/cfpb-tag-group/{cfpb-tag-group.component.scss → styles.component.scss} +3 -4
  48. package/src/elements/cfpb-tag-topic/index.js +3 -4
  49. package/src/elements/cfpb-tag-topic/{cfpb-tag-topic.component.scss → styles.component.scss} +2 -2
  50. package/src/elements/cfpb-tagline/index.js +4 -5
  51. package/src/elements/cfpb-tagline/skeleton.css +7 -0
  52. package/src/elements/cfpb-tagline/{cfpb-tagline.component.scss → styles.component.scss} +3 -4
  53. package/src/elements/cfpb-utilities/fallback/wc-fallback.css +31 -0
  54. package/src/elements/cfpb-utilities/fallback/wc-fallback.js +65 -0
  55. package/src/elements/cfpb-utilities/shared-config.js +52 -0
  56. package/src/elements/cfpb-utilities/skeleton.css +33 -0
  57. package/src/elements/cfpb-utilities/transition/{transition.scss → transition.css} +11 -11
  58. package/src/elements/index.js +11 -2
  59. package/src/index.js +1 -5
  60. package/src/index.scss +1 -1
  61. package/src/tokens/abstracts/custom-props.json +13 -1
  62. package/src/utilities/functions.scss +20 -0
  63. package/src/elements/base/index.js +0 -2
  64. package/src/elements/cfpb-file-upload/cfpb-file-upload.component.scss +0 -10
  65. package/src/elements/cfpb-form-alert/cfpb-form-alert.component.scss +0 -36
  66. /package/src/elements/cfpb-button/{cfpb-button.component.scss → styles.component.scss} +0 -0
  67. /package/src/elements/cfpb-checkbox-icon/{cfpb-checkbox-icon.component.scss → styles.component.scss} +0 -0
@@ -1,5 +1,4 @@
1
- @use 'sass:math';
2
- @use '@cfpb/cfpb-design-system/src/elements/abstracts' as *;
1
+ @use '../../utilities/functions' as *;
3
2
 
4
3
  @mixin u-btn-divider() {
5
4
  content: '';
@@ -21,7 +20,7 @@
21
20
  width: fit-content;
22
21
  align-items: center;
23
22
 
24
- gap: math.div(10px, $btn-font-size) + rem;
23
+ gap: rem-from-px(10px);
25
24
  }
26
25
 
27
26
  .left-divider::before,
@@ -1,5 +1,6 @@
1
1
  import { LitElement, html, css, unsafeCSS } from 'lit';
2
- import styles from './cfpb-label.component.scss?inline';
2
+ import { defineComponent } from '../cfpb-utilities/shared-config';
3
+ import styles from './styles.component.scss?inline';
3
4
  import { ifDefined } from 'lit/directives/if-defined.js';
4
5
 
5
6
  /**
@@ -53,7 +54,6 @@ export class CfpbLabel extends LitElement {
53
54
  }
54
55
 
55
56
  static init() {
56
- window.customElements.get('cfpb-label') ||
57
- window.customElements.define('cfpb-label', CfpbLabel);
57
+ defineComponent('cfpb-label', CfpbLabel);
58
58
  }
59
59
  }
@@ -1,5 +1,5 @@
1
- @use 'sass:math';
2
1
  @use '@cfpb/cfpb-design-system/src/elements/abstracts' as *;
2
+ @use '../../utilities/functions' as *;
3
3
 
4
4
  :host {
5
5
  .a-label {
@@ -9,27 +9,27 @@
9
9
 
10
10
  &__helper {
11
11
  color: var(--label-helper);
12
- font-size: math.div(16px, $base-font-size-px) + rem;
12
+ font-size: rem-from-px(16px);
13
13
  font-weight: normal;
14
14
 
15
15
  &--block {
16
16
  display: block;
17
17
 
18
18
  // Add a gap between the label helper and label.
19
- margin-top: math.div(10px, $size-vi) + em;
19
+ margin-top: rem-from-px(10px);
20
20
  }
21
21
  }
22
22
 
23
23
  &--heading {
24
24
  display: block;
25
25
 
26
- margin-bottom: math.div(10px, $size-iv) + em;
26
+ margin-bottom: rem-from-px(10px);
27
27
 
28
28
  @include heading-4($has-margin-bottom: false);
29
29
 
30
30
  // Add a gap between the label helper and label heading
31
31
  .a-label__helper--block {
32
- margin-top: math.div(10px, $base-font-size-px) + rem;
32
+ margin-top: rem-from-px(10px);
33
33
  }
34
34
  }
35
35
  }
@@ -1,10 +1,15 @@
1
1
  import { LitElement, html, css, unsafeCSS } from 'lit';
2
+ import { defineComponent } from '../cfpb-utilities/shared-config';
2
3
  import { ref, createRef } from 'lit/directives/ref.js';
3
- import styles from './cfpb-list.component.scss?inline';
4
- import { CfpbListItem } from '../cfpb-list-item';
4
+ import styles from './styles.component.scss?inline';
5
+ import { CfpbListboxItem } from '../cfpb-listbox-item';
5
6
  import { parseChildData } from '../cfpb-utilities/parse-child-data';
6
7
 
7
- export class CfpbList extends LitElement {
8
+ /**
9
+ * @element cfpb-listbox.
10
+ * @slot - Slot for the list of items in the list box.
11
+ */
12
+ export class CfpbListbox extends LitElement {
8
13
  static styles = css`
9
14
  ${unsafeCSS(styles)}
10
15
  `;
@@ -84,7 +89,7 @@ export class CfpbList extends LitElement {
84
89
 
85
90
  let firstChecked = null;
86
91
  itemsArray.forEach((data) => {
87
- const item = document.createElement('cfpb-list-item');
92
+ const item = document.createElement('cfpb-listbox-item');
88
93
  item.textContent = data.value ?? '';
89
94
  if ('disabled' in data) item.disabled = data.disabled;
90
95
  if ('hidden' in data) item.hidden = data.hidden;
@@ -109,7 +114,7 @@ export class CfpbList extends LitElement {
109
114
  // -------------------------
110
115
  #syncItems() {
111
116
  // Collect items.
112
- this.#items = [...this.querySelectorAll('cfpb-list-item')];
117
+ this.#items = [...this.querySelectorAll('cfpb-listbox-item')];
113
118
 
114
119
  // Ensure each item has a type.
115
120
  this.#items.forEach((item) => {
@@ -187,7 +192,7 @@ export class CfpbList extends LitElement {
187
192
  #applyTypeToItems() {
188
193
  if (!['plain', 'check', 'checkbox'].includes(this.type)) {
189
194
  // eslint-disable-next-line no-console
190
- console.warn(`<cfpb-list>: invalid type "${this.type}".`);
195
+ console.warn(`<cfpb-listbox>: invalid type "${this.type}".`);
191
196
  return;
192
197
  }
193
198
  this.#items.forEach((item) => (item.type = this.type));
@@ -372,9 +377,7 @@ export class CfpbList extends LitElement {
372
377
  }
373
378
 
374
379
  static init() {
375
- CfpbListItem.init();
376
- if (!window.customElements.get('cfpb-list')) {
377
- window.customElements.define('cfpb-list', CfpbList);
378
- }
380
+ CfpbListboxItem.init();
381
+ defineComponent('cfpb-listbox', CfpbListbox);
379
382
  }
380
383
  }
@@ -1,15 +1,15 @@
1
1
  import { jest } from '@jest/globals';
2
- import { CfpbList } from './index';
2
+ import { CfpbListbox } from './index';
3
3
 
4
4
  beforeAll(() => {
5
- CfpbList.init();
5
+ CfpbListbox.init();
6
6
  });
7
7
 
8
- describe('<cfpb-list> tests', () => {
8
+ describe('<cfpb-listbox> tests', () => {
9
9
  let list;
10
10
 
11
11
  beforeEach(() => {
12
- list = document.createElement('cfpb-list');
12
+ list = document.createElement('cfpb-listbox');
13
13
  document.body.appendChild(list);
14
14
  });
15
15
 
@@ -123,7 +123,7 @@ describe('<cfpb-list> tests', () => {
123
123
 
124
124
  const container = list.shadowRoot.querySelector('div');
125
125
  container.focus();
126
- expect(document.activeElement.tagName).toBe('CFPB-LIST');
126
+ expect(document.activeElement.tagName).toBe('CFPB-LISTBOX');
127
127
 
128
128
  // ArrowDown → first visible
129
129
  container.dispatchEvent(
@@ -141,7 +141,7 @@ describe('<cfpb-list> tests', () => {
141
141
  container.dispatchEvent(
142
142
  new KeyboardEvent('keydown', { key: 'ArrowUp', bubbles: true }),
143
143
  );
144
- expect(document.activeElement.tagName).toBe('CFPB-LIST');
144
+ expect(document.activeElement.tagName).toBe('CFPB-LISTBOX');
145
145
  });
146
146
 
147
147
  test('showAllItems unhides all items', async () => {
@@ -173,21 +173,21 @@ describe('<cfpb-list> tests', () => {
173
173
  list.childData = JSON.stringify([{ value: 'A' }, { value: 'B' }]);
174
174
  await list.updateComplete;
175
175
  list.focusItemAt(-1);
176
- expect(document.activeElement.tagName).toBe('CFPB-LIST');
176
+ expect(document.activeElement.tagName).toBe('CFPB-LISTBOX');
177
177
  });
178
178
 
179
179
  test('focusItemAt(null) focuses the container', async () => {
180
180
  list.childData = JSON.stringify([{ value: 'A' }]);
181
181
  await list.updateComplete;
182
182
  list.focusItemAt(null);
183
- expect(document.activeElement.tagName).toBe('CFPB-LIST');
183
+ expect(document.activeElement.tagName).toBe('CFPB-LISTBOX');
184
184
  });
185
185
 
186
186
  test('focusItemAt(undefined) focuses the container', async () => {
187
187
  list.childData = JSON.stringify([{ value: 'A' }]);
188
188
  await list.updateComplete;
189
189
  list.focusItemAt(undefined);
190
- expect(document.activeElement.tagName).toBe('CFPB-LIST');
190
+ expect(document.activeElement.tagName).toBe('CFPB-LISTBOX');
191
191
  });
192
192
 
193
193
  test('ArrowDown from container focuses first visible item', async () => {
@@ -1,9 +1,5 @@
1
- @use 'sass:math';
2
- @use '@cfpb/cfpb-design-system/src/elements/abstracts' as *;
3
- @use '@cfpb/cfpb-design-system/src/components/cfpb-icons/icon';
4
-
5
1
  :host {
6
- ::slotted(cfpb-list-item) {
2
+ ::slotted(cfpb-listbox-item) {
7
3
  position: relative;
8
4
  margin-top: 1px;
9
5
 
@@ -1,13 +1,14 @@
1
1
  import { LitElement, html, css, unsafeCSS } from 'lit';
2
- import styles from './cfpb-list-item.component.scss?inline';
2
+ import { defineComponent } from '../cfpb-utilities/shared-config';
3
+ import styles from './styles.component.scss?inline';
3
4
  import { ref, createRef } from 'lit/directives/ref.js';
4
5
  import { CfpbCheckboxIcon } from '../cfpb-checkbox-icon';
5
6
 
6
7
  /**
7
- * @element cfpb-list-item.
8
+ * @element cfpb-listbox-item.
8
9
  * @slot - The text for the list item.
9
10
  */
10
- export class CfpbListItem extends LitElement {
11
+ export class CfpbListboxItem extends LitElement {
11
12
  static styles = css`
12
13
  ${unsafeCSS(styles)}
13
14
  `;
@@ -207,9 +208,6 @@ export class CfpbListItem extends LitElement {
207
208
 
208
209
  static init() {
209
210
  CfpbCheckboxIcon.init();
210
-
211
- if (!window.customElements.get('cfpb-list-item')) {
212
- window.customElements.define('cfpb-list-item', CfpbListItem);
213
- }
211
+ defineComponent('cfpb-listbox-item', CfpbListboxItem);
214
212
  }
215
213
  }
@@ -1,6 +1,6 @@
1
- @use 'sass:math';
2
1
  @use '@cfpb/cfpb-design-system/src/elements/abstracts' as *;
3
2
  @use '@cfpb/cfpb-design-system/src/components/cfpb-icons/icons-lib' as *;
3
+ @use '../../utilities/functions' as *;
4
4
 
5
5
  :host {
6
6
  // Theme variables.
@@ -18,7 +18,7 @@
18
18
  display: inline-grid;
19
19
 
20
20
  // 30px is width of checkbox/radio button plus the needed padding.
21
- grid-template-columns: math.div(30px, $base-font-size-px) + em auto;
21
+ grid-template-columns: rem-from-px(30px) auto;
22
22
  vertical-align: top;
23
23
 
24
24
  // Wrap long words in narrow form fields to prevent clipping
@@ -1,13 +1,13 @@
1
1
  import { LitElement, html, css, unsafeCSS } from 'lit';
2
- import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
3
- import styles from './cfpb-pagination.component.scss?inline';
4
- import { leftIcon, rightIcon } from '../../components/cfpb-icons/icons-lib.js';
2
+ import { defineComponent } from '../cfpb-utilities/shared-config';
3
+ import styles from './styles.component.scss?inline';
4
+ import { CfpbIcon } from '../cfpb-icon';
5
5
  import { I18nService, MediaQueryService } from '../cfpb-utilities/';
6
6
 
7
7
  /**
8
8
  *
9
- * @element cfpb-button
10
- * @slot - The main content for the button.
9
+ * @element cfpb-pagination
10
+ * @slot - Slot for passing in i18n (internationalization) service strings via a <template>.
11
11
  */
12
12
  export class CfpbPagination extends LitElement {
13
13
  #mediaService;
@@ -153,7 +153,7 @@ export class CfpbPagination extends LitElement {
153
153
  ?disabled=${this.isAtMin}
154
154
  @click=${() => this.#goto(this.currentPage - 1)}
155
155
  >
156
- ${unsafeSVG(leftIcon)} ${trans('next')}
156
+ <cfpb-icon name="left" color="white"></cfpb-icon> ${trans('next')}
157
157
  </cfpb-button>
158
158
 
159
159
  <form
@@ -193,16 +193,16 @@ export class CfpbPagination extends LitElement {
193
193
  ?disabled=${this.isAtMax}
194
194
  @click=${() => this.#goto(this.currentPage + 1)}
195
195
  >
196
- ${trans('previous')} ${unsafeSVG(rightIcon)}
196
+ ${trans('previous')}
197
+ <cfpb-icon name="right" color="white"></cfpb-icon>
197
198
  </cfpb-button>
198
199
  </nav>
199
200
  `;
200
201
  }
201
202
 
202
203
  static init() {
204
+ CfpbIcon.init();
203
205
  I18nService.init();
204
-
205
- window.customElements.get('cfpb-pagination') ||
206
- window.customElements.define('cfpb-pagination', CfpbPagination);
206
+ defineComponent('cfpb-pagination', CfpbPagination);
207
207
  }
208
208
  }
@@ -1,7 +1,7 @@
1
- @use 'sass:math';
2
1
  @use '@cfpb/cfpb-design-system/src/elements/abstracts' as *;
3
2
  @use '@cfpb/cfpb-design-system/src/utilities' as *;
4
3
  @use '@cfpb/cfpb-design-system/src/components/cfpb-icons/icon' as *;
4
+ @use '../../utilities/functions' as *;
5
5
 
6
6
  :host {
7
7
  width: 100%;
@@ -12,17 +12,17 @@
12
12
  grid-template-areas:
13
13
  'pag-btn-prev . pag-btn-next'
14
14
  'pag-form pag-form pag-form';
15
- row-gap: math.div(15px, $base-font-size-px) + rem;
15
+ row-gap: rem-from-px(15px);
16
16
 
17
17
  &__form {
18
18
  grid-area: pag-form;
19
19
  display: flex;
20
20
  flex-flow: wrap;
21
21
  place-content: center;
22
- gap: math.div(10px, $base-font-size-px) + rem;
22
+ gap: rem-from-px(10px);
23
23
 
24
- padding: math.div(5px, $base-font-size-px) + rem;
25
- border-radius: math.div(4px, $base-font-size-px) + rem;
24
+ padding: rem-from-px(5px);
25
+ border-radius: rem-from-px(4px);
26
26
  background: var(--gray-5);
27
27
  color: var(--gray);
28
28
  }
@@ -30,7 +30,7 @@
30
30
  &__current-page {
31
31
  // 45px is a magic number to provide enough room for three digits
32
32
  // and the number spinners for type="number" inputs on desktop
33
- width: math.div(45px, $base-font-size-px) + rem;
33
+ width: rem-from-px(45px);
34
34
 
35
35
  font-weight: 500;
36
36
  text-align: right;
@@ -1,16 +1,13 @@
1
1
  import { html, LitElement, css, unsafeCSS, nothing } from 'lit';
2
+ import { defineComponent } from '../cfpb-utilities/shared-config';
3
+ import styles from './styles.component.scss?inline';
2
4
  import { ref, createRef } from 'lit/directives/ref.js';
3
- import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
4
- import styles from './cfpb-select.component.scss?inline';
5
- import {
6
- downIcon as expandIcon,
7
- upIcon as collapseIcon,
8
- } from '../../components/cfpb-icons/icons-lib.js';
5
+ import { CfpbIcon } from '../cfpb-icon';
9
6
  import { CfpbFormSearchInput } from '../cfpb-form-search-input';
10
7
  import { SearchService } from '../cfpb-utilities/search-service.js';
11
8
  import { MaxHeightTransition } from '../../utilities/transition/max-height-transition';
12
9
  import { FlyoutMenu } from '../../utilities/behavior/flyout-menu';
13
- import { CfpbList } from '../cfpb-list';
10
+ import { CfpbListbox } from '../cfpb-listbox';
14
11
  import { CfpbTagGroup } from '../cfpb-tag-group';
15
12
 
16
13
  import { SingleSelectEventProxy } from './single-select-event-proxy.js';
@@ -314,11 +311,11 @@ export class CfpbSelect extends LitElement {
314
311
  @click=${this.#onClick}
315
312
  >
316
313
  <span class="o-select__cue-open" role="img" aria-label="Show">
317
- ${unsafeSVG(expandIcon)}
314
+ <cfpb-icon name="down"></cfpb-icon>
318
315
  <span class="u-visually-hidden">Show</span>
319
316
  </span>
320
317
  <span class="o-select__cue-close" role="img" aria-label="Hide">
321
- ${unsafeSVG(collapseIcon)}
318
+ <cfpb-icon name="up"></cfpb-icon>
322
319
  <span class="u-visually-hidden">Hide</span>
323
320
  </span>
324
321
  </button>
@@ -327,7 +324,7 @@ export class CfpbSelect extends LitElement {
327
324
  data-js-hook="behavior_flyout-menu_content"
328
325
  ${ref(this.#contentDom)}
329
326
  >
330
- <cfpb-list
327
+ <cfpb-listbox
331
328
  tabindex=${this.#noResults ? '-1' : '0'}
332
329
  @item-click=${this.#onItemClick}
333
330
  ?multiple=${this.multiple}
@@ -338,7 +335,7 @@ export class CfpbSelect extends LitElement {
338
335
  : 'Choose an item…'}
339
336
  ${ref(this.#list)}
340
337
  >
341
- </cfpb-list>
338
+ </cfpb-listbox>
342
339
  <div class=${this.#noResults ? 'no-results' : 'u-hidden'}>
343
340
  No results found
344
341
  </div>
@@ -373,11 +370,10 @@ export class CfpbSelect extends LitElement {
373
370
  }
374
371
 
375
372
  static init() {
373
+ CfpbIcon.init();
376
374
  CfpbFormSearchInput.init();
377
- CfpbList.init();
375
+ CfpbListbox.init();
378
376
  CfpbTagGroup.init();
379
-
380
- window.customElements.get('cfpb-select') ||
381
- window.customElements.define('cfpb-select', CfpbSelect);
377
+ defineComponent('cfpb-select', CfpbSelect);
382
378
  }
383
379
  }
@@ -11,7 +11,7 @@ export class MultipleSelectEventProxy {
11
11
  }
12
12
 
13
13
  onBlur() {
14
- // In multiselect, blur happens when inside the list, so we ignore any
14
+ // In multiselect, blur happens when inside the listbox, so we ignore any
15
15
  // blur actions.
16
16
  }
17
17
 
@@ -72,7 +72,7 @@ export class MultipleSelectEventProxy {
72
72
  host.isExpanded = !host.isExpanded;
73
73
  break;
74
74
  }
75
- } else if (focused === 'CFPB-LIST-ITEM') {
75
+ } else if (focused === 'CFPB-LISTBOX-ITEM') {
76
76
  switch (evt.key) {
77
77
  case 'Tab':
78
78
  if (evt.shiftKey) {
@@ -42,7 +42,7 @@ export class SingleSelectEventProxy {
42
42
  case 'ArrowDown':
43
43
  evt.preventDefault();
44
44
  host.isExpanded = true;
45
- this.list.querySelector('cfpb-list-item')?.focus();
45
+ this.list.querySelector('cfpb-listbox-item')?.focus();
46
46
  break;
47
47
  }
48
48
  }
@@ -1,9 +1,8 @@
1
- @use 'sass:math';
2
- @use '@cfpb/cfpb-design-system/src/elements/abstracts' as *;
3
1
  @use '@cfpb/cfpb-design-system/src/elements/base' as *;
4
2
  @use '@cfpb/cfpb-design-system/src/utilities' as *;
5
3
  @use '@cfpb/cfpb-design-system/src/components/cfpb-icons/icon';
6
- @use '../cfpb-utilities/transition/transition.scss' as *;
4
+ @use '../cfpb-utilities/transition/transition.css' as *;
5
+ @use '../../utilities/functions' as *;
7
6
 
8
7
  :host {
9
8
  // Theme
@@ -51,7 +50,7 @@
51
50
  button {
52
51
  // This line-height settings is larger than base.scss to
53
52
  // accommodate the SVG height.
54
- line-height: math.div(21px, $base-font-size-px);
53
+ line-height: unitless-from-px(21px);
55
54
 
56
55
  // Remove default focus ring.
57
56
  outline: none;
@@ -133,7 +132,7 @@
133
132
  justify-content: space-between;
134
133
  align-items: center;
135
134
  gap: 10px;
136
- padding-left: math.div(10px, $base-font-size-px) + em;
135
+ padding-left: rem-from-px(10px);
137
136
 
138
137
  cursor: pointer;
139
138
  }
@@ -151,7 +150,7 @@
151
150
  padding: 0;
152
151
 
153
152
  &::after {
154
- padding-bottom: math.div(15px, $base-font-size-px) + em;
153
+ padding-bottom: rem-from-px(15px);
155
154
  width: 100%;
156
155
  }
157
156
  }
@@ -1,6 +1,7 @@
1
1
  import { LitElement, html, css, unsafeCSS } from 'lit';
2
+ import { defineComponent } from '../cfpb-utilities/shared-config';
2
3
  import { unsafeHTML } from 'lit/directives/unsafe-html.js';
3
- import styles from './cfpb-tag-filter.component.scss?inline';
4
+ import styles from './styles.component.scss?inline';
4
5
  import { errorIcon as icon } from '../../components/cfpb-icons/icons-lib';
5
6
 
6
7
  /**
@@ -64,8 +65,6 @@ export class CfpbTagFilter extends LitElement {
64
65
  }
65
66
 
66
67
  static init() {
67
- // Initialize parent file upload.
68
- window.customElements.get('cfpb-tag-filter') ||
69
- window.customElements.define('cfpb-tag-filter', CfpbTagFilter);
68
+ defineComponent('cfpb-tag-filter', CfpbTagFilter);
70
69
  }
71
70
  }
@@ -1,23 +1,21 @@
1
- @use 'sass:math';
2
- @use '@cfpb/cfpb-design-system/src/elements/abstracts' as *;
3
- @use '@cfpb/cfpb-design-system/src/elements/cfpb-button/vars' as *;
1
+ @use '../../utilities/functions' as *;
4
2
 
5
3
  :host {
6
4
  button {
7
5
  // This line-height isn't 19 or 22, as 20 creates a 30px high tag.
8
- line-height: math.div(20px, $base-font-size-px);
6
+ line-height: unitless-from-px(20px);
9
7
 
10
8
  // Filter tags appear in filtered contexts, often as part of multiselects.
11
- font-size: math.div(16px, $btn-font-size) + rem;
9
+ font-size: rem-from-px(16px);
12
10
 
13
11
  display: flex;
14
- gap: math.div(10px, $btn-font-size) + rem;
12
+ gap: rem-from-px(10px);
15
13
  align-items: center;
16
14
 
17
15
  border: 1px solid var(--teal);
18
16
  padding: 4px 6px;
19
17
  background-color: var(--teal-20);
20
- border-radius: math.div(3px, $base-font-size-px) + rem;
18
+ border-radius: rem-from-px(3px);
21
19
  color: var(--black);
22
20
  text-align: left;
23
21
  min-width: fit-content;
@@ -43,7 +41,7 @@
43
41
  // Prevent flexbox from squishing icon when tag text is long.
44
42
  flex: none;
45
43
 
46
- height: math.div(19px, $btn-font-size) + rem;
44
+ height: rem-from-px(19px);
47
45
  }
48
46
 
49
47
  // If the contents are wrapped in a label, negate the label's display.
@@ -1,5 +1,6 @@
1
1
  import { LitElement, html, css, unsafeCSS } from 'lit';
2
- import styles from './cfpb-tag-group.component.scss?inline';
2
+ import { defineComponent } from '../cfpb-utilities/shared-config';
3
+ import styles from './styles.component.scss?inline';
3
4
  import { parseChildData } from '../cfpb-utilities/parse-child-data';
4
5
 
5
6
  const SUPPORTED_TAG_LIST = ['CFPB-TAG-FILTER', 'CFPB-TAG-TOPIC'];
@@ -364,7 +365,6 @@ export class CfpbTagGroup extends LitElement {
364
365
  }
365
366
 
366
367
  static init() {
367
- window.customElements.get('cfpb-tag-group') ||
368
- window.customElements.define('cfpb-tag-group', CfpbTagGroup);
368
+ defineComponent('cfpb-tag-group', CfpbTagGroup);
369
369
  }
370
370
  }
@@ -1,6 +1,5 @@
1
- @use 'sass:math';
2
1
  @use '@cfpb/cfpb-design-system/src/elements/abstracts' as *;
3
- @use '@cfpb/cfpb-design-system/src/elements/cfpb-button/vars' as *;
2
+ @use '../../utilities/functions' as *;
4
3
 
5
4
  :host {
6
5
  // Tag group sets the spacing between tags.
@@ -17,7 +16,7 @@
17
16
  // Tablet and above.
18
17
  @include respond-to-min($bp-sm-min) {
19
18
  display: flex;
20
- gap: math.div(15px, $btn-font-size) + rem;
19
+ gap: rem-from-px(15px);
21
20
  flex-wrap: wrap;
22
21
 
23
22
  &[stacked] {
@@ -28,7 +27,7 @@
28
27
 
29
28
  &:has(cfpb-tag-filter) {
30
29
  display: flex;
31
- gap: math.div(15px, $btn-font-size) + rem;
30
+ gap: rem-from-px(15px);
32
31
  flex-wrap: wrap;
33
32
  }
34
33
  }
@@ -1,5 +1,6 @@
1
1
  import { LitElement, html, css, unsafeCSS } from 'lit';
2
- import styles from './cfpb-tag-topic.component.scss?inline';
2
+ import { defineComponent } from '../cfpb-utilities/shared-config';
3
+ import styles from './styles.component.scss?inline';
3
4
 
4
5
  /**
5
6
  *
@@ -67,8 +68,6 @@ export class CfpbTagTopic extends LitElement {
67
68
  }
68
69
 
69
70
  static init() {
70
- // Initialize parent file upload.
71
- window.customElements.get('cfpb-tag-topic') ||
72
- window.customElements.define('cfpb-tag-topic', CfpbTagTopic);
71
+ defineComponent('cfpb-tag-topic', CfpbTagTopic);
73
72
  }
74
73
  }
@@ -1,15 +1,15 @@
1
- @use 'sass:math';
2
1
  @use '@cfpb/cfpb-design-system/src/elements/base' as *;
3
2
  @use '@cfpb/cfpb-design-system/src/elements/abstracts' as *;
4
3
  @use '@cfpb/cfpb-design-system/src/utilities' as *;
5
4
  @use '@cfpb/cfpb-design-system/src/components/cfpb-typography/mixins' as *;
5
+ @use '../../utilities/functions' as *;
6
6
 
7
7
  :host {
8
8
  // Topic tags
9
9
  .a-tag-topic {
10
10
  text-decoration: none;
11
11
  display: flex;
12
- gap: math.div(5px, $btn-font-size) + rem;
12
+ gap: rem-from-px(5px);
13
13
  }
14
14
 
15
15
  @include u-jump-link(
@@ -1,9 +1,10 @@
1
1
  import { LitElement, html, css, unsafeCSS } from 'lit';
2
+ import { defineComponent } from '../cfpb-utilities/shared-config';
2
3
  import { CfpbFlagUsa } from '../cfpb-flag-usa';
3
- import styles from './cfpb-tagline.component.scss?inline';
4
+ import styles from './styles.component.scss?inline';
4
5
 
5
6
  /**
6
- * @element cfpb-icon-text
7
+ * @element cfpb-tagline
7
8
  * @slot - The main content for the tagline.
8
9
  */
9
10
  export class CfpbTagline extends LitElement {
@@ -46,8 +47,6 @@ export class CfpbTagline extends LitElement {
46
47
 
47
48
  static init() {
48
49
  CfpbFlagUsa.init();
49
-
50
- globalThis.customElements.get('cfpb-tagline') ??
51
- globalThis.customElements.define('cfpb-tagline', CfpbTagline);
50
+ defineComponent('cfpb-tagline', CfpbTagline);
52
51
  }
53
52
  }
@@ -0,0 +1,7 @@
1
+ cfpb-tagline:not(:defined) {
2
+ min-height: 16.5px;
3
+ }
4
+
5
+ cfpb-tagline[islarge]:not(:defined) {
6
+ min-height: 22px;
7
+ }