kitchen-simulator 5.0.0-test.17 → 5.0.0-test.19

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 (206) hide show
  1. package/package.json +8 -18
  2. package/src/@history.js +3 -0
  3. package/src/CrossSignOn.jsx +94 -0
  4. package/src/KitchenConfigurator.jsx +1526 -0
  5. package/src/KitchenConfiguratorApp.jsx +1 -1
  6. package/src/_KitchenConfigurator.jsx +3 -91
  7. package/src/components/atoms/Snackbar/index.jsx +43 -0
  8. package/src/components/atoms/radio-button/index.jsx +20 -0
  9. package/src/components/atoms/radio-button/styles.js +56 -0
  10. package/src/components/button/MainButton.jsx +157 -0
  11. package/src/components/button/ToggleMeasureButton.jsx +65 -0
  12. package/src/components/catalog-view/catalog-breadcrumb.jsx +53 -0
  13. package/src/components/catalog-view/catalog-item.jsx +229 -0
  14. package/src/components/catalog-view/catalog-list.jsx +173 -0
  15. package/src/components/catalog-view/catalog-page-item.jsx +110 -0
  16. package/src/components/catalog-view/catalog-turn-back-page-item.jsx +80 -0
  17. package/src/components/configurator/custom-configurator.jsx +77 -0
  18. package/src/components/configurator/project-configurator.jsx +120 -0
  19. package/src/components/content.jsx +136 -0
  20. package/src/components/export.js +36 -0
  21. package/src/components/firstsetting/button/styles.js +223 -0
  22. package/src/components/firstsetting/export.js +9 -0
  23. package/src/components/firstsetting/firstsetting-content-button.jsx +198 -0
  24. package/src/components/firstsetting/firstsetting-toggle-button.jsx +101 -0
  25. package/src/components/firstsetting/firstsetting.jsx +814 -0
  26. package/src/components/footerbar/button/ControlButton.jsx +43 -0
  27. package/src/components/footerbar/button/DirectionButton.jsx +54 -0
  28. package/src/components/footerbar/button/DirectionPanSpinButton.jsx +36 -0
  29. package/src/components/footerbar/button/ToggleButton.jsx +58 -0
  30. package/src/components/footerbar/button/ToggleConvertButton.jsx +48 -0
  31. package/src/components/footerbar/button/ToggleMeasureButton.jsx +33 -0
  32. package/src/components/footerbar/button/styles.js +217 -0
  33. package/src/components/footerbar/export.js +9 -0
  34. package/src/components/footerbar/footer-content-button.jsx +198 -0
  35. package/src/components/footerbar/footer-toggle-button.jsx +101 -0
  36. package/src/components/footerbar/footerbar.jsx +1103 -0
  37. package/src/components/footerbar/styles.js +263 -0
  38. package/src/components/header/button/MenuButton.jsx +46 -0
  39. package/src/components/header/button/SaveButton.jsx +54 -0
  40. package/src/components/header/button/styles.js +181 -0
  41. package/src/components/header/export.js +5 -0
  42. package/src/components/header/header.jsx +631 -0
  43. package/src/components/header/header.style.css +47 -0
  44. package/src/components/header/styles.js +320 -0
  45. package/src/components/login/Login.js +77 -0
  46. package/src/components/login/LoginForm/index.js +108 -0
  47. package/src/components/login/Register.js +82 -0
  48. package/src/components/login/RegisterForm/index.js +171 -0
  49. package/src/components/login/jwtService.js +201 -0
  50. package/src/components/login/style.css +158 -0
  51. package/src/components/login/style.scss +260 -0
  52. package/src/components/molecules/slider/index.jsx +15 -0
  53. package/src/components/molecules/slider/styles.js +0 -0
  54. package/src/components/molecules/slider/styles.scss +3 -0
  55. package/src/components/myprojects/export.js +5 -0
  56. package/src/components/myprojects/index.jsx +445 -0
  57. package/src/components/myprojects/styles.js +241 -0
  58. package/src/components/sidebar/custom-accordion.jsx +48 -0
  59. package/src/components/sidebar/export.js +15 -0
  60. package/src/components/sidebar/panel-element-editor/attributes-editor/attributes-editor.jsx +73 -0
  61. package/src/components/sidebar/panel-element-editor/attributes-editor/confirm-popup.jsx +101 -0
  62. package/src/components/sidebar/panel-element-editor/attributes-editor/hole-attributes-editor.jsx +149 -0
  63. package/src/components/sidebar/panel-element-editor/attributes-editor/item-attributes-editor.jsx +316 -0
  64. package/src/components/sidebar/panel-element-editor/attributes-editor/line-attributes-editor.jsx +108 -0
  65. package/src/components/sidebar/panel-element-editor/element-editor.jsx +1070 -0
  66. package/src/components/sidebar/panel-element-editor/multi-elements-editor.jsx +0 -0
  67. package/src/components/sidebar/panel-element-editor/panel-element-editor.jsx +104 -0
  68. package/src/components/sidebar/panel-element-editor/panel-multi-elements-editor.jsx +155 -0
  69. package/src/components/sidebar/panel-group-editor.jsx +272 -0
  70. package/src/components/sidebar/panel-groups.jsx +310 -0
  71. package/src/components/sidebar/panel-guides.jsx +192 -0
  72. package/src/components/sidebar/panel-layer-elements.jsx +298 -0
  73. package/src/components/sidebar/panel-layers.jsx +381 -0
  74. package/src/components/sidebar/panel.jsx +71 -0
  75. package/src/components/sidebar/sidebar.jsx +106 -0
  76. package/src/components/sidebar/toolbar-panel.jsx +139 -0
  77. package/src/components/sign/export.js +7 -0
  78. package/src/components/sign/main/index.jsx +523 -0
  79. package/src/components/sign/main/styles.js +163 -0
  80. package/src/components/style/button.jsx +95 -0
  81. package/src/components/style/cancel-button.jsx +20 -0
  82. package/src/components/style/content-container.jsx +29 -0
  83. package/src/components/style/content-title.jsx +20 -0
  84. package/src/components/style/delete-button.jsx +23 -0
  85. package/src/components/style/export.jsx +48 -0
  86. package/src/components/style/form-block.jsx +13 -0
  87. package/src/components/style/form-color-input.jsx +27 -0
  88. package/src/components/style/form-label.jsx +15 -0
  89. package/src/components/style/form-number-input.jsx +196 -0
  90. package/src/components/style/form-number-input_2.jsx +191 -0
  91. package/src/components/style/form-select.jsx +38 -0
  92. package/src/components/style/form-slider.jsx +36 -0
  93. package/src/components/style/form-submit-button.jsx +23 -0
  94. package/src/components/style/form-text-input.jsx +65 -0
  95. package/src/components/toolbar/button/ControlButton.jsx +41 -0
  96. package/src/components/toolbar/button/DirectionButton.jsx +34 -0
  97. package/src/components/toolbar/button/RightButton.jsx +103 -0
  98. package/src/components/toolbar/button/ToggleButton.jsx +41 -0
  99. package/src/components/toolbar/button/index.jsx +55 -0
  100. package/src/components/toolbar/button/styles.js +127 -0
  101. package/src/components/toolbar/components/DoorStyleMenu.jsx +103 -0
  102. package/src/components/toolbar/components/Pricing.jsx +126 -0
  103. package/src/components/toolbar/components/ReviewForQuote.jsx +635 -0
  104. package/src/components/toolbar/export.js +21 -0
  105. package/src/components/toolbar/main/Alert.js +122 -0
  106. package/src/components/toolbar/main/TakePictureModal.jsx +104 -0
  107. package/src/components/toolbar/main/confirm-popup.jsx +99 -0
  108. package/src/components/toolbar/main/index.jsx +5627 -0
  109. package/src/components/toolbar/main/lShaped.json +311 -0
  110. package/src/components/toolbar/main/longNarrow.json +238 -0
  111. package/src/components/toolbar/main/myComponents.js +123 -0
  112. package/src/components/toolbar/main/oRectangle.json +220 -0
  113. package/src/components/toolbar/main/rectangle.json +238 -0
  114. package/src/components/toolbar/main/style.css +107 -0
  115. package/src/components/toolbar/main/styles.js +696 -0
  116. package/src/components/toolbar/plugin-item.jsx +123 -0
  117. package/src/components/toolbar/popup/appliance/appliance-category/index.jsx +73 -0
  118. package/src/components/toolbar/popup/appliance/choose-appliance/index.jsx +102 -0
  119. package/src/components/toolbar/popup/appliance/index.jsx +83 -0
  120. package/src/components/toolbar/popup/autosaveprompt/index.jsx +150 -0
  121. package/src/components/toolbar/popup/autosaveprompt/styles.css +64 -0
  122. package/src/components/toolbar/popup/autosaveprompt/styles.js +40 -0
  123. package/src/components/toolbar/popup/cabinet/cabinet-category/index.jsx +73 -0
  124. package/src/components/toolbar/popup/cabinet/choose-product/index.jsx +119 -0
  125. package/src/components/toolbar/popup/cabinet/index.jsx +85 -0
  126. package/src/components/toolbar/popup/doorStyle/choose-style/index.jsx +63 -0
  127. package/src/components/toolbar/popup/doorStyle/index.jsx +71 -0
  128. package/src/components/toolbar/popup/doorStyle/style-category/index.jsx +139 -0
  129. package/src/components/toolbar/popup/downloadsummary/downloadSummaryContext.js +2 -0
  130. package/src/components/toolbar/popup/downloadsummary/downloadSummaryTemp.jsx +157 -0
  131. package/src/components/toolbar/popup/downloadsummary/index.jsx +643 -0
  132. package/src/components/toolbar/popup/downloadsummary/show2D/show2DView.jsx +51 -0
  133. package/src/components/toolbar/popup/downloadsummary/show2D/viewer2DDownLoad.jsx +175 -0
  134. package/src/components/toolbar/popup/downloadsummary/show3D/show3DView.jsx +283 -0
  135. package/src/components/toolbar/popup/downloadsummary/show3D/viewer3DDownLoad.jsx +2257 -0
  136. package/src/components/toolbar/popup/downloadsummary/showCabinetInfo.js +93 -0
  137. package/src/components/toolbar/popup/downloadsummary/showElevation/showElevationView.jsx +132 -0
  138. package/src/components/toolbar/popup/downloadsummary/showElevation/viewer3DElevationDownload.jsx +2198 -0
  139. package/src/components/toolbar/popup/downloadsummary/showElevation/viewerElevationDownload.jsx +152 -0
  140. package/src/components/toolbar/popup/downloadsummary/showWarranty.jsx +149 -0
  141. package/src/components/toolbar/popup/downloadsummary/styles.css +177 -0
  142. package/src/components/toolbar/popup/downloadsummary/styles.js +453 -0
  143. package/src/components/toolbar/popup/finishingtouch/category/index.jsx +34 -0
  144. package/src/components/toolbar/popup/finishingtouch/index.jsx +58 -0
  145. package/src/components/toolbar/popup/finishingtouch/material-edit.jsx +112 -0
  146. package/src/components/toolbar/popup/finishingtouch/product/index.jsx +116 -0
  147. package/src/components/toolbar/popup/floorplan/choose-floor/confirm-popup.jsx +101 -0
  148. package/src/components/toolbar/popup/floorplan/choose-floor/index.jsx +254 -0
  149. package/src/components/toolbar/popup/floorplan/choose-floor/lShaped.json +311 -0
  150. package/src/components/toolbar/popup/floorplan/choose-floor/longNarrow.json +238 -0
  151. package/src/components/toolbar/popup/floorplan/choose-floor/oRectangle.json +220 -0
  152. package/src/components/toolbar/popup/floorplan/choose-floor/rectangle.json +238 -0
  153. package/src/components/toolbar/popup/floorplan/choose-floor/styles.js +86 -0
  154. package/src/components/toolbar/popup/floorplan/floor-category/index.jsx +109 -0
  155. package/src/components/toolbar/popup/floorplan/index.jsx +60 -0
  156. package/src/components/toolbar/popup/index.jsx +241 -0
  157. package/src/components/toolbar/popup/newproject/index.jsx +59 -0
  158. package/src/components/toolbar/popup/newproject/styles.css +64 -0
  159. package/src/components/toolbar/popup/newproject/styles.js +41 -0
  160. package/src/components/toolbar/popup/product/appliance.jsx +54 -0
  161. package/src/components/toolbar/popup/product/cabinetproduct.jsx +15 -0
  162. package/src/components/toolbar/popup/product/doorstyle.jsx +58 -0
  163. package/src/components/toolbar/popup/product/doorstyleproduct.jsx +47 -0
  164. package/src/components/toolbar/popup/product/floor.jsx +36 -0
  165. package/src/components/toolbar/popup/product/floorproduct.jsx +42 -0
  166. package/src/components/toolbar/popup/product/index.jsx +36 -0
  167. package/src/components/toolbar/popup/product/primary.jsx +77 -0
  168. package/src/components/toolbar/popup/product/productline.jsx +93 -0
  169. package/src/components/toolbar/popup/product/reviewItem.jsx +427 -0
  170. package/src/components/toolbar/popup/product/reviewMolding.jsx +310 -0
  171. package/src/components/toolbar/popup/product/style.css +54 -0
  172. package/src/components/toolbar/popup/product/styles.js +260 -0
  173. package/src/components/toolbar/popup/savedesign/FullPictureForm.jsx +146 -0
  174. package/src/components/toolbar/popup/savedesign/index.jsx +495 -0
  175. package/src/components/toolbar/popup/savedesign/savedesign.style.css +16 -0
  176. package/src/components/toolbar/popup/savedesign/styles.js +151 -0
  177. package/src/components/toolbar/popup/setDoorStyleOption/index.jsx +87 -0
  178. package/src/components/toolbar/popup/styles.js +909 -0
  179. package/src/components/toolbar/popup/submitforquote/AddToCartOptions.jsx +192 -0
  180. package/src/components/toolbar/popup/submitforquote/CustomerRequestsForm.jsx +96 -0
  181. package/src/components/toolbar/popup/submitforquote/SkipDesignerReview.jsx +54 -0
  182. package/src/components/toolbar/popup/submitforquote/StepDots.jsx +25 -0
  183. package/src/components/toolbar/popup/submitforquote/cart-choice.jsx +116 -0
  184. package/src/components/toolbar/popup/submitforquote/doorstyle-menus.js +38 -0
  185. package/src/components/toolbar/popup/submitforquote/index.jsx +698 -0
  186. package/src/components/toolbar/popup/submitforquote/styles.css +105 -0
  187. package/src/components/toolbar/popup/submitforquote/styles.js +294 -0
  188. package/src/components/toolbar/popup/submitprompt/index.jsx +89 -0
  189. package/src/components/toolbar/popup/submitprompt/styles.css +64 -0
  190. package/src/components/toolbar/popup/submitprompt/styles.js +42 -0
  191. package/src/components/toolbar/toolbar-button.jsx +90 -0
  192. package/src/components/toolbar/toolbar-load-button.jsx +36 -0
  193. package/src/components/toolbar/toolbar-save-button.jsx +32 -0
  194. package/src/components/tutorial-view/Modal.jsx +584 -0
  195. package/src/components/tutorial-view/style.css +111 -0
  196. package/src/components/tutorial-view/styles.js +65 -0
  197. package/src/components/wizardstep/button/styles.js +677 -0
  198. package/src/components/wizardstep/export.js +5 -0
  199. package/src/components/wizardstep/index.jsx +1372 -0
  200. package/src/components/wizardstep/styles.js +688 -0
  201. package/src/components/wizardstep/wizardstep-content-button.jsx +198 -0
  202. package/src/components/wizardstep/wizardstep-toggle-button.jsx +101 -0
  203. package/src/{_index.js → index.js} +4 -4
  204. package/src/renderer.jsx +466 -0
  205. package/src/actions/_export.js +0 -35
  206. package/src/components/_export.js +0 -11
