@apple-pie/slice 0.1.30 → 0.1.32

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 (334) hide show
  1. package/README.md +36 -276
  2. package/dist/cjs/chunks/{AudioBubble-DisHuKIC.js → AudioBubble-Dh2IlYW0.js} +3 -5
  3. package/dist/cjs/chunks/Avatar-WcBAu25_.js +82 -0
  4. package/dist/cjs/chunks/{AvatarGroup-DhGp_qLw.js → AvatarGroup-eUkVdeTf.js} +1 -3
  5. package/dist/cjs/chunks/Badge-4tBynWZe.js +22 -0
  6. package/dist/cjs/chunks/{Button-PsJx1WmV.js → Button-QJ5lsSAz.js} +1 -3
  7. package/dist/cjs/chunks/{ButtonBar-8zm6a_h7.js → ButtonBar-DcpvT1vD.js} +1 -3
  8. package/dist/cjs/chunks/{Camera-zFyIXcge.js → Camera-iDyPLq9h.js} +3 -5
  9. package/dist/cjs/chunks/CheckBox-CmZJd8u2.js +51 -0
  10. package/dist/cjs/chunks/Chip-Bd1bSYeC.js +77 -0
  11. package/dist/cjs/chunks/{DivInput-2cMdJQ9U.js → DivInput-BY9pQ6ty.js} +1 -3
  12. package/dist/cjs/chunks/{Dot-fKIwhjYA.js → Dot-BeWDLajy.js} +1 -3
  13. package/dist/cjs/chunks/{DrggablePanel-P7TgBI3j.js → DrggablePanel-DzY5wTco.js} +3 -5
  14. package/dist/cjs/chunks/DropDown-Cn_nX8u7.js +104 -0
  15. package/dist/cjs/chunks/ErrorSummary-D-0uVwyV.js +85 -0
  16. package/dist/cjs/chunks/{FileIcon-PuDoz0mF.js → FileIcon-JfY2AYqG.js} +2 -2
  17. package/dist/cjs/chunks/FileList-Dc1nfpR2.js +222 -0
  18. package/dist/cjs/chunks/{FlexDiv-D4aSJC_G.js → FlexDiv-B5Pi0-aJ.js} +2 -3
  19. package/dist/cjs/chunks/Grouper-DKZkTlow.js +61 -0
  20. package/dist/cjs/chunks/{Icon-BtcHXeqE.js → Icon-BVYVJp9J.js} +4 -7
  21. package/dist/cjs/chunks/IconButton-CP1Wsvsx.js +82 -0
  22. package/dist/cjs/chunks/{IndexedDB-BaVmQgkK.js → IndexedDB-CeiVT55Z.js} +1 -1
  23. package/dist/cjs/chunks/Label-DIs1rOey.js +102 -0
  24. package/dist/cjs/chunks/Level-3yxetsco.js +58 -0
  25. package/dist/cjs/chunks/{MdStreamBuffer-CvLO7CVi.js → MdStreamBuffer-BudWFoNw.js} +38 -16
  26. package/dist/cjs/chunks/Modal-CjpQdoOe.js +127 -0
  27. package/dist/cjs/chunks/{ModalController-13xmvKnm.js → ModalController-Cp2PXOOS.js} +1 -3
  28. package/dist/cjs/chunks/{Overlay-GXu6nMnw.js → Overlay-DRpHYZek.js} +1 -3
  29. package/dist/cjs/chunks/Pager-ChnTKwml.js +36 -0
  30. package/dist/cjs/chunks/{ProgressIndicator-D06PqCQk.js → ProgressIndicator-CFiAU-aF.js} +2 -6
  31. package/dist/cjs/chunks/{PromptInput-DuE4vGxR.js → PromptInput-BFWR0TaP.js} +2 -4
  32. package/dist/cjs/chunks/RadioButton-Bi-FP41j.js +55 -0
  33. package/dist/cjs/chunks/{RadioButtonList-N7Fmvr5W.js → RadioButtonList-JHPKMCoX.js} +1 -2
  34. package/dist/cjs/chunks/{Slider-BSy8xciG.js → Slider-D97ws1Cl.js} +1 -3
  35. package/dist/cjs/chunks/{Spacer-CyZAUR5N.js → Spacer-DvI2M1wZ.js} +1 -1
  36. package/dist/cjs/chunks/{Switch-Crm-nHYI.js → Switch-DDSSprb7.js} +1 -2
  37. package/dist/cjs/chunks/{TabBar-BtFfMwiB.js → TabBar-TllSeSzb.js} +2 -4
  38. package/dist/cjs/chunks/TextArea-DjZRDixt.js +74 -0
  39. package/dist/cjs/chunks/{TextField-Bh2EA082.js → TextField-CKA3K0AN.js} +3 -5
  40. package/dist/cjs/chunks/Tip-BdGXN-TQ.js +88 -0
  41. package/dist/cjs/chunks/Toast-COrDS_50.js +177 -0
  42. package/dist/cjs/chunks/ToggleButton-hoOMzBZc.js +39 -0
  43. package/dist/cjs/chunks/UploadArea-ClG8ZgRZ.js +127 -0
  44. package/dist/cjs/chunks/{WSConnection-DrOC8Z0R.js → WSConnection-Brxc2hEv.js} +1 -1
  45. package/dist/cjs/chunks/WebRTCConnection-eWP4lueC.js +252 -0
  46. package/dist/cjs/chunks/{localDBStore-zyDhaEiP.js → localDBStore-SS_r0C6F.js} +1 -1
  47. package/dist/cjs/chunks/{microphoneStore-D1fV_8QQ.js → microphoneStore-DM_8bhFr.js} +27 -4
  48. package/dist/cjs/chunks/{misc-QpU0XEOW.js → misc-4xyXRU2K.js} +1 -1
  49. package/dist/cjs/chunks/{sseStore-1OeJ9TRP.js → sseStore-Ag-UnuQq.js} +2 -2
  50. package/dist/cjs/chunks/{uploads-worker-Az040BSN.js → uploads-worker-CI-SZptI.js} +1 -1
  51. package/dist/cjs/chunks/{uploadsStore-8mOTz0Qe.js → uploadsStore-DR2hc4ct.js} +2 -2
  52. package/dist/cjs/chunks/{volumeStore-Pv23v12t.js → volumeStore-DtTHf-9_.js} +5 -4
  53. package/dist/cjs/chunks/webRTCStore-DWWn7k-0.js +55 -0
  54. package/dist/cjs/chunks/{windowStore-CCxCOUqa.js → windowStore-BUo9Du_e.js} +1 -1
  55. package/dist/cjs/components/AudioBubble/index.js +7 -7
  56. package/dist/cjs/components/Avatar/index.js +3 -4
  57. package/dist/cjs/components/AvatarGroup/index.js +4 -4
  58. package/dist/cjs/components/Badge/index.js +3 -3
  59. package/dist/cjs/components/Button/index.js +7 -8
  60. package/dist/cjs/components/ButtonBar/index.js +7 -7
  61. package/dist/cjs/components/Camera/index.js +8 -8
  62. package/dist/cjs/components/CheckBox/index.js +7 -7
  63. package/dist/cjs/components/Chip/index.js +7 -8
  64. package/dist/cjs/components/DivInput/index.js +3 -4
  65. package/dist/cjs/components/Dot/index.js +3 -3
  66. package/dist/cjs/components/DraggablePanel/index.js +6 -6
  67. package/dist/cjs/components/DropDown/index.js +7 -7
  68. package/dist/cjs/components/ErrorSummary/index.js +6 -7
  69. package/dist/cjs/components/FileIcon/index.js +6 -7
  70. package/dist/cjs/components/FileList/index.js +7 -7
  71. package/dist/cjs/components/FlexDiv/index.js +3 -4
  72. package/dist/cjs/components/Grouper/index.js +7 -8
  73. package/dist/cjs/components/Icon/index.js +6 -7
  74. package/dist/cjs/components/IconButton/index.js +6 -7
  75. package/dist/cjs/components/Label/index.js +3 -4
  76. package/dist/cjs/components/Level/index.js +7 -0
  77. package/dist/cjs/components/Modal/index.js +7 -8
  78. package/dist/cjs/components/ModalController/index.js +4 -4
  79. package/dist/cjs/components/Overlay/index.js +3 -3
  80. package/dist/cjs/components/Pager/index.js +3 -4
  81. package/dist/cjs/components/Progress/index.js +5 -6
  82. package/dist/cjs/components/PromptInput/index.js +9 -10
  83. package/dist/cjs/components/RadioButton/index.js +7 -7
  84. package/dist/cjs/components/RadioButtonList/index.js +8 -8
  85. package/dist/cjs/components/Slider/index.js +4 -5
  86. package/dist/cjs/components/Spacer/index.js +2 -2
  87. package/dist/cjs/components/Switch/index.js +3 -3
  88. package/dist/cjs/components/TabBar/index.js +9 -9
  89. package/dist/cjs/components/TextArea/index.js +8 -8
  90. package/dist/cjs/components/Textfield/index.js +9 -9
  91. package/dist/cjs/components/Tip/index.js +3 -4
  92. package/dist/cjs/components/Toast/index.js +7 -8
  93. package/dist/cjs/components/ToggleButton/index.js +8 -8
  94. package/dist/cjs/components/UploadArea/index.js +7 -7
  95. package/dist/cjs/hooks/useAudioRecorder.js +1 -1
  96. package/dist/cjs/hooks/useBindWebRTC.js +60 -0
  97. package/dist/cjs/hooks/useLocalStore.js +3 -3
  98. package/dist/cjs/hooks/useMdStreamBuffer.js +55 -30
  99. package/dist/cjs/hooks/useMicrophone.js +1 -1
  100. package/dist/cjs/hooks/useObserveTheme.js +3 -3
  101. package/dist/cjs/hooks/useTheme.js +2 -3
  102. package/dist/cjs/hooks/useTrackRenders.js +2 -2
  103. package/dist/cjs/hooks.js +9 -6
  104. package/dist/cjs/index.js +19 -17
  105. package/dist/cjs/providers/ThemeProvider.js +6 -17
  106. package/dist/cjs/providers/themeServer.js +15 -9
  107. package/dist/cjs/providers.js +4 -5
  108. package/dist/cjs/stores/LocalDB.js +3 -3
  109. package/dist/cjs/stores/SSE.js +2 -2
  110. package/dist/cjs/stores/WS.js +2 -2
  111. package/dist/cjs/stores/WebRTC.js +9 -0
  112. package/dist/cjs/stores/microphone.js +5 -4
  113. package/dist/cjs/stores/modal.js +1 -1
  114. package/dist/cjs/stores/tip.js +1 -1
  115. package/dist/cjs/stores/toast.js +1 -1
  116. package/dist/cjs/stores/uploads.js +2 -2
  117. package/dist/cjs/stores/volume.js +2 -2
  118. package/dist/cjs/stores/window.js +2 -2
  119. package/dist/cjs/stores.js +18 -13
  120. package/dist/cjs/theme/type.js +1 -1
  121. package/dist/cjs/utils/index.js +4 -3
  122. package/dist/cjs/utils/objects/index.js +4 -3
  123. package/dist/cjs/workers/uploads/uploads.js +2 -2
  124. package/dist/esm/chunks/{AudioBubble-D052QyPH.mjs → AudioBubble-cYlxxQ7c.mjs} +3 -7
  125. package/dist/esm/chunks/Avatar-D84wF2os.mjs +88 -0
  126. package/dist/esm/chunks/{AvatarGroup-C7YRtPmJ.mjs → AvatarGroup-DiwfbRxH.mjs} +2 -6
  127. package/dist/esm/chunks/Badge-DuUb5-80.mjs +26 -0
  128. package/dist/esm/chunks/{Button-BQS3rwrS.mjs → Button-BIgwWrPJ.mjs} +6 -10
  129. package/dist/esm/chunks/{ButtonBar-GLNRjmjv.mjs → ButtonBar-vNvnvw7u.mjs} +3 -7
  130. package/dist/esm/chunks/{Camera-CAp0Y2gN.mjs → Camera-BMwkTJPq.mjs} +5 -9
  131. package/dist/esm/chunks/CheckBox-Cpoxy8w_.mjs +61 -0
  132. package/dist/esm/chunks/Chip-BayNVv7N.mjs +87 -0
  133. package/dist/esm/chunks/{DivInput-g6F1YWTo.mjs → DivInput-CWRUxy1y.mjs} +2 -6
  134. package/dist/esm/chunks/{Dot-DZE134mJ.mjs → Dot-v_kcIWV2.mjs} +1 -5
  135. package/dist/esm/chunks/{DrggablePanel-C0AmJy8g.mjs → DrggablePanel-yEeGeE1w.mjs} +2 -6
  136. package/dist/esm/chunks/DropDown-QQhwAg_J.mjs +112 -0
  137. package/dist/esm/chunks/ErrorSummary-DzIZMIll.mjs +90 -0
  138. package/dist/esm/chunks/{FileIcon-BQ2zZIW5.mjs → FileIcon-6UlkbKzk.mjs} +2 -2
  139. package/dist/esm/chunks/FileList-vMiGJByw.mjs +230 -0
  140. package/dist/esm/chunks/{FlexDiv-DnY1_qk4.mjs → FlexDiv-B1m7aY04.mjs} +3 -6
  141. package/dist/esm/chunks/Grouper-BDrAnfDF.mjs +73 -0
  142. package/dist/esm/chunks/{Icon--RjjODc9.mjs → Icon-D4A6_c4x.mjs} +3 -8
  143. package/dist/esm/chunks/IconButton-B_W-aOsB.mjs +96 -0
  144. package/dist/esm/chunks/{IndexedDB-Dk7a4fPS.mjs → IndexedDB-CTqfKmp1.mjs} +1 -1
  145. package/dist/esm/chunks/Label-I75yz3gq.mjs +113 -0
  146. package/dist/esm/chunks/Level-DgczkKBr.mjs +63 -0
  147. package/dist/esm/chunks/{MdStreamBuffer-By7pHJQL.mjs → MdStreamBuffer-CoQWQwRL.mjs} +38 -16
  148. package/dist/esm/chunks/Modal-CwwyijaO.mjs +139 -0
  149. package/dist/esm/chunks/{ModalController-BO5FkAqu.mjs → ModalController-IyB9lDRa.mjs} +2 -6
  150. package/dist/esm/chunks/{Overlay-sXM7cEYc.mjs → Overlay-C-yori3-.mjs} +1 -5
  151. package/dist/esm/chunks/Pager-BEtfyKtq.mjs +42 -0
  152. package/dist/esm/chunks/{ProgressIndicator-B5oByN3i.mjs → ProgressIndicator-BV0ginXb.mjs} +2 -8
  153. package/dist/esm/chunks/{PromptInput-Cwd53ux7.mjs → PromptInput-Cn5fRYap.mjs} +3 -7
  154. package/dist/esm/chunks/RadioButton-DWlg6ldv.mjs +63 -0
  155. package/dist/esm/chunks/{RadioButtonList-C_heuiis.mjs → RadioButtonList-D9FdlhPL.mjs} +3 -6
  156. package/dist/esm/chunks/{Slider-XEV0D2Rd.mjs → Slider-B2WZkZSg.mjs} +3 -7
  157. package/dist/esm/chunks/{Spacer-C5651N0N.mjs → Spacer-7Oj0SlD0.mjs} +1 -1
  158. package/dist/esm/chunks/{Switch-RfA431T4.mjs → Switch-DRhnznnO.mjs} +1 -4
  159. package/dist/esm/chunks/{TabBar-kPZ6ZJxr.mjs → TabBar-D6VR71ye.mjs} +5 -9
  160. package/dist/esm/chunks/TextArea-CkB5rJjI.mjs +80 -0
  161. package/dist/esm/chunks/{TextField-DwVKlLI_.mjs → TextField-BIXmkjEz.mjs} +5 -9
  162. package/dist/esm/chunks/Tip-CTdrwLky.mjs +96 -0
  163. package/dist/esm/chunks/Toast-8bUziIgh.mjs +189 -0
  164. package/dist/esm/chunks/ToggleButton-BOFITa8_.mjs +47 -0
  165. package/dist/esm/chunks/UploadArea-DE2ccDVx.mjs +135 -0
  166. package/dist/esm/chunks/{WSConnection-DV7k84B4.mjs → WSConnection-CHudrD62.mjs} +1 -1
  167. package/dist/esm/chunks/WebRTCConnection-DQbNa7Z9.mjs +252 -0
  168. package/dist/esm/chunks/{localDBStore-Dnpo5nSv.mjs → localDBStore-CaYiqITY.mjs} +2 -2
  169. package/dist/esm/chunks/{microphoneStore-Dr3lxoWX.mjs → microphoneStore-COEGtgyX.mjs} +26 -3
  170. package/dist/esm/chunks/{misc-wS74txaa.mjs → misc-2MIIqzsX.mjs} +1 -1
  171. package/dist/esm/chunks/{sseStore-DjrfpNAS.mjs → sseStore-nW9CMec_.mjs} +2 -2
  172. package/dist/esm/chunks/{tslib.es6-C-olHjXV.mjs → tslib.es6-C81Qhn1z.mjs} +1 -1
  173. package/dist/esm/chunks/{uploads-worker-CYp-F4dz.mjs → uploads-worker-CMomtRvm.mjs} +1 -1
  174. package/dist/esm/chunks/{uploadsStore-DeRMJ5c9.mjs → uploadsStore-CsfpSOTS.mjs} +1 -1
  175. package/dist/esm/chunks/{volumeStore-BX7QcrL-.mjs → volumeStore-TSYPqbHx.mjs} +5 -4
  176. package/dist/esm/chunks/webRTCStore-CVCDJzj5.mjs +57 -0
  177. package/dist/esm/chunks/{windowStore-CAzx2-QV.mjs → windowStore-BvejIR82.mjs} +1 -1
  178. package/dist/esm/components/AudioBubble/index.mjs +4 -6
  179. package/dist/esm/components/Avatar/index.mjs +3 -5
  180. package/dist/esm/components/AvatarGroup/index.mjs +4 -6
  181. package/dist/esm/components/Badge/index.mjs +2 -4
  182. package/dist/esm/components/Button/index.mjs +8 -10
  183. package/dist/esm/components/ButtonBar/index.mjs +4 -6
  184. package/dist/esm/components/Camera/index.mjs +6 -8
  185. package/dist/esm/components/CheckBox/index.mjs +4 -6
  186. package/dist/esm/components/Chip/index.mjs +5 -7
  187. package/dist/esm/components/DivInput/index.mjs +3 -5
  188. package/dist/esm/components/Dot/index.mjs +2 -4
  189. package/dist/esm/components/DraggablePanel/index.mjs +3 -5
  190. package/dist/esm/components/DropDown/index.mjs +4 -6
  191. package/dist/esm/components/ErrorSummary/index.mjs +3 -5
  192. package/dist/esm/components/FileIcon/index.mjs +3 -5
  193. package/dist/esm/components/FileList/index.mjs +6 -8
  194. package/dist/esm/components/FlexDiv/index.mjs +2 -4
  195. package/dist/esm/components/Grouper/index.mjs +5 -7
  196. package/dist/esm/components/Icon/index.mjs +4 -6
  197. package/dist/esm/components/IconButton/index.mjs +7 -9
  198. package/dist/esm/components/Label/index.mjs +3 -5
  199. package/dist/esm/components/Level/index.mjs +11 -0
  200. package/dist/esm/components/Modal/index.mjs +10 -12
  201. package/dist/esm/components/ModalController/index.mjs +4 -6
  202. package/dist/esm/components/Overlay/index.mjs +2 -4
  203. package/dist/esm/components/Pager/index.mjs +3 -5
  204. package/dist/esm/components/Progress/index.mjs +4 -6
  205. package/dist/esm/components/PromptInput/index.mjs +11 -13
  206. package/dist/esm/components/RadioButton/index.mjs +4 -6
  207. package/dist/esm/components/RadioButtonList/index.mjs +5 -7
  208. package/dist/esm/components/Slider/index.mjs +4 -6
  209. package/dist/esm/components/Spacer/index.mjs +2 -2
  210. package/dist/esm/components/Switch/index.mjs +2 -4
  211. package/dist/esm/components/TabBar/index.mjs +8 -10
  212. package/dist/esm/components/TextArea/index.mjs +9 -11
  213. package/dist/esm/components/Textfield/index.mjs +10 -12
  214. package/dist/esm/components/Tip/index.mjs +3 -5
  215. package/dist/esm/components/Toast/index.mjs +5 -7
  216. package/dist/esm/components/ToggleButton/index.mjs +9 -11
  217. package/dist/esm/components/UploadArea/index.mjs +9 -11
  218. package/dist/esm/hooks/useAudioRecorder.mjs +1 -1
  219. package/dist/esm/hooks/useBindWebRTC.mjs +72 -0
  220. package/dist/esm/hooks/useLocalStore.mjs +3 -3
  221. package/dist/esm/hooks/useMdStreamBuffer.mjs +56 -28
  222. package/dist/esm/hooks/useMicrophone.mjs +1 -1
  223. package/dist/esm/hooks/useObserveTheme.mjs +0 -2
  224. package/dist/esm/hooks/useTheme.mjs +0 -2
  225. package/dist/esm/hooks/useTrackRenders.mjs +2 -2
  226. package/dist/esm/hooks.mjs +14 -4
  227. package/dist/esm/index.mjs +62 -52
  228. package/dist/esm/providers/ThemeProvider.mjs +6 -19
  229. package/dist/esm/providers/themeServer.mjs +11 -6
  230. package/dist/esm/providers.mjs +0 -2
  231. package/dist/esm/stores/LocalDB.mjs +3 -3
  232. package/dist/esm/stores/SSE.mjs +3 -3
  233. package/dist/esm/stores/WS.mjs +2 -2
  234. package/dist/esm/stores/WebRTC.mjs +7 -0
  235. package/dist/esm/stores/microphone.mjs +2 -2
  236. package/dist/esm/stores/modal.mjs +1 -1
  237. package/dist/esm/stores/tip.mjs +1 -1
  238. package/dist/esm/stores/toast.mjs +1 -1
  239. package/dist/esm/stores/uploads.mjs +3 -3
  240. package/dist/esm/stores/volume.mjs +2 -2
  241. package/dist/esm/stores/window.mjs +2 -2
  242. package/dist/esm/stores.mjs +17 -13
  243. package/dist/esm/theme/type.mjs +1 -1
  244. package/dist/esm/utils/index.mjs +11 -9
  245. package/dist/esm/utils/objects/index.mjs +8 -6
  246. package/dist/esm/workers/uploads/uploads.mjs +2 -2
  247. package/dist/styles.css +8476 -0
  248. package/dist/types/components/Level/Level.d.ts +5 -0
  249. package/dist/types/components/Level/_types.d.ts +21 -0
  250. package/dist/types/components/Level/index.d.ts +2 -0
  251. package/dist/types/components/Modal/_types.d.ts +4 -0
  252. package/dist/types/components/Toast/_types.d.ts +1 -0
  253. package/dist/types/hooks/index.d.ts +2 -0
  254. package/dist/types/hooks/useBindWebRTC/index.d.ts +1 -0
  255. package/dist/types/hooks/useBindWebRTC/useBindWebRTC.d.ts +15 -0
  256. package/dist/types/hooks/useLocalStore/useLocalStore.d.ts +1 -1
  257. package/dist/types/hooks/useMdStreamBuffer/useMdStreamBuffer.d.ts +6 -1
  258. package/dist/types/index.d.ts +4 -1
  259. package/dist/types/providers/ThemeProvider.d.ts +1 -6
  260. package/dist/types/providers/themeServer.d.ts +7 -3
  261. package/dist/types/stores/WebRTC/_types.d.ts +16 -0
  262. package/dist/types/stores/WebRTC/index.d.ts +2 -0
  263. package/dist/types/stores/WebRTC/webRTCStore.d.ts +21 -0
  264. package/dist/types/stores/index.d.ts +1 -0
  265. package/dist/types/stores/microphone/index.d.ts +1 -1
  266. package/dist/types/stores/microphone/microphoneStore.d.ts +14 -1
  267. package/dist/types/stores/toast/_types.d.ts +1 -0
  268. package/dist/types/stores/volume/_types.d.ts +3 -1
  269. package/dist/types/stores/volume/volumeStore.d.ts +6 -2
  270. package/dist/types/utils/functions/files.d.ts +1 -1
  271. package/dist/types/utils/index.d.ts +2 -2
  272. package/dist/types/utils/objects/MDStreamBuffer/MdStreamBuffer.d.ts +10 -0
  273. package/dist/types/utils/objects/MDStreamBuffer/_types.d.ts +2 -0
  274. package/dist/types/utils/objects/WebRTCConnection/WebRTCConnection.d.ts +37 -3
  275. package/dist/types/utils/objects/WebRTCConnection/_types.d.ts +13 -4
  276. package/dist/types/utils/objects/index.d.ts +2 -0
  277. package/package.json +8 -3
  278. package/dist/cjs/chunks/Avatar-CqUSRzVd.js +0 -84
  279. package/dist/cjs/chunks/Badge-DjPJ_iJX.js +0 -24
  280. package/dist/cjs/chunks/CheckBox-Cbh6UK-7.js +0 -53
  281. package/dist/cjs/chunks/Chip-DcS8dtW2.js +0 -79
  282. package/dist/cjs/chunks/DropDown-B0970yVe.js +0 -105
  283. package/dist/cjs/chunks/ErrorSummary-K_rPxGWK.js +0 -87
  284. package/dist/cjs/chunks/FileList-sDq1jK0b.js +0 -225
  285. package/dist/cjs/chunks/Grouper-Ccd-x_Nb.js +0 -63
  286. package/dist/cjs/chunks/IconButton-CF4cR7Tr.js +0 -84
  287. package/dist/cjs/chunks/Label-htjXHiQ4.js +0 -103
  288. package/dist/cjs/chunks/Modal-C0Z59meI.js +0 -101
  289. package/dist/cjs/chunks/Pager-D2_fshTy.js +0 -38
  290. package/dist/cjs/chunks/RadioButton-DPB2ZGVf.js +0 -56
  291. package/dist/cjs/chunks/TextArea-CRiPRF8v.js +0 -76
  292. package/dist/cjs/chunks/Tip-C5keUoHx.js +0 -90
  293. package/dist/cjs/chunks/Toast-CyiFOsI3.js +0 -178
  294. package/dist/cjs/chunks/ToggleButton-D5_WnW0o.js +0 -40
  295. package/dist/cjs/chunks/UploadArea-KqES_OLl.js +0 -129
  296. package/dist/cjs/chunks/style-inject.es-CMuL-BfJ.js +0 -11
  297. package/dist/esm/chunks/Avatar-29zhNfxX.mjs +0 -92
  298. package/dist/esm/chunks/Badge-CC0zSLMf.mjs +0 -30
  299. package/dist/esm/chunks/CheckBox-7TiT2U47.mjs +0 -65
  300. package/dist/esm/chunks/Chip-CKsojimU.mjs +0 -91
  301. package/dist/esm/chunks/DropDown-mwo8fY7p.mjs +0 -115
  302. package/dist/esm/chunks/ErrorSummary-EzCqVifm.mjs +0 -94
  303. package/dist/esm/chunks/FileList-fh-x9Dzm.mjs +0 -235
  304. package/dist/esm/chunks/Grouper-naJMvpB9.mjs +0 -77
  305. package/dist/esm/chunks/IconButton-ByBYppAj.mjs +0 -100
  306. package/dist/esm/chunks/Label-C04tD7UZ.mjs +0 -116
  307. package/dist/esm/chunks/Modal-B9ad9OfJ.mjs +0 -115
  308. package/dist/esm/chunks/Pager-Bz0FpgO5.mjs +0 -46
  309. package/dist/esm/chunks/RadioButton-CLeRiZ8x.mjs +0 -66
  310. package/dist/esm/chunks/TextArea-CxscPLwN.mjs +0 -84
  311. package/dist/esm/chunks/Tip-C6EcX7_M.mjs +0 -100
  312. package/dist/esm/chunks/Toast-D4uMNvaa.mjs +0 -192
  313. package/dist/esm/chunks/ToggleButton-C0QIflzX.mjs +0 -51
  314. package/dist/esm/chunks/UploadArea-je-1NhGb.mjs +0 -139
  315. package/dist/esm/chunks/style-inject.es-D0BjEaN8.mjs +0 -11
  316. /package/dist/cjs/chunks/{SSEConnection-C-1OzEOp.js → SSEConnection-DfjLAlOG.js} +0 -0
  317. /package/dist/cjs/chunks/{_types-Bdqd2vHh.js → _types-DMyBIF8s.js} +0 -0
  318. /package/dist/cjs/chunks/{audioVisualizer-EIfIjWH7.js → audioVisualizer-BxPvUj4h.js} +0 -0
  319. /package/dist/cjs/chunks/{colors-njquvHkx.js → colors-4n0sNFRA.js} +0 -0
  320. /package/dist/cjs/chunks/{debounce-BF4i6uIC.js → debounce-_IK-La-Z.js} +0 -0
  321. /package/dist/cjs/chunks/{modalStore-7VjHHM8X.js → modalStore-CFsfK3ba.js} +0 -0
  322. /package/dist/cjs/chunks/{sharedTypes-gCECyn2N.js → sharedTypes-C0ZHzH_T.js} +0 -0
  323. /package/dist/cjs/chunks/{tipStore-Ck4NLvml.js → tipStore-dqD9-c30.js} +0 -0
  324. /package/dist/cjs/chunks/{toastStore-CSStgB9d.js → toastStore-BN1N7WXv.js} +0 -0
  325. /package/dist/cjs/chunks/{tslib.es6-C8dZW5nY.js → tslib.es6-DsF7Wv4Y.js} +0 -0
  326. /package/dist/esm/chunks/{SSEConnection-DcA3wFsO.mjs → SSEConnection-iFKOV9Uo.mjs} +0 -0
  327. /package/dist/esm/chunks/{_types-BVrr_Khp.mjs → _types-DrNviSG6.mjs} +0 -0
  328. /package/dist/esm/chunks/{audioVisualizer-ZgT77nUw.mjs → audioVisualizer-BsmpLZyK.mjs} +0 -0
  329. /package/dist/esm/chunks/{colors-FQ0uNQcW.mjs → colors-BAATtfbL.mjs} +0 -0
  330. /package/dist/esm/chunks/{debounce-Bst1jxMS.mjs → debounce-CYBH5qXQ.mjs} +0 -0
  331. /package/dist/esm/chunks/{modalStore-BpWnLtOF.mjs → modalStore-DmaeMv7z.mjs} +0 -0
  332. /package/dist/esm/chunks/{sharedTypes-tn9-uJvb.mjs → sharedTypes-CyrInj1b.mjs} +0 -0
  333. /package/dist/esm/chunks/{tipStore-CL5a95Bl.mjs → tipStore-B_MUZfr2.mjs} +0 -0
  334. /package/dist/esm/chunks/{toastStore-D2PEIqCo.mjs → toastStore-DAprlBVj.mjs} +0 -0
