@micromag/element-text-input 0.4.49 → 0.4.51
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/es/index.js +17 -10
- package/package.json +3 -3
package/es/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
2
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
-
import
|
|
4
|
+
import { useId } from 'react';
|
|
5
5
|
import { usePlaceholderStyle } from '@micromag/core/hooks';
|
|
6
6
|
import { getStyleFromMargin, getStyleFromText, getStyleFromBox } from '@micromag/core/utils';
|
|
7
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
8
|
|
|
8
9
|
var styles = {"container":"micromag-element-text-input-container","element":"micromag-element-text-input-element"};
|
|
9
10
|
|
|
@@ -78,22 +79,28 @@ function TextInput(_ref) {
|
|
|
78
79
|
required: required,
|
|
79
80
|
disabled: disabled
|
|
80
81
|
});
|
|
81
|
-
var element = multiline ? /*#__PURE__*/
|
|
82
|
+
var element = multiline ? /*#__PURE__*/jsx("textarea", _objectSpread(_objectSpread({}, elementProps), {}, {
|
|
82
83
|
tabIndex: focusable ? 0 : -1,
|
|
83
84
|
id: "input-".concat(id)
|
|
84
|
-
})) : /*#__PURE__*/
|
|
85
|
+
})) : /*#__PURE__*/jsx("input", _objectSpread(_objectSpread({}, elementProps), {}, {
|
|
85
86
|
type: "text",
|
|
86
87
|
tabIndex: focusable ? 0 : -1,
|
|
87
88
|
id: "input-".concat(id)
|
|
88
89
|
}));
|
|
89
90
|
var placeholderStyles = usePlaceholderStyle("#input-".concat(id), placeholderStyle);
|
|
90
|
-
var placeholderStyleElement = placeholderStyles !== null ? /*#__PURE__*/
|
|
91
|
-
type: "text/css"
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
},
|
|
91
|
+
var placeholderStyleElement = placeholderStyles !== null ? /*#__PURE__*/jsx("style", {
|
|
92
|
+
type: "text/css",
|
|
93
|
+
children: placeholderStyles
|
|
94
|
+
}) : null;
|
|
95
|
+
return !labelOutside ? /*#__PURE__*/jsxs(Fragment, {
|
|
96
|
+
children: [element, placeholderStyleElement]
|
|
97
|
+
}) : /*#__PURE__*/jsxs("label", _objectSpread(_objectSpread({}, containerProps), {}, {
|
|
98
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
99
|
+
className: labelClassName,
|
|
100
|
+
style: labelStyle,
|
|
101
|
+
children: label
|
|
102
|
+
}), element, placeholderStyleElement]
|
|
103
|
+
}));
|
|
97
104
|
}
|
|
98
105
|
|
|
99
106
|
export { TextInput as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-text-input",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.51",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"@babel/runtime": "^7.28.6",
|
|
63
|
-
"@micromag/core": "^0.4.
|
|
63
|
+
"@micromag/core": "^0.4.51",
|
|
64
64
|
"classnames": "^2.2.6",
|
|
65
65
|
"react-helmet": "^6.1.0"
|
|
66
66
|
},
|
|
@@ -68,6 +68,6 @@
|
|
|
68
68
|
"access": "public",
|
|
69
69
|
"registry": "https://registry.npmjs.org/"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "985a2370829c9ac8901ea97bf20bfc98ab158439",
|
|
72
72
|
"types": "es/index.d.ts"
|
|
73
73
|
}
|