solid-ui 3.1.3-11 → 3.1.3-13

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 (372) hide show
  1. package/README.md +11 -0
  2. package/dist/chunks/{DialogProvider-ge2aA77F.js → DialogProvider-B7wEBrVN.js} +11 -13
  3. package/dist/chunks/{DialogProvider-ge2aA77F.js.map → DialogProvider-B7wEBrVN.js.map} +1 -1
  4. package/dist/chunks/{account-CdqIoTsl.js → account-DeNlj01m.js} +30 -27
  5. package/dist/chunks/account-DeNlj01m.js.map +1 -0
  6. package/dist/chunks/{auth-D8B5yczR.js → auth-Knq99zZ9.js} +100 -117
  7. package/dist/chunks/auth-Knq99zZ9.js.map +1 -0
  8. package/dist/chunks/{avatar-DNGFKkhm.js → avatar-DgO_p94F.js} +16 -9
  9. package/dist/chunks/avatar-DgO_p94F.js.map +1 -0
  10. package/dist/chunks/{button-oanBb_ha.js → button-Dvkek1tx.js} +10 -11
  11. package/dist/chunks/{button-oanBb_ha.js.map → button-Dvkek1tx.js.map} +1 -1
  12. package/dist/chunks/{chunk.7MPIABXH-CEYdxYyt.js → chunk.7MPIABXH-DNcYOuE8.js} +22 -22
  13. package/dist/chunks/{chunk.7MPIABXH-CEYdxYyt.js.map → chunk.7MPIABXH-DNcYOuE8.js.map} +1 -1
  14. package/dist/chunks/{combobox-Dav1bNHS.js → combobox-B5j4LoHY.js} +109 -180
  15. package/dist/chunks/combobox-B5j4LoHY.js.map +1 -0
  16. package/dist/chunks/{combobox-option-DxJvAZ_Q.js → combobox-option-C5lKAumO.js} +7 -8
  17. package/dist/chunks/{combobox-option-DxJvAZ_Q.js.map → combobox-option-C5lKAumO.js.map} +1 -1
  18. package/dist/chunks/components-BD458q30.js +758 -0
  19. package/dist/chunks/components-BD458q30.js.map +1 -0
  20. package/dist/chunks/{dialog-Ujvm11_B.js → dialog-DZgm_Tph.js} +57 -114
  21. package/dist/chunks/dialog-DZgm_Tph.js.map +1 -0
  22. package/dist/chunks/{dialog-content-CEITrC59.js → dialog-content-DY-ROHyi.js} +4 -4
  23. package/dist/chunks/{dialog-content-CEITrC59.js.map → dialog-content-DY-ROHyi.js.map} +1 -1
  24. package/dist/chunks/{dialog-footer-DVLEK5bU.js → dialog-footer-BAZTjZ8J.js} +4 -4
  25. package/dist/chunks/{dialog-footer-DVLEK5bU.js.map → dialog-footer-BAZTjZ8J.js.map} +1 -1
  26. package/dist/chunks/{dialog-header-kEWl21oD.js → dialog-header-COzPcK8F.js} +4 -4
  27. package/dist/chunks/{dialog-header-kEWl21oD.js.map → dialog-header-COzPcK8F.js.map} +1 -1
  28. package/dist/chunks/dialogs-DEuwXC46.js +26 -0
  29. package/dist/chunks/dialogs-DEuwXC46.js.map +1 -0
  30. package/dist/chunks/{dialogs-root-dPGfuzSZ.js → dialogs-root-BYp6fIUE.js} +12 -17
  31. package/dist/chunks/dialogs-root-BYp6fIUE.js.map +1 -0
  32. package/dist/chunks/guard-DI4k0FkM.js +225 -0
  33. package/dist/chunks/guard-DI4k0FkM.js.map +1 -0
  34. package/dist/chunks/{menu-item-BHJ4xljI.js → input-CCpEhtqA.js} +33 -31
  35. package/dist/chunks/input-CCpEhtqA.js.map +1 -0
  36. package/dist/chunks/{login-button-Ta3tkpn4.js → login-button-BafqiKef.js} +9 -10
  37. package/dist/chunks/{login-button-Ta3tkpn4.js.map → login-button-BafqiKef.js.map} +1 -1
  38. package/dist/chunks/{logout-button-Db6VmUmJ.js → logout-button-D54NF9EW.js} +9 -10
  39. package/dist/chunks/{logout-button-Db6VmUmJ.js.map → logout-button-D54NF9EW.js.map} +1 -1
  40. package/dist/chunks/{menu-CQEXqNO6.js → menu-DKxtACGA.js} +46 -47
  41. package/dist/chunks/{menu-CQEXqNO6.js.map → menu-DKxtACGA.js.map} +1 -1
  42. package/dist/chunks/{input-BjCX2bFe.js → menu-item-D9BqJtKZ.js} +72 -132
  43. package/dist/chunks/menu-item-D9BqJtKZ.js.map +1 -0
  44. package/dist/chunks/photo-capture-BoZF621r.js +403 -0
  45. package/dist/chunks/photo-capture-BoZF621r.js.map +1 -0
  46. package/dist/chunks/photo-capture-modal-BLZtHDj1.js +560 -0
  47. package/dist/chunks/photo-capture-modal-BLZtHDj1.js.map +1 -0
  48. package/dist/chunks/{provider-CoVkCkMs.js → provider-Btl6Lnki.js} +16 -14
  49. package/dist/chunks/provider-Btl6Lnki.js.map +1 -0
  50. package/dist/chunks/{select-OM-SgY4K.js → select-XkieYvDm.js} +53 -110
  51. package/dist/chunks/select-XkieYvDm.js.map +1 -0
  52. package/dist/chunks/{select-option-pVhYlXrt.js → select-option-DUg4AWzw.js} +7 -8
  53. package/dist/chunks/{select-option-pVhYlXrt.js.map → select-option-DUg4AWzw.js.map} +1 -1
  54. package/dist/chunks/{signup-button-wO4uoqUi.js → signup-button-D5wS8_gB.js} +9 -10
  55. package/dist/chunks/{signup-button-wO4uoqUi.js.map → signup-button-D5wS8_gB.js.map} +1 -1
  56. package/dist/chunks/{solid-emblem-D2clBuKZ.js → solid-emblem-XHk-oomv.js} +5 -5
  57. package/dist/chunks/{solid-emblem-D2clBuKZ.js.map → solid-emblem-XHk-oomv.js.map} +1 -1
  58. package/dist/chunks/{src-B9CXYA44.js → src-CJICzMIV.js} +4 -3
  59. package/dist/chunks/{src-B9CXYA44.js.map → src-CJICzMIV.js.map} +1 -1
  60. package/dist/components/account/Account.cjs.js +6 -4
  61. package/dist/components/account/Account.cjs.js.map +1 -1
  62. package/dist/components/account/Account.d.ts +2 -0
  63. package/dist/components/account/Account.d.ts.map +1 -1
  64. package/dist/components/account/Account.esm.js +10 -4
  65. package/dist/components/account/Account.esm.js.map +1 -1
  66. package/dist/components/account/Account.stories.d.ts +10 -12
  67. package/dist/components/account/Account.stories.d.ts.map +1 -1
  68. package/dist/components/account/Account.styles.cjs.js +1 -1
  69. package/dist/components/account/Account.styles.cjs.js.map +1 -1
  70. package/dist/components/account/Account.styles.esm.js +1 -1
  71. package/dist/components/account/Account.styles.esm.js.map +1 -1
  72. package/dist/components/account.js +1 -1
  73. package/dist/components/all.cjs.js +1 -0
  74. package/dist/components/all.d.ts +2 -0
  75. package/dist/components/all.d.ts.map +1 -0
  76. package/dist/components/all.esm.js +25 -0
  77. package/dist/components/avatar/Avatar.cjs.js +1 -1
  78. package/dist/components/avatar/Avatar.cjs.js.map +1 -1
  79. package/dist/components/avatar/Avatar.d.ts +3 -0
  80. package/dist/components/avatar/Avatar.d.ts.map +1 -1
  81. package/dist/components/avatar/Avatar.esm.js +9 -1
  82. package/dist/components/avatar/Avatar.esm.js.map +1 -1
  83. package/dist/components/avatar/Avatar.stories.d.ts +4 -22
  84. package/dist/components/avatar/Avatar.stories.d.ts.map +1 -1
  85. package/dist/components/avatar.js +1 -1
  86. package/dist/components/button/Button.stories.d.ts +15 -154
  87. package/dist/components/button/Button.stories.d.ts.map +1 -1
  88. package/dist/components/button/Button.styles.cjs.js +1 -1
  89. package/dist/components/button/Button.styles.cjs.js.map +1 -1
  90. package/dist/components/button/Button.styles.esm.js +1 -1
  91. package/dist/components/button/Button.styles.esm.js.map +1 -1
  92. package/dist/components/button.js +1 -1
  93. package/dist/components/combobox/Combobox.cjs.js +12 -12
  94. package/dist/components/combobox/Combobox.cjs.js.map +1 -1
  95. package/dist/components/combobox/Combobox.d.ts +4 -11
  96. package/dist/components/combobox/Combobox.d.ts.map +1 -1
  97. package/dist/components/combobox/Combobox.esm.js +102 -173
  98. package/dist/components/combobox/Combobox.esm.js.map +1 -1
  99. package/dist/components/combobox/Combobox.stories.d.ts +9 -46
  100. package/dist/components/combobox/Combobox.stories.d.ts.map +1 -1
  101. package/dist/components/combobox/Combobox.styles.cjs.js +1 -1
  102. package/dist/components/combobox/Combobox.styles.cjs.js.map +1 -1
  103. package/dist/components/combobox/Combobox.styles.esm.js +1 -1
  104. package/dist/components/combobox/Combobox.styles.esm.js.map +1 -1
  105. package/dist/components/combobox-option.js +1 -1
  106. package/dist/components/combobox.js +1 -1
  107. package/dist/components/dialog/Dialog.cjs.js +3 -3
  108. package/dist/components/dialog/Dialog.cjs.js.map +1 -1
  109. package/dist/components/dialog/Dialog.esm.js +6 -6
  110. package/dist/components/dialog/Dialog.esm.js.map +1 -1
  111. package/dist/components/dialog/Dialog.stories.d.ts +22 -0
  112. package/dist/components/dialog/Dialog.stories.d.ts.map +1 -0
  113. package/dist/components/dialog/docs/sample-modal/SampleModal.d.ts +6 -0
  114. package/dist/components/dialog/docs/sample-modal/SampleModal.d.ts.map +1 -0
  115. package/dist/components/dialog/docs/sample-modal/index.d.ts +4 -0
  116. package/dist/components/dialog/docs/sample-modal/index.d.ts.map +1 -0
  117. package/dist/components/dialog-content.js +1 -1
  118. package/dist/components/dialog-footer.js +1 -1
  119. package/dist/components/dialog-header.js +1 -1
  120. package/dist/components/dialog-provider.js +1 -1
  121. package/dist/components/dialog.js +1 -1
  122. package/dist/components/dialogs-root/DialogsRoot.cjs.js +4 -7
  123. package/dist/components/dialogs-root/DialogsRoot.cjs.js.map +1 -1
  124. package/dist/components/dialogs-root/DialogsRoot.d.ts.map +1 -1
  125. package/dist/components/dialogs-root/DialogsRoot.esm.js +7 -10
  126. package/dist/components/dialogs-root/DialogsRoot.esm.js.map +1 -1
  127. package/dist/components/dialogs-root.js +1 -1
  128. package/dist/components/guard/Guard.cjs.js +4 -2
  129. package/dist/components/guard/Guard.cjs.js.map +1 -1
  130. package/dist/components/guard/Guard.d.ts +7 -0
  131. package/dist/components/guard/Guard.d.ts.map +1 -1
  132. package/dist/components/guard/Guard.esm.js +74 -48
  133. package/dist/components/guard/Guard.esm.js.map +1 -1
  134. package/dist/components/guard/Guard.stories.d.ts +9 -16
  135. package/dist/components/guard/Guard.stories.d.ts.map +1 -1
  136. package/dist/components/guard.js +1 -1
  137. package/dist/components/index.cjs.js +1 -1
  138. package/dist/components/index.d.ts +0 -1
  139. package/dist/components/index.d.ts.map +1 -1
  140. package/dist/components/index.esm.js +1 -24
  141. package/dist/components/input/Input.cjs.js +2 -2
  142. package/dist/components/input/Input.cjs.js.map +1 -1
  143. package/dist/components/input/Input.d.ts +3 -11
  144. package/dist/components/input/Input.d.ts.map +1 -1
  145. package/dist/components/input/Input.esm.js +61 -135
  146. package/dist/components/input/Input.esm.js.map +1 -1
  147. package/dist/components/input/Input.stories.d.ts +13 -22
  148. package/dist/components/input/Input.stories.d.ts.map +1 -1
  149. package/dist/components/input.js +1 -1
  150. package/dist/components/login-button/LoginButton.stories.d.ts +4 -4
  151. package/dist/components/login-button/LoginButton.stories.d.ts.map +1 -1
  152. package/dist/components/login-button.js +1 -1
  153. package/dist/components/login-modal/LoginModal.cjs.js +1 -1
  154. package/dist/components/login-modal/LoginModal.cjs.js.map +1 -1
  155. package/dist/components/login-modal/LoginModal.esm.js +1 -1
  156. package/dist/components/login-modal/LoginModal.esm.js.map +1 -1
  157. package/dist/components/login-modal/LoginModal.stories.d.ts +13 -5
  158. package/dist/components/login-modal/LoginModal.stories.d.ts.map +1 -1
  159. package/dist/components/login-modal.js +1 -1
  160. package/dist/components/logout-button/LogoutButton.stories.d.ts +4 -4
  161. package/dist/components/logout-button/LogoutButton.stories.d.ts.map +1 -1
  162. package/dist/components/logout-button.js +1 -1
  163. package/dist/components/menu/Menu.cjs.js +1 -1
  164. package/dist/components/menu/Menu.cjs.js.map +1 -1
  165. package/dist/components/menu/Menu.esm.js +1 -1
  166. package/dist/components/menu/Menu.esm.js.map +1 -1
  167. package/dist/components/menu/Menu.stories.d.ts +3 -4
  168. package/dist/components/menu/Menu.stories.d.ts.map +1 -1
  169. package/dist/components/menu/Menu.styles.cjs.js +1 -1
  170. package/dist/components/menu/Menu.styles.cjs.js.map +1 -1
  171. package/dist/components/menu/Menu.styles.esm.js +1 -1
  172. package/dist/components/menu/Menu.styles.esm.js.map +1 -1
  173. package/dist/components/menu-item/MenuItem.cjs.js +4 -4
  174. package/dist/components/menu-item/MenuItem.cjs.js.map +1 -1
  175. package/dist/components/menu-item/MenuItem.d.ts +1 -0
  176. package/dist/components/menu-item/MenuItem.d.ts.map +1 -1
  177. package/dist/components/menu-item/MenuItem.esm.js +72 -55
  178. package/dist/components/menu-item/MenuItem.esm.js.map +1 -1
  179. package/dist/components/menu-item/MenuItem.styles.cjs.js +1 -1
  180. package/dist/components/menu-item/MenuItem.styles.cjs.js.map +1 -1
  181. package/dist/components/menu-item/MenuItem.styles.esm.js +1 -1
  182. package/dist/components/menu-item/MenuItem.styles.esm.js.map +1 -1
  183. package/dist/components/menu-item.js +1 -1
  184. package/dist/components/menu.js +1 -1
  185. package/dist/components/photo-capture/PhotoCapture.cjs.js +6 -0
  186. package/dist/components/photo-capture/PhotoCapture.cjs.js.map +1 -0
  187. package/dist/components/photo-capture/PhotoCapture.d.ts +20 -0
  188. package/dist/components/photo-capture/PhotoCapture.d.ts.map +1 -0
  189. package/dist/components/photo-capture/PhotoCapture.esm.js +404 -0
  190. package/dist/components/photo-capture/PhotoCapture.esm.js.map +1 -0
  191. package/dist/components/photo-capture/PhotoCapture.stories.d.ts +16 -0
  192. package/dist/components/photo-capture/PhotoCapture.stories.d.ts.map +1 -0
  193. package/dist/components/photo-capture/docs/photo-capture-sandbox/PhotoCaptureSandbox.d.ts +9 -0
  194. package/dist/components/photo-capture/docs/photo-capture-sandbox/PhotoCaptureSandbox.d.ts.map +1 -0
  195. package/dist/components/photo-capture/docs/photo-capture-sandbox/index.d.ts +4 -0
  196. package/dist/components/photo-capture/docs/photo-capture-sandbox/index.d.ts.map +1 -0
  197. package/dist/components/photo-capture/index.cjs.js +2 -1
  198. package/dist/components/photo-capture/index.cjs.js.map +1 -0
  199. package/dist/components/photo-capture/index.d.ts +4 -1
  200. package/dist/components/photo-capture/index.d.ts.map +1 -1
  201. package/dist/components/photo-capture/index.esm.js +7 -3
  202. package/dist/components/photo-capture/index.esm.js.map +1 -0
  203. package/dist/components/photo-capture-modal/PhotoCaptureModal.cjs.js +24 -0
  204. package/dist/components/photo-capture-modal/PhotoCaptureModal.cjs.js.map +1 -0
  205. package/dist/components/photo-capture-modal/PhotoCaptureModal.d.ts +42 -0
  206. package/dist/components/photo-capture-modal/PhotoCaptureModal.d.ts.map +1 -0
  207. package/dist/components/photo-capture-modal/PhotoCaptureModal.esm.js +561 -0
  208. package/dist/components/photo-capture-modal/PhotoCaptureModal.esm.js.map +1 -0
  209. package/dist/components/photo-capture-modal/PhotoCaptureModal.styles.cjs.js +2 -0
  210. package/dist/components/photo-capture-modal/PhotoCaptureModal.styles.cjs.js.map +1 -0
  211. package/dist/components/photo-capture-modal/PhotoCaptureModal.styles.esm.js +7 -0
  212. package/dist/components/photo-capture-modal/PhotoCaptureModal.styles.esm.js.map +1 -0
  213. package/dist/components/photo-capture-modal/index.cjs.js +2 -0
  214. package/dist/components/photo-capture-modal/index.cjs.js.map +1 -0
  215. package/dist/components/photo-capture-modal/index.d.ts +4 -0
  216. package/dist/components/photo-capture-modal/index.d.ts.map +1 -0
  217. package/dist/components/photo-capture-modal/index.esm.js +7 -0
  218. package/dist/components/photo-capture-modal/index.esm.js.map +1 -0
  219. package/dist/components/photo-capture-modal.js +2 -0
  220. package/dist/components/photo-capture.js +2 -2
  221. package/dist/components/provider/Provider.cjs.js +1 -1
  222. package/dist/components/provider/Provider.cjs.js.map +1 -1
  223. package/dist/components/provider/Provider.d.ts +1 -0
  224. package/dist/components/provider/Provider.d.ts.map +1 -1
  225. package/dist/components/provider/Provider.esm.js +3 -0
  226. package/dist/components/provider/Provider.esm.js.map +1 -1
  227. package/dist/components/provider.js +1 -1
  228. package/dist/components/select/Select.cjs.js +3 -3
  229. package/dist/components/select/Select.cjs.js.map +1 -1
  230. package/dist/components/select/Select.d.ts +3 -10
  231. package/dist/components/select/Select.d.ts.map +1 -1
  232. package/dist/components/select/Select.esm.js +52 -109
  233. package/dist/components/select/Select.esm.js.map +1 -1
  234. package/dist/components/select/Select.stories.d.ts +9 -13
  235. package/dist/components/select/Select.stories.d.ts.map +1 -1
  236. package/dist/components/select-option.js +1 -1
  237. package/dist/components/select.js +1 -1
  238. package/dist/components/signup-button/SignupButton.stories.d.ts +4 -4
  239. package/dist/components/signup-button/SignupButton.stories.d.ts.map +1 -1
  240. package/dist/components/signup-button.js +1 -1
  241. package/dist/components/solid-emblem.js +1 -1
  242. package/dist/components.js +24 -23
  243. package/dist/index.cjs.js +1 -1
  244. package/dist/index.cjs.js.map +1 -1
  245. package/dist/index.esm.js +12 -10
  246. package/dist/index.esm.js.map +1 -1
  247. package/dist/index.js +6 -8
  248. package/dist/lib/auth/NoopAuth.cjs.js +1 -1
  249. package/dist/lib/auth/NoopAuth.cjs.js.map +1 -1
  250. package/dist/lib/auth/NoopAuth.d.ts +2 -2
  251. package/dist/lib/auth/NoopAuth.d.ts.map +1 -1
  252. package/dist/lib/auth/NoopAuth.esm.js +2 -3
  253. package/dist/lib/auth/NoopAuth.esm.js.map +1 -1
  254. package/dist/lib/auth/SolidAuth.cjs.js +1 -1
  255. package/dist/lib/auth/SolidAuth.cjs.js.map +1 -1
  256. package/dist/lib/auth/SolidAuth.d.ts +6 -0
  257. package/dist/lib/auth/SolidAuth.d.ts.map +1 -1
  258. package/dist/lib/auth/SolidAuth.esm.js +31 -20
  259. package/dist/lib/auth/SolidAuth.esm.js.map +1 -1
  260. package/dist/lib/auth/context.cjs.js.map +1 -1
  261. package/dist/lib/auth/context.d.ts +2 -0
  262. package/dist/lib/auth/context.d.ts.map +1 -1
  263. package/dist/lib/auth/context.esm.js.map +1 -1
  264. package/dist/lib/components/decorators.cjs.js.map +1 -1
  265. package/dist/lib/components/decorators.esm.js.map +1 -1
  266. package/dist/lib/components/dialog-component/DialogComponent.cjs.js +2 -0
  267. package/dist/lib/components/dialog-component/DialogComponent.cjs.js.map +1 -0
  268. package/dist/lib/components/dialog-component/DialogComponent.d.ts +10 -0
  269. package/dist/lib/components/dialog-component/DialogComponent.d.ts.map +1 -0
  270. package/dist/{chunks/guard-DZGvf4tS.js → lib/components/dialog-component/DialogComponent.esm.js} +70 -67
  271. package/dist/lib/components/dialog-component/DialogComponent.esm.js.map +1 -0
  272. package/dist/lib/components/dialog-component/index.cjs.js +1 -0
  273. package/dist/lib/components/dialog-component/index.d.ts +4 -0
  274. package/dist/lib/components/dialog-component/index.d.ts.map +1 -0
  275. package/dist/lib/components/dialog-component/index.esm.js +2 -0
  276. package/dist/lib/components/form-control-component/FormControlComponent.cjs.js +2 -0
  277. package/dist/lib/components/form-control-component/FormControlComponent.cjs.js.map +1 -0
  278. package/dist/lib/components/form-control-component/FormControlComponent.d.ts +15 -0
  279. package/dist/lib/components/form-control-component/FormControlComponent.d.ts.map +1 -0
  280. package/dist/lib/components/form-control-component/FormControlComponent.esm.js +271 -0
  281. package/dist/lib/components/form-control-component/FormControlComponent.esm.js.map +1 -0
  282. package/dist/lib/components/form-control-component/index.cjs.js +1 -0
  283. package/dist/lib/components/form-control-component/index.d.ts +4 -0
  284. package/dist/lib/components/form-control-component/index.d.ts.map +1 -0
  285. package/dist/lib/components/form-control-component/index.esm.js +2 -0
  286. package/dist/lib/components/ids.cjs.js.map +1 -1
  287. package/dist/lib/components/ids.esm.js.map +1 -1
  288. package/dist/lib/components/index.cjs.js +1 -1
  289. package/dist/lib/components/index.d.ts +3 -1
  290. package/dist/lib/components/index.d.ts.map +1 -1
  291. package/dist/lib/components/index.esm.js +8 -4
  292. package/dist/lib/components/traits/DialogTrait.cjs.js +1 -1
  293. package/dist/lib/components/traits/DialogTrait.cjs.js.map +1 -1
  294. package/dist/lib/components/traits/DialogTrait.d.ts +2 -1
  295. package/dist/lib/components/traits/DialogTrait.d.ts.map +1 -1
  296. package/dist/lib/components/traits/DialogTrait.esm.js +26 -6
  297. package/dist/lib/components/traits/DialogTrait.esm.js.map +1 -1
  298. package/dist/lib/components/traits/FormControlTrait.cjs.js +1 -1
  299. package/dist/lib/components/traits/FormControlTrait.cjs.js.map +1 -1
  300. package/dist/lib/components/traits/FormControlTrait.d.ts +4 -2
  301. package/dist/lib/components/traits/FormControlTrait.d.ts.map +1 -1
  302. package/dist/lib/components/traits/FormControlTrait.esm.js +28 -10
  303. package/dist/lib/components/traits/FormControlTrait.esm.js.map +1 -1
  304. package/dist/lib/components/web-component/WebComponent.cjs.js +1 -1
  305. package/dist/lib/components/web-component/WebComponent.cjs.js.map +1 -1
  306. package/dist/lib/components/web-component/WebComponent.d.ts +12 -1
  307. package/dist/lib/components/web-component/WebComponent.d.ts.map +1 -1
  308. package/dist/lib/components/web-component/WebComponent.esm.js +28 -6
  309. package/dist/lib/components/web-component/WebComponent.esm.js.map +1 -1
  310. package/dist/lib/components/web-component/WebComponent.styles.cjs.js +1 -1
  311. package/dist/lib/components/web-component/WebComponent.styles.esm.js +1 -1
  312. package/dist/lib/dialogs/Dialog.cjs.js +1 -1
  313. package/dist/lib/dialogs/Dialog.cjs.js.map +1 -1
  314. package/dist/lib/dialogs/Dialog.d.ts +4 -8
  315. package/dist/lib/dialogs/Dialog.d.ts.map +1 -1
  316. package/dist/lib/dialogs/Dialog.esm.js +1 -8
  317. package/dist/lib/dialogs/Dialog.esm.js.map +1 -1
  318. package/dist/lib/dialogs/helpers.cjs.js +1 -1
  319. package/dist/lib/dialogs/helpers.cjs.js.map +1 -1
  320. package/dist/lib/dialogs/helpers.d.ts +7 -2
  321. package/dist/lib/dialogs/helpers.d.ts.map +1 -1
  322. package/dist/lib/dialogs/helpers.esm.js +5 -3
  323. package/dist/lib/dialogs/helpers.esm.js.map +1 -1
  324. package/dist/loader.js +6 -8
  325. package/dist/solid-ui.js +137 -389
  326. package/dist/solid-ui.min.js +137 -389
  327. package/dist/solid-ui.min.js.map +1 -1
  328. package/dist/storybook/auth/StorybookAuth.d.ts +1 -0
  329. package/dist/storybook/auth/StorybookAuth.d.ts.map +1 -1
  330. package/dist/storybook/components/StorybookProvider.d.ts +1 -0
  331. package/dist/storybook/components/StorybookProvider.d.ts.map +1 -1
  332. package/dist/storybook/helpers.d.ts +2 -6
  333. package/dist/storybook/helpers.d.ts.map +1 -1
  334. package/dist/storybook/stubs.d.ts +7 -3
  335. package/dist/storybook/stubs.d.ts.map +1 -1
  336. package/dist/theme.css +1 -1
  337. package/package.json +1 -2
  338. package/dist/chunks/account-CdqIoTsl.js.map +0 -1
  339. package/dist/chunks/auth-D8B5yczR.js.map +0 -1
  340. package/dist/chunks/avatar-DNGFKkhm.js.map +0 -1
  341. package/dist/chunks/close-dialog-DfAh83bX.js +0 -14
  342. package/dist/chunks/close-dialog-DfAh83bX.js.map +0 -1
  343. package/dist/chunks/combobox-Dav1bNHS.js.map +0 -1
  344. package/dist/chunks/components-PQfnwrHI.js +0 -107
  345. package/dist/chunks/components-PQfnwrHI.js.map +0 -1
  346. package/dist/chunks/context-B_xwK-Y_.js +0 -22
  347. package/dist/chunks/context-B_xwK-Y_.js.map +0 -1
  348. package/dist/chunks/decorators-BqWyWiL9.js +0 -50
  349. package/dist/chunks/decorators-BqWyWiL9.js.map +0 -1
  350. package/dist/chunks/dialog-Ujvm11_B.js.map +0 -1
  351. package/dist/chunks/dialogs-root-dPGfuzSZ.js.map +0 -1
  352. package/dist/chunks/guard-DZGvf4tS.js.map +0 -1
  353. package/dist/chunks/input-BjCX2bFe.js.map +0 -1
  354. package/dist/chunks/menu-item-BHJ4xljI.js.map +0 -1
  355. package/dist/chunks/photo-capture-DzK6wZF4.js +0 -624
  356. package/dist/chunks/photo-capture-DzK6wZF4.js.map +0 -1
  357. package/dist/chunks/provider-CoVkCkMs.js.map +0 -1
  358. package/dist/chunks/select-OM-SgY4K.js.map +0 -1
  359. package/dist/v2/components/media/photoCapture/PhotoCapture.cjs.js +0 -281
  360. package/dist/v2/components/media/photoCapture/PhotoCapture.cjs.js.map +0 -1
  361. package/dist/v2/components/media/photoCapture/PhotoCapture.d.ts +0 -200
  362. package/dist/v2/components/media/photoCapture/PhotoCapture.d.ts.map +0 -1
  363. package/dist/v2/components/media/photoCapture/PhotoCapture.esm.js +0 -623
  364. package/dist/v2/components/media/photoCapture/PhotoCapture.esm.js.map +0 -1
  365. package/dist/v2/components/media/photoCapture/PhotoCapture.test.d.ts +0 -1
  366. package/dist/v2/components/media/photoCapture/PhotoCapture.test.d.ts.map +0 -1
  367. package/dist/v2/components/media/photoCapture/index.cjs.js +0 -2
  368. package/dist/v2/components/media/photoCapture/index.cjs.js.map +0 -1
  369. package/dist/v2/components/media/photoCapture/index.d.ts +0 -3
  370. package/dist/v2/components/media/photoCapture/index.d.ts.map +0 -1
  371. package/dist/v2/components/media/photoCapture/index.esm.js +0 -8
  372. package/dist/v2/components/media/photoCapture/index.esm.js.map +0 -1
