@momentum-design/components 0.129.19 → 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 +204 -204
- package/dist/browser/index.js.map +4 -4
- 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/components/formfieldwrapper/formfieldwrapper.component.d.ts +5 -0
- package/dist/components/formfieldwrapper/formfieldwrapper.component.js +5 -0
- package/dist/components/formfieldwrapper/formfieldwrapper.constants.d.ts +1 -1
- package/dist/components/formfieldwrapper/formfieldwrapper.constants.js +3 -2
- package/dist/components/select/select.component.d.ts +2 -2
- package/dist/components/select/select.component.js +2 -2
- package/dist/custom-elements.json +102 -16
- package/dist/react/alertchip/index.d.ts +5 -5
- package/dist/react/alertchip/index.js +5 -5
- package/dist/react/select/index.d.ts +2 -2
- package/dist/react/select/index.js +2 -2
- 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
|
};
|
|
@@ -58,6 +58,7 @@ declare class FormfieldWrapper extends FormfieldWrapper_base {
|
|
|
58
58
|
required: boolean;
|
|
59
59
|
/**
|
|
60
60
|
* The type of help text. It can be 'default', 'error', 'warning', 'success', 'priority'.
|
|
61
|
+
* @default 'default'
|
|
61
62
|
*/
|
|
62
63
|
helpTextType: ValidationType;
|
|
63
64
|
/**
|
|
@@ -74,6 +75,10 @@ declare class FormfieldWrapper extends FormfieldWrapper_base {
|
|
|
74
75
|
* @default 'top'
|
|
75
76
|
*/
|
|
76
77
|
toggletipPlacement: PopoverPlacement;
|
|
78
|
+
/**
|
|
79
|
+
* The strategy of the toggletip that is displayed when the info icon is hovered.
|
|
80
|
+
* @default 'absolute'
|
|
81
|
+
*/
|
|
77
82
|
toggletipStrategy: PopoverStrategy;
|
|
78
83
|
/**
|
|
79
84
|
* Aria label for the info icon that is displayed next to the label when `toggletipText` is set.
|
|
@@ -70,6 +70,7 @@ class FormfieldWrapper extends DisabledMixin(Component) {
|
|
|
70
70
|
this.required = false;
|
|
71
71
|
/**
|
|
72
72
|
* The type of help text. It can be 'default', 'error', 'warning', 'success', 'priority'.
|
|
73
|
+
* @default 'default'
|
|
73
74
|
*/
|
|
74
75
|
this.helpTextType = DEFAULTS.VALIDATION;
|
|
75
76
|
/**
|
|
@@ -77,6 +78,10 @@ class FormfieldWrapper extends DisabledMixin(Component) {
|
|
|
77
78
|
* @default 'top'
|
|
78
79
|
*/
|
|
79
80
|
this.toggletipPlacement = DEFAULTS.TOGGLETIP_PLACEMENT;
|
|
81
|
+
/**
|
|
82
|
+
* The strategy of the toggletip that is displayed when the info icon is hovered.
|
|
83
|
+
* @default 'absolute'
|
|
84
|
+
*/
|
|
80
85
|
this.toggletipStrategy = DEFAULTS.TOGGLETIP_STRATEGY;
|
|
81
86
|
/**
|
|
82
87
|
* Determines whether the form field is read-only.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import utils from '../../utils/tag-name';
|
|
2
|
+
import { POPOVER_PLACEMENT, STRATEGY } from '../popover/popover.constants';
|
|
2
3
|
import { TYPE, VALID_TEXT_TAGS } from '../text/text.constants';
|
|
3
4
|
const TAG_NAME = utils.constructTagName('formfieldwrapper');
|
|
4
5
|
const VALIDATION = {
|
|
@@ -14,8 +15,8 @@ const DEFAULTS = {
|
|
|
14
15
|
HEADING_ID: 'heading-id',
|
|
15
16
|
ICON_SIZE: 20,
|
|
16
17
|
INFO_ICON: 'info-badge-filled',
|
|
17
|
-
TOGGLETIP_PLACEMENT:
|
|
18
|
-
TOGGLETIP_STRATEGY:
|
|
18
|
+
TOGGLETIP_PLACEMENT: POPOVER_PLACEMENT.TOP,
|
|
19
|
+
TOGGLETIP_STRATEGY: STRATEGY.ABSOLUTE,
|
|
19
20
|
};
|
|
20
21
|
const MDC_TEXT_OPTIONS = {
|
|
21
22
|
TAGNAME: VALID_TEXT_TAGS.SPAN,
|
|
@@ -9,6 +9,7 @@ declare const Select_base: import("../../utils/mixins/index.types").Constructor<
|
|
|
9
9
|
/**
|
|
10
10
|
* The mdc-select component is a dropdown selection control that allows users to pick an option from a predefined list.
|
|
11
11
|
* It is designed to work with `mdc-option` for individual options and `mdc-optgroup` for grouping related options.
|
|
12
|
+
* Optional: Add `mdc-divider` after each option group (`mdc-optgroup`) to separate groups visually.
|
|
12
13
|
*
|
|
13
14
|
* Every mdc-option should have a `value` attribute set to ensure proper form submission.
|
|
14
15
|
*
|
|
@@ -27,14 +28,13 @@ declare const Select_base: import("../../utils/mixins/index.types").Constructor<
|
|
|
27
28
|
*
|
|
28
29
|
* @tagname mdc-select
|
|
29
30
|
*
|
|
30
|
-
* @slot default - This is a default/unnamed slot for Selectlistbox including options and/or option group.
|
|
31
|
-
*
|
|
32
31
|
* @event click - (React: onClick) This event is dispatched when the select is clicked.
|
|
33
32
|
* @event change - (React: onChange) This event is dispatched when the select is changed.
|
|
34
33
|
* @event input - (React: onInput) This event is dispatched when the select is changed.
|
|
35
34
|
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the select.
|
|
36
35
|
* @event focus - (React: onFocus) This event is dispatched when the select receives focus.
|
|
37
36
|
*
|
|
37
|
+
* @slot default - This is a default/unnamed slot for Selectlistbox including options and/or option group.
|
|
38
38
|
* @slot label - Slot for the label element. If not provided, the `label` property will be used to render the label.
|
|
39
39
|
* @slot toggletip - Slot for the toggletip info icon button. If not provided, the `toggletip-text` property will be used to render the info icon button and toggletip.
|
|
40
40
|
* @slot help-icon - Slot for the helper/validation icon. If not provided, the icon will be rendered based on the `helpTextType` property.
|
|
@@ -30,6 +30,7 @@ import styles from './select.styles';
|
|
|
30
30
|
/**
|
|
31
31
|
* The mdc-select component is a dropdown selection control that allows users to pick an option from a predefined list.
|
|
32
32
|
* It is designed to work with `mdc-option` for individual options and `mdc-optgroup` for grouping related options.
|
|
33
|
+
* Optional: Add `mdc-divider` after each option group (`mdc-optgroup`) to separate groups visually.
|
|
33
34
|
*
|
|
34
35
|
* Every mdc-option should have a `value` attribute set to ensure proper form submission.
|
|
35
36
|
*
|
|
@@ -48,14 +49,13 @@ import styles from './select.styles';
|
|
|
48
49
|
*
|
|
49
50
|
* @tagname mdc-select
|
|
50
51
|
*
|
|
51
|
-
* @slot default - This is a default/unnamed slot for Selectlistbox including options and/or option group.
|
|
52
|
-
*
|
|
53
52
|
* @event click - (React: onClick) This event is dispatched when the select is clicked.
|
|
54
53
|
* @event change - (React: onChange) This event is dispatched when the select is changed.
|
|
55
54
|
* @event input - (React: onInput) This event is dispatched when the select is changed.
|
|
56
55
|
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the select.
|
|
57
56
|
* @event focus - (React: onFocus) This event is dispatched when the select receives focus.
|
|
58
57
|
*
|
|
58
|
+
* @slot default - This is a default/unnamed slot for Selectlistbox including options and/or option group.
|
|
59
59
|
* @slot label - Slot for the label element. If not provided, the `label` property will be used to render the label.
|
|
60
60
|
* @slot toggletip - Slot for the toggletip info icon button. If not provided, the `toggletip-text` property will be used to render the info icon button and toggletip.
|
|
61
61
|
* @slot help-icon - Slot for the helper/validation icon. If not provided, the icon will be rendered based on the `helpTextType` property.
|