@m3e/card 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.
Files changed (42) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +268 -0
  3. package/cem.config.mjs +16 -0
  4. package/demo/index.html +126 -0
  5. package/dist/css-custom-data.json +367 -0
  6. package/dist/custom-elements.json +629 -0
  7. package/dist/html-custom-data.json +33 -0
  8. package/dist/index.js +689 -0
  9. package/dist/index.js.map +1 -0
  10. package/dist/index.min.js +272 -0
  11. package/dist/index.min.js.map +1 -0
  12. package/dist/src/CardElement.d.ts +168 -0
  13. package/dist/src/CardElement.d.ts.map +1 -0
  14. package/dist/src/CardOrientation.d.ts +3 -0
  15. package/dist/src/CardOrientation.d.ts.map +1 -0
  16. package/dist/src/CardVariant.d.ts +3 -0
  17. package/dist/src/CardVariant.d.ts.map +1 -0
  18. package/dist/src/index.d.ts +4 -0
  19. package/dist/src/index.d.ts.map +1 -0
  20. package/dist/src/styles/CardStyle.d.ts +7 -0
  21. package/dist/src/styles/CardStyle.d.ts.map +1 -0
  22. package/dist/src/styles/CardToken.d.ts +9 -0
  23. package/dist/src/styles/CardToken.d.ts.map +1 -0
  24. package/dist/src/styles/CardVariantStyle.d.ts +7 -0
  25. package/dist/src/styles/CardVariantStyle.d.ts.map +1 -0
  26. package/dist/src/styles/CardVariantToken.d.ts +50 -0
  27. package/dist/src/styles/CardVariantToken.d.ts.map +1 -0
  28. package/dist/src/styles/index.d.ts +3 -0
  29. package/dist/src/styles/index.d.ts.map +1 -0
  30. package/eslint.config.mjs +13 -0
  31. package/package.json +48 -0
  32. package/rollup.config.js +32 -0
  33. package/src/CardElement.ts +258 -0
  34. package/src/CardOrientation.ts +2 -0
  35. package/src/CardVariant.ts +2 -0
  36. package/src/index.ts +3 -0
  37. package/src/styles/CardStyle.ts +163 -0
  38. package/src/styles/CardToken.ts +12 -0
  39. package/src/styles/CardVariantStyle.ts +99 -0
  40. package/src/styles/CardVariantToken.ts +205 -0
  41. package/src/styles/index.ts +2 -0
  42. package/tsconfig.json +9 -0
