@momentum-design/components 0.129.6 → 0.129.8
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 +19 -19
- package/dist/browser/index.js.map +2 -2
- package/dist/components/chip/chip.component.d.ts +1 -1
- package/dist/components/chip/chip.types.d.ts +2 -4
- package/dist/components/dialog/dialog.component.d.ts +9 -0
- package/dist/components/dialog/dialog.component.js +21 -3
- package/dist/components/dialog/dialog.constants.d.ts +1 -0
- package/dist/components/dialog/dialog.constants.js +1 -0
- package/dist/components/filterchip/filterchip.constants.d.ts +1 -1
- package/dist/custom-elements.json +48 -0
- package/dist/index.d.ts +2 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CSSResult } from 'lit';
|
|
2
2
|
import Buttonsimple from '../buttonsimple/buttonsimple.component';
|
|
3
|
-
import type { ColorType } from '
|
|
3
|
+
import type { ColorType } from '../staticchip/staticchip.types';
|
|
4
4
|
declare const Chip_base: import("../../utils/mixins/index.types").Constructor<import("../../utils/mixins/IconNameMixin").IconNameMixinInterface> & typeof Buttonsimple;
|
|
5
5
|
/**
|
|
6
6
|
* mdc-chip is an interactive element that can be used to represent a chip. It supports a leading icon along with label.
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import type { OverrideEventTarget
|
|
1
|
+
import type { OverrideEventTarget } from '../../utils/types';
|
|
2
2
|
import type Chip from './chip.component';
|
|
3
|
-
import { COLOR } from './chip.constants';
|
|
4
|
-
type ColorType = ValueOf<typeof COLOR>;
|
|
5
3
|
interface Events {
|
|
6
4
|
onClickEvent: OverrideEventTarget<MouseEvent, Chip>;
|
|
7
5
|
onKeyDownEvent: OverrideEventTarget<KeyboardEvent, Chip>;
|
|
8
6
|
onKeyUpEvent: OverrideEventTarget<KeyboardEvent, Chip>;
|
|
9
7
|
onFocusEvent: OverrideEventTarget<FocusEvent, Chip>;
|
|
10
8
|
}
|
|
11
|
-
export type {
|
|
9
|
+
export type { Events };
|
|
@@ -181,6 +181,15 @@ declare class Dialog extends Dialog_base {
|
|
|
181
181
|
* @default true
|
|
182
182
|
*/
|
|
183
183
|
focusTrap: boolean;
|
|
184
|
+
/**
|
|
185
|
+
* Determines whether a backdrop should be displayed behind the dialog.
|
|
186
|
+
* By default, a backdrop is present and it will cover the rest of the page and prevent interaction
|
|
187
|
+
* with other elements while the dialog is open.
|
|
188
|
+
* When this attribute is set to true, no backdrop will be created.
|
|
189
|
+
*
|
|
190
|
+
* @default false
|
|
191
|
+
*/
|
|
192
|
+
hideBackdrop: boolean;
|
|
184
193
|
/**
|
|
185
194
|
* For now preventScroll is always true as the dialog is a modal component only.
|
|
186
195
|
* This means scroll will be prevented when the dialog is open.
|
|
@@ -186,6 +186,15 @@ class Dialog extends BackdropMixin(PreventScrollMixin(FocusTrapMixin(FooterMixin
|
|
|
186
186
|
* @default true
|
|
187
187
|
*/
|
|
188
188
|
this.focusTrap = DEFAULTS.FOCUS_TRAP;
|
|
189
|
+
/**
|
|
190
|
+
* Determines whether a backdrop should be displayed behind the dialog.
|
|
191
|
+
* By default, a backdrop is present and it will cover the rest of the page and prevent interaction
|
|
192
|
+
* with other elements while the dialog is open.
|
|
193
|
+
* When this attribute is set to true, no backdrop will be created.
|
|
194
|
+
*
|
|
195
|
+
* @default false
|
|
196
|
+
*/
|
|
197
|
+
this.hideBackdrop = DEFAULTS.HIDE_BACKDROP;
|
|
189
198
|
/**
|
|
190
199
|
* For now preventScroll is always true as the dialog is a modal component only.
|
|
191
200
|
* This means scroll will be prevented when the dialog is open.
|
|
@@ -358,9 +367,12 @@ class Dialog extends BackdropMixin(PreventScrollMixin(FocusTrapMixin(FooterMixin
|
|
|
358
367
|
if (newValue && !oldValue) {
|
|
359
368
|
// Store the currently focused element before opening the dialog
|
|
360
369
|
this.lastActiveElement = document.activeElement;
|
|
361
|
-
//
|
|
362
|
-
this.
|
|
363
|
-
|
|
370
|
+
// create backdrop if enabled
|
|
371
|
+
if (!this.hideBackdrop) {
|
|
372
|
+
// remove any existing backdrop and create a new one
|
|
373
|
+
this.removeBackdrop();
|
|
374
|
+
this.createBackdrop('dialog');
|
|
375
|
+
}
|
|
364
376
|
this.activatePreventScroll();
|
|
365
377
|
await this.updateComplete;
|
|
366
378
|
if (this.focusTrap) {
|
|
@@ -372,6 +384,8 @@ class Dialog extends BackdropMixin(PreventScrollMixin(FocusTrapMixin(FooterMixin
|
|
|
372
384
|
DialogEventManager.onShowDialog(this);
|
|
373
385
|
}
|
|
374
386
|
else if (!newValue && oldValue) {
|
|
387
|
+
// Always remove backdrop if it exists, regardless of current hideBackdrop value
|
|
388
|
+
// This handles the case where hideBackdrop was changed while dialog was open
|
|
375
389
|
this.removeBackdrop();
|
|
376
390
|
// Set aria-expanded attribute on the trigger element to false if it exists
|
|
377
391
|
(_d = this.triggerElement) === null || _d === void 0 ? void 0 : _d.setAttribute('aria-expanded', 'false');
|
|
@@ -526,4 +540,8 @@ __decorate([
|
|
|
526
540
|
property({ type: Boolean, reflect: true, attribute: 'focus-trap' }),
|
|
527
541
|
__metadata("design:type", Boolean)
|
|
528
542
|
], Dialog.prototype, "focusTrap", void 0);
|
|
543
|
+
__decorate([
|
|
544
|
+
property({ type: Boolean, reflect: true, attribute: 'hide-backdrop' }),
|
|
545
|
+
__metadata("design:type", Boolean)
|
|
546
|
+
], Dialog.prototype, "hideBackdrop", void 0);
|
|
529
547
|
export default Dialog;
|
|
@@ -15,6 +15,7 @@ declare const DEFAULTS: {
|
|
|
15
15
|
readonly VARIANT: "default";
|
|
16
16
|
readonly DISABLE_ARIA_HAS_POPUP: false;
|
|
17
17
|
readonly FOCUS_TRAP: true;
|
|
18
|
+
readonly HIDE_BACKDROP: false;
|
|
18
19
|
};
|
|
19
20
|
declare const DIALOG_SIZE: readonly ["small", "medium", "large", "xlarge", "fullscreen"];
|
|
20
21
|
declare const DIALOG_ROLE: readonly ["dialog", "alertdialog"];
|
|
@@ -15,6 +15,7 @@ const DEFAULTS = {
|
|
|
15
15
|
VARIANT: DIALOG_VARIANT.DEFAULT,
|
|
16
16
|
DISABLE_ARIA_HAS_POPUP: false,
|
|
17
17
|
FOCUS_TRAP: true,
|
|
18
|
+
HIDE_BACKDROP: false,
|
|
18
19
|
};
|
|
19
20
|
const DIALOG_SIZE = ['small', 'medium', 'large', 'xlarge', 'fullscreen'];
|
|
20
21
|
const DIALOG_ROLE = ['dialog', 'alertdialog'];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IconNames } from '../icon/icon.types';
|
|
2
|
-
import { ColorType } from '../
|
|
2
|
+
import type { ColorType } from '../staticchip/staticchip.types';
|
|
3
3
|
declare const TAG_NAME: "mdc-filterchip";
|
|
4
4
|
declare const DEFAULTS: {
|
|
5
5
|
readonly ICON_NAME: Extract<IconNames, "check-bold">;
|
|
@@ -2483,6 +2483,21 @@
|
|
|
2483
2483
|
"module": "components/dialog/dialog.component.js"
|
|
2484
2484
|
}
|
|
2485
2485
|
},
|
|
2486
|
+
{
|
|
2487
|
+
"kind": "field",
|
|
2488
|
+
"name": "hideBackdrop",
|
|
2489
|
+
"type": {
|
|
2490
|
+
"text": "boolean"
|
|
2491
|
+
},
|
|
2492
|
+
"description": "Determines whether a backdrop should be displayed behind the dialog.\nBy default, a backdrop is present and it will cover the rest of the page and prevent interaction\nwith other elements while the dialog is open.\nWhen this attribute is set to true, no backdrop will be created.",
|
|
2493
|
+
"default": "false",
|
|
2494
|
+
"attribute": "hide-backdrop",
|
|
2495
|
+
"reflects": true,
|
|
2496
|
+
"inheritedFrom": {
|
|
2497
|
+
"name": "Dialog",
|
|
2498
|
+
"module": "components/dialog/dialog.component.js"
|
|
2499
|
+
}
|
|
2500
|
+
},
|
|
2486
2501
|
{
|
|
2487
2502
|
"kind": "field",
|
|
2488
2503
|
"name": "id",
|
|
@@ -3211,6 +3226,19 @@
|
|
|
3211
3226
|
"name": "Dialog",
|
|
3212
3227
|
"module": "src/components/dialog/dialog.component.ts"
|
|
3213
3228
|
}
|
|
3229
|
+
},
|
|
3230
|
+
{
|
|
3231
|
+
"name": "hide-backdrop",
|
|
3232
|
+
"type": {
|
|
3233
|
+
"text": "boolean"
|
|
3234
|
+
},
|
|
3235
|
+
"description": "Determines whether a backdrop should be displayed behind the dialog.\nBy default, a backdrop is present and it will cover the rest of the page and prevent interaction\nwith other elements while the dialog is open.\nWhen this attribute is set to true, no backdrop will be created.",
|
|
3236
|
+
"default": "false",
|
|
3237
|
+
"fieldName": "hideBackdrop",
|
|
3238
|
+
"inheritedFrom": {
|
|
3239
|
+
"name": "Dialog",
|
|
3240
|
+
"module": "src/components/dialog/dialog.component.ts"
|
|
3241
|
+
}
|
|
3214
3242
|
}
|
|
3215
3243
|
],
|
|
3216
3244
|
"superclass": {
|
|
@@ -15689,6 +15717,17 @@
|
|
|
15689
15717
|
"attribute": "header-text",
|
|
15690
15718
|
"reflects": true
|
|
15691
15719
|
},
|
|
15720
|
+
{
|
|
15721
|
+
"kind": "field",
|
|
15722
|
+
"name": "hideBackdrop",
|
|
15723
|
+
"type": {
|
|
15724
|
+
"text": "boolean"
|
|
15725
|
+
},
|
|
15726
|
+
"description": "Determines whether a backdrop should be displayed behind the dialog.\nBy default, a backdrop is present and it will cover the rest of the page and prevent interaction\nwith other elements while the dialog is open.\nWhen this attribute is set to true, no backdrop will be created.",
|
|
15727
|
+
"default": "false",
|
|
15728
|
+
"attribute": "hide-backdrop",
|
|
15729
|
+
"reflects": true
|
|
15730
|
+
},
|
|
15692
15731
|
{
|
|
15693
15732
|
"kind": "field",
|
|
15694
15733
|
"name": "id",
|
|
@@ -16253,6 +16292,15 @@
|
|
|
16253
16292
|
"default": "true",
|
|
16254
16293
|
"fieldName": "focusTrap"
|
|
16255
16294
|
},
|
|
16295
|
+
{
|
|
16296
|
+
"name": "hide-backdrop",
|
|
16297
|
+
"type": {
|
|
16298
|
+
"text": "boolean"
|
|
16299
|
+
},
|
|
16300
|
+
"description": "Determines whether a backdrop should be displayed behind the dialog.\nBy default, a backdrop is present and it will cover the rest of the page and prevent interaction\nwith other elements while the dialog is open.\nWhen this attribute is set to true, no backdrop will be created.",
|
|
16301
|
+
"default": "false",
|
|
16302
|
+
"fieldName": "hideBackdrop"
|
|
16303
|
+
},
|
|
16256
16304
|
{
|
|
16257
16305
|
"name": "should-focus-trap-wrap",
|
|
16258
16306
|
"type": {
|
package/dist/index.d.ts
CHANGED
|
@@ -86,6 +86,7 @@ import Slider from './components/slider';
|
|
|
86
86
|
import ListBox from './components/listbox';
|
|
87
87
|
import Banner from './components/banner';
|
|
88
88
|
import type { BadgeType } from './components/badge/badge.types';
|
|
89
|
+
import type { ColorType as ChipColorType } from './components/staticchip/staticchip.types';
|
|
89
90
|
import type { ButtonColor, ButtonVariant, IconButtonSize, PillButtonSize } from './components/button/button.types';
|
|
90
91
|
import type { PopoverPlacement } from './components/popover/popover.types';
|
|
91
92
|
import type { SkeletonVariant } from './components/skeleton/skeleton.types';
|
|
@@ -104,5 +105,5 @@ import { SKELETON_VARIANTS } from './components/skeleton/skeleton.constants';
|
|
|
104
105
|
import { inMemoryCache, webAPIAssetsCache } from './utils/assets-cache';
|
|
105
106
|
import type { TablistChangeEvent } from './components/tablist/tablist.types';
|
|
106
107
|
export { Accordion, AccordionButton, AccordionGroup, AlertChip, Animation, AnnouncementDialog, Appheader, Avatar, AvatarButton, Badge, Brandvisual, Bullet, Button, ButtonGroup, ButtonLink, Card, CardButton, CardCheckbox, CardRadio, Checkbox, Chip, Coachmark, ControlTypeProvider, Dialog, Divider, FilterChip, FormfieldGroup, Icon, IconProvider, Illustration, IllustrationProvider, Input, InputChip, Link, LinkButton, Linksimple, List, Listheader, ListItem, Marker, MenuBar, MenuItem, MenuItemCheckbox, MenuItemRadio, MenuPopover, MenuSection, NavMenuItem, OptGroup, Option, Password, Popover, Presence, Progressbar, Progressspinner, Radio, RadioGroup, ResponsiveSettingsProvider, ScreenreaderAnnouncer, Searchfield, Searchpopover, Select, SelectListbox, SideNavigation, Skeleton, Spinner, StaticChip, StaticCheckbox, StaticRadio, StaticToggle, Stepper, StepperConnector, StepperItem, Tab, TabList, Text, Textarea, ThemeProvider, Toast, Toggle, Typewriter, ToggleTip, Tooltip, VirtualizedList, Combobox, Slider, ListBox, Banner, };
|
|
107
|
-
export type { BadgeType, ButtonColor, ButtonVariant, IconButtonSize, MenuPopoverActionEvent, MenuPopoverChangeEvent, MenuSectionChangeEvent, PillButtonSize, PopoverPlacement, SkeletonVariant, SelectChangeEvent, SelectInputEvent, SpinnerSize, SpinnerVariant, SliderChangeEvent, TextType, TypewriterType, InputInputEvent, InputChangeEvent, InputFocusEvent, InputBlurEvent, InputClearEvent, VirtualizedListScrollEvent, TablistChangeEvent, TextareaInputEvent, TextareaChangeEvent, TextareaFocusEvent, TextareaBlurEvent, TextareaLimitExceededEvent, };
|
|
108
|
+
export type { BadgeType, ChipColorType, ButtonColor, ButtonVariant, IconButtonSize, MenuPopoverActionEvent, MenuPopoverChangeEvent, MenuSectionChangeEvent, PillButtonSize, PopoverPlacement, SkeletonVariant, SelectChangeEvent, SelectInputEvent, SpinnerSize, SpinnerVariant, SliderChangeEvent, TextType, TypewriterType, InputInputEvent, InputChangeEvent, InputFocusEvent, InputBlurEvent, InputClearEvent, VirtualizedListScrollEvent, TablistChangeEvent, TextareaInputEvent, TextareaChangeEvent, TextareaFocusEvent, TextareaBlurEvent, TextareaLimitExceededEvent, };
|
|
108
109
|
export { BUTTON_COLORS, BUTTON_VARIANTS, ICON_BUTTON_SIZES, inMemoryCache, PILL_BUTTON_SIZES, SKELETON_VARIANTS, webAPIAssetsCache, };
|