@kvdbil/components 8.6.2 → 8.6.3

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,7 +1,7 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("react-select"),o=require("styled-components"),t=require("../../shared/constants.js"),a=require("../../theme.js"),l=require("../FieldLabel.js");function i(y){return y&&typeof y=="object"&&"default"in y?y:{default:y}}require("../../typography/BodyText/index.js"),require("../../shared/media-queries.js");var d=i(e),s=i(r),n=i(o);const u=n.default.div`
2
- font-family: ${({theme:y})=>y.typography.fontBaseFamily};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("react-select"),o=require("styled-components"),t=require("../../shared/constants.js"),a=require("../../theme.js"),l=require("../FieldLabel.js");function d(x){return x&&typeof x=="object"&&"default"in x?x:{default:x}}require("../../typography/BodyText/index.js"),require("../../shared/media-queries.js");var i=d(e),s=d(r),n=d(o);const u=n.default.div`
2
+ font-family: ${({theme:x})=>x.typography.fontBaseFamily};
3
3
  position: relative;
4
- `,c=y=>y&&{paddingLeft:"2.5rem"},f=y=>y&&{border:`1px solid ${a.default.colors.gray.light1}`,color:a.default.colors.gray.dark1,fill:a.default.colors.gray.light1},m=n.default.div`
4
+ `,c=x=>x&&{paddingLeft:"2.5rem"},f=x=>x&&{border:`1px solid ${a.default.colors.gray.light1}`,color:a.default.colors.gray.dark1,fill:a.default.colors.gray.light1},m=x=>x&&{border:`2px solid ${a.default.colors.error.dark}`},p=n.default.div`
5
5
  position: absolute;
6
6
  z-index: 1;
7
7
  top: 0.5rem;
@@ -10,26 +10,25 @@
10
10
  fill: ${a.default.colors.gray.dark5};
11
11
  transition: ${t.DEFAULT_TRANSITION_MS};
12
12
 
