@momentum-design/components 0.44.0 → 0.46.0

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.
@@ -0,0 +1,30 @@
1
+ import { CSSResult } from 'lit';
2
+ import { Component } from '../../models';
3
+ /**
4
+ * The `mdc-appheader` component provides a structured and accessible app header layout.
5
+ * It consists of three primary sections: leading, center, and trailing.
6
+ *
7
+ * - The **leading section** typically holds a **brand logo**, **brand name** or **menu icon**.
8
+ * - The **center section** can contain a **search bar**, **icons** or action controls.
9
+ * - The **trailing section** generally includes a **profile avatar**, **additional icons** or **action controls**.
10
+ *
11
+ * @tagname mdc-appheader
12
+ *
13
+ * @slot leading - Slot for the leading section (e.g., brand logo, brand name).
14
+ * @slot center - Slot for the center section (e.g., search bar, icons).
15
+ * @slot trailing - Slot for the trailing section (e.g., profile avatar, icons).
16
+ *
17
+ * @csspart container - The main container for styling the header.
18
+ * @csspart leading-section - The leading section of the header.
19
+ * @csspart center-section - The center section of the header.
20
+ * @csspart trailing-section - The trailing section of the header.
21
+ */
22
+ declare class Appheader extends Component {
23
+ /**
24
+ * Renders the structured layout of the app header.
25
+ * Uses `slots` for flexibility, allowing consumers to insert custom content.
26
+ */
27
+ render(): import("lit-html").TemplateResult<1>;
28
+ static styles: Array<CSSResult>;
29
+ }
30
+ export default Appheader;
@@ -0,0 +1,44 @@
1
+ import { html } from 'lit';
2
+ import styles from './appheader.styles';
3
+ import { Component } from '../../models';
4
+ /**
5
+ * The `mdc-appheader` component provides a structured and accessible app header layout.
6
+ * It consists of three primary sections: leading, center, and trailing.
7
+ *
8
+ * - The **leading section** typically holds a **brand logo**, **brand name** or **menu icon**.
9
+ * - The **center section** can contain a **search bar**, **icons** or action controls.
10
+ * - The **trailing section** generally includes a **profile avatar**, **additional icons** or **action controls**.
11
+ *
12
+ * @tagname mdc-appheader
13
+ *
14
+ * @slot leading - Slot for the leading section (e.g., brand logo, brand name).
15
+ * @slot center - Slot for the center section (e.g., search bar, icons).
16
+ * @slot trailing - Slot for the trailing section (e.g., profile avatar, icons).
17
+ *
18
+ * @csspart container - The main container for styling the header.
19
+ * @csspart leading-section - The leading section of the header.
20
+ * @csspart center-section - The center section of the header.
21
+ * @csspart trailing-section - The trailing section of the header.
22
+ */
23
+ class Appheader extends Component {
24
+ /**
25
+ * Renders the structured layout of the app header.
26
+ * Uses `slots` for flexibility, allowing consumers to insert custom content.
27
+ */
28
+ render() {
29
+ return html `
30
+ <header part="container">
31
+ <div part="leading-section">
32
+ <slot name="leading"></slot>
33
+ </div>
34
+ <div part="center-section">
35
+ <slot name="center"></slot>
36
+ </div>
37
+ <div part="trailing-section">
38
+ <slot name="trailing"></slot>
39
+ </div>
40
+ </header>`;
41
+ }
42
+ }
43
+ Appheader.styles = [...Component.styles, ...styles];
44
+ export default Appheader;
@@ -0,0 +1,2 @@
1
+ declare const TAG_NAME: "mdc-appheader";
2
+ export { TAG_NAME };
@@ -0,0 +1,3 @@
1
+ import utils from '../../utils/tag-name';
2
+ const TAG_NAME = utils.constructTagName('appheader');
3
+ export { TAG_NAME };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("lit").CSSResult[];
2
+ export default _default;
@@ -0,0 +1,37 @@
1
+ import { css } from 'lit';
2
+ const styles = css `
3
+ :host {
4
+ --mdc-appheader-height: 4rem;
5
+ }
6
+
7
+ :host::part(container) {
8
+ display: flex;
9
+ align-items: center;
10
+ width: 100%;
11
+ height: var(--mdc-appheader-height);
12
+ padding: 1rem;
13
+ }
14
+
15
+ :host::part(leading-section),
16
+ :host::part(center-section),
17
+ :host::part(trailing-section) {
18
+ flex: 1;
19
+ display: flex;
20
+ height: 100%;
21
+ }
22
+
23
+ :host::part(leading-section) {
24
+ justify-content: flex-start;
25
+
26
+ }
27
+
28
+ :host::part(center-section) {
29
+ justify-content: center;
30
+ align-items: center;
31
+ }
32
+
33
+ :host::part(trailing-section) {
34
+ justify-content: flex-end;
35
+ }
36
+ `;
37
+ export default [styles];
@@ -0,0 +1,7 @@
1
+ import Appheader from './appheader.component';
2
+ declare global {
3
+ interface HTMLElementTagNameMap {
4
+ ['mdc-appheader']: Appheader;
5
+ }
6
+ }
7
+ export default Appheader;
@@ -0,0 +1,4 @@
1
+ import Appheader from './appheader.component';
2
+ import { TAG_NAME } from './appheader.constants';
3
+ Appheader.register(TAG_NAME);
4
+ export default Appheader;
@@ -2,6 +2,7 @@ import { css } from 'lit';
2
2
  const styles = css `
3
3
  :host {
4
4
  display: block;
5
+ height: 100%;
5
6
  }
6
7
  :host::part(brandvisual) {
7
8
  height: 100%;