@bytebrand/fe-ui-core 4.3.1 → 4.4.0

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 (125) hide show
  1. package/__tests__/components/UserDasboardPage/sections/CheckoutSection/CheckoutSection.test.tsx +613 -0
  2. package/__tests__/components/UserDasboardPage/sections/FavoriteSection/FavoriteSection.test.tsx +335 -0
  3. package/__tests__/utils/CommonUtils/getOfferSliders.test.ts +4 -2
  4. package/common.ts +6 -2
  5. package/package.json +19 -28
  6. package/source/components/AccordionWidget/AccordionWidget.tsx +1 -3
  7. package/source/components/Breadcrumbs/Breadcrumbs.tsx +3 -3
  8. package/source/components/Checkout/CheckoutStepper/CheckoutStepper.styl +2 -190
  9. package/source/components/Checkout/CheckoutStepper/CheckoutStepper.tsx +15 -16
  10. package/source/components/Checkout/OrderOverviewItem/OrderOverviewItem.styl +2 -2
  11. package/source/components/Checkout/OrderOverviewItem/OrderOverviewItem.tsx +3 -3
  12. package/source/components/FormattedNumber/FormattedNumber.tsx +2 -3
  13. package/source/components/InfoBlocks/FirstInfoBlock/FirstInfoBlockItem/FirstInfoBlockItem.styl +4 -6
  14. package/source/components/OfferDetailedSection/partials/PanelConfig.tsx +0 -3
  15. package/source/components/OfferPanel/MuiOfferPeriod/{MuiOfferPeriod.theme.js → MuiOfferPeriod.theme.tsx} +8 -13
  16. package/source/components/OfferPanel/MuiOfferPeriod/MuiOfferPeriod.tsx +28 -4
  17. package/source/components/OfferPanel/OfferCheckboxGroup/CheckboxContainer.tsx +6 -12
  18. package/source/components/OfferPanel/OfferCheckboxGroup/OfferCheckboxGroup.tsx +1 -1
  19. package/source/components/OfferPanel/OfferPanel.tsx +1 -1
  20. package/source/components/OfferPanel/OfferPeriod/OfferPeriod.tsx +0 -4
  21. package/source/components/OfferPanel/RangeGroup/RangeGroup.tsx +6 -4
  22. package/source/components/PriceRatingDetailed/PriceRatingDetailed.tsx +6 -2
  23. package/source/components/SearchFilters/filters/AlternativeID.tsx +42 -53
  24. package/source/components/SearchFilters/filters/DriveType.tsx +1 -1
  25. package/source/components/SearchFilters/filters/EmissionSticker.tsx +1 -1
  26. package/source/components/SearchFilters/filters/FirstRegistration.tsx +0 -1
  27. package/source/components/SearchFilters/filters/InteriorColor.tsx +1 -1
  28. package/source/components/SearchFilters/filters/InteriorMaterial.tsx +2 -1
  29. package/source/components/SearchFilters/filters/Mileage.tsx +1 -1
  30. package/source/components/SearchFilters/filters/Power.tsx +36 -17
  31. package/source/components/SearchFilters/filters/StateOptions.tsx +0 -1
  32. package/source/components/SearchFilters/filters/Transmission.tsx +1 -1
  33. package/source/components/SearchPage/SearchChips/SearchChips.tsx +1 -1
  34. package/source/components/SearchPageMobile/FiltersDetailed/BodyType.tsx +3 -3
  35. package/source/components/SearchPageMobile/FiltersDetailed/Consumption.tsx +2 -2
  36. package/source/components/SearchPageMobile/FiltersDetailed/Doors.tsx +1 -1
  37. package/source/components/SearchPageMobile/FiltersDetailed/MakeModel.tsx +1 -1
  38. package/source/components/SearchWidget/ColorWidget/BodyColorWidget.tsx +3 -3
  39. package/source/components/SearchWidget/EnvironmentWidget/EnvironmentWidget.tsx +3 -3
  40. package/source/components/SearchWidget/HighlightsWidget/HighlightsWidget.tsx +2 -2
  41. package/source/components/SearchWidget/StateWidget/StateWidget.tsx +1 -2
  42. package/source/components/SearchWidgetsMobile/BasicDataWidgetMobile/BasicDataWidgetMobile.tsx +4 -4
  43. package/source/components/SearchWidgetsMobile/EquipmentsWidget/EquipmentsWidget.tsx +16 -16
  44. package/source/components/SearchWidgetsMobile/HighlightsWidgetMobile/HighlightsWidgetMobile.tsx +1 -1
  45. package/source/components/SearchWidgetsMobile/InteriorWidget/InteriorWidget.tsx +1 -1
  46. package/source/components/SearchWidgetsMobile/SafetyWidget/SafetyWidget.tsx +6 -6
  47. package/source/components/Stepper/Stepper.tsx +4 -3
  48. package/source/components/UserDashboardPage/sections/CheckoutSection/CheckoutSection.styl +38 -0
  49. package/source/components/UserDashboardPage/sections/CheckoutSection/CheckoutSection.tsx +120 -0
  50. package/source/components/UserDashboardPage/sections/FavoriteSection/FavoriteSection.styl +22 -0
  51. package/source/components/UserDashboardPage/sections/FavoriteSection/FavoriteSection.tsx +84 -0
  52. package/source/components/UserDashboardPage/sections/OrderStatusSection/AdditionalOrderInfo.styl +11 -2
  53. package/source/components/UserDashboardPage/sections/OrderStatusSection/AdditionalOrderInfo.tsx +5 -5
  54. package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusCar.tsx +57 -38
  55. package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusCard.tsx +2 -2
  56. package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusSection.tsx +183 -101
  57. package/source/components/UserDashboardPage/sections/RequestedCarsSection/RequestedCarsSection.tsx +5 -7
  58. package/source/components/Vehicle/VehicleFormattedPrice/VehicleFormattedPrice.tsx +33 -7
  59. package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.styl +10 -2
  60. package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.tsx +54 -14
  61. package/source/components/VehicleDetailedSidebar/partials/Price.styl +5 -1
  62. package/source/components/VehicleDetailedSidebar/partials/Price.tsx +2 -1
  63. package/source/components/VehicleDetailedSidebar/partials/PriceContent.styl +16 -5
  64. package/source/components/VehicleDetailedSidebar/partials/PriceContent.tsx +9 -4
  65. package/source/components/VehicleDetailedSidebar/partials/Properties.tsx +1 -1
  66. package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.styl +45 -0
  67. package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.tsx +121 -42
  68. package/source/components/VehicleDetailedSlider/partials/PriceData.styl +4 -1
  69. package/source/components/VehicleDetailedSlider/partials/PriceData.tsx +8 -1
  70. package/source/components/VehicleDetailedSlider/partials/Stats.tsx +2 -2
  71. package/source/components/VehicleSmallCard/VehicleData/VechiclePriceItem/VechiclePriceItem.tsx +9 -7
  72. package/source/components/VehicleSmallCard/VehicleData/VehiclePrice/VehiclePrice.styl +35 -1
  73. package/source/components/VehicleSmallCard/VehicleData/VehiclePrice/VehiclePrice.tsx +9 -3
  74. package/source/components/VehicleSmallCard/VehicleData/VehicleTitle/VehicleTitle.styl +11 -2
  75. package/source/components/VehicleSmallCard/VehicleData/VehicleTitle/VehicleTitle.tsx +2 -1
  76. package/source/components/VehicleSmallCard/VehicleSmallCard.styl +3 -1
  77. package/source/components/VehicleSmallCard/VehicleSmallCard.tsx +3 -7
  78. package/source/components/_common/Badge/Badge.styl +3 -0
  79. package/source/components/_common/Badge/Badge.tsx +1 -1
  80. package/source/components/_common/Button/Button.tsx +5 -4
  81. package/source/components/_common/Checkbox/FormCheckbox.tsx +4 -4
  82. package/source/components/_common/CheckboxMaterial/CheckboxMaterial.tsx +1 -1
  83. package/source/components/_common/Chip/Chip.tsx +1 -3
  84. package/source/components/_common/ExpansionPanel/ExpansionPanel.tsx +3 -3
  85. package/source/components/_common/IconSVG/IconSVGConfig.tsx +2 -0
  86. package/source/components/_common/IconSVG/SVG/flags/SK.tsx +0 -1
  87. package/source/components/_common/IconSVG/SVG/slider/360New.tsx +1 -1
  88. package/source/components/_common/IconSVG/SVG/slider/YoutubeButton.tsx +26 -0
  89. package/source/components/_common/MaterialAccordion/MaterialAccordion.tsx +22 -30
  90. package/source/components/_common/MaterialAutocomplete/MaterialAutocomplete.styled.tsx +8 -8
  91. package/source/components/_common/MaterialDatePicker/MaterialDatePicker.styled.tsx +0 -1
  92. package/source/components/_common/MaterialSelect/MaterialSelect.styled.tsx +12 -15
  93. package/source/components/_common/MaterialSelect/MaterialSelect.tsx +3 -3
  94. package/source/components/_common/MaterialSwitch/MaterialSwitch.tsx +3 -1
  95. package/source/components/_common/MaterialTooltip/MaterialTooltip.styled.tsx +1 -1
  96. package/source/components/_common/MaterialTooltip/MaterialTooltip.tsx +3 -3
  97. package/source/components/_common/Modal/CookieModal.tsx +1 -3
  98. package/source/components/_common/Modal/Modal.styled.tsx +2 -1
  99. package/source/components/_common/Modal/Modal.tsx +1 -5
  100. package/source/components/_common/Modal/ModalsConfig.tsx +5 -1
  101. package/source/components/_common/Modal/modals/ManageCookieModal/ManageCookieModal.styl +23 -7
  102. package/source/components/_common/Modal/modals/ManageCookieModal/ManageCookieModal.tsx +84 -36
  103. package/source/components/_common/Modal/modals/PreviewCookieModal/PreviewCookieModal.styl +29 -14
  104. package/source/components/_common/Modal/modals/PreviewCookieModal/PreviewCookieModal.tsx +17 -10
  105. package/source/components/_common/OfferRequestButtonWrapper/OfferRequestButtonWrapper.tsx +12 -4
  106. package/source/components/_common/Range/Range.tsx +26 -16
  107. package/source/components/_common/UserMenu/MaterialMenu.styled.tsx +0 -1
  108. package/source/components/_common/UserMenu/MaterialMenu.tsx +3 -3
  109. package/source/components/_common/UserMenu/MaterialMenuItem.tsx +42 -20
  110. package/source/components/_common/UserMenu/NestedMenu.tsx +1 -1
  111. package/source/components/_common/withStats/withStats.styl +3 -0
  112. package/source/components/_common/withStats/withStats.tsx +19 -16
  113. package/source/components/containers/SearchPage/FiltersContainer/FiltersContainer.styl +14 -1
  114. package/source/components/containers/SearchPage/FiltersContainer/FiltersContainer.tsx +78 -42
  115. package/source/framework/constants/common.ts +89 -60
  116. package/source/framework/constants/highlights.ts +1 -1
  117. package/source/framework/constants.ts +1 -1
  118. package/source/framework/types/types.ts +9 -4
  119. package/source/framework/utils/CommonUtils.ts +73 -62
  120. package/source/framework/utils/DateUtils.ts +10 -2
  121. package/source/framework/vehiclesProps/decoratedLightProps.tsx +1 -2
  122. package/source/framework/vehiclesProps/decoratedProps.tsx +1 -2
  123. package/source/locales/data.ts +2 -2
  124. package/tslint.json +1 -2
  125. package/utils.ts +2 -0
