@momentum-design/components 0.51.2 → 0.51.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/dist/browser/index.js +94 -72
- package/dist/browser/index.js.map +2 -2
- package/dist/components/avatarbutton/avatarbutton.component.d.ts +4 -0
- package/dist/components/avatarbutton/avatarbutton.component.js +5 -1
- package/dist/components/avatarbutton/avatarbutton.styles.js +22 -0
- package/dist/components/tooltip/tooltip.component.js +0 -1
- package/dist/custom-elements.json +15 -1
- package/dist/react/avatarbutton/index.d.ts +4 -0
- package/dist/react/avatarbutton/index.js +4 -0
- package/package.json +1 -1
@@ -16,6 +16,10 @@ declare const AvatarButton_base: import("../../utils/mixins/index.types").Constr
|
|
16
16
|
* @event focus - (React: onFocus) This event is dispatched when the avatarbutton receives focus.
|
17
17
|
*
|
18
18
|
* @tagname mdc-avatarbutton
|
19
|
+
*
|
20
|
+
* @cssproperty --mdc-avatarbutton-overlay-background-color-rest - Background color of the overlay in rest state
|
21
|
+
* @cssproperty --mdc-avatarbutton-overlay-background-color-hover - Background color of the overlay in hover state
|
22
|
+
* @cssproperty --mdc-avatarbutton-overlay-background-color-active - Background color of the overlay in active state
|
19
23
|
*/
|
20
24
|
declare class AvatarButton extends AvatarButton_base {
|
21
25
|
/**
|
@@ -30,6 +30,10 @@ import styles from './avatarbutton.styles';
|
|
30
30
|
* @event focus - (React: onFocus) This event is dispatched when the avatarbutton receives focus.
|
31
31
|
*
|
32
32
|
* @tagname mdc-avatarbutton
|
33
|
+
*
|
34
|
+
* @cssproperty --mdc-avatarbutton-overlay-background-color-rest - Background color of the overlay in rest state
|
35
|
+
* @cssproperty --mdc-avatarbutton-overlay-background-color-hover - Background color of the overlay in hover state
|
36
|
+
* @cssproperty --mdc-avatarbutton-overlay-background-color-active - Background color of the overlay in active state
|
33
37
|
*/
|
34
38
|
class AvatarButton extends AvatarComponentMixin(IconNameMixin(Buttonsimple)) {
|
35
39
|
constructor() {
|
@@ -58,8 +62,8 @@ class AvatarButton extends AvatarComponentMixin(IconNameMixin(Buttonsimple)) {
|
|
58
62
|
}
|
59
63
|
render() {
|
60
64
|
return html `
|
65
|
+
<div part="overlay" aria-hidden="true"></div>
|
61
66
|
<mdc-avatar
|
62
|
-
slot="prefixIcon"
|
63
67
|
?is-typing="${this.isTyping}"
|
64
68
|
counter="${ifDefined(this.counter)}"
|
65
69
|
icon-name="${ifDefined(this.iconName)}"
|
@@ -2,10 +2,32 @@ import { css } from 'lit';
|
|
2
2
|
import { hostFitContentStyles, hostFocusRingStyles } from '../../utils/styles';
|
3
3
|
const styles = [hostFitContentStyles, css `
|
4
4
|
:host {
|
5
|
+
--mdc-avatarbutton-overlay-background-color-rest: var(--mds-color-theme-avatar-ghost);
|
6
|
+
--mdc-avatarbutton-overlay-background-color-hover: var(--mds-color-theme-avatar-hover);
|
7
|
+
--mdc-avatarbutton-overlay-background-color-active: var(--mds-color-theme-avatar-pressed);
|
5
8
|
padding: unset;
|
6
9
|
margin: unset;
|
7
10
|
outline: none;
|
8
11
|
border-radius: 0.25rem;
|
12
|
+
position: relative;
|
13
|
+
cursor: pointer;
|
14
|
+
}
|
15
|
+
:host::part(overlay) {
|
16
|
+
position: absolute;
|
17
|
+
border-radius: 100vh;
|
18
|
+
height: 100%;
|
19
|
+
width: 100%;
|
20
|
+
z-index: 1;
|
21
|
+
background-color: var(--mdc-avatarbutton-overlay-background-color-rest);
|
22
|
+
}
|
23
|
+
:host(:not([is-typing]):hover)::part(overlay) {
|
24
|
+
background-color: var(--mdc-avatarbutton-overlay-background-color-hover);
|
25
|
+
}
|
26
|
+
:host(:not([is-typing]):active)::part(overlay) {
|
27
|
+
background-color: var(--mdc-avatarbutton-overlay-background-color-active);
|
28
|
+
}
|
29
|
+
:host::part(presence) {
|
30
|
+
z-index: 2;
|
9
31
|
}
|
10
32
|
`, ...hostFocusRingStyles()];
|
11
33
|
export default styles;
|
@@ -55,7 +55,6 @@ class Tooltip extends Popover {
|
|
55
55
|
this.offset = DEFAULTS.OFFSET;
|
56
56
|
this.placement = DEFAULTS.PLACEMENT;
|
57
57
|
this.role = 'tooltip';
|
58
|
-
this.showArrow = true;
|
59
58
|
this.trigger = 'mouseenter focusin';
|
60
59
|
this.enabledFocusTrap = false;
|
61
60
|
this.enabledPreventScroll = false;
|
@@ -774,6 +774,20 @@
|
|
774
774
|
"kind": "class",
|
775
775
|
"description": "The `mdc-avatarbutton` component is an interactable version of the `mdc-avatar` component.\n\nThis component is made by extending `buttonsimple` class.\nThe button component acts as a wrapper for the avatar component.",
|
776
776
|
"name": "AvatarButton",
|
777
|
+
"cssProperties": [
|
778
|
+
{
|
779
|
+
"description": "Background color of the overlay in rest state",
|
780
|
+
"name": "--mdc-avatarbutton-overlay-background-color-rest"
|
781
|
+
},
|
782
|
+
{
|
783
|
+
"description": "Background color of the overlay in hover state",
|
784
|
+
"name": "--mdc-avatarbutton-overlay-background-color-hover"
|
785
|
+
},
|
786
|
+
{
|
787
|
+
"description": "Background color of the overlay in active state",
|
788
|
+
"name": "--mdc-avatarbutton-overlay-background-color-active"
|
789
|
+
}
|
790
|
+
],
|
777
791
|
"members": [
|
778
792
|
{
|
779
793
|
"kind": "field",
|
@@ -1348,7 +1362,7 @@
|
|
1348
1362
|
"module": "/src/components/buttonsimple/buttonsimple.component"
|
1349
1363
|
},
|
1350
1364
|
"tagName": "mdc-avatarbutton",
|
1351
|
-
"jsDoc": "/**\n * The `mdc-avatarbutton` component is an interactable version of the `mdc-avatar` component.\n *\n * This component is made by extending `buttonsimple` class.\n * The button component acts as a wrapper for the avatar component.\n *\n * @dependency mdc-avatar\n *\n * @event click - (React: onClick) This event is dispatched when the avatarbutton is clicked.\n * @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the avatarbutton.\n * @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the avatarbutton.\n * @event focus - (React: onFocus) This event is dispatched when the avatarbutton receives focus.\n *\n * @tagname mdc-avatarbutton\n */",
|
1365
|
+
"jsDoc": "/**\n * The `mdc-avatarbutton` component is an interactable version of the `mdc-avatar` component.\n *\n * This component is made by extending `buttonsimple` class.\n * The button component acts as a wrapper for the avatar component.\n *\n * @dependency mdc-avatar\n *\n * @event click - (React: onClick) This event is dispatched when the avatarbutton is clicked.\n * @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the avatarbutton.\n * @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the avatarbutton.\n * @event focus - (React: onFocus) This event is dispatched when the avatarbutton receives focus.\n *\n * @tagname mdc-avatarbutton\n *\n * @cssproperty --mdc-avatarbutton-overlay-background-color-rest - Background color of the overlay in rest state\n * @cssproperty --mdc-avatarbutton-overlay-background-color-hover - Background color of the overlay in hover state\n * @cssproperty --mdc-avatarbutton-overlay-background-color-active - Background color of the overlay in active state\n */",
|
1352
1366
|
"customElement": true
|
1353
1367
|
}
|
1354
1368
|
],
|
@@ -14,6 +14,10 @@ import Component from '../../components/avatarbutton';
|
|
14
14
|
* @event focus - (React: onFocus) This event is dispatched when the avatarbutton receives focus.
|
15
15
|
*
|
16
16
|
* @tagname mdc-avatarbutton
|
17
|
+
*
|
18
|
+
* @cssproperty --mdc-avatarbutton-overlay-background-color-rest - Background color of the overlay in rest state
|
19
|
+
* @cssproperty --mdc-avatarbutton-overlay-background-color-hover - Background color of the overlay in hover state
|
20
|
+
* @cssproperty --mdc-avatarbutton-overlay-background-color-active - Background color of the overlay in active state
|
17
21
|
*/
|
18
22
|
declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {
|
19
23
|
onClick: EventName<MouseEvent>;
|
@@ -16,6 +16,10 @@ import { TAG_NAME } from '../../components/avatarbutton/avatarbutton.constants';
|
|
16
16
|
* @event focus - (React: onFocus) This event is dispatched when the avatarbutton receives focus.
|
17
17
|
*
|
18
18
|
* @tagname mdc-avatarbutton
|
19
|
+
*
|
20
|
+
* @cssproperty --mdc-avatarbutton-overlay-background-color-rest - Background color of the overlay in rest state
|
21
|
+
* @cssproperty --mdc-avatarbutton-overlay-background-color-hover - Background color of the overlay in hover state
|
22
|
+
* @cssproperty --mdc-avatarbutton-overlay-background-color-active - Background color of the overlay in active state
|
19
23
|
*/
|
20
24
|
const reactWrapper = createComponent({
|
21
25
|
tagName: TAG_NAME,
|
package/package.json
CHANGED