@micromag/element-text-input 0.4.49 → 0.4.50

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 +17 -10
  2. 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 React, { useId } from 'react';
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__*/React.createElement("textarea", Object.assign({}, elementProps, {
82
+ var element = multiline ? /*#__PURE__*/jsx("textarea", _objectSpread(_objectSpread({}, elementProps), {}, {
82
83
  tabIndex: focusable ? 0 : -1,
83
84
  id: "input-".concat(id)
84
- })) : /*#__PURE__*/React.createElement("input", Object.assign({}, elementProps, {
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__*/React.createElement("style", {
91
- type: "text/css"
92
- }, placeholderStyles) : null;
93
- return !labelOutside ? /*#__PURE__*/React.createElement(React.Fragment, null, element, placeholderStyleElement) : /*#__PURE__*/React.createElement("label", containerProps, /*#__PURE__*/React.createElement("div", {
94
- className: labelClassName,
95
- style: labelStyle
96
- }, label), element, placeholderStyleElement);
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.49",
3
+ "version": "0.4.50",
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.49",
63
+ "@micromag/core": "^0.4.50",
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": "0a225ff29387217cccb0fcc5a731e23c74bd202e",
71
+ "gitHead": "940d5ca98f8f448b79eaa3e2fa685c3ee95185b8",
72
72
  "types": "es/index.d.ts"
73
73
  }