@bytebrand/fe-ui-core 4.8.46 → 4.8.47

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 (187) hide show
  1. package/media/locales/de/promoSlider.json +0 -1
  2. package/media/locales/en/promoSlider.json +0 -1
  3. package/package.json +5 -3
  4. package/source/components/AccordionWidget/AccordionWidget.styl +0 -1
  5. package/source/components/AccordionWidget/AccordionWidget.tsx +4 -8
  6. package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.tsx +11 -23
  7. package/source/components/VehicleSmallCard/VehicleData/VechiclePriceItem/VechiclePriceItem.styl +0 -5
  8. package/source/components/VehicleSmallCard/VehicleData/VechiclePriceItem/VechiclePriceItem.tsx +1 -3
  9. package/source/components/VehicleSmallCard/VehicleData/VehicleInfo/VehicleInfo.styl +1 -1
  10. package/source/components/VehicleSmallCard/VehicleData/VehicleInfo/VehicleInfo.tsx +11 -24
  11. package/source/components/VehicleSmallCard/VehicleData/VehiclePrice/VehiclePrice.styl +2 -3
  12. package/source/components/VehicleSmallCard/VehicleData/VehicleProperty/VehicleProperty.styl +1 -4
  13. package/source/components/VehicleSmallCard/VehicleData/VehicleProperty/VehicleProperty.tsx +2 -3
  14. package/source/components/VehicleSmallCard/VehicleData/VehicleTitle/VehicleTitle.tsx +1 -1
  15. package/source/components/VehicleSmallCard/VehicleSmallCard.tsx +6 -15
  16. package/source/components/_common/MaterialAccordionGroup/MaterialAccordionGroup.styled.tsx +1 -4
  17. package/source/components/_common/withStats/withStats.styl +21 -0
  18. package/source/components/_common/withStats/withStats.tsx +21 -4
  19. package/source/framework/DataTransformers.ts +0 -1
  20. package/source/framework/constants/common.ts +4 -8
  21. package/source/framework/types/types.ts +0 -1
  22. package/source/framework/vehiclesProps/decoratedLightProps.tsx +12 -48
  23. package/source/framework/vehiclesProps/decoratedProps.tsx +8 -35
  24. package/source/locales/data.ts +5 -4
  25. package/.husky/pre-push +0 -4
  26. package/.storybook/addons.js +0 -4
  27. package/.storybook/config.js +0 -64
  28. package/.storybook/postcss.config.js +0 -6
  29. package/.storybook/preview-head.html +0 -10
  30. package/.storybook/webpack.config.js +0 -130
  31. package/__tests__/components/Checkout/OrderOverviewItem/OrderOverviewItem.test.tsx +0 -42
  32. package/__tests__/components/Checkout/PaymentTypeCard/PaymentTypeCard.test.tsx +0 -50
  33. package/__tests__/components/Checkout/RadioGroup.test.tsx +0 -95
  34. package/__tests__/components/Checkout/ServiceCardWrapper.test.tsx +0 -53
  35. package/__tests__/components/Checkout/Switcher.test.tsx +0 -43
  36. package/__tests__/components/UserDasboardPage/sections/CheckoutSection/CheckoutSection.test.tsx +0 -613
  37. package/__tests__/components/UserDasboardPage/sections/FavoriteSection/FavoriteSection.test.tsx +0 -335
  38. package/__tests__/components/UserDasboardPage/sections/OrderStatusSection/AdditionalOrderInfo.test.tsx +0 -127
  39. package/__tests__/components/UserDasboardPage/sections/OrderStatusSection/OrderStatusCar.test.tsx +0 -58
  40. package/__tests__/components/UserDasboardPage/sections/OrderStatusSection/OrderStatusCard.test.tsx +0 -74
  41. package/__tests__/components/UserDasboardPage/sections/OrderStatusSection/OrderStatusSection.test.tsx +0 -62
  42. package/__tests__/components/UserDasboardPage/sections/RequestedCarsSection/RequestedCarsSection.test.tsx +0 -117
  43. package/__tests__/components/Vehicle/VehicleFormattedPrice/VehicleFormattedPrice.test.tsx +0 -58
  44. package/__tests__/components/VehicleSmallCard/VehicleInfo.test.tsx +0 -88
  45. package/__tests__/components/VehicleSmallCard/VehicleTitle.test.tsx +0 -91
  46. package/__tests__/components/_common/Badge/Badge.test.tsx +0 -15
  47. package/__tests__/components/_common/IconSVG/IconSVG.test.tsx +0 -23
  48. package/__tests__/components/_common/Image/Image.test.tsx +0 -82
  49. package/__tests__/components/_common/MaterialAutocomplete/MaterialAutocomplete.test.tsx +0 -49
  50. package/__tests__/components/_common/MaterialDatePicker/MaterialDatePicker.test.tsx +0 -54
  51. package/__tests__/components/_common/MaterialField/MaterialField.test.tsx +0 -58
  52. package/__tests__/components/_common/StarButton/StarButton.test.tsx +0 -46
  53. package/__tests__/mockedData/financingConfig.js +0 -202
  54. package/__tests__/mockedData/mockedPendingRequestedCar.js +0 -69
  55. package/__tests__/utils/CommonUtils/addPrefixToKeys.test.ts +0 -18
  56. package/__tests__/utils/CommonUtils/arrToObj.test.js +0 -32
  57. package/__tests__/utils/CommonUtils/checkRangeValuesOnEqual.test.ts +0 -17
  58. package/__tests__/utils/CommonUtils/fixNumber.test.ts +0 -20
  59. package/__tests__/utils/CommonUtils/formatMileage.test.ts +0 -8
  60. package/__tests__/utils/CommonUtils/getChipFilterValue.test.ts +0 -22
  61. package/__tests__/utils/CommonUtils/getFormattedNumber.test.ts +0 -19
  62. package/__tests__/utils/CommonUtils/getFormattedPrice.test.ts +0 -19
  63. package/__tests__/utils/CommonUtils/getGroupValuesForQuery.test.ts +0 -51
  64. package/__tests__/utils/CommonUtils/getOfferSliders.test.ts +0 -64
  65. package/__tests__/utils/CommonUtils/getPriceRating.test.ts +0 -26
  66. package/__tests__/utils/CommonUtils/getPriceRatingConfig.test.ts +0 -33
  67. package/__tests__/utils/CommonUtils/preloadNearbyImages.test.ts +0 -9
  68. package/__tests__/utils/CommonUtils/sliceLessThan.test.ts +0 -23
  69. package/__tests__/utils/CommonUtils/sliceMoreThan.test.ts +0 -23
  70. package/source/components/AdvantageItem/AdvantageItem.story.js +0 -23
  71. package/source/components/Alternative/Dealer.story.js +0 -32
  72. package/source/components/Alternative/Dealer.story.styl +0 -3
  73. package/source/components/Breadcrumbs/Breadcrumbs.story.js +0 -40
  74. package/source/components/Breadcrumbs/FirstInfoBlock/FirstInfoBlock.story.js +0 -45
  75. package/source/components/Checkout/OrderOverviewItem/OrderOverviewItem.story.js +0 -243
  76. package/source/components/Checkout/OrderOverviewItem/OrderOverviewItem.story.styl +0 -21
  77. package/source/components/Checkout/RadioCards/RadioGroupCheckout.story.js +0 -105
  78. package/source/components/Checkout/RadioCards/RadioGroupCheckout.story.styl +0 -37
  79. package/source/components/Checkout/Switcher/Switcher.story.js +0 -41
  80. package/source/components/Checkout/Switcher/Switcher.story.styl +0 -2
  81. package/source/components/CompactSearchWidget/CompactSearchWidget.story.js +0 -187
  82. package/source/components/ContactForm/ContactForm.story.js +0 -94
  83. package/source/components/ContactForm/ContactForm.story.styl +0 -0
  84. package/source/components/ContactInfo/ContactInfo.story.js +0 -58
  85. package/source/components/CustomerQuote/CustomerQuote.story.js +0 -41
  86. package/source/components/CustomerQuotesSlider/CustomerQuotesSlider.story.js +0 -73
  87. package/source/components/CustomerQuotesSlider/CustomerQuotesSlider.story.styl +0 -5
  88. package/source/components/FormattedNumber/FormattedNumber.story.js +0 -114
  89. package/source/components/InfoBlocks/InfoBlockWrapper.story.js +0 -101
  90. package/source/components/InfoBlocks/InfoBlockWrapper.story.styl +0 -46
  91. package/source/components/OfferPanel/AboAccordion/AboFaq/AboFaq.story.js +0 -97
  92. package/source/components/OfferPanel/OfferPanel.story.js +0 -139
  93. package/source/components/OfferPanel/RangeGroup/RangeGroup.story.js +0 -35
  94. package/source/components/OfferPanel/RangeGroup/RangeGroup.story.styl +0 -3
  95. package/source/components/PriceRating/PriceRating.story.js +0 -39
  96. package/source/components/PriceRating/PriceRating.story.styl +0 -2
  97. package/source/components/PriceRatingDetailed/PriceRatingDetailed.story.js +0 -78
  98. package/source/components/PriceRatingDetailed/PriceRatingDetailed.story.styl +0 -11
  99. package/source/components/RateSearchValue/RateSearchValue.story.js +0 -78
  100. package/source/components/RateSearchValue/RateSearchValue.story.styl +0 -2
  101. package/source/components/RateSearchWidget/RateSearchWidget.story.js +0 -57
  102. package/source/components/RateSearchWidget/RateSearchWidget.story.styl +0 -12
  103. package/source/components/SearchFilters/FiltersFactory.story.js +0 -273
  104. package/source/components/SearchPage/Filters/MakeModel/MakeModel.story.js +0 -12
  105. package/source/components/SearchWidget/BasicDataWidget/BasicDataWidget.story.js +0 -834
  106. package/source/components/SearchWidget/BasicDataWidget/BasicDataWidget.story.styl +0 -40
  107. package/source/components/SearchWidget/SearchWidget.story.js +0 -191
  108. package/source/components/SearchWidget/SearchWidget.story.styl +0 -6
  109. package/source/components/Stepper/Stepper.story.js +0 -119
  110. package/source/components/Stepper/Stepper.story.styl +0 -41
  111. package/source/components/Theme.story.js +0 -36
  112. package/source/components/Theme.story.styl +0 -85
  113. package/source/components/TickerText/TickerText.story.js +0 -17
  114. package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusSection.story.js +0 -95
  115. package/source/components/UserDashboardPage/sections/RequestedCarsSection/RequestedCarsSection.story.js +0 -97
  116. package/source/components/Vehicle/VehicleConsumption/VehicleConsumption.story.js +0 -31
  117. package/source/components/Vehicle/VehicleFormattedPrice/VehicleFormattedPrice.story.js +0 -247
  118. package/source/components/VehicleCompared/CompareGeneral/CompareGeneral.story.js +0 -30
  119. package/source/components/VehicleCompared/ComparePrice/ComparePrice.story.js +0 -18
  120. package/source/components/VehicleCompared/CompareTitle/CompareTitle.story.js +0 -19
  121. package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.story.js +0 -44
  122. package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.story.js +0 -120
  123. package/source/components/VehiclePromoSlider/VehiclePromoInfo/VehiclePromoInfo.story.js +0 -42
  124. package/source/components/VehiclePromoSlider/VehiclePromoSlide/VehiclePromoSlide.story.js +0 -62
  125. package/source/components/VehiclePromoSlider/VehiclePromoSlider.story.js +0 -42
  126. package/source/components/VehicleSmallCard/VehicleSmallCard.story.js +0 -412
  127. package/source/components/VehicleSmallCard/VehicleSmallCard.story.styl +0 -56
  128. package/source/components/VehicleSmallCardForDealerships/VehicleSmallCardForDealerships.story.js +0 -199
  129. package/source/components/VehicleSmallCardForDealerships/VehicleSmallCardForDealerships.story.styl +0 -40
  130. package/source/components/_common/Accordion/Accordion.story.js +0 -36
  131. package/source/components/_common/Badge/Badge.story.js +0 -27
  132. package/source/components/_common/Badge/Badge.story.styl +0 -5
  133. package/source/components/_common/Bubble/Bubble.story.js +0 -52
  134. package/source/components/_common/Button/Button.story.js +0 -52
  135. package/source/components/_common/Button/Button.story.styl +0 -5
  136. package/source/components/_common/ButtonOld/Button.story.js +0 -54
  137. package/source/components/_common/ButtonOld/Button.story.styl +0 -5
  138. package/source/components/_common/Checkbox/Checkbox.story.js +0 -85
  139. package/source/components/_common/Checkbox/Checkbox.story.styl +0 -14
  140. package/source/components/_common/CheckboxMaterial/CheckboxMaterial.story.js +0 -126
  141. package/source/components/_common/CheckboxMaterial/CheckboxMaterial.story.styl +0 -14
  142. package/source/components/_common/Chip/Chip.story.js +0 -43
  143. package/source/components/_common/ChipList/ChipList.story.js +0 -36
  144. package/source/components/_common/DropDown/DropDown.story.js +0 -35
  145. package/source/components/_common/ExpandablePanel/ExpandablePanel.story.js +0 -41
  146. package/source/components/_common/Histogram/Histogram.story.js +0 -51
  147. package/source/components/_common/IconSVG/IconSVG.story.js +0 -21
  148. package/source/components/_common/IconSVG/IconSVG.story.styl +0 -25
  149. package/source/components/_common/Image/Image.story.js +0 -142
  150. package/source/components/_common/Image/Image.story.styl +0 -18
  151. package/source/components/_common/ImagesSet/ImagesSet.story.js +0 -34
  152. package/source/components/_common/ImagesSet/ImagesSet.story.styl +0 -4
  153. package/source/components/_common/Loader/Loader.story.js +0 -21
  154. package/source/components/_common/MaterialAccordionGroup/MaterialAccordionGroup.story.js +0 -49
  155. package/source/components/_common/MaterialDatePicker/MaterialDatePicker.story.js +0 -45
  156. package/source/components/_common/MaterialDatePicker/MaterialDatePicker.story.styl +0 -6
  157. package/source/components/_common/MaterialField/MaterialField.story.js +0 -87
  158. package/source/components/_common/MaterialField/MaterialField.story.styl +0 -34
  159. package/source/components/_common/MaterialSelect/MaterialSelect.story.js +0 -52
  160. package/source/components/_common/MaterialSelect/MaterialSelect.story.styl +0 -6
  161. package/source/components/_common/MaterialStepButton/MaterialStepButton.story.js +0 -47
  162. package/source/components/_common/MaterialStepButton/MaterialStepButton.story.styl +0 -6
  163. package/source/components/_common/MaterialSwitch/MaterialSwitch.story.js +0 -17
  164. package/source/components/_common/MaterialTooltip/MaterialTooltip.story.js +0 -10
  165. package/source/components/_common/Modal/Modal.story.js +0 -37
  166. package/source/components/_common/MuiGroupedSelect/MuiGroupedSelect.story.js +0 -21
  167. package/source/components/_common/PropertySelector/PSGroup.story.js +0 -93
  168. package/source/components/_common/PropertySelector/PSGroup.story.styl +0 -25
  169. package/source/components/_common/PropertySelector/ProperySelector.story.js +0 -83
  170. package/source/components/_common/Radio/FormRadioGroup.story.js +0 -28
  171. package/source/components/_common/Radio/FormRadioGroup.story.styl +0 -2
  172. package/source/components/_common/Radio/Radio.story.js +0 -54
  173. package/source/components/_common/Radio/RadioGroup.story.js +0 -90
  174. package/source/components/_common/Radio/RadioGroup.story.styl +0 -39
  175. package/source/components/_common/Range/Range.story.js +0 -46
  176. package/source/components/_common/Range/Range.story.styl +0 -5
  177. package/source/components/_common/SliderArrow/SliderArrow.story.js +0 -18
  178. package/source/components/_common/Tabs/Tabs.story.js +0 -56
  179. package/source/components/_common/TimePicker/TimePicker.story.js +0 -37
  180. package/source/components/_common/Tooltip/Tooltip.story.js +0 -28
  181. package/source/components/_common/UserMenu/MaterialMenu.story.js +0 -73
  182. package/source/components/_common/VehicleSlider/VehicleSlider.story.js +0 -99
  183. package/source/components/_common/VehicleSlider/VehicleSlider.story.styl +0 -0
  184. package/source/components/_common/withLabel/withLabel.story.js +0 -62
  185. package/source/components/_common/withPopover/withPopover.story.js +0 -48
  186. package/source/components/_common/withPopover/withPopover.story.styl +0 -54
  187. package/source/components/_common/withStats/withStats.story.js +0 -75
