@fluid-topics/ft-radio 2.0.38 → 2.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.
@@ -0,0 +1,7 @@
1
+ export interface FtRadioProperties {
2
+ value?: string;
3
+ name?: string;
4
+ checked?: boolean;
5
+ ariaChecked?: string;
6
+ disabled?: boolean;
7
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,9 +1,9 @@
1
1
  export declare const FtRadioCssVariables: {
2
- textColor: import("@fluid-topics/ft-wc-utils").FtCssVariable;
3
- fontSize: import("@fluid-topics/ft-wc-utils").FtCssVariable;
4
- colorPrimary: import("@fluid-topics/ft-wc-utils").FtCssVariable;
5
- colorOnPrimary: import("@fluid-topics/ft-wc-utils").FtCssVariable;
6
- borderColor: import("@fluid-topics/ft-wc-utils").FtCssVariable;
7
- colorOnSurfaceDisabled: import("@fluid-topics/ft-wc-utils").FtCssVariable;
2
+ textColor: import("@fluid-topics/design-system-variables").FtCssVariable;
3
+ fontSize: import("@fluid-topics/design-system-variables").FtCssVariable;
4
+ colorPrimary: import("@fluid-topics/design-system-variables").FtCssVariable;
5
+ colorOnPrimary: import("@fluid-topics/design-system-variables").FtCssVariable;
6
+ borderColor: import("@fluid-topics/design-system-variables").FtCssVariable;
7
+ colorOnSurfaceDisabled: import("@fluid-topics/design-system-variables").FtCssVariable;
8
8
  };
9
9
  export declare const classicStyles: import("lit").CSSResult;
@@ -1,5 +1,5 @@
1
1
  import { css } from "lit";
2
- import { designSystemVariables, FtCssVariableFactory } from "@fluid-topics/ft-wc-utils";
2
+ import { designSystemVariables, FtCssVariableFactory, } from "@fluid-topics/ft-wc-utils";
3
3
  import { FtTypographyCssVariables } from "@fluid-topics/ft-typography";
4
4
  export const FtRadioCssVariables = {
5
5
  textColor: FtCssVariableFactory.extend("--ft-radio-text-color", "", designSystemVariables.colorOnSurfaceHigh),
@@ -96,7 +96,7 @@ export const classicStyles = css `
96
96
  outline-offset: -2px;
97
97
  }
98
98
 
99
- .ft-radio ft-or-ftds-typography {
99
+ .ft-radio ft-typography {
100
100
  padding-right: 2px;
101
101
  }
102
102
  `;
package/build/index.d.ts CHANGED
@@ -1,9 +1,7 @@
1
1
  export * from "./ft-radio";
2
+ export * from "./ft-radio.properties";
2
3
  export * from "./ft-radio.styles";
3
- export * from "./ftds-radio";
4
- export * from "./ftds-radio.styles";
5
4
  export * from "./ft-radio-group";
5
+ export * from "./ft-radio-group.properties";
6
6
  export * from "./ft-radio-group.styles";
7
- export * from "./ftds-radio-group";
8
- export * from "./ftds-radio-group.styles";
9
7
  import "./define";
package/build/index.js CHANGED
@@ -1,9 +1,7 @@
1
1
  export * from "./ft-radio";
2
+ export * from "./ft-radio.properties";
2
3
  export * from "./ft-radio.styles";
3
- export * from "./ftds-radio";
4
- export * from "./ftds-radio.styles";
5
4
  export * from "./ft-radio-group";
5
+ export * from "./ft-radio-group.properties";
6
6
  export * from "./ft-radio-group.styles";
7
- export * from "./ftds-radio-group";
8
- export * from "./ftds-radio-group.styles";
9
7
  import "./define";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-radio",
3
- "version": "2.0.38",
3
+ "version": "2.1.0",
4
4
  "description": "A radio component",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,10 +19,10 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-ripple": "2.0.38",
23
- "@fluid-topics/ft-typography": "2.0.38",
24
- "@fluid-topics/ft-wc-utils": "2.0.38",
22
+ "@fluid-topics/ft-ripple": "2.1.0",
23
+ "@fluid-topics/ft-typography": "2.1.0",
24
+ "@fluid-topics/ft-wc-utils": "2.1.0",
25
25
  "lit": "3.1.0"
26
26
  },
27
- "gitHead": "8a5f1d6fb69ac18ec2e6d05dcf82e036d7423c35"
27
+ "gitHead": "4727cf19d04236ad1d2b2cb43ce1c46298834c7e"
28
28
  }
