@m3e/drawer-container 1.0.0-rc.2 → 1.0.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/custom-elements.json +29 -35
- package/dist/index.js +34 -12
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +29 -29
- package/dist/index.min.js.map +1 -1
- package/dist/src/DrawerContainerElement.d.ts +102 -0
- package/dist/src/DrawerContainerElement.d.ts.map +1 -0
- package/dist/src/DrawerMode.d.ts +3 -0
- package/dist/src/DrawerMode.d.ts.map +1 -0
- package/dist/src/DrawerPosition.d.ts +3 -0
- package/dist/src/DrawerPosition.d.ts.map +1 -0
- package/dist/src/DrawerToggleElement.d.ts +48 -0
- package/dist/src/DrawerToggleElement.d.ts.map +1 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/styles/DrawerContainerStyle.d.ts +7 -0
- package/dist/src/styles/DrawerContainerStyle.d.ts.map +1 -0
- package/dist/src/styles/DrawerContainerToken.d.ts +16 -0
- package/dist/src/styles/DrawerContainerToken.d.ts.map +1 -0
- package/dist/src/styles/index.d.ts +2 -0
- package/dist/src/styles/index.d.ts.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { CSSResultGroup, LitElement, PropertyValues } from "lit";
|
|
2
|
+
import { DrawerMode } from "./DrawerMode";
|
|
3
|
+
/**
|
|
4
|
+
* A container for one or two sliding drawers.
|
|
5
|
+
*
|
|
6
|
+
* @description
|
|
7
|
+
* A responsive layout container that manages left and right drawers alongside main content.
|
|
8
|
+
* Supports `over`, `push`, `side`, and `auto` modes, adapting drawer behavior based on breakpoint size.
|
|
9
|
+
* Encodes spatial hierarchy, motion transitions, and accessibility semantics for modal, dismissible,
|
|
10
|
+
* and permanent navigation.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* The following example illustrates a typical drawer layout.
|
|
14
|
+
* ```html
|
|
15
|
+
* <m3e-drawer-container>
|
|
16
|
+
* <nav slot="start">
|
|
17
|
+
* <!-- Start drawer content -->
|
|
18
|
+
* </nav>
|
|
19
|
+
* <main>
|
|
20
|
+
* <!-- Main content -->
|
|
21
|
+
* </main>
|
|
22
|
+
* <aside slot="end">
|
|
23
|
+
* <!-- End drawer content -->
|
|
24
|
+
* </aside>
|
|
25
|
+
* <m3e-drawer-container>
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @tag m3e-drawer-container
|
|
29
|
+
*
|
|
30
|
+
* @slot - Renders the main content.
|
|
31
|
+
* @slot start - Renders the start drawer.
|
|
32
|
+
* @slot end - Renders the end drawer.
|
|
33
|
+
*
|
|
34
|
+
* @attr end - Whether the end drawer is open.
|
|
35
|
+
* @attr end-mode - The behavior mode of the end drawer.
|
|
36
|
+
* @attr end-divider - Whether to show a divider between the end drawer and content for `side` mode.
|
|
37
|
+
* @attr start - Whether the start drawer is open.
|
|
38
|
+
* @attr start-mode - The behavior mode of the start drawer.
|
|
39
|
+
* @attr start-divider - Whether to show a divider between the start drawer and content for `side` mode.
|
|
40
|
+
*
|
|
41
|
+
* @fires change - Emitted when the state of the start or end drawers change.
|
|
42
|
+
*
|
|
43
|
+
* @cssprop --m3e-drawer-container-color - The background color of the drawer container.
|
|
44
|
+
* @cssprop --m3e-drawer-container-elevation - The elevation level of the drawer container.
|
|
45
|
+
* @cssprop --m3e-drawer-container-width - The width of the drawer container.
|
|
46
|
+
* @cssprop --m3e-drawer-container-scrim-opacity - The opacity of the scrim behind the drawer.
|
|
47
|
+
* @cssprop --m3e-modal-drawer-start-shape - The shape of the drawer’s start edge (typically left in LTR).
|
|
48
|
+
* @cssprop --m3e-modal-drawer-end-shape - The shape of the drawer’s end edge (typically right in LTR).
|
|
49
|
+
* @cssprop --m3e-modal-drawer-container-color - The background color of the modal drawer container.
|
|
50
|
+
* @cssprop --m3e-modal-drawer-elevation - The elevation level of the modal drawer container.
|
|
51
|
+
* @cssprop --m3e-drawer-divider-color - The color of the divider between drawer sections.
|
|
52
|
+
* @cssprop --m3e-drawer-divider-thickness - The thickness of the divider line.
|
|
53
|
+
*/
|
|
54
|
+
export declare class M3eDrawerContainerElement extends LitElement {
|
|
55
|
+
#private;
|
|
56
|
+
/** The styles of the element. */
|
|
57
|
+
static styles: CSSResultGroup;
|
|
58
|
+
/** @private */ private _startMode;
|
|
59
|
+
/** @private */ private _endMode;
|
|
60
|
+
/**
|
|
61
|
+
* Whether the start drawer is open.
|
|
62
|
+
* @default false
|
|
63
|
+
*/
|
|
64
|
+
start: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* The behavior mode of the start drawer.
|
|
67
|
+
* @default "side"
|
|
68
|
+
*/
|
|
69
|
+
startMode: DrawerMode;
|
|
70
|
+
/**
|
|
71
|
+
* Whether to show a divider between the start drawer and content for `side` mode.
|
|
72
|
+
* @default "side"
|
|
73
|
+
*/
|
|
74
|
+
startDivider: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Whether the end drawer is open.
|
|
77
|
+
* @default false
|
|
78
|
+
*/
|
|
79
|
+
end: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* The behavior mode of the end drawer.
|
|
82
|
+
* @default "side"
|
|
83
|
+
*/
|
|
84
|
+
endMode: DrawerMode;
|
|
85
|
+
/**
|
|
86
|
+
* Whether to show a divider between the end drawer and content for `side` mode.
|
|
87
|
+
* @default "side"
|
|
88
|
+
*/
|
|
89
|
+
endDivider: boolean;
|
|
90
|
+
/** @inheritdoc */
|
|
91
|
+
disconnectedCallback(): void;
|
|
92
|
+
/** @inheritdoc */
|
|
93
|
+
protected update(changedProperties: PropertyValues<this>): void;
|
|
94
|
+
/** @inheritdoc */
|
|
95
|
+
protected render(): unknown;
|
|
96
|
+
}
|
|
97
|
+
declare global {
|
|
98
|
+
interface HTMLElementTagNameMap {
|
|
99
|
+
"m3e-drawer-container": M3eDrawerContainerElement;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=DrawerContainerElement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DrawerContainerElement.d.ts","sourceRoot":"","sources":["../../src/DrawerContainerElement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAQ,UAAU,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAMvE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,qBACa,yBAA0B,SAAQ,UAAU;;IACvD,iCAAiC;IACjC,OAAgB,MAAM,EAAE,cAAc,CAAwB;IAE9D,eAAe,CAAU,OAAO,CAAC,UAAU,CAAuC;IAClF,eAAe,CAAU,OAAO,CAAC,QAAQ,CAAuC;IAKhF;;;OAGG;IACyC,KAAK,UAAS;IAE1D;;;OAGG;IACmD,SAAS,EAAE,UAAU,CAAU;IAErF;;;OAGG;IACqE,YAAY,UAAS;IAE7F;;;OAGG;IACyC,GAAG,UAAS;IAExD;;;OAGG;IACiD,OAAO,EAAE,UAAU,CAAU;IAEjF;;;OAGG;IACmE,UAAU,UAAS;IAEzF,kBAAkB;IACT,oBAAoB,IAAI,IAAI;IAOrC,kBAAkB;cACC,MAAM,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IAgBxE,kBAAkB;cACC,MAAM,IAAI,OAAO;CAmGrC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,sBAAsB,EAAE,yBAAyB,CAAC;KACnD;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DrawerMode.d.ts","sourceRoot":"","sources":["../../src/DrawerMode.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DrawerPosition.d.ts","sourceRoot":"","sources":["../../src/DrawerPosition.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,KAAK,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { CSSResultGroup, LitElement } from "lit";
|
|
2
|
+
declare const M3eDrawerToggleElement_base: import("node_modules/@m3e/core/dist/src/shared/mixins/Constructor").Constructor<import("@m3e/core").HtmlForMixin> & typeof LitElement;
|
|
3
|
+
/**
|
|
4
|
+
* An element, nested within a clickable element, used to toggle the opened state of a drawer.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* The following example illustrates the use of a `m3e-drawer-toggle`, nested inside a `m3e-icon-button` component,
|
|
8
|
+
* which toggles the open state of the start drawer.
|
|
9
|
+
*
|
|
10
|
+
* ```html
|
|
11
|
+
* <m3e-icon-button slot="leading-icon" aria-label="Menu" toggle selected>
|
|
12
|
+
* <m3e-drawer-toggle for="startDrawer"></m3e-drawer-toggle>
|
|
13
|
+
* <m3e-icon name="menu"></m3e-icon>
|
|
14
|
+
* <m3e-icon slot="selected" name="menu_open"></m3e-icon>
|
|
15
|
+
* </m3e-icon-button>
|
|
16
|
+
*
|
|
17
|
+
* <m3e-drawer-container start>
|
|
18
|
+
* <nav slot="start" id="startDrawer" aria-label="Navigation">
|
|
19
|
+
* <!-- Start drawer content -->
|
|
20
|
+
* </nav>
|
|
21
|
+
* <!-- Container content -->
|
|
22
|
+
* </m3e-drawer-container>
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @tag m3e-drawer-toggle
|
|
26
|
+
*/
|
|
27
|
+
export declare class M3eDrawerToggleElement extends M3eDrawerToggleElement_base {
|
|
28
|
+
#private;
|
|
29
|
+
/** The styles of the element. */
|
|
30
|
+
static styles: CSSResultGroup;
|
|
31
|
+
/** @inheritdoc */
|
|
32
|
+
connectedCallback(): void;
|
|
33
|
+
/** @inheritdoc */
|
|
34
|
+
disconnectedCallback(): void;
|
|
35
|
+
/** @inheritdoc */
|
|
36
|
+
attach(control: HTMLElement): void;
|
|
37
|
+
/** @inheritdoc */
|
|
38
|
+
detach(): void;
|
|
39
|
+
/** @inheritdoc */
|
|
40
|
+
protected render(): unknown;
|
|
41
|
+
}
|
|
42
|
+
declare global {
|
|
43
|
+
interface HTMLElementTagNameMap {
|
|
44
|
+
"m3e-drawer-toggle": M3eDrawerToggleElement;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export {};
|
|
48
|
+
//# sourceMappingURL=DrawerToggleElement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DrawerToggleElement.d.ts","sourceRoot":"","sources":["../../src/DrawerToggleElement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,cAAc,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;;AAQ5D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBACa,sBAAuB,SAAQ,2BAAmB;;IAC7D,iCAAiC;IACjC,OAAgB,MAAM,EAAE,cAAc,CAOpC;IAKF,kBAAkB;IACT,iBAAiB,IAAI,IAAI;IAKlC,kBAAkB;IACT,oBAAoB,IAAI,IAAI;IAKrC,kBAAkB;IACT,MAAM,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAc3C,kBAAkB;IACT,MAAM,IAAI,IAAI;IAcvB,kBAAkB;cACC,MAAM,IAAI,OAAO;CAsDrC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,mBAAmB,EAAE,sBAAsB,CAAC;KAC7C;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DrawerContainerStyle.d.ts","sourceRoot":"","sources":["../../../src/styles/DrawerContainerStyle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,cAAc,EAAa,MAAM,KAAK,CAAC;AAMrD;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,cAuKlC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Component design tokens that control `M3eDrawerContainerElement`.
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export declare const DrawerContainerToken: {
|
|
6
|
+
readonly containerColor: import("lit").CSSResult;
|
|
7
|
+
readonly containerElevation: import("lit").CSSResult;
|
|
8
|
+
readonly containerWidth: import("lit").CSSResult;
|
|
9
|
+
readonly scrimOpacity: import("lit").CSSResult;
|
|
10
|
+
readonly cornerShape: import("lit").CSSResult;
|
|
11
|
+
readonly modalContainerColor: import("lit").CSSResult;
|
|
12
|
+
readonly modalContainerElevation: import("lit").CSSResult;
|
|
13
|
+
readonly dividerColor: import("lit").CSSResult;
|
|
14
|
+
readonly dividerThickness: import("lit").CSSResult;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=DrawerContainerToken.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DrawerContainerToken.d.ts","sourceRoot":"","sources":["../../../src/styles/DrawerContainerToken.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;CAUvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/styles/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m3e/drawer-container",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.4",
|
|
4
4
|
"description": "Drawer Container for M3E",
|
|
5
5
|
"author": "matraic <matraic@yahoo.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"clean": "rimraf dist"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@m3e/core": "1.0.0-rc.
|
|
31
|
+
"@m3e/core": "1.0.0-rc.4",
|
|
32
32
|
"lit": "^3.3.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|