@powerhousedao/document-engineering 1.29.0 → 1.31.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 (290) hide show
  1. package/dist/src/scalars/components/phone-number-field/index.d.ts +3 -0
  2. package/dist/src/scalars/components/phone-number-field/index.d.ts.map +1 -0
  3. package/dist/src/scalars/components/phone-number-field/index.js +2 -0
  4. package/dist/src/scalars/components/phone-number-field/index.js.map +1 -0
  5. package/dist/src/scalars/components/phone-number-field/phone-number-field.d.ts +3 -0
  6. package/dist/src/scalars/components/phone-number-field/phone-number-field.d.ts.map +1 -0
  7. package/dist/src/scalars/components/phone-number-field/phone-number-field.js +33 -0
  8. package/dist/src/scalars/components/phone-number-field/phone-number-field.js.map +1 -0
  9. package/dist/src/scalars/components/phone-number-field/types.d.ts +5 -0
  10. package/dist/src/scalars/components/phone-number-field/types.d.ts.map +1 -0
  11. package/dist/src/scalars/components/phone-number-field/types.js +2 -0
  12. package/dist/src/scalars/components/phone-number-field/types.js.map +1 -0
  13. package/dist/src/table/components/default-cell-editors/aid-editor.d.ts +4 -0
  14. package/dist/src/table/components/default-cell-editors/aid-editor.d.ts.map +1 -0
  15. package/dist/src/table/components/default-cell-editors/aid-editor.js +12 -0
  16. package/dist/src/table/components/default-cell-editors/aid-editor.js.map +1 -0
  17. package/dist/src/table/components/default-cell-editors/amount-editor.d.ts +4 -0
  18. package/dist/src/table/components/default-cell-editors/amount-editor.d.ts.map +1 -0
  19. package/dist/src/table/components/default-cell-editors/amount-editor.js +15 -0
  20. package/dist/src/table/components/default-cell-editors/amount-editor.js.map +1 -0
  21. package/dist/src/table/components/default-cell-editors/boolean-editor.d.ts +1 -1
  22. package/dist/src/table/components/default-cell-editors/boolean-editor.d.ts.map +1 -1
  23. package/dist/src/table/components/default-cell-editors/boolean-editor.js +1 -1
  24. package/dist/src/table/components/default-cell-editors/boolean-editor.js.map +1 -1
  25. package/dist/src/table/components/default-cell-editors/country-editor.d.ts +4 -0
  26. package/dist/src/table/components/default-cell-editors/country-editor.d.ts.map +1 -0
  27. package/dist/src/table/components/default-cell-editors/country-editor.js +12 -0
  28. package/dist/src/table/components/default-cell-editors/country-editor.js.map +1 -0
  29. package/dist/src/table/components/default-cell-editors/currency-editor.d.ts +4 -0
  30. package/dist/src/table/components/default-cell-editors/currency-editor.d.ts.map +1 -0
  31. package/dist/src/table/components/default-cell-editors/currency-editor.js +12 -0
  32. package/dist/src/table/components/default-cell-editors/currency-editor.js.map +1 -0
  33. package/dist/src/table/components/default-cell-editors/date-editor.d.ts +4 -0
  34. package/dist/src/table/components/default-cell-editors/date-editor.d.ts.map +1 -0
  35. package/dist/src/table/components/default-cell-editors/date-editor.js +12 -0
  36. package/dist/src/table/components/default-cell-editors/date-editor.js.map +1 -0
  37. package/dist/src/table/components/default-cell-editors/datetime-editor.d.ts +4 -0
  38. package/dist/src/table/components/default-cell-editors/datetime-editor.d.ts.map +1 -0
  39. package/dist/src/table/components/default-cell-editors/datetime-editor.js +12 -0
  40. package/dist/src/table/components/default-cell-editors/datetime-editor.js.map +1 -0
  41. package/dist/src/table/components/default-cell-editors/email-editor.d.ts +4 -0
  42. package/dist/src/table/components/default-cell-editors/email-editor.d.ts.map +1 -0
  43. package/dist/src/table/components/default-cell-editors/email-editor.js +12 -0
  44. package/dist/src/table/components/default-cell-editors/email-editor.js.map +1 -0
  45. package/dist/src/table/components/default-cell-editors/enum-editor.d.ts +4 -0
  46. package/dist/src/table/components/default-cell-editors/enum-editor.d.ts.map +1 -0
  47. package/dist/src/table/components/default-cell-editors/enum-editor.js +12 -0
  48. package/dist/src/table/components/default-cell-editors/enum-editor.js.map +1 -0
  49. package/dist/src/table/components/default-cell-editors/get-cell-editor-fn.d.ts.map +1 -1
  50. package/dist/src/table/components/default-cell-editors/get-cell-editor-fn.js +44 -8
  51. package/dist/src/table/components/default-cell-editors/get-cell-editor-fn.js.map +1 -1
  52. package/dist/src/table/components/default-cell-editors/index.d.ts +3 -3
  53. package/dist/src/table/components/default-cell-editors/index.d.ts.map +1 -1
  54. package/dist/src/table/components/default-cell-editors/index.js +3 -3
  55. package/dist/src/table/components/default-cell-editors/index.js.map +1 -1
  56. package/dist/src/table/components/default-cell-editors/number-editor.d.ts +1 -1
  57. package/dist/src/table/components/default-cell-editors/number-editor.d.ts.map +1 -1
  58. package/dist/src/table/components/default-cell-editors/number-editor.js +1 -1
  59. package/dist/src/table/components/default-cell-editors/number-editor.js.map +1 -1
  60. package/dist/src/table/components/default-cell-editors/oid-editor.d.ts +4 -0
  61. package/dist/src/table/components/default-cell-editors/oid-editor.d.ts.map +1 -0
  62. package/dist/src/table/components/default-cell-editors/oid-editor.js +12 -0
  63. package/dist/src/table/components/default-cell-editors/oid-editor.js.map +1 -0
  64. package/dist/src/table/components/default-cell-editors/phid-editor.d.ts +4 -0
  65. package/dist/src/table/components/default-cell-editors/phid-editor.d.ts.map +1 -0
  66. package/dist/src/table/components/default-cell-editors/phid-editor.js +12 -0
  67. package/dist/src/table/components/default-cell-editors/phid-editor.js.map +1 -0
  68. package/dist/src/table/components/default-cell-editors/string-editor.d.ts +1 -1
  69. package/dist/src/table/components/default-cell-editors/string-editor.d.ts.map +1 -1
  70. package/dist/src/table/components/default-cell-editors/string-editor.js +1 -1
  71. package/dist/src/table/components/default-cell-editors/string-editor.js.map +1 -1
  72. package/dist/src/table/components/default-cell-editors/time-editor.d.ts +4 -0
  73. package/dist/src/table/components/default-cell-editors/time-editor.d.ts.map +1 -0
  74. package/dist/src/table/components/default-cell-editors/time-editor.js +12 -0
  75. package/dist/src/table/components/default-cell-editors/time-editor.js.map +1 -0
  76. package/dist/src/table/components/default-cell-editors/url-editor.d.ts +4 -0
  77. package/dist/src/table/components/default-cell-editors/url-editor.d.ts.map +1 -0
  78. package/dist/src/table/components/default-cell-editors/url-editor.js +12 -0
  79. package/dist/src/table/components/default-cell-editors/url-editor.js.map +1 -0
  80. package/dist/src/table/components/default-cell-renderers/aid-render.d.ts +4 -0
  81. package/dist/src/table/components/default-cell-renderers/aid-render.d.ts.map +1 -0
  82. package/dist/src/table/components/default-cell-renderers/aid-render.js +11 -0
  83. package/dist/src/table/components/default-cell-renderers/aid-render.js.map +1 -0
  84. package/dist/src/table/components/default-cell-renderers/amount-render.d.ts +4 -0
  85. package/dist/src/table/components/default-cell-renderers/amount-render.d.ts.map +1 -0
  86. package/dist/src/table/components/default-cell-renderers/amount-render.js +11 -0
  87. package/dist/src/table/components/default-cell-renderers/amount-render.js.map +1 -0
  88. package/dist/src/table/components/default-cell-renderers/country-render.d.ts +4 -0
  89. package/dist/src/table/components/default-cell-renderers/country-render.d.ts.map +1 -0
  90. package/dist/src/table/components/default-cell-renderers/country-render.js +11 -0
  91. package/dist/src/table/components/default-cell-renderers/country-render.js.map +1 -0
  92. package/dist/src/table/components/default-cell-renderers/currency-render.d.ts +4 -0
  93. package/dist/src/table/components/default-cell-renderers/currency-render.d.ts.map +1 -0
  94. package/dist/src/table/components/default-cell-renderers/currency-render.js +11 -0
  95. package/dist/src/table/components/default-cell-renderers/currency-render.js.map +1 -0
  96. package/dist/src/table/components/default-cell-renderers/date-render.d.ts +4 -0
  97. package/dist/src/table/components/default-cell-renderers/date-render.d.ts.map +1 -0
  98. package/dist/src/table/components/default-cell-renderers/date-render.js +24 -0
  99. package/dist/src/table/components/default-cell-renderers/date-render.js.map +1 -0
  100. package/dist/src/table/components/default-cell-renderers/datetime-render.d.ts +4 -0
  101. package/dist/src/table/components/default-cell-renderers/datetime-render.d.ts.map +1 -0
  102. package/dist/src/table/components/default-cell-renderers/datetime-render.js +24 -0
  103. package/dist/src/table/components/default-cell-renderers/datetime-render.js.map +1 -0
  104. package/dist/src/table/components/default-cell-renderers/email-render.d.ts +4 -0
  105. package/dist/src/table/components/default-cell-renderers/email-render.d.ts.map +1 -0
  106. package/dist/src/table/components/default-cell-renderers/email-render.js +11 -0
  107. package/dist/src/table/components/default-cell-renderers/email-render.js.map +1 -0
  108. package/dist/src/table/components/default-cell-renderers/enum-render.d.ts +4 -0
  109. package/dist/src/table/components/default-cell-renderers/enum-render.d.ts.map +1 -0
  110. package/dist/src/table/components/default-cell-renderers/enum-render.js +11 -0
  111. package/dist/src/table/components/default-cell-renderers/enum-render.js.map +1 -0
  112. package/dist/src/table/components/default-cell-renderers/get-render-fn.d.ts.map +1 -1
  113. package/dist/src/table/components/default-cell-renderers/get-render-fn.js +36 -0
  114. package/dist/src/table/components/default-cell-renderers/get-render-fn.js.map +1 -1
  115. package/dist/src/table/components/default-cell-renderers/oid-render.d.ts +4 -0
  116. package/dist/src/table/components/default-cell-renderers/oid-render.d.ts.map +1 -0
  117. package/dist/src/table/components/default-cell-renderers/oid-render.js +11 -0
  118. package/dist/src/table/components/default-cell-renderers/oid-render.js.map +1 -0
  119. package/dist/src/table/components/default-cell-renderers/phid-render.d.ts +4 -0
  120. package/dist/src/table/components/default-cell-renderers/phid-render.d.ts.map +1 -0
  121. package/dist/src/table/components/default-cell-renderers/phid-render.js +11 -0
  122. package/dist/src/table/components/default-cell-renderers/phid-render.js.map +1 -0
  123. package/dist/src/table/components/default-cell-renderers/time-render.d.ts +4 -0
  124. package/dist/src/table/components/default-cell-renderers/time-render.d.ts.map +1 -0
  125. package/dist/src/table/components/default-cell-renderers/time-render.js +11 -0
  126. package/dist/src/table/components/default-cell-renderers/time-render.js.map +1 -0
  127. package/dist/src/table/components/default-cell-renderers/url-render.d.ts +4 -0
  128. package/dist/src/table/components/default-cell-renderers/url-render.d.ts.map +1 -0
  129. package/dist/src/table/components/default-cell-renderers/url-render.js +12 -0
  130. package/dist/src/table/components/default-cell-renderers/url-render.js.map +1 -0
  131. package/dist/src/table/components/default-fns/default-column-config.d.ts.map +1 -1
  132. package/dist/src/table/components/default-fns/default-column-config.js +12 -0
  133. package/dist/src/table/components/default-fns/default-column-config.js.map +1 -1
  134. package/dist/src/table/components/default-sort-columns/default-sort-fns.d.ts.map +1 -1
  135. package/dist/src/table/components/default-sort-columns/default-sort-fns.js +12 -0
  136. package/dist/src/table/components/default-sort-columns/default-sort-fns.js.map +1 -1
  137. package/dist/src/table/components/rows/render-row.js +2 -2
  138. package/dist/src/table/components/rows/render-row.js.map +1 -1
  139. package/dist/src/table/components/rows/row-actions.d.ts.map +1 -1
  140. package/dist/src/table/components/rows/row-actions.js +5 -2
  141. package/dist/src/table/components/rows/row-actions.js.map +1 -1
  142. package/dist/src/table/components/table-provider/table-provider.d.ts.map +1 -1
  143. package/dist/src/table/components/table-provider/table-provider.js +2 -4
  144. package/dist/src/table/components/table-provider/table-provider.js.map +1 -1
  145. package/dist/src/table/examples/table-editing/table-editing.d.ts.map +1 -1
  146. package/dist/src/table/examples/table-editing/table-editing.js +7 -6
  147. package/dist/src/table/examples/table-editing/table-editing.js.map +1 -1
  148. package/dist/src/table/hooks/useGlobalTableKeyEvents.d.ts.map +1 -1
  149. package/dist/src/table/hooks/useGlobalTableKeyEvents.js +20 -0
  150. package/dist/src/table/hooks/useGlobalTableKeyEvents.js.map +1 -1
  151. package/dist/src/table/index.d.ts +1 -0
  152. package/dist/src/table/index.d.ts.map +1 -1
  153. package/dist/src/table/index.js +1 -0
  154. package/dist/src/table/index.js.map +1 -1
  155. package/dist/src/table/logic/table-api.d.ts.map +1 -1
  156. package/dist/src/table/logic/table-api.js +26 -9
  157. package/dist/src/table/logic/table-api.js.map +1 -1
  158. package/dist/src/table/table/mock-data.d.ts +1 -0
  159. package/dist/src/table/table/mock-data.d.ts.map +1 -1
  160. package/dist/src/table/table/mock-data.js +7 -0
  161. package/dist/src/table/table/mock-data.js.map +1 -1
  162. package/dist/src/table/table/object-set-table.d.ts.map +1 -1
  163. package/dist/src/table/table/object-set-table.js +1 -0
  164. package/dist/src/table/table/object-set-table.js.map +1 -1
  165. package/dist/src/table/table/types.d.ts +11 -2
  166. package/dist/src/table/table/types.d.ts.map +1 -1
  167. package/dist/src/ui/components/data-entry/amount-input/amount-input.d.ts.map +1 -1
  168. package/dist/src/ui/components/data-entry/amount-input/amount-input.js +2 -2
  169. package/dist/src/ui/components/data-entry/amount-input/amount-input.js.map +1 -1
  170. package/dist/src/ui/components/data-entry/country-code-picker/country-code-picker.d.ts.map +1 -1
  171. package/dist/src/ui/components/data-entry/country-code-picker/country-code-picker.js +8 -3
  172. package/dist/src/ui/components/data-entry/country-code-picker/country-code-picker.js.map +1 -1
  173. package/dist/src/ui/components/data-entry/file-input/examples/file-upload-item-example.d.ts +7 -0
  174. package/dist/src/ui/components/data-entry/file-input/examples/file-upload-item-example.d.ts.map +1 -0
  175. package/dist/src/ui/components/data-entry/file-input/examples/file-upload-item-example.js +64 -0
  176. package/dist/src/ui/components/data-entry/file-input/examples/file-upload-item-example.js.map +1 -0
  177. package/dist/src/ui/components/data-entry/file-input/examples/index.d.ts +2 -0
  178. package/dist/src/ui/components/data-entry/file-input/examples/index.d.ts.map +1 -0
  179. package/dist/src/ui/components/data-entry/file-input/examples/index.js +2 -0
  180. package/dist/src/ui/components/data-entry/file-input/examples/index.js.map +1 -0
  181. package/dist/src/ui/components/data-entry/file-input/file-input.d.ts.map +1 -1
  182. package/dist/src/ui/components/data-entry/file-input/file-input.js +14 -8
  183. package/dist/src/ui/components/data-entry/file-input/file-input.js.map +1 -1
  184. package/dist/src/ui/components/data-entry/file-input/sub-components/file-upload-item.d.ts +11 -3
  185. package/dist/src/ui/components/data-entry/file-input/sub-components/file-upload-item.d.ts.map +1 -1
  186. package/dist/src/ui/components/data-entry/file-input/sub-components/file-upload-item.js +24 -12
  187. package/dist/src/ui/components/data-entry/file-input/sub-components/file-upload-item.js.map +1 -1
  188. package/dist/src/ui/components/data-entry/file-input/sub-components/placeholder-corrupted.d.ts +9 -0
  189. package/dist/src/ui/components/data-entry/file-input/sub-components/placeholder-corrupted.d.ts.map +1 -0
  190. package/dist/src/ui/components/data-entry/file-input/sub-components/placeholder-corrupted.js +10 -0
  191. package/dist/src/ui/components/data-entry/file-input/sub-components/placeholder-corrupted.js.map +1 -0
  192. package/dist/src/ui/components/data-entry/file-input/sub-components/placeholder-loading.d.ts +8 -0
  193. package/dist/src/ui/components/data-entry/file-input/sub-components/placeholder-loading.d.ts.map +1 -0
  194. package/dist/src/ui/components/data-entry/file-input/sub-components/placeholder-loading.js +11 -0
  195. package/dist/src/ui/components/data-entry/file-input/sub-components/placeholder-loading.js.map +1 -0
  196. package/dist/src/ui/components/data-entry/file-input/sub-components/placeholder-unsupported.d.ts +6 -0
  197. package/dist/src/ui/components/data-entry/file-input/sub-components/placeholder-unsupported.d.ts.map +1 -0
  198. package/dist/src/ui/components/data-entry/file-input/sub-components/placeholder-unsupported.js +8 -0
  199. package/dist/src/ui/components/data-entry/file-input/sub-components/placeholder-unsupported.js.map +1 -0
  200. package/dist/src/ui/components/data-entry/file-input/sub-components/preview-audio.d.ts +8 -0
  201. package/dist/src/ui/components/data-entry/file-input/sub-components/preview-audio.d.ts.map +1 -0
  202. package/dist/src/ui/components/data-entry/file-input/sub-components/preview-audio.js +8 -0
  203. package/dist/src/ui/components/data-entry/file-input/sub-components/preview-audio.js.map +1 -0
  204. package/dist/src/ui/components/data-entry/file-input/sub-components/preview-file.d.ts +5 -7
  205. package/dist/src/ui/components/data-entry/file-input/sub-components/preview-file.d.ts.map +1 -1
  206. package/dist/src/ui/components/data-entry/file-input/sub-components/preview-file.js +4 -13
  207. package/dist/src/ui/components/data-entry/file-input/sub-components/preview-file.js.map +1 -1
  208. package/dist/src/ui/components/data-entry/file-input/sub-components/preview-header.d.ts +9 -0
  209. package/dist/src/ui/components/data-entry/file-input/sub-components/preview-header.d.ts.map +1 -0
  210. package/dist/src/ui/components/data-entry/file-input/sub-components/preview-header.js +8 -0
  211. package/dist/src/ui/components/data-entry/file-input/sub-components/preview-header.js.map +1 -0
  212. package/dist/src/ui/components/data-entry/file-input/sub-components/preview-image.d.ts +4 -7
  213. package/dist/src/ui/components/data-entry/file-input/sub-components/preview-image.d.ts.map +1 -1
  214. package/dist/src/ui/components/data-entry/file-input/sub-components/preview-image.js +4 -13
  215. package/dist/src/ui/components/data-entry/file-input/sub-components/preview-image.js.map +1 -1
  216. package/dist/src/ui/components/data-entry/file-input/sub-components/preview-video.d.ts +8 -0
  217. package/dist/src/ui/components/data-entry/file-input/sub-components/preview-video.d.ts.map +1 -0
  218. package/dist/src/ui/components/data-entry/file-input/sub-components/preview-video.js +8 -0
  219. package/dist/src/ui/components/data-entry/file-input/sub-components/preview-video.js.map +1 -0
  220. package/dist/src/ui/components/data-entry/file-input/types.d.ts +8 -8
  221. package/dist/src/ui/components/data-entry/file-input/types.d.ts.map +1 -1
  222. package/dist/src/ui/components/data-entry/file-input/types.js +2 -2
  223. package/dist/src/ui/components/data-entry/file-input/types.js.map +1 -1
  224. package/dist/src/ui/components/data-entry/file-input/useFetchQuery.d.ts +11 -0
  225. package/dist/src/ui/components/data-entry/file-input/useFetchQuery.d.ts.map +1 -0
  226. package/dist/src/ui/components/data-entry/file-input/useFetchQuery.js +30 -0
  227. package/dist/src/ui/components/data-entry/file-input/useFetchQuery.js.map +1 -0
  228. package/dist/src/ui/components/data-entry/file-input/useUploadFile.d.ts +6 -0
  229. package/dist/src/ui/components/data-entry/file-input/useUploadFile.d.ts.map +1 -1
  230. package/dist/src/ui/components/data-entry/file-input/useUploadFile.js +54 -2
  231. package/dist/src/ui/components/data-entry/file-input/useUploadFile.js.map +1 -1
  232. package/dist/src/ui/components/data-entry/file-input/utils.d.ts +34 -2
  233. package/dist/src/ui/components/data-entry/file-input/utils.d.ts.map +1 -1
  234. package/dist/src/ui/components/data-entry/file-input/utils.js +182 -24
  235. package/dist/src/ui/components/data-entry/file-input/utils.js.map +1 -1
  236. package/dist/src/ui/components/data-entry/number-input/number-input.d.ts.map +1 -1
  237. package/dist/src/ui/components/data-entry/number-input/number-input.js +5 -5
  238. package/dist/src/ui/components/data-entry/number-input/number-input.js.map +1 -1
  239. package/dist/src/ui/components/data-entry/number-input/types.d.ts +1 -0
  240. package/dist/src/ui/components/data-entry/number-input/types.d.ts.map +1 -1
  241. package/dist/src/ui/components/data-entry/phone-number-input/phone-number-input.d.ts.map +1 -1
  242. package/dist/src/ui/components/data-entry/phone-number-input/phone-number-input.js +8 -9
  243. package/dist/src/ui/components/data-entry/phone-number-input/phone-number-input.js.map +1 -1
  244. package/dist/src/ui/components/data-entry/phone-number-input/subcomponents/phone-number-diff.d.ts +15 -0
  245. package/dist/src/ui/components/data-entry/phone-number-input/subcomponents/phone-number-diff.d.ts.map +1 -0
  246. package/dist/src/ui/components/data-entry/phone-number-input/subcomponents/phone-number-diff.js +117 -0
  247. package/dist/src/ui/components/data-entry/phone-number-input/subcomponents/phone-number-diff.js.map +1 -0
  248. package/dist/src/ui/components/data-entry/phone-number-input/subcomponents/phone-number-input-diff.d.ts +14 -0
  249. package/dist/src/ui/components/data-entry/phone-number-input/subcomponents/phone-number-input-diff.d.ts.map +1 -0
  250. package/dist/src/ui/components/data-entry/phone-number-input/subcomponents/phone-number-input-diff.js +8 -0
  251. package/dist/src/ui/components/data-entry/phone-number-input/subcomponents/phone-number-input-diff.js.map +1 -0
  252. package/dist/src/ui/components/data-entry/phone-number-input/subcomponents/splitted-phone-number.d.ts +12 -0
  253. package/dist/src/ui/components/data-entry/phone-number-input/subcomponents/splitted-phone-number.d.ts.map +1 -0
  254. package/dist/src/ui/components/data-entry/phone-number-input/subcomponents/splitted-phone-number.js +9 -0
  255. package/dist/src/ui/components/data-entry/phone-number-input/subcomponents/splitted-phone-number.js.map +1 -0
  256. package/dist/src/ui/components/data-entry/phone-number-input/types.d.ts +2 -1
  257. package/dist/src/ui/components/data-entry/phone-number-input/types.d.ts.map +1 -1
  258. package/dist/src/ui/components/data-entry/phone-number-input/use-phone-number-input.d.ts +8 -2
  259. package/dist/src/ui/components/data-entry/phone-number-input/use-phone-number-input.d.ts.map +1 -1
  260. package/dist/src/ui/components/data-entry/phone-number-input/use-phone-number-input.js +94 -16
  261. package/dist/src/ui/components/data-entry/phone-number-input/use-phone-number-input.js.map +1 -1
  262. package/dist/src/ui/components/data-entry/textarea/textarea.d.ts.map +1 -1
  263. package/dist/src/ui/components/data-entry/textarea/textarea.js +8 -4
  264. package/dist/src/ui/components/data-entry/textarea/textarea.js.map +1 -1
  265. package/dist/src/ui/components/icon-components/BrokenAudio.d.ts +7 -0
  266. package/dist/src/ui/components/icon-components/BrokenAudio.d.ts.map +1 -0
  267. package/dist/src/ui/components/icon-components/BrokenAudio.js +7 -0
  268. package/dist/src/ui/components/icon-components/BrokenAudio.js.map +1 -0
  269. package/dist/src/ui/components/icon-components/BrokenVideo.d.ts +7 -0
  270. package/dist/src/ui/components/icon-components/BrokenVideo.d.ts.map +1 -0
  271. package/dist/src/ui/components/icon-components/BrokenVideo.js +7 -0
  272. package/dist/src/ui/components/icon-components/BrokenVideo.js.map +1 -0
  273. package/dist/src/ui/components/icon-components/PlaceholderAudio.d.ts +7 -0
  274. package/dist/src/ui/components/icon-components/PlaceholderAudio.d.ts.map +1 -0
  275. package/dist/src/ui/components/icon-components/PlaceholderAudio.js +7 -0
  276. package/dist/src/ui/components/icon-components/PlaceholderAudio.js.map +1 -0
  277. package/dist/src/ui/components/icon-components/PlaceholderVideo.d.ts +7 -0
  278. package/dist/src/ui/components/icon-components/PlaceholderVideo.d.ts.map +1 -0
  279. package/dist/src/ui/components/icon-components/PlaceholderVideo.js +7 -0
  280. package/dist/src/ui/components/icon-components/PlaceholderVideo.js.map +1 -0
  281. package/dist/src/ui/components/icon-components/index.d.ts +1 -1
  282. package/dist/src/ui/components/icon-components/index.d.ts.map +1 -1
  283. package/dist/src/ui/components/icon-components/index.js +12 -0
  284. package/dist/src/ui/components/icon-components/index.js.map +1 -1
  285. package/dist/src/ui/components/sidebar/subcomponents/sidebar-item.d.ts.map +1 -1
  286. package/dist/src/ui/components/sidebar/subcomponents/sidebar-item.js +2 -1
  287. package/dist/src/ui/components/sidebar/subcomponents/sidebar-item.js.map +1 -1
  288. package/dist/style.css +174 -11
  289. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  290. package/package.json +1 -1
