@momentum-design/components 0.129.36 → 0.129.38
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 +263 -264
- package/dist/browser/index.js.map +4 -4
- package/dist/components/bullet/bullet.component.d.ts +16 -6
- package/dist/components/bullet/bullet.component.js +16 -6
- package/dist/components/bullet/bullet.styles.js +5 -6
- package/dist/components/divider/divider.component.d.ts +50 -55
- package/dist/components/divider/divider.component.js +50 -55
- package/dist/components/marker/marker.component.d.ts +20 -15
- package/dist/components/marker/marker.component.js +20 -15
- package/dist/components/popover/popover.component.d.ts +5 -2
- package/dist/components/popover/popover.component.js +39 -21
- package/dist/components/popover/popover.constants.d.ts +6 -1
- package/dist/components/popover/popover.constants.js +6 -1
- package/dist/components/staticcheckbox/staticcheckbox.component.d.ts +22 -11
- package/dist/components/staticcheckbox/staticcheckbox.component.js +22 -11
- package/dist/components/staticradio/staticradio.component.d.ts +21 -11
- package/dist/components/staticradio/staticradio.component.js +21 -11
- package/dist/components/statictoggle/statictoggle.component.d.ts +25 -12
- package/dist/components/statictoggle/statictoggle.component.js +25 -12
- package/dist/custom-elements.json +169 -79
- package/dist/react/bullet/index.d.ts +16 -6
- package/dist/react/bullet/index.js +16 -6
- package/dist/react/divider/index.d.ts +33 -38
- package/dist/react/divider/index.js +33 -38
- package/dist/react/marker/index.d.ts +17 -12
- package/dist/react/marker/index.js +17 -12
- package/dist/react/staticcheckbox/index.d.ts +22 -11
- package/dist/react/staticcheckbox/index.js +22 -11
- package/dist/react/staticradio/index.d.ts +21 -11
- package/dist/react/staticradio/index.js +21 -11
- package/dist/react/statictoggle/index.d.ts +25 -12
- package/dist/react/statictoggle/index.js +25 -12
- package/dist/utils/controllers/Timers.d.ts +49 -0
- package/dist/utils/controllers/Timers.js +96 -0
- package/package.json +1 -1
|
@@ -2,15 +2,25 @@ import type { CSSResult } from 'lit';
|
|
|
2
2
|
import { Component } from '../../models';
|
|
3
3
|
import type { Size } from './bullet.types';
|
|
4
4
|
/**
|
|
5
|
-
* Bullet component
|
|
6
|
-
*
|
|
5
|
+
* The Bullet component displays a small circular visual indicator used to organize and present
|
|
6
|
+
* items in a list format. It provides a simple, consistent way to mark list items or emphasize
|
|
7
|
+
* content points.
|
|
8
|
+
*
|
|
9
|
+
* Bullets are available in three sizes (small, medium, large) to accommodate different layout
|
|
10
|
+
* densities and visual hierarchies.
|
|
11
|
+
*
|
|
12
|
+
* ## When to use
|
|
13
|
+
* Use bullets to create unordered lists, mark navigation items, or provide visual indicators
|
|
14
|
+
* for list content. Choose bullet size based on content importance and layout density.
|
|
15
|
+
*
|
|
16
|
+
* ## Accessibility
|
|
17
|
+
* - Bullets are purely decorative and should be used alongside meaningful text content
|
|
18
|
+
* - Do not rely solely on bullet size or color to convey information
|
|
7
19
|
*
|
|
8
20
|
* @tagname mdc-bullet
|
|
9
21
|
*
|
|
10
|
-
* @cssproperty --mdc-bullet-background-color -
|
|
11
|
-
* @cssproperty --mdc-bullet-size
|
|
12
|
-
* @cssproperty --mdc-bullet-size-medium - medium size value of the bullet
|
|
13
|
-
* @cssproperty --mdc-bullet-size-large - large size value of the bullet
|
|
22
|
+
* @cssproperty --mdc-bullet-background-color - Background color of the bullet.
|
|
23
|
+
* @cssproperty --mdc-bullet-size - Height of the bullet.
|
|
14
24
|
*/
|
|
15
25
|
declare class Bullet extends Component {
|
|
16
26
|
/**
|
|
@@ -12,15 +12,25 @@ import { Component } from '../../models';
|
|
|
12
12
|
import styles from './bullet.styles';
|
|
13
13
|
import { SIZE } from './bullet.constants';
|
|
14
14
|
/**
|
|
15
|
-
* Bullet component
|
|
16
|
-
*
|
|
15
|
+
* The Bullet component displays a small circular visual indicator used to organize and present
|
|
16
|
+
* items in a list format. It provides a simple, consistent way to mark list items or emphasize
|
|
17
|
+
* content points.
|
|
18
|
+
*
|
|
19
|
+
* Bullets are available in three sizes (small, medium, large) to accommodate different layout
|
|
20
|
+
* densities and visual hierarchies.
|
|
21
|
+
*
|
|
22
|
+
* ## When to use
|
|
23
|
+
* Use bullets to create unordered lists, mark navigation items, or provide visual indicators
|
|
24
|
+
* for list content. Choose bullet size based on content importance and layout density.
|
|
25
|
+
*
|
|
26
|
+
* ## Accessibility
|
|
27
|
+
* - Bullets are purely decorative and should be used alongside meaningful text content
|
|
28
|
+
* - Do not rely solely on bullet size or color to convey information
|
|
17
29
|
*
|
|
18
30
|
* @tagname mdc-bullet
|
|
19
31
|
*
|
|
20
|
-
* @cssproperty --mdc-bullet-background-color -
|
|
21
|
-
* @cssproperty --mdc-bullet-size
|
|
22
|
-
* @cssproperty --mdc-bullet-size-medium - medium size value of the bullet
|
|
23
|
-
* @cssproperty --mdc-bullet-size-large - large size value of the bullet
|
|
32
|
+
* @cssproperty --mdc-bullet-background-color - Background color of the bullet.
|
|
33
|
+
* @cssproperty --mdc-bullet-size - Height of the bullet.
|
|
24
34
|
*/
|
|
25
35
|
class Bullet extends Component {
|
|
26
36
|
constructor() {
|
|
@@ -2,23 +2,22 @@ import { css } from 'lit';
|
|
|
2
2
|
const styles = css `
|
|
3
3
|
:host {
|
|
4
4
|
--mdc-bullet-background-color: var(--mds-color-theme-outline-secondary-normal);
|
|
5
|
-
--mdc-bullet-size
|
|
6
|
-
--mdc-bullet-size-medium: 0.5rem;
|
|
7
|
-
--mdc-bullet-size-large: 1rem;
|
|
5
|
+
--mdc-bullet-size: 0.25rem;
|
|
8
6
|
|
|
9
7
|
border-radius: 50%;
|
|
10
8
|
display: block;
|
|
11
9
|
aspect-ratio: 1;
|
|
10
|
+
height: var(--mdc-bullet-size);
|
|
12
11
|
background-color: var(--mdc-bullet-background-color);
|
|
13
12
|
}
|
|
14
13
|
:host([size='small']) {
|
|
15
|
-
|
|
14
|
+
--mdc-bullet-size: 0.25rem;
|
|
16
15
|
}
|
|
17
16
|
:host([size='medium']) {
|
|
18
|
-
|
|
17
|
+
--mdc-bullet-size: 0.5rem;
|
|
19
18
|
}
|
|
20
19
|
:host([size='large']) {
|
|
21
|
-
|
|
20
|
+
--mdc-bullet-size: 1rem;
|
|
22
21
|
}
|
|
23
22
|
`;
|
|
24
23
|
export default [styles];
|
|
@@ -3,85 +3,80 @@ import { CSSResult } from 'lit';
|
|
|
3
3
|
import { Component } from '../../models';
|
|
4
4
|
import type { Directions, DividerOrientation, DividerVariant } from './divider.types';
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
* It
|
|
6
|
+
* The Divider component provides a visual line to separate and organize content within layouts.
|
|
7
|
+
* It supports both horizontal and vertical orientations with solid or gradient styles, and can
|
|
8
|
+
* optionally include centered text labels or interactive grabber buttons.
|
|
8
9
|
*
|
|
9
|
-
*
|
|
10
|
-
* - **
|
|
11
|
-
* - **
|
|
10
|
+
* The divider automatically infers its type based on the content in its slot:
|
|
11
|
+
* - **Primary**: Simple line with no content
|
|
12
|
+
* - **Text**: Horizontal line with centered text label
|
|
13
|
+
* - **Grabber Button**: Line with centered interactive button
|
|
12
14
|
*
|
|
13
|
-
* **
|
|
14
|
-
* -
|
|
15
|
-
* -
|
|
15
|
+
* **Note:**
|
|
16
|
+
* - Vertical text dividers are not currently supported.
|
|
17
|
+
* - If the slot contains invalid tag names or multiple elements, the divider defaults to the Primary type
|
|
18
|
+
* - Use the provided CSS custom properties to customize divider styles
|
|
16
19
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* - **Text**: A horizontal divider with a text label in the center.
|
|
21
|
-
* - **Grabber Button**: A horizontal or vertical divider with a styled button in the center.
|
|
20
|
+
* ## When to use
|
|
21
|
+
* Use dividers to create visual separation between content sections, list items, or layout regions.
|
|
22
|
+
* Add text labels to provide context, or grabber buttons to create resizable panes.
|
|
22
23
|
*
|
|
23
|
-
*
|
|
24
|
-
* - When
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* **Notes:**
|
|
29
|
-
* - If the slot is replaced by an invalid tag name or contains multiple elements,
|
|
30
|
-
* the divider defaults to the **Primary** type.
|
|
31
|
-
* - To override the styles of the divider, use the provided CSS custom properties.
|
|
24
|
+
* ## Accessibility
|
|
25
|
+
* - When using a grabber button, provide `aria-label` to describe its purpose
|
|
26
|
+
* - Set `aria-expanded` on the button to indicate the current state of resizable sections
|
|
27
|
+
* - Ensure sufficient color contrast for the divider line
|
|
32
28
|
*
|
|
33
29
|
* @tagname mdc-divider
|
|
34
30
|
*
|
|
35
|
-
* @cssproperty --mdc-divider-background-color -
|
|
36
|
-
* @cssproperty --mdc-divider-width -
|
|
37
|
-
* @cssproperty --mdc-divider-horizontal-gradient -
|
|
38
|
-
* @cssproperty --mdc-divider-vertical-gradient -
|
|
39
|
-
* @cssproperty --mdc-divider-text-size -
|
|
40
|
-
* @cssproperty --mdc-divider-text-color -
|
|
41
|
-
* @cssproperty --mdc-divider-text-margin -
|
|
42
|
-
* @cssproperty --mdc-divider-text-line-height -
|
|
43
|
-
* @cssproperty --mdc-divider-grabber-button-background-color-normal -
|
|
44
|
-
*
|
|
45
|
-
* @cssproperty --mdc-divider-grabber-button-background-color-
|
|
46
|
-
*
|
|
47
|
-
* @cssproperty --mdc-divider-grabber-button-
|
|
48
|
-
*
|
|
49
|
-
* @
|
|
50
|
-
* @cssproperty --mdc-divider-grabber-button-border-radius - border radius of the grabber button
|
|
31
|
+
* @cssproperty --mdc-divider-background-color - Background color of the divider line.
|
|
32
|
+
* @cssproperty --mdc-divider-width - Width (thickness) of the divider line.
|
|
33
|
+
* @cssproperty --mdc-divider-horizontal-gradient - Gradient for horizontal dividers.
|
|
34
|
+
* @cssproperty --mdc-divider-vertical-gradient - Gradient for vertical dividers.
|
|
35
|
+
* @cssproperty --mdc-divider-text-size - Font size of the text label in text dividers.
|
|
36
|
+
* @cssproperty --mdc-divider-text-color - Font color of the text label in text dividers.
|
|
37
|
+
* @cssproperty --mdc-divider-text-margin - Left and right margin of the text label.
|
|
38
|
+
* @cssproperty --mdc-divider-text-line-height - Line height of the text label.
|
|
39
|
+
* @cssproperty --mdc-divider-grabber-button-background-color-normal - Background color of the grabber button in rest state.
|
|
40
|
+
* @cssproperty --mdc-divider-grabber-button-background-color-hover - Background color of the grabber button in hover state.
|
|
41
|
+
* @cssproperty --mdc-divider-grabber-button-background-color-pressed - Background color of the grabber button in pressed state.
|
|
42
|
+
* @cssproperty --mdc-divider-grabber-button-border-color - Border color of the grabber button.
|
|
43
|
+
* @cssproperty --mdc-divider-grabber-button-border-radius - Border radius of the grabber button.
|
|
44
|
+
*
|
|
45
|
+
* @slot - Content for the divider. Use `mdc-text` for text labels or `mdc-button` for grabber buttons.
|
|
51
46
|
*/
|
|
52
47
|
declare class Divider extends Component {
|
|
53
48
|
/**
|
|
54
|
-
*
|
|
55
|
-
* - **horizontal**: A thin
|
|
56
|
-
* - **vertical**: A thin
|
|
49
|
+
* Determines the orientation of the divider line.
|
|
50
|
+
* - **horizontal**: A thin horizontal line
|
|
51
|
+
* - **vertical**: A thin vertical line
|
|
57
52
|
*
|
|
58
|
-
* Note:
|
|
53
|
+
* Note: Vertical text dividers are not currently supported.
|
|
59
54
|
* @default horizontal
|
|
60
55
|
*/
|
|
61
56
|
orientation: DividerOrientation;
|
|
62
57
|
/**
|
|
63
|
-
*
|
|
64
|
-
* - **solid**: Solid line
|
|
65
|
-
* - **gradient**: Gradient
|
|
58
|
+
* Visual style of the divider line.
|
|
59
|
+
* - **solid**: Solid line with uniform color
|
|
60
|
+
* - **gradient**: Gradient line that fades on both ends
|
|
66
61
|
* @default solid
|
|
67
62
|
*/
|
|
68
63
|
variant: DividerVariant;
|
|
69
64
|
/**
|
|
70
|
-
* Direction of the arrow icon
|
|
71
|
-
* - **positive
|
|
72
|
-
* - **negative
|
|
65
|
+
* Direction of the arrow icon displayed on the grabber button.
|
|
66
|
+
* - **positive**: Up arrow (horizontal) or right arrow (vertical)
|
|
67
|
+
* - **negative**: Down arrow (horizontal) or left arrow (vertical)
|
|
73
68
|
*
|
|
74
|
-
*
|
|
75
|
-
* @default
|
|
69
|
+
* Only applies when using a grabber button. Directions follow the Cartesian coordinate system.
|
|
70
|
+
* @default negative
|
|
76
71
|
*/
|
|
77
72
|
arrowDirection: Directions;
|
|
78
73
|
/**
|
|
79
|
-
* Position of the button
|
|
80
|
-
* - **positive
|
|
81
|
-
* - **negative
|
|
74
|
+
* Position of the grabber button along the divider line.
|
|
75
|
+
* - **positive**: Right side (horizontal) or top side (vertical)
|
|
76
|
+
* - **negative**: Left side (horizontal) or bottom side (vertical)
|
|
82
77
|
*
|
|
83
|
-
*
|
|
84
|
-
* @default
|
|
78
|
+
* Only applies when using a grabber button. Directions follow the Cartesian coordinate system.
|
|
79
|
+
* @default negative
|
|
85
80
|
*/
|
|
86
81
|
buttonPosition: Directions;
|
|
87
82
|
/**
|
|
@@ -13,87 +13,82 @@ import { Component } from '../../models';
|
|
|
13
13
|
import { ARROW_ICONS, BUTTON_TAG, DEFAULTS, DIRECTIONS, DIVIDER_ORIENTATION, DIVIDER_VARIANT, TEXT_TAG, } from './divider.constants';
|
|
14
14
|
import styles from './divider.styles';
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
17
|
-
* It
|
|
16
|
+
* The Divider component provides a visual line to separate and organize content within layouts.
|
|
17
|
+
* It supports both horizontal and vertical orientations with solid or gradient styles, and can
|
|
18
|
+
* optionally include centered text labels or interactive grabber buttons.
|
|
18
19
|
*
|
|
19
|
-
*
|
|
20
|
-
* - **
|
|
21
|
-
* - **
|
|
20
|
+
* The divider automatically infers its type based on the content in its slot:
|
|
21
|
+
* - **Primary**: Simple line with no content
|
|
22
|
+
* - **Text**: Horizontal line with centered text label
|
|
23
|
+
* - **Grabber Button**: Line with centered interactive button
|
|
22
24
|
*
|
|
23
|
-
* **
|
|
24
|
-
* -
|
|
25
|
-
* -
|
|
25
|
+
* **Note:**
|
|
26
|
+
* - Vertical text dividers are not currently supported.
|
|
27
|
+
* - If the slot contains invalid tag names or multiple elements, the divider defaults to the Primary type
|
|
28
|
+
* - Use the provided CSS custom properties to customize divider styles
|
|
26
29
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* - **Text**: A horizontal divider with a text label in the center.
|
|
31
|
-
* - **Grabber Button**: A horizontal or vertical divider with a styled button in the center.
|
|
30
|
+
* ## When to use
|
|
31
|
+
* Use dividers to create visual separation between content sections, list items, or layout regions.
|
|
32
|
+
* Add text labels to provide context, or grabber buttons to create resizable panes.
|
|
32
33
|
*
|
|
33
|
-
*
|
|
34
|
-
* - When
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* **Notes:**
|
|
39
|
-
* - If the slot is replaced by an invalid tag name or contains multiple elements,
|
|
40
|
-
* the divider defaults to the **Primary** type.
|
|
41
|
-
* - To override the styles of the divider, use the provided CSS custom properties.
|
|
34
|
+
* ## Accessibility
|
|
35
|
+
* - When using a grabber button, provide `aria-label` to describe its purpose
|
|
36
|
+
* - Set `aria-expanded` on the button to indicate the current state of resizable sections
|
|
37
|
+
* - Ensure sufficient color contrast for the divider line
|
|
42
38
|
*
|
|
43
39
|
* @tagname mdc-divider
|
|
44
40
|
*
|
|
45
|
-
* @cssproperty --mdc-divider-background-color -
|
|
46
|
-
* @cssproperty --mdc-divider-width -
|
|
47
|
-
* @cssproperty --mdc-divider-horizontal-gradient -
|
|
48
|
-
* @cssproperty --mdc-divider-vertical-gradient -
|
|
49
|
-
* @cssproperty --mdc-divider-text-size -
|
|
50
|
-
* @cssproperty --mdc-divider-text-color -
|
|
51
|
-
* @cssproperty --mdc-divider-text-margin -
|
|
52
|
-
* @cssproperty --mdc-divider-text-line-height -
|
|
53
|
-
* @cssproperty --mdc-divider-grabber-button-background-color-normal -
|
|
54
|
-
*
|
|
55
|
-
* @cssproperty --mdc-divider-grabber-button-background-color-
|
|
56
|
-
*
|
|
57
|
-
* @cssproperty --mdc-divider-grabber-button-
|
|
58
|
-
*
|
|
59
|
-
* @
|
|
60
|
-
* @cssproperty --mdc-divider-grabber-button-border-radius - border radius of the grabber button
|
|
41
|
+
* @cssproperty --mdc-divider-background-color - Background color of the divider line.
|
|
42
|
+
* @cssproperty --mdc-divider-width - Width (thickness) of the divider line.
|
|
43
|
+
* @cssproperty --mdc-divider-horizontal-gradient - Gradient for horizontal dividers.
|
|
44
|
+
* @cssproperty --mdc-divider-vertical-gradient - Gradient for vertical dividers.
|
|
45
|
+
* @cssproperty --mdc-divider-text-size - Font size of the text label in text dividers.
|
|
46
|
+
* @cssproperty --mdc-divider-text-color - Font color of the text label in text dividers.
|
|
47
|
+
* @cssproperty --mdc-divider-text-margin - Left and right margin of the text label.
|
|
48
|
+
* @cssproperty --mdc-divider-text-line-height - Line height of the text label.
|
|
49
|
+
* @cssproperty --mdc-divider-grabber-button-background-color-normal - Background color of the grabber button in rest state.
|
|
50
|
+
* @cssproperty --mdc-divider-grabber-button-background-color-hover - Background color of the grabber button in hover state.
|
|
51
|
+
* @cssproperty --mdc-divider-grabber-button-background-color-pressed - Background color of the grabber button in pressed state.
|
|
52
|
+
* @cssproperty --mdc-divider-grabber-button-border-color - Border color of the grabber button.
|
|
53
|
+
* @cssproperty --mdc-divider-grabber-button-border-radius - Border radius of the grabber button.
|
|
54
|
+
*
|
|
55
|
+
* @slot - Content for the divider. Use `mdc-text` for text labels or `mdc-button` for grabber buttons.
|
|
61
56
|
*/
|
|
62
57
|
class Divider extends Component {
|
|
63
58
|
constructor() {
|
|
64
59
|
super(...arguments);
|
|
65
60
|
/**
|
|
66
|
-
*
|
|
67
|
-
* - **horizontal**: A thin
|
|
68
|
-
* - **vertical**: A thin
|
|
61
|
+
* Determines the orientation of the divider line.
|
|
62
|
+
* - **horizontal**: A thin horizontal line
|
|
63
|
+
* - **vertical**: A thin vertical line
|
|
69
64
|
*
|
|
70
|
-
* Note:
|
|
65
|
+
* Note: Vertical text dividers are not currently supported.
|
|
71
66
|
* @default horizontal
|
|
72
67
|
*/
|
|
73
68
|
this.orientation = DEFAULTS.ORIENTATION;
|
|
74
69
|
/**
|
|
75
|
-
*
|
|
76
|
-
* - **solid**: Solid line
|
|
77
|
-
* - **gradient**: Gradient
|
|
70
|
+
* Visual style of the divider line.
|
|
71
|
+
* - **solid**: Solid line with uniform color
|
|
72
|
+
* - **gradient**: Gradient line that fades on both ends
|
|
78
73
|
* @default solid
|
|
79
74
|
*/
|
|
80
75
|
this.variant = DEFAULTS.VARIANT;
|
|
81
76
|
/**
|
|
82
|
-
* Direction of the arrow icon
|
|
83
|
-
* - **positive
|
|
84
|
-
* - **negative
|
|
77
|
+
* Direction of the arrow icon displayed on the grabber button.
|
|
78
|
+
* - **positive**: Up arrow (horizontal) or right arrow (vertical)
|
|
79
|
+
* - **negative**: Down arrow (horizontal) or left arrow (vertical)
|
|
85
80
|
*
|
|
86
|
-
*
|
|
87
|
-
* @default
|
|
81
|
+
* Only applies when using a grabber button. Directions follow the Cartesian coordinate system.
|
|
82
|
+
* @default negative
|
|
88
83
|
*/
|
|
89
84
|
this.arrowDirection = DEFAULTS.ARROW_DIRECTION;
|
|
90
85
|
/**
|
|
91
|
-
* Position of the button
|
|
92
|
-
* - **positive
|
|
93
|
-
* - **negative
|
|
86
|
+
* Position of the grabber button along the divider line.
|
|
87
|
+
* - **positive**: Right side (horizontal) or top side (vertical)
|
|
88
|
+
* - **negative**: Left side (horizontal) or bottom side (vertical)
|
|
94
89
|
*
|
|
95
|
-
*
|
|
96
|
-
* @default
|
|
90
|
+
* Only applies when using a grabber button. Directions follow the Cartesian coordinate system.
|
|
91
|
+
* @default negative
|
|
97
92
|
*/
|
|
98
93
|
this.buttonPosition = DEFAULTS.BUTTON_DIRECTION;
|
|
99
94
|
}
|
|
@@ -2,28 +2,33 @@ import { CSSResult } from 'lit';
|
|
|
2
2
|
import { Component } from '../../models';
|
|
3
3
|
import type { MarkerVariants } from './marker.types';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* the content or to signify important information.
|
|
5
|
+
* The Marker component displays a vertical line (0.25rem wide) used to draw attention to specific content
|
|
6
|
+
* or signify important information. It provides visual emphasis through color and pattern variations.
|
|
8
7
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
8
|
+
* Markers are commonly used alongside list items, cards, or content blocks to indicate status,
|
|
9
|
+
* priority, or categorization.
|
|
10
|
+
*
|
|
11
|
+
* ## When to use
|
|
12
|
+
* Use markers to highlight important content, indicate status or priority levels, or provide
|
|
13
|
+
* visual categorization in lists and layouts.
|
|
14
|
+
*
|
|
15
|
+
* ## Accessibility
|
|
16
|
+
* - Markers are purely decorative and should not convey information solely through color
|
|
17
|
+
* - Always pair markers with text labels or other indicators to convey meaning
|
|
18
|
+
* - Ensure sufficient color contrast for visibility
|
|
12
19
|
*
|
|
13
20
|
* @tagname mdc-marker
|
|
14
21
|
*
|
|
15
|
-
* @cssproperty --mdc-marker-solid-background-color -
|
|
16
|
-
*
|
|
17
|
-
* @cssproperty --mdc-marker-striped-color -
|
|
18
|
-
* @cssproperty --mdc-marker-
|
|
19
|
-
* in striped variant.
|
|
20
|
-
* @cssproperty --mdc-marker-width - Allows customization of the default width.
|
|
22
|
+
* @cssproperty --mdc-marker-solid-background-color - Background color for solid variant markers.
|
|
23
|
+
* @cssproperty --mdc-marker-striped-color - Stripe color for striped variant markers.
|
|
24
|
+
* @cssproperty --mdc-marker-striped-background-color - Background color for striped variant markers.
|
|
25
|
+
* @cssproperty --mdc-marker-width - Width (thickness) of the marker line.
|
|
21
26
|
*/
|
|
22
27
|
declare class Marker extends Component {
|
|
23
28
|
/**
|
|
24
|
-
*
|
|
25
|
-
* - **solid**: Solid
|
|
26
|
-
* - **striped**:
|
|
29
|
+
* Visual style of the marker.
|
|
30
|
+
* - **solid**: Solid colored vertical line
|
|
31
|
+
* - **striped**: Vertical line with diagonal stripes pattern
|
|
27
32
|
* @default solid
|
|
28
33
|
*/
|
|
29
34
|
variant: MarkerVariants;
|
|
@@ -12,30 +12,35 @@ import { Component } from '../../models';
|
|
|
12
12
|
import styles from './marker.styles';
|
|
13
13
|
import { MARKER_VARIANTS } from './marker.constants';
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* the content or to signify important information.
|
|
15
|
+
* The Marker component displays a vertical line (0.25rem wide) used to draw attention to specific content
|
|
16
|
+
* or signify important information. It provides visual emphasis through color and pattern variations.
|
|
18
17
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
18
|
+
* Markers are commonly used alongside list items, cards, or content blocks to indicate status,
|
|
19
|
+
* priority, or categorization.
|
|
20
|
+
*
|
|
21
|
+
* ## When to use
|
|
22
|
+
* Use markers to highlight important content, indicate status or priority levels, or provide
|
|
23
|
+
* visual categorization in lists and layouts.
|
|
24
|
+
*
|
|
25
|
+
* ## Accessibility
|
|
26
|
+
* - Markers are purely decorative and should not convey information solely through color
|
|
27
|
+
* - Always pair markers with text labels or other indicators to convey meaning
|
|
28
|
+
* - Ensure sufficient color contrast for visibility
|
|
22
29
|
*
|
|
23
30
|
* @tagname mdc-marker
|
|
24
31
|
*
|
|
25
|
-
* @cssproperty --mdc-marker-solid-background-color -
|
|
26
|
-
*
|
|
27
|
-
* @cssproperty --mdc-marker-striped-color -
|
|
28
|
-
* @cssproperty --mdc-marker-
|
|
29
|
-
* in striped variant.
|
|
30
|
-
* @cssproperty --mdc-marker-width - Allows customization of the default width.
|
|
32
|
+
* @cssproperty --mdc-marker-solid-background-color - Background color for solid variant markers.
|
|
33
|
+
* @cssproperty --mdc-marker-striped-color - Stripe color for striped variant markers.
|
|
34
|
+
* @cssproperty --mdc-marker-striped-background-color - Background color for striped variant markers.
|
|
35
|
+
* @cssproperty --mdc-marker-width - Width (thickness) of the marker line.
|
|
31
36
|
*/
|
|
32
37
|
class Marker extends Component {
|
|
33
38
|
constructor() {
|
|
34
39
|
super(...arguments);
|
|
35
40
|
/**
|
|
36
|
-
*
|
|
37
|
-
* - **solid**: Solid
|
|
38
|
-
* - **striped**:
|
|
41
|
+
* Visual style of the marker.
|
|
42
|
+
* - **solid**: Solid colored vertical line
|
|
43
|
+
* - **striped**: Vertical line with diagonal stripes pattern
|
|
39
44
|
* @default solid
|
|
40
45
|
*/
|
|
41
46
|
this.variant = MARKER_VARIANTS.SOLID;
|
|
@@ -344,8 +344,6 @@ declare class Popover extends Popover_base {
|
|
|
344
344
|
animationFrame: boolean;
|
|
345
345
|
arrowElement: HTMLElement | null;
|
|
346
346
|
/** @internal */
|
|
347
|
-
private hoverTimer;
|
|
348
|
-
/** @internal */
|
|
349
347
|
private isHovered;
|
|
350
348
|
/** @internal */
|
|
351
349
|
private openDelay;
|
|
@@ -380,6 +378,7 @@ declare class Popover extends Popover_base {
|
|
|
380
378
|
* @internal
|
|
381
379
|
*/
|
|
382
380
|
get triggerElement(): HTMLElement | null;
|
|
381
|
+
private timers;
|
|
383
382
|
constructor();
|
|
384
383
|
private parseTrigger;
|
|
385
384
|
protected firstUpdated(changedProperties: PropertyValues): Promise<void>;
|
|
@@ -452,6 +451,10 @@ declare class Popover extends Popover_base {
|
|
|
452
451
|
* This method checks if the trigger element has visible focus or is being hovered.
|
|
453
452
|
*/
|
|
454
453
|
private handleFocusIn;
|
|
454
|
+
/**
|
|
455
|
+
* Cancels the open delay timer.
|
|
456
|
+
*/
|
|
457
|
+
private cancelOpenDelay;
|
|
455
458
|
/**
|
|
456
459
|
* Starts the close delay timer.
|
|
457
460
|
* If the popover is not interactive, it will close the popover after the delay.
|
|
@@ -16,7 +16,8 @@ import { Component } from '../../models';
|
|
|
16
16
|
import { BackdropMixin } from '../../utils/mixins/BackdropMixin';
|
|
17
17
|
import { FocusTrapMixin } from '../../utils/mixins/FocusTrapMixin';
|
|
18
18
|
import { PreventScrollMixin } from '../../utils/mixins/PreventScrollMixin';
|
|
19
|
-
import {
|
|
19
|
+
import { Timers } from '../../utils/controllers/Timers';
|
|
20
|
+
import { COLOR, DEFAULTS, POPOVER_PLACEMENT, TIMEOUTS, TRIGGER } from './popover.constants';
|
|
20
21
|
import { PopoverEventManager } from './popover.events';
|
|
21
22
|
import { popoverStack } from './popover.stack';
|
|
22
23
|
import styles from './popover.styles';
|
|
@@ -365,8 +366,6 @@ class Popover extends BackdropMixin(PreventScrollMixin(FocusTrapMixin(Component)
|
|
|
365
366
|
this.animationFrame = DEFAULTS.ANIMATION_FRAME;
|
|
366
367
|
this.arrowElement = null;
|
|
367
368
|
/** @internal */
|
|
368
|
-
this.hoverTimer = null;
|
|
369
|
-
/** @internal */
|
|
370
369
|
this.isHovered = false;
|
|
371
370
|
/** @internal */
|
|
372
371
|
this.openDelay = 0;
|
|
@@ -385,6 +384,7 @@ class Popover extends BackdropMixin(PreventScrollMixin(FocusTrapMixin(Component)
|
|
|
385
384
|
* @internal
|
|
386
385
|
*/
|
|
387
386
|
this.popoverDepth = 0;
|
|
387
|
+
this.timers = new Timers(this);
|
|
388
388
|
this.parseTrigger = () => {
|
|
389
389
|
var _a;
|
|
390
390
|
const triggers = ((_a = this.trigger) === null || _a === void 0 ? void 0 : _a.split(' ')) || [];
|
|
@@ -556,57 +556,77 @@ class Popover extends BackdropMixin(PreventScrollMixin(FocusTrapMixin(Component)
|
|
|
556
556
|
this.show();
|
|
557
557
|
}
|
|
558
558
|
};
|
|
559
|
+
/**
|
|
560
|
+
* Cancels the open delay timer.
|
|
561
|
+
*/
|
|
562
|
+
this.cancelOpenDelay = () => {
|
|
563
|
+
this.timers.clearTimeout(TIMEOUTS.OPEN);
|
|
564
|
+
};
|
|
559
565
|
/**
|
|
560
566
|
* Starts the close delay timer.
|
|
561
567
|
* If the popover is not interactive, it will close the popover after the delay.
|
|
562
568
|
*/
|
|
563
569
|
this.startCloseDelay = () => {
|
|
570
|
+
this.cancelOpenDelay();
|
|
564
571
|
if (!this.interactive) {
|
|
565
572
|
this.hide();
|
|
566
573
|
}
|
|
567
574
|
else {
|
|
568
|
-
|
|
575
|
+
const callback = () => {
|
|
569
576
|
this.visible = false;
|
|
570
|
-
}
|
|
577
|
+
};
|
|
578
|
+
if (this.closeDelay > 0) {
|
|
579
|
+
this.timers.setTimeout(TIMEOUTS.HOVER, callback, this.closeDelay);
|
|
580
|
+
}
|
|
581
|
+
else {
|
|
582
|
+
this.timers.clearTimeout(TIMEOUTS.HOVER);
|
|
583
|
+
callback();
|
|
584
|
+
}
|
|
571
585
|
}
|
|
572
586
|
};
|
|
573
587
|
/**
|
|
574
588
|
* Cancels the close delay timer.
|
|
575
589
|
*/
|
|
576
590
|
this.cancelCloseDelay = () => {
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
this.hoverTimer = null;
|
|
580
|
-
}
|
|
591
|
+
this.timers.clearTimeout(TIMEOUTS.HOVER);
|
|
592
|
+
this.timers.clearTimeout(TIMEOUTS.CLOSE);
|
|
581
593
|
};
|
|
582
594
|
/**
|
|
583
595
|
* Shows the popover.
|
|
584
596
|
*/
|
|
585
597
|
this.show = () => {
|
|
586
|
-
if (this.
|
|
598
|
+
if (this.shouldSuppressOpening) {
|
|
587
599
|
return;
|
|
588
600
|
}
|
|
589
601
|
this.cancelCloseDelay();
|
|
602
|
+
if (this.visible) {
|
|
603
|
+
return;
|
|
604
|
+
}
|
|
605
|
+
const callback = () => {
|
|
606
|
+
this.visible = true;
|
|
607
|
+
};
|
|
590
608
|
if (this.openDelay > 0) {
|
|
591
|
-
setTimeout(
|
|
592
|
-
this.visible = true;
|
|
593
|
-
}, this.openDelay);
|
|
609
|
+
this.timers.setTimeout(TIMEOUTS.OPEN, callback, this.openDelay);
|
|
594
610
|
}
|
|
595
611
|
else {
|
|
596
|
-
this.
|
|
612
|
+
this.timers.clearTimeout(TIMEOUTS.OPEN);
|
|
613
|
+
callback();
|
|
597
614
|
}
|
|
598
615
|
};
|
|
599
616
|
/**
|
|
600
617
|
* Hides the popover.
|
|
601
618
|
*/
|
|
602
619
|
this.hide = () => {
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
620
|
+
this.cancelOpenDelay();
|
|
621
|
+
const callback = () => {
|
|
622
|
+
this.visible = false;
|
|
623
|
+
};
|
|
624
|
+
if (this.closeDelay > 0) {
|
|
625
|
+
this.timers.setTimeout(TIMEOUTS.CLOSE, callback, this.closeDelay);
|
|
607
626
|
}
|
|
608
627
|
else {
|
|
609
|
-
this.
|
|
628
|
+
this.timers.clearTimeout(TIMEOUTS.CLOSE);
|
|
629
|
+
callback();
|
|
610
630
|
}
|
|
611
631
|
};
|
|
612
632
|
/**
|
|
@@ -724,8 +744,6 @@ class Popover extends BackdropMixin(PreventScrollMixin(FocusTrapMixin(Component)
|
|
|
724
744
|
this.moveElementBackAfterBackdropRemoval(this.triggerElement);
|
|
725
745
|
this.removeBackdrop();
|
|
726
746
|
(_b = this.floatingUICleanupFunction) === null || _b === void 0 ? void 0 : _b.call(this);
|
|
727
|
-
// clean timer if there is one set:
|
|
728
|
-
this.cancelCloseDelay();
|
|
729
747
|
if (!this.keepConnectedTooltipOpen) {
|
|
730
748
|
if (this.connectedTooltip) {
|
|
731
749
|
this.connectedTooltip.shouldSuppressOpening = false;
|