@popsure/dirty-swan 0.38.1 → 0.38.2

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.
@@ -3,7 +3,7 @@ import { jsx } from 'react/jsx-runtime';
3
3
  import { c as classNames } from '../../../index-6ea95111.js';
4
4
  import { s as styleInject } from '../../../style-inject.es-1f59c1d0.js';
5
5
 
6
- var css_248z = ".styles-module_wrapper__1_lY0 {\n margin: 4px;\n}";
6
+ var css_248z = ".styles-module_wrapper__1_lY0 {\n padding: 4px;\n}";
7
7
  var styles = {"wrapper":"styles-module_wrapper__1_lY0"};
8
8
  styleInject(css_248z);
9
9
 
@@ -12,7 +12,10 @@ var IconWrapper = function (_a) {
12
12
  var children = _a.children, _c = _a.size, size = _c === void 0 ? 16 : _c, color = _a.color, className = _a.className;
13
13
  return (jsx("span", __assign({ className: classNames('d-inline-block', styles.wrapper, className !== null && className !== void 0 ? className : '', (_b = {},
14
14
  _b["tc-" + color] = !!color,
15
- _b)) }, { children: jsx("svg", __assign({ width: size, height: size, viewBox: "0 0 24 24", fill: "none" }, { children: children }), void 0) }), void 0));
15
+ _b)), style: {
16
+ width: size + "px",
17
+ height: size + "px"
18
+ } }, { children: jsx("svg", __assign({ className: 'w100', viewBox: "0 0 24 24", fill: "none" }, { children: children }), void 0) }), void 0));
16
19
  };
17
20
 
18
21
  export { IconWrapper };
@@ -1 +1 @@
1
- {"version":3,"file":"IconWrapper.js","sources":["../../../../../../src/lib/components/icon/IconWrapper/IconWrapper.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport { Color, Size } from '../../../models/styles';\n\nimport styles from './styles.module.scss';\nimport { ReactNode } from 'react';\n\nexport type IconWrapperProps = {\n children?: ReactNode;\n size?: Size;\n color?: Color;\n className?: string;\n};\n\nconst IconWrapper = ({\n children,\n size = 16,\n color,\n className,\n}: IconWrapperProps) => (\n <span\n className={classNames('d-inline-block', styles.wrapper, className ?? '', {\n [`tc-${color}`]: !!color,\n })}\n >\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n {children}\n </svg>\n </span>\n);\n\nexport { IconWrapper };"],"names":["_jsx"],"mappings":";;;;;;;;;IAaM,WAAW,GAAG,UAAC,EAKF;;QAJjB,QAAQ,cAAA,EACR,YAAS,EAAT,IAAI,mBAAG,EAAE,KAAA,EACT,KAAK,WAAA,EACL,SAAS,eAAA;IACa,QACtBA,uBACE,SAAS,EAAE,UAAU,CAAC,gBAAgB,EAAE,MAAM,CAAC,OAAO,EAAE,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,EAAE;YACrE,GAAC,QAAM,KAAO,IAAG,CAAC,CAAC,KAAK;gBACxB,gBAEFA,sBAAK,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,gBAC5D,QAAQ,YACL,YACD;AATe;;;;"}
1
+ {"version":3,"file":"IconWrapper.js","sources":["../../../../../../src/lib/components/icon/IconWrapper/IconWrapper.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport { Color, Size } from '../../../models/styles';\n\nimport styles from './styles.module.scss';\nimport { ReactNode } from 'react';\n\nexport type IconWrapperProps = {\n children?: ReactNode;\n size?: Size;\n color?: Color;\n className?: string;\n};\n\nconst IconWrapper = ({\n children,\n size = 16,\n color,\n className,\n}: IconWrapperProps) => (\n <span\n className={classNames('d-inline-block', styles.wrapper, className ?? '', {\n [`tc-${color}`]: !!color,\n })}\n style={{\n width: `${size}px`,\n height: `${size}px`\n }}\n >\n <svg className='w100' viewBox=\"0 0 24 24\" fill=\"none\">\n {children}\n </svg>\n </span>\n);\n\nexport { IconWrapper };"],"names":["_jsx"],"mappings":";;;;;;;;;IAaM,WAAW,GAAG,UAAC,EAKF;;QAJjB,QAAQ,cAAA,EACR,YAAS,EAAT,IAAI,mBAAG,EAAE,KAAA,EACT,KAAK,WAAA,EACL,SAAS,eAAA;IACa,QACtBA,uBACE,SAAS,EAAE,UAAU,CAAC,gBAAgB,EAAE,MAAM,CAAC,OAAO,EAAE,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,EAAE;YACrE,GAAC,QAAM,KAAO,IAAG,CAAC,CAAC,KAAK;gBACxB,EACF,KAAK,EAAE;YACL,KAAK,EAAK,IAAI,OAAI;YAClB,MAAM,EAAK,IAAI,OAAI;SACpB,gBAEDA,sBAAK,SAAS,EAAC,MAAM,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,gBAClD,QAAQ,YACL,YACD;AAbe;;;;"}
@@ -2,7 +2,7 @@ import { _ as __assign } from '../../tslib.es6-5bc94358.js';
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import { useState } from 'react';
4
4
  import { Input } from '../input/index.js';
