@momentum-design/components 0.117.3 → 0.118.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.
Files changed (50) hide show
  1. package/dist/browser/index.js +562 -487
  2. package/dist/browser/index.js.map +4 -4
  3. package/dist/components/announcementdialog/announcementdialog.component.d.ts +87 -0
  4. package/dist/components/announcementdialog/announcementdialog.component.js +131 -0
  5. package/dist/components/announcementdialog/announcementdialog.constants.d.ts +6 -0
  6. package/dist/components/announcementdialog/announcementdialog.constants.js +7 -0
  7. package/dist/components/announcementdialog/announcementdialog.styles.d.ts +2 -0
  8. package/dist/components/announcementdialog/announcementdialog.styles.js +52 -0
  9. package/dist/components/announcementdialog/announcementdialog.types.d.ts +6 -0
  10. package/dist/components/announcementdialog/announcementdialog.types.js +1 -0
  11. package/dist/components/announcementdialog/index.d.ts +9 -0
  12. package/dist/components/announcementdialog/index.js +6 -0
  13. package/dist/components/checkbox/checkbox.component.d.ts +5 -0
  14. package/dist/components/checkbox/checkbox.component.js +5 -0
  15. package/dist/components/combobox/combobox.component.d.ts +4 -0
  16. package/dist/components/combobox/combobox.component.js +4 -0
  17. package/dist/components/dialog/dialog.component.d.ts +14 -1
  18. package/dist/components/dialog/dialog.component.js +43 -27
  19. package/dist/components/dialog/dialog.styles.js +2 -0
  20. package/dist/components/dialog/dialog.types.d.ts +1 -1
  21. package/dist/components/formfieldgroup/formfieldgroup.component.d.ts +4 -0
  22. package/dist/components/formfieldgroup/formfieldgroup.component.js +4 -0
  23. package/dist/components/formfieldwrapper/formfieldwrapper.component.d.ts +10 -6
  24. package/dist/components/formfieldwrapper/formfieldwrapper.component.js +37 -23
  25. package/dist/components/formfieldwrapper/formfieldwrapper.constants.d.ts +1 -0
  26. package/dist/components/formfieldwrapper/formfieldwrapper.constants.js +1 -0
  27. package/dist/components/input/input.component.d.ts +9 -0
  28. package/dist/components/input/input.component.js +9 -0
  29. package/dist/components/popover/popover.constants.d.ts +1 -1
  30. package/dist/components/popover/popover.constants.js +1 -1
  31. package/dist/custom-elements.json +2438 -284
  32. package/dist/index.d.ts +2 -1
  33. package/dist/index.js +2 -1
  34. package/dist/react/announcementdialog/index.d.ts +75 -0
  35. package/dist/react/announcementdialog/index.js +82 -0
  36. package/dist/react/checkbox/index.d.ts +5 -0
  37. package/dist/react/checkbox/index.js +5 -0
  38. package/dist/react/combobox/index.d.ts +4 -0
  39. package/dist/react/combobox/index.js +4 -0
  40. package/dist/react/dialog/index.d.ts +1 -0
  41. package/dist/react/dialog/index.js +1 -0
  42. package/dist/react/formfieldgroup/index.d.ts +4 -0
  43. package/dist/react/formfieldgroup/index.js +4 -0
  44. package/dist/react/formfieldwrapper/index.d.ts +4 -1
  45. package/dist/react/formfieldwrapper/index.js +4 -1
  46. package/dist/react/index.d.ts +2 -1
  47. package/dist/react/index.js +2 -1
  48. package/dist/react/input/index.d.ts +9 -0
  49. package/dist/react/input/index.js +9 -0
  50. package/package.json +1 -1
@@ -29,16 +29,19 @@ import { getHelperIcon } from './formfieldwrapper.utils';
29
29
  * @dependency mdc-button
30
30
  * @dependency mdc-toggletip
31
31
  *
32
- *
32
+ * @slot label - Slot for the label element. If not provided, the `label` property will be used to render the label.
33
+ * @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.
34
+ * @slot help-icon - Slot for the helper/validation icon. If not provided, the icon will be rendered based on the `helpTextType` property.
35
+ * @slot help-text - Slot for the helper/validation text. If not provided, the `helpText` property will be used to render the helper/validation text.
33
36
  */
