@bytebrand/fe-ui-core 4.8.56 → 4.8.57

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/media/locales/de/promoSlider.json +0 -1
  2. package/media/locales/en/promoSlider.json +0 -1
  3. package/package.json +120 -117
  4. package/source/components/AccordionWidget/AccordionWidget.styl +0 -1
  5. package/source/components/AccordionWidget/AccordionWidget.tsx +4 -8
  6. package/source/components/OfferPanel/OfferCheckboxGroup/CheckboxContainer.tsx +2 -2
  7. package/source/components/OfferPanel/OfferCheckboxGroup/OfferCheckboxGroup.styl +0 -24
  8. package/source/components/OfferPanel/OfferCheckboxGroup/OfferCheckboxGroup.tsx +2 -1
  9. package/source/components/OfferPanel/OfferPanel.tsx +1 -1
  10. package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.tsx +11 -23
  11. package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.tsx +6 -2
  12. package/source/components/VehicleDetailedSlider/partials/PriceData.tsx +9 -8
  13. package/source/components/VehicleSmallCard/VehicleData/VechiclePriceItem/VechiclePriceItem.styl +0 -5
  14. package/source/components/VehicleSmallCard/VehicleData/VechiclePriceItem/VechiclePriceItem.tsx +1 -3
  15. package/source/components/VehicleSmallCard/VehicleData/VehicleInfo/VehicleInfo.styl +1 -1
  16. package/source/components/VehicleSmallCard/VehicleData/VehicleInfo/VehicleInfo.tsx +11 -24
  17. package/source/components/VehicleSmallCard/VehicleData/VehiclePrice/VehiclePrice.styl +2 -3
  18. package/source/components/VehicleSmallCard/VehicleData/VehicleProperty/VehicleProperty.styl +1 -4
  19. package/source/components/VehicleSmallCard/VehicleData/VehicleProperty/VehicleProperty.tsx +2 -3
  20. package/source/components/VehicleSmallCard/VehicleData/VehicleTitle/VehicleTitle.tsx +1 -1
  21. package/source/components/VehicleSmallCard/VehicleSmallCard.tsx +3 -14
  22. package/source/components/_common/MaterialAccordionGroup/MaterialAccordionGroup.styled.tsx +1 -4
  23. package/source/components/_common/MaterialTooltip/MaterialTooltip.tsx +3 -4
  24. package/source/components/_common/withStats/withStats.styl +0 -10
  25. package/source/components/_common/withStats/withStats.tsx +11 -2
  26. package/source/framework/DataTransformers.ts +0 -1
  27. package/source/framework/constants/common.ts +4 -8
  28. package/source/framework/types/types.ts +0 -1
  29. package/source/framework/vehiclesProps/decoratedLightProps.tsx +12 -48
  30. package/source/framework/vehiclesProps/decoratedProps.tsx +8 -35
  31. package/source/locales/data.ts +0 -3
  32. package/.husky/pre-push +0 -4
  33. package/.storybook/addons.js +0 -4
  34. package/.storybook/config.js +0 -64
  35. package/.storybook/postcss.config.js +0 -6
  36. package/.storybook/preview-head.html +0 -10
  37. package/.storybook/webpack.config.js +0 -130
  38. package/__tests__/components/Checkout/OrderOverviewItem/OrderOverviewItem.test.tsx +0 -42
  39. package/__tests__/components/Checkout/PaymentTypeCard/PaymentTypeCard.test.tsx +0 -50
  40. package/__tests__/components/Checkout/RadioGroup.test.tsx +0 -95
  41. package/__tests__/components/Checkout/ServiceCardWrapper.test.tsx +0 -53
  42. package/__tests__/components/Checkout/Switcher.test.tsx +0 -43
  43. package/__tests__/components/UserDasboardPage/sections/CheckoutSection/CheckoutSection.test.tsx +0 -613
  44. package/__tests__/components/UserDasboardPage/sections/FavoriteSection/FavoriteSection.test.tsx +0 -335
  45. package/__tests__/components/UserDasboardPage/sections/OrderStatusSection/AdditionalOrderInfo.test.tsx +0 -127
  46. package/__tests__/components/UserDasboardPage/sections/OrderStatusSection/OrderStatusCar.test.tsx +0 -58
  47. package/__tests__/components/UserDasboardPage/sections/OrderStatusSection/OrderStatusCard.test.tsx +0 -74
  48. package/__tests__/components/UserDasboardPage/sections/OrderStatusSection/OrderStatusSection.test.tsx +0 -62
  49. package/__tests__/components/UserDasboardPage/sections/RequestedCarsSection/RequestedCarsSection.test.tsx +0 -117
  50. package/__tests__/components/Vehicle/VehicleFormattedPrice/VehicleFormattedPrice.test.tsx +0 -58
  51. package/__tests__/components/VehicleSmallCard/VehicleInfo.test.tsx +0 -88
  52. package/__tests__/components/VehicleSmallCard/VehicleTitle.test.tsx +0 -91
  53. package/__tests__/components/_common/Badge/Badge.test.tsx +0 -15
  54. package/__tests__/components/_common/IconSVG/IconSVG.test.tsx +0 -23
  55. package/__tests__/components/_common/Image/Image.test.tsx +0 -82
  56. package/__tests__/components/_common/MaterialAutocomplete/MaterialAutocomplete.test.tsx +0 -49
  57. package/__tests__/components/_common/MaterialDatePicker/MaterialDatePicker.test.tsx +0 -54
  58. package/__tests__/components/_common/MaterialField/MaterialField.test.tsx +0 -58
  59. package/__tests__/components/_common/StarButton/StarButton.test.tsx +0 -46
  60. package/__tests__/mockedData/financingConfig.js +0 -202
  61. package/__tests__/mockedData/mockedPendingRequestedCar.js +0 -69
  62. package/__tests__/utils/CommonUtils/addPrefixToKeys.test.ts +0 -18
  63. package/__tests__/utils/CommonUtils/arrToObj.test.js +0 -32
  64. package/__tests__/utils/CommonUtils/checkRangeValuesOnEqual.test.ts +0 -17
  65. package/__tests__/utils/CommonUtils/fixNumber.test.ts +0 -20
  66. package/__tests__/utils/CommonUtils/formatMileage.test.ts +0 -8
  67. package/__tests__/utils/CommonUtils/getChipFilterValue.test.ts +0 -22
  68. package/__tests__/utils/CommonUtils/getFormattedNumber.test.ts +0 -19
  69. package/__tests__/utils/CommonUtils/getFormattedPrice.test.ts +0 -19
  70. package/__tests__/utils/CommonUtils/getGroupValuesForQuery.test.ts +0 -51
  71. package/__tests__/utils/CommonUtils/getOfferSliders.test.ts +0 -64
  72. package/__tests__/utils/CommonUtils/getPriceRating.test.ts +0 -26
  73. package/__tests__/utils/CommonUtils/getPriceRatingConfig.test.ts +0 -33
  74. package/__tests__/utils/CommonUtils/preloadNearbyImages.test.ts +0 -9
  75. package/__tests__/utils/CommonUtils/sliceLessThan.test.ts +0 -23
  76. package/__tests__/utils/CommonUtils/sliceMoreThan.test.ts +0 -23
  77. package/source/components/AdvantageItem/AdvantageItem.story.js +0 -23
  78. package/source/components/Alternative/Dealer.story.js +0 -32
  79. package/source/components/Alternative/Dealer.story.styl +0 -3
  80. package/source/components/Breadcrumbs/Breadcrumbs.story.js +0 -40
  81. package/source/components/Breadcrumbs/FirstInfoBlock/FirstInfoBlock.story.js +0 -45
  82. package/source/components/Checkout/OrderOverviewItem/OrderOverviewItem.story.js +0 -243
  83. package/source/components/Checkout/OrderOverviewItem/OrderOverviewItem.story.styl +0 -21
  84. package/source/components/Checkout/RadioCards/RadioGroupCheckout.story.js +0 -105
  85. package/source/components/Checkout/RadioCards/RadioGroupCheckout.story.styl +0 -37
  86. package/source/components/Checkout/Switcher/Switcher.story.js +0 -41
  87. package/source/components/Checkout/Switcher/Switcher.story.styl +0 -2
  88. package/source/components/CompactSearchWidget/CompactSearchWidget.story.js +0 -187
  89. package/source/components/ContactForm/ContactForm.story.js +0 -94
  90. package/source/components/ContactForm/ContactForm.story.styl +0 -0
  91. package/source/components/ContactInfo/ContactInfo.story.js +0 -58
  92. package/source/components/CustomerQuote/CustomerQuote.story.js +0 -41
  93. package/source/components/CustomerQuotesSlider/CustomerQuotesSlider.story.js +0 -73
  94. package/source/components/CustomerQuotesSlider/CustomerQuotesSlider.story.styl +0 -5
  95. package/source/components/FormattedNumber/FormattedNumber.story.js +0 -114
  96. package/source/components/InfoBlocks/InfoBlockWrapper.story.js +0 -101
  97. package/source/components/InfoBlocks/InfoBlockWrapper.story.styl +0 -46
  98. package/source/components/OfferPanel/AboAccordion/AboFaq/AboFaq.story.js +0 -97
  99. package/source/components/OfferPanel/OfferPanel.story.js +0 -139
  100. package/source/components/OfferPanel/RangeGroup/RangeGroup.story.js +0 -35
  101. package/source/components/OfferPanel/RangeGroup/RangeGroup.story.styl +0 -3
  102. package/source/components/PriceRating/PriceRating.story.js +0 -39
  103. package/source/components/PriceRating/PriceRating.story.styl +0 -2
  104. package/source/components/PriceRatingDetailed/PriceRatingDetailed.story.js +0 -78
  105. package/source/components/PriceRatingDetailed/PriceRatingDetailed.story.styl +0 -11
  106. package/source/components/RateSearchValue/RateSearchValue.story.js +0 -78
  107. package/source/components/RateSearchValue/RateSearchValue.story.styl +0 -2
  108. package/source/components/RateSearchWidget/RateSearchWidget.story.js +0 -57
  109. package/source/components/RateSearchWidget/RateSearchWidget.story.styl +0 -12
  110. package/source/components/SearchFilters/FiltersFactory.story.js +0 -273
  111. package/source/components/SearchPage/Filters/MakeModel/MakeModel.story.js +0 -12
  112. package/source/components/SearchWidget/BasicDataWidget/BasicDataWidget.story.js +0 -834
  113. package/source/components/SearchWidget/BasicDataWidget/BasicDataWidget.story.styl +0 -40
  114. package/source/components/SearchWidget/SearchWidget.story.js +0 -191
  115. package/source/components/SearchWidget/SearchWidget.story.styl +0 -6
  116. package/source/components/Stepper/Stepper.story.js +0 -119
  117. package/source/components/Stepper/Stepper.story.styl +0 -41
  118. package/source/components/Theme.story.js +0 -36
  119. package/source/components/Theme.story.styl +0 -85
  120. package/source/components/TickerText/TickerText.story.js +0 -17
  121. package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusSection.story.js +0 -95
  122. package/source/components/UserDashboardPage/sections/RequestedCarsSection/RequestedCarsSection.story.js +0 -97
  123. package/source/components/Vehicle/VehicleConsumption/VehicleConsumption.story.js +0 -31
  124. package/source/components/Vehicle/VehicleFormattedPrice/VehicleFormattedPrice.story.js +0 -247
  125. package/source/components/VehicleCompared/CompareGeneral/CompareGeneral.story.js +0 -30
  126. package/source/components/VehicleCompared/ComparePrice/ComparePrice.story.js +0 -18
  127. package/source/components/VehicleCompared/CompareTitle/CompareTitle.story.js +0 -19
  128. package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.story.js +0 -44
  129. package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.story.js +0 -120
  130. package/source/components/VehiclePromoSlider/VehiclePromoInfo/VehiclePromoInfo.story.js +0 -42
  131. package/source/components/VehiclePromoSlider/VehiclePromoSlide/VehiclePromoSlide.story.js +0 -62
  132. package/source/components/VehiclePromoSlider/VehiclePromoSlider.story.js +0 -42
  133. package/source/components/VehicleSmallCard/VehicleSmallCard.story.js +0 -412
  134. package/source/components/VehicleSmallCard/VehicleSmallCard.story.styl +0 -56
  135. package/source/components/VehicleSmallCardForDealerships/VehicleSmallCardForDealerships.story.js +0 -199
  136. package/source/components/VehicleSmallCardForDealerships/VehicleSmallCardForDealerships.story.styl +0 -40
  137. package/source/components/_common/Accordion/Accordion.story.js +0 -36
  138. package/source/components/_common/Badge/Badge.story.js +0 -27
  139. package/source/components/_common/Badge/Badge.story.styl +0 -5
  140. package/source/components/_common/Bubble/Bubble.story.js +0 -52
  141. package/source/components/_common/Button/Button.story.js +0 -52
  142. package/source/components/_common/Button/Button.story.styl +0 -5
  143. package/source/components/_common/ButtonOld/Button.story.js +0 -54
  144. package/source/components/_common/ButtonOld/Button.story.styl +0 -5
  145. package/source/components/_common/Checkbox/Checkbox.story.js +0 -85
  146. package/source/components/_common/Checkbox/Checkbox.story.styl +0 -14
  147. package/source/components/_common/CheckboxMaterial/CheckboxMaterial.story.js +0 -126
  148. package/source/components/_common/CheckboxMaterial/CheckboxMaterial.story.styl +0 -14
  149. package/source/components/_common/Chip/Chip.story.js +0 -43
  150. package/source/components/_common/ChipList/ChipList.story.js +0 -36
  151. package/source/components/_common/DropDown/DropDown.story.js +0 -35
  152. package/source/components/_common/ExpandablePanel/ExpandablePanel.story.js +0 -41
  153. package/source/components/_common/Histogram/Histogram.story.js +0 -51
  154. package/source/components/_common/IconSVG/IconSVG.story.js +0 -21
  155. package/source/components/_common/IconSVG/IconSVG.story.styl +0 -25
  156. package/source/components/_common/Image/Image.story.js +0 -142
  157. package/source/components/_common/Image/Image.story.styl +0 -18
  158. package/source/components/_common/ImagesSet/ImagesSet.story.js +0 -34
  159. package/source/components/_common/ImagesSet/ImagesSet.story.styl +0 -4
  160. package/source/components/_common/Loader/Loader.story.js +0 -21
  161. package/source/components/_common/MaterialAccordionGroup/MaterialAccordionGroup.story.js +0 -49
  162. package/source/components/_common/MaterialDatePicker/MaterialDatePicker.story.js +0 -45
  163. package/source/components/_common/MaterialDatePicker/MaterialDatePicker.story.styl +0 -6
  164. package/source/components/_common/MaterialField/MaterialField.story.js +0 -87
  165. package/source/components/_common/MaterialField/MaterialField.story.styl +0 -34
  166. package/source/components/_common/MaterialSelect/MaterialSelect.story.js +0 -52
  167. package/source/components/_common/MaterialSelect/MaterialSelect.story.styl +0 -6
  168. package/source/components/_common/MaterialStepButton/MaterialStepButton.story.js +0 -47
  169. package/source/components/_common/MaterialStepButton/MaterialStepButton.story.styl +0 -6
  170. package/source/components/_common/MaterialSwitch/MaterialSwitch.story.js +0 -17
  171. package/source/components/_common/MaterialTooltip/MaterialTooltip.story.js +0 -10
  172. package/source/components/_common/Modal/Modal.story.js +0 -37
  173. package/source/components/_common/MuiGroupedSelect/MuiGroupedSelect.story.js +0 -21
  174. package/source/components/_common/PropertySelector/PSGroup.story.js +0 -93
  175. package/source/components/_common/PropertySelector/PSGroup.story.styl +0 -25
  176. package/source/components/_common/PropertySelector/ProperySelector.story.js +0 -83
  177. package/source/components/_common/Radio/FormRadioGroup.story.js +0 -28
  178. package/source/components/_common/Radio/FormRadioGroup.story.styl +0 -2
  179. package/source/components/_common/Radio/Radio.story.js +0 -54
  180. package/source/components/_common/Radio/RadioGroup.story.js +0 -90
  181. package/source/components/_common/Radio/RadioGroup.story.styl +0 -39
  182. package/source/components/_common/Range/Range.story.js +0 -46
  183. package/source/components/_common/Range/Range.story.styl +0 -5
  184. package/source/components/_common/SliderArrow/SliderArrow.story.js +0 -18
  185. package/source/components/_common/Tabs/Tabs.story.js +0 -56
  186. package/source/components/_common/TimePicker/TimePicker.story.js +0 -37
  187. package/source/components/_common/Tooltip/Tooltip.story.js +0 -28
  188. package/source/components/_common/UserMenu/MaterialMenu.story.js +0 -73
  189. package/source/components/_common/VehicleSlider/VehicleSlider.story.js +0 -99
  190. package/source/components/_common/VehicleSlider/VehicleSlider.story.styl +0 -0
  191. package/source/components/_common/withLabel/withLabel.story.js +0 -62
  192. package/source/components/_common/withPopover/withPopover.story.js +0 -48
  193. package/source/components/_common/withPopover/withPopover.story.styl +0 -54
  194. package/source/components/_common/withStats/withStats.story.js +0 -75
