@kvdbil/components 16.0.6 → 16.0.7
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/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../typography/BodyText/index.js"),r=require("styled-components"),n=require("../../theme.js"),i=require("../../typography/Heading/index.js"),a=require("../Button/index.js"),s=require("react-router-dom");require("../../shared/media-queries.js"),require("react"),require("../Spinner/index.js"),require("../../utils/utils.js"),require("../../typography/ButtonText/index.js"),require("../Button/styles.js");var l,o=(l=r)&&l.__esModule?l:{default:l};const d=r.css`
|
|
2
2
|
text-decoration: ${({$withUnderline:e})=>e?`underline ${n.default.colors.info.dark}`:"none"};
|
|
3
3
|
|
|
4
4
|
span {
|
|
@@ -11,4 +11,4 @@
|
|
|
11
11
|
${d}
|
|
12
12
|
`,p=o.default(a.Button)`
|
|
13
13
|
font-family: ${({$fontFamily:e})=>`${e}, sans-serif`};
|
|
14
|
-
`;function h(
|
|
14
|
+
`;function h(r,n){switch(n){case"BodyLink":return e.jsx(t.BodyLink,{as:"span",children:r});case"BodyText":return e.jsx(t.BodyText,{as:"span",children:r});case"Caption":return e.jsx(t.Caption,{as:"span",children:r});case"Caption2":return e.jsx(t.Caption2,{as:"span",children:r});case"CaptionLink":return e.jsx(t.CaptionLink,{as:"span",children:r});case"Status":return e.jsx(t.Status,{as:"span",children:r});case"Headline":return e.jsx(i.Headline,{as:"span",children:r});case"Title":return e.jsx(i.Title,{as:"span",children:r});case"Subtitle":return e.jsx(i.Subtitle,{as:"span",children:r});case"TinyTitleRegular":return e.jsx(i.TinyTitleRegular,{as:"span",children:r});case"TinyTitleBold":return e.jsx(i.TinyTitleBold,{as:"span",children:r});case"Display1":return e.jsx(i.Display1,{as:"span",children:r});case"Display2":return e.jsx(i.Display2,{as:"span",children:r});case"Display3":return e.jsx(i.Display3,{as:"span",children:r})}}const x=({path:t,text:r,url:n,rel:i,ariaLabel:a,typographyType:s="BodyLink",target:l,isButton:o=!1,buttonColor:d="primary",buttonColorShade:x,buttonVariant:y,fullWidth:f,buttonSize:j,withUnderline:b=!1,buttonPrefixIcon:B,children:T,fontFamily:k="Next Book",isDisabled:m=!1})=>{const q=n??t??"",$=q.startsWith("http")&&typeof window<"u"&&!q.includes(window.location.hostname),g={$isButton:o,$withUnderline:b,rel:i||("_blank"===l?$?"noopener noreferrer":"noopener":void 0),"aria-label":a},D=((t,r,n,i,a)=>e.jsxs(e.Fragment,{children:[r,n?e.jsx(p,{color:a.color,colorShade:a.colorShade,variant:a.variant,fullWidth:a.fullWidth,size:a.size,prefixIcon:a.prefixIcon,$fontFamily:a.fontFamily,isDisabled:a.isDisabled,children:t}):t&&h(t,i)]}))(r,T,o,s,{color:d,colorShade:x,variant:y,fullWidth:f,size:j,prefixIcon:B,fontFamily:k,isDisabled:m});return $?e.jsx(u,{href:q,target:l??"_blank",...g,"data-testid":"external-link",children:D}):e.jsx(c,{to:q,target:l??"_self",...g,"data-testid":"internal-link",children:D})};exports.Link=x,exports.default=x;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{jsxs as F,jsx as
|
|
1
|
+
import{jsxs as F,jsx as t,Fragment as W}from"react/jsx-runtime";import{Status as z,CaptionLink as I,Caption2 as v,Caption as U,BodyText as _,BodyLink as j}from"../../typography/BodyText/index.js";import l,{css as H}from"styled-components";import f from"../../theme.js";import{Display3 as R,Display2 as J,Display1 as K,TinyTitleBold as M,TinyTitleRegular as N,Subtitle as O,Title as P,Headline as Q}from"../../typography/Heading/index.js";import{Button as V}from"../Button/index.js";import{Link as q}from"react-router-dom";import"../../shared/media-queries.js";import"react";import"../Spinner/index.js";import"../../utils/utils.js";import"../../typography/ButtonText/index.js";import"../Button/styles.js";const h=H`
|
|
2
2
|
text-decoration: ${({$withUnderline:n})=>n?`underline ${f.colors.info.dark}`:"none"};
|
|
3
3
|
|
|
4
4
|
span {
|
|
5
5
|
color: ${({$isButton:n})=>!n&&`${f.colors.info.dark}`};
|
|
6
6
|
font-weight: 600;
|
|
7
7
|
}
|
|
8
|
-
`,A=
|
|
8
|
+
`,A=l.a`
|
|
9
9
|
${h}
|
|
10
|
-
`,E=
|
|
10
|
+
`,E=l(q)`
|
|
11
11
|
${h}
|
|
12
|
-
`,G=
|
|
12
|
+
`,G=l(V)`
|
|
13
13
|
font-family: ${({$fontFamily:n})=>`${n}, sans-serif`};
|
|
14
|
-
`;function X(n,r){switch(r){case"BodyLink":return
|
|
14
|
+
`;function X(n,r){switch(r){case"BodyLink":return t(j,{as:"span",children:n});case"BodyText":return t(_,{as:"span",children:n});case"Caption":return t(U,{as:"span",children:n});case"Caption2":return t(v,{as:"span",children:n});case"CaptionLink":return t(I,{as:"span",children:n});case"Status":return t(z,{as:"span",children:n});case"Headline":return t(Q,{as:"span",children:n});case"Title":return t(P,{as:"span",children:n});case"Subtitle":return t(O,{as:"span",children:n});case"TinyTitleRegular":return t(N,{as:"span",children:n});case"TinyTitleBold":return t(M,{as:"span",children:n});case"Display1":return t(K,{as:"span",children:n});case"Display2":return t(J,{as:"span",children:n});case"Display3":return t(R,{as:"span",children:n})}}const Y=(n,r,o,e,i)=>F(W,{children:[r,o?t(G,{color:i.color,colorShade:i.colorShade,variant:i.variant,fullWidth:i.fullWidth,size:i.size,prefixIcon:i.prefixIcon,$fontFamily:i.fontFamily,isDisabled:i.isDisabled,children:n}):n&&X(n,e)]}),m=({path:n,text:r,url:o,rel:e,ariaLabel:i,typographyType:y="BodyLink",target:s,isButton:c=!1,buttonColor:b="primary",buttonColorShade:k,buttonVariant:$,fullWidth:x,buttonSize:T,withUnderline:B=!1,buttonPrefixIcon:D,children:w,fontFamily:L="Next Book",isDisabled:S=!1})=>{const a=o??n??"",d=a.startsWith("http")&&typeof window<"u"&&!a.includes(window.location.hostname),g=()=>{if(e)return e;if(s==="_blank")return d?"noopener noreferrer":"noopener"},C={color:b,colorShade:k,variant:$,fullWidth:x,size:T,prefixIcon:D,fontFamily:L,isDisabled:S},p={$isButton:c,$withUnderline:B,rel:g(),"aria-label":i},u=Y(r,w,c,y,C);return d?t(A,{href:a,target:s??"_blank",...p,"data-testid":"external-link",children:u}):t(E,{to:a,target:s??"_self",...p,"data-testid":"internal-link",children:u})};export{m as Link,m as default};
|
package/package.json
CHANGED