@m3e/expansion-panel 1.0.0-rc.1 → 1.0.0-rc.3

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.
@@ -1,85 +0,0 @@
1
- import { css, unsafeCSS } from "lit";
2
-
3
- import { DesignToken } from "@m3e/core";
4
-
5
- import { ExpansionHeaderToken } from "./ExpansionHeaderToken";
6
-
7
- /**
8
- * Styles for `M3eExpansionHeaderElement`.
9
- * @internal
10
- */
11
- export const ExpansionHeaderStyle = css`
12
- :host {
13
- display: flex;
14
- border-radius: inherit;
15
- outline: none;
16
- position: relative;
17
- height: ${ExpansionHeaderToken.collapsedHeight};
18
- padding-inline-start: ${ExpansionHeaderToken.paddingLeft};
19
- padding-inline-end: ${ExpansionHeaderToken.paddingRight};
20
- font-size: ${ExpansionHeaderToken.fontSize};
21
- font-weight: ${ExpansionHeaderToken.fontWeight};
22
- line-height: ${ExpansionHeaderToken.lineHeight};
23
- letter-spacing: ${ExpansionHeaderToken.tracking};
24
- transition: ${unsafeCSS(`height var(--m3e-collapsible-animation-duration, ${DesignToken.motion.duration.medium1})
25
- ${DesignToken.motion.easing.standard}`)};
26
-
27
- column-gap: ${ExpansionHeaderToken.spacing};
28
- }
29
- :host(:not(:disabled)) {
30
- cursor: pointer;
31
- }
32
- :host([aria-expanded="true"]) {
33
- height: ${ExpansionHeaderToken.expandedHeight};
34
- }
35
- :host(:not(:focus-visible)) .state-layer {
36
- --m3e-state-layer-focus-color: transparent;
37
- }
38
- :host([aria-expanded="true"]) .state-layer {
39
- --m3e-state-layer-hover-color: transparent;
40
- }
41
- :host([aria-expanded="true"]) [part="background"],
42
- .content {
43
- flex: 1 1 auto;
44
- display: flex;
45
- align-items: center;
46
- }
47
- .toggle {
48
- display: flex;
49
- align-items: center;
50
- justify-content: center;
51
- vertical-align: middle;
52
- font-size: ${ExpansionHeaderToken.toggleIconSize};
53
- transition: ${unsafeCSS(`transform var(--m3e-collapsible-animation-duration, ${DesignToken.motion.duration.medium1})
54
- ${DesignToken.motion.easing.standard}`)};
55
- }
56
- :host([toggle-direction="vertical"][aria-expanded="true"]) .toggle {
57
- transform: rotate(180deg);
58
- }
59
- :host([toggle-direction="horizontal"][aria-expanded="true"]) .toggle {
60
- transform: rotate(90deg);
61
- }
62
- :host([toggle-position="before"]) .toggle {
63
- margin-inline-start: calc(0px - ${ExpansionHeaderToken.spacing});
64
- }
65
- :host([toggle-position="after"]) .toggle {
66
- margin-inline-end: calc(0px - ${ExpansionHeaderToken.spacing});
67
- }
68
- :host([hide-toggle]) .toggle {
69
- display: none;
70
- }
71
- ::slotted([slot="toggle-icon"]) {
72
- font-size: inherit !important;
73
- flex: none;
74
- }
75
- ::slotted(svg[slot="toggle-icon"]) {
76
- width: 1em;
77
- height: 1em;
78
- }
79
- @media (prefers-reduced-motion) {
80
- :host,
81
- .toggle {
82
- transition: none;
83
- }
84
- }
85
- `;
@@ -1,24 +0,0 @@
1
- import { unsafeCSS } from "lit";
2
-
3
- import { DesignToken } from "@m3e/core";
4
-
5
- /**
6
- * Component design tokens for `M3eExpansionHeaderElement`.
7
- * @internal
8
- */
9
- export const ExpansionHeaderToken = {
10
- collapsedHeight: unsafeCSS("var(--m3e-expansion-header-collapsed-height, 3rem)"),
11
- expandedHeight: unsafeCSS("var(--m3e-expansion-header-expanded-height, 4rem)"),
12
- paddingLeft: unsafeCSS("var(--m3e-expansion-header-padding-left, 1.5rem)"),
13
- paddingRight: unsafeCSS("var(--m3e-expansion-header-padding-right, 1.5rem)"),
14
- spacing: unsafeCSS("var(--m3e-expansion-header-spacing, 0.5rem)"),
15
- toggleIconSize: unsafeCSS("var(--m3e-expansion-header-toggle-icon-size, 1.5rem)"),
16
- fontSize: unsafeCSS(`var(--m3e-expansion-header-font-size, ${DesignToken.typescale.standard.title.medium.fontSize})`),
17
- fontWeight: unsafeCSS(
18
- `var(--m3e-expansion-header-font-weight, ${DesignToken.typescale.standard.title.medium.fontWeight})`
19
- ),
20
- lineHeight: unsafeCSS(
21
- `var(--m3e-expansion-header-line-height, ${DesignToken.typescale.standard.title.medium.lineHeight})`
22
- ),
23
- tracking: unsafeCSS(`var(--m3e-expansion-header-tracking, ${DesignToken.typescale.standard.title.medium.tracking})`),
24
- } as const;
@@ -1,85 +0,0 @@
1
- import { css, unsafeCSS } from "lit";
2
-
3
- import { DesignToken } from "@m3e/core";
4
-
5
- import { ExpansionPanelToken } from "./ExpansionPanelToken";
6
- import { ExpansionHeaderToken } from "./ExpansionHeaderToken";
7
-
8
- /**
9
- * Styles for `M3eExpansionPanelElement`.
10
- * @internal
11
- */
12
- export const ExpansionPanelStyle = css`
13
- :host {
14
- display: block;
15
- background-color: ${ExpansionPanelToken.containerColor};
16
- transition: ${unsafeCSS(`box-shadow var(--m3e-collapsible-animation-duration, ${DesignToken.motion.duration.medium1})
17
- ${DesignToken.motion.easing.standard}`)};
18
- }
19
- :host(:not(:disabled)) {
20
- color: ${ExpansionPanelToken.textColor};
21
- }
22
- :host(:disabled) {
23
- color: color-mix(
24
- in srgb,
25
- ${ExpansionPanelToken.disabledTextColor} ${ExpansionPanelToken.disabledTextOpacity},
26
- transparent
27
- );
28
- }
29
- :host(:not([open])) {
30
- box-shadow: ${ExpansionPanelToken.collapsedElevation};
31
- border-radius: ${ExpansionPanelToken.collapsedShape};
32
- }
33
- :host([open]) {
34
- box-shadow: ${ExpansionPanelToken.expandedElevation};
35
- border-radius: ${ExpansionPanelToken.expandedShape};
36
- margin-block: ${ExpansionPanelToken.expandedSpace};
37
- }
38
- .toggle {
39
- display: flex;
40
- align-items: center;
41
- justify-content: center;
42
- font-size: ${ExpansionHeaderToken.toggleIconSize};
43
- }
44
- ::slotted([slot="toggle-icon"]) {
45
- font-size: inherit !important;
46
- flex: none;
47
- }
48
- .toggle svg,
49
- ::slotted(svg[slot="toggle-icon"]) {
50
- width: 1em;
51
- height: 1em;
52
- }
53
- .content {
54
- padding: ${ExpansionPanelToken.contentPadding};
55
- }
56
- ::slotted([slot="actions"]) {
57
- flex: none;
58
- display: flex;
59
- align-items: center;
60
- column-gap: ${ExpansionPanelToken.actionsSpacing};
61
- padding: ${ExpansionPanelToken.actionsPadding};
62
- border-top-style: solid;
63
- border-top-width: ${ExpansionPanelToken.actionsDividerThickness};
64
- border-top-color: ${ExpansionPanelToken.actionsDividerColor};
65
- }
66
- ::slotted([slot="actions"][end]) {
67
- justify-content: flex-end;
68
- }
69
- @media (prefers-reduced-motion) {
70
- :host {
71
- transition: none;
72
- }
73
- }
74
- @media (forced-colors: active) {
75
- :host {
76
- border: 1px solid CanvasText;
77
- }
78
- :host(:disabled) {
79
- color: GrayText;
80
- }
81
- ::slotted([slot="actions"]) {
82
- border-top-color: GrayText;
83
- }
84
- }
85
- `;
@@ -1,28 +0,0 @@
1
- import { unsafeCSS } from "lit";
2
-
3
- import { DesignToken } from "@m3e/core";
4
-
5
- /**
6
- * Component design tokens for `M3eExpansionPanelElement`.
7
- * @internal
8
- */
9
- export const ExpansionPanelToken = {
10
- textColor: unsafeCSS(`var(--m3e-expansion-panel-text-color, ${DesignToken.color.onSurface})`),
11
- disabledTextColor: unsafeCSS(`var(--m3e-expansion-panel-disabled-text-color, ${DesignToken.color.onSurface})`),
12
- disabledTextOpacity: unsafeCSS(`var(--m3e-expansion-panel-disabled-text-opacity, 38%)`),
13
- containerColor: unsafeCSS("var(--m3e-expansion-panel-container-color)"),
14
- collapsedElevation: unsafeCSS("var(--m3e-expansion-panel-elevation)"),
15
- collapsedShape: unsafeCSS("var(--m3e-expansion-panel-shape)"),
16
- expandedElevation: unsafeCSS("var(--m3e-expansion-panel-open-elevation, var(--m3e-expansion-panel-elevation))"),
17
- expandedShape: unsafeCSS("var(--m3e-expansion-panel-open-shape, var(--m3e-expansion-panel-shape))"),
18
- expandedSpace: unsafeCSS("var(--_expansion-panel-open-spacing)"),
19
- contentPadding: unsafeCSS("var(--m3e-expansion-panel-content-padding, 0 1.5rem 1rem 1.5rem)"),
20
- actionsSpacing: unsafeCSS("var(--m3e-expansion-panel-actions-spacing, 0.5rem)"),
21
- actionsPadding: unsafeCSS("var(--m3e-expansion-panel-actions-padding, 1rem 1.5rem 1rem 1.5rem)"),
22
- actionsDividerThickness: unsafeCSS(
23
- "var(--m3e-expansion-panel-actions-divider-thickness, var(--m3e-divider-thickness, 1px))"
24
- ),
25
- actionsDividerColor: unsafeCSS(
26
- `var(--m3e-expansion-panel-actions-divider-color, var(--m3e-divider-color, ${DesignToken.color.outlineVariant}))`
27
- ),
28
- } as const;
@@ -1,2 +0,0 @@
1
- export * from "./ExpansionHeaderStyle";
2
- export * from "./ExpansionPanelStyle";
package/tsconfig.json DELETED
@@ -1,9 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.json",
3
- "compilerOptions": {
4
- "rootDir": "./src",
5
- "outDir": "./dist/src"
6
- },
7
- "include": ["src/**/*.ts", "**/*.mjs", "**/*.js"],
8
- "exclude": []
9
- }