@@ -1,623 +0,0 @@
1
- import { LitElement as e, css as t, html as n, nothing as r } from "lit";
2
- //#region src/v2/components/media/photoCapture/PhotoCapture.ts
3
- var i = "image/png", a = class extends e {
4
- static formAssociated = !0;
5
- static properties = {
6
- label: {
7
- type: String,
8
- reflect: !0
9
- },
10
- heading: {
11
- type: String,
12
- reflect: !0
13
- },
14
- captureLabel: {
15
- type: String,
16
- attribute: "capture-label",
17
- reflect: !0
18
- },
19
- confirmLabel: {
20
- type: String,
21
- attribute: "confirm-label",
22
- reflect: !0
23
- },
24
- retakeLabel: {
25
- type: String,
26
- attribute: "retake-label",
27
- reflect: !0
28
- },
29
- cancelLabel: {
30
- type: String,
31
- attribute: "cancel-label",
32
- reflect: !0
33
- },
34
- presentation: {
35
- type: String,
36
- reflect: !0
37
- },
38
- theme: {
39
- type: String,
40
- reflect: !0
41
- },
42
- facingMode: {
43
- type: String,
44
- attribute: "facing-mode",
45
- reflect: !0
46
- },
47
- constraints: {
48
- type: String,
49
- reflect: !0
50
- },
51
- captureFormat: {
52
- type: String,
53
- attribute: "capture-format",
54
- reflect: !0
55
- },
56
- captureQuality: {
57
- type: Number,
58
- attribute: "capture-quality"
59
- },
60
- open: {
61
- type: Boolean,
62
- reflect: !0
63
- },
64
- disabled: {
65
- type: Boolean,
66
- reflect: !0
67
- },
68
- name: {
69
- type: String,
70
- reflect: !0
71
- },
72
- required: {
73
- type: Boolean,
74
- reflect: !0
75
- },
76
- showTrigger: {
77
- type: Boolean,
78
- attribute: "show-trigger",
79
- reflect: !0
80
- },
81
- showCancelButton: {
82
- type: Boolean,
83
- attribute: "show-cancel-button",
84
- reflect: !0
85
- },
86
- autoCloseOnCapture: {
87
- type: Boolean,
88
- attribute: "auto-close-on-capture"
89
- },
90
- fileNamePrefix: {
91
- type: String,
92
- attribute: "file-name-prefix",
93
- reflect: !0
94
- },
95
- value: { attribute: !1 },
96
- mediaConstraints: { attribute: !1 },
97
- _errorMessage: { state: !0 },
98
- _previewUrl: { state: !0 },
99
- _startingPreview: { state: !0 }
100
- };
101
- static styles = t`
102
- :host {
103
- display: block;
104
- --photo-capture-trigger-background: var(--lavender-900, #7c4cff);
105
- --photo-capture-trigger-text: var(--color-header-text, #ffffff);
106
- --photo-capture-surface: var(--color-background, #ffffff);
107
- --photo-capture-text: var(--gray-900, #101828);
108
- --photo-capture-muted-text: var(--gray-600, #4a5565);
109
- --photo-capture-border: var(--gray-200, #e5e7eb);
110
- --photo-capture-hover: var(--gray-100, #f3f4f6);
111
- --photo-capture-shadow: var(--box-shadow-sm, 0 1px 4px rgba(0, 0, 0, 0.12));
112
- --photo-capture-overlay: rgba(0, 0, 0, 0.6);
113
- --photo-capture-frame-max-width: 260px;
114
- --photo-capture-radius: 8px;
115
- --photo-capture-button-radius: var(--border-radius-base, 0.3125rem);
116
- --photo-capture-gap: var(--spacing-2xs, 0.625rem);
117
- color: var(--photo-capture-text);
118
- box-sizing: border-box;
119
- }
120
-
121
- :host([theme='dark']) {
122
- --photo-capture-surface: var(--gray-900, #111827);
123
- --photo-capture-text: var(--white, #ffffff);
124
- --photo-capture-muted-text: var(--gray-300, #d1d5dc);
125
- --photo-capture-border: var(--gray-700, #364153);
126
- --photo-capture-hover: rgba(255, 255, 255, 0.08);
127
- --photo-capture-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
128
- }
129
-
130
- *, *::before, *::after {
131
- box-sizing: border-box;
132
- }
133
-
134
- .trigger-button,
135
- .action-button,
136
- .cancel-button,
137
- .close-button {
138
- font: inherit;
139
- cursor: pointer;
140
- }
141
-
142
- .trigger-button {
143
- display: inline-flex;
144
- align-items: center;
145
- justify-content: center;
146
- min-height: 35px;
147
- padding: 0.5rem 0.9rem;
148
- border: none;
149
- border-radius: var(--photo-capture-button-radius);
150
- background: var(--photo-capture-trigger-background);
151
- color: var(--photo-capture-trigger-text);
152
- transition: transform 0.2s ease;
153
- }
154
-
155
- .trigger-button:active {
156
- transform: translateY(1px);
157
- }
158
-
159
- .trigger-button:disabled,
160
- .action-button:disabled,
161
- .cancel-button:disabled {
162
- opacity: 0.55;
163
- cursor: not-allowed;
164
- }
165
-
166
- .inline-root[hidden] {
167
- display: none;
168
- }
169
-
170
- .dialog {
171
- border: none;
172
- padding: 0;
173
- background: transparent;
174
- outline: none;
175
- overflow: visible;
176
- max-width: none;
177
- max-height: none;
178
- }
179
-
180
- .dialog::backdrop {
181
- background: var(--photo-capture-overlay);
182
- }
183
-
184
- .panel {
185
- position: relative;
186
- display: flex;
187
- flex-direction: column;
188
- align-items: center;
189
- gap: var(--photo-capture-gap);
190
- width: min(100%, 340px);
191
- padding: 1rem;
192
- border: 1px solid var(--photo-capture-border);
193
- border-radius: var(--photo-capture-radius);
194
- background: var(--photo-capture-surface);
195
- color: var(--photo-capture-text);
196
- box-shadow: var(--photo-capture-shadow);
197
- }
198
-
199
- .panel-header {
200
- display: flex;
201
- align-items: center;
202
- justify-content: space-between;
203
- gap: 0.5rem;
204
- width: 100%;
205
- }
206
-
207
- .panel-heading {
208
- margin: 0;
209
- font-size: 1rem;
210
- font-weight: 700;
211
- line-height: 1.4;
212
- }
213
-
214
- .close-button {
215
- display: inline-flex;
216
- align-items: center;
217
- justify-content: center;
218
- width: 1.75rem;
219
- height: 1.75rem;
220
- padding: 0;
221
- border: none;
222
- border-radius: 999px;
223
- background: transparent;
224
- color: var(--photo-capture-muted-text);
225
- font-size: 1.125rem;
226
- line-height: 1;
227
- }
228
-
229
- .close-button:hover,
230
- .close-button:focus-visible,
231
- .action-button:hover,
232
- .action-button:focus-visible,
233
- .cancel-button:hover,
234
- .cancel-button:focus-visible {
235
- background: var(--photo-capture-hover);
236
- }
237
-
238
- .viewport {
239
- display: flex;
240
- align-items: center;
241
- justify-content: center;
242
- width: 100%;
243
- min-height: 200px;
244
- border-radius: 0.5rem;
245
- overflow: hidden;
246
- background: color-mix(in srgb, var(--photo-capture-surface) 92%, #000 8%);
247
- }
248
-
249
- .viewport video,
250
- .viewport img {
251
- display: block;
252
- width: 100%;
253
- max-width: var(--photo-capture-frame-max-width);
254
- height: auto;
255
- border-radius: 0.5rem;
256
- margin: 0 auto;
257
- object-fit: cover;
258
- }
259
-
260
- .status {
261
- width: 100%;
262
- text-align: center;
263
- color: var(--photo-capture-muted-text);
264
- font-size: 0.875rem;
265
- }
266
-
267
- .status.error {
268
- color: var(--color-error, #b00020);
269
- }
270
-
271
- .actions {
272
- display: flex;
273
- align-items: center;
274
- justify-content: center;
275
- flex-wrap: wrap;
276
- gap: var(--photo-capture-gap);
277
- width: 100%;
278
- }
279
-
280
- .action-button,
281
- .cancel-button {
282
- display: inline-flex;
283
- align-items: center;
284
- justify-content: center;
285
- min-height: 2.25rem;
286
- padding: 0.45rem 0.85rem;
287
- border-radius: var(--photo-capture-button-radius);
288
- border: 1px solid var(--photo-capture-border);
289
- background: var(--photo-capture-surface);
290
- color: var(--photo-capture-text);
291
- font-size: var(--font-size-xxs, 0.75rem);
292
- font-weight: var(--font-weight-xbold, 700);
293
- line-height: 1.5;
294
- }
295
-
296
- .action-button--primary {
297
- background: var(--photo-capture-trigger-background);
298
- color: var(--photo-capture-trigger-text);
299
- border-color: transparent;
300
- }
301
- `;
302
- _value = null;
303
- _stream = null;
304
- _internals;
305
- _associatedForm = null;
306
- _handleFormData = (e) => {
307
- let t = e.formData;
308
- !t || !this.name || !this.value || this.disabled || t.append(this.name, this.value, this.value.name);
309
- };
310
- _handleFormReset = () => {
311
- this._clearValue({ emitEvents: !1 }), this.open && this._queuePreviewStart();
312
- };
313
- get _supportsFormInternals() {
314
- return !!this._internals && typeof this._internals.setFormValue == "function";
315
- }
316
- constructor() {
317
- super(), this.label = "Take Photo", this.heading = "Take a photo", this.captureLabel = "Take Photo", this.confirmLabel = "Use Photo", this.retakeLabel = "Retake", this.cancelLabel = "Cancel", this.presentation = "inline", this.theme = "light", this.facingMode = "user", this.constraints = "", this.captureFormat = i, this.captureQuality = void 0, this.open = !1, this.disabled = !1, this.name = "", this.required = !1, this.showTrigger = !1, this.showCancelButton = !0, this.autoCloseOnCapture = !1, this.fileNamePrefix = "", this.mediaConstraints = void 0, this._errorMessage = "", this._previewUrl = "", this._startingPreview = !1, this._internals = typeof this.attachInternals == "function" ? this.attachInternals() : null;
318
- }
319
- get value() {
320
- return this._value;
321
- }
322
- set value(e) {
323
- let t = e instanceof File ? e : null, n = this._value;
324
- n !== t && (this._value = t, this._syncPreviewFromValue(t), this._syncFormValue(), this._syncValidity(), this.requestUpdate("value", n));
325
- }
326
- get form() {
327
- return (this._supportsFormInternals ? this._internals?.form : null) ?? this._associatedForm;
328
- }
329
- get validationMessage() {
330
- return (typeof this._internals?.validationMessage == "string" ? this._internals.validationMessage : "") || (this.required && !this.value ? "Please capture a photo." : "");
331
- }
332
- get willValidate() {
333
- return typeof this._internals?.willValidate == "boolean" ? this._internals.willValidate : !this.disabled;
334
- }
335
- checkValidity() {
336
- return this._internals && typeof this._internals.checkValidity == "function" ? this._internals.checkValidity() : !(this.required && !this.value);
337
- }
338
- reportValidity() {
339
- return this._internals && typeof this._internals.reportValidity == "function" ? this._internals.reportValidity() : this.checkValidity();
340
- }
341
- connectedCallback() {
342
- super.connectedCallback(), this._syncAssociatedForm(), this._syncFormValue(), this._syncValidity();
343
- }
344
- disconnectedCallback() {
345
- this._syncAssociatedForm(null), this._stopStream(), this._revokePreviewUrl(), super.disconnectedCallback();
346
- }
347
- formResetCallback() {
348
- this._handleFormReset();
349
- }
350
- formDisabledCallback(e) {
351
- this.disabled = e;
352
- }
353
- updated(e) {
354
- if (this._syncAssociatedForm(), this.presentation === "dialog") {
355
- let e = this.shadowRoot?.querySelector("dialog");
356
- e && (this.open && !e.open ? e.showModal() : !this.open && e.open && e.close());
357
- }
358
- if (e.has("open") && !this.open && this._stopStream(), this.open && !this.value && !this._stream && !this._startingPreview && (e.has("open") || e.has("presentation") || e.has("_previewUrl") || e.has("value")) && this._queuePreviewStart(), (e.has("name") || e.has("disabled") || e.has("value")) && this._syncFormValue(), (e.has("required") || e.has("disabled") || e.has("value")) && this._syncValidity(), this._stream) {
359
- let e = this.shadowRoot?.querySelector("video.capture-preview");
360
- e && e.srcObject !== this._stream && (e.srcObject = this._stream);
361
- }
362
- }
363
- _setOpen(e) {
364
- this.open !== e && (this.open = e, this.dispatchEvent(new CustomEvent("open-change", {
365
- detail: { open: e },
366
- bubbles: !0,
367
- composed: !0
368
- })));
369
- }
370
- _emitError(e, t = "Unable to access the camera") {
371
- this._errorMessage = t, this.dispatchEvent(new CustomEvent("error", {
372
- detail: {
373
- error: e,
374
- message: t
375
- },
376
- bubbles: !0,
377
- composed: !0
378
- }));
379
- }
380
- _syncAssociatedForm(e = this.closest("form")) {
381
- this._associatedForm !== e && (this._associatedForm && (this._associatedForm.removeEventListener("formdata", this._handleFormData), this._associatedForm.removeEventListener("reset", this._handleFormReset)), this._associatedForm = e, this._associatedForm && !this._supportsFormInternals && (this._associatedForm.addEventListener("formdata", this._handleFormData), this._associatedForm.addEventListener("reset", this._handleFormReset)));
382
- }
383
- _syncFormValue() {
384
- if (!this._supportsFormInternals) return;
385
- let e = this._internals;
386
- if (e) {
387
- if (this.disabled || !this.name || !this.value) {
388
- e.setFormValue(null);
389
- return;
390
- }
391
- e.setFormValue(this.value);
392
- }
393
- }
394
- _syncValidity() {
395
- if (!(!this._internals || !this._supportsFormInternals || typeof this._internals.setValidity != "function")) {
396
- if (this.disabled || !this.required || this.value) {
397
- this._internals.setValidity({});
398
- return;
399
- }
400
- this._internals.setValidity({ valueMissing: !0 }, "Please capture a photo.");
401
- }
402
- }
403
- _syncPreviewFromValue(e) {
404
- this._revokePreviewUrl(), e && (this._stopStream(), this._previewUrl = URL.createObjectURL(e));
405
- }
406
- _clearValue(e) {
407
- this.value = null, this._errorMessage = "", e.emitEvents && this._dispatchValueEvents();
408
- }
409
- _dispatchValueEvents() {
410
- let e = { value: this.value };
411
- this.dispatchEvent(new CustomEvent("input", {
412
- detail: e,
413
- bubbles: !0,
414
- composed: !0
415
- })), this.dispatchEvent(new CustomEvent("change", {
416
- detail: e,
417
- bubbles: !0,
418
- composed: !0
419
- }));
420
- }
421
- _fileExtensionForMimeType(e) {
422
- switch (e) {
423
- case "image/jpeg": return "jpg";
424
- case "image/webp": return "webp";
425
- case "image/gif": return "gif";
426
- default: return "png";
427
- }
428
- }
429
- _createFileFromBlob(e) {
430
- let t = e.type || this.captureFormat || i, n = this._fileExtensionForMimeType(t), r = (this.fileNamePrefix || this.name || "photo").trim() || "photo";
431
- return new File([e], `${r}-${Date.now()}.${n}`, { type: t });
432
- }
433
- _queuePreviewStart() {
434
- this._startPreview().catch(() => void 0);
435
- }
436
- _resolveMediaConstraints() {
437
- if (this.mediaConstraints) return this.mediaConstraints;
438
- if (this.constraints) try {
439
- return JSON.parse(this.constraints);
440
- } catch (e) {
441
- throw Error(`Invalid constraints JSON: ${e.message}`);
442
- }
443
- return { video: !this.facingMode || { facingMode: { ideal: this.facingMode } } };
444
- }
445
- async _startPreview() {
446
- if (!(!this.open || this.value || this._startingPreview)) {
447
- if (!navigator.mediaDevices?.getUserMedia) {
448
- this._emitError(/* @__PURE__ */ Error("navigator.mediaDevices.getUserMedia not available"), "Camera access is not available in this browser");
449
- return;
450
- }
451
- this._startingPreview = !0, this._errorMessage = "";
452
- try {
453
- let e = await navigator.mediaDevices.getUserMedia(this._resolveMediaConstraints());
454
- if (!this.open) {
455
- e.getTracks().forEach((e) => e.stop());
456
- return;
457
- }
458
- this._stream = e, this.requestUpdate(), await this.updateComplete;
459
- let t = this.shadowRoot?.querySelector("video.capture-preview");
460
- t && (t.srcObject = e, await t.play?.().catch(() => void 0));
461
- } catch (e) {
462
- this._emitError(e, e?.message || "Unable to start the camera preview");
463
- } finally {
464
- this._startingPreview = !1;
465
- }
466
- }
467
- }
468
- _stopStream() {
469
- if (!this._stream) return;
470
- this._stream.getTracks().forEach((e) => e.stop()), this._stream = null;
471
- let e = this.shadowRoot?.querySelector("video.capture-preview");
472
- e && (e.srcObject = null);
473
- }
474
- _revokePreviewUrl() {
475
- this._previewUrl && URL.revokeObjectURL(this._previewUrl), this._previewUrl = "";
476
- }
477
- async _captureSnapshot() {
478
- let e = this.shadowRoot?.querySelector("video.capture-preview");
479
- if (!e) return;
480
- let t = e.videoWidth || e.clientWidth || 640, n = e.videoHeight || e.clientHeight || 480, r = document.createElement("canvas");
481
- r.width = t, r.height = n;
482
- let a = r.getContext("2d");
483
- if (!a) {
484
- this._emitError(/* @__PURE__ */ Error("Canvas 2D context unavailable"), "Unable to capture a photo in this browser");
485
- return;
486
- }
487
- a.drawImage(e, 0, 0, t, n);
488
- let o = await new Promise((e) => {
489
- r.toBlob(e, this.captureFormat || i, this.captureQuality);
490
- });
491
- if (!o) {
492
- this._emitError(/* @__PURE__ */ Error("Camera snapshot failed"), "Unable to create an image from the current camera frame");
493
- return;
494
- }
495
- this.value = this._createFileFromBlob(o), this._errorMessage = "";
496
- }
497
- async _retakePhoto() {
498
- this._clearValue({ emitEvents: !0 }), await this._startPreview();
499
- }
500
- _confirmPhoto() {
501
- !this.value || !this._previewUrl || (this._dispatchValueEvents(), this.dispatchEvent(new CustomEvent("photo-captured", {
502
- detail: {
503
- file: this.value,
504
- blob: this.value,
505
- objectUrl: this._previewUrl,
506
- contentType: this.value.type || this.captureFormat || i
507
- },
508
- bubbles: !0,
509
- composed: !0
510
- })), this.autoCloseOnCapture && this._setOpen(!1));
511
- }
512
- _handleCancel() {
513
- this._stopStream(), this._clearValue({ emitEvents: !1 }), this._setOpen(!1), this.dispatchEvent(new CustomEvent("cancel", {
514
- bubbles: !0,
515
- composed: !0
516
- }));
517
- }
518
- _openCapture() {
519
- this.disabled || this._setOpen(!0);
520
- }
521
- _renderViewport() {
522
- return this._previewUrl ? n`<img class="capture-preview" part="preview-image" src="${this._previewUrl}" alt="Captured photo preview" />` : n`<video class="capture-preview" part="preview-video" autoplay playsinline muted></video>`;
523
- }
524
- _renderStatus() {
525
- return this._errorMessage ? n`<div class="status error" part="error-message">${this._errorMessage}</div>` : this._startingPreview ? n`<div class="status" part="status-message">Opening camera…</div>` : this.value ? n`<div class="status" part="status-message">Review the photo before confirming it.</div>` : n`<div class="status" part="status-message">Preview the camera and take a photo when ready.</div>`;
526
- }
527
- _renderActions() {
528
- return n`
529
- <div class="actions" part="actions">
530
- ${this.showCancelButton ? n`
531
- <button
532
- class="cancel-button"
533
- part="cancel-button"
534
- type="button"
535
- @click="${this._handleCancel}"
536
- >${this.cancelLabel}</button>
537
- ` : r}
538
-
539
- ${this.value ? n`
540
- <button
541
- class="action-button"
542
- part="retake-button"
543
- type="button"
544
- @click="${this._retakePhoto}"
545
- >${this.retakeLabel}</button>
546
- <button
547
- class="action-button action-button--primary"
548
- part="confirm-button"
549
- type="button"
550
- @click="${this._confirmPhoto}"
551
- >${this.confirmLabel}</button>
552
- ` : n`
553
- <button
554
- class="action-button action-button--primary"
555
- part="capture-button"
556
- type="button"
557
- ?disabled="${this._startingPreview || !this._stream}"
558
- @click="${this._captureSnapshot}"
559
- >${this.captureLabel}</button>
560
- `}
561
- </div>
562
- `;
563
- }
564
- _renderPanel() {
565
- return n`
566
- <div class="panel" part="panel">
567
- <div class="panel-header" part="header">
568
- <h2 class="panel-heading" part="heading"><slot name="heading">${this.heading}</slot></h2>
569
- ${this.showCancelButton ? n`
570
- <button
571
- class="close-button"
572
- part="close-button"
573
- type="button"
574
- aria-label="${this.cancelLabel}"
575
- @click="${this._handleCancel}"
576
- >&times;</button>
577
- ` : r}
578
- </div>
579
- <div class="viewport" part="viewport">${this._renderViewport()}</div>
580
- ${this._renderStatus()}
581
- ${this._renderActions()}
582
- </div>
583
- `;
584
- }
585
- render() {
586
- return n`
587
- ${this.showTrigger || this.presentation === "dialog" ? n`
588
- <button
589
- class="trigger-button"
590
- part="trigger-button"
591
- type="button"
592
- ?disabled="${this.disabled}"
593
- @click="${this._openCapture}"
594
- ><slot>${this.label}</slot></button>
595
- ` : r}
596
-
597
- ${this.presentation === "dialog" ? n`
598
- <dialog
599
- class="dialog"
600
- part="dialog"
601
- aria-modal="true"
602
- aria-label="${this.heading}"
603
- @cancel="${(e) => {
604
- e.preventDefault(), this._handleCancel();
605
- }}"
606
- @click="${(e) => {
607
- e.target === e.currentTarget && this._handleCancel();
608
- }}"
609
- >
610
- ${this.open ? this._renderPanel() : r}
611
- </dialog>
612
- ` : n`
613
- <div class="inline-root" part="inline-root" ?hidden="${!this.open}">
614
- ${this.open ? this._renderPanel() : r}
615
- </div>
616
- `}
617
- `;
618
- }
619
- };
620
- //#endregion
621
- export { a as PhotoCapture };
622
-
623
- //# sourceMappingURL=PhotoCapture.esm.js.map