@cfpb/cfpb-design-system 4.3.0 → 4.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 (167) hide show
  1. package/CHANGELOG.md +21 -1
  2. package/dist/components/cfpb-buttons/index.css +1 -1
  3. package/dist/components/cfpb-buttons/index.css.map +2 -2
  4. package/dist/components/cfpb-buttons/index.js +1 -1
  5. package/dist/components/cfpb-buttons/index.js.map +1 -1
  6. package/dist/components/cfpb-expandables/index.css +1 -1
  7. package/dist/components/cfpb-expandables/index.css.map +2 -2
  8. package/dist/components/cfpb-expandables/index.js +1 -1
  9. package/dist/components/cfpb-expandables/index.js.map +2 -2
  10. package/dist/components/cfpb-forms/index.css +1 -1
  11. package/dist/components/cfpb-forms/index.css.map +2 -2
  12. package/dist/components/cfpb-forms/index.js +1 -1
  13. package/dist/components/cfpb-forms/index.js.map +2 -2
  14. package/dist/components/cfpb-icons/index.css +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 +1 -1
  19. package/dist/components/cfpb-layout/index.css.map +2 -2
  20. package/dist/components/cfpb-layout/index.js +1 -1
  21. package/dist/components/cfpb-layout/index.js.map +1 -1
  22. package/dist/components/cfpb-notifications/index.css +1 -1
  23. package/dist/components/cfpb-notifications/index.css.map +2 -2
  24. package/dist/components/cfpb-notifications/index.js +1 -1
  25. package/dist/components/cfpb-notifications/index.js.map +1 -1
  26. package/dist/components/cfpb-pagination/index.css +1 -1
  27. package/dist/components/cfpb-pagination/index.css.map +2 -2
  28. package/dist/components/cfpb-pagination/index.js +1 -1
  29. package/dist/components/cfpb-pagination/index.js.map +1 -1
  30. package/dist/components/cfpb-tables/index.css +1 -1
  31. package/dist/components/cfpb-tables/index.css.map +2 -2
  32. package/dist/components/cfpb-tables/index.js +1 -1
  33. package/dist/components/cfpb-tables/index.js.map +1 -1
  34. package/dist/components/cfpb-tooltips/index.css +1 -1
  35. package/dist/components/cfpb-tooltips/index.css.map +2 -2
  36. package/dist/components/cfpb-tooltips/index.js +1 -1
  37. package/dist/components/cfpb-tooltips/index.js.map +1 -1
  38. package/dist/components/cfpb-typography/index.css +1 -1
  39. package/dist/components/cfpb-typography/index.css.map +2 -2
  40. package/dist/components/cfpb-typography/index.js +1 -1
  41. package/dist/components/cfpb-typography/index.js.map +1 -1
  42. package/dist/elements/abstracts/index.js +2 -0
  43. package/dist/elements/abstracts/index.js.map +7 -0
  44. package/dist/elements/base/index.css +3 -0
  45. package/dist/elements/base/index.css.map +7 -0
  46. package/dist/elements/base/index.js +2 -0
  47. package/dist/elements/base/index.js.map +7 -0
  48. package/dist/elements/cfpb-button/index.js +4 -4
  49. package/dist/elements/cfpb-button/index.js.map +2 -2
  50. package/dist/elements/cfpb-checkbox-icon/index.js +3 -3
  51. package/dist/elements/cfpb-checkbox-icon/index.js.map +2 -2
  52. package/dist/elements/cfpb-expandable/index.js +4 -4
  53. package/dist/elements/cfpb-expandable/index.js.map +2 -2
  54. package/dist/elements/cfpb-file-upload/index.js +4 -4
  55. package/dist/elements/cfpb-file-upload/index.js.map +3 -3
  56. package/dist/elements/cfpb-form-alert/index.js +3 -3
  57. package/dist/elements/cfpb-form-alert/index.js.map +2 -2
  58. package/dist/elements/cfpb-form-choice/index.js +3 -3
  59. package/dist/elements/cfpb-form-choice/index.js.map +2 -2
  60. package/dist/elements/cfpb-form-search/index.js +3 -3
  61. package/dist/elements/cfpb-form-search/index.js.map +3 -3
  62. package/dist/elements/cfpb-form-search-input/index.js +3 -3
  63. package/dist/elements/cfpb-form-search-input/index.js.map +3 -3
  64. package/dist/elements/cfpb-icon-text/index.js +1 -1
  65. package/dist/elements/cfpb-icon-text/index.js.map +2 -2
  66. package/dist/elements/cfpb-label/index.js +1 -1
  67. package/dist/elements/cfpb-label/index.js.map +2 -2
  68. package/dist/elements/cfpb-list/index.js +3 -3
  69. package/dist/elements/cfpb-list/index.js.map +3 -3
  70. package/dist/elements/cfpb-list-item/index.js +3 -3
  71. package/dist/elements/cfpb-list-item/index.js.map +2 -2
  72. package/dist/elements/cfpb-pagination/index.js +3 -3
  73. package/dist/elements/cfpb-pagination/index.js.map +2 -2
  74. package/dist/elements/cfpb-select/index.js +4 -4
  75. package/dist/elements/cfpb-select/index.js.map +4 -4
  76. package/dist/elements/cfpb-tag-filter/index.js +2 -2
  77. package/dist/elements/cfpb-tag-filter/index.js.map +2 -2
  78. package/dist/elements/cfpb-tag-group/index.js +1 -1
  79. package/dist/elements/cfpb-tag-group/index.js.map +2 -2
  80. package/dist/elements/cfpb-tag-topic/index.js +3 -3
  81. package/dist/elements/cfpb-tag-topic/index.js.map +2 -2
  82. package/dist/elements/index.js +7 -7
  83. package/dist/elements/index.js.map +4 -4
  84. package/dist/index.css +1 -1
  85. package/dist/index.css.map +3 -3
  86. package/dist/index.js +7 -7
  87. package/dist/index.js.map +4 -4
  88. package/dist/utilities/index.css +1 -1
  89. package/dist/utilities/index.css.map +2 -2
  90. package/dist/utilities/index.js +1 -1
  91. package/dist/utilities/index.js.map +2 -2
  92. package/package.json +1 -1
  93. package/src/components/cfpb-buttons/button-group.scss +1 -1
  94. package/src/components/cfpb-buttons/button-link.scss +10 -54
  95. package/src/components/cfpb-buttons/button.scss +3 -3
  96. package/src/components/cfpb-buttons/vars.scss +1 -1
  97. package/src/components/cfpb-expandables/expandable-group.scss +1 -1
  98. package/src/components/cfpb-expandables/expandable.scss +1 -1
  99. package/src/components/cfpb-expandables/summary.scss +1 -1
  100. package/src/components/cfpb-forms/form-alert.scss +1 -1
  101. package/src/components/cfpb-forms/form-field.scss +6 -6
  102. package/src/components/cfpb-forms/form.scss +1 -1
  103. package/src/components/cfpb-forms/label.scss +2 -2
  104. package/src/components/cfpb-forms/multiselect.scss +1 -1
  105. package/src/components/cfpb-forms/range.scss +7 -7
  106. package/src/components/cfpb-forms/search-input.scss +1 -1
  107. package/src/components/cfpb-forms/select.scss +1 -1
  108. package/src/components/cfpb-forms/tag.scss +1 -1
  109. package/src/components/cfpb-forms/text-input.scss +1 -1
  110. package/src/components/cfpb-icons/icon.scss +1 -1
  111. package/src/components/cfpb-layout/card-group.scss +1 -1
  112. package/src/components/cfpb-layout/card.scss +1 -1
  113. package/src/components/cfpb-layout/email-signup.scss +1 -1
  114. package/src/components/cfpb-layout/featured-content-module.scss +1 -1
  115. package/src/components/cfpb-layout/hero.scss +1 -1
  116. package/src/components/cfpb-layout/layout.scss +9 -9
  117. package/src/components/cfpb-layout/well.scss +1 -1
  118. package/src/components/cfpb-notifications/banner.scss +1 -1
  119. package/src/components/cfpb-notifications/notification.scss +1 -1
  120. package/src/components/cfpb-pagination/pagination.scss +1 -1
  121. package/src/components/cfpb-tables/table.scss +1 -1
  122. package/src/components/cfpb-tooltips/tooltip.scss +1 -1
  123. package/src/components/cfpb-typography/date.scss +1 -1
  124. package/src/components/cfpb-typography/list.scss +1 -1
  125. package/src/components/cfpb-typography/meta-header.scss +1 -1
  126. package/src/components/cfpb-typography/mixins.scss +1 -1
  127. package/src/components/cfpb-typography/pull-quote.scss +1 -1
  128. package/src/components/cfpb-typography/slug-header.scss +1 -1
  129. package/src/components/cfpb-typography/tagline.scss +1 -1
  130. package/src/elements/abstracts/custom-props.css +1 -1
  131. package/src/elements/abstracts/sizing-vars.scss +2 -1
  132. package/src/elements/abstracts/vars.css +1 -1
  133. package/src/elements/cfpb-button/cfpb-button-group.scss +8 -6
  134. package/src/elements/cfpb-button/cfpb-button-link.scss +54 -47
  135. package/src/elements/cfpb-button/cfpb-button.scss +168 -172
  136. package/src/elements/cfpb-button/index.js +16 -1
  137. package/src/elements/cfpb-button/vars.css +1 -1
  138. package/src/elements/cfpb-expandable/cfpb-expandable.component.scss +2 -2
  139. package/src/elements/cfpb-file-upload/index.js +9 -9
  140. package/src/elements/cfpb-form-search-input/index.js +4 -0
  141. package/src/elements/cfpb-icon-text/cfpb-icon-text.component.scss +2 -1
  142. package/src/elements/cfpb-list/cfpb-list.component.scss +19 -8
  143. package/src/elements/cfpb-list/index.js +62 -40
  144. package/src/elements/cfpb-list/index.spec.js +66 -21
  145. package/src/elements/cfpb-select/cfpb-select.component.scss +2 -2
  146. package/src/elements/cfpb-select/index.js +60 -70
  147. package/src/elements/cfpb-select/multiple-select-event-proxy.js +88 -0
  148. package/src/elements/cfpb-select/single-select-event-proxy.js +47 -0
  149. package/src/elements/cfpb-tag-topic/cfpb-tag-topic.component.scss +2 -2
  150. package/src/index.js +2 -2
  151. package/src/index.scss +3 -2
  152. package/src/utilities/breakpoint-state.js +1 -1
  153. package/src/utilities/utilities.scss +1 -1
  154. package/src/abstracts/custom-props.scss +0 -175
  155. package/src/abstracts/grid-mixins.scss +0 -82
  156. package/src/abstracts/heading-mixins.scss +0 -345
  157. package/src/abstracts/index.scss +0 -6
  158. package/src/abstracts/media-queries.scss +0 -35
  159. package/src/abstracts/vars-breakpoints.scss +0 -16
  160. package/src/abstracts/vars.scss +0 -184
  161. package/src/base/base.scss +0 -375
  162. package/src/base/font.scss +0 -27
  163. package/src/base/index.scss +0 -3
  164. package/src/base/normalize.scss +0 -290
  165. /package/src/{abstracts → elements/abstracts}/index.js +0 -0
  166. /package/src/{abstracts → elements/abstracts}/vars-breakpoints.js +0 -0
  167. /package/src/{base → elements/base}/index.js +0 -0
