@popsure/dirty-swan 0.58.2 → 0.58.4

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 (39) hide show
  1. package/dist/cjs/index.js +66 -60
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/lib/components/multiDropzone/index.stories.d.ts +9 -0
  4. package/dist/cjs/lib/components/multiDropzone/types.d.ts +3 -2
  5. package/dist/esm/{TableSection-ebace923.js → TableSection-f41d4248.js} +4 -60
  6. package/dist/esm/TableSection-f41d4248.js.map +1 -0
  7. package/dist/esm/components/input/index.js +1 -1
  8. package/dist/esm/components/multiDropzone/index.js +9 -2
  9. package/dist/esm/components/multiDropzone/index.js.map +1 -1
  10. package/dist/esm/components/multiDropzone/index.stories.js +22 -7
  11. package/dist/esm/components/multiDropzone/index.stories.js.map +1 -1
  12. package/dist/esm/components/multiDropzone/index.test.js +1 -0
  13. package/dist/esm/components/multiDropzone/index.test.js.map +1 -1
  14. package/dist/esm/components/table/Table.js +2 -1
  15. package/dist/esm/components/table/Table.js.map +1 -1
  16. package/dist/esm/components/table/Table.stories.js +2 -1
  17. package/dist/esm/components/table/Table.stories.js.map +1 -1
  18. package/dist/esm/components/table/Table.test.js +2 -1
  19. package/dist/esm/components/table/Table.test.js.map +1 -1
  20. package/dist/esm/components/table/components/TableContents/TableContents.js +2 -1
  21. package/dist/esm/components/table/components/TableContents/TableContents.js.map +1 -1
  22. package/dist/esm/components/table/components/TableContents/TableContents.test.js +2 -1
  23. package/dist/esm/components/table/components/TableContents/TableContents.test.js.map +1 -1
  24. package/dist/esm/components/table/components/TableSection/TableSection.js +2 -1
  25. package/dist/esm/components/table/components/TableSection/TableSection.js.map +1 -1
  26. package/dist/esm/components/table/components/TableSection/TableSection.test.js +2 -1
  27. package/dist/esm/components/table/components/TableSection/TableSection.test.js.map +1 -1
  28. package/dist/esm/index.js +2 -1
  29. package/dist/esm/index.js.map +1 -1
  30. package/dist/esm/lib/components/multiDropzone/index.stories.d.ts +9 -0
  31. package/dist/esm/lib/components/multiDropzone/types.d.ts +3 -2
  32. package/dist/esm/useMediaQuery-1a3a2432.js +61 -0
  33. package/dist/esm/useMediaQuery-1a3a2432.js.map +1 -0
  34. package/package.json +1 -1
  35. package/src/lib/components/input/style.module.scss +4 -0
  36. package/src/lib/components/multiDropzone/index.stories.tsx +49 -19
  37. package/src/lib/components/multiDropzone/index.tsx +13 -1
  38. package/src/lib/components/multiDropzone/types.ts +19 -18
  39. package/dist/esm/TableSection-ebace923.js.map +0 -1
package/dist/cjs/index.js CHANGED
@@ -303,7 +303,7 @@ function generateId() {
303
303
  return 'xxxx-xxxx-xxx-xxxx'.replace(/[x]/g, function () { return (Math.floor(Math.random() * 16).toString(16)); });
304
304
  }
305
305
 
