@solexllc/usx 0.1.5 → 0.1.7

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 (45) hide show
  1. package/package.json +2 -2
  2. package/src/components/_accordion.scss +1 -3
  3. package/src/components/_alert.scss +14 -42
  4. package/src/components/_attribution.scss +1 -3
  5. package/src/components/_avatar-group.scss +1 -3
  6. package/src/components/_avatar.scss +4 -4
  7. package/src/components/_banner.scss +5 -15
  8. package/src/components/_block.scss +1 -3
  9. package/src/components/_branding.scss +2 -6
  10. package/src/components/_breadcrumb.scss +5 -15
  11. package/src/components/_button-group.scss +1 -3
  12. package/src/components/_button.scss +15 -45
  13. package/src/components/_carousel.scss +6 -18
  14. package/src/components/_checkbox.scss +7 -21
  15. package/src/components/_clickable.scss +4 -12
  16. package/src/components/_collection.scss +2 -6
  17. package/src/components/_combobox.scss +7 -19
  18. package/src/components/_file-input.scss +15 -43
  19. package/src/components/_footer.scss +23 -69
  20. package/src/components/_form-group.scss +5 -15
  21. package/src/components/_header.scss +30 -90
  22. package/src/components/_hero.scss +94 -54
  23. package/src/components/_icon-list.scss +1 -3
  24. package/src/components/_in-page-nav.scss +9 -27
  25. package/src/components/_input.scss +17 -51
  26. package/src/components/_language-selector.scss +3 -9
  27. package/src/components/_layout.scss +1 -3
  28. package/src/components/_link.scss +7 -21
  29. package/src/components/_misc-banner.scss +1 -3
  30. package/src/components/_modal.scss +4 -12
  31. package/src/components/_page.scss +2 -6
  32. package/src/components/_pagination.scss +13 -37
  33. package/src/components/_process-list.scss +4 -12
  34. package/src/components/_radio-buttons.scss +6 -18
  35. package/src/components/_section.scss +2 -6
  36. package/src/components/_select.scss +17 -51
  37. package/src/components/_sidenav.scss +10 -30
  38. package/src/components/_site-alert.scss +5 -15
  39. package/src/components/_step-indicator.scss +16 -48
  40. package/src/components/_summary-box.scss +5 -15
  41. package/src/components/_table.scss +2 -6
  42. package/src/components/_task-list.scss +6 -18
  43. package/src/components/_text-area.scss +15 -45
  44. package/src/components/_theme-picker.scss +2 -6
  45. package/src/components/_tooltip.scss +1 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solexllc/usx",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "Compiled USWDS-based component styles for USX.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -32,7 +32,7 @@
32
32
  "src"
33
33
  ],
34
34
  "dependencies": {
35
- "@solexllc/usx-theme": "0.2.1"
35
+ "@solexllc/usx-theme": "0.2.2"
36
36
  },
37
37
  "devDependencies": {
38
38
  "sass": "^1.98.0"
@@ -22,9 +22,7 @@ $usx-accordion-icon-add: 'data:image/svg+xml,%3Csvg xmlns=\'http://www.w3.org/20
22
22
 
23
23
  &.usa-accordion--bordered {
24
24
  .usa-accordion__content {
25
- @if $usx-accordion-border-width {
26
- border-width: $usx-accordion-border-width;
27
- }
25
+ border-width: usx-when($usx-accordion-border-width);
28
26
  }
29
27
  }
30
28
 
@@ -8,13 +8,9 @@
8
8
  &.usx-alert, .usa-alert__body {
9
9
  position: relative;
10
10
 
11
- @if $usx-alert-radius {
12
- border-radius: $usx-alert-radius;
13
- }
11
+ border-radius: usx-when($usx-alert-radius);
14
12
 
15
- @if $usx-alert-box-shadow {
16
- box-shadow: $usx-alert-box-shadow;
17
- }
13
+ box-shadow: usx-when($usx-alert-box-shadow);
18
14
  }
19
15
  }
20
16
 
@@ -43,9 +39,7 @@
43
39
 