@@ -2,17 +2,13 @@
2
2
  @use './vars' as *;
3
3
  @use '@cfpb/cfpb-design-system/src/elements/abstracts' as *;
4
4
 
5
- //
6
- // Button link
7
- //
8
-
9
5
  /*
10
- Link text and underline.
11
- $v: Link link and visited color.
12
- $h: Link hover color.
13
- $f: Link focus color.
14
- $a: Link active color.
15
- */
6
+ Link text and underline.
7
+ $v: Link link and visited color.
8
+ $h: Link hover color.
9
+ $f: Link focus color.
10
+ $a: Link active color.
11
+ */
16
12
  @mixin u-btn-link-states($selector, $v, $h, $f, $a) {
17
13
  #{$selector} {
18
14
  &,
@@ -29,6 +25,7 @@ $a: Link active color.
29
25
  text-decoration-style: solid;
30
26
  background-color: transparent;
31
27
  color: $h;
28
+ box-shadow: none; // Added by secondary variant.
32
29
  }
33
30
 
34
31
  &:focus,
@@ -48,49 +45,59 @@ $a: Link active color.
48
45
  }
49
46
  }
50
47
 
51
- .a-btn--link {
52
- // Padding added so the focus rectangle falls below the underline.
53
- padding: 1.5px 0;
54
- border-radius: 0;
55
- text-decoration-line: underline;
56
- text-decoration-thickness: 1px;
57
- text-decoration-style: dotted;
58
- text-underline-offset: 4.5px;
48
+ :host {
49
+ //
50
+ // Button link
51
+ //
52
+
53
+ .a-btn--link {
54
+ // Remove any border and background add by primary and secondary button.
55
+ box-shadow: none;
56
+ background-color: transparent;
57
+
58
+ // Padding added so the focus rectangle falls below the underline.
59
+ padding: 1.5px 0;
60
+ border-radius: 0;
61
+ text-decoration-line: underline;
62
+ text-decoration-thickness: 1px;
63
+ text-decoration-style: dotted;
64
+ text-underline-offset: 4.5px;
59
65
 
60
- &:has(svg) {
61
- // Button links should be closer to their icon.
62
- gap: math.div(5px, $base-font-size-px) + rem;
66
+ &:has(svg) {
67
+ // Button links should be closer to their icon.
68
+ gap: math.div(5px, $base-font-size-px) + rem;
63
69
 
64
- // Button links shouldn't have a divider.
65
- &::before {
66
- display: none;
70
+ // Button links shouldn't have a divider.
71
+ &::before {
72
+ display: none;
73
+ }
67
74
  }
68
75
  }
69
- }
70
76
 
71
- @include u-btn-link-states(
72
- '.a-btn--link',
73
- var(--link-text),
74
- var(--link-text-hover),
75
- var(--link-text),
76
- var(--link-text-active)
77
- );
77
+ @include u-btn-link-states(
78
+ '.a-btn--link',
79
+ var(--link-text),
80
+ var(--link-text-hover),
81
+ var(--link-text),
82
+ var(--link-text-active)
83
+ );
78
84
 
79
- //
80
- // Secondary button link
81
- //
85
+ //
86
+ // Secondary button link
87
+ //
82
88
 
83
- // The .a-btn--link.a-btn--secondary combo shouldn't be used,
84
- // so we provide no styles.
89
+ // The .a-btn--link.a-btn--secondary combo shouldn't be used,
90
+ // so we provide no styles.
85
91
 
86
- //
87
- // Destructive action button link
88
- //
92
+ //
93
+ // Destructive action button link
94
+ //
89
95
 
90
- @include u-btn-link-states(
91
- '.a-btn--link.a-btn--warning',
92
- var(--btn-warning-bg),
93
- var(--btn-warning-bg-hover),
94
- var(--btn-warning-bg),
95
- var(--btn-warning-bg-active)
96
- );
96
+ @include u-btn-link-states(
97
+ '.a-btn--link.a-btn--warning',
98
+ var(--btn-warning-bg),
99
+ var(--btn-warning-bg-hover),
100
+ var(--btn-warning-bg),
101
+ var(--btn-warning-bg-active)
102
+ );
103
+ }
@@ -1,222 +1,218 @@
1
1
  @use 'sass:math';
2
2
  @use './vars' as *;
3
3
  @use '@cfpb/cfpb-design-system/src/elements/abstracts' as *;
4
+ @use '@cfpb/cfpb-design-system/src/elements/cfpb-icon-text/cfpb-icon-text.component' as *;
4
5
 
5
- //
6
- // Default button
7
- //
8
-
9
- button.a-btn::-moz-focus-inner,
10
- input.a-btn::-moz-focus-inner {
11
- // Fixes inconsistent button.btn height in Firefox.
12
- // Helps with inconsistent input.btn height in Firefox but not completely.
13
- border: 0;
14
- }
15
-
16
- @mixin u-btn-divider() {
17
- content: '';
18
- border-left: 1px solid var(--btn-divider);
19
- order: 2;
20
- place-self: normal;
21
- }
22
-
23
- .a-btn {
24
- line-height: math.div(19px, $base-font-size-px);
25
- appearance: none;
26
- display: flex;
27
- gap: math.div(10px, $base-font-size-px) + rem;
28
-
29
- box-sizing: border-box;
30
- padding: math.div($btn-v-padding, $btn-font-size) + em
31
- math.div($btn-h-padding, $btn-font-size) + em;
32
- border: 0;
33
- margin: 0;
34
- border-radius: math.div($btn-border-radius-size, $btn-font-size) + em;
35
- cursor: pointer;
36
- font-size: math.div($btn-font-size, $base-font-size-px) + em;
37
- font-weight: 500;
38
- text-align: center;
39
- text-decoration: none;
40
- transition: background-color 0.1s;
41
- width: fit-content;
42
- height: fit-content;
43
- justify-content: center;
44
- align-items: center;
45
-
46
- &,
47
- &:link,
48
- &:visited {
49
- background-color: var(--btn-bg);
50
- color: var(--btn-text);
51
- }
52
-
53
- &:hover,
54
- &.hover,
55
- &:focus,
56
- &.focus {
57
- background-color: var(--btn-bg-hover);
58
- color: var(--btn-text);
59
- }
60
-
61
- &:focus,
62
- &.focus {
63
- outline: 1px dotted var(--btn-bg);
64
-
65
- // The outline-offset property is not supported everywhere (e.g. IE)
66
- // but it adds a nice touch in browsers where it is.
67
- outline-offset: 1px;
68
- }
6
+ :host {
7
+ //
8
+ // Default button
9
+ //
69
10
 
70
- &:active,
71
- &.active {
72
- background-color: var(--btn-bg-active);
11
+ button.a-btn::-moz-focus-inner,
12
+ input.a-btn::-moz-focus-inner {
13
+ // Fixes inconsistent button.btn height in Firefox.
14
+ // Helps with inconsistent input.btn height in Firefox but not completely.
15
+ border: 0;
73
16
  }
74
17
 
75
- //
76
- // Secondary button
77
- //
18
+ .a-btn {
19
+ line-height: math.div(19px, $base-font-size-px);
20
+ appearance: none;
21
+ display: flex;
22
+ gap: math.div(10px, $base-font-size-px) + rem;
23
+
24
+ box-sizing: border-box;
25
+ padding: math.div($btn-v-padding, $btn-font-size) + em
26
+ math.div($btn-h-padding, $btn-font-size) + em;
27
+ border: 0;
28
+ margin: 0;
29
+ border-radius: math.div($btn-border-radius-size, $btn-font-size) + em;
30
+ cursor: pointer;
31
+ font-size: math.div($btn-font-size, $base-font-size-px) + em;
32
+ font-weight: 500;
33
+ text-align: center;
34
+ text-decoration: none;
35
+ transition: background-color 0.1s;
36
+ width: fit-content;
37
+ height: fit-content;
38
+ justify-content: center;
39
+ align-items: center;
78
40
 
79
- &--secondary {
80
41
  &,
81
42
  &:link,
82
43
  &:visited {
83
- background-color: var(--btn-secondary-bg);
84
- color: var(--btn-secondary-text);
85
- box-shadow: 0 0 0 1px var(--btn-secondary-border) inset;
44
+ background-color: var(--btn-bg);
45
+ color: var(--btn-text);
86
46
  }
87
47
 
88
48
  &:hover,
89
49
  &.hover,
90
50
  &:focus,
91
51
  &.focus {
92
- background-color: var(--btn-secondary-bg-hover);
93
- color: var(--btn-secondary-text-hover);
94
- box-shadow: 0 0 0 1px var(--btn-secondary-border-hover) inset;
52
+ background-color: var(--btn-bg-hover);
53
+ color: var(--btn-text);
95
54
  }
96
55
 
97
56
  &:focus,
98
57
  &.focus {
99
- outline-color: var(--btn-secondary-border);
58
+ outline: 1px dotted var(--btn-bg);
59
+
60
+ // The outline-offset property is not supported everywhere (e.g. IE)
61
+ // but it adds a nice touch in browsers where it is.
62
+ outline-offset: 1px;
100
63
  }
101
64
 
102
65
  &:active,
103
66
  &.active {
104
- background-color: var(--btn-secondary-bg-active);
105
- color: var(--btn-secondary-text-active);
106
- box-shadow: 0 0 0 1px var(--btn-secondary-border-active) inset;
67
+ background-color: var(--btn-bg-active);
107
68
  }
108
- }
109
69
 
110
- //
111
- // Destructive action button
112
- //
70
+ //
71
+ // Secondary button
72
+ //
73
+
74
+ &--secondary {
75
+ &,
76
+ &:link,
77
+ &:visited {
78
+ background-color: var(--btn-secondary-bg);
79
+ color: var(--btn-secondary-text);
80
+ box-shadow: 0 0 0 1px var(--btn-secondary-border) inset;
81
+ }
82
+
83
+ &:hover,
84
+ &.hover,
85
+ &:focus,
86
+ &.focus {
87
+ background-color: var(--btn-secondary-bg-hover);
88
+ color: var(--btn-secondary-text-hover);
89
+ box-shadow: 0 0 0 1px var(--btn-secondary-border-hover) inset;
90
+ }
91
+
92
+ &:focus,
93
+ &.focus {
94
+ outline-color: var(--btn-secondary-border);
95
+ }
96
+
97
+ &:active,
98
+ &.active {
99
+ background-color: var(--btn-secondary-bg-active);
100
+ color: var(--btn-secondary-text-active);
101
+ box-shadow: 0 0 0 1px var(--btn-secondary-border-active) inset;
102
+ }
103
+ }
113
104
 
114
- &--warning {
115
- &,
116
- &:link,
117
- &:visited {
118
- background-color: var(--btn-warning-bg);
119
- color: var(--btn-warning-text);
105
+ //
106
+ // Destructive action button
107
+ //
108
+
109
+ &--warning {
110
+ &,
111
+ &:link,
112
+ &:visited {
113
+ background-color: var(--btn-warning-bg);
114
+ color: var(--btn-warning-text);
115
+ }
116
+
117
+ &:hover,
118
+ &.hover,
119
+ &:focus,
120
+ &.focus {
121
+ background-color: var(--btn-warning-bg-hover);
122
+ }
123
+
124
+ &:focus,
125
+ &.focus {
126
+ outline-color: var(--btn-warning-bg);
127
+ }
128
+
129
+ &:active,
130
+ &.active {
131
+ background-color: var(--btn-warning-bg-active);
132
+ }
120
133
  }
121
134
 
122
- &:hover,
123
- &.hover,
124
- &:focus,
125
- &.focus {
126
- background-color: var(--btn-warning-bg-hover);
135
+ //
136
+ // Disabled button
137
+ //
138
+
139
+ &--disabled,
140
+ &[disabled],
141
+ &[aria-disabled='true'] {
142
+ &,
143
+ &:link,
144
+ &:visited,
145
+ &:hover,
146
+ &.hover,
147
+ &:focus,
148
+ &.focus,
149
+ &:active,
150
+ &.active {
151
+ background-color: var(--btn-disabled-bg);
152
+ color: var(--btn-disabled-text);
153
+ box-shadow: none; // Added by secondary variant.
154
+ cursor: not-allowed;
155
+ }
156
+
157
+ &:focus,
158
+ &.focus {
159
+ outline-color: var(--btn-disabled-outline);
160
+ }
127
161
  }
128
162
 
129
- &:focus,
130
- &.focus {
131
- outline-color: var(--btn-warning-bg);
163
+ //
164
+ // Full width button on x-small screens
165
+ //
166
+ &--full-on-xs {
167
+ // Mobile only.
168
+ @include respond-to-max($bp-xs-max) {
169
+ width: 100%;
170
+ }
132
171
  }
133
172
 
134
- &:active,
135
- &.active {
136
- background-color: var(--btn-warning-bg-active);
173
+ // Set either the text or icon as the last item in the button.
174
+ &:has(svg + span) {
175
+ span {
176
+ order: 3;
177
+ }
137
178
  }
138
- }
139
179
 
140
- //
141
- // Disabled button
142
- //
180
+ &:has(span + svg) {
181
+ svg {
182
+ order: 3;
143
183
 
144
- &--disabled,
145
- &[disabled],
146
- &[aria-disabled='true'] {
147
- &,
148
- &:link,
149
- &:visited,
150
- &:hover,
151
- &.hover,
152
- &:focus,
153
- &.focus,
154
- &:active,
155
- &.active {
156
- background-color: var(--btn-disabled-bg);
157
- color: var(--btn-disabled-text);
158
- cursor: default; // Fallback for IE/Opera
159
- cursor: not-allowed;
184
+ // Prevent icon from shrinking when button wraps.
185
+ flex: none;
186
+ }
160
187
  }
161
188
 
162
- &:focus,
163
- &.focus {
164
- outline-color: var(--btn-disabled-outline);
189
+ // Handle button with icon divider logic.
190
+ &:not(.a-btn--hide-icon):has(svg + span)::before,
191
+ &:not(.a-btn--hide-icon):has(span + svg)::before {
192
+ @include u-btn-divider;
165
193
  }
166
- }
167
194
 
168
- //
169
- // Full width button on x-small screens
170
- //
171
- &--full-on-xs {
172
- // Mobile only.
173
- @include respond-to-max($bp-xs-max) {
174
- width: 100%;
195
+ // Handle different coloring in divider.
196
+ &--secondary:has(svg)::before {
197
+ border-color: var(--btn-secondary-divider) !important;
175
198
  }
176
- }
177
199
 
178
- // Set either the text or icon as the last item in the button.
179
- &:has(svg + span) {
180
- span {
181
- order: 3;
200
+ &--warning:has(svg)::before {
201
+ border-color: var(--btn-warning-divider) !important;
182
202
  }
183
- }
184
203
 
185
- &:has(span + svg) {
186
- svg {
187
- order: 3;
188
-
189
- // Prevent icon from shrinking when button wraps.
190
- flex: none;
204
+ &--disabled:has(svg)::before,
205
+ &[disabled]:has(svg)::before,
206
+ &[aria-disabled='true']:has(svg)::before {
207
+ border-color: var(--btn-disabled-divider) !important;
191
208
  }
192
- }
193
-
194
- // Handle button with icon divider logic.
195
- &:not(.a-btn--hide-icon):has(svg + span)::before,
196
- &:not(.a-btn--hide-icon):has(span + svg)::before {
197
- @include u-btn-divider;
198
- }
199
-
200
- // Handle different coloring in divider.
201
- &--secondary:has(svg)::before {
202
- border-color: var(--btn-secondary-divider) !important;
203
- }
204
-
205
- &--warning:has(svg)::before {
206
- border-color: var(--btn-warning-divider) !important;
207
- }
208
-
209
- &--disabled:has(svg)::before,
210
- &[disabled]:has(svg)::before,
211
- &[aria-disabled='true']:has(svg)::before {
212
- border-color: var(--btn-disabled-divider) !important;
213
- }
214
209
 
215
- // Hide the icon if the a-btn--hide-icon modifier is set.
216
- // Useful for showing and hiding a loading icon, for example.
217
- &--hide-icon {
218
- svg {
219
- display: none;
210
+ // Hide the icon if the a-btn--hide-icon modifier is set.
211
+ // Useful for showing and hiding a loading icon, for example.
212
+ &--hide-icon {
213
+ svg {
214
+ display: none;
215
+ }
220
216
  }
221
217
  }
222
218
  }
@@ -92,6 +92,17 @@ export class CfpbButton extends LitElement {
92
92
  this.#iconTextDom.value?.showIcon();
93
93
  }
94
94
 
95
+ get dividerColorVar() {
96
+ switch (this.variant) {
97
+ case 'warning':
98
+ return '--btn-warning-divider';
99
+ case 'secondary':
100
+ return '--btn-secondary-divider';
101
+ default:
102
+ return '--btn-divider';
103
+ }
104
+ }
105
+
95
106
  /**
96
107
  * Ensure the variant value is valid, and fall back to a default if not.
97
108
  * @returns {string} A valid variant value string.
@@ -122,7 +133,11 @@ export class CfpbButton extends LitElement {
122
133
 
123
134
  #renderTextAndIcon() {
124
135
  return html`
125
- <cfpb-icon-text ${ref(this.#iconTextDom)} ?disabled=${this.disabled}>
136
+ <cfpb-icon-text
137
+ ${ref(this.#iconTextDom)}
138
+ ?disabled=${this.disabled}
139
+ style="--icon-text-divider: var(${this.dividerColorVar})"
140
+ >
126
141
  <slot></slot>
127
142
  </cfpb-icon-text>
128
143
  `;
@@ -2,7 +2,7 @@
2
2
  * Do not edit directly, this file was auto-generated.
3
3
  */
4
4
 
5
- :host {
5
+ :root {
6
6
  --btn-bg: var(--pacific);
7
7
  --btn-bg-active: var(--navy);
8
8
  --btn-bg-hover: var(--pacific-dark);
@@ -1,6 +1,6 @@
1
1
  @use 'sass:math';
2
- @use '@cfpb/cfpb-design-system/src/abstracts' as *;
3
- @use '@cfpb/cfpb-design-system/src/base' as *;
2
+ @use '@cfpb/cfpb-design-system/src/elements/abstracts' as *;
3
+ @use '@cfpb/cfpb-design-system/src/elements/base' as *;
4
4
  @use '@cfpb/cfpb-design-system/src/utilities' as *;
5
5
  @use '../cfpb-utilities/transition/transition.scss' as *;
6
6
 
@@ -30,8 +30,8 @@ export class CfpbFileUpload extends LitElement {
30
30
  this.#hideDetails();
31
31
  }
32
32
 
33
- fileInput = createRef();
34
- fileDetails = createRef();
33
+ #fileInput = createRef();
34
+ #fileDetails = createRef();
35
35
 
36
36
  #getUploadName(fileName) {
37
37
  let uploadName = fileName;
@@ -44,9 +44,9 @@ export class CfpbFileUpload extends LitElement {
44
44
  }
45
45
 
46
46
  #showDetails() {
47
- this.fileName = this.#getUploadName(this.fileInput.value.value);
48
- this.value = this.fileInput.value.value;
49
- this.files = this.fileInput.value.files;
47
+ this.fileName = this.#getUploadName(this.#fileInput.value.value);
48
+ this.value = this.#fileInput.value.value;
49
+ this.files = this.#fileInput.value.files;
50
50
  this.isDetailHidden = false;
51
51
  }
52
52
 
@@ -58,7 +58,7 @@ export class CfpbFileUpload extends LitElement {
58
58
  }
59
59
 
60
60
  #checkStatus() {
61
- if (this.fileInput.value.value == '') {
61
+ if (this.#fileInput.value.value == '') {
62
62
  this.#hideDetails();
63
63
  } else {
64
64
  this.#showDetails();
@@ -70,7 +70,7 @@ export class CfpbFileUpload extends LitElement {
70
70
  <cfpb-button
71
71
  variant="secondary"
72
72
  @click=${() => {
73
- this.fileInput.value.click();
73
+ this.#fileInput.value.click();
74
74
  }}
75
75
  >
76
76
  <slot></slot>
@@ -82,12 +82,12 @@ export class CfpbFileUpload extends LitElement {
82
82
  accept=${this.accept}
83
83
  @input=${() => this.#checkStatus()}
84
84
  @cancel=${() => this.#checkStatus()}
85
- ${ref(this.fileInput)}
85
+ ${ref(this.#fileInput)}
86
86
  />
87
87
  <div
88
88
  part="upload-details"
89
89
  ?hidden=${this.isDetailHidden}
90
- ${ref(this.fileDetails)}
90
+ ${ref(this.#fileDetails)}
91
91
  >
92
92
  <h4>File added</h4>
93
93
  <ul>
@@ -84,6 +84,10 @@ export class CfpbFormSearchInput extends LitElement {
84
84
  );
85
85
  }
86
86
 
87
+ focus() {
88
+ this.#searchInput.value.focus();
89
+ }
90
+
87
91
  render() {
88
92
  return html`
89
93
  <div
@@ -44,7 +44,8 @@
44
44
  }
45
45
 
46
46
  :host([disabled]) {
47
- --icon-text-divider: var(--icon-text-divider-disabled);
47
+ // !important is set so that disabled divider color overrides all other color.
48
+ --icon-text-divider: var(--icon-text-divider-disabled) !important;
48
49
  }
49
50
 
50
51
  // Hide SVG if user calls hideIcon()
@@ -4,20 +4,31 @@
4
4
 
5
5
  :host {
6
6
  ::slotted(cfpb-list-item) {
7
- border-bottom: 1px solid var(--gray-20);
7
+ position: relative;
8
+ margin-top: 1px;
8
9
 
9
- // Overlap with the border of prior item.
10
- margin-top: -1px;
11
- }
10
+ &::before,
11
+ &::after {
12
+ position: absolute;
13
+ content: '';
14
+ display: block;
15
+ width: 100%;
16
+ height: 1px;
17
+ }
12
18
 
13
- ::slotted(cfpb-list-item:first-of-type) {
14
- border-top: 1px solid var(--gray-20);
19
+ &::before {
20
+ top: -1px;
21
+ border-top: 1px solid var(--gray-20);
22
+ }
15
23
 
16
- // Don't shift the first item.
17
- margin-top: 0;
24
+ &::after {
25
+ bottom: -1px;
26
+ border-bottom: 1px solid var(--gray-20);
27
+ }
18
28
  }
19
29
 
20
30
  :focus {
21
31
  outline: 1px dotted var(--pacific);
32
+ outline-offset: 2px;
22
33
  }
23
34
  }