@kvdbil/components 14.1.0 → 14.1.1
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/cjs/components/Hero/index.js +9 -15
- package/esm/components/Hero/index.js +18 -24
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("styled-components"),n=require("../../typography/Heading/index.js"),i=require("../../shared/media-queries.js");function
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("styled-components"),n=require("../../typography/Heading/index.js"),i=require("../../shared/media-queries.js");function a(v){return v&&typeof v=="object"&&"default"in v?v:{default:v}}var r=a(e),o=a(t);const l=o.default.div`
|
|
2
2
|
position: relative;
|
|
3
3
|
min-height: 440px;
|
|
4
4
|
display: flex;
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
|
|
15
15
|
100% {
|
|
16
16
|
background-color:#f5f5f5;
|
|
17
|
-
}`,
|
|
17
|
+
}`,s=o.default.div`
|
|
18
18
|
width: 100%;
|
|
19
19
|
height: 440px;
|
|
20
20
|
animation: ${d} 2s linear infinite;
|
|
21
|
-
|
|
21
|
+
`,u=o.default.div`
|
|
22
22
|
pointer-events: ${({$pointerEvents:v})=>v};
|
|
23
23
|
display: flex;
|
|
24
24
|
flex-direction: ${({$direction:v})=>v};
|
|
@@ -27,25 +27,24 @@
|
|
|
27
27
|
padding: 3rem 1.5rem;
|
|
28
28
|
z-index: 1;
|
|
29
29
|
flex: 1;
|
|
30
|
-
`,
|
|
30
|
+
`,c=o.default.iframe`
|
|
31
31
|
position: absolute;
|
|
32
32
|
width: 100%;
|
|
33
33
|
height: 100%;
|
|
34
34
|
top: 0;
|
|
35
35
|
left: 0;
|
|
36
|
-
|
|
36
|
+
`,$=v=>typeof v=="number",f=v=>typeof v=="string",m=o.default.div`
|
|
37
37
|
width: 100%;
|
|
38
38
|
min-height: 440px;
|
|
39
39
|
display: flex;
|
|
40
40
|
flex-direction: column;
|
|
41
|
-
|
|
42
|
-
${({$centered:v})=>v&&"justify-content: center;"}
|
|
41
|
+
justify-content: center;
|
|
43
42
|
|
|
44
43
|
${({$url:v,...w})=>v&&`
|
|
45
44
|
background: url('${v}');
|
|
46
45
|
background-repeat: no-repeat;
|
|
47
46
|
background-size: cover;
|
|
48
|
-
background-position: ${(({$positionX:b,$positionY:k})
|
|
47
|
+
background-position: ${(({$positionX:b,$positionY:k})=>$(b)&&$(k)?`${b}% ${k}%`:f(b)&&f(k)?`${b} ${k}`:b||k?`${($(b)?`${b}%`:b)||"50%"} ${($(k)?`${k}%`:k)||"50%"}`:"50% 50%")(w)};
|
|
49
48
|
`}
|
|
50
49
|
`,p=o.default.div`
|
|
51
50
|
padding-left: 1rem;
|
|
@@ -56,8 +55,7 @@
|
|
|
56
55
|
padding-right: 1.5rem;
|
|
57
56
|
}
|
|
58
57
|
`,g=o.default.div`
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
|
|
61
59
|
${({$centered:v})=>v&&`
|
|
62
60
|
display: flex;
|
|
63
61
|
flex-direction: column;
|
|
@@ -83,10 +81,6 @@
|
|
|
83
81
|
margin-right: ${v.laptopVw}vw;
|
|
84
82
|
}
|
|
85
83
|
`}
|
|
86
|
-
|
|
87
|
-
${i.mq("laptop")} {
|
|
88
|
-
${({$centered:v})=>!v&&"margin-top: 3.75rem;"}
|
|
89
|
-
}
|
|
90
84
|
`,h=o.default(n.Display3)`
|
|
91
85
|
margin: 0;
|
|
92
86
|
color: ${({$color:v,theme:w})=>w.colors.text[v]};
|
|
@@ -102,4 +96,4 @@
|
|
|
102
96
|
margin-top: 3rem;
|
|
103
97
|
|
|
104
98
|
${({$shadow:v,theme:w})=>v&&`box-shadow: ${w.elevations.elevation8};`}
|
|
105
|
-
`;exports.colorAnimation=d,exports.default=({imageProps:v,videoProps:w,children:b,align:k,direction:
|
|
99
|
+
`;exports.colorAnimation=d,exports.default=({imageProps:v,videoProps:w,children:b,align:k,direction:P,justify:S,contentMaxWidth:W=64,heading:E,headingColor:V="dark",subheading:j,button:q,dynamicGutter:z,isLoading:I=!1,contentCentered:M=!1,containerStyle:X,elementShadow:G=!1})=>{const{autoplay:Y=0,controls:_=0,disablekb:A=0,end:C,loop:B=0,modestbranding:D=1,start:F=0,showInfo:H=0}=(w==null?void 0:w.ytConfig)||{};return I?r.default.createElement(s,{"data-testid":"loader"}):r.default.createElement(l,{style:X},w?r.default.createElement(c,{"data-testid":"hero-video",title:"video-frame",src:`${w.src}?disabledkb=${A}&autoplay=${Y}&controls=${_}&loop=${B}&modestbranding=${D}&start=${F}&showInfo=${H}${C?`&end=${C}`:""}`,width:"100%",height:"100%",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}):r.default.createElement(m,{"data-testid":"hero-image",$positionX:v==null?void 0:v.x,$positionY:v==null?void 0:v.y,$url:v==null?void 0:v.src},r.default.createElement(p,null,(E||j||q)&&r.default.createElement(g,{$maxWidth:W,$dynamicGutter:z,$centered:M},E&&r.default.createElement(h,{as:"h1",$color:V,$shadow:G},E),j&&r.default.createElement(x,{$color:V,$shadow:G},j),q&&r.default.createElement(y,{$shadow:G},q)),b&&r.default.createElement(u,{$pointerEvents:w?"none":"auto",$align:k||"flex-start",$direction:P||"column",$justify:S||"flex-start"},b))))};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import r from"react";import
|
|
1
|
+
import r from"react";import n,{keyframes as I}from"styled-components";import{Display3 as W,Title as q}from"../../typography/Heading/index.js";import{mq as m}from"../../shared/media-queries.js";const z=n.div`
|
|
2
2
|
position: relative;
|
|
3
3
|
min-height: 440px;
|
|
4
4
|
display: flex;
|
|
5
5
|
flex-direction: column;
|
|
6
|
-
`,
|
|
6
|
+
`,u=I`
|
|
7
7
|
0% {
|
|
8
8
|
background-color:#f5f5f5;
|
|
9
9
|
}
|
|
@@ -14,11 +14,11 @@ import r from"react";import a,{keyframes as I}from"styled-components";import{Dis
|
|
|
14
14
|
|
|
15
15
|
100% {
|
|
16
16
|
background-color:#f5f5f5;
|
|
17
|
-
}`,L=
|
|
17
|
+
}`,L=n.div`
|
|
18
18
|
width: 100%;
|
|
19
19
|
height: 440px;
|
|
20
|
-
animation: ${
|
|
21
|
-
`,R=
|
|
20
|
+
animation: ${u} 2s linear infinite;
|
|
21
|
+
`,R=n.div`
|
|
22
22
|
pointer-events: ${({$pointerEvents:e})=>e};
|
|
23
23
|
display: flex;
|
|
24
24
|
flex-direction: ${({$direction:e})=>e};
|
|
@@ -27,19 +27,18 @@ import r from"react";import a,{keyframes as I}from"styled-components";import{Dis
|
|
|
27
27
|
padding: 3rem 1.5rem;
|
|
28
28
|
z-index: 1;
|
|
29
29
|
flex: 1;
|
|
30
|
-
`,_=
|
|
30
|
+
`,_=n.iframe`
|
|
31
31
|
position: absolute;
|
|
32
32
|
width: 100%;
|
|
33
33
|
height: 100%;
|
|
34
34
|
top: 0;
|
|
35
35
|
left: 0;
|
|
36
|
-
`,
|
|
36
|
+
`,o=e=>typeof e=="number",$=e=>typeof e=="string",A=({$positionX:e,$positionY:t})=>{if(o(e)&&o(t))return`${e}% ${t}%`;if($(e)&&$(t))return`${e} ${t}`;if(e||t){const a=o(e)?`${e}%`:e,l=o(t)?`${t}%`:t;return`${a||"50%"} ${l||"50%"}`}return"50% 50%"},D=n.div`
|
|
37
37
|
width: 100%;
|
|
38
38
|
min-height: 440px;
|
|
39
39
|
display: flex;
|
|
40
40
|
flex-direction: column;
|
|
41
|
-
|
|
42
|
-
${({$centered:e})=>e&&"justify-content: center;"}
|
|
41
|
+
justify-content: center;
|
|
43
42
|
|
|
44
43
|
${({$url:e,...t})=>e&&`
|
|
45
44
|
background: url('${e}');
|
|
@@ -47,17 +46,16 @@ import r from"react";import a,{keyframes as I}from"styled-components";import{Dis
|
|
|
47
46
|
background-size: cover;
|
|
48
47
|
background-position: ${A(t)};
|
|
49
48
|
`}
|
|
50
|
-
`,F=
|
|
49
|
+
`,F=n.div`
|
|
51
50
|
padding-left: 1rem;
|
|
52
51
|
padding-right: 1rem;
|
|
53
52
|
|
|
54
|
-
${
|
|
53
|
+
${m("tablet")} {
|
|
55
54
|
padding-left: 1.5rem;
|
|
56
55
|
padding-right: 1.5rem;
|
|
57
56
|
}
|
|
58
|
-
`,N=
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
`,N=n.div`
|
|
58
|
+
|
|
61
59
|
${({$centered:e})=>e&&`
|
|
62
60
|
display: flex;
|
|
63
61
|
flex-direction: column;
|
|
@@ -73,33 +71,29 @@ import r from"react";import a,{keyframes as I}from"styled-components";import{Dis
|
|
|
73
71
|
`}
|
|
74
72
|
|
|
75
73
|
${({$dynamicGutter:e})=>e&&`
|
|
76
|
-
${
|
|
74
|
+
${m("tablet")} {
|
|
77
75
|
margin-left: ${e.tabletVw}vw;
|
|
78
76
|
margin-right: ${e.tabletVw}vw;
|
|
79
77
|
}
|
|
80
78
|
|
|
81
|
-
${
|
|
79
|
+
${m("laptop")} {
|
|
82
80
|
margin-left: ${e.laptopVw}vw;
|
|
83
81
|
margin-right: ${e.laptopVw}vw;
|
|
84
82
|
}
|
|
85
83
|
`}
|
|
86
|
-
|
|
87
|
-
${o("laptop")} {
|
|
88
|
-
${({$centered:e})=>!e&&"margin-top: 3.75rem;"}
|
|
89
|
-
}
|
|
90
|
-
`,O=a(W)`
|
|
84
|
+
`,O=n(W)`
|
|
91
85
|
margin: 0;
|
|
92
86
|
color: ${({$color:e,theme:t})=>t.colors.text[e]};
|
|
93
87
|
|
|
94
88
|
${({$shadow:e})=>e&&"text-shadow: 4px 4px 6px rgba(0, 0, 0, 0.2);"}
|
|
95
|
-
`,S=
|
|
89
|
+
`,S=n(q)`
|
|
96
90
|
margin: 0.25rem 0;
|
|
97
91
|
color: ${({$color:e,theme:t})=>t.colors.text[e]};
|
|
98
92
|
|
|
99
93
|
${({$shadow:e})=>e&&"text-shadow: 4px 4px 6px rgba(0, 0, 0, 0.2);"}
|
|
100
|
-
`,T=
|
|
94
|
+
`,T=n.div`
|
|
101
95
|
display: inline-block;
|
|
102
96
|
margin-top: 3rem;
|
|
103
97
|
|
|
104
98
|
${({$shadow:e,theme:t})=>e&&`box-shadow: ${t.elevations.elevation8};`}
|
|
105
|
-
`,J=({imageProps:e,videoProps:t,children:
|
|
99
|
+
`,J=({imageProps:e,videoProps:t,children:a,align:l,direction:p,justify:x,contentMaxWidth:h=64,heading:i,headingColor:f="dark",subheading:c,button:d,dynamicGutter:b,isLoading:w=!1,contentCentered:v=!1,containerStyle:y,elementShadow:s=!1})=>{const{autoplay:k=0,controls:E=0,disablekb:j=0,end:g,loop:C=0,modestbranding:V=1,start:B=0,showInfo:H=0}=(t==null?void 0:t.ytConfig)||{};return w?r.createElement(L,{"data-testid":"loader"}):r.createElement(z,{style:y},t?r.createElement(_,{"data-testid":"hero-video",title:"video-frame",src:`${t.src}?disabledkb=${j}&autoplay=${k}&controls=${E}&loop=${C}&modestbranding=${V}&start=${B}&showInfo=${H}${g?`&end=${g}`:""}`,width:"100%",height:"100%",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}):r.createElement(D,{"data-testid":"hero-image",$positionX:e==null?void 0:e.x,$positionY:e==null?void 0:e.y,$url:e==null?void 0:e.src},r.createElement(F,null,(i||c||d)&&r.createElement(N,{$maxWidth:h,$dynamicGutter:b,$centered:v},i&&r.createElement(O,{as:"h1",$color:f,$shadow:s},i),c&&r.createElement(S,{$color:f,$shadow:s},c),d&&r.createElement(T,{$shadow:s},d)),a&&r.createElement(R,{$pointerEvents:t?"none":"auto",$align:l||"flex-start",$direction:p||"column",$justify:x||"flex-start"},a))))};export{u as colorAnimation,J as default};
|