@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,23 @@
1
+ export const colorConstants = {
2
+ primaryColor: '#21ABD2',
3
+ secondaryColor: '#F0FBFF',
4
+ primaryTextColor: '#1D201F',
5
+ secondaryTextColor: '#5B5B5B',
6
+ AccentStrokeColor: '#EDEFF2',
7
+ AccentDisabledColor: '#C1C1C1',
8
+ AccentCrossColor: '#A31621',
9
+ AccentTickColor: '#478862',
10
+ AccentInputBgColor: '#F5F9FF',
11
+ AccentTabsBgColor: '#D6F2F9',
12
+ AccentCross: '#f1646f',
13
+ White: '#FFFFFF',
14
+ AccentAchieveBgNew: '#E7E7E7',
15
+ StrokeGray: '#F2F4F7',
16
+ AccentSurveyButton: '#E9F7FB',
17
+ AccentCancelActive: '#F5939A',
18
+ AccentActiveButtonBG: '#90D5E8',
19
+ AccentDivider: '#E5E5E5',
20
+ AccentGrayBlue: '#E8ECF2',
21
+ };
22
+
23
+ export const maxContainerWidth = '410px';
@@ -0,0 +1,61 @@
1
+ import styled from 'styled-components';
2
+
3
+ export const StyledScrollListSectionWrapper = styled.div`
4
+ @media (min-width: 1024px) {
5
+ grid-column: 1 / 3;
6
+ }
7
+
8
+ @media (max-width: 1024px) and (min-width: 600px) {
9
+ max-width: 452px;
10
+ }
11
+ `;
12
+
13
+ export const StyledSectionTitle = styled.div`
14
+ font-weight: 700;
15
+ font-size: 24px;
16
+ line-height: 32px;
17
+ `;
18
+
19
+ export const StyledScrollListWrapper = styled.div`
20
+ display: flex;
21
+ overflow-x: auto;
22
+ scrollbar-width: none;
23
+ &::-webkit-scrollbar {
24
+ display: none;
25
+ }
26
+ `;
27
+
28
+ export const StyledScrollListPsychologist = styled.div`
29
+ min-width: max-content;
30
+ margin-right: 12px;
31
+ cursor: pointer;
32
+ `;
33
+
34
+ export const StyledScrollListPsychologistAvatar = styled.section`
35
+ border: 1px solid #f2f4f7;
36
+ border-radius: 999px;
37
+ height: 72px;
38
+ width: 72px;
39
+ padding: 5px;
40
+ overflow: hidden !important;
41
+ display: flex;
42
+ justify-content: center;
43
+ align-items: center;
44
+ .img {
45
+ border-radius: 99px;
46
+ max-width: max-content;
47
+ min-width: 62px;
48
+ width: 62px;
49
+ height: 62px;
50
+ user-select: none;
51
+ }
52
+ `;
53
+
54
+ export const StyledScrollListPsychologistName = styled.div`
55
+ color: #1d201f;
56
+ font-style: normal;
57
+ font-weight: 600;
58
+ font-size: 12px;
59
+ line-height: 16px;
60
+ text-align: center;
61
+ `;
@@ -0,0 +1,68 @@
1
+ import React, { useState } from 'react';
2
+ import { IonSkeletonText } from '@ionic/react';
3
+ import {
4
+ StyledScrollListSectionWrapper,
5
+ StyledScrollListWrapper,
6
+ StyledScrollListPsychologist,
7
+ StyledScrollListPsychologistAvatar,
8
+ StyledScrollListPsychologistName,
9
+ } from './UserPsychologistScrollList.styled';
10
+ import { PsychologistType } from '../userAppTypes';
11
+
12
+ export type UsersPsychologistScrollListPropsType = {
13
+ psychologistClickHandler: React.Dispatch<
14
+ React.SetStateAction<{
15
+ isShow: boolean;
16
+ psychologist_id: string;
17
+ }>
18
+ >;
19
+ usersPsychologists: Array<PsychologistType> | null;
20
+ };
21
+
22
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
23
+ export const UsersPsychologistScrollList = ({
24
+ psychologistClickHandler,
25
+ usersPsychologists,
26
+ }: UsersPsychologistScrollListPropsType) => {
27
+ const [imageLoaded, setImageLoaded] = useState(false);
28
+
29
+
30
+ if (usersPsychologists && usersPsychologists.length) {
31
+ return (
32
+ <StyledScrollListSectionWrapper>
33
+ <StyledScrollListWrapper>
34
+ {usersPsychologists.map((psychologist) => (
35
+ <StyledScrollListPsychologist
36
+ key={`${psychologist.id}-scroll`}
37
+ onClick={() =>
38
+ psychologistClickHandler({
39
+ isShow: true,
40
+ psychologist_id: psychologist.id,
41
+ })
42
+ }
43
+ >
44
+ <StyledScrollListPsychologistAvatar>
45
+ <img
46
+ className="img"
47
+ src={psychologist.avatar}
48
+ alt={psychologist.first_name}
49
+ onLoad={() => setImageLoaded(true)}
50
+ style={{ display: imageLoaded ? 'block' : 'none' }}
51
+ />
52
+ <IonSkeletonText
53
+ animated
54
+ className="img"
55
+ style={{ display: imageLoaded ? 'none' : 'block' }}
56
+ />
57
+ </StyledScrollListPsychologistAvatar>
58
+ <StyledScrollListPsychologistName>
59
+ {psychologist.first_name}
60
+ </StyledScrollListPsychologistName>
61
+ </StyledScrollListPsychologist>
62
+ ))}
63
+ </StyledScrollListWrapper>
64
+ </StyledScrollListSectionWrapper>
65
+ );
66
+ }
67
+ return null;
68
+ };
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { render } from '@testing-library/react';
3
+ import { ArchivedConsultationCard } from './ArchivedConsultationCard';
4
+
5
+ describe('Test archived consultation', () => {
6
+ test('Smoke test', () => {
7
+ render(<ArchivedConsultationCard date="" img="" name="" />);
8
+ });
9
+ });
@@ -0,0 +1,72 @@
1
+ import styled from 'styled-components';
2
+ import { colorConstants } from '../Theme/mindly_constants';
3
+
4
+ export const Container = styled.div`
5
+ overflow: hidden;
6
+ display: flex;
7
+ justify-content: space-between;
8
+ background: ${colorConstants.AccentGrayBlue};
9
+ padding: 8px;
10
+ width: 100%;
11
+ border-radius: 4px;
12
+ `;
13
+
14
+ export const TextContainer = styled.div`
15
+ h3 {
16
+ padding-top: 5px;
17
+ font-weight: 700;
18
+ font-size: 18px;
19
+ line-height: 24px;
20
+ color: ${colorConstants.primaryTextColor};
21
+ }
22
+
23
+ h5 {
24
+ color: ${colorConstants.secondaryTextColor};
25
+ font-weight: 400;
26
+ font-size: 16px;
27
+ line-height: 24px;
28
+ }
29
+
30
+ h5.isFreeStatus {
31
+ font-weight: 700;
32
+ font-size: 12px;
33
+ line-height: 16px;
34
+ text-align: center;
35
+ padding: 2px 8px;
36
+ color: ${colorConstants.primaryTextColor};
37
+ }
38
+
39
+ .greeny-bg {
40
+ max-width: max-content;
41
+ background: #cfe2d7;
42
+ box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
43
+ border-radius: 12px;
44
+ }
45
+
46
+ .reddy-bg {
47
+ max-width: max-content;
48
+ background: #f6dfdf;
49
+ box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
50
+ border-radius: 12px;
51
+ }
52
+
53
+ h5.check {
54
+ margin-top: 5px;
55
+ display: flex;
56
+ align-items: center;
57
+ color: ${colorConstants.AccentTickColor};
58
+ font-weight: 400;
59
+ font-size: 14px;
60
+ line-height: 16px;
61
+ }
62
+
63
+ svg {
64
+ margin-right: 4px;
65
+ }
66
+ `;
67
+
68
+ export const Avatar = styled.img`
69
+ max-width: 94px;
70
+ max-height: 94px;
71
+ border-radius: 8px;
72
+ `;
@@ -0,0 +1,3 @@
1
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M12.6237 3.67075C12.8056 3.46294 13.1214 3.44188 13.3293 3.62372C13.5342 3.80307 13.5575 4.11281 13.3836 4.32066L13.3763 4.32926L6.37629 12.3293C6.18827 12.5441 5.85953 12.5578 5.65438 12.3613L5.64645 12.3536L2.64645 9.35356C2.45118 9.1583 2.45118 8.84171 2.64645 8.64645C2.839 8.4539 3.14952 8.45123 3.34535 8.63843L3.35355 8.64645L5.97563 11.2685L12.6237 3.67075Z" fill="#478862"/>
3
+ </svg>
@@ -0,0 +1,61 @@
1
+ import React from 'react';
2
+ import {
3
+ Avatar,
4
+ Container,
5
+ TextContainer,
6
+ } from './ArchivedConsultationCard.style';
7
+ import { ReactComponent as Icon } from './ArchivedConsultationCard.svg';
8
+ import '../Theme/global.css';
9
+
10
+ export interface ArchivedConsultationCardProps {
11
+ /*
12
+ * Psychologist name and surname
13
+ */
14
+ nameAndSurname: string;
15
+
16
+ /*
17
+ * Start date of the last consultation ( in format day, month, time)
18
+ */
19
+ date: string;
20
+
21
+ /*
22
+ * Psychologist avatar link
23
+ */
24
+ avatar: string;
25
+ /*
26
+ * If that's a free consultation
27
+ */
28
+ isFree?: boolean;
29
+ /**
30
+ * Consultation price
31
+ */
32
+ price: string;
33
+ ['data-testid']?: string;
34
+ }
35
+
36
+ export const ArchivedConsultationCard: React.FC<ArchivedConsultationCardProps> =
37
+ (props) => {
38
+ return (
39
+ <Container data-testid={props['data-testid']}>
40
+ <TextContainer>
41
+ {typeof props.isFree === 'boolean' &&
42
+ (props.isFree ? (
43
+ <div className="reddy-bg">
44
+ <h5 className="isFreeStatus">Безкоштовна</h5>
45
+ </div>
46
+ ) : (
47
+ <div className="greeny-bg">
48
+ <h5 className="isFreeStatus">{`Платна - ${props.price} грн`}</h5>
49
+ </div>
50
+ ))}
51
+ <h3>{props.nameAndSurname}</h3>
52
+ <h5 className="semiBold">{props.date}</h5>
53
+ <h5 className="check">
54
+ <Icon />
55
+ Завершена
56
+ </h5>
57
+ </TextContainer>
58
+ <Avatar src={props.avatar} alt="user-avatar" />
59
+ </Container>
60
+ );
61
+ };
@@ -0,0 +1,170 @@
1
+ import styled, { css } from 'styled-components';
2
+ import { colorConstants } from '../Theme/mindly_constants';
3
+
4
+ interface ContainerProps {
5
+ buttonType:
6
+ | 'primary'
7
+ | 'secondary'
8
+ | 'actionButton'
9
+ | 'actionButtonDisabled'
10
+ | 'secondaryWithStroke'
11
+ | 'secondaryCancel'
12
+ | 'actionButtonActive'
13
+ | 'actionButtonGreen';
14
+ isDisabled: boolean;
15
+ }
16
+
17
+ export const Container = styled.button<ContainerProps>`
18
+ padding: 12px 0;
19
+ width: 100%;
20
+ border-radius: 4px;
21
+ max-height: 40px;
22
+ border: 0;
23
+ background: ${colorConstants.primaryColor};
24
+ color: ${colorConstants.White};
25
+ font-weight: 600;
26
+ font-size: 14px;
27
+ line-height: 16px;
28
+
29
+ &:hover,
30
+ &:active {
31
+ box-shadow: inset 0 4px 15px rgba(0, 0, 0, 0.2),
32
+ inset 0 -4px 15px rgba(0, 0, 0, 0.2);
33
+ }
34
+
35
+ ${(props: ContainerProps) =>
36
+ props.buttonType === 'secondary' &&
37
+ css`
38
+ background: inherit;
39
+ color: ${colorConstants.primaryColor};
40
+ font-weight: 400;
41
+
42
+ &:hover,
43
+ &:active {
44
+ box-shadow: none;
45
+ color: ${colorConstants.AccentActiveButtonBG};
46
+ }
47
+ `}
48
+
49
+ ${(props: ContainerProps) =>
50
+ props.buttonType === 'secondaryWithStroke' &&
51
+ css`
52
+ color: ${colorConstants.primaryColor};
53
+ background: inherit;
54
+ box-shadow: none;
55
+ border: 1px solid ${colorConstants.primaryColor};
56
+
57
+ &:hover,
58
+ &:active {
59
+ box-shadow: none;
60
+ color: ${colorConstants.AccentActiveButtonBG};
61
+ background: inherit;
62
+ border: 1px solid ${colorConstants.AccentActiveButtonBG};
63
+ }
64
+ `}
65
+
66
+ ${(props: ContainerProps) =>
67
+ props.buttonType === 'secondaryCancel' &&
68
+ css`
69
+ color: ${colorConstants.AccentCross};
70
+ background: inherit;
71
+ box-shadow: none;
72
+ border: 0;
73
+ font-weight: 400;
74
+
75
+ &:hover,
76
+ &:active {
77
+ box-shadow: none;
78
+ color: ${colorConstants.AccentCancelActive};
79
+ background: inherit;
80
+ border: 0;
81
+ }
82
+ `}
83
+
84
+ ${(props: ContainerProps) =>
85
+ props.buttonType === 'actionButton' &&
86
+ css`
87
+ color: ${colorConstants.AccentDisabledColor};
88
+ background: inherit;
89
+ box-shadow: none;
90
+ border: 1px solid ${colorConstants.AccentDisabledColor};
91
+
92
+ &:hover,
93
+ &:active {
94
+ color: ${colorConstants.AccentDisabledColor};
95
+ background: inherit;
96
+ box-shadow: none;
97
+ border: 1px solid ${colorConstants.AccentDisabledColor};
98
+ }
99
+ `}
100
+
101
+
102
+ ${(props: ContainerProps) =>
103
+ props.isDisabled &&
104
+ css`
105
+ background: ${colorConstants.AccentDisabledColor};
106
+ color: ${colorConstants.White};
107
+ box-shadow: none;
108
+
109
+ &:hover,
110
+ &:active {
111
+ box-shadow: none;
112
+ background: ${colorConstants.AccentDisabledColor};
113
+ color: ${colorConstants.White};
114
+ }
115
+ `}
116
+
117
+ ${(props: ContainerProps) =>
118
+ props.buttonType === 'actionButtonDisabled' &&
119
+ css`
120
+ color: ${colorConstants.AccentDisabledColor};
121
+ background: inherit;
122
+ box-shadow: none !important;
123
+ border: 1px solid ${colorConstants.AccentDisabledColor};
124
+ text-decoration: line-through;
125
+ `}
126
+
127
+ ${(props: ContainerProps) =>
128
+ props.buttonType === 'actionButtonActive' &&
129
+ css`
130
+ box-shadow: none;
131
+ color: ${colorConstants.primaryColor};
132
+ background: ${colorConstants.AccentSurveyButton};
133
+ border: 1px solid ${colorConstants.primaryColor};
134
+
135
+ &:hover,
136
+ &:active {
137
+ box-shadow: none;
138
+ color: ${colorConstants.primaryColor};
139
+ background: ${colorConstants.AccentSurveyButton};
140
+ border: 1px solid ${colorConstants.primaryColor};
141
+ }
142
+ `}
143
+
144
+ ${(props: ContainerProps) =>
145
+ props.buttonType === 'actionButtonGreen' &&
146
+ css`
147
+ color: ${colorConstants.AccentTickColor};
148
+ background: linear-gradient(
149
+ 0deg,
150
+ rgba(255, 255, 255, 0.86),
151
+ rgba(255, 255, 255, 0.86)
152
+ ),
153
+ ${colorConstants.AccentTickColor};
154
+ box-shadow: none;
155
+ border: 1px solid ${colorConstants.AccentTickColor};
156
+
157
+ &:hover,
158
+ &:active {
159
+ box-shadow: none;
160
+ color: ${colorConstants.AccentTickColor};
161
+ background: linear-gradient(
162
+ 0deg,
163
+ rgba(255, 255, 255, 0.86),
164
+ rgba(255, 255, 255, 0.86)
165
+ ),
166
+ ${colorConstants.AccentTickColor};
167
+ border: 1px solid ${colorConstants.AccentTickColor};
168
+ }
169
+ `}
170
+ `;
@@ -0,0 +1,39 @@
1
+ import React from 'react';
2
+ import { render } from '@testing-library/react';
3
+ import { Button } from './Button';
4
+
5
+ describe('Test button', () => {
6
+ test('Smoke test button', () => {
7
+ render(
8
+ <Button buttonType="primary" isDisabled onClick={() => undefined}>
9
+ Text
10
+ </Button>
11
+ );
12
+ });
13
+
14
+ test('Click on button test', () => {
15
+ const clickFuncMock = jest.fn();
16
+ const { getByText } = render(
17
+ <Button onClick={clickFuncMock} buttonType="primary" isDisabled={false}>
18
+ Text
19
+ </Button>
20
+ );
21
+ const button = getByText('Text');
22
+ expect(clickFuncMock).not.toHaveBeenCalled();
23
+ button.click();
24
+ expect(clickFuncMock).toHaveBeenCalled();
25
+ });
26
+
27
+ test('Text is button disabled', () => {
28
+ const clickFuncMock = jest.fn();
29
+ const { getByText } = render(
30
+ <Button onClick={clickFuncMock} buttonType="primary" isDisabled>
31
+ Text
32
+ </Button>
33
+ );
34
+ const button = getByText('Text');
35
+ expect(clickFuncMock).not.toHaveBeenCalled();
36
+ button.click();
37
+ expect(clickFuncMock).not.toHaveBeenCalled();
38
+ });
39
+ });
@@ -0,0 +1,47 @@
1
+ import React from 'react';
2
+ import { Container } from './Button.style';
3
+
4
+ export interface ButtonProps {
5
+ /*
6
+ * A props that sets the appearance of the button
7
+ */
8
+ buttonType:
9
+ | 'primary'
10
+ | 'secondary'
11
+ | 'actionButton'
12
+ | 'actionButtonDisabled'
13
+ | 'secondaryWithStroke'
14
+ | 'secondaryCancel'
15
+ | 'actionButtonActive'
16
+ | 'actionButtonGreen';
17
+
18
+ /*
19
+ * Toggles clickability of button. Also changes appearance
20
+ */
21
+ isDisabled: boolean;
22
+
23
+ /*
24
+ * Text inside the button (default React children)
25
+ */
26
+ children: React.ReactNode;
27
+
28
+ /*
29
+ * Default React onClick
30
+ */
31
+ onClick?: (props?: React.SyntheticEvent) => void;
32
+ ['data-testid']?: string;
33
+ }
34
+
35
+ export const Button: React.FC<ButtonProps> = (props) => {
36
+ return (
37
+ <Container
38
+ data-testid={props['data-testid']}
39
+ onClick={props?.onClick}
40
+ disabled={props.isDisabled}
41
+ isDisabled={props.isDisabled}
42
+ buttonType={props.buttonType}
43
+ >
44
+ {props.children}
45
+ </Container>
46
+ );
47
+ };
@@ -0,0 +1,119 @@
1
+ import styled from 'styled-components';
2
+ import { colorConstants } from '../Theme/mindly_constants';
3
+
4
+ export const Container = styled.div`
5
+ width: 100%;
6
+ padding: 16px;
7
+ border: 1px solid ${colorConstants.StrokeGray};
8
+ box-shadow: 1px 5px 20px rgba(0, 0, 0, 0.1);
9
+ border-radius: 4px;
10
+ `;
11
+
12
+ export const InfoContainer = styled.div`
13
+ display: flex;
14
+ justify-content: space-between;
15
+ align-items: center;
16
+ height: 104px;
17
+
18
+ & .person-avatar {
19
+ border-radius: 8px;
20
+ font-weight: 700;
21
+ font-size: 41px;
22
+ line-height: 61px;
23
+ flex: 0 0 104px;
24
+ }
25
+ `;
26
+
27
+ export const TextInfo = styled.div`
28
+ display: flex;
29
+ flex-direction: column;
30
+ margin-right: 8px;
31
+ justify-content: space-around;
32
+ height: 100%;
33
+
34
+ h3 {
35
+ color: #5b5b5b;
36
+ font-weight: 400;
37
+ font-size: 14px;
38
+ line-height: 16px;
39
+ font-family: 'Inter', sans-serif;
40
+ }
41
+
42
+ span {
43
+ color: ${colorConstants.primaryColor};
44
+ font-weight: 600;
45
+ font-size: 14px;
46
+ line-height: 16px;
47
+ }
48
+
49
+ h2.time {
50
+ font-family: 'Inter';
51
+ font-style: normal;
52
+ font-weight: 600;
53
+ font-size: 14px;
54
+ line-height: 16px;
55
+ color: #1d201f;
56
+ }
57
+
58
+ div.is-free {
59
+ margin-top: 12px;
60
+ padding: 2px 7px;
61
+ border-radius: 12px;
62
+ max-width: max-content;
63
+ text-align: center;
64
+
65
+ &.greeny {
66
+ background-color: #cfe2d7;
67
+ }
68
+
69
+ &.reddy {
70
+ background-color: #ffc7c7;
71
+ }
72
+
73
+ h2 {
74
+ font-weight: 700;
75
+ font-size: 12px;
76
+ line-height: 16px;
77
+ }
78
+ }
79
+ `;
80
+
81
+ export const Photo = styled.img`
82
+ width: 104px;
83
+ height: 104px;
84
+ border-radius: 8px;
85
+ object-fit: cover;
86
+ flex: 0 0 104px;
87
+ `;
88
+
89
+ export const DividersContainer = styled.div`
90
+ margin: 16px 0 4px 0;
91
+ display: flex;
92
+ align-items: center;
93
+ justify-content: space-between;
94
+
95
+ div.divider {
96
+ height: 1px;
97
+ flex-grow: 1;
98
+ background: ${colorConstants.AccentDisabledColor};
99
+ }
100
+
101
+ h4 {
102
+ color: #c1c1c1;
103
+ margin: 0 16px;
104
+ font-size: 12px;
105
+ line-height: 14px;
106
+ }
107
+ `;
108
+
109
+ export const ButtonContainer = styled.div`
110
+ display: flex;
111
+
112
+ & button {
113
+ padding: 0;
114
+ }
115
+ `;
116
+
117
+ export const ButtonsContainer = styled.div`
118
+ margin-top: 16px;
119
+ `;