@popsure/dirty-swan 0.34.0 → 0.35.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/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +129 -106
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/lib/components/chip/index.d.ts +2 -1
- package/dist/cjs/lib/components/informationBox/index.d.ts +12 -0
- package/dist/cjs/lib/components/informationBox/index.stories.d.ts +35 -0
- package/dist/cjs/lib/components/informationBox/index.test.d.ts +1 -0
- package/dist/cjs/lib/components/link/index.d.ts +2 -0
- package/dist/cjs/lib/components/link/index.stories.d.ts +26 -0
- package/dist/cjs/lib/index.d.ts +3 -1
- package/dist/esm/components/autocompleteAddress/index.test.js +1 -1
- package/dist/esm/components/chip/index.js +2 -2
- package/dist/esm/components/chip/index.js.map +1 -1
- package/dist/esm/components/comparisonTable/components/TableButton/index.test.js +2 -2
- package/dist/esm/components/comparisonTable/components/TableRowHeader/index.test.js +2 -2
- package/dist/esm/components/dateSelector/index.test.js +1 -1
- package/dist/esm/components/informationBox/index.js +19 -0
- package/dist/esm/components/informationBox/index.js.map +1 -0
- package/dist/esm/components/informationBox/index.stories.js +42 -0
- package/dist/esm/components/informationBox/index.stories.js.map +1 -0
- package/dist/esm/components/informationBox/index.test.js +49 -0
- package/dist/esm/components/informationBox/index.test.js.map +1 -0
- package/dist/esm/components/input/autoSuggestMultiSelect/index.js +13 -9
- package/dist/esm/components/input/autoSuggestMultiSelect/index.js.map +1 -1
- package/dist/esm/components/input/checkbox/index.test.js +1 -1
- package/dist/esm/components/input/currency/index.test.js +1 -1
- package/dist/esm/components/link/index.js +11 -0
- package/dist/esm/components/link/index.js.map +1 -0
- package/dist/esm/components/link/index.stories.js +33 -0
- package/dist/esm/components/link/index.stories.js.map +1 -0
- package/dist/esm/components/multiDropzone/index.test.js +2 -2
- package/dist/esm/components/segmentedControl/index.test.js +1 -1
- package/dist/esm/{customRender-4157fcff.js → customRender-20b5f7ec.js} +3 -3
- package/dist/esm/{customRender-4157fcff.js.map → customRender-20b5f7ec.js.map} +1 -1
- package/dist/esm/{extend-expect-46bdce4a.js → extend-expect-25e5049d.js} +2 -2
- package/dist/esm/{extend-expect-46bdce4a.js.map → extend-expect-25e5049d.js.map} +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/components/chip/index.d.ts +2 -1
- package/dist/esm/lib/components/informationBox/index.d.ts +12 -0
- package/dist/esm/lib/components/informationBox/index.stories.d.ts +35 -0
- package/dist/esm/lib/components/informationBox/index.test.d.ts +1 -0
- package/dist/esm/lib/components/link/index.d.ts +2 -0
- package/dist/esm/lib/components/link/index.stories.d.ts +26 -0
- package/dist/esm/lib/index.d.ts +3 -1
- package/dist/esm/util/testUtils/customRender.js +1 -1
- package/package.json +1 -1
- package/src/index.tsx +2 -0
- package/src/lib/components/chip/index.tsx +3 -1
- package/src/lib/components/informationBox/index.stories.tsx +51 -0
- package/src/lib/components/informationBox/index.test.tsx +55 -0
- package/src/lib/components/informationBox/index.tsx +65 -0
- package/src/lib/components/informationBox/info.svg +11 -0
- package/src/lib/components/informationBox/style.module.scss +62 -0
- package/src/lib/components/input/autoSuggestMultiSelect/index.tsx +29 -18
- package/src/lib/components/input/autoSuggestMultiSelect/style.module.scss +6 -0
- package/src/lib/components/link/index.stories.tsx +29 -0
- package/src/lib/components/link/index.tsx +9 -0
- package/src/lib/index.tsx +4 -0
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { DateSelector, SignaturePad, AutocompleteAddress, Input, MultiDropzone, IbanInput, CurrencyInput, BottomModal, RegularModal, BottomOrRegularModal, CardWithTopLeftIcon, CardWithLeftIcon, CardWithTopIcon, InfoCard, CardButton, Button, AutoSuggestMultiSelect, Chip, AutoSuggestInput, ComparisonTable, TableRating, TableTrueFalse, TableRowHeader, TableButton, TableInfoButton, SegmentedControl, DownloadButton, Markdown, Checkbox, images } from './lib';
|
|
1
|
+
export { DateSelector, SignaturePad, AutocompleteAddress, Input, MultiDropzone, IbanInput, CurrencyInput, BottomModal, RegularModal, BottomOrRegularModal, CardWithTopLeftIcon, CardWithLeftIcon, CardWithTopIcon, InfoCard, CardButton, Button, AutoSuggestMultiSelect, Chip, AutoSuggestInput, ComparisonTable, TableRating, TableTrueFalse, TableRowHeader, TableButton, TableInfoButton, SegmentedControl, DownloadButton, Markdown, Checkbox, Link, InformationBox, images } from './lib';
|
|
2
2
|
export type { DownloadStatus, FileType, MultiDropzoneProps, TableHeader, UploadedFile, UploadStatus, } from './lib';
|
package/dist/esm/index.js
CHANGED
|
@@ -4,6 +4,7 @@ export { AutocompleteAddress } from './components/autocompleteAddress/index.js';
|
|
|
4
4
|
export { Input } from './components/input/index.js';
|
|
5
5
|
export { MultiDropzone } from './components/multiDropzone/index.js';
|
|
6
6
|
export { DownloadButton } from './components/downloadButton/index.js';
|
|
7
|
+
export { InformationBox } from './components/informationBox/index.js';
|
|
7
8
|
export { default as IbanInput } from './components/input/iban/index.js';
|
|
8
9
|
export { default as CurrencyInput } from './components/input/currency/index.js';
|
|
9
10
|
export { Checkbox } from './components/input/checkbox/index.js';
|
|
@@ -19,6 +20,7 @@ export { default as AutoSuggestInput } from './components/input/autoSuggestInput
|
|
|
19
20
|
export { ComparisonTable } from './components/comparisonTable/index.js';
|
|
20
21
|
export { SegmentedControl } from './components/segmentedControl/index.js';
|
|
21
22
|
export { Markdown } from './components/markdown/index.js';
|
|
23
|
+
export { Link } from './components/link/index.js';
|
|
22
24
|
export { i as images } from './index-31224f74.js';
|
|
23
25
|
export { default as TableRating } from './components/comparisonTable/components/TableRating/index.js';
|
|
24
26
|
export { default as TableTrueFalse } from './components/comparisonTable/components/TableTrueFalse.js';
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Option } from '../../models/autoSuggestInput';
|
|
2
|
-
declare const _default: ({ value, onRemove, }: {
|
|
2
|
+
declare const _default: ({ className, value, onRemove, }: {
|
|
3
3
|
value: Option;
|
|
4
4
|
onRemove: (value: Option) => void;
|
|
5
|
+
className?: string | undefined;
|
|
5
6
|
}) => JSX.Element;
|
|
6
7
|
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
declare type Variant = 'warning' | 'error' | 'success' | 'information' | 'neutral';
|
|
3
|
+
export interface InformationBoxProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
variant?: Variant;
|
|
6
|
+
title?: string;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
showIcon?: boolean;
|
|
9
|
+
size?: 'default' | 'small';
|
|
10
|
+
}
|
|
11
|
+
declare const InformationBox: ({ className, variant, title, children, showIcon, size }: InformationBoxProps) => JSX.Element;
|
|
12
|
+
export { InformationBox };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { InformationBoxProps } from '.';
|
|
2
|
+
declare const story: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: ({ className, variant, title, children, showIcon, size }: InformationBoxProps) => JSX.Element;
|
|
5
|
+
argTypes: {
|
|
6
|
+
children: {
|
|
7
|
+
control: {
|
|
8
|
+
type: string;
|
|
9
|
+
};
|
|
10
|
+
defaultValue: string;
|
|
11
|
+
description: string;
|
|
12
|
+
};
|
|
13
|
+
title: {
|
|
14
|
+
defaultValue: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
showIcon: {
|
|
18
|
+
defaultValue: boolean;
|
|
19
|
+
description: string;
|
|
20
|
+
};
|
|
21
|
+
size: {
|
|
22
|
+
defaultValue: string;
|
|
23
|
+
description: string;
|
|
24
|
+
};
|
|
25
|
+
variant: {
|
|
26
|
+
defaultValue: string;
|
|
27
|
+
description: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export declare const InformationBoxStory: {
|
|
32
|
+
({ children, showIcon, title, size, variant, }: InformationBoxProps): JSX.Element;
|
|
33
|
+
storyName: string;
|
|
34
|
+
};
|
|
35
|
+
export default story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { LinkProps } from '.';
|
|
3
|
+
declare const story: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: ({ children, className, ...rest }: import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>) => JSX.Element;
|
|
6
|
+
argTypes: {
|
|
7
|
+
children: {
|
|
8
|
+
control: string;
|
|
9
|
+
defaultValue: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
href: {
|
|
13
|
+
control: string;
|
|
14
|
+
defaultValue: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
parameters: {
|
|
19
|
+
componentSubtitle: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export declare const LinkStory: {
|
|
23
|
+
({ children, href, ...rest }: LinkProps): JSX.Element;
|
|
24
|
+
storyName: string;
|
|
25
|
+
};
|
|
26
|
+
export default story;
|
package/dist/esm/lib/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { AutocompleteAddress } from './components/autocompleteAddress';
|
|
|
4
4
|
import { Input } from './components/input';
|
|
5
5
|
import { MultiDropzone, FileType, MultiDropzoneProps, UploadedFile, UploadStatus } from './components/multiDropzone';
|
|
6
6
|
import { DownloadButton } from './components/downloadButton';
|
|
7
|
+
import { InformationBox } from './components/informationBox';
|
|
7
8
|
import IbanInput from './components/input/iban';
|
|
8
9
|
import CurrencyInput from './components/input/currency';
|
|
9
10
|
import { Checkbox } from './components/input/checkbox';
|
|
@@ -16,7 +17,8 @@ import AutoSuggestInput from './components/input/autoSuggestInput';
|
|
|
16
17
|
import { ComparisonTable, TableRating, TableTrueFalse, TableRowHeader, TableButton, TableInfoButton, TableHeader } from './components/comparisonTable';
|
|
17
18
|
import { SegmentedControl } from './components/segmentedControl';
|
|
18
19
|
import { Markdown } from './components/markdown';
|
|
20
|
+
import { Link } from './components/link';
|
|
19
21
|
import { images } from './util/images';
|
|
20
|
-
export { DateSelector, SignaturePad, AutocompleteAddress, Input, MultiDropzone, DownloadButton, IbanInput, BottomModal, RegularModal, BottomOrRegularModal, CardWithTopLeftIcon, CardWithLeftIcon, CardWithTopIcon, InfoCard, CardButton, Button, CurrencyInput, AutoSuggestMultiSelect, Chip, AutoSuggestInput, ComparisonTable, TableRating, TableTrueFalse, TableRowHeader, TableButton, TableInfoButton, SegmentedControl, Markdown, Checkbox, images, };
|
|
22
|
+
export { DateSelector, SignaturePad, AutocompleteAddress, Input, MultiDropzone, DownloadButton, IbanInput, BottomModal, RegularModal, BottomOrRegularModal, CardWithTopLeftIcon, CardWithLeftIcon, CardWithTopIcon, InfoCard, CardButton, Button, CurrencyInput, AutoSuggestMultiSelect, Chip, AutoSuggestInput, ComparisonTable, TableRating, TableTrueFalse, TableRowHeader, TableButton, TableInfoButton, SegmentedControl, Markdown, Checkbox, Link, InformationBox, images, };
|
|
21
23
|
export type { FileType, MultiDropzoneProps, TableHeader, UploadedFile, UploadStatus };
|
|
22
24
|
export type { DownloadStatus } from './models/download';
|
package/package.json
CHANGED
package/src/index.tsx
CHANGED
|
@@ -4,13 +4,15 @@ import removeButtonHighlightedIcon from './icons/remove-button-highlighted.svg';
|
|
|
4
4
|
import { Option } from '../../models/autoSuggestInput';
|
|
5
5
|
|
|
6
6
|
export default ({
|
|
7
|
+
className,
|
|
7
8
|
value,
|
|
8
9
|
onRemove,
|
|
9
10
|
}: {
|
|
10
11
|
value: Option;
|
|
11
12
|
onRemove: (value: Option) => void;
|
|
13
|
+
className?: string;
|
|
12
14
|
}) => (
|
|
13
|
-
<div className={`p-p mr8 mb8 d-flex ${styles['chip']}`}>
|
|
15
|
+
<div className={`p-p mr8 mb8 d-flex ${className} ${styles['chip']}`}>
|
|
14
16
|
{value.leftIcon && (
|
|
15
17
|
<img
|
|
16
18
|
className={`mr8 ${styles['chip-image']}`}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { InformationBox, InformationBoxProps } from '.';
|
|
2
|
+
|
|
3
|
+
const story = {
|
|
4
|
+
title: 'JSX/InformationBox',
|
|
5
|
+
component: InformationBox,
|
|
6
|
+
argTypes: {
|
|
7
|
+
children: {
|
|
8
|
+
control: { type: 'text' },
|
|
9
|
+
defaultValue: 'It seems that you already have an account with us! Sign in now',
|
|
10
|
+
description: 'Content that is displayed inside the information box',
|
|
11
|
+
},
|
|
12
|
+
title: {
|
|
13
|
+
defaultValue: 'Log in to your account',
|
|
14
|
+
description: 'Title of the information box',
|
|
15
|
+
},
|
|
16
|
+
showIcon: {
|
|
17
|
+
defaultValue: false,
|
|
18
|
+
description: 'Whether or not to show the info icon',
|
|
19
|
+
},
|
|
20
|
+
size: {
|
|
21
|
+
defaultValue: 'default',
|
|
22
|
+
description: 'Size to display the component',
|
|
23
|
+
},
|
|
24
|
+
variant: {
|
|
25
|
+
defaultValue: 'information',
|
|
26
|
+
description: 'Variant that defines the style of the InformationBox',
|
|
27
|
+
},
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const InformationBoxStory = ({
|
|
32
|
+
children,
|
|
33
|
+
showIcon,
|
|
34
|
+
title,
|
|
35
|
+
size,
|
|
36
|
+
variant,
|
|
37
|
+
}: InformationBoxProps) => (
|
|
38
|
+
<div className='wmx6'>
|
|
39
|
+
<InformationBox
|
|
40
|
+
children={children}
|
|
41
|
+
showIcon={showIcon}
|
|
42
|
+
title={title}
|
|
43
|
+
size={size}
|
|
44
|
+
variant={variant}
|
|
45
|
+
/>
|
|
46
|
+
</div>
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
InformationBoxStory.storyName = "InformationBox";
|
|
50
|
+
|
|
51
|
+
export default story;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { render, screen } from '../../util/testUtils';
|
|
2
|
+
|
|
3
|
+
import { InformationBox } from '.';
|
|
4
|
+
|
|
5
|
+
describe('InformationBox component', () => {
|
|
6
|
+
it('Should render title', async () => {
|
|
7
|
+
render(
|
|
8
|
+
<InformationBox title={'Title'}>
|
|
9
|
+
Content
|
|
10
|
+
</InformationBox>
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
expect(screen.getByText('Title')).toBeInTheDocument();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it('Should not render title when title prop is not passed', async () => {
|
|
17
|
+
render(
|
|
18
|
+
<InformationBox>
|
|
19
|
+
Content
|
|
20
|
+
</InformationBox>
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
expect(screen.queryByTestId('information-box-title')).not.toBeInTheDocument();
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('Should render content', async () => {
|
|
27
|
+
render(
|
|
28
|
+
<InformationBox>
|
|
29
|
+
Content
|
|
30
|
+
</InformationBox>
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
expect(screen.getByText('Content')).toBeInTheDocument();
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('Should show icon when showIcon is true', async () => {
|
|
37
|
+
render(
|
|
38
|
+
<InformationBox showIcon>
|
|
39
|
+
Content
|
|
40
|
+
</InformationBox>
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
expect(screen.getByTestId('information-box-icon')).toBeInTheDocument();
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('Should not show icon when showIcon is false', async () => {
|
|
47
|
+
render(
|
|
48
|
+
<InformationBox showIcon={false}>
|
|
49
|
+
Content
|
|
50
|
+
</InformationBox>
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
expect(screen.queryByTestId('information-box-icon')).not.toBeInTheDocument();
|
|
54
|
+
});
|
|
55
|
+
});
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import styles from './style.module.scss';
|
|
4
|
+
|
|
5
|
+
type Variant = 'warning' | 'error' | 'success' | 'information' | 'neutral';
|
|
6
|
+
|
|
7
|
+
export interface InformationBoxProps {
|
|
8
|
+
className?: string;
|
|
9
|
+
variant?: Variant;
|
|
10
|
+
title?: string;
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
showIcon?: boolean;
|
|
13
|
+
size?: 'default' | 'small';
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const InformationBox = ({
|
|
17
|
+
className = '',
|
|
18
|
+
variant = 'information',
|
|
19
|
+
title,
|
|
20
|
+
children,
|
|
21
|
+
showIcon,
|
|
22
|
+
size = 'default'
|
|
23
|
+
}: InformationBoxProps) => (
|
|
24
|
+
<div
|
|
25
|
+
className={classNames(
|
|
26
|
+
className,
|
|
27
|
+
'p16 br8 color-black',
|
|
28
|
+
styles.informationBox,
|
|
29
|
+
styles[`informationBox--${variant}`]
|
|
30
|
+
)}
|
|
31
|
+
role="alert"
|
|
32
|
+
>
|
|
33
|
+
<div className='d-flex'>
|
|
34
|
+
{showIcon &&
|
|
35
|
+
<span
|
|
36
|
+
data-testid="information-box-icon"
|
|
37
|
+
className={classNames(
|
|
38
|
+
styles.icon,
|
|
39
|
+
styles[`icon--${variant}`],
|
|
40
|
+
'mr8'
|
|
41
|
+
)}
|
|
42
|
+
/>
|
|
43
|
+
}
|
|
44
|
+
<div>
|
|
45
|
+
{title && (
|
|
46
|
+
<h4
|
|
47
|
+
data-testid="information-box-title"
|
|
48
|
+
className={classNames(
|
|
49
|
+
size === 'default'? 'p-h4' : 'p-h5',
|
|
50
|
+
'mb8'
|
|
51
|
+
)}
|
|
52
|
+
>
|
|
53
|
+
{title}
|
|
54
|
+
</h4>
|
|
55
|
+
)}
|
|
56
|
+
|
|
57
|
+
<p className={size === 'default' ? 'p-p' : 'p-p--small'}>
|
|
58
|
+
{children}
|
|
59
|
+
</p>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
export { InformationBox };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none">
|
|
2
|
+
<g clip-path="url(#a)">
|
|
3
|
+
<path stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10ZM12 16v-4"/>
|
|
4
|
+
<circle cx="12" cy="8" r="1" fill="#000"/>
|
|
5
|
+
</g>
|
|
6
|
+
<defs>
|
|
7
|
+
<clipPath id="a">
|
|
8
|
+
<path fill="#fff" d="M0 0h24v24H0z"/>
|
|
9
|
+
</clipPath>
|
|
10
|
+
</defs>
|
|
11
|
+
</svg>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
|
|
2
|
+
@use "../../scss/public/colors" as *;
|
|
3
|
+
|
|
4
|
+
.informationBox {
|
|
5
|
+
border: 1px solid;
|
|
6
|
+
|
|
7
|
+
&--information {
|
|
8
|
+
background-color: $ds-blue-100;
|
|
9
|
+
border-color: $ds-blue-500;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&--error {
|
|
13
|
+
background-color: $ds-red-100;
|
|
14
|
+
border-color: $ds-red-500;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&--warning {
|
|
18
|
+
background-color: $ds-yellow-100;
|
|
19
|
+
border-color: $ds-yellow-500;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&--success {
|
|
23
|
+
background-color: $ds-green-100;
|
|
24
|
+
border-color: $ds-green-500;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&--neutral {
|
|
28
|
+
background-color: $ds-white;
|
|
29
|
+
border-color: $ds-white;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.icon {
|
|
34
|
+
display: inline-block;
|
|
35
|
+
width: 24px;
|
|
36
|
+
height: 24px;
|
|
37
|
+
|
|
38
|
+
mask-image: url('./info.svg');
|
|
39
|
+
mask-size: contain;
|
|
40
|
+
mask-repeat: no-repeat;
|
|
41
|
+
mask-position: center;
|
|
42
|
+
|
|
43
|
+
&--information {
|
|
44
|
+
background-color: $ds-blue-500;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&--error {
|
|
48
|
+
background-color: $ds-red-500;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&--warning {
|
|
52
|
+
background-color: $ds-yellow-500;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&--success {
|
|
56
|
+
background-color: $ds-green-500;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&--neutral {
|
|
60
|
+
background-color: $ds-primary-500;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -4,6 +4,7 @@ import { Option } from '../../../models/autoSuggestInput';
|
|
|
4
4
|
import Chip from '../../chip';
|
|
5
5
|
import AutoSuggestInput from '../autoSuggestInput';
|
|
6
6
|
import styles from './style.module.scss';
|
|
7
|
+
import classNames from 'classnames';
|
|
7
8
|
|
|
8
9
|
export default ({
|
|
9
10
|
options,
|
|
@@ -24,27 +25,37 @@ export default ({
|
|
|
24
25
|
}) => {
|
|
25
26
|
const [suggestions, setSuggestions] = useState<Option[]>([]);
|
|
26
27
|
const [currentOption, setCurrentOption] = useState('');
|
|
28
|
+
const hasChips = Boolean(selectedValues && selectedValues.length > 0);
|
|
27
29
|
|
|
28
30
|
return (
|
|
29
31
|
<>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
{
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
32
|
+
<div
|
|
33
|
+
className={classNames(
|
|
34
|
+
styles['chip-container'],
|
|
35
|
+
chipsListClassName,
|
|
36
|
+
{
|
|
37
|
+
[styles.appearIn]: hasChips
|
|
38
|
+
},
|
|
39
|
+
)}
|
|
40
|
+
>
|
|
41
|
+
{selectedValues && hasChips && (
|
|
42
|
+
<>
|
|
43
|
+
{selectedValues.map((value, index) => (
|
|
44
|
+
<Chip
|
|
45
|
+
key={`${value.value}-${index}`}
|
|
46
|
+
className="mb16"
|
|
47
|
+
value={value}
|
|
48
|
+
onRemove={(value: Option) => {
|
|
49
|
+
const newValues = [...selectedValues].filter(
|
|
50
|
+
(selectedValue) => selectedValue.value !== value.value
|
|
51
|
+
);
|
|
52
|
+
setValues(newValues);
|
|
53
|
+
}}
|
|
54
|
+
/>
|
|
55
|
+
))}
|
|
56
|
+
</>
|
|
57
|
+
)}
|
|
58
|
+
</div>
|
|
48
59
|
<AutoSuggestInput
|
|
49
60
|
className={multiSelectClassName}
|
|
50
61
|
placeholder={placeholder}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Link, LinkProps } from '.';
|
|
2
|
+
|
|
3
|
+
const story = {
|
|
4
|
+
title: 'JSX/Link',
|
|
5
|
+
component: Link,
|
|
6
|
+
argTypes: {
|
|
7
|
+
children: {
|
|
8
|
+
control: 'text',
|
|
9
|
+
defaultValue: 'Click here to go to Feather Insurance',
|
|
10
|
+
description: 'Content that is displayed as clickable inside the link',
|
|
11
|
+
},
|
|
12
|
+
href: {
|
|
13
|
+
control: 'text',
|
|
14
|
+
defaultValue: 'https://feather-insurance.com',
|
|
15
|
+
description: 'Specifies the URL of the page the link goes to',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
parameters: {
|
|
19
|
+
componentSubtitle: 'Links are a styled helper component for anchor (<a />) tags.',
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const LinkStory = ({ children, href, ...rest }: LinkProps) => (
|
|
24
|
+
<Link href={href} {...rest}>{children}</Link>
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
LinkStory.storyName = "Link";
|
|
28
|
+
|
|
29
|
+
export default story;
|
package/src/lib/index.tsx
CHANGED
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
UploadStatus
|
|
11
11
|
} from './components/multiDropzone';
|
|
12
12
|
import { DownloadButton } from './components/downloadButton';
|
|
13
|
+
import { InformationBox } from './components/informationBox';
|
|
13
14
|
import IbanInput from './components/input/iban';
|
|
14
15
|
import CurrencyInput from './components/input/currency';
|
|
15
16
|
import { Checkbox } from './components/input/checkbox';
|
|
@@ -40,6 +41,7 @@ import {
|
|
|
40
41
|
} from './components/comparisonTable';
|
|
41
42
|
import { SegmentedControl } from './components/segmentedControl';
|
|
42
43
|
import { Markdown } from './components/markdown';
|
|
44
|
+
import { Link } from './components/link';
|
|
43
45
|
import { images } from './util/images';
|
|
44
46
|
|
|
45
47
|
export {
|
|
@@ -72,6 +74,8 @@ export {
|
|
|
72
74
|
SegmentedControl,
|
|
73
75
|
Markdown,
|
|
74
76
|
Checkbox,
|
|
77
|
+
Link,
|
|
78
|
+
InformationBox,
|
|
75
79
|
images,
|
|
76
80
|
};
|
|
77
81
|
|