@solexllc/usx 0.1.0

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 (76) hide show
  1. package/README.md +45 -0
  2. package/package.json +45 -0
  3. package/src/_utilities.scss +146 -0
  4. package/src/components/_accordion.scss +110 -0
  5. package/src/components/_alert.scss +156 -0
  6. package/src/components/_attribution.scss +40 -0
  7. package/src/components/_avatar-group.scss +50 -0
  8. package/src/components/_avatar.scss +63 -0
  9. package/src/components/_banner.scss +30 -0
  10. package/src/components/_block.scss +105 -0
  11. package/src/components/_branding.scss +89 -0
  12. package/src/components/_breadcrumb.scss +35 -0
  13. package/src/components/_button-group.scss +50 -0
  14. package/src/components/_button.scss +250 -0
  15. package/src/components/_calendar-date.scss +50 -0
  16. package/src/components/_carousel.scss +142 -0
  17. package/src/components/_character-count.scss +12 -0
  18. package/src/components/_checkbox.scss +68 -0
  19. package/src/components/_clickable.scss +81 -0
  20. package/src/components/_code.scss +76 -0
  21. package/src/components/_collection.scss +27 -0
  22. package/src/components/_combobox.scss +59 -0
  23. package/src/components/_copy-to-clipboard.scss +46 -0
  24. package/src/components/_date-picker.scss +58 -0
  25. package/src/components/_eyebrow.scss +10 -0
  26. package/src/components/_file-input.scss +254 -0
  27. package/src/components/_focus.scss +24 -0
  28. package/src/components/_footer.scss +185 -0
  29. package/src/components/_form-group.scss +32 -0
  30. package/src/components/_header.scss +441 -0
  31. package/src/components/_hero.scss +149 -0
  32. package/src/components/_icon-list.scss +23 -0
  33. package/src/components/_icon.scss +18 -0
  34. package/src/components/_image.scss +80 -0
  35. package/src/components/_in-page-nav.scss +74 -0
  36. package/src/components/_indicator.scss +73 -0
  37. package/src/components/_input.scss +135 -0
  38. package/src/components/_language-selector.scss +26 -0
  39. package/src/components/_layout.scss +115 -0
  40. package/src/components/_link.scss +63 -0
  41. package/src/components/_list.scss +4 -0
  42. package/src/components/_misc-banner.scss +143 -0
  43. package/src/components/_modal.scss +47 -0
  44. package/src/components/_page.scss +28 -0
  45. package/src/components/_pagination.scss +202 -0
  46. package/src/components/_process-list.scss +35 -0
  47. package/src/components/_prose.scss +1 -0
  48. package/src/components/_radio-buttons.scss +66 -0
  49. package/src/components/_range-slider.scss +117 -0
  50. package/src/components/_required.scss +7 -0
  51. package/src/components/_search.scss +10 -0
  52. package/src/components/_section.scss +26 -0
  53. package/src/components/_select.scss +112 -0
  54. package/src/components/_sidenav.scss +74 -0
  55. package/src/components/_site-alert.scss +75 -0
  56. package/src/components/_spinner.scss +25 -0
  57. package/src/components/_status.scss +46 -0
  58. package/src/components/_step-indicator.scss +130 -0
  59. package/src/components/_summary-box.scss +42 -0
  60. package/src/components/_swap.scss +151 -0
  61. package/src/components/_switch.scss +108 -0
  62. package/src/components/_table.scss +330 -0
  63. package/src/components/_tag-group.scss +9 -0
  64. package/src/components/_tag.scss +47 -0
  65. package/src/components/_task-list.scss +75 -0
  66. package/src/components/_text-area.scss +87 -0
  67. package/src/components/_theme-picker.scss +60 -0
  68. package/src/components/_time-picker.scss +1 -0
  69. package/src/components/_toggle.scss +34 -0
  70. package/src/components/_tooltip.scss +73 -0
  71. package/src/components/_typography.scss +145 -0
  72. package/src/icons/spinner.svg +14 -0
  73. package/src/img/usx-icons.json +5 -0
  74. package/src/img/usx-sprite.svg +24 -0
  75. package/src/index.scss +67 -0
  76. package/src/themed.scss +11 -0
