@momentum-design/components 0.18.4 → 0.18.6

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 (35) hide show
  1. package/dist/browser/index.js +427 -62
  2. package/dist/browser/index.js.map +4 -4
  3. package/dist/components/checkbox/checkbox.component.d.ts +71 -0
  4. package/dist/components/checkbox/checkbox.component.js +150 -0
  5. package/dist/components/checkbox/checkbox.constants.d.ts +6 -0
  6. package/dist/components/checkbox/checkbox.constants.js +7 -0
  7. package/dist/components/checkbox/checkbox.styles.d.ts +2 -0
  8. package/dist/components/checkbox/checkbox.styles.js +106 -0
  9. package/dist/components/checkbox/index.d.ts +8 -0
  10. package/dist/components/checkbox/index.js +5 -0
  11. package/dist/components/formfieldwrapper/formfieldwrapper.constants.d.ts +3 -3
  12. package/dist/components/formfieldwrapper/formfieldwrapper.constants.js +3 -3
  13. package/dist/components/formfieldwrapper/formfieldwrapper.utils.js +4 -4
  14. package/dist/components/input/index.d.ts +10 -0
  15. package/dist/components/input/index.js +7 -0
  16. package/dist/components/input/input.component.d.ts +208 -0
  17. package/dist/components/input/input.component.js +401 -0
  18. package/dist/components/input/input.constants.d.ts +25 -0
  19. package/dist/components/input/input.constants.js +29 -0
  20. package/dist/components/input/input.styles.d.ts +2 -0
  21. package/dist/components/input/input.styles.js +118 -0
  22. package/dist/components/input/input.types.d.ts +4 -0
  23. package/dist/components/input/input.types.js +1 -0
  24. package/dist/custom-elements.json +2569 -1222
  25. package/dist/index.d.ts +3 -1
  26. package/dist/index.js +3 -1
  27. package/dist/react/checkbox/index.d.ts +27 -0
  28. package/dist/react/checkbox/index.js +36 -0
  29. package/dist/react/index.d.ts +5 -3
  30. package/dist/react/index.js +5 -3
  31. package/dist/react/input/index.d.ts +39 -0
  32. package/dist/react/input/index.js +48 -0
  33. package/dist/utils/mixins/DataAriaLabelMixin.d.ts +6 -0
  34. package/dist/utils/mixins/DataAriaLabelMixin.js +29 -0
  35. package/package.json +1 -1
