@momentum-design/components 0.32.0 → 0.33.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.
package/dist/index.d.ts CHANGED
@@ -24,8 +24,9 @@ import ThemeProvider from './components/themeprovider';
24
24
  import Toggle from './components/toggle';
25
25
  import VirtualizedList from './components/virtualizedlist';
26
26
  import { inMemoryCache, webAPIIconsCache } from './utils/icon-cache';
27
+ import Textarea from './components/textarea';
27
28
  import type { SpinnerSize, SpinnerVariant } from './components/spinner/spinner.types';
28
29
  import type { TextType } from './components/text/text.types';
29
- export { Avatar, AvatarButton, Badge, Bullet, Button, Checkbox, Divider, FormfieldGroup, Icon, IconProvider, Input, Link, List, ListItem, Marker, Popover, Presence, Radio, RadioGroup, Spinner, Tab, Text, ThemeProvider, Toggle, VirtualizedList, };
30
+ export { Avatar, AvatarButton, Badge, Bullet, Button, Checkbox, Divider, FormfieldGroup, Icon, IconProvider, Input, Link, List, ListItem, Marker, Popover, Presence, Radio, RadioGroup, Spinner, Tab, Text, ThemeProvider, Toggle, VirtualizedList, Textarea, };
30
31
  export type { TextType, SpinnerSize, SpinnerVariant, };
31
32
  export { inMemoryCache, webAPIIconsCache };
package/dist/index.js CHANGED
@@ -24,5 +24,6 @@ import ThemeProvider from './components/themeprovider';
24
24
  import Toggle from './components/toggle';
25
25
  import VirtualizedList from './components/virtualizedlist';
26
26
  import { inMemoryCache, webAPIIconsCache } from './utils/icon-cache';
27
- export { Avatar, AvatarButton, Badge, Bullet, Button, Checkbox, Divider, FormfieldGroup, Icon, IconProvider, Input, Link, List, ListItem, Marker, Popover, Presence, Radio, RadioGroup, Spinner, Tab, Text, ThemeProvider, Toggle, VirtualizedList, };
27
+ import Textarea from './components/textarea';
28
+ export { Avatar, AvatarButton, Badge, Bullet, Button, Checkbox, Divider, FormfieldGroup, Icon, IconProvider, Input, Link, List, ListItem, Marker, Popover, Presence, Radio, RadioGroup, Spinner, Tab, Text, ThemeProvider, Toggle, VirtualizedList, Textarea, };
28
29
  export { inMemoryCache, webAPIIconsCache };
@@ -1,7 +1,7 @@
1
- export { default as Badge } from './badge';
2
1
  export { default as AvatarButton } from './avatarbutton';
3
- export { default as Bullet } from './bullet';
2
+ export { default as Badge } from './badge';
4
3
  export { default as Avatar } from './avatar';
4
+ export { default as Bullet } from './bullet';
5
5
  export { default as Button } from './button';
6
6
  export { default as Buttonsimple } from './buttonsimple';
7
7
  export { default as Checkbox } from './checkbox';
@@ -22,6 +22,7 @@ export { default as RadioGroup } from './radiogroup';
22
22
  export { default as Spinner } from './spinner';
23
23
  export { default as Tab } from './tab';
24
24
  export { default as Text } from './text';
25
+ export { default as Textarea } from './textarea';
25
26
  export { default as ThemeProvider } from './themeprovider';
26
27
  export { default as Toggle } from './toggle';
27
28
  export { default as VirtualizedList } from './virtualizedlist';
@@ -1,7 +1,7 @@
1
- export { default as Badge } from './badge';
2
1
  export { default as AvatarButton } from './avatarbutton';
3
- export { default as Bullet } from './bullet';
2
+ export { default as Badge } from './badge';
4
3
  export { default as Avatar } from './avatar';
4
+ export { default as Bullet } from './bullet';
5
5
  export { default as Button } from './button';
6
6
  export { default as Buttonsimple } from './buttonsimple';
7
7
  export { default as Checkbox } from './checkbox';
@@ -22,6 +22,7 @@ export { default as RadioGroup } from './radiogroup';
22
22
  export { default as Spinner } from './spinner';
23
23
  export { default as Tab } from './tab';
24
24
  export { default as Text } from './text';
25
+ export { default as Textarea } from './textarea';
25
26
  export { default as ThemeProvider } from './themeprovider';
26
27
  export { default as Toggle } from './toggle';
27
28
  export { default as VirtualizedList } from './virtualizedlist';
