@m3e/drawer-container 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,178 +0,0 @@
1
- import { css, CSSResultGroup, unsafeCSS } from "lit";
2
-
3
- import { DesignToken } from "@m3e/core";
4
-
5
- import { DrawerContainerToken } from "./DrawerContainerToken";
6
-
7
- /**
8
- * Styles for `M3eDrawerContainerElement`.
9
- * @internal
10
- */
11
- export const DrawerContainerStyle: CSSResultGroup = css`
12
- :host {
13
- display: flex;
14
- flex-direction: row;
15
- position: relative;
16
- overflow: hidden;
17
- flex: 1 1 auto;
18
- }
19
- .content {
20
- height: 100%;
21
- }
22
- ::slotted([slot="start"]),
23
- ::slotted([slot="end"]) {
24
- display: block;
25
- height: 100%;
26
- z-index: 3;
27
- outline: none;
28
- box-sizing: border-box;
29
- flex: none;
30
- width: ${DrawerContainerToken.containerWidth};
31
- background-color: ${DrawerContainerToken.containerColor};
32
- box-shadow: ${DrawerContainerToken.containerElevation};
33
- transition: ${unsafeCSS(
34
- `margin ${DesignToken.motion.duration.medium4} ${DesignToken.motion.easing.standard},
35
- visibility ${DesignToken.motion.duration.medium4} ${DesignToken.motion.easing.standard} allow-discrete,
36
- background-color ${DesignToken.motion.duration.medium4} ${DesignToken.motion.easing.standard},
37
- box-shadow ${DesignToken.motion.duration.medium4} ${DesignToken.motion.easing.standard}`
38
- )};
39
- }
40
- :host(.-start-over) ::slotted([slot="start"]) {
41
- position: absolute;
42
- top: 0;
43
- left: 0;
44
- }
45
- :host(.-end-over) ::slotted([slot="end"]) {
46
- position: absolute;
47
- top: 0;
48
- right: 0;
49
- }
50
- :host(:not([start])) ::slotted([slot="start"]) {
51
- visibility: hidden;
52
- margin-inline-start: calc(0px - ${DrawerContainerToken.containerWidth});
53
- }
54
- :host([start]) ::slotted([slot="start"]) {
55
- visibility: visible;
56
- margin-inline-start: 0;
57
- }
58
- :host(:not([end])) ::slotted([slot="end"]) {
59
- visibility: hidden;
60
- margin-inline-end: calc(0px - ${DrawerContainerToken.containerWidth});
61
- }
62
- :host([end]) ::slotted([slot="end"]) {
63
- margin-inline-end: 0;
64
- visibility: visible;
65
- }
66
- .content {
67
- flex: 1 1 auto;
68
- position: relative;
69
- height: 100%;
70
- }
71
- .scrim {
72
- display: block;
73
- position: absolute;
74
- left: 0;
75
- right: 0;
76
- top: 0;
77
- bottom: 0;
78
- z-index: 1;
79
- background-color: ${DesignToken.color.scrim};
80
- opacity: 0;
81
- visibility: hidden;
82
- transition: ${unsafeCSS(
83
- `opacity ${DesignToken.motion.duration.medium4} ${DesignToken.motion.easing.standard},
84
- visibility ${DesignToken.motion.duration.medium4} ${DesignToken.motion.easing.standard} allow-discrete`
85
- )};
86
- }
87
- @starting-style {
88
- .scrim {
89
- opacity: 0;
90
- }
91
- }
92
- :host(.-start-push[start]) .scrim,
93
- :host(.-end-push[end]) .scrim,
94
- :host(.-start-over[start]) .scrim,
95
- :host(.-end-over[end]) .scrim {
96
- visibility: visible;
97
- opacity: ${DrawerContainerToken.scrimOpacity};
98
- }
99
- :host(.-start-push) ::slotted([slot="start"]),
100
- :host(.-start-over) ::slotted([slot="start"]) {
101
- border-start-end-radius: ${DrawerContainerToken.cornerShape};
102
- border-end-end-radius: ${DrawerContainerToken.cornerShape};
103
- }
104
- :host(.-end-push) ::slotted([slot="end"]),
105
- :host(.-end-over) ::slotted([slot="end"]) {
106
- border-start-start-radius: ${DrawerContainerToken.cornerShape};
107
- border-end-start-radius: ${DrawerContainerToken.cornerShape};
108
- }
109
- :host(.-start-push) ::slotted([slot="start"]),
110
- :host(.-end-push) ::slotted([slot="end"]),
111
- :host(.-start-over) ::slotted([slot="start"]),
112
- :host(.-end-over) ::slotted([slot="end"]) {
113
- background-color: ${DrawerContainerToken.modalContainerColor};
114
- box-shadow: ${DrawerContainerToken.modalContainerElevation};
115
- }
116
- :host([start-divider]) ::slotted([slot="start"]) {
117
- border-inline-end-color: transparent;
118
- border-inline-end-width: ${DrawerContainerToken.dividerThickness};
119
- border-inline-end-style: solid;
120
- box-sizing: border-box;
121
- }
122
- :host([start-divider].-start-side[start]:not(.-end-push[end]):not(.-end-over[end])) ::slotted([slot="start"]) {
123
- border-inline-end-color: ${DrawerContainerToken.dividerColor};
124
- }
125
- :host([end-divider]) ::slotted([slot="end"]) {
126
- border-inline-start-color: transparent;
127
- border-inline-start-width: ${DrawerContainerToken.dividerThickness};
128
- border-inline-start-style: solid;
129
- box-sizing: border-box;
130
- }
131
- :host([end-divider].-end-side[end]:not(.-start-push[start]):not(.-start-over[start])) ::slotted([slot="end"]) {
132
- border-inline-start-color: ${DrawerContainerToken.dividerColor};
133
- }
134
- @media (forced-colors: active) {
135
- ::slotted([slot="start"]),
136
- ::slotted([slot="end"]) {
137
- background-color: Canvas;
138
- box-shadow: unset;
139
- transition: ${unsafeCSS(
140
- `margin ${DesignToken.motion.duration.medium4} ${DesignToken.motion.easing.standard},
141
- visibility ${DesignToken.motion.duration.medium4} ${DesignToken.motion.easing.standard} allow-discrete`
142
- )};
143
- }
144
- :host(.-start-push) ::slotted([slot="start"]),
145
- :host(.-end-push) ::slotted([slot="end"]),
146
- :host(.-start-over) ::slotted([slot="start"]),
147
- :host(.-end-over) ::slotted([slot="end"]) {
148
- background-color: Canvas;
149
- box-shadow: unset;
150
- border-color: CanvasText;
151
- }
152
- ::slotted([slot="start"]),
153
- ::slotted([slot="end"]) {
154
- border-style: solid;
155
- border-color: Canvas;
156
- border-width: 1px;
157
- }
158
- ::slotted([slot="start"]) {
159
- border-inline-start-style: none;
160
- }
161
- ::slotted([slot="end"]) {
162
- border-inline-end-style: none;
163
- }
164
- :host([start-divider].-start-side[start]:not(.-end-push[end]):not(.-end-over[end])) ::slotted([slot="start"]) {
165
- border-inline-end-color: GrayText;
166
- }
167
- :host([end-divider].-end-side[end]:not(.-start-push[start]):not(.-start-over[start])) ::slotted([slot="end"]) {
168
- border-inline-start-color: GrayText;
169
- }
170
- }
171
- @media (prefers-reduced-motion) {
172
- ::slotted([slot="start"]),
173
- ::slotted([slot="end"]),
174
- .scrim {
175
- transition: none;
176
- }
177
- }
178
- `;
@@ -1,19 +0,0 @@
1
- import { unsafeCSS } from "lit";
2
-
3
- import { DesignToken } from "@m3e/core";
4
-
5
- /**
6
- * Component design tokens that control `M3eDrawerContainerElement`.
7
- * @internal
8
- */
9
- export const DrawerContainerToken = {
10
- containerColor: unsafeCSS(`var(--m3e-drawer-container-color, ${DesignToken.color.surface})`),
11
- containerElevation: unsafeCSS(`var(--m3e-drawer-container-elevation, ${DesignToken.elevation.level0})`),
12
- containerWidth: unsafeCSS(`var(--m3e-drawer-container-width, 22.5rem)`),
13
- scrimOpacity: unsafeCSS("var(--m3e-drawer-container-scrim-opacity, 32%)"),
14
- cornerShape: unsafeCSS(`var(--m3e-modal-drawer-corner-shape, ${DesignToken.shape.corner.large})`),
15
- modalContainerColor: unsafeCSS(`var(--m3e-modal-drawer-container-color, ${DesignToken.color.surfaceContainerLow})`),
16
- modalContainerElevation: unsafeCSS(`var(--m3e-modal-drawer-elevation, ${DesignToken.elevation.level1})`),
17
- dividerColor: unsafeCSS(`var(--m3e-drawer-divider-color, ${DesignToken.color.outline})`),
18
- dividerThickness: unsafeCSS("var(--m3e-drawer-divider-thickness, 1px)"),
19
- } as const;
@@ -1 +0,0 @@
1
- export * from "./DrawerContainerStyle";
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
- }