@micromag/element-text-input 0.4.10 → 0.4.12
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 +6 -2
- package/package.json +5 -5
package/es/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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 React from 'react';
|
|
4
|
+
import React, { useId } from 'react';
|
|
5
5
|
import { Helmet } from 'react-helmet';
|
|
6
6
|
import { usePlaceholderStyle } from '@micromag/core/hooks';
|
|
7
7
|
import { getStyleFromMargin, getStyleFromText, getStyleFromBox } from '@micromag/core/utils';
|
|
@@ -47,6 +47,7 @@ function TextInput(_ref) {
|
|
|
47
47
|
var labelStyle = {};
|
|
48
48
|
var elementStyle = {};
|
|
49
49
|
var placeholderStyle = {};
|
|
50
|
+
var id = useId();
|
|
50
51
|
if (margin !== null) {
|
|
51
52
|
containerStyle = _objectSpread(_objectSpread({}, containerStyle), getStyleFromMargin(margin));
|
|
52
53
|
}
|
|
@@ -88,7 +89,10 @@ function TextInput(_ref) {
|
|
|
88
89
|
tabIndex: focusable ? '0' : '-1'
|
|
89
90
|
}));
|
|
90
91
|
var placeholderStyles = usePlaceholderStyle(styles.element, placeholderStyle);
|
|
91
|
-
var placeholderStyleElement = /*#__PURE__*/React.createElement(Helmet, null, /*#__PURE__*/React.createElement("style",
|
|
92
|
+
var placeholderStyleElement = /*#__PURE__*/React.createElement(Helmet, null, /*#__PURE__*/React.createElement("style", {
|
|
93
|
+
href: "inputstyle-".concat(id),
|
|
94
|
+
precedence: "medium"
|
|
95
|
+
}, placeholderStyles));
|
|
92
96
|
return !labelOutside ? /*#__PURE__*/React.createElement(React.Fragment, null, element, placeholderStyleElement) : /*#__PURE__*/React.createElement("label", containerProps, /*#__PURE__*/React.createElement("div", {
|
|
93
97
|
className: labelClassName,
|
|
94
98
|
style: labelStyle
|
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.12",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -51,16 +51,16 @@
|
|
|
51
51
|
"build": "../../scripts/prepare-package.sh --types"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"react": "^19.
|
|
54
|
+
"react": "^18.3.0 || ^19.0.0",
|
|
55
55
|
"react-dom": "^18.3.0 || ^19.0.0"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"react": "^19.
|
|
58
|
+
"react": "^18.3.0 || ^19.0.0",
|
|
59
59
|
"react-dom": "^18.3.0 || ^19.0.0"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"@babel/runtime": "^7.28.6",
|
|
63
|
-
"@micromag/core": "^0.4.
|
|
63
|
+
"@micromag/core": "^0.4.12",
|
|
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": "fa821e0596694b952cf4d6dd45f9f3ff57d9ef92",
|
|
72
72
|
"types": "es/index.d.ts"
|
|
73
73
|
}
|