@kvdbil/components 16.0.6 → 16.0.8

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"),r=require("../../typography/BodyText/index.js"),t=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=t)&&l.__esModule?l:{default:l};const d=t.css`
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(t,n){switch(n){case"BodyLink":return e.jsx(r.BodyLink,{as:"span",children:t});case"BodyText":return e.jsx(r.BodyText,{as:"span",children:t});case"Caption":return e.jsx(r.Caption,{as:"span",children:t});case"Caption2":return e.jsx(r.Caption2,{as:"span",children:t});case"CaptionLink":return e.jsx(r.CaptionLink,{as:"span",children:t});case"Status":return e.jsx(r.Status,{as:"span",children:t});case"Headline":return e.jsx(i.Headline,{as:"span",children:t});case"Title":return e.jsx(i.Title,{as:"span",children:t});case"Subtitle":return e.jsx(i.Subtitle,{as:"span",children:t});case"TinyTitleRegular":return e.jsx(i.TinyTitleRegular,{as:"span",children:t});case"TinyTitleBold":return e.jsx(i.TinyTitleBold,{as:"span",children:t});case"Display1":return e.jsx(i.Display1,{as:"span",children:t});case"Display2":return e.jsx(i.Display2,{as:"span",children:t});case"Display3":return e.jsx(i.Display3,{as:"span",children:t})}}const x=({path:r,text:t,url:n,rel:i,ariaLabel:a,typographyType:s="BodyLink",target:l="_self",isButton:o=!1,buttonColor:d="primary",buttonColorShade:x,buttonVariant:y,fullWidth:f,buttonSize:j,withUnderline:B=!1,buttonPrefixIcon:b,children:T,fontFamily:m="Next Book",isDisabled:q=!1})=>{const $=n??r??"",k=$.startsWith("http")&&typeof window<"u"&&!$.includes(window.location.hostname),g={target:l,$isButton:o,$withUnderline:B,rel:i||("_blank"===l?k?"noopener noreferrer":"noopener":void 0),"aria-label":a},D=((r,t,n,i,a)=>e.jsxs(e.Fragment,{children:[t,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:r}):r&&h(r,i)]}))(t,T,o,s,{color:d,colorShade:x,variant:y,fullWidth:f,size:j,prefixIcon:b,fontFamily:m,isDisabled:q});return k?e.jsx(u,{href:$,...g,"data-testid":"external-link",children:D}):e.jsx(c,{to:$,...g,"data-testid":"internal-link",children:D})};exports.Link=x,exports.default=x;
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 i,Fragment as W}from"react/jsx-runtime";import{Status as z,CaptionLink as I,Caption2 as v,Caption as U,BodyText as j,BodyLink as H}from"../../typography/BodyText/index.js";import s,{css as R}from"styled-components";import f from"../../theme.js";import{Display3 as _,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=R`
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=s.a`
8
+ `,A=l.a`
9
9
  ${h}
10
- `,E=s(q)`
10
+ `,E=l(q)`
11
11
  ${h}
12
- `,G=s(V)`
12
+ `,G=l(V)`
13
13
  font-family: ${({$fontFamily:n})=>`${n}, sans-serif`};
14
- `;function X(n,r){switch(r){case"BodyLink":return i(H,{as:"span",children:n});case"BodyText":return i(j,{as:"span",children:n});case"Caption":return i(U,{as:"span",children:n});case"Caption2":return i(v,{as:"span",children:n});case"CaptionLink":return i(I,{as:"span",children:n});case"Status":return i(z,{as:"span",children:n});case"Headline":return i(Q,{as:"span",children:n});case"Title":return i(P,{as:"span",children:n});case"Subtitle":return i(O,{as:"span",children:n});case"TinyTitleRegular":return i(N,{as:"span",children:n});case"TinyTitleBold":return i(M,{as:"span",children:n});case"Display1":return i(K,{as:"span",children:n});case"Display2":return i(J,{as:"span",children:n});case"Display3":return i(_,{as:"span",children:n})}}const Y=(n,r,o,e,t)=>F(W,{children:[r,o?i(G,{color:t.color,colorShade:t.colorShade,variant:t.variant,fullWidth:t.fullWidth,size:t.size,prefixIcon:t.prefixIcon,$fontFamily:t.fontFamily,isDisabled:t.isDisabled,children:n}):n&&X(n,e)]}),m=({path:n,text:r,url:o,rel:e,ariaLabel:t,typographyType:y="BodyLink",target:l="_self",isButton:c=!1,buttonColor:$="primary",buttonColorShade:b,buttonVariant:k,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),C=()=>{if(e)return e;if(l==="_blank")return d?"noopener noreferrer":"noopener"},g={color:$,colorShade:b,variant:k,fullWidth:x,size:T,prefixIcon:D,fontFamily:L,isDisabled:S},p={target:l,$isButton:c,$withUnderline:B,rel:C(),"aria-label":t},u=Y(r,w,c,y,g);return d?i(A,{href:a,...p,"data-testid":"external-link",children:u}):i(E,{to:a,...p,"data-testid":"internal-link",children:u})};export{m as Link,m as default};
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kvdbil/components",
3
- "version": "16.0.6",
3
+ "version": "16.0.8",
4
4
  "sideEffects": false,
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",
@@ -73,7 +73,7 @@
73
73
  "@testing-library/react-hooks": "^8.0.1",
74
74
  "@testing-library/user-event": "^14.5.2",
75
75
  "@types/jest": "^29.5.12",
76
- "@types/node": "22.15.24",
76
+ "@types/node": "22.16.0",
77
77
  "@types/react": "^18.3.8",
78
78
  "@types/react-collapse": "^5.0.4",
79
79
  "@types/react-dom": "^18.3.0",
package/package.json.tmp CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kvdbil/components",
3
- "version": "16.0.6",
3
+ "version": "16.0.8",
4
4
  "sideEffects": false,
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",
@@ -72,7 +72,7 @@
72
72
  "@testing-library/react-hooks": "^8.0.1",
73
73
  "@testing-library/user-event": "^14.5.2",
74
74
  "@types/jest": "^29.5.12",
75
- "@types/node": "22.15.24",
75
+ "@types/node": "22.16.0",
76
76
  "@types/react": "^18.3.8",
77
77
  "@types/react-collapse": "^5.0.4",
78
78
  "@types/react-dom": "^18.3.0",