@bytebrand/fe-ui-core 4.8.49 → 4.8.51

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 (194) hide show
  1. package/.husky/pre-push +4 -0
  2. package/.storybook/addons.js +4 -0
  3. package/.storybook/config.js +64 -0
  4. package/.storybook/postcss.config.js +6 -0
  5. package/.storybook/preview-head.html +10 -0
  6. package/.storybook/webpack.config.js +130 -0
  7. package/__tests__/components/Checkout/OrderOverviewItem/OrderOverviewItem.test.tsx +42 -0
  8. package/__tests__/components/Checkout/PaymentTypeCard/PaymentTypeCard.test.tsx +50 -0
  9. package/__tests__/components/Checkout/RadioGroup.test.tsx +95 -0
  10. package/__tests__/components/Checkout/ServiceCardWrapper.test.tsx +53 -0
  11. package/__tests__/components/Checkout/Switcher.test.tsx +43 -0
  12. package/__tests__/components/UserDasboardPage/sections/CheckoutSection/CheckoutSection.test.tsx +613 -0
  13. package/__tests__/components/UserDasboardPage/sections/FavoriteSection/FavoriteSection.test.tsx +335 -0
  14. package/__tests__/components/UserDasboardPage/sections/OrderStatusSection/AdditionalOrderInfo.test.tsx +127 -0
  15. package/__tests__/components/UserDasboardPage/sections/OrderStatusSection/OrderStatusCar.test.tsx +58 -0
  16. package/__tests__/components/UserDasboardPage/sections/OrderStatusSection/OrderStatusCard.test.tsx +74 -0
  17. package/__tests__/components/UserDasboardPage/sections/OrderStatusSection/OrderStatusSection.test.tsx +62 -0
  18. package/__tests__/components/UserDasboardPage/sections/RequestedCarsSection/RequestedCarsSection.test.tsx +117 -0
  19. package/__tests__/components/Vehicle/VehicleFormattedPrice/VehicleFormattedPrice.test.tsx +58 -0
  20. package/__tests__/components/VehicleSmallCard/VehicleInfo.test.tsx +88 -0
  21. package/__tests__/components/VehicleSmallCard/VehicleTitle.test.tsx +91 -0
  22. package/__tests__/components/_common/Badge/Badge.test.tsx +15 -0
  23. package/__tests__/components/_common/IconSVG/IconSVG.test.tsx +23 -0
  24. package/__tests__/components/_common/Image/Image.test.tsx +82 -0
  25. package/__tests__/components/_common/MaterialAutocomplete/MaterialAutocomplete.test.tsx +49 -0
  26. package/__tests__/components/_common/MaterialDatePicker/MaterialDatePicker.test.tsx +54 -0
  27. package/__tests__/components/_common/MaterialField/MaterialField.test.tsx +58 -0
  28. package/__tests__/components/_common/StarButton/StarButton.test.tsx +46 -0
  29. package/__tests__/mockedData/financingConfig.js +202 -0
  30. package/__tests__/mockedData/mockedPendingRequestedCar.js +69 -0
  31. package/__tests__/utils/CommonUtils/addPrefixToKeys.test.ts +18 -0
  32. package/__tests__/utils/CommonUtils/arrToObj.test.js +32 -0
  33. package/__tests__/utils/CommonUtils/checkRangeValuesOnEqual.test.ts +17 -0
  34. package/__tests__/utils/CommonUtils/fixNumber.test.ts +20 -0
  35. package/__tests__/utils/CommonUtils/formatMileage.test.ts +8 -0
  36. package/__tests__/utils/CommonUtils/getChipFilterValue.test.ts +22 -0
  37. package/__tests__/utils/CommonUtils/getFormattedNumber.test.ts +19 -0
  38. package/__tests__/utils/CommonUtils/getFormattedPrice.test.ts +19 -0
  39. package/__tests__/utils/CommonUtils/getGroupValuesForQuery.test.ts +51 -0
  40. package/__tests__/utils/CommonUtils/getOfferSliders.test.ts +64 -0
  41. package/__tests__/utils/CommonUtils/getPriceRating.test.ts +26 -0
  42. package/__tests__/utils/CommonUtils/getPriceRatingConfig.test.ts +33 -0
  43. package/__tests__/utils/CommonUtils/preloadNearbyImages.test.ts +9 -0
  44. package/__tests__/utils/CommonUtils/sliceLessThan.test.ts +23 -0
  45. package/__tests__/utils/CommonUtils/sliceMoreThan.test.ts +23 -0
  46. package/media/locales/de/promoSlider.json +1 -0
  47. package/media/locales/en/promoSlider.json +1 -0
  48. package/package.json +2 -5
  49. package/source/components/AccordionWidget/AccordionWidget.styl +1 -0
  50. package/source/components/AccordionWidget/AccordionWidget.tsx +8 -4
  51. package/source/components/AdvantageItem/AdvantageItem.story.js +23 -0
  52. package/source/components/Alternative/Dealer.story.js +32 -0
  53. package/source/components/Alternative/Dealer.story.styl +3 -0
  54. package/source/components/Breadcrumbs/Breadcrumbs.story.js +40 -0
  55. package/source/components/Breadcrumbs/FirstInfoBlock/FirstInfoBlock.story.js +45 -0
  56. package/source/components/Checkout/OrderOverviewItem/OrderOverviewItem.story.js +243 -0
  57. package/source/components/Checkout/OrderOverviewItem/OrderOverviewItem.story.styl +21 -0
  58. package/source/components/Checkout/RadioCards/RadioGroupCheckout.story.js +105 -0
  59. package/source/components/Checkout/RadioCards/RadioGroupCheckout.story.styl +37 -0
  60. package/source/components/Checkout/Switcher/Switcher.story.js +41 -0
  61. package/source/components/Checkout/Switcher/Switcher.story.styl +2 -0
  62. package/source/components/CompactSearchWidget/CompactSearchWidget.story.js +187 -0
  63. package/source/components/ContactForm/ContactForm.story.js +94 -0
  64. package/source/components/ContactForm/ContactForm.story.styl +0 -0
  65. package/source/components/ContactInfo/ContactInfo.story.js +58 -0
  66. package/source/components/CustomerQuote/CustomerQuote.story.js +41 -0
  67. package/source/components/CustomerQuotesSlider/CustomerQuotesSlider.story.js +73 -0
  68. package/source/components/CustomerQuotesSlider/CustomerQuotesSlider.story.styl +5 -0
  69. package/source/components/FormattedNumber/FormattedNumber.story.js +114 -0
  70. package/source/components/InfoBlocks/InfoBlockWrapper.story.js +101 -0
  71. package/source/components/InfoBlocks/InfoBlockWrapper.story.styl +46 -0
  72. package/source/components/OfferPanel/AboAccordion/AboFaq/AboFaq.story.js +97 -0
  73. package/source/components/OfferPanel/OfferCheckboxGroup/CheckboxContainer.tsx +1 -1
  74. package/source/components/OfferPanel/OfferCheckboxGroup/OfferCheckboxGroup.styl +24 -0
  75. package/source/components/OfferPanel/OfferCheckboxGroup/OfferCheckboxGroup.tsx +1 -1
  76. package/source/components/OfferPanel/OfferPanel.story.js +139 -0
  77. package/source/components/OfferPanel/OfferPanel.tsx +1 -1
  78. package/source/components/OfferPanel/RangeGroup/RangeGroup.story.js +35 -0
  79. package/source/components/OfferPanel/RangeGroup/RangeGroup.story.styl +3 -0
  80. package/source/components/PriceRating/PriceRating.story.js +39 -0
  81. package/source/components/PriceRating/PriceRating.story.styl +2 -0
  82. package/source/components/PriceRatingDetailed/PriceRatingDetailed.story.js +78 -0
  83. package/source/components/PriceRatingDetailed/PriceRatingDetailed.story.styl +11 -0
  84. package/source/components/RateSearchValue/RateSearchValue.story.js +78 -0
  85. package/source/components/RateSearchValue/RateSearchValue.story.styl +2 -0
  86. package/source/components/RateSearchWidget/RateSearchWidget.story.js +57 -0
  87. package/source/components/RateSearchWidget/RateSearchWidget.story.styl +12 -0
  88. package/source/components/SearchFilters/FiltersFactory.story.js +273 -0
  89. package/source/components/SearchPage/Filters/MakeModel/MakeModel.story.js +12 -0
  90. package/source/components/SearchWidget/BasicDataWidget/BasicDataWidget.story.js +834 -0
  91. package/source/components/SearchWidget/BasicDataWidget/BasicDataWidget.story.styl +40 -0
  92. package/source/components/SearchWidget/SearchWidget.story.js +191 -0
  93. package/source/components/SearchWidget/SearchWidget.story.styl +6 -0
  94. package/source/components/Stepper/Stepper.story.js +119 -0
  95. package/source/components/Stepper/Stepper.story.styl +41 -0
  96. package/source/components/Theme.story.js +36 -0
  97. package/source/components/Theme.story.styl +85 -0
  98. package/source/components/TickerText/TickerText.story.js +17 -0
  99. package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusSection.story.js +95 -0
  100. package/source/components/UserDashboardPage/sections/RequestedCarsSection/RequestedCarsSection.story.js +97 -0
  101. package/source/components/Vehicle/VehicleConsumption/VehicleConsumption.story.js +31 -0
  102. package/source/components/Vehicle/VehicleFormattedPrice/VehicleFormattedPrice.story.js +247 -0
  103. package/source/components/VehicleCompared/CompareGeneral/CompareGeneral.story.js +30 -0
  104. package/source/components/VehicleCompared/ComparePrice/ComparePrice.story.js +18 -0
  105. package/source/components/VehicleCompared/CompareTitle/CompareTitle.story.js +19 -0
  106. package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.story.js +44 -0
  107. package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.tsx +23 -11
  108. package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.story.js +120 -0
  109. package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.tsx +2 -0
  110. package/source/components/VehicleDetailedSlider/partials/PriceData.tsx +7 -4
  111. package/source/components/VehiclePromoSlider/VehiclePromoInfo/VehiclePromoInfo.story.js +42 -0
  112. package/source/components/VehiclePromoSlider/VehiclePromoSlide/VehiclePromoSlide.story.js +62 -0
  113. package/source/components/VehiclePromoSlider/VehiclePromoSlider.story.js +42 -0
  114. package/source/components/VehicleSmallCard/VehicleData/VechiclePriceItem/VechiclePriceItem.styl +5 -0
  115. package/source/components/VehicleSmallCard/VehicleData/VechiclePriceItem/VechiclePriceItem.tsx +3 -1
  116. package/source/components/VehicleSmallCard/VehicleData/VehicleInfo/VehicleInfo.styl +1 -1
  117. package/source/components/VehicleSmallCard/VehicleData/VehicleInfo/VehicleInfo.tsx +24 -11
  118. package/source/components/VehicleSmallCard/VehicleData/VehiclePrice/VehiclePrice.styl +3 -2
  119. package/source/components/VehicleSmallCard/VehicleData/VehicleProperty/VehicleProperty.styl +4 -1
  120. package/source/components/VehicleSmallCard/VehicleData/VehicleProperty/VehicleProperty.tsx +3 -2
  121. package/source/components/VehicleSmallCard/VehicleData/VehicleTitle/VehicleTitle.tsx +1 -1
  122. package/source/components/VehicleSmallCard/VehicleSmallCard.story.js +412 -0
  123. package/source/components/VehicleSmallCard/VehicleSmallCard.story.styl +56 -0
  124. package/source/components/VehicleSmallCard/VehicleSmallCard.tsx +14 -3
  125. package/source/components/VehicleSmallCardForDealerships/VehicleSmallCardForDealerships.story.js +199 -0
  126. package/source/components/VehicleSmallCardForDealerships/VehicleSmallCardForDealerships.story.styl +40 -0
  127. package/source/components/_common/Accordion/Accordion.story.js +36 -0
  128. package/source/components/_common/Badge/Badge.story.js +27 -0
  129. package/source/components/_common/Badge/Badge.story.styl +5 -0
  130. package/source/components/_common/Bubble/Bubble.story.js +52 -0
  131. package/source/components/_common/Button/Button.story.js +52 -0
  132. package/source/components/_common/Button/Button.story.styl +5 -0
  133. package/source/components/_common/ButtonOld/Button.story.js +54 -0
  134. package/source/components/_common/ButtonOld/Button.story.styl +5 -0
  135. package/source/components/_common/Checkbox/Checkbox.story.js +85 -0
  136. package/source/components/_common/Checkbox/Checkbox.story.styl +14 -0
  137. package/source/components/_common/CheckboxMaterial/CheckboxMaterial.story.js +126 -0
  138. package/source/components/_common/CheckboxMaterial/CheckboxMaterial.story.styl +14 -0
  139. package/source/components/_common/Chip/Chip.story.js +43 -0
  140. package/source/components/_common/ChipList/ChipList.story.js +36 -0
  141. package/source/components/_common/DropDown/DropDown.story.js +35 -0
  142. package/source/components/_common/ExpandablePanel/ExpandablePanel.story.js +41 -0
  143. package/source/components/_common/Histogram/Histogram.story.js +51 -0
  144. package/source/components/_common/IconSVG/IconSVG.story.js +21 -0
  145. package/source/components/_common/IconSVG/IconSVG.story.styl +25 -0
  146. package/source/components/_common/Image/Image.story.js +142 -0
  147. package/source/components/_common/Image/Image.story.styl +18 -0
  148. package/source/components/_common/ImagesSet/ImagesSet.story.js +34 -0
  149. package/source/components/_common/ImagesSet/ImagesSet.story.styl +4 -0
  150. package/source/components/_common/Loader/Loader.story.js +21 -0
  151. package/source/components/_common/MaterialAccordionGroup/MaterialAccordionGroup.story.js +49 -0
  152. package/source/components/_common/MaterialAccordionGroup/MaterialAccordionGroup.styled.tsx +4 -1
  153. package/source/components/_common/MaterialDatePicker/MaterialDatePicker.story.js +45 -0
  154. package/source/components/_common/MaterialDatePicker/MaterialDatePicker.story.styl +6 -0
  155. package/source/components/_common/MaterialField/MaterialField.story.js +87 -0
  156. package/source/components/_common/MaterialField/MaterialField.story.styl +34 -0
  157. package/source/components/_common/MaterialSelect/MaterialSelect.story.js +52 -0
  158. package/source/components/_common/MaterialSelect/MaterialSelect.story.styl +6 -0
  159. package/source/components/_common/MaterialStepButton/MaterialStepButton.story.js +47 -0
  160. package/source/components/_common/MaterialStepButton/MaterialStepButton.story.styl +6 -0
  161. package/source/components/_common/MaterialSwitch/MaterialSwitch.story.js +17 -0
  162. package/source/components/_common/MaterialTooltip/MaterialTooltip.story.js +10 -0
  163. package/source/components/_common/MaterialTooltip/MaterialTooltip.tsx +1 -1
  164. package/source/components/_common/Modal/Modal.story.js +37 -0
  165. package/source/components/_common/MuiGroupedSelect/MuiGroupedSelect.story.js +21 -0
  166. package/source/components/_common/PropertySelector/PSGroup.story.js +93 -0
  167. package/source/components/_common/PropertySelector/PSGroup.story.styl +25 -0
  168. package/source/components/_common/PropertySelector/ProperySelector.story.js +83 -0
  169. package/source/components/_common/Radio/FormRadioGroup.story.js +28 -0
  170. package/source/components/_common/Radio/FormRadioGroup.story.styl +2 -0
  171. package/source/components/_common/Radio/Radio.story.js +54 -0
  172. package/source/components/_common/Radio/RadioGroup.story.js +90 -0
  173. package/source/components/_common/Radio/RadioGroup.story.styl +39 -0
  174. package/source/components/_common/Range/Range.story.js +46 -0
  175. package/source/components/_common/Range/Range.story.styl +5 -0
  176. package/source/components/_common/SliderArrow/SliderArrow.story.js +18 -0
  177. package/source/components/_common/Tabs/Tabs.story.js +56 -0
  178. package/source/components/_common/TimePicker/TimePicker.story.js +37 -0
  179. package/source/components/_common/Tooltip/Tooltip.story.js +28 -0
  180. package/source/components/_common/UserMenu/MaterialMenu.story.js +73 -0
  181. package/source/components/_common/VehicleSlider/VehicleSlider.story.js +99 -0
  182. package/source/components/_common/VehicleSlider/VehicleSlider.story.styl +0 -0
  183. package/source/components/_common/withLabel/withLabel.story.js +62 -0
  184. package/source/components/_common/withPopover/withPopover.story.js +48 -0
  185. package/source/components/_common/withPopover/withPopover.story.styl +54 -0
  186. package/source/components/_common/withStats/withStats.story.js +75 -0
  187. package/source/components/_common/withStats/withStats.tsx +1 -1
  188. package/source/framework/DataTransformers.ts +1 -0
  189. package/source/framework/constants/common.ts +8 -4
  190. package/source/framework/types/types.ts +1 -0
  191. package/source/framework/vehiclesProps/decoratedLightProps.tsx +48 -12
  192. package/source/framework/vehiclesProps/decoratedProps.tsx +35 -8
  193. package/source/locales/data.ts +3 -0
  194. package/bytebrand-fe-ui-core-4.8.47.tgz +0 -0
