@popsure/dirty-swan 0.33.4 → 0.34.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 (139) hide show
  1. package/dist/cjs/index.js +25 -18
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/lib/components/cards/cardButton/index.d.ts +8 -8
  4. package/dist/cjs/lib/components/cards/cardButton/index.stories.d.ts +39 -0
  5. package/dist/cjs/lib/components/cards/cardWithLeftIcon/index.d.ts +6 -12
  6. package/dist/cjs/lib/components/cards/cardWithLeftIcon/index.stories.d.ts +55 -0
  7. package/dist/cjs/lib/components/cards/cardWithTopIcon/index.d.ts +5 -11
  8. package/dist/cjs/lib/components/cards/cardWithTopIcon/index.stories.d.ts +59 -0
  9. package/dist/cjs/lib/components/cards/cardWithTopLeftIcon/index.d.ts +6 -12
  10. package/dist/cjs/lib/components/cards/cardWithTopLeftIcon/index.stories.d.ts +49 -0
  11. package/dist/cjs/lib/components/cards/index.d.ts +5 -5
  12. package/dist/cjs/lib/components/cards/infoCard/index.d.ts +4 -10
  13. package/dist/cjs/lib/components/cards/infoCard/index.stories.d.ts +47 -0
  14. package/dist/cjs/lib/components/dateSelector/index.d.ts +11 -11
  15. package/dist/cjs/lib/components/dateSelector/index.stories.d.ts +65 -0
  16. package/dist/cjs/lib/components/input/index.d.ts +4 -5
  17. package/dist/cjs/lib/components/input/input.stories.d.ts +90 -0
  18. package/dist/cjs/lib/components/input/stories/config.d.ts +71 -0
  19. package/dist/cjs/lib/components/multiDropzone/index.d.ts +4 -4
  20. package/dist/cjs/lib/components/multiDropzone/index.stories.d.ts +72 -0
  21. package/dist/cjs/lib/index.d.ts +3 -3
  22. package/dist/cjs/lib/util/images/index.d.ts +7 -0
  23. package/dist/esm/components/autocompleteAddress/index.js +1 -1
  24. package/dist/esm/components/autocompleteAddress/index.js.map +1 -1
  25. package/dist/esm/components/cards/cardButton/index.js +1 -1
  26. package/dist/esm/components/cards/cardButton/index.stories.js +49 -0
  27. package/dist/esm/components/cards/cardButton/index.stories.js.map +1 -0
  28. package/dist/esm/components/cards/cardWithLeftIcon/index.js +1 -1
  29. package/dist/esm/components/cards/cardWithLeftIcon/index.stories.js +64 -0
  30. package/dist/esm/components/cards/cardWithLeftIcon/index.stories.js.map +1 -0
  31. package/dist/esm/components/cards/cardWithTopIcon/index.js +1 -1
  32. package/dist/esm/components/cards/cardWithTopIcon/index.stories.js +68 -0
  33. package/dist/esm/components/cards/cardWithTopIcon/index.stories.js.map +1 -0
  34. package/dist/esm/components/cards/cardWithTopLeftIcon/index.js +1 -1
  35. package/dist/esm/components/cards/cardWithTopLeftIcon/index.stories.js +57 -0
  36. package/dist/esm/components/cards/cardWithTopLeftIcon/index.stories.js.map +1 -0
  37. package/dist/esm/components/cards/index.js +9 -9
  38. package/dist/esm/components/cards/index.js.map +1 -1
  39. package/dist/esm/components/cards/infoCard/index.js +1 -1
  40. package/dist/esm/components/cards/infoCard/index.stories.js +58 -0
  41. package/dist/esm/components/cards/infoCard/index.stories.js.map +1 -0
  42. package/dist/esm/components/comparisonTable/components/AccordionItem/AccordionItem.js +1 -1
  43. package/dist/esm/components/comparisonTable/components/TableArrows/index.js +1 -1
  44. package/dist/esm/components/comparisonTable/components/TableInfoButton/index.js +1 -1
  45. package/dist/esm/components/dateSelector/index.js +6 -2179
  46. package/dist/esm/components/dateSelector/index.js.map +1 -1
  47. package/dist/esm/components/dateSelector/index.stories.js +92 -0
  48. package/dist/esm/components/dateSelector/index.stories.js.map +1 -0
  49. package/dist/esm/components/dateSelector/index.test.js +1 -1
  50. package/dist/esm/components/dateSelector/index.test.js.map +1 -1
  51. package/dist/esm/components/input/autoSuggestInput/index.js +1 -1
  52. package/dist/esm/components/input/autoSuggestInput/index.js.map +1 -1
  53. package/dist/esm/components/input/checkbox/index.stories.js +1 -1
  54. package/dist/esm/components/input/currency/index.js +1 -1
  55. package/dist/esm/components/input/currency/index.js.map +1 -1
  56. package/dist/esm/components/input/iban/index.js +1 -1
  57. package/dist/esm/components/input/iban/index.js.map +1 -1
  58. package/dist/esm/components/input/index.js +1 -1
  59. package/dist/esm/components/input/index.js.map +1 -1
  60. package/dist/esm/components/input/input.stories.js +85 -0
  61. package/dist/esm/components/input/input.stories.js.map +1 -0
  62. package/dist/esm/components/multiDropzone/index.js +3 -3
  63. package/dist/esm/components/multiDropzone/index.js.map +1 -1
  64. package/dist/esm/components/multiDropzone/index.stories.js +147 -0
  65. package/dist/esm/components/multiDropzone/index.stories.js.map +1 -0
  66. package/dist/esm/components/multiDropzone/index.test.js +2 -2
  67. package/dist/esm/components/multiDropzone/index.test.js.map +1 -1
  68. package/dist/esm/{index-e81a1766.js → index-31224f74.js} +8 -1
  69. package/dist/esm/index-31224f74.js.map +1 -0
  70. package/dist/esm/index-47663d39.js.map +1 -1
  71. package/dist/esm/index-639cf8b3.js +2179 -0
  72. package/dist/esm/index-639cf8b3.js.map +1 -0
  73. package/dist/esm/index.js +4 -4
  74. package/dist/esm/lib/components/cards/cardButton/index.d.ts +8 -8
  75. package/dist/esm/lib/components/cards/cardButton/index.stories.d.ts +39 -0
  76. package/dist/esm/lib/components/cards/cardWithLeftIcon/index.d.ts +6 -12
  77. package/dist/esm/lib/components/cards/cardWithLeftIcon/index.stories.d.ts +55 -0
  78. package/dist/esm/lib/components/cards/cardWithTopIcon/index.d.ts +5 -11
  79. package/dist/esm/lib/components/cards/cardWithTopIcon/index.stories.d.ts +59 -0
  80. package/dist/esm/lib/components/cards/cardWithTopLeftIcon/index.d.ts +6 -12
  81. package/dist/esm/lib/components/cards/cardWithTopLeftIcon/index.stories.d.ts +49 -0
  82. package/dist/esm/lib/components/cards/index.d.ts +5 -5
  83. package/dist/esm/lib/components/cards/infoCard/index.d.ts +4 -10
  84. package/dist/esm/lib/components/cards/infoCard/index.stories.d.ts +47 -0
  85. package/dist/esm/lib/components/dateSelector/index.d.ts +11 -11
  86. package/dist/esm/lib/components/dateSelector/index.stories.d.ts +65 -0
  87. package/dist/esm/lib/components/input/index.d.ts +4 -5
  88. package/dist/esm/lib/components/input/input.stories.d.ts +90 -0
  89. package/dist/esm/lib/components/input/stories/config.d.ts +71 -0
  90. package/dist/esm/lib/components/multiDropzone/index.d.ts +4 -4
  91. package/dist/esm/lib/components/multiDropzone/index.stories.d.ts +72 -0
  92. package/dist/esm/lib/index.d.ts +3 -3
  93. package/dist/esm/lib/util/images/index.d.ts +7 -0
  94. package/dist/esm/scss/public/demo.js +1 -1
  95. package/dist/esm/scss/public/demo.js.map +1 -1
  96. package/dist/esm/util/images/index.stories.js +1 -1
  97. package/dist/index.css +10 -10
  98. package/dist/lib/scss/public/colors/default.scss +2 -2
  99. package/dist/lib/scss/public/demo.tsx +1 -1
  100. package/package.json +1 -1
  101. package/src/App.tsx +1 -1
  102. package/src/lib/components/autocompleteAddress/index.tsx +1 -1
  103. package/src/lib/components/cards/cardButton/index.stories.tsx +61 -0
  104. package/src/lib/components/cards/cardButton/index.tsx +9 -10
  105. package/src/lib/components/cards/cardWithLeftIcon/index.stories.tsx +79 -0
  106. package/src/lib/components/cards/cardWithLeftIcon/index.tsx +8 -6
  107. package/src/lib/components/cards/cardWithTopIcon/index.stories.tsx +85 -0
  108. package/src/lib/components/cards/cardWithTopIcon/index.tsx +9 -7
  109. package/src/lib/components/cards/cardWithTopLeftIcon/index.stories.tsx +73 -0
  110. package/src/lib/components/cards/cardWithTopLeftIcon/index.tsx +8 -6
  111. package/src/lib/components/cards/index.tsx +5 -5
  112. package/src/lib/components/cards/infoCard/index.stories.tsx +71 -0
  113. package/src/lib/components/cards/infoCard/index.tsx +7 -5
  114. package/src/lib/components/dateSelector/index.stories.tsx +104 -0
  115. package/src/lib/components/dateSelector/index.test.tsx +2 -2
  116. package/src/lib/components/dateSelector/index.tsx +14 -14
  117. package/src/lib/components/input/a.stories.mdx +2 -2
  118. package/src/lib/components/input/autoSuggestInput/index.tsx +1 -1
  119. package/src/lib/components/input/currency/index.tsx +1 -1
  120. package/src/lib/components/input/iban/index.tsx +1 -1
  121. package/src/lib/components/input/index.tsx +4 -4
  122. package/src/lib/components/input/input.stories.tsx +48 -0
  123. package/src/lib/components/input/stories/config.ts +56 -0
  124. package/src/lib/components/multiDropzone/index.stories.tsx +228 -0
  125. package/src/lib/components/multiDropzone/index.test.tsx +1 -1
  126. package/src/lib/components/multiDropzone/index.tsx +6 -6
  127. package/src/lib/index.tsx +4 -3
  128. package/src/lib/scss/public/colors/default.scss +2 -2
  129. package/src/lib/scss/public/demo.tsx +1 -1
  130. package/src/lib/util/images/index.ts +7 -0
  131. package/dist/esm/index-e81a1766.js.map +0 -1
  132. package/src/lib/components/cards/cardButton/index.stories.mdx +0 -47
  133. package/src/lib/components/cards/cardWithLeftIcon/index.stories.mdx +0 -103
  134. package/src/lib/components/cards/cardWithTopIcon/index.stories.mdx +0 -105
  135. package/src/lib/components/cards/cardWithTopLeftIcon/index.stories.mdx +0 -101
  136. package/src/lib/components/cards/infoCard/index.stories.mdx +0 -61
  137. package/src/lib/components/dateSelector/index.stories.mdx +0 -106
  138. package/src/lib/components/input/index.stories.mdx +0 -108
  139. package/src/lib/components/multiDropzone/index.stories.mdx +0 -187
