@mindly/ui-components 3.1.4 → 3.1.6

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 (115) hide show
  1. package/dist/index.ts +88 -0
  2. package/dist/lib/AppHeader/AppHeader.style.ts +19 -0
  3. package/dist/lib/AppHeader/AppHeader.tsx +23 -0
  4. package/dist/lib/AppHeader/index.ts +1 -0
  5. package/dist/lib/Avatar/Avatar.style.ts +17 -0
  6. package/dist/lib/Avatar/Avatar.tsx +46 -0
  7. package/dist/lib/Avatar/index.ts +1 -0
  8. package/dist/lib/Container/Container.styled.ts +15 -0
  9. package/dist/lib/Container/Container.tsx +15 -0
  10. package/dist/lib/Container/index.ts +1 -0
  11. package/dist/lib/EntryNotFound/EntryNotFound.style.ts +14 -0
  12. package/dist/lib/EntryNotFound/EntryNotFound.tsx +21 -0
  13. package/dist/lib/EntryNotFound/calendar.svg +69 -0
  14. package/dist/lib/EntryNotFound/index.ts +1 -0
  15. package/dist/lib/Filters/ListSelect/ListSelect.style.ts +38 -0
  16. package/dist/lib/Filters/ListSelect/ListSelect.tsx +48 -0
  17. package/dist/lib/Filters/ListSelect/index.ts +1 -0
  18. package/dist/lib/Filters/Range/Range.style.ts +41 -0
  19. package/dist/lib/Filters/Range/Range.tsx +48 -0
  20. package/dist/lib/Filters/Range/index.ts +1 -0
  21. package/dist/lib/Filters/RowSelect/RowSelect.style.ts +30 -0
  22. package/dist/lib/Filters/RowSelect/RowSelect.tsx +38 -0
  23. package/dist/lib/Filters/RowSelect/index.ts +1 -0
  24. package/dist/lib/Filters/Toggle/Toggle.style.ts +14 -0
  25. package/dist/lib/Filters/Toggle/Toggle.tsx +26 -0
  26. package/dist/lib/Filters/Toggle/index.ts +1 -0
  27. package/dist/lib/HorisontalCalendar/HorizontalCalendar.styled.ts +117 -0
  28. package/dist/lib/HorisontalCalendar/HorizontalCalendar.tsx +213 -0
  29. package/dist/lib/HorisontalCalendar/index.ts +1 -0
  30. package/dist/lib/ImageWithFallback/ImageWithFallback.tsx +37 -0
  31. package/dist/lib/LetterAvatar/LetterAvatar.styled.ts +32 -0
  32. package/dist/lib/LetterAvatar/LetterAvatar.tsx +23 -0
  33. package/dist/lib/Modal/Modal.style.ts +12 -0
  34. package/dist/lib/Modal/Modal.tsx +30 -0
  35. package/dist/lib/Modal/index.ts +1 -0
  36. package/dist/lib/ModalCalendar/ModalCalendar.styled.ts +123 -0
  37. package/dist/lib/ModalCalendar/ModalCalendar.tsx +71 -0
  38. package/dist/lib/PersonDateTimeCard/PersonDateTimeCard.styled.ts +36 -0
  39. package/dist/lib/PersonDateTimeCard/PersonDateTimeCard.tsx +32 -0
  40. package/dist/lib/Segment/Segment.style.ts +14 -0
  41. package/dist/lib/Segment/Segment.tsx +29 -0
  42. package/dist/lib/Segment/index.ts +2 -0
  43. package/dist/lib/Segment/types.ts +4 -0
  44. package/dist/lib/SelectImpressionEmoji/ImpressionEmojiEnum.ts +9 -0
  45. package/dist/lib/SelectImpressionEmoji/SelectImpressionEmoji.styled.ts +28 -0
  46. package/dist/lib/SelectImpressionEmoji/SelectImpressionEmoji.tsx +56 -0
  47. package/dist/lib/SelectImpressionEmoji/SelectImpressionEmojiProps.ts +8 -0
  48. package/dist/lib/SelectImpressionEmoji/emojis.ts +9 -0
  49. package/dist/lib/SelectImpressionEmoji/index.tsx +14 -0
  50. package/dist/lib/Theme/global.css +251 -0
  51. package/dist/lib/Theme/mindly_constants.ts +23 -0
  52. package/dist/lib/UsersPsychologistScrollList/UserPsychologistScrollList.styled.ts +61 -0
  53. package/dist/lib/UsersPsychologistScrollList/UsersPsychologistScrollList.tsx +68 -0
  54. package/dist/lib/archived-consultation-card/ArchivedConsultation.test.tsx +9 -0
  55. package/dist/lib/archived-consultation-card/ArchivedConsultationCard.style.ts +72 -0
  56. package/dist/lib/archived-consultation-card/ArchivedConsultationCard.svg +3 -0
  57. package/dist/lib/archived-consultation-card/ArchivedConsultationCard.tsx +61 -0
  58. package/dist/lib/button/Button.style.ts +170 -0
  59. package/dist/lib/button/Button.test.tsx +39 -0
  60. package/dist/lib/button/Button.tsx +47 -0
  61. package/dist/lib/consultation-card/ConsultationCard.style.ts +119 -0
  62. package/dist/lib/consultation-card/ConsultationCard.test.tsx +65 -0
  63. package/dist/lib/consultation-card/ConsultationCard.tsx +155 -0
  64. package/dist/lib/consultation-card/ConsultationCardSkeleton.tsx +114 -0
  65. package/dist/lib/consultation-card/index.ts +2 -0
  66. package/dist/lib/content-card/ContentCard.style.ts +59 -0
  67. package/dist/lib/content-card/ContentCard.test.tsx +29 -0
  68. package/dist/lib/content-card/ContentCard.tsx +81 -0
  69. package/dist/lib/date-picker/DatePicker.style.ts +52 -0
  70. package/dist/lib/date-picker/DatePicker.test.tsx +9 -0
  71. package/dist/lib/date-picker/DatePicker.tsx +59 -0
  72. package/dist/lib/floating-button/FloatingButton.style.ts +21 -0
  73. package/dist/lib/floating-button/FloatingButton.test.tsx +9 -0
  74. package/dist/lib/floating-button/FloatingButton.tsx +29 -0
  75. package/dist/lib/floating-button/floating button.svg +6 -0
  76. package/dist/lib/footer-for-booking/FooterForBooking.style.ts +56 -0
  77. package/dist/lib/footer-for-booking/FooterForBooking.test.tsx +30 -0
  78. package/dist/lib/footer-for-booking/FooterForBooking.tsx +53 -0
  79. package/dist/lib/input/Input.style.ts +37 -0
  80. package/dist/lib/input/Input.test.tsx +21 -0
  81. package/dist/lib/input/Input.tsx +73 -0
  82. package/dist/lib/list-button/ListButton.style.ts +21 -0
  83. package/dist/lib/list-button/ListButton.test.tsx +26 -0
  84. package/dist/lib/list-button/ListButton.tsx +30 -0
  85. package/dist/lib/navigation-bar/NavigationBar.style.ts +81 -0
  86. package/dist/lib/navigation-bar/NavigationBar.test.tsx +15 -0
  87. package/dist/lib/navigation-bar/NavigationBar.tsx +31 -0
  88. package/dist/lib/no-internet-connection/NoInternetConnection.style.ts +26 -0
  89. package/dist/lib/no-internet-connection/NoInternetConnection.svg +10 -0
  90. package/dist/lib/no-internet-connection/NoInternetConnection.test.tsx +9 -0
  91. package/dist/lib/no-internet-connection/NoInternetConnection.tsx +30 -0
  92. package/dist/lib/notes-card-text/NotesCardText.style.ts +14 -0
  93. package/dist/lib/notes-card-text/NotesCardText.tsx +32 -0
  94. package/dist/lib/notes-card-text/index.ts +1 -0
  95. package/dist/lib/notes-editor/NotesEditor.styled.ts +24 -0
  96. package/dist/lib/notes-editor/NotesEditor.tsx +16 -0
  97. package/dist/lib/scroll-tabs/ScrollTabs.style.ts +19 -0
  98. package/dist/lib/scroll-tabs/ScrollTabs.test.tsx +9 -0
  99. package/dist/lib/scroll-tabs/ScrollTabs.tsx +42 -0
  100. package/dist/lib/tab-bar/TabBar.style.tsx +43 -0
  101. package/dist/lib/tab-bar/TabBar.tsx +11 -0
  102. package/dist/lib/therapist-card/TherapistCard.style.ts +104 -0
  103. package/dist/lib/therapist-card/TherapistCard.test.tsx +40 -0
  104. package/dist/lib/therapist-card/TherapistCard.tsx +96 -0
  105. package/dist/lib/therapist-information-component/TherapistInformationComponent.style.ts +40 -0
  106. package/dist/lib/therapist-information-component/TherapistInformationComponent.test.tsx +16 -0
  107. package/dist/lib/therapist-information-component/TherapistInformationComponent.tsx +51 -0
  108. package/dist/lib/toast/index.css +13 -0
  109. package/dist/lib/toast/toast.ts +17 -0
  110. package/dist/lib/userAppTypes.ts +261 -0
  111. package/dist/lib/your-local-time-block/YourLocalTimeBlock.styled.ts +28 -0
  112. package/dist/lib/your-local-time-block/YourLocalTimeBlock.tsx +26 -0
  113. package/dist/react-app-env.d.ts +1 -0
  114. package/dist/svg.d.ts +13 -0
  115. package/package.json +4 -17
