@kvdbil/components 16.0.8 → 17.0.1
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/README.md +2 -1
- package/cjs/components/Accordion/index.js +8 -8
- package/cjs/components/Badge/index.js +5 -5
- package/cjs/components/Breadcrumbs/BreadcrumbsItem.js +5 -5
- package/cjs/components/Breadcrumbs/index.js +2 -2
- package/cjs/components/Button/index.js +14 -13
- package/cjs/components/Card/index.js +5 -5
- package/cjs/components/CheckBox/index.js +7 -7
- package/cjs/components/Chip/index.js +6 -6
- package/cjs/components/Dialog/index.js +1 -1
- package/cjs/components/ErrorMessage/index.js +2 -2
- package/cjs/components/Icon/index.js +4 -4
- package/cjs/components/Link/index.js +4 -6
- package/cjs/components/ListItem/index.js +3 -3
- package/cjs/components/MenuItem/index.js +1 -1
- package/cjs/components/Message/index.js +21 -10
- package/cjs/components/Modal/FocudTrap.js +3 -0
- package/cjs/components/Modal/index.js +23 -16
- package/cjs/components/OffCanvas/index.js +4 -4
- package/cjs/components/RadioButton/index.js +17 -17
- package/cjs/components/RegistrationPlate/index.js +3 -3
- package/cjs/components/Snackbar/index.js +23 -19
- package/cjs/components/Spinner/index.js +9 -9
- package/cjs/components/SpinnerThin/index.js +6 -7
- package/cjs/components/Stepper/index.js +10 -10
- package/cjs/components/StepperAccordion/index.js +18 -24
- package/cjs/components/Switcher/index.js +6 -6
- package/cjs/components/Table/index.js +9 -9
- package/cjs/components/Tabs/Tab.js +1 -2
- package/cjs/components/Tabs/Tabs.js +1 -1
- package/cjs/components/TextArea/index.js +12 -12
- package/cjs/components/Textfield/index.js +3 -3
- package/cjs/components/TimePicker/index.js +2 -2
- package/cjs/components/Toggle/index.js +6 -6
- package/cjs/components/ToggleArrow/index.js +2 -2
- package/cjs/components/ValuationRange/index.js +15 -15
- package/cjs/index.js +1 -1
- package/esm/components/Accordion/index.js +9 -9
- package/esm/components/Badge/index.js +7 -7
- package/esm/components/Breadcrumbs/BreadcrumbsItem.js +6 -6
- package/esm/components/Breadcrumbs/index.js +2 -2
- package/esm/components/Button/index.js +16 -15
- package/esm/components/Card/index.js +1 -1
- package/esm/components/CheckBox/index.js +7 -7
- package/esm/components/Chip/index.js +20 -20
- package/esm/components/Dialog/index.js +1 -1
- package/esm/components/ErrorMessage/index.js +2 -2
- package/esm/components/Icon/index.js +1 -1
- package/esm/components/Link/index.js +6 -8
- package/esm/components/ListItem/index.js +4 -4
- package/esm/components/MenuItem/index.js +2 -2
- package/esm/components/Message/index.js +21 -10
- package/esm/components/Modal/FocudTrap.js +3 -0
- package/esm/components/Modal/index.js +23 -16
- package/esm/components/OffCanvas/index.js +15 -11
- package/esm/components/RadioButton/index.js +12 -12
- package/esm/components/RegistrationPlate/index.js +4 -4
- package/esm/components/Snackbar/index.js +26 -22
- package/esm/components/Spinner/index.js +5 -5
- package/esm/components/SpinnerThin/index.js +9 -10
- package/esm/components/Stepper/index.js +30 -30
- package/esm/components/StepperAccordion/index.js +26 -32
- package/esm/components/Switcher/index.js +6 -6
- package/esm/components/Table/index.js +5 -5
- package/esm/components/Tabs/Tab.js +3 -4
- package/esm/components/Tabs/Tabs.js +1 -1
- package/esm/components/TextArea/index.js +16 -16
- package/esm/components/Textfield/index.js +16 -16
- package/esm/components/TimePicker/index.js +2 -2
- package/esm/components/Toggle/index.js +12 -12
- package/esm/components/ToggleArrow/index.js +3 -3
- package/esm/components/ValuationRange/index.js +15 -15
- package/esm/index.js +1 -1
- package/package.json +4 -5
- package/package.json.tmp +4 -5
- package/types/components/Badge/index.d.ts +2 -1
- package/types/components/Chip/index.d.ts +4 -4
- package/types/components/Modal/FocudTrap.d.ts +4 -0
- package/types/components/Spinner/index.d.ts +5 -2
- package/types/components/SpinnerThin/index.d.ts +6 -1
- package/types/components/Stepper/index.d.ts +8 -1
- package/types/components/StepperAccordion/index.d.ts +1 -1
- package/types/components/Switcher/index.d.ts +2 -1
- package/types/components/Table/index.d.ts +2 -1
- package/types/components/Toggle/index.d.ts +2 -1
- package/types/components/ValuationRange/index.d.ts +6 -1
- package/cjs/components/DayPicker/DayPickerNavBar.js +0 -25
- package/cjs/components/Icons/Arrow.js +0 -1
- package/cjs/components/Icons/CheckCircle.js +0 -1
- package/cjs/components/Icons/CheckIcon.js +0 -1
- package/cjs/components/Icons/Close.js +0 -1
- package/cjs/components/Icons/ErrorCircle.js +0 -1
- package/cjs/components/Icons/InfoCircle.js +0 -1
- package/esm/components/DayPicker/DayPickerNavBar.js +0 -25
- package/esm/components/Icons/Arrow.js +0 -1
- package/esm/components/Icons/CheckCircle.js +0 -1
- package/esm/components/Icons/CheckIcon.js +0 -1
- package/esm/components/Icons/Close.js +0 -1
- package/esm/components/Icons/ErrorCircle.js +0 -1
- package/esm/components/Icons/InfoCircle.js +0 -1
- package/types/components/DayPicker/DayPickerNavBar.d.ts +0 -9
- package/types/components/Icons/Arrow.d.ts +0 -5
- package/types/components/Icons/CheckCircle.d.ts +0 -5
- package/types/components/Icons/CheckIcon.d.ts +0 -5
- package/types/components/Icons/Close.d.ts +0 -5
- package/types/components/Icons/ErrorCircle.d.ts +0 -5
- package/types/components/Icons/InfoCircle.d.ts +0 -5
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as l,jsxs as k}from"react/jsx-runtime";import a from"styled-components";import C from"../../icons/components/CloseIcon.js";import{getFontSize as $,getCursorType as b,getBackgroundColor as D,getColor as z,getBorderColor as B,getHoverBorderColor as H,getHoverBackgroundColor as j,getHoverColor as w,getActiveBackgroundColor as m,getActiveBorderColor as A,getActiveColor as F,getSufixHoverBackgroundColor as I}from"./styles.js";import"../../utils/utils.js";const P={small:"2px 16px",regular:"3px 16px",large:"7px 16px"},S=a.div`
|
|
2
2
|
font-family: ${({theme:e})=>e.typography.fontBaseFamily};
|
|
3
|
-
font-size: ${({size:e})
|
|
3
|
+
font-size: ${({size:e})=>$(e)};
|
|
4
4
|
font-weight: ${({theme:e})=>e.typography.fontBaseBoldWeight};
|
|
5
5
|
line-height: 1.25;
|
|
6
6
|
letter-spacing: 0.1px;
|
|
7
7
|
display: inline-flex;
|
|
8
|
-
cursor: ${
|
|
8
|
+
cursor: ${b};
|
|
9
9
|
align-items: center;
|
|
10
|
-
background: ${
|
|
11
|
-
color: ${
|
|
10
|
+
background: ${D};
|
|
11
|
+
color: ${z};
|
|
12
12
|
justify-content: center;
|
|
13
13
|
border-width: 1px;
|
|
14
14
|
border-style: solid;
|
|
15
|
-
border-color: ${
|
|
15
|
+
border-color: ${B};
|
|
16
16
|
border-radius: 1.293rem;
|
|
17
|
-
padding: ${({size:e,isDeletable:
|
|
17
|
+
padding: ${({size:e,isDeletable:n})=>n?"0 0.5rem 0 1rem":P[e]};
|
|
18
18
|
transition:
|
|
19
19
|
color 0.3s ease,
|
|
20
20
|
background-color 0.3s ease,
|
|
@@ -22,28 +22,28 @@ import{jsx as i,jsxs as x}from"react/jsx-runtime";import t from"styled-component
|
|
|
22
22
|
box-sizing: border-box;
|
|
23
23
|
|
|
24
24
|
${e=>!e.isDisabled&&e.isClickable&&` &:hover {
|
|
25
|
-
border-color: ${
|
|
26
|
-
background-color: ${
|
|
27
|
-
color: ${
|
|
25
|
+
border-color: ${H(e)};
|
|
26
|
+
background-color: ${j(e)};
|
|
27
|
+
color: ${w(e)};
|
|
28
28
|
} &:active {
|
|
29
|
-
background-color: ${
|
|
30
|
-
border-color: ${
|
|
31
|
-
color: ${
|
|
29
|
+
background-color: ${m(e)};
|
|
30
|
+
border-color: ${A(e)};
|
|
31
|
+
color: ${F(e)};
|
|
32
32
|
}`}
|
|
33
|
-
`,
|
|
33
|
+
`,T=a.span`
|
|
34
34
|
display: flex;
|
|
35
35
|
align-items: center;
|
|
36
36
|
justify-content: center;
|
|
37
37
|
text-align: center;
|
|
38
38
|
line-height: 1.5;
|
|
39
|
-
`,
|
|
39
|
+
`,W=a.span`
|
|
40
40
|
margin-right: 0.625rem;
|
|
41
41
|
display: flex;
|
|
42
42
|
align-items: center;
|
|
43
|
-
`,
|
|
43
|
+
`,E=a.span`
|
|
44
44
|
display: flex;
|
|
45
45
|
align-items: center;
|
|
46
|
-
cursor: ${
|
|
46
|
+
cursor: ${b};
|
|
47
47
|
padding: 0.5rem;
|
|
48
48
|
margin-left: 0.25rem;
|
|
49
49
|
margin-right: -0.25rem;
|
|
@@ -59,16 +59,16 @@ import{jsx as i,jsxs as x}from"react/jsx-runtime";import t from"styled-component
|
|
|
59
59
|
width: 80%;
|
|
60
60
|
border-radius: 50%;
|
|
61
61
|
z-index: -1;
|
|
62
|
-
background-color: ${
|
|
62
|
+
background-color: ${I};
|
|
63
63
|
opacity: 0;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
&:active:before {
|
|
67
|
-
background-color: ${
|
|
67
|
+
background-color: ${m};
|
|
68
68
|
opacity: 1;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
&:hover:before {
|
|
72
72
|
opacity: 1;
|
|
73
73
|
}
|
|
74
|
-
`,
|
|
74
|
+
`,u=({color:e="primary",children:n,component:f,isDisabled:r,onClick:d,size:h="regular",prefix:s,onDelete:c,variant:g="solid",role:x,...v})=>{const i=!!(d&&!r),t=!!(c&&!r),y=!!s,p=o=>{o.stopPropagation(),c?.(o)};return l(S,{...v,role:x??(i?"button":void 0),onClick:i?d:void 0,tabIndex:i?0:void 0,as:f??(i?"button":"div"),color:e,isDisabled:r,size:h,isClickable:i,isDeletable:t,variant:g,hasPrefix:y,"aria-disabled":r,children:k(T,{children:[s&&l(W,{className:"prefix",children:s}),n,c&&l(E,{role:"button","aria-label":"Remove","aria-disabled":r,onClick:t?p:void 0,color:e,variant:g,isClickable:i,isDisabled:r,isDeletable:!0,size:"regular",tabIndex:t?0:void 0,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&t&&(o.preventDefault(),p(o))},children:l(C,{})})]})})};export{u as Chip,u as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as d,jsx as i}from"react/jsx-runtime";import r from"styled-components";import{Modal as f}from"../Modal/index.js";import h from"../../theme.js";import{TinyTitleBold as c}from"../../typography/Heading/index.js";import"react";import"react-dom";import"react-transition-group";import"../
|
|
1
|
+
import{jsxs as d,jsx as i}from"react/jsx-runtime";import r from"styled-components";import{Modal as f}from"../Modal/index.js";import h from"../../theme.js";import{TinyTitleBold as c}from"../../typography/Heading/index.js";import"react";import"react-dom";import"react-transition-group";import"../../icons/components/CloseIcon.js";import"../../utils/utils.js";import"../Modal/FocudTrap.js";import"../../shared/media-queries.js";const g=r(c)`
|
|
2
2
|
font-weight: ${h.typography.fontAlternativeRegularWeight};
|
|
3
3
|
margin: 0;
|
|
4
4
|
`,w=r.div`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as a}from"react/jsx-runtime";import i from"styled-components";const n=i.div`
|
|
2
2
|
font-family: ${({theme:e})=>e.typography.fontAlternativeFamily};
|
|
3
3
|
font-weight: ${({theme:e})=>e.typography.fontAlternativeRegularWeight};
|
|
4
4
|
background: ${({theme:e})=>e.colors.error.lighter};
|
|
@@ -7,4 +7,4 @@ import{jsx as n}from"react/jsx-runtime";import a from"styled-components";const i
|
|
|
7
7
|
font-size: 13px;
|
|
8
8
|
padding: 10px;
|
|
9
9
|
${({centered:e})=>e&&"text-align: center;"}
|
|
10
|
-
`,r=({children:e,centered:t,...o})=>n
|
|
10
|
+
`,r=({children:e,centered:t,...o})=>a(n,{centered:t,role:"alert","aria-live":"assertive",...o,children:e});export{r as ErrorMessage,r as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as c,Fragment as u,jsx as e}from"react/jsx-runtime";import{useState as x}from"react";import i from"styled-components";import{Caption as h}from"../../typography/BodyText/index.js";import{Title as b}from"../../typography/Heading/index.js";import p from"../../theme.js";import{Snackbar as k}from"../Snackbar/index.js";import"../../shared/media-queries.js";import"
|
|
1
|
+
import{jsxs as c,Fragment as u,jsx as e}from"react/jsx-runtime";import{useState as x}from"react";import i from"styled-components";import{Caption as h}from"../../typography/BodyText/index.js";import{Title as b}from"../../typography/Heading/index.js";import p from"../../theme.js";import{Snackbar as k}from"../Snackbar/index.js";import"../../shared/media-queries.js";import"react-transition-group";import"../../utils/utils.js";import"../../icons/components/AlertIcon.js";import"../../icons/components/CheckCircleIcon.js";import"../../icons/components/CloseIcon.js";import"../../icons/components/InfoIcon.js";const w=i.div`
|
|
2
2
|
margin: 0 auto;
|
|
3
3
|
max-width: 700px;
|
|
4
4
|
`,y=i(b)`
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import{jsxs as F,jsx as
|
|
1
|
+
import{jsxs as F,jsx as i,Fragment as v}from"react/jsx-runtime";import{Status as I,CaptionLink as W,Caption2 as z,Caption as U,BodyText as _,BodyLink as j}from"../../typography/BodyText/index.js";import h,{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 O,Subtitle as P,Title as V,Headline as q}from"../../typography/Heading/index.js";import{Button as A}from"../Button/index.js";import{Link as E}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 m=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
|
-
`,
|
|
9
|
-
${
|
|
10
|
-
`,
|
|
11
|
-
${
|
|
12
|
-
|
|
13
|
-
font-family: ${({$fontFamily:n})=>`${n}, sans-serif`};
|
|
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};
|
|
8
|
+
`,G=h.a`
|
|
9
|
+
${m}
|
|
10
|
+
`,N=h(E)`
|
|
11
|
+
${m}
|
|
12
|
+
`;function Q(n,r){switch(r){case"BodyLink":return i(j,{as:"span",children:n});case"BodyText":return i(_,{as:"span",children:n});case"Caption":return i(U,{as:"span",children:n});case"Caption2":return i(z,{as:"span",children:n});case"CaptionLink":return i(W,{as:"span",children:n});case"Status":return i(I,{as:"span",children:n});case"Headline":return i(q,{as:"span",children:n});case"Title":return i(V,{as:"span",children:n});case"Subtitle":return i(P,{as:"span",children:n});case"TinyTitleRegular":return i(O,{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(R,{as:"span",children:n})}}const X=(n,r,o,a,t)=>F(v,{children:[r,o?i(A,{as:"span",color:t.color,colorShade:t.colorShade,variant:t.variant,fullWidth:t.fullWidth,size:t.size,prefixIcon:t.prefixIcon,isDisabled:t.isDisabled,style:{display:"inline-flex",fontFamily:t.fontFamily?`${t.fontFamily}, sans-serif`:void 0},children:n}):n&&Q(n,a)]}),y=({path:n,text:r,url:o,rel:a,ariaLabel:t,typographyType:b="BodyLink",target:s,isButton:d=!1,buttonColor:k="primary",buttonColorShade:x,buttonVariant:T,fullWidth:$,buttonSize:B,withUnderline:D=!1,buttonPrefixIcon:w,children:L,fontFamily:S,isDisabled:l=!1})=>{const e=o??n??"",c=e.startsWith("http")&&typeof window<"u"&&!e.includes(window.location.hostname),g=()=>{if(a)return a;if(s==="_blank")return c?"noopener noreferrer":"noopener"},C={color:k,colorShade:x,variant:T,fullWidth:$,size:B,prefixIcon:w,fontFamily:S,isDisabled:l},p={$isButton:d,$withUnderline:D,rel:g(),"aria-label":t},u=X(r,L,d,b,C);return c?i(G,{href:e,target:s??"_blank",...p,"data-testid":"external-link",children:u}):i(N,{to:e,target:s??"_self",...p,"data-testid":"internal-link","aria-disabled":l,tabIndex:l?-1:void 0,children:u})};export{y as Link,y as default};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{jsxs as d,jsx as l}from"react/jsx-runtime";import i from"styled-components";import{BodyText as m}from"../../typography/BodyText/index.js";import{TinyTitleBold as
|
|
1
|
+
import{jsxs as d,jsx as l}from"react/jsx-runtime";import i from"styled-components";import{BodyText as m}from"../../typography/BodyText/index.js";import{TinyTitleBold as c}from"../../typography/Heading/index.js";import"../../shared/media-queries.js";const s=i.li`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
padding-bottom: 20px;
|
|
5
5
|
&:last-child {
|
|
6
6
|
padding-bottom: 0;
|
|
7
7
|
}
|
|
8
|
-
`,
|
|
8
|
+
`,h=i.div`
|
|
9
9
|
display: flex;
|
|
10
10
|
align-items: center;
|
|
11
11
|
margin: 0;
|
|
12
|
-
`,
|
|
12
|
+
`,p=i(c)`
|
|
13
13
|
margin: 0;
|
|
14
14
|
`,x=i.div`
|
|
15
15
|
display: flex;
|
|
@@ -21,4 +21,4 @@ import{jsxs as d,jsx as l}from"react/jsx-runtime";import i from"styled-component
|
|
|
21
21
|
}
|
|
22
22
|
`,g=i.div`
|
|
23
23
|
padding-left: ${({hasIcon:t})=>t?"54px":0};
|
|
24
|
-
`,f=({title:t,text:n,icon:e,component:
|
|
24
|
+
`,f=({title:t,text:n,icon:e,component:o="li",children:r,...a})=>d(s,{as:o,role:o!=="li"?"listitem":void 0,...a,children:[d(h,{children:[e&&l(x,{"aria-hidden":"true",children:e}),l(p,{as:"h4",children:t})]}),(n||r)&&l(g,{hasIcon:!!e,children:d(m,{children:[n,r]})})]});export{f as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as
|
|
1
|
+
import{jsxs as s,jsx as r}from"react/jsx-runtime";import t from"styled-components";import n from"../../theme.js";const o={1:{size:"2rem",lineHeight:"3rem",bottom:"2rem",fontFamily:n.typography.fontAlternativeFamily},2:{size:"1.5rem",lineHeight:"2.5rem",bottom:"1rem",fontFamily:n.typography.fontAlternativeFamily},3:{size:"1rem",lineHeight:"1.5rem",bottom:"1rem",fontFamily:n.typography.fontBaseFamily}},g=t.li`
|
|
2
2
|
list-style-type: none;
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
@@ -35,4 +35,4 @@ import{jsxs as h,jsx as r}from"react/jsx-runtime";import t from"styled-component
|
|
|
35
35
|
font-family: ${({theme:e})=>e.typography.fontBaseFamily};
|
|
36
36
|
color: ${({theme:e})=>e.colors.text.dark};
|
|
37
37
|
margin-top: ${({level:e})=>e===3?"0.25rem":0};
|
|
38
|
-
`,f=({preamble:e,title:l,level:i,component:
|
|
38
|
+
`,f=({preamble:e,title:l,level:i,component:a="li",children:p,...y})=>{const h=!!e;return s(g,{as:a,role:a!=="li"?"listitem":void 0,...y,hasPreamble:h,children:[l&&r(v,{as:"h3",children:l}),s(c,{level:i,children:[r(d,{level:i,hasPreamble:h,children:p}),e&&r($,{level:i,children:e})]})]})};export{f as MenuItem,f as default};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{jsx as o,jsxs as a}from"react/jsx-runtime";import{useRef as h,useState as x}from"react";import s from"styled-components";import{TinyTitleRegular as
|
|
1
|
+
import{jsx as o,jsxs as a}from"react/jsx-runtime";import{useRef as h,useState as x}from"react";import s from"styled-components";import{TinyTitleRegular as v}from"../../typography/Heading/index.js";import b from"../../icons/components/AlertIcon.js";import k from"../../icons/components/CheckCircleIcon.js";import y from"../../icons/components/CloseIcon.js";import $ from"../../icons/components/InfoIcon.js";import w from"../../icons/components/WarningIcon.js";import{resetButtonStyle as C}from"../../utils/utils.js";import"../../shared/media-queries.js";const T=(e,r,t)=>{const n=t.colors.text.dark,i=t.colors.background.light;switch(e){case"info":return{text:r?t.colors.info.dark:n,background:r?i:t.colors.info.lighter};case"success":return{text:r?t.colors.success.dark:n,background:r?i:t.colors.success.lighter};case"warning":return{text:r?t.colors.warning.dark:n,background:r?i:t.colors.warning.lighter};case"error":return{text:r?t.colors.error.dark:n,background:r?i:t.colors.error.lighter};case"text":default:return{text:r?t.colors.text.light:n,background:r?t.colors.background.dark:i}}},j=e=>{switch(e){case"success":return o(k,{});case"warning":return o(w,{});case"error":return o(b,{});case"info":case"text":default:return o($,{})}},D=s.div`
|
|
2
2
|
${({isDeleted:e})=>e&&`
|
|
3
3
|
opacity: 0;
|
|
4
4
|
transition: opacity 0.3s;
|
|
5
5
|
`}
|
|
6
|
-
`,
|
|
6
|
+
`,W=s.div`
|
|
7
7
|
display: ${({fullWidth:e})=>e?"flex":"inline-flex"};
|
|
8
8
|
${({fullWidth:e})=>e&&"justify-content: space-between;"}
|
|
9
9
|
align-items: center;
|
|
@@ -14,25 +14,36 @@ import{jsx as o,jsxs as a}from"react/jsx-runtime";import{useRef as h,useState as
|
|
|
14
14
|
justify-content: center;
|
|
15
15
|
`}
|
|
16
16
|
|
|
17
|
-
${({theme:e,messageType:
|
|
17
|
+
${({theme:e,messageType:r,inverted:t})=>{const{text:n,background:i}=T(r,t,e);return`
|
|
18
18
|
color: ${n};
|
|
19
19
|
background-color: ${i};
|
|
20
20
|
`}}
|
|
21
|
-
`,W=s.div`
|
|
22
|
-
display: flex;
|
|
23
21
|
`,R=s.div`
|
|
22
|
+
display: flex;
|
|
23
|
+
`,S=s.div`
|
|
24
24
|
padding: 0.75rem 0;
|
|
25
|
-
`,z=s(
|
|
25
|
+
`,z=s(v)`
|
|
26
26
|
margin: 0;
|
|
27
27
|
`,P=s.span`
|
|
28
28
|
display: flex;
|
|
29
29
|
align-items: center;
|
|
30
30
|
margin-right: 1rem;
|
|
31
31
|
font-size: 1.5rem;
|
|
32
|
-
`,A=s.
|
|
32
|
+
`,A=s.button`
|
|
33
|
+
${C}
|
|
33
34
|
display: flex;
|
|
34
35
|
align-items: center;
|
|
35
36
|
margin-left: 1rem;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
|
|
38
|
+
&:focus-visible {
|
|
39
|
+
outline: revert;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&:hover {
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
svg {
|
|
47
|
+
font-size: 2.5rem;
|
|
48
|
+
}
|
|
49
|
+
`,B=({children:e,type:r,withIcon:t=!1,isDeletable:n=!1,fullWidth:i=!1,inverted:c=!1,textCenter:d=!1,...u})=>{const l=h(null),[f,m]=x(!1),g=p=>{p.stopPropagation(),m(!0),setTimeout(()=>{l.current&&l.current.remove()},300)};return o(D,{isDeleted:f,children:a(W,{messageType:r,fullWidth:i,inverted:c,textCenter:d,role:r==="error"||r==="warning"?"alert":void 0,"aria-live":r==="error"||r==="warning"?"assertive":"polite",ref:l,...u,children:[a(R,{children:[t&&o(P,{children:j(r)}),a(S,{children:[typeof e=="string"&&o(z,{children:e}),typeof e!="string"&&e]})]}),n&&o(A,{onClick:g,"aria-label":"Close",type:"button",children:o(y,{})})]})})};export{B as default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{jsx as u}from"react/jsx-runtime";import{useRef as a,useEffect as m}from"react";import b from"styled-components";const p=b.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
`,h=({children:s})=>{const o=a(null);return m(()=>{const d=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'],n=o.current;if(!n)return;const e=Array.from(n.querySelectorAll(d.join(","))),i=r=>{if(r.key!=="Tab")return;if(e.length===0){r.preventDefault();return}const f=e[0],c=e[e.length-1],t=e.findIndex(l=>document.activeElement===l);r.preventDefault(),r.shiftKey?t===-1||t===0?c.focus():e[t-1].focus():t===-1||t===e.length-1?f.focus():e[t+1].focus()};return n.addEventListener("keydown",i),()=>{n.removeEventListener("keydown",i)}},[]),u(p,{ref:o,children:s})};export{h as FocusTrap};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as t,jsxs as
|
|
1
|
+
import{jsx as t,jsxs as a,Fragment as y}from"react/jsx-runtime";import{useRef as c,useEffect as v}from"react";import{createPortal as k}from"react-dom";import{CSSTransition as T}from"react-transition-group";import o,{css as E,createGlobalStyle as l}from"styled-components";import C from"../../icons/components/CloseIcon.js";import{resetButtonStyle as S}from"../../utils/utils.js";import{FocusTrap as $}from"./FocudTrap.js";const u=E`
|
|
2
2
|
.backgroundTransition-enter {
|
|
3
3
|
opacity: 0;
|
|
4
4
|
}
|
|
@@ -16,21 +16,21 @@ import{jsx as t,jsxs as e,Fragment as x}from"react/jsx-runtime";import{useEffect
|
|
|
16
16
|
opacity: 0;
|
|
17
17
|
transition: opacity 0.25s ease-in-out;
|
|
18
18
|
}
|
|
19
|
-
`,
|
|
20
|
-
${
|
|
19
|
+
`,j=o.div`
|
|
20
|
+
${u}
|
|
21
21
|
position: fixed;
|
|
22
22
|
width: 100%;
|
|
23
23
|
height: 100%;
|
|
24
24
|
top: 0;
|
|
25
25
|
left: 0;
|
|
26
26
|
z-index: 200;
|
|
27
|
-
`,
|
|
27
|
+
`,z=o.div`
|
|
28
28
|
z-index: -1;
|
|
29
29
|
position: absolute;
|
|
30
30
|
width: 100%;
|
|
31
31
|
height: 100%;
|
|
32
32
|
background-color: rgba(34, 34, 34, 0.3);
|
|
33
|
-
`,
|
|
33
|
+
`,I=o.div`
|
|
34
34
|
position: relative;
|
|
35
35
|
max-width: 512px;
|
|
36
36
|
padding: 1rem;
|
|
@@ -53,20 +53,27 @@ import{jsx as t,jsxs as e,Fragment as x}from"react/jsx-runtime";import{useEffect
|
|
|
53
53
|
margin-right: auto;
|
|
54
54
|
min-width: 355px;
|
|
55
55
|
}
|
|
56
|
-
`,S=o.div`
|
|
57
|
-
position: absolute;
|
|
58
|
-
top: 1rem;
|
|
59
|
-
right: 1rem;
|
|
60
56
|
|
|
61
|
-
|
|
57
|
+
&:focus-visible {
|
|
58
|
+
outline: none;
|
|
59
|
+
}
|
|
60
|
+
`,L=o.button`
|
|
61
|
+
${S}
|
|
62
|
+
display: flex;
|
|
63
|
+
justify-self: flex-end;
|
|
64
|
+
|
|
65
|
+
&:focus-visible {
|
|
66
|
+
outline: revert;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&:hover {
|
|
62
70
|
cursor: pointer;
|
|
63
71
|
}
|
|
64
72
|
|
|
65
73
|
svg {
|
|
66
|
-
|
|
67
|
-
height: 1rem;
|
|
74
|
+
font-size: 1.5rem;
|
|
68
75
|
}
|
|
69
|
-
`,
|
|
76
|
+
`,O=l`
|
|
70
77
|
body {
|
|
71
78
|
overflow: hidden;
|
|
72
79
|
|
|
@@ -74,6 +81,6 @@ import{jsx as t,jsxs as e,Fragment as x}from"react/jsx-runtime";import{useEffect
|
|
|
74
81
|
padding-right: 15px !important;
|
|
75
82
|
`}
|
|
76
83
|
}
|
|
77
|
-
`,
|
|
78
|
-
${
|
|
79
|
-
`,
|
|
84
|
+
`,P=l`
|
|
85
|
+
${u}
|
|
86
|
+
`,m=({children:p,isOpen:e,contentStyles:f,withPortal:g=!1,withCloseIcon:x=!0,onClose:i,...b})=>{const n=c(null),r=c(null);v(()=>{const s=w=>{w.key==="Escape"&&e&&i()};return e&&(r.current=document.activeElement,window.addEventListener("keydown",s),n.current&&n.current.focus()),!e&&r.current&&r.current.focus(),()=>{window.removeEventListener("keydown",s)}},[i,e]);const h=!!(typeof window<"u"&&window.document&&window.document.createElement),d=t(T,{in:e,mountOnEnter:!0,unmountOnExit:!0,timeout:400,classNames:"backgroundTransition",children:a(y,{children:[t(P,{}),a(j,{...b,children:[t(z,{"data-testid":"background",onClick:i}),t($,{children:a(I,{style:f,role:"dialog","aria-modal":"true","aria-labelledby":"modal-title",tabIndex:-1,ref:n,children:[x&&t(L,{onClick:i,"data-testid":"close",type:"button","aria-label":"Close dialog",children:t(C,{})}),p]})}),t(O,{})]})]})});return g&&h?k(d,document.body):d};export{m as Modal,m as default};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import{jsxs as
|
|
2
|
-
${({animationName:t,animationDuration:
|
|
1
|
+
import{jsxs as b,Fragment as h,jsx as n}from"react/jsx-runtime";import{useRef as $,useEffect as O}from"react";import{createPortal as C}from"react-dom";import g from"styled-components";import{CSSTransition as y}from"react-transition-group";import E from"./Overlay.js";import{useOutsideClick as N}from"./useClickOutside.js";import{FocusTrap as D}from"../Modal/FocudTrap.js";const P="offCanvasAnimation",S={timeout:{enter:300,exit:300},mountOnEnter:!0,unmountOnExit:!0},j=g.div`
|
|
2
|
+
${({animationName:t,animationDuration:l,width:e,from:o,backgroundColor:m,theme:i})=>`
|
|
3
3
|
position: fixed;
|
|
4
4
|
z-index: 1001;
|
|
5
5
|
width: 100%;
|
|
6
6
|
height: 100%;
|
|
7
7
|
top: 0;
|
|
8
8
|
${o==="left"?"left: 0;":"right: 0;"}
|
|
9
|
-
background-color: ${
|
|
10
|
-
width: ${
|
|
9
|
+
background-color: ${m||i.colors.background.light};
|
|
10
|
+
width: ${e};
|
|
11
11
|
box-shadow: 0 0 0.5em rgba(0, 0, 0, 0.2);
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
&.${t}--right-enter {
|
|
15
|
-
transform: translate3d(${
|
|
15
|
+
transform: translate3d(${e}, 0, 0);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
&.${t}--right-enter.${t}--right-enter-active {
|
|
@@ -25,12 +25,12 @@ import{jsxs as v,Fragment as c,jsx as n}from"react/jsx-runtime";import{useRef as
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
&.${t}--right-exit.${t}--right-exit-active {
|
|
28
|
-
transform: translate3d(${
|
|
28
|
+
transform: translate3d(${e}, 0, 0);
|
|
29
29
|
transition: transform 0.2s ease-in-out;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
&.${t}--left-enter {
|
|
33
|
-
transform: translate3d(-${
|
|
33
|
+
transform: translate3d(-${e}, 0, 0);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
&.${t}--left-enter.${t}--left-enter-active {
|
|
@@ -43,15 +43,19 @@ import{jsxs as v,Fragment as c,jsx as n}from"react/jsx-runtime";import{useRef as
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
&.${t}--left-exit.${t}--left-exit-active {
|
|
46
|
-
transform: translate3d(-${
|
|
47
|
-
transition: transform ${
|
|
46
|
+
transform: translate3d(-${e}, 0, 0);
|
|
47
|
+
transition: transform ${l}ms ease-in-out;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&:focus-visible {
|
|
51
|
+
outline: none;
|
|
48
52
|
}
|
|
49
53
|
`}
|
|
50
|
-
`,
|
|
54
|
+
`,F=g.div`
|
|
51
55
|
position: relative;
|
|
52
56
|
width: 100%;
|
|
53
57
|
height: 100%;
|
|
54
58
|
overflow-x: hidden;
|
|
55
59
|
overflow-y: auto;
|
|
56
60
|
-webkit-overflow-scrolling: touch;
|
|
57
|
-
`,
|
|
61
|
+
`,p=({animationName:t=P,animationDuration:l=300,backgroundColor:e,backgroundOverlay:o,children:m,from:i="right",isOpen:r,onClickOutside:a,width:v="375px",withPortal:w,transitionProps:x})=>{const s=$(null),d=$(null);N(s,()=>a?.()),O(()=>{const u=k=>{k.key==="Escape"&&r&&a?.()};return r&&(d.current=document.activeElement,window.addEventListener("keydown",u),s.current&&s.current.focus()),!r&&d.current&&d.current.focus(),()=>{window.removeEventListener("keydown",u)}},[a,r]),o&&!a&&console.error("Please provide a clickOutside handler when using backgroundOverlay option in OffCanvas component");const c=`${t}--${i}`,f=b(h,{children:[o&&n(E,{isOpen:r}),n(h,{children:n(y,{in:r,className:`${t} ${c}`,classNames:c,...S,...x,children:n(D,{children:n(j,{ref:s,animationName:t,animationDuration:l,backgroundColor:e,from:i,width:v,role:"dialog","aria-modal":"true","aria-label":"Side panel",tabIndex:-1,children:n(F,{className:`${t}-content`,children:m})})})})})]});return w?C(f,document.body):f};export{p as OffCanvas,p as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as b,jsx as c}from"react/jsx-runtime";import i,{css as
|
|
1
|
+
import{jsxs as b,jsx as c}from"react/jsx-runtime";import i,{css as s}from"styled-components";import{generateNameHash as g}from"../../shared/helpers.js";import e from"../../theme.js";import{BodyText as $}from"../../typography/BodyText/index.js";import{BackgroundStyles as x}from"../IconButton.js";import"../../shared/media-queries.js";import"../../utils/utils.js";const f=s`
|
|
2
2
|
.circle {
|
|
3
3
|
&--outer {
|
|
4
4
|
height: 24px;
|
|
@@ -11,7 +11,7 @@ import{jsxs as b,jsx as c}from"react/jsx-runtime";import i,{css as a}from"styled
|
|
|
11
11
|
transform: scale(0.6);
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
`,k=
|
|
14
|
+
`,k=s`
|
|
15
15
|
.circle {
|
|
16
16
|
&--outer {
|
|
17
17
|
height: 32px;
|
|
@@ -24,7 +24,7 @@ import{jsxs as b,jsx as c}from"react/jsx-runtime";import i,{css as a}from"styled
|
|
|
24
24
|
transform: scale(0.6);
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
`,p={regular:f,large:k},y=
|
|
27
|
+
`,p={regular:f,large:k},y=s`
|
|
28
28
|
cursor: default;
|
|
29
29
|
|
|
30
30
|
.circle {
|
|
@@ -36,14 +36,14 @@ import{jsxs as b,jsx as c}from"react/jsx-runtime";import i,{css as a}from"styled
|
|
|
36
36
|
border: 2px solid ${e.colors.grayscaleToned.light2};
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
`,D=
|
|
39
|
+
`,D=s`
|
|
40
40
|
.circle {
|
|
41
41
|
&--inner {
|
|
42
42
|
opacity: 1;
|
|
43
43
|
background-color: ${e.colors.grayscaleToned.light2};
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
`,z=(r,o,
|
|
46
|
+
`,z=(r,o,a)=>s`
|
|
47
47
|
.circle {
|
|
48
48
|
&--inner {
|
|
49
49
|
opacity: 1;
|
|
@@ -52,10 +52,10 @@ import{jsxs as b,jsx as c}from"react/jsx-runtime";import i,{css as a}from"styled
|
|
|
52
52
|
|
|
53
53
|
&--outer {
|
|
54
54
|
border: 2px solid
|
|
55
|
-
${
|
|
55
|
+
${a?e.colors.error.dark:e.colors[r][o]};
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
`,
|
|
58
|
+
`,v=i.div`
|
|
59
59
|
display: flex;
|
|
60
60
|
align-items: flex-start;
|
|
61
61
|
box-sizing: border-box;
|
|
@@ -79,21 +79,21 @@ import{jsxs as b,jsx as c}from"react/jsx-runtime";import i,{css as a}from"styled
|
|
|
79
79
|
transition: background-color 400ms;
|
|
80
80
|
${x}
|
|
81
81
|
}
|
|
82
|
-
`,
|
|
82
|
+
`,E=i.input`
|
|
83
83
|
position: absolute;
|
|
84
84
|
opacity: 0;
|
|
85
85
|
margin: 0;
|
|
86
86
|
${r=>!r.isDisabled&&"cursor: pointer;"}
|
|
87
87
|
z-index: 1;
|
|
88
88
|
${r=>p[r.$size]};
|
|
89
|
-
`,
|
|
89
|
+
`,N=i.span`
|
|
90
90
|
display: flex;
|
|
91
91
|
box-sizing: border-box;
|
|
92
92
|
border-radius: 50%;
|
|
93
93
|
|
|
94
94
|
border: 2px solid
|
|
95
95
|
${r=>r.$hasError?e.colors.error.dark:e.colors.grayscaleToned.dark5};
|
|
96
|
-
`,
|
|
96
|
+
`,T=i.span`
|
|
97
97
|
box-sizing: border-box;
|
|
98
98
|
opacity: 0;
|
|
99
99
|
margin: auto;
|
|
@@ -102,9 +102,9 @@ import{jsxs as b,jsx as c}from"react/jsx-runtime";import i,{css as a}from"styled
|
|
|
102
102
|
position: absolute;
|
|
103
103
|
top: 0;
|
|
104
104
|
left: 0;
|
|
105
|
-
`,
|
|
105
|
+
`,w=i($)`
|
|
106
106
|
cursor: ${({isDisabled:r})=>r?"default":"pointer"};
|
|
107
107
|
user-select: none;
|
|
108
108
|
color: ${({theme:r,isDisabled:o})=>o?r.colors.text.disabled:r.colors.text.dark};
|
|
109
109
|
margin-left: 0.5rem;
|
|
110
|
-
`,m=({name:r=g("radio-button"),size:o="regular",checked:
|
|
110
|
+
`,m=({name:r=g("radio-button"),size:o="regular",checked:a=!1,isDisabled:l=!1,color:n="secondary",colorShade:h="mainAlt",label:d,hasError:t,...u})=>b(v,{children:[b(S,{size:o,$color:n,$colorShade:h,isChecked:a,isDisabled:l,$hasError:t,children:[c(E,{"data-validate":"checked",checked:a,type:"radio",name:r,id:r,disabled:l,"aria-label":d?void 0:r,"aria-checked":a,"aria-invalid":t||void 0,className:"circle circle--outer",$size:o,isDisabled:l,$color:n,$colorShade:h,...u}),c(N,{className:"circle circle--outer",$hasError:t,children:c(T,{className:"circle circle--inner"})})]}),d&&c(w,{as:"label",htmlFor:r,isDisabled:l,children:d})]});export{m as RadioButton,m as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as i,jsx as
|
|
1
|
+
import{jsxs as i,jsx as r}from"react/jsx-runtime";import t from"styled-components";import a from"./EuFlagIcon.js";const s=t.div`
|
|
2
2
|
display: grid;
|
|
3
3
|
grid-template: 100% / 16px auto;
|
|
4
4
|
width: 124px;
|
|
@@ -17,7 +17,7 @@ import{jsxs as i,jsx as o}from"react/jsx-runtime";import t from"styled-component
|
|
|
17
17
|
font-size: 11px;
|
|
18
18
|
align-self: center;
|
|
19
19
|
}
|
|
20
|
-
`,
|
|
20
|
+
`,p=t.div`
|
|
21
21
|
display: flex;
|
|
22
22
|
justify-content: center;
|
|
23
23
|
align-items: center;
|
|
@@ -30,10 +30,10 @@ import{jsxs as i,jsx as o}from"react/jsx-runtime";import t from"styled-component
|
|
|
30
30
|
border-left: none;
|
|
31
31
|
border-top-right-radius: 4px;
|
|
32
32
|
border-bottom-right-radius: 4px;
|
|
33
|
-
`,
|
|
33
|
+
`,h=t.div`
|
|
34
34
|
color: ${({theme:e})=>e.colors.text.light};
|
|
35
35
|
font-family: ${({theme:e})=>e.typography.fontBaseFamily};
|
|
36
36
|
font-size: 10px;
|
|
37
37
|
font-weight: ${({theme:e})=>e.typography.fontBaseBoldWeight};
|
|
38
38
|
line-height: 1;
|
|
39
|
-
`,
|
|
39
|
+
`,c=({regNumber:e})=>{const d=l=>{const o=l.replace(/\s+/g,"").slice(0,6);return`${o.slice(0,3)} ${o.slice(3)}`};return i(s,{role:"text","aria-label":`Registration plate: ${e}`,children:[i(n,{"aria-hidden":"true",children:[r(a,{"aria-hidden":"true"}),r(h,{children:"S"})]}),r(p,{children:d(e)})]})};export{c as default};
|