Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
5ba857c
fix: merged checkbox fixes from spectrum-css for WHCM
jnurthen Nov 12, 2021
1c01b22
fix: WHCM for menu
jnurthen Nov 13, 2021
1cbc0ea
fix: WHCM fixes for textfield
jnurthen Nov 13, 2021
3d9b038
fix: WHCM for switch
jnurthen Nov 18, 2021
43b053e
fix: WHCM checkbox - more fixes
jnurthen Nov 25, 2021
984793b
fix: WHCM radioGroup
jnurthen Nov 25, 2021
71fbb79
fix: WHCM slider
jnurthen Nov 25, 2021
1aa3afa
fix: WHCM stepper
jnurthen Nov 25, 2021
b0ba6fc
fix: merged checkbox fixes from spectrum-css for WHCM
jnurthen Nov 12, 2021
ccffaf7
fix: WHCM for menu
jnurthen Nov 13, 2021
138b2c4
fix: WHCM fixes for textfield
jnurthen Nov 13, 2021
72a7654
fix: WHCM for switch
jnurthen Nov 18, 2021
8d74956
fix: WHCM checkbox - more fixes
jnurthen Nov 25, 2021
8c79395
fix: WHCM radioGroup
jnurthen Nov 25, 2021
bb33844
fix: WHCM slider
jnurthen Nov 25, 2021
92b7504
fix: WHCM stepper
jnurthen Nov 25, 2021
6a16ca6
Merge branch 'WHCM-inputs' of https://github.com/jnurthen/react-spect…
jnurthen Feb 9, 2022
7703542
Add calendar WHCM
jnurthen Feb 10, 2022
f45332b
Add InputGroup WHCM
jnurthen Feb 10, 2022
f7cda1f
Add Color Controls WHCM
jnurthen Feb 10, 2022
a7f7d39
fix linter
jnurthen Feb 10, 2022
e572c56
fix: Picker WHCM
jnurthen Feb 11, 2022
78b6f4c
fix: add WHCM checkbox story
jnurthen Feb 12, 2022
ab8cd95
Merge branch 'main' into WHCM-inputs
snowystinger Feb 16, 2022
26121dc
fix: update WHCM combo/menu/picker
jnurthen Feb 17, 2022
15c8429
fix: add hover style for today
jnurthen Mar 17, 2022
1b3cb8a
fix: remove comment from radio
jnurthen Mar 18, 2022
4f629a7
fix: indents in inputgroup
jnurthen Mar 18, 2022
acd7ce3
fix: textfield border on hover in WHCM
jnurthen Mar 18, 2022
c3a89fa
fix: switch review comments WHCM
jnurthen Mar 18, 2022
38acf7c
fix: stepper fixes from review comments
jnurthen Mar 19, 2022
e873aab
fix: inputgroup, picker, menu review comments
jnurthen Mar 21, 2022
c326a87
Merge branch 'main' into WHCM-inputs
LFDanLu Apr 18, 2022
fafdfb2
remove focus colour for colorhandle
jnurthen Jun 7, 2022
b4b6d7f
add focus on cells within dateFields
jnurthen Jun 8, 2022
250c061
Merge branch 'main' into WHCM-inputs
jnurthen Jun 8, 2022
2652796
Merge branch 'main' into WHCM-inputs
jnurthen Jun 8, 2022
9ef0248
fix placeholder for dropdown
jnurthen Jun 8, 2022
75b1a32
Merge branch 'main' into WHCM-inputs
Jun 16, 2022
f041a65
add focus overrides for readonly & placeholder
jnurthen Jun 16, 2022
06d95f1
fix: unavailable today date was invisible
jnurthen Jun 24, 2022
e29d077
fix slider down state
jnurthen Jun 27, 2022
26a3d97
Fix quiet combobox
jnurthen Jun 27, 2022
6726f83
Add invalid colours
jnurthen Jun 30, 2022
d90330e
ColorArea should have forced-color-adjust: none
Jun 30, 2022
3930fec
fix: combobox/picker/date/textfield hover/active style
jnurthen Jul 1, 2022
de82ec6
Merge branch 'WHCM-inputs' of https://github.com/jnurthen/react-spect…
jnurthen Jul 1, 2022
c0c88ac
Merge branch 'main' into WHCM-inputs
LFDanLu Jul 13, 2022
23fe1e0
Merge branch 'main' into WHCM-inputs
LFDanLu Jul 18, 2022
0ee5bc5
Merge branch 'main' into WHCM-inputs
LFDanLu Jul 18, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions packages/@adobe/spectrum-css-temp/components/button/skin.css
Original file line number Diff line number Diff line change
Expand Up @@ -1337,6 +1337,8 @@ governing permissions and limitations under the License.
--spectrum-logicbutton-or-text-color: ButtonText;
--spectrum-button-primary-focus-ring-color-key-focus: CanvasText;
--spectrum-button-primary-focus-ring-size-key-focus: 3px;
--spectrum-dropdown-border-color-key-focus: Highlight;

}

