@fragiola/primitives-react 0.0.0-stage → 0.0.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/LICENSE +21 -0
- package/README.md +38 -2
- package/dist/accordion--E-5hjWo.js +210 -0
- package/dist/accordion--E-5hjWo.js.map +1 -0
- package/dist/accordion.d.ts +4 -0
- package/dist/accordion.js +1 -0
- package/dist/alert-dialog-7FIAj98B.js +37 -0
- package/dist/alert-dialog-7FIAj98B.js.map +1 -0
- package/dist/alert-dialog.d.ts +9 -0
- package/dist/alert-dialog.js +1 -0
- package/dist/aspect-ratio-CUADsevg.js +19 -0
- package/dist/aspect-ratio-CUADsevg.js.map +1 -0
- package/dist/aspect-ratio.d.ts +3 -0
- package/dist/aspect-ratio.js +1 -0
- package/dist/async-list-7ljWFMgA.js +35 -0
- package/dist/async-list-7ljWFMgA.js.map +1 -0
- package/dist/async-list.d.ts +2 -0
- package/dist/async-list.js +1 -0
- package/dist/autocomplete-virtual-BE8dDDgU.js +56 -0
- package/dist/autocomplete-virtual-BE8dDDgU.js.map +1 -0
- package/dist/autocomplete-virtual.d.ts +4 -0
- package/dist/autocomplete-virtual.js +3 -0
- package/dist/autocomplete.d.ts +9 -0
- package/dist/autocomplete.js +1 -0
- package/dist/avatar-CABjoLs9.js +101 -0
- package/dist/avatar-CABjoLs9.js.map +1 -0
- package/dist/avatar.d.ts +3 -0
- package/dist/avatar.js +1 -0
- package/dist/breadcrumbs-nG0Rq3kX.js +69 -0
- package/dist/breadcrumbs-nG0Rq3kX.js.map +1 -0
- package/dist/breadcrumbs.d.ts +3 -0
- package/dist/breadcrumbs.js +1 -0
- package/dist/button-B6h8UkhR.js +30 -0
- package/dist/button-B6h8UkhR.js.map +1 -0
- package/dist/button-props-DWfy1ZSo.js +69 -0
- package/dist/button-props-DWfy1ZSo.js.map +1 -0
- package/dist/button.d.ts +3 -0
- package/dist/button.js +1 -0
- package/dist/calendar-preset-Cs-hy-_0.js +70 -0
- package/dist/calendar-preset-Cs-hy-_0.js.map +1 -0
- package/dist/calendar-preset.d.ts +4 -0
- package/dist/calendar-preset.js +3 -0
- package/dist/calendar-root-base-CIkiSebb.js +515 -0
- package/dist/calendar-root-base-CIkiSebb.js.map +1 -0
- package/dist/calendar-row-BO5kyOgq.d.ts +84 -0
- package/dist/calendar-value-DCOjO7og.d.ts +23 -0
- package/dist/calendar-view-DT9i5Xg_.js +157 -0
- package/dist/calendar-view-DT9i5Xg_.js.map +1 -0
- package/dist/calendar-view.d.ts +6 -0
- package/dist/calendar-view.js +4 -0
- package/dist/calendar.d.ts +7 -0
- package/dist/calendar.js +1 -0
- package/dist/carousel-ClQsQ135.js +436 -0
- package/dist/carousel-ClQsQ135.js.map +1 -0
- package/dist/carousel.d.ts +4 -0
- package/dist/carousel.js +1 -0
- package/dist/cascade-select-DZlpKUok.js +582 -0
- package/dist/cascade-select-DZlpKUok.js.map +1 -0
- package/dist/cascade-select.d.ts +7 -0
- package/dist/cascade-select.js +1 -0
- package/dist/change-details-CPSkPCNw.d.ts +32 -0
- package/dist/checkbox-CbmkKNfv.js +165 -0
- package/dist/checkbox-CbmkKNfv.js.map +1 -0
- package/dist/checkbox-group-_UrFCUgQ.js +99 -0
- package/dist/checkbox-group-_UrFCUgQ.js.map +1 -0
- package/dist/checkbox-group-context-CoGqgxBM.js +6 -0
- package/dist/checkbox-group-context-CoGqgxBM.js.map +1 -0
- package/dist/checkbox-group.d.ts +4 -0
- package/dist/checkbox-group.js +1 -0
- package/dist/checkbox.d.ts +4 -0
- package/dist/checkbox.js +1 -0
- package/dist/clipboard-CvgO1qhh.js +189 -0
- package/dist/clipboard-CvgO1qhh.js.map +1 -0
- package/dist/clipboard.d.ts +4 -0
- package/dist/clipboard.js +1 -0
- package/dist/collapsible-Dh0TUP6l.js +112 -0
- package/dist/collapsible-Dh0TUP6l.js.map +1 -0
- package/dist/collapsible.d.ts +4 -0
- package/dist/collapsible.js +1 -0
- package/dist/color-area-BGo6tZxX.js +311 -0
- package/dist/color-area-BGo6tZxX.js.map +1 -0
- package/dist/color-area.d.ts +4 -0
- package/dist/color-area.js +1 -0
- package/dist/color-field-B9QEKyQ1.js +334 -0
- package/dist/color-field-B9QEKyQ1.js.map +1 -0
- package/dist/color-field.d.ts +4 -0
- package/dist/color-field.js +1 -0
- package/dist/color-picker-BNOtqWUK.js +276 -0
- package/dist/color-picker-BNOtqWUK.js.map +1 -0
- package/dist/color-picker-binding-D9xBS_my.js +6 -0
- package/dist/color-picker-binding-D9xBS_my.js.map +1 -0
- package/dist/color-picker-popover-CV_wP6KG.js +195 -0
- package/dist/color-picker-popover-CV_wP6KG.js.map +1 -0
- package/dist/color-picker-popover.d.ts +7 -0
- package/dist/color-picker-popover.js +1 -0
- package/dist/color-picker.d.ts +4 -0
- package/dist/color-picker.js +1 -0
- package/dist/color-slider-Bw940FJr.js +357 -0
- package/dist/color-slider-Bw940FJr.js.map +1 -0
- package/dist/color-slider.d.ts +4 -0
- package/dist/color-slider.js +1 -0
- package/dist/color-swatch-C9ws0xF4.js +37 -0
- package/dist/color-swatch-C9ws0xF4.js.map +1 -0
- package/dist/color-swatch-picker-CnmTr1SY.js +286 -0
- package/dist/color-swatch-picker-CnmTr1SY.js.map +1 -0
- package/dist/color-swatch-picker.d.ts +4 -0
- package/dist/color-swatch-picker.js +1 -0
- package/dist/color-swatch.d.ts +3 -0
- package/dist/color-swatch.js +1 -0
- package/dist/color-wheel--n8w5fIJ.js +247 -0
- package/dist/color-wheel--n8w5fIJ.js.map +1 -0
- package/dist/color-wheel.d.ts +4 -0
- package/dist/color-wheel.js +1 -0
- package/dist/combobox-virtual-BI-l10BE.js +61 -0
- package/dist/combobox-virtual-BI-l10BE.js.map +1 -0
- package/dist/combobox-virtual.d.ts +4 -0
- package/dist/combobox-virtual.js +3 -0
- package/dist/combobox.d.ts +9 -0
- package/dist/combobox.js +1 -0
- package/dist/command-virtual-CxNLxsih.js +56 -0
- package/dist/command-virtual-CxNLxsih.js.map +1 -0
- package/dist/command-virtual.d.ts +4 -0
- package/dist/command-virtual.js +3 -0
- package/dist/command.d.ts +5 -0
- package/dist/command.js +1 -0
- package/dist/context-menu-DGj2L-Sv.js +131 -0
- package/dist/context-menu-DGj2L-Sv.js.map +1 -0
- package/dist/context-menu.d.ts +8 -0
- package/dist/context-menu.js +1 -0
- package/dist/date-field-C1nhThPd.js +33 -0
- package/dist/date-field-C1nhThPd.js.map +1 -0
- package/dist/date-field-root-CzSo5iKL.d.ts +26 -0
- package/dist/date-field-root-base-B-050SUC.js +185 -0
- package/dist/date-field-root-base-B-050SUC.js.map +1 -0
- package/dist/date-field-segment-BoS-ohDh.d.ts +67 -0
- package/dist/date-field.d.ts +6 -0
- package/dist/date-field.js +1 -0
- package/dist/date-picker-input-BCaKff7A.js +29 -0
- package/dist/date-picker-input-BCaKff7A.js.map +1 -0
- package/dist/date-picker-input-root-base-Cc3mE-NR.d.ts +17 -0
- package/dist/date-picker-input-root-base-D4VaBnpf.js +361 -0
- package/dist/date-picker-input-root-base-D4VaBnpf.js.map +1 -0
- package/dist/date-picker-input.d.ts +7 -0
- package/dist/date-picker-input.js +3 -0
- package/dist/date-picker-trigger-BKPvZbRg.js +304 -0
- package/dist/date-picker-trigger-BKPvZbRg.js.map +1 -0
- package/dist/date-picker-trigger-DHsAhBf2.d.ts +51 -0
- package/dist/date-picker.d.ts +11 -0
- package/dist/date-picker.js +1 -0
- package/dist/date-range-field-C-ID01oa.js +34 -0
- package/dist/date-range-field-C-ID01oa.js.map +1 -0
- package/dist/date-range-field-input-BkLpldTx.js +33 -0
- package/dist/date-range-field-input-BkLpldTx.js.map +1 -0
- package/dist/date-range-field-input-BwCNo15l.d.ts +13 -0
- package/dist/date-range-field-root-CmZ3c7xn.d.ts +31 -0
- package/dist/date-range-field-root-base-DWH3nqmz.d.ts +23 -0
- package/dist/date-range-field-root-base-z8S5aSCs.js +261 -0
- package/dist/date-range-field-root-base-z8S5aSCs.js.map +1 -0
- package/dist/date-range-field.d.ts +9 -0
- package/dist/date-range-field.js +1 -0
- package/dist/date-range-picker-input-DlIdTD-J.js +30 -0
- package/dist/date-range-picker-input-DlIdTD-J.js.map +1 -0
- package/dist/date-range-picker-input.d.ts +10 -0
- package/dist/date-range-picker-input.js +3 -0
- package/dist/date-range-picker.d.ts +11 -0
- package/dist/date-range-picker.js +1 -0
- package/dist/dialog-DDE15qBB.js +33 -0
- package/dist/dialog-DDE15qBB.js.map +1 -0
- package/dist/dialog-root-base-DDMrqDC9.js +328 -0
- package/dist/dialog-root-base-DDMrqDC9.js.map +1 -0
- package/dist/dialog-title-BitK2i0A.d.ts +78 -0
- package/dist/dialog.d.ts +9 -0
- package/dist/dialog.js +1 -0
- package/dist/direction-BfW1BOg1.js +22 -0
- package/dist/direction-BfW1BOg1.js.map +1 -0
- package/dist/direction-context-CiRdNJmu.js +11 -0
- package/dist/direction-context-CiRdNJmu.js.map +1 -0
- package/dist/direction.d.ts +2 -0
- package/dist/direction.js +1 -0
- package/dist/drawer-CaPOhMl-.js +302 -0
- package/dist/drawer-CaPOhMl-.js.map +1 -0
- package/dist/drawer.d.ts +9 -0
- package/dist/drawer.js +1 -0
- package/dist/drop-zone-q0-5u2cs.js +86 -0
- package/dist/drop-zone-q0-5u2cs.js.map +1 -0
- package/dist/drop-zone.d.ts +4 -0
- package/dist/drop-zone.js +1 -0
- package/dist/editable-vU6vYZOD.js +403 -0
- package/dist/editable-vU6vYZOD.js.map +1 -0
- package/dist/editable.d.ts +4 -0
- package/dist/editable.js +1 -0
- package/dist/field-DibhXWF6.js +308 -0
- package/dist/field-DibhXWF6.js.map +1 -0
- package/dist/field.d.ts +4 -0
- package/dist/field.js +1 -0
- package/dist/fieldset-Cz80P2jc.js +53 -0
- package/dist/fieldset-Cz80P2jc.js.map +1 -0
- package/dist/fieldset-context-CeaxEBvi.js +6 -0
- package/dist/fieldset-context-CeaxEBvi.js.map +1 -0
- package/dist/fieldset.d.ts +3 -0
- package/dist/fieldset.js +1 -0
- package/dist/file-upload-BIRibICU.js +513 -0
- package/dist/file-upload-BIRibICU.js.map +1 -0
- package/dist/file-upload.d.ts +4 -0
- package/dist/file-upload.js +1 -0
- package/dist/form-DNAaFPpL.js +87 -0
- package/dist/form-DNAaFPpL.js.map +1 -0
- package/dist/form-context-BW-nK6kl.js +6 -0
- package/dist/form-context-BW-nK6kl.js.map +1 -0
- package/dist/form.d.ts +3 -0
- package/dist/form.js +1 -0
- package/dist/hover-card-CRDpA_zU.js +317 -0
- package/dist/hover-card-CRDpA_zU.js.map +1 -0
- package/dist/hover-card.d.ts +9 -0
- package/dist/hover-card.js +1 -0
- package/dist/index-0bXL0iXX.d.ts +25 -0
- package/dist/index-6f2s5HfF.d.ts +30 -0
- package/dist/index-9WYWziGt.d.ts +42 -0
- package/dist/index-B57uQVXT.d.ts +100 -0
- package/dist/index-BA629roy.d.ts +52 -0
- package/dist/index-BC5bS-vC.d.ts +30 -0
- package/dist/index-BDbTYsJR.d.ts +77 -0
- package/dist/index-BEaxabvv.d.ts +80 -0
- package/dist/index-BLRo_PJD.d.ts +58 -0
- package/dist/index-BMt816ZL.d.ts +51 -0
- package/dist/index-BQJrDd_G.d.ts +108 -0
- package/dist/index-BUJIeLCT.d.ts +37 -0
- package/dist/index-BZxd4oqB.d.ts +111 -0
- package/dist/index-B_JVgpGe.d.ts +13 -0
- package/dist/index-BdxleDV0.d.ts +104 -0
- package/dist/index-Be4w9GAc.d.ts +13 -0
- package/dist/index-Bht8ohW3.d.ts +31 -0
- package/dist/index-Bk1NBvxD.d.ts +75 -0
- package/dist/index-BmtcAsQr.d.ts +44 -0
- package/dist/index-BmuEv-h3.d.ts +35 -0
- package/dist/index-BnPLIkKG.d.ts +31 -0
- package/dist/index-BoJU86K5.d.ts +52 -0
- package/dist/index-Bq6yByLv.d.ts +50 -0
- package/dist/index-Bqt2th2p.d.ts +41 -0
- package/dist/index-BrXfSGo2.d.ts +51 -0
- package/dist/index-BsvcTJ_x.d.ts +17 -0
- package/dist/index-BxcCz-NS.d.ts +36 -0
- package/dist/index-C3y4g2fs.d.ts +21 -0
- package/dist/index-C8-b81Jh.d.ts +20 -0
- package/dist/index-C8KLM25T.d.ts +31 -0
- package/dist/index-C9TSddnB.d.ts +140 -0
- package/dist/index-CCnaczzE.d.ts +32 -0
- package/dist/index-CD6hgnl1.d.ts +86 -0
- package/dist/index-CEN3o4Pw.d.ts +35 -0
- package/dist/index-CFlhfs3y.d.ts +30 -0
- package/dist/index-CIQU06ga.d.ts +36 -0
- package/dist/index-CNUEsZ_M.d.ts +51 -0
- package/dist/index-CNYBtgVC.d.ts +53 -0
- package/dist/index-CQJHcuzo.d.ts +76 -0
- package/dist/index-CTw9ONha.d.ts +69 -0
- package/dist/index-CU9QnAha.d.ts +32 -0
- package/dist/index-CcwKZWPY.d.ts +92 -0
- package/dist/index-Cjl7RT2o.d.ts +17 -0
- package/dist/index-ClfKp-sZ.d.ts +21 -0
- package/dist/index-CqGIxPDB.d.ts +82 -0
- package/dist/index-CsXJJ0G8.d.ts +41 -0
- package/dist/index-Cyjcq7lp.d.ts +28 -0
- package/dist/index-CzB9dDcM.d.ts +22 -0
- package/dist/index-D1-zqp2Q.d.ts +44 -0
- package/dist/index-D59OFWyx.d.ts +53 -0
- package/dist/index-D9lx4wAU.d.ts +21 -0
- package/dist/index-DHrnPQEE.d.ts +128 -0
- package/dist/index-DHwyHITu.d.ts +131 -0
- package/dist/index-DQ68aV2P.d.ts +21 -0
- package/dist/index-DQAkgf9_.d.ts +14 -0
- package/dist/index-DRow1231.d.ts +31 -0
- package/dist/index-DTGZeJU7.d.ts +29 -0
- package/dist/index-DU7jtvI8.d.ts +24 -0
- package/dist/index-DVjhOpXu.d.ts +42 -0
- package/dist/index-DZoqbcd6.d.ts +26 -0
- package/dist/index-Da0eVQHO.d.ts +62 -0
- package/dist/index-DhNPJa6U.d.ts +31 -0
- package/dist/index-DnQAamhU.d.ts +27 -0
- package/dist/index-DoFrs7Az.d.ts +16 -0
- package/dist/index-DorcIjVk.d.ts +20 -0
- package/dist/index-Dx-yMTdt.d.ts +81 -0
- package/dist/index-J4LbimqY.d.ts +79 -0
- package/dist/index-L6Mp2njJ.d.ts +81 -0
- package/dist/index-OmXQjsNi.d.ts +37 -0
- package/dist/index-PpCPWRbt.d.ts +30 -0
- package/dist/index-Pq-ztBxR.d.ts +34 -0
- package/dist/index-Qgz-Dnsj.d.ts +73 -0
- package/dist/index-R3h8-VcD.d.ts +32 -0
- package/dist/index-WtAHbmtb.d.ts +88 -0
- package/dist/index-dKoYaA3K.d.ts +38 -0
- package/dist/index-fgqEotIa.d.ts +16 -0
- package/dist/index-gvpnQy8T.d.ts +87 -0
- package/dist/index-kY3Yo50q.d.ts +68 -0
- package/dist/index-ndFpL4W9.d.ts +15 -0
- package/dist/index-oLgwTyCz.d.ts +45 -0
- package/dist/index-pSrGVYre.d.ts +40 -0
- package/dist/index-t4CBZJDG.d.ts +65 -0
- package/dist/index-wC8PY0fW.d.ts +16 -0
- package/dist/index-wv0Lafz4.d.ts +46 -0
- package/dist/index-zEeZUMLc.d.ts +29 -0
- package/dist/index.d.ts +125 -0
- package/dist/index.js +104 -0
- package/dist/label-DN9tJMXl.js +24 -0
- package/dist/label-DN9tJMXl.js.map +1 -0
- package/dist/label.d.ts +3 -0
- package/dist/label.js +1 -0
- package/dist/link-D3xYrfPK.js +22 -0
- package/dist/link-D3xYrfPK.js.map +1 -0
- package/dist/link-props-Shu8RU_5.js +27 -0
- package/dist/link-props-Shu8RU_5.js.map +1 -0
- package/dist/link.d.ts +3 -0
- package/dist/link.js +1 -0
- package/dist/listbox-virtual-C4wz3TOa.js +281 -0
- package/dist/listbox-virtual-C4wz3TOa.js.map +1 -0
- package/dist/listbox-virtual.d.ts +6 -0
- package/dist/listbox-virtual.js +3 -0
- package/dist/listbox.d.ts +5 -0
- package/dist/listbox.js +1 -0
- package/dist/live-region-style-Xgiu9ttw.js +48 -0
- package/dist/live-region-style-Xgiu9ttw.js.map +1 -0
- package/dist/menu-bar-context-1duNlOWo.js +14 -0
- package/dist/menu-bar-context-1duNlOWo.js.map +1 -0
- package/dist/menu-oZj27rvf.js +123 -0
- package/dist/menu-oZj27rvf.js.map +1 -0
- package/dist/menu-separator-CzAc4jM8.d.ts +143 -0
- package/dist/menu-submenu-trigger-BykOQORL.js +672 -0
- package/dist/menu-submenu-trigger-BykOQORL.js.map +1 -0
- package/dist/menu.d.ts +10 -0
- package/dist/menu.js +1 -0
- package/dist/menubar-wjJF54GJ.js +213 -0
- package/dist/menubar-wjJF54GJ.js.map +1 -0
- package/dist/menubar.d.ts +3 -0
- package/dist/menubar.js +1 -0
- package/dist/meter-11PgO99t.js +120 -0
- package/dist/meter-11PgO99t.js.map +1 -0
- package/dist/meter.d.ts +3 -0
- package/dist/meter.js +1 -0
- package/dist/month-calendar-value-CNJcsqcv.d.ts +5 -0
- package/dist/month-calendar-value-D_au-Kbz.js +35 -0
- package/dist/month-calendar-value-D_au-Kbz.js.map +1 -0
- package/dist/month-calendar.d.ts +6 -0
- package/dist/month-calendar.js +1 -0
- package/dist/month-picker-DFjFvjo9.js +26 -0
- package/dist/month-picker-DFjFvjo9.js.map +1 -0
- package/dist/month-picker-root-base-CI7jcllI.js +162 -0
- package/dist/month-picker-root-base-CI7jcllI.js.map +1 -0
- package/dist/month-picker-root-base-SELhczoy.d.ts +28 -0
- package/dist/month-picker.d.ts +10 -0
- package/dist/month-picker.js +3 -0
- package/dist/month-range-calendar-BmnWB6OD.js +28 -0
- package/dist/month-range-calendar-BmnWB6OD.js.map +1 -0
- package/dist/month-range-calendar.d.ts +6 -0
- package/dist/month-range-calendar.js +3 -0
- package/dist/month-range-picker-TfMtxi2X.js +26 -0
- package/dist/month-range-picker-TfMtxi2X.js.map +1 -0
- package/dist/month-range-picker.d.ts +10 -0
- package/dist/month-range-picker.js +3 -0
- package/dist/multiple-calendar-EBsuTzYQ.js +133 -0
- package/dist/multiple-calendar-EBsuTzYQ.js.map +1 -0
- package/dist/multiple-calendar.d.ts +7 -0
- package/dist/multiple-calendar.js +3 -0
- package/dist/navigation-menu-82shSjXS.js +660 -0
- package/dist/navigation-menu-82shSjXS.js.map +1 -0
- package/dist/navigation-menu.d.ts +5 -0
- package/dist/navigation-menu.js +1 -0
- package/dist/number-field-BUNkL15K.js +491 -0
- package/dist/number-field-BUNkL15K.js.map +1 -0
- package/dist/number-field.d.ts +4 -0
- package/dist/number-field.js +1 -0
- package/dist/otp-field-BMKBhv0O.js +363 -0
- package/dist/otp-field-BMKBhv0O.js.map +1 -0
- package/dist/otp-field.d.ts +4 -0
- package/dist/otp-field.js +1 -0
- package/dist/overlay-handle-DOyqO4oY.js +62 -0
- package/dist/overlay-handle-DOyqO4oY.js.map +1 -0
- package/dist/overlay-handle-DzzlzKqP.d.ts +16 -0
- package/dist/pagination-CMWaQSpr.js +173 -0
- package/dist/pagination-CMWaQSpr.js.map +1 -0
- package/dist/pagination.d.ts +4 -0
- package/dist/pagination.js +1 -0
- package/dist/parts-B2E7RN77.d.ts +170 -0
- package/dist/parts-BHkvkEgf.js +485 -0
- package/dist/parts-BHkvkEgf.js.map +1 -0
- package/dist/parts-BJ94V7Kv.d.ts +24 -0
- package/dist/parts-BL0sXepP.d.ts +101 -0
- package/dist/parts-BjC20sfl.d.ts +19 -0
- package/dist/parts-BnbJ2FWv.d.ts +81 -0
- package/dist/parts-C688_OLH.js +24 -0
- package/dist/parts-C688_OLH.js.map +1 -0
- package/dist/parts-C81p8gpg.d.ts +147 -0
- package/dist/parts-CDVlldST.js +721 -0
- package/dist/parts-CDVlldST.js.map +1 -0
- package/dist/parts-CNp1lOIU.js +24 -0
- package/dist/parts-CNp1lOIU.js.map +1 -0
- package/dist/parts-CXjEfLf7.d.ts +125 -0
- package/dist/parts-CrriPiIL.js +29 -0
- package/dist/parts-CrriPiIL.js.map +1 -0
- package/dist/parts-DVNSEjIO.d.ts +19 -0
- package/dist/parts-DmQ9WqOP.js +512 -0
- package/dist/parts-DmQ9WqOP.js.map +1 -0
- package/dist/parts-DoQQN1Io.d.ts +96 -0
- package/dist/parts-VT0Ohb06.js +806 -0
- package/dist/parts-VT0Ohb06.js.map +1 -0
- package/dist/parts-XRa0gd47.js +350 -0
- package/dist/parts-XRa0gd47.js.map +1 -0
- package/dist/parts-_ZriSS4p.js +376 -0
- package/dist/parts-_ZriSS4p.js.map +1 -0
- package/dist/password-input-BQAySlmc.js +212 -0
- package/dist/password-input-BQAySlmc.js.map +1 -0
- package/dist/password-input.d.ts +4 -0
- package/dist/password-input.js +1 -0
- package/dist/picker-binding-context-7ci59zS0.js +22 -0
- package/dist/picker-binding-context-7ci59zS0.js.map +1 -0
- package/dist/popover-C5UaRJpT.js +295 -0
- package/dist/popover-C5UaRJpT.js.map +1 -0
- package/dist/popover.d.ts +9 -0
- package/dist/popover.js +1 -0
- package/dist/progress-2d64jFqb.js +141 -0
- package/dist/progress-2d64jFqb.js.map +1 -0
- package/dist/progress.d.ts +3 -0
- package/dist/progress.js +1 -0
- package/dist/radio-Mvw36nnF.js +128 -0
- package/dist/radio-Mvw36nnF.js.map +1 -0
- package/dist/radio-group-D7DchtVK.js +149 -0
- package/dist/radio-group-D7DchtVK.js.map +1 -0
- package/dist/radio-group-context-DRe2PyiF.js +6 -0
- package/dist/radio-group-context-DRe2PyiF.js.map +1 -0
- package/dist/radio-group.d.ts +4 -0
- package/dist/radio-group.js +1 -0
- package/dist/radio.d.ts +3 -0
- package/dist/radio.js +1 -0
- package/dist/range-calendar-BMxPzzAr.js +32 -0
- package/dist/range-calendar-BMxPzzAr.js.map +1 -0
- package/dist/range-calendar.d.ts +6 -0
- package/dist/range-calendar.js +1 -0
- package/dist/rating-DQdIL_nz.js +303 -0
- package/dist/rating-DQdIL_nz.js.map +1 -0
- package/dist/rating.d.ts +4 -0
- package/dist/rating.js +1 -0
- package/dist/render-C7XnxB7f.js +40 -0
- package/dist/render-C7XnxB7f.js.map +1 -0
- package/dist/render-element-DXbUbfgN.js +66 -0
- package/dist/render-element-DXbUbfgN.js.map +1 -0
- package/dist/render-element-Pwuv2wsL.d.ts +13 -0
- package/dist/render.d.ts +3 -0
- package/dist/render.js +1 -0
- package/dist/roving-context-BVp0I9UN.js +16 -0
- package/dist/roving-context-BVp0I9UN.js.map +1 -0
- package/dist/scroll-area-CGaVLKik.js +274 -0
- package/dist/scroll-area-CGaVLKik.js.map +1 -0
- package/dist/scroll-area.d.ts +3 -0
- package/dist/scroll-area.js +1 -0
- package/dist/search-field-DqGQt6pC.js +207 -0
- package/dist/search-field-DqGQt6pC.js.map +1 -0
- package/dist/search-field.d.ts +4 -0
- package/dist/search-field.js +1 -0
- package/dist/segmented-control-BYrnLASo.js +316 -0
- package/dist/segmented-control-BYrnLASo.js.map +1 -0
- package/dist/segmented-control.d.ts +4 -0
- package/dist/segmented-control.js +1 -0
- package/dist/select-virtual-9vDaEiye.js +55 -0
- package/dist/select-virtual-9vDaEiye.js.map +1 -0
- package/dist/select-virtual.d.ts +4 -0
- package/dist/select-virtual.js +3 -0
- package/dist/select.d.ts +8 -0
- package/dist/select.js +1 -0
- package/dist/separator-ChAJks2Q.js +18 -0
- package/dist/separator-ChAJks2Q.js.map +1 -0
- package/dist/separator.d.ts +3 -0
- package/dist/separator.js +1 -0
- package/dist/slider-DZiqQ18C.js +437 -0
- package/dist/slider-DZiqQ18C.js.map +1 -0
- package/dist/slider.d.ts +4 -0
- package/dist/slider.js +1 -0
- package/dist/state-attributes-DhboDeMS.js +14 -0
- package/dist/state-attributes-DhboDeMS.js.map +1 -0
- package/dist/steps-t_FxFH9P.js +251 -0
- package/dist/steps-t_FxFH9P.js.map +1 -0
- package/dist/steps.d.ts +4 -0
- package/dist/steps.js +1 -0
- package/dist/switch-D3zj8gtg.js +137 -0
- package/dist/switch-D3zj8gtg.js.map +1 -0
- package/dist/switch.d.ts +4 -0
- package/dist/switch.js +1 -0
- package/dist/tabs-o83wz1hF.js +285 -0
- package/dist/tabs-o83wz1hF.js.map +1 -0
- package/dist/tabs.d.ts +4 -0
- package/dist/tabs.js +1 -0
- package/dist/tag-group-gmBdCkE4.js +354 -0
- package/dist/tag-group-gmBdCkE4.js.map +1 -0
- package/dist/tag-group.d.ts +4 -0
- package/dist/tag-group.js +1 -0
- package/dist/tags-input-Co9pI732.js +555 -0
- package/dist/tags-input-Co9pI732.js.map +1 -0
- package/dist/tags-input.d.ts +4 -0
- package/dist/tags-input.js +1 -0
- package/dist/time-field-qqgemJB1.js +35 -0
- package/dist/time-field-qqgemJB1.js.map +1 -0
- package/dist/time-field.d.ts +5 -0
- package/dist/time-field.js +1 -0
- package/dist/time-range-field-BurnJee0.js +36 -0
- package/dist/time-range-field-BurnJee0.js.map +1 -0
- package/dist/time-range-field.d.ts +7 -0
- package/dist/time-range-field.js +1 -0
- package/dist/toast-ChdTo_Md.js +341 -0
- package/dist/toast-ChdTo_Md.js.map +1 -0
- package/dist/toast.d.ts +4 -0
- package/dist/toast.js +1 -0
- package/dist/toggle-W5tihPuD.js +65 -0
- package/dist/toggle-W5tihPuD.js.map +1 -0
- package/dist/toggle-group-DpJ794rw.js +73 -0
- package/dist/toggle-group-DpJ794rw.js.map +1 -0
- package/dist/toggle-group-context-Bp44l1NR.js +6 -0
- package/dist/toggle-group-context-Bp44l1NR.js.map +1 -0
- package/dist/toggle-group.d.ts +4 -0
- package/dist/toggle-group.js +1 -0
- package/dist/toggle.d.ts +4 -0
- package/dist/toggle.js +1 -0
- package/dist/toolbar-DfjePeEZ.js +178 -0
- package/dist/toolbar-DfjePeEZ.js.map +1 -0
- package/dist/toolbar.d.ts +3 -0
- package/dist/toolbar.js +1 -0
- package/dist/tooltip-CqZtSspz.js +320 -0
- package/dist/tooltip-CqZtSspz.js.map +1 -0
- package/dist/tooltip.d.ts +9 -0
- package/dist/tooltip.js +1 -0
- package/dist/use-color-picker-binding-D0R-FsfF.js +17 -0
- package/dist/use-color-picker-binding-D0R-FsfF.js.map +1 -0
- package/dist/use-controllable-state-Dm8eNkgP.js +36 -0
- package/dist/use-controllable-state-Dm8eNkgP.js.map +1 -0
- package/dist/use-element-tpFZ-kuA.js +10 -0
- package/dist/use-element-tpFZ-kuA.js.map +1 -0
- package/dist/use-field-control-CL_nOU7T.js +131 -0
- package/dist/use-field-control-CL_nOU7T.js.map +1 -0
- package/dist/use-overlay-portal-Cfv6qtTO.js +18 -0
- package/dist/use-overlay-portal-Cfv6qtTO.js.map +1 -0
- package/dist/use-overlay-portal-D8GjZ-m7.d.ts +13 -0
- package/dist/use-overlay-root-BDO5E_0S.d.ts +23 -0
- package/dist/use-overlay-root-eXuUlCpV.js +225 -0
- package/dist/use-overlay-root-eXuUlCpV.js.map +1 -0
- package/dist/use-overlay-trigger-CxW1Z6Q6.js +74 -0
- package/dist/use-overlay-trigger-CxW1Z6Q6.js.map +1 -0
- package/dist/use-overlay-trigger-PP99t2ZF.d.ts +11 -0
- package/dist/use-panel-transition-CKMdsqPR.js +145 -0
- package/dist/use-panel-transition-CKMdsqPR.js.map +1 -0
- package/dist/use-positioner-BpxM4U5Y.d.ts +11 -0
- package/dist/use-positioner-DtJR980s.js +56 -0
- package/dist/use-positioner-DtJR980s.js.map +1 -0
- package/dist/use-presence-Cwi_UTLe.js +97 -0
- package/dist/use-presence-Cwi_UTLe.js.map +1 -0
- package/dist/use-required-context-Cjd_CYnv.js +11 -0
- package/dist/use-required-context-Cjd_CYnv.js.map +1 -0
- package/dist/use-roving-composite-D0vtGxm8.js +82 -0
- package/dist/use-roving-composite-D0vtGxm8.js.map +1 -0
- package/dist/use-roving-item-Dxe3phsZ.js +42 -0
- package/dist/use-roving-item-Dxe3phsZ.js.map +1 -0
- package/dist/use-segment-group--unFuh-Z.js +307 -0
- package/dist/use-segment-group--unFuh-Z.js.map +1 -0
- package/dist/use-virtual-rows-B5N0qgmT.js +99 -0
- package/dist/use-virtual-rows-B5N0qgmT.js.map +1 -0
- package/dist/use-virtual-rows-BQFqR0_e.d.ts +16 -0
- package/dist/year-calendar-CroBMFMN.js +28 -0
- package/dist/year-calendar-CroBMFMN.js.map +1 -0
- package/dist/year-calendar.d.ts +6 -0
- package/dist/year-calendar.js +3 -0
- package/dist/year-picker-DJVxXtPh.js +26 -0
- package/dist/year-picker-DJVxXtPh.js.map +1 -0
- package/dist/year-picker.d.ts +10 -0
- package/dist/year-picker.js +3 -0
- package/dist/year-range-calendar-Cz2WYDV2.js +28 -0
- package/dist/year-range-calendar-Cz2WYDV2.js.map +1 -0
- package/dist/year-range-calendar.d.ts +6 -0
- package/dist/year-range-calendar.js +3 -0
- package/dist/year-range-picker-9f7L5Hgx.js +26 -0
- package/dist/year-range-picker-9f7L5Hgx.js.map +1 -0
- package/dist/year-range-picker.d.ts +10 -0
- package/dist/year-range-picker.js +3 -0
- package/package.json +553 -3
|
@@ -0,0 +1,513 @@
|
|
|
1
|
+
import { t as useRequiredContext } from "./use-required-context-Cjd_CYnv.js";
|
|
2
|
+
import { n as mergeRefs, t as renderElement } from "./render-element-DXbUbfgN.js";
|
|
3
|
+
import { t as useElement } from "./use-element-tpFZ-kuA.js";
|
|
4
|
+
import { n as useFileDropTarget, t as LIVE_REGION_STYLE } from "./live-region-style-Xgiu9ttw.js";
|
|
5
|
+
import { t as stateAttributes } from "./state-attributes-DhboDeMS.js";
|
|
6
|
+
import { t as useControllableState } from "./use-controllable-state-Dm8eNkgP.js";
|
|
7
|
+
import { t as useFieldControl } from "./use-field-control-CL_nOU7T.js";
|
|
8
|
+
import { createContext, useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
9
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { VISUALLY_HIDDEN_INPUT_STYLE, bridgeForm } from "@fragiola/primitives/form";
|
|
11
|
+
import { announceText } from "@fragiola/primitives/clipboard";
|
|
12
|
+
import { acceptAttribute, acceptsFile, assignFiles, checkFiles, fieldFiles, formatFileSize } from "@fragiola/primitives/file";
|
|
13
|
+
// src/components/file-upload/file-upload-context.ts
|
|
14
|
+
const FileUploadContext = createContext(null);
|
|
15
|
+
function fileUploadState(context) {
|
|
16
|
+
return {
|
|
17
|
+
value: context.value,
|
|
18
|
+
rejectedFiles: context.rejectedFiles,
|
|
19
|
+
disabled: context.disabled,
|
|
20
|
+
empty: context.empty,
|
|
21
|
+
dropTarget: context.dropTarget
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
const FileUploadItemContext = createContext(null);
|
|
25
|
+
// src/components/file-upload/file-upload-clear-trigger.tsx
|
|
26
|
+
/** Removes every file; hidden while there is none (spec/file-upload.md). */
|
|
27
|
+
function FileUploadClearTrigger(props) {
|
|
28
|
+
const context = useRequiredContext(FileUploadContext, "FileUpload.ClearTrigger");
|
|
29
|
+
return renderElement("button", props, fileUploadState(context), {
|
|
30
|
+
type: "button",
|
|
31
|
+
disabled: context.disabled,
|
|
32
|
+
hidden: context.empty && context.rejectedFiles.length === 0,
|
|
33
|
+
"data-primitives-part": "file-upload-clear-trigger",
|
|
34
|
+
...context.attributes,
|
|
35
|
+
onClick: (event) => context.clear(event.nativeEvent)
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
// src/components/file-upload/file-upload-dropzone.tsx
|
|
39
|
+
/**
|
|
40
|
+
* DropZone's drop target inside a FileUpload (spec/file-upload.md): its drops and pastes are the
|
|
41
|
+
* Root's picks, its press opens the HiddenInput's dialog.
|
|
42
|
+
*/
|
|
43
|
+
function FileUploadDropzone(props) {
|
|
44
|
+
const context = useRequiredContext(FileUploadContext, "FileUpload.Dropzone");
|
|
45
|
+
const [element, setElement] = useElement();
|
|
46
|
+
const { setDropzone, setDropTarget, disabled } = context;
|
|
47
|
+
const ref = useMemo(() => mergeRefs(setElement, setDropzone), [setElement, setDropzone]);
|
|
48
|
+
const dropTarget = useFileDropTarget(element, {
|
|
49
|
+
disabled,
|
|
50
|
+
onFiles: context.pick,
|
|
51
|
+
onDropTargetChange: (active) => setDropTarget(active),
|
|
52
|
+
onActivate: context.openDialog
|
|
53
|
+
});
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
if (disabled) setDropTarget(false);
|
|
56
|
+
}, [disabled, setDropTarget]);
|
|
57
|
+
return renderElement("div", props, fileUploadState(context), {
|
|
58
|
+
role: "button",
|
|
59
|
+
tabIndex: disabled ? void 0 : 0,
|
|
60
|
+
"aria-disabled": disabled ? "true" : void 0,
|
|
61
|
+
"data-primitives-part": "file-upload-dropzone",
|
|
62
|
+
...context.attributes,
|
|
63
|
+
...stateAttributes({ "drop-target": dropTarget })
|
|
64
|
+
}, ref);
|
|
65
|
+
}
|
|
66
|
+
// src/components/file-upload/file-upload-hidden-input.tsx
|
|
67
|
+
/**
|
|
68
|
+
* The native file input: the form's control, its files the value (spec/file-upload.md, "Forms").
|
|
69
|
+
* Hidden from the tab order and the accessibility tree; the Trigger and the Dropzone open it.
|
|
70
|
+
*/
|
|
71
|
+
function FileUploadHiddenInput(props) {
|
|
72
|
+
const context = useRequiredContext(FileUploadContext, "FileUpload.HiddenInput");
|
|
73
|
+
return renderElement("input", props, fileUploadState(context), {
|
|
74
|
+
type: "file",
|
|
75
|
+
id: context.inputId,
|
|
76
|
+
name: context.name,
|
|
77
|
+
accept: context.accept,
|
|
78
|
+
multiple: context.multiple,
|
|
79
|
+
capture: context.capture,
|
|
80
|
+
required: context.required,
|
|
81
|
+
disabled: context.disabled,
|
|
82
|
+
tabIndex: -1,
|
|
83
|
+
"aria-hidden": "true",
|
|
84
|
+
style: VISUALLY_HIDDEN_INPUT_STYLE,
|
|
85
|
+
"data-primitives-part": "file-upload-hidden-input",
|
|
86
|
+
onChange: (event) => {
|
|
87
|
+
const files = [...event.currentTarget.files ?? []];
|
|
88
|
+
if (files.length > 0) context.pick(files, "input-change", event.nativeEvent);
|
|
89
|
+
}
|
|
90
|
+
}, context.setInput);
|
|
91
|
+
}
|
|
92
|
+
// src/components/file-upload/file-upload-item.tsx
|
|
93
|
+
const NO_REASONS = [];
|
|
94
|
+
/** One file, accepted or rejected (spec/file-upload.md). */
|
|
95
|
+
function FileUploadItem({ file, ...props }) {
|
|
96
|
+
const context = useRequiredContext(FileUploadContext, "FileUpload.Item");
|
|
97
|
+
const rejection = context.rejectedFiles.find((entry) => entry.file === file);
|
|
98
|
+
const rejected = rejection !== void 0 && !context.value.includes(file);
|
|
99
|
+
const reasons = rejected ? rejection.reasons : NO_REASONS;
|
|
100
|
+
const item = useMemo(() => ({
|
|
101
|
+
file,
|
|
102
|
+
rejected,
|
|
103
|
+
reasons,
|
|
104
|
+
attributes: {
|
|
105
|
+
...context.attributes,
|
|
106
|
+
...stateAttributes({ rejected })
|
|
107
|
+
}
|
|
108
|
+
}), [
|
|
109
|
+
file,
|
|
110
|
+
rejected,
|
|
111
|
+
reasons,
|
|
112
|
+
context.attributes
|
|
113
|
+
]);
|
|
114
|
+
return /* @__PURE__ */ jsx(FileUploadItemContext.Provider, {
|
|
115
|
+
value: item,
|
|
116
|
+
children: renderElement("li", props, {
|
|
117
|
+
...fileUploadState(context),
|
|
118
|
+
file,
|
|
119
|
+
rejected,
|
|
120
|
+
reasons
|
|
121
|
+
}, {
|
|
122
|
+
"data-primitives-part": "file-upload-item",
|
|
123
|
+
...item.attributes
|
|
124
|
+
})
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
// src/components/file-upload/use-file-upload-item.ts
|
|
128
|
+
/** An Item part's contexts and state. */
|
|
129
|
+
function useFileUploadItem(part) {
|
|
130
|
+
const root = useRequiredContext(FileUploadContext, part);
|
|
131
|
+
const item = useRequiredContext(FileUploadItemContext, part);
|
|
132
|
+
return {
|
|
133
|
+
root,
|
|
134
|
+
item,
|
|
135
|
+
state: {
|
|
136
|
+
...fileUploadState(root),
|
|
137
|
+
file: item.file,
|
|
138
|
+
rejected: item.rejected,
|
|
139
|
+
reasons: item.reasons
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
// src/components/file-upload/file-upload-item-delete-trigger.tsx
|
|
144
|
+
/** Removes the Item's file, moving the focus on (spec/file-upload.md, "Focus"). */
|
|
145
|
+
function FileUploadItemDeleteTrigger(props) {
|
|
146
|
+
const { root, item, state } = useFileUploadItem("FileUpload.ItemDeleteTrigger");
|
|
147
|
+
return renderElement("button", props, state, {
|
|
148
|
+
type: "button",
|
|
149
|
+
disabled: root.disabled,
|
|
150
|
+
"data-primitives-part": "file-upload-item-delete-trigger",
|
|
151
|
+
...item.attributes,
|
|
152
|
+
onClick: (event) => root.remove(item.file, event.nativeEvent, event.currentTarget)
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
// src/components/file-upload/file-upload-item-group.tsx
|
|
156
|
+
/** The list of Items (spec/file-upload.md). */
|
|
157
|
+
function FileUploadItemGroup(props) {
|
|
158
|
+
const context = useRequiredContext(FileUploadContext, "FileUpload.ItemGroup");
|
|
159
|
+
return renderElement("ul", props, fileUploadState(context), {
|
|
160
|
+
"data-primitives-part": "file-upload-item-group",
|
|
161
|
+
...context.attributes
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
// src/components/file-upload/file-upload-item-name.tsx
|
|
165
|
+
/** The Item's file name, unless the app gives children (spec/file-upload.md). */
|
|
166
|
+
function FileUploadItemName(props) {
|
|
167
|
+
const { item, state } = useFileUploadItem("FileUpload.ItemName");
|
|
168
|
+
return renderElement("span", {
|
|
169
|
+
...props,
|
|
170
|
+
children: props.children ?? item.file.name
|
|
171
|
+
}, state, {
|
|
172
|
+
"data-primitives-part": "file-upload-item-name",
|
|
173
|
+
...item.attributes
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
// src/components/file-upload/file-upload-item-preview.tsx
|
|
177
|
+
/** A preview, rendered only for a file of its type (spec/file-upload.md). */
|
|
178
|
+
function FileUploadItemPreview({ type = "image/*", ...props }) {
|
|
179
|
+
const { item, state } = useFileUploadItem("FileUpload.ItemPreview");
|
|
180
|
+
if (!acceptsFile(item.file, type)) return null;
|
|
181
|
+
return renderElement("div", props, state, {
|
|
182
|
+
"data-primitives-part": "file-upload-item-preview",
|
|
183
|
+
...item.attributes
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
// src/components/file-upload/file-upload-item-preview-image.tsx
|
|
187
|
+
/**
|
|
188
|
+
* The Item's file as an image, through an object URL made once mounted and revoked when it
|
|
189
|
+
* unmounts or its file changes (spec/file-upload.md); `alt` is the app's.
|
|
190
|
+
*/
|
|
191
|
+
function FileUploadItemPreviewImage(props) {
|
|
192
|
+
const { item, state } = useFileUploadItem("FileUpload.ItemPreviewImage");
|
|
193
|
+
const [image, setImage] = useState(null);
|
|
194
|
+
const [src, setSrc] = useState();
|
|
195
|
+
const { file } = item;
|
|
196
|
+
useLayoutEffect(() => {
|
|
197
|
+
const url = image?.ownerDocument.defaultView?.URL;
|
|
198
|
+
if (url === void 0) return;
|
|
199
|
+
const objectUrl = url.createObjectURL(file);
|
|
200
|
+
setSrc(objectUrl);
|
|
201
|
+
return () => {
|
|
202
|
+
url.revokeObjectURL(objectUrl);
|
|
203
|
+
};
|
|
204
|
+
}, [image, file]);
|
|
205
|
+
return renderElement("img", props, state, {
|
|
206
|
+
src,
|
|
207
|
+
"data-primitives-part": "file-upload-item-preview-image",
|
|
208
|
+
...item.attributes
|
|
209
|
+
}, setImage);
|
|
210
|
+
}
|
|
211
|
+
// src/components/file-upload/file-upload-item-size-text.tsx
|
|
212
|
+
/** The Item's file size in the locale's bytes, unless the app gives children (spec/file-upload.md). */
|
|
213
|
+
function FileUploadItemSizeText(props) {
|
|
214
|
+
const { root, item, state } = useFileUploadItem("FileUpload.ItemSizeText");
|
|
215
|
+
return renderElement("span", {
|
|
216
|
+
...props,
|
|
217
|
+
children: props.children ?? formatFileSize(item.file.size, root.locale)
|
|
218
|
+
}, state, {
|
|
219
|
+
"data-primitives-part": "file-upload-item-size-text",
|
|
220
|
+
...item.attributes
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
// src/components/file-upload/file-upload-label.tsx
|
|
224
|
+
/** The label of the HiddenInput (a press opens the dialog), naming the Root (spec/file-upload.md). */
|
|
225
|
+
function FileUploadLabel(props) {
|
|
226
|
+
const context = useRequiredContext(FileUploadContext, "FileUpload.Label");
|
|
227
|
+
const { setLabelled } = context;
|
|
228
|
+
useLayoutEffect(() => {
|
|
229
|
+
setLabelled(true);
|
|
230
|
+
return () => setLabelled(false);
|
|
231
|
+
}, [setLabelled]);
|
|
232
|
+
return renderElement("label", props, fileUploadState(context), {
|
|
233
|
+
id: context.labelId,
|
|
234
|
+
htmlFor: context.inputId,
|
|
235
|
+
"data-primitives-part": "file-upload-label",
|
|
236
|
+
...context.attributes
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
// src/components/file-upload/file-upload-root.tsx
|
|
240
|
+
const NO_FILES = [];
|
|
241
|
+
/**
|
|
242
|
+
* A form control holding a list of files (spec/file-upload.md): the checks of each pick, the
|
|
243
|
+
* accepted and rejected lists, the hidden file input its files are assigned to, the Field binding,
|
|
244
|
+
* and a polite live region it renders as its last child.
|
|
245
|
+
*/
|
|
246
|
+
function FileUploadRoot({ value: valueProp, defaultValue = NO_FILES, onValueChange, onFileReject, accept, maxFiles = 1, minFileSize, maxFileSize, validate, name, required = false, disabled: disabledProp = false, capture, id, locale, announcement, children, ...props }) {
|
|
247
|
+
const [value, setValue] = useControllableState(valueProp, defaultValue, onValueChange);
|
|
248
|
+
const [rejectedFiles, setRejectedFiles] = useState([]);
|
|
249
|
+
const [dropTarget, setDropTarget] = useState(false);
|
|
250
|
+
const [labelled, setLabelled] = useState(false);
|
|
251
|
+
const [input, setInput] = useElement();
|
|
252
|
+
const [trigger, setTrigger] = useElement();
|
|
253
|
+
const [dropzone, setDropzone] = useElement();
|
|
254
|
+
const [root, setRoot] = useElement();
|
|
255
|
+
const announcer = useRef(null);
|
|
256
|
+
const [syncs, setSyncs] = useState(0);
|
|
257
|
+
const generatedId = useId();
|
|
258
|
+
const inputId = id ?? `${generatedId}input`;
|
|
259
|
+
const labelId = `${generatedId}label`;
|
|
260
|
+
const field = useFieldControl({
|
|
261
|
+
id: inputId,
|
|
262
|
+
labelable: true,
|
|
263
|
+
value: useMemo(() => fieldFiles(value), [value]),
|
|
264
|
+
filled: value.length > 0,
|
|
265
|
+
input: () => input,
|
|
266
|
+
focusTarget: () => trigger ?? dropzone
|
|
267
|
+
});
|
|
268
|
+
const disabled = disabledProp || field.disabled;
|
|
269
|
+
const latest = useRef({
|
|
270
|
+
value,
|
|
271
|
+
rejectedFiles,
|
|
272
|
+
rules: {
|
|
273
|
+
accept,
|
|
274
|
+
maxFiles,
|
|
275
|
+
minFileSize,
|
|
276
|
+
maxFileSize,
|
|
277
|
+
validate
|
|
278
|
+
},
|
|
279
|
+
onFileReject,
|
|
280
|
+
announcement,
|
|
281
|
+
input,
|
|
282
|
+
trigger,
|
|
283
|
+
dropzone,
|
|
284
|
+
root,
|
|
285
|
+
disabled
|
|
286
|
+
});
|
|
287
|
+
latest.current = {
|
|
288
|
+
value,
|
|
289
|
+
rejectedFiles,
|
|
290
|
+
rules: {
|
|
291
|
+
accept,
|
|
292
|
+
maxFiles,
|
|
293
|
+
minFileSize,
|
|
294
|
+
maxFileSize,
|
|
295
|
+
validate
|
|
296
|
+
},
|
|
297
|
+
onFileReject,
|
|
298
|
+
announcement,
|
|
299
|
+
input,
|
|
300
|
+
trigger,
|
|
301
|
+
dropzone,
|
|
302
|
+
root,
|
|
303
|
+
disabled
|
|
304
|
+
};
|
|
305
|
+
useLayoutEffect(() => {
|
|
306
|
+
if (input !== null) assignFiles(input, value);
|
|
307
|
+
}, [
|
|
308
|
+
input,
|
|
309
|
+
value,
|
|
310
|
+
syncs
|
|
311
|
+
]);
|
|
312
|
+
const pick = useCallback((files, reason, event) => {
|
|
313
|
+
const current = latest.current;
|
|
314
|
+
if (current.disabled) return;
|
|
315
|
+
const result = checkFiles(current.value, files, current.rules);
|
|
316
|
+
setSyncs((count) => count + 1);
|
|
317
|
+
setRejectedFiles(result.rejected);
|
|
318
|
+
const details = {
|
|
319
|
+
reason,
|
|
320
|
+
event
|
|
321
|
+
};
|
|
322
|
+
if (result.accepted.length > 0) setValue(result.value, details);
|
|
323
|
+
if (result.rejected.length > 0) current.onFileReject?.(result.rejected, details);
|
|
324
|
+
if (current.announcement !== void 0 && announcer.current) announceText(announcer.current, current.announcement({
|
|
325
|
+
value: result.value,
|
|
326
|
+
acceptedFiles: result.accepted,
|
|
327
|
+
rejectedFiles: result.rejected,
|
|
328
|
+
reason,
|
|
329
|
+
event
|
|
330
|
+
}));
|
|
331
|
+
}, [setValue]);
|
|
332
|
+
const openDialog = useCallback(() => {
|
|
333
|
+
const current = latest.current;
|
|
334
|
+
if (!current.disabled) current.input?.click();
|
|
335
|
+
}, []);
|
|
336
|
+
const focusControl = useCallback(() => {
|
|
337
|
+
const current = latest.current;
|
|
338
|
+
(current.trigger ?? current.dropzone)?.focus();
|
|
339
|
+
}, []);
|
|
340
|
+
const remove = useCallback((file, event, button) => {
|
|
341
|
+
const current = latest.current;
|
|
342
|
+
const buttons = [...(button.closest("[data-primitives-part=\"file-upload-item-group\"]") ?? current.root)?.querySelectorAll("[data-primitives-part=\"file-upload-item-delete-trigger\"]") ?? []];
|
|
343
|
+
const index = buttons.indexOf(button);
|
|
344
|
+
const next = index === -1 ? void 0 : buttons[index + 1] ?? buttons[index - 1];
|
|
345
|
+
if (next !== void 0) next.focus();
|
|
346
|
+
else focusControl();
|
|
347
|
+
if (current.value.includes(file)) setValue(current.value.filter((entry) => entry !== file), {
|
|
348
|
+
reason: "delete-press",
|
|
349
|
+
event
|
|
350
|
+
});
|
|
351
|
+
else setRejectedFiles(current.rejectedFiles.filter((entry) => entry.file !== file));
|
|
352
|
+
}, [setValue, focusControl]);
|
|
353
|
+
const clear = useCallback((event) => {
|
|
354
|
+
focusControl();
|
|
355
|
+
setRejectedFiles([]);
|
|
356
|
+
if (latest.current.value.length > 0) setValue([], {
|
|
357
|
+
reason: "clear-press",
|
|
358
|
+
event
|
|
359
|
+
});
|
|
360
|
+
}, [setValue, focusControl]);
|
|
361
|
+
const reset = useRef({
|
|
362
|
+
defaultValue,
|
|
363
|
+
setValue,
|
|
364
|
+
markReset: field.reset
|
|
365
|
+
});
|
|
366
|
+
reset.current = {
|
|
367
|
+
defaultValue,
|
|
368
|
+
setValue,
|
|
369
|
+
markReset: field.reset
|
|
370
|
+
};
|
|
371
|
+
useEffect(() => {
|
|
372
|
+
if (input === null) return;
|
|
373
|
+
return bridgeForm(input, {
|
|
374
|
+
reset: () => {
|
|
375
|
+
const current = reset.current;
|
|
376
|
+
current.markReset();
|
|
377
|
+
setRejectedFiles([]);
|
|
378
|
+
setSyncs((count) => count + 1);
|
|
379
|
+
current.setValue(current.defaultValue, { reason: "none" });
|
|
380
|
+
},
|
|
381
|
+
invalid: () => {
|
|
382
|
+
const current = latest.current;
|
|
383
|
+
return current.trigger ?? current.dropzone;
|
|
384
|
+
}
|
|
385
|
+
});
|
|
386
|
+
}, [input]);
|
|
387
|
+
const empty = value.length === 0;
|
|
388
|
+
const state = {
|
|
389
|
+
value,
|
|
390
|
+
rejectedFiles,
|
|
391
|
+
disabled,
|
|
392
|
+
empty,
|
|
393
|
+
dropTarget
|
|
394
|
+
};
|
|
395
|
+
const attributes = useMemo(() => ({
|
|
396
|
+
...field.attributes,
|
|
397
|
+
...stateAttributes({
|
|
398
|
+
disabled,
|
|
399
|
+
empty,
|
|
400
|
+
"drop-target": dropTarget
|
|
401
|
+
})
|
|
402
|
+
}), [
|
|
403
|
+
field.attributes,
|
|
404
|
+
disabled,
|
|
405
|
+
empty,
|
|
406
|
+
dropTarget
|
|
407
|
+
]);
|
|
408
|
+
const context = useMemo(() => ({
|
|
409
|
+
value,
|
|
410
|
+
rejectedFiles,
|
|
411
|
+
disabled,
|
|
412
|
+
empty,
|
|
413
|
+
dropTarget,
|
|
414
|
+
inputId,
|
|
415
|
+
labelId,
|
|
416
|
+
name: field.name ?? name,
|
|
417
|
+
accept: acceptAttribute(accept),
|
|
418
|
+
multiple: maxFiles > 1,
|
|
419
|
+
capture,
|
|
420
|
+
required,
|
|
421
|
+
locale,
|
|
422
|
+
attributes,
|
|
423
|
+
setLabelled,
|
|
424
|
+
setInput,
|
|
425
|
+
setTrigger,
|
|
426
|
+
setDropzone,
|
|
427
|
+
setDropTarget,
|
|
428
|
+
pick,
|
|
429
|
+
openDialog,
|
|
430
|
+
remove,
|
|
431
|
+
clear
|
|
432
|
+
}), [
|
|
433
|
+
value,
|
|
434
|
+
rejectedFiles,
|
|
435
|
+
disabled,
|
|
436
|
+
empty,
|
|
437
|
+
dropTarget,
|
|
438
|
+
inputId,
|
|
439
|
+
labelId,
|
|
440
|
+
field.name,
|
|
441
|
+
name,
|
|
442
|
+
accept,
|
|
443
|
+
maxFiles,
|
|
444
|
+
capture,
|
|
445
|
+
required,
|
|
446
|
+
locale,
|
|
447
|
+
attributes,
|
|
448
|
+
setInput,
|
|
449
|
+
setTrigger,
|
|
450
|
+
setDropzone,
|
|
451
|
+
pick,
|
|
452
|
+
openDialog,
|
|
453
|
+
remove,
|
|
454
|
+
clear
|
|
455
|
+
]);
|
|
456
|
+
const content = typeof children === "function" ? children(state) : children;
|
|
457
|
+
return /* @__PURE__ */ jsx(FileUploadContext.Provider, {
|
|
458
|
+
value: context,
|
|
459
|
+
children: renderElement("div", {
|
|
460
|
+
...props,
|
|
461
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [content, /* @__PURE__ */ jsx("span", {
|
|
462
|
+
ref: announcer,
|
|
463
|
+
"aria-live": "polite",
|
|
464
|
+
"aria-atomic": "true",
|
|
465
|
+
"data-primitives-part": "file-upload-announcer",
|
|
466
|
+
style: LIVE_REGION_STYLE
|
|
467
|
+
})] })
|
|
468
|
+
}, state, {
|
|
469
|
+
role: "group",
|
|
470
|
+
"aria-labelledby": field.inField ? field.aria["aria-labelledby"] : labelled ? labelId : void 0,
|
|
471
|
+
"aria-describedby": field.aria["aria-describedby"],
|
|
472
|
+
"aria-invalid": field.aria["aria-invalid"],
|
|
473
|
+
"data-primitives-part": "file-upload-root",
|
|
474
|
+
...attributes,
|
|
475
|
+
onFocus: field.onFocus,
|
|
476
|
+
onBlur: (event) => {
|
|
477
|
+
if (!event.currentTarget.contains(event.relatedTarget)) field.onBlur();
|
|
478
|
+
}
|
|
479
|
+
}, setRoot)
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
// src/components/file-upload/file-upload-trigger.tsx
|
|
483
|
+
/** The button that opens the file dialog (spec/file-upload.md). */
|
|
484
|
+
function FileUploadTrigger(props) {
|
|
485
|
+
const context = useRequiredContext(FileUploadContext, "FileUpload.Trigger");
|
|
486
|
+
return renderElement("button", props, fileUploadState(context), {
|
|
487
|
+
type: "button",
|
|
488
|
+
disabled: context.disabled,
|
|
489
|
+
"data-primitives-part": "file-upload-trigger",
|
|
490
|
+
...context.attributes,
|
|
491
|
+
onClick: context.openDialog
|
|
492
|
+
}, context.setTrigger);
|
|
493
|
+
}
|
|
494
|
+
// src/components/file-upload/parts.ts
|
|
495
|
+
/** spec/file-upload.md */
|
|
496
|
+
const FileUpload = {
|
|
497
|
+
Root: FileUploadRoot,
|
|
498
|
+
Label: FileUploadLabel,
|
|
499
|
+
Dropzone: FileUploadDropzone,
|
|
500
|
+
Trigger: FileUploadTrigger,
|
|
501
|
+
HiddenInput: FileUploadHiddenInput,
|
|
502
|
+
ItemGroup: FileUploadItemGroup,
|
|
503
|
+
Item: FileUploadItem,
|
|
504
|
+
ItemName: FileUploadItemName,
|
|
505
|
+
ItemSizeText: FileUploadItemSizeText,
|
|
506
|
+
ItemPreview: FileUploadItemPreview,
|
|
507
|
+
ItemPreviewImage: FileUploadItemPreviewImage,
|
|
508
|
+
ItemDeleteTrigger: FileUploadItemDeleteTrigger,
|
|
509
|
+
ClearTrigger: FileUploadClearTrigger
|
|
510
|
+
};
|
|
511
|
+
export { FileUpload as t };
|
|
512
|
+
|
|
513
|
+
//# sourceMappingURL=file-upload-BIRibICU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-upload-BIRibICU.js","names":[],"sources":["../src/components/file-upload/file-upload-context.ts","../src/components/file-upload/file-upload-clear-trigger.tsx","../src/components/file-upload/file-upload-dropzone.tsx","../src/components/file-upload/file-upload-hidden-input.tsx","../src/components/file-upload/file-upload-item.tsx","../src/components/file-upload/use-file-upload-item.ts","../src/components/file-upload/file-upload-item-delete-trigger.tsx","../src/components/file-upload/file-upload-item-group.tsx","../src/components/file-upload/file-upload-item-name.tsx","../src/components/file-upload/file-upload-item-preview.tsx","../src/components/file-upload/file-upload-item-preview-image.tsx","../src/components/file-upload/file-upload-item-size-text.tsx","../src/components/file-upload/file-upload-label.tsx","../src/components/file-upload/file-upload-root.tsx","../src/components/file-upload/file-upload-trigger.tsx","../src/components/file-upload/parts.ts"],"sourcesContent":["import type { FileRejection } from \"@fragiola/primitives/file\";\nimport { createContext } from \"react\";\nimport type { ChangeReason } from \"../../utils/change-details.ts\";\n\n/** The state every part renders with (spec/file-upload.md, \"API\"). */\nexport interface FileUploadState {\n /** The accepted files. */\n value: File[];\n /** The last pick's rejected files, with their reasons. */\n rejectedFiles: FileRejection<File>[];\n disabled: boolean;\n /** No accepted file. */\n empty: boolean;\n /** A drag of files is over the Dropzone. */\n dropTarget: boolean;\n}\n\nexport interface FileUploadContextValue extends FileUploadState {\n inputId: string;\n labelId: string;\n name: string | undefined;\n accept: string | undefined;\n multiple: boolean;\n capture: \"user\" | \"environment\" | undefined;\n required: boolean;\n locale: string | undefined;\n /** The Field's state attributes and the Root's own, for every part. */\n attributes: Record<`data-${string}`, string>;\n setLabelled: (labelled: boolean) => void;\n setInput: (element: HTMLInputElement | null) => void;\n setTrigger: (element: HTMLElement | null) => void;\n setDropzone: (element: HTMLElement | null) => void;\n setDropTarget: (active: boolean) => void;\n /** New files from the dialog, a drop or a paste. */\n pick: (files: File[], reason: ChangeReason, event: Event) => void;\n openDialog: () => void;\n /** Removes a file from the value or the rejected list, moving the focus on. */\n remove: (file: File, event: Event, button: HTMLElement) => void;\n clear: (event: Event) => void;\n}\n\nexport const FileUploadContext = createContext<FileUploadContextValue | null>(\n null,\n);\n\nexport function fileUploadState(\n context: FileUploadContextValue,\n): FileUploadState {\n return {\n value: context.value,\n rejectedFiles: context.rejectedFiles,\n disabled: context.disabled,\n empty: context.empty,\n dropTarget: context.dropTarget,\n };\n}\n\n/** An Item's state: the Root's, and its file. */\nexport interface FileUploadItemState extends FileUploadState {\n file: File;\n rejected: boolean;\n /** A rejected file's reasons (`[]` for an accepted one). */\n reasons: readonly string[];\n}\n\nexport interface FileUploadItemContextValue {\n file: File;\n rejected: boolean;\n reasons: readonly string[];\n attributes: Record<`data-${string}`, string>;\n}\n\nexport const FileUploadItemContext =\n createContext<FileUploadItemContextValue | null>(null);\n","import type { MouseEvent } from \"react\";\nimport { useRequiredContext } from \"../../hooks/use-required-context.ts\";\nimport { type PartProps, renderElement } from \"../../utils/render-element.tsx\";\nimport {\n FileUploadContext,\n type FileUploadState,\n fileUploadState,\n} from \"./file-upload-context.ts\";\n\nexport type FileUploadClearTriggerProps = PartProps<FileUploadState>;\n\n/** Removes every file; hidden while there is none (spec/file-upload.md). */\nexport function FileUploadClearTrigger(props: FileUploadClearTriggerProps) {\n const context = useRequiredContext(\n FileUploadContext,\n \"FileUpload.ClearTrigger\",\n );\n return renderElement(\"button\", props, fileUploadState(context), {\n type: \"button\",\n disabled: context.disabled,\n hidden: context.empty && context.rejectedFiles.length === 0,\n \"data-primitives-part\": \"file-upload-clear-trigger\",\n ...context.attributes,\n onClick: (event: MouseEvent<HTMLElement>) =>\n context.clear(event.nativeEvent),\n });\n}\n","import { useEffect, useMemo } from \"react\";\nimport { useElement } from \"../../hooks/use-element.ts\";\nimport { useFileDropTarget } from \"../../hooks/use-file-drop-target.ts\";\nimport { useRequiredContext } from \"../../hooks/use-required-context.ts\";\nimport { mergeRefs } from \"../../utils/merge-refs.ts\";\nimport { type PartProps, renderElement } from \"../../utils/render-element.tsx\";\nimport { stateAttributes } from \"../../utils/state-attributes.ts\";\nimport {\n FileUploadContext,\n type FileUploadState,\n fileUploadState,\n} from \"./file-upload-context.ts\";\n\nexport type FileUploadDropzoneProps = PartProps<FileUploadState>;\n\n/**\n * DropZone's drop target inside a FileUpload (spec/file-upload.md): its drops and pastes are the\n * Root's picks, its press opens the HiddenInput's dialog.\n */\nexport function FileUploadDropzone(props: FileUploadDropzoneProps) {\n const context = useRequiredContext(\n FileUploadContext,\n \"FileUpload.Dropzone\",\n );\n const [element, setElement] = useElement<HTMLElement>();\n const { setDropzone, setDropTarget, disabled } = context;\n const ref = useMemo(\n () => mergeRefs(setElement, setDropzone),\n [setElement, setDropzone],\n );\n const dropTarget = useFileDropTarget(element, {\n disabled,\n onFiles: context.pick,\n onDropTargetChange: (active) => setDropTarget(active),\n onActivate: context.openDialog,\n });\n useEffect(() => {\n if (disabled) {\n setDropTarget(false);\n }\n }, [disabled, setDropTarget]);\n return renderElement(\n \"div\",\n props,\n fileUploadState(context),\n {\n role: \"button\",\n tabIndex: disabled ? undefined : 0,\n \"aria-disabled\": disabled ? \"true\" : undefined,\n \"data-primitives-part\": \"file-upload-dropzone\",\n ...context.attributes,\n ...stateAttributes({ \"drop-target\": dropTarget }),\n },\n ref,\n );\n}\n","import { VISUALLY_HIDDEN_INPUT_STYLE } from \"@fragiola/primitives/form\";\nimport type { ChangeEvent } from \"react\";\nimport { useRequiredContext } from \"../../hooks/use-required-context.ts\";\nimport { type PartProps, renderElement } from \"../../utils/render-element.tsx\";\nimport {\n FileUploadContext,\n type FileUploadState,\n fileUploadState,\n} from \"./file-upload-context.ts\";\n\nexport type FileUploadHiddenInputProps = PartProps<FileUploadState>;\n\n/**\n * The native file input: the form's control, its files the value (spec/file-upload.md, \"Forms\").\n * Hidden from the tab order and the accessibility tree; the Trigger and the Dropzone open it.\n */\nexport function FileUploadHiddenInput(props: FileUploadHiddenInputProps) {\n const context = useRequiredContext(\n FileUploadContext,\n \"FileUpload.HiddenInput\",\n );\n return renderElement(\n \"input\",\n props,\n fileUploadState(context),\n {\n type: \"file\",\n id: context.inputId,\n name: context.name,\n accept: context.accept,\n multiple: context.multiple,\n capture: context.capture,\n required: context.required,\n disabled: context.disabled,\n tabIndex: -1,\n \"aria-hidden\": \"true\",\n style: VISUALLY_HIDDEN_INPUT_STYLE,\n \"data-primitives-part\": \"file-upload-hidden-input\",\n onChange: (event: ChangeEvent<HTMLInputElement>) => {\n const files = [...(event.currentTarget.files ?? [])];\n if (files.length > 0) {\n context.pick(files, \"input-change\", event.nativeEvent);\n }\n },\n },\n context.setInput as (element: HTMLElement | null) => void,\n );\n}\n","import { useMemo } from \"react\";\nimport { useRequiredContext } from \"../../hooks/use-required-context.ts\";\nimport { type PartProps, renderElement } from \"../../utils/render-element.tsx\";\nimport { stateAttributes } from \"../../utils/state-attributes.ts\";\nimport {\n FileUploadContext,\n FileUploadItemContext,\n type FileUploadItemContextValue,\n type FileUploadItemState,\n fileUploadState,\n} from \"./file-upload-context.ts\";\n\nexport interface FileUploadItemProps extends PartProps<FileUploadItemState> {\n /** The Item's file: an accepted one, or a rejected one. */\n file: File;\n}\n\nconst NO_REASONS: readonly string[] = [];\n\n/** One file, accepted or rejected (spec/file-upload.md). */\nexport function FileUploadItem({ file, ...props }: FileUploadItemProps) {\n const context = useRequiredContext(FileUploadContext, \"FileUpload.Item\");\n const rejection = context.rejectedFiles.find(\n (entry) => entry.file === file,\n );\n const rejected = rejection !== undefined && !context.value.includes(file);\n const reasons = rejected ? rejection.reasons : NO_REASONS;\n const item = useMemo<FileUploadItemContextValue>(\n () => ({\n file,\n rejected,\n reasons,\n attributes: {\n ...context.attributes,\n ...stateAttributes({ rejected }),\n },\n }),\n [file, rejected, reasons, context.attributes],\n );\n return (\n <FileUploadItemContext.Provider value={item}>\n {renderElement(\n \"li\",\n props,\n { ...fileUploadState(context), file, rejected, reasons },\n {\n \"data-primitives-part\": \"file-upload-item\",\n ...item.attributes,\n },\n )}\n </FileUploadItemContext.Provider>\n );\n}\n","import { useRequiredContext } from \"../../hooks/use-required-context.ts\";\nimport {\n FileUploadContext,\n type FileUploadContextValue,\n FileUploadItemContext,\n type FileUploadItemContextValue,\n type FileUploadItemState,\n fileUploadState,\n} from \"./file-upload-context.ts\";\n\n/** An Item part's contexts and state. */\nexport function useFileUploadItem(part: string): {\n root: FileUploadContextValue;\n item: FileUploadItemContextValue;\n state: FileUploadItemState;\n} {\n const root = useRequiredContext(FileUploadContext, part);\n const item = useRequiredContext(FileUploadItemContext, part);\n return {\n root,\n item,\n state: {\n ...fileUploadState(root),\n file: item.file,\n rejected: item.rejected,\n reasons: item.reasons,\n },\n };\n}\n","import type { MouseEvent } from \"react\";\nimport { type PartProps, renderElement } from \"../../utils/render-element.tsx\";\nimport type { FileUploadItemState } from \"./file-upload-context.ts\";\nimport { useFileUploadItem } from \"./use-file-upload-item.ts\";\n\nexport type FileUploadItemDeleteTriggerProps = PartProps<FileUploadItemState>;\n\n/** Removes the Item's file, moving the focus on (spec/file-upload.md, \"Focus\"). */\nexport function FileUploadItemDeleteTrigger(\n props: FileUploadItemDeleteTriggerProps,\n) {\n const { root, item, state } = useFileUploadItem(\n \"FileUpload.ItemDeleteTrigger\",\n );\n return renderElement(\"button\", props, state, {\n type: \"button\",\n disabled: root.disabled,\n \"data-primitives-part\": \"file-upload-item-delete-trigger\",\n ...item.attributes,\n onClick: (event: MouseEvent<HTMLElement>) =>\n root.remove(item.file, event.nativeEvent, event.currentTarget),\n });\n}\n","import { useRequiredContext } from \"../../hooks/use-required-context.ts\";\nimport { type PartProps, renderElement } from \"../../utils/render-element.tsx\";\nimport {\n FileUploadContext,\n type FileUploadState,\n fileUploadState,\n} from \"./file-upload-context.ts\";\n\nexport type FileUploadItemGroupProps = PartProps<FileUploadState>;\n\n/** The list of Items (spec/file-upload.md). */\nexport function FileUploadItemGroup(props: FileUploadItemGroupProps) {\n const context = useRequiredContext(\n FileUploadContext,\n \"FileUpload.ItemGroup\",\n );\n return renderElement(\"ul\", props, fileUploadState(context), {\n \"data-primitives-part\": \"file-upload-item-group\",\n ...context.attributes,\n });\n}\n","import { type PartProps, renderElement } from \"../../utils/render-element.tsx\";\nimport type { FileUploadItemState } from \"./file-upload-context.ts\";\nimport { useFileUploadItem } from \"./use-file-upload-item.ts\";\n\nexport type FileUploadItemNameProps = PartProps<FileUploadItemState>;\n\n/** The Item's file name, unless the app gives children (spec/file-upload.md). */\nexport function FileUploadItemName(props: FileUploadItemNameProps) {\n const { item, state } = useFileUploadItem(\"FileUpload.ItemName\");\n return renderElement(\n \"span\",\n { ...props, children: props.children ?? item.file.name },\n state,\n {\n \"data-primitives-part\": \"file-upload-item-name\",\n ...item.attributes,\n },\n );\n}\n","import { acceptsFile } from \"@fragiola/primitives/file\";\nimport { type PartProps, renderElement } from \"../../utils/render-element.tsx\";\nimport type { FileUploadItemState } from \"./file-upload-context.ts\";\nimport { useFileUploadItem } from \"./use-file-upload-item.ts\";\n\nexport interface FileUploadItemPreviewProps\n extends PartProps<FileUploadItemState> {\n /** The files it previews, an `accept` pattern (default `\"image/*\"`). */\n type?: string;\n}\n\n/** A preview, rendered only for a file of its type (spec/file-upload.md). */\nexport function FileUploadItemPreview({\n type = \"image/*\",\n ...props\n}: FileUploadItemPreviewProps) {\n const { item, state } = useFileUploadItem(\"FileUpload.ItemPreview\");\n if (!acceptsFile(item.file, type)) {\n return null;\n }\n return renderElement(\"div\", props, state, {\n \"data-primitives-part\": \"file-upload-item-preview\",\n ...item.attributes,\n });\n}\n","import { useLayoutEffect, useState } from \"react\";\nimport { type PartProps, renderElement } from \"../../utils/render-element.tsx\";\nimport type { FileUploadItemState } from \"./file-upload-context.ts\";\nimport { useFileUploadItem } from \"./use-file-upload-item.ts\";\n\nexport type FileUploadItemPreviewImageProps = PartProps<FileUploadItemState>;\n\n/**\n * The Item's file as an image, through an object URL made once mounted and revoked when it\n * unmounts or its file changes (spec/file-upload.md); `alt` is the app's.\n */\nexport function FileUploadItemPreviewImage(\n props: FileUploadItemPreviewImageProps,\n) {\n const { item, state } = useFileUploadItem(\"FileUpload.ItemPreviewImage\");\n const [image, setImage] = useState<HTMLImageElement | null>(null);\n const [src, setSrc] = useState<string>();\n const { file } = item;\n useLayoutEffect(() => {\n const url = image?.ownerDocument.defaultView?.URL;\n if (url === undefined) {\n return undefined;\n }\n const objectUrl = url.createObjectURL(file);\n setSrc(objectUrl);\n return () => {\n url.revokeObjectURL(objectUrl);\n };\n }, [image, file]);\n return renderElement(\n \"img\",\n props,\n state,\n {\n src,\n \"data-primitives-part\": \"file-upload-item-preview-image\",\n ...item.attributes,\n },\n setImage as (element: HTMLElement | null) => void,\n );\n}\n","import { formatFileSize } from \"@fragiola/primitives/file\";\nimport { type PartProps, renderElement } from \"../../utils/render-element.tsx\";\nimport type { FileUploadItemState } from \"./file-upload-context.ts\";\nimport { useFileUploadItem } from \"./use-file-upload-item.ts\";\n\nexport type FileUploadItemSizeTextProps = PartProps<FileUploadItemState>;\n\n/** The Item's file size in the locale's bytes, unless the app gives children (spec/file-upload.md). */\nexport function FileUploadItemSizeText(props: FileUploadItemSizeTextProps) {\n const { root, item, state } = useFileUploadItem(\"FileUpload.ItemSizeText\");\n return renderElement(\n \"span\",\n {\n ...props,\n children:\n props.children ?? formatFileSize(item.file.size, root.locale),\n },\n state,\n {\n \"data-primitives-part\": \"file-upload-item-size-text\",\n ...item.attributes,\n },\n );\n}\n","import { useLayoutEffect } from \"react\";\nimport { useRequiredContext } from \"../../hooks/use-required-context.ts\";\nimport { type PartProps, renderElement } from \"../../utils/render-element.tsx\";\nimport {\n FileUploadContext,\n type FileUploadState,\n fileUploadState,\n} from \"./file-upload-context.ts\";\n\nexport type FileUploadLabelProps = PartProps<FileUploadState>;\n\n/** The label of the HiddenInput (a press opens the dialog), naming the Root (spec/file-upload.md). */\nexport function FileUploadLabel(props: FileUploadLabelProps) {\n const context = useRequiredContext(FileUploadContext, \"FileUpload.Label\");\n const { setLabelled } = context;\n useLayoutEffect(() => {\n setLabelled(true);\n return () => setLabelled(false);\n }, [setLabelled]);\n return renderElement(\"label\", props, fileUploadState(context), {\n id: context.labelId,\n htmlFor: context.inputId,\n \"data-primitives-part\": \"file-upload-label\",\n ...context.attributes,\n });\n}\n","import { announceText } from \"@fragiola/primitives/clipboard\";\nimport {\n acceptAttribute,\n assignFiles,\n checkFiles,\n type FileAccept,\n type FileRejection,\n fieldFiles,\n} from \"@fragiola/primitives/file\";\nimport { bridgeForm } from \"@fragiola/primitives/form\";\nimport {\n type FocusEvent,\n type ReactNode,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { useControllableState } from \"../../hooks/use-controllable-state.ts\";\nimport { useElement } from \"../../hooks/use-element.ts\";\nimport { useFieldControl } from \"../../hooks/use-field-control.ts\";\nimport type {\n ChangeDetails,\n ChangeReason,\n} from \"../../utils/change-details.ts\";\nimport { LIVE_REGION_STYLE } from \"../../utils/live-region-style.ts\";\nimport { type PartProps, renderElement } from \"../../utils/render-element.tsx\";\nimport { stateAttributes } from \"../../utils/state-attributes.ts\";\nimport {\n FileUploadContext,\n type FileUploadContextValue,\n type FileUploadState,\n} from \"./file-upload-context.ts\";\n\n/** What `announcement` receives after a pick. */\nexport interface FileUploadPickDetails extends ChangeDetails {\n /** The accepted files after the pick. */\n value: File[];\n /** The pick's accepted files. */\n acceptedFiles: File[];\n rejectedFiles: FileRejection<File>[];\n}\n\nexport interface FileUploadRootProps\n extends Omit<PartProps<FileUploadState>, \"children\"> {\n value?: File[];\n defaultValue?: File[];\n onValueChange?: (value: File[], details: ChangeDetails) => void;\n onFileReject?: (\n rejections: FileRejection<File>[],\n details: ChangeDetails,\n ) => void;\n accept?: FileAccept;\n /** At most this many files (default `1`: a new pick replaces the file). */\n maxFiles?: number;\n minFileSize?: number;\n maxFileSize?: number;\n validate?: (\n file: File,\n value: readonly File[],\n ) => readonly string[] | null | undefined;\n name?: string;\n required?: boolean;\n disabled?: boolean;\n capture?: \"user\" | \"environment\";\n /** The HiddenInput's id. */\n id?: string;\n /** ItemSizeText's locale (default: the runtime's). */\n locale?: string;\n /** The text announced (politely) after each pick. */\n announcement?: (details: FileUploadPickDetails) => string;\n children?: ReactNode | ((state: FileUploadState) => ReactNode);\n}\n\nconst NO_FILES: File[] = [];\n\n/**\n * A form control holding a list of files (spec/file-upload.md): the checks of each pick, the\n * accepted and rejected lists, the hidden file input its files are assigned to, the Field binding,\n * and a polite live region it renders as its last child.\n */\nexport function FileUploadRoot({\n value: valueProp,\n defaultValue = NO_FILES,\n onValueChange,\n onFileReject,\n accept,\n maxFiles = 1,\n minFileSize,\n maxFileSize,\n validate,\n name,\n required = false,\n disabled: disabledProp = false,\n capture,\n id,\n locale,\n announcement,\n children,\n ...props\n}: FileUploadRootProps) {\n const [value, setValue] = useControllableState<File[], ChangeDetails>(\n valueProp,\n defaultValue,\n onValueChange,\n );\n const [rejectedFiles, setRejectedFiles] = useState<FileRejection<File>[]>(\n [],\n );\n const [dropTarget, setDropTarget] = useState(false);\n const [labelled, setLabelled] = useState(false);\n const [input, setInput] = useElement<HTMLInputElement>();\n const [trigger, setTrigger] = useElement<HTMLElement>();\n const [dropzone, setDropzone] = useElement<HTMLElement>();\n const [root, setRoot] = useElement<HTMLElement>();\n const announcer = useRef<HTMLSpanElement | null>(null);\n // a pick re-assigns the input's files even when the value did not change (the dialog wrote\n // the picked files into it)\n const [syncs, setSyncs] = useState(0);\n const generatedId = useId();\n const inputId = id ?? `${generatedId}input`;\n const labelId = `${generatedId}label`;\n\n const field = useFieldControl({\n id: inputId,\n labelable: true,\n value: useMemo(() => fieldFiles(value), [value]),\n filled: value.length > 0,\n input: () => input,\n focusTarget: () => trigger ?? dropzone,\n });\n const disabled = disabledProp || field.disabled;\n\n const latest = useRef({\n value,\n rejectedFiles,\n rules: { accept, maxFiles, minFileSize, maxFileSize, validate },\n onFileReject,\n announcement,\n input,\n trigger,\n dropzone,\n root,\n disabled,\n });\n latest.current = {\n value,\n rejectedFiles,\n rules: { accept, maxFiles, minFileSize, maxFileSize, validate },\n onFileReject,\n announcement,\n input,\n trigger,\n dropzone,\n root,\n disabled,\n };\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: `syncs` re-runs it after a pick\n useLayoutEffect(() => {\n if (input !== null) {\n assignFiles(input, value);\n }\n }, [input, value, syncs]);\n\n const pick = useCallback(\n (files: File[], reason: ChangeReason, event: Event) => {\n const current = latest.current;\n if (current.disabled) {\n return;\n }\n const result = checkFiles(current.value, files, current.rules);\n setSyncs((count) => count + 1);\n setRejectedFiles(result.rejected);\n const details = { reason, event };\n if (result.accepted.length > 0) {\n setValue(result.value, details);\n }\n if (result.rejected.length > 0) {\n current.onFileReject?.(result.rejected, details);\n }\n if (current.announcement !== undefined && announcer.current) {\n announceText(\n announcer.current,\n current.announcement({\n value: result.value,\n acceptedFiles: result.accepted,\n rejectedFiles: result.rejected,\n reason,\n event,\n }),\n );\n }\n },\n [setValue],\n );\n const openDialog = useCallback(() => {\n const current = latest.current;\n if (!current.disabled) {\n current.input?.click();\n }\n }, []);\n const focusControl = useCallback(() => {\n const current = latest.current;\n (current.trigger ?? current.dropzone)?.focus();\n }, []);\n const remove = useCallback(\n (file: File, event: Event, button: HTMLElement) => {\n const current = latest.current;\n // the focus moves to the next delete button, else the previous one, else the\n // Trigger (spec/file-upload.md, \"Focus\"), in the button's ItemGroup\n const scope =\n button.closest(\n '[data-primitives-part=\"file-upload-item-group\"]',\n ) ?? current.root;\n const buttons = [\n ...(scope?.querySelectorAll<HTMLElement>(\n '[data-primitives-part=\"file-upload-item-delete-trigger\"]',\n ) ?? []),\n ];\n const index = buttons.indexOf(button);\n const next =\n index === -1\n ? undefined\n : (buttons[index + 1] ?? buttons[index - 1]);\n if (next !== undefined) {\n next.focus();\n } else {\n focusControl();\n }\n if (current.value.includes(file)) {\n setValue(\n current.value.filter((entry) => entry !== file),\n { reason: \"delete-press\", event },\n );\n } else {\n setRejectedFiles(\n current.rejectedFiles.filter(\n (entry) => entry.file !== file,\n ),\n );\n }\n },\n [setValue, focusControl],\n );\n const clear = useCallback(\n (event: Event) => {\n focusControl();\n setRejectedFiles([]);\n if (latest.current.value.length > 0) {\n setValue([], { reason: \"clear-press\", event });\n }\n },\n [setValue, focusControl],\n );\n\n // a form reset returns to the default value (spec/file-upload.md, \"Forms\")\n const reset = useRef({ defaultValue, setValue, markReset: field.reset });\n reset.current = { defaultValue, setValue, markReset: field.reset };\n useEffect(() => {\n if (input === null) {\n return undefined;\n }\n return bridgeForm(input, {\n reset: () => {\n const current = reset.current;\n current.markReset();\n setRejectedFiles([]);\n setSyncs((count) => count + 1);\n current.setValue(current.defaultValue, { reason: \"none\" });\n },\n invalid: () => {\n const current = latest.current;\n return current.trigger ?? current.dropzone;\n },\n });\n }, [input]);\n\n const empty = value.length === 0;\n const state: FileUploadState = {\n value,\n rejectedFiles,\n disabled,\n empty,\n dropTarget,\n };\n const attributes = useMemo(\n () => ({\n ...field.attributes,\n ...stateAttributes({ disabled, empty, \"drop-target\": dropTarget }),\n }),\n [field.attributes, disabled, empty, dropTarget],\n );\n const context = useMemo<FileUploadContextValue>(\n () => ({\n value,\n rejectedFiles,\n disabled,\n empty,\n dropTarget,\n inputId,\n labelId,\n name: field.name ?? name,\n accept: acceptAttribute(accept),\n multiple: maxFiles > 1,\n capture,\n required,\n locale,\n attributes,\n setLabelled,\n setInput,\n setTrigger,\n setDropzone,\n setDropTarget,\n pick,\n openDialog,\n remove,\n clear,\n }),\n [\n value,\n rejectedFiles,\n disabled,\n empty,\n dropTarget,\n inputId,\n labelId,\n field.name,\n name,\n accept,\n maxFiles,\n capture,\n required,\n locale,\n attributes,\n setInput,\n setTrigger,\n setDropzone,\n pick,\n openDialog,\n remove,\n clear,\n ],\n );\n const content = typeof children === \"function\" ? children(state) : children;\n return (\n <FileUploadContext.Provider value={context}>\n {renderElement(\n \"div\",\n {\n ...props,\n children: (\n <>\n {content}\n <span\n ref={announcer}\n aria-live=\"polite\"\n aria-atomic=\"true\"\n data-primitives-part=\"file-upload-announcer\"\n style={LIVE_REGION_STYLE}\n />\n </>\n ),\n },\n state,\n {\n role: \"group\",\n \"aria-labelledby\": field.inField\n ? field.aria[\"aria-labelledby\"]\n : labelled\n ? labelId\n : undefined,\n \"aria-describedby\": field.aria[\"aria-describedby\"],\n \"aria-invalid\": field.aria[\"aria-invalid\"],\n \"data-primitives-part\": \"file-upload-root\",\n ...attributes,\n onFocus: field.onFocus,\n onBlur: (event: FocusEvent<HTMLElement>) => {\n if (\n !event.currentTarget.contains(\n event.relatedTarget as Node | null,\n )\n ) {\n field.onBlur();\n }\n },\n },\n setRoot,\n )}\n </FileUploadContext.Provider>\n );\n}\n","import { useRequiredContext } from \"../../hooks/use-required-context.ts\";\nimport { type PartProps, renderElement } from \"../../utils/render-element.tsx\";\nimport {\n FileUploadContext,\n type FileUploadState,\n fileUploadState,\n} from \"./file-upload-context.ts\";\n\nexport type FileUploadTriggerProps = PartProps<FileUploadState>;\n\n/** The button that opens the file dialog (spec/file-upload.md). */\nexport function FileUploadTrigger(props: FileUploadTriggerProps) {\n const context = useRequiredContext(FileUploadContext, \"FileUpload.Trigger\");\n return renderElement(\n \"button\",\n props,\n fileUploadState(context),\n {\n type: \"button\",\n disabled: context.disabled,\n \"data-primitives-part\": \"file-upload-trigger\",\n ...context.attributes,\n onClick: context.openDialog,\n },\n context.setTrigger,\n );\n}\n","import { FileUploadClearTrigger } from \"./file-upload-clear-trigger.tsx\";\nimport { FileUploadDropzone } from \"./file-upload-dropzone.tsx\";\nimport { FileUploadHiddenInput } from \"./file-upload-hidden-input.tsx\";\nimport { FileUploadItem } from \"./file-upload-item.tsx\";\nimport { FileUploadItemDeleteTrigger } from \"./file-upload-item-delete-trigger.tsx\";\nimport { FileUploadItemGroup } from \"./file-upload-item-group.tsx\";\nimport { FileUploadItemName } from \"./file-upload-item-name.tsx\";\nimport { FileUploadItemPreview } from \"./file-upload-item-preview.tsx\";\nimport { FileUploadItemPreviewImage } from \"./file-upload-item-preview-image.tsx\";\nimport { FileUploadItemSizeText } from \"./file-upload-item-size-text.tsx\";\nimport { FileUploadLabel } from \"./file-upload-label.tsx\";\nimport { FileUploadRoot } from \"./file-upload-root.tsx\";\nimport { FileUploadTrigger } from \"./file-upload-trigger.tsx\";\n\n/** spec/file-upload.md */\nexport const FileUpload = {\n Root: FileUploadRoot,\n Label: FileUploadLabel,\n Dropzone: FileUploadDropzone,\n Trigger: FileUploadTrigger,\n HiddenInput: FileUploadHiddenInput,\n ItemGroup: FileUploadItemGroup,\n Item: FileUploadItem,\n ItemName: FileUploadItemName,\n ItemSizeText: FileUploadItemSizeText,\n ItemPreview: FileUploadItemPreview,\n ItemPreviewImage: FileUploadItemPreviewImage,\n ItemDeleteTrigger: FileUploadItemDeleteTrigger,\n ClearTrigger: FileUploadClearTrigger,\n};\n"],"mappings":";;;;;;;;;;;;;AAyCA,MAAa,oBAAoB,cAC7B,IACJ;AAEA,SAAgB,gBACZ,SACe;CACf,OAAO;EACH,OAAO,QAAQ;EACf,eAAe,QAAQ;EACvB,UAAU,QAAQ;EAClB,OAAO,QAAQ;EACf,YAAY,QAAQ;CACxB;AACJ;AAiBA,MAAa,wBACT,cAAiD,IAAI;;;AC7DzD,SAAgB,uBAAuB,OAAoC;CACvE,MAAM,UAAU,mBACZ,mBACA,yBACJ;CACA,OAAO,cAAc,UAAU,OAAO,gBAAgB,OAAO,GAAG;EAC5D,MAAM;EACN,UAAU,QAAQ;EAClB,QAAQ,QAAQ,SAAS,QAAQ,cAAc,WAAW;EAC1D,wBAAwB;EACxB,GAAG,QAAQ;EACX,UAAU,UACN,QAAQ,MAAM,MAAM,WAAW;CACvC,CAAC;AACL;;;;;;ACPA,SAAgB,mBAAmB,OAAgC;CAC/D,MAAM,UAAU,mBACZ,mBACA,qBACJ;CACA,MAAM,CAAC,SAAS,cAAc,WAAwB;CACtD,MAAM,EAAE,aAAa,eAAe,aAAa;CACjD,MAAM,MAAM,cACF,UAAU,YAAY,WAAW,GACvC,CAAC,YAAY,WAAW,CAC5B;CACA,MAAM,aAAa,kBAAkB,SAAS;EAC1C;EACA,SAAS,QAAQ;EACjB,qBAAq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CACJ,IACA;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA,MAAM;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACJ,CACJ;CACA,MAAM,UAAU,OAAO,aAAa,aAAa,SAAS,KAAK,IAAI;CACnE,OACI,oBAAC,kBAAkB,UAAnB;EAA4B,OAAO;EAC9B,UAAA,cACG,OACA;GACI,GAAG;GACH,UACI,qBAAA,UAAA,EAAA,UAAA,CACK,SACD,oBAAC,QAAD;IACI,KAAK;IACL,aAAU;IACV,eAAY;IACZ,wBAAqB;IACrB,OAAO;GACV,CAAA,CACH,EAAA,CAAA;EAEV,GACA,OACA;GACI,MAAM;GACN,mBAAmB,MAAM,UACnB,MAAM,KAAK,qBACX,WACE,UACA,KAAA;GACR,oBAAoB,MAAM,KAAK;GAC/B,gBAAgB,MAAM,KAAK;GAC3B,wBAAwB;GACxB,GAAG;GACH,SAAS,MAAM;GACf,SAAS,UAAmC;IACxC,IACI,CAAC,MAAM,cAAc,SACjB,MAAM,aACV,GAEA,MAAM,OAAO;GAErB;EACJ,GACA,OACJ;CACwB,CAAA;AAEpC;;;AC/XA,SAAgB,kBAAkB,OAA+B;CAC7D,MAAM,UAAU,mBAAmB,mBAAmB,oBAAoB;CAC1E,OAAO,cACH,UACA,OACA,gBAAgB,OAAO,GACvB;EACI,MAAM;EACN,UAAU,QAAQ;EAClB,wBAAwB;EACxB,GAAG,QAAQ;EACX,SAAS,QAAQ;CACrB,GACA,QAAQ,UACZ;AACJ;;;ACXA,MAAa,aAAa;CACtB,MAAM;CACN,OAAO;CACP,UAAU;CACV,SAAS;CACT,aAAa;CACb,WAAW;CACX,MAAM;CACN,UAAU;CACV,cAAc;CACd,aAAa;CACb,kBAAkB;CAClB,mBAAmB;CACnB,cAAc;AAClB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { n as ChangeReason, t as ChangeDetails } from "./change-details-CPSkPCNw.js";
|
|
2
|
+
import { n as RenderProp } from "./render-element-Pwuv2wsL.js";
|
|
3
|
+
import { _ as FileUploadHiddenInputProps, a as FileUpload, b as FileUploadItemState, c as FileUploadRootProps, d as FileUploadItemPreviewImageProps, f as FileUploadItemPreviewProps, g as FileUploadItemProps, h as FileUploadItemDeleteTriggerProps, i as FileRejectionReason, l as FileUploadLabelProps, m as FileUploadItemGroupProps, n as FileAccept, o as FileUploadTriggerProps, p as FileUploadItemNameProps, r as FileRejection, s as FileUploadPickDetails, t as CheckedFile, u as FileUploadItemSizeTextProps, v as FileUploadDropzoneProps, x as FileUploadState, y as FileUploadClearTriggerProps } from "./index-DHrnPQEE.js";
|
|
4
|
+
export { type ChangeDetails, type ChangeReason, type CheckedFile, type FileAccept, type FileRejection, type FileRejectionReason, FileUpload, type FileUploadClearTriggerProps, type FileUploadDropzoneProps, type FileUploadHiddenInputProps, type FileUploadItemDeleteTriggerProps, type FileUploadItemGroupProps, type FileUploadItemNameProps, type FileUploadItemPreviewImageProps, type FileUploadItemPreviewProps, type FileUploadItemProps, type FileUploadItemSizeTextProps, type FileUploadItemState, type FileUploadLabelProps, type FileUploadPickDetails, type FileUploadRootProps, type FileUploadState, type FileUploadTriggerProps, type RenderProp };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as FileUpload } from "./file-upload-BIRibICU.js";
|