34
37
  class FormfieldWrapper extends DisabledMixin(Component) {
35
38
  constructor() {
36
39
  super(...arguments);
37
40
  /**
38
- * Indicates the unique identifier for the native input element.
39
- * Required for acccessibility.
40
- * @internal
41
- */
41
+ * Indicates the unique identifier for the native input element.
42
+ * Required for acccessibility.
43
+ * @internal
44
+ */
42
45
  this.inputId = `mdc-el-${uuidv4()}`;
43
46
  /**
44
47
  * The required attribute to indicate that the input field is required.
@@ -55,6 +58,7 @@ class FormfieldWrapper extends DisabledMixin(Component) {
55
58
  * @default 'top'
56
59
  */
57
60
  this.toggletipPlacement = DEFAULTS.TOGGLETIP_PLACEMENT;
61
+ this.toggletipStrategy = DEFAULTS.TOGGLETIP_STRATEGY;
58
62
  /** @internal */
59
63
  this.shouldRenderLabel = true;
60
64
  }
@@ -68,7 +72,9 @@ class FormfieldWrapper extends DisabledMixin(Component) {
68
72
  return nothing;
69
73
  }
70
74
  return this.shouldRenderLabel
71
- ? html `<label for="${this.inputId}" id="${DEFAULTS.HEADING_ID}" class="mdc-label" part="label">${this.label}</label>`
75
+ ? html `<label for="${this.inputId}" id="${DEFAULTS.HEADING_ID}" class="mdc-label" part="label"
76
+ >${this.label}</label
77
+ >`
72
78
  : html ` <mdc-text
73
79
  id="${DEFAULTS.HEADING_ID}"
74
80
  tagname="${MDC_TEXT_OPTIONS.TAGNAME}"
@@ -119,28 +125,32 @@ class FormfieldWrapper extends DisabledMixin(Component) {
119
125
  renderLabel() {
120
126
  if (!this.label)
121
127
  return nothing;
128
+ const triggerId = `toggletip-trigger-${uuidv4()}`;
122
129
  return html `<div class="mdc-label-text" part="label-text">
123
130
  <slot name="label">${this.renderLabelElement()}</slot>
124
131
  ${this.required ? html `<span part="required-indicator">*</span>` : nothing}
125
- ${this.toggletipText
132
+ <slot name="toggletip">
133
+ ${this.toggletipText
126
134
  ? html ` <mdc-button
127
- part="info-icon-btn"
128
- prefix-icon="${DEFAULTS.INFO_ICON}"
129
- size="${DEFAULTS.ICON_SIZE}"
130
- variant="${BUTTON_VARIANTS.TERTIARY}"
131
- aria-label="${ifDefined(this.infoIconAriaLabel)}"
132
- ?disabled="${this.disabled}"
133
- id="info-icon-id"
134
- ></mdc-button>
135
- <mdc-toggletip
136
- part="label-toggletip"
137
- triggerid="info-icon-id"
138
- id="label-toggletip-id"
139
- placement="${this.toggletipPlacement}"
140
- show-arrow
141
- >${this.toggletipText}</mdc-toggletip
142
- >`
135
+ part="info-icon-btn"
136
+ prefix-icon="${DEFAULTS.INFO_ICON}"
137
+ size="${DEFAULTS.ICON_SIZE}"
138
+ variant="${BUTTON_VARIANTS.TERTIARY}"
139
+ aria-label="${ifDefined(this.infoIconAriaLabel)}"
140
+ ?disabled="${this.disabled}"
141
+ id="${triggerId}"
142
+ ></mdc-button>
143
+ <mdc-toggletip
144
+ part="label-toggletip"
145
+ triggerid="${triggerId}"
146
+ id="label-toggletip-id"
147
+ placement="${this.toggletipPlacement}"
148
+ strategy="${this.toggletipStrategy}"
149
+ show-arrow
150
+ >${this.toggletipText}</mdc-toggletip
151
+ >`
143
152
  : nothing}
153
+ </slot>
144
154
  </div>`;
145
155
  }
146
156
  /**
@@ -182,6 +192,10 @@ __decorate([
182
192
  property({ type: String, reflect: true, attribute: 'toggletip-placement' }),
183
193
  __metadata("design:type", String)
184
194
  ], FormfieldWrapper.prototype, "toggletipPlacement", void 0);
195
+ __decorate([
196
+ property({ type: String, reflect: true, attribute: 'toggletip-strategy' }),
197
+ __metadata("design:type", String)
198
+ ], FormfieldWrapper.prototype, "toggletipStrategy", void 0);
185
199
  __decorate([
186
200
  property({ type: String, reflect: true, attribute: 'info-icon-aria-label' }),
187
201
  __metadata("design:type", String)
@@ -14,6 +14,7 @@ declare const DEFAULTS: {
14
14
  readonly ICON_SIZE: 20;
15
15
  readonly INFO_ICON: Extract<IconNames, "info-badge-filled">;
16
16
  readonly TOGGLETIP_PLACEMENT: "top";
17
+ readonly TOGGLETIP_STRATEGY: "absolute";
17
18
  };
18
19
  declare const MDC_TEXT_OPTIONS: {
19
20
  readonly TAGNAME: "span";
@@ -15,6 +15,7 @@ const DEFAULTS = {
15
15
  ICON_SIZE: 20,
16
16
  INFO_ICON: 'info-badge-filled',
17
17
  TOGGLETIP_PLACEMENT: 'top',
18
+ TOGGLETIP_STRATEGY: 'absolute',
18
19
  };
19
20
  const MDC_TEXT_OPTIONS = {
20
21
  TAGNAME: VALID_TEXT_TAGS.SPAN,
@@ -29,6 +29,15 @@ declare const Input_base: import("../../utils/mixins/index.types").Constructor<i
29
29
  * @dependency mdc-button
30
30
  * @dependency mdc-toggletip
31
31
  *
32
+ * @slot label - Slot for the label element. If not provided, the `label` property will be used to render the label.
33
+ * @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.
34
+ * @slot help-icon - Slot for the helper/validation icon. If not provided, the icon will be rendered based on the `helpTextType` property.
35
+ * @slot help-text - Slot for the helper/validation text. If not provided, the `helpText` property will be used to render the helper/validation text.
36
+ * @slot input - Slot for the input element. If not provided, the input field will be rendered.
37
+ * @slot input-leading-icon - Slot for the leading icon before the input field. If not provided, the `leadingIcon` property will be used to render the leading icon.
38
+ * @slot input-prefix-text - Slot for the prefix text before the input field. If not provided, the `prefixText` property will be used to render the prefix text.
39
+ * @slot trailing-button - Slot for the trailing button to clear the input field. If not provided, the clear button will be rendered when `trailingButton` property is set to true.
40
+ *
32
41
  * @cssproperty --mdc-input-disabled-border-color - Border color for the input container when disabled
33
42
  * @cssproperty --mdc-input-disabled-text-color - Text color for the input field when disabled
34
43
  * @cssproperty --mdc-input-disabled-background-color - Background color for the input field when disabled
@@ -44,6 +44,15 @@ import styles from './input.styles';
44
44
  * @dependency mdc-button
45
45
  * @dependency mdc-toggletip
46
46
  *
47
+ * @slot label - Slot for the label element. If not provided, the `label` property will be used to render the label.
48
+ * @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.
49
+ * @slot help-icon - Slot for the helper/validation icon. If not provided, the icon will be rendered based on the `helpTextType` property.
50
+ * @slot help-text - Slot for the helper/validation text. If not provided, the `helpText` property will be used to render the helper/validation text.
51
+ * @slot input - Slot for the input element. If not provided, the input field will be rendered.
52
+ * @slot input-leading-icon - Slot for the leading icon before the input field. If not provided, the `leadingIcon` property will be used to render the leading icon.
53
+ * @slot input-prefix-text - Slot for the prefix text before the input field. If not provided, the `prefixText` property will be used to render the prefix text.
54
+ * @slot trailing-button - Slot for the trailing button to clear the input field. If not provided, the clear button will be rendered when `trailingButton` property is set to true.
55
+ *
47
56
  * @cssproperty --mdc-input-disabled-border-color - Border color for the input container when disabled
48
57
  * @cssproperty --mdc-input-disabled-text-color - Text color for the input field when disabled
49
58
  * @cssproperty --mdc-input-disabled-background-color - Background color for the input field when disabled
@@ -31,6 +31,7 @@ declare const DEFAULTS: {
31
31
  readonly PLACEMENT: "bottom";
32
32
  readonly TRIGGER: "click";
33
33
  readonly COLOR: "tonal";
34
+ readonly STRATEGY: "absolute";
34
35
  readonly OFFSET: 4;
35
36
  readonly BOUNDARY: "clippingAncestors";
36
37
  readonly BOUNDARY_ROOT: "viewport";
@@ -54,7 +55,6 @@ declare const DEFAULTS: {
54
55
  readonly DISABLE_ARIA_EXPANDED: false;
55
56
  readonly PROPAGATE_EVENT_ON_ESCAPE: false;
56
57
  readonly KEEP_CONNECTED_TOOLTIP_CLOSED: true;
57
- readonly STRATEGY: "absolute";
58
58
  readonly IS_BACKDROP_INVISIBLE: true;
59
59
  };
60
60
  export { TAG_NAME, POPOVER_PLACEMENT, COLOR, STRATEGY, TRIGGER, DEFAULTS };
@@ -33,6 +33,7 @@ const DEFAULTS = {
33
33
  PLACEMENT: POPOVER_PLACEMENT.BOTTOM,
34
34
  TRIGGER: TRIGGER.CLICK,
35
35
  COLOR: COLOR.TONAL,
36
+ STRATEGY: STRATEGY.ABSOLUTE,
36
37
  OFFSET: 4,
37
38
  BOUNDARY: 'clippingAncestors',
38
39
  BOUNDARY_ROOT: 'viewport',
@@ -56,7 +57,6 @@ const DEFAULTS = {
56
57
  DISABLE_ARIA_EXPANDED: false,
57
58
  PROPAGATE_EVENT_ON_ESCAPE: false,
58
59
  KEEP_CONNECTED_TOOLTIP_CLOSED: true,
59
- STRATEGY: 'absolute',
60
60
  IS_BACKDROP_INVISIBLE: true,
61
61
  };
62
62
  export { TAG_NAME, POPOVER_PLACEMENT, COLOR, STRATEGY, TRIGGER, DEFAULTS };