@atlaskit/textarea 4.3.10 → 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 +12 -0
- package/dist/cjs/component-tokens.js +5 -5
- package/dist/cjs/styles.js +17 -15
- package/dist/cjs/text-area.js +2 -2
- package/dist/cjs/theme.js +7 -1
- package/dist/cjs/types.js +5 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/component-tokens.js +3 -3
- package/dist/es2019/styles.js +21 -15
- package/dist/es2019/text-area.js +2 -2
- package/dist/es2019/theme.js +7 -1
- package/dist/es2019/types.js +1 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/component-tokens.js +3 -3
- package/dist/esm/styles.js +17 -15
- package/dist/esm/text-area.js +2 -2
- package/dist/esm/theme.js +7 -1
- package/dist/esm/types.js +1 -0
- package/dist/esm/version.json +1 -1
- package/dist/types/component-tokens.d.ts +3 -3
- 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/theme.d.ts +1 -0
- package/dist/types/types.d.ts +96 -0
- package/dist/types-ts4.0/component-tokens.d.ts +3 -3
- 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/theme.d.ts +1 -0
- 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,17 @@
|
|
|
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
|
+
|
|
9
|
+
## 4.3.11
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`bedbdec0e82`](https://bitbucket.org/atlassian/atlassian-frontend/commits/bedbdec0e82) - Update hover state appearance of subtle Textarea, Textfield and Select components to match the hover states of their default counterparts.
|
|
14
|
+
|
|
3
15
|
## 4.3.10
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.transparent = exports.textColor = exports.
|
|
6
|
+
exports.transparent = exports.textColor = exports.subtleBorderColorHover = exports.placeholderTextColor = exports.invalidBorderColor = exports.disabledTextColor = exports.disabledBorder = exports.disabledBackground = exports.defaultBorderColorFocus = exports.defaultBorderColor = exports.defaultBackgroundColorHover = exports.defaultBackgroundColorFocus = exports.defaultBackgroundColor = void 0;
|
|
7
7
|
|
|
8
8
|
var _colors = require("@atlaskit/theme/colors");
|
|
9
9
|
|
|
@@ -47,11 +47,11 @@ var defaultBackgroundColorFocus = {
|
|
|
47
47
|
dark: "var(--ds-background-input-pressed, ".concat(_colors.DN10, ")")
|
|
48
48
|
};
|
|
49
49
|
exports.defaultBackgroundColorFocus = defaultBackgroundColorFocus;
|
|
50
|
-
var
|
|
51
|
-
light: "var(--ds-
|
|
52
|
-
dark: "var(--ds-
|
|
50
|
+
var subtleBorderColorHover = {
|
|
51
|
+
light: "var(--ds-border-input, transparent)",
|
|
52
|
+
dark: "var(--ds-border-input, transparent)"
|
|
53
53
|
};
|
|
54
|
-
exports.
|
|
54
|
+
exports.subtleBorderColorHover = subtleBorderColorHover;
|
|
55
55
|
var placeholderTextColor = {
|
|
56
56
|
light: "var(--ds-text-subtlest, ".concat(_colors.N100, ")"),
|
|
57
57
|
dark: "var(--ds-text-subtlest, ".concat(_colors.DN200, ")")
|
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) {
|
|
@@ -82,10 +83,11 @@ var placeholderStyle = function placeholderStyle(placeholderTextColor) {
|
|
|
82
83
|
};
|
|
83
84
|
};
|
|
84
85
|
|
|
85
|
-
var
|
|
86
|
+
var hoverBackgroundAndBorderStyles = function hoverBackgroundAndBorderStyles(props) {
|
|
86
87
|
return {
|
|
87
88
|
'&:hover:not(:read-only):not(:focus)': {
|
|
88
89
|
backgroundColor: props.backgroundColorHover,
|
|
90
|
+
borderColor: props.borderColorHover,
|
|
89
91
|
'&:disabled': {
|
|
90
92
|
backgroundColor: props.disabledRules.backgroundColorHover
|
|
91
93
|
},
|
|
@@ -150,7 +152,7 @@ var staticStyles = {
|
|
|
150
152
|
borderRadius: borderRadius,
|
|
151
153
|
boxSizing: 'border-box',
|
|
152
154
|
overflow: 'auto',
|
|
153
|
-
transition: "background-color ".concat(transitionDuration, " ease-in-out"),
|
|
155
|
+
transition: "background-color ".concat(transitionDuration, " ease-in-out,\n border-color ").concat(transitionDuration, " ease-in-out"),
|
|
154
156
|
wordWrap: 'break-word',
|
|
155
157
|
fontSize: fontSize,
|
|
156
158
|
borderWidth: borderWidth,
|
|
@@ -184,8 +186,8 @@ var getBaseStyles = function getBaseStyles(_ref) {
|
|
|
184
186
|
|
|
185
187
|
exports.getBaseStyles = getBaseStyles;
|
|
186
188
|
|
|
187
|
-
var themeStyles = function themeStyles(props) {
|
|
188
|
-
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, bgAndBorderColorStyles(props)),
|
|
189
|
+
var themeStyles = function themeStyles(props, appearance) {
|
|
190
|
+
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, bgAndBorderColorStyles(props, appearance)), hoverBackgroundAndBorderStyles(props)), placeholderStyle(props.placeholderTextColor)), {}, {
|
|
189
191
|
color: props.textColor,
|
|
190
192
|
'&:disabled': {
|
|
191
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/theme.js
CHANGED
|
@@ -61,7 +61,7 @@ var backgroundColorFocus = {
|
|
|
61
61
|
};
|
|
62
62
|
var backgroundColorHover = {
|
|
63
63
|
standard: componentTokens.defaultBackgroundColorHover,
|
|
64
|
-
subtle: componentTokens.
|
|
64
|
+
subtle: componentTokens.defaultBackgroundColorHover,
|
|
65
65
|
none: componentTokens.transparent
|
|
66
66
|
};
|
|
67
67
|
var borderColor = {
|
|
@@ -74,6 +74,11 @@ var borderColorFocus = {
|
|
|
74
74
|
subtle: componentTokens.defaultBorderColorFocus,
|
|
75
75
|
none: componentTokens.transparent
|
|
76
76
|
};
|
|
77
|
+
var borderColorHover = {
|
|
78
|
+
standard: componentTokens.defaultBorderColor,
|
|
79
|
+
subtle: componentTokens.subtleBorderColorHover,
|
|
80
|
+
none: componentTokens.transparent
|
|
81
|
+
};
|
|
77
82
|
|
|
78
83
|
/**
|
|
79
84
|
* @deprecated
|
|
@@ -104,6 +109,7 @@ var Theme = (0, _components.createTheme)(function (_ref) {
|
|
|
104
109
|
return {
|
|
105
110
|
borderColor: borderColor[appearance][mode],
|
|
106
111
|
borderColorFocus: borderColorFocus[appearance][mode],
|
|
112
|
+
borderColorHover: borderColorHover[appearance][mode],
|
|
107
113
|
backgroundColorHover: backgroundColorHover[appearance][mode],
|
|
108
114
|
backgroundColorFocus: backgroundColorFocus[appearance][mode],
|
|
109
115
|
backgroundColor: backgroundColor[appearance][mode],
|
package/dist/cjs/version.json
CHANGED
|
@@ -31,9 +31,9 @@ export const defaultBackgroundColorFocus = {
|
|
|
31
31
|
light: `var(--ds-background-input-pressed, ${N0})`,
|
|
32
32
|
dark: `var(--ds-background-input-pressed, ${DN10})`
|
|
33
33
|
};
|
|
34
|
-
export const
|
|
35
|
-
light:
|
|
36
|
-
dark:
|
|
34
|
+
export const subtleBorderColorHover = {
|
|
35
|
+
light: "var(--ds-border-input, transparent)",
|
|
36
|
+
dark: "var(--ds-border-input, transparent)"
|
|
37
37
|
};
|
|
38
38
|
export const placeholderTextColor = {
|
|
39
39
|
light: `var(--ds-text-subtlest, ${N100})`,
|
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 => ({
|
|
@@ -62,10 +66,11 @@ const placeholderStyle = placeholderTextColor => ({
|
|
|
62
66
|
}
|
|
63
67
|
});
|
|
64
68
|
|
|
65
|
-
const
|
|
69
|
+
const hoverBackgroundAndBorderStyles = props => {
|
|
66
70
|
return {
|
|
67
71
|
'&:hover:not(:read-only):not(:focus)': {
|
|
68
72
|
backgroundColor: props.backgroundColorHover,
|
|
73
|
+
borderColor: props.borderColorHover,
|
|
69
74
|
'&:disabled': {
|
|
70
75
|
backgroundColor: props.disabledRules.backgroundColorHover
|
|
71
76
|
},
|
|
@@ -125,7 +130,8 @@ const staticStyles = {
|
|
|
125
130
|
borderRadius: borderRadius,
|
|
126
131
|
boxSizing: 'border-box',
|
|
127
132
|
overflow: 'auto',
|
|
128
|
-
transition: `background-color ${transitionDuration} ease-in-out
|
|
133
|
+
transition: `background-color ${transitionDuration} ease-in-out,
|
|
134
|
+
border-color ${transitionDuration} ease-in-out`,
|
|
129
135
|
wordWrap: 'break-word',
|
|
130
136
|
fontSize,
|
|
131
137
|
borderWidth: borderWidth,
|
|
@@ -159,9 +165,9 @@ export const getBaseStyles = ({
|
|
|
159
165
|
...fontFamilyStyle(isMonospaced),
|
|
160
166
|
maxHeight
|
|
161
167
|
});
|
|
162
|
-
export const themeStyles = props => {
|
|
163
|
-
return { ...bgAndBorderColorStyles(props),
|
|
164
|
-
...
|
|
168
|
+
export const themeStyles = (props, appearance) => {
|
|
169
|
+
return { ...bgAndBorderColorStyles(props, appearance),
|
|
170
|
+
...hoverBackgroundAndBorderStyles(props),
|
|
165
171
|
...placeholderStyle(props.placeholderTextColor),
|
|
166
172
|
color: props.textColor,
|
|
167
173
|
'&:disabled': {
|
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,
|
package/dist/es2019/theme.js
CHANGED
|
@@ -46,7 +46,7 @@ const backgroundColorFocus = {
|
|
|
46
46
|
};
|
|
47
47
|
const backgroundColorHover = {
|
|
48
48
|
standard: componentTokens.defaultBackgroundColorHover,
|
|
49
|
-
subtle: componentTokens.
|
|
49
|
+
subtle: componentTokens.defaultBackgroundColorHover,
|
|
50
50
|
none: componentTokens.transparent
|
|
51
51
|
};
|
|
52
52
|
const borderColor = {
|
|
@@ -59,6 +59,11 @@ const borderColorFocus = {
|
|
|
59
59
|
subtle: componentTokens.defaultBorderColorFocus,
|
|
60
60
|
none: componentTokens.transparent
|
|
61
61
|
};
|
|
62
|
+
const borderColorHover = {
|
|
63
|
+
standard: componentTokens.defaultBorderColor,
|
|
64
|
+
subtle: componentTokens.subtleBorderColorHover,
|
|
65
|
+
none: componentTokens.transparent
|
|
66
|
+
};
|
|
62
67
|
|
|
63
68
|
/**
|
|
64
69
|
* @deprecated
|
|
@@ -88,6 +93,7 @@ export const Theme = createTheme(({
|
|
|
88
93
|
}) => ({
|
|
89
94
|
borderColor: borderColor[appearance][mode],
|
|
90
95
|
borderColorFocus: borderColorFocus[appearance][mode],
|
|
96
|
+
borderColorHover: borderColorHover[appearance][mode],
|
|
91
97
|
backgroundColorHover: backgroundColorHover[appearance][mode],
|
|
92
98
|
backgroundColorFocus: backgroundColorFocus[appearance][mode],
|
|
93
99
|
backgroundColor: backgroundColor[appearance][mode],
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/es2019/version.json
CHANGED
|
@@ -31,9 +31,9 @@ export var defaultBackgroundColorFocus = {
|
|
|
31
31
|
light: "var(--ds-background-input-pressed, ".concat(N0, ")"),
|
|
32
32
|
dark: "var(--ds-background-input-pressed, ".concat(DN10, ")")
|
|
33
33
|
};
|
|
34
|
-
export var
|
|
35
|
-
light: "var(--ds-
|
|
36
|
-
dark: "var(--ds-
|
|
34
|
+
export var subtleBorderColorHover = {
|
|
35
|
+
light: "var(--ds-border-input, transparent)",
|
|
36
|
+
dark: "var(--ds-border-input, transparent)"
|
|
37
37
|
};
|
|
38
38
|
export var placeholderTextColor = {
|
|
39
39
|
light: "var(--ds-text-subtlest, ".concat(N100, ")"),
|
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) {
|
|
@@ -72,10 +73,11 @@ var placeholderStyle = function placeholderStyle(placeholderTextColor) {
|
|
|
72
73
|
};
|
|
73
74
|
};
|
|
74
75
|
|
|
75
|
-
var
|
|
76
|
+
var hoverBackgroundAndBorderStyles = function hoverBackgroundAndBorderStyles(props) {
|
|
76
77
|
return {
|
|
77
78
|
'&:hover:not(:read-only):not(:focus)': {
|
|
78
79
|
backgroundColor: props.backgroundColorHover,
|
|
80
|
+
borderColor: props.borderColorHover,
|
|
79
81
|
'&:disabled': {
|
|
80
82
|
backgroundColor: props.disabledRules.backgroundColorHover
|
|
81
83
|
},
|
|
@@ -140,7 +142,7 @@ var staticStyles = {
|
|
|
140
142
|
borderRadius: borderRadius,
|
|
141
143
|
boxSizing: 'border-box',
|
|
142
144
|
overflow: 'auto',
|
|
143
|
-
transition: "background-color ".concat(transitionDuration, " ease-in-out"),
|
|
145
|
+
transition: "background-color ".concat(transitionDuration, " ease-in-out,\n border-color ").concat(transitionDuration, " ease-in-out"),
|
|
144
146
|
wordWrap: 'break-word',
|
|
145
147
|
fontSize: fontSize,
|
|
146
148
|
borderWidth: borderWidth,
|
|
@@ -170,8 +172,8 @@ export var getBaseStyles = function getBaseStyles(_ref) {
|
|
|
170
172
|
maxHeight: maxHeight
|
|
171
173
|
});
|
|
172
174
|
};
|
|
173
|
-
export var themeStyles = function themeStyles(props) {
|
|
174
|
-
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, bgAndBorderColorStyles(props)),
|
|
175
|
+
export var themeStyles = function themeStyles(props, appearance) {
|
|
176
|
+
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, bgAndBorderColorStyles(props, appearance)), hoverBackgroundAndBorderStyles(props)), placeholderStyle(props.placeholderTextColor)), {}, {
|
|
175
177
|
color: props.textColor,
|
|
176
178
|
'&:disabled': {
|
|
177
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,
|
package/dist/esm/theme.js
CHANGED
|
@@ -46,7 +46,7 @@ var backgroundColorFocus = {
|
|
|
46
46
|
};
|
|
47
47
|
var backgroundColorHover = {
|
|
48
48
|
standard: componentTokens.defaultBackgroundColorHover,
|
|
49
|
-
subtle: componentTokens.
|
|
49
|
+
subtle: componentTokens.defaultBackgroundColorHover,
|
|
50
50
|
none: componentTokens.transparent
|
|
51
51
|
};
|
|
52
52
|
var borderColor = {
|
|
@@ -59,6 +59,11 @@ var borderColorFocus = {
|
|
|
59
59
|
subtle: componentTokens.defaultBorderColorFocus,
|
|
60
60
|
none: componentTokens.transparent
|
|
61
61
|
};
|
|
62
|
+
var borderColorHover = {
|
|
63
|
+
standard: componentTokens.defaultBorderColor,
|
|
64
|
+
subtle: componentTokens.subtleBorderColorHover,
|
|
65
|
+
none: componentTokens.transparent
|
|
66
|
+
};
|
|
62
67
|
|
|
63
68
|
/**
|
|
64
69
|
* @deprecated
|
|
@@ -88,6 +93,7 @@ export var Theme = createTheme(function (_ref) {
|
|
|
88
93
|
return {
|
|
89
94
|
borderColor: borderColor[appearance][mode],
|
|
90
95
|
borderColorFocus: borderColorFocus[appearance][mode],
|
|
96
|
+
borderColorHover: borderColorHover[appearance][mode],
|
|
91
97
|
backgroundColorHover: backgroundColorHover[appearance][mode],
|
|
92
98
|
backgroundColorFocus: backgroundColorFocus[appearance][mode],
|
|
93
99
|
backgroundColor: backgroundColor[appearance][mode],
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/esm/version.json
CHANGED
|
@@ -30,9 +30,9 @@ export declare const defaultBackgroundColorFocus: {
|
|
|
30
30
|
light: "var(--ds-background-input-pressed)";
|
|
31
31
|
dark: "var(--ds-background-input-pressed)";
|
|
32
32
|
};
|
|
33
|
-
export declare const
|
|
34
|
-
light: "var(--ds-
|
|
35
|
-
dark: "var(--ds-
|
|
33
|
+
export declare const subtleBorderColorHover: {
|
|
34
|
+
light: "var(--ds-border-input)";
|
|
35
|
+
dark: "var(--ds-border-input)";
|
|
36
36
|
};
|
|
37
37
|
export declare const placeholderTextColor: {
|
|
38
38
|
light: "var(--ds-text-subtlest)";
|
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;
|
package/dist/types/theme.d.ts
CHANGED
|
@@ -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 {};
|
|
@@ -30,9 +30,9 @@ export declare const defaultBackgroundColorFocus: {
|
|
|
30
30
|
light: "var(--ds-background-input-pressed)";
|
|
31
31
|
dark: "var(--ds-background-input-pressed)";
|
|
32
32
|
};
|
|
33
|
-
export declare const
|
|
34
|
-
light: "var(--ds-
|
|
35
|
-
dark: "var(--ds-
|
|
33
|
+
export declare const subtleBorderColorHover: {
|
|
34
|
+
light: "var(--ds-border-input)";
|
|
35
|
+
dark: "var(--ds-border-input)";
|
|
36
36
|
};
|
|
37
37
|
export declare const placeholderTextColor: {
|
|
38
38
|
light: "var(--ds-text-subtlest)";
|
|
@@ -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