@darajs/ui-components 1.12.6 → 1.13.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.
- package/dist/chat/chat.js +1 -1
- package/dist/input/input.d.ts +1 -15
- package/dist/input/input.d.ts.map +1 -1
- package/dist/input/input.js +11 -22
- package/dist/input/input.js.map +1 -1
- package/dist/markdown/markdown.d.ts.map +1 -1
- package/dist/markdown/markdown.js +64 -13
- package/dist/markdown/markdown.js.map +1 -1
- package/dist/numeric-input/numeric-input.d.ts +1 -9
- package/dist/numeric-input/numeric-input.d.ts.map +1 -1
- package/dist/numeric-input/numeric-input.js +35 -25
- package/dist/numeric-input/numeric-input.js.map +1 -1
- package/dist/textarea/textarea.d.ts +1 -1
- package/dist/textarea/textarea.d.ts.map +1 -1
- package/dist/textarea/textarea.js +26 -13
- package/dist/textarea/textarea.js.map +1 -1
- package/package.json +8 -8
package/dist/chat/chat.js
CHANGED
|
@@ -176,7 +176,7 @@ function Chat(props) {
|
|
|
176
176
|
React.useLayoutEffect(() => {
|
|
177
177
|
scrollToBottom(chatBodyRef === null || chatBodyRef === void 0 ? void 0 : chatBodyRef.current);
|
|
178
178
|
}, []);
|
|
179
|
-
return (_jsxs(ChatWrapper, { className: props.className, style: props.style, "$isPopup": props.isPopup, children: [_jsxs(ChatTop, { children: [_jsx("span", { children: (_b = props.chatTitle) !== null && _b !== void 0 ? _b : 'Chat' }), props.isPopup && _jsx(CloseIcon, { onClick: props.onClose, "aria-label": "Close chat" })] }), _jsxs(ChatBody, { ref: chatBodyRef, role: "log", children: [localMessages.map((message) => (_jsx(MessageComponent, { onChange: onEditMessage, onDelete: onDeleteMessage, value: message, didUserWriteMessage: didUserWriteMessage(message, props.activeUser), isEditable: !props.isHistoryReadonly }, message.id))), props.loadingComponent] }), _jsxs(ReplyWrapper, { children: [_jsx(TextArea, { onChange: onChangeReply, onComplete: onSubmitMessage, placeholder: (_c = props.placeholder) !== null && _c !== void 0 ? _c : 'Add a comment', resize: "none", maxHeight: 6, value: reply, style: { width: '100%' } }), _jsx(ReplyButtons, { children: _jsx(Button, { "aria-label": "Send", style: { height: '3.
|
|
179
|
+
return (_jsxs(ChatWrapper, { className: props.className, style: props.style, "$isPopup": props.isPopup, children: [_jsxs(ChatTop, { children: [_jsx("span", { children: (_b = props.chatTitle) !== null && _b !== void 0 ? _b : 'Chat' }), props.isPopup && _jsx(CloseIcon, { onClick: props.onClose, "aria-label": "Close chat" })] }), _jsxs(ChatBody, { ref: chatBodyRef, role: "log", children: [localMessages.map((message) => (_jsx(MessageComponent, { onChange: onEditMessage, onDelete: onDeleteMessage, value: message, didUserWriteMessage: didUserWriteMessage(message, props.activeUser), isEditable: !props.isHistoryReadonly }, message.id))), props.loadingComponent] }), _jsxs(ReplyWrapper, { children: [_jsx(TextArea, { onChange: onChangeReply, onComplete: onSubmitMessage, placeholder: (_c = props.placeholder) !== null && _c !== void 0 ? _c : 'Add a comment', resize: "none", maxHeight: 6, value: reply, style: { width: '100%' } }), _jsx(ReplyButtons, { children: _jsx(Button, { "aria-label": "Send", style: { height: '3.4rem' }, disabled: !!props.loadingComponent || !(reply.trim().length > 0), onClick: onSubmitMessage, children: _jsx(PaperPlane, { onClick: onSubmitMessage }) }) })] })] }));
|
|
180
180
|
}
|
|
181
181
|
export default Chat;
|
|
182
182
|
//# sourceMappingURL=chat.js.map
|
package/dist/input/input.d.ts
CHANGED
|
@@ -17,32 +17,18 @@
|
|
|
17
17
|
import * as React from 'react';
|
|
18
18
|
import { InteractiveComponentProps } from '../types';
|
|
19
19
|
export declare const ErrorMessage: import("styled-components").StyledComponent<"span", import("@darajs/styled-components").DefaultTheme, {}, never>;
|
|
20
|
-
export interface InputProps extends InteractiveComponentProps<string> {
|
|
21
|
-
/** An optional prop to focus the input upon mounting it */
|
|
22
|
-
autoFocus?: boolean;
|
|
20
|
+
export interface InputProps extends InteractiveComponentProps<string>, Omit<React.InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange'> {
|
|
23
21
|
/** An optional keydown event filter, that can filter out invalid chars from an input. Should return true to let
|
|
24
22
|
* the char through */
|
|
25
23
|
keydownFilter?: (e: React.KeyboardEvent<HTMLInputElement>) => boolean;
|
|
26
|
-
/** An optional maximum length */
|
|
27
|
-
maxLength?: number;
|
|
28
24
|
/** An optional value to put in the input to check for maximum value */
|
|
29
25
|
maxValue?: any;
|
|
30
26
|
/** An optional value to put in the input to check for minimum value */
|
|
31
27
|
minValue?: any;
|
|
32
|
-
/** An optional onBlur handler for listening to input blur events */
|
|
33
|
-
onBlur?: (e: React.SyntheticEvent<HTMLInputElement>) => void | Promise<void>;
|
|
34
28
|
/** An optional onChange handler for listening to changes in the input */
|
|
35
29
|
onChange?: (value: string, e?: React.SyntheticEvent<HTMLInputElement>) => void | Promise<void>;
|
|
36
|
-
/** An optional onClick handler for listening to input click events */
|
|
37
|
-
onClick?: (e: React.SyntheticEvent<HTMLInputElement>) => void | Promise<void>;
|
|
38
30
|
/** An optional event listener for complete events (enter presses) */
|
|
39
31
|
onComplete?: () => void | Promise<void>;
|
|
40
|
-
/** An optional handler for listening to key down events */
|
|
41
|
-
onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void | Promise<void>;
|
|
42
|
-
/** An optional placeholder that will be used when the input is empty, defaults to '' */
|
|
43
|
-
placeholder?: string;
|
|
44
|
-
/** Input type attribute */
|
|
45
|
-
type?: string;
|
|
46
32
|
}
|
|
47
33
|
/**
|
|
48
34
|
* A simple text input component, accepts an onChange handler to listen for changes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/input/input.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AA8CrD,eAAO,MAAM,YAAY,kHAIxB,CAAC;AAEF,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/input/input.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AA8CrD,eAAO,MAAM,YAAY,kHAIxB,CAAC;AAEF,MAAM,WAAW,UACb,SAAQ,yBAAyB,CAAC,MAAM,CAAC,EAErC,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IAC3E;0BACsB;IACtB,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,KAAK,OAAO,CAAC;IACtE,uEAAuE;IACvE,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,uEAAuE;IACvE,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,yEAAyE;IACzE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/F,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3C;AAED;;;;;;;;GAQG;AACH,QAAA,MAAM,KAAK,qFAuDV,CAAC;AAGF,eAAe,KAAK,CAAC"}
|
package/dist/input/input.js
CHANGED
|
@@ -66,36 +66,25 @@ export const ErrorMessage = styled.span `
|
|
|
66
66
|
* @param ref - forward ref that's attached to underlying input element
|
|
67
67
|
*/
|
|
68
68
|
const Input = forwardRef((_a, ref) => {
|
|
69
|
-
var { type = 'text' } = _a,
|
|
70
|
-
const
|
|
69
|
+
var { type = 'text', onChange, onKeyDown, keydownFilter, onComplete, maxValue, minValue, errorMsg, className, style, initialValue } = _a, rest = __rest(_a, ["type", "onChange", "onKeyDown", "keydownFilter", "onComplete", "maxValue", "minValue", "errorMsg", "className", "style", "initialValue"]);
|
|
70
|
+
const handleChange = (e) => {
|
|
71
71
|
const target = e.target;
|
|
72
|
-
if (
|
|
73
|
-
|
|
72
|
+
if (onChange) {
|
|
73
|
+
onChange(target.value, e);
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
|
-
const
|
|
77
|
-
if (
|
|
78
|
-
|
|
76
|
+
const handleKeyDown = (e) => {
|
|
77
|
+
if (onKeyDown) {
|
|
78
|
+
onKeyDown(e);
|
|
79
79
|
}
|
|
80
|
-
if (
|
|
80
|
+
if (keydownFilter && !keydownFilter(e)) {
|
|
81
81
|
e.preventDefault();
|
|
82
82
|
}
|
|
83
|
-
if (e.key === Key.ENTER &&
|
|
84
|
-
|
|
83
|
+
if (e.key === Key.ENTER && onComplete) {
|
|
84
|
+
onComplete();
|
|
85
85
|
}
|
|
86
86
|
};
|
|
87
|
-
|
|
88
|
-
const addOptionalItems = () => {
|
|
89
|
-
const result = {};
|
|
90
|
-
if (props.minValue) {
|
|
91
|
-
result.minValue = props.minValue;
|
|
92
|
-
}
|
|
93
|
-
if (props.maxValue) {
|
|
94
|
-
result.maxValue = props.minValue;
|
|
95
|
-
}
|
|
96
|
-
return result;
|
|
97
|
-
};
|
|
98
|
-
return (_jsxs(InputWrapper, { className: props.className, style: props.style, children: [_jsx(PrimaryInput, Object.assign({ autoFocus: props.autoFocus, defaultValue: props.initialValue, disabled: props.disabled, isErrored: !!props.errorMsg, maxLength: props.maxLength, onBlur: props.onBlur, onChange: onChange, onClick: props.onClick, onKeyDown: onKeyDown, placeholder: props.placeholder, ref: ref, type: type, value: props.value }, addOptionalItems())), props.errorMsg && _jsxs(ErrorMessage, { children: [props.errorMsg, " "] })] }));
|
|
87
|
+
return (_jsxs(InputWrapper, { className: className, style: style, children: [_jsx(PrimaryInput, Object.assign({}, rest, { defaultValue: initialValue, isErrored: !!errorMsg, onChange: handleChange, onKeyDown: handleKeyDown, ref: ref, type: type, min: minValue, max: maxValue })), errorMsg && _jsx(ErrorMessage, { children: errorMsg })] }));
|
|
99
88
|
});
|
|
100
89
|
Input.displayName = 'Input';
|
|
101
90
|
export default Input;
|
package/dist/input/input.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../src/input/input.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAiBA,OAAO,EAAgB,UAAU,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAE/C,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAOnC,MAAM,YAAY,GAAG,MAAM,CAAC,KAAK,CAAmB;;;;;;;;;aASvC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC;;wBAErE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK;wBACnC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;;;;;;4BAM9E,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;;;;4BAIlF,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK;;;;;;;;;;CAU9D,CAAC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YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,CAAC,CAAC,QAAQ,EACrB,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAE,aAAa,EACxB,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,QAAQ,EACb,GAAG,EAAE,QAAQ,IACf,EACD,QAAQ,IAAI,KAAC,YAAY,cAAE,QAAQ,GAAgB,IACzC,CAClB,CAAC;AACN,CAAC,CACJ,CAAC;AACF,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC;AAE5B,eAAe,KAAK,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/markdown/markdown.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAsB,EAAc,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAOpE,UAAU,aAAc,SAAQ,OAAO;IACnC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mFAAmF;IACnF,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC/B;
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/markdown/markdown.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAsB,EAAc,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAOpE,UAAU,aAAc,SAAQ,OAAO;IACnC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mFAAmF;IACnF,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC/B;AA0VD;;GAEG;AACH,iBAAS,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,GAAG,CAAC,OAAO,CAkBnD;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -57,8 +57,7 @@ const CustomMarkdownWrapper = styled.div `
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
blockquote {
|
|
60
|
-
|
|
61
|
-
quotes: '"\\201C""\\201D""\\2018""\\2019"';
|
|
60
|
+
quotes: '\\201C' '\\201D' '\\2018' '\\2019';
|
|
62
61
|
|
|
63
62
|
margin-top: 1.5rem;
|
|
64
63
|
margin-bottom: 1.5rem;
|
|
@@ -69,6 +68,14 @@ const CustomMarkdownWrapper = styled.div `
|
|
|
69
68
|
color: ${(props) => props.theme.colors.grey6};
|
|
70
69
|
|
|
71
70
|
border-left: 0.25rem solid ${(props) => props.theme.colors.grey3};
|
|
71
|
+
|
|
72
|
+
p:first-of-type::before {
|
|
73
|
+
content: open-quote;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
p:last-of-type::after {
|
|
77
|
+
content: close-quote;
|
|
78
|
+
}
|
|
72
79
|
}
|
|
73
80
|
|
|
74
81
|
h1 {
|
|
@@ -81,7 +88,7 @@ const CustomMarkdownWrapper = styled.div `
|
|
|
81
88
|
}
|
|
82
89
|
|
|
83
90
|
h2 {
|
|
84
|
-
margin-top:
|
|
91
|
+
margin-top: 2rem;
|
|
85
92
|
margin-bottom: 1rem;
|
|
86
93
|
|
|
87
94
|
font-size: 2rem;
|
|
@@ -116,6 +123,13 @@ const CustomMarkdownWrapper = styled.div `
|
|
|
116
123
|
}
|
|
117
124
|
}
|
|
118
125
|
|
|
126
|
+
figcaption {
|
|
127
|
+
margin-top: 0.875rem;
|
|
128
|
+
font-size: 0.875rem;
|
|
129
|
+
line-height: 1.5rem;
|
|
130
|
+
color: ${(props) => props.theme.colors.grey5};
|
|
131
|
+
}
|
|
132
|
+
|
|
119
133
|
h2 code {
|
|
120
134
|
font-size: 0.875rem;
|
|
121
135
|
}
|
|
@@ -183,10 +197,6 @@ const CustomMarkdownWrapper = styled.div `
|
|
|
183
197
|
border-radius: 0.25rem;
|
|
184
198
|
}
|
|
185
199
|
|
|
186
|
-
strong {
|
|
187
|
-
font-style: italic;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
200
|
p {
|
|
191
201
|
margin-top: 0.75rem;
|
|
192
202
|
margin-bottom: 0.75rem;
|
|
@@ -202,20 +212,42 @@ const CustomMarkdownWrapper = styled.div `
|
|
|
202
212
|
}
|
|
203
213
|
}
|
|
204
214
|
|
|
215
|
+
ol > li::marker {
|
|
216
|
+
font-weight: 400;
|
|
217
|
+
color: ${(props) => props.theme.colors.text};
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
ul > li::marker {
|
|
221
|
+
color: ${(props) => props.theme.colors.grey4};
|
|
222
|
+
}
|
|
223
|
+
|
|
205
224
|
hr {
|
|
206
225
|
margin-top: 3rem;
|
|
207
226
|
margin-bottom: 3rem;
|
|
208
227
|
}
|
|
209
228
|
|
|
210
229
|
table {
|
|
230
|
+
table-layout: auto;
|
|
231
|
+
border-collapse: collapse;
|
|
232
|
+
|
|
233
|
+
width: 100%;
|
|
234
|
+
margin-top: 2rem;
|
|
235
|
+
margin-bottom: 2rem;
|
|
236
|
+
|
|
211
237
|
font-size: 0.875rem;
|
|
212
238
|
line-height: 1.7;
|
|
213
239
|
|
|
214
240
|
thead {
|
|
241
|
+
border-bottom: 1px solid ${(props) => props.theme.colors.grey3};
|
|
242
|
+
|
|
215
243
|
th {
|
|
216
244
|
padding-right: 0.5rem;
|
|
217
245
|
padding-bottom: 0.5rem;
|
|
218
246
|
padding-left: 0.5rem;
|
|
247
|
+
|
|
248
|
+
font-weight: 600;
|
|
249
|
+
text-align: start;
|
|
250
|
+
vertical-align: bottom;
|
|
219
251
|
}
|
|
220
252
|
|
|
221
253
|
th:first-child {
|
|
@@ -227,17 +259,36 @@ const CustomMarkdownWrapper = styled.div `
|
|
|
227
259
|
}
|
|
228
260
|
}
|
|
229
261
|
|
|
230
|
-
|
|
262
|
+
tfoot {
|
|
263
|
+
border-top: 1px solid ${(props) => props.theme.colors.grey2};
|
|
264
|
+
|
|
231
265
|
td {
|
|
232
|
-
|
|
266
|
+
text-align: start;
|
|
267
|
+
vertical-align: top;
|
|
233
268
|
}
|
|
269
|
+
}
|
|
234
270
|
|
|
235
|
-
|
|
236
|
-
|
|
271
|
+
tbody {
|
|
272
|
+
tr {
|
|
273
|
+
border-bottom: 1px solid ${(props) => props.theme.colors.grey2};
|
|
274
|
+
|
|
275
|
+
&:last-child {
|
|
276
|
+
border-bottom: 0;
|
|
277
|
+
}
|
|
237
278
|
}
|
|
238
279
|
|
|
239
|
-
td
|
|
240
|
-
padding
|
|
280
|
+
td {
|
|
281
|
+
padding: 0.5rem;
|
|
282
|
+
text-align: start;
|
|
283
|
+
vertical-align: baseline;
|
|
284
|
+
|
|
285
|
+
&:first-child {
|
|
286
|
+
padding-left: 0;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
&:last-child {
|
|
290
|
+
padding-right: 0;
|
|
291
|
+
}
|
|
241
292
|
}
|
|
242
293
|
}
|
|
243
294
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.js","sourceRoot":"","sources":["../../src/markdown/markdown.tsx"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,aAAsC,MAAM,gBAAgB,CAAC;AACpE,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAE7D,OAAO,UAAU,EAAE,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAa7E,MAAM,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;gCAgBR,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK;gCACnC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK;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AAQ,CAAC"}
|
|
@@ -16,25 +16,17 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import * as React from 'react';
|
|
18
18
|
import { InteractiveComponentProps } from '../types';
|
|
19
|
-
export interface NumericInputProps extends InteractiveComponentProps<number> {
|
|
20
|
-
/** An optional prop to focus the input upon mounting it */
|
|
21
|
-
autoFocus?: boolean;
|
|
19
|
+
export interface NumericInputProps extends InteractiveComponentProps<number>, Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'value' | 'initialValue'> {
|
|
22
20
|
/** An optional parameter to restrict the field to just integers */
|
|
23
21
|
integerOnly?: boolean;
|
|
24
22
|
/** An optional property to set the maximum accepted value */
|
|
25
23
|
maxValue?: number;
|
|
26
24
|
/** An optional property to set the minimum accepted value */
|
|
27
25
|
minValue?: number;
|
|
28
|
-
/** An optional onBlur handler for listening to input blur events */
|
|
29
|
-
onBlur?: (e: React.SyntheticEvent<HTMLInputElement>) => void | Promise<void>;
|
|
30
26
|
/** An optional onChange handler for listening to changes in the input */
|
|
31
27
|
onChange?: (value: number, e?: React.SyntheticEvent<HTMLInputElement>) => void | Promise<void>;
|
|
32
28
|
/** An optional event listener for complete events (enter presses) */
|
|
33
29
|
onComplete?: () => void | Promise<void>;
|
|
34
|
-
/** An optional event listener for keydown events */
|
|
35
|
-
onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void | Promise<void>;
|
|
36
|
-
/** An optional placeholder that will be used when the input is empty, defaults to '' */
|
|
37
|
-
placeholder?: string;
|
|
38
30
|
/** An optional property to set how many steps the stepper should take */
|
|
39
31
|
stepSkip?: number;
|
|
40
32
|
/** An optional property to show input stepper control */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"numeric-input.d.ts","sourceRoot":"","sources":["../../src/numeric-input/numeric-input.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAwHrD,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"numeric-input.d.ts","sourceRoot":"","sources":["../../src/numeric-input/numeric-input.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAwHrD,MAAM,WAAW,iBACb,SAAQ,yBAAyB,CAAC,MAAM,CAAC,EAErC,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,UAAU,GAAG,OAAO,GAAG,cAAc,CAAC;IAC5F,mEAAmE;IACnE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yEAAyE;IACzE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/F,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,yEAAyE;IACzE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yDAAyD;IACzD,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;GAIG;AACH,QAAA,MAAM,YAAY,4FAkHjB,CAAC;AAGF,eAAe,YAAY,CAAC"}
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
1
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
13
|
/**
|
|
3
14
|
* Copyright 2023 Impulse Innovations Limited
|
|
@@ -134,28 +145,28 @@ const getInitialValue = (value, initialValue) => {
|
|
|
134
145
|
*
|
|
135
146
|
* @param props the component props
|
|
136
147
|
*/
|
|
137
|
-
const NumericInput = React.forwardRef((
|
|
148
|
+
const NumericInput = React.forwardRef((_a, ref) => {
|
|
149
|
+
var { value, onChange, initialValue } = _a, props = __rest(_a, ["value", "onChange", "initialValue"]);
|
|
138
150
|
const keydownFilter = useMemo(() => numericFilter(props.integerOnly), [props.integerOnly]);
|
|
139
|
-
const [input, setInput] = useState(getInitialValue(
|
|
140
|
-
const step = (
|
|
141
|
-
var _a;
|
|
151
|
+
const [input, setInput] = useState(getInitialValue(value, initialValue));
|
|
152
|
+
const step = (v) => {
|
|
142
153
|
if (!input || input === '-') {
|
|
143
154
|
return;
|
|
144
155
|
}
|
|
145
156
|
const isFloat = input.includes('.');
|
|
146
157
|
const parsedValue = isFloat ? parseFloat(input) : parseInt(input);
|
|
147
|
-
let nextValueNumber = parsedValue +
|
|
158
|
+
let nextValueNumber = parsedValue + v;
|
|
148
159
|
let nextValueStr = String(nextValueNumber);
|
|
149
160
|
if (isFloat) {
|
|
150
161
|
const decimals = input.split('.')[1];
|
|
151
162
|
if (decimals) {
|
|
152
|
-
nextValueStr = (parsedValue +
|
|
163
|
+
nextValueStr = (parsedValue + v / Math.pow(10, decimals.length)).toFixed(decimals.length);
|
|
153
164
|
nextValueNumber = parseFloat(nextValueStr);
|
|
154
165
|
}
|
|
155
166
|
}
|
|
156
167
|
// controlled
|
|
157
|
-
if (
|
|
158
|
-
|
|
168
|
+
if (value !== undefined) {
|
|
169
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(nextValueNumber, {
|
|
159
170
|
target: {
|
|
160
171
|
value: nextValueStr,
|
|
161
172
|
},
|
|
@@ -181,39 +192,38 @@ const NumericInput = React.forwardRef((props, ref) => {
|
|
|
181
192
|
step(stepSkip * -1);
|
|
182
193
|
}
|
|
183
194
|
};
|
|
184
|
-
const
|
|
185
|
-
|
|
186
|
-
const parsed = props.integerOnly ? parseInt(value) : parseFloat(value);
|
|
195
|
+
const handleOnChange = useCallback((v, e) => {
|
|
196
|
+
const parsed = props.integerOnly ? parseInt(v) : parseFloat(v);
|
|
187
197
|
// uncontrolled component
|
|
188
|
-
if (
|
|
189
|
-
setInput(
|
|
190
|
-
|
|
198
|
+
if (value === undefined) {
|
|
199
|
+
setInput(v);
|
|
200
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(parsed, e);
|
|
191
201
|
return;
|
|
192
202
|
}
|
|
193
203
|
// if the value ends with a period, don't call onChange as it's not yet a valid number
|
|
194
|
-
if (
|
|
195
|
-
setInput(
|
|
204
|
+
if (v.endsWith('.')) {
|
|
205
|
+
setInput(v);
|
|
196
206
|
return;
|
|
197
207
|
}
|
|
198
208
|
// if the value is decimal and ends in a zero the user has also not changed the number/finished typing
|
|
199
|
-
if (
|
|
200
|
-
setInput(
|
|
209
|
+
if (v.includes('.') && v.endsWith('0')) {
|
|
210
|
+
setInput(v);
|
|
201
211
|
return;
|
|
202
212
|
}
|
|
203
213
|
// if the user is typing a negative number, don't call onChange until they have added the number
|
|
204
|
-
if (
|
|
205
|
-
setInput(
|
|
214
|
+
if (v === '-') {
|
|
215
|
+
setInput(v);
|
|
206
216
|
return;
|
|
207
217
|
}
|
|
208
|
-
|
|
218
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(parsed, e);
|
|
209
219
|
},
|
|
210
220
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
211
|
-
[props.integerOnly,
|
|
221
|
+
[props.integerOnly, value, onChange]);
|
|
212
222
|
useEffect(() => {
|
|
213
|
-
setInput(getInitialValue(
|
|
223
|
+
setInput(getInitialValue(value, initialValue));
|
|
214
224
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
215
|
-
}, [
|
|
216
|
-
return (_jsxs("div", { children: [_jsxs(InputWrapper, { disabled: props.disabled, errorMsg: props.errorMsg, stepper: props.stepper, style: props.style, children: [_jsx(Input, {
|
|
225
|
+
}, [value]);
|
|
226
|
+
return (_jsxs("div", { children: [_jsxs(InputWrapper, { disabled: props.disabled, errorMsg: props.errorMsg, stepper: props.stepper, style: props.style, children: [_jsx(Input, Object.assign({}, props, { keydownFilter: keydownFilter, onChange: handleOnChange, onKeyDown: onKeyDown, ref: ref, value: input })), props.stepper && _jsx(InputStepper, { disabled: props.disabled, step: step, stepSkip: props.stepSkip })] }), props.errorMsg && _jsx(ErrorMessage, { children: props.errorMsg })] }));
|
|
217
227
|
});
|
|
218
228
|
Input.displayName = 'NumericInput';
|
|
219
229
|
export default NumericInput;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"numeric-input.js","sourceRoot":"","sources":["../../src/numeric-input/numeric-input.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"numeric-input.js","sourceRoot":"","sources":["../../src/numeric-input/numeric-input.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAiB,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjF,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAE/C,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;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CAAC,QAAQ,EACxB,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,KAAK,EAAE,KAAK,CAAC,KAAK,aAElB,KAAC,KAAK,oBACE,KAAK,IACT,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,cAAc,EACxB,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,IACd,EACD,KAAK,CAAC,OAAO,IAAI,KAAC,YAAY,IAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,GAAI,IACvF,EACd,KAAK,CAAC,QAAQ,IAAI,KAAC,YAAY,cAAE,KAAK,CAAC,QAAQ,GAAgB,IAC9D,CACT,CAAC;AACN,CAAC,CACJ,CAAC;AACF,KAAK,CAAC,WAAW,GAAG,cAAc,CAAC;AAEnC,eAAe,YAAY,CAAC"}
|
|
@@ -34,7 +34,7 @@ export interface TextAreaProps extends InteractiveComponentProps<string> {
|
|
|
34
34
|
placeholder?: string;
|
|
35
35
|
/** An optional property which sets whether the textarea is resizable, and if so, in which directions */
|
|
36
36
|
resize?: 'none' | 'both' | 'horizontal' | 'vertical' | 'block' | 'inline';
|
|
37
|
-
/** The maximum height the textarea will grow to, if not set it will not grow as more text is entered */
|
|
37
|
+
/** The maximum height the textarea will grow to, if not set it will not grow as more text is entered, this expected as an rem value */
|
|
38
38
|
maxHeight?: number;
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../src/textarea/textarea.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAuDrD,MAAM,WAAW,aAAc,SAAQ,yBAAyB,CAAC,MAAM,CAAC;IACpE,8DA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37
|
-
min-height: 3.
|
|
37
|
+
min-height: 3.4rem;
|
|
38
38
|
padding: 1rem;
|
|
39
39
|
|
|
40
40
|
font-size: 1rem;
|
|
@@ -45,14 +45,14 @@ const PrimaryTextArea = styled.textarea `
|
|
|
45
45
|
border-radius: 0.25rem;
|
|
46
46
|
outline: 0;
|
|
47
47
|
|
|
48
|
-
:focus:not(:disabled) {
|
|
49
|
-
border: 1px solid ${(props) => (props.isErrored ? props.theme.colors.error : props.theme.colors.grey3)};
|
|
50
|
-
}
|
|
51
|
-
|
|
52
48
|
:hover:not(:disabled) {
|
|
53
49
|
border: 1px solid ${(props) => (props.isErrored ? props.theme.colors.error : props.theme.colors.grey2)};
|
|
54
50
|
}
|
|
55
51
|
|
|
52
|
+
:focus:not(:disabled) {
|
|
53
|
+
border: 1px solid ${(props) => (props.isErrored ? props.theme.colors.error : props.theme.colors.grey3)};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
56
|
:active:not(:disabled) {
|
|
57
57
|
border: 1px solid ${(props) => (props.isErrored ? props.theme.colors.error : props.theme.colors.grey3)};
|
|
58
58
|
}
|
|
@@ -72,16 +72,29 @@ const PrimaryTextArea = styled.textarea `
|
|
|
72
72
|
*/
|
|
73
73
|
function TextArea({ autoFocus, className, disabled, errorMsg, initialValue, keydownFilter, maxHeight, onBlur, onChange, onClick, onComplete, placeholder, style, value, resize, }) {
|
|
74
74
|
const textareaRef = React.useRef(null);
|
|
75
|
-
React.
|
|
76
|
-
// This effect is used to resize the textarea based on the content
|
|
75
|
+
React.useLayoutEffect(() => {
|
|
77
76
|
if (maxHeight && textareaRef.current) {
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
//
|
|
82
|
-
|
|
77
|
+
const computedStyle = window.getComputedStyle(textareaRef.current);
|
|
78
|
+
const minHeight = parseFloat(computedStyle.minHeight);
|
|
79
|
+
const maxHeightInPx = parseFloat(computedStyle.maxHeight);
|
|
80
|
+
// Reset the height to the initial minimum height in px
|
|
81
|
+
textareaRef.current.style.height = `${minHeight}px`;
|
|
82
|
+
// Calculate the new height based on scrollHeight
|
|
83
|
+
const newHeight = textareaRef.current.scrollHeight;
|
|
83
84
|
if (minHeight < newHeight) {
|
|
84
|
-
|
|
85
|
+
const adjustedHeight = Math.min(newHeight, maxHeightInPx);
|
|
86
|
+
// Set the textarea height to the new calculated height
|
|
87
|
+
textareaRef.current.style.height = `${adjustedHeight}px`;
|
|
88
|
+
// Toggle overflow-y based on whether maxHeight is reached, this is to guarantee overflow does not show before it is needed
|
|
89
|
+
if (adjustedHeight >= maxHeightInPx) {
|
|
90
|
+
textareaRef.current.style.overflowY = 'auto';
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
textareaRef.current.style.overflowY = 'hidden';
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
textareaRef.current.style.overflowY = 'hidden';
|
|
85
98
|
}
|
|
86
99
|
}
|
|
87
100
|
}, [maxHeight, value]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.js","sourceRoot":"","sources":["../../src/textarea/textarea.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAE/C,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGnC,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAA;;;;;;;aAOnB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK;CAC/C,CAAC;AAMF,MAAM,eAAe,GAAG,MAAM,CAAC,QAAQ,CAAsB;;;;;;;;;;;aAWhD,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAA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Q,EAAE,QAAQ,EAClB,SAAS,EAAE,CAAC,CAAC,QAAQ,EACrB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,EACpE,KAAK,EAAE,KAAK,GACd,EACD,QAAQ,IAAI,KAAC,YAAY,cAAE,QAAQ,GAAgB,IAClD,CACT,CAAC;AACN,CAAC;AAED,eAAe,QAAQ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@darajs/ui-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0",
|
|
4
4
|
"description": "The core React UI kit for Dara",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"@babel/preset-env": "^7.15.6",
|
|
25
25
|
"@babel/preset-react": "^7.14.5",
|
|
26
26
|
"@babel/preset-typescript": "^7.15.0",
|
|
27
|
-
"@darajs/eslint-config": "1.
|
|
28
|
-
"@darajs/prettier-config": "1.
|
|
29
|
-
"@darajs/stylelint-config": "1.
|
|
27
|
+
"@darajs/eslint-config": "1.13.0",
|
|
28
|
+
"@darajs/prettier-config": "1.13.0",
|
|
29
|
+
"@darajs/stylelint-config": "1.13.0",
|
|
30
30
|
"@storybook/addon-a11y": "^6.5.16",
|
|
31
31
|
"@storybook/addon-actions": "^6.5.16",
|
|
32
32
|
"@storybook/addon-essentials": "^6.5.16",
|
|
@@ -68,9 +68,9 @@
|
|
|
68
68
|
"typescript": "^5.0.4"
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@darajs/styled-components": "1.
|
|
72
|
-
"@darajs/ui-icons": "1.
|
|
73
|
-
"@darajs/ui-utils": "1.
|
|
71
|
+
"@darajs/styled-components": "1.13.0",
|
|
72
|
+
"@darajs/ui-icons": "1.13.0",
|
|
73
|
+
"@darajs/ui-utils": "1.13.0",
|
|
74
74
|
"@floating-ui/react": "^0.26.12",
|
|
75
75
|
"@fortawesome/free-regular-svg-icons": "~6.4.0",
|
|
76
76
|
"@fortawesome/free-solid-svg-icons": "~6.4.0",
|
|
@@ -104,5 +104,5 @@
|
|
|
104
104
|
"publishConfig": {
|
|
105
105
|
"access": "public"
|
|
106
106
|
},
|
|
107
|
-
"gitHead": "
|
|
107
|
+
"gitHead": "095eb739d4264011284c4ba2f1e52f48eae07c73"
|
|
108
108
|
}
|