@@ -0,0 +1,61 @@
1
+ import Component from '../../components/textarea';
2
+ /**
3
+ * mdc-textarea component, which is used to get the multi-line text input from the user.
4
+ * It contains:
5
+ * - label: It is the title of the textarea field.
6
+ * - required-label: A string depicting that the textarea field is required.
7
+ * - Textarea: It is the multi-line text input field.
8
+ * - helper-text: It is the text that provides additional information about the textarea field.
9
+ * - max-character-limit: It is the text that shows the character count of the textarea field.
10
+ * - clear-button: A boolean value when marked to true represents a button that can
11
+ * clear the text value within the textarea field.
12
+ * - Error, Warning, Success, Priority Help Text type: It is the text that provides additional information
13
+ * about the textarea field based on the validation state.
14
+ * - limitexceeded: It is the event that is dispatched when the character limit exceeds or restored.
15
+ * This event exposes 3 properties:
16
+ * - currentCharacterCount - the current number of characters in the textarea field,
17
+ * - maxCharacterLimit - the maximum number of characters allowed in the textarea field,
18
+ * - value - the current value of the textarea field,
19
+ *
20
+ * **Note**: Consumers must set the help-text-type with 'error' and
21
+ * help-text attribute with the error message using limitexceeded event.
22
+ * The same help-text value will be used for the validation message to be displayed.
23
+ *
24
+ * @tagname mdc-textarea
25
+ *
26
+ * @event input - (React: onInput) This event is dispatched when the value of the textarea field changes (every press).
27
+ * @event change - (React: onChange) This event is dispatched when the value of the textarea field changes (on blur).
28
+ * @event focus - (React: onFocus) This event is dispatched when the textarea receives focus.
29
+ * @event blur - (React: onBlur) This event is dispatched when the textarea loses focus.
30
+ * @event limitexceeded - (React: onLimitExceeded) This event is dispatched once when the character limit
31
+ * exceeds or restored.
32
+ *
33
+ *
34
+ * @dependency mdc-icon
35
+ * @dependency mdc-text
36
+ * @dependency mdc-button
37
+ *
38
+ * @cssproperty --mdc-textarea-disabled-border-color - Border color for the textarea container when disabled
39
+ * @cssproperty --mdc-textarea-disabled-text-color - Text color for the textarea field when disabled
40
+ * @cssproperty --mdc-textarea-disabled-background-color - Background color for the textarea field when disabled
41
+ * @cssproperty --mdc-textarea-text-color - Text color for the textarea field
42
+ * @cssproperty --mdc-textarea-background-color - Background color for the textarea field
43
+ * @cssproperty --mdc-textarea-border-color - Border color for the textarea field
44
+ * @cssproperty --mdc-textarea-text-secondary-normal - Text color for the character counter
45
+ * @cssproperty --mdc-textarea-error-border-color - Border color for the error related help text
46
+ * @cssproperty --mdc-textarea-warning-border-color - Border color for the warning related help text
47
+ * @cssproperty --mdc-textarea-success-border-color - Border color for the success related help text
48
+ * @cssproperty --mdc-textarea-primary-border-color - Border color for the priority related help text
49
+ * @cssproperty --mdc-textarea-hover-background-color - Background color for the textarea container when hover
50
+ * @cssproperty --mdc-textarea-focused-background-color - Background color for the textarea container when focused
51
+ * @cssproperty --mdc-textarea-focused-border-color - Border color for the textarea container when focused
52
+ */
53
+ declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {
54
+ onLimitExceeded: string;
55
+ undefined: string;
56
+ onInput: string;
57
+ onChange: string;
58
+ onFocus: string;
59
+ onBlur: string;
60
+ }>;
61
+ export default reactWrapper;
@@ -0,0 +1,70 @@
1
+ import * as React from 'react';
2
+ import { createComponent } from '@lit/react';
3
+ import Component from '../../components/textarea';
4
+ import { TAG_NAME } from '../../components/textarea/textarea.constants';
5
+ /**
6
+ * mdc-textarea component, which is used to get the multi-line text input from the user.
7
+ * It contains:
8
+ * - label: It is the title of the textarea field.
9
+ * - required-label: A string depicting that the textarea field is required.
10
+ * - Textarea: It is the multi-line text input field.
11
+ * - helper-text: It is the text that provides additional information about the textarea field.
12
+ * - max-character-limit: It is the text that shows the character count of the textarea field.
13
+ * - clear-button: A boolean value when marked to true represents a button that can
14
+ * clear the text value within the textarea field.
15
+ * - Error, Warning, Success, Priority Help Text type: It is the text that provides additional information
16
+ * about the textarea field based on the validation state.
17
+ * - limitexceeded: It is the event that is dispatched when the character limit exceeds or restored.
18
+ * This event exposes 3 properties:
19
+ * - currentCharacterCount - the current number of characters in the textarea field,
20
+ * - maxCharacterLimit - the maximum number of characters allowed in the textarea field,
21
+ * - value - the current value of the textarea field,
22
+ *
23
+ * **Note**: Consumers must set the help-text-type with 'error' and
24
+ * help-text attribute with the error message using limitexceeded event.
25
+ * The same help-text value will be used for the validation message to be displayed.
26
+ *
27
+ * @tagname mdc-textarea
28
+ *
29
+ * @event input - (React: onInput) This event is dispatched when the value of the textarea field changes (every press).
30
+ * @event change - (React: onChange) This event is dispatched when the value of the textarea field changes (on blur).
31
+ * @event focus - (React: onFocus) This event is dispatched when the textarea receives focus.
32
+ * @event blur - (React: onBlur) This event is dispatched when the textarea loses focus.
33
+ * @event limitexceeded - (React: onLimitExceeded) This event is dispatched once when the character limit
34
+ * exceeds or restored.
35
+ *
36
+ *
37
+ * @dependency mdc-icon
38
+ * @dependency mdc-text
39
+ * @dependency mdc-button
40
+ *
41
+ * @cssproperty --mdc-textarea-disabled-border-color - Border color for the textarea container when disabled
42
+ * @cssproperty --mdc-textarea-disabled-text-color - Text color for the textarea field when disabled
43
+ * @cssproperty --mdc-textarea-disabled-background-color - Background color for the textarea field when disabled
44
+ * @cssproperty --mdc-textarea-text-color - Text color for the textarea field
45
+ * @cssproperty --mdc-textarea-background-color - Background color for the textarea field
46
+ * @cssproperty --mdc-textarea-border-color - Border color for the textarea field
47
+ * @cssproperty --mdc-textarea-text-secondary-normal - Text color for the character counter
48
+ * @cssproperty --mdc-textarea-error-border-color - Border color for the error related help text
49
+ * @cssproperty --mdc-textarea-warning-border-color - Border color for the warning related help text
50
+ * @cssproperty --mdc-textarea-success-border-color - Border color for the success related help text
51
+ * @cssproperty --mdc-textarea-primary-border-color - Border color for the priority related help text
52
+ * @cssproperty --mdc-textarea-hover-background-color - Background color for the textarea container when hover
53
+ * @cssproperty --mdc-textarea-focused-background-color - Background color for the textarea container when focused
54
+ * @cssproperty --mdc-textarea-focused-border-color - Border color for the textarea container when focused
55
+ */
56
+ const reactWrapper = createComponent({
57
+ tagName: TAG_NAME,
58
+ elementClass: Component,
59
+ react: React,
60
+ events: {
61
+ onLimitExceeded: 'limitexceeded',
62
+ undefined: 'undefined',
63
+ onInput: 'input',
64
+ onChange: 'change',
65
+ onFocus: 'focus',
66
+ onBlur: 'blur',
67
+ },
68
+ displayName: 'Textarea',
69
+ });
70
+ export default reactWrapper;
@@ -2,7 +2,7 @@ import { LitElement } from 'lit';
2
2
  import type { Constructor } from './index.types';
