@spaced-out/ui-design-system 0.3.10 → 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.
- package/.cspell/custom-words.txt +2 -0
- package/CHANGELOG.md +18 -0
- package/lib/components/PromptInput/PromptInput.js +8 -4
- package/lib/components/PromptInput/PromptInput.js.flow +8 -4
- package/lib/components/PromptInput/PromptInput.module.css +1 -0
- package/lib/components/Separator/Separator.js +2 -2
- package/lib/components/Separator/Separator.js.flow +2 -4
- package/package.json +1 -1
package/.cspell/custom-words.txt
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,24 @@
|
|
|
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
|
+
|
|
15
|
+
### [0.3.11](https://github.com/spaced-out/ui-design-system/compare/v0.3.10...v0.3.11) (2024-12-18)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* ai prompt style fixes ([1af84dd](https://github.com/spaced-out/ui-design-system/commit/1af84dd1cd14cf105a9688ab76e1aa641793295c))
|
|
21
|
+
* bug fixes in separator ([#306](https://github.com/spaced-out/ui-design-system/issues/306)) ([115b1da](https://github.com/spaced-out/ui-design-system/commit/115b1dad44e0e2b349a1e8f044e68aec20ef31b7))
|
|
22
|
+
|
|
5
23
|
### [0.3.10](https://github.com/spaced-out/ui-design-system/compare/v0.3.9...v0.3.10) (2024-12-17)
|
|
6
24
|
|
|
7
25
|
|
|
@@ -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}
|
|
@@ -28,8 +28,8 @@ const Separator = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
28
28
|
const resolvedWidth = width || (orientation === ORIENTATION.vertical ? _size.size2 : 'auto');
|
|
29
29
|
const resolvedHeight = height || (orientation === ORIENTATION.horizontal ? _size.size2 : 'auto');
|
|
30
30
|
const style = {
|
|
31
|
-
'--separator-width':
|
|
32
|
-
'--separator-height':
|
|
31
|
+
'--separator-width': resolvedWidth,
|
|
32
|
+
'--separator-height': resolvedHeight
|
|
33
33
|
};
|
|
34
34
|
return /*#__PURE__*/React.createElement("div", {
|
|
35
35
|
ref: ref,
|
|
@@ -44,10 +44,8 @@ export const Separator: React$AbstractComponent<
|
|
|
44
44
|
height || (orientation === ORIENTATION.horizontal ? size2 : 'auto');
|
|
45
45
|
|
|
46
46
|
const style = {
|
|
47
|
-
'--separator-width':
|
|
48
|
-
|
|
49
|
-
'--separator-height':
|
|
50
|
-
orientation === ORIENTATION.horizontal ? resolvedHeight : 'auto',
|
|
47
|
+
'--separator-width': resolvedWidth,
|
|
48
|
+
'--separator-height': resolvedHeight,
|
|
51
49
|
};
|
|
52
50
|
|
|
53
51
|
return (
|