.spectrum-Button--overBackground {
Expand Down Expand Up @@ -1371,4 +1373,16 @@ governing permissions and limitations under the License.
--spectrum-actionbutton-emphasized-icon-color-key-focus: HighlightText;
}
}
.spectrum-FieldButton {
&:focus-ring,
&.is-focused {
&:not(.spectrum-FieldButton--quiet) {
outline:2px solid Highlight;
}
&.spectrum-FieldButton--quiet {
forced-color-adjust: none;
box-shadow: 0 2px 0 0 var(--spectrum-dropdown-border-color-key-focus);
}
}
}
}
55 changes: 55 additions & 0 deletions packages/@adobe/spectrum-css-temp/components/calendar/skin.css
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,58 @@ governing permissions and limitations under the License.
}
}
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noticed the following when testing the Calendar/DateRangePicker WHCM. Lemme know if these are as expected due to color limitations or if they aren't/won't be handled in this PR:

  1. Can't see that the user is currently focused on the datepicker button:
    focusOnButton
    vs

image

  1. The current date (aka the 24th) styling is overridden when the range includes it
    currentDayInRange
    vs

image

  1. The invalid colors are inconsistent between the date range, the validation icons, and the border/focus ring of the input field. The invalid color in the calendar in particular are hard to see on the black blackground (perhaps a limitation of WHCM theming since there isn't an error color?)
    Invalid
    vs

image

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Working on this.
  2. I think this is an acceptable compromise. With limited colours knowing today is optional IMO. The colour in the default scheme doesn't meet WCAG so if we insist knowing today is required then we need to fix outside high contrast mode too.
  3. These variables were introduced after I created this PR. I'm adding these new invalid variables which will look identical to a selection. The error message is the way you tell that there is an error

@media (forced-colors: active) {
.spectrum-Calendar-date {
color: CanvasText;
forced-color-adjust: none;
--spectrum-calendar-button-icon-color: ButtonText;
--spectrum-calendar-day-background-color-cap-selected: Highlight;
--spectrum-calendar-day-background-color-cap-invalid-selected: Highlight;
--spectrum-calendar-day-background-color-cap-invalid-selected-down: Highlight;
--spectrum-calendar-day-background-color-cap-invalid-selected-hover: Highlight;
--spectrum-calendar-day-background-color-cap-selected-down: Highlight;
--spectrum-calendar-day-background-color-cap-selected-hover: Highlight;
--spectrum-calendar-day-background-color-disabled: ButtonFace;
--spectrum-calendar-day-background-color-down: ButtonFace;
--spectrum-calendar-day-background-color-hover: ButtonFace;
--spectrum-calendar-day-background-color-invalid-selected: Highlight;
--spectrum-calendar-day-background-color-selected-hover: Highlight;
--spectrum-calendar-day-background-color-selected: Highlight;
--spectrum-calendar-day-border-color-key-focus: ButtonText;
--spectrum-calendar-day-text-color-cap-selected: HighlightText;
--spectrum-calendar-day-text-color-cap-selected-hover: HighlightText;
--spectrum-calendar-day-text-color-disabled: GrayText;
--spectrum-calendar-day-text-color-hover: ButtonText;
--spectrum-calendar-day-text-color-selected-hover: HighlightText;
--spectrum-calendar-day-title-text-color: CanvasText;
--spectrum-calendar-day-today-background-color: ButtonText;
--spectrum-calendar-day-today-background-color-down: ButtonText;
--spectrum-calendar-day-today-background-color-hover: ButtonText;
--spectrum-calendar-day-today-text-color: ButtonFace;
&.is-range-selection {
color: HighlightText;
}
&.is-disabled {
&.is-range-selection {
background: Highlight;
color: HighlightText;
}

&.is-selected {
background: Highlight;
color: HighlightText;
}
}
&.is-unavailable {
&.is-today {
color: var(--spectrum-calendar-day-text-color-hover);
}
}
&:hover {
&.is-today {
color: var(--spectrum-calendar-day-today-text-color);
}
}
}
}
61 changes: 60 additions & 1 deletion packages/@adobe/spectrum-css-temp/components/checkbox/skin.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
Copyright 2019 Adobe. All rights reserved.
This file is licensed to you under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy
Expand Down Expand Up @@ -207,3 +207,62 @@ governing permissions and limitations under the License.
}
}
}
@media (forced-colors: active) {
.spectrum-Checkbox {
forced-color-adjust: none;
--spectrum-checkbox-box-border-color: ButtonText;
--spectrum-checkbox-box-border-color-error: Highlight;
--spectrum-checkbox-box-border-color-error-down: Highlight;
--spectrum-checkbox-box-border-color-error-hover: Highlight;
--spectrum-checkbox-box-border-color-key-focus: Highlight;
--spectrum-checkbox-checkmark-color: HighlightText;
--spectrum-checkbox-emphasized-box-background-color: ButtonFace;
--spectrum-checkbox-emphasized-box-background-color-disabled: ButtonFace;
--spectrum-checkbox-emphasized-box-border-color: ButtonText;
--spectrum-checkbox-emphasized-box-border-color-disabled: GrayText;
--spectrum-checkbox-emphasized-box-border-color-down: Highlight;
--spectrum-checkbox-emphasized-box-border-color-hover: Highlight;
--spectrum-checkbox-emphasized-box-border-color-selected: Highlight;
--spectrum-checkbox-emphasized-box-border-color-selected-down: Highlight;
--spectrum-checkbox-emphasized-box-border-color-selected-hover: Highlight;
--spectrum-checkbox-emphasized-box-border-color-selected-key-focus: Highlight;
--spectrum-checkbox-emphasized-text-color: FieldText;
--spectrum-checkbox-emphasized-text-color-down: FieldText;
--spectrum-checkbox-emphasized-text-color-hover: FieldText;
--spectrum-checkbox-emphasized-text-color-key-focus: FieldText;
--spectrum-checkbox-focus-ring-color-key-focus: ButtonText;
--spectrum-checkbox-quiet-box-border-color-selected: Highlight;
--spectrum-checkbox-quiet-box-border-color-selected-down: Highlight;
--spectrum-checkbox-quiet-box-border-color-selected-hover: Highlight;
--spectrum-checkbox-text-color: FieldText;
--spectrum-checkbox-text-color-disabled: GrayText;
--spectrum-checkbox-text-color-error: FieldText;
--spectrum-checkbox-text-color-error-down: FieldText;
--spectrum-checkbox-text-color-error-hover: FieldText;

&.is-invalid {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer if we can only override variables and not re-define selectors if possible. I think most of this seems unnecessary because the vars are already overridden above?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variables as defined assume the same border colour for :checked.
I don't think I can do this without modifying

.spectrum-Checkbox.is-invalid {
  /* Extra-specific selectors added here to handle checked state */
  .spectrum-Checkbox-input:checked + .spectrum-Checkbox-box,
  .spectrum-Checkbox-box {
    &:before {
      border-color: var(--spectrum-checkbox-box-border-color-error);
    }
  }

in lines 158-165 where the same colour is used for checked and unchecked.
I could add a new variable there and split that selector. Would that be better?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@devongovett is that the direction you would like me to go?

.spectrum-Checkbox-box {
&:before {
border-color: var(--spectrum-checkbox-box-border-color);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This conflicts with var(--spectrum-checkbox-box-border-color-error) above. Is the intended border color Highlight or ButtonText?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is intended to be ButtonText when unselected and Highlight when selected according to the XD
Checkbox (Windows high contrast mode) UI kit

}
}
&.is-indeterminate .spectrum-Checkbox-box {
&:before {
border-color: var(--spectrum-checkbox-box-border-color-error);
}
}
&.is-disabled .spectrum-Checkbox-input:checked + .spectrum-Checkbox-box {
&:before {
border-color: GrayText;
}
}
/* Extra-specific selectors added here to handle checked state */
.spectrum-Checkbox-input:checked + .spectrum-Checkbox-box
{
&:before {
border-color: var(--spectrum-checkbox-box-border-color-error);
}
}
}
}
}
11 changes: 6 additions & 5 deletions packages/@adobe/spectrum-css-temp/components/colorarea/skin.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,29 @@
.spectrum-ColorHandle-color {
forced-color-adjust: none;
}

.spectrum-ColorArea {
&.is-disabled {
background: var(--spectrum-colorarea-fill-color-disabled);

&:before {
box-shadow: inset 0 0 0 var(--spectrum-colorarea-border-size) var(--spectrum-colorarea-border-color-disabled);
}

.spectrum-ColorArea-gradient {
display: none;
}
}
}

@media (forced-colors: active) {
.spectrum-ColorArea {
--spectrum-colorarea-fill-color-disabled : GrayText;
}
.spectrum-ColorArea {
forced-color-adjust: none;
&.is-disabled {
forced-color-adjust: none;
}
}
}
}
10 changes: 10 additions & 0 deletions packages/@adobe/spectrum-css-temp/components/colorhandle/skin.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,13 @@
.spectrum-ColorHandle-color {
box-shadow: inset 0 0 0 var(--spectrum-colorhandle-outer-border-size) var(--spectrum-colorhandle-outer-border-color);
}

