@m3e/fab 1.0.0-rc.1
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/LICENSE +22 -0
- package/README.md +181 -0
- package/cem.config.mjs +16 -0
- package/demo/index.html +80 -0
- package/dist/css-custom-data.json +1247 -0
- package/dist/custom-elements.json +1363 -0
- package/dist/html-custom-data.json +78 -0
- package/dist/index.js +1393 -0
- package/dist/index.js.map +1 -0
- package/dist/index.min.js +310 -0
- package/dist/index.min.js.map +1 -0
- package/dist/src/FabElement.d.ts +355 -0
- package/dist/src/FabElement.d.ts.map +1 -0
- package/dist/src/FabSize.d.ts +3 -0
- package/dist/src/FabSize.d.ts.map +1 -0
- package/dist/src/FabVariant.d.ts +3 -0
- package/dist/src/FabVariant.d.ts.map +1 -0
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/styles/FabSizeStyle.d.ts +7 -0
- package/dist/src/styles/FabSizeStyle.d.ts.map +1 -0
- package/dist/src/styles/FabSizeToken.d.ts +25 -0
- package/dist/src/styles/FabSizeToken.d.ts.map +1 -0
- package/dist/src/styles/FabStyle.d.ts +7 -0
- package/dist/src/styles/FabStyle.d.ts.map +1 -0
- package/dist/src/styles/FabVariantStyle.d.ts +7 -0
- package/dist/src/styles/FabVariantStyle.d.ts.map +1 -0
- package/dist/src/styles/FabVariantToken.d.ts +52 -0
- package/dist/src/styles/FabVariantToken.d.ts.map +1 -0
- package/dist/src/styles/index.d.ts +4 -0
- package/dist/src/styles/index.d.ts.map +1 -0
- package/eslint.config.mjs +13 -0
- package/package.json +49 -0
- package/rollup.config.js +32 -0
- package/src/FabElement.ts +448 -0
- package/src/FabSize.ts +2 -0
- package/src/FabVariant.ts +9 -0
- package/src/index.ts +3 -0
- package/src/styles/FabSizeStyle.ts +45 -0
- package/src/styles/FabSizeToken.ts +102 -0
- package/src/styles/FabStyle.ts +155 -0
- package/src/styles/FabVariantStyle.ts +95 -0
- package/src/styles/FabVariantToken.ts +1068 -0
- package/src/styles/index.ts +3 -0
- package/tsconfig.json +9 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1393 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* Copyright (c) 2025 matraic
|
|
4
|
+
* See LICENSE file in the project root for full license text.
|
|
5
|
+
*/
|
|
6
|
+
import { unsafeCSS, css, LitElement, html } from 'lit';
|
|
7
|
+
import { DesignToken, KeyboardClick, LinkButton, FormSubmitter, Focusable, DisabledInteractive, Disabled, AttachInternals, Role, PressedController, renderPseudoLink } from '@m3e/core';
|
|
8
|
+
|
|
9
|
+
/******************************************************************************
|
|
10
|
+
Copyright (c) Microsoft Corporation.
|
|
11
|
+
|
|
12
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
13
|
+
purpose with or without fee is hereby granted.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
16
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
17
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
18
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
19
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
20
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
21
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
22
|
+
***************************************************************************** */
|
|
23
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
function __decorate(decorators, target, key, desc) {
|
|
27
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
28
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
29
|
+
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;
|
|
30
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
34
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
35
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
36
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
40
|
+
var e = new Error(message);
|
|
41
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @license
|
|
46
|
+
* Copyright 2017 Google LLC
|
|
47
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
48
|
+
*/
|
|
49
|
+
const t$1=t=>(e,o)=>{ void 0!==o?o.addInitializer((()=>{customElements.define(t,e);})):customElements.define(t,e);};
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @license
|
|
53
|
+
* Copyright 2019 Google LLC
|
|
54
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
55
|
+
*/
|
|
56
|
+
const t=globalThis,e$3=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),o$2=new WeakMap;let n$2 = class n{constructor(t,e,o){if(this._$cssResult$=true,o!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o;const s=this.t;if(e$3&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o$2.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o$2.set(s,t));}return t}toString(){return this.cssText}};const r$2=t=>new n$2("string"==typeof t?t:t+"",void 0,s),S=(s,o)=>{if(e$3)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement("style"),n=t.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o);}},c$1=e$3?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$2(e)})(t):t;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @license
|
|
60
|
+
* Copyright 2017 Google LLC
|
|
61
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
62
|
+
*/const{is:i,defineProperty:e$2,getOwnPropertyDescriptor:h,getOwnPropertyNames:r$1,getOwnPropertySymbols:o$1,getPrototypeOf:n$1}=Object,a=globalThis,c=a.trustedTypes,l=c?c.emptyScript:"",p=a.reactiveElementPolyfillSupport,d=(t,s)=>t,u={toAttribute(t,s){switch(s){case Boolean:t=t?l:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t);}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t);}catch(t){i=null;}}return i}},f=(t,s)=>!i(t,s),b={attribute:true,type:String,converter:u,reflect:false,useDefault:false,hasChanged:f};Symbol.metadata??=Symbol("metadata"),a.litPropertyMetadata??=new WeakMap;class y extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t);}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=b){if(s.state&&(s.attribute=false),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=true),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),h=this.getPropertyDescriptor(t,i,s);void 0!==h&&e$2(this.prototype,t,h);}}static getPropertyDescriptor(t,s,i){const{get:e,set:r}=h(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t;}};return {get:e,set(s){const h=e?.call(this);r?.call(this,s),this.requestUpdate(t,h,i);},configurable:true,enumerable:true}}static getPropertyOptions(t){return this.elementProperties.get(t)??b}static _$Ei(){if(this.hasOwnProperty(d("elementProperties")))return;const t=n$1(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty(d("finalized")))return;if(this.finalized=true,this._$Ei(),this.hasOwnProperty(d("properties"))){const t=this.properties,s=[...r$1(t),...o$1(t)];for(const i of s)this.createProperty(i,t[i]);}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i);}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(c$1(s));}else void 0!==s&&i.push(c$1(s));return i}static _$Eu(t,s){const i=s.attribute;return false===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=false,this.hasUpdated=false,this._$Em=null,this._$Ev();}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)));}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.();}removeController(t){this._$EO?.delete(t);}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t);}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return S(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(true),this._$EO?.forEach((t=>t.hostConnected?.()));}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()));}attributeChangedCallback(t,s,i){this._$AK(t,i);}_$ET(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&true===i.reflect){const h=(void 0!==i.converter?.toAttribute?i.converter:u).toAttribute(s,i.type);this._$Em=t,null==h?this.removeAttribute(e):this.setAttribute(e,h),this._$Em=null;}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),h="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u;this._$Em=e;const r=h.fromAttribute(s,t.type);this[e]=r??this._$Ej?.get(e)??r,this._$Em=null;}}requestUpdate(t,s,i){if(void 0!==t){const e=this.constructor,h=this[t];if(i??=e.getPropertyOptions(t),!((i.hasChanged??f)(h,s)||i.useDefault&&i.reflect&&h===this._$Ej?.get(t)&&!this.hasAttribute(e._$Eu(t,i))))return;this.C(t,s,i);} false===this.isUpdatePending&&(this._$ES=this._$EP());}C(t,s,{useDefault:i,reflect:e,wrapped:h},r){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??s??this[t]),true!==h||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),true===e&&this._$Em!==t&&(this._$Eq??=new Set).add(t));}async _$EP(){this.isUpdatePending=true;try{await this._$ES;}catch(t){Promise.reject(t);}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0;}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t){const{wrapped:t}=i,e=this[s];true!==t||this._$AL.has(s)||void 0===e||this.C(s,void 0,i,e);}}let t=false;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$EM();}catch(s){throw t=false,this._$EM(),s}t&&this._$AE(s);}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=true,this.firstUpdated(t)),this.updated(t);}_$EM(){this._$AL=new Map,this.isUpdatePending=false;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return true}update(t){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM();}updated(t){}firstUpdated(t){}}y.elementStyles=[],y.shadowRootOptions={mode:"open"},y[d("elementProperties")]=new Map,y[d("finalized")]=new Map,p?.({ReactiveElement:y}),(a.reactiveElementVersions??=[]).push("2.1.1");
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* @license
|
|
66
|
+
* Copyright 2017 Google LLC
|
|
67
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
68
|
+
*/const o={attribute:true,type:String,converter:u,reflect:false,hasChanged:f},r=(t=o,e,r)=>{const{kind:n,metadata:i}=r;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),"setter"===n&&((t=Object.create(t)).wrapped=true),s.set(r.name,t),"accessor"===n){const{name:o}=r;return {set(r){const n=e.get.call(this);e.set.call(this,r),this.requestUpdate(o,n,t);},init(e){return void 0!==e&&this.C(o,void 0,t,e),e}}}if("setter"===n){const{name:o}=r;return function(r){const n=this[o];e.call(this,r),this.requestUpdate(o,n,t);}}throw Error("Unsupported decorator location: "+n)};function n(t){return (e,o)=>"object"==typeof o?r(t,e,o):((t,e,o)=>{const r=e.hasOwnProperty(o);return e.constructor.createProperty(o,t),r?Object.getOwnPropertyDescriptor(e,o):void 0})(t,e,o)}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* @license
|
|
72
|
+
* Copyright 2017 Google LLC
|
|
73
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
74
|
+
*/
|
|
75
|
+
const e$1=(e,t,c)=>(c.configurable=true,c.enumerable=true,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,c),c);
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* @license
|
|
79
|
+
* Copyright 2017 Google LLC
|
|
80
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
81
|
+
*/function e(e,r){return (n,s,i)=>{const o=t=>t.renderRoot?.querySelector(e)??null;return e$1(n,s,{get(){return o(this)}})}}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Baseline styles for `M3eFabElement`.
|
|
85
|
+
* @internal
|
|
86
|
+
*/
|
|
87
|
+
const FabStyle = css `
|
|
88
|
+
:host {
|
|
89
|
+
display: inline-block;
|
|
90
|
+
outline: none;
|
|
91
|
+
user-select: none;
|
|
92
|
+
}
|
|
93
|
+
.base {
|
|
94
|
+
box-sizing: border-box;
|
|
95
|
+
vertical-align: middle;
|
|
96
|
+
display: inline-flex;
|
|
97
|
+
align-items: center;
|
|
98
|
+
justify-content: center;
|
|
99
|
+
position: relative;
|
|
100
|
+
width: 100%;
|
|
101
|
+
transition: ${unsafeCSS(`background-color ${DesignToken.motion.duration.short4} ${DesignToken.motion.easing.standard}`)};
|
|
102
|
+
}
|
|
103
|
+
.touch {
|
|
104
|
+
position: absolute;
|
|
105
|
+
height: 3rem;
|
|
106
|
+
left: 0;
|
|
107
|
+
right: 0;
|
|
108
|
+
}
|
|
109
|
+
.wrapper {
|
|
110
|
+
width: 100%;
|
|
111
|
+
overflow: hidden;
|
|
112
|
+
display: inline-flex;
|
|
113
|
+
align-items: center;
|
|
114
|
+
}
|
|
115
|
+
.label {
|
|
116
|
+
justify-self: center;
|
|
117
|
+
flex: 1 1 auto;
|
|
118
|
+
text-align: center;
|
|
119
|
+
white-space: nowrap;
|
|
120
|
+
overflow: hidden;
|
|
121
|
+
text-overflow: ellipsis;
|
|
122
|
+
transition: ${unsafeCSS(`color ${DesignToken.motion.duration.short4} ${DesignToken.motion.easing.standard}`)};
|
|
123
|
+
}
|
|
124
|
+
.icon {
|
|
125
|
+
transition: ${unsafeCSS(`color ${DesignToken.motion.duration.short4} ${DesignToken.motion.easing.standard}`)};
|
|
126
|
+
}
|
|
127
|
+
:host(:not(:disabled):not([disabled-interactive])) {
|
|
128
|
+
cursor: pointer;
|
|
129
|
+
}
|
|
130
|
+
:host([disabled-interactive]) {
|
|
131
|
+
cursor: not-allowed;
|
|
132
|
+
}
|
|
133
|
+
.close-icon,
|
|
134
|
+
::slotted(:not([slot])),
|
|
135
|
+
::slotted([slot="close-icon"]) {
|
|
136
|
+
font-size: inherit !important;
|
|
137
|
+
flex: none;
|
|
138
|
+
}
|
|
139
|
+
.close-icon,
|
|
140
|
+
::slotted(svg:not([slot])),
|
|
141
|
+
::slotted(svg[slot="close-icon"]) {
|
|
142
|
+
width: 1em;
|
|
143
|
+
height: 1em;
|
|
144
|
+
}
|
|
145
|
+
:host(:not([extended])) ::slotted([slot="label"]),
|
|
146
|
+
.base.-with-menu ::slotted([slot="label"]),
|
|
147
|
+
.base:not(.-with-menu) ::slotted([slot="close-icon"]),
|
|
148
|
+
.base:not(.-with-menu) .close-icon,
|
|
149
|
+
:host([aria-expanded="true"]) .base.-with-menu ::slotted(:not([slot])),
|
|
150
|
+
:host([aria-expanded="false"]) .base.-with-menu ::slotted([slot="close-icon"]),
|
|
151
|
+
:host([aria-expanded="false"]) .base.-with-menu .close-icon {
|
|
152
|
+
display: none;
|
|
153
|
+
}
|
|
154
|
+
:host([aria-expanded="true"]) .base.-with-menu {
|
|
155
|
+
border-radius: var(--m3e-fab-menu-close-button-container-shape, ${DesignToken.shape.corner.full});
|
|
156
|
+
height: calc(var(--m3e-fab-menu-close-button-container-height, 3.5rem) + ${DesignToken.density.calc(-3)});
|
|
157
|
+
}
|
|
158
|
+
:host([aria-expanded="true"]) .base.-with-menu .wrapper {
|
|
159
|
+
padding-inline-start: calc(var(--m3e-fab-menu-close-button-leading-space, 1rem) + ${DesignToken.density.calc(-3)});
|
|
160
|
+
padding-inline-end: calc(var(--m3e-fab-menu-close-button-trailing-space, 1rem) + ${DesignToken.density.calc(-3)});
|
|
161
|
+
}
|
|
162
|
+
:host([aria-expanded="true"]) .base.-with-menu .icon {
|
|
163
|
+
font-size: calc(var(--m3e-fab-menu-close-button-icon-size, 1.5rem) + ${DesignToken.density.calc(-3)});
|
|
164
|
+
--m3e-icon-size: calc(var(--m3e-fab-menu-close-button-icon-size, 1.5rem) + ${DesignToken.density.calc(-3)});
|
|
165
|
+
}
|
|
166
|
+
.base.-with-menu {
|
|
167
|
+
transition: height ${DesignToken.motion.spring.fastSpatial};
|
|
168
|
+
}
|
|
169
|
+
.base.-with-menu .wrapper {
|
|
170
|
+
transition: padding ${DesignToken.motion.spring.fastSpatial};
|
|
171
|
+
}
|
|
172
|
+
a {
|
|
173
|
+
all: unset;
|
|
174
|
+
display: block;
|
|
175
|
+
position: absolute;
|
|
176
|
+
top: 0px;
|
|
177
|
+
left: 0px;
|
|
178
|
+
right: 0px;
|
|
179
|
+
bottom: 0px;
|
|
180
|
+
z-index: 1;
|
|
181
|
+
}
|
|
182
|
+
@media (forced-colors: active) {
|
|
183
|
+
.base,
|
|
184
|
+
.icon {
|
|
185
|
+
transition: none;
|
|
186
|
+
}
|
|
187
|
+
.base {
|
|
188
|
+
outline-style: solid;
|
|
189
|
+
}
|
|
190
|
+
:host([variant]:not(:disabled):not([disabled-interactive])) .base {
|
|
191
|
+
background-color: ButtonFace;
|
|
192
|
+
outline-color: ButtonText;
|
|
193
|
+
}
|
|
194
|
+
:host([variant]:not(:disabled):not([disabled-interactive])) .label,
|
|
195
|
+
:host([variant]:not(:disabled):not([disabled-interactive])) .icon {
|
|
196
|
+
color: ButtonText;
|
|
197
|
+
}
|
|
198
|
+
:host([variant]:disabled) .base,
|
|
199
|
+
:host([variant][disabled-interactive]) .base {
|
|
200
|
+
outline-color: GrayText;
|
|
201
|
+
background-color: unset;
|
|
202
|
+
}
|
|
203
|
+
:host([variant]:disabled) .label,
|
|
204
|
+
:host([variant][disabled-interactive]) .label,
|
|
205
|
+
:host([variant]:disabled) .icon,
|
|
206
|
+
:host([variant][disabled-interactive]) .icon {
|
|
207
|
+
color: GrayText;
|
|
208
|
+
}
|
|
209
|
+
:host([size="small"]) .base {
|
|
210
|
+
outline-offset: calc(0px - var(--m3e-button-small-outline-thickness, 1px));
|
|
211
|
+
outline-width: var(--m3e-button-small-outline-thickness, 1px);
|
|
212
|
+
}
|
|
213
|
+
:host([size="medium"]) .base {
|
|
214
|
+
outline-offset: calc(0px - var(--m3e-button-medium-outline-thickness, 1px));
|
|
215
|
+
outline-width: var(--m3e-button-medium-outline-thickness, 1px);
|
|
216
|
+
}
|
|
217
|
+
:host([size="large"]) .base {
|
|
218
|
+
outline-offset: calc(0px - var(--m3e-button-large-outline-thickness, 0.125rem));
|
|
219
|
+
outline-width: var(--m3e-button-large-outline-thickness, 0.125rem);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
@media (prefers-reduced-motion) {
|
|
223
|
+
.base,
|
|
224
|
+
.base.resting,
|
|
225
|
+
.base.pressed,
|
|
226
|
+
.label,
|
|
227
|
+
.icon {
|
|
228
|
+
transition: none;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
`;
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Component design tokens that control the `M3eFabElement` for all size variants.
|
|
235
|
+
* @internal
|
|
236
|
+
*/
|
|
237
|
+
const FabSizeToken = {
|
|
238
|
+
/** Design tokens that control the `small` `size` variant. */
|
|
239
|
+
small: {
|
|
240
|
+
containerHeight: unsafeCSS(`calc(var(--m3e-fab-small-container-height, 3.5rem) + ${DesignToken.density.calc(-3)})`),
|
|
241
|
+
labelTextFontSize: unsafeCSS(`var(--m3e-fab-small-label-text-font-size, ${DesignToken.typescale.standard.title.medium.fontSize})`),
|
|
242
|
+
labelTextFontWeight: unsafeCSS(`var(--m3e-fab-small-label-text-font-weight, ${DesignToken.typescale.standard.title.medium.fontWeight})`),
|
|
243
|
+
labelTextLineHeight: unsafeCSS(`var(--m3e-fab-small-label-text-line-height, ${DesignToken.typescale.standard.title.medium.lineHeight})`),
|
|
244
|
+
labelTextTracking: unsafeCSS(`var(--m3e-fab-small-label-text-tracking, ${DesignToken.typescale.standard.title.medium.tracking})`),
|
|
245
|
+
iconSize: unsafeCSS(`calc(var(--m3e-fab-small-icon-size, 1.5rem) + ${DesignToken.density.calc(-3)})`),
|
|
246
|
+
extendedIconSize: unsafeCSS("var(--m3e-fab-small-icon-size, 1.5rem)"),
|
|
247
|
+
shape: unsafeCSS(`var(--m3e-fab-small-shape, ${DesignToken.shape.corner.large})`),
|
|
248
|
+
leadingSpace: unsafeCSS(`calc(var(--m3e-fab-small-leading-space, 1rem) + ${DesignToken.density.calc(-3)})`),
|
|
249
|
+
trailingSpace: unsafeCSS(`calc(var(--m3e-fab-small-trailing-space, 1rem) + ${DesignToken.density.calc(-3)})`),
|
|
250
|
+
iconLabelSpace: unsafeCSS("var(--m3e-fab-small-icon-label-space, 0.5rem)"),
|
|
251
|
+
extendedLeadingSpace: unsafeCSS("var(--m3e-fab-small-leading-space, 1rem)"),
|
|
252
|
+
extendedTrailingSpace: unsafeCSS("var(--m3e-fab-small-trailing-space, 1rem)"),
|
|
253
|
+
},
|
|
254
|
+
/** Design tokens that control the `medium` `size` variant. */
|
|
255
|
+
medium: {
|
|
256
|
+
containerHeight: unsafeCSS(`calc(var(--m3e-fab-medium-container-height, 5rem) + ${DesignToken.density.calc(-3)})`),
|
|
257
|
+
labelTextFontSize: unsafeCSS(`var(--m3e-fab-medium-label-text-font-size, ${DesignToken.typescale.standard.title.large.fontSize})`),
|
|
258
|
+
labelTextFontWeight: unsafeCSS(`var(--m3e-fab-medium-label-text-font-weight, ${DesignToken.typescale.standard.title.large.fontWeight})`),
|
|
259
|
+
labelTextLineHeight: unsafeCSS(`var(--m3e-fab-medium-label-text-line-height, ${DesignToken.typescale.standard.title.large.lineHeight})`),
|
|
260
|
+
labelTextTracking: unsafeCSS(`var(--m3e-fab-medium-label-text-tracking, ${DesignToken.typescale.standard.title.large.tracking})`),
|
|
261
|
+
iconSize: unsafeCSS(`calc(var(--m3e-fab-medium-icon-size, 1.75rem) + ${DesignToken.density.calc(-3)})`),
|
|
262
|
+
extendedIconSize: unsafeCSS("var(--m3e-fab-medium-icon-size, 1.75rem)"),
|
|
263
|
+
shape: unsafeCSS(`var(--m3e-fab-medium-shape, ${DesignToken.shape.corner.largeIncreased})`),
|
|
264
|
+
leadingSpace: unsafeCSS(`calc(var(--m3e-fab-medium-leading-space, 1.625rem) + ${DesignToken.density.calc(-3)})`),
|
|
265
|
+
trailingSpace: unsafeCSS(`calc(var(--m3e-fab-medium-trailing-space, 1.625rem) + ${DesignToken.density.calc(-3)})`),
|
|
266
|
+
iconLabelSpace: unsafeCSS("var(--m3e-fab-medium-icon-label-space, 0.75rem)"),
|
|
267
|
+
extendedLeadingSpace: unsafeCSS("var(--m3e-fab-medium-leading-space, 1.625rem)"),
|
|
268
|
+
extendedTrailingSpace: unsafeCSS("var(--m3e-fab-medium-trailing-space, 1.625rem)"),
|
|
269
|
+
},
|
|
270
|
+
/** Design tokens that control the `large` `size` variant. */
|
|
271
|
+
large: {
|
|
272
|
+
containerHeight: unsafeCSS(`calc(var(--m3e-fab-large-container-height, 6rem) + ${DesignToken.density.calc(-3)})`),
|
|
273
|
+
labelTextFontSize: unsafeCSS(`var(--m3e-fab-large-label-text-font-size, ${DesignToken.typescale.standard.headline.small.fontSize})`),
|
|
274
|
+
labelTextFontWeight: unsafeCSS(`var(--m3e-fab-large-label-text-font-weight, ${DesignToken.typescale.standard.headline.small.fontWeight})`),
|
|
275
|
+
labelTextLineHeight: unsafeCSS(`var(--m3e-fab-large-label-text-line-height, ${DesignToken.typescale.standard.headline.small.lineHeight})`),
|
|
276
|
+
labelTextTracking: unsafeCSS(`var(--m3e-fab-large-label-text-tracking, ${DesignToken.typescale.standard.headline.small.tracking})`),
|
|
277
|
+
iconSize: unsafeCSS(`calc(var(--m3e-fab-large-icon-size, 2.25rem) + ${DesignToken.density.calc(-3)})`),
|
|
278
|
+
extendedIconSize: unsafeCSS("var(--m3e-fab-large-icon-size, 2.25rem)"),
|
|
279
|
+
shape: unsafeCSS(`var(--m3e-fab-large-shape, ${DesignToken.shape.corner.extraLarge})`),
|
|
280
|
+
leadingSpace: unsafeCSS(`calc(var(--m3e-fab-large-leading-space, 1.75rem) + ${DesignToken.density.calc(-3)})`),
|
|
281
|
+
trailingSpace: unsafeCSS(`calc(var(--m3e-fab-large-trailing-space, 1.75rem) + ${DesignToken.density.calc(-3)})`),
|
|
282
|
+
iconLabelSpace: unsafeCSS("var(--m3e-fab-large-icon-label-space, 1rem)"),
|
|
283
|
+
extendedLeadingSpace: unsafeCSS("var(--m3e-fab-large-leading-space, 1.75rem)"),
|
|
284
|
+
extendedTrailingSpace: unsafeCSS("var(--m3e-fab-large-trailing-space, 1.75rem)"),
|
|
285
|
+
},
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
/** @private */
|
|
289
|
+
function fabStyle(size) {
|
|
290
|
+
return css `
|
|
291
|
+
:host([size="${unsafeCSS(size)}"]) .base {
|
|
292
|
+
height: ${FabSizeToken[size].containerHeight};
|
|
293
|
+
}
|
|
294
|
+
:host([size="${unsafeCSS(size)}"]) .base {
|
|
295
|
+
border-radius: ${FabSizeToken[size].shape};
|
|
296
|
+
}
|
|
297
|
+
:host([size="${unsafeCSS(size)}"]) .label {
|
|
298
|
+
font-size: ${FabSizeToken[size].labelTextFontSize};
|
|
299
|
+
font-weight: ${FabSizeToken[size].labelTextFontWeight};
|
|
300
|
+
line-height: ${FabSizeToken[size].labelTextLineHeight};
|
|
301
|
+
letter-spacing: ${FabSizeToken[size].labelTextTracking};
|
|
302
|
+
}
|
|
303
|
+
:host([size="${unsafeCSS(size)}"]:not([extended])) .wrapper {
|
|
304
|
+
padding-inline-start: ${FabSizeToken[size].leadingSpace};
|
|
305
|
+
padding-inline-end: ${FabSizeToken[size].trailingSpace};
|
|
306
|
+
}
|
|
307
|
+
:host([size="${unsafeCSS(size)}"]:not([extended])) .icon {
|
|
308
|
+
font-size: ${FabSizeToken[size].iconSize};
|
|
309
|
+
--m3e-icon-size: ${FabSizeToken[size].iconSize};
|
|
310
|
+
}
|
|
311
|
+
:host([size="${unsafeCSS(size)}"][extended]) .wrapper {
|
|
312
|
+
padding-inline-start: ${FabSizeToken[size].extendedLeadingSpace};
|
|
313
|
+
padding-inline-end: ${FabSizeToken[size].extendedTrailingSpace};
|
|
314
|
+
column-gap: ${FabSizeToken[size].iconLabelSpace};
|
|
315
|
+
}
|
|
316
|
+
:host([size="${unsafeCSS(size)}"][extended]) .icon {
|
|
317
|
+
font-size: ${FabSizeToken[size].extendedIconSize};
|
|
318
|
+
--m3e-icon-size: ${FabSizeToken[size].extendedIconSize};
|
|
319
|
+
}
|
|
320
|
+
`;
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Size variant styles for `M3eFabElement`.
|
|
324
|
+
* @internal
|
|
325
|
+
*/
|
|
326
|
+
const FabSizeStyle = [fabStyle("small"), fabStyle("medium"), fabStyle("large")];
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Component design tokens that control the appearance variants of `M3FabElement`.
|
|
330
|
+
* @internal
|
|
331
|
+
*/
|
|
332
|
+
const FabVariantToken = {
|
|
333
|
+
/** Design tokens that control the `primary` variant. */
|
|
334
|
+
primary: {
|
|
335
|
+
/** Default label color. */
|
|
336
|
+
labelTextColor: unsafeCSS(`var(--m3e-primary-fab-label-text-color, ${DesignToken.color.onPrimary})`),
|
|
337
|
+
/** Default icon color. */
|
|
338
|
+
iconColor: unsafeCSS(`var(--m3e-primary-fab-icon-color, ${DesignToken.color.onPrimary})`),
|
|
339
|
+
/** Default container background color. */
|
|
340
|
+
containerColor: unsafeCSS(`var(--m3e-primary-fab-container-color, ${DesignToken.color.primary})`),
|
|
341
|
+
/** Resting elevation. */
|
|
342
|
+
containerElevation: unsafeCSS(`var(--m3e-primary-fab-container-elevation, ${DesignToken.elevation.level3})`),
|
|
343
|
+
/** Lowered resting elevation. */
|
|
344
|
+
loweredContainerElevation: unsafeCSS(`var(--m3e-primary-fab-lowered-container-elevation, ${DesignToken.elevation.level2})`),
|
|
345
|
+
/** Design tokens that control disabled state. */
|
|
346
|
+
disabled: {
|
|
347
|
+
/** Container background color when disabled. */
|
|
348
|
+
containerColor: unsafeCSS(`var(--m3e-primary-fab-disabled-container-color, ${DesignToken.color.onSurface})`),
|
|
349
|
+
/** Opacity of container when disabled. */
|
|
350
|
+
containerOpacity: unsafeCSS(`var(--m3e-primary-fab-disabled-container-opacity, 10%)`),
|
|
351
|
+
/** Icon color when disabled. */
|
|
352
|
+
iconColor: unsafeCSS(`var(--m3e-primary-fab-disabled-icon-color, ${DesignToken.color.onSurface})`),
|
|
353
|
+
/** Icon opacity when disabled. */
|
|
354
|
+
iconOpacity: unsafeCSS(`var(--m3e-primary-fab-disabled-icon-opacity, 38%)`),
|
|
355
|
+
/** Label color when disabled. */
|
|
356
|
+
labelTextColor: unsafeCSS(`var(--m3e-primary-fab-disabled-label-text-color, ${DesignToken.color.onSurface})`),
|
|
357
|
+
/** Label opacity when disabled. */
|
|
358
|
+
labelTextOpacity: unsafeCSS(`var(--m3e-primary-fab-disabled-label-text-opacity, 38%)`),
|
|
359
|
+
/** Elevation when disabled. */
|
|
360
|
+
containerElevation: unsafeCSS(`var(--m3e-primary-fab-disabled-container-elevation, ${DesignToken.elevation.level0})`),
|
|
361
|
+
/** Lowered elevation when disabled. */
|
|
362
|
+
loweredContainerElevation: unsafeCSS(`var(--m3e-primary-fab-lowered-disabled-container-elevation, ${DesignToken.elevation.level0})`),
|
|
363
|
+
},
|
|
364
|
+
/** Design tokens that control hover state. */
|
|
365
|
+
hover: {
|
|
366
|
+
/** Icon color on hover. */
|
|
367
|
+
iconColor: unsafeCSS(`var(--m3e-primary-fab-hover-icon-color, ${DesignToken.color.onPrimary})`),
|
|
368
|
+
/** Label color on hover. */
|
|
369
|
+
labelTextColor: unsafeCSS(`var(--m3e-primary-fab-hover-label-text-color, ${DesignToken.color.onPrimary})`),
|
|
370
|
+
/** State layer color on hover. */
|
|
371
|
+
stateLayerColor: unsafeCSS(`var(--m3e-primary-fab-hover-state-layer-color, ${DesignToken.color.onPrimary})`),
|
|
372
|
+
/** State layer opacity on hover. */
|
|
373
|
+
stateLayerOpacity: unsafeCSS(`var(--m3e-primary-fab-hover-state-layer-opacity, ${DesignToken.state.hoverStateLayerOpacity})`),
|
|
374
|
+
/** Elevation on hover. */
|
|
375
|
+
containerElevation: unsafeCSS(`var(--m3e-primary-fab-hover-container-elevation, ${DesignToken.elevation.level4})`),
|
|
376
|
+
/** Lowered elevation on hover. */
|
|
377
|
+
loweredContainerElevation: unsafeCSS(`var(--m3e-primary-fab-lowered-hover-container-elevation, ${DesignToken.elevation.level3})`),
|
|
378
|
+
},
|
|
379
|
+
/** Design tokens that control focus state. */
|
|
380
|
+
focus: {
|
|
381
|
+
/** Icon color on focus. */
|
|
382
|
+
iconColor: unsafeCSS(`var(--m3e-primary-fab-focus-icon-color, ${DesignToken.color.onPrimary})`),
|
|
383
|
+
/** Label color on focus. */
|
|
384
|
+
labelTextColor: unsafeCSS(`var(--m3e-primary-fab-focus-label-text-color, ${DesignToken.color.onPrimary})`),
|
|
385
|
+
/** State layer color on focus. */
|
|
386
|
+
stateLayerColor: unsafeCSS(`var(--m3e-primary-fab-focus-state-layer-color, ${DesignToken.color.onPrimary})`),
|
|
387
|
+
/**State layer opacity on focus. */
|
|
388
|
+
stateLayerOpacity: unsafeCSS(`var(--m3e-primary-fab-focus-state-layer-opacity, ${DesignToken.state.focusStateLayerOpacity})`),
|
|
389
|
+
/** Elevation on focus. */
|
|
390
|
+
containerElevation: unsafeCSS(`var(--m3e-primary-fab-focus-container-elevation, ${DesignToken.elevation.level3})`),
|
|
391
|
+
/** Lowered elevation on focus. */
|
|
392
|
+
loweredContainerElevation: unsafeCSS(`var(--m3e-primary-fab-lowered-focus-container-elevation, ${DesignToken.elevation.level2})`),
|
|
393
|
+
},
|
|
394
|
+
/** Design tokens that control pressed state. */
|
|
395
|
+
pressed: {
|
|
396
|
+
/** Icon color on pressed. */
|
|
397
|
+
iconColor: unsafeCSS(`var(--m3e-primary-fab-pressed-icon-color, ${DesignToken.color.onPrimary})`),
|
|
398
|
+
/** Label color on pressed. */
|
|
399
|
+
labelTextColor: unsafeCSS(`var(--m3e-primary-fab-pressed-label-text-color, ${DesignToken.color.onPrimary})`),
|
|
400
|
+
/** State layer color on pressed. */
|
|
401
|
+
stateLayerColor: unsafeCSS(`var(--m3e-primary-fab-pressed-state-layer-color, ${DesignToken.color.onPrimary})`),
|
|
402
|
+
/** State layer opacity on pressed. */
|
|
403
|
+
stateLayerOpacity: unsafeCSS(`var(--m3e-primary-fab-pressed-state-layer-opacity, ${DesignToken.state.pressedStateLayerOpacity})`),
|
|
404
|
+
/** Elevation on pressed. */
|
|
405
|
+
containerElevation: unsafeCSS(`var(--m3e-primary-fab-pressed-container-elevation, ${DesignToken.elevation.level3})`),
|
|
406
|
+
/** Lowered elevation on pressed. */
|
|
407
|
+
loweredContainerElevation: unsafeCSS(`var(--m3e-primary-fab-lowered-pressed-container-elevation, ${DesignToken.elevation.level2})`),
|
|
408
|
+
},
|
|
409
|
+
},
|
|
410
|
+
/** Design tokens that control the `secondary` variant. */
|
|
411
|
+
secondary: {
|
|
412
|
+
/** Default label color. */
|
|
413
|
+
labelTextColor: unsafeCSS(`var(--m3e-secondary-fab-label-text-color, ${DesignToken.color.onSecondary})`),
|
|
414
|
+
/** Default icon color. */
|
|
415
|
+
iconColor: unsafeCSS(`var(--m3e-secondary-fab-icon-color, ${DesignToken.color.onSecondary})`),
|
|
416
|
+
/** Default container background color. */
|
|
417
|
+
containerColor: unsafeCSS(`var(--m3e-secondary-fab-container-color, ${DesignToken.color.secondary})`),
|
|
418
|
+
/** Resting elevation. */
|
|
419
|
+
containerElevation: unsafeCSS(`var(--m3e-secondary-fab-container-elevation, ${DesignToken.elevation.level3})`),
|
|
420
|
+
/** Lowered resting elevation. */
|
|
421
|
+
loweredContainerElevation: unsafeCSS(`var(--m3e-secondary-fab-lowered-container-elevation, ${DesignToken.elevation.level2})`),
|
|
422
|
+
/** Design tokens that control disabled state. */
|
|
423
|
+
disabled: {
|
|
424
|
+
/** Container background color when disabled. */
|
|
425
|
+
containerColor: unsafeCSS(`var(--m3e-secondary-fab-disabled-container-color, ${DesignToken.color.onSurface})`),
|
|
426
|
+
/** Opacity of container when disabled. */
|
|
427
|
+
containerOpacity: unsafeCSS(`var(--m3e-secondary-fab-disabled-container-opacity, 10%)`),
|
|
428
|
+
/** Icon color when disabled. */
|
|
429
|
+
iconColor: unsafeCSS(`var(--m3e-secondary-fab-disabled-icon-color, ${DesignToken.color.onSurface})`),
|
|
430
|
+
/** Icon opacity when disabled. */
|
|
431
|
+
iconOpacity: unsafeCSS(`var(--m3e-secondary-fab-disabled-icon-opacity, 38%)`),
|
|
432
|
+
/** Label color when disabled. */
|
|
433
|
+
labelTextColor: unsafeCSS(`var(--m3e-secondary-fab-disabled-label-text-color, ${DesignToken.color.onSurface})`),
|
|
434
|
+
/** Label opacity when disabled. */
|
|
435
|
+
labelTextOpacity: unsafeCSS(`var(--m3e-secondary-fab-disabled-label-text-opacity, 38%)`),
|
|
436
|
+
/** Elevation when disabled. */
|
|
437
|
+
containerElevation: unsafeCSS(`var(--m3e-secondary-fab-disabled-container-elevation, ${DesignToken.elevation.level0})`),
|
|
438
|
+
/** Lowered elevation when disabled. */
|
|
439
|
+
loweredContainerElevation: unsafeCSS(`var(--m3e-secondary-fab-lowered-disabled-container-elevation, ${DesignToken.elevation.level0})`),
|
|
440
|
+
},
|
|
441
|
+
/** Design tokens that control hover state. */
|
|
442
|
+
hover: {
|
|
443
|
+
/** Icon color on hover. */
|
|
444
|
+
iconColor: unsafeCSS(`var(--m3e-secondary-fab-hover-icon-color, ${DesignToken.color.onSecondary})`),
|
|
445
|
+
/** Label color on hover. */
|
|
446
|
+
labelTextColor: unsafeCSS(`var(--m3e-secondary-fab-hover-label-text-color, ${DesignToken.color.onSecondary})`),
|
|
447
|
+
/** State layer color on hover. */
|
|
448
|
+
stateLayerColor: unsafeCSS(`var(--m3e-secondary-fab-hover-state-layer-color, ${DesignToken.color.onSecondary})`),
|
|
449
|
+
/** State layer opacity on hover. */
|
|
450
|
+
stateLayerOpacity: unsafeCSS(`var(--m3e-secondary-fab-hover-state-layer-opacity, ${DesignToken.state.hoverStateLayerOpacity})`),
|
|
451
|
+
/** Elevation on hover. */
|
|
452
|
+
containerElevation: unsafeCSS(`var(--m3e-secondary-fab-hover-container-elevation, ${DesignToken.elevation.level4})`),
|
|
453
|
+
/** Lowered elevation on hover. */
|
|
454
|
+
loweredContainerElevation: unsafeCSS(`var(--m3e-secondary-fab-lowered-hover-container-elevation, ${DesignToken.elevation.level3})`),
|
|
455
|
+
},
|
|
456
|
+
/** Design tokens that control focus state. */
|
|
457
|
+
focus: {
|
|
458
|
+
/** Icon color on focus. */
|
|
459
|
+
iconColor: unsafeCSS(`var(--m3e-secondary-fab-focus-icon-color, ${DesignToken.color.onSecondary})`),
|
|
460
|
+
/** Label color on focus. */
|
|
461
|
+
labelTextColor: unsafeCSS(`var(--m3e-secondary-fab-focus-label-text-color, ${DesignToken.color.onSecondary})`),
|
|
462
|
+
/** State layer color on focus. */
|
|
463
|
+
stateLayerColor: unsafeCSS(`var(--m3e-secondary-fab-focus-state-layer-color, ${DesignToken.color.onSecondary})`),
|
|
464
|
+
/**State layer opacity on focus. */
|
|
465
|
+
stateLayerOpacity: unsafeCSS(`var(--m3e-secondary-fab-focus-state-layer-opacity, ${DesignToken.state.focusStateLayerOpacity})`),
|
|
466
|
+
/** Elevation on focus. */
|
|
467
|
+
containerElevation: unsafeCSS(`var(--m3e-secondary-fab-focus-container-elevation, ${DesignToken.elevation.level3})`),
|
|
468
|
+
/** Lowered elevation on focus. */
|
|
469
|
+
loweredContainerElevation: unsafeCSS(`var(--m3e-secondary-fab-lowered-focus-container-elevation, ${DesignToken.elevation.level2})`),
|
|
470
|
+
},
|
|
471
|
+
/** Design tokens that control pressed state. */
|
|
472
|
+
pressed: {
|
|
473
|
+
/** Icon color on pressed. */
|
|
474
|
+
iconColor: unsafeCSS(`var(--m3e-secondary-fab-pressed-icon-color, ${DesignToken.color.onSecondary})`),
|
|
475
|
+
/** Label color on pressed. */
|
|
476
|
+
labelTextColor: unsafeCSS(`var(--m3e-secondary-fab-pressed-label-text-color, ${DesignToken.color.onSecondary})`),
|
|
477
|
+
/** State layer color on pressed. */
|
|
478
|
+
stateLayerColor: unsafeCSS(`var(--m3e-secondary-fab-pressed-state-layer-color, ${DesignToken.color.onSecondary})`),
|
|
479
|
+
/** State layer opacity on pressed. */
|
|
480
|
+
stateLayerOpacity: unsafeCSS(`var(--m3e-secondary-fab-pressed-state-layer-opacity, ${DesignToken.state.pressedStateLayerOpacity})`),
|
|
481
|
+
/** Elevation on pressed. */
|
|
482
|
+
containerElevation: unsafeCSS(`var(--m3e-secondary-fab-pressed-container-elevation, ${DesignToken.elevation.level3})`),
|
|
483
|
+
/** Lowered elevation on pressed. */
|
|
484
|
+
loweredContainerElevation: unsafeCSS(`var(--m3e-secondary-fab-lowered-pressed-container-elevation, ${DesignToken.elevation.level2})`),
|
|
485
|
+
},
|
|
486
|
+
},
|
|
487
|
+
/** Design tokens that control the `tertiary` variant. */
|
|
488
|
+
tertiary: {
|
|
489
|
+
/** Default label color. */
|
|
490
|
+
labelTextColor: unsafeCSS(`var(--m3e-tertiary-fab-label-text-color, ${DesignToken.color.onTertiary})`),
|
|
491
|
+
/** Default icon color. */
|
|
492
|
+
iconColor: unsafeCSS(`var(--m3e-tertiary-fab-icon-color, ${DesignToken.color.onTertiary})`),
|
|
493
|
+
/** Default container background color. */
|
|
494
|
+
containerColor: unsafeCSS(`var(--m3e-tertiary-fab-container-color, ${DesignToken.color.tertiary})`),
|
|
495
|
+
/** Resting elevation. */
|
|
496
|
+
containerElevation: unsafeCSS(`var(--m3e-tertiary-fab-container-elevation, ${DesignToken.elevation.level3})`),
|
|
497
|
+
/** Lowered resting elevation. */
|
|
498
|
+
loweredContainerElevation: unsafeCSS(`var(--m3e-tertiary-fab-lowered-container-elevation, ${DesignToken.elevation.level2})`),
|
|
499
|
+
/** Design tokens that control disabled state. */
|
|
500
|
+
disabled: {
|
|
501
|
+
/** Container background color when disabled. */
|
|
502
|
+
containerColor: unsafeCSS(`var(--m3e-tertiary-fab-disabled-container-color, ${DesignToken.color.onSurface})`),
|
|
503
|
+
/** Opacity of container when disabled. */
|
|
504
|
+
containerOpacity: unsafeCSS(`var(--m3e-tertiary-fab-disabled-container-opacity, 10%)`),
|
|
505
|
+
/** Icon color when disabled. */
|
|
506
|
+
iconColor: unsafeCSS(`var(--m3e-tertiary-fab-disabled-icon-color, ${DesignToken.color.onSurface})`),
|
|
507
|
+
/** Icon opacity when disabled. */
|
|
508
|
+
iconOpacity: unsafeCSS(`var(--m3e-tertiary-fab-disabled-icon-opacity, 38%)`),
|
|
509
|
+
/** Label color when disabled. */
|
|
510
|
+
labelTextColor: unsafeCSS(`var(--m3e-tertiary-fab-disabled-label-text-color, ${DesignToken.color.onSurface})`),
|
|
511
|
+
/** Label opacity when disabled. */
|
|
512
|
+
labelTextOpacity: unsafeCSS(`var(--m3e-tertiary-fab-disabled-label-text-opacity, 38%)`),
|
|
513
|
+
/** Elevation when disabled. */
|
|
514
|
+
containerElevation: unsafeCSS(`var(--m3e-tertiary-fab-disabled-container-elevation, ${DesignToken.elevation.level0})`),
|
|
515
|
+
/** Lowered elevation when disabled. */
|
|
516
|
+
loweredContainerElevation: unsafeCSS(`var(--m3e-tertiary-fab-lowered-disabled-container-elevation, ${DesignToken.elevation.level0})`),
|
|
517
|
+
},
|
|
518
|
+
/** Design tokens that control hover state. */
|
|
519
|
+
hover: {
|
|
520
|
+
/** Icon color on hover. */
|
|
521
|
+
iconColor: unsafeCSS(`var(--m3e-tertiary-fab-hover-icon-color, ${DesignToken.color.onTertiary})`),
|
|
522
|
+
/** Label color on hover. */
|
|
523
|
+
labelTextColor: unsafeCSS(`var(--m3e-tertiary-fab-hover-label-text-color, ${DesignToken.color.onTertiary})`),
|
|
524
|
+
/** State layer color on hover. */
|
|
525
|
+
stateLayerColor: unsafeCSS(`var(--m3e-tertiary-fab-hover-state-layer-color, ${DesignToken.color.onTertiary})`),
|
|
526
|
+
/** State layer opacity on hover. */
|
|
527
|
+
stateLayerOpacity: unsafeCSS(`var(--m3e-tertiary-fab-hover-state-layer-opacity, ${DesignToken.state.hoverStateLayerOpacity})`),
|
|
528
|
+
/** Elevation on hover. */
|
|
529
|
+
containerElevation: unsafeCSS(`var(--m3e-tertiary-fab-hover-container-elevation, ${DesignToken.elevation.level4})`),
|
|
530
|
+
/** Lowered elevation on hover. */
|
|
531
|
+
loweredContainerElevation: unsafeCSS(`var(--m3e-tertiary-fab-lowered-hover-container-elevation, ${DesignToken.elevation.level3})`),
|
|
532
|
+
},
|
|
533
|
+
/** Design tokens that control focus state. */
|
|
534
|
+
focus: {
|
|
535
|
+
/** Icon color on focus. */
|
|
536
|
+
iconColor: unsafeCSS(`var(--m3e-tertiary-fab-focus-icon-color, ${DesignToken.color.onTertiary})`),
|
|
537
|
+
/** Label color on focus. */
|
|
538
|
+
labelTextColor: unsafeCSS(`var(--m3e-tertiary-fab-focus-label-text-color, ${DesignToken.color.onTertiary})`),
|
|
539
|
+
/** State layer color on focus. */
|
|
540
|
+
stateLayerColor: unsafeCSS(`var(--m3e-tertiary-fab-focus-state-layer-color, ${DesignToken.color.onTertiary})`),
|
|
541
|
+
/**State layer opacity on focus. */
|
|
542
|
+
stateLayerOpacity: unsafeCSS(`var(--m3e-tertiary-fab-focus-state-layer-opacity, ${DesignToken.state.focusStateLayerOpacity})`),
|
|
543
|
+
/** Elevation on focus. */
|
|
544
|
+
containerElevation: unsafeCSS(`var(--m3e-tertiary-fab-focus-container-elevation, ${DesignToken.elevation.level3})`),
|
|
545
|
+
/** Lowered elevation on focus. */
|
|
546
|
+
loweredContainerElevation: unsafeCSS(`var(--m3e-tertiary-fab-lowered-focus-container-elevation, ${DesignToken.elevation.level2})`),
|
|
547
|
+
},
|
|
548
|
+
/** Design tokens that control pressed state. */
|
|
549
|
+
pressed: {
|
|
550
|
+
/** Icon color on pressed. */
|
|
551
|
+
iconColor: unsafeCSS(`var(--m3e-tertiary-fab-pressed-icon-color, ${DesignToken.color.onTertiary})`),
|
|
552
|
+
/** Label color on pressed. */
|
|
553
|
+
labelTextColor: unsafeCSS(`var(--m3e-tertiary-fab-pressed-label-text-color, ${DesignToken.color.onTertiary})`),
|
|
554
|
+
/** State layer color on pressed. */
|
|
555
|
+
stateLayerColor: unsafeCSS(`var(--m3e-tertiary-fab-pressed-state-layer-color, ${DesignToken.color.onTertiary})`),
|
|
556
|
+
/** State layer opacity on pressed. */
|
|
557
|
+
stateLayerOpacity: unsafeCSS(`var(--m3e-tertiary-fab-pressed-state-layer-opacity, ${DesignToken.state.pressedStateLayerOpacity})`),
|
|
558
|
+
/** Elevation on pressed. */
|
|
559
|
+
containerElevation: unsafeCSS(`var(--m3e-tertiary-fab-pressed-container-elevation, ${DesignToken.elevation.level3})`),
|
|
560
|
+
/** Lowered elevation on pressed. */
|
|
561
|
+
loweredContainerElevation: unsafeCSS(`var(--m3e-tertiary-fab-lowered-pressed-container-elevation, ${DesignToken.elevation.level2})`),
|
|
562
|
+
},
|
|
563
|
+
},
|
|
564
|
+
/** Design tokens that control the `primary-container` variant. */
|
|
565
|
+
"primary-container": {
|
|
566
|
+
/** Default label color. */
|
|
567
|
+
labelTextColor: unsafeCSS(`var(--m3e-primary-container-fab-label-text-color, ${DesignToken.color.onPrimaryContainer})`),
|
|
568
|
+
/** Default icon color. */
|
|
569
|
+
iconColor: unsafeCSS(`var(--m3e-primary-container-fab-icon-color, ${DesignToken.color.onPrimaryContainer})`),
|
|
570
|
+
/** Default container background color. */
|
|
571
|
+
containerColor: unsafeCSS(`var(--m3e-primary-container-fab-container-color, ${DesignToken.color.primaryContainer})`),
|
|
572
|
+
/** Resting elevation. */
|
|
573
|
+
containerElevation: unsafeCSS(`var(--m3e-primary-container-fab-container-elevation, ${DesignToken.elevation.level3})`),
|
|
574
|
+
/** Lowered resting elevation. */
|
|
575
|
+
loweredContainerElevation: unsafeCSS(`var(--m3e-primary-container-fab-lowered-container-elevation, ${DesignToken.elevation.level2})`),
|
|
576
|
+
/** Design tokens that control disabled state. */
|
|
577
|
+
disabled: {
|
|
578
|
+
/** Container background color when disabled. */
|
|
579
|
+
containerColor: unsafeCSS(`var(--m3e-primary-container-fab-disabled-container-color, ${DesignToken.color.onSurface})`),
|
|
580
|
+
/** Opacity of container when disabled. */
|
|
581
|
+
containerOpacity: unsafeCSS(`var(--m3e-primary-container-fab-disabled-container-opacity, 10%)`),
|
|
582
|
+
/** Icon color when disabled. */
|
|
583
|
+
iconColor: unsafeCSS(`var(--m3e-primary-container-fab-disabled-icon-color, ${DesignToken.color.onSurface})`),
|
|
584
|
+
/** Icon opacity when disabled. */
|
|
585
|
+
iconOpacity: unsafeCSS(`var(--m3e-primary-container-fab-disabled-icon-opacity, 38%)`),
|
|
586
|
+
/** Label color when disabled. */
|
|
587
|
+
labelTextColor: unsafeCSS(`var(--m3e-primary-container-fab-disabled-label-text-color, ${DesignToken.color.onSurface})`),
|
|
588
|
+
/** Label opacity when disabled. */
|
|
589
|
+
labelTextOpacity: unsafeCSS(`var(--m3e-primary-container-fab-disabled-label-text-opacity, 38%)`),
|
|
590
|
+
/** Elevation when disabled. */
|
|
591
|
+
containerElevation: unsafeCSS(`var(--m3e-primary-container-fab-disabled-container-elevation, ${DesignToken.elevation.level0})`),
|
|
592
|
+
/** Lowered elevation when disabled. */
|
|
593
|
+
loweredContainerElevation: unsafeCSS(`var(--m3e-primary-container-fab-lowered-disabled-container-elevation, ${DesignToken.elevation.level0})`),
|
|
594
|
+
},
|
|
595
|
+
/** Design tokens that control hover state. */
|
|
596
|
+
hover: {
|
|
597
|
+
/** Icon color on hover. */
|
|
598
|
+
iconColor: unsafeCSS(`var(--m3e-primary-container-fab-hover-icon-color, ${DesignToken.color.onPrimaryContainer})`),
|
|
599
|
+
/** Label color on hover. */
|
|
600
|
+
labelTextColor: unsafeCSS(`var(--m3e-primary-container-fab-hover-label-text-color, ${DesignToken.color.onPrimaryContainer})`),
|
|
601
|
+
/** State layer color on hover. */
|
|
602
|
+
stateLayerColor: unsafeCSS(`var(--m3e-primary-container-fab-hover-state-layer-color, ${DesignToken.color.onPrimaryContainer})`),
|
|
603
|
+
/** State layer opacity on hover. */
|
|
604
|
+
stateLayerOpacity: unsafeCSS(`var(--m3e-primary-container-fab-hover-state-layer-opacity, ${DesignToken.state.hoverStateLayerOpacity})`),
|
|
605
|
+
/** Elevation on hover. */
|
|
606
|
+
containerElevation: unsafeCSS(`var(--m3e-primary-container-fab-hover-container-elevation, ${DesignToken.elevation.level4})`),
|
|
607
|
+
/** Lowered elevation on hover. */
|
|
608
|
+
loweredContainerElevation: unsafeCSS(`var(--m3e-primary-container-fab-lowered-hover-container-elevation, ${DesignToken.elevation.level3})`),
|
|
609
|
+
},
|
|
610
|
+
/** Design tokens that control focus state. */
|
|
611
|
+
focus: {
|
|
612
|
+
/** Icon color on focus. */
|
|
613
|
+
iconColor: unsafeCSS(`var(--m3e-primary-container-fab-focus-icon-color, ${DesignToken.color.onPrimaryContainer})`),
|
|
614
|
+
/** Label color on focus. */
|
|
615
|
+
labelTextColor: unsafeCSS(`var(--m3e-primary-container-fab-focus-label-text-color, ${DesignToken.color.onPrimaryContainer})`),
|
|
616
|
+
/** State layer color on focus. */
|
|
617
|
+
stateLayerColor: unsafeCSS(`var(--m3e-primary-container-fab-focus-state-layer-color, ${DesignToken.color.onPrimaryContainer})`),
|
|
618
|
+
/**State layer opacity on focus. */
|
|
619
|
+
stateLayerOpacity: unsafeCSS(`var(--m3e-primary-container-fab-focus-state-layer-opacity, ${DesignToken.state.focusStateLayerOpacity})`),
|
|
620
|
+
/** Elevation on focus. */
|
|
621
|
+
containerElevation: unsafeCSS(`var(--m3e-primary-container-fab-focus-container-elevation, ${DesignToken.elevation.level3})`),
|
|
622
|
+
/** Lowered elevation on focus. */
|
|
623
|
+
loweredContainerElevation: unsafeCSS(`var(--m3e-primary-container-fab-lowered-focus-container-elevation, ${DesignToken.elevation.level2})`),
|
|
624
|
+
},
|
|
625
|
+
/** Design tokens that control pressed state. */
|
|
626
|
+
pressed: {
|
|
627
|
+
/** Icon color on pressed. */
|
|
628
|
+
iconColor: unsafeCSS(`var(--m3e-primary-container-fab-pressed-icon-color, ${DesignToken.color.onPrimaryContainer})`),
|
|
629
|
+
/** Label color on pressed. */
|
|
630
|
+
labelTextColor: unsafeCSS(`var(--m3e-primary-container-fab-pressed-label-text-color, ${DesignToken.color.onPrimaryContainer})`),
|
|
631
|
+
/** State layer color on pressed. */
|
|
632
|
+
stateLayerColor: unsafeCSS(`var(--m3e-primary-container-fab-pressed-state-layer-color, ${DesignToken.color.onPrimaryContainer})`),
|
|
633
|
+
/** State layer opacity on pressed. */
|
|
634
|
+
stateLayerOpacity: unsafeCSS(`var(--m3e-primary-container-fab-pressed-state-layer-opacity, ${DesignToken.state.pressedStateLayerOpacity})`),
|
|
635
|
+
/** Elevation on pressed. */
|
|
636
|
+
containerElevation: unsafeCSS(`var(--m3e-primary-container-fab-pressed-container-elevation, ${DesignToken.elevation.level3})`),
|
|
637
|
+
/** Lowered elevation on pressed. */
|
|
638
|
+
loweredContainerElevation: unsafeCSS(`var(--m3e-primary-container-fab-lowered-pressed-container-elevation, ${DesignToken.elevation.level2})`),
|
|
639
|
+
},
|
|
640
|
+
},
|
|
641
|
+
/** Design tokens that control the `secondary-container` variant. */
|
|
642
|
+
"secondary-container": {
|
|
643
|
+
/** Default label color. */
|
|
644
|
+
labelTextColor: unsafeCSS(`var(--m3e-secondary-container-fab-label-text-color, ${DesignToken.color.onSecondaryContainer})`),
|
|
645
|
+
/** Default icon color. */
|
|
646
|
+
iconColor: unsafeCSS(`var(--m3e-secondary-container-fab-icon-color, ${DesignToken.color.onSecondaryContainer})`),
|
|
647
|
+
/** Default container background color. */
|
|
648
|
+
containerColor: unsafeCSS(`var(--m3e-secondary-container-fab-container-color, ${DesignToken.color.secondaryContainer})`),
|
|
649
|
+
/** Resting elevation. */
|
|
650
|
+
containerElevation: unsafeCSS(`var(--m3e-secondary-container-fab-container-elevation, ${DesignToken.elevation.level3})`),
|
|
651
|
+
/** Lowered resting elevation. */
|
|
652
|
+
loweredContainerElevation: unsafeCSS(`var(--m3e-secondary-container-fab-lowered-container-elevation, ${DesignToken.elevation.level2})`),
|
|
653
|
+
/** Design tokens that control disabled state. */
|
|
654
|
+
disabled: {
|
|
655
|
+
/** Container background color when disabled. */
|
|
656
|
+
containerColor: unsafeCSS(`var(--m3e-secondary-container-fab-disabled-container-color, ${DesignToken.color.onSurface})`),
|
|
657
|
+
/** Opacity of container when disabled. */
|
|
658
|
+
containerOpacity: unsafeCSS(`var(--m3e-secondary-container-fab-disabled-container-opacity, 10%)`),
|
|
659
|
+
/** Icon color when disabled. */
|
|
660
|
+
iconColor: unsafeCSS(`var(--m3e-secondary-container-fab-disabled-icon-color, ${DesignToken.color.onSurface})`),
|
|
661
|
+
/** Icon opacity when disabled. */
|
|
662
|
+
iconOpacity: unsafeCSS(`var(--m3e-secondary-container-fab-disabled-icon-opacity, 38%)`),
|
|
663
|
+
/** Label color when disabled. */
|
|
664
|
+
labelTextColor: unsafeCSS(`var(--m3e-secondary-container-fab-disabled-label-text-color, ${DesignToken.color.onSurface})`),
|
|
665
|
+
/** Label opacity when disabled. */
|
|
666
|
+
labelTextOpacity: unsafeCSS(`var(--m3e-secondary-container-fab-disabled-label-text-opacity, 38%)`),
|
|
667
|
+
/** Elevation when disabled. */
|
|
668
|
+
containerElevation: unsafeCSS(`var(--m3e-secondary-container-fab-disabled-container-elevation, ${DesignToken.elevation.level0})`),
|
|
669
|
+
/** Lowered elevation when disabled. */
|
|
670
|
+
loweredContainerElevation: unsafeCSS(`var(--m3e-secondary-container-fab-lowered-disabled-container-elevation, ${DesignToken.elevation.level0})`),
|
|
671
|
+
},
|
|
672
|
+
/** Design tokens that control hover state. */
|
|
673
|
+
hover: {
|
|
674
|
+
/** Icon color on hover. */
|
|
675
|
+
iconColor: unsafeCSS(`var(--m3e-secondary-container-fab-hover-icon-color, ${DesignToken.color.onSecondaryContainer})`),
|
|
676
|
+
/** Label color on hover. */
|
|
677
|
+
labelTextColor: unsafeCSS(`var(--m3e-secondary-container-fab-hover-label-text-color, ${DesignToken.color.onSecondaryContainer})`),
|
|
678
|
+
/** State layer color on hover. */
|
|
679
|
+
stateLayerColor: unsafeCSS(`var(--m3e-secondary-container-fab-hover-state-layer-color, ${DesignToken.color.onSecondaryContainer})`),
|
|
680
|
+
/** State layer opacity on hover. */
|
|
681
|
+
stateLayerOpacity: unsafeCSS(`var(--m3e-secondary-container-fab-hover-state-layer-opacity, ${DesignToken.state.hoverStateLayerOpacity})`),
|
|
682
|
+
/** Elevation on hover. */
|
|
683
|
+
containerElevation: unsafeCSS(`var(--m3e-secondary-container-fab-hover-container-elevation, ${DesignToken.elevation.level4})`),
|
|
684
|
+
/** Lowered elevation on hover. */
|
|
685
|
+
loweredContainerElevation: unsafeCSS(`var(--m3e-secondary-container-fab-lowered-hover-container-elevation, ${DesignToken.elevation.level3})`),
|
|
686
|
+
},
|
|
687
|
+
/** Design tokens that control focus state. */
|
|
688
|
+
focus: {
|
|
689
|
+
/** Icon color on focus. */
|
|
690
|
+
iconColor: unsafeCSS(`var(--m3e-secondary-container-fab-focus-icon-color, ${DesignToken.color.onSecondaryContainer})`),
|
|
691
|
+
/** Label color on focus. */
|
|
692
|
+
labelTextColor: unsafeCSS(`var(--m3e-secondary-container-fab-focus-label-text-color, ${DesignToken.color.onSecondaryContainer})`),
|
|
693
|
+
/** State layer color on focus. */
|
|
694
|
+
stateLayerColor: unsafeCSS(`var(--m3e-secondary-container-fab-focus-state-layer-color, ${DesignToken.color.onSecondaryContainer})`),
|
|
695
|
+
/**State layer opacity on focus. */
|
|
696
|
+
stateLayerOpacity: unsafeCSS(`var(--m3e-secondary-container-fab-focus-state-layer-opacity, ${DesignToken.state.focusStateLayerOpacity})`),
|
|
697
|
+
/** Elevation on focus. */
|
|
698
|
+
containerElevation: unsafeCSS(`var(--m3e-secondary-container-fab-focus-container-elevation, ${DesignToken.elevation.level3})`),
|
|
699
|
+
/** Lowered elevation on focus. */
|
|
700
|
+
loweredContainerElevation: unsafeCSS(`var(--m3e-secondary-container-fab-lowered-focus-container-elevation, ${DesignToken.elevation.level2})`),
|
|
701
|
+
},
|
|
702
|
+
/** Design tokens that control pressed state. */
|
|
703
|
+
pressed: {
|
|
704
|
+
/** Icon color on pressed. */
|
|
705
|
+
iconColor: unsafeCSS(`var(--m3e-secondary-container-fab-pressed-icon-color, ${DesignToken.color.onSecondaryContainer})`),
|
|
706
|
+
/** Label color on pressed. */
|
|
707
|
+
labelTextColor: unsafeCSS(`var(--m3e-secondary-container-fab-pressed-label-text-color, ${DesignToken.color.onSecondaryContainer})`),
|
|
708
|
+
/** State layer color on pressed. */
|
|
709
|
+
stateLayerColor: unsafeCSS(`var(--m3e-secondary-container-fab-pressed-state-layer-color, ${DesignToken.color.onSecondaryContainer})`),
|
|
710
|
+
/** State layer opacity on pressed. */
|
|
711
|
+
stateLayerOpacity: unsafeCSS(`var(--m3e-secondary-container-fab-pressed-state-layer-opacity, ${DesignToken.state.pressedStateLayerOpacity})`),
|
|
712
|
+
/** Elevation on pressed. */
|
|
713
|
+
containerElevation: unsafeCSS(`var(--m3e-secondary-container-fab-pressed-container-elevation, ${DesignToken.elevation.level3})`),
|
|
714
|
+
/** Lowered elevation on pressed. */
|
|
715
|
+
loweredContainerElevation: unsafeCSS(`var(--m3e-secondary-container-fab-lowered-pressed-container-elevation, ${DesignToken.elevation.level2})`),
|
|
716
|
+
},
|
|
717
|
+
},
|
|
718
|
+
/** Design tokens that control the `tertiary-container` variant. */
|
|
719
|
+
"tertiary-container": {
|
|
720
|
+
/** Default label color. */
|
|
721
|
+
labelTextColor: unsafeCSS(`var(--m3e-tertiary-container-fab-label-text-color, ${DesignToken.color.onTertiaryContainer})`),
|
|
722
|
+
/** Default icon color. */
|
|
723
|
+
iconColor: unsafeCSS(`var(--m3e-tertiary-container-fab-icon-color, ${DesignToken.color.onTertiaryContainer})`),
|
|
724
|
+
/** Default container background color. */
|
|
725
|
+
containerColor: unsafeCSS(`var(--m3e-tertiary-container-fab-container-color, ${DesignToken.color.tertiaryContainer})`),
|
|
726
|
+
/** Resting elevation. */
|
|
727
|
+
containerElevation: unsafeCSS(`var(--m3e-tertiary-container-fab-container-elevation, ${DesignToken.elevation.level3})`),
|
|
728
|
+
/** Lowered resting elevation. */
|
|
729
|
+
loweredContainerElevation: unsafeCSS(`var(--m3e-tertiary-container-fab-lowered-container-elevation, ${DesignToken.elevation.level2})`),
|
|
730
|
+
/** Design tokens that control disabled state. */
|
|
731
|
+
disabled: {
|
|
732
|
+
/** Container background color when disabled. */
|
|
733
|
+
containerColor: unsafeCSS(`var(--m3e-tertiary-container-fab-disabled-container-color, ${DesignToken.color.onSurface})`),
|
|
734
|
+
/** Opacity of container when disabled. */
|
|
735
|
+
containerOpacity: unsafeCSS(`var(--m3e-tertiary-container-fab-disabled-container-opacity, 10%)`),
|
|
736
|
+
/** Icon color when disabled. */
|
|
737
|
+
iconColor: unsafeCSS(`var(--m3e-tertiary-container-fab-disabled-icon-color, ${DesignToken.color.onSurface})`),
|
|
738
|
+
/** Icon opacity when disabled. */
|
|
739
|
+
iconOpacity: unsafeCSS(`var(--m3e-tertiary-container-fab-disabled-icon-opacity, 38%)`),
|
|
740
|
+
/** Label color when disabled. */
|
|
741
|
+
labelTextColor: unsafeCSS(`var(--m3e-tertiary-container-fab-disabled-label-text-color, ${DesignToken.color.onSurface})`),
|
|
742
|
+
/** Label opacity when disabled. */
|
|
743
|
+
labelTextOpacity: unsafeCSS(`var(--m3e-tertiary-container-fab-disabled-label-text-opacity, 38%)`),
|
|
744
|
+
/** Elevation when disabled. */
|
|
745
|
+
containerElevation: unsafeCSS(`var(--m3e-tertiary-container-fab-disabled-container-elevation, ${DesignToken.elevation.level0})`),
|
|
746
|
+
/** Lowered elevation when disabled. */
|
|
747
|
+
loweredContainerElevation: unsafeCSS(`var(--m3e-tertiary-container-fab-lowered-disabled-container-elevation, ${DesignToken.elevation.level0})`),
|
|
748
|
+
},
|
|
749
|
+
/** Design tokens that control hover state. */
|
|
750
|
+
hover: {
|
|
751
|
+
/** Icon color on hover. */
|
|
752
|
+
iconColor: unsafeCSS(`var(--m3e-tertiary-container-fab-hover-icon-color, ${DesignToken.color.onTertiaryContainer})`),
|
|
753
|
+
/** Label color on hover. */
|
|
754
|
+
labelTextColor: unsafeCSS(`var(--m3e-tertiary-container-fab-hover-label-text-color, ${DesignToken.color.onTertiaryContainer})`),
|
|
755
|
+
/** State layer color on hover. */
|
|
756
|
+
stateLayerColor: unsafeCSS(`var(--m3e-tertiary-container-fab-hover-state-layer-color, ${DesignToken.color.onTertiaryContainer})`),
|
|
757
|
+
/** State layer opacity on hover. */
|
|
758
|
+
stateLayerOpacity: unsafeCSS(`var(--m3e-tertiary-container-fab-hover-state-layer-opacity, ${DesignToken.state.hoverStateLayerOpacity})`),
|
|
759
|
+
/** Elevation on hover. */
|
|
760
|
+
containerElevation: unsafeCSS(`var(--m3e-tertiary-container-fab-hover-container-elevation, ${DesignToken.elevation.level4})`),
|
|
761
|
+
/** Lowered elevation on hover. */
|
|
762
|
+
loweredContainerElevation: unsafeCSS(`var(--m3e-tertiary-container-fab-lowered-hover-container-elevation, ${DesignToken.elevation.level3})`),
|
|
763
|
+
},
|
|
764
|
+
/** Design tokens that control focus state. */
|
|
765
|
+
focus: {
|
|
766
|
+
/** Icon color on focus. */
|
|
767
|
+
iconColor: unsafeCSS(`var(--m3e-tertiary-container-fab-focus-icon-color, ${DesignToken.color.onTertiaryContainer})`),
|
|
768
|
+
/** Label color on focus. */
|
|
769
|
+
labelTextColor: unsafeCSS(`var(--m3e-tertiary-container-fab-focus-label-text-color, ${DesignToken.color.onTertiaryContainer})`),
|
|
770
|
+
/** State layer color on focus. */
|
|
771
|
+
stateLayerColor: unsafeCSS(`var(--m3e-tertiary-container-fab-focus-state-layer-color, ${DesignToken.color.onTertiaryContainer})`),
|
|
772
|
+
/**State layer opacity on focus. */
|
|
773
|
+
stateLayerOpacity: unsafeCSS(`var(--m3e-tertiary-container-fab-focus-state-layer-opacity, ${DesignToken.state.focusStateLayerOpacity})`),
|
|
774
|
+
/** Elevation on focus. */
|
|
775
|
+
containerElevation: unsafeCSS(`var(--m3e-tertiary-container-fab-focus-container-elevation, ${DesignToken.elevation.level3})`),
|
|
776
|
+
/** Lowered elevation on focus. */
|
|
777
|
+
loweredContainerElevation: unsafeCSS(`var(--m3e-tertiary-container-fab-lowered-focus-container-elevation, ${DesignToken.elevation.level2})`),
|
|
778
|
+
},
|
|
779
|
+
/** Design tokens that control pressed state. */
|
|
780
|
+
pressed: {
|
|
781
|
+
/** Icon color on pressed. */
|
|
782
|
+
iconColor: unsafeCSS(`var(--m3e-tertiary-container-fab-pressed-icon-color, ${DesignToken.color.onTertiaryContainer})`),
|
|
783
|
+
/** Label color on pressed. */
|
|
784
|
+
labelTextColor: unsafeCSS(`var(--m3e-tertiary-container-fab-pressed-label-text-color, ${DesignToken.color.onTertiaryContainer})`),
|
|
785
|
+
/** State layer color on pressed. */
|
|
786
|
+
stateLayerColor: unsafeCSS(`var(--m3e-tertiary-container-fab-pressed-state-layer-color, ${DesignToken.color.onTertiaryContainer})`),
|
|
787
|
+
/** State layer opacity on pressed. */
|
|
788
|
+
stateLayerOpacity: unsafeCSS(`var(--m3e-tertiary-container-fab-pressed-state-layer-opacity, ${DesignToken.state.pressedStateLayerOpacity})`),
|
|
789
|
+
/** Elevation on pressed. */
|
|
790
|
+
containerElevation: unsafeCSS(`var(--m3e-tertiary-container-fab-pressed-container-elevation, ${DesignToken.elevation.level3})`),
|
|
791
|
+
/** Lowered elevation on pressed. */
|
|
792
|
+
loweredContainerElevation: unsafeCSS(`var(--m3e-tertiary-container-fab-lowered-pressed-container-elevation, ${DesignToken.elevation.level2})`),
|
|
793
|
+
},
|
|
794
|
+
},
|
|
795
|
+
/** Design tokens that control the `surface` variant. */
|
|
796
|
+
surface: {
|
|
797
|
+
/** Default label color. */
|
|
798
|
+
labelTextColor: unsafeCSS(`var(--m3e-surface-fab-label-text-color, ${DesignToken.color.primary})`),
|
|
799
|
+
/** Default icon color. */
|
|
800
|
+
iconColor: unsafeCSS(`var(--m3e-surface-fab-icon-color, ${DesignToken.color.primary})`),
|
|
801
|
+
/** Default container background color. */
|
|
802
|
+
containerColor: unsafeCSS(`var(--m3e-surface-fab-container-color, ${DesignToken.color.surfaceContainerHigh})`),
|
|
803
|
+
/** Resting elevation. */
|
|
804
|
+
containerElevation: unsafeCSS(`var(--m3e-surface-fab-container-elevation, ${DesignToken.elevation.level3})`),
|
|
805
|
+
/** Lowered resting elevation. */
|
|
806
|
+
loweredContainerElevation: unsafeCSS(`var(--m3e-surface-fab-lowered-container-elevation, ${DesignToken.elevation.level2})`),
|
|
807
|
+
/** Lowered container background color. */
|
|
808
|
+
loweredContainerColor: unsafeCSS(`var(--m3e-surface-fab-lowered-container-color, ${DesignToken.color.surfaceContainerLow})`),
|
|
809
|
+
/** Design tokens that control disabled state. */
|
|
810
|
+
disabled: {
|
|
811
|
+
/** Container background color when disabled. */
|
|
812
|
+
containerColor: unsafeCSS(`var(--m3e-surface-fab-disabled-container-color, ${DesignToken.color.onSurface})`),
|
|
813
|
+
/** Opacity of container when disabled. */
|
|
814
|
+
containerOpacity: unsafeCSS(`var(--m3e-surface-fab-disabled-container-opacity, 10%)`),
|
|
815
|
+
/** Icon color when disabled. */
|
|
816
|
+
iconColor: unsafeCSS(`var(--m3e-surface-fab-disabled-icon-color, ${DesignToken.color.onSurface})`),
|
|
817
|
+
/** Icon opacity when disabled. */
|
|
818
|
+
iconOpacity: unsafeCSS(`var(--m3e-surface-fab-disabled-icon-opacity, 38%)`),
|
|
819
|
+
/** Label color when disabled. */
|
|
820
|
+
labelTextColor: unsafeCSS(`var(--m3e-surface-fab-disabled-label-text-color, ${DesignToken.color.onSurface})`),
|
|
821
|
+
/** Label opacity when disabled. */
|
|
822
|
+
labelTextOpacity: unsafeCSS(`var(--m3e-surface-fab-disabled-label-text-opacity, 38%)`),
|
|
823
|
+
/** Elevation when disabled. */
|
|
824
|
+
containerElevation: unsafeCSS(`var(--m3e-surface-fab-disabled-container-elevation, ${DesignToken.elevation.level0})`),
|
|
825
|
+
/** Lowered elevation when disabled. */
|
|
826
|
+
loweredContainerElevation: unsafeCSS(`var(--m3e-surface-fab-lowered-disabled-container-elevation, ${DesignToken.elevation.level0})`),
|
|
827
|
+
},
|
|
828
|
+
/** Design tokens that control hover state. */
|
|
829
|
+
hover: {
|
|
830
|
+
/** Icon color on hover. */
|
|
831
|
+
iconColor: unsafeCSS(`var(--m3e-surface-fab-hover-icon-color, ${DesignToken.color.primary})`),
|
|
832
|
+
/** Label color on hover. */
|
|
833
|
+
labelTextColor: unsafeCSS(`var(--m3e-surface-fab-hover-label-text-color, ${DesignToken.color.primary})`),
|
|
834
|
+
/** State layer color on hover. */
|
|
835
|
+
stateLayerColor: unsafeCSS(`var(--m3e-surface-fab-hover-state-layer-color, ${DesignToken.color.primary})`),
|
|
836
|
+
/** State layer opacity on hover. */
|
|
837
|
+
stateLayerOpacity: unsafeCSS(`var(--m3e-surface-fab-hover-state-layer-opacity, ${DesignToken.state.hoverStateLayerOpacity})`),
|
|
838
|
+
/** Elevation on hover. */
|
|
839
|
+
containerElevation: unsafeCSS(`var(--m3e-surface-fab-hover-container-elevation, ${DesignToken.elevation.level4})`),
|
|
840
|
+
/** Lowered elevation on hover. */
|
|
841
|
+
loweredContainerElevation: unsafeCSS(`var(--m3e-surface-fab-lowered-hover-container-elevation, ${DesignToken.elevation.level3})`),
|
|
842
|
+
},
|
|
843
|
+
/** Design tokens that control focus state. */
|
|
844
|
+
focus: {
|
|
845
|
+
/** Icon color on focus. */
|
|
846
|
+
iconColor: unsafeCSS(`var(--m3e-surface-fab-focus-icon-color, ${DesignToken.color.primary})`),
|
|
847
|
+
/** Label color on focus. */
|
|
848
|
+
labelTextColor: unsafeCSS(`var(--m3e-surface-fab-focus-label-text-color, ${DesignToken.color.primary})`),
|
|
849
|
+
/** State layer color on focus. */
|
|
850
|
+
stateLayerColor: unsafeCSS(`var(--m3e-surface-fab-focus-state-layer-color, ${DesignToken.color.primary})`),
|
|
851
|
+
/**State layer opacity on focus. */
|
|
852
|
+
stateLayerOpacity: unsafeCSS(`var(--m3e-surface-fab-focus-state-layer-opacity, ${DesignToken.state.focusStateLayerOpacity})`),
|
|
853
|
+
/** Elevation on focus. */
|
|
854
|
+
containerElevation: unsafeCSS(`var(--m3e-surface-fab-focus-container-elevation, ${DesignToken.elevation.level3})`),
|
|
855
|
+
/** Lowered elevation on focus. */
|
|
856
|
+
loweredContainerElevation: unsafeCSS(`var(--m3e-surface-fab-lowered-focus-container-elevation, ${DesignToken.elevation.level2})`),
|
|
857
|
+
},
|
|
858
|
+
/** Design tokens that control pressed state. */
|
|
859
|
+
pressed: {
|
|
860
|
+
/** Icon color on pressed. */
|
|
861
|
+
iconColor: unsafeCSS(`var(--m3e-surface-fab-pressed-icon-color, ${DesignToken.color.primary})`),
|
|
862
|
+
/** Label color on pressed. */
|
|
863
|
+
labelTextColor: unsafeCSS(`var(--m3e-surface-fab-pressed-label-text-color, ${DesignToken.color.primary})`),
|
|
864
|
+
/** State layer color on pressed. */
|
|
865
|
+
stateLayerColor: unsafeCSS(`var(--m3e-surface-fab-pressed-state-layer-color, ${DesignToken.color.primary})`),
|
|
866
|
+
/** State layer opacity on pressed. */
|
|
867
|
+
stateLayerOpacity: unsafeCSS(`var(--m3e-surface-fab-pressed-state-layer-opacity, ${DesignToken.state.pressedStateLayerOpacity})`),
|
|
868
|
+
/** Elevation on pressed. */
|
|
869
|
+
containerElevation: unsafeCSS(`var(--m3e-surface-fab-pressed-container-elevation, ${DesignToken.elevation.level3})`),
|
|
870
|
+
/** Lowered elevation on pressed. */
|
|
871
|
+
loweredContainerElevation: unsafeCSS(`var(--m3e-surface-fab-lowered-pressed-container-elevation, ${DesignToken.elevation.level2})`),
|
|
872
|
+
},
|
|
873
|
+
},
|
|
874
|
+
};
|
|
875
|
+
|
|
876
|
+
/** @private */
|
|
877
|
+
function fabVariantStyle(variant) {
|
|
878
|
+
return css `
|
|
879
|
+
:host([variant="${unsafeCSS(variant)}"]:not([lowered])) .base {
|
|
880
|
+
background-color: ${FabVariantToken[variant].containerColor};
|
|
881
|
+
--m3e-elevation-level: ${FabVariantToken[variant].containerElevation};
|
|
882
|
+
--m3e-elevation-hover-level: ${FabVariantToken[variant].hover.containerElevation};
|
|
883
|
+
--m3e-elevation-focus-level: ${FabVariantToken[variant].focus.containerElevation};
|
|
884
|
+
--m3e-elevation-pressed-level: ${FabVariantToken[variant].pressed.containerElevation};
|
|
885
|
+
}
|
|
886
|
+
:host([variant="${unsafeCSS(variant)}"][lowered]) .base {
|
|
887
|
+
background-color: ${FabVariantToken[variant].loweredContainerColor ?? FabVariantToken[variant].containerColor};
|
|
888
|
+
--m3e-elevation-level: ${FabVariantToken[variant].loweredContainerElevation};
|
|
889
|
+
--m3e-elevation-hover-level: ${FabVariantToken[variant].hover.loweredContainerElevation};
|
|
890
|
+
--m3e-elevation-focus-level: ${FabVariantToken[variant].focus.loweredContainerElevation};
|
|
891
|
+
--m3e-elevation-pressed-level: ${FabVariantToken[variant].pressed.loweredContainerElevation};
|
|
892
|
+
}
|
|
893
|
+
:host([variant="${unsafeCSS(variant)}"]) .base {
|
|
894
|
+
--m3e-state-layer-hover-color: ${FabVariantToken[variant].hover.stateLayerColor};
|
|
895
|
+
--m3e-state-layer-hover-opacity: ${FabVariantToken[variant].hover.stateLayerOpacity};
|
|
896
|
+
--m3e-state-layer-focus-color: ${FabVariantToken[variant].focus.stateLayerColor};
|
|
897
|
+
--m3e-state-layer-focus-opacity: ${FabVariantToken[variant].focus.stateLayerOpacity};
|
|
898
|
+
--m3e-ripple-color: ${FabVariantToken[variant].pressed.stateLayerColor};
|
|
899
|
+
--m3e-ripple-opacity: ${FabVariantToken[variant].pressed.stateLayerOpacity};
|
|
900
|
+
}
|
|
901
|
+
:host([variant="${unsafeCSS(variant)}"]) .label {
|
|
902
|
+
color: ${FabVariantToken[variant].labelTextColor};
|
|
903
|
+
}
|
|
904
|
+
:host([variant="${unsafeCSS(variant)}"]:focus) .label {
|
|
905
|
+
color: ${FabVariantToken[variant].focus.labelTextColor};
|
|
906
|
+
}
|
|
907
|
+
:host([variant="${unsafeCSS(variant)}"]:hover) .label {
|
|
908
|
+
color: ${FabVariantToken[variant].hover.labelTextColor};
|
|
909
|
+
}
|
|
910
|
+
:host([variant="${unsafeCSS(variant)}"]) .base.pressed .label {
|
|
911
|
+
color: ${FabVariantToken[variant].pressed.labelTextColor};
|
|
912
|
+
}
|
|
913
|
+
:host([variant="${unsafeCSS(variant)}"]) .icon {
|
|
914
|
+
color: ${FabVariantToken[variant].iconColor};
|
|
915
|
+
}
|
|
916
|
+
:host([variant="${unsafeCSS(variant)}"]:focus) .icon {
|
|
917
|
+
color: ${FabVariantToken[variant].focus.iconColor};
|
|
918
|
+
}
|
|
919
|
+
:host([variant="${unsafeCSS(variant)}"]:hover) .icon {
|
|
920
|
+
color: ${FabVariantToken[variant].hover.iconColor};
|
|
921
|
+
}
|
|
922
|
+
:host([variant="${unsafeCSS(variant)}"]) .base.pressed .icon {
|
|
923
|
+
color: ${FabVariantToken[variant].pressed.iconColor};
|
|
924
|
+
}
|
|
925
|
+
:host([variant="${unsafeCSS(variant)}"]:disabled) .base,
|
|
926
|
+
:host([variant="${unsafeCSS(variant)}"][disabled-interactive]) .base {
|
|
927
|
+
--m3e-elevation-level: ${FabVariantToken[variant].disabled.containerElevation};
|
|
928
|
+
background-color: color-mix(
|
|
929
|
+
in srgb,
|
|
930
|
+
${FabVariantToken[variant].disabled.containerColor} ${FabVariantToken[variant].disabled.containerOpacity},
|
|
931
|
+
transparent
|
|
932
|
+
);
|
|
933
|
+
}
|
|
934
|
+
:host([variant="${unsafeCSS(variant)}"]:disabled) .label,
|
|
935
|
+
:host([variant="${unsafeCSS(variant)}"][disabled-interactive]) .label {
|
|
936
|
+
color: color-mix(
|
|
937
|
+
in srgb,
|
|
938
|
+
${FabVariantToken[variant].disabled.labelTextColor} ${FabVariantToken[variant].disabled.labelTextOpacity},
|
|
939
|
+
transparent
|
|
940
|
+
);
|
|
941
|
+
}
|
|
942
|
+
:host([variant="${unsafeCSS(variant)}"]:disabled) .icon,
|
|
943
|
+
:host([variant="${unsafeCSS(variant)}"][disabled-interactive]) .icon {
|
|
944
|
+
color: color-mix(
|
|
945
|
+
in srgb,
|
|
946
|
+
${FabVariantToken[variant].disabled.iconColor} ${FabVariantToken[variant].disabled.iconOpacity},
|
|
947
|
+
transparent
|
|
948
|
+
);
|
|
949
|
+
}
|
|
950
|
+
`;
|
|
951
|
+
}
|
|
952
|
+
/**
|
|
953
|
+
* Appearance variant styles for `M3eFabElement`.
|
|
954
|
+
* @internal
|
|
955
|
+
*/
|
|
956
|
+
const FabVariantStyle = [
|
|
957
|
+
fabVariantStyle("primary"),
|
|
958
|
+
fabVariantStyle("secondary"),
|
|
959
|
+
fabVariantStyle("tertiary"),
|
|
960
|
+
fabVariantStyle("primary-container"),
|
|
961
|
+
fabVariantStyle("secondary-container"),
|
|
962
|
+
fabVariantStyle("tertiary-container"),
|
|
963
|
+
fabVariantStyle("surface"),
|
|
964
|
+
];
|
|
965
|
+
|
|
966
|
+
var _M3eFabElement_instances, _M3eFabElement_handleSlotChange;
|
|
967
|
+
/**
|
|
968
|
+
* @summary
|
|
969
|
+
* A floating action button (FAB) used to present important actions.
|
|
970
|
+
*
|
|
971
|
+
* @description
|
|
972
|
+
* The `m3e-fab` component is a prominent, expressive UI component that represents the primary action on a screen.
|
|
973
|
+
* Designed according to Material Design 3 guidelines, it supports seven visual variants, specified using the
|
|
974
|
+
* `variant` attribute—`primary`, `primary-container`, `secondary`, `secondary-container`, `tertiary`, `tertiary-container`
|
|
975
|
+
* and `surface`—each with dynamic elevation and adaptive color theming.
|
|
976
|
+
*
|
|
977
|
+
* The component is accessible by default, with ARIA roles, contrast-safe color tokens, and strong focus indicators.
|
|
978
|
+
* It can be extended to display a label alongside its icon, and responds to interaction states (hover, focus, press, disabled)
|
|
979
|
+
* with smooth motion transitions, elevation changes, and adaptive color theming. It can also function as a link or be
|
|
980
|
+
* used to submit form data.
|
|
981
|
+
*
|
|
982
|
+
* Native disabled `<button>` elements cannot receive focus. This can be problematic in some cases because it can prevent you
|
|
983
|
+
* from telling the user why the button is disabled. You can use the `disabled-interactive` attribute to style a `m3e-fab`
|
|
984
|
+
* as disabled but allow for it to receive focus. The button will have `aria-disabled="true"` for assistive technology.
|
|
985
|
+
*
|
|
986
|
+
* @example
|
|
987
|
+
* The following example illustrates a basic floating action button.
|
|
988
|
+
* ```html
|
|
989
|
+
* <m3e-fab>
|
|
990
|
+
* <m3e-icon>add</m3e-icon>
|
|
991
|
+
* </m3e-fab>
|
|
992
|
+
* ```
|
|
993
|
+
*
|
|
994
|
+
* @example
|
|
995
|
+
* The next example illustrates an extended floating action button.
|
|
996
|
+
* ```html
|
|
997
|
+
* <m3e-fab extended>
|
|
998
|
+
* <m3e-icon>add</m3e-icon>
|
|
999
|
+
* <span slot="label">Add</span>
|
|
1000
|
+
* </m3e-fab>
|
|
1001
|
+
* ```
|
|
1002
|
+
*
|
|
1003
|
+
* @tag m3e-fab
|
|
1004
|
+
*
|
|
1005
|
+
* @slot - Renders the icon of the button.
|
|
1006
|
+
* @slot label - Renders the label of an extended button.
|
|
1007
|
+
* @slot close-icon - Renders the close icon when used to open a FAB menu.
|
|
1008
|
+
*
|
|
1009
|
+
* @attr disabled - Whether the element is disabled.
|
|
1010
|
+
* @attr disabled-interactive - Whether the element is disabled and interactive.
|
|
1011
|
+
* @attr download - A value indicating whether the `target` of the link button will be downloaded, optionally specifying the new name of the file.
|
|
1012
|
+
* @attr extended - Whether the button is extended to show the label.
|
|
1013
|
+
* @attr href - The URL to which the link button points.
|
|
1014
|
+
* @attr lowered - Whether to present a lowered elevation.
|
|
1015
|
+
* @attr name - The name of the element, submitted as a pair with the element's `value` as part of form data, when the element is used to submit a form.
|
|
1016
|
+
* @attr rel - The relationship between the `target` of the link button and the document.
|
|
1017
|
+
* @attr size - The size of the button.
|
|
1018
|
+
* @attr target - The target of the link button.
|
|
1019
|
+
* @attr type - The type of the element.
|
|
1020
|
+
* @attr value - The value associated with the element's name when it's submitted with form data.
|
|
1021
|
+
* @attr variant - The appearance variant of the button.
|
|
1022
|
+
*
|
|
1023
|
+
* @cssprop --m3e-fab-small-container-height - Height of the small FAB container.
|
|
1024
|
+
* @cssprop --m3e-fab-small-label-text-font-size - Font size for the small FAB label text.
|
|
1025
|
+
* @cssprop --m3e-fab-small-label-text-font-weight - Font weight for the small FAB label text.
|
|
1026
|
+
* @cssprop --m3e-fab-small-label-text-line-height - Line height for the small FAB label text.
|
|
1027
|
+
* @cssprop --m3e-fab-small-label-text-tracking - Letter spacing (tracking) for the small FAB label text.
|
|
1028
|
+
* @cssprop --m3e-fab-small-icon-size - Icon size for the small FAB.
|
|
1029
|
+
* @cssprop --m3e-fab-small-shape - Border radius for the small FAB.
|
|
1030
|
+
* @cssprop --m3e-fab-small-leading-space - Leading space for the small FAB.
|
|
1031
|
+
* @cssprop --m3e-fab-small-trailing-space - Trailing space for the small FAB.
|
|
1032
|
+
* @cssprop --m3e-fab-small-icon-label-space - Space between icon and label for the small FAB.
|
|
1033
|
+
* @cssprop --m3e-fab-medium-container-height - Height of the medium FAB container.
|
|
1034
|
+
* @cssprop --m3e-fab-medium-label-text-font-size - Font size for the medium FAB label text.
|
|
1035
|
+
* @cssprop --m3e-fab-medium-label-text-font-weight - Font weight for the medium FAB label text.
|
|
1036
|
+
* @cssprop --m3e-fab-medium-label-text-line-height - Line height for the medium FAB label text.
|
|
1037
|
+
* @cssprop --m3e-fab-medium-label-text-tracking - Letter spacing (tracking) for the medium FAB label text.
|
|
1038
|
+
* @cssprop --m3e-fab-medium-icon-size - Icon size for the medium FAB.
|
|
1039
|
+
* @cssprop --m3e-fab-medium-shape - Border radius for the medium FAB.
|
|
1040
|
+
* @cssprop --m3e-fab-medium-leading-space - Leading space for the medium FAB.
|
|
1041
|
+
* @cssprop --m3e-fab-medium-trailing-space - Trailing space for the medium FAB.
|
|
1042
|
+
* @cssprop --m3e-fab-medium-icon-label-space - Space between icon and label for the medium FAB.
|
|
1043
|
+
* @cssprop --m3e-fab-large-container-height - Height of the large FAB container.
|
|
1044
|
+
* @cssprop --m3e-fab-large-label-text-font-size - Font size for the large FAB label text.
|
|
1045
|
+
* @cssprop --m3e-fab-large-label-text-font-weight - Font weight for the large FAB label text.
|
|
1046
|
+
* @cssprop --m3e-fab-large-label-text-line-height - Line height for the large FAB label text.
|
|
1047
|
+
* @cssprop --m3e-fab-large-label-text-tracking - Letter spacing (tracking) for the large FAB label text.
|
|
1048
|
+
* @cssprop --m3e-fab-large-icon-size - Icon size for the large FAB.
|
|
1049
|
+
* @cssprop --m3e-fab-large-shape - Border radius for the large FAB.
|
|
1050
|
+
* @cssprop --m3e-fab-large-leading-space - Leading space for the large FAB.
|
|
1051
|
+
* @cssprop --m3e-fab-large-trailing-space - Trailing space for the large FAB.
|
|
1052
|
+
* @cssprop --m3e-fab-large-icon-label-space - Space between icon and label for the large FAB.
|
|
1053
|
+
* @cssprop --m3e-primary-fab-label-text-color - Default label text color for primary FAB.
|
|
1054
|
+
* @cssprop --m3e-primary-fab-icon-color - Default icon color for primary FAB.
|
|
1055
|
+
* @cssprop --m3e-primary-fab-container-color - Default container background color for primary FAB.
|
|
1056
|
+
* @cssprop --m3e-primary-fab-container-elevation - Resting elevation for primary FAB.
|
|
1057
|
+
* @cssprop --m3e-primary-fab-lowered-container-elevation - Lowered resting elevation for primary FAB.
|
|
1058
|
+
* @cssprop --m3e-primary-fab-disabled-container-color - Container background color when disabled (primary).
|
|
1059
|
+
* @cssprop --m3e-primary-fab-disabled-container-opacity - Opacity of container when disabled (primary).
|
|
1060
|
+
* @cssprop --m3e-primary-fab-disabled-icon-color - Icon color when disabled (primary).
|
|
1061
|
+
* @cssprop --m3e-primary-fab-disabled-icon-opacity - Icon opacity when disabled (primary).
|
|
1062
|
+
* @cssprop --m3e-primary-fab-disabled-label-text-color - Label text color when disabled (primary).
|
|
1063
|
+
* @cssprop --m3e-primary-fab-disabled-label-text-opacity - Label text opacity when disabled (primary).
|
|
1064
|
+
* @cssprop --m3e-primary-fab-disabled-container-elevation - Elevation when disabled (primary).
|
|
1065
|
+
* @cssprop --m3e-primary-fab-lowered-disabled-container-elevation - Lowered elevation when disabled (primary).
|
|
1066
|
+
* @cssprop --m3e-primary-fab-hover-icon-color - Icon color on hover (primary).
|
|
1067
|
+
* @cssprop --m3e-primary-fab-hover-label-text-color - Label text color on hover (primary).
|
|
1068
|
+
* @cssprop --m3e-primary-fab-hover-state-layer-color - State layer color on hover (primary).
|
|
1069
|
+
* @cssprop --m3e-primary-fab-hover-state-layer-opacity - State layer opacity on hover (primary).
|
|
1070
|
+
* @cssprop --m3e-primary-fab-hover-container-elevation - Elevation on hover (primary).
|
|
1071
|
+
* @cssprop --m3e-primary-fab-lowered-hover-container-elevation - Lowered elevation on hover (primary).
|
|
1072
|
+
* @cssprop --m3e-primary-fab-focus-icon-color - Icon color on focus (primary).
|
|
1073
|
+
* @cssprop --m3e-primary-fab-focus-label-text-color - Label text color on focus (primary).
|
|
1074
|
+
* @cssprop --m3e-primary-fab-focus-state-layer-color - State layer color on focus (primary).
|
|
1075
|
+
* @cssprop --m3e-primary-fab-focus-state-layer-opacity - State layer opacity on focus (primary).
|
|
1076
|
+
* @cssprop --m3e-primary-fab-focus-container-elevation - Elevation on focus (primary).
|
|
1077
|
+
* @cssprop --m3e-primary-fab-lowered-focus-container-elevation - Lowered elevation on focus (primary).
|
|
1078
|
+
* @cssprop --m3e-primary-fab-pressed-icon-color - Icon color on pressed (primary).
|
|
1079
|
+
* @cssprop --m3e-primary-fab-pressed-label-text-color - Label text color on pressed (primary).
|
|
1080
|
+
* @cssprop --m3e-primary-fab-pressed-state-layer-color - State layer color on pressed (primary).
|
|
1081
|
+
* @cssprop --m3e-primary-fab-pressed-state-layer-opacity - State layer opacity on pressed (primary).
|
|
1082
|
+
* @cssprop --m3e-primary-fab-pressed-container-elevation - Elevation on pressed (primary).
|
|
1083
|
+
* @cssprop --m3e-primary-fab-lowered-pressed-container-elevation - Lowered elevation on pressed (primary).
|
|
1084
|
+
* @cssprop --m3e-secondary-fab-label-text-color - Default label text color for secondary FAB.
|
|
1085
|
+
* @cssprop --m3e-secondary-fab-icon-color - Default icon color for secondary FAB.
|
|
1086
|
+
* @cssprop --m3e-secondary-fab-container-color - Default container background color for secondary FAB.
|
|
1087
|
+
* @cssprop --m3e-secondary-fab-container-elevation - Resting elevation for secondary FAB.
|
|
1088
|
+
* @cssprop --m3e-secondary-fab-lowered-container-elevation - Lowered resting elevation for secondary FAB.
|
|
1089
|
+
* @cssprop --m3e-secondary-fab-disabled-container-color - Container background color when disabled (secondary).
|
|
1090
|
+
* @cssprop --m3e-secondary-fab-disabled-container-opacity - Opacity of container when disabled (secondary).
|
|
1091
|
+
* @cssprop --m3e-secondary-fab-disabled-icon-color - Icon color when disabled (secondary).
|
|
1092
|
+
* @cssprop --m3e-secondary-fab-disabled-icon-opacity - Icon opacity when disabled (secondary).
|
|
1093
|
+
* @cssprop --m3e-secondary-fab-disabled-label-text-color - Label text color when disabled (secondary).
|
|
1094
|
+
* @cssprop --m3e-secondary-fab-disabled-label-text-opacity - Label text opacity when disabled (secondary).
|
|
1095
|
+
* @cssprop --m3e-secondary-fab-disabled-container-elevation - Elevation when disabled (secondary).
|
|
1096
|
+
* @cssprop --m3e-secondary-fab-lowered-disabled-container-elevation - Lowered elevation when disabled (secondary).
|
|
1097
|
+
* @cssprop --m3e-secondary-fab-hover-icon-color - Icon color on hover (secondary).
|
|
1098
|
+
* @cssprop --m3e-secondary-fab-hover-label-text-color - Label text color on hover (secondary).
|
|
1099
|
+
* @cssprop --m3e-secondary-fab-hover-state-layer-color - State layer color on hover (secondary).
|
|
1100
|
+
* @cssprop --m3e-secondary-fab-hover-state-layer-opacity - State layer opacity on hover (secondary).
|
|
1101
|
+
* @cssprop --m3e-secondary-fab-hover-container-elevation - Elevation on hover (secondary).
|
|
1102
|
+
* @cssprop --m3e-secondary-fab-lowered-hover-container-elevation - Lowered elevation on hover (secondary).
|
|
1103
|
+
* @cssprop --m3e-secondary-fab-focus-icon-color - Icon color on focus (secondary).
|
|
1104
|
+
* @cssprop --m3e-secondary-fab-focus-label-text-color - Label text color on focus (secondary).
|
|
1105
|
+
* @cssprop --m3e-secondary-fab-focus-state-layer-color - State layer color on focus (secondary).
|
|
1106
|
+
* @cssprop --m3e-secondary-fab-focus-state-layer-opacity - State layer opacity on focus (secondary).
|
|
1107
|
+
* @cssprop --m3e-secondary-fab-focus-container-elevation - Elevation on focus (secondary).
|
|
1108
|
+
* @cssprop --m3e-secondary-fab-lowered-focus-container-elevation - Lowered elevation on focus (secondary).
|
|
1109
|
+
* @cssprop --m3e-secondary-fab-pressed-icon-color - Icon color on pressed (secondary).
|
|
1110
|
+
* @cssprop --m3e-secondary-fab-pressed-label-text-color - Label text color on pressed (secondary).
|
|
1111
|
+
* @cssprop --m3e-secondary-fab-pressed-state-layer-color - State layer color on pressed (secondary).
|
|
1112
|
+
* @cssprop --m3e-secondary-fab-pressed-state-layer-opacity - State layer opacity on pressed (secondary).
|
|
1113
|
+
* @cssprop --m3e-secondary-fab-pressed-container-elevation - Elevation on pressed (secondary).
|
|
1114
|
+
* @cssprop --m3e-secondary-fab-lowered-pressed-container-elevation - Lowered elevation on pressed (secondary).
|
|
1115
|
+
* @cssprop --m3e-tertiary-fab-label-text-color - Default label text color for tertiary FAB.
|
|
1116
|
+
* @cssprop --m3e-tertiary-fab-icon-color - Default icon color for tertiary FAB.
|
|
1117
|
+
* @cssprop --m3e-tertiary-fab-container-color - Default container background color for tertiary FAB.
|
|
1118
|
+
* @cssprop --m3e-tertiary-fab-container-elevation - Resting elevation for tertiary FAB.
|
|
1119
|
+
* @cssprop --m3e-tertiary-fab-lowered-container-elevation - Lowered resting elevation for tertiary FAB.
|
|
1120
|
+
* @cssprop --m3e-tertiary-fab-disabled-container-color - Container background color when disabled (tertiary).
|
|
1121
|
+
* @cssprop --m3e-tertiary-fab-disabled-container-opacity - Opacity of container when disabled (tertiary).
|
|
1122
|
+
* @cssprop --m3e-tertiary-fab-disabled-icon-color - Icon color when disabled (tertiary).
|
|
1123
|
+
* @cssprop --m3e-tertiary-fab-disabled-icon-opacity - Icon opacity when disabled (tertiary).
|
|
1124
|
+
* @cssprop --m3e-tertiary-fab-disabled-label-text-color - Label text color when disabled (tertiary).
|
|
1125
|
+
* @cssprop --m3e-tertiary-fab-disabled-label-text-opacity - Label text opacity when disabled (tertiary).
|
|
1126
|
+
* @cssprop --m3e-tertiary-fab-disabled-container-elevation - Elevation when disabled (tertiary).
|
|
1127
|
+
* @cssprop --m3e-tertiary-fab-lowered-disabled-container-elevation - Lowered elevation when disabled (tertiary).
|
|
1128
|
+
* @cssprop --m3e-tertiary-fab-hover-icon-color - Icon color on hover (tertiary).
|
|
1129
|
+
* @cssprop --m3e-tertiary-fab-hover-label-text-color - Label text color on hover (tertiary).
|
|
1130
|
+
* @cssprop --m3e-tertiary-fab-hover-state-layer-color - State layer color on hover (tertiary).
|
|
1131
|
+
* @cssprop --m3e-tertiary-fab-hover-state-layer-opacity - State layer opacity on hover (tertiary).
|
|
1132
|
+
* @cssprop --m3e-tertiary-fab-hover-container-elevation - Elevation on hover (tertiary).
|
|
1133
|
+
* @cssprop --m3e-tertiary-fab-lowered-hover-container-elevation - Lowered elevation on hover (tertiary).
|
|
1134
|
+
* @cssprop --m3e-tertiary-fab-focus-icon-color - Icon color on focus (tertiary).
|
|
1135
|
+
* @cssprop --m3e-tertiary-fab-focus-label-text-color - Label text color on focus (tertiary).
|
|
1136
|
+
* @cssprop --m3e-tertiary-fab-focus-state-layer-color - State layer color on focus (tertiary).
|
|
1137
|
+
* @cssprop --m3e-tertiary-fab-focus-state-layer-opacity - State layer opacity on focus (tertiary).
|
|
1138
|
+
* @cssprop --m3e-tertiary-fab-focus-container-elevation - Elevation on focus (tertiary).
|
|
1139
|
+
* @cssprop --m3e-tertiary-fab-lowered-focus-container-elevation - Lowered elevation on focus (tertiary).
|
|
1140
|
+
* @cssprop --m3e-tertiary-fab-pressed-icon-color - Icon color on pressed (tertiary).
|
|
1141
|
+
* @cssprop --m3e-tertiary-fab-pressed-label-text-color - Label text color on pressed (tertiary).
|
|
1142
|
+
* @cssprop --m3e-tertiary-fab-pressed-state-layer-color - State layer color on pressed (tertiary).
|
|
1143
|
+
* @cssprop --m3e-tertiary-fab-pressed-state-layer-opacity - State layer opacity on pressed (tertiary).
|
|
1144
|
+
* @cssprop --m3e-tertiary-fab-pressed-container-elevation - Elevation on pressed (tertiary).
|
|
1145
|
+
* @cssprop --m3e-tertiary-fab-lowered-pressed-container-elevation - Lowered elevation on pressed (tertiary).
|
|
1146
|
+
* @cssprop --m3e-primary-container-fab-label-text-color - Default label text color for primary-container FAB.
|
|
1147
|
+
* @cssprop --m3e-primary-container-fab-icon-color - Default icon color for primary-container FAB.
|
|
1148
|
+
* @cssprop --m3e-primary-container-fab-container-color - Default container background color for primary-container FAB.
|
|
1149
|
+
* @cssprop --m3e-primary-container-fab-container-elevation - Resting elevation for primary-container FAB.
|
|
1150
|
+
* @cssprop --m3e-primary-container-fab-lowered-container-elevation - Lowered resting elevation for primary-container FAB.
|
|
1151
|
+
* @cssprop --m3e-primary-container-fab-disabled-container-color - Container background color when disabled (primary-container).
|
|
1152
|
+
* @cssprop --m3e-primary-container-fab-disabled-container-opacity - Opacity of container when disabled (primary-container).
|
|
1153
|
+
* @cssprop --m3e-primary-container-fab-disabled-icon-color - Icon color when disabled (primary-container).
|
|
1154
|
+
* @cssprop --m3e-primary-container-fab-disabled-icon-opacity - Icon opacity when disabled (primary-container).
|
|
1155
|
+
* @cssprop --m3e-primary-container-fab-disabled-label-text-color - Label text color when disabled (primary-container).
|
|
1156
|
+
* @cssprop --m3e-primary-container-fab-disabled-label-text-opacity - Label text opacity when disabled (primary-container).
|
|
1157
|
+
* @cssprop --m3e-primary-container-fab-disabled-container-elevation - Elevation when disabled (primary-container).
|
|
1158
|
+
* @cssprop --m3e-primary-container-fab-lowered-disabled-container-elevation - Lowered elevation when disabled (primary-container).
|
|
1159
|
+
* @cssprop --m3e-primary-container-fab-hover-icon-color - Icon color on hover (primary-container).
|
|
1160
|
+
* @cssprop --m3e-primary-container-fab-hover-label-text-color - Label text color on hover (primary-container).
|
|
1161
|
+
* @cssprop --m3e-primary-container-fab-hover-state-layer-color - State layer color on hover (primary-container).
|
|
1162
|
+
* @cssprop --m3e-primary-container-fab-hover-state-layer-opacity - State layer opacity on hover (primary-container).
|
|
1163
|
+
* @cssprop --m3e-primary-container-fab-hover-container-elevation - Elevation on hover (primary-container).
|
|
1164
|
+
* @cssprop --m3e-primary-container-fab-lowered-hover-container-elevation - Lowered elevation on hover (primary-container).
|
|
1165
|
+
* @cssprop --m3e-primary-container-fab-focus-icon-color - Icon color on focus (primary-container).
|
|
1166
|
+
* @cssprop --m3e-primary-container-fab-focus-label-text-color - Label text color on focus (primary-container).
|
|
1167
|
+
* @cssprop --m3e-primary-container-fab-focus-state-layer-color - State layer color on focus (primary-container).
|
|
1168
|
+
* @cssprop --m3e-primary-container-fab-focus-state-layer-opacity - State layer opacity on focus (primary-container).
|
|
1169
|
+
* @cssprop --m3e-primary-container-fab-focus-container-elevation - Elevation on focus (primary-container).
|
|
1170
|
+
* @cssprop --m3e-primary-container-fab-lowered-focus-container-elevation - Lowered elevation on focus (primary-container).
|
|
1171
|
+
* @cssprop --m3e-primary-container-fab-pressed-icon-color - Icon color on pressed (primary-container).
|
|
1172
|
+
* @cssprop --m3e-primary-container-fab-pressed-label-text-color - Label text color on pressed (primary-container).
|
|
1173
|
+
* @cssprop --m3e-primary-container-fab-pressed-state-layer-color - State layer color on pressed (primary-container).
|
|
1174
|
+
* @cssprop --m3e-primary-container-fab-pressed-state-layer-opacity - State layer opacity on pressed (primary-container).
|
|
1175
|
+
* @cssprop --m3e-primary-container-fab-pressed-container-elevation - Elevation on pressed (primary-container).
|
|
1176
|
+
* @cssprop --m3e-primary-container-fab-lowered-pressed-container-elevation - Lowered elevation on pressed (primary-container).
|
|
1177
|
+
* @cssprop --m3e-secondary-container-fab-label-text-color - Default label text color for secondary-container FAB.
|
|
1178
|
+
* @cssprop --m3e-secondary-container-fab-icon-color - Default icon color for secondary-container FAB.
|
|
1179
|
+
* @cssprop --m3e-secondary-container-fab-container-color - Default container background color for secondary-container FAB.
|
|
1180
|
+
* @cssprop --m3e-secondary-container-fab-container-elevation - Resting elevation for secondary-container FAB.
|
|
1181
|
+
* @cssprop --m3e-secondary-container-fab-lowered-container-elevation - Lowered resting elevation for secondary-container FAB.
|
|
1182
|
+
* @cssprop --m3e-secondary-container-fab-disabled-container-color - Container background color when disabled (secondary-container).
|
|
1183
|
+
* @cssprop --m3e-secondary-container-fab-disabled-container-opacity - Opacity of container when disabled (secondary-container).
|
|
1184
|
+
* @cssprop --m3e-secondary-container-fab-disabled-icon-color - Icon color when disabled (secondary-container).
|
|
1185
|
+
* @cssprop --m3e-secondary-container-fab-disabled-icon-opacity - Icon opacity when disabled (secondary-container).
|
|
1186
|
+
* @cssprop --m3e-secondary-container-fab-disabled-label-text-color - Label text color when disabled (secondary-container).
|
|
1187
|
+
* @cssprop --m3e-secondary-container-fab-disabled-label-text-opacity - Label text opacity when disabled (secondary-container).
|
|
1188
|
+
* @cssprop --m3e-secondary-container-fab-disabled-container-elevation - Elevation when disabled (secondary-container).
|
|
1189
|
+
* @cssprop --m3e-secondary-container-fab-lowered-disabled-container-elevation - Lowered elevation when disabled (secondary-container).
|
|
1190
|
+
* @cssprop --m3e-secondary-container-fab-hover-icon-color - Icon color on hover (secondary-container).
|
|
1191
|
+
* @cssprop --m3e-secondary-container-fab-hover-label-text-color - Label text color on hover (secondary-container).
|
|
1192
|
+
* @cssprop --m3e-secondary-container-fab-hover-state-layer-color - State layer color on hover (secondary-container).
|
|
1193
|
+
* @cssprop --m3e-secondary-container-fab-hover-state-layer-opacity - State layer opacity on hover (secondary-container).
|
|
1194
|
+
* @cssprop --m3e-secondary-container-fab-hover-container-elevation - Elevation on hover (secondary-container).
|
|
1195
|
+
* @cssprop --m3e-secondary-container-fab-lowered-hover-container-elevation - Lowered elevation on hover (secondary-container).
|
|
1196
|
+
* @cssprop --m3e-secondary-container-fab-focus-icon-color - Icon color on focus (secondary-container).
|
|
1197
|
+
* @cssprop --m3e-secondary-container-fab-focus-label-text-color - Label text color on focus (secondary-container).
|
|
1198
|
+
* @cssprop --m3e-secondary-container-fab-focus-state-layer-color - State layer color on focus (secondary-container).
|
|
1199
|
+
* @cssprop --m3e-secondary-container-fab-focus-state-layer-opacity - State layer opacity on focus (secondary-container).
|
|
1200
|
+
* @cssprop --m3e-secondary-container-fab-focus-container-elevation - Elevation on focus (secondary-container).
|
|
1201
|
+
* @cssprop --m3e-secondary-container-fab-lowered-focus-container-elevation - Lowered elevation on focus (secondary-container).
|
|
1202
|
+
* @cssprop --m3e-secondary-container-fab-pressed-icon-color - Icon color on pressed (secondary-container).
|
|
1203
|
+
* @cssprop --m3e-secondary-container-fab-pressed-label-text-color - Label text color on pressed (secondary-container).
|
|
1204
|
+
* @cssprop --m3e-secondary-container-fab-pressed-state-layer-color - State layer color on pressed (secondary-container).
|
|
1205
|
+
* @cssprop --m3e-secondary-container-fab-pressed-state-layer-opacity - State layer opacity on pressed (secondary-container).
|
|
1206
|
+
* @cssprop --m3e-secondary-container-fab-pressed-container-elevation - Elevation on pressed (secondary-container).
|
|
1207
|
+
* @cssprop --m3e-secondary-container-fab-lowered-pressed-container-elevation - Lowered elevation on pressed (secondary-container).
|
|
1208
|
+
* @cssprop --m3e-tertiary-container-fab-label-text-color - Default label text color for tertiary-container FAB.
|
|
1209
|
+
* @cssprop --m3e-tertiary-container-fab-icon-color - Default icon color for tertiary-container FAB.
|
|
1210
|
+
* @cssprop --m3e-tertiary-container-fab-container-color - Default container background color for tertiary-container FAB.
|
|
1211
|
+
* @cssprop --m3e-tertiary-container-fab-container-elevation - Resting elevation for tertiary-container FAB.
|
|
1212
|
+
* @cssprop --m3e-tertiary-container-fab-lowered-container-elevation - Lowered resting elevation for tertiary-container FAB.
|
|
1213
|
+
* @cssprop --m3e-tertiary-container-fab-disabled-container-color - Container background color when disabled (tertiary-container).
|
|
1214
|
+
* @cssprop --m3e-tertiary-container-fab-disabled-container-opacity - Opacity of container when disabled (tertiary-container).
|
|
1215
|
+
* @cssprop --m3e-tertiary-container-fab-disabled-icon-color - Icon color when disabled (tertiary-container).
|
|
1216
|
+
* @cssprop --m3e-tertiary-container-fab-disabled-icon-opacity - Icon opacity when disabled (tertiary-container).
|
|
1217
|
+
* @cssprop --m3e-tertiary-container-fab-disabled-label-text-color - Label text color when disabled (tertiary-container).
|
|
1218
|
+
* @cssprop --m3e-tertiary-container-fab-disabled-label-text-opacity - Label text opacity when disabled (tertiary-container).
|
|
1219
|
+
* @cssprop --m3e-tertiary-container-fab-disabled-container-elevation - Elevation when disabled (tertiary-container).
|
|
1220
|
+
* @cssprop --m3e-tertiary-container-fab-lowered-disabled-container-elevation - Lowered elevation when disabled (tertiary-container).
|
|
1221
|
+
* @cssprop --m3e-tertiary-container-fab-hover-icon-color - Icon color on hover (tertiary-container).
|
|
1222
|
+
* @cssprop --m3e-tertiary-container-fab-hover-label-text-color - Label text color on hover (tertiary-container).
|
|
1223
|
+
* @cssprop --m3e-tertiary-container-fab-hover-state-layer-color - State layer color on hover (tertiary-container).
|
|
1224
|
+
* @cssprop --m3e-tertiary-container-fab-hover-state-layer-opacity - State layer opacity on hover (tertiary-container).
|
|
1225
|
+
* @cssprop --m3e-tertiary-container-fab-hover-container-elevation - Elevation on hover (tertiary-container).
|
|
1226
|
+
* @cssprop --m3e-tertiary-container-fab-lowered-hover-container-elevation - Lowered elevation on hover (tertiary-container).
|
|
1227
|
+
* @cssprop --m3e-tertiary-container-fab-focus-icon-color - Icon color on focus (tertiary-container).
|
|
1228
|
+
* @cssprop --m3e-tertiary-container-fab-focus-label-text-color - Label text color on focus (tertiary-container).
|
|
1229
|
+
* @cssprop --m3e-tertiary-container-fab-focus-state-layer-color - State layer color on focus (tertiary-container).
|
|
1230
|
+
* @cssprop --m3e-tertiary-container-fab-focus-state-layer-opacity - State layer opacity on focus (tertiary-container).
|
|
1231
|
+
* @cssprop --m3e-tertiary-container-fab-focus-container-elevation - Elevation on focus (tertiary-container).
|
|
1232
|
+
* @cssprop --m3e-tertiary-container-fab-lowered-focus-container-elevation - Lowered elevation on focus (tertiary-container).
|
|
1233
|
+
* @cssprop --m3e-tertiary-container-fab-pressed-icon-color - Icon color on pressed (tertiary-container).
|
|
1234
|
+
* @cssprop --m3e-tertiary-container-fab-pressed-label-text-color - Label text color on pressed (tertiary-container).
|
|
1235
|
+
* @cssprop --m3e-tertiary-container-fab-pressed-state-layer-color - State layer color on pressed (tertiary-container).
|
|
1236
|
+
* @cssprop --m3e-tertiary-container-fab-pressed-state-layer-opacity - State layer opacity on pressed (tertiary-container).
|
|
1237
|
+
* @cssprop --m3e-tertiary-container-fab-pressed-container-elevation - Elevation on pressed (tertiary-container).
|
|
1238
|
+
* @cssprop --m3e-tertiary-container-fab-lowered-pressed-container-elevation - Lowered elevation on pressed (tertiary-container).
|
|
1239
|
+
* @cssprop --m3e-surface-fab-label-text-color - Default label text color for surface FAB.
|
|
1240
|
+
* @cssprop --m3e-surface-fab-icon-color - Default icon color for surface FAB.
|
|
1241
|
+
* @cssprop --m3e-surface-fab-container-color - Default container background color for surface FAB.
|
|
1242
|
+
* @cssprop --m3e-surface-fab-container-elevation - Resting elevation for surface FAB.
|
|
1243
|
+
* @cssprop --m3e-surface-fab-lowered-container-elevation - Lowered resting elevation for surface FAB.
|
|
1244
|
+
* @cssprop --m3e-surface-fab-lowered-container-color - Lowered container background color for surface FAB.
|
|
1245
|
+
* @cssprop --m3e-surface-fab-disabled-container-color - Container background color when disabled (surface).
|
|
1246
|
+
* @cssprop --m3e-surface-fab-disabled-container-opacity - Opacity of container when disabled (surface).
|
|
1247
|
+
* @cssprop --m3e-surface-fab-disabled-icon-color - Icon color when disabled (surface).
|
|
1248
|
+
* @cssprop --m3e-surface-fab-disabled-icon-opacity - Icon opacity when disabled (surface).
|
|
1249
|
+
* @cssprop --m3e-surface-fab-disabled-label-text-color - Label text color when disabled (surface).
|
|
1250
|
+
* @cssprop --m3e-surface-fab-disabled-label-text-opacity - Label text opacity when disabled (surface).
|
|
1251
|
+
* @cssprop --m3e-surface-fab-disabled-container-elevation - Elevation when disabled (surface).
|
|
1252
|
+
* @cssprop --m3e-surface-fab-lowered-disabled-container-elevation - Lowered elevation when disabled (surface).
|
|
1253
|
+
* @cssprop --m3e-surface-fab-hover-icon-color - Icon color on hover (surface).
|
|
1254
|
+
* @cssprop --m3e-surface-fab-hover-label-text-color - Label text color on hover (surface).
|
|
1255
|
+
* @cssprop --m3e-surface-fab-hover-state-layer-color - State layer color on hover (surface).
|
|
1256
|
+
* @cssprop --m3e-surface-fab-hover-state-layer-opacity - State layer opacity on hover (surface).
|
|
1257
|
+
* @cssprop --m3e-surface-fab-hover-container-elevation - Elevation on hover (surface).
|
|
1258
|
+
* @cssprop --m3e-surface-fab-lowered-hover-container-elevation - Lowered elevation on hover (surface).
|
|
1259
|
+
* @cssprop --m3e-surface-fab-focus-icon-color - Icon color on focus (surface).
|
|
1260
|
+
* @cssprop --m3e-surface-fab-focus-label-text-color - Label text color on focus (surface).
|
|
1261
|
+
* @cssprop --m3e-surface-fab-focus-state-layer-color - State layer color on focus (surface).
|
|
1262
|
+
* @cssprop --m3e-surface-fab-focus-state-layer-opacity - State layer opacity on focus (surface).
|
|
1263
|
+
* @cssprop --m3e-surface-fab-focus-container-elevation - Elevation on focus (surface).
|
|
1264
|
+
* @cssprop --m3e-surface-fab-lowered-focus-container-elevation - Lowered elevation on focus (surface).
|
|
1265
|
+
* @cssprop --m3e-surface-fab-pressed-icon-color - Icon color on pressed (surface).
|
|
1266
|
+
* @cssprop --m3e-surface-fab-pressed-label-text-color - Label text color on pressed (surface).
|
|
1267
|
+
* @cssprop --m3e-surface-fab-pressed-state-layer-color - State layer color on pressed (surface).
|
|
1268
|
+
* @cssprop --m3e-surface-fab-pressed-state-layer-opacity - State layer opacity on pressed (surface).
|
|
1269
|
+
* @cssprop --m3e-surface-fab-pressed-container-elevation - Elevation on pressed (surface).
|
|
1270
|
+
* @cssprop --m3e-surface-fab-lowered-pressed-container-elevation - Lowered elevation on pressed (surface).
|
|
1271
|
+
*/
|
|
1272
|
+
let M3eFabElement = class M3eFabElement extends KeyboardClick(LinkButton(FormSubmitter(Focusable(DisabledInteractive(Disabled(AttachInternals(Role(LitElement, "button"), true))))))) {
|
|
1273
|
+
constructor() {
|
|
1274
|
+
super();
|
|
1275
|
+
_M3eFabElement_instances.add(this);
|
|
1276
|
+
/**
|
|
1277
|
+
* The appearance variant of the button.
|
|
1278
|
+
* @default "primary-container"
|
|
1279
|
+
*/
|
|
1280
|
+
this.variant = "primary-container";
|
|
1281
|
+
/**
|
|
1282
|
+
* Whether to present a lowered elevation.
|
|
1283
|
+
* @default false
|
|
1284
|
+
*/
|
|
1285
|
+
this.lowered = false;
|
|
1286
|
+
/**
|
|
1287
|
+
* The size of the button.
|
|
1288
|
+
* @default "medium"
|
|
1289
|
+
*/
|
|
1290
|
+
this.size = "medium";
|
|
1291
|
+
/**
|
|
1292
|
+
* Whether the button is extended to show the label.
|
|
1293
|
+
* @default false
|
|
1294
|
+
*/
|
|
1295
|
+
this.extended = false;
|
|
1296
|
+
new PressedController(this, {
|
|
1297
|
+
isPressedKey: (key) => key === " " || key === "Enter",
|
|
1298
|
+
callback: (pressed) => {
|
|
1299
|
+
if (!this.disabled && !this.disabledInteractive) {
|
|
1300
|
+
this._base?.classList.toggle("pressed", pressed);
|
|
1301
|
+
this._base?.classList.toggle("resting", !pressed);
|
|
1302
|
+
}
|
|
1303
|
+
},
|
|
1304
|
+
});
|
|
1305
|
+
}
|
|
1306
|
+
/** @inheritdoc */
|
|
1307
|
+
disconnectedCallback() {
|
|
1308
|
+
super.disconnectedCallback();
|
|
1309
|
+
this._base?.classList.toggle("pressed", false);
|
|
1310
|
+
this._base?.classList.toggle("resting", false);
|
|
1311
|
+
}
|
|
1312
|
+
/** @inheritdoc */
|
|
1313
|
+
firstUpdated(_changedProperties) {
|
|
1314
|
+
super.firstUpdated(_changedProperties);
|
|
1315
|
+
[this._elevation, this._focusRing, this._stateLayer, this._ripple].forEach((x) => x?.attach(this));
|
|
1316
|
+
}
|
|
1317
|
+
/** @inheritdoc */
|
|
1318
|
+
updated(_changedProperties) {
|
|
1319
|
+
super.updated(_changedProperties);
|
|
1320
|
+
if ((_changedProperties.has("disabled") && this.disabled) ||
|
|
1321
|
+
(_changedProperties.has("disabledInteractive") && this.disabledInteractive)) {
|
|
1322
|
+
this._base?.classList.toggle("pressed", false);
|
|
1323
|
+
this._base?.classList.toggle("resting", false);
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
/** @inheritdoc */
|
|
1327
|
+
render() {
|
|
1328
|
+
return html `<div class="base">
|
|
1329
|
+
<m3e-elevation class="elevation" ?disabled="${this.disabled || this.disabledInteractive}"></m3e-elevation>
|
|
1330
|
+
<m3e-state-layer class="state-layer" ?disabled="${this.disabled || this.disabledInteractive}"></m3e-state-layer>
|
|
1331
|
+
<m3e-focus-ring class="focus-ring" ?disabled="${this.disabled}"></m3e-focus-ring>
|
|
1332
|
+
<m3e-ripple
|
|
1333
|
+
class="ripple"
|
|
1334
|
+
?centered="${!this.extended}"
|
|
1335
|
+
?disabled="${this.disabled || this.disabledInteractive}"
|
|
1336
|
+
></m3e-ripple>
|
|
1337
|
+
<div class="touch" aria-hidden="true"></div>
|
|
1338
|
+
${this[renderPseudoLink]()}
|
|
1339
|
+
<div class="wrapper">
|
|
1340
|
+
<slot class="icon" aria-hidden="true" @slotchange="${__classPrivateFieldGet(this, _M3eFabElement_instances, "m", _M3eFabElement_handleSlotChange)}"></slot>
|
|
1341
|
+
<slot class="icon" aria-hidden="true" name="close-icon">
|
|
1342
|
+
<svg class="close-icon" viewBox="0 -960 960 960" fill="currentColor">
|
|
1343
|
+
<path
|
|
1344
|
+
d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"
|
|
1345
|
+
/>
|
|
1346
|
+
</svg>
|
|
1347
|
+
</slot>
|
|
1348
|
+
<div class="label">
|
|
1349
|
+
<slot name="label" @slotchange="${__classPrivateFieldGet(this, _M3eFabElement_instances, "m", _M3eFabElement_handleSlotChange)}"></slot>
|
|
1350
|
+
</div>
|
|
1351
|
+
</div>
|
|
1352
|
+
</div>`;
|
|
1353
|
+
}
|
|
1354
|
+
};
|
|
1355
|
+
_M3eFabElement_instances = new WeakSet();
|
|
1356
|
+
_M3eFabElement_handleSlotChange = function _M3eFabElement_handleSlotChange() {
|
|
1357
|
+
this._base?.classList.toggle("-with-menu", this.querySelector("m3e-fab-menu-trigger") !== null);
|
|
1358
|
+
};
|
|
1359
|
+
/** The styles of the element. */
|
|
1360
|
+
M3eFabElement.styles = [FabSizeStyle, FabVariantStyle, FabStyle];
|
|
1361
|
+
__decorate([
|
|
1362
|
+
e(".base")
|
|
1363
|
+
], M3eFabElement.prototype, "_base", void 0);
|
|
1364
|
+
__decorate([
|
|
1365
|
+
e(".elevation")
|
|
1366
|
+
], M3eFabElement.prototype, "_elevation", void 0);
|
|
1367
|
+
__decorate([
|
|
1368
|
+
e(".focus-ring")
|
|
1369
|
+
], M3eFabElement.prototype, "_focusRing", void 0);
|
|
1370
|
+
__decorate([
|
|
1371
|
+
e(".state-layer")
|
|
1372
|
+
], M3eFabElement.prototype, "_stateLayer", void 0);
|
|
1373
|
+
__decorate([
|
|
1374
|
+
e(".ripple")
|
|
1375
|
+
], M3eFabElement.prototype, "_ripple", void 0);
|
|
1376
|
+
__decorate([
|
|
1377
|
+
n({ reflect: true })
|
|
1378
|
+
], M3eFabElement.prototype, "variant", void 0);
|
|
1379
|
+
__decorate([
|
|
1380
|
+
n({ type: Boolean, reflect: true })
|
|
1381
|
+
], M3eFabElement.prototype, "lowered", void 0);
|
|
1382
|
+
__decorate([
|
|
1383
|
+
n({ reflect: true })
|
|
1384
|
+
], M3eFabElement.prototype, "size", void 0);
|
|
1385
|
+
__decorate([
|
|
1386
|
+
n({ type: Boolean, reflect: true })
|
|
1387
|
+
], M3eFabElement.prototype, "extended", void 0);
|
|
1388
|
+
M3eFabElement = __decorate([
|
|
1389
|
+
t$1("m3e-fab")
|
|
1390
|
+
], M3eFabElement);
|
|
1391
|
+
|
|
1392
|
+
export { M3eFabElement };
|
|
1393
|
+
//# sourceMappingURL=index.js.map
|