@spaced-out/ui-design-system 0.3.11 → 0.3.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.
@@ -33,6 +33,7 @@ drilldown
33
33
  Drilldown
34
34
  dropzone
35
35
  Dumont
36
+ EBITDA
36
37
  Efate
37
38
  Enderbury
38
39
  eqeqeq
@@ -43,6 +44,7 @@ flowtype
43
44
  fontawesome
44
45
  framename
45
46
  Gaurav
47
+ Heatmaps
46
48
  highcharts
47
49
  Hovd
48
50
  innerref
package/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.3.12](https://github.com/spaced-out/ui-design-system/compare/v0.3.11...v0.3.12) (2024-12-18)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * ai-components ([#307](https://github.com/spaced-out/ui-design-system/issues/307)) ([0ebf223](https://github.com/spaced-out/ui-design-system/commit/0ebf223719c8413a4c99e782be232f654cd2e637))
11
+ * promptinput bug fix on height ([4c8b116](https://github.com/spaced-out/ui-design-system/commit/4c8b116543348da082b327e04536466ff96d2835))
12
+ * some random prompting magic ([317d296](https://github.com/spaced-out/ui-design-system/commit/317d296cfebad106951153b5b34bf6a03c60a216))
13
+ * tidy up the states ([27e4678](https://github.com/spaced-out/ui-design-system/commit/27e4678061cf3563db22d865ddc9fd63d0932977))
14
+
5
15
  ### [0.3.11](https://github.com/spaced-out/ui-design-system/compare/v0.3.10...v0.3.11) (2024-12-18)
6
16
 
7
17
 
@@ -53,16 +53,21 @@ const PromptInput = /*#__PURE__*/React.forwardRef((_ref, ref) => {
53
53
  const handleInput = () => {
54
54
  const textarea = textareaRef.current;
55
55
  if (textarea) {
56
- textarea.style.height = 'auto';
56
+ textarea.style.height = 'auto'; // Reset height to auto to shrink
57
57
  if (textarea.scrollHeight > parseInt(_size.size200)) {
58
- textarea.style.height = _size.size200;
58
+ textarea.style.height = _size.size200; // Limit height to size200
59
59
  textarea.style.overflowY = 'auto';
60
60
  } else {
61
- textarea.style.height = `${textarea.scrollHeight}px`;
61
+ textarea.style.height = `${textarea.scrollHeight}px`; // Adjust to content height
62
62
  textarea.style.overflowY = 'hidden';
63
63
  }
64
64
  }
65
65
  };
66
+
67
+ // Reset height on value change
68
+ React.useEffect(() => {
69
+ handleInput();
70
+ }, [value]);
66
71
  const textCountError = React.useMemo(() => {
67
72
  const charCount = value ? value.length : 0;
68
73
  return textCountLimit != null && charCount > textCountLimit;
@@ -81,7 +86,6 @@ const PromptInput = /*#__PURE__*/React.forwardRef((_ref, ref) => {
81
86
  textarea: (0, _classify.default)(_PromptInputModule.default.textarea, classNames?.textarea)
82
87
  },
83
88
  ref: textareaRef,
84
- onInput: handleInput,
85
89
  value: value,
86
90
  onChange: onInputChange,
87
91
  onFocus: onInputFocus,
@@ -102,17 +102,22 @@ export const PromptInput: React$AbstractComponent<
102
102
  const handleInput = () => {
103
103
  const textarea = textareaRef.current;
104
104
  if (textarea) {
105
- textarea.style.height = 'auto';
105
+ textarea.style.height = 'auto'; // Reset height to auto to shrink
106
106
  if (textarea.scrollHeight > parseInt(size200)) {
107
- textarea.style.height = size200;
107
+ textarea.style.height = size200; // Limit height to size200
108
108
  textarea.style.overflowY = 'auto';
109
109
  } else {
110
- textarea.style.height = `${textarea.scrollHeight}px`;
110
+ textarea.style.height = `${textarea.scrollHeight}px`; // Adjust to content height
111
111
  textarea.style.overflowY = 'hidden';
112
112
  }
113
113
  }
114
114
  };
115
115
 
116
+ // Reset height on value change
117
+ React.useEffect(() => {
118
+ handleInput();
119
+ }, [value]);
120
+
116
121
  const textCountError = React.useMemo(() => {
117
122
  const charCount = value ? value.length : 0;
118
123
  return textCountLimit != null && charCount > textCountLimit;
@@ -135,7 +140,6 @@ export const PromptInput: React$AbstractComponent<
135
140
  textarea: classify(css.textarea, classNames?.textarea),
136
141
  }}
137
142
  ref={textareaRef}
138
- onInput={handleInput}
139
143
  value={value}
140
144
  onChange={onInputChange}
141
145
  onFocus={onInputFocus}
@@ -43,6 +43,7 @@
43
43
  .textarea {
44
44
  width: sizeFluid;
45
45
  max-height: size200;
46
+ min-height: 100%;
46
47
  }
47
48
 
48
49
  .secondaryRow {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spaced-out/ui-design-system",
3
- "version": "0.3.11",
3
+ "version": "0.3.12",
4
4
  "main": "index.js",
5
5
  "description": "Sense UI components library",
6
6
  "author": {