@m3e/card 1.0.0-rc.1 → 1.0.0-rc.2

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 (40) hide show
  1. package/README.md +1 -2
  2. package/dist/custom-elements.json +2944 -7
  3. package/dist/html-custom-data.json +46 -1
  4. package/dist/index.js +4 -3
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.js +57 -57
  7. package/dist/index.min.js.map +1 -1
  8. package/package.json +3 -3
  9. package/cem.config.mjs +0 -16
  10. package/demo/index.html +0 -126
  11. package/dist/src/CardElement.d.ts +0 -168
  12. package/dist/src/CardElement.d.ts.map +0 -1
  13. package/dist/src/CardOrientation.d.ts +0 -3
  14. package/dist/src/CardOrientation.d.ts.map +0 -1
  15. package/dist/src/CardVariant.d.ts +0 -3
  16. package/dist/src/CardVariant.d.ts.map +0 -1
  17. package/dist/src/index.d.ts +0 -4
  18. package/dist/src/index.d.ts.map +0 -1
  19. package/dist/src/styles/CardStyle.d.ts +0 -7
  20. package/dist/src/styles/CardStyle.d.ts.map +0 -1
  21. package/dist/src/styles/CardToken.d.ts +0 -9
  22. package/dist/src/styles/CardToken.d.ts.map +0 -1
  23. package/dist/src/styles/CardVariantStyle.d.ts +0 -7
  24. package/dist/src/styles/CardVariantStyle.d.ts.map +0 -1
  25. package/dist/src/styles/CardVariantToken.d.ts +0 -50
  26. package/dist/src/styles/CardVariantToken.d.ts.map +0 -1
  27. package/dist/src/styles/index.d.ts +0 -3
  28. package/dist/src/styles/index.d.ts.map +0 -1
  29. package/eslint.config.mjs +0 -13
  30. package/rollup.config.js +0 -32
  31. package/src/CardElement.ts +0 -258
  32. package/src/CardOrientation.ts +0 -2
  33. package/src/CardVariant.ts +0 -2
  34. package/src/index.ts +0 -3
  35. package/src/styles/CardStyle.ts +0 -163
  36. package/src/styles/CardToken.ts +0 -12
  37. package/src/styles/CardVariantStyle.ts +0 -99
  38. package/src/styles/CardVariantToken.ts +0 -205
  39. package/src/styles/index.ts +0 -2
  40. package/tsconfig.json +0 -9
