@popsure/dirty-swan 0.33.5 → 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 +144 -121
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/lib/components/cards/cardButton/index.d.ts +8 -8
- package/dist/cjs/lib/components/cards/cardButton/index.stories.d.ts +39 -0
- package/dist/cjs/lib/components/cards/cardWithLeftIcon/index.d.ts +6 -12
- package/dist/cjs/lib/components/cards/cardWithLeftIcon/index.stories.d.ts +55 -0
- package/dist/cjs/lib/components/cards/cardWithTopIcon/index.d.ts +5 -11
- package/dist/cjs/lib/components/cards/cardWithTopIcon/index.stories.d.ts +59 -0
- package/dist/cjs/lib/components/cards/cardWithTopLeftIcon/index.d.ts +6 -12
- package/dist/cjs/lib/components/cards/cardWithTopLeftIcon/index.stories.d.ts +49 -0
- package/dist/cjs/lib/components/cards/index.d.ts +5 -5
- package/dist/cjs/lib/components/cards/infoCard/index.d.ts +4 -10
- package/dist/cjs/lib/components/cards/infoCard/index.stories.d.ts +47 -0
- 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/input/index.d.ts +4 -5
- package/dist/cjs/lib/components/input/input.stories.d.ts +90 -0
- package/dist/cjs/lib/components/input/stories/config.d.ts +71 -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 +4 -2
- package/dist/esm/components/autocompleteAddress/index.js +1 -1
- package/dist/esm/components/autocompleteAddress/index.js.map +1 -1
- package/dist/esm/components/autocompleteAddress/index.test.js +1 -1
- package/dist/esm/components/cards/cardButton/index.js +1 -1
- package/dist/esm/components/cards/cardButton/index.stories.js +49 -0
- package/dist/esm/components/cards/cardButton/index.stories.js.map +1 -0
- package/dist/esm/components/cards/cardWithLeftIcon/index.js +1 -1
- package/dist/esm/components/cards/cardWithLeftIcon/index.stories.js +64 -0
- package/dist/esm/components/cards/cardWithLeftIcon/index.stories.js.map +1 -0
- package/dist/esm/components/cards/cardWithTopIcon/index.js +1 -1
- package/dist/esm/components/cards/cardWithTopIcon/index.stories.js +68 -0
- package/dist/esm/components/cards/cardWithTopIcon/index.stories.js.map +1 -0
- package/dist/esm/components/cards/cardWithTopLeftIcon/index.js +1 -1
- package/dist/esm/components/cards/cardWithTopLeftIcon/index.stories.js +57 -0
- package/dist/esm/components/cards/cardWithTopLeftIcon/index.stories.js.map +1 -0
- package/dist/esm/components/cards/index.js +9 -9
- package/dist/esm/components/cards/index.js.map +1 -1
- package/dist/esm/components/cards/infoCard/index.js +1 -1
- package/dist/esm/components/cards/infoCard/index.stories.js +58 -0
- package/dist/esm/components/cards/infoCard/index.stories.js.map +1 -0
- 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/AccordionItem/AccordionItem.js +1 -1
- package/dist/esm/components/comparisonTable/components/TableArrows/index.js +1 -1
- package/dist/esm/components/comparisonTable/components/TableButton/index.test.js +2 -2
- package/dist/esm/components/comparisonTable/components/TableInfoButton/index.js +1 -1
- 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/autoSuggestInput/index.js +1 -1
- package/dist/esm/components/input/autoSuggestInput/index.js.map +1 -1
- 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.js +1 -1
- package/dist/esm/components/input/currency/index.js.map +1 -1
- package/dist/esm/components/input/currency/index.test.js +1 -1
- package/dist/esm/components/input/iban/index.js +1 -1
- package/dist/esm/components/input/iban/index.js.map +1 -1
- package/dist/esm/components/input/index.js +1 -1
- package/dist/esm/components/input/index.js.map +1 -1
- package/dist/esm/components/input/input.stories.js +85 -0
- package/dist/esm/components/input/input.stories.js.map +1 -0
- 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-47663d39.js.map +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +3 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/components/cards/cardButton/index.d.ts +8 -8
- package/dist/esm/lib/components/cards/cardButton/index.stories.d.ts +39 -0
- package/dist/esm/lib/components/cards/cardWithLeftIcon/index.d.ts +6 -12
- package/dist/esm/lib/components/cards/cardWithLeftIcon/index.stories.d.ts +55 -0
- package/dist/esm/lib/components/cards/cardWithTopIcon/index.d.ts +5 -11
- package/dist/esm/lib/components/cards/cardWithTopIcon/index.stories.d.ts +59 -0
- package/dist/esm/lib/components/cards/cardWithTopLeftIcon/index.d.ts +6 -12
- package/dist/esm/lib/components/cards/cardWithTopLeftIcon/index.stories.d.ts +49 -0
- package/dist/esm/lib/components/cards/index.d.ts +5 -5
- package/dist/esm/lib/components/cards/infoCard/index.d.ts +4 -10
- package/dist/esm/lib/components/cards/infoCard/index.stories.d.ts +47 -0
- 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/input/index.d.ts +4 -5
- package/dist/esm/lib/components/input/input.stories.d.ts +90 -0
- package/dist/esm/lib/components/input/stories/config.d.ts +71 -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 +4 -2
- package/dist/esm/scss/public/demo.js +1 -1
- package/dist/esm/scss/public/demo.js.map +1 -1
- package/dist/esm/util/testUtils/customRender.js +1 -1
- package/dist/index.css +10 -10
- package/dist/lib/scss/public/colors/default.scss +2 -2
- package/dist/lib/scss/public/demo.tsx +1 -1
- package/package.json +1 -1
- package/src/index.tsx +2 -0
- package/src/lib/components/autocompleteAddress/index.tsx +1 -1
- package/src/lib/components/cards/cardButton/index.stories.tsx +61 -0
- package/src/lib/components/cards/cardButton/index.tsx +9 -10
- package/src/lib/components/cards/cardWithLeftIcon/index.stories.tsx +79 -0
- package/src/lib/components/cards/cardWithLeftIcon/index.tsx +8 -6
- package/src/lib/components/cards/cardWithTopIcon/index.stories.tsx +85 -0
- package/src/lib/components/cards/cardWithTopIcon/index.tsx +9 -7
- package/src/lib/components/cards/cardWithTopLeftIcon/index.stories.tsx +73 -0
- package/src/lib/components/cards/cardWithTopLeftIcon/index.tsx +8 -6
- package/src/lib/components/cards/index.tsx +5 -5
- package/src/lib/components/cards/infoCard/index.stories.tsx +71 -0
- package/src/lib/components/cards/infoCard/index.tsx +7 -5
- 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/a.stories.mdx +2 -2
- package/src/lib/components/input/autoSuggestInput/index.tsx +1 -1
- 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/input/currency/index.tsx +1 -1
- package/src/lib/components/input/iban/index.tsx +1 -1
- package/src/lib/components/input/index.tsx +4 -4
- package/src/lib/components/input/input.stories.tsx +48 -0
- package/src/lib/components/input/stories/config.ts +56 -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 +5 -1
- package/src/lib/scss/public/colors/default.scss +2 -2
- package/src/lib/scss/public/demo.tsx +1 -1
- package/src/lib/components/cards/cardButton/index.stories.mdx +0 -47
- package/src/lib/components/cards/cardWithLeftIcon/index.stories.mdx +0 -103
- package/src/lib/components/cards/cardWithTopIcon/index.stories.mdx +0 -105
- package/src/lib/components/cards/cardWithTopLeftIcon/index.stories.mdx +0 -101
- package/src/lib/components/cards/infoCard/index.stories.mdx +0 -61
- package/src/lib/components/input/index.stories.mdx +0 -108
|
@@ -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}
|
|
@@ -5,16 +5,16 @@ import generateId from '../../util/generateId';
|
|
|
5
5
|
import styles from './style.module.scss';
|
|
6
6
|
|
|
7
7
|
// Something weird is going on with enterKeyHint that makes it a required field under certain circumstances. The & Omit<…> and & Pick<…> is a hacky way to go around that.
|
|
8
|
-
export type InputProps =
|
|
8
|
+
export type InputProps = Omit<JSX.IntrinsicElements['input'], 'enterKeyHint'> &
|
|
9
|
+
Partial<Pick<JSX.IntrinsicElements['input'], 'enterKeyHint'>> & {
|
|
9
10
|
error?: string;
|
|
10
11
|
prefix?: string;
|
|
11
12
|
label?: string;
|
|
12
13
|
id?: string;
|
|
13
14
|
hideLabel?: boolean;
|
|
14
|
-
}
|
|
15
|
-
Partial<Pick<JSX.IntrinsicElements['input'], 'enterKeyHint'>>;
|
|
15
|
+
};
|
|
16
16
|
|
|
17
|
-
export
|
|
17
|
+
export const Input = React.forwardRef(
|
|
18
18
|
(
|
|
19
19
|
{
|
|
20
20
|
className,
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
|
|
2
|
+
import { ChangeEvent, useState } from 'react';
|
|
3
|
+
import { Input, InputProps } from '.';
|
|
4
|
+
import sharedConfig from './stories/config';
|
|
5
|
+
|
|
6
|
+
const story = {
|
|
7
|
+
title: 'JSX/Inputs/Input',
|
|
8
|
+
component: Input,
|
|
9
|
+
argTypes: sharedConfig,
|
|
10
|
+
parameters: {
|
|
11
|
+
componentSubtitle: 'The default input component is used to gather informations from the user.'
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const InputStory = ({
|
|
16
|
+
onChange,
|
|
17
|
+
className,
|
|
18
|
+
placeholder,
|
|
19
|
+
value,
|
|
20
|
+
label,
|
|
21
|
+
hideLabel,
|
|
22
|
+
prefix,
|
|
23
|
+
error
|
|
24
|
+
}: InputProps) => {
|
|
25
|
+
const [newValue, setValue] = useState(value);
|
|
26
|
+
|
|
27
|
+
const handleOnChange = (event: ChangeEvent<HTMLInputElement>) => {
|
|
28
|
+
setValue(event.target.value)
|
|
29
|
+
onChange?.(event);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<Input
|
|
34
|
+
onChange={handleOnChange}
|
|
35
|
+
value={newValue}
|
|
36
|
+
className={className}
|
|
37
|
+
placeholder={placeholder}
|
|
38
|
+
label={label}
|
|
39
|
+
hideLabel={hideLabel}
|
|
40
|
+
prefix={prefix}
|
|
41
|
+
error={error}
|
|
42
|
+
/>
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
InputStory.storyName = 'Input';
|
|
47
|
+
|
|
48
|
+
export default story;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
const sharedConfig = {
|
|
2
|
+
value: {
|
|
3
|
+
defaultValue: '',
|
|
4
|
+
description: 'Current input value.',
|
|
5
|
+
control: { type: 'text' }
|
|
6
|
+
},
|
|
7
|
+
className: {
|
|
8
|
+
description: 'Wrapper classNames for custom styling',
|
|
9
|
+
defaultValue: '',
|
|
10
|
+
control: { type: 'text' }
|
|
11
|
+
},
|
|
12
|
+
placeholder: {
|
|
13
|
+
description: 'Placeholder for DirtySwan Input component',
|
|
14
|
+
defaultValue: 'Placeholder',
|
|
15
|
+
control: { type: 'text' }
|
|
16
|
+
},
|
|
17
|
+
label: {
|
|
18
|
+
description: 'Label of the Input component',
|
|
19
|
+
defaultValue: 'Input Label',
|
|
20
|
+
control: { type: 'text' }
|
|
21
|
+
},
|
|
22
|
+
hideLabel: {
|
|
23
|
+
description: 'Whether or not a label should be hidden.. This is needed for accessibility purposes and a label should always be provided',
|
|
24
|
+
defaultValue: false,
|
|
25
|
+
control: { type: 'boolean' }
|
|
26
|
+
},
|
|
27
|
+
prefix: {
|
|
28
|
+
description: 'A prefix that can be displayed on the left of the input. Specially useful for currencies.',
|
|
29
|
+
defaultValue: '£',
|
|
30
|
+
control: { type: 'text' }
|
|
31
|
+
},
|
|
32
|
+
id: {
|
|
33
|
+
description: 'Unique ID identifier of the input. Relevant for accessibility.',
|
|
34
|
+
defaultValue: '1234567890',
|
|
35
|
+
control: { type: 'text' }
|
|
36
|
+
},
|
|
37
|
+
error: {
|
|
38
|
+
description: 'Error message that will also make input show on error state.',
|
|
39
|
+
defaultValue: '',
|
|
40
|
+
control: { type: 'text' },
|
|
41
|
+
table: {
|
|
42
|
+
type: {
|
|
43
|
+
summary: 'string | boolean'
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
onChange: {
|
|
48
|
+
description: 'Function that is called when value of current input changes',
|
|
49
|
+
action: true,
|
|
50
|
+
table: {
|
|
51
|
+
category: "Callbacks",
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export default sharedConfig;
|
|
@@ -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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DateSelector } from './components/dateSelector';
|
|
2
2
|
import { SignaturePad } from './components/signaturePad';
|
|
3
3
|
import { AutocompleteAddress } from './components/autocompleteAddress';
|
|
4
|
-
import Input from './components/input';
|
|
4
|
+
import { Input } from './components/input';
|
|
5
5
|
import {
|
|
6
6
|
MultiDropzone,
|
|
7
7
|
FileType,
|
|
@@ -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
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// TODO: Reference colors
|
|
2
2
|
$ds-primary-25: #fcfcff !default;
|
|
3
3
|
$ds-primary-50: #f7f7ff !default;
|
|
4
|
-
$ds-primary-100: #
|
|
4
|
+
$ds-primary-100: #ebebff !default;
|
|
5
5
|
$ds-primary-300: #b1b0f5 !default;
|
|
6
6
|
$ds-primary-500: #8e8cee !default;
|
|
7
7
|
$ds-primary-700: #6160a2 !default;
|
|
@@ -9,7 +9,7 @@ $ds-primary-900: #2e2e4c !default;
|
|
|
9
9
|
|
|
10
10
|
$ds-purple-25: #fcfcff;
|
|
11
11
|
$ds-purple-50: #f7f7ff;
|
|
12
|
-
$ds-purple-100: #
|
|
12
|
+
$ds-purple-100: #ebebff;
|
|
13
13
|
$ds-purple-300: #b1b0f5;
|
|
14
14
|
$ds-purple-500: #8e8cee;
|
|
15
15
|
$ds-purple-700: #6160a2;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { Meta, Preview } from '@storybook/addon-docs/blocks';
|
|
2
|
-
|
|
3
|
-
import CardButton from '.';
|
|
4
|
-
|
|
5
|
-
<Meta title="JSX/Cards/Card Button" />
|
|
6
|
-
|
|
7
|
-
# Card Button
|
|
8
|
-
|
|
9
|
-
| attribute | unit | description | default value | required |
|
|
10
|
-
| ----------- | ------------------------ | ---------------------------------------------- | ------------- | ----------------------------------- |
|
|
11
|
-
| title | string | Title text that needs to be displayed | n/a | true |
|
|
12
|
-
| description | string / ReactNode (JSX) | Description text that is displayed under title | n/a | true |
|
|
13
|
-
| disabled | boolean | Disabled state of the button | false | false |
|
|
14
|
-
| className | string | Class name for most top parent element | n/a | false |
|
|
15
|
-
| onClick | function | Function that runs on click of the button | n/a | true (false if href prop exists) |
|
|
16
|
-
| href | string | Redirect URL on click of the button | n/a | true (false if onClick prop exists) |
|
|
17
|
-
|
|
18
|
-
<Preview>
|
|
19
|
-
<>
|
|
20
|
-
<h4 className="p-h4">Normal state</h4>
|
|
21
|
-
<br />
|
|
22
|
-
<CardButton
|
|
23
|
-
title="Name"
|
|
24
|
-
description="Seungha Kong"
|
|
25
|
-
onClick={() => console.log('This is a button component')}
|
|
26
|
-
/>
|
|
27
|
-
<br />
|
|
28
|
-
<br />
|
|
29
|
-
<h4 className="p-h4">Long description</h4>
|
|
30
|
-
<br />
|
|
31
|
-
<CardButton
|
|
32
|
-
title="Risky Sports"
|
|
33
|
-
description="Mountain or rock climbing, Bouldering, Martial arts, Extreme sports, Scuba diving, Sky diving, Bungee jumping, Mountain or rock climbing, Bouldering, Martial arts,"
|
|
34
|
-
onClick={() => console.log('This is a button component')}
|
|
35
|
-
/>
|
|
36
|
-
<br />
|
|
37
|
-
<br />
|
|
38
|
-
<h4 className="p-h4">Disabled state</h4>
|
|
39
|
-
<br />
|
|
40
|
-
<CardButton
|
|
41
|
-
title="Address"
|
|
42
|
-
description="Lohmühlenstraße 65 10557 Berlin"
|
|
43
|
-
onClick={() => console.log('This is a button component')}
|
|
44
|
-
disabled
|
|
45
|
-
/>
|
|
46
|
-
</>
|
|
47
|
-
</Preview>
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { Meta, Preview } from '@storybook/addon-docs/blocks';
|
|
2
|
-
|
|
3
|
-
import CardWithLeftIcon from '.';
|
|
4
|
-
import { featherLogo } from '../icons';
|
|
5
|
-
|
|
6
|
-
<Meta title="JSX/Cards/Card with left icon" />
|
|
7
|
-
|
|
8
|
-
# Card with left icon
|
|
9
|
-
|
|
10
|
-
| attribute | unit | description | default value | required |
|
|
11
|
-
| ---------- | ------------------------------------------------------------------------------------ | ------------------------------------------------- | ------------- | -------- |
|
|
12
|
-
| title | string | The title text that needs to be displayed | n/a | true |
|
|
13
|
-
| cardSize | [Card Size (xs,s,m,b)](?path=/story/jsx-cards-intro--page#card-size-xsmall-small-medium-big) | Size of the card | medium | false |
|
|
14
|
-
| leftIcon | [Icon](?path=/story/jsx-cards-intro--page#icon) | Icon displayed on the left hand side of the card | n/a | false |
|
|
15
|
-
| rightIcon | [Icon](?path=/story/jsx-cards-intro--page#icon) | Icon displayed on the right hand side of the card | n/a | false |
|
|
16
|
-
| state | [Card State](?path=/story/jsx-cards-intro--page#card-state) | State that describe the interation with the card | actionable | false |
|
|
17
|
-
| dropshadow | boolean | If the card should have a box-shadow or not | true | false |
|
|
18
|
-
| className | string | Class name for most top parent element | 'n/a' | false |
|
|
19
|
-
|
|
20
|
-
<Preview>
|
|
21
|
-
<>
|
|
22
|
-
<h4 className="p-h4">Extra small card</h4>
|
|
23
|
-
<CardWithLeftIcon
|
|
24
|
-
title="Lorem ipsum"
|
|
25
|
-
cardSize="xsmall"
|
|
26
|
-
className="wmx6 mt8"
|
|
27
|
-
rightIcon="arrow"
|
|
28
|
-
leftIcon={featherLogo}
|
|
29
|
-
>
|
|
30
|
-
Praesent euismod porta odio at tempus.{' '}
|
|
31
|
-
<span className="fw-bold">Aenean urna massa</span>, facilisis malesuada
|
|
32
|
-
eros at, rhoncus imperdiet nunc
|
|
33
|
-
</CardWithLeftIcon>
|
|
34
|
-
<h4 className="p-h4">Small card</h4>
|
|
35
|
-
<CardWithLeftIcon
|
|
36
|
-
title="Lorem ipsum"
|
|
37
|
-
cardSize="small"
|
|
38
|
-
className="wmx6 mt8"
|
|
39
|
-
rightIcon="arrow"
|
|
40
|
-
leftIcon={featherLogo}
|
|
41
|
-
>
|
|
42
|
-
Praesent euismod porta odio at tempus.{' '}
|
|
43
|
-
<span className="fw-bold">Aenean urna massa</span>, facilisis malesuada
|
|
44
|
-
eros at, rhoncus imperdiet nunc
|
|
45
|
-
</CardWithLeftIcon>
|
|
46
|
-
<h4 className="p-h4 mt24">Medium card</h4>
|
|
47
|
-
<CardWithLeftIcon
|
|
48
|
-
title="Lorem ipsum"
|
|
49
|
-
cardSize="medium"
|
|
50
|
-
className="wmx6 mt8"
|
|
51
|
-
rightIcon="arrow"
|
|
52
|
-
leftIcon={featherLogo}
|
|
53
|
-
>
|
|
54
|
-
Praesent euismod porta odio at tempus.{' '}
|
|
55
|
-
<span className="fw-bold">Aenean urna massa</span>, facilisis malesuada
|
|
56
|
-
eros at, rhoncus imperdiet nunc
|
|
57
|
-
</CardWithLeftIcon>
|
|
58
|
-
<h4 className="p-h4 mt24">Big card</h4>
|
|
59
|
-
<CardWithLeftIcon
|
|
60
|
-
title="Lorem ipsum"
|
|
61
|
-
cardSize="big"
|
|
62
|
-
className="wmx6 mt8"
|
|
63
|
-
rightIcon="arrow"
|
|
64
|
-
leftIcon={featherLogo}
|
|
65
|
-
>
|
|
66
|
-
Praesent euismod porta odio at tempus.{' '}
|
|
67
|
-
<span className="fw-bold">Aenean urna massa</span>, facilisis malesuada
|
|
68
|
-
eros at, rhoncus imperdiet nunc
|
|
69
|
-
</CardWithLeftIcon>
|
|
70
|
-
<h4 className="p-h4 mt24">Muted</h4>
|
|
71
|
-
<CardWithLeftIcon
|
|
72
|
-
state="muted"
|
|
73
|
-
title="Lorem ipsum"
|
|
74
|
-
cardSize="big"
|
|
75
|
-
className="wmx6 mt8"
|
|
76
|
-
rightIcon="arrow"
|
|
77
|
-
leftIcon={featherLogo}
|
|
78
|
-
>
|
|
79
|
-
Praesent euismod porta odio at tempus.{' '}
|
|
80
|
-
<span className="fw-bold">Aenean urna massa</span>, facilisis malesuada
|
|
81
|
-
eros at, rhoncus imperdiet nunc
|
|
82
|
-
</CardWithLeftIcon>
|
|
83
|
-
<h4 className="p-h4 mt24">No left icon and right icon</h4>
|
|
84
|
-
<CardWithLeftIcon title="Lorem ipsum" cardSize="big" className="wmx6 mt8">
|
|
85
|
-
Praesent euismod porta odio at tempus.{' '}
|
|
86
|
-
<span className="fw-bold">Aenean urna massa</span>, facilisis malesuada
|
|
87
|
-
eros at, rhoncus imperdiet nunc
|
|
88
|
-
</CardWithLeftIcon>
|
|
89
|
-
<h4 className="p-h4 mt24">No dropshadow</h4>
|
|
90
|
-
<CardWithLeftIcon
|
|
91
|
-
title="Lorem ipsum"
|
|
92
|
-
cardSize="medium"
|
|
93
|
-
className="wmx6 mt8"
|
|
94
|
-
rightIcon="arrow"
|
|
95
|
-
leftIcon={featherLogo}
|
|
96
|
-
dropshadow={false}
|
|
97
|
-
>
|
|
98
|
-
Praesent euismod porta odio at tempus.{' '}
|
|
99
|
-
<span className="fw-bold">Aenean urna massa</span>, facilisis malesuada
|
|
100
|
-
eros at, rhoncus imperdiet nunc
|
|
101
|
-
</CardWithLeftIcon>
|
|
102
|
-
</>
|
|
103
|
-
</Preview>
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { Meta, Preview } from '@storybook/addon-docs/blocks';
|
|
2
|
-
|
|
3
|
-
import CardWithTopIcon from '.';
|
|
4
|
-
import { featherLogo } from '../icons';
|
|
5
|
-
|
|
6
|
-
<Meta title="JSX/Cards/Card with top icon" />
|
|
7
|
-
|
|
8
|
-
# Card with top icon
|
|
9
|
-
|
|
10
|
-
| attribute | unit | description | default value | required |
|
|
11
|
-
| ---------- | ----------------------------------------------------------------------------------------- | ------------------------------------------------ | ------------- | -------- |
|
|
12
|
-
| title | string | The title text that needs to be displayed | n/a | true |
|
|
13
|
-
| cardSize | [Card Size (s,m,b)](?path=/story/jsx-cards-intro--page#card-size-xsmall-small-medium-big) | Size of the card | medium | false |
|
|
14
|
-
| topIcon | [Icon](?path=/story/jsx-cards-intro--page#icon) | Icon displayed on the top of the card | n/a | true |
|
|
15
|
-
| rightIcon | [Icon](?path=/story/jsx-cards-intro--page#icon) | Icon displayed on the right of the title | n/a | false |
|
|
16
|
-
| state | [Card State](?path=/story/jsx-cards-intro--page#card-state) | State that describe the interation with the card | actionable | false |
|
|
17
|
-
| dropshadow | boolean | If the card should have a box-shadow or not | true | false |
|
|
18
|
-
|
|
19
|
-
<Preview>
|
|
20
|
-
<>
|
|
21
|
-
<h4 className="p-h4">Small card</h4>
|
|
22
|
-
<CardWithTopIcon
|
|
23
|
-
title="Lorem ipsum"
|
|
24
|
-
cardSize="small"
|
|
25
|
-
className="wmx6 mt8"
|
|
26
|
-
rightIcon="arrow"
|
|
27
|
-
topIcon={featherLogo}
|
|
28
|
-
>
|
|
29
|
-
<p className="p-p mt16 tc-grey-600">
|
|
30
|
-
Praesent euismod porta odio at tempus.{' '}
|
|
31
|
-
<span className="fw-bold">Aenean urna massa</span>, facilisis malesuada
|
|
32
|
-
eros at, rhoncus imperdiet nunc
|
|
33
|
-
</p>
|
|
34
|
-
</CardWithTopIcon>
|
|
35
|
-
<h4 className="p-h4 mt24">Medium card</h4>
|
|
36
|
-
<CardWithTopIcon
|
|
37
|
-
title="Lorem ipsum"
|
|
38
|
-
cardSize="medium"
|
|
39
|
-
className="wmx6 mt8"
|
|
40
|
-
rightIcon="arrow"
|
|
41
|
-
topIcon={featherLogo}
|
|
42
|
-
>
|
|
43
|
-
<p className="p-p mt16 tc-grey-600">
|
|
44
|
-
Praesent euismod porta odio at tempus.{' '}
|
|
45
|
-
<span className="fw-bold">Aenean urna massa</span>, facilisis malesuada
|
|
46
|
-
eros at, rhoncus imperdiet nunc
|
|
47
|
-
</p>
|
|
48
|
-
</CardWithTopIcon>
|
|
49
|
-
<h4 className="p-h4 mt24">Big card</h4>
|
|
50
|
-
<CardWithTopIcon
|
|
51
|
-
title="Lorem ipsum"
|
|
52
|
-
cardSize="big"
|
|
53
|
-
className="wmx6 mt8"
|
|
54
|
-
rightIcon="arrow"
|
|
55
|
-
topIcon={featherLogo}
|
|
56
|
-
>
|
|
57
|
-
<p className="p-p mt16 tc-grey-600">
|
|
58
|
-
Praesent euismod porta odio at tempus.{' '}
|
|
59
|
-
<span className="fw-bold">Aenean urna massa</span>, facilisis malesuada
|
|
60
|
-
eros at, rhoncus imperdiet nunc
|
|
61
|
-
</p>
|
|
62
|
-
</CardWithTopIcon>
|
|
63
|
-
<h4 className="p-h4 mt24">Muted</h4>
|
|
64
|
-
<CardWithTopIcon
|
|
65
|
-
title="Lorem ipsum"
|
|
66
|
-
className="wmx6 mt8"
|
|
67
|
-
rightIcon="arrow"
|
|
68
|
-
topIcon={featherLogo}
|
|
69
|
-
state="muted"
|
|
70
|
-
>
|
|
71
|
-
<p className="p-p mt16 tc-grey-600">
|
|
72
|
-
Praesent euismod porta odio at tempus.{' '}
|
|
73
|
-
<span className="fw-bold">Aenean urna massa</span>, facilisis malesuada
|
|
74
|
-
eros at, rhoncus imperdiet nunc
|
|
75
|
-
</p>
|
|
76
|
-
</CardWithTopIcon>
|
|
77
|
-
<h4 className="p-h4 mt24">No right icon</h4>
|
|
78
|
-
<CardWithTopIcon
|
|
79
|
-
title="Lorem ipsum"
|
|
80
|
-
topIcon={featherLogo}
|
|
81
|
-
cardSize="small"
|
|
82
|
-
className="wmx6 mt8"
|
|
83
|
-
>
|
|
84
|
-
<p className="p-p mt16 tc-grey-600">
|
|
85
|
-
Praesent euismod porta odio at tempus.{' '}
|
|
86
|
-
<span className="fw-bold">Aenean urna massa</span>, facilisis malesuada
|
|
87
|
-
eros at, rhoncus imperdiet nunc
|
|
88
|
-
</p>
|
|
89
|
-
</CardWithTopIcon>
|
|
90
|
-
<h4 className="p-h4 mt24">No dropshadow</h4>
|
|
91
|
-
<CardWithTopIcon
|
|
92
|
-
title="Lorem ipsum"
|
|
93
|
-
topIcon={featherLogo}
|
|
94
|
-
cardSize="small"
|
|
95
|
-
className="wmx6 mt8"
|
|
96
|
-
dropshadow={false}
|
|
97
|
-
>
|
|
98
|
-
<p className="p-p mt16 tc-grey-600">
|
|
99
|
-
Praesent euismod porta odio at tempus.{' '}
|
|
100
|
-
<span className="fw-bold">Aenean urna massa</span>, facilisis malesuada
|
|
101
|
-
eros at, rhoncus imperdiet nunc
|
|
102
|
-
</p>
|
|
103
|
-
</CardWithTopIcon>
|
|
104
|
-
</>
|
|
105
|
-
</Preview>
|