@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,70 @@
1
+ /**
2
+ *
3
+ * InputText
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 InputText = styled.input`
13
+ width: 100%;
14
+ height: ${sizes.input.height};
15
+ padding: 0 ${sizes.input.padding};
16
+ font-weight: ${sizes.fontWeight.regular};
17
+ font-size: ${sizes.input.fontSize};
18
+ cursor: text;
19
+ outline: 0;
20
+ border: 1px solid ${colors.lightGrey};
21
+ border-radius: ${sizes.borderRadius};
22
+ color: ${colors.blueTxt};
23
+ background-color: transparent;
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
+ ${props =>
50
+ (props.type === 'search' || props.type === 'email' || props.icon) &&
51
+ `
52
+ padding-left: calc(${sizes.input.height} + ${sizes.input.padding});
53
+ `}
54
+
55
+ ${props =>
56
+ props.type === 'password' &&
57
+ `
58
+ padding-right: calc(${sizes.input.height} + ${sizes.input.padding});
59
+ `}
60
+ `;
61
+
62
+ InputText.defaultProps = {
63
+ type: 'text',
64
+ };
65
+
66
+ InputText.propTypes = {
67
+ type: PropTypes.string,
68
+ };
69
+
70
+ export default InputText;
@@ -0,0 +1,39 @@
1
+ import React from 'react';
2
+ import { shallow } from 'enzyme';
3
+ import renderer from 'react-test-renderer';
4
+
5
+ import InputText from '../index';
6
+
7
+ import sizes from '../../../assets/styles/sizes';
8
+
9
+ const renderComponent = () => shallow(<InputText />);
10
+
11
+ describe('<InputText />', () => {
12
+ it('should not crash', () => {
13
+ renderComponent();
14
+ });
15
+
16
+ describe('<InputText /> style', () => {
17
+ it('should render left icon space if type is search', () => {
18
+ const tree = renderer.create(<InputText type="search" />).toJSON();
19
+ expect(tree).toHaveStyleRule(
20
+ 'padding-left',
21
+ `calc(${sizes.input.height} + ${sizes.input.padding})`
22
+ );
23
+ });
24
+ it('should render left icon space if type is email', () => {
25
+ const tree = renderer.create(<InputText type="email" />).toJSON();
26
+ expect(tree).toHaveStyleRule(
27
+ 'padding-left',
28
+ `calc(${sizes.input.height} + ${sizes.input.padding})`
29
+ );
30
+ });
31
+ it('should render right icon space if type is password', () => {
32
+ const tree = renderer.create(<InputText type="password" />).toJSON();
33
+ expect(tree).toHaveStyleRule(
34
+ 'padding-right',
35
+ `calc(${sizes.input.height} + ${sizes.input.padding})`
36
+ );
37
+ });
38
+ });
39
+ });
@@ -0,0 +1,57 @@
1
+ /**
2
+ *
3
+ * InputWrapper
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 InputWrapper = styled.div`
12
+ position: relative;
13
+ background-color: ${colors.white};
14
+ border-radius: ${sizes.borderRadius};
15
+
16
+ button[type='button'] {
17
+ width: ${sizes.input.height};
18
+ height: ${sizes.input.height};
19
+ position: absolute;
20
+ top: 0;
21
+ right: 0;
22
+ z-index: 2;
23
+ cursor: pointer;
24
+ outline: 0;
25
+ border: 0;
26
+ background: transparent;
27
+ transition: color 0.2s ease;
28
+
29
+ &:hover {
30
+ span::before {
31
+ color: ${colors.blueTxt};
32
+ }
33
+ }
34
+
35
+ &.shown {
36
+ span::before {
37
+ color: ${colors.blueTxt};
38
+ }
39
+
40
+ & + input[type='text'] {
41
+ padding-right: calc(${sizes.input.height} + ${sizes.input.padding});
42
+ }
43
+ }
44
+ }
45
+
46
+ span {
47
+ border-top-left-radius: ${sizes.borderRadius};
48
+ border-bottom-left-radius: ${sizes.borderRadius};
49
+ }
50
+
51
+ input {
52
+ position: relative;
53
+ z-index: 1;
54
+ }
55
+ `;
56
+
57
+ export default InputWrapper;
@@ -0,0 +1,18 @@
1
+ /**
2
+ *
3
+ * Label
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 Label = styled.label`
12
+ width: 100%;
13
+ font-weight: ${sizes.fontWeight.semiBold};
14
+ font-size: ${sizes.input.fontSize};
15
+ color: ${colors.blueTxt};
16
+ `;
17
+
18
+ export default Label;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { shallow } from 'enzyme';
3
+
4
+ import Label from '../index';
5
+
6
+ const renderComponent = () => shallow(<Label />);
7
+
8
+ describe('<Label />', () => {
9
+ it('should not crash', () => {
10
+ renderComponent();
11
+ });
12
+ });
@@ -0,0 +1,35 @@
1
+ /**
2
+ *
3
+ * Links
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 Links = styled.div`
12
+ display: flex;
13
+ justify-content: flex-end;
14
+ gap: ${sizes.spacing.sm}px;
15
+
16
+ button {
17
+ background: transparent;
18
+ border: 0;
19
+ outline: 0;
20
+ color: ${colors.blueTxt};
21
+ transition: color 0.2s ease, opacity 0.2s ease;
22
+
23
+ &:focus-visible {
24
+ outline: 2px solid ${colors.blue};
25
+ outline-offset: 2px;
26
+ }
27
+
28
+ svg {
29
+ font-size: 1rem;
30
+ color: ${colors.blueTxt};
31
+ }
32
+ }
33
+ `;
34
+
35
+ export default Links;
@@ -0,0 +1,85 @@
1
+ /**
2
+ *
3
+ * List
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 List = styled.div`
12
+ width: 100%;
13
+ position: relative;
14
+ overflow-x: auto;
15
+ border-radius: ${sizes.borderRadius};
16
+ background: ${colors.white};
17
+
18
+ table {
19
+ border-collapse: collapse;
20
+ width: 100%;
21
+ min-width: 500px;
22
+ font-family: 'Lato', -apple-system, BlinkMacSystemFont, sans-serif;
23
+ }
24
+
25
+ thead {
26
+ tr {
27
+ height: 3rem;
28
+ line-height: 0.1rem;
29
+ font-weight: ${sizes.fontWeight.bold};
30
+ text-transform: capitalize;
31
+
32
+ td {
33
+ background-color: ${colors.greyHeader};
34
+ }
35
+ }
36
+ }
37
+
38
+ tbody {
39
+ color: ${colors.blueTxt};
40
+
41
+ tr {
42
+ height: 5.4rem;
43
+ transition: background-color 0.15s ease;
44
+
45
+ &::before {
46
+ content: '-';
47
+ display: inline-block;
48
+ line-height: 1.1em;
49
+ color: transparent;
50
+ background-color: transparent;
51
+ position: absolute;
52
+ left: 3rem;
53
+ width: calc(100% - 6rem);
54
+ height: 1px;
55
+ margin-top: -${sizes.margin * 0.1}px;
56
+ }
57
+
58
+ &:not(:first-of-type)::before {
59
+ background-color: rgba(14, 22, 34, 0.04);
60
+ }
61
+ }
62
+
63
+ td {
64
+ padding: 0.75em;
65
+ vertical-align: middle;
66
+ font-size: 1.3rem;
67
+ line-height: 1.8rem;
68
+
69
+ &:first-of-type:not(:last-of-type) {
70
+ padding-left: 3rem;
71
+ }
72
+
73
+ &:last-of-type:not(:first-of-type) {
74
+ padding-right: 3rem;
75
+ }
76
+ }
77
+ }
78
+
79
+ @media (min-width: ${sizes.tablet}) {
80
+ width: 100%;
81
+ overflow-x: auto;
82
+ }
83
+ `;
84
+
85
+ export default List;
@@ -0,0 +1,13 @@
1
+ /**
2
+ *
3
+ * ListHeader
4
+ *
5
+ */
6
+
7
+ import styled from 'styled-components';
8
+
9
+ const ListHeader = styled.div`
10
+ position: relative;
11
+ `;
12
+
13
+ export default ListHeader;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { shallow } from 'enzyme';
3
+
4
+ import ListHeader from '../index';
5
+
6
+ const renderComponent = () => shallow(<ListHeader />);
7
+
8
+ describe('<ListHeader />', () => {
9
+ it('should not crash', () => {
10
+ renderComponent();
11
+ });
12
+ });
@@ -0,0 +1,17 @@
1
+ /**
2
+ *
3
+ * ListRow
4
+ *
5
+ */
6
+
7
+ import styled from 'styled-components';
8
+
9
+ const ListRow = styled.tr`
10
+ td {
11
+ padding-left: 0.75em;
12
+ padding-right: 0.75em;
13
+ text-align: left;
14
+ }
15
+ `;
16
+
17
+ export default ListRow;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { shallow } from 'enzyme';
3
+
4
+ import ListRow from '../index';
5
+
6
+ const renderComponent = () => shallow(<ListRow />);
7
+
8
+ describe('<ListRow />', () => {
9
+ it('should not crash', () => {
10
+ renderComponent();
11
+ });
12
+ });
@@ -0,0 +1,17 @@
1
+ /**
2
+ *
3
+ * ListSubtitle
4
+ *
5
+ */
6
+
7
+ import styled from 'styled-components';
8
+ import colors from '../../assets/styles/colors';
9
+
10
+ const ListSubtitle = styled.p`
11
+ font-family: 'Lato', -apple-system, BlinkMacSystemFont, sans-serif;
12
+ color: ${colors.greySubtitle};
13
+ font-size: 1.3rem;
14
+ line-height: 1.5;
15
+ `;
16
+
17
+ export default ListSubtitle;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { shallow } from 'enzyme';
3
+
4
+ import ListSubtitle from '../index';
5
+
6
+ const renderComponent = () => shallow(<ListSubtitle />);
7
+
8
+ describe('<ListSubtitle />', () => {
9
+ it('should not crash', () => {
10
+ renderComponent();
11
+ });
12
+ });
@@ -0,0 +1,20 @@
1
+ /**
2
+ *
3
+ * ListTitle
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 ListTitle = styled.p`
13
+ color: ${colors.blueTxt};
14
+ font-family: 'Lato', -apple-system, BlinkMacSystemFont, sans-serif;
15
+ font-size: 1.8rem;
16
+ font-weight: ${sizes.fontWeight.bold};
17
+ line-height: 1.4;
18
+ `;
19
+
20
+ export default ListTitle;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { shallow } from 'enzyme';
3
+
4
+ import ListTitle from '../index';
5
+
6
+ const renderComponent = () => shallow(<ListTitle />);
7
+
8
+ describe('<ListTitle />', () => {
9
+ it('should not crash', () => {
10
+ renderComponent();
11
+ });
12
+ });
@@ -0,0 +1,41 @@
1
+ /**
2
+ *
3
+ * LoadingBar
4
+ *
5
+ */
6
+
7
+ import styled, { keyframes } from 'styled-components';
8
+ import colors from '../../assets/styles/colors';
9
+ import sizes from '../../assets/styles/sizes';
10
+
11
+ const loading = keyframes`
12
+ from { left: -200px; width: 30%; }
13
+ 50% { width: 30%; }
14
+ 70% { width: 70%; }
15
+ 80% { left: 50%; }
16
+ 95% { left: 120%; }
17
+ to { left: 100%; }
18
+ `;
19
+
20
+ const LoadingBar = styled.div`
21
+ height: 6px;
22
+ width: 20%;
23
+ margin-top: ${sizes.spacing.lg}px;
24
+ position: relative;
25
+ overflow: hidden;
26
+ background-color: ${colors.greyHeader};
27
+ border-radius: ${sizes.borderRadius};
28
+
29
+ &:before {
30
+ display: block;
31
+ position: absolute;
32
+ content: '';
33
+ left: -200px;
34
+ width: 200px;
35
+ height: 6px;
36
+ background-color: ${colors.lightGrey};
37
+ animation: ${loading} 2s linear infinite;
38
+ }
39
+ `;
40
+
41
+ export default LoadingBar;
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { shallow } from 'enzyme';
3
+ // import renderer from 'react-test-renderer';
4
+
5
+ import LoadingBar from '../index';
6
+
7
+ const renderComponent = () => shallow(<LoadingBar />);
8
+
9
+ describe('<LoadingBar />', () => {
10
+ it('should not crash', () => {
11
+ renderComponent();
12
+ });
13
+
14
+ // Commenting it ATM
15
+ // it('should match snapshot', () => {
16
+ // const tree = renderer.create(<LoadingBar />).toJSON();
17
+ // expect(tree).toMatchSnapshot();
18
+ // });
19
+ });
@@ -0,0 +1,81 @@
1
+ /**
2
+ *
3
+ * LoadingIndicator
4
+ *
5
+ */
6
+ import React from 'react';
7
+ import PropTypes from 'prop-types';
8
+ import styled, { css, keyframes } from 'styled-components';
9
+ import colors from '../../assets/styles/colors';
10
+
11
+ const spin = keyframes`
12
+ 0% { transform: rotate(0deg); }
13
+ 100% { transform: rotate(360deg); }
14
+ `;
15
+
16
+ const getSize = (size, small) => {
17
+ if (size) return size;
18
+ if (small) return '11px';
19
+
20
+ return '26px';
21
+ };
22
+
23
+ const Loader = styled.div`
24
+ display: flex;
25
+ justify-content: center;
26
+ align-items: center;
27
+ width: 100%;
28
+
29
+ > div {
30
+ width: ${({ size, small }) => getSize(size, small)};
31
+ height: ${({ size, small }) => getSize(size, small)};
32
+ border: ${({ borderWidth, borderColor }) =>
33
+ `${borderWidth} solid ${borderColor}`};
34
+ border-top-color: ${({ borderTopColor }) => borderTopColor};
35
+ border-radius: 50%;
36
+ animation: ${({ animationTime }) =>
37
+ css`
38
+ ${spin} ${animationTime} linear infinite
39
+ `};
40
+ }
41
+ `;
42
+
43
+ const LoadingIndicator = ({
44
+ animationTime,
45
+ borderColor,
46
+ borderTopColor,
47
+ borderWidth,
48
+ small,
49
+ size,
50
+ }) => (
51
+ <Loader
52
+ animationTime={animationTime}
53
+ borderColor={borderColor}
54
+ borderTopColor={borderTopColor}
55
+ borderWidth={borderWidth}
56
+ small={small}
57
+ size={size}
58
+ >
59
+ <div />
60
+ </Loader>
61
+ );
62
+
63
+ LoadingIndicator.defaultProps = {
64
+ animationTime: '1s',
65
+ borderColor: colors.greyIconBkgd,
66
+ borderTopColor: colors.blue,
67
+ borderWidth: '4px',
68
+ size: null,
69
+ small: false,
70
+ };
71
+
72
+ LoadingIndicator.propTypes = {
73
+ animationTime: PropTypes.string,
74
+ borderColor: PropTypes.string,
75
+ borderTopColor: PropTypes.string,
76
+ borderWidth: PropTypes.string,
77
+ size: PropTypes.string,
78
+ small: PropTypes.bool,
79
+ };
80
+
81
+ export default LoadingIndicator;
@@ -0,0 +1,39 @@
1
+ import styled from 'styled-components';
2
+ import colors from '../../assets/styles/colors';
3
+ import sizes from '../../assets/styles/sizes';
4
+
5
+ const Option = styled.div`
6
+ display: flex;
7
+ height: ${({ height }) => height};
8
+ margin: ${({ margin }) => margin};
9
+ align-items: center;
10
+ padding-left: ${sizes.spacing.lg}px;
11
+ background: rgba(0, 126, 255, 0.08);
12
+ border: 1px solid rgba(0, 126, 255, 0.24);
13
+ border-radius: ${sizes.borderRadiusSm};
14
+ line-height: ${({ lineHeight }) => lineHeight};
15
+ color: ${colors.blue};
16
+ font-size: ${({ theme }) =>
17
+ theme?.main?.sizes?.fonts?.md || sizes.input.fontSize};
18
+ -webkit-font-smoothing: antialiased;
19
+ `;
20
+
21
+ Option.defaultProps = {
22
+ height: '30px',
23
+ lineHeight: '28px',
24
+ margin: '0',
25
+ theme: {
26
+ main: {
27
+ sizes: {
28
+ fonts: {
29
+ xs: '11px',
30
+ sm: '12px',
31
+ md: '13px',
32
+ lg: '18px',
33
+ },
34
+ },
35
+ },
36
+ },
37
+ };
38
+
39
+ export default Option;
@@ -0,0 +1,29 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`<Option /> should match the snapshot 1`] = `
4
+ .c0 {
5
+ display: -webkit-box;
6
+ display: -webkit-flex;
7
+ display: -ms-flexbox;
8
+ display: flex;
9
+ height: 30px;
10
+ margin: 0;
11
+ -webkit-align-items: center;
12
+ -webkit-box-align: center;
13
+ -ms-flex-align: center;
14
+ align-items: center;
15
+ padding-left: 10px;
16
+ background: rgba(0,126,255,0.08);
17
+ border: 1px solid rgba(0,126,255,0.24);
18
+ border-radius: 2px;
19
+ line-height: 28px;
20
+ color: #007eff;
21
+ font-size: 13px;
22
+ -webkit-font-smoothing: antialiased;
23
+ }
24
+
25
+ <div
26
+ className="c0"
27
+ height="30px"
28
+ />
29
+ `;
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import renderer from 'react-test-renderer';
3
+ import { shallow } from 'enzyme';
4
+ import Option from '../index';
5
+
6
+ describe('<Option />', () => {
7
+ it('should not crash', () => {
8
+ shallow(<Option />);
9
+ });
10
+
11
+ it('should match the snapshot', () => {
12
+ const tree = renderer.create(<Option />).toJSON();
13
+
14
+ expect(tree).toMatchSnapshot();
15
+ });
16
+ });