@@ -6,7 +6,7 @@ import { CurrencyCodePicker } from '../currency-code-picker/index.js';
6
6
  import { useAmountInput } from './use-amount-input.js';
7
7
  import { NumberInput } from '../number-input/index.js';
8
8
  import { AmountInputDiff } from './subcomponents/amount-input-diff.js';
9
- const AmountInputController = forwardRef(({ label, value, id: propId, minValue, maxValue, onChange, onBlur, disabled, className, required, errors, warnings, description, defaultValue, type, numberProps, selectProps, step = 1, currencyPosition = 'right', name, trailingZeros, viewPrecision, precision, placeholder, placeholderSelect, units, includeCurrencySymbols, symbolPosition,
9
+ const AmountInputController = forwardRef(({ label, value, id: propId, minValue, maxValue, onChange, onBlur, disabled, className, required, errors, warnings, description, defaultValue, type, numberProps, selectProps, step = 1, currencyPosition = 'right', name, trailingZeros, viewPrecision, precision, placeholder, placeholderSelect, units, includeCurrencySymbols, symbolPosition, enableStepCarets = false,
10
10
  // Diff Props
11
11
  baseValue, viewMode = 'edition', }, ref) => {
12
12
  const generatedId = useId();
@@ -25,7 +25,7 @@ baseValue, viewMode = 'edition', }, ref) => {
25
25
  if (viewMode === 'edition') {
26
26
  return (_jsxs(FormGroup, { children: [label && (_jsx(FormLabel, { htmlFor: id, required: required, disabled: disabled, hasError: !!errors?.length, className: cn(disabled && 'mb-[3px]'), children: label })), _jsxs("div", { className: cn('relative flex items-center', 'rounded-md border border-gray-300', 'h-[36px]',
27
27
  // focus state
28
- 'focus:rounded-md focus:border-gray-900 transition-colors focus-within:ring-1 focus-within:rounded focus-within:ring-offset-0'), children: [_jsx("input", { name: name, type: "hidden", "data-cast": isBigInt ? 'AmountBigInt' : 'AmountNumber' }), isShowSelect && currencyPosition === 'left' && (_jsx(CurrencyCodePicker, { contentAlign: "start", contentClassName: "[&]:!w-[120px]", disabled: disabled, currencies: options, value: valueSelect, onChange: handleOnChangeSelect, placeholder: placeholderSelect, includeCurrencySymbols: includeCurrencySymbols, symbolPosition: symbolPosition, searchable: false, className: cn('focus:border-r-none focus:z-10 focus:ring-0 focus:ring-offset-0 focus:bg-none', 'outline-none focus-visible:ring-0 focus-visible:ring-offset-0', 'h-[32px]', 'hover:bg-transparent', 'border-none', selectProps?.className), ...(selectProps ?? { name: '' }) })), isShowSelect && currencyPosition === 'left' && (_jsx("div", { className: "border-l-[1px] border-gray-300 h-full flex items-center" })), _jsxs("div", { className: cn('relative flex items-center'), children: [_jsx(NumberInput, { name: "", step: step, required: required, disabled: disabled, value: valueInput === undefined ? undefined : valueInput, id: id, maxValue: maxValue, precision: precision, minValue: minValue, onChange: handleOnChangeInput, onFocus: handleIsInputFocused, placeholder: placeholder, numericType: type === 'AmountCurrency' || type === 'AmountCrypto' ? 'BigInt' : 'Float', className: cn(currencyPosition === 'left' && 'rounded-l-none border-l-[0.5px]', currencyPosition === 'right' && 'rounded-r-none border-r-[0.5px]', isPercent && 'rounded-md pr-7', isAmountWithoutUnit && 'rounded-md', 'outline-none focus-visible:ring-0 focus-visible:ring-offset-0', 'border-none', 'h-[32px]', className), onBlur: handleBlur, ref: ref, ...(numberProps || {}) }), isPercent && !inputFocused && (_jsx("span", { className: cn('pointer-events-none absolute inset-y-0 right-2 ml-2 flex items-center', disabled ? 'text-gray-400' : 'text-gray-900'), children: "%" }))] }), isShowSelect && currencyPosition === 'right' && (_jsx("div", { className: "border-l-[1px] border-gray-300 h-full flex items-center" })), isShowSelect && currencyPosition === 'right' && (_jsx(CurrencyCodePicker, { contentAlign: "end", contentClassName: "[&]:!w-[120px]", className: cn('focus:border-l-none focus:z-10 focus:ring-0 focus:ring-offset-0 focus:bg-none', 'outline-none focus-visible:ring-0 focus-visible:ring-offset-0', 'h-[32px]', 'hover:bg-transparent', 'border-none', selectProps?.className), disabled: disabled, includeCurrencySymbols: includeCurrencySymbols, currencies: options, value: valueSelect, onChange: handleOnChangeSelect, name: "", placeholder: placeholderSelect, symbolPosition: symbolPosition, searchable: false, ...(selectProps ?? { name: '' }) }))] }), description && _jsx(FormDescription, { children: description }), warnings && _jsx(FormMessageList, { messages: warnings, type: "warning" }), errors && _jsx(FormMessageList, { messages: errors, type: "error" })] }));
28
+ 'focus:rounded-md focus:border-gray-900 transition-colors focus-within:ring-1 focus-within:rounded focus-within:ring-offset-0'), children: [_jsx("input", { name: name, type: "hidden", "data-cast": isBigInt ? 'AmountBigInt' : 'AmountNumber' }), isShowSelect && currencyPosition === 'left' && (_jsx(CurrencyCodePicker, { contentAlign: "start", contentClassName: "[&]:!w-[120px]", disabled: disabled, currencies: options, value: valueSelect, onChange: handleOnChangeSelect, placeholder: placeholderSelect, includeCurrencySymbols: includeCurrencySymbols, symbolPosition: symbolPosition, searchable: false, className: cn('focus:border-r-none focus:z-10 focus:ring-0 focus:ring-offset-0 focus:bg-none', 'outline-none focus-visible:ring-0 focus-visible:ring-offset-0', 'h-[32px]', 'hover:bg-transparent', 'border-none', selectProps?.className), ...(selectProps ?? { name: '' }) })), isShowSelect && currencyPosition === 'left' && (_jsx("div", { className: "border-l-[1px] border-gray-300 h-full flex items-center" })), _jsxs("div", { className: cn('relative flex items-center'), children: [_jsx(NumberInput, { name: "", step: step, required: required, disabled: disabled, value: valueInput === undefined ? undefined : valueInput, id: id, maxValue: maxValue, precision: precision, minValue: minValue, onChange: handleOnChangeInput, onFocus: handleIsInputFocused, placeholder: placeholder, enableStepCarets: enableStepCarets, numericType: type === 'AmountCurrency' || type === 'AmountCrypto' ? 'BigInt' : 'Float', className: cn(currencyPosition === 'left' && 'rounded-l-none border-l-[0.5px]', currencyPosition === 'right' && 'rounded-r-none border-r-[0.5px]', isPercent && 'rounded-md pr-7', isAmountWithoutUnit && 'rounded-md', 'outline-none focus-visible:ring-0 focus-visible:ring-offset-0', 'border-none', 'h-[32px]', className), onBlur: handleBlur, ref: ref, ...(numberProps || {}) }), isPercent && !inputFocused && (_jsx("span", { className: cn('pointer-events-none absolute inset-y-0 right-2 ml-2 flex items-center', disabled ? 'text-gray-400' : 'text-gray-900'), children: "%" }))] }), isShowSelect && currencyPosition === 'right' && (_jsx("div", { className: "border-l-[1px] border-gray-300 h-full flex items-center" })), isShowSelect && currencyPosition === 'right' && (_jsx(CurrencyCodePicker, { contentAlign: "end", contentClassName: "[&]:!w-[120px]", className: cn('focus:border-l-none focus:z-10 focus:ring-0 focus:ring-offset-0 focus:bg-none', 'outline-none focus-visible:ring-0 focus-visible:ring-offset-0', 'h-[32px]', 'hover:bg-transparent', 'border-none', selectProps?.className), disabled: disabled, includeCurrencySymbols: includeCurrencySymbols, currencies: options, value: valueSelect, onChange: handleOnChangeSelect, name: "", placeholder: placeholderSelect, symbolPosition: symbolPosition, searchable: false, ...(selectProps ?? { name: '' }) }))] }), description && _jsx(FormDescription, { children: description }), warnings && _jsx(FormMessageList, { messages: warnings, type: "warning" }), errors && _jsx(FormMessageList, { messages: errors, type: "error" })] }));
29
29
  }
