@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.
- package/.stylelintignore +1 -0
- package/README.md +50 -0
- package/babel.config.js +18 -0
- package/build/18ea3062c6e779649b89c301e4d65a7c.ttf +0 -0
- package/build/1d2ca94dfba6f8d87cfda33b32f0febc.woff +0 -0
- package/build/21b3848a32fce5b0f5014948186f6964.woff2 +0 -0
- package/build/6cfa65c63939188f33ef0e3a68d09306.woff +0 -0
- package/build/6d20cff5b3255dd0078f935c34e2b882.woff2 +0 -0
- package/build/75614cfcfedd509b1f7ac1c26c53bb7f.woff2 +0 -0
- package/build/89b618086a797a8be0f4549489bb2993.woff +0 -0
- package/build/8acc961684668b6e28e961e26afc2af9.ttf +0 -0
- package/build/a6069540692725c247f13984a9598a92.woff2 +0 -0
- package/build/bb14dc80e8b5d860fe9cb2362987d630.ttf +0 -0
- package/build/bundle.development.js +951 -0
- package/build/bundle.production.js +1 -0
- package/build/c66465590541129e82d3d6f725c5658b.woff +0 -0
- package/build/c7687ac11011d85e040e2ce14d5bf6eb.ttf +0 -0
- package/build/esm/assets/fonts/lato/Lato-Black.ttf +0 -0
- package/build/esm/assets/fonts/lato/Lato-Black.woff +0 -0
- package/build/esm/assets/fonts/lato/Lato-Black.woff2 +0 -0
- package/build/esm/assets/fonts/lato/Lato-Bold.ttf +0 -0
- package/build/esm/assets/fonts/lato/Lato-Bold.woff +0 -0
- package/build/esm/assets/fonts/lato/Lato-Bold.woff2 +0 -0
- package/build/esm/assets/fonts/lato/Lato-Regular.ttf +0 -0
- package/build/esm/assets/fonts/lato/Lato-Regular.woff +0 -0
- package/build/esm/assets/fonts/lato/Lato-Regular.woff2 +0 -0
- package/build/esm/assets/fonts/lato/Lato-SemiBold.ttf +0 -0
- package/build/esm/assets/fonts/lato/Lato-SemiBold.woff +0 -0
- package/build/esm/assets/fonts/lato/Lato-SemiBold.woff2 +0 -0
- package/build/esm/assets/icons/icon_select.svg +1 -0
- package/build/esm/assets/icons/icon_trash.svg +1 -0
- package/build/esm/assets/styles/colors.js +84 -0
- package/build/esm/assets/styles/mixins.js +28 -0
- package/build/esm/assets/styles/sizes.js +77 -0
- package/build/esm/components/Button/PrefixIcon.js +7 -0
- package/build/esm/components/Button/index.js +34 -0
- package/build/esm/components/Card/index.js +23 -0
- package/build/esm/components/Checkbox/index.js +25 -0
- package/build/esm/components/CheckboxWrapper/index.js +36 -0
- package/build/esm/components/CustomRow/index.js +12 -0
- package/build/esm/components/DatePicker/index.js +24 -0
- package/build/esm/components/Description/index.js +12 -0
- package/build/esm/components/Enumeration/index.js +25 -0
- package/build/esm/components/EnumerationWrapper/index.js +13 -0
- package/build/esm/components/ErrorMessage/index.js +13 -0
- package/build/esm/components/Fonts/index.js +31 -0
- package/build/esm/components/GlobalStyle/index.js +7 -0
- package/build/esm/components/Header/index.js +13 -0
- package/build/esm/components/HeaderActions/index.js +12 -0
- package/build/esm/components/HeaderTitle/index.js +13 -0
- package/build/esm/components/Icon/index.js +16 -0
- package/build/esm/components/IconText/index.js +9 -0
- package/build/esm/components/IconWrapper/index.js +16 -0
- package/build/esm/components/InputNumber/index.js +14 -0
- package/build/esm/components/InputText/index.js +24 -0
- package/build/esm/components/InputWrapper/index.js +13 -0
- package/build/esm/components/Label/index.js +13 -0
- package/build/esm/components/Links/index.js +13 -0
- package/build/esm/components/List/index.js +13 -0
- package/build/esm/components/ListHeader/index.js +11 -0
- package/build/esm/components/ListRow/index.js +11 -0
- package/build/esm/components/ListSubtitle/index.js +12 -0
- package/build/esm/components/ListTitle/index.js +13 -0
- package/build/esm/components/LoadingBar/index.js +14 -0
- package/build/esm/components/LoadingIndicator/index.js +69 -0
- package/build/esm/components/Option/index.js +37 -0
- package/build/esm/components/Paging/index.js +13 -0
- package/build/esm/components/Select/index.js +14 -0
- package/build/esm/components/Tab/index.js +30 -0
- package/build/esm/components/Table/index.js +13 -0
- package/build/esm/components/TableRowEmpty/index.js +13 -0
- package/build/esm/components/Textarea/index.js +13 -0
- package/build/esm/components/TimeList/index.js +13 -0
- package/build/esm/components/TimePicker/index.js +20 -0
- package/build/esm/components/TimePickerWrapper/index.js +13 -0
- package/build/esm/components/Toggle/index.js +25 -0
- package/build/esm/components/ToggleWrapper/index.js +13 -0
- package/build/esm/components/Tooltip/index.js +28 -0
- package/build/esm/index.js +46 -0
- package/build/index.js +8 -0
- package/package.json +113 -0
- package/src/assets/fonts/lato/Lato-Black.ttf +0 -0
- package/src/assets/fonts/lato/Lato-Black.woff +0 -0
- package/src/assets/fonts/lato/Lato-Black.woff2 +0 -0
- package/src/assets/fonts/lato/Lato-Bold.ttf +0 -0
- package/src/assets/fonts/lato/Lato-Bold.woff +0 -0
- package/src/assets/fonts/lato/Lato-Bold.woff2 +0 -0
- package/src/assets/fonts/lato/Lato-Regular.ttf +0 -0
- package/src/assets/fonts/lato/Lato-Regular.woff +0 -0
- package/src/assets/fonts/lato/Lato-Regular.woff2 +0 -0
- package/src/assets/fonts/lato/Lato-SemiBold.ttf +0 -0
- package/src/assets/fonts/lato/Lato-SemiBold.woff +0 -0
- package/src/assets/fonts/lato/Lato-SemiBold.woff2 +0 -0
- package/src/assets/icons/icon_select.svg +1 -0
- package/src/assets/icons/icon_trash.svg +1 -0
- package/src/assets/styles/colors.js +92 -0
- package/src/assets/styles/mixins.js +45 -0
- package/src/assets/styles/sizes.js +87 -0
- package/src/components/Button/PrefixIcon.js +11 -0
- package/src/components/Button/index.js +122 -0
- package/src/components/Button/tests/__snapshots__/index.test.js.snap +169 -0
- package/src/components/Button/tests/index.test.js +91 -0
- package/src/components/Card/index.js +73 -0
- package/src/components/Checkbox/index.js +141 -0
- package/src/components/Checkbox/tests/Checkbox.test.js +19 -0
- package/src/components/Checkbox/tests/__snapshots__/Checkbox.test.js.snap +71 -0
- package/src/components/CheckboxWrapper/index.js +100 -0
- package/src/components/CustomRow/index.js +21 -0
- package/src/components/DatePicker/index.js +280 -0
- package/src/components/DatePicker/tests/Datepicker.test.js +12 -0
- package/src/components/Description/index.js +17 -0
- package/src/components/Enumeration/index.js +40 -0
- package/src/components/Enumeration/tests/Enumeration.test.js +12 -0
- package/src/components/EnumerationWrapper/index.js +47 -0
- package/src/components/ErrorMessage/index.js +18 -0
- package/src/components/Fonts/index.js +83 -0
- package/src/components/GlobalStyle/index.js +68 -0
- package/src/components/Header/index.js +73 -0
- package/src/components/Header/tests/__snapshots__/index.test.js.snap +75 -0
- package/src/components/Header/tests/index.test.js +18 -0
- package/src/components/HeaderActions/index.js +30 -0
- package/src/components/HeaderActions/tests/__snapshots__/index.test.js.snap +34 -0
- package/src/components/HeaderActions/tests/index.test.js +19 -0
- package/src/components/HeaderTitle/index.js +47 -0
- package/src/components/HeaderTitle/tests/__snapshots__/index.test.js.snap +39 -0
- package/src/components/HeaderTitle/tests/index.test.js +19 -0
- package/src/components/Icon/index.js +17 -0
- package/src/components/IconText/index.js +18 -0
- package/src/components/IconWrapper/index.js +29 -0
- package/src/components/InputNumber/index.js +209 -0
- package/src/components/InputNumber/tests/index.test.js +12 -0
- package/src/components/InputText/index.js +70 -0
- package/src/components/InputText/tests/index.test.js +39 -0
- package/src/components/InputWrapper/index.js +57 -0
- package/src/components/Label/index.js +18 -0
- package/src/components/Label/tests/index.test.js +12 -0
- package/src/components/Links/index.js +35 -0
- package/src/components/List/index.js +85 -0
- package/src/components/ListHeader/index.js +13 -0
- package/src/components/ListHeader/tests/index.test.js +12 -0
- package/src/components/ListRow/index.js +17 -0
- package/src/components/ListRow/tests/index.test.js +12 -0
- package/src/components/ListSubtitle/index.js +17 -0
- package/src/components/ListSubtitle/tests/index.test.js +12 -0
- package/src/components/ListTitle/index.js +20 -0
- package/src/components/ListTitle/tests/index.test.js +12 -0
- package/src/components/LoadingBar/index.js +41 -0
- package/src/components/LoadingBar/tests/index.test.js +19 -0
- package/src/components/LoadingIndicator/index.js +81 -0
- package/src/components/Option/index.js +39 -0
- package/src/components/Option/tests/__snapshots__/index.test.js.snap +29 -0
- package/src/components/Option/tests/index.test.js +16 -0
- package/src/components/Paging/index.js +68 -0
- package/src/components/Select/index.js +54 -0
- package/src/components/Select/tests/index.test.js +12 -0
- package/src/components/Tab/index.js +78 -0
- package/src/components/Table/index.js +147 -0
- package/src/components/TableRowEmpty/index.js +28 -0
- package/src/components/Textarea/index.js +50 -0
- package/src/components/Textarea/tests/__snapshots__/index.test.js.snap +71 -0
- package/src/components/Textarea/tests/index.test.js +33 -0
- package/src/components/TimeList/index.js +78 -0
- package/src/components/TimePicker/index.js +59 -0
- package/src/components/TimePickerWrapper/index.js +57 -0
- package/src/components/Toggle/index.js +82 -0
- package/src/components/Toggle/tests/index.test.js +12 -0
- package/src/components/ToggleWrapper/index.js +36 -0
- package/src/components/Tooltip/index.js +34 -0
- package/src/index.js +47 -0
- package/webfonts/Lato-Black.ttf +0 -0
- package/webfonts/Lato-Black.woff +0 -0
- package/webfonts/Lato-Black.woff2 +0 -0
- package/webfonts/Lato-Bold.ttf +0 -0
- package/webfonts/Lato-Bold.woff +0 -0
- package/webfonts/Lato-Bold.woff2 +0 -0
- package/webfonts/Lato-Regular.ttf +0 -0
- package/webfonts/Lato-Regular.woff +0 -0
- package/webfonts/Lato-Regular.woff2 +0 -0
- package/webfonts/Lato-SemiBold.ttf +0 -0
- package/webfonts/Lato-SemiBold.woff +0 -0
- package/webfonts/Lato-SemiBold.woff2 +0 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Header
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import styled from 'styled-components';
|
|
8
|
+
import sizes from '../../assets/styles/sizes';
|
|
9
|
+
import colors from '../../assets/styles/colors';
|
|
10
|
+
|
|
11
|
+
const Header = styled.div`
|
|
12
|
+
margin-bottom: ${sizes.spacing.xxl}px;
|
|
13
|
+
position: relative;
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 50px;
|
|
16
|
+
|
|
17
|
+
.justify-content-end {
|
|
18
|
+
display: flex;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.header-title p {
|
|
22
|
+
width: 100%;
|
|
23
|
+
margin: 0;
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
text-overflow: ellipsis;
|
|
26
|
+
white-space: nowrap;
|
|
27
|
+
font-size: 1.3rem;
|
|
28
|
+
font-weight: ${sizes.fontWeight.regular};
|
|
29
|
+
line-height: normal;
|
|
30
|
+
color: ${colors.greySubtitle};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.sticky {
|
|
34
|
+
position: fixed;
|
|
35
|
+
top: 0;
|
|
36
|
+
left: 30.6rem;
|
|
37
|
+
z-index: 1050;
|
|
38
|
+
background-color: ${colors.white};
|
|
39
|
+
width: calc(100vw - 30.6rem);
|
|
40
|
+
padding-right: ${sizes.spacing.lg}px;
|
|
41
|
+
height: 60px;
|
|
42
|
+
display: flex;
|
|
43
|
+
|
|
44
|
+
.row {
|
|
45
|
+
width: 100%;
|
|
46
|
+
margin: auto;
|
|
47
|
+
margin-top: ${sizes.spacing.lg}px;
|
|
48
|
+
|
|
49
|
+
.header-title p {
|
|
50
|
+
display: none;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
> div > div {
|
|
54
|
+
padding-top: 0;
|
|
55
|
+
|
|
56
|
+
h1 {
|
|
57
|
+
font-size: 2rem;
|
|
58
|
+
|
|
59
|
+
svg {
|
|
60
|
+
margin-top: ${sizes.spacing.sm}px;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
button {
|
|
65
|
+
margin-top: auto;
|
|
66
|
+
margin-bottom: auto;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
`;
|
|
72
|
+
|
|
73
|
+
export default Header;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`<Header /> snapshot 1`] = `
|
|
4
|
+
.c0 {
|
|
5
|
+
margin-bottom: 30px;
|
|
6
|
+
position: relative;
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: 50px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.c0 .justify-content-end {
|
|
12
|
+
display: -webkit-box;
|
|
13
|
+
display: -webkit-flex;
|
|
14
|
+
display: -ms-flexbox;
|
|
15
|
+
display: flex;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.c0 .header-title p {
|
|
19
|
+
width: 100%;
|
|
20
|
+
margin: 0;
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
text-overflow: ellipsis;
|
|
23
|
+
white-space: nowrap;
|
|
24
|
+
font-size: 1.3rem;
|
|
25
|
+
font-weight: 400;
|
|
26
|
+
line-height: normal;
|
|
27
|
+
color: #787e8f;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.c0 .sticky {
|
|
31
|
+
position: fixed;
|
|
32
|
+
top: 0;
|
|
33
|
+
left: 30.6rem;
|
|
34
|
+
z-index: 1050;
|
|
35
|
+
background-color: white;
|
|
36
|
+
width: calc(100vw - 30.6rem);
|
|
37
|
+
padding-right: 15px;
|
|
38
|
+
height: 60px;
|
|
39
|
+
display: -webkit-box;
|
|
40
|
+
display: -webkit-flex;
|
|
41
|
+
display: -ms-flexbox;
|
|
42
|
+
display: flex;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.c0 .sticky .row {
|
|
46
|
+
width: 100%;
|
|
47
|
+
margin: auto;
|
|
48
|
+
margin-top: 16px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.c0 .sticky .row .header-title p {
|
|
52
|
+
display: none;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.c0 .sticky .row > div > div {
|
|
56
|
+
padding-top: 0;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.c0 .sticky .row > div > div h1 {
|
|
60
|
+
font-size: 2rem;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.c0 .sticky .row > div > div h1 svg {
|
|
64
|
+
margin-top: 8px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.c0 .sticky .row > div > div button {
|
|
68
|
+
margin-top: auto;
|
|
69
|
+
margin-bottom: auto;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
<div
|
|
73
|
+
className="c0"
|
|
74
|
+
/>
|
|
75
|
+
`;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { shallow } from 'enzyme';
|
|
3
|
+
import renderer from 'react-test-renderer';
|
|
4
|
+
|
|
5
|
+
import Header from '../index';
|
|
6
|
+
|
|
7
|
+
const renderComponent = () => shallow(<Header />);
|
|
8
|
+
|
|
9
|
+
describe('<Header />', () => {
|
|
10
|
+
it('should not crash', () => {
|
|
11
|
+
renderComponent();
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it('snapshot', () => {
|
|
15
|
+
const tree = renderer.create(<Header />).toJSON();
|
|
16
|
+
expect(tree).toMatchSnapshot();
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* HeaderActions
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import styled from 'styled-components';
|
|
8
|
+
import sizes from '../../assets/styles/sizes';
|
|
9
|
+
|
|
10
|
+
const HeaderActions = styled.div`
|
|
11
|
+
display: flex;
|
|
12
|
+
justify-content: flex-end;
|
|
13
|
+
align-items: center;
|
|
14
|
+
gap: ${sizes.spacing.lg}px;
|
|
15
|
+
width: fit-content;
|
|
16
|
+
max-width: 100%;
|
|
17
|
+
padding-top: 1rem;
|
|
18
|
+
|
|
19
|
+
> button {
|
|
20
|
+
margin: 0;
|
|
21
|
+
max-width: 100%;
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
text-overflow: ellipsis;
|
|
24
|
+
white-space: nowrap;
|
|
25
|
+
text-align: center;
|
|
26
|
+
outline: 0;
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
29
|
+
|
|
30
|
+
export default HeaderActions;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`<HeaderActions /> snapshot 1`] = `
|
|
4
|
+
.c0 {
|
|
5
|
+
display: -webkit-box;
|
|
6
|
+
display: -webkit-flex;
|
|
7
|
+
display: -ms-flexbox;
|
|
8
|
+
display: flex;
|
|
9
|
+
-webkit-box-pack: end;
|
|
10
|
+
-webkit-justify-content: flex-end;
|
|
11
|
+
-ms-flex-pack: end;
|
|
12
|
+
justify-content: flex-end;
|
|
13
|
+
width: -webkit-fit-content;
|
|
14
|
+
width: -moz-fit-content;
|
|
15
|
+
width: fit-content;
|
|
16
|
+
max-width: 100%;
|
|
17
|
+
padding-top: 1rem;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.c0 > button {
|
|
21
|
+
margin-right: 0;
|
|
22
|
+
margin-left: 1rem;
|
|
23
|
+
max-width: 100%;
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
text-overflow: ellipsis;
|
|
26
|
+
white-space: nowrap;
|
|
27
|
+
text-align: center;
|
|
28
|
+
outline: 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
<div
|
|
32
|
+
className="c0"
|
|
33
|
+
/>
|
|
34
|
+
`;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { shallow } from 'enzyme';
|
|
3
|
+
|
|
4
|
+
import renderer from 'react-test-renderer';
|
|
5
|
+
|
|
6
|
+
import HeaderActions from '../index';
|
|
7
|
+
|
|
8
|
+
const renderComponent = () => shallow(<HeaderActions />);
|
|
9
|
+
|
|
10
|
+
describe('<HeaderActions />', () => {
|
|
11
|
+
it('should not crash', () => {
|
|
12
|
+
renderComponent();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it('snapshot', () => {
|
|
16
|
+
const tree = renderer.create(<HeaderActions />).toJSON();
|
|
17
|
+
expect(tree).toMatchSnapshot();
|
|
18
|
+
});
|
|
19
|
+
});
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* HeaderTitle
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import styled from 'styled-components';
|
|
8
|
+
import sizes from '../../assets/styles/sizes';
|
|
9
|
+
import colors from '../../assets/styles/colors';
|
|
10
|
+
|
|
11
|
+
const HeaderTitle = styled.div`
|
|
12
|
+
position: relative;
|
|
13
|
+
padding-top: 0.5rem;
|
|
14
|
+
|
|
15
|
+
h1 {
|
|
16
|
+
position: relative;
|
|
17
|
+
width: fit-content;
|
|
18
|
+
max-width: 100%;
|
|
19
|
+
margin-bottom: 0;
|
|
20
|
+
padding-right: 18px;
|
|
21
|
+
font-size: 2.4rem;
|
|
22
|
+
line-height: normal;
|
|
23
|
+
font-weight: ${sizes.fontWeight.bold};
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
text-overflow: ellipsis;
|
|
26
|
+
white-space: nowrap;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
svg {
|
|
30
|
+
position: absolute;
|
|
31
|
+
right: 0;
|
|
32
|
+
top: 0;
|
|
33
|
+
margin-top: 12px;
|
|
34
|
+
font-size: 1.2rem;
|
|
35
|
+
color: ${colors.greySubtitle};
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
outline: 0;
|
|
38
|
+
transition: color 0.2s ease;
|
|
39
|
+
|
|
40
|
+
&:focus-visible {
|
|
41
|
+
outline: 2px solid ${colors.blue};
|
|
42
|
+
outline-offset: 2px;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
`;
|
|
46
|
+
|
|
47
|
+
export default HeaderTitle;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`<HeaderTitle /> snapshot 1`] = `
|
|
4
|
+
.c0 {
|
|
5
|
+
position: relative;
|
|
6
|
+
padding-top: 0.5rem;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.c0 h1 {
|
|
10
|
+
position: relative;
|
|
11
|
+
width: -webkit-fit-content;
|
|
12
|
+
width: -moz-fit-content;
|
|
13
|
+
width: fit-content;
|
|
14
|
+
max-width: 100%;
|
|
15
|
+
margin-bottom: 0;
|
|
16
|
+
padding-right: 18px;
|
|
17
|
+
font-size: 2.4rem;
|
|
18
|
+
line-height: normal;
|
|
19
|
+
font-weight: 600;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
text-overflow: ellipsis;
|
|
22
|
+
white-space: nowrap;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.c0 svg {
|
|
26
|
+
position: absolute;
|
|
27
|
+
right: 0;
|
|
28
|
+
top: 0;
|
|
29
|
+
margin-top: 12px;
|
|
30
|
+
font-size: 12px;
|
|
31
|
+
color: rgba(16,22,34,0.35);
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
outline: 0;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
<div
|
|
37
|
+
className="c0"
|
|
38
|
+
/>
|
|
39
|
+
`;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { shallow } from 'enzyme';
|
|
3
|
+
|
|
4
|
+
import renderer from 'react-test-renderer';
|
|
5
|
+
|
|
6
|
+
import HeaderTitle from '../index';
|
|
7
|
+
|
|
8
|
+
const renderComponent = () => shallow(<HeaderTitle />);
|
|
9
|
+
|
|
10
|
+
describe('<HeaderTitle />', () => {
|
|
11
|
+
it('should not crash', () => {
|
|
12
|
+
renderComponent();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it('snapshot', () => {
|
|
16
|
+
const tree = renderer.create(<HeaderTitle />).toJSON();
|
|
17
|
+
expect(tree).toMatchSnapshot();
|
|
18
|
+
});
|
|
19
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Icon
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import styled from 'styled-components';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
9
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
10
|
+
|
|
11
|
+
const Icon = styled(FontAwesomeIcon)``;
|
|
12
|
+
|
|
13
|
+
Icon.propTypes = {
|
|
14
|
+
icon: PropTypes.any.isRequired,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default Icon;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import sizes from '../../assets/styles/sizes';
|
|
3
|
+
|
|
4
|
+
import IconWrapper from '../IconWrapper';
|
|
5
|
+
|
|
6
|
+
const IconText = styled(IconWrapper)`
|
|
7
|
+
z-index: 3;
|
|
8
|
+
transform: translateY(0);
|
|
9
|
+
|
|
10
|
+
::before {
|
|
11
|
+
content: '${props => props.text}';
|
|
12
|
+
font-family: 'Lato', -apple-system, BlinkMacSystemFont, sans-serif;
|
|
13
|
+
font-size: 1.6rem;
|
|
14
|
+
font-weight: ${sizes.fontWeight.bold};
|
|
15
|
+
}
|
|
16
|
+
`;
|
|
17
|
+
|
|
18
|
+
export default IconText;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import colors from '../../assets/styles/colors';
|
|
4
|
+
import sizes from '../../assets/styles/sizes';
|
|
5
|
+
|
|
6
|
+
const IconWrapper = styled.span`
|
|
7
|
+
width: calc(${sizes.input.height} - 2px);
|
|
8
|
+
height: calc(${sizes.input.height} - 2px);
|
|
9
|
+
color: ${colors.greyIconColor};
|
|
10
|
+
position: absolute;
|
|
11
|
+
left: 1px;
|
|
12
|
+
top: 1px;
|
|
13
|
+
background-color: ${props =>
|
|
14
|
+
props.background ? colors.greyIconBkgd : 'transparent'};
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
font-size: 1.3rem;
|
|
19
|
+
`;
|
|
20
|
+
|
|
21
|
+
IconWrapper.defaultProps = {
|
|
22
|
+
background: true,
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
IconWrapper.propTypes = {
|
|
26
|
+
background: PropTypes.bool,
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default IconWrapper;
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* InputNumber
|
|
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 InputNumber = styled.div`
|
|
13
|
+
.rc-input-number {
|
|
14
|
+
margin: 0;
|
|
15
|
+
padding: 0;
|
|
16
|
+
line-height: 26px;
|
|
17
|
+
font-size: 1.2rem;
|
|
18
|
+
height: 26px;
|
|
19
|
+
display: inline-block;
|
|
20
|
+
vertical-align: middle;
|
|
21
|
+
border: 1px solid ${colors.lightGrey};
|
|
22
|
+
border-radius: ${sizes.borderRadiusSm};
|
|
23
|
+
transition: border-color 0.2s ease, box-shadow 0.2s ease;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.rc-input-number-focused {
|
|
27
|
+
border-color: ${colors.blueBorder};
|
|
28
|
+
box-shadow: 0 0 0 3px ${colors.blueFocusRing};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.rc-input-number-handler {
|
|
32
|
+
text-align: center;
|
|
33
|
+
line-height: 12px;
|
|
34
|
+
height: 12px;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
display: block;
|
|
37
|
+
touch-action: none;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.rc-input-number-handler-up-inner,
|
|
41
|
+
.rc-input-number-handler-down-inner {
|
|
42
|
+
color: ${colors.greySubtitle};
|
|
43
|
+
user-select: none;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.rc-input-number:hover {
|
|
47
|
+
border-color: ${colors.blueBorder};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.rc-input-number:hover .rc-input-number-handler-up,
|
|
51
|
+
.rc-input-number:hover .rc-input-number-handler-wrap {
|
|
52
|
+
border-color: ${colors.blueBorder};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.rc-input-number-disabled:hover {
|
|
56
|
+
border-color: ${colors.lightGrey};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.rc-input-number-disabled:hover .rc-input-number-handler-up,
|
|
60
|
+
.rc-input-number-disabled:hover .rc-input-number-handler-wrap {
|
|
61
|
+
border-color: ${colors.lightGrey};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.rc-input-number-input-wrap {
|
|
65
|
+
overflow: hidden;
|
|
66
|
+
height: 100%;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.rc-input-number-input {
|
|
70
|
+
width: 100%;
|
|
71
|
+
text-align: center;
|
|
72
|
+
outline: 0;
|
|
73
|
+
-moz-appearance: textfield;
|
|
74
|
+
line-height: 26px;
|
|
75
|
+
height: 100%;
|
|
76
|
+
transition: color 0.2s ease;
|
|
77
|
+
color: ${colors.blueTxt};
|
|
78
|
+
border: 0;
|
|
79
|
+
border-radius: ${sizes.borderRadiusSm};
|
|
80
|
+
padding: 0;
|
|
81
|
+
|
|
82
|
+
&::-webkit-outer-spin-button,
|
|
83
|
+
&::-webkit-inner-spin-button {
|
|
84
|
+
-webkit-appearance: none;
|
|
85
|
+
margin: 0;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.rc-input-number-handler-wrap {
|
|
90
|
+
float: right;
|
|
91
|
+
border-left: 1px solid ${colors.lightGrey};
|
|
92
|
+
width: 20px;
|
|
93
|
+
height: 100%;
|
|
94
|
+
transition: border-color 0.2s ease;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.rc-input-number-handler-up {
|
|
98
|
+
border-bottom: 1px solid ${colors.lightGrey};
|
|
99
|
+
padding-top: 1px;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.rc-input-number-handler-up-inner:after {
|
|
103
|
+
content: '+';
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.rc-input-number-handler-down-inner:after {
|
|
107
|
+
content: '-';
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.rc-input-number-handler-down-disabled,
|
|
111
|
+
.rc-input-number-handler-up-disabled {
|
|
112
|
+
opacity: 0.6;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.rc-input-number-handler-down-disabled:hover,
|
|
116
|
+
.rc-input-number-handler-up-disabled:hover {
|
|
117
|
+
color: ${colors.brightGrey};
|
|
118
|
+
border-color: ${colors.lightGrey};
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.rc-input-number-disabled .rc-input-number-input {
|
|
122
|
+
opacity: 0.6;
|
|
123
|
+
cursor: not-allowed;
|
|
124
|
+
background-color: ${colors.greyIconBkgd};
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.rc-input-number-disabled .rc-input-number-handler {
|
|
128
|
+
opacity: 0.6;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.rc-input-number-disabled .rc-input-number-handler:hover {
|
|
132
|
+
color: ${colors.brightGrey};
|
|
133
|
+
border-color: ${colors.lightGrey};
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.rc-input-number.inputNumber {
|
|
137
|
+
width: 100%;
|
|
138
|
+
height: ${sizes.input.height};
|
|
139
|
+
background-color: ${colors.white};
|
|
140
|
+
border: 0;
|
|
141
|
+
box-shadow: none;
|
|
142
|
+
position: relative;
|
|
143
|
+
|
|
144
|
+
input {
|
|
145
|
+
width: 100%;
|
|
146
|
+
height: 100%;
|
|
147
|
+
border: 1px solid ${colors.lightGrey};
|
|
148
|
+
padding: 0 ${sizes.input.padding};
|
|
149
|
+
cursor: pointer;
|
|
150
|
+
outline: 0;
|
|
151
|
+
padding-right: calc(${sizes.input.height} + ${sizes.input.padding});
|
|
152
|
+
border-radius: ${sizes.borderRadius};
|
|
153
|
+
text-align: left;
|
|
154
|
+
font-weight: ${sizes.fontWeight.regular};
|
|
155
|
+
font-size: 1.3rem;
|
|
156
|
+
color: ${colors.blueTxt};
|
|
157
|
+
transition: border-color 0.2s ease, box-shadow 0.2s ease;
|
|
158
|
+
|
|
159
|
+
&::placeholder {
|
|
160
|
+
color: ${colors.greyPlaceholder};
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
&::-webkit-input-placeholder {
|
|
164
|
+
color: ${colors.greyPlaceholder};
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
&:focus {
|
|
168
|
+
border-color: ${colors.blueBorder};
|
|
169
|
+
box-shadow: 0 0 0 3px ${colors.blueFocusRing};
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
&:disabled {
|
|
173
|
+
cursor: not-allowed;
|
|
174
|
+
background-color: ${colors.greyIconBkgd};
|
|
175
|
+
color: ${colors.brightGrey};
|
|
176
|
+
opacity: 1;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.rc-input-number-handler-wrap {
|
|
181
|
+
width: 24px;
|
|
182
|
+
position: absolute;
|
|
183
|
+
right: 0;
|
|
184
|
+
top: 0;
|
|
185
|
+
background-image: url(${img});
|
|
186
|
+
background-repeat: no-repeat;
|
|
187
|
+
background-position: right center;
|
|
188
|
+
border: none;
|
|
189
|
+
cursor: pointer;
|
|
190
|
+
|
|
191
|
+
span {
|
|
192
|
+
height: 50%;
|
|
193
|
+
border: 0;
|
|
194
|
+
|
|
195
|
+
span {
|
|
196
|
+
color: transparent;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
input[type='number']::-webkit-inner-spin-button,
|
|
203
|
+
input[type='number']::-webkit-outer-spin-button {
|
|
204
|
+
-webkit-appearance: none;
|
|
205
|
+
margin: 0;
|
|
206
|
+
}
|
|
207
|
+
`;
|
|
208
|
+
|
|
209
|
+
export default InputNumber;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { shallow } from 'enzyme';
|
|
3
|
+
|
|
4
|
+
import InputNumber from '../index';
|
|
5
|
+
|
|
6
|
+
const renderComponent = () => shallow(<InputNumber />);
|
|
7
|
+
|
|
8
|
+
describe('<InputNumber />', () => {
|
|
9
|
+
it('should not crash', () => {
|
|
10
|
+
renderComponent();
|
|
11
|
+
});
|
|
12
|
+
});
|