@pingux/astro 2.141.0 → 2.141.1-alpha.0

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.
@@ -63,10 +63,6 @@ var PromptInput = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
63
63
  _useProgressiveState2 = (0, _slicedToArray2["default"])(_useProgressiveState, 2),
64
64
  value = _useProgressiveState2[0],
65
65
  setValue = _useProgressiveState2[1];
66
- var countLineBreaks = function countLineBreaks(str) {
67
- var lineBreaks = str.match(/\r\n|\r|\n/g);
68
- return lineBreaks ? lineBreaks.length : 0;
69
- };
70
66
  var handleFileSelect = function handleFileSelect(_event, files) {
71
67
  var arrayWithNewFiles = (0, _from["default"])(files);
72
68
  var filesWithIdAndLink = (0, _map["default"])(arrayWithNewFiles).call(arrayWithNewFiles, function (newFile) {
@@ -124,9 +120,8 @@ var PromptInput = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
124
120
  var inputRef = (0, _hooks.useLocalOrForwardRef)(ref);
125
121
  (0, _react.useEffect)(function () {
126
122
  if (inputRef.current && value) {
127
- var lb = countLineBreaks(value);
128
123
  inputRef.current.style.height = 'auto';
129
- inputRef.current.style.height = "calc(".concat((lb + 1) * 24, "px)");
124
+ inputRef.current.style.height = "".concat(inputRef.current.scrollHeight, "px");
130
125
  } else if (value === '') {
131
126
  inputRef.current.style.height = 'auto';
132
127
  inputRef.current.style.height = '26px';
@@ -186,7 +181,8 @@ var PromptInput = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
186
181
  }, fileInputButtonProps))), (0, _react2.jsx)(_index.TextArea, (0, _extends2["default"])({
187
182
  ref: inputRef,
188
183
  variant: "forms.input.promptInput",
189
- "data-testid": "prompt-input"
184
+ "data-testid": "prompt-input",
185
+ rows: 1
190
186
  }, fieldControlInputProps, {
191
187
  onKeyUp: onKeyUp,
192
188
  onKeyDown: onKeyDown
@@ -42,4 +42,7 @@ input.fieldControlWrapper = _objectSpread({}, fieldControlWrapper);
42
42
  input.multivaluesWrapper = {
43
43
  backgroundColor: 'background.base'
44
44
  };
45
+ input.promptInput = {
46
+ color: 'gray-100'
47
+ };
45
48
  input.search = _objectSpread({}, input);
@@ -51,10 +51,6 @@ var PromptInput = /*#__PURE__*/forwardRef(function (props, ref) {
51
51
  _useProgressiveState2 = _slicedToArray(_useProgressiveState, 2),
52
52
  value = _useProgressiveState2[0],
53
53
  setValue = _useProgressiveState2[1];
54
- var countLineBreaks = function countLineBreaks(str) {
55
- var lineBreaks = str.match(/\r\n|\r|\n/g);
56
- return lineBreaks ? lineBreaks.length : 0;
57
- };
58
54
  var handleFileSelect = function handleFileSelect(_event, files) {
59
55
  var arrayWithNewFiles = _Array$from(files);
60
56
  var filesWithIdAndLink = _mapInstanceProperty(arrayWithNewFiles).call(arrayWithNewFiles, function (newFile) {
@@ -112,9 +108,8 @@ var PromptInput = /*#__PURE__*/forwardRef(function (props, ref) {
112
108
  var inputRef = useLocalOrForwardRef(ref);
113
109
  useEffect(function () {
114
110
  if (inputRef.current && value) {
115
- var lb = countLineBreaks(value);
116
111
  inputRef.current.style.height = 'auto';
117
- inputRef.current.style.height = "calc(".concat((lb + 1) * 24, "px)");
112
+ inputRef.current.style.height = "".concat(inputRef.current.scrollHeight, "px");
118
113
  } else if (value === '') {
119
114
  inputRef.current.style.height = 'auto';
120
115
  inputRef.current.style.height = '26px';
@@ -174,7 +169,8 @@ var PromptInput = /*#__PURE__*/forwardRef(function (props, ref) {
174
169
  }, fileInputButtonProps))), ___EmotionJSX(TextArea, _extends({
175
170
  ref: inputRef,
176
171
  variant: "forms.input.promptInput",
177
- "data-testid": "prompt-input"
172
+ "data-testid": "prompt-input",
173
+ rows: 1
178
174
  }, fieldControlInputProps, {
179
175
  onKeyUp: onKeyUp,
180
176
  onKeyDown: onKeyDown
@@ -33,4 +33,7 @@ input.fieldControlWrapper = _objectSpread({}, fieldControlWrapper);
33
33
  input.multivaluesWrapper = {
34
34
  backgroundColor: 'background.base'
35
35
  };
36
+ input.promptInput = {
37
+ color: 'gray-100'
38
+ };
36
39
  input.search = _objectSpread({}, input);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "2.141.0",
3
+ "version": "2.141.1-alpha.0",
4
4
  "description": "React component library for Ping Identity's design system",
5
5
  "repository": {
6
6
  "type": "git",