44
40
  .#{$uswds-class-name}.#{$usa-class-name}:not(.usx-site-alert--maintenance *):not(.usx-site-alert--maintenance-warning *),
45
41
  .#{$uswds-class-name}.#{$usa-class-name}:not(.usx-site-alert--maintenance *):not(.usx-site-alert--maintenance-warning *) .usa-alert__body {
46
- @if $bg {
47
- background-color: $bg;
48
- }
42
+ background-color: usx-when($bg);
49
43
 
50
44
  @if $color {
51
45
  color: $color;
@@ -61,13 +55,9 @@
61
55
  }
62
56
  }
63
57
 
64
- @if $border {
65
- border-color: $border;
66
- }
58
+ border-color: usx-when($border);
67
59
 
68
- @if $usx-alert-border-width {
69
- border-width: $usx-alert-border-width;
70
- }
60
+ border-width: usx-when($usx-alert-border-width);
71
61
  }
72
62
  }
73
63
 
@@ -109,48 +99,30 @@
109
99
 
110
100
  .usx-alert {
111
101
  .usa-alert--slim {
112
- @if $usx-alert-slim-padding-block {
113
- padding-block: $usx-alert-slim-padding-block;
114
- }
102
+ padding-block: usx-when($usx-alert-slim-padding-block);
115
103
 
116
- @if $usx-alert-slim-padding-inline {
117
- padding-inline: $usx-alert-slim-padding-inline;
118
- }
104
+ padding-inline: usx-when($usx-alert-slim-padding-inline);
119
105
  }
120
106
 
121
107
  .usa-alert--no-icon {
122
- @if $usx-alert-no-icon-padding-inline-start {
123
- padding-inline-start: $usx-alert-no-icon-padding-inline-start;
124
- }
108
+ padding-inline-start: usx-when($usx-alert-no-icon-padding-inline-start);
125
109
  }
126
110
 
127
111
  .usa-alert__body {
128
- @if $usx-alert-body-gap {
129
- gap: $usx-alert-body-gap;
130
- }
112
+ gap: usx-when($usx-alert-body-gap);
131
113
  }
132
114
 
133
115
  .usa-alert__heading {
134
- @if $usx-alert-heading-font-size {
135
- font-size: $usx-alert-heading-font-size;
136
- }
116
+ font-size: usx-when($usx-alert-heading-font-size);
137
117
 
138
- @if $usx-alert-heading-font-weight {
139
- font-weight: $usx-alert-heading-font-weight;
140
- }
118
+ font-weight: usx-when($usx-alert-heading-font-weight);
141
119
 
142
- @if $usx-alert-heading-margin-block-end {
143
- margin-block-end: $usx-alert-heading-margin-block-end;
144
- }
120
+ margin-block-end: usx-when($usx-alert-heading-margin-block-end);
145
121
  }
146
122
 
147
123
  .usa-alert__text {
148
- @if $usx-alert-text-font-size {
149
- font-size: $usx-alert-text-font-size;
150
- }
124
+ font-size: usx-when($usx-alert-text-font-size);
151
125
 
152
- @if $usx-alert-text-line-height {
153
- line-height: $usx-alert-text-line-height;
154
- }
126
+ line-height: usx-when($usx-alert-text-line-height);
155
127
  }
156
128
  }
@@ -33,8 +33,6 @@
33
33
  font-size: $usx-attribution-secondary-font-size;
34
34
  color: #71767a;
35
35
 
36
- @if $usx-attribution-secondary-text {
37
- color: $usx-attribution-secondary-text;
38
- }
36
+ color: usx-when($usx-attribution-secondary-text);
39
37
  }
40
38
  }
@@ -25,9 +25,7 @@
25
25
  img {
26
26
  box-shadow: 0 0 0 2px #00bde3;
27
27
 
28
- @if $usx-avatar-group-overlap-box-shadow {
29
- box-shadow: $usx-avatar-group-overlap-box-shadow;
30
- }
28
+ box-shadow: usx-when($usx-avatar-group-overlap-box-shadow);
31
29
  }
32
30
  }
33
31
  }
