@soul-refiner/design-system 0.2.64 → 0.2.65
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.
|
@@ -127,14 +127,14 @@ const Secondary = styled(Box) `
|
|
|
127
127
|
const Outlined = styled(Box) `
|
|
128
128
|
background-color: var(--color-white);
|
|
129
129
|
color: var(--color-grey-3);
|
|
130
|
-
border: 1px solid var(--color-
|
|
130
|
+
border: 1px solid var(--color-grey-8);
|
|
131
131
|
|
|
132
|
-
&:
|
|
133
|
-
background-color: var(--color-grey-
|
|
132
|
+
&:hover {
|
|
133
|
+
background-color: var(--color-grey-10);
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
&:
|
|
137
|
-
|
|
136
|
+
&:active {
|
|
137
|
+
background-color: var(--color-grey-9);
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
${base}
|
|
@@ -10,6 +10,7 @@ export type Props = {
|
|
|
10
10
|
label?: string;
|
|
11
11
|
maxCharacters?: number;
|
|
12
12
|
multiple?: boolean;
|
|
13
|
+
name?: string;
|
|
13
14
|
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
14
15
|
onMultipleChange?: (values: string[]) => void;
|
|
15
16
|
placeholder?: string;
|
|
@@ -33,5 +34,5 @@ interface WarningProps extends Props {
|
|
|
33
34
|
warning?: true;
|
|
34
35
|
}
|
|
35
36
|
export type TextInputProps = DisabledProps | SuccessfulProps | WarningProps;
|
|
36
|
-
export declare const TextInput: ({ bg, disabled, helperText, icon, label, maxCharacters, multiple, onChange, onMultipleChange, placeholder, size, successful, sx, value, warning, }: TextInputProps) => React.JSX.Element;
|
|
37
|
+
export declare const TextInput: ({ bg, disabled, helperText, icon, label, maxCharacters, multiple, name, onChange, onMultipleChange, placeholder, size, successful, sx, value, warning, }: TextInputProps) => React.JSX.Element;
|
|
37
38
|
export {};
|
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { Chip } from '../../feedback/chip/chip';
|
|
5
5
|
import { CheckmarkCircle, AlertCircle } from '../../../icons';
|
|
6
|
-
export const TextInput = ({ bg = 'var(--color-blue-10)', disabled, helperText, icon, label, maxCharacters, multiple, onChange, onMultipleChange, placeholder, size = 'large', successful, sx, value, warning, }) => {
|
|
6
|
+
export const TextInput = ({ bg = 'var(--color-blue-10)', disabled, helperText, icon, label, maxCharacters, multiple, name, onChange, onMultipleChange, placeholder, size = 'large', successful, sx, value, warning, }) => {
|
|
7
7
|
const id = React.useId();
|
|
8
8
|
const isMultiple = multiple;
|
|
9
9
|
const [multipleValueToAdd, setMultipleValueToAdd] = React.useState('');
|
|
@@ -49,7 +49,7 @@ export const TextInput = ({ bg = 'var(--color-blue-10)', disabled, helperText, i
|
|
|
49
49
|
isMultiple && (React.createElement(MultipleInputWrapper, { onSubmit: handleMultipleAdd },
|
|
50
50
|
value.filter(Boolean).map((item, index) => (React.createElement(Chip, { key: id + item + index, color: "blue", size: "small", onDismiss: () => handleMultipleItemRemoval(item) }, item))),
|
|
51
51
|
React.createElement(Input, { onChange: handleMultipleValueToAdd, onKeyDown: handleMultipleValueDelete, value: multipleValueToAdd, "$size": size }))),
|
|
52
|
-
!isMultiple && (React.createElement(Input, { disabled: disabled, onChange: onChange, placeholder: placeholder, value: maxCharacters
|
|
52
|
+
!isMultiple && (React.createElement(Input, { disabled: disabled, name: name, onChange: onChange, placeholder: placeholder, value: maxCharacters
|
|
53
53
|
? value.slice(0, maxCharacters - 1)
|
|
54
54
|
: value, "$size": size })),
|
|
55
55
|
maxCharacters && (React.createElement(MaxCharactersText, { "$size": size },
|