Skip to content

Commit d829abb

Browse files
TarunAdoberise-erpeldingcastastrophe
authored
fix(search): update disabled state in spectrum two (#3593)
Co-authored-by: rise-erpelding <54716846+rise-erpelding@users.noreply.github.com> Co-authored-by: [ Cassondra ] <castastrophe@users.noreply.github.com>
1 parent 3ec3b46 commit d829abb

File tree

5 files changed

+21
-3
lines changed

5 files changed

+21
-3
lines changed

.changeset/four-phones-agree.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@spectrum-css/search": patch
3+
---
4+
5+
Updated `--spectrum-search-background-color-disabled` to `--spectrum-gray-25` and `--spectrum-search-border-color-disabled` to `--spectrum-gray-300` for the S2 foundations contexts.
6+
7+
Also defines disabled quiet border and background colors (`--system-search-quiet-background-color-disabled` and `--system-search-quiet-border-color-disabled`) in order to maintain disabled quiet styling.

components/search/dist/metadata.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@
118118
"--spectrum-component-top-to-text-100",
119119
"--spectrum-corner-radius-100",
120120
"--spectrum-default-font-style",
121-
"--spectrum-disabled-background-color",
122121
"--spectrum-disabled-border-color",
123122
"--spectrum-disabled-content-color",
124123
"--spectrum-field-edge-to-visual-quiet",
@@ -127,6 +126,7 @@
127126
"--spectrum-focus-indicator-gap",
128127
"--spectrum-focus-indicator-thickness",
129128
"--spectrum-gray-25",
129+
"--spectrum-gray-300",
130130
"--spectrum-gray-500",
131131
"--spectrum-gray-600",
132132
"--spectrum-gray-800",
@@ -151,13 +151,17 @@
151151
],
152152
"system-theme": [
153153
"--system-search-background-color",
154+
"--system-search-background-color-disabled",
154155
"--system-search-border-color-default",
156+
"--system-search-border-color-disabled",
155157
"--system-search-border-color-focus",
156158
"--system-search-border-color-focus-hover",
157159
"--system-search-border-color-hover",
158160
"--system-search-border-color-key-focus",
159161
"--system-search-border-radius",
160162
"--system-search-edge-to-visual",
163+
"--system-search-quiet-background-color-disabled",
164+
"--system-search-quiet-border-color-disabled",
161165
"--system-search-size-l-border-radius",
162166
"--system-search-size-l-edge-to-visual",
163167
"--system-search-size-m-border-radius",

components/search/index.css

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@
4848

4949
/* Disabled */
5050
--spectrum-search-color-disabled: var(--spectrum-disabled-content-color);
51-
--spectrum-search-background-color-disabled: var(--spectrum-disabled-background-color);
52-
--spectrum-search-border-color-disabled: var(--spectrum-disabled-background-color);
5351

5452
/* @passthrough start -- settings for nested Textfield component */
5553
--mod-textfield-font-family: var(--mod-search-font-family, var(--spectrum-search-font-family));

components/search/themes/spectrum-two.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
--spectrum-search-border-color-key-focus: var(--spectrum-gray-900);
2121

2222
--spectrum-search-background-color: var(--spectrum-gray-25);
23+
--spectrum-search-background-color-disabled: var(--spectrum-gray-25);
24+
--spectrum-search-border-color-disabled: var(--spectrum-gray-300);
2325

2426
&,
2527
&.spectrum-Search--sizeM {
@@ -42,4 +44,9 @@
4244
--spectrum-search-edge-to-visual: var(--spectrum-component-edge-to-visual-300);
4345
}
4446
}
47+
48+
.spectrum-Search--quiet {
49+
--spectrum-search-background-color-disabled: transparent;
50+
--spectrum-search-border-color-disabled: var(--spectrum-disabled-border-color);
51+
}
4552
}

components/search/themes/spectrum.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
@container style(--system: legacy) {
1919
.spectrum-Search {
20+
--spectrum-search-background-color-disabled: var(--spectrum-disabled-background-color);
21+
--spectrum-search-border-color-disabled: var(--spectrum-disabled-background-color);
2022
--spectrum-search-background-color: var(--spectrum-gray-50);
2123
}
2224
}

0 commit comments

Comments
 (0)