306
- var css_248z$I = ".style-module_container__2L4SP {\n position: relative;\n}\n\n.style-module_prefix__3jAFZ {\n position: absolute;\n left: 16px;\n top: 50%;\n transform: translateY(-50%);\n color: var(--ds-grey-500);\n transition: 0.3s top;\n}\n.style-module_prefix--with-error__1yTTM {\n color: var(--ds-red-500);\n}\n.style-module_prefix--disabled__2-gcw {\n color: var(--ds-grey-600);\n}\n\n.style-module_input__1eJO5:not(:placeholder-shown) ~ .style-module_placeholder__1U2z0,\n.style-module_input__1eJO5:focus ~ .style-module_placeholder__1U2z0,\n.style-module_input--with-inside-label__253bZ ~ .style-module_placeholder__1U2z0 {\n top: 7px;\n left: 16px;\n transform: translateY(0);\n font-size: 10px;\n line-height: 12px;\n opacity: 1;\n}\n\n.style-module_input__1eJO5:focus ~ .style-module_placeholder__1U2z0 {\n color: var(--ds-primary-500);\n}\n.style-module_input__1eJO5:focus ~ .style-module_placeholder--with-error__2ieRU {\n color: var(--ds-red-500);\n}\n\n.style-module_input__1eJO5:focus ~ .style-module_prefix__3jAFZ {\n color: var(--ds-primary-500);\n}\n.style-module_input__1eJO5:focus ~ .style-module_prefix--with-error__1yTTM {\n color: var(--ds-red-500);\n}\n\n.style-module_input__1eJO5:not(:placeholder-shown) ~ .style-module_prefix__3jAFZ,\n.style-module_input__1eJO5:focus ~ .style-module_prefix__3jAFZ {\n top: 28px;\n}\n\n.style-module_input--with-inside-label__253bZ ~ .style-module_prefix__3jAFZ,\n.style-module_input--with-inside-label__253bZ:focus ~ .style-module_prefix__3jAFZ,\n.style-module_input--with-inside-label__253bZ:not(:placeholder-shown) ~ .style-module_prefix__3jAFZ {\n top: 29px;\n}\n\n.style-module_input__1eJO5 {\n box-sizing: border-box;\n padding-top: 9px;\n font-family: inherit;\n}\n.style-module_input--no-placeholder__3EGwh {\n padding-top: 0px;\n}\n.style-module_input--with-prefix__38e0j {\n padding-left: 32px !important;\n}\n\n.style-module_placeholder__1U2z0 {\n position: absolute;\n pointer-events: none;\n left: 16px;\n top: 50%;\n transform: translateY(-50%);\n transition: 0.3s ease all;\n color: var(--ds-grey-500);\n}\n.style-module_placeholder--with-prefix__2PquQ {\n left: 32px;\n}\n.style-module_placeholder--with-error__2ieRU {\n color: var(--ds-red-500);\n}\n\n.style-module_label__3FEZ1 {\n display: inline-block;\n margin-bottom: 8px;\n color: var(--ds-grey-600);\n}\n.style-module_label--with-error__166bP {\n color: var(--ds-red-500);\n}\n\n.style-module_error__167Zc {\n margin-top: 4px;\n}";
306
+ var css_248z$I = ".style-module_container__2L4SP {\n position: relative;\n}\n\n.style-module_prefix__3jAFZ {\n position: absolute;\n left: 16px;\n top: 50%;\n transform: translateY(-50%);\n color: var(--ds-grey-500);\n transition: 0.3s top;\n}\n.style-module_prefix--with-error__1yTTM {\n color: var(--ds-red-500);\n}\n.style-module_prefix--disabled__2-gcw {\n color: var(--ds-grey-600);\n}\n\n.style-module_input__1eJO5:not(:placeholder-shown) ~ .style-module_placeholder__1U2z0,\n.style-module_input__1eJO5:focus ~ .style-module_placeholder__1U2z0,\n.style-module_input--with-inside-label__253bZ ~ .style-module_placeholder__1U2z0 {\n top: 7px;\n left: 16px;\n transform: translateY(0);\n font-size: 10px;\n line-height: 12px;\n opacity: 1;\n}\n\n.style-module_input__1eJO5:focus ~ .style-module_placeholder__1U2z0 {\n color: var(--ds-primary-500);\n}\n.style-module_input__1eJO5:focus ~ .style-module_placeholder--with-error__2ieRU {\n color: var(--ds-red-500);\n}\n\n.style-module_input__1eJO5:focus ~ .style-module_prefix__3jAFZ {\n color: var(--ds-primary-500);\n}\n.style-module_input__1eJO5:focus ~ .style-module_prefix--with-error__1yTTM {\n color: var(--ds-red-500);\n}\n\n.style-module_input__1eJO5:not(:placeholder-shown) ~ .style-module_prefix__3jAFZ,\n.style-module_input__1eJO5:focus ~ .style-module_prefix__3jAFZ {\n top: 28px;\n}\n\n.style-module_input--with-inside-label__253bZ ~ .style-module_prefix__3jAFZ,\n.style-module_input--with-inside-label__253bZ:focus ~ .style-module_prefix__3jAFZ,\n.style-module_input--with-inside-label__253bZ:not(:placeholder-shown) ~ .style-module_prefix__3jAFZ {\n top: 29px;\n}\n\n.style-module_input__1eJO5 {\n box-sizing: border-box;\n padding-top: 9px;\n font-family: inherit;\n}\n.style-module_input--no-placeholder__3EGwh {\n padding-top: 0px;\n}\n.style-module_input--with-prefix__38e0j {\n padding-left: 32px !important;\n}\n.style-module_input--with-inside-label__253bZ {\n padding-top: 9px;\n}\n\n.style-module_placeholder__1U2z0 {\n position: absolute;\n pointer-events: none;\n left: 16px;\n top: 50%;\n transform: translateY(-50%);\n transition: 0.3s ease all;\n color: var(--ds-grey-500);\n}\n.style-module_placeholder--with-prefix__2PquQ {\n left: 32px;\n}\n.style-module_placeholder--with-error__2ieRU {\n color: var(--ds-red-500);\n}\n\n.style-module_label__3FEZ1 {\n display: inline-block;\n margin-bottom: 8px;\n color: var(--ds-grey-600);\n}\n.style-module_label--with-error__166bP {\n color: var(--ds-red-500);\n}\n\n.style-module_error__167Zc {\n margin-top: 4px;\n}";
307
307
  var styles$H = {"container":"style-module_container__2L4SP","prefix":"style-module_prefix__3jAFZ","prefix--with-error":"style-module_prefix--with-error__1yTTM","prefix--disabled":"style-module_prefix--disabled__2-gcw","input":"style-module_input__1eJO5","placeholder":"style-module_placeholder__1U2z0","input--with-inside-label":"style-module_input--with-inside-label__253bZ","placeholder--with-error":"style-module_placeholder--with-error__2ieRU","input--no-placeholder":"style-module_input--no-placeholder__3EGwh","input--with-prefix":"style-module_input--with-prefix__38e0j","placeholder--with-prefix":"style-module_placeholder--with-prefix__2PquQ","label":"style-module_label__3FEZ1","label--with-error":"style-module_label--with-error__166bP","error":"style-module_error__167Zc"};
