@momentum-design/components 0.129.13 → 0.129.14
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/dist/browser/index.js.map +2 -2
- package/dist/components/appheader/appheader.component.d.ts +16 -12
- package/dist/components/appheader/appheader.component.js +16 -12
- package/dist/components/avatar/avatar.component.d.ts +22 -15
- package/dist/components/avatar/avatar.component.js +22 -15
- package/dist/components/avatarbutton/avatarbutton.component.d.ts +13 -11
- package/dist/components/avatarbutton/avatarbutton.component.js +13 -11
- package/dist/custom-elements.json +26 -20
- package/dist/react/appheader/index.d.ts +16 -12
- package/dist/react/appheader/index.js +16 -12
- package/dist/react/avatar/index.d.ts +25 -18
- package/dist/react/avatar/index.js +25 -18
- package/dist/react/avatarbutton/index.d.ts +13 -11
- package/dist/react/avatarbutton/index.js +13 -11
- package/package.json +1 -1
|
@@ -3,24 +3,31 @@ import { createComponent } from '@lit/react';
|
|
|
3
3
|
import Component from '../../components/avatar';
|
|
4
4
|
import { TAG_NAME } from '../../components/avatar/avatar.constants';
|
|
5
5
|
/**
|
|
6
|
-
* The `mdc-avatar` component
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* While
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
6
|
+
* The `mdc-avatar` component represents a person or a space. It displays as a photo, initials, icon, or counter.
|
|
7
|
+
*
|
|
8
|
+
* ## Display Priority
|
|
9
|
+
*
|
|
10
|
+
* When multiple attributes are provided, the component determines what to display based on this priority:
|
|
11
|
+
* 1. **Photo** (`src`) - Takes highest priority
|
|
12
|
+
* - While loading: Shows `initials` as placeholder if provided (instant), otherwise shows icon (requires loading)
|
|
13
|
+
* - After loading: Shows the photo
|
|
14
|
+
* - On error: Placeholder remains visible (initials or icon)
|
|
15
|
+
* 2. **Icon** (`icon-name`) - Takes priority if no `src` is provided
|
|
16
|
+
* - Shows custom icon if `icon-name` is set (requires icon library to load)
|
|
17
|
+
* - **Note:** If both `icon-name` and `initials` are provided (without `src`), icon takes precedence and initials are ignored.
|
|
18
|
+
* This means users may see a delay while the icon loads, even though initials render instantly.
|
|
19
|
+
* - Defaults to `user-regular` icon if no other content is available
|
|
20
|
+
* 3. **Initials** (`initials`) - Displayed only if no `src` or `icon-name` is provided
|
|
21
|
+
* - Shows first two characters, converted to uppercase
|
|
22
|
+
* - Renders instantly (no loading required)
|
|
23
|
+
* 4. **Counter** (`counter`) - Displayed only if none of the above are provided
|
|
24
|
+
* - Shows numeric value (max 99+)
|
|
25
|
+
* - Negative values display as 0
|
|
26
|
+
*
|
|
27
|
+
* ## Behavior
|
|
28
|
+
* - Non-interactive and non-focusable component (use `mdc-avatarbutton` for clickable avatars)
|
|
29
|
+
* - Shows loading indicator overlay when `is-typing` is true (displays on top of existing content)
|
|
30
|
+
* - Presence indicator hidden when counter is set or when typing
|
|
24
31
|
*
|
|
25
32
|
* @dependency mdc-icon
|
|
26
33
|
* @dependency mdc-presence
|
|
@@ -2,25 +2,27 @@ import { type EventName } from '@lit/react';
|
|
|
2
2
|
import Component from '../../components/avatarbutton';
|
|
3
3
|
import type { Events as EventsInherited } from '../../components/buttonsimple/buttonsimple.types';
|
|
4
4
|
/**
|
|
5
|
-
* The `mdc-avatarbutton` component is an
|
|
5
|
+
* The `mdc-avatarbutton` component is an interactive, clickable version of `mdc-avatar`.
|
|
6
|
+
* It wraps the avatar component in a button, making it focusable and actionable.
|
|
6
7
|
*
|
|
7
|
-
* This component
|
|
8
|
-
*
|
|
8
|
+
* This component extends `buttonsimple` and includes all avatar display features (photo, initials, icon, counter, presence).
|
|
9
|
+
* Use CSS parts to customize the avatar's appearance inside the button.
|
|
9
10
|
*
|
|
10
|
-
*
|
|
11
|
+
* ## Accessibility
|
|
12
|
+
* - Always provide an `aria-label` attribute to describe the button's purpose
|
|
11
13
|
*
|
|
12
14
|
* @dependency mdc-avatar
|
|
13
15
|
*
|
|
14
|
-
* @event click - (React: onClick)
|
|
15
|
-
* @event keydown - (React: onKeyDown)
|
|
16
|
-
* @event keyup - (React: onKeyUp)
|
|
17
|
-
* @event focus - (React: onFocus)
|
|
16
|
+
* @event click - (React: onClick) Dispatched when the avatar button is clicked.
|
|
17
|
+
* @event keydown - (React: onKeyDown) Dispatched when a key is pressed on the avatar button.
|
|
18
|
+
* @event keyup - (React: onKeyUp) Dispatched when a key is released on the avatar button.
|
|
19
|
+
* @event focus - (React: onFocus) Dispatched when the avatar button receives focus.
|
|
18
20
|
*
|
|
19
21
|
* @tagname mdc-avatarbutton
|
|
20
22
|
*
|
|
21
|
-
* @cssproperty --mdc-avatarbutton-overlay-background-color-rest - Background color of the overlay in rest state
|
|
22
|
-
* @cssproperty --mdc-avatarbutton-overlay-background-color-hover - Background color of the overlay in hover state
|
|
23
|
-
* @cssproperty --mdc-avatarbutton-overlay-background-color-active - Background color of the overlay in active state
|
|
23
|
+
* @cssproperty --mdc-avatarbutton-overlay-background-color-rest - Background color of the overlay in rest state.
|
|
24
|
+
* @cssproperty --mdc-avatarbutton-overlay-background-color-hover - Background color of the overlay in hover state.
|
|
25
|
+
* @cssproperty --mdc-avatarbutton-overlay-background-color-active - Background color of the overlay in active state.
|
|
24
26
|
*
|
|
25
27
|
* @csspart overlay - The overlay part of the avatar button.
|
|
26
28
|
* @csspart content - The main content of the avatar.
|
|
@@ -3,25 +3,27 @@ import { createComponent } from '@lit/react';
|
|
|
3
3
|
import Component from '../../components/avatarbutton';
|
|
4
4
|
import { TAG_NAME } from '../../components/avatarbutton/avatarbutton.constants';
|
|
5
5
|
/**
|
|
6
|
-
* The `mdc-avatarbutton` component is an
|
|
6
|
+
* The `mdc-avatarbutton` component is an interactive, clickable version of `mdc-avatar`.
|
|
7
|
+
* It wraps the avatar component in a button, making it focusable and actionable.
|
|
7
8
|
*
|
|
8
|
-
* This component
|
|
9
|
-
*
|
|
9
|
+
* This component extends `buttonsimple` and includes all avatar display features (photo, initials, icon, counter, presence).
|
|
10
|
+
* Use CSS parts to customize the avatar's appearance inside the button.
|
|
10
11
|
*
|
|
11
|
-
*
|
|
12
|
+
* ## Accessibility
|
|
13
|
+
* - Always provide an `aria-label` attribute to describe the button's purpose
|
|
12
14
|
*
|
|
13
15
|
* @dependency mdc-avatar
|
|
14
16
|
*
|
|
15
|
-
* @event click - (React: onClick)
|
|
16
|
-
* @event keydown - (React: onKeyDown)
|
|
17
|
-
* @event keyup - (React: onKeyUp)
|
|
18
|
-
* @event focus - (React: onFocus)
|
|
17
|
+
* @event click - (React: onClick) Dispatched when the avatar button is clicked.
|
|
18
|
+
* @event keydown - (React: onKeyDown) Dispatched when a key is pressed on the avatar button.
|
|
19
|
+
* @event keyup - (React: onKeyUp) Dispatched when a key is released on the avatar button.
|
|
20
|
+
* @event focus - (React: onFocus) Dispatched when the avatar button receives focus.
|
|
19
21
|
*
|
|
20
22
|
* @tagname mdc-avatarbutton
|
|
21
23
|
*
|
|
22
|
-
* @cssproperty --mdc-avatarbutton-overlay-background-color-rest - Background color of the overlay in rest state
|
|
23
|
-
* @cssproperty --mdc-avatarbutton-overlay-background-color-hover - Background color of the overlay in hover state
|
|
24
|
-
* @cssproperty --mdc-avatarbutton-overlay-background-color-active - Background color of the overlay in active state
|
|
24
|
+
* @cssproperty --mdc-avatarbutton-overlay-background-color-rest - Background color of the overlay in rest state.
|
|
25
|
+
* @cssproperty --mdc-avatarbutton-overlay-background-color-hover - Background color of the overlay in hover state.
|
|
26
|
+
* @cssproperty --mdc-avatarbutton-overlay-background-color-active - Background color of the overlay in active state.
|
|
25
27
|
*
|
|
26
28
|
* @csspart overlay - The overlay part of the avatar button.
|
|
27
29
|
* @csspart content - The main content of the avatar.
|