@@ -0,0 +1,12 @@
1
+ @use 'pkg:@solexllc/usx-theme/variables' as *;
2
+
3
+ /* stylelint-disable selector-class-pattern -- Public USX classes use BEM naming. */
4
+ // Character count mostly inherits styles from the components it's composed of
5
+ // (form-group, input/textarea, hint). The one USWDS style it doesn't inherit
6
+ // is the invalid-count status message, so that's the only override here.
7
+ .usx-character-count {
8
+ .usa-character-count__status.usa-character-count__status--invalid {
9
+ color: $usx-color-error;
10
+ font-weight: $usx-font-weight-bold;
11
+ }
12
+ }
@@ -0,0 +1,68 @@
1
+ @use 'pkg:@solexllc/usx-theme/variables' as *;
2
+
3
+ /* stylelint-disable selector-class-pattern -- Public USX classes use BEM naming. */
4
+ .usa-checkbox__label {
5
+ @if $usx-text-ink {
6
+ color: $usx-text-ink;
7
+ }
8
+ }
9
+
10
+ .usa-checkbox__input--tile + .usa-checkbox__label {
11
+ @if $usx-surface-1 {
12
+ background-color: $usx-surface-1;
13
+ }
14
+ }
15
+
16
+ .usx-checkbox {
17
+ @if $usx-checkable-tile-radius {
18
+ .usa-checkbox__input--tile + .usa-checkbox__label {
19
+ border-radius: $usx-checkable-tile-radius;
20
+ }
21
+ }
22
+
23
+ .usa-checkbox__input--tile + .usa-checkbox__label {
24
+ @if $usx-checkable-tile-border {
25
+ border-color: $usx-checkable-tile-border;
26
+ }
27
+
28
+ @if $usx-checkable-tile-border-width {
29
+ border-width: $usx-checkable-tile-border-width;
30
+ }
31
+ }
32
+
33
+ .usa-checkbox__label::before {
34
+ @if $usx-checkable-radius {
35
+ border-radius: $usx-checkable-radius;
36
+ }
37
+
38
+ @if $usx-checkable-bg {
39
+ background-color: $usx-checkable-bg;
40
+ }
41
+
42
+ @if $usx-checkable-border {
43
+ box-shadow: 0 0 0 2px $usx-checkable-border;
44
+ }
45
+ }
46
+
47
+ .usa-checkbox__input:checked:not(:disabled) {
48
+ & + .usa-checkbox__label {
49
+ @if $usx-color-primary {
50
+ &::before {
51
+ background-color: $usx-color-primary;
52
+ box-shadow: 0 0 0 2px $usx-color-primary;
53
+ }
54
+ }
55
+ }
56
+
57
+ &.usa-checkbox__input--tile + .usa-checkbox__label {
58
+ @if $usx-color-primary {
59
+ border-color: $usx-color-primary;
60
+ }
61
+ }
62
+ }
63
+ }
64
+
65
+ .usx-checkbox.usx-checkbox--small .usa-checkbox__label::before {
66
+ height: 1.125rem;
67
+ width: 1.125rem;
68
+ }
@@ -0,0 +1,81 @@
1
+ @use 'pkg:@solexllc/usx-theme/variables' as *;
2
+
3
+ /* stylelint-disable selector-class-pattern -- Public USX classes use BEM naming. */
4
+ .usx-clickable {
5
+ text-decoration: none;
6
+ color: currentcolor;
7
+ overflow: wrap;
8
+
9
+ .usx-clickable__link {
10
+ position: relative;
11
+ width: fit-content;
12
+ height: fit-content;
13
+ text-wrap: nowrap;
14
+
15
+ &::after {
16
+ content: '';
17
+ position: absolute;
18
+ left: 0;
19
+ right: 0;
20
+ bottom: 0;
21
+ height: 1px;
22
+ background-color: currentcolor;
23
+ transform: scaleX(0);
24
+ transform-origin: left center;
25
+ transition: transform 0.25s ease-in-out;
26
+ pointer-events: none;
27
+ }
28
+ }
29
+
30
+ &:hover {
31
+ .usx-clickable__link::after {
32
+ transform: scaleX(1);
33
+ }
34
+ }
35
+
36
+ &:focus {
37
+ background-color: color-mix(in oklab, #2491ff 20%, transparent);
38
+
39
+ @if $usx-clickable-focus {
40
+ background-color: color-mix(in oklab, $usx-clickable-focus 20%, transparent);
41
+ }
42
+
43
+ .usx-clickable__link {
44
+ text-decoration: underline;
45
+ text-decoration-thickness: 1px;
46
+ text-underline-offset: 2px;
47
+
48
+ &::after {
49
+ transition: none;
50
+ transform: scaleX(1);
51
+ height: 2px;
52
+ }
53
+ }
54
+ }
55
+
56
+ &:hover, &:focus {
57
+ .usx-clickable__color-on-hover {
58
+ color: #005ea2;
59
+
60
+ @if $usx-clickable-text-hover {
61
+ color: $usx-clickable-text-hover;
62
+ }
63
+
64
+ @if $usx-color-primary {
65
+ color: $usx-color-primary;
66
+ }
67
+ }
68
+
69
+ .usx-clickable__bg-color-on-hover {
70
+ background-color: #005ea2;
71
+
72
+ @if $usx-clickable-text-hover {
73
+ background-color: $usx-clickable-text-hover;
74
+ }
75
+
76
+ @if $usx-color-primary {
77
+ background-color: $usx-color-primary;
78
+ }
79
+ }
80
+ }
81
+ }
@@ -0,0 +1,76 @@
1
+ @use 'pkg:@solexllc/usx-theme/variables' as *;
2
+
3
+ /* stylelint-disable selector-class-pattern -- Public USX classes use BEM naming. */
4
+ .usx-mockup-code {
5
+ border-radius: $usx-code-radius;
6
+ overflow: hidden;
7
+ padding: 2.5rem 0 0.75rem;
8
+ position: relative;
9
+ font-size: $usx-code-font-size;
10
+ line-height: $usx-line-height-base;
11
+
12
+ &:not([class^="bg-"]):not([class*=" bg-"]) {
13
+ background-color: black;
14
+ }
15
+
16
+ &:not([class^="text-"]):not([class*=" text-"]) {
17
+ color: white;
18
+ }
19
+
20
+ &::before {
21
+ position: absolute;
22
+ top: 1rem;
23
+ content: '';
24
+ color: white;
25
+ margin-bottom: 1rem;
26
+ display: block;
27
+ height: .75rem;
28
+ width: .75rem;
29
+ border-radius: 100%;
30
+ opacity: .3;
31
+ box-shadow: 1.25em 0, 2.75em 0, 4.25em 0;
32
+ }
33
+
34
+ .usx-mockup-code__content {
35
+ overflow: scroll;
36
+ padding-bottom: 0.5rem;
37
+
38
+ pre {
39
+ padding: 0;
40
+ margin: 0;
41
+ width: 100%;
42
+
43
+ &::before {
44
+ content: '';
45
+ margin-right: 2ch;
46
+ }
47
+
48
+ &[data-prefix] {
49
+ &::before {
50
+ content: attr(data-prefix);
51
+ display: inline-block;
52
+ width: 2rem;
53
+ text-align: right;
54
+ opacity: .6;
55
+ }
56
+ }
57
+
58
+ code {
59
+ padding-right: 1.25rem;
60
+ }
61
+ }
62
+
63
+ }
64
+
65
+ .usx-copy {
66
+ position: absolute;
67
+ top: .5rem;
68
+ right: .5rem;
69
+ opacity: .6;
70
+ transition: opacity 0.2s;
71
+
72
+ &:hover {
73
+ opacity: 1;
74
+ }
75
+ }
76
+ }
@@ -0,0 +1,27 @@
1
+ /* stylelint-disable selector-class-pattern -- Public USX classes use BEM naming. */
2
+
3
+ @use 'pkg:@solexllc/usx-theme/variables' as *;
4
+
5
+ .usx-collection {
6
+ .usx-calendar-date {
7
+ margin-right: 1rem;
8
+ }
9
+
10
+ // Real USWDS never sets a color on meta/description — they just inherit
11
+ // ambient text, which doesn't reliably flip with a themed surface (the
12
+ // heading link is already themed separately via .usx-link). Excludes
13
+ // .usa-tag: tag meta items carry their own opaque bg/text pairing
14
+ // (self-contained badge, same class applied directly to the <li>) and
15
+ // must not inherit this muted text color over their own background.
16
+ .usa-collection__meta-item:not(.usa-tag) {
17
+ @if $usx-collection-meta-text {
18
+ color: $usx-collection-meta-text;
19
+ }
20
+ }
21
+
22
+ .usa-collection__description {
23
+ @if $usx-collection-description-text {
24
+ color: $usx-collection-description-text;
25
+ }
26
+ }
27
+ }
@@ -0,0 +1,59 @@
1
+ @use 'pkg:@solexllc/usx-theme/variables' as *;
2
+
3
+ /* stylelint-disable selector-class-pattern -- Public USX classes use BEM naming. */
4
+
5
+ // Real USWDS's compiled CSS only pins a hardcoded ink color on
6
+ // `.usa-combo-box__input` (via the shared %block-input-styles placeholder);
7
+ // the dropdown list/options never get their own `color`, relying on the
8
+ // assumption that inherited/ambient text color is always dark. That holds in
9
+ // real USWDS (no runtime theme switching) but breaks under our dark presets,
10
+ // which flip ambient text to a light color while the list keeps its
11
+ // permanently-white background (same "form controls don't flip surfaces"
12
+ // convention as $usx-input-bg/-text/-border, both always null) — making
13
+ // options illegible. Pin the same ink color the input already gets so list
14
+ // text stays legible under every preset.
15
+ .usa-combo-box__list {
16
+ color: #1b1b1b;
17
+ }
18
+
19
+ // Real USWDS's compiled CSS hardcodes the selected-option highlight to a
20
+ // literal `color("primary")`, so it stayed USWDS default blue under every
21
+ // preset even though it's just the ordinary brand primary color (not a fixed
22
+ // system gray) — chain it to the theme instead.
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
+ }
28
+ }
29
+
30
+ .usx-combo-box,
31
+ .usx-time-picker {
32
+ &.usx-combo-box--error .usa-combo-box__input {
33
+ border-width: 0.25rem;
34
+ border-color: #b50909;
35
+ border-style: solid;
36
+ padding-top: calc(0.5rem - 0.25rem);
37
+ padding-bottom: calc(0.5rem - 0.25rem);
38
+
39
+ @if $usx-input-error-border-width {
40
+ border-width: $usx-input-error-border-width;
41
+ }
42
+
43
+ @if $usx-input-error-border {
44
+ border-color: $usx-input-error-border;
45
+ }
46
+
47
+ @if $usx-input-error-border-style {
48
+ border-style: $usx-input-error-border-style;
49
+ }
50
+
51
+ @if $usx-input-error-padding-top {
52
+ padding-top: $usx-input-error-padding-top;
53
+ }
54
+
55
+ @if $usx-input-error-padding-bottom {
56
+ padding-bottom: $usx-input-error-padding-bottom;
57
+ }
58
+ }
59
+ }
@@ -0,0 +1,46 @@
1
+ @use 'pkg:@solexllc/usx-theme/variables' as *;
2
+
3
+ /* stylelint-disable selector-class-pattern -- Public USX classes use BEM naming. */
4
+ .usx-copy {
5
+ padding: .5rem;
6
+ gap: 0;
7
+ width: auto;
8
+
9
+ &.usx-copy--dark {
10
+ color: white !important;
11
+ }
12
+
13
+ &:hover {
14
+ background-color: color-mix(in oklab, currentColor 30%, #0000);
15
+ }
16
+
17
+ .usx-copy__check {
18
+ display: none;
19
+ }
20
+
21
+ &:focus:not(:focus-visible) {
22
+ .usx-copy__copy {
23
+ display: none;
24
+ }
25
+
26
+ .usx-copy__check {
27
+ display: inline-flex;
28
+ }
29
+ }
30
+ }
31
+
32
+ .usx-tooltip {
33
+ .usx-copy__tooltip--copied {
34
+ display: none !important;
35
+ }
36
+
37
+ &:has(.usx-copy:focus:not(:focus-visible)) {
38
+ .usx-copy__tooltip--copy {
39
+ display: none !important;
40
+ }
41
+
42
+ .usx-copy__tooltip--copied {
43
+ display: block !important;
44
+ }
45
+ }
46
+ }
@@ -0,0 +1,58 @@
1
+ @use 'pkg:@solexllc/usx-theme/variables' as *;
2
+
3
+ .usx-date-picker {
4
+ &:has(
5
+ .usa-date-picker__button:hover,
6
+ .usa-date-picker__button:active,
7
+ .usa-date-picker__button:focus,
8
+ .usa-date-picker__button:focus-visible
9
+ ) {
10
+ .usa-date-picker__external-input {
11
+ border-top-right-radius: 0;
12
+ border-bottom-right-radius: 0;
13
+ }
14
+ }
15
+
16
+ &.usa-date-picker--active {
17
+ .usa-date-picker__external-input {
18
+ border-top-right-radius: 0;
19
+ border-bottom-right-radius: 0;
20
+ border-bottom-left-radius: 0;
21
+ }
22
+ }
23
+
24
+ // Calendar icon as an inline data URI (copied from USWDS's own
25
+ // usa-icons/calendar_today.svg). USWDS bakes this in as a fixed-color
26
+ // background-image at build time, so it can't track a runtime text-color
27
+ // override. Painting it on a pseudo-element via mask-image + background-color
28
+ // instead keeps it independent of the button's own background-color, which
29
+ // is used for the hover/active surface states below.
30
+ $usx-date-picker-button-icon: 'data:image/svg+xml,%3Csvg xmlns=\'http://www.w3.org/2000/svg\' width=\'24\' height=\'24\' viewBox=\'0 0 24 24\'%3E%3Cpath d=\'M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 18H4V8h16v13z\'/%3E%3C/svg%3E';
31
+
32
+ /* stylelint-disable selector-class-pattern -- Real USWDS classes, not USX BEM. */
33
+ .usa-date-picker__button {
34
+ @if $usx-date-picker-button-icon-color {
35
+ position: relative;
36
+ background-image: none !important;
37
+
38
+ &::before {
39
+ content: '';
40
+ position: absolute;
41
+ inset: 0;
42
+ margin: auto;
43
+ height: 1.5rem;
44
+ width: 1.5rem;
45
+ background-color: $usx-date-picker-button-icon-color;
46
+ mask: url("#{$usx-date-picker-button-icon}") center / 1.5rem no-repeat;
47
+ -webkit-mask: url("#{$usx-date-picker-button-icon}") center / 1.5rem no-repeat;
48
+ }
49
+ }
50
+
51
+ @if $usx-date-picker-button-hover-active-bg {
52
+ &:not([disabled]):hover,
53
+ &:not([disabled]):active {
54
+ background-color: $usx-date-picker-button-hover-active-bg;
55
+ }
56
+ }
57
+ }
58
+ }
@@ -0,0 +1,10 @@
1
+ @use 'pkg:@solexllc/usx-theme/variables' as *;
2
+
3
+ .usx-eyebrow {
4
+ display: block;
5
+ font-size: $usx-font-size-base;
6
+ font-style: normal;
7
+ font-weight: $usx-font-weight-regular;
8
+ color: $usx-text-subtle;
9
+ text-transform: uppercase;
10
+ }
@@ -0,0 +1,254 @@
1
+ @use 'pkg:@solexllc/usx-theme/variables' as *;
2
+
3
+ /* stylelint-disable selector-class-pattern -- Real USWDS classes, not USX BEM. */
4
+
5
+ /* ---------------------------------- */
6
+
7
+ /* Base Enhancements */
8
+
9
+ /* ---------------------------------- */
10
+
11
+ .usa-file-input__target {
12
+ @if $usx-input-radius {
13
+ border-radius: $usx-input-radius;
14
+ }
15
+
16
+ @if $usx-input-border {
17
+ border-color: $usx-input-border;
18
+ }
19
+ }
20
+
21
+ /* ---------------------------------- */
22
+
23
+ /* State Enhancements */
24
+
25
+ /* ---------------------------------- */
26
+
27
+ .usa-form-group--error .usa-file-input__target {
28
+ @if $usx-input-error-border {
29
+ border-color: $usx-input-error-border;
30
+ }
31
+
32
+ @if $usx-file-input-border-width {
33
+ border-width: $usx-file-input-border-width;
34
+ }
35
+ }
36
+
37
+ .usa-file-input__target.has-invalid-file {
38
+ // For some reason, they use accent warm here. Very odd.
39
+ @if $usx-color-accent-warm {
40
+ border-color: $usx-color-accent-warm;
41
+ }
42
+ }
43
+
44
+ // USWDS bakes this message to a fixed "secondary-dark" red (#b50909)
45
+ // regardless of theme — reuse the same error color as .usa-error-message.
46
+ .has-invalid-file .usa-file-input__accepted-files-message {
47
+ @if $usx-color-error {
48
+ color: $usx-color-error;
49
+ }
50
+ }
51
+
52
+ /* ---------------------------------- */
53
+
54
+ /* Theme Corrections */
55
+
56
+ /* ---------------------------------- */
57
+
58
+ @if $usx-file-input-border {
59
+ .usa-file-input__target {
60
+ border-color: $usx-file-input-border;
61
+ }
62
+ }
63
+
64
+ @if $usx-file-input-border-width {
65
+ .usa-file-input__target {
66
+ border-width: $usx-file-input-border-width;
67
+ }
68
+ }
69
+
70
+ // USWDS bakes the dropzone's idle background and instructions text to fixed
71
+ // light-mode colors (#fff / #454545), so a white box otherwise shows through
72
+ // on dark themes regardless of surrounding surface/text tokens.
73
+ @if $usx-surface-2 {
74
+ .usa-file-input__box {
75
+ background-color: $usx-surface-2;
76
+ }
77
+ }
78
+
79
+ @if $usx-text-ink {
80
+ .usa-file-input__instructions {
81
+ color: $usx-text-ink;
82
+ }
83
+ }
84
+
85
+ // USWDS bakes the "N files selected" heading and each preview row to a
86
+ // fixed "primary-lighter" background with default body text, regardless of
87
+ // theme — same callout role as the accordion button/banner backgrounds.
88
+ @if $usx-file-input-preview-bg {
89
+ .usa-file-input__preview-heading,
90
+ .usa-file-input__preview {
91
+ background-color: $usx-file-input-preview-bg;
92
+ }
93
+ }
94
+
95
+ @if $usx-file-input-preview-text {
96
+ .usa-file-input__preview-heading,
97
+ .usa-file-input__preview {
98
+ color: $usx-file-input-preview-text;
99
+ }
100
+ }
101
+
102
+ // USWDS bakes the "choose from folder" text to a fixed link-blue (#005ea2),
103
+ // so it doesn't track a themed link color otherwise — reuse the same
104
+ // usx-link variables/states rather than introducing a separate token.
105
+ .usa-file-input__choose {
106
+ @if $usx-link-text {
107
+ color: $usx-link-text;
108
+ }
109
+
110
+ &:hover {
111
+ @if $usx-link-text-hover {
112
+ color: $usx-link-text-hover;
113
+ }
114
+ }
115
+
116
+ &:active {
117
+ @if $usx-link-text-active {
118
+ color: $usx-link-text-active;
119
+ }
120
+ }
121
+
122
+ &:visited {
123
+ @if $usx-link-text-visited {
124
+ color: $usx-link-text-visited;
125
+ }
126
+ }
127
+ }
128
+
129
+ /* ---------------------------------- */
130
+
131
+ /* Managed-multiple file list */
132
+
133
+ /* (VA.gov-style per-file delete rows, see FileInput.jsx) */
134
+
135
+ /* ---------------------------------- */
136
+
137
+ .usx-file-input__file-list {
138
+ list-style: none;
139
+ margin: 0.5rem 0 1rem;
140
+ padding: 0;
141
+ max-width: 30rem;
142
+
143
+ .usx-file-input__file-name.usx-link {
144
+ display: inline-block;
145
+ }
146
+ }
147
+
148
+ .usx-file-input__file-item {
149
+ align-items: center;
150
+ border-style: solid;
151
+ display: flex;
152
+ gap: 0.5rem;
153
+ justify-content: space-between;
154
+ margin-bottom: 0.5rem;
155
+ padding: 0.5rem 1rem;
156
+
157
+ @if $usx-input-radius {
158
+ border-radius: $usx-input-radius;
159
+ }
160
+
161
+ @if $usx-file-input-item-border {
162
+ border-color: $usx-file-input-item-border;
163
+ }
164
+
165
+ @if $usx-file-input-item-border-width {
166
+ border-width: $usx-file-input-item-border-width;
167
+ }
168
+ }
169
+
170
+ // Info stays on the left and shrinks (long names wrap) so the Delete button
171
+ // on the right is never pushed out of view, even on small screens.
172
+ .usx-file-input__file-info {
173
+ display: flex;
174
+ flex: 1 1 auto;
175
+ flex-direction: column;
176
+ gap: 0.25rem;
177
+ min-width: 0;
178
+ overflow-wrap: anywhere;
179
+ }
180
+
181
+ .usx-file-input__file-name {
182
+ // A downloadable file's name renders as a Link (.usx-link), which sets
183
+ // `width: max-content` so it never stretches to fill a container — but
184
+ // that also stops it from ever wrapping, so a long name just overflows
185
+ // this row instead. `fit-content` still shrinks to wrap when needed,
186
+ // without stretching the link's clickable area for short names the way
187
+ // `auto` does.
188
+ width: fit-content;
189
+ }
190
+
191
+ .usx-file-input__file-size {
192
+ @if $usx-color-base {
193
+ color: $usx-color-base;
194
+ }
195
+ }
196
+
197
+ .usx-file-input__delete-button {
198
+ align-items: center;
199
+ display: inline-flex;
200
+ flex-shrink: 0;
201
+ gap: 0.5rem;
202
+ margin-right: 0;
203
+
204
+ // USWDS's base .usa-button is width:100% below its own tablet breakpoint
205
+ // (only reset to auto at tablet+) — override so this button always sizes
206
+ // to its content and never crowds out the file info next to it.
207
+ width: auto;
208
+ }
209
+
210
+ .usx-file-input__delete-icon {
211
+ display: none;
212
+ }
213
+
214
+ // Below tablet width the Delete button becomes icon-only (label is still
215
+ // present for assistive tech, just visually hidden) so it never crowds out
216
+ // the file name/size on narrow screens.
217
+ @include at-media('mobile') {
218
+ .usx-file-input__delete-button {
219
+ padding: 0.5rem;
220
+ }
221
+
222
+ .usx-file-input__delete-icon {
223
+ display: block;
224
+ }
225
+
226
+ .usx-file-input__delete-label {
227
+ border: 0;
228
+ clip: rect(0, 0, 0, 0);
229
+ height: 1px;
230
+ margin: -1px;
231
+ overflow: hidden;
232
+ padding: 0;
233
+ position: absolute;
234
+ white-space: nowrap;
235
+ width: 1px;
236
+ }
237
+ }
238
+
239
+ // The managed-multiple input is reset after every selection so it always
240
+ // looks empty/ready — but USWDS still builds its own preview UI (filename,
241
+ // thumbnail, "N files selected" heading) asynchronously, so it's suppressed
242
+ // here rather than relying on a reliably-timed reset.
243
+ .usx-file-input__add-only {
244
+ .usa-file-input__preview,
245
+ .usa-file-input__preview-heading,
246
+ .usa-file-input__accepted-files-message {
247
+ display: none !important;
248
+ }
249
+
250
+ .usa-file-input__instructions {
251
+ display: block !important;
252
+ }
253
+ }
254
+