@wayke-se/components-react 3.0.0-beta.11 → 3.0.0-beta.13
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.
- package/dist/index.js +5529 -5460
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +320 -257
- package/dist/index.mjs.map +2 -2
- package/package.json +4 -2
- package/.editorconfig +0 -10
- package/.eslintrc.js +0 -62
- package/.github/workflows/release-to-production.yaml +0 -40
- package/.github/workflows/release-to-test.yaml +0 -40
- package/.prettierrc +0 -12
- package/assets/ajax-loader.gif +0 -0
- package/assets/default.css +0 -1
- package/assets/fonts/slick.eot +0 -0
- package/assets/fonts/slick.svg +0 -14
- package/assets/fonts/slick.ttf +0 -0
- package/assets/fonts/slick.woff +0 -0
- package/codegen.yml +0 -19
- package/esbuild/build.js +0 -39
- package/esbuild/common.js +0 -15
- package/esbuild/start.js +0 -21
- package/esbuild/www/index.html +0 -32
- package/example/src/@types/global.d.ts +0 -7
- package/example/src/@types/react-panellum.d.ts +0 -1
- package/example/src/App.tsx +0 -77
- package/example/src/assets/style/ecom.css +0 -63
- package/example/src/assets/style/theme.css +0 -83
- package/example/src/index.html +0 -26
- package/example/src/index.tsx +0 -11
- package/example/src/routes/HashRoute/index.tsx +0 -30
- package/example/src/routes/Home/index.tsx +0 -33
- package/example/src/routes/NotFound/index.tsx +0 -5
- package/example/src/routes/PathRoute/index.tsx +0 -35
- package/example/src/routes/Search/index.tsx +0 -28
- package/example/src/routes/SearchItem/index.tsx +0 -28
- package/example/src/routes/index.tsx +0 -25
- package/src/@types/action.ts +0 -3
- package/src/@types/codegen/types.ts +0 -366
- package/src/@types/filter.ts +0 -18
- package/src/@types/queryFilter.ts +0 -5
- package/src/@types/react-panellum.d.ts +0 -1
- package/src/@types/search.ts +0 -118
- package/src/@types/theme.d.ts +0 -5
- package/src/@types/vehicle-properties.ts +0 -33
- package/src/State/CentralStorage/CentralStorageContext.ts +0 -10
- package/src/State/CentralStorage/CentralStorageProvider.tsx +0 -21
- package/src/State/CentralStorage/useCentralStorage.ts +0 -37
- package/src/State/Path/PathContext.ts +0 -11
- package/src/State/Path/PathProvider.tsx +0 -66
- package/src/State/Path/reducer.ts +0 -30
- package/src/State/Path/usePath.ts +0 -13
- package/src/State/RelatedSearch/RelatedSearchContext.ts +0 -18
- package/src/State/RelatedSearch/RelatedSearchProvider.tsx +0 -55
- package/src/State/RelatedSearch/useRelatedSearch.ts +0 -20
- package/src/State/Search/SearchContext.ts +0 -27
- package/src/State/Search/SearchProvider.tsx +0 -243
- package/src/State/Search/useSearch.ts +0 -6
- package/src/State/Settings/SettingsContext.ts +0 -15
- package/src/State/Settings/SettingsProvider.tsx +0 -23
- package/src/State/Settings/useSettings.ts +0 -7
- package/src/components/Accordion/index.tsx +0 -57
- package/src/components/Accordion/wrapper.tsx +0 -107
- package/src/components/ActionList/index.tsx +0 -48
- package/src/components/ActionList/toggle-item.tsx +0 -59
- package/src/components/Avatar/index.tsx +0 -12
- package/src/components/Avatar/wrapper.tsx +0 -21
- package/src/components/Badge/index.tsx +0 -12
- package/src/components/Badge/wrapper.tsx +0 -32
- package/src/components/Blockquote/index.tsx +0 -32
- package/src/components/Blockquote/wrapper.tsx +0 -52
- package/src/components/Button/index.tsx +0 -226
- package/src/components/CheckMarkList/index.tsx +0 -21
- package/src/components/CheckMarkList/wrapper.tsx +0 -31
- package/src/components/Checklist/index.tsx +0 -51
- package/src/components/Checklist/wrapper.tsx +0 -65
- package/src/components/ColorSelect/index.tsx +0 -63
- package/src/components/ColorSelect/wrapper.tsx +0 -82
- package/src/components/ColumnRow/index.tsx +0 -20
- package/src/components/Container/index.tsx +0 -11
- package/src/components/Container/wrapper.tsx +0 -14
- package/src/components/Content/index.tsx +0 -15
- package/src/components/Content/wrapper.tsx +0 -61
- package/src/components/ContentLogo/index.tsx +0 -27
- package/src/components/DataList/index.tsx +0 -25
- package/src/components/DataList/wrapper.tsx +0 -29
- package/src/components/DetailBox/index.tsx +0 -34
- package/src/components/DetailBox/wrapper.tsx +0 -34
- package/src/components/ExtendContent/index.tsx +0 -43
- package/src/components/ExtendContent/wrapper.tsx +0 -41
- package/src/components/ExtendInfo/index.tsx +0 -32
- package/src/components/ExtendInfo/wrapper.tsx +0 -63
- package/src/components/Filter/index.tsx +0 -108
- package/src/components/Filter/wrapper.tsx +0 -79
- package/src/components/FilterPanel/checkListFacet.tsx +0 -46
- package/src/components/FilterPanel/colorFacet.tsx +0 -47
- package/src/components/FilterPanel/faceSelector.tsx +0 -53
- package/src/components/FilterPanel/index.tsx +0 -79
- package/src/components/FilterPanel/rangeFacet.tsx +0 -128
- package/src/components/FinancialOptions/LoanModal.tsx +0 -223
- package/src/components/FinancialOptions/index.tsx +0 -29
- package/src/components/FinancialOptions/leasing.tsx +0 -77
- package/src/components/FinancialOptions/loan.tsx +0 -87
- package/src/components/Gallery/MediaButton.tsx +0 -19
- package/src/components/Gallery/index.tsx +0 -227
- package/src/components/Gallery/wrapper.tsx +0 -323
- package/src/components/Grid/index.tsx +0 -87
- package/src/components/Grid/wrapper.tsx +0 -30
- package/src/components/Heading/index.tsx +0 -72
- package/src/components/Icon/index.tsx +0 -87
- package/src/components/InputCheckbox/index.tsx +0 -30
- package/src/components/InputCheckbox/wrapper.tsx +0 -87
- package/src/components/InputGroup/index.tsx +0 -24
- package/src/components/InputLabel/index.tsx +0 -14
- package/src/components/InputLabel/wrapper.tsx +0 -10
- package/src/components/InputSearch/index.tsx +0 -51
- package/src/components/InputSearch/wrapper.tsx +0 -97
- package/src/components/InputSelect/index.tsx +0 -35
- package/src/components/InputSelect/wrapper.tsx +0 -59
- package/src/components/InputText/index.tsx +0 -27
- package/src/components/InputText/wrapper.tsx +0 -57
- package/src/components/InsuranceOptions/Insurance.tsx +0 -60
- package/src/components/InsuranceOptions/InsuranceFree.tsx +0 -59
- package/src/components/InsuranceOptions/InsuranceFreeModal.tsx +0 -49
- package/src/components/InsuranceOptions/InsuranceModal.tsx +0 -253
- package/src/components/InsuranceOptions/index.tsx +0 -27
- package/src/components/Lightbox/index.tsx +0 -51
- package/src/components/Lightbox/wrapper.tsx +0 -97
- package/src/components/Loader/index.tsx +0 -18
- package/src/components/Loader/wrapper.tsx +0 -50
- package/src/components/LogoBox/index.tsx +0 -22
- package/src/components/LogoBox/wrapper.tsx +0 -19
- package/src/components/Map/index.tsx +0 -62
- package/src/components/Map/wrapper.tsx +0 -29
- package/src/components/Modal/index.tsx +0 -51
- package/src/components/Modal/wrapper.tsx +0 -127
- package/src/components/OpeningHours/index.tsx +0 -145
- package/src/components/OptionBox/index.tsx +0 -23
- package/src/components/OptionBox/wrapper.tsx +0 -56
- package/src/components/OverflowBox/index.tsx +0 -11
- package/src/components/OverflowBox/wrapper.tsx +0 -7
- package/src/components/OverflowGrid/index.tsx +0 -70
- package/src/components/Page/index.tsx +0 -46
- package/src/components/Panel/index.tsx +0 -50
- package/src/components/Panel/wrapper.tsx +0 -155
- package/src/components/Pdf/index.tsx +0 -46
- package/src/components/Pdf/wrapper.tsx +0 -61
- package/src/components/PhoneNumber/index.tsx +0 -33
- package/src/components/Portal/index.ts +0 -5
- package/src/components/Portal/portal-element.tsx +0 -9
- package/src/components/Portal/portal-namespace.ts +0 -1
- package/src/components/Portal/portal.tsx +0 -36
- package/src/components/Price/index.tsx +0 -12
- package/src/components/PriceTable/index.tsx +0 -34
- package/src/components/PriceTable/wrapper.tsx +0 -27
- package/src/components/ProductCard/index.tsx +0 -133
- package/src/components/ProductCard/wrapper.tsx +0 -147
- package/src/components/ProductPage/index.tsx +0 -99
- package/src/components/ProgressBar/index.tsx +0 -31
- package/src/components/ProgressBar/wrapper.tsx +0 -29
- package/src/components/RangeSlider/RangeSliderSimple.tsx +0 -90
- package/src/components/RangeSlider/SliderWithLabel.tsx +0 -62
- package/src/components/RangeSlider/handle.tsx +0 -26
- package/src/components/RangeSlider/index.tsx +0 -132
- package/src/components/RangeSlider/track.tsx +0 -19
- package/src/components/RangeSlider/wrapper.tsx +0 -93
- package/src/components/RangeSliderLabel/index.tsx +0 -18
- package/src/components/RangeSliderLabel/wrapper.tsx +0 -33
- package/src/components/Repeat/index.tsx +0 -21
- package/src/components/Result/index.tsx +0 -91
- package/src/components/Result/wrapper.tsx +0 -39
- package/src/components/Root/index.tsx +0 -24
- package/src/components/SearchBar/index.tsx +0 -48
- package/src/components/SearchFilter/index.tsx +0 -31
- package/src/components/SearchTerm/index.tsx +0 -23
- package/src/components/SearchTerm/wrapper.tsx +0 -71
- package/src/components/SectionHeader/index.tsx +0 -25
- package/src/components/SectionHeader/wrapper.tsx +0 -17
- package/src/components/Snackbar/index.tsx +0 -35
- package/src/components/Snackbar/wrapper.tsx +0 -65
- package/src/components/SortSelect/index.tsx +0 -35
- package/src/components/SortSelect/wrapper.tsx +0 -54
- package/src/components/Sphere/Sphere.tsx +0 -49
- package/src/components/Sphere/SphereLightbox.tsx +0 -10
- package/src/components/Sphere/SphereViewer.tsx +0 -81
- package/src/components/Sphere/wrapper.tsx +0 -253
- package/src/components/SrOnly/index.tsx +0 -14
- package/src/components/SwitchBar/index.tsx +0 -55
- package/src/components/SwitchBar/wrapper.tsx +0 -80
- package/src/components/TableColumn/index.tsx +0 -18
- package/src/components/TableList/index.tsx +0 -39
- package/src/components/Tabs/index.tsx +0 -34
- package/src/components/Tabs/wrapper.tsx +0 -82
- package/src/components/ThreeSixty/Rotation.tsx +0 -136
- package/src/components/ThreeSixty/ThreeSixtLightbox.tsx +0 -34
- package/src/components/ThreeSixty/ThreeSixty.tsx +0 -53
- package/src/components/UspList/index.tsx +0 -47
- package/src/components/UspList/wrapper.tsx +0 -92
- package/src/components/Utility/index.tsx +0 -17
- package/src/components/Video/CustomPlayer.tsx +0 -28
- package/src/components/Video/EmbeddedVideoLightbox.tsx +0 -31
- package/src/components/Video/EmbededVideo.tsx +0 -72
- package/src/components/Video/QuickNavEmbeded.tsx +0 -35
- package/src/components/Video/QuickNavVideo.tsx +0 -14
- package/src/components/Video/Video.tsx +0 -18
- package/src/components/Video/VimeoPlayer.tsx +0 -21
- package/src/components/Video/YoutubePlayer.tsx +0 -21
- package/src/components/Video/useThumbnail.ts +0 -28
- package/src/components/Video/utils.ts +0 -47
- package/src/components/Video/wrapper.tsx +0 -29
- package/src/hooks/useFetch.ts +0 -88
- package/src/hooks/useHasBeenVisible.ts +0 -17
- package/src/hooks/useHashGuid.ts +0 -33
- package/src/hooks/useInsurance.ts +0 -22
- package/src/hooks/useLoan.ts +0 -21
- package/src/hooks/useOnScreen.ts +0 -20
- package/src/hooks/useOutsideClick.ts +0 -19
- package/src/hooks/usePrevious.ts +0 -11
- package/src/hooks/useSearchItem.ts +0 -11
- package/src/hooks/useSearchItemBranch.ts +0 -14
- package/src/hooks/useSessionStorage.ts +0 -32
- package/src/hooks/useVimeoThumbnail.ts +0 -31
- package/src/images/map/marker.png +0 -0
- package/src/images/placeholders/staticmap.jpg +0 -0
- package/src/index-dev.tsx +0 -42
- package/src/index-esbuild.ts +0 -74
- package/src/index.ts +0 -72
- package/src/layout/helpers.tsx +0 -6
- package/src/layout/keyframes.tsx +0 -23
- package/src/layout/theme.ts +0 -60
- package/src/layouts/WaykeComposite.tsx +0 -64
- package/src/layouts/WaykeCompositeWithProvider.tsx +0 -17
- package/src/layouts/search/index.tsx +0 -124
- package/src/layouts/searchItem/Branch.tsx +0 -97
- package/src/layouts/searchItem/BranchModal.tsx +0 -67
- package/src/layouts/searchItem/CheckList.tsx +0 -146
- package/src/layouts/searchItem/ManufacturerPackagesOption.tsx +0 -54
- package/src/layouts/searchItem/MetadataItem.tsx +0 -74
- package/src/layouts/searchItem/PackageOptionModal.tsx +0 -54
- package/src/layouts/searchItem/PackageOptions.tsx +0 -58
- package/src/layouts/searchItem/Page404.tsx +0 -17
- package/src/layouts/searchItem/PageLoading.tsx +0 -17
- package/src/layouts/searchItem/Property.tsx +0 -134
- package/src/layouts/searchItem/Related.tsx +0 -120
- package/src/layouts/searchItem/index.tsx +0 -342
- package/src/providers/WaykeItemProvidet.tsx +0 -63
- package/src/providers/WaykeProvider.tsx +0 -75
- package/src/providers/graphqlProvider.tsx +0 -9
- package/src/providers/themeProvider.tsx +0 -15
- package/src/queries/INSURANCE_CALCULATION.ts +0 -43
- package/src/queries/LOAN_CALCULATION.ts +0 -39
- package/src/queries/SEARCH_ITEM_BRANCH_QUERY.ts +0 -120
- package/src/queries/SEARCH_ITEM_QUERY.ts +0 -237
- package/src/utils/constants.ts +0 -34
- package/src/utils/converters.ts +0 -45
- package/src/utils/deep-copy.ts +0 -6
- package/src/utils/formats.ts +0 -83
- package/src/utils/metadata.min.ts +0 -87
- package/src/utils/phonenumbers.ts +0 -17
- package/src/utils/pubsub/Actions.ts +0 -20
- package/src/utils/pubsub/Events.ts +0 -79
- package/src/utils/pubsub/pubsub.ts +0 -151
- package/src/utils/regex.ts +0 -13
- package/src/utils/sortOptions.ts +0 -36
- package/src/utils/specification.ts +0 -581
- package/src/utils/ssn.ts +0 -1
- package/src/utils/url.ts +0 -1
- package/src/utils/vehicle-properties/compare-basic-properties.ts +0 -63
- package/src/utils/vehicle-properties/compare-categories.ts +0 -45
- package/src/utils/vehicle-properties/compare-properties.ts +0 -5
- package/src/utils/vehicle-properties/custom-property-adder.ts +0 -163
- package/src/utils/vehicle-properties/property-hint-enricher.ts +0 -230
- package/src/utils/vehicle-properties/property-remover.ts +0 -28
- package/src/utils/vehicle-properties/property-tree-creator.ts +0 -171
- package/src/utils/vehicle-properties/property-tree-sorter.ts +0 -20
- package/tsconfig.build.json +0 -10
- package/tsconfig.eslint.json +0 -11
- package/tsconfig.json +0 -18
- package/webpack.analyze.js +0 -10
- package/webpack.config.js +0 -95
|
@@ -1,323 +0,0 @@
|
|
|
1
|
-
import styled, { css } from 'styled-components';
|
|
2
|
-
|
|
3
|
-
import { size } from '../../layout/helpers';
|
|
4
|
-
import { ButtonReset } from '../Button/index';
|
|
5
|
-
import { Wrapper as Container } from '../Container/wrapper';
|
|
6
|
-
|
|
7
|
-
const quickNavWidth = 83; // 75px + 8px
|
|
8
|
-
|
|
9
|
-
export const Wrapper = styled.div`
|
|
10
|
-
${(props) => props.theme.breakpoint.LtMd} {
|
|
11
|
-
${Container} & {
|
|
12
|
-
margin-left: ${size(-3)};
|
|
13
|
-
margin-right: ${size(-3)};
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
${(props) => props.theme.breakpoint.LtSm} {
|
|
18
|
-
${Container} & {
|
|
19
|
-
margin-left: ${size(-2)};
|
|
20
|
-
margin-right: ${size(-2)};
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
${(props) => props.theme.breakpoint.Md} {
|
|
25
|
-
position: relative;
|
|
26
|
-
padding-right: ${quickNavWidth}px;
|
|
27
|
-
}
|
|
28
|
-
`;
|
|
29
|
-
|
|
30
|
-
export const Main = styled.div`
|
|
31
|
-
position: relative;
|
|
32
|
-
height: 0;
|
|
33
|
-
padding-bottom: 66.66666667%;
|
|
34
|
-
|
|
35
|
-
${(props) => props.theme.breakpoint.Md} {
|
|
36
|
-
//background-color: ${(props) => props.theme.color.accent};
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.slick-slider,
|
|
40
|
-
.slick-list,
|
|
41
|
-
.slick-track,
|
|
42
|
-
.slick-slide,
|
|
43
|
-
.slick-slide > * {
|
|
44
|
-
height: 100%;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.slick-slide > * {
|
|
48
|
-
font-size: 0;
|
|
49
|
-
|
|
50
|
-
> * {
|
|
51
|
-
font-size: 1rem;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
`;
|
|
55
|
-
|
|
56
|
-
export const Alt = styled.div`
|
|
57
|
-
position: absolute;
|
|
58
|
-
top: 0;
|
|
59
|
-
bottom: 0;
|
|
60
|
-
right: 0;
|
|
61
|
-
width: ${quickNavWidth}px;
|
|
62
|
-
padding-left: ${size(1)};
|
|
63
|
-
|
|
64
|
-
${(props) => props.theme.breakpoint.LtMd} {
|
|
65
|
-
display: none;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
:after {
|
|
69
|
-
content: '';
|
|
70
|
-
position: absolute;
|
|
71
|
-
bottom: 0;
|
|
72
|
-
left: 0;
|
|
73
|
-
right: 0;
|
|
74
|
-
height: ${size(2.5)};
|
|
75
|
-
background-image: linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
|
|
76
|
-
pointer-events: none;
|
|
77
|
-
}
|
|
78
|
-
`;
|
|
79
|
-
|
|
80
|
-
export const Item = styled.div`
|
|
81
|
-
position: relative;
|
|
82
|
-
width: 100%;
|
|
83
|
-
height: 100%;
|
|
84
|
-
overflow: hidden;
|
|
85
|
-
|
|
86
|
-
:focus {
|
|
87
|
-
outline: none;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
${(props) => props.theme.breakpoint.LtMd} {
|
|
91
|
-
//background-color: ${(props) => props.theme.color.textDark};
|
|
92
|
-
transition: border-radius 150ms ease;
|
|
93
|
-
}
|
|
94
|
-
`;
|
|
95
|
-
|
|
96
|
-
export const SliderWrapper = styled.div`
|
|
97
|
-
position: absolute;
|
|
98
|
-
top: 0;
|
|
99
|
-
bottom: 0;
|
|
100
|
-
left: 0;
|
|
101
|
-
right: 0;
|
|
102
|
-
|
|
103
|
-
.slick-slider {
|
|
104
|
-
position: absolute;
|
|
105
|
-
top: 0;
|
|
106
|
-
bottom: 0;
|
|
107
|
-
left: 0;
|
|
108
|
-
right: 0;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
${(props) => props.theme.breakpoint.LtMd} {
|
|
112
|
-
overflow: hidden;
|
|
113
|
-
|
|
114
|
-
.slick-list {
|
|
115
|
-
overflow: visible;
|
|
116
|
-
width: 95%;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.slick-slide {
|
|
120
|
-
border-right: ${size(1)} solid ${(props) => props.theme.color.bg};
|
|
121
|
-
//transform: scale(0.95);
|
|
122
|
-
transform-origin: 0 50%;
|
|
123
|
-
transition: transform 150ms ease;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
.slick-slide.slick-active {
|
|
127
|
-
transform: none;
|
|
128
|
-
|
|
129
|
-
${Item} {
|
|
130
|
-
border-top-left-radius: 0;
|
|
131
|
-
border-bottom-left-radius: 0;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
`;
|
|
136
|
-
|
|
137
|
-
export const Image = styled.img`
|
|
138
|
-
display: block;
|
|
139
|
-
position: absolute;
|
|
140
|
-
left: 0;
|
|
141
|
-
top: 0;
|
|
142
|
-
right: 0;
|
|
143
|
-
bottom: 0;
|
|
144
|
-
margin: auto;
|
|
145
|
-
max-width: 100%;
|
|
146
|
-
max-height: 100%;
|
|
147
|
-
object-fit: cover;
|
|
148
|
-
cursor: pointer;
|
|
149
|
-
`;
|
|
150
|
-
|
|
151
|
-
export const ImageFull = styled.img`
|
|
152
|
-
display: block;
|
|
153
|
-
position: absolute;
|
|
154
|
-
top: 0;
|
|
155
|
-
left: 0;
|
|
156
|
-
width: 100%;
|
|
157
|
-
height: 100%;
|
|
158
|
-
object-fit: cover;
|
|
159
|
-
`;
|
|
160
|
-
|
|
161
|
-
// Arrow Nav
|
|
162
|
-
|
|
163
|
-
const Arrow = styled(ButtonReset)`
|
|
164
|
-
position: absolute;
|
|
165
|
-
top: 50%;
|
|
166
|
-
transform: translateY(-50%);
|
|
167
|
-
display: flex;
|
|
168
|
-
align-items: center;
|
|
169
|
-
justify-content: center;
|
|
170
|
-
width: ${size(4)};
|
|
171
|
-
height: ${size(4)};
|
|
172
|
-
border-radius: 50%;
|
|
173
|
-
font-size: 1rem;
|
|
174
|
-
line-height: 1;
|
|
175
|
-
background-color: rgba(255, 255, 255, 0.4);
|
|
176
|
-
backdrop-filter: blur(5px);
|
|
177
|
-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
178
|
-
color: ${(props) => props.theme.color.textDark};
|
|
179
|
-
transform-origin: 50% 50%;
|
|
180
|
-
transition: transform 200ms ease;
|
|
181
|
-
|
|
182
|
-
:before {
|
|
183
|
-
content: '';
|
|
184
|
-
position: absolute;
|
|
185
|
-
top: 0;
|
|
186
|
-
bottom: 0;
|
|
187
|
-
left: 0;
|
|
188
|
-
right: 0;
|
|
189
|
-
border-radius: 50%;
|
|
190
|
-
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
|
|
191
|
-
opacity: 0;
|
|
192
|
-
transition: opacity 200ms ease;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
:hover {
|
|
196
|
-
:before {
|
|
197
|
-
opacity: 1;
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
:active {
|
|
202
|
-
transform: translateY(-50%) scale(0.95);
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
${(props) => props.theme.breakpoint.LtSm} {
|
|
206
|
-
display: none;
|
|
207
|
-
}
|
|
208
|
-
`;
|
|
209
|
-
|
|
210
|
-
export const ArrowLeft = styled(Arrow)`
|
|
211
|
-
left: ${size(2)};
|
|
212
|
-
`;
|
|
213
|
-
|
|
214
|
-
export const ArrowRight = styled(Arrow)`
|
|
215
|
-
right: ${size(2)};
|
|
216
|
-
`;
|
|
217
|
-
|
|
218
|
-
// Quick Nav
|
|
219
|
-
|
|
220
|
-
export const QuickNav = styled.ul`
|
|
221
|
-
position: relative;
|
|
222
|
-
max-height: 100%;
|
|
223
|
-
list-style: none;
|
|
224
|
-
padding: 0;
|
|
225
|
-
margin: 0;
|
|
226
|
-
overflow: auto;
|
|
227
|
-
-webkit-overflow-scrolling: touch;
|
|
228
|
-
`;
|
|
229
|
-
|
|
230
|
-
type QuickNavItemProps = React.DetailedHTMLProps<
|
|
231
|
-
React.HTMLAttributes<HTMLLIElement>,
|
|
232
|
-
HTMLLIElement
|
|
233
|
-
> & {
|
|
234
|
-
active?: boolean;
|
|
235
|
-
};
|
|
236
|
-
|
|
237
|
-
export const QuickNavItem = styled.li.attrs(() => ({
|
|
238
|
-
className: 'wayke__theme wayke__color--primary-text',
|
|
239
|
-
}))<QuickNavItemProps>`
|
|
240
|
-
position: relative;
|
|
241
|
-
|
|
242
|
-
& + & {
|
|
243
|
-
margin-top: ${size(1)};
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
${({ active }) =>
|
|
247
|
-
active &&
|
|
248
|
-
css`
|
|
249
|
-
:before {
|
|
250
|
-
content: '';
|
|
251
|
-
position: absolute;
|
|
252
|
-
top: 0;
|
|
253
|
-
left: 0;
|
|
254
|
-
width: 100%;
|
|
255
|
-
height: 100%;
|
|
256
|
-
border: 3px solid currentColor;
|
|
257
|
-
z-index: 2;
|
|
258
|
-
}
|
|
259
|
-
`}
|
|
260
|
-
`;
|
|
261
|
-
|
|
262
|
-
export const QuickNavBtn = styled(ButtonReset)`
|
|
263
|
-
position: relative;
|
|
264
|
-
display: block;
|
|
265
|
-
width: 100%;
|
|
266
|
-
height: 0;
|
|
267
|
-
padding-bottom: 66.66666667%; // 3:2
|
|
268
|
-
transform-origin: 50% 50%;
|
|
269
|
-
transition: transform 300ms cubic-bezier(0.47, 1.64, 0.41, 0.8);
|
|
270
|
-
|
|
271
|
-
:before {
|
|
272
|
-
content: '';
|
|
273
|
-
position: absolute;
|
|
274
|
-
top: 0;
|
|
275
|
-
left: 0;
|
|
276
|
-
width: 100%;
|
|
277
|
-
height: 100%;
|
|
278
|
-
background-color: rgba(0, 0, 0, 0.15);
|
|
279
|
-
opacity: 0;
|
|
280
|
-
z-index: 1;
|
|
281
|
-
transition: opacity 150ms ease;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
:hover {
|
|
285
|
-
:before {
|
|
286
|
-
opacity: 1;
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
:active {
|
|
291
|
-
transform: scale(0.95);
|
|
292
|
-
}
|
|
293
|
-
`;
|
|
294
|
-
|
|
295
|
-
export const QuickNavImg = styled.img`
|
|
296
|
-
display: block;
|
|
297
|
-
position: absolute;
|
|
298
|
-
top: 0;
|
|
299
|
-
left: 0;
|
|
300
|
-
width: 100%;
|
|
301
|
-
height: 100%;
|
|
302
|
-
object-fit: cover;
|
|
303
|
-
`;
|
|
304
|
-
|
|
305
|
-
// Media Button
|
|
306
|
-
|
|
307
|
-
export const MediaButtonWrapper = styled.div`
|
|
308
|
-
position: absolute;
|
|
309
|
-
bottom: ${size(2)};
|
|
310
|
-
left: 50%;
|
|
311
|
-
transform: translateX(-50%);
|
|
312
|
-
z-index: 1;
|
|
313
|
-
`;
|
|
314
|
-
|
|
315
|
-
// Sphere Close Button
|
|
316
|
-
|
|
317
|
-
export const EnableNavigationButton = styled.div`
|
|
318
|
-
position: absolute;
|
|
319
|
-
bottom: ${size(2)};
|
|
320
|
-
left: 50%;
|
|
321
|
-
transform: translateX(-50%);
|
|
322
|
-
z-index: 1;
|
|
323
|
-
`;
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { Wrapper, List, Item } from './wrapper';
|
|
4
|
-
import ProductCard from '../ProductCard/index';
|
|
5
|
-
import { Document } from '../../@types/search';
|
|
6
|
-
import { numberSeparator } from '../../utils/formats';
|
|
7
|
-
|
|
8
|
-
const resolveImage = (document: Document) => {
|
|
9
|
-
const img = document.featuredImage?.files?.[0]?.url;
|
|
10
|
-
if (img) {
|
|
11
|
-
return `${img}?w=567&q=72`;
|
|
12
|
-
}
|
|
13
|
-
return undefined;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
interface GridProps {
|
|
17
|
-
documents?: Document[];
|
|
18
|
-
hashRoute?: boolean;
|
|
19
|
-
pathRoute?: string;
|
|
20
|
-
placeholderImage?: string;
|
|
21
|
-
onClickItem?: (id: string) => void;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const Grid = ({ documents, placeholderImage, hashRoute, pathRoute, onClickItem }: GridProps) => {
|
|
25
|
-
if (!documents) {
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
<Wrapper>
|
|
31
|
-
<List>
|
|
32
|
-
{documents.map((document) => {
|
|
33
|
-
const _path = pathRoute?.replace(/^\/|\/$/g, '');
|
|
34
|
-
|
|
35
|
-
const prefix = _path ? `/${_path}/` : '/';
|
|
36
|
-
|
|
37
|
-
const pathRouteUrl =
|
|
38
|
-
window.location.pathname === '/'
|
|
39
|
-
? `${prefix}${document._id}`
|
|
40
|
-
: `${window.location.pathname}${prefix}${document._id}`;
|
|
41
|
-
|
|
42
|
-
return (
|
|
43
|
-
<Item key={document._id}>
|
|
44
|
-
<ProductCard
|
|
45
|
-
id={document._id}
|
|
46
|
-
onClick={onClickItem}
|
|
47
|
-
title={document.title}
|
|
48
|
-
pathRoute={pathRoute}
|
|
49
|
-
href={pathRoute ? pathRouteUrl : hashRoute ? `#${document._id}` : undefined}
|
|
50
|
-
image={resolveImage(document)}
|
|
51
|
-
placeholderImage={placeholderImage}
|
|
52
|
-
description={document.shortDescription}
|
|
53
|
-
uspList={[
|
|
54
|
-
{
|
|
55
|
-
title: document.modelYear,
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
title: `${numberSeparator(document.mileage)} mil`,
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
title: document.gearboxType,
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
title: document.fuelType,
|
|
65
|
-
},
|
|
66
|
-
]}
|
|
67
|
-
price={`${numberSeparator(document.price)} kr`}
|
|
68
|
-
leasingPrice={
|
|
69
|
-
document.leasingPrice !== undefined
|
|
70
|
-
? `${numberSeparator(document.leasingPrice)} kr`
|
|
71
|
-
: undefined
|
|
72
|
-
}
|
|
73
|
-
oldPrice={
|
|
74
|
-
document.oldPrice !== undefined && document.price < document.oldPrice
|
|
75
|
-
? `${numberSeparator(document.oldPrice)} kr`
|
|
76
|
-
: undefined
|
|
77
|
-
}
|
|
78
|
-
/>
|
|
79
|
-
</Item>
|
|
80
|
-
);
|
|
81
|
-
})}
|
|
82
|
-
</List>
|
|
83
|
-
</Wrapper>
|
|
84
|
-
);
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
export default Grid;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
|
|
3
|
-
import { size } from '../../layout/helpers';
|
|
4
|
-
|
|
5
|
-
export const Wrapper = styled.div``;
|
|
6
|
-
|
|
7
|
-
export const List = styled.ul`
|
|
8
|
-
display: flex;
|
|
9
|
-
flex-wrap: wrap;
|
|
10
|
-
list-style: none;
|
|
11
|
-
padding: 0;
|
|
12
|
-
margin: ${size(-2)} ${size(-1)};
|
|
13
|
-
`;
|
|
14
|
-
|
|
15
|
-
export const Item = styled.li`
|
|
16
|
-
flex: 1 1 auto;
|
|
17
|
-
width: 100%;
|
|
18
|
-
max-width: 100%;
|
|
19
|
-
padding: ${size(2)} ${size(1)};
|
|
20
|
-
|
|
21
|
-
${(props) => props.theme.breakpoint.Sm} {
|
|
22
|
-
width: 50%;
|
|
23
|
-
max-width: 50%;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
${(props) => props.theme.breakpoint.Md} {
|
|
27
|
-
width: 33.333%;
|
|
28
|
-
max-width: 33.333%;
|
|
29
|
-
}
|
|
30
|
-
`;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import styled, { css } from 'styled-components';
|
|
3
|
-
|
|
4
|
-
import { size } from '../../layout/helpers';
|
|
5
|
-
|
|
6
|
-
type HeadingBaseProps = React.DetailedHTMLProps<
|
|
7
|
-
React.HTMLAttributes<HTMLDivElement>,
|
|
8
|
-
HTMLDivElement
|
|
9
|
-
> & {
|
|
10
|
-
noMargin?: boolean;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const HeadingBase = styled.div.attrs(() => ({
|
|
14
|
-
className: 'wayke__theme wayke__font--bold',
|
|
15
|
-
}))<HeadingBaseProps>`
|
|
16
|
-
margin-top: 0;
|
|
17
|
-
margin-bottom: ${size(2)};
|
|
18
|
-
font-weight: normal;
|
|
19
|
-
line-height: 1.2;
|
|
20
|
-
|
|
21
|
-
${({ noMargin }) =>
|
|
22
|
-
noMargin &&
|
|
23
|
-
css`
|
|
24
|
-
margin-bottom: 0;
|
|
25
|
-
`}
|
|
26
|
-
`;
|
|
27
|
-
|
|
28
|
-
export const H1 = styled(HeadingBase).attrs<{ as: string }>((props) => ({
|
|
29
|
-
as: props.as || 'h1',
|
|
30
|
-
}))`
|
|
31
|
-
font-size: 1.875rem;
|
|
32
|
-
`;
|
|
33
|
-
|
|
34
|
-
export const H2 = styled(HeadingBase).attrs<{ as: string }>((props) => ({
|
|
35
|
-
as: props.as || 'h2',
|
|
36
|
-
}))`
|
|
37
|
-
font-size: 1.5rem;
|
|
38
|
-
`;
|
|
39
|
-
|
|
40
|
-
/*
|
|
41
|
-
export const H3 = styled(HeadingBase).attrs<{ as: string }>((props) => ({
|
|
42
|
-
as: props.as || 'h3',
|
|
43
|
-
}))`
|
|
44
|
-
font-size: 1.125rem;
|
|
45
|
-
`;
|
|
46
|
-
*/
|
|
47
|
-
|
|
48
|
-
export const H4 = styled(HeadingBase).attrs<{ as: string }>((props) => ({
|
|
49
|
-
as: props.as || 'h4',
|
|
50
|
-
}))`
|
|
51
|
-
font-size: 1rem;
|
|
52
|
-
`;
|
|
53
|
-
|
|
54
|
-
export const H5 = styled(HeadingBase).attrs<{ as: string }>((props) => ({
|
|
55
|
-
as: props.as || 'h5',
|
|
56
|
-
}))`
|
|
57
|
-
font-size: 0.875rem;
|
|
58
|
-
`;
|
|
59
|
-
|
|
60
|
-
/*
|
|
61
|
-
export const H6 = styled(HeadingBase).attrs<{ as: string }>((props) => ({
|
|
62
|
-
as: props.as || 'h6',
|
|
63
|
-
}))`
|
|
64
|
-
font-size: 0.67rem;
|
|
65
|
-
`;
|
|
66
|
-
*/
|
|
67
|
-
|
|
68
|
-
export const VisualHeading = styled.div.attrs(() => ({
|
|
69
|
-
className: 'wayke__theme wayke__font--bold',
|
|
70
|
-
}))`
|
|
71
|
-
font-size: 1em;
|
|
72
|
-
`;
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import styled, { css } from 'styled-components';
|
|
3
|
-
|
|
4
|
-
type SharedIconProps = {
|
|
5
|
-
block?: boolean;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
type IconProps = React.SVGProps<SVGSVGElement> & SharedIconProps;
|
|
9
|
-
|
|
10
|
-
const Icon = styled.svg.attrs(() => ({
|
|
11
|
-
xmlns: 'http://www.w3.org/2000/svg',
|
|
12
|
-
}))<IconProps>`
|
|
13
|
-
display: inline-block;
|
|
14
|
-
vertical-align: middle;
|
|
15
|
-
width: 1em;
|
|
16
|
-
height: 1em;
|
|
17
|
-
fill: currentColor;
|
|
18
|
-
|
|
19
|
-
${({ block }) =>
|
|
20
|
-
block &&
|
|
21
|
-
css`
|
|
22
|
-
display: block;
|
|
23
|
-
`}
|
|
24
|
-
`;
|
|
25
|
-
|
|
26
|
-
type IconInfoProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> &
|
|
27
|
-
SharedIconProps;
|
|
28
|
-
|
|
29
|
-
export const IconInfo = ({ block }: IconInfoProps) => (
|
|
30
|
-
<Icon viewBox="0 0 24 24" block={block}>
|
|
31
|
-
<path d="M12 0C5.371 0 0 5.371 0 12s5.371 12 12 12 12-5.371 12-12S18.629 0 12 0zm0 2c5.5234 0 10 4.4766 10 10s-4.4766 10-10 10S2 17.5234 2 12 6.4766 2 12 2zm0 3.8125c-.1836 0-.336-.004-.5.0313-.164.0351-.3164.125-.4375.2187-.121.0938-.211.2227-.2813.375s-.0937.332-.0937.5625c0 .2266.0234.4063.0938.5625.0703.1563.1601.2813.2812.375.121.0938.2734.1484.4375.1875.164.039.3164.0625.5.0625.1797 0 .371-.0234.5313-.0625.1601-.039.2851-.0938.4062-.1875.121-.0938.211-.2188.2813-.375.0703-.1523.125-.336.125-.5625 0-.2305-.0547-.4102-.125-.5625-.0704-.1523-.1602-.2813-.2813-.375-.121-.0938-.246-.1836-.4063-.2188-.1601-.0351-.3515-.0312-.5312-.0312zm-1.2188 3.3438v8.9687h2.4375V9.1562z" />
|
|
32
|
-
</Icon>
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
export const IconCancel = ({ block }: IconInfoProps) => (
|
|
36
|
-
<Icon viewBox="0 0 16 16" block={block}>
|
|
37
|
-
<path d="M15.7 14.3c.4.4.4 1 0 1.4-.2.2-.5.3-.7.3s-.5-.1-.7-.3L8 9.4l-6.3 6.3c-.2.2-.4.3-.7.3s-.5-.1-.7-.3c-.4-.4-.4-1 0-1.4L6.6 8 .3 1.7C-.1 1.3-.1.7.3.3c.4-.4 1-.4 1.4 0L8 6.6 14.3.3c.4-.4 1-.4 1.4 0 .4.4.4 1 0 1.4L9.4 8l6.3 6.3z" />
|
|
38
|
-
</Icon>
|
|
39
|
-
);
|
|
40
|
-
|
|
41
|
-
export const IconChevronDown = ({ block }: IconInfoProps) => (
|
|
42
|
-
<Icon viewBox="0 0 18 18" block={block}>
|
|
43
|
-
<path d="M17.7 5L9 13.7.3 5l.7-.7 8 8 8-8 .7.7z" />
|
|
44
|
-
</Icon>
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
export const IconChevronLeft = ({ block }: IconInfoProps) => (
|
|
48
|
-
<Icon viewBox="0 0 18 18" block={block}>
|
|
49
|
-
<path d="M13 17.7L4.3 9 13 .3l.7.7-8 8 8 8-.7.7z" />
|
|
50
|
-
</Icon>
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
export const IconChevronRight = ({ block }: IconInfoProps) => (
|
|
54
|
-
<Icon viewBox="0 0 18 18" block={block}>
|
|
55
|
-
<path d="M5 .3L13.7 9 5 17.7l-.7-.7 8-8-8-8L5 .3z" />
|
|
56
|
-
</Icon>
|
|
57
|
-
);
|
|
58
|
-
|
|
59
|
-
export const IconCheck = ({ block }: IconInfoProps) => (
|
|
60
|
-
<Icon viewBox="0 0 16 16" block={block}>
|
|
61
|
-
<path d="M15.6 4.3l-9.3 9.4c-.5.5-1.4.5-1.9 0l-4-4c-.5-.5-.5-1.4 0-1.9s1.3-.5 1.9 0l3.1 3.1 8.4-8.5c.5-.5 1.4-.5 1.9 0s.4 1.3-.1 1.9z" />
|
|
62
|
-
</Icon>
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
export const IconRadio = ({ block }: IconInfoProps) => (
|
|
66
|
-
<Icon viewBox="0 0 16 16" block={block}>
|
|
67
|
-
<path d="M13 8c0 2.8-2.2 5-5 5s-5-2.2-5-5 2.2-5 5-5 5 2.2 5 5zm3 0c0 4.4-3.6 8-8 8s-8-3.6-8-8 3.6-8 8-8 8 3.6 8 8zm-1 0c0-3.9-3.1-7-7-7S1 4.1 1 8s3.1 7 7 7 7-3.1 7-7z" />
|
|
68
|
-
</Icon>
|
|
69
|
-
);
|
|
70
|
-
|
|
71
|
-
export const IconSearch = ({ block }: IconInfoProps) => (
|
|
72
|
-
<Icon viewBox="0 0 16 16" block={block}>
|
|
73
|
-
<path d="M15.5 15.3L11 10.8c1.2-1.1 2-2.7 2-4.5C13 2.9 10.2.1 6.8.1S.5 2.8.5 6.2s2.8 6.2 6.2 6.2c1.3 0 2.5-.4 3.5-1.1l4.6 4.6.7-.6zM1.4 6.2C1.4 3.3 3.8 1 6.7 1S12 3.3 12 6.2c0 1.5-.7 2.9-1.7 3.9l-.7.5c-.8.5-1.8.8-2.8.8-3 .1-5.4-2.3-5.4-5.2z" />
|
|
74
|
-
</Icon>
|
|
75
|
-
);
|
|
76
|
-
|
|
77
|
-
export const IconExclamationCircle = ({ block }: IconInfoProps) => (
|
|
78
|
-
<Icon viewBox="0 0 32 32" block={block}>
|
|
79
|
-
<path d="M14.482 21.893c0-0.857 0.694-1.551 1.551-1.551s1.551 0.694 1.551 1.551c0 0.857-0.694 1.551-1.551 1.551s-1.551-0.694-1.551-1.551zM16.033 2.838c-7.271 0-13.187 5.916-13.187 13.187s5.916 13.187 13.187 13.187 13.187-5.916 13.187-13.187c0-7.271-5.916-13.187-13.187-13.187zM16.033 27.203c-6.163 0-11.178-5.015-11.178-11.178s5.015-11.178 11.178-11.178c6.164 0 11.178 5.015 11.178 11.178s-5.014 11.178-11.178 11.178zM16.033 8.308c-0.555 0-1.004 0.45-1.004 1.004v8.227c0 0.555 0.45 1.004 1.004 1.004s1.004-0.45 1.004-1.004v-8.227c0-0.555-0.45-1.004-1.004-1.004z" />
|
|
80
|
-
</Icon>
|
|
81
|
-
);
|
|
82
|
-
|
|
83
|
-
export const IconExclamationTriangle = ({ block }: IconInfoProps) => (
|
|
84
|
-
<Icon viewBox="0 0 32 32" block={block}>
|
|
85
|
-
<path d="M15.951 19.663c-0.457 0-0.828-0.37-0.828-0.828v-4.357c0-0.457 0.37-0.828 0.828-0.828s0.828 0.37 0.828 0.828v4.357c0 0.457-0.371 0.828-0.828 0.828zM15.952 22.906c-0.305 0-0.606-0.126-0.821-0.341s-0.338-0.514-0.338-0.818 0.122-0.606 0.338-0.821c0.431-0.43 1.209-0.43 1.639 0 0.215 0.215 0.341 0.516 0.341 0.821s-0.126 0.603-0.341 0.818c-0.215 0.215-0.513 0.341-0.818 0.341zM27.049 27.070h-22.196c-0.352 0-0.677-0.186-0.855-0.489s-0.184-0.677-0.014-0.985l11.098-20.105c0.175-0.317 0.508-0.513 0.87-0.513s0.695 0.197 0.87 0.513l11.098 20.105c0.17 0.308 0.165 0.683-0.014 0.985s-0.504 0.489-0.856 0.489zM6.536 25.083h18.83l-9.415-17.056-9.415 17.056z" />
|
|
86
|
-
</Icon>
|
|
87
|
-
);
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
import { Input, Label, LabelText, Wrapper } from './wrapper';
|
|
4
|
-
|
|
5
|
-
type Props = React.DetailedHTMLProps<
|
|
6
|
-
React.InputHTMLAttributes<HTMLInputElement>,
|
|
7
|
-
HTMLInputElement
|
|
8
|
-
> & {
|
|
9
|
-
id: string;
|
|
10
|
-
children: React.ReactNode;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const InputCheckbox = ({ children, ...props }: Props) => {
|
|
14
|
-
const { id } = props;
|
|
15
|
-
return (
|
|
16
|
-
<Wrapper aria-labelledby={id ? `${id}-label` : undefined}>
|
|
17
|
-
<Input
|
|
18
|
-
{...(props as React.DetailedHTMLProps<
|
|
19
|
-
React.InputHTMLAttributes<HTMLInputElement>,
|
|
20
|
-
HTMLInputElement
|
|
21
|
-
>)}
|
|
22
|
-
/>
|
|
23
|
-
<Label id={`${id}-label`} htmlFor={id}>
|
|
24
|
-
<LabelText>{children}</LabelText>
|
|
25
|
-
</Label>
|
|
26
|
-
</Wrapper>
|
|
27
|
-
);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export default InputCheckbox;
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import styled, { css } from 'styled-components';
|
|
3
|
-
|
|
4
|
-
import { size } from '../../layout/helpers';
|
|
5
|
-
|
|
6
|
-
export const Label = styled.label.attrs(() => ({
|
|
7
|
-
className: 'wayke__theme wayke__color--primary-text',
|
|
8
|
-
}))`
|
|
9
|
-
position: relative;
|
|
10
|
-
display: flex;
|
|
11
|
-
align-items: flex-start;
|
|
12
|
-
font-size: 1rem;
|
|
13
|
-
line-height: 1.2;
|
|
14
|
-
cursor: pointer;
|
|
15
|
-
|
|
16
|
-
:before {
|
|
17
|
-
content: '';
|
|
18
|
-
display: flex;
|
|
19
|
-
align-items: center;
|
|
20
|
-
justify-content: center;
|
|
21
|
-
flex-shrink: 0;
|
|
22
|
-
width: ${size(2.5)};
|
|
23
|
-
height: ${size(2.5)};
|
|
24
|
-
margin-right: ${size(1)};
|
|
25
|
-
background-color: ${(props) => props.theme.color.accent};
|
|
26
|
-
color: currentColor;
|
|
27
|
-
border: none;
|
|
28
|
-
box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.07);
|
|
29
|
-
text-align: center;
|
|
30
|
-
font-size: 15px;
|
|
31
|
-
cursor: pointer;
|
|
32
|
-
border-radius: 3px;
|
|
33
|
-
margin-top: -2px;
|
|
34
|
-
}
|
|
35
|
-
`;
|
|
36
|
-
|
|
37
|
-
export const Wrapper = styled((props) => <div {...props} />).attrs(({ type, checked }) => ({
|
|
38
|
-
role: type || 'checkbox',
|
|
39
|
-
'aria-checked': checked,
|
|
40
|
-
}))`
|
|
41
|
-
${({ error }) =>
|
|
42
|
-
error &&
|
|
43
|
-
css`
|
|
44
|
-
${Label} {
|
|
45
|
-
color: ${(props) => props.theme.color.ui.negative};
|
|
46
|
-
|
|
47
|
-
:before {
|
|
48
|
-
background-color: ${(props) => props.theme.color.ui.negativeLight};
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
`}
|
|
52
|
-
`;
|
|
53
|
-
|
|
54
|
-
export const Input = styled((props) => (
|
|
55
|
-
<input {...props} className={`${props.checked ? 'checked' : undefined} ${props.className}`} />
|
|
56
|
-
)).attrs(({ type, checked }) => ({
|
|
57
|
-
checked,
|
|
58
|
-
type: type || 'checkbox',
|
|
59
|
-
}))`
|
|
60
|
-
position: fixed;
|
|
61
|
-
left: -9999px;
|
|
62
|
-
opacity: 0;
|
|
63
|
-
|
|
64
|
-
&[disabled] {
|
|
65
|
-
& + ${Label} {
|
|
66
|
-
color: ${(props) => props.theme.color.disabledText};
|
|
67
|
-
|
|
68
|
-
&:before {
|
|
69
|
-
background-color: ${(props) => props.theme.color.disabledBg};
|
|
70
|
-
cursor: not-allowed;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
&:checked,
|
|
76
|
-
&.checked {
|
|
77
|
-
& + ${Label} {
|
|
78
|
-
:before {
|
|
79
|
-
content: '✓';
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
`;
|
|
84
|
-
|
|
85
|
-
export const LabelText = styled.div`
|
|
86
|
-
color: ${(props) => props.theme.color.textDark};
|
|
87
|
-
`;
|