3
3
  export interface AssociatedFormControl {
4
4
  autofocus: boolean;
5
- disabled: boolean;
5
+ disabled?: boolean;
6
6
  name: string;
7
7
  value: string | string[];
8
8
  pattern?: string;
@@ -30,7 +30,7 @@ export interface FormInternalsMixinInterface {
30
30
  validationMessage: string;
31
31
  willValidate: boolean;
32
32
  internals: ElementInternals;
33
- inputElement: HTMLInputElement;
33
+ inputElement: HTMLInputElement | HTMLTextAreaElement;
34
34
  setValidity(): void;
35
35
  checkValidity(): boolean;
36
36
  reportValidity(): boolean;
@@ -72,7 +72,7 @@ export const FormInternalsMixin = (superClass) => {
72
72
  ], InnerMixinClass.prototype, "validationMessage", void 0);
73
73
  __decorate([
74
74
  query('input'),
75
- __metadata("design:type", HTMLInputElement)
75
+ __metadata("design:type", Object)
76
76
  ], InnerMixinClass.prototype, "inputElement", void 0);
77
77
  // Cast return type to your mixin's interface intersected with the superClass type
78
78
  return InnerMixinClass;
package/package.json CHANGED
@@ -38,5 +38,5 @@
38
38
  "lit": "^3.2.0",
39
39
  "uuid": "^11.0.5"
40
40
  },
41
- "version": "0.32.0"
41
+ "version": "0.33.0"
42
42
  }