@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,7 +1,7 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { useState } from 'react';
3
3
  import { Checkbox } from './index.js';
4
- import { i as images } from '../../../index-e81a1766.js';
4
+ import { i as images } from '../../../index-31224f74.js';
5
5
  import '../../../tslib.es6-5bc94358.js';
6
6
  import '../../../index-e9e37a34.js';
7
7
  import '../../../style-inject.es-1f59c1d0.js';
@@ -1,7 +1,7 @@
1
1
  import { a as __rest, _ as __assign } from '../../../tslib.es6-5bc94358.js';
2
2
  import { jsx } from 'react/jsx-runtime';
3
3
  import { useRef, useState, useEffect } from 'react';
4
- import Input from '../index.js';
4
+ import { Input } from '../index.js';
5
5
  import '../../../index-e9e37a34.js';
6
6
  import '../../../index-fb46adf9.js';
7
7
  import '../../../style-inject.es-1f59c1d0.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../src/lib/components/input/currency/format/index.ts","../../../../../../src/lib/components/input/currency/index.tsx"],"sourcesContent":["export const formatInput = (input: string): string => {\n const decimalSeparator = input.includes(',') ? ',' : '.';\n const parts = input.split(decimalSeparator);\n const floor = parts[0];\n const ceiling = parts[1];\n parts[0] = floor.replace(/\\B(?=(\\d{3})+(?!\\d))/g, ' ');\n if (ceiling) {\n parts[1] = ceiling.slice(0, Math.min(ceiling.length, 2));\n }\n return parts.join('.');\n};\n\nexport function reverseFormatInput(input: string): number {\n return Number(input.replace(/,/, '.').replace(/\\s/g, ''));\n}\n","import { useEffect, useRef, useState } from 'react';\n\nimport { formatInput, reverseFormatInput } from './format';\nimport Input, { InputProps } from '..';\n\nconst CurrencyInput = ({\n value,\n onChange,\n type,\n ...props\n}: {\n value?: number;\n placeholder?: string;\n onChange?: (value: number) => void;\n} & Omit<InputProps, 'onChange' | 'value' | 'ref'>) => {\n const inputRef = useRef<HTMLInputElement | null>(null);\n const [cursor, setCursor] = useState<number | null>(null);\n const [shadowValue, setShadowValue] = useState('');\n\n const formattedShadowValue = formatInput(\n shadowValue\n .replace(/ /g, '') // remove all whitespace\n .replace(',', '.') // change commas to dot for decimal separator\n .replace('.', 'DECIMAL_SEPARATOR') // Gymnastic to remove all the but the first decimal separators 🤸\n .replace(/\\./g, '')\n .replace('DECIMAL_SEPARATOR', '.') // End of the Gymnastic 🤸\n .replace(/[^\\d\\\\.]/g, '') // remove all non decimal and dot\n );\n\n useEffect(() => {\n if (value && value !== reverseFormatInput(shadowValue)) {\n setShadowValue(formatInput(value.toString()));\n }\n // eslint-disable-next-line\n }, [value]);\n\n useEffect(() => {\n onChange?.(reverseFormatInput(shadowValue));\n // eslint-disable-next-line\n }, [shadowValue]);\n\n useEffect(() => {\n if (!inputRef.current || !cursor) {\n return;\n }\n\n const cursorDiff = String(formattedShadowValue).length - String(shadowValue).length;\n const newCursor = cursorDiff + cursor;\n\n inputRef.current.selectionStart = newCursor;\n inputRef.current.selectionEnd = newCursor;\n },[cursor, formattedShadowValue, shadowValue])\n\n return (\n <Input\n prefix=\"€\"\n ref={inputRef}\n type=\"string\"\n value={formattedShadowValue}\n onChange={(e) => {\n setCursor(e.target.selectionStart);\n setShadowValue(e.target.value);\n }}\n {...props}\n />\n );\n};\n\nexport default CurrencyInput;\n"],"names":["_jsx"],"mappings":";;;;;;;;AAAO,IAAM,WAAW,GAAG,UAAC,KAAa;IACvC,IAAM,gBAAgB,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC;IACzD,IAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAC5C,IAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACvB,IAAM,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACzB,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,uBAAuB,EAAE,GAAG,CAAC,CAAC;IACvD,IAAI,OAAO,EAAE;QACX,KAAK,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;KAC1D;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC,CAAC;SAEc,kBAAkB,CAAC,KAAa;IAC9C,OAAO,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;AAC5D;;ICTM,aAAa,GAAG,UAAC,EAS2B;QARhD,KAAK,WAAA,EACL,QAAQ,cAAA,SACJ,MACD,KAAK,cAJa,6BAKtB;IAKC,IAAM,QAAQ,GAAG,MAAM,CAA0B,IAAI,CAAC,CAAC;IACjD,IAAA,KAAsB,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AAoB,EAAE,WAAW,CAAC,CAAC,CAAA;IAE9C,QACEA,IAAC,KAAK,aACJ,MAAM,EAAC,QAAG,EACV,GAAG,EAAE,QAAQ,EACb,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE,oBAAoB,EAC3B,QAAQ,EAAE,UAAC,CAAC;YACV,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;YACnC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;SAChC,IACG,KAAK,UACT,EACF;AACJ;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../src/lib/components/input/currency/format/index.ts","../../../../../../src/lib/components/input/currency/index.tsx"],"sourcesContent":["export const formatInput = (input: string): string => {\n const decimalSeparator = input.includes(',') ? ',' : '.';\n const parts = input.split(decimalSeparator);\n const floor = parts[0];\n const ceiling = parts[1];\n parts[0] = floor.replace(/\\B(?=(\\d{3})+(?!\\d))/g, ' ');\n if (ceiling) {\n parts[1] = ceiling.slice(0, Math.min(ceiling.length, 2));\n }\n return parts.join('.');\n};\n\nexport function reverseFormatInput(input: string): number {\n return Number(input.replace(/,/, '.').replace(/\\s/g, ''));\n}\n","import { useEffect, useRef, useState } from 'react';\n\nimport { formatInput, reverseFormatInput } from './format';\nimport { Input, InputProps } from '..';\n\nconst CurrencyInput = ({\n value,\n onChange,\n type,\n ...props\n}: {\n value?: number;\n placeholder?: string;\n onChange?: (value: number) => void;\n} & Omit<InputProps, 'onChange' | 'value' | 'ref'>) => {\n const inputRef = useRef<HTMLInputElement | null>(null);\n const [cursor, setCursor] = useState<number | null>(null);\n const [shadowValue, setShadowValue] = useState('');\n\n const formattedShadowValue = formatInput(\n shadowValue\n .replace(/ /g, '') // remove all whitespace\n .replace(',', '.') // change commas to dot for decimal separator\n .replace('.', 'DECIMAL_SEPARATOR') // Gymnastic to remove all the but the first decimal separators 🤸\n .replace(/\\./g, '')\n .replace('DECIMAL_SEPARATOR', '.') // End of the Gymnastic 🤸\n .replace(/[^\\d\\\\.]/g, '') // remove all non decimal and dot\n );\n\n useEffect(() => {\n if (value && value !== reverseFormatInput(shadowValue)) {\n setShadowValue(formatInput(value.toString()));\n }\n // eslint-disable-next-line\n }, [value]);\n\n useEffect(() => {\n onChange?.(reverseFormatInput(shadowValue));\n // eslint-disable-next-line\n }, [shadowValue]);\n\n useEffect(() => {\n if (!inputRef.current || !cursor) {\n return;\n }\n\n const cursorDiff = String(formattedShadowValue).length - String(shadowValue).length;\n const newCursor = cursorDiff + cursor;\n\n inputRef.current.selectionStart = newCursor;\n inputRef.current.selectionEnd = newCursor;\n },[cursor, formattedShadowValue, shadowValue])\n\n return (\n <Input\n prefix=\"€\"\n ref={inputRef}\n type=\"string\"\n value={formattedShadowValue}\n onChange={(e) => {\n setCursor(e.target.selectionStart);\n setShadowValue(e.target.value);\n }}\n {...props}\n />\n );\n};\n\nexport default CurrencyInput;\n"],"names":["_jsx"],"mappings":";;;;;;;;AAAO,IAAM,WAAW,GAAG,UAAC,KAAa;IACvC,IAAM,gBAAgB,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC;IACzD,IAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAC5C,IAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACvB,IAAM,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACzB,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,uBAAuB,EAAE,GAAG,CAAC,CAAC;IACvD,IAAI,OAAO,EAAE;QACX,KAAK,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;KAC1D;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzB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AAO,IAAI,CAAC,MAAM,EAAE;YAChC,OAAO;SACR;QAED,IAAM,UAAU,GAAI,MAAM,CAAC,oBAAoB,CAAC,CAAC,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC;QACrF,IAAM,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC;QAEtC,QAAQ,CAAC,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC;QAC5C,QAAQ,CAAC,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;KAC3C,EAAC,CAAC,MAAM,EAAE,oBAAoB,EAAE,WAAW,CAAC,CAAC,CAAA;IAE9C,QACEA,IAAC,KAAK,aACJ,MAAM,EAAC,QAAG,EACV,GAAG,EAAE,QAAQ,EACb,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE,oBAAoB,EAC3B,QAAQ,EAAE,UAAC,CAAC;YACV,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;YACnC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;SAChC,IACG,KAAK,UACT,EACF;AACJ;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { a as __rest, _ as __assign } from '../../../tslib.es6-5bc94358.js';