@media (forced-colors: active) {
.spectrum-ColorHandle {
forced-color-adjust: none;
--spectrum-colorhandle-inner-border-color-disabled: GrayText;
--spectrum-colorhandle-fill-color-disabled: GrayText;
--spectrum-colorhandle-inner-border-color: ButtonText;
--spectrum-colorhandle-outer-border-color: ButtonFace;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,11 @@
.spectrum-ColorLoupe-inner-checker {
fill: var(--spectrum-global-color-static-gray-500);
}

@media (forced-colors: active) {
.spectrum-ColorLoupe {
forced-color-adjust: none;
--spectrum-colorloupe-inner-border-color: ButtonText;
--spectrum-colorloupe-outer-border-color: ButtonFace;
}
}
10 changes: 10 additions & 0 deletions packages/@adobe/spectrum-css-temp/components/colorslider/skin.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,13 @@
margin: 0;
}
}

@media (forced-colors: active) {
.spectrum-ColorSlider {
forced-color-adjust: none;
--spectrum-colorslider-fill-color-disabled: GrayText;
--spectrum-colorslider-border-color-disabled: GrayText;
--spectrum-colorslider-border-color: ButtonText;
--spectrum-colorarea-border-color: ButtonText;
}
}
10 changes: 10 additions & 0 deletions packages/@adobe/spectrum-css-temp/components/colorwheel/skin.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,13 @@
border-color: var(--spectrum-colorwheel-border-color);
}
}