13
- ${y=>y.isDisabled&&`
13
+ ${x=>x.isDisabled&&`
14
14
  fill: ${a.default.colors.gray.light1};
15
15
  `}
16
16
 
17
- ${y=>y.isFocused&&`
18
- fill: ${y.theme.colors.text.dark};
17
+ ${x=>x.isFocused&&`
18
+ fill: ${x.theme.colors.text.dark};
19
19
  `}
20
- `,p=n.default.span`
20
+ `,h=n.default.span`
21
21
  display: block;
22
- font-family: ${({theme:y})=>y.typography.fontBaseFamily};
22
+ font-family: ${({theme:x})=>x.typography.fontBaseFamily};
23
23
  font-size: 0.81rem;
24
24
  margin-top: 0.25rem;
25
- margin-left: 0.85rem;
26
- color: ${({hasError:y})=>y?a.default.colors.error.main:a.default.colors.text.disabled};
27
- `,h=n.default(y=>d.default.createElement("svg",{...y},d.default.createElement("symbol",{id:"icon-arrow",viewBox:"0 0 19 19"},d.default.createElement("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"})),d.default.createElement("use",{xlinkHref:"#icon-arrow"})))`
25
+ color: ${({hasError:x})=>x?a.default.colors.error.dark:a.default.colors.text.disabled};
26
+ `,g=n.default(x=>i.default.createElement("svg",{...x},i.default.createElement("symbol",{id:"icon-arrow",viewBox:"0 0 19 19"},i.default.createElement("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"})),i.default.createElement("use",{xlinkHref:"#icon-arrow"})))`
28
27
  width: 0.8rem;
29
28
  height: 0.8rem;
30
29
  margin: 0 0.5rem;
31
- ${y=>y.$isFocused&&`color: ${y.$theme.colors.text.dark}`}
32
- ${y=>y.$isDisabled&&`color: ${y.$theme.colors.gray.dark1}`}
30
+ ${x=>x.$isFocused&&`color: ${x.$theme.colors.text.dark}`}
31
+ ${x=>x.$isDisabled&&`color: ${x.$theme.colors.gray.dark1}`}
33
32
 
34
33
 
35
34
  path {
@@ -39,6 +38,6 @@
39
38
 
40
39
  transition: transform ${t.DEFAULT_TRANSITION_MS};
41
40
 
42
- transform: ${y=>y.$isMenuOpen?"rotate(-180deg)":"rotate(0deg)"};
41
+ transform: ${x=>x.$isMenuOpen?"rotate(-180deg)":"rotate(0deg)"};
43
42
  transform-origin: 50% 60%;
44
- `,g=({selectProps:{menuIsOpen:y=!1},isFocused:D=!1,isDisabled:I})=>d.default.createElement(h,{$isDisabled:I,$isFocused:D,$isMenuOpen:y,$theme:a.default}),b=({className:y,color:D="primary",forwardRef:I,hasError:L=!1,height:v,helperText:C,isDisabled:S=!1,onBlur:M=()=>null,onFocus:N=()=>null,onInputChange:O=()=>null,placeholder:_="",name:B,...$})=>{var q;const[k,T]=e.useState(!1),[R,z]=e.useState(""),E=({isSelected:x,isFocused:F,isDisabled:w})=>x?a.default.colors[D].main:w?a.default.colors.background.light:F?a.default.colors.background.gray:a.default.colors.background.light,A=((x,F)=>F?a.default.colors.error.main:x?a.default.colors.text.dark:a.default.colors.gray.light1)(k,L);return d.default.createElement(u,{className:y},$.label&&d.default.createElement(l.Label,{htmlFor:B,height:v,isFocused:k,hasValue:Boolean($.value||R),disabled:S,theme:a.default,hasError:L},$.label),$.prefix&&d.default.createElement(m,{isDisabled:S,isFocused:k},$.prefix),d.default.createElement(s.default,{...$,inputId:B,name:B,ref:I,isDisabled:S,onInputChange:(x,F)=>{O(x,F),z(x)},placeholder:_,onFocus:x=>{T(!0),N(x)},onBlur:x=>{T(!1),M(x)},styles:{control:x=>({...x,borderRadius:0,color:a.default.colors.text.dark,fontFamily:a.default.typography.fontBaseFamily,fontSize:"1rem",fontWeight:400,cursor:"pointer",padding:"0.7rem 0.75rem",backgroundColor:a.default.colors.background.light,borderColor:A,boxShadow:"none",minHeight:"3rem","&:hover":{borderColor:"none"},...f(S),...c(Boolean($.prefix))}),placeholder:x=>({...x,display:k?"static":"none"}),singleValue:x=>({...x,maxWidth:"calc(100% - 3.3rem)",width:"calc(100% - 3.3rem)"}),menuList:x=>({...x,padding:"8px 0"}),menu:x=>({...x,borderRadius:0,boxShadow:a.default.elevations.elevation2,zIndex:2,padding:"0"}),option:(x,{isSelected:F,isFocused:w,isDisabled:j})=>({...x,padding:"1rem",cursor:j?"not-allowed":"pointer","&:hover":{background:E({isSelected:F,isFocused:!0,isDisabled:j})},background:E({isSelected:F,isFocused:w}),...c(Boolean($.prefix))}),valueContainer:x=>({...x,position:"static",padding:v?v-1+"rem 0 ":0,height:v?"auto":"21px"}),clearIndicator:x=>({...x,paddingTop:0,paddingBottom:0})},components:{IndicatorSeparator:()=>null,DropdownIndicator:g,...(q=$.components)!=null?q:{}}}),C&&d.default.createElement(p,{hasError:L},C))};exports.Select=b,exports.default=b;
43
+ `,b=({selectProps:{menuIsOpen:x=!1},isFocused:L=!1,isDisabled:B})=>i.default.createElement(g,{$isDisabled:B,$isFocused:L,$isMenuOpen:x,$theme:a.default}),y=({className:x,color:L="primary",forwardRef:B,hasError:S=!1,height:D,helperText:q,isDisabled:E=!1,onBlur:N=()=>null,onFocus:O=()=>null,onInputChange:_=()=>null,placeholder:R="",name:w,...F})=>{var T;const[I,j]=e.useState(!1),[z,A]=e.useState(""),v=({isSelected:$,isFocused:k,isDisabled:C})=>$?a.default.colors[L].main:C?a.default.colors.background.light:k?a.default.colors.background.gray:a.default.colors.background.light,H=(($,k)=>k?a.default.colors.error.main:$?a.default.colors.text.dark:a.default.colors.gray.light1)(I,S);return i.default.createElement(u,{className:x},F.label&&i.default.createElement(l.Label,{htmlFor:w,height:D,isFocused:I,hasValue:Boolean(F.value||z),disabled:E,theme:a.default,hasError:S},F.label),F.prefix&&i.default.createElement(p,{isDisabled:E,isFocused:I},F.prefix),i.default.createElement(s.default,{...F,inputId:w,name:w,ref:B,isDisabled:E,onInputChange:($,k)=>{_($,k),A($)},placeholder:R,onFocus:$=>{j(!0),O($)},onBlur:$=>{j(!1),N($)},styles:{control:$=>({...$,borderRadius:0,color:a.default.colors.text.dark,fontFamily:a.default.typography.fontBaseFamily,fontSize:"1rem",fontWeight:400,cursor:"pointer",padding:"0.7rem 0.75rem",backgroundColor:a.default.colors.background.light,borderColor:H,boxShadow:"none",minHeight:"3rem","&:hover":{borderColor:"none"},...f(E),...m(S),...c(Boolean(F.prefix))}),placeholder:$=>({...$,display:I?"static":"none"}),singleValue:$=>({...$,maxWidth:"calc(100% - 3.3rem)",width:"calc(100% - 3.3rem)"}),menuList:$=>({...$,padding:"8px 0"}),menu:$=>({...$,borderRadius:0,boxShadow:a.default.elevations.elevation2,zIndex:2,padding:"0"}),option:($,{isSelected:k,isFocused:C,isDisabled:M})=>({...$,padding:"1rem",cursor:M?"not-allowed":"pointer","&:hover":{background:v({isSelected:k,isFocused:!0,isDisabled:M})},background:v({isSelected:k,isFocused:C}),...c(Boolean(F.prefix))}),valueContainer:$=>({...$,position:"static",padding:D?D-1+"rem 0 ":0,height:D?"auto":"21px"}),clearIndicator:$=>({...$,paddingTop:0,paddingBottom:0})},components:{IndicatorSeparator:()=>null,DropdownIndicator:b,...(T=F.components)!=null?T:{}}}),q&&i.default.createElement(h,{hasError:S},q))};exports.Select=y,exports.default=y;
@@ -1,14 +1,14 @@
1
- import t,{useState as x}from"react";import T from"react-select";import d from"styled-components";import{DEFAULT_TRANSITION_MS as F}from"../../shared/constants.js";import r from"../../theme.js";import{Label as _}from"../FieldLabel.js";import"../../typography/BodyText/index.js";import"../../shared/media-queries.js";const z=d.div`
1
+ import t,{useState as x}from"react";import T from"react-select";import m from"styled-components";import{DEFAULT_TRANSITION_MS as k}from"../../shared/constants.js";import r from"../../theme.js";import{Label as _}from"../FieldLabel.js";import"../../typography/BodyText/index.js";import"../../shared/media-queries.js";const z=m.div`
2
2
  font-family: ${({theme:e})=>e.typography.fontBaseFamily};
3
3
  position: relative;
4
- `,k=e=>e&&{paddingLeft:"2.5rem"},A=e=>e&&{border:`1px solid ${r.colors.gray.light1}`,color:r.colors.gray.dark1,fill:r.colors.gray.light1},M=d.div`
4
+ `,F=e=>e&&{paddingLeft:"2.5rem"},A=e=>e&&{border:`1px solid ${r.colors.gray.light1}`,color:r.colors.gray.dark1,fill:r.colors.gray.light1},M=e=>e&&{border:`2px solid ${r.colors.error.dark}`},O=m.div`
5
5
  position: absolute;
6
6
  z-index: 1;
7
7
  top: 0.5rem;
8
8
  margin: 0.35rem 0.75rem;
9
9
 
10
10
  fill: ${r.colors.gray.dark5};
11
- transition: ${F};
11
+ transition: ${k};
12
12
 
13
13
  ${e=>e.isDisabled&&`
14
14
  fill: ${r.colors.gray.light1};
@@ -17,14 +17,13 @@ import t,{useState as x}from"react";import T from"react-select";import d from"st
17
17
  ${e=>e.isFocused&&`
18
18
  fill: ${e.theme.colors.text.dark};
19
19
  `}
20
- `,O=d.span`
20
+ `,H=m.span`
21
21
  display: block;
22
22
  font-family: ${({theme:e})=>e.typography.fontBaseFamily};
23
23
  font-size: 0.81rem;
24
24
  margin-top: 0.25rem;
25
- margin-left: 0.85rem;
26
- color: ${({hasError:e})=>e?r.colors.error.main:r.colors.text.disabled};
27
- `,H=e=>t.createElement("svg",{...e},t.createElement("symbol",{id:"icon-arrow",viewBox:"0 0 19 19"},t.createElement("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"})),t.createElement("use",{xlinkHref:"#icon-arrow"})),V=d(H)`
25
+ color: ${({hasError:e})=>e?r.colors.error.dark:r.colors.text.disabled};
26
+ `,V=e=>t.createElement("svg",{...e},t.createElement("symbol",{id:"icon-arrow",viewBox:"0 0 19 19"},t.createElement("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"})),t.createElement("use",{xlinkHref:"#icon-arrow"})),N=m(V)`
28
27
  width: 0.8rem;
29
28
  height: 0.8rem;
30
29
  margin: 0 0.5rem;
@@ -37,8 +36,8 @@ import t,{useState as x}from"react";import T from"react-select";import d from"st
37
36
  stroke: currentColor;
38
37
  }
39
38
 
40
- transition: transform ${F};
39
+ transition: transform ${k};
41
40
 
42
41
  transform: ${e=>e.$isMenuOpen?"rotate(-180deg)":"rotate(0deg)"};
43
42
  transform-origin: 50% 60%;
44
- `,N=(e,l)=>l?r.colors.error.main:e?r.colors.text.dark:r.colors.gray.light1,P=({selectProps:{menuIsOpen:e=!1},isFocused:l=!1,isDisabled:m})=>t.createElement(V,{$isDisabled:m,$isFocused:l,$isMenuOpen:e,$theme:r}),C=({className:e,color:l="primary",forwardRef:m,hasError:u=!1,height:i,helperText:p,isDisabled:s=!1,onBlur:v=()=>null,onFocus:B=()=>null,onInputChange:w=()=>null,placeholder:I="",name:g,...n})=>{var h;const[c,y]=x(!1),[L,S]=x(""),E=(o,a)=>{w(o,a),S(o)},b=({isSelected:o,isFocused:a,isDisabled:f})=>o?r.colors[l].main:f?r.colors.background.light:a?r.colors.background.gray:r.colors.background.light,j=o=>{y(!0),B(o)},D=o=>{y(!1),v(o)},R=N(c,u);return t.createElement(z,{className:e},n.label&&t.createElement(_,{htmlFor:g,height:i,isFocused:c,hasValue:Boolean(n.value||L),disabled:s,theme:r,hasError:u},n.label),n.prefix&&t.createElement(M,{isDisabled:s,isFocused:c},n.prefix),t.createElement(T,{...n,inputId:g,name:g,ref:m,isDisabled:s,onInputChange:E,placeholder:I,onFocus:j,onBlur:D,styles:{control:o=>({...o,borderRadius:0,color:r.colors.text.dark,fontFamily:r.typography.fontBaseFamily,fontSize:"1rem",fontWeight:400,cursor:"pointer",padding:"0.7rem 0.75rem",backgroundColor:r.colors.background.light,borderColor:R,boxShadow:"none",minHeight:"3rem","&:hover":{borderColor:"none"},...A(s),...k(Boolean(n.prefix))}),placeholder:o=>({...o,display:c?"static":"none"}),singleValue:o=>({...o,maxWidth:"calc(100% - 3.3rem)",width:"calc(100% - 3.3rem)"}),menuList:o=>({...o,padding:"8px 0"}),menu:o=>({...o,borderRadius:0,boxShadow:r.elevations.elevation2,zIndex:2,padding:"0"}),option:(o,{isSelected:a,isFocused:f,isDisabled:$})=>({...o,padding:"1rem",cursor:$?"not-allowed":"pointer","&:hover":{background:b({isSelected:a,isFocused:!0,isDisabled:$})},background:b({isSelected:a,isFocused:f}),...k(Boolean(n.prefix))}),valueContainer:o=>({...o,position:"static",padding:i?`${i-1}rem 0 `:0,height:i?"auto":"21px"}),clearIndicator:o=>({...o,paddingTop:0,paddingBottom:0})},components:{IndicatorSeparator:()=>null,DropdownIndicator:P,...(h=n.components)!=null?h:{}}}),p&&t.createElement(O,{hasError:u},p))};export{C as Select,C as default};
43
+ `,P=(e,a)=>a?r.colors.error.main:e?r.colors.text.dark:r.colors.gray.light1,W=({selectProps:{menuIsOpen:e=!1},isFocused:a=!1,isDisabled:u})=>t.createElement(N,{$isDisabled:u,$isFocused:a,$isMenuOpen:e,$theme:r}),C=({className:e,color:a="primary",forwardRef:u,hasError:i=!1,height:s,helperText:p,isDisabled:c=!1,onBlur:v=()=>null,onFocus:B=()=>null,onInputChange:w=()=>null,placeholder:I="",name:g,...n})=>{var h;const[d,y]=x(!1),[L,S]=x(""),E=(o,l)=>{w(o,l),S(o)},b=({isSelected:o,isFocused:l,isDisabled:f})=>o?r.colors[a].main:f?r.colors.background.light:l?r.colors.background.gray:r.colors.background.light,j=o=>{y(!0),B(o)},D=o=>{y(!1),v(o)},R=P(d,i);return t.createElement(z,{className:e},n.label&&t.createElement(_,{htmlFor:g,height:s,isFocused:d,hasValue:Boolean(n.value||L),disabled:c,theme:r,hasError:i},n.label),n.prefix&&t.createElement(O,{isDisabled:c,isFocused:d},n.prefix),t.createElement(T,{...n,inputId:g,name:g,ref:u,isDisabled:c,onInputChange:E,placeholder:I,onFocus:j,onBlur:D,styles:{control:o=>({...o,borderRadius:0,color:r.colors.text.dark,fontFamily:r.typography.fontBaseFamily,fontSize:"1rem",fontWeight:400,cursor:"pointer",padding:"0.7rem 0.75rem",backgroundColor:r.colors.background.light,borderColor:R,boxShadow:"none",minHeight:"3rem","&:hover":{borderColor:"none"},...A(c),...M(i),...F(Boolean(n.prefix))}),placeholder:o=>({...o,display:d?"static":"none"}),singleValue:o=>({...o,maxWidth:"calc(100% - 3.3rem)",width:"calc(100% - 3.3rem)"}),menuList:o=>({...o,padding:"8px 0"}),menu:o=>({...o,borderRadius:0,boxShadow:r.elevations.elevation2,zIndex:2,padding:"0"}),option:(o,{isSelected:l,isFocused:f,isDisabled:$})=>({...o,padding:"1rem",cursor:$?"not-allowed":"pointer","&:hover":{background:b({isSelected:l,isFocused:!0,isDisabled:$})},background:b({isSelected:l,isFocused:f}),...F(Boolean(n.prefix))}),valueContainer:o=>({...o,position:"static",padding:s?`${s-1}rem 0 `:0,height:s?"auto":"21px"}),clearIndicator:o=>({...o,paddingTop:0,paddingBottom:0})},components:{IndicatorSeparator:()=>null,DropdownIndicator:W,...(h=n.components)!=null?h:{}}}),p&&t.createElement(H,{hasError:i},p))};export{C as Select,C as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kvdbil/components",
3
- "version": "8.6.2",
3
+ "version": "8.6.3",
4
4
  "sideEffects": false,
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",