@atlaskit/textarea 4.3.11 → 4.4.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/CHANGELOG.md +6 -0
- package/dist/cjs/styles.js +14 -13
- package/dist/cjs/text-area.js +2 -2
- package/dist/cjs/types.js +5 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/styles.js +16 -12
- package/dist/es2019/text-area.js +2 -2
- package/dist/es2019/types.js +1 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/styles.js +14 -13
- package/dist/esm/text-area.js +2 -2
- package/dist/esm/types.js +1 -0
- package/dist/esm/version.json +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/styles.d.ts +2 -1
- package/dist/types/text-area.d.ts +2 -95
- package/dist/types/types.d.ts +96 -0
- package/dist/types-ts4.0/index.d.ts +1 -0
- package/dist/types-ts4.0/styles.d.ts +2 -1
- package/dist/types-ts4.0/text-area.d.ts +2 -95
- package/dist/types-ts4.0/types.d.ts +96 -0
- package/extract-react-types/textarea-props.tsx +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/textarea
|
|
2
2
|
|
|
3
|
+
## 4.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`b8841384da6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b8841384da6) - Disabled background and border styles should not be applied to components that have either no background or transparent background to begin with. Textfield and textarea variants that do not have backgrounds (sublte or none) have no backgrounds or borders applied when disabled. As such, any comopnents that consume these will also be affected.
|
|
8
|
+
|
|
3
9
|
## 4.3.11
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/cjs/styles.js
CHANGED
|
@@ -45,8 +45,8 @@ var borderBoxMinHeightCompact = function borderBoxMinHeightCompact(minimumRows,
|
|
|
45
45
|
return contentHeightCompact + compactVerticalPadding * 2 + borderHeight * 2;
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
-
var bgAndBorderColorStyles = function bgAndBorderColorStyles(props) {
|
|
49
|
-
return {
|
|
48
|
+
var bgAndBorderColorStyles = function bgAndBorderColorStyles(props, appearance) {
|
|
49
|
+
return _objectSpread({
|
|
50
50
|
'&:focus': {
|
|
51
51
|
backgroundColor: props.backgroundColorFocus,
|
|
52
52
|
borderColor: props.borderColorFocus
|
|
@@ -55,14 +55,6 @@ var bgAndBorderColorStyles = function bgAndBorderColorStyles(props) {
|
|
|
55
55
|
backgroundColor: props.backgroundColor,
|
|
56
56
|
borderColor: props.borderColor
|
|
57
57
|
},
|
|
58
|
-
'&:disabled:focus': {
|
|
59
|
-
backgroundColor: props.disabledRules.backgroundColorFocus,
|
|
60
|
-
borderColor: props.disabledRules.borderColorFocus
|
|
61
|
-
},
|
|
62
|
-
'&:disabled:not(:focus)': {
|
|
63
|
-
backgroundColor: props.disabledRules.backgroundColor,
|
|
64
|
-
borderColor: props.disabledRules.borderColor
|
|
65
|
-
},
|
|
66
58
|
'&[data-invalid]:focus': {
|
|
67
59
|
backgroundColor: props.invalidRules.backgroundColorFocus,
|
|
68
60
|
borderColor: props.invalidRules.borderColorFocus
|
|
@@ -71,7 +63,16 @@ var bgAndBorderColorStyles = function bgAndBorderColorStyles(props) {
|
|
|
71
63
|
backgroundColor: props.invalidRules.backgroundColor,
|
|
72
64
|
borderColor: props.invalidRules.borderColor
|
|
73
65
|
}
|
|
74
|
-
}
|
|
66
|
+
}, appearance === 'standard' ? {
|
|
67
|
+
'&:disabled:focus': {
|
|
68
|
+
backgroundColor: props.disabledRules.backgroundColorFocus,
|
|
69
|
+
borderColor: props.disabledRules.borderColorFocus
|
|
70
|
+
},
|
|
71
|
+
'&:disabled:not(:focus)': {
|
|
72
|
+
backgroundColor: props.disabledRules.backgroundColor,
|
|
73
|
+
borderColor: props.disabledRules.borderColor
|
|
74
|
+
}
|
|
75
|
+
} : {});
|
|
75
76
|
};
|
|
76
77
|
|
|
77
78
|
var placeholderStyle = function placeholderStyle(placeholderTextColor) {
|
|
@@ -185,8 +186,8 @@ var getBaseStyles = function getBaseStyles(_ref) {
|
|
|
185
186
|
|
|
186
187
|
exports.getBaseStyles = getBaseStyles;
|
|
187
188
|
|
|
188
|
-
var themeStyles = function themeStyles(props) {
|
|
189
|
-
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, bgAndBorderColorStyles(props)), hoverBackgroundAndBorderStyles(props)), placeholderStyle(props.placeholderTextColor)), {}, {
|
|
189
|
+
var themeStyles = function themeStyles(props, appearance) {
|
|
190
|
+
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, bgAndBorderColorStyles(props, appearance)), hoverBackgroundAndBorderStyles(props)), placeholderStyle(props.placeholderTextColor)), {}, {
|
|
190
191
|
color: props.textColor,
|
|
191
192
|
'&:disabled': {
|
|
192
193
|
color: props.disabledRules.textColor
|
package/dist/cjs/text-area.js
CHANGED
|
@@ -40,7 +40,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
40
40
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
41
41
|
|
|
42
42
|
var packageName = "@atlaskit/textarea";
|
|
43
|
-
var packageVersion = "4.
|
|
43
|
+
var packageVersion = "4.4.0";
|
|
44
44
|
var analyticsParams = {
|
|
45
45
|
componentName: 'textArea',
|
|
46
46
|
packageName: packageName,
|
|
@@ -143,7 +143,7 @@ var TextAreaWithTokens = /*#__PURE__*/(0, _react.forwardRef)(function (props, re
|
|
|
143
143
|
});
|
|
144
144
|
}, [minimumRows, resize, appearance, isMonospaced, maxHeight]);
|
|
145
145
|
var textAreaStyles = [baseStyles, // not memoizing themeStyles as `tokens` is an unstable reference
|
|
146
|
-
(0, _styles.themeStyles)(tokens)];
|
|
146
|
+
(0, _styles.themeStyles)(tokens, appearance)];
|
|
147
147
|
return (0, _core.jsx)("textarea", (0, _extends2.default)({}, controlProps, {
|
|
148
148
|
value: value,
|
|
149
149
|
disabled: isDisabled,
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/styles.js
CHANGED
|
@@ -29,7 +29,7 @@ const borderBoxMinHeightCompact = (minimumRows, borderHeight) => {
|
|
|
29
29
|
return contentHeightCompact + compactVerticalPadding * 2 + borderHeight * 2;
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
const bgAndBorderColorStyles = props => ({
|
|
32
|
+
const bgAndBorderColorStyles = (props, appearance) => ({
|
|
33
33
|
'&:focus': {
|
|
34
34
|
backgroundColor: props.backgroundColorFocus,
|
|
35
35
|
borderColor: props.borderColorFocus
|
|
@@ -38,14 +38,6 @@ const bgAndBorderColorStyles = props => ({
|
|
|
38
38
|
backgroundColor: props.backgroundColor,
|
|
39
39
|
borderColor: props.borderColor
|
|
40
40
|
},
|
|
41
|
-
'&:disabled:focus': {
|
|
42
|
-
backgroundColor: props.disabledRules.backgroundColorFocus,
|
|
43
|
-
borderColor: props.disabledRules.borderColorFocus
|
|
44
|
-
},
|
|
45
|
-
'&:disabled:not(:focus)': {
|
|
46
|
-
backgroundColor: props.disabledRules.backgroundColor,
|
|
47
|
-
borderColor: props.disabledRules.borderColor
|
|
48
|
-
},
|
|
49
41
|
'&[data-invalid]:focus': {
|
|
50
42
|
backgroundColor: props.invalidRules.backgroundColorFocus,
|
|
51
43
|
borderColor: props.invalidRules.borderColorFocus
|
|
@@ -53,7 +45,19 @@ const bgAndBorderColorStyles = props => ({
|
|
|
53
45
|
'&[data-invalid]:not(:focus)': {
|
|
54
46
|
backgroundColor: props.invalidRules.backgroundColor,
|
|
55
47
|
borderColor: props.invalidRules.borderColor
|
|
56
|
-
}
|
|
48
|
+
},
|
|
49
|
+
// Disabled background and border styles should not be applied to components that
|
|
50
|
+
// have either no background or transparent background to begin with
|
|
51
|
+
...(appearance === 'standard' ? {
|
|
52
|
+
'&:disabled:focus': {
|
|
53
|
+
backgroundColor: props.disabledRules.backgroundColorFocus,
|
|
54
|
+
borderColor: props.disabledRules.borderColorFocus
|
|
55
|
+
},
|
|
56
|
+
'&:disabled:not(:focus)': {
|
|
57
|
+
backgroundColor: props.disabledRules.backgroundColor,
|
|
58
|
+
borderColor: props.disabledRules.borderColor
|
|
59
|
+
}
|
|
60
|
+
} : {})
|
|
57
61
|
});
|
|
58
62
|
|
|
59
63
|
const placeholderStyle = placeholderTextColor => ({
|
|
@@ -161,8 +165,8 @@ export const getBaseStyles = ({
|
|
|
161
165
|
...fontFamilyStyle(isMonospaced),
|
|
162
166
|
maxHeight
|
|
163
167
|
});
|
|
164
|
-
export const themeStyles = props => {
|
|
165
|
-
return { ...bgAndBorderColorStyles(props),
|
|
168
|
+
export const themeStyles = (props, appearance) => {
|
|
169
|
+
return { ...bgAndBorderColorStyles(props, appearance),
|
|
166
170
|
...hoverBackgroundAndBorderStyles(props),
|
|
167
171
|
...placeholderStyle(props.placeholderTextColor),
|
|
168
172
|
color: props.textColor,
|
package/dist/es2019/text-area.js
CHANGED
|
@@ -8,7 +8,7 @@ import GlobalTheme from '@atlaskit/theme/components';
|
|
|
8
8
|
import { borderWidth, getBaseStyles, themeStyles } from './styles';
|
|
9
9
|
import { Theme } from './theme';
|
|
10
10
|
const packageName = "@atlaskit/textarea";
|
|
11
|
-
const packageVersion = "4.
|
|
11
|
+
const packageVersion = "4.4.0";
|
|
12
12
|
const analyticsParams = {
|
|
13
13
|
componentName: 'textArea',
|
|
14
14
|
packageName,
|
|
@@ -103,7 +103,7 @@ const TextAreaWithTokens = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
103
103
|
maxHeight
|
|
104
104
|
}), [minimumRows, resize, appearance, isMonospaced, maxHeight]);
|
|
105
105
|
const textAreaStyles = [baseStyles, // not memoizing themeStyles as `tokens` is an unstable reference
|
|
106
|
-
themeStyles(tokens)];
|
|
106
|
+
themeStyles(tokens, appearance)];
|
|
107
107
|
return jsx("textarea", _extends({}, controlProps, {
|
|
108
108
|
value: value,
|
|
109
109
|
disabled: isDisabled,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/styles.js
CHANGED
|
@@ -35,8 +35,8 @@ var borderBoxMinHeightCompact = function borderBoxMinHeightCompact(minimumRows,
|
|
|
35
35
|
return contentHeightCompact + compactVerticalPadding * 2 + borderHeight * 2;
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
var bgAndBorderColorStyles = function bgAndBorderColorStyles(props) {
|
|
39
|
-
return {
|
|
38
|
+
var bgAndBorderColorStyles = function bgAndBorderColorStyles(props, appearance) {
|
|
39
|
+
return _objectSpread({
|
|
40
40
|
'&:focus': {
|
|
41
41
|
backgroundColor: props.backgroundColorFocus,
|
|
42
42
|
borderColor: props.borderColorFocus
|
|
@@ -45,14 +45,6 @@ var bgAndBorderColorStyles = function bgAndBorderColorStyles(props) {
|
|
|
45
45
|
backgroundColor: props.backgroundColor,
|
|
46
46
|
borderColor: props.borderColor
|
|
47
47
|
},
|
|
48
|
-
'&:disabled:focus': {
|
|
49
|
-
backgroundColor: props.disabledRules.backgroundColorFocus,
|
|
50
|
-
borderColor: props.disabledRules.borderColorFocus
|
|
51
|
-
},
|
|
52
|
-
'&:disabled:not(:focus)': {
|
|
53
|
-
backgroundColor: props.disabledRules.backgroundColor,
|
|
54
|
-
borderColor: props.disabledRules.borderColor
|
|
55
|
-
},
|
|
56
48
|
'&[data-invalid]:focus': {
|
|
57
49
|
backgroundColor: props.invalidRules.backgroundColorFocus,
|
|
58
50
|
borderColor: props.invalidRules.borderColorFocus
|
|
@@ -61,7 +53,16 @@ var bgAndBorderColorStyles = function bgAndBorderColorStyles(props) {
|
|
|
61
53
|
backgroundColor: props.invalidRules.backgroundColor,
|
|
62
54
|
borderColor: props.invalidRules.borderColor
|
|
63
55
|
}
|
|
64
|
-
}
|
|
56
|
+
}, appearance === 'standard' ? {
|
|
57
|
+
'&:disabled:focus': {
|
|
58
|
+
backgroundColor: props.disabledRules.backgroundColorFocus,
|
|
59
|
+
borderColor: props.disabledRules.borderColorFocus
|
|
60
|
+
},
|
|
61
|
+
'&:disabled:not(:focus)': {
|
|
62
|
+
backgroundColor: props.disabledRules.backgroundColor,
|
|
63
|
+
borderColor: props.disabledRules.borderColor
|
|
64
|
+
}
|
|
65
|
+
} : {});
|
|
65
66
|
};
|
|
66
67
|
|
|
67
68
|
var placeholderStyle = function placeholderStyle(placeholderTextColor) {
|
|
@@ -171,8 +172,8 @@ export var getBaseStyles = function getBaseStyles(_ref) {
|
|
|
171
172
|
maxHeight: maxHeight
|
|
172
173
|
});
|
|
173
174
|
};
|
|
174
|
-
export var themeStyles = function themeStyles(props) {
|
|
175
|
-
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, bgAndBorderColorStyles(props)), hoverBackgroundAndBorderStyles(props)), placeholderStyle(props.placeholderTextColor)), {}, {
|
|
175
|
+
export var themeStyles = function themeStyles(props, appearance) {
|
|
176
|
+
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, bgAndBorderColorStyles(props, appearance)), hoverBackgroundAndBorderStyles(props)), placeholderStyle(props.placeholderTextColor)), {}, {
|
|
176
177
|
color: props.textColor,
|
|
177
178
|
'&:disabled': {
|
|
178
179
|
color: props.disabledRules.textColor
|
package/dist/esm/text-area.js
CHANGED
|
@@ -16,7 +16,7 @@ import GlobalTheme from '@atlaskit/theme/components';
|
|
|
16
16
|
import { borderWidth, getBaseStyles, themeStyles } from './styles';
|
|
17
17
|
import { Theme } from './theme';
|
|
18
18
|
var packageName = "@atlaskit/textarea";
|
|
19
|
-
var packageVersion = "4.
|
|
19
|
+
var packageVersion = "4.4.0";
|
|
20
20
|
var analyticsParams = {
|
|
21
21
|
componentName: 'textArea',
|
|
22
22
|
packageName: packageName,
|
|
@@ -121,7 +121,7 @@ var TextAreaWithTokens = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
121
121
|
});
|
|
122
122
|
}, [minimumRows, resize, appearance, isMonospaced, maxHeight]);
|
|
123
123
|
var textAreaStyles = [baseStyles, // not memoizing themeStyles as `tokens` is an unstable reference
|
|
124
|
-
themeStyles(tokens)];
|
|
124
|
+
themeStyles(tokens, appearance)];
|
|
125
125
|
return jsx("textarea", _extends({}, controlProps, {
|
|
126
126
|
value: value,
|
|
127
127
|
disabled: isDisabled,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/esm/version.json
CHANGED
package/dist/types/index.d.ts
CHANGED
package/dist/types/styles.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { CSSObject } from '@emotion/core';
|
|
3
3
|
import { ThemeTokens } from './theme';
|
|
4
|
+
import { TextAreaProps } from './types';
|
|
4
5
|
export interface StyleProps {
|
|
5
6
|
minimumRows: number | undefined;
|
|
6
7
|
resize: string | undefined;
|
|
@@ -10,4 +11,4 @@ export interface StyleProps {
|
|
|
10
11
|
}
|
|
11
12
|
export declare const borderWidth = 2;
|
|
12
13
|
export declare const getBaseStyles: ({ minimumRows, resize, appearance, isMonospaced, maxHeight, }: StyleProps) => CSSObject;
|
|
13
|
-
export declare const themeStyles: (props: ThemeTokens) => CSSObject;
|
|
14
|
+
export declare const themeStyles: (props: ThemeTokens, appearance: TextAreaProps['appearance']) => CSSObject;
|
|
@@ -1,99 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
4
|
-
export interface OwnProps extends WithAnalyticsEventsProps {
|
|
5
|
-
/**
|
|
6
|
-
* controls the appearance of the field.
|
|
7
|
-
* subtle shows styling on hover.
|
|
8
|
-
* none prevents all field styling.
|
|
9
|
-
*/
|
|
10
|
-
appearance?: 'standard' | 'subtle' | 'none';
|
|
11
|
-
/**
|
|
12
|
-
* Set whether the fields should expand to fill available horizontal space.
|
|
13
|
-
*/
|
|
14
|
-
isCompact?: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Sets the field as uneditable, with a changed hover state.
|
|
17
|
-
*/
|
|
18
|
-
isDisabled?: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* If true, prevents the value of the input from being edited.
|
|
21
|
-
*/
|
|
22
|
-
isReadOnly?: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* Set required for form that the field is part of.
|
|
25
|
-
*/
|
|
26
|
-
isRequired?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Sets styling to indicate that the input is invalid.
|
|
29
|
-
*/
|
|
30
|
-
isInvalid?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* The minimum number of rows of text to display
|
|
33
|
-
*/
|
|
34
|
-
minimumRows?: number;
|
|
35
|
-
/**
|
|
36
|
-
* The maxheight of the textarea
|
|
37
|
-
*/
|
|
38
|
-
maxHeight?: string;
|
|
39
|
-
/**
|
|
40
|
-
* The value of the text-area.
|
|
41
|
-
*/
|
|
42
|
-
value?: string;
|
|
43
|
-
/**
|
|
44
|
-
* The default value of the textarea
|
|
45
|
-
*/
|
|
46
|
-
defaultValue?: string;
|
|
47
|
-
/**
|
|
48
|
-
* Name of the input form control
|
|
49
|
-
*/
|
|
50
|
-
name?: string;
|
|
51
|
-
/**
|
|
52
|
-
* The placeholder within the textarea
|
|
53
|
-
*/
|
|
54
|
-
placeholder?: string;
|
|
55
|
-
/**
|
|
56
|
-
* Handler to be called when the input is blurred
|
|
57
|
-
*/
|
|
58
|
-
onBlur?: React.FocusEventHandler<HTMLTextAreaElement>;
|
|
59
|
-
/**
|
|
60
|
-
* Handler to be called when the input changes.
|
|
61
|
-
*/
|
|
62
|
-
onChange?: React.ChangeEventHandler<HTMLTextAreaElement>;
|
|
63
|
-
/**
|
|
64
|
-
* Handler to be called when the input is focused
|
|
65
|
-
*/
|
|
66
|
-
onFocus?: React.FocusEventHandler<HTMLTextAreaElement>;
|
|
67
|
-
/**
|
|
68
|
-
* Sets content text value to monospace
|
|
69
|
-
*/
|
|
70
|
-
isMonospaced?: boolean;
|
|
71
|
-
/**
|
|
72
|
-
* Enables the resizing of the textarea:
|
|
73
|
-
* auto: both directions.
|
|
74
|
-
* horizontal: only along the x axis.
|
|
75
|
-
* vertical: only along the y axis.
|
|
76
|
-
* smart (default): vertically grows and shrinks the textarea automatically to wrap your input text.
|
|
77
|
-
* none: explicitly disallow resizing on the textarea.
|
|
78
|
-
*/
|
|
79
|
-
resize?: 'auto' | 'vertical' | 'horizontal' | 'smart' | 'none';
|
|
80
|
-
/**
|
|
81
|
-
* Enables native spell check on the `textarea` element.
|
|
82
|
-
*/
|
|
83
|
-
spellCheck?: boolean;
|
|
84
|
-
/**
|
|
85
|
-
* The theme function TextArea consumes to derive theming constants for use in styling its components
|
|
86
|
-
*/
|
|
87
|
-
theme?: any;
|
|
88
|
-
/**
|
|
89
|
-
* A `testId` prop is provided for specified elements, which is a unique
|
|
90
|
-
* string that appears as a data attribute `data-testid` in the rendered code,
|
|
91
|
-
* serving as a hook for automated tests
|
|
92
|
-
*/
|
|
93
|
-
testId?: string;
|
|
94
|
-
}
|
|
95
|
-
declare type Combine<First, Second> = Omit<First, keyof Second> & Second;
|
|
96
|
-
export declare type TextAreaProps = Combine<Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'disabled' | 'required' | 'readonly'>, OwnProps>;
|
|
3
|
+
import { TextAreaProps } from './types';
|
|
97
4
|
/**
|
|
98
5
|
* __Text area__
|
|
99
6
|
*
|
|
@@ -103,5 +10,5 @@ export declare type TextAreaProps = Combine<Omit<React.TextareaHTMLAttributes<HT
|
|
|
103
10
|
* - [Code](https://atlassian.design/components/textarea/code)
|
|
104
11
|
* - [Usage](https://atlassian.design/components/textarea/usage)
|
|
105
12
|
*/
|
|
106
|
-
declare const TextArea: React.MemoExoticComponent<React.ForwardRefExoticComponent<Pick<TextAreaProps, "appearance" | "
|
|
13
|
+
declare const TextArea: React.MemoExoticComponent<React.ForwardRefExoticComponent<Pick<TextAreaProps, "appearance" | "isCompact" | "isDisabled" | "isReadOnly" | "isRequired" | "isInvalid" | "minimumRows" | "maxHeight" | "value" | "defaultValue" | "name" | "placeholder" | "onBlur" | "onChange" | "onFocus" | "isMonospaced" | "resize" | "spellCheck" | "theme" | "testId" | "autoComplete" | "autoFocus" | "cols" | "dirName" | "form" | "maxLength" | "minLength" | "readOnly" | "rows" | "wrap" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "slot" | "style" | "tabIndex" | "title" | "inputMode" | "is" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "css" | "createAnalyticsEvent"> & React.RefAttributes<HTMLTextAreaElement>>>;
|
|
107
14
|
export default TextArea;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
3
|
+
export interface OwnProps extends WithAnalyticsEventsProps {
|
|
4
|
+
/**
|
|
5
|
+
* controls the appearance of the field.
|
|
6
|
+
* subtle shows styling on hover.
|
|
7
|
+
* none prevents all field styling.
|
|
8
|
+
*/
|
|
9
|
+
appearance?: 'standard' | 'subtle' | 'none';
|
|
10
|
+
/**
|
|
11
|
+
* Set whether the fields should expand to fill available horizontal space.
|
|
12
|
+
*/
|
|
13
|
+
isCompact?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Sets the field as uneditable, with a changed hover state.
|
|
16
|
+
*/
|
|
17
|
+
isDisabled?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* If true, prevents the value of the input from being edited.
|
|
20
|
+
*/
|
|
21
|
+
isReadOnly?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Set required for form that the field is part of.
|
|
24
|
+
*/
|
|
25
|
+
isRequired?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Sets styling to indicate that the input is invalid.
|
|
28
|
+
*/
|
|
29
|
+
isInvalid?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* The minimum number of rows of text to display
|
|
32
|
+
*/
|
|
33
|
+
minimumRows?: number;
|
|
34
|
+
/**
|
|
35
|
+
* The maxheight of the textarea
|
|
36
|
+
*/
|
|
37
|
+
maxHeight?: string;
|
|
38
|
+
/**
|
|
39
|
+
* The value of the text-area.
|
|
40
|
+
*/
|
|
41
|
+
value?: string;
|
|
42
|
+
/**
|
|
43
|
+
* The default value of the textarea
|
|
44
|
+
*/
|
|
45
|
+
defaultValue?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Name of the input form control
|
|
48
|
+
*/
|
|
49
|
+
name?: string;
|
|
50
|
+
/**
|
|
51
|
+
* The placeholder within the textarea
|
|
52
|
+
*/
|
|
53
|
+
placeholder?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Handler to be called when the input is blurred
|
|
56
|
+
*/
|
|
57
|
+
onBlur?: React.FocusEventHandler<HTMLTextAreaElement>;
|
|
58
|
+
/**
|
|
59
|
+
* Handler to be called when the input changes.
|
|
60
|
+
*/
|
|
61
|
+
onChange?: React.ChangeEventHandler<HTMLTextAreaElement>;
|
|
62
|
+
/**
|
|
63
|
+
* Handler to be called when the input is focused
|
|
64
|
+
*/
|
|
65
|
+
onFocus?: React.FocusEventHandler<HTMLTextAreaElement>;
|
|
66
|
+
/**
|
|
67
|
+
* Sets content text value to monospace
|
|
68
|
+
*/
|
|
69
|
+
isMonospaced?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Enables the resizing of the textarea:
|
|
72
|
+
* auto: both directions.
|
|
73
|
+
* horizontal: only along the x axis.
|
|
74
|
+
* vertical: only along the y axis.
|
|
75
|
+
* smart (default): vertically grows and shrinks the textarea automatically to wrap your input text.
|
|
76
|
+
* none: explicitly disallow resizing on the textarea.
|
|
77
|
+
*/
|
|
78
|
+
resize?: 'auto' | 'vertical' | 'horizontal' | 'smart' | 'none';
|
|
79
|
+
/**
|
|
80
|
+
* Enables native spell check on the `textarea` element.
|
|
81
|
+
*/
|
|
82
|
+
spellCheck?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* The theme function TextArea consumes to derive theming constants for use in styling its components
|
|
85
|
+
*/
|
|
86
|
+
theme?: any;
|
|
87
|
+
/**
|
|
88
|
+
* A `testId` prop is provided for specified elements, which is a unique
|
|
89
|
+
* string that appears as a data attribute `data-testid` in the rendered code,
|
|
90
|
+
* serving as a hook for automated tests
|
|
91
|
+
*/
|
|
92
|
+
testId?: string;
|
|
93
|
+
}
|
|
94
|
+
declare type Combine<First, Second> = Omit<First, keyof Second> & Second;
|
|
95
|
+
export declare type TextAreaProps = Combine<Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'disabled' | 'required' | 'readonly'>, OwnProps>;
|
|
96
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { CSSObject } from '@emotion/core';
|
|
3
3
|
import { ThemeTokens } from './theme';
|
|
4
|
+
import { TextAreaProps } from './types';
|
|
4
5
|
export interface StyleProps {
|
|
5
6
|
minimumRows: number | undefined;
|
|
6
7
|
resize: string | undefined;
|
|
@@ -10,4 +11,4 @@ export interface StyleProps {
|
|
|
10
11
|
}
|
|
11
12
|
export declare const borderWidth = 2;
|
|
12
13
|
export declare const getBaseStyles: ({ minimumRows, resize, appearance, isMonospaced, maxHeight, }: StyleProps) => CSSObject;
|
|
13
|
-
export declare const themeStyles: (props: ThemeTokens) => CSSObject;
|
|
14
|
+
export declare const themeStyles: (props: ThemeTokens, appearance: TextAreaProps['appearance']) => CSSObject;
|
|
@@ -1,99 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
4
|
-
export interface OwnProps extends WithAnalyticsEventsProps {
|
|
5
|
-
/**
|
|
6
|
-
* controls the appearance of the field.
|
|
7
|
-
* subtle shows styling on hover.
|
|
8
|
-
* none prevents all field styling.
|
|
9
|
-
*/
|
|
10
|
-
appearance?: 'standard' | 'subtle' | 'none';
|
|
11
|
-
/**
|
|
12
|
-
* Set whether the fields should expand to fill available horizontal space.
|
|
13
|
-
*/
|
|
14
|
-
isCompact?: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Sets the field as uneditable, with a changed hover state.
|
|
17
|
-
*/
|
|
18
|
-
isDisabled?: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* If true, prevents the value of the input from being edited.
|
|
21
|
-
*/
|
|
22
|
-
isReadOnly?: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* Set required for form that the field is part of.
|
|
25
|
-
*/
|
|
26
|
-
isRequired?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Sets styling to indicate that the input is invalid.
|
|
29
|
-
*/
|
|
30
|
-
isInvalid?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* The minimum number of rows of text to display
|
|
33
|
-
*/
|
|
34
|
-
minimumRows?: number;
|
|
35
|
-
/**
|
|
36
|
-
* The maxheight of the textarea
|
|
37
|
-
*/
|
|
38
|
-
maxHeight?: string;
|
|
39
|
-
/**
|
|
40
|
-
* The value of the text-area.
|
|
41
|
-
*/
|
|
42
|
-
value?: string;
|
|
43
|
-
/**
|
|
44
|
-
* The default value of the textarea
|
|
45
|
-
*/
|
|
46
|
-
defaultValue?: string;
|
|
47
|
-
/**
|
|
48
|
-
* Name of the input form control
|
|
49
|
-
*/
|
|
50
|
-
name?: string;
|
|
51
|
-
/**
|
|
52
|
-
* The placeholder within the textarea
|
|
53
|
-
*/
|
|
54
|
-
placeholder?: string;
|
|
55
|
-
/**
|
|
56
|
-
* Handler to be called when the input is blurred
|
|
57
|
-
*/
|
|
58
|
-
onBlur?: React.FocusEventHandler<HTMLTextAreaElement>;
|
|
59
|
-
/**
|
|
60
|
-
* Handler to be called when the input changes.
|
|
61
|
-
*/
|
|
62
|
-
onChange?: React.ChangeEventHandler<HTMLTextAreaElement>;
|
|
63
|
-
/**
|
|
64
|
-
* Handler to be called when the input is focused
|
|
65
|
-
*/
|
|
66
|
-
onFocus?: React.FocusEventHandler<HTMLTextAreaElement>;
|
|
67
|
-
/**
|
|
68
|
-
* Sets content text value to monospace
|
|
69
|
-
*/
|
|
70
|
-
isMonospaced?: boolean;
|
|
71
|
-
/**
|
|
72
|
-
* Enables the resizing of the textarea:
|
|
73
|
-
* auto: both directions.
|
|
74
|
-
* horizontal: only along the x axis.
|
|
75
|
-
* vertical: only along the y axis.
|
|
76
|
-
* smart (default): vertically grows and shrinks the textarea automatically to wrap your input text.
|
|
77
|
-
* none: explicitly disallow resizing on the textarea.
|
|
78
|
-
*/
|
|
79
|
-
resize?: 'auto' | 'vertical' | 'horizontal' | 'smart' | 'none';
|
|
80
|
-
/**
|
|
81
|
-
* Enables native spell check on the `textarea` element.
|
|
82
|
-
*/
|
|
83
|
-
spellCheck?: boolean;
|
|
84
|
-
/**
|
|
85
|
-
* The theme function TextArea consumes to derive theming constants for use in styling its components
|
|
86
|
-
*/
|
|
87
|
-
theme?: any;
|
|
88
|
-
/**
|
|
89
|
-
* A `testId` prop is provided for specified elements, which is a unique
|
|
90
|
-
* string that appears as a data attribute `data-testid` in the rendered code,
|
|
91
|
-
* serving as a hook for automated tests
|
|
92
|
-
*/
|
|
93
|
-
testId?: string;
|
|
94
|
-
}
|
|
95
|
-
declare type Combine<First, Second> = Omit<First, keyof Second> & Second;
|
|
96
|
-
export declare type TextAreaProps = Combine<Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'disabled' | 'required' | 'readonly'>, OwnProps>;
|
|
3
|
+
import { TextAreaProps } from './types';
|
|
97
4
|
/**
|
|
98
5
|
* __Text area__
|
|
99
6
|
*
|
|
@@ -103,5 +10,5 @@ export declare type TextAreaProps = Combine<Omit<React.TextareaHTMLAttributes<HT
|
|
|
103
10
|
* - [Code](https://atlassian.design/components/textarea/code)
|
|
104
11
|
* - [Usage](https://atlassian.design/components/textarea/usage)
|
|
105
12
|
*/
|
|
106
|
-
declare const TextArea: React.MemoExoticComponent<React.ForwardRefExoticComponent<Pick<TextAreaProps, "appearance" | "
|
|
13
|
+
declare const TextArea: React.MemoExoticComponent<React.ForwardRefExoticComponent<Pick<TextAreaProps, "appearance" | "isCompact" | "isDisabled" | "isReadOnly" | "isRequired" | "isInvalid" | "minimumRows" | "maxHeight" | "value" | "defaultValue" | "name" | "placeholder" | "onBlur" | "onChange" | "onFocus" | "isMonospaced" | "resize" | "spellCheck" | "theme" | "testId" | "autoComplete" | "autoFocus" | "cols" | "dirName" | "form" | "maxLength" | "minLength" | "readOnly" | "rows" | "wrap" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "slot" | "style" | "tabIndex" | "title" | "inputMode" | "is" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "css" | "createAnalyticsEvent"> & React.RefAttributes<HTMLTextAreaElement>>>;
|
|
107
14
|
export default TextArea;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
3
|
+
export interface OwnProps extends WithAnalyticsEventsProps {
|
|
4
|
+
/**
|
|
5
|
+
* controls the appearance of the field.
|
|
6
|
+
* subtle shows styling on hover.
|
|
7
|
+
* none prevents all field styling.
|
|
8
|
+
*/
|
|
9
|
+
appearance?: 'standard' | 'subtle' | 'none';
|
|
10
|
+
/**
|
|
11
|
+
* Set whether the fields should expand to fill available horizontal space.
|
|
12
|
+
*/
|
|
13
|
+
isCompact?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Sets the field as uneditable, with a changed hover state.
|
|
16
|
+
*/
|
|
17
|
+
isDisabled?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* If true, prevents the value of the input from being edited.
|
|
20
|
+
*/
|
|
21
|
+
isReadOnly?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Set required for form that the field is part of.
|
|
24
|
+
*/
|
|
25
|
+
isRequired?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Sets styling to indicate that the input is invalid.
|
|
28
|
+
*/
|
|
29
|
+
isInvalid?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* The minimum number of rows of text to display
|
|
32
|
+
*/
|
|
33
|
+
minimumRows?: number;
|
|
34
|
+
/**
|
|
35
|
+
* The maxheight of the textarea
|
|
36
|
+
*/
|
|
37
|
+
maxHeight?: string;
|
|
38
|
+
/**
|
|
39
|
+
* The value of the text-area.
|
|
40
|
+
*/
|
|
41
|
+
value?: string;
|
|
42
|
+
/**
|
|
43
|
+
* The default value of the textarea
|
|
44
|
+
*/
|
|
45
|
+
defaultValue?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Name of the input form control
|
|
48
|
+
*/
|
|
49
|
+
name?: string;
|
|
50
|
+
/**
|
|
51
|
+
* The placeholder within the textarea
|
|
52
|
+
*/
|
|
53
|
+
placeholder?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Handler to be called when the input is blurred
|
|
56
|
+
*/
|
|
57
|
+
onBlur?: React.FocusEventHandler<HTMLTextAreaElement>;
|
|
58
|
+
/**
|
|
59
|
+
* Handler to be called when the input changes.
|
|
60
|
+
*/
|
|
61
|
+
onChange?: React.ChangeEventHandler<HTMLTextAreaElement>;
|
|
62
|
+
/**
|
|
63
|
+
* Handler to be called when the input is focused
|
|
64
|
+
*/
|
|
65
|
+
onFocus?: React.FocusEventHandler<HTMLTextAreaElement>;
|
|
66
|
+
/**
|
|
67
|
+
* Sets content text value to monospace
|
|
68
|
+
*/
|
|
69
|
+
isMonospaced?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Enables the resizing of the textarea:
|
|
72
|
+
* auto: both directions.
|
|
73
|
+
* horizontal: only along the x axis.
|
|
74
|
+
* vertical: only along the y axis.
|
|
75
|
+
* smart (default): vertically grows and shrinks the textarea automatically to wrap your input text.
|
|
76
|
+
* none: explicitly disallow resizing on the textarea.
|
|
77
|
+
*/
|
|
78
|
+
resize?: 'auto' | 'vertical' | 'horizontal' | 'smart' | 'none';
|
|
79
|
+
/**
|
|
80
|
+
* Enables native spell check on the `textarea` element.
|
|
81
|
+
*/
|
|
82
|
+
spellCheck?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* The theme function TextArea consumes to derive theming constants for use in styling its components
|
|
85
|
+
*/
|
|
86
|
+
theme?: any;
|
|
87
|
+
/**
|
|
88
|
+
* A `testId` prop is provided for specified elements, which is a unique
|
|
89
|
+
* string that appears as a data attribute `data-testid` in the rendered code,
|
|
90
|
+
* serving as a hook for automated tests
|
|
91
|
+
*/
|
|
92
|
+
testId?: string;
|
|
93
|
+
}
|
|
94
|
+
declare type Combine<First, Second> = Omit<First, keyof Second> & Second;
|
|
95
|
+
export declare type TextAreaProps = Combine<Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'disabled' | 'required' | 'readonly'>, OwnProps>;
|
|
96
|
+
export {};
|
package/package.json
CHANGED