@popsure/dirty-swan 0.38.3 → 0.38.5

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 (34) hide show
  1. package/dist/cjs/index.js +33 -1897
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/lib/components/autocompleteAddress/index.d.ts +18 -1
  4. package/dist/cjs/lib/components/autocompleteAddress/index.stories.d.ts +1 -1
  5. package/dist/cjs/lib/components/multiDropzone/UploadFileCell/index.d.ts +1 -1
  6. package/dist/cjs/lib/components/multiDropzone/index.d.ts +1 -1
  7. package/dist/esm/components/autocompleteAddress/index.js +24 -1888
  8. package/dist/esm/components/autocompleteAddress/index.js.map +1 -1
  9. package/dist/esm/components/autocompleteAddress/index.stories.js +14 -14
  10. package/dist/esm/components/autocompleteAddress/index.stories.js.map +1 -1
  11. package/dist/esm/components/cards/index.js +3 -3
  12. package/dist/esm/components/cards/index.js.map +1 -1
  13. package/dist/esm/components/multiDropzone/UploadFileCell/index.js +1 -1
  14. package/dist/esm/components/multiDropzone/index.js +2 -2
  15. package/dist/esm/components/multiDropzone/index.js.map +1 -1
  16. package/dist/esm/components/multiDropzone/index.stories.js +3 -3
  17. package/dist/esm/components/multiDropzone/index.stories.js.map +1 -1
  18. package/dist/esm/components/multiDropzone/index.test.js +1 -1
  19. package/dist/esm/{index-da10b7ad.js → index-3e39c956.js} +7 -7
  20. package/dist/esm/{index-da10b7ad.js.map → index-3e39c956.js.map} +1 -1
  21. package/dist/esm/index.js +1 -1
  22. package/dist/esm/lib/components/autocompleteAddress/index.d.ts +18 -1
  23. package/dist/esm/lib/components/autocompleteAddress/index.stories.d.ts +1 -1
  24. package/dist/esm/lib/components/multiDropzone/UploadFileCell/index.d.ts +1 -1
  25. package/dist/esm/lib/components/multiDropzone/index.d.ts +1 -1
  26. package/package.json +1 -1
  27. package/src/lib/components/autocompleteAddress/index.stories.tsx +41 -33
  28. package/src/lib/components/autocompleteAddress/index.tsx +55 -53
  29. package/src/lib/components/cards/cardWithLeftIcon/index.tsx +4 -6
  30. package/src/lib/components/cards/cardWithTopLeftIcon/index.tsx +6 -8
  31. package/src/lib/components/multiDropzone/UploadFileCell/index.tsx +15 -13
  32. package/src/lib/components/multiDropzone/UploadFileCell/style.module.scss +5 -2
  33. package/src/lib/components/multiDropzone/index.stories.tsx +2 -2
  34. package/src/lib/components/multiDropzone/index.tsx +3 -2
@@ -1,5 +1,5 @@
1
1
  import { associatedClassForCardState, CardProps, headingForCardSize } from '..';
2
- import { Icon, IconSize, arrowRight } from '../icons';
2
+ import { arrowRight, Icon, IconSize } from '../icons';
3
3
 
4
4
  import styles from './style.module.scss';
5
5
 
@@ -37,7 +37,7 @@ export type CardWithLeftIconProps = Omit<CardProps, 'title'> & {
37
37
  leftIconSize?: IconSize;
38
38
  title?: string;
39
39
  subtitle?: string;
40
- }
40
+ };
41
41
 
