@popsure/dirty-swan 0.33.5 → 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 (100) hide show
  1. package/dist/cjs/index.js +15 -15
  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/input/index.d.ts +4 -5
  15. package/dist/cjs/lib/components/input/input.stories.d.ts +90 -0
  16. package/dist/cjs/lib/components/input/stories/config.d.ts +71 -0
  17. package/dist/cjs/lib/index.d.ts +1 -1
  18. package/dist/esm/components/autocompleteAddress/index.js +1 -1
  19. package/dist/esm/components/autocompleteAddress/index.js.map +1 -1
  20. package/dist/esm/components/cards/cardButton/index.js +1 -1
  21. package/dist/esm/components/cards/cardButton/index.stories.js +49 -0
  22. package/dist/esm/components/cards/cardButton/index.stories.js.map +1 -0
  23. package/dist/esm/components/cards/cardWithLeftIcon/index.js +1 -1
  24. package/dist/esm/components/cards/cardWithLeftIcon/index.stories.js +64 -0
  25. package/dist/esm/components/cards/cardWithLeftIcon/index.stories.js.map +1 -0
  26. package/dist/esm/components/cards/cardWithTopIcon/index.js +1 -1
  27. package/dist/esm/components/cards/cardWithTopIcon/index.stories.js +68 -0
  28. package/dist/esm/components/cards/cardWithTopIcon/index.stories.js.map +1 -0
  29. package/dist/esm/components/cards/cardWithTopLeftIcon/index.js +1 -1
  30. package/dist/esm/components/cards/cardWithTopLeftIcon/index.stories.js +57 -0
  31. package/dist/esm/components/cards/cardWithTopLeftIcon/index.stories.js.map +1 -0
  32. package/dist/esm/components/cards/index.js +9 -9
  33. package/dist/esm/components/cards/index.js.map +1 -1
  34. package/dist/esm/components/cards/infoCard/index.js +1 -1
  35. package/dist/esm/components/cards/infoCard/index.stories.js +58 -0
  36. package/dist/esm/components/cards/infoCard/index.stories.js.map +1 -0
  37. package/dist/esm/components/comparisonTable/components/AccordionItem/AccordionItem.js +1 -1
  38. package/dist/esm/components/comparisonTable/components/TableArrows/index.js +1 -1
  39. package/dist/esm/components/comparisonTable/components/TableInfoButton/index.js +1 -1
  40. package/dist/esm/components/input/autoSuggestInput/index.js +1 -1
  41. package/dist/esm/components/input/autoSuggestInput/index.js.map +1 -1
  42. package/dist/esm/components/input/currency/index.js +1 -1
  43. package/dist/esm/components/input/currency/index.js.map +1 -1
  44. package/dist/esm/components/input/iban/index.js +1 -1
  45. package/dist/esm/components/input/iban/index.js.map +1 -1
  46. package/dist/esm/components/input/index.js +1 -1
  47. package/dist/esm/components/input/index.js.map +1 -1
  48. package/dist/esm/components/input/input.stories.js +85 -0
  49. package/dist/esm/components/input/input.stories.js.map +1 -0
  50. package/dist/esm/index-47663d39.js.map +1 -1
  51. package/dist/esm/index.js +1 -1
  52. package/dist/esm/lib/components/cards/cardButton/index.d.ts +8 -8
  53. package/dist/esm/lib/components/cards/cardButton/index.stories.d.ts +39 -0
  54. package/dist/esm/lib/components/cards/cardWithLeftIcon/index.d.ts +6 -12
  55. package/dist/esm/lib/components/cards/cardWithLeftIcon/index.stories.d.ts +55 -0
  56. package/dist/esm/lib/components/cards/cardWithTopIcon/index.d.ts +5 -11
  57. package/dist/esm/lib/components/cards/cardWithTopIcon/index.stories.d.ts +59 -0
  58. package/dist/esm/lib/components/cards/cardWithTopLeftIcon/index.d.ts +6 -12
  59. package/dist/esm/lib/components/cards/cardWithTopLeftIcon/index.stories.d.ts +49 -0
  60. package/dist/esm/lib/components/cards/index.d.ts +5 -5
  61. package/dist/esm/lib/components/cards/infoCard/index.d.ts +4 -10
  62. package/dist/esm/lib/components/cards/infoCard/index.stories.d.ts +47 -0
  63. package/dist/esm/lib/components/input/index.d.ts +4 -5
  64. package/dist/esm/lib/components/input/input.stories.d.ts +90 -0
  65. package/dist/esm/lib/components/input/stories/config.d.ts +71 -0
  66. package/dist/esm/lib/index.d.ts +1 -1
  67. package/dist/esm/scss/public/demo.js +1 -1
  68. package/dist/esm/scss/public/demo.js.map +1 -1
  69. package/dist/index.css +10 -10
  70. package/dist/lib/scss/public/colors/default.scss +2 -2
  71. package/dist/lib/scss/public/demo.tsx +1 -1
  72. package/package.json +1 -1
  73. package/src/lib/components/autocompleteAddress/index.tsx +1 -1
  74. package/src/lib/components/cards/cardButton/index.stories.tsx +61 -0
  75. package/src/lib/components/cards/cardButton/index.tsx +9 -10
  76. package/src/lib/components/cards/cardWithLeftIcon/index.stories.tsx +79 -0
  77. package/src/lib/components/cards/cardWithLeftIcon/index.tsx +8 -6
  78. package/src/lib/components/cards/cardWithTopIcon/index.stories.tsx +85 -0
  79. package/src/lib/components/cards/cardWithTopIcon/index.tsx +9 -7
  80. package/src/lib/components/cards/cardWithTopLeftIcon/index.stories.tsx +73 -0
  81. package/src/lib/components/cards/cardWithTopLeftIcon/index.tsx +8 -6
  82. package/src/lib/components/cards/index.tsx +5 -5
  83. package/src/lib/components/cards/infoCard/index.stories.tsx +71 -0
  84. package/src/lib/components/cards/infoCard/index.tsx +7 -5
  85. package/src/lib/components/input/a.stories.mdx +2 -2
  86. package/src/lib/components/input/autoSuggestInput/index.tsx +1 -1
  87. package/src/lib/components/input/currency/index.tsx +1 -1
  88. package/src/lib/components/input/iban/index.tsx +1 -1
  89. package/src/lib/components/input/index.tsx +4 -4
  90. package/src/lib/components/input/input.stories.tsx +48 -0
  91. package/src/lib/components/input/stories/config.ts +56 -0
  92. package/src/lib/index.tsx +1 -1
  93. package/src/lib/scss/public/colors/default.scss +2 -2
  94. package/src/lib/scss/public/demo.tsx +1 -1
  95. package/src/lib/components/cards/cardButton/index.stories.mdx +0 -47
  96. package/src/lib/components/cards/cardWithLeftIcon/index.stories.mdx +0 -103
  97. package/src/lib/components/cards/cardWithTopIcon/index.stories.mdx +0 -105
  98. package/src/lib/components/cards/cardWithTopLeftIcon/index.stories.mdx +0 -101
  99. package/src/lib/components/cards/infoCard/index.stories.mdx +0 -61
  100. package/src/lib/components/input/index.stories.mdx +0 -108
@@ -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}
@@ -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,
@@ -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;
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,
@@ -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>