2
2
  import { jsx } from 'react/jsx-runtime';
3
- import Input from '../index.js';
3
+ import { Input } from '../index.js';
4
4
  import 'react';
5
5
  import '../../../index-e9e37a34.js';
6
6
  import '../../../index-fb46adf9.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../src/lib/components/input/iban/formatIban/index.ts","../../../../../../src/lib/components/input/iban/index.tsx"],"sourcesContent":["const IBAN_CHAR_LIMIT = 4;\n\nexport const formatIban = (iban?: string): string => {\n if (iban) {\n const cleanIban = iban\n .replace(/\\s\\s+/g, ' ')\n .replace(/[^0-9a-zA-Z]/gi, '')\n .toUpperCase();\n\n const values: string[] = [];\n\n cleanIban.split('').forEach((char, idx) => {\n if (idx % IBAN_CHAR_LIMIT === 0) {\n values.push(cleanIban.substring(idx, idx + IBAN_CHAR_LIMIT));\n }\n });\n\n return values.join(' ');\n }\n\n return '';\n};\n","import Input, { InputProps } from '..';\n\nimport { formatIban } from './formatIban';\n\nconst IbanInput = ({\n value,\n onChange,\n ...props\n}: {\n value?: string;\n onChange: (value: string) => void;\n} & Omit<InputProps, 'onChange' | 'value' | 'ref'>) => (\n <Input\n value={formatIban(value)}\n onChange={(e) => onChange(formatIban(e.target.value))}\n {...props}\n />\n);\n\nexport default IbanInput;\n"],"names":["_jsx"],"mappings":";;;;;;;;AAAA,IAAM,eAAe,GAAG,CAAC,CAAC;AAEnB,IAAM,UAAU,GAAG,UAAC,IAAa;IACtC,IAAI,IAAI,EAAE;QACR,IAAM,WAAS,GAAG,IAAI;aACnB,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC;aACtB,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC;aAC7B,WAAW,EAAE,CAAC;QAEjB,IAAM,QAAM,GAAa,EAAE,CAAC;QAE5B,WAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,UAAC,IAAI,EAAE,GAAG;YACpC,IAAI,GAAG,GAAG,eAAe,KAAK,CAAC,EAAE;gBAC/B,QAAM,CAAC,IAAI,CAAC,WAAS,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,GAAG,eAAe,CAAC,CAAC,CAAC;aAC9D;SACF,CAAC,CAAC;QAEH,OAAO,QAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACzB;IAED,OAAO,EAAE,CAAC;AACZ,CAAC;;ICjBK,SAAS,GAAG,UAAC,EAO+B;IANhD,IAAA,KAAK,WAAA,EACL,QAAQ,cAAA,EACL,KAAK,cAHS,qBAIlB,CADS;IAI6C,QACrDA,IAAC,KAAK,aACJ,KAAK,EAAE,UAAU,CAAC,KAAK,CAAC,EACxB,QAAQ,EAAE,UAAC,CAAC,IAAK,OAAA,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,GAAA,IACjD,KAAK,UACT,EACH;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../src/lib/components/input/iban/formatIban/index.ts","../../../../../../src/lib/components/input/iban/index.tsx"],"sourcesContent":["const IBAN_CHAR_LIMIT = 4;\n\nexport const formatIban = (iban?: string): string => {\n if (iban) {\n const cleanIban = iban\n .replace(/\\s\\s+/g, ' ')\n .replace(/[^0-9a-zA-Z]/gi, '')\n .toUpperCase();\n\n const values: string[] = [];\n\n cleanIban.split('').forEach((char, idx) => {\n if (idx % IBAN_CHAR_LIMIT === 0) {\n values.push(cleanIban.substring(idx, idx + IBAN_CHAR_LIMIT));\n }\n });\n\n return values.join(' ');\n }\n\n return '';\n};\n","import { Input, InputProps } from '..';\n\nimport { formatIban } from './formatIban';\n\nconst IbanInput = ({\n value,\n onChange,\n ...props\n}: {\n value?: string;\n onChange: (value: string) => void;\n} & Omit<InputProps, 'onChange' | 'value' | 'ref'>) => (\n <Input\n value={formatIban(value)}\n onChange={(e) => onChange(formatIban(e.target.value))}\n {...props}\n />\n);\n\nexport default IbanInput;\n"],"names":["_jsx"],"mappings":";;;;;;;;AAAA,IAAM,eAAe,GAAG,CAAC,CAAC;AAEnB,IAAM,UAAU,GAAG,UAAC,IAAa;IACtC,IAAI,IAAI,EAAE;QACR,IAAM,WAAS,GAAG,IAAI;aACnB,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC;aACtB,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC;aAC7B,WAAW,EAAE,CAAC;QAEjB,IAAM,QAAM,GAAa,EAAE,CAAC;QAE5B,WAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,UAAC,IAAI,EAAE,GAAG;YACpC,IAAI,GAAG,GAAG,eAAe,KAAK,CAAC,EAAE;gBAC/B,QAAM,CAAC,IAAI,CAAC,WAAS,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,GAAG,eAAe,CAAC,CAAC,CAAC;aAC9D;SACF,CAAC,CAAC;QAEH,OAAO,QAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACzB;IAED,OAAO,EAAE,CAAC;AACZ,CAAC;;ICjBK,SAAS,GAAG,UAAC,EAO+B;IANhD,IAAA,KAAK,WAAA,EACL,QAAQ,cAAA,EACL,KAAK,cAHS,qBAIlB,CADS;IAI6C,QACrDA,IAAC,KAAK,aACJ,KAAK,EAAE,UAAU,CAAC,KAAK,CAAC,EACxB,QAAQ,EAAE,UAAC,CAAC,IAAK,OAAA,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,GAAA,IACjD,KAAK,UACT,EACH;;;;;"}
