@kvdbil/components 16.0.2 → 16.0.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.
- package/cjs/components/Badge/index.js +1 -1
- package/cjs/components/Breadcrumbs/BreadcrumbsItem.js +1 -1
- package/cjs/components/Button/index.js +1 -1
- package/cjs/components/Button/styles.js +1 -1
- package/cjs/components/Card/index.js +8 -8
- package/cjs/components/CheckBox/index.js +12 -11
- package/cjs/components/DayPicker/index.js +2 -2
- package/cjs/components/ErrorMessage/index.js +2 -2
- package/cjs/components/FieldLabel.js +4 -4
- package/cjs/components/IconButton.js +15 -16
- package/cjs/components/RadioButton/index.js +24 -23
- package/cjs/components/Select/index.js +9 -9
- package/cjs/components/Snackbar/index.js +6 -5
- package/cjs/components/Spinner/index.js +1 -1
- package/cjs/components/Stamp/index.js +1 -1
- package/cjs/components/Stepper/index.js +15 -14
- package/cjs/components/StepperAccordion/index.js +13 -13
- package/cjs/components/Switcher/index.js +2 -2
- package/cjs/components/Tabs/Tab.js +5 -5
- package/cjs/components/Tabs/Tabs.js +3 -3
- package/cjs/components/TextArea/index.js +4 -4
- package/cjs/components/Toggle/index.js +6 -6
- package/cjs/components/ValuationRange/index.js +15 -15
- package/cjs/index.js +1 -1
- package/cjs/utils/utils.js +2 -2
- package/esm/components/Badge/index.js +1 -1
- package/esm/components/Breadcrumbs/BreadcrumbsItem.js +3 -3
- package/esm/components/Button/index.js +5 -5
- package/esm/components/Button/styles.js +23 -23
- package/esm/components/Card/index.js +9 -9
- package/esm/components/CheckBox/index.js +19 -18
- package/esm/components/DayPicker/index.js +2 -2
- package/esm/components/ErrorMessage/index.js +4 -4
- package/esm/components/FieldLabel.js +16 -16
- package/esm/components/IconButton.js +12 -13
- package/esm/components/RadioButton/index.js +28 -27
- package/esm/components/Select/index.js +4 -4
- package/esm/components/Snackbar/index.js +16 -15
- package/esm/components/Spinner/index.js +3 -3
- package/esm/components/Stamp/index.js +1 -1
- package/esm/components/Stepper/index.js +33 -32
- package/esm/components/StepperAccordion/index.js +21 -21
- package/esm/components/Switcher/index.js +4 -4
- package/esm/components/Tabs/Tab.js +5 -5
- package/esm/components/Tabs/Tabs.js +8 -8
- package/esm/components/TextArea/index.js +2 -2
- package/esm/components/Toggle/index.js +6 -6
- package/esm/components/ValuationRange/index.js +15 -15
- package/esm/index.js +1 -1
- package/esm/utils/utils.js +2 -2
- package/package.json +1 -1
- package/package.json.tmp +1 -1
- package/types/components/Button/styles.d.ts +2 -2
- package/types/components/Card/index.d.ts +4 -1
- package/types/components/CheckBox/index.d.ts +3 -2
- package/types/components/DayPicker/index.d.ts +3 -2
- package/types/components/IconButton.d.ts +5 -3
- package/types/components/RadioButton/index.d.ts +3 -2
- package/types/components/Select/index.d.ts +3 -2
- package/types/components/Stamp/index.d.ts +3 -2
- package/types/components/Stepper/index.d.ts +3 -2
- package/types/components/StepperAccordion/index.d.ts +2 -1
- package/types/components/Switcher/index.d.ts +3 -2
- package/types/components/Tabs/Tab.d.ts +2 -1
- package/types/components/Tabs/Tabs.d.ts +3 -2
- package/types/components/Toggle/index.d.ts +3 -2
- package/types/components/ValuationRange/index.d.ts +3 -2
- package/types/index.d.ts +1 -1
- package/types/utils/utils.d.ts +9 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{jsxs as
|
|
2
|
-
background: ${({
|
|
1
|
+
import{jsxs as n,jsx as t}from"react/jsx-runtime";import d from"styled-components";import m from"../../theme.js";const h=d.div``,g=d.div`
|
|
2
|
+
background: ${({theme:e,$customColor:o,$color:r="secondary",$colorShade:l})=>o||e.colors[r][l]};
|
|
3
3
|
height: 0.25rem;
|
|
4
|
-
`,p=
|
|
5
|
-
background: ${
|
|
4
|
+
`,p=d.div`
|
|
5
|
+
background: ${m.colors.background.light};
|
|
6
6
|
|
|
7
|
-
${({noFrame:
|
|
7
|
+
${({noFrame:e,topBorder:o,lineBorder:r,theme:l})=>!o&&(!e||r)&&`border-top: 1px solid ${l.colors.grayscaleToned.light5};`}
|
|
8
8
|
|
|
9
|
-
${({noFrame:
|
|
9
|
+
${({noFrame:e,lineBorder:o,theme:r})=>(!e||o)&&`border-bottom: 1px solid ${r.colors.grayscaleToned.light5};
|
|
10
10
|
`}
|
|
11
11
|
|
|
12
|
-
${({noFrame:
|
|
13
|
-
border-left: 1px solid ${
|
|
14
|
-
`,
|
|
12
|
+
${({noFrame:e,lineBorder:o,theme:r})=>!e&&!o&&`border-right: 1px solid ${r.colors.grayscaleToned.light5};
|
|
13
|
+
border-left: 1px solid ${r.colors.grayscaleToned.light5};`}
|
|
14
|
+
`,a=({children:e,topBorder:o,topBorderColor:r,topBorderColorShade:l="mainAlt",noFrame:i=!1,lineBorder:s=!1,as:c="div"})=>n(h,{as:c,children:[(o||r)&&t(g,{$customColor:o,$color:r,$colorShade:l}),t(p,{topBorder:o,noFrame:i,lineBorder:s,children:e})]});export{a as Card,a as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as b,jsx as s}from"react/jsx-runtime";import a,{css as r}from"styled-components";import
|
|
1
|
+
import{jsxs as b,jsx as s}from"react/jsx-runtime";import a,{css as r}from"styled-components";import g from"../../icons/components/CheckmarkIcon.js";import{generateNameHash as $}from"../../shared/helpers.js";import i from"../../theme.js";import{BodyText as f}from"../../typography/BodyText/index.js";import{BackgroundStyles as u}from"../IconButton.js";import"../../shared/media-queries.js";import"../../utils/utils.js";const k=r`
|
|
2
2
|
width: 24px;
|
|
3
3
|
height: 24px;
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@ import{jsxs as b,jsx as s}from"react/jsx-runtime";import a,{css as r}from"styled
|
|
|
6
6
|
width: 15px;
|
|
7
7
|
height: 15px;
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
`,y=r`
|
|
10
10
|
width: 32px;
|
|
11
11
|
height: 32px;
|
|
12
12
|
|
|
@@ -14,10 +14,10 @@ import{jsxs as b,jsx as s}from"react/jsx-runtime";import a,{css as r}from"styled
|
|
|
14
14
|
width: 22px;
|
|
15
15
|
height: 22px;
|
|
16
16
|
}
|
|
17
|
-
`,
|
|
17
|
+
`,h={regular:k,large:y},v=r`
|
|
18
18
|
cursor: default;
|
|
19
19
|
border: 2px solid ${i.colors.grayscaleToned.light2};
|
|
20
|
-
`,
|
|
20
|
+
`,z=(e,o)=>r`
|
|
21
21
|
svg {
|
|
22
22
|
opacity: 1;
|
|
23
23
|
}
|
|
@@ -25,12 +25,12 @@ import{jsxs as b,jsx as s}from"react/jsx-runtime";import a,{css as r}from"styled
|
|
|
25
25
|
:hover {
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
background: ${i.colors[e]
|
|
29
|
-
border: 2px solid ${i.colors[e]
|
|
30
|
-
`,
|
|
28
|
+
background: ${i.colors[e][o]};
|
|
29
|
+
border: 2px solid ${i.colors[e][o]};
|
|
30
|
+
`,D=r`
|
|
31
31
|
background: ${i.colors.grayscaleToned.light2};
|
|
32
32
|
z-index: 1;
|
|
33
|
-
`,
|
|
33
|
+
`,S=r`
|
|
34
34
|
border: 2px solid ${i.colors.error.dark};
|
|
35
35
|
`,w=a.div`
|
|
36
36
|
display: flex;
|
|
@@ -47,13 +47,14 @@ import{jsxs as b,jsx as s}from"react/jsx-runtime";import a,{css as r}from"styled
|
|
|
47
47
|
outline: none;
|
|
48
48
|
cursor: pointer;
|
|
49
49
|
z-index: 1;
|
|
50
|
-
${e=>
|
|
50
|
+
${e=>h[e.boxSize]};
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
&:hover,
|
|
53
|
+
&:focus {
|
|
53
54
|
transition: background-color 400ms;
|
|
54
55
|
${u}
|
|
55
56
|
}
|
|
56
|
-
`,
|
|
57
|
+
`,T=a.span`
|
|
57
58
|
box-sizing: border-box;
|
|
58
59
|
cursor: pointer;
|
|
59
60
|
display: flex;
|
|
@@ -64,21 +65,21 @@ import{jsxs as b,jsx as s}from"react/jsx-runtime";import a,{css as r}from"styled
|
|
|
64
65
|
|
|
65
66
|
border: 2px solid ${i.colors.grayscaleToned.dark5};
|
|
66
67
|
|
|
67
|
-
${e=>
|
|
68
|
+
${e=>h[e.size]};
|
|
68
69
|
|
|
69
70
|
svg {
|
|
70
71
|
opacity: 0;
|
|
71
72
|
color: ${({theme:e})=>e.colors.common.white};
|
|
72
73
|
}
|
|
73
74
|
|
|
74
|
-
${e=>e.isChecked&&
|
|
75
|
-
${e=>e.isDisabled&&
|
|
76
|
-
${e=>e.hasError&&
|
|
77
|
-
${e=>e.isChecked&&e.isDisabled&&
|
|
78
|
-
`,
|
|
75
|
+
${e=>e.isChecked&&z(e.$color,e.$colorShade)};
|
|
76
|
+
${e=>e.isDisabled&&v};
|
|
77
|
+
${e=>e.hasError&&S};
|
|
78
|
+
${e=>e.isChecked&&e.isDisabled&&D};
|
|
79
|
+
`,j=a(f)`
|
|
79
80
|
flex: 1;
|
|
80
81
|
cursor: ${({isDisabled:e})=>e?"default":"pointer"};
|
|
81
82
|
user-select: none;
|
|
82
83
|
color: ${({theme:e,isDisabled:o})=>o?e.colors.text.disabled:e.colors.text.dark};
|
|
83
84
|
margin-left: 0.5rem;
|
|
84
|
-
`,
|
|
85
|
+
`,p=({name:e=$("check-box"),isDisabled:o=!1,size:l="regular",checked:t=!1,color:d="secondary",colorShade:c="mainAlt",hasError:x=!1,label:n,...m})=>b(w,{children:[s(C,{...m,type:"checkbox",checked:t,"data-validate":"checked",name:e,id:e,$color:d,$colorShade:c,disabled:o,isDisabled:o,boxSize:l}),s(T,{size:l,$color:d,$colorShade:c,isChecked:t,isDisabled:o,hasError:x,children:s(g,{})}),n&&s(j,{as:"label",htmlFor:e,isDisabled:o,children:n})]});export{p as CheckBox,p as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as i}from"react/jsx-runtime";import{useState as y}from"react";import h from"styled-components";import t from"../../theme.js";import{DayPicker as u}from"react-day-picker";import*as m from"date-fns/locale";import{isToday as g}from"date-fns";import k from"./style.js";const D=h.div`
|
|
2
2
|
${k}
|
|
3
3
|
|
|
4
4
|
.rdp-chevron {
|
|
@@ -6,4 +6,4 @@ import{jsx as l}from"react/jsx-runtime";import{useState as p}from"react";import
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
font-family: ${({theme:o})=>o.typography.fontAlternativeFamily};
|
|
9
|
-
|
|
9
|
+
`,$=(o,r,e)=>{const l=e&&g(e)?t.colors.background.light:t.colors[o][r];return{selected:{color:t.colors.text.light,background:t.colors[o][r]},today:{color:l}}},s=({locale:o="sv",color:r="primary",colorShade:e="mainAlt",selectedDay:l,disabledDays:d,...n})=>{const[a,f]=y(l);function p(c){c&&f(c)}return i(D,{children:i(u,{...n,mode:"single",selected:a,onSelect:p,locale:m[o]||m.enGB,modifiersStyles:$(r,e,a),disabled:d})})};export{s as DayPicker,s as default};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{jsx as n}from"react/jsx-runtime";import
|
|
1
|
+
import{jsx as n}from"react/jsx-runtime";import a from"styled-components";const i=a.div`
|
|
2
2
|
font-family: ${({theme:e})=>e.typography.fontAlternativeFamily};
|
|
3
3
|
font-weight: ${({theme:e})=>e.typography.fontAlternativeRegularWeight};
|
|
4
|
-
background: ${({theme:e})=>e.colors.error.
|
|
5
|
-
color:
|
|
4
|
+
background: ${({theme:e})=>e.colors.error.lighter};
|
|
5
|
+
color: ${({theme:e})=>e.colors.text.dark};
|
|
6
6
|
border-radius: 0.25rem;
|
|
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})=>n(i,{centered:t,...o,children:e});export{r as ErrorMessage,r as default};
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import
|
|
2
|
-
transform: translateY(${
|
|
1
|
+
import s,{css as t}from"styled-components";import{BodyTextStyle as i}from"../typography/BodyText/index.js";import"react/jsx-runtime";import"../shared/media-queries.js";const l=(o,e)=>t`
|
|
2
|
+
transform: translateY(${o});
|
|
3
3
|
line-height: 0.875rem;
|
|
4
4
|
font-size: 0.75rem;
|
|
5
5
|
transform-origin: 0 0;
|
|
6
6
|
padding: 0 5px;
|
|
7
7
|
left: 0.5rem;
|
|
8
|
-
color: ${({theme:r})=>
|
|
9
|
-
`,n=t`
|
|
10
|
-
color: ${({theme:e,hasError:o})=>o?e.colors.error.dark:e.colors.text.dark};
|
|
8
|
+
color: ${({theme:r})=>e?r.colors.error.dark:r.colors.text.dark};
|
|
11
9
|
`,c=t`
|
|
12
|
-
color: ${({theme:e})=>e.colors.text.
|
|
10
|
+
color: ${({theme:o,hasError:e})=>e?o.colors.error.dark:o.colors.text.dark};
|
|
11
|
+
`,n=t`
|
|
12
|
+
color: ${({theme:o})=>o.colors.text.disabled};
|
|
13
13
|
`,d=t`
|
|
14
14
|
width: max-content;
|
|
15
15
|
left: 0;
|
|
16
16
|
right: 0;
|
|
17
17
|
margin-right: auto;
|
|
18
18
|
margin-left: auto;
|
|
19
|
-
`,h=
|
|
19
|
+
`,h=s.label`
|
|
20
20
|
${i}
|
|
21
21
|
pointer-events: none;
|
|
22
22
|
position: absolute;
|
|
23
23
|
max-width: calc(100% - 2rem);
|
|
24
24
|
z-index: 1;
|
|
25
|
-
top: ${({height:
|
|
25
|
+
top: ${({height:o})=>o?`calc(${o}rem - 5px)`:"12px"};
|
|
26
26
|
left: calc(0.75rem + 2px);
|
|
27
27
|
transition: 150ms;
|
|
28
|
-
color: ${({theme:
|
|
28
|
+
color: ${({theme:o})=>o.colors.text.dark};
|
|
29
29
|
overflow: hidden;
|
|
30
30
|
white-space: nowrap;
|
|
31
31
|
text-overflow: ellipsis;
|
|
32
32
|
background: transparent;
|
|
33
33
|
|
|
34
|
-
${({theme:
|
|
34
|
+
${({theme:o,hasValue:e,isFocused:r})=>(e||r)&&`
|
|
35
35
|
span {
|
|
36
36
|
display: block;
|
|
37
37
|
width: 100%;
|
|
38
38
|
height: 8px;
|
|
39
39
|
position: absolute;
|
|
40
|
-
top:
|
|
40
|
+
top: 6px;
|
|
41
41
|
left: 0;
|
|
42
|
-
background-color: ${
|
|
42
|
+
background-color: ${o.colors.background.light};
|
|
43
43
|
z-index: -1;
|
|
44
44
|
}
|
|
45
45
|
`}
|
|
46
46
|
|
|
47
|
-
${({hasValue:
|
|
48
|
-
${({centered:
|
|
49
|
-
${({isFocused:
|
|
50
|
-
${({disabled:
|
|
47
|
+
${({hasValue:o,isFocused:e,height:r,hasError:a})=>(o||e)&&l(`${r?`calc(-${r}rem - 2px)`:"-18px"}`,a)}
|
|
48
|
+
${({centered:o,hasValue:e,isFocused:r})=>(e||r)&&o&&d}
|
|
49
|
+
${({isFocused:o})=>o&&c}
|
|
50
|
+
${({disabled:o})=>o&&n}
|
|
51
51
|
`;export{h as Label};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import{jsxs as u,jsx as
|
|
1
|
+
import{jsxs as u,jsx as b}from"react/jsx-runtime";import n,{css as a}from"styled-components";import{hexToRGB as m,resolveColorWithNeutral as f}from"../utils/utils.js";const h=a`
|
|
2
2
|
background-color: transparent;
|
|
3
|
-
`,l="400ms",
|
|
4
|
-
background-color: ${({theme:e
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
`,v=n.div`
|
|
3
|
+
`,l="400ms",k="1500ms",v="750ms",r=a`
|
|
4
|
+
background-color: ${({theme:e,$color:c,$colorShade:i})=>m(f(e,c)[i],.1)};
|
|
5
|
+
${e=>e.isDisabled&&h};
|
|
6
|
+
`,$=n.div`
|
|
8
7
|
cursor: ${e=>e.isDisabled?"default":"pointer"};
|
|
9
8
|
outline: none;
|
|
10
9
|
|
|
@@ -17,24 +16,24 @@ import{jsxs as u,jsx as d}from"react/jsx-runtime";import n,{css as a}from"styled
|
|
|
17
16
|
}
|
|
18
17
|
}
|
|
19
18
|
|
|
20
|
-
|
|
19
|
+
&:hover {
|
|
21
20
|
.button-background {
|
|
22
21
|
transition: background-color ${l};
|
|
23
22
|
${r}
|
|
24
23
|
}
|
|
25
24
|
}
|
|
26
25
|
|
|
27
|
-
|
|
26
|
+
&:focus {
|
|
28
27
|
.button-background {
|
|
29
28
|
transition: background-color ${l};
|
|
30
|
-
animation: FocusRipple ${
|
|
29
|
+
animation: FocusRipple ${k} 0ms infinite alternate-reverse;
|
|
31
30
|
${r}
|
|
32
31
|
}
|
|
33
32
|
}
|
|
34
33
|
|
|
35
|
-
|
|
34
|
+
&:active {
|
|
36
35
|
.button-background {
|
|
37
|
-
animation: ActiveRipple ${
|
|
36
|
+
animation: ActiveRipple ${v};
|
|
38
37
|
${r}
|
|
39
38
|
}
|
|
40
39
|
}
|
|
@@ -62,7 +61,7 @@ import{jsxs as u,jsx as d}from"react/jsx-runtime";import n,{css as a}from"styled
|
|
|
62
61
|
clip-path: circle(50%);
|
|
63
62
|
}
|
|
64
63
|
}
|
|
65
|
-
`,
|
|
64
|
+
`,g=n.div`
|
|
66
65
|
top: 0;
|
|
67
66
|
left: 0;
|
|
68
67
|
|
|
@@ -72,4 +71,4 @@ import{jsxs as u,jsx as d}from"react/jsx-runtime";import n,{css as a}from"styled
|
|
|
72
71
|
|
|
73
72
|
position: absolute;
|
|
74
73
|
border-radius: 10rem;
|
|
75
|
-
`,
|
|
74
|
+
`,y=({children:e,isActive:c,isDisabled:i,onClick:t,noTabIndex:s=!1,color:p,colorShade:d="mainAlt"})=>u($,{$color:p,$colorShade:d,isActive:c,isDisabled:i,onClick:o=>{o.stopPropagation(),o.preventDefault(),o.persist(),!i&&typeof t=="function"&&t(o)},onKeyDown:o=>{o.key==="Enter"&&!i&&typeof t=="function"&&(o.persist(),t(o))},tabIndex:i||s?void 0:0,children:[b(g,{className:"button-background"}),e]});export{r as BackgroundStyles,y as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as b,jsx as
|
|
1
|
+
import{jsxs as b,jsx as c}from"react/jsx-runtime";import i,{css as a}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=a`
|
|
2
2
|
.circle {
|
|
3
3
|
&--outer {
|
|
4
4
|
height: 24px;
|
|
@@ -11,7 +11,7 @@ import{jsxs as b,jsx as l}from"react/jsx-runtime";import i,{css as s}from"styled
|
|
|
11
11
|
transform: scale(0.6);
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
`,
|
|
14
|
+
`,k=a`
|
|
15
15
|
.circle {
|
|
16
16
|
&--outer {
|
|
17
17
|
height: 32px;
|
|
@@ -24,86 +24,87 @@ import{jsxs as b,jsx as l}from"react/jsx-runtime";import i,{css as s}from"styled
|
|
|
24
24
|
transform: scale(0.6);
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
`,
|
|
27
|
+
`,p={regular:f,large:k},y=a`
|
|
28
28
|
cursor: default;
|
|
29
29
|
|
|
30
30
|
.circle {
|
|
31
31
|
&--inner {
|
|
32
|
-
background-color: ${e.colors.grayscaleToned.
|
|
32
|
+
background-color: ${e.colors.grayscaleToned.light2};
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
&--outer {
|
|
36
|
-
border: 2px solid ${e.colors.grayscaleToned.
|
|
36
|
+
border: 2px solid ${e.colors.grayscaleToned.light2};
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
`,
|
|
39
|
+
`,D=a`
|
|
40
40
|
.circle {
|
|
41
41
|
&--inner {
|
|
42
42
|
opacity: 1;
|
|
43
|
-
background-color: ${e.colors.grayscaleToned.
|
|
43
|
+
background-color: ${e.colors.grayscaleToned.light2};
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
`,
|
|
46
|
+
`,z=(r,o,s)=>a`
|
|
47
47
|
.circle {
|
|
48
48
|
&--inner {
|
|
49
49
|
opacity: 1;
|
|
50
|
-
background-color: ${e.colors[r]
|
|
50
|
+
background-color: ${e.colors[r][o]};
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
&--outer {
|
|
54
54
|
border: 2px solid
|
|
55
|
-
${
|
|
55
|
+
${s?e.colors.error.dark:e.colors[r][o]};
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
`,
|
|
58
|
+
`,E=i.div`
|
|
59
59
|
display: flex;
|
|
60
|
-
align-items:
|
|
60
|
+
align-items: flex-start;
|
|
61
61
|
box-sizing: border-box;
|
|
62
|
-
`,
|
|
62
|
+
`,S=i.span`
|
|
63
63
|
cursor: pointer;
|
|
64
64
|
display: flex;
|
|
65
65
|
position: relative;
|
|
66
66
|
align-items: center;
|
|
67
67
|
justify-content: center;
|
|
68
68
|
|
|
69
|
-
${r=>
|
|
69
|
+
${r=>p[r.size]};
|
|
70
70
|
|
|
71
|
-
${r=>!r.isDisabled&&r.isChecked&&
|
|
71
|
+
${r=>!r.isDisabled&&r.isChecked&&z(r.$color,r.$colorShade,r.$hasError)};
|
|
72
72
|
${r=>r.isDisabled&&y};
|
|
73
73
|
|
|
74
|
-
${r=>r.isChecked&&r.isDisabled&&
|
|
75
|
-
|
|
74
|
+
${r=>r.isChecked&&r.isDisabled&&D};
|
|
75
|
+
|
|
76
|
+
&:hover,
|
|
77
|
+
&:focus {
|
|
78
|
+
border-radius: 50%;
|
|
79
|
+
transition: background-color 400ms;
|
|
80
|
+
${x}
|
|
81
|
+
}
|
|
82
|
+
`,T=i.input`
|
|
76
83
|
position: absolute;
|
|
77
84
|
opacity: 0;
|
|
78
85
|
margin: 0;
|
|
79
86
|
${r=>!r.isDisabled&&"cursor: pointer;"}
|
|
80
87
|
z-index: 1;
|
|
81
|
-
${r=>
|
|
82
|
-
|
|
83
|
-
:focus-visible {
|
|
84
|
-
transition: background-color 400ms;
|
|
85
|
-
${x}
|
|
86
|
-
}
|
|
88
|
+
${r=>p[r.$size]};
|
|
87
89
|
`,v=i.span`
|
|
88
90
|
display: flex;
|
|
89
91
|
box-sizing: border-box;
|
|
90
92
|
border-radius: 50%;
|
|
91
93
|
|
|
92
94
|
border: 2px solid
|
|
93
|
-
${r=>r.$hasError?e.colors.error.dark:e.colors.grayscaleToned.
|
|
95
|
+
${r=>r.$hasError?e.colors.error.dark:e.colors.grayscaleToned.dark5};
|
|
94
96
|
`,w=i.span`
|
|
95
97
|
box-sizing: border-box;
|
|
96
98
|
opacity: 0;
|
|
97
99
|
margin: auto;
|
|
98
100
|
border-radius: 50%;
|
|
99
|
-
background-color: ${e.colors.grayscaleToned.light1};
|
|
100
101
|
|
|
101
102
|
position: absolute;
|
|
102
103
|
top: 0;
|
|
103
104
|
left: 0;
|
|
104
|
-
`,B=i(
|
|
105
|
+
`,B=i($)`
|
|
105
106
|
cursor: ${({isDisabled:r})=>r?"default":"pointer"};
|
|
106
107
|
user-select: none;
|
|
107
108
|
color: ${({theme:r,isDisabled:o})=>o?r.colors.text.disabled:r.colors.text.dark};
|
|
108
109
|
margin-left: 0.5rem;
|
|
109
|
-
`,
|
|
110
|
+
`,m=({name:r=g("radio-button"),size:o="regular",checked:s=!1,isDisabled:l=!1,color:t="secondary",colorShade:d="mainAlt",label:n,hasError:h,...u})=>b(E,{children:[b(S,{size:o,$color:t,$colorShade:d,isChecked:s,isDisabled:l,$hasError:h,children:[c(T,{"data-validate":"checked",checked:s,type:"radio",name:r,id:r,disabled:l,"aria-label":r,"aria-checked":s,className:"circle circle--outer",$size:o,isDisabled:l,$color:t,$colorShade:d,...u}),c(v,{className:"circle circle--outer",$hasError:h,children:c(w,{className:"circle circle--inner"})})]}),n&&c(B,{as:"label",htmlFor:r,isDisabled:l,children:n})]});export{m as RadioButton,m as default};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{jsxs as u,jsx as a,Fragment as M}from"react/jsx-runtime";import{useState as F}from"react";import N from"react-select";import m from"styled-components";import{DEFAULT_TRANSITION_MS as S}from"../../shared/constants.js";import r from"../../theme.js";import{CaptionStyle as R}from"../../typography/BodyText/index.js";import{Label as
|
|
1
|
+
import{jsxs as u,jsx as a,Fragment as M}from"react/jsx-runtime";import{useState as F}from"react";import N from"react-select";import m from"styled-components";import{DEFAULT_TRANSITION_MS as S}from"../../shared/constants.js";import r from"../../theme.js";import{CaptionStyle as R}from"../../typography/BodyText/index.js";import{Label as A}from"../FieldLabel.js";import"../../shared/media-queries.js";const W=m.div`
|
|
2
2
|
font-family: ${({theme:o})=>o.typography.fontBaseFamily};
|
|
3
3
|
position: relative;
|
|
4
|
-
`,T=o=>o&&{paddingLeft:"2.5rem"},j=o=>o&&{border:`1px solid ${r.colors.grayscaleToned.light1}`,color:r.colors.grayscaleToned.dark1,fill:r.colors.grayscaleToned.light1},
|
|
4
|
+
`,T=o=>o&&{paddingLeft:"2.5rem"},j=o=>o&&{border:`1px solid ${r.colors.grayscaleToned.light1}`,color:r.colors.grayscaleToned.dark1,fill:r.colors.grayscaleToned.light1},_=o=>o&&{border:`2px solid ${r.colors.error.dark}`},P=m.div`
|
|
5
5
|
position: absolute;
|
|
6
6
|
z-index: 1;
|
|
7
7
|
top: 0.5rem;
|
|
@@ -13,7 +13,7 @@ import{jsxs as u,jsx as a,Fragment as M}from"react/jsx-runtime";import{useState
|
|
|
13
13
|
${o=>o.isDisabled&&` fill: ${r.colors.grayscaleToned.light1}; `}
|
|
14
14
|
|
|
15
15
|
${o=>o.isFocused&&` fill: ${o.theme.colors.text.dark}; `}
|
|
16
|
-
`,
|
|
16
|
+
`,U=m.span`
|
|
17
17
|
${R}
|
|
18
18
|
display: block;
|
|
19
19
|
margin-top: 0.25rem;
|
|
@@ -36,4 +36,4 @@ import{jsxs as u,jsx as a,Fragment as M}from"react/jsx-runtime";import{useState
|
|
|
36
36
|
transform: ${o=>o.$isMenuOpen?"rotate(-180deg)":"rotate(0deg)"};
|
|
37
37
|
|
|
38
38
|
transform-origin: 50% 60%;
|
|
39
|
-
`,
|
|
39
|
+
`,Z=(o,t)=>t?r.colors.error.dark:o?r.colors.text.dark:r.colors.grayscaleToned.light1,q=({selectProps:{menuIsOpen:o=!1},isFocused:t=!1,isDisabled:p})=>a(G,{$isDisabled:p,$isFocused:t,$isMenuOpen:o,$theme:r});function D({className:o,color:t="primary",colorShade:p="mainAlt",forwardRef:w,hasError:s=!1,height:n,helperText:f,isDisabled:d=!1,onBlur:L=()=>null,onFocus:v=()=>null,onInputChange:C=()=>null,placeholder:I="",name:g,...i}){const[c,b]=F(!1),[B,z]=F(""),O=(e,l)=>{C(e,l),z(e)},$=({isSelected:e,isFocused:l,isDisabled:h})=>e?r.colors[t][p]:h?r.colors.background.light:l?r.colors.background.gray:r.colors.background.light,E=e=>{b(!0),v(e)},H=e=>{b(!1),L(e)},x=Z(c,s),y=!i.label;return u(W,{className:o,children:[!y&&i.label&&a(A,{htmlFor:g,height:n,isFocused:c,hasValue:!!(i.value||B),disabled:d,theme:r,hasError:s,children:u(M,{children:[i.label,a("span",{})]})}),i.prefix&&a(P,{isDisabled:d,isFocused:c,children:i.prefix}),a(N,{...i,id:"react-select",inputId:g,name:g,ref:w,isDisabled:d,onInputChange:O,placeholder:I,onFocus:E,onBlur:H,styles:{control:e=>({...e,borderRadius:0,color:r.colors.text.dark,fontFamily:r.typography.fontBaseFamily,fontSize:"1rem",fontWeight:400,cursor:"pointer",padding:"0.7rem 0.5rem",backgroundColor:r.colors.background.light,borderColor:x,boxShadow:"none",minHeight:"3rem","&:hover":{borderColor:"none"},...j(d),..._(s),...T(!!i.prefix)}),input:e=>({...e,height:"auto",margin:0,padding:0}),placeholder:e=>{const l={...e,fontSize:"1rem",lineHeight:"1.5rem",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",margin:0};return y?{...l,color:r.colors.text.dark,fontWeight:600}:{...l,display:c?"static":"none"}},menuList:e=>({...e,padding:"0.5rem 0",paddingBottom:"5rem",marginTop:0,border:`1px solid ${x}`,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:l,isFocused:h,isDisabled:k})=>({...e,padding:"0.5rem",lineHeight:"1.5rem",fontSize:"1rem",fontWeight:400,cursor:k?"not-allowed":"pointer","&:hover":{background:$({isSelected:l,isFocused:!0,isDisabled:k})},background:$({isSelected:l,isFocused:h}),...T(!!i.prefix)}),valueContainer:e=>({...e,position:"static",padding:n?`${n-1}rem 0 `:0,height:n?"auto":"1.5rem"}),clearIndicator:e=>({...e,paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:"0.2rem"})},components:{IndicatorSeparator:()=>null,DropdownIndicator:q,...i.components??{}}}),f&&a(U,{hasError:s,children:f})]})}export{D as Select,D as default};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{jsx as t,jsxs as
|
|
1
|
+
import{jsx as t,jsxs as $}from"react/jsx-runtime";import{useEffect as y}from"react";import n,{css as i}from"styled-components";import v from"../Icons/CheckCircle.js";import b from"../Icons/Close.js";import k from"../Icons/ErrorCircle.js";import E from"../Icons/InfoCircle.js";import{CSSTransition as w}from"react-transition-group";import{resolveColorWithNeutral as C}from"../../utils/utils.js";const B={top:i`
|
|
2
2
|
top: 0;
|
|
3
|
-
`,bottom:
|
|
3
|
+
`,bottom:i`
|
|
4
4
|
bottom: 0;
|
|
5
|
-
`},N={right:
|
|
5
|
+
`},N={right:i`
|
|
6
6
|
right: 0;
|
|
7
|
-
`,center:
|
|
7
|
+
`,center:i`
|
|
8
8
|
left: 50%;
|
|
9
9
|
transform: translate(-50%, 0);
|
|
10
|
-
`,left:
|
|
10
|
+
`,left:i`
|
|
11
11
|
left: 0;
|
|
12
|
-
`},
|
|
12
|
+
`},c=200,o="anim",O=n.div`
|
|
13
13
|
font-family: ${({theme:e})=>e.typography.fontBaseFamily};
|
|
14
14
|
position: fixed;
|
|
15
15
|
display: flex;
|
|
@@ -27,24 +27,25 @@ import{jsx as t,jsxs as y}from"react/jsx-runtime";import{useEffect as $}from"rea
|
|
|
27
27
|
font-size: 0.875rem;
|
|
28
28
|
|
|
29
29
|
box-shadow: ${({theme:e})=>e.elevations.elevation8};
|
|
30
|
-
background-color: ${({theme:e
|
|
31
|
-
|
|
30
|
+
background-color: ${({theme:e,$color:r})=>r!=="none"?C(e,r).lighter:e.colors.background.light};
|
|
31
|
+
|
|
32
|
+
color: ${({theme:e})=>e.colors.text.dark};
|
|
32
33
|
|
|
33
34
|
${e=>B[e.origin.vertical||"bottom"]}
|
|
34
35
|
${e=>N[e.origin.horizontal||"left"]}
|
|
35
36
|
|
|
36
|
-
transition: opacity ${
|
|
37
|
+
transition: opacity ${c}ms ease-in;
|
|
37
38
|
|
|
38
|
-
&.${
|
|
39
|
+
&.${o}-enter {
|
|
39
40
|
opacity: 0;
|
|
40
41
|
}
|
|
41
|
-
&.${
|
|
42
|
+
&.${o}-enter-active {
|
|
42
43
|
opacity: 1;
|
|
43
44
|
}
|
|
44
|
-
&.${
|
|
45
|
+
&.${o}-exit {
|
|
45
46
|
opacity: 1;
|
|
46
47
|
}
|
|
47
|
-
&.${
|
|
48
|
+
&.${o}-exit-active {
|
|
48
49
|
opacity: 0;
|
|
49
50
|
}
|
|
50
51
|
`,g=n.div`
|
|
@@ -57,7 +58,7 @@ import{jsx as t,jsxs as y}from"react/jsx-runtime";import{useEffect as $}from"rea
|
|
|
57
58
|
svg {
|
|
58
59
|
width: 1.5rem;
|
|
59
60
|
height: 1.5rem;
|
|
60
|
-
fill: ${({theme:e
|
|
61
|
+
fill: ${({theme:e})=>e.colors.text.dark};
|
|
61
62
|
}
|
|
62
63
|
`,S=n(g)`
|
|
63
64
|
cursor: pointer;
|
|
@@ -75,4 +76,4 @@ import{jsx as t,jsxs as y}from"react/jsx-runtime";import{useEffect as $}from"rea
|
|
|
75
76
|
}
|
|
76
77
|
`,T=n.span`
|
|
77
78
|
flex: 1;
|
|
78
|
-
`,W={error:t(k,{}),success:t(
|
|
79
|
+
`,W={error:t(k,{}),success:t(v,{}),info:t(E,{}),text:""},p=({message:e,color:r="none",type:a="info",action:l,isOpen:h,origin:d={},onClose:m=()=>{},onExited:f=()=>{},autoHideDuration:s=4e3,...u})=>(y(()=>{const x=setTimeout(m,s);return()=>clearTimeout(x)},[s,m]),t(w,{in:h,timeout:c,mountOnEnter:!0,unmountOnExit:!0,onExited:f,classNames:o,children:$(O,{...u,$color:r,origin:d,children:[t(g,{type:a,children:W[a]}),t(T,{children:e}),l&&l,t(S,{onClick:m,children:t(b,{})})]})}));export{p as Snackbar,p as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as i}from"react/jsx-runtime";import s,{keyframes as m}from"styled-components";import d from"../../theme.js";import{neutralColorSwap as n}from"../../utils/utils.js";const u=e=>{const r={slow:"2s",default:"1s",fast:"0.5s"};return r[e]||r.default},o=e=>{const r={smaller:1,small:2,regular:3,large:4};return typeof e=="number"?e:r[e]||r.regular},f=m`
|
|
2
2
|
0% {
|
|
3
3
|
transform: rotate(0deg);
|
|
4
4
|
}
|
|
@@ -8,7 +8,7 @@ import{jsx as l}from"react/jsx-runtime";import s,{keyframes as m}from"styled-com
|
|
|
8
8
|
`,p=s.div`
|
|
9
9
|
display: inline-block;
|
|
10
10
|
border-radius: 50%;
|
|
11
|
-
border-top: ${({theme:e,color:r,customColor:
|
|
11
|
+
border-top: ${({theme:e,color:r,customColor:t,size:a})=>`${o(a)/10}em solid ${t??r==="neutral"?n(e).mainAlt:e.colors?.[r]?.mainAlt}`};
|
|
12
12
|
border-bottom: ${({size:e})=>`${o(e)/10}em solid rgba(0, 0, 0, 0.1);`};
|
|
13
13
|
border-right: ${({size:e})=>`${o(e)/10}em solid rgba(0, 0, 0, 0.1);`};
|
|
14
14
|
border-left: ${({size:e})=>`${o(e)/10}em solid rgba(0, 0, 0, 0.1);`};
|
|
@@ -16,4 +16,4 @@ import{jsx as l}from"react/jsx-runtime";import s,{keyframes as m}from"styled-com
|
|
|
16
16
|
height: ${({size:e})=>o(e)}em;
|
|
17
17
|
animation: ${f} ${({speed:e})=>u(e)} infinite linear;
|
|
18
18
|
will-change: transform;
|
|
19
|
-
`,$=({size:e="regular",color:r="primary",speed:
|
|
19
|
+
`,$=({size:e="regular",color:r="primary",speed:t="default",customColor:a,...l})=>i(p,{"aria-label":"loading",role:"status","aria-live":"polite","aria-busy":"true",...l,size:e,speed:t,color:r,customColor:a,theme:d});export{$ as default};
|