@onewelcome/react-lib-components 0.1.2-alpha → 0.1.3-alpha
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/react-lib-components.cjs.development.js +17 -16
- package/dist/react-lib-components.cjs.development.js.map +1 -1
- package/dist/react-lib-components.cjs.production.min.js +1 -1
- package/dist/react-lib-components.cjs.production.min.js.map +1 -1
- package/dist/react-lib-components.esm.js +17 -16
- package/dist/react-lib-components.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/Form/FormGroup/FormGroup.tsx +1 -1
- package/src/Form/FormSelectorWrapper/FormSelectorWrapper.tsx +13 -12
- package/src/Form/Input/Input.module.scss +1 -0
- package/src/Form/Wrapper/InputWrapper/InputWrapper.module.scss +6 -1
- package/src/Form/Wrapper/InputWrapper/InputWrapper.tsx +10 -3
- package/src/Form/Wrapper/TextareaWrapper/TextareaWrapper.module.scss +2 -2
- package/src/Form/Wrapper/Wrapper/Wrapper.module.scss +1 -1
package/package.json
CHANGED
|
@@ -54,7 +54,7 @@ export const FormGroup = React.forwardRef<HTMLDivElement, Props>(
|
|
|
54
54
|
>
|
|
55
55
|
{helperText && !error && (
|
|
56
56
|
<FormHelperText {...helperProps} className={''} id={helperId}>
|
|
57
|
-
{helperText}
|
|
57
|
+
{(helperProps && helperProps.children) || helperText}
|
|
58
58
|
</FormHelperText>
|
|
59
59
|
)}
|
|
60
60
|
{error && errorMessage && (
|
|
@@ -45,18 +45,19 @@ export const FormSelectorWrapper = React.forwardRef<HTMLDivElement, Props>(
|
|
|
45
45
|
}`}
|
|
46
46
|
>
|
|
47
47
|
<div {...containerProps}>{children}</div>
|
|
48
|
-
{helperText
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
48
|
+
{(helperText || (helperProps && helperProps.children)) &&
|
|
49
|
+
(!error || parentErrorId || !errorMessage) && (
|
|
50
|
+
<FormHelperText
|
|
51
|
+
{...helperProps}
|
|
52
|
+
ref={helperRef}
|
|
53
|
+
id={`${identifier}`}
|
|
54
|
+
className={`${classes['helper-text']} ${helperProps?.className ?? ''} ${
|
|
55
|
+
error ? classes['error'] : ''
|
|
56
|
+
}`}
|
|
57
|
+
>
|
|
58
|
+
{(helperProps && helperProps.children) || helperText}
|
|
59
|
+
</FormHelperText>
|
|
60
|
+
)}
|
|
60
61
|
{errorMessage && !parentErrorId && error && (
|
|
61
62
|
<span className={classes['error-message']}>
|
|
62
63
|
<Icon className={classes['error-icon']} icon={Icons.Error} />
|
|
@@ -19,10 +19,15 @@ input {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
.input-wrapper [data-icon]:before {
|
|
22
|
-
|
|
22
|
+
transition: 0.2s ease-in-out;
|
|
23
|
+
transform: translateY(0px);
|
|
23
24
|
font-size: 1.125rem;
|
|
24
25
|
}
|
|
25
26
|
|
|
27
|
+
.input-wrapper .floating-label-active [data-icon]:before {
|
|
28
|
+
transform: translateY(5px);
|
|
29
|
+
}
|
|
30
|
+
|
|
26
31
|
.input-wrapper [data-prefix],
|
|
27
32
|
.input-wrapper [data-suffix] {
|
|
28
33
|
transform: translateY(-0.125rem);
|
|
@@ -54,6 +54,7 @@ export const InputWrapper = React.forwardRef<HTMLDivElement, Props>(
|
|
|
54
54
|
helperText,
|
|
55
55
|
helperProps,
|
|
56
56
|
value,
|
|
57
|
+
className,
|
|
57
58
|
error,
|
|
58
59
|
onChange,
|
|
59
60
|
onBlur,
|
|
@@ -90,7 +91,7 @@ export const InputWrapper = React.forwardRef<HTMLDivElement, Props>(
|
|
|
90
91
|
{...rest}
|
|
91
92
|
ref={ref || wrapper}
|
|
92
93
|
name={name}
|
|
93
|
-
className={classes['input-wrapper']}
|
|
94
|
+
className={`${classes['input-wrapper']} ${className ?? ''}`}
|
|
94
95
|
labelProps={{
|
|
95
96
|
id: labelId,
|
|
96
97
|
className: labelClasses.join(' '),
|
|
@@ -111,7 +112,11 @@ export const InputWrapper = React.forwardRef<HTMLDivElement, Props>(
|
|
|
111
112
|
{...inputProps}
|
|
112
113
|
prefix={hasValueOrActiveFloatingLabel ? prefix : ''}
|
|
113
114
|
suffix={hasValueOrActiveFloatingLabel ? suffix : ''}
|
|
114
|
-
wrapperProps={{
|
|
115
|
+
wrapperProps={{
|
|
116
|
+
className: `${floatingLabelActive ? classes['floating-label-active'] : ''} ${
|
|
117
|
+
inputProps?.wrapperProps?.className ?? ''
|
|
118
|
+
}`,
|
|
119
|
+
}}
|
|
115
120
|
ref={(inputProps && inputProps.ref) || input}
|
|
116
121
|
aria-labelledby={labelId}
|
|
117
122
|
aria-describedby={error ? errorId : helperId}
|
|
@@ -132,7 +137,9 @@ export const InputWrapper = React.forwardRef<HTMLDivElement, Props>(
|
|
|
132
137
|
? setFloatingLabelActive(true)
|
|
133
138
|
: setFloatingLabelActive(false);
|
|
134
139
|
}}
|
|
135
|
-
className={floatingLabelActive ? classes['floating-label'] : ''}
|
|
140
|
+
className={`${floatingLabelActive ? classes['floating-label'] : ''} ${
|
|
141
|
+
inputProps?.className ?? ''
|
|
142
|
+
}`}
|
|
136
143
|
name={name}
|
|
137
144
|
error={error}
|
|
138
145
|
id={name}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.textarea-label {
|
|
2
2
|
left: calc(
|
|
3
|
-
1.25rem +
|
|
4
|
-
); //
|
|
3
|
+
1.25rem + 1px
|
|
4
|
+
); // 1px is for offset of the textarea border. It's relative to the parent div which doesn't have a border.
|
|
5
5
|
|
|
6
6
|
&.focus {
|
|
7
7
|
color: var(--color-primary);
|