Skip to content

Commit c650f4f

Browse files
fix: fix color of disabled option description text (#5835)
* fix: fix color of disabled option description text * ci: fix test unit snapshots --------- Co-authored-by: Pierre <pbertinet@scaleway.com>
1 parent cb75383 commit c650f4f

File tree

3 files changed

+15
-16
lines changed

3 files changed

+15
-16
lines changed

.changeset/dry-tigers-speak.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@ultraviolet/ui": patch
3+
---
4+
5+
Fix color of disabled option description text

packages/ui/src/components/SelectInput/__tests__/__snapshots__/index.test.tsx.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5737,7 +5737,7 @@ exports[`selectInput > renders correctly with label on the right and optional in
57375737
Jupiter
57385738
</span>
57395739
<span
5740-
class="style__m4c9ow0 style_strikeThrough_false__m4c9ow2 style_italic_false__m4c9ow4 style_underline_false__m4c9ow6 style_oneLine_false__m4c9ow8 style_sentiment_neutral__m4c9owb style_prominence_weak__m4c9owl style_variant_bodySmall__m4c9own style_disabled_false__m4c9ow1b style_undefined_compound_27__m4c9ow23 style_undefined_compound_75__m4c9ow3f"
5740+
class="style__m4c9ow0 style_strikeThrough_false__m4c9ow2 style_italic_false__m4c9ow4 style_underline_false__m4c9ow6 style_oneLine_false__m4c9ow8 style_prominence_default__m4c9owi style_variant_bodySmall__m4c9own style_disabled_false__m4c9ow1b style_undefined_compound_72__m4c9ow3c"
57415741
style="--qabug40: left;"
57425742
>
57435743
Jupiter is the fifth planet from the Sun and the largest in the Solar System. It is a gas giant with a mass more than two and a half times that of all the other planets in the Solar System combined, and slightly less than one one-thousandth the mass of the Sun.
@@ -5967,7 +5967,7 @@ exports[`selectInput > renders correctly with label on the right and optional in
59675967
Earth
59685968
</span>
59695969
<span
5970-
class="style__m4c9ow0 style_strikeThrough_false__m4c9ow2 style_italic_false__m4c9ow4 style_underline_false__m4c9ow6 style_oneLine_false__m4c9ow8 style_sentiment_neutral__m4c9owb style_prominence_weak__m4c9owl style_variant_bodySmall__m4c9own style_disabled_false__m4c9ow1b style_undefined_compound_27__m4c9ow23 style_undefined_compound_75__m4c9ow3f"
5970+
class="style__m4c9ow0 style_strikeThrough_false__m4c9ow2 style_italic_false__m4c9ow4 style_underline_false__m4c9ow6 style_oneLine_false__m4c9ow8 style_prominence_default__m4c9owi style_variant_bodySmall__m4c9own style_disabled_false__m4c9ow1b style_undefined_compound_72__m4c9ow3c"
59715971
style="--qabug40: left;"
59725972
>
59735973
Our home planet
@@ -6029,7 +6029,7 @@ exports[`selectInput > renders correctly with label on the right and optional in
60296029
</div>
60306030
</span>
60316031
<span
6032-
class="style__m4c9ow0 style_strikeThrough_false__m4c9ow2 style_italic_false__m4c9ow4 style_underline_false__m4c9ow6 style_oneLine_false__m4c9ow8 style_sentiment_neutral__m4c9owb style_prominence_weak__m4c9owl style_variant_bodySmall__m4c9own style_disabled_false__m4c9ow1b style_undefined_compound_27__m4c9ow23 style_undefined_compound_75__m4c9ow3f"
6032+
class="style__m4c9ow0 style_strikeThrough_false__m4c9ow2 style_italic_false__m4c9ow4 style_underline_false__m4c9ow6 style_oneLine_false__m4c9ow8 style_prominence_default__m4c9owi style_variant_bodySmall__m4c9own style_disabled_false__m4c9ow1b style_undefined_compound_72__m4c9ow3c"
60336033
style="--qabug40: left;"
60346034
>
60356035
Pluto does not fit the usual classification of either terrestrial or Jovian planets, but is rocky
@@ -6209,7 +6209,7 @@ exports[`selectInput > renders correctly with label on the right and optional in
62096209
Jupiter
62106210
</span>
62116211
<span
6212-
class="style__m4c9ow0 style_strikeThrough_false__m4c9ow2 style_italic_false__m4c9ow4 style_underline_false__m4c9ow6 style_oneLine_false__m4c9ow8 style_sentiment_neutral__m4c9owb style_prominence_weak__m4c9owl style_variant_bodySmall__m4c9own style_disabled_false__m4c9ow1b style_undefined_compound_27__m4c9ow23 style_undefined_compound_75__m4c9ow3f"
6212+
class="style__m4c9ow0 style_strikeThrough_false__m4c9ow2 style_italic_false__m4c9ow4 style_underline_false__m4c9ow6 style_oneLine_false__m4c9ow8 style_prominence_default__m4c9owi style_variant_bodySmall__m4c9own style_disabled_false__m4c9ow1b style_undefined_compound_72__m4c9ow3c"
62136213
style="--qabug40: left;"
62146214
>
62156215
Jupiter is the fifth planet from the Sun and the largest in the Solar System. It is a gas giant with a mass more than two and a half times that of all the other planets in the Solar System combined, and slightly less than one one-thousandth the mass of the Sun.
@@ -6439,7 +6439,7 @@ exports[`selectInput > renders correctly with label on the right and optional in
64396439
Earth
64406440
</span>
64416441
<span
6442-
class="style__m4c9ow0 style_strikeThrough_false__m4c9ow2 style_italic_false__m4c9ow4 style_underline_false__m4c9ow6 style_oneLine_false__m4c9ow8 style_sentiment_neutral__m4c9owb style_prominence_weak__m4c9owl style_variant_bodySmall__m4c9own style_disabled_false__m4c9ow1b style_undefined_compound_27__m4c9ow23 style_undefined_compound_75__m4c9ow3f"
6442+
class="style__m4c9ow0 style_strikeThrough_false__m4c9ow2 style_italic_false__m4c9ow4 style_underline_false__m4c9ow6 style_oneLine_false__m4c9ow8 style_prominence_default__m4c9owi style_variant_bodySmall__m4c9own style_disabled_false__m4c9ow1b style_undefined_compound_72__m4c9ow3c"
64436443
style="--qabug40: left;"
64446444
>
64456445
Our home planet
@@ -6501,7 +6501,7 @@ exports[`selectInput > renders correctly with label on the right and optional in
65016501
</div>
65026502
</span>
65036503
<span
6504-
class="style__m4c9ow0 style_strikeThrough_false__m4c9ow2 style_italic_false__m4c9ow4 style_underline_false__m4c9ow6 style_oneLine_false__m4c9ow8 style_sentiment_neutral__m4c9owb style_prominence_weak__m4c9owl style_variant_bodySmall__m4c9own style_disabled_false__m4c9ow1b style_undefined_compound_27__m4c9ow23 style_undefined_compound_75__m4c9ow3f"
6504+
class="style__m4c9ow0 style_strikeThrough_false__m4c9ow2 style_italic_false__m4c9ow4 style_underline_false__m4c9ow6 style_oneLine_false__m4c9ow8 style_prominence_default__m4c9owi style_variant_bodySmall__m4c9own style_disabled_false__m4c9ow1b style_undefined_compound_72__m4c9ow3c"
65056505
style="--qabug40: left;"
65066506
>
65076507
Pluto does not fit the usual classification of either terrestrial or Jovian planets, but is rocky

packages/ui/src/components/SelectInput/components/DropdownOption.tsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export const DisplayOption = ({
5050
as="span"
5151
placement="left"
5252
prominence="weak"
53-
sentiment="neutral"
53+
sentiment={option.disabled ? undefined : 'neutral'}
5454
variant="bodySmall"
5555
>
5656
{option.description}
@@ -87,13 +87,7 @@ export const DisplayOption = ({
8787
{option.label}
8888
</Text>
8989
{option.description ? (
90-
<Text
91-
as="span"
92-
placement="left"
93-
prominence="weak"
94-
sentiment="neutral"
95-
variant="bodySmall"
96-
>
90+
<Text as="span" placement="left" variant="bodySmall">
9791
{option.description}
9892
</Text>
9993
) : null}
@@ -136,7 +130,7 @@ export const DisplayOption = ({
136130
as="span"
137131
placement="left"
138132
prominence="weak"
139-
sentiment="neutral"
133+
sentiment={option.disabled ? undefined : 'neutral'}
140134
variant="bodySmall"
141135
>
142136
{option.description}
@@ -179,7 +173,7 @@ export const DisplayOption = ({
179173
as="span"
180174
placement="left"
181175
prominence="weak"
182-
sentiment="neutral"
176+
sentiment={option.disabled ? undefined : 'neutral'}
183177
variant="bodySmall"
184178
>
185179
{option.description}

0 commit comments

Comments
 (0)