@@ -22,7 +22,7 @@ import {
22
22
  Models as PlannerModels,
23
23
  Plugins as PlannerPlugins,
24
24
  reducer as PlannerReducer
25
- } from '../src/_index';
25
+ } from '../src/index';
26
26
  import { Map } from 'immutable';
27
27
  import ReactGA from 'react-ga4';
28
28
  import { hotjar } from 'react-hotjar';
@@ -1,75 +1,22 @@
1
- import Dialog from '@material-ui/core/Dialog';
2
1
  import axios from 'axios';
3
2
  import convert from 'convert-units';
4
- import { Plugins as PlannerPlugins } from './_index';
3
+ import { Plugins as PlannerPlugins } from './index';
5
4
  import PropTypes from 'prop-types';
6
5
  import React, { Component } from 'react';
7
6
  import ReactGA from 'react-ga4';
8
7
  import { hotjar } from 'react-hotjar';
9
8
  import { connect } from 'react-redux';
10
9
  import { bindActionCreators } from 'redux';
11
- import styled from 'styled-components';
12
- import SnackBar from './components/atoms/Snackbar';
13
10
  import * as constants from './constants';
14
- import {
15
- BG_COLOR_HOVER,
16
- CLIENTS_NAME,
17
- DEFAULT_FONT_FAMILY,
18
- PRIMARY_GREEN_COLOR,
19
- SECONDARY_PURPLE_COLOR,
20
- TEXT_COLOR_NEUTRAL_1
21
- } from './constants';
22
11
  import { base64Decode, getPath } from './utils/helper';
