@momentum-design/components 0.129.18 → 0.129.20

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.
@@ -58,6 +58,7 @@ declare class FormfieldWrapper extends FormfieldWrapper_base {
58
58
  required: boolean;
59
59
  /**
60
60
  * The type of help text. It can be 'default', 'error', 'warning', 'success', 'priority'.
61
+ * @default 'default'
61
62
  */
62
63
  helpTextType: ValidationType;
63
64
  /**
@@ -74,6 +75,10 @@ declare class FormfieldWrapper extends FormfieldWrapper_base {
74
75
  * @default 'top'
75
76
  */
76
77
  toggletipPlacement: PopoverPlacement;
78
+ /**
79
+ * The strategy of the toggletip that is displayed when the info icon is hovered.
80
+ * @default 'absolute'
81
+ */
77
82
  toggletipStrategy: PopoverStrategy;
78
83
  /**
79
84
  * Aria label for the info icon that is displayed next to the label when `toggletipText` is set.
@@ -70,6 +70,7 @@ class FormfieldWrapper extends DisabledMixin(Component) {
70
70
  this.required = false;
71
71
  /**
72
72
  * The type of help text. It can be 'default', 'error', 'warning', 'success', 'priority'.
73
+ * @default 'default'
73
74
  */
74
75
  this.helpTextType = DEFAULTS.VALIDATION;
75
76
  /**
@@ -77,6 +78,10 @@ class FormfieldWrapper extends DisabledMixin(Component) {
77
78
  * @default 'top'
78
79
  */
79
80
  this.toggletipPlacement = DEFAULTS.TOGGLETIP_PLACEMENT;
81
+ /**
82
+ * The strategy of the toggletip that is displayed when the info icon is hovered.
83
+ * @default 'absolute'
84
+ */
80
85
  this.toggletipStrategy = DEFAULTS.TOGGLETIP_STRATEGY;
81
86
  /**
82
87
  * Determines whether the form field is read-only.
@@ -1,4 +1,4 @@
1
- import { IconNames } from '../icon/icon.types';
1
+ import type { IconNames } from '../icon/icon.types';
2
2
  declare const TAG_NAME: "mdc-formfieldwrapper";
3
3
  declare const VALIDATION: {
4
4
  readonly DEFAULT: "default";
@@ -1,4 +1,5 @@
1
1
  import utils from '../../utils/tag-name';
2
+ import { POPOVER_PLACEMENT, STRATEGY } from '../popover/popover.constants';
2
3
  import { TYPE, VALID_TEXT_TAGS } from '../text/text.constants';
3
4
  const TAG_NAME = utils.constructTagName('formfieldwrapper');
4
5
  const VALIDATION = {
@@ -14,8 +15,8 @@ const DEFAULTS = {
14
15
  HEADING_ID: 'heading-id',
15
16
  ICON_SIZE: 20,
16
17
  INFO_ICON: 'info-badge-filled',
17
- TOGGLETIP_PLACEMENT: 'top',
18
- TOGGLETIP_STRATEGY: 'absolute',
18
+ TOGGLETIP_PLACEMENT: POPOVER_PLACEMENT.TOP,
19
+ TOGGLETIP_STRATEGY: STRATEGY.ABSOLUTE,
19
20
  };
20
21
  const MDC_TEXT_OPTIONS = {
21
22
  TAGNAME: VALID_TEXT_TAGS.SPAN,
@@ -9,6 +9,7 @@ declare const Select_base: import("../../utils/mixins/index.types").Constructor<
9
9
  /**
10
10
  * The mdc-select component is a dropdown selection control that allows users to pick an option from a predefined list.
11
11
  * It is designed to work with `mdc-option` for individual options and `mdc-optgroup` for grouping related options.
12
+ * Optional: Add `mdc-divider` after each option group (`mdc-optgroup`) to separate groups visually.
12
13
  *
13
14
  * Every mdc-option should have a `value` attribute set to ensure proper form submission.
14
15
  *
@@ -27,14 +28,13 @@ declare const Select_base: import("../../utils/mixins/index.types").Constructor<
27
28
  *
28
29
  * @tagname mdc-select
29
30
  *
30
- * @slot default - This is a default/unnamed slot for Selectlistbox including options and/or option group.
31
- *
32
31
  * @event click - (React: onClick) This event is dispatched when the select is clicked.
33
32
  * @event change - (React: onChange) This event is dispatched when the select is changed.
34
33
  * @event input - (React: onInput) This event is dispatched when the select is changed.
35
34
  * @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the select.
36
35
  * @event focus - (React: onFocus) This event is dispatched when the select receives focus.
37
36
  *
37
+ * @slot default - This is a default/unnamed slot for Selectlistbox including options and/or option group.
38
38
  * @slot label - Slot for the label element. If not provided, the `label` property will be used to render the label.
39
39
  * @slot toggletip - Slot for the toggletip info icon button. If not provided, the `toggletip-text` property will be used to render the info icon button and toggletip.
40
40
  * @slot help-icon - Slot for the helper/validation icon. If not provided, the icon will be rendered based on the `helpTextType` property.
@@ -30,6 +30,7 @@ import styles from './select.styles';
30
30
  /**
31
31
  * The mdc-select component is a dropdown selection control that allows users to pick an option from a predefined list.
32
32
  * It is designed to work with `mdc-option` for individual options and `mdc-optgroup` for grouping related options.
33
+ * Optional: Add `mdc-divider` after each option group (`mdc-optgroup`) to separate groups visually.
33
34
  *
34
35
  * Every mdc-option should have a `value` attribute set to ensure proper form submission.
35
36
  *
@@ -48,14 +49,13 @@ import styles from './select.styles';
48
49
  *
49
50
  * @tagname mdc-select
50
51
  *
51
- * @slot default - This is a default/unnamed slot for Selectlistbox including options and/or option group.
52
- *
53
52
  * @event click - (React: onClick) This event is dispatched when the select is clicked.
54
53
  * @event change - (React: onChange) This event is dispatched when the select is changed.
55
54
  * @event input - (React: onInput) This event is dispatched when the select is changed.
56
55
  * @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the select.
57
56
  * @event focus - (React: onFocus) This event is dispatched when the select receives focus.
58
57
  *
58
+ * @slot default - This is a default/unnamed slot for Selectlistbox including options and/or option group.
59
59
  * @slot label - Slot for the label element. If not provided, the `label` property will be used to render the label.
60
60
  * @slot toggletip - Slot for the toggletip info icon button. If not provided, the `toggletip-text` property will be used to render the info icon button and toggletip.
61
61
  * @slot help-icon - Slot for the helper/validation icon. If not provided, the icon will be rendered based on the `helpTextType` property.
@@ -16,10 +16,10 @@ declare const VirtualizedList_base: import("../../utils/mixins/index.types").Con
16
16
  *
17
17
  * ## Setup
18
18
  *
19
- * `virtualizerProps` is a required prop that requires at least two properties to be set: `count` and `estimateSize`.
20
- * `count` is the total number of items in the list, and `estimateSize` is a function that returns the estimated
21
- * size (in pixels) of each item in the list. `getItemKey` is also strongly recommended to be set to provide unique
22
- * keys for each item in the list.
19
+ * `virtualizerProps` is a required prop that requires at least three properties to be set:
20
+ * - `count` is the total number of items in the list
21
+ * - `estimateSize` is a function that returns the estimated size (in pixels) of each item in the list
22
+ * - `getItemKey` is a function that returns a unique key for each item in the list.
23
23
  *
24
24
  * ### Render list items
25
25
  *
@@ -48,6 +48,19 @@ declare const VirtualizedList_base: import("../../utils/mixins/index.types").Con
48
48
  * Unique keys for the list items are critical for dynamically changing list items or item's content.
49
49
  * If the key change with the content it will cause scrollbar and content shuttering.
50
50
  *
51
+ * ### Top/Bottom Padding
52
+ *
53
+ * If padding is required at the top or the bottom of the list, do not apply padding/margin via CSS since this
54
+ * will break the virtualization calculations and can cause scrollbars when they are not necessary.
55
+ * Instead use the `paddingStart` and `paddingEnd` properties (in pixels) of the `virtualizerProps` prop.
56
+ *
57
+ * ### Gaps between items
58
+ *
59
+ * If you are adding gaps between items using CSS margin or gap properties, you must provide the same value in pixels
60
+ * to the `gap` property of the `virtualizerProps` prop. This ensures that the virtualization calculations are accurate.
61
+ * If you are using CSS margins, ensure that you are not applying the margin to the top of the first or the bottom of the last item.
62
+ * If you need spacing there, use the `paddingStart` and `paddingEnd` properties of the `virtualizerProps` prop.
63
+ *
51
64
  * @tagname mdc-virtualizedlist
52
65
  *
53
66
  * @event scroll - (React: onScroll) Event that gets called when user scrolls inside of list.
@@ -30,10 +30,10 @@ import { DEFAULTS } from './virtualizedlist.constants';
30
30
  *
31
31
  * ## Setup
32
32
  *
33
- * `virtualizerProps` is a required prop that requires at least two properties to be set: `count` and `estimateSize`.
34
- * `count` is the total number of items in the list, and `estimateSize` is a function that returns the estimated
35
- * size (in pixels) of each item in the list. `getItemKey` is also strongly recommended to be set to provide unique
36
- * keys for each item in the list.
33
+ * `virtualizerProps` is a required prop that requires at least three properties to be set:
34
+ * - `count` is the total number of items in the list
35
+ * - `estimateSize` is a function that returns the estimated size (in pixels) of each item in the list
36
+ * - `getItemKey` is a function that returns a unique key for each item in the list.
37
37
  *
38
38
  * ### Render list items
39
39
  *
@@ -62,6 +62,19 @@ import { DEFAULTS } from './virtualizedlist.constants';
62
62
  * Unique keys for the list items are critical for dynamically changing list items or item's content.
63
63
  * If the key change with the content it will cause scrollbar and content shuttering.
64
64
  *
65
+ * ### Top/Bottom Padding
66
+ *
67
+ * If padding is required at the top or the bottom of the list, do not apply padding/margin via CSS since this
68
+ * will break the virtualization calculations and can cause scrollbars when they are not necessary.
69
+ * Instead use the `paddingStart` and `paddingEnd` properties (in pixels) of the `virtualizerProps` prop.
70
+ *
71
+ * ### Gaps between items
72
+ *
73
+ * If you are adding gaps between items using CSS margin or gap properties, you must provide the same value in pixels
74
+ * to the `gap` property of the `virtualizerProps` prop. This ensures that the virtualization calculations are accurate.
75
+ * If you are using CSS margins, ensure that you are not applying the margin to the top of the first or the bottom of the last item.
76
+ * If you need spacing there, use the `paddingStart` and `paddingEnd` properties of the `virtualizerProps` prop.
77
+ *
65
78
  * @tagname mdc-virtualizedlist
66
79
  *
67
80
  * @event scroll - (React: onScroll) Event that gets called when user scrolls inside of list.