package/dist/index.js ADDED
@@ -0,0 +1,689 @@
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
+ * Component design tokens for `M3eCardElement`.
85
+ * @internal
86
+ */
87
+ const CardToken = {
88
+ padding: unsafeCSS("var(--m3e-card-padding, 1rem)"),
89
+ shape: unsafeCSS(`var(--m3e-card-shape, ${DesignToken.shape.corner.medium});`),
90
+ };
91
+
92
+ /**
93
+ * Component design tokens that control the appearance variants of `M3eCardElement`.
94
+ * @internal
95
+ */
96
+ const CardVariantToken = {
97
+ filled: {
98
+ textColor: unsafeCSS(`var(--m3e-filled-card-text-color, ${DesignToken.color.onSurface})`),
99
+ containerColor: unsafeCSS(`var(--m3e-filled-card-container-color, ${DesignToken.color.surfaceContainerHighest})`),
100
+ containerElevation: unsafeCSS(`var(--m3e-filled-card-container-elevation, ${DesignToken.elevation.level0})`),
101
+ disabled: {
102
+ textColor: unsafeCSS(`var(--m3e-filled-card-disabled-text-color, ${DesignToken.color.onSurface})`),
103
+ textOpacity: unsafeCSS(`var(--m3e-filled-card-disabled-text-opacity, 38%)`),
104
+ imageOpacity: unsafeCSS(`var(--m3e-filled-card-disabled-image-opacity, 38%)`),
105
+ containerColor: unsafeCSS(`var(--m3e-filled-card-disabled-container-color, ${DesignToken.color.surfaceVariant})`),
106
+ containerElevation: unsafeCSS(`var(--m3e-filled-card-disabled-container-elevation, ${DesignToken.elevation.level0})`),
107
+ containerElevationColor: unsafeCSS(`var(--m3e-filled-card-disabled-container-elevation-color, ${DesignToken.color.onSurface})`),
108
+ containerElevationOpacity: unsafeCSS(`var(--m3e-filled-card-disabled-container-elevation-opacity, 38%)`),
109
+ containerOpacity: unsafeCSS(`var(--m3e-filled-card-disabled-container-opacity, 38%)`),
110
+ },
111
+ hover: {
112
+ textColor: unsafeCSS(`var(--m3e-filled-card-hover-text-color, ${DesignToken.color.onSurface})`),
113
+ stateLayerColor: unsafeCSS(`var(--m3e-filled-card-hover-state-layer-color, ${DesignToken.color.onSurface})`),
114
+ stateLayerOpacity: unsafeCSS(`var(--m3e-filled-card-hover-state-layer-opacity, ${DesignToken.state.hoverStateLayerOpacity})`),
115
+ containerElevation: unsafeCSS(`var(--m3e-filled-card-hover-container-elevation, ${DesignToken.elevation.level1})`),
116
+ },
117
+ focus: {
118
+ textColor: unsafeCSS(`var(--m3e-filled-card-focus-text-color, ${DesignToken.color.onSurface})`),
119
+ stateLayerColor: unsafeCSS(`var(--m3e-filled-card-focus-state-layer-color, ${DesignToken.color.onSurface})`),
120
+ stateLayerOpacity: unsafeCSS(`var(--m3e-filled-card-focus-state-layer-opacity, ${DesignToken.state.focusStateLayerOpacity})`),
121
+ containerElevation: unsafeCSS(`var(--m3e-filled-card-focus-container-elevation, ${DesignToken.elevation.level0})`),
122
+ },
123
+ pressed: {
124
+ textColor: unsafeCSS(`var(--m3e-filled-card-pressed-text-color, ${DesignToken.color.onSurface})`),
125
+ stateLayerColor: unsafeCSS(`var(--m3e-filled-card-pressed-state-layer-color, ${DesignToken.color.onSurface})`),
126
+ stateLayerOpacity: unsafeCSS(`var(--m3e-filled-card-pressed-state-layer-opacity, ${DesignToken.state.pressedStateLayerOpacity})`),
127
+ containerElevation: unsafeCSS(`var(--m3e-filled-card-pressed-container-elevation, ${DesignToken.elevation.level0})`),
128
+ },
129
+ },
130
+ elevated: {
131
+ textColor: unsafeCSS(`var(--m3e-elevated-card-text-color, ${DesignToken.color.onSurface})`),
132
+ containerColor: unsafeCSS(`var(--m3e-elevated-card-container-color, ${DesignToken.color.surfaceContainerLow})`),
133
+ containerElevation: unsafeCSS(`var(--m3e-elevated-card-container-elevation, ${DesignToken.elevation.level1})`),
134
+ disabled: {
135
+ textColor: unsafeCSS(`var(--m3e-elevated-card-disabled-text-color, ${DesignToken.color.onSurface})`),
136
+ textOpacity: unsafeCSS(`var(--m3e-elevated-card-disabled-text-opacity, 38%)`),
137
+ imageOpacity: unsafeCSS(`var(--m3e-elevated-card-disabled-image-opacity, 38%)`),
138
+ containerColor: unsafeCSS(`var(--m3e-elevated-card-disabled-container-color, ${DesignToken.color.surface})`),
139
+ containerElevation: unsafeCSS(`var(--m3e-elevated-card-disabled-container-elevation, ${DesignToken.elevation.level1})`),
140
+ containerElevationColor: unsafeCSS(`var(--m3e-elevated-card-disabled-container-elevation-color, ${DesignToken.color.onSurface})`),
141
+ containerElevationOpacity: unsafeCSS(`var(--m3e-elevated-card-disabled-container-elevation-opacity, 38%)`),
142
+ containerOpacity: unsafeCSS(`var(--m3e-elevated-card-disabled-container-opacity, 38%)`),
143
+ },
144
+ hover: {
145
+ textColor: unsafeCSS(`var(--m3e-elevated-card-hover-text-color, ${DesignToken.color.onSurface})`),
146
+ stateLayerColor: unsafeCSS(`var(--m3e-elevated-card-hover-state-layer-color, ${DesignToken.color.onSurface})`),
147
+ stateLayerOpacity: unsafeCSS(`var(--m3e-elevated-card-hover-state-layer-opacity, ${DesignToken.state.hoverStateLayerOpacity})`),
148
+ containerElevation: unsafeCSS(`var(--m3e-elevated-card-hover-container-elevation, ${DesignToken.elevation.level2})`),
149
+ },
150
+ focus: {
151
+ textColor: unsafeCSS(`var(--m3e-elevated-card-focus-text-color, ${DesignToken.color.onSurface})`),
152
+ stateLayerColor: unsafeCSS(`var(--m3e-elevated-card-focus-state-layer-color, ${DesignToken.color.onSurface})`),
153
+ stateLayerOpacity: unsafeCSS(`var(--m3e-elevated-card-focus-state-layer-opacity, ${DesignToken.state.focusStateLayerOpacity})`),
154
+ containerElevation: unsafeCSS(`var(--m3e-elevated-card-focus-container-elevation, ${DesignToken.elevation.level1})`),
155
+ },
156
+ pressed: {
157
+ textColor: unsafeCSS(`var(--m3e-elevated-card-pressed-text-color, ${DesignToken.color.onSurface})`),
158
+ stateLayerColor: unsafeCSS(`var(--m3e-elevated-card-pressed-state-layer-color, ${DesignToken.color.onSurface})`),
159
+ stateLayerOpacity: unsafeCSS(`var(--m3e-elevated-card-pressed-state-layer-opacity, ${DesignToken.state.pressedStateLayerOpacity})`),
160
+ containerElevation: unsafeCSS(`var(--m3e-elevated-card-pressed-container-elevation, ${DesignToken.elevation.level1})`),
161
+ },
162
+ },
163
+ outlined: {
164
+ textColor: unsafeCSS(`var(--m3e-outlined-card-text-color, ${DesignToken.color.onSurface})`),
165
+ containerElevation: unsafeCSS(`var(--m3e-outlined-card-container-elevation, ${DesignToken.elevation.level0})`),
166
+ outlineColor: unsafeCSS(`var(--m3e-outlined-card-outline-color, ${DesignToken.color.outlineVariant})`),
167
+ outlineThickness: unsafeCSS("var(--m3e-outlined-card-outline-thickness, 1px)"),
168
+ disabled: {
169
+ textColor: unsafeCSS(`var(--m3e-outlined-card-disabled-text-color, ${DesignToken.color.onSurface})`),
170
+ textOpacity: unsafeCSS(`var(--m3e-outlined-card-disabled-text-opacity, 38%)`),
171
+ imageOpacity: unsafeCSS(`var(--m3e-outlined-card-disabled-image-opacity, 38%)`),
172
+ containerElevation: unsafeCSS(`var(--m3e-outlined-card-disabled-container-elevation, ${DesignToken.elevation.level0})`),
173
+ containerElevationColor: unsafeCSS(`var(--m3e-outlined-card-disabled-container-elevation-color, ${DesignToken.color.onSurface})`),
174
+ containerElevationOpacity: unsafeCSS(`var(--m3e-outlined-card-disabled-container-elevation-opacity, 38%)`),
175
+ outlineColor: unsafeCSS(`var(--m3e-outlined-card-disabled-outline-color, ${DesignToken.color.outline})`),
176
+ outlineOpacity: unsafeCSS(`var(--m3e-outlined-card-disabled-outline-opacity, 12%)`),
177
+ },
178
+ hover: {
179
+ textColor: unsafeCSS(`var(--m3e-outlined-card-hover-text-color, ${DesignToken.color.onSurface})`),
180
+ stateLayerColor: unsafeCSS(`var(--m3e-outlined-card-hover-state-layer-color, ${DesignToken.color.onSurface})`),
181
+ stateLayerOpacity: unsafeCSS(`var(--m3e-outlined-card-hover-state-layer-opacity, ${DesignToken.state.hoverStateLayerOpacity})`),
182
+ containerElevation: unsafeCSS(`var(--m3e-outlined-card-hover-container-elevation, ${DesignToken.elevation.level1})`),
183
+ outlineColor: unsafeCSS(`var(--m3e-outlined-card-hover-outline-color, ${DesignToken.color.outlineVariant})`),
184
+ },
185
+ focus: {
186
+ textColor: unsafeCSS(`var(--m3e-outlined-card-focus-text-color, ${DesignToken.color.onSurface})`),
187
+ stateLayerColor: unsafeCSS(`var(--m3e-outlined-card-focus-state-layer-color, ${DesignToken.color.onSurface})`),
188
+ stateLayerOpacity: unsafeCSS(`var(--m3e-outlined-card-focus-state-layer-opacity, ${DesignToken.state.focusStateLayerOpacity})`),
189
+ containerElevation: unsafeCSS(`var(--m3e-outlined-card-focus-container-elevation, ${DesignToken.elevation.level0})`),
190
+ outlineColor: unsafeCSS(`var(--m3e-outlined-card-focus-outline-color, ${DesignToken.color.onSurface})`),
191
+ },
192
+ pressed: {
193
+ textColor: unsafeCSS(`var(--m3e-outlined-card-pressed-text-color, ${DesignToken.color.onSurface})`),
194
+ stateLayerColor: unsafeCSS(`var(--m3e-outlined-card-pressed-state-layer-color, ${DesignToken.color.onSurface})`),
195
+ stateLayerOpacity: unsafeCSS(`var(--m3e-outlined-card-pressed-state-layer-opacity, ${DesignToken.state.pressedStateLayerOpacity})`),
196
+ containerElevation: unsafeCSS(`var(--m3e-outlined-card-pressed-container-elevation, ${DesignToken.elevation.level0})`),
197
+ outlineColor: unsafeCSS(`var(--m3e-outlined-card-pressed-outline-color, ${DesignToken.color.outlineVariant})`),
198
+ },
199
+ },
200
+ };
201
+
202
+ /**
203
+ * Baseline styles for `M3eCardElement`.
204
+ * @internal
205
+ */
206
+ const CardStyle = css `
207
+ :host {
208
+ outline: none;
209
+ }
210
+ :host(:not([inline])) {
211
+ display: block;
212
+ }
213
+ :host(:not([inline])) .base {
214
+ display: flex;
215
+ }
216
+ :host([inline]) {
217
+ display: inline-block;
218
+ vertical-align: middle;
219
+ }
220
+ :host([inline]) .base {
221
+ display: inline-flex;
222
+ }
223
+ .base {
224
+ width: 100%;
225
+ height: 100%;
226
+ position: relative;
227
+ box-sizing: border-box;
228
+ border-radius: ${CardToken.shape};
229
+ transition: ${unsafeCSS(`background-color ${DesignToken.motion.duration.short4} ${DesignToken.motion.easing.standard},
230
+ border-color ${DesignToken.motion.duration.short4} ${DesignToken.motion.easing.standard}`)};
231
+ }
232
+ :host([actionable]) .base {
233
+ user-select: none;
234
+ }
235
+ :host([actionable]:not(:disabled):not([disabled-interactive])) {
236
+ cursor: pointer;
237
+ }
238
+ :host([actionable][disabled-interactive]) {
239
+ cursor: not-allowed;
240
+ }
241
+ :host(:not([actionable])) .focus-ring,
242
+ :host(:not([actionable])) .state-layer,
243
+ :host(:not([actionable])) .ripple {
244
+ display: none;
245
+ }
246
+ :host([variant="outlined"]) .base {
247
+ border-style: solid;
248
+ }
249
+ ::slotted([slot="content"]) {
250
+ flex: 1 1 auto;
251
+ }
252
+ :host([orientation="vertical"]) ::slotted([slot="content"]) {
253
+ margin-inline: ${CardToken.padding};
254
+ }
255
+ :host([orientation="vertical"]) ::slotted([slot="content"]:first-child) {
256
+ margin-block-start: ${CardToken.padding};
257
+ }
258
+ :host([orientation="vertical"]) ::slotted([slot="content"]:last-child) {
259
+ margin-block-end: ${CardToken.padding};
260
+ }
261
+ :host([orientation="horizontal"]) ::slotted([slot="content"]) {
262
+ margin-block: ${CardToken.padding};
263
+ }
264
+ :host([orientation="horizontal"]) ::slotted([slot="content"]:first-child) {
265
+ margin-inline-start: ${CardToken.padding};
266
+ }
267
+ :host([orientation="horizontal"]) ::slotted([slot="content"]:last-child) {
268
+ margin-inline-end: ${CardToken.padding};
269
+ }
270
+ :host([orientation="vertical"]) ::slotted([slot="header"]:not(img):not(video)) {
271
+ margin-inline: ${CardToken.padding};
272
+ margin-block-start: ${CardToken.padding};
273
+ }
274
+ :host([orientation="horizontal"]) ::slotted([slot="header"]:not(img):not(video)) {
275
+ margin-inline-start: ${CardToken.padding};
276
+ margin-block: ${CardToken.padding};
277
+ }
278
+ ::slotted(img),
279
+ ::slotted(video) {
280
+ inset: 0;
281
+ object-fit: cover;
282
+ }
283
+ ::slotted(img[slot="header"]),
284
+ ::slotted(video[slot="header"]) {
285
+ border-radius: ${CardToken.shape};
286
+ }
287
+ ::slotted([slot="actions"]) {
288
+ margin-inline: ${CardToken.padding};
289
+ margin-block: ${CardToken.padding};
290
+ }
291
+ ::slotted([slot="actions"][end]) {
292
+ justify-content: flex-end;
293
+ }
294
+ :host([orientation="vertical"]) ::slotted([slot="footer"]) {
295
+ margin-inline: ${CardToken.padding};
296
+ margin-block-end: ${CardToken.padding};
297
+ }
298
+ :host([orientation="horizontal"]) ::slotted([slot="footer"]) {
299
+ margin-block: ${CardToken.padding};
300
+ margin-inline-end: ${CardToken.padding};
301
+ }
302
+ ::slotted([slot="header"]),
303
+ ::slotted([slot="actions"]),
304
+ ::slotted([slot="footer"]) {
305
+ flex: none;
306
+ display: flex;
307
+ align-items: center;
308
+ }
309
+ :host([orientation="vertical"]) .base,
310
+ :host([orientation="horizontal"]) ::slotted([slot="header"]),
311
+ :host([orientation="horizontal"]) ::slotted([slot="actions"]),
312
+ :host([orientation="horizontal"]) ::slotted([slot="footer"]) {
313
+ flex-direction: column;
314
+ }
315
+ :host([orientation="horizontal"]) .base,
316
+ :host([orientation="vertical"]) ::slotted([slot="header"]),
317
+ :host([orientation="vertical"]) ::slotted([slot="actions"]),
318
+ :host([orientation="vertical"]) ::slotted([slot="footer"]) {
319
+ flex-direction: row;
320
+ }
321
+ :host([orientation="horizontal"]) ::slotted(img),
322
+ :host([orientation="horizontal"]) ::slotted(video) {
323
+ aspect-ratio: 16 / 9;
324
+ }
325
+ a {
326
+ all: unset;
327
+ display: block;
328
+ position: absolute;
329
+ top: 0px;
330
+ left: 0px;
331
+ right: 0px;
332
+ bottom: 0px;
333
+ z-index: 1;
334
+ }
335
+ @media (forced-colors: active) {
336
+ .base {
337
+ transition: none;
338
+ }
339
+ :host([variant]) .base {
340
+ border-style: solid;
341
+ border-color: CanvasText;
342
+ border-width: ${CardVariantToken.outlined.outlineThickness ?? unsafeCSS("unset")};
343
+ }
344
+ :host([actionable][variant]:disabled) .base,
345
+ :host([actionable][variant][disabled-interactive]) .base {
346
+ color: GrayText;
347
+ border-color: GrayText;
348
+ }
349
+ }
350
+ @media (prefers-reduced-motion) {
351
+ .base {
352
+ transition: none;
353
+ }
354
+ }
355
+ `;
356
+
357
+ /** @private */
358
+ function cardVariantStyle(variant) {
359
+ return css `
360
+ :host([variant="${unsafeCSS(variant)}"]) .base {
361
+ background-color: ${CardVariantToken[variant].containerColor ?? unsafeCSS("unset")};
362
+ box-shadow: ${CardVariantToken[variant].containerElevation ?? unsafeCSS("unset")};
363
+ border-width: ${CardVariantToken[variant].outlineThickness ?? unsafeCSS("unset")};
364
+ }
365
+ :host([actionable][variant="${unsafeCSS(variant)}"]) .base {
366
+ --m3e-state-layer-hover-color: ${CardVariantToken[variant].hover.stateLayerColor};
367
+ --m3e-state-layer-hover-opacity: ${CardVariantToken[variant].hover.stateLayerOpacity};
368
+ --m3e-state-layer-focus-color: ${CardVariantToken[variant].focus.stateLayerColor};
369
+ --m3e-state-layer-focus-opacity: ${CardVariantToken[variant].focus.stateLayerOpacity};
370
+ --m3e-ripple-color: ${CardVariantToken[variant].pressed.stateLayerColor};
371
+ --m3e-ripple-opacity: ${CardVariantToken[variant].pressed.stateLayerOpacity};
372
+ --m3e-elevation-level: ${CardVariantToken[variant].containerElevation ?? unsafeCSS("unset")};
373
+ --m3e-elevation-hover-level: ${CardVariantToken[variant].hover.containerElevation ?? unsafeCSS("unset")};
374
+ --m3e-elevation-focus-level: ${CardVariantToken[variant].focus.containerElevation ?? unsafeCSS("unset")};
375
+ --m3e-elevation-pressed-level: ${CardVariantToken[variant].pressed.containerElevation ?? unsafeCSS("unset")};
376
+ }
377
+ :host([variant="${unsafeCSS(variant)}"]) .base {
378
+ border-color: ${CardVariantToken[variant].outlineColor ?? unsafeCSS("unset")};
379
+ }
380
+ :host([actionable][variant="${unsafeCSS(variant)}"]:focus .base) {
381
+ border-color: ${CardVariantToken[variant].focus.outlineColor ?? unsafeCSS("unset")};
382
+ }
383
+ :host([actionable][variant="${unsafeCSS(variant)}"]:hover .base) {
384
+ border-color: ${CardVariantToken[variant].hover.outlineColor ?? unsafeCSS("unset")};
385
+ }
386
+ :host([actionable][variant="${unsafeCSS(variant)}"]) .base.pressed {
387
+ border-color: ${CardVariantToken[variant].pressed.outlineColor ?? unsafeCSS("unset")};
388
+ }
389
+ :host([variant="${unsafeCSS(variant)}"]) .base {
390
+ color: ${CardVariantToken[variant].textColor ?? unsafeCSS("unset")};
391
+ }
392
+ :host([actionable][variant="${unsafeCSS(variant)}"]:focus) .base {
393
+ color: ${CardVariantToken[variant].focus.textColor ?? unsafeCSS("unset")};
394
+ }
395
+ :host([actionable][variant="${unsafeCSS(variant)}"]:hover) .base {
396
+ color: ${CardVariantToken[variant].hover.textColor ?? unsafeCSS("unset")};
397
+ }
398
+ :host([actionable][variant="${unsafeCSS(variant)}"]) .base.pressed {
399
+ color: ${CardVariantToken[variant].pressed.textColor ?? unsafeCSS("unset")};
400
+ }
401
+ :host([actionable][variant="${unsafeCSS(variant)}"]:disabled) .base,
402
+ :host([actionable][variant="${unsafeCSS(variant)}"][disabled-interactive]) .base {
403
+ --m3e-elevation-level: ${CardVariantToken[variant].disabled.containerElevation ?? unsafeCSS("unset")};
404
+ --m3e-elevation-color: color-mix(
405
+ in srgb,
406
+ ${CardVariantToken[variant].disabled.containerElevationColor}
407
+ ${CardVariantToken[variant].disabled.containerElevationOpacity},
408
+ transparent
409
+ );
410
+ color: color-mix(
411
+ in srgb,
412
+ ${CardVariantToken[variant].disabled.textColor} ${CardVariantToken[variant].disabled.textOpacity},
413
+ transparent
414
+ );
415
+ background-color: ${CardVariantToken[variant].disabled.containerColor &&
416
+ CardVariantToken[variant].disabled.containerOpacity
417
+ ? unsafeCSS(`color-mix(
418
+ in srgb,
419
+ ${CardVariantToken[variant].disabled.containerColor} ${CardVariantToken[variant].disabled.containerOpacity},
420
+ transparent
421
+ )`)
422
+ : unsafeCSS("unset")};
423
+ border-color: ${CardVariantToken[variant].disabled.outlineColor &&
424
+ CardVariantToken[variant].disabled.outlineOpacity
425
+ ? unsafeCSS(`color-mix(
426
+ in srgb,
427
+ ${CardVariantToken[variant].disabled.outlineColor} ${CardVariantToken[variant].disabled.outlineOpacity},
428
+ transparent
429
+ )`)
430
+ : unsafeCSS("unset")};
431
+ }
432
+ :host([actionable][variant="${unsafeCSS(variant)}"]:disabled) ::slotted(img),
433
+ :host([actionable][variant="${unsafeCSS(variant)}"][disabled-interactive]) ::slotted(img),
434
+ :host([actionable][variant="${unsafeCSS(variant)}"]:disabled) ::slotted(video),
435
+ :host([actionable][variant="${unsafeCSS(variant)}"][disabled-interactive]) ::slotted(video) {
436
+ opacity: ${CardVariantToken[variant].disabled.imageOpacity};
437
+ }
438
+ `;
439
+ }
440
+ /**
441
+ * Appearance variant styles for `M3eCardElement`.
442
+ * @internal
443
+ */
444
+ const CardVariantStyle = [
445
+ cardVariantStyle("filled"),
446
+ cardVariantStyle("elevated"),
447
+ cardVariantStyle("outlined"),
448
+ ];
449
+
450
+ var _M3eCardElement_instances, _M3eCardElement_clickHandler, _M3eCardElement_handleClick;
451
+ /**
452
+ * @summary
453
+ * A content container for text, images (or other media), and actions in the context of a single subject.
454
+ *
455
+ * @description
456
+ * The `m3e-card` component is a flexible, expressive container for presenting a unified subject—text,
457
+ * media, and actions—on a visually distinct surface. It supports multiple appearance variants via the
458
+ * `variant` attribute: `filled` (default, for solid emphasis), `outlined` (for subtle framing with a border),
459
+ * and `elevated` (for depth and motion with shadow elevation).
460
+ *
461
+ * Cards can be made actionable, responding to user interaction when the `actionable` attribute is set, and can be
462
+ * presented inline with surrounding content using the `inline` attribute.
463
+ *
464
+ * It supports both vertical and horizontal layouts through the `orientation` attribute. Content organization is
465
+ * enabled via dedicated slots for `header`, `content`, `actions`, and `footer`, or developers can use the default
466
+ * slot for custom layouts.
467
+ *
468
+ * The component provides dynamic elevation, adaptive shape, and expressive color theming, and responds to interaction states
469
+ * (hover, focus, press, disabled) with smooth motion and visual feedback, ensuring clarity, accessibility,
470
+ * and a cohesive user experience in accordance with Material Design 3 guidelines.
471
+ *
472
+ * @example
473
+ * The following example illustrates each of the dedicated slots of a card.
474
+ * ```html
475
+ * <m3e-card>
476
+ * <div slot="header">Header section</div>
477
+ * <div slot="content">Content section</div>
478
+ * <div slot="actions">Actions section</div>
479
+ * <div slot="footer">Footer section</div>
480
+ * </m3e-card>
481
+ * ```
482
+ *
483
+ * @tag m3e-card
484
+ *
485
+ * @slot - Renders the content of the card without padding.
486
+ * @slot header - Renders the header of the card.
487
+ * @slot content - Renders the content of the card with padding.
488
+ * @slot actions - Renders the actions of the card.
489
+ * @slot footer - Renders the footer of the card.
490
+ *
491
+ * @attr actionable - Whether the card is "actionable" and will respond to use interaction.
492
+ * @attr inline - Whether to present the card inline with surrounding content.
493
+ * @attr orientation - The orientation of the card.
494
+ * @attr variant - The appearance variant of the card.
495
+ *
496
+ * @cssprop --m3e-card-padding - Internal spacing for all slotted regions
497
+ * @cssprop --m3e-card-shape - Corner radius of the card container.
498
+ * @cssprop --m3e-filled-card-text-color - Foreground color for text content in filled cards.
499
+ * @cssprop --m3e-filled-card-container-color - Background color of the filled card container.
500
+ * @cssprop --m3e-filled-card-container-elevation - Elevation level for filled card container.
501
+ * @cssprop --m3e-filled-card-disabled-text-color - Text color when filled card is disabled.
502
+ * @cssprop --m3e-filled-card-disabled-text-opacity - Opacity applied to text when disabled.
503
+ * @cssprop --m3e-filled-card-disabled-container-color - Background color when disabled.
504
+ * @cssprop --m3e-filled-card-disabled-container-elevation - Elevation level when disabled.
505
+ * @cssprop --m3e-filled-card-disabled-container-elevation-color - Shadow color when disabled.
506
+ * @cssprop --m3e-filled-card-disabled-container-elevation-opacity - Shadow opacity when disabled.
507
+ * @cssprop --m3e-filled-card-disabled-container-opacity - Overall container opacity when disabled.
508
+ * @cssprop --m3e-filled-card-hover-text-color - Text color on hover.
509
+ * @cssprop --m3e-filled-card-hover-state-layer-color - State layer color on hover.
510
+ * @cssprop --m3e-filled-card-hover-state-layer-opacity - State layer opacity on hover.
511
+ * @cssprop --m3e-filled-card-hover-container-elevation - Elevation level on hover.
512
+ * @cssprop --m3e-filled-card-focus-text-color - Text color on focus.
513
+ * @cssprop --m3e-filled-card-focus-state-layer-color - State layer color on focus.
514
+ * @cssprop --m3e-filled-card-focus-state-layer-opacity - State layer opacity on focus.
515
+ * @cssprop --m3e-filled-card-focus-container-elevation - Elevation level on focus.
516
+ * @cssprop --m3e-filled-card-pressed-text-color - Text color on press.
517
+ * @cssprop --m3e-filled-card-pressed-state-layer-color - State layer color on press.
518
+ * @cssprop --m3e-filled-card-pressed-state-layer-opacity - State layer opacity on press.
519
+ * @cssprop --m3e-filled-card-pressed-container-elevation - Elevation level on press.
520
+ * @cssprop --m3e-elevated-card-text-color - Foreground color for text content in elevated cards.
521
+ * @cssprop --m3e-elevated-card-container-color - Background color of the elevated card container.
522
+ * @cssprop --m3e-elevated-card-container-elevation - Elevation level for elevated card container.
523
+ * @cssprop --m3e-elevated-card-disabled-text-color - Text color when elevated card is disabled.
524
+ * @cssprop --m3e-elevated-card-disabled-text-opacity - Opacity applied to text when disabled.
525
+ * @cssprop --m3e-elevated-card-disabled-container-color - Background color when disabled.
526
+ * @cssprop --m3e-elevated-card-disabled-container-elevation - Elevation level when disabled.
527
+ * @cssprop --m3e-elevated-card-disabled-container-elevation-color - Shadow color when disabled.
528
+ * @cssprop --m3e-elevated-card-disabled-container-elevation-opacity - Shadow opacity when disabled.
529
+ * @cssprop --m3e-elevated-card-disabled-container-opacity - Overall container opacity when disabled.
530
+ * @cssprop --m3e-elevated-card-hover-text-color - Text color on hover.
531
+ * @cssprop --m3e-elevated-card-hover-state-layer-color - State layer color on hover.
532
+ * @cssprop --m3e-elevated-card-hover-state-layer-opacity - State layer opacity on hover.
533
+ * @cssprop --m3e-elevated-card-hover-container-elevation - Elevation level on hover.
534
+ * @cssprop --m3e-elevated-card-focus-text-color - Text color on focus.
535
+ * @cssprop --m3e-elevated-card-focus-state-layer-color - State layer color on focus.
536
+ * @cssprop --m3e-elevated-card-focus-state-layer-opacity - State layer opacity on focus.
537
+ * @cssprop --m3e-elevated-card-focus-container-elevation - Elevation level on focus.
538
+ * @cssprop --m3e-elevated-card-pressed-text-color - Text color on press.
539
+ * @cssprop --m3e-elevated-card-pressed-state-layer-color - State layer color on press.
540
+ * @cssprop --m3e-elevated-card-pressed-state-layer-opacity - State layer opacity on press.
541
+ * @cssprop --m3e-elevated-card-pressed-container-elevation - Elevation level on press.
542
+ * @cssprop --m3e-outlined-card-text-color - Foreground color for text content in outlined cards.
543
+ * @cssprop --m3e-outlined-card-container-elevation - Elevation level for outlined card container.
544
+ * @cssprop --m3e-outlined-card-outline-color - Border color for outlined cards.
545
+ * @cssprop --m3e-outlined-card-outline-thickness - Border thickness for outlined cards.
546
+ * @cssprop --m3e-outlined-card-disabled-text-color - Text color when outlined card is disabled.
547
+ * @cssprop --m3e-outlined-card-disabled-text-opacity - Opacity applied to text when disabled.
548
+ * @cssprop --m3e-outlined-card-disabled-container-elevation - Elevation level when disabled.
549
+ * @cssprop --m3e-outlined-card-disabled-container-elevation-color - Shadow color when disabled.
550
+ * @cssprop --m3e-outlined-card-disabled-container-elevation-opacity - Shadow opacity when disabled.
551
+ * @cssprop --m3e-outlined-card-disabled-outline-color - Border color when disabled.
552
+ * @cssprop --m3e-outlined-card-disabled-outline-opacity - Border opacity when disabled.
553
+ * @cssprop --m3e-outlined-card-hover-text-color - Text color on hover.
554
+ * @cssprop --m3e-outlined-card-hover-state-layer-color - State layer color on hover.
555
+ * @cssprop --m3e-outlined-card-hover-state-layer-opacity - State layer opacity on hover.
556
+ * @cssprop --m3e-outlined-card-hover-container-elevation - Elevation level on hover.
557
+ * @cssprop --m3e-outlined-card-hover-outline-color - Border color on hover.
558
+ * @cssprop --m3e-outlined-card-focus-text-color - Text color on focus.
559
+ * @cssprop --m3e-outlined-card-focus-state-layer-color - State layer color on focus.
560
+ * @cssprop --m3e-outlined-card-focus-state-layer-opacity - State layer opacity on focus.
561
+ * @cssprop --m3e-outlined-card-focus-container-elevation - Elevation level on focus.
562
+ * @cssprop --m3e-outlined-card-focus-outline-color - Border color on focus.
563
+ * @cssprop --m3e-outlined-card-pressed-text-color - Text color on press.
564
+ * @cssprop --m3e-outlined-card-pressed-state-layer-color - State layer color on press.
565
+ * @cssprop --m3e-outlined-card-pressed-state-layer-opacity - State layer opacity on press.
566
+ * @cssprop --m3e-outlined-card-pressed-container-elevation - Elevation level on press.
567
+ * @cssprop --m3e-outlined-card-pressed-outline-color - Border color on press.
568
+ */
569
+ let M3eCardElement = class M3eCardElement extends KeyboardClick(LinkButton(FormSubmitter(Focusable(DisabledInteractive(Disabled(AttachInternals(Role(LitElement, "none"), true))))))) {
570
+ constructor() {
571
+ super();
572
+ _M3eCardElement_instances.add(this);
573
+ /** @private */ _M3eCardElement_clickHandler.set(this, (e) => __classPrivateFieldGet(this, _M3eCardElement_instances, "m", _M3eCardElement_handleClick).call(this, e));
574
+ /**
575
+ * Whether to present the card inline with surrounding content.
576
+ * @default false
577
+ */
578
+ this.inline = false;
579
+ /**
580
+ * Whether the card is "actionable" and will respond to use interaction.
581
+ * @default false
582
+ */
583
+ this.actionable = false;
584
+ /**
585
+ * The appearance variant of the card.
586
+ * @default "filled"
587
+ */
588
+ this.variant = "filled";
589
+ /**
590
+ * The orientation of the card.
591
+ * @default "vertical"
592
+ */
593
+ this.orientation = "vertical";
594
+ new PressedController(this, {
595
+ isPressedKey: (key) => key === " " || key === "Enter",
596
+ callback: (pressed) => {
597
+ if (this.actionable && !this.disabled && !this.disabledInteractive) {
598
+ this._base?.classList.toggle("pressed", pressed);
599
+ }
600
+ },
601
+ });
602
+ }
603
+ /** @inheritdoc */
604
+ connectedCallback() {
605
+ if (this.hasAttribute("actionable")) {
606
+ // If href is specified, the LinkButton mixin changes this to "link" if role is "button".
607
+ this.role = "button";
608
+ }
609
+ super.connectedCallback();
610
+ this.addEventListener("click", __classPrivateFieldGet(this, _M3eCardElement_clickHandler, "f"));
611
+ }
612
+ /** @inheritdoc */
613
+ disconnectedCallback() {
614
+ super.disconnectedCallback();
615
+ this._base?.classList.toggle("pressed", false);
616
+ this.removeEventListener("click", __classPrivateFieldGet(this, _M3eCardElement_clickHandler, "f"));
617
+ }
618
+ /** @inheritdoc */
619
+ render() {
620
+ return html `<div class="base">
621
+ <m3e-elevation
622
+ class="elevation"
623
+ ?disabled="${!this.actionable || this.disabled || this.disabledInteractive}"
624
+ ></m3e-elevation>
625
+ <m3e-focus-ring class="focus-ring" ?disabled="${!this.actionable || this.disabled}"></m3e-focus-ring>
626
+ <m3e-state-layer
627
+ class="state-layer"
628
+ ?disabled="${!this.actionable || this.disabled || this.disabledInteractive}"
629
+ ></m3e-state-layer>
630
+ <m3e-ripple
631
+ class="ripple"
632
+ ?disabled="${!this.actionable || this.disabled || this.disabledInteractive}"
633
+ ></m3e-ripple>
634
+ ${this[renderPseudoLink]()}
635
+ <slot name="header"></slot>
636
+ <slot name="content"><slot></slot></slot>
637
+ <slot name="actions"></slot>
638
+ <slot name="footer"></slot>
639
+ </div>`;
640
+ }
641
+ /** @inheritdoc */
642
+ firstUpdated(_changedProperties) {
643
+ super.firstUpdated(_changedProperties);
644
+ [this._elevation, this._focusRing, this._stateLayer, this._ripple].forEach((x) => x?.attach(this));
645
+ }
646
+ };
647
+ _M3eCardElement_clickHandler = new WeakMap();
648
+ _M3eCardElement_instances = new WeakSet();
649
+ _M3eCardElement_handleClick = function _M3eCardElement_handleClick(e) {
650
+ if (this.disabled || this.disabledInteractive) {
651
+ e.preventDefault();
652
+ e.stopImmediatePropagation();
653
+ }
654
+ };
655
+ /** The styles of the element. */
656
+ M3eCardElement.styles = [CardVariantStyle, CardStyle];
657
+ __decorate([
658
+ e(".base")
659
+ ], M3eCardElement.prototype, "_base", void 0);
660
+ __decorate([
661
+ e(".elevation")
662
+ ], M3eCardElement.prototype, "_elevation", void 0);
663
+ __decorate([
664
+ e(".focus-ring")
665
+ ], M3eCardElement.prototype, "_focusRing", void 0);
666
+ __decorate([
667
+ e(".state-layer")
668
+ ], M3eCardElement.prototype, "_stateLayer", void 0);
669
+ __decorate([
670
+ e(".ripple")
671
+ ], M3eCardElement.prototype, "_ripple", void 0);
672
+ __decorate([
673
+ n({ type: Boolean })
674
+ ], M3eCardElement.prototype, "inline", void 0);
675
+ __decorate([
676
+ n({ type: Boolean })
677
+ ], M3eCardElement.prototype, "actionable", void 0);
678
+ __decorate([
679
+ n({ reflect: true })
680
+ ], M3eCardElement.prototype, "variant", void 0);
681
+ __decorate([
682
+ n({ reflect: true })
683
+ ], M3eCardElement.prototype, "orientation", void 0);
684
+ M3eCardElement = __decorate([
685
+ t$1("m3e-card")
686
+ ], M3eCardElement);
687
+
688
+ export { M3eCardElement };
689
+ //# sourceMappingURL=index.js.map