@momentum-design/components 0.118.5 → 0.119.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.
@@ -1,6 +1,6 @@
1
1
  export { default as Accordion } from './accordion';
2
- export { default as AccordionButton } from './accordionbutton';
3
2
  export { default as AccordionGroup } from './accordiongroup';
3
+ export { default as AccordionButton } from './accordionbutton';
4
4
  export { default as AlertChip } from './alertchip';
5
5
  export { default as Animation } from './animation';
6
6
  export { default as AnnouncementDialog } from './announcementdialog';
@@ -8,8 +8,8 @@ export { default as Appheader } from './appheader';
8
8
  export { default as Avatar } from './avatar';
9
9
  export { default as AvatarButton } from './avatarbutton';
10
10
  export { default as Badge } from './badge';
11
- export { default as Brandvisual } from './brandvisual';
12
11
  export { default as Banner } from './banner';
12
+ export { default as Brandvisual } from './brandvisual';
13
13
  export { default as Bullet } from './bullet';
14
14
  export { default as Button } from './button';
15
15
  export { default as ButtonGroup } from './buttongroup';
@@ -1,6 +1,6 @@
1
1
  export { default as Accordion } from './accordion';
2
- export { default as AccordionButton } from './accordionbutton';
3
2
  export { default as AccordionGroup } from './accordiongroup';
3
+ export { default as AccordionButton } from './accordionbutton';
4
4
  export { default as AlertChip } from './alertchip';
5
5
  export { default as Animation } from './animation';
6
6
  export { default as AnnouncementDialog } from './announcementdialog';
@@ -8,8 +8,8 @@ export { default as Appheader } from './appheader';
8
8
  export { default as Avatar } from './avatar';
9
9
  export { default as AvatarButton } from './avatarbutton';
10
10
  export { default as Badge } from './badge';
11
- export { default as Brandvisual } from './brandvisual';
12
11
  export { default as Banner } from './banner';
12
+ export { default as Brandvisual } from './brandvisual';
13
13
  export { default as Bullet } from './bullet';
14
14
  export { default as Button } from './button';
15
15
  export { default as ButtonGroup } from './buttongroup';
@@ -2,20 +2,56 @@ import { type EventName } from '@lit/react';
2
2
  import Component from '../../components/popover';
3
3
  import type { Events } from '../../components/popover/popover.types';
