@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.
Files changed (153) hide show
  1. package/dist/cjs/index.d.ts +1 -1
  2. package/dist/cjs/index.js +144 -121
  3. package/dist/cjs/index.js.map +1 -1
  4. package/dist/cjs/lib/components/cards/cardButton/index.d.ts +8 -8
  5. package/dist/cjs/lib/components/cards/cardButton/index.stories.d.ts +39 -0
  6. package/dist/cjs/lib/components/cards/cardWithLeftIcon/index.d.ts +6 -12
  7. package/dist/cjs/lib/components/cards/cardWithLeftIcon/index.stories.d.ts +55 -0
  8. package/dist/cjs/lib/components/cards/cardWithTopIcon/index.d.ts +5 -11
  9. package/dist/cjs/lib/components/cards/cardWithTopIcon/index.stories.d.ts +59 -0
  10. package/dist/cjs/lib/components/cards/cardWithTopLeftIcon/index.d.ts +6 -12
  11. package/dist/cjs/lib/components/cards/cardWithTopLeftIcon/index.stories.d.ts +49 -0
  12. package/dist/cjs/lib/components/cards/index.d.ts +5 -5
  13. package/dist/cjs/lib/components/cards/infoCard/index.d.ts +4 -10
  14. package/dist/cjs/lib/components/cards/infoCard/index.stories.d.ts +47 -0
  15. package/dist/cjs/lib/components/chip/index.d.ts +2 -1
  16. package/dist/cjs/lib/components/informationBox/index.d.ts +12 -0
  17. package/dist/cjs/lib/components/informationBox/index.stories.d.ts +35 -0
  18. package/dist/cjs/lib/components/informationBox/index.test.d.ts +1 -0
  19. package/dist/cjs/lib/components/input/index.d.ts +4 -5
  20. package/dist/cjs/lib/components/input/input.stories.d.ts +90 -0
  21. package/dist/cjs/lib/components/input/stories/config.d.ts +71 -0
  22. package/dist/cjs/lib/components/link/index.d.ts +2 -0
  23. package/dist/cjs/lib/components/link/index.stories.d.ts +26 -0
  24. package/dist/cjs/lib/index.d.ts +4 -2
  25. package/dist/esm/components/autocompleteAddress/index.js +1 -1
  26. package/dist/esm/components/autocompleteAddress/index.js.map +1 -1
  27. package/dist/esm/components/autocompleteAddress/index.test.js +1 -1
  28. package/dist/esm/components/cards/cardButton/index.js +1 -1
  29. package/dist/esm/components/cards/cardButton/index.stories.js +49 -0
  30. package/dist/esm/components/cards/cardButton/index.stories.js.map +1 -0
  31. package/dist/esm/components/cards/cardWithLeftIcon/index.js +1 -1
  32. package/dist/esm/components/cards/cardWithLeftIcon/index.stories.js +64 -0
  33. package/dist/esm/components/cards/cardWithLeftIcon/index.stories.js.map +1 -0
  34. package/dist/esm/components/cards/cardWithTopIcon/index.js +1 -1
  35. package/dist/esm/components/cards/cardWithTopIcon/index.stories.js +68 -0
  36. package/dist/esm/components/cards/cardWithTopIcon/index.stories.js.map +1 -0
  37. package/dist/esm/components/cards/cardWithTopLeftIcon/index.js +1 -1
  38. package/dist/esm/components/cards/cardWithTopLeftIcon/index.stories.js +57 -0
  39. package/dist/esm/components/cards/cardWithTopLeftIcon/index.stories.js.map +1 -0
  40. package/dist/esm/components/cards/index.js +9 -9
  41. package/dist/esm/components/cards/index.js.map +1 -1
  42. package/dist/esm/components/cards/infoCard/index.js +1 -1
  43. package/dist/esm/components/cards/infoCard/index.stories.js +58 -0
  44. package/dist/esm/components/cards/infoCard/index.stories.js.map +1 -0
  45. package/dist/esm/components/chip/index.js +2 -2
  46. package/dist/esm/components/chip/index.js.map +1 -1
  47. package/dist/esm/components/comparisonTable/components/AccordionItem/AccordionItem.js +1 -1
  48. package/dist/esm/components/comparisonTable/components/TableArrows/index.js +1 -1
  49. package/dist/esm/components/comparisonTable/components/TableButton/index.test.js +2 -2
  50. package/dist/esm/components/comparisonTable/components/TableInfoButton/index.js +1 -1
  51. package/dist/esm/components/comparisonTable/components/TableRowHeader/index.test.js +2 -2
  52. package/dist/esm/components/dateSelector/index.test.js +1 -1
  53. package/dist/esm/components/informationBox/index.js +19 -0
  54. package/dist/esm/components/informationBox/index.js.map +1 -0
  55. package/dist/esm/components/informationBox/index.stories.js +42 -0
  56. package/dist/esm/components/informationBox/index.stories.js.map +1 -0
  57. package/dist/esm/components/informationBox/index.test.js +49 -0
  58. package/dist/esm/components/informationBox/index.test.js.map +1 -0
  59. package/dist/esm/components/input/autoSuggestInput/index.js +1 -1
  60. package/dist/esm/components/input/autoSuggestInput/index.js.map +1 -1
  61. package/dist/esm/components/input/autoSuggestMultiSelect/index.js +13 -9
  62. package/dist/esm/components/input/autoSuggestMultiSelect/index.js.map +1 -1
  63. package/dist/esm/components/input/checkbox/index.test.js +1 -1
  64. package/dist/esm/components/input/currency/index.js +1 -1
  65. package/dist/esm/components/input/currency/index.js.map +1 -1
  66. package/dist/esm/components/input/currency/index.test.js +1 -1
  67. package/dist/esm/components/input/iban/index.js +1 -1
  68. package/dist/esm/components/input/iban/index.js.map +1 -1
  69. package/dist/esm/components/input/index.js +1 -1
  70. package/dist/esm/components/input/index.js.map +1 -1
  71. package/dist/esm/components/input/input.stories.js +85 -0
  72. package/dist/esm/components/input/input.stories.js.map +1 -0
  73. package/dist/esm/components/link/index.js +11 -0
  74. package/dist/esm/components/link/index.js.map +1 -0
  75. package/dist/esm/components/link/index.stories.js +33 -0
  76. package/dist/esm/components/link/index.stories.js.map +1 -0
  77. package/dist/esm/components/multiDropzone/index.test.js +2 -2
  78. package/dist/esm/components/segmentedControl/index.test.js +1 -1
  79. package/dist/esm/{customRender-4157fcff.js → customRender-20b5f7ec.js} +3 -3
  80. package/dist/esm/{customRender-4157fcff.js.map → customRender-20b5f7ec.js.map} +1 -1
  81. package/dist/esm/{extend-expect-46bdce4a.js → extend-expect-25e5049d.js} +2 -2
  82. package/dist/esm/{extend-expect-46bdce4a.js.map → extend-expect-25e5049d.js.map} +1 -1
  83. package/dist/esm/index-47663d39.js.map +1 -1
  84. package/dist/esm/index.d.ts +1 -1
  85. package/dist/esm/index.js +3 -1
  86. package/dist/esm/index.js.map +1 -1
  87. package/dist/esm/lib/components/cards/cardButton/index.d.ts +8 -8
  88. package/dist/esm/lib/components/cards/cardButton/index.stories.d.ts +39 -0
  89. package/dist/esm/lib/components/cards/cardWithLeftIcon/index.d.ts +6 -12
  90. package/dist/esm/lib/components/cards/cardWithLeftIcon/index.stories.d.ts +55 -0
  91. package/dist/esm/lib/components/cards/cardWithTopIcon/index.d.ts +5 -11
  92. package/dist/esm/lib/components/cards/cardWithTopIcon/index.stories.d.ts +59 -0
  93. package/dist/esm/lib/components/cards/cardWithTopLeftIcon/index.d.ts +6 -12
  94. package/dist/esm/lib/components/cards/cardWithTopLeftIcon/index.stories.d.ts +49 -0
  95. package/dist/esm/lib/components/cards/index.d.ts +5 -5
  96. package/dist/esm/lib/components/cards/infoCard/index.d.ts +4 -10
  97. package/dist/esm/lib/components/cards/infoCard/index.stories.d.ts +47 -0
  98. package/dist/esm/lib/components/chip/index.d.ts +2 -1
  99. package/dist/esm/lib/components/informationBox/index.d.ts +12 -0
  100. package/dist/esm/lib/components/informationBox/index.stories.d.ts +35 -0
  101. package/dist/esm/lib/components/informationBox/index.test.d.ts +1 -0
  102. package/dist/esm/lib/components/input/index.d.ts +4 -5
  103. package/dist/esm/lib/components/input/input.stories.d.ts +90 -0
  104. package/dist/esm/lib/components/input/stories/config.d.ts +71 -0
  105. package/dist/esm/lib/components/link/index.d.ts +2 -0
  106. package/dist/esm/lib/components/link/index.stories.d.ts +26 -0
  107. package/dist/esm/lib/index.d.ts +4 -2
  108. package/dist/esm/scss/public/demo.js +1 -1
  109. package/dist/esm/scss/public/demo.js.map +1 -1
  110. package/dist/esm/util/testUtils/customRender.js +1 -1
  111. package/dist/index.css +10 -10
  112. package/dist/lib/scss/public/colors/default.scss +2 -2
  113. package/dist/lib/scss/public/demo.tsx +1 -1
  114. package/package.json +1 -1
  115. package/src/index.tsx +2 -0
  116. package/src/lib/components/autocompleteAddress/index.tsx +1 -1
  117. package/src/lib/components/cards/cardButton/index.stories.tsx +61 -0
  118. package/src/lib/components/cards/cardButton/index.tsx +9 -10
  119. package/src/lib/components/cards/cardWithLeftIcon/index.stories.tsx +79 -0
  120. package/src/lib/components/cards/cardWithLeftIcon/index.tsx +8 -6
  121. package/src/lib/components/cards/cardWithTopIcon/index.stories.tsx +85 -0
  122. package/src/lib/components/cards/cardWithTopIcon/index.tsx +9 -7
  123. package/src/lib/components/cards/cardWithTopLeftIcon/index.stories.tsx +73 -0
  124. package/src/lib/components/cards/cardWithTopLeftIcon/index.tsx +8 -6
  125. package/src/lib/components/cards/index.tsx +5 -5
  126. package/src/lib/components/cards/infoCard/index.stories.tsx +71 -0
  127. package/src/lib/components/cards/infoCard/index.tsx +7 -5
  128. package/src/lib/components/chip/index.tsx +3 -1
  129. package/src/lib/components/informationBox/index.stories.tsx +51 -0
  130. package/src/lib/components/informationBox/index.test.tsx +55 -0
  131. package/src/lib/components/informationBox/index.tsx +65 -0
  132. package/src/lib/components/informationBox/info.svg +11 -0
  133. package/src/lib/components/informationBox/style.module.scss +62 -0
  134. package/src/lib/components/input/a.stories.mdx +2 -2
  135. package/src/lib/components/input/autoSuggestInput/index.tsx +1 -1
  136. package/src/lib/components/input/autoSuggestMultiSelect/index.tsx +29 -18
  137. package/src/lib/components/input/autoSuggestMultiSelect/style.module.scss +6 -0
  138. package/src/lib/components/input/currency/index.tsx +1 -1
  139. package/src/lib/components/input/iban/index.tsx +1 -1
  140. package/src/lib/components/input/index.tsx +4 -4
  141. package/src/lib/components/input/input.stories.tsx +48 -0
  142. package/src/lib/components/input/stories/config.ts +56 -0
  143. package/src/lib/components/link/index.stories.tsx +29 -0
  144. package/src/lib/components/link/index.tsx +9 -0
  145. package/src/lib/index.tsx +5 -1
  146. package/src/lib/scss/public/colors/default.scss +2 -2
  147. package/src/lib/scss/public/demo.tsx +1 -1
  148. package/src/lib/components/cards/cardButton/index.stories.mdx +0 -47
  149. package/src/lib/components/cards/cardWithLeftIcon/index.stories.mdx +0 -103
  150. package/src/lib/components/cards/cardWithTopIcon/index.stories.mdx +0 -105
  151. package/src/lib/components/cards/cardWithTopLeftIcon/index.stories.mdx +0 -101
  152. package/src/lib/components/cards/infoCard/index.stories.mdx +0 -61
  153. 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