23
- import actions from './actions/_export';
12
+ import actions from './actions/export';
24
13
  import Catalog from './catalog/catalog';
25
- import { Content } from './components/_export';
14
+ import { Content } from './components/export';
26
15
  import Translator from './translator/translator';
27
16
  import { objectsMap } from './utils/objects-utils';
28
17
  import { VERSION } from './version';
29
18
 
30
- const AWS = require('aws-sdk');
31
-
32
- const StyledDialog = styled(Dialog)`
33
- .MuiDialog-paperWidthSm {
34
- border-radius: 10px;
35
- }
36
- `;
37
-
38
- export const StyledDialogContent = styled.span`
39
- font-family: ${DEFAULT_FONT_FAMILY};
40
- color: ${TEXT_COLOR_NEUTRAL_1};
41
- padding: 10px 30px;
42
- padding-top: 30px;
43
- `;
44
-
45
- export const StyledDialogAction = styled.div`
46
- display: flex;
47
- justify-content: flex-end;
48
- padding: 15px 30px 25px;
49
- `;
50
-
51
- export const StyledButton = styled.div`
52
- padding: 10px 20px;
53
- cursor: pointer;
54
- margin-right: 10px;
55
- color: ${SECONDARY_PURPLE_COLOR};
56
- font-weight: bold;
57
- font-family: ${DEFAULT_FONT_FAMILY};
58
- font-size: 16px;
59
- border-radius: 20px;
60
- :hover {
61
- background-color: ${BG_COLOR_HOVER};
62
- }
63
- `;
64
-
65
- const s3 = new AWS.S3({
66
- accessKeyId: process.env.REACT_APP_AWS_ID,
67
- secretAccessKey: process.env.REACT_APP_AWS_SECRET
68
- });
69
-
70
19
  const toolbarW = 0;