@@ -136,6 +136,7 @@ const VehiclePrice: React.FC<IVehiclePriceSectionProps> = (props: IVehiclePriceS
136
136
  const buttonClassNames = classnames(
137
137
  classButton,
138
138
  styles.buttonDetails,
139
+ { [styles.landingButton]: vehicleComponentName === 'landing' },
139
140
  { [styles.isAlternativeButton]: typeAlternative }
140
141
  );
141
142
 
@@ -183,7 +184,7 @@ const VehiclePrice: React.FC<IVehiclePriceSectionProps> = (props: IVehiclePriceS
183
184
  }
184
185
  ] : '';
185
186
 
186
- const priceData = combineRefAlternative ? [
187
+ const priceData:any = combineRefAlternative ? [
187
188
  ...priceItemsGlobal,
188
189
  {
189
190
  isTotal: true,
@@ -195,7 +196,8 @@ const VehiclePrice: React.FC<IVehiclePriceSectionProps> = (props: IVehiclePriceS
195
196
  {
196
197
  isTotal: true,
197
198
  totalCurrent: margin ? margin : currentSalesPriceExtra,
198
- title: t('vehicleProps:title.marge')
199
+ title: t('vehicleProps:title.marge'),
200
+ isMarge: true
199
201
  }
200
202
  ] : [
201
203
  ...priceItemsGlobal,
@@ -254,6 +256,7 @@ const VehiclePrice: React.FC<IVehiclePriceSectionProps> = (props: IVehiclePriceS
254
256
  routeObj={routeObj}
255
257
  vehicleComponentName={vehicleComponentName}
256
258
  combineRefAlternative={combineRefAlternative}
259
+ isMarge={props.isMarge}
257
260
  />
258
261
  ))}
259
262
  {vehicleComponentName === 'favorite' && showCompareCheckboxes && (
@@ -273,7 +276,10 @@ const VehiclePrice: React.FC<IVehiclePriceSectionProps> = (props: IVehiclePriceS
273
276
  </Button>
274
277
  ) : null}
275
278
  {showOfferBtn ? (
276
- <Button variant={offerBtnVariantCondition} className={buttonClassNames} onClick={onDetailsClick}>{t('vehicleProps:title.toOffer')}</Button>
279
+ vehicleComponentName === 'landing' ? (
280
+ <button className={buttonClassNames} onClick={onDetailsClick}>{t('vehicleProps:title.toOffer')}</button>
281
+ ) :
282
+ <Button variant={offerBtnVariantCondition} className={buttonClassNames} onClick={onDetailsClick}>{t('vehicleProps:title.toOffer')}</Button>
277
283
  ) : ''}
278
284
  </section>
279
285
  );
@@ -28,6 +28,9 @@
28
28
  display block
29
29
  +media-tablet-landscape-up()
30
30
  display flex
31
+ &.wrapTitlesAlternative
32
+ +media-tablet-landscape-up()
33
+ flex-wrap: wrap
31
34
  &.wrapTitlesFavorite
32
35
  display: flex;
33
36
  +media-tablet-landscape-up()
@@ -57,7 +60,7 @@
57
60
 
58
61
  +media-tablet-landscape-up()
59
62
  margin: 0 0 -1px 3px
60
- max-width: 100%;
63
+ overflow: hidden
61
64
 
62
65
  .optionTitle
63
66
  display: flex
@@ -72,6 +75,7 @@
72
75
  margin-top: 3px;
73
76
  +media-tablet-landscape-up()
74
77
  margin-left: 8px;
78
+ width: 100%
75
79
  margin-top: 0;
76
80
  &.optionTitleFavorite
77
81
  font-size: 12px;
@@ -83,7 +87,12 @@
83
87
  margin-left: 8px;
84
88
  &.optionTitleIsAlternative
85
89
  overflow: hidden;
86
- max-width: 260px;
90
+ .subModel
91
+ margin: 5px 0 0 0
92
+ +media-tablet-landscape-up()
93
+ max-width: 260px;
94
+ +media-tablet-landscape-up()
95
+ margin-left: 0
87
96
 
88
97
  .sponsored
89
98
  font-weight: 700
@@ -33,7 +33,8 @@ const VehicleTitle: React.FC<IVehicleTitleProps> = ({
33
33
  styles.wrapTitles,
34
34
  { [styles.wrapTitlesFavorite]: vehicleComponentName === 'favorite' },
35
35
  { [styles.wrapTitlesRecently]: vehicleComponentName === 'recently' || vehicleComponentName === 'landing' || vehicleComponentName === 'main' },
36
- { [styles.wrapTitlesSearch]: vehicleComponentName === 'search' || vehicleComponentName === 'myVehicles' }
36
+ { [styles.wrapTitlesSearch]: vehicleComponentName === 'search' || vehicleComponentName === 'myVehicles' },
37
+ { [styles.wrapTitlesAlternative]: combineRefAlternative }
37
38
  );
38
39
  const optionTitleClassName = classnames(
39
40
  styles.optionTitle,
@@ -224,10 +224,12 @@
224
224
 
225
225
  & > div
226
226
  display flex
227
- align-items: center
227
+ align-items: center;
228
+ gap: 4px;
228
229
 
229
230
  &:first-of-type
230
231
  color: $skyBlue;
232
+ line-height: 1;
231
233
 
232
234
  .isFirstReferenceCar
233
235
  border: 1px solid $skyBlue !important;
@@ -34,7 +34,6 @@ interface IVehicleSmallCardProps {
34
34
  language?: string;
35
35
  vehicleComponentName?: 'comparable' | 'landing' | 'search' | 'main' | 'myVehicles' | 'favorite' | 'recently';
36
36
  isTop?: boolean;
37
- isDealer?: boolean;
38
37
  isDealerSuperAdmin?: boolean;
39
38
  isReferenceSearch?: boolean;
40
39
  dashboardButtonText?: string;
@@ -85,7 +84,6 @@ interface IVehicleSmallCardProps {
85
84
  isAlternative?: boolean;
86
85
  typeAlternative?: string;
87
86
  index?: number;
88
- currentPage?: number;
89
87
  }
90
88
 
91
89
  const VehicleSmallCard: FunctionComponent<IVehicleSmallCardProps> = (props) => {
@@ -119,7 +117,6 @@ const VehicleSmallCard: FunctionComponent<IVehicleSmallCardProps> = (props) => {
119
117
  priceSubMtl,
120
118
  onContainerClick,
121
119
  onAddOfferToMainSlideClick,
122
- isDealer,
123
120
  isDealerSuperAdmin,
124
121
  mainImageId,
125
122
  onFavoriteClick,
@@ -145,8 +142,7 @@ const VehicleSmallCard: FunctionComponent<IVehicleSmallCardProps> = (props) => {
145
142
  minimizeData = false,
146
143
  isAlternative = false,
147
144
  typeAlternative,
148
- index,
149
- currentPage
145
+ index
150
146
  } = props;
151
147
 
152
148
  const combineRefAlternative = isAlternative || isReferenceSearch;
@@ -167,7 +163,7 @@ const VehicleSmallCard: FunctionComponent<IVehicleSmallCardProps> = (props) => {
167
163
  { [styles.vehicleWrapRecently]: vehicleComponentName === 'recently' },
168
164
  { [styles.topVehicle]: isTop },
169
165
  { [styles.disableBorder]: minimizeData },
170
- { [styles.isFirstReferenceCar]: isReferenceSearch && index === 0 && currentPage === 1 },
166
+ { [styles.isFirstReferenceCar]: isReferenceSearch && index === 0 },
171
167
  className
172
168
  );
173
169
 
@@ -295,7 +291,7 @@ const VehicleSmallCard: FunctionComponent<IVehicleSmallCardProps> = (props) => {
295
291
  {showComponentLikeSlider ? (
296
292
  <>
297
293
  <DecoratedSliderForSRL {...decoratedSliderProps} />
298
- {renderIDInfo && isDealer ? renderIDInfo() : null}
294
+ {renderIDInfo ? renderIDInfo() : null}
299
295
  {combineRefAlternative && (
300
296
  <div className={styles.wrapAlternativeData}>
301
297
  <div>
@@ -35,6 +35,9 @@ $badge-border-width = 1px
35
35
  .blue
36
36
  background-color: $primary
37
37
  color: white
38
+ .lightBlue
39
+ background-color: #26C6F9
40
+ color: white
38
41
 
39
42
  .red
40
43
  color: #fff;
@@ -3,7 +3,7 @@ import classnames from 'classnames';
3
3
 
4
4
  import styles from './Badge.styl';
5
5
 
6
- export type TBadgeType = 'white' | 'gray' | 'green' | 'blue' | 'red';
6
+ export type TBadgeType = 'white' | 'gray' | 'green' | 'blue' | 'red' | 'lightBlue';
7
7
 
8
8
  export interface IBadgeProps {
9
9
  children: any;
@@ -15,6 +15,7 @@ export interface IButtonProps {
15
15
  color?: variantColor;
16
16
  children?: any;
17
17
  variant?: variantType;
18
+ getRef?: (ref: HTMLButtonElement) => void;
18
19
 
19
20
  disabled?: boolean;
20
21
  loading?: boolean;
@@ -25,8 +26,7 @@ export interface IButtonProps {
25
26
  onMouseLeave?: (event: React.MouseEvent<HTMLButtonElement>) => void;
26
27
  }
27
28
 
28
- const Button: React.FC<IButtonProps> = ({ className, color = 'primary', onClick, onMouseEnter, onMouseLeave, variant, loading, disabled, children }: IButtonProps) => {
29
-
29
+ const Button: React.FC<IButtonProps> = ({ getRef, className, color, onClick, onMouseEnter, onMouseLeave, variant, loading, disabled, children }: IButtonProps) => {
30
30
  const onHandlerClick = (event: React.MouseEvent<HTMLButtonElement>) => {
31
31
  event.stopPropagation();
32
32
  event.nativeEvent.stopImmediatePropagation();
@@ -53,6 +53,7 @@ const Button: React.FC<IButtonProps> = ({ className, color = 'primary', onClick,
53
53
  onClick: onHandlerClick,
54
54
  onMouseEnter: onHandlerMouseEnter,
55
55
  onMouseLeave: onHandlerMouseLeave,
56
+ ref:getRef,
56
57
  disabled: disabled || loading
57
58
  };
58
59
 
@@ -63,14 +64,14 @@ const Button: React.FC<IButtonProps> = ({ className, color = 'primary', onClick,
63
64
 
64
65
  Button.defaultProps = {
65
66
  className: '',
66
-
67
+ color: 'primary',
67
68
  disabled: false,
68
69
  loading: false,
69
70
  variant: 'contained',
70
71
  buttonType: 'button',
71
72
 
72
73
  onClick: () => { },
73
-
74
+ getRef: () => { },
74
75
  onMouseEnter: () => { },
75
76
  onMouseLeave: () => { }
76
77
  };
@@ -21,7 +21,7 @@ interface IFormCheckboxState {
21
21
  checked?: boolean;
22
22
  error?: boolean;
23
23
  disabled?: boolean
24
- }
24
+ };
25
25
  }
26
26
 
27
27
  class FormCheckbox extends React.Component<IFormCheckboxProps, IFormCheckboxState> {
@@ -68,11 +68,11 @@ class FormCheckbox extends React.Component<IFormCheckboxProps, IFormCheckboxStat
68
68
  checked,
69
69
  name,
70
70
  disabled,
71
- onChange: this.handleChange,
72
- error: customError,
73
71
  label,
74
72
  checkboxClassName,
75
- labelClassName
73
+ labelClassName,
74
+ onChange: this.handleChange,
75
+ error: customError
76
76
  };
77
77
 
78
78
  return (
@@ -26,7 +26,7 @@ export interface ICheckboxProps {
26
26
  checkedIcon?: any;
27
27
  className?: string;
28
28
  type?: string;
29
- content?: string;
29
+ content?: string | JSX.Element;
30
30
  radio?: boolean;
31
31
  formControlClassName?: string;
32
32
  contentType?: string;
@@ -7,13 +7,12 @@ export interface IChip {
7
7
  }
8
8
 
9
9
  export interface IChipProps {
10
- className?: string;
11
10
  chip: IChip;
12
11
  onClick?: (event: React.MouseEvent, chip: IChip) => void;
13
12
  onDelete?: (event: React.MouseEvent, chip: IChip) => void;
14
13
  }
15
14
 
16
- const ChipLanding: React.FunctionComponent<IChipProps> = ({ chip, className, onClick, onDelete }) => {
15
+ const ChipLanding: React.FunctionComponent<IChipProps> = ({ chip, onClick, onDelete }) => {
17
16
  const { key, value } = chip;
18
17
  const onDeleteHandler = (event: any) => { event.stopPropagation(); onDelete(event, chip); };
19
18
  const onClickHandler = (event: any) => { event.stopPropagation(); onClick(event, chip); };
@@ -31,7 +30,6 @@ const ChipLanding: React.FunctionComponent<IChipProps> = ({ chip, className, onC
31
30
  };
32
31
 
33
32
  ChipLanding.defaultProps = {
34
- className: '',
35
33
  chip: { key: '', value: '' },
36
34
  onClick: () => {},
37
35
  onDelete: () => {}
@@ -8,10 +8,10 @@ import { ThemeProvider } from '@mui/material/styles';
8
8
  import { Theme } from './ExpansionPanel.styled';
9
9
 
10
10
  export interface IExpansionPanelProps {
11
- title?: string | JSX.Element;
11
+ title?: string;
12
12
  subTitle?: string;
13
13
  defaultExpanded?: boolean;
14
- onChange?: (panel: string) => (event: React.SyntheticEvent, isExpanded: boolean) => void;
14
+ onChange?: any; // TODO: understand how this onchange works and where it is used and write the correct types
15
15
  className?: string;
16
16
  children?: any;
17
17
  reactScrollName?: string; // property "name" for "Element" component of "react-scroll" library
@@ -71,7 +71,7 @@ class ExpansionPanel extends React.Component<IExpansionPanelProps> {
71
71
  <Accordion
72
72
  defaultExpanded={defaultExpanded}
73
73
  onChange={isCompare ? onChange : onChange && onChange(reactScrollName)}
74
- expanded={isCompare ? expanded : expanded && (expanded === reactScrollName)}
74
+ expanded={(isCompare && typeof expanded === 'boolean') ? expanded : expanded && (expanded === reactScrollName)}
75
75
  className={accordionClassName}
76
76
  >
77
77
  <AccordionSummary
@@ -236,6 +236,7 @@ import Easy from './SVG/slider/Easy';
236
236
  import Safe from './SVG/slider/Safe';
237
237
  import ZoomIn from './SVG/slider/ZoomIn';
238
238
  import ZoomOut from './SVG/slider/ZoomOut';
239
+ import YoutubeButton from './SVG/slider/YoutubeButton'
239
240
 
240
241
  // social
241
242
  import SharingInterface from './SVG/social/SharingInterface';
@@ -547,6 +548,7 @@ const components: IComponentsProp = {
547
548
  safe: Safe,
548
549
  zoomIn: ZoomIn,
549
550
  zoomOut: ZoomOut,
551
+ youtubeButton:YoutubeButton,
550
552
 
551
553
  // social
552
554
  sharingInterface: SharingInterface,
@@ -1,5 +1,4 @@
1
1
  /* tslint:disable */
2
- import { fill } from "lodash";
3
2
  import * as React from "react";
4
3
 
5
4
  const SK = (props: any) => (
@@ -10,7 +10,7 @@ const Svg360New = (props: any) => (
10
10
  >
11
11
  <path fillRule="evenodd" clipRule="evenodd" d="M19.2731 12.0024C19.2854 11.774 19.2917 11.5352 19.2917 11.2855C19.2917 11.1381 19.2896 10.9914 19.2854 10.8455C20.9575 11.7695 21.9814 13.0117 21.9814 14.3777C21.9814 16.8116 18.7309 18.8525 14.3546 19.4004V18.3921C16.0124 18.1721 17.47 17.7275 18.5982 17.1434C20.2857 16.2698 20.9814 15.24 20.9814 14.3777C20.9814 13.6409 20.4735 12.7818 19.2731 12.0024ZM8.73484 18.2452V16.9993C8.73484 16.8454 8.90151 16.7491 9.03484 16.8261L12.3089 18.7164C12.4422 18.7934 12.4422 18.9858 12.3089 19.0628L9.03484 20.9531C8.90151 21.03 8.73484 20.9338 8.73484 20.7799V19.2622C4.82573 18.562 2.01855 16.6395 2.01855 14.3777C2.01855 13.0115 3.04264 11.7692 4.71506 10.8452C4.71086 10.9912 4.70874 11.138 4.70874 11.2855C4.70874 11.5353 4.71462 11.7743 4.72619 12.0028C3.52623 12.7822 3.01855 13.641 3.01855 14.3777C3.01855 15.24 3.71425 16.2698 5.40178 17.1434C6.31839 17.618 7.45254 18.0005 8.73484 18.2452Z" fill="#636578"/>
12
12
  <path fillRule="evenodd" clipRule="evenodd" d="M12.5852 4.01221H11.371H8.76601C8.17317 4.01221 7.93534 4.05632 7.82485 4.10914L7.82398 4.10955C7.78226 4.12949 7.739 4.15017 7.66339 4.36463L6.90141 7.76114L6.89787 7.77689L6.89333 7.79238C6.36163 9.60562 6.44052 12.1325 6.61804 13.7916C6.65081 14.0978 6.91756 14.3404 7.25825 14.3404H7.51156C7.75013 14.3404 7.94353 14.147 7.94353 13.9084C7.94353 13.5663 8.22089 13.289 8.56302 13.289L11.3769 13.289L12.6228 13.289C12.6231 13.289 12.6234 13.289 12.6238 13.289H13.9287H15.3304C15.6726 13.289 15.9499 13.5663 15.9499 13.9084C15.9499 14.147 16.1433 14.3404 16.3819 14.3404H16.6927C17.0621 14.3404 17.3517 14.0778 17.3866 13.7448C17.5607 12.0842 17.633 9.5881 17.1064 7.79238L17.1018 7.77689L17.0983 7.76114L16.3363 4.36463C16.2607 4.15017 16.2175 4.12949 16.1757 4.10955L16.1749 4.10914C16.0644 4.05632 15.8265 4.01221 15.2337 4.01221H12.5852ZM12.6228 14.289L13.9287 14.289H15.001C15.1677 14.8951 15.7228 15.3404 16.3819 15.3404H16.6927C17.539 15.3404 18.2893 14.7252 18.3812 13.8491C18.5576 12.1668 18.6497 9.51711 18.0706 7.52675L17.3059 4.11822L17.3 4.09191L17.2913 4.06638C17.1801 3.7402 17.0155 3.40262 16.6062 3.20696C16.2639 3.04331 15.8059 3.01221 15.2337 3.01221H12.5852H11.371H8.76601C8.19381 3.01221 7.73577 3.04331 7.3935 3.20696C6.98426 3.40262 6.81959 3.7402 6.70842 4.06638L6.69972 4.09191L6.69381 4.11822L5.92913 7.52675C5.3446 9.5359 5.44389 12.2173 5.62372 13.898C5.71431 14.7446 6.43952 15.3404 7.25825 15.3404H7.51156C8.17066 15.3404 8.72577 14.8951 8.89243 14.289H11.3759C11.3763 14.289 11.3766 14.289 11.3769 14.289L12.6228 14.289Z" fill="#636578"/>
13
- <path d="M17.5619 7.56836V7.56836C13.9305 8.65377 10.0509 8.65178 6.41895 7.56836V7.56836" stroke="#636578" stroke-linecap="round"/>
13
+ <path d="M17.5619 7.56836V7.56836C13.9305 8.65377 10.0509 8.65178 6.41895 7.56836V7.56836" stroke="#636578" strokeLinecap="round"/>
14
14
  <circle cx="8.15374" cy="10.3359" r="0.768972" fill="#636578"/>
15
15
  <circle cx="15.8442" cy="10.4555" r="0.768972" fill="#636578"/>
16
16
  </svg>
@@ -0,0 +1,26 @@
1
+ /* tslint:disable */
2
+ import * as React from 'react';
3
+
4
+ const SvgYoutubeButton = (props: any) => (
5
+ <svg
6
+ xmlns="http://www.w3.org/2000/svg"
7
+ width="146"
8
+ height="103"
9
+ viewBox="0 0 146 103"
10
+ fill="none"
11
+ {...props}
12
+ >
13
+ <g clipPath="url(#clip0_13856_24182)">
14
+ <path d="M142.741 16.6087C141.067 10.3215 137.398 4.99979 131.11 3.32604C119.716 0.278958 72.9583 0 72.9583 0C72.9583 0 26.2006 0.278958 14.8063 3.32604C8.51896 4.99979 4.87104 10.3215 3.17583 16.6087C0.12875 28.0031 0 51.5 0 51.5C0 51.5 0.12875 74.9969 3.17583 86.3912C4.84958 92.6785 8.51896 98.0002 14.8063 99.674C26.2006 102.721 72.9583 103 72.9583 103C72.9583 103 119.716 102.721 131.11 99.674C137.398 98.0002 141.067 92.6785 142.741 86.3912C145.788 74.9969 145.917 51.5 145.917 51.5C145.917 51.5 145.788 28.0031 142.741 16.6087Z" fill="#FF0000" />
15
+ <path d="M96.5625 51.5003L57.9375 30.042V72.9587" fill="white" />
16
+ </g>
17
+ <defs>
18
+ <clipPath id="clip0_13856_24182">
19
+ <rect width="145.917" height="103" fill="white" />
20
+ </clipPath>
21
+ </defs>
22
+ </svg>
23
+ );
24
+
25
+ export default SvgYoutubeButton;
26
+ /* tslint:enable */
@@ -3,8 +3,7 @@ import { Accordion, AccordionSummary, AccordionDetails } from '@mui/material';
3
3
  import IconSVG from '../IconSVG/IconSVG';
4
4
  import {
5
5
  ThemeProvider,
6
- createTheme,
7
- experimental_sx as sx
6
+ createTheme
8
7
  } from '@mui/material/styles';
9
8
 
10
9
  export interface IItem {
@@ -18,7 +17,9 @@ export interface IAccordionProps {
18
17
 
19
18
  defaultOpened?: number;
20
19
 
21
- variant?: string;
20
+ variant?: any;
21
+
22
+ expandedDefault?: string;
22
23
  }
23
24
 
24
25
  declare module '@mui/material/AccordionSummary' {
@@ -46,10 +47,9 @@ const MaterialAccordion = (
46
47
  const theme = createTheme({
47
48
  components: {
48
49
  MuiAccordion: {
49
- variants: [
50
- {
51
- props: { variant: 'searchDetailed' },
52
- style: {
50
+ styleOverrides: {
51
+ root: () => ({
52
+ ...(variant === 'searchDetailed' && {
53
53
  margin: 0,
54
54
  '&.Mui-expanded': {
55
55
  margin: 0
@@ -57,11 +57,8 @@ const MaterialAccordion = (
57
57
  '&.MuiAccordion-root:before': {
58
58
  opacity: 0
59
59
  }
60
- }
61
- },
62
- {
63
- props: { variant: 'searchDetailedSmall' },
64
- style: {
60
+ }),
61
+ ...(variant === 'searchDetailedSmall' && {
65
62
  margin: 0,
66
63
  boxShadow: 'none',
67
64
  '&.Mui-expanded': {
@@ -70,32 +67,28 @@ const MaterialAccordion = (
70
67
  '&.MuiAccordion-root:before': {
71
68
  opacity: 0
72
69
  }
73
- }
74
- }
75
- ]
70
+ })
71
+ })
72
+ }
76
73
  },
77
74
  MuiAccordionSummary: {
78
- variants: [
79
- {
80
- props: { variant: 'searchDetailed' },
81
- style: {
75
+ styleOverrides: {
76
+ root: () => ({
77
+ ...(variant === 'searchDetailed' && {
82
78
  color: '#005ccb',
83
79
  fontWeight: 'bold',
84
80
  fontSize: 14,
85
81
  '&.Mui-expanded': {
86
82
  borderBottom: '1px solid #e8e8e8'
87
83
  }
88
- }
89
- },
90
- {
91
- props: { variant: 'searchDetailedSmall' },
92
- style: {
84
+ }),
85
+ ...(variant === 'searchDetailedSmall' && {
93
86
  color: '1f1f1f',
94
87
  fontWeight: 'bold',
95
88
  fontSize: 14
96
- }
97
- }
98
- ]
89
+ })
90
+ })
91
+ }
99
92
  }
100
93
  }
101
94
  });
@@ -104,10 +97,10 @@ const MaterialAccordion = (
104
97
  const [expanded, setExpanded] = useState(expandedDefault || false);
105
98
 
106
99
  const handleChange =
107
- (panel: string) => (event: React.SyntheticEvent, isExpanded: boolean) => {
100
+ (panel: string) => (_: React.SyntheticEvent, isExpanded: boolean) => {
108
101
  setExpanded(isExpanded ? panel : false);
109
102
  };
110
- return items.map((item: any, index: number) => {
103
+ return items.map((item: { title: string, content: any }, index: number) => {
111
104
  return (
112
105
  <ThemeProvider theme={theme}>
113
106
  <Accordion
@@ -120,7 +113,6 @@ const MaterialAccordion = (
120
113
  expandIcon={<IconSVG name={'arrowSelect'} customDimensions />}
121
114
  aria-controls={item.title}
122
115
  id={item.title}
123
- variant={variant}
124
116
  sx={{
125
117
  borderBottom: '1px solid #e8e8e8',
126
118
  borderImageWidth: 0
@@ -21,7 +21,7 @@ export const Theme = createTheme({
21
21
  },
22
22
  ['&.Mui-focused + [data-popper-placement*="bottom"] .MuiOutlinedInput-notchedOutline']: {
23
23
  ...(ownerState.name === 'mobileSearch' && { // tslint:disable-line
24
- borderTop: isMobileOnly ? '2px solid #1976d2' : 0
24
+ borderTop: isMobileOnly ? '2px solid #005CCB' : 0
25
25
  })
26
26
  },
27
27
  ['&.Mui-focused .MuiInputLabel-root']: {
@@ -38,9 +38,9 @@ export const Theme = createTheme({
38
38
  ['&.Mui-focused + [data-popper-placement*="top"] > .MuiPaper-root']: {
39
39
  borderBottomLeftRadius: 0,
40
40
  borderBottomRightRadius: 0,
41
- borderLeft: '2px solid #1976d2',
42
- borderRight: '2px solid #1976d2',
43
- borderTop: '2px solid #1976d2',
41
+ borderLeft: '2px solid #005CCB',
42
+ borderRight: '2px solid #005CCB',
43
+ borderTop: '2px solid #005CCB',
44
44
  ...(ownerState.error && { // tslint:disable-line
45
45
  borderColor: '#d32f2f'
46
46
  })
@@ -48,15 +48,15 @@ export const Theme = createTheme({
48
48
  ['&.Mui-focused + [data-popper-placement*="bottom"] > .MuiPaper-root']: {
49
49
  borderTopLeftRadius: 0,
50
50
  borderTopRightRadius: 0,
51
- borderLeft: '2px solid #1976d2',
52
- borderRight: '2px solid #1976d2',
53
- borderBottom: '2px solid #1976d2',
51
+ borderLeft: '2px solid #005CCB',
52
+ borderRight: '2px solid #005CCB',
53
+ borderBottom: '2px solid #005CCB',
54
54
  ...(ownerState.error && { // tslint:disable-line
55
55
  borderColor: '#d32f2f'
56
56
  }),
57
57
  marginTop: '-3px',
58
58
  ...(ownerState.name === 'mobileSearch' && { // tslint:disable-line
59
- borderTop: isMobileOnly ? '2px solid #1976d2' : 0,
59
+ borderTop: isMobileOnly ? '2px solid #005CCB' : 0,
60
60
  marginTop: 0,
61
61
  borderTopRightRadius: 4,
62
62
  borderTopLeftRadius: 4
@@ -6,7 +6,6 @@ export const Theme = createTheme({
6
6
  styleOverrides: {
7
7
  input: ({ ownerState: { size } }: { ownerState: { size?: 'smaller' | 'custom' | 'normal' | 'small' | 'medium' } }) => ({
8
8
  ...(size === 'smaller' && {
9
- // tslint:disable-line
10
9
  height: 28,
11
10
  boxSizing: 'border-box'
12
11
  }),
@@ -1,6 +1,6 @@
1
1
  import { createTheme } from '@mui/material/styles';
2
2
  import { IconButton } from '@mui/material';
3
- import { padding, styled } from '@mui/system';
3
+ import { styled } from '@mui/system';
4
4
  import IconSVG from '../IconSVG/IconSVG';
5
5
  import { isMobileOnly } from 'react-device-detect';
6
6
 
@@ -15,9 +15,9 @@ export const Theme = createTheme({
15
15
  },
16
16
  MuiInputLabel: {
17
17
  styleOverrides: {
18
- root: ({ ownerState }) => ({
18
+ root: ({ ownerState: { size } }: { ownerState: { size?: 'smaller' | 'custom' | 'normal' | 'small' | 'medium' } }) => ({
19
19
  maxWidth: 'calc(100% - 38px)',
20
- ...(ownerState.size === 'custom' && { // tslint:disable-line
20
+ ...(size === 'custom' && {
21
21
  marginTop: isMobileOnly ? '0px' :'-4px',
22
22
  ['&.MuiInputLabel-shrink, &.Mui-focused']: {
23
23
  marginTop: 0
@@ -37,8 +37,8 @@ export const Theme = createTheme({
37
37
  borderTopLeftRadius: 0,
38
38
  borderTopRightRadius: 0,
39
39
  transformOrigin: '0 0 !important',
40
- boxShadow: 'inset 2px 0px 0px 0px #1976d2, inset -2px 0px 0px 0px #1976d2',
41
- borderBottom: '2px solid #1976d2',
40
+ boxShadow: 'inset 2px 0px 0px 0px #005CCB, inset -2px 0px 0px 0px #005CCB',
41
+ borderBottom: '2px solid #005CCB',
42
42
  ['& > .MuiList-root']: {
43
43
  paddingRight: '0 !important',
44
44
  width: '100% !important'
@@ -48,12 +48,12 @@ export const Theme = createTheme({
48
48
  },
49
49
  ['::-webkit-scrollbar-track']: {
50
50
  background: '#fff',
51
- borderRight: '2px solid #1976d2',
51
+ borderRight: '2px solid #005CCB',
52
52
  boxShadow: 'inset -4px 0 0 0 #fff'
53
53
  },
54
54
  ['::-webkit-scrollbar-thumb']: {
55
55
  backgroundColor: '#e8e8e8',
56
- borderRight: '2px solid #1976d2',
56
+ borderRight: '2px solid #005CCB',
57
57
  boxShadow: 'inset -4px 0 0 0 #fff'
58
58
  },
59
59
  ['::-webkit-scrollbar-thumb:hover']: {
@@ -64,22 +64,19 @@ export const Theme = createTheme({
64
64
  },
65
65
  MuiOutlinedInput: {
66
66
  styleOverrides: {
67
- root: ({ ownerState }) => ({
68
- ...(ownerState.size === 'small' && {
67
+ root: ({ ownerState: { size } }: { ownerState: { size?: 'smaller' | 'custom' | 'normal' | 'small' | 'medium' } }) => ({
68
+ ...(size === 'small' && {
69
69
  paddingRight: '0 !important',
70
- flexWrap: 'nowrap !important',
71
- ['.Mui-disabled']: {
72
- // backgroundColor: '#e8e8e8'
73
- }
70
+ flexWrap: 'nowrap !important'
74
71
  }),
75
- ...(ownerState.size === 'custom' && {
72
+ ...(size === 'custom' && {
76
73
  height: isMobileOnly ? 56 : 48,
77
74
  boxSizing: 'border-box'
78
75
  }),
79
76
  ['&.Mui-disabled svg']: {
80
77
  opacity:'0.38'
81
78
  }
82
- })
79
+ } as any)
83
80
  }
84
81
  },
85
82
  MuiListItemText: {
@@ -9,7 +9,7 @@ import { isMobileOnly } from 'react-device-detect';
9
9
 
10
10
  export interface IItems {
11
11
  value: string | number;
12
- label: string;
12
+ label: string | JSX.Element;
13
13
  isDisabled?: boolean;
14
14
  isSeries?: boolean;
15
15
  }
@@ -32,7 +32,7 @@ export interface IVehicleModalProps {
32
32
  icon?: string;
33
33
  children?: JSX.Element | JSX.Element[];
34
34
  onChange: (value: any) => void;
35
- items: IItems[];
35
+ items?: IItems[];
36
36
  selectClassName?: string;
37
37
  amountOfItems?: number;
38
38
  customDimensionsIcon?: boolean;
@@ -99,7 +99,7 @@ const MaterialSelect: React.FC<IVehicleModalProps> = ({
99
99
  onChange('' as string);
100
100
  };
101
101
 
102
- const getLabel = (label: string, disabled: boolean) => disabled ? <span>{label.toUpperCase()}</span> : label;
102
+ const getLabel = (label: string | JSX.Element, disabled: boolean) => disabled ? <span>{(label as string).toUpperCase()}</span> : label;
103
103
 
104
104
  const IconClassNames = classnames(
105
105
  classNameIcon
@@ -7,10 +7,11 @@ interface IMaterialSwitch {
7
7
  disabled?: boolean;
8
8
  onChange: (value: boolean) => void;
9
9
  label?: any;
10
+ sx?: any;
10
11
  labelPlacement?: 'bottom' | 'end' | 'start' | 'top';
11
12
  }
12
13
 
13
- const MaterialSwitch = ({ disabled, label, onChange, value = false, labelPlacement }: IMaterialSwitch) => {
14
+ const MaterialSwitch = ({ disabled, label, onChange, value = false, sx, labelPlacement }: IMaterialSwitch) => {
14
15
  const [checked, setChecked] = useState(value);
15
16
  const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
16
17
  setChecked(event.target.checked);
@@ -19,6 +20,7 @@ const MaterialSwitch = ({ disabled, label, onChange, value = false, labelPlaceme
19
20
  return (
20
21
  <FormControlLabel
21
22
  label={label}
23
+ sx={sx}
22
24
  labelPlacement={labelPlacement}
23
25
  control={
24
26
  <Switch