30
30
  return (_jsx(AmountInputDiff, { value: value, baseValue: baseValue, viewMode: viewMode, required: required, label: label, currencyPosition: currencyPosition, options: options, symbolPosition: symbolPosition, includeCurrencySymbols: includeCurrencySymbols }));
31
31
  });
@@ -1 +1 @@
1
- {"version":3,"file":"amount-input.js","sourceRoot":"","sources":["../../../../../../src/ui/components/data-entry/amount-input/amount-input.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACnD,OAAO,EACL,eAAe,EACf,SAAS,EACT,SAAS,EACT,eAAe,GAChB,MAAM,mDAAmD,CAAA;AAC1D,OAAO,EAAE,EAAE,EAAE,MAAM,kCAAkC,CAAA;AACrD,OAAO,EAAiB,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AAGpF,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAGtD,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAA;AA8BtE,MAAM,qBAAqB,GAAG,UAAU,CACtC,CACE,EACE,KAAK,EACL,KAAK,EACL,EAAE,EAAE,MAAM,EACV,QAAQ,EACR,QAAQ,EACR,QA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ourceRoot":"","sources":["../../../../../../src/ui/components/data-entry/amount-input/amount-input.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACnD,OAAO,EACL,eAAe,EACf,SAAS,EACT,SAAS,EACT,eAAe,GAChB,MAAM,mDAAmD,CAAA;AAC1D,OAAO,EAAE,EAAE,EAAE,MAAM,kCAAkC,CAAA;AACrD,OAAO,EAAiB,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AAGpF,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAGtD,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAA;AA8BtE,MAAM,qBAAqB,GAAG,UAAU,CACtC,CACE,EACE,KAAK,EACL,KAAK,EACL,EAAE,EAAE,MAAM,EACV,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,IAAI,EACJ,WAAW,EACX,WAAW,EACX,IAAI,GAAG,CAAC,EACR,gBAAgB,GAAG,OAAO,EAC1B,IAAI,EACJ,aAAa,EACb,aAAa,EACb,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,KAAK,EACL,sBAAsB,EACtB,cAAc,EACd,gBAAgB,GAAG,KAAK;AACxB,aAAa;AACb,SAAS,EACT,QAAQ,GAAG,SAAS,GACrB,EACD,GAAG,EACH,EAAE;IACF,MAAM,WAAW,GAAG,KAAK,EAAE,CAAA;IAC3B,MAAM,EAAE,GAAG,MAAM,IAAI,WAAW,CAAA;IAChC,MAAM,EACJ,YAAY,EACZ,SAAS,EACT,OAAO,EACP,WAAW,EACX,UAAU,EACV,mBAAmB,EACnB,oBAAoB,EACpB,UAAU,EACV,QAAQ,EACR,oBAAoB,EACpB,mBAAmB,EACn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K,IAAI,KAAK,CAAC,YAAY,CAAC,CAAA;IAErE,MAAM,YAAY,GAAG,CAAC,CAAsC,EAAE,EAAE;QAC9D,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAA;QAC/B,QAAQ,CAAC,QAAkB,CAAC,CAAA;IAC9B,CAAC,CAAA;IACD,OAAO,KAAC,qBAAqB,OAAK,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,GAAI,CAAA;AACnF,CAAC,CAAA;AAED,MAAM,WAAW,GAAG,CAAC,KAAuB,EAAE,EAAE;IAC9C,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;QACnB,OAAO,KAAC,qBAAqB,OAAK,KAAK,GAAI,CAAA;IAC7C,CAAC;IACD,OAAO,KAAC,uBAAuB,OAAM,KAAsC,GAAI,CAAA;AACjF,CAAC,CAAA;AAED,WAAW,CAAC,WAAW,GAAG,aAAa,CAAA;AAEvC,OAAO,EAAE,WAAW,EAAyB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"country-code-picker.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/data-entry/country-code-picker/country-code-picker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2C,MAAM,OAAO,CAAA;AAK/D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAA;AAOxD,QAAA,MAAM,iBAAiB,kGA2GtB,CAAA;AAID,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
1
+ {"version":3,"file":"country-code-picker.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/data-entry/country-code-picker/country-code-picker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2C,MAAM,OAAO,CAAA;AAK/D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAA;AAOxD,QAAA,MAAM,iBAAiB,kGA8GtB,CAAA;AAID,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
@@ -26,9 +26,14 @@ const CountryCodePicker = React.forwardRef(({ label, required, value, defaultVal
26
26
  : undefined,
27
27
  }))
28
28
  .sort((a, b) => (a.label > b.label ? 1 : a.label < b.label ? -1 : 0));
29
- const options = Array.isArray(allowedCountries) || Array.isArray(excludedCountries)
30
- ? defaultOptions.filter((option) => (!allowedCountries || allowedCountries.includes(option.value)) &&
31
- !excludedCountries?.includes(option.value))
29
+ const allowedCountriesArray = Array.isArray(allowedCountries) ? allowedCountries : undefined;
30
+ const excludedCountriesArray = Array.isArray(excludedCountries) ? excludedCountries : undefined;
31
+ const options = allowedCountriesArray || excludedCountriesArray
32
+ ? defaultOptions.filter((option) => {
33
+ const isAllowedCountry = allowedCountriesArray ? allowedCountriesArray.includes(option.value) : true;
34
+ const isExcludedCountry = excludedCountriesArray ? !excludedCountriesArray.includes(option.value) : true;
35
+ return isAllowedCountry && isExcludedCountry;
36
+ })
32
37
  : defaultOptions;
33
38
  const selectedOption = options.find((option) => option.value === internalValue);
34
39
  const baseOption = options.find((option) => option.value === baseValue);
@@ -1 +1 @@
1
- {"version":3,"file":"country-code-picker.js","sourceRoot":"","sources":["../../../../../../src/ui/components/data-entry/country-code-picker/country-code-picker.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,SAA6B,MAAM,iBAAiB,CAAA;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAGrD,MAAM,iBAAiB,GAAG,CAAC,aAAsB,EAAE,WAAmB,EAAE,EAAE;IACxE,IAAI,CAAC,aAAa,IAAI,CAAC,WAAW;QAAE,OAAO,SAAS,CAAA;IACpD,OAAO,KAAC,UAAU,IAAC,SAAS,EAAC,QAAQ,EAAC,WAAW,EAAE,WAAW,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"version":3,"file":"country-code-picker.js","sourceRoot":"","sources":["../../../../../../src/ui/components/data-entry/country-code-picker/country-code-picker.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,SAA6B,MAAM,iBAAiB,CAAA;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAGrD,MAAM,iBAAiB,GAAG,CAAC,aAAsB,EAAE,WAAmB,EAAE,EAAE;IACxE,IAAI,CAAC,aAAa,IAAI,CAAC,WAAW;QAAE,OAAO,SAAS,CAAA;IACpD,OAAO,KAAC,UAAU,IAAC,SAAS,EAAC,QAAQ,EAAC,WAAW,EAAE,WAAW,CAAC,WAAW,EAAE,EAAE,MAAM,EAAE,EAAE,GAAI,CAAA;AAC9F,CAAC,CAAA;AAED,MAAM,iBAAiB,GAAG,KAAK,CAAC,UAAU,CACxC,CACE,EACE,KAAK,EACL,QAAQ,EACR,KAAK,EACL,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,GAAG,KAAK,EAC7B,YAAY,GAAG,WAAW,EAC1B,aAAa,GAAG,IAAI,EACpB,YAAY,EACZ,QAAQ,GAAG,SAAS,EACpB,SAAS,EACT,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAC,KAAK,IAAI,YAAY,IAAI,EAAE,CAAC,CAAA;IAE/E,MAAM,cAAc,GAAI,SAAkC;SACvD,MAAM,CACL,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,WAA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ACvB,QAAQ,EAAE,CAAC,KAAK,CAAC,CAAA;IACnB,CAAC,EACD,CAAC,QAAQ,CAAC,CACX,CAAA;IAED,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,gBAAgB,CAAC,KAAK,CAAC,CAAA;QACzB,CAAC;IACH,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAA;IAEX,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,OAAO,CACL,KAAC,MAAM,IACL,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,OAAO,EAChB,aAAa,EAAC,WAAW,EACzB,qBAAqB,EAAC,OAAO,EAC7B,UAAU,EAAE,YAAY,EACxB,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,YAAY,EACtB,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,KACd,KAAK,GACT,CACH,CAAA;IACH,CAAC;IAED,OAAO,CACL,KAAC,UAAU,IACT,KAAK,EAAE,aAAa,EACpB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,GACV,CACH,CAAA;AACH,CAAC,CACF,CAAA;AAED,iBAAiB,CAAC,WAAW,GAAG,mBAAmB,CAAA;AAEnD,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Example component demonstrating the FileField component usage within a real Form context.
3
+ * This shows how to manage file upload states and handle user interactions in a production-like scenario.
4
+ */
5
+ declare const FileUploadItemExample: () => import("react/jsx-runtime").JSX.Element;
6
+ export default FileUploadItemExample;
7
+ //# sourceMappingURL=file-upload-item-example.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-upload-item-example.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/examples/file-upload-item-example.tsx"],"names":[],"mappings":"AAMA;;;GAGG;AACH,QAAA,MAAM,qBAAqB,+CA8I1B,CAAA;AAED,eAAe,qBAAqB,CAAA"}
@@ -0,0 +1,64 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import { Form } from '../../../../../scalars/components/form/index.js';
4
+ import { FileField } from '../../../../../scalars/components/file-field/index.js';
5
+ import { Button } from '../../../../../ui/components/button/index.js';
6
+ /**
7
+ * Example component demonstrating the FileField component usage within a real Form context.
8
+ * This shows how to manage file upload states and handle user interactions in a production-like scenario.
9
+ */
10
+ const FileUploadItemExample = () => {
11
+ const [status, setStatus] = useState('idle');
12
+ const [progress, setProgress] = useState(0);
13
+ const [errorMessage, setErrorMessage] = useState([]);
14
+ const [file, setFile] = useState(undefined);
15
+ const simulateUpload = () => {
16
+ setStatus('uploading');
17
+ setProgress(0);
18
+ const interval = setInterval(() => {
19
+ setProgress((prev) => {
20
+ if (prev >= 100) {
21
+ clearInterval(interval);
22
+ setStatus('success');
23
+ return 100;
24
+ }
25
+ return prev + 10;
26
+ });
27
+ }, 200);
28
+ };
29
+ const simulateError = () => {
30
+ setStatus('error');
31
+ setErrorMessage(['File size exceeds limit', 'Invalid file format']);
32
+ };
33
+ const handleCancel = () => {
34
+ console.log('File upload canceled');
35
+ setStatus('idle');
36
+ setProgress(0);
37
+ setErrorMessage([]);
38
+ };
39
+ const handleReload = () => {
40
+ console.log('Retrying upload');
41
+ setStatus('uploading');
42
+ setProgress(0);
43
+ setErrorMessage([]);
44
+ simulateUpload();
45
+ };
46
+ const resetToIdle = () => {
47
+ setStatus('idle');
48
+ setProgress(0);
49
+ setErrorMessage([]);
50
+ };
51
+ const handleFormSubmit = async (data) => {
52
+ const file = data.file;
53
+ setFile(file);
54
+ // Simulate API call
55
+ await new Promise((resolve) => setTimeout(resolve, 1000));
56
+ // eslint-disable-next-line no-alert
57
+ alert(`Form submitted successfully!\n\nFile: ${data.file.name}\nDescription: ${data.description}`);
58
+ };
59
+ return (_jsxs("div", { className: "space-y-6 p-6 max-w-2xl", children: [_jsxs("div", { className: "space-y-4", children: [_jsx("h3", { className: "text-lg font-semibold", children: "FileField Integration Example" }), _jsx("p", { className: "text-sm text-gray-600", children: "This example demonstrates how to use FileField within a real Form context, showing file upload states and user interactions in a production-like scenario." }), _jsxs("div", { className: "border rounded-lg p-6 bg-white shadow-sm", children: [_jsx("h4", { className: "text-md font-medium text-gray-700 mb-4", children: "Document Upload Form" }), _jsx(Form, { onSubmit: handleFormSubmit, children: ({ formState: { isSubmitting } }) => (_jsxs("div", { className: "space-y-4 w-[247px]", children: [_jsx(FileField, { name: "file", label: "Upload Document", description: "Choose your document", required: true, maxFileSize: 15728640, dragAndDropEnabled: true,
60
+ // File upload state props
61
+ status: status, progress: progress, showPreview: true, errorsUpload: errorMessage, onCancel: handleCancel, onReload: handleReload, fileName: file?.name ?? '', fileSize: file?.size ?? 0, mimeType: file?.type ?? '' }), _jsxs("div", { className: "flex flex-wrap gap-2 pt-2", children: [_jsx("button", { type: "button", onClick: simulateUpload, disabled: status === 'uploading', className: "px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed text-sm", children: "Simulate Upload" }), _jsx("button", { type: "button", onClick: simulateError, disabled: status === 'uploading', className: "px-4 py-2 bg-red-600 text-white rounded-md hover:bg-red-700 disabled:opacity-50 disabled:cursor-not-allowed text-sm", children: "Simulate Error" }), _jsx("button", { type: "button", onClick: resetToIdle, className: "px-4 py-2 bg-gray-600 text-white rounded-md hover:bg-gray-700 text-sm", children: "Reset to Idle" })] }), _jsx("div", { className: "pt-4", children: _jsx(Button, { type: "submit", disabled: isSubmitting, className: "w-full", children: isSubmitting ? 'Submitting...' : 'Submit Document' }) })] })) })] })] }), _jsxs("div", { className: "text-sm text-gray-600 space-y-2", children: [_jsx("h4", { className: "font-medium text-gray-700", children: "How to use this example:" }), _jsxs("ol", { className: "list-decimal list-inside space-y-1 ml-4", children: [_jsx("li", { children: "Select a file using the FileField component in the form above" }), _jsx("li", { children: "Use the control buttons to simulate different upload states" }), _jsx("li", { children: "Submit the form to see how FileField integrates with form submission" }), _jsx("li", { children: "Observe how the FileUploadItem component responds to different props" }), _jsx("li", { children: "Try the cancel and reload functionality" })] })] })] }));
62
+ };
63
+ export default FileUploadItemExample;
64
+ //# sourceMappingURL=file-upload-item-example.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-upload-item-example.js","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/examples/file-upload-item-example.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,iDAAiD,CAAA;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,uDAAuD,CAAA;AACjF,OAAO,EAAE,MAAM,EAAE,MAAM,8CAA8C,CAAA;AAGrE;;;GAGG;AACH,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACjC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAa,MAAM,CAAC,CAAA;IACxD,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;IAC3C,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAW,EAAE,CAAC,CAAA;IAC9D,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAmB,SAAS,CAAC,CAAA;IAE7D,MAAM,cAAc,GAAG,GAAG,EAAE;QAC1B,SAAS,CAAC,WAAW,CAAC,CAAA;QACtB,WAAW,CAAC,CAAC,CAAC,CAAA;QAEd,MAAM,QAAQ,GAAG,WAAW,CAAC,GAAG,EAAE;YAChC,WAAW,CAAC,CAAC,IAAI,EAAE,EAAE;gBACnB,IAAI,IAAI,IAAI,GAAG,EAA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Aa,EACtB,QAAQ,EAAE,MAAM,KAAK,WAAW,EAChC,SAAS,EAAC,qHAAqH,+BAGxH,EACT,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,WAAW,EACpB,SAAS,EAAC,uEAAuE,8BAG1E,IACL,EAGN,cAAK,SAAS,EAAC,MAAM,YACnB,KAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAC,QAAQ,YAC7D,YAAY,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,iBAAiB,GAC5C,GACL,IACF,CACP,GACI,IACH,IACF,EAEN,eAAK,SAAS,EAAC,iCAAiC,aAC9C,aAAI,SAAS,EAAC,2BAA2B,yCAA8B,EACvE,cAAI,SAAS,EAAC,yCAAyC,aACrD,yFAAsE,EACtE,uFAAoE,EACpE,gGAA6E,EAC7E,gGAA6E,EAC7E,mEAAgD,IAC7C,IACD,IACF,CACP,CAAA;AACH,CAAC,CAAA;AAED,eAAe,qBAAqB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { default as FileUploadItemExample } from './file-upload-item-example.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/examples/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,+BAA+B,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { default as FileUploadItemExample } from './file-upload-item-example.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/examples/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,+BAA+B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"file-input.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/data-entry/file-input/file-input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgB,MAAM,OAAO,CAAA;AACpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAahD,QAAA,MAAM,SAAS,yFAyKd,CAAA;AAID,OAAO,EAAE,SAAS,EAAE,CAAA"}
1
+ {"version":3,"file":"file-input.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/data-entry/file-input/file-input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgB,MAAM,OAAO,CAAA;AACpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAchD,QAAA,MAAM,SAAS,yFA2Ld,CAAA;AAID,OAAO,EAAE,SAAS,EAAE,CAAA"}
@@ -1,16 +1,16 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React, { useId } from 'react';
3
3
  import { cn } from '../../../../scalars/lib/utils.js';
4
- import { Icon } from '../../icon/icon.js';
5
4
  import FileBackground from '../../icon-components/FileBackground.js';
6
- import { Input } from '../../../../ui/components/data-entry/input/index.js';
7
- import { FormLabel } from '../../../../scalars/components/fragments/form-label/form-label.js';
8
- import { FormMessageList } from '../../../../scalars/components/fragments/form-message/index.js';
9
5
  import { useDropzone } from 'react-dropzone';
10
6
  import { formatBytes, getExtensionsFromMimeTypes } from './utils.js';
11
7
  import { Button } from '../../../../scalars/components/fragments/button/button.js';
12
8
  import { useFileUpload } from './useUploadFile.js';
13
9
  import { FileUploadItem } from './sub-components/file-upload-item.js';
10
+ import { Icon } from '../../icon/index.js';
11
+ import { Input } from '../../../../ui/components/data-entry/input/index.js';
12
+ import { FormLabel } from '../../../../scalars/components/fragments/form-label/form-label.js';
13
+ import { FormMessageList } from '../../../../scalars/components/fragments/form-message/index.js';
14
14
  const FileInput = React.forwardRef(({ name, label, description, required, disabled = false, errors = [], warnings = [], id: propId, maxFileSize, allowedFileTypes, value, defaultValue, dragAndDropEnabled = true, onChange,
15
15
  // Item Props
16
16
  fileName, fileSize, mimeType, progress, onCancel, onReload, showPreview = false, errorsUpload, status = 'idle', ...props }, ref) => {
@@ -19,13 +19,17 @@ fileName, fileSize, mimeType, progress, onCancel, onReload, showPreview = false,
19
19
  const hasError = Array.isArray(errors) && errors.length > 0;
20
20
  const hasWarning = Array.isArray(warnings) && warnings.length > 0;
21
21
  const allowedFileTypesString = Array.isArray(allowedFileTypes) ? allowedFileTypes : [];
22
- const { handleDrop, borderIndicator, preview } = useFileUpload({ value, defaultValue, onChange });
22
+ const { handleDrop, borderIndicator, preview, handleCancelPreview, handleOnPreview, isPreviewOpen, previewStatus, typePreview, } = useFileUpload({
23
+ value,
24
+ defaultValue,
25
+ onChange,
26
+ });
23
27
  const { getInputProps, getRootProps, open, inputRef } = useDropzone({
24
28
  onDropAccepted: (acceptedFiles) => {
25
29
  handleDrop(acceptedFiles);
26
30
  },
27
- noClick: true,
28
- noKeyboard: true,
31
+ noClick: status !== 'idle',
32
+ noKeyboard: status !== 'idle',
29
33
  });
30
34
  return (_jsxs("div", { className: "flex flex-col", children: [!!label && (_jsx(FormLabel, { htmlFor: id, id: `${id}-label`, disabled: disabled, hasError: hasError, required: required, className: cn(disabled && 'pointer-events-none'), children: label })), _jsx("div", { className: "flex flex-col w-full h-full pt-3.5 min-h-[148px]", children: _jsxs("div", { className: "relative h-[148px]", children: [_jsx("div", { className: cn('absolute z-0 h-full w-full', borderIndicator), "data-state": value ? 'selected' : 'idle', "data-testid": "file-input-border", children: _jsx(FileBackground, { className: "w-full h-full opacity-50" }) }), _jsxs("div", { ...getRootProps({
31
35
  role: 'group',
@@ -33,7 +37,9 @@ fileName, fileSize, mimeType, progress, onCancel, onReload, showPreview = false,
33
37
  // padding
34
38
  'px-3 py-4'),
35
39
  tabIndex: disabled ? -1 : 0,
36
- }), "data-testid": "file-drop-area", children: [status === 'idle' && (_jsxs("div", { className: "flex flex-col items-center justify-center gap-2", children: [_jsx(Icon, { name: "FileUpload", size: 40, className: "text-gray-500", "aria-hidden": "true" }), _jsx("p", { className: "text-gray-500 font-normal text-sm leading-5", children: description })] })), status !== 'idle' && (_jsx("div", { className: "absolute inset-0 flex items-center justify-center p-4", children: _jsx("div", { className: "w-full max-w-full", children: _jsx(FileUploadItem, { errorsUpload: errorsUpload, mimeType: mimeType, fileName: fileName, fileSize: formatBytes(fileSize ?? 0, 2), progress: progress, status: status, onCancel: onCancel, onReload: onReload, showPreview: showPreview, preview: preview }) }) })), _jsx("input", { ref: ref, type: "hidden", name: name }), _jsx(Input, { ...getInputProps({
40
+ }), "data-testid": "file-drop-area", children: [status === 'idle' && (_jsxs("div", { className: "flex flex-col items-center justify-center gap-2", children: [_jsx(Icon, { name: "FileUpload", size: 40, className: "text-gray-500", "aria-hidden": "true" }), _jsx("p", { className: "text-gray-500 font-normal text-sm leading-5", children: description })] })), status !== 'idle' && (_jsx("div", { className: "absolute inset-0 flex items-center justify-center p-4", children: _jsx("div", { className: "w-full max-w-full", children: _jsx(FileUploadItem, { errorsUpload: errorsUpload, mimeType: mimeType, fileName: fileName, fileSize: formatBytes(fileSize ?? 0, 2), progress: progress, status: status, onCancel: onCancel, onReload: onReload,
41
+ // Preview Props
42
+ preview: preview, showPreview: showPreview, handleOnCancelPreview: handleCancelPreview, isPreviewOpen: isPreviewOpen, handleOnPreview: handleOnPreview, previewStatus: previewStatus, typePreview: typePreview }) }) })), _jsx("input", { ref: ref, type: "hidden", name: name }), _jsx(Input, { ...getInputProps({
37
43
  id,
38
44
  required,
39
45
  disabled,
@@ -1 +1 @@
1
- {"version":3,"file":"file-input.js","sourceRoot":"","sources":["../../../../../../src/ui/components/data-entry/file-input/file-input.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAEpC,OAAO,EAAE,EAAE,EAAE,MAAM,kCAAkC,CAAA;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AACzC,OAAO,cAAc,M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,QAAQ,IAAI,qBAAqB,CAClC,YAED,KAAC,MAAM,IACL,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,IAAI,EACb,QAAQ,EAAE,QAAQ,gBACP,aAAa,EACxB,SAAS,EAAE,EAAE,CACX,0HAA0H;gCAC1H,UAAU;gCACV,WAAW;gCACX,QAAQ;gCACR,yDAAyD,CAC1D,4BAGM,GACL,CACP,IACG,GACF,EACN,eAAK,SAAS,EAAC,0BAA0B,aACvC,gBAAM,SAAS,EAAC,wDAAwD,2BAC3D,0BAA0B,CAAC,sBAAsB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IACnE,EACP,gBAAM,SAAS,EAAC,wDAAwD,sBAChE,WAAW,CAAC,WAAW,EAAE,CAAC,CAAC,IAC5B,IACH,EACN,eAAK,SAAS,EAAC,0BAA0B,aACtC,QAAQ,IAAI,KAAC,eAAe,IAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAC,OAAO,GAAG,EAC9D,UAAU,IAAI,KAAC,eAAe,IAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAC,SAAS,GAAG,IACjE,IACF,CACP,CAAA;AACH,CAAC,CACF,CAAA;AAED,SAAS,CAAC,WAAW,GAAG,WAAW,CAAA;AAEnC,OAAO,EAAE,SAAS,EAAE,CAAA"}
1
+ {"version":3,"file":"file-input.js","sourceRoot":"","sources":["../../../../../../src/ui/components/data-entry/file-input/file-input.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAEpC,OAAO,EAAE,EAAE,EAAE,MAAM,kCAAkC,CAAA;AACrD,OAAO,cAAc,MAAM,yCAAyC,CAAA;AAEpE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAA;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,2DAA2D,CAAA;AAClF,OAAO,EA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,EACL,MAAM,KAAK,MAAM,IAAI,CACpB,cACE,SAAS,EAAE,EAAE,CACX,+EAA+E,EAC/E,QAAQ,IAAI,qBAAqB,CAClC,YAED,KAAC,MAAM,IACL,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,IAAI,EACb,QAAQ,EAAE,QAAQ,gBACP,aAAa,EACxB,SAAS,EAAE,EAAE,CACX,0HAA0H;gCAC1H,UAAU;gCACV,WAAW;gCACX,QAAQ;gCACR,yDAAyD,CAC1D,4BAGM,GACL,CACP,IACG,GACF,EACN,eAAK,SAAS,EAAC,0BAA0B,aACvC,gBAAM,SAAS,EAAC,wDAAwD,2BAC3D,0BAA0B,CAAC,sBAAsB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IACnE,EACP,gBAAM,SAAS,EAAC,wDAAwD,sBAChE,WAAW,CAAC,WAAW,EAAE,CAAC,CAAC,IAC5B,IACH,EACN,eAAK,SAAS,EAAC,0BAA0B,aACtC,QAAQ,IAAI,KAAC,eAAe,IAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAC,OAAO,GAAG,EAC9D,UAAU,IAAI,KAAC,eAAe,IAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAC,SAAS,GAAG,IACjE,IACF,CACP,CAAA;AACH,CAAC,CACF,CAAA;AAED,SAAS,CAAC,WAAW,GAAG,WAAW,CAAA;AAEnC,OAAO,EAAE,SAAS,EAAE,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { UploadFile } from '../types.js';
1
+ import type { PreviewType, UploadFile } from '../types.js';
2
2
  interface FileUploadItemProps {
3
3
  fileName?: string;
4
4
  fileSize?: string;
@@ -11,7 +11,15 @@ interface FileUploadItemProps {
11
11
  status?: UploadFile;
12
12
  showPreview?: boolean;
13
13
  preview?: string;
14
+ isPreviewOpen?: boolean;
15
+ handleOnPreview?: () => void;
16
+ handleOnCancelPreview?: () => void;
17
+ previewStatus: 'idle' | 'loading' | 'success' | 'corrupted_file' | 'unsupported_file';
18
+ typePreview?: PreviewType;
14
19
  }
15
- export declare const FileUploadItem: ({ fileName, fileSize, progress, onCancel, onReload, className, mimeType, errorsUpload, status, showPreview, preview, }: FileUploadItemProps) => import("react/jsx-runtime").JSX.Element;
16
- export {};
20
+ declare const FileUploadItem: {
21
+ ({ fileName, fileSize, progress, onCancel, onReload, className, mimeType, errorsUpload, status, showPreview, preview, isPreviewOpen, handleOnPreview, handleOnCancelPreview, previewStatus, typePreview, }: FileUploadItemProps): import("react/jsx-runtime").JSX.Element;
22
+ displayName: string;
23
+ };
24
+ export { FileUploadItem };
17
25
  //# sourceMappingURL=file-upload-item.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"file-upload-item.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/sub-components/file-upload-item.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAI7C,UAAU,mBAAmB;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAA;IAC3D,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAA;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,eAAO,MAAM,cAAc,GAAI,wHAY5B,mBAAmB,4CA6GrB,CAAA"}
1
+ {"version":3,"file":"file-upload-item.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/sub-components/file-upload-item.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAiB1D,UAAU,mBAAmB;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAA;IAC3D,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAA;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB,MAAM,CAAC,EAAE,UAAU,CAAA;IAGnB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,eAAe,CAAC,EAAE,MAAM,IAAI,CAAA;IAC5B,qBAAqB,CAAC,EAAE,MAAM,IAAI,CAAA;IAClC,aAAa,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,gBAAgB,GAAG,kBAAkB,CAAA;IACrF,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B;AAED,QAAA,MAAM,cAAc;gNAmBjB,mBAAmB;;CAwIrB,CAAA;AAID,OAAO,EAAE,cAAc,EAAE,CAAA"}
@@ -1,13 +1,21 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState } from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
2
  import { cn } from '../../../../../scalars/lib/utils.js';
4
- import { ProgressBar } from '../../../../../scalars/components/fragments/progress-bar/progress-bar.js';
5
- import { Icon } from '../../../icon/icon.js';
3
+ import { ProgressBar } from '../../../../../scalars/components/fragments/progress-bar/index.js';
4
+ import { Icon } from '../../../icon/index.js';
6
5
  import { FormMessageList } from '../../../../../scalars/components/fragments/form-message/message-list.js';
7
- import { getIconKey, MESSAGES } from '../utils.js';
8
- import { AlertDialog, AlertDialogContent } from '../../../confirm/alert-dialog.js';
9
- export const FileUploadItem = ({ fileName = '', fileSize = '', progress = undefined, onCancel, onReload, className, mimeType = '', errorsUpload, status = 'idle', showPreview, preview, }) => {
10
- const [isPreviewOpen, setIsPreviewOpen] = useState(false);
6
+ import { getContainerDimensions, getIconKey, MESSAGES } from '../utils.js';
7
+ import { AlertDialog, AlertDialogContent, AlertDialogDescription, AlertDialogTitle, } from '../../../confirm/alert-dialog.js';
8
+ import { VisuallyHidden } from '@radix-ui/react-visually-hidden';
9
+ import PreviewFile from './preview-file.js';
10
+ import PreviewImage from './preview-image.js';
11
+ import PreviewAudio from './preview-audio.js';
12
+ import PreviewVideo from './preview-video.js';
13
+ import { PlaceHolderUnsupported } from './placeholder-unsupported.js';
14
+ import { PlaceHolderLoading } from './placeholder-loading.js';
15
+ import { PlaceHolderCorrupted } from './placeholder-corrupted.js';
16
+ const FileUploadItem = ({ fileName = '', fileSize = '', progress = undefined, onCancel, onReload, className, mimeType = '', errorsUpload, status = 'idle',
17
+ // Preview Props
18
+ showPreview, preview, isPreviewOpen, handleOnPreview, handleOnCancelPreview = () => null, previewStatus, typePreview, }) => {
11
19
  const showProgress = status === 'uploading' && progress !== undefined && progress >= 0 && progress < 100;
12
20
  const showSuccess = status === 'success';
13
21
  const showError = status === 'error';
@@ -20,10 +28,14 @@ export const FileUploadItem = ({ fileName = '', fileSize = '', progress = undefi
20
28
  e.stopPropagation();
21
29
  onReload?.(e);
22
30
  };
23
- const handleOnPreview = (e) => {
24
- e.stopPropagation();
25
- setIsPreviewOpen(true);
31
+ const commonPreviewProps = {
32
+ className: 'w-full h-full',
33
+ status: previewStatus,
34
+ onClose: handleOnCancelPreview,
35
+ preview,
26
36
  };
27
- return (_jsxs("div", { className: cn('bg-white rounded-md shadow-[0px_2px_12px_0px_rgba(37,42,52,0.10)] w-full', 'pt-2 px-2 pb-1', 'border-gray-100', className), children: [_jsxs("div", { className: "flex items-start gap-2", children: [_jsxs("div", { className: "flex flex-1 gap-2 ", children: [_jsx(Icon, { name: getIconKey(mimeType), size: 36 }), _jsxs("div", { className: "flex w-23 flex-col", children: [_jsx("span", { className: cn('text-gray-900 text-xs font-medium leading-4.5', 'truncate'), children: fileName }), _jsx("span", { className: "text-gray-500 text-xs leading-4.5 font-medium", children: fileSize })] })] }), _jsx("div", { className: "flex flex-col items-center gap-2", children: _jsxs("div", { className: "flex items-center gap-2", children: [showProgress && _jsxs("span", { className: "text-gray-600 font-medium text-xs", children: [Math.round(progress), "%"] }), status === 'error' && (_jsx("button", { type: "button", onClick: handleOnReload, className: "text-gray-400 hover:text-gray-600 transition-colors", "aria-label": "Reload upload", children: _jsx(Icon, { name: "Reload", size: 16, className: "text-gray-900" }) })), _jsx("button", { type: "button", onClick: handleOnCancel, className: "text-gray-400 hover:text-gray-600 transition-colors", "aria-label": "Cancel Upload", children: _jsx(Icon, { name: "XmarkLight", size: 16, className: "text-gray-900" }) })] }) })] }), _jsxs("div", { className: "flex flex-col mt-0.5 h-4.5", children: [showProgress && (_jsx(ProgressBar, { value: progress, className: "h-2 bg-gray-100 [&_[data-slot=progress-bar-indicator]]:bg-blue-600" })), _jsxs("div", { className: "flex flex-row justify-between", role: "status", "aria-live": "polite", "aria-atomic": "true", children: [showSuccess && _jsx("span", { className: "text-green-700 text-xs leading-4.5 font-normal", children: MESSAGES.success }), showSuccess && showPreview && (_jsx("button", { type: "button", onClick: handleOnPreview, className: "text-blue-900 text-xs leading-4.5 font-normal", "aria-label": "Open preview", children: MESSAGES.preview }))] }), showError && (_jsx("div", { role: "alert", "aria-live": "assertive", "aria-atomic": "true", children: _jsx("span", { className: "text-red-900 text-xs leading-4.5 font-normal", children: MESSAGES.error }) }))] }), showPreview && (_jsx(AlertDialog, { open: isPreviewOpen, children: _jsx(AlertDialogContent, { children: _jsx("div", { className: "flex flex-col gap-2 w-[500px] h-[600px] mt-2", children: _jsx("img", { src: preview, alt: "preview", className: "w-full h-full" }) }) }) })), showErrorsUpload && _jsx(FormMessageList, { messages: errorsUpload, type: "error", className: "gap-0.5" })] }));
37
+ return (_jsxs("div", { className: cn('bg-white rounded-md shadow-[0px_2px_12px_0px_rgba(37,42,52,0.10)] w-full', 'pt-2 px-2 pb-1', 'border-gray-100', className), children: [_jsxs("div", { className: "flex items-start gap-2", children: [_jsxs("div", { className: "flex flex-1 gap-2 ", children: [_jsx(Icon, { name: getIconKey(mimeType), size: 36 }), _jsxs("div", { className: "flex w-23 flex-col", children: [_jsx("span", { className: cn('text-gray-900 text-xs font-medium leading-4.5', 'truncate'), children: fileName }), _jsx("span", { className: "text-gray-500 text-xs leading-4.5 font-medium", children: fileSize })] })] }), _jsx("div", { className: "flex flex-col items-center gap-2", children: _jsxs("div", { className: "flex items-center gap-2", children: [showProgress && _jsxs("span", { className: "text-gray-600 font-medium text-xs", children: [Math.round(progress), "%"] }), status === 'error' && (_jsx("button", { type: "button", onClick: handleOnReload, className: "text-gray-400 hover:text-gray-600 transition-colors", "aria-label": "Reload upload", children: _jsx(Icon, { name: "Reload", size: 16, className: "text-gray-900" }) })), _jsx("button", { type: "button", onClick: handleOnCancel, className: "text-gray-400 hover:text-gray-600 transition-colors", "aria-label": "Cancel Upload", children: _jsx(Icon, { name: "XmarkLight", size: 16, className: "text-gray-900" }) })] }) })] }), _jsxs("div", { className: "flex flex-col mt-0.5 h-4.5", children: [showProgress && (_jsx(ProgressBar, { value: progress, className: "h-2 bg-gray-100 [&_[data-slot=progress-bar-indicator]]:bg-blue-600" })), _jsxs("div", { className: "flex flex-row justify-between", role: "status", "aria-live": "polite", "aria-atomic": "true", children: [showSuccess && _jsx("span", { className: "text-green-700 text-xs leading-4.5 font-normal", children: MESSAGES.success }), showSuccess && showPreview && (_jsx("button", { type: "button", onClick: handleOnPreview, className: "text-blue-900 text-xs leading-4.5 font-normal", "aria-label": "Open preview", children: MESSAGES.preview }))] }), showError && (_jsx("div", { role: "alert", "aria-live": "assertive", "aria-atomic": "true", children: _jsx("span", { className: "text-red-900 text-xs leading-4.5 font-normal", children: MESSAGES.error }) }))] }), showPreview && (_jsxs(AlertDialog, { open: isPreviewOpen, children: [_jsx(VisuallyHidden, { children: _jsx(AlertDialogTitle, { children: "Preview" }) }), _jsx(VisuallyHidden, { children: _jsx(AlertDialogDescription, { children: "Preview of the file" }) }), _jsxs(AlertDialogContent, { className: cn('p-0 border-0 shadow-none bg-transparent max-w-none', getContainerDimensions(previewStatus, typePreview)), children: [previewStatus === 'loading' && (_jsx(PlaceHolderLoading, { onClose: handleOnCancelPreview, typePreview: typePreview ?? 'pdf' })), previewStatus === 'corrupted_file' && (_jsx(PlaceHolderCorrupted, { onClose: handleOnCancelPreview, typePreview: typePreview ?? 'pdf' })), previewStatus === 'unsupported_file' && _jsx(PlaceHolderUnsupported, { onClose: handleOnCancelPreview }), previewStatus === 'success' && (_jsxs(_Fragment, { children: [typePreview === 'pdf' && _jsx(PreviewFile, { ...commonPreviewProps }), typePreview === 'image' && _jsx(PreviewImage, { ...commonPreviewProps }), typePreview === 'audio' && _jsx(PreviewAudio, { ...commonPreviewProps }), typePreview === 'video' && _jsx(PreviewVideo, { ...commonPreviewProps })] }))] })] })), showErrorsUpload && _jsx(FormMessageList, { messages: errorsUpload, type: "error", className: "gap-0.5" })] }));
28
38
  };
39
+ FileUploadItem.displayName = 'FileUploadItem';
40
+ export { FileUploadItem };
29
41
  //# sourceMappingURL=file-upload-item.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"file-upload-item.js","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/sub-components/file-upload-item.tsx"],"names":[],"mappings":";A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AE,SAAS,EAAC,eAAe,GAAG,GACvD,IACL,GACF,IACF,EAEN,eAAK,SAAS,EAAC,4BAA4B,aACxC,YAAY,IAAI,CACf,KAAC,WAAW,IACV,KAAK,EAAE,QAAQ,EACf,SAAS,EAAC,oEAAoE,GAC9E,CACH,EACD,eAAK,SAAS,EAAC,+BAA+B,EAAC,IAAI,EAAC,QAAQ,eAAW,QAAQ,iBAAa,MAAM,aAC/F,WAAW,IAAI,eAAM,SAAS,EAAC,gDAAgD,YAAE,QAAQ,CAAC,OAAO,GAAQ,EACzG,WAAW,IAAI,WAAW,IAAI,CAC7B,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,eAAe,EACxB,SAAS,EAAC,+CAA+C,gBAC9C,cAAc,YAExB,QAAQ,CAAC,OAAO,GACV,CACV,IACG,EAEL,SAAS,IAAI,CACZ,cAAK,IAAI,EAAC,OAAO,eAAW,WAAW,iBAAa,MAAM,YACxD,eAAM,SAAS,EAAC,8CAA8C,YAAE,QAAQ,CAAC,KAAK,GAAQ,GAClF,CACP,IACG,EACL,WAAW,IAAI,CACd,KAAC,WAAW,IAAC,IAAI,EAAE,aAAa,YAC9B,KAAC,kBAAkB,cACjB,cAAK,SAAS,EAAC,8CAA8C,YAE3D,cAAK,GAAG,EAAE,OAAO,EAAE,GAAG,EAAC,SAAS,EAAC,SAAS,EAAC,eAAe,GAAG,GACzD,GACa,GACT,CACf,EAEA,gBAAgB,IAAI,KAAC,eAAe,IAAC,QAAQ,EAAE,YAAY,EAAE,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,SAAS,GAAG,IAC7F,CACP,CAAA;AACH,CAAC,CAAA"}
1
+ {"version":3,"file":"file-upload-item.js","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/sub-components/file-upload-item.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,qCAAqC,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,mEAAmE,CAAA;A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AAkB,IAAC,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,WAAW,IAAI,KAAK,GAAI,CAC1F,EAEA,aAAa,KAAK,gBAAgB,IAAI,CACrC,KAAC,oBAAoB,IAAC,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,WAAW,IAAI,KAAK,GAAI,CAC5F,EAEA,aAAa,KAAK,kBAAkB,IAAI,KAAC,sBAAsB,IAAC,OAAO,EAAE,qBAAqB,GAAI,EAElG,aAAa,KAAK,SAAS,IAAI,CAC9B,8BACG,WAAW,KAAK,KAAK,IAAI,KAAC,WAAW,OAAK,kBAAkB,GAAI,EAChE,WAAW,KAAK,OAAO,IAAI,KAAC,YAAY,OAAK,kBAAkB,GAAI,EACnE,WAAW,KAAK,OAAO,IAAI,KAAC,YAAY,OAAK,kBAAkB,GAAI,EACnE,WAAW,KAAK,OAAO,IAAI,KAAC,YAAY,OAAK,kBAAkB,GAAI,IACnE,CACJ,IACkB,IACT,CACf,EAEA,gBAAgB,IAAI,KAAC,eAAe,IAAC,QAAQ,EAAE,YAAY,EAAE,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,SAAS,GAAG,IAC7F,CACP,CAAA;AACH,CAAC,CAAA;AAED,cAAc,CAAC,WAAW,GAAG,gBAAgB,CAAA;AAE7C,OAAO,EAAE,cAAc,EAAE,CAAA"}
@@ -0,0 +1,9 @@
1
+ import type { PreviewType } from '../types.js';
2
+ interface PlaceHolderCorruptedProps {
3
+ onClose: () => void;
4
+ className?: string;
5
+ typePreview: PreviewType;
6
+ }
7
+ export declare const PlaceHolderCorrupted: ({ onClose, className, typePreview }: PlaceHolderCorruptedProps) => import("react/jsx-runtime").JSX.Element;
8
+ export {};
9
+ //# sourceMappingURL=placeholder-corrupted.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"placeholder-corrupted.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/sub-components/placeholder-corrupted.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAI9C,UAAU,yBAAyB;IACjC,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,WAAW,CAAA;CACzB;AAED,eAAO,MAAM,oBAAoB,GAAI,qCAAqC,yBAAyB,4CAwBlG,CAAA"}
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from '../../../../../scalars/lib/utils.js';
3
+ import { Icon } from '../../../icon/index.js';
4
+ import { getBrokenFileIcon } from '../utils.js';
5
+ import PreviewHeader from './preview-header.js';
6
+ export const PlaceHolderCorrupted = ({ onClose, className, typePreview }) => {
7
+ const iconBroken = getBrokenFileIcon(typePreview);
8
+ return (_jsxs("div", { className: cn('flex flex-col bg-white rounded-md shadow-[1px_4px_15px_0px_rgba(74,88,115,0.25)] px-6 py-4 gap-4 w-full h-full', className), children: [_jsx(PreviewHeader, { status: "error", onClose: onClose, title: "Corrupted File" }), _jsx("div", { className: "flex flex-col items-center justify-center bg-gray-100 w-full rounded-md overflow-hidden flex-1", children: _jsx("div", { className: "relative", children: _jsx(Icon, { name: iconBroken, size: 128, className: "text-gray-300" }) }) }), _jsx("div", { className: "border-gray-200", children: _jsx("p", { className: "text-xs text-red-900 font-normal leading-4.5", children: "Your file is corrupted and cannot be shown in the preview" }) })] }));
9
+ };
10
+ //# sourceMappingURL=placeholder-corrupted.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"placeholder-corrupted.js","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/sub-components/placeholder-corrupted.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,qCAAqC,CAAA;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAE7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,aAAa,MAAM,qBAAqB,CAAA;AAQ/C,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAA6B,EAAE,EAAE;IACrG,MAAM,UAAU,GAAG,iBAAiB,CAAC,WAAW,CAAC,CAAA;IAEjD,OAAO,CACL,eACE,SAAS,EAAE,EAAE,CACX,gHAAgH,EAChH,SAAS,CACV,aAED,KAAC,aAAa,IAAC,MAAM,EAAC,OAAO,EAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAC,gBAAgB,GAAG,EACzE,cAAK,SAAS,EAAC,gGAAgG,YAC7G,cAAK,SAAS,EAAC,UAAU,YACvB,KAAC,IAAI,IAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAC,eAAe,GAAG,GAC3D,GACF,EAEN,cAAK,SAAS,EAAC,iBAAiB,YAC9B,YAAG,SAAS,EAAC,8CAA8C,0EAEvD,GACA,IACF,CACP,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,8 @@
1
+ import type { PreviewType } from '../types.js';
2
+ interface PlaceHolderPdfProps {
3
+ onClose: () => void;
4
+ typePreview: PreviewType;
5
+ }
6
+ export declare const PlaceHolderLoading: ({ onClose, typePreview }: PlaceHolderPdfProps) => import("react/jsx-runtime").JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=placeholder-loading.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"placeholder-loading.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/sub-components/placeholder-loading.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAG9C,UAAU,mBAAmB;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,WAAW,EAAE,WAAW,CAAA;CACzB;AAED,eAAO,MAAM,kBAAkB,GAAI,0BAA0B,mBAAmB,4CAuB/E,CAAA"}
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import PreviewHeader from './preview-header.js';
3
+ import LoadingBar from './loading-bar.js';
4
+ import { cn } from '../../../../../scalars/lib/utils.js';
5
+ import { Icon } from '../../../icon/index.js';
6
+ import { getIconLoading } from '../utils.js';
7
+ export const PlaceHolderLoading = ({ onClose, typePreview }) => {
8
+ const iconLoading = getIconLoading(typePreview);
9
+ return (_jsxs("div", { className: "flex flex-col bg-white rounded-md shadow-[1px_4px_15px_0px_rgba(37, 44, 56, 0.25)] px-6 py-4 gap-4 border border-gray-200 w-full h-full", children: [_jsx(PreviewHeader, { status: "idle", onClose: onClose }), _jsx("div", { className: cn('flex-1 min-h-0 flex flex-col items-center justify-center bg-gray-100 w-full overflow-auto rounded-md'), children: _jsxs("div", { className: "flex flex-col items-center justify-center gap-6", children: [_jsx("div", { className: "relative", children: _jsx(Icon, { name: iconLoading, size: 256, className: "text-gray-300" }) }), _jsxs("div", { className: "flex flex-col items-center justify-center gap-4", children: [_jsx("h3", { className: "text-xl font-bold leading-6 text-gray-500", children: "Loading" }), _jsx(LoadingBar, { progress: 50, className: "w-[375px]" })] })] }) })] }));
10
+ };
11
+ //# sourceMappingURL=placeholder-loading.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"placeholder-loading.js","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/sub-components/placeholder-loading.tsx"],"names":[],"mappings":";AAAA,OAAO,aAAa,MAAM,qBAAqB,CAAA;AAC/C,OAAO,UAAU,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,EAAE,EAAE,MAAM,qCAAqC,CAAA;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAE7C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAO5C,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EAAE,OAAO,EAAE,WAAW,EAAuB,EAAE,EAAE;IAClF,MAAM,WAAW,GAAG,cAAc,CAAC,WAAW,CAAC,CAAA;IAC/C,OAAO,CACL,eAAK,SAAS,EAAC,yIAAyI,aACtJ,KAAC,aAAa,IAAC,MAAM,EAAC,MAAM,EAAC,OAAO,EAAE,OAAO,GAAI,EACjD,cACE,SAAS,EAAE,EAAE,CACX,sGAAsG,CACvG,YAED,eAAK,SAAS,EAAC,iDAAiD,aAC9D,cAAK,SAAS,EAAC,UAAU,YACvB,KAAC,IAAI,IAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAC,eAAe,GAAG,GAC5D,EAEN,eAAK,SAAS,EAAC,iDAAiD,aAC9D,aAAI,SAAS,EAAC,2CAA2C,wBAAa,EACtE,KAAC,UAAU,IAAC,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAC,WAAW,GAAG,IAC9C,IACF,GACF,IACF,CACP,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ interface PlaceHolderPdfProps {
2
+ onClose: () => void;
3
+ }
4
+ export declare const PlaceHolderUnsupported: ({ onClose }: PlaceHolderPdfProps) => import("react/jsx-runtime").JSX.Element;
5
+ export {};
6
+ //# sourceMappingURL=placeholder-unsupported.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"placeholder-unsupported.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/sub-components/placeholder-unsupported.tsx"],"names":[],"mappings":"AAIA,UAAU,mBAAmB;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB;AAED,eAAO,MAAM,sBAAsB,GAAI,aAAa,mBAAmB,4CAwBtE,CAAA"}
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import PreviewHeader from './preview-header.js';
3
+ import { cn } from '../../../../../scalars/lib/utils.js';
4
+ import { Icon } from '../../../icon/index.js';
5
+ export const PlaceHolderUnsupported = ({ onClose }) => {
6
+ return (_jsxs("div", { className: "flex flex-col bg-white rounded-md shadow-[1px_4px_15px_0px_rgba(37, 44, 56, 0.25)] px-6 py-4 gap-4 border border-gray-200 w-full h-full", children: [_jsx(PreviewHeader, { status: "idle", onClose: onClose }), _jsxs("div", { className: cn('flex-1 min-h-0 flex flex-col items-center justify-center bg-gray-100 w-full overflow-auto rounded-md'), children: [_jsx("div", { className: "relative", children: _jsx(Icon, { name: "ContentUnavailableIcon", size: 256, className: "text-gray-300" }) }), _jsxs("div", { className: "flex flex-col items-center justify-center gap-4", children: [_jsx("h3", { className: "text-xl font-bold leading-6 text-gray-500", children: "Opss!" }), _jsx("p", { className: "text-center text-sm text-gray-500 mx-auto max-w-[375px] whitespace-pre-line", children: "It looks like we still don't support this format. (We are working on it) Please try to upload it with a different Format." })] })] })] }));
7
+ };
8
+ //# sourceMappingURL=placeholder-unsupported.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"placeholder-unsupported.js","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/sub-components/placeholder-unsupported.tsx"],"names":[],"mappings":";AAAA,OAAO,aAAa,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,EAAE,EAAE,MAAM,qCAAqC,CAAA;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAM7C,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,EAAE,OAAO,EAAuB,EAAE,EAAE;IACzE,OAAO,CACL,eAAK,SAAS,EAAC,yIAAyI,aACtJ,KAAC,aAAa,IAAC,MAAM,EAAC,MAAM,EAAC,OAAO,EAAE,OAAO,GAAI,EACjD,eACE,SAAS,EAAE,EAAE,CACX,sGAAsG,CACvG,aAED,cAAK,SAAS,EAAC,UAAU,YACvB,KAAC,IAAI,IAAC,IAAI,EAAC,wBAAwB,EAAC,IAAI,EAAE,GAAG,EAAE,SAAS,EAAC,eAAe,GAAG,GACvE,EAEN,eAAK,SAAS,EAAC,iDAAiD,aAC9D,aAAI,SAAS,EAAC,2CAA2C,sBAAW,EAEpE,YAAG,SAAS,EAAC,6EAA6E,0IAGtF,IACA,IACF,IACF,CACP,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,8 @@
1
+ interface AudioPreviewProps {
2
+ onClose?: () => void;
3
+ preview?: string;
4
+ className?: string;
5
+ }
6
+ declare const PreviewAudio: ({ onClose, preview, className }: AudioPreviewProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default PreviewAudio;
8
+ //# sourceMappingURL=preview-audio.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preview-audio.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/sub-components/preview-audio.tsx"],"names":[],"mappings":"AAGA,UAAU,iBAAiB;IACzB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,QAAA,MAAM,YAAY,GAAI,iCAA8C,iBAAiB,4CAiBpF,CAAA;AAED,eAAe,YAAY,CAAA"}
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from '../../../../../scalars/lib/utils.js';
3
+ import PreviewHeader from './preview-header.js';
4
+ const PreviewAudio = ({ onClose = () => null, preview, className }) => {
5
+ return (_jsxs("div", { className: cn('flex flex-col bg-white rounded-md shadow-[1px_4px_15px_0px_rgba(74,88,15,0.25)] px-6 py-4 gap-4 w-full h-full', className), children: [_jsx(PreviewHeader, { status: "idle", onClose: onClose, title: "Audio Preview" }), _jsx("div", { className: "flex-1 flex items-center justify-center", children: _jsx("audio", { src: preview, controls: true, className: "w-full", "aria-label": "Audio player", children: _jsx("p", { children: "Your browser does not support the audio preview." }) }) })] }));
6
+ };
7
+ export default PreviewAudio;
8
+ //# sourceMappingURL=preview-audio.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preview-audio.js","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/sub-components/preview-audio.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,qCAAqC,CAAA;AACxD,OAAO,aAAa,MAAM,qBAAqB,CAAA;AAQ/C,MAAM,YAAY,GAAG,CAAC,EAAE,OAAO,GAAG,GAAG,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAqB,EAAE,EAAE;IACvF,OAAO,CACL,eACE,SAAS,EAAE,EAAE,CACX,+GAA+G,EAC/G,SAAS,CACV,aAED,KAAC,aAAa,IAAC,MAAM,EAAC,MAAM,EAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAC,eAAe,GAAG,EAEvE,cAAK,SAAS,EAAC,yCAAyC,YACtD,gBAAO,GAAG,EAAE,OAAO,EAAE,QAAQ,QAAC,SAAS,EAAC,QAAQ,gBAAY,cAAc,YACxE,2EAAuD,GACjD,GACJ,IACF,CACP,CAAA;AACH,CAAC,CAAA;AAED,eAAe,YAAY,CAAA"}
@@ -1,10 +1,8 @@
1
- import { type PreviewStatus } from '../types.js';
2
1
  interface FilePreviewStateProps {
3
- status: PreviewStatus;
4
- onClose: () => void;
5
- title?: string;
6
- message?: string;
2
+ onClose?: () => void;
3
+ preview?: string;
4
+ className?: string;
7
5
  }
8
- declare const PreviewFilePreview: ({ status, onClose, title: overrideTitle, message: overrideMessage, }: FilePreviewStateProps) => import("react/jsx-runtime").JSX.Element;
9
- export default PreviewFilePreview;
6
+ declare const PreviewFile: ({ onClose, preview, className }: FilePreviewStateProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default PreviewFile;
10
8
  //# sourceMappingURL=preview-file.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"preview-file.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/sub-components/preview-file.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,aAAa,CAAA;AAIhE,UAAU,qBAAqB;IAC7B,MAAM,EAAE,aAAa,CAAA;IACrB,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,QAAA,MAAM,kBAAkB,GAAI,sEAKzB,qBAAqB,4CAoDvB,CAAA;AAED,eAAe,kBAAkB,CAAA"}
1
+ {"version":3,"file":"preview-file.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/components/data-entry/file-input/sub-components/preview-file.tsx"],"names":[],"mappings":"AAGA,UAAU,qBAAqB;IAC7B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,QAAA,MAAM,WAAW,GAAI,iCAA8C,qBAAqB,4CAqBvF,CAAA;AAED,eAAe,WAAW,CAAA"}