@kvdbil/components 8.3.6 → 8.4.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/CheckBox/index.js +12 -11
- package/cjs/components/FieldLabel.js +27 -22
- package/cjs/components/Hero/index.js +15 -9
- package/cjs/components/Select/index.js +1 -1
- package/cjs/components/Stepper/index.js +54 -25
- package/cjs/components/TextArea/index.js +21 -22
- package/cjs/components/Textfield/index.js +26 -24
- package/cjs/index.js +1 -1
- package/esm/components/CheckBox/index.js +5 -4
- package/esm/components/FieldLabel.js +21 -16
- package/esm/components/Hero/index.js +15 -9
- package/esm/components/Select/index.js +2 -2
- package/esm/components/Stepper/index.js +54 -25
- package/esm/components/TextArea/index.js +21 -22
- package/esm/components/Textfield/index.js +19 -17
- package/esm/index.js +1 -1
- package/package.json +1 -1
- package/types/components/Hero/index.d.ts +22 -2
- package/types/components/Stepper/index.d.ts +7 -1
- package/types/components/TextArea/index.d.ts +7 -3
- package/types/index.d.ts +0 -2
- package/cjs/components/InlineStepper/Step.js +0 -56
- package/cjs/components/InlineStepper/StepCircle.js +0 -43
- package/cjs/components/InlineStepper/index.js +0 -7
- package/esm/components/InlineStepper/Step.js +0 -56
- package/esm/components/InlineStepper/StepCircle.js +0 -43
- package/esm/components/InlineStepper/index.js +0 -7
- package/types/components/InlineStepper/Step.d.ts +0 -20
- package/types/components/InlineStepper/StepCircle.d.ts +0 -8
- package/types/components/InlineStepper/index.d.ts +0 -10
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import e from"react";import r from"styled-components";import o from"../../theme.js";import{CaptionLink as c}from"../../typography/BodyText/index.js";import m from"./StepCircle.js";import"../../shared/media-queries.js";import"../Icons/CheckIcon.js";const s=r.div`
|
|
2
|
-
background-color: ${o.colors.gray.dark3};
|
|
3
|
-
height: 1px;
|
|
4
|
-
right: 0;
|
|
5
|
-
left: calc(50% + 20px);
|
|
6
|
-
top: 1.25rem;
|
|
7
|
-
position: absolute;
|
|
8
|
-
width: calc(100% - 40px);
|
|
9
|
-
`,u=r.div`
|
|
10
|
-
font-family: ${({theme:t})=>t.typography.fontBaseFamily};
|
|
11
|
-
display: flex;
|
|
12
|
-
position: relative;
|
|
13
|
-
padding: 0 0.5rem;
|
|
14
|
-
flex: 1;
|
|
15
|
-
align-items: center;
|
|
16
|
-
flex-direction: column;
|
|
17
|
-
|
|
18
|
-
&:last-child {
|
|
19
|
-
padding-bottom: 0;
|
|
20
|
-
${s} {
|
|
21
|
-
display: none;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
`,x=r(c)`
|
|
25
|
-
width: 100%;
|
|
26
|
-
margin: 0.5rem 0 0;
|
|
27
|
-
line-height: 1.2;
|
|
28
|
-
text-align: center;
|
|
29
|
-
color: ${o.colors.text.dark};
|
|
30
|
-
`,d=r.div`
|
|
31
|
-
margin: 0 auto;
|
|
32
|
-
width: 1px;
|
|
33
|
-
height: 100%;
|
|
34
|
-
background-color: ${o.colors.gray.dark3};
|
|
35
|
-
`,v=r.div`
|
|
36
|
-
margin-right: 0.75rem;
|
|
37
|
-
`,E=r.div`
|
|
38
|
-
font-family: ${({theme:t})=>t.typography.fontBaseFamily};
|
|
39
|
-
display: flex;
|
|
40
|
-
padding-bottom: 1rem;
|
|
41
|
-
|
|
42
|
-
&:last-child {
|
|
43
|
-
${d} {
|
|
44
|
-
display: none;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
`,k=r(c)`
|
|
48
|
-
margin: 0;
|
|
49
|
-
width: 100%;
|
|
50
|
-
line-height: 1.2;
|
|
51
|
-
text-align: left;
|
|
52
|
-
color: ${o.colors.text.dark};
|
|
53
|
-
display: flex;
|
|
54
|
-
flex-direction: column;
|
|
55
|
-
justify-content: center;
|
|
56
|
-
`,p=({active:t,disabled:i})=>t?"active":i?"disabled":"completed",$=({step:t=0,active:i=!1,completed:f=!1,disabled:h=!1,orientation:g,children:a,backgroundColor:y,...n})=>{const l=p({active:i,disabled:h,completed:f});return g==="horizontal"?e.createElement(u,{...n},e.createElement(m,{state:l,step:t,backgroundColor:y}),e.createElement(s,null),e.createElement(x,{as:"div"},a)):e.createElement(E,{...n},e.createElement(v,null,e.createElement(m,{state:l,step:t}),e.createElement(d,null)),e.createElement(k,{as:"div"},a))};export{$ as default,p as getStepState};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import r from"react";import i from"styled-components";import t from"../../theme.js";import s from"../Icons/CheckIcon.js";const l=e=>({active:{background:t.colors.primary.main,color:t.colors.text.light,border:`1px solid ${t.colors.primary.main}`},completed:{background:t.colors.success.main,color:t.colors.text.light,border:`1px solid ${t.colors.success.main}`},disabled:{background:e,color:t.colors.primary.main,border:`1px solid ${t.colors.primary.main}`}}),a=i.div`
|
|
2
|
-
box-sizing: content-box;
|
|
3
|
-
width: 40px;
|
|
4
|
-
height: 40px;
|
|
5
|
-
border-radius: 50%;
|
|
6
|
-
position: relative;
|
|
7
|
-
display: flex;
|
|
8
|
-
align-items: center;
|
|
9
|
-
justify-content: center;
|
|
10
|
-
border: ${({state:e,backgroundColor:o})=>l(o)[e].border};
|
|
11
|
-
justify-content: center;
|
|
12
|
-
background-color: ${({state:e,backgroundColor:o})=>l(o)[e].background};
|
|
13
|
-
color: ${({state:e,backgroundColor:o})=>l(o)[e].color};
|
|
14
|
-
&:after {
|
|
15
|
-
content: '';
|
|
16
|
-
width: 42px;
|
|
17
|
-
height: 42px;
|
|
18
|
-
border-radius: 50%;
|
|
19
|
-
top: -11px;
|
|
20
|
-
left: -11px;
|
|
21
|
-
position: absolute;
|
|
22
|
-
z-index: 2;
|
|
23
|
-
border: ${({backgroundColor:e})=>`10px solid ${e}`};
|
|
24
|
-
}
|
|
25
|
-
`,d=i.div`
|
|
26
|
-
display: flex;
|
|
27
|
-
font-size: 1.25rem;
|
|
28
|
-
line-height: 1;
|
|
29
|
-
font-family: ${({theme:e})=>e.typography.fontAlternativeFamily};
|
|
30
|
-
font-weight: ${({theme:e})=>e.typography.fontAlternativeBoldWeight};
|
|
31
|
-
width: 100%;
|
|
32
|
-
height: 100%;
|
|
33
|
-
align-items: center;
|
|
34
|
-
justify-content: center;
|
|
35
|
-
`,m=i.div`
|
|
36
|
-
width: 14px;
|
|
37
|
-
height: 14px;
|
|
38
|
-
display: flex;
|
|
39
|
-
& svg {
|
|
40
|
-
fill: ${({theme:e})=>e.colors.text.light};
|
|
41
|
-
width: 100%;
|
|
42
|
-
}
|
|
43
|
-
`,p=({state:e,step:o,backgroundColor:c=t.colors.background.light,...n})=>r.createElement("div",null,r.createElement(a,{className:e,state:e,...n,backgroundColor:c},r.createElement(d,{as:"div"},e==="completed"?r.createElement(m,null,r.createElement(s,{className:""})):r.createElement("span",{className:"step-content-text"},o))));export{p as default};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import m,{cloneElement as i}from"react";import d from"styled-components";import h from"../../theme.js";const u=d.div`
|
|
2
|
-
min-height: 4rem;
|
|
3
|
-
padding: 10px 0;
|
|
4
|
-
display: ${({orientation:e})=>e==="horizontal"?"flex":"block"};
|
|
5
|
-
justify-content: space-between;
|
|
6
|
-
background-color: ${({backgroundColor:e})=>e};
|
|
7
|
-
`,y=(e,r)=>i(e,r),f=({children:e,activeStep:r=0,orientation:n="horizontal",backgroundColor:l=h.colors.background.light,...c})=>{const p=(Array.isArray(e)?e:[e]).map((o,t)=>{var s;const a={active:t===r,step:t+1,completed:t<r,disabled:t>r,children:(s=o==null?void 0:o.props)==null?void 0:s.children,orientation:n,backgroundColor:l};return y(o,a)});return m.createElement(u,{...c,orientation:n,backgroundColor:l},p)};export{f as InlineStepper};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { Orientation } from '.';
|
|
3
|
-
export interface StepProps {
|
|
4
|
-
backgroundColor?: string;
|
|
5
|
-
step?: number;
|
|
6
|
-
active?: boolean;
|
|
7
|
-
completed?: boolean;
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
children?: ReactNode;
|
|
10
|
-
orientation?: Orientation;
|
|
11
|
-
}
|
|
12
|
-
declare type State = 'active' | 'completed' | 'disabled';
|
|
13
|
-
interface States {
|
|
14
|
-
active?: boolean;
|
|
15
|
-
disabled?: boolean;
|
|
16
|
-
completed?: boolean;
|
|
17
|
-
}
|
|
18
|
-
export declare const getStepState: ({ active, disabled }: States) => State;
|
|
19
|
-
declare const Step: ({ step, active, completed, disabled, orientation, children, backgroundColor, ...props }: StepProps) => JSX.Element;
|
|
20
|
-
export default Step;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
declare type State = 'active' | 'completed' | 'disabled';
|
|
2
|
-
interface Props {
|
|
3
|
-
state: State;
|
|
4
|
-
step: number;
|
|
5
|
-
backgroundColor?: string;
|
|
6
|
-
}
|
|
7
|
-
declare const StepCircle: ({ state, step, backgroundColor, ...props }: Props) => JSX.Element;
|
|
8
|
-
export default StepCircle;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
import { StepProps } from './Step';
|
|
3
|
-
export declare type Orientation = 'horizontal' | 'vertical';
|
|
4
|
-
export interface InlineStepperProps {
|
|
5
|
-
activeStep: number;
|
|
6
|
-
children: ReactElement<StepProps>[] | ReactElement<StepProps>;
|
|
7
|
-
orientation?: Orientation;
|
|
8
|
-
backgroundColor?: string;
|
|
9
|
-
}
|
|
10
|
-
export declare const InlineStepper: ({ children, activeStep, orientation, backgroundColor, ...props }: InlineStepperProps) => JSX.Element;
|