@@ -0,0 +1,51 @@
1
+ import React from 'react';
2
+ import Slider from '@bytebrand/fe-histoslider';
3
+ import { storiesOf } from '@storybook/react';
4
+ import { action } from '@storybook/addon-actions';
5
+
6
+ import { PRICE_HISTOGRAM } from '../../../framework/data';
7
+
8
+ // Stateful container for testing interaction
9
+ class HistosliderContainer extends React.Component {
10
+ state = {
11
+ selection: null
12
+ };
13
+ setSelection = selection => {
14
+ (() => action("setSelection"))();
15
+ this.setState({ selection });
16
+ };
17
+
18
+ render() {
19
+ const histogram = PRICE_HISTOGRAM.map((item) => ({
20
+ x0: item.from,
21
+ x: item.to,
22
+ y: item.count
23
+ }));
24
+ const props = {
25
+ handleLabelFormat: ',.2r',
26
+ data: histogram,
27
+ // How much to pad the slider and histogram by, defaults to 20
28
+ padding: 0,
29
+ // The extent of the selection, this doesn't have to be sorted (and you shouldn't sort it to store it)
30
+ selection: this.state.selection,
31
+ // A function to handle a change in the selection
32
+ onChange: this.setSelection
33
+ };
34
+
35
+ return (
36
+ <div>
37
+ <Slider {...props} />
38
+ <Slider {...props} disableHistogram />
39
+ </div>
40
+ );
41
+ }
42
+ }
43
+
44
+ storiesOf('_Common_UI', module)
45
+ .add('Histogram', () => (
46
+ <div>
47
+ <HistosliderContainer />
48
+ </div>
49
+ ));
50
+
51
+
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import components from './IconSVGConfig';
3
+
4
+ import { storiesOf } from '@storybook/react';
5
+
6
+ import IconSVG from './IconSVG';
7
+ import styles from './IconSVG.story.styl';
8
+
9
+ const iconNames = Object.keys(components);
10
+
11
+ storiesOf('_Common_UI', module)
12
+ .add('IconSVG', () => (
13
+ <div style={{display: 'flex', flexWrap: 'wrap'}}>
14
+ {iconNames.map((name) => (
15
+ <div style={{width: '250px', margin: '10px', padding: '10px', border: '1px solid black', display: 'flex', justifyContent: 'space-between', alignItems: 'center'}}>
16
+ <IconSVG customDimensions name={name}/>
17
+ <div> - {name}</div>
18
+ </div>
19
+ ))}
20
+ </div>
21
+ ));
@@ -0,0 +1,25 @@
1
+ @import '../../../theme/theme.styl'
2
+
3
+ .wrapper
4
+ margin-bottom: 10px
5
+ text-align: center
6
+
7
+ .camera
8
+ fill: $grassGreen
9
+
10
+ .sliderEye
11
+ fill: $primary
12
+ width: 3em
13
+ height: 3em
14
+
15
+ .star
16
+ fill: $yellow
17
+ width: 40px
18
+ height: 30px
19
+ stroke: black
20
+ stroke-width: 1px
21
+
22
+ .checkBlue
23
+ fill: $primary
24
+ width: 3em
25
+ height: 3em
@@ -0,0 +1,142 @@
1
+ import React from 'react';
2
+ import styles from './Image.story.styl'
3
+ import { storiesOf } from '@storybook/react';
4
+
5
+ import Image from './Image.tsx';
6
+ import {COLUMN_STYLES, CONTAINER_STYLES, ROW_STYLES} from '../../../framework/constants';
7
+
8
+ const SRC_HORIZONTAL = 'https://placekitten.com/150/100';
9
+ const SRC_SQUARE = 'https://placekitten.com/150/150';
10
+ const SRC_VERTICAL = 'https://placekitten.com/100/150';
11
+
12
+ const SRC_SMALL = 'https://dummyimage.com/3000x2000/000000/fff.png&text=SMALL+IMAGE';
13
+ const SRC_LARGE = 'https://dummyimage.com/3000x2000/eb00eb/ffffff.png&text=LARGE+IMAGE';
14
+
15
+ storiesOf('_Common_UI', module)
16
+ .add('Image', () => (
17
+ <div style={CONTAINER_STYLES}>
18
+ <div style={COLUMN_STYLES}>
19
+
20
+ <div style={ROW_STYLES}>
21
+ <div className={styles.row}>
22
+ <div className={styles.col}>
23
+ <h2 className={styles.title}>{`<Image width='100%' ratioW={4} ratioH={3} />`}</h2>
24
+ <div className={styles.row}>
25
+ <div className={styles.col}>
26
+ <Image srcSmall={SRC_SMALL} srcLarge={SRC_LARGE} width='500px' ratioW={4} ratioH={3} />
27
+ </div>
28
+ </div>
29
+ </div>
30
+ {/* <div className={styles.col}>
31
+ <h2 className={styles.title}>{`<Image width='100%' height={200} />`}</h2>
32
+ <div className={styles.row}>
33
+ <div className={styles.col} style={{ width: '300px', maxWidth: '100%', margin: '0 auto' }}>
34
+ <Image src={SRC_VERTICAL} width='100%' height={200} />
35
+ </div>
36
+ </div>
37
+ </div> */}
38
+ </div>
39
+ </div>
40
+
41
+ {/* <div style={ROW_STYLES}>
42
+ <h2 className={styles.title}>{`<Image width={200} ratioW={4} ratioH={3} />`}</h2>
43
+ <div className={styles.row}>
44
+ <div className={styles.col}>
45
+ <Image src={SRC_HORIZONTAL} width={200} ratioW={4} ratioH={3} />
46
+ <div className={styles.label}>(horizontal image 150x100)</div>
47
+ </div>
48
+ <div className={styles.col}>
49
+ <Image src={SRC_SQUARE} width={200} ratioW={4} ratioH={3} />
50
+ <div className={styles.label}>(square image 150x150)</div>
51
+ </div>
52
+ <div className={styles.col}>
53
+ <Image src={SRC_VERTICAL} width={200} ratioW={4} ratioH={3} />
54
+ <div className={styles.label}>(vertical image 100x150)</div>
55
+ </div>
56
+ </div>
57
+ </div>
58
+
59
+ <div style={ROW_STYLES}>
60
+ <h2 className={styles.title}>{`<Image width={200} ratioW={11} ratioH={5} />`}</h2>
61
+ <div className={styles.row}>
62
+ <div className={styles.col}>
63
+ <Image src={SRC_HORIZONTAL} width={200} ratioW={11} ratioH={5} />
64
+ <div className={styles.label}>(horizontal image 150x100)</div>
65
+ </div>
66
+ <div className={styles.col}>
67
+ <Image src={SRC_SQUARE} width={200} ratioW={11} ratioH={5} />
68
+ <div className={styles.label}>(square image 150x150)</div>
69
+ </div>
70
+ <div className={styles.col}>
71
+ <Image src={SRC_VERTICAL} width={200} ratioW={11} ratioH={5} />
72
+ <div className={styles.label}>(vertical image 100x150)</div>
73
+ </div>
74
+ </div>
75
+ </div>
76
+
77
+ <div style={ROW_STYLES}>
78
+ <h2 className={styles.title}>{`<Image width={250} height={200} />`}</h2>
79
+ <div className={styles.row}>
80
+ <div className={styles.col}>
81
+ <Image src={SRC_HORIZONTAL} width={250} height={200} />
82
+ <div className={styles.label}>(horizontal image 150x100)</div>
83
+ </div>
84
+ <div className={styles.col}>
85
+ <Image src={SRC_SQUARE} width={250} height={200} />
86
+ <div className={styles.label}>(square image 150x150)</div>
87
+ </div>
88
+ <div className={styles.col}>
89
+ <Image src={SRC_VERTICAL} width={250} height={200} />
90
+ <div className={styles.label}>(vertical image 100x150)</div>
91
+ </div>
92
+ </div>
93
+ </div>
94
+
95
+ <div style={ROW_STYLES}>
96
+ <h2 className={styles.title}>{`<Image width={200} height={250} />`}</h2>
97
+ <div className={styles.row}>
98
+ <div className={styles.col}>
99
+ <Image src={SRC_HORIZONTAL} width={200} height={250} />
100
+ <div className={styles.label}>(horizontal image 150x100)</div>
101
+ </div>
102
+ <div className={styles.col}>
103
+ <Image src={SRC_SQUARE} width={200} height={250} />
104
+ <div className={styles.label}>(square image 150x150)</div>
105
+ </div>
106
+ <div className={styles.col}>
107
+ <Image src={SRC_VERTICAL} width={200} height={250} />
108
+ <div className={styles.label}>(vertical image 100x150)</div>
109
+ </div>
110
+ </div>
111
+ </div>
112
+
113
+ <div style={ROW_STYLES}>
114
+ <h2 className={styles.title}>{`<Image width={200} height={200} />`}</h2>
115
+ <div className={styles.row}>
116
+ <div className={styles.col}>
117
+ <Image src={SRC_HORIZONTAL} width={200} height={200} />
118
+ <div className={styles.label}>(horizontal image 150x100)</div>
119
+ </div>
120
+ <div className={styles.col}>
121
+ <Image src={SRC_SQUARE} width={200} height={200} />
122
+ <div className={styles.label}>(square image 150x150)</div>
123
+ </div>
124
+ <div className={styles.col}>
125
+ <Image src={SRC_VERTICAL} width={200} height={200} />
126
+ <div className={styles.label}>(vertical image 100x150)</div>
127
+ </div>
128
+ </div>
129
+ </div>
130
+
131
+ <div style={ROW_STYLES}>
132
+ <h2 className={styles.title}>Error</h2>
133
+ <div className={styles.row}>
134
+ <div className={styles.col}>
135
+ <Image src='http://wrong.src.url' width={100} height={100} />
136
+ </div>
137
+ </div>
138
+ </div>*/}
139
+
140
+ </div>
141
+ </div>
142
+ ));
@@ -0,0 +1,18 @@
1
+ .title
2
+ text-align center
3
+ margin-top 20px
4
+ margin-bottom 10px
5
+ font-size 18px
6
+
7
+ .row
8
+ display flex
9
+ justify-content: space-between
10
+ flex-wrap: nowrap
11
+ text-align center
12
+
13
+ .col
14
+ margin 0 10px
15
+
16
+ .label
17
+ font-size 12px
18
+ margin-top 10px
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import { storiesOf } from '@storybook/react';
3
+ import { action } from '@storybook/addon-actions';
4
+ import { Resizable } from 're-resizable';
5
+ import ImagesSet from './ImagesSet';
6
+ import styles from './ImagesSet.story.styl';
7
+
8
+ const PLACEHOLDER_IMAGE_URL = 'https://images.autode-stage.de//noimage/small';
9
+ const IMAGE_URL = 'http://picsum.photos/400/300/?random';
10
+ const images = [];
11
+ for (let i = 0; i <= 7; i++) {
12
+ images.push({ url: `${IMAGE_URL}&tag=${Math.random()}`, description: '' });
13
+ }
14
+
15
+ const resizableProps = {
16
+ className: styles.resizable,
17
+ defaultSize: { width: 770, height: 390 }
18
+ };
19
+
20
+ const imagesSetProps = {
21
+ images,
22
+ imageSizes: [2, 1, 1, 2, 1, 1, 1, 2, 1],
23
+ columnsCount: 4,
24
+ rowsCount: 3,
25
+ onImageClick: action('click'),
26
+ placeholderUrl: PLACEHOLDER_IMAGE_URL
27
+ };
28
+
29
+ storiesOf('_Common_UI', module)
30
+ .add('ImagesSet', () => (
31
+ <Resizable {...resizableProps}>
32
+ <ImagesSet {...imagesSetProps} />
33
+ </Resizable>
34
+ ));
@@ -0,0 +1,4 @@
1
+ @import '../../../theme/theme.styl'
2
+
3
+ .resizable
4
+ border: 1px solid $grey-e
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+
3
+ import { storiesOf } from '@storybook/react';
4
+
5
+ import Loader from './Loader.tsx';
6
+ import { CONTAINER_STYLES } from '../../../framework/constants';
7
+
8
+
9
+ storiesOf('_Common_UI', module)
10
+ .add('Loader', () => (
11
+ <div style={CONTAINER_STYLES}>
12
+ <Loader size='tiny' />
13
+ <Loader size='small' />
14
+ <Loader size='medium' />
15
+ <Loader size='large' />
16
+
17
+ <div style={{ width: 40, height: 40 }}>
18
+ <Loader fluid />
19
+ </div>
20
+ </div>
21
+ ));
@@ -0,0 +1,49 @@
1
+ import React, { useState } from 'react';
2
+ import { storiesOf } from '@storybook/react';
3
+ import MaterialAccordionGroup from './MaterialAccordionGroup';
4
+
5
+ const MaterialAccordionGroupComponent = () => {
6
+ const [switchValue, setSwitchValue] = useState(false);
7
+ const handleSwitch = (value) => {
8
+ setSwitchValue(value);
9
+ };
10
+ const switchProps = {
11
+ value: switchValue,
12
+ onChange: handleSwitch
13
+ }
14
+ return (
15
+ <>
16
+ <MaterialAccordionGroup
17
+ title='Collaps item 1'
18
+ tooltipText='tooltipText'
19
+ withSwitch
20
+ switchProps={switchProps}
21
+ >
22
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse
23
+ malesuada lacus ex, sit amet blandit leo lobortis eget. Lorem ipsum dolor
24
+ sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex,
25
+ sit amet blandit leo lobortis eget.
26
+ </MaterialAccordionGroup>
27
+ <MaterialAccordionGroup
28
+ title='collaps item 1'
29
+ >
30
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse
31
+ malesuada lacus ex, sit amet blandit leo lobortis eget. Lorem ipsum dolor
32
+ sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex,
33
+ sit amet blandit leo lobortis eget.
34
+ </MaterialAccordionGroup>
35
+ <MaterialAccordionGroup
36
+ title='collaps item 1'
37
+ tooltipText='tooltipText 3'
38
+ >
39
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse
40
+ malesuada lacus ex, sit amet blandit leo lobortis eget. Lorem ipsum dolor
41
+ sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex,
42
+ sit amet blandit leo lobortis eget.
43
+ </MaterialAccordionGroup>
44
+ </>
45
+ )
46
+ }
47
+
48
+ storiesOf('_Common_UI', module)
49
+ .add('MaterialAccordionGroup', () => <MaterialAccordionGroupComponent />)
@@ -1,4 +1,7 @@
1
- import { styled, createTheme } from '@mui/material/styles';
1
+ import { styled as muiStyled, createTheme } from '@mui/material/styles';
2
+
3
+ // Cast to any to bypass MUI 5.9 styled() overload mismatch with strict TS in consumers (fe-landing).
4
+ const styled: any = muiStyled;
2
5
 
