@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
@@ -30,7 +30,13 @@ const cardTextStyleFromCardSize = (
30
30
  }
31
31
  };
32
32
 
33
- export default ({
33
+ export type CardWithLeftIconProps = CardProps & {
34
+ cardSize?: 'xsmall' | 'small' | 'medium' | 'big';
35
+ leftIcon?: Icon;
36
+ rightIcon?: 'arrow' | Icon;
37
+ }
38
+
39
+ export const CardWithLeftIcon = ({
34
40
  className = '',
35
41
  title,
36
42
  cardSize = 'medium',
@@ -40,11 +46,7 @@ export default ({
40
46
  state = 'actionable',
41
47
  dropshadow = true,
42
48
  ...props
43
- }: CardProps & {
44
- cardSize?: 'xsmall' | 'small' | 'medium' | 'big';
45
- leftIcon?: Icon;
46
- rightIcon?: 'arrow' | Icon;
47
- }) => {
49
+ }: CardWithLeftIconProps) => {
48
50
  const cardStyle = `d-flex ai-center ${className} ${associatedClassForCardState(
49
51
  state,
50
52
  dropshadow
@@ -0,0 +1,85 @@
1
+ import { CardWithTopIcon, CardWithTopIconProps } from '.';
2
+ import { images } from '../../../util/images';
3
+
4
+ const story = {
5
+ title: 'JSX/Cards/CardWithTopIcon',
6
+ component: CardWithTopIcon,
7
+ argTypes: {
8
+ title: {
9
+ defaultValue: 'Lorem Ipsum',
10
+ description: 'Title text that needs to be displayed',
11
+ },
12
+ children: {
13
+ type: 'text',
14
+ defaultValue: 'Mountain or rock climbing, Bouldering, Martial arts, Extreme sports, Scuba diving, Sky diving, Bungee jumping, Mountain or rock climbing, Bouldering, Martial arts,',
15
+ description: 'Content that is displayed inside the card',
16
+ },
17
+ state: {
18
+ defaultValue: 'actionable',
19
+ description: 'State that describe the interation with the card',
20
+ },
21
+ topIcon: {
22
+ defaultValue: {
23
+ src: images.mortgage,
24
+ alt: 'Image alt'
25
+ },
26
+ description: 'Icon displayed on the top of the card.',
27
+ },
28
+ topIconSize: {
29
+ defaultValue: {
30
+ width: 48,
31
+ height: 48
32
+ },
33
+ description: 'Size of the top icon',
34
+ },
35
+ rightIcon: {
36
+ defaultValue: 'arrow',
37
+ description: 'Icon displayed on the top right corner of the card',
38
+ },
39
+ cardSize: {
40
+ control: { type: 'select' },
41
+ defaultValue: 'medium',
42
+ description: 'Size of the card'
43
+ },
44
+ dropshadow: {
45
+ defaultValue: true,
46
+ description: 'If the card should have a box-shadow or not',
47
+ },
48
+ className: {
49
+ defaultValue: 'ws6',
50
+ type: 'text',
51
+ description: 'Class name for most top parent element',
52
+ },
53
+ },
54
+ };
55
+
56
+ export const CardWithTopIconStory = ({
57
+ title,
58
+ dropshadow,
59
+ cardSize,
60
+ children,
61
+ className,
62
+ topIcon,
63
+ topIconSize,
64
+ rightIcon,
65
+ state,
66
+ }: CardWithTopIconProps) => (
67
+ <CardWithTopIcon
68
+ cardSize={cardSize}
69
+ className={className}
70
+ dropshadow={dropshadow}
71
+ state={state}
72
+ topIcon={topIcon}
73
+ topIconSize={topIconSize}
74
+ rightIcon={rightIcon}
75
+ title={title}
76
+ >
77
+ <p className="p-p mt16 tc-grey-600">
78
+ {children}
79
+ </p>
80
+ </CardWithTopIcon>
81
+ );
82
+
83
+ CardWithTopIconStory.storyName = "CardWithTopIcon";
84
+
85
+ export default story;
@@ -3,7 +3,14 @@ import { Icon, arrowRight, IconSize } from '../icons';
3
3
 
4
4
  import styles from './style.module.scss';
5
5
 
6
- export default ({
6
+ export type CardWithTopIconProps = CardProps & {
7
+ topIcon: Icon;
8
+ topIconSize: IconSize;
9
+ cardSize?: 'small' | 'medium' | 'big';
10
+ rightIcon?: 'arrow' | Icon;
11
+ };
12
+
13
+ export const CardWithTopIcon = ({
7
14
  className,
8
15
  title,
9
16
  cardSize = 'medium',
@@ -14,12 +21,7 @@ export default ({
14
21
  state = 'actionable',
15
22
  dropshadow = true,
16
23
  ...props
17
- }: CardProps & {
18
- topIcon: Icon;
19
- topIconSize: IconSize;
20
- cardSize?: 'small' | 'medium' | 'big';
21
- rightIcon?: 'arrow' | Icon;
22
- }) => {
24
+ }: CardWithTopIconProps) => {
23
25
  const cardStyle = `d-flex fd-column ai-center ${className} ${associatedClassForCardState(
24
26
  state,
25
27
  dropshadow
@@ -0,0 +1,73 @@
1
+ import { CardWithTopLeftIcon, CardWithTopLeftIconProps } from '.';
2
+ import { images } from '../../../util/images';
3
+
4
+ const story = {
5
+ title: 'JSX/Cards/CardWithTopLeftIcon',
6
+ component: CardWithTopLeftIcon,
7
+ argTypes: {
8
+ title: {
9
+ defaultValue: 'Lorem Ipsum',
10
+ description: 'Title text that needs to be displayed',
11
+ },
12
+ children: {
13
+ type: 'text',
14
+ defaultValue: 'Mountain or rock climbing, Bouldering, Martial arts, Extreme sports, Scuba diving, Sky diving, Bungee jumping, Mountain or rock climbing, Bouldering, Martial arts,',
15
+ description: 'Content that is displayed inside the card',
16
+ },
17
+ state: {
18
+ defaultValue: 'actionable',
19
+ description: 'State that describe the interation with the card',
20
+ },
21
+ leftIcon: {
22
+ defaultValue: 'logo',
23
+ description: 'Icon displayed on the left of the card.',
24
+ },
25
+ rightIcon: {
26
+ defaultValue: 'arrow',
27
+ description: 'Icon displayed on the top right corner of the card',
28
+ },
29
+ cardSize: {
30
+ control: { type: 'select' },
31
+ defaultValue: 'medium',
32
+ description: 'Size of the card'
33
+ },
34
+ dropshadow: {
35
+ defaultValue: true,
36
+ description: 'If the card should have a box-shadow or not',
37
+ },
38
+ className: {
39
+ defaultValue: '',
40
+ type: 'text',
41
+ description: 'Class name for most top parent element',
42
+ },
43
+ },
44
+ };
45
+
46
+ export const CardWithTopLeftIconStory = ({
47
+ title,
48
+ dropshadow,
49
+ children,
50
+ className,
51
+ cardSize,
52
+ leftIcon,
53
+ rightIcon,
54
+ state,
55
+ }: CardWithTopLeftIconProps) => {
56
+ return (
57
+ <CardWithTopLeftIcon
58
+ cardSize={cardSize}
59
+ className={className}
60
+ dropshadow={dropshadow}
61
+ state={state}
62
+ leftIcon={leftIcon}
63
+ rightIcon={rightIcon}
64
+ title={title}
65
+ >
66
+ {children}
67
+ </CardWithTopLeftIcon>
68
+ );
69
+ }
70
+
71
+ CardWithTopLeftIconStory.storyName = "CardWithTopLeftIcon";
72
+
73
+ export default story;
@@ -18,7 +18,13 @@ const containerStyleFromTitleSize = (
18
18
  }
19
19
  };
20
20
 
21
- export default ({
21
+ export type CardWithTopLeftIconProps = CardProps & {
22
+ cardSize?: 'xsmall' | 'small' | 'medium' | 'big';
23
+ leftIcon?: 'logo' | Icon;
24
+ rightIcon?: 'arrow' | Icon;
25
+ };
26
+
27
+ export const CardWithTopLeftIcon = ({
22
28
  className,
23
29
  title,
24
30
  cardSize = 'medium',
@@ -28,11 +34,7 @@ export default ({
28
34
  state = 'actionable',
29
35
  dropshadow = true,
30
36
  ...props
31
- }: CardProps & {
32
- cardSize?: 'xsmall' | 'small' | 'medium' | 'big';
33
- leftIcon?: 'logo' | Icon;
34
- rightIcon?: 'arrow' | Icon;
35
- }) => {
37
+ }: CardWithTopLeftIconProps) => {
36
38
  const cardStyle = `${className} ${associatedClassForCardState(
37
39
  state,
38
40
  dropshadow
@@ -1,8 +1,8 @@
1
- import CardWithTopLeftIcon from './cardWithTopLeftIcon';
2
- import CardWithLeftIcon from './cardWithLeftIcon';
3
- import CardWithTopIcon from './cardWithTopIcon';
4
- import InfoCard from './infoCard';
5
- import CardButton from './cardButton';
1
+ import { CardWithTopLeftIcon } from './cardWithTopLeftIcon';
2
+ import { CardWithLeftIcon } from './cardWithLeftIcon';
3
+ import { CardWithTopIcon } from './cardWithTopIcon';
4
+ import { InfoCard } from './infoCard';
5
+ import { CardButton } from './cardButton';
6
6
 
7
7
  type CardState = 'actionable' | 'static' | 'muted';
8
8
 
@@ -0,0 +1,71 @@
1
+ import { InfoCard, InfoCardProps } from '.';
2
+ import { images } from '../../../util/images';
3
+
4
+ const story = {
5
+ title: 'JSX/Cards/InfoCard',
6
+ component: InfoCard,
7
+ argTypes: {
8
+ title: {
9
+ defaultValue: 'Lorem Ipsum',
10
+ description: 'Title text that needs to be displayed',
11
+ },
12
+ children: {
13
+ type: 'text',
14
+ defaultValue: 'Mountain or rock climbing, Bouldering, Martial arts, Extreme sports, Scuba diving, Sky diving, Bungee jumping, Mountain or rock climbing, Bouldering, Martial arts,',
15
+ description: 'Content that is displayed inside the card',
16
+ },
17
+ state: {
18
+ defaultValue: 'actionable',
19
+ description: 'State that describe the interation with the card',
20
+ },
21
+ topIcon: {
22
+ defaultValue: {
23
+ src: images.mortgage,
24
+ alt: 'Image alt'
25
+ },
26
+ description: 'Icon displayed on the top of the card, inside the purple circle',
27
+ },
28
+ rightIcon: {
29
+ defaultValue: {
30
+ src: images.washingMachine,
31
+ alt: 'Icon alt'
32
+ },
33
+ description: 'Icon displayed on the top right corner of the card',
34
+ },
35
+ dropshadow: {
36
+ defaultValue: true,
37
+ description: 'If the card should have a box-shadow or not',
38
+ },
39
+ className: {
40
+ defaultValue: '',
41
+ description: 'Class name for most top parent element',
42
+ },
43
+ },
44
+ };
45
+
46
+ export const InfoCardStory = ({
47
+ title,
48
+ dropshadow,
49
+ children,
50
+ className,
51
+ rightIcon,
52
+ state,
53
+ topIcon
54
+ }: InfoCardProps) => {
55
+ return (
56
+ <InfoCard
57
+ className={className}
58
+ dropshadow={dropshadow}
59
+ state={state}
60
+ rightIcon={rightIcon}
61
+ title={title}
62
+ topIcon={topIcon}
63
+ >
64
+ {children}
65
+ </InfoCard>
66
+ );
67
+ }
68
+
69
+ InfoCardStory.storyName = "InfoCard";
70
+
71
+ export default story;
@@ -3,7 +3,12 @@ import { Icon, info } from '../icons';
3
3
 
4
4
  import styles from './style.module.scss';
5
5
 
6
- export default ({
6
+ export type InfoCardProps = CardProps & {
7
+ topIcon: Icon;
8
+ rightIcon?: 'info' | Icon;
9
+ };
10
+
11
+ export const InfoCard = ({
7
12
  className,
8
13
  title,
9
14
  children,
@@ -12,10 +17,7 @@ export default ({
12
17
  state = 'actionable',
13
18
  dropshadow = true,
14
19
  ...props
15
- }: CardProps & {
16
- topIcon: Icon;
17
- rightIcon?: 'info' | Icon;
18
- }) => (
20
+ }: InfoCardProps) => (
19
21
  <div className={`${styles['root-container']} ${className ?? ''}`} {...props}>
20
22
  <img
21
23
  src={topIcon.src}
@@ -4,13 +4,15 @@ import removeButtonHighlightedIcon from './icons/remove-button-highlighted.svg';
4
4
  import { Option } from '../../models/autoSuggestInput';
5
5
 
6
6
  export default ({
7
+ className,
7
8
  value,
8
9
  onRemove,
9
10
  }: {
10
11
  value: Option;
11
12
  onRemove: (value: Option) => void;
13
+ className?: string;
12
14
  }) => (
13
- <div className={`p-p mr8 mb8 d-flex ${styles['chip']}`}>
15
+ <div className={`p-p mr8 mb8 d-flex ${className} ${styles['chip']}`}>
14
16
  {value.leftIcon && (
15
17
  <img
16
18
  className={`mr8 ${styles['chip-image']}`}
@@ -0,0 +1,51 @@
1
+ import { InformationBox, InformationBoxProps } from '.';
2
+
3
+ const story = {
4
+ title: 'JSX/InformationBox',
5
+ component: InformationBox,
6
+ argTypes: {
7
+ children: {
8
+ control: { type: 'text' },
9
+ defaultValue: 'It seems that you already have an account with us! Sign in now',
10
+ description: 'Content that is displayed inside the information box',
11
+ },
12
+ title: {
13
+ defaultValue: 'Log in to your account',
14
+ description: 'Title of the information box',
15
+ },
16
+ showIcon: {
17
+ defaultValue: false,
18
+ description: 'Whether or not to show the info icon',
19
+ },
20
+ size: {
21
+ defaultValue: 'default',
22
+ description: 'Size to display the component',
23
+ },
24
+ variant: {
25
+ defaultValue: 'information',
26
+ description: 'Variant that defines the style of the InformationBox',
27
+ },
28
+ }
29
+ };
30
+
31
+ export const InformationBoxStory = ({
32
+ children,
33
+ showIcon,
34
+ title,
35
+ size,
36
+ variant,
37
+ }: InformationBoxProps) => (
38
+ <div className='wmx6'>
39
+ <InformationBox
40
+ children={children}
41
+ showIcon={showIcon}
42
+ title={title}
43
+ size={size}
44
+ variant={variant}
45
+ />
46
+ </div>
47
+ );
48
+
49
+ InformationBoxStory.storyName = "InformationBox";
50
+
51
+ export default story;
@@ -0,0 +1,55 @@
1
+ import { render, screen } from '../../util/testUtils';
2
+
3
+ import { InformationBox } from '.';
4
+
5
+ describe('InformationBox component', () => {
6
+ it('Should render title', async () => {
7
+ render(
8
+ <InformationBox title={'Title'}>
9
+ Content
10
+ </InformationBox>
11
+ )
12
+
13
+ expect(screen.getByText('Title')).toBeInTheDocument();
14
+ });
15
+
16
+ it('Should not render title when title prop is not passed', async () => {
17
+ render(
18
+ <InformationBox>
19
+ Content
20
+ </InformationBox>
21
+ )
22
+
23
+ expect(screen.queryByTestId('information-box-title')).not.toBeInTheDocument();
24
+ });
25
+
26
+ it('Should render content', async () => {
27
+ render(
28
+ <InformationBox>
29
+ Content
30
+ </InformationBox>
31
+ )
32
+
33
+ expect(screen.getByText('Content')).toBeInTheDocument();
34
+ });
35
+
36
+ it('Should show icon when showIcon is true', async () => {
37
+ render(
38
+ <InformationBox showIcon>
39
+ Content
40
+ </InformationBox>
41
+ )
42
+
43
+ expect(screen.getByTestId('information-box-icon')).toBeInTheDocument();
44
+ });
45
+
46
+ it('Should not show icon when showIcon is false', async () => {
47
+ render(
48
+ <InformationBox showIcon={false}>
49
+ Content
50
+ </InformationBox>
51
+ )
52
+
53
+ expect(screen.queryByTestId('information-box-icon')).not.toBeInTheDocument();
54
+ });
55
+ });
@@ -0,0 +1,65 @@
1
+ import { ReactNode } from 'react';
2
+ import classNames from 'classnames';
3
+ import styles from './style.module.scss';
4
+
5
+ type Variant = 'warning' | 'error' | 'success' | 'information' | 'neutral';
6
+
7
+ export interface InformationBoxProps {
8
+ className?: string;
9
+ variant?: Variant;
10
+ title?: string;
11
+ children: ReactNode;
12
+ showIcon?: boolean;
13
+ size?: 'default' | 'small';
14
+ }
15
+
16
+ const InformationBox = ({
17
+ className = '',
18
+ variant = 'information',
19
+ title,
20
+ children,
21
+ showIcon,
22
+ size = 'default'
23
+ }: InformationBoxProps) => (
24
+ <div
25
+ className={classNames(
26
+ className,
27
+ 'p16 br8 color-black',
28
+ styles.informationBox,
29
+ styles[`informationBox--${variant}`]
30
+ )}
31
+ role="alert"
32
+ >
33
+ <div className='d-flex'>
34
+ {showIcon &&
35
+ <span
36
+ data-testid="information-box-icon"
37
+ className={classNames(
38
+ styles.icon,
39
+ styles[`icon--${variant}`],
40
+ 'mr8'
41
+ )}
42
+ />
43
+ }
44
+ <div>
45
+ {title && (
46
+ <h4
47
+ data-testid="information-box-title"
48
+ className={classNames(
49
+ size === 'default'? 'p-h4' : 'p-h5',
50
+ 'mb8'
51
+ )}
52
+ >
53
+ {title}
54
+ </h4>
55
+ )}
56
+
57
+ <p className={size === 'default' ? 'p-p' : 'p-p--small'}>
58
+ {children}
59
+ </p>
60
+ </div>
61
+ </div>
62
+ </div>
63
+ );
64
+
65
+ export { InformationBox };
@@ -0,0 +1,11 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none">
2
+ <g clip-path="url(#a)">
3
+ <path stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10ZM12 16v-4"/>
4
+ <circle cx="12" cy="8" r="1" fill="#000"/>
5
+ </g>
6
+ <defs>
7
+ <clipPath id="a">
8
+ <path fill="#fff" d="M0 0h24v24H0z"/>
9
+ </clipPath>
10
+ </defs>
11
+ </svg>
@@ -0,0 +1,62 @@
1
+
2
+ @use "../../scss/public/colors" as *;
3
+
4
+ .informationBox {
5
+ border: 1px solid;
6
+
7
+ &--information {
8
+ background-color: $ds-blue-100;
9
+ border-color: $ds-blue-500;
10
+ }
11
+
12
+ &--error {
13
+ background-color: $ds-red-100;
14
+ border-color: $ds-red-500;
15
+ }
16
+
17
+ &--warning {
18
+ background-color: $ds-yellow-100;
19
+ border-color: $ds-yellow-500;
20
+ }
21
+
22
+ &--success {
23
+ background-color: $ds-green-100;
24
+ border-color: $ds-green-500;
25
+ }
26
+
27
+ &--neutral {
28
+ background-color: $ds-white;
29
+ border-color: $ds-white;
30
+ }
31
+ }
32
+
33
+ .icon {
34
+ display: inline-block;
35
+ width: 24px;
36
+ height: 24px;
37
+
38
+ mask-image: url('./info.svg');
39
+ mask-size: contain;
40
+ mask-repeat: no-repeat;
41
+ mask-position: center;
42
+
43
+ &--information {
44
+ background-color: $ds-blue-500;
45
+ }
46
+
47
+ &--error {
48
+ background-color: $ds-red-500;
49
+ }
50
+
51
+ &--warning {
52
+ background-color: $ds-yellow-500;
53
+ }
54
+
55
+ &--success {
56
+ background-color: $ds-green-500;
57
+ }
58
+
59
+ &--neutral {
60
+ background-color: $ds-primary-500;
61
+ }
62
+ }
@@ -1,6 +1,6 @@
1
1
  import { Meta, Story, Preview } from '@storybook/addon-docs/blocks';
2
2
 
3
- import Input from '.';
3
+ import { Input } from '.';
4
4
 
5
5
  <Meta title="JSX/Inputs/Intro" />
6
6
 
@@ -10,7 +10,7 @@ Input elements are used to gather information from users.
10
10
 
11
11
  We have defined a few different input components according to the use case:
12
12
 
13
- - A default [Input](?path=/story/jsx-inputs-input--page) component
13
+ - A default [Input](?path=/story/jsx-inputs-input--input-story) component
14
14
  - A [Currency Input](?path=/story/jsx-inputs-currency-input--page) component that is meant to be used for entering amount in Euro
15
15
  - An [Iban Input](?path=/story/jsx-inputs-iban-input--page) that is meant to be used when entering banking informations.
16
16
  - A [AutoSuggestInput]() component allows quick search via the input field to find an option for selection.
@@ -3,7 +3,7 @@ import Autosuggest, { RenderInputComponentProps } from 'react-autosuggest';
3
3
 
4
4
  import styles from './style.module.scss';
5
5
  import { Option } from '../../../models/autoSuggestInput';
6
- import Input, { InputProps } from '../index';
6
+ import { Input, InputProps } from '../index';
7
7
 
8
8
  export default ({
9
9
  currentOption,