@kvdbil/components 13.7.1 → 13.9.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/Button/index.js +11 -10
- package/cjs/components/Button/styles.js +12 -12
- package/cjs/components/Tabs/Tabs.js +16 -12
- package/cjs/components/Tabs/index.js +1 -1
- package/esm/components/Button/index.js +20 -19
- package/esm/components/Button/styles.js +11 -11
- package/esm/components/Tabs/Tabs.js +16 -12
- package/esm/components/Tabs/index.js +1 -1
- package/package.json +1 -1
- package/types/components/Button/index.d.ts +3 -2
- package/types/components/Button/styles.d.ts +2 -2
- package/types/components/Tabs/Tabs.d.ts +4 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("styled-components"),l=require("../../theme.js"),r=require("../Spinner/index.js"),i=require("../../typography/ButtonText/index.js"),a=require("./styles.js");function s(x){return x&&typeof x=="object"&&"default"in x?x:{default:x}}var o=s(e),n=s(t);const
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("styled-components"),l=require("../../theme.js"),r=require("../Spinner/index.js"),i=require("../../typography/ButtonText/index.js"),a=require("./styles.js");function s(x){return x&&typeof x=="object"&&"default"in x?x:{default:x}}var o=s(e),n=s(t);const d=n.default.button`
|
|
2
2
|
${i.BasicButtonFontStyle}
|
|
3
3
|
box-sizing: border-box;
|
|
4
4
|
outline: none;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
width: ${({fullWidth:x})=>x&&"100%"};
|
|
11
11
|
display: flex;
|
|
12
12
|
align-items: center;
|
|
13
|
-
justify-content: ${({sufixIcon:x,prefixIcon:
|
|
13
|
+
justify-content: ${({sufixIcon:x,prefixIcon:h,isLoading:S})=>S||!x&&!h?"center":"space-between"};
|
|
14
14
|
|
|
15
15
|
${({size:x="small"})=>a.fontSizes[x]||i.ButtonRegularTextStyle}
|
|
16
16
|
${({size:x})=>t.css`
|
|
@@ -19,21 +19,22 @@
|
|
|
19
19
|
${x==="large"&&a.largeSizeStyles()}
|
|
20
20
|
`}
|
|
21
21
|
background-color: transparent;
|
|
22
|
-
transition: color 0.3s ease, background-color 0.3s ease, border 0.3s ease
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
transition: color 0.3s ease, background-color 0.3s ease, border 0.3s ease,
|
|
23
|
+
filter 0.3s;
|
|
24
|
+
${({variant:x="solid",color:h="primary",colorShade:S="main",disabled:v,theme:$})=>t.css`
|
|
25
|
+
${v?a.disabledColorStyles($,x):a.colorStyles[x]($,h,S)}
|
|
25
26
|
`}
|
|
26
27
|
&:focus-visible {
|
|
27
28
|
box-shadow: 0px 0px 0px 1px ${({theme:x})=>x.colors.gray.light5};
|
|
28
29
|
}
|
|
29
|
-
`,
|
|
30
|
+
`,u={smaller:"1rem",small:"1rem",regular:"1.5rem",large:"1.5rem"},c={smaller:"0.5rem",small:"0.5rem",regular:"1rem",large:"1rem"},f=n.default.span`
|
|
30
31
|
display: flex;
|
|
31
|
-
margin-right: ${({type:x,size:
|
|
32
|
-
margin-left: ${({type:x,size:
|
|
33
|
-
font-size: ${({size:x})=>
|
|
32
|
+
margin-right: ${({type:x,size:h})=>x==="prefix"?c[h]:0};
|
|
33
|
+
margin-left: ${({type:x,size:h})=>x==="sufix"?c[h]:0};
|
|
34
|
+
font-size: ${({size:x})=>u[x]};
|
|
34
35
|
opacity: ${({isLoading:x})=>x?0:1};
|
|
35
36
|
`,m=n.default(r.default)`
|
|
36
37
|
position: absolute;
|
|
37
38
|
`,p=n.default.span`
|
|
38
39
|
opacity: ${({isLoading:x})=>x?0:1};
|
|
39
|
-
`,g={smaller:1,small:1,regular:1.5,large:1.5},y=e.forwardRef(({size:x="small",color:
|
|
40
|
+
`,g={smaller:1,small:1,regular:1.5,large:1.5},y=e.forwardRef(({size:x="small",color:h="primary",colorShade:S="main",variant:v="solid",fullWidth:$=!1,isDisabled:q=!1,isLoading:z=!1,children:B,sufixIcon:E,prefixIcon:L,minWidth:I,as:W="button",...w},k)=>{return o.default.createElement(d,{...w,as:W,minWidth:I,color:h,colorShade:S,disabled:q||z,fullWidth:$,theme:l.default,variant:v,size:x,isLoading:z,ref:k,prefixIcon:L,sufixIcon:E},o.default.createElement(o.default.Fragment,null,L&&o.default.createElement(f,{size:x,type:"prefix",isLoading:z},L),(j=z,typeof(b=B)=="string"||typeof b=="number"?o.default.createElement(p,{isLoading:j},b):o.default.isValidElement(b)?o.default.cloneElement(b,{style:{...b.props.style,opacity:j?0:1}}):b),E&&o.default.createElement(f,{size:x,type:"sufix",isLoading:z},E),z&&o.default.createElement(m,{color:l.default.colors.gray.light1,size:g[x]})));var b,j});y.displayName="Button",exports.Button=y,exports.default=y;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("../../typography/ButtonText/index.js");require("react"),require("styled-components");const r={smaller:o.ButtonSmallTextStyle,small:o.ButtonRegularTextStyle,regular:o.ButtonRegularTextStyle,large:o.ButtonLargeTextStyle},
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("../../typography/ButtonText/index.js");require("react"),require("styled-components");const r={smaller:o.ButtonSmallTextStyle,small:o.ButtonRegularTextStyle,regular:o.ButtonRegularTextStyle,large:o.ButtonLargeTextStyle},e=(s,a)=>`
|
|
2
2
|
color: ${s.colors[a].main};
|
|
3
3
|
border: 2px solid ${s.colors[a].main};
|
|
4
4
|
background-color: transparent;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
border: 2px solid ${s.colors[a].light};
|
|
13
13
|
color: ${s.colors[a].light};
|
|
14
14
|
}
|
|
15
|
-
`,
|
|
15
|
+
`,l=(s,a)=>`
|
|
16
16
|
color: ${a!=="neutral"?s.colors[a].main:s.colors.neutral.light};
|
|
17
17
|
background-color: transparent;
|
|
18
18
|
|
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
:active {
|
|
24
24
|
color: ${s.colors[a].dark};
|
|
25
25
|
}
|
|
26
|
-
`,
|
|
26
|
+
`,n=s=>`
|
|
27
27
|
color: ${s.colors.gray.light1};
|
|
28
28
|
cursor: not-allowed;
|
|
29
|
-
`,t={solid:(s,a)=>`
|
|
29
|
+
`,t={solid:(s,a,i)=>`
|
|
30
30
|
color: ${s.colors.text.light};
|
|
31
|
-
background-color: ${s.colors[a]
|
|
31
|
+
background-color: ${s.colors[a][i]};
|
|
32
32
|
|
|
33
33
|
:hover {
|
|
34
34
|
border-color: ${s.colors[a].dark};
|
|
35
|
-
|
|
35
|
+
filter: brightness(0.9)
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
:active {
|
|
39
39
|
border-color: ${s.colors[a].light};
|
|
40
|
-
|
|
40
|
+
filter: brightness(1.1)
|
|
41
41
|
}
|
|
42
|
-
`,outline:
|
|
43
|
-
${
|
|
42
|
+
`,outline:e,flat:l};exports.colorStyles=t,exports.disabledColorStyles=(s,a)=>a==="solid"?`
|
|
43
|
+
${n(s)};
|
|
44
44
|
background-color: ${s.colors.gray.light4};`:a==="outline"?`
|
|
45
|
-
${
|
|
46
|
-
border: 2px solid ${s.colors.gray.light1};`:
|
|
45
|
+
${n(s)};
|
|
46
|
+
border: 2px solid ${s.colors.gray.light1};`:n(s),exports.flatColorStyles=l,exports.fontSizes=r,exports.largeSizeStyles=()=>`
|
|
47
47
|
padding: 0.25rem 1.5rem;
|
|
48
48
|
min-height: 3.75rem;
|
|
49
|
-
`,exports.outlineColorStyles=
|
|
49
|
+
`,exports.outlineColorStyles=e,exports.regularSizeStyles=()=>`
|
|
50
50
|
padding: 0.25rem 1.5rem;
|
|
51
51
|
min-height: 3rem;
|
|
52
52
|
`,exports.smallerAndSmallSizeStyles=()=>`
|
|
@@ -1,24 +1,28 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("./Tab.js"),r=require("styled-components"),l=require("../../shared/media-queries.js"),i=require("react-collapse");function
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("./Tab.js"),r=require("styled-components"),l=require("../../shared/media-queries.js"),i=require("react-collapse"),n=require("../../typography/Heading/index.js");function a(v){return v&&typeof v=="object"&&"default"in v?v:{default:v}}require("../Button/index.js"),require("../../theme.js"),require("../Spinner/index.js"),require("../../typography/ButtonText/index.js"),require("../Button/styles.js"),require("../../utils/utils.js");var o=a(e),d=a(r);const s=d.default.div`
|
|
2
2
|
.ReactCollapse--collapse {
|
|
3
3
|
transition: height 300ms;
|
|
4
4
|
}
|
|
5
|
-
`,d
|
|
5
|
+
`,u=d.default.ul`
|
|
6
6
|
width: 100%;
|
|
7
7
|
padding: 0;
|
|
8
8
|
margin: 0.5rem 0;
|
|
9
|
-
display:
|
|
10
|
-
flex-direction:
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: row;
|
|
11
|
+
justify-content: space-between;
|
|
11
12
|
align-items: center;
|
|
12
|
-
flex-wrap: wrap;
|
|
13
13
|
|
|
14
|
-
${({theme:
|
|
15
|
-
border-bottom: 3px solid ${
|
|
14
|
+
${({theme:v,fullWidthBorder:A,borderColor:g})=>A?`border-bottom: 3px solid ${v.colors.gray[g]};`:`& > li {
|
|
15
|
+
border-bottom: 3px solid ${v.colors.gray[g]};
|
|
16
16
|
}`}
|
|
17
17
|
|
|
18
|
-
${l.mq("
|
|
19
|
-
flex-direction:
|
|
20
|
-
justify-content: ${({justify:
|
|
18
|
+
${l.mq(null,"mobileL")} {
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
justify-content: ${({justify:v})=>v};
|
|
21
21
|
}
|
|
22
|
-
`,
|
|
22
|
+
`,c=d.default(n.Title)`
|
|
23
|
+
margin: 0;
|
|
24
|
+
`,p=d.default.div`
|
|
25
|
+
display: flex;
|
|
26
|
+
`,f=d.default.div`
|
|
23
27
|
padding: 0.5rem 0;
|
|
24
|
-
`,
|
|
28
|
+
`,b=d.default.div``,m=({activeColor:v="secondary",justify:A="end",activeIndex:g,initalActive:R,children:U=[],kbNavAutoOpen:T=!0,onTabClick:I,fullWidthBorder:_=!0,borderColor:H="light6",headline:O})=>{var W,L;const q=e.Children.map(U,y=>y),[k,$]=e.useState(()=>R!=null?R:q.findIndex(y=>!y.props.isDisabled)),S=e.useRef([]),K=Boolean((L=(W=q[k])==null?void 0:W.props)==null?void 0:L.children);e.useEffect(()=>{g!==void 0&&$(g)},[g]);const M=(y,h)=>{if(y.preventDefault(),y.key!=="Enter"||T||$(h),y.key==="ArrowLeft"||y.key==="ArrowRight"){const x=T?k:h,j=y.key==="ArrowRight",E=j?x+1:0,w=j?q.length:x,B=q.slice(E,w);j||B.reverse();const D=B.findIndex(C=>!C.props.isDisabled);if(D!==-1){const C=j?x+(D+1):x-(D+1);T&&$(C),S.current[C].focus()}}};return o.default.createElement(s,null,o.default.createElement(i.UnmountClosed,{isOpened:!0},o.default.createElement(u,{fullWidthBorder:_,justify:A,role:"tablist",borderColor:H},O&&o.default.createElement(c,null,O),o.default.createElement(p,null,q.map((y,h)=>{if(!y)return null;const x=k===h;return o.default.createElement(t.default,{key:h,label:y.props.label,isDisabled:y.props.isDisabled,index:h,id:h,isActive:k===h,activeColor:v,onClick:(j,E)=>{var w,B;x||y.props.isDisabled||((B=(w=y.props).onClick)==null||B.call(w,j,E),I==null||I(j,E),((D,C)=>{D.preventDefault(),$(C)})(j,E))},onKeyUp:M,ref:j=>S.current[h]=j})}))),K&&o.default.createElement(f,null,q.map((y,h)=>{const x=y.props.children&&k===h;return o.default.createElement(b,{key:h,id:`tabpanel-${h}`,role:"tabpanel","aria-labelledby":`tab-${h}`,"aria-hidden":x?"false":"true"},x&&y.props.children)}))))};exports.Tabs=m,exports.default=m;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./Tabs.js"),r=require("./Tab.js");require("react"),require("styled-components"),require("../../shared/media-queries.js"),require("react-collapse"),require("../Button/index.js"),require("../../theme.js"),require("../Spinner/index.js"),require("../../typography/ButtonText/index.js"),require("../Button/styles.js"),require("../../utils/utils.js"),exports.Tabs=e.Tabs,exports.Tab=r.default;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./Tabs.js"),r=require("./Tab.js");require("react"),require("styled-components"),require("../../shared/media-queries.js"),require("react-collapse"),require("../../typography/Heading/index.js"),require("../Button/index.js"),require("../../theme.js"),require("../Spinner/index.js"),require("../../typography/ButtonText/index.js"),require("../Button/styles.js"),require("../../utils/utils.js"),exports.Tabs=e.Tabs,exports.Tab=r.default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import r,{forwardRef as
|
|
2
|
-
${
|
|
1
|
+
import r,{forwardRef as h}from"react";import n,{css as f}from"styled-components";import g from"../../theme.js";import C from"../Spinner/index.js";import{BasicButtonFontStyle as R,ButtonRegularTextStyle as T}from"../../typography/ButtonText/index.js";import{fontSizes as z,smallerAndSmallSizeStyles as A,regularSizeStyles as _,largeSizeStyles as k,disabledColorStyles as F,colorStyles as N}from"./styles.js";const c=0,O=n.button`
|
|
2
|
+
${R}
|
|
3
3
|
box-sizing: border-box;
|
|
4
4
|
outline: none;
|
|
5
5
|
cursor: pointer;
|
|
@@ -12,28 +12,29 @@ import r,{forwardRef as w}from"react";import n,{css as y}from"styled-components"
|
|
|
12
12
|
align-items: center;
|
|
13
13
|
justify-content: ${({sufixIcon:e,prefixIcon:t,isLoading:s})=>!s&&(e||t)?"space-between":"center"};
|
|
14
14
|
|
|
15
|
-
${({size:e="small"})=>
|
|
16
|
-
${({size:e})=>
|
|
17
|
-
${(e==="smaller"||e==="small")&&
|
|
18
|
-
${e==="regular"&&
|
|
19
|
-
${e==="large"&&
|
|
15
|
+
${({size:e="small"})=>z[e]||T}
|
|
16
|
+
${({size:e})=>f`
|
|
17
|
+
${(e==="smaller"||e==="small")&&A()}
|
|
18
|
+
${e==="regular"&&_()}
|
|
19
|
+
${e==="large"&&k()}
|
|
20
20
|
`}
|
|
21
21
|
background-color: transparent;
|
|
22
|
-
transition: color 0.3s ease, background-color 0.3s ease, border 0.3s ease
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
transition: color 0.3s ease, background-color 0.3s ease, border 0.3s ease,
|
|
23
|
+
filter 0.3s;
|
|
24
|
+
${({variant:e="solid",color:t="primary",colorShade:s="main",disabled:m,theme:a})=>f`
|
|
25
|
+
${m?F(a,e):N[e](a,t,s)}
|
|
25
26
|
`}
|
|
26
27
|
&:focus-visible {
|
|
27
28
|
box-shadow: 0px 0px 0px 1px ${({theme:e})=>e.colors.gray.light5};
|
|
28
29
|
}
|
|
29
|
-
`,
|
|
30
|
+
`,v={smaller:"1rem",small:"1rem",regular:"1.5rem",large:"1.5rem"},S={smaller:"0.5rem",small:"0.5rem",regular:"1rem",large:"1rem"},$=n.span`
|
|
30
31
|
display: flex;
|
|
31
|
-
margin-right: ${({type:e,size:t})=>e==="prefix"?
|
|
32
|
-
margin-left: ${({type:e,size:t})=>e==="sufix"?
|
|
33
|
-
font-size: ${({size:e})=>
|
|
34
|
-
opacity: ${({isLoading:e})=>e?
|
|
35
|
-
`,
|
|
32
|
+
margin-right: ${({type:e,size:t})=>e==="prefix"?S[t]:0};
|
|
33
|
+
margin-left: ${({type:e,size:t})=>e==="sufix"?S[t]:0};
|
|
34
|
+
font-size: ${({size:e})=>v[e]};
|
|
35
|
+
opacity: ${({isLoading:e})=>e?c:1};
|
|
36
|
+
`,D=n(C)`
|
|
36
37
|
position: absolute;
|
|
37
|
-
`,
|
|
38
|
-
opacity: ${({isLoading:e})=>e?
|
|
39
|
-
`,
|
|
38
|
+
`,G=n.span`
|
|
39
|
+
opacity: ${({isLoading:e})=>e?c:1};
|
|
40
|
+
`,M={smaller:1,small:1,regular:1.5,large:1.5},u=h(({size:e="small",color:t="primary",colorShade:s="main",variant:m="solid",fullWidth:a=!1,isDisabled:b=!1,isLoading:o=!1,children:d,sufixIcon:i,prefixIcon:p,minWidth:x,as:E="button",...B},j)=>{const w=(l,y)=>typeof l=="string"||typeof l=="number"?r.createElement(G,{isLoading:y},l):r.isValidElement(l)?r.cloneElement(l,{style:{...l.props.style,opacity:y?c:1}}):l;return r.createElement(O,{...B,as:E,minWidth:x,color:t,colorShade:s,disabled:b||o,fullWidth:a,theme:g,variant:m,size:e,isLoading:o,ref:j,prefixIcon:p,sufixIcon:i},r.createElement(r.Fragment,null,p&&r.createElement($,{size:e,type:"prefix",isLoading:o},p),w(d,o),i&&r.createElement($,{size:e,type:"sufix",isLoading:o},i),o&&r.createElement(D,{color:g.colors.gray.light1,size:M[e]})))});u.displayName="Button";export{u as Button,u as default};
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import{ButtonSmallTextStyle as
|
|
1
|
+
import{ButtonSmallTextStyle as e,ButtonRegularTextStyle as t,ButtonLargeTextStyle as a}from"../../typography/ButtonText/index.js";import"react";import"styled-components";const c={smaller:e,small:t,regular:t,large:a},d=()=>`
|
|
2
2
|
padding: 0.25rem 0.75rem;
|
|
3
3
|
min-height: 2.5rem;
|
|
4
|
-
`,
|
|
4
|
+
`,g=()=>`
|
|
5
5
|
padding: 0.25rem 1.5rem;
|
|
6
6
|
min-height: 3rem;
|
|
7
|
-
`,
|
|
7
|
+
`,u=()=>`
|
|
8
8
|
padding: 0.25rem 1.5rem;
|
|
9
9
|
min-height: 3.75rem;
|
|
10
|
-
`,
|
|
10
|
+
`,y=(o,r,n)=>`
|
|
11
11
|
color: ${o.colors.text.light};
|
|
12
|
-
background-color: ${o.colors[r]
|
|
12
|
+
background-color: ${o.colors[r][n]};
|
|
13
13
|
|
|
14
14
|
:hover {
|
|
15
15
|
border-color: ${o.colors[r].dark};
|
|
16
|
-
|
|
16
|
+
filter: brightness(0.9)
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
:active {
|
|
20
20
|
border-color: ${o.colors[r].light};
|
|
21
|
-
|
|
21
|
+
filter: brightness(1.1)
|
|
22
22
|
}
|
|
23
|
-
`,
|
|
23
|
+
`,s=(o,r)=>`
|
|
24
24
|
color: ${o.colors[r].main};
|
|
25
25
|
border: 2px solid ${o.colors[r].main};
|
|
26
26
|
background-color: transparent;
|
|
@@ -34,7 +34,7 @@ import{ButtonSmallTextStyle as a,ButtonRegularTextStyle as s,ButtonLargeTextStyl
|
|
|
34
34
|
border: 2px solid ${o.colors[r].light};
|
|
35
35
|
color: ${o.colors[r].light};
|
|
36
36
|
}
|
|
37
|
-
`,
|
|
37
|
+
`,i=(o,r)=>`
|
|
38
38
|
color: ${r!=="neutral"?o.colors[r].main:o.colors.neutral.light};
|
|
39
39
|
background-color: transparent;
|
|
40
40
|
|
|
@@ -48,8 +48,8 @@ import{ButtonSmallTextStyle as a,ButtonRegularTextStyle as s,ButtonLargeTextStyl
|
|
|
48
48
|
`,l=o=>`
|
|
49
49
|
color: ${o.colors.gray.light1};
|
|
50
50
|
cursor: not-allowed;
|
|
51
|
-
|
|
51
|
+
`,S=(o,r)=>r==="solid"?`
|
|
52
52
|
${l(o)};
|
|
53
53
|
background-color: ${o.colors.gray.light4};`:r==="outline"?`
|
|
54
54
|
${l(o)};
|
|
55
|
-
border: 2px solid ${o.colors.gray.light1};`:l(o)
|
|
55
|
+
border: 2px solid ${o.colors.gray.light1};`:l(o),$={solid:y,outline:s,flat:i};export{$ as colorStyles,S as disabledColorStyles,i as flatColorStyles,c as fontSizes,u as largeSizeStyles,s as outlineColorStyles,g as regularSizeStyles,d as smallerAndSmallSizeStyles};
|
|
@@ -1,24 +1,28 @@
|
|
|
1
|
-
import
|
|
1
|
+
import l,{Children as A,useState as B,useRef as S,useEffect as H}from"react";import I from"./Tab.js";import a from"styled-components";import{mq as P}from"../../shared/media-queries.js";import{UnmountClosed as U}from"react-collapse";import{Title as q}from"../../typography/Heading/index.js";import"../Button/index.js";import"../../theme.js";import"../Spinner/index.js";import"../../typography/ButtonText/index.js";import"../Button/styles.js";import"../../utils/utils.js";const F=a.div`
|
|
2
2
|
.ReactCollapse--collapse {
|
|
3
3
|
transition: height 300ms;
|
|
4
4
|
}
|
|
5
|
-
`,
|
|
5
|
+
`,K=a.ul`
|
|
6
6
|
width: 100%;
|
|
7
7
|
padding: 0;
|
|
8
8
|
margin: 0.5rem 0;
|
|
9
|
-
display:
|
|
10
|
-
flex-direction:
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: row;
|
|
11
|
+
justify-content: space-between;
|
|
11
12
|
align-items: center;
|
|
12
|
-
flex-wrap: wrap;
|
|
13
13
|
|
|
14
|
-
${({theme:
|
|
15
|
-
border-bottom: 3px solid ${
|
|
14
|
+
${({theme:o,fullWidthBorder:b,borderColor:s})=>b?`border-bottom: 3px solid ${o.colors.gray[s]};`:`& > li {
|
|
15
|
+
border-bottom: 3px solid ${o.colors.gray[s]};
|
|
16
16
|
}`}
|
|
17
17
|
|
|
18
|
-
${P("
|
|
19
|
-
flex-direction:
|
|
20
|
-
justify-content: ${({justify:
|
|
18
|
+
${P(null,"mobileL")} {
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
justify-content: ${({justify:o})=>o};
|
|
21
21
|
}
|
|
22
|
-
`,
|
|
22
|
+
`,L=a(q)`
|
|
23
|
+
margin: 0;
|
|
24
|
+
`,z=a.div`
|
|
25
|
+
display: flex;
|
|
26
|
+
`,G=a.div`
|
|
23
27
|
padding: 0.5rem 0;
|
|
24
|
-
`,
|
|
28
|
+
`,J=a.div``,D=({activeColor:o="secondary",justify:b="end",activeIndex:s,initalActive:g,children:R=[],kbNavAutoOpen:y=!0,onTabClick:T,fullWidthBorder:$=!0,borderColor:k="light6",headline:v})=>{var E,j;const i=A.map(R,e=>e),[c,m]=B(()=>g!=null?g:i.findIndex(e=>!e.props.isDisabled)),C=S([]),w=Boolean((j=(E=i[c])==null?void 0:E.props)==null?void 0:j.children),_=(e,t)=>{e.preventDefault(),m(t)};H(()=>{typeof s!="undefined"&&m(s)},[s]);const x=(e,t)=>{if(e.preventDefault(),e.key==="Enter"&&!y&&m(t),e.key==="ArrowLeft"||e.key==="ArrowRight"){const n=y?c:t,r=e.key==="ArrowRight",d=r?n+1:0,u=r?i.length:n,p=i.slice(d,u);r||p.reverse();const h=p.findIndex(f=>!f.props.isDisabled);if(h!==-1){const f=r?n+(h+1):n-(h+1);y&&m(f),C.current[f].focus()}}};return l.createElement(F,null,l.createElement(U,{isOpened:!0},l.createElement(K,{fullWidthBorder:$,justify:b,role:"tablist",borderColor:k},v&&l.createElement(L,null,v),l.createElement(z,null,i.map((e,t)=>{if(!e)return null;const n=c===t;return l.createElement(I,{key:t,label:e.props.label,isDisabled:e.props.isDisabled,index:t,id:t,isActive:c===t,activeColor:o,onClick:(r,d)=>{var u,p;!n&&!e.props.isDisabled&&((p=(u=e.props).onClick)==null||p.call(u,r,d),T==null||T(r,d),_(r,d))},onKeyUp:x,ref:r=>C.current[t]=r})}))),w&&l.createElement(G,null,i.map((e,t)=>{const n=e.props.children&&c===t;return l.createElement(J,{key:t,id:`tabpanel-${t}`,role:"tabpanel","aria-labelledby":`tab-${t}`,"aria-hidden":n?"false":"true"},n&&e.props.children)}))))};export{D as Tabs,D as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{Tabs}from"./Tabs.js";export{default as Tab}from"./Tab.js";import"react";import"styled-components";import"../../shared/media-queries.js";import"react-collapse";import"../Button/index.js";import"../../theme.js";import"../Spinner/index.js";import"../../typography/ButtonText/index.js";import"../Button/styles.js";import"../../utils/utils.js";
|
|
1
|
+
export{Tabs}from"./Tabs.js";export{default as Tab}from"./Tab.js";import"react";import"styled-components";import"../../shared/media-queries.js";import"react-collapse";import"../../typography/Heading/index.js";import"../Button/index.js";import"../../theme.js";import"../Spinner/index.js";import"../../typography/ButtonText/index.js";import"../Button/styles.js";import"../../utils/utils.js";
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React, { ComponentPropsWithRef, CSSProperties, ReactNode } from 'react';
|
|
2
|
-
import { Color, Variant, Size } from '../../Types';
|
|
2
|
+
import { Color, Variant, Size, ColorShade } from '../../Types';
|
|
3
3
|
interface Props {
|
|
4
4
|
size?: Size;
|
|
5
5
|
color?: Color;
|
|
6
|
+
colorShade?: ColorShade;
|
|
6
7
|
variant?: Variant;
|
|
7
8
|
fullWidth?: boolean;
|
|
8
9
|
style?: CSSProperties;
|
|
@@ -15,5 +16,5 @@ interface Props {
|
|
|
15
16
|
as?: keyof JSX.IntrinsicElements;
|
|
16
17
|
}
|
|
17
18
|
export declare type ButtonProps = ComponentPropsWithRef<'button'> & Props;
|
|
18
|
-
export declare const Button: React.ForwardRefExoticComponent<Pick<ButtonProps, "form" | "slot" | "style" | "title" | "type" | "name" | "key" | "value" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "as" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "size" | "minWidth" | "fullWidth" | "sufixIcon" | "prefixIcon" | "isLoading" | "variant" | "isDisabled"> & React.RefAttributes<HTMLElement>>;
|
|
19
|
+
export declare const Button: React.ForwardRefExoticComponent<Pick<ButtonProps, "form" | "slot" | "style" | "title" | "type" | "name" | "key" | "value" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "as" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "size" | "minWidth" | "fullWidth" | "sufixIcon" | "prefixIcon" | "isLoading" | "variant" | "colorShade" | "isDisabled"> & React.RefAttributes<HTMLElement>>;
|
|
19
20
|
export default Button;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Theme } from '../../theme';
|
|
2
|
-
import { Color, Variant } from '../../Types';
|
|
2
|
+
import { Color, ColorShade, Variant } from '../../Types';
|
|
3
3
|
export declare const fontSizes: {
|
|
4
4
|
smaller: import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<import("styled-components").DefaultTheme>>;
|
|
5
5
|
small: import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<import("styled-components").DefaultTheme>>;
|
|
@@ -13,7 +13,7 @@ export declare const outlineColorStyles: (theme: Theme, color: Color) => string;
|
|
|
13
13
|
export declare const flatColorStyles: (theme: Theme, color: Color) => string;
|
|
14
14
|
export declare const disabledColorStyles: (theme: Theme, variant: Variant) => string;
|
|
15
15
|
export declare const colorStyles: {
|
|
16
|
-
solid: (theme: Theme, color: Color) => string;
|
|
16
|
+
solid: (theme: Theme, color: Color, colorShade: ColorShade) => string;
|
|
17
17
|
outline: (theme: Theme, color: Color) => string;
|
|
18
18
|
flat: (theme: Theme, color: Color) => string;
|
|
19
19
|
};
|
|
@@ -3,6 +3,7 @@ import { Color } from '../../Types';
|
|
|
3
3
|
import { ReactElement } from 'react';
|
|
4
4
|
import { TabProps } from './Tab';
|
|
5
5
|
import { CSSProperties } from 'styled-components';
|
|
6
|
+
import theme from '../../theme';
|
|
6
7
|
declare type TabElement = ReactElement<TabProps>;
|
|
7
8
|
export interface TabsProps {
|
|
8
9
|
activeColor?: Color;
|
|
@@ -13,6 +14,8 @@ export interface TabsProps {
|
|
|
13
14
|
kbNavAutoOpen?: boolean;
|
|
14
15
|
onTabClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>, index: number) => void;
|
|
15
16
|
fullWidthBorder?: boolean;
|
|
17
|
+
borderColor?: keyof typeof theme.colors.gray;
|
|
18
|
+
headline?: string;
|
|
16
19
|
}
|
|
17
|
-
export declare const Tabs: ({ activeColor, justify, activeIndex, initalActive, children, kbNavAutoOpen, onTabClick, fullWidthBorder, }: TabsProps) => JSX.Element;
|
|
20
|
+
export declare const Tabs: ({ activeColor, justify, activeIndex, initalActive, children, kbNavAutoOpen, onTabClick, fullWidthBorder, borderColor, headline, }: TabsProps) => JSX.Element;
|
|
18
21
|
export default Tabs;
|