3
6
  export const AccordionSummaryContent = styled('div')({
4
7
  display: 'flex',
@@ -0,0 +1,45 @@
1
+ import React, { useState } from 'react';
2
+ import { Resizable } from 're-resizable';
3
+ import { storiesOf } from '@storybook/react';
4
+ // Components
5
+ import MaterialDatePicker from './MaterialDatePicker';
6
+ import styles from './MaterialDatePicker.story.styl';
7
+
8
+ import {
9
+ _minDate,
10
+ handleMaxDate,
11
+ } from '../../../framework/utils/DateUtils';
12
+
13
+ const resizableProps = {
14
+ defaultSize: {
15
+ width: 360,
16
+ height: 700
17
+ }
18
+ };
19
+
20
+ const MaterialDatePickerWrapper = () => {
21
+ const [value, newValue] = useState('');
22
+
23
+ const onHandleChange = (value) => {
24
+ newValue(value);
25
+ };
26
+
27
+ return (
28
+ <Resizable {...resizableProps}>
29
+ <div className={styles.wrapper}>
30
+ <MaterialDatePicker
31
+ language='en'
32
+ maxDate={new Date(handleMaxDate())}
33
+ minDate={_minDate}
34
+ value={value}
35
+ error={true}
36
+ placeholder='Date of Birth DD/MM/YYYY*'
37
+ onChange={(value) => onHandleChange(value)}
38
+ />
39
+ </div>
40
+ </Resizable>
41
+ );
42
+ }
43
+
44
+ storiesOf('_Common_UI', module)
45
+ .add('MaterialDatePicker', () => <MaterialDatePickerWrapper />)
@@ -0,0 +1,6 @@
1
+ @import '../../../theme/theme.styl'
2
+
3
+ .wrapper
4
+ background-color: #fff;
5
+ box-sizing: border-box;
6
+ padding: 15px;
@@ -0,0 +1,87 @@
1
+ import React, { useState } from 'react';
2
+ import { Resizable } from 're-resizable';
3
+ import { storiesOf } from '@storybook/react';
4
+ import styles from './MaterialField.story.styl';
5
+ // Components
6
+ import MaterialField from './MaterialField';
7
+
8
+ const resizableProps = {
9
+ defaultSize: { width: 360, height: 700 }
10
+ };
11
+
12
+ const MaterialFieldWrapper = () => {
13
+ const [newData, setNewData] = useState({
14
+ firstName: '',
15
+ lastName: '123123',
16
+ email: '',
17
+ countryCode: '+49',
18
+ areaCode: '',
19
+ phoneNumber: ''
20
+ });
21
+
22
+ const onHandleChange = (value, name) => {
23
+ setNewData({ ...newData, [name]: value });
24
+ };
25
+
26
+ return (
27
+ <Resizable {...resizableProps}>
28
+ <div className={styles.wrapper}>
29
+ <MaterialField
30
+ onChange={value => onHandleChange(value, 'firstName')}
31
+ label='Vorname'
32
+ value={newData.firstName}
33
+ className={styles.firstName}
34
+ error={newData.firstName === '' ? true : false}
35
+ helperText={newData.firstName === '' ? '* Bitte geben Sie eine gültige Straße an' : ''}
36
+ required
37
+ />
38
+ <MaterialField
39
+ onChange={value => onHandleChange(value, 'lastName')}
40
+ label='Nachname'
41
+ value={newData.lastName}
42
+ className={styles.lastName}
43
+ error={newData.lastName === '' ? true : false}
44
+ helperText={newData.lastName === '' ? '* Bitte geben Sie eine gültige Straße an' : ''}
45
+ />
46
+ <MaterialField
47
+ onChange={value => onHandleChange(value, 'email')}
48
+ label='E-Mail Adresse'
49
+ value={newData.email}
50
+ className={styles.email}
51
+ error={newData.email === '' ? true : false}
52
+ helperText={newData.email === '' ? '* Bitte geben Sie eine gültige Straße an' : ''}
53
+ />
54
+ <MaterialField
55
+ onChange={value => onHandleChange(value, 'countryCode')}
56
+ label='Land'
57
+ value={newData.countryCode}
58
+ className={styles.countryCode}
59
+ error={newData.countryCode === '' ? true : false}
60
+ helperText={newData.countryCode === '' ? '* Bitte geben Sie eine gültige Straße an' : ''}
61
+ />
62
+
63
+ <MaterialField
64
+ onChange={value => onHandleChange(value, 'areaCode')}
65
+ label='Vorwahl'
66
+ value={newData.areaCode}
67
+ className={styles.areaCode}
68
+ classNameInputLabel={styles.areaCodeInputLabel}
69
+ error={newData.areaCode === '' ? true : false}
70
+ helperText={newData.areaCode === '' ? '* Bitte geben Sie eine gültige Straße an' : ''}
71
+ />
72
+
73
+ <MaterialField
74
+ onChange={value => onHandleChange(value, 'phoneNumber')}
75
+ label='Telefonnummer'
76
+ value={newData.phoneNumber}
77
+ className={styles.phoneNumber}
78
+ error={newData.phoneNumber === '' ? true : false}
79
+ helperText={newData.phoneNumber === '' ? '* Bitte geben Sie eine gültige Straße an' : ''}
80
+ />
81
+ </div>
82
+ </Resizable>
83
+ );
84
+ }
85
+
86
+ storiesOf('_Common_UI', module)
87
+ .add('MaterialField', () => <MaterialFieldWrapper />)
@@ -0,0 +1,34 @@
1
+ @import '../../../theme/theme.styl'
2
+
3
+ .wrapper
4
+ background-color: #fff;
5
+ box-sizing: border-box;
6
+ padding: 16px
7
+ display: grid;
8
+ grid-gap: 24px 16px
9
+ grid-template-columns: repeat(4, 1fr);
10
+ grid-template-areas:
11
+ 'firstName firstName lastName lastName'\
12
+ 'email email email email'\
13
+ 'countryCode areaCode phoneNumber phoneNumber'
14
+
15
+ .firstName
16
+ grid-area: firstName;
17
+
18
+ .lastName
19
+ grid-area: lastName;
20
+
21
+ .email
22
+ grid-area: email;
23
+
24
+ .countryCode
25
+ grid-area: countryCode;
26
+
27
+ .areaCode
28
+ grid-area: areaCode;
29
+
30
+ .phoneNumber
31
+ grid-area: phoneNumber;
32
+
33
+ .areaCodeInputLabel
34
+ font-size: 13px !important;
@@ -0,0 +1,52 @@
1
+ import React, { useState } from 'react';
2
+ import { Resizable } from 're-resizable';
3
+ import { storiesOf } from '@storybook/react';
4
+ import { MenuItem } from '@mui/material';
5
+ // Components
6
+ import MaterialSelect from './MaterialSelect';
7
+ import styles from './MaterialSelect.story.styl';
8
+
9
+ const resizableProps = {
10
+ defaultSize: { width: 360, height: 700 }
11
+ };
12
+
13
+ // const inputFields = [{
14
+ // 'Vorname',
15
+ // 'Nachname'
16
+ // }]
17
+
18
+ const MaterialFieldWrapper = () => {
19
+ const [newData, setNewData] = useState({
20
+ firstName: '',
21
+ lastName: '',
22
+ email: '',
23
+ countryCode: '+49',
24
+ areaCode: '',
25
+ phoneNumber: ''
26
+ });
27
+
28
+ const onHandleChange = (event, type) => {
29
+ setNewData({ ...newData, [type]: event.target.value });
30
+ };
31
+
32
+ return (
33
+ <Resizable {...resizableProps}>
34
+ <div className={styles.wrapper}>
35
+ <MaterialSelect
36
+ onHandleChange={e => onHandleChange(e, 'firstName')}
37
+ label='age'
38
+ value={newData.firstName}
39
+ error={true}
40
+ helperText={`We'll never share your email.`}
41
+ >
42
+ <MenuItem value={1}>Ten</MenuItem>
43
+ <MenuItem value={2}>Twenty</MenuItem>
44
+ <MenuItem value={3}>Thirty</MenuItem>
45
+ </MaterialSelect>
46
+ </div>
47
+ </Resizable>
48
+ );
49
+ }
50
+
51
+ storiesOf('_Common_UI', module)
52
+ .add('MaterialSelect', () => <MaterialFieldWrapper />)
@@ -0,0 +1,6 @@
1
+ @import '../../../theme/theme.styl'
2
+
3
+ .wrapper
4
+ background-color: #fff;
5
+ box-sizing: border-box;
6
+ padding: 16px
@@ -0,0 +1,47 @@
1
+ import React, { useState } from 'react';
2
+ import { Resizable } from 're-resizable';
3
+ import { storiesOf } from '@storybook/react';
4
+ // Components
5
+ import MaterialStepButton from './MaterialStepButton';
6
+ import styles from './MaterialStepButton.story.styl';
7
+
8
+ import {
9
+ _minDate,
10
+ handleMaxDate,
11
+ checkingWhenLess18Age,
12
+ createDateAsUTC
13
+ } from '../../../framework/utils/DateUtils';
14
+
15
+ const resizableProps = {
16
+ defaultSize: {
17
+ width: 360,
18
+ height: 700
19
+ }
20
+ };
21
+
22
+ const MaterialStepButtonWrapper = () => {
23
+ const [value, newValue] = useState('');
24
+
25
+ const onHandleChange = (value) => {
26
+ newValue(value);
27
+ };
28
+
29
+ return (
30
+ <Resizable {...resizableProps}>
31
+ <div className={styles.wrapper}>
32
+ <MaterialStepButton
33
+ language='en'
34
+ maxDate={new Date(handleMaxDate())}
35
+ minDate={_minDate}
36
+ value={value}
37
+ error={true}
38
+ placeholder='Date of Birth DD/MM/YYYY*'
39
+ onChange={(value) => onHandleChange(createDateAsUTC(value))}
40
+ />
41
+ </div>
42
+ </Resizable>
43
+ );
44
+ }
45
+
46
+ storiesOf('_Common_UI', module)
47
+ .add('MaterialStepButton', () => <MaterialStepButtonWrapper />)
@@ -0,0 +1,6 @@
1
+ @import '../../../theme/theme.styl'
2
+
3
+ .wrapper
4
+ background-color: #fff;
5
+ box-sizing: border-box;
6
+ padding: 15px;