@momentum-design/components 0.43.1 → 0.45.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%;
@@ -465,6 +465,67 @@
465
465
  }
466
466
  ]
467
467
  },
468
+ {
469
+ "kind": "javascript-module",
470
+ "path": "components/appheader/appheader.component.js",
471
+ "declarations": [
472
+ {
473
+ "kind": "class",
474
+ "description": "The `mdc-appheader` component provides a structured and accessible app header layout.\nIt consists of three primary sections: leading, center, and trailing.\n\n- The **leading section** typically holds a **brand logo**, **brand name** or **menu icon**.\n- The **center section** can contain a **search bar**, **icons** or action controls.\n- The **trailing section** generally includes a **profile avatar**, **additional icons** or **action controls**.",
475
+ "name": "Appheader",
476
+ "cssParts": [
477
+ {
478
+ "description": "The main container for styling the header.",
479
+ "name": "container"
480
+ },
481
+ {
482
+ "description": "The leading section of the header.",
483
+ "name": "leading-section"
484
+ },
485
+ {
486
+ "description": "The center section of the header.",
487
+ "name": "center-section"
488
+ },
489
+ {
490
+ "description": "The trailing section of the header.",
491
+ "name": "trailing-section"
492
+ }
493
+ ],
494
+ "slots": [
495
+ {
496
+ "description": "Slot for the leading section (e.g., brand logo, brand name).",
497
+ "name": "leading"
498
+ },
499
+ {
500
+ "description": "Slot for the center section (e.g., search bar, icons).",
501
+ "name": "center"
502
+ },
503
+ {
504
+ "description": "Slot for the trailing section (e.g., profile avatar, icons).",
505
+ "name": "trailing"
506
+ }
507
+ ],
508
+ "members": [],
509
+ "superclass": {
510
+ "name": "Component",
511
+ "module": "/src/models"
512
+ },
513
+ "tagName": "mdc-appheader",
514
+ "jsDoc": "/**\n * The `mdc-appheader` component provides a structured and accessible app header layout.\n * It consists of three primary sections: leading, center, and trailing.\n *\n * - The **leading section** typically holds a **brand logo**, **brand name** or **menu icon**.\n * - The **center section** can contain a **search bar**, **icons** or action controls.\n * - The **trailing section** generally includes a **profile avatar**, **additional icons** or **action controls**.\n *\n * @tagname mdc-appheader\n *\n * @slot leading - Slot for the leading section (e.g., brand logo, brand name).\n * @slot center - Slot for the center section (e.g., search bar, icons).\n * @slot trailing - Slot for the trailing section (e.g., profile avatar, icons).\n *\n * @csspart container - The main container for styling the header.\n * @csspart leading-section - The leading section of the header.\n * @csspart center-section - The center section of the header.\n * @csspart trailing-section - The trailing section of the header.\n */",
515
+ "customElement": true
516
+ }
517
+ ],
518
+ "exports": [
519
+ {
520
+ "kind": "js",
521
+ "name": "default",
522
+ "declaration": {
523
+ "name": "Appheader",
524
+ "module": "components/appheader/appheader.component.js"
525
+ }
526
+ }
527
+ ]
528
+ },
468
529
  {
469
530
  "kind": "javascript-module",
470
531
  "path": "components/avatar/avatar.component.js",
package/dist/index.d.ts CHANGED
@@ -35,6 +35,7 @@ import OptGroup from './components/optgroup';
35
35
  import Textarea from './components/textarea';
36
36
  import Searchfield from './components/searchfield';
37
37
  import Brandvisual from './components/brandvisual';
38
+ import Appheader from './components/appheader';
38
39
  import type { SpinnerSize, SpinnerVariant } from './components/spinner/spinner.types';
39
40
  import type { TextType } from './components/text/text.types';
40
41
  import type { PopoverPlacement } from './components/popover/popover.types';
@@ -42,6 +43,6 @@ import type { BadgeType } from './components/badge/badge.types';
42
43
  import type { IconButtonSize, PillButtonSize, ButtonVariant, ButtonColor } from './components/button/button.types';
43
44
  import { BUTTON_COLORS, BUTTON_VARIANTS, ICON_BUTTON_SIZES, PILL_BUTTON_SIZES } from './components/button/button.constants';
44
45
  import { inMemoryCache, webAPIIconsCache } from './utils/icon-cache';
45
- export { AlertChip, Avatar, AvatarButton, Badge, Bullet, Button, Checkbox, Chip, Coachmark, Divider, FilterChip, FormfieldGroup, Icon, IconProvider, Input, InputChip, Link, List, ListItem, Marker, Popover, Presence, Radio, RadioGroup, Spinner, Tab, Text, ThemeProvider, Toggle, VirtualizedList, Option, OptGroup, Progressbar, Textarea, Tooltip, Searchfield, Brandvisual, };
46
+ export { AlertChip, Avatar, AvatarButton, Badge, Bullet, Button, Checkbox, Chip, Coachmark, Divider, FilterChip, FormfieldGroup, Icon, IconProvider, Input, InputChip, Link, List, ListItem, Marker, Popover, Presence, Radio, RadioGroup, Spinner, Tab, Text, ThemeProvider, Toggle, VirtualizedList, Option, OptGroup, Progressbar, Textarea, Tooltip, Searchfield, Brandvisual, Appheader, };
46
47
  export type { TextType, SpinnerSize, SpinnerVariant, PopoverPlacement, BadgeType, IconButtonSize, PillButtonSize, ButtonVariant, ButtonColor, };
47
48
  export { inMemoryCache, webAPIIconsCache, BUTTON_COLORS, BUTTON_VARIANTS, ICON_BUTTON_SIZES, PILL_BUTTON_SIZES };
package/dist/index.js CHANGED
@@ -36,10 +36,11 @@ import OptGroup from './components/optgroup';
36
36
  import Textarea from './components/textarea';
37
37
  import Searchfield from './components/searchfield';
38
38
  import Brandvisual from './components/brandvisual';
39
+ import Appheader from './components/appheader';
39
40
  // Constants / Utils Imports
40
41
  import { BUTTON_COLORS, BUTTON_VARIANTS, ICON_BUTTON_SIZES, PILL_BUTTON_SIZES, } from './components/button/button.constants';
41
42
  import { inMemoryCache, webAPIIconsCache } from './utils/icon-cache';
42
43
  // Components Exports
43
- export { AlertChip, Avatar, AvatarButton, Badge, Bullet, Button, Checkbox, Chip, Coachmark, Divider, FilterChip, FormfieldGroup, Icon, IconProvider, Input, InputChip, Link, List, ListItem, Marker, Popover, Presence, Radio, RadioGroup, Spinner, Tab, Text, ThemeProvider, Toggle, VirtualizedList, Option, OptGroup, Progressbar, Textarea, Tooltip, Searchfield, Brandvisual, };
44
+ export { AlertChip, Avatar, AvatarButton, Badge, Bullet, Button, Checkbox, Chip, Coachmark, Divider, FilterChip, FormfieldGroup, Icon, IconProvider, Input, InputChip, Link, List, ListItem, Marker, Popover, Presence, Radio, RadioGroup, Spinner, Tab, Text, ThemeProvider, Toggle, VirtualizedList, Option, OptGroup, Progressbar, Textarea, Tooltip, Searchfield, Brandvisual, Appheader, };
44
45
  // Constants / Utils Exports
45
46
  export { inMemoryCache, webAPIIconsCache, BUTTON_COLORS, BUTTON_VARIANTS, ICON_BUTTON_SIZES, PILL_BUTTON_SIZES };
@@ -0,0 +1,22 @@
1
+ import Component from '../../components/appheader';
2
+ /**
3
+ * The `mdc-appheader` component provides a structured and accessible app header layout.
4
+ * It consists of three primary sections: leading, center, and trailing.
5
+ *
6
+ * - The **leading section** typically holds a **brand logo**, **brand name** or **menu icon**.
7
+ * - The **center section** can contain a **search bar**, **icons** or action controls.
8
+ * - The **trailing section** generally includes a **profile avatar**, **additional icons** or **action controls**.
9
+ *
10
+ * @tagname mdc-appheader
11
+ *
12
+ * @slot leading - Slot for the leading section (e.g., brand logo, brand name).
13
+ * @slot center - Slot for the center section (e.g., search bar, icons).
14
+ * @slot trailing - Slot for the trailing section (e.g., profile avatar, icons).
15
+ *
16
+ * @csspart container - The main container for styling the header.
17
+ * @csspart leading-section - The leading section of the header.
18
+ * @csspart center-section - The center section of the header.
19
+ * @csspart trailing-section - The trailing section of the header.
20
+ */
21
+ declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {}>;
22
+ export default reactWrapper;
@@ -0,0 +1,31 @@
1
+ import * as React from 'react';
2
+ import { createComponent } from '@lit/react';
3
+ import Component from '../../components/appheader';
4
+ import { TAG_NAME } from '../../components/appheader/appheader.constants';
5
+ /**
6
+ * The `mdc-appheader` component provides a structured and accessible app header layout.
7
+ * It consists of three primary sections: leading, center, and trailing.
8
+ *
9
+ * - The **leading section** typically holds a **brand logo**, **brand name** or **menu icon**.
10
+ * - The **center section** can contain a **search bar**, **icons** or action controls.
11
+ * - The **trailing section** generally includes a **profile avatar**, **additional icons** or **action controls**.
12
+ *
13
+ * @tagname mdc-appheader
14
+ *
15
+ * @slot leading - Slot for the leading section (e.g., brand logo, brand name).
16
+ * @slot center - Slot for the center section (e.g., search bar, icons).
17
+ * @slot trailing - Slot for the trailing section (e.g., profile avatar, icons).
18
+ *
19
+ * @csspart container - The main container for styling the header.
20
+ * @csspart leading-section - The leading section of the header.
21
+ * @csspart center-section - The center section of the header.
22
+ * @csspart trailing-section - The trailing section of the header.
23
+ */
24
+ const reactWrapper = createComponent({
25
+ tagName: TAG_NAME,
26
+ elementClass: Component,
27
+ react: React,
28
+ events: {},
29
+ displayName: 'Appheader',
30
+ });
31
+ export default reactWrapper;
@@ -1,4 +1,5 @@
1
1
  export { default as AlertChip } from './alertchip';
2
+ export { default as Appheader } from './appheader';
2
3
  export { default as Avatar } from './avatar';
3
4
  export { default as AvatarButton } from './avatarbutton';
4
5
  export { default as Badge } from './badge';
@@ -1,4 +1,5 @@
1
1
  export { default as AlertChip } from './alertchip';
2
+ export { default as Appheader } from './appheader';
2
3
  export { default as Avatar } from './avatar';
3
4
  export { default as AvatarButton } from './avatarbutton';
4
5
  export { default as Badge } from './badge';
package/package.json CHANGED
@@ -38,5 +38,5 @@
38
38
  "lit": "^3.2.0",
39
39
  "uuid": "^11.0.5"
40
40
  },
41
- "version": "0.43.1"
41
+ "version": "0.45.0"
42
42
  }