Skip to content

chore: update dependency @spectrum-css/radio to v10.1.0 #5342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .changeset/stale-candies-camp.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
'@spectrum-web-components/dropzone': patch
'@spectrum-web-components/illustrated-message': patch
'@spectrum-web-components/menu': patch
'@spectrum-web-components/radio': patch
'@spectrum-web-components/status-light': patch
'@spectrum-web-components/styles': patch
'@spectrum-web-components/switch': patch
Expand Down
2 changes: 1 addition & 1 deletion packages/radio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"@spectrum-web-components/shared": "1.5.0"
},
"devDependencies": {
"@spectrum-css/radio": "10.0.0-s2-foundations.17"
"@spectrum-css/radio": "10.1.0"
},
"types": "./src/index.d.ts",
"customElements": "custom-elements.json",
Expand Down
180 changes: 0 additions & 180 deletions packages/radio/src/radio-overrides.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,187 +24,7 @@ governing permissions and limitations under the License.
--spectrum-radio-button-border-color-focus: var(
--system-radio-button-border-color-focus
);
--spectrum-radio-neutral-content-color: var(
--system-radio-neutral-content-color
);
--spectrum-radio-neutral-content-color-hover: var(
--system-radio-neutral-content-color-hover
);
--spectrum-radio-neutral-content-color-down: var(
--system-radio-neutral-content-color-down
);
--spectrum-radio-neutral-content-color-focus: var(
--system-radio-neutral-content-color-focus
);
--spectrum-radio-focus-indicator-thickness: var(
--system-radio-focus-indicator-thickness
);
--spectrum-radio-focus-indicator-gap: var(
--system-radio-focus-indicator-gap
);
--spectrum-radio-focus-indicator-color: var(
--system-radio-focus-indicator-color
);
--spectrum-radio-disabled-content-color: var(
--system-radio-disabled-content-color
);
--spectrum-radio-disabled-border-color: var(
--system-radio-disabled-border-color
);
--spectrum-radio-emphasized-accent-color: var(
--system-radio-emphasized-accent-color
);
--spectrum-radio-emphasized-accent-color-hover: var(
--system-radio-emphasized-accent-color-hover
);
--spectrum-radio-emphasized-accent-color-down: var(
--system-radio-emphasized-accent-color-down
);
--spectrum-radio-emphasized-accent-color-focus: var(
--system-radio-emphasized-accent-color-focus
);
--spectrum-radio-border-width: var(--system-radio-border-width);
--spectrum-radio-button-background-color: var(
--system-radio-button-background-color
);
--spectrum-radio-button-checked-border-color-default: var(
--system-radio-button-checked-border-color-default
);
--spectrum-radio-button-checked-border-color-hover: var(
--system-radio-button-checked-border-color-hover
);
--spectrum-radio-button-checked-border-color-down: var(
--system-radio-button-checked-border-color-down
);
--spectrum-radio-button-checked-border-color-focus: var(
--system-radio-button-checked-border-color-focus
);
--spectrum-radio-line-height: var(--system-radio-line-height);
--spectrum-radio-animation-duration: var(--system-radio-animation-duration);
--spectrum-radio-height: var(--system-radio-height);
--spectrum-radio-button-control-size: var(
--system-radio-button-control-size
);
--spectrum-radio-text-to-control: var(--system-radio-text-to-control);
--spectrum-radio-label-top-to-text: var(--system-radio-label-top-to-text);
--spectrum-radio-label-bottom-to-text: var(
--system-radio-label-bottom-to-text
);
--spectrum-radio-button-top-to-control: var(
--system-radio-button-top-to-control
);
--spectrum-radio-font-size: var(--system-radio-font-size);
}

:host(:lang(ja)) {
--spectrum-radio-line-height-cjk: var(
--system-radio-lang-ja-line-height-cjk
);
}

:host(:lang(zh)) {
--spectrum-radio-line-height-cjk: var(
--system-radio-lang-zh-line-height-cjk
);
}

:host(:lang(ko)) {
--spectrum-radio-line-height-cjk: var(
--system-radio-lang-ko-line-height-cjk
);
}

:host {
--spectrum-radio-height: var(--system-radio-size-m-height);
--spectrum-radio-button-control-size: var(
--system-radio-size-m-button-control-size
);
--spectrum-radio-text-to-control: var(
--system-radio-size-m-text-to-control
);
--spectrum-radio-label-top-to-text: var(
--system-radio-size-m-label-top-to-text
);
--spectrum-radio-label-bottom-to-text: var(
--system-radio-size-m-label-bottom-to-text
);
--spectrum-radio-button-top-to-control: var(
--system-radio-size-m-button-top-to-control
);
--spectrum-radio-font-size: var(--system-radio-size-m-font-size);
}