42
42
  export const CardWithLeftIcon = ({
43
43
  className = '',
@@ -78,9 +78,7 @@ export const CardWithLeftIcon = ({
78
78
  <div className="d-flex">
79
79
  {(title || subtitle) && (
80
80
  <div>
81
- {title && (
82
- <div className={headingStyle}>{title}</div>
83
- )}
81
+ {title && <div className={headingStyle}>{title}</div>}
84
82
  {subtitle && (
85
83
  <div className={`tc-grey-500 ${headingStyle}`}>{subtitle}</div>
86
84
  )}
@@ -96,7 +94,7 @@ export const CardWithLeftIcon = ({
96
94
  />
97
95
  )}
98
96
  </div>
99
- <p className={cardTextStyle}>{children}</p>
97
+ <div className={cardTextStyle}>{children}</div>
100
98
  </div>
101
99
  </div>
102
100
  );
@@ -1,9 +1,5 @@
1
- import {
2
- associatedClassForCardState,
3
- CardProps,
4
- headingForCardSize,
5
- } from '..';
6
- import { Icon, arrowRight, featherLogo } from '../icons';
1
+ import { associatedClassForCardState, CardProps, headingForCardSize } from '..';
2
+ import { arrowRight, featherLogo, Icon } from '../icons';
7
3
 
8
4
  import styles from './style.module.scss';
9
5
 
@@ -43,7 +39,9 @@ export const CardWithTopLeftIcon = ({
43
39
  const titleContainerStyle = styles['title-container'];
44
40
  const headingStyle = headingForCardSize(cardSize);
45
41
  const iconStyle = styles['right-icon'];
46
- const cardTextStyle = `p-p tc-grey-600 ${cardSize === 'xsmall' ? styles.indent : 'mt16'}`;
42
+ const cardTextStyle = `p-p tc-grey-600 ${
43
+ cardSize === 'xsmall' ? styles.indent : 'mt16'
44
+ }`;
47
45
 
48
46
  return (
49
47
  <div className={cardStyle} {...props}>
@@ -68,7 +66,7 @@ export const CardWithTopLeftIcon = ({
68
66
  />
69
67
  )}
70
68
  </div>
71
- <p className={cardTextStyle}>{children}</p>
69
+ <div className={cardTextStyle}>{children}</div>
72
70
  </div>
73
71
  );
74
72
  };
@@ -8,7 +8,7 @@ import { UploadStatus, UploadedFile } from '../types';
8
8
  interface Props {
9
9
  uploadStatus: UploadStatus;
10
10
  file: UploadedFile;
11
- onRemoveFile: (id: string) => void;
11
+ onRemoveFile?: (id: string) => void;
12
12
  uploading: boolean;
13
13
  }
14
14
 
@@ -38,11 +38,11 @@ const UploadFileCell: React.FC<Props> = ({
38
38
  ERROR: icons.fileErrorIcon,
39
39
  };
40
40
 
41
- const mapDisplayText: { [s in UploadStatus]: string } = {
41
+ const displayText = {
42
42
  UPLOADING: 'Uploading...',
43
43
  COMPLETE: name,
44
44
  ERROR: error ?? 'Something went wrong. Try uploading again.',
45
- };
45
+ }[uploadStatus];
46
46
 
47
47
  return (
48
48
  <div
@@ -57,8 +57,8 @@ const UploadFileCell: React.FC<Props> = ({
57
57
  alt=""
58
58
  />
59
59
  <div className="w100">
60
- <div className={`p-p ${styles['upload-display-text']}`}>
61
- {mapDisplayText[uploadStatus]}
60
+ <div className={`p-p ${styles['upload-display-text']}`} title={displayText}>
61
+ {displayText}
62
62
  </div>
63
63
 
64
64
  {isUploading && showProgressBar && (
@@ -100,14 +100,16 @@ const UploadFileCell: React.FC<Props> = ({
100
100
  </a>
101
101
  )}
102
102
 
103
- <img
104
- className={classnames(styles['remove-icon'], {
105
- [styles.disabled]: uploading,
106
- })}
107
- src={hasError ? icons.trashErrorIcon : icons.trashIcon}
108
- onClick={() => onRemoveFile(id)}
109
- alt="remove"
110
- />
103
+ {onRemoveFile && (
104
+ <img
105
+ className={classnames(styles['remove-icon'], {
106
+ [styles.disabled]: uploading,
107
+ })}
108
+ src={hasError ? icons.trashErrorIcon : icons.trashIcon}
109
+ onClick={() => onRemoveFile(id)}
110
+ alt="remove"
111
+ />
112
+ )}
111
113
  </div>
112
114
  )}
113
115
  </div>
@@ -5,7 +5,7 @@
5
5
  align-items: center;
6
6
  justify-content: space-between;
7
7
 
8
- height: 64px;
8
+ min-height: 64px;
9
9
  padding: 8px 16px;
10
10
 
11
11
  border: 1px solid $ds-grey-400;
@@ -34,7 +34,10 @@
34
34
  }
35
35
 
36
36
  .upload-display-text {
37
- overflow-wrap: anywhere;
37
+ display: -webkit-box;
38
+ -webkit-line-clamp: 2;
39
+ -webkit-box-orient: vertical;
40
+ overflow: hidden;
38
41
  }
39
42
 
40
43
  .progress-bar-container {
@@ -9,7 +9,7 @@ const story = {
9
9
  uploadedFiles: {
10
10
  defaultValue: [{
11
11
  id: '123456789',
12
- name: 'dummyfile.png'
12
+ name: 'my-code-doesnt-work-i-have-no-idea-why-my-code-works.jpg'
13
13
  }],
14
14
  description: 'List of files to be displayed on the component.',
15
15
  },
@@ -75,7 +75,7 @@ export const MultiDropzoneStory = ({
75
75
  const [localFiles, setLocalFiles] = useState<UploadedFile[]>(uploadedFiles);
76
76
 
77
77
  const handleOnRemoveFile = (id: string) => {
78
- onRemoveFile(id);
78
+ onRemoveFile?.(id);
79
79
  setLocalFiles((prevFiles) => prevFiles.filter((file) => file.id !== id));
80
80
  };
81
81
 
@@ -28,7 +28,7 @@ interface MultiDropzoneProps {
28
28
  uploadedFiles: UploadedFile[];
29
29
  uploading: boolean;
30
30
  onFileSelect: (files: File[]) => void;
31
- onRemoveFile: (id: string) => void;
31
+ onRemoveFile?: (id: string) => void;
32
32
  accept?: AcceptType;
33
33
  isCondensed?: boolean;
34
34
  maxFiles?: number;
@@ -152,7 +152,8 @@ const MultiDropzone = ({
152
152
  uploadStatus={getUploadStatus(file.progress, file.error)}
153
153
  file={file}
154
154
  key={file.id}
155
- onRemoveFile={onRemoveFile}
155
+
156
+ {...!onRemoveFile ? {} : {onRemoveFile}}
156
157
  uploading={uploading}
157
158
  />
158
159
  ))}