@momentum-design/components 0.104.10 → 0.104.12
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 +210 -182
- package/dist/browser/index.js.map +3 -3
- package/dist/components/avatar/avatar.styles.js +28 -0
- package/dist/components/avatar/avatar.utils.js +9 -9
- package/dist/components/cardcheckbox/cardcheckbox.component.d.ts +1 -1
- package/dist/components/cardcheckbox/cardcheckbox.component.js +2 -1
- package/dist/components/cardcheckbox/cardcheckbox.types.d.ts +3 -1
- package/dist/components/cardradio/cardradio.component.d.ts +1 -1
- package/dist/components/cardradio/cardradio.component.js +3 -2
- package/dist/components/cardradio/cardradio.types.d.ts +3 -1
- package/dist/components/presence/presence.component.d.ts +14 -16
- package/dist/components/presence/presence.component.js +24 -36
- package/dist/components/presence/presence.constants.d.ts +11 -11
- package/dist/components/presence/presence.constants.js +12 -12
- package/dist/components/presence/presence.styles.js +16 -16
- package/dist/components/presence/presence.types.d.ts +3 -3
- package/dist/components/presence/presence.utils.d.ts +2 -1
- package/dist/components/presence/presence.utils.js +27 -15
- package/dist/custom-elements.json +37 -10
- package/dist/react/cardcheckbox/index.d.ts +4 -1
- package/dist/react/cardcheckbox/index.js +2 -1
- package/dist/react/cardradio/index.d.ts +4 -1
- package/dist/react/cardradio/index.js +2 -1
- package/package.json +1 -1
@@ -79,6 +79,34 @@ const styles = [
|
|
79
79
|
bottom: 0;
|
80
80
|
right: 0;
|
81
81
|
}
|
82
|
+
|
83
|
+
:host([size='124'])::part(presence) {
|
84
|
+
bottom: -0.25rem;
|
85
|
+
right: -0.21875rem;
|
86
|
+
}
|
87
|
+
|
88
|
+
:host([size='88'])::part(presence),
|
89
|
+
:host([size='72'])::part(presence),
|
90
|
+
:host([size='64'])::part(presence) {
|
91
|
+
bottom: -0.09375rem;
|
92
|
+
right: -0.09375rem;
|
93
|
+
}
|
94
|
+
|
95
|
+
:host([size='48'])::part(presence) {
|
96
|
+
bottom: -0.03125rem;
|
97
|
+
right: -0.03125rem;
|
98
|
+
}
|
99
|
+
|
100
|
+
:host([size='32'])::part(presence) {
|
101
|
+
bottom: -0.15625rem;
|
102
|
+
right: -0.15625rem;
|
103
|
+
}
|
104
|
+
|
105
|
+
:host([size='24'])::part(presence) {
|
106
|
+
bottom: -0.1875rem;
|
107
|
+
right: -0.1875rem;
|
108
|
+
}
|
109
|
+
|
82
110
|
:host::part(loading-wrapper) {
|
83
111
|
position: absolute;
|
84
112
|
border-radius: 100vh;
|
@@ -1,17 +1,17 @@
|
|
1
|
-
import {
|
1
|
+
import { PRESENCE_SIZE } from '../presence/presence.constants';
|
2
2
|
import { TYPE as FONT_TYPE } from '../text/text.constants';
|
3
3
|
import { AVATAR_SIZE } from './avatar.constants';
|
4
4
|
const getPresenceSize = (size) => {
|
5
5
|
const avatarPresenceSizeMap = {
|
6
|
-
[AVATAR_SIZE[124]]: PRESENCE_SIZE
|
7
|
-
[AVATAR_SIZE[88]]: PRESENCE_SIZE
|
8
|
-
[AVATAR_SIZE[72]]: PRESENCE_SIZE
|
9
|
-
[AVATAR_SIZE[64]]: PRESENCE_SIZE
|
10
|
-
[AVATAR_SIZE[48]]: PRESENCE_SIZE
|
11
|
-
[AVATAR_SIZE[32]]: PRESENCE_SIZE
|
12
|
-
[AVATAR_SIZE[24]]: PRESENCE_SIZE
|
6
|
+
[AVATAR_SIZE[124]]: PRESENCE_SIZE[124],
|
7
|
+
[AVATAR_SIZE[88]]: PRESENCE_SIZE[88],
|
8
|
+
[AVATAR_SIZE[72]]: PRESENCE_SIZE[72],
|
9
|
+
[AVATAR_SIZE[64]]: PRESENCE_SIZE[64],
|
10
|
+
[AVATAR_SIZE[48]]: PRESENCE_SIZE[48],
|
11
|
+
[AVATAR_SIZE[32]]: PRESENCE_SIZE[32],
|
12
|
+
[AVATAR_SIZE[24]]: PRESENCE_SIZE[24],
|
13
13
|
};
|
14
|
-
return avatarPresenceSizeMap[size] || PRESENCE_SIZE
|
14
|
+
return avatarPresenceSizeMap[size] || PRESENCE_SIZE[32]; // default size of presence
|
15
15
|
};
|
16
16
|
const getAvatarIconSize = (size) => {
|
17
17
|
const avatarIconSizeMap = {
|
@@ -47,7 +47,7 @@ declare const CardCheckbox_base: import("../../utils/mixins/index.types").Constr
|
|
47
47
|
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the card.
|
48
48
|
* It toggles the checked state when space key is used.
|
49
49
|
* @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.
|
50
|
-
*
|
50
|
+
* @event change - (React: onChange) Event that gets dispatched when the card's checked state changes.
|
51
51
|
*/
|
52
52
|
declare class CardCheckbox extends CardCheckbox_base {
|
53
53
|
/**
|
@@ -61,7 +61,7 @@ import styles from './cardcheckbox.styles';
|
|
61
61
|
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the card.
|
62
62
|
* It toggles the checked state when space key is used.
|
63
63
|
* @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.
|
64
|
-
*
|
64
|
+
* @event change - (React: onChange) Event that gets dispatched when the card's checked state changes.
|
65
65
|
*/
|
66
66
|
class CardCheckbox extends DisabledMixin(TabIndexMixin(Card)) {
|
67
67
|
constructor() {
|
@@ -101,6 +101,7 @@ class CardCheckbox extends DisabledMixin(TabIndexMixin(Card)) {
|
|
101
101
|
if (!this.disabled) {
|
102
102
|
this.checked = !this.checked;
|
103
103
|
}
|
104
|
+
this.dispatchEvent(new Event('change', { bubbles: true, composed: true }));
|
104
105
|
}
|
105
106
|
/**
|
106
107
|
* Toggles the checked state when enter key is used
|
@@ -1,11 +1,13 @@
|
|
1
|
-
import type { OverrideEventTarget, ValueOf } from '../../utils/types';
|
1
|
+
import type { OverrideEventTarget, TypedCustomEvent, ValueOf } from '../../utils/types';
|
2
2
|
import type CardCheckbox from './cardcheckbox.component';
|
3
3
|
import { SELECTION_TYPE } from './cardcheckbox.constants';
|
4
4
|
type SelectionType = ValueOf<typeof SELECTION_TYPE>;
|
5
|
+
type CardCheckboxChangeEvent = TypedCustomEvent<CardCheckbox>;
|
5
6
|
interface Events {
|
6
7
|
onClickEvent: OverrideEventTarget<MouseEvent, CardCheckbox>;
|
7
8
|
onKeyDownEvent: OverrideEventTarget<KeyboardEvent, CardCheckbox>;
|
8
9
|
onKeyUpEvent: OverrideEventTarget<KeyboardEvent, CardCheckbox>;
|
9
10
|
onFocusEvent: OverrideEventTarget<FocusEvent, CardCheckbox>;
|
11
|
+
onChangeEvent: CardCheckboxChangeEvent;
|
10
12
|
}
|
11
13
|
export { SelectionType, Events };
|
@@ -46,7 +46,7 @@ declare const CardRadio_base: import("../../utils/mixins/index.types").Construct
|
|
46
46
|
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the card.
|
47
47
|
* It toggles the checked state when space key is used.
|
48
48
|
* @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.
|
49
|
-
*
|
49
|
+
* @event change - (React: onChange) Event that gets dispatched when the card's checked state changes.
|
50
50
|
*/
|
51
51
|
declare class CardRadio extends CardRadio_base {
|
52
52
|
/**
|
@@ -61,7 +61,7 @@ import styles from './cardradio.styles';
|
|
61
61
|
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the card.
|
62
62
|
* It toggles the checked state when space key is used.
|
63
63
|
* @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.
|
64
|
-
*
|
64
|
+
* @event change - (React: onChange) Event that gets dispatched when the card's checked state changes.
|
65
65
|
*/
|
66
66
|
class CardRadio extends DisabledMixin(TabIndexMixin(Card)) {
|
67
67
|
constructor() {
|
@@ -96,7 +96,7 @@ class CardRadio extends DisabledMixin(TabIndexMixin(Card)) {
|
|
96
96
|
* Dispatches the change event.
|
97
97
|
*/
|
98
98
|
toggleChecked() {
|
99
|
-
if (this.disabled)
|
99
|
+
if (this.disabled || this.checked)
|
100
100
|
return;
|
101
101
|
const cards = this.getAllCardsWithinSameGroup();
|
102
102
|
cards.forEach(card => {
|
@@ -106,6 +106,7 @@ class CardRadio extends DisabledMixin(TabIndexMixin(Card)) {
|
|
106
106
|
card.checked = false;
|
107
107
|
});
|
108
108
|
this.checked = true;
|
109
|
+
this.dispatchEvent(new Event('change', { bubbles: true, composed: true }));
|
109
110
|
}
|
110
111
|
setDisabled(disabled) {
|
111
112
|
this.setAttribute('aria-disabled', `${disabled}`);
|
@@ -1,9 +1,11 @@
|
|
1
|
-
import type { OverrideEventTarget } from '../../utils/types';
|
1
|
+
import type { OverrideEventTarget, TypedCustomEvent } from '../../utils/types';
|
2
2
|
import type CardRadio from './cardradio.component';
|
3
|
+
type CardRadioChangeEvent = TypedCustomEvent<CardRadio>;
|
3
4
|
interface Events {
|
4
5
|
onClickEvent: OverrideEventTarget<MouseEvent, CardRadio>;
|
5
6
|
onKeyDownEvent: OverrideEventTarget<KeyboardEvent, CardRadio>;
|
6
7
|
onKeyUpEvent: OverrideEventTarget<KeyboardEvent, CardRadio>;
|
7
8
|
onFocusEvent: OverrideEventTarget<FocusEvent, CardRadio>;
|
9
|
+
onChangeEvent: CardRadioChangeEvent;
|
8
10
|
}
|
9
11
|
export type { Events };
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { CSSResult } from 'lit';
|
1
|
+
import { CSSResult, PropertyValues } from 'lit';
|
2
2
|
import { Component } from '../../models';
|
3
3
|
import type { PresenceType, PresenceSize } from './presence.types';
|
4
4
|
/**
|
@@ -49,18 +49,18 @@ declare class Presence extends Component {
|
|
49
49
|
*/
|
50
50
|
type: PresenceType;
|
51
51
|
/**
|
52
|
-
* Acceptable values include:
|
53
|
-
* -
|
54
|
-
* -
|
55
|
-
* -
|
56
|
-
* -
|
57
|
-
* -
|
58
|
-
* -
|
59
|
-
* -
|
52
|
+
* Acceptable numeric values include:
|
53
|
+
* - 24
|
54
|
+
* - 32
|
55
|
+
* - 48
|
56
|
+
* - 64
|
57
|
+
* - 72
|
58
|
+
* - 88
|
59
|
+
* - 124
|
60
60
|
*
|
61
|
-
* Presence icons are minimum 14px in size, meaning
|
62
|
-
* icons will be no smaller than 14px.
|
63
|
-
* @default
|
61
|
+
* Presence icons are minimum 14px in size, meaning 24, 32, and 48 presence
|
62
|
+
* icons will be no smaller than 14px (for sizes 24, 32, 48).
|
63
|
+
* @default 32
|
64
64
|
*/
|
65
65
|
size: PresenceSize;
|
66
66
|
/**
|
@@ -68,10 +68,8 @@ declare class Presence extends Component {
|
|
68
68
|
* State to track the current icon type (previous type until the new icon is loaded)
|
69
69
|
*/
|
70
70
|
private currentIconType;
|
71
|
-
|
72
|
-
|
73
|
-
*/
|
74
|
-
private get iconSize();
|
71
|
+
update(changedProperties: PropertyValues): void;
|
72
|
+
private setSize;
|
75
73
|
/**
|
76
74
|
* Get the icon name based on the presence type
|
77
75
|
*/
|
@@ -10,9 +10,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
10
10
|
import { html } from 'lit';
|
11
11
|
import { property, state } from 'lit/decorators.js';
|
12
12
|
import { Component } from '../../models';
|
13
|
-
import { DEFAULTS,
|
13
|
+
import { DEFAULTS, PRESENCE_SIZE } from './presence.constants';
|
14
14
|
import styles from './presence.styles';
|
15
|
-
import { getIconValue } from './presence.utils';
|
15
|
+
import { getIconValue, getPresenceIconSize } from './presence.utils';
|
16
16
|
/**
|
17
17
|
* The `mdc-presence` component is a versatile UI element used to
|
18
18
|
* display the presence status of a user or entity within an avatar component.
|
@@ -63,18 +63,18 @@ class Presence extends Component {
|
|
63
63
|
*/
|
64
64
|
this.type = DEFAULTS.TYPE;
|
65
65
|
/**
|
66
|
-
* Acceptable values include:
|
67
|
-
* -
|
68
|
-
* -
|
69
|
-
* -
|
70
|
-
* -
|
71
|
-
* -
|
72
|
-
* -
|
73
|
-
* -
|
66
|
+
* Acceptable numeric values include:
|
67
|
+
* - 24
|
68
|
+
* - 32
|
69
|
+
* - 48
|
70
|
+
* - 64
|
71
|
+
* - 72
|
72
|
+
* - 88
|
73
|
+
* - 124
|
74
74
|
*
|
75
|
-
* Presence icons are minimum 14px in size, meaning
|
76
|
-
* icons will be no smaller than 14px.
|
77
|
-
* @default
|
75
|
+
* Presence icons are minimum 14px in size, meaning 24, 32, and 48 presence
|
76
|
+
* icons will be no smaller than 14px (for sizes 24, 32, 48).
|
77
|
+
* @default 32
|
78
78
|
*/
|
79
79
|
this.size = DEFAULTS.SIZE;
|
80
80
|
/**
|
@@ -83,27 +83,15 @@ class Presence extends Component {
|
|
83
83
|
*/
|
84
84
|
this.currentIconType = DEFAULTS.TYPE;
|
85
85
|
}
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
switch (this.size) {
|
91
|
-
case SIZE.MIDSIZE:
|
92
|
-
return 1.16125;
|
93
|
-
case SIZE.LARGE:
|
94
|
-
return 1.30625;
|
95
|
-
case SIZE.X_LARGE:
|
96
|
-
return 1.596875;
|
97
|
-
case SIZE.XX_LARGE:
|
98
|
-
return 2.25;
|
99
|
-
case SIZE.XX_SMALL:
|
100
|
-
case SIZE.X_SMALL:
|
101
|
-
case SIZE.SMALL:
|
102
|
-
default:
|
103
|
-
this.size = DEFAULTS.SIZE;
|
104
|
-
return 0.875;
|
86
|
+
update(changedProperties) {
|
87
|
+
super.update(changedProperties);
|
88
|
+
if (changedProperties.has('size')) {
|
89
|
+
this.setSize(this.size);
|
105
90
|
}
|
106
91
|
}
|
92
|
+
setSize(size) {
|
93
|
+
this.setAttribute('size', Object.values(PRESENCE_SIZE).includes(size) ? `${size}` : DEFAULTS.SIZE.toString());
|
94
|
+
}
|
107
95
|
/**
|
108
96
|
* Get the icon name based on the presence type
|
109
97
|
*/
|
@@ -131,11 +119,11 @@ class Presence extends Component {
|
|
131
119
|
}
|
132
120
|
render() {
|
133
121
|
return html `
|
134
|
-
<div
|
122
|
+
<div part="presence-content">
|
135
123
|
<mdc-icon
|
136
124
|
class="mdc-presence-icon mdc-presence-icon__${this.currentIconType}"
|
137
125
|
name="${this.icon}"
|
138
|
-
size="${this.
|
126
|
+
size="${getPresenceIconSize(this.size)}"
|
139
127
|
@load="${this.handleOnLoad}"
|
140
128
|
@error="${this.handleOnError}"
|
141
129
|
></mdc-icon>
|
@@ -149,8 +137,8 @@ __decorate([
|
|
149
137
|
__metadata("design:type", String)
|
150
138
|
], Presence.prototype, "type", void 0);
|
151
139
|
__decorate([
|
152
|
-
property({ type:
|
153
|
-
__metadata("design:type",
|
140
|
+
property({ type: Number, reflect: true }),
|
141
|
+
__metadata("design:type", Number)
|
154
142
|
], Presence.prototype, "size", void 0);
|
155
143
|
__decorate([
|
156
144
|
state(),
|
@@ -1,5 +1,5 @@
|
|
1
1
|
declare const TAG_NAME: "mdc-presence";
|
2
|
-
declare const
|
2
|
+
declare const PRESENCE_TYPE: {
|
3
3
|
readonly ACTIVE: "active";
|
4
4
|
readonly AWAY: "away";
|
5
5
|
readonly AWAY_CALLING: "away-calling";
|
@@ -15,17 +15,17 @@ declare const TYPE: {
|
|
15
15
|
readonly QUIET: "quiet";
|
16
16
|
readonly SCHEDULED: "scheduled";
|
17
17
|
};
|
18
|
-
declare const
|
19
|
-
readonly
|
20
|
-
readonly
|
21
|
-
readonly
|
22
|
-
readonly
|
23
|
-
readonly
|
24
|
-
readonly
|
25
|
-
readonly
|
18
|
+
declare const PRESENCE_SIZE: {
|
19
|
+
readonly 24: 24;
|
20
|
+
readonly 32: 32;
|
21
|
+
readonly 48: 48;
|
22
|
+
readonly 64: 64;
|
23
|
+
readonly 72: 72;
|
24
|
+
readonly 88: 88;
|
25
|
+
readonly 124: 124;
|
26
26
|
};
|
27
27
|
declare const DEFAULTS: {
|
28
28
|
readonly TYPE: "active";
|
29
|
-
readonly SIZE:
|
29
|
+
readonly SIZE: 32;
|
30
30
|
};
|
31
|
-
export { TAG_NAME, DEFAULTS,
|
31
|
+
export { TAG_NAME, DEFAULTS, PRESENCE_TYPE, PRESENCE_SIZE };
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import utils from '../../utils/tag-name';
|
2
2
|
const TAG_NAME = utils.constructTagName('presence');
|
3
|
-
const
|
3
|
+
const PRESENCE_TYPE = {
|
4
4
|
ACTIVE: 'active',
|
5
5
|
AWAY: 'away',
|
6
6
|
AWAY_CALLING: 'away-calling',
|
@@ -16,17 +16,17 @@ const TYPE = {
|
|
16
16
|
QUIET: 'quiet',
|
17
17
|
SCHEDULED: 'scheduled',
|
18
18
|
};
|
19
|
-
const
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
19
|
+
const PRESENCE_SIZE = {
|
20
|
+
24: 24,
|
21
|
+
32: 32,
|
22
|
+
48: 48,
|
23
|
+
64: 64,
|
24
|
+
72: 72,
|
25
|
+
88: 88,
|
26
|
+
124: 124,
|
27
27
|
};
|
28
28
|
const DEFAULTS = {
|
29
|
-
TYPE:
|
30
|
-
SIZE:
|
29
|
+
TYPE: PRESENCE_TYPE.ACTIVE,
|
30
|
+
SIZE: PRESENCE_SIZE[32],
|
31
31
|
};
|
32
|
-
export { TAG_NAME, DEFAULTS,
|
32
|
+
export { TAG_NAME, DEFAULTS, PRESENCE_TYPE, PRESENCE_SIZE };
|
@@ -21,32 +21,32 @@ const styles = [
|
|
21
21
|
--mdc-presence-overlay-background-color: var(--mds-color-theme-background-solid-primary-normal);
|
22
22
|
}
|
23
23
|
|
24
|
-
|
24
|
+
:host::part(presence-content) {
|
25
25
|
border-radius: 50%;
|
26
26
|
background-color: var(--mdc-presence-overlay-background-color);
|
27
27
|
display: flex;
|
28
28
|
justify-content: center;
|
29
29
|
align-items: center;
|
30
30
|
}
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
width: 1.
|
35
|
-
height: 1.
|
31
|
+
:host([size='24'])::part(presence-content),
|
32
|
+
:host([size='32'])::part(presence-content),
|
33
|
+
:host([size='48'])::part(presence-content) {
|
34
|
+
width: 1.125rem;
|
35
|
+
height: 1.125rem;
|
36
36
|
}
|
37
|
-
|
38
|
-
width: 1.
|
39
|
-
height: 1.
|
37
|
+
:host([size='64'])::part(presence-content) {
|
38
|
+
width: 1.5625rem;
|
39
|
+
height: 1.5625rem;
|
40
40
|
}
|
41
|
-
|
42
|
-
width: 1.
|
43
|
-
height: 1.
|
41
|
+
:host([size='72'])::part(presence-content) {
|
42
|
+
width: 1.75rem;
|
43
|
+
height: 1.75rem;
|
44
44
|
}
|
45
|
-
|
46
|
-
width:
|
47
|
-
height:
|
45
|
+
:host([size='88'])::part(presence-content) {
|
46
|
+
width: 2.125rem;
|
47
|
+
height: 2.125rem;
|
48
48
|
}
|
49
|
-
|
49
|
+
:host([size='124'])::part(presence-content) {
|
50
50
|
width: 2.75rem;
|
51
51
|
height: 2.75rem;
|
52
52
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { ValueOf } from '../../utils/types';
|
2
|
-
import {
|
3
|
-
type PresenceType = ValueOf<typeof
|
4
|
-
type PresenceSize = ValueOf<typeof
|
2
|
+
import { PRESENCE_TYPE, PRESENCE_SIZE } from './presence.constants';
|
3
|
+
type PresenceType = ValueOf<typeof PRESENCE_TYPE>;
|
4
|
+
type PresenceSize = ValueOf<typeof PRESENCE_SIZE>;
|
5
5
|
export type { PresenceType, PresenceSize };
|
@@ -1,2 +1,3 @@
|
|
1
|
-
import type { PresenceType } from './presence.types';
|
1
|
+
import type { PresenceSize, PresenceType } from './presence.types';
|
2
2
|
export declare const getIconValue: (type: PresenceType) => "active-presence-small-filled" | "away-calling-presence-filled" | "busy-presence-bold" | "camera-filled" | "dnd-presence-badge-filled" | "generic-device-video-badge-filled" | "handset-filled" | "meetings-presence-badge-filled" | "pause-badge-filled" | "phone-badge-filled" | "pto-presence-filled" | "quiet-hours-presence-filled" | "recents-presence-badge-filled" | "share-screen-badge-filled";
|
3
|
+
export declare const getPresenceIconSize: (size: PresenceSize) => number;
|
@@ -1,34 +1,46 @@
|
|
1
|
-
import {
|
1
|
+
import { PRESENCE_TYPE, PRESENCE_SIZE } from './presence.constants';
|
2
2
|
export const getIconValue = (type) => {
|
3
3
|
switch (type) {
|
4
|
-
case
|
4
|
+
case PRESENCE_TYPE.AWAY:
|
5
5
|
return 'recents-presence-badge-filled';
|
6
|
-
case
|
6
|
+
case PRESENCE_TYPE.AWAY_CALLING:
|
7
7
|
return 'away-calling-presence-filled';
|
8
|
-
case
|
8
|
+
case PRESENCE_TYPE.BUSY:
|
9
9
|
return 'busy-presence-bold';
|
10
|
-
case
|
10
|
+
case PRESENCE_TYPE.DND:
|
11
11
|
return 'dnd-presence-badge-filled';
|
12
|
-
case
|
12
|
+
case PRESENCE_TYPE.MEETING:
|
13
13
|
return 'camera-filled';
|
14
|
-
case
|
14
|
+
case PRESENCE_TYPE.ON_CALL:
|
15
15
|
return 'handset-filled';
|
16
|
-
case
|
16
|
+
case PRESENCE_TYPE.ON_DEVICE:
|
17
17
|
return 'generic-device-video-badge-filled';
|
18
|
-
case
|
18
|
+
case PRESENCE_TYPE.ON_MOBILE:
|
19
19
|
return 'phone-badge-filled';
|
20
|
-
case
|
20
|
+
case PRESENCE_TYPE.PAUSE:
|
21
21
|
return 'pause-badge-filled';
|
22
|
-
case
|
22
|
+
case PRESENCE_TYPE.PTO:
|
23
23
|
return 'pto-presence-filled';
|
24
|
-
case
|
24
|
+
case PRESENCE_TYPE.PRESENTING:
|
25
25
|
return 'share-screen-badge-filled';
|
26
|
-
case
|
26
|
+
case PRESENCE_TYPE.QUIET:
|
27
27
|
return 'quiet-hours-presence-filled';
|
28
|
-
case
|
28
|
+
case PRESENCE_TYPE.SCHEDULED:
|
29
29
|
return 'meetings-presence-badge-filled';
|
30
|
-
case
|
30
|
+
case PRESENCE_TYPE.ACTIVE:
|
31
31
|
default:
|
32
32
|
return 'active-presence-small-filled';
|
33
33
|
}
|
34
34
|
};
|
35
|
+
export const getPresenceIconSize = (size) => {
|
36
|
+
const presenceIconSizeMap = {
|
37
|
+
[PRESENCE_SIZE[124]]: 2.25,
|
38
|
+
[PRESENCE_SIZE[88]]: 1.625,
|
39
|
+
[PRESENCE_SIZE[72]]: 1.3125,
|
40
|
+
[PRESENCE_SIZE[64]]: 1.1875,
|
41
|
+
[PRESENCE_SIZE[48]]: 0.875,
|
42
|
+
[PRESENCE_SIZE[32]]: 0.875,
|
43
|
+
[PRESENCE_SIZE[24]]: 0.875,
|
44
|
+
};
|
45
|
+
return presenceIconSizeMap[size] || 0.875; // default size of icon
|
46
|
+
};
|
@@ -6873,6 +6873,14 @@
|
|
6873
6873
|
}
|
6874
6874
|
],
|
6875
6875
|
"events": [
|
6876
|
+
{
|
6877
|
+
"name": "change",
|
6878
|
+
"type": {
|
6879
|
+
"text": "Event"
|
6880
|
+
},
|
6881
|
+
"description": "(React: onChange) Event that gets dispatched when the card's checked state changes.",
|
6882
|
+
"reactName": "onChange"
|
6883
|
+
},
|
6876
6884
|
{
|
6877
6885
|
"description": "(React: onClick) Event that gets dispatched when the card is clicked. It toggles the checked state.",
|
6878
6886
|
"name": "click",
|
@@ -7071,7 +7079,7 @@
|
|
7071
7079
|
"module": "/src/components/card/card.component"
|
7072
7080
|
},
|
7073
7081
|
"tagName": "mdc-cardcheckbox",
|
7074
|
-
"jsDoc": "/**\n * cardcheckbox component extends `mdc-card` and supports checkbox selection interaction addtionally.\n *\n * While using this component within a form or group of cards, make sure cards are in a role = \"checkbox-group\".\n * This card would have events for selected and unselected (similar to checkbox)\n *\n * **Note**: This is a single selection card i.e. interacting anywhere on the card would toggle the checked state.\n * Make sure to pass only non-interactable elements within the slots.\n *\n * Make sure to pass the `card-title` mandatorily for this card.\n *\n * @tagname mdc-cardcheckbox\n *\n * @dependency mdc-icon\n * @dependency mdc-staticcheckbox\n * @dependency mdc-text\n *\n * @slot before-body - This slot is for passing the content before the body\n * @slot body - This slot is for passing the text content for the card\n * @slot after-body - This slot is for passing the content after the body\n * @slot footer-link - This slot is for passing `mdc-link` component within the footer section.\n * @slot footer-button-primary - This slot is for passing primary variant of `mdc-button` component within the footer section.\n *\n * @csspart header - The header part of the card\n * @csspart icon - The icon part of the card header\n * @csspart body - The body part of the card\n * @csspart image - The image part of the card\n * @csspart footer - The footer part of the card\n * @csspart footer-link - The link part of the card footer\n * @csspart footer-button-primary - The primary button part of the card footer\n * @csspart footer-button-secondary - The secondary button part of the card footer\n * @csspart icon-button - The icon button part of the card header\n * @csspart text - The text part of the card\n * @csspart check - The check part of the card\n * @csspart check-icon - The check icon part of the card\n * @csspart check-icon-button - The check icon button part of the card\n *\n * @cssproperty --mdc-card-width - The width of the card\n *\n * @event click - (React: onClick) Event that gets dispatched when the card is clicked. It toggles the checked state.\n * @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the card.\n * It toggles the checked state when enter key is used.\n * @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the card.\n * It toggles the checked state when space key is used.\n * @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.\n
|
7082
|
+
"jsDoc": "/**\n * cardcheckbox component extends `mdc-card` and supports checkbox selection interaction addtionally.\n *\n * While using this component within a form or group of cards, make sure cards are in a role = \"checkbox-group\".\n * This card would have events for selected and unselected (similar to checkbox)\n *\n * **Note**: This is a single selection card i.e. interacting anywhere on the card would toggle the checked state.\n * Make sure to pass only non-interactable elements within the slots.\n *\n * Make sure to pass the `card-title` mandatorily for this card.\n *\n * @tagname mdc-cardcheckbox\n *\n * @dependency mdc-icon\n * @dependency mdc-staticcheckbox\n * @dependency mdc-text\n *\n * @slot before-body - This slot is for passing the content before the body\n * @slot body - This slot is for passing the text content for the card\n * @slot after-body - This slot is for passing the content after the body\n * @slot footer-link - This slot is for passing `mdc-link` component within the footer section.\n * @slot footer-button-primary - This slot is for passing primary variant of `mdc-button` component within the footer section.\n *\n * @csspart header - The header part of the card\n * @csspart icon - The icon part of the card header\n * @csspart body - The body part of the card\n * @csspart image - The image part of the card\n * @csspart footer - The footer part of the card\n * @csspart footer-link - The link part of the card footer\n * @csspart footer-button-primary - The primary button part of the card footer\n * @csspart footer-button-secondary - The secondary button part of the card footer\n * @csspart icon-button - The icon button part of the card header\n * @csspart text - The text part of the card\n * @csspart check - The check part of the card\n * @csspart check-icon - The check icon part of the card\n * @csspart check-icon-button - The check icon button part of the card\n *\n * @cssproperty --mdc-card-width - The width of the card\n *\n * @event click - (React: onClick) Event that gets dispatched when the card is clicked. It toggles the checked state.\n * @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the card.\n * It toggles the checked state when enter key is used.\n * @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the card.\n * It toggles the checked state when space key is used.\n * @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.\n * @event change - (React: onChange) Event that gets dispatched when the card's checked state changes.\n */",
|
7075
7083
|
"customElement": true
|
7076
7084
|
}
|
7077
7085
|
],
|
@@ -7612,6 +7620,14 @@
|
|
7612
7620
|
}
|
7613
7621
|
],
|
7614
7622
|
"events": [
|
7623
|
+
{
|
7624
|
+
"name": "change",
|
7625
|
+
"type": {
|
7626
|
+
"text": "Event"
|
7627
|
+
},
|
7628
|
+
"description": "(React: onChange) Event that gets dispatched when the card's checked state changes.",
|
7629
|
+
"reactName": "onChange"
|
7630
|
+
},
|
7615
7631
|
{
|
7616
7632
|
"description": "(React: onClick) Event that gets dispatched when the card is clicked. It toggles the checked state.",
|
7617
7633
|
"name": "click",
|
@@ -7810,7 +7826,7 @@
|
|
7810
7826
|
"module": "/src/components/card/card.component"
|
7811
7827
|
},
|
7812
7828
|
"tagName": "mdc-cardradio",
|
7813
|
-
"jsDoc": "/**\n * cardradio component extends `mdc-card` and supports radio selection interaction addtionally.\n *\n * While using this component within a form or group of cards, make sure cards are in a role = \"radio-group\".\n * This card would have events for selected and unselected (similar to radio)\n *\n * **Note**: This is a single selection card i.e. interacting anywhere on the card would toggle the checked state.\n * Make sure to pass only non-interactable elements within the slots.\n *\n * Make sure to pass the `card-title` mandatorily for this card.\n *\n * @tagname mdc-cardradio\n *\n * @dependency mdc-icon\n * @dependency mdc-staticradio\n * @dependency mdc-text\n *\n * @slot before-body - This slot is for passing the content before the body\n * @slot body - This slot is for passing the text content for the card\n * @slot after-body - This slot is for passing the content after the body\n * @slot footer-link - This slot is for passing `mdc-link` component within the footer section.\n * @slot footer-button-primary - This slot is for passing primary variant of `mdc-button` component within the footer section.\n *\n * @csspart header - The header part of the card\n * @csspart icon - The icon part of the card header\n * @csspart body - The body part of the card\n * @csspart image - The image part of the card\n * @csspart footer - The footer part of the card\n * @csspart footer-link - The link part of the card footer\n * @csspart footer-button-primary - The primary button part of the card footer\n * @csspart footer-button-secondary - The secondary button part of the card footer\n * @csspart icon-button - The icon button part of the card header\n * @csspart text - The text part of the card\n * @csspart check - The check part of the card\n * @csspart check-icon - The check icon part of the card\n * @csspart check-icon-button - The check icon button part of the card\n *\n * @cssproperty --mdc-card-width - The width of the card\n *\n * @event click - (React: onClick) Event that gets dispatched when the card is clicked. It toggles the checked state.\n * @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the card.\n * It toggles the checked state when enter key is used.\n * @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the card.\n * It toggles the checked state when space key is used.\n * @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.\n
|
7829
|
+
"jsDoc": "/**\n * cardradio component extends `mdc-card` and supports radio selection interaction addtionally.\n *\n * While using this component within a form or group of cards, make sure cards are in a role = \"radio-group\".\n * This card would have events for selected and unselected (similar to radio)\n *\n * **Note**: This is a single selection card i.e. interacting anywhere on the card would toggle the checked state.\n * Make sure to pass only non-interactable elements within the slots.\n *\n * Make sure to pass the `card-title` mandatorily for this card.\n *\n * @tagname mdc-cardradio\n *\n * @dependency mdc-icon\n * @dependency mdc-staticradio\n * @dependency mdc-text\n *\n * @slot before-body - This slot is for passing the content before the body\n * @slot body - This slot is for passing the text content for the card\n * @slot after-body - This slot is for passing the content after the body\n * @slot footer-link - This slot is for passing `mdc-link` component within the footer section.\n * @slot footer-button-primary - This slot is for passing primary variant of `mdc-button` component within the footer section.\n *\n * @csspart header - The header part of the card\n * @csspart icon - The icon part of the card header\n * @csspart body - The body part of the card\n * @csspart image - The image part of the card\n * @csspart footer - The footer part of the card\n * @csspart footer-link - The link part of the card footer\n * @csspart footer-button-primary - The primary button part of the card footer\n * @csspart footer-button-secondary - The secondary button part of the card footer\n * @csspart icon-button - The icon button part of the card header\n * @csspart text - The text part of the card\n * @csspart check - The check part of the card\n * @csspart check-icon - The check icon part of the card\n * @csspart check-icon-button - The check icon button part of the card\n *\n * @cssproperty --mdc-card-width - The width of the card\n *\n * @event click - (React: onClick) Event that gets dispatched when the card is clicked. It toggles the checked state.\n * @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the card.\n * It toggles the checked state when enter key is used.\n * @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the card.\n * It toggles the checked state when space key is used.\n * @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.\n * @event change - (React: onChange) Event that gets dispatched when the card's checked state changes.\n */",
|
7814
7830
|
"customElement": true
|
7815
7831
|
}
|
7816
7832
|
],
|
@@ -28413,17 +28429,28 @@
|
|
28413
28429
|
"type": {
|
28414
28430
|
"text": "PresenceSize"
|
28415
28431
|
},
|
28416
|
-
"description": "Acceptable values include:\n-
|
28417
|
-
"default": "
|
28432
|
+
"description": "Acceptable numeric values include:\n- 24\n- 32\n- 48\n- 64\n- 72\n- 88\n- 124\n\nPresence icons are minimum 14px in size, meaning 24, 32, and 48 presence\nicons will be no smaller than 14px (for sizes 24, 32, 48).",
|
28433
|
+
"default": "32",
|
28418
28434
|
"attribute": "size",
|
28419
28435
|
"reflects": true
|
28420
28436
|
},
|
28421
28437
|
{
|
28422
|
-
"kind": "
|
28423
|
-
"name": "
|
28438
|
+
"kind": "method",
|
28439
|
+
"name": "setSize",
|
28424
28440
|
"privacy": "private",
|
28425
|
-
"
|
28426
|
-
|
28441
|
+
"return": {
|
28442
|
+
"type": {
|
28443
|
+
"text": "void"
|
28444
|
+
}
|
28445
|
+
},
|
28446
|
+
"parameters": [
|
28447
|
+
{
|
28448
|
+
"name": "size",
|
28449
|
+
"type": {
|
28450
|
+
"text": "PresenceSize"
|
28451
|
+
}
|
28452
|
+
}
|
28453
|
+
]
|
28427
28454
|
},
|
28428
28455
|
{
|
28429
28456
|
"kind": "field",
|
@@ -28470,8 +28497,8 @@
|
|
28470
28497
|
"type": {
|
28471
28498
|
"text": "PresenceSize"
|
28472
28499
|
},
|
28473
|
-
"description": "Acceptable values include:\n-
|
28474
|
-
"default": "
|
28500
|
+
"description": "Acceptable numeric values include:\n- 24\n- 32\n- 48\n- 64\n- 72\n- 88\n- 124\n\nPresence icons are minimum 14px in size, meaning 24, 32, and 48 presence\nicons will be no smaller than 14px (for sizes 24, 32, 48).",
|
28501
|
+
"default": "32",
|
28475
28502
|
"fieldName": "size"
|
28476
28503
|
}
|
28477
28504
|
],
|
@@ -45,9 +45,12 @@ import Component from '../../components/cardcheckbox';
|
|
45
45
|
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the card.
|
46
46
|
* It toggles the checked state when space key is used.
|
47
47
|
* @event focus - (React: onFocus) Event that gets dispatched when the card receives focus.
|
48
|
-
*
|
48
|
+
* @event change - (React: onChange) Event that gets dispatched when the card's checked state changes.
|
49
49
|
*/
|
50
50
|
declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {
|
51
|
+
onChange: EventName<CustomEvent<unknown> & {
|
52
|
+
target: Component;
|
53
|
+
}>;
|
51
54
|
onClick: EventName<import("../../utils/types").OverrideEventTarget<MouseEvent, Component>>;
|
52
55
|
onKeyDown: EventName<import("../../utils/types").OverrideEventTarget<KeyboardEvent, Component>>;
|
53
56
|
onKeyUp: EventName<import("../../utils/types").OverrideEventTarget<KeyboardEvent, Component>>;
|