@momentum-design/components 0.127.5 → 0.127.7
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 +224 -223
- package/dist/browser/index.js.map +4 -4
- package/dist/components/announcementdialog/announcementdialog.component.d.ts +3 -1
- package/dist/components/announcementdialog/announcementdialog.component.js +18 -8
- package/dist/components/dialog/dialog.component.d.ts +12 -1
- package/dist/components/dialog/dialog.component.js +27 -5
- package/dist/components/screenreaderannouncer/screenreaderannouncer.component.d.ts +10 -0
- package/dist/components/screenreaderannouncer/screenreaderannouncer.component.js +47 -6
- package/dist/components/textarea/textarea.component.d.ts +0 -9
- package/dist/components/textarea/textarea.component.js +19 -35
- package/dist/custom-elements.json +506 -502
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.js +2 -2
- package/dist/utils/provider/index.d.ts +16 -5
- package/dist/utils/provider/index.js +11 -1
- package/package.json +1 -1
package/dist/react/index.d.ts
CHANGED
|
@@ -9,8 +9,8 @@ export { default as Avatar } from './avatar';
|
|
|
9
9
|
export { default as AvatarButton } from './avatarbutton';
|
|
10
10
|
export { default as Badge } from './badge';
|
|
11
11
|
export { default as Banner } from './banner';
|
|
12
|
-
export { default as Brandvisual } from './brandvisual';
|
|
13
12
|
export { default as Bullet } from './bullet';
|
|
13
|
+
export { default as Brandvisual } from './brandvisual';
|
|
14
14
|
export { default as Button } from './button';
|
|
15
15
|
export { default as ButtonGroup } from './buttongroup';
|
|
16
16
|
export { default as ButtonLink } from './buttonlink';
|
|
@@ -41,9 +41,9 @@ export { default as Linksimple } from './linksimple';
|
|
|
41
41
|
export { default as List } from './list';
|
|
42
42
|
export { default as ListBox } from './listbox';
|
|
43
43
|
export { default as Listheader } from './listheader';
|
|
44
|
+
export { default as ListItem } from './listitem';
|
|
44
45
|
export { default as Marker } from './marker';
|
|
45
46
|
export { default as MenuBar } from './menubar';
|
|
46
|
-
export { default as ListItem } from './listitem';
|
|
47
47
|
export { default as MenuItem } from './menuitem';
|
|
48
48
|
export { default as MenuItemCheckbox } from './menuitemcheckbox';
|
|
49
49
|
export { default as MenuItemRadio } from './menuitemradio';
|
package/dist/react/index.js
CHANGED
|
@@ -9,8 +9,8 @@ export { default as Avatar } from './avatar';
|
|
|
9
9
|
export { default as AvatarButton } from './avatarbutton';
|
|
10
10
|
export { default as Badge } from './badge';
|
|
11
11
|
export { default as Banner } from './banner';
|
|
12
|
-
export { default as Brandvisual } from './brandvisual';
|
|
13
12
|
export { default as Bullet } from './bullet';
|
|
13
|
+
export { default as Brandvisual } from './brandvisual';
|
|
14
14
|
export { default as Button } from './button';
|
|
15
15
|
export { default as ButtonGroup } from './buttongroup';
|
|
16
16
|
export { default as ButtonLink } from './buttonlink';
|
|
@@ -41,9 +41,9 @@ export { default as Linksimple } from './linksimple';
|
|
|
41
41
|
export { default as List } from './list';
|
|
42
42
|
export { default as ListBox } from './listbox';
|
|
43
43
|
export { default as Listheader } from './listheader';
|
|
44
|
+
export { default as ListItem } from './listitem';
|
|
44
45
|
export { default as Marker } from './marker';
|
|
45
46
|
export { default as MenuBar } from './menubar';
|
|
46
|
-
export { default as ListItem } from './listitem';
|
|
47
47
|
export { default as MenuItem } from './menuitem';
|
|
48
48
|
export { default as MenuItemCheckbox } from './menuitemcheckbox';
|
|
49
49
|
export { default as MenuItemRadio } from './menuitemradio';
|
|
@@ -1,9 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
type
|
|
1
|
+
import type { ReactiveElement } from 'lit';
|
|
2
|
+
import { type Context, ContextConsumer } from '@lit/context';
|
|
3
|
+
import type { Options } from '@lit/context/lib/controllers/context-consumer';
|
|
4
|
+
type ConsumeOptions<C extends Context<unknown, unknown>> = Options<C> & {
|
|
4
5
|
host: ReactiveElement;
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* List of properties which need update when context changes
|
|
8
|
+
*
|
|
9
|
+
* For example a property getter depends on the context value and the property must be reflected to attribute.
|
|
10
|
+
*
|
|
11
|
+
* Background: Lit does not track dependencies between context consumers and properties, so
|
|
12
|
+
* we need to manually request an update for those properties.
|
|
13
|
+
*
|
|
14
|
+
* You can do it in the `updated` lifecycle method as well, but it will trigger an extra update cycle.
|
|
15
|
+
* While this approach will batch the updates with the context update cycle (which happens anyway).
|
|
16
|
+
*/
|
|
17
|
+
syncProperties?: string[];
|
|
7
18
|
};
|
|
8
19
|
declare const providerUtils: {
|
|
9
20
|
consume: <C extends Context<unknown, unknown>>(options: ConsumeOptions<C>) => ContextConsumer<C, ReactiveElement>;
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
import { ContextConsumer } from '@lit/context';
|
|
2
2
|
const consume = (options) => {
|
|
3
|
-
const { host, context, subscribe } = options;
|
|
3
|
+
const { host, context, subscribe, callback, syncProperties } = options;
|
|
4
|
+
const contextCallback = (callback || syncProperties) &&
|
|
5
|
+
((value) => {
|
|
6
|
+
if (syncProperties) {
|
|
7
|
+
syncProperties.forEach(prop => {
|
|
8
|
+
host.requestUpdate(prop);
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
callback === null || callback === void 0 ? void 0 : callback(value);
|
|
12
|
+
});
|
|
4
13
|
return new ContextConsumer(host, {
|
|
5
14
|
context,
|
|
15
|
+
callback: contextCallback,
|
|
6
16
|
subscribe: subscribe !== null && subscribe !== void 0 ? subscribe : true,
|
|
7
17
|
});
|
|
8
18
|
};
|