@bbl-digital/snorre 3.1.21 → 3.1.22
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/bundle.js +62 -59
- package/esm/core/Input/index.js +35 -32
- package/esm/core/Input/styles.js +28 -28
- package/lib/core/Input/index.d.ts +1 -1
- package/lib/core/Input/index.d.ts.map +1 -1
- package/lib/core/Input/index.js +35 -32
- package/lib/core/Input/styles.d.ts +2 -2
- package/lib/core/Input/styles.d.ts.map +1 -1
- package/lib/core/Input/styles.js +28 -28
- package/package.json +1 -1
package/lib/core/Input/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/** @jsxImportSource @emotion/react */
|
2
2
|
import React, { useState } from 'react';
|
3
|
-
import { styles
|
3
|
+
import { styles } from './styles';
|
4
4
|
import IconSearch from '../../icons/General/IconSearch';
|
5
5
|
import { useEffect } from 'react';
|
6
6
|
import { useDebounce } from '../utils/debounce';
|
@@ -62,38 +62,41 @@ const Input = /*#__PURE__*/React.forwardRef(({
|
|
62
62
|
|
63
63
|
handleDebounceChange(debouncedValue); // eslint-disable-next-line react-hooks/exhaustive-deps
|
64
64
|
}, [debouncedValue]);
|
65
|
-
return _jsxs("
|
66
|
-
css:
|
67
|
-
children: [
|
68
|
-
css:
|
69
|
-
children: props.label
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
65
|
+
return _jsxs("div", {
|
66
|
+
css: styles.relative,
|
67
|
+
children: [_jsxs("label", {
|
68
|
+
css: theme => [styles.default(theme), props.highlight && styles.highligted(height), type === 'search' && styles.searchLabel(theme), (props.invalid || props.invalidMessage) && styles.invalid(theme), height && styles.height(height)],
|
69
|
+
children: [props.label && _jsx("span", {
|
70
|
+
css: info && styles.pr4,
|
71
|
+
children: props.label
|
72
|
+
}), _jsx("input", {
|
73
|
+
type: type,
|
74
|
+
...(type !== 'password' && {
|
75
|
+
value
|
76
|
+
}),
|
77
|
+
placeholder: props.placeholder,
|
78
|
+
disabled: props.disabled,
|
79
|
+
autoFocus: props.focus,
|
80
|
+
onBlur: props.onBlur,
|
81
|
+
onFocus: props.onFocus,
|
82
|
+
onChange: onInputChange,
|
83
|
+
maxLength: maxlength,
|
84
|
+
ref: ref,
|
85
|
+
name: props.name,
|
86
|
+
css: theme => [type === 'text' && styles.text(theme), type === 'search' && styles.search(theme), type === 'password' && styles.password(theme), type === 'number' && styles.number(theme), type === 'file' && styles.file, props.disabled && styles.disabled(theme), props.cardInput && styles.cardInput],
|
87
|
+
children: React.Children.map(props.children, child => {
|
88
|
+
if (!child) {
|
89
|
+
return null;
|
90
|
+
}
|
89
91
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
92
|
+
return child;
|
93
|
+
})
|
94
|
+
}), type === 'search' && _jsx(IconSearch, {}), props.invalidMessage && _jsx(IconErrorOutline, {
|
95
|
+
size: "16px"
|
96
|
+
}), props.invalidMessage && _jsx("span", {
|
97
|
+
css: styles.errorMessage,
|
98
|
+
children: props.invalidMessage
|
99
|
+
})]
|
97
100
|
}), info && _jsx("span", {
|
98
101
|
css: styles.infoButton,
|
99
102
|
children: _jsx(InfoButton, {
|
@@ -10,13 +10,13 @@ declare const styles: {
|
|
10
10
|
file: import("@emotion/react").SerializedStyles;
|
11
11
|
disabled: (theme: IAppTheme) => import("@emotion/react").SerializedStyles;
|
12
12
|
cardInput: import("@emotion/react").SerializedStyles;
|
13
|
-
validation: import("@emotion/react").SerializedStyles;
|
14
13
|
invalid: (theme: IAppTheme) => import("@emotion/react").SerializedStyles;
|
15
14
|
height: (height: string) => import("@emotion/react").SerializedStyles;
|
15
|
+
errorMessage: (theme: IAppTheme) => import("@emotion/react").SerializedStyles;
|
16
16
|
pr4: import("@emotion/react").SerializedStyles;
|
17
17
|
infoButton: import("@emotion/react").SerializedStyles;
|
18
|
+
relative: import("@emotion/react").SerializedStyles;
|
18
19
|
};
|
19
|
-
export declare const ErrorMessage: (theme: IAppTheme) => import("@emotion/react").SerializedStyles;
|
20
20
|
export default styles;
|
21
21
|
export { styles };
|
22
22
|
//# sourceMappingURL=styles.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/packages/core/Input/styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEjD,QAAA,MAAM,MAAM;qBACO,SAAS;;
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/packages/core/Input/styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEjD,QAAA,MAAM,MAAM;qBACO,SAAS;;oBA4DV,SAAS;kBAKX,SAAS;sBAKL,SAAS;oBAMX,SAAS;yBAaJ,SAAS;;sBAgBZ,SAAS;;qBAeV,SAAS;qBAkCT,MAAM;0BAKD,SAAS;;;;CAwBhC,CAAA;AAED,eAAe,MAAM,CAAA;AAErB,OAAO,EAAE,MAAM,EAAE,CAAA"}
|