@abihealth/goapp-react-native 1.17.0 → 1.18.1

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.
Files changed (36) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/common/assets/ChevronIcon.d.ts +6 -0
  3. package/dist/common/assets/ChevronIcon.js +43 -0
  4. package/dist/common/assets/ChevronIcon.tsx +12 -0
  5. package/dist/common/assets/SearchGlassIcon.d.ts +3 -0
  6. package/dist/common/assets/SearchGlassIcon.js +48 -0
  7. package/dist/common/assets/SearchGlassIcon.tsx +19 -0
  8. package/dist/common/components/AnswerScreen/PrescriptionCard/index.js +1 -1
  9. package/dist/common/icons/CloseIcon.d.ts +3 -1
  10. package/dist/common/icons/CloseIcon.js +2 -2
  11. package/dist/common/screens/AnswerScreen.js +2 -1
  12. package/dist/form-prescriptions/api/prescription.d.ts +3 -1
  13. package/dist/form-prescriptions/api/prescription.js +6 -1
  14. package/dist/form-prescriptions/components/FormPrescription.js +0 -2
  15. package/dist/form-prescriptions/components/IndicationCategory.d.ts +3 -0
  16. package/dist/form-prescriptions/components/IndicationCategory.js +75 -0
  17. package/dist/form-prescriptions/components/IndicationSurveyButton.d.ts +1 -1
  18. package/dist/form-prescriptions/components/IndicationSurveyButton.js +10 -8
  19. package/dist/form-prescriptions/components/Questionnaire/QuestionnaireQuestion/OpenEnded.js +1 -1
  20. package/dist/form-prescriptions/components/Questionnaire/QuestionnaireQuestion/SingleChoice.js +3 -3
  21. package/dist/form-prescriptions/components/SearchableDropdown.d.ts +90 -0
  22. package/dist/form-prescriptions/components/SearchableDropdown.js +212 -0
  23. package/dist/form-prescriptions/contexts/IndicationSurveyContext.js +6 -0
  24. package/dist/form-prescriptions/hooks/useIndicationSurvey.d.ts +3 -2
  25. package/dist/form-prescriptions/hooks/useIndicationSurvey.js +9 -1
  26. package/dist/form-prescriptions/mocks/indication-survey.d.ts +2 -2
  27. package/dist/form-prescriptions/mocks/indication-survey.js +44 -44
  28. package/dist/form-prescriptions/screens/HomeScreen.js +18 -33
  29. package/dist/form-prescriptions/types/indications.d.ts +2 -2
  30. package/dist/index.d.ts +5 -3
  31. package/dist/index.js +7 -3
  32. package/dist/video-consultations/screens/DeliveryAddressScreen.js +1 -2
  33. package/dist/video-consultations/screens/ProcessingPrescriptionScreen.js +3 -2
  34. package/package.json +13 -13
  35. package/dist/common/api/models/common.d.ts +0 -3
  36. package/dist/common/api/models/common.js +0 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.18.1](https://github.com/abiglobalhealth/react-native-sdk/compare/goapp-react-native-v1.18.0...goapp-react-native-v1.18.1) (2025-03-19)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * undefined processing prescription screen in custom components ([#146](https://github.com/abiglobalhealth/react-native-sdk/issues/146)) ([9d9a6f4](https://github.com/abiglobalhealth/react-native-sdk/commit/9d9a6f44d37581bdbc1883ff55a93a4fda4f7a93))
9
+
10
+ ## [1.18.0](https://github.com/abiglobalhealth/react-native-sdk/compare/goapp-react-native-v1.17.0...goapp-react-native-v1.18.0) (2025-03-19)
11
+
12
+
13
+ ### Features
14
+
15
+ * Add indication survey and searchable dropdown features ([#139](https://github.com/abiglobalhealth/react-native-sdk/issues/139)) ([782b022](https://github.com/abiglobalhealth/react-native-sdk/commit/782b022ce2d693c3746c2635120b03a02a56c13f))
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * answer screen theme in prescription card ([#145](https://github.com/abiglobalhealth/react-native-sdk/issues/145)) ([0f321a1](https://github.com/abiglobalhealth/react-native-sdk/commit/0f321a12ebb693c4e1c29c824a76c1b260524ad3))
21
+
3
22
  ## [1.17.0](https://github.com/abiglobalhealth/react-native-sdk/compare/goapp-react-native-v1.16.0...goapp-react-native-v1.17.0) (2025-03-18)
4
23
 
5
24
 
@@ -0,0 +1,6 @@
1
+ import { ColorValue, ViewStyle } from 'react-native';
2
+ declare const ChevronIcon: ({ color, style }: {
3
+ color: ColorValue;
4
+ style?: ViewStyle;
5
+ }) => import("react").JSX.Element;
6
+ export default ChevronIcon;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ var react_native_svg_1 = __importStar(require("react-native-svg"));
37
+ var ChevronIcon = function (_a) {
38
+ var color = _a.color, style = _a.style;
39
+ return (<react_native_svg_1.default width={12} height={8} fill="none" viewBox="0 0 12 8" style={style}>
40
+ <react_native_svg_1.Path fill={color} d="M5.997 7.381a.93.93 0 0 1-.71-.287L.239 2.046A.815.815 0 0 1 0 1.46.794.794 0 0 1 .24.863.807.807 0 0 1 .83.619c.231 0 .429.081.592.244l4.574 4.574L10.572.863a.814.814 0 0 1 .587-.239.795.795 0 0 1 .597.239c.163.162.244.36.244.591 0 .232-.081.43-.244.592L6.708 7.094a.93.93 0 0 1-.71.287Z"/>
41
+ </react_native_svg_1.default>);
42
+ };
43
+ exports.default = ChevronIcon;
@@ -0,0 +1,12 @@
1
+ import { ColorValue, ViewStyle } from 'react-native'
2
+ import Svg, { Path } from 'react-native-svg'
3
+
4
+ const ChevronIcon = ({ color, style }: { color: ColorValue; style?: ViewStyle }) => (
5
+ <Svg width={12} height={8} fill="none" viewBox="0 0 12 8" style={style}>
6
+ <Path
7
+ fill={color}
8
+ d="M5.997 7.381a.93.93 0 0 1-.71-.287L.239 2.046A.815.815 0 0 1 0 1.46.794.794 0 0 1 .24.863.807.807 0 0 1 .83.619c.231 0 .429.081.592.244l4.574 4.574L10.572.863a.814.814 0 0 1 .587-.239.795.795 0 0 1 .597.239c.163.162.244.36.244.591 0 .232-.081.43-.244.592L6.708 7.094a.93.93 0 0 1-.71.287Z"
9
+ />
10
+ </Svg>
11
+ )
12
+ export default ChevronIcon
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ declare const SearchGlassIcon: () => React.JSX.Element;
3
+ export default SearchGlassIcon;
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ var React = __importStar(require("react"));
37
+ var react_native_svg_1 = __importStar(require("react-native-svg"));
38
+ var SearchGlassIcon = function () { return (<react_native_svg_1.default width={24} height={24} fill="none">
39
+ <react_native_svg_1.G clipPath="url(#a)">
40
+ <react_native_svg_1.Path fill="#757575" d="m23.485 21.487-4.594-4.594a10.44 10.44 0 0 0 2.157-6.367c0-2.811-1.095-5.455-3.084-7.443A10.457 10.457 0 0 0 10.521 0a10.457 10.457 0 0 0-7.443 3.083c-4.104 4.104-4.104 10.782 0 14.886a10.456 10.456 0 0 0 7.443 3.083 10.44 10.44 0 0 0 6.367-2.156l4.594 4.595c.277.276.64.415 1.002.415s.725-.139 1.001-.415a1.416 1.416 0 0 0 0-2.004ZM5.081 15.966c-3-3-2.999-7.88 0-10.88a7.644 7.644 0 0 1 5.44-2.253c2.055 0 3.987.8 5.44 2.253a7.643 7.643 0 0 1 2.253 5.44c0 2.055-.8 3.987-2.253 5.44a7.642 7.642 0 0 1-5.44 2.253c-2.055 0-3.987-.8-5.44-2.253Z"/>
41
+ </react_native_svg_1.G>
42
+ <react_native_svg_1.Defs>
43
+ <react_native_svg_1.ClipPath id="a">
44
+ <react_native_svg_1.Path fill="#fff" d="M0 0h24v24H0z"/>
45
+ </react_native_svg_1.ClipPath>
46
+ </react_native_svg_1.Defs>
47
+ </react_native_svg_1.default>); };
48
+ exports.default = SearchGlassIcon;
@@ -0,0 +1,19 @@
1
+ import * as React from 'react'
2
+ import Svg, { ClipPath, Defs, G, Path } from 'react-native-svg'
3
+
4
+ const SearchGlassIcon = () => (
5
+ <Svg width={24} height={24} fill="none">
6
+ <G clipPath="url(#a)">
7
+ <Path
8
+ fill="#757575"
9
+ d="m23.485 21.487-4.594-4.594a10.44 10.44 0 0 0 2.157-6.367c0-2.811-1.095-5.455-3.084-7.443A10.457 10.457 0 0 0 10.521 0a10.457 10.457 0 0 0-7.443 3.083c-4.104 4.104-4.104 10.782 0 14.886a10.456 10.456 0 0 0 7.443 3.083 10.44 10.44 0 0 0 6.367-2.156l4.594 4.595c.277.276.64.415 1.002.415s.725-.139 1.001-.415a1.416 1.416 0 0 0 0-2.004ZM5.081 15.966c-3-3-2.999-7.88 0-10.88a7.644 7.644 0 0 1 5.44-2.253c2.055 0 3.987.8 5.44 2.253a7.643 7.643 0 0 1 2.253 5.44c0 2.055-.8 3.987-2.253 5.44a7.642 7.642 0 0 1-5.44 2.253c-2.055 0-3.987-.8-5.44-2.253Z"
10
+ />
11
+ </G>
12
+ <Defs>
13
+ <ClipPath id="a">
14
+ <Path fill="#fff" d="M0 0h24v24H0z" />
15
+ </ClipPath>
16
+ </Defs>
17
+ </Svg>
18
+ )
19
+ export default SearchGlassIcon
@@ -22,7 +22,7 @@ var PrescriptionCard = function (_a) {
22
22
  var screens = (0, useCustomComponents_1.useCustomComponents)().screens;
23
23
  var medication = [prescription.data.medication, prescription.data.quantity].join(', ');
24
24
  return (<Card_1.Card type="prescription" style={[styles.container, (_c = (_b = screens === null || screens === void 0 ? void 0 : screens.AnswerScreen) === null || _b === void 0 ? void 0 : _b.prescriptionCard) === null || _c === void 0 ? void 0 : _c.containerStyle]}>
25
- {((_e = (_d = screens.AnswerScreen) === null || _d === void 0 ? void 0 : _d.prescriptionCard) === null || _e === void 0 ? void 0 : _e.customComponent) ? (<screens.AnswerScreen.prescriptionCard.customComponent prescription={prescription}/>) : (<react_native_1.View style={styles.innerContainer}>
25
+ {((_e = (_d = screens === null || screens === void 0 ? void 0 : screens.AnswerScreen) === null || _d === void 0 ? void 0 : _d.prescriptionCard) === null || _e === void 0 ? void 0 : _e.customComponent) ? (<screens.AnswerScreen.prescriptionCard.customComponent prescription={prescription}/>) : (<react_native_1.View style={styles.innerContainer}>
26
26
  <react_native_1.View style={styles.header}>
27
27
  <PillsIcon_1.PillsIcon />
28
28
  <Text_1.Text bold>{t('prescription.request.details')}</Text_1.Text>
@@ -1,5 +1,7 @@
1
1
  import React from 'react';
2
2
  import { ColorValue } from 'react-native';
3
- export declare const CloseIcon: ({ color }: {
3
+ export declare const CloseIcon: ({ color, width, height }: {
4
4
  color?: ColorValue;
5
+ width?: number;
6
+ height?: number;
5
7
  }) => React.JSX.Element;
@@ -41,10 +41,10 @@ var useTheme_1 = require("../hooks/useTheme");
41
41
  var react_1 = __importDefault(require("react"));
42
42
  var react_native_svg_1 = __importStar(require("react-native-svg"));
43
43
  var CloseIcon = function (_a) {
44
- var color = _a.color;
44
+ var color = _a.color, _b = _a.width, width = _b === void 0 ? 20 : _b, _c = _a.height, height = _c === void 0 ? 20 : _c;
45
45
  var palette = (0, useTheme_1.useTheme)().palette;
46
46
  var parsedColor = color || palette.white;
47
- return (<react_native_svg_1.default width={20} height={20} viewBox="0 0 20 20" fill="none">
47
+ return (<react_native_svg_1.default width={width} height={height} viewBox="0 0 20 20" fill="none">
48
48
  <react_native_svg_1.Path d="M19.2969 1.39831C18.8039 0.884786 18.0076 0.884786 17.5146 1.39831L11.3333 7.82396L5.15207 1.38514C4.65908 0.871619 3.86272 0.871619 3.36974 1.38514C2.87675 1.89867 2.87675 2.72821 3.36974 3.24174L9.551 9.68056L3.36974 16.1194C2.87675 16.6329 2.87675 17.4624 3.36974 17.976C3.86272 18.4895 4.65908 18.4895 5.15207 17.976L11.3333 11.5371L17.5146 17.976C18.0076 18.4895 18.8039 18.4895 19.2969 17.976C19.7899 17.4624 19.7899 16.6329 19.2969 16.1194L13.1157 9.68056L19.2969 3.24174C19.7773 2.74138 19.7773 1.89867 19.2969 1.39831Z" fill={parsedColor}/>
49
49
  </react_native_svg_1.default>);
50
50
  };
@@ -60,7 +60,8 @@ var AnswerScreen = function (_a) {
60
60
  var scrollRef = (0, react_1.useRef)(null);
61
61
  var consultation = (0, useConsultation_1.useConsultation)().consultation;
62
62
  var _c = (0, react_1.useState)(false), showCloseConsultation = _c[0], setShowCloseConsultation = _c[1];
63
- var AnswerScreen = (0, useCustomComponents_1.useCustomComponents)().screens.AnswerScreen;
63
+ var screens = (0, useCustomComponents_1.useCustomComponents)().screens;
64
+ var AnswerScreen = screens === null || screens === void 0 ? void 0 : screens.AnswerScreen;
64
65
  var scrollEnd = function () { var _a; return (_a = scrollRef.current) === null || _a === void 0 ? void 0 : _a.scrollToEnd({ animated: true }); };
65
66
  (0, react_1.useEffect)(function () { return scrollEnd(); }, [showCloseConsultation]);
66
67
  (0, react_1.useEffect)(function () {
@@ -1,2 +1,4 @@
1
- import { IndicationCategory } from './models/prescription';
1
+ import { IndicationCategory } from '../api/models/prescription';
2
+ import { IndicationSurveyQuestions } from '../types/indications';
2
3
  export declare const getIndicationSurveyList: () => Promise<IndicationCategory[]>;
4
+ export declare const getIndicationSurvey: (id: string) => Promise<IndicationSurveyQuestions>;
@@ -3,8 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getIndicationSurveyList = void 0;
6
+ exports.getIndicationSurvey = exports.getIndicationSurveyList = void 0;
7
7
  var axios_1 = __importDefault(require("axios"));
8
8
  var INDICATION_SURVEY_LIST_URL = '/prescription/indication-survey/list';
9
+ var INDICATION_SURVEY_URL = '/prescription/indication-survey/';
9
10
  var getIndicationSurveyList = function () { return axios_1.default.get(INDICATION_SURVEY_LIST_URL).then(function (response) { return response === null || response === void 0 ? void 0 : response.data; }); };
10
11
  exports.getIndicationSurveyList = getIndicationSurveyList;
12
+ var getIndicationSurvey = function (id) {
13
+ return axios_1.default.get("".concat(INDICATION_SURVEY_URL).concat(id)).then(function (response) { return response === null || response === void 0 ? void 0 : response.data; });
14
+ };
15
+ exports.getIndicationSurvey = getIndicationSurvey;
@@ -35,8 +35,6 @@ var ConsultationScreen = function () {
35
35
  var commonScreen = (0, screens_1.getCommonScreen)(consultation);
36
36
  if (commonScreen)
37
37
  return commonScreen;
38
- if (!consultation)
39
- return <HomeScreen_1.HomeScreen />;
40
38
  var status = consultation.status;
41
39
  switch (status) {
42
40
  default:
@@ -0,0 +1,3 @@
1
+ import { IndicationCategory as IndicationCategoryProps } from '../api/models/prescription';
2
+ export declare const IndicationCategory: ({ iconUrl, textKey, indications }: IndicationCategoryProps) => import("react").JSX.Element;
3
+ export default IndicationCategory;
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.IndicationCategory = void 0;
7
+ var ChevronIcon_1 = __importDefault(require("../../common/assets/ChevronIcon"));
8
+ var Text_1 = require("../../common/components/Text");
9
+ var useTheme_1 = require("../../common/hooks/useTheme");
10
+ var react_1 = require("react");
11
+ var react_i18next_1 = require("react-i18next");
12
+ var react_native_1 = require("react-native");
13
+ var react_native_svg_1 = require("react-native-svg");
14
+ var IndicationSurveyButton_1 = __importDefault(require("./IndicationSurveyButton"));
15
+ var IndicationCategory = function (_a) {
16
+ var iconUrl = _a.iconUrl, textKey = _a.textKey, indications = _a.indications;
17
+ var t = (0, react_i18next_1.useTranslation)().t;
18
+ var theme = (0, useTheme_1.useTheme)();
19
+ var styles = getStyles(theme);
20
+ var _b = (0, react_1.useState)(false), open = _b[0], setOpen = _b[1];
21
+ return (<react_native_1.View style={styles.container}>
22
+ <react_native_1.View style={styles.titleContainer}>
23
+ <react_native_1.View style={styles.titleWrapper}>
24
+ <react_native_svg_1.SvgUri uri={iconUrl} style={styles.icon} accessibilityLabel={t(textKey)} width={16} height={16}/>
25
+ <Text_1.Text bold style={styles.title}>
26
+ {t(textKey)}
27
+ </Text_1.Text>
28
+ </react_native_1.View>
29
+ <react_native_1.TouchableOpacity onPress={function () { return setOpen(!open); }}>
30
+ <ChevronIcon_1.default color={open ? theme.palette.primary.base : theme.palette.black} style={open ? { transform: [{ rotate: '180deg' }] } : undefined}/>
31
+ </react_native_1.TouchableOpacity>
32
+ </react_native_1.View>
33
+ <react_native_1.View style={[styles.buttonsContainer, { display: open ? 'flex' : 'none' }]}>
34
+ {indications.map(function (indication) { return (<IndicationSurveyButton_1.default key={indication.textKey} {...indication}/>); })}
35
+ </react_native_1.View>
36
+ </react_native_1.View>);
37
+ };
38
+ exports.IndicationCategory = IndicationCategory;
39
+ exports.default = exports.IndicationCategory;
40
+ var getStyles = function (_a) {
41
+ var palette = _a.palette, spacing = _a.spacing;
42
+ return react_native_1.StyleSheet.create({
43
+ container: {
44
+ width: '100%',
45
+ paddingVertical: spacing.md,
46
+ borderBottomWidth: 1,
47
+ borderBottomColor: palette.white
48
+ },
49
+ titleContainer: {
50
+ justifyContent: 'space-between',
51
+ flexDirection: 'row',
52
+ alignItems: 'center',
53
+ flex: 1,
54
+ width: '100%'
55
+ },
56
+ titleWrapper: {
57
+ flexDirection: 'row',
58
+ overflow: 'hidden',
59
+ alignItems: 'center',
60
+ marginRight: spacing.sm,
61
+ flex: 1
62
+ },
63
+ buttonsContainer: {
64
+ width: '100%',
65
+ paddingTop: spacing.md,
66
+ gap: spacing.xs
67
+ },
68
+ icon: {
69
+ marginRight: spacing.xs
70
+ },
71
+ title: {
72
+ textTransform: 'uppercase'
73
+ }
74
+ });
75
+ };
@@ -1,3 +1,3 @@
1
1
  import { IndicationSurveyList } from '../api/models/prescription';
2
- export declare const IndicationSurveyButton: ({ iconUrl, textKey }: IndicationSurveyList) => import("react").JSX.Element;
2
+ export declare const IndicationSurveyButton: ({ iconUrl, id, textKey }: IndicationSurveyList) => import("react").JSX.Element;
3
3
  export default IndicationSurveyButton;
@@ -3,17 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.IndicationSurveyButton = void 0;
4
4
  var Text_1 = require("../../common/components/Text");
5
5
  var useTheme_1 = require("../../common/hooks/useTheme");
6
+ var useIndicationSurvey_1 = require("../hooks/useIndicationSurvey");
6
7
  var react_i18next_1 = require("react-i18next");
7
8
  var react_native_1 = require("react-native");
9
+ var react_native_svg_1 = require("react-native-svg");
8
10
  var IndicationSurveyButton = function (_a) {
9
- var iconUrl = _a.iconUrl, textKey = _a.textKey;
11
+ var iconUrl = _a.iconUrl, id = _a.id, textKey = _a.textKey;
10
12
  var t = (0, react_i18next_1.useTranslation)().t;
11
13
  var theme = (0, useTheme_1.useTheme)();
12
14
  var styles = getStyles(theme);
13
- return (<react_native_1.View style={[styles.container, theme.shadows.soft]}>
14
- <react_native_1.Image source={{ uri: iconUrl }} style={styles.icon} accessibilityLabel={t(textKey)}/>
15
+ var onSelectIndication = (0, useIndicationSurvey_1.useIndicationSurvey)().onSelectIndication;
16
+ return (<react_native_1.TouchableOpacity style={[styles.container, theme.shadows.soft]} onPress={function () { return onSelectIndication(id.toString()); }}>
17
+ <react_native_svg_1.SvgUri uri={iconUrl} style={styles.icon} accessibilityLabel={t(textKey)} width={16} height={16}/>
15
18
  <Text_1.Text>{t(textKey)}</Text_1.Text>
16
- </react_native_1.View>);
19
+ </react_native_1.TouchableOpacity>);
17
20
  };
18
21
  exports.IndicationSurveyButton = IndicationSurveyButton;
19
22
  exports.default = exports.IndicationSurveyButton;
@@ -21,16 +24,15 @@ var getStyles = function (_a) {
21
24
  var borderRadius = _a.borderRadius, palette = _a.palette, spacing = _a.spacing;
22
25
  return react_native_1.StyleSheet.create({
23
26
  container: {
27
+ width: '100%',
24
28
  borderRadius: borderRadius.md,
25
29
  backgroundColor: palette.white,
26
30
  flexDirection: 'row',
27
- alignItems: 'flex-start',
28
- justifyContent: 'center',
31
+ alignItems: 'center',
29
32
  padding: spacing.sm
30
33
  },
31
34
  icon: {
32
- width: 16,
33
- height: 16
35
+ marginRight: spacing.xs
34
36
  }
35
37
  });
36
38
  };
@@ -60,7 +60,7 @@ var OpenEnded = function () {
60
60
  return __generator(this, function (_a) {
61
61
  addAnswer({
62
62
  id: 'textArea',
63
- value: data.answer
63
+ value: (data === null || data === void 0 ? void 0 : data.answer) || ''
64
64
  });
65
65
  nextStep();
66
66
  return [2 /*return*/];
@@ -51,8 +51,8 @@ var SingleChoice = function () {
51
51
  return setShowExitLogic(true);
52
52
  addAnswer({
53
53
  id: answer.id,
54
- key: answer.titleKey,
55
- value: t(answer.text)
54
+ key: answer.value,
55
+ value: t(answer.value)
56
56
  });
57
57
  nextStep();
58
58
  };
@@ -65,7 +65,7 @@ var SingleChoice = function () {
65
65
  {currentQuestion.answers
66
66
  .sort(function (a, z) { return a.order - z.order; })
67
67
  .map(function (answer) { return (<Button_1.Button key={answer.id} radio variant="secondary" onPress={function () { return handleSaveAnswer(answer); }}>
68
- {t(answer.text)}
68
+ {t(answer.value)}
69
69
  </Button_1.Button>); })}
70
70
  </>);
71
71
  };
@@ -0,0 +1,90 @@
1
+ import { Theme } from '../../common/types/theme';
2
+ import React from 'react';
3
+ export type Item = {
4
+ label: string;
5
+ category?: string;
6
+ value: string;
7
+ };
8
+ interface SearchableDropDownProps {
9
+ items?: Item[];
10
+ defaultIndex?: number;
11
+ placeholder?: string;
12
+ placeholderTextColor?: string;
13
+ underlineColorAndroid?: string;
14
+ loading?: boolean;
15
+ onTextChange?: (_: string) => void;
16
+ onItemSelect?: (_?: any) => void;
17
+ onFocus?: () => void;
18
+ }
19
+ export declare const SearchableDropDown: (props: SearchableDropDownProps) => React.JSX.Element;
20
+ export declare const getStyles: ({ palette, spacing, font, borderRadius }: Theme) => {
21
+ listContainer: {
22
+ backgroundColor: import("react-native").ColorValue;
23
+ width: "100%";
24
+ paddingHorizontal: number;
25
+ borderRadius: number;
26
+ flex: number;
27
+ minHeight: number;
28
+ };
29
+ itemContainer: {
30
+ width: "100%";
31
+ justifyContent: "center";
32
+ alignSelf: "center";
33
+ borderBottomWidth: number;
34
+ borderBottomColor: import("react-native").ColorValue;
35
+ paddingVertical: number;
36
+ gap: number;
37
+ };
38
+ notFoundContainer: {
39
+ backgroundColor: import("react-native").ColorValue;
40
+ borderRadius: number;
41
+ padding: number;
42
+ };
43
+ itemText: {
44
+ color: import("react-native").ColorValue;
45
+ fontSize: number;
46
+ fontWeight: "bold";
47
+ };
48
+ itemCategory: {
49
+ color: import("react-native").ColorValue;
50
+ fontSize: number;
51
+ paddingLeft: number;
52
+ };
53
+ modal: {
54
+ height: "80%";
55
+ backgroundColor: import("react-native").ColorValue;
56
+ };
57
+ modalContent: {
58
+ padding: number;
59
+ gap: number;
60
+ flex: number;
61
+ };
62
+ wrapperContainer: {
63
+ backgroundColor: import("react-native").ColorValue;
64
+ flexDirection: "row";
65
+ alignItems: "center";
66
+ height: number;
67
+ width: "100%";
68
+ borderColor: import("react-native").ColorValue;
69
+ borderWidth: number;
70
+ borderRadius: number;
71
+ padding: number;
72
+ marginBottom: number;
73
+ flex: number;
74
+ minHeight: number;
75
+ maxHeight: number;
76
+ justifyContent: "space-between";
77
+ };
78
+ input: {
79
+ outlineWidth: number;
80
+ flex: number;
81
+ borderWidth: number;
82
+ paddingHorizontal: number;
83
+ fontSize: number;
84
+ color: import("react-native").ColorValue;
85
+ };
86
+ center: {
87
+ textAlign: "center";
88
+ };
89
+ };
90
+ export {};