@kvdbil/components 14.3.7 → 14.3.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.
@@ -95,4 +95,4 @@
95
95
  user-select: none;
96
96
  color: ${({theme:e,isDisabled:r})=>r?e.colors.text.disabled:e.colors.text.dark};
97
97
  margin-left: 0.5rem;
98
- `,f=({name:r=i.generateNameHash("radio-button"),size:s="regular",checked:l=!1,isDisabled:a=!1,color:t="secondary",onChange:d,label:c,...n})=>e.jsxs(u,{children:[e.jsxs(o.default,{onClick:d,isActive:l,isDisabled:a,color:t,children:[e.jsx(b,{"data-validate":"checked",checked:l,type:"radio",name:r,id:r,onChange:d,disabled:a,"aria-label":r,...n}),e.jsx(h,{size:s,color:t,isChecked:l,isDisabled:a,children:e.jsx(p,{className:"circle circle--outer",children:e.jsx(x,{className:"circle circle--inner"})})})]}),c&&e.jsx(g,{as:"label",htmlFor:r,isDisabled:a,children:c})]});exports.RadioButton=f,exports.default=f;
98
+ `,f=({name:r=i.generateNameHash("radio-button"),size:s="regular",checked:l=!1,isDisabled:a=!1,color:t="secondary",onChange:d,label:c,...n})=>e.jsxs(u,{children:[e.jsxs(o.default,{onClick:d,isActive:l,isDisabled:a,color:t,children:[e.jsx(b,{"data-validate":"checked",checked:l,type:"radio",name:r,id:r,disabled:a,"aria-label":r,"aria-checked":l,...n}),e.jsx(h,{size:s,color:t,isChecked:l,isDisabled:a,children:e.jsx(p,{className:"circle circle--outer",children:e.jsx(x,{className:"circle circle--inner"})})})]}),c&&e.jsx(g,{as:"label",htmlFor:r,isDisabled:a,children:c})]});exports.RadioButton=f,exports.default=f;
@@ -1,7 +1,7 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),o=require("react-select"),t=require("styled-components"),i=require("../../shared/constants.js"),a=require("../../theme.js"),l=require("../../typography/BodyText/index.js"),s=require("../FieldLabel.js");function d(e){return e&&e.__esModule?e:{default:e}}require("../../shared/media-queries.js");var n=d(o),u=d(t);const c=u.default.div`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),o=require("react-select"),t=require("styled-components"),i=require("../../shared/constants.js"),a=require("../../theme.js"),l=require("../../typography/BodyText/index.js"),s=require("../FieldLabel.js");function d(e){return e&&e.__esModule?e:{default:e}}require("../../shared/media-queries.js");var n=d(o),c=d(t);const u=c.default.div`
2
2
  font-family: ${({theme:e})=>e.typography.fontBaseFamily};
3
3
  position: relative;
4
- `,p=e=>e&&{paddingLeft:"2.5rem"},m=e=>e&&{border:`1px solid ${a.default.colors.gray.light1}`,color:a.default.colors.gray.dark1,fill:a.default.colors.gray.light1},f=e=>e&&{border:`2px solid ${a.default.colors.error.dark}`},g=u.default.div`
4
+ `,p=e=>e&&{paddingLeft:"2.5rem"},m=e=>e&&{border:`1px solid ${a.default.colors.gray.light1}`,color:a.default.colors.gray.dark1,fill:a.default.colors.gray.light1},f=e=>e&&{border:`2px solid ${a.default.colors.error.dark}`},g=c.default.div`
5
5
  position: absolute;
6
6
  z-index: 1;
7
7
  top: 0.5rem;
@@ -13,12 +13,12 @@
13
13
  ${e=>e.isDisabled&&` fill: ${a.default.colors.gray.light1}; `}
14
14
 
15
15
  ${e=>e.isFocused&&` fill: ${e.theme.colors.text.dark}; `}
16
- `,h=u.default.span`
16
+ `,h=c.default.span`
17
17
  ${l.CaptionStyle}