5
- import { i as icons } from '../../index-38cf6d96.js';
5
+ import { i as icons } from '../../index-35a77b9b.js';
6
6
  import Button from '../button/index.js';
7
7
  import { c as classNames } from '../../index-6ea95111.js';
8
8
  import { s as styleInject } from '../../style-inject.es-1f59c1d0.js';
@@ -1,6 +1,6 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { IconWrapper } from './IconWrapper/IconWrapper.js';
3
- import { i as icons } from '../../index-38cf6d96.js';
3
+ import { i as icons } from '../../index-35a77b9b.js';
4
4
  import '../../tslib.es6-5bc94358.js';
5
5
  import '../../index-6ea95111.js';
6
6
  import '../../style-inject.es-1f59c1d0.js';
@@ -2812,23 +2812,25 @@ var MultiDropzone = function (_a) {
2812
2812
  var formattedAccept = getFormattedAcceptObject(accept);
2813
2813
  var fileList = formatAcceptFileList(formattedAccept);
2814
2814
  var maxSizePlaceholder = maxSize && maxSize > 0
2815
- ? ((textOverrides === null || textOverrides === void 0 ? void 0 : textOverrides.sizeUpToText) || "up to") + " " + formatBytes(maxSize)
2816
- : "";
2817
- var placeholder = ((textOverrides === null || textOverrides === void 0 ? void 0 : textOverrides.supportsTextShort) || "Supports") + " " + (fileList || "JPEG, PNG, PDF") + " " + maxSizePlaceholder;
2815
+ ? ((textOverrides === null || textOverrides === void 0 ? void 0 : textOverrides.sizeUpToText) || 'up to') + " " + formatBytes(maxSize)
2816
+ : '';
2817
+ var placeholder = ((textOverrides === null || textOverrides === void 0 ? void 0 : textOverrides.supportsTextShort) || 'Supports') + " " + (fileList || 'JPEG, PNG, PDF') + " " + maxSizePlaceholder;
2818
2818
  var isOverMaxFiles = maxFiles > 0 && uploadedFiles.length > maxFiles;
2819
- var removeError = function (removeId) { return (setErrors(errors.filter(function (_a) {
2820
- var id = _a.id;
2821
- return id !== removeId;
2822
- }))); };
2819
+ var removeError = function (removeId) {
2820
+ return setErrors(errors.filter(function (_a) {
2821
+ var id = _a.id;
2822
+ return id !== removeId;
2823
+ }));
2824
+ };
2823
2825
  var onDrop = useCallback(function (acceptedFiles, filesRejected) {
2824
2826
  onFileSelect(acceptedFiles);
2825
- setErrors(function (previousErrors) { return (__spreadArray$1(__spreadArray$1([], previousErrors), filesRejected.map(function (_a) {
2827
+ setErrors(function (previousErrors) { return __spreadArray$1(__spreadArray$1([], previousErrors), filesRejected.map(function (_a) {
2826
2828
  var errors = _a.errors;
2827
2829
  return ({
2828
2830
  id: generateId(),
2829
2831
  message: getErrorMessage(errors[0], { fileList: fileList, maxSize: maxSize }, textOverrides),
2830
2832
  });
2831
- }))); });
2833
+ })); });
2832
2834
  }, [fileList, maxSize, onFileSelect, textOverrides]);
2833
2835
  var _f = useDropzone({
2834
2836
  accept: formattedAccept,
@@ -2836,11 +2838,12 @@ var MultiDropzone = function (_a) {
2836
2838
  maxSize: maxSize,
2837
2839
  onDrop: onDrop,
2838
2840
  }), getRootProps = _f.getRootProps, getInputProps = _f.getInputProps;
2841
+ var uniqueId = useRef(generateId());
2839
2842
  return (jsxs("div", __assign({ className: styles.container }, { children: [jsxs("div", __assign({ className: classNames("w100 ta-center br8 c-pointer " + styles.dropzoneContainer, (_b = {},
2840
2843
  _b[styles['dropzoneContainerDisabled']] = uploading,
2841
- _b)) }, getRootProps(), { children: [jsx("input", __assign({ "data-testid": "ds-drop-input" }, getInputProps()), void 0),
2844
+ _b)) }, getRootProps(), { children: [jsx("input", __assign({ "data-testid": "ds-drop-input", id: uniqueId.current }, getInputProps()), void 0),
2842
2845
  jsx("img", { className: isCondensed ? styles.img : '', src: isCondensed ? icons.uploadSmallIcon : icons.uploadIcon, alt: "purple cloud with an arrow" }, void 0),
2843
- jsx("div", __assign({ className: "p-h4 mt8 " + (isCondensed ? styles.textInline : '') }, { children: uploading
2846
+ jsx("label", __assign({ htmlFor: uniqueId.current, className: "p-h4 mt8 d-block c-pointer " + (isCondensed ? styles.textInline : '') }, { children: uploading
2844
2847
  ? (textOverrides === null || textOverrides === void 0 ? void 0 : textOverrides.currentlyUploadingText) ||
2845
2848
  'Please wait while uploading file...'
2846
2849
  : (textOverrides === null || textOverrides === void 0 ? void 0 : textOverrides.instructionsText) || 'Choose file or drag & drop' }), void 0),
@@ -2855,7 +2858,7 @@ var MultiDropzone = function (_a) {
2855
2858
  }, onRemoveFile: function () { return removeError(id); }, uploading: false }, id));
2856
2859
  }),
2857
2860
  uploadedFiles.length > 0 && (jsx("div", __assign({ className: "w100 mt16" }, { children: uploadedFiles.map(function (file) { return (jsx(UploadFileCell, { uploadStatus: getUploadStatus(file.progress, file.error), file: file, onRemoveFile: onRemoveFile, uploading: uploading }, file.id)); }) }), void 0)),
2858
- jsx(AnimateHeight, __assign({ duration: 300, height: isOverMaxFiles ? 'auto' : 0 }, { children: jsx("p", __assign({ className: "tc-red-500 p-p--small" }, { children: (textOverrides === null || textOverrides === void 0 ? void 0 : textOverrides.tooManyFilesError) || "Too many files." }), void 0) }), void 0)] }), void 0));
2861
+ jsx(AnimateHeight, __assign({ duration: 300, height: isOverMaxFiles ? 'auto' : 0 }, { children: jsx("p", __assign({ className: "tc-red-500 p-p--small" }, { children: (textOverrides === null || textOverrides === void 0 ? void 0 : textOverrides.tooManyFilesError) || 'Too many files.' }), void 0) }), void 0)] }), void 0));
2859
2862
  };
2860
2863
 
2861
2864
  export { MultiDropzone };