4
4
  /**
5
- * Popover component is a lightweight floating UI element that displays additional content when triggered.
6
- * It can be used for tooltips, dropdowns, or contextual menus.
5
+ * Popover is genric overlay which can be trigered by any actinable element.
6
+ *
7
+ * It can be used for tooltips, dropdowns, menus or any showing any other contextual content.
8
+ *
7
9
  * The popover automatically positions itself based on available space and
8
- * supports dynamic height adjustments with scrollable content when needed
10
+ * supports dynamic height adjustments with scrollable content when needed.
11
+ * It uses [Floating UI](https://floating-ui.com/) for maintaining the position of the popover.
12
+ *
13
+ * ## Limitations
14
+ *
15
+ * ### On trigger for multiple popovers
16
+ *
17
+ * A component (button, etc.) can trigger more than one popover, but only one of them should change the
18
+ * aria-expanded and aria-haspopup attributes on the trigger.
9
19
  *
10
- * Note:
11
- * - A component (button) can trigger more than one popover, but only one of them should change the
12
- * aria-expanded and aria-haspopup, the rest of the popovers must have `disable-aria-expanded` attribute.
20
+ * To prevent unexpected attribute changes on the trigger `disable-aria-expanded` attribute must be set on all linked
21
+ * Popoers except one.
22
+ *
23
+ * ### React Popover with append-to attribute
24
+ *
25
+ * React mounts the popover based on the virtual DOM, but when the append-to attribute is set, the popover removes itself
26
+ * and mounts to the specified element. React will not know about the move and will not know about the
27
+ * newly created mdc-popoverportal element either. This throws a `NotFoundError` error when the Popover is directly
28
+ * added/removed by React, for example:
29
+ *
30
+ * ```tsx
31
+ * const SomeComponent = () => {
32
+ * const [isOpen, setIsOpen] = useState(false);
33
+ * return (<div>
34
+ * {isOpen && <Popover append-to="some-element-id">...</mdc-popover>}
35
+ * </div>);
36
+ * }
37
+ * ```
38
+ * As a workaround Popover need to wrap with any other element/component, for example:
39
+ * ```tsx
40
+ * const SomeComponent = () => {
41
+ * const [isOpen, setIsOpen] = useState(false);
42
+ * return (<div>
43
+ * {isOpen && <div>
44
+ * <Popover append-to="some-element-id">...</mdc-popover>
45
+ * <div>}
46
+ * </div>);
47
+ * }
48
+ * ```
49
+ * Note the wrapper <div> around the Popover component (React.Fragment does not work).
13
50
  *
14
51
  * @dependency mdc-button
15
52
  *
16
53
  * @tagname mdc-popover
17
54
  *
18
- *
19
55
  * @event shown - (React: onShown) This event is dispatched when the popover is shown
20
56
  * @event hidden - (React: onHidden) This event is dispatched when the popover is hidden
21
57
  * @event created - (React: onCreated) This event is dispatched when the popover is created (added to the DOM)
@@ -3,20 +3,56 @@ import { createComponent } from '@lit/react';
3
3
  import Component from '../../components/popover';
4
4
  import { TAG_NAME } from '../../components/popover/popover.constants';
5
5
  /**
6
- * Popover component is a lightweight floating UI element that displays additional content when triggered.
7
- * It can be used for tooltips, dropdowns, or contextual menus.
6
+ * Popover is genric overlay which can be trigered by any actinable element.
7
+ *
8
+ * It can be used for tooltips, dropdowns, menus or any showing any other contextual content.
9
+ *
8
10
  * The popover automatically positions itself based on available space and
9
- * supports dynamic height adjustments with scrollable content when needed
11
+ * supports dynamic height adjustments with scrollable content when needed.
12
+ * It uses [Floating UI](https://floating-ui.com/) for maintaining the position of the popover.
13
+ *
14
+ * ## Limitations
15
+ *
16
+ * ### On trigger for multiple popovers
17
+ *
18
+ * A component (button, etc.) can trigger more than one popover, but only one of them should change the
19
+ * aria-expanded and aria-haspopup attributes on the trigger.
10
20
  *
11
- * Note:
12
- * - A component (button) can trigger more than one popover, but only one of them should change the
13
- * aria-expanded and aria-haspopup, the rest of the popovers must have `disable-aria-expanded` attribute.
21
+ * To prevent unexpected attribute changes on the trigger `disable-aria-expanded` attribute must be set on all linked
22
+ * Popoers except one.
23
+ *
24
+ * ### React Popover with append-to attribute
25
+ *
26
+ * React mounts the popover based on the virtual DOM, but when the append-to attribute is set, the popover removes itself
27
+ * and mounts to the specified element. React will not know about the move and will not know about the
28
+ * newly created mdc-popoverportal element either. This throws a `NotFoundError` error when the Popover is directly
29
+ * added/removed by React, for example:
30
+ *
31
+ * ```tsx
32
+ * const SomeComponent = () => {
33
+ * const [isOpen, setIsOpen] = useState(false);
34
+ * return (<div>
35
+ * {isOpen && <Popover append-to="some-element-id">...</mdc-popover>}
36
+ * </div>);
37
+ * }
38
+ * ```
39
+ * As a workaround Popover need to wrap with any other element/component, for example:
40
+ * ```tsx
41
+ * const SomeComponent = () => {
42
+ * const [isOpen, setIsOpen] = useState(false);
43
+ * return (<div>
44
+ * {isOpen && <div>
45
+ * <Popover append-to="some-element-id">...</mdc-popover>
46
+ * <div>}
47
+ * </div>);
48
+ * }
49
+ * ```
50
+ * Note the wrapper <div> around the Popover component (React.Fragment does not work).
14
51
  *
15
52
  * @dependency mdc-button
16
53
  *
17
54
  * @tagname mdc-popover
18
55
  *
19
- *
20
56
  * @event shown - (React: onShown) This event is dispatched when the popover is shown
21
57
  * @event hidden - (React: onHidden) This event is dispatched when the popover is hidden
22
58
  * @event created - (React: onCreated) This event is dispatched when the popover is created (added to the DOM)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@momentum-design/components",
3
3
  "packageManager": "yarn@3.2.4",
4
- "version": "0.118.5",
4
+ "version": "0.119.0",
5
5
  "engines": {
6
6
  "node": ">=20.0.0",
7
7
  "npm": ">=8.0.0"