18
18
  display: block;
19
19
  margin-top: 0.25rem;
20
20
  color: ${({hasError:e})=>e?a.default.colors.error.dark:a.default.colors.text.disabled};
21
- `,x=u.default((r=>e.jsxs("svg",{...r,children:[e.jsx("symbol",{id:"icon-arrow",viewBox:"0 0 19 19",children:e.jsx("path",{d:"M2.03039 7.95496L9.80856 15.7331C9.90619 15.8308 10.0645 15.8308 10.1621 15.7331L17.9403 7.95496L19.0009 9.01562L11.2228 16.7938C10.5394 17.4772 9.43132 17.4772 8.7479 16.7938L0.969727 9.01562L2.03039 7.95496Z"})}),e.jsx("use",{xlinkHref:"#icon-arrow"})]})))`
21
+ `,x=c.default((r=>e.jsxs("svg",{...r,children:[e.jsx("symbol",{id:"icon-arrow",viewBox:"0 0 19 19",children:e.jsx("path",{d:"M2.03039 7.95496L9.80856 15.7331C9.90619 15.8308 10.0645 15.8308 10.1621 15.7331L17.9403 7.95496L19.0009 9.01562L11.2228 16.7938C10.5394 17.4772 9.43132 17.4772 8.7479 16.7938L0.969727 9.01562L2.03039 7.95496Z"})}),e.jsx("use",{xlinkHref:"#icon-arrow"})]})))`
22
22
  width: 0.75rem;
23
23
  height: 0.75rem;
24
24
  margin: 0;
@@ -36,4 +36,4 @@
36
36
  transform: ${e=>e.$isMenuOpen?"rotate(-180deg)":"rotate(0deg)"};
37
37
 
38
38
  transform-origin: 50% 60%;
