@micromag/element-text-input 0.4.45 → 0.4.48

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.
Files changed (2) hide show
  1. package/es/index.js +9 -9
  2. package/package.json +3 -3
package/es/index.js CHANGED
@@ -2,7 +2,6 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
2
  import _objectSpread from '@babel/runtime/helpers/objectSpread2';
3
3
  import classNames from 'classnames';
4
4
  import React, { useId } from 'react';
5
- import { Helmet } from 'react-helmet';
6
5
  import { usePlaceholderStyle } from '@micromag/core/hooks';
7
6
  import { getStyleFromMargin, getStyleFromText, getStyleFromBox } from '@micromag/core/utils';
8
7
 
@@ -64,7 +63,7 @@ function TextInput(_ref) {
64
63
  placeholderStyle = _objectSpread(_objectSpread({}, placeholderStyle), getStyleFromText(placeholderTextStyle));
65
64
  }
66
65
  var containerProps = {
67
- className: classNames([styles.container, className, _defineProperty({}, styles.element, !labelOutside)]),
66
+ className: classNames([styles.container, className, _defineProperty({}, styles.element, !labelOutside), className]),
68
67
  style: containerStyle
69
68
  };
70
69
  var elementProps = _objectSpread(_objectSpread({
@@ -80,16 +79,17 @@ function TextInput(_ref) {
80
79
  disabled: disabled
81
80
  });
82
81
  var element = multiline ? /*#__PURE__*/React.createElement("textarea", Object.assign({}, elementProps, {
83
- tabIndex: focusable ? '0' : '-1'
82
+ tabIndex: focusable ? 0 : -1,
83
+ id: "input-".concat(id)
84
84
  })) : /*#__PURE__*/React.createElement("input", Object.assign({}, elementProps, {
85
85
  type: "text",
86
- tabIndex: focusable ? '0' : '-1'
86
+ tabIndex: focusable ? 0 : -1,
87
+ id: "input-".concat(id)
87
88
  }));
88
- var placeholderStyles = usePlaceholderStyle(styles.element, placeholderStyle);
89
- var placeholderStyleElement = /*#__PURE__*/React.createElement(Helmet, null, /*#__PURE__*/React.createElement("style", {
90
- href: "inputstyle-".concat(id),
91
- precedence: "medium"
92
- }, placeholderStyles));
89
+ var placeholderStyles = usePlaceholderStyle("#input-".concat(id), placeholderStyle);
90
+ var placeholderStyleElement = placeholderStyles !== null ? /*#__PURE__*/React.createElement("style", {
91
+ type: "text/css"
92
+ }, placeholderStyles) : null;
93
93
  return !labelOutside ? /*#__PURE__*/React.createElement(React.Fragment, null, element, placeholderStyleElement) : /*#__PURE__*/React.createElement("label", containerProps, /*#__PURE__*/React.createElement("div", {
94
94
  className: labelClassName,
95
95
  style: labelStyle
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/element-text-input",
3
- "version": "0.4.45",
3
+ "version": "0.4.48",
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.45",
63
+ "@micromag/core": "^0.4.48",
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": "21ad909808957602ac07befd6a45bdc0cbee6183",
71
+ "gitHead": "d6772865be1ee3f2d19288ebfbf4b9b6860f4cd7",
72
72
  "types": "es/index.d.ts"
73
73
  }