@spark-web/text-input 1.0.0 → 1.0.3
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 +55 -0
- package/README.md +3 -3
- package/dist/spark-web-text-input.cjs.dev.js +8 -17
- package/dist/spark-web-text-input.cjs.prod.js +8 -17
- package/dist/spark-web-text-input.esm.js +5 -10
- package/package.json +13 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,60 @@
|
|
|
1
1
|
# @spark-web/text-input
|
|
2
2
|
|
|
3
|
+
## 1.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#42](https://github.com/brighte-labs/spark-web/pull/42)
|
|
8
|
+
[`435779a`](https://github.com/brighte-labs/spark-web/commit/435779aa42bd635bbf43e1fd41724c666402caa2)
|
|
9
|
+
Thanks [@lukebennett88](https://github.com/lukebennett88)! - Prevent multiple
|
|
10
|
+
versions of React
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
[[`435779a`](https://github.com/brighte-labs/spark-web/commit/435779aa42bd635bbf43e1fd41724c666402caa2)]:
|
|
14
|
+
- @spark-web/a11y@1.0.3
|
|
15
|
+
- @spark-web/box@1.0.3
|
|
16
|
+
- @spark-web/field@1.0.3
|
|
17
|
+
- @spark-web/text@1.0.3
|
|
18
|
+
- @spark-web/theme@2.0.2
|
|
19
|
+
- @spark-web/utils@1.1.1
|
|
20
|
+
|
|
21
|
+
## 1.0.2
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- [#40](https://github.com/brighte-labs/spark-web/pull/40)
|
|
26
|
+
[`062c8ab`](https://github.com/brighte-labs/spark-web/commit/062c8ab8c7b4120f8d14c269b5f7801288c678ca)
|
|
27
|
+
Thanks [@lukebennett88](https://github.com/lukebennett88)! - Add
|
|
28
|
+
@babel/transform-runtime
|
|
29
|
+
|
|
30
|
+
- Updated dependencies
|
|
31
|
+
[[`062c8ab`](https://github.com/brighte-labs/spark-web/commit/062c8ab8c7b4120f8d14c269b5f7801288c678ca)]:
|
|
32
|
+
- @spark-web/a11y@1.0.2
|
|
33
|
+
- @spark-web/box@1.0.2
|
|
34
|
+
- @spark-web/field@1.0.2
|
|
35
|
+
- @spark-web/text@1.0.2
|
|
36
|
+
- @spark-web/theme@2.0.1
|
|
37
|
+
- @spark-web/utils@1.0.2
|
|
38
|
+
|
|
39
|
+
## 1.0.1
|
|
40
|
+
|
|
41
|
+
### Patch Changes
|
|
42
|
+
|
|
43
|
+
- [#36](https://github.com/brighte-labs/spark-web/pull/36)
|
|
44
|
+
[`8546f8f`](https://github.com/brighte-labs/spark-web/commit/8546f8f05daaa79ea3ff954c6c4928a7a2d0622d)
|
|
45
|
+
Thanks [@lukebennett88](https://github.com/lukebennett88)! - Update Babel
|
|
46
|
+
config
|
|
47
|
+
|
|
48
|
+
- Updated dependencies
|
|
49
|
+
[[`aebff30`](https://github.com/brighte-labs/spark-web/commit/aebff30c86cb0a9db22b545c46159ce0d1c14afb),
|
|
50
|
+
[`8546f8f`](https://github.com/brighte-labs/spark-web/commit/8546f8f05daaa79ea3ff954c6c4928a7a2d0622d)]:
|
|
51
|
+
- @spark-web/theme@2.0.0
|
|
52
|
+
- @spark-web/a11y@1.0.1
|
|
53
|
+
- @spark-web/box@1.0.1
|
|
54
|
+
- @spark-web/field@1.0.1
|
|
55
|
+
- @spark-web/text@1.0.1
|
|
56
|
+
- @spark-web/utils@1.0.1
|
|
57
|
+
|
|
3
58
|
## 1.0.0
|
|
4
59
|
|
|
5
60
|
### Major Changes
|
package/README.md
CHANGED
|
@@ -19,9 +19,9 @@ details.
|
|
|
19
19
|
| ------------ | ------------------------------------------------------------------------- | ------- | -------------------------------------------------------------------------------------------- |
|
|
20
20
|
| data? | [DataAttributeMap][data-attribute-map] | | Sets data attributes for the component. |
|
|
21
21
|
| type? | 'text' \| 'password' \| 'email' \| 'search' \| 'number' \| 'tel' \| 'url' | 'text' | Sets the type attribute for the component. |
|
|
22
|
-
| onBlur? | React.FocusEventHandler
|
|
23
|
-
| onFocus? | React.FocusEventHandler
|
|
24
|
-
| onChange? | React.FormEventHandler
|
|
22
|
+
| onBlur? | React.FocusEventHandler\<HTMLInputElement> | | Callback function when input field component loses focuses. |
|
|
23
|
+
| onFocus? | React.FocusEventHandler\<HTMLInputElement> | | Callback function when the input field component is in focus. |
|
|
24
|
+
| onChange? | React.FormEventHandler\<HTMLInputElement> | | Callback function when value of the input field has been changed. |
|
|
25
25
|
| placeholder? | string | | Specifies a short hint that describes the expected value (type of value) of the input field. |
|
|
26
26
|
| value? | string \| number \| readonly string[] | | Specifies the value of the input field. |
|
|
27
27
|
|
|
@@ -2,11 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var _objectWithoutProperties = require('@babel/runtime/helpers/esm/objectWithoutProperties');
|
|
9
|
-
var React = require('react');
|
|
5
|
+
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
6
|
+
var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
|
|
7
|
+
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
10
8
|
var css = require('@emotion/css');
|
|
11
9
|
var a11y = require('@spark-web/a11y');
|
|
12
10
|
var box = require('@spark-web/box');
|
|
@@ -14,21 +12,14 @@ var field = require('@spark-web/field');
|
|
|
14
12
|
var text = require('@spark-web/text');
|
|
15
13
|
var theme = require('@spark-web/theme');
|
|
16
14
|
var internal = require('@spark-web/utils/internal');
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
15
|
+
var react = require('react');
|
|
16
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
21
17
|
|
|
22
18
|
var _excluded = ["data"],
|
|
23
19
|
_excluded2 = ["disabled", "invalid"];
|
|
24
|
-
var __jsx = React__default["default"].createElement;
|
|
25
|
-
|
|
26
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
27
|
-
|
|
28
|
-
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) { _defineProperty(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; }
|
|
29
20
|
|
|
30
21
|
/** Organize and emphasize information quickly and effectively in a list of text elements. */
|
|
31
|
-
var TextInput = /*#__PURE__*/
|
|
22
|
+
var TextInput = /*#__PURE__*/react.forwardRef(function (_ref, forwardedRef) {
|
|
32
23
|
var data = _ref.data,
|
|
33
24
|
consumerProps = _objectWithoutProperties(_ref, _excluded);
|
|
34
25
|
|
|
@@ -41,7 +32,7 @@ var TextInput = /*#__PURE__*/React.forwardRef(function (_ref, forwardedRef) {
|
|
|
41
32
|
disabled: disabled,
|
|
42
33
|
invalid: invalid
|
|
43
34
|
});
|
|
44
|
-
return
|
|
35
|
+
return /*#__PURE__*/jsxRuntime.jsx(box.Box, _objectSpread(_objectSpread(_objectSpread({
|
|
45
36
|
as: "input",
|
|
46
37
|
disabled: disabled,
|
|
47
38
|
ref: forwardedRef // styles
|
|
@@ -52,7 +43,7 @@ var TextInput = /*#__PURE__*/React.forwardRef(function (_ref, forwardedRef) {
|
|
|
52
43
|
height: "medium",
|
|
53
44
|
paddingX: "medium",
|
|
54
45
|
className: css.css(inputStyles)
|
|
55
|
-
}, data ? internal.buildDataAttributes(data) : null, a11yProps, consumerProps));
|
|
46
|
+
}, data ? internal.buildDataAttributes(data) : null), a11yProps), consumerProps));
|
|
56
47
|
});
|
|
57
48
|
TextInput.displayName = 'TextInput'; // Styled components
|
|
58
49
|
// ------------------------------
|
|
@@ -2,11 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var _objectWithoutProperties = require('@babel/runtime/helpers/esm/objectWithoutProperties');
|
|
9
|
-
var React = require('react');
|
|
5
|
+
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
6
|
+
var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
|
|
7
|
+
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
10
8
|
var css = require('@emotion/css');
|
|
11
9
|
var a11y = require('@spark-web/a11y');
|
|
12
10
|
var box = require('@spark-web/box');
|
|
@@ -14,21 +12,14 @@ var field = require('@spark-web/field');
|
|
|
14
12
|
var text = require('@spark-web/text');
|
|
15
13
|
var theme = require('@spark-web/theme');
|
|
16
14
|
var internal = require('@spark-web/utils/internal');
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
15
|
+
var react = require('react');
|
|
16
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
21
17
|
|
|
22
18
|
var _excluded = ["data"],
|
|
23
19
|
_excluded2 = ["disabled", "invalid"];
|
|
24
|
-
var __jsx = React__default["default"].createElement;
|
|
25
|
-
|
|
26
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
27
|
-
|
|
28
|
-
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) { _defineProperty(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; }
|
|
29
20
|
|
|
30
21
|
/** Organize and emphasize information quickly and effectively in a list of text elements. */
|
|
31
|
-
var TextInput = /*#__PURE__*/
|
|
22
|
+
var TextInput = /*#__PURE__*/react.forwardRef(function (_ref, forwardedRef) {
|
|
32
23
|
var data = _ref.data,
|
|
33
24
|
consumerProps = _objectWithoutProperties(_ref, _excluded);
|
|
34
25
|
|
|
@@ -41,7 +32,7 @@ var TextInput = /*#__PURE__*/React.forwardRef(function (_ref, forwardedRef) {
|
|
|
41
32
|
disabled: disabled,
|
|
42
33
|
invalid: invalid
|
|
43
34
|
});
|
|
44
|
-
return
|
|
35
|
+
return /*#__PURE__*/jsxRuntime.jsx(box.Box, _objectSpread(_objectSpread(_objectSpread({
|
|
45
36
|
as: "input",
|
|
46
37
|
disabled: disabled,
|
|
47
38
|
ref: forwardedRef // styles
|
|
@@ -52,7 +43,7 @@ var TextInput = /*#__PURE__*/React.forwardRef(function (_ref, forwardedRef) {
|
|
|
52
43
|
height: "medium",
|
|
53
44
|
paddingX: "medium",
|
|
54
45
|
className: css.css(inputStyles)
|
|
55
|
-
}, data ? internal.buildDataAttributes(data) : null, a11yProps, consumerProps));
|
|
46
|
+
}, data ? internal.buildDataAttributes(data) : null), a11yProps), consumerProps));
|
|
56
47
|
});
|
|
57
48
|
TextInput.displayName = 'TextInput'; // Styled components
|
|
58
49
|
// ------------------------------
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
1
|
import _slicedToArray from '@babel/runtime/helpers/esm/slicedToArray';
|
|
3
|
-
import
|
|
2
|
+
import _objectSpread from '@babel/runtime/helpers/esm/objectSpread2';
|
|
4
3
|
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
5
|
-
import React, { forwardRef } from 'react';
|
|
6
4
|
import { css } from '@emotion/css';
|
|
7
5
|
import { useFocusRing } from '@spark-web/a11y';
|
|
8
6
|
import { Box } from '@spark-web/box';
|
|
@@ -10,14 +8,11 @@ import { useFieldContext } from '@spark-web/field';
|
|
|
10
8
|
import { useText } from '@spark-web/text';
|
|
11
9
|
import { useTheme } from '@spark-web/theme';
|
|
12
10
|
import { buildDataAttributes } from '@spark-web/utils/internal';
|
|
11
|
+
import { forwardRef } from 'react';
|
|
12
|
+
import { jsx } from 'react/jsx-runtime';
|
|
13
13
|
|
|
14
14
|
var _excluded = ["data"],
|
|
15
15
|
_excluded2 = ["disabled", "invalid"];
|
|
16
|
-
var __jsx = React.createElement;
|
|
17
|
-
|
|
18
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
19
|
-
|
|
20
|
-
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) { _defineProperty(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; }
|
|
21
16
|
|
|
22
17
|
/** Organize and emphasize information quickly and effectively in a list of text elements. */
|
|
23
18
|
var TextInput = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
|
|
@@ -33,7 +28,7 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
|
|
|
33
28
|
disabled: disabled,
|
|
34
29
|
invalid: invalid
|
|
35
30
|
});
|
|
36
|
-
return
|
|
31
|
+
return /*#__PURE__*/jsx(Box, _objectSpread(_objectSpread(_objectSpread({
|
|
37
32
|
as: "input",
|
|
38
33
|
disabled: disabled,
|
|
39
34
|
ref: forwardedRef // styles
|
|
@@ -44,7 +39,7 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
|
|
|
44
39
|
height: "medium",
|
|
45
40
|
paddingX: "medium",
|
|
46
41
|
className: css(inputStyles)
|
|
47
|
-
}, data ? buildDataAttributes(data) : null, a11yProps, consumerProps));
|
|
42
|
+
}, data ? buildDataAttributes(data) : null), a11yProps), consumerProps));
|
|
48
43
|
});
|
|
49
44
|
TextInput.displayName = 'TextInput'; // Styled components
|
|
50
45
|
// ------------------------------
|
package/package.json
CHANGED
|
@@ -1,23 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spark-web/text-input",
|
|
3
|
+
"version": "1.0.3",
|
|
3
4
|
"license": "MIT",
|
|
4
|
-
"version": "1.0.0",
|
|
5
5
|
"main": "dist/spark-web-text-input.cjs.js",
|
|
6
6
|
"module": "dist/spark-web-text-input.esm.js",
|
|
7
|
-
"devDependencies": {
|
|
8
|
-
"@types/react": "^17.0.12"
|
|
9
|
-
},
|
|
10
7
|
"dependencies": {
|
|
11
8
|
"@babel/runtime": "^7.14.6",
|
|
12
9
|
"@emotion/css": "^11.7.1",
|
|
13
|
-
"@spark-web/a11y": "^1.0.
|
|
14
|
-
"@spark-web/box": "^1.0.
|
|
15
|
-
"@spark-web/field": "^1.0.
|
|
16
|
-
"@spark-web/text": "^1.0.
|
|
17
|
-
"@spark-web/theme": "^
|
|
18
|
-
"@spark-web/utils": "^1.
|
|
10
|
+
"@spark-web/a11y": "^1.0.3",
|
|
11
|
+
"@spark-web/box": "^1.0.3",
|
|
12
|
+
"@spark-web/field": "^1.0.3",
|
|
13
|
+
"@spark-web/text": "^1.0.3",
|
|
14
|
+
"@spark-web/theme": "^2.0.2",
|
|
15
|
+
"@spark-web/utils": "^1.1.1"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@types/react": "^17.0.12",
|
|
19
19
|
"react": "^17.0.2"
|
|
20
20
|
},
|
|
21
|
+
"peerDependencies": {
|
|
22
|
+
"react": ">=17.0.2"
|
|
23
|
+
},
|
|
21
24
|
"engines": {
|
|
22
25
|
"node": ">= 14.13"
|
|
23
26
|
}
|