@momentum-design/components 0.122.20 → 0.122.22
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 +188 -184
- package/dist/browser/index.js.map +3 -3
- package/dist/components/announcementdialog/announcementdialog.styles.js +1 -1
- package/dist/components/dialog/dialog.component.d.ts +14 -5
- package/dist/components/dialog/dialog.component.js +14 -5
- package/dist/components/dialog/dialog.styles.js +13 -9
- package/dist/components/tooltip/tooltip.component.d.ts +0 -5
- package/dist/components/tooltip/tooltip.component.js +1 -16
- package/dist/custom-elements.json +2 -20
- package/dist/react/dialog/index.d.ts +14 -5
- package/dist/react/dialog/index.js +14 -5
- package/package.json +1 -1
|
@@ -8,6 +8,10 @@ declare const Dialog_base: import("../../utils/mixins/index.types").Constructor<
|
|
|
8
8
|
* The dialog is available in 5 sizes: small, medium, large, xlarge and fullscreen. It may also receive custom styling/sizing.
|
|
9
9
|
* The dialog interrupts the user and will block interaction with the rest of the application until it is closed.
|
|
10
10
|
*
|
|
11
|
+
* Dialog component have 2 variants: default and promotional.
|
|
12
|
+
*
|
|
13
|
+
* ## Visibility
|
|
14
|
+
*
|
|
11
15
|
* The dialog can be controlled solely through the `visible` property, no trigger element is required.
|
|
12
16
|
* If a `triggerId` is provided, the dialog will manage focus with that element, otherwise it will
|
|
13
17
|
* remember the previously focused element before the dialog was opened.
|
|
@@ -17,16 +21,21 @@ declare const Dialog_base: import("../../utils/mixins/index.types").Constructor<
|
|
|
17
21
|
* Use the `onClose` event to handle the close action of the dialog (fired when Close button is clicked
|
|
18
22
|
* or Escape is pressed).
|
|
19
23
|
*
|
|
20
|
-
*
|
|
24
|
+
* ## Accessibility
|
|
21
25
|
*
|
|
22
|
-
*
|
|
26
|
+
* Some attributes have to be explicitly set by the consumer of the component:
|
|
23
27
|
*
|
|
24
28
|
* - The dialog should have an aria-label or aria-labelledby attribute to provide a label for screen readers.
|
|
25
29
|
* - Use aria-labelledby to reference the ID of the element that labels the dialog when there is no visible title.
|
|
26
30
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
31
|
+
* ## Responsive design
|
|
32
|
+
*
|
|
33
|
+
* Dialog has few built in logic to prevent content clipping on small screens
|
|
34
|
+
*
|
|
35
|
+
* - maximum height limited to the viewport height
|
|
36
|
+
* - dialog body has `overflow: auto` by default
|
|
37
|
+
* - dialog itself also has `overflow: auto`, it activates only when the body can not shrink more
|
|
38
|
+
*
|
|
30
39
|
*
|
|
31
40
|
* @dependency mdc-button
|
|
32
41
|
* @dependency mdc-text
|
|
@@ -26,6 +26,10 @@ import styles from './dialog.styles';
|
|
|
26
26
|
* The dialog is available in 5 sizes: small, medium, large, xlarge and fullscreen. It may also receive custom styling/sizing.
|
|
27
27
|
* The dialog interrupts the user and will block interaction with the rest of the application until it is closed.
|
|
28
28
|
*
|
|
29
|
+
* Dialog component have 2 variants: default and promotional.
|
|
30
|
+
*
|
|
31
|
+
* ## Visibility
|
|
32
|
+
*
|
|
29
33
|
* The dialog can be controlled solely through the `visible` property, no trigger element is required.
|
|
30
34
|
* If a `triggerId` is provided, the dialog will manage focus with that element, otherwise it will
|
|
31
35
|
* remember the previously focused element before the dialog was opened.
|
|
@@ -35,16 +39,21 @@ import styles from './dialog.styles';
|
|
|
35
39
|
* Use the `onClose` event to handle the close action of the dialog (fired when Close button is clicked
|
|
36
40
|
* or Escape is pressed).
|
|
37
41
|
*
|
|
38
|
-
*
|
|
42
|
+
* ## Accessibility
|
|
39
43
|
*
|
|
40
|
-
*
|
|
44
|
+
* Some attributes have to be explicitly set by the consumer of the component:
|
|
41
45
|
*
|
|
42
46
|
* - The dialog should have an aria-label or aria-labelledby attribute to provide a label for screen readers.
|
|
43
47
|
* - Use aria-labelledby to reference the ID of the element that labels the dialog when there is no visible title.
|
|
44
48
|
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
49
|
+
* ## Responsive design
|
|
50
|
+
*
|
|
51
|
+
* Dialog has few built in logic to prevent content clipping on small screens
|
|
52
|
+
*
|
|
53
|
+
* - maximum height limited to the viewport height
|
|
54
|
+
* - dialog body has `overflow: auto` by default
|
|
55
|
+
* - dialog itself also has `overflow: auto`, it activates only when the body can not shrink more
|
|
56
|
+
*
|
|
48
57
|
*
|
|
49
58
|
* @dependency mdc-button
|
|
50
59
|
* @dependency mdc-text
|
|
@@ -25,22 +25,22 @@ const styles = css `
|
|
|
25
25
|
transform: translate(50%, 50%);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
:host > [part=
|
|
29
|
-
|
|
28
|
+
:host > [part='body']:first-of-type {
|
|
29
|
+
padding-top: 0;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
:host > [part=
|
|
32
|
+
:host > [part='dialog-close-btn'] {
|
|
33
33
|
margin-top: 0;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
:host > slot[name=
|
|
36
|
+
:host > slot[name='footer'] {
|
|
37
37
|
margin-top: 0;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
slot[name=
|
|
41
|
-
slot[name=
|
|
42
|
-
slot[name=
|
|
43
|
-
slot[name=
|
|
40
|
+
slot[name='footer-link']::slotted(*),
|
|
41
|
+
slot[name='footer-button-primary']::slotted(*),
|
|
42
|
+
slot[name='footer-button-secondary']::slotted(*),
|
|
43
|
+
slot[name='footer']::slotted(*) {
|
|
44
44
|
margin-top: 1rem;
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -75,12 +75,15 @@ const styles = css `
|
|
|
75
75
|
height: 100%;
|
|
76
76
|
border: none;
|
|
77
77
|
border-radius: 0;
|
|
78
|
+
max-height: 100vh;
|
|
78
79
|
}
|
|
79
80
|
|
|
80
81
|
:host {
|
|
81
82
|
width: var(--mdc-dialog-width);
|
|
82
83
|
height: var(--mdc-dialog-height);
|
|
83
84
|
max-width: 100%;
|
|
85
|
+
max-height: calc(100vh - 2rem);
|
|
86
|
+
overflow-y: auto;
|
|
84
87
|
}
|
|
85
88
|
|
|
86
89
|
:host::part(header-section),
|
|
@@ -118,7 +121,8 @@ const styles = css `
|
|
|
118
121
|
align-items: center;
|
|
119
122
|
height: 100%;
|
|
120
123
|
width: 100%;
|
|
121
|
-
|
|
124
|
+
padding-top: 1rem;
|
|
125
|
+
overflow-y: auto;
|
|
122
126
|
}
|
|
123
127
|
|
|
124
128
|
:host::part(footer) {
|
|
@@ -30,12 +30,7 @@ declare class Tooltip extends Popover {
|
|
|
30
30
|
* @default 'description'
|
|
31
31
|
*/
|
|
32
32
|
tooltipType: TooltipType;
|
|
33
|
-
private defaultSlotNodes;
|
|
34
33
|
connectedCallback(): void;
|
|
35
|
-
/**
|
|
36
|
-
* @returns The tooltip text.
|
|
37
|
-
*/
|
|
38
|
-
private getTooltipText;
|
|
39
34
|
/**
|
|
40
35
|
* Sets the type attribute for the tooltip component.
|
|
41
36
|
* If the provided type is not included in the TOOLTIP_TYPES,
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import { property
|
|
10
|
+
import { property } from 'lit/decorators.js';
|
|
11
11
|
import { v4 as uuidv4 } from 'uuid';
|
|
12
12
|
import { ROLE } from '../../utils/roles';
|
|
13
13
|
import Popover from '../popover/popover.component';
|
|
@@ -66,13 +66,6 @@ class Tooltip extends Popover {
|
|
|
66
66
|
this.size = false;
|
|
67
67
|
this.disableAriaExpanded = true;
|
|
68
68
|
}
|
|
69
|
-
/**
|
|
70
|
-
* @returns The tooltip text.
|
|
71
|
-
*/
|
|
72
|
-
getTooltipText() {
|
|
73
|
-
var _a, _b;
|
|
74
|
-
return (((_b = (_a = this.defaultSlotNodes) === null || _a === void 0 ? void 0 : _a.map(node => node.textContent).join(' ')) === null || _b === void 0 ? void 0 : _b.trim()) || '');
|
|
75
|
-
}
|
|
76
69
|
/**
|
|
77
70
|
* Sets the type attribute for the tooltip component.
|
|
78
71
|
* If the provided type is not included in the TOOLTIP_TYPES,
|
|
@@ -125,7 +118,6 @@ class Tooltip extends Popover {
|
|
|
125
118
|
this.setTooltipType(DEFAULTS.TOOLTIP_TYPE);
|
|
126
119
|
}
|
|
127
120
|
if (this.triggerElement) {
|
|
128
|
-
const tooltipText = this.getTooltipText();
|
|
129
121
|
switch (this.tooltipType) {
|
|
130
122
|
case TOOLTIP_TYPES.DESCRIPTION:
|
|
131
123
|
if (previousTooltipType === TOOLTIP_TYPES.LABEL) {
|
|
@@ -148,9 +140,6 @@ class Tooltip extends Popover {
|
|
|
148
140
|
}
|
|
149
141
|
break;
|
|
150
142
|
}
|
|
151
|
-
if (tooltipText.length > 0 && this.tooltipType !== TOOLTIP_TYPES.NONE && !this.ariaLabel) {
|
|
152
|
-
this.ariaLabel = tooltipText;
|
|
153
|
-
}
|
|
154
143
|
}
|
|
155
144
|
}
|
|
156
145
|
async update(changedProperties) {
|
|
@@ -171,8 +160,4 @@ __decorate([
|
|
|
171
160
|
property({ type: String, attribute: 'tooltip-type', reflect: true }),
|
|
172
161
|
__metadata("design:type", String)
|
|
173
162
|
], Tooltip.prototype, "tooltipType", void 0);
|
|
174
|
-
__decorate([
|
|
175
|
-
queryAssignedNodes(),
|
|
176
|
-
__metadata("design:type", Array)
|
|
177
|
-
], Tooltip.prototype, "defaultSlotNodes", void 0);
|
|
178
163
|
export default Tooltip;
|
|
@@ -15194,7 +15194,7 @@
|
|
|
15194
15194
|
"declarations": [
|
|
15195
15195
|
{
|
|
15196
15196
|
"kind": "class",
|
|
15197
|
-
"description": "Dialog component is a modal dialog that can be used to display information or prompt the user for input.\nIt can be used to create custom dialogs where content for the body and footer actions is provided by the consumer.\nThe dialog is available in 5 sizes: small, medium, large, xlarge and fullscreen. It may also receive custom styling/sizing.\nThe dialog interrupts the user and will block interaction with the rest of the application until it is closed.\n\nThe dialog can be controlled solely through the `visible` property, no trigger element is required.\nIf a `triggerId` is provided, the dialog will manage focus with that element, otherwise it will\nremember the previously focused element before the dialog was opened.\n\nThe dialog is a controlled component, meaning it does not have its own state management for visibility.\nUse the `visible` property to control the visibility of the dialog.\nUse the `onClose` event to handle the close action of the dialog (fired when Close button is clicked\nor Escape is pressed).\n\
|
|
15197
|
+
"description": "Dialog component is a modal dialog that can be used to display information or prompt the user for input.\nIt can be used to create custom dialogs where content for the body and footer actions is provided by the consumer.\nThe dialog is available in 5 sizes: small, medium, large, xlarge and fullscreen. It may also receive custom styling/sizing.\nThe dialog interrupts the user and will block interaction with the rest of the application until it is closed.\n\nDialog component have 2 variants: default and promotional.\n\n## Visibility\n\nThe dialog can be controlled solely through the `visible` property, no trigger element is required.\nIf a `triggerId` is provided, the dialog will manage focus with that element, otherwise it will\nremember the previously focused element before the dialog was opened.\n\nThe dialog is a controlled component, meaning it does not have its own state management for visibility.\nUse the `visible` property to control the visibility of the dialog.\nUse the `onClose` event to handle the close action of the dialog (fired when Close button is clicked\nor Escape is pressed).\n\n## Accessibility\n\nSome attributes have to be explicitly set by the consumer of the component:\n\n- The dialog should have an aria-label or aria-labelledby attribute to provide a label for screen readers.\n- Use aria-labelledby to reference the ID of the element that labels the dialog when there is no visible title.\n\n## Responsive design\n\nDialog has few built in logic to prevent content clipping on small screens\n\n- maximum height limited to the viewport height\n- dialog body has `overflow: auto` by default\n- dialog itself also has `overflow: auto`, it activates only when the body can not shrink more",
|
|
15198
15198
|
"name": "Dialog",
|
|
15199
15199
|
"cssProperties": [
|
|
15200
15200
|
{
|
|
@@ -16262,7 +16262,7 @@
|
|
|
16262
16262
|
"module": "/src/models"
|
|
16263
16263
|
},
|
|
16264
16264
|
"tagName": "mdc-dialog",
|
|
16265
|
-
"jsDoc": "/**\n * Dialog component is a modal dialog that can be used to display information or prompt the user for input.\n * It can be used to create custom dialogs where content for the body and footer actions is provided by the consumer.\n * The dialog is available in 5 sizes: small, medium, large, xlarge and fullscreen. It may also receive custom styling/sizing.\n * The dialog interrupts the user and will block interaction with the rest of the application until it is closed.\n *\n * The dialog can be controlled solely through the `visible` property, no trigger element is required.\n * If a `triggerId` is provided, the dialog will manage focus with that element, otherwise it will\n * remember the previously focused element before the dialog was opened.\n *\n * The dialog is a controlled component, meaning it does not have its own state management for visibility.\n * Use the `visible` property to control the visibility of the dialog.\n * Use the `onClose` event to handle the close action of the dialog (fired when Close button is clicked\n * or Escape is pressed).\n *\n *
|
|
16265
|
+
"jsDoc": "/**\n * Dialog component is a modal dialog that can be used to display information or prompt the user for input.\n * It can be used to create custom dialogs where content for the body and footer actions is provided by the consumer.\n * The dialog is available in 5 sizes: small, medium, large, xlarge and fullscreen. It may also receive custom styling/sizing.\n * The dialog interrupts the user and will block interaction with the rest of the application until it is closed.\n *\n * Dialog component have 2 variants: default and promotional.\n *\n * ## Visibility\n *\n * The dialog can be controlled solely through the `visible` property, no trigger element is required.\n * If a `triggerId` is provided, the dialog will manage focus with that element, otherwise it will\n * remember the previously focused element before the dialog was opened.\n *\n * The dialog is a controlled component, meaning it does not have its own state management for visibility.\n * Use the `visible` property to control the visibility of the dialog.\n * Use the `onClose` event to handle the close action of the dialog (fired when Close button is clicked\n * or Escape is pressed).\n *\n * ## Accessibility\n *\n * Some attributes have to be explicitly set by the consumer of the component:\n *\n * - The dialog should have an aria-label or aria-labelledby attribute to provide a label for screen readers.\n * - Use aria-labelledby to reference the ID of the element that labels the dialog when there is no visible title.\n *\n * ## Responsive design\n *\n * Dialog has few built in logic to prevent content clipping on small screens\n *\n * - maximum height limited to the viewport height\n * - dialog body has `overflow: auto` by default\n * - dialog itself also has `overflow: auto`, it activates only when the body can not shrink more\n *\n *\n * @dependency mdc-button\n * @dependency mdc-text\n *\n * @tagname mdc-dialog\n *\n * @event shown - (React: onShown) Dispatched when the dialog is shown\n * @event hidden - (React: onHidden) Dispatched when the dialog is hidden\n * @event created - (React: onCreated) Dispatched when the dialog is created (added to the DOM)\n * @event destroyed - (React: onDestroyed) Dispatched when the dialog is destroyed (removed from the DOM)\n * @event close - (React: onClose) Dispatched when the Close Button is clicked or Escape key is pressed\n * (this does not hide the dialog)\n *\n * @cssproperty --mdc-dialog-primary-background-color - primary background color of the dialog\n * @cssproperty --mdc-dialog-border-color - border color of the dialog\n * @cssproperty --mdc-dialog-header-text-color - text color of the header/title of the dialog\n * @cssproperty --mdc-dialog-description-text-color - text color of the below header description of the dialog\n * @cssproperty --mdc-dialog-elevation-3 - elevation of the dialog\n * @cssproperty --mdc-dialog-width - width of the dialog\n * @cssproperty --mdc-dialog-height - height of the dialog\n *\n * @csspart body - The body section of the dialog.\n * @csspart description-text - The description text of the dialog.\n * @csspart dialog-close-btn - The close button of the dialog.\n * @csspart header - The header of the dialog.\n * @csspart header-section - The header section of the dialog.\n * @csspart header-text - The header text of the dialog.\n *\n * @slot header-prefix - Slot for the dialog header content. This can be used to pass custom header content.\n * @slot dialog-body - Slot for the dialog body content\n * @slot footer-link - This slot is for passing `mdc-link` component within the footer section.\n * @slot footer-button-secondary - This slot is for passing secondary variant of `mdc-button` component\n * within the footer section.\n * @slot footer-button-primary - This slot is for passing primary variant of\n * `mdc-button` component within the footer section.\n * @slot footer - This slot is for passing custom footer content. Only use this if really needed,\n * using the footer-link and footer-button slots is preferred\n */",
|
|
16266
16266
|
"customElement": true
|
|
16267
16267
|
}
|
|
16268
16268
|
],
|
|
@@ -51085,24 +51085,6 @@
|
|
|
51085
51085
|
"attribute": "tooltip-type",
|
|
51086
51086
|
"reflects": true
|
|
51087
51087
|
},
|
|
51088
|
-
{
|
|
51089
|
-
"kind": "field",
|
|
51090
|
-
"name": "defaultSlotNodes",
|
|
51091
|
-
"type": {
|
|
51092
|
-
"text": "Array<Node>"
|
|
51093
|
-
},
|
|
51094
|
-
"privacy": "private"
|
|
51095
|
-
},
|
|
51096
|
-
{
|
|
51097
|
-
"kind": "method",
|
|
51098
|
-
"name": "getTooltipText",
|
|
51099
|
-
"privacy": "private",
|
|
51100
|
-
"return": {
|
|
51101
|
-
"type": {
|
|
51102
|
-
"text": ""
|
|
51103
|
-
}
|
|
51104
|
-
}
|
|
51105
|
-
},
|
|
51106
51088
|
{
|
|
51107
51089
|
"kind": "method",
|
|
51108
51090
|
"name": "setTooltipType",
|
|
@@ -7,6 +7,10 @@ import type { Events } from '../../components/dialog/dialog.types';
|
|
|
7
7
|
* The dialog is available in 5 sizes: small, medium, large, xlarge and fullscreen. It may also receive custom styling/sizing.
|
|
8
8
|
* The dialog interrupts the user and will block interaction with the rest of the application until it is closed.
|
|
9
9
|
*
|
|
10
|
+
* Dialog component have 2 variants: default and promotional.
|
|
11
|
+
*
|
|
12
|
+
* ## Visibility
|
|
13
|
+
*
|
|
10
14
|
* The dialog can be controlled solely through the `visible` property, no trigger element is required.
|
|
11
15
|
* If a `triggerId` is provided, the dialog will manage focus with that element, otherwise it will
|
|
12
16
|
* remember the previously focused element before the dialog was opened.
|
|
@@ -16,16 +20,21 @@ import type { Events } from '../../components/dialog/dialog.types';
|
|
|
16
20
|
* Use the `onClose` event to handle the close action of the dialog (fired when Close button is clicked
|
|
17
21
|
* or Escape is pressed).
|
|
18
22
|
*
|
|
19
|
-
*
|
|
23
|
+
* ## Accessibility
|
|
20
24
|
*
|
|
21
|
-
*
|
|
25
|
+
* Some attributes have to be explicitly set by the consumer of the component:
|
|
22
26
|
*
|
|
23
27
|
* - The dialog should have an aria-label or aria-labelledby attribute to provide a label for screen readers.
|
|
24
28
|
* - Use aria-labelledby to reference the ID of the element that labels the dialog when there is no visible title.
|
|
25
29
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
30
|
+
* ## Responsive design
|
|
31
|
+
*
|
|
32
|
+
* Dialog has few built in logic to prevent content clipping on small screens
|
|
33
|
+
*
|
|
34
|
+
* - maximum height limited to the viewport height
|
|
35
|
+
* - dialog body has `overflow: auto` by default
|
|
36
|
+
* - dialog itself also has `overflow: auto`, it activates only when the body can not shrink more
|
|
37
|
+
*
|
|
29
38
|
*
|
|
30
39
|
* @dependency mdc-button
|
|
31
40
|
* @dependency mdc-text
|
|
@@ -8,6 +8,10 @@ import { TAG_NAME } from '../../components/dialog/dialog.constants';
|
|
|
8
8
|
* The dialog is available in 5 sizes: small, medium, large, xlarge and fullscreen. It may also receive custom styling/sizing.
|
|
9
9
|
* The dialog interrupts the user and will block interaction with the rest of the application until it is closed.
|
|
10
10
|
*
|
|
11
|
+
* Dialog component have 2 variants: default and promotional.
|
|
12
|
+
*
|
|
13
|
+
* ## Visibility
|
|
14
|
+
*
|
|
11
15
|
* The dialog can be controlled solely through the `visible` property, no trigger element is required.
|
|
12
16
|
* If a `triggerId` is provided, the dialog will manage focus with that element, otherwise it will
|
|
13
17
|
* remember the previously focused element before the dialog was opened.
|
|
@@ -17,16 +21,21 @@ import { TAG_NAME } from '../../components/dialog/dialog.constants';
|
|
|
17
21
|
* Use the `onClose` event to handle the close action of the dialog (fired when Close button is clicked
|
|
18
22
|
* or Escape is pressed).
|
|
19
23
|
*
|
|
20
|
-
*
|
|
24
|
+
* ## Accessibility
|
|
21
25
|
*
|
|
22
|
-
*
|
|
26
|
+
* Some attributes have to be explicitly set by the consumer of the component:
|
|
23
27
|
*
|
|
24
28
|
* - The dialog should have an aria-label or aria-labelledby attribute to provide a label for screen readers.
|
|
25
29
|
* - Use aria-labelledby to reference the ID of the element that labels the dialog when there is no visible title.
|
|
26
30
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
31
|
+
* ## Responsive design
|
|
32
|
+
*
|
|
33
|
+
* Dialog has few built in logic to prevent content clipping on small screens
|
|
34
|
+
*
|
|
35
|
+
* - maximum height limited to the viewport height
|
|
36
|
+
* - dialog body has `overflow: auto` by default
|
|
37
|
+
* - dialog itself also has `overflow: auto`, it activates only when the body can not shrink more
|
|
38
|
+
*
|
|
30
39
|
*
|
|
31
40
|
* @dependency mdc-button
|
|
32
41
|
* @dependency mdc-text
|