@@ -1,90 +0,0 @@
1
- import React from 'react';
2
- import { storiesOf } from '@storybook/react';
3
- import { action } from '@storybook/addon-actions';
4
-
5
- import Radio from './Radio';
6
- import RadioGroup from './RadioGroup';
7
-
8
- import styles from './RadioGroup.story.styl';
9
-
10
- export class RadioGroupDefault extends React.Component {
11
- state = {
12
- value: 'always'
13
- };
14
- action = action('change');
15
-
16
- onChange = (event, value) => {
17
- this.action(event, value);
18
- this.setState(() => ({ value }));
19
- };
20
-
21
- render() {
22
- return (
23
- <RadioGroup name='availability' containerClassName={styles.default} value={this.state.value} onChange={this.onChange}>
24
- <Radio label='Available always' value='always' />
25
- <Radio label='Available from' value='fromDate' />
26
- <Radio label='Unknown' value='unknown' disabled={true} />
27
- </RadioGroup>
28
- );
29
- }
30
- }
31
-
32
- export class RadioGroupVertical extends React.Component {
33
- state = {
34
- value: 'M_Sport'
35
- };
36
-
37
- action = action('change');
38
- onChange = (event, value) => {
39
- this.action(event, value);
40
- this.setState(() => ({ value }));
41
- };
42
-
43
- renderSubModel = (index) => {
44
- const models = ['320 | 2.0 | Automatic', '320 | 2.0 | Diesel', '320 | 2.0'];
45
-
46
- return (
47
- <div className={styles.equipment}>
48
- <div className={styles.column}>
49
- <span className={styles.value}>
50
- {models[index]}
51
- </span>
52
- </div>
53
- <div className={styles.column}>
54
- <span className={styles.title}>
55
- Power
56
- </span>
57
- <span className={styles.value}>
58
- 184 PS / 138 KW
59
- </span>
60
- </div>
61
- <div className={styles.column}>
62
- <span className={styles.title}>
63
- Built by
64
- </span>
65
- <span className={styles.value}>
66
- 7/2015 – 12/2018
67
- </span>
68
- </div>
69
- </div>
70
- );
71
- };
72
-
73
- render() {
74
- return (
75
- <RadioGroup name='sub_model' containerClassName={styles.vertical} childClassName={styles.verticalChild} value={this.state.value} onChange={this.onChange}>
76
- <Radio label={this.renderSubModel(0)} value='M_Sport' />
77
- <Radio label={this.renderSubModel(1)} value='M_Sport_Coupe' />
78
- <Radio label={this.renderSubModel(2)} value='M_Sport_Diesel' />
79
- </RadioGroup>
80
- );
81
- }
82
- }
83
-
84
- storiesOf('_Common_UI', module)
85
- .add('RadioGroup', () => (
86
- <div>
87
- <RadioGroupDefault />
88
- <RadioGroupVertical />
89
- </div>
90
- ));
@@ -1,39 +0,0 @@
1
- .default
2
- border: 1px solid lightgray
3
- padding: 10px
4
- border-radius: 5px
5
- margin-bottom: 20px
6
- display: flex
7
- flex-direction: row
8
- align-items: center
9
- justify-content: space-between
10
-
11
- .vertical
12
- composes: default
13
- display: flex
14
- flex-direction: column
15
- align-items: center
16
- padding: 10px
17
-
18
- .verticalChild:not(:last-of-type)
19
- margin-bottom: 10px
20
-
21
- .equipment
22
- display: flex
23
- flex-direction: row
24
- align-items: center
25
- justify-content: space-between
26
- min-width: 500px
27
-
28
- .column
29
- display: flex
30
- flex-direction: column
31
- align-items: stretch
32
- width: 150px
33
-
34
- .title
35
- font-size: 10px
36
-
37
- .value
38
- font-size: 14px
39
-
@@ -1,46 +0,0 @@
1
- import React, { useState } from 'react';
2
-
3
- import { storiesOf } from '@storybook/react';
4
- import { action } from '@storybook/addon-actions';
5
- import Range from './Range';
6
- import { Tooltip } from '@mui/material';
7
-
8
- import styles from './Range.story.styl';
9
-
10
- const RangeWrapper = () => {
11
- const [value, setValue] = useState(300);
12
-
13
- const onChange = (value) => {
14
- setValue(value);
15
- action('onChange');
16
- };
17
-
18
- const ValueLabelComponent = (props) => {
19
- const { children, value } = props;
20
-
21
- return (
22
- <Tooltip enterTouchDelay={0} placement='top' title={value}>
23
- {children}
24
- </Tooltip>
25
- );
26
- };
27
-
28
- const props = {
29
- value,
30
- components: {
31
- ValueLabel: ValueLabelComponent
32
- },
33
- onChange,
34
- min: 0,
35
- max: 10000,
36
- step: 100
37
- };
38
- return (
39
- <div className={styles.container}>
40
- <Range {...props} />
41
- </div>
42
- );
43
- };
44
-
45
- storiesOf('_Common_UI', module)
46
- .add('Range', () => <RangeWrapper />);
@@ -1,5 +0,0 @@
1
- .container
2
- width: 300px
3
- height: 100px
4
- background-color #fff;
5
- padding: 15px;
@@ -1,18 +0,0 @@
1
- import React from 'react';
2
-
3
- import { storiesOf } from '@storybook/react';
4
- import { action } from '@storybook/addon-actions';
5
- import SliderArrow from './SliderArrow';
6
-
7
-
8
- const props = {
9
- direction: 'left',
10
- onClick: action('slider arrow clicked')
11
- };
12
-
13
- storiesOf('_Common_UI', module)
14
- .add('SliderArrow', () => (
15
- <div>
16
- <SliderArrow {...props} />
17
- </div>
18
- ));
@@ -1,56 +0,0 @@
1
- import React, { useState } from 'react';
2
- import { Resizable } from 're-resizable';
3
- import { storiesOf } from '@storybook/react';
4
- import { action } from '@storybook/addon-actions';
5
- import TabsComponent from './Tabs.tsx';
6
-
7
-
8
- const wrapperProps = {
9
- border: '1px solid rgba(0,0,0,0.1)',
10
- borderRadius: '2px',
11
- backgroundColor: '#fff'
12
- };
13
-
14
- const resizableProps = {
15
- defaultSize: { width: 'auto', height: 'auto' }
16
- };
17
-
18
- const TabsStory = () => {
19
- const [priceTabActiveIndex, setNewIndex] = useState(0);
20
-
21
- const onTabPriceSelect = (event, priceTabActiveIndex) => {
22
- setNewIndex(priceTabActiveIndex);
23
- };
24
-
25
- const tabsProps = {
26
- priceTabActiveIndex,
27
- onTabPriceSelect,
28
- tabsTitles: [{
29
- title: 'financing',
30
- children: <span>financing</span>
31
- }, {
32
- title: 'leasing',
33
- children: <span>leasing</span>
34
- }, {
35
- title: 'buy',
36
- children: <span>buy</span>
37
- }, {
38
- title: 'abo',
39
- isDisable: true,
40
- children: <span>abo</span>
41
- }],
42
- };
43
-
44
- return (
45
- <>
46
- <p>Tabs on CDP</p>
47
- <div style={wrapperProps}>
48
- <Resizable {...resizableProps}>
49
- <TabsComponent {...tabsProps} />
50
- </Resizable>
51
- </div>
52
- </>
53
- );
54
- };
55
-
56
- storiesOf('_Common_UI', module).add('Tabs', () => <TabsStory />);
@@ -1,37 +0,0 @@
1
- import React, { useState } from 'react';
2
-
3
- import { storiesOf } from '@storybook/react';
4
- import TimePicker from './TimePicker';
5
-
6
- const TimePickerStory = () => {
7
- const [time, setTime] = useState(0);
8
- const [day, setDay] = useState(0);
9
- const [timestamp, setTimestamp] = useState('');
10
-
11
- const onHandleTimeChange = (value) => {
12
- setTime(value)
13
- };
14
- const onHandleDayChange = (value) => {
15
- setDay(value)
16
- };
17
- const onHandleTimestampChange = (value) => {
18
- setTimestamp(new Date(value))
19
- };
20
- return (
21
- <TimePicker
22
- style={{ background: '#fff', display: 'flex', justifyContent: 'space-between', width: '800px' }}
23
- time={time}
24
- day={day}
25
- onHandleTimeChange={onHandleTimeChange}
26
- onHandleDayChange={onHandleDayChange}
27
- onHandleTimestampChange={onHandleTimestampChange}
28
- lang='de'
29
- t={phrase => phrase}
30
- />
31
- )
32
- }
33
-
34
- storiesOf('_Common_UI', module)
35
- .add('TimePicker', () => (
36
- <div style={{ background: '#fff', width: '350px', height: '100%' }}><TimePickerStory /></div>
37
- ));
@@ -1,28 +0,0 @@
1
- import React from 'react';
2
-
3
- import { storiesOf } from '@storybook/react';
4
- import Tooltip from './Tooltip';
5
-
6
-
7
- const description = {
8
- financing: `Bei der Finanzierung zahlen Sie lediglich die Zinsen des Darlehens und einen geringen Tilgungsanteil. Zum Vertragsende können Sie entscheiden, ob Sie den Restbetrag ablösen oder weiter finanzieren wollen.`,
9
- leasing: `Beim Leasing zahlen Sie lediglich die Zinsen des Darlehens und einen geringen Tilgungsanteil. Zum Vertragsende geben Sie das Auto einfach wieder zurück.`,
10
- abo: `Bei diesem Auto-Abo ist bereits alles an Bord. Teil-und Vollkasko sowie Haftpflicht sind inklusive, ebenso wie Wartungs- und Verschleißreparaturen. Sie zahlen also nur Ihre Rate und Kraftstoff.`,
11
- kaufen: `Nach Kaufabschluss haben Sie die sofortigen Eigentumsrechte und keine Finanzierungskosten. Als Eigentümer können Sie Ihr Fahrzeug zueigenen Konditionen weiter verkaufen und Änderungen vornehmen.`,
12
- };
13
-
14
- storiesOf('_Common_UI', module).add('Tooltip', () => (
15
- <div>
16
- <Tooltip description={description.financing} />
17
- <br />
18
- <Tooltip description={description.leasing} positionX='left' />
19
- <br />
20
- <Tooltip description={description.abo} positionX='center' />
21
- <br />
22
- <Tooltip description={description.kaufen} positionY='top' positionX='right' />
23
- <br />
24
- <Tooltip description={description.kaufen} positionY='top' positionX='center' />
25
- <br />
26
- <Tooltip description={description.kaufen} positionY='top' positionX='left' />
27
- </div>
28
- ));
@@ -1,73 +0,0 @@
1
- import React from 'react';
2
-
3
- import { storiesOf } from '@storybook/react';
4
- import MaterialMenu from './MaterialMenu';
5
-
6
- const superAdmin = false;
7
-
8
- const userMenuItems = [
9
- {
10
- icon: 'dashboardIcon',
11
- label: 'Dashboard'
12
- },
13
- {
14
- icon: 'userProfileIcon',
15
- label: 'Profile'
16
- },
17
- {
18
- icon: 'addressIcon',
19
- label: 'Address'
20
- },
21
- {
22
- icon: 'myVehiclesIcon',
23
- label: 'My Vehicles'
24
- },
25
- {
26
- icon: 'savedSearchsIcon',
27
- label: 'Saved searchs'
28
- },
29
- {
30
- icon: 'favoritesIcon',
31
- label: 'Favorites',
32
- amount: 0
33
- },
34
- !superAdmin && {
35
- icon: 'dealersIcon',
36
- label: 'Dealers',
37
- amount: 1234,
38
- divider: true,
39
- nestedItems: [
40
- {
41
- icon: 'supportCallbackIcon',
42
- label: 'Support & Call back',
43
- divider: true,
44
- },
45
- {
46
- icon: 'supportCallbackIcon',
47
- label: 'Support & Call back',
48
- divider: true,
49
- },
50
- {
51
- icon: 'supportCallbackIcon',
52
- label: 'Support & Call back',
53
- divider: true,
54
- }
55
- ]
56
- },
57
- {
58
- icon: 'imageSettingsIcon',
59
- label: 'Image Settings'
60
- },
61
- !superAdmin && {
62
- icon: 'supportCallbackIcon',
63
- label: 'Support & Call back',
64
- divider: true
65
- },
66
- {
67
- icon: 'logoutIcon',
68
- label: 'Logout'
69
- },
70
-
71
- ];
72
-
73
- storiesOf('_Common_UI', module).add('UserMenu', () => <MaterialMenu menuItems={userMenuItems} headerComponent='Firstname Lastname' />);
@@ -1,99 +0,0 @@
1
- import React from 'react';
2
- import styles from './VehicleSlider.story.styl'
3
- import { storiesOf } from '@storybook/react';
4
-
5
- import VehicleSlider from './VehicleSlider.tsx';
6
- import VehicleSliderForSRL from './VehicleSliderForSRL.tsx';
7
-
8
- import withStats from '../withStats/withStats.tsx';
9
- import withLabel from '../withLabel/withLabel.tsx';
10
-
11
- import { COLUMN_STYLES, CONTAINER_STYLES, ROW_STYLES } from '../../../framework/constants';
12
-
13
- const IMAGE_URL = 'https://picsum.photos/400/300/?random';
14
- const images = [];
15
- const imagesForSRL = [];
16
-
17
- for (let i = 0; i <= 10; i++) {
18
- images.push({ url: `${IMAGE_URL}&tag=${Math.random()}`, description: '' });
19
- }
20
-
21
- for (let i = 0; i <= 10; i++) {
22
- imagesForSRL.push({ imageUrlSmall: `${IMAGE_URL}&tag=${Math.random()}` });
23
- }
24
-
25
- const DecoratedSlider = withLabel(withStats(VehicleSlider));
26
- const DecoratedSliderForSRL = withLabel(withStats(VehicleSliderForSRL));
27
-
28
- export class ImageWithStatsContainer extends React.Component {
29
- state = {
30
- isFavoured: false
31
- };
32
-
33
- onFavoriteClick = () => {
34
- this.setState({ isFavoured: !this.state.isFavoured })
35
- };
36
-
37
- render() {
38
- const statsProps = {
39
- isFavoured: this.state.isFavoured,
40
- imagesCount: images.length,
41
- statsData: {
42
- totalCarImpCount: 15,
43
- totalFavCount: 20
44
- },
45
- statsSize: 'xs',
46
- onFavoriteClick: this.onFavoriteClick,
47
- };
48
-
49
- const sliderProps = {
50
- images,
51
- wrapperClassName: styles.slider
52
- };
53
-
54
- const sliderSRLProps = {
55
- images: imagesForSRL,
56
- wrapperClassName: styles.slider
57
- };
58
-
59
- return (
60
- <div style={CONTAINER_STYLES}>
61
- <div style={COLUMN_STYLES}>
62
- <div style={ROW_STYLES}>
63
- <div className={styles.row}>
64
- <div className={styles.col}>
65
- <h2 className={styles.title}>{'Slider props: { isLarge: true }'}</h2>
66
- <div className={styles.row}>
67
- <div className={styles.col} style={{ width: '300px', maxWidth: '100%', margin: '0 auto' }}>
68
- <VehicleSlider images={images} wrapperClassName={styles.slider} size='lg' />
69
- </div>
70
- </div>
71
- </div>
72
- <div className={styles.col}>
73
- <h2 className={styles.title}>Slider with Stats</h2>
74
- <div className={styles.row}>
75
- <div className={styles.col} style={{ width: '300px', maxWidth: '100%', margin: '0 auto' }}>
76
- <DecoratedSlider {...statsProps} {...sliderProps} />
77
- </div>
78
- </div>
79
- </div>
80
- <div className={styles.col}>
81
- <h2 className={styles.title}>Slider with Stats for SRL</h2>
82
- <div className={styles.row}>
83
- <div className={styles.col} style={{ width: '300px', maxWidth: '100%', margin: '0 auto' }}>
84
- <DecoratedSliderForSRL {...statsProps} {...sliderSRLProps} />
85
- </div>
86
- </div>
87
- </div>
88
- </div>
89
- </div>
90
- </div>
91
- </div>
92
- );
93
- }
94
- }
95
-
96
- storiesOf('_Common_UI', module)
97
- .add('VehicleSlider', () => (
98
- <ImageWithStatsContainer />
99
- ));
@@ -1,62 +0,0 @@
1
- import React from 'react';
2
- import styles from '../Image/Image.story.styl'
3
- import { storiesOf } from '@storybook/react';
4
-
5
- import Image from '../Image/Image.tsx';
6
- import withLabel from './withLabel.tsx'
7
- import withStats from '../withStats/withStats.tsx'
8
- import { COLUMN_STYLES, CONTAINER_STYLES, ROW_STYLES } from '../../../framework/constants';
9
-
10
- const SRC_HORIZONTAL = 'https://placekitten.com/400/300';
11
-
12
- const ImageWithLabel = withLabel(Image);
13
- const DecoratedImage = withLabel(withStats(Image));
14
-
15
- export class ImageWithLabelContainer extends React.Component {
16
- state = {
17
- isFavoured: false
18
- };
19
-
20
- onFavoriteClick = () => {
21
- this.setState({ isFavoured: !this.state.isFavoured })
22
- };
23
-
24
- render() {
25
- const statsProps = {
26
- isFavoured: this.state.isFavoured,
27
- imagesCount: 10,
28
- statsData: {
29
- totalCarImpCount: 15,
30
- totalFavCount: 20
31
- },
32
- statsSize: 'xs',
33
- onFavoriteClick: this.onFavoriteClick
34
- };
35
-
36
- return (
37
- <div className={styles.row}>
38
- <div className={styles.col}>
39
- <h2 className={styles.title}>XS Size</h2>
40
- <div className={styles.row}>
41
- <div className={styles.col} style={{ width: '300px', maxWidth: '100%', margin: '0 auto' }}>
42
- <ImageWithLabel labelVisible={true} src={SRC_HORIZONTAL} width='100%' ratioW={4} ratioH={3} />
43
- </div>
44
- </div>
45
- </div>
46
- <div className={styles.col}>
47
- <h2 className={styles.title}>MD Size</h2>
48
- <div className={styles.row}>
49
- <div className={styles.col} style={{ width: '300px', maxWidth: '100%', margin: '0 auto' }}>
50
- <DecoratedImage src={SRC_HORIZONTAL} width='100%' ratioW={4} ratioH={3} {...statsProps} />
51
- </div>
52
- </div>
53
- </div>
54
- </div>
55
- );
56
- }
57
- }
58
-
59
- storiesOf('_Common_UI', module)
60
- .add('withLabel', () => (
61
- <ImageWithLabelContainer />
62
- ));
@@ -1,48 +0,0 @@
1
- import React from 'react';
2
- import classnames from 'classnames';
3
- import { storiesOf } from '@storybook/react';
4
- import withPopover from './withPopover';
5
- import styles from './withPopover.story.styl'
6
-
7
- const Target = ({ isPopoverShown, text }) => {
8
- const className = classnames(styles.target, { [styles.targetOpen]: isPopoverShown });
9
- return <div className={className}>{text}</div>;
10
- };
11
-
12
- const Popover = ({ isPopoverShown, text }) => {
13
- const className = classnames(styles.popover, { [styles.popoverOpen]: isPopoverShown });
14
- return <div className={className}>{text}</div>;
15
- };
16
-
17
- const TargetWithPopover = withPopover(Target, Popover);
18
-
19
- export class WithPopoverContainer extends React.Component {
20
- state = {
21
- type: 'click'
22
- };
23
-
24
- onCheckboxChange = () => {
25
- this.setState({ type: this.state.type === 'click' ? 'hover' : 'click' });
26
- };
27
-
28
- render() {
29
- const targetWithPopoverProps = {
30
- targetProps: { text: 'Target' },
31
- popoverProps: { text: 'Popover' },
32
- type: this.state.type
33
- };
34
-
35
- return (
36
- <React.Fragment>
37
- <label className={styles.label}>
38
- <input type='checkbox' value={this.state.showOnHover} onChange={this.onCheckboxChange} />
39
- <span>Open on hover</span>
40
- </label>
41
- <TargetWithPopover {...targetWithPopoverProps} />
42
- </React.Fragment>
43
- );
44
- }
45
- }
46
-
47
- storiesOf('_Common_UI', module)
48
- .add('withPopover', () => <WithPopoverContainer />);
@@ -1,54 +0,0 @@
1
- @import '../../../theme/theme.styl'
2
-
3
- .label
4
- display: block
5
- font-family: $font-style-arial
6
- margin-bottom: 20px
7
-
8
- .target
9
- position: relative
10
- font-family: $font-style-arial
11
- width: 150px
12
- height: 30px
13
- line-height: 30px
14
- text-align: center
15
- border 1px solid $grey-b
16
- border-radius: 3px
17
- transition: all 0.2s ease-in-out
18
- cursor: pointer
19
- &:hover
20
- background-color: $grey-f2
21
-
22
- .targetOpen
23
- color: $primary
24
- font-weight: bold
25
- border-color: $primary
26
- &:after
27
- content: ''
28
- position: absolute
29
- display: block
30
- width: 100%
31
- height: 15px
32
-
33
- .popover
34
- position: relative
35
- box-sizing: border-box
36
- color: white
37
- font-size: 25px
38
- font-weight: bold
39
- border 3px solid $yellow-f1
40
- position: absolute
41
- top: 45px
42
- width: 250px
43
- height: 100px
44
- line-height: 100px
45
- text-align: center
46
- border-radius: 3px
47
- background-color: $grassGreen
48
- visibility: hidden
49
- opacity: 0
50
- transition: all 0.2s ease-in-out
51
-
52
- .popoverOpen
53
- visibility: visible
54
- opacity: 1