@punch-in/buffet-modern 3.3.11

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 (181) hide show
  1. package/.stylelintignore +1 -0
  2. package/README.md +50 -0
  3. package/babel.config.js +18 -0
  4. package/build/18ea3062c6e779649b89c301e4d65a7c.ttf +0 -0
  5. package/build/1d2ca94dfba6f8d87cfda33b32f0febc.woff +0 -0
  6. package/build/21b3848a32fce5b0f5014948186f6964.woff2 +0 -0
  7. package/build/6cfa65c63939188f33ef0e3a68d09306.woff +0 -0
  8. package/build/6d20cff5b3255dd0078f935c34e2b882.woff2 +0 -0
  9. package/build/75614cfcfedd509b1f7ac1c26c53bb7f.woff2 +0 -0
  10. package/build/89b618086a797a8be0f4549489bb2993.woff +0 -0
  11. package/build/8acc961684668b6e28e961e26afc2af9.ttf +0 -0
  12. package/build/a6069540692725c247f13984a9598a92.woff2 +0 -0
  13. package/build/bb14dc80e8b5d860fe9cb2362987d630.ttf +0 -0
  14. package/build/bundle.development.js +951 -0
  15. package/build/bundle.production.js +1 -0
  16. package/build/c66465590541129e82d3d6f725c5658b.woff +0 -0
  17. package/build/c7687ac11011d85e040e2ce14d5bf6eb.ttf +0 -0
  18. package/build/esm/assets/fonts/lato/Lato-Black.ttf +0 -0
  19. package/build/esm/assets/fonts/lato/Lato-Black.woff +0 -0
  20. package/build/esm/assets/fonts/lato/Lato-Black.woff2 +0 -0
  21. package/build/esm/assets/fonts/lato/Lato-Bold.ttf +0 -0
  22. package/build/esm/assets/fonts/lato/Lato-Bold.woff +0 -0
  23. package/build/esm/assets/fonts/lato/Lato-Bold.woff2 +0 -0
  24. package/build/esm/assets/fonts/lato/Lato-Regular.ttf +0 -0
  25. package/build/esm/assets/fonts/lato/Lato-Regular.woff +0 -0
  26. package/build/esm/assets/fonts/lato/Lato-Regular.woff2 +0 -0
  27. package/build/esm/assets/fonts/lato/Lato-SemiBold.ttf +0 -0
  28. package/build/esm/assets/fonts/lato/Lato-SemiBold.woff +0 -0
  29. package/build/esm/assets/fonts/lato/Lato-SemiBold.woff2 +0 -0
  30. package/build/esm/assets/icons/icon_select.svg +1 -0
  31. package/build/esm/assets/icons/icon_trash.svg +1 -0
  32. package/build/esm/assets/styles/colors.js +84 -0
  33. package/build/esm/assets/styles/mixins.js +28 -0
  34. package/build/esm/assets/styles/sizes.js +77 -0
  35. package/build/esm/components/Button/PrefixIcon.js +7 -0
  36. package/build/esm/components/Button/index.js +34 -0
  37. package/build/esm/components/Card/index.js +23 -0
  38. package/build/esm/components/Checkbox/index.js +25 -0
  39. package/build/esm/components/CheckboxWrapper/index.js +36 -0
  40. package/build/esm/components/CustomRow/index.js +12 -0
  41. package/build/esm/components/DatePicker/index.js +24 -0
  42. package/build/esm/components/Description/index.js +12 -0
  43. package/build/esm/components/Enumeration/index.js +25 -0
  44. package/build/esm/components/EnumerationWrapper/index.js +13 -0
  45. package/build/esm/components/ErrorMessage/index.js +13 -0
  46. package/build/esm/components/Fonts/index.js +31 -0
  47. package/build/esm/components/GlobalStyle/index.js +7 -0
  48. package/build/esm/components/Header/index.js +13 -0
  49. package/build/esm/components/HeaderActions/index.js +12 -0
  50. package/build/esm/components/HeaderTitle/index.js +13 -0
  51. package/build/esm/components/Icon/index.js +16 -0
  52. package/build/esm/components/IconText/index.js +9 -0
  53. package/build/esm/components/IconWrapper/index.js +16 -0
  54. package/build/esm/components/InputNumber/index.js +14 -0
  55. package/build/esm/components/InputText/index.js +24 -0
  56. package/build/esm/components/InputWrapper/index.js +13 -0
  57. package/build/esm/components/Label/index.js +13 -0
  58. package/build/esm/components/Links/index.js +13 -0
  59. package/build/esm/components/List/index.js +13 -0
  60. package/build/esm/components/ListHeader/index.js +11 -0
  61. package/build/esm/components/ListRow/index.js +11 -0
  62. package/build/esm/components/ListSubtitle/index.js +12 -0
  63. package/build/esm/components/ListTitle/index.js +13 -0
  64. package/build/esm/components/LoadingBar/index.js +14 -0
  65. package/build/esm/components/LoadingIndicator/index.js +69 -0
  66. package/build/esm/components/Option/index.js +37 -0
  67. package/build/esm/components/Paging/index.js +13 -0
  68. package/build/esm/components/Select/index.js +14 -0
  69. package/build/esm/components/Tab/index.js +30 -0
  70. package/build/esm/components/Table/index.js +13 -0
  71. package/build/esm/components/TableRowEmpty/index.js +13 -0
  72. package/build/esm/components/Textarea/index.js +13 -0
  73. package/build/esm/components/TimeList/index.js +13 -0
  74. package/build/esm/components/TimePicker/index.js +20 -0
  75. package/build/esm/components/TimePickerWrapper/index.js +13 -0
  76. package/build/esm/components/Toggle/index.js +25 -0
  77. package/build/esm/components/ToggleWrapper/index.js +13 -0
  78. package/build/esm/components/Tooltip/index.js +28 -0
  79. package/build/esm/index.js +46 -0
  80. package/build/index.js +8 -0
  81. package/package.json +113 -0
  82. package/src/assets/fonts/lato/Lato-Black.ttf +0 -0
  83. package/src/assets/fonts/lato/Lato-Black.woff +0 -0
  84. package/src/assets/fonts/lato/Lato-Black.woff2 +0 -0
  85. package/src/assets/fonts/lato/Lato-Bold.ttf +0 -0
  86. package/src/assets/fonts/lato/Lato-Bold.woff +0 -0
  87. package/src/assets/fonts/lato/Lato-Bold.woff2 +0 -0
  88. package/src/assets/fonts/lato/Lato-Regular.ttf +0 -0
  89. package/src/assets/fonts/lato/Lato-Regular.woff +0 -0
  90. package/src/assets/fonts/lato/Lato-Regular.woff2 +0 -0
  91. package/src/assets/fonts/lato/Lato-SemiBold.ttf +0 -0
  92. package/src/assets/fonts/lato/Lato-SemiBold.woff +0 -0
  93. package/src/assets/fonts/lato/Lato-SemiBold.woff2 +0 -0
  94. package/src/assets/icons/icon_select.svg +1 -0
  95. package/src/assets/icons/icon_trash.svg +1 -0
  96. package/src/assets/styles/colors.js +92 -0
  97. package/src/assets/styles/mixins.js +45 -0
  98. package/src/assets/styles/sizes.js +87 -0
  99. package/src/components/Button/PrefixIcon.js +11 -0
  100. package/src/components/Button/index.js +122 -0
  101. package/src/components/Button/tests/__snapshots__/index.test.js.snap +169 -0
  102. package/src/components/Button/tests/index.test.js +91 -0
  103. package/src/components/Card/index.js +73 -0
  104. package/src/components/Checkbox/index.js +141 -0
  105. package/src/components/Checkbox/tests/Checkbox.test.js +19 -0
  106. package/src/components/Checkbox/tests/__snapshots__/Checkbox.test.js.snap +71 -0
  107. package/src/components/CheckboxWrapper/index.js +100 -0
  108. package/src/components/CustomRow/index.js +21 -0
  109. package/src/components/DatePicker/index.js +280 -0
  110. package/src/components/DatePicker/tests/Datepicker.test.js +12 -0
  111. package/src/components/Description/index.js +17 -0
  112. package/src/components/Enumeration/index.js +40 -0
  113. package/src/components/Enumeration/tests/Enumeration.test.js +12 -0
  114. package/src/components/EnumerationWrapper/index.js +47 -0
  115. package/src/components/ErrorMessage/index.js +18 -0
  116. package/src/components/Fonts/index.js +83 -0
  117. package/src/components/GlobalStyle/index.js +68 -0
  118. package/src/components/Header/index.js +73 -0
  119. package/src/components/Header/tests/__snapshots__/index.test.js.snap +75 -0
  120. package/src/components/Header/tests/index.test.js +18 -0
  121. package/src/components/HeaderActions/index.js +30 -0
  122. package/src/components/HeaderActions/tests/__snapshots__/index.test.js.snap +34 -0
  123. package/src/components/HeaderActions/tests/index.test.js +19 -0
  124. package/src/components/HeaderTitle/index.js +47 -0
  125. package/src/components/HeaderTitle/tests/__snapshots__/index.test.js.snap +39 -0
  126. package/src/components/HeaderTitle/tests/index.test.js +19 -0
  127. package/src/components/Icon/index.js +17 -0
  128. package/src/components/IconText/index.js +18 -0
  129. package/src/components/IconWrapper/index.js +29 -0
  130. package/src/components/InputNumber/index.js +209 -0
  131. package/src/components/InputNumber/tests/index.test.js +12 -0
  132. package/src/components/InputText/index.js +70 -0
  133. package/src/components/InputText/tests/index.test.js +39 -0
  134. package/src/components/InputWrapper/index.js +57 -0
  135. package/src/components/Label/index.js +18 -0
  136. package/src/components/Label/tests/index.test.js +12 -0
  137. package/src/components/Links/index.js +35 -0
  138. package/src/components/List/index.js +85 -0
  139. package/src/components/ListHeader/index.js +13 -0
  140. package/src/components/ListHeader/tests/index.test.js +12 -0
  141. package/src/components/ListRow/index.js +17 -0
  142. package/src/components/ListRow/tests/index.test.js +12 -0
  143. package/src/components/ListSubtitle/index.js +17 -0
  144. package/src/components/ListSubtitle/tests/index.test.js +12 -0
  145. package/src/components/ListTitle/index.js +20 -0
  146. package/src/components/ListTitle/tests/index.test.js +12 -0
  147. package/src/components/LoadingBar/index.js +41 -0
  148. package/src/components/LoadingBar/tests/index.test.js +19 -0
  149. package/src/components/LoadingIndicator/index.js +81 -0
  150. package/src/components/Option/index.js +39 -0
  151. package/src/components/Option/tests/__snapshots__/index.test.js.snap +29 -0
  152. package/src/components/Option/tests/index.test.js +16 -0
  153. package/src/components/Paging/index.js +68 -0
  154. package/src/components/Select/index.js +54 -0
  155. package/src/components/Select/tests/index.test.js +12 -0
  156. package/src/components/Tab/index.js +78 -0
  157. package/src/components/Table/index.js +147 -0
  158. package/src/components/TableRowEmpty/index.js +28 -0
  159. package/src/components/Textarea/index.js +50 -0
  160. package/src/components/Textarea/tests/__snapshots__/index.test.js.snap +71 -0
  161. package/src/components/Textarea/tests/index.test.js +33 -0
  162. package/src/components/TimeList/index.js +78 -0
  163. package/src/components/TimePicker/index.js +59 -0
  164. package/src/components/TimePickerWrapper/index.js +57 -0
  165. package/src/components/Toggle/index.js +82 -0
  166. package/src/components/Toggle/tests/index.test.js +12 -0
  167. package/src/components/ToggleWrapper/index.js +36 -0
  168. package/src/components/Tooltip/index.js +34 -0
  169. package/src/index.js +47 -0
  170. package/webfonts/Lato-Black.ttf +0 -0
  171. package/webfonts/Lato-Black.woff +0 -0
  172. package/webfonts/Lato-Black.woff2 +0 -0
  173. package/webfonts/Lato-Bold.ttf +0 -0
  174. package/webfonts/Lato-Bold.woff +0 -0
  175. package/webfonts/Lato-Bold.woff2 +0 -0
  176. package/webfonts/Lato-Regular.ttf +0 -0
  177. package/webfonts/Lato-Regular.woff +0 -0
  178. package/webfonts/Lato-Regular.woff2 +0 -0
  179. package/webfonts/Lato-SemiBold.ttf +0 -0
  180. package/webfonts/Lato-SemiBold.woff +0 -0
  181. package/webfonts/Lato-SemiBold.woff2 +0 -0