@@ -4,9 +4,10 @@
4
4
  /* stylelint-disable no-descending-specificity -- Size modifiers intentionally precede the base content rule. */
5
5
  .usx-avatar {
6
6
  text-decoration: none;
7
- display: block;
7
+ display: flex;
8
8
  width: 3rem;
9
9
  height: 3rem;
10
+ align-items: center;
10
11
 
11
12
  &.usx-avatar--size-sm {
12
13
  width: 2.5rem;
@@ -41,9 +42,8 @@
41
42
  }
42
43
 
43
44
  .usx-avatar__img {
44
- height: 100%;
45
- width: 100%;
46
- object-fit: cover;
45
+ height: auto;
46
+ width: auto;
47
47
  }
48
48
 
49
49
  .usx-avatar__content {
@@ -2,29 +2,19 @@
2
2
 
3
3
  /* stylelint-disable selector-class-pattern -- Public USX classes use BEM naming. */
4
4
  .usa-banner.usx-banner {
5
- @if $usx-banner-bg {
6
- background-color: $usx-banner-bg;
7
- }
5
+ background-color: usx-when($usx-banner-bg);
8
6
 
9
- @if $usx-banner-text {
10
- color: $usx-banner-text;
11
- }
7
+ color: usx-when($usx-banner-text);
12
8
 
13
9
  .usa-banner__header-text, .usa-banner__content {
14
- @if $usx-banner-text {
15
- color: $usx-banner-text;
16
- }
10
+ color: usx-when($usx-banner-text);
17
11
  }
18
12
 
19
13
  .usa-banner__button {
20
- @if $usx-banner-button-text {
21
- color: $usx-banner-button-text;
22
- }
14
+ color: usx-when($usx-banner-button-text);
23
15
  }
24
16
 
25
17
  .usa-banner__button::after {
26
- @if $usx-banner-chevron-text {
27
- background-color: $usx-banner-chevron-text;
28
- }
18
+ background-color: usx-when($usx-banner-chevron-text);
29
19
  }
30
20
  }
@@ -31,9 +31,7 @@
31
31
  background-color: #e2e8f0;
32
32
  padding: 1rem 1.25rem;
33
33
 
34
- @if $usx-block-callout-bg {
35
- background-color: $usx-block-callout-bg;
36
- }
34
+ background-color: usx-when($usx-block-callout-bg);
37
35
 
38
36
  @if $usx-block-border-width {
39
37
  border-width: $usx-block-border-width 0 0;
@@ -45,17 +45,13 @@
45
45
 
46
46
  .usa-header {
47
47
  .usx-logo__title {
48
- @if $usx-header-text {
49
- color: $usx-header-text;
50
- }
48
+ color: usx-when($usx-header-text);
51
49
  }
52
50
  }
53
51
 
54
52
  .usa-footer {
55
53
  .usx-logo__title {
56
- @if $usx-footer-text {
57
- color: $usx-footer-text;
58
- }
54
+ color: usx-when($usx-footer-text);
59
55
  }
60
56
  }
61
57
 
@@ -5,31 +5,21 @@
5
5
  // Real USWDS hardcodes breadcrumb background/text to fixed #fff/#1b1b1b —
6
6
  // give it a themeable default instead (nav/wayfinding element).
7
7
  .usx-breadcrumb {
8
- @if $usx-breadcrumb-bg {
9
- background-color: $usx-breadcrumb-bg;
10
- }
8
+ background-color: usx-when($usx-breadcrumb-bg);
11
9
 
12
- @if $usx-breadcrumb-text {
13
- color: $usx-breadcrumb-text;
14
- }
10
+ color: usx-when($usx-breadcrumb-text);
15
11
 
16
12
  .usa-breadcrumb__link {
17
- @if $usx-breadcrumb-link-text {
18
- color: $usx-breadcrumb-link-text;
19
- }
13
+ color: usx-when($usx-breadcrumb-link-text);
20
14
 
21
15
  &:hover {
22
- @if $usx-breadcrumb-link-text-hover {
23
- color: $usx-breadcrumb-link-text-hover;
24
- }
16
+ color: usx-when($usx-breadcrumb-link-text-hover);
25
17
  }
26
18
  }
27
19
 
28
20
  .usa-breadcrumb__list-item {
29
21
  &.usa-current {
30
- @if $usx-breadcrumb-current-text {
31
- color: $usx-breadcrumb-current-text;
32
- }
22
+ color: usx-when($usx-breadcrumb-current-text);
33
23
  }
34
24
  }
35
25
  }
@@ -7,9 +7,7 @@
7
7
  &.usa-button-group--segmented {
8
8
  .usa-button-group__item {
9
9
  &:where(:not(:last-child)) #{$selector}::before {
10
- @if $divider {
11
- border-right: $divider;
12
- }
10
+ border-right: usx-when($divider);
13
11
  }
14
12
 
15
13
  &:where(:not(:first-child):not(:last-child)) {
@@ -8,14 +8,10 @@
8
8
 
9
9
  /* ---------------------------------- */
10
10
  .usa-button.usx-button:not(.usa-button--unstyled) {
11
- @if $usx-radius-button {
12
- border-radius: $usx-radius-button;
13
- }
11
+ border-radius: usx-when($usx-radius-button);
14
12
 
15
13
  &:not(.usa-button--outline) {
16
- @if $usx-button-box-shadow {
17
- box-shadow: $usx-button-box-shadow;
18
- }
14
+ box-shadow: usx-when($usx-button-box-shadow);
19
15
  }
20
16
  }
21
17
 
@@ -62,40 +58,26 @@
62
58
  ) {
63
59
  /* Non-disabled buttons only */
64
60
  .usa-button.usx-button#{$selector}:not(:disabled):not([aria-disabled="true"]):not(.usx-button--ghost) {
65
- @if $bg {
66
- background-color: $bg;
67
- }
61
+ background-color: usx-when($bg);
68
62
 
69
- @if $color {
70
- color: $color;
71
- }
63
+ color: usx-when($color);
72
64
 
73
- @if $box-shadow {
74
- box-shadow: $box-shadow;
75
- }
65
+ box-shadow: usx-when($box-shadow);
76
66
 
77
67
  /* Hover state */
78
68
  &.usa-button--hover,
79
69
  &:hover {
80
- @if $bg-hover {
81
- background-color: $bg-hover;
82
- }
70
+ background-color: usx-when($bg-hover);
83
71
 
84
- @if $color-hover {
85
- color: $color-hover;
86
- }
72
+ color: usx-when($color-hover);
87
73
  }
88
74
 
89
75
  /* Active state */
90
76
  &.usa-button--active,
91
77
  &:active {
92
- @if $bg-active {
93
- background-color: $bg-active;
94
- }
78
+ background-color: usx-when($bg-active);
95
79
 
96
- @if $color-active {
97
- color: $color-active;
98
- }
80
+ color: usx-when($color-active);
99
81
  }
100
82
 
101
83
  /* Inverse modifier */
@@ -199,33 +181,23 @@
199
181
 
200
182
  &:not([disabled]):not([aria-disabled="true"]) {
201
183
  &.usa-button--primary {
202
- @if $usx-color-primary {
203
- color: $usx-color-primary;
204
- }
184
+ color: usx-when($usx-color-primary);
205
185
  }
206
186
 
207
187
  &.usa-button--secondary {
208
- @if $usx-color-secondary {
209
- color: $usx-color-secondary;
210
- }
188
+ color: usx-when($usx-color-secondary);
211
189
  }
212
190
 
213
191
  &.usa-button--accent-cool {
214
- @if $usx-color-accent-cool {
215
- color: $usx-color-accent-cool;
216
- }
192
+ color: usx-when($usx-color-accent-cool);
217
193
  }
218
194
 
219
195
  &.usa-button--accent-warm {
220
- @if $usx-color-accent-warm {
221
- color: $usx-color-accent-warm;
222
- }
196
+ color: usx-when($usx-color-accent-warm);
223
197
  }
224
198
 
225
199
  &.usa-button--base {
226
- @if $usx-color-base {
227
- color: $usx-color-base;
228
- }
200
+ color: usx-when($usx-color-base);
229
201
  }
230
202
 
231
203
  &.usa-button--hover,
@@ -241,9 +213,7 @@
241
213
  &.usa-button--inverse {
242
214
  color: white;
243
215
 
244
- @if $usx-surface-1 {
245
- color: $usx-surface-1;
246
- }
216
+ color: usx-when($usx-surface-1);
247
217
  }
248
218
  }
249
219
  }
@@ -45,9 +45,7 @@
45
45
  outline: .25rem solid #2491ff;
46
46
  outline-offset: -.25rem;
47
47
 
48
- @if $usx-carousel-focus {
49
- outline-color: $usx-carousel-focus;
50
- }
48
+ outline-color: usx-when($usx-carousel-focus);
51
49
  }
52
50
 
53
51
  /* ============================= */
@@ -64,9 +62,7 @@
64
62
  bottom: 10px;
65
63
  width: 100%;
66
64
 
67
- @if $usx-carousel-dot-gap {
68
- gap: $usx-carousel-dot-gap;
69
- }
65
+ gap: usx-when($usx-carousel-dot-gap);
70
66
  }
71
67
 
72
68
  .usx-carousel__dots a {
@@ -77,24 +73,18 @@
77
73
  display: inline-block;
78
74
  text-decoration: none;
79
75
 
80
- @if $usx-carousel-dot-bg {
81
- background: $usx-carousel-dot-bg;
82
- }
76
+ background: usx-when($usx-carousel-dot-bg);
83
77
 
84
78
  &:hover {
85
79
  background: #a0a0a0;
86
80
 
87
- @if $usx-carousel-dot-bg-hover {
88
- background: $usx-carousel-dot-bg-hover;
89
- }
81
+ background: usx-when($usx-carousel-dot-bg-hover);
90
82
  }
91
83
 
92
84
  &:active {
93
85
  background: #808080;
94
86
 
95
- @if $usx-carousel-dot-bg-active {
96
- background: $usx-carousel-dot-bg-active;
97
- }
87
+ background: usx-when($usx-carousel-dot-bg-active);
98
88
  }
99
89
  }
100
90
 
@@ -113,9 +103,7 @@
113
103
  overflow: hidden;
114
104
  background-color: #f8fafc;
115
105
 
116
- @if $usx-carousel-card-media-bg {
117
- background-color: $usx-carousel-card-media-bg;
118
- }
106
+ background-color: usx-when($usx-carousel-card-media-bg);
119
107
  }
120
108
 
121
109
  &.usa-card__media--inset {
@@ -2,15 +2,11 @@
2
2
 
3
3
  /* stylelint-disable selector-class-pattern -- Public USX classes use BEM naming. */
4
4
  .usa-checkbox__label {
5
- @if $usx-text-ink {
6
- color: $usx-text-ink;
7
- }
5
+ color: usx-when($usx-text-ink);
8
6
  }
9
7
 
10
8
  .usa-checkbox__input--tile + .usa-checkbox__label {
11
- @if $usx-surface-1 {
12
- background-color: $usx-surface-1;
13
- }
9
+ background-color: usx-when($usx-surface-1);
14
10
  }
15
11
 
16
12
  .usx-checkbox {
@@ -21,23 +17,15 @@
21
17
  }
22
18
 
23
19
  .usa-checkbox__input--tile + .usa-checkbox__label {
24
- @if $usx-checkable-tile-border {
25
- border-color: $usx-checkable-tile-border;
26
- }
20
+ border-color: usx-when($usx-checkable-tile-border);
27
21
 
28
- @if $usx-checkable-tile-border-width {
29
- border-width: $usx-checkable-tile-border-width;
30
- }
22
+ border-width: usx-when($usx-checkable-tile-border-width);
31
23
  }
32
24
 
33
25
  .usa-checkbox__label::before {
34
- @if $usx-checkable-radius {
35
- border-radius: $usx-checkable-radius;
36
- }
26
+ border-radius: usx-when($usx-checkable-radius);
37
27
 
38
- @if $usx-checkable-bg {
39
- background-color: $usx-checkable-bg;
40
- }
28
+ background-color: usx-when($usx-checkable-bg);
41
29
 
42
30
  @if $usx-checkable-border {
43
31
  box-shadow: 0 0 0 2px $usx-checkable-border;
@@ -55,9 +43,7 @@
55
43
  }
56
44
 
57
45
  &.usa-checkbox__input--tile + .usa-checkbox__label {
58
- @if $usx-color-primary {
59
- border-color: $usx-color-primary;
60
- }
46
+ border-color: usx-when($usx-color-primary);
61
47
  }
62
48
  }
63
49
  }
@@ -57,25 +57,17 @@
57
57
  .usx-clickable__color-on-hover {
58
58
  color: #005ea2;
59
59
 
60
- @if $usx-clickable-text-hover {
61
- color: $usx-clickable-text-hover;
62
- }
60
+ color: usx-when($usx-clickable-text-hover);
63
61
 
64
- @if $usx-color-primary {
65
- color: $usx-color-primary;
66
- }
62
+ color: usx-when($usx-color-primary);
67
63
  }
68
64
 
69
65
  .usx-clickable__bg-color-on-hover {
70
66
  background-color: #005ea2;
71
67
 
72
- @if $usx-clickable-text-hover {
73
- background-color: $usx-clickable-text-hover;
74
- }
68
+ background-color: usx-when($usx-clickable-text-hover);
75
69
 
76
- @if $usx-color-primary {
77
- background-color: $usx-color-primary;
78
- }
70
+ background-color: usx-when($usx-color-primary);
79
71
  }
80
72
  }
