@kvdbil/components 14.1.1 → 14.2.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.
@@ -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(v){return v&&typeof v=="object"&&"default"in v?v:{default:v}}var r=a(e),o=a(t);const l=o.default.div`
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:v})=>v};
22
+ pointer-events: ${({$pointerEvents:w})=>w};
23
23
  display: flex;
24
- flex-direction: ${({$direction:v})=>v};
25
- align-items: ${({$align:v})=>v};
26
- justify-content: ${({$justify:v})=>v};
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
- `,$=v=>typeof v=="number",f=v=>typeof v=="string",m=o.default.div`
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:v,...w})=>v&&`
44
- background: url('${v}');
43
+ ${({$url:w,...b})=>w&&`
44
+ background: url('${w}');
45
45
  background-repeat: no-repeat;
46
46
  background-size: cover;
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)};
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:v,$dynamicGutter:w})=>!w&&`
66
+ ${({$maxWidth:w,$dynamicGutter:b})=>!b&&`
67
67
  width: 100%;
68
68
  margin-left: auto;
69
69
  margin-right: auto;
70
- max-width: ${v}rem;
70
+ max-width: ${w}rem;
71
71
  `}
72
72
 
73
- ${({$dynamicGutter:v})=>v&&`
73
+ ${({$dynamicGutter:w})=>w&&`
74
74
  ${i.mq("tablet")} {
75
- margin-left: ${v.tabletVw}vw;
76
- margin-right: ${v.tabletVw}vw;
75
+ margin-left: ${w.tabletVw}vw;
76
+ margin-right: ${w.tabletVw}vw;
77
77
  }
78
78
 
79
79
  ${i.mq("laptop")} {
80
- margin-left: ${v.laptopVw}vw;
81
- margin-right: ${v.laptopVw}vw;
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:v,theme:w})=>w.colors.text[v]};
86
+ color: ${({$color:w,theme:b})=>b.colors.text[w]};
87
87
 
88
- ${({$shadow:v})=>v&&"text-shadow: 4px 4px 6px rgba(0, 0, 0, 0.2);"}
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:v,theme:w})=>w.colors.text[v]};
91
+ color: ${({$color:w,theme:b})=>b.colors.text[w]};
92
92
 
93
- ${({$shadow:v})=>v&&"text-shadow: 4px 4px 6px rgba(0, 0, 0, 0.2);"}
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:v,theme:w})=>v&&`box-shadow: ${w.elevations.elevation8};`}
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))))};
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 m}from"../../shared/media-queries.js";const z=n.div`
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
- `,u=I`
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
- }`,L=n.div`
17
+ }`,R=n.div`
18
18
  width: 100%;
19
19
  height: 440px;
20
- animation: ${u} 2s linear infinite;
21
- `,R=n.div`
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
- `,_=n.iframe`
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
- `,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`
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: ${A(t)};
47
+ background-position: ${D(t)};
48
48
  `}
49
- `,F=n.div`
49
+ `,N=n.div`
50
50
  padding-left: 1rem;
51
51
  padding-right: 1rem;
52
+ z-index: 2;
52
53
 
53
- ${m("tablet")} {
54
+ ${f("tablet")} {
54
55
  padding-left: 1.5rem;
55
56
  padding-right: 1.5rem;
56
57
  }
57
- `,N=n.div`
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
- ${m("tablet")} {
74
+ ${f("tablet")} {
75
75
  margin-left: ${e.tabletVw}vw;
76
76
  margin-right: ${e.tabletVw}vw;
77
77
  }
78
78
 
79
- ${m("laptop")} {
79
+ ${f("laptop")} {
80
80
  margin-left: ${e.laptopVw}vw;
81
81
  margin-right: ${e.laptopVw}vw;
82
82
  }
83
83
  `}
84
- `,O=n(W)`
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
- `,S=n(q)`
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
- `,T=n.div`
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
- `,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};
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kvdbil/components",
3
- "version": "14.1.1",
3
+ "version": "14.2.1",
4
4
  "sideEffects": false,
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",
@@ -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;