@momentum-design/components 0.129.9 → 0.129.11
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 +175 -175
- package/dist/browser/index.js.map +3 -3
- package/dist/components/accordion/accordion.component.d.ts +28 -27
- package/dist/components/accordion/accordion.component.js +24 -25
- package/dist/components/accordionbutton/accordionbutton.component.d.ts +31 -27
- package/dist/components/accordionbutton/accordionbutton.component.js +28 -25
- package/dist/components/accordiongroup/accordiongroup.component.d.ts +21 -22
- package/dist/components/accordiongroup/accordiongroup.component.js +21 -22
- package/dist/components/accordiongroup/accordiongroup.styles.js +5 -5
- package/dist/components/tooltip/tooltip.component.d.ts +9 -1
- package/dist/components/tooltip/tooltip.component.js +28 -17
- package/dist/components/tooltip/tooltip.constants.d.ts +5 -0
- package/dist/components/tooltip/tooltip.constants.js +6 -1
- package/dist/custom-elements.json +57 -57
- package/dist/react/accordion/index.d.ts +24 -25
- package/dist/react/accordion/index.js +24 -25
- package/dist/react/accordionbutton/index.d.ts +20 -21
- package/dist/react/accordionbutton/index.js +20 -21
- package/dist/react/accordiongroup/index.d.ts +11 -19
- package/dist/react/accordiongroup/index.js +11 -19
- package/dist/react/tooltip/index.d.ts +9 -1
- package/dist/react/tooltip/index.js +9 -1
- package/package.json +1 -1
|
@@ -3,30 +3,31 @@ import { createComponent } from '@lit/react';
|
|
|
3
3
|
import Component from '../../components/accordion';
|
|
4
4
|
import { TAG_NAME } from '../../components/accordion/accordion.constants';
|
|
5
5
|
/**
|
|
6
|
-
* An accordion
|
|
6
|
+
* An accordion is a vertically stacked component with a header and expandable/collapsible body section.
|
|
7
|
+
* The header displays a prefix icon, header text, optional control slots (leading and trailing), and a dedicated expand/collapse button.
|
|
8
|
+
* Unlike `accordionbutton`, only the expand/collapse button is clickable and not the entire header.
|
|
7
9
|
*
|
|
8
|
-
*
|
|
9
|
-
* -
|
|
10
|
-
* - Header
|
|
11
|
-
* - Leading
|
|
12
|
-
* - Trailing
|
|
10
|
+
* ## Header contains
|
|
11
|
+
* - Optional prefix icon
|
|
12
|
+
* - Header text (default H3, customizable via `data-aria-level`)
|
|
13
|
+
* - Leading slot for controls (placed after header text)
|
|
14
|
+
* - Trailing slot for controls (placed before expand/collapse button)
|
|
15
|
+
* - Expand/collapse button (automatically positioned at the end)
|
|
13
16
|
*
|
|
14
|
-
*
|
|
15
|
-
* - Default slot
|
|
17
|
+
* ## Body contains
|
|
18
|
+
* - Default slot for any content
|
|
16
19
|
*
|
|
17
|
-
* The accordion
|
|
18
|
-
*
|
|
19
|
-
* There are two sizes of accordion, one is small and the other is large.
|
|
20
|
-
* Small size has a padding of 1rem (16px) and large size has a padding of 1.5rem (24px) for the body section of accordion.
|
|
20
|
+
* The accordion supports different border styles through the `variant` attribute and different spacing through the `size` attribute.
|
|
21
|
+
* An accordion can be disabled, which prevents all interactions including the expand/collapse button and any slotted controls.
|
|
21
22
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
23
|
+
* ## When to use
|
|
24
|
+
* - Use `mdc-accordion` when you need additional interactive controls (chips, badges, buttons, icons) in the header.
|
|
25
|
+
* - Use `mdc-accordionbutton` if you only need a simple clickable header without extra controls.
|
|
24
26
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* If an accordion is expanded by default, then the screen reader might loose focus when toggling the visibilty of the accordion.
|
|
27
|
+
* ## Accessibility
|
|
28
|
+
* - Always provide `open-button-aria-label` and `close-button-aria-label` for screen reader support
|
|
29
|
+
* - Adjust `data-aria-level` based on heading hierarchy in your page
|
|
30
|
+
* - Note: Screen readers may lose focus when toggling if accordion is expanded by default
|
|
30
31
|
*
|
|
31
32
|
* @tagname mdc-accordion
|
|
32
33
|
*
|
|
@@ -34,16 +35,14 @@ import { TAG_NAME } from '../../components/accordion/accordion.constants';
|
|
|
34
35
|
* @dependency mdc-icon
|
|
35
36
|
* @dependency mdc-text
|
|
36
37
|
*
|
|
37
|
-
* @slot leading-controls - The leading controls slot of the accordion on the header section.
|
|
38
|
-
* @slot trailing-controls - The trailing controls slot of the accordion on the header section.
|
|
38
|
+
* @slot leading-controls - The leading controls slot of the accordion on the header section. Placed after the header text.
|
|
39
|
+
* @slot trailing-controls - The trailing controls slot of the accordion on the header section. Placed before the expand/collapse button.
|
|
39
40
|
* @slot default - The default slot contains the body section of the accordion. User can place anything inside this body slot.
|
|
40
41
|
*
|
|
41
|
-
* @event shown - (React: onShown) This event is triggered when the accordion is expanded.
|
|
42
|
+
* @event shown - (React: onShown) This event is triggered when the accordion is toggled (expanded or collapsed).
|
|
42
43
|
*
|
|
43
44
|
* @cssproperty --mdc-accordionbutton-border-color - The border color of the accordion.
|
|
44
|
-
* @cssproperty --mdc-accordionbutton-
|
|
45
|
-
* @cssproperty --mdc-accordionbutton-active-color - The active color of the accordion.
|
|
46
|
-
* @cssproperty --mdc-accordionbutton-disabled-color - The disabled color of the accordion.
|
|
45
|
+
* @cssproperty --mdc-accordionbutton-disabled-color - The disabled text color of the accordion.
|
|
47
46
|
*
|
|
48
47
|
* @csspart body-section - The body section of the accordion.
|
|
49
48
|
* @csspart header-section - The header section of the accordion.
|
|
@@ -2,28 +2,27 @@ import { type EventName } from '@lit/react';
|
|
|
2
2
|
import Component from '../../components/accordionbutton';
|
|
3
3
|
import type { Events } from '../../components/accordionbutton/accordionbutton.types';
|
|
4
4
|
/**
|
|
5
|
-
* An accordion button
|
|
5
|
+
* An accordion button is a vertically stacked component with a clickable header and expandable/collapsible body section.
|
|
6
|
+
* The entire header is clickable to toggle the visibility of the body content.
|
|
6
7
|
*
|
|
7
|
-
*
|
|
8
|
-
* -
|
|
9
|
-
* - Header
|
|
8
|
+
* ## Header contains
|
|
9
|
+
* - Optional prefix icon
|
|
10
|
+
* - Header text (default H3, customizable via `data-aria-level`)
|
|
11
|
+
* - Expand/collapse arrow icon (visual indicator)
|
|
10
12
|
*
|
|
11
|
-
*
|
|
12
|
-
* - Default slot
|
|
13
|
+
* ## Body contains
|
|
14
|
+
* - Default slot for any content
|
|
13
15
|
*
|
|
14
|
-
* The accordion button
|
|
15
|
-
*
|
|
16
|
-
* There are two sizes of accordion, one is small and the other is large.
|
|
17
|
-
* Small size has a padding of 1rem (16px) and large size has a padding of 1.5rem (24px) for the body section of accordion.
|
|
16
|
+
* The accordion button supports different border styles through the `variant` attribute and different spacing through the `size` attribute.
|
|
17
|
+
* An accordion button can be disabled, which prevents the header from being clickable.
|
|
18
18
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
19
|
+
* ## When to use
|
|
20
|
+
* - Use `mdc-accordionbutton` for simple clickable headers without additional controls.
|
|
21
|
+
* - Use `mdc-accordion` instead if you need extra controls (chips, badges, icons) in the header.
|
|
21
22
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* If an accordion button is expanded by default, then the screen reader might loose focus when toggling the visibilty of the accordion button.
|
|
23
|
+
* ## Accessibility
|
|
24
|
+
* - Adjust `data-aria-level` based on heading hierarchy in your page.
|
|
25
|
+
* - Note: Screen readers may lose focus when toggling if accordion button is expanded by default.
|
|
27
26
|
*
|
|
28
27
|
* @tagname mdc-accordionbutton
|
|
29
28
|
*
|
|
@@ -33,12 +32,12 @@ import type { Events } from '../../components/accordionbutton/accordionbutton.ty
|
|
|
33
32
|
*
|
|
34
33
|
* @slot default - The default slot contains the body section of the accordion. User can place anything inside this body slot.
|
|
35
34
|
*
|
|
36
|
-
* @event shown - (React: onShown) This event is triggered when the accordion button is expanded.
|
|
35
|
+
* @event shown - (React: onShown) This event is triggered when the accordion button is toggled (expanded or collapsed).
|
|
37
36
|
*
|
|
38
37
|
* @cssproperty --mdc-accordionbutton-border-color - The border color of the accordion button.
|
|
39
|
-
* @cssproperty --mdc-accordionbutton-hover-color - The hover color of the accordion button.
|
|
40
|
-
* @cssproperty --mdc-accordionbutton-active-color - The active color of the accordion button.
|
|
41
|
-
* @cssproperty --mdc-accordionbutton-disabled-color - The disabled color of the accordion button.
|
|
38
|
+
* @cssproperty --mdc-accordionbutton-hover-color - The hover background color of the accordion button header.
|
|
39
|
+
* @cssproperty --mdc-accordionbutton-active-color - The active background color of the accordion button header.
|
|
40
|
+
* @cssproperty --mdc-accordionbutton-disabled-color - The disabled text color of the accordion button.
|
|
42
41
|
*
|
|
43
42
|
* @csspart body-section - The body section of the accordion button.
|
|
44
43
|
* @csspart header-button-section - The header button section of the accordion button.
|
|
@@ -3,28 +3,27 @@ import { createComponent } from '@lit/react';
|
|
|
3
3
|
import Component from '../../components/accordionbutton';
|
|
4
4
|
import { TAG_NAME } from '../../components/accordionbutton/accordionbutton.constants';
|
|
5
5
|
/**
|
|
6
|
-
* An accordion button
|
|
6
|
+
* An accordion button is a vertically stacked component with a clickable header and expandable/collapsible body section.
|
|
7
|
+
* The entire header is clickable to toggle the visibility of the body content.
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
-
* -
|
|
10
|
-
* - Header
|
|
9
|
+
* ## Header contains
|
|
10
|
+
* - Optional prefix icon
|
|
11
|
+
* - Header text (default H3, customizable via `data-aria-level`)
|
|
12
|
+
* - Expand/collapse arrow icon (visual indicator)
|
|
11
13
|
*
|
|
12
|
-
*
|
|
13
|
-
* - Default slot
|
|
14
|
+
* ## Body contains
|
|
15
|
+
* - Default slot for any content
|
|
14
16
|
*
|
|
15
|
-
* The accordion button
|
|
16
|
-
*
|
|
17
|
-
* There are two sizes of accordion, one is small and the other is large.
|
|
18
|
-
* Small size has a padding of 1rem (16px) and large size has a padding of 1.5rem (24px) for the body section of accordion.
|
|
17
|
+
* The accordion button supports different border styles through the `variant` attribute and different spacing through the `size` attribute.
|
|
18
|
+
* An accordion button can be disabled, which prevents the header from being clickable.
|
|
19
19
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
20
|
+
* ## When to use
|
|
21
|
+
* - Use `mdc-accordionbutton` for simple clickable headers without additional controls.
|
|
22
|
+
* - Use `mdc-accordion` instead if you need extra controls (chips, badges, icons) in the header.
|
|
22
23
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* If an accordion button is expanded by default, then the screen reader might loose focus when toggling the visibilty of the accordion button.
|
|
24
|
+
* ## Accessibility
|
|
25
|
+
* - Adjust `data-aria-level` based on heading hierarchy in your page.
|
|
26
|
+
* - Note: Screen readers may lose focus when toggling if accordion button is expanded by default.
|
|
28
27
|
*
|
|
29
28
|
* @tagname mdc-accordionbutton
|
|
30
29
|
*
|
|
@@ -34,12 +33,12 @@ import { TAG_NAME } from '../../components/accordionbutton/accordionbutton.const
|
|
|
34
33
|
*
|
|
35
34
|
* @slot default - The default slot contains the body section of the accordion. User can place anything inside this body slot.
|
|
36
35
|
*
|
|
37
|
-
* @event shown - (React: onShown) This event is triggered when the accordion button is expanded.
|
|
36
|
+
* @event shown - (React: onShown) This event is triggered when the accordion button is toggled (expanded or collapsed).
|
|
38
37
|
*
|
|
39
38
|
* @cssproperty --mdc-accordionbutton-border-color - The border color of the accordion button.
|
|
40
|
-
* @cssproperty --mdc-accordionbutton-hover-color - The hover color of the accordion button.
|
|
41
|
-
* @cssproperty --mdc-accordionbutton-active-color - The active color of the accordion button.
|
|
42
|
-
* @cssproperty --mdc-accordionbutton-disabled-color - The disabled color of the accordion button.
|
|
39
|
+
* @cssproperty --mdc-accordionbutton-hover-color - The hover background color of the accordion button header.
|
|
40
|
+
* @cssproperty --mdc-accordionbutton-active-color - The active background color of the accordion button header.
|
|
41
|
+
* @cssproperty --mdc-accordionbutton-disabled-color - The disabled text color of the accordion button.
|
|
43
42
|
*
|
|
44
43
|
* @csspart body-section - The body section of the accordion button.
|
|
45
44
|
* @csspart header-button-section - The header button section of the accordion button.
|
|
@@ -1,32 +1,24 @@
|
|
|
1
1
|
import Component from '../../components/accordiongroup';
|
|
2
2
|
/**
|
|
3
|
-
* An accordion group is a
|
|
4
|
-
*
|
|
5
|
-
* Accordions are commonly used to reduce the need to scroll when presenting multiple sections of content on a single page.
|
|
3
|
+
* An accordion group is a container that manages multiple accordion or accordionbutton components as a unified set.
|
|
4
|
+
* It controls the visual styling, spacing, and expansion behavior of all child accordions.
|
|
6
5
|
*
|
|
7
|
-
*
|
|
6
|
+
* The group applies consistent `variant` and `size` attributes to all children automatically.
|
|
7
|
+
* By default, expanding one accordion collapses others (`allow-multiple` is false). Set `allow-multiple` to true to allow multiple expanded items.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
* -
|
|
11
|
-
* -
|
|
12
|
-
* -
|
|
9
|
+
* ## Accepted children
|
|
10
|
+
* - Use `mdc-accordionbutton` children for simple clickable headers.
|
|
11
|
+
* - Use `mdc-accordion` children when you need additional controls (chips, badges, icons) in the headers.
|
|
12
|
+
* - Other elements in the slot are ignored.
|
|
13
13
|
*
|
|
14
|
-
*
|
|
15
|
-
* -
|
|
16
|
-
* - Large: Large size has a padding of 1.5rem (24px) for both heading and body sections.
|
|
17
|
-
*
|
|
18
|
-
* The variant and size will be applied to all accordions inside this accordion group.
|
|
19
|
-
* To show/expand more than one accordion at any given time, then set `allow-multiple` to `true`. By default, it's `false`.
|
|
20
|
-
*
|
|
21
|
-
* If you don't need any controls on your accordion heading, then it's advised to use `accordionbutton` component.
|
|
22
|
-
*
|
|
23
|
-
* If the first accordion of the accordion group is expanded by default, then the screen reader might loose focus when toggling the visibilty of the first accordion.
|
|
14
|
+
* ## Accessibility
|
|
15
|
+
* - Note: Screen readers may lose focus when toggling if the first accordion is expanded by default.
|
|
24
16
|
*
|
|
25
17
|
* @tagname mdc-accordiongroup
|
|
26
18
|
*
|
|
27
19
|
* @slot default - The default slot can contain the `accordion` or `accordionbutton` components.
|
|
28
20
|
*
|
|
29
|
-
* @cssproperty --mdc-accordiongroup-border-color - The border color
|
|
21
|
+
* @cssproperty --mdc-accordiongroup-items-border-color - The border color applied to all child accordion items and their separators.
|
|
30
22
|
*/
|
|
31
23
|
declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {}>;
|
|
32
24
|
export default reactWrapper;
|
|
@@ -3,33 +3,25 @@ import { createComponent } from '@lit/react';
|
|
|
3
3
|
import Component from '../../components/accordiongroup';
|
|
4
4
|
import { TAG_NAME } from '../../components/accordiongroup/accordiongroup.constants';
|
|
5
5
|
/**
|
|
6
|
-
* An accordion group is a
|
|
7
|
-
*
|
|
8
|
-
* Accordions are commonly used to reduce the need to scroll when presenting multiple sections of content on a single page.
|
|
6
|
+
* An accordion group is a container that manages multiple accordion or accordionbutton components as a unified set.
|
|
7
|
+
* It controls the visual styling, spacing, and expansion behavior of all child accordions.
|
|
9
8
|
*
|
|
10
|
-
*
|
|
9
|
+
* The group applies consistent `variant` and `size` attributes to all children automatically.
|
|
10
|
+
* By default, expanding one accordion collapses others (`allow-multiple` is false). Set `allow-multiple` to true to allow multiple expanded items.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
* -
|
|
14
|
-
* -
|
|
15
|
-
* -
|
|
12
|
+
* ## Accepted children
|
|
13
|
+
* - Use `mdc-accordionbutton` children for simple clickable headers.
|
|
14
|
+
* - Use `mdc-accordion` children when you need additional controls (chips, badges, icons) in the headers.
|
|
15
|
+
* - Other elements in the slot are ignored.
|
|
16
16
|
*
|
|
17
|
-
*
|
|
18
|
-
* -
|
|
19
|
-
* - Large: Large size has a padding of 1.5rem (24px) for both heading and body sections.
|
|
20
|
-
*
|
|
21
|
-
* The variant and size will be applied to all accordions inside this accordion group.
|
|
22
|
-
* To show/expand more than one accordion at any given time, then set `allow-multiple` to `true`. By default, it's `false`.
|
|
23
|
-
*
|
|
24
|
-
* If you don't need any controls on your accordion heading, then it's advised to use `accordionbutton` component.
|
|
25
|
-
*
|
|
26
|
-
* If the first accordion of the accordion group is expanded by default, then the screen reader might loose focus when toggling the visibilty of the first accordion.
|
|
17
|
+
* ## Accessibility
|
|
18
|
+
* - Note: Screen readers may lose focus when toggling if the first accordion is expanded by default.
|
|
27
19
|
*
|
|
28
20
|
* @tagname mdc-accordiongroup
|
|
29
21
|
*
|
|
30
22
|
* @slot default - The default slot can contain the `accordion` or `accordionbutton` components.
|
|
31
23
|
*
|
|
32
|
-
* @cssproperty --mdc-accordiongroup-border-color - The border color
|
|
24
|
+
* @cssproperty --mdc-accordiongroup-items-border-color - The border color applied to all child accordion items and their separators.
|
|
33
25
|
*/
|
|
34
26
|
const reactWrapper = createComponent({
|
|
35
27
|
tagName: TAG_NAME,
|
|
@@ -2,10 +2,18 @@ import { type EventName } from '@lit/react';
|
|
|
2
2
|
import Component from '../../components/tooltip';
|
|
3
3
|
import type { Events as EventsInherited } from '../../components/popover/popover.types';
|
|
4
4
|
/**
|
|
5
|
+
* A Tooltip is a special type of popovers that provide additional context to content on the screen. <br/>
|
|
6
|
+
* Tooltip is triggered by mouse hover or by keyboard focus and will disappear upon mouse exit or focus change.
|
|
7
|
+
*
|
|
8
|
+
* Because of this, tooltips cannot contain content that can be focused or interacted with.
|
|
9
|
+
* When a tooltip must contain a focusable element like a link or button, use a toggle tip instead.
|
|
10
|
+
*
|
|
5
11
|
* A tooltip is triggered by mouse hover or by keyboard focus
|
|
6
12
|
* and will disappear upon mouse exit or focus change.
|
|
7
13
|
*
|
|
8
|
-
* Note:
|
|
14
|
+
* Note:
|
|
15
|
+
* - Tooltips cannot contain content that can be focused or interacted with.
|
|
16
|
+
* - Tooltips will contain the default `aria-hidden="true"` so that VO will never focus the tooltip.
|
|
9
17
|
*
|
|
10
18
|
* @tagname mdc-tooltip
|
|
11
19
|
*
|
|
@@ -3,10 +3,18 @@ import { createComponent } from '@lit/react';
|
|
|
3
3
|
import Component from '../../components/tooltip';
|
|
4
4
|
import { TAG_NAME } from '../../components/tooltip/tooltip.constants';
|
|
5
5
|
/**
|
|
6
|
+
* A Tooltip is a special type of popovers that provide additional context to content on the screen. <br/>
|
|
7
|
+
* Tooltip is triggered by mouse hover or by keyboard focus and will disappear upon mouse exit or focus change.
|
|
8
|
+
*
|
|
9
|
+
* Because of this, tooltips cannot contain content that can be focused or interacted with.
|
|
10
|
+
* When a tooltip must contain a focusable element like a link or button, use a toggle tip instead.
|
|
11
|
+
*
|
|
6
12
|
* A tooltip is triggered by mouse hover or by keyboard focus
|
|
7
13
|
* and will disappear upon mouse exit or focus change.
|
|
8
14
|
*
|
|
9
|
-
* Note:
|
|
15
|
+
* Note:
|
|
16
|
+
* - Tooltips cannot contain content that can be focused or interacted with.
|
|
17
|
+
* - Tooltips will contain the default `aria-hidden="true"` so that VO will never focus the tooltip.
|
|
10
18
|
*
|
|
11
19
|
* @tagname mdc-tooltip
|
|
12
20
|
*
|