81
73
  }
@@ -14,14 +14,10 @@
14
14
  // (self-contained badge, same class applied directly to the <li>) and
15
15
  // must not inherit this muted text color over their own background.
16
16
  .usa-collection__meta-item:not(.usa-tag) {
17
- @if $usx-collection-meta-text {
18
- color: $usx-collection-meta-text;
19
- }
17
+ color: usx-when($usx-collection-meta-text);
20
18
  }
21
19
 
22
20
  .usa-collection__description {
23
- @if $usx-collection-description-text {
24
- color: $usx-collection-description-text;
25
- }
21
+ color: usx-when($usx-collection-description-text);
26
22
  }
27
23
  }
@@ -21,10 +21,8 @@
21
21
  // preset even though it's just the ordinary brand primary color (not a fixed
22
22
  // system gray) — chain it to the theme instead.
23
23
  .usa-combo-box__list-option--selected {
24
- @if $usx-combo-box-selected-bg {
25
- background-color: $usx-combo-box-selected-bg;
26
- border-color: $usx-combo-box-selected-bg;
27
- }
24
+ background-color: usx-when($usx-combo-box-selected-bg);
25
+ border-color: usx-when($usx-combo-box-selected-bg);
28
26
  }
29
27
 
30
28
  .usx-combo-box,
@@ -36,24 +34,14 @@
36
34
  padding-top: calc(0.5rem - 0.25rem);
37
35
  padding-bottom: calc(0.5rem - 0.25rem);
38
36
 
39
- @if $usx-input-error-border-width {
40
- border-width: $usx-input-error-border-width;
41
- }
37
+ border-width: usx-when($usx-input-error-border-width);
42
38
 
43
- @if $usx-input-error-border {
44
- border-color: $usx-input-error-border;
45
- }
39
+ border-color: usx-when($usx-input-error-border);
46
40
 
47
- @if $usx-input-error-border-style {
48
- border-style: $usx-input-error-border-style;
49
- }
41
+ border-style: usx-when($usx-input-error-border-style);
50
42
 
51
- @if $usx-input-error-padding-top {
52
- padding-top: $usx-input-error-padding-top;
53
- }
43
+ padding-top: usx-when($usx-input-error-padding-top);
54
44
 
55
- @if $usx-input-error-padding-bottom {
56
- padding-bottom: $usx-input-error-padding-bottom;
57
- }
45
+ padding-bottom: usx-when($usx-input-error-padding-bottom);
58
46
  }
59
47
  }