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