@@ -0,0 +1,71 @@
1
+ import { CSSResult, PropertyValues } from 'lit';
2
+ import FormfieldWrapper from '../formfieldwrapper/formfieldwrapper.component';
3
+ declare const Checkbox_base: import("../../utils/mixins/index.types").Constructor<import("../../utils/mixins/NameMixin").NameMixinInterface> & import("../../utils/mixins/index.types").Constructor<import("../../utils/mixins/ValueMixin").ValueMixinInterface> & import("../../utils/mixins/index.types").Constructor<import("../../utils/mixins/DataAriaLabelMixin").DataAriaLabelMixinInterface> & typeof FormfieldWrapper;
4
+ /**
5
+ * Checkboxes allow users to select multiple options from a list or turn an item/feature on or off.
6
+ * These are often used in forms, settings, and selections in lists.
7
+ *
8
+ * A checkbox component contains an optional label and an optional helper text.
9
+ *
10
+ * @dependency mdc-icon
11
+ *
12
+ * @tagname mdc-checkbox
13
+ *
14
+ * @cssproperty --mdc-checkbox-background-color-hover - Allows customization of the background color on hover.
15
+ * @cssproperty --mdc-checkbox-border-color - Border color in high contrast.
16
+ * @cssproperty --mdc-checkbox-checked-background-color - Background color for a selected checkbox.
17
+ * @cssproperty --mdc-checkbox-checked-background-color-hover - Background color for a selected checkbox when hovered.
18
+ * @cssproperty --mdc-checkbox-checked-pressed-icon-color - Background color for a selected checkbox when pressed.
19
+ * @cssproperty --mdc-checkbox-disabled-background-color - Background color for a disabled checkbox.
20
+ * @cssproperty --mdc-checkbox-disabled-border-color - Border color for a disabled checkbox.
21
+ * @cssproperty --mdc-checkbox-disabled-checked-icon-color - Background color for a disabled, selected checkbox.
22
+ * @cssproperty --mdc-checkbox-disabled-icon-color - Icon color for a disabled checkbox.
23
+ * @cssproperty --mdc-checkbox-icon-background-color - Background color for an unselected checkbox.
24
+ * @cssproperty --mdc-checkbox-icon-border-color - Default background color for an unselected checkbox.
25
+ * @cssproperty --mdc-checkbox-icon-color - Icon color for an unselected checkbox.
26
+ * @cssproperty --mdc-checkbox-pressed-icon-color - Background color for a selected checkbox when pressed.
27
+ */
28
+ declare class Checkbox extends Checkbox_base {
29
+ /**
30
+ * Determines whether the checkbox is selected or unselected.
31
+ *
32
+ * @default false
33
+ */
34
+ checked: boolean;
35
+ /**
36
+ * This property is used to determine the parent checkbox in a nested checkbox group.
37
+ * If any one of the children is unselected, then the parent checkbox will be indeterminate.
38
+ * If all children are either selected or unselected, then the parent checkbox will not be indeterminate.
39
+ *
40
+ * @default false
41
+ */
42
+ indeterminate: boolean;
43
+ /** @internal */
44
+ private internals;
45
+ /** @internal */
46
+ static formAssociated: boolean;
47
+ /** @internal */
48
+ get form(): HTMLFormElement | null;
49
+ constructor();
50
+ /**
51
+ * Updates the form value to reflect the current state of the checkbox.
52
+ * If checked, the value is set to either the user-provided value or 'on' if no value is provided.
53
+ * If unchecked, the value is set to null.
54
+ */
55
+ private setFormValue;
56
+ /**
57
+ * Toggles the state of the checkbox element.
58
+ * If the element is not disabled, then
59
+ * the checked property is toggled and the indeterminate property is set to false.
60
+ */
61
+ private toggleState;
62
+ /**
63
+ * Toggles the state of the checkbox element.
64
+ * and dispatch the new event.
65
+ */
66
+ handleChange(event: Event): void;
67
+ update(changedProperties: PropertyValues): void;
68
+ render(): import("lit-html").TemplateResult<1>;
69
+ static styles: Array<CSSResult>;
70
+ }
71
+ export default Checkbox;
@@ -0,0 +1,150 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ import { html, nothing } from 'lit';
11
+ import { property } from 'lit/decorators.js';
12
+ import { ifDefined } from 'lit/directives/if-defined.js';
13
+ import { DataAriaLabelMixin } from '../../utils/mixins/DataAriaLabelMixin';
14
+ import { NameMixin } from '../../utils/mixins/NameMixin';
15
+ import { ValueMixin } from '../../utils/mixins/ValueMixin';
16
+ import FormfieldWrapper from '../formfieldwrapper/formfieldwrapper.component';
17
+ import { ICON_NAME } from './checkbox.constants';
18
+ import styles from './checkbox.styles';
19
+ /**
20
+ * Checkboxes allow users to select multiple options from a list or turn an item/feature on or off.
21
+ * These are often used in forms, settings, and selections in lists.
22
+ *
23
+ * A checkbox component contains an optional label and an optional helper text.
24
+ *
25
+ * @dependency mdc-icon
26
+ *
27
+ * @tagname mdc-checkbox
28
+ *
29
+ * @cssproperty --mdc-checkbox-background-color-hover - Allows customization of the background color on hover.
30
+ * @cssproperty --mdc-checkbox-border-color - Border color in high contrast.
31
+ * @cssproperty --mdc-checkbox-checked-background-color - Background color for a selected checkbox.
32
+ * @cssproperty --mdc-checkbox-checked-background-color-hover - Background color for a selected checkbox when hovered.
33
+ * @cssproperty --mdc-checkbox-checked-pressed-icon-color - Background color for a selected checkbox when pressed.
34
+ * @cssproperty --mdc-checkbox-disabled-background-color - Background color for a disabled checkbox.
35
+ * @cssproperty --mdc-checkbox-disabled-border-color - Border color for a disabled checkbox.
36
+ * @cssproperty --mdc-checkbox-disabled-checked-icon-color - Background color for a disabled, selected checkbox.
37
+ * @cssproperty --mdc-checkbox-disabled-icon-color - Icon color for a disabled checkbox.
38
+ * @cssproperty --mdc-checkbox-icon-background-color - Background color for an unselected checkbox.
39
+ * @cssproperty --mdc-checkbox-icon-border-color - Default background color for an unselected checkbox.
40
+ * @cssproperty --mdc-checkbox-icon-color - Icon color for an unselected checkbox.
41
+ * @cssproperty --mdc-checkbox-pressed-icon-color - Background color for a selected checkbox when pressed.
42
+ */
43
+ class Checkbox extends NameMixin(ValueMixin(DataAriaLabelMixin(FormfieldWrapper))) {
44
+ /** @internal */
45
+ get form() {
46
+ return this.internals.form;
47
+ }
48
+ constructor() {
49
+ super();
50
+ /**
51
+ * Determines whether the checkbox is selected or unselected.
52
+ *
53
+ * @default false
54
+ */
55
+ this.checked = false;
56
+ /**
57
+ * This property is used to determine the parent checkbox in a nested checkbox group.
58
+ * If any one of the children is unselected, then the parent checkbox will be indeterminate.
59
+ * If all children are either selected or unselected, then the parent checkbox will not be indeterminate.
60
+ *
61
+ * @default false
62
+ */
63
+ this.indeterminate = false;
64
+ this.internals = this.attachInternals();
65
+ // Checkbox does not contain helpTextType property.
66
+ this.helpTextType = undefined;
67
+ }
68
+ /**
69
+ * Updates the form value to reflect the current state of the checkbox.
70
+ * If checked, the value is set to either the user-provided value or 'on' if no value is provided.
71
+ * If unchecked, the value is set to null.
72
+ */
73
+ setFormValue() {
74
+ let actualValue = null;
75
+ if (this.checked) {
76
+ actualValue = !this.value ? 'on' : this.value;
77
+ }
78
+ this.internals.setFormValue(actualValue);
79
+ }
80
+ /**
81
+ * Toggles the state of the checkbox element.
82
+ * If the element is not disabled, then
83
+ * the checked property is toggled and the indeterminate property is set to false.
84
+ */
85
+ toggleState() {
86
+ if (!this.disabled) {
87
+ this.checked = !this.checked;
88
+ this.indeterminate = false;
89
+ }
90
+ }
91
+ /**
92
+ * Toggles the state of the checkbox element.
93
+ * and dispatch the new event.
94
+ */
95
+ handleChange(event) {
96
+ this.toggleState();
97
+ this.dispatchEvent(new Event(event.type, event));
98
+ }
99
+ update(changedProperties) {
100
+ super.update(changedProperties);
101
+ if (changedProperties.has('checked')) {
102
+ this.setFormValue();
103
+ }
104
+ }
105
+ render() {
106
+ var _a;
107
+ const checkboxIconContent = (this.checked || this.indeterminate) ? html `
108
+ <mdc-icon
109
+ class="icon"
110
+ name="${this.indeterminate ? ICON_NAME.INDETERMINATE : ICON_NAME.CHECKED}"
111
+ size="1"
112
+ length-unit="rem"
113
+ ></mdc-icon>
114
+ ` : nothing;
115
+ const helpTextContent = this.helpText ? this.renderHelperText() : nothing;
116
+ return html `
117
+ <div class="container mdc-focus-ring">
118
+ <input
119
+ id="${this.id}"
120
+ type="checkbox"
121
+ class="input"
122
+ name="${ifDefined(this.name)}"
123
+ value="${ifDefined(this.value)}"
124
+ .checked="${this.checked}"
125
+ .indeterminate="${this.indeterminate}"
126
+ .disabled="${this.disabled}"
127
+ aria-label="${(_a = this.dataAriaLabel) !== null && _a !== void 0 ? _a : ''}"
128
+ @change=${this.handleChange}
129
+ />
130
+ <div class="icon-container">${checkboxIconContent}</div>
131
+ </div>
132
+ <div class="text-container">
133
+ ${this.renderLabel()}
134
+ ${helpTextContent}
135
+ </div>
136
+ `;
137
+ }
138
+ }
139
+ /** @internal */
140
+ Checkbox.formAssociated = true;
141
+ Checkbox.styles = [...FormfieldWrapper.styles, ...styles];
142
+ __decorate([
143
+ property({ type: Boolean, reflect: true }),
144
+ __metadata("design:type", Object)
145
+ ], Checkbox.prototype, "checked", void 0);
146
+ __decorate([
147
+ property({ type: Boolean, reflect: true }),
148
+ __metadata("design:type", Object)
149
+ ], Checkbox.prototype, "indeterminate", void 0);
150
+ export default Checkbox;
@@ -0,0 +1,6 @@
1
+ declare const TAG_NAME: "mdc-checkbox";
2
+ declare const ICON_NAME: {
3
+ readonly CHECKED: "check-bold";
4
+ readonly INDETERMINATE: "minus-bold";
5
+ };
6
+ export { TAG_NAME, ICON_NAME };
@@ -0,0 +1,7 @@
1
+ import utils from '../../utils/tag-name';
2
+ const TAG_NAME = utils.constructTagName('checkbox');
3
+ const ICON_NAME = {
4
+ CHECKED: 'check-bold',
5
+ INDETERMINATE: 'minus-bold',
6
+ };
7
+ export { TAG_NAME, ICON_NAME };
@@ -0,0 +1,2 @@
1
+ declare const styles: import("lit").CSSResult[];
2
+ export default styles;
@@ -0,0 +1,106 @@
1
+ import { css } from 'lit';
2
+ import { hostFocusRingStyles } from '../../utils/styles';
3
+ const styles = [css `
4
+ :host {
5
+ --mdc-checkbox-background-color-hover: var(--mds-color-theme-control-inactive-hover);
6
+ --mdc-checkbox-border-color: var(--mds-color-theme-outline-button-normal);
7
+ --mdc-checkbox-checked-background-color-hover: var(--mds-color-theme-control-active-hover);
8
+ --mdc-checkbox-checked-background-color: var(--mds-color-theme-control-active-normal);
9
+ --mdc-checkbox-checked-pressed-icon-color: var(--mds-color-theme-control-active-pressed);
10
+ --mdc-checkbox-disabled-background-color: var(--mds-color-theme-control-inactive-disabled);
11
+ --mdc-checkbox-disabled-border-color: var(--mds-color-theme-outline-primary-disabled);
12
+ --mdc-checkbox-disabled-checked-icon-color: var(--mds-color-theme-control-active-disabled);
13
+ --mdc-checkbox-disabled-icon-color: var(--mds-color-theme-text-primary-disabled);
14
+ --mdc-checkbox-icon-background-color: var(--mds-color-theme-control-inactive-normal);
15
+ --mdc-checkbox-icon-border-color: var(--mds-color-theme-outline-input-normal);
16
+ --mdc-checkbox-icon-color: var(--mds-color-theme-inverted-text-primary-normal);
17
+ --mdc-checkbox-pressed-icon-color: var(--mds-color-theme-control-inactive-pressed);
18
+
19
+ flex-direction: row;
20
+ align-items: flex-start;
21
+ }
22
+ .mdc-label, .input {
23
+ cursor: pointer;
24
+ }
25
+ :host([checked]) .icon-container,
26
+ :host([indeterminate]) .icon-container {
27
+ background: var(--mdc-checkbox-checked-background-color);
28
+ border: unset;
29
+ }
30
+ :host([checked]) .container:hover .icon-container,
31
+ :host([indeterminate]) .container:hover .icon-container {
32
+ background: var(--mdc-checkbox-checked-background-color-hover);
33
+ }
34
+ :host([checked]) .container:active .icon-container,
35
+ :host([indeterminate]) .container:active .icon-container {
36
+ background: var(--mdc-checkbox-checked-pressed-icon-color);
37
+ }
38
+ :host([disabled]) .mdc-label,
39
+ :host([disabled]) .input {
40
+ cursor: default;
41
+ }
42
+ :host([disabled]) .container:hover {
43
+ background: unset;
44
+ }
45
+ :host([disabled]) .icon-container {
46
+ border-color: var(--mdc-checkbox-disabled-border-color);
47
+ background: var(--mdc-checkbox-disabled-background-color);
48
+ }
49
+ :host([disabled]) .icon {
50
+ --mdc-icon-fill-color: var(--mdc-checkbox-disabled-icon-color);
51
+ }
52
+ :host([disabled][checked]) .icon-container,
53
+ :host([disabled][indeterminate]) .icon-container {
54
+ background: var(--mdc-checkbox-disabled-checked-icon-color);
55
+ border: 0.0625rem solid var(--mdc-checkbox-disabled-border-color);
56
+ }
57
+ .input {
58
+ margin: 0;
59
+ padding: 0;
60
+ position: absolute;
61
+ opacity: 0.1%;
62
+ overflow: visible;
63
+ z-index: 1;
64
+ }
65
+ .icon-container {
66
+ display: flex;
67
+ align-items: center;
68
+ border: 0.0625rem solid var(--mdc-checkbox-icon-border-color);
69
+ background: var(--mdc-checkbox-icon-background-color);
70
+ }
71
+ .container:hover {
72
+ background: var(--mdc-checkbox-background-color-hover);
73
+ }
74
+ .container:active {
75
+ background: var(--mdc-checkbox-pressed-icon-color);
76
+ }
77
+ .input, .icon-container {
78
+ width: 1rem;
79
+ height: 1rem;
80
+ }
81
+ .input,
82
+ .icon-container,
83
+ .container {
84
+ border-radius: 0.125rem;
85
+ }
86
+ .icon {
87
+ --mdc-icon-fill-color: var(--mdc-checkbox-icon-color);
88
+ }
89
+ .container {
90
+ margin: 0.125rem 0;
91
+ }
92
+ .text-container {
93
+ display: flex;
94
+ flex-direction: column;
95
+ gap: 0.25rem;
96
+ }
97
+
98
+ /* High Contrast Mode */
99
+ @media (forced-colors: active) {
100
+ :host([checked]) .icon-container,
101
+ :host([indeterminate]) .icon-container {
102
+ border: 0.0625rem solid var(--mdc-checkbox-border-color);
103
+ }
104
+ }
105
+ `, ...hostFocusRingStyles(true)];
106
+ export default styles;
@@ -0,0 +1,8 @@
1
+ import Checkbox from './checkbox.component';
2
+ import '../icon';
3
+ declare global {
4
+ interface HTMLElementTagNameMap {
5
+ ['mdc-checkbox']: Checkbox;
6
+ }
7
+ }
8
+ export default Checkbox;
@@ -0,0 +1,5 @@
1
+ import Checkbox from './checkbox.component';
2
+ import { TAG_NAME } from './checkbox.constants';
3
+ import '../icon';
4
+ Checkbox.register(TAG_NAME);
5
+ export default Checkbox;
@@ -1,10 +1,10 @@
1
1
  declare const TAG_NAME: "mdc-formfieldwrapper";
