@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.
@@ -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 contains a header and body section with a focusable heading that can be expanded or collapsed.
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
- * The header section contains:
9
- * - Prefix Icon
10
- * - Header Text
11
- * - Leading Slot - Contains the leading controls of the accordion on the header section. This will be placed on the leading side, after the header text.
12
- * - Trailing Slot - Contains the trailing controls of the accordion on the header section. This will be placed on the trailing side, before the expand/collapse button.
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
- * The body section contains:
15
- * - Default slot - User can place any content inside the body section.
17
+ * ## Body contains
18
+ * - Default slot for any content
16
19
  *
17
- * The accordion can be expanded or collapsed. The visibility of the body section can be controlled by `expanded` attribute. <br/>
18
- * There are two types of variants based on that the border styling of the accordion gets reflected. <br/>
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
- * By default, the header text in the accordion heading is of H3 with an aria-level of '3'.
23
- * If this accordion is placed on any other level in the entire webpage, then do adjust the aria-level number based on that.
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
- * An accordion can be disabled, and when it's disabled, the header section will not be clickable.
26
- *
27
- * If you don't need any controls on your accordion heading, then it's advised to use `accordionbutton` component.
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-hover-color - The hover color of the accordion.
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 contains a header and body section with optional slots inside the heading which are focusable.
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
- * The header section contains:
8
- * - Prefix Icon
9
- * - Header Text
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
- * The body section contains:
12
- * - Default slot - User can place any content inside the body section.
13
+ * ## Body contains
14
+ * - Default slot for any content
13
15
  *
14
- * The accordion button can be expanded or collapsed. The visibility of the body section can be controlled by `expanded` attribute. <br/>
15
- * There are two types of variants based on that the border styling of the accordion gets reflected. <br/>
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
- * By default, the header text in the accordion heading is of H3 with an aria-level of '3'.
20
- * If this accordion is placed on any other level in the entire webpage, then do adjust the aria-level number based on that.
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
- * An accordion can be disabled, and when it's disabled, the header section will not be clickable.
23
- *
24
- * If you do need any controls on your accordion heading, then it's advised to use `accordion` component.
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 contains a header and body section with optional slots inside the heading which are focusable.
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
- * The header section contains:
9
- * - Prefix Icon
10
- * - Header Text
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
- * The body section contains:
13
- * - Default slot - User can place any content inside the body section.
14
+ * ## Body contains
15
+ * - Default slot for any content
14
16
  *
15
- * The accordion button can be expanded or collapsed. The visibility of the body section can be controlled by `expanded` attribute. <br/>
16
- * There are two types of variants based on that the border styling of the accordion gets reflected. <br/>
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
- * By default, the header text in the accordion heading is of H3 with an aria-level of '3'.
21
- * If this accordion is placed on any other level in the entire webpage, then do adjust the aria-level number based on that.
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
- * An accordion can be disabled, and when it's disabled, the header section will not be clickable.
24
- *
25
- * If you do need any controls on your accordion heading, then it's advised to use `accordion` component.
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 vertically stacked set of interactive headings that each contain a header and body content.
4
- * Each heading of the accordion acts as a control that enable users to expand or hide their associated body sections of content.
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
- * - Default Slot: The accordion group component only accepts, `accordion` and `accordionbutton` components as the children, rest are ignored.
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
- * There are three types of variants:
10
- * - Stacked - Each accordion will have a gap of 1.5rem (24px).
11
- * - Borderless - Each accordion will not have any border and the group will also not have any border.
12
- * - Contained - Each accordion will have no gap in between them and the border of the entire accordiongroup will be continuous.
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
- * There are two types of sizes:
15
- * - Small: Small size has a padding of 1rem (16px) for both heading and body sections.
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 of the entire accordiongroup
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 vertically stacked set of interactive headings that each contain a header and body content.
7
- * Each heading of the accordion acts as a control that enable users to expand or hide their associated body sections of content.
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
- * - Default Slot: The accordion group component only accepts, `accordion` and `accordionbutton` components as the children, rest are ignored.
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
- * There are three types of variants:
13
- * - Stacked - Each accordion will have a gap of 1.5rem (24px).
14
- * - Borderless - Each accordion will not have any border and the group will also not have any border.
15
- * - Contained - Each accordion will have no gap in between them and the border of the entire accordiongroup will be continuous.
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
- * There are two types of sizes:
18
- * - Small: Small size has a padding of 1rem (16px) for both heading and body sections.
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 of the entire accordiongroup
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: Tooltips cannot contain content that can be focused or interacted with.
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: Tooltips cannot contain content that can be focused or interacted with.
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
  *
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.129.9",
4
+ "version": "0.129.11",
5
5
  "engines": {
6
6
  "node": ">=20.0.0",
7
7
  "npm": ">=8.0.0"