308
308
  styleInject(css_248z$I);
309
309
 
@@ -8286,7 +8286,7 @@ var IMAGE_FILES = [
8286
8286
  'png',
8287
8287
  'tiff',
8288
8288
  'webp',
8289
- 'svg'
8289
+ 'svg',
8290
8290
  ];
8291
8291
 
8292
8292
  var getUploadStatus = function (progress, error) {
@@ -8375,6 +8375,63 @@ var getStatusMessage = function (_a) {
8375
8375
  return message.trim();
8376
8376
  };
8377
8377
 
8378
+ var breakpointLookup = function (breakpoint) {
8379
+ if (typeof window === 'undefined') {
8380
+ return {
8381
+ initialValue: false,
8382
+ queryString: '',
8383
+ };
8384
+ }
8385
+ switch (breakpoint) {
8386
+ case 'BELOW_TABLET':
8387
+ return {
8388
+ initialValue: window.innerWidth <= 720, // 45rem = 720px = tablet breakpoint
8389
+ queryString: '(max-width: 45rem)',
8390
+ };
8391
+ case 'BELOW_DESKTOP':
8392
+ return {
8393
+ initialValue: window.innerWidth <= 1024, // 64rem = 1024px = desktop breakpoint
8394
+ queryString: '(max-width: 64rem)',
8395
+ };
8396
+ case 'ABOVE_MOBILE':
8397
+ return {
8398
+ initialValue: window.innerWidth >= 544, // 34rem = 544px = mobile breakpoint}
8399
+ queryString: '(min-width: 34rem)',
8400
+ };
8401
+ case 'ABOVE_TABLET':
8402
+ return {
8403
+ initialValue: window.innerWidth >= 720, // 45rem = 720px = tablet breakpoint
8404
+ queryString: '(min-width: 45rem)',
8405
+ };
8406
+ case 'ABOVE_DESKTOP':
8407
+ return {
8408
+ initialValue: window.innerWidth >= 1024, // 64rem = 1024px = desktop breakpoint
8409
+ queryString: '(min-width: 64rem)',
8410
+ };
8411
+ case 'BELOW_MOBILE':
8412
+ default:
8413
+ return {
8414
+ initialValue: window.innerWidth <= 544, // 34rem = 544px = mobile breakpoint}
8415
+ queryString: '(max-width: 34rem)',
8416
+ };
8417
+ }
8418
+ };
8419
+ var useMediaQuery = function (breakpoint) {
8420
+ var _a = breakpointLookup(breakpoint), initialValue = _a.initialValue, queryString = _a.queryString;
8421
+ var _b = React.useState(initialValue), matchesBreakpoint = _b[0], setMatchesBreakpoint = _b[1];
8422
+ React.useEffect(function () {
8423
+ var mediaQuery = window.matchMedia(queryString);
8424
+ var updateMediaQuery = function (e) {
8425
+ return setMatchesBreakpoint(e.matches);
8426
+ };
8427
+ mediaQuery.addEventListener('change', updateMediaQuery);
8428
+ return function () {
8429
+ mediaQuery.removeEventListener('change', updateMediaQuery);
8430
+ };
8431
+ }, [queryString]);
8432
+ return matchesBreakpoint;
8433
+ };
8434
+
8378
8435
  var MultiDropzone = function (_a) {
8379
8436
  var _b;
8380
8437
  var uploadedFiles = _a.uploadedFiles, onFileSelect = _a.onFileSelect, onRemoveFile = _a.onRemoveFile, uploading = _a.uploading, _c = _a.isCondensed, isCondensed = _c === void 0 ? false : _c, accept = _a.accept, _d = _a.maxFiles, maxFiles = _d === void 0 ? 0 : _d, maxSize = _a.maxSize, textOverrides = _a.textOverrides;
@@ -8414,12 +8471,18 @@ var MultiDropzone = function (_a) {
8414
8471
  maxSize: maxSize,
8415
8472
  onDrop: onDrop,
8416
8473
  }), getRootProps = _g.getRootProps, getInputProps = _g.getInputProps;
8474
+ var isNonDesktopDevice = useMediaQuery('BELOW_TABLET');
8475
+ var instructionsTextDesktop = (textOverrides === null || textOverrides === void 0 ? void 0 : textOverrides.instructionsText) || 'Choose file or drag & drop';
8476
+ var instructionsTextMobile = (textOverrides === null || textOverrides === void 0 ? void 0 : textOverrides.instructionsTextMobile) || 'Tap to choose file';
8477
+ var instructionsText = isNonDesktopDevice
8478
+ ? instructionsTextMobile
8479
+ : instructionsTextDesktop;
8417
8480
  return (jsxRuntime.jsxs("div", { className: styles$C.container, children: [jsxRuntime.jsxs("div", __assign({ className: classNames$1("w100 ta-center br8 c-pointer ".concat(styles$C.dropzoneContainer), (_b = {},
8418
8481
  _b[styles$C['dropzoneContainerDisabled']] = uploading,
8419
8482
  _b)) }, getRootProps(), { children: [jsxRuntime.jsx("div", { className: "sr-only", "aria-live": "polite", "aria-atomic": "true", children: statusMessage }), jsxRuntime.jsx("input", __assign({ "data-testid": "ds-drop-input" }, getInputProps())), jsxRuntime.jsx(UploadCloudIcon, { className: isCondensed ? styles$C.img : '', size: isCondensed ? 24 : 64, color: 'purple-500' }), jsxRuntime.jsx("div", { className: "p-h4 mt8 d-block c-pointer ".concat(isCondensed ? styles$C.textInline : ''), children: uploading
8420
8483
  ? (textOverrides === null || textOverrides === void 0 ? void 0 : textOverrides.currentlyUploadingText) ||
8421
8484
  'Please wait while uploading file...'
8422
- : (textOverrides === null || textOverrides === void 0 ? void 0 : textOverrides.instructionsText) || 'Choose file or drag & drop' }), jsxRuntime.jsx("div", { className: "p-p--small tc-grey-500", children: (textOverrides === null || textOverrides === void 0 ? void 0 : textOverrides.supportsText) || placeholder })] })), errors.map(function (_a) {
8485
+ : instructionsText }), jsxRuntime.jsx("div", { className: "p-p--small tc-grey-500", children: (textOverrides === null || textOverrides === void 0 ? void 0 : textOverrides.supportsText) || placeholder })] })), errors.map(function (_a) {
8423
8486
  var id = _a.id, message = _a.message;
8424
8487
  return message && (jsxRuntime.jsx(UploadFileCell, { uploadStatus: "ERROR", file: {
8425
8488
  error: message,
@@ -16291,63 +16354,6 @@ var css_248z$4 = ".Table-module_wrapper__2MMNq {\n position: relative;\n}\n\n.T
16291
16354
  var styles$4 = {"wrapper":"Table-module_wrapper__2MMNq","container":"Table-module_container__3VFLP","stickyHeader":"Table-module_stickyHeader__2uEpP","modalContent":"Table-module_modalContent__1PNgv"};
16292
16355
  styleInject(css_248z$4);
16293
16356
 
16294
- var breakpointLookup = function (breakpoint) {
16295
- if (typeof window === 'undefined') {
16296
- return {
16297
- initialValue: false,
16298
- queryString: '',
16299
- };
16300
- }
16301
- switch (breakpoint) {
16302
- case 'BELOW_TABLET':
16303
- return {
16304
- initialValue: window.innerWidth <= 720, // 45rem = 720px = tablet breakpoint
16305
- queryString: '(max-width: 45rem)',
16306
- };
16307
- case 'BELOW_DESKTOP':
16308
- return {
16309
- initialValue: window.innerWidth <= 1024, // 64rem = 1024px = desktop breakpoint
16310
- queryString: '(max-width: 64rem)',
16311
- };
16312
- case 'ABOVE_MOBILE':
16313
- return {
16314
- initialValue: window.innerWidth >= 544, // 34rem = 544px = mobile breakpoint}
16315
- queryString: '(min-width: 34rem)',
16316
- };
16317
- case 'ABOVE_TABLET':
16318
- return {
16319
- initialValue: window.innerWidth >= 720, // 45rem = 720px = tablet breakpoint
16320
- queryString: '(min-width: 45rem)',
16321
- };
16322
- case 'ABOVE_DESKTOP':
16323
- return {
16324
- initialValue: window.innerWidth >= 1024, // 64rem = 1024px = desktop breakpoint
16325
- queryString: '(min-width: 64rem)',
16326
- };
16327
- case 'BELOW_MOBILE':
16328
- default:
16329
- return {
16330
- initialValue: window.innerWidth <= 544, // 34rem = 544px = mobile breakpoint}
16331
- queryString: '(max-width: 34rem)',
16332
- };
16333
- }
16334
- };
16335
- var useMediaQuery = function (breakpoint) {
16336
- var _a = breakpointLookup(breakpoint), initialValue = _a.initialValue, queryString = _a.queryString;
16337
- var _b = React.useState(initialValue), matchesBreakpoint = _b[0], setMatchesBreakpoint = _b[1];
16338
- React.useEffect(function () {
16339
- var mediaQuery = window.matchMedia(queryString);
16340
- var updateMediaQuery = function (e) {
16341
- return setMatchesBreakpoint(e.matches);
16342
- };
16343
- mediaQuery.addEventListener('change', updateMediaQuery);
16344
- return function () {
16345
- mediaQuery.removeEventListener('change', updateMediaQuery);
16346
- };
16347
- }, [queryString]);
16348
- return matchesBreakpoint;
16349
- };
16350
-
16351
16357
  var css_248z$3 = ".TableSection-module_table__sNbDq {\n border-collapse: collapse;\n table-layout: fixed;\n}\n@media (min-width: 34rem) {\n .TableSection-module_table__sNbDq {\n min-width: 845px;\n }\n}\n\n.TableSection-module_tr__UbkbE {\n min-height: 72px;\n}";
16352
16358
  var styles$3 = {"table":"TableSection-module_table__sNbDq","tr":"TableSection-module_tr__UbkbE"};
16353
16359
  styleInject(css_248z$3);