- {selectedValues && selectedValues.length > 0 && (
31
- <div
32
- className={`mb8 ${styles['chip-container']} ${chipsListClassName}`}
33
- >
34
- {selectedValues.map((value, index) => (
35
- <Chip
36
- key={`${value.value}-${index}`}
37
- value={value}
38
- onRemove={(value: Option) => {
39
- const newValues = [...selectedValues].filter(
40
- (selectedValue) => selectedValue.value !== value.value
41
- );
42
- setValues(newValues);
43
- }}
44
- />
45
- ))}
46
- </div>
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}
@@ -1,4 +1,10 @@
1
1
  .chip-container {
2
2
  display: flex;
3
3
  flex-wrap: wrap;
4
+ max-height: 10px;
5
+ transition: 0.7s ease-in;
6
+ }
7
+
8
+ .appearIn {
9
+ max-height: 300px;
4
10
  }
@@ -1,7 +1,7 @@
1
1
  import { useEffect, useRef, useState } from 'react';
2
2
 
3
3
  import { formatInput, reverseFormatInput } from './format';
4
- import Input, { InputProps } from '..';
4
+ import { Input, InputProps } from '..';
5
5
 
6
6
  const CurrencyInput = ({
7
7
  value,
@@ -1,4 +1,4 @@
1
- import Input, { InputProps } from '..';
1
+ import { Input, InputProps } from '..';
2
2
 
3
3
  import { formatIban } from './formatIban';
4
4
 
@@ -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
- } & Omit<JSX.IntrinsicElements['input'], 'enterKeyHint'> &
15
- Partial<Pick<JSX.IntrinsicElements['input'], 'enterKeyHint'>>;
15
+ };
16
16
 
17
- export default React.forwardRef(
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;
@@ -0,0 +1,9 @@
1
+ import classnames from 'classnames';
2
+
3
+ export type LinkProps = JSX.IntrinsicElements['a'];
4
+
5
+ export const Link = ({ children, className, ...rest }: LinkProps) => (
6
+ <a className={classnames(className, 'p-a c-pointer')} {...rest}>
7
+ {children}
8
+ </a>
9
+ );
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: #e6e5ff !default;
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: #e6e5ff;
12
+ $ds-purple-100: #ebebff;
13
13
  $ds-purple-300: #b1b0f5;
14
14
  $ds-purple-500: #8e8cee;
15
15
  $ds-purple-700: #6160a2;
@@ -24,7 +24,7 @@ const colors = [
24
24
  {
25
25
  name: 'Primary 100',
26
26
  code: 'primary-100',
27
- hex: '#e6e5ff',
27
+ hex: '#ebebff',
28
28
  },
29
29
  {
30
30
  name: 'Primary 300',
@@ -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>