2
2
  declare const VALIDATION: {
3
+ readonly DEFAULT: "default";
3
4
  readonly ERROR: "error";
4
- readonly WARNING: "warning";
5
- readonly SUCCESS: "success";
6
5
  readonly PRIORITY: "priority";
7
- readonly DEFAULT: "default";
6
+ readonly SUCCESS: "success";
7
+ readonly WARNING: "warning";
8
8
  };
9
9
  declare const DEFAULTS: {
10
10
  readonly VALIDATION: "default";
@@ -2,11 +2,11 @@ import utils from '../../utils/tag-name';
2
2
  import { TYPE, VALID_TEXT_TAGS } from '../text/text.constants';
3
3
  const TAG_NAME = utils.constructTagName('formfieldwrapper');
4
4
  const VALIDATION = {
5
+ DEFAULT: 'default',
5
6
  ERROR: 'error',
6
- WARNING: 'warning',
7
- SUCCESS: 'success',
8
7
  PRIORITY: 'priority',
9
- DEFAULT: 'default',
8
+ SUCCESS: 'success',
9
+ WARNING: 'warning',
10
10
  };
11
11
  const DEFAULTS = {
12
12
  VALIDATION: VALIDATION.DEFAULT,
@@ -1,10 +1,10 @@
1
1
  import { VALIDATION } from './formfieldwrapper.constants';
2
2
  const getHelperIcon = (type) => {
3
3
  const helperIconSizeMap = {
4
- [VALIDATION.ERROR]: 'error-legacy-filled',
5
- [VALIDATION.WARNING]: 'warning-filled',
6
- [VALIDATION.SUCCESS]: 'check-circle-filled',
7
- [VALIDATION.PRIORITY]: 'priority-circle-filled',
4
+ [VALIDATION.ERROR]: 'error-legacy-badge-filled',
5
+ [VALIDATION.WARNING]: 'warning-badge-filled',
6
+ [VALIDATION.SUCCESS]: 'check-circle-badge-filled',
7
+ [VALIDATION.PRIORITY]: 'priority-badge-filled',
8
8
  [VALIDATION.DEFAULT]: '',
9
9
  };
10
10
  return helperIconSizeMap[type] || '';
@@ -0,0 +1,10 @@
1
+ import Input from './input.component';
2
+ import '../button';
3
+ import '../icon';
4
+ import '../text';
5
+ declare global {
6
+ interface HTMLElementTagNameMap {
7
+ ['mdc-input']: Input;
8
+ }
9
+ }
10
+ export default Input;
@@ -0,0 +1,7 @@
1
+ import Input from './input.component';
2
+ import { TAG_NAME } from './input.constants';
3
+ import '../button';
4
+ import '../icon';
5
+ import '../text';
6
+ Input.register(TAG_NAME);
7
+ export default Input;
@@ -0,0 +1,208 @@
1
+ import { CSSResult, nothing, PropertyValueMap } from 'lit';
2
+ import FormfieldWrapper from '../formfieldwrapper';
3
+ import type { IconNames } from '../icon/icon.types';
4
+ import type { AutoCapitalizeType } from './input.types';
5
+ declare const Input_base: import("../../utils/mixins/index.types").Constructor<import("../../utils/mixins/DataAriaLabelMixin").DataAriaLabelMixinInterface> & import("../../utils/mixins/index.types").Constructor<import("../../utils/mixins/ValueMixin").ValueMixinInterface> & import("../../utils/mixins/index.types").Constructor<import("../../utils/mixins/NameMixin").NameMixinInterface> & typeof FormfieldWrapper;
6
+ /**
7
+ * mdc-input is a component that allows users to input text.
8
+ * It contains:
9
+ * - label field - describe the input field.
10
+ * - input field - contains the value
11
+ * - help text or validation message - displayed below the input field.
12
+ * - trailing button - it displays a clear the input field.
13
+ * - prefix text - displayed before the input field.
14
+ * - leading icon - displayed before the input field.
15
+ * - clear-aria-label - aria label for the trailing button.
16
+ * - all the attributes of the input field.
17
+ *
18
+ * @tagname mdc-input
19
+ *
20
+ * @dependency mdc-icon
21
+ * @dependency mdc-text
22
+ * @dependency mdc-button
23
+ *
24
+ * @cssproperty --mdc-input-disabled-border-color - Border color for the input container when disabled
25
+ * @cssproperty --mdc-input-disabled-text-color - Text color for the input field when disabled
26
+ * @cssproperty --mdc-input-disabled-background-color - Background color for the input field when disabled
27
+ * @cssproperty --mdc-input-border-color - Border color for the input container
28
+ * @cssproperty --mdc-input-text-color - Text color for the input field
29
+ * @cssproperty --mdc-input-background-color - Background color for the input field
30
+ * @cssproperty --mdc-input-selection-background-color - Background color for the selected text
31
+ * @cssproperty --mdc-input-selection-text-color - Text color for the selected text
32
+ * @cssproperty --mdc-input-support-text-color - Text color for the help text
33
+ * @cssproperty --mdc-input-hover-background-color - Background color for the input field when hovered
34
+ * @cssproperty --mdc-input-focused-background-color - Background color for the input field when focused
35
+ * @cssproperty --mdc-input-focused-border-color - Border color for the input container when focused
36
+ * @cssproperty --mdc-input-error-border-color - Border color for the input container when error
37
+ * @cssproperty --mdc-input-warning-border-color - Border color for the input container when warning
38
+ * @cssproperty --mdc-input-success-border-color - Border color for the input container when success
39
+ * @cssproperty --mdc-input-primary-border-color - Border color for the input container when primary
40
+ *
41
+ */
42
+ declare class Input extends Input_base {
43
+ /**
44
+ * The placeholder text that is displayed when the input field is empty.
45
+ */
46
+ placeholder: string;
47
+ /**
48
+ * required attribute of the input field.
49
+ * If true, the consumer should indicate it on the label that the input field is required.
50
+ */
51
+ required: boolean;
52
+ /**
53
+ * readonly attribute of the input field. If true, the input field is read-only.
54
+ */
55
+ readonly: boolean;
56
+ /**
57
+ * The prefix text that is displayed before the input field. It has a max length of 10 characters.
58
+ * When the prefix text is set, make sure to set the 'data-aria-label'
59
+ * attribute with the appropriate value for accessibility.
60
+ */
61
+ prefixText?: string;
62
+ /**
63
+ * The leading icon that is displayed before the input field.
64
+ */
65
+ leadingIcon?: IconNames;
66
+ /**
67
+ * The trailing button when set to true, shows a clear button that clears the input field.
68
+ * @default false
69
+ */
70
+ trailingButton: boolean;
71
+ /**
72
+ * The maximum number of characters that the input field can accept.
73
+ */
74
+ maxlength?: number;
75
+ /**
76
+ * The minimum number of characters that the input field can accept.
77
+ */
78
+ minlength?: number;
79
+ /**
80
+ * The autocapitalize attribute of the input field.
81
+ * @default 'off'
82
+ */
83
+ autocapitalize: AutoCapitalizeType;
84
+ /**
85
+ * The autocomplete attribute of the input field.
86
+ * @default 'off'
87
+ */
88
+ autocomplete: any;
89
+ /**
90
+ * If true, the input field is focused when the component is rendered.
91
+ * @default false
92
+ */
93
+ autofocus: boolean;
94
+ /**
95
+ * Specifies the name of the directionality of text for submission purposes (e.g., "rtl" for right-to-left).
96
+ */
97
+ dirname?: string;
98
+ /**
99
+ * The pattern attribute of the input field.
100
+ * Specifies a regular expression that the input value must match for validation purposes.
101
+ */
102
+ pattern?: string;
103
+ /**
104
+ * The list attribute of the input field.
105
+ * Identifies a list of pre-defined options to suggest to the user.
106
+ */
107
+ list?: string;
108
+ /**
109
+ * The size attribute of the input field.
110
+ * Specifies the width of the input field.
111
+ * @default undefined
112
+ */
113
+ size?: number | undefined;
114
+ /**
115
+ * Aria label for the trailing button. If trailing button is set to true, this label is used for the clear button.
116
+ * @default ''
117
+ */
118
+ clearAriaLabel: string;
119
+ checkValidity(): boolean;
120
+ reportValidity(): boolean;
121
+ /** @internal */
122
+ private internals;
123
+ /** @internal */
124
+ static formAssociated: boolean;
125
+ /** @internal */
126
+ get form(): HTMLFormElement | null;
127
+ constructor();
128
+ /**
129
+ * @internal
130
+ * The input element
131
+ */
132
+ private inputElement;
133
+ connectedCallback(): void;
134
+ protected updated(changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
135
+ /**
136
+ * Handles the value change of the input field.
137
+ * Sets the form value and updates the validity of the input field.
138
+ * @returns void
139
+ */
140
+ handleValueChange(): void;
141
+ /**
142
+ * This function is called when the attribute changes.
143
+ * It updates the validity of the input field based on the input field's validity.
144
+ *
145
+ * @param name - attribute name
146
+ * @param old - old value
147
+ * @param value - new value
148
+ */
149
+ attributeChangedCallback(name: string, old: string | null, value: string | null): void;
150
+ /**
151
+ * Sets the validity of the input field based on the input field's validity.
152
+ * @returns void
153
+ */
154
+ private setValidityFromInput;
155
+ /**
156
+ * Updates the value of the input field.
157
+ * Sets the form value.
158
+ * @returns void
159
+ */
160
+ private updateValue;
161
+ /**
162
+ * Handles the input event of the input field.
163
+ * Updates the value and sets the validity of the input field.
164
+ *
165
+ */
166
+ private onInput;
167
+ /**
168
+ * Handles the change event of the input field.
169
+ * Updates the value and sets the validity of the input field.
170
+ *
171
+ * The 'change' event does not bubble up through the shadow DOM as it was not composed.
172
+ * Therefore, we need to re-dispatch the same event to ensure it is propagated correctly.
173
+ * Read more: https://developer.mozilla.org/en-US/docs/Web/API/Event/composed
174
+ *
175
+ * @param event - Event which contains information about the value change.
176
+ */
177
+ private onChange;
178
+ /**
179
+ * Renders the leading icon before the input field.
180
+ * If the leading icon is not set, it will not be displayed.
181
+ *
182
+ * @returns void
183
+ */
184
+ protected renderLeadingIcon(): import("lit-html").TemplateResult<1> | typeof nothing;
185
+ /**
186
+ * Renders the prefix text before the input field.
187
+ * If the prefix text is more than 10 characters,
188
+ * - it will not be displayed.
189
+ * - the validation messsage will be displayed.
190
+ *
191
+ * Note: We are setting aria-hidden so that the screen reader does not read the prefix text.
192
+ * The consumers should set the appropriate aria-label for the input field using 'data-aria-label' attribute.
193
+ * @returns void
194
+ */
195
+ protected renderPrefixText(): import("lit-html").TemplateResult<1> | typeof nothing;
196
+ /**
197
+ * Clears the input field.
198
+ */
199
+ private clearInputText;
200
+ /**
201
+ * Renders the trailing button to clear the input field if the trailingButton is set to true.
202
+ * @returns void
203
+ */
204
+ protected renderTrailingButton(): import("lit-html").TemplateResult<1> | typeof nothing;
205
+ render(): import("lit-html").TemplateResult<1>;
206
+ static styles: Array<CSSResult>;
207
+ }
208
+ export default Input;