@planningcenter/tapestry 2.9.1-rc.1 → 2.10.0-rc.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.
- package/dist/components/radio/Radio.d.ts +17 -4
- package/dist/components/radio/Radio.d.ts.map +1 -1
- package/dist/components/radio/Radio.js +5 -1
- package/dist/components/radio/Radio.js.map +1 -1
- package/dist/reactRender.css +140 -147
- package/dist/reactRender.css.map +1 -1
- package/dist/reactRenderLegacy.css +140 -147
- package/dist/reactRenderLegacy.css.map +1 -1
- package/dist/unstable.css +5 -12
- package/dist/unstable.css.map +1 -1
- package/package.json +2 -2
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import React, { InputHTMLAttributes } from "react";
|
|
2
2
|
export type RadioSize = "md" | "sm";
|
|
3
|
-
|
|
3
|
+
interface RadioBaseProps {
|
|
4
4
|
description?: string;
|
|
5
|
+
name: string;
|
|
6
|
+
size?: RadioSize;
|
|
7
|
+
}
|
|
8
|
+
interface RadioWithLabel extends RadioBaseProps {
|
|
9
|
+
"aria-labelledby"?: never;
|
|
5
10
|
/**
|
|
6
11
|
* Label content for the radio. When using non-string content
|
|
7
12
|
* (e.g. JSX), it must not contain interactive elements. This
|
|
@@ -9,20 +14,28 @@ export interface RadioProps {
|
|
|
9
14
|
* well as Tapestry or Tapestry-React interactive components.
|
|
10
15
|
*/
|
|
11
16
|
label: React.ReactNode;
|
|
12
|
-
name: string;
|
|
13
|
-
size?: RadioSize;
|
|
14
17
|
}
|
|
18
|
+
interface RadioWithAriaLabelledBy extends RadioBaseProps {
|
|
19
|
+
"aria-labelledby": string;
|
|
20
|
+
label?: never;
|
|
21
|
+
}
|
|
22
|
+
export type RadioProps = RadioWithLabel | RadioWithAriaLabelledBy;
|
|
15
23
|
export type RadioElementProps = Omit<InputHTMLAttributes<HTMLInputElement>, keyof RadioProps | "type"> & RadioProps;
|
|
16
24
|
/**
|
|
17
25
|
* A radio component that renders as a radio input with label.
|
|
18
26
|
* Supports various sizes.
|
|
19
27
|
* Must have a name attribute.
|
|
20
28
|
*
|
|
29
|
+
* **Required:** You must provide either:
|
|
30
|
+
* - `label` - Label content for the radio
|
|
31
|
+
* - `aria-labelledby` - ID of an external element that provides the label
|
|
32
|
+
*
|
|
21
33
|
* When using non-string content for `label` (e.g. JSX), it must not contain
|
|
22
34
|
* interactive elements. This includes native HTML elements such as `<a>` and
|
|
23
35
|
* `<button>`, as well as Tapestry or Tapestry-React interactive components.
|
|
24
36
|
*
|
|
25
37
|
* @component
|
|
26
38
|
*/
|
|
27
|
-
export declare const Radio: React.ForwardRefExoticComponent<
|
|
39
|
+
export declare const Radio: React.ForwardRefExoticComponent<RadioElementProps & React.RefAttributes<HTMLInputElement>>;
|
|
40
|
+
export {};
|
|
28
41
|
//# sourceMappingURL=Radio.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../../../src/components/radio/Radio.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAc,mBAAmB,EAAE,MAAM,OAAO,CAAA;AAI9D,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,IAAI,CAAA;AAEnC,
|
|
1
|
+
{"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../../../src/components/radio/Radio.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAc,mBAAmB,EAAE,MAAM,OAAO,CAAA;AAI9D,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,IAAI,CAAA;AAEnC,UAAU,cAAc;IACtB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,SAAS,CAAA;CACjB;AAED,UAAU,cAAe,SAAQ,cAAc;IAC7C,iBAAiB,CAAC,EAAE,KAAK,CAAA;IACzB;;;;;OAKG;IACH,KAAK,EAAE,KAAK,CAAC,SAAS,CAAA;CACvB;AAED,UAAU,uBAAwB,SAAQ,cAAc;IACtD,iBAAiB,EAAE,MAAM,CAAA;IACzB,KAAK,CAAC,EAAE,KAAK,CAAA;CACd;AAED,MAAM,MAAM,UAAU,GAAG,cAAc,GAAG,uBAAuB,CAAA;AAEjE,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,MAAM,UAAU,GAAG,MAAM,CAC1B,GACC,UAAU,CAAA;AAEZ;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,KAAK,4FAuCjB,CAAA"}
|
|
@@ -7,6 +7,10 @@ import { useId } from '../../utilities/useId.js';
|
|
|
7
7
|
* Supports various sizes.
|
|
8
8
|
* Must have a name attribute.
|
|
9
9
|
*
|
|
10
|
+
* **Required:** You must provide either:
|
|
11
|
+
* - `label` - Label content for the radio
|
|
12
|
+
* - `aria-labelledby` - ID of an external element that provides the label
|
|
13
|
+
*
|
|
10
14
|
* When using non-string content for `label` (e.g. JSX), it must not contain
|
|
11
15
|
* interactive elements. This includes native HTML elements such as `<a>` and
|
|
12
16
|
* `<button>`, as well as Tapestry or Tapestry-React interactive components.
|
|
@@ -19,7 +23,7 @@ const Radio = forwardRef(({ className, description, id, label, size = "md", ...r
|
|
|
19
23
|
const radioId = id || `tds-radio-${stableId}`;
|
|
20
24
|
return (React.createElement("div", { className: combinedClassName },
|
|
21
25
|
React.createElement("input", { ...restProps, "aria-describedby": description ? `${radioId}-description` : undefined, id: radioId, ref: ref, type: "radio" }),
|
|
22
|
-
React.createElement("label", { htmlFor: radioId }, label),
|
|
26
|
+
label && React.createElement("label", { htmlFor: radioId }, label),
|
|
23
27
|
description && (React.createElement("p", { id: `${radioId}-description`, className: "tds-radio-description" }, description))));
|
|
24
28
|
});
|
|
25
29
|
Radio.displayName = "Radio";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.js","sources":["../../../src/components/radio/Radio.tsx"],"sourcesContent":["import classNames from \"classnames\"\nimport React, { forwardRef, InputHTMLAttributes } from \"react\"\n\nimport { useId } from \"../../utilities/useId\"\n\nexport type RadioSize = \"md\" | \"sm\"\n\
|
|
1
|
+
{"version":3,"file":"Radio.js","sources":["../../../src/components/radio/Radio.tsx"],"sourcesContent":["import classNames from \"classnames\"\nimport React, { forwardRef, InputHTMLAttributes } from \"react\"\n\nimport { useId } from \"../../utilities/useId\"\n\nexport type RadioSize = \"md\" | \"sm\"\n\ninterface RadioBaseProps {\n description?: string\n name: string\n size?: RadioSize\n}\n\ninterface RadioWithLabel extends RadioBaseProps {\n \"aria-labelledby\"?: never\n /**\n * Label content for the radio. When using non-string content\n * (e.g. JSX), it must not contain interactive elements. This\n * includes native HTML elements such as `<a>` and `<button>`, as\n * well as Tapestry or Tapestry-React interactive components.\n */\n label: React.ReactNode\n}\n\ninterface RadioWithAriaLabelledBy extends RadioBaseProps {\n \"aria-labelledby\": string\n label?: never\n}\n\nexport type RadioProps = RadioWithLabel | RadioWithAriaLabelledBy\n\nexport type RadioElementProps = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n keyof RadioProps | \"type\"\n> &\n RadioProps\n\n/**\n * A radio component that renders as a radio input with label.\n * Supports various sizes.\n * Must have a name attribute.\n *\n * **Required:** You must provide either:\n * - `label` - Label content for the radio\n * - `aria-labelledby` - ID of an external element that provides the label\n *\n * When using non-string content for `label` (e.g. JSX), it must not contain\n * interactive elements. This includes native HTML elements such as `<a>` and\n * `<button>`, as well as Tapestry or Tapestry-React interactive components.\n *\n * @component\n */\nexport const Radio = forwardRef<HTMLInputElement, RadioElementProps>(\n (\n {\n className,\n description,\n id,\n label,\n size = \"md\",\n ...restProps\n }: RadioElementProps,\n ref\n ) => {\n const combinedClassName = classNames(\n \"tds-radio\",\n size && size === \"sm\" && `tds-radio--sm`,\n className\n )\n\n const stableId = useId()\n const radioId = id || `tds-radio-${stableId}`\n\n return (\n <div className={combinedClassName}>\n <input\n {...restProps}\n aria-describedby={description ? `${radioId}-description` : undefined}\n id={radioId}\n ref={ref}\n type=\"radio\"\n />\n {label && <label htmlFor={radioId}>{label}</label>}\n {description && (\n <p id={`${radioId}-description`} className=\"tds-radio-description\">\n {description}\n </p>\n )}\n </div>\n )\n }\n)\n\nRadio.displayName = \"Radio\"\n"],"names":[],"mappings":";;;;AAqCA;;;;;;;;;;;;;;AAcG;AACI,MAAM,KAAK,GAAG,UAAU,CAC7B,CACE,EACE,SAAS,EACT,WAAW,EACX,EAAE,EACF,KAAK,EACL,IAAI,GAAG,IAAI,EACX,GAAG,SAAS,EACM,EACpB,GAAG,KACD;AACF,IAAA,MAAM,iBAAiB,GAAG,UAAU,CAClC,WAAW,EACX,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,CAAA,aAAA,CAAe,EACxC,SAAS,CACV;AAED,IAAA,MAAM,QAAQ,GAAG,KAAK,EAAE;AACxB,IAAA,MAAM,OAAO,GAAG,EAAE,IAAI,CAAA,UAAA,EAAa,QAAQ,EAAE;AAE7C,IAAA,QACE,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,iBAAiB,EAAA;QAC/B,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAA,GACM,SAAS,EAAA,kBAAA,EACK,WAAW,GAAG,CAAA,EAAG,OAAO,CAAA,YAAA,CAAc,GAAG,SAAS,EACpE,EAAE,EAAE,OAAO,EACX,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,OAAO,EAAA,CACZ;AACD,QAAA,KAAK,IAAI,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAO,OAAO,EAAE,OAAO,EAAA,EAAG,KAAK,CAAS;AACjD,QAAA,WAAW,KACV,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAG,EAAE,EAAE,CAAA,EAAG,OAAO,CAAA,YAAA,CAAc,EAAE,SAAS,EAAC,uBAAuB,EAAA,EAC/D,WAAW,CACV,CACL,CACG;AAEV,CAAC;AAGH,KAAK,CAAC,WAAW,GAAG,OAAO;;;;"}
|
package/dist/reactRender.css
CHANGED
|
@@ -2072,153 +2072,6 @@ a[class="tds-btn"]{
|
|
|
2072
2072
|
@media (prefers-color-scheme: dark){
|
|
2073
2073
|
}
|
|
2074
2074
|
|
|
2075
|
-
.tds-toggle-switch{
|
|
2076
|
-
--tds-toggle-switch-font-size:var(--t-font-size-md);
|
|
2077
|
-
--tds-toggle-switch-column-gap:var(--t-spacing-2);
|
|
2078
|
-
--tds-toggle-switch-cursor:pointer;
|
|
2079
|
-
--tds-toggle-switch-display:inline-grid;
|
|
2080
|
-
--tds-toggle-switch-line-height:1.4;
|
|
2081
|
-
|
|
2082
|
-
--tds-toggle-switch-label-color:var(--t-text-color);
|
|
2083
|
-
|
|
2084
|
-
--tds-toggle-switch-track-width:var(--t-container-size-md);
|
|
2085
|
-
--tds-toggle-switch-track-outline:none;
|
|
2086
|
-
--tds-toggle-switch-track-height:var(--t-container-size-xs);
|
|
2087
|
-
--tds-toggle-switch-track-background-color:var(--t-fill-color-control-neutral-off);
|
|
2088
|
-
--tds-toggle-switch-track-transition:background-color 180ms ease-in-out;
|
|
2089
|
-
|
|
2090
|
-
--tds-toggle-switch-thumb-size:var(--t-element-size-md);
|
|
2091
|
-
--tds-toggle-switch-thumb-transform:translateX(0);
|
|
2092
|
-
--tds-toggle-switch-thumb-transition:transform 180ms ease-in-out;
|
|
2093
|
-
|
|
2094
|
-
--tds-toggle-switch-description-font-size:var(--t-font-size-sm);
|
|
2095
|
-
--tds-toggle-switch-description-line-height:1.35;
|
|
2096
|
-
--tds-toggle-switch-description-color:var(--t-text-color-secondary);
|
|
2097
|
-
|
|
2098
|
-
display:var(--tds-toggle-switch-display);
|
|
2099
|
-
grid-template-areas:"input label" ". description";
|
|
2100
|
-
grid-template-columns:var(--tds-toggle-switch-track-width) auto;
|
|
2101
|
-
-moz-column-gap:var(--tds-toggle-switch-column-gap);
|
|
2102
|
-
column-gap:var(--tds-toggle-switch-column-gap);
|
|
2103
|
-
-webkit-user-select:none;
|
|
2104
|
-
-moz-user-select:none;
|
|
2105
|
-
user-select:none;
|
|
2106
|
-
}
|
|
2107
|
-
|
|
2108
|
-
.tds-toggle-switch input[type="checkbox"]{
|
|
2109
|
-
position:absolute;
|
|
2110
|
-
grid-area:input;
|
|
2111
|
-
width:var(--tds-toggle-switch-track-width);
|
|
2112
|
-
height:var(--tds-toggle-switch-track-height);
|
|
2113
|
-
margin:0;
|
|
2114
|
-
-webkit-appearance:none;
|
|
2115
|
-
-moz-appearance:none;
|
|
2116
|
-
appearance:none;
|
|
2117
|
-
cursor:var(--tds-toggle-switch-cursor);
|
|
2118
|
-
background-color:transparent;
|
|
2119
|
-
border:0;
|
|
2120
|
-
border-radius:var(--t-border-radius-round);
|
|
2121
|
-
}
|
|
2122
|
-
|
|
2123
|
-
.tds-toggle-switch label{
|
|
2124
|
-
display:inline-flex;
|
|
2125
|
-
grid-area:label;
|
|
2126
|
-
-moz-column-gap:var(--tds-toggle-switch-column-gap);
|
|
2127
|
-
column-gap:var(--tds-toggle-switch-column-gap);
|
|
2128
|
-
margin-top:-.09375em;
|
|
2129
|
-
font-size:var(--tds-toggle-switch-font-size);
|
|
2130
|
-
font-weight:var(--t-font-weight-normal);
|
|
2131
|
-
line-height:var(--tds-toggle-switch-line-height);
|
|
2132
|
-
color:var(--tds-toggle-switch-label-color);
|
|
2133
|
-
cursor:var(--tds-toggle-switch-cursor);
|
|
2134
|
-
}
|
|
2135
|
-
|
|
2136
|
-
.tds-toggle-switch:has(.tds-toggle-switch-description){
|
|
2137
|
-
row-gap:var(--t-spacing-fourth);
|
|
2138
|
-
}
|
|
2139
|
-
|
|
2140
|
-
.tds-toggle-switch:not(:has(input:disabled)):has(input:hover){
|
|
2141
|
-
--tds-toggle-switch-track-background-color:var(--t-fill-color-neutral-025);
|
|
2142
|
-
}
|
|
2143
|
-
|
|
2144
|
-
.tds-toggle-switch:has(input:focus-visible){
|
|
2145
|
-
--tds-toggle-switch-track-outline:solid var(--t-spacing-fourth) var(--t-border-color-status-info);
|
|
2146
|
-
}
|
|
2147
|
-
|
|
2148
|
-
.tds-toggle-switch:has(input:checked){
|
|
2149
|
-
--tds-toggle-switch-track-background-color:var(--t-fill-color-control);
|
|
2150
|
-
--tds-toggle-switch-thumb-transform:translateX(calc(var(--tds-toggle-switch-track-width) - var(--tds-toggle-switch-thumb-size) - var(--t-spacing-half)));
|
|
2151
|
-
}
|
|
2152
|
-
|
|
2153
|
-
.tds-toggle-switch:has(input:checked):not(:has(input:disabled)):has(input:hover){
|
|
2154
|
-
--tds-toggle-switch-track-background-color:var(--t-fill-color-interaction-hover);
|
|
2155
|
-
}
|
|
2156
|
-
|
|
2157
|
-
.tds-toggle-switch:has(input:disabled){
|
|
2158
|
-
--tds-toggle-switch-track-background-color:var(--t-fill-color-control-disabled);
|
|
2159
|
-
--tds-toggle-switch-label-color:var(--t-text-color-disabled);
|
|
2160
|
-
--tds-toggle-switch-description-color:var(--t-text-color-disabled);
|
|
2161
|
-
--tds-toggle-switch-cursor:not-allowed;
|
|
2162
|
-
}
|
|
2163
|
-
|
|
2164
|
-
.tds-toggle-switch-track{
|
|
2165
|
-
position:relative;
|
|
2166
|
-
flex-shrink:0;
|
|
2167
|
-
grid-area:input;
|
|
2168
|
-
width:var(--tds-toggle-switch-track-width);
|
|
2169
|
-
height:var(--tds-toggle-switch-track-height);
|
|
2170
|
-
outline:var(--tds-toggle-switch-track-outline);
|
|
2171
|
-
outline-offset:var(--t-spacing-fourth);
|
|
2172
|
-
background-color:var(--tds-toggle-switch-track-background-color);
|
|
2173
|
-
border-radius:var(--t-border-radius-round);
|
|
2174
|
-
transition:var(--tds-toggle-switch-track-transition);
|
|
2175
|
-
}
|
|
2176
|
-
|
|
2177
|
-
.tds-toggle-switch-track::before{
|
|
2178
|
-
position:absolute;
|
|
2179
|
-
top:var(--t-spacing-fourth);
|
|
2180
|
-
left:var(--t-spacing-fourth);
|
|
2181
|
-
width:var(--tds-toggle-switch-thumb-size);
|
|
2182
|
-
height:var(--tds-toggle-switch-thumb-size);
|
|
2183
|
-
content:"";
|
|
2184
|
-
background-color:#fff;
|
|
2185
|
-
border-radius:var(--t-border-radius-round);
|
|
2186
|
-
transform:var(--tds-toggle-switch-thumb-transform);
|
|
2187
|
-
transition:var(--tds-toggle-switch-thumb-transition);
|
|
2188
|
-
}
|
|
2189
|
-
|
|
2190
|
-
@media (prefers-reduced-motion: reduce){
|
|
2191
|
-
|
|
2192
|
-
.tds-toggle-switch-track{
|
|
2193
|
-
--tds-toggle-switch-track-transition:none;
|
|
2194
|
-
--tds-toggle-switch-thumb-transition:none;
|
|
2195
|
-
}
|
|
2196
|
-
}
|
|
2197
|
-
|
|
2198
|
-
.tds-toggle-switch-description{
|
|
2199
|
-
display:flex;
|
|
2200
|
-
grid-area:description;
|
|
2201
|
-
align-items:flex-start;
|
|
2202
|
-
margin:0;
|
|
2203
|
-
font-size:var(--tds-toggle-switch-description-font-size);
|
|
2204
|
-
line-height:var(--tds-toggle-switch-description-line-height);
|
|
2205
|
-
color:var(--tds-toggle-switch-description-color);
|
|
2206
|
-
cursor:text;
|
|
2207
|
-
}
|
|
2208
|
-
|
|
2209
|
-
.tds-toggle-switch--sm{
|
|
2210
|
-
--tds-toggle-switch-font-size:var(--t-font-size-sm);
|
|
2211
|
-
--tds-toggle-switch-line-height:1.35;
|
|
2212
|
-
--tds-toggle-switch-track-height:var(--t-element-size-lg);
|
|
2213
|
-
--tds-toggle-switch-thumb-size:var(--t-element-size-sm);
|
|
2214
|
-
--tds-toggle-switch-description-font-size:var(--t-font-size-xs);
|
|
2215
|
-
--tds-toggle-switch-description-line-height:1.3;
|
|
2216
|
-
}
|
|
2217
|
-
|
|
2218
|
-
.tds-toggle-switch--hide-label{
|
|
2219
|
-
--tds-toggle-switch-display:inline-flex;
|
|
2220
|
-
}
|
|
2221
|
-
|
|
2222
2075
|
.tds-checkbox{
|
|
2223
2076
|
--tds-checkbox-font-size:var(--t-font-size-md);
|
|
2224
2077
|
--tds-checkbox-cursor:pointer;
|
|
@@ -2409,6 +2262,146 @@ a[class="tds-btn"]{
|
|
|
2409
2262
|
--tds-checkbox-description-line-height:1.3;
|
|
2410
2263
|
}
|
|
2411
2264
|
|
|
2265
|
+
.tds-toggle-switch{
|
|
2266
|
+
--tds-toggle-switch-font-size:var(--t-font-size-md);
|
|
2267
|
+
--tds-toggle-switch-column-gap:var(--t-spacing-2);
|
|
2268
|
+
--tds-toggle-switch-cursor:pointer;
|
|
2269
|
+
--tds-toggle-switch-display:inline-grid;
|
|
2270
|
+
--tds-toggle-switch-line-height:1.4;
|
|
2271
|
+
|
|
2272
|
+
--tds-toggle-switch-label-color:var(--t-text-color);
|
|
2273
|
+
|
|
2274
|
+
--tds-toggle-switch-track-width:var(--t-container-size-md);
|
|
2275
|
+
--tds-toggle-switch-track-outline:none;
|
|
2276
|
+
--tds-toggle-switch-track-height:var(--t-container-size-xs);
|
|
2277
|
+
--tds-toggle-switch-track-background-color:var(--t-fill-color-control-neutral-off);
|
|
2278
|
+
--tds-toggle-switch-track-transition:background-color 180ms ease-in-out;
|
|
2279
|
+
|
|
2280
|
+
--tds-toggle-switch-thumb-size:var(--t-element-size-md);
|
|
2281
|
+
--tds-toggle-switch-thumb-transform:translateX(0);
|
|
2282
|
+
--tds-toggle-switch-thumb-transition:transform 180ms ease-in-out;
|
|
2283
|
+
|
|
2284
|
+
--tds-toggle-switch-description-font-size:var(--t-font-size-sm);
|
|
2285
|
+
--tds-toggle-switch-description-line-height:1.35;
|
|
2286
|
+
--tds-toggle-switch-description-color:var(--t-text-color-secondary);
|
|
2287
|
+
|
|
2288
|
+
display:var(--tds-toggle-switch-display);
|
|
2289
|
+
grid-template-columns:auto;
|
|
2290
|
+
grid-auto-columns:1fr;
|
|
2291
|
+
gap:var(--t-spacing-fourth) var(--tds-toggle-switch-column-gap);
|
|
2292
|
+
-webkit-user-select:none;
|
|
2293
|
+
-moz-user-select:none;
|
|
2294
|
+
user-select:none;
|
|
2295
|
+
}
|
|
2296
|
+
|
|
2297
|
+
.tds-toggle-switch input[type="checkbox"]{
|
|
2298
|
+
position:absolute;
|
|
2299
|
+
width:var(--tds-toggle-switch-track-width);
|
|
2300
|
+
height:var(--tds-toggle-switch-track-height);
|
|
2301
|
+
margin:0;
|
|
2302
|
+
-webkit-appearance:none;
|
|
2303
|
+
-moz-appearance:none;
|
|
2304
|
+
appearance:none;
|
|
2305
|
+
cursor:var(--tds-toggle-switch-cursor);
|
|
2306
|
+
background-color:transparent;
|
|
2307
|
+
border:0;
|
|
2308
|
+
border-radius:var(--t-border-radius-round);
|
|
2309
|
+
}
|
|
2310
|
+
|
|
2311
|
+
.tds-toggle-switch label{
|
|
2312
|
+
display:inline-flex;
|
|
2313
|
+
grid-area:1 / 2;
|
|
2314
|
+
-moz-column-gap:var(--tds-toggle-switch-column-gap);
|
|
2315
|
+
column-gap:var(--tds-toggle-switch-column-gap);
|
|
2316
|
+
margin-top:-.09375em;
|
|
2317
|
+
font-size:var(--tds-toggle-switch-font-size);
|
|
2318
|
+
font-weight:var(--t-font-weight-normal);
|
|
2319
|
+
line-height:var(--tds-toggle-switch-line-height);
|
|
2320
|
+
color:var(--tds-toggle-switch-label-color);
|
|
2321
|
+
cursor:var(--tds-toggle-switch-cursor);
|
|
2322
|
+
}
|
|
2323
|
+
|
|
2324
|
+
.tds-toggle-switch:not(:has(input:disabled)):has(input:hover){
|
|
2325
|
+
--tds-toggle-switch-track-background-color:var(--t-fill-color-neutral-025);
|
|
2326
|
+
}
|
|
2327
|
+
|
|
2328
|
+
.tds-toggle-switch:has(input:focus-visible){
|
|
2329
|
+
--tds-toggle-switch-track-outline:solid var(--t-spacing-fourth) var(--t-border-color-status-info);
|
|
2330
|
+
}
|
|
2331
|
+
|
|
2332
|
+
.tds-toggle-switch:has(input:checked){
|
|
2333
|
+
--tds-toggle-switch-track-background-color:var(--t-fill-color-control);
|
|
2334
|
+
--tds-toggle-switch-thumb-transform:translateX(calc(var(--tds-toggle-switch-track-width) - var(--tds-toggle-switch-thumb-size) - var(--t-spacing-half)));
|
|
2335
|
+
}
|
|
2336
|
+
|
|
2337
|
+
.tds-toggle-switch:has(input:checked):not(:has(input:disabled)):has(input:hover){
|
|
2338
|
+
--tds-toggle-switch-track-background-color:var(--t-fill-color-interaction-hover);
|
|
2339
|
+
}
|
|
2340
|
+
|
|
2341
|
+
.tds-toggle-switch:has(input:disabled){
|
|
2342
|
+
--tds-toggle-switch-track-background-color:var(--t-fill-color-control-disabled);
|
|
2343
|
+
--tds-toggle-switch-label-color:var(--t-text-color-disabled);
|
|
2344
|
+
--tds-toggle-switch-description-color:var(--t-text-color-disabled);
|
|
2345
|
+
--tds-toggle-switch-cursor:not-allowed;
|
|
2346
|
+
}
|
|
2347
|
+
|
|
2348
|
+
.tds-toggle-switch-track{
|
|
2349
|
+
position:relative;
|
|
2350
|
+
flex-shrink:0;
|
|
2351
|
+
width:var(--tds-toggle-switch-track-width);
|
|
2352
|
+
height:var(--tds-toggle-switch-track-height);
|
|
2353
|
+
outline:var(--tds-toggle-switch-track-outline);
|
|
2354
|
+
outline-offset:var(--t-spacing-fourth);
|
|
2355
|
+
background-color:var(--tds-toggle-switch-track-background-color);
|
|
2356
|
+
border-radius:var(--t-border-radius-round);
|
|
2357
|
+
transition:var(--tds-toggle-switch-track-transition);
|
|
2358
|
+
}
|
|
2359
|
+
|
|
2360
|
+
.tds-toggle-switch-track::before{
|
|
2361
|
+
position:absolute;
|
|
2362
|
+
top:var(--t-spacing-fourth);
|
|
2363
|
+
left:var(--t-spacing-fourth);
|
|
2364
|
+
width:var(--tds-toggle-switch-thumb-size);
|
|
2365
|
+
height:var(--tds-toggle-switch-thumb-size);
|
|
2366
|
+
content:"";
|
|
2367
|
+
background-color:#fff;
|
|
2368
|
+
border-radius:var(--t-border-radius-round);
|
|
2369
|
+
transform:var(--tds-toggle-switch-thumb-transform);
|
|
2370
|
+
transition:var(--tds-toggle-switch-thumb-transition);
|
|
2371
|
+
}
|
|
2372
|
+
|
|
2373
|
+
@media (prefers-reduced-motion: reduce){
|
|
2374
|
+
|
|
2375
|
+
.tds-toggle-switch-track{
|
|
2376
|
+
--tds-toggle-switch-track-transition:none;
|
|
2377
|
+
--tds-toggle-switch-thumb-transition:none;
|
|
2378
|
+
}
|
|
2379
|
+
}
|
|
2380
|
+
|
|
2381
|
+
.tds-toggle-switch-description{
|
|
2382
|
+
display:flex;
|
|
2383
|
+
grid-area:2 / 2;
|
|
2384
|
+
align-items:flex-start;
|
|
2385
|
+
margin:0;
|
|
2386
|
+
font-size:var(--tds-toggle-switch-description-font-size);
|
|
2387
|
+
line-height:var(--tds-toggle-switch-description-line-height);
|
|
2388
|
+
color:var(--tds-toggle-switch-description-color);
|
|
2389
|
+
cursor:text;
|
|
2390
|
+
}
|
|
2391
|
+
|
|
2392
|
+
.tds-toggle-switch--sm{
|
|
2393
|
+
--tds-toggle-switch-font-size:var(--t-font-size-sm);
|
|
2394
|
+
--tds-toggle-switch-line-height:1.35;
|
|
2395
|
+
--tds-toggle-switch-track-height:var(--t-element-size-lg);
|
|
2396
|
+
--tds-toggle-switch-thumb-size:var(--t-element-size-sm);
|
|
2397
|
+
--tds-toggle-switch-description-font-size:var(--t-font-size-xs);
|
|
2398
|
+
--tds-toggle-switch-description-line-height:1.3;
|
|
2399
|
+
}
|
|
2400
|
+
|
|
2401
|
+
.tds-toggle-switch--hide-label{
|
|
2402
|
+
--tds-toggle-switch-display:inline-flex;
|
|
2403
|
+
}
|
|
2404
|
+
|
|
2412
2405
|
.t-banner{
|
|
2413
2406
|
--t-banner-font-size:var(--t-font-size-md);
|
|
2414
2407
|
--t-banner-font-color:var(--t-text-color);
|