@@ -0,0 +1,6 @@
1
+ <svg width="54" height="54" viewBox="0 0 54 54" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="54" height="54" fill="#21ABD2"/>
3
+ <path d="M27.0002 15C21.9405 15 17.8237 19.1168 17.8237 24.1765V32.647C17.8237 33.8148 18.7737 34.7648 19.9413 34.7648C21.1092 34.7648 22.0591 33.8148 22.0591 32.647V25.5883C22.0591 24.4206 21.1092 23.4706 19.9413 23.4706C19.7037 23.4706 19.4788 23.5188 19.2651 23.5913C19.5663 19.5829 22.9168 16.4117 27.0002 16.4117C31.0815 16.4117 34.431 19.58 34.735 23.5856C34.5226 23.5129 34.2964 23.4706 34.0591 23.4706C32.8913 23.4706 31.9413 24.4206 31.9413 25.5883V32.647C31.9413 33.8148 32.8913 34.7648 34.0591 34.7648C34.3078 34.7648 34.5431 34.7139 34.765 34.6348V35.4706C34.765 35.8601 34.4479 36.1765 34.0591 36.1765H28.9879C28.6954 35.3566 27.9192 34.7648 27.0002 34.7648C25.8326 34.7648 24.8826 35.7147 24.8826 36.8824C24.8826 38.05 25.8326 39 27.0002 39C27.9192 39 28.6954 38.408 28.9879 37.5883H34.0591C35.2268 37.5883 36.1768 36.6383 36.1768 35.4706C36.1768 31.2248 36.1768 28.4269 36.1768 24.1765C36.1768 19.1168 32.06 15 27.0002 15V15Z" fill="white"/>
4
+ <path d="M37.5884 25.0122V33.2227C38.4081 32.9304 39.0001 32.1542 39.0001 31.235V26.9998C39.0001 26.0808 38.4081 25.3046 37.5884 25.0122Z" fill="white"/>
5
+ <path d="M15 26.9998V31.235C15 32.1542 15.592 32.9304 16.4117 33.2227V25.0122C15.592 25.3046 15 26.0808 15 26.9998Z" fill="white"/>
6
+ </svg>
@@ -0,0 +1,56 @@
1
+ import styled from 'styled-components';
2
+ import { IonIcon } from '@ionic/react';
3
+ import { colorConstants } from '../Theme/mindly_constants';
4
+
5
+ interface ContainerProps {
6
+ isIos: boolean;
7
+ }
8
+
9
+ export const Container = styled.div<ContainerProps>`
10
+ padding: ${(props) => (props.isIos ? '16px 24px 50px' : '16px 24px')};
11
+ box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.12);
12
+ display: flex;
13
+ position: fixed;
14
+ z-index: 10000000000000;
15
+ background: ${colorConstants.White};
16
+ bottom: -1px;
17
+ justify-content: space-between;
18
+ align-items: center;
19
+ width: 100%;
20
+
21
+ @media (min-width: 600px) {
22
+ padding-left: calc((100vw - 468px) / 2);
23
+ padding-right: calc((100vw - 468px) / 2);
24
+ }
25
+
26
+ @media (min-width: 1024px) {
27
+ padding-left: calc((100vw - 960px) / 2);
28
+ padding-right: calc((100vw - 960px) / 2);
29
+ }
30
+
31
+ button {
32
+ min-height: 44px !important;
33
+ width: 132px;
34
+ }
35
+ `;
36
+
37
+ export const InfoContainer = styled.div`
38
+ h4 {
39
+ color: ${colorConstants.primaryTextColor};
40
+ }
41
+
42
+ h4:first-child {
43
+ margin-bottom: 4px;
44
+ }
45
+ `;
46
+
47
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
48
+ export const SmallIcon = styled<any>(IonIcon)`
49
+ // #skipcq
50
+ margin: 0 5px -4px 0;
51
+ font-size: 18px;
52
+
53
+ &.ion-color {
54
+ --ion-color-base: ${colorConstants.primaryColor} !important;
55
+ }
56
+ `;
@@ -0,0 +1,30 @@
1
+ import { render, screen } from '@testing-library/react';
2
+ import React from 'react';
3
+ import { FooterForBooking } from './FooterForBooking';
4
+
5
+ describe('Test floating button', () => {
6
+ test('Smoke test', () => {
7
+ render(
8
+ <FooterForBooking
9
+ eventHandler={() => undefined}
10
+ price="1250 грн"
11
+ duration={50}
12
+ isIos
13
+ />
14
+ );
15
+ });
16
+
17
+ test('Smoke test', () => {
18
+ const handleEvent = jest.fn();
19
+ render(
20
+ <FooterForBooking
21
+ eventHandler={handleEvent}
22
+ price="1250 грн"
23
+ duration={50}
24
+ isIos
25
+ />
26
+ );
27
+ screen.getByText('Записатися').click();
28
+ expect(handleEvent).toHaveBeenCalledTimes(1);
29
+ });
30
+ });
@@ -0,0 +1,53 @@
1
+ import React from 'react';
2
+ import { Container, InfoContainer, SmallIcon } from './FooterForBooking.style';
3
+ import { Button } from '../button/Button';
4
+ import { timeOutline, cardOutline } from 'ionicons/icons';
5
+ import '../Theme/global.css';
6
+
7
+ export interface FooterForBookingProps {
8
+ /*
9
+ * Function to switch on booking system
10
+ */
11
+ eventHandler: (props?: React.SyntheticEvent) => void;
12
+
13
+ /*
14
+ * Duration of consultation (in mn)
15
+ */
16
+ duration: number;
17
+
18
+ /*
19
+ * Consultation cost. You need to transfer it together with the type of currency
20
+ */
21
+ price: string;
22
+
23
+ /*
24
+ * If platform === ios set this props true
25
+ */
26
+ isIos: boolean;
27
+ ['data-testid']?: string;
28
+ }
29
+
30
+ export const FooterForBooking: React.FC<FooterForBookingProps> = (props) => {
31
+ return (
32
+ <Container isIos={props.isIos}>
33
+ <InfoContainer>
34
+ <h4>
35
+ <SmallIcon icon={timeOutline} color="primary" />
36
+ <>{props.duration} хв</>
37
+ </h4>
38
+ <h4>
39
+ <SmallIcon icon={cardOutline} color="primary" />
40
+ {props.price}
41
+ </h4>
42
+ </InfoContainer>
43
+ <Button
44
+ buttonType={'primary'}
45
+ isDisabled={false}
46
+ data-testid={props['data-testid']}
47
+ onClick={props.eventHandler} // #skipcq
48
+ >
49
+ Записатися
50
+ </Button>
51
+ </Container>
52
+ );
53
+ };
@@ -0,0 +1,37 @@
1
+ import { IonIcon, IonInput } from '@ionic/react';
2
+ import { colorConstants } from '../Theme/mindly_constants';
3
+ import styled from 'styled-components';
4
+
5
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6
+ export const InputIonIcon = styled<any>(IonIcon)`
7
+ // skipcq JS-0323
8
+ width: 20px;
9
+ z-index: 3;
10
+ height: 20px;
11
+ position: absolute;
12
+ top: calc(50% - 10px);
13
+ left: 20px;
14
+ color: ${colorConstants.primaryTextColor} !important;
15
+ `;
16
+
17
+ interface CustomIonInputProps {
18
+ isActive: boolean;
19
+ }
20
+
21
+ export const CustomIonInput = styled(IonInput)<CustomIonInputProps>`
22
+ position: relative;
23
+ border: none;
24
+ border-radius: 4px;
25
+ font-size: 14px;
26
+ font-family: 'Lato Regular', sans-serif;
27
+ --padding-start: 55px !important;
28
+ --background: ${colorConstants.AccentInputBgColor} !important;
29
+ min-height: 36px;
30
+ line-height: 20px;
31
+ color: ${(props) =>
32
+ props.isActive
33
+ ? colorConstants.primaryTextColor
34
+ : colorConstants.AccentDisabledColor};
35
+ --placeholder-color: ${colorConstants.AccentDisabledColor};
36
+ --placeholder-opacity: 1;
37
+ `;
@@ -0,0 +1,21 @@
1
+ import { render } from '@testing-library/react';
2
+ import React from 'react';
3
+ import { Input } from './Input';
4
+ import { personOutline } from 'ionicons/icons';
5
+
6
+ describe('Test input', () => {
7
+ test('Smoke test', () => {
8
+ render(
9
+ <Input
10
+ data-cy="input"
11
+ icon={personOutline}
12
+ isActive
13
+ name={'input'}
14
+ onIonChange={() => undefined}
15
+ placeholder={'input'}
16
+ type="text"
17
+ value=""
18
+ />
19
+ );
20
+ });
21
+ });
@@ -0,0 +1,73 @@
1
+ import React from 'react';
2
+ import { CustomIonInput, InputIonIcon } from './Input.style';
3
+ import '../Theme/global.css';
4
+
5
+ export interface InputProps {
6
+ /*
7
+ * Toggles the color of text in the input (value !== '')
8
+ */
9
+ isActive: boolean;
10
+
11
+ /*
12
+ * Default react input name
13
+ */
14
+ name: string;
15
+
16
+ /*
17
+ * Default input type
18
+ */
19
+ type:
20
+ | 'date'
21
+ | 'email'
22
+ | 'number'
23
+ | 'password'
24
+ | 'search'
25
+ | 'tel'
26
+ | 'text'
27
+ | 'url'
28
+ | 'time'
29
+ | 'week'
30
+ | 'month'
31
+ | 'datetime-local';
32
+
33
+ /*
34
+ * Default input placeholder
35
+ */
36
+ placeholder: string;
37
+
38
+ /*
39
+ * Default input value
40
+ */
41
+ value: string;
42
+
43
+ /*
44
+ * Data test id for cypress
45
+ */
46
+ ['data-testid']?: string;
47
+
48
+ /*
49
+ * Default onIonChange
50
+ */
51
+ onIonChange: (e: CustomEvent) => void;
52
+
53
+ /*
54
+ * Link on icon
55
+ */
56
+ icon: string;
57
+ }
58
+
59
+ export const Input: React.FC<InputProps> = (props) => {
60
+ return (
61
+ <CustomIonInput
62
+ name={props.name}
63
+ placeholder={props.placeholder}
64
+ value={props.value}
65
+ data-testid={props['data-testid']}
66
+ onIonChange={(e) => props.onIonChange(e)}
67
+ isActive={props.isActive}
68
+ type={props.type}
69
+ >
70
+ <InputIonIcon icon={props.icon} />
71
+ </CustomIonInput>
72
+ );
73
+ };
@@ -0,0 +1,21 @@
1
+ import styled from 'styled-components';
2
+ import { colorConstants } from '../Theme/mindly_constants';
3
+ import { IonIcon } from '@ionic/react';
4
+
5
+ export const Container = styled.button`
6
+ display: flex;
7
+ justify-content: space-between;
8
+ color: ${colorConstants.primaryTextColor};
9
+ border: 0;
10
+ border-bottom: 1px solid ${colorConstants.AccentDivider};
11
+ width: 100%;
12
+ padding: 10px 16px;
13
+ background: inherit;
14
+ align-items: center;
15
+ `;
16
+
17
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
18
+ export const CustomIonIcon = styled<any>(IonIcon)`
19
+ // #skipcq
20
+ font-size: 24px;
21
+ `;
@@ -0,0 +1,26 @@
1
+ import { render, screen } from '@testing-library/react';
2
+ import React from 'react';
3
+ import { ListButton } from './ListButton';
4
+ import { personOutline } from 'ionicons/icons';
5
+
6
+ describe('Test list button', () => {
7
+ test('Smoke test', () => {
8
+ render(
9
+ <ListButton onClick={() => false} icon={personOutline}>
10
+ Кнопка
11
+ </ListButton>
12
+ );
13
+ });
14
+
15
+ test('Smoke test', () => {
16
+ const handleEvent = jest.fn();
17
+ render(
18
+ <ListButton onClick={handleEvent} icon={personOutline}>
19
+ Кнопка
20
+ </ListButton>
21
+ );
22
+ const listButton = screen.getByText('Кнопка');
23
+ listButton.click();
24
+ expect(handleEvent).toHaveBeenCalledTimes(1);
25
+ });
26
+ });
@@ -0,0 +1,30 @@
1
+ import React from 'react';
2
+ import '../Theme/global.css';
3
+ import { Container, CustomIonIcon } from './ListButton.style';
4
+
5
+ export interface ListButtonProps {
6
+ /*
7
+ * Text inside the button (default React children)
8
+ */
9
+ children: React.ReactNode;
10
+
11
+ /*
12
+ * Link on icon
13
+ */
14
+ icon: string;
15
+
16
+ /*
17
+ * Default React onClick
18
+ */
19
+ onClick: (props?: React.SyntheticEvent) => void;
20
+ ['data-testid']?: string;
21
+ }
22
+
23
+ export const ListButton: React.FC<ListButtonProps> = (props) => {
24
+ return (
25
+ <Container data-testid={props['data-testid']} onClick={props.onClick}>
26
+ <h4>{props.children}</h4>
27
+ <CustomIonIcon src={props.icon} />
28
+ </Container>
29
+ );
30
+ };
@@ -0,0 +1,81 @@
1
+ import styled, { css } from 'styled-components';
2
+ import { IonHeader } from '@ionic/react';
3
+ import { colorConstants } from '../Theme/mindly_constants';
4
+
5
+ interface ContainerProps {
6
+ isIos: boolean;
7
+ isInternetConnected: boolean;
8
+ }
9
+
10
+ export const Container = styled(IonHeader)<ContainerProps>`
11
+ padding: ${(props) =>
12
+ props.isInternetConnected ? '10px 16px' : '40px 16px 16px'};
13
+ background: #ffffff;
14
+ position: fixed;
15
+ z-index: 1000;
16
+ min-height: ${(props) => (props.isInternetConnected ? '44px' : '74px')};
17
+ box-shadow: 0 1px 5px rgba(0, 0, 0, 0.12);
18
+ color: ${colorConstants.secondaryTextColor};
19
+
20
+ @media (min-width: 600px) {
21
+ padding-left: calc((100vw - 468px) / 2);
22
+ padding-right: calc((100vw - 468px) / 2);
23
+ }
24
+
25
+ @media (min-width: 1024px) {
26
+ padding-left: calc((100vw - 960px) / 2);
27
+ padding-right: calc((100vw - 960px) / 2);
28
+ }
29
+
30
+ .left {
31
+ cursor: pointer;
32
+ position: absolute;
33
+ color: ${colorConstants.primaryColor};
34
+ left: 0;
35
+ }
36
+
37
+ .right {
38
+ cursor: pointer;
39
+ color: ${colorConstants.primaryColor};
40
+ position: absolute;
41
+ right: 0;
42
+ }
43
+
44
+ &:after {
45
+ background-image: none;
46
+ }
47
+
48
+ ${(props: ContainerProps) =>
49
+ props.isIos &&
50
+ css`
51
+ padding: ${props.isInternetConnected
52
+ ? '54px 16px 10px'
53
+ : '64px 16px 10px'};
54
+ min-height: ${props.isInternetConnected ? '88px' : '98px'};
55
+
56
+ .left {
57
+ position: absolute;
58
+ left: 0;
59
+ }
60
+
61
+ .right {
62
+ position: absolute;
63
+ right: 0;
64
+ }
65
+ `}
66
+ `;
67
+
68
+ export const PositionRelative = styled.div`
69
+ position: relative;
70
+ display: flex;
71
+ text-align: center;
72
+ justify-content: center;
73
+
74
+ @media (min-width: 600px) {
75
+ width: 468px;
76
+ }
77
+
78
+ @media (min-width: 1024px) {
79
+ width: 960px;
80
+ }
81
+ `;
@@ -0,0 +1,15 @@
1
+ import { render } from '@testing-library/react';
2
+ import React from 'react';
3
+ import { NavigationBar } from './NavigationBar';
4
+
5
+ describe('Test navigation bar', () => {
6
+ test('Smoke test', () => {
7
+ render(
8
+ <NavigationBar isInternetConnected isIos>
9
+ <h3 className="left">first</h3>
10
+ <h3>second</h3>
11
+ <h3 className="right">third</h3>
12
+ </NavigationBar>
13
+ );
14
+ });
15
+ });
@@ -0,0 +1,31 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { Container, PositionRelative } from './NavigationBar.style';
3
+ import '../Theme/global.css';
4
+
5
+ export interface NavigationBarProps {
6
+ /*
7
+ * If internet connected, set this props true. Changes the appearance of a component
8
+ */
9
+ isInternetConnected: boolean;
10
+
11
+ /*
12
+ * Here you pass the special HTML structure. All variations can be viewed in the storybook
13
+ */
14
+ children?: ReactNode;
15
+
16
+ /*
17
+ * If platform === ios set this props true
18
+ */
19
+ isIos: boolean;
20
+ }
21
+
22
+ export const NavigationBar: React.FC<NavigationBarProps> = (props) => {
23
+ return (
24
+ <Container
25
+ isIos={props.isIos}
26
+ isInternetConnected={props.isInternetConnected}
27
+ >
28
+ <PositionRelative>{props.children}</PositionRelative>
29
+ </Container>
30
+ );
31
+ };
@@ -0,0 +1,26 @@
1
+ import styled from 'styled-components';
2
+ import { colorConstants } from '../Theme/mindly_constants';
3
+
4
+ interface ContainerProps {
5
+ isInternetConnected: boolean;
6
+ isIos: boolean;
7
+ }
8
+
9
+ export const Container = styled.div<ContainerProps>`
10
+ z-index: 999;
11
+ position: fixed;
12
+ box-sizing: border-box;
13
+ background: ${colorConstants.AccentCross};
14
+ width: 100%;
15
+ display: ${(props) => (props.isInternetConnected ? 'none' : 'flex')};
16
+ justify-content: center;
17
+ align-items: center;
18
+ padding: ${(props) => (props.isIos ? '32px 0 8px' : '8px 0')};
19
+
20
+ span {
21
+ font-size: 10px;
22
+ line-height: 14px;
23
+ margin-left: 8px;
24
+ color: ${colorConstants.White};
25
+ }
26
+ `;
@@ -0,0 +1,10 @@
1
+ <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M7 13.5625C3.38158 13.5625 0.4375 10.6184 0.4375 7C0.4375 3.38158 3.38158 0.4375 7 0.4375C10.6184 0.4375 13.5625 3.38158 13.5625 7C13.5625 10.6184 10.6184 13.5625 7 13.5625Z" fill="#F1646F"/>
3
+ <path d="M7 14C3.14008 14 0 10.8599 0 7C0 3.14008 3.14008 0 7 0C10.8599 0 14 3.14008 14 7C14 10.8599 10.8599 14 7 14ZM7 0.875C3.6225 0.875 0.875 3.6225 0.875 7C0.875 10.3775 3.6225 13.125 7 13.125C10.3775 13.125 13.125 10.3775 13.125 7C13.125 3.6225 10.3775 0.875 7 0.875Z" fill="white"/>
4
+ <path d="M11.509 6.25341C11.3976 6.25341 11.285 6.21083 11.1999 6.12566C10.9362 5.86199 10.6492 5.62458 10.3476 5.41924C10.1475 5.28391 10.095 5.01208 10.2315 4.81199C10.3663 4.61191 10.6381 4.55824 10.8388 4.69591C11.1859 4.93099 11.5155 5.20399 11.8188 5.50616C11.9897 5.67708 11.9897 5.95416 11.8194 6.12566C11.7336 6.21024 11.6216 6.25341 11.509 6.25341Z" fill="white"/>
5
+ <path d="M2.49085 6.25316C2.37943 6.25316 2.26743 6.21058 2.18226 6.12541C2.01076 5.95508 2.0096 5.67799 2.18051 5.50649C3.7911 3.88949 6.0311 3.17666 8.36735 3.63574C8.60418 3.68241 8.75876 3.91283 8.71268 4.14966C8.66601 4.38649 8.43618 4.53758 8.19876 4.49499C6.1466 4.09074 4.2041 4.71433 2.80001 6.12424C2.71485 6.20999 2.60285 6.25316 2.49085 6.25316Z" fill="white"/>
6
+ <path d="M9.93993 7.82829C9.82851 7.82829 9.71593 7.7857 9.63076 7.70054C9.37351 7.44329 9.08359 7.22395 8.77034 7.04954C8.55918 6.9317 8.48393 6.66512 8.60118 6.45395C8.71843 6.24279 8.98501 6.16695 9.19676 6.28479C9.58001 6.49887 9.93468 6.76662 10.2497 7.08045C10.4206 7.25137 10.4206 7.52845 10.2503 7.69995C10.1645 7.7857 10.0519 7.82829 9.93993 7.82829Z" fill="white"/>
7
+ <path d="M4.06016 7.82864C3.94816 7.82864 3.83616 7.78606 3.75099 7.70031C3.58007 7.52939 3.58007 7.25172 3.75099 7.08139C4.37632 6.45664 5.14691 6.03022 5.97932 5.84939C6.21499 5.79747 6.44891 5.94739 6.50024 6.18306C6.55216 6.41931 6.40224 6.65264 6.16657 6.70397C5.49749 6.84981 4.87624 7.19456 4.36991 7.70031C4.28416 7.78606 4.17157 7.82864 4.06016 7.82864Z" fill="white"/>
8
+ <path d="M6.99999 10.4997C6.42599 10.4997 5.92258 10.1135 5.77733 9.56109C5.71608 9.32776 5.85608 9.08801 6.08941 9.02676C6.32099 8.96726 6.56249 9.10492 6.62374 9.33884C6.66866 9.50976 6.81974 9.62467 6.99999 9.62467C7.21874 9.62467 7.39666 9.44676 7.39666 9.22801C7.39666 9.04776 7.28174 8.89726 7.11082 8.85176C6.87749 8.79051 6.73691 8.55076 6.79874 8.31742C6.85999 8.08351 7.10266 7.94642 7.33307 8.00534C7.88549 8.15059 8.27166 8.65284 8.27166 9.22801C8.27166 9.92917 7.70116 10.4997 6.99999 10.4997Z" fill="white"/>
9
+ <path d="M2.36069 12.0764C2.24869 12.0764 2.13669 12.0339 2.05153 11.9481C1.88061 11.7772 1.88061 11.5001 2.05153 11.3292L11.33 2.05128C11.5009 1.88037 11.778 1.88037 11.9489 2.05128C12.1199 2.2222 12.1199 2.49928 11.9489 2.6702L2.66986 11.9481C2.58469 12.0339 2.47269 12.0764 2.36069 12.0764Z" fill="white"/>
10
+ </svg>
@@ -0,0 +1,9 @@
1
+ import { render } from '@testing-library/react';
2
+ import React from 'react';
3
+ import { NoInternetConnection } from './NoInternetConnection';
4
+
5
+ describe('Test no internet connection', () => {
6
+ test('Smoke test', () => {
7
+ render(<NoInternetConnection isInternetConnected isIos />);
8
+ });
9
+ });
@@ -0,0 +1,30 @@
1
+ import React from 'react';
2
+ import { ReactComponent as Icon } from './NoInternetConnection.svg';
3
+ import { Container } from './NoInternetConnection.style';
4
+ import '../Theme/global.css';
5
+
6
+ export interface NoInternetConnectionProps {
7
+ /*
8
+ * If internet connected, set this props true. Changes the appearance of a component
9
+ */
10
+ isInternetConnected: boolean;
11
+
12
+ /*
13
+ * If platform === ios set this props true
14
+ */
15
+ isIos: boolean;
16
+ }
17
+
18
+ export const NoInternetConnection: React.FC<NoInternetConnectionProps> = (
19
+ props
20
+ ) => {
21
+ return (
22
+ <Container
23
+ isInternetConnected={props.isInternetConnected}
24
+ isIos={props.isIos}
25
+ >
26
+ <Icon />
27
+ <span>Інтернет підключення відсутнє</span>
28
+ </Container>
29
+ );
30
+ };
@@ -0,0 +1,14 @@
1
+ import styled from 'styled-components';
2
+
3
+ export const StyledNotesCardPre = styled.pre`
4
+ overflow-y: hidden;
5
+ overflow-x: auto;
6
+
7
+ white-space: pre-wrap;
8
+ font-family: 'Inter';
9
+ font-style: normal;
10
+ font-weight: 400;
11
+ font-size: 14px;
12
+ line-height: 16px;
13
+ color: #1d201f;
14
+ `;
@@ -0,0 +1,32 @@
1
+ import { StyledNotesCardPre } from './NotesCardText.style';
2
+ import React, { useCallback } from 'react';
3
+
4
+ export type NotesCardTextProps = {
5
+ text: string
6
+ }
7
+
8
+ const NotesCardText: React.FC<NotesCardTextProps> = ({ text }) => {
9
+ const matchAndReplaceLinkToATag = useCallback(
10
+ () => {
11
+ const expression =
12
+ // eslint-disable-next-line max-len
13
+ /(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/gi;
14
+ const regex = RegExp(expression);
15
+
16
+ return text.split(regex).map((textPart) =>
17
+ regex.test(textPart) ? (
18
+ <a className="text-link" href={textPart}>
19
+ {textPart}
20
+ </a>
21
+ ) : (
22
+ textPart
23
+ )
24
+ );
25
+ },
26
+ [text]
27
+ );
28
+
29
+ return (<StyledNotesCardPre>{matchAndReplaceLinkToATag()}</StyledNotesCardPre>);
30
+ };
31
+
32
+ export default NotesCardText;
@@ -0,0 +1 @@
1
+ export * from './NotesCardText';
@@ -0,0 +1,24 @@
1
+ import { IonTextarea } from '@ionic/react';
2
+ import styled from 'styled-components';
3
+
4
+ export const StyledIonTextarea = styled(IonTextarea)`
5
+ font-family: 'Inter';
6
+ font-style: normal;
7
+ font-weight: 600;
8
+ font-size: 16px;
9
+ line-height: 24px;
10
+ --padding-bottom: 20px !important;
11
+ --padding-end: 16px !important;
12
+ --padding-start: 16px !important;
13
+ --padding-top: 0 !important;
14
+
15
+ textarea {
16
+ min-height: 300px !important;
17
+
18
+ overflow: hidden !important;
19
+
20
+ &::-webkit-scrollbar {
21
+ display: none;
22
+ }
23
+ }
24
+ `;
@@ -0,0 +1,16 @@
1
+ import React, { forwardRef, HTMLAttributes, RefAttributes } from 'react';
2
+ import { JSX } from '@ionic/core/components';
3
+ import { StyledIonTextarea } from './NotesEditor.styled';
4
+
5
+ export type NotesEditorProps = JSX.IonTextarea &
6
+ HTMLAttributes<HTMLIonTextareaElement> &
7
+ RefAttributes<HTMLIonTextareaElement>;
8
+
9
+ const NotesEditor = forwardRef<HTMLIonTextareaElement, NotesEditorProps>(
10
+ (props, ref) => {
11
+ return <StyledIonTextarea autoGrow ref={ref} {...props} />;
12
+ }
13
+ );
14
+ NotesEditor.displayName = 'NotesEditor';
15
+
16
+ export default NotesEditor;