@media (forced-colors: active) {
.spectrum-ColorWheel {
forced-color-adjust: none;
--spectrum-colorwheel-fill-color-disabled: GrayText;
--spectrum-colorwheel-border-color-disabled: GrayText;
--spectrum-colorwheel-border-color: ButtonText;
--spectrum-colorarea-border-color: ButtonText;
}
}
32 changes: 30 additions & 2 deletions packages/@adobe/spectrum-css-temp/components/dropdown/skin.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ governing permissions and limitations under the License.
*/

.spectrum-Dropdown {
/* Override to gray-800 to meet WCAG */
--spectrum-dropdown-placeholder-text-color: var(--spectrum-global-color-gray-800);

.spectrum-Dropdown-trigger:hover {
.spectrum-Dropdown-chevron {
color: var(--spectrum-dropdown-icon-color-hover);
Expand Down Expand Up @@ -62,8 +65,7 @@ governing permissions and limitations under the License.

.spectrum-Dropdown-label {
&.is-placeholder {
/* Override to gray-800 to meet WCAG */
color: var(--spectrum-global-color-gray-800);
color: var(--spectrum-dropdown-placeholder-text-color);
}
}

Expand All @@ -85,3 +87,29 @@ governing permissions and limitations under the License.
color: var(--spectrum-dropdown-icon-color-key-focus)
}
}

@media (forced-colors: active) {
.spectrum-Dropdown {
--spectrum-dropdown-icon-color: ButtonText;
--spectrum-dropdown-icon-color-disabled: GrayText;
--spectrum-dropdown-icon-color-hover: ButtonText;
--spectrum-dropdown-icon-color-key-focus: ButtonText;
--spectrum-dropdown-placeholder-text-color: GrayText;
--spectrum-dropdown-placeholder-text-color-disabled: GrayText;
--spectrum-dropdown-placeholder-text-color-down: GrayText;
--spectrum-dropdown-placeholder-text-color-hover: GrayText;
--spectrum-dropdown-placeholder-text-color-key-focus: GrayText;
--spectrum-dropdown-placeholder-text-color-mouse-focus: GrayText;
--spectrum-dropdown-text-color-disabled: GrayText;
--spectrum-dropdown-validation-icon-color-error: ButtonText;
}
/*Override the label behaviour when NOT a placeholder*/
.spectrum-Dropdown-trigger {
&:hover .spectrum-Dropdown-label {
color: ButtonText;
&.is-placeholder {
color: GrayText;
}
}
}
}
78 changes: 78 additions & 0 deletions packages/@adobe/spectrum-css-temp/components/inputgroup/skin.css
Original file line number Diff line number Diff line change
Expand Up @@ -217,3 +217,81 @@ governing permissions and limitations under the License.
}
}
}
@media (forced-colors: active) {
.spectrum-InputGroup {
--spectrum-dropdown-border-color-error: Highlight;
--spectrum-dropdown-border-color-key-focus: Highlight;
--spectrum-textfield-border-color-error: Highlight;
--spectrum-textfield-border-color-hover: Highlight;
--spectrum-textfield-border-color-key-focus: Highlight;
--spectrum-textfield-quiet-border-color: CanvasText;
--spectrum-textfield-quiet-border-color-disabled: GrayText;
--spectrum-textfield-quiet-border-color-hover: Highlight;
--spectrum-textfield-quiet-border-color-key-focus: Highlight;
--spectrum-textfield-text-color-disabled: GrayText;
forced-color-adjust: none;
.spectrum-InputGroup-input {
forced-color-adjust: auto;
}
.spectrum-FieldButton {
forced-color-adjust: auto;
}

&.is-disabled:not(.spectrum-InputGroup--invalid):not(.spectrum-InputGroup--quiet) .spectrum-FieldButton {
border-color: GrayText;
border-width: 1px;
}
}

.spectrum-InputGroup--quiet {
/*
specifically for readonly inputgroups that aren't disabled since the button will have the disabled class
but we don't want the border color to be the disabled quiet one
*/
&:not(.is-disabled) {
.spectrum-FieldButton {
&:disabled,
&:disabled:hover {
border-color: var(--spectrum-textfield-quiet-border-color);
}
}
}
&.is-disabled {
.spectrum-FieldButton {
border-color: GrayText;
}
}
}
.spectrum-InputGroup--invalid {
.spectrum-FieldButton {
border-color: Highlight;
}
&.is-disabled:not(.spectrum-InputGroup--quiet) .spectrum-InputGroup-input {
border-color: GrayText;
}
&.is-disabled {
&.spectrum-InputGroup--quiet .spectrum-InputGroup-input {
border-color: GrayText;
}
&.spectrum-InputGroup--quiet .spectrum-FieldButton {
border-color: GrayText;
}
}
&.is-disabled:not(.spectrum-InputGroup--quiet) .spectrum-FieldButton {
border-color: GrayText;
}
}

.spectrum-InputGroup {
&:focus-ring
{
&:not(.spectrum-InputGroup--quiet) {
outline:2px solid Highlight;
}
&.spectrum-InputGroup--quiet {
box-shadow: 0 2px 0 0 var(--spectrum-dropdown-border-color-key-focus);
}
}
}
}

Loading