:host([size='s']) {
--spectrum-radio-height: var(--system-radio-size-s-height);
--spectrum-radio-button-control-size: var(
--system-radio-size-s-button-control-size
);
--spectrum-radio-text-to-control: var(
--system-radio-size-s-text-to-control
);
--spectrum-radio-label-top-to-text: var(
--system-radio-size-s-label-top-to-text
);
--spectrum-radio-label-bottom-to-text: var(
--system-radio-size-s-label-bottom-to-text
);
--spectrum-radio-button-top-to-control: var(
--system-radio-size-s-button-top-to-control
);
--spectrum-radio-font-size: var(--system-radio-size-s-font-size);
}

:host([size='l']) {
--spectrum-radio-height: var(--system-radio-size-l-height);
--spectrum-radio-button-control-size: var(
--system-radio-size-l-button-control-size
);
--spectrum-radio-text-to-control: var(
--system-radio-size-l-text-to-control
);
--spectrum-radio-label-top-to-text: var(
--system-radio-size-l-label-top-to-text
);
--spectrum-radio-label-bottom-to-text: var(
--system-radio-size-l-label-bottom-to-text
);
--spectrum-radio-button-top-to-control: var(
--system-radio-size-l-button-top-to-control
);
--spectrum-radio-font-size: var(--system-radio-size-l-font-size);
}

:host([size='xl']) {
--spectrum-radio-height: var(--system-radio-size-xl-height);
--spectrum-radio-button-control-size: var(
--system-radio-size-xl-button-control-size
);
--spectrum-radio-text-to-control: var(
--system-radio-size-xl-text-to-control
);
--spectrum-radio-label-top-to-text: var(
--system-radio-size-xl-label-top-to-text
);
--spectrum-radio-label-bottom-to-text: var(
--system-radio-size-xl-label-bottom-to-text
);
--spectrum-radio-button-top-to-control: var(
--system-radio-size-xl-button-top-to-control
);
--spectrum-radio-font-size: var(--system-radio-size-xl-font-size);
}

:host([emphasized]) {
--spectrum-radio-button-checked-border-color-default: var(
--system-radio-emphasized-button-checked-border-color-default
);
--spectrum-radio-button-checked-border-color-hover: var(
--system-radio-emphasized-button-checked-border-color-hover
);
--spectrum-radio-button-checked-border-color-down: var(
--system-radio-emphasized-button-checked-border-color-down
);
--spectrum-radio-button-checked-border-color-focus: var(
--system-radio-emphasized-button-checked-border-color-focus
);
}
19 changes: 12 additions & 7 deletions packages/radio/src/radio.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,17 @@ governing permissions and limitations under the License.
}

/**
* Work around for https://github.com/adobe/spectrum-css/issues/2251
**/
:host([dir='rtl']) #button:after {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yay this is not needed because the exact same code is coming from the spectrum-radio file!

transform: translateX(50%) translateY(-50%);
* @todo updated designs call for the radio button to be visible;
* however as that can cause layout shifts, hold this update until a breaking release.
*/
:host([readonly]) #button {
clip: rect(1px, 1px, 1px, 1px);
clip-path: inset(50%);
position: fixed;
inset-block-end: 100%;
inset-inline-end: 100%;
}

/**
* End workaround
**/
:host([readonly]) #label {
margin-inline-start: 0;
}
86 changes: 74 additions & 12 deletions packages/radio/src/spectrum-radio.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,79 @@ governing permissions and limitations under the License.
*/

/* THIS FILE IS MACHINE GENERATED. DO NOT EDIT */
:host {
--spectrum-radio-neutral-content-color: var(--spectrum-neutral-content-color-default);
--spectrum-radio-neutral-content-color-hover: var(--spectrum-neutral-content-color-hover);
--spectrum-radio-neutral-content-color-down: var(--spectrum-neutral-content-color-down);
--spectrum-radio-neutral-content-color-focus: var(--spectrum-neutral-content-color-key-focus);
--spectrum-radio-focus-indicator-thickness: var(--spectrum-focus-indicator-thickness);
--spectrum-radio-focus-indicator-gap: var(--spectrum-focus-indicator-gap);
--spectrum-radio-focus-indicator-color: var(--spectrum-focus-indicator-color);
--spectrum-radio-disabled-content-color: var(--spectrum-disabled-content-color);
--spectrum-radio-disabled-border-color: var(--spectrum-disabled-content-color);
--spectrum-radio-emphasized-accent-color: var(--spectrum-accent-color-900);
--spectrum-radio-emphasized-accent-color-hover: var(--spectrum-accent-color-1000);
--spectrum-radio-emphasized-accent-color-down: var(--spectrum-accent-color-1100);
--spectrum-radio-emphasized-accent-color-focus: var(--spectrum-accent-color-1000);
--spectrum-radio-border-width: var(--spectrum-border-width-200);
--spectrum-radio-button-checked-border-color-default: var(--spectrum-neutral-background-color-selected-default);
--spectrum-radio-button-checked-border-color-hover: var(--spectrum-neutral-background-color-selected-hover);
--spectrum-radio-button-checked-border-color-down: var(--spectrum-neutral-background-color-selected-down);
--spectrum-radio-button-checked-border-color-focus: var(--spectrum-neutral-background-color-selected-key-focus);
--spectrum-radio-line-height: var(--spectrum-line-height-100);
--spectrum-radio-animation-duration: var(--spectrum-animation-duration-100);
}

