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