@laerdal/life-react-components 1.8.0-dev.34 → 1.8.0-dev.35
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/Button/Iconbutton.cjs +5 -7
- package/dist/Button/Iconbutton.cjs.map +1 -1
- package/dist/Button/Iconbutton.d.ts +0 -2
- package/dist/Button/Iconbutton.js +5 -7
- package/dist/Button/Iconbutton.js.map +1 -1
- package/dist/ChipsInput/ChipInputField.cjs +3 -2
- package/dist/ChipsInput/ChipInputField.cjs.map +1 -1
- package/dist/ChipsInput/ChipInputField.js +3 -2
- package/dist/ChipsInput/ChipInputField.js.map +1 -1
- package/dist/Dropdown/BasicDropdown.cjs +2 -0
- package/dist/Dropdown/BasicDropdown.cjs.map +1 -1
- package/dist/Dropdown/BasicDropdown.js +2 -0
- package/dist/Dropdown/BasicDropdown.js.map +1 -1
- package/dist/Dropdown/DropdownFilter.cjs +2 -0
- package/dist/Dropdown/DropdownFilter.cjs.map +1 -1
- package/dist/Dropdown/DropdownFilter.d.ts +1 -1
- package/dist/Dropdown/DropdownFilter.js +2 -0
- package/dist/Dropdown/DropdownFilter.js.map +1 -1
- package/dist/InputFields/DatepickerField.cjs +3 -2
- package/dist/InputFields/DatepickerField.cjs.map +1 -1
- package/dist/InputFields/DatepickerField.js +3 -2
- package/dist/InputFields/DatepickerField.js.map +1 -1
- package/dist/InputFields/Label.cjs +14 -24
- package/dist/InputFields/Label.cjs.map +1 -1
- package/dist/InputFields/Label.js +16 -24
- package/dist/InputFields/Label.js.map +1 -1
- package/dist/InputFields/PasswordField.cjs +1 -1
- package/dist/InputFields/PasswordField.cjs.map +1 -1
- package/dist/InputFields/PasswordField.js +1 -1
- package/dist/InputFields/PasswordField.js.map +1 -1
- package/dist/InputFields/QuickSearch.cjs +3 -2
- package/dist/InputFields/QuickSearch.cjs.map +1 -1
- package/dist/InputFields/QuickSearch.js +3 -2
- package/dist/InputFields/QuickSearch.js.map +1 -1
- package/dist/InputFields/TextField.cjs +16 -26
- package/dist/InputFields/TextField.cjs.map +1 -1
- package/dist/InputFields/TextField.d.ts +1 -3
- package/dist/InputFields/TextField.js +18 -27
- package/dist/InputFields/TextField.js.map +1 -1
- package/dist/InputFields/Textarea.cjs +20 -26
- package/dist/InputFields/Textarea.cjs.map +1 -1
- package/dist/InputFields/Textarea.d.ts +11 -1
- package/dist/InputFields/Textarea.js +24 -31
- package/dist/InputFields/Textarea.js.map +1 -1
- package/dist/InputFields/components/SearchBarInput.cjs +1 -1
- package/dist/InputFields/components/SearchBarInput.cjs.map +1 -1
- package/dist/InputFields/components/SearchBarInput.js +1 -1
- package/dist/InputFields/components/SearchBarInput.js.map +1 -1
- package/dist/InputFields/components/SearchField.cjs +1 -1
- package/dist/InputFields/components/SearchField.cjs.map +1 -1
- package/dist/InputFields/components/SearchField.js +1 -1
- package/dist/InputFields/components/SearchField.js.map +1 -1
- package/dist/InputFields/styling.cjs +13 -15
- package/dist/InputFields/styling.cjs.map +1 -1
- package/dist/InputFields/styling.d.ts +1 -4
- package/dist/InputFields/styling.js +10 -13
- package/dist/InputFields/styling.js.map +1 -1
- package/dist/MenuItem/MenuItem.cjs +11 -2
- package/dist/MenuItem/MenuItem.cjs.map +1 -1
- package/dist/MenuItem/MenuItem.d.ts +3 -1
- package/dist/MenuItem/MenuItem.js +13 -4
- package/dist/MenuItem/MenuItem.js.map +1 -1
- package/dist/styles/colors.cjs +1 -0
- package/dist/styles/colors.cjs.map +1 -1
- package/dist/styles/colors.d.ts +1 -0
- package/dist/styles/colors.js +1 -0
- package/dist/styles/colors.js.map +1 -1
- package/package.json +1 -1
- package/dist/InputFields/types.cjs +0 -6
- package/dist/InputFields/types.cjs.map +0 -1
- package/dist/InputFields/types.d.ts +0 -38
- package/dist/InputFields/types.js +0 -2
- package/dist/InputFields/types.js.map +0 -1
|
@@ -11,14 +11,14 @@ exports.default = void 0;
|
|
|
11
11
|
|
|
12
12
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
13
13
|
|
|
14
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
+
|
|
14
16
|
var React = _interopRequireWildcard(require("react"));
|
|
15
17
|
|
|
16
18
|
var _styles = require("../styles");
|
|
17
19
|
|
|
18
20
|
var _styling = require("./styling");
|
|
19
21
|
|
|
20
|
-
var _types = require("../types");
|
|
21
|
-
|
|
22
22
|
var _SystemIcons = require("../icons/systemicons/SystemIcons");
|
|
23
23
|
|
|
24
24
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
@@ -36,56 +36,50 @@ var TextareaWrapper = _styledComponents.default.div(_templateObject || (_templat
|
|
|
36
36
|
return props.margin ? "margin: ".concat(props.margin, ";") : '';
|
|
37
37
|
});
|
|
38
38
|
|
|
39
|
-
var TextArea = _styledComponents.default.textarea(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n border: 1px solid ", ";\n background: ", ";\n border-radius: 4px;\n outline: none;\n margin: 1px;\n padding: 16px;\n\n
|
|
40
|
-
|
|
41
|
-
}, (0, _styles.ComponentMStyling)(_styles.ComponentTextStyle.Italic, _styles.COLORS.black), (0, _styles.ComponentSStyling)(_styles.ComponentTextStyle.Italic, _styles.COLORS.black), (0, _styles.ComponentSStyling)(_styles.ComponentTextStyle.Italic, _styles.COLORS.neutral_500), (0, _styles.ComponentMStyling)(_styles.ComponentTextStyle.Italic, _styles.COLORS.black), _styles.COLORS.primary_700, _styles.COLORS.primary_800, _styles.COLORS.critical_500, _styles.COLORS.correct_500, _styles.COLORS.neutral_100, _styles.COLORS.neutral_300, (0, _styles.ComponentMStyling)(_styles.ComponentTextStyle.Italic, _styles.COLORS.neutral_500));
|
|
39
|
+
var TextArea = _styledComponents.default.textarea(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n border: 1px solid ", ";\n background: ", ";\n border-radius: 4px;\n outline: none;\n margin: 1px;\n padding: 16px;\n\n ", "\n\n &.small {\n width: 304px;\n }\n\n &.medium {\n width: 344px;\n }\n\n &:hover {\n border: 2px solid ", ";\n margin: 0px;\n }\n\n &:active,\n &:focus {\n border: 2px solid ", ";\n margin: 0px;\n }\n\n &.invalid,\n &.invalid:hover,\n &.invalid:focus,\n &.invalid:active {\n border: none;\n margin: 1px;\n box-shadow: inset 0px 0px 0px 2px ", ";\n }\n\n &:disabled,\n &:disabled:hover,\n &:disabled:focus {\n cursor: not-allowed;\n border: 1px solid ", ";\n margin: 1px;\n box-shadow: none;\n\n &::placeholder {\n color: ", ";\n }\n }\n\n &::placeholder {\n ", "\n }\n"])), _styles.COLORS.neutral_400, _styles.COLORS.white, (0, _styles.ComponentMStyling)(_styles.ComponentTextStyle.Italic, _styles.COLORS.black), _styles.COLORS.primary_700, _styles.COLORS.primary_800, _styles.COLORS.critical_500, _styles.COLORS.neutral_100, _styles.COLORS.neutral_300, (0, _styles.ComponentMStyling)(_styles.ComponentTextStyle.Italic, _styles.COLORS.neutral_600)); // Add component-specific types
|
|
40
|
+
|
|
42
41
|
|
|
43
42
|
var Textarea = function Textarea(_ref) {
|
|
44
43
|
var id = _ref.id,
|
|
45
44
|
placeholder = _ref.placeholder,
|
|
46
|
-
state = _ref.state,
|
|
47
45
|
value = _ref.value,
|
|
48
46
|
size = _ref.size,
|
|
49
47
|
disabled = _ref.disabled,
|
|
50
48
|
validationMessage = _ref.validationMessage,
|
|
51
49
|
_onChange = _ref.onChange,
|
|
52
|
-
margin = _ref.margin
|
|
53
|
-
autoHeight = _ref.autoHeight,
|
|
54
|
-
note = _ref.note,
|
|
55
|
-
required = _ref.required;
|
|
50
|
+
margin = _ref.margin;
|
|
56
51
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(TextareaWrapper, {
|
|
57
52
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(TextArea, {
|
|
58
53
|
id: id,
|
|
59
54
|
value: value,
|
|
60
|
-
placeholder:
|
|
61
|
-
|
|
62
|
-
className: "".concat(size, " ").concat(state || (validationMessage ? _types.States.Invalid : '')),
|
|
55
|
+
placeholder: placeholder,
|
|
56
|
+
className: "".concat(size, " ").concat(validationMessage ? 'invalid' : ''),
|
|
63
57
|
disabled: disabled,
|
|
64
58
|
onChange: function onChange(e) {
|
|
65
59
|
var _e$target;
|
|
66
60
|
|
|
67
61
|
return _onChange && _onChange((e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value) || '');
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
type: state !== null && state !== void 0 ? state : _types.States.Invalid,
|
|
73
|
-
children: [state === _types.States.Valid ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_SystemIcons.CheckMark, {
|
|
74
|
-
color: _styles.COLORS.correct_400
|
|
75
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_SystemIcons.TechnicalWarning, {
|
|
62
|
+
}
|
|
63
|
+
}), validationMessage && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styling.ErrorMessage, {
|
|
64
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_SystemIcons.TechnicalWarning, {
|
|
65
|
+
size: "20px",
|
|
76
66
|
color: _styles.COLORS.critical_400
|
|
77
67
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
78
68
|
children: validationMessage
|
|
79
69
|
})]
|
|
80
|
-
}), note && !disabled && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styling.NoteMessage, {
|
|
81
|
-
className: size,
|
|
82
|
-
children: [note.icon, /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
83
|
-
children: note.message
|
|
84
|
-
})]
|
|
85
70
|
})]
|
|
86
71
|
});
|
|
87
72
|
};
|
|
88
73
|
|
|
74
|
+
Textarea.propTypes = {
|
|
75
|
+
id: _propTypes.default.string.isRequired,
|
|
76
|
+
placeholder: _propTypes.default.string.isRequired,
|
|
77
|
+
value: _propTypes.default.string,
|
|
78
|
+
disabled: _propTypes.default.bool,
|
|
79
|
+
onChange: _propTypes.default.func,
|
|
80
|
+
validationMessage: _propTypes.default.string,
|
|
81
|
+
margin: _propTypes.default.string
|
|
82
|
+
};
|
|
89
83
|
var _default = Textarea;
|
|
90
84
|
exports.default = _default;
|
|
91
85
|
//# sourceMappingURL=Textarea.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/InputFields/Textarea.tsx"],"names":["TextareaWrapper","styled","div","props","margin","TextArea","textarea","COLORS","neutral_400","white","
|
|
1
|
+
{"version":3,"sources":["../../src/InputFields/Textarea.tsx"],"names":["TextareaWrapper","styled","div","props","margin","TextArea","textarea","COLORS","neutral_400","white","ComponentTextStyle","Italic","black","primary_700","primary_800","critical_500","neutral_100","neutral_300","neutral_600","Textarea","id","placeholder","value","size","disabled","validationMessage","onChange","e","target","critical_400"],"mappings":";;;;;;;;;;;;;;;AAGA;;AAKA;;AACA;;AAMA;;AAKA;;;;;;;;;;AAGA;AACA,IAAMA,eAAe,GAAGC,0BAAOC,GAAV,8GAEjB,UAACC,KAAD;AAAA,SAAYA,KAAK,CAACC,MAAN,qBAA0BD,KAAK,CAACC,MAAhC,SAA4C,EAAxD;AAAA,CAFiB,CAArB;;AAIA,IAAMC,QAAQ,GAAGJ,0BAAOK,QAAV,61BACQC,eAAOC,WADf,EAEED,eAAOE,KAFT,EAQV,+BAAkBC,2BAAmBC,MAArC,EAA6CJ,eAAOK,KAApD,CARU,EAmBUL,eAAOM,WAnBjB,EAyBUN,eAAOO,WAzBjB,EAmC0BP,eAAOQ,YAnCjC,EA0CUR,eAAOS,WA1CjB,EA+CCT,eAAOU,WA/CR,EAoDR,+BAAkBP,2BAAmBC,MAArC,EAA6CJ,eAAOW,WAApD,CApDQ,CAAd,C,CAwDA;;;AAYA,IAAMC,QAAgD,GAAG,SAAnDA,QAAmD,OAAoG;AAAA,MAAjGC,EAAiG,QAAjGA,EAAiG;AAAA,MAA7FC,WAA6F,QAA7FA,WAA6F;AAAA,MAAhFC,KAAgF,QAAhFA,KAAgF;AAAA,MAAzEC,IAAyE,QAAzEA,IAAyE;AAAA,MAAnEC,QAAmE,QAAnEA,QAAmE;AAAA,MAAzDC,iBAAyD,QAAzDA,iBAAyD;AAAA,MAAtCC,SAAsC,QAAtCA,QAAsC;AAAA,MAA5BtB,MAA4B,QAA5BA,MAA4B;AAC3J,sBACE,sBAAC,eAAD;AAAA,4BACE,qBAAC,QAAD;AACE,MAAA,EAAE,EAAEgB,EADN;AAEE,MAAA,KAAK,EAAEE,KAFT;AAGE,MAAA,WAAW,EAAED,WAHf;AAIE,MAAA,SAAS,YAAKE,IAAL,cAAaE,iBAAiB,GAAG,SAAH,GAAe,EAA7C,CAJX;AAKE,MAAA,QAAQ,EAAED,QALZ;AAME,MAAA,QAAQ,EAAE,kBAACG,CAAD;AAAA;;AAAA,eAAYD,SAAQ,IAAIA,SAAQ,CAAC,CAAAC,CAAC,SAAD,IAAAA,CAAC,WAAD,yBAAAA,CAAC,CAAEC,MAAH,wDAAWN,KAAX,KAAoB,EAArB,CAAhC;AAAA;AANZ,MADF,EASGG,iBAAiB,iBAChB,sBAAC,qBAAD;AAAA,8BACE,qBAAC,6BAAD;AAAkB,QAAA,IAAI,EAAC,MAAvB;AAA8B,QAAA,KAAK,EAAElB,eAAOsB;AAA5C,QADF,eAEE;AAAA,kBAAOJ;AAAP,QAFF;AAAA,MAVJ;AAAA,IADF;AAkBD,CAnBD;;;AAVEL,EAAAA,E;AACAC,EAAAA,W;AACAC,EAAAA,K;AACAE,EAAAA,Q;AACAE,EAAAA,Q;AACAD,EAAAA,iB;AAEArB,EAAAA,M;;eAwBae,Q","sourcesContent":["/**\n * Import React libraries.\n */\nimport * as React from 'react';\n\n/**\n * Import custom styles.\n */\nimport { COLORS } from '../styles';\nimport { ErrorMessage } from './styling';\nimport { Size } from '../types';\n\n/**\n * Import custom components.\n */\nimport { TechnicalWarning } from '../icons/systemicons/SystemIcons';\n\n/**\n * Import third-party libraries.\n */\nimport styled from 'styled-components';\nimport { ComponentMStyling, ComponentTextStyle } from '../styles';\n\n// Add component-specific styles.\nconst TextareaWrapper = styled.div<{ margin?: string }>`\n width: 100%;\n ${(props) => (props.margin ? `margin: ${props.margin};` : '')}\n`;\nconst TextArea = styled.textarea`\n border: 1px solid ${COLORS.neutral_400};\n background: ${COLORS.white};\n border-radius: 4px;\n outline: none;\n margin: 1px;\n padding: 16px;\n\n ${ComponentMStyling(ComponentTextStyle.Italic, COLORS.black)}\n\n &.small {\n width: 304px;\n }\n\n &.medium {\n width: 344px;\n }\n\n &:hover {\n border: 2px solid ${COLORS.primary_700};\n margin: 0px;\n }\n\n &:active,\n &:focus {\n border: 2px solid ${COLORS.primary_800};\n margin: 0px;\n }\n\n &.invalid,\n &.invalid:hover,\n &.invalid:focus,\n &.invalid:active {\n border: none;\n margin: 1px;\n box-shadow: inset 0px 0px 0px 2px ${COLORS.critical_500};\n }\n\n &:disabled,\n &:disabled:hover,\n &:disabled:focus {\n cursor: not-allowed;\n border: 1px solid ${COLORS.neutral_100};\n margin: 1px;\n box-shadow: none;\n\n &::placeholder {\n color: ${COLORS.neutral_300};\n }\n }\n\n &::placeholder {\n ${ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_600)}\n }\n`;\n\n// Add component-specific types\ntype TextareaProps = {\n id: string;\n placeholder: string;\n value?: string;\n disabled?: boolean;\n onChange?: (text: string) => void;\n validationMessage?: string;\n size: Size.Small | Size.Medium;\n margin?: string;\n};\n\nconst Textarea: React.FunctionComponent<TextareaProps> = ({ id, placeholder, value, size, disabled, validationMessage, onChange, margin }: TextareaProps) => {\n return (\n <TextareaWrapper>\n <TextArea\n id={id}\n value={value}\n placeholder={placeholder}\n className={`${size} ${validationMessage ? 'invalid' : ''}`}\n disabled={disabled}\n onChange={(e: any) => onChange && onChange(e?.target?.value || '')}\n />\n {validationMessage && (\n <ErrorMessage>\n <TechnicalWarning size=\"20px\" color={COLORS.critical_400} />\n <span>{validationMessage}</span>\n </ErrorMessage>\n )}\n </TextareaWrapper>\n );\n};\n\nexport default Textarea;\n"],"file":"Textarea.cjs"}
|
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
* Import React libraries.
|
|
3
3
|
*/
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import {
|
|
5
|
+
import { Size } from '../types';
|
|
6
|
+
declare type TextareaProps = {
|
|
7
|
+
id: string;
|
|
8
|
+
placeholder: string;
|
|
9
|
+
value?: string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
onChange?: (text: string) => void;
|
|
12
|
+
validationMessage?: string;
|
|
13
|
+
size: Size.Small | Size.Medium;
|
|
14
|
+
margin?: string;
|
|
15
|
+
};
|
|
6
16
|
declare const Textarea: React.FunctionComponent<TextareaProps>;
|
|
7
17
|
export default Textarea;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
+
import _pt from "prop-types";
|
|
2
3
|
|
|
3
4
|
var _templateObject, _templateObject2;
|
|
4
5
|
|
|
@@ -10,75 +11,67 @@ import * as React from 'react';
|
|
|
10
11
|
* Import custom styles.
|
|
11
12
|
*/
|
|
12
13
|
|
|
13
|
-
import { COLORS
|
|
14
|
-
import {
|
|
15
|
-
|
|
14
|
+
import { COLORS } from '../styles';
|
|
15
|
+
import { ErrorMessage } from './styling';
|
|
16
|
+
|
|
16
17
|
/**
|
|
17
18
|
* Import custom components.
|
|
18
19
|
*/
|
|
19
|
-
|
|
20
|
-
import { CheckMark, TechnicalWarning } from '../icons/systemicons/SystemIcons';
|
|
20
|
+
import { TechnicalWarning } from '../icons/systemicons/SystemIcons';
|
|
21
21
|
/**
|
|
22
22
|
* Import third-party libraries.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
import styled from 'styled-components';
|
|
26
|
-
import { ComponentMStyling, ComponentTextStyle } from '../styles';
|
|
26
|
+
import { ComponentMStyling, ComponentTextStyle } from '../styles'; // Add component-specific styles.
|
|
27
|
+
|
|
27
28
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
28
29
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
29
|
-
// Add component-specific styles.
|
|
30
30
|
var TextareaWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n ", "\n"])), function (props) {
|
|
31
31
|
return props.margin ? "margin: ".concat(props.margin, ";") : '';
|
|
32
32
|
});
|
|
33
|
-
var TextArea = styled.textarea(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n border: 1px solid ", ";\n background: ", ";\n border-radius: 4px;\n outline: none;\n margin: 1px;\n padding: 16px;\n\n
|
|
34
|
-
return props.autoHeight ? 'none' : '';
|
|
35
|
-
}, ComponentMStyling(ComponentTextStyle.Italic, COLORS.black), ComponentSStyling(ComponentTextStyle.Italic, COLORS.black), ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_500), ComponentMStyling(ComponentTextStyle.Italic, COLORS.black), COLORS.primary_700, COLORS.primary_800, COLORS.critical_500, COLORS.correct_500, COLORS.neutral_100, COLORS.neutral_300, ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_500));
|
|
33
|
+
var TextArea = styled.textarea(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n border: 1px solid ", ";\n background: ", ";\n border-radius: 4px;\n outline: none;\n margin: 1px;\n padding: 16px;\n\n ", "\n\n &.small {\n width: 304px;\n }\n\n &.medium {\n width: 344px;\n }\n\n &:hover {\n border: 2px solid ", ";\n margin: 0px;\n }\n\n &:active,\n &:focus {\n border: 2px solid ", ";\n margin: 0px;\n }\n\n &.invalid,\n &.invalid:hover,\n &.invalid:focus,\n &.invalid:active {\n border: none;\n margin: 1px;\n box-shadow: inset 0px 0px 0px 2px ", ";\n }\n\n &:disabled,\n &:disabled:hover,\n &:disabled:focus {\n cursor: not-allowed;\n border: 1px solid ", ";\n margin: 1px;\n box-shadow: none;\n\n &::placeholder {\n color: ", ";\n }\n }\n\n &::placeholder {\n ", "\n }\n"])), COLORS.neutral_400, COLORS.white, ComponentMStyling(ComponentTextStyle.Italic, COLORS.black), COLORS.primary_700, COLORS.primary_800, COLORS.critical_500, COLORS.neutral_100, COLORS.neutral_300, ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_600)); // Add component-specific types
|
|
36
34
|
|
|
37
35
|
var Textarea = function Textarea(_ref) {
|
|
38
36
|
var id = _ref.id,
|
|
39
37
|
placeholder = _ref.placeholder,
|
|
40
|
-
state = _ref.state,
|
|
41
38
|
value = _ref.value,
|
|
42
39
|
size = _ref.size,
|
|
43
40
|
disabled = _ref.disabled,
|
|
44
41
|
validationMessage = _ref.validationMessage,
|
|
45
42
|
_onChange = _ref.onChange,
|
|
46
|
-
margin = _ref.margin
|
|
47
|
-
autoHeight = _ref.autoHeight,
|
|
48
|
-
note = _ref.note,
|
|
49
|
-
required = _ref.required;
|
|
43
|
+
margin = _ref.margin;
|
|
50
44
|
return /*#__PURE__*/_jsxs(TextareaWrapper, {
|
|
51
45
|
children: [/*#__PURE__*/_jsx(TextArea, {
|
|
52
46
|
id: id,
|
|
53
47
|
value: value,
|
|
54
|
-
placeholder:
|
|
55
|
-
|
|
56
|
-
className: "".concat(size, " ").concat(state || (validationMessage ? States.Invalid : '')),
|
|
48
|
+
placeholder: placeholder,
|
|
49
|
+
className: "".concat(size, " ").concat(validationMessage ? 'invalid' : ''),
|
|
57
50
|
disabled: disabled,
|
|
58
51
|
onChange: function onChange(e) {
|
|
59
52
|
var _e$target;
|
|
60
53
|
|
|
61
54
|
return _onChange && _onChange((e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value) || '');
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
type: state !== null && state !== void 0 ? state : States.Invalid,
|
|
67
|
-
children: [state === States.Valid ? /*#__PURE__*/_jsx(CheckMark, {
|
|
68
|
-
color: COLORS.correct_400
|
|
69
|
-
}) : /*#__PURE__*/_jsx(TechnicalWarning, {
|
|
55
|
+
}
|
|
56
|
+
}), validationMessage && /*#__PURE__*/_jsxs(ErrorMessage, {
|
|
57
|
+
children: [/*#__PURE__*/_jsx(TechnicalWarning, {
|
|
58
|
+
size: "20px",
|
|
70
59
|
color: COLORS.critical_400
|
|
71
60
|
}), /*#__PURE__*/_jsx("span", {
|
|
72
61
|
children: validationMessage
|
|
73
62
|
})]
|
|
74
|
-
}), note && !disabled && /*#__PURE__*/_jsxs(NoteMessage, {
|
|
75
|
-
className: size,
|
|
76
|
-
children: [note.icon, /*#__PURE__*/_jsx("span", {
|
|
77
|
-
children: note.message
|
|
78
|
-
})]
|
|
79
63
|
})]
|
|
80
64
|
});
|
|
81
65
|
};
|
|
82
66
|
|
|
67
|
+
Textarea.propTypes = {
|
|
68
|
+
id: _pt.string.isRequired,
|
|
69
|
+
placeholder: _pt.string.isRequired,
|
|
70
|
+
value: _pt.string,
|
|
71
|
+
disabled: _pt.bool,
|
|
72
|
+
onChange: _pt.func,
|
|
73
|
+
validationMessage: _pt.string,
|
|
74
|
+
margin: _pt.string
|
|
75
|
+
};
|
|
83
76
|
export default Textarea;
|
|
84
77
|
//# sourceMappingURL=Textarea.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/InputFields/Textarea.tsx"],"names":["React","COLORS","
|
|
1
|
+
{"version":3,"sources":["../../src/InputFields/Textarea.tsx"],"names":["React","COLORS","ErrorMessage","TechnicalWarning","styled","ComponentMStyling","ComponentTextStyle","TextareaWrapper","div","props","margin","TextArea","textarea","neutral_400","white","Italic","black","primary_700","primary_800","critical_500","neutral_100","neutral_300","neutral_600","Textarea","id","placeholder","value","size","disabled","validationMessage","onChange","e","target","critical_400"],"mappings":";;;;;AAAA;AACA;AACA;AACA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AAEA;AACA;AACA;;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c,EADN;AAEE,MAAA,KAAK,EAAEE,KAFT;AAGE,MAAA,WAAW,EAAED,WAHf;AAIE,MAAA,SAAS,YAAKE,IAAL,cAAaE,iBAAiB,GAAG,SAAH,GAAe,EAA7C,CAJX;AAKE,MAAA,QAAQ,EAAED,QALZ;AAME,MAAA,QAAQ,EAAE,kBAACG,CAAD;AAAA;;AAAA,eAAYD,SAAQ,IAAIA,SAAQ,CAAC,CAAAC,CAAC,SAAD,IAAAA,CAAC,WAAD,yBAAAA,CAAC,CAAEC,MAAH,wDAAWN,KAAX,KAAoB,EAArB,CAAhC;AAAA;AANZ,MADF,EASGG,iBAAiB,iBAChB,MAAC,YAAD;AAAA,8BACE,KAAC,gBAAD;AAAkB,QAAA,IAAI,EAAC,MAAvB;AAA8B,QAAA,KAAK,EAAE5B,MAAM,CAACgC;AAA5C,QADF,eAEE;AAAA,kBAAOJ;AAAP,QAFF;AAAA,MAVJ;AAAA,IADF;AAkBD,CAnBD;;;AAVEL,EAAAA,E;AACAC,EAAAA,W;AACAC,EAAAA,K;AACAE,EAAAA,Q;AACAE,EAAAA,Q;AACAD,EAAAA,iB;AAEAnB,EAAAA,M;;AAwBF,eAAea,QAAf","sourcesContent":["/**\n * Import React libraries.\n */\nimport * as React from 'react';\n\n/**\n * Import custom styles.\n */\nimport { COLORS } from '../styles';\nimport { ErrorMessage } from './styling';\nimport { Size } from '../types';\n\n/**\n * Import custom components.\n */\nimport { TechnicalWarning } from '../icons/systemicons/SystemIcons';\n\n/**\n * Import third-party libraries.\n */\nimport styled from 'styled-components';\nimport { ComponentMStyling, ComponentTextStyle } from '../styles';\n\n// Add component-specific styles.\nconst TextareaWrapper = styled.div<{ margin?: string }>`\n width: 100%;\n ${(props) => (props.margin ? `margin: ${props.margin};` : '')}\n`;\nconst TextArea = styled.textarea`\n border: 1px solid ${COLORS.neutral_400};\n background: ${COLORS.white};\n border-radius: 4px;\n outline: none;\n margin: 1px;\n padding: 16px;\n\n ${ComponentMStyling(ComponentTextStyle.Italic, COLORS.black)}\n\n &.small {\n width: 304px;\n }\n\n &.medium {\n width: 344px;\n }\n\n &:hover {\n border: 2px solid ${COLORS.primary_700};\n margin: 0px;\n }\n\n &:active,\n &:focus {\n border: 2px solid ${COLORS.primary_800};\n margin: 0px;\n }\n\n &.invalid,\n &.invalid:hover,\n &.invalid:focus,\n &.invalid:active {\n border: none;\n margin: 1px;\n box-shadow: inset 0px 0px 0px 2px ${COLORS.critical_500};\n }\n\n &:disabled,\n &:disabled:hover,\n &:disabled:focus {\n cursor: not-allowed;\n border: 1px solid ${COLORS.neutral_100};\n margin: 1px;\n box-shadow: none;\n\n &::placeholder {\n color: ${COLORS.neutral_300};\n }\n }\n\n &::placeholder {\n ${ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_600)}\n }\n`;\n\n// Add component-specific types\ntype TextareaProps = {\n id: string;\n placeholder: string;\n value?: string;\n disabled?: boolean;\n onChange?: (text: string) => void;\n validationMessage?: string;\n size: Size.Small | Size.Medium;\n margin?: string;\n};\n\nconst Textarea: React.FunctionComponent<TextareaProps> = ({ id, placeholder, value, size, disabled, validationMessage, onChange, margin }: TextareaProps) => {\n return (\n <TextareaWrapper>\n <TextArea\n id={id}\n value={value}\n placeholder={placeholder}\n className={`${size} ${validationMessage ? 'invalid' : ''}`}\n disabled={disabled}\n onChange={(e: any) => onChange && onChange(e?.target?.value || '')}\n />\n {validationMessage && (\n <ErrorMessage>\n <TechnicalWarning size=\"20px\" color={COLORS.critical_400} />\n <span>{validationMessage}</span>\n </ErrorMessage>\n )}\n </TextareaWrapper>\n );\n};\n\nexport default Textarea;\n"],"file":"Textarea.js"}
|
|
@@ -35,7 +35,7 @@ var Search = _styledComponents.default.input.attrs(function () {
|
|
|
35
35
|
return {
|
|
36
36
|
type: 'search'
|
|
37
37
|
};
|
|
38
|
-
})(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n appearance: none;\n width: calc(100% - 96px);\n\n /* To prevent browser putting its own cross inside the search bar */\n\n ::-ms-clear {\n display: none;\n width: 0;\n height: 0;\n }\n\n ::-ms-reveal {\n display: none;\n width: 0;\n height: 0;\n }\n\n ::-webkit-search-decoration,\n ::-webkit-search-cancel-button,\n ::-webkit-search-results-button,\n ::-webkit-search-results-decoration {\n display: none;\n }\n\n ::placeholder {\n ", "\n }\n\n height: 32px;\n border-width: 0;\n margin-left:
|
|
38
|
+
})(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n appearance: none;\n width: calc(100% - 96px);\n\n /* To prevent browser putting its own cross inside the search bar */\n\n ::-ms-clear {\n display: none;\n width: 0;\n height: 0;\n }\n\n ::-ms-reveal {\n display: none;\n width: 0;\n height: 0;\n }\n\n ::-webkit-search-decoration,\n ::-webkit-search-cancel-button,\n ::-webkit-search-results-button,\n ::-webkit-search-results-decoration {\n display: none;\n }\n\n ::placeholder {\n ", "\n }\n\n height: 32px;\n border-width: 0;\n margin-left: 50px;\n outline: none;\n\n ", "\n ::placeholder {\n ", "\n }\n\n ", " {\n ::placeholder {\n ", "\n }\n }\n\n &.small {\n ::placeholder {\n ", "\n }\n }\n\n &.medium {\n ::placeholder {\n ", "\n }\n }\n\n &:disabled {\n background: transparent;\n border: none;\n }\n"])), (0, _styles.ComponentSStyling)(_index.ComponentTextStyle.Italic, _index.COLORS.neutral_500), (0, _styles.ComponentMStyling)(_index.ComponentTextStyle.Regular, _index.COLORS.black), (0, _styles.ComponentSStyling)(_index.ComponentTextStyle.Italic, _index.COLORS.neutral_600), _index.BREAKPOINTS.MEDIUM, (0, _styles.ComponentMStyling)(_index.ComponentTextStyle.Italic, _index.COLORS.neutral_600), (0, _styles.ComponentSStyling)(_index.ComponentTextStyle.Italic, _index.COLORS.neutral_600), (0, _styles.ComponentMStyling)(_index.ComponentTextStyle.Italic, _index.COLORS.neutral_600));
|
|
39
39
|
|
|
40
40
|
exports.Search = Search;
|
|
41
41
|
var SearchBarInput = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/InputFields/components/SearchBarInput.tsx"],"names":["Search","styled","input","attrs","type","ComponentTextStyle","Italic","COLORS","neutral_500","Regular","black","neutral_600","BREAKPOINTS","MEDIUM","SearchBarInput","React","forwardRef","props","ref","id","searchTerm","setSearchTerm","enterSearch","placeholder","disabled","onKeyDown","size","onBlur","elementRef","focusParentRefs","isPressingEnter","e","key","preventDefault","stopPropagation","target","value"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;;;;;;;;;AAEO,IAAMA,MAAM,GAAGC,0BAAOC,KAAP,CAAaC,KAAb,CAAmB;AAAA,SAAO;
|
|
1
|
+
{"version":3,"sources":["../../../src/InputFields/components/SearchBarInput.tsx"],"names":["Search","styled","input","attrs","type","ComponentTextStyle","Italic","COLORS","neutral_500","Regular","black","neutral_600","BREAKPOINTS","MEDIUM","SearchBarInput","React","forwardRef","props","ref","id","searchTerm","setSearchTerm","enterSearch","placeholder","disabled","onKeyDown","size","onBlur","elementRef","focusParentRefs","isPressingEnter","e","key","preventDefault","stopPropagation","target","value"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;;;;;;;;;AAEO,IAAMA,MAAM,GAAGC,0BAAOC,KAAP,CAAaC,KAAb,CAAmB;AAAA,SAAO;AAACC,IAAAA,IAAI,EAAE;AAAP,GAAP;AAAA,CAAnB,CAAH,66BA0Bb,+BAAkBC,0BAAmBC,MAArC,EAA6CC,cAAOC,WAApD,CA1Ba,EAkCf,+BAAkBH,0BAAmBI,OAArC,EAA8CF,cAAOG,KAArD,CAlCe,EAoCb,+BAAkBL,0BAAmBC,MAArC,EAA6CC,cAAOI,WAApD,CApCa,EAuCfC,mBAAYC,MAvCG,EAyCX,+BAAkBR,0BAAmBC,MAArC,EAA6CC,cAAOI,WAApD,CAzCW,EA+CX,+BAAkBN,0BAAmBC,MAArC,EAA6CC,cAAOI,WAApD,CA/CW,EAqDX,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ACI,MAAF,CAASC,KAAV,CAAzB;AAAA,KARZ;AASE,IAAA,KAAK,EAAEhB,UATT;AAUE,IAAA,MAAM,EAAE,gBAACW,CAAD;AAAA,aAAOJ,OAAM,IAAIA,OAAM,CAACI,CAAD,CAAvB;AAAA,KAVV;AAWE,IAAA,SAAS,EAAEN,SAXb;AAYE,IAAA,UAAU,EAAE,oBAACM,CAAD;AAAA,aAAaD,eAAe,CAACC,CAAD,CAAf,GAAqBT,WAAW,CAACS,CAAD,CAAhC,GAAsC,IAAnD;AAAA;AAZd,IADF;AAgBD,CAxCsB,CAAvB;;AAZEZ,EAAAA,E;AACAC,EAAAA,U;AACAC,EAAAA,a;AACAC,EAAAA,W;AACAC,EAAAA,W;AACAC,EAAAA,Q;AACAC,EAAAA,S;AAEAE,EAAAA,M;AACAE,EAAAA,e;;eA6Caf,c","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport {BREAKPOINTS, COLORS, ComponentTextStyle} from '../../styles/index';\nimport {Size} from '../../types';\nimport {ComponentMStyling, ComponentSStyling} from '../../styles';\nimport {useFocusVisibleRef} from '../../common';\n\nexport const Search = styled.input.attrs(() => ({type: 'search'}))`\n appearance: none;\n width: calc(100% - 96px);\n\n /* To prevent browser putting its own cross inside the search bar */\n\n ::-ms-clear {\n display: none;\n width: 0;\n height: 0;\n }\n\n ::-ms-reveal {\n display: none;\n width: 0;\n height: 0;\n }\n\n ::-webkit-search-decoration,\n ::-webkit-search-cancel-button,\n ::-webkit-search-results-button,\n ::-webkit-search-results-decoration {\n display: none;\n }\n\n ::placeholder {\n ${ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_500)}\n }\n\n height: 32px;\n border-width: 0;\n margin-left: 50px;\n outline: none;\n\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.black)}\n ::placeholder {\n ${ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_600)}\n }\n\n ${BREAKPOINTS.MEDIUM} {\n ::placeholder {\n ${ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_600)}\n }\n }\n\n &.small {\n ::placeholder {\n ${ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_600)}\n }\n }\n\n &.medium {\n ::placeholder {\n ${ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_600)}\n }\n }\n\n &:disabled {\n background: transparent;\n border: none;\n }\n`;\n\n\ntype SearchBarInputProps = {\n id: string;\n searchTerm?: string;\n setSearchTerm: (term: string) => void;\n enterSearch: (e: any) => void;\n placeholder?: string;\n disabled?: boolean;\n onKeyDown?: (e: React.KeyboardEvent) => void;\n size?: Size.Small | Size.Medium;\n onBlur?: (e: any) => void;\n focusParentRefs?: React.RefObject<any>[];\n};\n\nconst SearchBarInput = React.forwardRef<HTMLInputElement, SearchBarInputProps>((props: SearchBarInputProps, ref) => {\n const {\n id,\n searchTerm,\n setSearchTerm,\n enterSearch,\n placeholder,\n disabled,\n onKeyDown,\n size,\n onBlur\n } = props;\n\n const elementRef = useFocusVisibleRef(props.focusParentRefs || [], ref);\n\n const isPressingEnter = (e: any) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n e.stopPropagation();\n return true;\n }\n return false;\n };\n\n return (\n <Search\n placeholder={disabled ? '' : placeholder}\n ref={elementRef}\n id={id}\n data-testid={id}\n className={size ? size : ''}\n tabIndex={0}\n disabled={disabled}\n onChange={(e: any) => setSearchTerm(e.target.value)}\n value={searchTerm}\n onBlur={(e) => onBlur && onBlur(e)}\n onKeyDown={onKeyDown}\n onKeyPress={(e: any) => (isPressingEnter(e) ? enterSearch(e) : null)}\n />\n );\n});\n\nexport default SearchBarInput;\n"],"file":"SearchBarInput.cjs"}
|
|
@@ -13,7 +13,7 @@ export var Search = styled.input.attrs(function () {
|
|
|
13
13
|
return {
|
|
14
14
|
type: 'search'
|
|
15
15
|
};
|
|
16
|
-
})(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n appearance: none;\n width: calc(100% - 96px);\n\n /* To prevent browser putting its own cross inside the search bar */\n\n ::-ms-clear {\n display: none;\n width: 0;\n height: 0;\n }\n\n ::-ms-reveal {\n display: none;\n width: 0;\n height: 0;\n }\n\n ::-webkit-search-decoration,\n ::-webkit-search-cancel-button,\n ::-webkit-search-results-button,\n ::-webkit-search-results-decoration {\n display: none;\n }\n\n ::placeholder {\n ", "\n }\n\n height: 32px;\n border-width: 0;\n margin-left:
|
|
16
|
+
})(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n appearance: none;\n width: calc(100% - 96px);\n\n /* To prevent browser putting its own cross inside the search bar */\n\n ::-ms-clear {\n display: none;\n width: 0;\n height: 0;\n }\n\n ::-ms-reveal {\n display: none;\n width: 0;\n height: 0;\n }\n\n ::-webkit-search-decoration,\n ::-webkit-search-cancel-button,\n ::-webkit-search-results-button,\n ::-webkit-search-results-decoration {\n display: none;\n }\n\n ::placeholder {\n ", "\n }\n\n height: 32px;\n border-width: 0;\n margin-left: 50px;\n outline: none;\n\n ", "\n ::placeholder {\n ", "\n }\n\n ", " {\n ::placeholder {\n ", "\n }\n }\n\n &.small {\n ::placeholder {\n ", "\n }\n }\n\n &.medium {\n ::placeholder {\n ", "\n }\n }\n\n &:disabled {\n background: transparent;\n border: none;\n }\n"])), ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_500), ComponentMStyling(ComponentTextStyle.Regular, COLORS.black), ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_600), BREAKPOINTS.MEDIUM, ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_600), ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_600), ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_600));
|
|
17
17
|
var SearchBarInput = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
18
18
|
var id = props.id,
|
|
19
19
|
searchTerm = props.searchTerm,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/InputFields/components/SearchBarInput.tsx"],"names":["React","styled","BREAKPOINTS","COLORS","ComponentTextStyle","ComponentMStyling","ComponentSStyling","useFocusVisibleRef","Search","input","attrs","type","Italic","neutral_500","Regular","black","neutral_600","MEDIUM","SearchBarInput","forwardRef","props","ref","id","searchTerm","setSearchTerm","enterSearch","placeholder","disabled","onKeyDown","size","onBlur","elementRef","focusParentRefs","isPressingEnter","e","key","preventDefault","stopPropagation","target","value"],"mappings":";;;;;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,
|
|
1
|
+
{"version":3,"sources":["../../../src/InputFields/components/SearchBarInput.tsx"],"names":["React","styled","BREAKPOINTS","COLORS","ComponentTextStyle","ComponentMStyling","ComponentSStyling","useFocusVisibleRef","Search","input","attrs","type","Italic","neutral_500","Regular","black","neutral_600","MEDIUM","SearchBarInput","forwardRef","props","ref","id","searchTerm","setSearchTerm","enterSearch","placeholder","disabled","onKeyDown","size","onBlur","elementRef","focusParentRefs","isPressingEnter","e","key","preventDefault","stopPropagation","target","value"],"mappings":";;;;;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,SAAQC,WAAR,EAAqBC,MAArB,EAA6BC,kBAA7B,QAAsD,oBAAtD;AAEA,SAAQC,iBAAR,EAA2BC,iBAA3B,QAAmD,cAAnD;AACA,SAAQC,kBAAR,QAAiC,cAAjC;;AAEA,OAAO,IAAMC,MAAM,GAAGP,MAAM,CAACQ,KAAP,CAAaC,KAAb,CAAmB;AAAA,SAAO;AAACC,IAAAA,IAAI,EAAE;AAAP,GAAP;AAAA,CAAnB,CAAH,+5BA0BbL,iBAAiB,CAACF,kBAAkB,CAACQ,MAApB,EAA4BT,MAAM,CAACU,WAAnC,CA1BJ,EAkCfR,iBAAiB,CAACD,kBAAkB,CAACU,OAApB,EAA6BX,MAAM,CAACY,KAApC,CAlCF,EAoCbT,iBAAiB,CAACF,kBAAkB,CAACQ,MAApB,EAA4BT,MAAM,CAACa,WAAnC,CAp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,EAHN;AAIE,mBAAaA,EAJf;AAKE,IAAA,SAAS,EAAEO,IAAI,GAAGA,IAAH,GAAU,EAL3B;AAME,IAAA,QAAQ,EAAE,CANZ;AAOE,IAAA,QAAQ,EAAEF,QAPZ;AAQE,IAAA,QAAQ,EAAE,kBAACO,CAAD;AAAA,aAAYV,aAAa,CAACU,CAAC,CAACI,MAAF,CAASC,KAAV,CAAzB;AAAA,KARZ;AASE,IAAA,KAAK,EAAEhB,UATT;AAUE,IAAA,MAAM,EAAE,gBAACW,CAAD;AAAA,aAAOJ,OAAM,IAAIA,OAAM,CAACI,CAAD,CAAvB;AAAA,KAVV;AAWE,IAAA,SAAS,EAAEN,SAXb;AAYE,IAAA,UAAU,EAAE,oBAACM,CAAD;AAAA,aAAaD,eAAe,CAACC,CAAD,CAAf,GAAqBT,WAAW,CAACS,CAAD,CAAhC,GAAsC,IAAnD;AAAA;AAZd,IADF;AAgBD,CAxCsB,CAAvB;;AAZEZ,EAAAA,E;AACAC,EAAAA,U;AACAC,EAAAA,a;AACAC,EAAAA,W;AACAC,EAAAA,W;AACAC,EAAAA,Q;AACAC,EAAAA,S;AAEAE,EAAAA,M;AACAE,EAAAA,e;;AA6CF,eAAed,cAAf","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport {BREAKPOINTS, COLORS, ComponentTextStyle} from '../../styles/index';\nimport {Size} from '../../types';\nimport {ComponentMStyling, ComponentSStyling} from '../../styles';\nimport {useFocusVisibleRef} from '../../common';\n\nexport const Search = styled.input.attrs(() => ({type: 'search'}))`\n appearance: none;\n width: calc(100% - 96px);\n\n /* To prevent browser putting its own cross inside the search bar */\n\n ::-ms-clear {\n display: none;\n width: 0;\n height: 0;\n }\n\n ::-ms-reveal {\n display: none;\n width: 0;\n height: 0;\n }\n\n ::-webkit-search-decoration,\n ::-webkit-search-cancel-button,\n ::-webkit-search-results-button,\n ::-webkit-search-results-decoration {\n display: none;\n }\n\n ::placeholder {\n ${ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_500)}\n }\n\n height: 32px;\n border-width: 0;\n margin-left: 50px;\n outline: none;\n\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.black)}\n ::placeholder {\n ${ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_600)}\n }\n\n ${BREAKPOINTS.MEDIUM} {\n ::placeholder {\n ${ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_600)}\n }\n }\n\n &.small {\n ::placeholder {\n ${ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_600)}\n }\n }\n\n &.medium {\n ::placeholder {\n ${ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_600)}\n }\n }\n\n &:disabled {\n background: transparent;\n border: none;\n }\n`;\n\n\ntype SearchBarInputProps = {\n id: string;\n searchTerm?: string;\n setSearchTerm: (term: string) => void;\n enterSearch: (e: any) => void;\n placeholder?: string;\n disabled?: boolean;\n onKeyDown?: (e: React.KeyboardEvent) => void;\n size?: Size.Small | Size.Medium;\n onBlur?: (e: any) => void;\n focusParentRefs?: React.RefObject<any>[];\n};\n\nconst SearchBarInput = React.forwardRef<HTMLInputElement, SearchBarInputProps>((props: SearchBarInputProps, ref) => {\n const {\n id,\n searchTerm,\n setSearchTerm,\n enterSearch,\n placeholder,\n disabled,\n onKeyDown,\n size,\n onBlur\n } = props;\n\n const elementRef = useFocusVisibleRef(props.focusParentRefs || [], ref);\n\n const isPressingEnter = (e: any) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n e.stopPropagation();\n return true;\n }\n return false;\n };\n\n return (\n <Search\n placeholder={disabled ? '' : placeholder}\n ref={elementRef}\n id={id}\n data-testid={id}\n className={size ? size : ''}\n tabIndex={0}\n disabled={disabled}\n onChange={(e: any) => setSearchTerm(e.target.value)}\n value={searchTerm}\n onBlur={(e) => onBlur && onBlur(e)}\n onKeyDown={onKeyDown}\n onKeyPress={(e: any) => (isPressingEnter(e) ? enterSearch(e) : null)}\n />\n );\n});\n\nexport default SearchBarInput;\n"],"file":"SearchBarInput.js"}
|
|
@@ -43,7 +43,7 @@ var SearchFieldWrapper = _styledComponents.default.div(_templateObject || (_temp
|
|
|
43
43
|
|
|
44
44
|
exports.SearchFieldWrapper = SearchFieldWrapper;
|
|
45
45
|
|
|
46
|
-
var StyledSearchField = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: row;\n box-shadow: inset 0 0 0 1px ", ";\n box-sizing: border-box;\n border-radius: 56px;\n align-items: center;\n position: relative;\n height: 48px;\n appearance: none;\n background-color: ", ";\n\n ", "\n\n padding: 0 !important;\n width: 100%;\n\n ::placeholder {\n ", "\n }\n\n ", " {\n ", "\n\n height: 56px;\n padding: 0 4px !important;\n\n &::placeholder {\n ", "\n }\n }\n\n &.small {\n ", "\n height: 48px;\n padding: 0 !important;\n\n &::placeholder {\n ", "\n }\n }\n\n &.medium {\n ", "\n height: 56px;\n\n &::placeholder {\n ", "\n }\n }\n\n &:hover {\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n &:focus-within {\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n div {\n color: ", ";\n background-color: transparent;\n }\n\n &.invalid {\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n &.disabled {\n box-shadow: inset 0 0 0 1px ", ";\n pointer-events: none;\n background-color: transparent !important;\n }\n"])), _index.COLORS.neutral_400, _index.COLORS.white, (0, _styles.ComponentSStyling)(_index.ComponentTextStyle.Regular, _index.COLORS.black), (0, _styles.ComponentSStyling)(_index.ComponentTextStyle.Italic, _index.COLORS.neutral_500), _index.BREAKPOINTS.MEDIUM, (0, _styles.ComponentMStyling)(_index.ComponentTextStyle.Regular, _index.COLORS.black), (0, _styles.ComponentMStyling)(_index.ComponentTextStyle.Italic, _index.COLORS.neutral_500), (0, _styles.ComponentSStyling)(_index.ComponentTextStyle.Regular, _index.COLORS.black), (0, _styles.ComponentSStyling)(_index.ComponentTextStyle.Italic, _index.COLORS.neutral_500), (0, _styles.ComponentMStyling)(_index.ComponentTextStyle.Regular, _index.COLORS.black), (0, _styles.ComponentMStyling)(_index.ComponentTextStyle.Italic, _index.COLORS.neutral_500), _index.COLORS.primary_800, _index.COLORS.primary_800, _index.COLORS.neutral_600, _index.COLORS.critical_400, _index.COLORS.neutral_100);
|
|
46
|
+
var StyledSearchField = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: row;\n box-shadow: inset 0 0 0 1px ", ";\n box-sizing: border-box;\n border-radius: 56px;\n align-items: center;\n position: relative;\n height: 48px;\n appearance: none;\n background-color: ", ";\n\n ", "\n\n padding: 0 !important;\n width: 100%;\n\n ::placeholder {\n ", "\n }\n\n ", " {\n ", "\n\n height: 56px;\n padding: 0 4px !important;\n\n &::placeholder {\n ", "\n }\n }\n\n &.small {\n ", "\n height: 48px;\n padding: 0 !important;\n\n &::placeholder {\n ", "\n }\n }\n\n &.medium {\n ", "\n height: 56px;\n\n &::placeholder {\n ", "\n }\n }\n\n &:hover {\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n &:focus-within {\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n div {\n color: ", ";\n background-color: transparent;\n }\n\n &.invalid {\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n &.disabled {\n box-shadow: inset 0 0 0 1px ", ";\n pointer-events: none;\n background-color: transparent !important;\n }\n\n"])), _index.COLORS.neutral_400, _index.COLORS.white, (0, _styles.ComponentSStyling)(_index.ComponentTextStyle.Regular, _index.COLORS.black), (0, _styles.ComponentSStyling)(_index.ComponentTextStyle.Italic, _index.COLORS.neutral_500), _index.BREAKPOINTS.MEDIUM, (0, _styles.ComponentMStyling)(_index.ComponentTextStyle.Regular, _index.COLORS.black), (0, _styles.ComponentMStyling)(_index.ComponentTextStyle.Italic, _index.COLORS.neutral_500), (0, _styles.ComponentSStyling)(_index.ComponentTextStyle.Regular, _index.COLORS.black), (0, _styles.ComponentSStyling)(_index.ComponentTextStyle.Italic, _index.COLORS.neutral_500), (0, _styles.ComponentMStyling)(_index.ComponentTextStyle.Regular, _index.COLORS.black), (0, _styles.ComponentMStyling)(_index.ComponentTextStyle.Italic, _index.COLORS.neutral_500), _index.COLORS.primary_800, _index.COLORS.primary_800, _index.COLORS.neutral_600, _index.COLORS.critical_400, _index.COLORS.neutral_100);
|
|
47
47
|
|
|
48
48
|
exports.StyledSearchField = StyledSearchField;
|
|
49
49
|
var SearchField = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/InputFields/components/SearchField.tsx"],"names":["SearchFieldWrapper","styled","div","focusStyles","StyledSearchField","COLORS","neutral_400","white","ComponentTextStyle","Regular","black","Italic","neutral_500","BREAKPOINTS","MEDIUM","primary_800","neutral_600","critical_400","neutral_100","SearchField","React","forwardRef","ref","id","searchTerm","disabled","validationMessage","children","size","className","rest","cls","concat"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["../../../src/InputFields/components/SearchField.tsx"],"names":["SearchFieldWrapper","styled","div","focusStyles","StyledSearchField","COLORS","neutral_400","white","ComponentTextStyle","Regular","black","Italic","neutral_500","BREAKPOINTS","MEDIUM","primary_800","neutral_600","critical_400","neutral_100","SearchField","React","forwardRef","ref","id","searchTerm","disabled","validationMessage","children","size","className","rest","cls","concat"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;AAKO,IAAMA,kBAAkB,GAAGC,0BAAOC,GAAV,iIAEzBC,kBAFyB,CAAxB;;;;AAMA,IAAMC,iBAAiB,GAAGH,0BAAOC,GAAV,8nCAGEG,cAAOC,WAHT,EAURD,cAAOE,KAVC,EAY1B,+BAAkBC,0BAAmBC,OAArC,EAA8CJ,cAAOK,KAArD,CAZ0B,EAkBxB,+BAAkBF,0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oB,IAAA,GAAG,EAAEP,GAAzB;AAAA,2BACE,qBAAC,iBAAD;AACE,MAAA,EAAE,YAAKC,EAAL,UADJ;AAEE,+BAAgBA,EAAhB,UAFF;AAGE,MAAA,SAAS,EAAEQ;AAHb,OAIMD,IAJN;AAAA,gBAKGH;AALH;AADF,IADF;AAWD,CA7BmB,CAApB;;AAREJ,EAAAA,E;AACAC,EAAAA,U;AACAC,EAAAA,Q;AACAC,EAAAA,iB;AACAC,EAAAA,Q;;eAmCaR,W","sourcesContent":["import * as React from 'react';\nimport styled, {css, CSSProperties} from 'styled-components';\nimport {BREAKPOINTS, COLORS, ComponentTextStyle, focusStyles} from '../../styles/index';\nimport {ComponentMStyling, ComponentSStyling} from '../../styles';\nimport {Z_INDEXES} from '../../styles/z-indexes';\nimport {Size} from '../../types';\nimport {activeErrorMessageState} from '../styling';\n\nexport const SearchFieldWrapper = styled.div`\n &.focus-visible-within {\n ${focusStyles}\n }\n`;\n\nexport const StyledSearchField = styled.div<{ activeValidationMessage?: boolean; }>`\n display: flex;\n flex-direction: row;\n box-shadow: inset 0 0 0 1px ${COLORS.neutral_400};\n box-sizing: border-box;\n border-radius: 56px;\n align-items: center;\n position: relative;\n height: 48px;\n appearance: none;\n background-color: ${COLORS.white};\n\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}\n\n padding: 0 !important;\n width: 100%;\n\n ::placeholder {\n ${ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_500)}\n }\n\n ${BREAKPOINTS.MEDIUM} {\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.black)}\n\n height: 56px;\n padding: 0 4px !important;\n\n &::placeholder {\n ${ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_500)}\n }\n }\n\n &.small {\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}\n height: 48px;\n padding: 0 !important;\n\n &::placeholder {\n ${ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_500)}\n }\n }\n\n &.medium {\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.black)}\n height: 56px;\n\n &::placeholder {\n ${ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_500)}\n }\n }\n\n &:hover {\n box-shadow: inset 0 0 0 2px ${COLORS.primary_800};\n }\n\n &:focus-within {\n box-shadow: inset 0 0 0 2px ${COLORS.primary_800};\n }\n\n div {\n color: ${COLORS.neutral_600};\n background-color: transparent;\n }\n\n &.invalid {\n box-shadow: inset 0 0 0 2px ${COLORS.critical_400};\n }\n\n &.disabled {\n box-shadow: inset 0 0 0 1px ${COLORS.neutral_100};\n pointer-events: none;\n background-color: transparent !important;\n }\n\n`;\n\ntype SeachFieldProps = React.HTMLAttributes<HTMLDivElement> & {\n id: string;\n searchTerm?: string;\n disabled?: boolean;\n validationMessage?: string;\n children: any;\n size?: Size.Small | Size.Medium;\n};\n\nconst SearchField = React.forwardRef<HTMLDivElement, SeachFieldProps>(({\n id,\n searchTerm,\n disabled,\n validationMessage,\n children,\n size,\n className,\n ...rest\n }, ref) => {\n\n const cls =\n (disabled ? 'disabled ' : '')\n .concat(searchTerm !== '' ? 'searchactive ' : '')\n .concat(size ? `${size} ` : '')\n .concat(validationMessage ? ' invalid ' : '')\n .concat(`${className ?? ''} `);\n\n return (\n <SearchFieldWrapper ref={ref}>\n <StyledSearchField\n id={`${id}_main`}\n data-testid={`${id}_main`}\n className={cls}\n {...rest}>\n {children}\n </StyledSearchField>\n </SearchFieldWrapper>\n );\n});\n\nexport default SearchField;\n"],"file":"SearchField.cjs"}
|
|
@@ -16,7 +16,7 @@ import { BREAKPOINTS, COLORS, ComponentTextStyle, focusStyles } from '../../styl
|
|
|
16
16
|
import { ComponentMStyling, ComponentSStyling } from '../../styles';
|
|
17
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
18
|
export var SearchFieldWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &.focus-visible-within {\n ", "\n }\n"])), focusStyles);
|
|
19
|
-
export var StyledSearchField = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n box-shadow: inset 0 0 0 1px ", ";\n box-sizing: border-box;\n border-radius: 56px;\n align-items: center;\n position: relative;\n height: 48px;\n appearance: none;\n background-color: ", ";\n\n ", "\n\n padding: 0 !important;\n width: 100%;\n\n ::placeholder {\n ", "\n }\n\n ", " {\n ", "\n\n height: 56px;\n padding: 0 4px !important;\n\n &::placeholder {\n ", "\n }\n }\n\n &.small {\n ", "\n height: 48px;\n padding: 0 !important;\n\n &::placeholder {\n ", "\n }\n }\n\n &.medium {\n ", "\n height: 56px;\n\n &::placeholder {\n ", "\n }\n }\n\n &:hover {\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n &:focus-within {\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n div {\n color: ", ";\n background-color: transparent;\n }\n\n &.invalid {\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n &.disabled {\n box-shadow: inset 0 0 0 1px ", ";\n pointer-events: none;\n background-color: transparent !important;\n }\n"])), COLORS.neutral_400, COLORS.white, ComponentSStyling(ComponentTextStyle.Regular, COLORS.black), ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_500), BREAKPOINTS.MEDIUM, ComponentMStyling(ComponentTextStyle.Regular, COLORS.black), ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_500), ComponentSStyling(ComponentTextStyle.Regular, COLORS.black), ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_500), ComponentMStyling(ComponentTextStyle.Regular, COLORS.black), ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_500), COLORS.primary_800, COLORS.primary_800, COLORS.neutral_600, COLORS.critical_400, COLORS.neutral_100);
|
|
19
|
+
export var StyledSearchField = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n box-shadow: inset 0 0 0 1px ", ";\n box-sizing: border-box;\n border-radius: 56px;\n align-items: center;\n position: relative;\n height: 48px;\n appearance: none;\n background-color: ", ";\n\n ", "\n\n padding: 0 !important;\n width: 100%;\n\n ::placeholder {\n ", "\n }\n\n ", " {\n ", "\n\n height: 56px;\n padding: 0 4px !important;\n\n &::placeholder {\n ", "\n }\n }\n\n &.small {\n ", "\n height: 48px;\n padding: 0 !important;\n\n &::placeholder {\n ", "\n }\n }\n\n &.medium {\n ", "\n height: 56px;\n\n &::placeholder {\n ", "\n }\n }\n\n &:hover {\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n &:focus-within {\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n div {\n color: ", ";\n background-color: transparent;\n }\n\n &.invalid {\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n &.disabled {\n box-shadow: inset 0 0 0 1px ", ";\n pointer-events: none;\n background-color: transparent !important;\n }\n\n"])), COLORS.neutral_400, COLORS.white, ComponentSStyling(ComponentTextStyle.Regular, COLORS.black), ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_500), BREAKPOINTS.MEDIUM, ComponentMStyling(ComponentTextStyle.Regular, COLORS.black), ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_500), ComponentSStyling(ComponentTextStyle.Regular, COLORS.black), ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_500), ComponentMStyling(ComponentTextStyle.Regular, COLORS.black), ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_500), COLORS.primary_800, COLORS.primary_800, COLORS.neutral_600, COLORS.critical_400, COLORS.neutral_100);
|
|
20
20
|
var SearchField = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
21
21
|
var id = _ref.id,
|
|
22
22
|
searchTerm = _ref.searchTerm,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/InputFields/components/SearchField.tsx"],"names":["React","styled","BREAKPOINTS","COLORS","ComponentTextStyle","focusStyles","ComponentMStyling","ComponentSStyling","SearchFieldWrapper","div","StyledSearchField","neutral_400","white","Regular","black","Italic","neutral_500","MEDIUM","primary_800","neutral_600","critical_400","neutral_100","SearchField","forwardRef","ref","id","searchTerm","disabled","validationMessage","children","size","className","rest","cls","concat"],"mappings":";;;;;;;;;;;;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,MAAP,
|
|
1
|
+
{"version":3,"sources":["../../../src/InputFields/components/SearchField.tsx"],"names":["React","styled","BREAKPOINTS","COLORS","ComponentTextStyle","focusStyles","ComponentMStyling","ComponentSStyling","SearchFieldWrapper","div","StyledSearchField","neutral_400","white","Regular","black","Italic","neutral_500","MEDIUM","primary_800","neutral_600","critical_400","neutral_100","SearchField","forwardRef","ref","id","searchTerm","disabled","validationMessage","children","size","className","rest","cls","concat"],"mappings":";;;;;;;;;;;;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,MAAP,MAAyC,mBAAzC;AACA,SAAQC,WAAR,EAAqBC,MAArB,EAA6BC,kBAA7B,EAAiDC,WAAjD,QAAmE,oBAAnE;AACA,SAAQC,iBAAR,EAA2BC,iBAA3B,QAAmD,cAAnD;;AAKA,OAAO,IAAMC,kBAAkB,GAAGP,MAAM,CAACQ,GAAV,mHAEzBJ,WAFyB,CAAxB;AAMP,OAAO,IAAMK,iBAAiB,GAAGT,MAAM,CAACQ,GAAV,gnCAGEN,MAAM,CAACQ,WAHT,EAURR,MAAM,CAACS,KAVC,EAY1BL,iBAAiB,CAACH,kBAAkB,CAACS,OAApB,EAA6BV,MAAM,CAACW,KAApC,CAZS,EAkBxBP,iBAAiB,CAACH,kBAAkB,CAACW,MAApB,EAA4BZ,MAAM,CAACa,WAAnC,CAlBO,EAqB1Bd,WAAW,CAACe,MArBc,EAsBxBX,iBAAiB,CAACF,kBAAkB,CAACS,OAApB,EAA6BV,MAAM,CAACW,KAApC,CAtBO,EA4BtBR,iBAAiB,CAACF,kBAAkB,CAACW,MAApB,EAA4BZ,MAAM,CAACa,WAAnC,CA5BK,EAiCxBT,iBAAiB,CAAC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SAAS,EAAEQ;AAHb,OAIMD,IAJN;AAAA,gBAKGH;AALH;AADF,IADF;AAWD,CA7BmB,CAApB;;AAREJ,EAAAA,E;AACAC,EAAAA,U;AACAC,EAAAA,Q;AACAC,EAAAA,iB;AACAC,EAAAA,Q;;AAmCF,eAAeP,WAAf","sourcesContent":["import * as React from 'react';\nimport styled, {css, CSSProperties} from 'styled-components';\nimport {BREAKPOINTS, COLORS, ComponentTextStyle, focusStyles} from '../../styles/index';\nimport {ComponentMStyling, ComponentSStyling} from '../../styles';\nimport {Z_INDEXES} from '../../styles/z-indexes';\nimport {Size} from '../../types';\nimport {activeErrorMessageState} from '../styling';\n\nexport const SearchFieldWrapper = styled.div`\n &.focus-visible-within {\n ${focusStyles}\n }\n`;\n\nexport const StyledSearchField = styled.div<{ activeValidationMessage?: boolean; }>`\n display: flex;\n flex-direction: row;\n box-shadow: inset 0 0 0 1px ${COLORS.neutral_400};\n box-sizing: border-box;\n border-radius: 56px;\n align-items: center;\n position: relative;\n height: 48px;\n appearance: none;\n background-color: ${COLORS.white};\n\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}\n\n padding: 0 !important;\n width: 100%;\n\n ::placeholder {\n ${ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_500)}\n }\n\n ${BREAKPOINTS.MEDIUM} {\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.black)}\n\n height: 56px;\n padding: 0 4px !important;\n\n &::placeholder {\n ${ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_500)}\n }\n }\n\n &.small {\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}\n height: 48px;\n padding: 0 !important;\n\n &::placeholder {\n ${ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_500)}\n }\n }\n\n &.medium {\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.black)}\n height: 56px;\n\n &::placeholder {\n ${ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_500)}\n }\n }\n\n &:hover {\n box-shadow: inset 0 0 0 2px ${COLORS.primary_800};\n }\n\n &:focus-within {\n box-shadow: inset 0 0 0 2px ${COLORS.primary_800};\n }\n\n div {\n color: ${COLORS.neutral_600};\n background-color: transparent;\n }\n\n &.invalid {\n box-shadow: inset 0 0 0 2px ${COLORS.critical_400};\n }\n\n &.disabled {\n box-shadow: inset 0 0 0 1px ${COLORS.neutral_100};\n pointer-events: none;\n background-color: transparent !important;\n }\n\n`;\n\ntype SeachFieldProps = React.HTMLAttributes<HTMLDivElement> & {\n id: string;\n searchTerm?: string;\n disabled?: boolean;\n validationMessage?: string;\n children: any;\n size?: Size.Small | Size.Medium;\n};\n\nconst SearchField = React.forwardRef<HTMLDivElement, SeachFieldProps>(({\n id,\n searchTerm,\n disabled,\n validationMessage,\n children,\n size,\n className,\n ...rest\n }, ref) => {\n\n const cls =\n (disabled ? 'disabled ' : '')\n .concat(searchTerm !== '' ? 'searchactive ' : '')\n .concat(size ? `${size} ` : '')\n .concat(validationMessage ? ' invalid ' : '')\n .concat(`${className ?? ''} `);\n\n return (\n <SearchFieldWrapper ref={ref}>\n <StyledSearchField\n id={`${id}_main`}\n data-testid={`${id}_main`}\n className={cls}\n {...rest}>\n {children}\n </StyledSearchField>\n </SearchFieldWrapper>\n );\n});\n\nexport default SearchField;\n"],"file":"SearchField.js"}
|