@42-central/ui-react 0.19.1 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/biome/no-gray-scale-class.grit +27 -0
- package/dist/{chunk-HCYULRWT.js → chunk-2KN3MI7I.js} +38 -34
- package/dist/chunk-2KN3MI7I.js.map +1 -0
- package/dist/chunk-2LI3VPDP.js +39 -0
- package/dist/chunk-2LI3VPDP.js.map +1 -0
- package/dist/{chunk-2NNZHVKD.js → chunk-2OQP7UY4.js} +22 -18
- package/dist/chunk-2OQP7UY4.js.map +1 -0
- package/dist/{chunk-RKYXG6X7.js → chunk-2TM7UVM2.js} +16 -13
- package/dist/chunk-2TM7UVM2.js.map +1 -0
- package/dist/chunk-3REFDGOM.js +89 -0
- package/dist/chunk-3REFDGOM.js.map +1 -0
- package/dist/{chunk-TBTSEPGP.js → chunk-45DFYIK5.js} +9 -7
- package/dist/chunk-45DFYIK5.js.map +1 -0
- package/dist/{chunk-CYWMES5P.js → chunk-4BGU2UQB.js} +23 -11
- package/dist/chunk-4BGU2UQB.js.map +1 -0
- package/dist/chunk-4EU6FGGB.js +104 -0
- package/dist/chunk-4EU6FGGB.js.map +1 -0
- package/dist/{chunk-P3XMBETI.js → chunk-4G3N7UMJ.js} +4 -7
- package/dist/chunk-4G3N7UMJ.js.map +1 -0
- package/dist/chunk-4TCTMRR5.js +293 -0
- package/dist/chunk-4TCTMRR5.js.map +1 -0
- package/dist/chunk-5337N3FE.js +176 -0
- package/dist/chunk-5337N3FE.js.map +1 -0
- package/dist/{chunk-GCGX4FEF.js → chunk-6KER77RS.js} +27 -41
- package/dist/chunk-6KER77RS.js.map +1 -0
- package/dist/chunk-6N6J2DOE.js +27 -0
- package/dist/chunk-6N6J2DOE.js.map +1 -0
- package/dist/{chunk-A6MYJTJI.js → chunk-6OV6EJQ2.js} +6 -7
- package/dist/chunk-6OV6EJQ2.js.map +1 -0
- package/dist/chunk-7AWOMWCQ.js +345 -0
- package/dist/chunk-7AWOMWCQ.js.map +1 -0
- package/dist/{chunk-Z6RPMRFH.js → chunk-7R4CDHBK.js} +9 -8
- package/dist/chunk-7R4CDHBK.js.map +1 -0
- package/dist/chunk-7TDHT3QD.js +62 -0
- package/dist/chunk-7TDHT3QD.js.map +1 -0
- package/dist/chunk-AHM6SGEU.js +15 -0
- package/dist/chunk-AHM6SGEU.js.map +1 -0
- package/dist/chunk-AZ2VUAGX.js +3 -0
- package/dist/chunk-AZ2VUAGX.js.map +1 -0
- package/dist/chunk-BUFALAEK.js +337 -0
- package/dist/chunk-BUFALAEK.js.map +1 -0
- package/dist/chunk-CDHIF2NV.js +340 -0
- package/dist/chunk-CDHIF2NV.js.map +1 -0
- package/dist/chunk-CQ4M4BSF.js +12 -0
- package/dist/chunk-CQ4M4BSF.js.map +1 -0
- package/dist/chunk-DHM4IG2O.js +13 -0
- package/dist/chunk-DHM4IG2O.js.map +1 -0
- package/dist/chunk-DHTSVJ4G.js +948 -0
- package/dist/chunk-DHTSVJ4G.js.map +1 -0
- package/dist/{chunk-WSIVRDRB.js → chunk-DUPE2CRU.js} +3 -3
- package/dist/{chunk-WSIVRDRB.js.map → chunk-DUPE2CRU.js.map} +1 -1
- package/dist/chunk-EIBDLRAR.js +30 -0
- package/dist/chunk-EIBDLRAR.js.map +1 -0
- package/dist/chunk-FUNTJZX7.js +217 -0
- package/dist/chunk-FUNTJZX7.js.map +1 -0
- package/dist/{chunk-YWRBG23W.js → chunk-FXDLS23K.js} +6 -3
- package/dist/chunk-FXDLS23K.js.map +1 -0
- package/dist/chunk-FZNPJAGJ.js +62 -0
- package/dist/chunk-FZNPJAGJ.js.map +1 -0
- package/dist/{chunk-CHTN5AHI.js → chunk-GGT4GJD6.js} +3 -3
- package/dist/chunk-GGT4GJD6.js.map +1 -0
- package/dist/chunk-GIPQUKCN.js +44 -0
- package/dist/chunk-GIPQUKCN.js.map +1 -0
- package/dist/chunk-H26K66EU.js +316 -0
- package/dist/chunk-H26K66EU.js.map +1 -0
- package/dist/chunk-H7INUXZD.js +104 -0
- package/dist/chunk-H7INUXZD.js.map +1 -0
- package/dist/{chunk-AIQG7IIT.js → chunk-H7WOMZXO.js} +10 -5
- package/dist/chunk-H7WOMZXO.js.map +1 -0
- package/dist/{chunk-WJOHNCYY.js → chunk-HBFN5W7Q.js} +37 -90
- package/dist/chunk-HBFN5W7Q.js.map +1 -0
- package/dist/chunk-HBWV5EPU.js +31 -0
- package/dist/chunk-HBWV5EPU.js.map +1 -0
- package/dist/chunk-HC4XVBP2.js +118 -0
- package/dist/chunk-HC4XVBP2.js.map +1 -0
- package/dist/chunk-HDRC6ITF.js +93 -0
- package/dist/chunk-HDRC6ITF.js.map +1 -0
- package/dist/chunk-HDYORQZN.js +23 -0
- package/dist/chunk-HDYORQZN.js.map +1 -0
- package/dist/chunk-HEQ2H6VO.js +148 -0
- package/dist/chunk-HEQ2H6VO.js.map +1 -0
- package/dist/chunk-HVOEVB4E.js +80 -0
- package/dist/chunk-HVOEVB4E.js.map +1 -0
- package/dist/chunk-HX3LNK26.js +193 -0
- package/dist/chunk-HX3LNK26.js.map +1 -0
- package/dist/{chunk-CSCVTESP.js → chunk-IMP5VHEN.js} +4 -11
- package/dist/chunk-IMP5VHEN.js.map +1 -0
- package/dist/{chunk-57BTVRRB.js → chunk-IPYHTCFL.js} +3 -3
- package/dist/{chunk-57BTVRRB.js.map → chunk-IPYHTCFL.js.map} +1 -1
- package/dist/chunk-J2WSKRJW.js +3 -0
- package/dist/chunk-J2WSKRJW.js.map +1 -0
- package/dist/chunk-J43LSYQO.js +14 -0
- package/dist/chunk-J43LSYQO.js.map +1 -0
- package/dist/{chunk-Z43YWH4R.js → chunk-JL4QMM46.js} +47 -25
- package/dist/chunk-JL4QMM46.js.map +1 -0
- package/dist/chunk-JQJ23YQX.js +38 -0
- package/dist/chunk-JQJ23YQX.js.map +1 -0
- package/dist/{chunk-SVKU3GUN.js → chunk-JYK6JVR3.js} +13 -13
- package/dist/chunk-JYK6JVR3.js.map +1 -0
- package/dist/chunk-JYKP4RSG.js +304 -0
- package/dist/chunk-JYKP4RSG.js.map +1 -0
- package/dist/chunk-K6BHDFX3.js +120 -0
- package/dist/chunk-K6BHDFX3.js.map +1 -0
- package/dist/chunk-K6YASO4L.js +25 -0
- package/dist/chunk-K6YASO4L.js.map +1 -0
- package/dist/{chunk-64T6Z7BA.js → chunk-KOT4PWGE.js} +107 -95
- package/dist/chunk-KOT4PWGE.js.map +1 -0
- package/dist/{chunk-RIP5G47F.js → chunk-LJ3GHC4V.js} +13 -11
- package/dist/chunk-LJ3GHC4V.js.map +1 -0
- package/dist/{chunk-YW6Q6ERX.js → chunk-LSIX2PVU.js} +49 -56
- package/dist/chunk-LSIX2PVU.js.map +1 -0
- package/dist/chunk-LZWA7V62.js +140 -0
- package/dist/chunk-LZWA7V62.js.map +1 -0
- package/dist/chunk-MKJKCBRE.js +437 -0
- package/dist/chunk-MKJKCBRE.js.map +1 -0
- package/dist/{chunk-QIDAXFKK.js → chunk-NJ4RO3CT.js} +52 -18
- package/dist/chunk-NJ4RO3CT.js.map +1 -0
- package/dist/{chunk-PINENGML.js → chunk-P276SCCV.js} +15 -8
- package/dist/chunk-P276SCCV.js.map +1 -0
- package/dist/chunk-PAFS7TED.js +85 -0
- package/dist/chunk-PAFS7TED.js.map +1 -0
- package/dist/chunk-PD4FX34E.js +309 -0
- package/dist/chunk-PD4FX34E.js.map +1 -0
- package/dist/{chunk-BEL75C7N.js → chunk-PMUCGFY5.js} +6 -4
- package/dist/chunk-PMUCGFY5.js.map +1 -0
- package/dist/{chunk-4NNGTNPV.js → chunk-Q5ZO2O25.js} +48 -34
- package/dist/chunk-Q5ZO2O25.js.map +1 -0
- package/dist/{chunk-YKUCSV34.js → chunk-R52P43LZ.js} +7 -13
- package/dist/chunk-R52P43LZ.js.map +1 -0
- package/dist/{chunk-CZEKZ5HR.js → chunk-R57QP43T.js} +32 -11
- package/dist/chunk-R57QP43T.js.map +1 -0
- package/dist/{chunk-I4SQQIP5.js → chunk-R5LYFTHA.js} +2 -2
- package/dist/chunk-R5LYFTHA.js.map +1 -0
- package/dist/{chunk-FOMR74VE.js → chunk-RGLNH7A5.js} +6 -6
- package/dist/chunk-RGLNH7A5.js.map +1 -0
- package/dist/chunk-RNRD6ER5.js +32 -0
- package/dist/chunk-RNRD6ER5.js.map +1 -0
- package/dist/{chunk-VZBUQNLX.js → chunk-S4TRYMCU.js} +51 -40
- package/dist/chunk-S4TRYMCU.js.map +1 -0
- package/dist/chunk-SDVZFXQ2.js +21 -0
- package/dist/chunk-SDVZFXQ2.js.map +1 -0
- package/dist/{chunk-CTSO6V72.js → chunk-SE3CGQRO.js} +11 -5
- package/dist/chunk-SE3CGQRO.js.map +1 -0
- package/dist/chunk-TCFB23JT.js +354 -0
- package/dist/chunk-TCFB23JT.js.map +1 -0
- package/dist/{chunk-BTFBBNRW.js → chunk-THLMW5IU.js} +5 -5
- package/dist/{chunk-BTFBBNRW.js.map → chunk-THLMW5IU.js.map} +1 -1
- package/dist/{chunk-YQHOKMSV.js → chunk-U2PNMMDB.js} +60 -53
- package/dist/chunk-U2PNMMDB.js.map +1 -0
- package/dist/{chunk-IRXZHLUL.js → chunk-VALQ2XVA.js} +4 -4
- package/dist/chunk-VALQ2XVA.js.map +1 -0
- package/dist/{chunk-UJZIF2BA.js → chunk-VVM7JMZS.js} +40 -54
- package/dist/chunk-VVM7JMZS.js.map +1 -0
- package/dist/{chunk-OGJFDNIS.js → chunk-WFHY6NRQ.js} +85 -54
- package/dist/chunk-WFHY6NRQ.js.map +1 -0
- package/dist/chunk-WG3BCIU4.js +20 -0
- package/dist/chunk-WG3BCIU4.js.map +1 -0
- package/dist/{chunk-K5UWVH6P.js → chunk-WR444JRU.js} +35 -26
- package/dist/chunk-WR444JRU.js.map +1 -0
- package/dist/chunk-XFEPUGUZ.js +15 -0
- package/dist/chunk-XFEPUGUZ.js.map +1 -0
- package/dist/chunk-XXOR34T4.js +10 -0
- package/dist/chunk-XXOR34T4.js.map +1 -0
- package/dist/{chunk-VZH6TS7M.js → chunk-Z5WYYDG2.js} +7 -4
- package/dist/chunk-Z5WYYDG2.js.map +1 -0
- package/dist/{chunk-IG7FBZVM.js → chunk-ZFUTGBJC.js} +13 -12
- package/dist/chunk-ZFUTGBJC.js.map +1 -0
- package/dist/{chunk-LM6F6DLR.js → chunk-ZN3WYGIQ.js} +18 -9
- package/dist/chunk-ZN3WYGIQ.js.map +1 -0
- package/dist/{chunk-FAOBC4IS.js → chunk-ZWOZL4XX.js} +38 -28
- package/dist/chunk-ZWOZL4XX.js.map +1 -0
- package/dist/chunk-ZYX564HO.js +27 -0
- package/dist/chunk-ZYX564HO.js.map +1 -0
- package/dist/colors.css +16 -8
- package/dist/components/accordion/accordion.d.ts +13 -4
- package/dist/components/accordion/accordion.d.ts.map +1 -1
- package/dist/components/accordion/index.d.ts +1 -1
- package/dist/components/accordion/index.d.ts.map +1 -1
- package/dist/components/accordion/index.js +27 -15
- package/dist/components/accordion/index.js.map +1 -1
- package/dist/components/action-icon/action-icon.d.ts.map +1 -1
- package/dist/components/action-icon/index.js +5 -4
- package/dist/components/alert/alert.d.ts +20 -8
- package/dist/components/alert/alert.d.ts.map +1 -1
- package/dist/components/alert/index.d.ts +1 -1
- package/dist/components/alert/index.d.ts.map +1 -1
- package/dist/components/alert/index.js +22 -10
- package/dist/components/alert/index.js.map +1 -1
- package/dist/components/ambient-background/ambient-background.d.ts +13 -3
- package/dist/components/ambient-background/ambient-background.d.ts.map +1 -1
- package/dist/components/ambient-background/index.js +38 -27
- package/dist/components/ambient-background/index.js.map +1 -1
- package/dist/components/app-shell/app-shell.d.ts +68 -6
- package/dist/components/app-shell/app-shell.d.ts.map +1 -1
- package/dist/components/app-shell/index.d.ts +1 -1
- package/dist/components/app-shell/index.d.ts.map +1 -1
- package/dist/components/app-shell/index.js +46 -18
- package/dist/components/app-shell/index.js.map +1 -1
- package/dist/components/aspect-ratio/aspect-ratio.d.ts +39 -0
- package/dist/components/aspect-ratio/aspect-ratio.d.ts.map +1 -0
- package/dist/components/aspect-ratio/index.d.ts +2 -0
- package/dist/components/aspect-ratio/index.d.ts.map +1 -0
- package/dist/components/aspect-ratio/index.js +33 -0
- package/dist/components/aspect-ratio/index.js.map +1 -0
- package/dist/components/autocomplete/autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/index.js +16 -19
- package/dist/components/autocomplete/index.js.map +1 -1
- package/dist/components/avatar/avatar.d.ts +14 -2
- package/dist/components/avatar/avatar.d.ts.map +1 -1
- package/dist/components/avatar/index.d.ts +1 -1
- package/dist/components/avatar/index.d.ts.map +1 -1
- package/dist/components/avatar/index.js +26 -13
- package/dist/components/avatar/index.js.map +1 -1
- package/dist/components/badge/badge.d.ts.map +1 -1
- package/dist/components/badge/index.js +6 -100
- package/dist/components/badge/index.js.map +1 -1
- package/dist/components/breadcrumb/breadcrumb.d.ts +21 -5
- package/dist/components/breadcrumb/breadcrumb.d.ts.map +1 -1
- package/dist/components/breadcrumb/index.d.ts +1 -1
- package/dist/components/breadcrumb/index.d.ts.map +1 -1
- package/dist/components/breadcrumb/index.js +30 -6
- package/dist/components/breadcrumb/index.js.map +1 -1
- package/dist/components/button/button.d.ts +37 -16
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/index.js +5 -4
- package/dist/components/button-multi-select/index.js +9 -7
- package/dist/components/button-multi-select/index.js.map +1 -1
- package/dist/components/button-select/button-select.d.ts.map +1 -1
- package/dist/components/button-select/index.js +9 -7
- package/dist/components/button-select/index.js.map +1 -1
- package/dist/components/calendar/calendar-body.d.ts +10 -1
- package/dist/components/calendar/calendar-body.d.ts.map +1 -1
- package/dist/components/calendar/calendar.d.ts +24 -7
- package/dist/components/calendar/calendar.d.ts.map +1 -1
- package/dist/components/calendar/index.d.ts +2 -1
- package/dist/components/calendar/index.d.ts.map +1 -1
- package/dist/components/calendar/index.js +10 -8
- package/dist/components/camera/camera-machine.d.ts +131 -0
- package/dist/components/camera/camera-machine.d.ts.map +1 -0
- package/dist/components/camera/camera.d.ts +230 -0
- package/dist/components/camera/camera.d.ts.map +1 -0
- package/dist/components/camera/fake-camera.d.ts +77 -0
- package/dist/components/camera/fake-camera.d.ts.map +1 -0
- package/dist/components/camera/index.d.ts +5 -0
- package/dist/components/camera/index.d.ts.map +1 -0
- package/dist/components/camera/index.js +38 -0
- package/dist/components/camera/index.js.map +1 -0
- package/dist/components/camera/platform.d.ts +21 -0
- package/dist/components/camera/platform.d.ts.map +1 -0
- package/dist/components/camera/use-camera.d.ts +98 -0
- package/dist/components/camera/use-camera.d.ts.map +1 -0
- package/dist/components/card/card.d.ts.map +1 -1
- package/dist/components/card/index.js +2 -1
- package/dist/components/carousel/carousel.d.ts +270 -0
- package/dist/components/carousel/carousel.d.ts.map +1 -0
- package/dist/components/carousel/index.d.ts +2 -0
- package/dist/components/carousel/index.d.ts.map +1 -0
- package/dist/components/carousel/index.js +666 -0
- package/dist/components/carousel/index.js.map +1 -0
- package/dist/components/chart/chart.d.ts +20 -2
- package/dist/components/chart/chart.d.ts.map +1 -1
- package/dist/components/chart/index.js +11 -1
- package/dist/components/chart/index.js.map +1 -1
- package/dist/components/chart/styles.css +12 -10
- package/dist/components/checkbox/checkbox.d.ts +8 -1
- package/dist/components/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/checkbox/index.d.ts +1 -1
- package/dist/components/checkbox/index.d.ts.map +1 -1
- package/dist/components/checkbox/index.js +7 -5
- package/dist/components/choice-card-group/choice-card-group.d.ts +1 -1
- package/dist/components/choice-card-group/choice-card-group.d.ts.map +1 -1
- package/dist/components/choice-card-group/index.js +50 -48
- package/dist/components/choice-card-group/index.js.map +1 -1
- package/dist/components/circular-progress/circular-progress.d.ts +9 -1
- package/dist/components/circular-progress/circular-progress.d.ts.map +1 -1
- package/dist/components/circular-progress/index.js +12 -1
- package/dist/components/circular-progress/index.js.map +1 -1
- package/dist/components/clipboard/clipboard.d.ts +17 -8
- package/dist/components/clipboard/clipboard.d.ts.map +1 -1
- package/dist/components/clipboard/copy.d.ts +19 -5
- package/dist/components/clipboard/copy.d.ts.map +1 -1
- package/dist/components/clipboard/index.d.ts +1 -1
- package/dist/components/clipboard/index.d.ts.map +1 -1
- package/dist/components/clipboard/index.js +60 -23
- package/dist/components/clipboard/index.js.map +1 -1
- package/dist/components/code/code.d.ts.map +1 -1
- package/dist/components/code/index.js +3 -2
- package/dist/components/code/index.js.map +1 -1
- package/dist/components/code-block/chrome.d.ts +10 -9
- package/dist/components/code-block/chrome.d.ts.map +1 -1
- package/dist/components/code-block/chrome.js +10 -8
- package/dist/components/code-block/code-block.d.ts +6 -11
- package/dist/components/code-block/code-block.d.ts.map +1 -1
- package/dist/components/code-block/index.d.ts +2 -2
- package/dist/components/code-block/index.d.ts.map +1 -1
- package/dist/components/code-block/index.js +11 -9
- package/dist/components/code-block/index.js.map +1 -1
- package/dist/components/code-block/static.d.ts +3 -5
- package/dist/components/code-block/static.d.ts.map +1 -1
- package/dist/components/code-block/static.js.map +1 -1
- package/dist/components/collapse/index.js +2 -2
- package/dist/components/combobox/combobox.d.ts +2 -2
- package/dist/components/combobox/combobox.d.ts.map +1 -1
- package/dist/components/combobox/index.js +10 -8
- package/dist/components/combobox-list/combobox-list.d.ts +10 -2
- package/dist/components/combobox-list/combobox-list.d.ts.map +1 -1
- package/dist/components/combobox-list/combobox-search-row.d.ts +31 -0
- package/dist/components/combobox-list/combobox-search-row.d.ts.map +1 -0
- package/dist/components/combobox-list/index.d.ts +1 -1
- package/dist/components/combobox-list/index.d.ts.map +1 -1
- package/dist/components/combobox-list/index.js +13 -10
- package/dist/components/compare/compare.d.ts +45 -0
- package/dist/components/compare/compare.d.ts.map +1 -0
- package/dist/components/compare/index.d.ts +2 -0
- package/dist/components/compare/index.d.ts.map +1 -0
- package/dist/components/compare/index.js +206 -0
- package/dist/components/compare/index.js.map +1 -0
- package/dist/components/container/container.d.ts +7 -1
- package/dist/components/container/container.d.ts.map +1 -1
- package/dist/components/container/index.js.map +1 -1
- package/dist/components/data-table/data-table-filter/data-table-date-filter.d.ts +13 -12
- package/dist/components/data-table/data-table-filter/data-table-date-filter.d.ts.map +1 -1
- package/dist/components/data-table/data-table-filter/data-table-number-filter.d.ts +4 -1
- package/dist/components/data-table/data-table-filter/data-table-number-filter.d.ts.map +1 -1
- package/dist/components/data-table/data-table-filter/index.d.ts +8 -4
- package/dist/components/data-table/data-table-filter/index.d.ts.map +1 -1
- package/dist/components/data-table/data-table-header-cell.d.ts +6 -9
- package/dist/components/data-table/data-table-header-cell.d.ts.map +1 -1
- package/dist/components/data-table/data-table-icons.d.ts +27 -0
- package/dist/components/data-table/data-table-icons.d.ts.map +1 -0
- package/dist/components/data-table/data-table-pagination.d.ts +18 -3
- package/dist/components/data-table/data-table-pagination.d.ts.map +1 -1
- package/dist/components/data-table/data-table-stack.d.ts +5 -2
- package/dist/components/data-table/data-table-stack.d.ts.map +1 -1
- package/dist/components/data-table/data-table-state.d.ts.map +1 -1
- package/dist/components/data-table/data-table-toolbar.d.ts +7 -2
- package/dist/components/data-table/data-table-toolbar.d.ts.map +1 -1
- package/dist/components/data-table/data-table-translations.d.ts +11 -2
- package/dist/components/data-table/data-table-translations.d.ts.map +1 -1
- package/dist/components/data-table/data-table.d.ts +12 -1
- package/dist/components/data-table/data-table.d.ts.map +1 -1
- package/dist/components/data-table/index.d.ts +1 -0
- package/dist/components/data-table/index.d.ts.map +1 -1
- package/dist/components/data-table/index.js +281 -198
- package/dist/components/data-table/index.js.map +1 -1
- package/dist/components/date-picker/aliases.d.ts +7 -0
- package/dist/components/date-picker/aliases.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker.d.ts +15 -6
- package/dist/components/date-picker/date-picker.d.ts.map +1 -1
- package/dist/components/date-picker/date-time-text.d.ts +2 -2
- package/dist/components/date-picker/date-time-text.d.ts.map +1 -1
- package/dist/components/date-picker/index.d.ts +1 -1
- package/dist/components/date-picker/index.d.ts.map +1 -1
- package/dist/components/date-picker/index.js +23 -20
- package/dist/components/date-picker/index.js.map +1 -1
- package/dist/components/divider/divider.d.ts +12 -3
- package/dist/components/divider/divider.d.ts.map +1 -1
- package/dist/components/divider/index.js +2 -1
- package/dist/components/download-button/download-button.d.ts +69 -0
- package/dist/components/download-button/download-button.d.ts.map +1 -0
- package/dist/components/download-button/index.d.ts +2 -0
- package/dist/components/download-button/index.d.ts.map +1 -0
- package/dist/components/download-button/index.js +13 -0
- package/dist/components/download-button/index.js.map +1 -0
- package/dist/components/drawer/drawer.d.ts +79 -44
- package/dist/components/drawer/drawer.d.ts.map +1 -1
- package/dist/components/drawer/index.d.ts +1 -1
- package/dist/components/drawer/index.d.ts.map +1 -1
- package/dist/components/drawer/index.js +10 -6
- package/dist/components/field/field.d.ts +8 -0
- package/dist/components/field/field.d.ts.map +1 -1
- package/dist/components/field/index.js +2 -1
- package/dist/components/figure/figure.d.ts +27 -0
- package/dist/components/figure/figure.d.ts.map +1 -0
- package/dist/components/figure/index.d.ts +2 -0
- package/dist/components/figure/index.d.ts.map +1 -0
- package/dist/components/figure/index.js +7 -0
- package/dist/components/figure/index.js.map +1 -0
- package/dist/components/file-item/file-item.d.ts +178 -0
- package/dist/components/file-item/file-item.d.ts.map +1 -0
- package/dist/components/file-item/index.d.ts +2 -0
- package/dist/components/file-item/index.d.ts.map +1 -0
- package/dist/components/file-item/index.js +25 -0
- package/dist/components/file-item/index.js.map +1 -0
- package/dist/components/file-preview/file-preview.d.ts +189 -0
- package/dist/components/file-preview/file-preview.d.ts.map +1 -0
- package/dist/components/file-preview/index.d.ts +2 -0
- package/dist/components/file-preview/index.d.ts.map +1 -0
- package/dist/components/file-preview/index.js +572 -0
- package/dist/components/file-preview/index.js.map +1 -0
- package/dist/components/file-queue-summary/file-queue-summary.d.ts +35 -0
- package/dist/components/file-queue-summary/file-queue-summary.d.ts.map +1 -0
- package/dist/components/file-queue-summary/index.d.ts +3 -0
- package/dist/components/file-queue-summary/index.d.ts.map +1 -0
- package/dist/components/file-queue-summary/index.js +7 -0
- package/dist/components/file-queue-summary/index.js.map +1 -0
- package/dist/components/file-trigger/file-trigger.d.ts +40 -0
- package/dist/components/file-trigger/file-trigger.d.ts.map +1 -0
- package/dist/components/file-trigger/index.d.ts +2 -0
- package/dist/components/file-trigger/index.d.ts.map +1 -0
- package/dist/components/file-trigger/index.js +11 -0
- package/dist/components/file-trigger/index.js.map +1 -0
- package/dist/components/file-upload/file-upload.d.ts +102 -14
- package/dist/components/file-upload/file-upload.d.ts.map +1 -1
- package/dist/components/file-upload/index.d.ts +1 -1
- package/dist/components/file-upload/index.d.ts.map +1 -1
- package/dist/components/file-upload/index.js +205 -101
- package/dist/components/file-upload/index.js.map +1 -1
- package/dist/components/flex/flex.d.ts +14 -2
- package/dist/components/flex/flex.d.ts.map +1 -1
- package/dist/components/flex/index.js +2 -1
- package/dist/components/gallery/gallery.d.ts +77 -0
- package/dist/components/gallery/gallery.d.ts.map +1 -0
- package/dist/components/gallery/index.d.ts +3 -0
- package/dist/components/gallery/index.d.ts.map +1 -0
- package/dist/components/gallery/index.js +272 -0
- package/dist/components/gallery/index.js.map +1 -0
- package/dist/components/gallery/layout.d.ts +96 -0
- package/dist/components/gallery/layout.d.ts.map +1 -0
- package/dist/components/grid/grid.d.ts +7 -1
- package/dist/components/grid/grid.d.ts.map +1 -1
- package/dist/components/grid/index.js +2 -10
- package/dist/components/grid/index.js.map +1 -1
- package/dist/components/hover-card/index.js +4 -3
- package/dist/components/hover-card/index.js.map +1 -1
- package/dist/components/image/blur-svg.d.ts +11 -0
- package/dist/components/image/blur-svg.d.ts.map +1 -0
- package/dist/components/image/image.d.ts +126 -0
- package/dist/components/image/image.d.ts.map +1 -0
- package/dist/components/image/index.d.ts +3 -0
- package/dist/components/image/index.d.ts.map +1 -0
- package/dist/components/image/index.js +12 -0
- package/dist/components/image/index.js.map +1 -0
- package/dist/components/image/srcset.d.ts +47 -0
- package/dist/components/image/srcset.d.ts.map +1 -0
- package/dist/components/image-cropper/image-cropper.d.ts +208 -0
- package/dist/components/image-cropper/image-cropper.d.ts.map +1 -0
- package/dist/components/image-cropper/index.d.ts +2 -0
- package/dist/components/image-cropper/index.d.ts.map +1 -0
- package/dist/components/image-cropper/index.js +22 -0
- package/dist/components/image-cropper/index.js.map +1 -0
- package/dist/components/indicator/index.js +10 -3
- package/dist/components/indicator/index.js.map +1 -1
- package/dist/components/indicator/indicator.d.ts +21 -8
- package/dist/components/indicator/indicator.d.ts.map +1 -1
- package/dist/components/input/index.js +3 -2
- package/dist/components/input/input.d.ts +1 -1
- package/dist/components/input/input.d.ts.map +1 -1
- package/dist/components/kbd/index.d.ts +1 -0
- package/dist/components/kbd/index.d.ts.map +1 -1
- package/dist/components/kbd/index.js +10 -78
- package/dist/components/kbd/index.js.map +1 -1
- package/dist/components/kbd/kbd.d.ts +45 -3
- package/dist/components/kbd/kbd.d.ts.map +1 -1
- package/dist/components/lightbox/index.d.ts +2 -0
- package/dist/components/lightbox/index.d.ts.map +1 -0
- package/dist/components/lightbox/index.js +1922 -0
- package/dist/components/lightbox/index.js.map +1 -0
- package/dist/components/lightbox/lightbox-controller.d.ts +97 -0
- package/dist/components/lightbox/lightbox-controller.d.ts.map +1 -0
- package/dist/components/lightbox/lightbox-machine.d.ts +165 -0
- package/dist/components/lightbox/lightbox-machine.d.ts.map +1 -0
- package/dist/components/lightbox/lightbox-zoom.d.ts +72 -0
- package/dist/components/lightbox/lightbox-zoom.d.ts.map +1 -0
- package/dist/components/lightbox/lightbox.d.ts +297 -0
- package/dist/components/lightbox/lightbox.d.ts.map +1 -0
- package/dist/components/mark/index.js +1 -1
- package/dist/components/mark/mark.d.ts.map +1 -1
- package/dist/components/menu/index.d.ts +1 -1
- package/dist/components/menu/index.d.ts.map +1 -1
- package/dist/components/menu/index.js +12 -6
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/menu/menu-data.d.ts +5 -8
- package/dist/components/menu/menu-data.d.ts.map +1 -1
- package/dist/components/menu/menu.d.ts +40 -18
- package/dist/components/menu/menu.d.ts.map +1 -1
- package/dist/components/modal/index.d.ts +1 -1
- package/dist/components/modal/index.d.ts.map +1 -1
- package/dist/components/modal/index.js +10 -6
- package/dist/components/modal/modal.d.ts +25 -19
- package/dist/components/modal/modal.d.ts.map +1 -1
- package/dist/components/multi-combobox-list/index.d.ts +1 -1
- package/dist/components/multi-combobox-list/index.d.ts.map +1 -1
- package/dist/components/multi-combobox-list/index.js +15 -12
- package/dist/components/multi-combobox-list/multi-combobox-list.d.ts +10 -2
- package/dist/components/multi-combobox-list/multi-combobox-list.d.ts.map +1 -1
- package/dist/components/multi-select/index.js +25 -19
- package/dist/components/multi-select/index.js.map +1 -1
- package/dist/components/multi-select/multi-select.d.ts +5 -2
- package/dist/components/multi-select/multi-select.d.ts.map +1 -1
- package/dist/components/nav-link/index.js +9 -6
- package/dist/components/nav-link/nav-link.d.ts +5 -2
- package/dist/components/nav-link/nav-link.d.ts.map +1 -1
- package/dist/components/nav-link/navigation.d.ts +8 -1
- package/dist/components/nav-link/navigation.d.ts.map +1 -1
- package/dist/components/nav-link/tanstack.js +9 -6
- package/dist/components/nav-link/tanstack.js.map +1 -1
- package/dist/components/notification/create-notifier.d.ts +4 -1
- package/dist/components/notification/create-notifier.d.ts.map +1 -1
- package/dist/components/notification/index.d.ts +1 -1
- package/dist/components/notification/index.d.ts.map +1 -1
- package/dist/components/notification/index.js +59 -21
- package/dist/components/notification/index.js.map +1 -1
- package/dist/components/notification/notification.d.ts +41 -11
- package/dist/components/notification/notification.d.ts.map +1 -1
- package/dist/components/number-input/index.d.ts +1 -1
- package/dist/components/number-input/index.d.ts.map +1 -1
- package/dist/components/number-input/index.js +10 -8
- package/dist/components/number-input/number-input.d.ts +9 -1
- package/dist/components/number-input/number-input.d.ts.map +1 -1
- package/dist/components/overlays/create-overlays.d.ts.map +1 -1
- package/dist/components/overlays/dialog-parts.d.ts +59 -0
- package/dist/components/overlays/dialog-parts.d.ts.map +1 -0
- package/dist/components/overlays/index.js +28 -31
- package/dist/components/overlays/index.js.map +1 -1
- package/dist/components/overlays/renderer.d.ts.map +1 -1
- package/dist/components/overlays/store.d.ts.map +1 -1
- package/dist/components/password-input/index.d.ts +1 -1
- package/dist/components/password-input/index.d.ts.map +1 -1
- package/dist/components/password-input/index.js +13 -5
- package/dist/components/password-input/index.js.map +1 -1
- package/dist/components/password-input/password-input.d.ts +10 -1
- package/dist/components/password-input/password-input.d.ts.map +1 -1
- package/dist/components/photo-capture/index.d.ts +4 -0
- package/dist/components/photo-capture/index.d.ts.map +1 -0
- package/dist/components/photo-capture/index.js +519 -0
- package/dist/components/photo-capture/index.js.map +1 -0
- package/dist/components/photo-capture/photo-capture-machine.d.ts +74 -0
- package/dist/components/photo-capture/photo-capture-machine.d.ts.map +1 -0
- package/dist/components/photo-capture/photo-capture.d.ts +192 -0
- package/dist/components/photo-capture/photo-capture.d.ts.map +1 -0
- package/dist/components/photo-capture/use-photo-capture.d.ts +92 -0
- package/dist/components/photo-capture/use-photo-capture.d.ts.map +1 -0
- package/dist/components/pill/index.js +5 -3
- package/dist/components/pill/pill.d.ts +4 -3
- package/dist/components/pill/pill.d.ts.map +1 -1
- package/dist/components/pills-input/index.d.ts +1 -1
- package/dist/components/pills-input/index.d.ts.map +1 -1
- package/dist/components/pills-input/index.js +12 -6
- package/dist/components/pills-input/pills-input.d.ts +29 -10
- package/dist/components/pills-input/pills-input.d.ts.map +1 -1
- package/dist/components/pin-input/index.d.ts +1 -1
- package/dist/components/pin-input/index.d.ts.map +1 -1
- package/dist/components/pin-input/index.js +39 -12
- package/dist/components/pin-input/index.js.map +1 -1
- package/dist/components/pin-input/pin-input.d.ts +14 -2
- package/dist/components/pin-input/pin-input.d.ts.map +1 -1
- package/dist/components/popover/icons.d.ts +9 -4
- package/dist/components/popover/icons.d.ts.map +1 -1
- package/dist/components/popover/index.js +4 -3
- package/dist/components/popover/popover.d.ts +12 -8
- package/dist/components/popover/popover.d.ts.map +1 -1
- package/dist/components/progress/index.js +4 -109
- package/dist/components/progress/index.js.map +1 -1
- package/dist/components/progress/progress.d.ts +9 -1
- package/dist/components/progress/progress.d.ts.map +1 -1
- package/dist/components/radio-group/index.js +11 -5
- package/dist/components/radio-group/index.js.map +1 -1
- package/dist/components/radio-group/radio-group.d.ts +3 -3
- package/dist/components/radio-group/radio-group.d.ts.map +1 -1
- package/dist/components/rating/icons.d.ts +0 -10
- package/dist/components/rating/icons.d.ts.map +1 -1
- package/dist/components/rating/index.d.ts +1 -1
- package/dist/components/rating/index.d.ts.map +1 -1
- package/dist/components/rating/index.js +16 -6
- package/dist/components/rating/index.js.map +1 -1
- package/dist/components/rating/rating.d.ts +18 -8
- package/dist/components/rating/rating.d.ts.map +1 -1
- package/dist/components/schedule/index.d.ts +6 -23
- package/dist/components/schedule/index.d.ts.map +1 -1
- package/dist/components/schedule/index.js +3314 -2729
- package/dist/components/schedule/index.js.map +1 -1
- package/dist/components/schedule/now-cursor-line.d.ts +11 -3
- package/dist/components/schedule/now-cursor-line.d.ts.map +1 -1
- package/dist/components/schedule/schedule-agenda-list.d.ts +1 -1
- package/dist/components/schedule/schedule-agenda-list.d.ts.map +1 -1
- package/dist/components/schedule/schedule-agenda-view.d.ts +3 -4
- package/dist/components/schedule/schedule-agenda-view.d.ts.map +1 -1
- package/dist/components/schedule/schedule-all-day-row.d.ts +3 -1
- package/dist/components/schedule/schedule-all-day-row.d.ts.map +1 -1
- package/dist/components/schedule/schedule-create-draft.d.ts.map +1 -1
- package/dist/components/schedule/schedule-dates.d.ts +42 -19
- package/dist/components/schedule/schedule-dates.d.ts.map +1 -1
- package/dist/components/schedule/schedule-day-column.d.ts +111 -0
- package/dist/components/schedule/schedule-day-column.d.ts.map +1 -0
- package/dist/components/schedule/schedule-days-view.d.ts +2 -2
- package/dist/components/schedule/schedule-days-view.d.ts.map +1 -1
- package/dist/components/schedule/schedule-drag-ghost.d.ts.map +1 -1
- package/dist/components/schedule/schedule-event-chip.d.ts +31 -2
- package/dist/components/schedule/schedule-event-chip.d.ts.map +1 -1
- package/dist/components/schedule/schedule-event-details-popover.d.ts +57 -0
- package/dist/components/schedule/schedule-event-details-popover.d.ts.map +1 -0
- package/dist/components/schedule/schedule-event-details.d.ts.map +1 -1
- package/dist/components/schedule/schedule-event-list-popover-content.d.ts +4 -1
- package/dist/components/schedule/schedule-event-list-popover-content.d.ts.map +1 -1
- package/dist/components/schedule/schedule-event-pill.d.ts +68 -0
- package/dist/components/schedule/schedule-event-pill.d.ts.map +1 -0
- package/dist/components/schedule/schedule-event-styles.d.ts +54 -0
- package/dist/components/schedule/schedule-event-styles.d.ts.map +1 -1
- package/dist/components/schedule/schedule-geometry.d.ts +10 -8
- package/dist/components/schedule/schedule-geometry.d.ts.map +1 -1
- package/dist/components/schedule/schedule-grid-gesture.d.ts +24 -2
- package/dist/components/schedule/schedule-grid-gesture.d.ts.map +1 -1
- package/dist/components/schedule/schedule-icons.d.ts +20 -0
- package/dist/components/schedule/schedule-icons.d.ts.map +1 -0
- package/dist/components/schedule/schedule-month-view.d.ts +1 -1
- package/dist/components/schedule/schedule-month-view.d.ts.map +1 -1
- package/dist/components/schedule/schedule-overflow-chip.d.ts +4 -2
- package/dist/components/schedule/schedule-overflow-chip.d.ts.map +1 -1
- package/dist/components/schedule/schedule-overflow-popover.d.ts +4 -1
- package/dist/components/schedule/schedule-overflow-popover.d.ts.map +1 -1
- package/dist/components/schedule/schedule-slot-cursor.d.ts +36 -0
- package/dist/components/schedule/schedule-slot-cursor.d.ts.map +1 -0
- package/dist/components/schedule/schedule-timed-grid-chrome.d.ts +86 -0
- package/dist/components/schedule/schedule-timed-grid-chrome.d.ts.map +1 -0
- package/dist/components/schedule/schedule-timed-grid.d.ts +3 -1
- package/dist/components/schedule/schedule-timed-grid.d.ts.map +1 -1
- package/dist/components/schedule/schedule-toolbar.d.ts +33 -10
- package/dist/components/schedule/schedule-toolbar.d.ts.map +1 -1
- package/dist/components/schedule/schedule-types.d.ts +103 -15
- package/dist/components/schedule/schedule-types.d.ts.map +1 -1
- package/dist/components/schedule/schedule-view-pagination-chrome.d.ts +36 -0
- package/dist/components/schedule/schedule-view-pagination-chrome.d.ts.map +1 -0
- package/dist/components/schedule/schedule-year-view.d.ts +1 -1
- package/dist/components/schedule/schedule-year-view.d.ts.map +1 -1
- package/dist/components/schedule/schedule.d.ts +0 -18
- package/dist/components/schedule/schedule.d.ts.map +1 -1
- package/dist/components/schedule/use-chip-keyboard-move.d.ts +45 -0
- package/dist/components/schedule/use-chip-keyboard-move.d.ts.map +1 -0
- package/dist/components/schedule/use-chip-motion.d.ts +28 -0
- package/dist/components/schedule/use-chip-motion.d.ts.map +1 -0
- package/dist/components/schedule/use-date-grid-navigation.d.ts +59 -0
- package/dist/components/schedule/use-date-grid-navigation.d.ts.map +1 -0
- package/dist/components/schedule/use-event-drag.d.ts.map +1 -1
- package/dist/components/schedule/use-event-resize.d.ts +10 -2
- package/dist/components/schedule/use-event-resize.d.ts.map +1 -1
- package/dist/components/schedule/use-schedule-reveal.d.ts +29 -0
- package/dist/components/schedule/use-schedule-reveal.d.ts.map +1 -0
- package/dist/components/schedule/use-schedule-selection.d.ts +3 -1
- package/dist/components/schedule/use-schedule-selection.d.ts.map +1 -1
- package/dist/components/schedule/use-timed-grid-announcer.d.ts +21 -0
- package/dist/components/schedule/use-timed-grid-announcer.d.ts.map +1 -0
- package/dist/components/schedule/use-timed-grid-paging.d.ts +36 -0
- package/dist/components/schedule/use-timed-grid-paging.d.ts.map +1 -0
- package/dist/components/segment-group/index.js +8 -6
- package/dist/components/segment-group/segment-group.d.ts +1 -1
- package/dist/components/segment-group/segment-group.d.ts.map +1 -1
- package/dist/components/select/index.js +13 -11
- package/dist/components/select/select.d.ts.map +1 -1
- package/dist/components/skeleton/index.js +2 -1
- package/dist/components/slider/index.js +6 -256
- package/dist/components/slider/index.js.map +1 -1
- package/dist/components/slider/slider.d.ts +18 -10
- package/dist/components/slider/slider.d.ts.map +1 -1
- package/dist/components/spinner/index.js +2 -1
- package/dist/components/spinner/spinner.d.ts +7 -36
- package/dist/components/spinner/spinner.d.ts.map +1 -1
- package/dist/components/spotlight/context.d.ts +50 -0
- package/dist/components/spotlight/context.d.ts.map +1 -0
- package/dist/components/spotlight/create-spotlight.d.ts +193 -0
- package/dist/components/spotlight/create-spotlight.d.ts.map +1 -0
- package/dist/components/spotlight/highlight.d.ts +23 -0
- package/dist/components/spotlight/highlight.d.ts.map +1 -0
- package/dist/components/spotlight/icons.d.ts +14 -0
- package/dist/components/spotlight/icons.d.ts.map +1 -0
- package/dist/components/spotlight/index.d.ts +12 -0
- package/dist/components/spotlight/index.d.ts.map +1 -0
- package/dist/components/spotlight/index.js +1695 -0
- package/dist/components/spotlight/index.js.map +1 -0
- package/dist/components/spotlight/label.d.ts +9 -0
- package/dist/components/spotlight/label.d.ts.map +1 -0
- package/dist/components/spotlight/recents.d.ts +29 -0
- package/dist/components/spotlight/recents.d.ts.map +1 -0
- package/dist/components/spotlight/spotlight-engine.d.ts +86 -0
- package/dist/components/spotlight/spotlight-engine.d.ts.map +1 -0
- package/dist/components/spotlight/spotlight.d.ts +233 -0
- package/dist/components/spotlight/spotlight.d.ts.map +1 -0
- package/dist/components/spotlight/static-source.d.ts +32 -0
- package/dist/components/spotlight/static-source.d.ts.map +1 -0
- package/dist/components/spotlight/store.d.ts +39 -0
- package/dist/components/spotlight/store.d.ts.map +1 -0
- package/dist/components/spotlight/translations.d.ts +90 -0
- package/dist/components/spotlight/translations.d.ts.map +1 -0
- package/dist/components/spotlight/types.d.ts +297 -0
- package/dist/components/spotlight/types.d.ts.map +1 -0
- package/dist/components/spotlight/view.d.ts +139 -0
- package/dist/components/spotlight/view.d.ts.map +1 -0
- package/dist/components/switch/index.js +7 -6
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/switch/switch.d.ts +3 -2
- package/dist/components/switch/switch.d.ts.map +1 -1
- package/dist/components/table/index.js +3 -1
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/tabs/index.js +5 -4
- package/dist/components/tabs/tabs-data.d.ts +6 -2
- package/dist/components/tabs/tabs-data.d.ts.map +1 -1
- package/dist/components/tabs/tabs.d.ts +55 -34
- package/dist/components/tabs/tabs.d.ts.map +1 -1
- package/dist/components/tags-input/index.js +41 -24
- package/dist/components/tags-input/index.js.map +1 -1
- package/dist/components/tags-input/tags-input.d.ts +12 -5
- package/dist/components/tags-input/tags-input.d.ts.map +1 -1
- package/dist/components/text/index.js +2 -2
- package/dist/components/text/text.d.ts.map +1 -1
- package/dist/components/text-input/index.js +3 -2
- package/dist/components/text-input/index.js.map +1 -1
- package/dist/components/textarea/index.js +3 -2
- package/dist/components/textarea/index.js.map +1 -1
- package/dist/components/theme-icon/index.js +2 -2
- package/dist/components/theme-script/index.js.map +1 -1
- package/dist/components/theme-script/theme-script.d.ts +2 -2
- package/dist/components/theme-script/theme-script.d.ts.map +1 -1
- package/dist/components/time-input/hour-cycle.d.ts +17 -7
- package/dist/components/time-input/hour-cycle.d.ts.map +1 -1
- package/dist/components/time-input/index.js +21 -20
- package/dist/components/time-input/index.js.map +1 -1
- package/dist/components/time-input/time-input.d.ts +2 -1
- package/dist/components/time-input/time-input.d.ts.map +1 -1
- package/dist/components/time-input/time-row.d.ts +20 -1
- package/dist/components/time-input/time-row.d.ts.map +1 -1
- package/dist/components/timeline/index.d.ts +1 -1
- package/dist/components/timeline/index.d.ts.map +1 -1
- package/dist/components/timeline/index.js +50 -48
- package/dist/components/timeline/index.js.map +1 -1
- package/dist/components/timeline/timeline.d.ts +16 -26
- package/dist/components/timeline/timeline.d.ts.map +1 -1
- package/dist/components/title/index.js +2 -2
- package/dist/components/title/title.d.ts.map +1 -1
- package/dist/components/tooltip/index.js +3 -2
- package/dist/components/tooltip/tooltip.d.ts +6 -4
- package/dist/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/tree-multi-select/index.d.ts +1 -1
- package/dist/components/tree-multi-select/index.d.ts.map +1 -1
- package/dist/components/tree-multi-select/index.js +111 -247
- package/dist/components/tree-multi-select/index.js.map +1 -1
- package/dist/components/tree-multi-select/tree-multi-select.d.ts +12 -5
- package/dist/components/tree-multi-select/tree-multi-select.d.ts.map +1 -1
- package/dist/components/tree-select/index.d.ts +1 -1
- package/dist/components/tree-select/index.d.ts.map +1 -1
- package/dist/components/tree-select/index.js +104 -320
- package/dist/components/tree-select/index.js.map +1 -1
- package/dist/components/tree-select/tree-popover.d.ts +126 -0
- package/dist/components/tree-select/tree-popover.d.ts.map +1 -0
- package/dist/components/tree-select/tree-select.d.ts +24 -2
- package/dist/components/tree-select/tree-select.d.ts.map +1 -1
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +59 -112
- package/dist/index.js.map +1 -1
- package/dist/lib/as-child.d.ts +1 -1
- package/dist/lib/cutout.d.ts +34 -0
- package/dist/lib/cutout.d.ts.map +1 -0
- package/dist/lib/dev-warn.d.ts +11 -0
- package/dist/lib/dev-warn.d.ts.map +1 -1
- package/dist/lib/file-kind-icons.d.ts +5 -0
- package/dist/lib/file-kind-icons.d.ts.map +1 -0
- package/dist/lib/file-queue-summary.d.ts +89 -0
- package/dist/lib/file-queue-summary.d.ts.map +1 -0
- package/dist/lib/file-queue.d.ts +147 -0
- package/dist/lib/file-queue.d.ts.map +1 -0
- package/dist/lib/files.d.ts +29 -0
- package/dist/lib/files.d.ts.map +1 -0
- package/dist/lib/focus-styles.d.ts +46 -7
- package/dist/lib/focus-styles.d.ts.map +1 -1
- package/dist/lib/gap.d.ts +17 -0
- package/dist/lib/gap.d.ts.map +1 -0
- package/dist/lib/graphemes.d.ts +10 -0
- package/dist/lib/graphemes.d.ts.map +1 -0
- package/dist/lib/icons.d.ts +34 -0
- package/dist/lib/icons.d.ts.map +1 -0
- package/dist/lib/image-file.d.ts +9 -0
- package/dist/lib/image-file.d.ts.map +1 -0
- package/dist/lib/merge-refs.d.ts +34 -7
- package/dist/lib/merge-refs.d.ts.map +1 -1
- package/dist/lib/motion/animate.d.ts +42 -0
- package/dist/lib/motion/animate.d.ts.map +1 -0
- package/dist/lib/motion/easing.d.ts +33 -0
- package/dist/lib/motion/easing.d.ts.map +1 -0
- package/dist/lib/motion/gesture.d.ts +127 -0
- package/dist/lib/motion/gesture.d.ts.map +1 -0
- package/dist/lib/motion/morph.d.ts +61 -0
- package/dist/lib/motion/morph.d.ts.map +1 -0
- package/dist/lib/motion/physics.d.ts +44 -0
- package/dist/lib/motion/physics.d.ts.map +1 -0
- package/dist/lib/motion/rect.d.ts +39 -0
- package/dist/lib/motion/rect.d.ts.map +1 -0
- package/dist/lib/motion/reduced-motion.d.ts +23 -0
- package/dist/lib/motion/reduced-motion.d.ts.map +1 -0
- package/dist/lib/motion/spring.d.ts +80 -0
- package/dist/lib/motion/spring.d.ts.map +1 -0
- package/dist/lib/motion/tokens.d.ts +43 -0
- package/dist/lib/motion/tokens.d.ts.map +1 -0
- package/dist/lib/motion/use-gesture.d.ts +36 -0
- package/dist/lib/motion/use-gesture.d.ts.map +1 -0
- package/dist/lib/open-file.d.ts +82 -0
- package/dist/lib/open-file.d.ts.map +1 -0
- package/dist/lib/open-index.d.ts +59 -0
- package/dist/lib/open-index.d.ts.map +1 -0
- package/dist/lib/overlay-layer.d.ts +15 -1
- package/dist/lib/overlay-layer.d.ts.map +1 -1
- package/dist/lib/radius.d.ts +17 -0
- package/dist/lib/radius.d.ts.map +1 -0
- package/dist/lib/ratio.d.ts +16 -0
- package/dist/lib/ratio.d.ts.map +1 -0
- package/dist/lib/save-file.d.ts +52 -0
- package/dist/lib/save-file.d.ts.map +1 -0
- package/dist/lib/select-data.d.ts +57 -24
- package/dist/lib/select-data.d.ts.map +1 -1
- package/dist/lib/tree-data.d.ts +7 -2
- package/dist/lib/tree-data.d.ts.map +1 -1
- package/dist/lib/typography-size.d.ts +27 -8
- package/dist/lib/typography-size.d.ts.map +1 -1
- package/dist/lib/use-debounced.d.ts +17 -0
- package/dist/lib/use-debounced.d.ts.map +1 -0
- package/dist/lib/use-disclosure.d.ts.map +1 -1
- package/dist/lib/use-document-visibility.d.ts +16 -0
- package/dist/lib/use-document-visibility.d.ts.map +1 -0
- package/dist/lib/use-element-size.d.ts +42 -0
- package/dist/lib/use-element-size.d.ts.map +1 -0
- package/dist/lib/use-file-queue.d.ts +62 -0
- package/dist/lib/use-file-queue.d.ts.map +1 -0
- package/dist/lib/use-hotkey.d.ts +240 -0
- package/dist/lib/use-hotkey.d.ts.map +1 -0
- package/dist/lib/use-hydrated.d.ts +16 -0
- package/dist/lib/use-hydrated.d.ts.map +1 -0
- package/dist/lib/use-in-view.d.ts +37 -0
- package/dist/lib/use-in-view.d.ts.map +1 -0
- package/dist/lib/use-now.d.ts +34 -3
- package/dist/lib/use-now.d.ts.map +1 -1
- package/dist/lib/use-object-url.d.ts +61 -0
- package/dist/lib/use-object-url.d.ts.map +1 -0
- package/dist/lib/use-uncontrolled.d.ts.map +1 -1
- package/dist/theme.css +184 -16
- package/package.json +4 -2
- package/src/as-child.contract.test.tsx +221 -6
- package/src/biome-plugins.test.ts +34 -4
- package/src/colors.css +16 -8
- package/src/components/accordion/accordion.test.tsx +45 -2
- package/src/components/accordion/accordion.tsx +38 -17
- package/src/components/accordion/index.ts +2 -0
- package/src/components/action-icon/action-icon.tsx +8 -6
- package/src/components/alert/alert.test.tsx +49 -2
- package/src/components/alert/alert.tsx +47 -14
- package/src/components/alert/index.ts +8 -1
- package/src/components/ambient-background/ambient-background.test.tsx +21 -7
- package/src/components/ambient-background/ambient-background.tsx +49 -28
- package/src/components/app-shell/app-shell.test.tsx +58 -8
- package/src/components/app-shell/app-shell.tsx +69 -17
- package/src/components/app-shell/index.ts +2 -0
- package/src/components/aspect-ratio/aspect-ratio.test.tsx +82 -0
- package/src/components/aspect-ratio/aspect-ratio.tsx +63 -0
- package/src/components/aspect-ratio/index.ts +1 -0
- package/src/components/autocomplete/autocomplete.tsx +9 -14
- package/src/components/avatar/avatar.test.tsx +101 -2
- package/src/components/avatar/avatar.tsx +65 -15
- package/src/components/avatar/index.ts +2 -0
- package/src/components/badge/badge.tsx +3 -1
- package/src/components/breadcrumb/breadcrumb.test.tsx +46 -0
- package/src/components/breadcrumb/breadcrumb.tsx +51 -10
- package/src/components/breadcrumb/index.ts +2 -0
- package/src/components/button/button.test.tsx +65 -12
- package/src/components/button/button.tsx +119 -29
- package/src/components/button-select/button-select.tsx +1 -2
- package/src/components/calendar/calendar-body.tsx +42 -28
- package/src/components/calendar/calendar.test.tsx +89 -0
- package/src/components/calendar/calendar.tsx +42 -4
- package/src/components/calendar/index.ts +2 -0
- package/src/components/camera/camera-machine.test.ts +188 -0
- package/src/components/camera/camera-machine.ts +274 -0
- package/src/components/camera/camera.test.tsx +580 -0
- package/src/components/camera/camera.tsx +938 -0
- package/src/components/camera/fake-camera.ts +153 -0
- package/src/components/camera/index.ts +36 -0
- package/src/components/camera/platform.test.ts +40 -0
- package/src/components/camera/platform.ts +53 -0
- package/src/components/camera/use-camera.ts +428 -0
- package/src/components/card/card.test.tsx +70 -0
- package/src/components/card/card.tsx +5 -2
- package/src/components/carousel/carousel.test.tsx +757 -0
- package/src/components/carousel/carousel.tsx +1115 -0
- package/src/components/carousel/index.ts +24 -0
- package/src/components/chart/chart.test.tsx +26 -0
- package/src/components/chart/chart.tsx +33 -3
- package/src/components/chart/styles.css +12 -10
- package/src/components/checkbox/checkbox.test.tsx +38 -1
- package/src/components/checkbox/checkbox.tsx +34 -10
- package/src/components/checkbox/control.ts +3 -3
- package/src/components/checkbox/index.ts +6 -1
- package/src/components/choice-card-group/choice-card-group.test.tsx +18 -0
- package/src/components/choice-card-group/choice-card-group.tsx +78 -58
- package/src/components/circular-progress/circular-progress.test.tsx +24 -5
- package/src/components/circular-progress/circular-progress.tsx +26 -3
- package/src/components/clipboard/clipboard.test.tsx +64 -5
- package/src/components/clipboard/clipboard.tsx +62 -16
- package/src/components/clipboard/copy.tsx +35 -20
- package/src/components/clipboard/index.ts +7 -1
- package/src/components/code/code.test.tsx +1 -1
- package/src/components/code/code.tsx +2 -1
- package/src/components/code-block/chrome.tsx +49 -53
- package/src/components/code-block/code-block.test.tsx +34 -13
- package/src/components/code-block/code-block.tsx +8 -9
- package/src/components/code-block/index.ts +4 -0
- package/src/components/code-block/static.tsx +8 -5
- package/src/components/combobox/combobox.tsx +14 -6
- package/src/components/combobox-list/combobox-list.test.tsx +54 -0
- package/src/components/combobox-list/combobox-list.tsx +57 -61
- package/src/components/combobox-list/combobox-search-row.tsx +92 -0
- package/src/components/combobox-list/index.ts +2 -0
- package/src/components/compare/compare.test.tsx +291 -0
- package/src/components/compare/compare.tsx +300 -0
- package/src/components/compare/index.ts +3 -0
- package/src/components/container/container.test.tsx +47 -0
- package/src/components/container/container.tsx +8 -2
- package/src/components/data-table/data-table-filter/data-table-date-filter.tsx +24 -18
- package/src/components/data-table/data-table-filter/data-table-number-filter.tsx +6 -3
- package/src/components/data-table/data-table-filter/index.tsx +34 -9
- package/src/components/data-table/data-table-filter.test.tsx +72 -0
- package/src/components/data-table/data-table-header-cell.tsx +75 -68
- package/src/components/data-table/data-table-icons.tsx +79 -0
- package/src/components/data-table/data-table-pagination.tsx +55 -19
- package/src/components/data-table/data-table-placeholder.tsx +2 -2
- package/src/components/data-table/data-table-stack.tsx +19 -25
- package/src/components/data-table/data-table-state.ts +4 -5
- package/src/components/data-table/data-table-toolbar.tsx +10 -3
- package/src/components/data-table/data-table-translations.ts +15 -3
- package/src/components/data-table/data-table.test.tsx +300 -13
- package/src/components/data-table/data-table.tsx +54 -21
- package/src/components/data-table/index.ts +5 -0
- package/src/components/date-picker/aliases.tsx +8 -0
- package/src/components/date-picker/date-picker.test.tsx +75 -0
- package/src/components/date-picker/date-picker.tsx +102 -51
- package/src/components/date-picker/date-time-text.test.ts +9 -0
- package/src/components/date-picker/date-time-text.ts +12 -4
- package/src/components/date-picker/index.ts +1 -0
- package/src/components/divider/divider.test.tsx +34 -5
- package/src/components/divider/divider.tsx +23 -6
- package/src/components/download-button/download-button.test.tsx +253 -0
- package/src/components/download-button/download-button.tsx +236 -0
- package/src/components/download-button/index.ts +11 -0
- package/src/components/drawer/drawer.test.tsx +287 -0
- package/src/components/drawer/drawer.tsx +238 -172
- package/src/components/drawer/index.ts +4 -11
- package/src/components/field/field.test.tsx +115 -0
- package/src/components/field/field.tsx +13 -4
- package/src/components/figure/figure.test.tsx +133 -0
- package/src/components/figure/figure.tsx +137 -0
- package/src/components/figure/index.ts +6 -0
- package/src/components/file-item/file-item.test.tsx +395 -0
- package/src/components/file-item/file-item.tsx +625 -0
- package/src/components/file-item/index.ts +22 -0
- package/src/components/file-preview/file-preview.test.tsx +479 -0
- package/src/components/file-preview/file-preview.tsx +953 -0
- package/src/components/file-preview/index.ts +22 -0
- package/src/components/file-queue-summary/file-queue-summary.test.tsx +285 -0
- package/src/components/file-queue-summary/file-queue-summary.tsx +121 -0
- package/src/components/file-queue-summary/index.ts +12 -0
- package/src/components/file-trigger/file-trigger.test.tsx +138 -0
- package/src/components/file-trigger/file-trigger.tsx +135 -0
- package/src/components/file-trigger/index.ts +3 -0
- package/src/components/file-upload/file-upload.test.tsx +416 -2
- package/src/components/file-upload/file-upload.tsx +391 -136
- package/src/components/file-upload/index.ts +11 -1
- package/src/components/flex/flex.test.tsx +15 -0
- package/src/components/flex/flex.tsx +20 -12
- package/src/components/gallery/gallery.test.tsx +436 -0
- package/src/components/gallery/gallery.tsx +367 -0
- package/src/components/gallery/index.ts +16 -0
- package/src/components/gallery/layout.test.ts +158 -0
- package/src/components/gallery/layout.ts +168 -0
- package/src/components/grid/grid.test.tsx +46 -0
- package/src/components/grid/grid.tsx +11 -11
- package/src/components/image/blur-svg.ts +54 -0
- package/src/components/image/image.test.tsx +481 -0
- package/src/components/image/image.tsx +424 -0
- package/src/components/image/index.ts +14 -0
- package/src/components/image/srcset.test.ts +73 -0
- package/src/components/image/srcset.ts +70 -0
- package/src/components/image-cropper/image-cropper.test.tsx +446 -0
- package/src/components/image-cropper/image-cropper.tsx +745 -0
- package/src/components/image-cropper/index.ts +24 -0
- package/src/components/indicator/indicator.test.tsx +73 -6
- package/src/components/indicator/indicator.tsx +38 -10
- package/src/components/input/input.tsx +6 -5
- package/src/components/kbd/index.ts +6 -0
- package/src/components/kbd/kbd.test.tsx +239 -2
- package/src/components/kbd/kbd.tsx +130 -6
- package/src/components/lightbox/index.ts +25 -0
- package/src/components/lightbox/lightbox-controller.ts +796 -0
- package/src/components/lightbox/lightbox-machine.test.ts +460 -0
- package/src/components/lightbox/lightbox-machine.ts +285 -0
- package/src/components/lightbox/lightbox-zoom.test.ts +130 -0
- package/src/components/lightbox/lightbox-zoom.ts +142 -0
- package/src/components/lightbox/lightbox.test.tsx +821 -0
- package/src/components/lightbox/lightbox.tsx +1301 -0
- package/src/components/mark/mark.test.tsx +21 -2
- package/src/components/mark/mark.tsx +15 -1
- package/src/components/menu/index.ts +4 -0
- package/src/components/menu/menu-data.tsx +20 -17
- package/src/components/menu/menu.test.tsx +123 -19
- package/src/components/menu/menu.tsx +150 -102
- package/src/components/modal/close-trigger.test.tsx +49 -0
- package/src/components/modal/index.ts +2 -0
- package/src/components/modal/modal.test.tsx +101 -0
- package/src/components/modal/modal.tsx +64 -103
- package/src/components/multi-combobox-list/index.ts +2 -0
- package/src/components/multi-combobox-list/multi-combobox-list.test.tsx +45 -0
- package/src/components/multi-combobox-list/multi-combobox-list.tsx +45 -62
- package/src/components/multi-select/multi-select.test.tsx +10 -2
- package/src/components/multi-select/multi-select.tsx +20 -18
- package/src/components/nav-link/nav-link.test.tsx +43 -0
- package/src/components/nav-link/nav-link.tsx +34 -15
- package/src/components/nav-link/navigation.test.tsx +29 -1
- package/src/components/nav-link/navigation.tsx +45 -22
- package/src/components/notification/create-notifier.tsx +79 -13
- package/src/components/notification/index.ts +2 -0
- package/src/components/notification/notification.test.tsx +252 -1
- package/src/components/notification/notification.tsx +102 -58
- package/src/components/number-input/index.ts +7 -1
- package/src/components/number-input/number-input.test.tsx +45 -0
- package/src/components/number-input/number-input.tsx +34 -27
- package/src/components/overlays/create-overlays.tsx +18 -21
- package/src/components/overlays/dialog-parts.tsx +201 -0
- package/src/components/overlays/overlays.test.tsx +170 -0
- package/src/components/overlays/renderer.tsx +2 -9
- package/src/components/overlays/store.ts +4 -1
- package/src/components/password-input/index.ts +2 -0
- package/src/components/password-input/password-input.test.tsx +30 -0
- package/src/components/password-input/password-input.tsx +17 -3
- package/src/components/photo-capture/index.ts +35 -0
- package/src/components/photo-capture/photo-capture-machine.test.ts +147 -0
- package/src/components/photo-capture/photo-capture-machine.ts +112 -0
- package/src/components/photo-capture/photo-capture.test.tsx +375 -0
- package/src/components/photo-capture/photo-capture.tsx +665 -0
- package/src/components/photo-capture/use-photo-capture.ts +199 -0
- package/src/components/pill/pill.test.tsx +58 -1
- package/src/components/pill/pill.tsx +34 -16
- package/src/components/pills-input/index.ts +1 -0
- package/src/components/pills-input/pills-input.test.ts +14 -14
- package/src/components/pills-input/pills-input.test.tsx +39 -0
- package/src/components/pills-input/pills-input.tsx +70 -32
- package/src/components/pin-input/index.ts +1 -1
- package/src/components/pin-input/pin-input.test.tsx +28 -0
- package/src/components/pin-input/pin-input.tsx +64 -16
- package/src/components/popover/icons.tsx +16 -12
- package/src/components/popover/popover.test.tsx +11 -0
- package/src/components/popover/popover.tsx +21 -11
- package/src/components/progress/progress.test.tsx +17 -5
- package/src/components/progress/progress.tsx +23 -7
- package/src/components/radio-group/radio-group.test.tsx +21 -1
- package/src/components/radio-group/radio-group.tsx +66 -48
- package/src/components/rating/icons.tsx +4 -2
- package/src/components/rating/index.ts +2 -0
- package/src/components/rating/rating.test.tsx +43 -4
- package/src/components/rating/rating.tsx +29 -13
- package/src/components/schedule/index.ts +4 -1
- package/src/components/schedule/now-cursor-line.test.tsx +6 -6
- package/src/components/schedule/now-cursor-line.tsx +29 -15
- package/src/components/schedule/schedule-a11y.test.tsx +847 -0
- package/src/components/schedule/schedule-agenda-list.tsx +25 -44
- package/src/components/schedule/schedule-agenda-view.test.tsx +2 -2
- package/src/components/schedule/schedule-agenda-view.tsx +22 -37
- package/src/components/schedule/schedule-all-day-row.tsx +35 -96
- package/src/components/schedule/schedule-create-draft.tsx +23 -90
- package/src/components/schedule/schedule-dates.test.ts +64 -20
- package/src/components/schedule/schedule-dates.ts +65 -27
- package/src/components/schedule/schedule-day-column.tsx +607 -0
- package/src/components/schedule/schedule-days-view.tsx +40 -49
- package/src/components/schedule/schedule-details-popover.test.tsx +97 -0
- package/src/components/schedule/schedule-drag-ghost.tsx +30 -98
- package/src/components/schedule/schedule-event-chip.tsx +120 -262
- package/src/components/schedule/schedule-event-details-popover.tsx +132 -0
- package/src/components/schedule/schedule-event-details.tsx +6 -7
- package/src/components/schedule/schedule-event-list-popover-content.tsx +9 -5
- package/src/components/schedule/schedule-event-pill.tsx +159 -0
- package/src/components/schedule/schedule-event-styles.ts +71 -0
- package/src/components/schedule/schedule-geometry.test.ts +5 -5
- package/src/components/schedule/schedule-geometry.ts +16 -13
- package/src/components/schedule/schedule-grid-gesture.test.ts +99 -0
- package/src/components/schedule/schedule-grid-gesture.ts +50 -12
- package/src/components/schedule/schedule-icons.test.tsx +105 -0
- package/src/components/schedule/schedule-icons.tsx +40 -0
- package/src/components/schedule/schedule-month-view.test.tsx +118 -2
- package/src/components/schedule/schedule-month-view.tsx +258 -200
- package/src/components/schedule/schedule-overflow-chip.tsx +9 -4
- package/src/components/schedule/schedule-overflow-popover.tsx +5 -0
- package/src/components/schedule/schedule-slot-cursor.tsx +422 -0
- package/src/components/schedule/schedule-timed-grid-chrome.tsx +330 -0
- package/src/components/schedule/schedule-timed-grid.tsx +222 -893
- package/src/components/schedule/schedule-toolbar.tsx +108 -60
- package/src/components/schedule/schedule-types.test.ts +43 -2
- package/src/components/schedule/schedule-types.ts +164 -17
- package/src/components/schedule/schedule-view-pagination-chrome.tsx +101 -0
- package/src/components/schedule/schedule-year-view.test.tsx +86 -1
- package/src/components/schedule/schedule-year-view.tsx +163 -136
- package/src/components/schedule/schedule.test.tsx +275 -7
- package/src/components/schedule/schedule.tsx +36 -242
- package/src/components/schedule/use-chip-keyboard-move.ts +109 -0
- package/src/components/schedule/use-chip-motion.ts +71 -0
- package/src/components/schedule/use-date-grid-navigation.ts +120 -0
- package/src/components/schedule/use-event-drag.ts +1 -23
- package/src/components/schedule/use-event-resize.ts +27 -22
- package/src/components/schedule/use-schedule-reveal.ts +259 -0
- package/src/components/schedule/use-schedule-selection.ts +14 -2
- package/src/components/schedule/use-timed-grid-announcer.test.ts +72 -0
- package/src/components/schedule/use-timed-grid-announcer.ts +42 -0
- package/src/components/schedule/use-timed-grid-paging.ts +118 -0
- package/src/components/segment-group/segment-group.test.tsx +27 -5
- package/src/components/segment-group/segment-group.tsx +35 -28
- package/src/components/select/select.tsx +8 -8
- package/src/components/skeleton/skeleton.tsx +1 -1
- package/src/components/slider/slider.test.tsx +56 -5
- package/src/components/slider/slider.tsx +93 -31
- package/src/components/spinner/spinner.test.tsx +34 -10
- package/src/components/spinner/spinner.tsx +52 -49
- package/src/components/spotlight/context.ts +62 -0
- package/src/components/spotlight/create-spotlight.test.tsx +252 -0
- package/src/components/spotlight/create-spotlight.tsx +515 -0
- package/src/components/spotlight/highlight.test.ts +57 -0
- package/src/components/spotlight/highlight.ts +86 -0
- package/src/components/spotlight/icons.tsx +27 -0
- package/src/components/spotlight/index.ts +68 -0
- package/src/components/spotlight/label.ts +10 -0
- package/src/components/spotlight/recents.test.ts +46 -0
- package/src/components/spotlight/recents.ts +54 -0
- package/src/components/spotlight/spotlight-engine.test.ts +836 -0
- package/src/components/spotlight/spotlight-engine.ts +525 -0
- package/src/components/spotlight/spotlight.test.tsx +2532 -0
- package/src/components/spotlight/spotlight.tsx +1429 -0
- package/src/components/spotlight/static-source.test.ts +71 -0
- package/src/components/spotlight/static-source.ts +62 -0
- package/src/components/spotlight/store.test.ts +122 -0
- package/src/components/spotlight/store.ts +130 -0
- package/src/components/spotlight/translations.ts +124 -0
- package/src/components/spotlight/types.ts +308 -0
- package/src/components/spotlight/view.test.ts +216 -0
- package/src/components/spotlight/view.ts +350 -0
- package/src/components/switch/switch.test.tsx +8 -0
- package/src/components/switch/switch.tsx +12 -8
- package/src/components/table/table.test.tsx +35 -0
- package/src/components/table/table.tsx +28 -4
- package/src/components/tabs/tabs-data.tsx +7 -2
- package/src/components/tabs/tabs.test.tsx +211 -50
- package/src/components/tabs/tabs.tsx +309 -120
- package/src/components/tags-input/tags-input.test.tsx +116 -2
- package/src/components/tags-input/tags-input.tsx +51 -31
- package/src/components/text/text.test.tsx +1 -1
- package/src/components/text/text.tsx +1 -4
- package/src/components/theme-icon/theme-icon.tsx +2 -2
- package/src/components/theme-script/theme-script.test.tsx +52 -0
- package/src/components/theme-script/theme-script.tsx +1 -1
- package/src/components/time-input/hour-cycle.test.ts +37 -0
- package/src/components/time-input/hour-cycle.ts +37 -10
- package/src/components/time-input/time-input.test.tsx +34 -0
- package/src/components/time-input/time-input.tsx +12 -14
- package/src/components/time-input/time-row.test.ts +10 -0
- package/src/components/time-input/time-row.tsx +39 -19
- package/src/components/timeline/index.ts +1 -0
- package/src/components/timeline/timeline.test.tsx +62 -4
- package/src/components/timeline/timeline.tsx +68 -26
- package/src/components/title/title.test.tsx +3 -3
- package/src/components/title/title.tsx +2 -1
- package/src/components/tooltip/tooltip.test.tsx +38 -5
- package/src/components/tooltip/tooltip.tsx +17 -17
- package/src/components/tree-multi-select/index.ts +2 -0
- package/src/components/tree-multi-select/tree-multi-select.test.tsx +137 -3
- package/src/components/tree-multi-select/tree-multi-select.tsx +130 -332
- package/src/components/tree-select/index.ts +7 -1
- package/src/components/tree-select/tree-popover.tsx +484 -0
- package/src/components/tree-select/tree-select.test.tsx +93 -1
- package/src/components/tree-select/tree-select.tsx +117 -415
- package/src/icon-stroke.test.tsx +114 -0
- package/src/index.ts +71 -0
- package/src/lib/as-child.ts +1 -1
- package/src/lib/cn.test.ts +14 -2
- package/src/lib/cutout.test.ts +37 -0
- package/src/lib/cutout.ts +56 -0
- package/src/lib/dev-warn.test.ts +89 -0
- package/src/lib/dev-warn.ts +61 -12
- package/src/lib/file-kind-icons.tsx +29 -0
- package/src/lib/file-queue-summary.test.ts +323 -0
- package/src/lib/file-queue-summary.ts +239 -0
- package/src/lib/file-queue.ts +493 -0
- package/src/lib/files.test.ts +72 -0
- package/src/lib/files.ts +211 -0
- package/src/lib/focus-styles.test.ts +97 -1
- package/src/lib/focus-styles.ts +153 -9
- package/src/lib/gap.ts +17 -0
- package/src/lib/graphemes.test.ts +26 -0
- package/src/lib/graphemes.ts +19 -0
- package/src/lib/icons.test.ts +22 -0
- package/src/lib/icons.ts +40 -0
- package/src/lib/image-file.test.ts +18 -0
- package/src/lib/image-file.ts +21 -0
- package/src/lib/merge-refs.test.tsx +79 -0
- package/src/lib/merge-refs.ts +58 -11
- package/src/lib/motion/animate.test.ts +114 -0
- package/src/lib/motion/animate.ts +88 -0
- package/src/lib/motion/easing.test.ts +57 -0
- package/src/lib/motion/easing.ts +107 -0
- package/src/lib/motion/gesture.test.ts +183 -0
- package/src/lib/motion/gesture.ts +300 -0
- package/src/lib/motion/morph.test.ts +93 -0
- package/src/lib/motion/morph.ts +88 -0
- package/src/lib/motion/physics.test.ts +75 -0
- package/src/lib/motion/physics.ts +61 -0
- package/src/lib/motion/rect.test.ts +52 -0
- package/src/lib/motion/rect.ts +67 -0
- package/src/lib/motion/reduced-motion.test.ts +57 -0
- package/src/lib/motion/reduced-motion.ts +34 -0
- package/src/lib/motion/spring.test.ts +93 -0
- package/src/lib/motion/spring.ts +143 -0
- package/src/lib/motion/tokens.ts +48 -0
- package/src/lib/motion/use-gesture.test.tsx +111 -0
- package/src/lib/motion/use-gesture.ts +133 -0
- package/src/lib/open-file.test.ts +275 -0
- package/src/lib/open-file.ts +351 -0
- package/src/lib/open-index.test.tsx +95 -0
- package/src/lib/open-index.tsx +90 -0
- package/src/lib/overlay-layer.test.tsx +32 -13
- package/src/lib/overlay-layer.tsx +25 -3
- package/src/lib/radius.ts +17 -0
- package/src/lib/ratio.test.ts +31 -0
- package/src/lib/ratio.ts +26 -0
- package/src/lib/save-file.test.ts +91 -0
- package/src/lib/save-file.ts +91 -0
- package/src/lib/select-data.test.tsx +123 -0
- package/src/lib/select-data.ts +130 -44
- package/src/lib/tree-data.ts +9 -4
- package/src/lib/typography-size.ts +28 -8
- package/src/lib/use-container-query.ts +4 -4
- package/src/lib/use-debounced.test.ts +105 -0
- package/src/lib/use-debounced.ts +44 -0
- package/src/lib/use-disclosure.ts +6 -1
- package/src/lib/use-document-visibility.test.tsx +46 -0
- package/src/lib/use-document-visibility.ts +37 -0
- package/src/lib/use-element-size.test.ts +142 -0
- package/src/lib/use-element-size.ts +87 -0
- package/src/lib/use-file-queue.test.tsx +774 -0
- package/src/lib/use-file-queue.ts +114 -0
- package/src/lib/use-hotkey.test.tsx +667 -0
- package/src/lib/use-hotkey.ts +562 -0
- package/src/lib/use-hydrated.test.tsx +43 -0
- package/src/lib/use-hydrated.ts +27 -0
- package/src/lib/use-in-view.test.ts +113 -0
- package/src/lib/use-in-view.ts +69 -0
- package/src/lib/use-now.test.tsx +65 -0
- package/src/lib/use-now.ts +37 -14
- package/src/lib/use-object-url.test.ts +195 -0
- package/src/lib/use-object-url.ts +108 -0
- package/src/lib/use-uncontrolled.test.ts +34 -2
- package/src/lib/use-uncontrolled.ts +7 -2
- package/src/test-setup.ts +65 -1
- package/src/theme.css +184 -16
- package/src/theme.forced-colors.test.tsx +152 -0
- package/src/theme.test.ts +34 -0
- package/src/visually-hidden-containment.test.tsx +32 -0
- package/dist/chunk-2GILNBZW.js +0 -31
- package/dist/chunk-2GILNBZW.js.map +0 -1
- package/dist/chunk-2NNZHVKD.js.map +0 -1
- package/dist/chunk-4NNGTNPV.js.map +0 -1
- package/dist/chunk-64T6Z7BA.js.map +0 -1
- package/dist/chunk-A6MYJTJI.js.map +0 -1
- package/dist/chunk-AIQG7IIT.js.map +0 -1
- package/dist/chunk-BEL75C7N.js.map +0 -1
- package/dist/chunk-CHTN5AHI.js.map +0 -1
- package/dist/chunk-CSCVTESP.js.map +0 -1
- package/dist/chunk-CTSO6V72.js.map +0 -1
- package/dist/chunk-CYWMES5P.js.map +0 -1
- package/dist/chunk-CZEKZ5HR.js.map +0 -1
- package/dist/chunk-DBTJEBMO.js +0 -291
- package/dist/chunk-DBTJEBMO.js.map +0 -1
- package/dist/chunk-FAOBC4IS.js.map +0 -1
- package/dist/chunk-FOMR74VE.js.map +0 -1
- package/dist/chunk-GCGX4FEF.js.map +0 -1
- package/dist/chunk-HCYULRWT.js.map +0 -1
- package/dist/chunk-I4SQQIP5.js.map +0 -1
- package/dist/chunk-IG7FBZVM.js.map +0 -1
- package/dist/chunk-INJUILCN.js +0 -31
- package/dist/chunk-INJUILCN.js.map +0 -1
- package/dist/chunk-IRXZHLUL.js.map +0 -1
- package/dist/chunk-K5UWVH6P.js.map +0 -1
- package/dist/chunk-LM6F6DLR.js.map +0 -1
- package/dist/chunk-MQO42HZL.js +0 -223
- package/dist/chunk-MQO42HZL.js.map +0 -1
- package/dist/chunk-OC7I2CTA.js +0 -8
- package/dist/chunk-OC7I2CTA.js.map +0 -1
- package/dist/chunk-OGJFDNIS.js.map +0 -1
- package/dist/chunk-P3XMBETI.js.map +0 -1
- package/dist/chunk-PINENGML.js.map +0 -1
- package/dist/chunk-PS2PZFXH.js +0 -84
- package/dist/chunk-PS2PZFXH.js.map +0 -1
- package/dist/chunk-QIDAXFKK.js.map +0 -1
- package/dist/chunk-RIP5G47F.js.map +0 -1
- package/dist/chunk-RKYXG6X7.js.map +0 -1
- package/dist/chunk-SVKU3GUN.js.map +0 -1
- package/dist/chunk-TBTSEPGP.js.map +0 -1
- package/dist/chunk-TWGCWKRV.js +0 -44
- package/dist/chunk-TWGCWKRV.js.map +0 -1
- package/dist/chunk-UJZIF2BA.js.map +0 -1
- package/dist/chunk-UVYTJQTJ.js +0 -14
- package/dist/chunk-UVYTJQTJ.js.map +0 -1
- package/dist/chunk-VZBUQNLX.js.map +0 -1
- package/dist/chunk-VZH6TS7M.js.map +0 -1
- package/dist/chunk-WJOHNCYY.js.map +0 -1
- package/dist/chunk-WZB6LPQI.js +0 -47
- package/dist/chunk-WZB6LPQI.js.map +0 -1
- package/dist/chunk-YKUCSV34.js.map +0 -1
- package/dist/chunk-YQHOKMSV.js.map +0 -1
- package/dist/chunk-YW6Q6ERX.js.map +0 -1
- package/dist/chunk-YWRBG23W.js.map +0 -1
- package/dist/chunk-Z43YWH4R.js.map +0 -1
- package/dist/chunk-Z6RPMRFH.js.map +0 -1
- package/dist/components/slider/sliderThumb.d.ts +0 -1
- package/dist/components/slider/sliderThumb.d.ts.map +0 -1
- package/src/components/slider/sliderThumb.tsx +0 -0
|
@@ -0,0 +1,519 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useImageCropperContext, ImageCropper } from '../../chunk-MKJKCBRE.js';
|
|
3
|
+
import '../../chunk-4TCTMRR5.js';
|
|
4
|
+
import { FileTrigger } from '../../chunk-HDRC6ITF.js';
|
|
5
|
+
import { Camera, useCamera, imageFile } from '../../chunk-DHTSVJ4G.js';
|
|
6
|
+
import '../../chunk-HX3LNK26.js';
|
|
7
|
+
import '../../chunk-K6YASO4L.js';
|
|
8
|
+
import '../../chunk-JYK6JVR3.js';
|
|
9
|
+
import '../../chunk-GGT4GJD6.js';
|
|
10
|
+
import '../../chunk-J43LSYQO.js';
|
|
11
|
+
import '../../chunk-7TDHT3QD.js';
|
|
12
|
+
import '../../chunk-5FDOOG4J.js';
|
|
13
|
+
import '../../chunk-P276SCCV.js';
|
|
14
|
+
import '../../chunk-7R4CDHBK.js';
|
|
15
|
+
import '../../chunk-45DFYIK5.js';
|
|
16
|
+
import '../../chunk-H7INUXZD.js';
|
|
17
|
+
import '../../chunk-SKPM2FRX.js';
|
|
18
|
+
import { Button } from '../../chunk-NJ4RO3CT.js';
|
|
19
|
+
import { useObjectUrl } from '../../chunk-TCFB23JT.js';
|
|
20
|
+
import '../../chunk-EIBDLRAR.js';
|
|
21
|
+
import '../../chunk-WG3BCIU4.js';
|
|
22
|
+
import '../../chunk-CQ4M4BSF.js';
|
|
23
|
+
import { useMediaQuery } from '../../chunk-HDYORQZN.js';
|
|
24
|
+
import { useMergedRefs } from '../../chunk-HBWV5EPU.js';
|
|
25
|
+
import '../../chunk-AHM6SGEU.js';
|
|
26
|
+
import { useDirectionCheck } from '../../chunk-IPYHTCFL.js';
|
|
27
|
+
import '../../chunk-ZN3WYGIQ.js';
|
|
28
|
+
import '../../chunk-7P32XCEU.js';
|
|
29
|
+
import '../../chunk-H7WOMZXO.js';
|
|
30
|
+
import '../../chunk-LJ3GHC4V.js';
|
|
31
|
+
import '../../chunk-6N6J2DOE.js';
|
|
32
|
+
import '../../chunk-PMUCGFY5.js';
|
|
33
|
+
import { useIsomorphicLayoutEffect } from '../../chunk-BUIHQJGE.js';
|
|
34
|
+
import '../../chunk-ZFUTGBJC.js';
|
|
35
|
+
import { mergeIcons, iconStroke } from '../../chunk-XXOR34T4.js';
|
|
36
|
+
import '../../chunk-HVOEVB4E.js';
|
|
37
|
+
import { composeChildren } from '../../chunk-R5LYFTHA.js';
|
|
38
|
+
import { props } from '../../chunk-WYCMIIRR.js';
|
|
39
|
+
import '../../chunk-3REFDGOM.js';
|
|
40
|
+
import { TEXT_COLOR_CLASSES } from '../../chunk-GIPQUKCN.js';
|
|
41
|
+
import { cn } from '../../chunk-QP4I37PA.js';
|
|
42
|
+
import { ark } from '@ark-ui/react/factory';
|
|
43
|
+
import { Check, RotateCcw, ImageUp, Camera as Camera$1 } from 'lucide-react';
|
|
44
|
+
import { createContext, useId, useEffect, useRef, useState, useMemo, useReducer, useCallback, useContext } from 'react';
|
|
45
|
+
import { match, P } from 'ts-pattern';
|
|
46
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
47
|
+
|
|
48
|
+
var initialPhotoCaptureState = { step: "source", moved: false };
|
|
49
|
+
var crop = (photo, origin) => ({
|
|
50
|
+
step: "crop",
|
|
51
|
+
moved: true,
|
|
52
|
+
photo,
|
|
53
|
+
origin,
|
|
54
|
+
busy: false,
|
|
55
|
+
failed: false
|
|
56
|
+
});
|
|
57
|
+
var reducePhotoCapture = (state, event) => match(event).returnType().with({ type: "open" }, () => state.step === "source" ? { step: "live", moved: true } : state).with({ type: "take" }, ({ photo }) => state.step === "live" ? crop(photo, "camera") : state).with(
|
|
58
|
+
{ type: "pick" },
|
|
59
|
+
({ photo, origin }) => (
|
|
60
|
+
// From any step, but never over an export in flight.
|
|
61
|
+
state.step === "crop" && state.busy ? state : crop(photo, origin)
|
|
62
|
+
)
|
|
63
|
+
).with(
|
|
64
|
+
{ type: "retake" },
|
|
65
|
+
() => match(state).returnType().with({ step: "crop", origin: "camera", busy: false }, () => ({
|
|
66
|
+
step: "live",
|
|
67
|
+
moved: true
|
|
68
|
+
})).otherwise(() => state)
|
|
69
|
+
).with(
|
|
70
|
+
{ type: "confirm" },
|
|
71
|
+
() => match(state).with({ step: "crop", busy: false }, (s) => ({ ...s, busy: true, failed: false })).otherwise(() => state)
|
|
72
|
+
).with(
|
|
73
|
+
{ type: "fail" },
|
|
74
|
+
() => match(state).with({ step: "crop", busy: true }, (s) => ({ ...s, busy: false, failed: true })).otherwise(() => state)
|
|
75
|
+
).with({ type: "done" }, () => state.step === "crop" ? { step: "source", moved: true } : state).with(
|
|
76
|
+
{ type: "reset" },
|
|
77
|
+
() => match(state).returnType().with({ step: "crop", busy: true }, () => state).with({ step: P.union("live", "crop") }, () => ({ step: "source", moved: true })).otherwise(() => state)
|
|
78
|
+
).exhaustive();
|
|
79
|
+
|
|
80
|
+
// src/components/photo-capture/use-photo-capture.ts
|
|
81
|
+
function usePhotoCapture({
|
|
82
|
+
onChange,
|
|
83
|
+
camera: wanted = "auto",
|
|
84
|
+
facing = "user",
|
|
85
|
+
ratio,
|
|
86
|
+
resolution,
|
|
87
|
+
mirror = false,
|
|
88
|
+
output
|
|
89
|
+
} = {}) {
|
|
90
|
+
const [state, dispatch] = useReducer(reducePhotoCapture, initialPhotoCaptureState);
|
|
91
|
+
const camera = useCamera({ facing, ratio, resolution, lazy: true });
|
|
92
|
+
const coarse = useMediaQuery("(pointer: coarse)");
|
|
93
|
+
const mode = match(wanted).returnType().with("auto", () => coarse ? "native" : "live").otherwise((chosen) => chosen);
|
|
94
|
+
const latest = useRef({ onChange, output });
|
|
95
|
+
useIsomorphicLayoutEffect(() => {
|
|
96
|
+
latest.current = { onChange, output };
|
|
97
|
+
});
|
|
98
|
+
const { start, stop } = camera;
|
|
99
|
+
const open = useCallback(() => {
|
|
100
|
+
dispatch({ type: "open" });
|
|
101
|
+
void start();
|
|
102
|
+
}, [start]);
|
|
103
|
+
const take = useCallback((photo) => dispatch({ type: "take", photo }), []);
|
|
104
|
+
const pick = useCallback(
|
|
105
|
+
(files, origin = "file") => {
|
|
106
|
+
const [photo] = files;
|
|
107
|
+
if (!photo) return;
|
|
108
|
+
stop();
|
|
109
|
+
dispatch({ type: "pick", photo, origin });
|
|
110
|
+
},
|
|
111
|
+
[stop]
|
|
112
|
+
);
|
|
113
|
+
const retake = useCallback(() => {
|
|
114
|
+
if (state.step !== "crop" || state.origin !== "camera" || state.busy) return;
|
|
115
|
+
dispatch({ type: "retake" });
|
|
116
|
+
void start();
|
|
117
|
+
}, [state, start]);
|
|
118
|
+
const confirm = useCallback(async (crop3) => {
|
|
119
|
+
dispatch({ type: "confirm" });
|
|
120
|
+
const { type = "image/jpeg", quality = 0.9, size } = latest.current.output ?? {};
|
|
121
|
+
const blob = await crop3({
|
|
122
|
+
type,
|
|
123
|
+
quality,
|
|
124
|
+
...size ? { maxSize: { width: size, height: size } } : {}
|
|
125
|
+
}).catch(() => null);
|
|
126
|
+
if (!(blob instanceof Blob)) {
|
|
127
|
+
dispatch({ type: "fail" });
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
const file = imageFile(blob, "photo");
|
|
131
|
+
latest.current.onChange?.(file);
|
|
132
|
+
dispatch({ type: "done" });
|
|
133
|
+
return file;
|
|
134
|
+
}, []);
|
|
135
|
+
const reset = useCallback(() => {
|
|
136
|
+
stop();
|
|
137
|
+
dispatch({ type: "reset" });
|
|
138
|
+
}, [stop]);
|
|
139
|
+
const crop2 = state.step === "crop" ? state : null;
|
|
140
|
+
return {
|
|
141
|
+
step: state.step,
|
|
142
|
+
mode,
|
|
143
|
+
photo: crop2?.photo ?? null,
|
|
144
|
+
origin: crop2?.origin ?? null,
|
|
145
|
+
busy: crop2?.busy ?? false,
|
|
146
|
+
failed: crop2?.failed ?? false,
|
|
147
|
+
moved: state.moved,
|
|
148
|
+
camera,
|
|
149
|
+
facing,
|
|
150
|
+
ratio,
|
|
151
|
+
mirror,
|
|
152
|
+
open,
|
|
153
|
+
take,
|
|
154
|
+
pick,
|
|
155
|
+
retake,
|
|
156
|
+
confirm,
|
|
157
|
+
reset
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
var DEFAULT_TRANSLATIONS = {
|
|
161
|
+
sourceTitle: "Add a photo",
|
|
162
|
+
sourceBody: "Nothing leaves this page until you choose Use photo.",
|
|
163
|
+
take: "Take photo",
|
|
164
|
+
file: "Choose a file",
|
|
165
|
+
library: "Choose from library",
|
|
166
|
+
retake: "Retake",
|
|
167
|
+
another: "Choose another",
|
|
168
|
+
confirm: "Use photo",
|
|
169
|
+
failed: "The photo couldn't be prepared. Try again, or choose another.",
|
|
170
|
+
announceCrop: "Photo ready to crop",
|
|
171
|
+
announceDone: "Photo added"
|
|
172
|
+
};
|
|
173
|
+
var DEFAULT_ICONS = {
|
|
174
|
+
take: /* @__PURE__ */ jsx(Camera$1, { "aria-hidden": true, className: iconStroke }),
|
|
175
|
+
file: /* @__PURE__ */ jsx(ImageUp, { "aria-hidden": true, className: iconStroke }),
|
|
176
|
+
retake: /* @__PURE__ */ jsx(RotateCcw, { "aria-hidden": true, className: iconStroke }),
|
|
177
|
+
confirm: /* @__PURE__ */ jsx(Check, { "aria-hidden": true, className: iconStroke })
|
|
178
|
+
};
|
|
179
|
+
var PhotoCaptureContext = createContext(null);
|
|
180
|
+
var usePhotoCaptureContext = () => {
|
|
181
|
+
const shared = useContext(PhotoCaptureContext);
|
|
182
|
+
if (!shared)
|
|
183
|
+
throw new Error("[@42/ui-react] PhotoCapture parts must be inside <PhotoCapture.Root>.");
|
|
184
|
+
return shared;
|
|
185
|
+
};
|
|
186
|
+
var SHOT = { type: "image/jpeg", quality: 0.95 };
|
|
187
|
+
var Announcer = ({ message }) => /* @__PURE__ */ jsx("div", { role: "status", "aria-live": "polite", className: "sr-only", children: message });
|
|
188
|
+
var PhotoCaptureRoot = ({
|
|
189
|
+
flow,
|
|
190
|
+
shape = "rectangle",
|
|
191
|
+
accept = "image/*",
|
|
192
|
+
translations,
|
|
193
|
+
icons,
|
|
194
|
+
color = "brand",
|
|
195
|
+
className,
|
|
196
|
+
testId,
|
|
197
|
+
asChild,
|
|
198
|
+
children,
|
|
199
|
+
ref,
|
|
200
|
+
...rest
|
|
201
|
+
}) => {
|
|
202
|
+
const direction = useDirectionCheck();
|
|
203
|
+
const [message, setMessage] = useState("");
|
|
204
|
+
const shared = useMemo(
|
|
205
|
+
() => ({
|
|
206
|
+
flow,
|
|
207
|
+
t: { ...DEFAULT_TRANSLATIONS, ...translations },
|
|
208
|
+
translations,
|
|
209
|
+
icons: mergeIcons(DEFAULT_ICONS, icons),
|
|
210
|
+
cameraIcons: icons,
|
|
211
|
+
shape,
|
|
212
|
+
accept,
|
|
213
|
+
color,
|
|
214
|
+
announce: setMessage
|
|
215
|
+
}),
|
|
216
|
+
[flow, translations, icons, shape, accept, color]
|
|
217
|
+
);
|
|
218
|
+
useEffect(() => {
|
|
219
|
+
if (flow.step === "crop") setMessage(shared.t.announceCrop);
|
|
220
|
+
}, [flow.step, shared.t]);
|
|
221
|
+
const rootRef = useMergedRefs(ref, direction);
|
|
222
|
+
return /* @__PURE__ */ jsx(PhotoCaptureContext, { value: shared, children: /* @__PURE__ */ jsx(
|
|
223
|
+
ark.div,
|
|
224
|
+
{
|
|
225
|
+
ref: rootRef,
|
|
226
|
+
asChild,
|
|
227
|
+
"data-color": color,
|
|
228
|
+
"data-step": flow.step,
|
|
229
|
+
"data-mode": flow.mode,
|
|
230
|
+
className: cn("flex w-full flex-col gap-3", className),
|
|
231
|
+
...props({ "data-testid": testId }),
|
|
232
|
+
...rest,
|
|
233
|
+
children: composeChildren(asChild, children, (own) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
234
|
+
own,
|
|
235
|
+
/* @__PURE__ */ jsx(Announcer, { message })
|
|
236
|
+
] }))
|
|
237
|
+
}
|
|
238
|
+
) });
|
|
239
|
+
};
|
|
240
|
+
var PhotoCaptureTake = ({ children, asChild: _asChild, ...rest }) => {
|
|
241
|
+
const { flow, t, icons, accept } = usePhotoCaptureContext();
|
|
242
|
+
const label = children ?? t.take;
|
|
243
|
+
return match(flow.mode).with("native", () => /* @__PURE__ */ jsx(
|
|
244
|
+
FileTrigger,
|
|
245
|
+
{
|
|
246
|
+
accept,
|
|
247
|
+
capture: flow.facing,
|
|
248
|
+
onSelect: (files) => flow.pick(files, "native"),
|
|
249
|
+
startSlot: icons.take,
|
|
250
|
+
...rest,
|
|
251
|
+
children: label
|
|
252
|
+
}
|
|
253
|
+
)).with(
|
|
254
|
+
"live",
|
|
255
|
+
() => flow.camera.status === "unsupported" ? null : /* @__PURE__ */ jsx(Button, { startSlot: icons.take, onClick: flow.open, ...rest, children: label })
|
|
256
|
+
).exhaustive();
|
|
257
|
+
};
|
|
258
|
+
var PhotoCaptureFile = ({ children, asChild: _asChild, ...rest }) => {
|
|
259
|
+
const { flow, t, icons, accept } = usePhotoCaptureContext();
|
|
260
|
+
return /* @__PURE__ */ jsx(
|
|
261
|
+
FileTrigger,
|
|
262
|
+
{
|
|
263
|
+
accept,
|
|
264
|
+
onSelect: (files) => flow.pick(files, "file"),
|
|
265
|
+
startSlot: icons.file,
|
|
266
|
+
...rest,
|
|
267
|
+
children: children ?? (flow.mode === "native" ? t.library : t.file)
|
|
268
|
+
}
|
|
269
|
+
);
|
|
270
|
+
};
|
|
271
|
+
var PhotoCaptureRetake = ({ children, asChild: _asChild, ...rest }) => {
|
|
272
|
+
const { flow, t, icons, accept } = usePhotoCaptureContext();
|
|
273
|
+
return match(flow.origin).with("camera", () => /* @__PURE__ */ jsx(
|
|
274
|
+
Button,
|
|
275
|
+
{
|
|
276
|
+
variant: "light",
|
|
277
|
+
startSlot: icons.retake,
|
|
278
|
+
disabled: flow.busy,
|
|
279
|
+
onClick: flow.retake,
|
|
280
|
+
...rest,
|
|
281
|
+
children: children ?? t.retake
|
|
282
|
+
}
|
|
283
|
+
)).with("native", () => /* @__PURE__ */ jsx(
|
|
284
|
+
FileTrigger,
|
|
285
|
+
{
|
|
286
|
+
variant: "light",
|
|
287
|
+
accept,
|
|
288
|
+
capture: flow.facing,
|
|
289
|
+
disabled: flow.busy,
|
|
290
|
+
onSelect: (files) => flow.pick(files, "native"),
|
|
291
|
+
startSlot: icons.retake,
|
|
292
|
+
...rest,
|
|
293
|
+
children: children ?? t.retake
|
|
294
|
+
}
|
|
295
|
+
)).with("file", () => /* @__PURE__ */ jsx(
|
|
296
|
+
FileTrigger,
|
|
297
|
+
{
|
|
298
|
+
variant: "light",
|
|
299
|
+
accept,
|
|
300
|
+
disabled: flow.busy,
|
|
301
|
+
onSelect: (files) => flow.pick(files, "file"),
|
|
302
|
+
startSlot: icons.file,
|
|
303
|
+
...rest,
|
|
304
|
+
children: children ?? t.another
|
|
305
|
+
}
|
|
306
|
+
)).with(null, () => null).exhaustive();
|
|
307
|
+
};
|
|
308
|
+
var PhotoCaptureConfirm = ({
|
|
309
|
+
id,
|
|
310
|
+
children,
|
|
311
|
+
asChild: _asChild,
|
|
312
|
+
...rest
|
|
313
|
+
}) => {
|
|
314
|
+
const { flow, t, icons, announce } = usePhotoCaptureContext();
|
|
315
|
+
const cropper = useImageCropperContext();
|
|
316
|
+
const generated = useId();
|
|
317
|
+
const button = id ?? generated;
|
|
318
|
+
useEffect(() => {
|
|
319
|
+
if (!flow.busy) document.getElementById(button)?.focus();
|
|
320
|
+
}, [flow.busy, button]);
|
|
321
|
+
return /* @__PURE__ */ jsx(
|
|
322
|
+
Button,
|
|
323
|
+
{
|
|
324
|
+
id: button,
|
|
325
|
+
startSlot: icons.confirm,
|
|
326
|
+
loading: flow.busy,
|
|
327
|
+
onClick: async () => {
|
|
328
|
+
const file = await flow.confirm(cropper.getCroppedImage);
|
|
329
|
+
if (file) announce(t.announceDone);
|
|
330
|
+
},
|
|
331
|
+
...rest,
|
|
332
|
+
children: children ?? t.confirm
|
|
333
|
+
}
|
|
334
|
+
);
|
|
335
|
+
};
|
|
336
|
+
var PhotoCaptureSource = ({
|
|
337
|
+
className,
|
|
338
|
+
testId,
|
|
339
|
+
children,
|
|
340
|
+
asChild: _asChild,
|
|
341
|
+
...rest
|
|
342
|
+
}) => {
|
|
343
|
+
const { flow, t } = usePhotoCaptureContext();
|
|
344
|
+
const root = useRef(null);
|
|
345
|
+
useEffect(() => {
|
|
346
|
+
if (flow.step === "source" && flow.moved)
|
|
347
|
+
root.current?.querySelector("button:not(:disabled)")?.focus();
|
|
348
|
+
}, [flow.step, flow.moved]);
|
|
349
|
+
if (flow.step !== "source") return null;
|
|
350
|
+
return /* @__PURE__ */ jsxs(
|
|
351
|
+
"div",
|
|
352
|
+
{
|
|
353
|
+
ref: root,
|
|
354
|
+
"data-part": "source",
|
|
355
|
+
className: cn(
|
|
356
|
+
"flex flex-col items-center justify-center gap-4 rounded-input border border-dashed p-6 text-center",
|
|
357
|
+
// The kit's hairline, dashed: FileUpload's dropzone.
|
|
358
|
+
"border-brand-900/20 dark:border-white/15",
|
|
359
|
+
className
|
|
360
|
+
),
|
|
361
|
+
...props({ "data-testid": testId }),
|
|
362
|
+
...rest,
|
|
363
|
+
children: [
|
|
364
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
365
|
+
/* @__PURE__ */ jsx("p", { className: "font-medium text-brand-950 text-md dark:text-white", children: t.sourceTitle }),
|
|
366
|
+
/* @__PURE__ */ jsx("p", { className: "text-black/50 text-sm dark:text-white/50", children: t.sourceBody })
|
|
367
|
+
] }),
|
|
368
|
+
/* @__PURE__ */ jsx("div", { className: "grid w-full max-w-md grid-cols-[repeat(auto-fit,minmax(min(100%,11rem),1fr))] gap-2", children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
369
|
+
/* @__PURE__ */ jsx(PhotoCaptureTake, {}),
|
|
370
|
+
/* @__PURE__ */ jsx(PhotoCaptureFile, {})
|
|
371
|
+
] }) })
|
|
372
|
+
]
|
|
373
|
+
}
|
|
374
|
+
);
|
|
375
|
+
};
|
|
376
|
+
var PhotoCaptureLive = ({
|
|
377
|
+
className,
|
|
378
|
+
classNames,
|
|
379
|
+
testId,
|
|
380
|
+
asChild: _asChild,
|
|
381
|
+
...rest
|
|
382
|
+
}) => {
|
|
383
|
+
const { flow, translations, cameraIcons, shape, color } = usePhotoCaptureContext();
|
|
384
|
+
const root = useRef(null);
|
|
385
|
+
const shutter = useRef(null);
|
|
386
|
+
const pending = useRef(false);
|
|
387
|
+
const status = flow.camera.status;
|
|
388
|
+
useEffect(() => {
|
|
389
|
+
if (flow.step !== "live" || !flow.moved) return;
|
|
390
|
+
pending.current = true;
|
|
391
|
+
root.current?.focus();
|
|
392
|
+
}, [flow.step, flow.moved]);
|
|
393
|
+
useEffect(() => {
|
|
394
|
+
if (!pending.current || status !== "live") return;
|
|
395
|
+
pending.current = false;
|
|
396
|
+
shutter.current?.focus();
|
|
397
|
+
}, [status]);
|
|
398
|
+
if (flow.step !== "live") return null;
|
|
399
|
+
return /* @__PURE__ */ jsxs(
|
|
400
|
+
Camera.Root,
|
|
401
|
+
{
|
|
402
|
+
ref: root,
|
|
403
|
+
tabIndex: -1,
|
|
404
|
+
camera: flow.camera,
|
|
405
|
+
onCapture: flow.take,
|
|
406
|
+
output: SHOT,
|
|
407
|
+
mirror: flow.mirror,
|
|
408
|
+
translations,
|
|
409
|
+
icons: cameraIcons,
|
|
410
|
+
color,
|
|
411
|
+
"data-part": "live",
|
|
412
|
+
className: cn("outline-none", className),
|
|
413
|
+
testId,
|
|
414
|
+
...rest,
|
|
415
|
+
children: [
|
|
416
|
+
/* @__PURE__ */ jsxs(Camera.Viewfinder, { ratio: flow.ratio, className: classNames?.viewfinder, children: [
|
|
417
|
+
/* @__PURE__ */ jsx(Camera.Guide, { shape, ratio: shape === "rectangle" ? flow.ratio : void 0 }),
|
|
418
|
+
/* @__PURE__ */ jsx(Camera.Live, { className: "absolute start-2 top-2 z-1" }),
|
|
419
|
+
/* @__PURE__ */ jsx(Camera.Status, { children: () => /* @__PURE__ */ jsx(PhotoCaptureFile, { size: "sm" }) })
|
|
420
|
+
] }),
|
|
421
|
+
/* @__PURE__ */ jsxs("div", { className: cn("grid grid-cols-[1fr_auto_1fr] items-center gap-3", classNames?.controls), children: [
|
|
422
|
+
/* @__PURE__ */ jsx("div", { className: "flex min-w-0 justify-start", children: status === "live" && /* @__PURE__ */ jsx(PhotoCaptureFile, { variant: "light" }) }),
|
|
423
|
+
/* @__PURE__ */ jsx(Camera.Shutter, { ref: shutter }),
|
|
424
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center justify-end gap-2", children: [
|
|
425
|
+
/* @__PURE__ */ jsx(Camera.Devices, { className: "min-w-0" }),
|
|
426
|
+
/* @__PURE__ */ jsx(Camera.Flip, {})
|
|
427
|
+
] })
|
|
428
|
+
] })
|
|
429
|
+
]
|
|
430
|
+
}
|
|
431
|
+
);
|
|
432
|
+
};
|
|
433
|
+
var PhotoCaptureCrop = ({
|
|
434
|
+
className,
|
|
435
|
+
classNames,
|
|
436
|
+
testId,
|
|
437
|
+
children,
|
|
438
|
+
asChild: _asChild,
|
|
439
|
+
...rest
|
|
440
|
+
}) => {
|
|
441
|
+
const { flow, t, translations, shape, color } = usePhotoCaptureContext();
|
|
442
|
+
const url = useObjectUrl(flow.photo);
|
|
443
|
+
if (flow.step !== "crop" || !url) return null;
|
|
444
|
+
return /* @__PURE__ */ jsxs(
|
|
445
|
+
ImageCropper.Root,
|
|
446
|
+
{
|
|
447
|
+
ratio: shape === "circle" ? 1 : flow.ratio,
|
|
448
|
+
shape,
|
|
449
|
+
color,
|
|
450
|
+
translations,
|
|
451
|
+
"data-part": "crop",
|
|
452
|
+
className,
|
|
453
|
+
testId,
|
|
454
|
+
...rest,
|
|
455
|
+
children: [
|
|
456
|
+
/* @__PURE__ */ jsxs(ImageCropper.Viewport, { className: classNames?.viewport, children: [
|
|
457
|
+
/* @__PURE__ */ jsx(ImageCropper.Image, { src: url }),
|
|
458
|
+
/* @__PURE__ */ jsx(ImageCropper.Selection, {})
|
|
459
|
+
] }),
|
|
460
|
+
/* @__PURE__ */ jsx(ImageCropper.Controls, { className: classNames?.controls }),
|
|
461
|
+
flow.failed && /* @__PURE__ */ jsx("p", { role: "alert", className: cn(TEXT_COLOR_CLASSES.error, "text-sm"), children: t.failed }),
|
|
462
|
+
/* @__PURE__ */ jsx("div", { className: cn("flex flex-wrap items-center justify-end gap-2", classNames?.actions), children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
463
|
+
/* @__PURE__ */ jsx(PhotoCaptureRetake, {}),
|
|
464
|
+
/* @__PURE__ */ jsx(PhotoCaptureConfirm, {})
|
|
465
|
+
] }) })
|
|
466
|
+
]
|
|
467
|
+
},
|
|
468
|
+
url
|
|
469
|
+
);
|
|
470
|
+
};
|
|
471
|
+
var PhotoCaptureComponent = ({
|
|
472
|
+
onChange,
|
|
473
|
+
camera,
|
|
474
|
+
facing,
|
|
475
|
+
ratio,
|
|
476
|
+
resolution,
|
|
477
|
+
mirror,
|
|
478
|
+
output,
|
|
479
|
+
classNames,
|
|
480
|
+
asChild: _asChild,
|
|
481
|
+
...rest
|
|
482
|
+
}) => {
|
|
483
|
+
const flow = usePhotoCapture({ onChange, camera, facing, ratio, resolution, mirror, output });
|
|
484
|
+
return /* @__PURE__ */ jsxs(PhotoCaptureRoot, { flow, ...rest, children: [
|
|
485
|
+
/* @__PURE__ */ jsx(PhotoCaptureSource, { className: classNames?.source }),
|
|
486
|
+
/* @__PURE__ */ jsx(
|
|
487
|
+
PhotoCaptureLive,
|
|
488
|
+
{
|
|
489
|
+
className: classNames?.live,
|
|
490
|
+
classNames: { viewfinder: classNames?.viewfinder, controls: classNames?.controls }
|
|
491
|
+
}
|
|
492
|
+
),
|
|
493
|
+
/* @__PURE__ */ jsx(
|
|
494
|
+
PhotoCaptureCrop,
|
|
495
|
+
{
|
|
496
|
+
className: classNames?.crop,
|
|
497
|
+
classNames: {
|
|
498
|
+
viewport: classNames?.viewport,
|
|
499
|
+
controls: classNames?.controls,
|
|
500
|
+
actions: classNames?.actions
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
)
|
|
504
|
+
] });
|
|
505
|
+
};
|
|
506
|
+
var PhotoCapture = Object.assign(PhotoCaptureComponent, {
|
|
507
|
+
Root: PhotoCaptureRoot,
|
|
508
|
+
Source: PhotoCaptureSource,
|
|
509
|
+
Live: PhotoCaptureLive,
|
|
510
|
+
Crop: PhotoCaptureCrop,
|
|
511
|
+
Take: PhotoCaptureTake,
|
|
512
|
+
File: PhotoCaptureFile,
|
|
513
|
+
Retake: PhotoCaptureRetake,
|
|
514
|
+
Confirm: PhotoCaptureConfirm
|
|
515
|
+
});
|
|
516
|
+
|
|
517
|
+
export { PhotoCapture, reducePhotoCapture, usePhotoCapture, usePhotoCaptureContext };
|
|
518
|
+
//# sourceMappingURL=index.js.map
|
|
519
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/photo-capture/photo-capture-machine.ts","../../../src/components/photo-capture/use-photo-capture.ts","../../../src/components/photo-capture/photo-capture.tsx"],"names":["match","crop","CameraIcon","useRef"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDO,IAAM,wBAAA,GAA8C,EAAE,IAAA,EAAM,QAAA,EAAU,OAAO,KAAA,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AAY,MAAA,EAAQ,MAAA,EAAQ,CAAA;AAC5F,EAAA,uBACE,IAAA,CAAC,gBAAA,EAAA,EAAiB,IAAA,EAAa,GAAG,IAAA,EAChC,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,kBAAA,EAAA,EAAmB,SAAA,EAAW,UAAA,EAAY,MAAA,EAAQ,CAAA;AAAA,oBACnD,GAAA;AAAA,MAAC,gBAAA;AAAA,MAAA;AAAA,QACC,WAAW,UAAA,EAAY,IAAA;AAAA,QACvB,YAAY,EAAE,UAAA,EAAY,YAAY,UAAA,EAAY,QAAA,EAAU,YAAY,QAAA;AAAS;AAAA,KACnF;AAAA,oBACA,GAAA;AAAA,MAAC,gBAAA;AAAA,MAAA;AAAA,QACC,WAAW,UAAA,EAAY,IAAA;AAAA,QACvB,UAAA,EAAY;AAAA,UACV,UAAU,UAAA,EAAY,QAAA;AAAA,UACtB,UAAU,UAAA,EAAY,QAAA;AAAA,UACtB,SAAS,UAAA,EAAY;AAAA;AACvB;AAAA;AACF,GAAA,EACF,CAAA;AAEJ,CAAA;AAEO,IAAM,YAAA,GAAe,MAAA,CAAO,MAAA,CAAO,qBAAA,EAAuB;AAAA,EAC/D,IAAA,EAAM,gBAAA;AAAA,EACN,MAAA,EAAQ,kBAAA;AAAA,EACR,IAAA,EAAM,gBAAA;AAAA,EACN,IAAA,EAAM,gBAAA;AAAA,EACN,IAAA,EAAM,gBAAA;AAAA,EACN,IAAA,EAAM,gBAAA;AAAA,EACN,MAAA,EAAQ,kBAAA;AAAA,EACR,OAAA,EAAS;AACX,CAAC","file":"index.js","sourcesContent":["import { match, P } from \"ts-pattern\"\n\n/**\n * PhotoCapture's steps, kept pure so every transition is unit-tested without\n * a camera or a canvas: `usePhotoCapture` feeds it what the parts report and\n * renders whatever it returns. The camera and the cropper keep their own\n * state; this only knows which of them is on screen, and with which photo.\n */\n\n/**\n * - `source`: the choice, camera or file. The first step, and where a used photo returns to.\n * - `live`: the in-page camera.\n * - `crop`: the photo, taken or picked, in the cropper, until it's used or retaken.\n */\nexport type PhotoCaptureStep = \"source\" | \"live\" | \"crop\"\n\n/**\n * Where the photo in the cropper came from, which decides what \"retake\"\n * means: the in-page camera again, the phone's camera app again, or another\n * file.\n */\nexport type PhotoCaptureOrigin = \"camera\" | \"native\" | \"file\"\n\nexport type PhotoCaptureState =\n | {\n step: \"source\"\n /** Whether a step was ever left: `false` on mount, so nothing steals focus as the page loads. */\n moved: boolean\n }\n | { step: \"live\"; moved: true }\n | {\n step: \"crop\"\n moved: true\n photo: File\n origin: PhotoCaptureOrigin\n /** The crop is being exported. */\n busy: boolean\n /** The last export failed. */\n failed: boolean\n }\n\nexport type PhotoCaptureEvent =\n /** \"Take photo\", in the page: the camera opens. */\n | { type: \"open\" }\n /** The shutter's photo. */\n | { type: \"take\"; photo: File }\n /** A file from the picker, or from the phone's camera app. */\n | { type: \"pick\"; photo: File; origin: Exclude<PhotoCaptureOrigin, \"camera\"> }\n /** Back to the in-page camera, for another shot. */\n | { type: \"retake\" }\n /** \"Use photo\": the export starts. */\n | { type: \"confirm\" }\n | { type: \"fail\" }\n /** The File went out: back to the start. */\n | { type: \"done\" }\n | { type: \"reset\" }\n\nexport const initialPhotoCaptureState: PhotoCaptureState = { step: \"source\", moved: false }\n\nconst crop = (photo: File, origin: PhotoCaptureOrigin): PhotoCaptureState => ({\n step: \"crop\",\n moved: true,\n photo,\n origin,\n busy: false,\n failed: false,\n})\n\n/**\n * The next state. An event that doesn't apply to the current step (a late\n * shutter after a file was picked, a double \"Use photo\") leaves it as it is.\n */\nexport const reducePhotoCapture = (\n state: PhotoCaptureState,\n event: PhotoCaptureEvent,\n): PhotoCaptureState =>\n match(event)\n .returnType<PhotoCaptureState>()\n .with({ type: \"open\" }, () => (state.step === \"source\" ? { step: \"live\", moved: true } : state))\n .with({ type: \"take\" }, ({ photo }) => (state.step === \"live\" ? crop(photo, \"camera\") : state))\n .with({ type: \"pick\" }, ({ photo, origin }) =>\n // From any step, but never over an export in flight.\n state.step === \"crop\" && state.busy ? state : crop(photo, origin),\n )\n .with({ type: \"retake\" }, () =>\n match(state)\n .returnType<PhotoCaptureState>()\n .with({ step: \"crop\", origin: \"camera\", busy: false }, () => ({\n step: \"live\",\n moved: true,\n }))\n .otherwise(() => state),\n )\n .with({ type: \"confirm\" }, () =>\n match(state)\n .with({ step: \"crop\", busy: false }, (s) => ({ ...s, busy: true, failed: false }))\n .otherwise(() => state),\n )\n .with({ type: \"fail\" }, () =>\n match(state)\n .with({ step: \"crop\", busy: true }, (s) => ({ ...s, busy: false, failed: true }))\n .otherwise(() => state),\n )\n .with({ type: \"done\" }, () => (state.step === \"crop\" ? { step: \"source\", moved: true } : state))\n .with({ type: \"reset\" }, () =>\n match(state)\n .returnType<PhotoCaptureState>()\n .with({ step: \"crop\", busy: true }, () => state)\n .with({ step: P.union(\"live\", \"crop\") }, () => ({ step: \"source\", moved: true }))\n .otherwise(() => state),\n )\n .exhaustive()\n","\"use client\"\n\nimport { useCallback, useReducer, useRef } from \"react\"\nimport { match } from \"ts-pattern\"\nimport { imageFile } from \"../../lib/image-file\"\nimport type { Ratio } from \"../../lib/ratio\"\nimport { useIsomorphicLayoutEffect } from \"../../lib/use-isomorphic-layout-effect\"\nimport { useMediaQuery } from \"../../lib/use-media-query\"\nimport type { CameraFacing, CameraResolution } from \"../camera/camera-machine\"\nimport { type UseCameraResult, useCamera } from \"../camera/use-camera\"\nimport {\n initialPhotoCaptureState,\n type PhotoCaptureOrigin,\n type PhotoCaptureStep,\n reducePhotoCapture,\n} from \"./photo-capture-machine\"\n\n/**\n * How the photo is taken:\n * - `live`: the camera in the page, a viewfinder and a shutter.\n * - `native`: the phone's own camera app, through a file input with `capture`. No viewfinder in the page.\n * - `auto`: `native` under a coarse pointer (a phone, a tablet), `live` otherwise.\n */\nexport type PhotoCaptureCamera = \"live\" | \"native\" | \"auto\"\n\nexport type PhotoCaptureOutput = {\n /** The encoding. A browser that can't encode it falls back to PNG, and the File says so. Defaults to `image/jpeg`. */\n type?: string\n /** 0–1, for JPEG and WebP. Defaults to 0.9. */\n quality?: number\n /** The longest side, in px: a larger crop is scaled down to fit, a smaller one is kept as is. */\n size?: number\n}\n\nexport type UsePhotoCaptureOptions = {\n /** Receives the cropped photo once \"Use photo\" is pressed. Nothing is emitted before. */\n onChange?: (file: File) => void\n /** The in-page camera, the phone's camera app, or whichever suits the device. Defaults to `auto`. */\n camera?: PhotoCaptureCamera\n /** The camera to open: the front one (`user`, the default) or the back one. */\n facing?: CameraFacing\n /** The crop's width / height, and the viewfinder's box. Free when unset; a circle is always 1. */\n ratio?: Ratio\n /** The capture size to aim for, for the in-page camera. See `useCamera`. */\n resolution?: CameraResolution\n /** Saves a selfie as the preview shows it, mirrored. Off by default: a saved selfie reads the right way round. */\n mirror?: boolean\n /** The File's encoding and size. */\n output?: PhotoCaptureOutput\n}\n\n/** What `confirm()` hands to the cropper's export: `ImageCropper`'s `getCroppedImage`. */\nexport type PhotoCaptureCrop = (options: {\n type: string\n quality: number\n maxSize?: { width: number; height: number }\n}) => Promise<Blob | string | null>\n\nexport type UsePhotoCaptureResult = {\n step: PhotoCaptureStep\n /** `auto` resolved for this device. */\n mode: \"live\" | \"native\"\n /** The photo in the cropper, taken or picked, before it's cropped. */\n photo: File | null\n /** Where `photo` came from, which decides what a retake means. */\n origin: PhotoCaptureOrigin | null\n /** The crop is being exported. */\n busy: boolean\n /** The last export failed. */\n failed: boolean\n /** Whether a step was ever left, so a part knows to move focus when it appears. */\n moved: boolean\n /** The in-page camera. Lazy: it turns on with `open()`, never on its own. */\n camera: UseCameraResult\n facing: CameraFacing\n ratio: Ratio | undefined\n mirror: boolean\n /** Opens the in-page camera. */\n open: () => void\n /** The shutter's photo: `Camera.Root`'s `onCapture`. */\n take: (photo: File) => void\n /** A picked file (the first of `files`), from the library or, with `native`, the phone's camera app. */\n pick: (files: readonly File[], origin?: Exclude<PhotoCaptureOrigin, \"camera\">) => void\n /** Back to the in-page camera for another shot. */\n retake: () => void\n /** Exports the crop through `crop`, then hands the File to `onChange` and starts over. Resolves the File, or `null` if the export failed. */\n confirm: (crop: PhotoCaptureCrop) => Promise<File | null>\n /** Back to the source step, the camera off. */\n reset: () => void\n}\n\n/**\n * PhotoCapture as plain state plus handlers: which step is on screen, the\n * photo in it, and the in-page camera. The steps are a pure reducer\n * (`reducePhotoCapture`); the camera is `useCamera`, mounted lazily so it\n * never lights up before \"Take photo\"; the crop is whatever `ImageCropper`\n * exports. This hook only wires them together.\n *\n * const flow = usePhotoCapture({ ratio: 1, output: { size: 512 }, onChange: upload })\n * <PhotoCapture.Root flow={flow} shape=\"circle\">…</PhotoCapture.Root>\n *\n * The camera turns off when the photo is taken, when a file is picked\n * instead, on `reset()` and on unmount. Nothing is uploaded: `onChange`\n * gets a File and the rest is yours.\n */\nexport function usePhotoCapture({\n onChange,\n camera: wanted = \"auto\",\n facing = \"user\",\n ratio,\n resolution,\n mirror = false,\n output,\n}: UsePhotoCaptureOptions = {}): UsePhotoCaptureResult {\n const [state, dispatch] = useReducer(reducePhotoCapture, initialPhotoCaptureState)\n const camera = useCamera({ facing, ratio, resolution, lazy: true })\n const coarse = useMediaQuery(\"(pointer: coarse)\")\n const mode = match(wanted)\n .returnType<\"live\" | \"native\">()\n .with(\"auto\", () => (coarse ? \"native\" : \"live\"))\n .otherwise((chosen) => chosen)\n\n // Read when the export resolves, not when it started: the latest callback and encoding.\n const latest = useRef({ onChange, output })\n useIsomorphicLayoutEffect(() => {\n latest.current = { onChange, output }\n })\n\n const { start, stop } = camera\n\n const open = useCallback(() => {\n dispatch({ type: \"open\" })\n void start()\n }, [start])\n\n const take = useCallback((photo: File) => dispatch({ type: \"take\", photo }), [])\n\n const pick = useCallback(\n (files: readonly File[], origin: Exclude<PhotoCaptureOrigin, \"camera\"> = \"file\") => {\n const [photo] = files\n if (!photo) return\n // A file instead of the shot: the camera goes off with the viewfinder.\n stop()\n dispatch({ type: \"pick\", photo, origin })\n },\n [stop],\n )\n\n const retake = useCallback(() => {\n if (state.step !== \"crop\" || state.origin !== \"camera\" || state.busy) return\n dispatch({ type: \"retake\" })\n void start()\n }, [state, start])\n\n const confirm = useCallback(async (crop: PhotoCaptureCrop) => {\n dispatch({ type: \"confirm\" })\n const { type = \"image/jpeg\", quality = 0.9, size } = latest.current.output ?? {}\n const blob = await crop({\n type,\n quality,\n ...(size ? { maxSize: { width: size, height: size } } : {}),\n }).catch(() => null)\n if (!(blob instanceof Blob)) {\n // A tainted canvas, an image that never loaded: the crop step says so.\n dispatch({ type: \"fail\" })\n return null\n }\n const file = imageFile(blob, \"photo\")\n latest.current.onChange?.(file)\n dispatch({ type: \"done\" })\n return file\n }, [])\n\n const reset = useCallback(() => {\n stop()\n dispatch({ type: \"reset\" })\n }, [stop])\n\n const crop = state.step === \"crop\" ? state : null\n return {\n step: state.step,\n mode,\n photo: crop?.photo ?? null,\n origin: crop?.origin ?? null,\n busy: crop?.busy ?? false,\n failed: crop?.failed ?? false,\n moved: state.moved,\n camera,\n facing,\n ratio,\n mirror,\n open,\n take,\n pick,\n retake,\n confirm,\n reset,\n }\n}\n","\"use client\"\n\nimport { ark, type HTMLArkProps } from \"@ark-ui/react/factory\"\nimport { Camera as CameraIcon, Check, ImageUp, RotateCcw } from \"lucide-react\"\nimport {\n type ComponentPropsWithoutRef,\n createContext,\n type ReactNode,\n type Ref,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from \"react\"\nimport { match } from \"ts-pattern\"\nimport { composeChildren, type NoAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { type IconMap, iconStroke, mergeIcons } from \"../../lib/icons\"\nimport { useDirectionCheck } from \"../../lib/intl\"\nimport { useMergedRefs } from \"../../lib/merge-refs\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport { useObjectUrl } from \"../../lib/use-object-url\"\nimport { Button, type ButtonProps } from \"../button/button\"\nimport { Camera, type CameraIconSlot, type CameraTranslations } from \"../camera/camera\"\nimport { FileTrigger } from \"../file-trigger/file-trigger\"\nimport {\n ImageCropper,\n type ImageCropperTranslations,\n useImageCropperContext,\n} from \"../image-cropper/image-cropper\"\nimport {\n type UsePhotoCaptureOptions,\n type UsePhotoCaptureResult,\n usePhotoCapture,\n} from \"./use-photo-capture\"\n\n/**\n * PhotoCapture — take a photo with the camera, or pick a file, crop it, and\n * get a File back. The brick a profile picture, a badge photo or a scanned\n * document is added with.\n *\n * <PhotoCapture shape=\"circle\" output={{ size: 512 }} onChange={(file) => setAvatar(file)} />\n *\n * It's a composition, not a new widget: `Camera` takes the photo,\n * `FileTrigger` picks a file (or opens a phone's camera app), `ImageCropper`\n * crops it, and `usePhotoCapture`, a small step reducer, says which of them\n * is on screen. Every part reads that hook, so a layout of your own drives\n * the same flow:\n *\n * const flow = usePhotoCapture({ ratio: \"3/4\", onChange: setBadge })\n * <PhotoCapture.Root flow={flow} shape=\"rectangle\">\n * <PhotoCapture.Source />\n * <PhotoCapture.Live />\n * <PhotoCapture.Crop />\n * </PhotoCapture.Root>\n *\n * It renders inline. In a modal, it's the modal's content: the camera stops\n * when it unmounts. Nothing is uploaded; `onChange` gets the cropped File\n * after \"Use photo\", and never before.\n */\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\n/** A rectangle, or a circle for a face. Drives the camera's guide and the cropper. */\nexport type PhotoCaptureShape = \"rectangle\" | \"circle\"\n\nexport type PhotoCaptureOwnTranslations = {\n /** The source step's heading. */\n sourceTitle?: string\n sourceBody?: string\n /** Takes a photo: opens the camera in the page, or the phone's camera app. */\n take?: string\n /** Picks a file, next to the in-page camera. */\n file?: string\n /** Picks from the phone's library, next to its camera app. */\n library?: string\n /** Back to the camera, from the crop. */\n retake?: string\n /** Picks another file, from the crop of a picked one. */\n another?: string\n /** Hands the crop to `onChange`. */\n confirm?: string\n /** Shown, as an alert, when the crop couldn't be exported. */\n failed?: string\n /** Announced politely when the photo reaches the cropper, and once it's been used. */\n announceCrop?: string\n announceDone?: string\n}\n\n/**\n * One map for everything PhotoCapture shows: its own strings, the camera's\n * (`CameraTranslations`) and the cropper's (`ImageCropperTranslations`).\n */\nexport type PhotoCaptureTranslations = PhotoCaptureOwnTranslations &\n CameraTranslations &\n ImageCropperTranslations\n\nexport const DEFAULT_TRANSLATIONS: Required<PhotoCaptureOwnTranslations> = {\n sourceTitle: \"Add a photo\",\n sourceBody: \"Nothing leaves this page until you choose Use photo.\",\n take: \"Take photo\",\n file: \"Choose a file\",\n library: \"Choose from library\",\n retake: \"Retake\",\n another: \"Choose another\",\n confirm: \"Use photo\",\n failed: \"The photo couldn't be prepared. Try again, or choose another.\",\n announceCrop: \"Photo ready to crop\",\n announceDone: \"Photo added\",\n}\n\nexport type PhotoCaptureIconSlot = \"take\" | \"file\" | \"retake\" | \"confirm\"\n/** PhotoCapture's own icons, and the camera's (`shutter`, `flip`, `start`, `retry`, `off`). */\nexport type PhotoCaptureIcons = IconMap<PhotoCaptureIconSlot | CameraIconSlot>\n\nexport const DEFAULT_ICONS: Record<PhotoCaptureIconSlot, ReactNode> = {\n take: <CameraIcon aria-hidden className={iconStroke} />,\n file: <ImageUp aria-hidden className={iconStroke} />,\n retake: <RotateCcw aria-hidden className={iconStroke} />,\n confirm: <Check aria-hidden className={iconStroke} />,\n}\n\ntype Shared = {\n flow: UsePhotoCaptureResult\n t: Required<PhotoCaptureOwnTranslations>\n /** The `translations` prop as given, for the camera and the cropper to merge with their own defaults. */\n translations: PhotoCaptureTranslations | undefined\n icons: Record<PhotoCaptureIconSlot, ReactNode>\n /** The `icons` prop as given, for the camera. */\n cameraIcons: PhotoCaptureIcons | undefined\n shape: PhotoCaptureShape\n accept: string | string[]\n color: Color\n announce: (message: string) => void\n}\n\nconst PhotoCaptureContext = createContext<Shared | null>(null)\n\n/** The nearest `PhotoCapture.Root`'s flow, translations and icons, for a part of your own. */\nexport const usePhotoCaptureContext = (): Shared => {\n const shared = useContext(PhotoCaptureContext)\n if (!shared)\n throw new Error(\"[@42/ui-react] PhotoCapture parts must be inside <PhotoCapture.Root>.\")\n return shared\n}\n\n/** What the camera encodes the shot as, on its way to the cropper, which re-encodes it as `output`. */\nconst SHOT = { type: \"image/jpeg\", quality: 0.95 }\n\n// ---------------------------------------------------------------------------\n// Root\n// ---------------------------------------------------------------------------\n\nexport type PhotoCaptureRootProps = Omit<HTMLArkProps<\"div\">, \"color\" | \"onChange\"> &\n WithTestId & {\n /** The flow, from `usePhotoCapture()`. */\n flow: UsePhotoCaptureResult\n /** A rectangle, or a circle for a face: the camera's guide and the crop. Defaults to `rectangle`. */\n shape?: PhotoCaptureShape\n /** The file types the pickers offer. Defaults to `image/*`. */\n accept?: string | string[]\n translations?: PhotoCaptureTranslations\n icons?: PhotoCaptureIcons\n /** The palette of the buttons, the shutter, the guide and the crop. `brand` by default. */\n color?: Color\n ref?: Ref<HTMLDivElement>\n }\n\n/** Announces each step, politely, from a visually hidden region. */\nconst Announcer = ({ message }: { message: string }) => (\n <div role=\"status\" aria-live=\"polite\" className=\"sr-only\">\n {message}\n </div>\n)\n\nconst PhotoCaptureRoot = ({\n flow,\n shape = \"rectangle\",\n accept = \"image/*\",\n translations,\n icons,\n color = \"brand\",\n className,\n testId,\n asChild,\n children,\n ref,\n ...rest\n}: PhotoCaptureRootProps) => {\n const direction = useDirectionCheck()\n const [message, setMessage] = useState(\"\")\n\n const shared = useMemo<Shared>(\n () => ({\n flow,\n t: { ...DEFAULT_TRANSLATIONS, ...translations },\n translations,\n icons: mergeIcons(DEFAULT_ICONS, icons),\n cameraIcons: icons,\n shape,\n accept,\n color,\n announce: setMessage,\n }),\n [flow, translations, icons, shape, accept, color],\n )\n\n // The live step announces itself through the camera's own region.\n useEffect(() => {\n if (flow.step === \"crop\") setMessage(shared.t.announceCrop)\n }, [flow.step, shared.t])\n\n const rootRef = useMergedRefs(ref, direction)\n return (\n <PhotoCaptureContext value={shared}>\n <ark.div\n ref={rootRef}\n asChild={asChild}\n data-color={color}\n data-step={flow.step}\n data-mode={flow.mode}\n className={cn(\"flex w-full flex-col gap-3\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {composeChildren(asChild, children, (own) => (\n <>\n {own}\n <Announcer message={message} />\n </>\n ))}\n </ark.div>\n </PhotoCaptureContext>\n )\n}\n\n// ---------------------------------------------------------------------------\n// Actions\n// ---------------------------------------------------------------------------\n\nexport type PhotoCaptureActionProps = NoAsChild<\n Omit<ButtonProps, \"onClick\" | \"onSelect\" | \"children\"> & {\n /** Replaces the label from `translations`. */\n children?: ReactNode\n }\n>\n\n/**\n * Takes a photo. With the in-page camera, it opens the `live` step; with\n * `native`, it opens the phone's camera app (`capture`), whose photo goes\n * straight to the crop. Hidden where the in-page camera can't work at all.\n */\nconst PhotoCaptureTake = ({ children, asChild: _asChild, ...rest }: PhotoCaptureActionProps) => {\n const { flow, t, icons, accept } = usePhotoCaptureContext()\n const label = children ?? t.take\n return match(flow.mode)\n .with(\"native\", () => (\n <FileTrigger\n accept={accept}\n capture={flow.facing}\n onSelect={(files) => flow.pick(files, \"native\")}\n startSlot={icons.take}\n {...rest}\n >\n {label}\n </FileTrigger>\n ))\n .with(\"live\", () =>\n flow.camera.status === \"unsupported\" ? null : (\n <Button startSlot={icons.take} onClick={flow.open} {...rest}>\n {label}\n </Button>\n ),\n )\n .exhaustive()\n}\n\n/**\n * Picks a file: \"Choose a file\" beside the in-page camera, \"Choose from\n * library\" beside the phone's camera app. Always there, at the same weight\n * as the camera, for anyone whose camera won't do.\n */\nconst PhotoCaptureFile = ({ children, asChild: _asChild, ...rest }: PhotoCaptureActionProps) => {\n const { flow, t, icons, accept } = usePhotoCaptureContext()\n return (\n <FileTrigger\n accept={accept}\n onSelect={(files) => flow.pick(files, \"file\")}\n startSlot={icons.file}\n {...rest}\n >\n {children ?? (flow.mode === \"native\" ? t.library : t.file)}\n </FileTrigger>\n )\n}\n\n/**\n * Back for another photo, the way this one came: the in-page camera again,\n * the phone's camera app again, or another file (\"Choose another\").\n */\nconst PhotoCaptureRetake = ({ children, asChild: _asChild, ...rest }: PhotoCaptureActionProps) => {\n const { flow, t, icons, accept } = usePhotoCaptureContext()\n return match(flow.origin)\n .with(\"camera\", () => (\n <Button\n variant=\"light\"\n startSlot={icons.retake}\n disabled={flow.busy}\n onClick={flow.retake}\n {...rest}\n >\n {children ?? t.retake}\n </Button>\n ))\n .with(\"native\", () => (\n <FileTrigger\n variant=\"light\"\n accept={accept}\n capture={flow.facing}\n disabled={flow.busy}\n onSelect={(files) => flow.pick(files, \"native\")}\n startSlot={icons.retake}\n {...rest}\n >\n {children ?? t.retake}\n </FileTrigger>\n ))\n .with(\"file\", () => (\n <FileTrigger\n variant=\"light\"\n accept={accept}\n disabled={flow.busy}\n onSelect={(files) => flow.pick(files, \"file\")}\n startSlot={icons.file}\n {...rest}\n >\n {children ?? t.another}\n </FileTrigger>\n ))\n .with(null, () => null)\n .exhaustive()\n}\n\n/**\n * \"Use photo\": exports the crop as `output` says, hands the File to\n * `onChange`, and starts over. Inside `PhotoCapture.Crop`, which provides the\n * cropper it exports. Takes focus when it appears, so after the shutter (or a\n * pick) Enter uses the photo.\n */\nconst PhotoCaptureConfirm = ({\n id,\n children,\n asChild: _asChild,\n ...rest\n}: PhotoCaptureActionProps) => {\n const { flow, t, icons, announce } = usePhotoCaptureContext()\n const cropper = useImageCropperContext()\n // Button takes no ref: found by its id to move focus to it.\n const generated = useId()\n const button = id ?? generated\n\n // The crop is only ever reached by a user's step: the shutter or a pick.\n // Again after a failure, which disabled (and so blurred) the button.\n useEffect(() => {\n if (!flow.busy) document.getElementById(button)?.focus()\n }, [flow.busy, button])\n\n return (\n <Button\n id={button}\n startSlot={icons.confirm}\n loading={flow.busy}\n onClick={async () => {\n const file = await flow.confirm(cropper.getCroppedImage)\n if (file) announce(t.announceDone)\n }}\n {...rest}\n >\n {children ?? t.confirm}\n </Button>\n )\n}\n\n// ---------------------------------------------------------------------------\n// Steps\n// ---------------------------------------------------------------------------\n\nexport type PhotoCaptureSourceProps = NoAsChild<ComponentPropsWithoutRef<\"div\"> & WithTestId>\n\n/**\n * The first step: \"Take photo\" and the file picker, side by side at the same\n * weight, under a line that says nothing leaves the page. With `native`,\n * that's the phone's camera app and its library: two pickers, because\n * Android 14 and 15 hide the camera from a picker without `capture`.\n * Children replace the two buttons.\n */\nconst PhotoCaptureSource = ({\n className,\n testId,\n children,\n asChild: _asChild,\n ...rest\n}: PhotoCaptureSourceProps) => {\n const { flow, t } = usePhotoCaptureContext()\n const root = useRef<HTMLDivElement>(null)\n\n // Back here after a photo was used: focus goes to the first choice, not the page.\n useEffect(() => {\n if (flow.step === \"source\" && flow.moved)\n root.current?.querySelector<HTMLElement>(\"button:not(:disabled)\")?.focus()\n }, [flow.step, flow.moved])\n\n if (flow.step !== \"source\") return null\n return (\n <div\n ref={root}\n data-part=\"source\"\n className={cn(\n \"flex flex-col items-center justify-center gap-4 rounded-input border border-dashed p-6 text-center\",\n // The kit's hairline, dashed: FileUpload's dropzone.\n \"border-brand-900/20 dark:border-white/15\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n <div className=\"flex flex-col gap-1\">\n <p className=\"font-medium text-brand-950 text-md dark:text-white\">{t.sourceTitle}</p>\n <p className=\"text-black/50 text-sm dark:text-white/50\">{t.sourceBody}</p>\n </div>\n {/* Side by side when they fit, stacked full width when not: the same weight either way. */}\n <div className=\"grid w-full max-w-md grid-cols-[repeat(auto-fit,minmax(min(100%,11rem),1fr))] gap-2\">\n {children ?? (\n <>\n <PhotoCaptureTake />\n <PhotoCaptureFile />\n </>\n )}\n </div>\n </div>\n )\n}\n\nexport type PhotoCaptureLiveClassNames = {\n viewfinder?: string\n controls?: string\n}\n\nexport type PhotoCaptureLiveProps = NoAsChild<\n Omit<ComponentPropsWithoutRef<\"div\">, \"children\" | \"color\"> &\n WithTestId & {\n classNames?: PhotoCaptureLiveClassNames\n }\n>\n\n/**\n * The in-page camera: `Camera`'s viewfinder with a guide in the flow's\n * shape, its status panels, the shutter, the camera switch and picker, and\n * the file picker beside the shutter. Every panel (asking, refused, busy, no\n * camera) offers the file picker too.\n *\n * Focus comes here as the step opens, and moves to the shutter once the\n * picture is live.\n */\nconst PhotoCaptureLive = ({\n className,\n classNames,\n testId,\n asChild: _asChild,\n ...rest\n}: PhotoCaptureLiveProps) => {\n const { flow, translations, cameraIcons, shape, color } = usePhotoCaptureContext()\n const root = useRef<HTMLDivElement>(null)\n const shutter = useRef<HTMLButtonElement>(null)\n /** Whether the shutter should take focus once it's enabled: after \"Take photo\" or a retake. */\n const pending = useRef(false)\n const status = flow.camera.status\n\n useEffect(() => {\n if (flow.step !== \"live\" || !flow.moved) return\n pending.current = true\n // The button that brought us here is gone: hold focus in the step until the shutter can take it.\n root.current?.focus()\n }, [flow.step, flow.moved])\n\n useEffect(() => {\n if (!pending.current || status !== \"live\") return\n pending.current = false\n shutter.current?.focus()\n }, [status])\n\n if (flow.step !== \"live\") return null\n return (\n <Camera.Root\n ref={root}\n tabIndex={-1}\n camera={flow.camera}\n onCapture={flow.take}\n output={SHOT}\n mirror={flow.mirror}\n translations={translations}\n icons={cameraIcons}\n color={color}\n data-part=\"live\"\n className={cn(\"outline-none\", className)}\n testId={testId}\n {...rest}\n >\n <Camera.Viewfinder ratio={flow.ratio} className={classNames?.viewfinder}>\n <Camera.Guide shape={shape} ratio={shape === \"rectangle\" ? flow.ratio : undefined} />\n <Camera.Live className=\"absolute start-2 top-2 z-1\" />\n <Camera.Status>{() => <PhotoCaptureFile size=\"sm\" />}</Camera.Status>\n </Camera.Viewfinder>\n <div className={cn(\"grid grid-cols-[1fr_auto_1fr] items-center gap-3\", classNames?.controls)}>\n {/* While a panel is up, it carries the file picker. */}\n <div className=\"flex min-w-0 justify-start\">\n {status === \"live\" && <PhotoCaptureFile variant=\"light\" />}\n </div>\n <Camera.Shutter ref={shutter} />\n <div className=\"flex min-w-0 items-center justify-end gap-2\">\n <Camera.Devices className=\"min-w-0\" />\n <Camera.Flip />\n </div>\n </div>\n </Camera.Root>\n )\n}\n\nexport type PhotoCaptureCropClassNames = {\n viewport?: string\n controls?: string\n actions?: string\n}\n\nexport type PhotoCaptureCropProps = NoAsChild<\n Omit<ComponentPropsWithoutRef<\"div\">, \"color\"> &\n WithTestId & {\n classNames?: PhotoCaptureCropClassNames\n /** Replaces the Retake and Use photo buttons. `PhotoCapture.Confirm` must stay inside. */\n children?: ReactNode\n }\n>\n\n/**\n * The photo in `ImageCropper`, locked to the flow's ratio and shape, with\n * its zoom, rotate and flip controls, then Retake and Use photo. Taking the\n * photo and cropping it are one step: there's no review screen between.\n */\nconst PhotoCaptureCrop = ({\n className,\n classNames,\n testId,\n children,\n asChild: _asChild,\n ...rest\n}: PhotoCaptureCropProps) => {\n const { flow, t, translations, shape, color } = usePhotoCaptureContext()\n // One URL per photo, which is also the cropper's key: a new photo starts a new crop.\n const url = useObjectUrl(flow.photo)\n\n if (flow.step !== \"crop\" || !url) return null\n return (\n <ImageCropper.Root\n key={url}\n ratio={shape === \"circle\" ? 1 : flow.ratio}\n shape={shape}\n color={color}\n translations={translations}\n data-part=\"crop\"\n className={className}\n testId={testId}\n {...rest}\n >\n <ImageCropper.Viewport className={classNames?.viewport}>\n <ImageCropper.Image src={url} />\n <ImageCropper.Selection />\n </ImageCropper.Viewport>\n <ImageCropper.Controls className={classNames?.controls} />\n {flow.failed && (\n <p role=\"alert\" className={cn(TEXT_COLOR_CLASSES.error, \"text-sm\")}>\n {t.failed}\n </p>\n )}\n <div className={cn(\"flex flex-wrap items-center justify-end gap-2\", classNames?.actions)}>\n {children ?? (\n <>\n <PhotoCaptureRetake />\n <PhotoCaptureConfirm />\n </>\n )}\n </div>\n </ImageCropper.Root>\n )\n}\n\n// ---------------------------------------------------------------------------\n// Convenience\n// ---------------------------------------------------------------------------\n\nexport type PhotoCaptureClassNames = {\n source?: string\n live?: string\n viewfinder?: string\n crop?: string\n viewport?: string\n controls?: string\n actions?: string\n}\n\nexport type PhotoCaptureProps = NoAsChild<\n Omit<PhotoCaptureRootProps, \"flow\" | \"children\"> &\n UsePhotoCaptureOptions & {\n classNames?: PhotoCaptureClassNames\n }\n>\n\nconst PhotoCaptureComponent = ({\n onChange,\n camera,\n facing,\n ratio,\n resolution,\n mirror,\n output,\n classNames,\n asChild: _asChild,\n ...rest\n}: PhotoCaptureProps) => {\n const flow = usePhotoCapture({ onChange, camera, facing, ratio, resolution, mirror, output })\n return (\n <PhotoCaptureRoot flow={flow} {...rest}>\n <PhotoCaptureSource className={classNames?.source} />\n <PhotoCaptureLive\n className={classNames?.live}\n classNames={{ viewfinder: classNames?.viewfinder, controls: classNames?.controls }}\n />\n <PhotoCaptureCrop\n className={classNames?.crop}\n classNames={{\n viewport: classNames?.viewport,\n controls: classNames?.controls,\n actions: classNames?.actions,\n }}\n />\n </PhotoCaptureRoot>\n )\n}\n\nexport const PhotoCapture = Object.assign(PhotoCaptureComponent, {\n Root: PhotoCaptureRoot,\n Source: PhotoCaptureSource,\n Live: PhotoCaptureLive,\n Crop: PhotoCaptureCrop,\n Take: PhotoCaptureTake,\n File: PhotoCaptureFile,\n Retake: PhotoCaptureRetake,\n Confirm: PhotoCaptureConfirm,\n})\n"]}
|