:host(:lang(ja)),
:host(:lang(ko)),
:host(:lang(zh)) {
--spectrum-radio-line-height-cjk: var(--spectrum-cjk-line-height-100);
}

:host,
:host {
--spectrum-radio-height: var(--spectrum-component-height-100);
--spectrum-radio-button-control-size: var(--spectrum-radio-button-control-size-medium);
--spectrum-radio-text-to-control: var(--spectrum-text-to-control-100);
--spectrum-radio-label-top-to-text: var(--spectrum-component-top-to-text-100);
--spectrum-radio-label-bottom-to-text: var(--spectrum-component-bottom-to-text-100);
--spectrum-radio-button-top-to-control: var(--spectrum-radio-button-top-to-control-medium);
--spectrum-radio-font-size: var(--spectrum-font-size-100);
}

:host([size='s']) {
--spectrum-radio-height: var(--spectrum-component-height-75);
--spectrum-radio-button-control-size: var(--spectrum-radio-button-control-size-small);
--spectrum-radio-text-to-control: var(--spectrum-text-to-control-75);
--spectrum-radio-label-top-to-text: var(--spectrum-component-top-to-text-75);
--spectrum-radio-label-bottom-to-text: var(--spectrum-component-bottom-to-text-75);
--spectrum-radio-button-top-to-control: var(--spectrum-radio-button-top-to-control-small);
--spectrum-radio-font-size: var(--spectrum-font-size-75);
}

:host([size='l']) {
--spectrum-radio-height: var(--spectrum-component-height-200);
--spectrum-radio-button-control-size: var(--spectrum-radio-button-control-size-large);
--spectrum-radio-text-to-control: var(--spectrum-text-to-control-200);
--spectrum-radio-label-top-to-text: var(--spectrum-component-top-to-text-200);
--spectrum-radio-label-bottom-to-text: var(--spectrum-component-bottom-to-text-200);
--spectrum-radio-button-top-to-control: var(--spectrum-radio-button-top-to-control-large);
--spectrum-radio-font-size: var(--spectrum-font-size-200);
}

:host([size='xl']) {
--spectrum-radio-height: var(--spectrum-component-height-300);
--spectrum-radio-button-control-size: var(--spectrum-radio-button-control-size-extra-large);
--spectrum-radio-text-to-control: var(--spectrum-text-to-control-300);
--spectrum-radio-label-top-to-text: var(--spectrum-component-top-to-text-300);
--spectrum-radio-label-bottom-to-text: var(--spectrum-component-bottom-to-text-300);
--spectrum-radio-button-top-to-control: var(--spectrum-radio-button-top-to-control-extra-large);
--spectrum-radio-font-size: var(--spectrum-font-size-300);
}

@media (forced-colors: active) {
:host {
--highcontrast-radio-button-background-color: ButtonFace;
--highcontrast-radio-neutral-content-color: CanvasText;
--highcontrast-radio-neutral-content-color-hover: CanvasText;
--highcontrast-radio-neutral-content-color-down: CanvasText;
Expand Down Expand Up @@ -80,23 +151,14 @@ governing permissions and limitations under the License.
color: var(--highcontrast-radio-neutral-content-color-focus, var(--mod-radio-neutral-content-color-focus, var(--spectrum-radio-neutral-content-color-focus)));
}

:host([readonly]) #input:read-only {
cursor: auto;
}

:host([readonly]) #button {
clip: rect(1px, 1px, 1px, 1px);
clip-path: inset(50%);
position: fixed;
inset-block-end: 100%;
inset-inline-end: 100%;
:host([readonly]) #input {
pointer-events: none;
}

:host([readonly][checked][disabled]) #input ~ #label,
:host([readonly][disabled]) #input ~ #label,
:host([readonly]) #label {
color: var(--highcontrast-radio-neutral-content-color, var(--mod-radio-neutral-content-color, var(--spectrum-radio-neutral-content-color)));
margin-inline-start: 0;
}

:host([emphasized][checked]) #input + #button:before {
Expand Down Expand Up @@ -205,7 +267,7 @@ governing permissions and limitations under the License.
box-sizing: border-box;
inline-size: var(--mod-radio-button-control-size, var(--spectrum-radio-button-control-size));
block-size: var(--mod-radio-button-control-size, var(--spectrum-radio-button-control-size));
background-color: var(--highcontrast-radio-button-background-color, var(--mod-radio-button-background-color, var(--spectrum-radio-button-background-color)));
background-color: var(--mod-radio-button-background-color, var(--spectrum-radio-button-background-color));
border-width: var(--mod-radio-border-width, var(--spectrum-radio-border-width));
border-color: var(--highcontrast-radio-button-border-color-default, var(--mod-radio-button-border-color-default, var(--spectrum-radio-button-border-color-default)));
transition:
Expand Down
Loading
Loading