@momentum-design/components 0.129.20 → 0.129.21
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 +2 -2
- package/dist/browser/index.js.map +3 -3
- package/dist/components/alertchip/alertchip.component.d.ts +7 -7
- package/dist/components/alertchip/alertchip.component.js +7 -14
- package/dist/components/alertchip/alertchip.constants.js +2 -1
- package/dist/components/alertchip/alertchip.types.d.ts +1 -1
- package/dist/components/alertchip/alertchip.utils.js +2 -2
- package/dist/custom-elements.json +14 -16
- package/dist/react/alertchip/index.d.ts +5 -5
- package/dist/react/alertchip/index.js +5 -5
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ declare const AlertChip_base: import("../../utils/mixins/index.types").Construct
|
|
|
6
6
|
* mdc-alertchip component is an interactive chip that consumers can use to represent an alert.
|
|
7
7
|
*
|
|
8
8
|
* - It supports a leading icon along with label.
|
|
9
|
-
* - It supports 5 variants of alerts -
|
|
9
|
+
* - It supports 5 variants of alerts - error, informational, neutral, success and warning.
|
|
10
10
|
*
|
|
11
11
|
* This component is built by extending Buttonsimple.
|
|
12
12
|
*
|
|
@@ -23,18 +23,18 @@ declare const AlertChip_base: import("../../utils/mixins/index.types").Construct
|
|
|
23
23
|
* @csspart icon - The alert icon
|
|
24
24
|
* @csspart label - The text label of the alertchip
|
|
25
25
|
*
|
|
26
|
-
* @event click - (React: onClick) This event is dispatched when the
|
|
27
|
-
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the
|
|
28
|
-
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the
|
|
29
|
-
* @event focus - (React: onFocus) This event is dispatched when the
|
|
26
|
+
* @event click - (React: onClick) This event is dispatched when the alertchip is clicked.
|
|
27
|
+
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the alertchip.
|
|
28
|
+
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the alertchip.
|
|
29
|
+
* @event focus - (React: onFocus) This event is dispatched when the alertchip receives focus.
|
|
30
30
|
*/
|
|
31
31
|
declare class AlertChip extends AlertChip_base {
|
|
32
32
|
/**
|
|
33
33
|
* The variant of the alertchip. It supports 5 variants
|
|
34
34
|
* - neutral
|
|
35
|
-
* - warning
|
|
36
35
|
* - error
|
|
37
36
|
* - success
|
|
37
|
+
* - warning
|
|
38
38
|
* - informational
|
|
39
39
|
*
|
|
40
40
|
* @default neutral
|
|
@@ -46,7 +46,7 @@ declare class AlertChip extends AlertChip_base {
|
|
|
46
46
|
* We recommend limiting the <b>maximum length of the label text to 20 characters</b>,
|
|
47
47
|
* including empty spaces to split words.
|
|
48
48
|
*/
|
|
49
|
-
label
|
|
49
|
+
label?: string;
|
|
50
50
|
connectedCallback(): void;
|
|
51
51
|
render(): import("lit-html").TemplateResult<1>;
|
|
52
52
|
static styles: Array<CSSResult>;
|
|
@@ -19,7 +19,7 @@ import { getAlertIcon } from './alertchip.utils';
|
|
|
19
19
|
* mdc-alertchip component is an interactive chip that consumers can use to represent an alert.
|
|
20
20
|
*
|
|
21
21
|
* - It supports a leading icon along with label.
|
|
22
|
-
* - It supports 5 variants of alerts -
|
|
22
|
+
* - It supports 5 variants of alerts - error, informational, neutral, success and warning.
|
|
23
23
|
*
|
|
24
24
|
* This component is built by extending Buttonsimple.
|
|
25
25
|
*
|
|
@@ -36,10 +36,10 @@ import { getAlertIcon } from './alertchip.utils';
|
|
|
36
36
|
* @csspart icon - The alert icon
|
|
37
37
|
* @csspart label - The text label of the alertchip
|
|
38
38
|
*
|
|
39
|
-
* @event click - (React: onClick) This event is dispatched when the
|
|
40
|
-
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the
|
|
41
|
-
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the
|
|
42
|
-
* @event focus - (React: onFocus) This event is dispatched when the
|
|
39
|
+
* @event click - (React: onClick) This event is dispatched when the alertchip is clicked.
|
|
40
|
+
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the alertchip.
|
|
41
|
+
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the alertchip.
|
|
42
|
+
* @event focus - (React: onFocus) This event is dispatched when the alertchip receives focus.
|
|
43
43
|
*/
|
|
44
44
|
class AlertChip extends IconNameMixin(Buttonsimple) {
|
|
45
45
|
constructor() {
|
|
@@ -47,21 +47,14 @@ class AlertChip extends IconNameMixin(Buttonsimple) {
|
|
|
47
47
|
/**
|
|
48
48
|
* The variant of the alertchip. It supports 5 variants
|
|
49
49
|
* - neutral
|
|
50
|
-
* - warning
|
|
51
50
|
* - error
|
|
52
51
|
* - success
|
|
52
|
+
* - warning
|
|
53
53
|
* - informational
|
|
54
54
|
*
|
|
55
55
|
* @default neutral
|
|
56
56
|
*/
|
|
57
57
|
this.variant = DEFAULTS.VARIANT;
|
|
58
|
-
/**
|
|
59
|
-
* The visible label text of the alertchip.
|
|
60
|
-
*
|
|
61
|
-
* We recommend limiting the <b>maximum length of the label text to 20 characters</b>,
|
|
62
|
-
* including empty spaces to split words.
|
|
63
|
-
*/
|
|
64
|
-
this.label = '';
|
|
65
58
|
}
|
|
66
59
|
connectedCallback() {
|
|
67
60
|
super.connectedCallback();
|
|
@@ -89,6 +82,6 @@ __decorate([
|
|
|
89
82
|
], AlertChip.prototype, "variant", void 0);
|
|
90
83
|
__decorate([
|
|
91
84
|
property({ type: String }),
|
|
92
|
-
__metadata("design:type",
|
|
85
|
+
__metadata("design:type", String)
|
|
93
86
|
], AlertChip.prototype, "label", void 0);
|
|
94
87
|
export default AlertChip;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ROLE } from '../../utils/roles';
|
|
1
2
|
import utils from '../../utils/tag-name';
|
|
2
3
|
import { BUTTON_SIZES } from '../buttonsimple/buttonsimple.constants';
|
|
3
4
|
import { TYPE, VALID_TEXT_TAGS } from '../text/text.constants';
|
|
@@ -14,6 +15,6 @@ const DEFAULTS = {
|
|
|
14
15
|
TEXT_TYPE: TYPE.BODY_MIDSIZE_REGULAR,
|
|
15
16
|
TAG_NAME: VALID_TEXT_TAGS.SPAN,
|
|
16
17
|
SIZE: BUTTON_SIZES[24],
|
|
17
|
-
ROLE:
|
|
18
|
+
ROLE: ROLE.BUTTON,
|
|
18
19
|
};
|
|
19
20
|
export { DEFAULTS, TAG_NAME, VARIANTS };
|
|
@@ -3,7 +3,7 @@ import type { IconNames } from '../icon/icon.types';
|
|
|
3
3
|
import type AlertChip from './alertchip.component';
|
|
4
4
|
import { VARIANTS } from './alertchip.constants';
|
|
5
5
|
type VariantType = ValueOf<typeof VARIANTS>;
|
|
6
|
-
type IconListType = Extract<IconNames, 'error-legacy-badge-filled' | '
|
|
6
|
+
type IconListType = Extract<IconNames, 'error-legacy-badge-filled' | 'info-badge-filled' | 'dnd-presence-badge-filled' | 'check-circle-badge-filled' | 'warning-badge-filled'>;
|
|
7
7
|
interface Events {
|
|
8
8
|
onClickEvent: OverrideEventTarget<MouseEvent, AlertChip>;
|
|
9
9
|
onKeyDownEvent: OverrideEventTarget<KeyboardEvent, AlertChip>;
|
|
@@ -2,10 +2,10 @@ import { VARIANTS } from './alertchip.constants';
|
|
|
2
2
|
const getAlertIcon = (type) => {
|
|
3
3
|
const alertIcon = {
|
|
4
4
|
[VARIANTS.ERROR]: 'error-legacy-badge-filled',
|
|
5
|
-
[VARIANTS.WARNING]: 'warning-badge-filled',
|
|
6
|
-
[VARIANTS.SUCCESS]: 'check-circle-badge-filled',
|
|
7
5
|
[VARIANTS.INFORMATIONAL]: 'info-badge-filled',
|
|
8
6
|
[VARIANTS.NEUTRAL]: 'dnd-presence-badge-filled',
|
|
7
|
+
[VARIANTS.SUCCESS]: 'check-circle-badge-filled',
|
|
8
|
+
[VARIANTS.WARNING]: 'warning-badge-filled',
|
|
9
9
|
};
|
|
10
10
|
return alertIcon[type];
|
|
11
11
|
};
|
|
@@ -153,8 +153,8 @@
|
|
|
153
153
|
"attribute": "disabled",
|
|
154
154
|
"reflects": true,
|
|
155
155
|
"inheritedFrom": {
|
|
156
|
-
"name": "
|
|
157
|
-
"module": "
|
|
156
|
+
"name": "DisabledMixin",
|
|
157
|
+
"module": "utils/mixins/DisabledMixin.js"
|
|
158
158
|
}
|
|
159
159
|
},
|
|
160
160
|
{
|
|
@@ -412,8 +412,8 @@
|
|
|
412
412
|
"default": "undefined",
|
|
413
413
|
"fieldName": "disabled",
|
|
414
414
|
"inheritedFrom": {
|
|
415
|
-
"name": "
|
|
416
|
-
"module": "src/
|
|
415
|
+
"name": "DisabledMixin",
|
|
416
|
+
"module": "src/utils/mixins/DisabledMixin.ts"
|
|
417
417
|
}
|
|
418
418
|
},
|
|
419
419
|
{
|
|
@@ -1010,7 +1010,7 @@
|
|
|
1010
1010
|
"declarations": [
|
|
1011
1011
|
{
|
|
1012
1012
|
"kind": "class",
|
|
1013
|
-
"description": "mdc-alertchip component is an interactive chip that consumers can use to represent an alert.\n\n- It supports a leading icon along with label.\n- It supports 5 variants of alerts -
|
|
1013
|
+
"description": "mdc-alertchip component is an interactive chip that consumers can use to represent an alert.\n\n- It supports a leading icon along with label.\n- It supports 5 variants of alerts - error, informational, neutral, success and warning.\n\nThis component is built by extending Buttonsimple.",
|
|
1014
1014
|
"name": "AlertChip",
|
|
1015
1015
|
"cssProperties": [
|
|
1016
1016
|
{
|
|
@@ -1207,9 +1207,8 @@
|
|
|
1207
1207
|
"kind": "field",
|
|
1208
1208
|
"name": "label",
|
|
1209
1209
|
"type": {
|
|
1210
|
-
"text": "string"
|
|
1210
|
+
"text": "string | undefined"
|
|
1211
1211
|
},
|
|
1212
|
-
"default": "''",
|
|
1213
1212
|
"description": "The visible label text of the alertchip.\n\nWe recommend limiting the <b>maximum length of the label text to 20 characters</b>,\nincluding empty spaces to split words.",
|
|
1214
1213
|
"attribute": "label"
|
|
1215
1214
|
},
|
|
@@ -1411,7 +1410,7 @@
|
|
|
1411
1410
|
"type": {
|
|
1412
1411
|
"text": "VariantType"
|
|
1413
1412
|
},
|
|
1414
|
-
"description": "The variant of the alertchip. It supports 5 variants\n- neutral\n-
|
|
1413
|
+
"description": "The variant of the alertchip. It supports 5 variants\n- neutral\n- error\n- success\n- warning\n- informational",
|
|
1415
1414
|
"default": "neutral",
|
|
1416
1415
|
"attribute": "variant",
|
|
1417
1416
|
"reflects": true
|
|
@@ -1419,7 +1418,7 @@
|
|
|
1419
1418
|
],
|
|
1420
1419
|
"events": [
|
|
1421
1420
|
{
|
|
1422
|
-
"description": "(React: onClick) This event is dispatched when the
|
|
1421
|
+
"description": "(React: onClick) This event is dispatched when the alertchip is clicked.",
|
|
1423
1422
|
"name": "click",
|
|
1424
1423
|
"reactName": "onClick",
|
|
1425
1424
|
"inheritedFrom": {
|
|
@@ -1428,7 +1427,7 @@
|
|
|
1428
1427
|
}
|
|
1429
1428
|
},
|
|
1430
1429
|
{
|
|
1431
|
-
"description": "(React: onKeyDown) This event is dispatched when a key is pressed down on the
|
|
1430
|
+
"description": "(React: onKeyDown) This event is dispatched when a key is pressed down on the alertchip.",
|
|
1432
1431
|
"name": "keydown",
|
|
1433
1432
|
"reactName": "onKeyDown",
|
|
1434
1433
|
"inheritedFrom": {
|
|
@@ -1437,7 +1436,7 @@
|
|
|
1437
1436
|
}
|
|
1438
1437
|
},
|
|
1439
1438
|
{
|
|
1440
|
-
"description": "(React: onKeyUp) This event is dispatched when a key is released on the
|
|
1439
|
+
"description": "(React: onKeyUp) This event is dispatched when a key is released on the alertchip.",
|
|
1441
1440
|
"name": "keyup",
|
|
1442
1441
|
"reactName": "onKeyUp",
|
|
1443
1442
|
"inheritedFrom": {
|
|
@@ -1446,7 +1445,7 @@
|
|
|
1446
1445
|
}
|
|
1447
1446
|
},
|
|
1448
1447
|
{
|
|
1449
|
-
"description": "(React: onFocus) This event is dispatched when the
|
|
1448
|
+
"description": "(React: onFocus) This event is dispatched when the alertchip receives focus.",
|
|
1450
1449
|
"name": "focus",
|
|
1451
1450
|
"reactName": "onFocus",
|
|
1452
1451
|
"inheritedFrom": {
|
|
@@ -1461,16 +1460,15 @@
|
|
|
1461
1460
|
"type": {
|
|
1462
1461
|
"text": "VariantType"
|
|
1463
1462
|
},
|
|
1464
|
-
"description": "The variant of the alertchip. It supports 5 variants\n- neutral\n-
|
|
1463
|
+
"description": "The variant of the alertchip. It supports 5 variants\n- neutral\n- error\n- success\n- warning\n- informational",
|
|
1465
1464
|
"default": "neutral",
|
|
1466
1465
|
"fieldName": "variant"
|
|
1467
1466
|
},
|
|
1468
1467
|
{
|
|
1469
1468
|
"name": "label",
|
|
1470
1469
|
"type": {
|
|
1471
|
-
"text": "string"
|
|
1470
|
+
"text": "string | undefined"
|
|
1472
1471
|
},
|
|
1473
|
-
"default": "''",
|
|
1474
1472
|
"description": "The visible label text of the alertchip.\n\nWe recommend limiting the <b>maximum length of the label text to 20 characters</b>,\nincluding empty spaces to split words.",
|
|
1475
1473
|
"fieldName": "label"
|
|
1476
1474
|
},
|
|
@@ -1639,7 +1637,7 @@
|
|
|
1639
1637
|
"module": "/src/components/buttonsimple/buttonsimple.component"
|
|
1640
1638
|
},
|
|
1641
1639
|
"tagName": "mdc-alertchip",
|
|
1642
|
-
"jsDoc": "/**\n * mdc-alertchip component is an interactive chip that consumers can use to represent an alert.\n *\n * - It supports a leading icon along with label.\n * - It supports 5 variants of alerts -
|
|
1640
|
+
"jsDoc": "/**\n * mdc-alertchip component is an interactive chip that consumers can use to represent an alert.\n *\n * - It supports a leading icon along with label.\n * - It supports 5 variants of alerts - error, informational, neutral, success and warning.\n *\n * This component is built by extending Buttonsimple.\n *\n * @tagname mdc-alertchip\n *\n * @dependency mdc-icon\n * @dependency mdc-text\n *\n * @cssproperty --mdc-chip-color - The color of the label text\n * @cssproperty --mdc-chip-icon-color - The color of the icon\n * @cssproperty --mdc-chip-border-color - The border color of the alertchip\n * @cssproperty --mdc-chip-background-color - The background color of the alertchip\n *\n * @csspart icon - The alert icon\n * @csspart label - The text label of the alertchip\n *\n * @event click - (React: onClick) This event is dispatched when the alertchip is clicked.\n * @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the alertchip.\n * @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the alertchip.\n * @event focus - (React: onFocus) This event is dispatched when the alertchip receives focus.\n */",
|
|
1643
1641
|
"customElement": true,
|
|
1644
1642
|
"slots": [
|
|
1645
1643
|
{
|
|
@@ -5,7 +5,7 @@ import type { Events as EventsInherited } from '../../components/buttonsimple/bu
|
|
|
5
5
|
* mdc-alertchip component is an interactive chip that consumers can use to represent an alert.
|
|
6
6
|
*
|
|
7
7
|
* - It supports a leading icon along with label.
|
|
8
|
-
* - It supports 5 variants of alerts -
|
|
8
|
+
* - It supports 5 variants of alerts - error, informational, neutral, success and warning.
|
|
9
9
|
*
|
|
10
10
|
* This component is built by extending Buttonsimple.
|
|
11
11
|
*
|
|
@@ -22,10 +22,10 @@ import type { Events as EventsInherited } from '../../components/buttonsimple/bu
|
|
|
22
22
|
* @csspart icon - The alert icon
|
|
23
23
|
* @csspart label - The text label of the alertchip
|
|
24
24
|
*
|
|
25
|
-
* @event click - (React: onClick) This event is dispatched when the
|
|
26
|
-
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the
|
|
27
|
-
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the
|
|
28
|
-
* @event focus - (React: onFocus) This event is dispatched when the
|
|
25
|
+
* @event click - (React: onClick) This event is dispatched when the alertchip is clicked.
|
|
26
|
+
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the alertchip.
|
|
27
|
+
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the alertchip.
|
|
28
|
+
* @event focus - (React: onFocus) This event is dispatched when the alertchip receives focus.
|
|
29
29
|
*/
|
|
30
30
|
declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {
|
|
31
31
|
onClick: EventName<EventsInherited["onClickEvent"]>;
|
|
@@ -6,7 +6,7 @@ import { TAG_NAME } from '../../components/alertchip/alertchip.constants';
|
|
|
6
6
|
* mdc-alertchip component is an interactive chip that consumers can use to represent an alert.
|
|
7
7
|
*
|
|
8
8
|
* - It supports a leading icon along with label.
|
|
9
|
-
* - It supports 5 variants of alerts -
|
|
9
|
+
* - It supports 5 variants of alerts - error, informational, neutral, success and warning.
|
|
10
10
|
*
|
|
11
11
|
* This component is built by extending Buttonsimple.
|
|
12
12
|
*
|
|
@@ -23,10 +23,10 @@ import { TAG_NAME } from '../../components/alertchip/alertchip.constants';
|
|
|
23
23
|
* @csspart icon - The alert icon
|
|
24
24
|
* @csspart label - The text label of the alertchip
|
|
25
25
|
*
|
|
26
|
-
* @event click - (React: onClick) This event is dispatched when the
|
|
27
|
-
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the
|
|
28
|
-
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the
|
|
29
|
-
* @event focus - (React: onFocus) This event is dispatched when the
|
|
26
|
+
* @event click - (React: onClick) This event is dispatched when the alertchip is clicked.
|
|
27
|
+
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the alertchip.
|
|
28
|
+
* @event keyup - (React: onKeyUp) This event is dispatched when a key is released on the alertchip.
|
|
29
|
+
* @event focus - (React: onFocus) This event is dispatched when the alertchip receives focus.
|
|
30
30
|
*/
|
|
31
31
|
const reactWrapper = createComponent({
|
|
32
32
|
tagName: TAG_NAME,
|