@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.
@@ -1,6 +1,6 @@
1
1
  /** @jsxImportSource @emotion/react */
2
2
  import React, { useState } from 'react';
3
- import { styles, ErrorMessage } from './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("label", {
66
- css: theme => [styles.default(theme), props.highlight && styles.highligted(height), type === 'search' && styles.searchLabel(theme), props.validation && styles.validation, (props.invalid || props.invalidMessage) && styles.invalid(theme), height && styles.height(height)],
67
- children: [props.label && _jsx("span", {
68
- css: info && styles.pr4,
69
- children: props.label
70
- }), _jsx("input", {
71
- type: type,
72
- ...(type !== 'password' && {
73
- value
74
- }),
75
- placeholder: props.placeholder,
76
- disabled: props.disabled,
77
- autoFocus: props.focus,
78
- onBlur: props.onBlur,
79
- onFocus: props.onFocus,
80
- onChange: onInputChange,
81
- maxLength: maxlength,
82
- ref: ref,
83
- name: props.name,
84
- 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],
85
- children: React.Children.map(props.children, child => {
86
- if (!child) {
87
- return null;
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
- return child;
91
- })
92
- }), type === 'search' && _jsx(IconSearch, {}), props.invalidMessage && _jsx(IconErrorOutline, {
93
- size: "16px"
94
- }), props.invalidMessage && _jsx("span", {
95
- css: theme => [ErrorMessage(theme)],
96
- children: props.invalidMessage
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;;oBA6DV,SAAS;kBAKX,SAAS;sBAKL,SAAS;oBAMX,SAAS;yBAaJ,SAAS;;sBAgBZ,SAAS;;;qBAiCV,SAAS;qBA+BT,MAAM;;;CAiBxB,CAAA;AAED,eAAO,MAAM,YAAY,UAAW,SAAS,8CAK5C,CAAA;AAED,eAAe,MAAM,CAAA;AAErB,OAAO,EAAE,MAAM,EAAE,CAAA"}
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"}