@@ -0,0 +1,68 @@
1
+ /**
2
+ *
3
+ * Paging
4
+ *
5
+ */
6
+
7
+ import styled from 'styled-components';
8
+
9
+ import colors from '../../assets/styles/colors';
10
+ import sizes from '../../assets/styles/sizes';
11
+
12
+ const Paging = styled.div`
13
+ ul.pagination {
14
+ display: flex;
15
+ flex-wrap: wrap;
16
+ justify-content: center;
17
+ align-items: center;
18
+ gap: ${sizes.spacing.sm}px;
19
+ margin: 0;
20
+ padding: 0;
21
+ font-size: 1.2rem;
22
+ list-style: none;
23
+
24
+ .page-item {
25
+ display: inline-flex;
26
+ align-items: center;
27
+ justify-content: center;
28
+ position: relative;
29
+
30
+ .page-link {
31
+ box-shadow: none;
32
+ font-family: 'Lato', -apple-system, BlinkMacSystemFont, sans-serif;
33
+ font-size: 1.2rem;
34
+ background-color: transparent;
35
+ color: ${colors.blueTxt};
36
+ padding: ${sizes.spacing.sm}px ${sizes.spacing.md}px;
37
+ border-radius: ${sizes.borderRadiusSm};
38
+ transition: background-color 0.2s ease, color 0.2s ease;
39
+
40
+ &:hover {
41
+ background-color: ${colors.greyHover};
42
+ }
43
+
44
+ &:focus-visible {
45
+ outline: 2px solid ${colors.blue};
46
+ outline-offset: 2px;
47
+ }
48
+ }
49
+
50
+ &.selected {
51
+ .page-link {
52
+ font-weight: ${sizes.fontWeight.bold};
53
+ color: ${colors.blue};
54
+ }
55
+ }
56
+
57
+ &:first-of-type,
58
+ &:last-of-type {
59
+ .page-link {
60
+ min-width: 24px;
61
+ min-height: 24px;
62
+ }
63
+ }
64
+ }
65
+ }
66
+ `;
67
+
68
+ export default Paging;
@@ -0,0 +1,54 @@
1
+ /**
2
+ *
3
+ * Select
4
+ *
5
+ */
6
+
7
+ import styled from 'styled-components';
8
+ import colors from '../../assets/styles/colors';
9
+ import sizes from '../../assets/styles/sizes';
10
+ import img from '../../assets/icons/icon_select.svg';
11
+
12
+ const Select = styled.select`
13
+ width: 100%;
14
+ height: ${sizes.input.height};
15
+ padding: 0 ${sizes.input.padding};
16
+ padding-right: 30px;
17
+ font-weight: ${sizes.fontWeight.regular};
18
+ font-size: ${sizes.input.fontSize};
19
+ cursor: pointer;
20
+ outline: 0;
21
+ border: 1px solid ${colors.lightGrey};
22
+ border-radius: ${sizes.borderRadius};
23
+ color: ${colors.blueTxt};
24
+ background-color: ${colors.white};
25
+ appearance: none;
26
+ -webkit-appearance: none;
27
+ -moz-appearance: none;
28
+ background-image: url(${img});
29
+ background-repeat: no-repeat;
30
+ background-position: right center;
31
+ transition: border-color 0.2s ease, box-shadow 0.2s ease;
32
+
33
+ &::-webkit-input-placeholder {
34
+ color: ${colors.greyPlaceholder};
35
+ }
36
+
37
+ &:focus {
38
+ border-color: ${colors.blueBorder};
39
+ box-shadow: 0 0 0 3px ${colors.blueFocusRing};
40
+ }
41
+
42
+ &:focus-visible {
43
+ outline: none;
44
+ }
45
+
46
+ &:disabled {
47
+ background-color: ${colors.greyIconBkgd};
48
+ cursor: not-allowed;
49
+ color: ${colors.brightGrey};
50
+ opacity: 1;
51
+ }
52
+ `;
53
+
54
+ export default Select;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { shallow } from 'enzyme';
3
+
4
+ import Select from '../index';
5
+
6
+ const renderComponent = () => shallow(<Select />);
7
+
8
+ describe('<Select />', () => {
9
+ it('should not crash', () => {
10
+ renderComponent();
11
+ });
12
+ });
@@ -0,0 +1,78 @@
1
+ /**
2
+ *
3
+ * Tab
4
+ *
5
+ */
6
+
7
+ import styled from 'styled-components';
8
+ import PropTypes from 'prop-types';
9
+
10
+ import sizes from '../../assets/styles/sizes';
11
+ import colors from '../../assets/styles/colors';
12
+
13
+ const Tab = styled.li`
14
+ display: inline-block;
15
+ width: calc(100% / ${props => props.count});
16
+ height: 3.6rem;
17
+
18
+ &:first-of-type a {
19
+ border-top-left-radius: ${sizes.borderRadiusSm};
20
+ }
21
+
22
+ &:last-of-type a {
23
+ border-top-right-radius: ${sizes.borderRadiusSm};
24
+ }
25
+
26
+ button {
27
+ width: 100%;
28
+ height: 100%;
29
+ border: 0;
30
+ padding: 0;
31
+ margin: 0;
32
+ background: transparent;
33
+ }
34
+
35
+ a {
36
+ display: flex;
37
+ width: 100%;
38
+ height: 100%;
39
+ padding: 0 ${sizes.margin * 2}px;
40
+ color: ${colors.blueTxt};
41
+ font-family: 'Lato', -apple-system, BlinkMacSystemFont, sans-serif;
42
+ font-size: 1.3rem;
43
+ text-align: center;
44
+ white-space: nowrap;
45
+ overflow: hidden;
46
+ text-overflow: ellipsis;
47
+ text-decoration: none;
48
+ cursor: pointer;
49
+ background-color: ${props => props.background};
50
+ border-top: 3px solid ${props => props.background};
51
+ border-bottom: 3px solid ${props => props.background};
52
+ transition: background-color 0.2s ease, border-color 0.2s ease;
53
+
54
+ p,
55
+ span {
56
+ margin: auto;
57
+ }
58
+
59
+ &.active {
60
+ border-top: 3px solid ${colors.blueTabBorder};
61
+ border-bottom: 3px solid ${colors.white};
62
+ background-color: ${colors.white};
63
+ font-weight: ${sizes.fontWeight.bold};
64
+ }
65
+ }
66
+ `;
67
+
68
+ Tab.defaultProps = {
69
+ index: 1,
70
+ background: colors.greyTabBkgd,
71
+ };
72
+
73
+ Tab.propTypes = {
74
+ background: PropTypes.string,
75
+ index: PropTypes.number,
76
+ };
77
+
78
+ export default Tab;
@@ -0,0 +1,147 @@
1
+ /**
2
+ *
3
+ * Table
4
+ *
5
+ */
6
+
7
+ import styled from 'styled-components';
8
+
9
+ import colors from '../../assets/styles/colors';
10
+ import sizes from '../../assets/styles/sizes';
11
+
12
+ const Table = styled.div`
13
+ width: 100%;
14
+ position: relative;
15
+ overflow-x: auto;
16
+ border-radius: ${sizes.borderRadiusLg};
17
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
18
+ background: ${colors.white};
19
+
20
+ table {
21
+ width: 100%;
22
+ min-width: 500px;
23
+ font-family: 'Lato', -apple-system, BlinkMacSystemFont, sans-serif;
24
+ border-collapse: collapse;
25
+
26
+ &.rowsSelected {
27
+ tbody::before {
28
+ content: '-';
29
+ height: ${sizes.table.deleteRow.height};
30
+ display: block;
31
+ }
32
+ }
33
+ }
34
+
35
+ .deleteRow {
36
+ height: ${sizes.table.deleteRow.height};
37
+ padding: 0 ${sizes.spacing.xl}px;
38
+ font-size: 1.3rem;
39
+ line-height: ${sizes.table.deleteRow.height};
40
+ background-color: ${colors.greyHover};
41
+ font-weight: ${sizes.fontWeight.bold};
42
+
43
+ button {
44
+ border: none;
45
+ background: transparent;
46
+ color: ${colors.darkOrange};
47
+ outline: 0;
48
+ transition: color 0.2s ease;
49
+
50
+ &:focus-visible {
51
+ outline: 2px solid ${colors.blue};
52
+ outline-offset: 2px;
53
+ }
54
+
55
+ svg {
56
+ margin-left: ${sizes.margin}px;
57
+ }
58
+ }
59
+ }
60
+
61
+ th,
62
+ td {
63
+ font-size: 1.3rem;
64
+ padding: 0 ${sizes.spacing.xl}px;
65
+ text-align: left;
66
+
67
+ &.checkCell {
68
+ width: 50px;
69
+ }
70
+ }
71
+
72
+ thead {
73
+ tr {
74
+ font-weight: ${sizes.fontWeight.bold};
75
+ text-transform: capitalize;
76
+
77
+ th {
78
+ background-color: ${colors.greyHeader};
79
+ height: ${sizes.table.header.height};
80
+
81
+ p {
82
+ padding-right: ${sizes.margin * 1.4}px;
83
+ color: ${colors.blueTxt};
84
+
85
+ &.clickable {
86
+ cursor: pointer;
87
+ }
88
+ }
89
+
90
+ svg {
91
+ position: absolute;
92
+ right: 0;
93
+ top: 0;
94
+
95
+ &.fa-sort-up {
96
+ top: 4px;
97
+ }
98
+
99
+ &.fa-sort-down {
100
+ top: -${sizes.margin * 0.2}px;
101
+ }
102
+ }
103
+ }
104
+ }
105
+ }
106
+
107
+ tbody {
108
+ background-color: ${colors.greyHover};
109
+ color: ${colors.blueTxt};
110
+
111
+ tr {
112
+ border-bottom: 1px solid ${colors.greySeparator};
113
+ background-color: ${colors.white};
114
+ cursor: pointer;
115
+ transition: background-color 0.15s ease;
116
+
117
+ &:hover {
118
+ background-color: ${colors.greyHover};
119
+ }
120
+
121
+ &:not(.deleteRow) {
122
+ td {
123
+ height: ${sizes.table.row.height};
124
+ }
125
+ }
126
+ }
127
+
128
+ td {
129
+ p {
130
+ overflow-x: hidden;
131
+ text-overflow: ellipsis;
132
+ white-space: nowrap;
133
+ line-height: 1.5;
134
+ }
135
+ }
136
+ }
137
+
138
+ span.link-icon svg {
139
+ color: ${colors.blueTxt};
140
+ }
141
+
142
+ @media (min-width: ${sizes.tablet}) {
143
+ overflow-x: auto;
144
+ }
145
+ `;
146
+
147
+ export default Table;
@@ -0,0 +1,28 @@
1
+ /**
2
+ *
3
+ * TableRowEmpty
4
+ *
5
+ */
6
+
7
+ import styled from 'styled-components';
8
+ import colors from '../../assets/styles/colors';
9
+ import sizes from '../../assets/styles/sizes';
10
+
11
+ const TableRowEmpty = styled.tr`
12
+ width: 100%;
13
+ height: 108px;
14
+ background: ${colors.white};
15
+
16
+ td {
17
+ height: 106px;
18
+ line-height: 106px;
19
+ font-size: 1.3rem;
20
+ font-weight: ${sizes.fontWeight.regular};
21
+ color: ${colors.blueTxt};
22
+ text-align: center;
23
+ border-collapse: collapse;
24
+ border-top: 1px solid ${colors.greySeparator};
25
+ }
26
+ `;
27
+
28
+ export default TableRowEmpty;
@@ -0,0 +1,50 @@
1
+ /**
2
+ *
3
+ * Textarea
4
+ *
5
+ */
6
+
7
+ import styled from 'styled-components';
8
+ import colors from '../../assets/styles/colors';
9
+ import sizes from '../../assets/styles/sizes';
10
+
11
+ const StyledTextarea = styled.textarea`
12
+ width: 100%;
13
+ min-height: 12rem;
14
+ padding: ${sizes.textarea.padding} ${sizes.input.padding};
15
+ font-weight: ${sizes.fontWeight.regular};
16
+ font-size: ${sizes.input.fontSize};
17
+ outline: 0;
18
+ border: 1px solid ${colors.lightGrey};
19
+ border-radius: ${sizes.borderRadius};
20
+ color: ${colors.blueTxt};
21
+ background-color: ${colors.white};
22
+ line-height: 1.5;
23
+ resize: vertical;
24
+ transition: border-color 0.2s ease, box-shadow 0.2s ease;
25
+
26
+ &::placeholder {
27
+ color: ${colors.greyPlaceholder};
28
+ }
29
+
30
+ &::-webkit-input-placeholder {
31
+ color: ${colors.greyPlaceholder};
32
+ }
33
+
34
+ &:focus {
35
+ border-color: ${colors.blueBorder};
36
+ box-shadow: 0 0 0 3px ${colors.blueFocusRing};
37
+ }
38
+
39
+ &:focus-visible {
40
+ outline: none;
41
+ }
42
+
43
+ &:disabled {
44
+ background-color: ${colors.greyIconBkgd};
45
+ cursor: not-allowed;
46
+ color: ${colors.brightGrey};
47
+ }
48
+ `;
49
+
50
+ export default StyledTextarea;
@@ -0,0 +1,71 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`<Textarea /> should match the snapshot when empty 1`] = `
4
+ .c0 {
5
+ width: 100%;
6
+ height: 19.1rem;
7
+ padding: 0.6rem 1rem;
8
+ font-weight: 400;
9
+ font-size: 1.3rem;
10
+ outline: 0;
11
+ border: 1px solid #E3E9F3;
12
+ border-radius: 2px;
13
+ color: #333740;
14
+ background-color: #ffffff;
15
+ line-height: 18px;
16
+ }
17
+
18
+ .c0::-webkit-input-placeholder {
19
+ color: #919BAE;
20
+ }
21
+
22
+ .c0:focus {
23
+ border-color: #78caff;
24
+ }
25
+
26
+ .c0:disabled {
27
+ background-color: #FAFAFB;
28
+ cursor: not-allowed;
29
+ color: #9ea7b8;
30
+ }
31
+
32
+ <textarea
33
+ className="c0"
34
+ placeholder="Write a short description"
35
+ />
36
+ `;
37
+
38
+ exports[`<Textarea /> should match the snapshot when not empty 1`] = `
39
+ .c0 {
40
+ width: 100%;
41
+ height: 19.1rem;
42
+ padding: 0.6rem 1rem;
43
+ font-weight: 400;
44
+ font-size: 1.3rem;
45
+ outline: 0;
46
+ border: 1px solid #E3E9F3;
47
+ border-radius: 2px;
48
+ color: #333740;
49
+ background-color: #ffffff;
50
+ line-height: 18px;
51
+ }
52
+
53
+ .c0::-webkit-input-placeholder {
54
+ color: #919BAE;
55
+ }
56
+
57
+ .c0:focus {
58
+ border-color: #78caff;
59
+ }
60
+
61
+ .c0:disabled {
62
+ background-color: #FAFAFB;
63
+ cursor: not-allowed;
64
+ color: #9ea7b8;
65
+ }
66
+
67
+ <textarea
68
+ className="c0"
69
+ value="Short description"
70
+ />
71
+ `;
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+ import { shallow } from 'enzyme';
3
+ import renderer from 'react-test-renderer';
4
+
5
+ import Textarea from '../index';
6
+
7
+ const renderComponent = () => {
8
+ const wrapper = shallow(<Textarea />);
9
+
10
+ return wrapper;
11
+ };
12
+
13
+ describe('<Textarea />', () => {
14
+ it('should not crash', () => {
15
+ renderComponent();
16
+ });
17
+
18
+ it('should match the snapshot when empty', () => {
19
+ const tree = renderer
20
+ .create(<Textarea placeholder="Write a short description" />)
21
+ .toJSON();
22
+
23
+ expect(tree).toMatchSnapshot();
24
+ });
25
+
26
+ it('should match the snapshot when not empty', () => {
27
+ const tree = renderer
28
+ .create(<Textarea value="Short description" />)
29
+ .toJSON();
30
+
31
+ expect(tree).toMatchSnapshot();
32
+ });
33
+ });
@@ -0,0 +1,78 @@
1
+ /**
2
+ *
3
+ * TimeList
4
+ *
5
+ */
6
+
7
+ import styled from 'styled-components';
8
+ import colors from '../../assets/styles/colors';
9
+ import sizes from '../../assets/styles/sizes';
10
+
11
+ const TimeList = styled.ul`
12
+ width: 100%;
13
+ height: 0;
14
+ font-family: 'Lato', -apple-system, BlinkMacSystemFont, sans-serif;
15
+ font-weight: ${sizes.fontWeight.bold};
16
+ font-size: ${sizes.input.fontSize};
17
+ color: ${colors.greyIconColor};
18
+ border: 1px solid transparent;
19
+ border-bottom-left-radius: ${sizes.borderRadiusSm};
20
+ border-bottom-right-radius: ${sizes.borderRadiusSm};
21
+ list-style: none;
22
+ padding: 0;
23
+ margin: 0;
24
+ overflow-x: hidden;
25
+ overflow-y: scroll;
26
+ transition: height 0.2s ease-out, visibility 0.2s ease-out,
27
+ border-color 0.2s ease-out;
28
+ visibility: hidden;
29
+
30
+ ::-webkit-scrollbar {
31
+ width: 0;
32
+ }
33
+ overflow: -moz-scrollbars-none;
34
+ -ms-overflow-style: none;
35
+ scrollbar-width: none;
36
+
37
+ &.displayed {
38
+ height: ${sizes.timepicker.list.height};
39
+ visibility: visible;
40
+ border-color: ${colors.lightGrey};
41
+ }
42
+
43
+ li {
44
+ position: relative;
45
+
46
+ input {
47
+ position: absolute;
48
+ top: 0;
49
+ left: 0;
50
+ width: 100%;
51
+ height: 100%;
52
+ margin: 0;
53
+ opacity: 0;
54
+ z-index: 1;
55
+ cursor: pointer;
56
+
57
+ &:checked + label,
58
+ &:hover + label {
59
+ background-color: ${colors.greyIconBkgd};
60
+ }
61
+ }
62
+
63
+ label {
64
+ display: block;
65
+ position: relative;
66
+ z-index: 0;
67
+ width: 100%;
68
+ height: 100%;
69
+ padding: ${sizes.margin * 0.4}px 0 ${sizes.margin * 0.2}px
70
+ calc(${sizes.input.height} + ${sizes.input.padding});
71
+ font-size: 1.3rem;
72
+ line-height: 30px;
73
+ margin-bottom: 0;
74
+ }
75
+ }
76
+ `;
77
+
78
+ export default TimeList;
@@ -0,0 +1,59 @@
1
+ /**
2
+ *
3
+ * TimePicker
4
+ *
5
+ */
6
+
7
+ import styled from 'styled-components';
8
+ import PropTypes from 'prop-types';
9
+ import colors from '../../assets/styles/colors';
10
+ import sizes from '../../assets/styles/sizes';
11
+
12
+ const TimePicker = styled.input`
13
+ width: 100%;
14
+ height: ${sizes.input.height};
15
+ padding: 0 ${sizes.input.padding};
16
+ padding-left: calc(${sizes.input.height} + ${sizes.input.padding});
17
+ font-family: 'Lato', -apple-system, BlinkMacSystemFont, sans-serif;
18
+ font-weight: ${sizes.fontWeight.regular};
19
+ font-size: ${sizes.input.fontSize};
20
+ cursor: pointer;
21
+ outline: 0;
22
+ border: 1px solid ${colors.lightGrey};
23
+ border-radius: ${sizes.borderRadius};
24
+ color: ${colors.blueTxt};
25
+ background-color: transparent;
26
+ transition: border-color 0.2s ease, box-shadow 0.2s ease;
27
+
28
+ &::placeholder {
29
+ color: ${colors.greyPlaceholder};
30
+ }
31
+
32
+ &::-webkit-input-placeholder {
33
+ color: ${colors.greyPlaceholder};
34
+ }
35
+
36
+ &:focus {
37
+ border-color: ${colors.blueBorder};
38
+ box-shadow: 0 0 0 3px ${colors.blueFocusRing};
39
+ }
40
+
41
+ &:focus-visible {
42
+ outline: none;
43
+ }
44
+
45
+ &:disabled {
46
+ cursor: not-allowed;
47
+ color: ${colors.brightGrey};
48
+ }
49
+ `;
50
+
51
+ TimePicker.defaultProps = {
52
+ type: 'text',
53
+ };
54
+
55
+ TimePicker.propTypes = {
56
+ type: PropTypes.string,
57
+ };
58
+
59
+ export default TimePicker;