@egov3/system-design 1.3.94 → 1.3.95
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/cjs/baseComponents/SearchBar/SearchBar.module.css.js +22 -0
- package/dist/cjs/baseComponents/SearchBar/SearchBar.module.css.js.map +1 -0
- package/dist/cjs/baseComponents/SearchBar/index.js +48 -0
- package/dist/cjs/baseComponents/SearchBar/index.js.map +1 -0
- package/dist/cjs/baseComponents/index.js +30 -28
- package/dist/cjs/baseComponents/index.js.map +1 -1
- package/dist/cjs/components/Messages/MsgSearch/MsgSearch.module.css.js +2 -2
- package/dist/cjs/components/Messages/MsgSearch/index.js +5 -14
- package/dist/cjs/components/Messages/MsgSearch/index.js.map +1 -1
- package/dist/esm/baseComponents/SearchBar/SearchBar.module.css.js +18 -0
- package/dist/esm/baseComponents/SearchBar/SearchBar.module.css.js.map +1 -0
- package/dist/esm/baseComponents/SearchBar/index.js +46 -0
- package/dist/esm/baseComponents/SearchBar/index.js.map +1 -0
- package/dist/esm/baseComponents/index.js +6 -4
- package/dist/esm/baseComponents/index.js.map +1 -1
- package/dist/esm/components/Messages/MsgSearch/MsgSearch.module.css.js +2 -2
- package/dist/esm/components/Messages/MsgSearch/index.js +2 -11
- package/dist/esm/components/Messages/MsgSearch/index.js.map +1 -1
- package/dist/types/baseComponents/SearchBar/index.d.ts +13 -0
- package/dist/types/components/Messages/MsgSearch/index.d.ts +1 -1
- package/dist/types/index.d.ts +11 -9
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var css_248z = ".SearchBar-module_searchLayout__VCBFD {\n display: flex;\n align-items: center;\n gap: 8px;\n width: 100%;\n}\n\n.SearchBar-module_searchIcon__w5c7b > :first-child {\n fill: var(--icon-secondary-color);\n}\n\n.SearchBar-module_clearIcon__tlykn > :first-child {\n fill: var(--icon-secondary-color);\n}\n\n.SearchBar-module_clearIcon__tlykn svg {\n width: 20px;\n height: 20px;\n flex-shrink: 0;\n}\n\n.SearchBar-module_loadingIcon__v-WG9 {\n animation: SearchBar-module_loading__qptyx 1s linear infinite;\n}\n\n.SearchBar-module_loadingIcon__v-WG9 > :first-child {\n fill: var(--icon-accent-color);\n}\n\n@keyframes SearchBar-module_loading__qptyx {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n.SearchBar-module_inputContainer__jvbxZ {\n display: flex;\n align-items: center;\n gap: 8px;\n flex: 1 0 0;\n border-radius: 8px;\n}\n\n.SearchBar-module_inputContainer--modal__5Ayyp {\n padding: 12px 16px;\n background: var(--surface-surface-white-nonconvert);\n box-shadow: 0 12px 32px 0 rgba(128, 130, 136, 0.5);\n}\n\n.SearchBar-module_inputContainer--default__82CUU {\n padding: 12px 16px;\n background: var(--surface-surface-1);\n}\n\n.SearchBar-module_inputContainer--chat__fXYm9 {\n padding: 6px 12px;\n background: var(--surface-surface-white-nonconvert);\n}\n\n.SearchBar-module_input__eZosz::placeholder {\n color: var(--text-disabled-color);\n}\n\n.SearchBar-module_iconWrapper__VHJrg {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.SearchBar-module_inputContainer--modal__5Ayyp .SearchBar-module_iconWrapper__VHJrg,\n.SearchBar-module_inputContainer--default__82CUU .SearchBar-module_iconWrapper__VHJrg,\n.SearchBar-module_inputContainer--modal__5Ayyp .SearchBar-module_clearIcon__tlykn,\n.SearchBar-module_inputContainer--default__82CUU .SearchBar-module_clearIcon__tlykn {\n height: 20px;\n width: 20px;\n}\n\n.SearchBar-module_inputContainer--chat__fXYm9 .SearchBar-module_iconWrapper__VHJrg,\n.SearchBar-module_inputContainer--chat__fXYm9 .SearchBar-module_clearIcon__tlykn {\n height: 16px;\n width: 16px;\n}\n\n.SearchBar-module_inputContainer--modal__5Ayyp input,\n.SearchBar-module_inputContainer--default__82CUU input {\n height: 24px;\n}\n\n.SearchBar-module_inputContainer--chat__fXYm9 input {\n height: 20px;\n}\n\n.SearchBar-module_input__eZosz {\n outline: none;\n border: none;\n width: 100%;\n background: transparent;\n}\n\n.SearchBar-module_input__eZosz:focus {\n caret-color: var(--default-primary-accent);\n}\n\nbutton {\n background: transparent;\n margin: 0;\n padding: 0;\n border: none;\n cursor: pointer;\n line-height: 0;\n}\n";
|
|
6
|
+
var styles = {"searchLayout":"SearchBar-module_searchLayout__VCBFD","searchIcon":"SearchBar-module_searchIcon__w5c7b","clearIcon":"SearchBar-module_clearIcon__tlykn","loadingIcon":"SearchBar-module_loadingIcon__v-WG9","loading":"SearchBar-module_loading__qptyx","inputContainer":"SearchBar-module_inputContainer__jvbxZ","inputContainer--modal":"SearchBar-module_inputContainer--modal__5Ayyp","inputContainer--default":"SearchBar-module_inputContainer--default__82CUU","inputContainer--chat":"SearchBar-module_inputContainer--chat__fXYm9","input":"SearchBar-module_input__eZosz","iconWrapper":"SearchBar-module_iconWrapper__VHJrg"};
|
|
7
|
+
function styleInject(css, options) {
|
|
8
|
+
if (typeof document === 'undefined') return;
|
|
9
|
+
const head = document.head || document.getElementsByTagName('head')[0];
|
|
10
|
+
const style = document.createElement('style');
|
|
11
|
+
style.type = 'text/css';
|
|
12
|
+
if (style.styleSheet) {
|
|
13
|
+
style.styleSheet.cssText = css;
|
|
14
|
+
} else {
|
|
15
|
+
style.appendChild(document.createTextNode(css));
|
|
16
|
+
}
|
|
17
|
+
head.appendChild(style);
|
|
18
|
+
}
|
|
19
|
+
styleInject(css_248z);
|
|
20
|
+
|
|
21
|
+
exports.default = styles;
|
|
22
|
+
//# sourceMappingURL=SearchBar.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchBar.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var graphics = require('@egov3/graphics');
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var index = require('../../constants/i18n/index.js');
|
|
7
|
+
var joinClasses = require('../../utils/joinClasses.js');
|
|
8
|
+
var typography_module = require('../../styles/typography.module.css.js');
|
|
9
|
+
var SearchBar_module = require('./SearchBar.module.css.js');
|
|
10
|
+
|
|
11
|
+
const langDic = index.i18n.MsgSearch;
|
|
12
|
+
const SearchBar = ({ lang, handleModalOpen, handleOnEnter, variant = "default", loading = false, disabled = false, defaultValue = "", showClearButton = true, }) => {
|
|
13
|
+
const [value, setValue] = React.useState(defaultValue);
|
|
14
|
+
const inputRef = React.useRef(null);
|
|
15
|
+
const handleKeyDown = React.useCallback((event) => {
|
|
16
|
+
if (disabled || loading)
|
|
17
|
+
return;
|
|
18
|
+
if (event.key === "Enter") {
|
|
19
|
+
event.preventDefault();
|
|
20
|
+
if (handleOnEnter && value.trim()) {
|
|
21
|
+
handleOnEnter(value.trim());
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}, [disabled, loading, handleOnEnter, value]);
|
|
25
|
+
const handleClear = React.useCallback(() => {
|
|
26
|
+
if (disabled || loading)
|
|
27
|
+
return;
|
|
28
|
+
setValue("");
|
|
29
|
+
if (handleOnEnter) {
|
|
30
|
+
handleOnEnter("");
|
|
31
|
+
}
|
|
32
|
+
inputRef.current?.focus();
|
|
33
|
+
}, [disabled, loading, handleOnEnter]);
|
|
34
|
+
const handleInputClick = React.useCallback((event) => {
|
|
35
|
+
if (variant === "modal") {
|
|
36
|
+
event.stopPropagation();
|
|
37
|
+
if (handleModalOpen && !disabled) {
|
|
38
|
+
handleModalOpen();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}, [variant, handleModalOpen, disabled]);
|
|
42
|
+
const inputContainerClasses = joinClasses.joinClasses(SearchBar_module.default.inputContainer, SearchBar_module.default[`inputContainer--${variant}`]);
|
|
43
|
+
const inputClasses = joinClasses.joinClasses(SearchBar_module.default.input, variant === "chat" ? typography_module.default.body2Regular : typography_module.default.body1Regular);
|
|
44
|
+
return (jsxRuntime.jsx("div", { "data-testid": "SearchBar_WRAPPER", className: SearchBar_module.default.searchLayout, "data-variant": variant, "data-loading": loading, "data-disabled": disabled, children: jsxRuntime.jsxs("div", { "data-testid": "SearchBar_INPUT_CONTAINER_WRAPPER", className: inputContainerClasses, children: [jsxRuntime.jsx("div", { className: SearchBar_module.default.iconWrapper, children: loading ? (jsxRuntime.jsx(graphics.Icons.General.Loader, { className: SearchBar_module.default.loadingIcon, "data-testid": "SearchBar_LOADING_ICON" })) : (jsxRuntime.jsx(graphics.Icons.General.Search, { className: SearchBar_module.default.searchIcon, "data-testid": "SearchBar_SEARCH_ICON" })) }), jsxRuntime.jsx("input", { ref: inputRef, "data-testid": "SearchBar_INPUT", value: value, onChange: (e) => setValue(e.target.value), disabled: disabled, readOnly: variant === "modal", "aria-label": langDic.MsgSearchInputPlaceHolder[lang], placeholder: langDic.MsgSearchInputPlaceHolder[lang], onClick: handleInputClick, onKeyDown: variant === "modal" ? undefined : handleKeyDown, className: inputClasses }), showClearButton && value.length > 0 && variant !== "modal" && (jsxRuntime.jsx("button", { "data-testid": "SearchBar_CLEAR_BUTTON", type: "button", onClick: handleClear, className: SearchBar_module.default.clearButton, "aria-label": "Clear search", disabled: disabled, children: jsxRuntime.jsx(graphics.Icons.General.Clear, { className: SearchBar_module.default.clearIcon, "data-testid": "SearchBar_CLEAR_ICON" }) }))] }) }));
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
exports.SearchBar = SearchBar;
|
|
48
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/baseComponents/SearchBar/index.tsx"],"sourcesContent":[null],"names":["i18n","useState","useRef","useCallback","joinClasses","styles","typography","_jsx","_jsxs","Icons"],"mappings":";;;;;;;;;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K,CAAC,EACzC,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,OAAO,KAAK,OAAO,EAAA,YAAA,EACjB,OAAO,CAAC,yBAAyB,CAAC,IAAI,CAAC,EACnD,WAAW,EAAE,OAAO,CAAC,yBAAyB,CAAC,IAAI,CAAC,EACpD,OAAO,EAAE,gBAAgB,EACzB,SAAS,EAAE,OAAO,KAAK,OAAO,GAAG,SAAS,GAAG,aAAa,EAC1D,SAAS,EAAE,YAAY,GACvB,EACD,eAAe,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,OAAO,KAAK,OAAO,KACzDA,cAAA,CAAA,QAAA,EAAA,EAAA,aAAA,EACc,wBAAwB,EACpC,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,WAAW,EACpB,SAAS,EAAEF,wBAAM,CAAC,WAAW,EAAA,YAAA,EAClB,cAAc,EACzB,QAAQ,EAAE,QAAQ,EAAA,QAAA,EAElBE,cAAA,CAACE,cAAK,CAAC,OAAO,CAAC,KAAK,EAAA,EAClB,SAAS,EAAEJ,wBAAM,CAAC,SAAS,EAAA,aAAA,EACf,sBAAsB,EAAA,CAClC,GACK,CACV,CAAA,EAAA,CACG,EAAA,CACF;AAEV;;;;"}
|
|
@@ -1,41 +1,43 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
require('../styles/colors.css.js');
|
|
4
|
-
var index$
|
|
5
|
-
var index$
|
|
6
|
-
var index$
|
|
7
|
-
var index$
|
|
8
|
-
var index$
|
|
9
|
-
var index$
|
|
10
|
-
var index$
|
|
11
|
-
var index = require('./Overlay/index.js');
|
|
4
|
+
var index$g = require('./Accordion/index.js');
|
|
5
|
+
var index$f = require('./Button/index.js');
|
|
6
|
+
var index$e = require('./InputField/index.js');
|
|
7
|
+
var index$d = require('./InputFieldGroup/index.js');
|
|
8
|
+
var index$c = require('./Label/index.js');
|
|
9
|
+
var index$b = require('./Loader/index.js');
|
|
10
|
+
var index$a = require('./Modal/index.js');
|
|
11
|
+
var index$9 = require('./Overlay/index.js');
|
|
12
12
|
var index$8 = require('./RadioGroup/index.js');
|
|
13
13
|
var index$7 = require('./RadioToggle/index.js');
|
|
14
|
-
var index$6 = require('./
|
|
15
|
-
var index$
|
|
16
|
-
var index$
|
|
17
|
-
var index$
|
|
18
|
-
var index$
|
|
19
|
-
var index$
|
|
14
|
+
var index$6 = require('./SearchBar/index.js');
|
|
15
|
+
var index$5 = require('./SelectBoxButton/index.js');
|
|
16
|
+
var index$4 = require('./StatusText/index.js');
|
|
17
|
+
var index$3 = require('./TabButtons/index.js');
|
|
18
|
+
var index$2 = require('./TextareaField/index.js');
|
|
19
|
+
var index$1 = require('./TextPair/index.js');
|
|
20
|
+
var index = require('./Typography/index.js');
|
|
20
21
|
|
|
21
22
|
const BaseComponents = {
|
|
22
|
-
Accordion: index$
|
|
23
|
-
Button: index$
|
|
23
|
+
Accordion: index$g.Accordion,
|
|
24
|
+
Button: index$f.Button,
|
|
24
25
|
CustomRadioButton: index$8.CustomRadioButton,
|
|
25
|
-
InputField: index$
|
|
26
|
-
InputFieldGroup: index$
|
|
27
|
-
Label: index$
|
|
28
|
-
Loader: index$
|
|
29
|
-
Modal: index$
|
|
26
|
+
InputField: index$e.InputField,
|
|
27
|
+
InputFieldGroup: index$d.InputFieldGroup,
|
|
28
|
+
Label: index$c.Label,
|
|
29
|
+
Loader: index$b.Loader,
|
|
30
|
+
Modal: index$a.Modal,
|
|
31
|
+
Overlay: index$9.Overlay,
|
|
30
32
|
RadioGroup: index$8.RadioGroup,
|
|
31
33
|
RadioToggle: index$7.RadioToggle,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
SearchBar: index$6.SearchBar,
|
|
35
|
+
SelectBoxButton: index$5.SelectBoxButton,
|
|
36
|
+
StatusText: index$4.StatusText,
|
|
37
|
+
TabButtons: index$3.TabButtons,
|
|
38
|
+
TextareaField: index$2.TextareaField,
|
|
39
|
+
TextPair: index$1.TextPair,
|
|
40
|
+
Typography: index.Typography,
|
|
39
41
|
};
|
|
40
42
|
|
|
41
43
|
exports.BaseComponents = BaseComponents;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/baseComponents/index.ts"],"sourcesContent":[null],"names":["Accordion","Button","CustomRadioButton","InputField","InputFieldGroup","Label","Loader","Modal","RadioGroup","RadioToggle","
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/baseComponents/index.ts"],"sourcesContent":[null],"names":["Accordion","Button","CustomRadioButton","InputField","InputFieldGroup","Label","Loader","Modal","Overlay","RadioGroup","RadioToggle","SearchBar","SelectBoxButton","StatusText","TabButtons","TextareaField","TextPair","Typography"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAoBO,MAAM,cAAc,GAAG;eAC5BA,iBAAS;YACTC,cAAM;uBACNC,yBAAiB;gBACjBC,kBAAU;qBACVC,uBAAe;WACfC,aAAK;YACLC,cAAM;WACNC,aAAK;aACLC,eAAO;gBACPC,kBAAU;iBACVC,mBAAW;eACXC,iBAAS;qBACTC,uBAAe;gBACfC,kBAAU;gBACVC,kBAAU;mBACVC,qBAAa;cACbC,gBAAQ;gBACRC,gBAAU;;;;;"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var css_248z = ".MsgSearch-module_searchLayout__8bgGo {\n display: flex;\n align-items: center;\n gap: 8px;\n width: 100%;\n}\n
|
|
6
|
-
var styles = {"searchLayout":"MsgSearch-module_searchLayout__8bgGo"
|
|
5
|
+
var css_248z = ".MsgSearch-module_searchLayout__8bgGo {\n display: flex;\n align-items: center;\n gap: 8px;\n width: 100%;\n}\n";
|
|
6
|
+
var styles = {"searchLayout":"MsgSearch-module_searchLayout__8bgGo"};
|
|
7
7
|
function styleInject(css, options) {
|
|
8
8
|
if (typeof document === 'undefined') return;
|
|
9
9
|
const head = document.head || document.getElementsByTagName('head')[0];
|
|
@@ -1,22 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var index$1 = require('../../../baseComponents/index.js');
|
|
7
|
-
var index = require('../../../constants/i18n/index.js');
|
|
4
|
+
var index = require('../../../baseComponents/index.js');
|
|
5
|
+
var index$1 = require('../../../constants/i18n/index.js');
|
|
8
6
|
var MsgSearch_module = require('./MsgSearch.module.css.js');
|
|
9
7
|
|
|
10
|
-
const langDic = index.i18n.MsgSearch;
|
|
11
|
-
const MsgSearch = ({ lang, handleClose,
|
|
12
|
-
|
|
13
|
-
return (jsxRuntime.jsxs("div", { "data-testid": "MsgSearch_WRAPPER", className: MsgSearch_module.default.searchLayout, children: [jsxRuntime.jsxs("div", { "data-testid": "InputContainer_WRAPPER", className: MsgSearch_module.default.inputContainer, children: [jsxRuntime.jsx(graphics.Icons.General.Search, { width: 16, height: 16, className: MsgSearch_module.default.searchIcon }), jsxRuntime.jsx("input", { "data-testid": "MsgSearch_INPUT", value: value, "aria-label": langDic.MsgSearchInputPlaceHolder[lang], placeholder: langDic.MsgSearchInputPlaceHolder[lang], onChange: (e) => {
|
|
14
|
-
setValue(e.target.value);
|
|
15
|
-
handleInputChange(e.target.value);
|
|
16
|
-
}, className: MsgSearch_module.default.input }), value && (jsxRuntime.jsx(graphics.Icons.General.Clear, { width: 16, height: 16, className: MsgSearch_module.default.clearIcon, onClick: () => {
|
|
17
|
-
setValue("");
|
|
18
|
-
handleInputChange("");
|
|
19
|
-
} }))] }), jsxRuntime.jsx(index$1.BaseComponents.Button, { "data-testid": "MsgSearch_CLOSE", "aria-label": langDic.MsgSearchButton[lang], size: "small", variant: "tinted", onClick: handleClose, children: langDic.MsgSearchButton[lang] })] }));
|
|
8
|
+
const langDic = index$1.i18n.MsgSearch;
|
|
9
|
+
const MsgSearch = ({ lang, handleClose, handleOnEnter, }) => {
|
|
10
|
+
return (jsxRuntime.jsxs("div", { "data-testid": "MsgSearch_WRAPPER", className: MsgSearch_module.default.searchLayout, children: [jsxRuntime.jsx(index.BaseComponents.SearchBar, { variant: "chat", lang: lang, handleOnEnter: handleOnEnter }), jsxRuntime.jsx(index.BaseComponents.Button, { "data-testid": "MsgSearch_CLOSE", "aria-label": langDic.MsgSearchButton[lang], size: "small", variant: "tinted", onClick: handleClose, children: langDic.MsgSearchButton[lang] })] }));
|
|
20
11
|
};
|
|
21
12
|
|
|
22
13
|
exports.MsgSearch = MsgSearch;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/Messages/MsgSearch/index.tsx"],"sourcesContent":[null],"names":["i18n","
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/Messages/MsgSearch/index.tsx"],"sourcesContent":[null],"names":["i18n","_jsxs","styles","_jsx","BaseComponents"],"mappings":";;;;;;;AAUA,MAAM,OAAO,GAAGA,YAAI,CAAC,SAAS;AAEvB,MAAM,SAAS,GAAG,CAAC,EACxB,IAAI,EACJ,WAAW,EACX,aAAa,GACG,KAAI;AACpB,IAAA,QACEC,eAAA,CAAA,KAAA,EAAA,EAAA,aAAA,EAAiB,mBAAmB,EAAC,SAAS,EAAEC,wBAAM,CAAC,YAAY,EAAA,QAAA,EAAA,CACjEC,cAAA,CAACC,oBAAc,CAAC,SAAS,EAAA,EACvB,OAAO,EAAC,MAAM,EACd,IAAI,EAAE,IAAI,EACV,aAAa,EAAE,aAAa,EAAA,CAC5B,EACFD,eAACC,oBAAc,CAAC,MAAM,EAAA,EAAA,aAAA,EACR,iBAAiB,EAAA,YAAA,EACjB,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,EACzC,IAAI,EAAC,OAAO,EACZ,OAAO,EAAC,QAAQ,EAChB,OAAO,EAAE,WAAW,EAAA,QAAA,EAEnB,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,EAAA,CACR,CAAA,EAAA,CACpB;AAEV;;;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var css_248z = ".SearchBar-module_searchLayout__VCBFD {\n display: flex;\n align-items: center;\n gap: 8px;\n width: 100%;\n}\n\n.SearchBar-module_searchIcon__w5c7b > :first-child {\n fill: var(--icon-secondary-color);\n}\n\n.SearchBar-module_clearIcon__tlykn > :first-child {\n fill: var(--icon-secondary-color);\n}\n\n.SearchBar-module_clearIcon__tlykn svg {\n width: 20px;\n height: 20px;\n flex-shrink: 0;\n}\n\n.SearchBar-module_loadingIcon__v-WG9 {\n animation: SearchBar-module_loading__qptyx 1s linear infinite;\n}\n\n.SearchBar-module_loadingIcon__v-WG9 > :first-child {\n fill: var(--icon-accent-color);\n}\n\n@keyframes SearchBar-module_loading__qptyx {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n.SearchBar-module_inputContainer__jvbxZ {\n display: flex;\n align-items: center;\n gap: 8px;\n flex: 1 0 0;\n border-radius: 8px;\n}\n\n.SearchBar-module_inputContainer--modal__5Ayyp {\n padding: 12px 16px;\n background: var(--surface-surface-white-nonconvert);\n box-shadow: 0 12px 32px 0 rgba(128, 130, 136, 0.5);\n}\n\n.SearchBar-module_inputContainer--default__82CUU {\n padding: 12px 16px;\n background: var(--surface-surface-1);\n}\n\n.SearchBar-module_inputContainer--chat__fXYm9 {\n padding: 6px 12px;\n background: var(--surface-surface-white-nonconvert);\n}\n\n.SearchBar-module_input__eZosz::placeholder {\n color: var(--text-disabled-color);\n}\n\n.SearchBar-module_iconWrapper__VHJrg {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.SearchBar-module_inputContainer--modal__5Ayyp .SearchBar-module_iconWrapper__VHJrg,\n.SearchBar-module_inputContainer--default__82CUU .SearchBar-module_iconWrapper__VHJrg,\n.SearchBar-module_inputContainer--modal__5Ayyp .SearchBar-module_clearIcon__tlykn,\n.SearchBar-module_inputContainer--default__82CUU .SearchBar-module_clearIcon__tlykn {\n height: 20px;\n width: 20px;\n}\n\n.SearchBar-module_inputContainer--chat__fXYm9 .SearchBar-module_iconWrapper__VHJrg,\n.SearchBar-module_inputContainer--chat__fXYm9 .SearchBar-module_clearIcon__tlykn {\n height: 16px;\n width: 16px;\n}\n\n.SearchBar-module_inputContainer--modal__5Ayyp input,\n.SearchBar-module_inputContainer--default__82CUU input {\n height: 24px;\n}\n\n.SearchBar-module_inputContainer--chat__fXYm9 input {\n height: 20px;\n}\n\n.SearchBar-module_input__eZosz {\n outline: none;\n border: none;\n width: 100%;\n background: transparent;\n}\n\n.SearchBar-module_input__eZosz:focus {\n caret-color: var(--default-primary-accent);\n}\n\nbutton {\n background: transparent;\n margin: 0;\n padding: 0;\n border: none;\n cursor: pointer;\n line-height: 0;\n}\n";
|
|
2
|
+
var styles = {"searchLayout":"SearchBar-module_searchLayout__VCBFD","searchIcon":"SearchBar-module_searchIcon__w5c7b","clearIcon":"SearchBar-module_clearIcon__tlykn","loadingIcon":"SearchBar-module_loadingIcon__v-WG9","loading":"SearchBar-module_loading__qptyx","inputContainer":"SearchBar-module_inputContainer__jvbxZ","inputContainer--modal":"SearchBar-module_inputContainer--modal__5Ayyp","inputContainer--default":"SearchBar-module_inputContainer--default__82CUU","inputContainer--chat":"SearchBar-module_inputContainer--chat__fXYm9","input":"SearchBar-module_input__eZosz","iconWrapper":"SearchBar-module_iconWrapper__VHJrg"};
|
|
3
|
+
function styleInject(css, options) {
|
|
4
|
+
if (typeof document === 'undefined') return;
|
|
5
|
+
const head = document.head || document.getElementsByTagName('head')[0];
|
|
6
|
+
const style = document.createElement('style');
|
|
7
|
+
style.type = 'text/css';
|
|
8
|
+
if (style.styleSheet) {
|
|
9
|
+
style.styleSheet.cssText = css;
|
|
10
|
+
} else {
|
|
11
|
+
style.appendChild(document.createTextNode(css));
|
|
12
|
+
}
|
|
13
|
+
head.appendChild(style);
|
|
14
|
+
}
|
|
15
|
+
styleInject(css_248z);
|
|
16
|
+
|
|
17
|
+
export { styles as default };
|
|
18
|
+
//# sourceMappingURL=SearchBar.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchBar.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { Icons } from '@egov3/graphics';
|
|
3
|
+
import { useState, useRef, useCallback } from 'react';
|
|
4
|
+
import { i18n } from '../../constants/i18n/index.js';
|
|
5
|
+
import { joinClasses } from '../../utils/joinClasses.js';
|
|
6
|
+
import typography from '../../styles/typography.module.css.js';
|
|
7
|
+
import styles from './SearchBar.module.css.js';
|
|
8
|
+
|
|
9
|
+
const langDic = i18n.MsgSearch;
|
|
10
|
+
const SearchBar = ({ lang, handleModalOpen, handleOnEnter, variant = "default", loading = false, disabled = false, defaultValue = "", showClearButton = true, }) => {
|
|
11
|
+
const [value, setValue] = useState(defaultValue);
|
|
12
|
+
const inputRef = useRef(null);
|
|
13
|
+
const handleKeyDown = useCallback((event) => {
|
|
14
|
+
if (disabled || loading)
|
|
15
|
+
return;
|
|
16
|
+
if (event.key === "Enter") {
|
|
17
|
+
event.preventDefault();
|
|
18
|
+
if (handleOnEnter && value.trim()) {
|
|
19
|
+
handleOnEnter(value.trim());
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}, [disabled, loading, handleOnEnter, value]);
|
|
23
|
+
const handleClear = useCallback(() => {
|
|
24
|
+
if (disabled || loading)
|
|
25
|
+
return;
|
|
26
|
+
setValue("");
|
|
27
|
+
if (handleOnEnter) {
|
|
28
|
+
handleOnEnter("");
|
|
29
|
+
}
|
|
30
|
+
inputRef.current?.focus();
|
|
31
|
+
}, [disabled, loading, handleOnEnter]);
|
|
32
|
+
const handleInputClick = useCallback((event) => {
|
|
33
|
+
if (variant === "modal") {
|
|
34
|
+
event.stopPropagation();
|
|
35
|
+
if (handleModalOpen && !disabled) {
|
|
36
|
+
handleModalOpen();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}, [variant, handleModalOpen, disabled]);
|
|
40
|
+
const inputContainerClasses = joinClasses(styles.inputContainer, styles[`inputContainer--${variant}`]);
|
|
41
|
+
const inputClasses = joinClasses(styles.input, variant === "chat" ? typography.body2Regular : typography.body1Regular);
|
|
42
|
+
return (jsx("div", { "data-testid": "SearchBar_WRAPPER", className: styles.searchLayout, "data-variant": variant, "data-loading": loading, "data-disabled": disabled, children: jsxs("div", { "data-testid": "SearchBar_INPUT_CONTAINER_WRAPPER", className: inputContainerClasses, children: [jsx("div", { className: styles.iconWrapper, children: loading ? (jsx(Icons.General.Loader, { className: styles.loadingIcon, "data-testid": "SearchBar_LOADING_ICON" })) : (jsx(Icons.General.Search, { className: styles.searchIcon, "data-testid": "SearchBar_SEARCH_ICON" })) }), jsx("input", { ref: inputRef, "data-testid": "SearchBar_INPUT", value: value, onChange: (e) => setValue(e.target.value), disabled: disabled, readOnly: variant === "modal", "aria-label": langDic.MsgSearchInputPlaceHolder[lang], placeholder: langDic.MsgSearchInputPlaceHolder[lang], onClick: handleInputClick, onKeyDown: variant === "modal" ? undefined : handleKeyDown, className: inputClasses }), showClearButton && value.length > 0 && variant !== "modal" && (jsx("button", { "data-testid": "SearchBar_CLEAR_BUTTON", type: "button", onClick: handleClear, className: styles.clearButton, "aria-label": "Clear search", disabled: disabled, children: jsx(Icons.General.Clear, { className: styles.clearIcon, "data-testid": "SearchBar_CLEAR_ICON" }) }))] }) }));
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export { SearchBar };
|
|
46
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/baseComponents/SearchBar/index.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;AAkBA,MAAM,OA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AO,KAAK,OAAO,EAAA,YAAA,EACjB,OAAO,CAAC,yBAAyB,CAAC,IAAI,CAAC,EACnD,WAAW,EAAE,OAAO,CAAC,yBAAyB,CAAC,IAAI,CAAC,EACpD,OAAO,EAAE,gBAAgB,EACzB,SAAS,EAAE,OAAO,KAAK,OAAO,GAAG,SAAS,GAAG,aAAa,EAC1D,SAAS,EAAE,YAAY,GACvB,EACD,eAAe,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,OAAO,KAAK,OAAO,KACzDA,GAAA,CAAA,QAAA,EAAA,EAAA,aAAA,EACc,wBAAwB,EACpC,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,MAAM,CAAC,WAAW,EAAA,YAAA,EAClB,cAAc,EACzB,QAAQ,EAAE,QAAQ,EAAA,QAAA,EAElBA,GAAA,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAA,EAClB,SAAS,EAAE,MAAM,CAAC,SAAS,EAAA,aAAA,EACf,sBAAsB,EAAA,CAClC,GACK,CACV,CAAA,EAAA,CACG,EAAA,CACF;AAEV;;;;"}
|
|
@@ -9,6 +9,7 @@ import { Modal } from './Modal/index.js';
|
|
|
9
9
|
import { Overlay } from './Overlay/index.js';
|
|
10
10
|
import { RadioGroup, CustomRadioButton } from './RadioGroup/index.js';
|
|
11
11
|
import { RadioToggle } from './RadioToggle/index.js';
|
|
12
|
+
import { SearchBar } from './SearchBar/index.js';
|
|
12
13
|
import { SelectBoxButton } from './SelectBoxButton/index.js';
|
|
13
14
|
import { StatusText } from './StatusText/index.js';
|
|
14
15
|
import { TabButtons } from './TabButtons/index.js';
|
|
@@ -25,15 +26,16 @@ const BaseComponents = {
|
|
|
25
26
|
Label,
|
|
26
27
|
Loader,
|
|
27
28
|
Modal,
|
|
29
|
+
Overlay,
|
|
28
30
|
RadioGroup,
|
|
29
31
|
RadioToggle,
|
|
32
|
+
SearchBar,
|
|
30
33
|
SelectBoxButton,
|
|
31
|
-
|
|
34
|
+
StatusText,
|
|
35
|
+
TabButtons,
|
|
32
36
|
TextareaField,
|
|
33
37
|
TextPair,
|
|
34
|
-
|
|
35
|
-
StatusText,
|
|
36
|
-
Overlay,
|
|
38
|
+
Typography,
|
|
37
39
|
};
|
|
38
40
|
|
|
39
41
|
export { BaseComponents };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/baseComponents/index.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/baseComponents/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAoBO,MAAM,cAAc,GAAG;IAC5B,SAAS;IACT,MAAM;IACN,iBAAiB;IACjB,UAAU;IACV,eAAe;IACf,KAAK;IACL,MAAM;IACN,KAAK;IACL,OAAO;IACP,UAAU;IACV,WAAW;IACX,SAAS;IACT,eAAe;IACf,UAAU;IACV,UAAU;IACV,aAAa;IACb,QAAQ;IACR,UAAU;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var css_248z = ".MsgSearch-module_searchLayout__8bgGo {\n display: flex;\n align-items: center;\n gap: 8px;\n width: 100%;\n}\n
|
|
2
|
-
var styles = {"searchLayout":"MsgSearch-module_searchLayout__8bgGo"
|
|
1
|
+
var css_248z = ".MsgSearch-module_searchLayout__8bgGo {\n display: flex;\n align-items: center;\n gap: 8px;\n width: 100%;\n}\n";
|
|
2
|
+
var styles = {"searchLayout":"MsgSearch-module_searchLayout__8bgGo"};
|
|
3
3
|
function styleInject(css, options) {
|
|
4
4
|
if (typeof document === 'undefined') return;
|
|
5
5
|
const head = document.head || document.getElementsByTagName('head')[0];
|
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { Icons } from '@egov3/graphics';
|
|
3
|
-
import { useState } from 'react';
|
|
4
2
|
import { BaseComponents } from '../../../baseComponents/index.js';
|
|
5
3
|
import { i18n } from '../../../constants/i18n/index.js';
|
|
6
4
|
import styles from './MsgSearch.module.css.js';
|
|
7
5
|
|
|
8
6
|
const langDic = i18n.MsgSearch;
|
|
9
|
-
const MsgSearch = ({ lang, handleClose,
|
|
10
|
-
|
|
11
|
-
return (jsxs("div", { "data-testid": "MsgSearch_WRAPPER", className: styles.searchLayout, children: [jsxs("div", { "data-testid": "InputContainer_WRAPPER", className: styles.inputContainer, children: [jsx(Icons.General.Search, { width: 16, height: 16, className: styles.searchIcon }), jsx("input", { "data-testid": "MsgSearch_INPUT", value: value, "aria-label": langDic.MsgSearchInputPlaceHolder[lang], placeholder: langDic.MsgSearchInputPlaceHolder[lang], onChange: (e) => {
|
|
12
|
-
setValue(e.target.value);
|
|
13
|
-
handleInputChange(e.target.value);
|
|
14
|
-
}, className: styles.input }), value && (jsx(Icons.General.Clear, { width: 16, height: 16, className: styles.clearIcon, onClick: () => {
|
|
15
|
-
setValue("");
|
|
16
|
-
handleInputChange("");
|
|
17
|
-
} }))] }), jsx(BaseComponents.Button, { "data-testid": "MsgSearch_CLOSE", "aria-label": langDic.MsgSearchButton[lang], size: "small", variant: "tinted", onClick: handleClose, children: langDic.MsgSearchButton[lang] })] }));
|
|
7
|
+
const MsgSearch = ({ lang, handleClose, handleOnEnter, }) => {
|
|
8
|
+
return (jsxs("div", { "data-testid": "MsgSearch_WRAPPER", className: styles.searchLayout, children: [jsx(BaseComponents.SearchBar, { variant: "chat", lang: lang, handleOnEnter: handleOnEnter }), jsx(BaseComponents.Button, { "data-testid": "MsgSearch_CLOSE", "aria-label": langDic.MsgSearchButton[lang], size: "small", variant: "tinted", onClick: handleClose, children: langDic.MsgSearchButton[lang] })] }));
|
|
18
9
|
};
|
|
19
10
|
|
|
20
11
|
export { MsgSearch };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/Messages/MsgSearch/index.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/Messages/MsgSearch/index.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":";;;;;AAUA,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS;AAEvB,MAAM,SAAS,GAAG,CAAC,EACxB,IAAI,EACJ,WAAW,EACX,aAAa,GACG,KAAI;AACpB,IAAA,QACEA,IAAA,CAAA,KAAA,EAAA,EAAA,aAAA,EAAiB,mBAAmB,EAAC,SAAS,EAAE,MAAM,CAAC,YAAY,EAAA,QAAA,EAAA,CACjEC,GAAA,CAAC,cAAc,CAAC,SAAS,EAAA,EACvB,OAAO,EAAC,MAAM,EACd,IAAI,EAAE,IAAI,EACV,aAAa,EAAE,aAAa,EAAA,CAC5B,EACFA,IAAC,cAAc,CAAC,MAAM,EAAA,EAAA,aAAA,EACR,iBAAiB,EAAA,YAAA,EACjB,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,EACzC,IAAI,EAAC,OAAO,EACZ,OAAO,EAAC,QAAQ,EAChB,OAAO,EAAE,WAAW,EAAA,QAAA,EAEnB,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,EAAA,CACR,CAAA,EAAA,CACpB;AAEV;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ILangProps } from '../../interfaces/common/index.js';
|
|
2
|
+
|
|
3
|
+
interface ISearchBarProps extends ILangProps {
|
|
4
|
+
handleModalOpen?: () => void;
|
|
5
|
+
handleOnEnter?: (value: string) => void;
|
|
6
|
+
variant?: "modal" | "chat" | "default";
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
defaultValue?: string;
|
|
10
|
+
showClearButton?: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type { ISearchBarProps };
|
|
@@ -2,7 +2,7 @@ import { ILangProps } from '../../../interfaces/common/index.js';
|
|
|
2
2
|
|
|
3
3
|
interface IMsgSearchProps extends ILangProps {
|
|
4
4
|
handleClose: () => void;
|
|
5
|
-
|
|
5
|
+
handleOnEnter: (value: string) => void;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
export type { IMsgSearchProps };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -19,14 +19,15 @@ import { IEdsSuccessProps } from './components/Identity/EdsSuccess/index.js';
|
|
|
19
19
|
import { IDocCardProps } from './components/Profile/DocCard/index.js';
|
|
20
20
|
import { IAuthStepProps } from './components/Identity/Auth/index.js';
|
|
21
21
|
import { IAgreementStepProps } from './components/Identity/Agreement/index.js';
|
|
22
|
-
import {
|
|
23
|
-
import { IStatusTextProps } from './baseComponents/StatusText/index.js';
|
|
24
|
-
import { ITabButtonsProps } from './baseComponents/TabButtons/index.js';
|
|
22
|
+
import { ITypographyProps } from './baseComponents/Typography/index.js';
|
|
25
23
|
import { ITextPairProps } from './baseComponents/TextPair/index.js';
|
|
26
24
|
import { ITextareaFieldProps } from './baseComponents/TextareaField/index.js';
|
|
27
|
-
import {
|
|
25
|
+
import { ITabButtonsProps } from './baseComponents/TabButtons/index.js';
|
|
26
|
+
import { IStatusTextProps } from './baseComponents/StatusText/index.js';
|
|
28
27
|
import { ISelectBoxProps } from './baseComponents/SelectBoxButton/index.js';
|
|
28
|
+
import { ISearchBarProps } from './baseComponents/SearchBar/index.js';
|
|
29
29
|
import { IRadioToggleProps } from './baseComponents/RadioToggle/index.js';
|
|
30
|
+
import { IOverlayProps } from './baseComponents/Overlay/index.js';
|
|
30
31
|
import { IModalProps } from './baseComponents/Modal/index.js';
|
|
31
32
|
import { ILabelProps } from './baseComponents/Label/index.js';
|
|
32
33
|
import { IInputFieldGroupProps } from './baseComponents/InputFieldGroup/index.js';
|
|
@@ -47,15 +48,16 @@ declare const SystemDesign: {
|
|
|
47
48
|
Label: ({ variant, text, isSpaced, Icon, onAction, }: ILabelProps) => react_jsx_runtime.JSX.Element;
|
|
48
49
|
Loader: () => react_jsx_runtime.JSX.Element;
|
|
49
50
|
Modal: ({ children, header, lang, open, setOpen, variant, withOverlay, }: IModalProps) => react_jsx_runtime.JSX.Element;
|
|
51
|
+
Overlay: ({ children, className }: IOverlayProps) => react_jsx_runtime.JSX.Element;
|
|
50
52
|
RadioGroup: ({ radioGroupItems, setSelectedOption, selectedOption, }: IRadioGroupProps) => react_jsx_runtime.JSX.Element;
|
|
51
53
|
RadioToggle: ({ lock, setLock }: IRadioToggleProps) => react_jsx_runtime.JSX.Element;
|
|
54
|
+
SearchBar: ({ lang, handleModalOpen, handleOnEnter, variant, loading, disabled, defaultValue, showClearButton, }: ISearchBarProps) => react_jsx_runtime.JSX.Element;
|
|
52
55
|
SelectBoxButton: ({ handleClick, labelText, disabled, error, modalValue, lang, }: ISelectBoxProps) => react_jsx_runtime.JSX.Element;
|
|
53
|
-
|
|
56
|
+
StatusText: ({ text, isAlignedCenter, isNeedIcon, variant, }: IStatusTextProps) => react_jsx_runtime.JSX.Element;
|
|
57
|
+
TabButtons: ({ tabDocLabels, activeTab, handleClick, }: ITabButtonsProps) => react_jsx_runtime.JSX.Element;
|
|
54
58
|
TextareaField: React.ForwardRefExoticComponent<ITextareaFieldProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
55
59
|
TextPair: ({ mainText, secondaryText, variant, }: ITextPairProps) => react_jsx_runtime.JSX.Element;
|
|
56
|
-
|
|
57
|
-
StatusText: ({ text, isAlignedCenter, isNeedIcon, variant, }: IStatusTextProps) => react_jsx_runtime.JSX.Element;
|
|
58
|
-
Overlay: ({ children, className }: IOverlayProps) => react_jsx_runtime.JSX.Element;
|
|
60
|
+
Typography: React.FC<ITypographyProps>;
|
|
59
61
|
};
|
|
60
62
|
Components: {
|
|
61
63
|
Agreement: ({ lang, agreementText, submitAgreementAndSign, }: IAgreementStepProps) => react_jsx_runtime.JSX.Element;
|
|
@@ -73,7 +75,7 @@ declare const SystemDesign: {
|
|
|
73
75
|
IdentityModal: ({ children, goBackService, handleLangChange, isMain, lang, navigator, }: IIdentityModalProps) => react_jsx_runtime.JSX.Element;
|
|
74
76
|
MsgBody: ({ msgItem, lang, handleDetailsClick, }: IMsgBodyProps) => react_jsx_runtime.JSX.Element;
|
|
75
77
|
MsgComponentHeader: ({ lang, headerText, headerAriaLabel, handleOpenSearch, handleReadAll, }: MsgComponentHeaderProps) => react_jsx_runtime.JSX.Element;
|
|
76
|
-
MsgSearch: ({ lang, handleClose,
|
|
78
|
+
MsgSearch: ({ lang, handleClose, handleOnEnter, }: IMsgSearchProps) => react_jsx_runtime.JSX.Element;
|
|
77
79
|
NextStepComponent: ({ disabled, handleNextStepClick, lang, }: INextStepComponentProps) => react_jsx_runtime.JSX.Element;
|
|
78
80
|
ProfileHealthGeneral: ({ lang, attachedClinic, compulsoryHealthInsurance, }: IProfileHealthGeneral) => react_jsx_runtime.JSX.Element;
|
|
79
81
|
RightMenuSectionItem: ({ title, btnText, btnOnClick, ariaLabel, btnVariant, }: IRightMenuSectionItemProps) => react_jsx_runtime.JSX.Element;
|