@@ -25,5 +25,5 @@ var Input = React__default.forwardRef(function (_a, ref) {
25
25
  error && (jsx("p", __assign({ className: "p-p--small tc-red-500 w100 " + styles.error }, { children: error }), void 0))] }), void 0));
26
26
  });
27
27
 
28
- export default Input;
28
+ export { Input };
29
29
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/lib/components/input/index.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport classnames from 'classnames';\nimport generateId from '../../util/generateId';\n\nimport styles from './style.module.scss';\n\n// 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.\nexport type InputProps = {\n error?: string;\n prefix?: string;\n label?: string;\n id?: string;\n hideLabel?: boolean;\n} & Omit<JSX.IntrinsicElements['input'], 'enterKeyHint'> &\n Partial<Pick<JSX.IntrinsicElements['input'], 'enterKeyHint'>>;\n\nexport default React.forwardRef(\n (\n {\n className,\n placeholder,\n label,\n id,\n prefix,\n error,\n disabled,\n hideLabel = false,\n ...props\n }: InputProps,\n ref?: React.ForwardedRef<HTMLInputElement>\n ) => {\n const [uniqueId] = useState(id ?? generateId());\n return (\n <div className={`${styles.container} ${className ?? ''}`}>\n {label && (\n <label\n htmlFor={uniqueId}\n className={classnames('p-p', styles.label, {\n [styles['label--with-error']]: error,\n 'sr-only': hideLabel,\n })}\n >\n {label}\n </label>\n )}\n <div style={{ position: 'relative' }}>\n <input\n id={uniqueId}\n data-testid=\"ds-input-input\"\n type=\"text\"\n ref={ref}\n className={classnames(\n error ? 'p-input--error' : 'p-input',\n !label && placeholder && placeholder.length > 0\n ? styles.input\n : styles['input--no-placeholder'],\n { [styles['input--with-prefix']]: prefix }\n )}\n placeholder={label ? placeholder : ' '}\n disabled={disabled}\n {...props}\n />\n {prefix && (\n <span\n className={classnames(\n styles.prefix,\n { [styles['prefix--with-error']]: error },\n { [styles['prefix--disabled']]: disabled }\n )}\n >\n {prefix}\n </span>\n )}\n {!label && (\n <label\n htmlFor={uniqueId}\n className={classnames(\n styles.placeholder,\n { [styles['placeholder--with-prefix']]: prefix },\n { [styles['placeholder--with-error']]: error }\n )}\n >\n {placeholder}\n </label>\n )}\n </div>\n {error && (\n <p className={`p-p--small tc-red-500 w100 ${styles.error}`}>\n {error}\n </p>\n )}\n </div>\n );\n }\n);\n"],"names":["React","_jsxs","_jsx"],"mappings":";;;;;;;;;;;AAgBA,YAAeA,cAAK,CAAC,UAAU,CAC7B,UACE,EAUa,EACb,GAA0C;;IAVxC,IAAA,SAAS,eAAA,EACT,WAAW,iBAAA,EACX,KAAK,WAAA,EACL,EAAE,QAAA,EACF,MAAM,YAAA,EACN,KAAK,WAAA,EACL,QAAQ,cAAA,EACR,iBAAiB,EAAjB,SAAS,mBAAG,KAAK,KAAA,EACd,KAAK,cATV,uFAUC,CADS;IAIH,IAAA,QAAQ,GAAI,QAAQ,CAAC,EAAE,aAAF,EAAE,cAAF,EAAE,GAAI,UAAU,EAAE,CAAC,GAAhC,CAAiC;IAChD,QACEC,uBAAK,SAAS,EAAK,MAAM,CAAC,SAAS,UAAI,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,EAAE,CAAE,iBACrD,KAAK,KACJC,wBACE,OAAO,EA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"index.js","sources":["../../../../../src/lib/components/input/index.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport classnames from 'classnames';\nimport generateId from '../../util/generateId';\n\nimport styles from './style.module.scss';\n\n// 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.\nexport type InputProps = Omit<JSX.IntrinsicElements['input'], 'enterKeyHint'> &\n Partial<Pick<JSX.IntrinsicElements['input'], 'enterKeyHint'>> & {\n error?: string;\n prefix?: string;\n label?: string;\n id?: string;\n hideLabel?: boolean;\n};\n\nexport const Input = React.forwardRef(\n (\n {\n className,\n placeholder,\n label,\n id,\n prefix,\n error,\n disabled,\n hideLabel = false,\n ...props\n }: InputProps,\n ref?: React.ForwardedRef<HTMLInputElement>\n ) => {\n const [uniqueId] = useState(id ?? generateId());\n return (\n <div className={`${styles.container} ${className ?? ''}`}>\n {label && (\n <label\n htmlFor={uniqueId}\n className={classnames('p-p', styles.label, {\n [styles['label--with-error']]: error,\n 'sr-only': hideLabel,\n })}\n >\n {label}\n </label>\n )}\n <div style={{ position: 'relative' }}>\n <input\n id={uniqueId}\n data-testid=\"ds-input-input\"\n type=\"text\"\n ref={ref}\n className={classnames(\n error ? 'p-input--error' : 'p-input',\n !label && placeholder && placeholder.length > 0\n ? styles.input\n : styles['input--no-placeholder'],\n { [styles['input--with-prefix']]: prefix }\n )}\n placeholder={label ? placeholder : ' '}\n disabled={disabled}\n {...props}\n />\n {prefix && (\n <span\n className={classnames(\n styles.prefix,\n { [styles['prefix--with-error']]: error },\n { [styles['prefix--disabled']]: disabled }\n )}\n >\n {prefix}\n </span>\n )}\n {!label && (\n <label\n htmlFor={uniqueId}\n className={classnames(\n styles.placeholder,\n { [styles['placeholder--with-prefix']]: prefix },\n { [styles['placeholder--with-error']]: error }\n )}\n >\n {placeholder}\n </label>\n )}\n </div>\n {error && (\n <p className={`p-p--small tc-red-500 w100 ${styles.error}`}>\n {error}\n </p>\n )}\n </div>\n );\n }\n);\n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,KACLA,uBACE,SAAS,EAAE,UAAU,CACnB,MAAM,CAAC,MAAM,YACX,GAAC,MAAM,CAAC,oBAAoB,CAAC,IAAG,KAAK,iBACrC,GAAC,MAAM,CAAC,kBAAkB,CAAC,IAAG,QAAQ,MACzC,gBAEA,MAAM,YACF,CACR;oBACA,CAAC,KAAK,KACLA,wBACE,OAAO,EAAE,QAAQ,EACjB,SAAS,EAAE,UAAU,CACnB,MAAM,CAAC,WAAW,YAChB,GAAC,MAAM,CAAC,0BAA0B,CAAC,IAAG,MAAM,iBAC5C,GAAC,MAAM,CAAC,yBAAyB,CAAC,IAAG,KAAK,MAC7C,gBAEA,WAAW,YACN,CACT,aACG;YACL,KAAK,KACJA,oBAAG,SAAS,EAAE,gCAA8B,MAAM,CAAC,KAAO,gBACvD,KAAK,YACJ,CACL,aACG,EACN;AACJ,CAAC;;;;"}
@@ -0,0 +1,85 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { useState } from 'react';
3
+ import { Input } from './index.js';
4
+ import '../../tslib.es6-5bc94358.js';
5
+ import '../../index-e9e37a34.js';
6
+ import '../../index-fb46adf9.js';
7
+ import '../../style-inject.es-1f59c1d0.js';
8
+
9
+ var sharedConfig = {
10
+ value: {
11
+ defaultValue: '',
12
+ description: 'Current input value.',
13
+ control: { type: 'text' }
14
+ },
15
+ className: {
16
+ description: 'Wrapper classNames for custom styling',
17
+ defaultValue: '',
18
+ control: { type: 'text' }
19
+ },
20
+ placeholder: {
21
+ description: 'Placeholder for DirtySwan Input component',
22
+ defaultValue: 'Placeholder',
23
+ control: { type: 'text' }
24
+ },
25
+ label: {
26
+ description: 'Label of the Input component',
27
+ defaultValue: 'Input Label',
28
+ control: { type: 'text' }
29
+ },
30
+ hideLabel: {
31
+ description: 'Whether or not a label should be hidden.. This is needed for accessibility purposes and a label should always be provided',
32
+ defaultValue: false,
33
+ control: { type: 'boolean' }
34
+ },
35
+ prefix: {
36
+ description: 'A prefix that can be displayed on the left of the input. Specially useful for currencies.',
37
+ defaultValue: '£',
38
+ control: { type: 'text' }
39
+ },
40
+ id: {
41
+ description: 'Unique ID identifier of the input. Relevant for accessibility.',
42
+ defaultValue: '1234567890',
43
+ control: { type: 'text' }
44
+ },
45
+ error: {
46
+ description: 'Error message that will also make input show on error state.',
47
+ defaultValue: '',
48
+ control: { type: 'text' },
49
+ table: {
50
+ type: {
51
+ summary: 'string | boolean'
52
+ },
53
+ },
54
+ },
55
+ onChange: {
56
+ description: 'Function that is called when value of current input changes',
57
+ action: true,
58
+ table: {
59
+ category: "Callbacks",
60
+ },
61
+ },
62
+ };
63
+
64
+ var story = {
65
+ title: 'JSX/Inputs/Input',
66
+ component: Input,
67
+ argTypes: sharedConfig,
68
+ parameters: {
69
+ componentSubtitle: 'The default input component is used to gather informations from the user.'
70
+ }
71
+ };
72
+ var InputStory = function (_a) {
73
+ var onChange = _a.onChange, className = _a.className, placeholder = _a.placeholder, value = _a.value, label = _a.label, hideLabel = _a.hideLabel, prefix = _a.prefix, error = _a.error;
74
+ var _b = useState(value), newValue = _b[0], setValue = _b[1];
75
+ var handleOnChange = function (event) {
76
+ setValue(event.target.value);
77
+ onChange === null || onChange === void 0 ? void 0 : onChange(event);
78
+ };
79
+ return (jsx(Input, { onChange: handleOnChange, value: newValue, className: className, placeholder: placeholder, label: label, hideLabel: hideLabel, prefix: prefix, error: error }, void 0));
80
+ };
81
+ InputStory.storyName = 'Input';
82
+
83
+ export default story;
84
+ export { InputStory };
85
+ //# sourceMappingURL=input.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input.stories.js","sources":["../../../../../src/lib/components/input/stories/config.ts","../../../../../src/lib/components/input/input.stories.tsx"],"sourcesContent":["const sharedConfig = {\n value: {\n defaultValue: '',\n description: 'Current input value.',\n control: { type: 'text' }\n },\n className: {\n description: 'Wrapper classNames for custom styling',\n defaultValue: '',\n control: { type: 'text' }\n },\n placeholder: {\n description: 'Placeholder for DirtySwan Input component',\n defaultValue: 'Placeholder',\n control: { type: 'text' }\n },\n label: {\n description: 'Label of the Input component',\n defaultValue: 'Input Label',\n control: { type: 'text' }\n },\n hideLabel: {\n description: 'Whether or not a label should be hidden.. This is needed for accessibility purposes and a label should always be provided',\n defaultValue: false,\n control: { type: 'boolean' }\n },\n prefix: {\n description: 'A prefix that can be displayed on the left of the input. Specially useful for currencies.',\n defaultValue: '£',\n control: { type: 'text' }\n },\n id: {\n description: 'Unique ID identifier of the input. Relevant for accessibility.',\n defaultValue: '1234567890',\n control: { type: 'text' }\n },\n error: {\n description: 'Error message that will also make input show on error state.',\n defaultValue: '',\n control: { type: 'text' },\n table: {\n type: { \n summary: 'string | boolean'\n },\n },\n },\n onChange: {\n description: 'Function that is called when value of current input changes',\n action: true,\n table: {\n category: \"Callbacks\",\n },\n },\n} \n\nexport default sharedConfig;","\nimport { ChangeEvent, useState } from 'react';\nimport { Input, InputProps } from '.';\nimport sharedConfig from './stories/config';\n\nconst story = {\n title: 'JSX/Inputs/Input',\n component: Input,\n argTypes: sharedConfig,\n parameters: {\n componentSubtitle: 'The default input component is used to gather informations from the user.'\n }\n};\n\nexport const InputStory = ({ \n onChange,\n className,\n placeholder,\n value,\n label,\n hideLabel,\n prefix,\n error\n}: InputProps) => {\n const [newValue, setValue] = useState(value);\n\n const handleOnChange = (event: ChangeEvent<HTMLInputElement>) => {\n setValue(event.target.value)\n onChange?.(event);\n }\n\n return (\n <Input \n onChange={handleOnChange}\n value={newValue}\n className={className}\n placeholder={placeholder}\n label={label}\n hideLabel={hideLabel}\n prefix={prefix}\n error={error}\n />\n );\n};\n\nInputStory.storyName = 'Input';\n\nexport default story;\n"],"names":["_jsx"],"mappings":";;;;;;;;AAAA,IAAM,YAAY,GAAG;IACnB,KAAK,EAAE;QACL,YAAY,EAAE,EAAE;QAChB,WAAW,EAAE,sBAAsB;QACnC,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;KAC1B;IACD,SAAS,EAAE;QACT,WAAW,EAAE,uCAAuC;QACpD,YAAY,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AAA,EACX,KAAK,WAAA,EACL,KAAK,WAAA,EACL,SAAS,eAAA,EACT,MAAM,YAAA,EACN,KAAK,WAAA;IAEC,IAAA,KAAuB,QAAQ,CAAC,KAAK,CAAC,EAArC,QAAQ,QAAA,EAAE,QAAQ,QAAmB,CAAC;IAE7C,IAAM,cAAc,GAAG,UAAC,KAAoC;QAC1D,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QAC5B,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAG,KAAK,CAAC,CAAC;KACnB,CAAA;IAED,QACEA,IAAC,KAAK,IACJ,QAAQ,EAAE,cAAc,EACxB,KAAK,EAAE,QAAQ,EACf,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,WACZ,EACF;AACJ,EAAE;AAEF,UAAU,CAAC,SAAS,GAAG,OAAO;;;;;"}
@@ -2805,9 +2805,9 @@ var getErrorMessage = function (_a, _b, textOverrides) {
2805
2805
  }
2806
2806
  };
2807
2807
 
2808
- var MultiDropZone = function (_a) {
2808
+ var MultiDropzone = function (_a) {
2809
2809
  var _b;
2810
- var accept = _a.accept, uploadedFiles = _a.uploadedFiles, onFileSelect = _a.onFileSelect, uploading = _a.uploading, onRemoveFile = _a.onRemoveFile, _c = _a.isCondensed, isCondensed = _c === void 0 ? false : _c, _d = _a.maxFiles, maxFiles = _d === void 0 ? 0 : _d, maxSize = _a.maxSize, textOverrides = _a.textOverrides;
2810
+ 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;
2811
2811
  var _e = useState([]), errors = _e[0], setErrors = _e[1];
2812
2812
  var formattedAccept = getFormattedAcceptObject(accept);
2813
2813
  var fileList = formatAcceptFileList(formattedAccept);
@@ -2858,5 +2858,5 @@ var MultiDropZone = function (_a) {
2858
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));
2859
2859
  };
2860
2860
 
2861
- export default MultiDropZone;
2861
+ export { MultiDropzone };
2862
2862
  //# sourceMappingURL=index.js.map