@@ -1,91 +0,0 @@
1
- 'use client';
2
- import { a as __rest } from "./tslib.es6-C-olHjXV.mjs";
3
-
4
- import { jsxs, jsx } from "react/jsx-runtime";
5
-
6
- import React, { useState, useCallback, useMemo } from "react";
7
-
8
- import { s as setStyle, a as accessibleKeyDown } from "./misc-wS74txaa.mjs";
9
-
10
- import { I as Icon } from "./Icon--RjjODc9.mjs";
11
-
12
- import { T as ToolTipType } from "./sharedTypes-tn9-uJvb.mjs";
13
-
14
- import { s as styleInject } from "./style-inject.es-D0BjEaN8.mjs";
15
-
16
- var css = {
17
- chip: "Chip-module_chip__0nys- flexBox-module_row__z24tF",
18
- icon: "Chip-module_icon__dtR-K flexBox-module_row__z24tF",
19
- xs: "Chip-module_xs__s-KNG type-module_body-xs-regular__ZAFft",
20
- s: "Chip-module_s__2KTXi type-module_body-s-regular__vRHSP",
21
- m: "Chip-module_m__l2u3N type-module_body-m-regular__LuQBA",
22
- l: "Chip-module_l__3MqPN type-module_body-l-regular__lOYbg"
23
- };
24
-
25
- styleInject(".flexBox-module_row__z24tF {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowBetween__5FEvi {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowStart__4tcxS {\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowEnd__rVdVm {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_column__ezvMq {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStart__C7P44 {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: flex-start;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStartCenter__PKcrG {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnBetween__ERfp7 {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnEnd__lLJuc {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-end;\n\talign-items: flex-end;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.type-module_body-xs-regular__ZAFft {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-medium__s3KvF {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-bold__Lhqqq {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.25px;\n}.type-module_body-s-regular__vRHSP {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-medium__tjdFc {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-bold__Iy-VX {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-m-regular__LuQBA {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-medium__uW1on {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-bold__UBcvQ {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-l-regular__lOYbg {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-medium__BqRC7 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-bold__Fh2dt {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-xl-regular__pF2kC {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-medium__BeyrH {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-bold__Ruknj {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_heading-s-medium__z8L3G {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-s-bold__0O3g6 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-bold__KXxEB {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-medium__cJeEA {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-medium__eRe05 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-bold__Xmwtf {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-medium__5q1m3 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-bold__k9VFV {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}\n\n.Chip-module_chip__0nys- {\n\tpadding: var(--ui-chip-padding) !important;\n\twidth: min-content;\n\tmin-height: 30px;\n\tgap: var(--ui-chip-gap);\n\tbackground: var(--ui-chip-bg-color);\n\tline-height: 1em;\n\tcolor: var(--ui-chip-label-color);\n\tborder: var(--ui-chip-border-size) solid var(--ui-chip-border-color);\n\tborder-radius: var(--ui-chip-border-radius);\n\ttransition: all var(--motion-water-duration) var(--motion-water) 0s;\n\tcursor: var(--ui-chip-cursor);\n\twhite-space: nowrap;\n\tuser-select: none;\n\t-webkit-user-select: none;\n\t&:hover {\n\t\tborder-color: var(--ui-chip-border-color-hover);\n\t\tbackground: var(--ui-chip-bg-color-hover);\n\t\tcolor: var(--ui-chip-label-color-hover);\n\t}\n}\n\n.Chip-module_icon__dtR-K {\n\theight: var(--ui-chip-icon-size);\n\tmin-height: var(--ui-chip-icon-size);\n\twidth: var(--ui-chip-icon-size);\n\tmin-width: var(--ui-chip-icon-size);\n}\n\n.Chip-module_xs__s-KNG {\n}\n\n.Chip-module_s__2KTXi {\n}\n\n.Chip-module_m__l2u3N {\n}\n\n.Chip-module_l__3MqPN {\n}\n");
26
-
27
- const Chip = React.memo(props => {
28
- const {children: children, label: label, icon: icon, tooltip: tooltip, iconSize: iconSize = 20, disabled: disabled = !1, focused: focused = !1, iconPosition: iconPosition = "left", labelSize: labelSize = "m", labelColor: labelColor = "var(--core-text-primary)", labelColorHover: labelColorHover = "var(--core-text-special)", iconColor: iconColor = "var(--core-text-primary)", iconColorHover: iconColorHover = "var(--core-text-special)", backgroundColor: backgroundColor, backgroundColorHover: backgroundColorHover, borderWidth: borderWidth, borderSize: borderSize = 1, borderColor: borderColor = "var(--core-text-primary)", borderColorHover: borderColorHover = "var(--core-text-special)", borderColorDisabled: borderColorDisabled = "var(--core-text-disabled)", bgColor: bgColor = "transparent", bgColorHover: bgColorHover = "var(--core-surface-secondary)", borderRadius: borderRadius = 8, paddingTop: paddingTop, paddingTops: paddingTops = 8, paddingSides: paddingSides = 16, gap: gap = 4, onToolTip: onToolTip = () => null, onClick: onClick = () => null} = props, divAttributes = __rest(props, [ "children", "label", "icon", "tooltip", "iconSize", "disabled", "focused", "iconPosition", "labelSize", "labelColor", "labelColorHover", "iconColor", "iconColorHover", "backgroundColor", "backgroundColorHover", "borderWidth", "borderSize", "borderColor", "borderColorHover", "borderColorDisabled", "bgColor", "bgColorHover", "borderRadius", "paddingTop", "paddingTops", "paddingSides", "gap", "onToolTip", "onClick" ]), {id: divId, className: className, style: style} = divAttributes, rest = __rest(divAttributes, [ "id", "className", "style" ]), divStyle = null != style ? style : {}, divClass = className ? ` ${className}` : "", [isHovered, setIsHovered] = useState(!1), resolvedBackgroundColor = null != backgroundColor ? backgroundColor : bgColor, resolvedBackgroundColorHover = null != backgroundColorHover ? backgroundColorHover : bgColorHover, resolvedBorderWidth = null != borderWidth ? borderWidth : borderSize, resolvedPaddingTop = null != paddingTop ? paddingTop : paddingTops, handleClick = useCallback(e => {
29
- disabled || onClick(e);
30
- }, [ disabled, onClick ]), handleMouseEnter = useCallback((enter, event) => {
31
- if (enter) {
32
- if (tooltip) {
33
- const tip = {
34
- type: ToolTipType.button,
35
- payload: {
36
- label: tooltip
37
- },
38
- ref: null,
39
- event: event
40
- };
41
- onToolTip(tip);
42
- }
43
- setIsHovered(!0);
44
- } else onToolTip(null), setIsHovered(!1);
45
- }, [ tooltip, onToolTip ]), padding = useMemo(() => {
46
- if (!icon) return `${resolvedPaddingTop}px ${paddingSides}px`;
47
- return `${resolvedPaddingTop}px ${"right" === iconPosition ? paddingSides - 4 : paddingSides}px ${resolvedPaddingTop}px ${"right" === iconPosition ? paddingSides : paddingSides - 4}px`;
48
- }, [ icon, iconPosition, resolvedPaddingTop, paddingSides ]), computedIconColor = useMemo(() => disabled ? "var(--core-text-disabled)" : isHovered ? null != iconColorHover ? iconColorHover : "var(--core-text-special)" : null != iconColor ? iconColor : "var(--core-text-primary)", [ iconColor, disabled, isHovered, iconColorHover ]), cssVars = useMemo(() => ({
49
- "--ui-chip-padding": padding,
50
- "--ui-chip-gap": setStyle(gap),
51
- "--ui-chip-border-radius": setStyle(borderRadius),
52
- "--ui-chip-border-size": setStyle(resolvedBorderWidth),
53
- "--ui-chip-border-color": disabled ? borderColorDisabled : borderColor,
54
- "--ui-chip-border-color-hover": disabled ? borderColorDisabled : borderColorHover,
55
- "--ui-chip-bg-color": resolvedBackgroundColor,
56
- "--ui-chip-bg-color-hover": disabled ? resolvedBackgroundColor : resolvedBackgroundColorHover,
57
- "--ui-chip-label-color": disabled ? "var(--core-text-disabled)" : labelColor,
58
- "--ui-chip-label-color-hover": disabled ? "var(--core-text-disabled)" : labelColorHover,
59
- "--ui-chip-cursor": disabled ? "default" : "pointer"
60
- }), [ padding, resolvedBackgroundColor, borderColor, borderColorDisabled, borderColorHover, resolvedBorderWidth, resolvedBackgroundColorHover, labelColorHover, labelColor, gap, borderRadius, disabled ]);
61
- return jsxs("div", Object.assign({
62
- id: divId,
63
- className: `${css.chip}${divClass}`,
64
- style: Object.assign(Object.assign({}, divStyle), cssVars),
65
- onKeyDown: e => accessibleKeyDown(e, () => handleClick(e)),
66
- onClick: handleClick,
67
- onMouseEnter: e => handleMouseEnter(!0, e),
68
- onMouseLeave: e => handleMouseEnter(!1, e)
69
- }, rest, {
70
- children: [ icon && "right" !== iconPosition && jsx("div", {
71
- className: css.icon,
72
- children: jsx(Icon, {
73
- name: icon,
74
- size: iconSize,
75
- strokeColor: computedIconColor
76
- })
77
- }), jsx("div", {
78
- className: css[labelSize],
79
- children: null != children ? children : label
80
- }), icon && "right" === iconPosition && jsx("div", {
81
- className: css.icon,
82
- children: jsx(Icon, {
83
- name: icon,
84
- size: iconSize,
85
- strokeColor: computedIconColor
86
- })
87
- }) ]
88
- }));
89
- });
90
-
91
- export { Chip as C };
@@ -1,115 +0,0 @@
1
- 'use client';
2
- import { a as __rest } from "./tslib.es6-C-olHjXV.mjs";
3
-
4
- import { jsx, jsxs } from "react/jsx-runtime";
5
-
6
- import React, { useState, useRef, useEffect, useCallback, useMemo } from "react";
7
-
8
- import { s as setStyle } from "./misc-wS74txaa.mjs";
9
-
10
- import { I as Icon } from "./Icon--RjjODc9.mjs";
11
-
12
- import { s as styleInject } from "./style-inject.es-D0BjEaN8.mjs";
13
-
14
- var css = {
15
- wrapper: "DropDown-module_wrapper__CyX0u flexBox-module_rowStart__4tcxS",
16
- face: "DropDown-module_face__6gyF3 flexBox-module_rowStart__4tcxS",
17
- faceText: "DropDown-module_faceText__glhB3",
18
- label: "DropDown-module_label__Mrwbp flexBox-module_rowStart__4tcxS",
19
- xs: "DropDown-module_xs__7L71q type-module_body-xs-regular__ZAFft",
20
- s: "DropDown-module_s__vAxXD type-module_body-s-regular__vRHSP",
21
- m: "DropDown-module_m__K6JPk type-module_body-m-regular__LuQBA",
22
- l: "DropDown-module_l__Kib48 type-module_body-l-regular__lOYbg",
23
- chevron: "DropDown-module_chevron__LkYsE flexBox-module_rowStart__4tcxS",
24
- select: "DropDown-module_select__mzNnv"
25
- };
26
-
27
- function resolveValueKey(value, valueKey) {
28
- if (valueKey && value && "object" == typeof value) return value[valueKey];
29
- }
30
-
31
- function DropDownComponent(props) {
32
- const {name: name = "drop-down-select", label: label, labelColor: labelColor = "var(--core-text-primary)", size: size = "m", width: width = "100%", height: height = "auto", inline: inline = !1, selectedIndex: selectedIndex, selectedValue: selectedValue, valueKey: valueKey, options: options = [], placeholder: placeholder = !0, borderRadius: borderRadius = 8, backgroundColor: backgroundColor = "var(--core-surface-secondary)", bgColor: bgColor = "var(--core-surface-secondary)", iconColor: iconColor = "var(--core-text-primary)", textColor: textColor = "var(--core-text-primary)", borderWidth: borderWidth, borderSize: borderSize = 1, borderColor: borderColor = "var(--core-outline-primary)", paddingLeft: paddingLeft = "10px", paddingRight: paddingRight = "8px", paddingTop: paddingTop = "8px", paddingBottom: paddingBottom = "8px", borderStyle: borderStyle = "box", iconSize: iconSize = 20, disabled: disabled = !1, error: error = !1, gap: gap = 8, onChange: onChange = () => null, onOption: onOption = () => null} = props, divAttributes = __rest(props, [ "name", "label", "labelColor", "size", "width", "height", "inline", "selectedIndex", "selectedValue", "valueKey", "options", "placeholder", "borderRadius", "backgroundColor", "bgColor", "iconColor", "textColor", "borderWidth", "borderSize", "borderColor", "paddingLeft", "paddingRight", "paddingTop", "paddingBottom", "borderStyle", "iconSize", "disabled", "error", "gap", "onChange", "onOption" ]), {id: divId, className: className, style: style} = divAttributes, rest = __rest(divAttributes, [ "id", "className", "style" ]), divStyle = null != style ? style : {}, divClass = className ? ` ${className}` : "", resolvedBackgroundColor = null != backgroundColor ? backgroundColor : bgColor, resolvedBorderWidth = null != borderWidth ? borderWidth : borderSize, [index, setIndex] = useState(null != selectedIndex ? selectedIndex : 0), [selectedText, setSelectedText] = useState("Select an option"), ref = useRef(null);
33
- useEffect(() => {
34
- if (null == selectedValue && void 0 !== selectedIndex && (null == ref ? void 0 : ref.current)) {
35
- if (!(null == options ? void 0 : options[selectedIndex])) return;
36
- const label = options[selectedIndex].label || "Select an option";
37
- setIndex(selectedIndex), setSelectedText(label), ref.current.selectedIndex = selectedIndex;
38
- }
39
- }, [ selectedIndex, options, selectedValue ]), useEffect(() => {
40
- if (!options || 0 === options.length || null == selectedValue) return;
41
- const selectedKey = resolveValueKey(selectedValue, valueKey), foundIndex = options.findIndex(option => {
42
- var _a, _b;
43
- return (null == option ? void 0 : option.value) === selectedValue || void 0 !== selectedKey && resolveValueKey(null == option ? void 0 : option.value, valueKey) === selectedKey || (null === (_a = null == option ? void 0 : option.label) || void 0 === _a ? void 0 : _a.toLowerCase()) === String(selectedValue).toLowerCase() || (null === (_b = null == option ? void 0 : option.alt) || void 0 === _b ? void 0 : _b.toLowerCase()) === String(selectedValue).toLowerCase();
44
- });
45
- if (-1 !== foundIndex) {
46
- const label = options[foundIndex].label || "Select an option";
47
- setSelectedText(label), setIndex(foundIndex), ref.current && (ref.current.selectedIndex = foundIndex);
48
- }
49
- }, [ selectedValue, options, valueKey ]);
50
- const handleChange = useCallback(i => {
51
- if (!options) return;
52
- const label = options[i].label || "Select an option";
53
- setIndex(i), setSelectedText(label), index !== i && (onChange(i, options[i]), onOption(options[i]));
54
- }, [ options, index, onChange, onOption ]), renderedOptions = useMemo(() => options ? options.map((option, i) => jsx("option", {
55
- value: i,
56
- onMouseUp: () => handleChange(i),
57
- children: null == option ? void 0 : option.label
58
- }, `${null == option ? void 0 : option.value}_${i}`)) : null, [ options, handleChange ]), displayText = useMemo(() => selectedText.replace("-- ", ""), [ selectedText ]), handleMouseDown = useCallback(e => {
59
- disabled && e.preventDefault();
60
- }, [ disabled ]), handleSelectChange = useCallback(e => {
61
- handleChange(e.target.selectedIndex);
62
- }, [ handleChange ]), setTextColor = useMemo(() => disabled ? "var(--core-text-disabled)" : placeholder && 0 === index ? "var(--core-text-tertiary)" : textColor, [ disabled, placeholder, index, textColor ]), setLabelColor = useMemo(() => disabled ? "var(--core-text-disabled)" : labelColor, [ disabled, labelColor ]), setIconColor = useMemo(() => disabled ? "var(--core-text-disabled)" : iconColor, [ disabled, iconColor ]), setBorderColor = useMemo(() => disabled ? "var(--core-outline-primary)" : error ? "var(--feedback-warning)" : borderColor, [ disabled, error, borderColor ]), setPadding = useMemo(() => "box" === borderStyle ? `${setStyle(paddingTop)} ${setStyle(paddingRight)} ${setStyle(paddingBottom)} ${setStyle(paddingLeft)}` : `0 0 ${setStyle(paddingBottom)} 0`, [ paddingTop, paddingRight, paddingBottom, paddingLeft, borderStyle ]), setBorder = useMemo(() => "box" === borderStyle ? `${setStyle(resolvedBorderWidth)} solid ${setBorderColor}` : "unset", [ resolvedBorderWidth, setBorderColor, borderStyle ]), setBorderBottom = useMemo(() => "none" !== borderStyle ? `${setStyle(resolvedBorderWidth)} solid ${setStyle(borderColor)}` : "unset", [ resolvedBorderWidth, borderColor, borderStyle ]), setBorderRadius = useMemo(() => "box" !== borderStyle ? 0 : `${borderRadius}px`, [ borderStyle, borderRadius ]), cssVars = useMemo(() => ({
63
- "--dd-gap": setStyle(gap),
64
- "--dd-height": setStyle(height),
65
- "--dd-width": setStyle(width),
66
- "--dd-margin": inline ? "0 4px" : "0",
67
- "--dd-border-radius": setBorderRadius,
68
- "--dd-border": setBorder,
69
- "--dd-border-bottom": setBorderBottom,
70
- "--dd-color": setTextColor,
71
- "--dd-bg-color": null != resolvedBackgroundColor ? resolvedBackgroundColor : "transparent",
72
- "--dd-padding": setPadding,
73
- "--dd-icon-size": `${iconSize}px`,
74
- "--dd-label-color": setLabelColor,
75
- "--dd-display": inline ? "inline-flex" : "flex"
76
- }), [ gap, height, width, setBorderRadius, setBorder, setBorderBottom, setTextColor, resolvedBackgroundColor, setPadding, setLabelColor, iconSize, inline ]);
77
- return jsxs("span", Object.assign({
78
- id: divId,
79
- className: `${css.wrapper}${divClass}`,
80
- style: Object.assign(Object.assign({}, divStyle), cssVars)
81
- }, rest, {
82
- children: [ label && jsx("span", {
83
- className: `${css.label} ${css[size]}`,
84
- children: label
85
- }), jsx("span", {
86
- className: `${css.face} ${css[size]}`,
87
- children: jsx("span", {
88
- className: css.faceText,
89
- children: displayText
90
- })
91
- }), jsx("span", {
92
- className: css.chevron,
93
- children: jsx(Icon, {
94
- name: "chevron down",
95
- size: iconSize,
96
- strokeColor: setIconColor
97
- })
98
- }), jsx("select", {
99
- className: css.select,
100
- value: index,
101
- ref: ref,
102
- onMouseDown: handleMouseDown,
103
- onChange: handleSelectChange,
104
- "aria-label": name,
105
- children: renderedOptions
106
- }) ]
107
- }));
108
- }
109
-
110
- styleInject(".flexBox-module_row__z24tF {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowBetween__5FEvi {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowStart__4tcxS {\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowEnd__rVdVm {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_column__ezvMq {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStart__C7P44 {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: flex-start;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStartCenter__PKcrG {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnBetween__ERfp7 {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnEnd__lLJuc {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-end;\n\talign-items: flex-end;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.type-module_body-xs-regular__ZAFft {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-medium__s3KvF {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-bold__Lhqqq {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.25px;\n}.type-module_body-s-regular__vRHSP {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-medium__tjdFc {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-bold__Iy-VX {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-m-regular__LuQBA {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-medium__uW1on {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-bold__UBcvQ {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-l-regular__lOYbg {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-medium__BqRC7 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-bold__Fh2dt {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-xl-regular__pF2kC {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-medium__BeyrH {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-bold__Ruknj {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_heading-s-medium__z8L3G {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-s-bold__0O3g6 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-bold__KXxEB {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-medium__cJeEA {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-medium__eRe05 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-bold__Xmwtf {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-medium__5q1m3 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-bold__k9VFV {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}\n\n.DropDown-module_wrapper__CyX0u {\n\tdisplay: var(--dd-display) !important;\n\tpadding: var(--dd-padding) !important;\n\tmargin: var(--dd-margin) !important;\n\tposition: relative;\n\tgap: var(--dd-gap);\n\twidth: var(--dd-width);\n\tborder-radius: var(--dd-border-radius);\n\tbackground-color: var(--dd-bg-color);\n\tborder: var(--dd-border);\n\tborder-bottom: var(--dd-border-bottom);\n\ttransition: all var(--motion-water-duration) var(--motion-water) 0s;\n\tuser-select: none;\n\t-webkit-user-select: none;\n}\n\n.DropDown-module_face__6gyF3 {\n\toverflow: hidden;\n\tmin-width: 0;\n\tflex: 1;\n}\n\n.DropDown-module_faceText__glhB3 {\n\tdisplay: -webkit-box;\n\t-webkit-line-clamp: 1;\n\t-webkit-box-orient: vertical;\n\tbox-sizing: border-box;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\tword-break: break-all;\n\tcolor: var(--dd-color);\n\tmin-width: 0;\n}\n\n.DropDown-module_label__Mrwbp {\n\twidth: min-content;\n\toverflow: hidden;\n\twhite-space: nowrap;\n\ttext-overflow: ellipsis;\n\tcolor: var(--dd-label-color);\n}\n\n.DropDown-module_xs__7L71q {\n}\n\n.DropDown-module_s__vAxXD {\n}\n\n.DropDown-module_m__K6JPk {\n}\n\n.DropDown-module_l__Kib48 {\n}\n\n.DropDown-module_chevron__LkYsE {\n\tmin-height: var(--dd-icon-size);\n\tmax-height: var(--dd-icon-size);\n\tmin-width: var(--dd-icon-size);\n\tmax-width: var(--dd-icon-size);\n}\n\n.DropDown-module_select__mzNnv {\n\tposition: absolute;\n\topacity: 0;\n\twidth: 100%;\n\theight: 100%;\n\tfont-size: 14px;\n\tbackground-color: #1f99cd;\n\tbackground-position: right 10px center;\n\tbackground-repeat: no-repeat;\n\tbackground-size: auto 50%;\n\tborder: none;\n\toutline: none;\n\t-moz-appearance: none;\n\t-webkit-appearance: none;\n\tappearance: none;\n\t&::-ms-expand {\n\t\tdisplay: none;\n\t}\n}\n"),
111
- DropDownComponent.displayName = "DropDown";
112
-
113
- const DropDown = React.memo(DropDownComponent);
114
-
115
- export { DropDown as D };
@@ -1,94 +0,0 @@
1
- 'use client';
2
- import { a as __rest } from "./tslib.es6-C-olHjXV.mjs";
3
-
4
- import { jsx, jsxs } from "react/jsx-runtime";
5
-
6
- import { AnimatePresence, motion } from "motion/react";
7
-
8
- import React, { useMemo, useCallback } from "react";
9
-
10
- import { useTheme } from "../hooks/useTheme.mjs";
11
-
12
- import "../theme/colors.mjs";
13
-
14
- import { a as addOpacity } from "./colors-FQ0uNQcW.mjs";
15
-
16
- import "../hooks/useWindow.mjs";
17
-
18
- import { s as styleInject } from "./style-inject.es-D0BjEaN8.mjs";
19
-
20
- var css = {
21
- errorBox: "ErrorSummary-module_errorBox__hjY50 flexBox-module_columnStart__C7P44",
22
- error: "ErrorSummary-module_error__QX1mr flexBox-module_columnStart__C7P44",
23
- p: "ErrorSummary-module_p__N-2Po",
24
- ul: "ErrorSummary-module_ul__Xv0K7",
25
- li: "ErrorSummary-module_li__0ciEx",
26
- xs: "ErrorSummary-module_xs__pTqMn type-module_body-xs-regular__ZAFft",
27
- s: "ErrorSummary-module_s__u2sIP type-module_body-s-regular__vRHSP",
28
- m: "ErrorSummary-module_m__-QyP- type-module_body-m-regular__LuQBA",
29
- l: "ErrorSummary-module_l__bb1xZ type-module_body-l-regular__lOYbg"
30
- };
31
-
32
- styleInject(".flexBox-module_row__z24tF {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowBetween__5FEvi {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowStart__4tcxS {\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowEnd__rVdVm {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_column__ezvMq {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStart__C7P44 {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: flex-start;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStartCenter__PKcrG {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnBetween__ERfp7 {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnEnd__lLJuc {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-end;\n\talign-items: flex-end;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.type-module_body-xs-regular__ZAFft {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-medium__s3KvF {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-bold__Lhqqq {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.25px;\n}.type-module_body-s-regular__vRHSP {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-medium__tjdFc {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-bold__Iy-VX {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-m-regular__LuQBA {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-medium__uW1on {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-bold__UBcvQ {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-l-regular__lOYbg {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-medium__BqRC7 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-bold__Fh2dt {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-xl-regular__pF2kC {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-medium__BeyrH {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-bold__Ruknj {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_heading-s-medium__z8L3G {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-s-bold__0O3g6 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-bold__KXxEB {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-medium__cJeEA {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-medium__eRe05 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-bold__Xmwtf {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-medium__5q1m3 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-bold__k9VFV {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}\n\n.ErrorSummary-module_errorBox__hjY50 {\n\twidth: 100%;\n\tbackground: var(--error-bg-color);\n\tborder: 1px solid var(--error-text-color);\n\tborder-radius: 4px;\n\tpadding: 16px !important;\n\toverflow: hidden;\n\tgap: 0;\n}\n\n.ErrorSummary-module_error__QX1mr {\n\twidth: 100%;\n\tmargin: 0 !important;\n\tpadding: 0 !important;\n\tmargin-bottom: 4px !important;\n\t&:last-child {\n\t\tmargin-bottom: 0 !important;\n\t}\n}\n\n.ErrorSummary-module_p__N-2Po {\n\tmargin: 0 !important;\n\tpadding: 0 !important;\n\tcolor: var(--error-text-color) !important;\n}\n\n.ErrorSummary-module_ul__Xv0K7 {\n\tpadding: 0 !important;\n\tmargin: 0 !important;\n}\n\n.ErrorSummary-module_li__0ciEx {\n\tcolor: var(--error-text-color) !important;\n\tline-height: 1.5em !important;\n\tpadding: 0;\n}\n\n.ErrorSummary-module_xs__pTqMn {\n\tfont-size: var(--font-size-xs) !important;\n}\n\n.ErrorSummary-module_s__u2sIP {\n\tfont-size: var(--font-size-s) !important;\n}\n\n.ErrorSummary-module_m__-QyP- {\n\tfont-size: var(--font-size-m) !important;\n}\n\n.ErrorSummary-module_l__bb1xZ {\n\tfont-size: var(--font-size-l) !important;\n}\n");
33
-
34
- const ErrorSummary = React.memo(props => {
35
- const {current: current} = useTheme(), warning = current.colors["feedback-warning"], bg = addOpacity(warning, .1), {entries: entries, textSize: textSize = "m", textColor: textColor = warning, backgroundColor: backgroundColor, bgColor: bgColor = bg, autoNumber: autoNumber = !0} = props, divAttributes = __rest(props, [ "entries", "textSize", "textColor", "backgroundColor", "bgColor", "autoNumber" ]), {id: divId, className: className, style: style} = divAttributes, rest = __rest(divAttributes, [ "id", "className", "style" ]), divStyle = null != style ? style : {}, divClass = className ? ` ${className}` : "", resolvedBackgroundColor = null != backgroundColor ? backgroundColor : bgColor, variants = useMemo(() => ({
36
- enter: {
37
- opacity: 0,
38
- maxHeight: 0
39
- },
40
- animate: {
41
- opacity: 1,
42
- maxHeight: 500
43
- },
44
- exit: {
45
- opacity: 0,
46
- maxHeight: 0
47
- }
48
- }), []), transition = useMemo(() => ({
49
- ease: "easeInOut",
50
- duration: .25
51
- }), []), renderMessages = useCallback(messages => messages ? messages.map(message => jsx("li", {
52
- className: `${css.li} ${css[textSize]}`,
53
- children: message
54
- }, message)) : null, [ textSize ]), renderedErrors = useMemo(() => {
55
- if (!entries) return null;
56
- const addNumbers = autoNumber && entries.length > 1;
57
- return entries.map((error, index) => {
58
- let messages;
59
- error.message && (messages = Array.isArray(error.message) ? error.message : [ error.message ]);
60
- return jsxs("div", {
61
- className: css.error,
62
- children: [ jsx("p", {
63
- className: `${css.p} ${css[textSize]}`,
64
- children: jsx("strong", {
65
- children: `${addNumbers ? `${index + 1}. ` : ""}${error.title}`
66
- })
67
- }), messages && jsx("ul", {
68
- className: css.ul,
69
- children: renderMessages(messages)
70
- }) ]
71
- }, `${error.title}_${index}`);
72
- });
73
- }, [ entries, autoNumber, renderMessages, textSize ]), cssVars = useMemo(() => ({
74
- "--error-text-color": textColor,
75
- "--error-bg-color": resolvedBackgroundColor
76
- }), [ textColor, resolvedBackgroundColor ]);
77
- return jsx(AnimatePresence, {
78
- initial: !1,
79
- children: entries && entries.length > 0 && jsx(motion.div, Object.assign({
80
- id: divId,
81
- className: `${css.errorBox}${divClass}`,
82
- style: Object.assign(Object.assign({}, divStyle), cssVars),
83
- initial: "enter",
84
- animate: "animate",
85
- exit: "exit",
86
- variants: variants,
87
- transition: transition
88
- }, rest, {
89
- children: renderedErrors
90
- }))
91
- });
92
- });
93
-
94
- export { ErrorSummary as E };
@@ -1,235 +0,0 @@
1
- 'use client';
2
- import { a as __rest } from "./tslib.es6-C-olHjXV.mjs";
3
-
4
- import { jsx, jsxs } from "react/jsx-runtime";
5
-
6
- import React, { useCallback, useMemo } from "react";
7
-
8
- import { s as setStyle, a as accessibleKeyDown } from "./misc-wS74txaa.mjs";
9
-
10
- import { F as FileIcon } from "./FileIcon-BQ2zZIW5.mjs";
11
-
12
- import { I as Icon } from "./Icon--RjjODc9.mjs";
13
-
14
- import { P as ProgressIndicator } from "./ProgressIndicator-B5oByN3i.mjs";
15
-
16
- import { s as styleInject } from "./style-inject.es-D0BjEaN8.mjs";
17
-
18
- /**
19
- * Split a file name into its display name and extension.
20
- */ var css = {
21
- wrapper: "FileList-module_wrapper__9-rrl flexBox-module_rowStart__4tcxS",
22
- file: "FileList-module_file__61dkh flexBox-module_rowStart__4tcxS",
23
- fileName: "FileList-module_fileName__amame flexBox-module_row__z24tF",
24
- meta: "FileList-module_meta__unbpG flexBox-module_columnStart__C7P44",
25
- status: "FileList-module_status__H1s6f type-module_body-xs-regular__ZAFft",
26
- error: "FileList-module_error__UZ4-T",
27
- fileIcon: "FileList-module_fileIcon__xDWW8 flexBox-module_row__z24tF",
28
- icon: "FileList-module_icon__JR0HE flexBox-module_row__z24tF",
29
- xs: "FileList-module_xs__i2S-5 type-module_body-xs-regular__ZAFft",
30
- s: "FileList-module_s__4q0ae type-module_body-s-regular__vRHSP",
31
- m: "FileList-module_m__hWqBx type-module_body-m-regular__LuQBA",
32
- l: "FileList-module_l__tHDNp type-module_body-l-regular__lOYbg",
33
- xl: "FileList-module_xl__fxW11 type-module_body-xl-regular__pF2kC"
34
- };
35
-
36
- /**
37
- * display the remove button if not uploading
38
- */
39
- function displayClose(uploading) {
40
- return uploading ? {
41
- display: "none"
42
- } : {
43
- display: "flex"
44
- };
45
- }
46
-
47
- styleInject('.flexBox-module_row__z24tF {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowBetween__5FEvi {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowStart__4tcxS {\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowEnd__rVdVm {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_column__ezvMq {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStart__C7P44 {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: flex-start;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStartCenter__PKcrG {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnBetween__ERfp7 {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnEnd__lLJuc {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-end;\n\talign-items: flex-end;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.type-module_body-xs-regular__ZAFft {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-medium__s3KvF {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-bold__Lhqqq {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.25px;\n}.type-module_body-s-regular__vRHSP {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-medium__tjdFc {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-bold__Iy-VX {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-m-regular__LuQBA {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-medium__uW1on {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-bold__UBcvQ {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-l-regular__lOYbg {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-medium__BqRC7 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-bold__Fh2dt {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-xl-regular__pF2kC {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-medium__BeyrH {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-bold__Ruknj {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_heading-s-medium__z8L3G {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-s-bold__0O3g6 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-bold__KXxEB {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-medium__cJeEA {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-medium__eRe05 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-bold__Xmwtf {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-medium__5q1m3 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-bold__k9VFV {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}\n\n.FileList-module_wrapper__9-rrl {\n\twidth: 100%;\n\toverflow: hidden;\n\tflex-wrap: var(--file-wrap);\n\tflex-direction: var(--file-direction) !important;\n\talign-items: flex-start !important;\n\tgap: var(--file-gap);\n\tuser-select: none;\n\t-webkit-user-select: none;\n}\n\n.FileList-module_file__61dkh {\n\tposition: relative;\n\tpadding: var(--file-padding) !important;\n\tborder: 1px solid var(--file-border-color);\n\tborder-radius: 4px;\n\toverflow: hidden;\n\tmin-height: max-content;\n\tmax-width: var(--file-max-width);\n\tmin-width: var(--file-min-width);\n\tcolor: var(--core-text-primary);\n\tbackground: transparent;\n\tgap: 4px;\n}\n\n/* file progress bar */\n.FileList-module_file__61dkh::before {\n\tcontent: "";\n\tposition: absolute;\n\tbackground: var(--file-bg-color);\n\ttop: 0;\n\tbottom: 0;\n\tleft: 0;\n\twidth: var(--file-progress);\n\ttransition: width var(--motion-water-duration) var(--motion-water) 0s;\n\tz-index: 1;\n}\n\n.FileList-module_fileName__amame {\n\twidth: 100%;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n\tword-break: break-all;\n\tdisplay: -webkit-box !important;\n\t-webkit-line-clamp: 1;\n\t-webkit-box-orient: vertical;\n\tz-index: 2;\n}\n\n.FileList-module_meta__unbpG {\n\tflex: 1;\n\tmin-width: 0;\n\tgap: 2px;\n\tz-index: 2;\n}\n\n.FileList-module_status__H1s6f {\n\tcolor: var(--core-text-secondary);\n\tline-height: 1.2;\n}\n\n.FileList-module_error__UZ4-T {\n\tcolor: var(--feedback-warning);\n}\n\n.FileList-module_fileIcon__xDWW8 {\n\tmin-width: var(--file-icon-size);\n\tmin-height: var(--file-icon-size);\n\tmax-width: var(--file-icon-size);\n\tmax-height: var(--file-icon-size);\n\tz-index: 2;\n}\n\n.FileList-module_icon__JR0HE {\n\tmargin-left: 4px !important;\n\tmin-width: 20px;\n\tmin-height: 20px;\n\tmax-width: 20px;\n\tmax-height: 20px;\n\tcursor: pointer;\n\tz-index: 2;\n}\n\n.FileList-module_xs__i2S-5 {\n}\n\n.FileList-module_s__4q0ae {\n}\n\n.FileList-module_m__hWqBx {\n}\n\n.FileList-module_l__tHDNp {\n}\n\n.FileList-module_xl__fxW11 {\n}\n');
48
-
49
- const FileList = React.memo(props => {
50
- const {files: files = [], onChange: onChange, onToolTip: onToolTip, maxWidth: maxWidth, minWidth: minWidth, direction: direction = "row", padding: padding, gap: gap = 10, size: size = "s", iconSize: iconSize = 24, backgroundColor: backgroundColor, bgColor: bgColor, canRemove: canRemove = !0} = props, divAttributes = __rest(props, [ "files", "onChange", "onToolTip", "maxWidth", "minWidth", "direction", "padding", "gap", "size", "iconSize", "backgroundColor", "bgColor", "canRemove" ]), {id: divId, className: className, style: style} = divAttributes, rest = __rest(divAttributes, [ "id", "className", "style" ]), divStyle = null != style ? style : {}, divClass = className ? ` ${className}` : "", resolvedBackgroundColor = null != backgroundColor ? backgroundColor : bgColor, fileNameToFileItem = useCallback(fileName => {
51
- const {ext: ext, name: name} = function(fileName) {
52
- var _a;
53
- const ext = null !== (_a = fileName.split(".").pop()) && void 0 !== _a ? _a : "unknown";
54
- return {
55
- name: fileName,
56
- ext: ext
57
- };
58
- }
59
- /**
60
- * Map a file extension to the corresponding file icon name.
61
- */ (fileName);
62
- return {
63
- name: name,
64
- ext: ext,
65
- icon: function(extension) {
66
- switch (extension) {
67
- case "png":
68
- case "jpeg":
69
- case "jpg":
70
- case "gif":
71
- case "heic":
72
- return "image";
73
-
74
- case "docx":
75
- case "doc":
76
- case "txt":
77
- return "text";
78
-
79
- case "md":
80
- return "md";
81
-
82
- case "html":
83
- case "js":
84
- case "ts":
85
- case "tsx":
86
- case "json":
87
- case "py":
88
- return "code";
89
-
90
- case "xls":
91
- case "xlsx":
92
- case "csv":
93
- return "sheet";
94
-
95
- case "ppt":
96
- case "pptx":
97
- return "preso";
98
-
99
- case "pdf":
100
- return "pdf";
101
-
102
- case "mp3":
103
- case "aif":
104
- case "wav":
105
- return "audio";
106
-
107
- case "mp4":
108
- case "mov":
109
- return "video";
110
-
111
- case "clipboard":
112
- return "clipboard";
113
-
114
- default:
115
- return "other";
116
- }
117
- }(ext)
118
- };
119
- }, []), displayList = useMemo(() => files.map((item, index) => {
120
- var _a;
121
- const fileName =
122
- /**
123
- * utility get file name from file item
124
- */
125
- function(item) {
126
- return "string" == typeof item.file ? item.file : item.file.name;
127
- }
128
- /**
129
- * cal progress as a percentage string
130
- */ (item), fileMeta = fileNameToFileItem(fileName), progress = function(uploading, progress) {
131
- if (void 0 === progress || Number.isNaN(progress)) return uploading ? "0%" : "100%";
132
- const percent = progress <= 1 ? 100 * progress : progress, clamped = Math.max(0, Math.min(100, percent));
133
- return `${Math.round(clamped)}%`;
134
- }
135
- /**
136
- * display the progress indicator if uploading
137
- */ (item.uploading, item.progress);
138
- return Object.assign(Object.assign({}, fileMeta), {
139
- key: `${fileMeta.name}-${index}`,
140
- index: index,
141
- uploading: null !== (_a = item.uploading) && void 0 !== _a && _a,
142
- progress: progress,
143
- error: item.error
144
- });
145
- }), [ files, fileNameToFileItem ]), handleRemove = useCallback(index => {
146
- const updated = files.filter((_, itemIndex) => itemIndex !== index);
147
- null == onChange || onChange(updated);
148
- }, [ files, onChange ]), handleMouseOver = useCallback(e => {
149
- const toolTip = {
150
- payload: {
151
- label: "Remove file"
152
- },
153
- ref: {
154
- current: e.currentTarget
155
- }
156
- };
157
- null == onToolTip || onToolTip(toolTip);
158
- }, [ onToolTip ]), handleMouseOut = useCallback(() => {
159
- null == onToolTip || onToolTip(null);
160
- }, [ onToolTip ]), cssVars = useMemo(() => ({
161
- "--file-max-width": "column" === direction ? "100%" : setStyle(maxWidth),
162
- "--file-min-width": "column" !== direction || minWidth ? setStyle(minWidth) : "100%",
163
- "--file-gap": setStyle(gap),
164
- "--file-direction": direction,
165
- "--file-wrap": "column" === direction ? "nowrap" : "wrap",
166
- "--file-padding": padding ? setStyle(padding) : "4px 4px 4px 2px",
167
- "--file-icon-size": setStyle(iconSize),
168
- "--file-overflow": "column" === direction ? "unset" : "hidden",
169
- "--file-bg-color": null != resolvedBackgroundColor ? resolvedBackgroundColor : "var(--core-surface-secondary)"
170
- }), [ maxWidth, gap, direction, minWidth, padding, iconSize, resolvedBackgroundColor ]), fileCSSVars = useCallback((progress, error) => ({
171
- "--file-progress": `${progress}`,
172
- "--file-border-color": error ? "var(--feedback-warning)" : "var(--core-outline-primary)"
173
- }), []);
174
- return jsx("div", Object.assign({
175
- className: `${css.wrapper}${divClass}`,
176
- style: Object.assign(Object.assign({}, divStyle), cssVars),
177
- id: divId
178
- }, rest, {
179
- children: displayList.map(i => {
180
- return jsxs("div", {
181
- className: `${css.file} ${css[size]}`,
182
- style: fileCSSVars(i.progress, i.error),
183
- children: [ jsx("div", {
184
- className: css.fileIcon,
185
- children: jsx(FileIcon, {
186
- name: i.icon,
187
- size: iconSize
188
- })
189
- }), jsxs("div", {
190
- className: css.meta,
191
- children: [ jsx("div", {
192
- className: css.fileName,
193
- children: i.name
194
- }), i.error && jsx("div", {
195
- className: `${css.status} ${i.error ? css.error : ""}`,
196
- children: i.error
197
- }) ]
198
- }), jsx("div", {
199
- className: css.icon,
200
- style: (uploading = i.uploading, uploading ? {
201
- display: "flex"
202
- } : {
203
- display: "none"
204
- }),
205
- children: jsx(ProgressIndicator, {
206
- inline: !0,
207
- size: 20,
208
- show: i.uploading
209
- })
210
- }), canRemove && jsx("div", {
211
- className: css.icon,
212
- style: displayClose(i.uploading),
213
- role: "button",
214
- "aria-label": "remove file",
215
- onMouseOver: handleMouseOver,
216
- onMouseOut: handleMouseOut,
217
- onFocus: handleMouseOver,
218
- onBlur: handleMouseOut,
219
- onClick: () => handleRemove(i.index),
220
- onKeyDown: e => accessibleKeyDown(e, () => handleRemove(i.index)),
221
- tabIndex: 0,
222
- children: jsx(Icon, {
223
- name: "x",
224
- style: {
225
- pointerEvents: "none"
226
- }
227
- })
228
- }) ]
229
- }, i.key);
230
- var uploading;
231
- })
232
- }));
233
- });
234
-
235
- export { FileList as F };