@@ -1,45 +0,0 @@
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 />)
@@ -1,6 +0,0 @@
1
- @import '../../../theme/theme.styl'
2
-
3
- .wrapper
4
- background-color: #fff;
5
- box-sizing: border-box;
6
- padding: 15px;
@@ -1,87 +0,0 @@
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 />)
@@ -1,34 +0,0 @@
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;
@@ -1,52 +0,0 @@
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 />)
@@ -1,6 +0,0 @@
1
- @import '../../../theme/theme.styl'
2
-
3
- .wrapper
4
- background-color: #fff;
5
- box-sizing: border-box;
6
- padding: 16px
@@ -1,47 +0,0 @@
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 />)
@@ -1,6 +0,0 @@
1
- @import '../../../theme/theme.styl'
2
-
3
- .wrapper
4
- background-color: #fff;
5
- box-sizing: border-box;
6
- padding: 15px;
@@ -1,17 +0,0 @@
1
- import React, { useState } from 'react';
2
- import { storiesOf } from '@storybook/react';
3
- import MaterialSwitch from './MaterialSwitch';
4
-
5
- const Switch = () => {
6
- const [value, setValue] = useState(false);
7
-
8
- const onChange = (checked) => {
9
- setValue(checked);
10
- };
11
-
12
- return <MaterialSwitch value={value} onChange={onChange} label='switcher' />
13
- }
14
-
15
-
16
- storiesOf('_Common_UI', module)
17
- .add('MaterialSwitch', () => <Switch />)
@@ -1,10 +0,0 @@
1
- import React, { useState } from 'react';
2
- import { storiesOf } from '@storybook/react';
3
- import MaterialTooltip from './MaterialTooltip';
4
-
5
- const Tooltip = () => {
6
- return <MaterialTooltip text='info text' icon='infoIcon' />
7
- }
8
-
9
- storiesOf('_Common_UI', module)
10
- .add('MaterialTooltip', () => <Tooltip />)
@@ -1,37 +0,0 @@
1
- import React, { useState } from 'react';
2
- import { storiesOf } from '@storybook/react';
3
- import useModal from '../../../framework/hooks/useModal';
4
-
5
- import Modal from './Modal';
6
-
7
- const ModalComponent = () => {
8
- const { isVisible, toggleModal } = useModal();
9
- const [modal, setModal] = useState('');
10
-
11
- const onClearModalState = () => {
12
- setModal('');
13
- };
14
-
15
- const onOpenCookieModal = () => {
16
- setModal('PREVIEW_COOKIE_MODAL');
17
- toggleModal();
18
- };
19
-
20
- const modalProps = {
21
- onClearModalState,
22
- setModal
23
- }
24
-
25
- return (
26
- <>
27
- <button onClick={onOpenCookieModal}>
28
- open modal
29
- </button>
30
- <Modal isVisible={isVisible} toggleModal={toggleModal} name={modal} modalProps={modalProps} />
31
- </>
32
- )
33
- }
34
-
35
-
36
- storiesOf('_Common_UI', module)
37
- .add('Modal', () => <ModalComponent />)
@@ -1,21 +0,0 @@
1
- import React from 'react';
2
- import { Resizable } from 're-resizable';
3
- import { storiesOf } from '@storybook/react';
4
- // Components
5
- import MuiGroupedSelect from './MuiGroupedSelect';
6
-
7
- const resizableProps = {
8
- defaultSize: { width: 360, height: 700 }
9
- };
10
-
11
- const MuiFieldWrapper = () => {
12
-
13
- return (
14
- <Resizable {...resizableProps}>
15
- <MuiGroupedSelect />
16
- </Resizable>
17
- );
18
- }
19
-
20
- storiesOf('_Common_UI', module)
21
- .add('MuiGroupedSelect', () => <MuiFieldWrapper />)
@@ -1,93 +0,0 @@
1
- import React from 'react';
2
- import { storiesOf } from '@storybook/react';
3
- import { action } from '@storybook/addon-actions';
4
-
5
- import PropertySelector from './PropertySelector';
6
- import PSGroup from './PSGroup';
7
-
8
- import styles from './PSGroup.story.styl';
9
-
10
- export class PSGroupDefault extends React.Component {
11
- state = {
12
- value: ['always']
13
- };
14
- action = action('change');
15
-
16
- onChange = (event, value) => {
17
- // value here have to be single string|number or array
18
- this.action(event, value);
19
- this.setState(() => ({ value }));
20
- };
21
-
22
- render() {
23
- return (
24
- <PSGroup name='availability' behavior='checkbox' value={this.state.value} containerClassName={styles.default} onChange={this.onChange}>
25
- <PropertySelector value='1' content='cbd_selector_exterior_color_brown' label='Brown' type='color' />
26
- <PropertySelector value='2' content='cbd_selector_exterior_color_blue' label='Blue' type='color' />
27
- <PropertySelector value='3' content='cbd_selector_exterior_color_green' label='Green' type='color' disabled={true} />
28
- </PSGroup>
29
- );
30
- }
31
- }
32
-
33
- export class PSGroupHorizontal extends React.Component {
34
- state = {
35
- value: ['M_Sport']
36
- };
37
-
38
- action = action('change');
39
- onChange = (event, value) => {
40
- this.action(event, value);
41
- this.setState(() => ({ value }));
42
- };
43
-
44
- renderSubModel = (index) => {
45
- const models = ['320 | 2.0 | Automatic', '320 | 2.0 | Diesel', '320 | 2.0'];
46
-
47
- return (
48
- <div className={styles.equipment}>
49
- <div className={styles.column}>
50
- <span className={styles.value}>
51
- {models[index]}
52
- </span>
53
- </div>
54
- <div className={styles.column}>
55
- <span className={styles.title}>
56
- Power
57
- </span>
58
- <span className={styles.value}>
59
- 184 PS / 138 KW
60
- </span>
61
- </div>
62
- <div className={styles.column}>
63
- <span className={styles.title}>
64
- Built by
65
- </span>
66
- <span className={styles.value}>
67
- 7/2015 – 12/2018
68
- </span>
69
- </div>
70
- </div>
71
- );
72
- };
73
-
74
- render() {
75
- return (
76
- <PSGroup name='sub_model' behavior='radio' containerClassName={styles.horizontal} childClassName={styles.horizontalChild} value={this.state.value} onChange={this.onChange}>
77
- <PropertySelector label={this.renderSubModel(0)} value='M_Sport' />
78
- <PropertySelector label={this.renderSubModel(1)} value='M_Sport_Coupe' />
79
- <PropertySelector label={this.renderSubModel(2)} value='M_Sport_Diesel' />
80
- </PSGroup>
81
- );
82
- }
83
- }
84
-
85
- storiesOf('_Common_UI', module)
86
- .add('PSGroup', () => (
87
- <div>
88
- <p className={styles.text}>Checkbox behavior</p>
89
- <PSGroupDefault />
90
- <p className={styles.text}>Radio button behavior</p>
91
- <PSGroupHorizontal />
92
- </div>
93
- ));
@@ -1,25 +0,0 @@
1
- @import '../../../theme/theme.styl'
2
-
3
- .default
4
- composes: default
5
- display: flex
6
- flex-direction: column
7
-
8
- .horizontal
9
- border: 1px solid lightgray
10
- padding: 10px
11
- border-radius: 5px
12
- margin-bottom: 20px
13
- display: flex
14
- flex-direction: row
15
- align-items: center
16
- justify-content: space-between
17
-
18
- .horizontalChild
19
- margin-bottom: 0 !important
20
- margin-right: 10px
21
-
22
- .text
23
- font-family: $font-style-arial
24
- font-size: $font-size-h3
25
- font-weight: $font-weight-medium
@@ -1,83 +0,0 @@
1
- import React from 'react';
2
-
3
- import { storiesOf } from '@storybook/react';
4
- import { action } from '@storybook/addon-actions';
5
-
6
- import PropertySelector from './PropertySelector';
7
- import { CONTAINER_STYLES, ROW_STYLES, COLUMN_STYLES } from '../../../framework/constants';
8
- import { EXTERIOR_COLORS } from '../../../framework/constants/selectors';
9
-
10
- const renderColors = () => EXTERIOR_COLORS.map((color, index) => {
11
- const props = {
12
- type: 'color',
13
- checked: index === 2 || index === 3,
14
- name: color,
15
- value: color,
16
-
17
- content: color,
18
- label: <span>wow so label. <b>much content</b></span>,
19
-
20
- tooltip: 'some text here',
21
- onChange: action('change')
22
- };
23
-
24
- return index < 5 ? (
25
- <div key={index} style={ROW_STYLES}>
26
- <PropertySelector {...props} />
27
- </div>
28
- ) : false;
29
- });
30
-
31
- const renderIcons = () => {
32
- const props = {
33
- type: 'icon',
34
- name: 'icon',
35
- checked: true,
36
- label: <span>wow so label. <b>much content</b></span>,
37
-
38
- content: <span></span>,
39
- onChange: action('change')
40
- };
41
-
42
- return (
43
- <div style={ROW_STYLES}>
44
- <PropertySelector {...props} />
45
- </div>
46
- );
47
- };
48
-
49
- const renderText = () => [...Array(5)].map((item, index) => {
50
- const props = {
51
- type: 'text',
52
- checked: index === 1,
53
- name: index,
54
-
55
- content: index === 0 ? 'All' : index,
56
- label: <span>wow so label. <b>much content</b></span>,
57
-
58
- tooltip: 'some text here',
59
- onChange: action('change')
60
- };
61
-
62
- return (
63
- <div key={index} style={ROW_STYLES}>
64
- <PropertySelector {...props} />
65
- </div>
66
- );
67
- });
68
-
69
-
70
- storiesOf('_Common_UI', module)
71
- .add('PropertySelector', () => (
72
- <div style={CONTAINER_STYLES}>
73
- <div style={COLUMN_STYLES}>
74
- {renderColors()}
75
- </div>
76
- <div style={COLUMN_STYLES}>
77
- {renderIcons()}
78
- </div>
79
- <div style={COLUMN_STYLES}>
80
- {renderText()}
81
- </div>
82
- </div>
83
- ));
@@ -1,28 +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 FormRadioGroup from './FormRadioGroup';
7
- import styles from './FormRadioGroup.story.styl';
8
-
9
- const mockField = {
10
- name: 'availability',
11
- value: 'always',
12
- error: 'Something went wrong',
13
- hasError: true,
14
- onChange: action('FormRadioGroup change'),
15
- bind: () => {
16
- const { bind, ...rest } = mockField;
17
- return rest;
18
- }
19
- };
20
-
21
- storiesOf('_Common_UI', module)
22
- .add('FormRadioGroup', () => (
23
- <FormRadioGroup field={mockField} childClassName={styles.child}>
24
- <Radio label='Available always' value='always'/>
25
- <Radio label='Available from' value='fromDate'/>
26
- <Radio label='Unknown' value='unknown' disabled={true}/>
27
- </FormRadioGroup>
28
- ));
@@ -1,2 +0,0 @@
1
- .child
2
- margin-right: 20px
@@ -1,54 +0,0 @@
1
- import React from 'react';
2
- import { storiesOf } from '@storybook/react';
3
- import { action } from '@storybook/addon-actions';
4
-
5
- import { ROW_STYLES, COLUMN_STYLES } from '../../../framework/constants';
6
- import Radio from './Radio';
7
- import RadioGroup from './RadioGroup';
8
- //import FormCheckbox from './FormCheckbox';
9
-
10
- //import styles from './Checkbox.story.styl';
11
-
12
- // Props related to FormCheckbox stories
13
- //const basePropsForm = {
14
- // field: { bind: () => { } },
15
- // label: 'Some label here'
16
- //};
17
- //
18
- //const withErrorForm = {
19
- // field: { bind: () => { }, hasError: true, error: 'Something went wrong'},
20
- // label: 'Some label here',
21
- //};
22
-
23
-
24
- // Props related to the Checkbox stories
25
- const baseProps = {
26
- name: 'bitch',
27
- checked: false,
28
- value: 'some bitchy value',
29
- label: <span>wow, so label!</span>,
30
-
31
- onChange: action('checkbox change'),
32
- onFocus: action('checkbox focus'),
33
- onBlur: action('checkbox blur')
34
- };
35
-
36
- storiesOf('_Common_UI', module)
37
- .add('Radio', () => (
38
- <div>
39
- <div style={ROW_STYLES}>
40
- <div style={COLUMN_STYLES}>
41
- <Radio {...baseProps} checked={true} />
42
- </div>
43
- <div style={COLUMN_STYLES}>
44
- <Radio {...baseProps} disabled={true} />
45
- </div>
46
- <div style={COLUMN_STYLES}>
47
- <Radio {...baseProps} error={true} />
48
- </div>
49
- <div style={COLUMN_STYLES}>
50
- <Radio {...baseProps} checked={true} disabled={true} />
51
- </div>
52
- </div>
53
- </div>
54
- ));