@@ -1,28 +0,0 @@
1
- import { FtLitElement } from "@fluid-topics/ft-wc-utils";
2
- import { PropertyValues } from "lit";
3
- import { FtBaseRadio } from "./ft-radio";
4
- export interface FtBaseRadioGroupProperties {
5
- name?: string;
6
- role?: string;
7
- ariaLabelledBy?: string;
8
- }
9
- export declare class FtBaseRadioGroup extends FtLitElement implements FtBaseRadioGroupProperties {
10
- static elementDefinitions: {};
11
- name: string;
12
- role: string;
13
- ariaLabelledBy: string;
14
- assignedElements?: Array<Element>;
15
- get radioButtons(): Array<FtBaseRadio>;
16
- currentSelectedIndex: number;
17
- protected render(): import("lit-html").TemplateResult<1>;
18
- connectedCallback(): void;
19
- disconnectedCallback(): void;
20
- private onSlotChange;
21
- protected contentAvailableCallback(props: PropertyValues): void;
22
- private onFocus;
23
- private onFocusOut;
24
- private onChange;
25
- private onKeyDown;
26
- private resolveCurrentSelectedIndex;
27
- private focusCurrentChecked;
28
- }
@@ -1,119 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import { FtLitElement } from "@fluid-topics/ft-wc-utils";
8
- import { property, queryAssignedElements, state } from "lit/decorators.js";
9
- import { html } from "lit";
10
- export class FtBaseRadioGroup extends FtLitElement {
11
- constructor() {
12
- super(...arguments);
13
- this.name = "";
14
- this.role = "radiogroup";
15
- this.ariaLabelledBy = "";
16
- this.currentSelectedIndex = 0;
17
- this.onFocus = () => {
18
- setTimeout(() => this.focusCurrentChecked(), 100);
19
- };
20
- this.onFocusOut = (e) => {
21
- };
22
- }
23
- get radioButtons() {
24
- var _a, _b;
25
- return (_b = (_a = this.assignedElements) === null || _a === void 0 ? void 0 : _a.flatMap((e) => e.matches("ft-radio,ftds-radio")
26
- ? [e]
27
- : [...e.querySelectorAll("ft-radio,ftds-radio")])) !== null && _b !== void 0 ? _b : [];
28
- }
29
- render() {
30
- return html `
31
- <slot @slotchange=${this.onSlotChange}
32
- @change=${this.onChange}
33
- @keydown=${this.onKeyDown}
34
- ></slot>
35
- `;
36
- }
37
- connectedCallback() {
38
- super.connectedCallback();
39
- this.addEventListener("focus", this.onFocus);
40
- this.addEventListener("focusout", this.onFocusOut);
41
- }
42
- disconnectedCallback() {
43
- super.disconnectedCallback();
44
- this.removeEventListener("focus", this.onFocus);
45
- this.removeEventListener("focusout", this.onFocusOut);
46
- }
47
- onSlotChange() {
48
- this.radioButtons.forEach((rb) => rb.name = this.name);
49
- }
50
- contentAvailableCallback(props) {
51
- super.contentAvailableCallback(props);
52
- this.radioButtons.forEach((rb) => rb.setInputTabIndex(-1)); // RadioButton is no more selectable alone
53
- this.resolveCurrentSelectedIndex();
54
- }
55
- onChange(event) {
56
- event.stopPropagation();
57
- this.radioButtons.forEach((rb) => rb.checked = event.detail.value === rb.value);
58
- this.dispatchEvent(new CustomEvent("change", { detail: event.detail.value }));
59
- this.resolveCurrentSelectedIndex();
60
- }
61
- onKeyDown(event) {
62
- let blockUnwhishedReaction = false;
63
- switch (event.key) {
64
- case "ArrowUp":
65
- case "ArrowLeft": {
66
- blockUnwhishedReaction = true;
67
- const indexToFocus = this.currentSelectedIndex - 1;
68
- this.radioButtons[indexToFocus < 0 ? this.radioButtons.length - 1 : indexToFocus].select();
69
- this.radioButtons[indexToFocus < 0 ? this.radioButtons.length - 1 : indexToFocus].focus();
70
- break;
71
- }
72
- case "ArrowDown":
73
- case "ArrowRight": {
74
- blockUnwhishedReaction = true;
75
- const indexToFocus = this.currentSelectedIndex + 1;
76
- this.radioButtons[indexToFocus > this.radioButtons.length - 1 ? 0 : indexToFocus].select();
77
- this.radioButtons[indexToFocus > this.radioButtons.length - 1 ? 0 : indexToFocus].focus();
78
- break;
79
- }
80
- case "Enter": {
81
- this.radioButtons[this.currentSelectedIndex].select();
82
- }
83
- }
84
- if (blockUnwhishedReaction) {
85
- event.stopPropagation();
86
- event.preventDefault();
87
- }
88
- }
89
- resolveCurrentSelectedIndex() {
90
- const checkedButtonIndex = this.radioButtons.findIndex((rb) => rb.checked);
91
- if (checkedButtonIndex == -1) {
92
- this.currentSelectedIndex = 0;
93
- this.radioButtons[0].select();
94
- }
95
- else {
96
- this.currentSelectedIndex = checkedButtonIndex;
97
- }
98
- this.radioButtons[this.currentSelectedIndex].setInputTabIndex(0);
99
- }
100
- focusCurrentChecked() {
101
- this.radioButtons[this.currentSelectedIndex].focus();
102
- }
103
- }
104
- FtBaseRadioGroup.elementDefinitions = {};
105
- __decorate([
106
- property()
107
- ], FtBaseRadioGroup.prototype, "name", void 0);
108
- __decorate([
109
- property({ reflect: true, attribute: "role" })
110
- ], FtBaseRadioGroup.prototype, "role", void 0);
111
- __decorate([
112
- property({ reflect: true, attribute: "aria-labelledby" })
113
- ], FtBaseRadioGroup.prototype, "ariaLabelledBy", void 0);
114
- __decorate([
115
- queryAssignedElements()
116
- ], FtBaseRadioGroup.prototype, "assignedElements", void 0);
117
- __decorate([
118
- state()
119
- ], FtBaseRadioGroup.prototype, "currentSelectedIndex", void 0);
@@ -1,37 +0,0 @@
1
- import { PropertyValues } from "lit";
2
- import { ElementDefinitionsMap, FtLitElement } from "@fluid-topics/ft-wc-utils";
3
- import { ClassInfo } from "lit/directives/class-map.js";
4
- export declare class FtRadioChangeEvent extends CustomEvent<{
5
- value: string;
6
- checked: boolean;
7
- }> {
8
- constructor(value: string, checked: boolean);
9
- }
10
- export interface FtBaseRadioProperties {
11
- value?: string;
12
- name?: string;
13
- checked?: boolean;
14
- ariaChecked?: string;
15
- disabled?: boolean;
16
- }
17
- export declare class FtBaseRadio extends FtLitElement implements FtBaseRadioProperties {
18
- static elementDefinitions: ElementDefinitionsMap;
19
- value: string;
20
- name: string;
21
- checked: boolean;
22
- ariaChecked: string;
23
- disabled: boolean;
24
- private container?;
25
- private ripple?;
26
- private input?;
27
- get radioClasses(): ClassInfo;
28
- get typographyVariant(): string;
29
- protected render(): import("lit-html").TemplateResult<1>;
30
- protected willUpdate(changedProperties: PropertyValues): void;
31
- private onChange;
32
- protected contentAvailableCallback(props: PropertyValues): void;
33
- select(): void;
34
- setInputTabIndex(index: number): void;
35
- focus(): void;
36
- onClick(e: Event): void;
37
- }
@@ -1,132 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import { html } from "lit";
8
- import { property, query } from "lit/decorators.js";
9
- import { FtLitElement } from "@fluid-topics/ft-wc-utils";
10
- import { classMap } from "lit/directives/class-map.js";
11
- import { FtRipple } from "@fluid-topics/ft-ripple";
12
- export class FtRadioChangeEvent extends CustomEvent {
13
- constructor(value, checked) {
14
- super("change", { detail: { value: value, checked: checked }, bubbles: true, composed: true });
15
- }
16
- }
17
- export class FtBaseRadio extends FtLitElement {
18
- constructor() {
19
- super(...arguments);
20
- this.value = "";
21
- this.name = "";
22
- this.checked = false;
23
- this.ariaChecked = "false";
24
- this.disabled = false;
25
- }
26
- get radioClasses() {
27
- return {
28
- "ft-radio": true,
29
- "ft-radio--checked": this.checked,
30
- "ft-radio--disabled": this.disabled,
31
- };
32
- }
33
- get typographyVariant() {
34
- return "";
35
- }
36
- render() {
37
- // We use inert on the input to prevent the "radio" role to be present twice in the aria tree
38
- return html `
39
- <div class="${classMap(this.radioClasses)}"
40
- @click=${this.onClick}>
41
- <div class="ft-radio--box-container">
42
- <ft-ripple
43
- ?disabled=${this.disabled}
44
- ?primary=${this.checked}
45
- unbounded>
46
- </ft-ripple>
47
- <div class="ft-radio--box">
48
- </div>
49
- <input id="radio-button"
50
- type="radio"
51
- name="${this.name}"
52
- value="${this.value}"
53
- .checked=${this.checked}
54
- .disabled=${this.disabled}
55
- @change=${this.onChange}
56
- >
57
- </div>
58
- <label for="radio-button" inert >
59
- <ft-or-ftds-typography variant="${this.typographyVariant}">
60
- <slot></slot>
61
- </ft-or-ftds-typography>
62
- </label>
63
- </div>
64
- `;
65
- }
66
- willUpdate(changedProperties) {
67
- super.willUpdate(changedProperties);
68
- if (changedProperties.has("checked")) {
69
- this.ariaChecked = this.checked ? "true" : "false";
70
- }
71
- }
72
- onChange(event) {
73
- event.stopPropagation();
74
- this.checked = event.target.checked;
75
- this.dispatchEvent(new FtRadioChangeEvent(this.value, this.checked));
76
- }
77
- contentAvailableCallback(props) {
78
- var _a;
79
- super.contentAvailableCallback(props);
80
- (_a = this.ripple) === null || _a === void 0 ? void 0 : _a.setupFor(this.container);
81
- }
82
- select() {
83
- this.checked = true;
84
- this.dispatchEvent(new FtRadioChangeEvent(this.value, this.checked));
85
- }
86
- setInputTabIndex(index) {
87
- if (this.input) {
88
- this.input.tabIndex = index;
89
- }
90
- }
91
- focus() {
92
- var _a;
93
- (_a = this.input) === null || _a === void 0 ? void 0 : _a.focus();
94
- setTimeout(() => { var _a; return (_a = this.ripple) === null || _a === void 0 ? void 0 : _a.forceFocusUpdate(); }, 0);
95
- }
96
- onClick(e) {
97
- var _a;
98
- if (e.target === this.input) {
99
- return;
100
- }
101
- e.stopPropagation();
102
- e.preventDefault();
103
- (_a = this.input) === null || _a === void 0 ? void 0 : _a.click();
104
- }
105
- }
106
- FtBaseRadio.elementDefinitions = {
107
- "ft-ripple": FtRipple,
108
- };
109
- __decorate([
110
- property()
111
- ], FtBaseRadio.prototype, "value", void 0);
112
- __decorate([
113
- property()
114
- ], FtBaseRadio.prototype, "name", void 0);
115
- __decorate([
116
- property({ type: Boolean, reflect: true })
117
- ], FtBaseRadio.prototype, "checked", void 0);
118
- __decorate([
119
- property({ attribute: "aria-checked", reflect: true })
120
- ], FtBaseRadio.prototype, "ariaChecked", void 0);
121
- __decorate([
122
- property({ type: Boolean })
123
- ], FtBaseRadio.prototype, "disabled", void 0);
124
- __decorate([
125
- query(".ft-radio")
126
- ], FtBaseRadio.prototype, "container", void 0);
127
- __decorate([
128
- query("ft-ripple")
129
- ], FtBaseRadio.prototype, "ripple", void 0);
130
- __decorate([
131
- query("input")
132
- ], FtBaseRadio.prototype, "input", void 0);
@@ -1,8 +0,0 @@
1
- import { FtBaseRadioGroup, FtBaseRadioGroupProperties } from "./ft-base-radio-group";
2
- import { DesignSystemFamily } from "@fluid-topics/design-system-variables";
3
- declare const FtdsRadioGroup_base: import("@fluid-topics/ft-wc-utils").FtdsBaseType<typeof FtBaseRadioGroup>;
4
- export declare class FtdsRadioGroup extends FtdsRadioGroup_base implements FtBaseRadioGroupProperties {
5
- family: DesignSystemFamily;
6
- static styles: import("lit").CSSResult[];
7
- }
8
- export {};
@@ -1,14 +0,0 @@
1
- import { FtBaseRadioGroup } from "./ft-base-radio-group";
2
- import { safariEllipsisFix, toFtdsBase } from "@fluid-topics/ft-wc-utils";
3
- import { designSystemGroupStyles } from "./ftds-radio-group.styles";
4
- import { DesignSystemFamily } from "@fluid-topics/design-system-variables";
5
- export class FtdsRadioGroup extends toFtdsBase(FtBaseRadioGroup) {
6
- constructor() {
7
- super(...arguments);
8
- this.family = DesignSystemFamily.brand;
9
- }
10
- }
11
- FtdsRadioGroup.styles = [
12
- safariEllipsisFix,
13
- designSystemGroupStyles,
14
- ];
@@ -1 +0,0 @@
1
- export declare const designSystemGroupStyles: import("lit").CSSResult;
@@ -1,13 +0,0 @@
1
- import { css } from "lit";
2
- import { radio } from "@fluid-topics/ft-wc-utils";
3
- export const designSystemGroupStyles = css `
4
- :host {
5
- display: flex;
6
- flex-direction: column;
7
- gap: ${radio.verticalGap}
8
- }
9
-
10
- :host(:focus-visible) {
11
- outline: none;
12
- }
13
- `;
@@ -1,13 +0,0 @@
1
- import { FtBaseRadio, FtBaseRadioProperties } from "./ft-base-radio";
2
- import { ClassInfo } from "lit/directives/class-map.js";
3
- import { ElementDefinitionsMap } from "@fluid-topics/ft-wc-utils";
4
- import { DesignSystemFamily } from "@fluid-topics/design-system-variables";
5
- declare const FtdsRadio_base: import("@fluid-topics/ft-wc-utils").FtdsBaseType<typeof FtBaseRadio>;
6
- export declare class FtdsRadio extends FtdsRadio_base implements FtBaseRadioProperties {
7
- static elementDefinitions: ElementDefinitionsMap;
8
- family: DesignSystemFamily;
9
- static styles: import("lit").CSSResult[];
10
- get radioClasses(): ClassInfo;
11
- get typographyVariant(): string;
12
- }
13
- export {};
@@ -1,28 +0,0 @@
1
- import { FtBaseRadio } from "./ft-base-radio";
2
- import { safariEllipsisFix, toFtdsBase } from "@fluid-topics/ft-wc-utils";
3
- import { designSystemStyles } from "./ftds-radio.styles";
4
- import { DesignSystemFamily } from "@fluid-topics/design-system-variables";
5
- import { FtdsTypographyVariants, FtTypography } from "@fluid-topics/ft-typography";
6
- export class FtdsRadio extends toFtdsBase(FtBaseRadio) {
7
- constructor() {
8
- super(...arguments);
9
- this.family = DesignSystemFamily.brand;
10
- }
11
- get radioClasses() {
12
- return {
13
- ...super.radioClasses,
14
- ...this.getDesignSystemBaseClasses(),
15
- };
16
- }
17
- get typographyVariant() {
18
- return FtdsTypographyVariants.body2medium;
19
- }
20
- }
21
- FtdsRadio.elementDefinitions = {
22
- ...FtBaseRadio.elementDefinitions,
23
- "ft-or-ftds-typography": FtTypography,
24
- };
25
- FtdsRadio.styles = [
26
- safariEllipsisFix,
27
- designSystemStyles,
28
- ];
@@ -1,3 +0,0 @@
1
- import { radio } from "@fluid-topics/ft-wc-utils";
2
- export { radio as FtdsRadioCssVariables };
3
- export declare const designSystemStyles: import("lit").CSSResult;
@@ -1,112 +0,0 @@
1
- import { css } from "lit";
2
- import { radio, setVariable, } from "@fluid-topics/ft-wc-utils";
3
- import { FtRippleCssVariables } from "@fluid-topics/ft-ripple";
4
- export { radio as FtdsRadioCssVariables };
5
- export const designSystemStyles = css `
6
- * {
7
- box-sizing: border-box;
8
- display: inline-flex;
9
- align-items: center;
10
- --input-size: calc(${radio.circleSize} + 2 * (${radio.focusOutlineOffset} + ${radio.focusOutlineWidth}));
11
- --input-margin: calc(-1 * ${radio.focusOutlineOffset} - ${radio.focusOutlineWidth});
12
- }
13
-
14
- .ft-radio {
15
- box-sizing: border-box;
16
- color: ${radio.color};
17
- gap: ${radio.horizontalGap};
18
- }
19
-
20
- .ft-radio--disabled:not(.ft-radio--checked) {
21
- opacity: ${radio.unselectedDisabledComponentOpacity}
22
- }
23
-
24
- .ft-radio--disabled.ft-radio--checked {
25
- opacity: ${radio.selectedDisabledComponentOpacity}
26
- }
27
-
28
- input {
29
- opacity: 0;
30
- position: absolute;
31
- width: var(--input-size);
32
- height: var(--input-size);
33
- margin: 0;
34
- }
35
-
36
- .ft-radio--box-container {
37
- position: relative;
38
- width: var(--input-size);
39
- height: var(--input-size);
40
- margin: var(--input-margin);
41
-
42
- display: flex;
43
- justify-content: center;
44
- align-items: center;
45
- flex-shrink: 0;
46
- }
47
-
48
- .ft-radio ft-ripple {
49
- z-index: 0;
50
- ${setVariable(FtRippleCssVariables.color, radio.unselectedStateLayerColor)};
51
- ${setVariable(FtRippleCssVariables.backgroundColor, radio.unselectedStateLayerColor)};
52
- ${setVariable(FtRippleCssVariables.opacityContentOnSurfaceHover, radio.unselectedHoverStateLayerOpacity)};
53
- ${setVariable(FtRippleCssVariables.opacityContentOnSurfaceFocused, radio.unselectedFocusStateLayerOpacity)};
54
- ${setVariable(FtRippleCssVariables.opacityContentOnSurfacePressed, radio.unselectedActiveStateLayerOpacity)};
55
- }
56
-
57
- .ft-radio--checked ft-ripple {
58
- ${setVariable(FtRippleCssVariables.color, radio.selectedStateLayerColor)};
59
- ${setVariable(FtRippleCssVariables.backgroundColor, radio.selectedStateLayerColor)};
60
- ${setVariable(FtRippleCssVariables.opacityContentOnSurfaceHover, radio.selectedHoverStateLayerOpacity)};
61
- ${setVariable(FtRippleCssVariables.opacityContentOnSurfaceFocused, radio.selectedFocusStateLayerOpacity)};
62
- ${setVariable(FtRippleCssVariables.opacityContentOnSurfacePressed, radio.selectedActiveStateLayerOpacity)};
63
- }
64
-
65
- .ft-radio--box {
66
- z-index: 1;
67
- border: 2px solid ${radio.unselectedBorderColor};
68
- border-radius: 50%;
69
-
70
- display: flex;
71
- justify-content: center;
72
- align-items: center;
73
-
74
- width: ${radio.circleSize};
75
- height: ${radio.circleSize};
76
- }
77
-
78
- .ft-radio--box:after {
79
- content: " ";
80
- background-color: ${radio.selectedRadioColor};
81
-
82
- border-radius: 50%;
83
-
84
- width: calc(${radio.circleSize} - 8px);
85
- height: calc(${radio.circleSize} - 8px);
86
-
87
- transform: scale(0);
88
- transition: transform 100ms ease;
89
- }
90
-
91
- .ft-radio--checked .ft-radio--box {
92
- border-color: ${radio.selectedRadioColor};
93
- }
94
-
95
-
96
- .ft-radio--checked .ft-radio--box:after {
97
- transform: scale(1);
98
- }
99
-
100
- .ft-radio--disabled .ft-radio--box {
101
- background-color: transparent;
102
- }
103
-
104
- .ft-radio:has(:focus-visible) .ft-radio--box {
105
- outline: ${radio.focusOutlineWidth} solid ${radio.focusFocusRingColor};
106
- outline-offset: ${radio.focusOutlineOffset};
107
- }
108
-
109
- .ft-radio ft-or-ftds-typography {
110
- padding-right: 2px;
111
- }
112
- `;