71
- const sidebarW = 250;
72
- const footerBarH = 20;
73
20
 
74
21
  const wrapperStyle = {
75
22
  display: 'flex',
@@ -549,41 +496,6 @@ class KitchenConfigurator extends Component {
549
496
 
550
497
  return (
551
498
  <section>
552
- <SnackBar
553
- isOpen={this.state.isSnackBarOpen}
554
- message={this.state.snackBarMessage}
555
- handleClose={() =>
556
- this.setState({ isSnackBarOpen: false, snackBarMessage: '' })
557
- }
558
- autoHideDuration={10000}
559
- />
560
- <SnackBar
561
- style={{ marginTop: this.state.isSnackBarOpen ? 75 : 'unset' }}
562
- isOpen={this.state.isSnackBar1Open}
563
- message={`The items in your design have been added to your shopping cart at ${CLIENTS_NAME[sessionStorage.getItem('visualizerName')]}. <br />Please log in with the same email address.`}
564
- autoHideDuration={20000}
565
- action={
566
- <div>
567
- <a
568
- href={this.state.redirectURL}
569
- target="_blank"
570
- style={{
571
- fontFamily: DEFAULT_FONT_FAMILY,
572
- color: PRIMARY_GREEN_COLOR,
573
- fontWeight: 700,
574
- marginRight: 10
575
- }}
576
- >
577
- View Cart
578
- </a>
579
- <img
580
- onClick={() => this.setState({ isSnackBar1Open: false })}
581
- style={{ float: 'right', height: 24, cursor: 'pointer' }}
582
- src="/assets/img/svg/close.svg"
583
- />
584
- </div>
585
- }
586
- />
587
499
  <div style={{ ...wrapperStyle, height }}>
588
500
  <Content
589
501
  width={contentW}
@@ -0,0 +1,43 @@
1
+ import React from 'react';
2
+ import Snackbar from '@material-ui/core/Snackbar';
3
+ import { SnackbarContent } from '@material-ui/core/index';
4
+ import Slide from '@material-ui/core/Slide';
5
+ import { TEXT_COLOR_NEUTRAL_0 } from '../../../constants';
6
+
7
+ const SnackBar = ({
8
+ message,
9
+ isOpen = false,
10
+ autoHideDuration = !!autoHideDuration ? autoHideDuration : 5000,
11
+ action = '',
12
+ handleClose,
13
+ snackBarColor = TEXT_COLOR_NEUTRAL_0,
14
+ style
15
+ }) => {
16
+ return (
17
+ <Snackbar
18
+ style={style}
19
+ open={isOpen}
20
+ autoHideDuration={autoHideDuration}
21
+ handleClose={handleClose}
22
+ anchorOrigin={{ vertical: 'top', horizontal: 'center' }}
23
+ TransitionComponent={Slide}
24
+ onClose={handleClose}
25
+ >
26
+ <SnackbarContent
27
+ style={{ backgroundColor: snackBarColor }}
28
+ action={
29
+ action || (
30
+ <img
31
+ onClick={handleClose}
32
+ style={{ float: 'right', height: 24, cursor: 'pointer' }}
33
+ src="/assets/img/svg/close.svg"
34
+ />
35
+ )
36
+ }
37
+ message={<div dangerouslySetInnerHTML={{ __html: message }} />}
38
+ />
39
+ </Snackbar>
40
+ );
41
+ };
42
+
43
+ export default SnackBar;
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+
3
+ import { RadioWrapper } from './styles';
4
+
5
+ const RadioButton = ({ label, checked = false, name, value, id, onChange }) => {
6
+ return (
7
+ <RadioWrapper onClick={() => onChange(value)}>
8
+ <input
9
+ type="radio"
10
+ id={id}
11
+ name={name}
12
+ defaultChecked={checked}
13
+ value={value}
14
+ />
15
+ <label htmlFor={id}>{label}</label>
16
+ </RadioWrapper>
17
+ );
18
+ };
19
+
20
+ export default RadioButton;
@@ -0,0 +1,56 @@
1
+ import styled from 'styled-components';
2
+
3
+ export const RadioWrapper = styled.div`
4
+ display: inline-block;
5
+ color: #fff;
6
+ margin-right: 10px;
7
+
8
+ [type='radio']:checked,
9
+ [type='radio']:not(:checked) {
10
+ position: absolute;
11
+ left: -9999px;
12
+ }
13
+ [type='radio']:checked + label,
14
+ [type='radio']:not(:checked) + label {
15
+ position: relative;
16
+ padding-left: 28px;
17
+ cursor: pointer;
18
+ line-height: 20px;
19
+ display: inline-block;
20
+ }
21
+ [type='radio']:checked + label:before,
22
+ [type='radio']:not(:checked) + label:before {
23
+ content: '';
24
+ position: absolute;
25
+ left: 0;
26
+ top: 0;
27
+ width: 18px;
28
+ height: 18px;
29
+ border: 1px solid #ddd;
30
+ border-radius: 100%;
31
+ background: #fff;
32
+ }
33
+ [type='radio']:checked + label:after,
34
+ [type='radio']:not(:checked) + label:after {
35
+ content: '';
36
+ width: 12px;
37
+ height: 12px;
38
+ background: #000;
39
+ position: absolute;
40
+ top: 4px;
41
+ left: 4px;
42
+ border-radius: 100%;
43
+ -webkit-transition: all 0.2s ease;
44
+ transition: all 0.2s ease;
45
+ }
46
+ [type='radio']:not(:checked) + label:after {
47
+ opacity: 0;
48
+ -webkit-transform: scale(0);
49
+ transform: scale(0);
50
+ }
51
+ [type='radio']:checked + label:after {
52
+ opacity: 1;
53
+ -webkit-transform: scale(1);
54
+ transform: scale(1);
55
+ }
56
+ `;
@@ -0,0 +1,157 @@
1
+ import React, { Component } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import styled from 'styled-components';
4
+ import {
5
+ BG_COLOR_0,
6
+ BG_COLOR_1,
7
+ BG_COLOR_HOVER,
8
+ DEFAULT_FONT_FAMILY,
9
+ PRIMARY_GREEN_COLOR,
10
+ SECONDARY_PURPLE_COLOR,
11
+ SHADE_DARK_GREEN_COLOR,
12
+ SHADE_DARK_PURPLE_COLOR,
13
+ SHADE_LIGHT_GREEN_COLOR,
14
+ SHADE_LIGHT_PURPLE_COLOR,
15
+ TEXT_COLOR_NEUTRAL_4
16
+ } from '../../constants';
17
+
18
+ /*
19
+ variant: primary, secondary, tertiary(default), icon, close, pagenumber;
20
+ size: large, small(default);
21
+ disabled: true, false(default);
22
+ text: user definition;
23
+ icon: user definition;
24
+ endIcon: user definition;
25
+ onClick: user definition;
26
+ buttonStyle: user definition;
27
+ textStyle: user definition;
28
+ imgStyle: userdefinition;
29
+ */
30
+
31
+ export default class MainButton extends Component {
32
+ constructor(props, context) {
33
+ super(props, context);
34
+ }
35
+
36
+ render() {
37
+ const { variant, text, size, icon, endIcon, disabled } = this.props;
38
+ let padding = '10px 20px';
39
+
40
+ if (size === 'large') {
41
+ if (variant === 'icon' || variant === 'pagenumber') padding = '10px';
42
+ } else {
43
+ if (variant === 'icon' || variant === 'pagenumber') padding = '5px';
44
+ else padding = '5px 10px';
45
+ }
46
+
47
+ const StyledButton = styled.button`
48
+ /* width: max-content; */
49
+ display: flex;
50
+ align-items: center;
51
+ justify-content: center;
52
+ padding: ${padding};
53
+ border: ${variant === 'primary' ? '0px solid' : '1px solid'};
54
+ cursor: ${disabled ? 'no-drop' : 'pointer'};
55
+ user-select: none;
56
+ background-color: ${variant === 'primary'
57
+ ? SECONDARY_PURPLE_COLOR
58
+ : BG_COLOR_1};
59
+ border-color: ${variant === 'primary' || variant === 'secondary'
60
+ ? SECONDARY_PURPLE_COLOR
61
+ : BG_COLOR_1};
62
+ border-radius: ${variant === 'icon' ? '50%' : '5px'};
63
+ outline: 0;
64
+ height: ${size === 'large' ? '40px' : '35px'};
65
+ width: ${variant === 'icon' || variant === 'pagenumber'
66
+ ? size === 'large'
67
+ ? '40px'
68
+ : '35px'
69
+ : 'max-content'};
70
+ :focus {
71
+ box-shadow: ${!disabled &&
72
+ `0px 0px 5px 2px ${SHADE_LIGHT_PURPLE_COLOR}`};
73
+ }
74
+ :hover {
75
+ background-color: ${!disabled &&
76
+ (variant === 'primary' ? SHADE_LIGHT_PURPLE_COLOR : BG_COLOR_0)};
77
+ }
78
+ :active {
79
+ background-color: ${!disabled &&
80
+ (variant === 'primary' ? SHADE_DARK_PURPLE_COLOR : BG_COLOR_0)};
81
+ }
82
+ `;
83
+
84
+ const StyledLabel = styled.span`
85
+ color: ${disabled
86
+ ? TEXT_COLOR_NEUTRAL_4
87
+ : variant === 'primary'
88
+ ? BG_COLOR_1
89
+ : SECONDARY_PURPLE_COLOR};
90
+ font-family: ${DEFAULT_FONT_FAMILY};
91
+ font-size: 13px;
92
+ font-weight: 600;
93
+ line-height: 18px;
94
+ text-align: center;
95
+ `;
96
+
97
+ const StyledImage = styled.img`
98
+ height: ${size === 'large' ? '20px' : '15px'};
99
+ width: ${size === 'large' ? '20px' : '15px'};
100
+ background-color: ${disabled
101
+ ? TEXT_COLOR_NEUTRAL_4
102
+ : variant !== 'primary'
103
+ ? SECONDARY_PURPLE_COLOR
104
+ : BG_COLOR_1};
105
+ -webkit-mask-image: url(${props => props.maskImage + '?nocache=2025'});
106
+ -webkit-mask-size: 90%;
107
+ -webkit-mask-repeat: no-repeat;
108
+ -webkit-mask-position: center;
109
+ `;
110
+
111
+ if (variant === 'icon' && text)
112
+ console.log('If your variant is icon, you cannnot use text');
113
+ if (variant === 'icon' && endIcon)
114
+ console.log('If your variant is icon, you cannnot use endIcon');
115
+ if (variant === 'icon' && (icon || endIcon))
116
+ console.log(
117
+ 'If your variant is pagenumber, you cannnot use icon or endIcon'
118
+ );
119
+ if (variant === 'close' && icon)
120
+ console.log('If your variant is close, you cannnot use icon');
121
+
122
+ return (
123
+ <StyledButton
124
+ onClick={!disabled && this.props.onClick}
125
+ style={{ ...this.props.buttonStyle }}
126
+ >
127
+ {variant !== 'pagenumber' && variant !== 'close' && icon && (
128
+ <StyledImage
129
+ style={{
130
+ ...this.props.imgStyle,
131
+ marginRight: variant !== 'icon' && 10
132
+ }}
133
+ maskImage={icon}
134
+ />
135
+ )}
136
+ {variant !== 'icon' && (
137
+ <StyledLabel style={{ ...this.props.textStyle }}>
138
+ {variant === 'pagenumber'
139
+ ? parseInt(text)
140
+ ? parseInt(text)
141
+ : 0
142
+ : text}
143
+ </StyledLabel>
144
+ )}
145
+ {variant !== 'pagenumber' && variant !== 'icon' && endIcon && (
146
+ <StyledImage style={{ marginLeft: 10 }} maskImage={endIcon} />
147
+ )}
148
+ </StyledButton>
149
+ );
150
+ }
151
+ }
152
+
153
+ MainButton.propTypes = {
154
+ variant: PropTypes.string.isRequired,
155
+ size: PropTypes.string.isRequired,
156
+ onClick: PropTypes.func
157
+ };
@@ -0,0 +1,65 @@
1
+ import React, { Component } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import styled from 'styled-components';
4
+
5
+ const Toggle = styled.div`
6
+ display: flex;
7
+ align-items: center;
8
+ position: relative;
9
+ height: 36px;
10
+ margin-left: 20px;
11
+ justify-content: center;
12
+ font-size: 14px;
13
+ cursor: pointer;
14
+ -webkit-user-select: none;
15
+ -moz-user-select: none;
16
+ -ms-user-select: none;
17
+ user-select: none;
18
+ :hover {
19
+ box-shadow: 0px 3px 5px -1px rgba(156, 154, 154, 0.2),
20
+ 0px 6px 10px 0px rgba(156, 154, 154, 0.39),
21
+ 0px 1px 18px 0px rgba(156, 154, 154, 0.12);
22
+ border-radius: 18px;
23
+ }
24
+ `;
25
+
26
+ const ToggleIcon = styled.div`
27
+ ${'' /* transition-duration: .3s; */}
28
+ position: absolute;
29
+ top: 0px;
30
+ img {
31
+ font-size: 1.4rem;
32
+ box-sizing: border-box;
33
+ border-radius: 50%;
34
+ }
35
+ `;
36
+
37
+ export default class ToggleMeasureButton extends Component {
38
+ constructor(props, context) {
39
+ super(props, context);
40
+ }
41
+
42
+ render() {
43
+ let { props } = this;
44
+ let activeStyle = props.showMeasure === 0 ? { left: 0 } : { right: 0 };
45
+ return (
46
+ <Toggle onClick={props.onClick} style={{ ...props.style }}>
47
+ {props.backgroundImage}
48
+ {[
49
+ props.icon !== undefined ? (
50
+ <ToggleIcon style={{ ...activeStyle }} key={props.icon}>
51
+ {props.icon}
52
+ </ToggleIcon>
53
+ ) : null
54
+ ]}
55
+ </Toggle>
56
+ );
57
+ }
58
+ }
59
+
60
+ ToggleMeasureButton.propTypes = {
61
+ title: PropTypes.string,
62
+ hover: PropTypes.bool,
63
+ active: PropTypes.bool.isRequired,
64
+ onClick: PropTypes.func
65
+ };
@@ -0,0 +1,53 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { MdArrowBack as Arrow } from 'react-icons/md';
4
+ import * as SharedStyle from '../../shared-style';
5
+
6
+ const breadcrumbStyle = {
7
+ margin: '1.5em',
8
+ display: 'flex'
9
+ };
10
+
11
+ const breadcrumbTextStyle = {
12
+ fontSize: '20px',
13
+ cursor: 'pointer'
14
+ };
15
+
16
+ const breadcrumbLastTextStyle = {
17
+ ...breadcrumbTextStyle,
18
+ fontWeight: 'bolder',
19
+ color: SharedStyle.SECONDARY_COLOR.main
20
+ };
21
+
22
+ const breadcrumbTabStyle = {
23
+ fill: SharedStyle.COLORS.black,
24
+ fontSize: '24px',
25
+ marginLeft: '10px',
26
+ marginRight: '10px'
27
+ };
28
+
29
+ const CatalogBreadcrumb = ({ names }) => {
30
+ let labelNames = names.map((name, ind) => {
31
+ let lastElement = ind === names.length - 1;
32
+
33
+ return (
34
+ <div key={ind} style={{ display: 'flex' }}>
35
+ <div
36
+ style={!lastElement ? breadcrumbTextStyle : breadcrumbLastTextStyle}
37
+ onClick={name.action || null}
38
+ >
39
+ {name.name}
40
+ </div>
41
+ {!lastElement ? <Arrow style={breadcrumbTabStyle} /> : null}
42
+ </div>
43
+ );
44
+ });
45
+
46
+ return <div style={breadcrumbStyle}>{labelNames}</div>;
47
+ };
48
+
49
+ CatalogBreadcrumb.propTypes = {
50
+ names: PropTypes.arrayOf(PropTypes.object).isRequired
51
+ };
52
+
53
+ export default CatalogBreadcrumb;