@kvdbil/components 11.10.2 → 12.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.
- package/cjs/components/Dialog/index.js +6 -24
- package/cjs/components/Hero/index.js +17 -10
- package/cjs/components/Modal/index.js +5 -5
- package/esm/components/Dialog/index.js +6 -24
- package/esm/components/Hero/index.js +40 -33
- package/esm/components/Modal/index.js +11 -11
- package/package.json +1 -1
- package/types/components/Dialog/index.d.ts +5 -14
- package/types/components/Hero/index.d.ts +2 -1
- package/types/components/Modal/index.d.ts +2 -1
|
@@ -1,27 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("styled-components"),r=require("
|
|
2
|
-
|
|
3
|
-
`,d=u.default.div`
|
|
4
|
-
top: 20px;
|
|
5
|
-
left: 32px;
|
|
6
|
-
position: absolute;
|
|
7
|
-
`,c=u.default(i.TinyTitleBold)`
|
|
8
|
-
font-weight: ${({theme:x})=>x.typography.fontAlternativeRegularWeight};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("styled-components"),r=require("../Modal/index.js"),l=require("../../theme.js"),i=require("../../typography/Heading/index.js");function n(f){return f&&typeof f=="object"&&"default"in f?f:{default:f}}require("react-dom"),require("react-transition-group"),require("../Icons/Close.js"),require("../../shared/media-queries.js");var o=n(e),a=n(t);const u=a.default(i.TinyTitleBold)`
|
|
2
|
+
font-weight: ${l.default.typography.fontAlternativeRegularWeight};
|
|
9
3
|
margin: 0;
|
|
10
|
-
`,
|
|
4
|
+
`,d=a.default.div`
|
|
11
5
|
display: flex;
|
|
12
|
-
justify-content:
|
|
13
|
-
|
|
14
|
-
justify-content: flex-start;
|
|
15
|
-
}
|
|
6
|
+
justify-content: flex-end;
|
|
7
|
+
gap: 1rem;
|
|
16
8
|
overflow-x: hidden;
|
|
17
|
-
`,y
|
|
18
|
-
overflow-x: hidden;
|
|
19
|
-
margin-right: 2rem;
|
|
20
|
-
justify-content: center;
|
|
21
|
-
width: 100%;
|
|
22
|
-
max-width: 110px;
|
|
23
|
-
`,p=u.default(n.Button)`
|
|
24
|
-
justify-content: center;
|
|
25
|
-
width: 100%;
|
|
26
|
-
max-width: 245px;
|
|
27
|
-
`,m=({isOpen:x,title:h,children:g,modalStyles:B,titleStyles:v,primaryButtonText:w,primaryButtonStyles:E,secondaryButtonStyles:S,secondaryButtonText:b,primaryButtonAction:q,secondaryButtonAction:j,onClose:C,withPortal:T,color:A="success"})=>a.default.createElement(l.Modal,{contentStyles:B,isOpen:x,onClose:C,withPortal:T},h&&a.default.createElement(d,null,a.default.createElement(c,{style:v},h)),a.default.createElement(s,null,g),a.default.createElement(f,null,j&&a.default.createElement(y,{style:S,onClick:j,variant:"outline",color:"neutral"},b),q&&a.default.createElement(p,{style:E,onClick:q,variant:"solid",color:A},w)));exports.Dialog=m,exports.default=m;
|
|
9
|
+
`,s=({isOpen:f,title:c,children:h,actions:p,onClose:g,withPortal:y,withCloseIcon:m=!0})=>o.default.createElement(r.Modal,{onClose:g,withPortal:y,isOpen:f,withCloseIcon:m},typeof c=="string"?o.default.createElement(u,null,c):c,o.default.createElement("div",null,h),p&&o.default.createElement(d,null,p));exports.Dialog=s,exports.default=s;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("styled-components"),
|
|
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("../Button/index.js"),r=require("../../shared/media-queries.js");function o(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 a=o(e),l=o(t);const d=l.default.div`
|
|
2
2
|
position: relative;
|
|
3
3
|
min-height: 440px;
|
|
4
4
|
background-size: cover;
|
|
5
5
|
display: flex;
|
|
6
6
|
flex-direction: column;
|
|
7
|
+
${({$centered:v})=>v&&"justify-content: center;"}
|
|
7
8
|
`,u=t.keyframes`
|
|
8
9
|
0% {
|
|
9
10
|
background-color:#f5f5f5;
|
|
@@ -15,14 +16,14 @@
|
|
|
15
16
|
|
|
16
17
|
100% {
|
|
17
18
|
background-color:#f5f5f5;
|
|
18
|
-
}`,
|
|
19
|
+
}`,c=l.default.div`
|
|
19
20
|
position: absolute;
|
|
20
21
|
width: 100%;
|
|
21
22
|
height: 100%;
|
|
22
23
|
top: 0;
|
|
23
24
|
left: 0;
|
|
24
25
|
animation: ${u} 2s linear infinite;
|
|
25
|
-
`,
|
|
26
|
+
`,s=l.default.div`
|
|
26
27
|
pointer-events: ${({$pointerEvents:v})=>v};
|
|
27
28
|
position: relative;
|
|
28
29
|
display: flex;
|
|
@@ -38,14 +39,14 @@
|
|
|
38
39
|
height: 100%;
|
|
39
40
|
top: 0;
|
|
40
41
|
left: 0;
|
|
41
|
-
`,m=v=>typeof v=="number"
|
|
42
|
+
`,m=v=>typeof v=="number",$=v=>typeof v=="string",p=l.default.img`
|
|
42
43
|
position: absolute;
|
|
43
44
|
top: 0;
|
|
44
45
|
left: 0;
|
|
45
46
|
height: 100%;
|
|
46
47
|
width: 100%;
|
|
47
48
|
object-fit: cover;
|
|
48
|
-
object-position: ${({$positionX:v,$positionY:w})=>m(v)&&m(w)?`${v}% ${w}
|
|
49
|
+
object-position: ${({$positionX:v,$positionY:w})=>m(v)&&m(w)?`${v}% ${w}%`:$(v)&&$(w)?`${v} ${w}`:v||w?`${(m(v)?`${v}%`:v)||"50%"} ${(m(w)?`${w}%`:w)||"50%"}`:"50% 50%"};
|
|
49
50
|
`,g=l.default.div`
|
|
50
51
|
width: 100%;
|
|
51
52
|
z-index: 1;
|
|
@@ -57,7 +58,13 @@
|
|
|
57
58
|
padding-right: 1.5rem;
|
|
58
59
|
}
|
|
59
60
|
`,h=l.default.div`
|
|
60
|
-
margin-top: 3rem;
|
|
61
|
+
${({$centered:v})=>!v&&"margin-top: 3rem;"}
|
|
62
|
+
|
|
63
|
+
${({$centered:v})=>v&&`
|
|
64
|
+
display: flex;
|
|
65
|
+
flex-direction: column;
|
|
66
|
+
align-items: center;
|
|
67
|
+
`}
|
|
61
68
|
|
|
62
69
|
${({$maxWidth:v,$dynamicGutter:w})=>!w&&`
|
|
63
70
|
width: 100%;
|
|
@@ -79,16 +86,16 @@
|
|
|
79
86
|
`}
|
|
80
87
|
|
|
81
88
|
${r.mq("laptop")} {
|
|
82
|
-
margin-top: 3.75rem;
|
|
89
|
+
${({$centered:v})=>!v&&"margin-top: 3.75rem;"}
|
|
83
90
|
}
|
|
84
|
-
`,y=l.default(
|
|
91
|
+
`,y=l.default(n.Display3)`
|
|
85
92
|
margin: 0;
|
|
86
93
|
color: ${({$color:v,theme:w})=>w.colors.text[v]};
|
|
87
|
-
`,x=l.default(
|
|
94
|
+
`,x=l.default(n.Title)`
|
|
88
95
|
margin: 0.25rem 0;
|
|
89
96
|
color: ${({$color:v,theme:w})=>w.colors.text[v]};
|
|
90
97
|
`,b=l.default.a`
|
|
91
98
|
display: inline-block;
|
|
92
99
|
margin-top: 3rem;
|
|
93
100
|
text-decoration: none;
|
|
94
|
-
`;exports.colorAnimation=u,exports.default=({imageProps:v,
|
|
101
|
+
`;exports.colorAnimation=u,exports.default=({imageProps:v,videoProps:w,children:k,align:V,direction:C,justify:S,contentMaxWidth:W=64,heading:q,headingColor:B="dark",subheading:E,buttonProps:j,dynamicGutter:F,isLoading:H=!1,contentCentered:z=!1,containerStyle:I})=>{const{autoplay:M=0,controls:T=0,disablekb:X=0,end:G,loop:Y=0,modestbranding:_=1,start:A=0,showInfo:D=0}=(w==null?void 0:w.ytConfig)||{},{link:L,text:O,color:P,...J}=j!=null?j:{};return a.default.createElement(d,{$centered:z,style:I},H?a.default.createElement(c,{"data-testid":"loader"}):a.default.createElement(a.default.Fragment,null,w?a.default.createElement(f,{"data-testid":"hero-video",title:"video-frame",src:`${w.src}?disabledkb=${X}&autoplay=${M}&controls=${T}&loop=${Y}&modestbranding=${_}&start=${A}&showInfo=${D}${G?`&end=${G}`:""}`,width:"100%",height:"100%",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}):a.default.createElement(p,{$positionX:v==null?void 0:v.x,$positionY:v==null?void 0:v.y,src:v==null?void 0:v.src,alt:"Hero background"})),(q||E||j)&&a.default.createElement(g,null,a.default.createElement(h,{$maxWidth:W,$dynamicGutter:F,$centered:z},q&&a.default.createElement(y,{as:"h1",$color:B},q),E&&a.default.createElement(x,{$color:B},E),j&&a.default.createElement(b,{href:L},a.default.createElement(i.Button,{size:"large",as:"span",color:P!=null?P:"secondary",...J},O)))),k&&a.default.createElement(s,{$pointerEvents:w?"none":"auto",$align:V||"flex-start",$direction:C||"column",$justify:S||"flex-start"},k))};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("react-dom"),n=require("react-transition-group"),i=require("styled-components"),r=require("../Icons/Close.js");function o(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("react-dom"),n=require("react-transition-group"),i=require("styled-components"),r=require("../Icons/Close.js");function o(h){return h&&typeof h=="object"&&"default"in h?h:{default:h}}var a=o(e),d=o(i);const l=i.css`
|
|
2
2
|
.backgroundTransition-enter {
|
|
3
3
|
opacity: 0;
|
|
4
4
|
}
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
`,s=d.default.div`
|
|
34
34
|
position: relative;
|
|
35
35
|
max-width: 512px;
|
|
36
|
-
padding:
|
|
36
|
+
padding: 1rem;
|
|
37
37
|
background-color: white;
|
|
38
38
|
border-radius: 3px;
|
|
39
39
|
box-shadow: 0px 24px 38px rgba(0, 0, 0, 0.1), 0px 9px 46px rgba(0, 0, 0, 0.09),
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
}
|
|
54
54
|
`,p=d.default.div`
|
|
55
55
|
position: absolute;
|
|
56
|
-
top:
|
|
57
|
-
right:
|
|
56
|
+
top: 1rem;
|
|
57
|
+
right: 1rem;
|
|
58
58
|
|
|
59
59
|
:hover {
|
|
60
60
|
cursor: pointer;
|
|
@@ -74,4 +74,4 @@
|
|
|
74
74
|
}
|
|
75
75
|
`,f=i.createGlobalStyle`
|
|
76
76
|
${l}
|
|
77
|
-
`,g=({children:
|
|
77
|
+
`,g=({children:h,isOpen:w,contentStyles:v,withPortal:E=!1,withCloseIcon:k=!0,onClose:x})=>{e.useEffect(()=>{const y=C=>{C.key==="Escape"&&w&&x()};return window.addEventListener("keydown",y),()=>{window.removeEventListener("keydown",y)}},[x,w]);const T=!(typeof window=="undefined"||!window.document||!window.document.createElement),b=a.default.createElement(n.CSSTransition,{in:w,mountOnEnter:!0,unmountOnExit:!0,timeout:400,classNames:"backgroundTransition"},a.default.createElement(a.default.Fragment,null,a.default.createElement(f,null),a.default.createElement(u,null,a.default.createElement(c,{"data-testid":"background",onClick:x}),a.default.createElement(s,{style:v},k&&a.default.createElement(p,{onClick:x,"data-testid":"close"},a.default.createElement(r.default,null)),h),a.default.createElement(m,null))));return E&&T?t.createPortal(b,document.body):b};exports.Modal=g,exports.default=g;
|
|
@@ -1,27 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
`,E=e.div`
|
|
4
|
-
top: 20px;
|
|
5
|
-
left: 32px;
|
|
6
|
-
position: absolute;
|
|
7
|
-
`,B=e(v)`
|
|
8
|
-
font-weight: ${({theme:o})=>o.typography.fontAlternativeRegularWeight};
|
|
1
|
+
import e from"react";import r from"styled-components";import{Modal as d}from"../Modal/index.js";import p from"../../theme.js";import{TinyTitleBold as c}from"../../typography/Heading/index.js";import"react-dom";import"react-transition-group";import"../Icons/Close.js";import"../../shared/media-queries.js";const f=r(c)`
|
|
2
|
+
font-weight: ${p.typography.fontAlternativeRegularWeight};
|
|
9
3
|
margin: 0;
|
|
10
|
-
`,
|
|
4
|
+
`,g=r.div`
|
|
11
5
|
display: flex;
|
|
12
|
-
justify-content:
|
|
13
|
-
|
|
14
|
-
justify-content: flex-start;
|
|
15
|
-
}
|
|
6
|
+
justify-content: flex-end;
|
|
7
|
+
gap: 1rem;
|
|
16
8
|
overflow-x: hidden;
|
|
17
|
-
`,
|
|
18
|
-
overflow-x: hidden;
|
|
19
|
-
margin-right: 2rem;
|
|
20
|
-
justify-content: center;
|
|
21
|
-
width: 100%;
|
|
22
|
-
max-width: 110px;
|
|
23
|
-
`,b=e(l)`
|
|
24
|
-
justify-content: center;
|
|
25
|
-
width: 100%;
|
|
26
|
-
max-width: 245px;
|
|
27
|
-
`,a=({isOpen:o,title:n,children:s,modalStyles:m,titleStyles:p,primaryButtonText:c,primaryButtonStyles:d,secondaryButtonStyles:u,secondaryButtonText:f,primaryButtonAction:r,secondaryButtonAction:i,onClose:y,withPortal:x,color:h="success"})=>t.createElement(j,{contentStyles:m,isOpen:o,onClose:y,withPortal:x},n&&t.createElement(E,null,t.createElement(B,{style:p},n)),t.createElement(w,null,s),t.createElement(C,null,i&&t.createElement(T,{style:u,onClick:i,variant:"outline",color:"neutral"},f),r&&t.createElement(b,{style:d,onClick:r,variant:"solid",color:h},c)));export{a as Dialog,a as default};
|
|
9
|
+
`,n=({isOpen:i,title:t,children:l,actions:o,onClose:m,withPortal:a,withCloseIcon:s=!0})=>e.createElement(d,{onClose:m,withPortal:a,isOpen:i,withCloseIcon:s},typeof t=="string"?e.createElement(f,null,t):t,e.createElement("div",null,l),o&&e.createElement(g,null,o));export{n as Dialog,n as default};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import n from"react";import r,{keyframes as
|
|
1
|
+
import n from"react";import r,{keyframes as L}from"styled-components";import{Display3 as T,Title as q}from"../../typography/Heading/index.js";import{Button as F}from"../Button/index.js";import{mq as a}from"../../shared/media-queries.js";import"../../theme.js";import"../Spinner/index.js";import"../../typography/ButtonText/index.js";import"../Button/styles.js";const R=r.div`
|
|
2
2
|
position: relative;
|
|
3
3
|
min-height: 440px;
|
|
4
4
|
background-size: cover;
|
|
5
5
|
display: flex;
|
|
6
6
|
flex-direction: column;
|
|
7
|
-
|
|
7
|
+
${({$centered:e})=>e&&"justify-content: center;"}
|
|
8
|
+
`,g=L`
|
|
8
9
|
0% {
|
|
9
10
|
background-color:#f5f5f5;
|
|
10
11
|
}
|
|
@@ -15,80 +16,86 @@ import n from"react";import r,{keyframes as I}from"styled-components";import{Dis
|
|
|
15
16
|
|
|
16
17
|
100% {
|
|
17
18
|
background-color:#f5f5f5;
|
|
18
|
-
}`,
|
|
19
|
+
}`,W=r.div`
|
|
19
20
|
position: absolute;
|
|
20
21
|
width: 100%;
|
|
21
22
|
height: 100%;
|
|
22
23
|
top: 0;
|
|
23
24
|
left: 0;
|
|
24
|
-
animation: ${
|
|
25
|
-
`,
|
|
26
|
-
pointer-events: ${({$pointerEvents:
|
|
25
|
+
animation: ${g} 2s linear infinite;
|
|
26
|
+
`,_=r.div`
|
|
27
|
+
pointer-events: ${({$pointerEvents:e})=>e};
|
|
27
28
|
position: relative;
|
|
28
29
|
display: flex;
|
|
29
|
-
flex-direction: ${({$direction:
|
|
30
|
-
align-items: ${({$align:
|
|
31
|
-
justify-content: ${({$justify:
|
|
30
|
+
flex-direction: ${({$direction:e})=>e};
|
|
31
|
+
align-items: ${({$align:e})=>e};
|
|
32
|
+
justify-content: ${({$justify:e})=>e};
|
|
32
33
|
padding: 50px;
|
|
33
34
|
z-index: 1;
|
|
34
35
|
flex: 1;
|
|
35
|
-
`,
|
|
36
|
+
`,A=r.iframe`
|
|
36
37
|
position: absolute;
|
|
37
38
|
width: 100%;
|
|
38
39
|
height: 100%;
|
|
39
40
|
top: 0;
|
|
40
41
|
left: 0;
|
|
41
|
-
`,
|
|
42
|
+
`,i=e=>typeof e=="number",$=e=>typeof e=="string",D=({$positionX:e,$positionY:t})=>{if(i(e)&&i(t))return`${e}% ${t}%`;if($(e)&&$(t))return`${e} ${t}`;if(e||t){const o=i(e)?`${e}%`:e,c=i(t)?`${t}%`:t;return`${o||"50%"} ${c||"50%"}`}return"50% 50%"},N=r.img`
|
|
42
43
|
position: absolute;
|
|
43
44
|
top: 0;
|
|
44
45
|
left: 0;
|
|
45
46
|
height: 100%;
|
|
46
47
|
width: 100%;
|
|
47
48
|
object-fit: cover;
|
|
48
|
-
object-position: ${
|
|
49
|
-
`,
|
|
49
|
+
object-position: ${D};
|
|
50
|
+
`,O=r.div`
|
|
50
51
|
width: 100%;
|
|
51
52
|
z-index: 1;
|
|
52
53
|
padding-left: 1rem;
|
|
53
54
|
padding-right: 1rem;
|
|
54
55
|
|
|
55
|
-
${
|
|
56
|
+
${a("tablet")} {
|
|
56
57
|
padding-left: 1.5rem;
|
|
57
58
|
padding-right: 1.5rem;
|
|
58
59
|
}
|
|
59
|
-
`,
|
|
60
|
-
margin-top: 3rem;
|
|
60
|
+
`,J=r.div`
|
|
61
|
+
${({$centered:e})=>!e&&"margin-top: 3rem;"}
|
|
61
62
|
|
|
62
|
-
${({$
|
|
63
|
+
${({$centered:e})=>e&&`
|
|
64
|
+
display: flex;
|
|
65
|
+
flex-direction: column;
|
|
66
|
+
align-items: center;
|
|
67
|
+
`}
|
|
68
|
+
|
|
69
|
+
${({$maxWidth:e,$dynamicGutter:t})=>!t&&`
|
|
63
70
|
width: 100%;
|
|
64
71
|
margin-left: auto;
|
|
65
72
|
margin-right: auto;
|
|
66
|
-
max-width: ${
|
|
73
|
+
max-width: ${e}rem;
|
|
67
74
|
`}
|
|
68
75
|
|
|
69
|
-
${({$dynamicGutter:
|
|
70
|
-
${
|
|
71
|
-
margin-left: ${
|
|
72
|
-
margin-right: ${
|
|
76
|
+
${({$dynamicGutter:e})=>e&&`
|
|
77
|
+
${a("tablet")} {
|
|
78
|
+
margin-left: ${e.tabletVw}vw;
|
|
79
|
+
margin-right: ${e.tabletVw}vw;
|
|
73
80
|
}
|
|
74
81
|
|
|
75
|
-
${
|
|
76
|
-
margin-left: ${
|
|
77
|
-
margin-right: ${
|
|
82
|
+
${a("laptop")} {
|
|
83
|
+
margin-left: ${e.laptopVw}vw;
|
|
84
|
+
margin-right: ${e.laptopVw}vw;
|
|
78
85
|
}
|
|
79
86
|
`}
|
|
80
87
|
|
|
81
|
-
${
|
|
82
|
-
margin-top: 3.75rem;
|
|
88
|
+
${a("laptop")} {
|
|
89
|
+
${({$centered:e})=>!e&&"margin-top: 3.75rem;"}
|
|
83
90
|
}
|
|
84
|
-
`,J=r(L)`
|
|
85
|
-
margin: 0;
|
|
86
|
-
color: ${({$color:t,theme:e})=>e.colors.text[t]};
|
|
87
91
|
`,K=r(T)`
|
|
92
|
+
margin: 0;
|
|
93
|
+
color: ${({$color:e,theme:t})=>t.colors.text[e]};
|
|
94
|
+
`,M=r(q)`
|
|
88
95
|
margin: 0.25rem 0;
|
|
89
|
-
color: ${({$color:
|
|
90
|
-
`,
|
|
96
|
+
color: ${({$color:e,theme:t})=>t.colors.text[e]};
|
|
97
|
+
`,Q=r.a`
|
|
91
98
|
display: inline-block;
|
|
92
99
|
margin-top: 3rem;
|
|
93
100
|
text-decoration: none;
|
|
94
|
-
`,
|
|
101
|
+
`,U=({imageProps:e,videoProps:t,children:o,align:c,direction:h,justify:x,contentMaxWidth:b=64,heading:d,headingColor:m="dark",subheading:s,buttonProps:l,dynamicGutter:y,isLoading:w=!1,contentCentered:f=!1,containerStyle:v})=>{const{autoplay:j=0,controls:k=0,disablekb:E=0,end:u,loop:B=0,modestbranding:V=1,start:z=0,showInfo:C=0}=(t==null?void 0:t.ytConfig)||{},{link:H,text:S,color:p,...I}=l!=null?l:{};return n.createElement(R,{$centered:f,style:v},w?n.createElement(W,{"data-testid":"loader"}):n.createElement(n.Fragment,null,t?n.createElement(A,{"data-testid":"hero-video",title:"video-frame",src:`${t.src}?disabledkb=${E}&autoplay=${j}&controls=${k}&loop=${B}&modestbranding=${V}&start=${z}&showInfo=${C}${u?`&end=${u}`:""}`,width:"100%",height:"100%",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}):n.createElement(N,{$positionX:e==null?void 0:e.x,$positionY:e==null?void 0:e.y,src:e==null?void 0:e.src,alt:"Hero background"})),(d||s||l)&&n.createElement(O,null,n.createElement(J,{$maxWidth:b,$dynamicGutter:y,$centered:f},d&&n.createElement(K,{as:"h1",$color:m},d),s&&n.createElement(M,{$color:m},s),l&&n.createElement(Q,{href:H},n.createElement(F,{size:"large",as:"span",color:p!=null?p:"secondary",...I},S)))),o&&n.createElement(_,{$pointerEvents:t?"none":"auto",$align:c||"flex-start",$direction:h||"column",$justify:x||"flex-start"},o))};export{g as colorAnimation,U as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import t,{useEffect as
|
|
1
|
+
import t,{useEffect as w}from"react";import{createPortal as h}from"react-dom";import{CSSTransition as x}from"react-transition-group";import n,{css as f,createGlobalStyle as a}from"styled-components";import b from"../Icons/Close.js";const d=f`
|
|
2
2
|
.backgroundTransition-enter {
|
|
3
3
|
opacity: 0;
|
|
4
4
|
}
|
|
@@ -16,7 +16,7 @@ import t,{useEffect as g}from"react";import{createPortal as x}from"react-dom";im
|
|
|
16
16
|
opacity: 0;
|
|
17
17
|
transition: opacity 0.25s ease-in-out;
|
|
18
18
|
}
|
|
19
|
-
`,
|
|
19
|
+
`,y=n.div`
|
|
20
20
|
${d}
|
|
21
21
|
position: fixed;
|
|
22
22
|
width: 100%;
|
|
@@ -24,16 +24,16 @@ import t,{useEffect as g}from"react";import{createPortal as x}from"react-dom";im
|
|
|
24
24
|
top: 0;
|
|
25
25
|
left: 0;
|
|
26
26
|
z-index: 200;
|
|
27
|
-
`,
|
|
27
|
+
`,k=n.div`
|
|
28
28
|
z-index: -1;
|
|
29
29
|
position: absolute;
|
|
30
30
|
width: 100%;
|
|
31
31
|
height: 100%;
|
|
32
32
|
background-color: rgba(34, 34, 34, 0.3);
|
|
33
|
-
`,
|
|
33
|
+
`,E=n.div`
|
|
34
34
|
position: relative;
|
|
35
35
|
max-width: 512px;
|
|
36
|
-
padding:
|
|
36
|
+
padding: 1rem;
|
|
37
37
|
background-color: white;
|
|
38
38
|
border-radius: 3px;
|
|
39
39
|
box-shadow: 0px 24px 38px rgba(0, 0, 0, 0.1), 0px 9px 46px rgba(0, 0, 0, 0.09),
|
|
@@ -51,10 +51,10 @@ import t,{useEffect as g}from"react";import{createPortal as x}from"react-dom";im
|
|
|
51
51
|
margin-right: auto;
|
|
52
52
|
min-width: 355px;
|
|
53
53
|
}
|
|
54
|
-
`,
|
|
54
|
+
`,v=n.div`
|
|
55
55
|
position: absolute;
|
|
56
|
-
top:
|
|
57
|
-
right:
|
|
56
|
+
top: 1rem;
|
|
57
|
+
right: 1rem;
|
|
58
58
|
|
|
59
59
|
:hover {
|
|
60
60
|
cursor: pointer;
|
|
@@ -64,7 +64,7 @@ import t,{useEffect as g}from"react";import{createPortal as x}from"react-dom";im
|
|
|
64
64
|
width: 1rem;
|
|
65
65
|
height: 1rem;
|
|
66
66
|
}
|
|
67
|
-
`,
|
|
67
|
+
`,T=a`
|
|
68
68
|
body {
|
|
69
69
|
overflow: hidden;
|
|
70
70
|
|
|
@@ -72,6 +72,6 @@ import t,{useEffect as g}from"react";import{createPortal as x}from"react-dom";im
|
|
|
72
72
|
padding-right: 15px !important;
|
|
73
73
|
`}
|
|
74
74
|
}
|
|
75
|
-
`,
|
|
75
|
+
`,C=a`
|
|
76
76
|
${d}
|
|
77
|
-
`,c=({children:s,isOpen:o,contentStyles:m,withPortal:l=!1,onClose:e})=>{
|
|
77
|
+
`,c=({children:s,isOpen:o,contentStyles:m,withPortal:l=!1,withCloseIcon:u=!0,onClose:e})=>{w(()=>{const r=g=>{g.key==="Escape"&&o&&e()};return window.addEventListener("keydown",r),()=>{window.removeEventListener("keydown",r)}},[e,o]);const p=!!(typeof window!="undefined"&&window.document&&window.document.createElement),i=t.createElement(x,{in:o,mountOnEnter:!0,unmountOnExit:!0,timeout:400,classNames:"backgroundTransition"},t.createElement(t.Fragment,null,t.createElement(C,null),t.createElement(y,null,t.createElement(k,{"data-testid":"background",onClick:e}),t.createElement(E,{style:m},u&&t.createElement(v,{onClick:e,"data-testid":"close"},t.createElement(b,null)),s),t.createElement(T,null))));return l&&p?h(i,document.body):i};export{c as Modal,c as default};
|
package/package.json
CHANGED
|
@@ -1,21 +1,12 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { Color } from '../../Types';
|
|
3
2
|
export interface DialogProps {
|
|
4
|
-
title?:
|
|
5
|
-
children: ReactNode;
|
|
3
|
+
title?: ReactNode;
|
|
6
4
|
isOpen: boolean;
|
|
7
|
-
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
actions?: ReactNode;
|
|
8
7
|
withPortal?: boolean;
|
|
9
|
-
|
|
10
|
-
secondaryButtonText?: string;
|
|
11
|
-
modalStyles?: {};
|
|
12
|
-
titleStyles?: {};
|
|
13
|
-
primaryButtonStyles?: {};
|
|
14
|
-
secondaryButtonStyles?: {};
|
|
8
|
+
withCloseIcon?: boolean;
|
|
15
9
|
onClose(): void;
|
|
16
|
-
primaryButtonAction?(): void;
|
|
17
|
-
secondaryButtonAction?(): void;
|
|
18
|
-
color?: Color;
|
|
19
10
|
}
|
|
20
|
-
export declare const Dialog: ({ isOpen, title, children,
|
|
11
|
+
export declare const Dialog: ({ isOpen, title, children, actions, onClose, withPortal, withCloseIcon, }: DialogProps) => JSX.Element;
|
|
21
12
|
export default Dialog;
|
|
@@ -49,6 +49,7 @@ export interface HeroProps {
|
|
|
49
49
|
};
|
|
50
50
|
dynamicGutter?: DynamicGutter;
|
|
51
51
|
isLoading?: boolean;
|
|
52
|
+
contentCentered?: boolean;
|
|
52
53
|
}
|
|
53
|
-
declare const Hero: ({ imageProps,
|
|
54
|
+
declare const Hero: ({ imageProps, videoProps, children, align, direction, justify, contentMaxWidth, heading, headingColor, subheading, buttonProps, dynamicGutter, isLoading, contentCentered, containerStyle, }: HeroProps) => JSX.Element;
|
|
54
55
|
export default Hero;
|
|
@@ -6,6 +6,7 @@ export interface ModalProps {
|
|
|
6
6
|
withPortal?: boolean;
|
|
7
7
|
onClose(): void;
|
|
8
8
|
contentStyles?: {};
|
|
9
|
+
withCloseIcon?: boolean;
|
|
9
10
|
}
|
|
10
|
-
export declare const Modal: ({ children, isOpen, contentStyles, withPortal, onClose, }: ModalProps) => JSX.Element;
|
|
11
|
+
export declare const Modal: ({ children, isOpen, contentStyles, withPortal, withCloseIcon, onClose, }: ModalProps) => JSX.Element;
|
|
11
12
|
export default Modal;
|