@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
|
@@ -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/cjs/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';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { b as __awaiter, c as __generator } from '../../tslib.es6-5bc94358.js';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { c as customRender, f as fireEvent } from '../../customRender-
|
|
3
|
+
import { c as customRender, f as fireEvent } from '../../customRender-20b5f7ec.js';
|
|
4
4
|
import { AutocompleteAddress } from './index.js';
|
|
5
5
|
import 'react';
|
|
6
6
|
import 'react-dom';
|
|
@@ -11,8 +11,8 @@ var removeButtonIcon = "data:image/svg+xml,%3Csvg%20width%3D%2217%22%20height%3D
|
|
|
11
11
|
var removeButtonHighlightedIcon = "data:image/svg+xml,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%204L4%2012%22%20stroke%3D%22%238E8CEE%22%20strokeWidth%3D%222%22%20strokeLinecap%3D%22round%22%20strokeLinejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M4%204L12%2012%22%20stroke%3D%22%238E8CEE%22%20strokeWidth%3D%222%22%20strokeLinecap%3D%22round%22%20strokeLinejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E";
|
|
12
12
|
|
|
13
13
|
var Chip = (function (_a) {
|
|
14
|
-
var value = _a.value, onRemove = _a.onRemove;
|
|
15
|
-
return (jsxs("div", __assign({ className: "p-p mr8 mb8 d-flex " + styles['chip'] }, { children: [value.leftIcon && (jsx("img", { className: "mr8 " + styles['chip-image'], src: value.leftIcon, alt: value.value }, void 0)),
|
|
14
|
+
var className = _a.className, value = _a.value, onRemove = _a.onRemove;
|
|
15
|
+
return (jsxs("div", __assign({ className: "p-p mr8 mb8 d-flex " + className + " " + styles['chip'] }, { children: [value.leftIcon && (jsx("img", { className: "mr8 " + styles['chip-image'], src: value.leftIcon, alt: value.value }, void 0)),
|
|
16
16
|
jsx("div", __assign({ className: "mr8" }, { children: value.value }), void 0),
|
|
17
17
|
jsxs("div", __assign({ className: "c-pointer " + styles['chip-button-container'], onClick: function () { return onRemove(value); } }, { children: [jsx("img", { className: styles['chip-remove-button-highlighted'], src: removeButtonHighlightedIcon, alt: "removal x button highlighted" }, void 0),
|
|
18
18
|
jsx("img", { className: styles['chip-remove-button'], src: removeButtonIcon, alt: "removal x button" }, void 0)] }), void 0)] }), void 0));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/lib/components/chip/icons/remove-button.svg","../../../../src/lib/components/chip/icons/remove-button-highlighted.svg","../../../../../src/lib/components/chip/index.tsx"],"sourcesContent":["export default \"data:image/svg+xml,%3Csvg%20width%3D%2217%22%20height%3D%2216%22%20viewBox%3D%220%200%2017%2016%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.4167%204L4.41666%2012%22%20stroke%3D%22%23B1B0F5%22%20strokeWidth%3D%222%22%20strokeLinecap%3D%22round%22%20strokeLinejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M4.41666%204L12.4167%2012%22%20stroke%3D%22%23B1B0F5%22%20strokeWidth%3D%222%22%20strokeLinecap%3D%22round%22%20strokeLinejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E\"","export default \"data:image/svg+xml,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%204L4%2012%22%20stroke%3D%22%238E8CEE%22%20strokeWidth%3D%222%22%20strokeLinecap%3D%22round%22%20strokeLinejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M4%204L12%2012%22%20stroke%3D%22%238E8CEE%22%20strokeWidth%3D%222%22%20strokeLinecap%3D%22round%22%20strokeLinejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E\"","import styles from './style.module.scss';\nimport removeButtonIcon from './icons/remove-button.svg';\nimport removeButtonHighlightedIcon from './icons/remove-button-highlighted.svg';\nimport { Option } from '../../models/autoSuggestInput';\n\nexport default ({\n value,\n onRemove,\n}: {\n value: Option;\n onRemove: (value: Option) => void;\n}) => (\n <div className={`p-p mr8 mb8 d-flex ${styles['chip']}`}>\n {value.leftIcon && (\n <img\n className={`mr8 ${styles['chip-image']}`}\n src={value.leftIcon}\n alt={value.value}\n />\n )}\n <div className=\"mr8\">{value.value}</div>\n <div\n className={`c-pointer ${styles['chip-button-container']}`}\n onClick={() => onRemove(value)}\n >\n <img\n className={styles['chip-remove-button-highlighted']}\n src={removeButtonHighlightedIcon}\n alt=\"removal x button highlighted\"\n />\n <img\n className={styles['chip-remove-button']}\n src={removeButtonIcon}\n alt=\"removal x button\"\n />\n </div>\n </div>\n);\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;AAAA,uBAAe;;ACAf,kCAAe;;ACKf,YAAe,UAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/lib/components/chip/icons/remove-button.svg","../../../../src/lib/components/chip/icons/remove-button-highlighted.svg","../../../../../src/lib/components/chip/index.tsx"],"sourcesContent":["export default \"data:image/svg+xml,%3Csvg%20width%3D%2217%22%20height%3D%2216%22%20viewBox%3D%220%200%2017%2016%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.4167%204L4.41666%2012%22%20stroke%3D%22%23B1B0F5%22%20strokeWidth%3D%222%22%20strokeLinecap%3D%22round%22%20strokeLinejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M4.41666%204L12.4167%2012%22%20stroke%3D%22%23B1B0F5%22%20strokeWidth%3D%222%22%20strokeLinecap%3D%22round%22%20strokeLinejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E\"","export default \"data:image/svg+xml,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%204L4%2012%22%20stroke%3D%22%238E8CEE%22%20strokeWidth%3D%222%22%20strokeLinecap%3D%22round%22%20strokeLinejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M4%204L12%2012%22%20stroke%3D%22%238E8CEE%22%20strokeWidth%3D%222%22%20strokeLinecap%3D%22round%22%20strokeLinejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E\"","import styles from './style.module.scss';\nimport removeButtonIcon from './icons/remove-button.svg';\nimport removeButtonHighlightedIcon from './icons/remove-button-highlighted.svg';\nimport { Option } from '../../models/autoSuggestInput';\n\nexport default ({\n className,\n value,\n onRemove,\n}: {\n value: Option;\n onRemove: (value: Option) => void;\n className?: string;\n}) => (\n <div className={`p-p mr8 mb8 d-flex ${className} ${styles['chip']}`}>\n {value.leftIcon && (\n <img\n className={`mr8 ${styles['chip-image']}`}\n src={value.leftIcon}\n alt={value.value}\n />\n )}\n <div className=\"mr8\">{value.value}</div>\n <div\n className={`c-pointer ${styles['chip-button-container']}`}\n onClick={() => onRemove(value)}\n >\n <img\n className={styles['chip-remove-button-highlighted']}\n src={removeButtonHighlightedIcon}\n alt=\"removal x button highlighted\"\n />\n <img\n className={styles['chip-remove-button']}\n src={removeButtonIcon}\n alt=\"removal x button\"\n />\n </div>\n </div>\n);\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;AAAA,uBAAe;;ACAf,kCAAe;;ACKf,YAAe,UAAC,EAQf;QAPC,SAAS,eAAA,EACT,KAAK,WAAA,EACL,QAAQ,cAAA;IAKJ,QACJA,uBAAK,SAAS,EAAE,wBAAsB,SAAS,SAAI,MAAM,CAAC,MAAM,CAAG,iBAChE,KAAK,CAAC,QAAQ,KACbC,aACE,SAAS,EAAE,SAAO,MAAM,CAAC,YAAY,CAAG,EACxC,GAAG,EAAE,KAAK,CAAC,QAAQ,EACnB,GAAG,EAAE,KAAK,CAAC,KAAK,WAChB,CACH;YACDA,sBAAK,SAAS,EAAC,KAAK,gBAAE,KAAK,CAAC,KAAK,YAAO;YACxCD,uBACE,SAAS,EAAE,eAAa,MAAM,CAAC,uBAAuB,CAAG,EACzD,OAAO,EAAE,cAAM,OAAA,QAAQ,CAAC,KAAK,CAAC,GAAA,iBAE9BC,aACE,SAAS,EAAE,MAAM,CAAC,gCAAgC,CAAC,EACnD,GAAG,EAAE,2BAA2B,EAChC,GAAG,EAAC,8BAA8B,WAClC;oBACFA,aACE,SAAS,EAAE,MAAM,CAAC,oBAAoB,CAAC,EACvC,GAAG,EAAE,gBAAgB,EACrB,GAAG,EAAC,kBAAkB,WACtB,aACE,aACF;AAzBF,CA0BL;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _ as __assign, b as __awaiter, c as __generator } from '../../../../tslib.es6-5bc94358.js';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { c as customRender } from '../../../../customRender-
|
|
4
|
-
import '../../../../extend-expect-
|
|
3
|
+
import { c as customRender } from '../../../../customRender-20b5f7ec.js';
|
|
4
|
+
import '../../../../extend-expect-25e5049d.js';
|
|
5
5
|
import TableButton from './index.js';
|
|
6
6
|
import 'react';
|
|
7
7
|
import 'react-dom';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _ as __assign, b as __awaiter, c as __generator } from '../../../../tslib.es6-5bc94358.js';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { c as customRender } from '../../../../customRender-
|
|
4
|
-
import '../../../../extend-expect-
|
|
3
|
+
import { c as customRender } from '../../../../customRender-20b5f7ec.js';
|
|
4
|
+
import '../../../../extend-expect-25e5049d.js';
|
|
5
5
|
import TableRowHeader from './index.js';
|
|
6
6
|
import 'react';
|
|
7
7
|
import 'react-dom';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { b as __awaiter, c as __generator } from '../../tslib.es6-5bc94358.js';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { c as customRender } from '../../customRender-
|
|
3
|
+
import { c as customRender } from '../../customRender-20b5f7ec.js';
|
|
4
4
|
import { D as DateSelector } from '../../index-639cf8b3.js';
|
|
5
5
|
import 'react';
|
|
6
6
|
import 'react-dom';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { _ as __assign } from '../../tslib.es6-5bc94358.js';
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { c as classnames } from '../../index-e9e37a34.js';
|
|
4
|
+
import { s as styleInject } from '../../style-inject.es-1f59c1d0.js';
|
|
5
|
+
|
|
6
|
+
var css_248z = ".style-module_informationBox__1dzYO {\n border: 1px solid;\n}\n.style-module_informationBox--information__rsyoM {\n background-color: #e5f0ff;\n border-color: #8bb4ea;\n}\n.style-module_informationBox--error__3BqOR {\n background-color: #fedede;\n border-color: #e55454;\n}\n.style-module_informationBox--warning__10V-E {\n background-color: #fff8e3;\n border-color: #f7ce5c;\n}\n.style-module_informationBox--success__d3gTw {\n background-color: #e4ffe6;\n border-color: #84de8a;\n}\n.style-module_informationBox--neutral__1XsMl {\n background-color: #fff;\n border-color: #fff;\n}\n\n.style-module_icon__3ZdHj {\n display: inline-block;\n width: 24px;\n height: 24px;\n mask-image: url(\"./info.svg\");\n mask-size: contain;\n mask-repeat: no-repeat;\n mask-position: center;\n}\n.style-module_icon--information__3Lmkk {\n background-color: #8bb4ea;\n}\n.style-module_icon--error__1bgLF {\n background-color: #e55454;\n}\n.style-module_icon--warning__3o6cZ {\n background-color: #f7ce5c;\n}\n.style-module_icon--success__ANiiU {\n background-color: #84de8a;\n}\n.style-module_icon--neutral__3KLc5 {\n background-color: #8e8cee;\n}";
|
|
7
|
+
var styles = {"informationBox":"style-module_informationBox__1dzYO","informationBox--information":"style-module_informationBox--information__rsyoM","informationBox--error":"style-module_informationBox--error__3BqOR","informationBox--warning":"style-module_informationBox--warning__10V-E","informationBox--success":"style-module_informationBox--success__d3gTw","informationBox--neutral":"style-module_informationBox--neutral__1XsMl","icon":"style-module_icon__3ZdHj","icon--information":"style-module_icon--information__3Lmkk","icon--error":"style-module_icon--error__1bgLF","icon--warning":"style-module_icon--warning__3o6cZ","icon--success":"style-module_icon--success__ANiiU","icon--neutral":"style-module_icon--neutral__3KLc5"};
|
|
8
|
+
styleInject(css_248z);
|
|
9
|
+
|
|
10
|
+
var InformationBox = function (_a) {
|
|
11
|
+
var _b = _a.className, className = _b === void 0 ? '' : _b, _c = _a.variant, variant = _c === void 0 ? 'information' : _c, title = _a.title, children = _a.children, showIcon = _a.showIcon, _d = _a.size, size = _d === void 0 ? 'default' : _d;
|
|
12
|
+
return (jsx("div", __assign({ className: classnames(className, 'p16 br8 color-black', styles.informationBox, styles["informationBox--" + variant]), role: "alert" }, { children: jsxs("div", __assign({ className: 'd-flex' }, { children: [showIcon &&
|
|
13
|
+
jsx("span", { "data-testid": "information-box-icon", className: classnames(styles.icon, styles["icon--" + variant], 'mr8') }, void 0),
|
|
14
|
+
jsxs("div", { children: [title && (jsx("h4", __assign({ "data-testid": "information-box-title", className: classnames(size === 'default' ? 'p-h4' : 'p-h5', 'mb8') }, { children: title }), void 0)),
|
|
15
|
+
jsx("p", __assign({ className: size === 'default' ? 'p-p' : 'p-p--small' }, { children: children }), void 0)] }, void 0)] }), void 0) }), void 0));
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export { InformationBox };
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/lib/components/informationBox/index.tsx"],"sourcesContent":["import { ReactNode } from 'react';\nimport classNames from 'classnames';\nimport styles from './style.module.scss';\n\ntype Variant = 'warning' | 'error' | 'success' | 'information' | 'neutral';\n\nexport interface InformationBoxProps {\n className?: string;\n variant?: Variant;\n title?: string;\n children: ReactNode;\n showIcon?: boolean;\n size?: 'default' | 'small';\n}\n\nconst InformationBox = ({\n className = '',\n variant = 'information',\n title,\n children,\n showIcon,\n size = 'default'\n}: InformationBoxProps) => (\n <div\n className={classNames(\n className, \n 'p16 br8 color-black', \n styles.informationBox,\n styles[`informationBox--${variant}`]\n )}\n role=\"alert\"\n >\n <div className='d-flex'>\n {showIcon && \n <span\n data-testid=\"information-box-icon\"\n className={classNames(\n styles.icon,\n styles[`icon--${variant}`],\n 'mr8'\n )}\n />\n }\n <div>\n {title && (\n <h4 \n data-testid=\"information-box-title\"\n className={classNames(\n size === 'default'? 'p-h4' : 'p-h5',\n 'mb8'\n )}\n >\n {title}\n </h4>\n )}\n\n <p className={size === 'default' ? 'p-p' : 'p-p--small'}>\n {children}\n </p>\n </div>\n </div>\n </div>\n);\n\nexport { InformationBox };\n"],"names":["_jsx","classNames","_jsxs"],"mappings":";;;;;;;;;IAeM,cAAc,GAAG,UAAC,EAOF;QANpB,iBAAc,EAAd,SAAS,mBAAG,EAAE,KAAA,EACd,eAAuB,EAAvB,OAAO,mBAAG,aAAa,KAAA,EACvB,KAAK,WAAA,EACL,QAAQ,cAAA,EACR,QAAQ,cAAA,EACR,YAAgB,EAAhB,IAAI,mBAAG,SAAS,KAAA;IACS,QACzBA,sBACE,SAAS,EAAEC,UAAU,CACnB,SAAS,EACT,qBAAqB,EACrB,MAAM,CAAC,cAAc,EACrB,MAAM,CAAC,qBAAmB,OAAS,CAAC,CACrC,EACD,IAAI,EAAC,OAAO,gBAEZC,uBAAK,SAAS,EAAC,QAAQ,iBACpB,QAAQ;oBACPF,6BACc,sBAAsB,EAClC,SAAS,EAAEC,UAAU,CACnB,MAAM,CAAC,IAAI,EACX,MAAM,CAAC,WAAS,OAAS,CAAC,EAC1B,KAAK,CACN,WACD;gBAEJC,yBACG,KAAK,KACJF,oCACc,uBAAuB,EACnC,SAAS,EAAEC,UAAU,CACnB,IAAI,KAAK,SAAS,GAAE,MAAM,GAAG,MAAM,EACnC,KAAK,CACN,gBAEA,KAAK,YACH,CACN;wBAEDD,oBAAG,SAAS,EAAE,IAAI,KAAK,SAAS,GAAG,KAAK,GAAG,YAAY,gBACpD,QAAQ,YACP,YACA,aACF,YACF;AAvCmB;;;;"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { _ as __assign } from '../../tslib.es6-5bc94358.js';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { InformationBox } from './index.js';
|
|
4
|
+
import '../../index-e9e37a34.js';
|
|
5
|
+
import '../../style-inject.es-1f59c1d0.js';
|
|
6
|
+
|
|
7
|
+
var story = {
|
|
8
|
+
title: 'JSX/InformationBox',
|
|
9
|
+
component: InformationBox,
|
|
10
|
+
argTypes: {
|
|
11
|
+
children: {
|
|
12
|
+
control: { type: 'text' },
|
|
13
|
+
defaultValue: 'It seems that you already have an account with us! Sign in now',
|
|
14
|
+
description: 'Content that is displayed inside the information box',
|
|
15
|
+
},
|
|
16
|
+
title: {
|
|
17
|
+
defaultValue: 'Log in to your account',
|
|
18
|
+
description: 'Title of the information box',
|
|
19
|
+
},
|
|
20
|
+
showIcon: {
|
|
21
|
+
defaultValue: false,
|
|
22
|
+
description: 'Whether or not to show the info icon',
|
|
23
|
+
},
|
|
24
|
+
size: {
|
|
25
|
+
defaultValue: 'default',
|
|
26
|
+
description: 'Size to display the component',
|
|
27
|
+
},
|
|
28
|
+
variant: {
|
|
29
|
+
defaultValue: 'information',
|
|
30
|
+
description: 'Variant that defines the style of the InformationBox',
|
|
31
|
+
},
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
var InformationBoxStory = function (_a) {
|
|
35
|
+
var children = _a.children, showIcon = _a.showIcon, title = _a.title, size = _a.size, variant = _a.variant;
|
|
36
|
+
return (jsx("div", __assign({ className: 'wmx6' }, { children: jsx(InformationBox, { children: children, showIcon: showIcon, title: title, size: size, variant: variant }, void 0) }), void 0));
|
|
37
|
+
};
|
|
38
|
+
InformationBoxStory.storyName = "InformationBox";
|
|
39
|
+
|
|
40
|
+
export default story;
|
|
41
|
+
export { InformationBoxStory };
|
|
42
|
+
//# sourceMappingURL=index.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.stories.js","sources":["../../../../../src/lib/components/informationBox/index.stories.tsx"],"sourcesContent":["import { InformationBox, InformationBoxProps } from '.';\n\nconst story = {\n title: 'JSX/InformationBox',\n component: InformationBox,\n argTypes: {\n children: {\n control: { type: 'text' },\n defaultValue: 'It seems that you already have an account with us! Sign in now',\n description: 'Content that is displayed inside the information box',\n },\n title: {\n defaultValue: 'Log in to your account',\n description: 'Title of the information box',\n },\n showIcon: {\n defaultValue: false,\n description: 'Whether or not to show the info icon',\n },\n size: {\n defaultValue: 'default',\n description: 'Size to display the component',\n },\n variant: {\n defaultValue: 'information',\n description: 'Variant that defines the style of the InformationBox',\n },\n }\n};\n\nexport const InformationBoxStory = ({\n children,\n showIcon,\n title,\n size,\n variant,\n}: InformationBoxProps) => (\n <div className='wmx6'>\n <InformationBox\n children={children}\n showIcon={showIcon}\n title={title}\n size={size}\n variant={variant}\n />\n </div>\n);\n\nInformationBoxStory.storyName = \"InformationBox\";\n\nexport default story;\n"],"names":["_jsx"],"mappings":";;;;;;IAEM,KAAK,GAAG;IACZ,KAAK,EAAE,oBAAoB;IAC3B,SAAS,EAAE,cAAc;IACzB,QAAQ,EAAE;QACR,QAAQ,EAAE;YACR,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;YACzB,YAAY,EAAE,gEAAgE;YAC9E,WAAW,EAAE,sDAAsD;SACpE;QACD,KAAK,EAAE;YACL,YAAY,EAAE,wBAAwB;YACtC,WAAW,EAAE,8BAA8B;SAC5C;QACD,QAAQ,EAAE;YACR,YAAY,EAAE,KAAK;YACnB,WAAW,EAAE,sCAAsC;SACpD;QACD,IAAI,EAAE;YACJ,YAAY,EAAE,SAAS;YACvB,WAAW,EAAE,+BAA+B;SAC7C;QACD,OAAO,EAAE;YACP,YAAY,EAAE,aAAa;YAC3B,WAAW,EAAE,sDAAsD;SACpE;KACF;EACD;IAEW,mBAAmB,GAAG,UAAC,EAMd;QALpB,QAAQ,cAAA,EACR,QAAQ,cAAA,EACR,KAAK,WAAA,EACL,IAAI,UAAA,EACJ,OAAO,aAAA;IACkB,QACzBA,sBAAK,SAAS,EAAC,MAAM,gBACnBA,IAAC,cAAc,IACb,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,WAChB,YACE;AATmB,EAUzB;AAEF,mBAAmB,CAAC,SAAS,GAAG,gBAAgB;;;;;"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { b as __awaiter, c as __generator, _ as __assign } from '../../tslib.es6-5bc94358.js';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { c as customRender, s as screen } from '../../customRender-20b5f7ec.js';
|
|
4
|
+
import { InformationBox } from './index.js';
|
|
5
|
+
import 'react';
|
|
6
|
+
import 'react-dom';
|
|
7
|
+
import '../../_commonjsHelpers-e7f67fd8.js';
|
|
8
|
+
import 'react-dom/test-utils';
|
|
9
|
+
import '../../index-e9e37a34.js';
|
|
10
|
+
import '../../style-inject.es-1f59c1d0.js';
|
|
11
|
+
|
|
12
|
+
describe('InformationBox component', function () {
|
|
13
|
+
it('Should render title', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
14
|
+
return __generator(this, function (_a) {
|
|
15
|
+
customRender(jsx(InformationBox, __assign({ title: 'Title' }, { children: "Content" }), void 0));
|
|
16
|
+
expect(screen.getByText('Title')).toBeInTheDocument();
|
|
17
|
+
return [2 /*return*/];
|
|
18
|
+
});
|
|
19
|
+
}); });
|
|
20
|
+
it('Should not render title when title prop is not passed', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
21
|
+
return __generator(this, function (_a) {
|
|
22
|
+
customRender(jsx(InformationBox, { children: "Content" }, void 0));
|
|
23
|
+
expect(screen.queryByTestId('information-box-title')).not.toBeInTheDocument();
|
|
24
|
+
return [2 /*return*/];
|
|
25
|
+
});
|
|
26
|
+
}); });
|
|
27
|
+
it('Should render content', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
28
|
+
return __generator(this, function (_a) {
|
|
29
|
+
customRender(jsx(InformationBox, { children: "Content" }, void 0));
|
|
30
|
+
expect(screen.getByText('Content')).toBeInTheDocument();
|
|
31
|
+
return [2 /*return*/];
|
|
32
|
+
});
|
|
33
|
+
}); });
|
|
34
|
+
it('Should show icon when showIcon is true', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
35
|
+
return __generator(this, function (_a) {
|
|
36
|
+
customRender(jsx(InformationBox, __assign({ showIcon: true }, { children: "Content" }), void 0));
|
|
37
|
+
expect(screen.getByTestId('information-box-icon')).toBeInTheDocument();
|
|
38
|
+
return [2 /*return*/];
|
|
39
|
+
});
|
|
40
|
+
}); });
|
|
41
|
+
it('Should not show icon when showIcon is false', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
42
|
+
return __generator(this, function (_a) {
|
|
43
|
+
customRender(jsx(InformationBox, __assign({ showIcon: false }, { children: "Content" }), void 0));
|
|
44
|
+
expect(screen.queryByTestId('information-box-icon')).not.toBeInTheDocument();
|
|
45
|
+
return [2 /*return*/];
|
|
46
|
+
});
|
|
47
|
+
}); });
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=index.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.js","sources":["../../../../../src/lib/components/informationBox/index.test.tsx"],"sourcesContent":["import { render, screen } from '../../util/testUtils';\n\nimport { InformationBox } from '.';\n\ndescribe('InformationBox component', () => {\n it('Should render title', async () => {\n render(\n <InformationBox title={'Title'}>\n Content\n </InformationBox>\n )\n\n expect(screen.getByText('Title')).toBeInTheDocument();\n });\n\n it('Should not render title when title prop is not passed', async () => {\n render(\n <InformationBox>\n Content\n </InformationBox>\n )\n\n expect(screen.queryByTestId('information-box-title')).not.toBeInTheDocument();\n });\n \n it('Should render content', async () => {\n render(\n <InformationBox>\n Content\n </InformationBox>\n )\n\n expect(screen.getByText('Content')).toBeInTheDocument();\n });\n \n it('Should show icon when showIcon is true', async () => {\n render(\n <InformationBox showIcon>\n Content\n </InformationBox>\n )\n\n expect(screen.getByTestId('information-box-icon')).toBeInTheDocument();\n });\n \n it('Should not show icon when showIcon is false', async () => {\n render(\n <InformationBox showIcon={false}>\n Content\n </InformationBox>\n )\n\n expect(screen.queryByTestId('information-box-icon')).not.toBeInTheDocument();\n });\n});\n"],"names":["render","_jsx"],"mappings":";;;;;;;;;;;AAIA,QAAQ,CAAC,0BAA0B,EAAE;IACnC,EAAE,CAAC,qBAAqB,EAAE;;YACxBA,YAAM,CACJC,IAAC,cAAc,aAAC,KAAK,EAAE,OAAO,qCAEb,CAClB,CAAA;YAED,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC;;;SACvD,CAAC,CAAC;IAEH,EAAE,CAAC,uDAAuD,EAAE;;YAC1DD,YAAM,CACJC,IAAC,cAAc,kCAEE,CAClB,CAAA;YAED,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,uBAAuB,CAAC,CAAC,CAAC,GAAG,CAAC,iBAAiB,EAAE,CAAC;;;SAC/E,CAAC,CAAC;IAEH,EAAE,CAAC,uBAAuB,EAAE;;YAC1BD,YAAM,CACJC,IAAC,cAAc,kCAEE,CAClB,CAAA;YAED,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC;;;SACzD,CAAC,CAAC;IAEH,EAAE,CAAC,wCAAwC,EAAE;;YAC3CD,YAAM,CACJC,IAAC,cAAc,aAAC,QAAQ,2CAEP,CAClB,CAAA;YAED,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC;;;SACxE,CAAC,CAAC;IAEH,EAAE,CAAC,6CAA6C,EAAE;;YAChDD,YAAM,CACJC,IAAC,cAAc,aAAC,QAAQ,EAAE,KAAK,qCAEd,CAClB,CAAA;YAED,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,sBAAsB,CAAC,CAAC,CAAC,GAAG,CAAC,iBAAiB,EAAE,CAAC;;;SAC9E,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -4,24 +4,28 @@ import { useState } from 'react';
|
|
|
4
4
|
import Chip from '../../chip/index.js';
|
|
5
5
|
import AutoSuggestInput from '../autoSuggestInput/index.js';
|
|
6
6
|
import { s as styleInject } from '../../../style-inject.es-1f59c1d0.js';
|
|
7
|
-
import '../../../index-e9e37a34.js';
|
|
7
|
+
import { c as classnames } from '../../../index-e9e37a34.js';
|
|
8
8
|
import '../../../index-171a0108.js';
|
|
9
9
|
import '../../../index-dd80248b.js';
|
|
10
10
|
import '../index.js';
|
|
11
11
|
import '../../../index-fb46adf9.js';
|
|
12
12
|
|
|
13
|
-
var css_248z = ".style-module_chip-container__26s37 {\n display: flex;\n flex-wrap: wrap;\n}";
|
|
14
|
-
var styles = {"chip-container":"style-module_chip-container__26s37"};
|
|
13
|
+
var css_248z = ".style-module_chip-container__26s37 {\n display: flex;\n flex-wrap: wrap;\n max-height: 10px;\n transition: 0.7s ease-in;\n}\n\n.style-module_appearIn__3XNel {\n max-height: 300px;\n}";
|
|
14
|
+
var styles = {"chip-container":"style-module_chip-container__26s37","appearIn":"style-module_appearIn__3XNel"};
|
|
15
15
|
styleInject(css_248z);
|
|
16
16
|
|
|
17
17
|
var index = (function (_a) {
|
|
18
|
+
var _b;
|
|
18
19
|
var options = _a.options, selectedValues = _a.selectedValues, setValues = _a.setValues, placeholder = _a.placeholder, chipsListClassName = _a.chipsListClassName, multiSelectClassName = _a.multiSelectClassName, wrapText = _a.wrapText;
|
|
19
|
-
var
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
var _c = useState([]), suggestions = _c[0], setSuggestions = _c[1];
|
|
21
|
+
var _d = useState(''), currentOption = _d[0], setCurrentOption = _d[1];
|
|
22
|
+
var hasChips = Boolean(selectedValues && selectedValues.length > 0);
|
|
23
|
+
return (jsxs(Fragment, { children: [jsx("div", __assign({ className: classnames(styles['chip-container'], chipsListClassName, (_b = {},
|
|
24
|
+
_b[styles.appearIn] = hasChips,
|
|
25
|
+
_b)) }, { children: selectedValues && hasChips && (jsx(Fragment, { children: selectedValues.map(function (value, index) { return (jsx(Chip, { className: "mb16", value: value, onRemove: function (value) {
|
|
26
|
+
var newValues = __spreadArray([], selectedValues).filter(function (selectedValue) { return selectedValue.value !== value.value; });
|
|
27
|
+
setValues(newValues);
|
|
28
|
+
} }, value.value + "-" + index)); }) }, void 0)) }), void 0),
|
|
25
29
|
jsx(AutoSuggestInput, { className: multiSelectClassName, placeholder: placeholder, onChange: setCurrentOption, handleSuggestionSelected: function (value) {
|
|
26
30
|
var newSelectedOptions = selectedValues !== null && selectedValues !== void 0 ? selectedValues : [];
|
|
27
31
|
newSelectedOptions === null || newSelectedOptions === void 0 ? void 0 : newSelectedOptions.push(value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../src/lib/components/input/autoSuggestMultiSelect/index.tsx"],"sourcesContent":["import { useState } from 'react';\n\nimport { Option } from '../../../models/autoSuggestInput';\nimport Chip from '../../chip';\nimport AutoSuggestInput from '../autoSuggestInput';\nimport styles from './style.module.scss';\n\nexport default ({\n options,\n selectedValues,\n setValues,\n placeholder,\n chipsListClassName,\n multiSelectClassName,\n wrapText,\n}: {\n options: Option[];\n selectedValues?: Option[];\n setValues: (values: Option[]) => void;\n placeholder: string;\n chipsListClassName?: string;\n multiSelectClassName?: string;\n wrapText?: boolean;\n}) => {\n const [suggestions, setSuggestions] = useState<Option[]>([]);\n const [currentOption, setCurrentOption] = useState('');\n
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../src/lib/components/input/autoSuggestMultiSelect/index.tsx"],"sourcesContent":["import { useState } from 'react';\n\nimport { Option } from '../../../models/autoSuggestInput';\nimport Chip from '../../chip';\nimport AutoSuggestInput from '../autoSuggestInput';\nimport styles from './style.module.scss';\nimport classNames from 'classnames';\n\nexport default ({\n options,\n selectedValues,\n setValues,\n placeholder,\n chipsListClassName,\n multiSelectClassName,\n wrapText,\n}: {\n options: Option[];\n selectedValues?: Option[];\n setValues: (values: Option[]) => void;\n placeholder: string;\n chipsListClassName?: string;\n multiSelectClassName?: string;\n wrapText?: boolean;\n}) => {\n const [suggestions, setSuggestions] = useState<Option[]>([]);\n const [currentOption, setCurrentOption] = useState('');\n const hasChips = Boolean(selectedValues && selectedValues.length > 0);\n\n return (\n <>\n <div\n className={classNames(\n styles['chip-container'],\n chipsListClassName,\n {\n [styles.appearIn]: hasChips\n },\n )}\n >\n {selectedValues && hasChips && (\n <>\n {selectedValues.map((value, index) => (\n <Chip\n key={`${value.value}-${index}`}\n className=\"mb16\"\n value={value}\n onRemove={(value: Option) => {\n const newValues = [...selectedValues].filter(\n (selectedValue) => selectedValue.value !== value.value\n );\n setValues(newValues);\n }}\n />\n ))}\n </>\n )}\n </div>\n <AutoSuggestInput\n className={multiSelectClassName}\n placeholder={placeholder}\n onChange={setCurrentOption}\n handleSuggestionSelected={(value) => {\n const newSelectedOptions = selectedValues ?? [];\n newSelectedOptions?.push(value);\n setValues(newSelectedOptions);\n setCurrentOption('');\n }}\n handleSuggestionFetchRequest={({ value }) => {\n const filteredOptions = options.filter(\n (option) =>\n option.value.toLowerCase().startsWith(value.toLowerCase()) &&\n selectedValues?.find(\n (selectedValue) => selectedValue.value === option.value\n ) === undefined\n );\n setSuggestions(filteredOptions);\n }}\n currentOption={currentOption}\n suggestions={suggestions}\n handleSuggestionClearRequest={() => setSuggestions([])}\n wrapText={wrapText}\n />\n </>\n );\n};\n"],"names":["_jsxs","_jsx","classNames"],"mappings":";;;;;;;;;;;;;;;;AAQA,aAAe,UAAC,EAgBf;;QAfC,OAAO,aAAA,EACP,cAAc,oBAAA,EACd,SAAS,eAAA,EACT,WAAW,iBAAA,EACX,kBAAkB,wBAAA,EAClB,oBAAoB,0BAAA,EACpB,QAAQ,cAAA;IAUF,IAAA,KAAgC,QAAQ,CAAW,EAAE,CAAC,EAArD,WAAW,QAAA,EAAE,cAAc,QAA0B,CAAC;IACvD,IAAA,KAAoC,QAAQ,CAAC,EAAE,CAAC,EAA/C,aAAa,QAAA,EAAE,gBAAgB,QAAgB,CAAC;IACvD,IAAM,QAAQ,GAAG,OAAO,CAAC,cAAc,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAEtE,QACEA,4BACEC,sBACE,SAAS,EAAEC,UAAU,CACnB,MAAM,CAAC,gBAAgB,CAAC,EACxB,kBAAkB;oBAEhB,GAAC,MAAM,CAAC,QAAQ,IAAG,QAAQ;wBAE9B,gBAEA,cAAc,IAAI,QAAQ,KACzBD,0BACG,cAAc,CAAC,GAAG,CAAC,UAAC,KAAK,EAAE,KAAK,IAAK,QACpCA,IAAC,IAAI,IAEH,SAAS,EAAC,MAAM,EAChB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,UAAC,KAAa;4BACtB,IAAM,SAAS,GAAG,kBAAI,cAAc,EAAE,MAAM,CAC1C,UAAC,aAAa,IAAK,OAAA,aAAa,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,GAAA,CACvD,CAAC;4BACF,SAAS,CAAC,SAAS,CAAC,CAAC;yBACtB,IARO,KAAK,CAAC,KAAK,SAAI,KAAO,CAS9B,IACH,CAAC,WACD,CACJ,YACG;YACNA,IAAC,gBAAgB,IACf,SAAS,EAAE,oBAAoB,EAC/B,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,gBAAgB,EAC1B,wBAAwB,EAAE,UAAC,KAAK;oBAC9B,IAAM,kBAAkB,GAAG,cAAc,aAAd,cAAc,cAAd,cAAc,GAAI,EAAE,CAAC;oBAChD,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,IAAI,CAAC,KAAK,CAAC,CAAC;oBAChC,SAAS,CAAC,kBAAkB,CAAC,CAAC;oBAC9B,gBAAgB,CAAC,EAAE,CAAC,CAAC;iBACtB,EACD,4BAA4B,EAAE,UAAC,EAAS;wBAAP,KAAK,WAAA;oBACpC,IAAM,eAAe,GAAG,OAAO,CAAC,MAAM,CACpC,UAAC,MAAM;wBACL,OAAA,MAAM,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;4BAC1D,CAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,IAAI,CAClB,UAAC,aAAa,IAAK,OAAA,aAAa,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,GAAA,CACxD,MAAK,SAAS;qBAAA,CAClB,CAAC;oBACF,cAAc,CAAC,eAAe,CAAC,CAAC;iBACjC,EACD,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,4BAA4B,EAAE,cAAM,OAAA,cAAc,CAAC,EAAE,CAAC,GAAA,EACtD,QAAQ,EAAE,QAAQ,WAClB,YACD,EACH;AACJ,CAAC;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { b as __awaiter, c as __generator } from '../../../tslib.es6-5bc94358.js';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { c as customRender } from '../../../customRender-
|
|
3
|
+
import { c as customRender } from '../../../customRender-20b5f7ec.js';
|
|
4
4
|
import { Checkbox } from './index.js';
|
|
5
5
|
import 'react';
|
|
6
6
|
import 'react-dom';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { b as __awaiter, c as __generator, _ as __assign } from '../../../tslib.es6-5bc94358.js';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { c as customRender } from '../../../customRender-
|
|
3
|
+
import { c as customRender } from '../../../customRender-20b5f7ec.js';
|
|
4
4
|
import CurrencyInput from './index.js';
|
|
5
5
|
import 'react';
|
|
6
6
|
import 'react-dom';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { a as __rest, _ as __assign } from '../../tslib.es6-5bc94358.js';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { c as classnames } from '../../index-e9e37a34.js';
|
|
4
|
+
|
|
5
|
+
var Link = function (_a) {
|
|
6
|
+
var children = _a.children, className = _a.className, rest = __rest(_a, ["children", "className"]);
|
|
7
|
+
return (jsx("a", __assign({ className: classnames(className, 'p-a c-pointer') }, rest, { children: children }), void 0));
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export { Link };
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/lib/components/link/index.tsx"],"sourcesContent":["import classnames from 'classnames';\n\nexport type LinkProps = JSX.IntrinsicElements['a'];\n\nexport const Link = ({ children, className, ...rest }: LinkProps) => (\n <a className={classnames(className, 'p-a c-pointer')} {...rest}>\n {children}\n </a>\n);"],"names":["_jsx"],"mappings":";;;;IAIa,IAAI,GAAG,UAAC,EAA2C;IAAzC,IAAA,QAAQ,cAAA,EAAE,SAAS,eAAA,EAAK,IAAI,cAA9B,yBAAgC,CAAF;IAAkB,QACnEA,oBAAG,SAAS,EAAE,UAAU,CAAC,SAAS,EAAE,eAAe,CAAC,IAAM,IAAI,cAC3D,QAAQ,YACP,EACL;;;;;"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { a as __rest, _ as __assign } from '../../tslib.es6-5bc94358.js';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { Link } from './index.js';
|
|
4
|
+
import '../../index-e9e37a34.js';
|
|
5
|
+
|
|
6
|
+
var story = {
|
|
7
|
+
title: 'JSX/Link',
|
|
8
|
+
component: Link,
|
|
9
|
+
argTypes: {
|
|
10
|
+
children: {
|
|
11
|
+
control: 'text',
|
|
12
|
+
defaultValue: 'Click here to go to Feather Insurance',
|
|
13
|
+
description: 'Content that is displayed as clickable inside the link',
|
|
14
|
+
},
|
|
15
|
+
href: {
|
|
16
|
+
control: 'text',
|
|
17
|
+
defaultValue: 'https://feather-insurance.com',
|
|
18
|
+
description: 'Specifies the URL of the page the link goes to',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
parameters: {
|
|
22
|
+
componentSubtitle: 'Links are a styled helper component for anchor (<a />) tags.',
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
var LinkStory = function (_a) {
|
|
26
|
+
var children = _a.children, href = _a.href, rest = __rest(_a, ["children", "href"]);
|
|
27
|
+
return (jsx(Link, __assign({ href: href }, rest, { children: children }), void 0));
|
|
28
|
+
};
|
|
29
|
+
LinkStory.storyName = "Link";
|
|
30
|
+
|
|
31
|
+
export default story;
|
|
32
|
+
export { LinkStory };
|
|
33
|
+
//# sourceMappingURL=index.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.stories.js","sources":["../../../../../src/lib/components/link/index.stories.tsx"],"sourcesContent":["import { Link, LinkProps } from '.';\n\nconst story = {\n title: 'JSX/Link',\n component: Link,\n argTypes: {\n children: {\n control: 'text',\n defaultValue: 'Click here to go to Feather Insurance',\n description: 'Content that is displayed as clickable inside the link',\n },\n href: {\n control: 'text',\n defaultValue: 'https://feather-insurance.com',\n description: 'Specifies the URL of the page the link goes to',\n },\n },\n parameters: {\n componentSubtitle: 'Links are a styled helper component for anchor (<a />) tags.',\n },\n};\n\nexport const LinkStory = ({ children, href, ...rest }: LinkProps) => (\n <Link href={href} {...rest}>{children}</Link>\n);\n\nLinkStory.storyName = \"Link\";\n\nexport default story;\n"],"names":["_jsx"],"mappings":";;;;;IAEM,KAAK,GAAG;IACZ,KAAK,EAAE,UAAU;IACjB,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE;QACR,QAAQ,EAAE;YACR,OAAO,EAAE,MAAM;YACf,YAAY,EAAE,uCAAuC;YACrD,WAAW,EAAE,wDAAwD;SACtE;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,MAAM;YACf,YAAY,EAAE,+BAA+B;YAC7C,WAAW,EAAE,gDAAgD;SAC9D;KACF;IACD,UAAU,EAAE;QACV,iBAAiB,EAAE,8DAA8D;KAClF;EACD;IAEW,SAAS,GAAG,UAAC,EAAsC;IAApC,IAAA,QAAQ,cAAA,EAAE,IAAI,UAAA,EAAK,IAAI,cAAzB,oBAA2B,CAAF;IAAkB,QACnEA,IAAC,IAAI,aAAC,IAAI,EAAE,IAAI,IAAM,IAAI,cAAG,QAAQ,YAAQ,EAC9C;EAAC;AAEF,SAAS,CAAC,SAAS,GAAG,MAAM;;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { b as __awaiter, c as __generator, _ as __assign, a as __rest } from '../../tslib.es6-5bc94358.js';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { c as customRender, a as act, f as fireEvent } from '../../customRender-
|
|
4
|
-
import '../../extend-expect-
|
|
3
|
+
import { c as customRender, a as act, f as fireEvent } from '../../customRender-20b5f7ec.js';
|
|
4
|
+
import '../../extend-expect-25e5049d.js';
|
|
5
5
|
import { MultiDropzone } from './index.js';
|
|
6
6
|
import 'react';
|
|
7
7
|
import 'react-dom';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { b as __awaiter, c as __generator } from '../../tslib.es6-5bc94358.js';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { c as customRender } from '../../customRender-
|
|
3
|
+
import { c as customRender } from '../../customRender-20b5f7ec.js';
|
|
4
4
|
import { SegmentedControl } from './index.js';
|
|
5
5
|
import 'react';
|
|
6
6
|
import 'react-dom';
|
|
@@ -19170,7 +19170,7 @@ const initialValue = {
|
|
|
19170
19170
|
debug,
|
|
19171
19171
|
logTestingPlaygroundURL
|
|
19172
19172
|
};
|
|
19173
|
-
typeof document !== 'undefined' && document.body // eslint-disable-line @typescript-eslint/no-unnecessary-condition
|
|
19173
|
+
const screen = typeof document !== 'undefined' && document.body // eslint-disable-line @typescript-eslint/no-unnecessary-condition
|
|
19174
19174
|
? getQueriesForElement(document.body, queries, initialValue) : Object.keys(queries).reduce((helpers, key) => {
|
|
19175
19175
|
// `key` is for all intents and purposes the type of keyof `helpers`, which itself is the type of `initialValue` plus incoming properties from `queries`
|
|
19176
19176
|
// if `Object.keys(something)` returned Array<keyof typeof something> this explicit type assertion would not be necessary
|
|
@@ -24098,5 +24098,5 @@ var customRender = function (ui, options) {
|
|
|
24098
24098
|
return (__assign({ user: userEvent.setup() }, render(ui, options)));
|
|
24099
24099
|
};
|
|
24100
24100
|
|
|
24101
|
-
export { act as a, customRender as c, fireEvent as f, lib as l };
|
|
24102
|
-
//# sourceMappingURL=customRender-
|
|
24101
|
+
export { act as a, customRender as c, fireEvent as f, lib as l, screen as s };
|
|
24102
|
+
//# sourceMappingURL=customRender-20b5f7ec.js.map
|