39
- `,b=({selectProps:{menuIsOpen:r=!1},isFocused:o=!1,isDisabled:t})=>e.jsx(x,{$isDisabled:t,$isFocused:o,$isMenuOpen:r,$theme:a.default});function y({className:o,color:t="primary",forwardRef:i,hasError:l=!1,height:d,helperText:u,isDisabled:x=!1,onBlur:y=(()=>null),onFocus:$=(()=>null),onInputChange:k=(()=>null),placeholder:F="",name:S,...j}){const[v,D]=r.useState(!1),[w,L]=r.useState(""),I=({isSelected:e,isFocused:r,isDisabled:o})=>e?a.default.colors[t].main:o?a.default.colors.background.light:r?a.default.colors.background.gray:a.default.colors.background.light,T=((e,r)=>r?a.default.colors.error.main:e?a.default.colors.text.dark:a.default.colors.gray.light1)(v,l),C=!j.label;return e.jsxs(c,{className:o,children:[!C&&j.label&&e.jsx(s.Label,{htmlFor:S,height:d,isFocused:v,hasValue:!(!j.value&&!w),disabled:x,theme:a.default,hasError:l,children:j.label}),j.prefix&&e.jsx(g,{isDisabled:x,isFocused:v,children:j.prefix}),e.jsx(n.default,{...j,inputId:S,name:S,ref:i,isDisabled:x,onInputChange:(e,r)=>{k(e,r),L(e)},placeholder:F,onFocus:e=>{D(!0),$(e)},onBlur:e=>{D(!1),y(e)},styles:{control:e=>({...e,borderRadius:0,color:a.default.colors.text.dark,fontFamily:a.default.typography.fontBaseFamily,fontSize:"1rem",fontWeight:400,cursor:"pointer",padding:"0.7rem 0.5rem",backgroundColor:a.default.colors.background.light,borderColor:T,boxShadow:"none",minHeight:"3rem","&:hover":{borderColor:"none"},...m(x),...f(l),...p(!!j.prefix)}),input:e=>({...e,height:"auto",margin:0,padding:0}),placeholder:e=>{const r={...e,fontSize:"1rem",lineHeight:"1.5rem",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",margin:0};return C?{...r,color:a.default.colors.text.dark,fontWeight:600}:{...r,display:v?"static":"none"}},menuList:e=>({...e,padding:"0.5rem 0",paddingBottom:"5rem",marginTop:0,border:`1px solid ${T}`,borderTop:"none",display:"flex",flexDirection:"column",gap:"0.5rem"}),menu:e=>({...e,borderRadius:0,boxShadow:"none",zIndex:5,padding:"0",marginTop:"-0.1rem"}),option:(e,{isSelected:r,isFocused:o,isDisabled:t})=>({...e,padding:"0.5rem",lineHeight:"1.5rem",fontSize:"1rem",fontWeight:400,cursor:t?"not-allowed":"pointer","&:hover":{background:I({isSelected:r,isFocused:!0,isDisabled:t})},background:I({isSelected:r,isFocused:o}),...p(!!j.prefix)}),valueContainer:e=>({...e,position:"static",padding:d?d-1+"rem 0 ":0,height:d?"auto":"1.5rem"}),clearIndicator:e=>({...e,paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:"0.2rem"})},components:{IndicatorSeparator:()=>null,DropdownIndicator:b,...j.components??{}}}),u&&e.jsx(h,{hasError:l,children:u})]})}exports.Select=y,exports.default=y;
39
+ `,b=({selectProps:{menuIsOpen:r=!1},isFocused:o=!1,isDisabled:t})=>e.jsx(x,{$isDisabled:t,$isFocused:o,$isMenuOpen:r,$theme:a.default});function y({className:o,color:t="primary",forwardRef:i,hasError:l=!1,height:d,helperText:c,isDisabled:x=!1,onBlur:y=(()=>null),onFocus:$=(()=>null),onInputChange:k=(()=>null),placeholder:F="",name:S,...j}){const[v,D]=r.useState(!1),[w,L]=r.useState(""),I=({isSelected:e,isFocused:r,isDisabled:o})=>e?a.default.colors[t].main:o?a.default.colors.background.light:r?a.default.colors.background.gray:a.default.colors.background.light,T=((e,r)=>r?a.default.colors.error.main:e?a.default.colors.text.dark:a.default.colors.gray.light1)(v,l),C=!j.label;return e.jsxs(u,{className:o,children:[!C&&j.label&&e.jsx(s.Label,{htmlFor:S,height:d,isFocused:v,hasValue:!(!j.value&&!w),disabled:x,theme:a.default,hasError:l,children:j.label}),j.prefix&&e.jsx(g,{isDisabled:x,isFocused:v,children:j.prefix}),e.jsx(n.default,{...j,id:"react-select",inputId:S,name:S,ref:i,isDisabled:x,onInputChange:(e,r)=>{k(e,r),L(e)},placeholder:F,onFocus:e=>{D(!0),$(e)},onBlur:e=>{D(!1),y(e)},styles:{control:e=>({...e,borderRadius:0,color:a.default.colors.text.dark,fontFamily:a.default.typography.fontBaseFamily,fontSize:"1rem",fontWeight:400,cursor:"pointer",padding:"0.7rem 0.5rem",backgroundColor:a.default.colors.background.light,borderColor:T,boxShadow:"none",minHeight:"3rem","&:hover":{borderColor:"none"},...m(x),...f(l),...p(!!j.prefix)}),input:e=>({...e,height:"auto",margin:0,padding:0}),placeholder:e=>{const r={...e,fontSize:"1rem",lineHeight:"1.5rem",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",margin:0};return C?{...r,color:a.default.colors.text.dark,fontWeight:600}:{...r,display:v?"static":"none"}},menuList:e=>({...e,padding:"0.5rem 0",paddingBottom:"5rem",marginTop:0,border:`1px solid ${T}`,borderTop:"none",display:"flex",flexDirection:"column",gap:"0.5rem"}),menu:e=>({...e,borderRadius:0,boxShadow:"none",zIndex:5,padding:"0",marginTop:"-0.1rem"}),option:(e,{isSelected:r,isFocused:o,isDisabled:t})=>({...e,padding:"0.5rem",lineHeight:"1.5rem",fontSize:"1rem",fontWeight:400,cursor:t?"not-allowed":"pointer","&:hover":{background:I({isSelected:r,isFocused:!0,isDisabled:t})},background:I({isSelected:r,isFocused:o}),...p(!!j.prefix)}),valueContainer:e=>({...e,position:"static",padding:d?d-1+"rem 0 ":0,height:d?"auto":"1.5rem"}),clearIndicator:e=>({...e,paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:"0.2rem"})},components:{IndicatorSeparator:()=>null,DropdownIndicator:b,...j.components??{}}}),c&&e.jsx(h,{hasError:l,children:c})]})}exports.Select=y,exports.default=y;
@@ -3,12 +3,12 @@ import{jsxs as s,Fragment as u,jsx as e}from"react/jsx-runtime";import{useState
3
3
  max-width: 700px;
4
4
  `,y=i(h)`
5
5
  margin: 0.5rem;
6
- `,$=i.ul`
6
+ `,O=i.ul`
7
7
  display: flex;
8
8
  list-style: none;
9
9
  flex-wrap: wrap;
10
10
  padding: 0;
11
- `,O=i.li`
11
+ `,$=i.li`
12
12
  background: ${({background:r})=>r};
13
13
  display: flex;
14
14
  justify-content: center;
@@ -29,4 +29,4 @@ import{jsxs as s,Fragment as u,jsx as e}from"react/jsx-runtime";import{useState
29
29
  `,v=i.span`
30
30
  font-size: ${({size:r})=>r};
31
31
  color: ${({color:r})=>r};
32
- `,z=({background:r=p.colors.background.light,color:l=p.colors.text.dark,icons:m,size:d="2rem"})=>{const[a,n]=x({isOpen:!1,message:"",type:"info",color:"neutral"}),g=async o=>{const c=`import { ${o} } from 'kvdbil-components';`;if(navigator.clipboard)try{await navigator.clipboard.writeText(c),n(t=>({...t,isOpen:!0,message:`copied import for ${o}`,type:"success",color:"success"}))}catch(t){n(f=>({...f,isOpen:!0,message:`Could not copy text: ${t}`,type:"error",color:"error"}))}};return s(u,{children:[s(w,{children:[e(y,{as:"h2",children:"Click to copy import declaration for icon"}),e($,{children:m.map(([o,c],t)=>s(O,{background:r,onClick:()=>{g(o)},children:[e(C,{children:o}),e(v,{size:d,color:l,children:e(c,{})})]},t))})]}),e(k,{message:a.message,isOpen:a.isOpen,type:a.type,color:a.color,onClose:()=>n(o=>({...o,isOpen:!1}))})]})};export{z as default};
32
+ `,z=({background:r=p.colors.background.light,color:l=p.colors.text.dark,icons:m,size:d="2rem"})=>{const[a,n]=x({isOpen:!1,message:"",type:"info",color:"neutral"}),g=async o=>{const c=`import { ${o} } from 'kvdbil-components';`;if(navigator.clipboard)try{await navigator.clipboard.writeText(c),n(t=>({...t,isOpen:!0,message:`copied import for ${o}`,type:"success",color:"success"}))}catch(t){n(f=>({...f,isOpen:!0,message:`Could not copy text: ${t}`,type:"error",color:"error"}))}};return s(u,{children:[s(w,{children:[e(y,{as:"h2",children:"Click to copy import declaration for icon"}),e(O,{children:m.map(([o,c],t)=>s($,{background:r,onClick:()=>{g(o)},children:[e(C,{children:o}),e(v,{size:d,color:l,children:e(c,{})})]},t))})]}),e(k,{message:a.message,isOpen:a.isOpen,type:a.type,color:a.color,onClose:()=>n(o=>({...o,isOpen:!1}))})]})};export{z as default};
@@ -1,4 +1,4 @@
1
- import{jsxs as b,jsx as o}from"react/jsx-runtime";import i,{css as l}from"styled-components";import{generateNameHash as g}from"../../shared/helpers.js";import r from"../../theme.js";import m from"../IconButton.js";import{BodyText as u}from"../../typography/BodyText/index.js";import"../../shared/media-queries.js";const x=l`
1
+ import{jsxs as n,jsx as o}from"react/jsx-runtime";import i,{css as l}from"styled-components";import{generateNameHash as g}from"../../shared/helpers.js";import r from"../../theme.js";import m from"../IconButton.js";import{BodyText as u}from"../../typography/BodyText/index.js";import"../../shared/media-queries.js";const x=l`
2
2
  .circle {
3
3
  &--outer {
4
4
  height: 24px;
@@ -95,4 +95,4 @@ import{jsxs as b,jsx as o}from"react/jsx-runtime";import i,{css as l}from"styled
95
95
  user-select: none;
96
96
  color: ${({theme:e,isDisabled:a})=>a?e.colors.text.disabled:e.colors.text.dark};
97
97
  margin-left: 0.5rem;
98
- `,h=({name:e=g("radio-button"),size:a="regular",checked:c=!1,isDisabled:s=!1,color:t="secondary",onChange:d,label:n,...p})=>b(z,{children:[b(m,{onClick:d,isActive:c,isDisabled:s,color:t,children:[o(v,{"data-validate":"checked",checked:c,type:"radio",name:e,id:e,onChange:d,disabled:s,"aria-label":e,...p}),o(C,{size:a,color:t,isChecked:c,isDisabled:s,children:o(w,{className:"circle circle--outer",children:o(j,{className:"circle circle--inner"})})})]}),n&&o(B,{as:"label",htmlFor:e,isDisabled:s,children:n})]});export{h as RadioButton,h as default};
98
+ `,b=({name:e=g("radio-button"),size:a="regular",checked:s=!1,isDisabled:c=!1,color:t="secondary",onChange:h,label:d,...p})=>n(z,{children:[n(m,{onClick:h,isActive:s,isDisabled:c,color:t,children:[o(v,{"data-validate":"checked",checked:s,type:"radio",name:e,id:e,disabled:c,"aria-label":e,"aria-checked":s,...p}),o(C,{size:a,color:t,isChecked:s,isDisabled:c,children:o(w,{className:"circle circle--outer",children:o(j,{className:"circle circle--inner"})})})]}),d&&o(B,{as:"label",htmlFor:e,isDisabled:c,children:d})]});export{b as RadioButton,b as default};
@@ -1,4 +1,4 @@
1
- import{jsxs as k,jsx as a}from"react/jsx-runtime";import{useState as F}from"react";import O from"react-select";import m from"styled-components";import{DEFAULT_TRANSITION_MS as S}from"../../shared/constants.js";import e from"../../theme.js";import{CaptionStyle as R}from"../../typography/BodyText/index.js";import{Label as H}from"../FieldLabel.js";import"../../shared/media-queries.js";const M=m.div`
1
+ import{jsxs as k,jsx as l}from"react/jsx-runtime";import{useState as F}from"react";import O from"react-select";import m from"styled-components";import{DEFAULT_TRANSITION_MS as S}from"../../shared/constants.js";import e from"../../theme.js";import{CaptionStyle as R}from"../../typography/BodyText/index.js";import{Label as H}from"../FieldLabel.js";import"../../shared/media-queries.js";const M=m.div`
2
2
  font-family: ${({theme:o})=>o.typography.fontBaseFamily};
3
3
  position: relative;
4
4
  `,D=o=>o&&{paddingLeft:"2.5rem"},W=o=>o&&{border:`1px solid ${e.colors.gray.light1}`,color:e.colors.gray.dark1,fill:e.colors.gray.light1},j=o=>o&&{border:`2px solid ${e.colors.error.dark}`},A=m.div`
@@ -18,7 +18,7 @@ import{jsxs as k,jsx as a}from"react/jsx-runtime";import{useState as F}from"reac
18
18
  display: block;
19
19
  margin-top: 0.25rem;
20
20
  color: ${({hasError:o})=>o?e.colors.error.dark:e.colors.text.disabled};
21
- `,P=o=>k("svg",{...o,children:[a("symbol",{id:"icon-arrow",viewBox:"0 0 19 19",children:a("path",{d:"M2.03039 7.95496L9.80856 15.7331C9.90619 15.8308 10.0645 15.8308 10.1621 15.7331L17.9403 7.95496L19.0009 9.01562L11.2228 16.7938C10.5394 17.4772 9.43132 17.4772 8.7479 16.7938L0.969727 9.01562L2.03039 7.95496Z"})}),a("use",{xlinkHref:"#icon-arrow"})]}),V=m(P)`
21
+ `,P=o=>k("svg",{...o,children:[l("symbol",{id:"icon-arrow",viewBox:"0 0 19 19",children:l("path",{d:"M2.03039 7.95496L9.80856 15.7331C9.90619 15.8308 10.0645 15.8308 10.1621 15.7331L17.9403 7.95496L19.0009 9.01562L11.2228 16.7938C10.5394 17.4772 9.43132 17.4772 8.7479 16.7938L0.969727 9.01562L2.03039 7.95496Z"})}),l("use",{xlinkHref:"#icon-arrow"})]}),V=m(P)`
22
22
  width: 0.75rem;
23
23
  height: 0.75rem;
24
24
  margin: 0;
@@ -36,4 +36,4 @@ import{jsxs as k,jsx as a}from"react/jsx-runtime";import{useState as F}from"reac
36
36
  transform: ${o=>o.$isMenuOpen?"rotate(-180deg)":"rotate(0deg)"};
37
37
 
38
38
  transform-origin: 50% 60%;
39
- `,G=(o,l)=>l?e.colors.error.main:o?e.colors.text.dark:e.colors.gray.light1,U=({selectProps:{menuIsOpen:o=!1},isFocused:l=!1,isDisabled:p})=>a(V,{$isDisabled:p,$isFocused:l,$isMenuOpen:o,$theme:e});function w({className:o,color:l="primary",forwardRef:p,hasError:s=!1,height:n,helperText:u,isDisabled:d=!1,onBlur:L=()=>null,onFocus:v=()=>null,onInputChange:C=()=>null,placeholder:I="",name:g,...i}){const[c,f]=F(!1),[T,B]=F(""),z=(r,t)=>{C(r,t),B(r)},b=({isSelected:r,isFocused:t,isDisabled:h})=>r?e.colors[l].main:h?e.colors.background.light:t?e.colors.background.gray:e.colors.background.light,E=r=>{f(!0),v(r)},N=r=>{f(!1),L(r)},x=G(c,s),$=!i.label;return k(M,{className:o,children:[!$&&i.label&&a(H,{htmlFor:g,height:n,isFocused:c,hasValue:!!(i.value||T),disabled:d,theme:e,hasError:s,children:i.label}),i.prefix&&a(A,{isDisabled:d,isFocused:c,children:i.prefix}),a(O,{...i,inputId:g,name:g,ref:p,isDisabled:d,onInputChange:z,placeholder:I,onFocus:E,onBlur:N,styles:{control:r=>({...r,borderRadius:0,color:e.colors.text.dark,fontFamily:e.typography.fontBaseFamily,fontSize:"1rem",fontWeight:400,cursor:"pointer",padding:"0.7rem 0.5rem",backgroundColor:e.colors.background.light,borderColor:x,boxShadow:"none",minHeight:"3rem","&:hover":{borderColor:"none"},...W(d),...j(s),...D(!!i.prefix)}),input:r=>({...r,height:"auto",margin:0,padding:0}),placeholder:r=>{const t={...r,fontSize:"1rem",lineHeight:"1.5rem",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",margin:0};return $?{...t,color:e.colors.text.dark,fontWeight:600}:{...t,display:c?"static":"none"}},menuList:r=>({...r,padding:"0.5rem 0",paddingBottom:"5rem",marginTop:0,border:`1px solid ${x}`,borderTop:"none",display:"flex",flexDirection:"column",gap:"0.5rem"}),menu:r=>({...r,borderRadius:0,boxShadow:"none",zIndex:5,padding:"0",marginTop:"-0.1rem"}),option:(r,{isSelected:t,isFocused:h,isDisabled:y})=>({...r,padding:"0.5rem",lineHeight:"1.5rem",fontSize:"1rem",fontWeight:400,cursor:y?"not-allowed":"pointer","&:hover":{background:b({isSelected:t,isFocused:!0,isDisabled:y})},background:b({isSelected:t,isFocused:h}),...D(!!i.prefix)}),valueContainer:r=>({...r,position:"static",padding:n?`${n-1}rem 0 `:0,height:n?"auto":"1.5rem"}),clearIndicator:r=>({...r,paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:"0.2rem"})},components:{IndicatorSeparator:()=>null,DropdownIndicator:U,...i.components??{}}}),u&&a(_,{hasError:s,children:u})]})}export{w as Select,w as default};
39
+ `,G=(o,n)=>n?e.colors.error.main:o?e.colors.text.dark:e.colors.gray.light1,U=({selectProps:{menuIsOpen:o=!1},isFocused:n=!1,isDisabled:p})=>l(V,{$isDisabled:p,$isFocused:n,$isMenuOpen:o,$theme:e});function w({className:o,color:n="primary",forwardRef:p,hasError:t=!1,height:s,helperText:u,isDisabled:d=!1,onBlur:L=()=>null,onFocus:v=()=>null,onInputChange:C=()=>null,placeholder:I="",name:g,...i}){const[c,f]=F(!1),[T,B]=F(""),z=(r,a)=>{C(r,a),B(r)},b=({isSelected:r,isFocused:a,isDisabled:h})=>r?e.colors[n].main:h?e.colors.background.light:a?e.colors.background.gray:e.colors.background.light,E=r=>{f(!0),v(r)},N=r=>{f(!1),L(r)},x=G(c,t),$=!i.label;return k(M,{className:o,children:[!$&&i.label&&l(H,{htmlFor:g,height:s,isFocused:c,hasValue:!!(i.value||T),disabled:d,theme:e,hasError:t,children:i.label}),i.prefix&&l(A,{isDisabled:d,isFocused:c,children:i.prefix}),l(O,{...i,id:"react-select",inputId:g,name:g,ref:p,isDisabled:d,onInputChange:z,placeholder:I,onFocus:E,onBlur:N,styles:{control:r=>({...r,borderRadius:0,color:e.colors.text.dark,fontFamily:e.typography.fontBaseFamily,fontSize:"1rem",fontWeight:400,cursor:"pointer",padding:"0.7rem 0.5rem",backgroundColor:e.colors.background.light,borderColor:x,boxShadow:"none",minHeight:"3rem","&:hover":{borderColor:"none"},...W(d),...j(t),...D(!!i.prefix)}),input:r=>({...r,height:"auto",margin:0,padding:0}),placeholder:r=>{const a={...r,fontSize:"1rem",lineHeight:"1.5rem",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",margin:0};return $?{...a,color:e.colors.text.dark,fontWeight:600}:{...a,display:c?"static":"none"}},menuList:r=>({...r,padding:"0.5rem 0",paddingBottom:"5rem",marginTop:0,border:`1px solid ${x}`,borderTop:"none",display:"flex",flexDirection:"column",gap:"0.5rem"}),menu:r=>({...r,borderRadius:0,boxShadow:"none",zIndex:5,padding:"0",marginTop:"-0.1rem"}),option:(r,{isSelected:a,isFocused:h,isDisabled:y})=>({...r,padding:"0.5rem",lineHeight:"1.5rem",fontSize:"1rem",fontWeight:400,cursor:y?"not-allowed":"pointer","&:hover":{background:b({isSelected:a,isFocused:!0,isDisabled:y})},background:b({isSelected:a,isFocused:h}),...D(!!i.prefix)}),valueContainer:r=>({...r,position:"static",padding:s?`${s-1}rem 0 `:0,height:s?"auto":"1.5rem"}),clearIndicator:r=>({...r,paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:"0.2rem"})},components:{IndicatorSeparator:()=>null,DropdownIndicator:U,...i.components??{}}}),u&&l(_,{hasError:t,children:u})]})}export{w as Select,w as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kvdbil/components",
3
- "version": "14.3.7",
3
+ "version": "14.3.8",
4
4
  "sideEffects": false,
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",
@@ -57,17 +57,17 @@
57
57
  "@svgr/cli": "^8.0.0",
58
58
  "@team-griffin/install-self-peers": "^1.1.1",
59
59
  "@testing-library/dom": "^10.4.0",
60
- "@testing-library/jest-dom": "^6.4.8",
61
- "@testing-library/react": "12.1.5",
60
+ "@testing-library/jest-dom": "^6.5.0",
61
+ "@testing-library/react": "^16.0.1",
62
62
  "@testing-library/react-hooks": "^8.0.1",
63
- "@testing-library/user-event": "^14.0.1",
63
+ "@testing-library/user-event": "^14.5.2",
64
64
  "@types/classnames": "^2.2.11",
65
65
  "@types/jest": "^29.5.12",
66
66
  "@types/node": "^22.4.1",
67
- "@types/react": "^17.0.2",
68
- "@types/react-collapse": "^5.0.0",
69
- "@types/react-dom": "^17.0.2",
70
- "@types/react-transition-group": "^4.4.0",
67
+ "@types/react": "^18.3.8",
68
+ "@types/react-collapse": "^5.0.4",
69
+ "@types/react-dom": "^18.3.0",
70
+ "@types/react-transition-group": "^4.4.11",
71
71
  "@types/uuid": "^10.0.0",
72
72
  "@typescript-eslint/eslint-plugin": "^7.0.0",
73
73
  "@typescript-eslint/parser": "^7.0.0",
@@ -88,14 +88,14 @@
88
88
  "husky": "^9.1.5",
89
89
  "jest": "^29.7.0",
90
90
  "jest-environment-jsdom": "^29.7.0",
91
- "jest-styled-components": "^7.0.3",
91
+ "jest-styled-components": "^7.2.0",
92
92
  "jest-watch-typeahead": "^2.2.2",
93
93
  "prettier": "^2.6.2",
94
- "react": "^17.0.2",
94
+ "react": "^18.3.1",
95
95
  "react-collapse": "^5.0.1",
96
96
  "react-day-picker": "^7.4.8",
97
97
  "react-docgen-typescript": "^2.2.2",
98
- "react-dom": "^17.0.2",
98
+ "react-dom": "^18.3.1",
99
99
  "react-is": "^18.3.1",
100
100
  "react-select": "5.8.0",
101
101
  "react-select-event": "5.5.1",
@@ -1,5 +1,5 @@
1
1
  import { Locale } from '../../Types';
2
- interface NavBarProps {
2
+ export interface NavBarProps {
3
3
  month: Date;
4
4
  onPreviousClick(callback?: () => void): void;
5
5
  onNextClick(callback?: () => void): void;
@@ -1,4 +1,8 @@
1
- type IconModule = [string, CallableFunction];
1
+ import React from 'react';
2
+ type IconModule = [
3
+ string,
4
+ (icon: React.SVGProps<SVGSVGElement>) => JSX.Element
5
+ ];
2
6
  export interface IconsProps {
3
7
  background: string;
4
8
  color: string;