@@ -1,168 +0,0 @@
1
- import { CSSResultGroup, LitElement, PropertyValues } from "lit";
2
- import { CardVariant } from "./CardVariant";
3
- import { CardOrientation } from "./CardOrientation";
4
- declare const M3eCardElement_base: import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").LinkButtonMixin> & import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").FormSubmitterMixin> & import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor & import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").DisabledInteractiveMixin> & import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").DisabledMixin> & import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").AttachInternalsMixin> & typeof LitElement;
5
- /**
6
- * @summary
7
- * A content container for text, images (or other media), and actions in the context of a single subject.
8
- *
9
- * @description
10
- * The `m3e-card` component is a flexible, expressive container for presenting a unified subject—text,
11
- * media, and actions—on a visually distinct surface. It supports multiple appearance variants via the
12
- * `variant` attribute: `filled` (default, for solid emphasis), `outlined` (for subtle framing with a border),
13
- * and `elevated` (for depth and motion with shadow elevation).
14
- *
15
- * Cards can be made actionable, responding to user interaction when the `actionable` attribute is set, and can be
16
- * presented inline with surrounding content using the `inline` attribute.
17
- *
18
- * It supports both vertical and horizontal layouts through the `orientation` attribute. Content organization is
19
- * enabled via dedicated slots for `header`, `content`, `actions`, and `footer`, or developers can use the default
20
- * slot for custom layouts.
21
- *
22
- * The component provides dynamic elevation, adaptive shape, and expressive color theming, and responds to interaction states
23
- * (hover, focus, press, disabled) with smooth motion and visual feedback, ensuring clarity, accessibility,
24
- * and a cohesive user experience in accordance with Material Design 3 guidelines.
25
- *
26
- * @example
27
- * The following example illustrates each of the dedicated slots of a card.
28
- * ```html
29
- * <m3e-card>
30
- * <div slot="header">Header section</div>
31
- * <div slot="content">Content section</div>
32
- * <div slot="actions">Actions section</div>
33
- * <div slot="footer">Footer section</div>
34
- * </m3e-card>
35
- * ```
36
- *
37
- * @tag m3e-card
38
- *
39
- * @slot - Renders the content of the card without padding.
40
- * @slot header - Renders the header of the card.
41
- * @slot content - Renders the content of the card with padding.
42
- * @slot actions - Renders the actions of the card.
43
- * @slot footer - Renders the footer of the card.
44
- *
45
- * @attr actionable - Whether the card is "actionable" and will respond to use interaction.
46
- * @attr inline - Whether to present the card inline with surrounding content.
47
- * @attr orientation - The orientation of the card.
48
- * @attr variant - The appearance variant of the card.
49
- *
50
- * @cssprop --m3e-card-padding - Internal spacing for all slotted regions
51
- * @cssprop --m3e-card-shape - Corner radius of the card container.
52
- * @cssprop --m3e-filled-card-text-color - Foreground color for text content in filled cards.
53
- * @cssprop --m3e-filled-card-container-color - Background color of the filled card container.
54
- * @cssprop --m3e-filled-card-container-elevation - Elevation level for filled card container.
55
- * @cssprop --m3e-filled-card-disabled-text-color - Text color when filled card is disabled.
56
- * @cssprop --m3e-filled-card-disabled-text-opacity - Opacity applied to text when disabled.
57
- * @cssprop --m3e-filled-card-disabled-container-color - Background color when disabled.
58
- * @cssprop --m3e-filled-card-disabled-container-elevation - Elevation level when disabled.
59
- * @cssprop --m3e-filled-card-disabled-container-elevation-color - Shadow color when disabled.
60
- * @cssprop --m3e-filled-card-disabled-container-elevation-opacity - Shadow opacity when disabled.
61
- * @cssprop --m3e-filled-card-disabled-container-opacity - Overall container opacity when disabled.
62
- * @cssprop --m3e-filled-card-hover-text-color - Text color on hover.
63
- * @cssprop --m3e-filled-card-hover-state-layer-color - State layer color on hover.
64
- * @cssprop --m3e-filled-card-hover-state-layer-opacity - State layer opacity on hover.
65
- * @cssprop --m3e-filled-card-hover-container-elevation - Elevation level on hover.
66
- * @cssprop --m3e-filled-card-focus-text-color - Text color on focus.
67
- * @cssprop --m3e-filled-card-focus-state-layer-color - State layer color on focus.
68
- * @cssprop --m3e-filled-card-focus-state-layer-opacity - State layer opacity on focus.
69
- * @cssprop --m3e-filled-card-focus-container-elevation - Elevation level on focus.
70
- * @cssprop --m3e-filled-card-pressed-text-color - Text color on press.
71
- * @cssprop --m3e-filled-card-pressed-state-layer-color - State layer color on press.
72
- * @cssprop --m3e-filled-card-pressed-state-layer-opacity - State layer opacity on press.
73
- * @cssprop --m3e-filled-card-pressed-container-elevation - Elevation level on press.
74
- * @cssprop --m3e-elevated-card-text-color - Foreground color for text content in elevated cards.
75
- * @cssprop --m3e-elevated-card-container-color - Background color of the elevated card container.
76
- * @cssprop --m3e-elevated-card-container-elevation - Elevation level for elevated card container.
77
- * @cssprop --m3e-elevated-card-disabled-text-color - Text color when elevated card is disabled.
78
- * @cssprop --m3e-elevated-card-disabled-text-opacity - Opacity applied to text when disabled.
79
- * @cssprop --m3e-elevated-card-disabled-container-color - Background color when disabled.
80
- * @cssprop --m3e-elevated-card-disabled-container-elevation - Elevation level when disabled.
81
- * @cssprop --m3e-elevated-card-disabled-container-elevation-color - Shadow color when disabled.
82
- * @cssprop --m3e-elevated-card-disabled-container-elevation-opacity - Shadow opacity when disabled.
83
- * @cssprop --m3e-elevated-card-disabled-container-opacity - Overall container opacity when disabled.
84
- * @cssprop --m3e-elevated-card-hover-text-color - Text color on hover.
85
- * @cssprop --m3e-elevated-card-hover-state-layer-color - State layer color on hover.
86
- * @cssprop --m3e-elevated-card-hover-state-layer-opacity - State layer opacity on hover.
87
- * @cssprop --m3e-elevated-card-hover-container-elevation - Elevation level on hover.
88
- * @cssprop --m3e-elevated-card-focus-text-color - Text color on focus.
89
- * @cssprop --m3e-elevated-card-focus-state-layer-color - State layer color on focus.
90
- * @cssprop --m3e-elevated-card-focus-state-layer-opacity - State layer opacity on focus.
91
- * @cssprop --m3e-elevated-card-focus-container-elevation - Elevation level on focus.
92
- * @cssprop --m3e-elevated-card-pressed-text-color - Text color on press.
93
- * @cssprop --m3e-elevated-card-pressed-state-layer-color - State layer color on press.
94
- * @cssprop --m3e-elevated-card-pressed-state-layer-opacity - State layer opacity on press.
95
- * @cssprop --m3e-elevated-card-pressed-container-elevation - Elevation level on press.
96
- * @cssprop --m3e-outlined-card-text-color - Foreground color for text content in outlined cards.
97
- * @cssprop --m3e-outlined-card-container-elevation - Elevation level for outlined card container.
98
- * @cssprop --m3e-outlined-card-outline-color - Border color for outlined cards.
99
- * @cssprop --m3e-outlined-card-outline-thickness - Border thickness for outlined cards.
100
- * @cssprop --m3e-outlined-card-disabled-text-color - Text color when outlined card is disabled.
101
- * @cssprop --m3e-outlined-card-disabled-text-opacity - Opacity applied to text when disabled.
102
- * @cssprop --m3e-outlined-card-disabled-container-elevation - Elevation level when disabled.
103
- * @cssprop --m3e-outlined-card-disabled-container-elevation-color - Shadow color when disabled.
104
- * @cssprop --m3e-outlined-card-disabled-container-elevation-opacity - Shadow opacity when disabled.
105
- * @cssprop --m3e-outlined-card-disabled-outline-color - Border color when disabled.
106
- * @cssprop --m3e-outlined-card-disabled-outline-opacity - Border opacity when disabled.
107
- * @cssprop --m3e-outlined-card-hover-text-color - Text color on hover.
108
- * @cssprop --m3e-outlined-card-hover-state-layer-color - State layer color on hover.
109
- * @cssprop --m3e-outlined-card-hover-state-layer-opacity - State layer opacity on hover.
110
- * @cssprop --m3e-outlined-card-hover-container-elevation - Elevation level on hover.
111
- * @cssprop --m3e-outlined-card-hover-outline-color - Border color on hover.
112
- * @cssprop --m3e-outlined-card-focus-text-color - Text color on focus.
113
- * @cssprop --m3e-outlined-card-focus-state-layer-color - State layer color on focus.
114
- * @cssprop --m3e-outlined-card-focus-state-layer-opacity - State layer opacity on focus.
115
- * @cssprop --m3e-outlined-card-focus-container-elevation - Elevation level on focus.
116
- * @cssprop --m3e-outlined-card-focus-outline-color - Border color on focus.
117
- * @cssprop --m3e-outlined-card-pressed-text-color - Text color on press.
118
- * @cssprop --m3e-outlined-card-pressed-state-layer-color - State layer color on press.
119
- * @cssprop --m3e-outlined-card-pressed-state-layer-opacity - State layer opacity on press.
120
- * @cssprop --m3e-outlined-card-pressed-container-elevation - Elevation level on press.
121
- * @cssprop --m3e-outlined-card-pressed-outline-color - Border color on press.
122
- */
123
- export declare class M3eCardElement extends M3eCardElement_base {
124
- #private;
125
- /** The styles of the element. */
126
- static styles: CSSResultGroup;
127
- /** @private */ private readonly _base?;
128
- /** @private */ private readonly _elevation?;
129
- /** @private */ private readonly _focusRing?;
130
- /** @private */ private readonly _stateLayer?;
131
- /** @private */ private readonly _ripple?;
132
- constructor();
133
- /**
134
- * Whether to present the card inline with surrounding content.
135
- * @default false
136
- */
137
- inline: boolean;
138
- /**
139
- * Whether the card is "actionable" and will respond to use interaction.
140
- * @default false
141
- */
142
- actionable: boolean;
143
- /**
144
- * The appearance variant of the card.
145
- * @default "filled"
146
- */
147
- variant: CardVariant;
148
- /**
149
- * The orientation of the card.
150
- * @default "vertical"
151
- */
152
- orientation: CardOrientation;
153
- /** @inheritdoc */
154
- connectedCallback(): void;
155
- /** @inheritdoc */
156
- disconnectedCallback(): void;
157
- /** @inheritdoc */
158
- protected render(): unknown;
159
- /** @inheritdoc */
160
- protected firstUpdated(_changedProperties: PropertyValues<this>): void;
161
- }
162
- declare global {
163
- interface HTMLElementTagNameMap {
164
- "m3e-card": M3eCardElement;
165
- }
166
- }
167
- export {};
168
- //# sourceMappingURL=CardElement.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CardElement.d.ts","sourceRoot":"","sources":["../../src/CardElement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAQ,UAAU,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAoBvE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqHG;AACH,qBACa,cAAe,SAAQ,mBAEnC;;IACC,iCAAiC;IACjC,OAAgB,MAAM,EAAE,cAAc,CAAiC;IAEvE,eAAe,CAAiB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAc;IACrE,eAAe,CAAsB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAsB;IACvF,eAAe,CAAuB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAsB;IACxF,eAAe,CAAwB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAuB;IAC3F,eAAe,CAAmB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAmB;;IAiB9E;;;OAGG;IAC0B,MAAM,UAAS;IAE5C;;;OAGG;IAC0B,UAAU,UAAS;IAEhD;;;OAGG;IAC0B,OAAO,EAAE,WAAW,CAAY;IAE7D;;;OAGG;IAC0B,WAAW,EAAE,eAAe,CAAc;IAEvE,kBAAkB;IACT,iBAAiB,IAAI,IAAI;IAUlC,kBAAkB;IACT,oBAAoB,IAAI,IAAI;IAOrC,kBAAkB;cACC,MAAM,IAAI,OAAO;IAuBpC,kBAAkB;cACC,YAAY,CAAC,kBAAkB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;CAYhF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,UAAU,EAAE,cAAc,CAAC;KAC5B;CACF"}
@@ -1,3 +0,0 @@
1
- /** Specifies the possible orientations of a card. */
2
- export type CardOrientation = "horizontal" | "vertical";
3
- //# sourceMappingURL=CardOrientation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CardOrientation.d.ts","sourceRoot":"","sources":["../../src/CardOrientation.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,MAAM,MAAM,eAAe,GAAG,YAAY,GAAG,UAAU,CAAC"}
@@ -1,3 +0,0 @@
1
- /** Specifies the possible appearance variants of a card. */
2
- export type CardVariant = "elevated" | "filled" | "outlined";
3
- //# sourceMappingURL=CardVariant.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CardVariant.d.ts","sourceRoot":"","sources":["../../src/CardVariant.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC"}
@@ -1,4 +0,0 @@
1
- export * from "./CardElement";
2
- export * from "./CardOrientation";
3
- export * from "./CardVariant";
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC"}
@@ -1,7 +0,0 @@
1
- import { CSSResult } from "lit";
2
- /**
3
- * Baseline styles for `M3eCardElement`.
4
- * @internal
5
- */
6
- export declare const CardStyle: CSSResult;
7
- //# sourceMappingURL=CardStyle.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CardStyle.d.ts","sourceRoot":"","sources":["../../../src/styles/CardStyle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,SAAS,EAAa,MAAM,KAAK,CAAC;AAOhD;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,SAuJvB,CAAC"}
@@ -1,9 +0,0 @@
1
- /**
2
- * Component design tokens for `M3eCardElement`.
3
- * @internal
4
- */
5
- export declare const CardToken: {
6
- readonly padding: import("lit").CSSResult;
7
- readonly shape: import("lit").CSSResult;
8
- };
9
- //# sourceMappingURL=CardToken.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CardToken.d.ts","sourceRoot":"","sources":["../../../src/styles/CardToken.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,eAAO,MAAM,SAAS;;;CAGZ,CAAC"}
@@ -1,7 +0,0 @@
1
- import { CSSResultGroup } from "lit";
2
- /**
3
- * Appearance variant styles for `M3eCardElement`.
4
- * @internal
5
- */
6
- export declare const CardVariantStyle: CSSResultGroup;
7
- //# sourceMappingURL=CardVariantStyle.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CardVariantStyle.d.ts","sourceRoot":"","sources":["../../../src/styles/CardVariantStyle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,cAAc,EAAa,MAAM,KAAK,CAAC;AA0FhE;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,cAI9B,CAAC"}
@@ -1,50 +0,0 @@
1
- import { CSSResult } from "lit";
2
- import { CardVariant } from "../CardVariant";
3
- /** @private */
4
- type _CardVariantToken = {
5
- textColor: CSSResult;
6
- containerColor?: CSSResult;
7
- containerElevation: CSSResult;
8
- outlineColor?: CSSResult;
9
- outlineThickness?: CSSResult;
10
- disabled: {
11
- textColor: CSSResult;
12
- textOpacity: CSSResult;
13
- imageOpacity: CSSResult;
14
- containerColor?: CSSResult;
15
- containerOpacity?: CSSResult;
16
- containerElevation: CSSResult;
17
- containerElevationColor: CSSResult;
18
- containerElevationOpacity: CSSResult;
19
- outlineColor?: CSSResult;
20
- outlineOpacity?: CSSResult;
21
- };
22
- hover: {
23
- textColor: CSSResult;
24
- stateLayerColor: CSSResult;
25
- stateLayerOpacity: CSSResult;
26
- containerElevation?: CSSResult;
27
- outlineColor?: CSSResult;
28
- };
29
- focus: {
30
- textColor: CSSResult;
31
- stateLayerColor: CSSResult;
32
- stateLayerOpacity: CSSResult;
33
- containerElevation?: CSSResult;
34
- outlineColor?: CSSResult;
35
- };
36
- pressed: {
37
- textColor: CSSResult;
38
- stateLayerColor: CSSResult;
39
- stateLayerOpacity: CSSResult;
40
- containerElevation?: CSSResult;
41
- outlineColor?: CSSResult;
42
- };
43
- };
44
- /**
45
- * Component design tokens that control the appearance variants of `M3eCardElement`.
46
- * @internal
47
- */
48
- export declare const CardVariantToken: Record<CardVariant, _CardVariantToken>;
49
- export {};
50
- //# sourceMappingURL=CardVariantToken.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CardVariantToken.d.ts","sourceRoot":"","sources":["../../../src/styles/CardVariantToken.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAa,MAAM,KAAK,CAAC;AAI3C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,eAAe;AACf,KAAK,iBAAiB,GAAG;IACvB,SAAS,EAAE,SAAS,CAAC;IACrB,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,kBAAkB,EAAE,SAAS,CAAC;IAC9B,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B,QAAQ,EAAE;QACR,SAAS,EAAE,SAAS,CAAC;QACrB,WAAW,EAAE,SAAS,CAAC;QACvB,YAAY,EAAE,SAAS,CAAC;QACxB,cAAc,CAAC,EAAE,SAAS,CAAC;QAC3B,gBAAgB,CAAC,EAAE,SAAS,CAAC;QAC7B,kBAAkB,EAAE,SAAS,CAAC;QAC9B,uBAAuB,EAAE,SAAS,CAAC;QACnC,yBAAyB,EAAE,SAAS,CAAC;QACrC,YAAY,CAAC,EAAE,SAAS,CAAC;QACzB,cAAc,CAAC,EAAE,SAAS,CAAC;KAC5B,CAAC;IACF,KAAK,EAAE;QACL,SAAS,EAAE,SAAS,CAAC;QACrB,eAAe,EAAE,SAAS,CAAC;QAC3B,iBAAiB,EAAE,SAAS,CAAC;QAC7B,kBAAkB,CAAC,EAAE,SAAS,CAAC;QAC/B,YAAY,CAAC,EAAE,SAAS,CAAC;KAC1B,CAAC;IACF,KAAK,EAAE;QACL,SAAS,EAAE,SAAS,CAAC;QACrB,eAAe,EAAE,SAAS,CAAC;QAC3B,iBAAiB,EAAE,SAAS,CAAC;QAC7B,kBAAkB,CAAC,EAAE,SAAS,CAAC;QAC/B,YAAY,CAAC,EAAE,SAAS,CAAC;KAC1B,CAAC;IACF,OAAO,EAAE;QACP,SAAS,EAAE,SAAS,CAAC;QACrB,eAAe,EAAE,SAAS,CAAC;QAC3B,iBAAiB,EAAE,SAAS,CAAC;QAC7B,kBAAkB,CAAC,EAAE,SAAS,CAAC;QAC/B,YAAY,CAAC,EAAE,SAAS,CAAC;KAC1B,CAAC;CACH,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,WAAW,EAAE,iBAAiB,CAwJ1D,CAAC"}
@@ -1,3 +0,0 @@
1
- export * from "./CardStyle";
2
- export * from "./CardVariantStyle";
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/styles/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC"}
package/eslint.config.mjs DELETED
@@ -1,13 +0,0 @@
1
- import eslint from "@eslint/js";
2
- import tseslint from "typescript-eslint";
3
- import { fileURLToPath } from "url";
4
- import { dirname } from "path";
5
-
6
- export default tseslint.config(eslint.configs.recommended, tseslint.configs.recommended, {
7
- languageOptions: {
8
- parserOptions: {
9
- project: true,
10
- tsconfigRootDir: dirname(fileURLToPath(import.meta.url)),
11
- },
12
- },
13
- });
package/rollup.config.js DELETED
@@ -1,32 +0,0 @@
1
- import resolve from "@rollup/plugin-node-resolve";
2
- import terser from "@rollup/plugin-terser";
3
- import typescript from "@rollup/plugin-typescript";
4
-
5
- const banner = `/**
6
- * @license MIT
7
- * Copyright (c) 2025 matraic
8
- * See LICENSE file in the project root for full license text.
9
- */`;
10
-
11
- export default [
12
- {
13
- input: "src/index.ts",
14
- output: [
15
- {
16
- file: "dist/index.js",
17
- format: "esm",
18
- sourcemap: true,
19
- banner: banner,
20
- },
21
- {
22
- file: "dist/index.min.js",
23
- format: "esm",
24
- sourcemap: true,
25
- banner: banner,
26
- plugins: [terser({ mangle: true })],
27
- },
28
- ],
29
- external: ["@m3e/core", "lit"],
30
- plugins: [resolve(), typescript()],
31
- },
32
- ];
@@ -1,258 +0,0 @@
1
- import { CSSResultGroup, html, LitElement, PropertyValues } from "lit";
2
- import { customElement, property, query } from "lit/decorators.js";
3
-
4
- import {
5
- renderPseudoLink,
6
- AttachInternals,
7
- Disabled,
8
- DisabledInteractive,
9
- Focusable,
10
- FormSubmitter,
11
- LinkButton,
12
- M3eElevationElement,
13
- M3eFocusRingElement,
14
- M3eRippleElement,
15
- M3eStateLayerElement,
16
- PressedController,
17
- Role,
18
- KeyboardClick,
19
- } from "@m3e/core";
20
-
21
- import { CardVariant } from "./CardVariant";
22
-
23
- import { CardStyle, CardVariantStyle } from "./styles";
24
- import { CardOrientation } from "./CardOrientation";
25
-
26
- /**
27
- * @summary
28
- * A content container for text, images (or other media), and actions in the context of a single subject.
29
- *
30
- * @description
31
- * The `m3e-card` component is a flexible, expressive container for presenting a unified subject—text,
32
- * media, and actions—on a visually distinct surface. It supports multiple appearance variants via the
33
- * `variant` attribute: `filled` (default, for solid emphasis), `outlined` (for subtle framing with a border),
34
- * and `elevated` (for depth and motion with shadow elevation).
35
- *
36
- * Cards can be made actionable, responding to user interaction when the `actionable` attribute is set, and can be
37
- * presented inline with surrounding content using the `inline` attribute.
38
- *
39
- * It supports both vertical and horizontal layouts through the `orientation` attribute. Content organization is
40
- * enabled via dedicated slots for `header`, `content`, `actions`, and `footer`, or developers can use the default
41
- * slot for custom layouts.
42
- *
43
- * The component provides dynamic elevation, adaptive shape, and expressive color theming, and responds to interaction states
44
- * (hover, focus, press, disabled) with smooth motion and visual feedback, ensuring clarity, accessibility,
45
- * and a cohesive user experience in accordance with Material Design 3 guidelines.
46
- *
47
- * @example
48
- * The following example illustrates each of the dedicated slots of a card.
49
- * ```html
50
- * <m3e-card>
51
- * <div slot="header">Header section</div>
52
- * <div slot="content">Content section</div>
53
- * <div slot="actions">Actions section</div>
54
- * <div slot="footer">Footer section</div>
55
- * </m3e-card>
56
- * ```
57
- *
58
- * @tag m3e-card
59
- *
60
- * @slot - Renders the content of the card without padding.
61
- * @slot header - Renders the header of the card.
62
- * @slot content - Renders the content of the card with padding.
63
- * @slot actions - Renders the actions of the card.
64
- * @slot footer - Renders the footer of the card.
65
- *
66
- * @attr actionable - Whether the card is "actionable" and will respond to use interaction.
67
- * @attr inline - Whether to present the card inline with surrounding content.
68
- * @attr orientation - The orientation of the card.
69
- * @attr variant - The appearance variant of the card.
70
- *
71
- * @cssprop --m3e-card-padding - Internal spacing for all slotted regions
72
- * @cssprop --m3e-card-shape - Corner radius of the card container.
73
- * @cssprop --m3e-filled-card-text-color - Foreground color for text content in filled cards.
74
- * @cssprop --m3e-filled-card-container-color - Background color of the filled card container.
75
- * @cssprop --m3e-filled-card-container-elevation - Elevation level for filled card container.
76
- * @cssprop --m3e-filled-card-disabled-text-color - Text color when filled card is disabled.
77
- * @cssprop --m3e-filled-card-disabled-text-opacity - Opacity applied to text when disabled.
78
- * @cssprop --m3e-filled-card-disabled-container-color - Background color when disabled.
79
- * @cssprop --m3e-filled-card-disabled-container-elevation - Elevation level when disabled.
80
- * @cssprop --m3e-filled-card-disabled-container-elevation-color - Shadow color when disabled.
81
- * @cssprop --m3e-filled-card-disabled-container-elevation-opacity - Shadow opacity when disabled.
82
- * @cssprop --m3e-filled-card-disabled-container-opacity - Overall container opacity when disabled.
83
- * @cssprop --m3e-filled-card-hover-text-color - Text color on hover.
84
- * @cssprop --m3e-filled-card-hover-state-layer-color - State layer color on hover.
85
- * @cssprop --m3e-filled-card-hover-state-layer-opacity - State layer opacity on hover.
86
- * @cssprop --m3e-filled-card-hover-container-elevation - Elevation level on hover.
87
- * @cssprop --m3e-filled-card-focus-text-color - Text color on focus.
88
- * @cssprop --m3e-filled-card-focus-state-layer-color - State layer color on focus.
89
- * @cssprop --m3e-filled-card-focus-state-layer-opacity - State layer opacity on focus.
90
- * @cssprop --m3e-filled-card-focus-container-elevation - Elevation level on focus.
91
- * @cssprop --m3e-filled-card-pressed-text-color - Text color on press.
92
- * @cssprop --m3e-filled-card-pressed-state-layer-color - State layer color on press.
93
- * @cssprop --m3e-filled-card-pressed-state-layer-opacity - State layer opacity on press.
94
- * @cssprop --m3e-filled-card-pressed-container-elevation - Elevation level on press.
95
- * @cssprop --m3e-elevated-card-text-color - Foreground color for text content in elevated cards.
96
- * @cssprop --m3e-elevated-card-container-color - Background color of the elevated card container.
97
- * @cssprop --m3e-elevated-card-container-elevation - Elevation level for elevated card container.
98
- * @cssprop --m3e-elevated-card-disabled-text-color - Text color when elevated card is disabled.
99
- * @cssprop --m3e-elevated-card-disabled-text-opacity - Opacity applied to text when disabled.
100
- * @cssprop --m3e-elevated-card-disabled-container-color - Background color when disabled.
101
- * @cssprop --m3e-elevated-card-disabled-container-elevation - Elevation level when disabled.
102
- * @cssprop --m3e-elevated-card-disabled-container-elevation-color - Shadow color when disabled.
103
- * @cssprop --m3e-elevated-card-disabled-container-elevation-opacity - Shadow opacity when disabled.
104
- * @cssprop --m3e-elevated-card-disabled-container-opacity - Overall container opacity when disabled.
105
- * @cssprop --m3e-elevated-card-hover-text-color - Text color on hover.
106
- * @cssprop --m3e-elevated-card-hover-state-layer-color - State layer color on hover.
107
- * @cssprop --m3e-elevated-card-hover-state-layer-opacity - State layer opacity on hover.
108
- * @cssprop --m3e-elevated-card-hover-container-elevation - Elevation level on hover.
109
- * @cssprop --m3e-elevated-card-focus-text-color - Text color on focus.
110
- * @cssprop --m3e-elevated-card-focus-state-layer-color - State layer color on focus.
111
- * @cssprop --m3e-elevated-card-focus-state-layer-opacity - State layer opacity on focus.
112
- * @cssprop --m3e-elevated-card-focus-container-elevation - Elevation level on focus.
113
- * @cssprop --m3e-elevated-card-pressed-text-color - Text color on press.
114
- * @cssprop --m3e-elevated-card-pressed-state-layer-color - State layer color on press.
115
- * @cssprop --m3e-elevated-card-pressed-state-layer-opacity - State layer opacity on press.
116
- * @cssprop --m3e-elevated-card-pressed-container-elevation - Elevation level on press.
117
- * @cssprop --m3e-outlined-card-text-color - Foreground color for text content in outlined cards.
118
- * @cssprop --m3e-outlined-card-container-elevation - Elevation level for outlined card container.
119
- * @cssprop --m3e-outlined-card-outline-color - Border color for outlined cards.
120
- * @cssprop --m3e-outlined-card-outline-thickness - Border thickness for outlined cards.
121
- * @cssprop --m3e-outlined-card-disabled-text-color - Text color when outlined card is disabled.
122
- * @cssprop --m3e-outlined-card-disabled-text-opacity - Opacity applied to text when disabled.
123
- * @cssprop --m3e-outlined-card-disabled-container-elevation - Elevation level when disabled.
124
- * @cssprop --m3e-outlined-card-disabled-container-elevation-color - Shadow color when disabled.
125
- * @cssprop --m3e-outlined-card-disabled-container-elevation-opacity - Shadow opacity when disabled.
126
- * @cssprop --m3e-outlined-card-disabled-outline-color - Border color when disabled.
127
- * @cssprop --m3e-outlined-card-disabled-outline-opacity - Border opacity when disabled.
128
- * @cssprop --m3e-outlined-card-hover-text-color - Text color on hover.
129
- * @cssprop --m3e-outlined-card-hover-state-layer-color - State layer color on hover.
130
- * @cssprop --m3e-outlined-card-hover-state-layer-opacity - State layer opacity on hover.
131
- * @cssprop --m3e-outlined-card-hover-container-elevation - Elevation level on hover.
132
- * @cssprop --m3e-outlined-card-hover-outline-color - Border color on hover.
133
- * @cssprop --m3e-outlined-card-focus-text-color - Text color on focus.
134
- * @cssprop --m3e-outlined-card-focus-state-layer-color - State layer color on focus.
135
- * @cssprop --m3e-outlined-card-focus-state-layer-opacity - State layer opacity on focus.
136
- * @cssprop --m3e-outlined-card-focus-container-elevation - Elevation level on focus.
137
- * @cssprop --m3e-outlined-card-focus-outline-color - Border color on focus.
138
- * @cssprop --m3e-outlined-card-pressed-text-color - Text color on press.
139
- * @cssprop --m3e-outlined-card-pressed-state-layer-color - State layer color on press.
140
- * @cssprop --m3e-outlined-card-pressed-state-layer-opacity - State layer opacity on press.
141
- * @cssprop --m3e-outlined-card-pressed-container-elevation - Elevation level on press.
142
- * @cssprop --m3e-outlined-card-pressed-outline-color - Border color on press.
143
- */
144
- @customElement("m3e-card")
145
- export class M3eCardElement extends KeyboardClick(
146
- LinkButton(FormSubmitter(Focusable(DisabledInteractive(Disabled(AttachInternals(Role(LitElement, "none"), true))))))
147
- ) {
148
- /** The styles of the element. */
149
- static override styles: CSSResultGroup = [CardVariantStyle, CardStyle];
150
-
151
- /** @private */ @query(".base") private readonly _base?: HTMLElement;
152
- /** @private */ @query(".elevation") private readonly _elevation?: M3eElevationElement;
153
- /** @private */ @query(".focus-ring") private readonly _focusRing?: M3eFocusRingElement;
154
- /** @private */ @query(".state-layer") private readonly _stateLayer?: M3eStateLayerElement;
155
- /** @private */ @query(".ripple") private readonly _ripple?: M3eRippleElement;
156
-
157
- /** @private */ readonly #clickHandler = (e: Event) => this.#handleClick(e);
158
-
159
- constructor() {
160
- super();
161
-
162
- new PressedController(this, {
163
- isPressedKey: (key) => key === " " || key === "Enter",
164
- callback: (pressed) => {
165
- if (this.actionable && !this.disabled && !this.disabledInteractive) {
166
- this._base?.classList.toggle("pressed", pressed);
167
- }
168
- },
169
- });
170
- }
171
-
172
- /**
173
- * Whether to present the card inline with surrounding content.
174
- * @default false
175
- */
176
- @property({ type: Boolean }) inline = false;
177
-
178
- /**
179
- * Whether the card is "actionable" and will respond to use interaction.
180
- * @default false
181
- */
182
- @property({ type: Boolean }) actionable = false;
183
-
184
- /**
185
- * The appearance variant of the card.
186
- * @default "filled"
187
- */
188
- @property({ reflect: true }) variant: CardVariant = "filled";
189
-
190
- /**
191
- * The orientation of the card.
192
- * @default "vertical"
193
- */
194
- @property({ reflect: true }) orientation: CardOrientation = "vertical";
195
-
196
- /** @inheritdoc */
197
- override connectedCallback(): void {
198
- if (this.hasAttribute("actionable")) {
199
- // If href is specified, the LinkButton mixin changes this to "link" if role is "button".
200
- this.role = "button";
201
- }
202
-
203
- super.connectedCallback();
204
- this.addEventListener("click", this.#clickHandler);
205
- }
206
-
207
- /** @inheritdoc */
208
- override disconnectedCallback(): void {
209
- super.disconnectedCallback();
210
-
211
- this._base?.classList.toggle("pressed", false);
212
- this.removeEventListener("click", this.#clickHandler);
213
- }
214
-
215
- /** @inheritdoc */
216
- protected override render(): unknown {
217
- return html`<div class="base">
218
- <m3e-elevation
219
- class="elevation"
220
- ?disabled="${!this.actionable || this.disabled || this.disabledInteractive}"
221
- ></m3e-elevation>
222
- <m3e-focus-ring class="focus-ring" ?disabled="${!this.actionable || this.disabled}"></m3e-focus-ring>
223
- <m3e-state-layer
224
- class="state-layer"
225
- ?disabled="${!this.actionable || this.disabled || this.disabledInteractive}"
226
- ></m3e-state-layer>
227
- <m3e-ripple
228
- class="ripple"
229
- ?disabled="${!this.actionable || this.disabled || this.disabledInteractive}"
230
- ></m3e-ripple>
231
- ${this[renderPseudoLink]()}
232
- <slot name="header"></slot>
233
- <slot name="content"><slot></slot></slot>
234
- <slot name="actions"></slot>
235
- <slot name="footer"></slot>
236
- </div>`;
237
- }
238
-
239
- /** @inheritdoc */
240
- protected override firstUpdated(_changedProperties: PropertyValues<this>): void {
241
- super.firstUpdated(_changedProperties);
242
- [this._elevation, this._focusRing, this._stateLayer, this._ripple].forEach((x) => x?.attach(this));
243
- }
244
-
245
- /** @private */
246
- #handleClick(e: Event): void {
247
- if (this.disabled || this.disabledInteractive) {
248
- e.preventDefault();
249
- e.stopImmediatePropagation();
250
- }
251
- }
252
- }
253
-
254
- declare global {
255
- interface HTMLElementTagNameMap {
256
- "m3e-card": M3eCardElement;
257
- }
258
- }
@@ -1,2 +0,0 @@
1
- /** Specifies the possible orientations of a card. */
2
- export type CardOrientation = "horizontal" | "vertical";
@@ -1,2 +0,0 @@
1
- /** Specifies the possible appearance variants of a card. */
2
- export type CardVariant = "elevated" | "filled" | "outlined";
package/src/index.ts DELETED
@@ -1,3 +0,0 @@
1
- export * from "./CardElement";
2
- export * from "./CardOrientation";
3
- export * from "./CardVariant";