@momentum-design/components 0.66.3 → 0.67.0
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 +456 -238
- package/dist/browser/index.js.map +4 -4
- package/dist/components/card/card.component.d.ts +4 -35
- package/dist/components/card/card.component.js +9 -79
- package/dist/components/dialog/dialog.component.d.ts +150 -0
- package/dist/components/dialog/dialog.component.js +340 -0
- package/dist/components/dialog/dialog.constants.d.ts +18 -0
- package/dist/components/dialog/dialog.constants.js +19 -0
- package/dist/components/dialog/dialog.events.d.ts +34 -0
- package/dist/components/dialog/dialog.events.js +47 -0
- package/dist/components/dialog/dialog.styles.d.ts +2 -0
- package/dist/components/dialog/dialog.styles.js +108 -0
- package/dist/components/dialog/dialog.types.d.ts +12 -0
- package/dist/components/dialog/dialog.types.js +1 -0
- package/dist/components/dialog/dialog.utils.d.ts +7 -0
- package/dist/components/dialog/dialog.utils.js +33 -0
- package/dist/components/dialog/index.d.ts +9 -0
- package/dist/components/dialog/index.js +6 -0
- package/dist/components/menuitemcheckbox/index.d.ts +12 -0
- package/dist/components/menuitemcheckbox/index.js +9 -0
- package/dist/components/menuitemcheckbox/menuitemcheckbox.component.d.ts +54 -0
- package/dist/components/menuitemcheckbox/menuitemcheckbox.component.js +137 -0
- package/dist/components/menuitemcheckbox/menuitemcheckbox.constants.d.ts +15 -0
- package/dist/components/menuitemcheckbox/menuitemcheckbox.constants.js +16 -0
- package/dist/components/menuitemcheckbox/menuitemcheckbox.styles.d.ts +2 -0
- package/dist/components/menuitemcheckbox/menuitemcheckbox.styles.js +13 -0
- package/dist/components/menuitemcheckbox/menuitemcheckbox.types.d.ts +10 -0
- package/dist/components/menuitemcheckbox/menuitemcheckbox.types.js +1 -0
- package/dist/components/menuitemradio/index.d.ts +10 -0
- package/dist/components/menuitemradio/index.js +7 -0
- package/dist/components/menuitemradio/menuitemradio.component.d.ts +34 -0
- package/dist/components/menuitemradio/menuitemradio.component.js +70 -0
- package/dist/components/menuitemradio/menuitemradio.constants.d.ts +6 -0
- package/dist/components/menuitemradio/menuitemradio.constants.js +7 -0
- package/dist/components/menuitemradio/menuitemradio.types.d.ts +9 -0
- package/dist/components/menuitemradio/menuitemradio.types.js +1 -0
- package/dist/components/popover/popover.styles.js +5 -0
- package/dist/components/toggletip/toggletip.styles.js +8 -0
- package/dist/custom-elements.json +5152 -2804
- package/dist/index.d.ts +6 -3
- package/dist/index.js +6 -3
- package/dist/react/dialog/index.d.ts +51 -0
- package/dist/react/dialog/index.js +59 -0
- package/dist/react/index.d.ts +3 -0
- package/dist/react/index.js +3 -0
- package/dist/react/menuitemcheckbox/index.d.ts +42 -0
- package/dist/react/menuitemcheckbox/index.js +50 -0
- package/dist/react/menuitemradio/index.d.ts +30 -0
- package/dist/react/menuitemradio/index.js +38 -0
- package/dist/utils/mixins/CardAndDialogFooterMixin.d.ts +11 -0
- package/dist/utils/mixins/CardAndDialogFooterMixin.js +102 -0
- package/dist/utils/mixins/FocusTrapMixin.js +4 -5
- package/package.json +1 -1
@@ -0,0 +1,70 @@
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
6
|
+
};
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
9
|
+
};
|
10
|
+
import { html } from 'lit';
|
11
|
+
import { property } from 'lit/decorators.js';
|
12
|
+
import { ROLE } from '../../utils/roles';
|
13
|
+
import MenuItem from '../menuitem/menuitem.component';
|
14
|
+
import { TYPE } from '../text/text.constants';
|
15
|
+
import { ARIA_CHECKED_STATES } from './menuitemradio.constants';
|
16
|
+
/**
|
17
|
+
* A menuitemradio component is a checkable menuitem that is used in a menu.
|
18
|
+
* A menuitemradio should be checked only one at a time. <br/>
|
19
|
+
* There should be no focusable descendants inside this menuitemradio component.
|
20
|
+
*
|
21
|
+
* The `aria-checked` menuitemradio attribute is used to indicate that the menuitemradio is checked or not.
|
22
|
+
*
|
23
|
+
* If you want more than one item in a group to be checked, consider using menuitemcheckbox component.
|
24
|
+
*
|
25
|
+
* If a menuitemradio is disabled, then the `aria-disabled` attribute is set to `true`.
|
26
|
+
*
|
27
|
+
* @dependency mdc-staticradio
|
28
|
+
* @dependency mdc-text
|
29
|
+
*
|
30
|
+
* @tagname mdc-menuitemradio
|
31
|
+
*
|
32
|
+
* @event change - (React: onChange) This event is dispatched when the menuitemradio changes.
|
33
|
+
* @event click - (React: onClick) This event is dispatched when the menuitemradio is clicked.
|
34
|
+
* @event focus - (React: onFocus) This event is dispatched when the menuitemradio receives focus.
|
35
|
+
*/
|
36
|
+
class MenuItemRadio extends MenuItem {
|
37
|
+
constructor() {
|
38
|
+
super(...arguments);
|
39
|
+
/**
|
40
|
+
* The aria-checked attribute is used to indicate that the menuitemradio is checked or not.
|
41
|
+
* @default 'false'
|
42
|
+
*/
|
43
|
+
this.ariaChecked = ARIA_CHECKED_STATES.FALSE;
|
44
|
+
}
|
45
|
+
connectedCallback() {
|
46
|
+
super.connectedCallback();
|
47
|
+
this.role = ROLE.MENUITEMRADIO;
|
48
|
+
}
|
49
|
+
render() {
|
50
|
+
return html `
|
51
|
+
<div part="leading-controls">
|
52
|
+
<mdc-staticradio
|
53
|
+
slot="leading-controls"
|
54
|
+
?checked="${this.ariaChecked === ARIA_CHECKED_STATES.TRUE}"
|
55
|
+
?disabled="${this.disabled}"
|
56
|
+
></mdc-staticradio>
|
57
|
+
</div>
|
58
|
+
<div part="leading-text">
|
59
|
+
${this.getText('leading-text-primary-label', TYPE.BODY_MIDSIZE_REGULAR, this.label)}
|
60
|
+
${this.getText('leading-text-secondary-label', TYPE.BODY_MIDSIZE_REGULAR, this.secondaryLabel)}
|
61
|
+
</div>
|
62
|
+
`;
|
63
|
+
}
|
64
|
+
}
|
65
|
+
MenuItemRadio.styles = [...MenuItem.styles];
|
66
|
+
__decorate([
|
67
|
+
property({ type: String, reflect: true, attribute: 'aria-checked' }),
|
68
|
+
__metadata("design:type", String)
|
69
|
+
], MenuItemRadio.prototype, "ariaChecked", void 0);
|
70
|
+
export default MenuItemRadio;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { ValueOf } from '../../utils/types';
|
2
|
+
import { ARIA_CHECKED_STATES } from './menuitemradio.constants';
|
3
|
+
type AriaChecked = ValueOf<typeof ARIA_CHECKED_STATES>;
|
4
|
+
interface Events {
|
5
|
+
onChangeEvent: Event;
|
6
|
+
onClickEvent: MouseEvent;
|
7
|
+
onFocusEvent: FocusEvent;
|
8
|
+
}
|
9
|
+
export type { Events, AriaChecked };
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -21,5 +21,13 @@ const styles = css `
|
|
21
21
|
:host([color='contrast'])::part(popover-content) {
|
22
22
|
color: var(--mdc-toggletip-text-color-contrast);
|
23
23
|
}
|
24
|
+
|
25
|
+
:host(:dir(ltr))::part(popover-content) {
|
26
|
+
margin-right: 2rem;
|
27
|
+
}
|
28
|
+
|
29
|
+
:host(:dir(rtl))::part(popover-content) {
|
30
|
+
margin-left: 2rem;
|
31
|
+
}
|
24
32
|
`;
|
25
33
|
export default [styles];
|