@@ -1,101 +0,0 @@
1
- import { Meta, Preview } from '@storybook/addon-docs/blocks';
2
-
3
- import CardWithTopLeftIcon from '.';
4
- import { featherLogo } from '../icons';
5
-
6
- <Meta title="JSX/Cards/Card with top left icon" />
7
-
8
- # Card with top 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
- | topIcon | [Icon](?path=/story/jsx-cards-intro--page#icon) | Icon displayed on the left of the title | n/a | false |
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">Extra small card</h4>
22
- <CardWithTopLeftIcon
23
- title="Lorem ipsum"
24
- cardSize="xsmall"
25
- className="wmx6 mt8"
26
- rightIcon="arrow"
27
- leftIcon={featherLogo}
28
- >
29
- Praesent euismod porta odio at tempus.{' '}
30
- <span className="fw-bold">Aenean urna massa</span>, facilisis malesuada
31
- eros at, rhoncus imperdiet nunc
32
- </CardWithTopLeftIcon>
33
- <h4 className="p-h4 mt24">Small card</h4>
34
- <CardWithTopLeftIcon
35
- title="Lorem ipsum"
36
- cardSize="small"
37
- className="wmx6 mt8"
38
- rightIcon="arrow"
39
- leftIcon={featherLogo}
40
- >
41
- Praesent euismod porta odio at tempus.{' '}
42
- <span className="fw-bold">Aenean urna massa</span>, facilisis malesuada
43
- eros at, rhoncus imperdiet nunc
44
- </CardWithTopLeftIcon>
45
- <h4 className="p-h4 mt24">Medium card</h4>
46
- <CardWithTopLeftIcon
47
- title="Lorem ipsum"
48
- cardSize="medium"
49
- className="wmx6 mt8"
50
- rightIcon="arrow"
51
- leftIcon={featherLogo}
52
- >
53
- Praesent euismod porta odio at tempus.{' '}
54
- <span className="fw-bold">Aenean urna massa</span>, facilisis malesuada
55
- eros at, rhoncus imperdiet nunc
56
- </CardWithTopLeftIcon>
57
- <h4 className="p-h4 mt24">Big card</h4>
58
- <CardWithTopLeftIcon
59
- title="Lorem ipsum"
60
- cardSize="big"
61
- className="wmx6 mt8"
62
- rightIcon="arrow"
63
- leftIcon={featherLogo}
64
- >
65
- Praesent euismod porta odio at tempus.{' '}
66
- <span className="fw-bold">Aenean urna massa</span>, facilisis malesuada
67
- eros at, rhoncus imperdiet nunc
68
- </CardWithTopLeftIcon>
69
- <h4 className="p-h4 mt24">Muted</h4>
70
- <CardWithTopLeftIcon
71
- title="Lorem ipsum"
72
- state="muted"
73
- className="wmx6 mt8"
74
- rightIcon="arrow"
75
- leftIcon={featherLogo}
76
- >
77
- Praesent euismod porta odio at tempus.{' '}
78
- <span className="fw-bold">Aenean urna massa</span>, facilisis malesuada
79
- eros at, rhoncus imperdiet nunc
80
- </CardWithTopLeftIcon>
81
- <h4 className="p-h4 mt24">No right icon or left icon</h4>
82
- <CardWithTopLeftIcon title="Lorem ipsum" className="wmx6 mt8">
83
- Praesent euismod porta odio at tempus.{' '}
84
- <span className="fw-bold">Aenean urna massa</span>, facilisis malesuada
85
- eros at, rhoncus imperdiet nunc
86
- </CardWithTopLeftIcon>
87
- <h4 className="p-h4">No dropshadow</h4>
88
- <CardWithTopLeftIcon
89
- title="Lorem ipsum"
90
- cardSize="medium"
91
- className="wmx6 mt8"
92
- rightIcon="arrow"
93
- leftIcon={featherLogo}
94
- dropshadow={false}
95
- >
96
- Praesent euismod porta odio at tempus.{' '}
97
- <span className="fw-bold">Aenean urna massa</span>, facilisis malesuada
98
- eros at, rhoncus imperdiet nunc
99
- </CardWithTopLeftIcon>
100
- </>
101
- </Preview>
@@ -1,61 +0,0 @@
1
- import { Meta, Preview } from '@storybook/addon-docs/blocks';
2
-
3
- import InfoCard from '.';
4
- import { featherLogo } from '../icons';
5
-
6
- <Meta title="JSX/Cards/Info card" />
7
-
8
- # Info card
9
-
10
- | attribute | unit | description | default value | required |
11
- | ---------- | ----------------------------------------------------------- | --------------------------------------------------------------- | ------------- | -------- |
12
- | title | string | The title text that needs to be displayed | n/a | true |
13
- | topIcon | [Icon](?path=/story/jsx-cards-intro--page#icon) | Icon displayed on the top of the card, inside the purple circle | n/a | true |
14
- | rightIcon | [Icon](?path=/story/jsx-cards-intro--page#icon) | Icon displayed on the top right corner of the card | n/a | false |
15
- | state | [Card State](?path=/story/jsx-cards-intro--page#card-state) | State that describe the interation with the card | actionable | false |
16
- | dropshadow | boolean | If the card should have a box-shadow or not | true | false |
17
-
18
- <Preview>
19
- <>
20
- <h4 className="p-h4">With right icon</h4>
21
- <InfoCard
22
- className="wmx6 mt8"
23
- title="Lorem ipsum"
24
- rightIcon="info"
25
- topIcon={featherLogo}
26
- >
27
- Praesent euismod porta odio at tempus.{' '}
28
- <span className="fw-bold">Aenean urna massa</span>, facilisis malesuada
29
- eros at, rhoncus imperdiet nunc
30
- </InfoCard>
31
- <h4 className="p-h4 mt24">Without right icon</h4>
32
- <InfoCard className="wmx6 mt8" title="Lorem ipsum" topIcon={featherLogo}>
33
- Praesent euismod porta odio at tempus.{' '}
34
- <span className="fw-bold">Aenean urna massa</span>, facilisis malesuada
35
- eros at, rhoncus imperdiet nunc
36
- </InfoCard>
37
- <h4 className="p-h4 mt24">Muted</h4>
38
- <InfoCard
39
- className="wmx6 mt8"
40
- title="Lorem ipsum"
41
- topIcon={featherLogo}
42
- state="muted"
43
- >
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
- </InfoCard>
48
- <h4 className="p-h4">No dropshadow</h4>
49
- <InfoCard
50
- className="wmx6 mt8"
51
- title="Lorem ipsum"
52
- rightIcon="info"
53
- topIcon={featherLogo}
54
- dropshadow={false}
55
- >
56
- Praesent euismod porta odio at tempus.{' '}
57
- <span className="fw-bold">Aenean urna massa</span>, facilisis malesuada
58
- eros at, rhoncus imperdiet nunc
59
- </InfoCard>
60
- </>
61
- </Preview>
@@ -1,106 +0,0 @@
1
- import { useState } from 'react';
2
- import { Meta, Preview } from '@storybook/addon-docs/blocks';
3
-
4
- import DateSelector from '.';
5
- import de from 'dayjs/locale/de';
6
-
7
- <Meta title="JSX/Date selector" component={DateSelector} />
8
-
9
- # Date selector
10
-
11
- Date selector are user interface elements which allow user to select a date in the `YYYY-MM-DD` format.
12
-
13
- <Preview>
14
- <iframe
15
- width="100%"
16
- height="450"
17
- src="https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com%2Ffile%2FMKs4cbojdVOBKUxv7okb93%2FDirty-Swan-Design-System%3Fnode-id%3D293%253A169"
18
- allowFullScreen
19
- ></iframe>
20
- </Preview>
21
-
22
- ## Default example
23
-
24
- ### Without calendar
25
-
26
- export const DateSelectorWithoutCalendarStory = () => {
27
- const [date, setDate] = useState('');
28
- return (
29
- <>
30
- <DateSelector
31
- value={date}
32
- className="mt24"
33
- yearBoundaries={{ min: 2020, max: 2022 }}
34
- onChange={(date) => {
35
- setDate(date);
36
- }}
37
- />
38
- </>
39
- );
40
- };
41
-
42
- <DateSelectorWithoutCalendarStory />
43
-
44
- ### With calendar
45
-
46
- export const DateSelectorWithCalendarStory = () => {
47
- const [date, setDate] = useState('');
48
- return (
49
- <div style={{ paddingBottom: '120px' }}>
50
- <DateSelector
51
- value={date}
52
- className="mt24"
53
- yearBoundaries={{ min: 2020, max: 2022 }}
54
- onChange={(date) => {
55
- setDate(date);
56
- }}
57
- displayCalendar={true}
58
- />
59
- </div>
60
- );
61
- };
62
-
63
- <DateSelectorWithCalendarStory />
64
-
65
- ### Localization
66
-
67
- | attribute | unit | description | default value | required |
68
- | -------------- | -------------------------------------------------- | --------------------------------------------------------------------------------------- | ------------- | -------- |
69
- | placeholders | `{ day?: string; month: string?; year?: string; }` | Placeholder text | undefined | false |
70
- | dayjsLocale | `ILocale` | Imported [Day.js locale Object](https://day.js.org/docs/en/customization/customization) | undefined | false |
71
- | firstDayOfWeek | number | Index of the first day of the week (0 = Sunday, 1 = Monday, etc.) | 0 | false |
72
-
73
- The `dayjsLocale` and `firstDayOfWeek` properties are used to localize the calendar of the `DateSelector`, whereas
74
- the `placeholders` object can be used to change the text of the different dropdowns. If no `dayjsLocale` is supplied, the default locale 'en' will be used for the DateSelector.
75
-
76
- Additional locales can be imported from dayjs like
77
- `import de from 'dayjs/locale/de';` and then passed on to the component:
78
- `<DateSelector ... dayjsLocale={de} />`
79
-
80
- [List of all supported locales](https://github.com/iamkun/dayjs/tree/dev/src/locale)
81
-
82
- export const DateSelectorWithCalendarLocalizedStory = () => {
83
- const [date, setDate] = useState('');
84
- return (
85
- <div style={{ paddingBottom: '120px' }}>
86
- <DateSelector
87
- value={date}
88
- className="mt24"
89
- yearBoundaries={{ min: 2020, max: 2022 }}
90
- onChange={(date) => {
91
- setDate(date);
92
- }}
93
- displayCalendar={true}
94
- placeholders={{
95
- day: 'Tag',
96
- month: 'Monat',
97
- year: 'Jahr',
98
- }}
99
- dayjsLocale={de}
100
- firstDayOfWeek={1}
101
- />
102
- </div>
103
- );
104
- };
105
-
106
- <DateSelectorWithCalendarLocalizedStory />
@@ -1,108 +0,0 @@
1
- import { Meta, Preview } from '@storybook/addon-docs/blocks';
2
-
3
- import Input from '.';
4
-
5
- <Meta title="JSX/Inputs/Input" />
6
-
7
- ## Input
8
-
9
- The default input component is used to gather informations from the user.
10
-
11
- You are looking at the JSX definition of the Input component, if you want you can use the [css alternative](?path=/story/css-components-input--page)
12
-
13
- <Preview>
14
- <>
15
- <h1 className="p-h1">Without placeholder</h1>
16
- <h4 className="p-h4 mt24">Empty</h4>
17
- <Input className="wmx5 mt8" />
18
- <h4 className="p-h4 mt24">Filled</h4>
19
- <Input className="wmx5 mt8" value="Lorem ipsum" />
20
- <h4 className="p-h4 mt24">Disabled</h4>
21
- <Input className="wmx5 mt8" value="Lorem ipsum" disabled={true} />
22
- <h4 className="p-h4 mt24">Error</h4>
23
- <Input
24
- className="wmx5 mt8"
25
- value="Lorem ipsum"
26
- error="Lorem ipsum dolor sit amet, consectetur adipiscing elit."
27
- />
28
- <h1 className="p-h1 mt32">With placeholder</h1>
29
- <h4 className="p-h4 mt24">Empty</h4>
30
- <Input className="wmx5 mt8" placeholder="Email" />
31
- <h4 className="p-h4 mt24">Filled</h4>
32
- <Input
33
- className="wmx5 mt8"
34
- value="jane.doe@feather-insurance.com"
35
- placeholder="Email"
36
- />
37
- <h4 className="p-h4 mt24">Disabled</h4>
38
- <Input className="wmx5 mt8" placeholder="Email" disabled />
39
- <h4 className="p-h4 mt24">Error</h4>
40
- <Input
41
- className="wmx5 mt8"
42
- value="jane.doe@feather-insurance.com"
43
- placeholder="Email"
44
- error="Lorem ipsum dolor sit amet, consectetur adipiscing elit."
45
- />
46
- <h1 className="p-h1 mt32">With prefix</h1>
47
- <h4 className="p-h4 mt24">Empty</h4>
48
- <Input className="wmx5 mt8" prefix="€" />
49
- <h4 className="p-h4 mt24">Filled</h4>
50
- <Input className="wmx5 mt8" value="100" prefix="€" />
51
- <h4 className="p-h4 mt24">Empty with placeholder</h4>
52
- <Input className="wmx5 mt8" placeholder="amount" prefix="€" />
53
- <h4 className="p-h4 mt24">Filled with placeholder</h4>
54
- <Input className="wmx5 mt8" placeholder="amount" value="100" prefix="€" />
55
- <h4 className="p-h4 mt24">Disabled</h4>
56
- <Input className="wmx5 mt8" placeholder="amount" disabled prefix="€" />
57
- <h4 className="p-h4 mt24">Error</h4>
58
- <Input
59
- className="wmx5 mt8"
60
- placeholder="amount"
61
- value="100"
62
- prefix="€"
63
- error="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ac hendrerit justo. Nunc nibh ex, vulputate ac leo id, feugiat rhoncus purus."
64
- />
65
- <h1 className="p-h1 mt32">With label</h1>
66
- <h4 className="p-h4 mt24">Empty</h4>
67
- <Input className="wmx5 mt8" label="Email" />
68
- <h4 className="p-h4 mt24">With placeholder</h4>
69
- <Input
70
- className="wmx5 mt8"
71
- label="Email"
72
- placeholder="email@feather-insurance.com"
73
- />
74
- <h4 className="p-h4 mt24">Filled</h4>
75
- <Input
76
- className="wmx5 mt8"
77
- value="email@feather-insurance.com"
78
- label="Email"
79
- placeholder="email@feather-insurance.com"
80
- />
81
- <h4 className="p-h4 mt24">Disabled</h4>
82
- <Input
83
- className="wmx5 mt8"
84
- label="Email"
85
- placeholder="email@feather-insurance.com"
86
- disabled
87
- />
88
- <h4 className="p-h4 mt24">Error</h4>
89
- <Input
90
- className="wmx5 mt8"
91
- label="Email"
92
- value="invalid.email@feather-insurance.com"
93
- placeholder="email@feather-insurance.com"
94
- error="Lorem ipsum dolor sit amet, consectetur adipiscing elit."
95
- />
96
- <h4 className="p-h4 mt24">With prefix</h4>
97
- <Input className="wmx5 mt8" label="Amount" value="100" prefix="€" />
98
- <h4 className="p-h4 mt24">With label hidden</h4>
99
- <Input
100
- className="wmx5 mt8"
101
- label="Amount"
102
- value="100"
103
- prefix="€"
104
- hideLabel
105
- onChange={() => {}}
106
- />
107
- </>
108
- </Preview>
@@ -1,187 +0,0 @@
1
- import { Meta, Preview } from '@storybook/addon-docs/blocks';
2
-
3
- import MultiDropzone from '.';
4
-
5
- <Meta title="JSX/MultiDropzone" component={MultiDropzone} />
6
-
7
- # MultiDropzone
8
-
9
- MultiDropzone component allows upload of multiple documents / files.
10
-
11
- ## Examples
12
-
13
- ### Idle state
14
-
15
- <Preview>
16
- <MultiDropzone
17
- uploadedFiles={[]}
18
- onFileSelect={() => {}}
19
- uploading={false}
20
- onRemoveFile={() => {}}
21
- />
22
- </Preview>
23
-
24
- ### Uploading state
25
-
26
- <Preview>
27
- <MultiDropzone
28
- uploadedFiles={[
29
- {
30
- id: '123',
31
- type: 'pdf',
32
- progress: '72',
33
- name: 'test_file_name.pdf',
34
- token: 'abc',
35
- previewUrl: 'http://getpopsure.com/test_file_name.pdf',
36
- },
37
- {
38
- id: '124',
39
- type: 'pdf',
40
- progress: '72',
41
- name: 'test_file_name.pdf',
42
- token: 'abc',
43
- previewUrl: 'http://getpopsure.com/test_file_name.pdf',
44
- showLoadingSpinner: true,
45
- showProgressBar: false,
46
- },
47
- {
48
- id: '125',
49
- type: 'pdf',
50
- progress: '72',
51
- name: 'test_file_name.pdf',
52
- token: 'abc',
53
- previewUrl: 'http://getpopsure.com/test_file_name.pdf',
54
- showLoadingSpinner: true,
55
- },
56
- {
57
- id: '456',
58
- type: 'pdf',
59
- progress: '100',
60
- name: 'test_file_name2.pdf',
61
- token: 'def',
62
- previewUrl: 'http://getpopsure.com/test_file_name2.pdf',
63
- },
64
- ]}
65
- onFileSelect={() => {}}
66
- uploading={true}
67
- onRemoveFile={() => {}}
68
- />
69
- </Preview>
70
-
71
- ### Uploaded state
72
-
73
- <Preview>
74
- <MultiDropzone
75
- uploadedFiles={[
76
- {
77
- id: '123',
78
- type: 'pdf',
79
- progress: '100',
80
- name: 'test_file_name.pdf',
81
- token: 'abc',
82
- previewUrl: 'http://getpopsure.com/test_file_name.pdf',
83
- },
84
- ]}
85
- onFileSelect={() => {}}
86
- uploading={false}
87
- onRemoveFile={() => {}}
88
- />
89
- </Preview>
90
-
91
- ### Condensed view
92
-
93
- <Preview>
94
- <MultiDropzone
95
- uploadedFiles={[
96
- {
97
- id: '123',
98
- type: 'pdf',
99
- progress: '100',
100
- name: 'test_file_name.pdf',
101
- token: 'abc',
102
- previewUrl: 'http://getpopsure.com/test_file_name.pdf',
103
- },
104
- ]}
105
- onFileSelect={() => {}}
106
- uploading={false}
107
- onRemoveFile={() => {}}
108
- isCondensed
109
- />
110
- </Preview>
111
-
112
- ### Error state
113
-
114
- <Preview>
115
- <MultiDropzone
116
- uploadedFiles={[
117
- {
118
- id: '123',
119
- type: 'pdf',
120
- progress: '0',
121
- name: 'test_file_name.pdf',
122
- token: 'abc',
123
- previewUrl: 'http://getpopsure.com/test_file_name.pdf',
124
- error: 'File is too big!',
125
- },
126
- ]}
127
- onFileSelect={() => {}}
128
- uploading={false}
129
- onRemoveFile={() => {}}
130
- />
131
- </Preview>
132
-
133
- ### Accepting only images
134
-
135
- <Preview>
136
- <MultiDropzone
137
- accept="image"
138
- isCondensed
139
- uploadedFiles={[]}
140
- onFileSelect={() => {}}
141
- uploading={false}
142
- onRemoveFile={() => {}}
143
- />
144
- </Preview>
145
-
146
- ### Accepting only documents
147
-
148
- <Preview>
149
- <MultiDropzone
150
- accept="document"
151
- isCondensed
152
- uploadedFiles={[]}
153
- onFileSelect={() => {}}
154
- uploading={false}
155
- onRemoveFile={() => {}}
156
- />
157
- </Preview>
158
-
159
- ### Limiting file size to 2MB
160
-
161
- <Preview>
162
- <MultiDropzone
163
- isCondensed
164
- uploadedFiles={[]}
165
- onFileSelect={() => {}}
166
- uploading={false}
167
- onRemoveFile={() => {}}
168
- maxSize={2096000}
169
- />
170
- </Preview>
171
-
172
- ### i18n support
173
-
174
- <Preview>
175
- <MultiDropzone
176
- uploadedFiles={[]}
177
- onFileSelect={() => {}}
178
- uploading={false}
179
- onRemoveFile={() => {}}
180
- textOverrides={{
181
- instructionsText: 'Datei auswählen oder per Drag & Drop platzieren',
182
- supportsTextShort: 'Unterstützt werden',
183
- currentlyUploadingText:
184
- 'Bitte warten während die Datei hochgeladen wird...'
185
- }}
186
- />
187
- </Preview>